CMS 3D CMS Logo

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