test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Public Attributes | Private Member Functions | Private Attributes
L1ExtraTreeProducer Class Reference

#include <L1Trigger/L1TNtuples/src/L1ExtraTreeProducer.cc>

Inheritance diagram for L1ExtraTreeProducer:
edm::EDAnalyzer edm::EDConsumerBase

Public Member Functions

 L1ExtraTreeProducer (const edm::ParameterSet &)
 
 ~L1ExtraTreeProducer ()
 
- Public Member Functions inherited from edm::EDAnalyzer
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzer ()
 
ModuleDescription const & moduleDescription () const
 
std::string workerType () const
 
virtual ~EDAnalyzer ()
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
 EDConsumerBase ()
 
ProductHolderIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
std::vector
< ProductHolderIndexAndSkipBit >
const & 
itemsToGetFromEvent () const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesDependentUpon (std::string const &iProcessName, std::string const &iModuleLabel, bool iPrint, std::vector< char const * > &oModuleLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
bool registeredToConsume (ProductHolderIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

Public Attributes

L1Analysis::L1AnalysisL1Extral1Extra
 
L1Analysis::L1AnalysisL1ExtraDataFormatl1ExtraData
 

Private Member Functions

virtual void analyze (const edm::Event &, const edm::EventSetup &)
 
virtual void beginJob (void)
 
virtual void endJob ()
 

Private Attributes

edm::EDGetTokenT
< l1extra::L1JetParticleCollection
cenJetToken_
 
edm::Service< TFileServicefs_
 
edm::EDGetTokenT
< l1extra::L1JetParticleCollection
fwdJetToken_
 
edm::EDGetTokenT
< l1extra::L1HFRingsCollection
hfRingsToken_
 
edm::EDGetTokenT
< l1extra::L1EmParticleCollection
isoEmToken_
 
edm::EDGetTokenT
< l1extra::L1JetParticleCollection
isoTauJetToken_
 
unsigned maxL1Extra_
 
edm::EDGetTokenT
< l1extra::L1EtMissParticleCollection
metToken_
 
edm::EDGetTokenT
< l1extra::L1EtMissParticleCollection
mhtToken_
 
edm::EDGetTokenT
< l1extra::L1MuonParticleCollection
muonToken_
 
edm::EDGetTokenT
< l1extra::L1EmParticleCollection
nonIsoEmToken_
 
edm::EDGetTokenT
< l1extra::L1JetParticleCollection
tauJetToken_
 
TTree * tree_
 

Additional Inherited Members

- Public Types inherited from edm::EDAnalyzer
typedef EDAnalyzer ModuleType
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Static Public Member Functions inherited from edm::EDAnalyzer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &)
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 

Detailed Description

Description: Produce L1 Extra tree

Implementation:

Definition at line 56 of file L1ExtraTreeProducer.cc.

Constructor & Destructor Documentation

L1ExtraTreeProducer::L1ExtraTreeProducer ( const edm::ParameterSet iConfig)
explicit

Definition at line 98 of file L1ExtraTreeProducer.cc.

References cenJetToken_, fs_, fwdJetToken_, edm::ParameterSet::getParameter(), edm::ParameterSet::getUntrackedParameter(), hfRingsToken_, isoEmToken_, isoTauJetToken_, l1Extra, l1ExtraData, TFileService::make(), maxL1Extra_, metToken_, mhtToken_, muonToken_, nonIsoEmToken_, tauJetToken_, and tree_.

98  {
99 
100 
101  nonIsoEmToken_ = consumes<l1extra::L1EmParticleCollection>(iConfig.getUntrackedParameter("nonIsoEmToken",edm::InputTag("l1extraParticles:NonIsolated")));
102  isoEmToken_ = consumes<l1extra::L1EmParticleCollection>(iConfig.getUntrackedParameter("isoEmToken",edm::InputTag("l1extraParticles:Isolated")));
103  tauJetToken_ = consumes<l1extra::L1JetParticleCollection>(iConfig.getUntrackedParameter("tauJetToken",edm::InputTag("l1extraParticles:Tau")));
104  isoTauJetToken_ = consumes<l1extra::L1JetParticleCollection>(iConfig.getUntrackedParameter("isoTauJetToken",edm::InputTag("l1extraParticles:IsoTau")));
105  cenJetToken_ = consumes<l1extra::L1JetParticleCollection>(iConfig.getUntrackedParameter("cenJetToken",edm::InputTag("l1extraParticles:Central")));
106  fwdJetToken_ = consumes<l1extra::L1JetParticleCollection>(iConfig.getUntrackedParameter("fwdJetToken",edm::InputTag("l1extraParticles:Forward")));
107  muonToken_ = consumes<l1extra::L1MuonParticleCollection>(iConfig.getUntrackedParameter("muonToken",edm::InputTag("l1extraParticles")));
108  metToken_ = consumes<l1extra::L1EtMissParticleCollection>(iConfig.getUntrackedParameter("metToken",edm::InputTag("l1extraParticles:MET")));
109  mhtToken_ = consumes<l1extra::L1EtMissParticleCollection>(iConfig.getUntrackedParameter("mhtToken",edm::InputTag("l1extraParticles:MHT")));
110  hfRingsToken_ = consumes<l1extra::L1HFRingsCollection>(iConfig.getUntrackedParameter("hfRingsToken",edm::InputTag("l1extraParticles")));
111 
112  maxL1Extra_ = iConfig.getParameter<unsigned int>("maxL1Extra");
113 
115  l1ExtraData = l1Extra->getData();
116 
117  // set up output
118  tree_=fs_->make<TTree>("L1ExtraTree", "L1ExtraTree");
119  tree_->Branch("L1Extra", "L1Analysis::L1AnalysisL1ExtraDataFormat", &l1ExtraData, 32000, 3);
120 
121 }
edm::EDGetTokenT< l1extra::L1JetParticleCollection > cenJetToken_
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
edm::EDGetTokenT< l1extra::L1EtMissParticleCollection > mhtToken_
edm::EDGetTokenT< l1extra::L1EtMissParticleCollection > metToken_
edm::EDGetTokenT< l1extra::L1JetParticleCollection > tauJetToken_
T * make(const Args &...args) const
make new ROOT object
Definition: TFileService.h:64
edm::EDGetTokenT< l1extra::L1HFRingsCollection > hfRingsToken_
L1Analysis::L1AnalysisL1ExtraDataFormat * l1ExtraData
edm::Service< TFileService > fs_
edm::EDGetTokenT< l1extra::L1EmParticleCollection > isoEmToken_
edm::EDGetTokenT< l1extra::L1MuonParticleCollection > muonToken_
edm::EDGetTokenT< l1extra::L1EmParticleCollection > nonIsoEmToken_
edm::EDGetTokenT< l1extra::L1JetParticleCollection > fwdJetToken_
edm::EDGetTokenT< l1extra::L1JetParticleCollection > isoTauJetToken_
L1Analysis::L1AnalysisL1Extra * l1Extra
L1ExtraTreeProducer::~L1ExtraTreeProducer ( )

Definition at line 124 of file L1ExtraTreeProducer.cc.

125 {
126 
127  // do anything here that needs to be done at desctruction time
128  // (e.g. close files, deallocate resources etc.)
129 
130 }

Member Function Documentation

void L1ExtraTreeProducer::analyze ( const edm::Event iEvent,
const edm::EventSetup iSetup 
)
privatevirtual

Implements edm::EDAnalyzer.

Definition at line 139 of file L1ExtraTreeProducer.cc.

References cenJetToken_, fwdJetToken_, edm::Event::getByToken(), hfRingsToken_, isoEmToken_, isoTauJetToken_, edm::HandleBase::isValid(), l1Extra, maxL1Extra_, metToken_, mhtToken_, metsig::muon, muonToken_, nonIsoEmToken_, L1Analysis::L1AnalysisL1Extra::Reset(), L1Analysis::L1AnalysisL1Extra::SetCenJet(), L1Analysis::L1AnalysisL1Extra::SetFwdJet(), L1Analysis::L1AnalysisL1Extra::SetHFring(), L1Analysis::L1AnalysisL1Extra::SetIsoEm(), L1Analysis::L1AnalysisL1Extra::SetIsoTauJet(), L1Analysis::L1AnalysisL1Extra::SetMet(), L1Analysis::L1AnalysisL1Extra::SetMht(), L1Analysis::L1AnalysisL1Extra::SetMuon(), L1Analysis::L1AnalysisL1Extra::SetNonIsoEm(), L1Analysis::L1AnalysisL1Extra::SetTauJet(), tauJetToken_, and tree_.

140 {
141 
142  l1Extra->Reset();
143 
154 
155  iEvent.getByToken(nonIsoEmToken_, nonIsoEm);
156  iEvent.getByToken(isoEmToken_, isoEm);
157  iEvent.getByToken(tauJetToken_, tauJet);
158  iEvent.getByToken(isoTauJetToken_, isoTauJet);
159  iEvent.getByToken(cenJetToken_, cenJet);
160  iEvent.getByToken(fwdJetToken_, fwdJet);
161  iEvent.getByToken(muonToken_, muon);
162  iEvent.getByToken(metToken_, mets);
163  iEvent.getByToken(mhtToken_, mhts);
164  iEvent.getByToken(hfRingsToken_, hfRings);
165 
166  if (isoEm.isValid()){
167  l1Extra->SetIsoEm(isoEm, maxL1Extra_);
168  } else {
169  edm::LogWarning("MissingProduct") << "L1Extra Iso Em not found. Branch will not be filled" << std::endl;
170  }
171 
172  if (nonIsoEm.isValid()){
173  l1Extra->SetNonIsoEm(nonIsoEm, maxL1Extra_);
174  } else {
175  edm::LogWarning("MissingProduct") << "L1Extra Non Iso Em not found. Branch will not be filled" << std::endl;
176  }
177 
178  if (cenJet.isValid()){
179  l1Extra->SetCenJet(cenJet, maxL1Extra_);
180  } else {
181  edm::LogWarning("MissingProduct") << "L1Extra Central Jets not found. Branch will not be filled" << std::endl;
182  }
183 
184  if (tauJet.isValid()){
185  l1Extra->SetTauJet(tauJet, maxL1Extra_);
186  } else {
187  edm::LogWarning("MissingProduct") << "L1Extra Tau Jets not found. Branch will not be filled" << std::endl;
188  }
189 
190  if (isoTauJet.isValid()){
191  l1Extra->SetIsoTauJet(isoTauJet, maxL1Extra_);
192  } else {
193  edm::LogWarning("MissingProduct") << "L1Extra Iso Tau Jets not found. Branch will not be filled" << std::endl;
194  }
195 
196  if (fwdJet.isValid()){
197  l1Extra->SetFwdJet(fwdJet, maxL1Extra_);
198  } else {
199  edm::LogWarning("MissingProduct") << "L1Extra Forward Jets not found. Branch will not be filled" << std::endl;
200  }
201 
202  if (muon.isValid()){
203  l1Extra->SetMuon(muon, maxL1Extra_);
204  } else {
205  edm::LogWarning("MissingProduct") << "L1Extra Muons not found. Branch will not be filled" << std::endl;
206  }
207 
208  if (mets.isValid()){
209  l1Extra->SetMet(mets);
210  } else {
211  edm::LogWarning("MissingProduct") << "L1Extra MET not found. Branch will not be filled" << std::endl;
212  }
213 
214  if (mhts.isValid()){
215  l1Extra->SetMht(mhts);
216  } else {
217  edm::LogWarning("MissingProduct") << "L1Extra MHT not found. Branch will not be filled" << std::endl;
218  }
219 
220  if (hfRings.isValid()){
221  l1Extra->SetHFring(hfRings);
222  } else {
223  edm::LogWarning("MissingProduct") << "L1Extra HF Rings not found. Branch will not be filled" << std::endl;
224  }
225 
226  tree_->Fill();
227 
228 }
void SetNonIsoEm(const edm::Handle< l1extra::L1EmParticleCollection > nonIsoEm, unsigned maxL1Extra)
edm::EDGetTokenT< l1extra::L1JetParticleCollection > cenJetToken_
edm::EDGetTokenT< l1extra::L1EtMissParticleCollection > mhtToken_
void SetIsoEm(const edm::Handle< l1extra::L1EmParticleCollection > isoEm, unsigned maxL1Extra)
edm::EDGetTokenT< l1extra::L1EtMissParticleCollection > metToken_
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:462
void SetMuon(const edm::Handle< l1extra::L1MuonParticleCollection > muon, unsigned maxL1Extra)
edm::EDGetTokenT< l1extra::L1JetParticleCollection > tauJetToken_
void SetTauJet(const edm::Handle< l1extra::L1JetParticleCollection > tauJet, unsigned maxL1Extra)
edm::EDGetTokenT< l1extra::L1HFRingsCollection > hfRingsToken_
void SetMet(const edm::Handle< l1extra::L1EtMissParticleCollection > mets)
void SetHFring(const edm::Handle< l1extra::L1HFRingsCollection > hfRings)
bool isValid() const
Definition: HandleBase.h:75
edm::EDGetTokenT< l1extra::L1EmParticleCollection > isoEmToken_
edm::EDGetTokenT< l1extra::L1MuonParticleCollection > muonToken_
void SetIsoTauJet(const edm::Handle< l1extra::L1JetParticleCollection > isoTauJet, unsigned maxL1Extra)
edm::EDGetTokenT< l1extra::L1EmParticleCollection > nonIsoEmToken_
edm::EDGetTokenT< l1extra::L1JetParticleCollection > fwdJetToken_
void SetFwdJet(const edm::Handle< l1extra::L1JetParticleCollection > fwdJet, unsigned maxL1Extra)
void SetMht(const edm::Handle< l1extra::L1EtMissParticleCollection > mhts)
edm::EDGetTokenT< l1extra::L1JetParticleCollection > isoTauJetToken_
L1Analysis::L1AnalysisL1Extra * l1Extra
void SetCenJet(const edm::Handle< l1extra::L1JetParticleCollection > cenJet, unsigned maxL1Extra)
void L1ExtraTreeProducer::beginJob ( void  )
privatevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 232 of file L1ExtraTreeProducer.cc.

233 {
234 }
void L1ExtraTreeProducer::endJob ( void  )
privatevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 238 of file L1ExtraTreeProducer.cc.

238  {
239 }

Member Data Documentation

edm::EDGetTokenT<l1extra::L1JetParticleCollection> L1ExtraTreeProducer::cenJetToken_
private

Definition at line 87 of file L1ExtraTreeProducer.cc.

Referenced by analyze(), and L1ExtraTreeProducer().

edm::Service<TFileService> L1ExtraTreeProducer::fs_
private

Definition at line 77 of file L1ExtraTreeProducer.cc.

Referenced by L1ExtraTreeProducer().

edm::EDGetTokenT<l1extra::L1JetParticleCollection> L1ExtraTreeProducer::fwdJetToken_
private

Definition at line 88 of file L1ExtraTreeProducer.cc.

Referenced by analyze(), and L1ExtraTreeProducer().

edm::EDGetTokenT<l1extra::L1HFRingsCollection> L1ExtraTreeProducer::hfRingsToken_
private

Definition at line 92 of file L1ExtraTreeProducer.cc.

Referenced by analyze(), and L1ExtraTreeProducer().

edm::EDGetTokenT<l1extra::L1EmParticleCollection> L1ExtraTreeProducer::isoEmToken_
private

Definition at line 84 of file L1ExtraTreeProducer.cc.

Referenced by analyze(), and L1ExtraTreeProducer().

edm::EDGetTokenT<l1extra::L1JetParticleCollection> L1ExtraTreeProducer::isoTauJetToken_
private

Definition at line 86 of file L1ExtraTreeProducer.cc.

Referenced by analyze(), and L1ExtraTreeProducer().

L1Analysis::L1AnalysisL1Extra* L1ExtraTreeProducer::l1Extra

Definition at line 69 of file L1ExtraTreeProducer.cc.

Referenced by analyze(), and L1ExtraTreeProducer().

L1Analysis::L1AnalysisL1ExtraDataFormat* L1ExtraTreeProducer::l1ExtraData

Definition at line 70 of file L1ExtraTreeProducer.cc.

Referenced by L1ExtraTreeProducer().

unsigned L1ExtraTreeProducer::maxL1Extra_
private

Definition at line 74 of file L1ExtraTreeProducer.cc.

Referenced by analyze(), and L1ExtraTreeProducer().

edm::EDGetTokenT<l1extra::L1EtMissParticleCollection> L1ExtraTreeProducer::metToken_
private

Definition at line 90 of file L1ExtraTreeProducer.cc.

Referenced by analyze(), and L1ExtraTreeProducer().

edm::EDGetTokenT<l1extra::L1EtMissParticleCollection> L1ExtraTreeProducer::mhtToken_
private

Definition at line 91 of file L1ExtraTreeProducer.cc.

Referenced by analyze(), and L1ExtraTreeProducer().

edm::EDGetTokenT<l1extra::L1MuonParticleCollection> L1ExtraTreeProducer::muonToken_
private

Definition at line 89 of file L1ExtraTreeProducer.cc.

Referenced by analyze(), and L1ExtraTreeProducer().

edm::EDGetTokenT<l1extra::L1EmParticleCollection> L1ExtraTreeProducer::nonIsoEmToken_
private

Definition at line 83 of file L1ExtraTreeProducer.cc.

Referenced by analyze(), and L1ExtraTreeProducer().

edm::EDGetTokenT<l1extra::L1JetParticleCollection> L1ExtraTreeProducer::tauJetToken_
private

Definition at line 85 of file L1ExtraTreeProducer.cc.

Referenced by analyze(), and L1ExtraTreeProducer().

TTree* L1ExtraTreeProducer::tree_
private

Definition at line 80 of file L1ExtraTreeProducer.cc.

Referenced by analyze(), and L1ExtraTreeProducer().