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 const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
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
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
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
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
EDGetToken consumes (const TypeToGet &id, 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)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 

Detailed Description

Definition at line 65 of file AnalyzerMinbias.cc.

Constructor & Destructor Documentation

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

Definition at line 119 of file AnalyzerMinbias.cc.

References edm::ParameterSet::getParameter(), edm::ParameterSet::getUntrackedParameter(), and AlCaHLTBitMon_QueryRunRegistry::string.

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 }
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
edm::EDGetTokenT< HBHERecHitCollection > tok_hbheNormal_
edm::EDGetTokenT< HFRecHitCollection > tok_hfrecoNoise_
edm::EDGetTokenT< HORecHitCollection > tok_horecoNoise_
std::string fOutputFileName
edm::EDGetTokenT< HORecHitCollection > tok_horecoMB_
edm::EDGetTokenT< HBHERecHitCollection > tok_hbherecoMB_
edm::EDGetTokenT< L1GlobalTriggerObjectMapRecord > tok_hltL1GtMap_
edm::EDGetTokenT< HFRecHitCollection > tok_hfrecoMB_
edm::EDGetTokenT< HBHERecHitCollection > tok_hbherecoNoise_
AnalyzerMinbias::~AnalyzerMinbias ( )
override

Definition at line 140 of file AnalyzerMinbias.cc.

140 {}

Member Function Documentation

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

Definition at line 241 of file AnalyzerMinbias.cc.

References lumiContext::fill, objects.autophobj::float, edm::EventSetup::get(), edm::Event::getByToken(), L1GlobalTriggerObjectMapRecord::gtObjectMap(), cuy::ii, edm::HandleBase::isValid(), LogDebug, convertSQLiteXML::ok, edm::Handle< T >::product(), edm::ESHandle< T >::product(), edm::Event::run(), edm::SortedCollection< T, SORT >::size(), and AlCaHLTBitMon_QueryRunRegistry::string.

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 }
#define LogDebug(id)
edm::EDGetTokenT< HBHERecHitCollection > tok_hbheNormal_
edm::EDGetTokenT< HFRecHitCollection > tok_hfrecoNoise_
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:517
const std::vector< L1GlobalTriggerObjectMap > & gtObjectMap() const
get / set the vector of object maps
edm::EDGetTokenT< HBHERecHitCollection > tok_hbherecoMB_
edm::EDGetTokenT< L1GlobalTriggerObjectMapRecord > tok_hltL1GtMap_
RunNumber_t run() const
Definition: Event.h:101
bool isValid() const
Definition: HandleBase.h:74
edm::EDGetTokenT< HFRecHitCollection > tok_hfrecoMB_
ii
Definition: cuy.py:590
T const * product() const
Definition: Handle.h:74
size_type size() const
T get() const
Definition: EventSetup.h:71
void analyzeHcal(const HcalRespCorrs *myRecalib, const HBHERecHitCollection &HithbheNS, const HBHERecHitCollection &HithbheMB, const HFRecHitCollection &HithfNS, const HFRecHitCollection &HithfMB, int algoBit, bool fill)
T const * product() const
Definition: ESHandle.h:86
edm::EDGetTokenT< HBHERecHitCollection > tok_hbherecoNoise_
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.

References edm::SortedCollection< T, SORT >::begin(), DEFINE_FWK_MODULE, edm::SortedCollection< T, SORT >::end(), CaloRecHit::energy(), HcalRespCorr::getValue(), HcalCondObjectContainer< Item >::getValues(), info(), DetId::rawId(), HcalDetId::subdet(), AnalyzerMinbias::myInfo::theMB0, and AnalyzerMinbias::myInfo::theNS0.

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 }
constexpr float energy() const
Definition: CaloRecHit.h:31
static const TGPicture * info(bool iBackgroundIsBlack)
HcalSubdetector subdet() const
get the subdetector
Definition: HcalDetId.h:146
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:50
std::vector< T >::const_iterator const_iterator
const Item * getValues(DetId fId, bool throwOnFail=true) const
const_iterator end() const
Definition: DetId.h:18
float getValue() const
Definition: HcalRespCorr.h:20
std::map< std::pair< int, HcalDetId >, myInfo > myMap_
const_iterator begin() const
void AnalyzerMinbias::beginJob ( void  )
overridevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 142 of file AnalyzerMinbias.cc.

References postprocess-scan-build::cells, egammaForCoreTracking_cff::depth, PVValHelper::eta, dataset::name, AlCaHLTBitMon_QueryRunRegistry::string, and runGCPTkAlMap::title.

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 }
std::string fOutputFileName
std::map< std::pair< int, HcalDetId >, myInfo > myMap_
void AnalyzerMinbias::endJob ( void  )
overridevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 186 of file AnalyzerMinbias.cc.

References postprocess-scan-build::cells, egammaForCoreTracking_cff::depth, mps_fire::i, cuy::ii, info(), LogDebug, genParticles_cff::map, AnalyzerMinbias::myInfo::runcheck, AnalyzerMinbias::myInfo::theDif0, AnalyzerMinbias::myInfo::theDif1, AnalyzerMinbias::myInfo::theDif2, AnalyzerMinbias::myInfo::theMB0, AnalyzerMinbias::myInfo::theMB1, AnalyzerMinbias::myInfo::theMB2, AnalyzerMinbias::myInfo::theMB3, AnalyzerMinbias::myInfo::theMB4, AnalyzerMinbias::myInfo::theNS0, AnalyzerMinbias::myInfo::theNS1, AnalyzerMinbias::myInfo::theNS2, AnalyzerMinbias::myInfo::theNS3, and AnalyzerMinbias::myInfo::theNS4.

Referenced by o2olib.O2ORunMgr::executeJob().

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 }
#define LogDebug(id)
static const TGPicture * info(bool iBackgroundIsBlack)
ii
Definition: cuy.py:590
std::map< std::pair< int, HcalDetId >, myInfo > myMap_

Member Data Documentation

int AnalyzerMinbias::cells
private

Definition at line 105 of file AnalyzerMinbias.cc.

int AnalyzerMinbias::depth
private
float AnalyzerMinbias::eta
private
std::string AnalyzerMinbias::fOutputFileName
private

Definition at line 95 of file AnalyzerMinbias.cc.

TH1D* AnalyzerMinbias::h_Noise[4]
private

Definition at line 99 of file AnalyzerMinbias.cc.

TH1D * AnalyzerMinbias::h_Signal[4]
private

Definition at line 99 of file AnalyzerMinbias.cc.

std::string AnalyzerMinbias::hcalfile_
private

Definition at line 95 of file AnalyzerMinbias.cc.

TFile* AnalyzerMinbias::hOutputFile
private

Definition at line 97 of file AnalyzerMinbias.cc.

int AnalyzerMinbias::ieta
private

Definition at line 105 of file AnalyzerMinbias.cc.

bool AnalyzerMinbias::ignoreL1_
private

Definition at line 100 of file AnalyzerMinbias.cc.

int AnalyzerMinbias::iphi
private

Definition at line 105 of file AnalyzerMinbias.cc.

float AnalyzerMinbias::mom0_Diff
private

Definition at line 109 of file AnalyzerMinbias.cc.

float AnalyzerMinbias::mom0_MB
private

Definition at line 107 of file AnalyzerMinbias.cc.

float AnalyzerMinbias::mom0_Noise
private

Definition at line 108 of file AnalyzerMinbias.cc.

float AnalyzerMinbias::mom1_Diff
private

Definition at line 109 of file AnalyzerMinbias.cc.

float AnalyzerMinbias::mom1_MB
private

Definition at line 107 of file AnalyzerMinbias.cc.

float AnalyzerMinbias::mom1_Noise
private

Definition at line 108 of file AnalyzerMinbias.cc.

float AnalyzerMinbias::mom2_Diff
private

Definition at line 109 of file AnalyzerMinbias.cc.

float AnalyzerMinbias::mom2_MB
private

Definition at line 107 of file AnalyzerMinbias.cc.

float AnalyzerMinbias::mom2_Noise
private

Definition at line 108 of file AnalyzerMinbias.cc.

float AnalyzerMinbias::mom3_Diff
private

Definition at line 109 of file AnalyzerMinbias.cc.

float AnalyzerMinbias::mom3_MB
private

Definition at line 107 of file AnalyzerMinbias.cc.

float AnalyzerMinbias::mom3_Noise
private

Definition at line 108 of file AnalyzerMinbias.cc.

float AnalyzerMinbias::mom4_Diff
private

Definition at line 109 of file AnalyzerMinbias.cc.

float AnalyzerMinbias::mom4_MB
private

Definition at line 107 of file AnalyzerMinbias.cc.

float AnalyzerMinbias::mom4_Noise
private

Definition at line 108 of file AnalyzerMinbias.cc.

int AnalyzerMinbias::mydet
private

Definition at line 105 of file AnalyzerMinbias.cc.

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

Definition at line 111 of file AnalyzerMinbias.cc.

std::ofstream* AnalyzerMinbias::myout_hcal
private

Definition at line 96 of file AnalyzerMinbias.cc.

int AnalyzerMinbias::mysubd
private

Definition at line 105 of file AnalyzerMinbias.cc.

TTree* AnalyzerMinbias::myTree
private

Definition at line 98 of file AnalyzerMinbias.cc.

float AnalyzerMinbias::occup
private

Definition at line 107 of file AnalyzerMinbias.cc.

float AnalyzerMinbias::phi
private
double AnalyzerMinbias::rnnum
private

Definition at line 101 of file AnalyzerMinbias.cc.

double AnalyzerMinbias::rnnumber
private

Definition at line 104 of file AnalyzerMinbias.cc.

bool AnalyzerMinbias::runNZS_
private

Definition at line 100 of file AnalyzerMinbias.cc.

bool AnalyzerMinbias::theRecalib_
private

Definition at line 100 of file AnalyzerMinbias.cc.

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

Definition at line 115 of file AnalyzerMinbias.cc.

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

Definition at line 112 of file AnalyzerMinbias.cc.

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

Definition at line 112 of file AnalyzerMinbias.cc.

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

Definition at line 113 of file AnalyzerMinbias.cc.

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

Definition at line 113 of file AnalyzerMinbias.cc.

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

Definition at line 116 of file AnalyzerMinbias.cc.

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

Definition at line 114 of file AnalyzerMinbias.cc.

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

Definition at line 114 of file AnalyzerMinbias.cc.

int AnalyzerMinbias::trigbit
private

Definition at line 105 of file AnalyzerMinbias.cc.