Ignore:
Timestamp:
04/22/04 15:45:20 (21 years ago)
Author:
stamerra
Message:
*** empty log message ***
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/manalysis/MMcTriggerLvl2Calc.cc

    r2446 r3795  
    4343#include "MLogManip.h"
    4444
    45 #include "MMcEvt.hxx"
     45//#include "MMcEvt.hxx"
    4646#include "MMcTrig.hxx"
     47#include "MRawRunHeader.h"
    4748#include "MMcRunHeader.hxx"
    4849
     
    6162{
    6263  fName  = name  ? name  : "MMcTriggerLvl2Calc";
    63   fTitle = title ? title : "Task to Fill the MMcTriggerLvl2 object";
     64  fTitle = title ? title : "Task to Fill the MMcTriggerLvl2 object"; 
     65}
     66
     67 // --------------------------------------------------------------------------
     68//
     69// Check for the run type. Return kTRUE if it is a MC run or if there
     70// is no MC run header (old camera files) kFALSE in case of a different
     71// run type
     72//
     73Bool_t MMcTriggerLvl2Calc::CheckRunType(MParList *pList) const
     74{
     75  const MRawRunHeader *run = (MRawRunHeader*)pList->FindObject("MRawRunHeader");
     76  if (!run)
     77    {
     78      *fLog << warn << dbginf << "Warning - cannot check file type, MRawRunHeader not found." << endl;
     79      return kTRUE;
     80    }
    6481 
    65 }
    66 
    67 
    68 // --------------------------------------------------------------------------
    69 //                                                                         
    70 //  PreProcess
    71 //
    72 //
    73 Int_t MMcTriggerLvl2Calc::PreProcess (MParList *pList)
    74 {
    75     // connect the raw data with this task
    76 
     82  return run->IsMonteCarloRun();
     83}
     84
     85// --------------------------------------------------------------------------
     86//
     87// Check for the runtype.
     88// Search for .
     89//
     90Bool_t MMcTriggerLvl2Calc::ReInit(MParList *pList)
     91{
     92    //
     93    // If it is no MC file skip this function...
     94    //
     95    if (!CheckRunType(pList))
     96    {
     97        *fLog << inf << "This is no MC file... skipping." << endl;
     98        return kTRUE;
     99    }
     100       
     101    //
     102    // Check all necessary containers
     103    //
    77104    fMcEvt = (MMcEvt*)pList->FindObject("MMcEvt");
    78     if (!fMcEvt)
    79     {
    80         *fLog << err << dbginf << "MMcEvt not found... exit." << endl;
    81         return kFALSE;
    82     }
     105     if (!fMcEvt)
     106     {
     107         *fLog << err << dbginf << "MMcEvt not found... exit." << endl;
     108         return kFALSE;
     109     }
    83110
    84111    fMcTrig = (MMcTrig*)pList->FindObject("MMcTrig");
     
    102129        return kFALSE;
    103130      }
    104     fMMcTriggerLvl2 = (MMcTriggerLvl2*)pList->FindObject("MMcTriggerLvl2");
     131
     132    return kTRUE;
     133}
     134
     135
     136// --------------------------------------------------------------------------
     137//                                                                         
     138//  PreProcess
     139//  Check the exxistence of the MMcTriggerLvl2 containers and the correct
     140//    setting of the fCompactNN that defines a compact pixel
     141//
     142Int_t MMcTriggerLvl2Calc::PreProcess (MParList *pList)
     143{
     144
     145    //    fMMcTriggerLvl2 = (MMcTriggerLvl2*)pList->FindObject("MMcTriggerLvl2");
     146    fMMcTriggerLvl2 = (MMcTriggerLvl2*)pList->FindCreateObj("MMcTriggerLvl2");
    105147    if (!fMMcTriggerLvl2)
    106148    {
     
    138180Int_t MMcTriggerLvl2Calc::Process()
    139181{
    140   fMMcTriggerLvl2->GetEnergy(fMcEvt);
     182  //  fMMcTriggerLvl2->GetEnergy(fMcEvt);
    141183
    142184  fMMcTriggerLvl2->SetLv1(fMcTrig);
Note: See TracChangeset for help on using the changeset viewer.