CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Types | Private Attributes
RPCRecHitValid Class Reference

#include <RPCRecHitValid.h>

Inheritance diagram for RPCRecHitValid:
edm::EDAnalyzer edm::EDConsumerBase

Public Member Functions

void analyze (const edm::Event &event, const edm::EventSetup &eventSetup)
 
void beginJob ()
 
void beginRun (const edm::Run &run, const edm::EventSetup &eventSetup)
 
void endJob ()
 
void endRun (const edm::Run &run, const edm::EventSetup &eventSetup)
 
 RPCRecHitValid (const edm::ParameterSet &pset)
 
 ~RPCRecHitValid ()
 
- Public Member Functions inherited from edm::EDAnalyzer
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzer ()
 
ModuleDescription const & moduleDescription () const
 
std::string workerType () const
 
virtual ~EDAnalyzer ()
 
- Public Member Functions inherited from edm::EDConsumerBase
 EDConsumerBase ()
 
ProductHolderIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
std::vector
< ProductHolderIndexAndSkipBit >
const & 
itemsToGetFromEvent () const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesDependentUpon (const std::string &iProcessName, std::vector< const char * > &oModuleLabels) const
 
bool registeredToConsume (ProductHolderIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

Private Types

typedef MonitorElementMEP
 
typedef RPCRecHitCollection RecHits
 
typedef
SimHitTPAssociationProducer::SimHitTPAssociationList 
SimHitAssoc
 
typedef edm::PSimHitContainer SimHits
 
typedef TrackingParticleCollection SimParticles
 

Private Attributes

DQMStoredbe_
 
std::map< int, int > detIdToIndexMapBarrel_
 
std::map< int, int > detIdToIndexMapEndcap_
 
RPCValidHistograms h_
 
MEP h_eventCount
 
MEP h_matchOccupancyBarrel_detId
 
MEP h_matchOccupancyEndcap_detId
 
MEP h_noiseOccupancyBarrel_detId
 
MEP h_noiseOccupancyEndcap_detId
 
MEP h_nRPCHitPerRecoMuon
 
MEP h_nRPCHitPerRecoMuonBarrel
 
MEP h_nRPCHitPerRecoMuonEndcap
 
MEP h_nRPCHitPerRecoMuonOverlap
 
MEP h_nRPCHitPerSimMuon
 
MEP h_nRPCHitPerSimMuonBarrel
 
MEP h_nRPCHitPerSimMuonEndcap
 
MEP h_nRPCHitPerSimMuonOverlap
 
MEP h_recoMuonBarrel_eta
 
MEP h_recoMuonBarrel_phi
 
MEP h_recoMuonBarrel_pt
 
MEP h_recoMuonEndcap_eta
 
MEP h_recoMuonEndcap_phi
 
MEP h_recoMuonEndcap_pt
 
MEP h_recoMuonNoRPC_eta
 
MEP h_recoMuonNoRPC_phi
 
MEP h_recoMuonNoRPC_pt
 
MEP h_recoMuonOverlap_eta
 
MEP h_recoMuonOverlap_phi
 
MEP h_recoMuonOverlap_pt
 
MEP h_recPunchOccupancyBarrel_station
 
MEP h_recPunchOccupancyBarrel_wheel
 
MEP h_recPunchOccupancyBarrel_wheel_station
 
MEP h_recPunchOccupancyEndcap_disk
 
MEP h_recPunchOccupancyEndcap_disk_ring
 
MEP h_refOccupancyBarrel_detId
 
MEP h_refOccupancyEndcap_detId
 
MEP h_refPunchOccupancyBarrel_station
 
MEP h_refPunchOccupancyBarrel_wheel
 
MEP h_refPunchOccupancyBarrel_wheel_station
 
MEP h_refPunchOccupancyEndcap_disk
 
MEP h_refPunchOccupancyEndcap_disk_ring
 
MEP h_rollAreaBarrel_detId
 
MEP h_rollAreaEndcap_detId
 
MEP h_simMuonBarrel_eta
 
MEP h_simMuonBarrel_phi
 
MEP h_simMuonBarrel_pt
 
MEP h_simMuonEndcap_eta
 
MEP h_simMuonEndcap_phi
 
MEP h_simMuonEndcap_pt
 
MEP h_simMuonNoRPC_eta
 
MEP h_simMuonNoRPC_phi
 
MEP h_simMuonNoRPC_pt
 
MEP h_simMuonOverlap_eta
 
MEP h_simMuonOverlap_phi
 
MEP h_simMuonOverlap_pt
 
MEP h_simParticleType
 
MEP h_simParticleTypeBarrel
 
MEP h_simParticleTypeEndcap
 
edm::EDGetTokenT
< reco::MuonCollection
muonToken_
 
edm::EDGetTokenT< RecHitsrecHitToken_
 
edm::EDGetTokenT< SimHitAssocsimHitAssocToken_
 
edm::EDGetTokenT< SimHitssimHitToken_
 
edm::EDGetTokenT< SimParticlessimParticleToken_
 
std::string subDir_
 

Additional Inherited Members

- Public Types inherited from edm::EDAnalyzer
typedef EDAnalyzer ModuleType
 
- Static Public Member Functions inherited from edm::EDAnalyzer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &)
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 

Detailed Description

Definition at line 25 of file RPCRecHitValid.h.

Member Typedef Documentation

Definition at line 52 of file RPCRecHitValid.h.

Definition at line 39 of file RPCRecHitValid.h.

Definition at line 41 of file RPCRecHitValid.h.

Definition at line 38 of file RPCRecHitValid.h.

Definition at line 40 of file RPCRecHitValid.h.

Constructor & Destructor Documentation

RPCRecHitValid::RPCRecHitValid ( const edm::ParameterSet pset)

Definition at line 26 of file RPCRecHitValid.cc.

References DQMStore::book1D(), DQMStore::book2D(), dbe_, edm::ParameterSet::getParameter(), MonitorElement::getTH1(), MonitorElement::getTH2F(), h, i, cppFunctionSkipper::operator, Pi, DQMStore::setCurrentFolder(), and AlCaHLTBitMon_QueryRunRegistry::string.

27 {
28  simHitToken_ = consumes<SimHits>(pset.getParameter<edm::InputTag>("simHit"));
29  recHitToken_ = consumes<RecHits>(pset.getParameter<edm::InputTag>("recHit"));
30  simParticleToken_ = consumes<SimParticles>(pset.getParameter<edm::InputTag>("simTrack"));
31  simHitAssocToken_ = consumes<SimHitAssoc>(pset.getParameter<edm::InputTag>("simHitAssoc"));
32  muonToken_ = consumes<reco::MuonCollection>(pset.getParameter<edm::InputTag>("muon"));
34  if ( !dbe_ )
35  {
36  edm::LogError("RPCRecHitValid") << "No DQMStore instance\n";
37  return;
38  }
39 
40  // Book MonitorElements
41  subDir_ = pset.getParameter<std::string>("subDir");
43 
44  // SimHit plots, not compatible to RPCPoint-RPCRecHit comparison
45  dbe_->setCurrentFolder(subDir_+"/HitProperty");
46  h_simParticleType = dbe_->book1D("SimHitPType", "SimHit particle type", 11, 0, 11);
47  h_simParticleType->getTH1()->SetMinimum(0);
48  if ( TH1* h = h_simParticleType->getTH1() )
49  {
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" );
61  }
62 
63  dbe_->setCurrentFolder(subDir_+"/Track");
64 
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);
69 
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);
74 
75  h_nRPCHitPerSimMuon ->getTH1()->SetMinimum(0);
76  h_nRPCHitPerSimMuonBarrel ->getTH1()->SetMinimum(0);
77  h_nRPCHitPerSimMuonOverlap ->getTH1()->SetMinimum(0);
78  h_nRPCHitPerSimMuonEndcap ->getTH1()->SetMinimum(0);
79 
80  h_nRPCHitPerRecoMuon ->getTH1()->SetMinimum(0);
81  h_nRPCHitPerRecoMuonBarrel ->getTH1()->SetMinimum(0);
82  h_nRPCHitPerRecoMuonOverlap->getTH1()->SetMinimum(0);
83  h_nRPCHitPerRecoMuonEndcap ->getTH1()->SetMinimum(0);
84 
85  float ptBins[] = {0, 1, 2, 5, 10, 20, 30, 50, 100, 200, 300, 500};
86  const int nPtBins = sizeof(ptBins)/sizeof(float)-1;
87  h_simMuonBarrel_pt = dbe_->book1D("SimMuonBarrel_pt" , "SimMuon RPCHit in Barrel p_{T};p_{T} [GeV/c^{2}]", nPtBins, ptBins);
88  h_simMuonOverlap_pt = dbe_->book1D("SimMuonOverlap_pt" , "SimMuon RPCHit in Overlap p_{T};p_{T} [GeV/c^{2}]", nPtBins, ptBins);
89  h_simMuonEndcap_pt = dbe_->book1D("SimMuonEndcap_pt" , "SimMuon RPCHit in Endcap p_{T};p_{T} [GeV/c^{2}]", nPtBins, ptBins);
90  h_simMuonNoRPC_pt = dbe_->book1D("SimMuonNoRPC_pt" , "SimMuon without RPCHit p_{T};p_{T} [GeV/c^{2}]", nPtBins, ptBins);
91  h_simMuonBarrel_eta = dbe_->book1D("SimMuonBarrel_eta" , "SimMuon RPCHit in Barrel #eta;#eta", 50, -2.5, 2.5);
92  h_simMuonOverlap_eta = dbe_->book1D("SimMuonOverlap_eta", "SimMuon RPCHit in Overlap #eta;#eta", 50, -2.5, 2.5);
93  h_simMuonEndcap_eta = dbe_->book1D("SimMuonEndcap_eta" , "SimMuon RPCHit in Endcap #eta;#eta", 50, -2.5, 2.5);
94  h_simMuonNoRPC_eta = dbe_->book1D("SimMuonNoRPC_eta", "SimMuon without RPCHit #eta;#eta", 50, -2.5, 2.5);
95  h_simMuonBarrel_phi = dbe_->book1D("SimMuonBarrel_phi" , "SimMuon RPCHit in Barrel #phi;#phi", 36, -TMath::Pi(), TMath::Pi());
96  h_simMuonOverlap_phi = dbe_->book1D("SimMuonOverlap_phi", "SimMuon RPCHit in Overlap #phi;#phi", 36, -TMath::Pi(), TMath::Pi());
97  h_simMuonEndcap_phi = dbe_->book1D("SimMuonEndcap_phi" , "SimMuon RPCHit in Endcap #phi;#phi", 36, -TMath::Pi(), TMath::Pi());
98  h_simMuonNoRPC_phi = dbe_->book1D("SimMuonNoRPC_phi", "SimMuon without RPCHit #phi;#phi", 36, -TMath::Pi(), TMath::Pi());
99 
100  h_recoMuonBarrel_pt = dbe_->book1D("RecoMuonBarrel_pt" , "RecoMuon RPCHit in Barrel p_{T};p_{T} [GeV/c^{2}]", nPtBins, ptBins);
101  h_recoMuonOverlap_pt = dbe_->book1D("RecoMuonOverlap_pt" , "RecoMuon RPCHit in Overlap p_{T};p_{T} [GeV/c^{2}]", nPtBins, ptBins);
102  h_recoMuonEndcap_pt = dbe_->book1D("RecoMuonEndcap_pt" , "RecoMuon RPCHit in Endcap p_{T};p_{T} [GeV/c^{2}]", nPtBins, ptBins);
103  h_recoMuonNoRPC_pt = dbe_->book1D("RecoMuonNoRPC_pt" , "RecoMuon without RPCHit p_{T};p_{T} [GeV/c^{2}]", nPtBins, ptBins);
104  h_recoMuonBarrel_eta = dbe_->book1D("RecoMuonBarrel_eta" , "RecoMuon RPCHit in Barrel #eta;#eta", 50, -2.5, 2.5);
105  h_recoMuonOverlap_eta = dbe_->book1D("RecoMuonOverlap_eta", "RecoMuon RPCHit in Overlap #eta;#eta", 50, -2.5, 2.5);
106  h_recoMuonEndcap_eta = dbe_->book1D("RecoMuonEndcap_eta" , "RecoMuon RPCHit in Endcap #eta;#eta", 50, -2.5, 2.5);
107  h_recoMuonNoRPC_eta = dbe_->book1D("RecoMuonNoRPC_eta", "RecoMuon without RPCHit #eta;#eta", 50, -2.5, 2.5);
108  h_recoMuonBarrel_phi = dbe_->book1D("RecoMuonBarrel_phi" , "RecoMuon RPCHit in Barrel #phi;#phi", 36, -TMath::Pi(), TMath::Pi());
109  h_recoMuonOverlap_phi = dbe_->book1D("RecoMuonOverlap_phi", "RecoMuon RPCHit in Overlap #phi;#phi", 36, -TMath::Pi(), TMath::Pi());
110  h_recoMuonEndcap_phi = dbe_->book1D("RecoMuonEndcap_phi" , "RecoMuon RPCHit in Endcap #phi;#phi", 36, -TMath::Pi(), TMath::Pi());
111  h_recoMuonNoRPC_phi = dbe_->book1D("RecoMuonNoRPC_phi", "RecoMuon without RPCHit #phi;#phi", 36, -TMath::Pi(), TMath::Pi());
112 
113  h_simMuonBarrel_pt ->getTH1()->SetMinimum(0);
114  h_simMuonOverlap_pt ->getTH1()->SetMinimum(0);
115  h_simMuonEndcap_pt ->getTH1()->SetMinimum(0);
116  h_simMuonNoRPC_pt ->getTH1()->SetMinimum(0);
117  h_simMuonBarrel_eta ->getTH1()->SetMinimum(0);
118  h_simMuonOverlap_eta ->getTH1()->SetMinimum(0);
119  h_simMuonEndcap_eta ->getTH1()->SetMinimum(0);
120  h_simMuonNoRPC_eta ->getTH1()->SetMinimum(0);
121  h_simMuonBarrel_phi ->getTH1()->SetMinimum(0);
122  h_simMuonOverlap_phi ->getTH1()->SetMinimum(0);
123  h_simMuonEndcap_phi ->getTH1()->SetMinimum(0);
124  h_simMuonNoRPC_phi ->getTH1()->SetMinimum(0);
125 
126  h_recoMuonBarrel_pt ->getTH1()->SetMinimum(0);
127  h_recoMuonOverlap_pt ->getTH1()->SetMinimum(0);
128  h_recoMuonEndcap_pt ->getTH1()->SetMinimum(0);
129  h_recoMuonNoRPC_pt ->getTH1()->SetMinimum(0);
130  h_recoMuonBarrel_eta ->getTH1()->SetMinimum(0);
131  h_recoMuonOverlap_eta->getTH1()->SetMinimum(0);
132  h_recoMuonEndcap_eta ->getTH1()->SetMinimum(0);
133  h_recoMuonNoRPC_eta ->getTH1()->SetMinimum(0);
134  h_recoMuonBarrel_phi ->getTH1()->SetMinimum(0);
135  h_recoMuonOverlap_phi->getTH1()->SetMinimum(0);
136  h_recoMuonEndcap_phi ->getTH1()->SetMinimum(0);
137  h_recoMuonNoRPC_phi ->getTH1()->SetMinimum(0);
138 
139  dbe_->setCurrentFolder(subDir_+"/Occupancy");
140 
141  h_eventCount = dbe_->book1D("EventCount", "Event count", 3, 1, 4);
142  h_eventCount->getTH1()->SetMinimum(0);
143  if ( h_eventCount )
144  {
145  TH1* h = h_eventCount->getTH1();
146  h->GetXaxis()->SetBinLabel(1, "eventBegin");
147  h->GetXaxis()->SetBinLabel(2, "eventEnd");
148  h->GetXaxis()->SetBinLabel(3, "run");
149  }
150 
151  h_refPunchOccupancyBarrel_wheel = dbe_->book1D("RefPunchOccupancyBarrel_wheel" , "RefPunchthrough occupancy", 5, -2.5, 2.5);
152  h_refPunchOccupancyEndcap_disk = dbe_->book1D("RefPunchOccupancyEndcap_disk" , "RefPunchthrough occupancy", 9, -4.5, 4.5);
153  h_refPunchOccupancyBarrel_station = dbe_->book1D("RefPunchOccupancyBarrel_station", "RefPunchthrough occupancy", 4, 0.5, 4.5);
154  h_recPunchOccupancyBarrel_wheel = dbe_->book1D("RecPunchOccupancyBarrel_wheel" , "Punchthrough recHit occupancy", 5, -2.5, 2.5);
155  h_recPunchOccupancyEndcap_disk = dbe_->book1D("RecPunchOccupancyEndcap_disk" , "Punchthrough recHit occupancy", 9, -4.5, 4.5);
156  h_recPunchOccupancyBarrel_station = dbe_->book1D("RecPunchOccupancyBarrel_station", "Punchthrough recHit occupancy", 4, 0.5, 4.5);
157 
158  h_refPunchOccupancyBarrel_wheel ->getTH1()->SetMinimum(0);
159  h_refPunchOccupancyEndcap_disk ->getTH1()->SetMinimum(0);
160  h_refPunchOccupancyBarrel_station ->getTH1()->SetMinimum(0);
161  h_recPunchOccupancyBarrel_wheel ->getTH1()->SetMinimum(0);
162  h_recPunchOccupancyEndcap_disk ->getTH1()->SetMinimum(0);
163  h_recPunchOccupancyBarrel_station ->getTH1()->SetMinimum(0);
164 
165  h_refPunchOccupancyBarrel_wheel_station = dbe_->book2D("RefPunchOccupancyBarrel_wheel_station", "RefPunchthrough occupancy", 5, -2.5, 2.5, 4, 0.5, 4.5);
166  h_refPunchOccupancyEndcap_disk_ring = dbe_->book2D("RefPunchOccupancyEndcap_disk_ring" , "RefPunchthrough occupancy", 9, -4.5, 4.5, 4, 0.5, 4.5);
167  h_recPunchOccupancyBarrel_wheel_station = dbe_->book2D("RecPunchOccupancyBarrel_wheel_station", "Punchthrough recHit occupancy", 5, -2.5, 2.5, 4, 0.5, 4.5);
168  h_recPunchOccupancyEndcap_disk_ring = dbe_->book2D("RecPunchOccupancyEndcap_disk_ring" , "Punchthrough recHit occupancy", 9, -4.5, 4.5, 4, 0.5, 4.5);
169 
170  h_refPunchOccupancyBarrel_wheel_station->getTH2F()->SetOption("COLZ");
171  h_refPunchOccupancyEndcap_disk_ring ->getTH2F()->SetOption("COLZ");
172  h_recPunchOccupancyBarrel_wheel_station->getTH2F()->SetOption("COLZ");
173  h_recPunchOccupancyEndcap_disk_ring ->getTH2F()->SetOption("COLZ");
174 
176  h_refPunchOccupancyEndcap_disk_ring ->getTH2F()->SetContour(10);
178  h_recPunchOccupancyEndcap_disk_ring ->getTH2F()->SetContour(10);
179 
184 
186  h_refPunchOccupancyEndcap_disk_ring ->getTH2F()->SetMinimum(0);
188  h_recPunchOccupancyEndcap_disk_ring ->getTH2F()->SetMinimum(0);
189 
190  for ( int i=1; i<=5; ++i )
191  {
192  TString binLabel = Form("Wheel %d", i-3);
193  h_refPunchOccupancyBarrel_wheel->getTH1()->GetXaxis()->SetBinLabel(i, binLabel);
194  h_refPunchOccupancyBarrel_wheel_station->getTH2F()->GetXaxis()->SetBinLabel(i, binLabel);
195  h_recPunchOccupancyBarrel_wheel->getTH1()->GetXaxis()->SetBinLabel(i, binLabel);
196  h_recPunchOccupancyBarrel_wheel_station->getTH2F()->GetXaxis()->SetBinLabel(i, binLabel);
197  }
198 
199  for ( int i=1; i<=9; ++i )
200  {
201  TString binLabel = Form("Disk %d", i-5);
202  h_refPunchOccupancyEndcap_disk ->getTH1()->GetXaxis()->SetBinLabel(i, binLabel);
203  h_refPunchOccupancyEndcap_disk_ring ->getTH2F()->GetXaxis()->SetBinLabel(i, binLabel);
204  h_recPunchOccupancyEndcap_disk ->getTH1()->GetXaxis()->SetBinLabel(i, binLabel);
205  h_recPunchOccupancyEndcap_disk_ring ->getTH2F()->GetXaxis()->SetBinLabel(i, binLabel);
206  }
207 
208  for ( int i=1; i<=4; ++i )
209  {
210  TString binLabel = Form("Station %d", i);
211  h_refPunchOccupancyBarrel_station ->getTH1()->GetXaxis()->SetBinLabel(i, binLabel);
212  h_refPunchOccupancyBarrel_wheel_station ->getTH2F()->GetYaxis()->SetBinLabel(i, binLabel);
213  h_recPunchOccupancyBarrel_station ->getTH1()->GetXaxis()->SetBinLabel(i, binLabel);
214  h_recPunchOccupancyBarrel_wheel_station ->getTH2F()->GetYaxis()->SetBinLabel(i, binLabel);
215  }
216 
217  for ( int i=1; i<=4; ++i )
218  {
219  TString binLabel = Form("Ring %d", i);
220  h_refPunchOccupancyEndcap_disk_ring ->getTH2F()->GetYaxis()->SetBinLabel(i, binLabel);
221  h_recPunchOccupancyEndcap_disk_ring ->getTH2F()->GetYaxis()->SetBinLabel(i, binLabel);
222  }
223 }
const double Pi
T getParameter(std::string const &) const
int i
Definition: DBlmapReader.cc:9
edm::EDGetTokenT< RecHits > recHitToken_
DQMStore * dbe_
MonitorElement * book1D(const char *name, const char *title, int nchX, double lowX, double highX)
Book 1D histogram.
Definition: DQMStore.cc:942
edm::EDGetTokenT< SimHitAssoc > simHitAssocToken_
edm::EDGetTokenT< SimParticles > simParticleToken_
MEP h_nRPCHitPerRecoMuonBarrel
MEP h_nRPCHitPerSimMuonBarrel
MEP h_nRPCHitPerSimMuonOverlap
MEP h_recPunchOccupancyEndcap_disk_ring
MEP h_refPunchOccupancyBarrel_wheel
MEP h_refPunchOccupancyEndcap_disk
MEP h_recPunchOccupancyEndcap_disk
void bookHistograms(DQMStore *dbe, const std::string subDir)
MEP h_nRPCHitPerSimMuonEndcap
MEP h_nRPCHitPerRecoMuonEndcap
RPCValidHistograms h_
TH1 * getTH1(void) const
MEP h_recPunchOccupancyBarrel_wheel_station
MEP h_refPunchOccupancyBarrel_wheel_station
The Signals That Services Can Subscribe To This is based on ActivityRegistry h
Helper function to determine trigger accepts.
Definition: Activities.doc:4
MEP h_refPunchOccupancyEndcap_disk_ring
MEP h_refPunchOccupancyBarrel_station
MEP h_nRPCHitPerRecoMuonOverlap
std::string subDir_
MEP h_recPunchOccupancyBarrel_wheel
edm::EDGetTokenT< reco::MuonCollection > muonToken_
edm::EDGetTokenT< SimHits > simHitToken_
TH2F * getTH2F(void) const
MonitorElement * book2D(const char *name, const char *title, int nchX, double lowX, double highX, int nchY, double lowY, double highY)
Book 2D histogram.
Definition: DQMStore.cc:1070
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:655
MEP h_recPunchOccupancyBarrel_station
RPCRecHitValid::~RPCRecHitValid ( )

Definition at line 225 of file RPCRecHitValid.cc.

226 {
227 }

Member Function Documentation

void RPCRecHitValid::analyze ( const edm::Event event,
const edm::EventSetup eventSetup 
)
virtual

Implements edm::EDAnalyzer.

Definition at line 337 of file RPCRecHitValid.cc.

References funct::abs(), dbe_, DetId::det(), edm::EventSetup::get(), edm::Event::getByToken(), i, RPCRoll::id(), match(), DetId::Muon, metsig::muon, n, or, DetId::rawId(), RPCDetId::region(), relativeConstraints::ring, RPCDetId::ring(), MuonSubdetId::RPC, SimHitTPAssociationProducer::simHitTPAssociationListGreater(), mathSSE::sqrt(), relativeConstraints::station, RPCDetId::station(), and DetId::subdetId().

338 {
339  if ( !dbe_ ) return;
340  h_eventCount->Fill(1);
341 
342  // Get the RPC Geometry
344  eventSetup.get<MuonGeometryRecord>().get(rpcGeom);
345 
346  // Retrieve SimHits from the event
348  if ( !event.getByToken(simHitToken_, simHitHandle) )
349  {
350  edm::LogInfo("RPCRecHitValid") << "Cannot find simHit collection\n";
351  return;
352  }
353 
354  // Retrieve RecHits from the event
356  if ( !event.getByToken(recHitToken_, recHitHandle) )
357  {
358  edm::LogInfo("RPCRecHitValid") << "Cannot find recHit collection\n";
359  return;
360  }
361 
362  // Get SimParticles
363  edm::Handle<TrackingParticleCollection> simParticleHandle;
364  if ( !event.getByToken(simParticleToken_, simParticleHandle) )
365  {
366  edm::LogInfo("RPCRecHitValid") << "Cannot find TrackingParticle collection\n";
367  return;
368  }
369 
370  // Get SimParticle to SimHit association map
372  if ( !event.getByToken(simHitAssocToken_, simHitsTPAssoc) )
373  {
374  edm::LogInfo("RPCRecHitValid") << "Cannot find TrackingParticle to SimHit association map\n";
375  return;
376  }
377 
378  // Get RecoMuons
380  if ( !event.getByToken(muonToken_, muonHandle) )
381  {
382  edm::LogInfo("RPCRecHitValid") << "Cannot find muon collection\n";
383  return;
384  }
385 
386  typedef edm::PSimHitContainer::const_iterator SimHitIter;
387  typedef RPCRecHitCollection::const_iterator RecHitIter;
388  typedef std::vector<TrackPSimHitRef> SimHitRefs;
389 
390  // TrackingParticles with (and without) RPC simHits
391  SimHitRefs muonSimHits, pthrSimHits;
392 
393  for ( int i=0, n=simParticleHandle->size(); i<n; ++i )
394  {
395  TrackingParticleRef simParticle(simParticleHandle, i);
396  if ( simParticle->pt() < 1.0 or simParticle->p() < 2.5 ) continue; // globalMuon acceptance
397 
398  // Collect SimHits from this Tracking Particle
399  SimHitRefs simHitsFromParticle;
400  auto range = std::equal_range(simHitsTPAssoc->begin(), simHitsTPAssoc->end(),
401  std::make_pair(simParticle, TrackPSimHitRef()),
403  for ( auto simParticleToHit = range.first; simParticleToHit != range.second; ++simParticleToHit )
404  {
405  auto simHit = simParticleToHit->second;
406  const DetId detId(simHit->detUnitId());
407  if ( detId.det() != DetId::Muon or detId.subdetId() != MuonSubdetId::RPC ) continue;
408 
409  simHitsFromParticle.push_back(simParticleToHit->second);
410  }
411  const int nRPCHit = simHitsFromParticle.size();
412  const bool hasRPCHit = nRPCHit > 0;
413 
414  if ( abs(simParticle->pdgId()) == 13 )
415  {
416  muonSimHits.insert(muonSimHits.end(), simHitsFromParticle.begin(), simHitsFromParticle.end());
417 
418  // Count number of Barrel hits and Endcap hits
419  int nRPCHitBarrel = 0;
420  int nRPCHitEndcap = 0;
421  for ( auto simHit : simHitsFromParticle )
422  {
423  const RPCDetId rpcDetId = static_cast<const RPCDetId>(simHit->detUnitId());
424  const RPCRoll* roll = dynamic_cast<const RPCRoll*>(rpcGeom->roll(rpcDetId));
425  if ( !roll ) continue;
426 
427  if ( rpcDetId.region() == 0 ) ++nRPCHitBarrel;
428  else ++nRPCHitEndcap;
429  }
430 
431  // Fill TrackingParticle related histograms
432  h_nRPCHitPerSimMuon->Fill(nRPCHit);
433  if ( nRPCHitBarrel and nRPCHitEndcap )
434  {
436  h_simMuonOverlap_pt->Fill(simParticle->pt());
437  h_simMuonOverlap_eta->Fill(simParticle->eta());
438  h_simMuonOverlap_phi->Fill(simParticle->phi());
439  }
440  else if ( nRPCHitBarrel )
441  {
443  h_simMuonBarrel_pt->Fill(simParticle->pt());
444  h_simMuonBarrel_eta->Fill(simParticle->eta());
445  h_simMuonBarrel_phi->Fill(simParticle->phi());
446  }
447  else if ( nRPCHitEndcap )
448  {
450  h_simMuonEndcap_pt->Fill(simParticle->pt());
451  h_simMuonEndcap_eta->Fill(simParticle->eta());
452  h_simMuonEndcap_phi->Fill(simParticle->phi());
453  }
454  else
455  {
456  h_simMuonNoRPC_pt->Fill(simParticle->pt());
457  h_simMuonNoRPC_eta->Fill(simParticle->eta());
458  h_simMuonNoRPC_phi->Fill(simParticle->phi());
459  }
460  }
461  else
462  {
463  pthrSimHits.insert(pthrSimHits.end(), simHitsFromParticle.begin(), simHitsFromParticle.end());
464  }
465 
466  if ( hasRPCHit )
467  {
468  switch ( simParticle->pdgId() )
469  {
470  case 13: h_simParticleType->Fill( 0); break;
471  case -13: h_simParticleType->Fill( 1); break;
472  case 11: h_simParticleType->Fill( 2); break;
473  case -11: h_simParticleType->Fill( 3); break;
474  case 211: h_simParticleType->Fill( 4); break;
475  case -211: h_simParticleType->Fill( 5); break;
476  case 321: h_simParticleType->Fill( 6); break;
477  case -321: h_simParticleType->Fill( 7); break;
478  case 2212: h_simParticleType->Fill( 8); break;
479  case -2212: h_simParticleType->Fill( 9); break;
480  default: h_simParticleType->Fill(10); break;
481  }
482  }
483  }
484 
485  // Loop over muon simHits, fill histograms which does not need associations
486  int nRefHitBarrel = 0, nRefHitEndcap = 0;
487  for ( auto simHit : muonSimHits )
488  {
489  const RPCDetId detId = static_cast<const RPCDetId>(simHit->detUnitId());
490  const RPCRoll* roll = dynamic_cast<const RPCRoll*>(rpcGeom->roll(detId));
491 
492  const int region = roll->id().region();
493  const int ring = roll->id().ring();
494  //const int sector = roll->id().sector();
495  const int station = roll->id().station();
496  //const int layer = roll->id().layer();
497  //const int subSector = roll->id().subsector();
498 
499  if ( region == 0 )
500  {
501  ++nRefHitBarrel;
505 
507  }
508  else
509  {
510  ++nRefHitEndcap;
511  h_.refHitOccupancyEndcap_disk->Fill(region*station);
512  h_.refHitOccupancyEndcap_disk_ring->Fill(region*station, ring);
513 
515  }
516  }
517 
518  // Loop over punch-through simHits, fill histograms which does not need associations
519  for ( auto simHit : pthrSimHits )
520  {
521  const RPCDetId detId = static_cast<const RPCDetId>(simHit->detUnitId());
522  const RPCRoll* roll = dynamic_cast<const RPCRoll*>(rpcGeom->roll(detId()));
523 
524  const int region = roll->id().region();
525  const int ring = roll->id().ring();
526  //const int sector = roll->id().sector();
527  const int station = roll->id().station();
528  //const int layer = roll->id().layer();
529  //const int subSector = roll->id().subsector();
530 
531  if ( region == 0 )
532  {
533  ++nRefHitBarrel;
537 
539  }
540  else
541  {
542  ++nRefHitEndcap;
543  h_refPunchOccupancyEndcap_disk->Fill(region*station);
544  h_refPunchOccupancyEndcap_disk_ring->Fill(region*station, ring);
545 
547  }
548  }
549  h_.nRefHitBarrel->Fill(nRefHitBarrel);
550  h_.nRefHitEndcap->Fill(nRefHitEndcap);
551 
552  // Loop over recHits, fill histograms which does not need associations
553  int sumClusterSizeBarrel = 0, sumClusterSizeEndcap = 0;
554  int nRecHitBarrel = 0, nRecHitEndcap = 0;
555  for ( RecHitIter recHitIter = recHitHandle->begin();
556  recHitIter != recHitHandle->end(); ++recHitIter )
557  {
558  const RPCDetId detId = static_cast<const RPCDetId>(recHitIter->rpcId());
559  const RPCRoll* roll = dynamic_cast<const RPCRoll*>(rpcGeom->roll(detId()));
560  if ( !roll ) continue;
561 
562  const int region = roll->id().region();
563  const int ring = roll->id().ring();
564  //const int sector = roll->id().sector();
565  const int station = roll->id().station();
566  //const int layer = roll->id().layer();
567  //const int subSector = roll->id().subsector();
568 
569  h_.clusterSize->Fill(recHitIter->clusterSize());
570 
571  if ( region == 0 )
572  {
573  ++nRecHitBarrel;
574  sumClusterSizeBarrel += recHitIter->clusterSize();
575  h_.clusterSizeBarrel->Fill(recHitIter->clusterSize());
579  }
580  else
581  {
582  ++nRecHitEndcap;
583  sumClusterSizeEndcap += recHitIter->clusterSize();
584  h_.clusterSizeEndcap->Fill(recHitIter->clusterSize());
585  h_.recHitOccupancyEndcap_disk->Fill(region*station);
586  h_.recHitOccupancyEndcap_disk_ring->Fill(region*station, ring);
587  }
588 
589  }
590  const double nRecHit = nRecHitBarrel+nRecHitEndcap;
591  h_.nRecHitBarrel->Fill(nRecHitBarrel);
592  h_.nRecHitEndcap->Fill(nRecHitEndcap);
593  if ( nRecHit > 0 )
594  {
595  const int sumClusterSize = sumClusterSizeBarrel+sumClusterSizeEndcap;
596  h_.avgClusterSize->Fill(double(sumClusterSize)/nRecHit);
597 
598  if ( nRecHitBarrel > 0 )
599  {
600  h_.avgClusterSizeBarrel->Fill(double(sumClusterSizeBarrel)/nRecHitBarrel);
601  }
602  if ( nRecHitEndcap > 0 )
603  {
604  h_.avgClusterSizeEndcap->Fill(double(sumClusterSizeEndcap)/nRecHitEndcap);
605  }
606  }
607 
608  // Start matching SimHits to RecHits
609  typedef std::map<TrackPSimHitRef, RecHitIter> SimToRecHitMap;
610  SimToRecHitMap simToRecHitMap;
611 
612  for ( auto simHit : muonSimHits )
613  {
614  const RPCDetId simDetId = static_cast<const RPCDetId>(simHit->detUnitId());
615  //const RPCRoll* simRoll = dynamic_cast<const RPCRoll*>(rpcGeom->roll(simDetId));
616 
617  const double simX = simHit->localPosition().x();
618 
619  for ( RecHitIter recHitIter = recHitHandle->begin();
620  recHitIter != recHitHandle->end(); ++recHitIter )
621  {
622  const RPCDetId recDetId = static_cast<const RPCDetId>(recHitIter->rpcId());
623  const RPCRoll* recRoll = dynamic_cast<const RPCRoll*>(rpcGeom->roll(recDetId));
624  if ( !recRoll ) continue;
625 
626  if ( simDetId != recDetId ) continue;
627 
628  const double recX = recHitIter->localPosition().x();
629  const double newDx = fabs(recX - simX);
630 
631  // Associate SimHit to RecHit
632  SimToRecHitMap::const_iterator prevSimToReco = simToRecHitMap.find(simHit);
633  if ( prevSimToReco == simToRecHitMap.end() )
634  {
635  simToRecHitMap.insert(std::make_pair(simHit, recHitIter));
636  }
637  else
638  {
639  const double oldDx = fabs(prevSimToReco->second->localPosition().x() - simX);
640 
641  if ( newDx < oldDx )
642  {
643  simToRecHitMap[simHit] = recHitIter;
644  }
645  }
646  }
647  }
648 
649  // Now we have simHit-recHit mapping
650  // So we can fill up relavant histograms
651  int nMatchHitBarrel = 0, nMatchHitEndcap = 0;
652  for ( auto match : simToRecHitMap )
653  {
654  TrackPSimHitRef simHit = match.first;
655  RecHitIter recHitIter = match.second;
656 
657  const RPCDetId detId = static_cast<const RPCDetId>(simHit->detUnitId());
658  const RPCRoll* roll = dynamic_cast<const RPCRoll*>(rpcGeom->roll(detId));
659 
660  const int region = roll->id().region();
661  const int ring = roll->id().ring();
662  //const int sector = roll->id().sector();
663  const int station = roll->id().station();
664  //const int layer = roll->id().layer();
665  //const int subsector = roll->id().subsector();
666 
667  const double simX = simHit->localPosition().x();
668  const double recX = recHitIter->localPosition().x();
669  const double errX = sqrt(recHitIter->localPositionError().xx());
670  const double dX = recX - simX;
671  const double pull = errX == 0 ? -999 : dX/errX;
672 
673  //const GlobalPoint simPos = roll->toGlobal(simHitIter->localPosition());
674  //const GlobalPoint recPos = roll->toGlobal(recHitIter->localPosition());
675 
676  if ( region == 0 )
677  {
678  ++nMatchHitBarrel;
679  h_.resBarrel->Fill(dX);
680  h_.pullBarrel->Fill(pull);
684 
685  h_.res_wheel_res->Fill(ring, dX);
686  h_.res_station_res->Fill(station, dX);
687  h_.pull_wheel_pull->Fill(ring, pull);
688  h_.pull_station_pull->Fill(station, pull);
689 
691  }
692  else
693  {
694  ++nMatchHitEndcap;
695  h_.resEndcap->Fill(dX);
696  h_.pullEndcap->Fill(pull);
697  h_.matchOccupancyEndcap_disk->Fill(region*station);
698  h_.matchOccupancyEndcap_disk_ring->Fill(region*station, ring);
699 
700  h_.res_disk_res->Fill(region*station, dX);
701  h_.res_ring_res->Fill(ring, dX);
702  h_.pull_disk_pull->Fill(region*station, pull);
703  h_.pull_ring_pull->Fill(ring, pull);
704 
706  }
707 
708  }
709  h_.nMatchHitBarrel->Fill(nMatchHitBarrel);
710  h_.nMatchHitEndcap->Fill(nMatchHitEndcap);
711 
712  // Reco Muon hits
713  for ( reco::MuonCollection::const_iterator muon = muonHandle->begin();
714  muon != muonHandle->end(); ++muon )
715  {
716  if ( !muon->isGlobalMuon() ) continue;
717 
718  int nRPCHitBarrel = 0;
719  int nRPCHitEndcap = 0;
720 
721  const reco::TrackRef glbTrack = muon->globalTrack();
722  for ( trackingRecHit_iterator recHit = glbTrack->recHitsBegin();
723  recHit != glbTrack->recHitsEnd(); ++recHit )
724  {
725  if ( !(*recHit)->isValid() ) continue;
726  const DetId detId = (*recHit)->geographicalId();
727  if ( detId.det() != DetId::Muon or detId.subdetId() != MuonSubdetId::RPC ) continue;
728  const RPCDetId rpcDetId = static_cast<const RPCDetId>(detId);
729 
730  if ( rpcDetId.region() == 0 ) ++nRPCHitBarrel;
731  else ++nRPCHitEndcap;
732  }
733 
734  const int nRPCHit = nRPCHitBarrel + nRPCHitEndcap;
735  h_nRPCHitPerRecoMuon->Fill(nRPCHit);
736  if ( nRPCHitBarrel and nRPCHitEndcap )
737  {
742  }
743  else if ( nRPCHitBarrel )
744  {
746  h_recoMuonBarrel_pt->Fill(muon->pt());
747  h_recoMuonBarrel_eta->Fill(muon->eta());
748  h_recoMuonBarrel_phi->Fill(muon->phi());
749  }
750  else if ( nRPCHitEndcap )
751  {
753  h_recoMuonEndcap_pt->Fill(muon->pt());
754  h_recoMuonEndcap_eta->Fill(muon->eta());
755  h_recoMuonEndcap_phi->Fill(muon->phi());
756  }
757  else
758  {
759  h_recoMuonNoRPC_pt->Fill(muon->pt());
760  h_recoMuonNoRPC_eta->Fill(muon->eta());
761  h_recoMuonNoRPC_phi->Fill(muon->phi());
762  }
763  }
764 
765  // Find Non-muon hits
766  for ( RecHitIter recHitIter = recHitHandle->begin();
767  recHitIter != recHitHandle->end(); ++recHitIter )
768  {
769  const RPCDetId detId = static_cast<const RPCDetId>(recHitIter->rpcId());
770  const RPCRoll* roll = dynamic_cast<const RPCRoll*>(rpcGeom->roll(detId));
771 
772  const int region = roll->id().region();
773  const int ring = roll->id().ring();
774  //const int sector = roll->id().sector();
775  const int station = roll->id().station();
776  //const int layer = roll->id().layer();
777  //const int subsector = roll->id().subsector();
778 
779  bool matched = false;
780  for ( auto match : simToRecHitMap )
781  {
782  if ( recHitIter == match.second )
783  {
784  matched = true;
785  break;
786  }
787  }
788 
789  if ( !matched )
790  {
791  // FIXME : kept for backward compatibility //
792  if ( region == 0 )
793  {
796  h_.umOccupancyBarrel_wheel_station->Fill(ring, station);
797  }
798  else
799  {
800  h_.umOccupancyEndcap_disk->Fill(region*station);
801  h_.umOccupancyEndcap_disk_ring->Fill(region*station, ring);
802  }
803  // End of FIXME //
804 
805  int nPunchMatched = 0;
806  // Check if this recHit came from non-muon simHit
807  for ( auto simHit : pthrSimHits )
808  {
809  const int absSimHitPType = abs(simHit->particleType());
810  if ( absSimHitPType == 13 ) continue;
811 
812  const RPCDetId simDetId = static_cast<const RPCDetId>(simHit->detUnitId());
813  if ( simDetId == detId ) ++nPunchMatched;
814  }
815 
816  if ( nPunchMatched > 0 )
817  {
818  if ( region == 0 )
819  {
823  }
824  else
825  {
826  h_recPunchOccupancyEndcap_disk->Fill(region*station);
827  h_recPunchOccupancyEndcap_disk_ring->Fill(region*station, ring);
828  }
829  }
830  }
831  }
832 
833  // Find noise recHits : RecHits without SimHit match
834  for ( RecHitIter recHitIter = recHitHandle->begin();
835  recHitIter != recHitHandle->end(); ++recHitIter )
836  {
837  const RPCDetId recDetId = static_cast<const RPCDetId>(recHitIter->rpcId());
838  const RPCRoll* roll = dynamic_cast<const RPCRoll*>(rpcGeom->roll(recDetId));
839 
840  const int region = roll->id().region();
841  // const int ring = roll->id().ring(); // UNUSED VARIABLE
842  //const int sector = roll->id().sector();
843  // const int station = roll->id().station(); // UNUSED VARIABLE
844  //const int layer = roll->id().layer();
845  //const int subsector = roll->id().subsector();
846 
847  const double recX = recHitIter->localPosition().x();
848  const double recErrX = sqrt(recHitIter->localPositionError().xx());
849 
850  bool matched = false;
851  for ( SimHitIter simHitIter = simHitHandle->begin();
852  simHitIter != simHitHandle->end(); ++simHitIter )
853  {
854  const RPCDetId simDetId = static_cast<const RPCDetId>(simHitIter->detUnitId());
855  const RPCRoll* simRoll = dynamic_cast<const RPCRoll*>(rpcGeom->roll(simDetId));
856  if ( !simRoll ) continue;
857 
858  if ( simDetId != recDetId ) continue;
859 
860  const double simX = simHitIter->localPosition().x();
861  const double dX = fabs(recX-simX);
862 
863  if ( dX/recErrX < 5 )
864  {
865  matched = true;
866  break;
867  }
868  }
869 
870  if ( !matched )
871  {
872  if ( region == 0 )
873  {
875  }
876  else
877  {
879  }
880  }
881  }
882 
883  h_eventCount->Fill(2);
884 }
int i
Definition: DBlmapReader.cc:9
edm::EDGetTokenT< RecHits > recHitToken_
DQMStore * dbe_
std::map< int, int > detIdToIndexMapEndcap_
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
Definition: Activities.doc:12
edm::EDGetTokenT< SimHitAssoc > simHitAssocToken_
static bool simHitTPAssociationListGreater(SimHitTPPair i, SimHitTPPair j)
edm::EDGetTokenT< SimParticles > simParticleToken_
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:434
MEP h_nRPCHitPerRecoMuonBarrel
std::map< int, int > detIdToIndexMapBarrel_
MEP h_nRPCHitPerSimMuonBarrel
MEP h_nRPCHitPerSimMuonOverlap
MEP h_recPunchOccupancyEndcap_disk_ring
MEP h_refPunchOccupancyBarrel_wheel
MEP h_refPunchOccupancyEndcap_disk
MEP h_matchOccupancyBarrel_detId
MEP h_recPunchOccupancyEndcap_disk
void Fill(long long x)
uint32_t rawId() const
get the raw id
Definition: DetId.h:43
RPCDetId id() const
Definition: RPCRoll.cc:24
MEP h_matchOccupancyEndcap_detId
MEP h_noiseOccupancyBarrel_detId
int ring() const
Definition: RPCDetId.h:72
T sqrt(T t)
Definition: SSEVec.h:48
MEP h_nRPCHitPerSimMuonEndcap
MEP h_nRPCHitPerRecoMuonEndcap
RPCValidHistograms h_
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
MEP h_recPunchOccupancyBarrel_wheel_station
MEP h_refPunchOccupancyBarrel_wheel_station
int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:37
MEP h_refPunchOccupancyEndcap_disk_ring
MEP h_refPunchOccupancyBarrel_station
MEP h_nRPCHitPerRecoMuonOverlap
Definition: DetId.h:18
MEP h_refOccupancyBarrel_detId
const T & get() const
Definition: EventSetup.h:55
MEP h_recPunchOccupancyBarrel_wheel
edm::EDGetTokenT< reco::MuonCollection > muonToken_
static const int RPC
Definition: MuonSubdetId.h:14
MEP h_refOccupancyEndcap_detId
edm::Ref< edm::PSimHitContainer > TrackPSimHitRef
std::pair< typename Association::data_type::first_type, double > match(Reference key, Association association, bool bestMatchByMaxValue)
Generic matching function.
Definition: Utils.h:6
edm::EDGetTokenT< SimHits > simHitToken_
Detector det() const
get the detector field from this detid
Definition: DetId.h:35
MEP h_noiseOccupancyEndcap_detId
int region() const
Region id: 0 for Barrel, +/-1 For +/- Endcap.
Definition: RPCDetId.h:63
int station() const
Definition: RPCDetId.h:96
MEP h_recPunchOccupancyBarrel_station
void RPCRecHitValid::beginJob ( void  )
virtual

Reimplemented from edm::EDAnalyzer.

Definition at line 229 of file RPCRecHitValid.cc.

230 {
231 }
void RPCRecHitValid::beginRun ( const edm::Run run,
const edm::EventSetup eventSetup 
)
virtual

Reimplemented from edm::EDAnalyzer.

Definition at line 237 of file RPCRecHitValid.cc.

References DQMStore::book1D(), DQMStore::bookProfile(), dbe_, edm::EventSetup::get(), MonitorElement::getTH1(), cmsHarvester::index, StripTopology::nstrips(), StripTopology::pitch(), RPCChamber::rolls(), DQMStore::setCurrentFolder(), RPCRoll::specificTopology(), and StripTopology::stripLength().

238 {
239  if ( !dbe_ ) return;
240  h_eventCount->Fill(3);
241 
242  // Book roll-by-roll histograms
244  eventSetup.get<MuonGeometryRecord>().get(rpcGeom);
245 
246  int nRPCRollBarrel = 0, nRPCRollEndcap = 0;
247 
248  TrackingGeometry::DetContainer rpcDets = rpcGeom->dets();
249  for ( auto det : rpcDets )
250  {
251  auto rpcCh = dynamic_cast<const RPCChamber*>(det);
252  if ( !rpcCh ) continue;
253 
254  std::vector<const RPCRoll*> rolls = rpcCh->rolls();
255  for ( auto roll : rolls )
256  {
257  if ( !roll ) continue;
258 
259  //RPCGeomServ rpcSrv(roll->id());
260  const int rawId = roll->geographicalId().rawId();
261  //if ( !roll->specs()->isRPC() ) { cout << "\nNoRPC : " << rpcSrv.name() << ' ' << rawId << endl; continue; }
262 
263  if ( roll->isBarrel() )
264  {
265  detIdToIndexMapBarrel_[rawId] = nRPCRollBarrel;
266  //rollIdToNameMapBarrel_[rawId] = rpcSrv.name();
267  ++nRPCRollBarrel;
268  }
269  else
270  {
271  detIdToIndexMapEndcap_[rawId] = nRPCRollEndcap;
272  //rollIdToNameMapEndcap_[rawId] = rpcSrv.name();
273  ++nRPCRollEndcap;
274  }
275  }
276  }
277 
278  dbe_->setCurrentFolder(subDir_+"/Occupancy");
279  h_matchOccupancyBarrel_detId = dbe_->book1D("MatchOccupancyBarrel_detId", "Matched hit occupancy;roll index (can be arbitrary)", nRPCRollBarrel, 0, nRPCRollBarrel);
280  h_matchOccupancyEndcap_detId = dbe_->book1D("MatchOccupancyEndcap_detId", "Matched hit occupancy;roll index (can be arbitrary)", nRPCRollEndcap, 0, nRPCRollEndcap);
281  h_refOccupancyBarrel_detId = dbe_->book1D("RefOccupancyBarrel_detId", "Reference hit occupancy;roll index (can be arbitrary)", nRPCRollBarrel, 0, nRPCRollBarrel);
282  h_refOccupancyEndcap_detId = dbe_->book1D("RefOccupancyEndcap_detId", "Reference hit occupancy;roll index (can be arbitrary)", nRPCRollEndcap, 0, nRPCRollEndcap);
283  h_noiseOccupancyBarrel_detId = dbe_->book1D("NoiseOccupancyBarrel_detId", "Noise occupancy;roll index (can be arbitrary)", nRPCRollBarrel, 0, nRPCRollBarrel);
284  h_noiseOccupancyEndcap_detId = dbe_->book1D("NoiseOccupancyEndcap_detId", "Noise occupancy;roll index (can be arbitrary)", nRPCRollEndcap, 0, nRPCRollEndcap);
285 
286  h_matchOccupancyBarrel_detId->getTH1()->SetMinimum(0);
287  h_matchOccupancyEndcap_detId->getTH1()->SetMinimum(0);
288  h_refOccupancyBarrel_detId ->getTH1()->SetMinimum(0);
289  h_refOccupancyEndcap_detId ->getTH1()->SetMinimum(0);
290  h_noiseOccupancyBarrel_detId->getTH1()->SetMinimum(0);
291  h_noiseOccupancyEndcap_detId->getTH1()->SetMinimum(0);
292 
293  h_rollAreaBarrel_detId = dbe_->bookProfile("RollAreaBarrel_detId", "Roll area;roll index;Area", nRPCRollBarrel, 0., 1.*nRPCRollBarrel, 0., 1e5);
294  h_rollAreaEndcap_detId = dbe_->bookProfile("RollAreaEndcap_detId", "Roll area;roll index;Area", nRPCRollEndcap, 0., 1.*nRPCRollEndcap, 0., 1e5);
295 
296  for ( auto detIdToIndex : detIdToIndexMapBarrel_ )
297  {
298  const int rawId = detIdToIndex.first;
299  const int index = detIdToIndex.second;
300 
301  const RPCDetId rpcDetId = static_cast<const RPCDetId>(rawId);
302  const RPCRoll* roll = dynamic_cast<const RPCRoll*>(rpcGeom->roll(rpcDetId));
303 
304  //RPCGeomServ rpcSrv(roll->id());
305  //if ( !roll->specs()->isRPC() ) { cout << "\nNoRPC : " << rpcSrv.name() << ' ' << rawId << endl; continue; }
306 
307  const StripTopology& topol = roll->specificTopology();
308  const double area = topol.stripLength()*topol.nstrips()*topol.pitch();
309 
310  h_rollAreaBarrel_detId->Fill(index, area);
311  }
312 
313  for ( auto detIdToIndex : detIdToIndexMapEndcap_ )
314  {
315  const int rawId = detIdToIndex.first;
316  const int index = detIdToIndex.second;
317 
318  const RPCDetId rpcDetId = static_cast<const RPCDetId>(rawId);
319  const RPCRoll* roll = dynamic_cast<const RPCRoll*>(rpcGeom->roll(rpcDetId));
320 
321  //RPCGeomServ rpcSrv(roll->id());
322  //if ( !roll->specs()->isRPC() ) { cout << "\nNoRPC : " << rpcSrv.name() << ' ' << rawId << endl; continue; }
323 
324  const StripTopology& topol = roll->specificTopology();
325  const double area = topol.stripLength()*topol.nstrips()*topol.pitch();
326 
327  h_rollAreaEndcap_detId->Fill(index, area);
328  }
329 }
virtual int nstrips() const =0
DQMStore * dbe_
std::map< int, int > detIdToIndexMapEndcap_
MonitorElement * book1D(const char *name, const char *title, int nchX, double lowX, double highX)
Book 1D histogram.
Definition: DQMStore.cc:942
std::map< int, int > detIdToIndexMapBarrel_
MEP h_matchOccupancyBarrel_detId
const StripTopology & specificTopology() const
Definition: RPCRoll.cc:107
void Fill(long long x)
virtual float stripLength() const =0
MEP h_matchOccupancyEndcap_detId
MEP h_rollAreaEndcap_detId
MEP h_noiseOccupancyBarrel_detId
MEP h_rollAreaBarrel_detId
const std::vector< const RPCRoll * > & rolls() const
Return the Rolls.
Definition: RPCChamber.cc:68
TH1 * getTH1(void) const
MonitorElement * bookProfile(const char *name, const char *title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, const char *option="s")
Definition: DQMStore.cc:1256
MEP h_refOccupancyBarrel_detId
const T & get() const
Definition: EventSetup.h:55
std::string subDir_
virtual float pitch() const =0
MEP h_refOccupancyEndcap_detId
std::vector< GeomDet const * > DetContainer
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:655
MEP h_noiseOccupancyEndcap_detId
void RPCRecHitValid::endJob ( void  )
virtual

Reimplemented from edm::EDAnalyzer.

Definition at line 233 of file RPCRecHitValid.cc.

234 {
235 }
void RPCRecHitValid::endRun ( const edm::Run run,
const edm::EventSetup eventSetup 
)
virtual

Reimplemented from edm::EDAnalyzer.

Definition at line 331 of file RPCRecHitValid.cc.

References dbe_.

332 {
333  if ( !dbe_ ) return;
334 
335 }
DQMStore * dbe_

Member Data Documentation

DQMStore* RPCRecHitValid::dbe_
private

Definition at line 50 of file RPCRecHitValid.h.

std::map<int, int> RPCRecHitValid::detIdToIndexMapBarrel_
private

Definition at line 81 of file RPCRecHitValid.h.

std::map<int, int> RPCRecHitValid::detIdToIndexMapEndcap_
private

Definition at line 81 of file RPCRecHitValid.h.

RPCValidHistograms RPCRecHitValid::h_
private

Definition at line 53 of file RPCRecHitValid.h.

MEP RPCRecHitValid::h_eventCount
private

Definition at line 55 of file RPCRecHitValid.h.

MEP RPCRecHitValid::h_matchOccupancyBarrel_detId
private

Definition at line 72 of file RPCRecHitValid.h.

MEP RPCRecHitValid::h_matchOccupancyEndcap_detId
private

Definition at line 73 of file RPCRecHitValid.h.

MEP RPCRecHitValid::h_noiseOccupancyBarrel_detId
private

Definition at line 76 of file RPCRecHitValid.h.

MEP RPCRecHitValid::h_noiseOccupancyEndcap_detId
private

Definition at line 77 of file RPCRecHitValid.h.

MEP RPCRecHitValid::h_nRPCHitPerRecoMuon
private

Definition at line 58 of file RPCRecHitValid.h.

MEP RPCRecHitValid::h_nRPCHitPerRecoMuonBarrel
private

Definition at line 58 of file RPCRecHitValid.h.

MEP RPCRecHitValid::h_nRPCHitPerRecoMuonEndcap
private

Definition at line 58 of file RPCRecHitValid.h.

MEP RPCRecHitValid::h_nRPCHitPerRecoMuonOverlap
private

Definition at line 58 of file RPCRecHitValid.h.

MEP RPCRecHitValid::h_nRPCHitPerSimMuon
private

Definition at line 57 of file RPCRecHitValid.h.

MEP RPCRecHitValid::h_nRPCHitPerSimMuonBarrel
private

Definition at line 57 of file RPCRecHitValid.h.

MEP RPCRecHitValid::h_nRPCHitPerSimMuonEndcap
private

Definition at line 57 of file RPCRecHitValid.h.

MEP RPCRecHitValid::h_nRPCHitPerSimMuonOverlap
private

Definition at line 57 of file RPCRecHitValid.h.

MEP RPCRecHitValid::h_recoMuonBarrel_eta
private

Definition at line 63 of file RPCRecHitValid.h.

MEP RPCRecHitValid::h_recoMuonBarrel_phi
private

Definition at line 64 of file RPCRecHitValid.h.

MEP RPCRecHitValid::h_recoMuonBarrel_pt
private

Definition at line 62 of file RPCRecHitValid.h.

MEP RPCRecHitValid::h_recoMuonEndcap_eta
private

Definition at line 63 of file RPCRecHitValid.h.

MEP RPCRecHitValid::h_recoMuonEndcap_phi
private

Definition at line 64 of file RPCRecHitValid.h.

MEP RPCRecHitValid::h_recoMuonEndcap_pt
private

Definition at line 62 of file RPCRecHitValid.h.

MEP RPCRecHitValid::h_recoMuonNoRPC_eta
private

Definition at line 63 of file RPCRecHitValid.h.

MEP RPCRecHitValid::h_recoMuonNoRPC_phi
private

Definition at line 64 of file RPCRecHitValid.h.

MEP RPCRecHitValid::h_recoMuonNoRPC_pt
private

Definition at line 62 of file RPCRecHitValid.h.

MEP RPCRecHitValid::h_recoMuonOverlap_eta
private

Definition at line 63 of file RPCRecHitValid.h.

MEP RPCRecHitValid::h_recoMuonOverlap_phi
private

Definition at line 64 of file RPCRecHitValid.h.

MEP RPCRecHitValid::h_recoMuonOverlap_pt
private

Definition at line 62 of file RPCRecHitValid.h.

MEP RPCRecHitValid::h_recPunchOccupancyBarrel_station
private

Definition at line 69 of file RPCRecHitValid.h.

MEP RPCRecHitValid::h_recPunchOccupancyBarrel_wheel
private

Definition at line 69 of file RPCRecHitValid.h.

MEP RPCRecHitValid::h_recPunchOccupancyBarrel_wheel_station
private

Definition at line 70 of file RPCRecHitValid.h.

MEP RPCRecHitValid::h_recPunchOccupancyEndcap_disk
private

Definition at line 69 of file RPCRecHitValid.h.

MEP RPCRecHitValid::h_recPunchOccupancyEndcap_disk_ring
private

Definition at line 70 of file RPCRecHitValid.h.

MEP RPCRecHitValid::h_refOccupancyBarrel_detId
private

Definition at line 74 of file RPCRecHitValid.h.

MEP RPCRecHitValid::h_refOccupancyEndcap_detId
private

Definition at line 75 of file RPCRecHitValid.h.

MEP RPCRecHitValid::h_refPunchOccupancyBarrel_station
private

Definition at line 67 of file RPCRecHitValid.h.

MEP RPCRecHitValid::h_refPunchOccupancyBarrel_wheel
private

Definition at line 67 of file RPCRecHitValid.h.

MEP RPCRecHitValid::h_refPunchOccupancyBarrel_wheel_station
private

Definition at line 68 of file RPCRecHitValid.h.

MEP RPCRecHitValid::h_refPunchOccupancyEndcap_disk
private

Definition at line 67 of file RPCRecHitValid.h.

MEP RPCRecHitValid::h_refPunchOccupancyEndcap_disk_ring
private

Definition at line 68 of file RPCRecHitValid.h.

MEP RPCRecHitValid::h_rollAreaBarrel_detId
private

Definition at line 78 of file RPCRecHitValid.h.

MEP RPCRecHitValid::h_rollAreaEndcap_detId
private

Definition at line 79 of file RPCRecHitValid.h.

MEP RPCRecHitValid::h_simMuonBarrel_eta
private

Definition at line 60 of file RPCRecHitValid.h.

MEP RPCRecHitValid::h_simMuonBarrel_phi
private

Definition at line 61 of file RPCRecHitValid.h.

MEP RPCRecHitValid::h_simMuonBarrel_pt
private

Definition at line 59 of file RPCRecHitValid.h.

MEP RPCRecHitValid::h_simMuonEndcap_eta
private

Definition at line 60 of file RPCRecHitValid.h.

MEP RPCRecHitValid::h_simMuonEndcap_phi
private

Definition at line 61 of file RPCRecHitValid.h.

MEP RPCRecHitValid::h_simMuonEndcap_pt
private

Definition at line 59 of file RPCRecHitValid.h.

MEP RPCRecHitValid::h_simMuonNoRPC_eta
private

Definition at line 60 of file RPCRecHitValid.h.

MEP RPCRecHitValid::h_simMuonNoRPC_phi
private

Definition at line 61 of file RPCRecHitValid.h.

MEP RPCRecHitValid::h_simMuonNoRPC_pt
private

Definition at line 59 of file RPCRecHitValid.h.

MEP RPCRecHitValid::h_simMuonOverlap_eta
private

Definition at line 60 of file RPCRecHitValid.h.

MEP RPCRecHitValid::h_simMuonOverlap_phi
private

Definition at line 61 of file RPCRecHitValid.h.

MEP RPCRecHitValid::h_simMuonOverlap_pt
private

Definition at line 59 of file RPCRecHitValid.h.

MEP RPCRecHitValid::h_simParticleType
private

Definition at line 65 of file RPCRecHitValid.h.

MEP RPCRecHitValid::h_simParticleTypeBarrel
private

Definition at line 65 of file RPCRecHitValid.h.

MEP RPCRecHitValid::h_simParticleTypeEndcap
private

Definition at line 65 of file RPCRecHitValid.h.

edm::EDGetTokenT<reco::MuonCollection> RPCRecHitValid::muonToken_
private

Definition at line 48 of file RPCRecHitValid.h.

edm::EDGetTokenT<RecHits> RPCRecHitValid::recHitToken_
private

Definition at line 45 of file RPCRecHitValid.h.

edm::EDGetTokenT<SimHitAssoc> RPCRecHitValid::simHitAssocToken_
private

Definition at line 47 of file RPCRecHitValid.h.

edm::EDGetTokenT<SimHits> RPCRecHitValid::simHitToken_
private

Definition at line 44 of file RPCRecHitValid.h.

edm::EDGetTokenT<SimParticles> RPCRecHitValid::simParticleToken_
private

Definition at line 46 of file RPCRecHitValid.h.

std::string RPCRecHitValid::subDir_
private

Definition at line 43 of file RPCRecHitValid.h.