56 edm::LogError(
"RPCPointVsRecHit") <<
"No DQMStore instance\n";
68 edm::LogInfo(
"RPCPointVsRecHit") <<
"Cannot find reference hit collection\n";
76 edm::LogInfo(
"RPCPointVsRecHit") <<
"Cannot find recHit collection\n";
83 for ( RecHitIter refHitIter = refHitHandle->begin();
84 refHitIter != refHitHandle->end(); ++refHitIter )
87 const RPCRoll* roll =
dynamic_cast<const RPCRoll*
>(rpcGeom->roll(detId()));
88 if ( !roll )
continue;
90 const int region = roll->
id().
region();
113 for ( RecHitIter recHitIter = recHitHandle->begin();
114 recHitIter != recHitHandle->end(); ++recHitIter )
117 const RPCRoll* roll =
dynamic_cast<const RPCRoll*
>(rpcGeom->roll(detId()));
118 if ( !roll )
continue;
120 const int region = roll->
id().
region();
121 const int ring = roll->
id().
ring();
123 const int station = (roll->
id().
station());
146 typedef std::map<RecHitIter, RecHitIter> RecToRecHitMap;
147 RecToRecHitMap refToRecHitMap;
149 for ( RecHitIter refHitIter = refHitHandle->begin();
150 refHitIter != refHitHandle->end(); ++refHitIter )
153 const RPCRoll* refRoll =
dynamic_cast<const RPCRoll*
>(rpcGeom->roll(refDetId));
154 if ( !refRoll )
continue;
156 const double refX = refHitIter->localPosition().x();
158 for ( RecHitIter recHitIter = recHitHandle->begin();
159 recHitIter != recHitHandle->end(); ++recHitIter )
162 const RPCRoll* recRoll =
dynamic_cast<const RPCRoll*
>(rpcGeom->roll(recDetId));
163 if ( !recRoll )
continue;
165 if ( refDetId != recDetId )
continue;
167 const double recX = recHitIter->localPosition().x();
168 const double newDx = fabs(recX - refX);
171 RecToRecHitMap::const_iterator prevRefToReco = refToRecHitMap.find(refHitIter);
172 if ( prevRefToReco == refToRecHitMap.end() )
174 refToRecHitMap.insert(std::make_pair(refHitIter, recHitIter));
178 const double oldDx = fabs(prevRefToReco->second->localPosition().x() - refX);
182 refToRecHitMap[refHitIter] = recHitIter;
190 for ( RecToRecHitMap::const_iterator
match = refToRecHitMap.begin();
193 RecHitIter refHitIter =
match->first;
194 RecHitIter recHitIter =
match->second;
197 const RPCRoll* roll =
dynamic_cast<const RPCRoll*
>(rpcGeom->roll(detId));
199 const int region = roll->
id().
region();
200 const int ring = roll->
id().
ring();
202 const int station = roll->
id().
station();
206 const double refX = refHitIter->localPosition().x();
207 const double recX = recHitIter->localPosition().x();
208 const double errX = recHitIter->localPositionError().xx();
209 const double dX = recX - refX;
210 const double pull = errX == 0 ? -999 : dX/errX;
238 for ( RecHitIter refHitIter = refHitHandle->begin();
239 refHitIter != refHitHandle->end(); ++refHitIter )
242 const RPCRoll* roll =
dynamic_cast<const RPCRoll*
>(rpcGeom->roll(detId));
244 const int region = roll->
id().
region();
245 const int ring = roll->
id().
ring();
247 const int station = roll->
id().
station();
251 bool matched =
false;
252 for ( RecToRecHitMap::const_iterator
match = refToRecHitMap.begin();
255 if ( refHitIter ==
match->first )
278 for ( RecHitIter recHitIter = recHitHandle->begin();
279 recHitIter != recHitHandle->end(); ++recHitIter )
282 const RPCRoll* roll =
dynamic_cast<const RPCRoll*
>(rpcGeom->roll(detId));
284 const int region = roll->
id().
region();
285 const int ring = roll->
id().
ring();
287 const int station = roll->
id().
station();
291 bool matched =
false;
292 for ( RecToRecHitMap::const_iterator
match = refToRecHitMap.begin();
295 if ( recHitIter ==
match->second )
MEP nUnMatchedRefHit_DvsR
GlobalPoint toGlobal(const Local2DPoint &lp) const
Conversion to the global R.F. from the R.F. of the GeomDet.
C::const_iterator const_iterator
constant access iterator type
edm::InputTag refHitLabel_
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
MEP nUnMatchedRecHit_DvsR
MEP nUnMatchedRefHit_WvsR
MEP nUnMatchedRecHit_WvsR
std::pair< typename Association::data_type::first_type, double > match(Reference key, Association association, bool bestMatchByMaxValue)
Generic matching function.
edm::InputTag recHitLabel_
int region() const
Region id: 0 for Barrel, +/-1 For +/- Endcap.