BOSS 8.0.0
BESIII Offline Software System
Loading...
Searching...
No Matches
Simulation/BOOST/EmcSim/include/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 "G4Allocator.hh"
15#include "G4THitsCollection.hh"
16#include "G4ThreeVector.hh"
17#include "G4VHit.hh"
18#include "Identifier/Identifier.h"
19#include <map>
20
21//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
22
23class BesEmcHit : public G4VHit {
24public:
28 const BesEmcHit& operator=( const BesEmcHit& );
29 int operator==( const BesEmcHit& ) const;
30
31 inline void* operator new( size_t );
32 inline void operator delete( void* );
33
34 void Draw();
35 void Print( G4int );
36 void Print();
37
38public:
39 void AddCrystal( G4double de, G4double dl ) {
40 TotalEdepCrystal += de;
41 TotalTrackLengthCrystal += dl;
42 };
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 ) {
50 PartId = id;
51 NumTheta = numTheta;
52 NumPhi = numPhi;
53 };
54 void SetTrackIndex( G4int index ) { trackIndex = index; }
55 void SetG4Index( G4int index ) { g4Index = index; }
56 void SetMomentum( G4ThreeVector momen ) { momentum = momen; }
57
58 G4double GetTotalEdepCrystal() { return TotalEdepCrystal; };
59 G4double GetTotalTrakCrystal() { return TotalTrackLengthCrystal; };
60 G4double GetEdepCrystal() { return EdepCrystal; };
61 G4double GetEdepCasing() { return EdepCasing; };
62 G4double GetTrakCrystal() { return TrackLengthCrystal; };
63 G4ThreeVector GetPosCrystal() { return PositionCrystal; };
64 G4double GetTimeCrystal() { return TimeCrystal; };
65 G4int GetPartId() { return PartId; };
66 G4int GetNumThetaCrystal() { return NumTheta; };
67 G4int GetNumPhiCrystal() { return NumPhi; };
68 G4int GetTrackIndex() { return trackIndex; }
69 G4int GetG4Index() { return g4Index; }
70 G4ThreeVector GetMomentum() { return momentum; }
71
72private:
73 G4double TotalEdepCrystal, TotalTrackLengthCrystal;
74 G4double EdepCrystal, TrackLengthCrystal;
75 G4double EdepCasing;
76 G4ThreeVector PositionCrystal;
77 G4double TimeCrystal;
78 G4int PartId, NumTheta, NumPhi;
79 G4int trackIndex;
80 G4int g4Index;
81 G4ThreeVector momentum;
82};
83
84//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
85
86typedef G4THitsCollection<BesEmcHit> BesEmcHitsCollection;
87
88extern G4Allocator<BesEmcHit> BesEmcHitAllocator;
89
90//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
91
92inline void* BesEmcHit::operator new( size_t ) {
93 void* aHit;
94 aHit = (void*)BesEmcHitAllocator.MallocSingle();
95 return aHit;
96}
97
98//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
99
100inline void BesEmcHit::operator delete( void* aHit ) {
101 BesEmcHitAllocator.FreeSingle( (BesEmcHit*)aHit );
102}
103
104//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
105
106class BesEmcTruthHit : public G4VHit {
107public:
110
113
114 G4int operator==( const BesEmcTruthHit& ) const;
115 inline void* operator new( size_t );
116 inline void operator delete( void* );
117
118 void Print();
119
120public:
121 inline void SetIdentify( Identifier id ) { m_identify = id; }
122 inline void SetTrackIndex( G4int index ) { m_trackIndex = index; }
123 inline void SetG4TrackId( G4int trackId ) { m_g4TrackId = trackId; }
124 inline void SetHitEmc( G4int is ) { m_hitEmc = is; }
125 inline void SetPDGCode( G4int code ) { m_PDGCode = code; }
126 inline void SetPDGCharge( G4double charge ) { m_PDGCharge = charge; }
127 inline void SetParticleName( G4String name ) { m_particleName = name; }
128 inline void SetEDep( G4double de ) { m_edep = de; }
129 inline void SetTime( G4double time ) { m_time = time; }
130 inline void SetMomentum( G4ThreeVector p ) { m_momentum = p; }
131 inline void SetPosition( G4ThreeVector pos ) { m_position = pos; }
132
133 Identifier GetIdentify() const { return m_identify; }
134 G4int GetTrackIndex() const { return m_trackIndex; }
135 G4int GetG4TrackId() const { return m_g4TrackId; }
136 G4int GetHitEmc() const { return m_hitEmc; }
137 G4int GetPDGCode() const { return m_PDGCode; }
138 G4double GetPDGCharge() const { return m_PDGCharge; }
139 G4String GetParticleName() const { return m_particleName; }
140 G4double GetEDep() const { return m_edep; }
141 G4double GetTime() const { return m_time; }
142 G4ThreeVector GetMomentum() const { return m_momentum; }
143 G4ThreeVector GetPosition() const { return m_position; }
144
145 std::map<Identifier, G4double>::const_iterator Begin() const;
146 std::map<Identifier, G4double>::const_iterator End() const;
147 std::map<Identifier, G4double>::const_iterator Find( Identifier ) const;
148
149 G4double GetEHit( Identifier );
150 void AddEHit( Identifier, G4double );
151 void Insert( Identifier, G4double );
152 G4int Size() const;
153
154private:
155 // hit crystal id
156 Identifier m_identify;
157 // track index
158 G4int m_trackIndex;
159 // G4 Track Id
160 G4int m_g4TrackId;
161 // whether hit Emc
162 G4int m_hitEmc;
163 // particle ID
164 G4int m_PDGCode;
165 // particle charge;
166 G4double m_PDGCharge;
167 // particle name
168 G4String m_particleName;
169 // total energy deposits
170 G4double m_edep;
171 G4double m_time;
172 G4ThreeVector m_momentum;
173 G4ThreeVector m_position;
174 std::map<Identifier, G4double> m_hitMap;
175};
176
177typedef G4THitsCollection<BesEmcTruthHit> BesEmcTruthHitsCollection;
178
179extern G4Allocator<BesEmcTruthHit> BesEmcTruthHitAllocator;
180
181//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
182
183inline void* BesEmcTruthHit::operator new( size_t ) {
184 void* aHit;
185 aHit = (void*)BesEmcTruthHitAllocator.MallocSingle();
186 return aHit;
187}
188
189inline void BesEmcTruthHit::operator delete( void* aHit ) {
190 BesEmcTruthHitAllocator.FreeSingle( (BesEmcTruthHit*)aHit );
191}
192
193#endif
**********INTEGER nmxhep !maximum number of particles DOUBLE PRECISION vhep INTEGER jdahep COMMON hepevt $ !serial number $ !number of particles $ !status code $ !particle ident KF $ !parent particles $ !childreen particles $ !four momentum
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 &)
void SetPosCrystal(G4ThreeVector position)
int operator==(const BesEmcHit &) const
void AddCrystal(G4double de, G4double dl)
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