ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/MitAna/TreeMod/src/HLTMod.cc
(Generate patch)

Comparing UserCode/MitAna/TreeMod/src/HLTMod.cc (file contents):
Revision 1.8 by loizides, Tue May 12 14:21:13 2009 UTC vs.
Revision 1.15 by loizides, Thu Sep 17 14:18:35 2009 UTC

# Line 5 | Line 5
5   #include <TTree.h>
6   #include "MitAna/DataTree/interface/Names.h"
7   #include "MitAna/DataTree/interface/TriggerName.h"
8 + #include "MitAna/DataTree/interface/TriggerMask.h"
9   #include "MitAna/DataTree/interface/TriggerObject.h"
10 + #include "MitAna/DataTree/interface/TriggerObjectCol.h"
11 + #include "MitAna/DataTree/interface/TriggerObjectsTable.h"
12  
13   using namespace mithep;
14  
# Line 16 | Line 19 | HLTMod::HLTMod(const char *name, const c
19    BaseMod(name,title),
20    fAbort(kTRUE),
21    fPrintTable(kFALSE),
22 +  fIgnoreBits(kFALSE),
23 +  fObjMode(kHlt),
24    fBitsName(Names::gkHltBitBrn),
25    fMyObjsNamePub(Form("%sTrigObjs", name)),
26    fBits(0),
# Line 55 | Line 60 | void HLTMod::AddTrigObjs(UInt_t tid)
60    const BitMask256 &ba = fTrigBitsAnd.at(tid);
61    const BitMask256 &bm = fTrigBitsCmp.at(tid);
62    for (UInt_t i=0; i<bm.Size(); ++i) {
63 <    if (ba.TestBit(i)==0)
63 >    if (ba.TestBit(i)==0 && !fIgnoreBits)
64        continue; // not an active trigger bit
65      if (fBitsDone.TestBit(i))
66        continue; // objects for this bit are already obtained
# Line 63 | Line 68 | void HLTMod::AddTrigObjs(UInt_t tid)
68        continue; // excluded trigger bit (ie a !trgname)
69  
70      const TList *list = fTrigObjs->GetList(i);
71 <    fMyTrgObjs->Add(list);    
71 >    if (list) {
72 >      TIter iter(list->MakeIterator());
73 >      const TriggerObject *to = dynamic_cast<const TriggerObject*>(iter.Next());
74 >      while (to) {
75 >        if ( (fObjMode == kAll) ||
76 >             ((fObjMode==kHlt) && (to->IsHLT())) ||
77 >             ((fObjMode==kL1) && (to->IsL1())) )
78 >          fMyTrgObjs->Add(to);    
79 >        to = dynamic_cast<const TriggerObject*>(iter.Next());
80 >      }
81 >    }
82      fBitsDone.SetBit(i);
83    }
84   }
# Line 82 | Line 97 | void HLTMod::BeginRun()
97    for (UInt_t i=0; i<fTrigNames.size(); ++i) {
98      BitMask256 tmask; //trigger mask
99      BitMask256 amask; //bitand mask
100 +    Bool_t gotamask = 0;
101      TString names(fTrigNames.at(i).c_str());
102  
103      TObjArray *arr = names.Tokenize("&");
# Line 101 | Line 117 | void HLTMod::BeginRun()
117            Warning("BeginRun", "Trigger %s not found.", sptr);
118            continue;
119          }
120 +        gotamask = 1;
121          UShort_t bit = tn->Id();
122          amask.SetBit(bit); //always set and-mask bit
123          if (!invert)
# Line 108 | Line 125 | void HLTMod::BeginRun()
125        }
126        delete arr;
127      }
128 <    fTrigBitsAnd.push_back(amask);
129 <    fTrigBitsCmp.push_back(tmask);
128 >    if (gotamask) {
129 >      fTrigBitsAnd.push_back(amask);
130 >      fTrigBitsCmp.push_back(tmask);
131 >    }
132    }
133   }
134  
# Line 150 | Line 169 | void HLTMod::Process()
169  
170    // take action if accepted
171    ++fNAcceped;
172 +  IncNEventsProcessed();
173    OnAccepted();
174    if (!AddObjThisEvt(fMyTrgObjs)) {
175      SendError(kAbortAnalysis, "Process",
# Line 178 | Line 198 | void HLTMod::SlaveBegin()
198      return;
199    }
200   }
201 +
202 + //--------------------------------------------------------------------------------------------------
203 + void HLTMod::SlaveTerminate()
204 + {
205 +  // Save number of accepted events.
206 +
207 +  SaveNEventsProcessed("hDHLTEvents");
208 + }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines