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::one::EDAnalyzer< edm::one::SharedResources > edm::one::EDAnalyzerBase edm::EDConsumerBase

Public Member Functions

 L1ExtraTreeProducer (const edm::ParameterSet &)
 
 ~L1ExtraTreeProducer () override
 
- Public Member Functions inherited from edm::one::EDAnalyzer< edm::one::SharedResources >
 EDAnalyzer ()=default
 
 EDAnalyzer (const EDAnalyzer &)=delete
 
SerialTaskQueueglobalLuminosityBlocksQueue () final
 
SerialTaskQueueglobalRunsQueue () final
 
const EDAnalyzeroperator= (const EDAnalyzer &)=delete
 
bool wantsGlobalLuminosityBlocks () const final
 
bool wantsGlobalRuns () const final
 
bool wantsInputProcessBlocks () const final
 
bool wantsProcessBlocks () const final
 
- Public Member Functions inherited from edm::one::EDAnalyzerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzerBase ()
 
ModuleDescription const & moduleDescription () const
 
bool wantsStreamLuminosityBlocks () const
 
bool wantsStreamRuns () const
 
 ~EDAnalyzerBase () 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
 
ESResolverIndex const * esGetTokenIndices (edm::Transition iTrans) const
 
std::vector< ESResolverIndex > const & esGetTokenIndicesVector (edm::Transition iTrans) const
 
std::vector< ESRecordIndex > const & esGetTokenRecordIndicesVector (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::array< std::vector< ModuleDescription const *> *, NumBranchTypes > &modulesAll, std::vector< ModuleProcessName > &modulesInPreviousProcesses, 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
 
void selectInputProcessBlocks (ProductRegistry const &productRegistry, ProcessBlockHelperBase const &processBlockHelperBase)
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
void updateLookup (eventsetup::ESRecordsToProductResolverIndices 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::one::EDAnalyzerBase
typedef EDAnalyzerBase ModuleType
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Static Public Member Functions inherited from edm::one::EDAnalyzerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
template<BranchType B = InEvent>
EDConsumerBaseAdaptor< Bconsumes (edm::InputTag tag) noexcept
 
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 ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes ()
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
template<Transition Tr = Transition::Event>
constexpr auto esConsumes ()
 
template<Transition Tr = Transition::Event>
auto esConsumes (ESInputTag tag)
 
template<Transition Tr = Transition::Event>
ESGetTokenGeneric esConsumes (eventsetup::EventSetupRecordKey const &iRecord, eventsetup::DataKey const &iKey)
 Used with EventSetupRecord::doGet. More...
 
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)
 
void resetItemsToGetFrom (BranchType iType)
 

Detailed Description

Description: Produce L1 Extra tree

Implementation:

Definition at line 55 of file L1ExtraTreeProducer.cc.

Constructor & Destructor Documentation

◆ L1ExtraTreeProducer()

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

Definition at line 91 of file L1ExtraTreeProducer.cc.

References cenJetToken_, fs_, fwdJetToken_, L1Analysis::L1AnalysisL1Extra::getData(), edm::ParameterSet::getParameter(), edm::ParameterSet::getUntrackedParameter(), hfRingsToken_, isoEmToken_, isoTauJetToken_, TFileService::kSharedResource, 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 
117 
118  usesResource(TFileService::kSharedResource);
119  // set up output
120  tree_ = fs_->make<TTree>("L1ExtraTree", "L1ExtraTree");
121  tree_->Branch("L1Extra", "L1Analysis::L1AnalysisL1ExtraDataFormat", &l1ExtraData, 32000, 3);
122 }
static const std::string kSharedResource
Definition: TFileService.h:76
edm::EDGetTokenT< l1extra::L1JetParticleCollection > cenJetToken_
T getParameter(std::string const &) const
Definition: ParameterSet.h:307
edm::EDGetTokenT< l1extra::L1EtMissParticleCollection > mhtToken_
edm::EDGetTokenT< l1extra::L1EtMissParticleCollection > metToken_
edm::EDGetTokenT< l1extra::L1JetParticleCollection > tauJetToken_
edm::EDGetTokenT< l1extra::L1HFRingsCollection > hfRingsToken_
T getUntrackedParameter(std::string const &, T const &) const
L1AnalysisL1ExtraDataFormat * getData()
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_
T * make(const Args &...args) const
make new ROOT object
Definition: TFileService.h:64
edm::EDGetTokenT< l1extra::L1JetParticleCollection > isoTauJetToken_
L1Analysis::L1AnalysisL1Extra * l1Extra

◆ ~L1ExtraTreeProducer()

L1ExtraTreeProducer::~L1ExtraTreeProducer ( )
override

Definition at line 124 of file L1ExtraTreeProducer.cc.

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

Member Function Documentation

◆ analyze()

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

Implements edm::one::EDAnalyzerBase.

Definition at line 134 of file L1ExtraTreeProducer.cc.

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

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

◆ beginJob()

void L1ExtraTreeProducer::beginJob ( void  )
overrideprivatevirtual

Reimplemented from edm::one::EDAnalyzerBase.

Definition at line 224 of file L1ExtraTreeProducer.cc.

224 {}

◆ endJob()

void L1ExtraTreeProducer::endJob ( void  )
overrideprivatevirtual

Reimplemented from edm::one::EDAnalyzerBase.

Definition at line 227 of file L1ExtraTreeProducer.cc.

227 {}

Member Data Documentation

◆ cenJetToken_

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

Definition at line 83 of file L1ExtraTreeProducer.cc.

Referenced by analyze(), and L1ExtraTreeProducer().

◆ fs_

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

Definition at line 73 of file L1ExtraTreeProducer.cc.

Referenced by L1ExtraTreeProducer().

◆ fwdJetToken_

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

Definition at line 84 of file L1ExtraTreeProducer.cc.

Referenced by analyze(), and L1ExtraTreeProducer().

◆ hfRingsToken_

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

Definition at line 88 of file L1ExtraTreeProducer.cc.

Referenced by analyze(), and L1ExtraTreeProducer().

◆ isoEmToken_

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

Definition at line 80 of file L1ExtraTreeProducer.cc.

Referenced by analyze(), and L1ExtraTreeProducer().

◆ isoTauJetToken_

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

Definition at line 82 of file L1ExtraTreeProducer.cc.

Referenced by analyze(), and L1ExtraTreeProducer().

◆ l1Extra

L1Analysis::L1AnalysisL1Extra* L1ExtraTreeProducer::l1Extra

Definition at line 66 of file L1ExtraTreeProducer.cc.

Referenced by analyze(), and L1ExtraTreeProducer().

◆ l1ExtraData

L1Analysis::L1AnalysisL1ExtraDataFormat* L1ExtraTreeProducer::l1ExtraData

Definition at line 67 of file L1ExtraTreeProducer.cc.

Referenced by L1ExtraTreeProducer().

◆ maxL1Extra_

unsigned L1ExtraTreeProducer::maxL1Extra_
private

Definition at line 70 of file L1ExtraTreeProducer.cc.

Referenced by analyze(), and L1ExtraTreeProducer().

◆ metToken_

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

Definition at line 86 of file L1ExtraTreeProducer.cc.

Referenced by analyze(), and L1ExtraTreeProducer().

◆ mhtToken_

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

Definition at line 87 of file L1ExtraTreeProducer.cc.

Referenced by analyze(), and L1ExtraTreeProducer().

◆ muonToken_

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

Definition at line 85 of file L1ExtraTreeProducer.cc.

Referenced by analyze(), and L1ExtraTreeProducer().

◆ nonIsoEmToken_

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

Definition at line 79 of file L1ExtraTreeProducer.cc.

Referenced by analyze(), and L1ExtraTreeProducer().

◆ tauJetToken_

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

Definition at line 81 of file L1ExtraTreeProducer.cc.

Referenced by analyze(), and L1ExtraTreeProducer().

◆ tree_

TTree* L1ExtraTreeProducer::tree_
private

Definition at line 76 of file L1ExtraTreeProducer.cc.

Referenced by analyze(), and L1ExtraTreeProducer().