CMS 3D CMS Logo

DTRecHitQuality.h
Go to the documentation of this file.
1 #ifndef Validation_DTRecHits_H
2 #define Validation_DTRecHits_H
3 
19 
21 
27 #include "Histograms.h"
32 
33 
34 #include <vector>
35 #include <map>
36 #include <string>
37 
38 namespace edm {
39  class ParameterSet;
40  class Event;
41  class EventSetup;
42 }
43 
44 class PSimHit;
45 class TFile;
46 class DTLayer;
47 class DTWireId;
48 class DTGeometry;
49 
51 public:
54 
56  virtual ~DTRecHitQuality();
57 
58  // Operations
59 
61  void analyze(const edm::Event & event, const edm::EventSetup& eventSetup);
62  // Write the histos to file
63 
64  virtual void beginRun(const edm::Run& iRun, const edm::EventSetup &setup);
65 
66  void endJob();
67  void endLuminosityBlock(edm::LuminosityBlock const& lumiSeg,
68  edm::EventSetup const& c);
69 
70 protected:
71 
72 private:
73 
74 
75  // The file which will store the histos
76  //TFile *theFile;
77  // Switch for debug output
78  bool debug;
79  // Root file name
85 
90 
91  // Switches for analysis at various steps
92  bool doStep1;
93  bool doStep2;
94  bool doStep3;
95  bool local;
96  // Return a map between DTRecHit1DPair and wireId
97  std::map<DTWireId, std::vector<DTRecHit1DPair> >
98  map1DRecHitsPerWire(const DTRecHitCollection* dt1DRecHitPairs);
99 
100  // Return a map between DTRecHit1D and wireId
101  std::map<DTWireId, std::vector<DTRecHit1D> >
102  map1DRecHitsPerWire(const DTRecSegment2DCollection* segment2Ds);
103 
104  // Return a map between DTRecHit1D and wireId
105  std::map<DTWireId, std::vector<DTRecHit1D> >
106  map1DRecHitsPerWire(const DTRecSegment4DCollection* segment4Ds);
107 
108  // Compute SimHit distance from wire (cm)
109  float simHitDistFromWire(const DTLayer* layer,
110  DTWireId wireId,
111  const PSimHit& hit);
112 
113  // Compute SimHit impact angle (in direction perp to wire)
114  float simHitImpactAngle(const DTLayer* layer,
115  DTWireId wireId,
116  const PSimHit& hit);
117 
118  // Compute SimHit distance from FrontEnd
119  float simHitDistFromFE(const DTLayer* layer,
120  DTWireId wireId,
121  const PSimHit& hit);
122 
123  // Find the RecHit closest to the muon SimHit
124 // const DTRecHit1DPair*
125 // findBestRecHit(const DTLayer* layer,
126 // DTWireId wireId,
127 // const std::vector<DTRecHit1DPair>& recHits,
128 // const float simHitDist);
129  template <typename type>
130  const type*
131  findBestRecHit(const DTLayer* layer,
132  DTWireId wireId,
133  const std::vector<type>& recHits,
134  const float simHitDist);
135 
136 
137 
138 
139  // Compute the distance from wire (cm) of a hits in a DTRecHit1DPair
140  float recHitDistFromWire(const DTRecHit1DPair& hitPair, const DTLayer* layer);
141  // Compute the distance from wire (cm) of a hits in a DTRecHit1D
142  float recHitDistFromWire(const DTRecHit1D& recHit, const DTLayer* layer);
143 
144  // Return the error on the measured (cm) coordinate
145  float recHitPositionError(const DTRecHit1DPair& recHit);
146  float recHitPositionError(const DTRecHit1D& recHit);
147 
148 
149  // Does the real job
150  template <typename type>
151  void compute(const DTGeometry *dtGeom,
152  const std::map<DTWireId, std::vector<PSimHit> >& simHitsPerWire,
153  const std::map<DTWireId, std::vector<type> >& recHitsPerWire,
154  int step);
155  //HRes1DHit * hRes_S1RPhi;
156  HRes1DHit *hRes_S1RPhi; // RecHits, 1. step, RPh
157  HRes1DHit *hRes_S2RPhi; // RecHits, 2. step, RPhi
158  HRes1DHit *hRes_S3RPhi; // RecHits, 3. step, RPhi
159 
160  HRes1DHit *hRes_S1RZ; // RecHits, 1. step, RZ
161  HRes1DHit *hRes_S2RZ; // RecHits, 2. step, RZ
162  HRes1DHit *hRes_S3RZ; // RecHits, 3. step, RZ
163 
164  HRes1DHit *hRes_S1RZ_W0; // RecHits, 1. step, RZ, wheel 0
165  HRes1DHit *hRes_S2RZ_W0; // RecHits, 2. step, RZ, wheel 0
166  HRes1DHit *hRes_S3RZ_W0; // RecHits, 3. step, RZ, wheel 0
167 
168  HRes1DHit *hRes_S1RZ_W1; // RecHits, 1. step, RZ, wheel +-1
169  HRes1DHit *hRes_S2RZ_W1; // RecHits, 2. step, RZ, wheel +-1
170  HRes1DHit *hRes_S3RZ_W1; // RecHits, 3. step, RZ, wheel +-1
171 
172  HRes1DHit *hRes_S1RZ_W2; // RecHits, 1. step, RZ, wheel +-2
173  HRes1DHit *hRes_S2RZ_W2; // RecHits, 2. step, RZ, wheel +-2
174  HRes1DHit *hRes_S3RZ_W2; // RecHits, 3. step, RZ, wheel +-2
175 
176  HRes1DHit *hRes_S1RPhi_W0; // RecHits, 1. step, RPhi, wheel 0
177  HRes1DHit *hRes_S2RPhi_W0; // RecHits, 2. step, RPhi, wheel 0
178  HRes1DHit *hRes_S3RPhi_W0; // RecHits, 3. step, RPhi, wheel 0
179 
180  HRes1DHit *hRes_S1RPhi_W1; // RecHits, 1. step, RPhi, wheel +-1
181  HRes1DHit *hRes_S2RPhi_W1; // RecHits, 2. step, RPhi, wheel +-1
182  HRes1DHit *hRes_S3RPhi_W1; // RecHits, 3. step, RPhi, wheel +-1
183 
184  HRes1DHit *hRes_S1RPhi_W2; // RecHits, 1. step, RPhi, wheel +-2
185  HRes1DHit *hRes_S2RPhi_W2; // RecHits, 2. step, RPhi, wheel +-2
186  HRes1DHit *hRes_S3RPhi_W2; // RecHits, 3. step, RPhi, wheel +-2
187 
188  HRes1DHit* hRes_S3RPhiWS[3][4]; // RecHits, 3. step, by wheel/station
189  HRes1DHit* hRes_S3RZWS[3][4]; // RecHits, 3. step, by wheel/station
190 
191  HEff1DHit *hEff_S1RPhi; // RecHits, 1. step, RPhi
192  HEff1DHit *hEff_S2RPhi; // RecHits, 2. step, RPhi
193  HEff1DHit *hEff_S3RPhi; // RecHits, 3. step, RPhi
194 
195  HEff1DHit *hEff_S1RZ; // RecHits, 1. step, RZ
196  HEff1DHit *hEff_S2RZ; // RecHits, 2. step, RZ
197  HEff1DHit *hEff_S3RZ; // RecHits, 3. step, RZ
198 
199  HEff1DHit *hEff_S1RZ_W0; // RecHits, 1. step, RZ, wheel 0
200  HEff1DHit *hEff_S2RZ_W0; // RecHits, 2. step, RZ, wheel 0
201  HEff1DHit *hEff_S3RZ_W0; // RecHits, 3. step, RZ, wheel 0
202 
203  HEff1DHit *hEff_S1RZ_W1; // RecHits, 1. step, RZ, wheel +-1
204  HEff1DHit *hEff_S2RZ_W1; // RecHits, 2. step, RZ, wheel +-1
205  HEff1DHit *hEff_S3RZ_W1; // RecHits, 3. step, RZ, wheel +-1
206 
207  HEff1DHit *hEff_S1RZ_W2; // RecHits, 1. step, RZ, wheel +-2
208  HEff1DHit *hEff_S2RZ_W2; // RecHits, 2. step, RZ, wheel +-2
209  HEff1DHit *hEff_S3RZ_W2; // RecHits, 3. step, RZ, wheel +-2
210 
211  HEff1DHit* hEff_S1RPhiWS[3][4]; // RecHits, 3. step, by wheel/station
212  HEff1DHit* hEff_S3RPhiWS[3][4]; // RecHits, 3. step, by wheel/station
213  HEff1DHit* hEff_S1RZWS[3][4]; // RecHits, 3. step, by wheel/station
214  HEff1DHit* hEff_S3RZWS[3][4]; // RecHits, 3. step, by wheel/station
215 
217  bool doall;
218 };
219 #endif
220 
221 
222 
223 
type
Definition: HCALResponse.h:21
edm::InputTag simHitLabel
edm::InputTag recHitLabel
HEff1DHit * hEff_S3RZ
HEff1DHit * hEff_S2RZ_W0
HRes1DHit * hRes_S3RPhi_W0
HEff1DHit * hEff_S2RZ
edm::EDGetTokenT< DTRecHitCollection > recHitToken_
def analyze(function, filename, filter=None)
Definition: Profiling.py:11
HEff1DHit * hEff_S3RPhi
HRes1DHit * hRes_S1RPhi_W1
def setup(process, global_tag, zero_tesla=False)
Definition: GeneralSetup.py:1
HRes1DHit * hRes_S1RPhi_W0
HRes1DHit * hRes_S1RZ
HRes1DHit * hRes_S3RZ_W2
HEff1DHit * hEff_S1RZ_W2
HEff1DHit * hEff_S3RZ_W1
HRes1DHit * hRes_S1RZ_W2
HRes1DHit * hRes_S2RPhi_W0
edm::EDGetTokenT< DTRecSegment2DCollection > segment2DToken_
HRes1DHit * hRes_S1RPhi
HRes1DHit * hRes_S2RPhi_W1
HRes1DHit * hRes_S2RZ_W1
A set of histograms of residuals and pulls for 1D RecHits.
Definition: Histograms.h:26
HEff1DHit * hEff_S3RZ_W2
HEff1DHit * hEff_S1RZ_W0
HRes1DHit * hRes_S2RZ_W0
HRes1DHit * hRes_S2RPhi_W2
std::string rootFileName
HEff1DHit * hEff_S2RZ_W1
HRes1DHit * hRes_S1RPhi_W2
HRes1DHit * hRes_S1RZ_W1
HEff1DHit * hEff_S3RZ_W0
HEff1DHit * hEff_S2RZ_W2
HRes1DHit * hRes_S2RPhi
HRes1DHit * hRes_S3RPhi_W2
HEff1DHit * hEff_S1RPhi
def compute(min, max)
HEff1DHit * hEff_S1RZ
HRes1DHit * hRes_S3RPhi
HEff1DHit * hEff_S2RPhi
HEff1DHit * hEff_S1RZ_W1
HLT enums.
edm::InputTag segment4DLabel
HRes1DHit * hRes_S3RZ_W0
HRes1DHit * hRes_S3RZ_W1
HRes1DHit * hRes_S3RZ
HRes1DHit * hRes_S2RZ
step
edm::InputTag segment2DLabel
HRes1DHit * hRes_S2RZ_W2
HRes1DHit * hRes_S3RPhi_W1
edm::EDGetTokenT< edm::PSimHitContainer > simHitToken_
HRes1DHit * hRes_S1RZ_W0
Definition: event.py:1
Definition: Run.h:42