Ignore:
Timestamp:
05/05/04 17:26:14 (21 years ago)
Author:
gaug
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars/mjobs
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/mjobs/MJExtractCalibTest.cc

    r3862 r3982  
    4848#include "MBadPixelsCam.h"
    4949#include "MCerPhotEvt.h"
     50#include "MArrivalTime.h"
    5051#include "MCalibrationChargeCam.h"
     52#include "MCalibrationRelTimeCam.h"
    5153#include "MCalibrationQECam.h"
    5254#include "MHCamEvent.h"
     
    5658#include "MExtractSlidingWindow.h"
    5759#include "MExtractor.h"
     60#include "MExtractTime.h"
     61#include "MExtractTimeFastSpline.h"
    5862#include "MFillH.h"
    5963#include "MCalibrate.h"
     64#include "MCalibrateRelTimes.h"
    6065#include "MPedPhotCalc.h"
    6166#include "MWriteRootFile.h"
     
    7075// Default constructor.
    7176//
    72 // Sets fRuns to 0, fExtractor to NULL
     77// Sets fRuns to 0, fExtractor to NULL, fTimeExtractor to NULL
    7378//
    7479MJExtractCalibTest::MJExtractCalibTest(const char *name, const char *title)
    75     : fRuns(NULL), fExtractor(NULL)
     80    : fRuns(NULL), fExtractor(NULL), fTimeExtractor(NULL)
    7681{
    7782    fName  = name  ? name  : "MJExtractCalibTest";
     
    151156}
    152157
     158TString 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
    153166TString MJExtractCalibTest::GetOutputFileP() const
    154167{
     
    240253    }
    241254
    242   if (TestBit(kEnableGraphicalOutput))
     255  //  if (TestBit(kEnableGraphicalOutput))
    243256    tlist.AddToList(&fill);
    244257  tlist.AddToList(&photcalc);
    245258  tlist.AddToList(&fillcam);
    246   //  tlist.AddToList(&write);
    247259 
    248260  // Create and setup the eventloop
     
    267279  return kTRUE;
    268280}
     281
     282Bool_t MJExtractCalibTest::ProcessT(MPedestalCam &pedcam, MCalibrationRelTimeCam &relcam)
     283{
     284  const TString fname = GetOutputFileT();
     285 
     286  if (gSystem->AccessPathName(fname, kFileExists))
     287    return ProcessFileT(pedcam,relcam);
     288 
     289  return kTRUE;
     290}
     291
     292Bool_t MJExtractCalibTest::ProcessFileT(MPedestalCam &pedcam, MCalibrationRelTimeCam &relcam)
     293{
     294
     295  if (!fRuns)
     296    {
     297      *fLog << err << "No Runs choosen... abort." << endl;
     298      return kFALSE;
     299    }
     300  if (fRuns->GetNumRuns() != fRuns->GetNumEntries())
     301    {
     302      *fLog << err << "Number of files found doesn't match number of runs... abort." << endl;
     303      return kFALSE;
     304    }
     305 
     306  *fLog << inf;
     307  fLog->Separator(GetDescriptor());
     308  *fLog << "Calculate MExtractedSignalCam from Runs " << fRuns->GetRunsAsString() << endl;
     309  *fLog << endl;
     310 
     311  MArrivalTime  arrtime;
     312
     313  // Setup Lists
     314  MParList plist;
     315  plist.AddToList(&pedcam);
     316  plist.AddToList(&relcam);
     317  plist.AddToList(&arrtime);
     318  plist.AddToList(&fTestCam);
     319  plist.AddToList(&fBadPixels);
     320 
     321  MTaskList tlist;
     322  plist.AddToList(&tlist);
     323
     324  // Setup Task-lists
     325  MReadMarsFile read("Events");
     326  read.DisableAutoScheme();
     327  static_cast<MRead&>(read).AddFiles(*fRuns);
     328 
     329  MGeomApply             apply; // Only necessary to craete geometry
     330  MExtractTimeFastSpline extract;
     331  MCalibrateRelTimes     timecalc;
     332
     333  MHCamEvent evt("ExtTimes");
     334  evt.SetType(0);
     335  MFillH fill(&evt, "MArrivalTimeCam");
     336 
     337  MFillH fillcam("MHCalibrationTestTimeCam", "MArrivalTime");
     338  fillcam.SetNameTab("TestTime");
     339
     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
     350  tlist.AddToList(&read);
     351  tlist.AddToList(&apply);
     352
     353  if (fTimeExtractor)
     354    tlist.AddToList(fTimeExtractor);
     355    else
     356    {
     357      *fLog << warn << GetDescriptor()
     358            << ": No extractor has been chosen, take default MExtractSlidingWindow " << endl;
     359      tlist.AddToList(&extract);
     360    }
     361
     362  //  if (TestBit(kEnableGraphicalOutput))
     363  tlist.AddToList(&fill);
     364  tlist.AddToList(&timecalc);
     365  tlist.AddToList(&fillcam);
     366 
     367  // Create and setup the eventloop
     368  MEvtLoop evtloop(fName);
     369  evtloop.SetParList(&plist);
     370  evtloop.SetDisplay(fDisplay);
     371  evtloop.SetLogStream(fLog);
     372 
     373  // Execute first analysis
     374  if (!evtloop.Eventloop())
     375    {
     376      *fLog << err << GetDescriptor() << ": Failed." << endl;
     377      return kFALSE;
     378    }
     379 
     380  tlist.PrintStatistics();
     381 
     382  DisplayResult(plist);
     383
     384  *fLog << inf << GetDescriptor() << ": Done." << endl;
     385 
     386  return kTRUE;
     387}
     388
    269389
    270390Bool_t MJExtractCalibTest::ReadPedPhotCam()
  • trunk/MagicSoft/Mars/mjobs/MJExtractCalibTest.h

    r3862 r3982  
    1818class MParList;
    1919class MPedestalCam;
     20class MCalibrationRelTimeCam;
    2021class MCalibrationChargeCam;
    2122class MCalibrationQECam;
    2223class MExtractor;
     24class MExtractTime;
    2325class MJExtractCalibTest : public MParContainer, public MGCamDisplays
    2426{
     
    2729  TString fOutputPath;
    2830
    29   MRunIter   *fRuns;                                       // Data files
    30   MExtractor *fExtractor;                                  // Signal extractor
     31  MRunIter     *fRuns;                       // Data files
     32  MExtractor   *fExtractor;                  // Signal extractor
     33  MExtractTime *fTimeExtractor;              // Arrival time extractor 
    3134 
    3235  MBadPixelsCam        fBadPixels;
     
    4043  Bool_t ProcessFileD(MPedestalCam &pedcam, MCalibrationChargeCam &calcam, MCalibrationQECam &qecam);
    4144  Bool_t ProcessFileP(MPedestalCam &pedcam, MCalibrationChargeCam &calcam, MCalibrationQECam &qecam);
     45  Bool_t ProcessFileT(MPedestalCam &pedcam, MCalibrationRelTimeCam &relcam); 
    4246
    4347public:
     
    4953  TString GetOutputFileP() const;
    5054  TString GetOutputFileD() const;
     55  TString GetOutputFileT() const;
    5156 
    5257  MHCalibrationTestCam &GetTestCam()    { return fTestCam; }
     
    5560 
    5661  void SetExtractor(MExtractor* ext)              { fExtractor = ext; }
     62  void SetTimeExtractor(MExtractTime* ext)         { fTimeExtractor = ext; }
    5763  void SetBadPixels(const MBadPixelsCam &bad) { bad.Copy(fBadPixels); }
    5864 
    5965  Bool_t ProcessD(MPedestalCam &pedcam, MCalibrationChargeCam &calcam, MCalibrationQECam &qecam);
    6066  Bool_t ProcessP(MPedestalCam &pedcam, MCalibrationChargeCam &calcam, MCalibrationQECam &qecam);
     67  Bool_t ProcessT(MPedestalCam &pedcam, MCalibrationRelTimeCam &relcam); 
    6168 
    6269  ClassDef(MJExtractCalibTest, 0) // Tool to extract, calibrate and test the signal
  • trunk/MagicSoft/Mars/mjobs/MJPedestal.cc

    r3889 r3982  
    258258    MGeomApply      geomapl;
    259259    // MBadPixelsMerge merge(&fBadPixels);
    260     //MExtractSignal sigcalc;
    261260    MPedCalcPedRun  pedcalc;
    262261
  • trunk/MagicSoft/Mars/mjobs/Makefile

    r3927 r3982  
    2121INCLUDES = -I. -I../mbase -I../mgui -I../mgeom -I../mdata -I../mhbase \
    2222           -I../mfileio -I../mfilter -I../manalysis -I../mhist -I../mcalib \
    23            -I../mbadpixels -I../msignal -I../mraw -I../mpedestal
     23           -I../mbadpixels -I../msignal -I../mraw -I../mpedestal -I../mtools
    2424
    2525#manalysis: MChisqEval (MParameters)
Note: See TracChangeset for help on using the changeset viewer.