CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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  virtual ~HcalTB04Analysis();
61 
62  virtual void produce(edm::Event&, const edm::EventSetup&);
63 
64 private:
65 
66  HcalTB04Analysis(const HcalTB04Analysis&); // stop default
68 
69  void init();
70 
71  // observer methods
72  void update(const BeginOfRun * run);
73  void update(const BeginOfEvent * evt);
74  void update(const G4Step * step);
75  void update(const EndOfEvent * evt);
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;
98  int iceta, icphi;
100  std::vector<std::string> names;
101  G4RotationMatrix* beamline_RM;
102 
103  // Constants for the run
104  int count;
106  std::vector<int> idHcal, idXtal;
107  std::vector<uint32_t> idTower, idEcal;
108 
109  // Constants for the event
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;
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
void update(const BeginOfRun *run)
This routine will be called when the appropriate signal arrives.
std::vector< double > secEkin
std::vector< int > idHcal
std::vector< CaloHit > hcalHitLayer
std::vector< double > eqeta
std::vector< double > eqie
virtual void produce(edm::Event &, const edm::EventSetup &)
void fillBuffer(const EndOfEvent *evt)
std::vector< int > shortLivedSecondaries
std::vector< int > secTrackID
std::vector< double > eqphi
std::vector< int > secPartID
std::vector< uint32_t > idEcal
std::vector< double > eseta
G4ThreeVector pvUVW
G4RotationMatrix * beamline_RM
std::vector< double > esime
double scale(int det, int layer)
std::vector< double > esphi
double timeOfFlight(int det, int layer, double eta)
std::vector< CaloHit > hcalHitCache
const HcalTB04Analysis & operator=(const HcalTB04Analysis &)
void xtalAnalysis(CLHEP::HepRandomEngine *)
HcalTB04Analysis(const edm::ParameterSet &p)
std::vector< int > idXtal
std::vector< CaloHit > ecalHitCache
std::vector< double > enois
std::vector< G4ThreeVector > secMomentum
int unitID(uint32_t id)
HcalTB04Histo * histo
G4ThreeVector pvMomentum
virtual ~HcalTB04Analysis()
std::vector< uint32_t > idTower
void qieAnalysis(CLHEP::HepRandomEngine *)
std::vector< double > eslay
std::vector< double > eqlay
G4ThreeVector pvPosition
std::vector< std::string > names
void fillEvent(PHcalTB04Info &)
std::vector< double > esimh