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.5 by loizides, Mon Mar 2 13:26:45 2009 UTC vs.
Revision 1.11 by loizides, Mon Jun 15 15:00:17 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  
12   using namespace mithep;
13  
# Line 15 | Line 17 | ClassImp(mithep::HLTMod)
17   HLTMod::HLTMod(const char *name, const char *title) :
18    BaseMod(name,title),
19    fAbort(kTRUE),
20 +  fPrintTable(kFALSE),
21    fBitsName(Names::gkHltBitBrn),
22 <  fMyObjsNamePub(Form("%sObjsadafafa", name)),
22 >  fMyObjsNamePub(Form("%sTrigObjs", name)),
23    fBits(0),
24    fMyTrgObjs(0),
25    fTriggers(0),
# Line 51 | Line 54 | void HLTMod::AddTrigObjs(UInt_t tid)
54   {
55    // Add trigger objects corresponding to trigger id.
56  
57 <  const BitMask256 &ba = fTrigBitsAnd.Ref(tid);
58 <  const BitMask256 &bm = fTrigBitsCmp.Ref(tid);
57 >  const BitMask256 &ba = fTrigBitsAnd.at(tid);
58 >  const BitMask256 &bm = fTrigBitsCmp.at(tid);
59    for (UInt_t i=0; i<bm.Size(); ++i) {
60      if (ba.TestBit(i)==0)
61        continue; // not an active trigger bit
# Line 72 | Line 75 | void HLTMod::BeginRun()
75   {
76    // Get HLT tree and set branches. Compute bitmasks to be used when comparing to the HLT bits.
77  
78 <  fTrigBitsAnd.Reset();
79 <  fTrigBitsCmp.Reset();
78 >  fTrigBitsAnd.clear();
79 >  fTrigBitsCmp.clear();
80  
81    if (fPrintTable)
82      fTriggers->Print();
# Line 82 | Line 85 | void HLTMod::BeginRun()
85      BitMask256 tmask; //trigger mask
86      BitMask256 amask; //bitand mask
87      TString names(fTrigNames.at(i).c_str());
88 +
89      TObjArray *arr = names.Tokenize("&");
90      if (arr) {
91        for(Int_t j=0; j<arr->GetEntries(); j++){
# Line 96 | Line 100 | void HLTMod::BeginRun()
100          }
101          const TriggerName *tn = fTriggers->Get(sptr);
102          if (!tn) {
103 <          Warning("BeginRun", "Trigger %s not found.", tn->Name());
103 >          Warning("BeginRun", "Trigger %s not found.", sptr);
104            continue;
105          }
106          UShort_t bit = tn->Id();
# Line 106 | Line 110 | void HLTMod::BeginRun()
110        }
111        delete arr;
112      }
113 <    fTrigBitsAnd.AddCopy(amask);
114 <    fTrigBitsCmp.AddCopy(tmask);
113 >    fTrigBitsAnd.push_back(amask);
114 >    fTrigBitsCmp.push_back(tmask);
115    }
116   }
117  
# Line 126 | Line 130 | void HLTMod::Process()
130    fMyTrgObjs->SetOwner(kFALSE); // the objects are owned by the object table
131    fBitsDone.Clear();
132    Bool_t accept = kFALSE;
133 <  for (UInt_t i = 0; i<fTrigBitsAnd.Entries(); ++i) {
134 <    BitMask256 bitmask(*fBits);
135 <    bitmask &= fTrigBitsAnd.Ref(i);
136 <    if (bitmask==fTrigBitsCmp.Ref(i)) {
133 >  for (UInt_t i = 0; i<fTrigBitsAnd.size(); ++i) {
134 >    BitMask256 bitmask(fBits->Get());
135 >    bitmask &= fTrigBitsAnd.at(i);
136 >    if (bitmask==fTrigBitsCmp.at(i)) {
137        accept = kTRUE;
138        AddTrigObjs(i);
139      }
# Line 148 | Line 152 | void HLTMod::Process()
152  
153    // take action if accepted
154    ++fNAcceped;
155 +  IncNEventsProcessed();
156    OnAccepted();
157    if (!AddObjThisEvt(fMyTrgObjs)) {
158      SendError(kAbortAnalysis, "Process",
# Line 176 | Line 181 | void HLTMod::SlaveBegin()
181      return;
182    }
183   }
184 +
185 + //--------------------------------------------------------------------------------------------------
186 + void HLTMod::SlaveTerminate()
187 + {
188 +  // Save number of accepted events.
189 +
190 +  SaveNEventsProcessed("hDHLTEvents");
191 + }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines