CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
DumpGctDigis Class Reference

#include <L1Trigger/GlobalCaloTrigger/test/DumpGctDigis.cc>

Inheritance diagram for DumpGctDigis:
edm::one::EDAnalyzer<> edm::one::EDAnalyzerBase edm::EDConsumerBase

Public Member Functions

void analyze (const edm::Event &, const edm::EventSetup &) override
 
void doEM (const edm::Event &, const edm::InputTag &label)
 
void doEnergySums (const edm::Event &, const edm::InputTag &label)
 
void doFibres (const edm::Event &, const edm::InputTag &label)
 
void doInternEM (const edm::Event &, const edm::InputTag &label)
 
void doJets (const edm::Event &, const edm::InputTag &label)
 
void doRctEM (const edm::Event &, const edm::InputTag &label)
 
void doRegions (const edm::Event &, const edm::InputTag &label)
 
 DumpGctDigis (const edm::ParameterSet &)
 
 ~DumpGctDigis () 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 noexcept final
 
bool wantsGlobalRuns () const noexcept final
 
bool wantsInputProcessBlocks () const noexcept final
 
bool wantsProcessBlocks () const noexcept 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 noexcept
 
bool wantsStreamRuns () const noexcept
 
 ~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)
 

Private Attributes

bool doEM_
 
bool doEmu_
 
bool doEnergySums_
 
bool doFibres_
 
bool doHW_
 
bool doInternEM_
 
bool doJets_
 
bool doRctEM_
 
bool doRegions_
 
edm::InputTag emuGctLabel_
 
edm::InputTag emuRctLabel_
 
std::ofstream outFile_
 
std::string outFilename_
 
edm::InputTag rawLabel_
 
unsigned rctEmMinRank_
 

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: <one line="" class="" summary>="">

Implementation: <Notes on="" implementation>="">

Definition at line 34 of file DumpGctDigis.h.

Constructor & Destructor Documentation

◆ DumpGctDigis()

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

Definition at line 28 of file DumpGctDigis.cc.

References MillePedeFileConverter_cfg::out, outFile_, and outFilename_.

29  : rawLabel_(iConfig.getUntrackedParameter<edm::InputTag>("rawInput", edm::InputTag("L1GctRawDigis"))),
30  emuRctLabel_(iConfig.getUntrackedParameter<edm::InputTag>("emuRctInput", edm::InputTag("L1RctEmuDigis"))),
31  emuGctLabel_(iConfig.getUntrackedParameter<edm::InputTag>("emuGctInput", edm::InputTag("L1GctEmuDigis"))),
32  outFilename_(iConfig.getUntrackedParameter<string>("outFile", "gctAnalyzer.txt")),
33  doHW_(iConfig.getUntrackedParameter<bool>("doHardware", true)),
34  doEmu_(iConfig.getUntrackedParameter<bool>("doEmulated", true)),
35  doRctEM_(iConfig.getUntrackedParameter<bool>("doRctEm", true)),
36  doEM_(iConfig.getUntrackedParameter<bool>("doEm", true)),
37  doRegions_(iConfig.getUntrackedParameter<bool>("doRegions", false)),
38  doJets_(iConfig.getUntrackedParameter<bool>("doJets", false)),
39  doInternEM_(iConfig.getUntrackedParameter<bool>("doInternEm", true)),
40  doFibres_(iConfig.getUntrackedParameter<bool>("doFibres", false)),
41  doEnergySums_(iConfig.getUntrackedParameter<bool>("doEnergySums", false)),
42  rctEmMinRank_(iConfig.getUntrackedParameter<unsigned>("rctEmMinRank", 0)) {
43  //now do what ever initialization is needed
44 
45  outFile_.open(outFilename_.c_str(), ios::out);
46 }
edm::InputTag rawLabel_
Definition: DumpGctDigis.h:52
edm::InputTag emuRctLabel_
Definition: DumpGctDigis.h:53
unsigned rctEmMinRank_
Definition: DumpGctDigis.h:67
std::string outFilename_
Definition: DumpGctDigis.h:55
std::ofstream outFile_
Definition: DumpGctDigis.h:69
T getUntrackedParameter(std::string const &, T const &) const
bool doEnergySums_
Definition: DumpGctDigis.h:65
bool doInternEM_
Definition: DumpGctDigis.h:63
edm::InputTag emuGctLabel_
Definition: DumpGctDigis.h:54

◆ ~DumpGctDigis()

DumpGctDigis::~DumpGctDigis ( )
override

Definition at line 48 of file DumpGctDigis.cc.

References outFile_.

48  {
49  // do anything here that needs to be done at desctruction time
50  // (e.g. close files, deallocate resources etc.)
51 
52  outFile_.close();
53 }
std::ofstream outFile_
Definition: DumpGctDigis.h:69

Member Function Documentation

◆ analyze()

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

Implements edm::one::EDAnalyzerBase.

Definition at line 60 of file DumpGctDigis.cc.

References doEM(), doEM_, doEmu_, doEnergySums(), doEnergySums_, doFibres(), doFibres_, doHW_, doInternEM(), doInternEM_, doJets(), doJets_, doRctEM(), doRctEM_, doRegions(), doRegions_, emuGctLabel_, emuRctLabel_, iEvent, outFile_, and rawLabel_.

60  {
61  using namespace edm;
62 
63  outFile_ << "Run :" << iEvent.id().run() << " Event :" << iEvent.id().event() << endl;
64 
65  // EM
66  if (doRctEM_ && doHW_) {
68  }
69  if (doRctEM_ && doEmu_) {
71  }
72  if (doEM_ && doHW_) {
74  }
75  if (doEM_ && doEmu_) {
77  }
78 
79  // Jets
80  if (doRegions_ && doHW_) {
82  }
83  if (doRegions_ && doEmu_) {
85  }
86  if (doJets_ && doHW_) {
88  }
89  if (doJets_ && doEmu_) {
91  }
92 
93  // Energy Sums
94  if (doEnergySums_ && doHW_) {
96  }
97  if (doEnergySums_ && doEmu_) {
99  }
100 
101  // debugging
102  if (doInternEM_ && doHW_) {
104  }
105  if (doFibres_ && doHW_) {
107  }
108 }
edm::InputTag rawLabel_
Definition: DumpGctDigis.h:52
edm::InputTag emuRctLabel_
Definition: DumpGctDigis.h:53
std::ofstream outFile_
Definition: DumpGctDigis.h:69
void doRegions(const edm::Event &, const edm::InputTag &label)
void doJets(const edm::Event &, const edm::InputTag &label)
int iEvent
Definition: GenABIO.cc:224
void doEnergySums(const edm::Event &, const edm::InputTag &label)
void doFibres(const edm::Event &, const edm::InputTag &label)
bool doEnergySums_
Definition: DumpGctDigis.h:65
bool doInternEM_
Definition: DumpGctDigis.h:63
void doInternEM(const edm::Event &, const edm::InputTag &label)
HLT enums.
edm::InputTag emuGctLabel_
Definition: DumpGctDigis.h:54
void doEM(const edm::Event &, const edm::InputTag &label)
void doRctEM(const edm::Event &, const edm::InputTag &label)

◆ doEM()

void DumpGctDigis::doEM ( const edm::Event iEvent,
const edm::InputTag label 
)

Definition at line 110 of file DumpGctDigis.cc.

References iEvent, label, compareTotals::ne, and outFile_.

Referenced by analyze().

110  {
111  using namespace edm;
112 
115 
116  L1GctEmCandCollection::const_iterator ie;
117  L1GctEmCandCollection::const_iterator ne;
118 
119  iEvent.getByLabel(label.label(), "isoEm", isoEm);
120  iEvent.getByLabel(label.label(), "nonIsoEm", nonIsoEm);
121 
122  outFile_ << "Iso EM from : " << label.label() << endl;
123  for (ie = isoEm->begin(); ie != isoEm->end(); ie++) {
124  outFile_ << (*ie) << " ieta(detID)=" << ie->regionId().ieta() << " iphi(detID)=" << ie->regionId().iphi() << endl;
125  }
126  outFile_ << endl;
127 
128  outFile_ << "Non-iso EM from : " << label.label() << endl;
129  for (ne = nonIsoEm->begin(); ne != nonIsoEm->end(); ne++) {
130  outFile_ << (*ne) << " ieta(detID)=" << ne->regionId().ieta() << " iphi(detID)=" << ne->regionId().iphi() << endl;
131  }
132  outFile_ << endl;
133 }
std::ofstream outFile_
Definition: DumpGctDigis.h:69
char const * label
int iEvent
Definition: GenABIO.cc:224
HLT enums.

◆ doEnergySums()

void DumpGctDigis::doEnergySums ( const edm::Event iEvent,
const edm::InputTag label 
)

Definition at line 236 of file DumpGctDigis.cc.

References l1tnanotables_cff::et, iEvent, label, BTaggingMonitor_cfi::met, l1tJetFileWriter_cfi::mht, and outFile_.

Referenced by analyze().

236  {
237  using namespace edm;
238 
243 
244  iEvent.getByLabel(label, etTotal);
245  iEvent.getByLabel(label, etHad);
246  iEvent.getByLabel(label, etMiss);
247  iEvent.getByLabel(label, htMiss);
248 
249  outFile_ << "Energy sums from: " << label.label() << endl;
250 
251  L1GctEtTotalCollection::const_iterator et;
252  for (et = etTotal->begin(); et != etTotal->end(); et++) {
253  outFile_ << *(et) << endl;
254  }
255 
256  L1GctEtHadCollection::const_iterator ht;
257  for (ht = etHad->begin(); ht != etHad->end(); ht++) {
258  outFile_ << *(ht) << endl;
259  }
260 
261  L1GctEtMissCollection::const_iterator met;
262  for (met = etMiss->begin(); met != etMiss->end(); met++) {
263  outFile_ << *(met) << endl;
264  }
265 
266  L1GctHtMissCollection::const_iterator mht;
267  for (mht = htMiss->begin(); mht != htMiss->end(); mht++) {
268  outFile_ << *(mht) << endl;
269  }
270 }
std::ofstream outFile_
Definition: DumpGctDigis.h:69
char const * label
int iEvent
Definition: GenABIO.cc:224
HLT enums.

◆ doFibres()

void DumpGctDigis::doFibres ( const edm::Event iEvent,
const edm::InputTag label 
)

Definition at line 220 of file DumpGctDigis.cc.

References f, iEvent, label, and outFile_.

Referenced by analyze().

220  {
221  using namespace edm;
222 
224 
225  L1GctFibreCollection::const_iterator f;
226 
227  iEvent.getByLabel(label, fibres);
228 
229  outFile_ << "Fibres from : " << label.label() << endl;
230  for (f = fibres->begin(); f != fibres->end(); f++) {
231  outFile_ << (*f) << endl;
232  }
233  outFile_ << endl;
234 }
std::ofstream outFile_
Definition: DumpGctDigis.h:69
char const * label
int iEvent
Definition: GenABIO.cc:224
double f[11][100]
HLT enums.

◆ doInternEM()

void DumpGctDigis::doInternEM ( const edm::Event iEvent,
const edm::InputTag label 
)

Definition at line 204 of file DumpGctDigis.cc.

References MillePedeFileConverter_cfg::e, iEvent, label, and outFile_.

Referenced by analyze().

204  {
205  using namespace edm;
206 
208 
209  L1GctInternEmCandCollection::const_iterator e;
210 
211  iEvent.getByLabel(label, em);
212 
213  outFile_ << "Internal EM from : " << label.label() << endl;
214  for (e = em->begin(); e != em->end(); e++) {
215  outFile_ << (*e) << " ieta(detID)=" << e->regionId().ieta() << " iphi(detID)=" << e->regionId().iphi() << endl;
216  }
217  outFile_ << endl;
218 }
std::ofstream outFile_
Definition: DumpGctDigis.h:69
char const * label
int iEvent
Definition: GenABIO.cc:224
HLT enums.

◆ doJets()

void DumpGctDigis::doJets ( const edm::Event iEvent,
const edm::InputTag label 
)

Definition at line 169 of file DumpGctDigis.cc.

References iEvent, label, outFile_, and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by analyze().

169  {
170  using namespace edm;
171 
175 
176  L1GctJetCandCollection::const_iterator cj;
177  L1GctJetCandCollection::const_iterator fj;
178  L1GctJetCandCollection::const_iterator tj;
179 
180  const std::string& labelStr = label.label();
181 
182  iEvent.getByLabel(labelStr, "cenJets", cenJets);
183  iEvent.getByLabel(labelStr, "forJets", forJets);
184  iEvent.getByLabel(labelStr, "tauJets", tauJets);
185 
186  outFile_ << "Central jets from : " << labelStr << endl;
187  for (cj = cenJets->begin(); cj != cenJets->end(); cj++) {
188  outFile_ << (*cj) << endl;
189  }
190  outFile_ << endl;
191 
192  outFile_ << "Forward jets from : " << labelStr << endl;
193  for (fj = forJets->begin(); fj != forJets->end(); fj++) {
194  outFile_ << (*fj) << endl;
195  }
196  outFile_ << endl;
197 
198  outFile_ << "Tau jets from : " << labelStr << endl;
199  for (tj = tauJets->begin(); tj != tauJets->end(); tj++) {
200  outFile_ << (*tj) << endl;
201  }
202 }
std::ofstream outFile_
Definition: DumpGctDigis.h:69
char const * label
int iEvent
Definition: GenABIO.cc:224
HLT enums.

◆ doRctEM()

void DumpGctDigis::doRctEM ( const edm::Event iEvent,
const edm::InputTag label 
)

Definition at line 135 of file DumpGctDigis.cc.

References MillePedeFileConverter_cfg::e, iEvent, label, outFile_, and rctEmMinRank_.

Referenced by analyze().

135  {
136  using namespace edm;
137 
139 
140  L1CaloEmCollection::const_iterator e;
141 
142  iEvent.getByLabel(label, em);
143 
144  outFile_ << "RCT EM from : " << label.label() << endl;
145  for (e = em->begin(); e != em->end(); e++) {
146  if (e->rank() >= rctEmMinRank_) {
147  outFile_ << (*e) << " ieta(detID)=" << e->regionId().ieta() << " iphi(detID)=" << e->regionId().iphi() << endl;
148  }
149  }
150  outFile_ << endl;
151 }
unsigned rctEmMinRank_
Definition: DumpGctDigis.h:67
std::ofstream outFile_
Definition: DumpGctDigis.h:69
char const * label
int iEvent
Definition: GenABIO.cc:224
HLT enums.

◆ doRegions()

void DumpGctDigis::doRegions ( const edm::Event iEvent,
const edm::InputTag label 
)

Definition at line 153 of file DumpGctDigis.cc.

References iEvent, label, outFile_, and alignCSCRings::r.

Referenced by analyze().

153  {
154  using namespace edm;
155 
157 
158  L1CaloRegionCollection::const_iterator r;
159 
160  iEvent.getByLabel(label, rgns);
161 
162  outFile_ << "Regions from : " << label.label() << endl;
163  for (r = rgns->begin(); r != rgns->end(); r++) {
164  outFile_ << (*r) << endl;
165  }
166  outFile_ << endl;
167 }
std::ofstream outFile_
Definition: DumpGctDigis.h:69
char const * label
int iEvent
Definition: GenABIO.cc:224
HLT enums.

Member Data Documentation

◆ doEM_

bool DumpGctDigis::doEM_
private

Definition at line 60 of file DumpGctDigis.h.

Referenced by analyze().

◆ doEmu_

bool DumpGctDigis::doEmu_
private

Definition at line 58 of file DumpGctDigis.h.

Referenced by analyze().

◆ doEnergySums_

bool DumpGctDigis::doEnergySums_
private

Definition at line 65 of file DumpGctDigis.h.

Referenced by analyze().

◆ doFibres_

bool DumpGctDigis::doFibres_
private

Definition at line 64 of file DumpGctDigis.h.

Referenced by analyze().

◆ doHW_

bool DumpGctDigis::doHW_
private

Definition at line 57 of file DumpGctDigis.h.

Referenced by analyze().

◆ doInternEM_

bool DumpGctDigis::doInternEM_
private

Definition at line 63 of file DumpGctDigis.h.

Referenced by analyze().

◆ doJets_

bool DumpGctDigis::doJets_
private

Definition at line 62 of file DumpGctDigis.h.

Referenced by analyze().

◆ doRctEM_

bool DumpGctDigis::doRctEM_
private

Definition at line 59 of file DumpGctDigis.h.

Referenced by analyze().

◆ doRegions_

bool DumpGctDigis::doRegions_
private

Definition at line 61 of file DumpGctDigis.h.

Referenced by analyze().

◆ emuGctLabel_

edm::InputTag DumpGctDigis::emuGctLabel_
private

Definition at line 54 of file DumpGctDigis.h.

Referenced by analyze().

◆ emuRctLabel_

edm::InputTag DumpGctDigis::emuRctLabel_
private

Definition at line 53 of file DumpGctDigis.h.

Referenced by analyze().

◆ outFile_

std::ofstream DumpGctDigis::outFile_
private

◆ outFilename_

std::string DumpGctDigis::outFilename_
private

Definition at line 55 of file DumpGctDigis.h.

Referenced by DumpGctDigis().

◆ rawLabel_

edm::InputTag DumpGctDigis::rawLabel_
private

Definition at line 52 of file DumpGctDigis.h.

Referenced by analyze().

◆ rctEmMinRank_

unsigned DumpGctDigis::rctEmMinRank_
private

Definition at line 67 of file DumpGctDigis.h.

Referenced by doRctEM().