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.3 by loizides, Thu Oct 23 18:25:27 2008 UTC vs.
Revision 1.8 by loizides, Tue May 12 14:21:13 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 119 | Line 121 | void HLTMod::Process()
121    // in a derived class, call it. Do not stop processing this event, if fAbort is kFALSE.
122  
123    ++fNEvents;
124 <  LoadBranch(fBitsName.Data());
124 >  LoadBranch(fBitsName);
125  
126    // match trigger bits to trigger mask and obtain trigger objects
127    fMyTrgObjs = new TriggerObjectOArr(0,fMyObjsNamePub);
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 163 | Line 165 | void HLTMod::SlaveBegin()
165   {
166    // Request trigger bit branch and obtain trigger table and objects.
167  
168 <  ReqBranch(fBitsName.Data(), fBits);
168 >  ReqBranch(fBitsName, fBits);
169    
170    fTriggers = GetHLTTable();
171    if (!fTriggers) {

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines