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

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

Definition at line 35 of file DumpGctDigis.h.

Constructor & Destructor Documentation

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

Definition at line 29 of file DumpGctDigis.cc.

References MillePedeFileConverter_cfg::out, outFile_, and outFilename_.

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

Definition at line 52 of file DumpGctDigis.cc.

References outFile_.

53 {
54 
55  // do anything here that needs to be done at desctruction time
56  // (e.g. close files, deallocate resources etc.)
57 
58  outFile_.close();
59 
60 }
std::ofstream outFile_
Definition: DumpGctDigis.h:70

Member Function Documentation

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

Definition at line 69 of file DumpGctDigis.cc.

References doEM(), doEM_, doEmu_, doEnergySums(), doEnergySums_, doFibres(), doFibres_, doHW_, doInternEM(), doInternEM_, doJets(), doJets_, doRctEM(), doRctEM_, doRegions(), doRegions_, emuGctLabel_, emuRctLabel_, edm::EventID::event(), edm::EventBase::id(), outFile_, rawLabel_, and edm::EventID::run().

70 {
71  using namespace edm;
72 
73  outFile_ << "Run :" << iEvent.id().run() << " Event :" << iEvent.id().event() << endl;
74 
75  // EM
76  if (doRctEM_ && doHW_) { doRctEM(iEvent, rawLabel_); }
77  if (doRctEM_ && doEmu_) { doRctEM(iEvent, emuRctLabel_); }
78  if (doEM_ && doHW_) { doEM(iEvent, rawLabel_); }
79  if (doEM_ && doEmu_){ doEM(iEvent, emuGctLabel_); }
80 
81  // Jets
82  if (doRegions_ && doHW_) { doRegions(iEvent, rawLabel_); }
83  if (doRegions_ && doEmu_) { doRegions(iEvent, emuRctLabel_); }
84  if (doJets_ && doHW_) { doJets(iEvent, rawLabel_); }
85  if (doJets_ && doEmu_) { doJets(iEvent, emuGctLabel_); }
86 
87  // Energy Sums
88  if (doEnergySums_ && doHW_) { doEnergySums(iEvent, rawLabel_); }
89  if (doEnergySums_ && doEmu_) { doEnergySums(iEvent, emuGctLabel_); }
90 
91  // debugging
92  if (doInternEM_ && doHW_) { doInternEM(iEvent, rawLabel_); }
93  if (doFibres_ && doHW_) { doFibres(iEvent, rawLabel_); }
94 
95 }
RunNumber_t run() const
Definition: EventID.h:39
EventNumber_t event() const
Definition: EventID.h:41
edm::InputTag rawLabel_
Definition: DumpGctDigis.h:53
edm::InputTag emuRctLabel_
Definition: DumpGctDigis.h:54
std::ofstream outFile_
Definition: DumpGctDigis.h:70
void doRegions(const edm::Event &, const edm::InputTag &label)
void doJets(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)
bool doEnergySums_
Definition: DumpGctDigis.h:66
bool doInternEM_
Definition: DumpGctDigis.h:64
void doInternEM(const edm::Event &, const edm::InputTag &label)
edm::EventID id() const
Definition: EventBase.h:60
HLT enums.
edm::InputTag emuGctLabel_
Definition: DumpGctDigis.h:55
void doEM(const edm::Event &, const edm::InputTag &label)
Definition: DumpGctDigis.cc:97
void doRctEM(const edm::Event &, const edm::InputTag &label)
void DumpGctDigis::doEM ( const edm::Event iEvent,
const edm::InputTag label 
)

Definition at line 97 of file DumpGctDigis.cc.

References edm::Event::getByLabel(), edm::InputTag::label(), Vispa.Plugins.EdmBrowser.EdmDataAccessor::ne(), and outFile_.

Referenced by analyze().

97  {
98 
99  using namespace edm;
100 
103 
104  L1GctEmCandCollection::const_iterator ie;
105  L1GctEmCandCollection::const_iterator ne;
106 
107  iEvent.getByLabel(label.label(),"isoEm",isoEm);
108  iEvent.getByLabel(label.label(),"nonIsoEm",nonIsoEm);
109 
110  outFile_ << "Iso EM from : " << label.label() << endl;
111  for (ie=isoEm->begin(); ie!=isoEm->end(); ie++) {
112  outFile_ << (*ie)
113  << " ieta(detID)=" << ie->regionId().ieta()
114  << " iphi(detID)=" << ie->regionId().iphi()
115  << endl;
116  }
117  outFile_ << endl;
118 
119  outFile_ << "Non-iso EM from : " << label.label() << endl;
120  for (ne=nonIsoEm->begin(); ne!=nonIsoEm->end(); ne++) {
121  outFile_ << (*ne)
122  << " ieta(detID)=" << ne->regionId().ieta()
123  << " iphi(detID)=" << ne->regionId().iphi()
124  << endl;
125  }
126  outFile_ << endl;
127 
128 }
std::ofstream outFile_
Definition: DumpGctDigis.h:70
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:535
std::string const & label() const
Definition: InputTag.h:36
HLT enums.
void DumpGctDigis::doEnergySums ( const edm::Event iEvent,
const edm::InputTag label 
)

Definition at line 250 of file DumpGctDigis.cc.

References stringResolutionProvider_cfi::et, edm::Event::getByLabel(), edm::InputTag::label(), RazorAnalyzer::met, and outFile_.

Referenced by analyze().

251 {
252  using namespace edm;
253 
258 
259  iEvent.getByLabel(label, etTotal);
260  iEvent.getByLabel(label, etHad);
261  iEvent.getByLabel(label, etMiss);
262  iEvent.getByLabel(label, htMiss);
263 
264  outFile_ << "Energy sums from: " << label.label() << endl;
265 
266  L1GctEtTotalCollection::const_iterator et;
267  for (et=etTotal->begin(); et!=etTotal->end(); et++){
268  outFile_ << *(et) << endl;
269  }
270 
271  L1GctEtHadCollection::const_iterator ht;
272  for (ht=etHad->begin(); ht!=etHad->end(); ht++){
273  outFile_ << *(ht) << endl;
274  }
275 
276  L1GctEtMissCollection::const_iterator met;
277  for (met=etMiss->begin(); met!=etMiss->end(); met++){
278  outFile_ << *(met) << endl;
279  }
280 
281  L1GctHtMissCollection::const_iterator mht;
282  for (mht=htMiss->begin(); mht!=htMiss->end(); mht++){
283  outFile_ << *(mht) << endl;
284  }
285 
286 }
std::ofstream outFile_
Definition: DumpGctDigis.h:70
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:535
met
===> hadronic RAZOR
et
define resolution functions of each parameter
std::string const & label() const
Definition: InputTag.h:36
HLT enums.
void DumpGctDigis::doFibres ( const edm::Event iEvent,
const edm::InputTag label 
)

Definition at line 232 of file DumpGctDigis.cc.

References f, edm::Event::getByLabel(), edm::InputTag::label(), and outFile_.

Referenced by analyze().

232  {
233 
234  using namespace edm;
235 
237 
238  L1GctFibreCollection::const_iterator f;
239 
240  iEvent.getByLabel(label, fibres);
241 
242  outFile_ << "Fibres from : " << label.label() << endl;
243  for (f=fibres->begin(); f!=fibres->end(); f++) {
244  outFile_ << (*f) << endl;
245  }
246  outFile_ << endl;
247 
248 }
std::ofstream outFile_
Definition: DumpGctDigis.h:70
double f[11][100]
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:535
std::string const & label() const
Definition: InputTag.h:36
HLT enums.
void DumpGctDigis::doInternEM ( const edm::Event iEvent,
const edm::InputTag label 
)

Definition at line 210 of file DumpGctDigis.cc.

References MillePedeFileConverter_cfg::e, edm::Event::getByLabel(), edm::InputTag::label(), and outFile_.

Referenced by analyze().

210  {
211 
212  using namespace edm;
213 
215 
216  L1GctInternEmCandCollection::const_iterator e;
217 
218  iEvent.getByLabel(label, em);
219 
220  outFile_ << "Internal EM from : " << label.label() << endl;
221  for (e=em->begin(); e!=em->end(); e++) {
222  outFile_ << (*e)
223  << " ieta(detID)=" << e->regionId().ieta()
224  << " iphi(detID)=" << e->regionId().iphi()
225  << endl;
226  }
227  outFile_ << endl;
228 
229 }
std::ofstream outFile_
Definition: DumpGctDigis.h:70
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:535
std::string const & label() const
Definition: InputTag.h:36
HLT enums.
void DumpGctDigis::doJets ( const edm::Event iEvent,
const edm::InputTag label 
)

Definition at line 173 of file DumpGctDigis.cc.

References edm::Event::getByLabel(), edm::InputTag::label(), outFile_, and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by analyze().

173  {
174 
175  using namespace edm;
176 
180 
181  L1GctJetCandCollection::const_iterator cj;
182  L1GctJetCandCollection::const_iterator fj;
183  L1GctJetCandCollection::const_iterator tj;
184 
185  const std::string& labelStr = label.label();
186 
187  iEvent.getByLabel(labelStr,"cenJets",cenJets);
188  iEvent.getByLabel(labelStr,"forJets",forJets);
189  iEvent.getByLabel(labelStr,"tauJets",tauJets);
190 
191  outFile_ << "Central jets from : " << labelStr << endl;
192  for (cj=cenJets->begin(); cj!=cenJets->end(); cj++) {
193  outFile_ << (*cj) << endl;
194  }
195  outFile_ << endl;
196 
197  outFile_ << "Forward jets from : " << labelStr << endl;
198  for (fj=forJets->begin(); fj!=forJets->end(); fj++) {
199  outFile_ << (*fj) << endl;
200  }
201  outFile_ << endl;
202 
203  outFile_ << "Tau jets from : " << labelStr << endl;
204  for (tj=tauJets->begin(); tj!=tauJets->end(); tj++) {
205  outFile_ << (*tj) << endl;
206  }
207 }
std::ofstream outFile_
Definition: DumpGctDigis.h:70
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:535
std::string const & label() const
Definition: InputTag.h:36
HLT enums.
void DumpGctDigis::doRctEM ( const edm::Event iEvent,
const edm::InputTag label 
)

Definition at line 130 of file DumpGctDigis.cc.

References MillePedeFileConverter_cfg::e, edm::Event::getByLabel(), edm::InputTag::label(), outFile_, and rctEmMinRank_.

Referenced by analyze().

130  {
131 
132  using namespace edm;
133 
135 
136  L1CaloEmCollection::const_iterator e;
137 
138  iEvent.getByLabel(label, em);
139 
140  outFile_ << "RCT EM from : " << label.label() << endl;
141  for (e=em->begin(); e!=em->end(); e++) {
142  if (e->rank() >= rctEmMinRank_) {
143  outFile_ << (*e)
144  << " ieta(detID)=" << e->regionId().ieta()
145  << " iphi(detID)=" << e->regionId().iphi()
146  << endl;
147  }
148  }
149  outFile_ << endl;
150 
151 }
unsigned rctEmMinRank_
Definition: DumpGctDigis.h:68
std::ofstream outFile_
Definition: DumpGctDigis.h:70
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:535
std::string const & label() const
Definition: InputTag.h:36
HLT enums.
void DumpGctDigis::doRegions ( const edm::Event iEvent,
const edm::InputTag label 
)

Definition at line 154 of file DumpGctDigis.cc.

References edm::Event::getByLabel(), edm::InputTag::label(), outFile_, and alignCSCRings::r.

Referenced by analyze().

154  {
155 
156  using namespace edm;
157 
159 
160  L1CaloRegionCollection::const_iterator r;
161 
162  iEvent.getByLabel(label, rgns);
163 
164  outFile_ << "Regions from : " << label.label() << endl;
165  for (r=rgns->begin(); r!=rgns->end(); r++) {
166  outFile_ << (*r) << endl;
167  }
168  outFile_ << endl;
169 
170 }
std::ofstream outFile_
Definition: DumpGctDigis.h:70
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:535
std::string const & label() const
Definition: InputTag.h:36
HLT enums.

Member Data Documentation

bool DumpGctDigis::doEM_
private

Definition at line 61 of file DumpGctDigis.h.

Referenced by analyze().

bool DumpGctDigis::doEmu_
private

Definition at line 59 of file DumpGctDigis.h.

Referenced by analyze().

bool DumpGctDigis::doEnergySums_
private

Definition at line 66 of file DumpGctDigis.h.

Referenced by analyze().

bool DumpGctDigis::doFibres_
private

Definition at line 65 of file DumpGctDigis.h.

Referenced by analyze().

bool DumpGctDigis::doHW_
private

Definition at line 58 of file DumpGctDigis.h.

Referenced by analyze().

bool DumpGctDigis::doInternEM_
private

Definition at line 64 of file DumpGctDigis.h.

Referenced by analyze().

bool DumpGctDigis::doJets_
private

Definition at line 63 of file DumpGctDigis.h.

Referenced by analyze().

bool DumpGctDigis::doRctEM_
private

Definition at line 60 of file DumpGctDigis.h.

Referenced by analyze().

bool DumpGctDigis::doRegions_
private

Definition at line 62 of file DumpGctDigis.h.

Referenced by analyze().

edm::InputTag DumpGctDigis::emuGctLabel_
private

Definition at line 55 of file DumpGctDigis.h.

Referenced by analyze().

edm::InputTag DumpGctDigis::emuRctLabel_
private

Definition at line 54 of file DumpGctDigis.h.

Referenced by analyze().

std::ofstream DumpGctDigis::outFile_
private
std::string DumpGctDigis::outFilename_
private

Definition at line 56 of file DumpGctDigis.h.

Referenced by DumpGctDigis().

edm::InputTag DumpGctDigis::rawLabel_
private

Definition at line 53 of file DumpGctDigis.h.

Referenced by analyze().

unsigned DumpGctDigis::rctEmMinRank_
private

Definition at line 68 of file DumpGctDigis.h.

Referenced by doRctEM().