Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:09:05

0001 #ifndef TrackSplittingMonitor_H
0002 #define TrackSplittingMonitor_H
0003 // -*- C++ -*-
0004 //
0005 // Package:    TrackSplittingMonitor
0006 // Class:      TrackSplittingMonitor
0007 //
0008 /**\class TrackSplittingMonitor TrackSplittingMonitor.cc DQM/TrackingMonitor/src/TrackSplittingMonitor.cc
0009  Monitoring source for general quantities related to tracks.
0010  */
0011 // Original Author:  Nhan Tran
0012 //         Created:  Thu 28 22:45:30 CEST 2008
0013 
0014 #include <fstream>
0015 #include <memory>
0016 #include "DQMServices/Core/interface/DQMEDAnalyzer.h"
0017 #include "DQMServices/Core/interface/DQMStore.h"
0018 #include "FWCore/Framework/interface/ESHandle.h"
0019 #include "FWCore/Framework/interface/Event.h"
0020 #include "FWCore/Framework/interface/Frameworkfwd.h"
0021 #include "FWCore/Framework/interface/MakerMacros.h"
0022 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0023 #include "FWCore/ServiceRegistry/interface/Service.h"
0024 #include "FWCore/Utilities/interface/EDGetToken.h"
0025 #include "Geometry/CSCGeometry/interface/CSCGeometry.h"
0026 #include "Geometry/DTGeometry/interface/DTGeometry.h"
0027 #include "Geometry/RPCGeometry/interface/RPCGeometry.h"
0028 #include "Geometry/Records/interface/MuonGeometryRecord.h"
0029 #include "Geometry/Records/interface/TrackerDigiGeometryRecord.h"
0030 #include "Geometry/TrackerGeometryBuilder/interface/TrackerGeometry.h"
0031 #include "MagneticField/Engine/interface/MagneticField.h"
0032 #include "MagneticField/Records/interface/IdealMagneticFieldRecord.h"
0033 #include "TrackingTools/TransientTrackingRecHit/interface/TransientTrackingRecHitBuilder.h"
0034 
0035 class TProfile;
0036 
0037 #include "DataFormats/MuonReco/interface/Muon.h"
0038 #include "DataFormats/MuonReco/interface/MuonFwd.h"
0039 
0040 class TrackSplittingMonitor : public DQMEDAnalyzer {
0041 public:
0042   explicit TrackSplittingMonitor(const edm::ParameterSet&);
0043   ~TrackSplittingMonitor() override = default;
0044 
0045   void analyze(const edm::Event&, const edm::EventSetup&) override;
0046   void bookHistograms(DQMStore::IBooker&, edm::Run const&, edm::EventSetup const&) override;
0047   static void fillDescriptions(edm::ConfigurationDescriptions& descriptions);
0048 
0049 private:
0050   void doProfileX(TH2* th2, MonitorElement* me);
0051   void doProfileX(MonitorElement* th2m, MonitorElement* me);
0052 
0053   // ----------member data ---------------------------
0054   static constexpr double cmToUm = 10.e4;
0055   static constexpr double radToUrad = 10.e3;
0056   static constexpr double sqrt2 = 1.41421356237;
0057 
0058   std::string histname;  //for naming the histograms according to algorithm used
0059   edm::ParameterSet conf_;
0060 
0061   const edm::ESGetToken<MagneticField, IdealMagneticFieldRecord> mfToken_;
0062   const edm::ESGetToken<TrackerGeometry, TrackerDigiGeometryRecord> tkGeomToken_;
0063   const edm::ESGetToken<DTGeometry, MuonGeometryRecord> dtGeomToken_;
0064   const edm::ESGetToken<CSCGeometry, MuonGeometryRecord> cscGeomToken_;
0065   const edm::ESGetToken<RPCGeometry, MuonGeometryRecord> rpcGeomToken_;
0066 
0067   const TrackerGeometry* theGeometry;
0068   const MagneticField* theMagField;
0069   const DTGeometry* dtGeometry;
0070   const CSCGeometry* cscGeometry;
0071   const RPCGeometry* rpcGeometry;
0072 
0073   const edm::EDGetTokenT<std::vector<reco::Track> > splitTracksToken_;
0074   const edm::EDGetTokenT<std::vector<reco::Muon> > splitMuonsToken_;
0075 
0076   const bool plotMuons_;
0077   const int pixelHitsPerLeg_;
0078   const int totalHitsPerLeg_;
0079   const double d0Cut_;
0080   const double dzCut_;
0081   const double ptCut_;
0082   const double norchiCut_;
0083 
0084   // histograms
0085   MonitorElement* ddxyAbsoluteResiduals_tracker_;
0086   MonitorElement* ddzAbsoluteResiduals_tracker_;
0087   MonitorElement* dphiAbsoluteResiduals_tracker_;
0088   MonitorElement* dthetaAbsoluteResiduals_tracker_;
0089   MonitorElement* dptAbsoluteResiduals_tracker_;
0090   MonitorElement* dcurvAbsoluteResiduals_tracker_;
0091 
0092   MonitorElement* ddxyNormalizedResiduals_tracker_;
0093   MonitorElement* ddzNormalizedResiduals_tracker_;
0094   MonitorElement* dphiNormalizedResiduals_tracker_;
0095   MonitorElement* dthetaNormalizedResiduals_tracker_;
0096   MonitorElement* dptNormalizedResiduals_tracker_;
0097   MonitorElement* dcurvNormalizedResiduals_tracker_;
0098 
0099   MonitorElement* ddxyAbsoluteResiduals_global_;
0100   MonitorElement* ddzAbsoluteResiduals_global_;
0101   MonitorElement* dphiAbsoluteResiduals_global_;
0102   MonitorElement* dthetaAbsoluteResiduals_global_;
0103   MonitorElement* dptAbsoluteResiduals_global_;
0104   MonitorElement* dcurvAbsoluteResiduals_global_;
0105 
0106   MonitorElement* ddxyNormalizedResiduals_global_;
0107   MonitorElement* ddzNormalizedResiduals_global_;
0108   MonitorElement* dphiNormalizedResiduals_global_;
0109   MonitorElement* dthetaNormalizedResiduals_global_;
0110   MonitorElement* dptNormalizedResiduals_global_;
0111   MonitorElement* dcurvNormalizedResiduals_global_;
0112 };
0113 #endif