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.4 by loizides, Tue Nov 25 14:29:41 2008 UTC vs.
Revision 1.10 by ceballos, Sun May 24 19:10:43 2009 UTC

# Line 15 | Line 15 | ClassImp(mithep::HLTMod)
15   HLTMod::HLTMod(const char *name, const char *title) :
16    BaseMod(name,title),
17    fAbort(kTRUE),
18 +  fPrintTable(kFALSE),
19    fBitsName(Names::gkHltBitBrn),
20 <  fMyObjsNamePub(Form("%sObjsadafafa", name)),
20 >  fMyObjsNamePub(Form("%sTrigObjs", name)),
21    fBits(0),
22    fMyTrgObjs(0),
23    fTriggers(0),
# Line 43 | Line 44 | void HLTMod::AddTrigger(const char *expr
44    // "A", "!A", "A&B", "A&!B" or "A&B&C"  
45  
46    string tname(expr);
47 <  fTrigNames.AddCopy(tname);
47 >  fTrigNames.push_back(tname);
48   }
49  
50   //--------------------------------------------------------------------------------------------------
# Line 51 | Line 52 | void HLTMod::AddTrigObjs(UInt_t tid)
52   {
53    // Add trigger objects corresponding to trigger id.
54  
55 <  const BitMask256 &ba = fTrigBitsAnd.Ref(tid);
56 <  const BitMask256 &bm = fTrigBitsCmp.Ref(tid);
55 >  const BitMask256 &ba = fTrigBitsAnd.at(tid);
56 >  const BitMask256 &bm = fTrigBitsCmp.at(tid);
57    for (UInt_t i=0; i<bm.Size(); ++i) {
58      if (ba.TestBit(i)==0)
59        continue; // not an active trigger bit
# Line 72 | Line 73 | void HLTMod::BeginRun()
73   {
74    // Get HLT tree and set branches. Compute bitmasks to be used when comparing to the HLT bits.
75  
76 <  fTrigBitsAnd.Reset();
77 <  fTrigBitsCmp.Reset();
76 >  fTrigBitsAnd.clear();
77 >  fTrigBitsCmp.clear();
78  
79    if (fPrintTable)
80      fTriggers->Print();
81  
82 <  for (UInt_t i=0; i<fTrigNames.Entries(); ++i) {
82 >  for (UInt_t i=0; i<fTrigNames.size(); ++i) {
83      BitMask256 tmask; //trigger mask
84      BitMask256 amask; //bitand mask
85 <    TString names(fTrigNames.At(i)->c_str());
85 >    TString names(fTrigNames.at(i).c_str());
86 >
87      TObjArray *arr = names.Tokenize("&");
88      if (arr) {
89        for(Int_t j=0; j<arr->GetEntries(); j++){
# Line 96 | Line 98 | void HLTMod::BeginRun()
98          }
99          const TriggerName *tn = fTriggers->Get(sptr);
100          if (!tn) {
101 <          Warning("BeginRun", "Trigger %s not found.", tn->Name());
101 >          Warning("BeginRun", "Trigger %s not found.", sptr);
102            continue;
103          }
104          UShort_t bit = tn->Id();
# Line 106 | Line 108 | void HLTMod::BeginRun()
108        }
109        delete arr;
110      }
111 <    fTrigBitsAnd.AddCopy(amask);
112 <    fTrigBitsCmp.AddCopy(tmask);
111 >    fTrigBitsAnd.push_back(amask);
112 >    fTrigBitsCmp.push_back(tmask);
113    }
114   }
115  
# Line 126 | Line 128 | void HLTMod::Process()
128    fMyTrgObjs->SetOwner(kFALSE); // the objects are owned by the object table
129    fBitsDone.Clear();
130    Bool_t accept = kFALSE;
131 <  for (UInt_t i = 0; i<fTrigBitsAnd.Entries(); ++i) {
132 <    BitMask256 bitmask(*fBits);
133 <    bitmask &= fTrigBitsAnd.Ref(i);
134 <    if (bitmask==fTrigBitsCmp.Ref(i)) {
131 >  for (UInt_t i = 0; i<fTrigBitsAnd.size(); ++i) {
132 >    BitMask256 bitmask(fBits->Get());
133 >    bitmask &= fTrigBitsAnd.at(i);
134 >    if (bitmask==fTrigBitsCmp.at(i)) {
135        accept = kTRUE;
136        AddTrigObjs(i);
137      }
# Line 148 | Line 150 | void HLTMod::Process()
150  
151    // take action if accepted
152    ++fNAcceped;
153 +  IncNEventsProcessed();
154    OnAccepted();
155    if (!AddObjThisEvt(fMyTrgObjs)) {
156      SendError(kAbortAnalysis, "Process",
# Line 176 | Line 179 | void HLTMod::SlaveBegin()
179      return;
180    }
181   }
182 +
183 + //--------------------------------------------------------------------------------------------------
184 + void HLTMod::SlaveTerminate()
185 + {
186 +  // Save number of accepted events.
187 +
188 +  SaveNEventsProcessed("hDHLTEvents");
189 + }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines