 |
ATLAS Offline Software
|
NEEDS DOCUMENTATION.
More...
#include <LArFastShower.h>
NEEDS DOCUMENTATION.
Definition at line 30 of file LArFastShower.h.
◆ LArFastShower()
Constructor.
Definition at line 38 of file LArFastShower.cxx.
40 G4VFastSimulationModel(
name, region),
61 auto threadId = std::this_thread::get_id();
64 hepmcFileName +=
"."+
ss.str();
74 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 276 of file LArFastShower.cxx.
279 G4ThreeVector showerDirection = fastTrack.GetPrimaryTrack()->GetMomentumDirection();
280 G4ThreeVector initialShowerPosition = fastTrack.GetPrimaryTrack()->GetPosition();
281 G4ThreeVector orthoShower = showerDirection.orthogonal();
282 G4ThreeVector crossShower = showerDirection.cross(orthoShower);
285 G4cout <<
"LArFastShower::CheckContainment() orthoShower: " << orthoShower << G4endl;
286 G4cout <<
"LArFastShower::CheckContainment() crossShower: " << crossShower << G4endl;
306 if (
Z == 0.0 &&
R == 0.0) {
313 G4double Zmx =
Z / 3;
315 G4int cosPhi[4] = {1,0,-1,0};
316 G4int sinPhi[4] = {0,1,0,-1};
319 G4cout <<
"LArFastShower::CheckContainment() R = " <<
R << G4endl;
320 G4cout <<
"LArFastShower::CheckContainment() Z = " <<
Z << G4endl;
323 G4ThreeVector position;
325 G4VSolid* caloSolid = fastTrack.GetEnvelopeSolid();
326 const G4AffineTransform* affineTransformation = fastTrack.GetAffineTransformation();
329 position = initialShowerPosition;
330 affineTransformation->ApplyPointTransform(position);
331 if(caloSolid->Inside(position) == kOutside)
335 position = initialShowerPosition +
Z*showerDirection;
336 affineTransformation->ApplyPointTransform(position);
337 if(caloSolid->Inside(position) == kOutside)
341 for(
int i=0;
i<4 ;
i++)
343 position = initialShowerPosition + Zmx*showerDirection +
344 R*cosPhi[
i]*orthoShower +
R*sinPhi[
i]*crossShower;
345 affineTransformation->ApplyPointTransform(position);
346 if(caloSolid->Inside(position) == kOutside)
351 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 185 of file LArFastShower.cxx.
188 G4cout <<
"LArFastShower::Doit()" << G4endl;
193 std::unique_ptr<const HepMC::GenEvent> ge =
GetGenEvent(fastTrack);
202 G4cout <<
"LArFastShower::Doit() done" << G4endl;
◆ fastShowerSD()
Definition at line 85 of file LArFastShower.cxx.
88 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 402 of file LArFastShower.cxx.
404 if ( &
particleType == G4Electron::ElectronDefinition() ||
407 }
else if ( &
particleType == G4Gamma::GammaDefinition() ) {
409 }
else if ( &
particleType == G4Neutron::NeutronDefinition() ) {
411 }
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 459 of file LArFastShower.cxx.
461 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 483 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 358 of file LArFastShower.cxx.
360 const G4ThreeVector showerPos = fastTrack.GetPrimaryTrack()->GetPosition();
361 const G4ThreeVector showerMom = fastTrack.GetPrimaryTrack()->GetMomentum();
362 const G4double
energy = fastTrack.GetPrimaryTrack()->GetKineticEnergy();
364 G4int pdgcode = fastTrack.GetPrimaryTrack()->GetDefinition()->GetPDGEncoding();
365 if (pdgcode < 0) pdgcode = -pdgcode;
368 HepMC3::Units::MomentumUnit momentumUnit = HepMC3::Units::MEV;
371 HepMC::Units::MomentumUnit momentumUnit = HepMC::Units::MEV;
375 std::unique_ptr<HepMC::GenEvent> ge = std::make_unique<HepMC::GenEvent>(momentumUnit,lengthUnit);
381 HepMC::FourVector(showerPos.x(), showerPos.y(), showerPos.z(), 0) );
387 HepMC::FourVector(0.,0.,0.,0.),
389 gv->add_particle_in(std::move(gpi));
393 HepMC::FourVector(showerMom.x(), showerMom.y(), showerMom.z(),
energy),
395 gv->add_particle_out(std::move(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 107 of file LArFastShower.cxx.
110 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 210 of file LArFastShower.cxx.
215 G4cout <<
"Low energy particle is being killed: " << fastTrack.GetPrimaryTrack()->GetKineticEnergy() << G4endl;
219 fastStep.KillPrimaryTrack();
220 fastStep.ProposePrimaryTrackPathLength(0.0);
◆ maxEneToShowerLib()
| double LArFastShower::maxEneToShowerLib |
( |
const G4ParticleDefinition & |
particleType | ) |
const |
|
protected |
get lower energy limit for frozen showers
Definition at line 433 of file LArFastShower.cxx.
435 if ( &
particleType == G4Electron::ElectronDefinition() ||
438 }
else if ( &
particleType == G4Gamma::GammaDefinition() ) {
440 }
else if ( &
particleType == G4Neutron::NeutronDefinition() ) {
442 }
else if ( &
particleType == G4PionPlus::PionPlusDefinition() ||
◆ minEneToShowerLib()
| double LArFastShower::minEneToShowerLib |
( |
const G4ParticleDefinition & |
particleType | ) |
const |
|
protected |
get upper energy limit for frozen showers
Definition at line 417 of file LArFastShower.cxx.
419 if ( &
particleType == G4Electron::ElectronDefinition() ||
422 }
else if ( &
particleType == G4Gamma::GammaDefinition() ) {
424 }
else if ( &
particleType == G4Neutron::NeutronDefinition() ) {
426 }
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 130 of file LArFastShower.cxx.
140 G4cout <<
"LArFastShower::commonTrigger" << G4endl;
146 G4double particleEnergy = fastTrack.GetPrimaryTrack()->GetKineticEnergy();
147 const G4ParticleDefinition&
particleType = *(fastTrack.GetPrimaryTrack()->GetDefinition());
154 G4cout <<
"Particle has energy (" << particleEnergy <<
") for shower lib and shower lib is on! Accept particle!" << G4endl;
159 G4cout <<
"Particle has energy (" << particleEnergy <<
") outside killing, shower lib and parametrisation "
160 <<
"or some features are switched off ... returning it to Geant " << G4endl;
171 G4cout <<
"LArFastShower::ModelTrigger() particle failed CheckContainment()... will not be parameterised: " << G4endl;
177 G4cout <<
"LArFastShower::ModelTrigger() direction: " << fastTrack.GetPrimaryTrackLocalDirection() << G4endl;
178 G4cout <<
"LArFastShower::ModelTrigger() mom dir: " << fastTrack.GetPrimaryTrack()->GetMomentumDirection() << G4endl;
◆ showerLibSvc()
Definition at line 94 of file LArFastShower.cxx.
98 if ( smartShowerLibSvc ) {
m_showerLibSvc = smartShowerLibSvc.get(); }
100 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 225 of file LArFastShower.cxx.
229 G4cout <<
"LArFastShower::UseShowerLib()" << G4endl;
238 const std::vector<EnergySpot> shower =
242 G4cout <<
"Got shower (" << shower.size() <<
") from shower lib" << G4endl;
246 for (
const auto& a_spot : shower) {
249 G4cout <<
"Make Spot: " << a_spot.GetPosition().x() <<
" "
250 << a_spot.GetPosition().y() <<
" " << a_spot.GetPosition().z()
251 <<
" " << a_spot.GetEnergy() <<
" " << a_spot.GetTime() << G4endl;
256 G4cout <<
"Made Spot" << G4endl;
262 G4cout <<
"LArFastShower::UseShowerLib() Done" << G4endl;
270 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