ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/MitProd/TreeFiller/src/FillMitTree.cc
(Generate patch)

Comparing UserCode/MitProd/TreeFiller/src/FillMitTree.cc (file contents):
Revision 1.51 by loizides, Wed Nov 25 14:45:40 2009 UTC vs.
Revision 1.55 by bendavid, Wed Feb 24 17:38:27 2010 UTC

# Line 15 | Line 15
15   #include "MitProd/TreeFiller/interface/FillerConversions.h"
16   #include "MitProd/TreeFiller/interface/FillerDecayParts.h"
17   #include "MitProd/TreeFiller/interface/FillerElectrons.h"
18 + #include "MitProd/TreeFiller/interface/FillerEvtSelData.h"
19   #include "MitProd/TreeFiller/interface/FillerGenJets.h"
20   #include "MitProd/TreeFiller/interface/FillerGenMet.h"
21   #include "MitProd/TreeFiller/interface/FillerMCEventInfo.h"
# Line 33 | Line 34
34   #include "MitProd/TreeFiller/interface/FillerStableParts.h"
35   #include "MitProd/TreeFiller/interface/FillerStripHits.h"
36   #include "MitProd/TreeFiller/interface/FillerSuperClusters.h"
37 + #include "MitProd/TreeFiller/interface/FillerTrackJets.h"
38   #include "MitProd/TreeFiller/interface/FillerTracks.h"
39   #include "MitProd/TreeFiller/interface/FillerVertexes.h"
40   #include "MitAna/DataTree/interface/Names.h"
# Line 88 | Line 90 | bool FillMitTree::addActiveFiller(BaseFi
90   }
91  
92   //--------------------------------------------------------------------------------------------------
93 + void FillMitTree::beginRun(edm::Run const &run, edm::EventSetup const &setup)
94 + {
95 +
96 +  // loop over the various components and book the branches
97 +  for (std::vector<BaseFiller*>::iterator iF = fillers_.begin(); iF != fillers_.end(); ++iF) {
98 +    edm::LogInfo("FillMitTree::beginJob") << "Booking for " << (*iF)->Name() << endl;
99 +    (*iF)->BookDataBlock(*tws_, setup);
100 +  }
101 +
102 +  // call branch ref for the event tree
103 +  if (brtable_ && tws_->GetTree())
104 +    tws_->GetTree()->BranchRef();
105 +
106 +  // Access and copy event content.
107 +
108 +  // first step: Loop over the data fillers of the various components
109 +  for (std::vector<BaseFiller*>::const_iterator iF = fillers_.begin(); iF != fillers_.end(); ++iF) {
110 +    (*iF)->FillRunBlock(run,setup);
111 +  }
112 +
113 + }
114 +
115 + //--------------------------------------------------------------------------------------------------
116   void FillMitTree::analyze(const edm::Event      &event,
117                            const edm::EventSetup &setup)
118   {
# Line 124 | Line 149 | void FillMitTree::analyze(const edm::Eve
149   }
150  
151   //--------------------------------------------------------------------------------------------------
152 < void FillMitTree::beginJob(const edm::EventSetup &event)
152 > void FillMitTree::beginJob()
153   {
154    // Access the tree and book branches.
155  
# Line 143 | Line 168 | void FillMitTree::beginJob(const edm::Ev
168      os->add(brtable_, brtable_->GetName());
169    }
170  
146  // loop over the various components and book the branches
147  for (std::vector<BaseFiller*>::iterator iF = fillers_.begin(); iF != fillers_.end(); ++iF) {
148    edm::LogInfo("FillMitTree::beginJob") << "Booking for " << (*iF)->Name() << endl;
149    (*iF)->BookDataBlock(*tws_, event);
150  }
151
152  // call branch ref for the event tree
153  if (brtable_ && tws_->GetTree())
154    tws_->GetTree()->BranchRef();
155  
171   }
172  
173   //--------------------------------------------------------------------------------------------------
# Line 220 | Line 235 | bool FillMitTree::configure(const edm::P
235        continue;
236      }  
237  
238 +    if (ftype.compare("FillerEvtSelData")==0) {
239 +      FillerEvtSelData *fillerEvtSelData = new FillerEvtSelData(cfg, name.c_str(), defactive_);
240 +      addActiveFiller(fillerEvtSelData);
241 +      continue;
242 +    }
243 +
244      if (ftype.compare("FillerBeamSpot")==0) {
245        FillerBeamSpot *fillerBeamSpot = new FillerBeamSpot(cfg, name.c_str(), defactive_);
246        addActiveFiller(fillerBeamSpot);
247        continue;
248      }
249 <  
249 >
250      if (ftype.compare("FillerVertexes")==0) {
251        FillerVertexes *fillerVertexes = new FillerVertexes(cfg, name.c_str(), defactive_);
252        addActiveFiller(fillerVertexes);
# Line 368 | Line 389 | bool FillMitTree::configure(const edm::P
389        continue;
390      }  
391      
392 +    if (ftype.compare("FillerTrackJets")==0) {
393 +      FillerTrackJets *fillerTrackJets = new FillerTrackJets(cfg, name.c_str(), defactive_);
394 +      addActiveFiller(fillerTrackJets);
395 +      continue;
396 +    }  
397 +
398      edm::LogError("FillMitTree")
399        << "Unknown fillerType " << ftype << " for pset named " << name << std::endl;
400      throw edm::Exception(edm::errors::Configuration, "FillMitTree::configure\n")

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines