30 edm::LogInfo(
"RPCPointVsRecHit") <<
"Cannot find reference hit collection\n";
37 edm::LogInfo(
"RPCPointVsRecHit") <<
"Cannot find recHit collection\n";
44 int nRefHitBarrel = 0, nRefHitEndcap = 0;
45 for (RecHitIter refHitIter = refHitHandle->begin(); refHitIter != refHitHandle->end(); ++refHitIter) {
51 const int region = roll->
id().
region();
71 int sumClusterSizeBarrel = 0, sumClusterSizeEndcap = 0;
72 int nRecHitBarrel = 0, nRecHitEndcap = 0;
73 for (RecHitIter recHitIter = recHitHandle->begin(); recHitIter != recHitHandle->end(); ++recHitIter) {
79 const int region = roll->
id().
region();
80 const int ring = roll->
id().
ring();
82 const int station = (roll->
id().
station());
90 sumClusterSizeBarrel += recHitIter->clusterSize();
97 sumClusterSizeEndcap += recHitIter->clusterSize();
103 const double nRecHit = nRecHitBarrel + nRecHitEndcap;
107 const int sumClusterSize = sumClusterSizeBarrel + sumClusterSizeEndcap;
110 if (nRecHitBarrel > 0) {
113 if (nRecHitEndcap > 0) {
119 typedef std::map<RecHitIter, RecHitIter> RecToRecHitMap;
120 RecToRecHitMap refToRecHitMap;
122 for (RecHitIter refHitIter = refHitHandle->begin(); refHitIter != refHitHandle->end(); ++refHitIter) {
128 const double refX = refHitIter->localPosition().x();
130 for (RecHitIter recHitIter = recHitHandle->begin(); recHitIter != recHitHandle->end(); ++recHitIter) {
136 if (refDetId != recDetId)
139 const double recX = recHitIter->localPosition().x();
140 const double newDx = fabs(recX - refX);
143 RecToRecHitMap::const_iterator prevRefToReco = refToRecHitMap.find(refHitIter);
144 if (prevRefToReco == refToRecHitMap.end()) {
145 refToRecHitMap.insert(std::make_pair(refHitIter, recHitIter));
147 const double oldDx = fabs(prevRefToReco->second->localPosition().x() - refX);
150 refToRecHitMap[refHitIter] = recHitIter;
158 for (RecToRecHitMap::const_iterator
match = refToRecHitMap.begin();
match != refToRecHitMap.end(); ++
match) {
159 RecHitIter refHitIter =
match->first;
160 RecHitIter recHitIter =
match->second;
165 const int region = roll->
id().
region();
166 const int ring = roll->
id().
ring();
168 const int station = roll->
id().
station();
172 const double refX = refHitIter->localPosition().x();
173 const double recX = recHitIter->localPosition().x();
174 const double errX =
sqrt(recHitIter->localPositionError().xx());
175 const double dX = recX - refX;
176 const double pull = errX == 0 ? -999 : dX /
errX;
MEP refHitOccupancyEndcap_disk_ring
bool getByToken(EDGetToken token, Handle< PROD > &result) const
edm::EDGetTokenT< RPCRecHitCollection > refHitToken_
MEP matchOccupancyEndcap_disk
MEP matchOccupancyEndcap_disk_ring
C::const_iterator const_iterator
constant access iterator type
MEP refHitOccupancyBarrel_station
MEP recHitOccupancyEndcap_disk
MEP recHitOccupancyBarrel_station
MEP recHitOccupancyBarrel_wheel_station
MEP matchOccupancyBarrel_wheel
MEP matchOccupancyBarrel_station
MEP recHitOccupancyEndcap_disk_ring
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
MEP refHitOccupancyEndcap_disk
const RPCRoll * roll(RPCDetId id) const
Return a roll given its id.
edm::EDGetTokenT< RPCRecHitCollection > recHitToken_
MEP refHitOccupancyBarrel_wheel
int region() const
Region id: 0 for Barrel, +/-1 For +/- Endcap.