CMS 3D CMS Logo

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
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
40 #include <vector>
41 
42 namespace edm {
43  class ParameterSet;
44  class EventSetup;
45 } // namespace edm
46 
47 class TH1F;
48 class TH2F;
49 
50 typedef std::vector<std::vector<int> > intDVector;
51 typedef std::vector<TrackingRecHit *> RecHitVector;
52 
53 class MuonAlignmentAnalyzer : public edm::one::EDAnalyzer<edm::one::SharedResources> {
54 public:
57 
59  ~MuonAlignmentAnalyzer() override = default;
60 
61  // Operations
62 
63  void analyze(const edm::Event &event, const edm::EventSetup &eventSetup) override;
64  static void fillDescriptions(edm::ConfigurationDescriptions &descriptions);
65 
66  void beginJob() override;
67  void endJob() override;
68 
69 protected:
70 private:
76  intDVector *,
77  intDVector *,
79 
81 
82  // InputTags
85 
86  // Collections needed
89 
90  // To switch between real data and MC
92 
94 
95  // Histograms
96 
97  // hist kinematic range
99  // hist residual range
102  const double resPhiRange, resThetaRange;
104 
110 
111  //# muons per event
112  TH1F *hGBNmuons;
113  TH1F *hSANmuons;
114  TH1F *hSimNmuons;
121 
122  // # hits per track
123  TH1F *hGBNhits;
126  TH1F *hSANhits;
129 
130  // Chi2 of Track
131  TH1F *hGBChi2;
132  TH1F *hSAChi2;
137 
138  // Invariant mass for dimuons
139  TH1F *hGBInvM;
140  TH1F *hSAInvM;
141  TH1F *hSimInvM;
142  // Invariant Mass distributions in Barrel (eta<1.04) region
146  // Invariant Mass distributions in Endcap (eta>=1.04) region
150  // Invariant Mass distributions in Barrel-Endcap overlap region
151  // 1 muon barrel & 1 muon endcap
155 
156  // pT
157  TH1F *hSAPTRec;
158  TH1F *hGBPTRec;
159  TH1F *hSimPT;
166  TH2F *hGBPTvsEta;
167  TH2F *hGBPTvsPhi;
168  TH2F *hSAPTvsEta;
169  TH2F *hSAPTvsPhi;
170  TH2F *hSimPTvsEta;
171  TH2F *hSimPTvsPhi;
172 
173  // For reco efficiency calculations
175  TH2F *hSAPhivsEta;
176  TH2F *hGBPhivsEta;
177 
178  // pT resolution
179  TH1F *hSAPTres;
180  TH1F *hSAinvPTres;
181  TH1F *hGBPTres;
182  TH1F *hGBinvPTres;
187  //pT rec - pT gen
188  TH1F *hSAPTDiff;
189  TH1F *hGBPTDiff;
200 
201  // Vector of chambers Residuals
202  std::vector<TH1F *> unitsLocalX;
203  std::vector<TH1F *> unitsLocalPhi;
204  std::vector<TH1F *> unitsLocalTheta;
205  std::vector<TH1F *> unitsLocalY;
206  std::vector<TH1F *> unitsGlobalRPhi;
207  std::vector<TH1F *> unitsGlobalPhi;
208  std::vector<TH1F *> unitsGlobalTheta;
209  std::vector<TH1F *> unitsGlobalRZ;
210 
211  // DT & CSC Residuals
220  std::vector<TH1F *> hResidualLocalXDT_W;
221  std::vector<TH1F *> hResidualLocalPhiDT_W;
222  std::vector<TH1F *> hResidualLocalThetaDT_W;
223  std::vector<TH1F *> hResidualLocalYDT_W;
224  std::vector<TH1F *> hResidualLocalXCSC_ME;
225  std::vector<TH1F *> hResidualLocalPhiCSC_ME;
226  std::vector<TH1F *> hResidualLocalThetaCSC_ME;
227  std::vector<TH1F *> hResidualLocalYCSC_ME;
228  std::vector<TH1F *> hResidualLocalXDT_MB;
229  std::vector<TH1F *> hResidualLocalPhiDT_MB;
230  std::vector<TH1F *> hResidualLocalThetaDT_MB;
231  std::vector<TH1F *> hResidualLocalYDT_MB;
240  std::vector<TH1F *> hResidualGlobalRPhiDT_W;
241  std::vector<TH1F *> hResidualGlobalPhiDT_W;
242  std::vector<TH1F *> hResidualGlobalThetaDT_W;
243  std::vector<TH1F *> hResidualGlobalZDT_W;
244  std::vector<TH1F *> hResidualGlobalRPhiCSC_ME;
245  std::vector<TH1F *> hResidualGlobalPhiCSC_ME;
246  std::vector<TH1F *> hResidualGlobalThetaCSC_ME;
247  std::vector<TH1F *> hResidualGlobalRCSC_ME;
248  std::vector<TH1F *> hResidualGlobalRPhiDT_MB;
249  std::vector<TH1F *> hResidualGlobalPhiDT_MB;
250  std::vector<TH1F *> hResidualGlobalThetaDT_MB;
251  std::vector<TH1F *> hResidualGlobalZDT_MB;
252 
253  // Mean and RMS of residuals for DQM
270 
287 
288  std::vector<long> detectorCollection;
289 
290  // ESHandle<MagneticField> theMGField;
291 
293 
294  // Counters
299 };
300 #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::EDGetTokenT< reco::TrackCollection > staTrackToken_
const edm::ESGetToken< MagneticField, IdealMagneticFieldRecord > magFieldToken_
const std::string theDataType
const unsigned int min1DTrackRecHitSize
std::vector< TH1F * > hResidualLocalYCSC_ME
std::vector< TH1F * > hResidualLocalPhiCSC_ME
RecHitVector doMatching(const reco::Track &, const edm::Handle< DTRecSegment4DCollection > &, const edm::Handle< CSCSegmentCollection > &, intDVector *, intDVector *, const edm::ESHandle< GlobalTrackingGeometry > &)
const edm::InputTag theGLBMuonTag
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
const edm::InputTag theRecHits4DTagCSC
const edm::EDGetTokenT< DTRecSegment4DCollection > allDTSegmentToken_
std::vector< TH1F * > hResidualGlobalRPhiDT_W
std::vector< TH1F * > hResidualLocalThetaCSC_ME
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
const edm::InputTag theRecHits4DTagDT
std::vector< TH1F * > unitsGlobalRZ
std::vector< TH1F * > hResidualGlobalPhiCSC_ME
const edm::InputTag theSTAMuonTag
void analyze(const edm::Event &event, const edm::EventSetup &eventSetup) override
std::vector< TH1F * > hResidualGlobalPhiDT_W
std::vector< TH1F * > unitsLocalPhi
const edm::EDGetTokenT< edm::SimTrackContainer > simTrackToken_
const unsigned int min4DTrackSegmentSize
MuonAlignmentAnalyzer(const edm::ParameterSet &pset)
Constructor.
~MuonAlignmentAnalyzer() override=default
Destructor.
std::vector< TH1F * > hResidualGlobalThetaDT_MB
std::vector< TH1F * > unitsLocalY
std::vector< TH1F * > hResidualLocalPhiDT_W
std::vector< TH1F * > hResidualGlobalPhiDT_MB
std::vector< TH1F * > hResidualGlobalThetaCSC_ME
HLT enums.
const edm::EDGetTokenT< reco::TrackCollection > glbTrackToken_
std::vector< TH1F * > hResidualLocalXDT_MB
std::vector< TrackingRecHit * > RecHitVector
std::vector< TH1F * > hResidualGlobalRCSC_ME
const edm::EDGetTokenT< CSCSegmentCollection > allCSCSegmentToken_
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