29 edm::LogInfo(
"RPCPointVsRecHit") <<
"Cannot find reference hit collection\n";
36 edm::LogInfo(
"RPCPointVsRecHit") <<
"Cannot find recHit collection\n";
43 int nRefHitBarrel = 0, nRefHitEndcap = 0;
44 for (RecHitIter refHitIter = refHitHandle->begin(); refHitIter != refHitHandle->end(); ++refHitIter) {
46 const RPCRoll *roll =
dynamic_cast<const RPCRoll *
>(rpcGeom->roll(detId()));
70 int sumClusterSizeBarrel = 0, sumClusterSizeEndcap = 0;
71 int nRecHitBarrel = 0, nRecHitEndcap = 0;
72 for (RecHitIter recHitIter = recHitHandle->begin(); recHitIter != recHitHandle->end(); ++recHitIter) {
74 const RPCRoll *roll =
dynamic_cast<const RPCRoll *
>(rpcGeom->roll(detId()));
78 const int region = roll->
id().
region();
79 const int ring = roll->
id().
ring();
81 const int station = (roll->
id().
station());
89 sumClusterSizeBarrel += recHitIter->clusterSize();
96 sumClusterSizeEndcap += recHitIter->clusterSize();
102 const double nRecHit = nRecHitBarrel + nRecHitEndcap;
106 const int sumClusterSize = sumClusterSizeBarrel + sumClusterSizeEndcap;
109 if (nRecHitBarrel > 0) {
112 if (nRecHitEndcap > 0) {
118 typedef std::map<RecHitIter, RecHitIter> RecToRecHitMap;
119 RecToRecHitMap refToRecHitMap;
121 for (RecHitIter refHitIter = refHitHandle->begin(); refHitIter != refHitHandle->end(); ++refHitIter) {
123 const RPCRoll *refRoll =
dynamic_cast<const RPCRoll *
>(rpcGeom->roll(refDetId));
127 const double refX = refHitIter->localPosition().x();
129 for (RecHitIter recHitIter = recHitHandle->begin(); recHitIter != recHitHandle->end(); ++recHitIter) {
131 const RPCRoll *recRoll =
dynamic_cast<const RPCRoll *
>(rpcGeom->roll(recDetId));
135 if (refDetId != recDetId)
138 const double recX = recHitIter->localPosition().x();
139 const double newDx = fabs(recX - refX);
142 RecToRecHitMap::const_iterator prevRefToReco = refToRecHitMap.find(refHitIter);
143 if (prevRefToReco == refToRecHitMap.end()) {
144 refToRecHitMap.insert(std::make_pair(refHitIter, recHitIter));
146 const double oldDx = fabs(prevRefToReco->second->localPosition().x() - refX);
149 refToRecHitMap[refHitIter] = recHitIter;
157 for (RecToRecHitMap::const_iterator
match = refToRecHitMap.begin();
match != refToRecHitMap.end(); ++
match) {
158 RecHitIter refHitIter =
match->first;
159 RecHitIter recHitIter =
match->second;
162 const RPCRoll *roll =
dynamic_cast<const RPCRoll *
>(rpcGeom->roll(detId));
164 const int region = roll->
id().
region();
165 const int ring = roll->
id().
ring();
167 const int station = roll->
id().
station();
171 const double refX = refHitIter->localPosition().x();
172 const double recX = recHitIter->localPosition().x();
173 const double errX =
sqrt(recHitIter->localPositionError().xx());
174 const double dX = recX - refX;
175 const double pull = errX == 0 ? -999 : dX / errX;
MEP refHitOccupancyEndcap_disk_ring
edm::ESGetToken< RPCGeometry, MuonGeometryRecord > rpcGeomToken_
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
Log< level::Info, false > LogInfo
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
ESHandle< T > getHandle(const ESGetToken< T, R > &iToken) const
MEP refHitOccupancyBarrel_wheel_station
MEP refHitOccupancyEndcap_disk
edm::EDGetTokenT< RPCRecHitCollection > recHitToken_
MEP refHitOccupancyBarrel_wheel
int region() const
Region id: 0 for Barrel, +/-1 For +/- Endcap.