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 
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> >
103 
104  // Return a map between DTRecHit1D and wireId
105  std::map<DTWireId, std::vector<DTRecHit1D> >
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_
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.
edm::EDGetTokenT< DTRecSegment4DCollection > segment4DToken_
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)
edm::EDGetTokenT< DTRecSegment2DCollection > segment2DToken_
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]
virtual void beginRun(const edm::Run &iRun, const edm::EventSetup &setup)
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]
void setup(std::vector< TH2F > &depth, std::string name, std::string units="")
edm::EDGetTokenT< edm::PSimHitContainer > simHitToken_
HRes1DHit * hRes_S1RZ_W0
Definition: Run.h:43
void endLuminosityBlock(edm::LuminosityBlock const &lumiSeg, edm::EventSetup const &c)