ATLAS Offline Software
Public Member Functions | Private Attributes | List of all members
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. More...
 
virtual ~PunchThroughSimWrapper ()=default
 Destructor. More...
 
virtual StatusCode initialize ()
 AlgTool initialize method. More...
 
virtual StatusCode finalize ()
 AlgTool finalize method. More...
 
virtual void DoPunchThroughSim (G4ParticleTable &ptable, ATHRNG::RNGWrapper *rngWrapper, 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 34 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 14 of file PunchThroughSimWrapper.cxx.

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

◆ ~PunchThroughSimWrapper()

virtual PunchThroughSimWrapper::~PunchThroughSimWrapper ( )
virtualdefault

Destructor.

Member Function Documentation

◆ DoPunchThroughSim()

void PunchThroughSimWrapper::DoPunchThroughSim ( G4ParticleTable &  ptable,
ATHRNG::RNGWrapper rngWrapper,
const double  simE,
std::vector< double >  simEfrac,
const G4FastTrack &  fastTrack,
G4FastStep &  fastStep 
)
virtual

Definition at line 29 of file PunchThroughSimWrapper.cxx.

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

◆ finalize()

StatusCode PunchThroughSimWrapper::finalize ( )
virtual

AlgTool finalize method.

Definition at line 24 of file PunchThroughSimWrapper.cxx.

25 {
26  return StatusCode::SUCCESS;
27 }

◆ initialize()

StatusCode PunchThroughSimWrapper::initialize ( )
virtual

AlgTool initialize method.

Definition at line 19 of file PunchThroughSimWrapper.cxx.

20 {
21  return StatusCode::SUCCESS;
22 }

Member Data Documentation

◆ m_PunchThroughG4Classifier

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

Definition at line 56 of file PunchThroughSimWrapper.h.

◆ m_PunchThroughG4Tool

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

Definition at line 55 of file PunchThroughSimWrapper.h.


The documentation for this class was generated from the following files:
PunchThroughSimWrapper::m_PunchThroughG4Tool
PublicToolHandle< IPunchThroughG4Tool > m_PunchThroughG4Tool
Definition: PunchThroughSimWrapper.h:55
python.CaloAddPedShiftConfig.type
type
Definition: CaloAddPedShiftConfig.py:42
PunchThroughSimWrapper::m_PunchThroughG4Classifier
PublicToolHandle< IPunchThroughG4Classifier > m_PunchThroughG4Classifier
Definition: PunchThroughSimWrapper.h:56
test_pyathena.parent
parent
Definition: test_pyathena.py:15
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:240