48 edm::LogError(
"RPCPointVsRecHit") <<
"No DQMStore instance\n";
60 edm::LogInfo(
"RPCPointVsRecHit") <<
"Cannot find reference hit collection\n";
68 edm::LogInfo(
"RPCPointVsRecHit") <<
"Cannot find recHit collection\n";
75 int nRefHitBarrel = 0, nRefHitEndcap = 0;
76 for ( RecHitIter refHitIter = refHitHandle->begin();
77 refHitIter != refHitHandle->end(); ++refHitIter )
80 const RPCRoll* roll =
dynamic_cast<const RPCRoll*
>(rpcGeom->roll(detId()));
81 if ( !roll )
continue;
83 const int region = roll->
id().
region();
107 int sumClusterSizeBarrel = 0, sumClusterSizeEndcap = 0;
108 int nRecHitBarrel = 0, nRecHitEndcap = 0;
109 for ( RecHitIter recHitIter = recHitHandle->begin();
110 recHitIter != recHitHandle->end(); ++recHitIter )
113 const RPCRoll* roll =
dynamic_cast<const RPCRoll*
>(rpcGeom->roll(detId()));
114 if ( !roll )
continue;
116 const int region = roll->
id().
region();
117 const int ring = roll->
id().
ring();
119 const int station = (roll->
id().
station());
128 sumClusterSizeBarrel += recHitIter->clusterSize();
137 sumClusterSizeEndcap += recHitIter->clusterSize();
144 const double nRecHit = nRecHitBarrel+nRecHitEndcap;
149 const int sumClusterSize = sumClusterSizeBarrel+sumClusterSizeEndcap;
152 if ( nRecHitBarrel > 0 )
156 if ( nRecHitEndcap > 0 )
163 typedef std::map<RecHitIter, RecHitIter> RecToRecHitMap;
164 RecToRecHitMap refToRecHitMap;
166 for ( RecHitIter refHitIter = refHitHandle->begin();
167 refHitIter != refHitHandle->end(); ++refHitIter )
170 const RPCRoll* refRoll =
dynamic_cast<const RPCRoll*
>(rpcGeom->roll(refDetId));
171 if ( !refRoll )
continue;
173 const double refX = refHitIter->localPosition().x();
175 for ( RecHitIter recHitIter = recHitHandle->begin();
176 recHitIter != recHitHandle->end(); ++recHitIter )
179 const RPCRoll* recRoll =
dynamic_cast<const RPCRoll*
>(rpcGeom->roll(recDetId));
180 if ( !recRoll )
continue;
182 if ( refDetId != recDetId )
continue;
184 const double recX = recHitIter->localPosition().x();
185 const double newDx = fabs(recX - refX);
188 RecToRecHitMap::const_iterator prevRefToReco = refToRecHitMap.find(refHitIter);
189 if ( prevRefToReco == refToRecHitMap.end() )
191 refToRecHitMap.insert(std::make_pair(refHitIter, recHitIter));
195 const double oldDx = fabs(prevRefToReco->second->localPosition().x() - refX);
199 refToRecHitMap[refHitIter] = recHitIter;
207 for ( RecToRecHitMap::const_iterator
match = refToRecHitMap.begin();
210 RecHitIter refHitIter =
match->first;
211 RecHitIter recHitIter =
match->second;
214 const RPCRoll* roll =
dynamic_cast<const RPCRoll*
>(rpcGeom->roll(detId));
216 const int region = roll->
id().
region();
217 const int ring = roll->
id().
ring();
219 const int station = roll->
id().
station();
223 const double refX = refHitIter->localPosition().x();
224 const double recX = recHitIter->localPosition().x();
225 const double errX =
sqrt(recHitIter->localPositionError().xx());
226 const double dX = recX - refX;
227 const double pull = errX == 0 ? -999 : dX/errX;
302 for ( RecHitIter recHitIter = recHitHandle->begin();
303 recHitIter != recHitHandle->end(); ++recHitIter )
306 const RPCRoll* roll =
dynamic_cast<const RPCRoll*
>(rpcGeom->roll(detId));
308 const int region = roll->
id().
region();
309 const int ring = roll->
id().
ring();
311 const int station = roll->
id().
station();
315 bool matched =
false;
316 for ( RecToRecHitMap::const_iterator
match = refToRecHitMap.begin();
319 if ( recHitIter ==
match->second )
MEP refHitOccupancyEndcap_disk_ring
bool getByToken(EDGetToken token, Handle< PROD > &result) const
MEP umOccupancyEndcap_disk
edm::EDGetTokenT< RPCRecHitCollection > refHitToken_
MEP matchOccupancyEndcap_disk
MEP matchOccupancyEndcap_disk_ring
MEP umOccupancyBarrel_wheel_station
MEP umOccupancyBarrel_wheel
MEP refHitOccupancyBarrel_station
MEP recHitOccupancyEndcap_disk
MEP recHitOccupancyBarrel_station
MEP recHitOccupancyBarrel_wheel_station
MEP matchOccupancyBarrel_wheel
MEP umOccupancyEndcap_disk_ring
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
MEP umOccupancyBarrel_station
edm::EDGetTokenT< RPCRecHitCollection > recHitToken_
MEP refHitOccupancyBarrel_wheel
int region() const
Region id: 0 for Barrel, +/-1 For +/- Endcap.