43 h_.bookHistograms(dbe_, subDir_);
46 dbe_->setCurrentFolder(subDir_+
"/HitProperty");
47 h_simTrackPType = dbe_->book1D(
"SimHitPType",
"SimHit particle type", 11, 0, 11);
48 if ( TH1*
h = h_simTrackPType->getTH1() )
50 h->GetXaxis()->SetBinLabel(1 ,
"#mu^{-}");
51 h->GetXaxis()->SetBinLabel(2 ,
"#mu^{+}");
52 h->GetXaxis()->SetBinLabel(3 ,
"e^{-}" );
53 h->GetXaxis()->SetBinLabel(4 ,
"e^{+}" );
54 h->GetXaxis()->SetBinLabel(5 ,
"#pi^{+}");
55 h->GetXaxis()->SetBinLabel(6 ,
"#pi^{-}");
56 h->GetXaxis()->SetBinLabel(7 ,
"K^{+}" );
57 h->GetXaxis()->SetBinLabel(8 ,
"K^{-}" );
58 h->GetXaxis()->SetBinLabel(9 ,
"p^{+}" );
59 h->GetXaxis()->SetBinLabel(10,
"p^{-}" );
60 h->GetXaxis()->SetBinLabel(11,
"Other" );
63 dbe_->setCurrentFolder(subDir_+
"/Track");
65 h_nRPCHitPerSimMuon = dbe_->book1D(
"NRPCHitPerSimMuon" ,
"Number of RPC SimHit per SimMuon", 11, -0.5, 10.5);
66 h_nRPCHitPerSimMuonBarrel = dbe_->book1D(
"NRPCHitPerSimMuonBarrel" ,
"Number of RPC SimHit per SimMuon", 11, -0.5, 10.5);
67 h_nRPCHitPerSimMuonOverlap = dbe_->book1D(
"NRPCHitPerSimMuonOverlap",
"Number of RPC SimHit per SimMuon", 11, -0.5, 10.5);
68 h_nRPCHitPerSimMuonEndcap = dbe_->book1D(
"NRPCHitPerSimMuonEndcap" ,
"Number of RPC SimHit per SimMuon", 11, -0.5, 10.5);
70 h_nRPCHitPerRecoMuon = dbe_->book1D(
"NRPCHitPerRecoMuon" ,
"Number of RPC RecHit per RecoMuon", 11, -0.5, 10.5);
71 h_nRPCHitPerRecoMuonBarrel = dbe_->book1D(
"NRPCHitPerRecoMuonBarrel" ,
"Number of RPC RecHit per RecoMuon", 11, -0.5, 10.5);
72 h_nRPCHitPerRecoMuonOverlap = dbe_->book1D(
"NRPCHitPerRecoMuonOverlap",
"Number of RPC RecHit per RecoMuon", 11, -0.5, 10.5);
73 h_nRPCHitPerRecoMuonEndcap = dbe_->book1D(
"NRPCHitPerRecoMuonEndcap" ,
"Number of RPC RecHit per RecoMuon", 11, -0.5, 10.5);
75 float ptBins[] = {0, 1, 2, 5, 10, 20, 30, 50, 100, 200, 300, 500};
76 const int nPtBins =
sizeof(
ptBins)/
sizeof(
float)-1;
77 h_simMuonBarrel_pt = dbe_->book1D(
"SimMuonBarrel_pt" ,
"SimMuon RPCHit in Barrel p_{T};p_{T} [GeV/c^{2}]", nPtBins, ptBins);
78 h_simMuonOverlap_pt = dbe_->book1D(
"SimMuonOverlap_pt" ,
"SimMuon RPCHit in Overlap p_{T};p_{T} [GeV/c^{2}]", nPtBins, ptBins);
79 h_simMuonEndcap_pt = dbe_->book1D(
"SimMuonEndcap_pt" ,
"SimMuon RPCHit in Endcap p_{T};p_{T} [GeV/c^{2}]", nPtBins, ptBins);
80 h_simMuonNoRPC_pt = dbe_->book1D(
"SimMuonNoRPC_pt" ,
"SimMuon without RPCHit p_{T};p_{T} [GeV/c^{2}]", nPtBins, ptBins);
81 h_simMuonBarrel_eta = dbe_->book1D(
"SimMuonBarrel_eta" ,
"SimMuon RPCHit in Barrel #eta;#eta", 50, -2.5, 2.5);
82 h_simMuonOverlap_eta = dbe_->book1D(
"SimMuonOverlap_eta",
"SimMuon RPCHit in Overlap #eta;#eta", 50, -2.5, 2.5);
83 h_simMuonEndcap_eta = dbe_->book1D(
"SimMuonEndcap_eta" ,
"SimMuon RPCHit in Endcap #eta;#eta", 50, -2.5, 2.5);
84 h_simMuonNoRPC_eta = dbe_->book1D(
"SimMuonNoRPC_eta",
"SimMuon without RPCHit #eta;#eta", 50, -2.5, 2.5);
85 h_simMuonBarrel_phi = dbe_->book1D(
"SimMuonBarrel_phi" ,
"SimMuon RPCHit in Barrel #phi;#phi", 36, -
TMath::Pi(),
TMath::Pi());
86 h_simMuonOverlap_phi = dbe_->book1D(
"SimMuonOverlap_phi",
"SimMuon RPCHit in Overlap #phi;#phi", 36, -
TMath::Pi(),
TMath::Pi());
87 h_simMuonEndcap_phi = dbe_->book1D(
"SimMuonEndcap_phi" ,
"SimMuon RPCHit in Endcap #phi;#phi", 36, -
TMath::Pi(),
TMath::Pi());
88 h_simMuonNoRPC_phi = dbe_->book1D(
"SimMuonNoRPC_phi",
"SimMuon without RPCHit #phi;#phi", 36, -
TMath::Pi(),
TMath::Pi());
90 h_recoMuonBarrel_pt = dbe_->book1D(
"RecoMuonBarrel_pt" ,
"RecoMuon RPCHit in Barrel p_{T};p_{T} [GeV/c^{2}]", nPtBins, ptBins);
91 h_recoMuonOverlap_pt = dbe_->book1D(
"RecoMuonOverlap_pt" ,
"RecoMuon RPCHit in Overlap p_{T};p_{T} [GeV/c^{2}]", nPtBins, ptBins);
92 h_recoMuonEndcap_pt = dbe_->book1D(
"RecoMuonEndcap_pt" ,
"RecoMuon RPCHit in Endcap p_{T};p_{T} [GeV/c^{2}]", nPtBins, ptBins);
93 h_recoMuonNoRPC_pt = dbe_->book1D(
"RecoMuonNoRPC_pt" ,
"RecoMuon without RPCHit p_{T};p_{T} [GeV/c^{2}]", nPtBins, ptBins);
94 h_recoMuonBarrel_eta = dbe_->book1D(
"RecoMuonBarrel_eta" ,
"RecoMuon RPCHit in Barrel #eta;#eta", 50, -2.5, 2.5);
95 h_recoMuonOverlap_eta = dbe_->book1D(
"RecoMuonOverlap_eta",
"RecoMuon RPCHit in Overlap #eta;#eta", 50, -2.5, 2.5);
96 h_recoMuonEndcap_eta = dbe_->book1D(
"RecoMuonEndcap_eta" ,
"RecoMuon RPCHit in Endcap #eta;#eta", 50, -2.5, 2.5);
97 h_recoMuonNoRPC_eta = dbe_->book1D(
"RecoMuonNoRPC_eta",
"RecoMuon without RPCHit #eta;#eta", 50, -2.5, 2.5);
98 h_recoMuonBarrel_phi = dbe_->book1D(
"RecoMuonBarrel_phi" ,
"RecoMuon RPCHit in Barrel #phi;#phi", 36, -
TMath::Pi(),
TMath::Pi());
99 h_recoMuonOverlap_phi = dbe_->book1D(
"RecoMuonOverlap_phi",
"RecoMuon RPCHit in Overlap #phi;#phi", 36, -
TMath::Pi(),
TMath::Pi());
100 h_recoMuonEndcap_phi = dbe_->book1D(
"RecoMuonEndcap_phi" ,
"RecoMuon RPCHit in Endcap #phi;#phi", 36, -
TMath::Pi(),
TMath::Pi());
101 h_recoMuonNoRPC_phi = dbe_->book1D(
"RecoMuonNoRPC_phi",
"RecoMuon without RPCHit #phi;#phi", 36, -
TMath::Pi(),
TMath::Pi());
103 dbe_->setCurrentFolder(subDir_+
"/Occupancy");
105 h_eventCount = dbe_->book1D(
"EventCount",
"Event count", 3, 1, 4);
108 TH1*
h = h_eventCount->getTH1();
109 h->GetXaxis()->SetBinLabel(1,
"eventBegin");
110 h->GetXaxis()->SetBinLabel(2,
"eventEnd");
111 h->GetXaxis()->SetBinLabel(3,
"run");
114 h_refPunchOccupancyBarrel_wheel = dbe_->book1D(
"RefPunchOccupancyBarrel_wheel" ,
"RefPunchthrough occupancy", 5, -2.5, 2.5);
115 h_refPunchOccupancyEndcap_disk = dbe_->book1D(
"RefPunchOccupancyEndcap_disk" ,
"RefPunchthrough occupancy", 7, -3.5, 3.5);
116 h_refPunchOccupancyBarrel_station = dbe_->book1D(
"RefPunchOccupancyBarrel_station",
"RefPunchthrough occupancy", 4, 0.5, 4.5);
117 h_recPunchOccupancyBarrel_wheel = dbe_->book1D(
"RecPunchOccupancyBarrel_wheel" ,
"Punchthrough recHit occupancy", 5, -2.5, 2.5);
118 h_recPunchOccupancyEndcap_disk = dbe_->book1D(
"RecPunchOccupancyEndcap_disk" ,
"Punchthrough recHit occupancy", 7, -3.5, 3.5);
119 h_recPunchOccupancyBarrel_station = dbe_->book1D(
"RecPunchOccupancyBarrel_station",
"Punchthrough recHit occupancy", 4, 0.5, 4.5);
121 h_refPunchOccupancyBarrel_wheel_station = dbe_->book2D(
"RefPunchOccupancyBarrel_wheel_station",
"RefPunchthrough occupancy", 5, -2.5, 2.5, 4, 0.5, 4.5);
122 h_refPunchOccupancyEndcap_disk_ring = dbe_->book2D(
"RefPunchOccupancyEndcap_disk_ring" ,
"RefPunchthrough occupancy", 7, -3.5, 3.5, 4, 0.5, 4.5);
123 h_recPunchOccupancyBarrel_wheel_station = dbe_->book2D(
"RecPunchOccupancyBarrel_wheel_station",
"Punchthrough recHit occupancy", 5, -2.5, 2.5, 4, 0.5, 4.5);
124 h_recPunchOccupancyEndcap_disk_ring = dbe_->book2D(
"RecPunchOccupancyEndcap_disk_ring" ,
"Punchthrough recHit occupancy", 7, -3.5, 3.5, 4, 0.5, 4.5);
126 h_refPunchOccupancyBarrel_wheel_station->getTH2F()->SetOption(
"COLZ");
127 h_refPunchOccupancyEndcap_disk_ring ->getTH2F()->SetOption(
"COLZ");
128 h_recPunchOccupancyBarrel_wheel_station->getTH2F()->SetOption(
"COLZ");
129 h_recPunchOccupancyEndcap_disk_ring ->getTH2F()->SetOption(
"COLZ");
131 for (
int i=1;
i<=5; ++
i )
133 TString binLabel = Form(
"Wheel %d",
i-3);
134 h_refPunchOccupancyBarrel_wheel->getTH1()->GetXaxis()->SetBinLabel(
i, binLabel);
135 h_refPunchOccupancyBarrel_wheel_station->getTH2F()->GetXaxis()->SetBinLabel(
i, binLabel);
136 h_recPunchOccupancyBarrel_wheel->getTH1()->GetXaxis()->SetBinLabel(
i, binLabel);
137 h_recPunchOccupancyBarrel_wheel_station->getTH2F()->GetXaxis()->SetBinLabel(
i, binLabel);
140 for (
int i=1;
i<=7; ++
i )
142 TString binLabel = Form(
"Disk %d",
i-4);
143 h_refPunchOccupancyEndcap_disk ->getTH1()->GetXaxis()->SetBinLabel(
i, binLabel);
144 h_refPunchOccupancyEndcap_disk_ring ->getTH2F()->GetXaxis()->SetBinLabel(
i, binLabel);
145 h_recPunchOccupancyEndcap_disk ->getTH1()->GetXaxis()->SetBinLabel(
i, binLabel);
146 h_recPunchOccupancyEndcap_disk_ring ->getTH2F()->GetXaxis()->SetBinLabel(
i, binLabel);
149 for (
int i=1;
i<=4; ++
i )
151 TString binLabel = Form(
"Station %d",
i);
152 h_refPunchOccupancyBarrel_station ->getTH1()->GetXaxis()->SetBinLabel(
i, binLabel);
153 h_refPunchOccupancyBarrel_wheel_station ->getTH2F()->GetYaxis()->SetBinLabel(
i, binLabel);
154 h_recPunchOccupancyBarrel_station ->getTH1()->GetXaxis()->SetBinLabel(
i, binLabel);
155 h_recPunchOccupancyBarrel_wheel_station ->getTH2F()->GetYaxis()->SetBinLabel(
i, binLabel);
158 for (
int i=1;
i<=4; ++
i )
160 TString binLabel = Form(
"Ring %d",
i);
161 h_refPunchOccupancyEndcap_disk_ring ->getTH2F()->GetYaxis()->SetBinLabel(
i, binLabel);
162 h_recPunchOccupancyEndcap_disk_ring ->getTH2F()->GetYaxis()->SetBinLabel(
i, binLabel);
181 h_eventCount->Fill(3);
187 int nRPCRollBarrel = 0, nRPCRollEndcap = 0;
190 for ( TrackingGeometry::DetContainer::const_iterator detIter = rpcDets.begin();
191 detIter != rpcDets.end(); ++detIter )
194 if ( !rpcCh )
continue;
196 std::vector<const RPCRoll*> rolls = rpcCh->
rolls();
197 for ( std::vector<const RPCRoll*>::const_iterator rollIter = rolls.begin();
198 rollIter != rolls.end(); ++rollIter )
200 const RPCRoll* roll = *rollIter;
201 if ( !roll )
continue;
209 detIdToIndexMapBarrel_[rawId] = nRPCRollBarrel;
215 detIdToIndexMapEndcap_[rawId] = nRPCRollEndcap;
223 h_matchOccupancyBarrel_detId =
dbe_->
book1D(
"MatchOccupancyBarrel_detId",
"Matched hit occupancy;roll index (can be arbitrary)", nRPCRollBarrel, 0, nRPCRollBarrel);
224 h_matchOccupancyEndcap_detId =
dbe_->
book1D(
"MatchOccupancyEndcap_detId",
"Matched hit occupancy;roll index (can be arbitrary)", nRPCRollEndcap, 0, nRPCRollEndcap);
225 h_refOccupancyBarrel_detId =
dbe_->
book1D(
"RefOccupancyBarrel_detId",
"Reference hit occupancy;roll index (can be arbitrary)", nRPCRollBarrel, 0, nRPCRollBarrel);
226 h_refOccupancyEndcap_detId =
dbe_->
book1D(
"RefOccupancyEndcap_detId",
"Reference hit occupancy;roll index (can be arbitrary)", nRPCRollEndcap, 0, nRPCRollEndcap);
227 h_noiseOccupancyBarrel_detId =
dbe_->
book1D(
"NoiseOccupancyBarrel_detId",
"Noise occupancy;roll index (can be arbitrary)", nRPCRollBarrel, 0, nRPCRollBarrel);
228 h_noiseOccupancyEndcap_detId =
dbe_->
book1D(
"NoiseOccupancyEndcap_detId",
"Noise occupancy;roll index (can be arbitrary)", nRPCRollEndcap, 0, nRPCRollEndcap);
236 const int nRPCRollBarrel = detIdToIndexMapBarrel_.size();
237 const int nRPCRollEndcap = detIdToIndexMapEndcap_.size();
239 h_rollAreaBarrel_detId =
dbe_->
bookProfile(
"RollAreaBarrel_detId",
"Roll area;roll index;Area", nRPCRollBarrel, 0., 1.*nRPCRollBarrel, 0., 1e5);
240 h_rollAreaEndcap_detId =
dbe_->
bookProfile(
"RollAreaEndcap_detId",
"Roll area;roll index;Area", nRPCRollEndcap, 0., 1.*nRPCRollEndcap, 0., 1e5);
245 for ( map<int, int>::const_iterator iter = detIdToIndexMapBarrel_.begin();
246 iter != detIdToIndexMapBarrel_.end(); ++iter )
248 const int rawId = iter->first;
249 const int index = iter->second;
252 const RPCRoll* roll =
dynamic_cast<const RPCRoll*
>(rpcGeom->roll(rpcDetId));
260 h_rollAreaBarrel_detId->Fill(index, area);
263 for ( map<int, int>::const_iterator iter = detIdToIndexMapEndcap_.begin();
264 iter != detIdToIndexMapEndcap_.end(); ++iter )
266 const int rawId = iter->first;
267 const int index = iter->second;
270 const RPCRoll* roll =
dynamic_cast<const RPCRoll*
>(rpcGeom->roll(rpcDetId));
278 h_rollAreaEndcap_detId->Fill(index, area);
285 h_eventCount->Fill(1);
293 if ( !event.
getByLabel(simHitLabel_, simHitHandle) )
295 edm::LogInfo(
"RPCRecHitValid") <<
"Cannot find simHit collection\n";
301 if ( !event.
getByLabel(recHitLabel_, recHitHandle) )
303 edm::LogInfo(
"RPCRecHitValid") <<
"Cannot find recHit collection\n";
309 if ( !event.
getByLabel(simTrackLabel_, simTrackHandle) )
311 edm::LogInfo(
"RPCRecHitValid") <<
"Cannot find simTrack collection\n";
317 if ( !event.
getByLabel(muonLabel_, muonHandle) )
319 edm::LogInfo(
"RPCRecHitValid") <<
"Cannot find muon collection\n";
323 typedef edm::PSimHitContainer::const_iterator SimHitIter;
326 std::vector<const PSimHit*> muonSimHits;
327 std::vector<const PSimHit*> pthrSimHits;
329 simTrack != simTrackHandle->end(); ++simTrack )
331 if ( simTrack->pt() < 1.0
or simTrack->p() < 2.5 )
continue;
333 bool hasRPCHit =
false;
334 if (
abs(simTrack->pdgId()) == 13 )
336 int nRPCHitBarrel = 0;
337 int nRPCHitEndcap = 0;
339 for ( SimHitIter simHit = simTrack->pSimHit_begin();
340 simHit != simTrack->pSimHit_end(); ++simHit )
342 const DetId detId(simHit->detUnitId());
345 const RPCRoll* roll =
dynamic_cast<const RPCRoll*
>(rpcGeom->roll(rpcDetId));
346 if ( !roll )
continue;
348 if ( rpcDetId.
region() == 0 ) ++nRPCHitBarrel;
349 else ++nRPCHitEndcap;
351 muonSimHits.push_back(&*simHit);
354 const int nRPCHit = nRPCHitBarrel+nRPCHitEndcap;
355 hasRPCHit = nRPCHit > 0;
356 h_nRPCHitPerSimMuon->Fill(nRPCHit);
357 if ( nRPCHitBarrel and nRPCHitEndcap )
359 h_nRPCHitPerSimMuonOverlap->Fill(nRPCHit);
360 h_simMuonOverlap_pt->Fill(simTrack->pt());
361 h_simMuonOverlap_eta->Fill(simTrack->eta());
362 h_simMuonOverlap_phi->Fill(simTrack->phi());
364 else if ( nRPCHitBarrel )
366 h_nRPCHitPerSimMuonBarrel->Fill(nRPCHit);
367 h_simMuonBarrel_pt->Fill(simTrack->pt());
368 h_simMuonBarrel_eta->Fill(simTrack->eta());
369 h_simMuonBarrel_phi->Fill(simTrack->phi());
371 else if ( nRPCHitEndcap )
373 h_nRPCHitPerSimMuonEndcap->Fill(nRPCHit);
374 h_simMuonEndcap_pt->Fill(simTrack->pt());
375 h_simMuonEndcap_eta->Fill(simTrack->eta());
376 h_simMuonEndcap_phi->Fill(simTrack->phi());
380 h_simMuonNoRPC_pt->Fill(simTrack->pt());
381 h_simMuonNoRPC_eta->Fill(simTrack->eta());
382 h_simMuonNoRPC_phi->Fill(simTrack->phi());
388 for ( SimHitIter simHit = simTrack->pSimHit_begin();
389 simHit != simTrack->pSimHit_end(); ++simHit )
391 const DetId detId(simHit->detUnitId());
394 const RPCRoll* roll =
dynamic_cast<const RPCRoll*
>(rpcGeom->roll(rpcDetId()));
395 if ( !roll )
continue;
398 pthrSimHits.push_back(&*simHit);
400 hasRPCHit = nRPCHit > 0;
405 switch ( simTrack->pdgId() )
407 case 13: h_simTrackPType->Fill( 0);
break;
408 case -13: h_simTrackPType->Fill( 1);
break;
409 case 11: h_simTrackPType->Fill( 2);
break;
410 case -11: h_simTrackPType->Fill( 3);
break;
411 case 211: h_simTrackPType->Fill( 4);
break;
412 case -211: h_simTrackPType->Fill( 5);
break;
413 case 321: h_simTrackPType->Fill( 6);
break;
414 case -321: h_simTrackPType->Fill( 7);
break;
415 case 2212: h_simTrackPType->Fill( 8);
break;
416 case -2212: h_simTrackPType->Fill( 9);
break;
417 default: h_simTrackPType->Fill(10);
break;
423 int nRefHitBarrel = 0, nRefHitEndcap = 0;
424 for ( std::vector<const PSimHit*>::const_iterator simHitP = muonSimHits.begin();
425 simHitP != muonSimHits.end(); ++simHitP )
427 const PSimHit* simHit = *simHitP;
429 const RPCRoll* roll =
dynamic_cast<const RPCRoll*
>(rpcGeom->roll(detId));
431 const int region = roll->
id().
region();
441 h_.refHitOccupancyBarrel_wheel->Fill(ring);
442 h_.refHitOccupancyBarrel_station->Fill(station);
443 h_.refHitOccupancyBarrel_wheel_station->Fill(ring, station);
445 h_refOccupancyBarrel_detId->Fill(detIdToIndexMapBarrel_[simHit->
detUnitId()]);
450 h_.refHitOccupancyEndcap_disk->Fill(region*station);
451 h_.refHitOccupancyEndcap_disk_ring->Fill(region*station, ring);
453 h_refOccupancyEndcap_detId->Fill(detIdToIndexMapEndcap_[simHit->
detUnitId()]);
458 for ( std::vector<const PSimHit*>::const_iterator simHitP = pthrSimHits.begin();
459 simHitP != pthrSimHits.end(); ++simHitP )
461 const PSimHit* simHit = *simHitP;
463 const RPCRoll* roll =
dynamic_cast<const RPCRoll*
>(rpcGeom->roll(detId()));
465 const int region = roll->
id().
region();
475 h_refPunchOccupancyBarrel_wheel->Fill(ring);
476 h_refPunchOccupancyBarrel_station->Fill(station);
477 h_refPunchOccupancyBarrel_wheel_station->Fill(ring, station);
479 h_refOccupancyBarrel_detId->Fill(detIdToIndexMapBarrel_[simHit->
detUnitId()]);
484 h_refPunchOccupancyEndcap_disk->Fill(region*station);
485 h_refPunchOccupancyEndcap_disk_ring->Fill(region*station, ring);
487 h_refOccupancyEndcap_detId->Fill(detIdToIndexMapEndcap_[simHit->
detUnitId()]);
490 h_.nRefHitBarrel->Fill(nRefHitBarrel);
491 h_.nRefHitEndcap->Fill(nRefHitEndcap);
494 int sumClusterSizeBarrel = 0, sumClusterSizeEndcap = 0;
495 int nRecHitBarrel = 0, nRecHitEndcap = 0;
496 for ( RecHitIter recHitIter = recHitHandle->begin();
497 recHitIter != recHitHandle->end(); ++recHitIter )
500 const RPCRoll* roll =
dynamic_cast<const RPCRoll*
>(rpcGeom->roll(detId()));
501 if ( !roll )
continue;
503 const int region = roll->
id().
region();
510 h_.clusterSize->Fill(recHitIter->clusterSize());
515 sumClusterSizeBarrel += recHitIter->clusterSize();
516 h_.clusterSizeBarrel->Fill(recHitIter->clusterSize());
517 h_.recHitOccupancyBarrel_wheel->Fill(ring);
518 h_.recHitOccupancyBarrel_station->Fill(station);
519 h_.recHitOccupancyBarrel_wheel_station->Fill(ring, station);
524 sumClusterSizeEndcap += recHitIter->clusterSize();
525 h_.clusterSizeEndcap->Fill(recHitIter->clusterSize());
526 h_.recHitOccupancyEndcap_disk->Fill(region*station);
527 h_.recHitOccupancyEndcap_disk_ring->Fill(region*station, ring);
531 const double nRecHit = nRecHitBarrel+nRecHitEndcap;
532 h_.nRecHitBarrel->Fill(nRecHitBarrel);
533 h_.nRecHitEndcap->Fill(nRecHitEndcap);
536 const int sumClusterSize = sumClusterSizeBarrel+sumClusterSizeEndcap;
537 h_.avgClusterSize->Fill(
double(sumClusterSize)/nRecHit);
539 if ( nRecHitBarrel > 0 )
541 h_.avgClusterSizeBarrel->Fill(
double(sumClusterSizeBarrel)/nRecHitBarrel);
543 if ( nRecHitEndcap > 0 )
545 h_.avgClusterSizeEndcap->Fill(
double(sumClusterSizeEndcap)/nRecHitEndcap);
550 typedef std::map<const PSimHit*, RecHitIter> SimToRecHitMap;
551 SimToRecHitMap simToRecHitMap;
553 for ( std::vector<const PSimHit*>::const_iterator simHitP = muonSimHits.begin();
554 simHitP != muonSimHits.end(); ++simHitP )
556 const PSimHit* simHit = *simHitP;
562 for ( RecHitIter recHitIter = recHitHandle->begin();
563 recHitIter != recHitHandle->end(); ++recHitIter )
566 const RPCRoll* recRoll =
dynamic_cast<const RPCRoll*
>(rpcGeom->roll(recDetId));
567 if ( !recRoll )
continue;
569 if ( simDetId != recDetId )
continue;
571 const double recX = recHitIter->localPosition().x();
572 const double newDx = fabs(recX - simX);
575 SimToRecHitMap::const_iterator prevSimToReco = simToRecHitMap.find(simHit);
576 if ( prevSimToReco == simToRecHitMap.end() )
578 simToRecHitMap.insert(std::make_pair(simHit, recHitIter));
582 const double oldDx = fabs(prevSimToReco->second->localPosition().x() - simX);
586 simToRecHitMap[simHit] = recHitIter;
594 int nMatchHitBarrel = 0, nMatchHitEndcap = 0;
595 for ( SimToRecHitMap::const_iterator
match = simToRecHitMap.begin();
599 RecHitIter recHitIter =
match->second;
602 const RPCRoll* roll =
dynamic_cast<const RPCRoll*
>(rpcGeom->roll(detId));
604 const int region = roll->
id().
region();
612 const double recX = recHitIter->localPosition().x();
613 const double errX =
sqrt(recHitIter->localPositionError().xx());
614 const double dX = recX - simX;
615 const double pull = errX == 0 ? -999 : dX/errX;
623 h_.resBarrel->Fill(dX);
624 h_.pullBarrel->Fill(pull);
625 h_.matchOccupancyBarrel_wheel->Fill(ring);
626 h_.matchOccupancyBarrel_station->Fill(station);
627 h_.matchOccupancyBarrel_wheel_station->Fill(ring, station);
629 h_.res_wheel_res->Fill(ring, dX);
630 h_.res_station_res->Fill(station, dX);
631 h_.pull_wheel_pull->Fill(ring, pull);
632 h_.pull_station_pull->Fill(station, pull);
634 h_matchOccupancyBarrel_detId->Fill(detIdToIndexMapBarrel_[detId.
rawId()]);
639 h_.resEndcap->Fill(dX);
640 h_.pullEndcap->Fill(pull);
641 h_.matchOccupancyEndcap_disk->Fill(region*station);
642 h_.matchOccupancyEndcap_disk_ring->Fill(region*station, ring);
644 h_.res_disk_res->Fill(region*station, dX);
645 h_.res_ring_res->Fill(ring, dX);
646 h_.pull_disk_pull->Fill(region*station, pull);
647 h_.pull_ring_pull->Fill(ring, pull);
649 h_matchOccupancyEndcap_detId->Fill(detIdToIndexMapEndcap_[detId.
rawId()]);
653 h_.nMatchHitBarrel->Fill(nMatchHitBarrel);
654 h_.nMatchHitEndcap->Fill(nMatchHitEndcap);
660 if ( !
muon->isGlobalMuon() )
continue;
662 int nRPCHitBarrel = 0;
663 int nRPCHitEndcap = 0;
667 recHit != glbTrack->recHitsEnd(); ++recHit )
669 if ( !(*recHit)->isValid() )
continue;
670 const DetId detId = (*recHit)->geographicalId();
674 if ( rpcDetId.
region() == 0 ) ++nRPCHitBarrel;
675 else ++nRPCHitEndcap;
678 const int nRPCHit = nRPCHitBarrel + nRPCHitEndcap;
679 h_nRPCHitPerRecoMuon->Fill(nRPCHit);
680 if ( nRPCHitBarrel and nRPCHitEndcap )
682 h_nRPCHitPerRecoMuonOverlap->Fill(nRPCHit);
683 h_recoMuonOverlap_pt->Fill(
muon->pt());
684 h_recoMuonOverlap_eta->Fill(
muon->eta());
685 h_recoMuonOverlap_phi->Fill(
muon->phi());
687 else if ( nRPCHitBarrel )
689 h_nRPCHitPerRecoMuonBarrel->Fill(nRPCHit);
690 h_recoMuonBarrel_pt->Fill(
muon->pt());
691 h_recoMuonBarrel_eta->Fill(
muon->eta());
692 h_recoMuonBarrel_phi->Fill(
muon->phi());
694 else if ( nRPCHitEndcap )
696 h_nRPCHitPerRecoMuonEndcap->Fill(nRPCHit);
697 h_recoMuonEndcap_pt->Fill(
muon->pt());
698 h_recoMuonEndcap_eta->Fill(
muon->eta());
699 h_recoMuonEndcap_phi->Fill(
muon->phi());
703 h_recoMuonNoRPC_pt->Fill(
muon->pt());
704 h_recoMuonNoRPC_eta->Fill(
muon->eta());
705 h_recoMuonNoRPC_phi->Fill(
muon->phi());
710 for ( RecHitIter recHitIter = recHitHandle->begin();
711 recHitIter != recHitHandle->end(); ++recHitIter )
714 const RPCRoll* roll =
dynamic_cast<const RPCRoll*
>(rpcGeom->roll(detId));
716 const int region = roll->
id().
region();
723 bool matched =
false;
724 for ( SimToRecHitMap::const_iterator
match = simToRecHitMap.begin();
727 if ( recHitIter ==
match->second )
739 h_.umOccupancyBarrel_wheel->Fill(ring);
740 h_.umOccupancyBarrel_station->Fill(station);
741 h_.umOccupancyBarrel_wheel_station->Fill(ring, station);
745 h_.umOccupancyEndcap_disk->Fill(region*station);
746 h_.umOccupancyEndcap_disk_ring->Fill(region*station, ring);
750 int nPunchMatched = 0;
752 for ( std::vector<const PSimHit*>::const_iterator pthrSimHitP = pthrSimHits.begin();
753 pthrSimHitP != pthrSimHits.end(); ++pthrSimHitP )
755 const PSimHit* simHit = *pthrSimHitP;
757 if ( absSimHitPType == 13 )
continue;
760 if ( simDetId == detId ) ++nPunchMatched;
763 if ( nPunchMatched > 0 )
767 h_recPunchOccupancyBarrel_wheel->Fill(ring);
768 h_recPunchOccupancyBarrel_station->Fill(station);
769 h_recPunchOccupancyBarrel_wheel_station->Fill(ring, station);
773 h_recPunchOccupancyEndcap_disk->Fill(region*station);
774 h_recPunchOccupancyEndcap_disk_ring->Fill(region*station, ring);
781 for ( RecHitIter recHitIter = recHitHandle->begin();
782 recHitIter != recHitHandle->end(); ++recHitIter )
785 const RPCRoll* roll =
dynamic_cast<const RPCRoll*
>(rpcGeom->roll(recDetId));
787 const int region = roll->
id().
region();
794 const double recX = recHitIter->localPosition().x();
795 const double recErrX =
sqrt(recHitIter->localPositionError().xx());
797 bool matched =
false;
798 for ( SimHitIter simHitIter = simHitHandle->begin();
799 simHitIter != simHitHandle->end(); ++simHitIter )
801 const RPCDetId simDetId =
static_cast<const RPCDetId>(simHitIter->detUnitId());
802 const RPCRoll* simRoll =
dynamic_cast<const RPCRoll*
>(rpcGeom->roll(simDetId));
803 if ( !simRoll )
continue;
805 if ( simDetId != recDetId )
continue;
807 const double simX = simHitIter->localPosition().x();
808 const double dX = fabs(recX-simX);
810 if ( dX/recErrX < 5 )
821 h_noiseOccupancyBarrel_detId->Fill(detIdToIndexMapBarrel_[recDetId.
rawId()]);
825 h_noiseOccupancyEndcap_detId->Fill(detIdToIndexMapEndcap_[recDetId.
rawId()]);
830 h_eventCount->Fill(2);
T getParameter(std::string const &) const
virtual int nstrips() const =0
boost::indirect_iterator< typename seq_t::const_iterator > const_iterator
void beginRun(const edm::Run &run, const edm::EventSetup &eventSetup)
RPCRecHitValid(const edm::ParameterSet &pset)
MonitorElement * book1D(const char *name, const char *title, int nchX, double lowX, double highX)
Book 1D histogram.
The Signals That Services Can Subscribe To This is based on ActivityRegistry and is current per Services can connect to the signals distributed by the ActivityRegistry in order to monitor the activity of the application Each possible callback has some defined which we here list in angle e< void, edm::EventIDconst &, edm::Timestampconst & > We also list in braces which AR_WATCH_USING_METHOD_ is used for those or
void endRun(const edm::Run &run, const edm::EventSetup &eventSetup)
#define DEFINE_FWK_MODULE(type)
std::vector< GeomDet * > DetContainer
const StripTopology & specificTopology() const
uint32_t rawId() const
get the raw id
C::const_iterator const_iterator
constant access iterator type
virtual float stripLength() const =0
Local3DPoint localPosition() const
const std::vector< const RPCRoll * > & rolls() const
Return the Rolls.
DetId geographicalId() const
The label of this GeomDet.
MonitorElement * bookProfile(const char *name, const char *title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, const char *option="s")
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
int subdetId() const
get the contents of the subdetector field (not cast into any detector's numbering enum) ...
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
The Signals That Services Can Subscribe To This is based on ActivityRegistry h
Helper function to determine trigger accepts.
virtual float pitch() const =0
void analyze(const edm::Event &event, const edm::EventSetup &eventSetup)
std::pair< typename Association::data_type::first_type, double > match(Reference key, Association association, bool bestMatchByMaxValue)
Generic matching function.
Detector det() const
get the detector field from this detid
void setCurrentFolder(const std::string &fullpath)
unsigned int detUnitId() const
int region() const
Region id: 0 for Barrel, +/-1 For +/- Endcap.