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

#include <Doxymodules_parameterisations.h>

Inheritance diagram for Par01PionShowerModel:
G4VFastSimulationModel

Public Member Functions

 Par01PionShowerModel (G4String, G4Region *)
 
 Par01PionShowerModel (G4String)
 
 ~Par01PionShowerModel ()
 
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
 
std::vector< Par01EnergySpotfeSpotList
 

Detailed Description

Definition at line 25 of file Doxymodules_parameterisations.h.

Constructor & Destructor Documentation

◆ Par01PionShowerModel() [1/2]

Par01PionShowerModel::Par01PionShowerModel ( G4String  modelName,
G4Region envelope 
)

Definition at line 48 of file Par01PionShowerModel.cc.

◆ Par01PionShowerModel() [2/2]

Par01PionShowerModel::Par01PionShowerModel ( G4String  modelName)

Definition at line 61 of file Par01PionShowerModel.cc.

62: G4VFastSimulationModel(modelName)
63{
64 fFakeStep = new G4Step();
65 fFakePreStepPoint = fFakeStep->GetPreStepPoint();
66 fFakePostStepPoint = fFakeStep->GetPostStepPoint();
69 fNaviSetup = false;
70}

◆ ~Par01PionShowerModel()

Par01PionShowerModel::~Par01PionShowerModel ( )

Definition at line 74 of file Par01PionShowerModel.cc.

75{
76 delete fFakeStep;
77 delete fpNavigator;
78}

Member Function Documentation

◆ IsApplicable()

G4bool Par01PionShowerModel::IsApplicable ( const G4ParticleDefinition particleType)
virtual

Definition at line 82 of file Par01PionShowerModel.cc.

83{
84 return
85 &particleType == G4PionMinus::PionMinusDefinition() ||
86 &particleType == G4PionPlus::PionPlusDefinition();
87}

◆ ModelTrigger()

G4bool Par01PionShowerModel::ModelTrigger ( const G4FastTrack )
virtual

Definition at line 91 of file Par01PionShowerModel.cc.

92{
93 // Applies the parameterisation always:
94 // ie as soon as the pion enters the envelope
95 return true;
96}

◆ DoIt()

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

Definition at line 100 of file Par01PionShowerModel.cc.

102{
103 // G4cout << "Par01PionShowerModel::DoIt" << G4endl;
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}
void Explode(const G4FastTrack &)

◆ AssignSpotAndCallHit()

void Par01PionShowerModel::AssignSpotAndCallHit ( const Par01EnergySpot eSpot)
private

Definition at line 189 of file Par01PionShowerModel.cc.

190{
191 //
192 // "converts" the energy spot into the fake
193 // G4Step to pass to sensitive detector:
194 //
195 FillFakeStep(eSpot);
196
197 //
198 // call sensitive part: taken/adapted from the stepping:
199 // Send G4Step information to Hit/Dig if the volume is sensitive
200 //
201 G4VPhysicalVolume* pCurrentVolume =
202 fFakeStep->GetPreStepPoint()->GetPhysicalVolume();
203 G4VSensitiveDetector* pSensitive;
204
205 if( pCurrentVolume != nullptr )
206 {
207 pSensitive = pCurrentVolume->GetLogicalVolume()->
208 GetSensitiveDetector();
209 if( pSensitive != nullptr )
210 {
211 pSensitive->Hit(fFakeStep);
212 }
213 }
214}
void FillFakeStep(const Par01EnergySpot &eSpot)

◆ FillFakeStep()

void Par01PionShowerModel::FillFakeStep ( const Par01EnergySpot eSpot)
private

Definition at line 218 of file Par01PionShowerModel.cc.

219{
220 //-----------------------------------------------------------
221 // find in which volume the spot is.
222 //-----------------------------------------------------------
223 if (!fNaviSetup)
224 {
226 SetWorldVolume(G4TransportationManager::GetTransportationManager()->
227 GetNavigatorForTracking()->GetWorldVolume());
229 LocateGlobalPointAndUpdateTouchableHandle(eSpot.GetPosition(),
230 G4ThreeVector(0.,0.,0.),
232 false);
233 fNaviSetup = true;
234 }
235 else
236 {
238 LocateGlobalPointAndUpdateTouchableHandle(eSpot.GetPosition(),
239 G4ThreeVector(0.,0.,0.),
241 }
242 //--------------------------------------
243 // Fills attribute of the G4Step needed
244 // by our sensitive detector:
245 //-------------------------------------
246 // set touchable volume at PreStepPoint:
247 fFakePreStepPoint->SetTouchableHandle(fTouchableHandle);
248 // set total energy deposit:
249 fFakeStep->SetTotalEnergyDeposit(eSpot.GetEnergy());
250}
G4double GetEnergy() const
G4ThreeVector GetPosition() const

◆ Explode()

void Par01PionShowerModel::Explode ( const G4FastTrack fastTrack)
private

Definition at line 119 of file Par01PionShowerModel.cc.

120{
121 //-----------------------------------------------------
122 // Non-physical shower generated: exp along z and
123 // transverse.
124 //-----------------------------------------------------
125
126 // center of the shower, we put at the middle of the ghost:
127 G4ThreeVector showerCenter;
128 G4double distOut;
129 distOut = fastTrack.GetEnvelopeSolid()->
130 DistanceToOut(fastTrack.GetPrimaryTrackLocalPosition(),
131 fastTrack.GetPrimaryTrackLocalDirection());
132 showerCenter = fastTrack.GetPrimaryTrackLocalPosition() +
133 (distOut/2.)*fastTrack.GetPrimaryTrackLocalDirection();
134
135 showerCenter = fastTrack.GetInverseAffineTransformation()->
136 TransformPoint(showerCenter);
137
138 // axis of the shower, in global reference frame:
139 G4ThreeVector xShower, yShower, zShower;
140 zShower = fastTrack.GetPrimaryTrack()->GetMomentumDirection();
141 xShower = zShower.orthogonal();
142 yShower = zShower.cross(xShower);
143
144 // shoot the energy spots:
145 G4double Energy = fastTrack.GetPrimaryTrack()->GetKineticEnergy();
146 G4int nSpot = 50;
147 G4double deposit = Energy/double(nSpot);
148 Par01EnergySpot eSpot;
149 eSpot.SetEnergy(deposit);
150 G4ThreeVector ePoint;
151
152 // clear the spot list before use
153 feSpotList.clear();
154
155 G4double z, r, phi;
156 for (int i = 0; i < nSpot; i++)
157 {
158 z = G4RandGauss::shoot(0,20*cm);
159 r = G4RandGauss::shoot(0,10*cm);
160 phi = G4UniformRand()*twopi;
161 ePoint = showerCenter +
162 z*zShower +
163 r*std::cos(phi)*xShower + r*std::sin(phi)*yShower;
164 eSpot.SetPosition(ePoint);
165 feSpotList.push_back(eSpot);
166 }
167}
void SetEnergy(const G4double &E)
void SetPosition(const G4ThreeVector &point)
std::vector< Par01EnergySpot > feSpotList

◆ BuildDetectorResponse()

void Par01PionShowerModel::BuildDetectorResponse ( )
private

Definition at line 171 of file Par01PionShowerModel.cc.

172{
173 // Does the assignation of the energy spots to the sensitive volumes:
174 for (size_t i = 0; i < feSpotList.size(); i++)
175 {
176 // Draw the energy spot:
177 // G4Colour red(1.,0.,0.);
178 // feSpotList[i].Draw(&red);
179 // feSpotList[i].Print();
180
181 // "converts" the energy spot into the fake
182 // G4Step to pass to sensitive detector:
184 }
185}
void AssignSpotAndCallHit(const Par01EnergySpot &eSpot)

Member Data Documentation

◆ fFakeStep

G4Step* Par01PionShowerModel::fFakeStep
private

Definition at line 74 of file Par01PionShowerModel.hh.

◆ fFakePreStepPoint

G4StepPoint* Par01PionShowerModel::fFakePreStepPoint
private

Definition at line 75 of file Par01PionShowerModel.hh.

◆ fFakePostStepPoint

G4StepPoint * Par01PionShowerModel::fFakePostStepPoint
private

Definition at line 75 of file Par01PionShowerModel.hh.

◆ fTouchableHandle

G4TouchableHandle Par01PionShowerModel::fTouchableHandle
private

Definition at line 76 of file Par01PionShowerModel.hh.

◆ fpNavigator

G4Navigator* Par01PionShowerModel::fpNavigator
private

Definition at line 77 of file Par01PionShowerModel.hh.

◆ fNaviSetup

G4bool Par01PionShowerModel::fNaviSetup
private

Definition at line 78 of file Par01PionShowerModel.hh.

◆ feSpotList

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

Definition at line 80 of file Par01PionShowerModel.hh.


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

Applications | User Support | Publications | Collaboration