test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
HcalTB06Analysis.h
Go to the documentation of this file.
1 #ifndef SimG4CMS_HcalTestBeam_HcalTB06Analysis_H
2 #define SimG4CMS_HcalTestBeam_HcalTB06Analysis_H
3 // -*- C++ -*-
4 //
5 // Package: HcalTestBeam
6 // Class : HcalTB06Analysis
7 //
14 //
15 // Original Author: Sunanda Banerjee
16 // Created: Tue Oct 10 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 
30 
33 
34 #include "G4Step.hh"
35 #include "G4Track.hh"
36 #include "G4ThreeVector.hh"
37 
38 #include <boost/cstdint.hpp>
39 
40 class BeginOfRun;
41 class BeginOfEvent;
42 class EndOfEvent;
43 
45  public Observer<const BeginOfRun *>,
46  public Observer<const BeginOfEvent *>,
47  public Observer<const EndOfEvent *>,
48  public Observer<const G4Step *> {
49 
50 public:
51 
53  virtual ~HcalTB06Analysis();
54 
55  virtual void produce(edm::Event&, const edm::EventSetup&);
56 
57 private:
58 
59  HcalTB06Analysis(const HcalTB06Analysis&); // stop default
61 
62  void init();
63 
64  // observer methods
65  void update(const BeginOfRun * run);
66  void update(const BeginOfEvent * evt);
67  void update(const G4Step * step);
68  void update(const EndOfEvent * evt);
69 
70  //User methods
71  void fillBuffer(const EndOfEvent * evt);
72  void finalAnalysis();
73  void fillEvent(PHcalTB06Info&);
74 
75  void clear();
76 
77 private:
78 
80 
81  // to read from parameter set
82  double beamOffset;
83  int iceta, icphi;
84  std::vector<std::string> names;
85  G4RotationMatrix* beamline_RM;
86 
87  // Constants for the run
88  int count;
89 
90  // Constants for the event
92  double pInit, etaInit, phiInit;
93  std::vector<CaloHit> ecalHitCache;
94  std::vector<CaloHit> hcalHitCache, hcalHitLayer;
95  double etots, eecals, ehcals;
96 
97  bool pvFound;
98  int evNum, pvType;
99  G4ThreeVector pvPosition, pvMomentum, pvUVW;
100  std::vector<int> secTrackID, secPartID;
101  std::vector<G4ThreeVector> secMomentum;
102  std::vector<double> secEkin;
103  std::vector<int> shortLivedSecondaries;
104 };
105 
106 #endif
G4ThreeVector pvMomentum
void update(const BeginOfRun *run)
This routine will be called when the appropriate signal arrives.
std::vector< std::string > names
std::vector< CaloHit > ecalHitCache
std::vector< CaloHit > hcalHitLayer
HcalTB06Histo * histo
G4ThreeVector pvPosition
virtual void produce(edm::Event &, const edm::EventSetup &)
void fillEvent(PHcalTB06Info &)
std::vector< CaloHit > hcalHitCache
std::vector< G4ThreeVector > secMomentum
std::vector< int > shortLivedSecondaries
const HcalTB06Analysis & operator=(const HcalTB06Analysis &)
void fillBuffer(const EndOfEvent *evt)
HcalTB06Analysis(const edm::ParameterSet &p)
std::vector< double > secEkin
std::vector< int > secPartID
virtual ~HcalTB06Analysis()
std::vector< int > secTrackID
G4RotationMatrix * beamline_RM
G4ThreeVector pvUVW