Ignore:
Timestamp:
05/25/04 11:13:08 (21 years ago)
Author:
gaug
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars/mjobs
Files:
2 edited

Legend:

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

    r3524 r4167  
    4747#include "MPedestalCam.h"
    4848#include "MCalibrationChargeCam.h"
     49#include "MCalibrationQECam.h"
    4950#include "MHCamEvent.h"
    5051
     
    139140Bool_t MJExtractSignal::ProcessFileD(MPedestalCam &pedcam)
    140141{
    141     if (!fRuns)
    142     {
    143         *fLog << err << "No Runs choosen... abort." << endl;
    144         return kFALSE;
    145     }
    146     if (fRuns->GetNumRuns() != fRuns->GetNumEntries())
     142
     143  if (!fRuns)
     144    {
     145      *fLog << err << "No Runs choosen... abort." << endl;
     146      return kFALSE;
     147    }
     148  if (fRuns->GetNumRuns() != fRuns->GetNumEntries())
    147149    {
    148150        *fLog << err << "Number of files found doesn't match number of runs... abort." << endl;
    149151        return kFALSE;
    150152    }
    151 
    152     *fLog << inf;
    153     fLog->Separator(GetDescriptor());
    154     *fLog << "Calculate MExtractedSignalCam from Runs " << fRuns->GetRunsAsString() << endl;
    155     *fLog << endl;
    156 
    157     // Setup Lists
    158     MParList plist;
    159     plist.AddToList(&pedcam);
    160 
    161     MTaskList tlist;
    162     plist.AddToList(&tlist);
    163 
    164     // Setup Parameters
    165 
    166     // Make sure, that at least an empty MBadPixelsCam is available
    167     // This is necessary for input which don't contain a MBadPixelsCam
    168     MBadPixelsCam badcam;
    169     plist.AddToList(&badcam);
    170 
    171     // Setup Task-lists
    172     MReadMarsFile read("Events");
    173     read.DisableAutoScheme();
    174     static_cast<MRead&>(read).AddFiles(*fRuns);
    175 
    176     MGeomApply      apply; // Only necessary to craete geometry
    177     MBadPixelsMerge merge(&fBadPixels);
    178     MExtractSignal  extract;
    179 
    180     MHCamEvent evt("ExtSignal");
    181     evt.SetType(0);
    182     MFillH fill(&evt, "MExtractedSignalCam");
    183 
    184     MWriteRootFile write(GetOutputFileD(), "RECREATE", fRuns->GetRunsAsString(), 2);
    185     write.AddContainer("MExtractedSignalCam", "Events");
    186     write.AddContainer("MTime",               "Events");
    187     write.AddContainer("MRawEvtHeader",       "Events");
    188     write.AddContainer("MPedestalCam",        "RunHeaders");
    189     write.AddContainer("MRawRunHeader",       "RunHeaders");
    190     write.AddContainer("MBadPixelsCam",       "RunHeaders");
    191 
    192     tlist.AddToList(&read);
    193     tlist.AddToList(&apply);
    194     tlist.AddToList(&merge);
    195     tlist.AddToList(&extract);
    196     if (TestBit(kEnableGraphicalOutput))
    197         tlist.AddToList(&fill);
    198     tlist.AddToList(&write);
    199 
    200     // Create and setup the eventloop
    201     MEvtLoop evtloop(fName);
    202     evtloop.SetParList(&plist);
    203     evtloop.SetDisplay(fDisplay);
    204     evtloop.SetLogStream(fLog);
    205 
    206     // Execute first analysis
    207     if (!evtloop.Eventloop())
    208     {
    209         *fLog << err << GetDescriptor() << ": Failed." << endl;
    210         return kFALSE;
    211     }
    212 
    213     tlist.PrintStatistics();
    214 
    215     //DisplayResult(plist);
    216 
    217     //if (!WriteResult())
    218     //    return kFALSE;
    219 
    220     *fLog << inf << GetDescriptor() << ": Done." << endl;
    221 
    222     return kTRUE;
     153 
     154  *fLog << inf;
     155  fLog->Separator(GetDescriptor());
     156  *fLog << "Calculate MExtractedSignalCam from Runs " << fRuns->GetRunsAsString() << endl;
     157  *fLog << endl;
     158 
     159  // Setup Lists
     160  MParList plist;
     161  plist.AddToList(&pedcam);
     162 
     163  MTaskList tlist;
     164  plist.AddToList(&tlist);
     165
     166  // Setup Parameters
     167 
     168  // Make sure, that at least an empty MBadPixelsCam is available
     169  // This is necessary for input which don't contain a MBadPixelsCam
     170  MBadPixelsCam badcam;
     171  plist.AddToList(&badcam);
     172 
     173  // Setup Task-lists
     174  MReadMarsFile read("Events");
     175  read.DisableAutoScheme();
     176  static_cast<MRead&>(read).AddFiles(*fRuns);
     177 
     178  MGeomApply      apply; // Only necessary to craete geometry
     179  MBadPixelsMerge merge(&fBadPixels);
     180  MExtractSignal  extract;
     181 
     182  MHCamEvent evt("ExtSignal");
     183  evt.SetType(0);
     184  MFillH fill(&evt, "MExtractedSignalCam");
     185 
     186  MWriteRootFile write(GetOutputFileD(), "RECREATE", fRuns->GetRunsAsString(), 2);
     187  write.AddContainer("MExtractedSignalCam", "Events");
     188  write.AddContainer("MTime",               "Events");
     189  write.AddContainer("MRawEvtHeader",       "Events");
     190  write.AddContainer("MPedestalCam",        "RunHeaders");
     191  write.AddContainer("MRawRunHeader",       "RunHeaders");
     192  write.AddContainer("MBadPixelsCam",       "RunHeaders");
     193 
     194  tlist.AddToList(&read);
     195  tlist.AddToList(&apply);
     196  tlist.AddToList(&merge);
     197  tlist.AddToList(&extract);
     198  if (TestBit(kEnableGraphicalOutput))
     199    tlist.AddToList(&fill);
     200  tlist.AddToList(&write);
     201 
     202  // Create and setup the eventloop
     203  MEvtLoop evtloop(fName);
     204  evtloop.SetParList(&plist);
     205  evtloop.SetDisplay(fDisplay);
     206  evtloop.SetLogStream(fLog);
     207 
     208  // Execute first analysis
     209  if (!evtloop.Eventloop())
     210    {
     211      *fLog << err << GetDescriptor() << ": Failed." << endl;
     212      return kFALSE;
     213    }
     214 
     215  tlist.PrintStatistics();
     216 
     217  //DisplayResult(plist);
     218 
     219  //if (!WriteResult())
     220  //    return kFALSE;
     221 
     222  *fLog << inf << GetDescriptor() << ": Done." << endl;
     223 
     224  return kTRUE;
    223225}
    224226
     
    259261}
    260262
    261 Bool_t MJExtractSignal::ProcessP(MPedestalCam &pedcam, MCalibrationChargeCam &calcam)
     263Bool_t MJExtractSignal::ProcessP(MPedestalCam &pedcam, MCalibrationChargeCam &calcam, MCalibrationQECam &qecam)
    262264{
    263265    if (!ReadPedPhotCam())
    264         return ProcessFileP(pedcam, calcam);
    265 
    266     return kTRUE;
    267 }
    268 
    269 Bool_t MJExtractSignal::ProcessFileP(MPedestalCam &pedcam, MCalibrationChargeCam &calcam)
     266        return ProcessFileP(pedcam, calcam, qecam);
     267
     268    return kTRUE;
     269}
     270
     271Bool_t MJExtractSignal::ProcessFileP(MPedestalCam &pedcam, MCalibrationChargeCam &calcam, MCalibrationQECam &qecam)
    270272{
    271273    if (!fRuns)
     
    293295    plist.AddToList(&pedcam);
    294296    plist.AddToList(&calcam);
     297    plist.AddToList(&qecam);
    295298    plist.AddToList(&fPedPhotCam);
    296299    plist.AddToList(&fBadPixels);
  • trunk/MagicSoft/Mars/mjobs/MJExtractSignal.h

    r3445 r4167  
    1616class MPedestalCam;
    1717class MCalibrationChargeCam;
     18class MCalibrationQECam;
    1819
    1920class MJExtractSignal : public MParContainer
     
    3334
    3435    Bool_t ProcessFileD(MPedestalCam &pedcam);
    35     Bool_t ProcessFileP(MPedestalCam &pedcam, MCalibrationChargeCam &calcam);
     36    Bool_t ProcessFileP(MPedestalCam &pedcam, MCalibrationChargeCam &calcam, MCalibrationQECam &qecam);
    3637
    3738public:
     
    5051
    5152    Bool_t ProcessD(MPedestalCam &pedcam);
    52     Bool_t ProcessP(MPedestalCam &pedcam, MCalibrationChargeCam &calcam);
     53    Bool_t ProcessP(MPedestalCam &pedcam, MCalibrationChargeCam &calcam, MCalibrationQECam &qecam);
    5354
    5455    ClassDef(MJExtractSignal, 0) // Tool to create a pedestal file (MPedestalCam)
Note: See TracChangeset for help on using the changeset viewer.