BOSS 7.0.4
BESIII Offline Software System
Loading...
Searching...
No Matches
Simulation/BOOST/EmcSim/EmcSim-00-00-46/EmcSim/BesEmcHit.hh
Go to the documentation of this file.
1//---------------------------------------------------------------------------//
2// BOOST --- BESIII Object_Oreiented Simulation Tool //
3//---------------------------------------------------------------------------//
4//Descpirtion: EMC detector
5//Author: Fu Chengdong
6//Created: Sep 4, 2003
7//Modified: He Miao, Jul 18th, 2006
8//Comment:
9//---------------------------------------------------------------------------//
10//
11#ifndef BesEmcHit_h
12#define BesEmcHit_h 1
13
14#include "G4VHit.hh"
15#include "G4THitsCollection.hh"
16#include "G4Allocator.hh"
17#include "G4ThreeVector.hh"
18#include "Identifier/Identifier.h"
19#include <map>
20
21//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
22
23class BesEmcHit : public G4VHit
24{
25 public:
26
31 int operator==(const BesEmcHit&) const;
32
33 inline void* operator new(size_t);
34 inline void operator delete(void*);
35
36 void Draw();
37 void Print(G4int);
38 void Print();
39
40 public:
41
42 void AddCrystal(G4double de, G4double dl) {TotalEdepCrystal += de; TotalTrackLengthCrystal += dl;};
43
44 void SetEdepCrystal(G4double de) {EdepCrystal=de;};
45 void SetEdepCasing(G4double de) {EdepCasing=de;};
46 void SetTrakCrystal(G4double dl){TrackLengthCrystal=dl;};
47 void SetPosCrystal(G4ThreeVector position){PositionCrystal=position;};
48 void SetTimeCrystal(G4double t){TimeCrystal=t;};
49 void SetNumCrystal(G4int id,G4int numTheta,G4int numPhi){PartId=id;NumTheta=numTheta;NumPhi=numPhi;};
50 void SetTrackIndex(G4int index) { trackIndex = index;}
51 void SetG4Index(G4int index) { g4Index = index;}
52 void SetMomentum(G4ThreeVector momen) {momentum = momen;}
53
54 G4double GetTotalEdepCrystal() { return TotalEdepCrystal; };
55 G4double GetTotalTrakCrystal() { return TotalTrackLengthCrystal; };
56 G4double GetEdepCrystal() { return EdepCrystal; };
57 G4double GetEdepCasing() { return EdepCasing; };
58 G4double GetTrakCrystal() { return TrackLengthCrystal; };
59 G4ThreeVector GetPosCrystal() { return PositionCrystal;};
60 G4double GetTimeCrystal() {return TimeCrystal;};
61 G4int GetPartId() {return PartId;};
62 G4int GetNumThetaCrystal() {return NumTheta;};
63 G4int GetNumPhiCrystal() {return NumPhi;};
64 G4int GetTrackIndex() {return trackIndex;}
65 G4int GetG4Index() {return g4Index;}
66 G4ThreeVector GetMomentum() {return momentum;}
67
68 private:
69
70 G4double TotalEdepCrystal, TotalTrackLengthCrystal;
71 G4double EdepCrystal,TrackLengthCrystal;
72 G4double EdepCasing;
73 G4ThreeVector PositionCrystal;
74 G4double TimeCrystal;
75 G4int PartId,NumTheta,NumPhi;
76 G4int trackIndex;
77 G4int g4Index;
78 G4ThreeVector momentum;
79};
80
81//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
82
83typedef G4THitsCollection<BesEmcHit> BesEmcHitsCollection;
84
85extern G4Allocator<BesEmcHit> BesEmcHitAllocator;
86
87//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
88
89inline void* BesEmcHit::operator new(size_t)
90{
91 void* aHit;
92 aHit = (void*) BesEmcHitAllocator.MallocSingle();
93 return aHit;
94}
95
96//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
97
98inline void BesEmcHit::operator delete(void* aHit)
99{
100 BesEmcHitAllocator.FreeSingle((BesEmcHit*) aHit);
101}
102
103//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
104
105class BesEmcTruthHit : public G4VHit
106{
107 public:
108
111
114
115 G4int operator==(const BesEmcTruthHit&) const;
116 inline void* operator new(size_t);
117 inline void operator delete(void*);
118
119 void Print();
120
121 public:
122
123 inline void SetIdentify(Identifier id) { m_identify=id; }
124 inline void SetTrackIndex(G4int index) { m_trackIndex=index; }
125 inline void SetG4TrackId(G4int trackId) { m_g4TrackId=trackId; }
126 inline void SetHitEmc(G4int is) { m_hitEmc=is; }
127 inline void SetPDGCode(G4int code) {m_PDGCode=code;}
128 inline void SetPDGCharge(G4double charge) {m_PDGCharge = charge;}
129 inline void SetParticleName(G4String name) {m_particleName=name;}
130 inline void SetEDep(G4double de) { m_edep=de; }
131 inline void SetTime(G4double time) { m_time=time; }
132 inline void SetMomentum(G4ThreeVector p) { m_momentum=p; }
133 inline void SetPosition(G4ThreeVector pos) { m_position=pos; }
134
135 Identifier GetIdentify() const { return m_identify; }
136 G4int GetTrackIndex() const { return m_trackIndex; }
137 G4int GetG4TrackId() const { return m_g4TrackId; }
138 G4int GetHitEmc() const { return m_hitEmc; }
139 G4int GetPDGCode() const {return m_PDGCode;}
140 G4double GetPDGCharge() const {return m_PDGCharge;}
141 G4String GetParticleName() const {return m_particleName;}
142 G4double GetEDep() const { return m_edep; }
143 G4double GetTime() const { return m_time; }
144 G4ThreeVector GetMomentum() const { return m_momentum; }
145 G4ThreeVector GetPosition() const { return m_position; }
146
147 std::map<Identifier,G4double>::const_iterator Begin() const;
148 std::map<Identifier,G4double>::const_iterator End() const;
149 std::map<Identifier,G4double>::const_iterator Find(Identifier) const;
150
152 void AddEHit(Identifier,G4double);
153 void Insert(Identifier,G4double);
154 G4int Size() const;
155
156 private:
157
158 //hit crystal id
159 Identifier m_identify;
160 //track index
161 G4int m_trackIndex;
162 //G4 Track Id
163 G4int m_g4TrackId;
164 //whether hit Emc
165 G4int m_hitEmc;
166 //particle ID
167 G4int m_PDGCode;
168 //particle charge;
169 G4double m_PDGCharge;
170 //particle name
171 G4String m_particleName;
172 //total energy deposits
173 G4double m_edep;
174 G4double m_time;
175 G4ThreeVector m_momentum;
176 G4ThreeVector m_position;
177 std::map<Identifier,G4double> m_hitMap;
178
179};
180
181typedef G4THitsCollection<BesEmcTruthHit> BesEmcTruthHitsCollection;
182
183extern G4Allocator<BesEmcTruthHit> BesEmcTruthHitAllocator;
184
185//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
186
187inline void* BesEmcTruthHit::operator new(size_t)
188{
189 void* aHit;
190 aHit = (void*) BesEmcTruthHitAllocator.MallocSingle();
191 return aHit;
192}
193
194inline void BesEmcTruthHit::operator delete(void* aHit)
195{
196 BesEmcTruthHitAllocator.FreeSingle((BesEmcTruthHit*) aHit);
197}
198
199#endif
Double_t time
G4Allocator< BesEmcTruthHit > BesEmcTruthHitAllocator
Definition: BesEmcHit.cc:17
G4THitsCollection< BesEmcTruthHit > BesEmcTruthHitsCollection
G4Allocator< BesEmcHit > BesEmcHitAllocator
Definition: BesEmcHit.cc:16
G4THitsCollection< BesEmcHit > BesEmcHitsCollection
void SetNumCrystal(G4int id, G4int numTheta, G4int numPhi)
void Draw()
void Print(G4int)
BesEmcHit(const BesEmcHit &)
int operator==(const BesEmcHit &) const
void Print()
const BesEmcHit & operator=(const BesEmcHit &)
BesEmcTruthHit(const BesEmcTruthHit &)
void AddEHit(Identifier, G4double)
std::map< Identifier, G4double >::const_iterator End() const
std::map< Identifier, G4double >::const_iterator Find(Identifier) const
const BesEmcTruthHit & operator=(const BesEmcTruthHit &)
void Insert(Identifier, G4double)
G4int operator==(const BesEmcTruthHit &) const
virtual ~BesEmcTruthHit()
G4double GetEHit(Identifier)
std::map< Identifier, G4double >::const_iterator Begin() const
G4int Size() const
int t()
Definition: t.c:1