CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
DTRecHitQuality.h
Go to the documentation of this file.
1 #ifndef Validation_DTRecHits_H
2 #define Validation_DTRecHits_H
3 
19 
21 
26 #include "Histograms.h"
31 
32 
33 #include <vector>
34 #include <map>
35 #include <string>
36 
37 namespace edm {
38  class ParameterSet;
39  class Event;
40  class EventSetup;
41 }
42 
43 class PSimHit;
44 class TFile;
45 class DTLayer;
46 class DTWireId;
47 class DTGeometry;
48 
50 public:
53 
55  virtual ~DTRecHitQuality();
56 
57  // Operations
58 
60  void analyze(const edm::Event & event, const edm::EventSetup& eventSetup);
61  // Write the histos to file
62 
63  void endJob();
64 void endLuminosityBlock(edm::LuminosityBlock const& lumiSeg,
65  edm::EventSetup const& c);
66 
67 protected:
68 
69 private:
70 
71 
72  // The file which will store the histos
73  //TFile *theFile;
74  // Switch for debug output
75  bool debug;
76  // Root file name
82 
83  // Switches for analysis at various steps
84  bool doStep1;
85  bool doStep2;
86  bool doStep3;
87  bool local;
88  // Return a map between DTRecHit1DPair and wireId
89  std::map<DTWireId, std::vector<DTRecHit1DPair> >
90  map1DRecHitsPerWire(const DTRecHitCollection* dt1DRecHitPairs);
91 
92  // Return a map between DTRecHit1D and wireId
93  std::map<DTWireId, std::vector<DTRecHit1D> >
95 
96  // Return a map between DTRecHit1D and wireId
97  std::map<DTWireId, std::vector<DTRecHit1D> >
99 
100  // Compute SimHit distance from wire (cm)
101  float simHitDistFromWire(const DTLayer* layer,
102  DTWireId wireId,
103  const PSimHit& hit);
104 
105  // Compute SimHit impact angle (in direction perp to wire)
106  float simHitImpactAngle(const DTLayer* layer,
107  DTWireId wireId,
108  const PSimHit& hit);
109 
110  // Compute SimHit distance from FrontEnd
111  float simHitDistFromFE(const DTLayer* layer,
112  DTWireId wireId,
113  const PSimHit& hit);
114 
115  // Find the RecHit closest to the muon SimHit
116 // const DTRecHit1DPair*
117 // findBestRecHit(const DTLayer* layer,
118 // DTWireId wireId,
119 // const std::vector<DTRecHit1DPair>& recHits,
120 // const float simHitDist);
121  template <typename type>
122  const type*
123  findBestRecHit(const DTLayer* layer,
124  DTWireId wireId,
125  const std::vector<type>& recHits,
126  const float simHitDist);
127 
128 
129 
130 
131  // Compute the distance from wire (cm) of a hits in a DTRecHit1DPair
132  float recHitDistFromWire(const DTRecHit1DPair& hitPair, const DTLayer* layer);
133  // Compute the distance from wire (cm) of a hits in a DTRecHit1D
134  float recHitDistFromWire(const DTRecHit1D& recHit, const DTLayer* layer);
135 
136  // Return the error on the measured (cm) coordinate
137  float recHitPositionError(const DTRecHit1DPair& recHit);
138  float recHitPositionError(const DTRecHit1D& recHit);
139 
140 
141  // Does the real job
142  template <typename type>
143  void compute(const DTGeometry *dtGeom,
144  const std::map<DTWireId, std::vector<PSimHit> >& simHitsPerWire,
145  const std::map<DTWireId, std::vector<type> >& recHitsPerWire,
146  int step);
147  //HRes1DHit * hRes_S1RPhi;
148  HRes1DHit *hRes_S1RPhi; // RecHits, 1. step, RPh
149  HRes1DHit *hRes_S2RPhi; // RecHits, 2. step, RPhi
150  HRes1DHit *hRes_S3RPhi; // RecHits, 3. step, RPhi
151 
152  HRes1DHit *hRes_S1RZ; // RecHits, 1. step, RZ
153  HRes1DHit *hRes_S2RZ; // RecHits, 2. step, RZ
154  HRes1DHit *hRes_S3RZ; // RecHits, 3. step, RZ
155 
156  HRes1DHit *hRes_S1RZ_W0; // RecHits, 1. step, RZ, wheel 0
157  HRes1DHit *hRes_S2RZ_W0; // RecHits, 2. step, RZ, wheel 0
158  HRes1DHit *hRes_S3RZ_W0; // RecHits, 3. step, RZ, wheel 0
159 
160  HRes1DHit *hRes_S1RZ_W1; // RecHits, 1. step, RZ, wheel +-1
161  HRes1DHit *hRes_S2RZ_W1; // RecHits, 2. step, RZ, wheel +-1
162  HRes1DHit *hRes_S3RZ_W1; // RecHits, 3. step, RZ, wheel +-1
163 
164  HRes1DHit *hRes_S1RZ_W2; // RecHits, 1. step, RZ, wheel +-2
165  HRes1DHit *hRes_S2RZ_W2; // RecHits, 2. step, RZ, wheel +-2
166  HRes1DHit *hRes_S3RZ_W2; // RecHits, 3. step, RZ, wheel +-2
167 
168  HRes1DHit *hRes_S1RPhi_W0; // RecHits, 1. step, RPhi, wheel 0
169  HRes1DHit *hRes_S2RPhi_W0; // RecHits, 2. step, RPhi, wheel 0
170  HRes1DHit *hRes_S3RPhi_W0; // RecHits, 3. step, RPhi, wheel 0
171 
172  HRes1DHit *hRes_S1RPhi_W1; // RecHits, 1. step, RPhi, wheel +-1
173  HRes1DHit *hRes_S2RPhi_W1; // RecHits, 2. step, RPhi, wheel +-1
174  HRes1DHit *hRes_S3RPhi_W1; // RecHits, 3. step, RPhi, wheel +-1
175 
176  HRes1DHit *hRes_S1RPhi_W2; // RecHits, 1. step, RPhi, wheel +-2
177  HRes1DHit *hRes_S2RPhi_W2; // RecHits, 2. step, RPhi, wheel +-2
178  HRes1DHit *hRes_S3RPhi_W2; // RecHits, 3. step, RPhi, wheel +-2
179 
180  HRes1DHit* hRes_S3RPhiWS[3][4]; // RecHits, 3. step, by wheel/station
181  HRes1DHit* hRes_S3RZWS[3][4]; // RecHits, 3. step, by wheel/station
182 
183  HEff1DHit *hEff_S1RPhi; // RecHits, 1. step, RPhi
184  HEff1DHit *hEff_S2RPhi; // RecHits, 2. step, RPhi
185  HEff1DHit *hEff_S3RPhi; // RecHits, 3. step, RPhi
186 
187  HEff1DHit *hEff_S1RZ; // RecHits, 1. step, RZ
188  HEff1DHit *hEff_S2RZ; // RecHits, 2. step, RZ
189  HEff1DHit *hEff_S3RZ; // RecHits, 3. step, RZ
190 
191  HEff1DHit *hEff_S1RZ_W0; // RecHits, 1. step, RZ, wheel 0
192  HEff1DHit *hEff_S2RZ_W0; // RecHits, 2. step, RZ, wheel 0
193  HEff1DHit *hEff_S3RZ_W0; // RecHits, 3. step, RZ, wheel 0
194 
195  HEff1DHit *hEff_S1RZ_W1; // RecHits, 1. step, RZ, wheel +-1
196  HEff1DHit *hEff_S2RZ_W1; // RecHits, 2. step, RZ, wheel +-1
197  HEff1DHit *hEff_S3RZ_W1; // RecHits, 3. step, RZ, wheel +-1
198 
199  HEff1DHit *hEff_S1RZ_W2; // RecHits, 1. step, RZ, wheel +-2
200  HEff1DHit *hEff_S2RZ_W2; // RecHits, 2. step, RZ, wheel +-2
201  HEff1DHit *hEff_S3RZ_W2; // RecHits, 3. step, RZ, wheel +-2
202 
203  HEff1DHit* hEff_S1RPhiWS[3][4]; // RecHits, 3. step, by wheel/station
204  HEff1DHit* hEff_S3RPhiWS[3][4]; // RecHits, 3. step, by wheel/station
205  HEff1DHit* hEff_S1RZWS[3][4]; // RecHits, 3. step, by wheel/station
206  HEff1DHit* hEff_S3RZWS[3][4]; // RecHits, 3. step, by wheel/station
207 
209  bool doall;
210 };
211 #endif
212 
213 
214 
215 
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
HEff1DHit * hEff_S3RPhi
HRes1DHit * hRes_S1RPhi_W1
void compute(const DTGeometry *dtGeom, const std::map< DTWireId, std::vector< PSimHit > > &simHitsPerWire, const std::map< DTWireId, std::vector< type > > &recHitsPerWire, int step)
const type * findBestRecHit(const DTLayer *layer, DTWireId wireId, const std::vector< type > &recHits, const float simHitDist)
HEff1DHit * hEff_S1RZWS[3][4]
void analyze(const edm::Event &event, const edm::EventSetup &eventSetup)
Perform the real analysis.
HRes1DHit * hRes_S1RPhi_W0
HRes1DHit * hRes_S1RZ
virtual ~DTRecHitQuality()
Destructor.
float recHitPositionError(const DTRecHit1DPair &recHit)
HRes1DHit * hRes_S3RZ_W2
float simHitDistFromWire(const DTLayer *layer, DTWireId wireId, const PSimHit &hit)
DTRecHitQuality(const edm::ParameterSet &pset)
Constructor.
HEff1DHit * hEff_S1RZ_W2
HEff1DHit * hEff_S3RZ_W1
HRes1DHit * hRes_S3RZWS[3][4]
HRes1DHit * hRes_S1RZ_W2
HRes1DHit * hRes_S2RPhi_W0
float recHitDistFromWire(const DTRecHit1DPair &hitPair, const DTLayer *layer)
HRes1DHit * hRes_S1RPhi
HRes1DHit * hRes_S2RPhi_W1
HEff1DHit * hEff_S3RPhiWS[3][4]
HRes1DHit * hRes_S2RZ_W1
std::map< DTWireId, std::vector< DTRecHit1DPair > > map1DRecHitsPerWire(const DTRecHitCollection *dt1DRecHitPairs)
A set of histograms of residuals and pulls for 1D RecHits.
Definition: Histograms.h:26
How EventSelector::AcceptEvent() decides whether to accept an event for output otherwise it is excluding the probing of A single or multiple positive and the trigger will pass if any such matching triggers are PASS or EXCEPTION[A criterion thatmatches no triggers at all is detected and causes a throw.] A single negative with an expectation of appropriate bit checking in the decision and the trigger will pass if any such matching triggers are FAIL or EXCEPTION A wildcarded negative criterion that matches more than one trigger in the trigger but the state exists so we define the behavior If all triggers are the negative crieriion will lead to accepting the event(this again matches the behavior of"!*"before the partial wildcard feature was incorporated).The per-event"cost"of each negative criterion with multiple relevant triggers is about the same as!*was in the past
float simHitImpactAngle(const DTLayer *layer, DTWireId wireId, const PSimHit &hit)
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
float simHitDistFromFE(const DTLayer *layer, DTWireId wireId, const PSimHit &hit)
HEff1DHit * hEff_S1RZ
HEff1DHit * hEff_S3RZWS[3][4]
HRes1DHit * hRes_S3RPhi
HEff1DHit * hEff_S2RPhi
HEff1DHit * hEff_S1RZ_W1
edm::InputTag segment4DLabel
HRes1DHit * hRes_S3RZ_W0
HRes1DHit * hRes_S3RZ_W1
HEff1DHit * hEff_S1RPhiWS[3][4]
HRes1DHit * hRes_S3RZ
HRes1DHit * hRes_S2RZ
edm::InputTag segment2DLabel
HRes1DHit * hRes_S2RZ_W2
HRes1DHit * hRes_S3RPhi_W1
HRes1DHit * hRes_S3RPhiWS[3][4]
HRes1DHit * hRes_S1RZ_W0
void endLuminosityBlock(edm::LuminosityBlock const &lumiSeg, edm::EventSetup const &c)