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 
14 
16 
21 #include "Histograms.h"
26 
27 
28 #include <vector>
29 #include <map>
30 #include <string>
31 
32 namespace edm {
33  class ParameterSet;
34  class Event;
35  class EventSetup;
36 }
37 
38 class PSimHit;
39 class TFile;
40 class DTLayer;
41 class DTWireId;
42 class DTGeometry;
43 
45 public:
48 
50  virtual ~DTRecHitQuality();
51 
52  // Operations
53 
55  void analyze(const edm::Event & event, const edm::EventSetup& eventSetup);
56  // Write the histos to file
57 
58  void endJob();
59 void endLuminosityBlock(edm::LuminosityBlock const& lumiSeg,
60  edm::EventSetup const& c);
61 
62 protected:
63 
64 private:
65 
66 
67  // The file which will store the histos
68  //TFile *theFile;
69  // Switch for debug output
70  bool debug;
71  // Root file name
77 
78  // Switches for analysis at various steps
79  bool doStep1;
80  bool doStep2;
81  bool doStep3;
82  bool local;
83  // Return a map between DTRecHit1DPair and wireId
84  std::map<DTWireId, std::vector<DTRecHit1DPair> >
85  map1DRecHitsPerWire(const DTRecHitCollection* dt1DRecHitPairs);
86 
87  // Return a map between DTRecHit1D and wireId
88  std::map<DTWireId, std::vector<DTRecHit1D> >
90 
91  // Return a map between DTRecHit1D and wireId
92  std::map<DTWireId, std::vector<DTRecHit1D> >
94 
95  // Compute SimHit distance from wire (cm)
96  float simHitDistFromWire(const DTLayer* layer,
97  DTWireId wireId,
98  const PSimHit& hit);
99 
100  // Compute SimHit impact angle (in direction perp to wire)
101  float simHitImpactAngle(const DTLayer* layer,
102  DTWireId wireId,
103  const PSimHit& hit);
104 
105  // Compute SimHit distance from FrontEnd
106  float simHitDistFromFE(const DTLayer* layer,
107  DTWireId wireId,
108  const PSimHit& hit);
109 
110  // Find the RecHit closest to the muon SimHit
111 // const DTRecHit1DPair*
112 // findBestRecHit(const DTLayer* layer,
113 // DTWireId wireId,
114 // const std::vector<DTRecHit1DPair>& recHits,
115 // const float simHitDist);
116  template <typename type>
117  const type*
118  findBestRecHit(const DTLayer* layer,
119  DTWireId wireId,
120  const std::vector<type>& recHits,
121  const float simHitDist);
122 
123 
124 
125 
126  // Compute the distance from wire (cm) of a hits in a DTRecHit1DPair
127  float recHitDistFromWire(const DTRecHit1DPair& hitPair, const DTLayer* layer);
128  // Compute the distance from wire (cm) of a hits in a DTRecHit1D
129  float recHitDistFromWire(const DTRecHit1D& recHit, const DTLayer* layer);
130 
131  // Return the error on the measured (cm) coordinate
132  float recHitPositionError(const DTRecHit1DPair& recHit);
133  float recHitPositionError(const DTRecHit1D& recHit);
134 
135 
136  // Does the real job
137  template <typename type>
138  void compute(const DTGeometry *dtGeom,
139  std::map<DTWireId, std::vector<PSimHit> > simHitsPerWire,
140  std::map<DTWireId, std::vector<type> > recHitsPerWire,
141  int step);
142  //HRes1DHit * hRes_S1RPhi;
143  HRes1DHit *hRes_S1RPhi; // RecHits, 1. step, RPh
144  HRes1DHit *hRes_S2RPhi; // RecHits, 2. step, RPhi
145  HRes1DHit *hRes_S3RPhi; // RecHits, 3. step, RPhi
146 
147  HRes1DHit *hRes_S1RZ; // RecHits, 1. step, RZ
148  HRes1DHit *hRes_S2RZ; // RecHits, 2. step, RZ
149  HRes1DHit *hRes_S3RZ; // RecHits, 3. step, RZ
150 
151  HRes1DHit *hRes_S1RZ_W0; // RecHits, 1. step, RZ, wheel 0
152  HRes1DHit *hRes_S2RZ_W0; // RecHits, 2. step, RZ, wheel 0
153  HRes1DHit *hRes_S3RZ_W0; // RecHits, 3. step, RZ, wheel 0
154 
155  HRes1DHit *hRes_S1RZ_W1; // RecHits, 1. step, RZ, wheel +-1
156  HRes1DHit *hRes_S2RZ_W1; // RecHits, 2. step, RZ, wheel +-1
157  HRes1DHit *hRes_S3RZ_W1; // RecHits, 3. step, RZ, wheel +-1
158 
159  HRes1DHit *hRes_S1RZ_W2; // RecHits, 1. step, RZ, wheel +-2
160  HRes1DHit *hRes_S2RZ_W2; // RecHits, 2. step, RZ, wheel +-2
161  HRes1DHit *hRes_S3RZ_W2; // RecHits, 3. step, RZ, wheel +-2
162 
163  HRes1DHit *hRes_S1RPhi_W0; // RecHits, 1. step, RPhi, wheel 0
164  HRes1DHit *hRes_S2RPhi_W0; // RecHits, 2. step, RPhi, wheel 0
165  HRes1DHit *hRes_S3RPhi_W0; // RecHits, 3. step, RPhi, wheel 0
166 
167  HRes1DHit *hRes_S1RPhi_W1; // RecHits, 1. step, RPhi, wheel +-1
168  HRes1DHit *hRes_S2RPhi_W1; // RecHits, 2. step, RPhi, wheel +-1
169  HRes1DHit *hRes_S3RPhi_W1; // RecHits, 3. step, RPhi, wheel +-1
170 
171  HRes1DHit *hRes_S1RPhi_W2; // RecHits, 1. step, RPhi, wheel +-2
172  HRes1DHit *hRes_S2RPhi_W2; // RecHits, 2. step, RPhi, wheel +-2
173  HRes1DHit *hRes_S3RPhi_W2; // RecHits, 3. step, RPhi, wheel +-2
174 
175  HEff1DHit *hEff_S1RPhi; // RecHits, 1. step, RPhi
176  HEff1DHit *hEff_S2RPhi; // RecHits, 2. step, RPhi
177  HEff1DHit *hEff_S3RPhi; // RecHits, 3. step, RPhi
178 
179  HEff1DHit *hEff_S1RZ; // RecHits, 1. step, RZ
180  HEff1DHit *hEff_S2RZ; // RecHits, 2. step, RZ
181  HEff1DHit *hEff_S3RZ; // RecHits, 3. step, RZ
182 
183  HEff1DHit *hEff_S1RZ_W0; // RecHits, 1. step, RZ, wheel 0
184  HEff1DHit *hEff_S2RZ_W0; // RecHits, 2. step, RZ, wheel 0
185  HEff1DHit *hEff_S3RZ_W0; // RecHits, 3. step, RZ, wheel 0
186 
187  HEff1DHit *hEff_S1RZ_W1; // RecHits, 1. step, RZ, wheel +-1
188  HEff1DHit *hEff_S2RZ_W1; // RecHits, 2. step, RZ, wheel +-1
189  HEff1DHit *hEff_S3RZ_W1; // RecHits, 3. step, RZ, wheel +-1
190 
191  HEff1DHit *hEff_S1RZ_W2; // RecHits, 1. step, RZ, wheel +-2
192  HEff1DHit *hEff_S2RZ_W2; // RecHits, 2. step, RZ, wheel +-2
193  HEff1DHit *hEff_S3RZ_W2; // RecHits, 3. step, RZ, wheel +-2
195  bool doall;
196 };
197 #endif
198 
199 
200 
201 
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
const type * findBestRecHit(const DTLayer *layer, DTWireId wireId, const std::vector< type > &recHits, const float simHitDist)
void analyze(const edm::Event &event, const edm::EventSetup &eventSetup)
Perform the real analysis.
HRes1DHit * hRes_S1RPhi_W0
HRes1DHit * hRes_S1RZ
virtual ~DTRecHitQuality()
Destructor.
dictionary map
Definition: Association.py:205
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_S1RZ_W2
HRes1DHit * hRes_S2RPhi_W0
float recHitDistFromWire(const DTRecHit1DPair &hitPair, const DTLayer *layer)
HRes1DHit * hRes_S1RPhi
HRes1DHit * hRes_S2RPhi_W1
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:28
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
void compute(const DTGeometry *dtGeom, std::map< DTWireId, std::vector< PSimHit > > simHitsPerWire, std::map< DTWireId, std::vector< type > > recHitsPerWire, int step)
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
HRes1DHit * hRes_S3RPhi
HEff1DHit * hEff_S2RPhi
HEff1DHit * hEff_S1RZ_W1
edm::InputTag segment4DLabel
HRes1DHit * hRes_S3RZ_W0
HRes1DHit * hRes_S3RZ_W1
HRes1DHit * hRes_S3RZ
HRes1DHit * hRes_S2RZ
edm::InputTag segment2DLabel
HRes1DHit * hRes_S2RZ_W2
HRes1DHit * hRes_S3RPhi_W1
HRes1DHit * hRes_S1RZ_W0
void endLuminosityBlock(edm::LuminosityBlock const &lumiSeg, edm::EventSetup const &c)