23 edm::LogError(
"RPCPointVsRecHit") <<
"No DQMStore instance\n";
29 h_.bookHistograms(
dbe_, subDir);
48 edm::LogError(
"RPCPointVsRecHit") <<
"No DQMStore instance\n";
58 if ( !event.
getByToken(refHitToken_, refHitHandle) )
60 edm::LogInfo(
"RPCPointVsRecHit") <<
"Cannot find reference hit collection\n";
66 if ( !event.
getByToken(recHitToken_, recHitHandle) )
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();
92 h_.refHitOccupancyBarrel_wheel->Fill(ring);
93 h_.refHitOccupancyBarrel_station->Fill(station);
94 h_.refHitOccupancyBarrel_wheel_station->Fill(ring, station);
98 h_.refHitOccupancyEndcap_disk->Fill(region*station);
99 h_.refHitOccupancyEndcap_disk_ring->Fill(region*station, ring);
103 h_.nRefHitBarrel->Fill(nRefHitBarrel);
104 h_.nRefHitEndcap->Fill(nRefHitEndcap);
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();
123 h_.clusterSize->Fill(recHitIter->clusterSize());
128 sumClusterSizeBarrel += recHitIter->clusterSize();
129 h_.clusterSizeBarrel->Fill(recHitIter->clusterSize());
130 h_.recHitOccupancyBarrel_wheel->Fill(ring);
131 h_.recHitOccupancyBarrel_station->Fill(station);
132 h_.recHitOccupancyBarrel_wheel_station->Fill(ring, station);
137 sumClusterSizeEndcap += recHitIter->clusterSize();
138 h_.clusterSizeEndcap->Fill(recHitIter->clusterSize());
139 h_.recHitOccupancyEndcap_disk->Fill(region*station);
140 h_.recHitOccupancyEndcap_disk_ring->Fill(ring, region*station);
144 const double nRecHit = nRecHitBarrel+nRecHitEndcap;
145 h_.nRecHitBarrel->Fill(nRecHitBarrel);
146 h_.nRecHitEndcap->Fill(nRecHitEndcap);
149 const int sumClusterSize = sumClusterSizeBarrel+sumClusterSizeEndcap;
150 h_.avgClusterSize->Fill(
double(sumClusterSize)/nRecHit);
152 if ( nRecHitBarrel > 0 )
154 h_.avgClusterSizeBarrel->Fill(
double(sumClusterSizeBarrel)/nRecHitBarrel);
156 if ( nRecHitEndcap > 0 )
158 h_.avgClusterSizeEndcap->Fill(
double(sumClusterSizeEndcap)/nRecHitEndcap);
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();
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;
234 h_.resBarrel->Fill(dX);
235 h_.pullBarrel->Fill(pull);
236 h_.matchOccupancyBarrel_wheel->Fill(ring);
237 h_.matchOccupancyBarrel_station->Fill(station);
238 h_.matchOccupancyBarrel_wheel_station->Fill(ring, station);
240 h_.res_wheel_res->Fill(ring, dX);
241 h_.res_station_res->Fill(station, dX);
242 h_.pull_wheel_pull->Fill(ring, pull);
243 h_.pull_station_pull->Fill(station, pull);
247 h_.resEndcap->Fill(dX);
248 h_.pullEndcap->Fill(pull);
249 h_.matchOccupancyEndcap_disk->Fill(region*station);
250 h_.matchOccupancyEndcap_disk_ring->Fill(region*station, ring);
252 h_.res_disk_res->Fill(region*station, dX);
253 h_.res_ring_res->Fill(ring, dX);
254 h_.pull_disk_pull->Fill(region*station, pull);
255 h_.pull_ring_pull->Fill(ring, pull);
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();
315 bool matched =
false;
316 for ( RecToRecHitMap::const_iterator
match = refToRecHitMap.begin();
319 if ( recHitIter ==
match->second )
330 h_.umOccupancyBarrel_wheel->Fill(ring);
331 h_.umOccupancyBarrel_station->Fill(station);
332 h_.umOccupancyBarrel_wheel_station->Fill(ring, station);
336 h_.umOccupancyEndcap_disk->Fill(region*station);
337 h_.umOccupancyEndcap_disk_ring->Fill(region*station, ring);
T getParameter(std::string const &) const
bool getByToken(EDGetToken token, Handle< PROD > &result) const
#define DEFINE_FWK_MODULE(type)
void analyze(const edm::Event &event, const edm::EventSetup &eventSetup)
How EventSelector::AcceptEvent() decides whether to accept an event for output otherwise it is excluding the probing of A single or multiple positive and the trigger will pass if any such matching triggers are PASS or EXCEPTION[A criterion thatmatches no triggers at all is detected and causes a throw.] A single negative with an expectation of appropriate bit checking in the decision and the trigger will pass if any such matching triggers are FAIL or EXCEPTION A wildcarded negative criterion that matches more than one trigger in the trigger but the state exists so we define the behavior If all triggers are the negative crieriion will lead to accepting the event(this again matches the behavior of"!*"before the partial wildcard feature was incorporated).The per-event"cost"of each negative criterion with multiple relevant triggers is about the same as!*was in the past
RPCPointVsRecHit(const edm::ParameterSet &pset)
std::pair< typename Association::data_type::first_type, double > match(Reference key, Association association, bool bestMatchByMaxValue)
Generic matching function.
int region() const
Region id: 0 for Barrel, +/-1 For +/- Endcap.