CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
EnergyScaleAnalyzer.h
Go to the documentation of this file.
1 #ifndef RecoEcal_EgammaClusterProducers_EnergyScaleAnalyzer_h
2 #define RecoEcal_EgammaClusterProducers_EnergyScaleAnalyzer_h
3 
10 //
11 //
12 
13 
14 // system include files
15 #include <memory>
16 
17 // user include files
20 
26 
36 
37 #include <string>
38 #include "TH1.h"
39 #include "TH2.h"
40 #include "TTree.h"
41 #include "TNtuple.h"
42 class TFile;
43 
44 //
45 // class declaration
46 //
47 
49  public:
50  explicit EnergyScaleAnalyzer( const edm::ParameterSet& );
52 
53 
54  virtual void analyze( const edm::Event&, const edm::EventSetup& );
55  virtual void beginJob();
56  virtual void endJob();
57 
58 
59  private:
60 
61  std::string outputFile_; // output file
62 
64 
65  // root file to store histograms
66  TFile* rootFile_;
67 
68  //Tree
69  TTree* mytree_;
70  struct tree_structure_ {
71  // MC information
72  int mc_npar;
73  int parID;
74  float mc_sep;
75  float mc_e;
76  float mc_et;
77  float mc_phi;
78  float mc_eta;
79  float mc_theta;
80 
81  // MC-EM matching info
82  float em_dR;
83 
84  // EM SC info (uncorrected)
86  int em_scType;
87  float em_e;
88  float em_et;
89  float em_phi;
90  float em_eta;
91  float em_theta;
92  int em_nCell;
93  int em_nBC;
94 
95  // physics variables
96  float em_pet;
97  float em_pe;
98  float em_peta;
99  float em_ptheta;
100 
101  // corrected collectin
102  float emCorr_e;
103  float emCorr_et;
104  float emCorr_eta;
105  float emCorr_phi;
107  float emCorr_pet;
108  float emCorr_peta;
110 
111  // EM widths, pw -- phiWidth, ew -- etaWidth
112  float em_pw;
113  float em_ew;
114  // ratios of widths pw/ew
115  float em_br;
116  };
118 
119  //
120  float xVtx_;
121  float yVtx_;
122  float zVtx_;
123  //
127  //
128  float xClust_vtx_;
129  float yClust_vtx_;
130  float zClust_vtx_;
131  //
132  float rClust_vtx_;
133  //
134  float energyMax_;
135  float eTMax_;
136  float eTMaxVtx_;
137  float etaMax_;
138  float etaMaxVtx_;
139  float phiMax_;
140  float phiMaxVtx_;
141  float thetaMax_;
143  //
144 
145  int evtN;
146 
147  //Function
148  void fillTree ( const reco::SuperClusterCollection* scColl, const reco::SuperClusterCollection* corrSCColl,
149  HepMC::GenParticle* mc, tree_structure_& tree_, float xV, float yV, float zV, int scType);
150 };
151 #endif
152 
virtual void analyze(const edm::Event &, const edm::EventSetup &)
void fillTree(const reco::SuperClusterCollection *scColl, const reco::SuperClusterCollection *corrSCColl, HepMC::GenParticle *mc, tree_structure_ &tree_, float xV, float yV, float zV, int scType)
std::vector< SuperCluster > SuperClusterCollection
collection of SuperCluser objectr
EnergyScaleAnalyzer(const edm::ParameterSet &)