39 std::stringstream folderName;
40 std::stringstream MeName; std::stringstream MeTitle;
41 for (
int w =-2;
w<=2;
w++){
49 MeName<<
"EffDistroWheel_"<<
w;
51 MeTitle<<
"Efficiency Distribution for Wheel "<<
w;
55 MeName<<
"GlobEfficiencyWheel_"<<
w;
57 MeTitle<<
"Efficiency Wheel "<<
w;
62 MeName<<
"Efficiency_Roll_vs_Sector_Wheel_"<<
w;
69 MeName<<
"AzimutalDistroW"<<
w;
71 MeTitle<<
"Efficiency per Sector Wheel "<<
w;
75 MeName<<
"AzimutalDistroW"<<w<<
"Ex";
77 MeTitle<<
"Expected per Sector Wheel "<<
w;
81 MeName<<
"AzimutalDistroW"<<w<<
"Oc";
83 MeTitle<<
"Occupancy per Sector Wheel "<<
w;
88 MeName<<
"ExpLayerW"<<
w;
90 MeTitle<<
"Expected Wheel "<<
w;
94 MeName<<
"ObsLayerW"<<
w;
96 MeTitle<<
"Observed Wheel "<<
w;
104 if (d==0) {
continue;}
111 MeName<<
"EffDistroDisk_"<<d;
113 MeTitle<<
"Efficiency Distribution Disk "<<d;
117 MeName<<
"GlobEfficiencyDisk_"<<d;
119 MeTitle<<
"Efficiency Disk "<<d;
125 MeName<<
"Efficiency_Roll_vs_Segment_Disk_"<<d;
135 MeName<<
"GregDistroR2D"<<d;
137 MeTitle<<
"Efficiency for Station "<<d<<
" Ring 2";
141 MeName<<
"GregDistroR3D"<<d;
143 MeTitle<<
"Efficiency for Station "<<d<<
" Ring 3";
147 MeName<<
"OcGregDistroR2D"<<d;
149 MeTitle<<
"Occupancy Distribution for Station "<<d<<
" Ring 2";
153 MeName<<
"OcGregDistroR3D"<<d;
155 MeTitle<<
"Occupancy Distribution for Station "<<d<<
" Ring 3";
159 MeName<<
"ExGregDistroR2D"<<d;
161 MeTitle<<
"Expected Distribution for Station "<<d<<
" Ring 2";
166 MeName<<
"ExGregDistroR3D"<<d;
168 MeTitle<<
"Expected Distribution for Station "<<d<<
" Ring 3";
179 LogDebug(
"rpcefficiencysecond")<<
"Getting the RPC Geometry";
186 std::stringstream binLabel;
187 for (
int w = -2;
w<=2 ;
w++){
188 for(
int x = 1;
x<=12;
x++){
189 for(
int y = 1;
y<=21;
y++){
197 for(
int x = 1;
x<=36;
x++){
198 for(
int y = 1;
y<=6;
y++){
207 for(
int j=0;
j<5;
j++){
212 for(
int j=0;
j<10;
j++){
217 for(TrackingGeometry::DetContainer::const_iterator it=rpcGeo->dets().begin(); it!=rpcGeo->dets().end();it++){
221 if(dynamic_cast< const RPCChamber* >( *it ) != 0 ){
223 std::vector< const RPCRoll*> roles = (ch->
rolls());
224 for(std::vector<const RPCRoll*>::const_iterator r = roles.begin();r != roles.end(); ++
r){
231 int region = rpcId.
region();
233 int sector = rpcId.
sector();
235 int geolayer = rpcId.
layer();
240 std::stringstream meIdRPC, meIdDT;
242 meIdRPC<<
folderPath<<
"MuonSegEff/RPCDataOccupancyFromDT_"<<rpcId.
rawId();
243 meIdDT<<
folderPath<<
"MuonSegEff/ExpectedOccupancyFromDT_"<<rpcId.
rawId();
248 int NumberWithOutPrediction=0;
255 double sumbuffef = 0.;
256 double sumbuffer = 0.;
257 double averageeff = 0.;
258 int NumberStripsPointed = 0;
263 for(
int i=1;
i<=int((*r)->nstrips());++
i){
266 LogDebug(
"rpcefficiencysecond")<<
"Inside the If";
271 sumbuffef=sumbuffef+buffef;
272 sumbuffer = sumbuffer + buffer*buffer;
273 NumberStripsPointed++;
275 NumberWithOutPrediction++;
277 LogDebug(
"rpcefficiencysecond")<<
"Strip="<<
i<<
" RPC="<<
histoRPC->
getBinContent(
i)<<
" DT="<<
histoDT->
getBinContent(
i)<<
" buffef="<<buffef<<
" buffer="<<buffer<<
" sumbuffef="<<sumbuffef<<
" sumbuffer="<<sumbuffer<<
" NumberStripsPointed="<<NumberStripsPointed<<
" NumberWithOutPrediction"<<NumberWithOutPrediction;
283 if(NumberStripsPointed!=0){
284 averageeff = (sumbuffef/double(NumberStripsPointed))*100.;
293 ef = double(o)/double(p);
294 er =
sqrt(ef*(1.-ef)/
double(p));
305 if(station==1&&geolayer==1) layer = 1;
306 else if(station==1&&geolayer==2) layer = 2;
307 else if(station==2&&geolayer==1) layer = 3;
308 else if(station==2&&geolayer==2) layer = 4;
309 else if(station==3) layer = 5;
310 else if(station==4) layer = 6;
318 LogDebug(
"rpcefficiencysecond")<<
"Pigi "<<camera<<
" "<<rpcsrv.
shortname()<<
" "<<(*r)->id();
323 xBin= (*r)->id().sector();
333 indexWheel[wheel+2]++;
341 std::stringstream meIdRPC,meIdCSC;
345 meIdRPC<<
folderPath<<
"MuonSegEff/RPCDataOccupancyFromCSC_"<<rpcId.
rawId();
346 meIdCSC<<
folderPath<<
"MuonSegEff/ExpectedOccupancyFromCSC_"<<rpcId.
rawId();
348 meIdPRO =
"Profile_"+ rpcsrv.
name();
354 int NumberWithOutPrediction=0;
361 double sumbuffef = 0;
362 double sumbuffer = 0;
363 double averageeff = 0;
364 int NumberStripsPointed = 0;
370 for(
int i=1;
i<=int((*r)->nstrips());++
i){
372 LogDebug(
"rpcefficiencysecond")<<
"Inside the If";
377 sumbuffef=sumbuffef+buffef;
378 sumbuffer = sumbuffer + buffer*buffer;
379 NumberStripsPointed++;
381 NumberWithOutPrediction++;
384 LogDebug(
"rpcefficiencysecond")<<
"Strip="<<
i<<
" RPC="<<
histoRPC->
getBinContent(
i)<<
" CSC="<<
histoCSC->
getBinContent(
i)<<
" buffef="<<buffef<<
" buffer="<<buffer<<
" sumbuffef="<<sumbuffef<<
" sumbuffer="<<sumbuffer<<
" NumberStripsPointed="<<NumberStripsPointed<<
" NumberWithOutPrediction"<<NumberWithOutPrediction;
390 if(NumberStripsPointed!=0){
391 averageeff = (sumbuffef/double(NumberStripsPointed))*100.;
396 int Disk = station*region;
403 }
else if(region == 1){
410 ef = double(o)/double(p);
411 er =
sqrt(ef*(1.-ef)/
double(p));
430 int yBin= (ring-1)*3-(*r)->id().roll()+1;
466 for (
int w =-2;
w<=2;
w++){
478 for (
int w=-2;
w<=2;
w++){
MonitorElement * EffGlobW[5]
T getUntrackedParameter(std::string const &, T const &) const
virtual void analyze(const edm::Event &, const edm::EventSetup &)
void setBinContent(int binx, double content)
set content of bin (1-D)
RPCEfficiencySecond(const edm::ParameterSet &)
MonitorElement * book1D(const char *name, const char *title, int nchX, double lowX, double highX)
Book 1D histogram.
MonitorElement * histoCSC
void setAxisRange(double xmin, double xmax, int axis=1)
set x-, y- or z-axis range (axis=1, 2, 3 respectively)
MonitorElement * OcGregR3D[10]
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)
MonitorElement * OcsectorEffW[5]
void labelXAxisSegment(MonitorElement *myMe)
void labelYAxisRoll(MonitorElement *myMe, int region, int ring, bool useRollInfo)
MonitorElement * sectorEffW[5]
uint32_t rawId() const
get the raw id
virtual void endRun(const edm::Run &, const edm::EventSetup &)
virtual std::string name()
void labelYAxisRing(MonitorElement *myMe, int numberOfRings, bool useRollInfo)
MonitorElement * ObsLayerW[5]
MonitorElement * EffGlobD[10]
const std::vector< const RPCRoll * > & rolls() const
Return the Rolls.
MonitorElement * EffDistroD[10]
MonitorElement * ExpLayerW[5]
void setBinError(int binx, double error)
set uncertainty on content of bin (1-D)
MonitorElement * OcGregR2D[10]
MonitorElement * get(const std::string &path) const
get ME from full pathname (e.g. "my/long/dir/my_histo")
virtual std::string shortname()
void labelXAxisSector(MonitorElement *myMe)
int detId2RollNr(const RPCDetId &_id)
MonitorElement * WheelSummary[5]
TH1F * getTH1F(void) const
MonitorElement * ExGregR2D[10]
int sector() const
Sector id: the group of chambers at same phi (and increasing r)
MonitorElement * DiskSummary[10]
virtual void beginRun(const edm::Run &, const edm::EventSetup &iSetup)
double getBinContent(int binx) const
get content of bin (1-D)
void save(const std::string &filename, const std::string &path="", const std::string &pattern="", const std::string &rewrite="", const uint32_t run=0, const uint32_t lumi=0, SaveReferenceTag ref=SaveWithReference, int minStatus=dqm::qstatus::STATUS_OK, const std::string &fileupdate="RECREATE", const bool resetMEsAfterWriting=false)
MonitorElement * ExsectorEffW[5]
MonitorElement * GregR2D[10]
MonitorElement * ExGregR3D[10]
MonitorElement * book2D(const char *name, const char *title, int nchX, double lowX, double highX, int nchY, double lowY, double highY)
Book 2D histogram.
void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)
MonitorElement * histoRPC
MonitorElement * GregR3D[10]
MonitorElement * EffDistroW[5]
void setCurrentFolder(const std::string &fullpath)
int region() const
Region id: 0 for Barrel, +/-1 For +/- Endcap.