31 if ( !event.
getByToken(refHitToken_, refHitHandle) )
33 edm::LogInfo(
"RPCPointVsRecHit") <<
"Cannot find reference hit collection\n";
39 if ( !event.
getByToken(recHitToken_, recHitHandle) )
41 edm::LogInfo(
"RPCPointVsRecHit") <<
"Cannot find recHit collection\n";
48 int nRefHitBarrel = 0, nRefHitEndcap = 0;
49 for ( RecHitIter refHitIter = refHitHandle->begin();
50 refHitIter != refHitHandle->end(); ++refHitIter )
53 const RPCRoll* roll =
dynamic_cast<const RPCRoll*
>(rpcGeom->roll(detId()));
54 if ( !roll )
continue;
56 const int region = roll->
id().
region();
65 h_.refHitOccupancyBarrel_wheel->Fill(ring);
66 h_.refHitOccupancyBarrel_station->Fill(station);
67 h_.refHitOccupancyBarrel_wheel_station->Fill(ring, station);
71 h_.refHitOccupancyEndcap_disk->Fill(region*station);
72 h_.refHitOccupancyEndcap_disk_ring->Fill(region*station, ring);
76 h_.nRefHitBarrel->Fill(nRefHitBarrel);
77 h_.nRefHitEndcap->Fill(nRefHitEndcap);
80 int sumClusterSizeBarrel = 0, sumClusterSizeEndcap = 0;
81 int nRecHitBarrel = 0, nRecHitEndcap = 0;
82 for ( RecHitIter recHitIter = recHitHandle->begin();
83 recHitIter != recHitHandle->end(); ++recHitIter )
86 const RPCRoll* roll =
dynamic_cast<const RPCRoll*
>(rpcGeom->roll(detId()));
87 if ( !roll )
continue;
89 const int region = roll->
id().
region();
96 h_.clusterSize->Fill(recHitIter->clusterSize());
101 sumClusterSizeBarrel += recHitIter->clusterSize();
102 h_.clusterSizeBarrel->Fill(recHitIter->clusterSize());
103 h_.recHitOccupancyBarrel_wheel->Fill(ring);
104 h_.recHitOccupancyBarrel_station->Fill(station);
105 h_.recHitOccupancyBarrel_wheel_station->Fill(ring, station);
110 sumClusterSizeEndcap += recHitIter->clusterSize();
111 h_.clusterSizeEndcap->Fill(recHitIter->clusterSize());
112 h_.recHitOccupancyEndcap_disk->Fill(region*station);
113 h_.recHitOccupancyEndcap_disk_ring->Fill(ring, region*station);
117 const double nRecHit = nRecHitBarrel+nRecHitEndcap;
118 h_.nRecHitBarrel->Fill(nRecHitBarrel);
119 h_.nRecHitEndcap->Fill(nRecHitEndcap);
122 const int sumClusterSize = sumClusterSizeBarrel+sumClusterSizeEndcap;
123 h_.avgClusterSize->Fill(
double(sumClusterSize)/nRecHit);
125 if ( nRecHitBarrel > 0 )
127 h_.avgClusterSizeBarrel->Fill(
double(sumClusterSizeBarrel)/nRecHitBarrel);
129 if ( nRecHitEndcap > 0 )
131 h_.avgClusterSizeEndcap->Fill(
double(sumClusterSizeEndcap)/nRecHitEndcap);
136 typedef std::map<RecHitIter, RecHitIter> RecToRecHitMap;
137 RecToRecHitMap refToRecHitMap;
139 for ( RecHitIter refHitIter = refHitHandle->begin();
140 refHitIter != refHitHandle->end(); ++refHitIter )
143 const RPCRoll* refRoll =
dynamic_cast<const RPCRoll*
>(rpcGeom->roll(refDetId));
144 if ( !refRoll )
continue;
146 const double refX = refHitIter->localPosition().x();
148 for ( RecHitIter recHitIter = recHitHandle->begin();
149 recHitIter != recHitHandle->end(); ++recHitIter )
152 const RPCRoll* recRoll =
dynamic_cast<const RPCRoll*
>(rpcGeom->roll(recDetId));
153 if ( !recRoll )
continue;
155 if ( refDetId != recDetId )
continue;
157 const double recX = recHitIter->localPosition().x();
158 const double newDx = fabs(recX - refX);
161 RecToRecHitMap::const_iterator prevRefToReco = refToRecHitMap.find(refHitIter);
162 if ( prevRefToReco == refToRecHitMap.end() )
164 refToRecHitMap.insert(std::make_pair(refHitIter, recHitIter));
168 const double oldDx = fabs(prevRefToReco->second->localPosition().x() - refX);
172 refToRecHitMap[refHitIter] = recHitIter;
180 for ( RecToRecHitMap::const_iterator
match = refToRecHitMap.begin();
183 RecHitIter refHitIter =
match->first;
184 RecHitIter recHitIter =
match->second;
187 const RPCRoll* roll =
dynamic_cast<const RPCRoll*
>(rpcGeom->roll(detId));
189 const int region = roll->
id().
region();
196 const double refX = refHitIter->localPosition().x();
197 const double recX = recHitIter->localPosition().x();
198 const double errX =
sqrt(recHitIter->localPositionError().xx());
199 const double dX = recX - refX;
200 const double pull = errX == 0 ? -999 : dX/errX;
207 h_.resBarrel->Fill(dX);
208 h_.pullBarrel->Fill(pull);
209 h_.matchOccupancyBarrel_wheel->Fill(ring);
210 h_.matchOccupancyBarrel_station->Fill(station);
211 h_.matchOccupancyBarrel_wheel_station->Fill(ring, station);
213 h_.res_wheel_res->Fill(ring, dX);
214 h_.res_station_res->Fill(station, dX);
215 h_.pull_wheel_pull->Fill(ring, pull);
216 h_.pull_station_pull->Fill(station, pull);
220 h_.resEndcap->Fill(dX);
221 h_.pullEndcap->Fill(pull);
222 h_.matchOccupancyEndcap_disk->Fill(region*station);
223 h_.matchOccupancyEndcap_disk_ring->Fill(region*station, ring);
225 h_.res_disk_res->Fill(region*station, dX);
226 h_.res_ring_res->Fill(ring, dX);
227 h_.pull_disk_pull->Fill(region*station, pull);
228 h_.pull_ring_pull->Fill(ring, pull);
275 for ( RecHitIter recHitIter = recHitHandle->begin();
276 recHitIter != recHitHandle->end(); ++recHitIter )
279 const RPCRoll* roll =
dynamic_cast<const RPCRoll*
>(rpcGeom->roll(detId));
281 const int region = roll->
id().
region();
288 bool matched =
false;
289 for ( RecToRecHitMap::const_iterator
match = refToRecHitMap.begin();
292 if ( recHitIter ==
match->second )
303 h_.umOccupancyBarrel_wheel->Fill(ring);
304 h_.umOccupancyBarrel_station->Fill(station);
305 h_.umOccupancyBarrel_wheel_station->Fill(ring, station);
309 h_.umOccupancyEndcap_disk->Fill(region*station);
310 h_.umOccupancyEndcap_disk_ring->Fill(region*station, ring);
323 h_.bookHistograms(booker, subDir_);
T getParameter(std::string const &) const
void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
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.