Loading [MathJax]/extensions/tex2jax.js
 |
ATLAS Offline Software
|
NEEDS DOCUMENTATION.
More...
#include <LArFastShower.h>
NEEDS DOCUMENTATION.
Definition at line 30 of file LArFastShower.h.
◆ LArFastShower()
Constructor.
Definition at line 37 of file LArFastShower.cxx.
39 G4VFastSimulationModel(
name),
60 auto threadId = std::this_thread::get_id();
63 hepmcFileName +=
"."+
ss.str();
73 FCAL3=500000, HECLOC=600000,
HEC=700000 };
◆ ~LArFastShower()
virtual LArFastShower::~LArFastShower |
( |
| ) |
|
|
inlinevirtual |
◆ CheckContainment()
G4bool LArFastShower::CheckContainment |
( |
const G4FastTrack & |
fastTrack | ) |
|
|
protectedvirtual |
Function to check the containment of a shower within a regular detector region.
Definition at line 275 of file LArFastShower.cxx.
278 G4ThreeVector showerDirection = fastTrack.GetPrimaryTrack()->GetMomentumDirection();
279 G4ThreeVector initialShowerPosition = fastTrack.GetPrimaryTrack()->GetPosition();
280 G4ThreeVector orthoShower = showerDirection.orthogonal();
281 G4ThreeVector crossShower = showerDirection.cross(orthoShower);
284 G4cout <<
"LArFastShower::CheckContainment() orthoShower: " << orthoShower << G4endl;
285 G4cout <<
"LArFastShower::CheckContainment() crossShower: " << crossShower << G4endl;
305 if (
Z == 0.0 &&
R == 0.0) {
312 G4double Zmx =
Z / 3;
314 G4int cosPhi[4] = {1,0,-1,0};
315 G4int sinPhi[4] = {0,1,0,-1};
318 G4cout <<
"LArFastShower::CheckContainment() R = " <<
R << G4endl;
319 G4cout <<
"LArFastShower::CheckContainment() Z = " <<
Z << G4endl;
322 G4ThreeVector position;
324 G4VSolid* caloSolid = fastTrack.GetEnvelopeSolid();
325 const G4AffineTransform* affineTransformation = fastTrack.GetAffineTransformation();
328 position = initialShowerPosition;
329 affineTransformation->ApplyPointTransform(position);
330 if(caloSolid->Inside(position) == kOutside)
334 position = initialShowerPosition +
Z*showerDirection;
335 affineTransformation->ApplyPointTransform(position);
336 if(caloSolid->Inside(position) == kOutside)
340 for(
int i=0;
i<4 ;
i++)
342 position = initialShowerPosition + Zmx*showerDirection +
343 R*cosPhi[
i]*orthoShower +
R*sinPhi[
i]*crossShower;
344 affineTransformation->ApplyPointTransform(position);
345 if(caloSolid->Inside(position) == kOutside)
350 G4cout <<
"LArFastShower::CheckContainment() Shower is contained " << G4endl;
◆ DoIt()
void LArFastShower::DoIt |
( |
const G4FastTrack & |
fastTrack, |
|
|
G4FastStep & |
fastStep |
|
) |
| |
|
override |
Assigns the track to the appropriate method for application of the fast simulation.
Only called if ModelTrigger returns true.
Definition at line 184 of file LArFastShower.cxx.
187 G4cout <<
"LArFastShower::Doit()" << G4endl;
192 std::unique_ptr<const HepMC::GenEvent> ge =
GetGenEvent(fastTrack);
201 G4cout <<
"LArFastShower::Doit() done" << G4endl;
◆ fastShowerSD()
Definition at line 84 of file LArFastShower.cxx.
87 throw std::runtime_error(
"LArFastShower: no pointer to IFastSimDedicatedSD!");
◆ flagToShowerLib()
bool LArFastShower::flagToShowerLib |
( |
const G4ParticleDefinition & |
particleType | ) |
const |
|
protected |
get switch for frozen showers
Definition at line 401 of file LArFastShower.cxx.
403 if ( &
particleType == G4Electron::ElectronDefinition() ||
406 }
else if ( &
particleType == G4Gamma::GammaDefinition() ) {
408 }
else if ( &
particleType == G4Neutron::NeutronDefinition() ) {
410 }
else if ( &
particleType == G4PionPlus::PionPlusDefinition() ||
◆ ForcedAccept()
G4bool LArFastShower::ForcedAccept |
( |
const G4FastTrack & |
fastTrack | ) |
|
|
virtual |
If it returns true, the particle will be parameterized without further checks.
Definition at line 458 of file LArFastShower.cxx.
460 G4ThreeVector initialShowerPosition = fastTrack.GetPrimaryTrack()->GetPosition();
◆ ForcedDeny()
G4bool LArFastShower::ForcedDeny |
( |
const G4FastTrack & |
| ) |
|
|
virtual |
If it returns true, the particle will be returned to G4 without further checks.
Definition at line 482 of file LArFastShower.cxx.
◆ generateFSStartingPoint()
bool LArFastShower::generateFSStartingPoint |
( |
std::unique_ptr< const HepMC::GenEvent > & |
ge | ) |
const |
|
protected |
◆ GetGenEvent()
std::unique_ptr< const HepMC::GenEvent > LArFastShower::GetGenEvent |
( |
const G4FastTrack & |
fastTrack | ) |
|
|
protected |
Definition at line 357 of file LArFastShower.cxx.
359 const G4ThreeVector showerPos = fastTrack.GetPrimaryTrack()->GetPosition();
360 const G4ThreeVector showerMom = fastTrack.GetPrimaryTrack()->GetMomentum();
361 const G4double
energy = fastTrack.GetPrimaryTrack()->GetKineticEnergy();
363 G4int pdgcode = fastTrack.GetPrimaryTrack()->GetDefinition()->GetPDGEncoding();
364 if (pdgcode < 0) pdgcode = -pdgcode;
367 HepMC3::Units::MomentumUnit momentumUnit = HepMC3::Units::MEV;
370 HepMC::Units::MomentumUnit momentumUnit = HepMC::Units::MEV;
374 std::unique_ptr<HepMC::GenEvent> ge = std::make_unique<HepMC::GenEvent>(momentumUnit,lengthUnit);
380 HepMC::FourVector(showerPos.x(), showerPos.y(), showerPos.z(), 0) );
386 HepMC::FourVector(0.,0.,0.,0.),
388 gv->add_particle_in(gpi);
392 HepMC::FourVector(showerMom.x(), showerMom.y(), showerMom.z(),
energy),
394 gv->add_particle_out(gpo);
◆ IsApplicable()
G4bool LArFastShower::IsApplicable |
( |
const G4ParticleDefinition & |
particleType | ) |
|
|
override |
Determines the applicability of the fast sim model to this particle type Called once for each track picked up by Geant as it enters a region with the fast sim assigned to it.
Currently returns false for all but photons and electrons.
Definition at line 106 of file LArFastShower.cxx.
109 G4cout <<
"LArFastShower::IsApplicable" << G4endl;
◆ KillParticle()
void LArFastShower::KillParticle |
( |
const G4FastTrack & |
, |
|
|
G4FastStep & |
fastStep |
|
) |
| |
|
protected |
Method to kill a particle and deposit its energy using exponential decay function.
Definition at line 209 of file LArFastShower.cxx.
214 G4cout <<
"Low energy particle is being killed: " << fastTrack.GetPrimaryTrack()->GetKineticEnergy() << G4endl;
218 fastStep.KillPrimaryTrack();
219 fastStep.ProposePrimaryTrackPathLength(0.0);
◆ maxEneToShowerLib()
double LArFastShower::maxEneToShowerLib |
( |
const G4ParticleDefinition & |
particleType | ) |
const |
|
protected |
get lower energy limit for frozen showers
Definition at line 432 of file LArFastShower.cxx.
434 if ( &
particleType == G4Electron::ElectronDefinition() ||
437 }
else if ( &
particleType == G4Gamma::GammaDefinition() ) {
439 }
else if ( &
particleType == G4Neutron::NeutronDefinition() ) {
441 }
else if ( &
particleType == G4PionPlus::PionPlusDefinition() ||
◆ minEneToShowerLib()
double LArFastShower::minEneToShowerLib |
( |
const G4ParticleDefinition & |
particleType | ) |
const |
|
protected |
get upper energy limit for frozen showers
Definition at line 416 of file LArFastShower.cxx.
418 if ( &
particleType == G4Electron::ElectronDefinition() ||
421 }
else if ( &
particleType == G4Gamma::GammaDefinition() ) {
423 }
else if ( &
particleType == G4Neutron::NeutronDefinition() ) {
425 }
else if ( &
particleType == G4PionPlus::PionPlusDefinition() ||
◆ ModelTrigger()
G4bool LArFastShower::ModelTrigger |
( |
const G4FastTrack & |
fastTrack | ) |
|
|
overridevirtual |
Determines the applicability of the fast sim model to this particular track.
Checks that geometric location, energy, and particle type are within bounds. Also checks for containment of the particle's shower within a specific detector region.
Definition at line 129 of file LArFastShower.cxx.
139 G4cout <<
"LArFastShower::commonTrigger" << G4endl;
145 G4double particleEnergy = fastTrack.GetPrimaryTrack()->GetKineticEnergy();
146 const G4ParticleDefinition&
particleType = *(fastTrack.GetPrimaryTrack()->GetDefinition());
153 G4cout <<
"Particle has energy (" << particleEnergy <<
") for shower lib and shower lib is on! Accept particle!" << G4endl;
158 G4cout <<
"Particle has energy (" << particleEnergy <<
") outside killing, shower lib and parametrisation "
159 <<
"or some features are switched off ... returning it to Geant " << G4endl;
170 G4cout <<
"LArFastShower::ModelTrigger() particle failed CheckContainment()... will not be parameterised: " << G4endl;
176 G4cout <<
"LArFastShower::ModelTrigger() direction: " << fastTrack.GetPrimaryTrackLocalDirection() << G4endl;
177 G4cout <<
"LArFastShower::ModelTrigger() mom dir: " << fastTrack.GetPrimaryTrack()->GetMomentumDirection() << G4endl;
◆ showerLibSvc()
Definition at line 93 of file LArFastShower.cxx.
97 if ( smartShowerLibSvc ) {
m_showerLibSvc = smartShowerLibSvc.get(); }
99 throw std::runtime_error(
"LArFastShower: cannot retrieve LArG4ShowerLibSvc");
◆ UseShowerLib()
void LArFastShower::UseShowerLib |
( |
const G4FastTrack & |
fastTrack, |
|
|
G4FastStep & |
fastStep |
|
) |
| |
|
protected |
Function for the application of shower library.
Definition at line 224 of file LArFastShower.cxx.
228 G4cout <<
"LArFastShower::UseShowerLib()" << G4endl;
237 const std::vector<EnergySpot> shower =
241 G4cout <<
"Got shower (" << shower.size() <<
") from shower lib" << G4endl;
245 for (
const auto& a_spot : shower) {
248 G4cout <<
"Make Spot: " << a_spot.GetPosition().x() <<
" "
249 << a_spot.GetPosition().y() <<
" " << a_spot.GetPosition().z()
250 <<
" " << a_spot.GetEnergy() <<
" " << a_spot.GetTime() << G4endl;
255 G4cout <<
"Made Spot" << G4endl;
261 G4cout <<
"LArFastShower::UseShowerLib() Done" << G4endl;
269 G4cout <<
"FastShower::UseShowerLib ERROR Handling an exception in LArFastShower::" <<
e.what() << G4endl;
◆ m_applicableMap
std::map<int,bool> LArFastShower::m_applicableMap |
|
private |
◆ m_configuration
◆ m_detector_tag_str
std::string LArFastShower::m_detector_tag_str |
|
private |
◆ m_detmap
std::map<std::string,int> LArFastShower::m_detmap |
|
private |
◆ m_eventNum
int LArFastShower::m_eventNum |
|
private |
◆ m_fastSimDedicatedSD
Shower library sensitive detector for this shower.
Definition at line 86 of file LArFastShower.h.
◆ m_generate_starting_points
bool LArFastShower::m_generate_starting_points |
|
private |
◆ m_showerLibSvc
Pointer to the shower library service.
Definition at line 88 of file LArFastShower.h.
◆ m_starting_points_file
std::shared_ptr<HepMC::IO_GenEvent> LArFastShower::m_starting_points_file |
|
private |
The documentation for this class was generated from the following files:
HepMC::GenVertex * GenVertexPtr
double m_g_MaxEneShowerLib
lower energy limit for photon frozen showers
virtual G4bool CheckContainment(const G4FastTrack &fastTrack)
Function to check the containment of a shower within a regular detector region.
virtual std::vector< EnergySpot > getShower(const G4FastTrack &, int) const =0
int m_detector_tag
name for the detector tag for the ShowerLibSvc
ILArG4ShowerLibSvc * showerLibSvc()
virtual double getContainmentZ(const G4FastTrack &, int)=0
GenParticle * GenParticlePtr
bool m_Pion_FlagShowerLib
switch for pion frozen showers
virtual G4bool ForcedDeny(const G4FastTrack &)
If it returns true, the particle will be returned to G4 without further checks.
double minEneToShowerLib(const G4ParticleDefinition &particleType) const
get upper energy limit for frozen showers
double m_Neut_MaxEneShowerLib
upper energy limit for neutron frozen showers
std::unique_ptr< const HepMC::GenEvent > GetGenEvent(const G4FastTrack &fastTrack)
double m_Neut_MinEneShowerLib
lower energy limit for neutron frozen showers
IFastSimDedicatedSD * fastShowerSD()
bool generateFSStartingPoint(std::unique_ptr< const HepMC::GenEvent > &ge) const
GenVertexPtr newGenVertexPtr(const HepMC::FourVector &pos=HepMC::FourVector(0.0, 0.0, 0.0, 0.0), const int i=0)
bool m_generate_starting_points
std::string m_showerLibSvcName
void UseShowerLib(const G4FastTrack &, G4FastStep &)
Function for the application of shower library.
double R(const INavigable4Momentum *p1, const double v_eta, const double v_phi)
bool flagToShowerLib(const G4ParticleDefinition &particleType) const
get switch for frozen showers
double m_g_MinEneShowerLib
upper energy limit for photon frozen showers
ILArG4ShowerLibSvc * m_showerLibSvc
Pointer to the shower library service.
virtual G4bool ForcedAccept(const G4FastTrack &)
If it returns true, the particle will be parameterized without further checks.
void KillParticle(const G4FastTrack &, G4FastStep &)
Method to kill a particle and deposit its energy using exponential decay function.
virtual void ProcessSpot(const EnergySpot &spot, double weight)=0
ProcessHitsMethod.
float m_generated_starting_points_ratio
switch for shower starting point record
bool m_Neut_FlagShowerLib
switch for neutron frozen showers
double m_Pion_MinEneShowerLib
lower energy limit for pion frozen showers
std::map< int, bool > m_applicableMap
bool m_g_FlagShowerLib
switch for photon frozen showers
const FastShowerConfigStruct m_configuration
std::string m_generated_starting_points_file
switch for shower starting point record
GenParticlePtr newGenParticlePtr(const HepMC::FourVector &mom=HepMC::FourVector(0.0, 0.0, 0.0, 0.0), int pid=0, int status=0)
bool m_e_FlagShowerLib
switch for electron frozen showers
double m_e_MaxEneShowerLib
upper energy limit for electron frozen showers
bool m_containLow
switch for containment check at low eta
bool m_containCrack
switch for containment check in crack region
double m_e_MinEneShowerLib
lower energy limit for electron frozen showers
std::shared_ptr< HepMC::IO_GenEvent > m_starting_points_file
IFastSimDedicatedSD * m_fastSimDedicatedSD
Shower library sensitive detector for this shower.
bool m_containHigh
switch for containment check at high eta
double m_Pion_MaxEneShowerLib
upper energy limit for pion frozen showers
double maxEneToShowerLib(const G4ParticleDefinition &particleType) const
get lower energy limit for frozen showers
std::map< std::string, int > m_detmap
virtual double getContainmentR(const G4FastTrack &, int)=0