Changeset 6820 for trunk/MagicSoft


Ignore:
Timestamp:
03/15/05 11:10:55 (20 years ago)
Author:
tbretz
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/Changelog

    r6819 r6820  
    2121
    2222                                                 -*-*- END OF LINE -*-*-
    23  2005/03/14 Toni Coarasa
    24    Please use the new CVS
    25 
    2623 2005/03/14 Thomas Bretz
    2724
    2825   * mbase/MGMenu.h:
    2926     - added a fix for root 4.02.00
     27
     28
     29 2005/03/14 Markus Gaug
     30
     31   * mcalib/MCalibrateData.cc
     32     - catch the case that now high-gain low-gian intercalibration const.
     33       is available.
     34
     35   * mjobs/MJPedestal.cc
     36     - modify option for pedy*.root: from UPDATE to RECREATE
     37
     38
     39
     40 2005/03/11 Markus Gaug
     41
     42   * callisto.rc
     43     - changed default weights for DF to cosmics_weights4.dat. (This has
     44       turned out to be the most stable set of weights).
     45
     46   * mjobs/MJCalibration.cc
     47     - some cosmetic changes in the output
     48     - in case of WriteHists(), do not overwrite existing signal*.root
     49       file, but append histograms (bugfix!)
     50
     51
     52
     53 2005/03/10 Toni Coarasa (With Nadia's and Alessandro's inside)
     54
     55   * mjobs/MJCut.cc
     56     - inclusion of (TString) to avoid compiler error under 2.95.3
     57
     58   * sinope.cc
     59     - inclusion of <errno.h> to avoid compiler error under 2.95.3
     60
     61
     62
     63 2005/03/10 Markus Gaug
     64
     65   * msignal/MExtractTimeAndCharge.cc
     66     - set fgLoGainStartShift to -4.0
     67     - put a check to avoid a dynamic low-gain range < 0 (should not
     68       occur with current extractors, but one never knows...)
     69
     70   * msignal/MExtractor.[h,cc]
     71     - introduced Clear()-function, used in SetRange()
     72
     73   * mjobs/MJCalibrateSignal.cc
     74     - changed order of initialization of the 2 MWriteRootFiles whereupon
     75       the crash goes away. Have to revise the /dev/null work-around
     76       in MWriteRootFile!
    3077
    3178
  • trunk/MagicSoft/Mars/mcalib/MCalibrateData.cc

    r6199 r6820  
    669669            if (sig.IsLoGainUsed())
    670670            {
    671                 signal    = sig.GetExtractedSignalLoGain()*fHiLoConv   [pixidx];
    672                 signalErr = sig.GetExtractedSignalLoGain()*fHiLoConvErr[pixidx];
     671              if (fHiLoConv[pixidx] < 0.5)
     672                {
     673                  signal    = sig.GetExtractedSignalHiGain()*1.5;
     674                  signalErr = sig.GetExtractedSignalHiGain()*2.;
     675                }
     676              else
     677                {
     678                  signal    = sig.GetExtractedSignalLoGain()*fHiLoConv   [pixidx];
     679                  signalErr = sig.GetExtractedSignalLoGain()*fHiLoConvErr[pixidx];
     680                }
    673681            }
    674682            else
  • trunk/MagicSoft/Mars/mjobs/MJCalibrateSignal.cc

    r6798 r6820  
    159159Bool_t MJCalibrateSignal::WriteResult(TObjArray &cont)
    160160{
    161     const TString name(Form("signal%08d.root", fSequence.GetSequence()));
    162     return WriteContainer(cont, name);
     161  if (IsNoStorage())
     162    return kTRUE;
     163
     164  const TString name(Form("signal%08d.root", fSequence.GetSequence()));
     165  return WriteContainer(cont, name);
    163166}
    164167
     
    367370
    368371    *fLog << all;
    369     if (extractor1)
    370     {
    371         *fLog << underline << "Signal Extractor found in calibration file" << endl;
    372         extractor1->Print();
    373         *fLog << endl;
    374         extractor3 = (MExtractor*)extractor1->Clone();
    375        
    376     }
    377     else
    378         *fLog << inf << "No Signal Extractor: ExtractSignal in file." << endl;
    379 
    380     if (extractor2)
    381     {
    382         *fLog << underline << "Time Extractor found in calibration file" << endl;
    383         extractor2->Print();
    384         *fLog << endl;
    385     }
    386     else
    387         *fLog << inf << "No Time Extractor: ExtractTime in file." << endl;
    388 
    389372    if (!geom.IsNull())
    390373        *fLog << inf << "Camera geometry found in file: " << geom << endl;
     
    395378      if (!ReadExtractorCosmics(extractor1))
    396379        *fLog << warn << "No extraction window update for signal extractor found" << endl;
     380
     381    if (extractor1)
     382    {
     383      *fLog << underline << "Signal Extractor found in calibration file" << endl;
     384      extractor1->Print();
     385      *fLog << endl;
     386      extractor3 = (MExtractor*)extractor1->Clone();
     387    }
     388    else
     389      *fLog << inf << "No Signal Extractor: ExtractSignal in file." << endl;
     390
     391    if (extractor2)
     392    {
     393        *fLog << underline << "Time Extractor found in calibration file" << endl;
     394        extractor2->Print();
     395        *fLog << endl;
     396    }
     397    else
     398        *fLog << inf << "No Time Extractor: ExtractTime in file." << endl;
    397399
    398400    // This is necessary for the case in which it is not in the files
     
    436438    const TString fname(Form("%s{s/_D_/_Y_}{s/.raw$/.root}", fPathOut.Data()));
    437439
    438     // Write the special MC tree
    439     MWriteRootFile writemc(2, fname, fOverwrite?"RECREATE":"NEW");
    440     writemc.SetName("WriteMC");
    441     writemc.AddContainer("MMcEvtBasic", "OriginalMC");
    442 
     440   
    443441    // Skips empty MC events (Not necessary, but faster!)
    444442    MContinue contmc("MRawEvtData.GetNumPixels<0.5", "ContEmptyMC");
     
    689687    write.AddContainer("MTimeCC",                   "CC",         kFALSE);
    690688
     689    // Write the special MC tree
     690    MWriteRootFile writemc(2, fname, fOverwrite?"RECREATE":"NEW");
     691    writemc.SetName("WriteMC");
     692    writemc.AddContainer("MMcEvtBasic", "OriginalMC");
     693
    691694    // Now setup tasklist for events
    692695    MTaskList tlist2;
     
    836839      interlacedcont.Add(&hilcam);
    837840
     841    if (IsHistsStorage())
     842      {
     843        interlacedcont.Add(plist.FindObject("MHCalibrationHiLoCam"));
     844        interlacedcont.Add(plist.FindObject("MHCalibrationPulseTimeCam"));
     845      }
     846   
    838847    if (!WriteResult(interlacedcont))
    839848      return kFALSE;
    840849
    841     //    if (IsHistsStorage())
    842     //      {
    843     //        addcont.Add(plist.FindObject("MHCalibrationHiLoCam"));
    844     //        addcont.Add(plist.FindObject("MHCalibrationPulseTimeCam"));
    845     //      }
    846    
    847850    // return if job went ok
    848851    *fLog << all << GetDescriptor() << ": Done." << endl;
  • trunk/MagicSoft/Mars/mjobs/MJCalibration.cc

    r6777 r6820  
    177177const Int_t MJCalibration::gkThirdBlindPixelInstallation   = 43308;
    178178const TString MJCalibration::fgReferenceFile = "mjobs/calibrationref.rc";
    179 const TString MJCalibration::fgHiLoCalibFile = "mjobs/hilocalib_df6.root";
     179const TString MJCalibration::fgHiLoCalibFile = "mjobs/hilocalib_df4.root";
    180180// --------------------------------------------------------------------------
    181181//
     
    14821482  MCalibrationHiLoCam hilocam;
    14831483 
     1484  *fLog << all << "Initializing High gain vs. Low gain intercalibration from " << fHiLoCalibFile << endl;
     1485  *fLog << all << endl;
     1486
    14841487  if (hilocam.Read()<=0)
    14851488  {
     
    17121715    }
    17131716
    1714     //if (!CheckEnv())
    1715     //    return kFALSE;
    1716 
    1717     if (!CheckEnv())
    1718       return kFALSE;
    1719 
    17201717    // --------------------------------------------------------------------------------
    17211718
     
    17321729    // --------------------------------------------------------------------------------
    17331730   
     1731    if (!CheckEnv())
     1732      return kFALSE;
     1733
     1734    // --------------------------------------------------------------------------------
     1735
    17341736    // Setup Tasklist
    17351737    MParList plist;
     
    19751977    tlist.PrintStatistics();
    19761978
    1977   if (fIsPixelCheck)
    1978     {
    1979       MHCalibrationChargeCam *hcam = (MHCalibrationChargeCam*)plist.FindObject("MHCalibrationChargeCam");
    1980       MHCalibrationChargePix &pix1 = (MHCalibrationChargePix&)(*hcam)[fCheckedPixId];
    1981       pix1.DrawClone("");
    1982      
    1983       MHCalibrationChargePix &pix2 = (MHCalibrationChargePix&)(*hcam)(fCheckedPixId);
    1984       pix2.DrawClone("");
    1985      
    1986       if (IsRelTimes())
    1987         {
    1988           MHCalibrationRelTimeCam *hccam = (MHCalibrationRelTimeCam*)plist.FindObject("MHCalibrationRelTimeCam");
    1989           MHCalibrationPix &pix11 = (*hccam)[fCheckedPixId];
    1990           pix11.DrawClone("");
    1991           MHCalibrationPix &pix12 = (*hccam)(fCheckedPixId);
    1992           pix12.DrawClone("");
    1993         }
    1994     }
    1995 
     1979    // --------------------------------------------------------------------------------
     1980
     1981    if (fIsPixelCheck)
     1982      {
     1983        MHCalibrationChargeCam *hcam = (MHCalibrationChargeCam*)plist.FindObject("MHCalibrationChargeCam");
     1984        MHCalibrationChargePix &pix1 = (MHCalibrationChargePix&)(*hcam)[fCheckedPixId];
     1985        pix1.DrawClone("");
     1986       
     1987        MHCalibrationChargePix &pix2 = (MHCalibrationChargePix&)(*hcam)(fCheckedPixId);
     1988        pix2.DrawClone("");
     1989       
     1990        if (IsRelTimes())
     1991          {
     1992            MHCalibrationRelTimeCam *hccam = (MHCalibrationRelTimeCam*)plist.FindObject("MHCalibrationRelTimeCam");
     1993            MHCalibrationPix &pix11 = (*hccam)[fCheckedPixId];
     1994            pix11.DrawClone("");
     1995            MHCalibrationPix &pix12 = (*hccam)(fCheckedPixId);
     1996            pix12.DrawClone("");
     1997          }
     1998      }
     1999   
    19962000    if (!fCalibrationPINDiode.IsValid())
    1997         SetUsePINDiode(kFALSE);
    1998 
     2001      SetUsePINDiode(kFALSE);
     2002   
    19992003    DisplayResult(plist);
    2000 
     2004   
    20012005    if (!WriteResult(plist))
    2002         return kFALSE;
    2003 
     2006      return kFALSE;
     2007   
    20042008    *fLog << all << GetDescriptor() << ": Done." << endl;
    2005 
     2009   
    20062010    return kTRUE;
    20072011}
  • trunk/MagicSoft/Mars/mjobs/MJCut.cc

    r6530 r6820  
    347347    TString fname0(path);
    348348    TString fname1(path);
    349     fname0 += fNameSummary.IsNull() ? Form("ganymed%08d-summary.root", set.GetNumAnalysis()) : fNameSummary;
    350     fname1 += fNameResult.IsNull()  ? Form("ganymed%08d-result.root",  set.GetNumAnalysis()) : fNameResult;
     349    fname0 += fNameSummary.IsNull() ?  (TString) Form("ganymed%08d-summary.root", set.GetNumAnalysis()) : fNameSummary;
     350    fname1 += fNameResult.IsNull()  ?  (TString) Form("ganymed%08d-result.root",  set.GetNumAnalysis()) : fNameResult;
    351351
    352352    MWriteRootFile write0(fPathOut.IsNull()?0:fname0.Data(), fOverwrite?"RECREATE":"NEW");
  • trunk/MagicSoft/Mars/mjobs/MJPedestal.cc

    r6785 r6820  
    179179    const TString fname = GetOutputFile();
    180180
     181    const Bool_t fileexist = !gSystem->AccessPathName(fname, kFileExists);
     182    if (!fileexist)
     183      {
     184        *fLog << inf << "Input file " << fname << " not found, will create pedestals" << endl;
     185        return kFALSE;
     186      }
     187
    181188    *fLog << inf << "Reading pedestals from file: " << fname << endl;
    182189
     
    242249  *fLog << inf << "Updating extractor in file: " << fname << endl;
    243250
    244   TFile file(fname, "UPDATE");
     251  TFile file(fname, fOverwrite?"RECREATE":"NEW");
    245252  if (!file.IsOpen())
    246253    {
    247254      *fLog << err << dbginf << "ERROR - Could not open file " << fname << endl;
     255      *fLog << err << dbginf << "Maybe, file " << fname << " already exists, call callisto with option -f then." << endl;
    248256      return kFALSE;
    249257    }
     
    252260  cont.Add(fExtractor);
    253261
    254   return WriteContainer(cont,name, fOverwrite?"RECREATE":"NEW");
     262  return WriteContainer(cont);
    255263}
    256264
     
    914922        if (fRuns && fRuns->GetNumRuns() != fRuns->GetNumEntries())
    915923        {
    916             *fLog << err << "Number of files found doesn't match number of runs... abort." << endl;
     924            *fLog << err << "Number of files found doesn't match number of runs... abort."
     925                << fRuns->GetNumRuns() << " vs. " << fRuns->GetNumEntries() << endl;
    917926            return kFALSE;
    918927        }
     
    10071016   
    10081017    MHPedestalCam hpedcam;
    1009     hpedcam.SetRenorm(kTRUE);
     1018    if (fExtractionType != kFundamental)
     1019      hpedcam.SetRenorm(kTRUE);
    10101020    //    fPedestalHist.SetRenorm(kTRUE);
    10111021    //    fPedestalHist.SetPedestalsOut(&fPedestalCamOut);
     1022    hpedcam.SetPedestalsOut(&fPedestalCamOut);
    10121023
    10131024    MPedestalCam pedinter;
     
    10381049    sel.SetNumSelectEvts(0);
    10391050     
    1040     if (fExtractionType!=kFundamental && fExtractor)
     1051    if (fExtractor)
    10411052      {
    10421053        fExtractor->SetFilter(&sel);
     
    10771088   
    10781089    if (fIsUseHists)
    1079     {
     1090      {
     1091        if (fExtractor->InheritsFrom("MExtractTimeAndCharge"))
     1092          hpedcam.SetFitStart(-10.*((MExtractTimeAndCharge*)fExtractor)->GetWindowSizeHiGain());
     1093       
    10801094        pedcalc.SetIntermediateStorage();
    10811095        pedlogain.SetIntermediateStorage();
     
    12481262            const Float_t meanpulsetime = cam->GetAverageArea(0).GetHiGainMean();
    12491263            const Float_t rmspulsetime = cam->GetAverageArea(0).GetHiGainRms();
    1250             *fLog << inf << "Mean pulse time (cosmics): " << meanpulsetime << "+-" << rmspulsetime << endl;
     1264            *fLog << all << "Mean pulse time (cosmics): " << meanpulsetime << "+-" << rmspulsetime << endl;
    12511265            const Int_t newfirst = (Int_t)(meanpulsetime-fExtractWinLeft);
    12521266            Int_t wshigain = fExtractor->InheritsFrom("MExtractTimeAndCharge")
     
    12551269            if (wshigain > 6)
    12561270              wshigain = 6;
    1257             const Int_t wslogain = fExtractor->InheritsFrom("MExtractTimeAndCharge")
     1271            Int_t wslogain = fExtractor->InheritsFrom("MExtractTimeAndCharge")
    12581272              ? ((MExtractTimeAndCharge*)fExtractor)->GetWindowSizeLoGain()
    12591273              : 6;
     1274            if (wslogain > 6)
     1275              wslogain = 6;
    12601276            const Int_t newlast  = (Int_t)(meanpulsetime+fExtractWinRight);
    1261             *fLog << inf << "Try to set new range limits: ("<<newfirst<<","<<newlast<<"+"<<wshigain
    1262                   <<","<<newfirst<<","<<newlast<<"+"<<wslogain<<")"<<endl;
     1277            *fLog << all << underline
     1278                  << "Try to set new range limits: ("<<newfirst<<","<<newlast<<"+"<<wshigain
     1279                  <<","<<newfirst-1<<","<<newlast<<"+"<<wslogain<<")"<<endl;
    12631280            if (newfirst < 0)
    12641281              {
     
    12741291            if (newlast+wslogain > data->GetNumLoGainSamples())
    12751292              {
    1276                 *fLog << err << "Pulse is too much to the right, cannot go beyond logain limits! "
    1277                       << " Try to use a different extractor ... " << endl;
     1293                *fLog << err << "Pulse is too much to the right, cannot go beyond logaie limits! " << endl;
     1294                *fLog << endl;
     1295                *fLog << "Try to use a different extractor (e.g. with a window size of only 4 sl.) or:" << endl;
     1296                *fLog << "Set the limit to a lower value (callisto.rc: line 310): " << endl;
     1297                *fLog << "    MJPedestalY2:ExtractWinRight: 5.0           " << endl;
     1298                *fLog << "(ATTENTION, you will lose late cosmics pulses!)" << endl;
     1299                *fLog << endl;
    12781300                return kFALSE;
    12791301              }
    1280             fExtractor->SetRange(newfirst,newlast+wshigain,newfirst,data->GetNumLoGainSamples()-1);
     1302            fExtractor->SetRange(newfirst,newlast+wshigain,
     1303                                 newfirst>0?newfirst-1:newfirst,data->GetNumLoGainSamples()-1);
    12811304            if (!WriteExtractor())
    12821305              {
  • trunk/MagicSoft/Mars/msignal/MExtractTimeAndCharge.cc

    r6798 r6820  
    8585using namespace std;
    8686
    87 const Float_t MExtractTimeAndCharge::fgLoGainStartShift = -2.8;
     87const Float_t MExtractTimeAndCharge::fgLoGainStartShift = -4.0;
    8888const Byte_t  MExtractTimeAndCharge::fgLoGainSwitch = 120;
    8989// --------------------------------------------------------------------------
     
    217217          fLoGainFirstSave = fLoGainFirst;
    218218          const Byte_t logainstart = sathi
    219             ? (sathi > (Int_t)fLoGainStartShift ? sathi + (Int_t)fLoGainStartShift : fLoGainFirst)
    220             : (Byte_t)(timehi + fLoGainStartShift);
     219            ? (sathi > (Int_t)(-fLoGainStartShift) ? sathi + (Int_t)fLoGainStartShift : fLoGainFirst)
     220            : (timehi+fLoGainStartShift > 0. ? (Byte_t)(timehi + fLoGainStartShift) : fLoGainFirst);
    221221          fLoGainFirst = logainstart > fLoGainFirstSave ? logainstart : fLoGainFirstSave;
    222222
  • trunk/MagicSoft/Mars/msignal/MExtractor.cc

    r6254 r6820  
    133133void MExtractor::SetRange(Byte_t hifirst, Byte_t hilast, Byte_t lofirst, Byte_t lolast)
    134134{
    135     fHiGainFirst = hifirst;
    136     fHiGainLast  = hilast;
    137 
    138     fLoGainFirst = lofirst;
    139     fLoGainLast  = lolast;
     135 
     136  Clear();
     137
     138  fHiGainFirst = hifirst;
     139  fHiGainLast  = hilast;
     140 
     141  fLoGainFirst = lofirst;
     142  fLoGainLast  = lolast;
    140143}
    141144
  • trunk/MagicSoft/Mars/msignal/MExtractor.h

    r5976 r6820  
    7272  MExtractor(const char *name=NULL, const char *title=NULL);
    7373 
     74  void Clear(Option_t *o="")
     75    {
     76      fHiGainFirst = fHiGainLast = fLoGainFirst = fLoGainLast = fHiLoLast = 0;
     77    }
     78
    7479  Byte_t  GetHiGainFirst()      const { return fHiGainFirst;      }
    7580  Byte_t  GetHiGainLast ()      const { return fHiGainLast ;      }
  • trunk/MagicSoft/Mars/sinope.cc

    r6604 r6820  
     1#include <errno.h>
    12#include <fstream>
    23
Note: See TracChangeset for help on using the changeset viewer.