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.2 by loizides, Wed Jun 18 19:17:21 2008 UTC vs.
Revision 1.3 by loizides, Thu Jun 19 16:53:43 2008 UTC

# Line 1 | Line 1
1   // $Id$
2  
3 + #include "MitProd/TreeFiller/interface/FillMitTree.h"
4   #include "FWCore/MessageLogger/interface/MessageLogger.h"
4 #include "FWCore/Framework/interface/ESHandle.h"
5 #include "DataFormats/Common/interface/Handle.h"
5   #include "FWCore/ServiceRegistry/interface/Service.h"
6 <
7 < #include "MitProd/TreeFiller/interface/FillMitTree.h"
6 > #include "MitProd/TreeService/interface/TreeService.h"
7 > #include "MitProd/TreeFiller/interface/FillerMetaInfos.h"
8   #include "MitProd/TreeFiller/interface/FillerGlobalMuons.h"
9  
10   using namespace std;
# Line 17 | Line 16 | FillMitTree::FillMitTree(const edm::Para
16   {
17    // Constructor: initialize fillers
18  
19 <  FillerGlobalMuons *fillerGlobalMuons = new FillerGlobalMuons(cfg);
20 <  if (fillerGlobalMuons->Active())
21 <    fillers_.push_back(fillerGlobalMuons);
22 <  else
24 <    delete fillerGlobalMuons;
19 >  if (!configure(cfg)) {
20 >    throw edm::Exception(edm::errors::Configuration, "FillMitTree::FillMitTree()\n")
21 >      << "Could not configure fillers." << "\n";
22 >  }
23   }
24  
25   //-------------------------------------------------------------------------------------------------
# Line 31 | Line 29 | FillMitTree::~FillMitTree()
29   }
30  
31   //-------------------------------------------------------------------------------------------------
32 < void FillMitTree::beginJob(edm::EventSetup const &event)
32 > void FillMitTree::analyze(const edm::Event      &event,
33 >                          const edm::EventSetup &setup)
34 > {
35 >  // Access and copy event content.
36 >
37 >  // First step: Loop over the data fillers of the various components
38 >  for (std::vector<BaseFiller*>::const_iterator iF = fillers_.begin(); iF != fillers_.end(); ++iF) {
39 >    (*iF)->FillDataBlock(event,setup);
40 >  }
41 >
42 >  // Second step: Loop over the link resolution of the various components
43 >  for (std::vector<BaseFiller*>::const_iterator iF = fillers_.begin(); iF != fillers_.end(); ++iF) {
44 >    (*iF)->ResolveLinks(event,setup);
45 >  }
46 > }
47 >
48 > //-------------------------------------------------------------------------------------------------
49 > void FillMitTree::beginJob(const edm::EventSetup &event)
50   {
51    // Access the tree and book branches.
52  
# Line 51 | Line 66 | void FillMitTree::beginJob(edm::EventSet
66   }
67  
68   //-------------------------------------------------------------------------------------------------
69 < void FillMitTree::analyze(const edm::Event      &event,
55 <                          const edm::EventSetup &setup)
69 > bool FillMitTree::configure(const edm::ParameterSet &cfg)
70   {
71 <  // Access and copy event content.
71 >  // Configure our fillers.
72  
59  // First step: Loop over the data fillers of the various components
60  for (std::vector<BaseFiller*>::const_iterator iF = fillers_.begin(); iF != fillers_.end(); ++iF) {
61    (*iF)->FillDataBlock(event,setup);
62  }
73  
74 <  // Second step: Loop over the link resolution of the various components
75 <  for (std::vector<BaseFiller*>::const_iterator iF = fillers_.begin(); iF != fillers_.end(); ++iF) {
76 <    (*iF)->ResolveLinks(event,setup);
77 <  }
74 >  FillerMetaInfos *fillerMetaInfos = new FillerMetaInfos(cfg);
75 >  if (fillerMetaInfos->Active())
76 >    fillers_.push_back(fillerMetaInfos);
77 >  else
78 >    delete fillerMetaInfos;
79 >
80 >  FillerGlobalMuons *fillerGlobalMuons = new FillerGlobalMuons(cfg);
81 >  if (fillerGlobalMuons->Active())
82 >    fillers_.push_back(fillerGlobalMuons);
83 >  else
84 >    delete fillerGlobalMuons;
85 >
86 >  return 1;
87   }
88  
89   //-------------------------------------------------------------------------------------------------

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines