ATLAS Offline Software
Loading...
Searching...
No Matches
PunchThroughSimWrapper Class Reference

Class to wrap PunchThrough simulation inside FastCaloSim; Runs both PunchThroughG4Classifier and PunchThroughG4Tool methods. More...

#include <PunchThroughSimWrapper.h>

Inheritance diagram for PunchThroughSimWrapper:
Collaboration diagram for PunchThroughSimWrapper:

Public Member Functions

 PunchThroughSimWrapper (const std::string &, const std::string &, const IInterface *)
 Constructor.
virtual ~PunchThroughSimWrapper ()=default
 Destructor.
virtual StatusCode initialize ()
 AlgTool initialize method.
virtual StatusCode finalize ()
 AlgTool finalize method.
virtual void DoPunchThroughSim (G4ParticleTable &ptable, CLHEP::HepRandomEngine *rng, const double simE, std::vector< double > simEfrac, const G4FastTrack &fastTrack, G4FastStep &fastStep)

Private Attributes

PublicToolHandle< IPunchThroughG4Toolm_PunchThroughG4Tool {this, "PunchThroughG4Tool", "PunchThroughG4Tool", ""}
PublicToolHandle< IPunchThroughG4Classifierm_PunchThroughG4Classifier {this, "PunchThroughG4Classifier", "PunchThroughG4Classifier", ""}

Detailed Description

Class to wrap PunchThrough simulation inside FastCaloSim; Runs both PunchThroughG4Classifier and PunchThroughG4Tool methods.

Author
Elmar Ritsch Elmar.nosp@m..Rit.nosp@m.sch@c.nosp@m.ern..nosp@m.ch @maintainer/updater Thomas Carter thoma.nosp@m.s.mi.nosp@m.chael.nosp@m..car.nosp@m.ter@c.nosp@m.ern..nosp@m.ch @maintainer/updater Firdaus Soberi firda.nosp@m.us.s.nosp@m.oberi.nosp@m.@cer.nosp@m.n.ch

Definition at line 31 of file PunchThroughSimWrapper.h.

Constructor & Destructor Documentation

◆ PunchThroughSimWrapper()

PunchThroughSimWrapper::PunchThroughSimWrapper ( const std::string & type,
const std::string & name,
const IInterface * parent )

Constructor.

Definition at line 15 of file PunchThroughSimWrapper.cxx.

16 : base_class(type,name,parent)
17{
18}

◆ ~PunchThroughSimWrapper()

virtual PunchThroughSimWrapper::~PunchThroughSimWrapper ( )
virtualdefault

Destructor.

Member Function Documentation

◆ DoPunchThroughSim()

void PunchThroughSimWrapper::DoPunchThroughSim ( G4ParticleTable & ptable,
CLHEP::HepRandomEngine * rng,
const double simE,
std::vector< double > simEfrac,
const G4FastTrack & fastTrack,
G4FastStep & fastStep )
virtual

Definition at line 30 of file PunchThroughSimWrapper.cxx.

31{
32 // Get Geant4 primary track
33 const G4Track* G4PrimaryTrack = fastTrack.GetPrimaryTrack();
34
35 // Get calo-ms variables
36 std::vector<double> caloMSVars = m_PunchThroughG4Tool->getCaloMSVars();
37
38 // Declare array holders
39 std::vector<std::map<std::string, double>> secKinematicsMapVect;
40
41 // Create output particle (secondaries) collection
42 auto secTrackCont = std::make_unique<G4TrackVector>();
43
44 // Draw flat random number to compare punchthrough probability
45 double punchThroughClassifierRand = CLHEP::RandFlat::shoot(rng);
46
47 // Calculate probability of punch through using punchThroughClassifier
48 double punchThroughProbability = m_PunchThroughG4Classifier->computePunchThroughProbability(fastTrack, simE, simEfrac);
49
50 // Safety condition
51 if( punchThroughProbability > punchThroughClassifierRand){
52 secKinematicsMapVect = m_PunchThroughG4Tool->computePunchThroughParticles(fastTrack, rng, punchThroughProbability, punchThroughClassifierRand);
53
54 // Create secondary tracks
55 if(secKinematicsMapVect.size()!=0){
56 // Now create all secondary tracks after all consistency checks (conservation of energy etc):
57 m_PunchThroughG4Tool->createAllSecondaryTracks(ptable, fastStep, *G4PrimaryTrack, secKinematicsMapVect, *secTrackCont, caloMSVars);
58 }
59 }
60 // done punchthrough procedure
61}
PublicToolHandle< IPunchThroughG4Tool > m_PunchThroughG4Tool
PublicToolHandle< IPunchThroughG4Classifier > m_PunchThroughG4Classifier

◆ finalize()

StatusCode PunchThroughSimWrapper::finalize ( )
virtual

AlgTool finalize method.

Definition at line 25 of file PunchThroughSimWrapper.cxx.

26{
27 return StatusCode::SUCCESS;
28}

◆ initialize()

StatusCode PunchThroughSimWrapper::initialize ( )
virtual

AlgTool initialize method.

Definition at line 20 of file PunchThroughSimWrapper.cxx.

21{
22 return StatusCode::SUCCESS;
23}

Member Data Documentation

◆ m_PunchThroughG4Classifier

PublicToolHandle<IPunchThroughG4Classifier> PunchThroughSimWrapper::m_PunchThroughG4Classifier {this, "PunchThroughG4Classifier", "PunchThroughG4Classifier", ""}
private

Definition at line 53 of file PunchThroughSimWrapper.h.

53{this, "PunchThroughG4Classifier", "PunchThroughG4Classifier", ""};

◆ m_PunchThroughG4Tool

PublicToolHandle<IPunchThroughG4Tool> PunchThroughSimWrapper::m_PunchThroughG4Tool {this, "PunchThroughG4Tool", "PunchThroughG4Tool", ""}
private

Definition at line 52 of file PunchThroughSimWrapper.h.

52{this, "PunchThroughG4Tool", "PunchThroughG4Tool", ""};

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