CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
RPCEfficiency.cc
Go to the documentation of this file.
1 /***************************************
2 Author:
3 Camilo Carrillo
4 Universidad de los Andes Bogota Colombia
5 camilo.carrilloATcern.ch
6 ****************************************/
7 
9 #include <sstream>
19 
20 
22 
23 int distsector_tmp(int sector1,int sector2){
24 
25  if(sector1==13) sector1=4;
26  if(sector1==14) sector1=10;
27 
28  if(sector2==13) sector2=4;
29  if(sector2==14) sector2=10;
30 
31  int distance = abs(sector1 - sector2);
32  if(distance>6) distance = 12-distance;
33  return distance;
34 }
35 
36 
38  incldt=iConfig.getUntrackedParameter<bool>("incldt",true);
39  incldtMB4=iConfig.getUntrackedParameter<bool>("incldtMB4",true);
40  inclcsc=iConfig.getUntrackedParameter<bool>("inclcsc",true);
41  debug=iConfig.getUntrackedParameter<bool>("debug",false);
42 
43  rangestrips = iConfig.getUntrackedParameter<double>("rangestrips",4.);
44  rangestripsRB4=iConfig.getUntrackedParameter<double>("rangestripsRB4",4.);
45  dupli = iConfig.getUntrackedParameter<int>("DuplicationCorrection",2);
46  MinCosAng=iConfig.getUntrackedParameter<double>("MinCosAng",0.96);
47  MaxD=iConfig.getUntrackedParameter<double>("MaxD",80.);
48  MaxDrb4=iConfig.getUntrackedParameter<double>("MaxDrb4",150.);
49 
50 
51  // muonRPCDigis=iConfig.getUntrackedParameter<std::string>("muonRPCDigis","muonRPCDigis");
52  cscSegments=iConfig.getParameter<edm::InputTag>("cscSegments");
53  dt4DSegments=iConfig.getParameter<edm::InputTag>("dt4DSegments");
54  RPCRecHitLabel_ = iConfig.getParameter<edm::InputTag>("RecHitLabel");
55 
56 
57  folderPath=iConfig.getUntrackedParameter<std::string>("folderPath","RPC/RPCEfficiency/");
58 
59  EffSaveRootFile = iConfig.getUntrackedParameter<bool>("EffSaveRootFile", false);
60  EffRootFileName = iConfig.getUntrackedParameter<std::string>("EffRootFileName", "RPCEfficiency.root");
61 
62  //Interface
63 
65 
66  std::string folder;
67  dbe->setCurrentFolder(folderPath);
68  statistics = dbe->book1D("Statistics","All Statistics",33,0.5,33.5);
69 
70  statistics->setBinLabel(1,"Events ",1);
71  statistics->setBinLabel(2,"Events with DT seg",1);
72  statistics->setBinLabel(3,"1 DT seg",1);
73  statistics->setBinLabel(4,"2 DT seg",1);
74  statistics->setBinLabel(5,"3 DT seg",1);
75  statistics->setBinLabel(6,"4 DT seg",1);
76  statistics->setBinLabel(7,"5 DT seg",1);
77  statistics->setBinLabel(8,"6 DT seg",1);
78  statistics->setBinLabel(9,"7 DT seg",1);
79  statistics->setBinLabel(10,"8 DT seg",1);
80  statistics->setBinLabel(11,"9 DT seg",1);
81  statistics->setBinLabel(12,"10 DT seg",1);
82  statistics->setBinLabel(13,"11 DT seg",1);
83  statistics->setBinLabel(14,"12 DT seg",1);
84  statistics->setBinLabel(15,"13 DT seg",1);
85  statistics->setBinLabel(16,"14 DT seg",1);
86  statistics->setBinLabel(17,"15 DT seg",1);
87  statistics->setBinLabel(18,"Events with CSC seg",1);
88  statistics->setBinLabel(16+3,"1 CSC seg",1);
89  statistics->setBinLabel(16+4,"2 CSC seg",1);
90  statistics->setBinLabel(16+5,"3 CSC seg",1);
91  statistics->setBinLabel(16+6,"4 CSC seg",1);
92  statistics->setBinLabel(16+7,"5 CSC seg",1);
93  statistics->setBinLabel(16+8,"6 CSC seg",1);
94  statistics->setBinLabel(16+9,"7 CSC seg",1);
95  statistics->setBinLabel(16+10,"8 CSC seg",1);
96  statistics->setBinLabel(16+11,"9 CSC seg",1);
97  statistics->setBinLabel(16+12,"10 CSC seg",1);
98  statistics->setBinLabel(16+13,"11 CSC seg",1);
99  statistics->setBinLabel(16+14,"12 CSC seg",1);
100  statistics->setBinLabel(16+15,"13 CSC seg",1);
101  statistics->setBinLabel(16+16,"14 CSC seg",1);
102  statistics->setBinLabel(16+17,"15 CSC seg",1);
103 
104  if(debug) std::cout<<"booking Global histograms with "<<folderPath<<std::endl;
105 
106  folder = folderPath+"MuonSegEff/"+"Residuals/Barrel";
107  dbe->setCurrentFolder(folder);
108 
109  //Barrel
110  std::stringstream histoName, histoTitle;
111 
112  for (int layer = 1 ; layer<= 6 ;layer++){
113  histoName.str("");
114  histoTitle.str("");
115  histoName<<"GlobalResidualsClu1La"<<layer;
116  histoTitle<<"RPC Residuals Layer "<<layer<<" Cluster Size 1";
117  hGlobalResClu1La[layer-1] = dbe->book1D(histoName.str(), histoTitle.str(),101,-10.,10.);
118 
119  histoName.str("");
120  histoTitle.str("");
121  histoName<<"GlobalResidualsClu2La"<<layer;
122  histoTitle<<"RPC Residuals Layer "<<layer<<" Cluster Size 2";
123  hGlobalResClu2La[layer-1] = dbe->book1D(histoName.str(), histoTitle.str(),101,-10.,10.);
124 
125  histoName.str("");
126  histoTitle.str("");
127  histoName<<"GlobalResidualsClu3La"<<layer;
128  histoTitle<<"RPC Residuals Layer "<<layer<<" Cluster Size 3";
129  hGlobalResClu3La[layer-1] = dbe->book1D(histoName.str(), histoTitle.str(),101,-10.,10.);
130 
131  }
132 
133  if(debug) std::cout<<"Booking Residuals for EndCap"<<std::endl;
134  folder = folderPath+"MuonSegEff/Residuals/EndCap";
135  dbe->setCurrentFolder(folder);
136 
137  //Endcap
138 
139  hGlobalResClu1R3C = dbe->book1D("GlobalResidualsClu1R3C","RPC Residuals Ring 3 Roll C Cluster Size 1",101,-10.,10.);
140  hGlobalResClu1R3B = dbe->book1D("GlobalResidualsClu1R3B","RPC Residuals Ring 3 Roll B Cluster Size 1",101,-10.,10.);
141  hGlobalResClu1R3A = dbe->book1D("GlobalResidualsClu1R3A","RPC Residuals Ring 3 Roll A Cluster Size 1",101,-10.,10.);
142  hGlobalResClu1R2C = dbe->book1D("GlobalResidualsClu1R2C","RPC Residuals Ring 2 Roll C Cluster Size 1",101,-10.,10.);
143  hGlobalResClu1R2B = dbe->book1D("GlobalResidualsClu1R2B","RPC Residuals Ring 2 Roll B Cluster Size 1",101,-10.,10.);
144  hGlobalResClu1R2A = dbe->book1D("GlobalResidualsClu1R2A","RPC Residuals Ring 2 Roll A Cluster Size 1",101,-10.,10.);
145 
146  hGlobalResClu2R3C = dbe->book1D("GlobalResidualsClu2R3C","RPC Residuals Ring 3 Roll C Cluster Size 2",101,-10.,10.);
147  hGlobalResClu2R3B = dbe->book1D("GlobalResidualsClu2R3B","RPC Residuals Ring 3 Roll B Cluster Size 2",101,-10.,10.);
148  hGlobalResClu2R3A = dbe->book1D("GlobalResidualsClu2R3A","RPC Residuals Ring 3 Roll A Cluster Size 2",101,-10.,10.);
149  hGlobalResClu2R2C = dbe->book1D("GlobalResidualsClu2R2C","RPC Residuals Ring 2 Roll C Cluster Size 2",101,-10.,10.);
150  hGlobalResClu2R2B = dbe->book1D("GlobalResidualsClu2R2B","RPC Residuals Ring 2 Roll B Cluster Size 2",101,-10.,10.);
151  hGlobalResClu2R2A = dbe->book1D("GlobalResidualsClu2R2A","RPC Residuals Ring 2 Roll A Cluster Size 2",101,-10.,10.);
152 
153  hGlobalResClu3R3C = dbe->book1D("GlobalResidualsClu3R3C","RPC Residuals Ring 3 Roll C Cluster Size 3",101,-10.,10.);
154  hGlobalResClu3R3B = dbe->book1D("GlobalResidualsClu3R3B","RPC Residuals Ring 3 Roll B Cluster Size 3",101,-10.,10.);
155  hGlobalResClu3R3A = dbe->book1D("GlobalResidualsClu3R3A","RPC Residuals Ring 3 Roll A Cluster Size 3",101,-10.,10.);
156  hGlobalResClu3R2C = dbe->book1D("GlobalResidualsClu3R2C","RPC Residuals Ring 2 Roll C Cluster Size 3",101,-10.,10.);
157  hGlobalResClu3R2B = dbe->book1D("GlobalResidualsClu3R2B","RPC Residuals Ring 2 Roll B Cluster Size 3",101,-10.,10.);
158  hGlobalResClu3R2A = dbe->book1D("GlobalResidualsClu3R2A","RPC Residuals Ring 2 Roll A Cluster Size 3",101,-10.,10.);
159 
160 }
161 
163 
165  iSetup.get<MuonGeometryRecord>().get(rpcGeo);
166 
167 
168  for (TrackingGeometry::DetContainer::const_iterator it=rpcGeo->dets().begin();it<rpcGeo->dets().end();it++){
169  if(dynamic_cast< RPCChamber* >( *it ) != 0 ){
170  RPCChamber* ch = dynamic_cast< RPCChamber* >( *it );
171  std::vector< const RPCRoll*> roles = (ch->rolls());
172  for(std::vector<const RPCRoll*>::const_iterator r = roles.begin();r != roles.end(); ++r){
173 
174  RPCDetId rpcId = (*r)->id();
175  int region=rpcId.region();
176  //booking all histograms
177 
178  // std::string nameRoll = rpcsrv.name();
179 
180  if(debug) std::cout<<"Booking for "<<rpcId.rawId()<<std::endl;
181 
182  bookDetUnitSeg(rpcId,(*r)->nstrips(),folderPath+"MuonSegEff/", meCollection[rpcId.rawId()] );
183 
184  if(region==0&&(incldt||incldtMB4)){
185  //std::cout<<"--Filling the dtstore"<<rpcId<<std::endl;
186  int wheel=rpcId.ring();
187  int sector=rpcId.sector();
188  int station=rpcId.station();
189  DTStationIndex ind(region,wheel,sector,station);
190  std::set<RPCDetId> myrolls;
191  if (rollstoreDT.find(ind)!=rollstoreDT.end()) myrolls=rollstoreDT[ind];
192  myrolls.insert(rpcId);
193  rollstoreDT[ind]=myrolls;
194 
195  }else if(region!=0 && inclcsc){
196  int station=rpcId.station();
197  int ring=rpcId.ring();
198  int cscring=ring;
199  int cscstation=station;
200  RPCGeomServ rpcsrv(rpcId);
201  int rpcsegment = rpcsrv.segment();
202  int cscchamber = rpcsegment;
203  if((station==2||station==3)&&ring==3){
204  cscring = 2;
205  }
206 
207  CSCStationIndex ind(region,cscstation,cscring,cscchamber);
208  std::set<RPCDetId> myrolls;
209  if (rollstoreCSC.find(ind)!=rollstoreCSC.end()){
210  myrolls=rollstoreCSC[ind];
211  }
212  myrolls.insert(rpcId);
213  rollstoreCSC[ind]=myrolls;
214  }
215  }
216  }
217  }
218  for (TrackingGeometry::DetContainer::const_iterator it=rpcGeo->dets().begin();it<rpcGeo->dets().end();it++){
219  if( dynamic_cast< RPCChamber* >( *it ) != 0 ){
220 
221  RPCChamber* ch = dynamic_cast< RPCChamber* >( *it );
222  std::vector< const RPCRoll*> roles = (ch->rolls());
223  for(std::vector<const RPCRoll*>::const_iterator r = roles.begin();r != roles.end(); ++r){
224  RPCDetId rpcId = (*r)->id();
225 
226  int region=rpcId.region();
227 
228  if(region!=0 && inclcsc && (rpcId.ring()==2 || rpcId.ring()==3)){
229  int region=rpcId.region();
230  int station=rpcId.station();
231  int ring=rpcId.ring();
232  int cscring = ring;
233 
234  if((station==2||station==3)&&ring==3) cscring = 2; //CSC Ring 2 covers rpc ring 2 & 3
235 
236 
237  int cscstation=station;
238  RPCGeomServ rpcsrv(rpcId);
239  int rpcsegment = rpcsrv.segment();
240 
241  int cscchamber = rpcsegment+1;
242  if(cscchamber==37)cscchamber=1;
243  CSCStationIndex ind(region,cscstation,cscring,cscchamber);
244  std::set<RPCDetId> myrolls;
245  if (rollstoreCSC.find(ind)!=rollstoreCSC.end())myrolls=rollstoreCSC[ind];
246  myrolls.insert(rpcId);
247  rollstoreCSC[ind]=myrolls;
248 
249  cscchamber = rpcsegment-1;
250  if(cscchamber==0)cscchamber=36;
251  CSCStationIndex indDos(region,cscstation,cscring,cscchamber);
252  std::set<RPCDetId> myrollsDos;
253  if (rollstoreCSC.find(indDos)!=rollstoreCSC.end()) myrollsDos=rollstoreCSC[indDos];
254  myrollsDos.insert(rpcId);
255  rollstoreCSC[indDos]=myrollsDos;
256  }
257  }
258  }
259  }
260 }//beginRun
261 
263 
265 
266 
270 
271  iSetup.get<MuonGeometryRecord>().get(rpcGeo);
272  iSetup.get<MuonGeometryRecord>().get(dtGeo);
273  iSetup.get<MuonGeometryRecord>().get(cscGeo);
274 
275  statistics->Fill(1);
276 
277  std::stringstream meIdRPC, meIdDT, meIdCSC;
278 
279  if(debug) std::cout <<"\t Getting the RPC RecHits"<<std::endl;
281  iEvent.getByLabel(RPCRecHitLabel_,rpcHits);
282 
283  if(rpcHits.isValid()) return;
284 
285  if(incldt){
286  if(debug) std::cout<<"\t Getting the DT Segments"<<std::endl;
288 
289  iEvent.getByLabel(dt4DSegments, all4DSegments);
290 
291  if(all4DSegments.isValid()){
292 
293  if(all4DSegments->size()>0){
294 
295  if(all4DSegments->size()<=16) statistics->Fill(2);
296 
297  if(debug) std::cout<<"\t Number of DT Segments in this event = "<<all4DSegments->size()<<std::endl;
298 
299  std::map<DTChamberId,int> DTSegmentCounter;
301 
302  for (segment = all4DSegments->begin();segment!=all4DSegments->end(); ++segment){
303  DTSegmentCounter[segment->chamberId()]++;
304  }
305 
306  statistics->Fill(all4DSegments->size()+2);
307 
308  if(debug) std::cout<<"\t Loop over all the 4D Segments"<<std::endl;
309  for (segment = all4DSegments->begin(); segment != all4DSegments->end(); ++segment){
310 
311  DTChamberId DTId = segment->chamberId();
312 
313 
314  if(DTSegmentCounter[DTId]==1 && DTId.station()!=4){
315 
316  int dtWheel = DTId.wheel();
317  int dtStation = DTId.station();
318  int dtSector = DTId.sector();
319 
320  LocalPoint segmentPosition= segment->localPosition();
321  LocalVector segmentDirection=segment->localDirection();
322 
323  const GeomDet* gdet=dtGeo->idToDet(segment->geographicalId());
324  const BoundPlane & DTSurface = gdet->surface();
325 
326  //check if the dimension of the segment is 4
327 
328  if(segment->dimension()==4){
329 
330  float Xo=segmentPosition.x();
331  float Yo=segmentPosition.y();
332  float Zo=segmentPosition.z();
333  float dx=segmentDirection.x();
334  float dy=segmentDirection.y();
335  float dz=segmentDirection.z();
336 
337  std::set<RPCDetId> rollsForThisDT = rollstoreDT[DTStationIndex(0,dtWheel,dtSector,dtStation)];
338 
339  if(debug) std::cout<<"DT \t \t Loop over all the rolls asociated to this DT"<<std::endl;
340  for (std::set<RPCDetId>::iterator iteraRoll = rollsForThisDT.begin();iteraRoll != rollsForThisDT.end(); iteraRoll++){
341  const RPCRoll* rollasociated = rpcGeo->roll(*iteraRoll);
342  RPCDetId rpcId = rollasociated->id();
343  const BoundPlane & RPCSurface = rollasociated->surface();
344 
345 // RPCGeomServ rpcsrv(rpcId);
346 // std::string nameRoll = rpcsrv.name();
347 
348  GlobalPoint CenterPointRollGlobal = RPCSurface.toGlobal(LocalPoint(0,0,0));
349 
350  LocalPoint CenterRollinDTFrame = DTSurface.toLocal(CenterPointRollGlobal);
351 
352  float D=CenterRollinDTFrame.z();
353 
354  float X=Xo+dx*D/dz;
355  float Y=Yo+dy*D/dz;
356  float Z=D;
357 
358  const RectangularStripTopology* top_= dynamic_cast<const RectangularStripTopology*> (&(rollasociated->topology()));
359  LocalPoint xmin = top_->localPosition(0.);
360  if(debug) std::cout<<"DT \t \t \t xmin of this Roll "<<xmin<<"cm"<<std::endl;
361  LocalPoint xmax = top_->localPosition((float)rollasociated->nstrips());
362  if(debug) std::cout<<"DT \t \t \t xmax of this Roll "<<xmax<<"cm"<<std::endl;
363  float rsize = fabs( xmax.x()-xmin.x() );
364  if(debug) std::cout<<"DT \t \t \t Roll Size "<<rsize<<"cm"<<std::endl;
365  float stripl = top_->stripLength();
366  float stripw = top_->pitch();
367 
368  float extrapolatedDistance = sqrt((X-Xo)*(X-Xo)+(Y-Yo)*(Y-Yo)+(Z-Zo)*(Z-Zo));
369 
370  if(extrapolatedDistance<=MaxD){
371 
372  GlobalPoint GlobalPointExtrapolated = DTSurface.toGlobal(LocalPoint(X,Y,Z));
373  LocalPoint PointExtrapolatedRPCFrame = RPCSurface.toLocal(GlobalPointExtrapolated);
374 
375  if(fabs(PointExtrapolatedRPCFrame.z()) < 10. &&
376  fabs(PointExtrapolatedRPCFrame.x()) < rsize*0.5 &&
377  fabs(PointExtrapolatedRPCFrame.y()) < stripl*0.5){
378 
379  RPCDetId rollId = rollasociated->id();
380  RPCGeomServ rpcsrv(rollId);
381  std::string nameRoll = rpcsrv.name();
382  if(debug) std::cout<<"DT \t \t \t \t The RPCName is "<<nameRoll<<std::endl;
383  const float stripPredicted =
384  rollasociated->strip(LocalPoint(PointExtrapolatedRPCFrame.x(),PointExtrapolatedRPCFrame.y(),0.));
385 
386  if(debug) std::cout<<"DT \t \t \t \t Candidate (from DT Segment) STRIP---> "<<stripPredicted<< std::endl;
387  //---- HISTOGRAM STRIP PREDICTED FROM DT ----
388 
389  std::map<std::string, MonitorElement*> meMap=meCollection[rpcId.rawId()];
390  meIdDT.str("");
391  meIdDT<<"ExpectedOccupancyFromDT_"<<rollId.rawId();
392  meMap[meIdDT.str()]->Fill(stripPredicted);
393  //-----------------------------------------------------
394 
395 
396  //-------RecHitPart Just For Residual--------
397  int countRecHits = 0;
398  int cluSize = 0;
399  float minres = 3000.;
400 
401  typedef std::pair<RPCRecHitCollection::const_iterator, RPCRecHitCollection::const_iterator> rangeRecHits;
402  rangeRecHits recHitCollection = rpcHits->get(rollasociated->id());
404 
405  for (recHit = recHitCollection.first; recHit != recHitCollection.second ; recHit++) {
406  countRecHits++;
407 
408  // sprintf(meIdRPC,"BXDistribution_%d",rollasociated->id().rawId());
409 // meMap[meIdRPC]->Fill(recHit->BunchX());
410 
411  LocalPoint recHitPos=recHit->localPosition();
412  float res=PointExtrapolatedRPCFrame.x()- recHitPos.x();
413  if(debug) std::cout<<"DT \t \t \t \t \t Found Rec Hit at "<<res<<"cm of the prediction."<<std::endl;
414  if(fabs(res)<fabs(minres)){
415  minres=res;
416  cluSize = recHit->clusterSize();
417  if(debug) std::cout<<"DT \t \t \t \t \t \t New Min Res "<<res<<"cm."<<std::endl;
418  }
419  }
420 
421  if(countRecHits==0){
422  if(debug) std::cout <<"DT \t \t \t \t \t THIS ROLL DOESN'T HAVE ANY RECHIT"<<std::endl;
423  }else{
424  assert(minres!=3000);
425 
426  if(fabs(minres)<=(rangestrips+cluSize*0.5)*stripw){
427  if(debug) std::cout<<"DT \t \t \t \t \t \t True!"<<std::endl;
428 
429  // float cosal = dx/sqrt(dx*dx+dz*dz);
430 
431  if(rollId.station()==1&&rollId.layer()==1) {
432  if(cluSize==1*dupli) {hGlobalResClu1La[0]->Fill(minres);}
433  else if(cluSize==2*dupli){ hGlobalResClu2La[0]->Fill(minres);}
434  else if(cluSize==3*dupli){ hGlobalResClu3La[0]->Fill(minres);}}
435  else if(rollId.station()==1&&rollId.layer()==2){
436  if(cluSize==1*dupli) {hGlobalResClu1La[1]->Fill(minres);}
437  else if(cluSize==2*dupli){ hGlobalResClu2La[1]->Fill(minres);}
438  else if(cluSize==3*dupli){ hGlobalResClu3La[1]->Fill(minres);}}
439  else if(rollId.station()==2&&rollId.layer()==1){
440  if(cluSize==1*dupli) {hGlobalResClu1La[2]->Fill(minres);}
441  else if(cluSize==2*dupli){ hGlobalResClu2La[2]->Fill(minres);}
442  else if(cluSize==3*dupli){ hGlobalResClu3La[2]->Fill(minres);}
443  }
444  else if(rollId.station()==2&&rollId.layer()==2){
445  if(cluSize==1*dupli) {hGlobalResClu1La[3]->Fill(minres);}
446  if(cluSize==2*dupli){ hGlobalResClu2La[3]->Fill(minres);}
447  else if(cluSize==3*dupli){ hGlobalResClu3La[3]->Fill(minres);}
448  }
449  else if(rollId.station()==3){
450  if(cluSize==1*dupli) {hGlobalResClu1La[4]->Fill(minres);}
451  else if(cluSize==2*dupli){ hGlobalResClu2La[4]->Fill(minres);}
452  else if(cluSize==3*dupli){ hGlobalResClu3La[4]->Fill(minres);}
453  }
454  meIdRPC.str("");
455  meIdRPC<<"RPCDataOccupancyFromDT_"<<rollId.rawId();
456  meMap[meIdRPC.str()]->Fill(stripPredicted);
457  }
458  }
459  }else{
460  if(debug) std::cout<<"DT \t \t \t \t No the prediction is outside of this roll"<<std::endl;
461  }//Condition for the right match
462  }else{
463  if(debug) std::cout<<"DT \t \t \t No, Exrtrapolation too long!, canceled"<<std::endl;
464  }//D so big
465  }//loop over all the rolls asociated
466  }//Is the segment 4D?
467  }else {
468  if(debug) std::cout<<"DT \t \t More than one segment in this chamber, or we are in Station 4"<<std::endl;
469  }
470  }
471  } else {
472  if(debug) std::cout<<"DT This Event doesn't have any DT4DDSegment"<<std::endl; //is ther more than 1 segment in this event?
473  }
474  }
475  }
476 
477  if(incldtMB4){
479  iEvent.getByLabel(dt4DSegments, all4DSegments);
480 
481  if(all4DSegments.isValid() && all4DSegments->size()>0){
482 
483  std::map<DTChamberId,int> DTSegmentCounter;
485 
486  for (segment = all4DSegments->begin();segment!=all4DSegments->end(); ++segment){
487  DTSegmentCounter[segment->chamberId()]++;
488  }
489 
490  if(debug) std::cout<<"MB4 \t \t Loop Over all4DSegments"<<std::endl;
491  for (segment = all4DSegments->begin(); segment != all4DSegments->end(); ++segment){
492 
493  DTChamberId DTId = segment->chamberId();
494 
495  if(DTSegmentCounter[DTId] == 1 && DTId.station()==4){
496  int dtWheel = DTId.wheel();
497  int dtStation = DTId.station();
498  int dtSector = DTId.sector();
499 
500  LocalPoint segmentPosition= segment->localPosition();
501  LocalVector segmentDirection=segment->localDirection();
502 
503  //check if the dimension of the segment is 2 and the station is 4
504 
505  if(segment->dimension()==2){
506  LocalVector segmentDirectionMB4=segmentDirection;
507  LocalPoint segmentPositionMB4=segmentPosition;
508 
509  bool compatiblesegments=false;
510 
511  const BoundPlane& DTSurface4 = dtGeo->idToDet(DTId)->surface();
512 
514 
515  for(segMB3=all4DSegments->begin();segMB3!=all4DSegments->end();++segMB3){
516 
517  DTChamberId dtid3 = segMB3->chamberId();
518 
519  if(distsector_tmp(dtid3.sector(),DTId.sector())<=1
520  && dtid3.station()==3
521  && dtid3.wheel()==DTId.wheel()
522  && DTSegmentCounter[dtid3] == 1
523  && segMB3->dimension()==4){
524 
525  const GeomDet* gdet3=dtGeo->idToDet(segMB3->geographicalId());
526  const BoundPlane & DTSurface3 = gdet3->surface();
527 
528  LocalVector segmentDirectionMB3 = segMB3->localDirection();
529  GlobalPoint segmentPositionMB3inGlobal = DTSurface3.toGlobal(segMB3->localPosition());
530 
531  LocalVector segDirMB4inMB3Frame=DTSurface3.toLocal(DTSurface4.toGlobal(segmentDirectionMB4));
532  LocalVector segDirMB3inMB4Frame=DTSurface4.toLocal(DTSurface3.toGlobal(segmentDirectionMB3));
533 
534  GlobalVector segDirMB4inGlobalFrame=DTSurface4.toGlobal(segmentDirectionMB4);
535  GlobalVector segDirMB3inGlobalFrame=DTSurface3.toGlobal(segmentDirectionMB3);
536 
537  float dx=segDirMB4inGlobalFrame.x();
538  float dy=segDirMB4inGlobalFrame.y();
539  // float dz=segDirMB4inGlobalFrame.z();
540 
541  float dx3=segDirMB3inGlobalFrame.x();
542  float dy3=segDirMB3inGlobalFrame.y();
543  // float dz3=segDirMB3inGlobalFrame.z();
544 
545  double cosAng=fabs(dx*dx3+dy*dy3/sqrt((dx3*dx3+dy3*dy3)*(dx*dx+dy*dy)));
546 
547  if(cosAng>MinCosAng){
548  compatiblesegments=true;
549  if(dtSector==13){
550  dtSector=4;
551  }
552  if(dtSector==14){
553  dtSector=10;
554  }
555 
556  std::set<RPCDetId> rollsForThisDT = rollstoreDT[DTStationIndex(0,dtWheel,dtSector,dtStation)]; //It should be always 4
557 
558  assert(rollsForThisDT.size()>=1);
559 
560  for (std::set<RPCDetId>::iterator iteraRoll=rollsForThisDT.begin();iteraRoll != rollsForThisDT.end(); iteraRoll++){
561  const RPCRoll* rollasociated = rpcGeo->roll(*iteraRoll); //roll asociado a MB4
562  RPCDetId rpcId = rollasociated->id();
563  const BoundPlane & RPCSurfaceRB4 = rollasociated->surface(); //surface MB4
564 
565  // RPCGeomServ rpcsrv(rpcId);
566  // std::string nameRoll = rpcsrv.name();
567 
568  GlobalPoint CenterPointRollGlobal=RPCSurfaceRB4.toGlobal(LocalPoint(0,0,0));
569  LocalPoint CenterRollinMB4Frame = DTSurface4.toLocal(CenterPointRollGlobal); //In MB4
570  LocalPoint segmentPositionMB3inMB4Frame = DTSurface4.toLocal(segmentPositionMB3inGlobal); //In MB4
571  LocalPoint segmentPositionMB3inRB4Frame = RPCSurfaceRB4.toLocal(segmentPositionMB3inGlobal); //In MB4
572  LocalVector segmentDirectionMB3inMB4Frame = DTSurface4.toLocal(segDirMB3inGlobalFrame); //In MB4
573 
574  //The exptrapolation is done in MB4 frame. for local x and z is done from MB4,
575  float Dxz=CenterRollinMB4Frame.z();
576  float Xo4=segmentPositionMB4.x();
577  float dxl=segmentDirectionMB4.x(); //dx local for MB4 segment in MB4 Frame
578  float dzl=segmentDirectionMB4.z(); //dx local for MB4 segment in MB4 Frame
579 
580  float X=Xo4+dxl*Dxz/dzl; //In MB4 frame
581  float Z=Dxz;//In MB4 frame
582 
583  //for local y is done from MB3
584  float Yo34=segmentPositionMB3inMB4Frame.y();
585  float dy34 = segmentDirectionMB3inMB4Frame.y();
586  float dz34 = segmentDirectionMB3inMB4Frame.z();
587  float Dy=Dxz-(segmentPositionMB3inMB4Frame.z()); //Distance beetween the segment in MB3 and the RB4 surface
588 
589  float Y=Yo34+dy34*Dy/dz34;//In MB4 Frame
590 
591  const RectangularStripTopology* top_
592  =dynamic_cast<const RectangularStripTopology*>(&(rollasociated->topology())); //Topology roll asociated MB4
593  LocalPoint xmin = top_->localPosition(0.);
594  LocalPoint xmax = top_->localPosition((float)rollasociated->nstrips());
595  float rsize = fabs( xmax.x()-xmin.x() );
596  float stripl = top_->stripLength();
597  float stripw = top_->pitch();
598 
599  float extrapolatedDistance = sqrt((Y-Yo34)*(Y-Yo34)+Dy*Dy);
600 
601  if(extrapolatedDistance<=MaxDrb4){
602 
603  GlobalPoint GlobalPointExtrapolated = DTSurface4.toGlobal(LocalPoint(X,Y,Z));
604  LocalPoint PointExtrapolatedRPCFrame = RPCSurfaceRB4.toLocal(GlobalPointExtrapolated);
605 
606  if(fabs(PointExtrapolatedRPCFrame.z()) < 5. &&
607  fabs(PointExtrapolatedRPCFrame.x()) < rsize*0.5 &&
608  fabs(PointExtrapolatedRPCFrame.y()) < stripl*0.5){
609 
610  RPCDetId rollId = rollasociated->id();
611 
612  // RPCGeomServ rpcsrv(rollId);
613 // std::string nameRoll = rpcsrv.name();
614 // if(debug) std::cout<<"MB4 \t \t \t \t \t The RPCName is "<<nameRoll<<std::endl;
615  const float stripPredicted=
616  rollasociated->strip(LocalPoint(PointExtrapolatedRPCFrame.x(),PointExtrapolatedRPCFrame.y(),0.));
617 
618  if(debug) std::cout<<"MB4 \t \t \t \t Candidate (from DT Segment) STRIP---> "<<stripPredicted<< std::endl;
619  //--------- HISTOGRAM STRIP PREDICTED FROM DT MB4 -------------------
620 
621  std::map<std::string, MonitorElement*> meMap=meCollection[rollId.rawId()];
622 
623  meIdDT.str("");
624  meIdDT<<"ExpectedOccupancyFromDT_"<<rollId.rawId();
625  meMap[meIdDT.str()]->Fill(stripPredicted);
626  //-------------------------------------------------
627 
628 
629  //-------RecHitPart Just For Residual--------
630  int countRecHits = 0;
631  int cluSize = 0;
632  float minres = 3000.;
633 
634  if(debug) std::cout<<"MB4 \t \t \t \t Getting RecHits in Roll Asociated"<<std::endl;
635  typedef std::pair<RPCRecHitCollection::const_iterator, RPCRecHitCollection::const_iterator> rangeRecHits;
636  rangeRecHits recHitCollection = rpcHits->get(rollasociated->id());
638 
639  for (recHit = recHitCollection.first; recHit != recHitCollection.second ; recHit++) {
640  countRecHits++;
641  LocalPoint recHitPos=recHit->localPosition();
642  float res=PointExtrapolatedRPCFrame.x()- recHitPos.x();
643  if(debug) std::cout<<"DT \t \t \t \t \t Found Rec Hit at "<<res<<"cm of the prediction."<<std::endl;
644  if(fabs(res)<fabs(minres)){
645  minres=res;
646  cluSize = recHit->clusterSize();
647  }
648  }
649 
650  if(countRecHits==0){
651  if(debug) std::cout <<"MB4 \t \t \t \t \t \t THIS ROLL DOESN'T HAVE ANY RECHIT"<<std::endl;
652  }else{
653  assert(minres!=3000);
654 
655  if(fabs(minres)<=(rangestrips+cluSize*0.5)*stripw){
656  assert(rollId.station()==4);
657  if(cluSize==1*dupli){ hGlobalResClu1La[5]->Fill(minres);}
658  else if(cluSize==2*dupli){ hGlobalResClu2La[5]->Fill(minres);}
659  else if(cluSize==3*dupli){ hGlobalResClu3La[5]->Fill(minres);}
660 
661  meIdRPC.str("");
662  meIdRPC<<"RPCDataOccupancyFromDT_"<<rollId.rawId();
663  meMap[meIdRPC.str()]->Fill(stripPredicted);
664  }
665  }
666  }else{
667  if(debug) std::cout<<"MB4 \t \t \t \t No the prediction is outside of this roll"<<std::endl;
668  }
669  }//Condition for the right match
670  else{
671  if(debug) std::cout<<"MB4 \t \t \t No, Exrtrapolation too long!, canceled"<<std::endl;
672  }
673  }//loop over all the rollsasociated
674  }else{
675  compatiblesegments=false;
676  if(debug) std::cout<<"MB4 \t \t \t \t I found segments in MB4 and MB3 adjacent or same wheel and sector but not compatibles Diferent Directions"<<std::endl;
677  }
678  }else{//if dtid3.station()==3&&dtid3.sector()==DTId.sector()&&dtid3.wheel()==DTId.wheel()&&segMB3->dim()==4
679  if(debug) std::cout<<"MB4 \t \t \t No the same station or same wheel or segment dim in mb3 not 4D"<<std::endl;
680  }
681  }//loop over all the segments looking for one in MB3
682  }else{
683  if(debug) std::cout<<"MB4 \t \t \t Is NOT a 2D Segment"<<std::endl;
684  }
685  }else{
686  if(debug) std::cout<<"MB4 \t \t \t \t There is not just one segment or is not in station 4"<<std::endl;
687  }//De aca para abajo esta en dtpart.inl
688  }
689  }else{
690  if(debug) std::cout<<"MB4 \t This event doesn't have 4D Segment"<<std::endl;
691  }
692 
693  }
694 
695 
696  if(inclcsc){
697  if(debug) std::cout <<"\t Getting the CSC Segments"<<std::endl;
698  edm::Handle<CSCSegmentCollection> allCSCSegments;
699 
700  iEvent.getByLabel(cscSegments, allCSCSegments);
701 
702  if(allCSCSegments.isValid()){
703  if(allCSCSegments->size()>0){
704  statistics->Fill(18);
705 
706  if(debug) std::cout<<"CSC \t Number of CSC Segments in this event = "<<allCSCSegments->size()<<std::endl;
707 
708  std::map<CSCDetId,int> CSCSegmentsCounter;
710 
711  int segmentsInThisEventInTheEndcap=0;
712 
713  for (segment = allCSCSegments->begin();segment!=allCSCSegments->end(); ++segment){
714  CSCSegmentsCounter[segment->cscDetId()]++;
715  segmentsInThisEventInTheEndcap++;
716  }
717 
718  statistics->Fill(allCSCSegments->size()+18);
719 
720  if(debug) std::cout<<"CSC \t loop over all the CSCSegments "<<std::endl;
721  for (segment = allCSCSegments->begin();segment!=allCSCSegments->end(); ++segment){
722  CSCDetId CSCId = segment->cscDetId();
723 
724  if(CSCSegmentsCounter[CSCId]==1 && CSCId.station()!=4 && CSCId.ring()!=1 && allCSCSegments->size()>=2){
725  if(debug) std::cout<<"CSC \t \t yes"<<std::endl;
726  int cscEndCap = CSCId.endcap();
727  int cscStation = CSCId.station();
728  int cscRing = CSCId.ring();
729  // int cscChamber = CSCId.chamber();
730  int rpcRegion = 1; if(cscEndCap==2) rpcRegion= -1;//Relacion entre las endcaps
731  int rpcRing = cscRing;
732  if(cscRing==4)rpcRing =1;
733  int rpcStation = cscStation;
734  int rpcSegment = CSCId.chamber();
735 
736  LocalPoint segmentPosition= segment->localPosition();
737  LocalVector segmentDirection=segment->localDirection();
738  float dz=segmentDirection.z();
739 
740  if(debug) std::cout<<"CSC \t \t Is a good Segment? dim = 4, 4 <= nRecHits <= 10 Incident angle int range 45 < "<<acos(dz)*180/3.1415926<<" < 135? "<<std::endl;
741 
742  if(segment->dimension()==4 && (segment->nRecHits()<=10 && segment->nRecHits()>=4)&& acos(dz)*180/3.1415926 > 45. && acos(dz)*180/3.1415926 < 160. ){
743 
744  float Xo=segmentPosition.x();
745  float Yo=segmentPosition.y();
746  float Zo=segmentPosition.z();
747  float dx=segmentDirection.x();
748  float dy=segmentDirection.y();
749  float dz=segmentDirection.z();
750 
751 
752  if(debug) std::cout<<"CSC \t \t Getting chamber from Geometry"<<std::endl;
753  const CSCChamber* TheChamber=cscGeo->chamber(CSCId);
754  if(debug) std::cout<<"CSC \t \t Getting ID from Chamber"<<std::endl;
755  const CSCDetId TheId=TheChamber->id();
756  if(debug) std::cout<<"CSC \t \t Printing The Id"<<TheId<<std::endl;
757  std::set<RPCDetId> rollsForThisCSC = rollstoreCSC[CSCStationIndex(rpcRegion,rpcStation,rpcRing,rpcSegment)];
758  if(debug) std::cout<<"CSC \t \t Number of rolls for this CSC = "<<rollsForThisCSC.size()<<std::endl;
759 
760  if(rpcRing!=1&&rpcStation!=4){
761 
762  //Loop over all the rolls
763  for (std::set<RPCDetId>::iterator iteraRoll = rollsForThisCSC.begin();iteraRoll != rollsForThisCSC.end(); iteraRoll++){
764 
765  const RPCRoll* rollasociated = rpcGeo->roll(*iteraRoll);
766  RPCDetId rpcId = rollasociated->id();
767 
768  const BoundPlane & RPCSurface = rollasociated->surface();
769 
770  GlobalPoint CenterPointRollGlobal = RPCSurface.toGlobal(LocalPoint(0,0,0));
771  GlobalPoint CenterPointCSCGlobal = TheChamber->toGlobal(LocalPoint(0,0,0));
772  GlobalPoint segmentPositionInGlobal=TheChamber->toGlobal(segmentPosition); //new way to convert to global
773  LocalPoint CenterRollinCSCFrame = TheChamber->toLocal(CenterPointRollGlobal);
774 
775  float D=CenterRollinCSCFrame.z();
776 
777  float X=Xo+dx*D/dz;
778  float Y=Yo+dy*D/dz;
779  float Z=D;
780 
781  const TrapezoidalStripTopology* top_=dynamic_cast<const TrapezoidalStripTopology*>(&(rollasociated->topology()));
782  LocalPoint xmin = top_->localPosition(0.);
783  if(debug) std::cout<<"CSC \t \t \t xmin of this Roll "<<xmin<<"cm"<<std::endl;
784  LocalPoint xmax = top_->localPosition((float)rollasociated->nstrips());
785  if(debug) std::cout<<"CSC \t \t \t xmax of this Roll "<<xmax<<"cm"<<std::endl;
786  float rsize = fabs( xmax.x()-xmin.x() );
787  if(debug) std::cout<<"CSC \t \t \t Roll Size "<<rsize<<"cm"<<std::endl;
788  float stripl = top_->stripLength();
789  float stripw = top_->pitch();
790 
791 
792  float extrapolatedDistance = sqrt((X-Xo)*(X-Xo)+(Y-Yo)*(Y-Yo)+(Z-Zo)*(Z-Zo));
793 
794 
795  if(extrapolatedDistance<=MaxD){
796 
797  GlobalPoint GlobalPointExtrapolated=TheChamber->toGlobal(LocalPoint(X,Y,Z));
798  LocalPoint PointExtrapolatedRPCFrame = RPCSurface.toLocal(GlobalPointExtrapolated);
799 
800 
801  if(fabs(PointExtrapolatedRPCFrame.z()) < 10. &&
802  fabs(PointExtrapolatedRPCFrame.x()) < rsize*0.5 &&
803  fabs(PointExtrapolatedRPCFrame.y()) < stripl*0.5){
804 
805  RPCDetId rollId = rollasociated->id();
806  RPCGeomServ rpcsrv(rollId);
807  std::string nameRoll = rpcsrv.name();
808 
809  if(debug) std::cout<<"CSC \t \t \t \t The RPCName is "<<nameRoll<<std::endl;
810 
811  const float stripPredicted =
812  rollasociated->strip(LocalPoint(PointExtrapolatedRPCFrame.x(),PointExtrapolatedRPCFrame.y(),0.));
813 
814  if(debug) std::cout<<"CSC \t \t \t \t \t Candidate"<<rollId<<" "<<"(from CSC Segment) STRIP---> "<<stripPredicted<< std::endl;
815  //--------- HISTOGRAM STRIP PREDICTED FROM CSC -------------------
816 
817  std::map<std::string, MonitorElement*> meMap=meCollection[rpcId.rawId()];
818  meIdCSC.str("");
819  meIdCSC<<"ExpectedOccupancyFromCSC_"<<rollId.rawId();
820  meMap[meIdCSC.str()]->Fill(stripPredicted);
821  //--------------------------------------------------------------------
822 
823 
824  //-------RecHitPart Just For Residual--------
825  int cluSize = 0;
826  int countRecHits = 0;
827  float minres = 3000.;
828 
829  if(debug) std::cout<<"CSC \t \t \t \t \t Getting RecHits in Roll Asociated"<<std::endl;
830  typedef std::pair<RPCRecHitCollection::const_iterator, RPCRecHitCollection::const_iterator> rangeRecHits;
831  rangeRecHits recHitCollection = rpcHits->get(rollasociated->id());
833 
834  for (recHit = recHitCollection.first; recHit != recHitCollection.second ; recHit++) {
835 
836  countRecHits++;
837  LocalPoint recHitPos=recHit->localPosition();
838  float res=PointExtrapolatedRPCFrame.x()- recHitPos.x();
839  if(debug) std::cout<<"CSC \t \t \t \t \t \t Found Rec Hit at "<<res<<"cm of the prediction."<<std::endl;
840  if(fabs(res)<fabs(minres)){
841  minres=res;
842  cluSize = recHit->clusterSize();
843  if(debug) std::cout<<"CSC \t \t \t \t \t \t \t New Min Res "<<res<<"cm."<<std::endl;
844  }
845  }
846 
847  if(countRecHits==0){
848  if(debug) std::cout <<"CSC \t \t \t \t \t THIS ROLL DOESN'T HAVE ANY RECHIT"<<std::endl;
849  }else{
850  assert(minres!=3000);
851 
852  if(fabs(minres)<=(rangestrips+cluSize*0.5)*stripw){
853  if(debug) std::cout<<"CSC \t \t \t \t \t \t True!"<<std::endl;
854 
855  if(rollId.ring()==2&&rollId.roll()==1){
856  if(cluSize==1*dupli) hGlobalResClu1R2A->Fill(minres);
857  else if(cluSize==2*dupli) hGlobalResClu2R2A->Fill(minres);
858  else if(cluSize==3*dupli) hGlobalResClu3R2A->Fill(minres);
859  }
860  else if(rollId.ring()==2&&rollId.roll()==2){
861  if(cluSize==1*dupli) hGlobalResClu1R2B->Fill(minres);
862  else if(cluSize==2*dupli) hGlobalResClu2R2B->Fill(minres);
863  else if(cluSize==3*dupli) hGlobalResClu3R2B->Fill(minres);
864  }
865  else if(rollId.ring()==2&&rollId.roll()==3){
866  if(cluSize==1*dupli) hGlobalResClu1R2C->Fill(minres);
867  else if(cluSize==2*dupli) hGlobalResClu2R2C->Fill(minres);
868  else if(cluSize==3*dupli) hGlobalResClu3R2C->Fill(minres);
869  }
870  else if(rollId.ring()==3&&rollId.roll()==1){
871  if(cluSize==1*dupli) hGlobalResClu1R3A->Fill(minres);
872  else if(cluSize==2*dupli) hGlobalResClu2R3A->Fill(minres);
873  else if(cluSize==3*dupli) hGlobalResClu3R3A->Fill(minres);
874  }
875  else if(rollId.ring()==3&&rollId.roll()==2){
876  if(cluSize==1*dupli) hGlobalResClu1R3B->Fill(minres);
877  else if(cluSize==2*dupli) hGlobalResClu2R3B->Fill(minres);
878  else if(cluSize==3*dupli) hGlobalResClu3R3B->Fill(minres);
879  }
880  else if(rollId.ring()==3&&rollId.roll()==3){if(cluSize==1*dupli) hGlobalResClu1R3C->Fill(minres); if(cluSize==2*dupli) hGlobalResClu2R3C->Fill(minres); if(cluSize==3*dupli) hGlobalResClu3R3C->Fill(minres);
881  }
882  meIdRPC.str("");
883  meIdRPC<<"RPCDataOccupancyFromCSC_"<<rollId.rawId();
884  meMap[meIdRPC.str()]->Fill(stripPredicted);
885  }
886  }
887 
888  }else{
889  if(debug) std::cout<<"CSC \t \t \t \t No the prediction is outside of this roll"<<std::endl;
890  }//Condition for the right match
891  }else{//if extrapolation distance D is not too long
892  if(debug) std::cout<<"CSC \t \t \t No, Exrtrapolation too long!, canceled"<<std::endl;
893  }//D so big
894  }//loop over the rolls asociated
895  }//Condition over the startup geometry!!!!
896  }//Is the segment 4D?
897  }else{
898  if(debug) std::cout<<"CSC \t \t More than one segment in this chamber, or we are in Station Ring 1 or in Station 4"<<std::endl;
899  }
900  }
901  }else{
902  if(debug) std::cout<<"CSC This Event doesn't have any CSCSegment"<<std::endl;
903  }
904  }
905  }
906 
907 }
908 
909 
910 void RPCEfficiency::endRun(const edm::Run& r, const edm::EventSetup& iSetup){
911  if (EffSaveRootFile){
913  }
914 }
915 
916 
918  dbe =0;
919 }
const double Z[kNumberCalorimeter]
int chamber() const
Definition: CSCDetId.h:70
GlobalPoint toGlobal(const Point2DBase< Scalar, LocalTag > lp) const
Definition: Surface.h:78
T getParameter(std::string const &) const
float strip(const LocalPoint &lp) const
Definition: RPCRoll.cc:71
T getUntrackedParameter(std::string const &, T const &) const
const Topology & topology() const
Definition: RPCRoll.cc:30
virtual void endJob()
int distsector_tmp(int sector1, int sector2)
MonitorElement * hGlobalResClu1R2A
virtual float stripLength() const
RPCEfficiency(const edm::ParameterSet &)
CSCDetId id() const
Get the (concrete) DetId.
Definition: CSCChamber.h:37
MonitorElement * hGlobalResClu1R3A
GlobalPoint toGlobal(const Local2DPoint &lp) const
Conversion to the global R.F. from the R.F. of the GeomDet.
Definition: GeomDet.h:49
void save(const std::string &filename, const std::string &path="", const std::string &pattern="", const std::string &rewrite="", SaveReferenceTag ref=SaveWithReference, int minStatus=dqm::qstatus::STATUS_OK, const std::string &fileupdate="RECREATE")
Definition: DQMStore.cc:1898
int nstrips() const
Definition: RPCRoll.cc:46
MonitorElement * hGlobalResClu3R2C
MonitorElement * hGlobalResClu2La[6]
T y() const
Definition: PV3DBase.h:57
#define X(str)
Definition: MuonsGrabber.cc:49
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)
#define abs(x)
Definition: mlp_lapack.h:159
MonitorElement * hGlobalResClu3R3C
LocalPoint toLocal(const GlobalPoint &gp) const
Conversion to the R.F. of the GeomDet.
Definition: GeomDet.h:64
virtual void beginJob()
std::map< int, std::map< std::string, MonitorElement * > > meCollection
edm::InputTag dt4DSegments
void Fill(long long x)
uint32_t rawId() const
get the raw id
Definition: DetId.h:45
int endcap() const
Definition: CSCDetId.h:95
DQMStore * dbe
C::const_iterator const_iterator
constant access iterator type
Definition: RangeMap.h:46
std::string EffRootFileName
RPCDetId id() const
Definition: RPCRoll.cc:24
int iEvent
Definition: GenABIO.cc:243
virtual std::string name()
Definition: RPCGeomServ.cc:15
int roll() const
Definition: RPCDetId.h:122
MonitorElement * hGlobalResClu3La[6]
void bookDetUnitSeg(RPCDetId &detId, int nstrips, std::string folder, std::map< std::string, MonitorElement * > &)
virtual void endRun(const edm::Run &r, const edm::EventSetup &iSetup)
int ring() const
Definition: RPCDetId.h:74
T sqrt(T t)
Definition: SSEVec.h:28
LocalPoint toLocal(const GlobalPoint &gp) const
std::string folderPath
T z() const
Definition: PV3DBase.h:58
MonitorElement * hGlobalResClu3R2A
const std::vector< const RPCRoll * > & rolls() const
Return the Rolls.
Definition: RPCChamber.cc:70
double rangestripsRB4
MonitorElement * hGlobalResClu1R3B
MonitorElement * hGlobalResClu1R2C
MonitorElement * hGlobalResClu2R3C
MonitorElement * hGlobalResClu3R3A
bool isValid() const
Definition: HandleBase.h:76
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:355
std::map< CSCStationIndex, std::set< RPCDetId > > rollstoreCSC
MonitorElement * statistics
std::map< DTStationIndex, std::set< RPCDetId > > rollstoreDT
int ring() const
Definition: CSCDetId.h:77
int layer() const
Definition: RPCDetId.h:110
virtual int segment()
Definition: RPCGeomServ.cc:467
MonitorElement * hGlobalResClu2R2A
edm::InputTag cscSegments
MonitorElement * hGlobalResClu2R3A
const T & get() const
Definition: EventSetup.h:55
edm::InputTag RPCRecHitLabel_
MonitorElement * hGlobalResClu1La[6]
virtual LocalPoint localPosition(float strip) const
int sector() const
Sector id: the group of chambers at same phi (and increasing r)
Definition: RPCDetId.h:104
double rangestrips
int sector() const
Definition: DTChamberId.h:63
Local3DPoint LocalPoint
Definition: LocalPoint.h:11
virtual void analyze(const edm::Event &, const edm::EventSetup &)
int station() const
Definition: CSCDetId.h:88
tuple cout
Definition: gather_cfg.py:41
MonitorElement * hGlobalResClu1R3C
MonitorElement * hGlobalResClu2R2B
virtual LocalPoint localPosition(float strip) const
int station() const
Return the station number.
Definition: DTChamberId.h:53
MonitorElement * hGlobalResClu3R3B
int wheel() const
Return the wheel number.
Definition: DTChamberId.h:47
T x() const
Definition: PV3DBase.h:56
virtual void beginRun(const edm::Run &, const edm::EventSetup &)
virtual float stripLength() const
det heigth (strip length in the middle)
DecomposeProduct< arg, typename Div::arg > D
Definition: Factorize.h:150
virtual const BoundPlane & surface() const
The nominal surface of the GeomDet.
Definition: GeomDet.h:37
MonitorElement * hGlobalResClu3R2B
MonitorElement * hGlobalResClu2R3B
MonitorElement * hGlobalResClu1R2B
MonitorElement * hGlobalResClu2R2C
Definition: Run.h:32
int region() const
Region id: 0 for Barrel, +/-1 For +/- Endcap.
Definition: RPCDetId.h:65
int station() const
Definition: RPCDetId.h:98