Ignore:
Timestamp:
12/21/09 10:06:41 (15 years ago)
Author:
tbretz
Message:
*** empty log message ***
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/mtrigger/MTriggerPatternDecode.cc

    r9490 r9531  
    2929//  Decodes the trigger pattern from MRawEvtData into MTriggerPattern.
    3030//
    31 // For files before file version 5 the trigger pattern is set to 00000000.
    32 // This can be changed using the information about the file-type.
     31// For files before file version 5 the trigger pattern is set according
     32// to the file type
    3333//
    3434// For more details see: MTriggerPattern
     
    7070Int_t MTriggerPatternDecode::PreProcess(MParList *pList)
    7171{
    72     fRunHeader = (MRawRunHeader*)pList->FindCreateObj("MRawRunHeader");
     72    fRunHeader = (MRawRunHeader*)pList->FindObject("MRawRunHeader");
    7373    if (!fRunHeader)
    7474    {
     
    7777    }
    7878
    79     fEvtHeader = (MRawEvtHeader *)pList->FindObject("MRawEvtHeader");
     79    fEvtHeader = (MRawEvtHeader*)pList->FindObject("MRawEvtHeader");
    8080    if (!fEvtHeader)
    8181    {
     
    8686    fPattern = (MTriggerPattern*)pList->FindCreateObj("MTriggerPattern");
    8787    if (!fPattern)
    88     {
    89         *fLog << err << "MRawEvtHeader not found... abort." << endl;
    9088        return kFALSE;
    91     }
    9289
    9390    return kTRUE;
     
    9693// --------------------------------------------------------------------------
    9794//
    98 // For files before file version 5 the trigger pattern is set to 00000000.
    99 // This can be changed using the information about the file-type.
    10095//
    10196Int_t MTriggerPatternDecode::Process()
    10297{
    103     // No setting necessary because MTriggerPattern::reset() has
    104     // been called just before
    10598    if (fRunHeader->GetFormatVersion()<5)
     99    {
     100        switch (fRunHeader->GetRunType()&0xff)
     101        {
     102        case MRawRunHeader::kRTData:
     103            fPattern->fPrescaled   = MTriggerPattern::kTriggerLvl1;
     104            fPattern->fUnprescaled = MTriggerPattern::kTriggerLvl1;
     105            return kTRUE;
     106
     107        case MRawRunHeader::kRTPedestal:
     108            fPattern->fPrescaled   = MTriggerPattern::kPedestal;
     109            fPattern->fUnprescaled = MTriggerPattern::kPedestal;
     110            return kTRUE;
     111
     112        case MRawRunHeader::kRTCalibration:
     113            fPattern->fPrescaled   = MTriggerPattern::kCalibration;
     114            fPattern->fUnprescaled = MTriggerPattern::kCalibration;
     115            return kTRUE;
     116        }
    106117        return kTRUE;
     118    }
    107119
    108120    const UInt_t pattern = ~fEvtHeader->GetTriggerID();
Note: See TracChangeset for help on using the changeset viewer.