89 cout <<
"Getting caloJets" << endl;
96 cout <<
"Getting recHits" << endl;
108 cout <<
"# of digis gotten - HBHE: " << HBHEDigis->
size() << endl;
110 evt.
getByLabel(
"ecalDigis",
"ebDigis", EBDigis);
111 evt.
getByLabel(
"ecalDigis",
"eeDigis", EEDigis);
117 cout <<
" *********************************************************" << endl;
123 std::vector<CaloTowerPtr>
towers =
jet->getCaloConstituents();
125 cout <<
" Jet: " << jetInd <<
", eta=" <<
jet->eta() <<
", phi=" <<
jet->phi() <<
", pt=" <<
jet->pt()
126 <<
",E=" <<
jet->energy() <<
", EB E=" <<
jet->emEnergyInEB() <<
" ,HB E=" <<
jet->hadEnergyInHB()
127 <<
", HO E=" <<
jet->hadEnergyInHO() <<
" ,EE E=" <<
jet->emEnergyInEE() <<
", HE E=" <<
jet->hadEnergyInHE()
128 <<
", HF E=" <<
jet->hadEnergyInHF() +
jet->emEnergyInHF() <<
", Num Towers=" <<
nConstituents << endl;
130 cout <<
" =====================================================" << endl;
131 float sumTowerE = 0.0;
137 cerr <<
"Bug? Can't find the tower" << endl;
140 int ietaTower =
towers[
i]->id().ieta();
141 int iphiTower =
towers[
i]->id().iphi();
142 sumTowerE += theTower->energy();
143 size_t numRecHits = theTower->constituentsSize();
144 cout <<
" Tower " <<
i <<
": ieta=" << ietaTower <<
", eta=" << theTower->eta() <<
", iphi=" << iphiTower
145 <<
", phi=" << theTower->phi() <<
", energy=" << theTower->energy() <<
", EM=" << theTower->emEnergy()
146 <<
", HAD=" << theTower->hadEnergy() <<
", HO=" << theTower->outerEnergy()
147 <<
", Num Rec Hits =" << numRecHits << endl;
149 cout <<
" ------------------------------------------------" << endl;
150 float sumRecHitE = 0.0;
152 for (
size_t j = 0;
j < numRecHits;
j++) {
153 DetId RecHitDetID = theTower->constituent(
j);
161 sumRecHitE += theRecHit->energy();
163 cout <<
" RecHit: " <<
j <<
": HB, ieta=" << HcalID.
ieta() <<
", iphi=" << HcalID.
iphi()
164 <<
", depth=" << HcalID.
depth() <<
", energy=" << theRecHit->energy()
165 <<
", time=" << theRecHit->time() <<
", All Digis=" << theDigis->size()
166 <<
", presamples =" << theDigis->presamples() << endl;
172 float SumDigiCharge = 0.0;
173 float EstimatedPedestal = 0.0;
174 int SamplesToAdd = 4;
176 cout <<
" ......................................" << endl;
178 for (
int k = 0;
k < theDigis->size();
k++) {
180 if (
k >= theDigis->presamples() &&
k < theDigis->presamples() + SamplesToAdd)
183 EstimatedPedestal += QIE.
nominal_fC() * SamplesToAdd / (theDigis->presamples() - 1);
184 cout <<
" Digi: " <<
k <<
", cap ID = " << QIE.
capid()
185 <<
": ADC Counts = " << QIE.
adc() <<
", nominal fC = " << QIE.
nominal_fC() << endl;
188 cout <<
" 4 Digi fC =" << SumDigiCharge <<
", est. ped. fC=" << EstimatedPedestal
189 <<
", est. GeV/fc=" << theRecHit->energy() / (SumDigiCharge - EstimatedPedestal) << endl;
191 cout <<
" ......................................" << endl;
195 sumRecHitE += theRecHit->energy() / 2;
197 sumRecHitE += theRecHit->energy();
200 cout <<
" RecHit: " <<
j <<
": HE, ieta=" << HcalID.
ieta() <<
", iphi=" << HcalID.
iphi()
201 <<
", depth=" << HcalID.
depth() <<
", energy=" << theRecHit->energy()
202 <<
", time=" << theRecHit->time() <<
", All Digis=" << theDigis->size()
203 <<
", presamples =" << theDigis->presamples() << endl;
204 float SumDigiCharge = 0.0;
205 float EstimatedPedestal = 0.0;
206 int SamplesToAdd = 4;
208 cout <<
" ......................................" << endl;
210 for (
int k = 0;
k < theDigis->size();
k++) {
212 if (
k >= theDigis->presamples() &&
k < theDigis->presamples() + SamplesToAdd)
215 EstimatedPedestal += QIE.
nominal_fC() * SamplesToAdd / (theDigis->presamples() - 1);
216 cout <<
" Digi: " <<
k <<
", cap ID = " << QIE.
capid()
217 <<
": ADC Counts = " << QIE.
adc() <<
", nominal fC = " << QIE.
nominal_fC() << endl;
220 cout <<
" 4 Digi fC =" << SumDigiCharge <<
", est. ped. fC=" << EstimatedPedestal
221 <<
", est. GeV/fc=" << theRecHit->energy() / (SumDigiCharge - EstimatedPedestal) << endl;
223 cout <<
" ......................................" << endl;
226 sumRecHitE += theRecHit->energy();
228 cout <<
" RecHit: " <<
j <<
": HO, ieta=" << HcalID.
ieta() <<
", iphi=" << HcalID.
iphi()
229 <<
", depth=" << HcalID.
depth() <<
", energy=" << theRecHit->energy()
230 <<
", time=" << theRecHit->time() <<
", All Digis=" << theDigis->size()
231 <<
", presamples =" << theDigis->presamples() << endl;
232 float SumDigiCharge = 0.0;
233 float EstimatedPedestal = 0.0;
234 int SamplesToAdd = 4;
236 cout <<
" ......................................" << endl;
238 for (
int k = 0;
k < theDigis->size();
k++) {
240 if (
k >= theDigis->presamples() &&
k < theDigis->presamples() + SamplesToAdd)
243 EstimatedPedestal += QIE.
nominal_fC() * SamplesToAdd / (theDigis->presamples() - 1);
244 cout <<
" Digi: " <<
k <<
", cap ID = " << QIE.
capid()
245 <<
": ADC Counts = " << QIE.
adc() <<
", nominal fC = " << QIE.
nominal_fC() << endl;
248 cout <<
" 4 Digi fC =" << SumDigiCharge <<
", est. ped. fC=" << EstimatedPedestal
249 <<
", est. GeV/fc=" << theRecHit->energy() / (SumDigiCharge - EstimatedPedestal) << endl;
251 cout <<
" ......................................" << endl;
254 sumRecHitE += theRecHit->energy();
256 cout <<
" RecHit: " <<
j <<
": HF, ieta=" << HcalID.
ieta() <<
", iphi=" << HcalID.
iphi()
257 <<
", depth=" << HcalID.
depth() <<
", energy=" << theRecHit->energy()
258 <<
", time=" << theRecHit->time() <<
", All Digis=" << theDigis->size()
259 <<
", presamples =" << theDigis->presamples() << endl;
260 float SumDigiCharge = 0.0;
261 float EstimatedPedestal = 0.0;
262 int SamplesToAdd = 1;
264 cout <<
" ......................................" << endl;
266 for (
int k = 0;
k < theDigis->size();
k++) {
268 if (
k >= theDigis->presamples() &&
k < theDigis->presamples() + SamplesToAdd)
271 EstimatedPedestal += QIE.
nominal_fC() * SamplesToAdd / (theDigis->presamples() - 1);
272 cout <<
" Digi: " <<
k <<
", cap ID = " << QIE.
capid()
273 <<
": ADC Counts = " << QIE.
adc() <<
", nominal fC = " << QIE.
nominal_fC() << endl;
276 cout <<
" 1 Digi fC =" << SumDigiCharge <<
", est. ped. fC=" << EstimatedPedestal
277 <<
", est. GeV/fc=" << theRecHit->energy() / (SumDigiCharge - EstimatedPedestal) << endl;
279 cout <<
" ......................................" << endl;
283 int EcalNum = RecHitDetID.
subdetId();
288 sumRecHitE += theRecHit->energy();
289 cout <<
" RecHit " <<
j <<
": EB, ieta=" << EcalID.
ieta() <<
", iphi=" << EcalID.
iphi()
290 <<
", SM=" << EcalID.
ism() <<
", energy=" << theRecHit->energy()
291 <<
", All Digis=" << theDigis->size() << endl;
293 cout <<
" ......................................" << endl;
295 for (
unsigned int k = 0;
k < theDigis->size();
k++) {
298 cout <<
" Digi: " <<
k <<
": ADC Sample = " << MGPA.
adc()
299 <<
", Gain ID = " << MGPA.
gainId() << endl;
302 cout <<
" ......................................" << endl;
303 }
else if (EcalNum == 2) {
307 sumRecHitE += theRecHit->energy();
308 cout <<
" RecHit " <<
j <<
": EE, ix=" << EcalID.
ix() <<
", iy=" << EcalID.
iy()
309 <<
", energy=" << theRecHit->energy() <<
", All Digis=" << theDigis->size() << endl;
311 cout <<
" ......................................" << endl;
313 for (
unsigned int k = 0;
k < theDigis->size();
k++) {
316 cout <<
" Digi: " <<
k <<
": ADC Sample = " << MGPA.
adc()
317 <<
", Gain ID = " << MGPA.
gainId() << endl;
320 cout <<
" ......................................" << endl;
325 if (
abs(ietaTower) == 28 ||
abs(ietaTower) == 29) {
326 cout <<
" Splitted Sum of RecHit Energies=" << sumRecHitE
327 <<
", CaloTower energy=" << theTower->energy() << endl;
329 cout <<
" Sum of RecHit Energies=" << sumRecHitE <<
", CaloTower energy=" << theTower->energy()
334 cout <<
" ------------------------------------------------" << endl;
337 cout <<
" Sum of tower energies=" << sumTowerE <<
", CaloJet energy=" <<
jet->energy() << endl;
340 cout <<
" =====================================================" << endl;
344 cout <<
" *********************************************************" << endl;
int iphi() const
get the crystal iphi
constexpr double nominal_fC() const
get the nominal FC (no calibrations applied)
std::vector< CaloTower >::const_iterator const_iterator
constexpr Detector det() const
get the detector field from this detid
int ieta() const
get the crystal ieta
constexpr HcalSubdetector subdet() const
get the subdetector
constexpr int ieta() const
get the cell ieta
int ism() const
get the ECAL/SM id
Abs< T >::type abs(const T &t)
constexpr int subdetId() const
get the contents of the subdetector field (not cast into any detector's numbering enum) ...
boost::transform_iterator< IterHelp, boost::counting_iterator< int > > const_iterator
iterator find(key_type k)
constexpr int capid() const
get the Capacitor id
constexpr int adc() const
get the ADC sample
int adc() const
get the ADC sample (12 bits)
const_iterator find(id_type i) const
constexpr int iphi() const
get the cell iphi
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
int gainId() const
get the gainId (2 bits)
constexpr int depth() const
get the tower depth