CMS 3D CMS Logo

MuonAlignmentAnalyzer.h
Go to the documentation of this file.
1 #ifndef Alignment_OfflineValidation_MuonAlignmentAnalyzer_H
2 #define Alignment_OfflineValidation_MuonAlignmentAnalyzer_H
3 
15 // Base Class Headers
29 #include <vector>
30 
31 namespace edm {
32  class ParameterSet;
33  class EventSetup;
34 } // namespace edm
35 
36 class TH1F;
37 class TH2F;
38 
39 typedef std::vector<std::vector<int> > intDVector;
40 typedef std::vector<TrackingRecHit *> RecHitVector;
41 
42 class MuonAlignmentAnalyzer : public edm::one::EDAnalyzer<edm::one::SharedResources> {
43 public:
46 
48  ~MuonAlignmentAnalyzer() override;
49 
50  // Operations
51 
52  void analyze(const edm::Event &event, const edm::EventSetup &eventSetup) override;
53 
54  void beginJob() override;
55  void endJob() override;
56 
57 protected:
58 private:
64  intDVector *,
65  intDVector *,
67 
69 
70  // InputTags
73 
74  // Collections needed
77 
78  // To switch between real data and MC
80 
82 
83  // Histograms
84 
85  //# muons per event
86  TH1F *hGBNmuons;
87  TH1F *hSANmuons;
88  TH1F *hSimNmuons;
95 
96  // # hits per track
97  TH1F *hGBNhits;
100  TH1F *hSANhits;
103 
104  // Chi2 of Track
105  TH1F *hGBChi2;
106  TH1F *hSAChi2;
111 
112  // Invariant mass for dimuons
113  TH1F *hGBInvM;
114  TH1F *hSAInvM;
115  TH1F *hSimInvM;
116  // Invariant Mass distributions in Barrel (eta<1.04) region
120  // Invariant Mass distributions in Endcap (eta>=1.04) region
124  // Invariant Mass distributions in Barrel-Endcap overlap region
125  // 1 muon barrel & 1 muon endcap
129 
130  // pT
131  TH1F *hSAPTRec;
132  TH1F *hGBPTRec;
133  TH1F *hSimPT;
140  TH2F *hGBPTvsEta;
141  TH2F *hGBPTvsPhi;
142  TH2F *hSAPTvsEta;
143  TH2F *hSAPTvsPhi;
144  TH2F *hSimPTvsEta;
145  TH2F *hSimPTvsPhi;
146 
147  // For reco efficiency calculations
149  TH2F *hSAPhivsEta;
150  TH2F *hGBPhivsEta;
151 
152  // pT resolution
153  TH1F *hSAPTres;
154  TH1F *hSAinvPTres;
155  TH1F *hGBPTres;
156  TH1F *hGBinvPTres;
161  //pT rec - pT gen
162  TH1F *hSAPTDiff;
163  TH1F *hGBPTDiff;
174 
175  // Vector of chambers Residuals
176  std::vector<TH1F *> unitsLocalX;
177  std::vector<TH1F *> unitsLocalPhi;
178  std::vector<TH1F *> unitsLocalTheta;
179  std::vector<TH1F *> unitsLocalY;
180  std::vector<TH1F *> unitsGlobalRPhi;
181  std::vector<TH1F *> unitsGlobalPhi;
182  std::vector<TH1F *> unitsGlobalTheta;
183  std::vector<TH1F *> unitsGlobalRZ;
184 
185  // DT & CSC Residuals
194  std::vector<TH1F *> hResidualLocalXDT_W;
195  std::vector<TH1F *> hResidualLocalPhiDT_W;
196  std::vector<TH1F *> hResidualLocalThetaDT_W;
197  std::vector<TH1F *> hResidualLocalYDT_W;
198  std::vector<TH1F *> hResidualLocalXCSC_ME;
199  std::vector<TH1F *> hResidualLocalPhiCSC_ME;
200  std::vector<TH1F *> hResidualLocalThetaCSC_ME;
201  std::vector<TH1F *> hResidualLocalYCSC_ME;
202  std::vector<TH1F *> hResidualLocalXDT_MB;
203  std::vector<TH1F *> hResidualLocalPhiDT_MB;
204  std::vector<TH1F *> hResidualLocalThetaDT_MB;
205  std::vector<TH1F *> hResidualLocalYDT_MB;
214  std::vector<TH1F *> hResidualGlobalRPhiDT_W;
215  std::vector<TH1F *> hResidualGlobalPhiDT_W;
216  std::vector<TH1F *> hResidualGlobalThetaDT_W;
217  std::vector<TH1F *> hResidualGlobalZDT_W;
218  std::vector<TH1F *> hResidualGlobalRPhiCSC_ME;
219  std::vector<TH1F *> hResidualGlobalPhiCSC_ME;
220  std::vector<TH1F *> hResidualGlobalThetaCSC_ME;
221  std::vector<TH1F *> hResidualGlobalRCSC_ME;
222  std::vector<TH1F *> hResidualGlobalRPhiDT_MB;
223  std::vector<TH1F *> hResidualGlobalPhiDT_MB;
224  std::vector<TH1F *> hResidualGlobalThetaDT_MB;
225  std::vector<TH1F *> hResidualGlobalZDT_MB;
226 
227  // Mean and RMS of residuals for DQM
244 
261 
262  std::vector<long> detectorCollection;
263 
264  // ESHandle<MagneticField> theMGField;
265 
267 
268  // Counters
273 
274  // hist kinematic range
276  // hist residual range
281 };
282 #endif
std::vector< TH1F * > hResidualGlobalRPhiDT_MB
std::vector< TH1F * > hResidualGlobalZDT_W
std::vector< TH1F * > hResidualLocalXCSC_ME
std::vector< TH1F * > hResidualLocalThetaDT_MB
std::vector< std::vector< int > > intDVector
std::vector< TH1F * > unitsGlobalPhi
const edm::ESGetToken< MagneticField, IdealMagneticFieldRecord > magFieldToken_
RecHitVector doMatching(const reco::Track &, edm::Handle< DTRecSegment4DCollection > &, edm::Handle< CSCSegmentCollection > &, intDVector *, intDVector *, edm::ESHandle< GlobalTrackingGeometry > &)
std::vector< TH1F * > hResidualLocalYCSC_ME
std::vector< TH1F * > hResidualLocalPhiCSC_ME
std::vector< TH1F * > hResidualGlobalRPhiCSC_ME
std::vector< TH1F * > hResidualLocalPhiDT_MB
edm::Service< TFileService > fs
std::vector< TH1F * > unitsGlobalRPhi
std::vector< TH1F * > hResidualLocalThetaDT_W
std::vector< TH1F * > hResidualGlobalZDT_MB
std::vector< TH1F * > unitsLocalX
const edm::ESGetToken< GlobalTrackingGeometry, GlobalTrackingGeometryRecord > trackingGeometryToken_
std::vector< TH1F * > hResidualGlobalThetaDT_W
std::vector< TH1F * > unitsLocalTheta
std::vector< TH1F * > hResidualGlobalRPhiDT_W
std::vector< TH1F * > hResidualLocalThetaCSC_ME
std::vector< TH1F * > unitsGlobalRZ
std::vector< TH1F * > hResidualGlobalPhiCSC_ME
void analyze(const edm::Event &event, const edm::EventSetup &eventSetup) override
std::vector< TH1F * > hResidualGlobalPhiDT_W
std::vector< TH1F * > unitsLocalPhi
MuonAlignmentAnalyzer(const edm::ParameterSet &pset)
Constructor.
std::vector< TH1F * > hResidualGlobalThetaDT_MB
std::vector< TH1F * > unitsLocalY
std::vector< TH1F * > hResidualLocalPhiDT_W
std::vector< TH1F * > hResidualGlobalPhiDT_MB
std::vector< TH1F * > hResidualGlobalThetaCSC_ME
~MuonAlignmentAnalyzer() override
Destructor.
HLT enums.
std::vector< TH1F * > hResidualLocalXDT_MB
std::vector< TrackingRecHit * > RecHitVector
std::vector< TH1F * > hResidualGlobalRCSC_ME
std::vector< TH1F * > hResidualLocalYDT_W
std::vector< long > detectorCollection
std::vector< TH1F * > unitsGlobalTheta
std::vector< TH1F * > hResidualLocalXDT_W
std::vector< TH1F * > hResidualLocalYDT_MB
Definition: event.py:1