Geant4  10.02.p03
Par01EMShowerModel Class Reference

#include <Par01EMShowerModel.hh>

Inheritance diagram for Par01EMShowerModel:
Collaboration diagram for Par01EMShowerModel:

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 &)
 
- Public Member Functions inherited from G4VFastSimulationModel
 G4VFastSimulationModel (const G4String &aName)
 
 G4VFastSimulationModel (const G4String &aName, G4Envelope *, G4bool IsUnique=FALSE)
 
virtual ~G4VFastSimulationModel ()
 
virtual G4bool AtRestModelTrigger (const G4FastTrack &)
 
virtual void AtRestDoIt (const G4FastTrack &, G4FastStep &)
 
const G4String GetName () const
 
G4bool operator== (const G4VFastSimulationModel &) const
 

Private Member Functions

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

Private Attributes

G4Step * fFakeStep
 
G4StepPoint * fFakePreStepPoint
 
G4StepPoint * fFakePostStepPoint
 
G4TouchableHandle fTouchableHandle
 
G4NavigatorfpNavigator
 
G4bool fNaviSetup
 
G4MaterialfCsI
 
std::vector< Par01EnergySpotfeSpotList
 

Detailed Description

Definition at line 45 of file Par01EMShowerModel.hh.

Constructor & Destructor Documentation

◆ Par01EMShowerModel() [1/2]

Par01EMShowerModel::Par01EMShowerModel ( G4String  modelName,
G4Region envelope 
)

Definition at line 44 of file Par01EMShowerModel.cc.

45 : G4VFastSimulationModel(modelName, envelope)
46 {
47  fFakeStep = new G4Step();
48  fFakePreStepPoint = fFakeStep->GetPreStepPoint();
49  fFakePostStepPoint = fFakeStep->GetPostStepPoint();
51  fpNavigator = new G4Navigator();
52  fNaviSetup = false;
53  fCsI = 0;
54 }
G4StepPoint * fFakePostStepPoint
G4Navigator * fpNavigator
G4VFastSimulationModel(const G4String &aName)
G4TouchableHandle fTouchableHandle
G4StepPoint * fFakePreStepPoint

◆ Par01EMShowerModel() [2/2]

Par01EMShowerModel::Par01EMShowerModel ( G4String  modelName)

Definition at line 56 of file Par01EMShowerModel.cc.

57 : G4VFastSimulationModel(modelName)
58 {
59  fFakeStep = new G4Step();
60  fFakePreStepPoint = fFakeStep->GetPreStepPoint();
61  fFakePostStepPoint = fFakeStep->GetPostStepPoint();
63  fpNavigator = new G4Navigator();
64  fNaviSetup = false;
65  fCsI = 0;
66 }
G4StepPoint * fFakePostStepPoint
G4Navigator * fpNavigator
G4VFastSimulationModel(const G4String &aName)
G4TouchableHandle fTouchableHandle
G4StepPoint * fFakePreStepPoint

◆ ~Par01EMShowerModel()

Par01EMShowerModel::~Par01EMShowerModel ( )

Definition at line 68 of file Par01EMShowerModel.cc.

69 {
70  delete fFakeStep;
71  delete fpNavigator;
72 }
G4Navigator * fpNavigator

Member Function Documentation

◆ AssignSpotAndCallHit()

void Par01EMShowerModel::AssignSpotAndCallHit ( const Par01EnergySpot eSpot)
private

Definition at line 194 of file Par01EMShowerModel.cc.

195 {
196  //
197  // "converts" the energy spot into the fake
198  // G4Step to pass to sensitive detector:
199  //
200  FillFakeStep(eSpot);
201 
202  //
203  // call sensitive part: taken/adapted from the stepping:
204  // Send G4Step information to Hit/Dig if the volume is sensitive
205  //
206  G4VPhysicalVolume* pCurrentVolume =
207  fFakeStep->GetPreStepPoint()->GetPhysicalVolume();
208  G4VSensitiveDetector* pSensitive;
209 
210  if( pCurrentVolume != 0 )
211  {
212  pSensitive = pCurrentVolume->GetLogicalVolume()->
213  GetSensitiveDetector();
214  if( pSensitive != 0 )
215  {
216  pSensitive->Hit(fFakeStep);
217  }
218  }
219 }
void FillFakeStep(const Par01EnergySpot &eSpot)
G4bool Hit(G4Step *aStep)
G4LogicalVolume * GetLogicalVolume() const
Here is the call graph for this function:
Here is the caller graph for this function:

◆ BuildDetectorResponse()

void Par01EMShowerModel::BuildDetectorResponse ( )
private

Definition at line 178 of file Par01EMShowerModel.cc.

179 {
180  // Does the assignation of the energy spots to the sensitive volumes:
181  for (size_t i = 0; i < feSpotList.size(); i++)
182  {
183  // Draw the energy spot:
184  feSpotList[i].Draw();
185  // feSpotList[i].Print();
186 
187  // "converts" the energy spot into the fake
188  // G4Step to pass to sensitive detector:
190  }
191 }
void AssignSpotAndCallHit(const Par01EnergySpot &eSpot)
std::vector< Par01EnergySpot > feSpotList
Here is the call graph for this function:
Here is the caller graph for this function:

◆ DoIt()

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

Implements G4VFastSimulationModel.

Definition at line 88 of file Par01EMShowerModel.cc.

90 {
91  // Kill the parameterised particle:
92  fastStep.KillPrimaryTrack();
93  fastStep.ProposePrimaryTrackPathLength(0.0);
94  fastStep.ProposeTotalEnergyDeposited(fastTrack.GetPrimaryTrack()->GetKineticEnergy());
95 
96  // split into "energy spots" energy according to the shower shape:
97  Explode(fastTrack);
98 
99  // and put those energy spots into the crystals:
101 
102 }
void Explode(const G4FastTrack &)
void ProposePrimaryTrackPathLength(G4double)
void ProposeTotalEnergyDeposited(G4double anEnergyPart)
void KillPrimaryTrack()
Definition: G4FastStep.cc:87
const G4Track * GetPrimaryTrack() const
Definition: G4FastTrack.hh:208
Here is the call graph for this function:

◆ Explode()

void Par01EMShowerModel::Explode ( const G4FastTrack fastTrack)
private

Definition at line 104 of file Par01EMShowerModel.cc.

105 {
106  //-----------------------------------------------------
107  //
108  //-----------------------------------------------------
109 
110  // Reduced quantities:
111  // -- critical energy in CsI:
112  G4double Ec = 800*MeV/(54. + 1.2); // 54 = mean Z of CsI
113  G4double Energy = fastTrack.GetPrimaryTrack()->GetKineticEnergy();
114  G4double y = Energy/Ec;
115 
116  // compute value of parameter "a" of longitudinal profile, b assumed = 0.5
117  G4double a, tmax, b(0.5), C;
118  if (fastTrack.GetPrimaryTrack()->GetDefinition() == G4Gamma::GammaDefinition()) C = 0.5;
119  else C = -0.5;
120  tmax = 1.0 * (std::log(y) + C);
121  a = 1.0 + b*tmax;
122 
123  // t : reduced quantity = z/X0:
124  G4double t, bt;
125  if ( fCsI == 0 ) fCsI = G4NistManager::Instance()->FindOrBuildMaterial("G4_CESIUM_IODIDE");
126  G4double X0 = fCsI->GetRadlen();
127  // Moliere radius:
128  G4double Es = 21*MeV;
129  G4double Rm = X0*Es/Ec;
130 
131  // axis of the shower, in global reference frame:
132  G4ThreeVector xShower, yShower, zShower;
133  zShower = fastTrack.GetPrimaryTrack()->GetMomentumDirection();
134  xShower = zShower.orthogonal();
135  yShower = zShower.cross(xShower);
136  // starting point of the shower:
137  G4ThreeVector sShower = fastTrack.GetPrimaryTrack()->GetPosition();
138 
139  // We shoot 100 spots of energy:
140  G4int nSpots = 100;
141  G4double deposit = Energy/double(nSpots);
142  Par01EnergySpot eSpot;
143  eSpot.SetEnergy(deposit);
144  G4ThreeVector ePoint;
145  G4double z, r, phi;
146 
147  feSpotList.clear();
148  for (int i = 0; i < nSpots; i++)
149  {
150  // Longitudinal profile:
151  // -- shoot z according to Gamma distribution:
152  bt = G4RandGamma::shoot(a,1.0);
153  t = bt/b;
154  z = t*X0;
155 
156  // transverse profile:
157  // we set 90% of energy in one Rm,
158  // the rest between 1 and 3.5 Rm:
159  G4double xr = G4UniformRand();
160  if (xr < 0.9) r = xr/0.9*Rm;
161  else r = ((xr - 0.9)/0.1*2.5 + 1.0)*Rm;
162  phi = G4UniformRand()*twopi;
163 
164  // build the position:
165  ePoint = sShower +
166  z*zShower +
167  r*std::cos(phi)*xShower + r*std::sin(phi)*yShower;
168 
169  // and the energy spot:
170  eSpot.SetPosition(ePoint);
171 
172  // Records the eSpot:
173  feSpotList.push_back(eSpot);
174  }
175 }
void SetPosition(const G4ThreeVector &point)
ThreeVector shoot(const G4int Ap, const G4int Af)
G4Material * FindOrBuildMaterial(const G4String &name, G4bool isotopes=true, G4bool warning=false)
static const double MeV
Definition: G4SIunits.hh:211
double C(double temp)
int G4int
Definition: G4Types.hh:78
static G4NistManager * Instance()
Double_t y
#define G4UniformRand()
Definition: Randomize.hh:97
Hep3Vector cross(const Hep3Vector &) const
static const double twopi
Definition: G4SIunits.hh:75
Hep3Vector orthogonal() const
void SetEnergy(const G4double &E)
const G4Track * GetPrimaryTrack() const
Definition: G4FastTrack.hh:208
double G4double
Definition: G4Types.hh:76
G4double GetRadlen() const
Definition: G4Material.hh:220
std::vector< Par01EnergySpot > feSpotList
static G4Gamma * GammaDefinition()
Definition: G4Gamma.cc:81
Here is the call graph for this function:
Here is the caller graph for this function:

◆ FillFakeStep()

void Par01EMShowerModel::FillFakeStep ( const Par01EnergySpot eSpot)
private

Definition at line 222 of file Par01EMShowerModel.cc.

223 {
224  //-----------------------------------------------------------
225  // find in which volume the spot is.
226  //-----------------------------------------------------------
227  if (!fNaviSetup)
228  {
229  fpNavigator->
231  GetNavigatorForTracking()->GetWorldVolume());
232  fpNavigator->
233  LocateGlobalPointAndUpdateTouchableHandle(eSpot.GetPosition(),
234  G4ThreeVector(0.,0.,0.),
236  false);
237  fNaviSetup = true;
238  }
239  else
240  {
241  fpNavigator->
242  LocateGlobalPointAndUpdateTouchableHandle(eSpot.GetPosition(),
243  G4ThreeVector(0.,0.,0.),
245  }
246  //--------------------------------------
247  // Fills attribute of the G4Step needed
248  // by our sensitive detector:
249  //-------------------------------------
250  // set touchable volume at PreStepPoint:
251  fFakePreStepPoint->SetTouchableHandle(fTouchableHandle);
252  // set total energy deposit:
253  fFakeStep->SetTotalEnergyDeposit(eSpot.GetEnergy());
254 }
CLHEP::Hep3Vector G4ThreeVector
G4Navigator * fpNavigator
static G4TransportationManager * GetTransportationManager()
G4ThreeVector GetPosition() const
G4TouchableHandle fTouchableHandle
G4StepPoint * fFakePreStepPoint
G4double GetEnergy() const
Here is the call graph for this function:
Here is the caller graph for this function:

◆ IsApplicable()

G4bool Par01EMShowerModel::IsApplicable ( const G4ParticleDefinition particleType)
virtual

Implements G4VFastSimulationModel.

Definition at line 74 of file Par01EMShowerModel.cc.

75 {
76  return
77  &particleType == G4Electron::ElectronDefinition() ||
78  &particleType == G4Positron::PositronDefinition() ||
79  &particleType == G4Gamma::GammaDefinition();
80 }
static G4Electron * ElectronDefinition()
Definition: G4Electron.cc:89
static G4Positron * PositronDefinition()
Definition: G4Positron.cc:89
static G4Gamma * GammaDefinition()
Definition: G4Gamma.cc:81
Here is the call graph for this function:

◆ ModelTrigger()

G4bool Par01EMShowerModel::ModelTrigger ( const G4FastTrack fastTrack)
virtual

Implements G4VFastSimulationModel.

Definition at line 82 of file Par01EMShowerModel.cc.

83 {
84  // Applies the parameterisation above 100 MeV:
85  return fastTrack.GetPrimaryTrack()->GetKineticEnergy() > 100*MeV;
86 }
static const double MeV
Definition: G4SIunits.hh:211
const G4Track * GetPrimaryTrack() const
Definition: G4FastTrack.hh:208
Here is the call graph for this function:

Member Data Documentation

◆ fCsI

G4Material* Par01EMShowerModel::fCsI
private

Definition at line 79 of file Par01EMShowerModel.hh.

◆ feSpotList

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

Definition at line 81 of file Par01EMShowerModel.hh.

◆ fFakePostStepPoint

G4StepPoint * Par01EMShowerModel::fFakePostStepPoint
private

Definition at line 75 of file Par01EMShowerModel.hh.

◆ fFakePreStepPoint

G4StepPoint* Par01EMShowerModel::fFakePreStepPoint
private

Definition at line 75 of file Par01EMShowerModel.hh.

◆ fFakeStep

G4Step* Par01EMShowerModel::fFakeStep
private

Definition at line 74 of file Par01EMShowerModel.hh.

◆ fNaviSetup

G4bool Par01EMShowerModel::fNaviSetup
private

Definition at line 78 of file Par01EMShowerModel.hh.

◆ fpNavigator

G4Navigator* Par01EMShowerModel::fpNavigator
private

Definition at line 77 of file Par01EMShowerModel.hh.

◆ fTouchableHandle

G4TouchableHandle Par01EMShowerModel::fTouchableHandle
private

Definition at line 76 of file Par01EMShowerModel.hh.


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