33 edm::LogInfo(
"RPCPointVsRecHit") <<
"Cannot find reference hit collection\n";
41 edm::LogInfo(
"RPCPointVsRecHit") <<
"Cannot find recHit collection\n";
48 int nRefHitBarrel = 0, nRefHitEndcap = 0;
49 for ( RecHitIter refHitIter = refHitHandle->begin();
50 refHitIter != refHitHandle->end(); ++refHitIter )
54 if ( !roll )
continue;
56 const int region = roll->
id().
region();
80 int sumClusterSizeBarrel = 0, sumClusterSizeEndcap = 0;
81 int nRecHitBarrel = 0, nRecHitEndcap = 0;
82 for ( RecHitIter recHitIter = recHitHandle->begin();
83 recHitIter != recHitHandle->end(); ++recHitIter )
87 if ( !roll )
continue;
89 const int region = roll->
id().
region();
90 const int ring = roll->
id().
ring();
92 const int station = (roll->
id().
station());
101 sumClusterSizeBarrel += recHitIter->clusterSize();
110 sumClusterSizeEndcap += recHitIter->clusterSize();
117 const double nRecHit = nRecHitBarrel+nRecHitEndcap;
122 const int sumClusterSize = sumClusterSizeBarrel+sumClusterSizeEndcap;
125 if ( nRecHitBarrel > 0 )
129 if ( nRecHitEndcap > 0 )
136 typedef std::map<RecHitIter, RecHitIter> RecToRecHitMap;
137 RecToRecHitMap refToRecHitMap;
139 for ( RecHitIter refHitIter = refHitHandle->begin();
140 refHitIter != refHitHandle->end(); ++refHitIter )
144 if ( !refRoll )
continue;
146 const double refX = refHitIter->localPosition().x();
148 for ( RecHitIter recHitIter = recHitHandle->begin();
149 recHitIter != recHitHandle->end(); ++recHitIter )
153 if ( !recRoll )
continue;
155 if ( refDetId != recDetId )
continue;
157 const double recX = recHitIter->localPosition().x();
158 const double newDx = fabs(recX - refX);
161 RecToRecHitMap::const_iterator prevRefToReco = refToRecHitMap.find(refHitIter);
162 if ( prevRefToReco == refToRecHitMap.end() )
164 refToRecHitMap.insert(std::make_pair(refHitIter, recHitIter));
168 const double oldDx = fabs(prevRefToReco->second->localPosition().x() - refX);
172 refToRecHitMap[refHitIter] = recHitIter;
180 for ( RecToRecHitMap::const_iterator
match = refToRecHitMap.begin();
183 RecHitIter refHitIter =
match->first;
184 RecHitIter recHitIter =
match->second;
189 const int region = roll->
id().
region();
190 const int ring = roll->
id().
ring();
192 const int station = roll->
id().
station();
196 const double refX = refHitIter->localPosition().x();
197 const double recX = recHitIter->localPosition().x();
198 const double errX =
sqrt(recHitIter->localPositionError().xx());
199 const double dX = recX - refX;
200 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
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.