27 edm::LogError(
"RPCPointVsRecHit") <<
"No DQMStore instance\n";
32 const std::string subDir = pset.
getParameter<std::string>(
"subDir");
33 h_.bookHistograms(dbe_, subDir);
40 if ( !rootFileName_.empty() )
dbe_->
save(rootFileName_);
56 edm::LogError(
"RPCPointVsRecHit") <<
"No DQMStore instance\n";
66 if ( !event.
getByLabel(refHitLabel_, refHitHandle) )
68 edm::LogInfo(
"RPCPointVsRecHit") <<
"Cannot find reference hit collection\n";
74 if ( !event.
getByLabel(recHitLabel_, recHitHandle) )
76 edm::LogInfo(
"RPCPointVsRecHit") <<
"Cannot find recHit collection\n";
83 for ( RecHitIter refHitIter = refHitHandle->begin();
84 refHitIter != refHitHandle->end(); ++refHitIter )
87 const RPCRoll* roll =
dynamic_cast<const RPCRoll*
>(rpcGeom->roll(detId()));
88 if ( !roll )
continue;
90 const int region = roll->
id().
region();
99 h_.nRefHit_W->Fill(ring);
100 h_.nRefHit_WvsR->Fill(ring, station);
104 h_.nRefHit_D->Fill(region*station);
105 h_.nRefHit_DvsR->Fill(region*station, ring);
113 for ( RecHitIter recHitIter = recHitHandle->begin();
114 recHitIter != recHitHandle->end(); ++recHitIter )
117 const RPCRoll* roll =
dynamic_cast<const RPCRoll*
>(rpcGeom->roll(detId()));
118 if ( !roll )
continue;
120 const int region = roll->
id().
region();
127 h_.clusterSize->Fill(recHitIter->clusterSize());
131 h_.nRecHit_W->Fill(ring);
132 h_.nRecHit_WvsR->Fill(ring, station);
136 h_.nRecHit_D->Fill(region*station);
137 h_.nRecHit_DvsR->Fill(ring, region*station);
146 typedef std::map<RecHitIter, RecHitIter> RecToRecHitMap;
147 RecToRecHitMap refToRecHitMap;
149 for ( RecHitIter refHitIter = refHitHandle->begin();
150 refHitIter != refHitHandle->end(); ++refHitIter )
153 const RPCRoll* refRoll =
dynamic_cast<const RPCRoll*
>(rpcGeom->roll(refDetId));
154 if ( !refRoll )
continue;
156 const double refX = refHitIter->localPosition().x();
158 for ( RecHitIter recHitIter = recHitHandle->begin();
159 recHitIter != recHitHandle->end(); ++recHitIter )
162 const RPCRoll* recRoll =
dynamic_cast<const RPCRoll*
>(rpcGeom->roll(recDetId));
163 if ( !recRoll )
continue;
165 if ( refDetId != recDetId )
continue;
167 const double recX = recHitIter->localPosition().x();
168 const double newDx = fabs(recX - refX);
171 RecToRecHitMap::const_iterator prevRefToReco = refToRecHitMap.find(refHitIter);
172 if ( prevRefToReco == refToRecHitMap.end() )
174 refToRecHitMap.insert(std::make_pair(refHitIter, recHitIter));
178 const double oldDx = fabs(prevRefToReco->second->localPosition().x() - refX);
182 refToRecHitMap[refHitIter] = recHitIter;
190 for ( RecToRecHitMap::const_iterator
match = refToRecHitMap.begin();
193 RecHitIter refHitIter =
match->first;
194 RecHitIter recHitIter =
match->second;
197 const RPCRoll* roll =
dynamic_cast<const RPCRoll*
>(rpcGeom->roll(detId));
199 const int region = roll->
id().
region();
206 const double refX = refHitIter->localPosition().x();
207 const double recX = recHitIter->localPosition().x();
208 const double errX = recHitIter->localPositionError().xx();
209 const double dX = recX - refX;
210 const double pull = errX == 0 ? -999 : dX/errX;
218 h_.pull_W->Fill(pull);
219 h_.nMatchedRefHit_W->Fill(ring);
220 h_.nMatchedRefHit_WvsR->Fill(ring, station);
222 h_.res2_W->Fill(ring, dX);
223 h_.pull2_W->Fill(ring, pull);
228 h_.pull_D->Fill(pull);
229 h_.nMatchedRefHit_D->Fill(region*station);
230 h_.nMatchedRefHit_DvsR->Fill(region*station, ring);
232 h_.res2_D->Fill(region*station, dX);
233 h_.pull2_D->Fill(region*station, pull);
238 for ( RecHitIter refHitIter = refHitHandle->begin();
239 refHitIter != refHitHandle->end(); ++refHitIter )
242 const RPCRoll* roll =
dynamic_cast<const RPCRoll*
>(rpcGeom->roll(detId));
244 const int region = roll->
id().
region();
251 bool matched =
false;
252 for ( RecToRecHitMap::const_iterator
match = refToRecHitMap.begin();
255 if ( refHitIter ==
match->first )
266 h_.nUnMatchedRefHit_W->Fill(ring);
267 h_.nUnMatchedRefHit_WvsR->Fill(ring, station);
271 h_.nUnMatchedRefHit_D->Fill(region*station);
272 h_.nUnMatchedRefHit_DvsR->Fill(region*station, ring);
278 for ( RecHitIter recHitIter = recHitHandle->begin();
279 recHitIter != recHitHandle->end(); ++recHitIter )
282 const RPCRoll* roll =
dynamic_cast<const RPCRoll*
>(rpcGeom->roll(detId));
284 const int region = roll->
id().
region();
291 bool matched =
false;
292 for ( RecToRecHitMap::const_iterator
match = refToRecHitMap.begin();
295 if ( recHitIter ==
match->second )
306 h_.nUnMatchedRecHit_W->Fill(ring);
307 h_.nUnMatchedRecHit_WvsR->Fill(ring, station);
311 h_.nUnMatchedRecHit_D->Fill(region*station);
312 h_.nUnMatchedRecHit_DvsR->Fill(region*station, ring);
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
#define DEFINE_FWK_MODULE(type)
GlobalPoint toGlobal(const Local2DPoint &lp) const
Conversion to the global R.F. from the R.F. of the GeomDet.
void save(const std::string &filename, const std::string &path="", const std::string &pattern="", const std::string &rewrite="", SaveReferenceTag ref=SaveWithReference, int minStatus=dqm::qstatus::STATUS_OK, const std::string &fileupdate="RECREATE")
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.