@@ -182,18 +182,13 @@ void RPCRecHitValid::bookHistograms(DQMStore::IBooker &booker, edm::Run const &r
182182 if (!roll)
183183 continue ;
184184
185- // RPCGeomServ rpcSrv(roll->id());
186185 const int rawId = roll->geographicalId ().rawId ();
187- // if ( !roll->specs()->isRPC() ) { cout << "\nNoRPC : " << rpcSrv.name()
188- // << ' ' << rawId << endl; continue; }
189186
190187 if (roll->isBarrel ()) {
191188 detIdToIndexMapBarrel_[rawId] = nRPCRollBarrel;
192- // rollIdToNameMapBarrel_[rawId] = rpcSrv.name();
193189 ++nRPCRollBarrel;
194190 } else {
195191 detIdToIndexMapEndcap_[rawId] = nRPCRollEndcap;
196- // rollIdToNameMapEndcap_[rawId] = rpcSrv.name();
197192 ++nRPCRollEndcap;
198193 }
199194 }
@@ -244,10 +239,6 @@ void RPCRecHitValid::bookHistograms(DQMStore::IBooker &booker, edm::Run const &r
244239 const RPCDetId rpcDetId = static_cast <const RPCDetId>(rawId);
245240 const RPCRoll *roll = dynamic_cast <const RPCRoll *>(rpcGeom->roll (rpcDetId));
246241
247- // RPCGeomServ rpcSrv(roll->id());
248- // if ( !roll->specs()->isRPC() ) { cout << "\nNoRPC : " << rpcSrv.name() <<
249- // ' ' << rawId << endl; continue; }
250-
251242 const StripTopology &topol = roll->specificTopology ();
252243 const double area = topol.stripLength () * topol.nstrips () * topol.pitch ();
253244
@@ -261,10 +252,6 @@ void RPCRecHitValid::bookHistograms(DQMStore::IBooker &booker, edm::Run const &r
261252 const RPCDetId rpcDetId = static_cast <const RPCDetId>(rawId);
262253 const RPCRoll *roll = dynamic_cast <const RPCRoll *>(rpcGeom->roll (rpcDetId));
263254
264- // RPCGeomServ rpcSrv(roll->id());
265- // if ( !roll->specs()->isRPC() ) { cout << "\nNoRPC : " << rpcSrv.name() <<
266- // ' ' << rawId << endl; continue; }
267-
268255 const StripTopology &topol = roll->specificTopology ();
269256 const double area = topol.stripLength () * topol.nstrips () * topol.pitch ();
270257
@@ -318,7 +305,7 @@ void RPCRecHitValid::analyze(const edm::Event &event, const edm::EventSetup &eve
318305 typedef std::vector<TrackPSimHitRef> SimHitRefs;
319306
320307 // TrackingParticles with (and without) RPC simHits
321- SimHitRefs muonSimHits, pthrSimHits ;
308+ SimHitRefs muonSimHits;
322309
323310 for (int i = 0 , n = simParticleHandle->size (); i < n; ++i) {
324311 TrackingParticleRef simParticle (simParticleHandle, i);
@@ -349,8 +336,8 @@ void RPCRecHitValid::analyze(const edm::Event &event, const edm::EventSetup &eve
349336 int nRPCHitBarrel = 0 ;
350337 int nRPCHitEndcap = 0 ;
351338 for (const auto &simHit : simHitsFromParticle) {
352- const RPCDetId rpcDetId = static_cast < const RPCDetId>( simHit->detUnitId ()) ;
353- const RPCRoll *roll = dynamic_cast < const RPCRoll *>( rpcGeom->roll (rpcDetId) );
339+ const RPCDetId rpcDetId{ simHit->detUnitId ()} ;
340+ const RPCRoll *roll = rpcGeom->roll (rpcDetId);
354341 if (!roll)
355342 continue ;
356343
@@ -431,10 +418,7 @@ void RPCRecHitValid::analyze(const edm::Event &event, const edm::EventSetup &eve
431418
432419 const int region = roll->id ().region ();
433420 const int ring = roll->id ().ring ();
434- // const int sector = roll->id().sector();
435421 const int station = roll->id ().station ();
436- // const int layer = roll->id().layer();
437- // const int subSector = roll->id().subsector();
438422
439423 if (region == 0 ) {
440424 ++nRefHitBarrel;
@@ -466,10 +450,7 @@ void RPCRecHitValid::analyze(const edm::Event &event, const edm::EventSetup &eve
466450
467451 const int region = roll->id ().region ();
468452 const int ring = roll->id ().ring ();
469- // const int sector = roll->id().sector();
470453 const int station = roll->id ().station ();
471- // const int layer = roll->id().layer();
472- // const int subSector = roll->id().subsector();
473454
474455 const double time = recHitIter->timeError () >= 0 ? recHitIter->time () : recHitIter->BunchX () * 25 ;
475456
@@ -524,15 +505,13 @@ void RPCRecHitValid::analyze(const edm::Event &event, const edm::EventSetup &eve
524505 SimToRecHitMap simToRecHitMap;
525506
526507 for (const auto &simHit : muonSimHits) {
527- const RPCDetId simDetId = static_cast <const RPCDetId>(simHit->detUnitId ());
528- // const RPCRoll* simRoll = dynamic_cast<const
529- // RPCRoll*>(rpcGeom->roll(simDetId));
508+ const RPCDetId simDetId{simHit->detUnitId ()};
530509
531510 const double simX = simHit->localPosition ().x ();
532511
533512 for (RecHitIter recHitIter = recHitHandle->begin (); recHitIter != recHitHandle->end (); ++recHitIter) {
534- const RPCDetId recDetId = static_cast < const RPCDetId>( recHitIter->rpcId ()) ;
535- const RPCRoll *recRoll = dynamic_cast < const RPCRoll *>( rpcGeom->roll (recDetId) );
513+ const RPCDetId recDetId{ recHitIter->rpcId ()} ;
514+ const RPCRoll *recRoll = rpcGeom->roll (recDetId);
536515 if (!recRoll)
537516 continue ;
538517
@@ -568,20 +547,14 @@ void RPCRecHitValid::analyze(const edm::Event &event, const edm::EventSetup &eve
568547
569548 const int region = roll->id ().region ();
570549 const int ring = roll->id ().ring ();
571- // const int sector = roll->id().sector();
572550 const int station = roll->id ().station ();
573- // const int layer = roll->id().layer();
574- // const int subsector = roll->id().subsector();
575551
576552 const double simX = simHit->localPosition ().x ();
577553 const double recX = recHitIter->localPosition ().x ();
578554 const double errX = sqrt (recHitIter->localPositionError ().xx ());
579555 const double dX = recX - simX;
580556 const double pull = errX == 0 ? -999 : dX / errX;
581557
582- // const GlobalPoint simPos = roll->toGlobal(simHitIter->localPosition());
583- // const GlobalPoint recPos = roll->toGlobal(recHitIter->localPosition());
584-
585558 if (region == 0 ) {
586559 ++nMatchHitBarrel;
587560 h_.resBarrel ->Fill (dX);
0 commit comments