CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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

virtual void analyze (const edm::Event &, const edm::EventSetup &) override
 
 AnalyzerMinbias (const edm::ParameterSet &)
 
virtual void beginJob ()
 
virtual void endJob ()
 
 ~AnalyzerMinbias ()
 
- Public Member Functions inherited from edm::EDAnalyzer
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzer ()
 
ModuleDescription const & moduleDescription () const
 
std::string workerType () const
 
virtual ~EDAnalyzer ()
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
 EDConsumerBase ()
 
ProductHolderIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
std::vector
< ProductHolderIndexAndSkipBit >
const & 
itemsToGetFromEvent () const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesDependentUpon (std::string const &iProcessName, std::string const &iModuleLabel, bool iPrint, std::vector< char const * > &oModuleLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
bool registeredToConsume (ProductHolderIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

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 >, myInfo
myMap_
 
std::ofstream * myout_hcal
 
int mysubd
 
TTree * myTree
 
float occup
 
float phi
 
double rnnum
 
double rnnumber
 
bool runNZS_
 
bool theRecalib_
 
edm::EDGetTokenT
< HBHERecHitCollection
tok_hbheNormal_
 
edm::EDGetTokenT
< HBHERecHitCollection
tok_hbherecoMB_
 
edm::EDGetTokenT
< HBHERecHitCollection
tok_hbherecoNoise_
 
edm::EDGetTokenT
< HFRecHitCollection
tok_hfrecoMB_
 
edm::EDGetTokenT
< HFRecHitCollection
tok_hfrecoNoise_
 
edm::EDGetTokenT
< L1GlobalTriggerObjectMapRecord
tok_hltL1GtMap_
 
edm::EDGetTokenT
< HORecHitCollection
tok_horecoMB_
 
edm::EDGetTokenT
< HORecHitCollection
tok_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 &)
 
- 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 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 66 of file AnalyzerMinbias.cc.

Constructor & Destructor Documentation

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

Definition at line 120 of file AnalyzerMinbias.cc.

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

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

Definition at line 143 of file AnalyzerMinbias.cc.

143 { }

Member Function Documentation

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

Implements edm::EDAnalyzer.

Definition at line 250 of file AnalyzerMinbias.cc.

References analyzeHcal(), lumiContext::fill, edm::EventSetup::get(), edm::Event::getByToken(), ignoreL1_, cuy::ii, edm::HandleBase::isValid(), LogDebug, convertSQLiteXML::ok, edm::Handle< T >::product(), edm::ESHandle< class >::product(), reco::return(), rnnum, edm::Event::run(), runNZS_, edm::SortedCollection< T, SORT >::size(), AlCaHLTBitMon_QueryRunRegistry::string, theRecalib_, tok_hbheNormal_, tok_hbherecoMB_, tok_hbherecoNoise_, tok_hfrecoMB_, tok_hfrecoNoise_, and tok_hltL1GtMap_.

250  {
251 
252  rnnum = (float)iEvent.run();
253  const HcalRespCorrs* myRecalib=0;
254  if (theRecalib_) {
255  edm::ESHandle <HcalRespCorrs> recalibCorrs;
256  iSetup.get<HcalRespCorrsRcd>().get("recalibrate",recalibCorrs);
257  myRecalib = recalibCorrs.product();
258  } // theRecalib
259 
261  iEvent.getByToken(tok_hbheNormal_, hbheNormal);
262  if (!hbheNormal.isValid()) {
263  edm::LogInfo("AnalyzerMB") << " hbheNormal failed";
264  } else {
265  edm::LogInfo("AnalyzerMB") << " The size of the normal collection "
266  << hbheNormal->size();
267  }
268 
270  iEvent.getByToken(tok_hbherecoNoise_, hbheNS);
271  if (!hbheNS.isValid()) {
272  edm::LogWarning("AnalyzerMB") << "HcalCalibAlgos: Error! can't get hbheNoise product!";
273  return ;
274  }
275  const HBHERecHitCollection HithbheNS = *(hbheNS.product());
276  edm::LogInfo("AnalyzerMB") << "HBHE NS size of collection " << HithbheNS.size();
277  if (runNZS_ && HithbheNS.size() != 5184) {
278  edm::LogWarning("AnalyzerMB") << "HBHE NS problem " << rnnum << " size "
279  << HithbheNS.size();
280  return;
281  }
282 
284  iEvent.getByToken(tok_hbherecoMB_, hbheMB);
285  if (!hbheMB.isValid()) {
286  edm::LogWarning("AnalyzerMB") << "HcalCalibAlgos: Error! can't get hbhe product!";
287  return ;
288  }
289  const HBHERecHitCollection HithbheMB = *(hbheMB.product());
290  edm::LogInfo("AnalyzerMB") << "HBHE MB size of collection " << HithbheMB.size();
291  if (runNZS_ && HithbheMB.size() != 5184) {
292  edm::LogWarning("AnalyzerMB") << "HBHE problem " << rnnum << " size "
293  << HithbheMB.size();
294  return;
295  }
296 
298  iEvent.getByToken(tok_hfrecoNoise_, hfNS);
299  if (!hfNS.isValid()) {
300  edm::LogWarning("AnalyzerMB") << "HcalCalibAlgos: Error! can't get hfNoise product!";
301  return ;
302  }
303  const HFRecHitCollection HithfNS = *(hfNS.product());
304  edm::LogInfo("AnalyzerMB") << "HF NS size of collection "<< HithfNS.size();
305  if (runNZS_ && HithfNS.size() != 1728) {
306  edm::LogWarning("AnalyzerMB") << "HF NS problem " << rnnum << " size "
307  << HithfNS.size();
308  return;
309  }
310 
312  iEvent.getByToken(tok_hfrecoMB_, hfMB);
313  if (!hfMB.isValid()) {
314  edm::LogWarning("AnalyzerMB") << "HcalCalibAlgos: Error! can't get hf product!";
315  return ;
316  }
317  const HFRecHitCollection HithfMB = *(hfMB.product());
318  edm::LogInfo("AnalyzerMB") << "HF MB size of collection " << HithfMB.size();
319  if(runNZS_ && HithfMB.size() != 1728) {
320  edm::LogWarning("AnalyzerMB") << "HF problem " << rnnum << " size "
321  << HithfMB.size();
322  return;
323  }
324 
325  if (ignoreL1_) {
326  analyzeHcal(myRecalib,HithbheNS,HithbheMB,HithfNS,HithfMB,1,true);
327  } else {
329  iEvent.getByToken(tok_hltL1GtMap_, gtObjectMapRecord);
330  if (gtObjectMapRecord.isValid()) {
331  const std::vector<L1GlobalTriggerObjectMap>& objMapVec = gtObjectMapRecord->gtObjectMap();
332  int ii(0);
333  bool ok(false), fill(true);
334  for (std::vector<L1GlobalTriggerObjectMap>::const_iterator itMap = objMapVec.begin();
335  itMap != objMapVec.end(); ++itMap, ++ii) {
336  bool resultGt = (*itMap).algoGtlResult();
337  if (resultGt == 1) {
338  ok = true;
339  int algoBit = (*itMap).algoBitNumber();
340  analyzeHcal(myRecalib,HithbheNS,HithbheMB,HithfNS,HithfMB,algoBit,fill);
341  fill = false;
342  std::string algoNameStr = (*itMap).algoName();
343  LogDebug("AnalyzerMB") << "Trigger[" << ii << "] " << algoNameStr
344  << " bit " << algoBit << " entered";
345  }
346  }
347  if (!ok) edm::LogInfo("AnalyzerMB") << "No passed L1 Triggers";
348  }
349  }
350 }
#define LogDebug(id)
edm::EDGetTokenT< HBHERecHitCollection > tok_hbheNormal_
string fill
Definition: lumiContext.py:319
edm::EDGetTokenT< HFRecHitCollection > tok_hfrecoNoise_
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:462
int ii
Definition: cuy.py:588
edm::EDGetTokenT< HBHERecHitCollection > tok_hbherecoMB_
edm::EDGetTokenT< L1GlobalTriggerObjectMapRecord > tok_hltL1GtMap_
RunNumber_t run() const
Definition: Event.h:93
bool isValid() const
Definition: HandleBase.h:75
edm::EDGetTokenT< HFRecHitCollection > tok_hfrecoMB_
T const * product() const
Definition: Handle.h:81
const T & get() const
Definition: EventSetup.h:56
T const * product() const
Definition: ESHandle.h:86
return(e1-e2)*(e1-e2)+dp *dp
size_type size() const
void analyzeHcal(const HcalRespCorrs *myRecalib, const HBHERecHitCollection &HithbheNS, const HBHERecHitCollection &HithbheMB, const HFRecHitCollection &HithfNS, const HFRecHitCollection &HithfMB, int algoBit, bool fill)
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 352 of file AnalyzerMinbias.cc.

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

Referenced by analyze().

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

Reimplemented from edm::EDAnalyzer.

Definition at line 145 of file AnalyzerMinbias.cc.

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, mom4_MB, mom4_Noise, mydet, myMap_, mysubd, myTree, mergeVDriftHistosByStation::name, occup, phi, rnnumber, AlCaHLTBitMon_QueryRunRegistry::string, indexGen::title, and trigbit.

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

Reimplemented from edm::EDAnalyzer.

Definition at line 190 of file AnalyzerMinbias.cc.

References cells, depth, h_Noise, h_Signal, hOutputFile, i, ieta, cuy::ii, info(), iphi, LogDebug, 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, 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, AnalyzerMinbias::myInfo::theNS4, and trigbit.

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

Member Data Documentation

int AnalyzerMinbias::cells
private

Definition at line 106 of file AnalyzerMinbias.cc.

Referenced by beginJob(), and endJob().

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

Definition at line 96 of file AnalyzerMinbias.cc.

Referenced by AnalyzerMinbias(), and beginJob().

TH1D* AnalyzerMinbias::h_Noise[4]
private

Definition at line 100 of file AnalyzerMinbias.cc.

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

TH1D * AnalyzerMinbias::h_Signal[4]
private

Definition at line 100 of file AnalyzerMinbias.cc.

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

std::string AnalyzerMinbias::hcalfile_
private

Definition at line 96 of file AnalyzerMinbias.cc.

TFile* AnalyzerMinbias::hOutputFile
private

Definition at line 98 of file AnalyzerMinbias.cc.

Referenced by beginJob(), and endJob().

int AnalyzerMinbias::ieta
private

Definition at line 106 of file AnalyzerMinbias.cc.

Referenced by beginJob(), and endJob().

bool AnalyzerMinbias::ignoreL1_
private

Definition at line 101 of file AnalyzerMinbias.cc.

Referenced by analyze(), and AnalyzerMinbias().

int AnalyzerMinbias::iphi
private

Definition at line 106 of file AnalyzerMinbias.cc.

Referenced by beginJob(), and endJob().

float AnalyzerMinbias::mom0_Diff
private

Definition at line 110 of file AnalyzerMinbias.cc.

Referenced by beginJob(), and endJob().

float AnalyzerMinbias::mom0_MB
private

Definition at line 108 of file AnalyzerMinbias.cc.

Referenced by beginJob(), and endJob().

float AnalyzerMinbias::mom0_Noise
private

Definition at line 109 of file AnalyzerMinbias.cc.

Referenced by beginJob(), and endJob().

float AnalyzerMinbias::mom1_Diff
private

Definition at line 110 of file AnalyzerMinbias.cc.

Referenced by beginJob(), and endJob().

float AnalyzerMinbias::mom1_MB
private

Definition at line 108 of file AnalyzerMinbias.cc.

Referenced by beginJob(), and endJob().

float AnalyzerMinbias::mom1_Noise
private

Definition at line 109 of file AnalyzerMinbias.cc.

Referenced by beginJob(), and endJob().

float AnalyzerMinbias::mom2_Diff
private

Definition at line 110 of file AnalyzerMinbias.cc.

Referenced by beginJob(), and endJob().

float AnalyzerMinbias::mom2_MB
private

Definition at line 108 of file AnalyzerMinbias.cc.

Referenced by beginJob(), and endJob().

float AnalyzerMinbias::mom2_Noise
private

Definition at line 109 of file AnalyzerMinbias.cc.

Referenced by beginJob(), and endJob().

float AnalyzerMinbias::mom3_Diff
private

Definition at line 110 of file AnalyzerMinbias.cc.

float AnalyzerMinbias::mom3_MB
private

Definition at line 108 of file AnalyzerMinbias.cc.

Referenced by beginJob(), and endJob().

float AnalyzerMinbias::mom3_Noise
private

Definition at line 109 of file AnalyzerMinbias.cc.

Referenced by endJob().

float AnalyzerMinbias::mom4_Diff
private

Definition at line 110 of file AnalyzerMinbias.cc.

float AnalyzerMinbias::mom4_MB
private

Definition at line 108 of file AnalyzerMinbias.cc.

Referenced by beginJob(), and endJob().

float AnalyzerMinbias::mom4_Noise
private

Definition at line 109 of file AnalyzerMinbias.cc.

Referenced by beginJob(), and endJob().

int AnalyzerMinbias::mydet
private

Definition at line 106 of file AnalyzerMinbias.cc.

Referenced by beginJob().

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

Definition at line 112 of file AnalyzerMinbias.cc.

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

std::ofstream* AnalyzerMinbias::myout_hcal
private

Definition at line 97 of file AnalyzerMinbias.cc.

int AnalyzerMinbias::mysubd
private

Definition at line 106 of file AnalyzerMinbias.cc.

Referenced by beginJob(), and endJob().

TTree* AnalyzerMinbias::myTree
private

Definition at line 99 of file AnalyzerMinbias.cc.

Referenced by beginJob(), and endJob().

float AnalyzerMinbias::occup
private

Definition at line 108 of file AnalyzerMinbias.cc.

Referenced by beginJob().

float AnalyzerMinbias::phi
private

Definition at line 107 of file AnalyzerMinbias.cc.

Referenced by Particle.Particle::__str__(), and beginJob().

double AnalyzerMinbias::rnnum
private

Definition at line 102 of file AnalyzerMinbias.cc.

Referenced by analyze(), and analyzeHcal().

double AnalyzerMinbias::rnnumber
private

Definition at line 105 of file AnalyzerMinbias.cc.

Referenced by beginJob(), and endJob().

bool AnalyzerMinbias::runNZS_
private

Definition at line 101 of file AnalyzerMinbias.cc.

Referenced by analyze(), and AnalyzerMinbias().

bool AnalyzerMinbias::theRecalib_
private

Definition at line 101 of file AnalyzerMinbias.cc.

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

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

Definition at line 116 of file AnalyzerMinbias.cc.

Referenced by analyze(), and AnalyzerMinbias().

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

Definition at line 113 of file AnalyzerMinbias.cc.

Referenced by analyze(), and AnalyzerMinbias().

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

Definition at line 113 of file AnalyzerMinbias.cc.

Referenced by analyze(), and AnalyzerMinbias().

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

Definition at line 114 of file AnalyzerMinbias.cc.

Referenced by analyze(), and AnalyzerMinbias().

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

Definition at line 114 of file AnalyzerMinbias.cc.

Referenced by analyze(), and AnalyzerMinbias().

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

Definition at line 117 of file AnalyzerMinbias.cc.

Referenced by analyze(), and AnalyzerMinbias().

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

Definition at line 115 of file AnalyzerMinbias.cc.

Referenced by AnalyzerMinbias().

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

Definition at line 115 of file AnalyzerMinbias.cc.

Referenced by AnalyzerMinbias().

int AnalyzerMinbias::trigbit
private

Definition at line 106 of file AnalyzerMinbias.cc.

Referenced by beginJob(), and endJob().