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 
48  public Observer<const BeginOfRun *>,
49  public Observer<const BeginOfEvent *>,
50  public Observer<const EndOfEvent *>,
51  public Observer<const G4Step *> {
52 
53 public:
54 
56  virtual ~HcalTB04Analysis();
57 
58  virtual void produce(edm::Event&, const edm::EventSetup&);
59 
60 private:
61 
62  HcalTB04Analysis(const HcalTB04Analysis&); // stop default
64 
65  void init();
66 
67  // observer methods
68  void update(const BeginOfRun * run);
69  void update(const BeginOfEvent * evt);
70  void update(const G4Step * step);
71  void update(const EndOfEvent * evt);
72 
73  //User methods
74  void fillBuffer(const EndOfEvent * evt);
75  void qieAnalysis();
76  void xtalAnalysis();
77  void finalAnalysis();
78  void fillEvent(PHcalTB04Info&);
79 
80  void clear();
81  int unitID(uint32_t id);
82  double scale(int det, int layer);
83  double timeOfFlight(int det, int layer, double eta);
84 
85 private:
86 
89 
90  // to read from parameter set
91  bool hcalOnly;
92  int mode, type;
94  int iceta, icphi;
96  std::vector<std::string> names;
97  G4RotationMatrix* beamline_RM;
98 
99  // Constants for the run
100  int count;
102  std::vector<int> idHcal, idXtal;
103  std::vector<uint32_t> idTower, idEcal;
104 
105  // Constants for the event
108  std::vector<CaloHit> ecalHitCache;
109  std::vector<CaloHit> hcalHitCache, hcalHitLayer;
110  std::vector<double> esimh, eqie, esime, enois;
111  std::vector<double> eseta, eqeta, esphi, eqphi, eslay, eqlay;
113 
114  bool pvFound;
115  int evNum, pvType;
116  G4ThreeVector pvPosition, pvMomentum, pvUVW;
117  std::vector<int> secTrackID, secPartID;
118  std::vector<G4ThreeVector> secMomentum;
119  std::vector<double> secEkin;
120  std::vector<int> shortLivedSecondaries;
121 };
122 
123 #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
T eta() const
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 &)
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
std::vector< double > eslay
std::vector< double > eqlay
G4ThreeVector pvPosition
std::vector< std::string > names
void fillEvent(PHcalTB04Info &)
std::vector< double > esimh