5#ifndef G4ATLASTOOLS_PUNCHTHROUGHG4TOOL_H
6#define G4ATLASTOOLS_PUNCHTHROUGHG4TOOL_H
23#include "G4ParticleTable.hh"
25#include "G4TrackVector.hh"
26#include "G4FastTrack.hh"
27#include "G4FastStep.hh"
44class PunchThroughG4Tool :
virtual public extends<AthAlgTool, IPunchThroughG4Tool, IPhysicsInitializationTool>
54 virtual StatusCode
finalize()
override;
60 virtual std::vector<std::map<std::string, double>>
computePunchThroughParticles(
const G4FastTrack& fastTrack, CLHEP::HepRandomEngine* rndmEngine,
double punchThroughProbability,
double punchThroughClassifierRand)
override;
63 virtual void createAllSecondaryTracks(G4ParticleTable &ptable, G4FastStep& fastStep,
const G4Track& g4PrimaryTrack, std::vector<std::map<std::string, double>> &secKinematicsMapVect, G4TrackVector& secTrackCont,
const std::vector<double> &caloMSVars)
override;
87 int pdg,
bool doAntiparticle =
false,
88 double minEnergy = 0.,
89 int maxNumParticles = -1,
90 double numParticlesFactor = 1.,
91 double energyFactor = 1.,
92 double posAngleFactor = 1.,
93 double momAngleFactor = 1.);
100 StatusCode
registerCorrelation(
int pdgID1,
int pdgID2,
double minCorrEnergy = 0.,
double fullCorrEnergy = 0.);
106 std::unique_ptr<PunchThroughPDFCreator>
readLookuptablePDF(
int pdgID, TFile* fileLookupTable,
const std::string& folderName);
115 const std::vector<std::pair<double, double>>* rzCalo);
122 int getAllParticles(
const G4Track& g4PrimaryTrack, std::vector<std::map<std::string, double>> &secKinematicsMapVect, CLHEP::HepRandomEngine* rndmEngine,
int pdg,
double interpEnergy,
double interpEta,
int numParticles = -1);
127 std::vector<std::map<std::string, double>>
checkEnergySumFromSecondaries(
double mainEnergyInit, std::vector<std::map<std::string, double>> &secKinematicsMapVect);
129 G4Track*
createSecondaryTrack( G4ParticleTable &ptable, G4FastStep& fastStep,
double currentTime,
int secondarySignedPDG,
130 double energy,
double theta,
double phi,
double momTheta,
double momPhi,
const std::vector<double> &caloMSVars);
135 int getCorrelatedParticles(
const G4Track& g4PrimaryTrack, std::vector<std::map<std::string, double>> &secKinematicsMapVect,
int pdg,
int corrParticles, CLHEP::HepRandomEngine* rndmEngine,
double interpEnergy,
double interpEta);
138 std::map<std::string, double>
getOneParticleKinematics(CLHEP::HepRandomEngine* rndmEngine,
int secondaryPDG,
float initParticleTheta,
float initParticlePhi,
double interpEnergy,
double interpEta)
const;
144 std::vector<double>
inversePCA(
int pcaCdfIterator, std::vector<double> &variables)
const;
147 static double inverseCdfTransform(
double variable,
const std::map<double, double> &inverse_cdf_map) ;
150 static std::vector<double>
dotProduct(
const std::vector<std::vector<double>> &m,
const std::vector<double> &v) ;
156 double interpolateEnergy(
const double &energy, CLHEP::HepRandomEngine* rndmEngine)
const;
159 double interpolateEta(
const double &
eta, CLHEP::HepRandomEngine* rndmEngine)
const;
198 StringProperty
m_filenameLookupTable{
this,
"FilenameLookupTable",
"CaloPunchThroughParametrisation.root",
"holds the filename of the lookup table"};
199 StringProperty
m_filenameInverseCDF{
this,
"FilenameInverseCdf",
"",
"holds the filename of inverse quantile transformer config"};
200 StringProperty
m_filenameInversePCA{
this,
"FilenameInversePca",
"",
"holds the filename of inverse PCA config"};
202 IntegerArrayProperty
m_pdgInitiators{
this,
"PunchThroughInitiators", {},
"vector of punch-through initiator pgds"};
203 IntegerArrayProperty
m_initiatorsMinEnergy{
this,
"InitiatorsMinEnergy", {},
"vector of punch-through initiator min energies to create punch through"};
204 DoubleArrayProperty
m_initiatorsEtaRange{
this,
"InitiatorsEtaRange", {},
"vector of min and max abs eta range to allow punch through initiators"};
205 IntegerArrayProperty
m_punchThroughParticles{
this,
"PunchThroughParticles", {},
"vector of pdgs of the particles produced in punch-throughs"};
206 BooleanArrayProperty
m_doAntiParticles{
this,
"DoAntiParticles", {},
"vector of bools to determine if anti-particles are created for each punch-through particle type"};
207 IntegerArrayProperty
m_correlatedParticle{
this,
"CorrelatedParticle", {},
"holds the pdg of the correlated particle for each given pdg"};
208 DoubleArrayProperty
m_minCorrEnergy{
this,
"MinCorrelationEnergy", {},
"holds the energy threshold below which no particle correlation is computed"};
209 DoubleArrayProperty
m_fullCorrEnergy{
this,
"FullCorrelationEnergy", {},
"holds the energy threshold above which a particle correlation is fully developed"};
210 DoubleArrayProperty
m_posAngleFactor{
this,
"ScalePosDeflectionAngles", {},
"tuning parameter to scale the position deflection angles"};
211 DoubleArrayProperty
m_momAngleFactor{
this,
"ScaleMomDeflectionAngles", {},
"tuning parameter to scale the momentum deflection angles"};
212 DoubleArrayProperty
m_minEnergy{
this,
"MinEnergy", {},
"punch-through particles minimum energies"};
213 IntegerArrayProperty
m_maxNumParticles{
this,
"MaxNumParticles", {},
"maximum number of punch-through particles for each particle type"};
214 DoubleArrayProperty
m_numParticlesFactor{
this,
"NumParticlesFactor", {},
"scale the number of punch-through particles"};
215 DoubleArrayProperty
m_energyFactor{
this,
"EnergyFactor", {},
"scale the energy of the punch-through particles"};
Scalar eta() const
pseudorapidity method
Scalar phi() const
phi method
Scalar theta() const
theta method
Creates random numbers with a distribution given as ROOT TF1.
This class holds information for different properties of a punch-through particle (energy,...
Simple DOM-like node structure to hold the result of XML parsing.