CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
MuonIsolationDQM.h
Go to the documentation of this file.
1 // -*- C++ -*-
2 // MuonIsolationDQM.h
3 // Package: Muon Isolation DQM
4 // Class: MuonIsolationDQM
5 //
6 /*
7 
8 Description: Muon Isolation DQM class
9 
10 NOTE: The static member variable declarations *should* include the key word "static", but
11 I haven't found an elegant way to initalize the vectors. Static primatives (e.g. int,
12 float, ...) and simple static objects are easy to initialze. Outside of the class
13 decleration, you would write
14 
15 int MuonIsolationDQM::CONST_INT = 5;
16 FooType MuonIsolationDQM::CONST_FOOT = Foo(constructor_argument);
17 
18 but you can't do this if you want to, say, initalize a std::vector with a bunch of
19 different values. So, you can't make them static and you have to initialize them using
20 a member method. To keep it consistent, I've just initialized them all in the same
21 method, even the simple types.
22 */
23 
24 //
25 // Original Author: "C. Jess Riedel", UC Santa Barbara
26 // Created: Tue Jul 17 15:58:24 CDT 2007
27 //
28 
29 //Base class
31 
32 //Member types
36 
37 //Other include files
43 
46 
47 //----------------------------------------
48 
49 //Forward declarations
50 class TH1;
51 class TH1I;
52 class TH1D;
53 class TH2;
54 class TProfile;
55 
56 //------------------------------------------
57 // Class Declaration: MuonIsolationDQM
58 //--------------------------------------
60  //---------namespace and typedefs--------------
65 
66 public:
67  //---------methods----------------------------
68  explicit MuonIsolationDQM(const edm::ParameterSet&);
69  ~MuonIsolationDQM() override;
70 
71  void analyze(const edm::Event&, const edm::EventSetup&) override;
72  void bookHistograms(DQMStore::IBooker&, edm::Run const&, edm::EventSetup const&) override;
73 
74 private:
75  //---------methods----------------------------
76  void InitStatics();
77  void RecordData(const reco::Muon& muon); //Fills Histograms with info from single muo
78  // void doPFIsoPlots(MuonIterator muon); //Fills Histograms with PF info from single muo (only for GLB)
79  void InitHistos(); //adds title, bin information to member histograms
80  void FillHistos(int); //Fills histograms with data
81  void FillNVtxHistos(int);
82  void NormalizeHistos(); //Normalize to number of muons
83 
84  //----- helper methods
85  int GetNVtxBin(int);
87 
88  //----------Static Variables---------------
89 
90  int vtxBin_;
91  double vtxMin_;
92  double vtxMax_;
93 
94  //Collection labels
97 
98  //root file name
100  // Directories within the rootfile
102 
103  //Histogram parameters
104  static const int NUM_VARS = 48; // looking at R03 and R05. Total of 54 histos.
105  static const int NUM_VARS_2D = 10; // looking only at R03. Total of 8 TH2F.
106  static const int NUM_VARS_NVTX = 6;
107 
108  double L_BIN_WIDTH; //large bins
109  double S_BIN_WIDTH; //small bins
110  int LOG_BINNING_ENABLED; //pseudo log binning for profile plots
116 
119  // std::string title_cd;
120 
121  std::vector<std::string> main_titles; //[NUM_VARS]
122  std::vector<std::string> axis_titles; //[NUM_VARS]
123  std::vector<std::string> names; //[NUM_VARS]
124  std::vector<std::vector<double> > param; //[NUM_VARS][3]
125  std::vector<int> isContinuous; //[NUM_VARS]
126 
127  std::vector<std::string> titles_2D; //[NUM_VARS]
128  std::vector<std::string> names_2D; //[NUM_VARS]
129 
130  std::vector<std::string> main_titles_NVtxs;
131  std::vector<std::string> names_NVtxs;
132  std::vector<std::string> axis_titles_NVtxs;
133  //---------------Dynamic Variables---------------------
134 
135  //The Data
136  double theData[NUM_VARS];
139 
140  //Histograms
142  std::vector<MonitorElement*> h_1D; //[NUM_VARS]
143  std::vector<MonitorElement*> h_2D; //[NUM_VARS_2D]
144  std::vector<MonitorElement*> h_1D_NVTX; //[NUM_VARS_NVTX]
145 
146  // std::vector<MonitorElement*> cd_plots;//[NUM_VARS]
147 
148  //Counters
149  int nEvents;
153 
154  //enums for monitorElement
155  enum { NOAXIS, XAXIS, YAXIS, ZAXIS };
156 };
std::vector< MonitorElement * > h_2D
static const int NUM_VARS_NVTX
const reco::IsoDeposit MuIsoDepRef
MonitorElement * h_nMuons
MuonIsolationDQM(const edm::ParameterSet &)
std::vector< MonitorElement * > h_1D
std::vector< std::string > main_titles
edm::View< reco::Muon >::const_iterator MuonIterator
std::vector< std::string > names
std::vector< std::string > names_2D
std::vector< MonitorElement * > h_1D_NVTX
void RecordData(const reco::Muon &muon)
static const int NUM_VARS_2D
std::string title_sam
std::vector< std::string > names_NVtxs
std::string title_cone
std::vector< int > isContinuous
int GetNVtxBin(int)
~MuonIsolationDQM() override
void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
std::string rootfilename
std::vector< std::string > titles_2D
std::vector< std::string > axis_titles
std::vector< std::string > axis_titles_NVtxs
edm::Handle< reco::IsoDepositMap > MuIsoDepHandle
double theDataNVtx[NUM_VARS_NVTX]
std::vector< std::vector< double > > param
static const int NUM_VARS
boost::indirect_iterator< typename seq_t::const_iterator > const_iterator
Definition: View.h:86
edm::RefToBase< reco::Muon > MuonBaseRef
double theData[NUM_VARS]
double theData2D[NUM_VARS_2D]
edm::EDGetTokenT< reco::VertexCollection > theVertexCollectionLabel_
Definition: Run.h:45
std::vector< std::string > main_titles_NVtxs
edm::EDGetTokenT< edm::View< reco::Muon > > theMuonCollectionLabel_
TH1 * GetTH1FromMonitorElement(MonitorElement *me)
void analyze(const edm::Event &, const edm::EventSetup &) override