CMS 3D CMS Logo

SimG4HcalValidation.h
Go to the documentation of this file.
1 // File: SimG4HcalValidation.h
3 // Analysis and validation of simhits of HCal inside the CMSSW framework
5 #ifndef Validation_HcalHits_SimG4HcalValidation_H
6 #define Validation_HcalHits_SimG4HcalValidation_H
7 
10 
15 
18 
19 #include <iostream>
20 #include <memory>
21 #include <vector>
22 #include <string>
23 
24 class G4Step;
25 class BeginOfJob;
26 class BeginOfRun;
27 class BeginOfEvent;
28 class EndOfEvent;
29 
30 namespace edm {
31  class ParameterSet;
32 }
33 
35  public Observer<const BeginOfJob *>,
36  public Observer<const BeginOfRun *>,
37  public Observer<const BeginOfEvent *>,
38  public Observer<const EndOfEvent *>,
39  public Observer<const G4Step *> {
40 
41 public:
43  virtual ~SimG4HcalValidation();
44 
45  void produce(edm::Event&, const edm::EventSetup&);
46 
47 private:
48  SimG4HcalValidation(const SimG4HcalValidation&); // stop default
49  const SimG4HcalValidation& operator=(const SimG4HcalValidation&);
50 
51  void init();
52 
53  // observer classes
54  void update(const BeginOfJob * job);
55  void update(const BeginOfRun * run);
56  void update(const BeginOfEvent * evt);
57  void update(const G4Step * step);
58  void update(const EndOfEvent * evt);
59 
60  // jetfinding and analysis-related stuff
61  void fill(const EndOfEvent * ev);
62  void layerAnalysis(PHcalValidInfoLayer&);
63  void nxNAnalysis(PHcalValidInfoNxN&);
64  void jetAnalysis(PHcalValidInfoJets&);
65  void fetchHits(PHcalValidInfoLayer&);
66  void clear();
67  void collectEnergyRdir(const double, const double);
68  double getHcalScale(std::string, int) const;
69 
70 
71 private:
72  //Keep parameters to instantiate Jet finder later
74 
75  //Keep reference to instantiate HcalNumberingFromDDD later
77 
78  //Keep parameters to instantiate HcalTestNumberingScheme later
80 
81  // Hit cache for cluster analysis
82  std::vector<CaloHit> hitcache; // e, eta, phi, time, layer, calo type
83 
84  // scale factors :
85  std::vector<float> scaleHB;
86  std::vector<float> scaleHE;
87  std::vector<float> scaleHF;
88 
89  // to read from parameter set
90  std::vector<std::string> names;
91  double coneSize, ehitThreshold, hhitThreshold;
92  float timeLowlim, timeUplim, eta0, phi0, jetThreshold;
93  bool applySampling, hcalOnly;
94  int infolevel;
95  std::string labelLayer, labelNxN, labelJets;
96 
97  // eta and phi size of windows around eta0, phi0
98  std::vector<double> dEta;
99  std::vector<double> dPhi;
100 
101  // some private members for ananlysis
102  unsigned int count;
103  double edepEB, edepEE, edepHB, edepHE, edepHO;
104  double edepd[5], edepl[20];
105  double een, hen, hoen; // Energy sum in ECAL, HCAL, HO
106  double vhitec, vhithc, enEcal, enHcal;
107 };
108 
109 #endif
HcalNumberingFromDDD * numberingFromDDD
std::vector< float > scaleHF
std::vector< std::string > names
std::vector< CaloHit > hitcache
std::vector< double > dEta
bool ev
SimG4HcalHitJetFinder * jetf
std::vector< double > dPhi
void clear(CLHEP::HepGenMatrix &m)
Helper function: Reset all elements of a matrix to 0.
Definition: matutil.cc:167
std::vector< float > scaleHB
std::vector< float > scaleHE
HLT enums.
#define update(a, b)
step
HcalTestNumberingScheme * org