295 edm::LogInfo(
"RPCRecHitValid") <<
"Cannot find simHit collection\n";
303 edm::LogInfo(
"RPCRecHitValid") <<
"Cannot find recHit collection\n";
311 edm::LogInfo(
"RPCRecHitValid") <<
"Cannot find simTrack collection\n";
319 edm::LogInfo(
"RPCRecHitValid") <<
"Cannot find muon collection\n";
323 typedef edm::PSimHitContainer::const_iterator SimHitIter;
326 std::vector<const PSimHit*> muonSimHits;
327 std::vector<const PSimHit*> pthrSimHits;
329 simTrack != simTrackHandle->end(); ++simTrack )
331 if ( simTrack->pt() < 1.0
or simTrack->p() < 2.5 )
continue;
333 bool hasRPCHit =
false;
334 if (
abs(simTrack->pdgId()) == 13 )
336 int nRPCHitBarrel = 0;
337 int nRPCHitEndcap = 0;
339 for ( SimHitIter simHit = simTrack->pSimHit_begin();
340 simHit != simTrack->pSimHit_end(); ++simHit )
342 const DetId detId(simHit->detUnitId());
345 const RPCRoll* roll =
dynamic_cast<const RPCRoll*
>(rpcGeom->roll(rpcDetId));
346 if ( !roll )
continue;
348 if ( rpcDetId.
region() == 0 ) ++nRPCHitBarrel;
349 else ++nRPCHitEndcap;
351 muonSimHits.push_back(&*simHit);
354 const int nRPCHit = nRPCHitBarrel+nRPCHitEndcap;
355 hasRPCHit = nRPCHit > 0;
357 if ( nRPCHitBarrel and nRPCHitEndcap )
364 else if ( nRPCHitBarrel )
371 else if ( nRPCHitEndcap )
388 for ( SimHitIter simHit = simTrack->pSimHit_begin();
389 simHit != simTrack->pSimHit_end(); ++simHit )
391 const DetId detId(simHit->detUnitId());
394 const RPCRoll* roll =
dynamic_cast<const RPCRoll*
>(rpcGeom->roll(rpcDetId()));
395 if ( !roll )
continue;
398 pthrSimHits.push_back(&*simHit);
400 hasRPCHit = nRPCHit > 0;
405 switch ( simTrack->pdgId() )
423 int nRefHitBarrel = 0, nRefHitEndcap = 0;
424 for ( std::vector<const PSimHit*>::const_iterator simHitP = muonSimHits.begin();
425 simHitP != muonSimHits.end(); ++simHitP )
427 const PSimHit* simHit = *simHitP;
429 const RPCRoll* roll =
dynamic_cast<const RPCRoll*
>(rpcGeom->roll(detId));
431 const int region = roll->
id().
region();
458 for ( std::vector<const PSimHit*>::const_iterator simHitP = pthrSimHits.begin();
459 simHitP != pthrSimHits.end(); ++simHitP )
461 const PSimHit* simHit = *simHitP;
463 const RPCRoll* roll =
dynamic_cast<const RPCRoll*
>(rpcGeom->roll(detId()));
465 const int region = roll->
id().
region();
466 const int ring = roll->
id().
ring();
468 const int station = roll->
id().
station();
494 int sumClusterSizeBarrel = 0, sumClusterSizeEndcap = 0;
495 int nRecHitBarrel = 0, nRecHitEndcap = 0;
496 for ( RecHitIter recHitIter = recHitHandle->begin();
497 recHitIter != recHitHandle->end(); ++recHitIter )
500 const RPCRoll* roll =
dynamic_cast<const RPCRoll*
>(rpcGeom->roll(detId()));
501 if ( !roll )
continue;
503 const int region = roll->
id().
region();
504 const int ring = roll->
id().
ring();
506 const int station = roll->
id().
station();
515 sumClusterSizeBarrel += recHitIter->clusterSize();
524 sumClusterSizeEndcap += recHitIter->clusterSize();
531 const double nRecHit = nRecHitBarrel+nRecHitEndcap;
536 const int sumClusterSize = sumClusterSizeBarrel+sumClusterSizeEndcap;
539 if ( nRecHitBarrel > 0 )
543 if ( nRecHitEndcap > 0 )
550 typedef std::map<const PSimHit*, RecHitIter> SimToRecHitMap;
551 SimToRecHitMap simToRecHitMap;
553 for ( std::vector<const PSimHit*>::const_iterator simHitP = muonSimHits.begin();
554 simHitP != muonSimHits.end(); ++simHitP )
556 const PSimHit* simHit = *simHitP;
562 for ( RecHitIter recHitIter = recHitHandle->begin();
563 recHitIter != recHitHandle->end(); ++recHitIter )
566 const RPCRoll* recRoll =
dynamic_cast<const RPCRoll*
>(rpcGeom->roll(recDetId));
567 if ( !recRoll )
continue;
569 if ( simDetId != recDetId )
continue;
571 const double recX = recHitIter->localPosition().x();
572 const double newDx = fabs(recX - simX);
575 SimToRecHitMap::const_iterator prevSimToReco = simToRecHitMap.find(simHit);
576 if ( prevSimToReco == simToRecHitMap.end() )
578 simToRecHitMap.insert(std::make_pair(simHit, recHitIter));
582 const double oldDx = fabs(prevSimToReco->second->localPosition().x() - simX);
586 simToRecHitMap[simHit] = recHitIter;
594 int nMatchHitBarrel = 0, nMatchHitEndcap = 0;
595 for ( SimToRecHitMap::const_iterator
match = simToRecHitMap.begin();
599 RecHitIter recHitIter =
match->second;
602 const RPCRoll* roll =
dynamic_cast<const RPCRoll*
>(rpcGeom->roll(detId));
604 const int region = roll->
id().
region();
605 const int ring = roll->
id().
ring();
607 const int station = roll->
id().
station();
612 const double recX = recHitIter->localPosition().x();
613 const double errX =
sqrt(recHitIter->localPositionError().xx());
614 const double dX = recX - simX;
615 const double pull = errX == 0 ? -999 : dX/errX;
660 if ( !
muon->isGlobalMuon() )
continue;
662 int nRPCHitBarrel = 0;
663 int nRPCHitEndcap = 0;
667 recHit != glbTrack->recHitsEnd(); ++recHit )
669 if ( !(*recHit)->isValid() )
continue;
670 const DetId detId = (*recHit)->geographicalId();
674 if ( rpcDetId.
region() == 0 ) ++nRPCHitBarrel;
675 else ++nRPCHitEndcap;
678 const int nRPCHit = nRPCHitBarrel + nRPCHitEndcap;
680 if ( nRPCHitBarrel and nRPCHitEndcap )
687 else if ( nRPCHitBarrel )
694 else if ( nRPCHitEndcap )
710 for ( RecHitIter recHitIter = recHitHandle->begin();
711 recHitIter != recHitHandle->end(); ++recHitIter )
714 const RPCRoll* roll =
dynamic_cast<const RPCRoll*
>(rpcGeom->roll(detId));
716 const int region = roll->
id().
region();
717 const int ring = roll->
id().
ring();
719 const int station = roll->
id().
station();
723 bool matched =
false;
724 for ( SimToRecHitMap::const_iterator
match = simToRecHitMap.begin();
727 if ( recHitIter ==
match->second )
750 int nPunchMatched = 0;
752 for ( std::vector<const PSimHit*>::const_iterator pthrSimHitP = pthrSimHits.begin();
753 pthrSimHitP != pthrSimHits.end(); ++pthrSimHitP )
755 const PSimHit* simHit = *pthrSimHitP;
757 if ( absSimHitPType == 13 )
continue;
760 if ( simDetId == detId ) ++nPunchMatched;
763 if ( nPunchMatched > 0 )
781 for ( RecHitIter recHitIter = recHitHandle->begin();
782 recHitIter != recHitHandle->end(); ++recHitIter )
785 const RPCRoll* roll =
dynamic_cast<const RPCRoll*
>(rpcGeom->roll(recDetId));
787 const int region = roll->
id().
region();
794 const double recX = recHitIter->localPosition().x();
795 const double recErrX =
sqrt(recHitIter->localPositionError().xx());
797 bool matched =
false;
798 for ( SimHitIter simHitIter = simHitHandle->begin();
799 simHitIter != simHitHandle->end(); ++simHitIter )
801 const RPCDetId simDetId =
static_cast<const RPCDetId>(simHitIter->detUnitId());
802 const RPCRoll* simRoll =
dynamic_cast<const RPCRoll*
>(rpcGeom->roll(simDetId));
803 if ( !simRoll )
continue;
805 if ( simDetId != recDetId )
continue;
807 const double simX = simHitIter->localPosition().x();
808 const double dX = fabs(recX-simX);
810 if ( dX/recErrX < 5 )
MEP h_recoMuonOverlap_eta
MEP refHitOccupancyEndcap_disk_ring
boost::indirect_iterator< typename seq_t::const_iterator > const_iterator
std::map< int, int > detIdToIndexMapEndcap_
The Signals That Services Can Subscribe To This is based on ActivityRegistry and is current per Services can connect to the signals distributed by the ActivityRegistry in order to monitor the activity of the application Each possible callback has some defined which we here list in angle e< void, edm::EventIDconst &, edm::Timestampconst & > We also list in braces which AR_WATCH_USING_METHOD_ is used for those or
MEP umOccupancyEndcap_disk
MEP h_nRPCHitPerRecoMuonBarrel
std::map< int, int > detIdToIndexMapBarrel_
MEP h_nRPCHitPerSimMuonBarrel
MEP h_nRPCHitPerSimMuonOverlap
MEP matchOccupancyEndcap_disk
MEP h_recPunchOccupancyEndcap_disk_ring
MEP h_refPunchOccupancyBarrel_wheel
MEP h_refPunchOccupancyEndcap_disk
MEP h_matchOccupancyBarrel_detId
MEP h_recPunchOccupancyEndcap_disk
MEP matchOccupancyEndcap_disk_ring
uint32_t rawId() const
get the raw id
MEP umOccupancyBarrel_wheel_station
C::const_iterator const_iterator
constant access iterator type
MEP h_matchOccupancyEndcap_detId
edm::InputTag recHitLabel_
MEP umOccupancyBarrel_wheel
Local3DPoint localPosition() const
MEP h_noiseOccupancyBarrel_detId
MEP h_nRPCHitPerSimMuonEndcap
MEP h_nRPCHitPerRecoMuonEndcap
MEP refHitOccupancyBarrel_station
MEP recHitOccupancyEndcap_disk
MEP h_recoMuonOverlap_phi
edm::InputTag simHitLabel_
MEP h_recPunchOccupancyBarrel_wheel_station
MEP h_refPunchOccupancyBarrel_wheel_station
int subdetId() const
get the contents of the subdetector field (not cast into any detector's numbering enum) ...
MEP recHitOccupancyBarrel_station
MEP h_refPunchOccupancyEndcap_disk_ring
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
MEP recHitOccupancyBarrel_wheel_station
MEP matchOccupancyBarrel_wheel
MEP umOccupancyEndcap_disk_ring
MEP h_refPunchOccupancyBarrel_station
MEP h_nRPCHitPerRecoMuonOverlap
MEP h_refOccupancyBarrel_detId
MEP matchOccupancyBarrel_station
MEP recHitOccupancyEndcap_disk_ring
MEP h_recPunchOccupancyBarrel_wheel
edm::InputTag simTrackLabel_
MEP h_refOccupancyEndcap_detId
MEP matchOccupancyBarrel_wheel_station
std::pair< typename Association::data_type::first_type, double > match(Reference key, Association association, bool bestMatchByMaxValue)
Generic matching function.
MEP recHitOccupancyBarrel_wheel
MEP refHitOccupancyBarrel_wheel_station
Detector det() const
get the detector field from this detid
MEP h_noiseOccupancyEndcap_detId
unsigned int detUnitId() const
MEP refHitOccupancyEndcap_disk
MEP umOccupancyBarrel_station
MEP refHitOccupancyBarrel_wheel
int region() const
Region id: 0 for Barrel, +/-1 For +/- Endcap.
MEP h_recPunchOccupancyBarrel_station