CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
MuIsoValidation.h
Go to the documentation of this file.
1 // -*- C++ -*-
2 // MuIsoValidation.h
3 // Package: Muon Isolation Validation
4 // Class: MuIsoValidation
5 //
6 /*
7 
8  Description: Muon Isolation Validation class
9 
10  NOTE: The static member variable declerations *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 MuIsoValidation::CONST_INT = 5;
16  FooType MuIsoValidation::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
43 
44 //----------------------------------------
45 
46 //Forward declarations
47 class TH1;
48 class TH1I;
49 class TH1D;
50 class TH2;
51 class TProfile;
52 
53 //------------------------------------------
54 // Class Declaration: MuIsoValidation
55 //--------------------------------------
57  //---------namespace and typedefs--------------
62 
63 public:
64  //---------methods----------------------------
65  explicit MuIsoValidation(const edm::ParameterSet&);
67 
68 
69 private:
70  //---------methods----------------------------
71  virtual void beginJob() ;
72  virtual void analyze(const edm::Event&, const edm::EventSetup&);
73  virtual void endJob() ;
74  void InitStatics();
75  void RecordData(MuonIterator muon);//Fills Histograms with info from single muon
76  void InitHistos();//adds title, bin information to member histograms
77  void MakeLogBinsForProfile(Double_t* bin_edges, const double min, const double max);
78  void FillHistos();//Fills histograms with data
79  void NormalizeHistos(); //Normalize to number of muons
83 
84 
85  //----------Static Variables---------------
86 
87  //Collection labels
93 
94  //root file name
95  std::string rootfilename;
96  // Directories within the rootfile
97  std::string dirName;
98  std::string subDirName;
99 
100  //Histogram parameters
101  static const int NUM_VARS = 21;
102  double L_BIN_WIDTH;//large bins
103  double S_BIN_WIDTH;//small bins
104  int LOG_BINNING_ENABLED;//pseudo log binning for profile plots
108 
109  std::string title_sam;
110  std::string title_cone;
111  std::string title_cd;
112 
113  std::vector<std::string> main_titles;//[NUM_VARS]
114  std::vector<std::string> axis_titles;//[NUM_VARS]
115  std::vector<std::string> names;//[NUM_VARS]
116  std::vector< std::vector<double> > param;//[NUM_VARS][3]
117  std::vector<int> isContinuous;//[NUM_VARS]
118  std::vector<int> cdCompNeeded;//[NUM_VARS]
119 
120  //---------------Dynamic Variables---------------------
121 
122  //MonitorElement
124 
125  //The Data
126  int theMuonData;//[number of muons]
127  double theData[NUM_VARS];
128 
129  //Histograms
131  std::vector<MonitorElement*> h_1D;//[NUM_VARS]
132  std::vector<MonitorElement*> cd_plots;//[NUM_VARS]
133  // std::vector< std::vector<MonitorElement*> > h_2D;//[NUM_VARS][NUM_VARS]
134  std::vector< std::vector<MonitorElement*> > p_2D;//[NUM_VARS][NUM_VARS]
135 
136  //Counters
137  int nEvents;
139  // int nCombinedMuons;
140 
141  //enums for monitorElement
143 };
144 
void RecordData(MuonIterator muon)
edm::InputTag ecalIsoDeposit_Tag
boost::indirect_iterator< typename seq_t::const_iterator > const_iterator
Definition: View.h:81
std::vector< int > isContinuous
TH1 * GetTH1FromMonitorElement(MonitorElement *me)
std::vector< std::vector< MonitorElement * > > p_2D
std::vector< std::string > names
std::string title_cd
edm::View< reco::Muon >::const_iterator MuonIterator
std::vector< std::string > main_titles
TH2 * GetTH2FromMonitorElement(MonitorElement *me)
double theData[NUM_VARS]
edm::InputTag hcalIsoDeposit_Tag
virtual void beginJob()
edm::InputTag tkIsoDeposit_Tag
MuIsoValidation(const edm::ParameterSet &)
#define min(a, b)
Definition: mlp_lapack.h:161
const reco::IsoDeposit MuIsoDepRef
std::vector< MonitorElement * > h_1D
TProfile * GetTProfileFromMonitorElement(MonitorElement *me)
edm::InputTag hoIsoDeposit_Tag
MonitorElement * h_nMuons
virtual void analyze(const edm::Event &, const edm::EventSetup &)
std::string title_sam
const T & max(const T &a, const T &b)
edm::RefToBase< reco::Muon > MuonBaseRef
std::vector< MonitorElement * > cd_plots
std::string dirName
std::string title_cone
std::string rootfilename
static const int NUM_VARS
std::vector< std::vector< double > > param
edm::Handle< reco::IsoDepositMap > MuIsoDepHandle
void MakeLogBinsForProfile(Double_t *bin_edges, const double min, const double max)
std::vector< std::string > axis_titles
edm::InputTag Muon_Tag
virtual void endJob()
std::vector< int > cdCompNeeded
std::string subDirName