142 tok_respCorr_ = esConsumes<HcalRespCorrs, HcalRespCorrsRcd>();
150 for (
int subd = 0; subd < 4; ++subd) {
151 sprintf(
name,
"Noise_%s", det[subd].c_str());
152 sprintf(
title,
"Energy Distribution for Noise in %s", det[subd].c_str());
154 sprintf(
name,
"Signal_%s", det[subd].c_str());
155 sprintf(
title,
"Energy Distribution for Signal in %s", det[subd].c_str());
160 myTree =
new TTree(
"RecJet",
"RecJet Tree");
198 if (
info.theMB0 > 0) {
216 ieta =
itr->first.second.ieta();
217 iphi =
itr->first.second.iphi();
237 for (
int i = 0;
i < 4;
i++) {
268 edm::LogWarning(
"AnalyzerMB") <<
"HcalCalibAlgos: Error! can't get hbheNoise product!";
281 edm::LogWarning(
"AnalyzerMB") <<
"HcalCalibAlgos: Error! can't get hbhe product!";
294 edm::LogWarning(
"AnalyzerMB") <<
"HcalCalibAlgos: Error! can't get hfNoise product!";
307 edm::LogWarning(
"AnalyzerMB") <<
"HcalCalibAlgos: Error! can't get hf product!";
318 analyzeHcal(myRecalib, HithbheNS, HithbheMB, HithfNS, HithfMB, 1,
true);
322 if (gtObjectMapRecord.
isValid()) {
323 const std::vector<L1GlobalTriggerObjectMap>& objMapVec = gtObjectMapRecord->
gtObjectMap();
325 bool ok(
false),
fill(
true);
326 for (std::vector<L1GlobalTriggerObjectMap>::const_iterator itMap = objMapVec.begin(); itMap != objMapVec.end();
328 bool resultGt = (*itMap).algoGtlResult();
331 int algoBit = (*itMap).algoBitNumber();
332 analyzeHcal(myRecalib, HithbheNS, HithbheMB, HithfNS, HithfMB, algoBit,
fill);
336 edm::LogVerbatim(
"AnalyzerMB") <<
"Trigger[" <<
ii <<
"] " << algoNameStr <<
" bit " << algoBit <<
" entered";
354 std::map<std::pair<int, HcalDetId>,
myInfo> tmpMap;
359 float icalconst = 1.;
364 HBHERecHit aHit(hbheItr->id(), hbheItr->energy() * icalconst, hbheItr->time());
365 double energyhit = aHit.
energy();
367 DetId id = (*hbheItr).detid();
369 std::map<std::pair<int, HcalDetId>,
myInfo>::iterator itr1 =
myMap_.find(std::pair<int, HcalDetId>(algoBit, hid));
370 if (itr1 ==
myMap_.end()) {
372 myMap_[std::pair<int, HcalDetId>(algoBit, hid)] =
info;
373 itr1 =
myMap_.find(std::pair<int, HcalDetId>(algoBit, hid));
375 itr1->second.theNS0++;
376 itr1->second.theNS1 += energyhit;
377 itr1->second.theNS2 += (energyhit * energyhit);
378 itr1->second.theNS3 += (energyhit * energyhit * energyhit);
379 itr1->second.theNS4 += (energyhit * energyhit * energyhit * energyhit);
380 itr1->second.runcheck =
rnnum;
384 std::map<std::pair<int, HcalDetId>,
myInfo>::iterator itr2 = tmpMap.find(std::pair<int, HcalDetId>(algoBit, hid));
385 if (itr2 == tmpMap.end()) {
387 tmpMap[std::pair<int, HcalDetId>(algoBit, hid)] =
info;
388 itr2 = tmpMap.find(std::pair<int, HcalDetId>(algoBit, hid));
390 itr2->second.theNS0++;
391 itr2->second.theNS1 += energyhit;
392 itr2->second.theNS2 += (energyhit * energyhit);
393 itr2->second.theNS3 += (energyhit * energyhit * energyhit);
394 itr2->second.theNS4 += (energyhit * energyhit * energyhit * energyhit);
395 itr2->second.runcheck =
rnnum;
403 float icalconst = 1.;
408 HBHERecHit aHit(hbheItr->id(), hbheItr->energy() * icalconst, hbheItr->time());
409 double energyhit = aHit.
energy();
411 DetId id = (*hbheItr).detid();
414 std::map<std::pair<int, HcalDetId>,
myInfo>::iterator itr1 =
myMap_.find(std::pair<int, HcalDetId>(algoBit, hid));
415 std::map<std::pair<int, HcalDetId>,
myInfo>::iterator itr2 = tmpMap.find(std::pair<int, HcalDetId>(algoBit, hid));
417 if (itr1 ==
myMap_.end()) {
419 myMap_[std::pair<int, HcalDetId>(algoBit, hid)] =
info;
420 itr1 =
myMap_.find(std::pair<int, HcalDetId>(algoBit, hid));
422 itr1->second.theMB0++;
423 itr1->second.theDif0 = 0;
424 itr1->second.theMB1 += energyhit;
425 itr1->second.theMB2 += (energyhit * energyhit);
426 itr1->second.theMB3 += (energyhit * energyhit * energyhit);
427 itr1->second.theMB4 += (energyhit * energyhit * energyhit * energyhit);
428 itr1->second.runcheck =
rnnum;
430 if (itr2 != tmpMap.end()) {
431 mydiff = energyhit - (itr2->second.theNS1);
432 itr1->second.theDif0++;
433 itr1->second.theDif1 += mydiff;
434 itr1->second.theDif2 += (mydiff * mydiff);
444 float icalconst = 1.;
449 HFRecHit aHit(hbheItr->id(), hbheItr->energy() * icalconst, hbheItr->time());
450 double energyhit = aHit.
energy();
452 if (fabs(energyhit) > 40.)
454 DetId id = (*hbheItr).detid();
457 std::map<std::pair<int, HcalDetId>,
myInfo>::iterator itr1 =
myMap_.find(std::pair<int, HcalDetId>(algoBit, hid));
459 if (itr1 ==
myMap_.end()) {
461 myMap_[std::pair<int, HcalDetId>(algoBit, hid)] =
info;
462 itr1 =
myMap_.find(std::pair<int, HcalDetId>(algoBit, hid));
464 itr1->second.theNS0++;
465 itr1->second.theNS1 += energyhit;
466 itr1->second.theNS2 += (energyhit * energyhit);
467 itr1->second.theNS3 += (energyhit * energyhit * energyhit);
468 itr1->second.theNS4 += (energyhit * energyhit * energyhit * energyhit);
469 itr1->second.runcheck =
rnnum;
473 std::map<std::pair<int, HcalDetId>,
myInfo>::iterator itr2 = tmpMap.find(std::pair<int, HcalDetId>(algoBit, hid));
474 if (itr2 == tmpMap.end()) {
476 tmpMap[std::pair<int, HcalDetId>(algoBit, hid)] =
info;
477 itr2 = tmpMap.find(std::pair<int, HcalDetId>(algoBit, hid));
479 itr2->second.theNS0++;
480 itr2->second.theNS1 += energyhit;
481 itr2->second.theNS2 += (energyhit * energyhit);
482 itr2->second.theNS3 += (energyhit * energyhit * energyhit);
483 itr2->second.theNS4 += (energyhit * energyhit * energyhit * energyhit);
484 itr2->second.runcheck =
rnnum;
492 float icalconst = 1.;
496 HFRecHit aHit(hbheItr->id(), hbheItr->energy() * icalconst, hbheItr->time());
498 double energyhit = aHit.
energy();
500 if (fabs(energyhit) > 40.)
503 DetId id = (*hbheItr).detid();
506 std::map<std::pair<int, HcalDetId>,
myInfo>::iterator itr1 =
myMap_.find(std::pair<int, HcalDetId>(algoBit, hid));
507 std::map<std::pair<int, HcalDetId>,
myInfo>::iterator itr2 = tmpMap.find(std::pair<int, HcalDetId>(algoBit, hid));
509 if (itr1 ==
myMap_.end()) {
511 myMap_[std::pair<int, HcalDetId>(algoBit, hid)] =
info;
512 itr1 =
myMap_.find(std::pair<int, HcalDetId>(algoBit, hid));
514 itr1->second.theMB0++;
515 itr1->second.theDif0 = 0;
516 itr1->second.theMB1 += energyhit;
517 itr1->second.theMB2 += (energyhit * energyhit);
518 itr1->second.theMB3 += (energyhit * energyhit * energyhit);
519 itr1->second.theMB4 += (energyhit * energyhit * energyhit * energyhit);
520 itr1->second.runcheck =
rnnum;
522 if (itr2 != tmpMap.end()) {
523 mydiff = energyhit - (itr2->second.theNS1);
524 itr1->second.theDif0++;
525 itr1->second.theDif1 += mydiff;
526 itr1->second.theDif2 += (mydiff * mydiff);