25 if(sector1==13) sector1=4;
26 if(sector1==14) sector1=10;
28 if(sector2==13) sector2=4;
29 if(sector2==14) sector2=10;
31 int distance =
abs(sector1 - sector2);
32 if(distance>6) distance = 12-distance;
67 dbe->setCurrentFolder(folderPath);
68 statistics = dbe->book1D(
"Statistics",
"All Statistics",33,0.5,33.5);
104 if(debug)
std::cout<<
"booking Global histograms with "<<folderPath<<std::endl;
106 folder = folderPath+
"MuonSegEff/"+
"Residuals/Barrel";
107 dbe->setCurrentFolder(folder);
110 std::stringstream histoName, histoTitle;
112 for (
int layer = 1 ; layer<= 6 ;layer++){
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.);
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.);
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.);
133 if(debug)
std::cout<<
"Booking Residuals for EndCap"<<std::endl;
134 folder = folderPath+
"MuonSegEff/Residuals/EndCap";
135 dbe->setCurrentFolder(folder);
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.);
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.);
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.);
168 for (TrackingGeometry::DetContainer::const_iterator it=rpcGeo->dets().begin();it<rpcGeo->dets().end();it++){
169 if(dynamic_cast< RPCChamber* >( *it ) != 0 ){
171 std::vector< const RPCRoll*> roles = (ch->
rolls());
172 for(std::vector<const RPCRoll*>::const_iterator
r = roles.begin();
r != roles.end(); ++
r){
175 int region=rpcId.
region();
186 int wheel=rpcId.
ring();
187 int sector=rpcId.
sector();
190 std::set<RPCDetId> myrolls;
192 myrolls.insert(rpcId);
195 }
else if(region!=0 &&
inclcsc){
201 int rpcsegment = rpcsrv.
segment();
202 int cscchamber = rpcsegment;
203 if((station==2||station==3)&&ring==3){
208 std::set<RPCDetId> myrolls;
212 myrolls.insert(rpcId);
218 for (TrackingGeometry::DetContainer::const_iterator it=rpcGeo->dets().begin();it<rpcGeo->dets().end();it++){
219 if( dynamic_cast< RPCChamber* >( *it ) != 0 ){
222 std::vector< const RPCRoll*> roles = (ch->
rolls());
223 for(std::vector<const RPCRoll*>::const_iterator
r = roles.begin();
r != roles.end(); ++
r){
226 int region=rpcId.
region();
229 int region=rpcId.
region();
234 if((station==2||station==3)&&ring==3) cscring = 2;
239 int rpcsegment = rpcsrv.
segment();
241 int cscchamber = rpcsegment+1;
242 if(cscchamber==37)cscchamber=1;
244 std::set<RPCDetId> myrolls;
246 myrolls.insert(rpcId);
249 cscchamber = rpcsegment-1;
250 if(cscchamber==0)cscchamber=36;
252 std::set<RPCDetId> myrollsDos;
254 myrollsDos.insert(rpcId);
277 std::stringstream meIdRPC, meIdDT, meIdCSC;
293 if(all4DSegments->size()>0){
297 if(
debug)
std::cout<<
"\t Number of DT Segments in this event = "<<all4DSegments->size()<<std::endl;
299 std::map<DTChamberId,int> DTSegmentCounter;
302 for (segment = all4DSegments->begin();segment!=all4DSegments->end(); ++segment){
303 DTSegmentCounter[segment->chamberId()]++;
308 if(
debug)
std::cout<<
"\t Loop over all the 4D Segments"<<std::endl;
309 for (segment = all4DSegments->begin(); segment != all4DSegments->end(); ++segment){
314 if(DTSegmentCounter[DTId]==1 && DTId.
station()!=4){
316 int dtWheel = DTId.
wheel();
317 int dtStation = DTId.
station();
318 int dtSector = DTId.
sector();
320 LocalPoint segmentPosition= segment->localPosition();
321 LocalVector segmentDirection=segment->localDirection();
323 const GeomDet* gdet=dtGeo->idToDet(segment->geographicalId());
328 if(segment->dimension()==4){
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();
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);
350 LocalPoint CenterRollinDTFrame = DTSurface.toLocal(CenterPointRollGlobal);
352 float D=CenterRollinDTFrame.
z();
358 const RectangularStripTopology* top_=
dynamic_cast<const RectangularStripTopology*
> (&(rollasociated->
topology()));
360 if(
debug)
std::cout<<
"DT \t \t \t xmin of this Roll "<<xmin<<
"cm"<<std::endl;
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();
368 float extrapolatedDistance =
sqrt((X-Xo)*(X-Xo)+(Y-Yo)*(Y-Yo)+(Z-Zo)*(Z-Zo));
370 if(extrapolatedDistance<=
MaxD){
373 LocalPoint PointExtrapolatedRPCFrame = RPCSurface.toLocal(GlobalPointExtrapolated);
375 if(fabs(PointExtrapolatedRPCFrame.
z()) < 10. &&
376 fabs(PointExtrapolatedRPCFrame.
x()) < rsize*0.5 &&
377 fabs(PointExtrapolatedRPCFrame.
y()) < stripl*0.5){
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.));
386 if(
debug)
std::cout<<
"DT \t \t \t \t Candidate (from DT Segment) STRIP---> "<<stripPredicted<< std::endl;
391 meIdDT<<
"ExpectedOccupancyFromDT_"<<rollId.
rawId();
392 meMap[meIdDT.str()]->Fill(stripPredicted);
397 int countRecHits = 0;
399 float minres = 3000.;
401 typedef std::pair<RPCRecHitCollection::const_iterator, RPCRecHitCollection::const_iterator> rangeRecHits;
402 rangeRecHits recHitCollection = rpcHits->get(rollasociated->
id());
405 for (recHit = recHitCollection.first; recHit != recHitCollection.second ; recHit++) {
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)){
416 cluSize = recHit->clusterSize();
417 if(
debug)
std::cout<<
"DT \t \t \t \t \t \t New Min Res "<<res<<
"cm."<<std::endl;
422 if(
debug)
std::cout <<
"DT \t \t \t \t \t THIS ROLL DOESN'T HAVE ANY RECHIT"<<std::endl;
424 assert(minres!=3000);
426 if(fabs(minres)<=(
rangestrips+cluSize*0.5)*stripw){
455 meIdRPC<<
"RPCDataOccupancyFromDT_"<<rollId.
rawId();
456 meMap[meIdRPC.str()]->Fill(stripPredicted);
460 if(
debug)
std::cout<<
"DT \t \t \t \t No the prediction is outside of this roll"<<std::endl;
463 if(
debug)
std::cout<<
"DT \t \t \t No, Exrtrapolation too long!, canceled"<<std::endl;
468 if(
debug)
std::cout<<
"DT \t \t More than one segment in this chamber, or we are in Station 4"<<std::endl;
472 if(
debug)
std::cout<<
"DT This Event doesn't have any DT4DDSegment"<<std::endl;
481 if(all4DSegments.
isValid() && all4DSegments->size()>0){
483 std::map<DTChamberId,int> DTSegmentCounter;
486 for (segment = all4DSegments->begin();segment!=all4DSegments->end(); ++segment){
487 DTSegmentCounter[segment->chamberId()]++;
490 if(
debug)
std::cout<<
"MB4 \t \t Loop Over all4DSegments"<<std::endl;
491 for (segment = all4DSegments->begin(); segment != all4DSegments->end(); ++segment){
495 if(DTSegmentCounter[DTId] == 1 && DTId.
station()==4){
496 int dtWheel = DTId.
wheel();
497 int dtStation = DTId.
station();
498 int dtSector = DTId.
sector();
500 LocalPoint segmentPosition= segment->localPosition();
501 LocalVector segmentDirection=segment->localDirection();
505 if(segment->dimension()==2){
507 LocalPoint segmentPositionMB4=segmentPosition;
510 const BoundPlane& DTSurface4 = dtGeo->idToDet(DTId)->surface();
514 for(segMB3=all4DSegments->begin();segMB3!=all4DSegments->end();++segMB3){
521 && DTSegmentCounter[dtid3] == 1
522 && segMB3->dimension()==4){
524 const GeomDet* gdet3=dtGeo->idToDet(segMB3->geographicalId());
527 LocalVector segmentDirectionMB3 = segMB3->localDirection();
528 GlobalPoint segmentPositionMB3inGlobal = DTSurface3.toGlobal(segMB3->localPosition());
530 GlobalVector segDirMB4inGlobalFrame=DTSurface4.toGlobal(segmentDirectionMB4);
531 GlobalVector segDirMB3inGlobalFrame=DTSurface3.toGlobal(segmentDirectionMB3);
533 float dx=segDirMB4inGlobalFrame.
x();
534 float dy=segDirMB4inGlobalFrame.
y();
537 float dx3=segDirMB3inGlobalFrame.
x();
538 float dy3=segDirMB3inGlobalFrame.
y();
541 double cosAng=fabs(dx*dx3+dy*dy3/
sqrt((dx3*dx3+dy3*dy3)*(dx*dx+dy*dy)));
553 assert(rollsForThisDT.size()>=1);
555 for (std::set<RPCDetId>::iterator iteraRoll=rollsForThisDT.begin();iteraRoll != rollsForThisDT.end(); iteraRoll++){
556 const RPCRoll* rollasociated = rpcGeo->roll(*iteraRoll);
563 LocalPoint CenterRollinMB4Frame = DTSurface4.toLocal(CenterPointRollGlobal);
564 LocalPoint segmentPositionMB3inMB4Frame = DTSurface4.toLocal(segmentPositionMB3inGlobal);
565 LocalVector segmentDirectionMB3inMB4Frame = DTSurface4.toLocal(segDirMB3inGlobalFrame);
568 float Dxz=CenterRollinMB4Frame.
z();
569 float Xo4=segmentPositionMB4.
x();
570 float dxl=segmentDirectionMB4.
x();
571 float dzl=segmentDirectionMB4.
z();
573 float X=Xo4+dxl*Dxz/dzl;
577 float Yo34=segmentPositionMB3inMB4Frame.
y();
578 float dy34 = segmentDirectionMB3inMB4Frame.
y();
579 float dz34 = segmentDirectionMB3inMB4Frame.
z();
580 float Dy=Dxz-(segmentPositionMB3inMB4Frame.
z());
582 float Y=Yo34+dy34*Dy/dz34;
584 const RectangularStripTopology* top_
585 =
dynamic_cast<const RectangularStripTopology*
>(&(rollasociated->
topology()));
588 float rsize = fabs( xmax.
x()-xmin.
x() );
589 float stripl = top_->stripLength();
590 float stripw = top_->pitch();
592 float extrapolatedDistance =
sqrt((Y-Yo34)*(Y-Yo34)+Dy*Dy);
594 if(extrapolatedDistance<=
MaxDrb4){
597 LocalPoint PointExtrapolatedRPCFrame = RPCSurfaceRB4.toLocal(GlobalPointExtrapolated);
599 if(fabs(PointExtrapolatedRPCFrame.
z()) < 5. &&
600 fabs(PointExtrapolatedRPCFrame.
x()) < rsize*0.5 &&
601 fabs(PointExtrapolatedRPCFrame.
y()) < stripl*0.5){
608 const float stripPredicted=
609 rollasociated->
strip(
LocalPoint(PointExtrapolatedRPCFrame.
x(),PointExtrapolatedRPCFrame.
y(),0.));
611 if(
debug)
std::cout<<
"MB4 \t \t \t \t Candidate (from DT Segment) STRIP---> "<<stripPredicted<< std::endl;
617 meIdDT<<
"ExpectedOccupancyFromDT_"<<rollId.
rawId();
618 meMap[meIdDT.str()]->Fill(stripPredicted);
623 int countRecHits = 0;
625 float minres = 3000.;
627 if(
debug)
std::cout<<
"MB4 \t \t \t \t Getting RecHits in Roll Asociated"<<std::endl;
628 typedef std::pair<RPCRecHitCollection::const_iterator, RPCRecHitCollection::const_iterator> rangeRecHits;
629 rangeRecHits recHitCollection = rpcHits->get(rollasociated->
id());
632 for (recHit = recHitCollection.first; recHit != recHitCollection.second ; recHit++) {
635 float res=PointExtrapolatedRPCFrame.
x()- recHitPos.
x();
636 if(
debug)
std::cout<<
"DT \t \t \t \t \t Found Rec Hit at "<<res<<
"cm of the prediction."<<std::endl;
637 if(fabs(res)<fabs(minres)){
639 cluSize = recHit->clusterSize();
644 if(
debug)
std::cout <<
"MB4 \t \t \t \t \t \t THIS ROLL DOESN'T HAVE ANY RECHIT"<<std::endl;
646 assert(minres!=3000);
648 if(fabs(minres)<=(
rangestrips+cluSize*0.5)*stripw){
655 meIdRPC<<
"RPCDataOccupancyFromDT_"<<rollId.
rawId();
656 meMap[meIdRPC.str()]->Fill(stripPredicted);
660 if(
debug)
std::cout<<
"MB4 \t \t \t \t No the prediction is outside of this roll"<<std::endl;
664 if(
debug)
std::cout<<
"MB4 \t \t \t No, Exrtrapolation too long!, canceled"<<std::endl;
668 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;
671 if(
debug)
std::cout<<
"MB4 \t \t \t No the same station or same wheel or segment dim in mb3 not 4D"<<std::endl;
675 if(
debug)
std::cout<<
"MB4 \t \t \t Is NOT a 2D Segment"<<std::endl;
678 if(
debug)
std::cout<<
"MB4 \t \t \t \t There is not just one segment or is not in station 4"<<std::endl;
682 if(
debug)
std::cout<<
"MB4 \t This event doesn't have 4D Segment"<<std::endl;
695 if(allCSCSegments->size()>0){
698 if(
debug)
std::cout<<
"CSC \t Number of CSC Segments in this event = "<<allCSCSegments->size()<<std::endl;
700 std::map<CSCDetId,int> CSCSegmentsCounter;
703 int segmentsInThisEventInTheEndcap=0;
705 for (segment = allCSCSegments->begin();segment!=allCSCSegments->end(); ++segment){
706 CSCSegmentsCounter[segment->cscDetId()]++;
707 segmentsInThisEventInTheEndcap++;
712 if(
debug)
std::cout<<
"CSC \t loop over all the CSCSegments "<<std::endl;
713 for (segment = allCSCSegments->begin();segment!=allCSCSegments->end(); ++segment){
714 CSCDetId CSCId = segment->cscDetId();
716 if(CSCSegmentsCounter[CSCId]==1 && CSCId.
station()!=4 && CSCId.
ring()!=1 && allCSCSegments->size()>=2){
718 int cscEndCap = CSCId.
endcap();
719 int cscStation = CSCId.
station();
720 int cscRing = CSCId.
ring();
722 int rpcRegion = 1;
if(cscEndCap==2) rpcRegion= -1;
723 int rpcRing = cscRing;
724 if(cscRing==4)rpcRing =1;
725 int rpcStation = cscStation;
726 int rpcSegment = CSCId.
chamber();
728 LocalPoint segmentPosition= segment->localPosition();
729 LocalVector segmentDirection=segment->localDirection();
730 float dz=segmentDirection.
z();
732 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;
734 if(segment->dimension()==4 && (segment->nRecHits()<=10 && segment->nRecHits()>=4)&& acos(dz)*180/3.1415926 > 45. && acos(dz)*180/3.1415926 < 160. ){
736 float Xo=segmentPosition.
x();
737 float Yo=segmentPosition.
y();
738 float Zo=segmentPosition.
z();
739 float dx=segmentDirection.
x();
740 float dy=segmentDirection.
y();
741 float dz=segmentDirection.
z();
744 if(
debug)
std::cout<<
"CSC \t \t Getting chamber from Geometry"<<std::endl;
745 const CSCChamber* TheChamber=cscGeo->chamber(CSCId);
746 if(
debug)
std::cout<<
"CSC \t \t Getting ID from Chamber"<<std::endl;
748 if(
debug)
std::cout<<
"CSC \t \t Printing The Id"<<TheId<<std::endl;
750 if(
debug)
std::cout<<
"CSC \t \t Number of rolls for this CSC = "<<rollsForThisCSC.size()<<std::endl;
752 if(rpcRing!=1&&rpcStation!=4){
755 for (std::set<RPCDetId>::iterator iteraRoll = rollsForThisCSC.begin();iteraRoll != rollsForThisCSC.end(); iteraRoll++){
757 const RPCRoll* rollasociated = rpcGeo->roll(*iteraRoll);
765 float D=CenterRollinCSCFrame.
z();
771 const TrapezoidalStripTopology* top_=
dynamic_cast<const TrapezoidalStripTopology*
>(&(rollasociated->
topology()));
773 if(
debug)
std::cout<<
"CSC \t \t \t xmin of this Roll "<<xmin<<
"cm"<<std::endl;
775 if(
debug)
std::cout<<
"CSC \t \t \t xmax of this Roll "<<xmax<<
"cm"<<std::endl;
776 float rsize = fabs( xmax.
x()-xmin.
x() );
777 if(
debug)
std::cout<<
"CSC \t \t \t Roll Size "<<rsize<<
"cm"<<std::endl;
778 float stripl = top_->stripLength();
779 float stripw = top_->pitch();
782 float extrapolatedDistance =
sqrt((X-Xo)*(X-Xo)+(Y-Yo)*(Y-Yo)+(Z-Zo)*(Z-Zo));
785 if(extrapolatedDistance<=
MaxD){
788 LocalPoint PointExtrapolatedRPCFrame = RPCSurface.toLocal(GlobalPointExtrapolated);
791 if(fabs(PointExtrapolatedRPCFrame.
z()) < 10. &&
792 fabs(PointExtrapolatedRPCFrame.
x()) < rsize*0.5 &&
793 fabs(PointExtrapolatedRPCFrame.
y()) < stripl*0.5){
799 if(
debug)
std::cout<<
"CSC \t \t \t \t The RPCName is "<<nameRoll<<std::endl;
801 const float stripPredicted =
802 rollasociated->
strip(
LocalPoint(PointExtrapolatedRPCFrame.
x(),PointExtrapolatedRPCFrame.
y(),0.));
804 if(
debug)
std::cout<<
"CSC \t \t \t \t \t Candidate"<<rollId<<
" "<<
"(from CSC Segment) STRIP---> "<<stripPredicted<< std::endl;
809 meIdCSC<<
"ExpectedOccupancyFromCSC_"<<rollId.
rawId();
810 meMap[meIdCSC.str()]->Fill(stripPredicted);
816 int countRecHits = 0;
817 float minres = 3000.;
819 if(
debug)
std::cout<<
"CSC \t \t \t \t \t Getting RecHits in Roll Asociated"<<std::endl;
820 typedef std::pair<RPCRecHitCollection::const_iterator, RPCRecHitCollection::const_iterator> rangeRecHits;
821 rangeRecHits recHitCollection = rpcHits->get(rollasociated->
id());
824 for (recHit = recHitCollection.first; recHit != recHitCollection.second ; recHit++) {
828 float res=PointExtrapolatedRPCFrame.
x()- recHitPos.
x();
829 if(
debug)
std::cout<<
"CSC \t \t \t \t \t \t Found Rec Hit at "<<res<<
"cm of the prediction."<<std::endl;
830 if(fabs(res)<fabs(minres)){
832 cluSize = recHit->clusterSize();
833 if(
debug)
std::cout<<
"CSC \t \t \t \t \t \t \t New Min Res "<<res<<
"cm."<<std::endl;
838 if(
debug)
std::cout <<
"CSC \t \t \t \t \t THIS ROLL DOESN'T HAVE ANY RECHIT"<<std::endl;
840 assert(minres!=3000);
842 if(fabs(minres)<=(
rangestrips+cluSize*0.5)*stripw){
845 if(rollId.
ring()==2&&rollId.
roll()==1){
850 else if(rollId.
ring()==2&&rollId.
roll()==2){
855 else if(rollId.
ring()==2&&rollId.
roll()==3){
860 else if(rollId.
ring()==3&&rollId.
roll()==1){
865 else if(rollId.
ring()==3&&rollId.
roll()==2){
873 meIdRPC<<
"RPCDataOccupancyFromCSC_"<<rollId.
rawId();
874 meMap[meIdRPC.str()]->Fill(stripPredicted);
879 if(
debug)
std::cout<<
"CSC \t \t \t \t No the prediction is outside of this roll"<<std::endl;
882 if(
debug)
std::cout<<
"CSC \t \t \t No, Exrtrapolation too long!, canceled"<<std::endl;
888 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;
892 if(
debug)
std::cout<<
"CSC This Event doesn't have any CSCSegment"<<std::endl;
const double Z[kNumberCalorimeter]
T getParameter(std::string const &) const
float strip(const LocalPoint &lp) const
T getUntrackedParameter(std::string const &, T const &) const
const Topology & topology() const
int distsector_tmp(int sector1, int sector2)
MonitorElement * hGlobalResClu1R2A
RPCEfficiency(const edm::ParameterSet &)
CSCDetId id() const
Get the (concrete) DetId.
MonitorElement * hGlobalResClu1R3A
GlobalPoint toGlobal(const Local2DPoint &lp) const
Conversion to the global R.F. from the R.F. of the GeomDet.
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")
MonitorElement * hGlobalResClu3R2C
MonitorElement * hGlobalResClu2La[6]
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 * hGlobalResClu3R3C
LocalPoint toLocal(const GlobalPoint &gp) const
Conversion to the R.F. of the GeomDet.
std::map< int, std::map< std::string, MonitorElement * > > meCollection
const Plane & surface() const
The nominal surface of the GeomDet.
edm::InputTag dt4DSegments
uint32_t rawId() const
get the raw id
C::const_iterator const_iterator
constant access iterator type
std::string EffRootFileName
virtual std::string name()
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)
MonitorElement * hGlobalResClu3R2A
const std::vector< const RPCRoll * > & rolls() const
Return the Rolls.
MonitorElement * hGlobalResClu1R3B
MonitorElement * hGlobalResClu1R2C
MonitorElement * hGlobalResClu2R3C
MonitorElement * hGlobalResClu3R3A
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
std::map< CSCStationIndex, std::set< RPCDetId > > rollstoreCSC
MonitorElement * statistics
std::map< DTStationIndex, std::set< RPCDetId > > rollstoreDT
MonitorElement * hGlobalResClu2R2A
edm::InputTag cscSegments
MonitorElement * hGlobalResClu2R3A
edm::InputTag RPCRecHitLabel_
MonitorElement * hGlobalResClu1La[6]
int sector() const
Sector id: the group of chambers at same phi (and increasing r)
virtual void analyze(const edm::Event &, const edm::EventSetup &)
MonitorElement * hGlobalResClu1R3C
MonitorElement * hGlobalResClu2R2B
int station() const
Return the station number.
MonitorElement * hGlobalResClu3R3B
int wheel() const
Return the wheel number.
virtual void beginRun(const edm::Run &, const edm::EventSetup &)
DecomposeProduct< arg, typename Div::arg > D
MonitorElement * hGlobalResClu3R2B
MonitorElement * hGlobalResClu2R3B
MonitorElement * hGlobalResClu1R2B
MonitorElement * hGlobalResClu2R2C
int region() const
Region id: 0 for Barrel, +/-1 For +/- Endcap.