CMS 3D CMS Logo

List of all members | Public Member Functions
ecaldqm::MESetProjection Class Reference

#include <MESetProjection.h>

Inheritance diagram for ecaldqm::MESetProjection:
ecaldqm::MESetEcal ecaldqm::MESet

Public Member Functions

MESetclone (std::string const &="") const override
 
void fill (DetId const &, double=1., double=0., double=0.) override
 
void fill (int, double=1., double=1., double=0.) override
 
void fill (double, double=1., double=0.) override
 
double getBinContent (DetId const &, int=0) const override
 
double getBinEntries (DetId const &, int=0) const override
 
double getBinError (DetId const &, int=0) const override
 
 MESetProjection (std::string const &, binning::ObjectType, binning::BinningType, MonitorElement::Kind, binning::AxisSpecs const *=0)
 
 MESetProjection (MESetProjection const &)
 
void setBinContent (DetId const &, double) override
 
void setBinEntries (DetId const &, double) override
 
void setBinError (DetId const &, double) override
 
 ~MESetProjection () override
 
- Public Member Functions inherited from ecaldqm::MESetEcal
void book (DQMStore::IBooker &) override
 
void fill (EcalElectronicsId const &, double=1., double=1., double=1.) override
 
virtual int findBin (DetId const &, double, double=0.) const
 
virtual int findBin (EcalElectronicsId const &, double, double=0.) const
 
virtual int findBin (int, double, double=0.) const
 
std::vector< std::string > generatePaths () const
 
double getBinContent (EcalElectronicsId const &, int) const override
 
double getBinContent (int, int) const override
 
double getBinEntries (EcalElectronicsId const &, int) const override
 
double getBinEntries (int, int) const override
 
double getBinError (EcalElectronicsId const &, int) const override
 
double getBinError (int, int) const override
 
bool isVariableBinning () const override
 
 MESetEcal (std::string const &, binning::ObjectType, binning::BinningType, MonitorElement::Kind, unsigned, binning::AxisSpecs const *=0, binning::AxisSpecs const *=0, binning::AxisSpecs const *=0)
 
 MESetEcal (MESetEcal const &)
 
MESetoperator= (MESet const &) override
 
bool retrieve (DQMStore::IGetter &, std::string *=0) const override
 
void setBinContent (DetId const &, int, double) override
 
void setBinContent (EcalElectronicsId const &, int, double) override
 
void setBinContent (int, int, double) override
 
void setBinEntries (DetId const &, int, double) override
 
void setBinEntries (EcalElectronicsId const &, int, double) override
 
void setBinEntries (int, int, double) override
 
void setBinError (DetId const &, int, double) override
 
void setBinError (EcalElectronicsId const &, int, double) override
 
void setBinError (int, int, double) override
 
 ~MESetEcal () override
 
- Public Member Functions inherited from ecaldqm::MESet
virtual const_iterator begin () const
 
virtual iterator begin ()
 
virtual const_iterator beginChannel () const
 
virtual iterator beginChannel ()
 
virtual void clear () const
 
virtual const_iterator end () const
 
virtual iterator end ()
 
std::string formPath (PathReplacements const &) const
 
bool getBatchMode () const
 
binning::BinningType getBinType () const
 
MonitorElement::Kind getKind () const
 
bool getLumiFlag () const
 
virtual MonitorElement const * getME (unsigned _iME) const
 
virtual MonitorElementgetME (unsigned _iME)
 
binning::ObjectType getObjType () const
 
virtual std::string const & getPath () const
 
bool isActive () const
 
virtual bool maskMatches (DetId const &, uint32_t, StatusManager const *) const
 
 MESet ()
 
 MESet (std::string const &, binning::ObjectType, binning::BinningType, MonitorElement::Kind)
 
 MESet (MESet const &)
 
virtual void recoverStats ()
 
virtual void reset (double=0., double=0., double=0.)
 
virtual void resetAll (double=0., double=0., double=0.)
 
virtual void setAxisTitle (std::string const &, int=1)
 
void setBatchMode ()
 
virtual void setBinContent (EcalElectronicsId const &, double)
 
virtual void setBinContent (int, double)
 
virtual void setBinEntries (EcalElectronicsId const &, double)
 
virtual void setBinEntries (int, double)
 
virtual void setBinError (EcalElectronicsId const &, double)
 
virtual void setBinError (int, double)
 
void setLumiFlag ()
 
virtual void softReset ()
 
virtual ~MESet ()
 

Additional Inherited Members

- Public Types inherited from ecaldqm::MESet
typedef std::map< std::string, std::string > PathReplacements
 
- Protected Member Functions inherited from ecaldqm::MESet
virtual void checkME_ (unsigned _iME) const
 
virtual void fill_ (unsigned, int, double)
 
virtual void fill_ (unsigned, int, double, double)
 
virtual void fill_ (unsigned, double, double, double)
 
void throw_ (std::string const &_message) const
 
- Protected Attributes inherited from ecaldqm::MESetEcal
unsigned logicalDimensions_
 
binning::AxisSpecs const * xaxis_
 
binning::AxisSpecs const * yaxis_
 
binning::AxisSpecs const * zaxis_
 
- Protected Attributes inherited from ecaldqm::MESet
bool active_
 
bool batchMode_
 
binning::BinningType btype_
 
MonitorElement::Kind kind_
 
bool lumiFlag_
 
std::vector< MonitorElement * > mes_
 
binning::ObjectType otype_
 
std::string path_
 

Detailed Description

Definition at line 13 of file MESetProjection.h.

Constructor & Destructor Documentation

ecaldqm::MESetProjection::MESetProjection ( std::string const &  _fullPath,
binning::ObjectType  _otype,
binning::BinningType  _btype,
MonitorElement::Kind  _kind,
binning::AxisSpecs const *  _yaxis = 0 
)

Definition at line 7 of file MESetProjection.cc.

References ecaldqm::MESet::btype_, MonitorElement::DQM_KIND_TH1F, MonitorElement::DQM_KIND_TPROFILE, ecaldqm::MESet::kind_, ecaldqm::binning::kProjEta, ecaldqm::binning::kProjPhi, and ecaldqm::MESet::throw_().

Referenced by clone().

7  :
8  MESetEcal(_fullPath, _otype, _btype, _kind, 1, nullptr, _yaxis)
9  {
10  switch(kind_){
13  break;
14  default:
15  throw_("Unsupported MonitorElement kind");
16  }
17 
18  switch(btype_){
19  case binning::kProjEta:
20  case binning::kProjPhi:
21  break;
22  default:
23  throw_("Unsupported binning");
24  }
25  }
MonitorElement::Kind kind_
Definition: MESet.h:134
void throw_(std::string const &_message) const
Definition: MESet.h:124
MESetEcal(std::string const &, binning::ObjectType, binning::BinningType, MonitorElement::Kind, unsigned, binning::AxisSpecs const *=0, binning::AxisSpecs const *=0, binning::AxisSpecs const *=0)
Definition: MESetEcal.cc:11
binning::BinningType btype_
Definition: MESet.h:133
ecaldqm::MESetProjection::MESetProjection ( MESetProjection const &  _orig)

Definition at line 27 of file MESetProjection.cc.

27  :
28  MESetEcal(_orig)
29  {
30  }
MESetEcal(std::string const &, binning::ObjectType, binning::BinningType, MonitorElement::Kind, unsigned, binning::AxisSpecs const *=0, binning::AxisSpecs const *=0, binning::AxisSpecs const *=0)
Definition: MESetEcal.cc:11
ecaldqm::MESetProjection::~MESetProjection ( )
override

Definition at line 32 of file MESetProjection.cc.

33  {
34  }

Member Function Documentation

MESet * ecaldqm::MESetProjection::clone ( std::string const &  _path = "") const
overridevirtual

Reimplemented from ecaldqm::MESetEcal.

Definition at line 37 of file MESetProjection.cc.

References popcon2dropbox::copy(), MESetProjection(), callgraph::path, ecaldqm::MESet::path_, and AlCaHLTBitMon_QueryRunRegistry::string.

38  {
40  if(_path != "") path_ = _path;
41  MESet* copy(new MESetProjection(*this));
42  path_ = path;
43  return copy;
44  }
def copy(args, dbName)
MESetProjection(std::string const &, binning::ObjectType, binning::BinningType, MonitorElement::Kind, binning::AxisSpecs const *=0)
std::string path_
Definition: MESet.h:131
void ecaldqm::MESetProjection::fill ( DetId const &  _id,
double  _w = 1.,
double  = 0.,
double  = 0. 
)
overridevirtual

Reimplemented from ecaldqm::MESetEcal.

Definition at line 47 of file MESetProjection.cc.

References ecaldqm::MESet::active_, ecaldqm::MESet::btype_, ecaldqm::MESet::checkME_(), EBDetId::crystalUnitToEta, EcalBarrel, EcalEndcap, EcalTriggerTower, ecaldqm::eta(), ecaldqm::MESet::fill_(), ecaldqm::binning::findPlotIndex(), ecaldqm::getTrigTowerMap(), photons_cff::ids, EcalTrigTowerDetId::ieta(), ecaldqm::isEndcapTTId(), ecaldqm::binning::kProjEta, ecaldqm::binning::kProjPhi, ecaldqm::MESet::otype_, ecaldqm::phi(), and DetId::subdetId().

48  {
49  if(!active_) return;
50 
51  unsigned iME(binning::findPlotIndex(otype_, _id));
52  checkME_(iME);
53 
54  int subdet(_id.subdetId());
55 
56  if(subdet == EcalBarrel){
57  EBDetId ebid(_id);
59  fill_(iME, eta(ebid), _w, 0.);
60  else if(btype_ == binning::kProjPhi)
61  fill_(iME, phi(ebid), _w, 0.);
62  }
63  else if(subdet == EcalEndcap){
64  EEDetId eeid(_id);
66  fill_(iME, eta(eeid), _w, 0.);
68  fill_(iME, phi(eeid), _w, 0.);
69  }
70  }
71  else if(isEndcapTTId(_id)){
72  EcalTrigTowerDetId ttid(_id);
73  std::vector<DetId> ids(getTrigTowerMap()->constituentsOf(ttid));
74  unsigned nIds(ids.size());
76  for(unsigned iId(0); iId < nIds; iId++)
77  fill_(iME, eta(EEDetId(ids[iId])), _w / nIds, 0.);
78  }
79  else if(btype_ == binning::kProjPhi){
80  for(unsigned iId(0); iId < nIds; iId++)
81  fill_(iME, phi(EEDetId(ids[iId])), _w / nIds, 0.);
82  }
83  }
84  else if(subdet == EcalTriggerTower){
85  EcalTrigTowerDetId ttid(_id);
87  int ieta(ttid.ieta());
88  if(ieta < 18 && ieta > 0)
89  fill_(iME, (ieta * 5 - 2.5) * EBDetId::crystalUnitToEta, _w, 0.);
90  else if(ieta > -18 && ieta < 0)
91  fill_(iME, (ieta * 5 + 2.5) * EBDetId::crystalUnitToEta, _w, 0.);
92  }
93  else if(btype_ == binning::kProjPhi)
94  fill_(iME, phi(ttid), _w, 0.);
95  }
96  }
virtual void checkME_(unsigned _iME) const
Definition: MESet.h:115
bool isEndcapTTId(DetId const &)
EcalTrigTowerConstituentsMap const * getTrigTowerMap()
static const float crystalUnitToEta
Definition: EBDetId.h:160
virtual void fill_(unsigned, int, double)
Definition: MESet.cc:278
unsigned findPlotIndex(ObjectType, DetId const &)
bool active_
Definition: MESet.h:138
binning::ObjectType otype_
Definition: MESet.h:132
binning::BinningType btype_
Definition: MESet.h:133
double eta(EBDetId const &)
double phi(EBDetId const &)
void ecaldqm::MESetProjection::fill ( int  _subdet,
double  _x = 1.,
double  _w = 1.,
double  = 0. 
)
overridevirtual

Reimplemented from ecaldqm::MESetEcal.

Definition at line 99 of file MESetProjection.cc.

References ecaldqm::MESet::active_, ecaldqm::MESet::btype_, ecaldqm::MESet::checkME_(), ecaldqm::binning::findPlotIndex(), ecaldqm::binning::kProjPhi, ecaldqm::MESet::mes_, ecaldqm::MESet::otype_, and ecaldqm::phi().

100  {
101  if(!active_) return;
102 
103  unsigned iME(binning::findPlotIndex(otype_, _subdet, btype_));
104  checkME_(iME);
105 
106  if(btype_ == binning::kProjPhi) _x = phi(_x);
107 
108  mes_[iME]->Fill(_x, _w);
109  }
virtual void checkME_(unsigned _iME) const
Definition: MESet.h:115
std::vector< MonitorElement * > mes_
Definition: MESet.h:129
unsigned findPlotIndex(ObjectType, DetId const &)
bool active_
Definition: MESet.h:138
binning::ObjectType otype_
Definition: MESet.h:132
binning::BinningType btype_
Definition: MESet.h:133
double phi(EBDetId const &)
void ecaldqm::MESetProjection::fill ( double  _x,
double  _w = 1.,
double  = 0. 
)
overridevirtual

Reimplemented from ecaldqm::MESetEcal.

Definition at line 112 of file MESetProjection.cc.

References ecaldqm::MESet::active_, ecaldqm::MESet::btype_, ecaldqm::MESet::checkME_(), ecaldqm::etaBound, ecaldqm::binning::kEcal2P, ecaldqm::binning::kProjEta, ecaldqm::MESet::mes_, and ecaldqm::MESet::otype_.

113  {
114  if(!active_) return;
115  if(btype_ != binning::kProjEta) return;
116 
117  unsigned iME;
118  if(_x < -etaBound) iME = 0;
119  else if(_x < etaBound) iME = 1;
120  else iME = 2;
121 
122  if(otype_ == binning::kEcal2P && iME == 2) iME = 0;
123 
124  checkME_(iME);
125 
126  mes_[iME]->Fill(_x, _w);
127  }
virtual void checkME_(unsigned _iME) const
Definition: MESet.h:115
double const etaBound
std::vector< MonitorElement * > mes_
Definition: MESet.h:129
bool active_
Definition: MESet.h:138
binning::ObjectType otype_
Definition: MESet.h:132
binning::BinningType btype_
Definition: MESet.h:133
double ecaldqm::MESetProjection::getBinContent ( DetId const &  _id,
int  = 0 
) const
overridevirtual

Reimplemented from ecaldqm::MESetEcal.

Definition at line 322 of file MESetProjection.cc.

References ecaldqm::MESet::active_, stringResolutionProvider_cfi::bin, ecaldqm::MESet::btype_, ecaldqm::MESet::checkME_(), EBDetId::crystalUnitToEta, EcalBarrel, EcalEndcap, EcalTriggerTower, ecaldqm::eta(), ecaldqm::binning::findPlotIndex(), MonitorElement::getBinContent(), MonitorElement::getTH1(), ecaldqm::getTrigTowerMap(), photons_cff::ids, EcalTrigTowerDetId::ieta(), ecaldqm::isEndcapTTId(), ecaldqm::binning::kProjEta, ecaldqm::binning::kProjPhi, ecaldqm::MESet::mes_, ecaldqm::MESet::otype_, ecaldqm::phi(), and DetId::subdetId().

323  {
324  if(!active_) return 0.;
325 
326  unsigned iME(binning::findPlotIndex(otype_, _id));
327  checkME_(iME);
328 
329  MonitorElement* me(mes_[iME]);
330 
331  if(isEndcapTTId(_id)){
332  EcalTrigTowerDetId ttid(_id);
333  std::vector<DetId> ids(getTrigTowerMap()->constituentsOf(ttid));
334  if(btype_ == binning::kProjEta){
335  int bin(me->getTH1()->FindBin(eta(EEDetId(ids[0]))));
336  return me->getBinContent(bin);
337  }
338  else if(btype_ == binning::kProjPhi){
339  int bin(me->getTH1()->FindBin(phi(EEDetId(ids[0]))));
340  return me->getBinContent(bin);
341  }
342  return 0.;
343  }
344 
345  double x(0.);
346  int subdet(_id.subdetId());
347  if(subdet == EcalBarrel){
348  EBDetId ebid(_id);
350  x = eta(ebid);
351  else if(btype_ == binning::kProjPhi)
352  x = phi(ebid);
353  }
354  else if(subdet == EcalEndcap){
356  x = eta(EEDetId(_id));
357  else if(btype_ == binning::kProjPhi)
358  x = phi(EEDetId(_id));
359  }
360  else if(subdet == EcalTriggerTower){
361  EcalTrigTowerDetId ttid(_id);
362  if(btype_ == binning::kProjEta){
363  int ieta(ttid.ieta());
364  if(ieta < 18 && ieta > 0)
365  x = (ieta * 5 - 2.5) * EBDetId::crystalUnitToEta;
366  else if(ieta > -18 && ieta < 0)
367  x = (ieta * 5 + 2.5) * EBDetId::crystalUnitToEta;
368  }
369  else if(btype_ == binning::kProjPhi)
370  x = phi(ttid);
371  }
372 
373  int bin(me->getTH1()->FindBin(x));
374  return me->getBinContent(bin);
375  }
virtual void checkME_(unsigned _iME) const
Definition: MESet.h:115
bool isEndcapTTId(DetId const &)
std::vector< MonitorElement * > mes_
Definition: MESet.h:129
EcalTrigTowerConstituentsMap const * getTrigTowerMap()
static const float crystalUnitToEta
Definition: EBDetId.h:160
bin
set the eta bin as selection string.
unsigned findPlotIndex(ObjectType, DetId const &)
bool active_
Definition: MESet.h:138
binning::ObjectType otype_
Definition: MESet.h:132
binning::BinningType btype_
Definition: MESet.h:133
double eta(EBDetId const &)
double phi(EBDetId const &)
double ecaldqm::MESetProjection::getBinEntries ( DetId const &  _id,
int  = 0 
) const
overridevirtual

Reimplemented from ecaldqm::MESetEcal.

Definition at line 434 of file MESetProjection.cc.

References ecaldqm::MESet::active_, stringResolutionProvider_cfi::bin, ecaldqm::MESet::btype_, ecaldqm::MESet::checkME_(), EBDetId::crystalUnitToEta, EcalBarrel, EcalEndcap, EcalTriggerTower, ecaldqm::eta(), ecaldqm::binning::findPlotIndex(), MonitorElement::getBinEntries(), MonitorElement::getTH1(), ecaldqm::getTrigTowerMap(), photons_cff::ids, EcalTrigTowerDetId::ieta(), ecaldqm::isEndcapTTId(), ecaldqm::binning::kProjEta, ecaldqm::binning::kProjPhi, ecaldqm::MESet::mes_, ecaldqm::MESet::otype_, ecaldqm::phi(), and DetId::subdetId().

435  {
436  if(!active_) return 0.;
437 
438  unsigned iME(binning::findPlotIndex(otype_, _id));
439  checkME_(iME);
440 
441  MonitorElement* me(mes_[iME]);
442 
443  if(isEndcapTTId(_id)){
444  EcalTrigTowerDetId ttid(_id);
445  std::vector<DetId> ids(getTrigTowerMap()->constituentsOf(ttid));
446  if(btype_ == binning::kProjEta){
447  int bin(me->getTH1()->FindBin(eta(EEDetId(ids[0]))));
448  return me->getBinEntries(bin);
449  }
450  else if(btype_ == binning::kProjPhi){
451  int bin(me->getTH1()->FindBin(phi(EEDetId(ids[0]))));
452  return me->getBinEntries(bin);
453  }
454  return 0.;
455  }
456 
457  double x(0.);
458  int subdet(_id.subdetId());
459  if(subdet == EcalBarrel){
460  EBDetId ebid(_id);
462  x = eta(ebid);
463  else if(btype_ == binning::kProjPhi)
464  x = phi(ebid);
465  }
466  else if(subdet == EcalEndcap){
468  x = eta(EEDetId(_id));
469  else if(btype_ == binning::kProjPhi)
470  x = phi(EEDetId(_id));
471  }
472  else if(subdet == EcalTriggerTower){
473  EcalTrigTowerDetId ttid(_id);
474  if(btype_ == binning::kProjEta){
475  int ieta(ttid.ieta());
476  if(ieta < 18 && ieta > 0)
477  x = (ieta * 5 - 2.5) * EBDetId::crystalUnitToEta;
478  else if(ieta > -18 && ieta < 0)
479  x = (ieta * 5 + 2.5) * EBDetId::crystalUnitToEta;
480  }
481  else if(btype_ == binning::kProjPhi)
482  x = phi(ttid);
483  }
484 
485  int bin(me->getTH1()->FindBin(x));
486  return me->getBinEntries(bin);
487  }
virtual void checkME_(unsigned _iME) const
Definition: MESet.h:115
bool isEndcapTTId(DetId const &)
std::vector< MonitorElement * > mes_
Definition: MESet.h:129
EcalTrigTowerConstituentsMap const * getTrigTowerMap()
static const float crystalUnitToEta
Definition: EBDetId.h:160
bin
set the eta bin as selection string.
unsigned findPlotIndex(ObjectType, DetId const &)
bool active_
Definition: MESet.h:138
binning::ObjectType otype_
Definition: MESet.h:132
binning::BinningType btype_
Definition: MESet.h:133
double eta(EBDetId const &)
double phi(EBDetId const &)
double ecaldqm::MESetProjection::getBinError ( DetId const &  _id,
int  = 0 
) const
overridevirtual

Reimplemented from ecaldqm::MESetEcal.

Definition at line 378 of file MESetProjection.cc.

References ecaldqm::MESet::active_, stringResolutionProvider_cfi::bin, ecaldqm::MESet::btype_, ecaldqm::MESet::checkME_(), EBDetId::crystalUnitToEta, EcalBarrel, EcalEndcap, EcalTriggerTower, ecaldqm::eta(), ecaldqm::binning::findPlotIndex(), MonitorElement::getBinError(), MonitorElement::getTH1(), ecaldqm::getTrigTowerMap(), photons_cff::ids, EcalTrigTowerDetId::ieta(), ecaldqm::isEndcapTTId(), ecaldqm::binning::kProjEta, ecaldqm::binning::kProjPhi, ecaldqm::MESet::mes_, ecaldqm::MESet::otype_, ecaldqm::phi(), and DetId::subdetId().

379  {
380  if(!active_) return 0.;
381 
382  unsigned iME(binning::findPlotIndex(otype_, _id));
383  checkME_(iME);
384 
385  MonitorElement* me(mes_[iME]);
386 
387  if(isEndcapTTId(_id)){
388  EcalTrigTowerDetId ttid(_id);
389  std::vector<DetId> ids(getTrigTowerMap()->constituentsOf(ttid));
390  if(btype_ == binning::kProjEta){
391  int bin(me->getTH1()->FindBin(eta(EEDetId(ids[0]))));
392  return me->getBinError(bin);
393  }
394  else if(btype_ == binning::kProjPhi){
395  int bin(me->getTH1()->FindBin(phi(EEDetId(ids[0]))));
396  return me->getBinError(bin);
397  }
398  return 0.;
399  }
400 
401  double x(0.);
402  int subdet(_id.subdetId());
403  if(subdet == EcalBarrel){
404  EBDetId ebid(_id);
406  x = eta(ebid);
407  else if(btype_ == binning::kProjPhi)
408  x = phi(ebid);
409  }
410  else if(subdet == EcalEndcap){
412  x = eta(EEDetId(_id));
413  else if(btype_ == binning::kProjPhi)
414  x = phi(EEDetId(_id));
415  }
416  else if(subdet == EcalTriggerTower){
417  EcalTrigTowerDetId ttid(_id);
418  if(btype_ == binning::kProjEta){
419  int ieta(ttid.ieta());
420  if(ieta < 18 && ieta > 0)
421  x = (ieta * 5 - 2.5) * EBDetId::crystalUnitToEta;
422  else if(ieta > -18 && ieta < 0)
423  x = (ieta * 5 + 2.5) * EBDetId::crystalUnitToEta;
424  }
425  else if(btype_ == binning::kProjPhi)
426  x = phi(ttid);
427  }
428 
429  int bin(me->getTH1()->FindBin(x));
430  return me->getBinError(bin);
431  }
virtual void checkME_(unsigned _iME) const
Definition: MESet.h:115
bool isEndcapTTId(DetId const &)
std::vector< MonitorElement * > mes_
Definition: MESet.h:129
EcalTrigTowerConstituentsMap const * getTrigTowerMap()
static const float crystalUnitToEta
Definition: EBDetId.h:160
bin
set the eta bin as selection string.
unsigned findPlotIndex(ObjectType, DetId const &)
bool active_
Definition: MESet.h:138
binning::ObjectType otype_
Definition: MESet.h:132
binning::BinningType btype_
Definition: MESet.h:133
double eta(EBDetId const &)
double phi(EBDetId const &)
void ecaldqm::MESetProjection::setBinContent ( DetId const &  _id,
double  _content 
)
overridevirtual

Reimplemented from ecaldqm::MESet.

Definition at line 130 of file MESetProjection.cc.

References ecaldqm::MESet::active_, stringResolutionProvider_cfi::bin, create_public_pileup_plots::bins, ecaldqm::MESet::btype_, ecaldqm::MESet::checkME_(), EBDetId::crystalUnitToEta, EcalBarrel, EcalEndcap, EcalTriggerTower, ecaldqm::eta(), ecaldqm::binning::findPlotIndex(), MonitorElement::getTH1(), ecaldqm::getTrigTowerMap(), photons_cff::ids, EcalTrigTowerDetId::ieta(), ecaldqm::isEndcapTTId(), ecaldqm::binning::kProjEta, ecaldqm::binning::kProjPhi, ecaldqm::MESet::mes_, ecaldqm::MESet::otype_, ecaldqm::phi(), MonitorElement::setBinContent(), and DetId::subdetId().

131  {
132  if(!active_) return;
133 
134  unsigned iME(binning::findPlotIndex(otype_, _id));
135  checkME_(iME);
136 
137  MonitorElement* me(mes_[iME]);
138 
139  if(isEndcapTTId(_id)){
140  EcalTrigTowerDetId ttid(_id);
141  std::vector<DetId> ids(getTrigTowerMap()->constituentsOf(ttid));
142  unsigned nIds(ids.size());
143  std::set<int> bins;
144  if(btype_ == binning::kProjEta){
145  for(unsigned iId(0); iId < nIds; iId++){
146  int bin(me->getTH1()->FindBin(eta(EEDetId(ids[iId]))));
147  if(bins.find(bin) != bins.end()) continue;
148  me->setBinContent(bin, _content);
149  }
150  }
151  else if(btype_ == binning::kProjPhi){
152  for(unsigned iId(0); iId < nIds; iId++){
153  int bin(me->getTH1()->FindBin(phi(EEDetId(ids[iId]))));
154  if(bins.find(bin) != bins.end()) continue;
155  me->setBinContent(bin, _content);
156  }
157  }
158  return;
159  }
160 
161  double x(0.);
162  int subdet(_id.subdetId());
163  if(subdet == EcalBarrel){
164  EBDetId ebid(_id);
166  x = eta(ebid);
167  else if(btype_ == binning::kProjPhi)
168  x = phi(ebid);
169  }
170  else if(subdet == EcalEndcap){
172  x = eta(EEDetId(_id));
173  else if(btype_ == binning::kProjPhi)
174  x = phi(EEDetId(_id));
175  }
176  else if(subdet == EcalTriggerTower){
177  EcalTrigTowerDetId ttid(_id);
178  if(btype_ == binning::kProjEta){
179  int ieta(ttid.ieta());
180  if(ieta < 18 && ieta > 0)
181  x = (ieta * 5 - 2.5) * EBDetId::crystalUnitToEta;
182  else if(ieta > -18 && ieta < 0)
183  x = (ieta * 5 + 2.5) * EBDetId::crystalUnitToEta;
184  }
185  else if(btype_ == binning::kProjPhi)
186  x = phi(ttid);
187  }
188 
189  int bin(me->getTH1()->FindBin(x));
190  me->setBinContent(bin, _content);
191  }
virtual void checkME_(unsigned _iME) const
Definition: MESet.h:115
bool isEndcapTTId(DetId const &)
std::vector< MonitorElement * > mes_
Definition: MESet.h:129
EcalTrigTowerConstituentsMap const * getTrigTowerMap()
static const float crystalUnitToEta
Definition: EBDetId.h:160
bin
set the eta bin as selection string.
unsigned findPlotIndex(ObjectType, DetId const &)
bool active_
Definition: MESet.h:138
binning::ObjectType otype_
Definition: MESet.h:132
binning::BinningType btype_
Definition: MESet.h:133
double eta(EBDetId const &)
double phi(EBDetId const &)
void ecaldqm::MESetProjection::setBinEntries ( DetId const &  _id,
double  _entries 
)
overridevirtual

Reimplemented from ecaldqm::MESet.

Definition at line 258 of file MESetProjection.cc.

References ecaldqm::MESet::active_, stringResolutionProvider_cfi::bin, create_public_pileup_plots::bins, ecaldqm::MESet::btype_, ecaldqm::MESet::checkME_(), EBDetId::crystalUnitToEta, EcalBarrel, EcalEndcap, EcalTriggerTower, ecaldqm::eta(), ecaldqm::binning::findPlotIndex(), MonitorElement::getTH1(), ecaldqm::getTrigTowerMap(), photons_cff::ids, EcalTrigTowerDetId::ieta(), ecaldqm::isEndcapTTId(), ecaldqm::binning::kProjEta, ecaldqm::binning::kProjPhi, ecaldqm::MESet::mes_, ecaldqm::MESet::otype_, ecaldqm::phi(), MonitorElement::setBinEntries(), and DetId::subdetId().

259  {
260  if(!active_) return;
261 
262  unsigned iME(binning::findPlotIndex(otype_, _id));
263  checkME_(iME);
264 
265  MonitorElement* me(mes_[iME]);
266 
267  if(isEndcapTTId(_id)){
268  EcalTrigTowerDetId ttid(_id);
269  std::vector<DetId> ids(getTrigTowerMap()->constituentsOf(ttid));
270  unsigned nIds(ids.size());
271  std::set<int> bins;
272  if(btype_ == binning::kProjEta){
273  for(unsigned iId(0); iId < nIds; iId++){
274  int bin(me->getTH1()->FindBin(eta(EEDetId(ids[iId]))));
275  if(bins.find(bin) != bins.end()) continue;
276  me->setBinEntries(bin, _entries);
277  }
278  }
279  else if(btype_ == binning::kProjPhi){
280  for(unsigned iId(0); iId < nIds; iId++){
281  int bin(me->getTH1()->FindBin(phi(EEDetId(ids[iId]))));
282  if(bins.find(bin) != bins.end()) continue;
283  me->setBinEntries(bin, _entries);
284  }
285  }
286  return;
287  }
288 
289  double x(0.);
290  int subdet(_id.subdetId());
291  if(subdet == EcalBarrel){
292  EBDetId ebid(_id);
294  x = eta(ebid);
295  else if(btype_ == binning::kProjPhi)
296  x = phi(ebid);
297  }
298  else if(subdet == EcalEndcap){
300  x = eta(EEDetId(_id));
301  else if(btype_ == binning::kProjPhi)
302  x = phi(EEDetId(_id));
303  }
304  else if(subdet == EcalTriggerTower){
305  EcalTrigTowerDetId ttid(_id);
306  if(btype_ == binning::kProjEta){
307  int ieta(ttid.ieta());
308  if(ieta < 18 && ieta > 0)
309  x = (ieta * 5 - 2.5) * EBDetId::crystalUnitToEta;
310  else if(ieta > -18 && ieta < 0)
311  x = (ieta * 5 + 2.5) * EBDetId::crystalUnitToEta;
312  }
313  else if(btype_ == binning::kProjPhi)
314  x = phi(ttid);
315  }
316 
317  int bin(me->getTH1()->FindBin(x));
318  me->setBinEntries(bin, _entries);
319  }
virtual void checkME_(unsigned _iME) const
Definition: MESet.h:115
bool isEndcapTTId(DetId const &)
std::vector< MonitorElement * > mes_
Definition: MESet.h:129
EcalTrigTowerConstituentsMap const * getTrigTowerMap()
static const float crystalUnitToEta
Definition: EBDetId.h:160
bin
set the eta bin as selection string.
unsigned findPlotIndex(ObjectType, DetId const &)
bool active_
Definition: MESet.h:138
binning::ObjectType otype_
Definition: MESet.h:132
binning::BinningType btype_
Definition: MESet.h:133
double eta(EBDetId const &)
double phi(EBDetId const &)
void ecaldqm::MESetProjection::setBinError ( DetId const &  _id,
double  _error 
)
overridevirtual

Reimplemented from ecaldqm::MESet.

Definition at line 194 of file MESetProjection.cc.

References ecaldqm::MESet::active_, stringResolutionProvider_cfi::bin, create_public_pileup_plots::bins, ecaldqm::MESet::btype_, ecaldqm::MESet::checkME_(), EBDetId::crystalUnitToEta, EcalBarrel, EcalEndcap, EcalTriggerTower, ecaldqm::eta(), ecaldqm::binning::findPlotIndex(), MonitorElement::getTH1(), ecaldqm::getTrigTowerMap(), photons_cff::ids, EcalTrigTowerDetId::ieta(), ecaldqm::isEndcapTTId(), ecaldqm::binning::kProjEta, ecaldqm::binning::kProjPhi, ecaldqm::MESet::mes_, ecaldqm::MESet::otype_, ecaldqm::phi(), MonitorElement::setBinError(), and DetId::subdetId().

195  {
196  if(!active_) return;
197 
198  unsigned iME(binning::findPlotIndex(otype_, _id));
199  checkME_(iME);
200 
201  MonitorElement* me(mes_[iME]);
202 
203  if(isEndcapTTId(_id)){
204  EcalTrigTowerDetId ttid(_id);
205  std::vector<DetId> ids(getTrigTowerMap()->constituentsOf(ttid));
206  unsigned nIds(ids.size());
207  std::set<int> bins;
208  if(btype_ == binning::kProjEta){
209  for(unsigned iId(0); iId < nIds; iId++){
210  int bin(me->getTH1()->FindBin(eta(EEDetId(ids[iId]))));
211  if(bins.find(bin) != bins.end()) continue;
212  me->setBinError(bin, _error);
213  }
214  }
215  else if(btype_ == binning::kProjPhi){
216  for(unsigned iId(0); iId < nIds; iId++){
217  int bin(me->getTH1()->FindBin(phi(EEDetId(ids[iId]))));
218  if(bins.find(bin) != bins.end()) continue;
219  me->setBinError(bin, _error);
220  }
221  }
222  return;
223  }
224 
225  double x(0.);
226  int subdet(_id.subdetId());
227  if(subdet == EcalBarrel){
228  EBDetId ebid(_id);
230  x = eta(ebid);
231  else if(btype_ == binning::kProjPhi)
232  x = phi(ebid);
233  }
234  else if(subdet == EcalEndcap){
236  x = eta(EEDetId(_id));
237  else if(btype_ == binning::kProjPhi)
238  x = phi(EEDetId(_id));
239  }
240  else if(subdet == EcalTriggerTower){
241  EcalTrigTowerDetId ttid(_id);
242  if(btype_ == binning::kProjEta){
243  int ieta(ttid.ieta());
244  if(ieta < 18 && ieta > 0)
245  x = (ieta * 5 - 2.5) * EBDetId::crystalUnitToEta;
246  else if(ieta > -18 && ieta < 0)
247  x = (ieta * 5 + 2.5) * EBDetId::crystalUnitToEta;
248  }
249  else if(btype_ == binning::kProjPhi)
250  x = phi(ttid);
251  }
252 
253  int bin(me->getTH1()->FindBin(x));
254  me->setBinError(bin, _error);
255  }
virtual void checkME_(unsigned _iME) const
Definition: MESet.h:115
bool isEndcapTTId(DetId const &)
std::vector< MonitorElement * > mes_
Definition: MESet.h:129
EcalTrigTowerConstituentsMap const * getTrigTowerMap()
static const float crystalUnitToEta
Definition: EBDetId.h:160
bin
set the eta bin as selection string.
unsigned findPlotIndex(ObjectType, DetId const &)
bool active_
Definition: MESet.h:138
binning::ObjectType otype_
Definition: MESet.h:132
binning::BinningType btype_
Definition: MESet.h:133
double eta(EBDetId const &)
double phi(EBDetId const &)