CMS 3D CMS Logo

HcalTB04Analysis.h
Go to the documentation of this file.
1 #ifndef HcalTestBeam_HcalTB04Analysis_H
2 #define HcalTestBeam_HcalTB04Analysis_H
3 // -*- C++ -*-
4 //
5 // Package: HcalTestBeam
6 // Class : HcalTB04Analysis
7 //
14 //
15 // Original Author: Sunanda Banerjee
16 // Created: Thu May 18 10:14:34 CEST 2006
17 //
18 
19 // system include files
20 #include <iostream>
21 #include <memory>
22 #include <vector>
23 #include <string>
24 
25 // user include files
28 
31 
34 
35 #include "G4Step.hh"
36 #include "G4Track.hh"
37 #include "G4ThreeVector.hh"
38 
39 #include <boost/cstdint.hpp>
40 
41 class BeginOfRun;
42 class BeginOfEvent;
43 class EndOfEvent;
44 
45 class PHcalTB04Info;
46 
47 namespace CLHEP {
48  class HepRandomEngine;
49 }
50 
52  public Observer<const BeginOfRun *>,
53  public Observer<const BeginOfEvent *>,
54  public Observer<const EndOfEvent *>,
55  public Observer<const G4Step *> {
56 
57 public:
58 
60  ~HcalTB04Analysis() override;
61 
62  void produce(edm::Event&, const edm::EventSetup&) override;
63 
64 private:
65 
66  HcalTB04Analysis(const HcalTB04Analysis&) = delete; // stop default
67  const HcalTB04Analysis& operator=(const HcalTB04Analysis&) = delete;
68 
69  void init();
70 
71  // observer methods
72  void update(const BeginOfRun * run) override;
73  void update(const BeginOfEvent * evt) override;
74  void update(const G4Step * step) override;
75  void update(const EndOfEvent * evt) override;
76 
77  //User methods
78  void fillBuffer(const EndOfEvent * evt);
79  void qieAnalysis(CLHEP::HepRandomEngine*);
80  void xtalAnalysis(CLHEP::HepRandomEngine*);
81  void finalAnalysis();
82  void fillEvent(PHcalTB04Info&);
83 
84  void clear();
85  int unitID(uint32_t id);
86  double scale(int det, int layer);
87  double timeOfFlight(int det, int layer, double eta);
88 
89 private:
90 
93 
94  // to read from parameter set
95  bool hcalOnly;
96  int mode, type;
97  double ecalNoise, beamOffset;
98  int iceta, icphi;
99  double scaleHB0, scaleHB16, scaleHO, scaleHE0;
100  std::vector<std::string> names;
101  G4RotationMatrix* beamline_RM;
102 
103  // Constants for the run
104  int count;
105  int nTower, nCrystal;
106  std::vector<int> idHcal, idXtal;
107  std::vector<uint32_t> idTower, idEcal;
108 
109  // Constants for the event
110  int nPrimary, particleType;
111  double pInit, etaInit, phiInit;
112  std::vector<CaloHit> ecalHitCache;
113  std::vector<CaloHit> hcalHitCache, hcalHitLayer;
114  std::vector<double> esimh, eqie, esime, enois;
115  std::vector<double> eseta, eqeta, esphi, eqphi, eslay, eqlay;
116  double etots, eecals, ehcals, etotq, eecalq, ehcalq;
117 
118  bool pvFound;
119  int evNum, pvType;
120  G4ThreeVector pvPosition, pvMomentum, pvUVW;
121  std::vector<int> secTrackID, secPartID;
122  std::vector<G4ThreeVector> secMomentum;
123  std::vector<double> secEkin;
124  std::vector<int> shortLivedSecondaries;
125 };
126 
127 #endif
std::vector< double > secEkin
def fillEvent(tree, event)
Definition: ntuple.py:16
std::vector< CaloHit > hcalHitLayer
int init
Definition: HydjetWrapper.h:67
std::vector< int > shortLivedSecondaries
std::vector< int > secTrackID
G4ThreeVector pvUVW
void clear(CLHEP::HepGenMatrix &m)
Helper function: Reset all elements of a matrix to 0.
Definition: matutil.cc:167
G4RotationMatrix * beamline_RM
std::vector< double > esphi
std::vector< int > idXtal
std::vector< CaloHit > ecalHitCache
std::vector< G4ThreeVector > secMomentum
HcalTB04Histo * histo
#define update(a, b)
std::vector< uint32_t > idTower
step
std::vector< std::string > names
double timeOfFlight(DetId id, const CaloGeometry *geo, bool debug=false)
Definition: CaloSimInfo.cc:17
std::vector< double > esimh