119 : fOutputFileName(iConfig.getUntrackedParameter<
std::
string>(
"HistOutFile")),
120 runNZS_(iConfig.getUntrackedParameter<
bool>(
"RunNZS",
true)),
121 theRecalib_(iConfig.getParameter<
bool>(
"Recalib")),
122 ignoreL1_(iConfig.getUntrackedParameter<
bool>(
"IgnoreL1",
true)),
140 for (
int subd = 0; subd < 4; ++subd) {
141 sprintf(
name,
"Noise_%s", det[subd].c_str());
142 sprintf(
title,
"Energy Distribution for Noise in %s", det[subd].c_str());
144 sprintf(
name,
"Signal_%s", det[subd].c_str());
145 sprintf(
title,
"Energy Distribution for Signal in %s", det[subd].c_str());
151 myTree_ =
fs->make<TTree>(
"RecJet",
"RecJet Tree");
186 edm::LogVerbatim(
"AnalyzerMinimumBias") <<
"Fired trigger bit number " << itr->first.first;
189 if (
info.theMB0 > 0) {
205 mysubd = itr->first.second.subdet();
206 depth = itr->first.second.depth();
207 ieta = itr->first.second.ieta();
208 iphi = itr->first.second.iphi();
228 for (
int i = 0;
i < 4;
i++) {
252 edm::LogVerbatim(
"AnalyzerMinimumBias") <<
" The size of the normal collection " << hbheNormal->
size();
257 edm::LogWarning(
"AnalyzerMinimumBias") <<
"HcalCalibAlgos: Error! can't get hbheNoise product!";
269 edm::LogWarning(
"AnalyzerMinimumBias") <<
"HcalCalibAlgos: Error! can't get hbhe product!";
281 edm::LogWarning(
"AnalyzerMinimumBias") <<
"HcalCalibAlgos: Error! can't get hfNoise product!";
293 edm::LogWarning(
"AnalyzerMinimumBias") <<
"HcalCalibAlgos: Error! can't get hf product!";
304 analyzeHcal(myRecalib, HithbheNS, HithbheMB, HithfNS, HithfMB, 1,
true);
307 if (gtObjectMapRecord.
isValid()) {
308 const std::vector<L1GlobalTriggerObjectMap>& objMapVec = gtObjectMapRecord->
gtObjectMap();
310 bool ok(
false),
fill(
true);
311 for (std::vector<L1GlobalTriggerObjectMap>::const_iterator itMap = objMapVec.begin(); itMap != objMapVec.end();
313 bool resultGt = (*itMap).algoGtlResult();
316 int algoBit = (*itMap).algoBitNumber();
317 analyzeHcal(myRecalib, HithbheNS, HithbheMB, HithfNS, HithfMB, algoBit,
fill);
322 <<
"Trigger[" <<
ii <<
"] " << algoNameStr <<
" bit " << algoBit <<
" entered";
340 std::map<std::pair<int, HcalDetId>,
myInfo> tmpMap;
345 float icalconst = 1.;
350 HBHERecHit aHit(hbheItr->id(), hbheItr->energy() * icalconst, hbheItr->time());
351 double energyhit = aHit.
energy();
353 DetId id = (*hbheItr).detid();
355 std::map<std::pair<int, HcalDetId>,
myInfo>::iterator itr1 =
myMap_.find(std::pair<int, HcalDetId>(algoBit, hid));
356 if (itr1 ==
myMap_.end()) {
358 myMap_[std::pair<int, HcalDetId>(algoBit, hid)] =
info;
359 itr1 =
myMap_.find(std::pair<int, HcalDetId>(algoBit, hid));
361 itr1->second.theNS0++;
362 itr1->second.theNS1 += energyhit;
363 itr1->second.theNS2 += (energyhit * energyhit);
364 itr1->second.theNS3 += (energyhit * energyhit * energyhit);
365 itr1->second.theNS4 += (energyhit * energyhit * energyhit * energyhit);
366 itr1->second.runcheck =
rnnum_;
370 std::map<std::pair<int, HcalDetId>,
myInfo>::iterator itr2 = tmpMap.find(std::pair<int, HcalDetId>(algoBit, hid));
371 if (itr2 == tmpMap.end()) {
373 tmpMap[std::pair<int, HcalDetId>(algoBit, hid)] =
info;
374 itr2 = tmpMap.find(std::pair<int, HcalDetId>(algoBit, hid));
376 itr2->second.theNS0++;
377 itr2->second.theNS1 += energyhit;
378 itr2->second.theNS2 += (energyhit * energyhit);
379 itr2->second.theNS3 += (energyhit * energyhit * energyhit);
380 itr2->second.theNS4 += (energyhit * energyhit * energyhit * energyhit);
381 itr2->second.runcheck =
rnnum_;
389 float icalconst = 1.;
394 HBHERecHit aHit(hbheItr->id(), hbheItr->energy() * icalconst, hbheItr->time());
395 double energyhit = aHit.
energy();
397 DetId id = (*hbheItr).detid();
400 std::map<std::pair<int, HcalDetId>,
myInfo>::iterator itr1 =
myMap_.find(std::pair<int, HcalDetId>(algoBit, hid));
401 std::map<std::pair<int, HcalDetId>,
myInfo>::iterator itr2 = tmpMap.find(std::pair<int, HcalDetId>(algoBit, hid));
403 if (itr1 ==
myMap_.end()) {
405 myMap_[std::pair<int, HcalDetId>(algoBit, hid)] =
info;
406 itr1 =
myMap_.find(std::pair<int, HcalDetId>(algoBit, hid));
408 itr1->second.theMB0++;
409 itr1->second.theDif0 = 0;
410 itr1->second.theMB1 += energyhit;
411 itr1->second.theMB2 += (energyhit * energyhit);
412 itr1->second.theMB3 += (energyhit * energyhit * energyhit);
413 itr1->second.theMB4 += (energyhit * energyhit * energyhit * energyhit);
414 itr1->second.runcheck =
rnnum_;
416 if (itr2 != tmpMap.end()) {
417 mydiff = energyhit - (itr2->second.theNS1);
418 itr1->second.theDif0++;
419 itr1->second.theDif1 += mydiff;
420 itr1->second.theDif2 += (mydiff * mydiff);
430 float icalconst = 1.;
435 HFRecHit aHit(hbheItr->id(), hbheItr->energy() * icalconst, hbheItr->time());
436 double energyhit = aHit.
energy();
438 if (fabs(energyhit) > 40.)
440 DetId id = (*hbheItr).detid();
443 std::map<std::pair<int, HcalDetId>,
myInfo>::iterator itr1 =
myMap_.find(std::pair<int, HcalDetId>(algoBit, hid));
445 if (itr1 ==
myMap_.end()) {
447 myMap_[std::pair<int, HcalDetId>(algoBit, hid)] =
info;
448 itr1 =
myMap_.find(std::pair<int, HcalDetId>(algoBit, hid));
450 itr1->second.theNS0++;
451 itr1->second.theNS1 += energyhit;
452 itr1->second.theNS2 += (energyhit * energyhit);
453 itr1->second.theNS3 += (energyhit * energyhit * energyhit);
454 itr1->second.theNS4 += (energyhit * energyhit * energyhit * energyhit);
455 itr1->second.runcheck =
rnnum_;
459 std::map<std::pair<int, HcalDetId>,
myInfo>::iterator itr2 = tmpMap.find(std::pair<int, HcalDetId>(algoBit, hid));
460 if (itr2 == tmpMap.end()) {
462 tmpMap[std::pair<int, HcalDetId>(algoBit, hid)] =
info;
463 itr2 = tmpMap.find(std::pair<int, HcalDetId>(algoBit, hid));
465 itr2->second.theNS0++;
466 itr2->second.theNS1 += energyhit;
467 itr2->second.theNS2 += (energyhit * energyhit);
468 itr2->second.theNS3 += (energyhit * energyhit * energyhit);
469 itr2->second.theNS4 += (energyhit * energyhit * energyhit * energyhit);
470 itr2->second.runcheck =
rnnum_;
478 float icalconst = 1.;
482 HFRecHit aHit(hbheItr->id(), hbheItr->energy() * icalconst, hbheItr->time());
484 double energyhit = aHit.
energy();
486 if (fabs(energyhit) > 40.)
489 DetId id = (*hbheItr).detid();
492 std::map<std::pair<int, HcalDetId>,
myInfo>::iterator itr1 =
myMap_.find(std::pair<int, HcalDetId>(algoBit, hid));
493 std::map<std::pair<int, HcalDetId>,
myInfo>::iterator itr2 = tmpMap.find(std::pair<int, HcalDetId>(algoBit, hid));
495 if (itr1 ==
myMap_.end()) {
497 myMap_[std::pair<int, HcalDetId>(algoBit, hid)] =
info;
498 itr1 =
myMap_.find(std::pair<int, HcalDetId>(algoBit, hid));
500 itr1->second.theMB0++;
501 itr1->second.theDif0 = 0;
502 itr1->second.theMB1 += energyhit;
503 itr1->second.theMB2 += (energyhit * energyhit);
504 itr1->second.theMB3 += (energyhit * energyhit * energyhit);
505 itr1->second.theMB4 += (energyhit * energyhit * energyhit * energyhit);
506 itr1->second.runcheck =
rnnum_;
508 if (itr2 != tmpMap.end()) {
509 mydiff = energyhit - (itr2->second.theNS1);
510 itr1->second.theDif0++;
511 itr1->second.theDif1 += mydiff;
512 itr1->second.theDif2 += (mydiff * mydiff);
static const std::string kSharedResource
Log< level::Info, true > LogVerbatim
const edm::EDGetTokenT< HBHERecHitCollection > tok_hbherecoNoise_
#define DEFINE_FWK_MODULE(type)
const edm::EDGetTokenT< HFRecHitCollection > tok_hfrecoMB_
T const * product() const
std::vector< T >::const_iterator const_iterator
const edm::EDGetTokenT< HBHERecHitCollection > tok_hbheNormal_
AnalyzerMinbias(const edm::ParameterSet &)
const edm::EDGetTokenT< HFRecHitCollection > tok_hfrecoNoise_
const Item * getValues(DetId fId, bool throwOnFail=true) const
constexpr float energy() const
const std::vector< L1GlobalTriggerObjectMap > & gtObjectMap() const
get / set the vector of object maps
constexpr HcalSubdetector subdet() const
get the subdetector
const edm::EDGetTokenT< HBHERecHitCollection > tok_hbherecoMB_
bool getData(T &iHolder) const
const_iterator begin() const
const edm::EDGetTokenT< L1GlobalTriggerObjectMapRecord > tok_hltL1GtMap_
std::ofstream * myout_hcal
const edm::ESGetToken< HcalRespCorrs, HcalRespCorrsRcd > tok_respCorr_
const_iterator end() const
constexpr uint32_t rawId() const
get the raw id
~AnalyzerMinbias() override=default
const edm::EDGetTokenT< HORecHitCollection > tok_horecoMB_
std::map< std::pair< int, HcalDetId >, myInfo > myMap_
Log< level::Warning, false > LogWarning
const std::string fOutputFileName
void analyzeHcal(const HcalRespCorrs *myRecalib, const HBHERecHitCollection &HithbheNS, const HBHERecHitCollection &HithbheMB, const HFRecHitCollection &HithfNS, const HFRecHitCollection &HithfMB, int algoBit, bool fill)
void analyze(const edm::Event &, const edm::EventSetup &) override
const edm::EDGetTokenT< HORecHitCollection > tok_horecoNoise_