CMS 3D CMS Logo

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 () override
 
- Public Member Functions inherited from edm::EDAnalyzer
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzer ()
 
SerialTaskQueueglobalLuminosityBlocksQueue ()
 
SerialTaskQueueglobalRunsQueue ()
 
ModuleDescription const & moduleDescription () const
 
std::string workerType () const
 
 ~EDAnalyzer () override
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
void convertCurrentProcessAlias (std::string const &processName)
 Convert "@currentProcess" in InputTag process names to the actual current process name. More...
 
 EDConsumerBase ()
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
ESProxyIndex const * esGetTokenIndices (edm::Transition iTrans) const
 
ProductResolverIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
std::vector< ProductResolverIndexAndSkipBit > const & itemsToGetFrom (BranchType iType) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
void updateLookup (eventsetup::ESRecordsToProxyIndices const &)
 
virtual ~EDConsumerBase () noexcept(false)
 

Public Attributes

L1Analysis::L1AnalysisL1Extral1Extra
 
L1Analysis::L1AnalysisL1ExtraDataFormatl1ExtraData
 

Private Member Functions

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

Private Attributes

edm::EDGetTokenT< l1extra::L1JetParticleCollectioncenJetToken_
 
edm::Service< TFileServicefs_
 
edm::EDGetTokenT< l1extra::L1JetParticleCollectionfwdJetToken_
 
edm::EDGetTokenT< l1extra::L1HFRingsCollectionhfRingsToken_
 
edm::EDGetTokenT< l1extra::L1EmParticleCollectionisoEmToken_
 
edm::EDGetTokenT< l1extra::L1JetParticleCollectionisoTauJetToken_
 
unsigned maxL1Extra_
 
edm::EDGetTokenT< l1extra::L1EtMissParticleCollectionmetToken_
 
edm::EDGetTokenT< l1extra::L1EtMissParticleCollectionmhtToken_
 
edm::EDGetTokenT< l1extra::L1MuonParticleCollectionmuonToken_
 
edm::EDGetTokenT< l1extra::L1EmParticleCollectionnonIsoEmToken_
 
edm::EDGetTokenT< l1extra::L1JetParticleCollectiontauJetToken_
 
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 &)
 
static bool wantsGlobalLuminosityBlocks ()
 
static bool wantsGlobalRuns ()
 
static bool wantsStreamLuminosityBlocks ()
 
static bool wantsStreamRuns ()
 
- 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 ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes ()
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
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 55 of file L1ExtraTreeProducer.cc.

Constructor & Destructor Documentation

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

Definition at line 91 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_.

91  {
92  nonIsoEmToken_ = consumes<l1extra::L1EmParticleCollection>(
93  iConfig.getUntrackedParameter("nonIsoEmToken", edm::InputTag("l1extraParticles:NonIsolated")));
94  isoEmToken_ = consumes<l1extra::L1EmParticleCollection>(
95  iConfig.getUntrackedParameter("isoEmToken", edm::InputTag("l1extraParticles:Isolated")));
96  tauJetToken_ = consumes<l1extra::L1JetParticleCollection>(
97  iConfig.getUntrackedParameter("tauJetToken", edm::InputTag("l1extraParticles:Tau")));
98  isoTauJetToken_ = consumes<l1extra::L1JetParticleCollection>(
99  iConfig.getUntrackedParameter("isoTauJetToken", edm::InputTag("l1extraParticles:IsoTau")));
100  cenJetToken_ = consumes<l1extra::L1JetParticleCollection>(
101  iConfig.getUntrackedParameter("cenJetToken", edm::InputTag("l1extraParticles:Central")));
102  fwdJetToken_ = consumes<l1extra::L1JetParticleCollection>(
103  iConfig.getUntrackedParameter("fwdJetToken", edm::InputTag("l1extraParticles:Forward")));
104  muonToken_ = consumes<l1extra::L1MuonParticleCollection>(
105  iConfig.getUntrackedParameter("muonToken", edm::InputTag("l1extraParticles")));
106  metToken_ = consumes<l1extra::L1EtMissParticleCollection>(
107  iConfig.getUntrackedParameter("metToken", edm::InputTag("l1extraParticles:MET")));
108  mhtToken_ = consumes<l1extra::L1EtMissParticleCollection>(
109  iConfig.getUntrackedParameter("mhtToken", edm::InputTag("l1extraParticles:MHT")));
110  hfRingsToken_ = consumes<l1extra::L1HFRingsCollection>(
111  iConfig.getUntrackedParameter("hfRingsToken", edm::InputTag("l1extraParticles")));
112 
113  maxL1Extra_ = iConfig.getParameter<unsigned int>("maxL1Extra");
114 
116  l1ExtraData = l1Extra->getData();
117 
118  // set up output
119  tree_ = fs_->make<TTree>("L1ExtraTree", "L1ExtraTree");
120  tree_->Branch("L1Extra", "L1Analysis::L1AnalysisL1ExtraDataFormat", &l1ExtraData, 32000, 3);
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 ( )
override

Definition at line 123 of file L1ExtraTreeProducer.cc.

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

Member Function Documentation

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

Definition at line 133 of file L1ExtraTreeProducer.cc.

References cenJetToken_, fwdJetToken_, edm::Event::getByToken(), hfRingsToken_, isoEmToken_, isoTauJetToken_, edm::HandleBase::isValid(), l1Extra, maxL1Extra_, singleTopDQM_cfi::mets, metToken_, mhtToken_, HLT_2018_cff::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_.

133  {
134  l1Extra->Reset();
135 
143  ;
147 
148  iEvent.getByToken(nonIsoEmToken_, nonIsoEm);
149  iEvent.getByToken(isoEmToken_, isoEm);
150  iEvent.getByToken(tauJetToken_, tauJet);
151  iEvent.getByToken(isoTauJetToken_, isoTauJet);
152  iEvent.getByToken(cenJetToken_, cenJet);
153  iEvent.getByToken(fwdJetToken_, fwdJet);
154  iEvent.getByToken(muonToken_, muon);
155  iEvent.getByToken(metToken_, mets);
156  iEvent.getByToken(mhtToken_, mhts);
157  iEvent.getByToken(hfRingsToken_, hfRings);
158 
159  if (isoEm.isValid()) {
160  l1Extra->SetIsoEm(isoEm, maxL1Extra_);
161  } else {
162  edm::LogWarning("MissingProduct") << "L1Extra Iso Em not found. Branch will not be filled" << std::endl;
163  }
164 
165  if (nonIsoEm.isValid()) {
166  l1Extra->SetNonIsoEm(nonIsoEm, maxL1Extra_);
167  } else {
168  edm::LogWarning("MissingProduct") << "L1Extra Non Iso Em not found. Branch will not be filled" << std::endl;
169  }
170 
171  if (cenJet.isValid()) {
172  l1Extra->SetCenJet(cenJet, maxL1Extra_);
173  } else {
174  edm::LogWarning("MissingProduct") << "L1Extra Central Jets not found. Branch will not be filled" << std::endl;
175  }
176 
177  if (tauJet.isValid()) {
178  l1Extra->SetTauJet(tauJet, maxL1Extra_);
179  } else {
180  edm::LogWarning("MissingProduct") << "L1Extra Tau Jets not found. Branch will not be filled" << std::endl;
181  }
182 
183  if (isoTauJet.isValid()) {
184  l1Extra->SetIsoTauJet(isoTauJet, maxL1Extra_);
185  } else {
186  edm::LogWarning("MissingProduct") << "L1Extra Iso Tau Jets not found. Branch will not be filled" << std::endl;
187  }
188 
189  if (fwdJet.isValid()) {
190  l1Extra->SetFwdJet(fwdJet, maxL1Extra_);
191  } else {
192  edm::LogWarning("MissingProduct") << "L1Extra Forward Jets not found. Branch will not be filled" << std::endl;
193  }
194 
195  if (muon.isValid()) {
196  l1Extra->SetMuon(muon, maxL1Extra_);
197  } else {
198  edm::LogWarning("MissingProduct") << "L1Extra Muons not found. Branch will not be filled" << std::endl;
199  }
200 
201  if (mets.isValid()) {
202  l1Extra->SetMet(mets);
203  } else {
204  edm::LogWarning("MissingProduct") << "L1Extra MET not found. Branch will not be filled" << std::endl;
205  }
206 
207  if (mhts.isValid()) {
208  l1Extra->SetMht(mhts);
209  } else {
210  edm::LogWarning("MissingProduct") << "L1Extra MHT not found. Branch will not be filled" << std::endl;
211  }
212 
213  if (hfRings.isValid()) {
214  l1Extra->SetHFring(hfRings);
215  } else {
216  edm::LogWarning("MissingProduct") << "L1Extra HF Rings not found. Branch will not be filled" << std::endl;
217  }
218 
219  tree_->Fill();
220 }
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:525
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:70
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  )
overrideprivatevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 223 of file L1ExtraTreeProducer.cc.

223 {}
void L1ExtraTreeProducer::endJob ( void  )
overrideprivatevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 226 of file L1ExtraTreeProducer.cc.

References DEFINE_FWK_MODULE.

226 {}

Member Data Documentation

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

Definition at line 83 of file L1ExtraTreeProducer.cc.

Referenced by analyze(), and L1ExtraTreeProducer().

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

Definition at line 73 of file L1ExtraTreeProducer.cc.

Referenced by L1ExtraTreeProducer().

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

Definition at line 84 of file L1ExtraTreeProducer.cc.

Referenced by analyze(), and L1ExtraTreeProducer().

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

Definition at line 88 of file L1ExtraTreeProducer.cc.

Referenced by analyze(), and L1ExtraTreeProducer().

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

Definition at line 80 of file L1ExtraTreeProducer.cc.

Referenced by analyze(), and L1ExtraTreeProducer().

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

Definition at line 82 of file L1ExtraTreeProducer.cc.

Referenced by analyze(), and L1ExtraTreeProducer().

L1Analysis::L1AnalysisL1Extra* L1ExtraTreeProducer::l1Extra

Definition at line 66 of file L1ExtraTreeProducer.cc.

Referenced by analyze(), and L1ExtraTreeProducer().

L1Analysis::L1AnalysisL1ExtraDataFormat* L1ExtraTreeProducer::l1ExtraData

Definition at line 67 of file L1ExtraTreeProducer.cc.

Referenced by L1ExtraTreeProducer().

unsigned L1ExtraTreeProducer::maxL1Extra_
private

Definition at line 70 of file L1ExtraTreeProducer.cc.

Referenced by analyze(), and L1ExtraTreeProducer().

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

Definition at line 86 of file L1ExtraTreeProducer.cc.

Referenced by analyze(), and L1ExtraTreeProducer().

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

Definition at line 87 of file L1ExtraTreeProducer.cc.

Referenced by analyze(), and L1ExtraTreeProducer().

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

Definition at line 85 of file L1ExtraTreeProducer.cc.

Referenced by analyze(), and L1ExtraTreeProducer().

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

Definition at line 79 of file L1ExtraTreeProducer.cc.

Referenced by analyze(), and L1ExtraTreeProducer().

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

Definition at line 81 of file L1ExtraTreeProducer.cc.

Referenced by analyze(), and L1ExtraTreeProducer().

TTree* L1ExtraTreeProducer::tree_
private

Definition at line 76 of file L1ExtraTreeProducer.cc.

Referenced by analyze(), and L1ExtraTreeProducer().