CMS 3D CMS Logo

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
List of all members | Public Member Functions | Private Attributes
L1ExtraTestAnalyzer Class Reference
Inheritance diagram for L1ExtraTestAnalyzer:
edm::one::EDAnalyzer<> edm::one::EDAnalyzerBase edm::EDConsumerBase

Public Member Functions

void analyze (const edm::Event &, const edm::EventSetup &) override
 
 L1ExtraTestAnalyzer (const edm::ParameterSet &)
 
 ~L1ExtraTestAnalyzer () override
 
- Public Member Functions inherited from edm::one::EDAnalyzer<>
 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
 
ESProxyIndex const * esGetTokenIndices (edm::Transition iTrans) const
 
std::vector< ESProxyIndex > 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
 
bool registeredToConsumeMany (TypeID const &, 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::ESRecordsToProxyIndices const &)
 
virtual ~EDConsumerBase () noexcept(false)
 

Private Attributes

edm::InputTag cenJetSource_
 
edm::InputTag etMissSource_
 
TFile file_
 
edm::InputTag forJetSource_
 
edm::InputTag gtReadoutSource_
 
edm::InputTag hfRingsSource_
 
TH1F hist_
 
edm::InputTag htMissSource_
 
edm::InputTag isoEmSource_
 
edm::InputTag muonSource_
 
edm::InputTag nonIsoEmSource_
 
edm::InputTag particleMapSource_
 
edm::InputTag tauJetSource_
 

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 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<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

L1TriggerOffline/L1ExtraTestAnalyzer/src/L1ExtraTestAnalyzer.cc

Author
Werner Sun

Description: simple analyzer to print out L1Extra object information.

Definition at line 54 of file L1ExtraTestAnalyzer.cc.

Constructor & Destructor Documentation

◆ L1ExtraTestAnalyzer()

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

Definition at line 91 of file L1ExtraTestAnalyzer.cc.

92  : isoEmSource_(iConfig.getParameter<edm::InputTag>("isolatedEmSource")),
93  nonIsoEmSource_(iConfig.getParameter<edm::InputTag>("nonIsolatedEmSource")),
94  cenJetSource_(iConfig.getParameter<edm::InputTag>("centralJetSource")),
95  forJetSource_(iConfig.getParameter<edm::InputTag>("forwardJetSource")),
96  tauJetSource_(iConfig.getParameter<edm::InputTag>("tauJetSource")),
97  muonSource_(iConfig.getParameter<edm::InputTag>("muonSource")),
98  etMissSource_(iConfig.getParameter<edm::InputTag>("etMissSource")),
99  htMissSource_(iConfig.getParameter<edm::InputTag>("htMissSource")),
100  hfRingsSource_(iConfig.getParameter<edm::InputTag>("hfRingsSource")),
101  gtReadoutSource_(iConfig.getParameter<edm::InputTag>("gtReadoutSource")),
102  particleMapSource_(iConfig.getParameter<edm::InputTag>("particleMapSource")),
103  file_("l1extra.root", "RECREATE"),
104  hist_("triggers",
105  "Triggers",
107  -0.75,
109  // now do what ever initialization is needed
110 }
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
edm::InputTag nonIsoEmSource_
edm::InputTag particleMapSource_
edm::InputTag gtReadoutSource_
edm::InputTag hfRingsSource_

◆ ~L1ExtraTestAnalyzer()

L1ExtraTestAnalyzer::~L1ExtraTestAnalyzer ( )
override

Definition at line 112 of file L1ExtraTestAnalyzer.cc.

References file_, and hist_.

112  {
113  // do anything here that needs to be done at desctruction time
114  // (e.g. close files, deallocate resources etc.)
115 
116  file_.cd();
117  hist_.Write();
118 }

Member Function Documentation

◆ analyze()

void L1ExtraTestAnalyzer::analyze ( const edm::Event iEvent,
const edm::EventSetup iSetup 
)
overridevirtual

Implements edm::one::EDAnalyzerBase.

Definition at line 125 of file L1ExtraTestAnalyzer.cc.

References cenJetSource_, gather_cfg::cout, etMissSource_, forJetSource_, hfRingsSource_, htMissSource_, mps_fire::i, caHitNtupletGeneratorKernels::iev, iEvent, isoEmSource_, muonSource_, nonIsoEmSource_, and tauJetSource_.

125  {
126  using namespace edm;
127  using namespace l1extra;
128 
129  static int iev = 0;
130  cout << "EVENT " << ++iev << endl;
131 
132  cout << "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~" << endl;
133 
134  // Isolated EM particles
136  iEvent.getByLabel(isoEmSource_, isoEmColl);
137  cout << "Number of isolated EM " << isoEmColl->size() << endl;
138 
139  for (L1EmParticleCollection::const_iterator emItr = isoEmColl->begin(); emItr != isoEmColl->end(); ++emItr) {
140  cout << " p4 (" << emItr->px() << ", " << emItr->py() << ", " << emItr->pz() << ", " << emItr->energy() << ") et "
141  << emItr->et() << " eta " << emItr->eta() << " phi " << emItr->phi() << endl;
142  }
143 
144  // Non-isolated EM particles
145  Handle<L1EmParticleCollection> nonIsoEmColl;
146  iEvent.getByLabel(nonIsoEmSource_, nonIsoEmColl);
147  cout << "Number of non-isolated EM " << nonIsoEmColl->size() << endl;
148 
149  for (L1EmParticleCollection::const_iterator emItr = nonIsoEmColl->begin(); emItr != nonIsoEmColl->end(); ++emItr) {
150  cout << " p4 (" << emItr->px() << ", " << emItr->py() << ", " << emItr->pz() << ", " << emItr->energy() << ") et "
151  << emItr->et() << " eta " << emItr->eta() << " phi " << emItr->phi() << endl;
152  }
153 
154  // Jet particles
156  iEvent.getByLabel(cenJetSource_, cenJetColl);
157  cout << "Number of central jets " << cenJetColl->size() << endl;
158 
159  for (L1JetParticleCollection::const_iterator jetItr = cenJetColl->begin(); jetItr != cenJetColl->end(); ++jetItr) {
160  cout << " p4 (" << jetItr->px() << ", " << jetItr->py() << ", " << jetItr->pz() << ", " << jetItr->energy()
161  << ") et " << jetItr->et() << " eta " << jetItr->eta() << " phi " << jetItr->phi() << endl;
162  }
163 
165  iEvent.getByLabel(forJetSource_, forJetColl);
166  cout << "Number of forward jets " << forJetColl->size() << endl;
167 
168  for (L1JetParticleCollection::const_iterator jetItr = forJetColl->begin(); jetItr != forJetColl->end(); ++jetItr) {
169  cout << " p4 (" << jetItr->px() << ", " << jetItr->py() << ", " << jetItr->pz() << ", " << jetItr->energy()
170  << ") et " << jetItr->et() << " eta " << jetItr->eta() << " phi " << jetItr->phi() << endl;
171  }
172 
174  iEvent.getByLabel(tauJetSource_, tauColl);
175  cout << "Number of tau jets " << tauColl->size() << endl;
176 
177  for (L1JetParticleCollection::const_iterator tauItr = tauColl->begin(); tauItr != tauColl->end(); ++tauItr) {
178  cout << " p4 (" << tauItr->px() << ", " << tauItr->py() << ", " << tauItr->pz() << ", " << tauItr->energy()
179  << ") et " << tauItr->et() << " eta " << tauItr->eta() << " phi " << tauItr->phi() << endl;
180  }
181 
182  // Muon particles
184  iEvent.getByLabel(muonSource_, muColl);
185  cout << "Number of muons " << muColl->size() << endl;
186 
187  for (L1MuonParticleCollection::const_iterator muItr = muColl->begin(); muItr != muColl->end(); ++muItr) {
188  cout << " q " << muItr->charge() << " p4 (" << muItr->px() << ", " << muItr->py() << ", " << muItr->pz() << ", "
189  << muItr->energy() << ") et " << muItr->et() << " eta " << muItr->eta() << endl
190  << " phi " << muItr->phi() << " iso " << muItr->isIsolated() << " mip " << muItr->isMip() << " fwd "
191  << muItr->isForward() << " rpc " << muItr->isRPC() << endl;
192  }
193 
194  // MET
196  iEvent.getByLabel(etMissSource_, etMissColl);
197  cout << "MET Coll (" << etMissColl->begin()->px() << ", " << etMissColl->begin()->py() << ", "
198  << etMissColl->begin()->pz() << ", " << etMissColl->begin()->energy() << ") phi " << etMissColl->begin()->phi()
199  << " EtTot " << etMissColl->begin()->etTotal() << endl;
200 
201  // MHT
203  iEvent.getByLabel(htMissSource_, htMissColl);
204  cout << "MHT Coll (" << htMissColl->begin()->px() << ", " << htMissColl->begin()->py() << ", "
205  << htMissColl->begin()->pz() << ", " << htMissColl->begin()->energy() << ") phi " << htMissColl->begin()->phi()
206  << " HtTot " << htMissColl->begin()->etTotal() << endl;
207 
208  // HF Rings
209  Handle<L1HFRingsCollection> hfRingsColl;
210  iEvent.getByLabel(hfRingsSource_, hfRingsColl);
211  cout << "HF Rings:" << endl;
212  for (int i = 0; i < L1HFRings::kNumRings; ++i) {
213  cout << " " << i << ": et sum = " << hfRingsColl->begin()->hfEtSum((L1HFRings::HFRingLabels)i)
214  << ", bit count = " << hfRingsColl->begin()->hfBitCount((L1HFRings::HFRingLabels)i) << endl;
215  }
216  cout << endl;
217 
218  // // L1GlobalTriggerReadoutRecord
219  // Handle< L1GlobalTriggerReadoutRecord > gtRecord ;
220  // iEvent.getByLabel( gtReadoutSource_, gtRecord ) ;
221  // cout << "Global trigger decision " << gtRecord->decision() << endl ;
222 
223  cout << endl;
224 }
TkSoAView< TrackerTraits > HitToTuple< TrackerTraits > const *__restrict__ int32_t int32_t int iev
edm::InputTag nonIsoEmSource_
int iEvent
Definition: GenABIO.cc:224
edm::InputTag hfRingsSource_
HLT enums.

Member Data Documentation

◆ cenJetSource_

edm::InputTag L1ExtraTestAnalyzer::cenJetSource_
private

Definition at line 66 of file L1ExtraTestAnalyzer.cc.

Referenced by analyze().

◆ etMissSource_

edm::InputTag L1ExtraTestAnalyzer::etMissSource_
private

Definition at line 70 of file L1ExtraTestAnalyzer.cc.

Referenced by analyze().

◆ file_

TFile L1ExtraTestAnalyzer::file_
private

Definition at line 76 of file L1ExtraTestAnalyzer.cc.

Referenced by ~L1ExtraTestAnalyzer().

◆ forJetSource_

edm::InputTag L1ExtraTestAnalyzer::forJetSource_
private

Definition at line 67 of file L1ExtraTestAnalyzer.cc.

Referenced by analyze().

◆ gtReadoutSource_

edm::InputTag L1ExtraTestAnalyzer::gtReadoutSource_
private

Definition at line 73 of file L1ExtraTestAnalyzer.cc.

◆ hfRingsSource_

edm::InputTag L1ExtraTestAnalyzer::hfRingsSource_
private

Definition at line 72 of file L1ExtraTestAnalyzer.cc.

Referenced by analyze().

◆ hist_

TH1F L1ExtraTestAnalyzer::hist_
private

Definition at line 77 of file L1ExtraTestAnalyzer.cc.

Referenced by ~L1ExtraTestAnalyzer().

◆ htMissSource_

edm::InputTag L1ExtraTestAnalyzer::htMissSource_
private

Definition at line 71 of file L1ExtraTestAnalyzer.cc.

Referenced by analyze().

◆ isoEmSource_

edm::InputTag L1ExtraTestAnalyzer::isoEmSource_
private

Definition at line 64 of file L1ExtraTestAnalyzer.cc.

Referenced by analyze().

◆ muonSource_

edm::InputTag L1ExtraTestAnalyzer::muonSource_
private

Definition at line 69 of file L1ExtraTestAnalyzer.cc.

Referenced by analyze().

◆ nonIsoEmSource_

edm::InputTag L1ExtraTestAnalyzer::nonIsoEmSource_
private

Definition at line 65 of file L1ExtraTestAnalyzer.cc.

Referenced by analyze().

◆ particleMapSource_

edm::InputTag L1ExtraTestAnalyzer::particleMapSource_
private

Definition at line 74 of file L1ExtraTestAnalyzer.cc.

◆ tauJetSource_

edm::InputTag L1ExtraTestAnalyzer::tauJetSource_
private

Definition at line 68 of file L1ExtraTestAnalyzer.cc.

Referenced by analyze().