24 edm::LogError(
"RPCPointVsRecHit") <<
"No DQMStore instance\n";
30 h_.bookHistograms(dbe_, subDir);
49 edm::LogError(
"RPCPointVsRecHit") <<
"No DQMStore instance\n";
59 if ( !event.
getByLabel(refHitLabel_, refHitHandle) )
61 edm::LogInfo(
"RPCPointVsRecHit") <<
"Cannot find reference hit collection\n";
67 if ( !event.
getByLabel(recHitLabel_, recHitHandle) )
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();
93 h_.refHitOccupancyBarrel_wheel->Fill(ring);
94 h_.refHitOccupancyBarrel_station->Fill(station);
95 h_.refHitOccupancyBarrel_wheel_station->Fill(ring, station);
99 h_.refHitOccupancyEndcap_disk->Fill(region*station);
100 h_.refHitOccupancyEndcap_disk_ring->Fill(region*station, ring);
104 h_.nRefHitBarrel->Fill(nRefHitBarrel);
105 h_.nRefHitEndcap->Fill(nRefHitEndcap);
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();
124 h_.clusterSize->Fill(recHitIter->clusterSize());
129 sumClusterSizeBarrel += recHitIter->clusterSize();
130 h_.clusterSizeBarrel->Fill(recHitIter->clusterSize());
131 h_.recHitOccupancyBarrel_wheel->Fill(ring);
132 h_.recHitOccupancyBarrel_station->Fill(station);
133 h_.recHitOccupancyBarrel_wheel_station->Fill(ring, station);
138 sumClusterSizeEndcap += recHitIter->clusterSize();
139 h_.clusterSizeEndcap->Fill(recHitIter->clusterSize());
140 h_.recHitOccupancyEndcap_disk->Fill(region*station);
141 h_.recHitOccupancyEndcap_disk_ring->Fill(ring, region*station);
145 const double nRecHit = nRecHitBarrel+nRecHitEndcap;
146 h_.nRecHitBarrel->Fill(nRecHitBarrel);
147 h_.nRecHitEndcap->Fill(nRecHitEndcap);
150 const int sumClusterSize = sumClusterSizeBarrel+sumClusterSizeEndcap;
151 h_.avgClusterSize->Fill(
double(sumClusterSize)/nRecHit);
153 if ( nRecHitBarrel > 0 )
155 h_.avgClusterSizeBarrel->Fill(
double(sumClusterSizeBarrel)/nRecHitBarrel);
157 if ( nRecHitEndcap > 0 )
159 h_.avgClusterSizeEndcap->Fill(
double(sumClusterSizeEndcap)/nRecHitEndcap);
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();
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;
235 h_.resBarrel->Fill(dX);
236 h_.pullBarrel->Fill(pull);
237 h_.matchOccupancyBarrel_wheel->Fill(ring);
238 h_.matchOccupancyBarrel_station->Fill(station);
239 h_.matchOccupancyBarrel_wheel_station->Fill(ring, station);
241 h_.res_wheel_res->Fill(ring, dX);
242 h_.res_station_res->Fill(station, dX);
243 h_.pull_wheel_pull->Fill(ring, pull);
244 h_.pull_station_pull->Fill(station, pull);
248 h_.resEndcap->Fill(dX);
249 h_.pullEndcap->Fill(pull);
250 h_.matchOccupancyEndcap_disk->Fill(region*station);
251 h_.matchOccupancyEndcap_disk_ring->Fill(region*station, ring);
253 h_.res_disk_res->Fill(region*station, dX);
254 h_.res_ring_res->Fill(ring, dX);
255 h_.pull_disk_pull->Fill(region*station, pull);
256 h_.pull_ring_pull->Fill(ring, pull);
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();
316 bool matched =
false;
317 for ( RecToRecHitMap::const_iterator
match = refToRecHitMap.begin();
320 if ( recHitIter ==
match->second )
331 h_.umOccupancyBarrel_wheel->Fill(ring);
332 h_.umOccupancyBarrel_station->Fill(station);
333 h_.umOccupancyBarrel_wheel_station->Fill(ring, station);
337 h_.umOccupancyEndcap_disk->Fill(region*station);
338 h_.umOccupancyEndcap_disk_ring->Fill(region*station, ring);
T getParameter(std::string const &) const
#define DEFINE_FWK_MODULE(type)
void analyze(const edm::Event &event, const edm::EventSetup &eventSetup)
C::const_iterator const_iterator
constant access iterator type
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
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
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.