Loading...
Searching...
No Matches
Public Member Functions | Private Member Functions | Private Attributes | List of all members
Par01EMShowerModel Class Reference

#include <Doxymodules_parameterisations.h>

Inheritance diagram for Par01EMShowerModel:
G4VFastSimulationModel

Public Member Functions

 Par01EMShowerModel (G4String, G4Region *)
 
 Par01EMShowerModel (G4String)
 
 ~Par01EMShowerModel ()
 
virtual G4bool IsApplicable (const G4ParticleDefinition &)
 
virtual G4bool ModelTrigger (const G4FastTrack &)
 
virtual void DoIt (const G4FastTrack &, G4FastStep &)
 

Private Member Functions

void AssignSpotAndCallHit (const Par01EnergySpot &eSpot)
 
void FillFakeStep (const Par01EnergySpot &eSpot)
 
void Explode (const G4FastTrack &)
 
void BuildDetectorResponse ()
 

Private Attributes

G4StepfFakeStep
 
G4StepPointfFakePreStepPoint
 
G4StepPointfFakePostStepPoint
 
G4TouchableHandle fTouchableHandle
 
G4NavigatorfpNavigator
 
G4bool fNaviSetup
 
G4MaterialfCsI
 
std::vector< Par01EnergySpotfeSpotList
 

Detailed Description

Definition at line 21 of file Doxymodules_parameterisations.h.

Constructor & Destructor Documentation

◆ Par01EMShowerModel() [1/2]

Par01EMShowerModel::Par01EMShowerModel ( G4String  modelName,
G4Region envelope 
)

Definition at line 48 of file Par01EMShowerModel.cc.

49: G4VFastSimulationModel(modelName, envelope)
50{
51 fFakeStep = new G4Step();
52 fFakePreStepPoint = fFakeStep->GetPreStepPoint();
53 fFakePostStepPoint = fFakeStep->GetPostStepPoint();
56 fNaviSetup = false;
57 fCsI = nullptr;
58}
G4TouchableHandle fTouchableHandle
G4StepPoint * fFakePreStepPoint
G4StepPoint * fFakePostStepPoint

◆ Par01EMShowerModel() [2/2]

Par01EMShowerModel::Par01EMShowerModel ( G4String  modelName)

Definition at line 62 of file Par01EMShowerModel.cc.

63: G4VFastSimulationModel(modelName)
64{
65 fFakeStep = new G4Step();
66 fFakePreStepPoint = fFakeStep->GetPreStepPoint();
67 fFakePostStepPoint = fFakeStep->GetPostStepPoint();
70 fNaviSetup = false;
71 fCsI = nullptr;
72}

◆ ~Par01EMShowerModel()

Par01EMShowerModel::~Par01EMShowerModel ( )

Definition at line 76 of file Par01EMShowerModel.cc.

77{
78 delete fFakeStep;
79 delete fpNavigator;
80}

Member Function Documentation

◆ IsApplicable()

G4bool Par01EMShowerModel::IsApplicable ( const G4ParticleDefinition particleType)
virtual

Definition at line 84 of file Par01EMShowerModel.cc.

85{
86 return
87 &particleType == G4Electron::ElectronDefinition() ||
88 &particleType == G4Positron::PositronDefinition() ||
89 &particleType == G4Gamma::GammaDefinition();
90}

◆ ModelTrigger()

G4bool Par01EMShowerModel::ModelTrigger ( const G4FastTrack fastTrack)
virtual

Definition at line 94 of file Par01EMShowerModel.cc.

95{
96 // Applies the parameterisation above 100 MeV:
97 return fastTrack.GetPrimaryTrack()->GetKineticEnergy() > 100*MeV;
98}

◆ DoIt()

void Par01EMShowerModel::DoIt ( const G4FastTrack fastTrack,
G4FastStep fastStep 
)
virtual

Definition at line 102 of file Par01EMShowerModel.cc.

104{
105 // Kill the parameterised particle:
106 fastStep.KillPrimaryTrack();
107 fastStep.ProposePrimaryTrackPathLength(0.0);
108 fastStep.ProposeTotalEnergyDeposited(fastTrack.GetPrimaryTrack()->GetKineticEnergy());
109
110 // split into "energy spots" energy according to the shower shape:
111 Explode(fastTrack);
112
113 // and put those energy spots into the crystals:
115
116}
void Explode(const G4FastTrack &)

◆ AssignSpotAndCallHit()

void Par01EMShowerModel::AssignSpotAndCallHit ( const Par01EnergySpot eSpot)
private

Definition at line 212 of file Par01EMShowerModel.cc.

213{
214 //
215 // "converts" the energy spot into the fake
216 // G4Step to pass to sensitive detector:
217 //
218 FillFakeStep(eSpot);
219
220 //
221 // call sensitive part: taken/adapted from the stepping:
222 // Send G4Step information to Hit/Dig if the volume is sensitive
223 //
224 G4VPhysicalVolume* pCurrentVolume =
225 fFakeStep->GetPreStepPoint()->GetPhysicalVolume();
226 G4VSensitiveDetector* pSensitive;
227
228 if( pCurrentVolume != nullptr )
229 {
230 pSensitive = pCurrentVolume->GetLogicalVolume()->
231 GetSensitiveDetector();
232 if( pSensitive != nullptr )
233 {
234 pSensitive->Hit(fFakeStep);
235 }
236 }
237}
void FillFakeStep(const Par01EnergySpot &eSpot)

◆ FillFakeStep()

void Par01EMShowerModel::FillFakeStep ( const Par01EnergySpot eSpot)
private

Definition at line 241 of file Par01EMShowerModel.cc.

242{
243 //-----------------------------------------------------------
244 // find in which volume the spot is.
245 //-----------------------------------------------------------
246 if (!fNaviSetup)
247 {
249 SetWorldVolume(G4TransportationManager::GetTransportationManager()->
250 GetNavigatorForTracking()->GetWorldVolume());
252 LocateGlobalPointAndUpdateTouchableHandle(eSpot.GetPosition(),
253 G4ThreeVector(0.,0.,0.),
255 false);
256 fNaviSetup = true;
257 }
258 else
259 {
261 LocateGlobalPointAndUpdateTouchableHandle(eSpot.GetPosition(),
262 G4ThreeVector(0.,0.,0.),
264 }
265 //--------------------------------------
266 // Fills attribute of the G4Step needed
267 // by our sensitive detector:
268 //-------------------------------------
269 // set touchable volume at PreStepPoint:
270 fFakePreStepPoint->SetTouchableHandle(fTouchableHandle);
271 // set total energy deposit:
272 fFakeStep->SetTotalEnergyDeposit(eSpot.GetEnergy());
273}
G4double GetEnergy() const
G4ThreeVector GetPosition() const

◆ Explode()

void Par01EMShowerModel::Explode ( const G4FastTrack fastTrack)
private

Definition at line 120 of file Par01EMShowerModel.cc.

121{
122 //-----------------------------------------------------
123 //
124 //-----------------------------------------------------
125
126 // Reduced quantities:
127 // -- critical energy in CsI:
128 G4double Ec = 800*MeV/(54. + 1.2); // 54 = mean Z of CsI
129 G4double Energy = fastTrack.GetPrimaryTrack()->GetKineticEnergy();
130 G4double y = Energy/Ec;
131
132 // compute value of parameter "a" of longitudinal profile, b assumed = 0.5
133 G4double a, tmax, b(0.5), C;
134 if (fastTrack.GetPrimaryTrack()->GetDefinition() == G4Gamma::GammaDefinition()) C = 0.5;
135 else C = -0.5;
136 tmax = 1.0 * (std::log(y) + C);
137 a = 1.0 + b*tmax;
138
139 // t : reduced quantity = z/X0:
140 G4double t, bt;
141 if ( fCsI == nullptr ) fCsI = G4NistManager::Instance()->FindOrBuildMaterial("G4_CESIUM_IODIDE");
142 G4double X0 = fCsI->GetRadlen();
143 // Moliere radius:
144 G4double Es = 21*MeV;
145 G4double Rm = X0*Es/Ec;
146
147 // axis of the shower, in global reference frame:
148 G4ThreeVector xShower, yShower, zShower;
149 zShower = fastTrack.GetPrimaryTrack()->GetMomentumDirection();
150 xShower = zShower.orthogonal();
151 yShower = zShower.cross(xShower);
152 // starting point of the shower:
153 G4ThreeVector sShower = fastTrack.GetPrimaryTrack()->GetPosition();
154
155 // We shoot 100 spots of energy:
156 G4int nSpots = 100;
157 G4double deposit = Energy/double(nSpots);
158 Par01EnergySpot eSpot;
159 eSpot.SetEnergy(deposit);
160 G4ThreeVector ePoint;
161 G4double z, r, phi;
162
163 feSpotList.clear();
164 for (int i = 0; i < nSpots; i++)
165 {
166 // Longitudinal profile:
167 // -- shoot z according to Gamma distribution:
168 bt = G4RandGamma::shoot(a,1.0);
169 t = bt/b;
170 z = t*X0;
171
172 // transverse profile:
173 // we set 90% of energy in one Rm,
174 // the rest between 1 and 3.5 Rm:
175 G4double xr = G4UniformRand();
176 if (xr < 0.9) r = xr/0.9*Rm;
177 else r = ((xr - 0.9)/0.1*2.5 + 1.0)*Rm;
178 phi = G4UniformRand()*twopi;
179
180 // build the position:
181 ePoint = sShower +
182 z*zShower +
183 r*std::cos(phi)*xShower + r*std::sin(phi)*yShower;
184
185 // and the energy spot:
186 eSpot.SetPosition(ePoint);
187
188 // Records the eSpot:
189 feSpotList.push_back(eSpot);
190 }
191}
std::vector< ExP01TrackerHit * > a
std::vector< Par01EnergySpot > feSpotList
void SetEnergy(const G4double &E)
void SetPosition(const G4ThreeVector &point)

◆ BuildDetectorResponse()

void Par01EMShowerModel::BuildDetectorResponse ( )
private

Definition at line 195 of file Par01EMShowerModel.cc.

196{
197 // Does the assignation of the energy spots to the sensitive volumes:
198 for (size_t i = 0; i < feSpotList.size(); i++)
199 {
200 // Draw the energy spot:
201 // feSpotList[i].Draw();
202 // feSpotList[i].Print();
203
204 // "converts" the energy spot into the fake
205 // G4Step to pass to sensitive detector:
207 }
208}
void AssignSpotAndCallHit(const Par01EnergySpot &eSpot)

Member Data Documentation

◆ fFakeStep

G4Step* Par01EMShowerModel::fFakeStep
private

Definition at line 76 of file Par01EMShowerModel.hh.

◆ fFakePreStepPoint

G4StepPoint* Par01EMShowerModel::fFakePreStepPoint
private

Definition at line 77 of file Par01EMShowerModel.hh.

◆ fFakePostStepPoint

G4StepPoint * Par01EMShowerModel::fFakePostStepPoint
private

Definition at line 77 of file Par01EMShowerModel.hh.

◆ fTouchableHandle

G4TouchableHandle Par01EMShowerModel::fTouchableHandle
private

Definition at line 78 of file Par01EMShowerModel.hh.

◆ fpNavigator

G4Navigator* Par01EMShowerModel::fpNavigator
private

Definition at line 79 of file Par01EMShowerModel.hh.

◆ fNaviSetup

G4bool Par01EMShowerModel::fNaviSetup
private

Definition at line 80 of file Par01EMShowerModel.hh.

◆ fCsI

G4Material* Par01EMShowerModel::fCsI
private

Definition at line 81 of file Par01EMShowerModel.hh.

◆ feSpotList

std::vector<Par01EnergySpot> Par01EMShowerModel::feSpotList
private

Definition at line 83 of file Par01EMShowerModel.hh.


The documentation for this class was generated from the following files:

Applications | User Support | Publications | Collaboration