Geant4 Cross Reference |
1 // 1 // 2 // ******************************************* 2 // ******************************************************************** 3 // * License and Disclaimer 3 // * License and Disclaimer * 4 // * 4 // * * 5 // * The Geant4 software is copyright of th 5 // * The Geant4 software is copyright of the Copyright Holders of * 6 // * the Geant4 Collaboration. It is provided 6 // * the Geant4 Collaboration. It is provided under the terms and * 7 // * conditions of the Geant4 Software License 7 // * conditions of the Geant4 Software License, included in the file * 8 // * LICENSE and available at http://cern.ch/ 8 // * LICENSE and available at http://cern.ch/geant4/license . These * 9 // * include a list of copyright holders. 9 // * include a list of copyright holders. * 10 // * 10 // * * 11 // * Neither the authors of this software syst 11 // * Neither the authors of this software system, nor their employing * 12 // * institutes,nor the agencies providing fin 12 // * institutes,nor the agencies providing financial support for this * 13 // * work make any representation or warran 13 // * work make any representation or warranty, express or implied, * 14 // * regarding this software system or assum 14 // * regarding this software system or assume any liability for its * 15 // * use. Please see the license in the file 15 // * use. Please see the license in the file LICENSE and URL above * 16 // * for the full disclaimer and the limitatio 16 // * for the full disclaimer and the limitation of liability. * 17 // * 17 // * * 18 // * This code implementation is the result 18 // * This code implementation is the result of the scientific and * 19 // * technical work of the GEANT4 collaboratio 19 // * technical work of the GEANT4 collaboration. * 20 // * By using, copying, modifying or distri 20 // * By using, copying, modifying or distributing the software (or * 21 // * any work based on the software) you ag 21 // * any work based on the software) you agree to acknowledge its * 22 // * use in resulting scientific publicati 22 // * use in resulting scientific publications, and indicate your * 23 // * acceptance of all terms of the Geant4 Sof 23 // * acceptance of all terms of the Geant4 Software license. * 24 // ******************************************* 24 // ******************************************************************** 25 // 25 // >> 26 // $Id: GFlashShowerModel.cc,v 1.13 2006/06/29 19:14:22 gunter Exp $ >> 27 // GEANT4 tag $Name: geant4-09-02 $ 26 // 28 // 27 // 29 // 28 // ------------------------------------------- 30 // ------------------------------------------------------------ 29 // GEANT 4 class implementation 31 // GEANT 4 class implementation 30 // 32 // 31 // ---------------- GFlashShowerModel --- 33 // ---------------- GFlashShowerModel ---------------- 32 // 34 // 33 // Authors: E.Barberio & Joanna Weng - 9.11.20 35 // Authors: E.Barberio & Joanna Weng - 9.11.2004 34 // ------------------------------------------- 36 // ------------------------------------------------------------ 35 37 36 #include "G4Electron.hh" 38 #include "G4Electron.hh" 37 #include "G4Positron.hh" 39 #include "G4Positron.hh" 38 #include "G4NeutrinoE.hh" 40 #include "G4NeutrinoE.hh" 39 #include "G4NeutrinoMu.hh" 41 #include "G4NeutrinoMu.hh" 40 #include "G4NeutrinoTau.hh" 42 #include "G4NeutrinoTau.hh" 41 #include "G4AntiNeutrinoE.hh" 43 #include "G4AntiNeutrinoE.hh" 42 #include "G4AntiNeutrinoMu.hh" 44 #include "G4AntiNeutrinoMu.hh" 43 #include "G4AntiNeutrinoTau.hh" 45 #include "G4AntiNeutrinoTau.hh" 44 #include "G4PionZero.hh" 46 #include "G4PionZero.hh" 45 #include "G4VProcess.hh" 47 #include "G4VProcess.hh" 46 #include "G4ios.hh" 48 #include "G4ios.hh" 47 #include "G4LogicalVolume.hh" 49 #include "G4LogicalVolume.hh" 48 #include "geomdefs.hh" 50 #include "geomdefs.hh" 49 51 50 #include "GFlashShowerModel.hh" 52 #include "GFlashShowerModel.hh" 51 #include "GFlashHomoShowerParameterisation.hh" 53 #include "GFlashHomoShowerParameterisation.hh" 52 #include "GFlashSamplingShowerParameterisation 54 #include "GFlashSamplingShowerParameterisation.hh" 53 #include "GFlashEnergySpot.hh" 55 #include "GFlashEnergySpot.hh" 54 56 55 GFlashShowerModel::GFlashShowerModel(G4String << 57 56 : G4VFastSimulationModel(modelName, envelope << 58 GFlashShowerModel::GFlashShowerModel(G4String modelName, >> 59 G4Envelope* envelope) >> 60 : G4VFastSimulationModel(modelName, envelope), >> 61 PBound(0), Parameterisation(0), HMaker(0) 57 { 62 { 58 FlagParamType = 0; << 63 FlagParamType = 0; 59 FlagParticleContainment = 1; << 64 FlagParticleContainment = 1; 60 StepInX0 = 0.1; 65 StepInX0 = 0.1; 61 EnergyStop = 0.0; << 66 Messenger = new GFlashShowerModelMessenger(this); 62 Messenger = new GFlashShowerModelMessenger(t << 63 } 67 } 64 68 65 GFlashShowerModel::GFlashShowerModel(G4String 69 GFlashShowerModel::GFlashShowerModel(G4String modelName) 66 : G4VFastSimulationModel(modelName), PBound( << 70 : G4VFastSimulationModel(modelName), >> 71 PBound(0), Parameterisation(0), HMaker(0) 67 { 72 { 68 FlagParamType = 1; << 73 FlagParamType =1; 69 FlagParticleContainment = 1; << 74 FlagParticleContainment = 1; 70 StepInX0 = 0.1; << 75 StepInX0 = 0.1; 71 EnergyStop = 0.0; << 76 Messenger = new GFlashShowerModelMessenger(this); 72 Messenger = new GFlashShowerModelMessenger(t << 73 } 77 } 74 78 75 GFlashShowerModel::~GFlashShowerModel() 79 GFlashShowerModel::~GFlashShowerModel() 76 { 80 { 77 delete Messenger; 81 delete Messenger; 78 } 82 } 79 83 80 G4bool GFlashShowerModel::IsApplicable(const G << 84 G4bool 81 { << 85 GFlashShowerModel::IsApplicable(const G4ParticleDefinition& particleType) 82 return &particleType == G4Electron::Electron << 86 { 83 || &particleType == G4Positron::Posit << 87 return >> 88 &particleType == G4Electron::ElectronDefinition() || >> 89 &particleType == G4Positron::PositronDefinition(); 84 } 90 } 85 91 86 /********************************************* 92 /**********************************************************************/ 87 /* Checks whether conditions of fast parameter 93 /* Checks whether conditions of fast parameterisation are fullfilled */ 88 /********************************************* 94 /**********************************************************************/ 89 95 90 G4bool GFlashShowerModel::ModelTrigger(const G << 96 G4bool GFlashShowerModel::ModelTrigger(const G4FastTrack & fastTrack ) 91 97 92 { 98 { 93 G4bool select = false; 99 G4bool select = false; 94 if (FlagParamType != 0) { << 100 if(FlagParamType != 0) 95 G4double ParticleEnergy = fastTrack.GetPri << 101 { 96 G4ParticleDefinition& ParticleType = *(fas << 102 G4double ParticleEnergy = fastTrack.GetPrimaryTrack()->GetKineticEnergy(); 97 if (ParticleEnergy > PBound->GetMinEneToPa << 103 G4ParticleDefinition &ParticleType = 98 && ParticleEnergy < PBound->GetMaxEneT << 104 *(fastTrack.GetPrimaryTrack()->GetDefinition()); >> 105 if(ParticleEnergy > PBound->GetMinEneToParametrise(ParticleType) || >> 106 ParticleEnergy < PBound->GetMaxEneToParametrise(ParticleType) ) 99 { 107 { 100 // check conditions depending on particl 108 // check conditions depending on particle flavour 101 // performance to be optimized @@@@@@@ 109 // performance to be optimized @@@@@@@ 102 Parameterisation->GenerateLongitudinalPr 110 Parameterisation->GenerateLongitudinalProfile(ParticleEnergy); 103 select = CheckParticleDefAndContainment( << 111 select = CheckParticleDefAndContainment(fastTrack); 104 if (select) EnergyStop = PBound->GetEneT << 112 if (select) EnergyStop= PBound->GetEneToKill(ParticleType); 105 } 113 } 106 } 114 } 107 << 115 return select; 108 return select; << 109 } 116 } 110 117 111 G4bool GFlashShowerModel::CheckParticleDefAndC << 112 { << 113 G4bool filter = false; << 114 G4ParticleDefinition* ParticleType = fastTra << 115 118 116 if (ParticleType == G4Electron::ElectronDefi << 119 G4bool 117 || ParticleType == G4Positron::PositronD << 120 GFlashShowerModel::CheckParticleDefAndContainment(const G4FastTrack& fastTrack) >> 121 { >> 122 G4bool filter=false; >> 123 G4ParticleDefinition * ParticleType = >> 124 fastTrack.GetPrimaryTrack()->GetDefinition(); >> 125 >> 126 if( ParticleType == G4Electron::ElectronDefinition() || >> 127 ParticleType == G4Positron::PositronDefinition() ) 118 { 128 { 119 filter = true; << 129 filter=true; 120 if (FlagParticleContainment == 1) { << 130 if(FlagParticleContainment == 1) 121 filter = CheckContainment(fastTrack); << 131 { >> 132 filter=CheckContainment(fastTrack); 122 } 133 } 123 } 134 } 124 return filter; << 135 return filter; 125 } 136 } 126 137 127 G4bool GFlashShowerModel::CheckContainment(con 138 G4bool GFlashShowerModel::CheckContainment(const G4FastTrack& fastTrack) 128 { 139 { 129 G4bool filter = false; << 140 G4bool filter=false; 130 // track informations 141 // track informations 131 G4ThreeVector DirectionShower = fastTrack.Ge << 142 G4ThreeVector DirectionShower=fastTrack.GetPrimaryTrackLocalDirection(); 132 G4ThreeVector InitialPositionShower = fastTr << 143 G4ThreeVector InitialPositionShower=fastTrack.GetPrimaryTrackLocalPosition(); 133 144 134 G4ThreeVector OrthoShower, CrossShower; << 145 G4ThreeVector OrthoShower, CrossShower; 135 // Returns orthogonal vector << 146 // Returns orthogonal vector 136 OrthoShower = DirectionShower.orthogonal(); 147 OrthoShower = DirectionShower.orthogonal(); 137 // Shower in direction perpendicular to Orth 148 // Shower in direction perpendicular to OrthoShower and DirectionShower 138 CrossShower = DirectionShower.cross(OrthoSho 149 CrossShower = DirectionShower.cross(OrthoShower); 139 << 150 140 G4double R = Parameterisation->GetAveR90(); << 151 G4double R = Parameterisation->GetAveR90(); 141 G4double Z = Parameterisation->GetAveT90(); << 152 G4double Z = Parameterisation->GetAveT90(); 142 G4int CosPhi[4] = {1, 0, -1, 0}; << 153 G4int CosPhi[4] = {1,0,-1,0}; 143 G4int SinPhi[4] = {0, 1, 0, -1}; << 154 G4int SinPhi[4] = {0,1,0,-1}; 144 << 155 145 G4ThreeVector Position; 156 G4ThreeVector Position; 146 G4int NlateralInside = 0; << 157 G4int NlateralInside=0; 147 // pointer to solid we're in 158 // pointer to solid we're in 148 G4VSolid* SolidCalo = fastTrack.GetEnvelopeS << 159 G4VSolid *SolidCalo = fastTrack.GetEnvelopeSolid(); 149 for (int i = 0; i < 4; i++) { << 160 for(int i=0; i<4 ;i++) >> 161 { 150 // polar coordinates 162 // polar coordinates 151 Position = InitialPositionShower + Z * Dir << 163 Position = InitialPositionShower + 152 + R * SinPhi[i] * CrossShower; << 164 Z*DirectionShower + 153 << 165 R*CosPhi[i]*OrthoShower + 154 if (SolidCalo->Inside(Position) != kOutsid << 166 R*SinPhi[i]*CrossShower ; >> 167 >> 168 if(SolidCalo->Inside(Position) != kOutside) >> 169 NlateralInside++; 155 } 170 } 156 << 171 157 // choose to parameterise or flag when all i 172 // choose to parameterise or flag when all inetc... 158 if (NlateralInside == 4) filter = true; << 173 if(NlateralInside==4) filter=true; 159 // std::cout << " points = " <<NlateralIns 174 // std::cout << " points = " <<NlateralInside << std::endl; 160 return filter; 175 return filter; 161 } 176 } 162 177 163 void GFlashShowerModel::DoIt(const G4FastTrack << 178 >> 179 void >> 180 GFlashShowerModel::DoIt(const G4FastTrack& fastTrack, G4FastStep& fastStep) 164 { 181 { 165 // parametrise electrons 182 // parametrise electrons 166 if (fastTrack.GetPrimaryTrack()->GetDefiniti << 183 if(fastTrack.GetPrimaryTrack()->GetDefinition() 167 || fastTrack.GetPrimaryTrack()->GetDefin << 184 == G4Electron::ElectronDefinition() || 168 ElectronDoIt(fastTrack, fastStep); << 185 fastTrack.GetPrimaryTrack()->GetDefinition() >> 186 == G4Positron::PositronDefinition() ) >> 187 ElectronDoIt(fastTrack,fastStep); 169 } 188 } 170 189 171 void GFlashShowerModel::ElectronDoIt(const G4F << 190 void >> 191 GFlashShowerModel::ElectronDoIt(const G4FastTrack& fastTrack, >> 192 G4FastStep& fastStep) 172 { 193 { 173 // std::cout<<"--- ElectronDoit --- "<<std:: 194 // std::cout<<"--- ElectronDoit --- "<<std::endl; 174 << 195 175 fastStep.KillPrimaryTrack(); 196 fastStep.KillPrimaryTrack(); 176 fastStep.ProposePrimaryTrackPathLength(0.0); << 197 fastStep.SetPrimaryTrackPathLength(0.0); 177 fastStep.ProposeTotalEnergyDeposited(fastTra << 198 fastStep.SetTotalEnergyDeposited(fastTrack.GetPrimaryTrack()-> 178 << 199 GetKineticEnergy()); 179 //----------------------------- << 200 180 // Get track parameters << 181 //----------------------------- 201 //----------------------------- 182 // E,vect{p} and t,vec(x) << 202 // Get track parameters >> 203 //----------------------------- >> 204 //E,vect{p} and t,vec(x) 183 G4double Energy = fastTrack.GetPrimaryTrack( 205 G4double Energy = fastTrack.GetPrimaryTrack()->GetKineticEnergy(); 184 << 206 185 // axis of the shower, in global reference f 207 // axis of the shower, in global reference frame: 186 G4ThreeVector DirectionShower = fastTrack.Ge << 208 G4ThreeVector DirectionShower = >> 209 fastTrack.GetPrimaryTrack()->GetMomentumDirection(); 187 G4ThreeVector OrthoShower, CrossShower; 210 G4ThreeVector OrthoShower, CrossShower; 188 OrthoShower = DirectionShower.orthogonal(); 211 OrthoShower = DirectionShower.orthogonal(); 189 CrossShower = DirectionShower.cross(OrthoSho 212 CrossShower = DirectionShower.cross(OrthoShower); 190 << 213 191 //-------------------------------- 214 //-------------------------------- 192 /// Generate longitudinal profile << 215 ///Generate longitudinal profile 193 //-------------------------------- 216 //-------------------------------- 194 Parameterisation->GenerateLongitudinalProfil 217 Parameterisation->GenerateLongitudinalProfile(Energy); 195 // performance iteration @@@@@@@ << 218 // performance iteration @@@@@@@ 196 << 219 197 /// Initialisation of long. loop variables << 220 ///Initialisation of long. loop variables 198 G4VSolid* SolidCalo = fastTrack.GetEnvelopeS << 221 G4VSolid *SolidCalo = fastTrack.GetEnvelopeSolid(); 199 G4ThreeVector pos = fastTrack.GetPrimaryTrac << 222 G4ThreeVector pos = fastTrack.GetPrimaryTrackLocalPosition(); 200 G4ThreeVector dir = fastTrack.GetPrimaryTrac << 223 G4ThreeVector dir = fastTrack.GetPrimaryTrackLocalDirection(); 201 G4double Bound = SolidCalo->DistanceToOut(po << 224 G4double Bound = SolidCalo->DistanceToOut(pos,dir); 202 << 225 203 G4double Dz = 0.00; << 226 G4double Dz = 0.00; 204 G4double ZEndStep = 0.00; 227 G4double ZEndStep = 0.00; 205 << 228 206 G4double EnergyNow = Energy; << 229 G4double EnergyNow = Energy; 207 G4double EneIntegral = 0.00; << 230 G4double EneIntegral = 0.00; 208 G4double LastEneIntegral = 0.00; << 231 G4double LastEneIntegral = 0.00; 209 G4double DEne = 0.00; << 232 G4double DEne = 0.00; 210 << 233 211 G4double NspIntegral = 0.00; << 234 G4double NspIntegral = 0.00; 212 G4double LastNspIntegral = 0.00; << 235 G4double LastNspIntegral = 0.00; 213 G4double DNsp = 0.00; << 236 G4double DNsp = 0.00; 214 << 237 215 // starting point of the shower: 238 // starting point of the shower: 216 G4ThreeVector PositionShower = fastTrack.Get << 239 G4ThreeVector PositionShower = fastTrack.GetPrimaryTrack()->GetPosition(); 217 G4ThreeVector NewPositionShower = PositionSh << 240 G4ThreeVector NewPositionShower = PositionShower; 218 G4double StepLenght = 0.00; << 241 G4double StepLenght = 0.00; 219 << 242 >> 243 G4int NSpotDeposited =0; >> 244 220 //-------------------------- 245 //-------------------------- 221 /// Begin Longitudinal Loop 246 /// Begin Longitudinal Loop 222 //------------------------- 247 //------------------------- 223 << 248 224 do { << 249 do 225 // determine step size=min(1Xo,next bounda << 250 { 226 G4double stepLength = StepInX0 * Parameter << 251 //determine step size=min(1Xo,next boundary) 227 if (Bound < stepLength) { << 252 G4double stepLength = StepInX0*Parameterisation->GetX0(); 228 Dz = Bound; << 253 if(Bound < stepLength) >> 254 { >> 255 Dz = Bound; 229 Bound = 0.00; 256 Bound = 0.00; 230 } 257 } 231 else { << 258 else 232 Dz = stepLength; << 259 { 233 Bound = Bound - Dz; << 260 Dz = stepLength; >> 261 Bound = Bound-Dz; 234 } 262 } 235 ZEndStep = ZEndStep + Dz; << 263 ZEndStep=ZEndStep+Dz; 236 << 264 237 // Determine Energy Release in Step 265 // Determine Energy Release in Step 238 if (EnergyNow > EnergyStop) { << 266 if(EnergyNow > EnergyStop) 239 LastEneIntegral = EneIntegral; << 267 { 240 EneIntegral = Parameterisation->Integrat << 268 LastEneIntegral = EneIntegral; 241 DEne = std::min(EnergyNow, (EneIntegral << 269 EneIntegral = Parameterisation->IntegrateEneLongitudinal(ZEndStep); 242 LastNspIntegral = NspIntegral; << 270 DEne = std::min( EnergyNow, 243 NspIntegral = Parameterisation->Integrat << 271 (EneIntegral-LastEneIntegral)*Energy); 244 DNsp = << 272 LastNspIntegral = NspIntegral; 245 std::max(1., std::floor((NspIntegral - << 273 NspIntegral = Parameterisation->IntegrateNspLongitudinal(ZEndStep); >> 274 DNsp = std::max(1., std::floor( (NspIntegral-LastNspIntegral) >> 275 *Parameterisation->GetNspot() )); 246 } 276 } 247 // end of the shower 277 // end of the shower 248 else { << 278 else >> 279 { 249 DEne = EnergyNow; 280 DEne = EnergyNow; 250 DNsp = std::max(1., std::floor((1. - Nsp << 281 DNsp = std::max(1., std::floor( (1.- NspIntegral) 251 } << 282 *Parameterisation->GetNspot() )); 252 EnergyNow = EnergyNow - DEne; << 283 } 253 << 284 EnergyNow = EnergyNow - DEne; >> 285 254 // Apply sampling fluctuation - only in sa 286 // Apply sampling fluctuation - only in sampling calorimeters 255 // 287 // 256 GFlashSamplingShowerParameterisation* sp = 288 GFlashSamplingShowerParameterisation* sp = 257 dynamic_cast<GFlashSamplingShowerParamet 289 dynamic_cast<GFlashSamplingShowerParameterisation*>(Parameterisation); 258 if (sp) { << 290 if (sp) 259 G4double DEneSampling = sp->ApplySamplin << 291 { >> 292 G4double DEneSampling = sp->ApplySampling(DEne,Energy); 260 DEne = DEneSampling; 293 DEne = DEneSampling; 261 } 294 } 262 295 263 // move particle in the middle of the step << 296 //move particle in the middle of the step 264 StepLenght = StepLenght + Dz / 2.00; << 297 StepLenght = StepLenght + Dz/2.00; 265 NewPositionShower = NewPositionShower + St << 298 NewPositionShower = NewPositionShower + 266 StepLenght = Dz / 2.00; << 299 StepLenght*DirectionShower; 267 << 300 StepLenght = Dz/2.00; 268 // generate spots & hits: << 301 269 for (G4int i = 0; i < DNsp; ++i) { << 302 //generate spots & hits: 270 GFlashEnergySpot Spot; << 303 for (int i = 0; i < DNsp; i++) 271 << 304 { 272 // Spot energy: the same for all spots << 305 NSpotDeposited++; 273 Spot.SetEnergy(DEne / DNsp); << 306 GFlashEnergySpot Spot; 274 G4double PhiSpot = Parameterisation->Gen << 307 275 G4double RSpot = Parameterisation // ra << 308 //Spot energy: the same for all spots 276 ->GenerateRadius(i, E << 309 Spot.SetEnergy( DEne / DNsp ); >> 310 G4double PhiSpot = Parameterisation->GeneratePhi(); // phi of spot >> 311 G4double RSpot = Parameterisation // radius of spot >> 312 ->GenerateRadius(i,Energy,ZEndStep-Dz/2.); 277 313 278 // check reference-> may be need to intr 314 // check reference-> may be need to introduce rot matrix @@@ 279 // Position: equally spaced in z 315 // Position: equally spaced in z 280 << 316 281 G4ThreeVector SpotPosition = << 317 G4ThreeVector SpotPosition = NewPositionShower + 282 NewPositionShower + Dz / DNsp * Direct << 318 Dz/DNsp*DirectionShower*(i+1/2.-DNsp/2.) + 283 + RSpot * std::cos(PhiSpot) * OrthoSho << 319 RSpot*std::cos(PhiSpot)*OrthoShower + >> 320 RSpot*std::sin(PhiSpot)*CrossShower; 284 Spot.SetPosition(SpotPosition); 321 Spot.SetPosition(SpotPosition); 285 << 322 286 // Generate Hits of this spot << 323 //Generate Hits of this spot 287 HMaker->make(&Spot, &fastTrack); 324 HMaker->make(&Spot, &fastTrack); 288 } 325 } 289 } while (EnergyNow > 0.0 && Bound > 0.0); << 326 } 290 << 327 while(EnergyNow > 0.0 && Bound> 0.0); >> 328 291 //--------------- 329 //--------------- 292 /// End Loop 330 /// End Loop 293 //--------------- << 331 //--------------- 294 } 332 } 295 333 296 /* 334 /* 297 335 298 void 336 void 299 GFlashShowerModel::GammaDoIt(const G4FastTrack 337 GFlashShowerModel::GammaDoIt(const G4FastTrack& fastTrack, 300 G4FastStep& 338 G4FastStep& fastStep) 301 { << 339 { 302 << 340 303 if( fastTrack.GetPrimaryTrack()->GetKineticE 341 if( fastTrack.GetPrimaryTrack()->GetKineticEnergy() > EnergyStop ) 304 return; 342 return; 305 << 343 306 //deposita in uno spot unico l'energia << 344 //deposita in uno spot unico l'energia 307 //con andamento exp decrescente. << 345 //con andamento exp decrescente. 308 << 346 309 // Kill the particle to be parametrised 347 // Kill the particle to be parametrised 310 fastStep.KillPrimaryTrack(); 348 fastStep.KillPrimaryTrack(); 311 fastStep.SetPrimaryTrackPathLength(0.0); 349 fastStep.SetPrimaryTrackPathLength(0.0); 312 fastStep.SetTotalEnergyDeposited(fastTrack.G 350 fastStep.SetTotalEnergyDeposited(fastTrack.GetPrimaryTrack() 313 ->GetKineti 351 ->GetKineticEnergy()); 314 // other settings???? 352 // other settings???? 315 feSpotList.clear(); << 353 feSpotList.clear(); 316 << 354 317 //----------------------------- 355 //----------------------------- 318 // Get track parameters << 356 // Get track parameters 319 //----------------------------- 357 //----------------------------- 320 358 321 // E,vect{p} and t,vec(x) 359 // E,vect{p} and t,vec(x) 322 G4double Energy = << 360 G4double Energy = 323 fastTrack.GetPrimaryTrack()->GetKineticEne 361 fastTrack.GetPrimaryTrack()->GetKineticEnergy(); 324 // axis of the shower, in global reference f 362 // axis of the shower, in global reference frame: 325 G4ThreeVector DirectionShower = 363 G4ThreeVector DirectionShower = 326 fastTrack.GetPrimaryTrack()->GetMomentumDi 364 fastTrack.GetPrimaryTrack()->GetMomentumDirection(); 327 // starting point of the shower: 365 // starting point of the shower: 328 G4ThreeVector PositionShower = 366 G4ThreeVector PositionShower = 329 fastTrack.GetPrimaryTrack()->GetPosition() 367 fastTrack.GetPrimaryTrack()->GetPosition(); 330 << 368 331 //G4double DEneSampling = Parameterisation-> 369 //G4double DEneSampling = Parameterisation->ApplySampling(Energy,Energy); 332 //if(DEneSampling <= 0.00) DEneSampling=Ener << 370 //if(DEneSampling <= 0.00) DEneSampling=Energy; 333 << 371 334 if(Energy > 0.0) 372 if(Energy > 0.0) 335 { 373 { 336 G4double dist = Parameterisation->Generate << 374 G4double dist = Parameterisation->GenerateExponential(Energy); 337 << 375 338 GFlashEnergySpot Spot; 376 GFlashEnergySpot Spot; 339 Spot.SetEnergy( Energy ); 377 Spot.SetEnergy( Energy ); 340 G4ThreeVector SpotPosition = PositionShowe << 378 G4ThreeVector SpotPosition = PositionShower + dist*DirectionShower; 341 Spot.SetPosition(SpotPosition); 379 Spot.SetPosition(SpotPosition); 342 << 380 343 // Record the Spot: 381 // Record the Spot: 344 feSpotList.push_back(Spot); 382 feSpotList.push_back(Spot); 345 << 383 346 //Generate Hits of this spot << 384 //Generate Hits of this spot 347 HMaker->make(Spot); 385 HMaker->make(Spot); 348 } 386 } 349 } 387 } 350 388 351 */ 389 */ 352 390