Changeset 4014 for trunk


Ignore:
Timestamp:
05/07/04 18:49:24 (21 years ago)
Author:
gaug
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/Changelog

    r4009 r4014  
    2020
    2121 2004/05/07: Markus Gaug
     22 
     23   * mjobs/MExtractCalibTest.cc
     24     - include write-out of the containers in the loop
    2225
    2326   * mjobs/MJCalibration.cc
  • trunk/MagicSoft/Mars/mjobs/MJExtractCalibTest.cc

    r3982 r4014  
    148148}
    149149
    150 TString MJExtractCalibTest::GetOutputFileD() const
     150TString MJExtractCalibTest::GetOutputFile() const
    151151{
    152152  if (!fRuns)
    153153    return "";
    154154 
    155   return Form("%s/%s-F3.root", (const char*)fOutputPath, (const char*)fRuns->GetRunsAsFileName());
    156 }
    157 
    158 TString MJExtractCalibTest::GetOutputFileT() const
    159 {
    160   if (!fRuns)
    161     return "";
    162  
    163   return Form("%s/%s-F4.root", (const char*)fOutputPath, (const char*)fRuns->GetRunsAsFileName());
    164 }
    165 
    166 TString MJExtractCalibTest::GetOutputFileP() const
    167 {
    168   if (!fRuns)
    169     return "";
    170 
    171   return Form("%s/%s-F2.root", (const char*)fOutputPath, (const char*)fRuns->GetRunsAsFileName());
    172 }
     155  return Form("%s/%s-Test.root", (const char*)fOutputPath, (const char*)fRuns->GetRunsAsFileName());
     156}
     157
    173158
    174159Bool_t MJExtractCalibTest::ProcessD(MPedestalCam &pedcam, MCalibrationChargeCam &calcam, MCalibrationQECam &qecam)
    175160{
    176   const TString fname = GetOutputFileD();
     161  const TString fname = GetOutputFile();
    177162 
    178163  if (gSystem->AccessPathName(fname, kFileExists))
     
    200185  *fLog << endl;
    201186 
    202   MCerPhotEvt          cerphot;
    203 
     187  MCerPhotEvt    cerphot;
     188  MPedPhotCam    pedphot;
    204189  // Setup Lists
    205190  MParList plist;
     
    208193  plist.AddToList(&qecam);
    209194  plist.AddToList(&cerphot);
     195  plist.AddToList(&pedphot);
    210196  plist.AddToList(&fTestCam);
    211197  plist.AddToList(&fBadPixels);
    212  
     198
    213199  MTaskList tlist;
    214200  plist.AddToList(&tlist);
     
    223209  MCalibrate            photcalc;
    224210  photcalc.SetCalibrationMode(MCalibrate::kFfactor);
     211  MPedPhotCalc    pedphotcalc; 
    225212
    226213  MHCamEvent evt("ExtSignal");
     
    231218  fillcam.SetNameTab("Test");
    232219
    233   /*
    234   MWriteRootFile write(GetOutputFileD(), "RECREATE", fRuns->GetRunsAsString(), 2);
    235   write.AddContainer("MExtractedSignalCam", "Events");
    236   write.AddContainer("MTime",               "Events");
    237   write.AddContainer("MRawEvtHeader",       "Events");
    238   write.AddContainer("MPedestalCam",        "RunHeaders");
    239   write.AddContainer("MRawRunHeader",       "RunHeaders");
    240   write.AddContainer("MBadPixelsCam",       "RunHeaders");
    241   */
    242220
    243221  tlist.AddToList(&read);
     
    254232
    255233  //  if (TestBit(kEnableGraphicalOutput))
    256     tlist.AddToList(&fill);
     234  tlist.AddToList(&fill);
    257235  tlist.AddToList(&photcalc);
     236  tlist.AddToList(&pedphotcalc);
    258237  tlist.AddToList(&fillcam);
    259238 
     239  MWriteRootFile write(GetOutputFile(),    "RECREATE", fRuns->GetRunsAsString(), 2);
     240  write.AddContainer(&pedcam               , "RunHeaders" );
     241  write.AddContainer(&pedphot              , "RunHeaders" );
     242  write.AddContainer(&calcam               , "Events"     );
     243  write.AddContainer(&qecam                , "Events"     );
     244  write.AddContainer(&fBadPixels           , "RunHeaders" );
     245  write.AddContainer("MHCalibrationTestCam", "Events"     );
     246  //  write.AddContainer(&testtime );
     247  tlist.AddToList(&write);
     248
    260249  // Create and setup the eventloop
    261250  MEvtLoop evtloop(fName);
     
    282271Bool_t MJExtractCalibTest::ProcessT(MPedestalCam &pedcam, MCalibrationRelTimeCam &relcam)
    283272{
    284   const TString fname = GetOutputFileT();
     273  const TString fname = GetOutputFile();
    285274 
    286275  if (gSystem->AccessPathName(fname, kFileExists))
     
    313302  // Setup Lists
    314303  MParList plist;
    315   plist.AddToList(&pedcam);
    316304  plist.AddToList(&relcam);
    317305  plist.AddToList(&arrtime);
    318   plist.AddToList(&fTestCam);
     306  plist.AddToList(&fTestTimeCam);
    319307  plist.AddToList(&fBadPixels);
    320308 
     
    338326  fillcam.SetNameTab("TestTime");
    339327
    340   /*
    341   MWriteRootFile write(GetOutputFileD(), "RECREATE", fRuns->GetRunsAsString(), 2);
    342   write.AddContainer("MExtractedSignalCam", "Events");
    343   write.AddContainer("MTime",               "Events");
    344   write.AddContainer("MRawEvtHeader",       "Events");
    345   write.AddContainer("MPedestalCam",        "RunHeaders");
    346   write.AddContainer("MRawRunHeader",       "RunHeaders");
    347   write.AddContainer("MBadPixelsCam",       "RunHeaders");
    348   */
    349 
    350328  tlist.AddToList(&read);
    351329  tlist.AddToList(&apply);
     
    356334    {
    357335      *fLog << warn << GetDescriptor()
    358             << ": No extractor has been chosen, take default MExtractSlidingWindow " << endl;
     336            << ": No extractor has been chosen, take default MExtractTimeFastSpline " << endl;
    359337      tlist.AddToList(&extract);
    360338    }
     
    365343  tlist.AddToList(&fillcam);
    366344 
     345  MWriteRootFile write(GetOutputFile(), "UPDATE", fRuns->GetRunsAsString(), 2);
     346  write.AddContainer(&relcam                   , "Events"     );
     347  write.AddContainer(&fBadPixels               , "RunHeaders" );
     348  write.AddContainer("MHCalibrationTestCam"    , "Events"     );
     349  write.AddContainer("MHCalibrationTestTimeCam", "Events"     );
     350  write.AddContainer("MArrivalTimeCam"         , "Events"     );
     351
    367352  // Create and setup the eventloop
    368353  MEvtLoop evtloop(fName);
     
    390375Bool_t MJExtractCalibTest::ReadPedPhotCam()
    391376{
    392     const TString fname = GetOutputFileP();
     377    const TString fname = GetOutputFile();
    393378
    394379    if (gSystem->AccessPathName(fname, kFileExists))
     
    424409}
    425410
    426 Bool_t MJExtractCalibTest::ProcessP(MPedestalCam &pedcam, MCalibrationChargeCam &calcam, MCalibrationQECam &qecam)
    427 {
    428     if (!ReadPedPhotCam())
    429         return ProcessFileP(pedcam, calcam, qecam);
    430 
    431     return kTRUE;
    432 }
    433 
    434 Bool_t MJExtractCalibTest::ProcessFileP(MPedestalCam &pedcam, MCalibrationChargeCam &calcam, MCalibrationQECam &qecam)
    435 {
    436     if (!fRuns)
    437     {
    438         *fLog << err << "No Runs choosen... abort." << endl;
    439         return kFALSE;
    440     }
    441     if (fRuns->GetNumRuns() != fRuns->GetNumEntries())
    442     {
    443         *fLog << err << "Number of files found doesn't match number of runs... abort." << endl;
    444         return kFALSE;
    445     }
    446 
    447     *fLog << inf;
    448     fLog->Separator(GetDescriptor());
    449     *fLog << "Calculate MExtractedSignalCam from Runs " << fRuns->GetRunsAsString() << endl;
    450     *fLog << endl;
    451 
    452     MReadMarsFile read("Events");
    453     read.DisableAutoScheme();
    454     static_cast<MRead&>(read).AddFiles(*fRuns);
    455 
    456     // Setup Tasklist
    457     MParList plist;
    458     plist.AddToList(&pedcam);
    459     plist.AddToList(&calcam);
    460     plist.AddToList(&fPedPhotCam);
    461     plist.AddToList(&fBadPixels);
    462 
    463     MTaskList tlist;
    464     plist.AddToList(&tlist);
    465 
    466     MGeomApply            apply; // Only necessary to craete geometry
    467     MExtractSlidingWindow extract2;
    468     MCalibrate            calib;
    469     MPedPhotCalc          calc;
    470 
    471     MHCamEvent evt1("ExtOffset");
    472     MHCamEvent evt2("CalOffset");
    473     evt1.SetType(0);
    474     evt2.SetType(0);
    475     MFillH fill1(&evt1, "MExtractedSignalCam", "FillExtractedSignal");
    476     MFillH fill2(&evt2, "MCerPhotEvt",         "FillCerPhotEvt");
    477 
    478     tlist.AddToList(&read);
    479     tlist.AddToList(&apply);
    480 
    481     if (fExtractor)
    482       tlist.AddToList(fExtractor);
    483     else
    484       {
    485       *fLog << warn << GetDescriptor()
    486             << ": No extractor has been chosen, take default MExtractSlidingWindow " << endl;
    487       tlist.AddToList(&extract2);
    488     }
    489 
    490     if (TestBit(kEnableGraphicalOutput))
    491         tlist.AddToList(&fill1);
    492     tlist.AddToList(&calib);
    493     tlist.AddToList(&calc);
    494     if (TestBit(kEnableGraphicalOutput))
    495         tlist.AddToList(&fill2);
    496 
    497     // Create and setup the eventloop
    498     MEvtLoop evtloop(fName);
    499     evtloop.SetParList(&plist);
    500     evtloop.SetDisplay(fDisplay);
    501     evtloop.SetLogStream(fLog);
    502 
    503     // Execute first analysis
    504     if (!evtloop.Eventloop())
    505     {
    506         *fLog << err << GetDescriptor() << ": Failed." << endl;
    507         return kFALSE;
    508     }
    509 
    510     tlist.PrintStatistics();
    511 
    512     DisplayResult(plist);
    513 
    514     *fLog << inf << GetDescriptor() << ": Done." << endl;
    515 
    516     return kTRUE;
    517 }
    518411
    519412/*
  • trunk/MagicSoft/Mars/mjobs/MJExtractCalibTest.h

    r3982 r4014  
    44#ifndef MARS_MHCalibrationTestCam
    55#include "MHCalibrationTestCam.h"
     6#endif
     7#ifndef MARS_MHCalibrationTestTimeCam
     8#include "MHCalibrationTestTimeCam.h"
    69#endif
    710#ifndef MARS_MPedPhotCam
     
    3336  MExtractTime *fTimeExtractor;              // Arrival time extractor 
    3437 
    35   MBadPixelsCam        fBadPixels;
    36   MHCalibrationTestCam fTestCam;
    37   MPedPhotCam          fPedPhotCam;
     38  MBadPixelsCam            fBadPixels;
     39  MHCalibrationTestCam     fTestCam;
     40  MHCalibrationTestTimeCam fTestTimeCam;
     41  MPedPhotCam              fPedPhotCam;
    3842
    3943  Bool_t ReadPedPhotCam();
     
    5155  void SetOutputPath(const char *path=".");
    5256 
    53   TString GetOutputFileP() const;
    54   TString GetOutputFileD() const;
    55   TString GetOutputFileT() const;
     57  TString GetOutputFile() const;
    5658 
    57   MHCalibrationTestCam &GetTestCam()    { return fTestCam; }
     59  MHCalibrationTestCam     &GetTestCam()      { return fTestCam; }
     60  MHCalibrationTestTimeCam &GetTestTimeCam()  { return fTestTimeCam; } 
    5861  MPedPhotCam          &GetPedPhotCam() { return fPedPhotCam; }
    5962  const MBadPixelsCam &GetBadPixels()  const { return fBadPixels; }
     
    6467 
    6568  Bool_t ProcessD(MPedestalCam &pedcam, MCalibrationChargeCam &calcam, MCalibrationQECam &qecam);
    66   Bool_t ProcessP(MPedestalCam &pedcam, MCalibrationChargeCam &calcam, MCalibrationQECam &qecam);
    6769  Bool_t ProcessT(MPedestalCam &pedcam, MCalibrationRelTimeCam &relcam); 
    6870 
Note: See TracChangeset for help on using the changeset viewer.