49 edm::LogError(
"RPCPointVsRecHit") <<
"No DQMStore instance\n";
61 edm::LogInfo(
"RPCPointVsRecHit") <<
"Cannot find reference hit collection\n";
69 edm::LogInfo(
"RPCPointVsRecHit") <<
"Cannot find recHit collection\n";
76 int nRefHitBarrel = 0, nRefHitEndcap = 0;
77 for ( RecHitIter refHitIter = refHitHandle->begin();
78 refHitIter != refHitHandle->end(); ++refHitIter )
81 const RPCRoll* roll =
dynamic_cast<const RPCRoll*
>(rpcGeom->roll(detId()));
82 if ( !roll )
continue;
84 const int region = roll->
id().
region();
108 int sumClusterSizeBarrel = 0, sumClusterSizeEndcap = 0;
109 int nRecHitBarrel = 0, nRecHitEndcap = 0;
110 for ( RecHitIter recHitIter = recHitHandle->begin();
111 recHitIter != recHitHandle->end(); ++recHitIter )
114 const RPCRoll* roll =
dynamic_cast<const RPCRoll*
>(rpcGeom->roll(detId()));
115 if ( !roll )
continue;
117 const int region = roll->
id().
region();
118 const int ring = roll->
id().
ring();
120 const int station = (roll->
id().
station());
129 sumClusterSizeBarrel += recHitIter->clusterSize();
138 sumClusterSizeEndcap += recHitIter->clusterSize();
145 const double nRecHit = nRecHitBarrel+nRecHitEndcap;
150 const int sumClusterSize = sumClusterSizeBarrel+sumClusterSizeEndcap;
153 if ( nRecHitBarrel > 0 )
157 if ( nRecHitEndcap > 0 )
164 typedef std::map<RecHitIter, RecHitIter> RecToRecHitMap;
165 RecToRecHitMap refToRecHitMap;
167 for ( RecHitIter refHitIter = refHitHandle->begin();
168 refHitIter != refHitHandle->end(); ++refHitIter )
171 const RPCRoll* refRoll =
dynamic_cast<const RPCRoll*
>(rpcGeom->roll(refDetId));
172 if ( !refRoll )
continue;
174 const double refX = refHitIter->localPosition().x();
176 for ( RecHitIter recHitIter = recHitHandle->begin();
177 recHitIter != recHitHandle->end(); ++recHitIter )
180 const RPCRoll* recRoll =
dynamic_cast<const RPCRoll*
>(rpcGeom->roll(recDetId));
181 if ( !recRoll )
continue;
183 if ( refDetId != recDetId )
continue;
185 const double recX = recHitIter->localPosition().x();
186 const double newDx = fabs(recX - refX);
189 RecToRecHitMap::const_iterator prevRefToReco = refToRecHitMap.find(refHitIter);
190 if ( prevRefToReco == refToRecHitMap.end() )
192 refToRecHitMap.insert(std::make_pair(refHitIter, recHitIter));
196 const double oldDx = fabs(prevRefToReco->second->localPosition().x() - refX);
200 refToRecHitMap[refHitIter] = recHitIter;
208 for ( RecToRecHitMap::const_iterator
match = refToRecHitMap.begin();
211 RecHitIter refHitIter =
match->first;
212 RecHitIter recHitIter =
match->second;
215 const RPCRoll* roll =
dynamic_cast<const RPCRoll*
>(rpcGeom->roll(detId));
217 const int region = roll->
id().
region();
218 const int ring = roll->
id().
ring();
220 const int station = roll->
id().
station();
224 const double refX = refHitIter->localPosition().x();
225 const double recX = recHitIter->localPosition().x();
226 const double errX =
sqrt(recHitIter->localPositionError().xx());
227 const double dX = recX - refX;
228 const double pull = errX == 0 ? -999 : dX/errX;
303 for ( RecHitIter recHitIter = recHitHandle->begin();
304 recHitIter != recHitHandle->end(); ++recHitIter )
307 const RPCRoll* roll =
dynamic_cast<const RPCRoll*
>(rpcGeom->roll(detId));
309 const int region = roll->
id().
region();
310 const int ring = roll->
id().
ring();
312 const int station = roll->
id().
station();
316 bool matched =
false;
317 for ( RecToRecHitMap::const_iterator
match = refToRecHitMap.begin();
320 if ( recHitIter ==
match->second )
MEP refHitOccupancyEndcap_disk_ring
MEP umOccupancyEndcap_disk
MEP matchOccupancyEndcap_disk
MEP matchOccupancyEndcap_disk_ring
MEP umOccupancyBarrel_wheel_station
C::const_iterator const_iterator
constant access iterator type
MEP umOccupancyBarrel_wheel
MEP refHitOccupancyBarrel_station
MEP recHitOccupancyEndcap_disk
edm::InputTag refHitLabel_
MEP recHitOccupancyBarrel_station
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
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::InputTag recHitLabel_
MEP refHitOccupancyBarrel_wheel
int region() const
Region id: 0 for Barrel, +/-1 For +/- Endcap.