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
 EDAnalyzer ()
 
std::string workerType () const
 
virtual ~EDAnalyzer ()
 
- Public Member Functions inherited from edm::EDConsumerBase
 EDConsumerBase ()
 
ProductHolderIndex indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductHolderIndex > &) const
 
void itemsToGet (BranchType, std::vector< ProductHolderIndex > &) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

Private Types

typedef MonitorElementMEP
 

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::InputTag muonLabel_
 
edm::InputTag recHitLabel_
 
edm::InputTag simHitAssocLabel_
 
edm::InputTag simHitLabel_
 
edm::InputTag simParticleLabel_
 
std::string subDir_
 

Additional Inherited Members

- Public Types inherited from edm::EDAnalyzer
typedef EDAnalyzer ModuleType
 
typedef WorkerT< EDAnalyzerWorkerType
 
- 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::EDAnalyzer
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
CurrentProcessingContext const * currentContext () const
 
- 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 20 of file RPCRecHitValid.h.

Member Typedef Documentation

Definition at line 41 of file RPCRecHitValid.h.

Constructor & Destructor Documentation

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

Definition at line 30 of file RPCRecHitValid.cc.

References dbe_, edm::ParameterSet::getParameter(), h, i, cppFunctionSkipper::operator, Pi, jptDQMConfig_cff::ptBins, and AlCaHLTBitMon_QueryRunRegistry::string.

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

Definition at line 229 of file RPCRecHitValid.cc.

230 {
231 }

Member Function Documentation

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

Implements edm::EDAnalyzer.

Definition at line 341 of file RPCRecHitValid.cc.

References abs, dbe_, DetId::det(), edm::EventSetup::get(), edm::Event::getByLabel(), 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().

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

Reimplemented from edm::EDAnalyzer.

Definition at line 233 of file RPCRecHitValid.cc.

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

Reimplemented from edm::EDAnalyzer.

Definition at line 241 of file RPCRecHitValid.cc.

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

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

Reimplemented from edm::EDAnalyzer.

Definition at line 237 of file RPCRecHitValid.cc.

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

Reimplemented from edm::EDAnalyzer.

Definition at line 335 of file RPCRecHitValid.cc.

References dbe_.

336 {
337  if ( !dbe_ ) return;
338 
339 }
DQMStore * dbe_

Member Data Documentation

DQMStore* RPCRecHitValid::dbe_
private

Definition at line 39 of file RPCRecHitValid.h.

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

Definition at line 70 of file RPCRecHitValid.h.

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

Definition at line 70 of file RPCRecHitValid.h.

RPCValidHistograms RPCRecHitValid::h_
private

Definition at line 42 of file RPCRecHitValid.h.

MEP RPCRecHitValid::h_eventCount
private

Definition at line 44 of file RPCRecHitValid.h.

MEP RPCRecHitValid::h_matchOccupancyBarrel_detId
private

Definition at line 61 of file RPCRecHitValid.h.

MEP RPCRecHitValid::h_matchOccupancyEndcap_detId
private

Definition at line 62 of file RPCRecHitValid.h.

MEP RPCRecHitValid::h_noiseOccupancyBarrel_detId
private

Definition at line 65 of file RPCRecHitValid.h.

MEP RPCRecHitValid::h_noiseOccupancyEndcap_detId
private

Definition at line 66 of file RPCRecHitValid.h.

MEP RPCRecHitValid::h_nRPCHitPerRecoMuon
private

Definition at line 47 of file RPCRecHitValid.h.

MEP RPCRecHitValid::h_nRPCHitPerRecoMuonBarrel
private

Definition at line 47 of file RPCRecHitValid.h.

MEP RPCRecHitValid::h_nRPCHitPerRecoMuonEndcap
private

Definition at line 47 of file RPCRecHitValid.h.

MEP RPCRecHitValid::h_nRPCHitPerRecoMuonOverlap
private

Definition at line 47 of file RPCRecHitValid.h.

MEP RPCRecHitValid::h_nRPCHitPerSimMuon
private

Definition at line 46 of file RPCRecHitValid.h.

MEP RPCRecHitValid::h_nRPCHitPerSimMuonBarrel
private

Definition at line 46 of file RPCRecHitValid.h.

MEP RPCRecHitValid::h_nRPCHitPerSimMuonEndcap
private

Definition at line 46 of file RPCRecHitValid.h.

MEP RPCRecHitValid::h_nRPCHitPerSimMuonOverlap
private

Definition at line 46 of file RPCRecHitValid.h.

MEP RPCRecHitValid::h_recoMuonBarrel_eta
private

Definition at line 52 of file RPCRecHitValid.h.

MEP RPCRecHitValid::h_recoMuonBarrel_phi
private

Definition at line 53 of file RPCRecHitValid.h.

MEP RPCRecHitValid::h_recoMuonBarrel_pt
private

Definition at line 51 of file RPCRecHitValid.h.

MEP RPCRecHitValid::h_recoMuonEndcap_eta
private

Definition at line 52 of file RPCRecHitValid.h.

MEP RPCRecHitValid::h_recoMuonEndcap_phi
private

Definition at line 53 of file RPCRecHitValid.h.

MEP RPCRecHitValid::h_recoMuonEndcap_pt
private

Definition at line 51 of file RPCRecHitValid.h.

MEP RPCRecHitValid::h_recoMuonNoRPC_eta
private

Definition at line 52 of file RPCRecHitValid.h.

MEP RPCRecHitValid::h_recoMuonNoRPC_phi
private

Definition at line 53 of file RPCRecHitValid.h.

MEP RPCRecHitValid::h_recoMuonNoRPC_pt
private

Definition at line 51 of file RPCRecHitValid.h.

MEP RPCRecHitValid::h_recoMuonOverlap_eta
private

Definition at line 52 of file RPCRecHitValid.h.

MEP RPCRecHitValid::h_recoMuonOverlap_phi
private

Definition at line 53 of file RPCRecHitValid.h.

MEP RPCRecHitValid::h_recoMuonOverlap_pt
private

Definition at line 51 of file RPCRecHitValid.h.

MEP RPCRecHitValid::h_recPunchOccupancyBarrel_station
private

Definition at line 58 of file RPCRecHitValid.h.

MEP RPCRecHitValid::h_recPunchOccupancyBarrel_wheel
private

Definition at line 58 of file RPCRecHitValid.h.

MEP RPCRecHitValid::h_recPunchOccupancyBarrel_wheel_station
private

Definition at line 59 of file RPCRecHitValid.h.

MEP RPCRecHitValid::h_recPunchOccupancyEndcap_disk
private

Definition at line 58 of file RPCRecHitValid.h.

MEP RPCRecHitValid::h_recPunchOccupancyEndcap_disk_ring
private

Definition at line 59 of file RPCRecHitValid.h.

MEP RPCRecHitValid::h_refOccupancyBarrel_detId
private

Definition at line 63 of file RPCRecHitValid.h.

MEP RPCRecHitValid::h_refOccupancyEndcap_detId
private

Definition at line 64 of file RPCRecHitValid.h.

MEP RPCRecHitValid::h_refPunchOccupancyBarrel_station
private

Definition at line 56 of file RPCRecHitValid.h.

MEP RPCRecHitValid::h_refPunchOccupancyBarrel_wheel
private

Definition at line 56 of file RPCRecHitValid.h.

MEP RPCRecHitValid::h_refPunchOccupancyBarrel_wheel_station
private

Definition at line 57 of file RPCRecHitValid.h.

MEP RPCRecHitValid::h_refPunchOccupancyEndcap_disk
private

Definition at line 56 of file RPCRecHitValid.h.

MEP RPCRecHitValid::h_refPunchOccupancyEndcap_disk_ring
private

Definition at line 57 of file RPCRecHitValid.h.

MEP RPCRecHitValid::h_rollAreaBarrel_detId
private

Definition at line 67 of file RPCRecHitValid.h.

MEP RPCRecHitValid::h_rollAreaEndcap_detId
private

Definition at line 68 of file RPCRecHitValid.h.

MEP RPCRecHitValid::h_simMuonBarrel_eta
private

Definition at line 49 of file RPCRecHitValid.h.

MEP RPCRecHitValid::h_simMuonBarrel_phi
private

Definition at line 50 of file RPCRecHitValid.h.

MEP RPCRecHitValid::h_simMuonBarrel_pt
private

Definition at line 48 of file RPCRecHitValid.h.

MEP RPCRecHitValid::h_simMuonEndcap_eta
private

Definition at line 49 of file RPCRecHitValid.h.

MEP RPCRecHitValid::h_simMuonEndcap_phi
private

Definition at line 50 of file RPCRecHitValid.h.

MEP RPCRecHitValid::h_simMuonEndcap_pt
private

Definition at line 48 of file RPCRecHitValid.h.

MEP RPCRecHitValid::h_simMuonNoRPC_eta
private

Definition at line 49 of file RPCRecHitValid.h.

MEP RPCRecHitValid::h_simMuonNoRPC_phi
private

Definition at line 50 of file RPCRecHitValid.h.

MEP RPCRecHitValid::h_simMuonNoRPC_pt
private

Definition at line 48 of file RPCRecHitValid.h.

MEP RPCRecHitValid::h_simMuonOverlap_eta
private

Definition at line 49 of file RPCRecHitValid.h.

MEP RPCRecHitValid::h_simMuonOverlap_phi
private

Definition at line 50 of file RPCRecHitValid.h.

MEP RPCRecHitValid::h_simMuonOverlap_pt
private

Definition at line 48 of file RPCRecHitValid.h.

MEP RPCRecHitValid::h_simParticleType
private

Definition at line 54 of file RPCRecHitValid.h.

MEP RPCRecHitValid::h_simParticleTypeBarrel
private

Definition at line 54 of file RPCRecHitValid.h.

MEP RPCRecHitValid::h_simParticleTypeEndcap
private

Definition at line 54 of file RPCRecHitValid.h.

edm::InputTag RPCRecHitValid::muonLabel_
private

Definition at line 37 of file RPCRecHitValid.h.

edm::InputTag RPCRecHitValid::recHitLabel_
private

Definition at line 34 of file RPCRecHitValid.h.

edm::InputTag RPCRecHitValid::simHitAssocLabel_
private

Definition at line 36 of file RPCRecHitValid.h.

edm::InputTag RPCRecHitValid::simHitLabel_
private

Definition at line 34 of file RPCRecHitValid.h.

edm::InputTag RPCRecHitValid::simParticleLabel_
private

Definition at line 35 of file RPCRecHitValid.h.

std::string RPCRecHitValid::subDir_
private

Definition at line 33 of file RPCRecHitValid.h.