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 <string>
22 #include <vector>
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 public:
42  ~SimG4HcalValidation() override;
43 
44  void produce(edm::Event &, const edm::EventSetup &) override;
45 
46 private:
47  SimG4HcalValidation(const SimG4HcalValidation &) = delete; // stop default
48  const SimG4HcalValidation &operator=(const SimG4HcalValidation &) = delete;
49 
50  void init();
51 
52  // observer classes
53  void update(const BeginOfJob *job) override;
54  void update(const BeginOfRun *run) override;
55  void update(const BeginOfEvent *evt) override;
56  void update(const G4Step *step) override;
57  void update(const EndOfEvent *evt) override;
58 
59  // jetfinding and analysis-related stuff
60  void fill(const EndOfEvent *ev);
61  void layerAnalysis(PHcalValidInfoLayer &);
62  void nxNAnalysis(PHcalValidInfoNxN &);
63  void jetAnalysis(PHcalValidInfoJets &);
64  void fetchHits(PHcalValidInfoLayer &);
65  void clear();
66  void collectEnergyRdir(const double, const double);
67  double getHcalScale(std::string, int) const;
68 
69 private:
70  // Keep parameters to instantiate Jet finder later
72 
73  // Keep reference to instantiate HcalNumberingFromDDD later
75 
76  // Keep parameters to instantiate HcalTestNumberingScheme later
78 
79  // Hit cache for cluster analysis
80  std::vector<CaloHit> hitcache; // e, eta, phi, time, layer, calo type
81 
82  // scale factors :
83  std::vector<float> scaleHB;
84  std::vector<float> scaleHE;
85  std::vector<float> scaleHF;
86 
87  // to read from parameter set
88  std::vector<std::string> names;
89  double coneSize, ehitThreshold, hhitThreshold;
90  float timeLowlim, timeUplim, eta0, phi0, jetThreshold;
91  bool applySampling, hcalOnly;
92  int infolevel;
93  std::string labelLayer, labelNxN, labelJets;
94 
95  // eta and phi size of windows around eta0, phi0
96  std::vector<double> dEta;
97  std::vector<double> dPhi;
98 
99  // some private members for ananlysis
100  unsigned int count;
101  double edepEB, edepEE, edepHB, edepHE, edepHO;
102  double edepd[5], edepl[20];
103  double een, hen, hoen; // Energy sum in ECAL, HCAL, HO
104  double vhitec, vhithc, enEcal, enHcal;
105 };
106 
107 #endif
HcalNumberingFromDDD * numberingFromDDD
std::vector< float > scaleHF
std::vector< std::string > names
std::vector< CaloHit > hitcache
int init
Definition: HydjetWrapper.h:67
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
Definition: StallMonitor.cc:94
HcalTestNumberingScheme * org