CGEM BOSS 6.6.5.g
BESIII Offline Software System
Loading...
Searching...
No Matches
BesCgemHit.hh
Go to the documentation of this file.
1//-------------------------------------------------------------------------------------//
2// BOOST --- BESIII Object_Oriented Simulation Tool //
3//-------------------------------------------------------------------------------------//
4/*
5 * =====================================================================================
6 *
7 * Filename: BesCgemHit.hh
8 * Description:
9 * Conventions:
10 * f_ : variable used in function parameter list
11 * gv_ : global variable
12 * lv_ : local variable used in function
13 * lvd_ : local variable double
14 * m_* : normal member of class
15 * sm_* : static member of class
16 * m_M_* : class data member, Material of each layer
17 * m_N_* : class data member, Number of layers (CgemLayer,GemFoil)
18 * m_R_* : class data member, Radius of each (material) layer, and so on
19 * m_L_* : class data member, Length of each layer or hole pitch
20 * m_T_* : class data member, Thickness of each (material) layer
21 * m_A_* : class data member, Angle of anode VStrip
22 * m_E_* : class data member, Energy
23 * m_P_* : class data member, P(Momentum)
24 * Version: CgemSim-01-00-00
25 * Created: 01/02/2014 16:59:21 PM
26 * Revision: CgemSim-00-00-01(in CMT version CgemBoss-0.0.1 written by xiuql)
27 * Compiler: gcc
28 * Author: [email protected]
29 * Organization: DG1,EPC,IHEP
30 * History:
31 * <Num> <Author> <Time> <Version> <remark>
32 * 0 juxd 20140102 01-00-00 created,
33 *
34 * =====================================================================================
35 */
36
37//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
38#ifndef BesCgemHit_h
39#define BesCgemHit_h 1
40
41/* Header file: Geant4 */
42#include "G4VHit.hh"
43#include "G4THitsCollection.hh"
44#include "G4Allocator.hh"
45#include "G4ThreeVector.hh"
46
47/* Header file: C++ */
48#include <vector>
49#include "TArrayI.h"
50
51using namespace std;
52
53class BesCgemHit : public G4VHit
54{
55 public:
56 BesCgemHit();
57 BesCgemHit(const BesCgemHit&);
59
60 /* Operator */
61 const BesCgemHit& operator=(const BesCgemHit&);
62 G4int operator==(const BesCgemHit&) const;
63
64 inline void* operator new(size_t);
65 inline void operator delete(void*);
66
67 /* Function inherit from base class */
68 virtual void Draw(){};
69 virtual void Print();
70
71 /* Set methods */
72 //Add by sunxh
73 void SetRdtEl ( G4int f_RdtElectron ) {m_RdtElectron = f_RdtElectron ;};
74 void SetHitID ( G4int f_ID_hit ) {m_ID_hit = f_ID_hit ;};
75 //end
76 void SetTrackID ( G4int f_ID_track ) {m_ID_track = f_ID_track ;};
77 void SetIsSecondary ( G4int isSec ) {m_isSecondary = isSec ;};
78 void SetLayerID ( G4int f_ID_layer ) {m_ID_layer = f_ID_layer ;};
79 void SetPDGCode ( G4int f_pdg_code ) {m_pdg_code = f_pdg_code ;};
80 void SetParentID ( G4int f_ID_parent ) {m_ID_parent = f_ID_parent ;};
81 void SetGlobalTime ( G4double f_global_time ) {m_global_time = f_global_time ;};
82 void SetTotalEnergyDeposit ( G4double f_E_deposit ) {m_E_deposit = f_E_deposit ;};
83 void SetStepLength ( G4double f_L_step ) {m_L_step = f_L_step ;};
84 void SetPositionOfPrePoint ( G4ThreeVector f_XYZ_pre ) {m_XYZ_pre = f_XYZ_pre ;};
85 void SetPositionOfPostPoint ( G4ThreeVector f_XYZ_post ) {m_XYZ_post = f_XYZ_post ;};
86 void SetPositionOfPrePointAlign ( G4ThreeVector f_XYZ_pre ) {m_XYZ_pre_align = f_XYZ_pre;};
87 void SetPositionOfPostPointAlign ( G4ThreeVector f_XYZ_post ) {m_XYZ_post_align= f_XYZ_post;};
88 void SetMomentumOfPrePoint ( G4ThreeVector f_P_pre ) {m_P_pre = f_P_pre ;};
89 void SetMomentumOfPostPoint ( G4ThreeVector f_P_post ) {m_P_post = f_P_post ;};
90 //void SetPrePositionInCu ( G4ThreeVector f_Cu_pre ) {m_Cu_pre = f_Cu_pre ;};
91 //void SetPostPositionInCu ( G4ThreeVector f_Cu_post ) {m_Cu_post = f_Cu_post ;};
92 //void SetMomentumOfCuPre ( G4ThreeVector f_P_Cu_pre ) {m_P_Cu_pre = f_P_Cu_pre ;};
93 //void SetMomentumOfCuPost ( G4ThreeVector f_P_Cu_post ) {m_P_Cu_post = f_P_Cu_post ;};
94 //Add by sunxh
95 void AddIdentifier ( G4int f_ID_Identifier[2000] , G4int N_dim ) {m_ID_Identifier.Set(N_dim, f_ID_Identifier); };
96 //end
97 void SetCreatorProcess(G4String proName) {m_creatorProcess=proName;};
98 //void SetCurrentTrkID(G4int id) {m_ID_current_track=id;};
99 //void SetCurrentPdgCode(G4int code) {m_current_pdgcode=id;};
100 void SetFlightLengthPrePoint(G4double len) {m_flightLength_pre =len;};
101 void SetFlightLengthPostPoint(G4double len) {m_flightLength_post=len;};
102 void AddDigiIdxQ(G4int id) { m_vecDigiIdx_Q.push_back(id); };
103 void SetDigiIdxT(G4int id) { m_digiIdx_T=id; };
104
105 /* Get methods */
106 //Add by sunxh
107 G4int GetRdtEl () const {return m_RdtElectron ;};
108 G4int GetHitID () const {return m_ID_hit ;};
109 //end
110 G4int GetTrackID () const {return m_ID_track ;};
111 G4int GetIsSecondary () const {return m_isSecondary ;};
112 G4int GetLayerID () const {return m_ID_layer ;};
113 G4int GetPDGCode () const {return m_pdg_code ;};
114 G4int GetParentID () const {return m_ID_parent ;};
115 G4double GetGlobalTime () const {return m_global_time ;};
116 G4double GetTotalEnergyDeposit () const {return m_E_deposit ;};
117 G4double GetStepLength () const {return m_L_step ;};
118 G4ThreeVector GetPositionOfPrePoint () const {return m_XYZ_pre ;};
119 G4ThreeVector GetPositionOfPostPoint () const {return m_XYZ_post ;};
120 G4ThreeVector GetPositionOfPrePointAlign () const {return m_XYZ_pre_align;};
121 G4ThreeVector GetPositionOfPostPointAlign () const {return m_XYZ_post_align;};
122 G4ThreeVector GetMomentumOfPrePoint () const {return m_P_pre ;};
123 G4ThreeVector GetMomentumOfPostPoint () const {return m_P_post ;};
124 //G4ThreeVector GetPrePositionInCu () const {return m_Cu_pre ;};
125 //G4ThreeVector GetPostPositionInCu () const {return m_Cu_post ;};
126 //G4ThreeVector GetMomentumOfCuPre () const {return m_P_Cu_pre ;};
127 //G4ThreeVector GetMomentumOfCuPost () const {return m_P_Cu_post ;};
128 //Add by sunxh
129 TArrayI GetIdentifier () const {return m_ID_Identifier;};
130 //end
131 G4String GetCreatorProcess() const {return m_creatorProcess;};
132 //G4int GetCurrentTrkID() const {return m_ID_current_track;};
133 //G4int GetCurrentPdgCode() const {return m_current_pdgcode;};
134 G4int GetFlightLengthPrePoint() const {return m_flightLength_pre;};
135 G4int GetFlightLengthPostPoint() const {return m_flightLength_post;};
136 const vector<G4int>& GetVecDigiIdxQ() const {return m_vecDigiIdx_Q;};
137 G4int GetDigiIdxT() const {return m_digiIdx_T;};
138
139
140 private:
141 //Add by sunxh
142 G4int m_RdtElectron;
143 G4int m_ID_hit;
144 //end
145 G4int m_ID_track; /* trk index of current track, could be mother or mother's mother or ... */
146 //G4int m_ID_current_track; /* G4 index of current track */
147 //G4int m_current_pdgcode; /* pdg code of current track */
148 G4int m_isSecondary; /* if the hit from the track index directly */
149 G4int m_ID_layer; /* ID of CgemLayer Hits belong to */
150 G4int m_pdg_code; /* PDG code of the track particle */
151 G4int m_ID_parent; /* parent ID of the track particle */
152 G4double m_global_time; /* Time since the current event began */
153 G4double m_E_deposit; /* Total energy deposited during the step */
154 G4double m_L_step; /* Step length */
155 G4ThreeVector m_XYZ_pre; /* Position of Pre Point */
156 G4ThreeVector m_XYZ_post; /* Position of Post Point */
157 G4ThreeVector m_XYZ_pre_align; /* Position of Pre Point after alignment conversion */
158 G4ThreeVector m_XYZ_post_align; /* Position of Post Point after alignment conversion */
159 G4ThreeVector m_P_pre; /* Momentum of Pre Point */
160 G4ThreeVector m_P_post; /* Momentum of post point */
161 G4double m_flightLength_pre;
162 G4double m_flightLength_post;
163 G4String m_creatorProcess; /* Name of the generation process */
164 //G4ThreeVector m_Cu_pre; //position of pre point in Cu//
165 //G4ThreeVector m_Cu_post; //position of post point in Cu//
166 //G4ThreeVector m_P_Cu_pre; //momentum of pre point in Cu//
167 //G4ThreeVector m_P_Cu_post; //momentum of post point in Cu//
168 //Add by sunxh
169 TArrayI m_ID_Identifier;
170 vector<G4int> m_vecDigiIdx_Q;// cgem digi indexes whose Q are (partly) from this true hit
171 G4int m_digiIdx_T; // cgem digi index whose T is from this true hit
172 //end
173
174};
175
176//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
177typedef G4THitsCollection<BesCgemHit> BesCgemHitsCollection;
178
179//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
180extern G4Allocator<BesCgemHit> BesCgemHitAllocator;
181
182//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
183inline void* BesCgemHit::operator new(size_t)
184{
185 void *hit;
186 hit = (void *) BesCgemHitAllocator.MallocSingle();
187 return hit;
188}
189
190//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
191inline void BesCgemHit::operator delete(void *hit)
192{
193 BesCgemHitAllocator.FreeSingle((BesCgemHit*) hit);
194}
195
196//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
197#endif
G4THitsCollection< BesCgemHit > BesCgemHitsCollection
Definition: BesCgemHit.hh:177
G4Allocator< BesCgemHit > BesCgemHitAllocator
Definition: BesCgemHit.cc:58
void SetTotalEnergyDeposit(G4double f_E_deposit)
Definition: BesCgemHit.hh:82
void SetIsSecondary(G4int isSec)
Definition: BesCgemHit.hh:77
void AddDigiIdxQ(G4int id)
Definition: BesCgemHit.hh:102
const BesCgemHit & operator=(const BesCgemHit &)
Definition: BesCgemHit.cc:114
void SetGlobalTime(G4double f_global_time)
Definition: BesCgemHit.hh:81
G4ThreeVector GetPositionOfPrePoint() const
Definition: BesCgemHit.hh:118
void AddIdentifier(G4int f_ID_Identifier[2000], G4int N_dim)
Definition: BesCgemHit.hh:95
G4ThreeVector GetMomentumOfPostPoint() const
Definition: BesCgemHit.hh:123
virtual void Draw()
Definition: BesCgemHit.hh:68
G4double GetGlobalTime() const
Definition: BesCgemHit.hh:115
void SetMomentumOfPostPoint(G4ThreeVector f_P_post)
Definition: BesCgemHit.hh:89
void SetDigiIdxT(G4int id)
Definition: BesCgemHit.hh:103
TArrayI GetIdentifier() const
Definition: BesCgemHit.hh:129
void SetHitID(G4int f_ID_hit)
Definition: BesCgemHit.hh:74
G4int GetHitID() const
Definition: BesCgemHit.hh:108
const vector< G4int > & GetVecDigiIdxQ() const
Definition: BesCgemHit.hh:136
void SetPDGCode(G4int f_pdg_code)
Definition: BesCgemHit.hh:79
G4ThreeVector GetPositionOfPostPointAlign() const
Definition: BesCgemHit.hh:121
G4ThreeVector GetPositionOfPrePointAlign() const
Definition: BesCgemHit.hh:120
G4int GetIsSecondary() const
Definition: BesCgemHit.hh:111
G4double GetStepLength() const
Definition: BesCgemHit.hh:117
void SetLayerID(G4int f_ID_layer)
Definition: BesCgemHit.hh:78
void SetRdtEl(G4int f_RdtElectron)
Definition: BesCgemHit.hh:73
G4int operator==(const BesCgemHit &) const
Definition: BesCgemHit.cc:139
G4int GetPDGCode() const
Definition: BesCgemHit.hh:113
void SetParentID(G4int f_ID_parent)
Definition: BesCgemHit.hh:80
G4int GetTrackID() const
Definition: BesCgemHit.hh:110
virtual void Print()
Definition: BesCgemHit.cc:145
void SetFlightLengthPostPoint(G4double len)
Definition: BesCgemHit.hh:101
void SetTrackID(G4int f_ID_track)
Definition: BesCgemHit.hh:76
G4ThreeVector GetPositionOfPostPoint() const
Definition: BesCgemHit.hh:119
void SetPositionOfPrePoint(G4ThreeVector f_XYZ_pre)
Definition: BesCgemHit.hh:84
void SetFlightLengthPrePoint(G4double len)
Definition: BesCgemHit.hh:100
G4double GetTotalEnergyDeposit() const
Definition: BesCgemHit.hh:116
void SetMomentumOfPrePoint(G4ThreeVector f_P_pre)
Definition: BesCgemHit.hh:88
G4ThreeVector GetMomentumOfPrePoint() const
Definition: BesCgemHit.hh:122
G4String GetCreatorProcess() const
Definition: BesCgemHit.hh:131
G4int GetRdtEl() const
Definition: BesCgemHit.hh:107
G4int GetLayerID() const
Definition: BesCgemHit.hh:112
G4int GetParentID() const
Definition: BesCgemHit.hh:114
void SetCreatorProcess(G4String proName)
Definition: BesCgemHit.hh:97
G4int GetFlightLengthPrePoint() const
Definition: BesCgemHit.hh:134
G4int GetFlightLengthPostPoint() const
Definition: BesCgemHit.hh:135
G4int GetDigiIdxT() const
Definition: BesCgemHit.hh:137
void SetPositionOfPostPointAlign(G4ThreeVector f_XYZ_post)
Definition: BesCgemHit.hh:87
void SetPositionOfPrePointAlign(G4ThreeVector f_XYZ_pre)
Definition: BesCgemHit.hh:86
void SetPositionOfPostPoint(G4ThreeVector f_XYZ_post)
Definition: BesCgemHit.hh:85
void SetStepLength(G4double f_L_step)
Definition: BesCgemHit.hh:83