CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros 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
37 
38 //Other include files
44 
47 
48 //----------------------------------------
49 
50 //Forward declarations
51 class TH1;
52 class TH1I;
53 class TH1D;
54 class TH2;
55 class TProfile;
56 
57 //------------------------------------------
58 // Class Declaration: MuonIsolationDQM
59 //--------------------------------------
61  //---------namespace and typedefs--------------
66 
67 public:
68  //---------methods----------------------------
69  explicit MuonIsolationDQM(const edm::ParameterSet&);
71 
72  void analyze(const edm::Event&, const edm::EventSetup&);
73  void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override;
74 
75 private:
76  //---------methods----------------------------
77  void InitStatics();
78  void RecordData(const reco::Muon& muon);//Fills Histograms with info from single muo
79  // void doPFIsoPlots(MuonIterator muon); //Fills Histograms with PF info from single muo (only for GLB)
80  void InitHistos();//adds title, bin information to member histograms
81  void FillHistos(int);//Fills histograms with data
82  void FillNVtxHistos(int);
83  void NormalizeHistos(); //Normalize to number of muons
84 
85  //----- helper methods
86  int GetNVtxBin(int);
88 
89  //----------Static Variables---------------
90 
91  //Collection labels
94 
95  //root file name
97  // Directories within the rootfile
99 
100  //Histogram parameters
101  static const int NUM_VARS = 48; // looking at R03 and R05. Total of 54 histos.
102  static const int NUM_VARS_2D = 10; // looking only at R03. Total of 8 TH2F.
103  static const int NUM_VARS_NVTX = 6 ;
104 
105  double L_BIN_WIDTH;//large bins
106  double S_BIN_WIDTH;//small bins
107  int LOG_BINNING_ENABLED;//pseudo log binning for profile plots
113 
116  // std::string title_cd;
117 
118  std::vector<std::string> main_titles;//[NUM_VARS]
119  std::vector<std::string> axis_titles;//[NUM_VARS]
120  std::vector<std::string> names;//[NUM_VARS]
121  std::vector< std::vector<double> > param;//[NUM_VARS][3]
122  std::vector<int> isContinuous;//[NUM_VARS]
123 
124  std::vector<std::string> titles_2D; //[NUM_VARS]
125  std::vector<std::string> names_2D; //[NUM_VARS]
126 
127  std::vector<std::string> main_titles_NVtxs;
128  std::vector<std::string> names_NVtxs;
129  std::vector<std::string> axis_titles_NVtxs;
130  //---------------Dynamic Variables---------------------
131 
132  //The Data
133  double theData[NUM_VARS];
136 
137  //Histograms
139  std::vector<MonitorElement*> h_1D; //[NUM_VARS]
140  std::vector<MonitorElement*> h_2D; //[NUM_VARS_2D]
141  std::vector<MonitorElement*> h_1D_NVTX;//[NUM_VARS_NVTX]
142 
143  // std::vector<MonitorElement*> cd_plots;//[NUM_VARS]
144 
145  //Counters
146  int nEvents;
150 
151  //enums for monitorElement
153 };
154 
std::vector< MonitorElement * > h_2D
static const int NUM_VARS_NVTX
std::string dirName
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< std::vector< double > > param
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)
void analyze(const edm::Event &, const edm::EventSetup &)
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]
static const int NUM_VARS
boost::indirect_iterator< typename seq_t::const_iterator > const_iterator
Definition: View.h:81
edm::RefToBase< reco::Muon > MuonBaseRef
edm::EDGetTokenT< reco::MuonCollection > theMuonCollectionLabel_
double theData[NUM_VARS]
double theData2D[NUM_VARS_2D]
edm::EDGetTokenT< reco::VertexCollection > theVertexCollectionLabel_
Definition: Run.h:43
std::vector< std::string > main_titles_NVtxs
TH1 * GetTH1FromMonitorElement(MonitorElement *me)