CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
RPCEfficiencyShiftHisto.cc
Go to the documentation of this file.
1 //
2 // Original Author: Cesare Calabria,161 R-006,
3 // Created: Tue Jul 20 12:58:43 CEST 2010
4 
5 // Reviewed : Anna Cimmino Tue Aug 16 10:20 2010
6 
7 
8 // user include files
10 #include <sstream>
11 
12 //CondFormats
15 // Framework
21 //DQM Services
23 
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 }
30 
31 
33 
35 
37 
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 }
145 
146 
T getUntrackedParameter(std::string const &, T const &) const
void setBinContent(int binx, double content)
set content of bin (1-D)
virtual ~RPCEfficiencyShiftHisto()
Destructor.
const double w
Definition: UKUtility.cc:23
MonitorElement * get(const std::string &path)
Definition: DQMStore.cc:302
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)
void dqmEndLuminosityBlock(DQMStore::IBooker &, DQMStore::IGetter &, edm::LuminosityBlock const &, edm::EventSetup const &)
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 dqmEndJob(DQMStore::IBooker &, DQMStore::IGetter &) override
RPCEfficiencyShiftHisto(const edm::ParameterSet &iConfig)
Constructor.
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:274
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
Definition: DDAxes.h:10