CMS 3D CMS Logo

DumpGctDigis.cc
Go to the documentation of this file.
2 
3 // system include files
4 #include <memory>
5 #include <iostream>
6 
7 // user include files
10 
13 
16 
18 
21 
22 using std::endl;
23 using std::ios;
24 using std::string;
25 
26 //
27 // constructors and destructor
28 //
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  //now do what ever initialization is needed
45 
46  outFile_.open(outFilename_.c_str(), ios::out);
47 }
48 
50  // do anything here that needs to be done at desctruction time
51  // (e.g. close files, deallocate resources etc.)
52 
53  outFile_.close();
54 }
55 
56 //
57 // member functions
58 //
59 
60 // ------------ method called to produce the data ------------
62  using namespace edm;
63 
64  outFile_ << "Run :" << iEvent.id().run() << " Event :" << iEvent.id().event() << endl;
65 
66  // EM
67  if (doRctEM_ && doHW_) {
69  }
70  if (doRctEM_ && doEmu_) {
72  }
73  if (doEM_ && doHW_) {
75  }
76  if (doEM_ && doEmu_) {
78  }
79 
80  // Jets
81  if (doRegions_ && doHW_) {
83  }
84  if (doRegions_ && doEmu_) {
86  }
87  if (doJets_ && doHW_) {
89  }
90  if (doJets_ && doEmu_) {
92  }
93 
94  // Energy Sums
95  if (doEnergySums_ && doHW_) {
97  }
98  if (doEnergySums_ && doEmu_) {
100  }
101 
102  // debugging
103  if (doInternEM_ && doHW_) {
105  }
106  if (doFibres_ && doHW_) {
108  }
109 }
110 
112  using namespace edm;
113 
116 
117  L1GctEmCandCollection::const_iterator ie;
118  L1GctEmCandCollection::const_iterator ne;
119 
120  iEvent.getByLabel(label.label(), "isoEm", isoEm);
121  iEvent.getByLabel(label.label(), "nonIsoEm", nonIsoEm);
122 
123  outFile_ << "Iso EM from : " << label.label() << endl;
124  for (ie = isoEm->begin(); ie != isoEm->end(); ie++) {
125  outFile_ << (*ie) << " ieta(detID)=" << ie->regionId().ieta() << " iphi(detID)=" << ie->regionId().iphi() << endl;
126  }
127  outFile_ << endl;
128 
129  outFile_ << "Non-iso EM from : " << label.label() << endl;
130  for (ne = nonIsoEm->begin(); ne != nonIsoEm->end(); ne++) {
131  outFile_ << (*ne) << " ieta(detID)=" << ne->regionId().ieta() << " iphi(detID)=" << ne->regionId().iphi() << endl;
132  }
133  outFile_ << endl;
134 }
135 
137  using namespace edm;
138 
140 
141  L1CaloEmCollection::const_iterator e;
142 
143  iEvent.getByLabel(label, em);
144 
145  outFile_ << "RCT EM from : " << label.label() << endl;
146  for (e = em->begin(); e != em->end(); e++) {
147  if (e->rank() >= rctEmMinRank_) {
148  outFile_ << (*e) << " ieta(detID)=" << e->regionId().ieta() << " iphi(detID)=" << e->regionId().iphi() << endl;
149  }
150  }
151  outFile_ << endl;
152 }
153 
155  using namespace edm;
156 
158 
159  L1CaloRegionCollection::const_iterator r;
160 
161  iEvent.getByLabel(label, rgns);
162 
163  outFile_ << "Regions from : " << label.label() << endl;
164  for (r = rgns->begin(); r != rgns->end(); r++) {
165  outFile_ << (*r) << endl;
166  }
167  outFile_ << endl;
168 }
169 
171  using namespace edm;
172 
176 
177  L1GctJetCandCollection::const_iterator cj;
178  L1GctJetCandCollection::const_iterator fj;
179  L1GctJetCandCollection::const_iterator tj;
180 
181  const std::string& labelStr = label.label();
182 
183  iEvent.getByLabel(labelStr, "cenJets", cenJets);
184  iEvent.getByLabel(labelStr, "forJets", forJets);
185  iEvent.getByLabel(labelStr, "tauJets", tauJets);
186 
187  outFile_ << "Central jets from : " << labelStr << endl;
188  for (cj = cenJets->begin(); cj != cenJets->end(); cj++) {
189  outFile_ << (*cj) << endl;
190  }
191  outFile_ << endl;
192 
193  outFile_ << "Forward jets from : " << labelStr << endl;
194  for (fj = forJets->begin(); fj != forJets->end(); fj++) {
195  outFile_ << (*fj) << endl;
196  }
197  outFile_ << endl;
198 
199  outFile_ << "Tau jets from : " << labelStr << endl;
200  for (tj = tauJets->begin(); tj != tauJets->end(); tj++) {
201  outFile_ << (*tj) << endl;
202  }
203 }
204 
206  using namespace edm;
207 
209 
210  L1GctInternEmCandCollection::const_iterator e;
211 
212  iEvent.getByLabel(label, em);
213 
214  outFile_ << "Internal EM from : " << label.label() << endl;
215  for (e = em->begin(); e != em->end(); e++) {
216  outFile_ << (*e) << " ieta(detID)=" << e->regionId().ieta() << " iphi(detID)=" << e->regionId().iphi() << endl;
217  }
218  outFile_ << endl;
219 }
220 
222  using namespace edm;
223 
225 
226  L1GctFibreCollection::const_iterator f;
227 
228  iEvent.getByLabel(label, fibres);
229 
230  outFile_ << "Fibres from : " << label.label() << endl;
231  for (f = fibres->begin(); f != fibres->end(); f++) {
232  outFile_ << (*f) << endl;
233  }
234  outFile_ << endl;
235 }
236 
238  using namespace edm;
239 
244 
245  iEvent.getByLabel(label, etTotal);
246  iEvent.getByLabel(label, etHad);
247  iEvent.getByLabel(label, etMiss);
248  iEvent.getByLabel(label, htMiss);
249 
250  outFile_ << "Energy sums from: " << label.label() << endl;
251 
252  L1GctEtTotalCollection::const_iterator et;
253  for (et = etTotal->begin(); et != etTotal->end(); et++) {
254  outFile_ << *(et) << endl;
255  }
256 
257  L1GctEtHadCollection::const_iterator ht;
258  for (ht = etHad->begin(); ht != etHad->end(); ht++) {
259  outFile_ << *(ht) << endl;
260  }
261 
262  L1GctEtMissCollection::const_iterator met;
263  for (met = etMiss->begin(); met != etMiss->end(); met++) {
264  outFile_ << *(met) << endl;
265  }
266 
267  L1GctHtMissCollection::const_iterator mht;
268  for (mht = htMiss->begin(); mht != htMiss->end(); mht++) {
269  outFile_ << *(mht) << endl;
270  }
271 }
DumpGctDigis::rctEmMinRank_
unsigned rctEmMinRank_
Definition: DumpGctDigis.h:67
electrons_cff.bool
bool
Definition: electrons_cff.py:372
funct::false
false
Definition: Factorize.h:34
f
double f[11][100]
Definition: MuScleFitUtils.cc:78
L1GctCollections.h
DumpGctDigis::doRegions
void doRegions(const edm::Event &, const edm::InputTag &label)
Definition: DumpGctDigis.cc:154
DumpGctDigis::doEmu_
bool doEmu_
Definition: DumpGctDigis.h:58
edm
HLT enums.
Definition: AlignableModifier.h:19
DumpGctDigis::outFile_
std::ofstream outFile_
Definition: DumpGctDigis.h:69
DumpGctDigis::doRctEM
void doRctEM(const edm::Event &, const edm::InputTag &label)
Definition: DumpGctDigis.cc:136
DumpGctDigis::doFibres_
bool doFibres_
Definition: DumpGctDigis.h:64
DumpGctDigis::rawLabel_
edm::InputTag rawLabel_
Definition: DumpGctDigis.h:52
EDAnalyzer.h
DumpGctDigis::emuRctLabel_
edm::InputTag emuRctLabel_
Definition: DumpGctDigis.h:53
DumpGctDigis::doEM_
bool doEM_
Definition: DumpGctDigis.h:60
DumpGctDigis::doEnergySums_
bool doEnergySums_
Definition: DumpGctDigis.h:65
DumpGctDigis::analyze
void analyze(const edm::Event &, const edm::EventSetup &) override
Definition: DumpGctDigis.cc:61
edm::Handle
Definition: AssociativeIterator.h:50
DumpGctDigis::doRctEM_
bool doRctEM_
Definition: DumpGctDigis.h:59
DumpGctDigis::doFibres
void doFibres(const edm::Event &, const edm::InputTag &label)
Definition: DumpGctDigis.cc:221
BTaggingMonitor_cfi.met
met
Definition: BTaggingMonitor_cfi.py:84
DumpGctDigis::DumpGctDigis
DumpGctDigis(const edm::ParameterSet &)
Definition: DumpGctDigis.cc:29
MakerMacros.h
DumpGctDigis::outFilename_
std::string outFilename_
Definition: DumpGctDigis.h:55
DumpGctDigis::doJets
void doJets(const edm::Event &, const edm::InputTag &label)
Definition: DumpGctDigis.cc:170
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
DumpGctDigis::doRegions_
bool doRegions_
Definition: DumpGctDigis.h:61
funct::true
true
Definition: Factorize.h:173
HLT_2018_cff.InputTag
InputTag
Definition: HLT_2018_cff.py:79016
edm::ParameterSet
Definition: ParameterSet.h:36
DumpGctDigis::doInternEM
void doInternEM(const edm::Event &, const edm::InputTag &label)
Definition: DumpGctDigis.cc:205
Event.h
DumpGctDigis::doJets_
bool doJets_
Definition: DumpGctDigis.h:62
L1CaloCollections.h
iEvent
int iEvent
Definition: GenABIO.cc:224
L1GctEtSums.h
DumpGctDigis::doEnergySums
void doEnergySums(const edm::Event &, const edm::InputTag &label)
Definition: DumpGctDigis.cc:237
EgHLTOffHistBins_cfi.et
et
Definition: EgHLTOffHistBins_cfi.py:8
edm::EventSetup
Definition: EventSetup.h:57
InputTag.h
alignCSCRings.r
r
Definition: alignCSCRings.py:93
DumpGctDigis::doEM
void doEM(const edm::Event &, const edm::InputTag &label)
Definition: DumpGctDigis.cc:111
DumpGctDigis::~DumpGctDigis
~DumpGctDigis() override
Definition: DumpGctDigis.cc:49
Frameworkfwd.h
DumpGctDigis.h
DumpGctDigis::doHW_
bool doHW_
Definition: DumpGctDigis.h:57
MillePedeFileConverter_cfg.out
out
Definition: MillePedeFileConverter_cfg.py:31
ParameterSet.h
DumpGctDigis::doInternEM_
bool doInternEM_
Definition: DumpGctDigis.h:63
edm::Event
Definition: Event.h:73
edm::InputTag
Definition: InputTag.h:15
label
const char * label
Definition: PFTauDecayModeTools.cc:11
MillePedeFileConverter_cfg.e
e
Definition: MillePedeFileConverter_cfg.py:37
DumpGctDigis::emuGctLabel_
edm::InputTag emuGctLabel_
Definition: DumpGctDigis.h:54