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.18 by loizides, Tue Dec 1 15:14:11 2009 UTC vs.
Revision 1.21 by bendavid, Sun May 15 20:40:30 2011 UTC

# Line 28 | Line 28 | HLTMod::HLTMod(const char *name, const c
28    fTriggers(0),
29    fTrigObjs(0),
30    fNEvents(0),
31 <  fNAcceped(0),
31 >  fNAccepted(0),
32    fNFailed(0)
33   {
34    // Constructor.
# Line 41 | Line 41 | HLTMod::~HLTMod()
41   }
42  
43   //--------------------------------------------------------------------------------------------------
44 < void HLTMod::AddTrigger(const char *expr)
44 > void HLTMod::AddTrigger(const char *expr, UInt_t firstRun, UInt_t lastRun)
45   {
46    // Add trigger search pattern to the list of patters. Each element of the list is logically
47    // "ored". The given expression can contain several trigger names logically "anded" (using "&").
# Line 49 | Line 49 | void HLTMod::AddTrigger(const char *expr
49    // "A", "!A", "A&B", "A&!B" or "A&B&C"  
50  
51    string tname(expr);
52 <  fTrigNames.push_back(tname);
52 >  std::pair<std::string,std::pair<UInt_t,UInt_t> > element(tname,std::pair<UInt_t,UInt_t>(firstRun,lastRun));
53 >  fTrigNames.push_back(element);
54   }
55  
56   //--------------------------------------------------------------------------------------------------
# Line 57 | Line 58 | void HLTMod::AddTrigObjs(UInt_t tid)
58   {
59    // Add trigger objects corresponding to trigger id.
60  
61 <  const BitMask256 &ba = fTrigBitsAnd.at(tid);
62 <  const BitMask256 &bm = fTrigBitsCmp.at(tid);
61 >  const BitMask1024 &ba = fTrigBitsAnd.at(tid);
62 >  const BitMask1024 &bm = fTrigBitsCmp.at(tid);
63    for (UInt_t i=0; i<bm.Size(); ++i) {
64      if (ba.TestBit(i)==0 && !fIgnoreBits)
65        continue; // not an active trigger bit
# Line 95 | Line 96 | void HLTMod::BeginRun()
96      Info("BeginRun", "Get trigger table for run %d", GetEventHeader()->RunNum());
97      fTriggers->Print();
98    }
99 +  
100 +  UInt_t runNumber = GetEventHeader()->RunNum();
101  
102    for (UInt_t i=0; i<fTrigNames.size(); ++i) {
103 <    BitMask256 tmask; //trigger mask
104 <    BitMask256 amask; //bitand mask
105 <    TString names(fTrigNames.at(i).c_str());
103 >    
104 >    UInt_t firstRun = fTrigNames.at(i).second.first;
105 >    UInt_t lastRun  = fTrigNames.at(i).second.second;
106 >    
107 >    // implement run dependence of the triggers
108 >    if ( (!(firstRun==0 && lastRun==0)) &&
109 >         ( runNumber<firstRun || runNumber>lastRun ) )
110 >      continue;
111 >    
112 >    BitMask1024 tmask; //trigger mask
113 >    BitMask1024 amask; //bitand mask
114 >    TString names(fTrigNames.at(i).first.c_str());
115  
116      TObjArray *arr = names.Tokenize("&");
117      if (arr) {
# Line 158 | Line 170 | void HLTMod::Process()
170    fBitsDone.Clear();
171    Bool_t accept = kFALSE;
172    for (UInt_t i = 0; i<fTrigBitsAnd.size(); ++i) {
173 <    BitMask256 bitmask(fBits->Get());
173 >    BitMask1024 bitmask(fBits->Get());
174      bitmask &= fTrigBitsAnd.at(i);
175      if (bitmask==fTrigBitsCmp.at(i)) {
176        accept = kTRUE;
# Line 178 | Line 190 | void HLTMod::Process()
190    }
191  
192    // take action if accepted
193 <  ++fNAcceped;
193 >  ++fNAccepted;
194    IncNEventsProcessed();
195    OnAccepted();
196    if (!AddObjThisEvt(fMyTrgObjs)) {
# Line 214 | Line 226 | void HLTMod::SlaveTerminate()
226   {
227    // Save number of accepted events.
228  
229 +  printf(" %s - Accepted events: %d (/%d)\n",GetName(),fNAccepted,fNEvents);
230    SaveNEventsProcessed("hDHLTEvents");
231   }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines