CMS 3D CMS Logo

List of all members | Classes | Public Member Functions | Private Member Functions | Private Attributes
AnalyzerMinbias Class Reference
Inheritance diagram for AnalyzerMinbias:
edm::EDAnalyzer edm::EDConsumerBase

Classes

struct  myInfo
 

Public Member Functions

void analyze (const edm::Event &, const edm::EventSetup &) override
 
 AnalyzerMinbias (const edm::ParameterSet &)
 
void beginJob () override
 
void endJob () override
 
 ~AnalyzerMinbias () override
 
- Public Member Functions inherited from edm::EDAnalyzer
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzer ()
 
SerialTaskQueueglobalLuminosityBlocksQueue ()
 
SerialTaskQueueglobalRunsQueue ()
 
ModuleDescription const & moduleDescription () const
 
std::string workerType () const
 
 ~EDAnalyzer () override
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
void convertCurrentProcessAlias (std::string const &processName)
 Convert "@currentProcess" in InputTag process names to the actual current process name. More...
 
 EDConsumerBase ()
 
 EDConsumerBase (EDConsumerBase &&)=default
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
ESProxyIndex const * esGetTokenIndices (edm::Transition iTrans) const
 
ProductResolverIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
std::vector< ProductResolverIndexAndSkipBit > const & itemsToGetFrom (BranchType iType) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
void updateLookup (eventsetup::ESRecordsToProxyIndices const &)
 
virtual ~EDConsumerBase () noexcept(false)
 

Private Member Functions

void analyzeHcal (const HcalRespCorrs *myRecalib, const HBHERecHitCollection &HithbheNS, const HBHERecHitCollection &HithbheMB, const HFRecHitCollection &HithfNS, const HFRecHitCollection &HithfMB, int algoBit, bool fill)
 

Private Attributes

int cells
 
int depth
 
float eta
 
std::string fOutputFileName
 
TH1D * h_Noise [4]
 
TH1D * h_Signal [4]
 
std::string hcalfile_
 
TFile * hOutputFile
 
int ieta
 
bool ignoreL1_
 
int iphi
 
float mom0_Diff
 
float mom0_MB
 
float mom0_Noise
 
float mom1_Diff
 
float mom1_MB
 
float mom1_Noise
 
float mom2_Diff
 
float mom2_MB
 
float mom2_Noise
 
float mom3_Diff
 
float mom3_MB
 
float mom3_Noise
 
float mom4_Diff
 
float mom4_MB
 
float mom4_Noise
 
int mydet
 
std::map< std::pair< int, HcalDetId >, myInfomyMap_
 
std::ofstream * myout_hcal
 
int mysubd
 
TTree * myTree
 
float occup
 
float phi
 
double rnnum
 
double rnnumber
 
bool runNZS_
 
bool theRecalib_
 
edm::EDGetTokenT< HBHERecHitCollectiontok_hbheNormal_
 
edm::EDGetTokenT< HBHERecHitCollectiontok_hbherecoMB_
 
edm::EDGetTokenT< HBHERecHitCollectiontok_hbherecoNoise_
 
edm::EDGetTokenT< HFRecHitCollectiontok_hfrecoMB_
 
edm::EDGetTokenT< HFRecHitCollectiontok_hfrecoNoise_
 
edm::EDGetTokenT< L1GlobalTriggerObjectMapRecordtok_hltL1GtMap_
 
edm::EDGetTokenT< HORecHitCollectiontok_horecoMB_
 
edm::EDGetTokenT< HORecHitCollectiontok_horecoNoise_
 
int trigbit
 

Additional Inherited Members

- Public Types inherited from edm::EDAnalyzer
typedef EDAnalyzer ModuleType
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Static Public Member Functions inherited from edm::EDAnalyzer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &)
 
static bool wantsGlobalLuminosityBlocks ()
 
static bool wantsGlobalRuns ()
 
static bool wantsStreamLuminosityBlocks ()
 
static bool wantsStreamRuns ()
 
- Protected Member Functions inherited from edm::EDConsumerBase
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes ()
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 

Detailed Description

Definition at line 65 of file AnalyzerMinbias.cc.

Constructor & Destructor Documentation

◆ AnalyzerMinbias()

AnalyzerMinbias::AnalyzerMinbias ( const edm::ParameterSet iConfig)
explicit

Definition at line 119 of file AnalyzerMinbias.cc.

119  {
120  // get name of output file with histogramms
121  fOutputFileName = iConfig.getUntrackedParameter<std::string>("HistOutFile");
122 
123  // get token names of modules, producing object collections
124  tok_hbherecoMB_ = consumes<HBHERecHitCollection>(iConfig.getParameter<edm::InputTag>("hbheInputMB"));
125  tok_horecoMB_ = consumes<HORecHitCollection>(iConfig.getParameter<edm::InputTag>("hoInputMB"));
126  tok_hfrecoMB_ = consumes<HFRecHitCollection>(iConfig.getParameter<edm::InputTag>("hfInputMB"));
127 
128  tok_hbherecoNoise_ = consumes<HBHERecHitCollection>(iConfig.getParameter<edm::InputTag>("hbheInputNoise"));
129  tok_horecoNoise_ = consumes<HORecHitCollection>(iConfig.getParameter<edm::InputTag>("hoInputNoise"));
130  tok_hfrecoNoise_ = consumes<HFRecHitCollection>(iConfig.getParameter<edm::InputTag>("hfInputNoise"));
131 
132  theRecalib_ = iConfig.getParameter<bool>("Recalib");
133  ignoreL1_ = iConfig.getUntrackedParameter<bool>("IgnoreL1", true);
134  runNZS_ = iConfig.getUntrackedParameter<bool>("RunNZS", true);
135 
136  tok_hbheNormal_ = consumes<HBHERecHitCollection>(edm::InputTag("hbhereco"));
137  tok_hltL1GtMap_ = consumes<L1GlobalTriggerObjectMapRecord>(edm::InputTag("hltL1GtObjectMap"));
138 }

References fOutputFileName, edm::ParameterSet::getParameter(), edm::ParameterSet::getUntrackedParameter(), ignoreL1_, runNZS_, AlCaHLTBitMon_QueryRunRegistry::string, theRecalib_, tok_hbheNormal_, tok_hbherecoMB_, tok_hbherecoNoise_, tok_hfrecoMB_, tok_hfrecoNoise_, tok_hltL1GtMap_, tok_horecoMB_, and tok_horecoNoise_.

◆ ~AnalyzerMinbias()

AnalyzerMinbias::~AnalyzerMinbias ( )
override

Definition at line 140 of file AnalyzerMinbias.cc.

140 {}

Member Function Documentation

◆ analyze()

void AnalyzerMinbias::analyze ( const edm::Event iEvent,
const edm::EventSetup iSetup 
)
overridevirtual

Implements edm::EDAnalyzer.

Definition at line 241 of file AnalyzerMinbias.cc.

241  {
242  rnnum = (float)iEvent.run();
243  const HcalRespCorrs* myRecalib = nullptr;
244  if (theRecalib_) {
245  edm::ESHandle<HcalRespCorrs> recalibCorrs;
246  iSetup.get<HcalRespCorrsRcd>().get("recalibrate", recalibCorrs);
247  myRecalib = recalibCorrs.product();
248  } // theRecalib
249 
251  iEvent.getByToken(tok_hbheNormal_, hbheNormal);
252  if (!hbheNormal.isValid()) {
253  edm::LogInfo("AnalyzerMB") << " hbheNormal failed";
254  } else {
255  edm::LogInfo("AnalyzerMB") << " The size of the normal collection " << hbheNormal->size();
256  }
257 
259  iEvent.getByToken(tok_hbherecoNoise_, hbheNS);
260  if (!hbheNS.isValid()) {
261  edm::LogWarning("AnalyzerMB") << "HcalCalibAlgos: Error! can't get hbheNoise product!";
262  return;
263  }
264  const HBHERecHitCollection HithbheNS = *(hbheNS.product());
265  edm::LogInfo("AnalyzerMB") << "HBHE NS size of collection " << HithbheNS.size();
266  if (runNZS_ && HithbheNS.size() != 5184) {
267  edm::LogWarning("AnalyzerMB") << "HBHE NS problem " << rnnum << " size " << HithbheNS.size();
268  return;
269  }
270 
272  iEvent.getByToken(tok_hbherecoMB_, hbheMB);
273  if (!hbheMB.isValid()) {
274  edm::LogWarning("AnalyzerMB") << "HcalCalibAlgos: Error! can't get hbhe product!";
275  return;
276  }
277  const HBHERecHitCollection HithbheMB = *(hbheMB.product());
278  edm::LogInfo("AnalyzerMB") << "HBHE MB size of collection " << HithbheMB.size();
279  if (runNZS_ && HithbheMB.size() != 5184) {
280  edm::LogWarning("AnalyzerMB") << "HBHE problem " << rnnum << " size " << HithbheMB.size();
281  return;
282  }
283 
285  iEvent.getByToken(tok_hfrecoNoise_, hfNS);
286  if (!hfNS.isValid()) {
287  edm::LogWarning("AnalyzerMB") << "HcalCalibAlgos: Error! can't get hfNoise product!";
288  return;
289  }
290  const HFRecHitCollection HithfNS = *(hfNS.product());
291  edm::LogInfo("AnalyzerMB") << "HF NS size of collection " << HithfNS.size();
292  if (runNZS_ && HithfNS.size() != 1728) {
293  edm::LogWarning("AnalyzerMB") << "HF NS problem " << rnnum << " size " << HithfNS.size();
294  return;
295  }
296 
298  iEvent.getByToken(tok_hfrecoMB_, hfMB);
299  if (!hfMB.isValid()) {
300  edm::LogWarning("AnalyzerMB") << "HcalCalibAlgos: Error! can't get hf product!";
301  return;
302  }
303  const HFRecHitCollection HithfMB = *(hfMB.product());
304  edm::LogInfo("AnalyzerMB") << "HF MB size of collection " << HithfMB.size();
305  if (runNZS_ && HithfMB.size() != 1728) {
306  edm::LogWarning("AnalyzerMB") << "HF problem " << rnnum << " size " << HithfMB.size();
307  return;
308  }
309 
310  if (ignoreL1_) {
311  analyzeHcal(myRecalib, HithbheNS, HithbheMB, HithfNS, HithfMB, 1, true);
312  } else {
314  iEvent.getByToken(tok_hltL1GtMap_, gtObjectMapRecord);
315  if (gtObjectMapRecord.isValid()) {
316  const std::vector<L1GlobalTriggerObjectMap>& objMapVec = gtObjectMapRecord->gtObjectMap();
317  int ii(0);
318  bool ok(false), fill(true);
319  for (std::vector<L1GlobalTriggerObjectMap>::const_iterator itMap = objMapVec.begin(); itMap != objMapVec.end();
320  ++itMap, ++ii) {
321  bool resultGt = (*itMap).algoGtlResult();
322  if (resultGt == 1) {
323  ok = true;
324  int algoBit = (*itMap).algoBitNumber();
325  analyzeHcal(myRecalib, HithbheNS, HithbheMB, HithfNS, HithfMB, algoBit, fill);
326  fill = false;
327  std::string algoNameStr = (*itMap).algoName();
328  LogDebug("AnalyzerMB") << "Trigger[" << ii << "] " << algoNameStr << " bit " << algoBit << " entered";
329  }
330  }
331  if (!ok)
332  edm::LogInfo("AnalyzerMB") << "No passed L1 Triggers";
333  }
334  }
335 }

References analyzeHcal(), ntuplemaker::fill, dqmMemoryStats::float, edm::EventSetup::get(), get, L1GlobalTriggerObjectMapRecord::gtObjectMap(), iEvent, ignoreL1_, cuy::ii, edm::HandleBase::isValid(), LogDebug, convertSQLiteXML::ok, edm::Handle< T >::product(), edm::ESHandle< T >::product(), rnnum, runNZS_, edm::SortedCollection< T, SORT >::size(), AlCaHLTBitMon_QueryRunRegistry::string, theRecalib_, tok_hbheNormal_, tok_hbherecoMB_, tok_hbherecoNoise_, tok_hfrecoMB_, tok_hfrecoNoise_, and tok_hltL1GtMap_.

◆ analyzeHcal()

void AnalyzerMinbias::analyzeHcal ( const HcalRespCorrs myRecalib,
const HBHERecHitCollection HithbheNS,
const HBHERecHitCollection HithbheMB,
const HFRecHitCollection HithfNS,
const HFRecHitCollection HithfMB,
int  algoBit,
bool  fill 
)
private

Definition at line 337 of file AnalyzerMinbias.cc.

343  {
344  // Noise part for HB HE
345  std::map<std::pair<int, HcalDetId>, myInfo> tmpMap;
346  tmpMap.clear();
347 
348  for (HBHERecHitCollection::const_iterator hbheItr = HithbheNS.begin(); hbheItr != HithbheNS.end(); hbheItr++) {
349  // Recalibration of energy
350  float icalconst = 1.;
351  DetId mydetid = hbheItr->id().rawId();
352  if (theRecalib_)
353  icalconst = myRecalib->getValues(mydetid)->getValue();
354 
355  HBHERecHit aHit(hbheItr->id(), hbheItr->energy() * icalconst, hbheItr->time());
356  double energyhit = aHit.energy();
357 
358  DetId id = (*hbheItr).detid();
359  HcalDetId hid = HcalDetId(id);
360  std::map<std::pair<int, HcalDetId>, myInfo>::iterator itr1 = myMap_.find(std::pair<int, HcalDetId>(algoBit, hid));
361  if (itr1 == myMap_.end()) {
362  myInfo info;
363  myMap_[std::pair<int, HcalDetId>(algoBit, hid)] = info;
364  itr1 = myMap_.find(std::pair<int, HcalDetId>(algoBit, hid));
365  }
366  itr1->second.theNS0++;
367  itr1->second.theNS1 += energyhit;
368  itr1->second.theNS2 += (energyhit * energyhit);
369  itr1->second.theNS3 += (energyhit * energyhit * energyhit);
370  itr1->second.theNS4 += (energyhit * energyhit * energyhit * energyhit);
371  itr1->second.runcheck = rnnum;
372  if (fill)
373  h_Noise[hid.subdet() - 1]->Fill(energyhit);
374 
375  std::map<std::pair<int, HcalDetId>, myInfo>::iterator itr2 = tmpMap.find(std::pair<int, HcalDetId>(algoBit, hid));
376  if (itr2 == tmpMap.end()) {
377  myInfo info;
378  tmpMap[std::pair<int, HcalDetId>(algoBit, hid)] = info;
379  itr2 = tmpMap.find(std::pair<int, HcalDetId>(algoBit, hid));
380  }
381  itr2->second.theNS0++;
382  itr2->second.theNS1 += energyhit;
383  itr2->second.theNS2 += (energyhit * energyhit);
384  itr2->second.theNS3 += (energyhit * energyhit * energyhit);
385  itr2->second.theNS4 += (energyhit * energyhit * energyhit * energyhit);
386  itr2->second.runcheck = rnnum;
387 
388  } // HBHE_NS
389 
390  // Signal part for HB HE
391 
392  for (HBHERecHitCollection::const_iterator hbheItr = HithbheMB.begin(); hbheItr != HithbheMB.end(); hbheItr++) {
393  // Recalibration of energy
394  float icalconst = 1.;
395  DetId mydetid = hbheItr->id().rawId();
396  if (theRecalib_)
397  icalconst = myRecalib->getValues(mydetid)->getValue();
398 
399  HBHERecHit aHit(hbheItr->id(), hbheItr->energy() * icalconst, hbheItr->time());
400  double energyhit = aHit.energy();
401 
402  DetId id = (*hbheItr).detid();
403  HcalDetId hid = HcalDetId(id);
404 
405  std::map<std::pair<int, HcalDetId>, myInfo>::iterator itr1 = myMap_.find(std::pair<int, HcalDetId>(algoBit, hid));
406  std::map<std::pair<int, HcalDetId>, myInfo>::iterator itr2 = tmpMap.find(std::pair<int, HcalDetId>(algoBit, hid));
407 
408  if (itr1 == myMap_.end()) {
409  myInfo info;
410  myMap_[std::pair<int, HcalDetId>(algoBit, hid)] = info;
411  itr1 = myMap_.find(std::pair<int, HcalDetId>(algoBit, hid));
412  }
413  itr1->second.theMB0++;
414  itr1->second.theDif0 = 0;
415  itr1->second.theMB1 += energyhit;
416  itr1->second.theMB2 += (energyhit * energyhit);
417  itr1->second.theMB3 += (energyhit * energyhit * energyhit);
418  itr1->second.theMB4 += (energyhit * energyhit * energyhit * energyhit);
419  itr1->second.runcheck = rnnum;
420  float mydiff = 0.0;
421  if (itr2 != tmpMap.end()) {
422  mydiff = energyhit - (itr2->second.theNS1);
423  itr1->second.theDif0++;
424  itr1->second.theDif1 += mydiff;
425  itr1->second.theDif2 += (mydiff * mydiff);
426  if (fill)
427  h_Signal[hid.subdet() - 1]->Fill(mydiff);
428  }
429  } // HBHE_MB
430 
431  // HF
432 
433  for (HFRecHitCollection::const_iterator hbheItr = HithfNS.begin(); hbheItr != HithfNS.end(); hbheItr++) {
434  // Recalibration of energy
435  float icalconst = 1.;
436  DetId mydetid = hbheItr->id().rawId();
437  if (theRecalib_)
438  icalconst = myRecalib->getValues(mydetid)->getValue();
439 
440  HFRecHit aHit(hbheItr->id(), hbheItr->energy() * icalconst, hbheItr->time());
441  double energyhit = aHit.energy();
442  // Remove PMT hits
443  if (fabs(energyhit) > 40.)
444  continue;
445  DetId id = (*hbheItr).detid();
446  HcalDetId hid = HcalDetId(id);
447 
448  std::map<std::pair<int, HcalDetId>, myInfo>::iterator itr1 = myMap_.find(std::pair<int, HcalDetId>(algoBit, hid));
449 
450  if (itr1 == myMap_.end()) {
451  myInfo info;
452  myMap_[std::pair<int, HcalDetId>(algoBit, hid)] = info;
453  itr1 = myMap_.find(std::pair<int, HcalDetId>(algoBit, hid));
454  }
455  itr1->second.theNS0++;
456  itr1->second.theNS1 += energyhit;
457  itr1->second.theNS2 += (energyhit * energyhit);
458  itr1->second.theNS3 += (energyhit * energyhit * energyhit);
459  itr1->second.theNS4 += (energyhit * energyhit * energyhit * energyhit);
460  itr1->second.runcheck = rnnum;
461  if (fill)
462  h_Noise[hid.subdet() - 1]->Fill(energyhit);
463 
464  std::map<std::pair<int, HcalDetId>, myInfo>::iterator itr2 = tmpMap.find(std::pair<int, HcalDetId>(algoBit, hid));
465  if (itr2 == tmpMap.end()) {
466  myInfo info;
467  tmpMap[std::pair<int, HcalDetId>(algoBit, hid)] = info;
468  itr2 = tmpMap.find(std::pair<int, HcalDetId>(algoBit, hid));
469  }
470  itr2->second.theNS0++;
471  itr2->second.theNS1 += energyhit;
472  itr2->second.theNS2 += (energyhit * energyhit);
473  itr2->second.theNS3 += (energyhit * energyhit * energyhit);
474  itr2->second.theNS4 += (energyhit * energyhit * energyhit * energyhit);
475  itr2->second.runcheck = rnnum;
476 
477  } // HF_NS
478 
479  // Signal part for HF
480 
481  for (HFRecHitCollection::const_iterator hbheItr = HithfMB.begin(); hbheItr != HithfMB.end(); hbheItr++) {
482  // Recalibration of energy
483  float icalconst = 1.;
484  DetId mydetid = hbheItr->id().rawId();
485  if (theRecalib_)
486  icalconst = myRecalib->getValues(mydetid)->getValue();
487  HFRecHit aHit(hbheItr->id(), hbheItr->energy() * icalconst, hbheItr->time());
488 
489  double energyhit = aHit.energy();
490  // Remove PMT hits
491  if (fabs(energyhit) > 40.)
492  continue;
493 
494  DetId id = (*hbheItr).detid();
495  HcalDetId hid = HcalDetId(id);
496 
497  std::map<std::pair<int, HcalDetId>, myInfo>::iterator itr1 = myMap_.find(std::pair<int, HcalDetId>(algoBit, hid));
498  std::map<std::pair<int, HcalDetId>, myInfo>::iterator itr2 = tmpMap.find(std::pair<int, HcalDetId>(algoBit, hid));
499 
500  if (itr1 == myMap_.end()) {
501  myInfo info;
502  myMap_[std::pair<int, HcalDetId>(algoBit, hid)] = info;
503  itr1 = myMap_.find(std::pair<int, HcalDetId>(algoBit, hid));
504  }
505  itr1->second.theMB0++;
506  itr1->second.theDif0 = 0;
507  itr1->second.theMB1 += energyhit;
508  itr1->second.theMB2 += (energyhit * energyhit);
509  itr1->second.theMB3 += (energyhit * energyhit * energyhit);
510  itr1->second.theMB4 += (energyhit * energyhit * energyhit * energyhit);
511  itr1->second.runcheck = rnnum;
512  float mydiff = 0.0;
513  if (itr2 != tmpMap.end()) {
514  mydiff = energyhit - (itr2->second.theNS1);
515  itr1->second.theDif0++;
516  itr1->second.theDif1 += mydiff;
517  itr1->second.theDif2 += (mydiff * mydiff);
518  if (fill)
519  h_Signal[hid.subdet() - 1]->Fill(mydiff);
520  }
521  }
522 }

References edm::SortedCollection< T, SORT >::begin(), edm::SortedCollection< T, SORT >::end(), CaloRecHit::energy(), ntuplemaker::fill, HcalRespCorr::getValue(), HcalCondObjectContainer< Item >::getValues(), h_Noise, h_Signal, info(), myMap_, DetId::rawId(), rnnum, HcalDetId::subdet(), and theRecalib_.

Referenced by analyze().

◆ beginJob()

void AnalyzerMinbias::beginJob ( void  )
overridevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 142 of file AnalyzerMinbias.cc.

142  {
143  std::string det[4] = {"HB", "HE", "HO", "HF"};
144  char name[80], title[80];
145  for (int subd = 0; subd < 4; ++subd) {
146  sprintf(name, "Noise_%s", det[subd].c_str());
147  sprintf(title, "Energy Distribution for Noise in %s", det[subd].c_str());
148  h_Noise[subd] = new TH1D(name, title, 100, -10., 10.);
149  sprintf(name, "Signal_%s", det[subd].c_str());
150  sprintf(title, "Energy Distribution for Signal in %s", det[subd].c_str());
151  h_Signal[subd] = new TH1D(name, title, 100, -10., 10.);
152  }
153 
154  hOutputFile = new TFile(fOutputFileName.c_str(), "RECREATE");
155  myTree = new TTree("RecJet", "RecJet Tree");
156  myTree->Branch("mydet", &mydet, "mydet/I");
157  myTree->Branch("mysubd", &mysubd, "mysubd/I");
158  myTree->Branch("cells", &cells, "cells");
159  myTree->Branch("depth", &depth, "depth/I");
160  myTree->Branch("ieta", &ieta, "ieta/I");
161  myTree->Branch("iphi", &iphi, "iphi/I");
162  myTree->Branch("eta", &eta, "eta/F");
163  myTree->Branch("phi", &phi, "phi/F");
164  myTree->Branch("mom0_MB", &mom0_MB, "mom0_MB/F");
165  myTree->Branch("mom1_MB", &mom1_MB, "mom1_MB/F");
166  myTree->Branch("mom2_MB", &mom2_MB, "mom2_MB/F");
167  myTree->Branch("mom3_MB", &mom3_MB, "mom3_MB/F");
168  myTree->Branch("mom4_MB", &mom4_MB, "mom4_MB/F");
169  myTree->Branch("mom0_Noise", &mom0_Noise, "mom0_Noise/F");
170  myTree->Branch("mom1_Noise", &mom1_Noise, "mom1_Noise/F");
171  myTree->Branch("mom2_Noise", &mom2_Noise, "mom2_Noise/F");
172  myTree->Branch("mom3_Noise", &mom3_Noise, "mom3_Noise/F");
173  myTree->Branch("mom4_Noise", &mom4_Noise, "mom4_Noise/F");
174  myTree->Branch("mom0_Diff", &mom0_Diff, "mom0_Diff/F");
175  myTree->Branch("mom1_Diff", &mom1_Diff, "mom1_Diff/F");
176  myTree->Branch("mom2_Diff", &mom2_Diff, "mom2_Diff/F");
177  myTree->Branch("occup", &occup, "occup/F");
178  myTree->Branch("trigbit", &trigbit, "trigbit/I");
179  myTree->Branch("rnnumber", &rnnumber, "rnnumber/D");
180 
181  myMap_.clear();
182 }

References cells, depth, eta, fOutputFileName, h_Noise, h_Signal, hOutputFile, ieta, iphi, mom0_Diff, mom0_MB, mom0_Noise, mom1_Diff, mom1_MB, mom1_Noise, mom2_Diff, mom2_MB, mom2_Noise, mom3_MB, mom3_Noise, mom4_MB, mom4_Noise, mydet, myMap_, mysubd, myTree, Skims_PA_cff::name, occup, phi, rnnumber, AlCaHLTBitMon_QueryRunRegistry::string, overlapproblemtsosanalyzer_cfi::title, and trigbit.

◆ endJob()

void AnalyzerMinbias::endJob ( void  )
overridevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 186 of file AnalyzerMinbias.cc.

186  {
187  int ii = 0;
188  for (std::map<std::pair<int, HcalDetId>, myInfo>::const_iterator itr = myMap_.begin(); itr != myMap_.end(); ++itr) {
189  LogDebug("AnalyzerMB") << "Fired trigger bit number " << itr->first.first;
190  myInfo info = itr->second;
191  if (info.theMB0 > 0) {
192  mom0_MB = info.theMB0;
193  mom1_MB = info.theMB1;
194  mom2_MB = info.theMB2;
195  mom3_MB = info.theMB3;
196  mom4_MB = info.theMB4;
197  mom0_Noise = info.theNS0;
198  mom1_Noise = info.theNS1;
199  mom2_Noise = info.theNS2;
200  mom3_Noise = info.theNS3;
201  mom4_Noise = info.theNS4;
202  mom0_Diff = info.theDif0;
203  mom1_Diff = info.theDif1;
204  mom2_Diff = info.theDif2;
205  rnnumber = info.runcheck;
206  trigbit = itr->first.first;
207  mysubd = itr->first.second.subdet();
208  depth = itr->first.second.depth();
209  ieta = itr->first.second.ieta();
210  iphi = itr->first.second.iphi();
211 
212  LogDebug("AnalyzerMB") << " Result= " << trigbit << " " << mysubd << " " << ieta << " " << iphi << " mom0 "
213  << mom0_MB << " mom1 " << mom1_MB << " mom2 " << mom2_MB << " mom3 " << mom3_MB << " mom4 "
214  << mom4_MB << " mom0_Noise " << mom0_Noise << " mom1_Noise " << mom1_Noise
215  << " mom2_Noise " << mom2_Noise << " mom3_Noise " << mom3_Noise << " mom4_Noise "
216  << mom4_Noise << " mom0_Diff " << mom0_Diff << " mom1_Diff " << mom1_Diff << " mom2_Diff "
217  << mom2_Diff;
218  myTree->Fill();
219  ii++;
220  }
221  }
222  cells = ii;
223  LogDebug("AnalyzerMB") << "cells"
224  << " " << cells;
225  hOutputFile->Write();
226  hOutputFile->cd();
227  myTree->Write();
228  for (int i = 0; i < 4; i++) {
229  h_Noise[i]->Write();
230  h_Signal[i]->Write();
231  }
232  hOutputFile->Close();
233 }

References cells, depth, h_Noise, h_Signal, hOutputFile, mps_fire::i, ieta, cuy::ii, info(), iphi, LogDebug, genParticles_cff::map, mom0_Diff, mom0_MB, mom0_Noise, mom1_Diff, mom1_MB, mom1_Noise, mom2_Diff, mom2_MB, mom2_Noise, mom3_MB, mom3_Noise, mom4_MB, mom4_Noise, myMap_, mysubd, myTree, rnnumber, and trigbit.

Referenced by o2olib.O2ORunMgr::executeJob().

Member Data Documentation

◆ cells

int AnalyzerMinbias::cells
private

Definition at line 105 of file AnalyzerMinbias.cc.

Referenced by beginJob(), and endJob().

◆ depth

int AnalyzerMinbias::depth
private

◆ eta

float AnalyzerMinbias::eta
private

◆ fOutputFileName

std::string AnalyzerMinbias::fOutputFileName
private

Definition at line 95 of file AnalyzerMinbias.cc.

Referenced by AnalyzerMinbias(), and beginJob().

◆ h_Noise

TH1D* AnalyzerMinbias::h_Noise[4]
private

Definition at line 99 of file AnalyzerMinbias.cc.

Referenced by analyzeHcal(), beginJob(), and endJob().

◆ h_Signal

TH1D * AnalyzerMinbias::h_Signal[4]
private

Definition at line 99 of file AnalyzerMinbias.cc.

Referenced by analyzeHcal(), beginJob(), and endJob().

◆ hcalfile_

std::string AnalyzerMinbias::hcalfile_
private

Definition at line 95 of file AnalyzerMinbias.cc.

◆ hOutputFile

TFile* AnalyzerMinbias::hOutputFile
private

Definition at line 97 of file AnalyzerMinbias.cc.

Referenced by beginJob(), and endJob().

◆ ieta

int AnalyzerMinbias::ieta
private

Definition at line 105 of file AnalyzerMinbias.cc.

Referenced by beginJob(), and endJob().

◆ ignoreL1_

bool AnalyzerMinbias::ignoreL1_
private

Definition at line 100 of file AnalyzerMinbias.cc.

Referenced by analyze(), and AnalyzerMinbias().

◆ iphi

int AnalyzerMinbias::iphi
private

Definition at line 105 of file AnalyzerMinbias.cc.

Referenced by beginJob(), and endJob().

◆ mom0_Diff

float AnalyzerMinbias::mom0_Diff
private

Definition at line 109 of file AnalyzerMinbias.cc.

Referenced by beginJob(), and endJob().

◆ mom0_MB

float AnalyzerMinbias::mom0_MB
private

Definition at line 107 of file AnalyzerMinbias.cc.

Referenced by beginJob(), and endJob().

◆ mom0_Noise

float AnalyzerMinbias::mom0_Noise
private

Definition at line 108 of file AnalyzerMinbias.cc.

Referenced by beginJob(), and endJob().

◆ mom1_Diff

float AnalyzerMinbias::mom1_Diff
private

Definition at line 109 of file AnalyzerMinbias.cc.

Referenced by beginJob(), and endJob().

◆ mom1_MB

float AnalyzerMinbias::mom1_MB
private

Definition at line 107 of file AnalyzerMinbias.cc.

Referenced by beginJob(), and endJob().

◆ mom1_Noise

float AnalyzerMinbias::mom1_Noise
private

Definition at line 108 of file AnalyzerMinbias.cc.

Referenced by beginJob(), and endJob().

◆ mom2_Diff

float AnalyzerMinbias::mom2_Diff
private

Definition at line 109 of file AnalyzerMinbias.cc.

Referenced by beginJob(), and endJob().

◆ mom2_MB

float AnalyzerMinbias::mom2_MB
private

Definition at line 107 of file AnalyzerMinbias.cc.

Referenced by beginJob(), and endJob().

◆ mom2_Noise

float AnalyzerMinbias::mom2_Noise
private

Definition at line 108 of file AnalyzerMinbias.cc.

Referenced by beginJob(), and endJob().

◆ mom3_Diff

float AnalyzerMinbias::mom3_Diff
private

Definition at line 109 of file AnalyzerMinbias.cc.

◆ mom3_MB

float AnalyzerMinbias::mom3_MB
private

Definition at line 107 of file AnalyzerMinbias.cc.

Referenced by beginJob(), and endJob().

◆ mom3_Noise

float AnalyzerMinbias::mom3_Noise
private

Definition at line 108 of file AnalyzerMinbias.cc.

Referenced by beginJob(), and endJob().

◆ mom4_Diff

float AnalyzerMinbias::mom4_Diff
private

Definition at line 109 of file AnalyzerMinbias.cc.

◆ mom4_MB

float AnalyzerMinbias::mom4_MB
private

Definition at line 107 of file AnalyzerMinbias.cc.

Referenced by beginJob(), and endJob().

◆ mom4_Noise

float AnalyzerMinbias::mom4_Noise
private

Definition at line 108 of file AnalyzerMinbias.cc.

Referenced by beginJob(), and endJob().

◆ mydet

int AnalyzerMinbias::mydet
private

Definition at line 105 of file AnalyzerMinbias.cc.

Referenced by beginJob().

◆ myMap_

std::map<std::pair<int, HcalDetId>, myInfo> AnalyzerMinbias::myMap_
private

Definition at line 111 of file AnalyzerMinbias.cc.

Referenced by analyzeHcal(), beginJob(), and endJob().

◆ myout_hcal

std::ofstream* AnalyzerMinbias::myout_hcal
private

Definition at line 96 of file AnalyzerMinbias.cc.

◆ mysubd

int AnalyzerMinbias::mysubd
private

Definition at line 105 of file AnalyzerMinbias.cc.

Referenced by beginJob(), and endJob().

◆ myTree

TTree* AnalyzerMinbias::myTree
private

Definition at line 98 of file AnalyzerMinbias.cc.

Referenced by beginJob(), and endJob().

◆ occup

float AnalyzerMinbias::occup
private

Definition at line 107 of file AnalyzerMinbias.cc.

Referenced by beginJob().

◆ phi

float AnalyzerMinbias::phi
private

◆ rnnum

double AnalyzerMinbias::rnnum
private

Definition at line 101 of file AnalyzerMinbias.cc.

Referenced by analyze(), and analyzeHcal().

◆ rnnumber

double AnalyzerMinbias::rnnumber
private

Definition at line 104 of file AnalyzerMinbias.cc.

Referenced by beginJob(), and endJob().

◆ runNZS_

bool AnalyzerMinbias::runNZS_
private

Definition at line 100 of file AnalyzerMinbias.cc.

Referenced by analyze(), and AnalyzerMinbias().

◆ theRecalib_

bool AnalyzerMinbias::theRecalib_
private

Definition at line 100 of file AnalyzerMinbias.cc.

Referenced by analyze(), analyzeHcal(), and AnalyzerMinbias().

◆ tok_hbheNormal_

edm::EDGetTokenT<HBHERecHitCollection> AnalyzerMinbias::tok_hbheNormal_
private

Definition at line 115 of file AnalyzerMinbias.cc.

Referenced by analyze(), and AnalyzerMinbias().

◆ tok_hbherecoMB_

edm::EDGetTokenT<HBHERecHitCollection> AnalyzerMinbias::tok_hbherecoMB_
private

Definition at line 112 of file AnalyzerMinbias.cc.

Referenced by analyze(), and AnalyzerMinbias().

◆ tok_hbherecoNoise_

edm::EDGetTokenT<HBHERecHitCollection> AnalyzerMinbias::tok_hbherecoNoise_
private

Definition at line 112 of file AnalyzerMinbias.cc.

Referenced by analyze(), and AnalyzerMinbias().

◆ tok_hfrecoMB_

edm::EDGetTokenT<HFRecHitCollection> AnalyzerMinbias::tok_hfrecoMB_
private

Definition at line 113 of file AnalyzerMinbias.cc.

Referenced by analyze(), and AnalyzerMinbias().

◆ tok_hfrecoNoise_

edm::EDGetTokenT<HFRecHitCollection> AnalyzerMinbias::tok_hfrecoNoise_
private

Definition at line 113 of file AnalyzerMinbias.cc.

Referenced by analyze(), and AnalyzerMinbias().

◆ tok_hltL1GtMap_

edm::EDGetTokenT<L1GlobalTriggerObjectMapRecord> AnalyzerMinbias::tok_hltL1GtMap_
private

Definition at line 116 of file AnalyzerMinbias.cc.

Referenced by analyze(), and AnalyzerMinbias().

◆ tok_horecoMB_

edm::EDGetTokenT<HORecHitCollection> AnalyzerMinbias::tok_horecoMB_
private

Definition at line 114 of file AnalyzerMinbias.cc.

Referenced by AnalyzerMinbias().

◆ tok_horecoNoise_

edm::EDGetTokenT<HORecHitCollection> AnalyzerMinbias::tok_horecoNoise_
private

Definition at line 114 of file AnalyzerMinbias.cc.

Referenced by AnalyzerMinbias().

◆ trigbit

int AnalyzerMinbias::trigbit
private

Definition at line 105 of file AnalyzerMinbias.cc.

Referenced by beginJob(), and endJob().

edm::ESHandle::product
T const * product() const
Definition: ESHandle.h:86
AnalyzerMinbias::mom2_Noise
float mom2_Noise
Definition: AnalyzerMinbias.cc:108
HcalRespCorrs
Definition: HcalRespCorrs.h:17
mps_fire.i
i
Definition: mps_fire.py:355
AnalyzerMinbias::mom4_Noise
float mom4_Noise
Definition: AnalyzerMinbias.cc:108
AnalyzerMinbias::eta
float eta
Definition: AnalyzerMinbias.cc:106
edm::SortedCollection::const_iterator
std::vector< T >::const_iterator const_iterator
Definition: SortedCollection.h:80
dqmMemoryStats.float
float
Definition: dqmMemoryStats.py:127
CaloRecHit::energy
constexpr float energy() const
Definition: CaloRecHit.h:29
edm::Handle::product
T const * product() const
Definition: Handle.h:70
AnalyzerMinbias::mom0_Noise
float mom0_Noise
Definition: AnalyzerMinbias.cc:108
HBHERecHit
Definition: HBHERecHit.h:13
AnalyzerMinbias::tok_hbherecoMB_
edm::EDGetTokenT< HBHERecHitCollection > tok_hbherecoMB_
Definition: AnalyzerMinbias.cc:112
AnalyzerMinbias::tok_hbheNormal_
edm::EDGetTokenT< HBHERecHitCollection > tok_hbheNormal_
Definition: AnalyzerMinbias.cc:115
edm::LogInfo
Definition: MessageLogger.h:254
AnalyzerMinbias::theRecalib_
bool theRecalib_
Definition: AnalyzerMinbias.cc:100
edm::SortedCollection
Definition: SortedCollection.h:49
edm::SortedCollection::size
size_type size() const
Definition: SortedCollection.h:215
info
static const TGPicture * info(bool iBackgroundIsBlack)
Definition: FWCollectionSummaryWidget.cc:152
AnalyzerMinbias::analyzeHcal
void analyzeHcal(const HcalRespCorrs *myRecalib, const HBHERecHitCollection &HithbheNS, const HBHERecHitCollection &HithbheMB, const HFRecHitCollection &HithfNS, const HFRecHitCollection &HithfMB, int algoBit, bool fill)
Definition: AnalyzerMinbias.cc:337
edm::ParameterSet::getUntrackedParameter
T getUntrackedParameter(std::string const &, T const &) const
convertSQLiteXML.ok
bool ok
Definition: convertSQLiteXML.py:98
edm::Handle
Definition: AssociativeIterator.h:50
AnalyzerMinbias::tok_hbherecoNoise_
edm::EDGetTokenT< HBHERecHitCollection > tok_hbherecoNoise_
Definition: AnalyzerMinbias.cc:112
HcalCondObjectContainer::getValues
const Item * getValues(DetId fId, bool throwOnFail=true) const
Definition: HcalCondObjectContainer.h:159
AnalyzerMinbias::tok_hfrecoMB_
edm::EDGetTokenT< HFRecHitCollection > tok_hfrecoMB_
Definition: AnalyzerMinbias.cc:113
AnalyzerMinbias::mom3_MB
float mom3_MB
Definition: AnalyzerMinbias.cc:107
AnalyzerMinbias::trigbit
int trigbit
Definition: AnalyzerMinbias.cc:105
DetId
Definition: DetId.h:17
AnalyzerMinbias::rnnum
double rnnum
Definition: AnalyzerMinbias.cc:101
HFRecHit
Definition: HFRecHit.h:11
edm::EventSetup::get
T get() const
Definition: EventSetup.h:73
edm::SortedCollection::begin
const_iterator begin() const
Definition: SortedCollection.h:262
AnalyzerMinbias::tok_horecoNoise_
edm::EDGetTokenT< HORecHitCollection > tok_horecoNoise_
Definition: AnalyzerMinbias.cc:114
edm::ESHandle
Definition: DTSurvey.h:22
AnalyzerMinbias::h_Noise
TH1D * h_Noise[4]
Definition: AnalyzerMinbias.cc:99
AnalyzerMinbias::h_Signal
TH1D * h_Signal[4]
Definition: AnalyzerMinbias.cc:99
AnalyzerMinbias::ieta
int ieta
Definition: AnalyzerMinbias.cc:105
AnalyzerMinbias::mom0_Diff
float mom0_Diff
Definition: AnalyzerMinbias.cc:109
AnalyzerMinbias::mydet
int mydet
Definition: AnalyzerMinbias.cc:105
AnalyzerMinbias::tok_horecoMB_
edm::EDGetTokenT< HORecHitCollection > tok_horecoMB_
Definition: AnalyzerMinbias.cc:114
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
edm::LogWarning
Definition: MessageLogger.h:141
ntuplemaker.fill
fill
Definition: ntuplemaker.py:304
AnalyzerMinbias::occup
float occup
Definition: AnalyzerMinbias.cc:107
HcalRespCorr::getValue
float getValue() const
Definition: HcalRespCorr.h:19
AnalyzerMinbias::mysubd
int mysubd
Definition: AnalyzerMinbias.cc:105
LogDebug
#define LogDebug(id)
Definition: MessageLogger.h:670
AnalyzerMinbias::runNZS_
bool runNZS_
Definition: AnalyzerMinbias.cc:100
AnalyzerMinbias::hOutputFile
TFile * hOutputFile
Definition: AnalyzerMinbias.cc:97
AnalyzerMinbias::iphi
int iphi
Definition: AnalyzerMinbias.cc:105
AnalyzerMinbias::myMap_
std::map< std::pair< int, HcalDetId >, myInfo > myMap_
Definition: AnalyzerMinbias.cc:111
edm::SortedCollection::end
const_iterator end() const
Definition: SortedCollection.h:267
AnalyzerMinbias::mom2_MB
float mom2_MB
Definition: AnalyzerMinbias.cc:107
HcalDetId::subdet
constexpr HcalSubdetector subdet() const
get the subdetector
Definition: HcalDetId.h:138
AnalyzerMinbias::tok_hltL1GtMap_
edm::EDGetTokenT< L1GlobalTriggerObjectMapRecord > tok_hltL1GtMap_
Definition: AnalyzerMinbias.cc:116
HcalDetId
Definition: HcalDetId.h:12
iEvent
int iEvent
Definition: GenABIO.cc:224
AnalyzerMinbias::phi
float phi
Definition: AnalyzerMinbias.cc:106
HcalRespCorrsRcd
Definition: HcalRespCorrsRcd.h:27
AnalyzerMinbias::fOutputFileName
std::string fOutputFileName
Definition: AnalyzerMinbias.cc:95
AnalyzerMinbias::mom1_Diff
float mom1_Diff
Definition: AnalyzerMinbias.cc:109
itr
std::vector< std::pair< float, float > >::iterator itr
Definition: HGCDigitizer.cc:28
get
#define get
AnalyzerMinbias::cells
int cells
Definition: AnalyzerMinbias.cc:105
overlapproblemtsosanalyzer_cfi.title
title
Definition: overlapproblemtsosanalyzer_cfi.py:7
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
DetId::rawId
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:57
AnalyzerMinbias::mom1_MB
float mom1_MB
Definition: AnalyzerMinbias.cc:107
AnalyzerMinbias::mom2_Diff
float mom2_Diff
Definition: AnalyzerMinbias.cc:109
AnalyzerMinbias::myTree
TTree * myTree
Definition: AnalyzerMinbias.cc:98
AnalyzerMinbias::mom1_Noise
float mom1_Noise
Definition: AnalyzerMinbias.cc:108
Skims_PA_cff.name
name
Definition: Skims_PA_cff.py:17
L1GlobalTriggerObjectMapRecord::gtObjectMap
const std::vector< L1GlobalTriggerObjectMap > & gtObjectMap() const
get / set the vector of object maps
Definition: L1GlobalTriggerObjectMapRecord.h:64
AnalyzerMinbias::depth
int depth
Definition: AnalyzerMinbias.cc:105
AnalyzerMinbias::rnnumber
double rnnumber
Definition: AnalyzerMinbias.cc:104
AnalyzerMinbias::mom3_Noise
float mom3_Noise
Definition: AnalyzerMinbias.cc:108
genParticles_cff.map
map
Definition: genParticles_cff.py:11
AnalyzerMinbias::mom4_MB
float mom4_MB
Definition: AnalyzerMinbias.cc:107
AnalyzerMinbias::ignoreL1_
bool ignoreL1_
Definition: AnalyzerMinbias.cc:100
edm::HandleBase::isValid
bool isValid() const
Definition: HandleBase.h:70
AnalyzerMinbias::mom0_MB
float mom0_MB
Definition: AnalyzerMinbias.cc:107
cuy.ii
ii
Definition: cuy.py:590
edm::InputTag
Definition: InputTag.h:15
AnalyzerMinbias::tok_hfrecoNoise_
edm::EDGetTokenT< HFRecHitCollection > tok_hfrecoNoise_
Definition: AnalyzerMinbias.cc:113