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
9 
12 
15 
17 
20 
21 using std::endl;
22 using std::ios;
23 using std::string;
24 
25 //
26 // constructors and destructor
27 //
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 }
47 
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 }
54 
55 //
56 // member functions
57 //
58 
59 // ------------ method called to produce the data ------------
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 }
109 
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 }
134 
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 }
152 
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 }
168 
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 }
203 
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 }
219 
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 }
235 
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 }
edm::InputTag rawLabel_
Definition: DumpGctDigis.h:52
edm::InputTag emuRctLabel_
Definition: DumpGctDigis.h:53
void analyze(const edm::Event &, const edm::EventSetup &) override
Definition: DumpGctDigis.cc:60
DumpGctDigis(const edm::ParameterSet &)
Definition: DumpGctDigis.cc:28
unsigned rctEmMinRank_
Definition: DumpGctDigis.h:67
std::string outFilename_
Definition: DumpGctDigis.h:55
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)
char const * 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
double f[11][100]
~DumpGctDigis() override
Definition: DumpGctDigis.cc:48
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)