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

Legend:

Unmodified
Added
Removed
  • 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              {
Note: See TracChangeset for help on using the changeset viewer.