CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Protected Member Functions | Private Attributes
RPCEfficiencyShiftHisto Class Reference

#include <RPCEfficiencyShiftHisto.h>

Inheritance diagram for RPCEfficiencyShiftHisto:
DQMEDHarvester edm::one::EDAnalyzer< edm::one::WatchRuns, edm::one::WatchLuminosityBlocks, edm::one::SharedResources > edm::one::EDAnalyzerBase edm::EDConsumerBase

Public Member Functions

 RPCEfficiencyShiftHisto (const edm::ParameterSet &iConfig)
 Constructor. More...
 
virtual ~RPCEfficiencyShiftHisto ()
 Destructor. More...
 
- Public Member Functions inherited from DQMEDHarvester
virtual void analyze (edm::Event const &, edm::EventSetup const &) final
 
virtual void beginLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &) final
 
virtual void beginRun (edm::Run const &, edm::EventSetup const &)
 
 DQMEDHarvester (void)
 
virtual void endJob () final
 
virtual void endLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &) final
 
virtual void endRun (edm::Run const &, edm::EventSetup const &)
 
- Public Member Functions inherited from edm::one::EDAnalyzer< edm::one::WatchRuns, edm::one::WatchLuminosityBlocks, edm::one::SharedResources >
 EDAnalyzer ()=default
 
- Public Member Functions inherited from edm::one::EDAnalyzerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzerBase ()
 
ModuleDescription const & moduleDescription () const
 
virtual ~EDAnalyzerBase ()
 
- 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 ()
 

Protected Member Functions

void beginJob ()
 
void dqmEndJob (DQMStore::IBooker &, DQMStore::IGetter &) override
 
void dqmEndLuminosityBlock (DQMStore::IBooker &, DQMStore::IGetter &, edm::LuminosityBlock const &, edm::EventSetup const &)
 
- 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)
 

Private Attributes

MonitorElementEffBarrelRoll
 
int effCut_
 
MonitorElementEffEndcapMinusRoll
 
MonitorElementEffEndcapPlusRoll
 
std::string globalFolder_
 
int numberOfDisks_
 
MonitorElementRollPercentage
 

Additional Inherited Members

- Public Types inherited from edm::one::EDAnalyzerBase
typedef EDAnalyzerBase ModuleType
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Static Public Member Functions inherited from edm::one::EDAnalyzerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 

Detailed Description

Definition at line 19 of file RPCEfficiencyShiftHisto.h.

Constructor & Destructor Documentation

RPCEfficiencyShiftHisto::RPCEfficiencyShiftHisto ( const edm::ParameterSet iConfig)

Constructor.

Definition at line 24 of file RPCEfficiencyShiftHisto.cc.

References effCut_, edm::ParameterSet::getUntrackedParameter(), globalFolder_, numberOfDisks_, and AlCaHLTBitMon_QueryRunRegistry::string.

24  {
25 
26  globalFolder_ = ps.getUntrackedParameter<std::string>("GlobalFolder", "RPC/RPCEfficiency/");
27  effCut_= ps.getUntrackedParameter<int>("EffCut", 90);
28  numberOfDisks_ = ps.getUntrackedParameter<int>("NumberOfEndcapDisks", 4);
29 }
RPCEfficiencyShiftHisto::~RPCEfficiencyShiftHisto ( )
virtual

Destructor.

Definition at line 32 of file RPCEfficiencyShiftHisto.cc.

32 { }

Member Function Documentation

void RPCEfficiencyShiftHisto::beginJob ( void  )
protectedvirtual

Reimplemented from edm::one::EDAnalyzerBase.

Definition at line 34 of file RPCEfficiencyShiftHisto.cc.

34 {}
void RPCEfficiencyShiftHisto::dqmEndJob ( DQMStore::IBooker ibooker,
DQMStore::IGetter igetter 
)
overrideprotectedvirtual

Implements DQMEDHarvester.

Definition at line 38 of file RPCEfficiencyShiftHisto.cc.

References DQMStore::IBooker::book1D(), DQMStore::IBooker::book2D(), ztail::d, EffBarrelRoll, effCut_, EffEndcapMinusRoll, EffEndcapPlusRoll, MonitorElement::Fill(), DQMStore::IGetter::get(), MonitorElement::getBinContent(), MonitorElement::getNbinsX(), MonitorElement::getNbinsY(), globalFolder_, numberOfDisks_, alignCSCRings::r, RollPercentage, alignCSCRings::s, MonitorElement::setBinContent(), MonitorElement::setBinLabel(), DQMStore::IBooker::setCurrentFolder(), w, x, and y.

38  {
39 
41  EffBarrelRoll = ibooker.book1D("EffBarrelRoll", "Barrel Efficiency",101,-0.5, 100.5);
42  EffEndcapPlusRoll = ibooker.book1D("EffEndcapPlusRoll", "Endcap + Efficiency",101,-0.5, 100.5);
43  EffEndcapMinusRoll = ibooker.book1D("EffEndcapMinusRoll", "Endcap - Efficiency",101,-0.5, 100.5);
44  RollPercentage = ibooker.book2D("RollPercentage", "RollPercentage",1,0.,1.,3,0.,3.);
45 
46  RollPercentage->setBinLabel(1,"%",1);
47  RollPercentage->setBinLabel(1,"E+",2);
48  RollPercentage->setBinLabel(2,"B",2);
49  RollPercentage->setBinLabel(3,"E-",2);
50 
51 
52  std::stringstream meName;
53  MonitorElement * myMe;
54 
55  meName.str("");
56  meName<<globalFolder_;
57 
58  //Barrel
59 
60  int entriesBarrel = 0;
61  int entriesBarrelBeyondEff = 0;
62  float percBarrel = 0;
63 
64  for(int w = -2 ; w<3; w++){
65 
66  meName.str("");
67  meName<<globalFolder_<<"Efficiency_Roll_vs_Sector_Wheel_"<<w;
68 
69  myMe = igetter.get(meName.str());
70 
71  if(myMe){
72  for(int s = 1; s <= myMe->getNbinsX(); s++){
73  for(int r = 1;r <= myMe->getNbinsY(); r++){
74 
75  double effBarrel = myMe->getBinContent(s,r);
76 
77  if(effBarrel >= 0){//5
78 
79  if (EffBarrelRoll) EffBarrelRoll->Fill(effBarrel);
80  entriesBarrel++;
81 
82  if(effBarrel >= effCut_) entriesBarrelBeyondEff++;
83  }
84  }
85  }
86  }
87  }
88 
89  if(entriesBarrel != 0){
90  percBarrel = 100*entriesBarrelBeyondEff/entriesBarrel;
91  if(RollPercentage)RollPercentage->setBinContent(1,2,percBarrel);}
92 
93 
94  //EndcapMinus
95 
96  int entriesEndcapMinus = 0;
97  int entriesEndcapMinusBeyondEff = 0;
98  float percEndcapMinus = 0;
99  int entriesEndcapPlus = 0;
100  int entriesEndcapPlusBeyondEff = 0;
101  float percEndcapPlus = 0;
102  for(int d = -numberOfDisks_ ; d <= numberOfDisks_; d++){
103 
104  if(d == 0) continue;
105 
106  meName.str("");
107  meName<<globalFolder_<<"Efficiency_Roll_vs_Segment_Disk_"<<d;
108  myMe = igetter.get(meName.str());
109 
110 
111  if(myMe){
112 
113  for (int x = 1 ;x <= myMe->getNbinsX();x++){
114  for(int y = 1;y<=myMe->getNbinsY(); y++){
115 
116  double effEndcap = myMe->getBinContent(x,y);
117 
118  if(d<0 ){
119  entriesEndcapMinus++;
121  if(effEndcap >= effCut_) entriesEndcapMinusBeyondEff++;
122  }else {
123  entriesEndcapPlus++;
125  if(effEndcap >= effCut_) entriesEndcapPlusBeyondEff++;
126  }
127  }
128  }
129  }
130  }
131 
132 
133  if(entriesEndcapMinus != 0){
134  percEndcapMinus = 100*entriesEndcapMinusBeyondEff/entriesEndcapMinus;
135  if( RollPercentage) RollPercentage->setBinContent(1,3,percEndcapMinus);}
136 
137 
138  if(entriesEndcapPlus != 0){
139  percEndcapPlus = 100*entriesEndcapPlusBeyondEff/entriesEndcapPlus;
140  if(RollPercentage) RollPercentage->setBinContent(1,1,percEndcapPlus);
141  }
142 
143 
144 }
void setBinContent(int binx, double content)
set content of bin (1-D)
const double w
Definition: UKUtility.cc:23
MonitorElement * get(const std::string &path)
Definition: DQMStore.cc:301
void setBinLabel(int bin, const std::string &label, int axis=1)
set bin label for x, y or z axis (axis=1, 2, 3 respectively)
int getNbinsY(void) const
get # of bins in Y-axis
void Fill(long long x)
tuple d
Definition: ztail.py:151
MonitorElement * book1D(Args &&...args)
Definition: DQMStore.h:115
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:273
MonitorElement * book2D(Args &&...args)
Definition: DQMStore.h:133
double getBinContent(int binx) const
get content of bin (1-D)
int getNbinsX(void) const
get # of bins in X-axis
void RPCEfficiencyShiftHisto::dqmEndLuminosityBlock ( DQMStore::IBooker ,
DQMStore::IGetter ,
edm::LuminosityBlock const &  ,
edm::EventSetup const &   
)
protectedvirtual

Reimplemented from DQMEDHarvester.

Definition at line 36 of file RPCEfficiencyShiftHisto.cc.

36 {}

Member Data Documentation

MonitorElement* RPCEfficiencyShiftHisto::EffBarrelRoll
private

Definition at line 37 of file RPCEfficiencyShiftHisto.h.

Referenced by dqmEndJob().

int RPCEfficiencyShiftHisto::effCut_
private

Definition at line 43 of file RPCEfficiencyShiftHisto.h.

Referenced by dqmEndJob(), and RPCEfficiencyShiftHisto().

MonitorElement* RPCEfficiencyShiftHisto::EffEndcapMinusRoll
private

Definition at line 39 of file RPCEfficiencyShiftHisto.h.

Referenced by dqmEndJob().

MonitorElement* RPCEfficiencyShiftHisto::EffEndcapPlusRoll
private

Definition at line 38 of file RPCEfficiencyShiftHisto.h.

Referenced by dqmEndJob().

std::string RPCEfficiencyShiftHisto::globalFolder_
private

Definition at line 45 of file RPCEfficiencyShiftHisto.h.

Referenced by dqmEndJob(), and RPCEfficiencyShiftHisto().

int RPCEfficiencyShiftHisto::numberOfDisks_
private

Definition at line 42 of file RPCEfficiencyShiftHisto.h.

Referenced by dqmEndJob(), and RPCEfficiencyShiftHisto().

MonitorElement* RPCEfficiencyShiftHisto::RollPercentage
private

Definition at line 40 of file RPCEfficiencyShiftHisto.h.

Referenced by dqmEndJob().