File indexing completed on 2024-04-06 12:09:38
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025
0026
0027
0028
0029
0030 #include "DQMServices/Core/interface/DQMEDAnalyzer.h"
0031
0032
0033 #include "FWCore/Utilities/interface/InputTag.h"
0034 #include "DQMServices/Core/interface/DQMStore.h"
0035 #include "FWCore/ServiceRegistry/interface/Service.h"
0036
0037
0038 #include "DataFormats/MuonReco/interface/Muon.h"
0039 #include "DataFormats/MuonReco/interface/MuonFwd.h"
0040 #include "DataFormats/RecoCandidate/interface/IsoDeposit.h"
0041 #include "DataFormats/RecoCandidate/interface/IsoDepositFwd.h"
0042 #include "DataFormats/TrackReco/interface/Track.h"
0043
0044 #include "DataFormats/VertexReco/interface/Vertex.h"
0045 #include "DataFormats/VertexReco/interface/VertexFwd.h"
0046
0047
0048
0049
0050 class TH1;
0051 class TH1I;
0052 class TH1D;
0053 class TH2;
0054 class TProfile;
0055
0056
0057
0058
0059 class MuonIsolationDQM : public DQMEDAnalyzer {
0060
0061 typedef edm::View<reco::Muon>::const_iterator MuonIterator;
0062 typedef edm::RefToBase<reco::Muon> MuonBaseRef;
0063 typedef edm::Handle<reco::IsoDepositMap> MuIsoDepHandle;
0064 typedef const reco::IsoDeposit MuIsoDepRef;
0065
0066 public:
0067
0068 explicit MuonIsolationDQM(const edm::ParameterSet&);
0069 ~MuonIsolationDQM() override;
0070
0071 void analyze(const edm::Event&, const edm::EventSetup&) override;
0072 void bookHistograms(DQMStore::IBooker&, edm::Run const&, edm::EventSetup const&) override;
0073
0074 private:
0075
0076 void InitStatics();
0077 void RecordData(const reco::Muon& muon);
0078
0079 void InitHistos();
0080 void FillHistos(int);
0081 void FillNVtxHistos(int);
0082 void NormalizeHistos();
0083
0084
0085 int GetNVtxBin(int);
0086 TH1* GetTH1FromMonitorElement(MonitorElement* me);
0087
0088
0089
0090 int vtxBin_;
0091 double vtxMin_;
0092 double vtxMax_;
0093
0094
0095 edm::EDGetTokenT<reco::VertexCollection> theVertexCollectionLabel_;
0096 edm::EDGetTokenT<edm::View<reco::Muon> > theMuonCollectionLabel_;
0097
0098
0099 std::string rootfilename;
0100
0101 std::string dirName;
0102
0103
0104 static const int NUM_VARS = 48;
0105 static const int NUM_VARS_2D = 10;
0106 static const int NUM_VARS_NVTX = 6;
0107
0108 double L_BIN_WIDTH;
0109 double S_BIN_WIDTH;
0110 int LOG_BINNING_ENABLED;
0111 int NUM_LOG_BINS;
0112 double LOG_BINNING_RATIO;
0113 bool requireGLBMuon;
0114 bool requireSTAMuon;
0115 bool requireTRKMuon;
0116
0117 std::string title_sam;
0118 std::string title_cone;
0119
0120
0121 std::vector<std::string> main_titles;
0122 std::vector<std::string> axis_titles;
0123 std::vector<std::string> names;
0124 std::vector<std::vector<double> > param;
0125 std::vector<int> isContinuous;
0126
0127 std::vector<std::string> titles_2D;
0128 std::vector<std::string> names_2D;
0129
0130 std::vector<std::string> main_titles_NVtxs;
0131 std::vector<std::string> names_NVtxs;
0132 std::vector<std::string> axis_titles_NVtxs;
0133
0134
0135
0136 double theData[NUM_VARS];
0137 double theData2D[NUM_VARS_2D];
0138 double theDataNVtx[NUM_VARS_NVTX];
0139
0140
0141 MonitorElement* h_nMuons;
0142 std::vector<MonitorElement*> h_1D;
0143 std::vector<MonitorElement*> h_2D;
0144 std::vector<MonitorElement*> h_1D_NVTX;
0145
0146
0147
0148
0149 int nEvents;
0150 int nSTAMuons;
0151 int nGLBMuons;
0152 int nTRKMuons;
0153
0154
0155 enum { NOAXIS, XAXIS, YAXIS, ZAXIS };
0156 };