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 Member Functions | Private Attributes
RPCEfficiencySecond Class Reference

#include <RPCEfficiencySecond.h>

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

Public Member Functions

int rollY (std::string shortname, const std::vector< std::string > &rollNames)
 
 RPCEfficiencySecond (const edm::ParameterSet &)
 
 ~RPCEfficiencySecond ()
 
- 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
 EDAnalyzerBase ()
 
ModuleDescription const & moduleDescription () const
 
virtual ~EDAnalyzerBase ()
 
- Public Member Functions inherited from edm::EDConsumerBase
 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 (const std::string &iProcessName, std::vector< const char * > &oModuleLabels) 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::one::EDAnalyzerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
- 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 Member Functions

std::map< std::string,
MonitorElement * > 
bookDetUnitSeg (DQMStore::IBooker &, RPCDetId &, int nstrips, std::string)
 
void myBooker (DQMStore::IBooker &)
 

Private Attributes

MonitorElementDiskSummary [10]
 
MonitorElementEffDistroD [10]
 
MonitorElementEffDistroW [5]
 
MonitorElementEffGlobD [10]
 
MonitorElementEffGlobW [5]
 
MonitorElementExGregR2D [10]
 
MonitorElementExGregR3D [10]
 
MonitorElementExpLayerW [5]
 
MonitorElementExsectorEffW [5]
 
std::string folderPath
 
MonitorElementGregR2D [10]
 
MonitorElementGregR3D [10]
 
MonitorElementhistoCSC
 
MonitorElementhistoCSC2
 
MonitorElementhistoDT
 
MonitorElementhistoDT2
 
MonitorElementhistoeffIdRPC_CSC
 
MonitorElementhistoeffIdRPC_DT
 
MonitorElementhistoPRO
 
MonitorElementhistoRealRPC
 
MonitorElementhistoRealRPC2
 
MonitorElementhistoRPC
 
MonitorElementhistoRPC2
 
bool init_
 
int innermostRings_
 
std::map< int, std::map
< std::string, MonitorElement * > > 
meCollection
 
int numberOfDisks_
 
MonitorElementObsLayerW [5]
 
MonitorElementOcGregR2D [10]
 
MonitorElementOcGregR3D [10]
 
MonitorElementOcsectorEffW [5]
 
edm::ESHandle< RPCGeometryrpcGeo_
 
MonitorElementsectorEffW [5]
 
MonitorElementWheelSummary [5]
 

Additional Inherited Members

- Public Types inherited from edm::one::EDAnalyzerBase
typedef EDAnalyzerBase ModuleType
 
- 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

author Camilo Carrillo (Uniandes)

Definition at line 19 of file RPCEfficiencySecond.h.

Constructor & Destructor Documentation

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

Definition at line 19 of file RPCEfficiencySecond.cc.

References folderPath, edm::ParameterSet::getUntrackedParameter(), init_, innermostRings_, numberOfDisks_, and AlCaHLTBitMon_QueryRunRegistry::string.

19  {
20 
21  folderPath = iConfig.getUntrackedParameter<std::string>("folderPath","RPC/RPCEfficiency/");
22  numberOfDisks_ = iConfig.getUntrackedParameter<int>("NumberOfEndcapDisks", 4);
23  innermostRings_ = iConfig.getUntrackedParameter<int>("NumberOfInnermostEndcapRings", 2);
24 
25  init_ = false;
26 
27 }
T getUntrackedParameter(std::string const &, T const &) const
RPCEfficiencySecond::~RPCEfficiencySecond ( )

Definition at line 29 of file RPCEfficiencySecond.cc.

29 {}

Member Function Documentation

void RPCEfficiencySecond::beginJob ( void  )
protectedvirtual

Reimplemented from edm::one::EDAnalyzerBase.

Definition at line 31 of file RPCEfficiencySecond.cc.

31 {}
std::map< std::string, MonitorElement * > RPCEfficiencySecond::bookDetUnitSeg ( DQMStore::IBooker ibooker,
RPCDetId detId,
int  nstrips,
std::string  folderPath 
)
private

Definition at line 12 of file RPCEfficiencyBookSecondStep.cc.

References DQMStore::IBooker::book1D(), RPCBookFolderStructure::folderStructure(), RPCGeomServ::name(), RPCDetId::region(), DQMStore::IBooker::setCurrentFolder(), and AlCaHLTBitMon_QueryRunRegistry::string.

12  {
13 
14  std::map<std::string, MonitorElement*> meMap;
15 
17 
18  std::string folder = folderPath+ "RollByRoll/" + folderStr->folderStructure(detId);
19 
20  delete folderStr;
21 
22  ibooker.setCurrentFolder(folder);
23 
24  RPCGeomServ RPCname(detId);
25  std::string nameRoll = RPCname.name();
26  char detUnitLabel[128];
27  char layerLabel[128];
28 
29  sprintf(detUnitLabel ,"%s",nameRoll.c_str());
30  sprintf(layerLabel ,"%s",nameRoll.c_str());
31 
32  char meId [128];
33  char meTitle [128];
34 
35  //Begin booking DT
36  if(detId.region()==0) {
37 
38  //std::cout<<"Booking "<<folder<<meId<<std::endl;
39  sprintf(meId,"ExpectedOccupancyFromDT_%s",detUnitLabel);
40  sprintf(meTitle,"ExpectedOccupancyFromDT_for_%s",layerLabel);
41  meMap[meId] = ibooker.book1D(meId, meTitle, nstrips, 0.5, nstrips+0.5);
42  //std::cout<<"Booking "<<meId<<std::endl;
43 
44  sprintf(meId,"RPCDataOccupancyFromDT_%s",detUnitLabel);
45  sprintf(meTitle,"RPCDataOccupancyFromDT_for_%s",layerLabel);
46  meMap[meId] = ibooker.book1D(meId, meTitle, nstrips, 0.5, nstrips+0.5);
47 
48  sprintf(meId,"Profile_%s",detUnitLabel);
49  sprintf(meTitle,"Profile_for_%s",layerLabel);
50  meMap[meId] = ibooker.book1D(meId, meTitle, nstrips, 0.5, nstrips+0.5);
51  //std::cout<<"Booking "<<folder<<meId<<std::endl;
52 
53 // sprintf(meId,"BXDistribution_%s",detUnitLabel);
54 // sprintf(meTitle,"BXDistribution_for_%s",layerLabel);
55 // meMap[meId] = ibooker.book1D(meId, meTitle, 11,-5.5, 5.5);
56 
57  }else{
58  //std::cout<<"Booking for the EndCap"<<detUnitLabel<<std::endl;
59 
60  //std::cout<<"Booking "<<meId<<std::endl;
61  sprintf(meId,"ExpectedOccupancyFromCSC_%s",detUnitLabel);
62  sprintf(meTitle,"ExpectedOccupancyFromCSC_for_%s",layerLabel);
63  meMap[meId] = ibooker.book1D(meId, meTitle, nstrips, 0.5, nstrips+0.5);
64 
65  //std::cout<<"Booking "<<meId<<std::endl;
66  sprintf(meId,"RPCDataOccupancyFromCSC_%s",detUnitLabel);
67  sprintf(meTitle,"RPCDataOccupancyFromCSC_for_%s",layerLabel);
68  meMap[meId] = ibooker.book1D(meId, meTitle, nstrips, 0.5, nstrips+0.5);
69 
70  //std::cout<<"Booking "<<meId<<std::endl;
71  sprintf(meId,"Profile_%s",detUnitLabel);
72  sprintf(meTitle,"Profile_for_%s",layerLabel);
73  meMap[meId] = ibooker.book1D(meId, meTitle, nstrips, 0.5, nstrips+0.5);
74 
75 // //std::cout<<"Booking "<<meId<<std::endl;
76 // sprintf(meId,"BXDistribution_%s",detUnitLabel);
77 // sprintf(meTitle,"BXDistribution_for_%s",layerLabel);
78 // meMap[meId] = ibooker.book1D(meId, meTitle, 11,-5.5, 5.5);
79  }
80  return meMap;
81 }
MonitorElement * book1D(Args &&...args)
Definition: DQMStore.h:115
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:274
std::string folderStructure(RPCDetId detId)
int region() const
Region id: 0 for Barrel, +/-1 For +/- Endcap.
Definition: RPCDetId.h:63
void RPCEfficiencySecond::dqmEndJob ( DQMStore::IBooker ibooker,
DQMStore::IGetter igetter 
)
overrideprotectedvirtual

Implements DQMEDHarvester.

Definition at line 46 of file RPCEfficiencySecond.cc.

References DQMStore::IBooker::book1D(), DQMStore::IBooker::book2D(), rpcdqm::utils::detId2RollNr(), DiskSummary, EffDistroD, EffDistroW, EffGlobD, EffGlobW, ExGregR2D, ExGregR3D, ExpLayerW, ExsectorEffW, MonitorElement::Fill(), folderPath, DQMStore::IGetter::get(), MonitorElement::getBinContent(), MonitorElement::getTH1F(), GregR2D, GregR3D, histoCSC, histoDT, histoRPC, i, cmsHarvester::index, innermostRings_, j, roll_playback::k, rpcdqm::utils::labelXAxisSector(), rpcdqm::utils::labelXAxisSegment(), rpcdqm::utils::labelYAxisRing(), rpcdqm::utils::labelYAxisRoll(), RPCDetId::layer(), LogDebug, N, RPCGeomServ::name(), numberOfDisks_, python.connectstrParser::o, ObsLayerW, OcGregR2D, OcGregR3D, OcsectorEffW, AlCaHLTBitMon_ParallelJobs::p, alignCSCRings::r, DetId::rawId(), RPCDetId::region(), relativeConstraints::ring, RPCDetId::ring(), RPCChamber::rolls(), rpcGeo_, RPCDetId::sector(), sectorEffW, RPCGeomServ::segment(), MonitorElement::setAxisRange(), MonitorElement::setAxisTitle(), MonitorElement::setBinContent(), MonitorElement::setBinError(), MonitorElement::setBinLabel(), DQMStore::IBooker::setCurrentFolder(), RPCGeomServ::shortname(), mathSSE::sqrt(), relativeConstraints::station, RPCDetId::station(), AlCaHLTBitMon_QueryRunRegistry::string, w, WheelSummary, x, detailsBasic3DVector::y, and cuy::yBin.

46  {
47 
48 
49  rpcdqm::utils rpcUtils;
50  //Barrel
51  std::stringstream folderName;
52  std::stringstream MeName; std::stringstream MeTitle;
53  for (int w =-2; w<=2; w++){
54  folderName.str("");
55  folderName<<folderPath<<"Wheel_"<<w;
56  ibooker.setCurrentFolder(folderName.str());
57  MeName.str("");
58  MeName<<"EffDistroWheel_"<<w;
59  MeTitle.str("");
60  MeTitle<<"Efficiency Distribution for Wheel "<<w;
61  EffDistroW[w+2]=ibooker.book1D(MeName.str(),MeTitle.str(),20,0.5,100.5);
62  MeName.str("");
63  MeName<<"GlobEfficiencyWheel_"<<w;
64  MeTitle.str("");
65  MeTitle<<"Efficiency Wheel "<<w;
66  EffGlobW[w+2]=ibooker.book1D(MeName.str(),MeTitle.str(),206,0.5,206.5);
68  MeName.str("");
69  MeName<<"Efficiency_Roll_vs_Sector_Wheel_"<<w;
70  WheelSummary[w+2] = ibooker.book2D(MeName.str(),MeName.str(),12, 0.5,12.5, 21, 0.5, 21.5);
71  rpcUtils.labelXAxisSector( WheelSummary[w+2] );
72  rpcUtils.labelYAxisRoll( WheelSummary[w+2], 0, w, true);
73  ibooker.setCurrentFolder(folderPath+"Azimutal/");
74  MeName.str("");
75  MeName<<"AzimutalDistroW"<<w;
76  MeTitle.str("");
77  MeTitle<<"Efficiency per Sector Wheel "<<w;
78  sectorEffW[w+2]= ibooker.book1D(MeName.str(),MeTitle.str(),12,0.5,12.5);
79  MeName.str("");
80  MeName<<"AzimutalDistroW"<<w<<"Ex";
81  MeTitle.str("");
82  MeTitle<<"Expected per Sector Wheel "<<w;
83  ExsectorEffW[w+2]= ibooker.book1D(MeName.str(),MeTitle.str(),12,0.5,12.5);
84  MeName.str("");
85  MeName<<"AzimutalDistroW"<<w<<"Oc";
86  MeTitle.str("");
87  MeTitle<<"Occupancy per Sector Wheel "<<w;
88  OcsectorEffW[w+2]= ibooker.book1D(MeName.str(),MeTitle.str(),12,0.5,12.5);
89  ibooker.setCurrentFolder(folderPath+"BarrelPerLayer/");
90  MeName.str("");
91  MeName<<"ExpLayerW"<<w;
92  MeTitle.str("");
93  MeTitle<<"Expected Wheel "<<w;
94  ExpLayerW[w+2]= ibooker.book1D(MeName.str(),MeTitle.str(),6,0.5,6.5);
95  MeName.str("");
96  MeName<<"ObsLayerW"<<w;
97  MeTitle.str("");
98  MeTitle<<"Observed Wheel "<<w;
99  ObsLayerW[w+2]= ibooker.book1D(MeName.str(),MeTitle.str(),6,0.5,6.5);
100  }
101  //EndCap
102  int index = 0;
103  for (int d = (-1 *numberOfDisks_); d<=numberOfDisks_; d++){
104  if (d==0) {continue;}
105  folderName.str("");
106  folderName<<folderPath<<"Disk_"<<d;
107  ibooker.setCurrentFolder(folderName.str());
108  MeName.str("");
109  MeName<<"EffDistroDisk_"<<d;
110  MeTitle.str("");
111  MeTitle<<"Efficiency Distribution Disk "<<d;
112  EffDistroD[index]=ibooker.book1D(MeName.str(),MeTitle.str(),20,0.5,100.5);
113  MeName.str("");
114  MeName<<"GlobEfficiencyDisk_"<<d;
115  MeTitle.str("");
116  MeTitle<<"Efficiency Disk "<<d;
117  EffGlobD[index] = ibooker.book1D(MeName.str(),MeTitle.str(),218,0.5,218.5);
118  ibooker.setCurrentFolder(folderPath);
119  MeName.str("");
120  MeName<<"Efficiency_Roll_vs_Segment_Disk_"<<d;
121  DiskSummary[index] = ibooker.book2D(MeName.str(),MeName.str(),36,0.5,36.5,6,0.5,6.5);
122  rpcUtils.labelXAxisSegment(DiskSummary[index]);
123  rpcUtils.labelYAxisRing(DiskSummary[index], innermostRings_ , true);
124  ibooker.setCurrentFolder(folderPath+"Azimutal/");
125  MeName.str("");
126  MeName<<"GregDistroR2D"<<d;
127  MeTitle.str("");
128  MeTitle<<"Efficiency for Station "<<d<<" Ring 2";
129  GregR2D[index]= ibooker.book1D(MeName.str(),MeTitle.str(),36,0.5,36.5);
130  MeName.str("");
131  MeName<<"GregDistroR3D"<<d;
132  MeTitle.str("");
133  MeTitle<<"Efficiency for Station "<<d<<" Ring 3";
134  GregR3D[index]= ibooker.book1D(MeName.str(),MeTitle.str(),36,0.5,36.5);
135  MeName.str("");
136  MeName<<"OcGregDistroR2D"<<d;
137  MeTitle.str("");
138  MeTitle<<"Occupancy Distribution for Station "<<d<<" Ring 2";
139  OcGregR2D[index]= ibooker.book1D(MeName.str(),MeTitle.str(),36,0.5,36.5);
140  MeName.str("");
141  MeName<<"OcGregDistroR3D"<<d;
142  MeTitle.str("");
143  MeTitle<<"Occupancy Distribution for Station "<<d<<" Ring 3";
144  OcGregR3D[index]= ibooker.book1D(MeName.str(),MeTitle.str(),36,0.5,36.5);
145  MeName.str("");
146  MeName<<"ExGregDistroR2D"<<d;
147  MeTitle.str("");
148  MeTitle<<"Expected Distribution for Station "<<d<<" Ring 2";
149  ExGregR2D[index]= ibooker.book1D(MeName.str(),MeTitle.str(),36,0.5,36.5);
150  MeName.str("");
151  MeName<<"ExGregDistroR3D"<<d;
152  MeTitle.str("");
153  MeTitle<<"Expected Distribution for Station "<<d<<" Ring 3";
154  ExGregR3D[index]= ibooker.book1D(MeName.str(),MeTitle.str(),36,0.5,36.5);
155  index++;
156  }
157 
158 
159 
160  LogDebug("rpcefficiencysecond")<<"Getting the RPC Geometry";
161 
162 
163  //Setting Labels in Summary Label.
164  std::stringstream binLabel;
165  for (int w = -2; w<=2 ;w++){
166  for(int x = 1;x<=12;x++){
167  for(int y = 1;y<=21;y++){
168  WheelSummary[w+2]->setBinContent(x,y,-1);
169  }
170  }
171  }
172  for (int d = 0 ; d<(numberOfDisks_*2); d++){
173  for(int x = 1;x<=36;x++){
174  for(int y = 1;y<=6;y++){
175  DiskSummary[d]->setBinContent(x,y,-1);
176  }
177  }
178  }
179  binLabel.str("");
180  int indexWheel[5];
181  for(int j=0;j<5;j++){
182  indexWheel[j]=0;
183  }
184  int indexDisk[10];
185  for(int j=0;j<10;j++){
186  indexDisk[j]=0;
187  }
188  for(TrackingGeometry::DetContainer::const_iterator it=rpcGeo_->dets().begin(); it!=rpcGeo_->dets().end();it++){
189  if(dynamic_cast< const RPCChamber* >( *it ) != 0 ){
190  const RPCChamber* ch = dynamic_cast< const RPCChamber* >( *it );
191  std::vector< const RPCRoll*> roles = (ch->rolls());
192  for(std::vector<const RPCRoll*>::const_iterator r = roles.begin();r != roles.end(); ++r){
193  RPCDetId rpcId = (*r)->id();
194  RPCGeomServ rpcsrv(rpcId);
195  // std::string nameRoll = rpcsrv.name();
196  std::string camera = rpcsrv.name();
197  //Breaking down the geometry
198  int region = rpcId.region();
199  int wheel = rpcId.ring(); int ring = rpcId.ring();
200  int sector = rpcId.sector();
201  int station = rpcId.station();
202  int geolayer = rpcId.layer();
203  if(region==0){//Barrel
204  std::stringstream meIdRPC, meIdDT; //, bxDistroId;
205  meIdRPC<<folderPath<<"MuonSegEff/RPCDataOccupancyFromDT_"<<rpcId.rawId();
206  meIdDT<<folderPath<<"MuonSegEff/ExpectedOccupancyFromDT_"<<rpcId.rawId();
207  histoRPC = igetter.get(meIdRPC.str());
208  histoDT = igetter.get(meIdDT.str());
209  int NumberWithOutPrediction=0;
210  double p = 0.;
211  double o = 0.;
212  double ef = 0.;
213  double er = 0.;
214  double buffef = 0.;
215  double buffer = 0.;
216  double sumbuffef = 0.;
217  double sumbuffer = 0.;
218  double averageeff = 0.;
219  int NumberStripsPointed = 0;
220  if(histoRPC && histoDT){
221  for(int i=1;i<=int((*r)->nstrips());++i){
222  if(histoDT->getBinContent(i)!=0){
223  LogDebug("rpcefficiencysecond")<<"Inside the If";
224  buffef = double(histoRPC->getBinContent(i))/double(histoDT->getBinContent(i));
225  buffer = sqrt(buffef*(1.-buffef)/double(histoDT->getBinContent(i)));
226  sumbuffef=sumbuffef+buffef;
227  sumbuffer = sumbuffer + buffer*buffer;
228  NumberStripsPointed++;
229  }else{
230  NumberWithOutPrediction++;
231  }
232  LogDebug("rpcefficiencysecond")<<"Strip="<<i<<" RPC="<<histoRPC->getBinContent(i)<<" DT="<<histoDT->getBinContent(i)<<" buffef="<<buffef<<" buffer="<<buffer<<" sumbuffef="<<sumbuffef<<" sumbuffer="<<sumbuffer<<" NumberStripsPointed="<<NumberStripsPointed<<" NumberWithOutPrediction"<<NumberWithOutPrediction;
233  }
234  p=histoDT->getTH1F()->Integral();
235  o=histoRPC->getTH1F()->Integral();
236  if(NumberStripsPointed!=0){
237  averageeff = (sumbuffef/double(NumberStripsPointed))*100.;
238  //averageerr = sqrt(sumbuffer/double(NumberStripsPointed))*100.;
239  }
240  }
241  // int Ring = rpcId.ring();
242  if(p!=0){
243  ef = double(o)/double(p);
244  er = sqrt(ef*(1.-ef)/double(p));
245  }
246  ef=ef*100;
247  er=er*100;
248  //Filling azimutal Wheel Histograms
249  int layer = 0;
250  if(station==1&&geolayer==1) layer = 1;
251  else if(station==1&&geolayer==2) layer = 2;
252  else if(station==2&&geolayer==1) layer = 3;
253  else if(station==2&&geolayer==2) layer = 4;
254  else if(station==3) layer = 5;
255  else if(station==4) layer = 6;
256  ExsectorEffW[wheel+2]->Fill(sector,p); OcsectorEffW[wheel+2]->Fill(sector,o);
257  ExpLayerW[wheel+2]->Fill(layer, p); ObsLayerW[wheel+2]->Fill(layer, o);
258  LogDebug("rpcefficiencysecond")<<"Pigi "<<camera<<" "<<rpcsrv.shortname()<<" "<<(*r)->id();
259  if(p > 100){//We need at least 100 predictions to fill the summary plot
260  int xBin,yBin;
261  xBin= (*r)->id().sector();
262  rpcdqm::utils rollNumber;
263  yBin = rollNumber.detId2RollNr((*r)->id());
264  WheelSummary[wheel+2]->setBinContent(xBin,yBin,averageeff);
265  }
266  EffDistroW[wheel+2]->Fill(averageeff);
267  indexWheel[wheel+2]++;
268  EffGlobW[wheel+2]->setBinContent(indexWheel[wheel+2],ef);
269  EffGlobW[wheel+2]->setBinError(indexWheel[wheel+2],er);
270  EffGlobW[wheel+2]->setBinLabel(indexWheel[wheel+2],camera,1);
271  }else{//EndCap
272  std::stringstream meIdRPC,meIdCSC; //, bxDistroId;
273  std::string meIdPRO;
274  meIdRPC<<folderPath<<"MuonSegEff/RPCDataOccupancyFromCSC_"<<rpcId.rawId();
275  meIdCSC<<folderPath<<"MuonSegEff/ExpectedOccupancyFromCSC_"<<rpcId.rawId();
276  meIdPRO = "Profile_"+ rpcsrv.name();
277  histoRPC= igetter.get(meIdRPC.str());
278  histoCSC= igetter.get(meIdCSC.str());
279  //BXDistribution = dbe->get(bxDistroId.str());
280  int NumberWithOutPrediction=0;
281  double p = 0;
282  double o = 0;
283  double ef =0;
284  double er =0;
285  double buffef = 0;
286  double buffer = 0;
287  double sumbuffef = 0;
288  double sumbuffer = 0;
289  double averageeff = 0;
290  int NumberStripsPointed = 0;
291  if(histoRPC && histoCSC) {
292  LogDebug("rpcefficiencysecond")<<rpcsrv.name();
293  for(int i=1;i<=int((*r)->nstrips());++i){
294  if(histoCSC->getBinContent(i)!=0){
295  LogDebug("rpcefficiencysecond")<<"Inside the If";
296  buffef = double(histoRPC->getBinContent(i))/double(histoCSC->getBinContent(i));
297  // meMap[meIdPRO]->setBinContent(i,buffef);
298  buffer = sqrt(buffef*(1.-buffef)/double(histoCSC->getBinContent(i)));
299  // meMap[meIdPRO]->setBinError(i,buffer);
300  sumbuffef=sumbuffef+buffef;
301  sumbuffer = sumbuffer + buffer*buffer;
302  NumberStripsPointed++;
303  }else{
304  NumberWithOutPrediction++;
305  }
306  LogDebug("rpcefficiencysecond")<<"Strip="<<i<<" RPC="<<histoRPC->getBinContent(i)<<" CSC="<<histoCSC->getBinContent(i)<<" buffef="<<buffef<<" buffer="<<buffer<<" sumbuffef="<<sumbuffef<<" sumbuffer="<<sumbuffer<<" NumberStripsPointed="<<NumberStripsPointed<<" NumberWithOutPrediction"<<NumberWithOutPrediction;
307  }
308  p=histoCSC->getTH1F()->Integral();
309  o=histoRPC->getTH1F()->Integral();
310  if(NumberStripsPointed!=0){
311  averageeff = (sumbuffef/double(NumberStripsPointed))*100.;
312  }
313  }
314  int Disk = station*region;
315  if(Disk > numberOfDisks_ || Disk<-numberOfDisks_){continue;} //remove strange disk numbers!!
316  int dIndex = -1;
317  if(region == -1){
318  dIndex = Disk+numberOfDisks_;
319  }else if(region == 1){
320  dIndex = Disk+numberOfDisks_-1;
321  }
322  if( dIndex<0 || dIndex>= numberOfDisks_*2){continue;} //extra check on disk numering
323  if(p!=0){
324  ef = double(o)/double(p);
325  er = sqrt(ef*(1.-ef)/double(p));
326  }
327  ef=ef*100;
328  er=er*100;
329  if(ring==2){
330  if (ExGregR2D[dIndex] && OcGregR2D[dIndex] ){
331  ExGregR2D[dIndex]->Fill(rpcsrv.segment(),p);
332  OcGregR2D[dIndex]->Fill(rpcsrv.segment(),o);
333  }
334  } else if(ring==3){
335  ExGregR3D[dIndex]->Fill(rpcsrv.segment(),p);
336  OcGregR3D[dIndex]->Fill(rpcsrv.segment(),o);
337  }
338  if(p > 100){ //We need at least 100 predictions to fill the summary plot
339  RPCGeomServ RPCServ((*r)->id());
340  int xBin = RPCServ.segment();
341  int yBin= (ring-1)*3-(*r)->id().roll()+1;
342  DiskSummary[dIndex]->setBinContent(xBin, yBin, averageeff);
343  }
344  if ( EffDistroD[dIndex]){EffDistroD[dIndex]->Fill(averageeff);}
345  indexDisk[dIndex]++;
346  if ( EffGlobD[dIndex]){
347  EffGlobD[dIndex]->setBinContent(indexDisk[dIndex],ef);
348  EffGlobD[dIndex]->setBinError(indexDisk[dIndex],er);
349  EffGlobD[dIndex]->setBinLabel(indexDisk[dIndex],camera,1);
350  }
351  }
352  }
353  }
354  }
355  double eff,N,err;
356  int k;
357  for (int d = 0; d<(numberOfDisks_*2); d++){
358  for(k=1;k<=36;k++){
359  err=0; eff=0; N=ExGregR2D[d]->getBinContent(k);
360  if(N!=0.){ eff = OcGregR2D[d]->getBinContent(k)/N; err=sqrt(eff*(1-eff)/N);}
361  GregR2D[d]->setBinContent(k,eff); GregR2D[d]->setBinError(k,err);
362  err=0; eff=0; N=ExGregR3D[d]->getBinContent(k);
363  if(N!=0.){ eff = OcGregR3D[d]->getBinContent(k)/N; err=sqrt(eff*(1-eff)/N);}
364  GregR3D[d]->setBinContent(k,eff); GregR3D[d]->setBinError(k,err);
365  }
366  }
367  for (int w =-2; w<=2; w++){
368  for(k=1;k<=12;k++){
369  err=0; eff=0; N=ExsectorEffW[w+2]->getBinContent(k);
370  if(N!=0.){ eff = OcsectorEffW[w+2]->getBinContent(k)/N;err=sqrt(eff*(1-eff)/N);}
371  sectorEffW[w+2]->setBinContent(k,eff); sectorEffW[w+2]->setBinError(k,err);
372  }
373  }
374  //Ranges for Both
375  //Barrel
376  for (int w=-2; w<=2; w++){
377  EffGlobW[w+2]->setAxisRange(-4.,100.,2);
378  EffGlobW[w+2]->setAxisTitle("%",2);
379  }
380  for (int d=0; d<(numberOfDisks_*2); d++){
381  EffGlobD[d]->setAxisRange(-4.,100.,2);
382  EffGlobD[d]->setAxisTitle("%",2);
383  }
384 
385 }
#define LogDebug(id)
MonitorElement * EffGlobW[5]
int i
Definition: DBlmapReader.cc:9
void setBinContent(int binx, double content)
set content of bin (1-D)
const double w
Definition: UKUtility.cc:23
MonitorElement * histoCSC
void setAxisRange(double xmin, double xmax, int axis=1)
set x-, y- or z-axis range (axis=1, 2, 3 respectively)
tuple yBin
Definition: cuy.py:891
MonitorElement * get(const std::string &path)
Definition: DQMStore.cc:298
MonitorElement * OcGregR3D[10]
MonitorElement * histoDT
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)
Definition: utils.h:250
void labelYAxisRoll(MonitorElement *myMe, int region, int ring, bool useRollInfo)
Definition: utils.h:268
MonitorElement * sectorEffW[5]
void Fill(long long x)
edm::ESHandle< RPCGeometry > rpcGeo_
uint32_t rawId() const
get the raw id
Definition: DetId.h:43
Definition: BoundDisk.h:19
void labelYAxisRing(MonitorElement *myMe, int numberOfRings, bool useRollInfo)
Definition: utils.h:295
MonitorElement * ObsLayerW[5]
int ring() const
Definition: RPCDetId.h:72
T sqrt(T t)
Definition: SSEVec.h:48
MonitorElement * book1D(Args &&...args)
Definition: DQMStore.h:115
MonitorElement * EffGlobD[10]
const std::vector< const RPCRoll * > & rolls() const
Return the Rolls.
Definition: RPCChamber.cc:68
int j
Definition: DBlmapReader.cc:9
MonitorElement * EffDistroD[10]
MonitorElement * ExpLayerW[5]
void setBinError(int binx, double error)
set uncertainty on content of bin (1-D)
MonitorElement * OcGregR2D[10]
void labelXAxisSector(MonitorElement *myMe)
Definition: utils.h:236
int layer() const
Definition: RPCDetId.h:108
virtual int segment()
Definition: RPCGeomServ.cc:467
int detId2RollNr(const RPCDetId &_id)
Definition: utils.h:18
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:274
#define N
Definition: blowfish.cc:9
MonitorElement * book2D(Args &&...args)
Definition: DQMStore.h:133
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)
Definition: RPCDetId.h:102
MonitorElement * DiskSummary[10]
double getBinContent(int binx) const
get content of bin (1-D)
MonitorElement * ExsectorEffW[5]
Definition: DDAxes.h:10
MonitorElement * GregR2D[10]
MonitorElement * ExGregR3D[10]
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]
int region() const
Region id: 0 for Barrel, +/-1 For +/- Endcap.
Definition: RPCDetId.h:63
int station() const
Definition: RPCDetId.h:96
void RPCEfficiencySecond::dqmEndLuminosityBlock ( DQMStore::IBooker ibooker,
DQMStore::IGetter igetter,
edm::LuminosityBlock const &  lb,
edm::EventSetup const &  iSetup 
)
protectedvirtual

Reimplemented from DQMEDHarvester.

Definition at line 33 of file RPCEfficiencySecond.cc.

References edm::EventSetup::get(), init_, LogDebug, and rpcGeo_.

33  {
34 
35  if(!init_){
36 
37  LogDebug("rpcefficiencysecond")<<"Getting the RPC Geometry";
38 
39  iSetup.get<MuonGeometryRecord>().get(rpcGeo_);
40  init_= true;
41 
42  }
43 }
#define LogDebug(id)
edm::ESHandle< RPCGeometry > rpcGeo_
void RPCEfficiencySecond::myBooker ( DQMStore::IBooker )
private
int RPCEfficiencySecond::rollY ( std::string  shortname,
const std::vector< std::string > &  rollNames 
)

Member Data Documentation

MonitorElement* RPCEfficiencySecond::DiskSummary[10]
private

Definition at line 64 of file RPCEfficiencySecond.h.

Referenced by dqmEndJob().

MonitorElement* RPCEfficiencySecond::EffDistroD[10]
private

Definition at line 60 of file RPCEfficiencySecond.h.

Referenced by dqmEndJob().

MonitorElement* RPCEfficiencySecond::EffDistroW[5]
private

Definition at line 54 of file RPCEfficiencySecond.h.

Referenced by dqmEndJob().

MonitorElement* RPCEfficiencySecond::EffGlobD[10]
private

Definition at line 57 of file RPCEfficiencySecond.h.

Referenced by dqmEndJob().

MonitorElement* RPCEfficiencySecond::EffGlobW[5]
private

Definition at line 51 of file RPCEfficiencySecond.h.

Referenced by dqmEndJob().

MonitorElement* RPCEfficiencySecond::ExGregR2D[10]
private

Definition at line 77 of file RPCEfficiencySecond.h.

Referenced by dqmEndJob().

MonitorElement* RPCEfficiencySecond::ExGregR3D[10]
private

Definition at line 78 of file RPCEfficiencySecond.h.

Referenced by dqmEndJob().

MonitorElement* RPCEfficiencySecond::ExpLayerW[5]
private

Definition at line 80 of file RPCEfficiencySecond.h.

Referenced by dqmEndJob().

MonitorElement* RPCEfficiencySecond::ExsectorEffW[5]
private

Definition at line 69 of file RPCEfficiencySecond.h.

Referenced by dqmEndJob().

std::string RPCEfficiencySecond::folderPath
private

Definition at line 91 of file RPCEfficiencySecond.h.

Referenced by dqmEndJob(), and RPCEfficiencySecond().

MonitorElement* RPCEfficiencySecond::GregR2D[10]
private

Definition at line 71 of file RPCEfficiencySecond.h.

Referenced by dqmEndJob().

MonitorElement* RPCEfficiencySecond::GregR3D[10]
private

Definition at line 72 of file RPCEfficiencySecond.h.

Referenced by dqmEndJob().

MonitorElement* RPCEfficiencySecond::histoCSC
private

Definition at line 36 of file RPCEfficiencySecond.h.

Referenced by dqmEndJob().

MonitorElement* RPCEfficiencySecond::histoCSC2
private

Definition at line 46 of file RPCEfficiencySecond.h.

MonitorElement* RPCEfficiencySecond::histoDT
private

Definition at line 34 of file RPCEfficiencySecond.h.

Referenced by dqmEndJob().

MonitorElement* RPCEfficiencySecond::histoDT2
private

Definition at line 44 of file RPCEfficiencySecond.h.

MonitorElement* RPCEfficiencySecond::histoeffIdRPC_CSC
private

Definition at line 40 of file RPCEfficiencySecond.h.

MonitorElement* RPCEfficiencySecond::histoeffIdRPC_DT
private

Definition at line 39 of file RPCEfficiencySecond.h.

MonitorElement* RPCEfficiencySecond::histoPRO
private

Definition at line 38 of file RPCEfficiencySecond.h.

MonitorElement* RPCEfficiencySecond::histoRealRPC
private

Definition at line 35 of file RPCEfficiencySecond.h.

MonitorElement* RPCEfficiencySecond::histoRealRPC2
private

Definition at line 45 of file RPCEfficiencySecond.h.

MonitorElement* RPCEfficiencySecond::histoRPC
private

Definition at line 33 of file RPCEfficiencySecond.h.

Referenced by dqmEndJob().

MonitorElement* RPCEfficiencySecond::histoRPC2
private

Definition at line 43 of file RPCEfficiencySecond.h.

bool RPCEfficiencySecond::init_
private

Definition at line 89 of file RPCEfficiencySecond.h.

Referenced by dqmEndLuminosityBlock(), and RPCEfficiencySecond().

int RPCEfficiencySecond::innermostRings_
private

Definition at line 93 of file RPCEfficiencySecond.h.

Referenced by dqmEndJob(), and RPCEfficiencySecond().

std::map<int, std::map<std::string, MonitorElement*> > RPCEfficiencySecond::meCollection
private

Definition at line 87 of file RPCEfficiencySecond.h.

int RPCEfficiencySecond::numberOfDisks_
private

Definition at line 92 of file RPCEfficiencySecond.h.

Referenced by dqmEndJob(), and RPCEfficiencySecond().

MonitorElement* RPCEfficiencySecond::ObsLayerW[5]
private

Definition at line 81 of file RPCEfficiencySecond.h.

Referenced by dqmEndJob().

MonitorElement* RPCEfficiencySecond::OcGregR2D[10]
private

Definition at line 74 of file RPCEfficiencySecond.h.

Referenced by dqmEndJob().

MonitorElement* RPCEfficiencySecond::OcGregR3D[10]
private

Definition at line 75 of file RPCEfficiencySecond.h.

Referenced by dqmEndJob().

MonitorElement* RPCEfficiencySecond::OcsectorEffW[5]
private

Definition at line 68 of file RPCEfficiencySecond.h.

Referenced by dqmEndJob().

edm::ESHandle<RPCGeometry> RPCEfficiencySecond::rpcGeo_
private

Definition at line 83 of file RPCEfficiencySecond.h.

Referenced by dqmEndJob(), and dqmEndLuminosityBlock().

MonitorElement* RPCEfficiencySecond::sectorEffW[5]
private

Definition at line 67 of file RPCEfficiencySecond.h.

Referenced by dqmEndJob().

MonitorElement* RPCEfficiencySecond::WheelSummary[5]
private

Definition at line 63 of file RPCEfficiencySecond.h.

Referenced by dqmEndJob().