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

Comparing UserCode/MitAna/TreeMod/src/OutputMod.cc (file contents):
Revision 1.4 by loizides, Thu Dec 4 13:55:06 2008 UTC vs.
Revision 1.6 by loizides, Mon Mar 2 13:26:45 2009 UTC

# Line 75 | Line 75 | void OutputMod::CheckAndAddBranch(const
75      return;
76  
77    // populate regular expression list if this was not yet done
78 <  if (fCmdReList.size() != fCmdList.Entries()) {
79 <    for (UInt_t i=0; i<fCmdList.Entries(); ++i) {
80 <      const char *ptr = fCmdList.At(i)->c_str();
78 >  if (fCmdReList.size() != fCmdList.size()) {
79 >    for (UInt_t i=0; i<fCmdList.size(); ++i) {
80 >      const char *ptr = fCmdList.at(i).c_str();
81        fCmdReList.push_back(TRegexp(ptr+5,kTRUE));
82        if (ptr[0]=='k')
83          fCmdDeList.push_back(kTRUE);
# Line 91 | Line 91 | void OutputMod::CheckAndAddBranch(const
91    Bool_t decision       = kFALSE;
92    Bool_t decision_found = kFALSE;
93  
94 <  for (UInt_t i=0; i<fCmdList.Entries(); ++i) {
94 >  for (UInt_t i=0; i<fCmdList.size(); ++i) {
95      TRegexp &re(fCmdReList.at(i));
96      if (brname.Index(re) == kNPOS)
97        continue;
# Line 114 | Line 114 | void OutputMod::CheckAndAddBranch(const
114    // add branch to accepted branch list
115    Info("CheckAndAddBranch", "Kept branch with name %s and class %s.", bname, cname);
116  
117 <  fBrNameList.AddCopy(string(bname));
118 <  fBrClassList.AddCopy(string(cname));
117 >  fBrNameList.push_back(string(bname));
118 >  fBrClassList.push_back(string(cname));
119  
120    // request branch
121    RequestBranch(bname);
# Line 129 | Line 129 | void OutputMod::CheckAndResolveDep(Bool_
129  
130    const THashTable &ht = GetSel()->GetBranchTable();
131  
132 <  TIterator *iter = ht.MakeIterator();
133 <  const TAMBranchInfo *next = dynamic_cast<const TAMBranchInfo*>(iter->Next());
132 >  TIter iter(ht.MakeIterator());
133 >  const TAMBranchInfo *next = dynamic_cast<const TAMBranchInfo*>(iter.Next());
134  
135    while (next) {
136      const TAMBranchInfo *cur = next;
137 <    next = dynamic_cast<const TAMBranchInfo*>(iter->Next());
137 >    next = dynamic_cast<const TAMBranchInfo*>(iter.Next());
138      Bool_t isloaded = cur->IsLoaded();
139      if (!isloaded)
140        continue;
# Line 157 | Line 157 | void OutputMod::CheckAndResolveDep(Bool_
157        Info("CheckAndResolveDep", "Resolving dependency for loaded branch %s and class %s",
158             bname,cname);
159  
160 <      fBrNameList.AddCopy(string(bname));
161 <      fBrClassList.AddCopy(string(cname));
160 >      fBrNameList.push_back(string(bname));
161 >      fBrClassList.push_back(string(cname));
162        fBranches[GetNBranches()-1] = reinterpret_cast<TObject*>(loader->GetAddress());
163  
164      } else {
# Line 225 | Line 225 | Bool_t OutputMod::IsAcceptedBranch(const
225  
226    // search in branch list
227    for (UInt_t i=0; i<GetNBranches(); ++i) {
228 <    if (fBrNameList.At(i)->compare(bname) == 0)
228 >    if (fBrNameList.at(i).compare(bname) == 0)
229        return kTRUE;
230    }
231  
# Line 281 | Line 281 | void OutputMod::LoadBranches()
281    // Loop over requested branches and load them.
282  
283    for (UInt_t i=0; i<GetNBranches(); ++i) {
284 <    LoadBranch(fBrNameList.At(i)->c_str());
284 >    LoadBranch(fBrNameList.at(i).c_str());
285    }
286   }
287  
# Line 412 | Line 412 | void OutputMod::SetupBranches()
412    // Setup branches in tree writer.
413  
414    for (UInt_t i=0; i<GetNBranches(); ++i) {
415 <    const char *bname = fBrNameList.At(i)->c_str();
416 <    const char *cname = fBrClassList.At(i)->c_str();
415 >    const char *bname = fBrNameList.at(i).c_str();
416 >    const char *cname = fBrClassList.at(i).c_str();
417      if (!fBranches[i]) {
418        Error("SetupBranches", "Pointer for branch with name %s and class %s is NULL.",
419              bname, cname);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines