59 namespace HcalMinbias {}
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());
143 h_Noise[subd] =
new TH1D(name, title, 100, -10., 10.);
144 sprintf(name,
"Signal_%s", det[subd].c_str());
145 sprintf(title,
"Energy Distribution for Signal in %s", det[subd].c_str());
146 h_Signal[subd] =
new TH1D(name, title, 100, -10., 10.);
151 myTree_ = fs->
make<TTree>(
"RecJet",
"RecJet Tree");
152 myTree_->Branch(
"mydet", &
mydet,
"mydet/I");
153 myTree_->Branch(
"mysubd", &
mysubd,
"mysubd/I");
154 myTree_->Branch(
"cells", &
cells,
"cells");
155 myTree_->Branch(
"depth", &
depth,
"depth/I");
156 myTree_->Branch(
"ieta", &
ieta,
"ieta/I");
157 myTree_->Branch(
"iphi", &
iphi,
"iphi/I");
158 myTree_->Branch(
"eta", &
eta,
"eta/F");
159 myTree_->Branch(
"phi", &
phi,
"phi/F");
160 myTree_->Branch(
"mom0_MB", &
mom0_MB,
"mom0_MB/F");
161 myTree_->Branch(
"mom1_MB", &
mom1_MB,
"mom1_MB/F");
162 myTree_->Branch(
"mom2_MB", &
mom2_MB,
"mom2_MB/F");
163 myTree_->Branch(
"mom3_MB", &
mom3_MB,
"mom3_MB/F");
164 myTree_->Branch(
"mom4_MB", &
mom4_MB,
"mom4_MB/F");
165 myTree_->Branch(
"mom0_Noise", &
mom0_Noise,
"mom0_Noise/F");
166 myTree_->Branch(
"mom1_Noise", &
mom1_Noise,
"mom1_Noise/F");
167 myTree_->Branch(
"mom2_Noise", &
mom2_Noise,
"mom2_Noise/F");
168 myTree_->Branch(
"mom3_Noise", &
mom3_Noise,
"mom3_Noise/F");
169 myTree_->Branch(
"mom4_Noise", &
mom4_Noise,
"mom4_Noise/F");
170 myTree_->Branch(
"mom0_Diff", &
mom0_Diff,
"mom0_Diff/F");
171 myTree_->Branch(
"mom1_Diff", &
mom1_Diff,
"mom1_Diff/F");
172 myTree_->Branch(
"mom2_Diff", &
mom2_Diff,
"mom2_Diff/F");
173 myTree_->Branch(
"occup", &
occup,
"occup/F");
174 myTree_->Branch(
"trigbit", &
trigbit,
"trigbit/I");
175 myTree_->Branch(
"rnnumber", &
rnnumber,
"rnnumber/D");
184 for (std::map<std::pair<int, HcalDetId>,
myInfo>::const_iterator itr =
myMap_.begin(); itr !=
myMap_.end(); ++itr) {
186 edm::LogVerbatim(
"AnalyzerMinimumBias") <<
"Fired trigger bit number " << itr->first.first;
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));
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));
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);
constexpr float energy() const
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_
constexpr uint32_t rawId() const
get the raw id
std::vector< T >::const_iterator const_iterator
T * make(const Args &...args) const
make new ROOT object
const Item * getValues(DetId fId, bool throwOnFail=true) const
const edm::EDGetTokenT< HBHERecHitCollection > tok_hbheNormal_
AnalyzerMinbias(const edm::ParameterSet &)
const edm::EDGetTokenT< HFRecHitCollection > tok_hfrecoNoise_
bool getData(T &iHolder) const
constexpr HcalSubdetector subdet() const
get the subdetector
Handle< PROD > getHandle(EDGetTokenT< PROD > token) const
const edm::EDGetTokenT< HBHERecHitCollection > tok_hbherecoMB_
const edm::EDGetTokenT< L1GlobalTriggerObjectMapRecord > tok_hltL1GtMap_
std::ofstream * myout_hcal
const edm::ESGetToken< HcalRespCorrs, HcalRespCorrsRcd > tok_respCorr_
const_iterator end() const
void fill(std::map< std::string, TH1 * > &h, const std::string &s, double x)
T const * product() const
~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_iterator begin() const
const edm::EDGetTokenT< HORecHitCollection > tok_horecoNoise_