5#ifndef G4ATLASTOOLS_PUNCHTHROUGHG4TOOL_H
6#define G4ATLASTOOLS_PUNCHTHROUGHG4TOOL_H
23#include <libxml/xmlmemory.h>
24#include <libxml/parser.h>
25#include <libxml/tree.h>
26#include <libxml/xmlreader.h>
27#include <libxml/xpath.h>
28#include <libxml/xpathInternals.h>
31#include "G4ParticleTable.hh"
33#include "G4TrackVector.hh"
34#include "G4FastTrack.hh"
35#include "G4FastStep.hh"
50class PunchThroughG4Tool :
virtual public extends<AthAlgTool, IPunchThroughG4Tool, IPhysicsInitializationTool>
60 virtual StatusCode
finalize()
override;
66 virtual std::vector<std::map<std::string, double>>
computePunchThroughParticles(
const G4FastTrack& fastTrack, CLHEP::HepRandomEngine* rndmEngine,
double punchThroughProbability,
double punchThroughClassifierRand)
override;
69 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;
83 int pdg,
bool doAntiparticle =
false,
84 double minEnergy = 0.,
85 int maxNumParticles = -1,
86 double numParticlesFactor = 1.,
87 double energyFactor = 1.,
88 double posAngleFactor = 1.,
89 double momAngleFactor = 1.);
96 StatusCode
registerCorrelation(
int pdgID1,
int pdgID2,
double minCorrEnergy = 0.,
double fullCorrEnergy = 0.);
102 std::unique_ptr<PunchThroughPDFCreator>
readLookuptablePDF(
int pdgID, TFile* fileLookupTable,
const std::string& folderName);
111 const std::vector<std::pair<double, double>>* rzCalo);
118 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);
123 std::vector<std::map<std::string, double>>
checkEnergySumFromSecondaries(
double mainEnergyInit, std::vector<std::map<std::string, double>> &secKinematicsMapVect);
125 G4Track*
createSecondaryTrack( G4ParticleTable &ptable, G4FastStep& fastStep,
double currentTime,
int secondarySignedPDG,
126 double energy,
double theta,
double phi,
double momTheta,
double momPhi,
const std::vector<double> &caloMSVars);
131 int getCorrelatedParticles(
const G4Track& g4PrimaryTrack, std::vector<std::map<std::string, double>> &secKinematicsMapVect,
int pdg,
int corrParticles, CLHEP::HepRandomEngine* rndmEngine,
double interpEnergy,
double interpEta);
134 std::map<std::string, double>
getOneParticleKinematics(CLHEP::HepRandomEngine* rndmEngine,
int secondaryPDG,
float initParticleTheta,
float initParticlePhi,
double interpEnergy,
double interpEta)
const;
140 std::vector<double>
inversePCA(
int pcaCdfIterator, std::vector<double> &variables)
const;
143 static double inverseCdfTransform(
double variable,
const std::map<double, double> &inverse_cdf_map) ;
146 static std::vector<double>
dotProduct(
const std::vector<std::vector<double>> &m,
const std::vector<double> &v) ;
152 double interpolateEnergy(
const double &energy, CLHEP::HepRandomEngine* rndmEngine)
const;
155 double interpolateEta(
const double &
eta, CLHEP::HepRandomEngine* rndmEngine)
const;
158 std::vector<std::map<std::string,std::string>>
getInfoMap(
const std::string& mainNode,
const std::string &xmlFilePath);
161 int passedParamIterator(
int pid,
double eta,
const std::vector<std::map<std::string,std::string>> &mapvect)
const;
194 StringProperty
m_filenameLookupTable{
this,
"FilenameLookupTable",
"CaloPunchThroughParametrisation.root",
"holds the filename of the lookup table"};
195 StringProperty
m_filenameInverseCDF{
this,
"FilenameInverseCdf",
"",
"holds the filename of inverse quantile transformer config"};
196 StringProperty
m_filenameInversePCA{
this,
"FilenameInversePca",
"",
"holds the filename of inverse PCA config"};
198 IntegerArrayProperty
m_pdgInitiators{
this,
"PunchThroughInitiators", {},
"vector of punch-through initiator pgds"};
199 IntegerArrayProperty
m_initiatorsMinEnergy{
this,
"InitiatorsMinEnergy", {},
"vector of punch-through initiator min energies to create punch through"};
200 DoubleArrayProperty
m_initiatorsEtaRange{
this,
"InitiatorsEtaRange", {},
"vector of min and max abs eta range to allow punch through initiators"};
201 IntegerArrayProperty
m_punchThroughParticles{
this,
"PunchThroughParticles", {},
"vector of pdgs of the particles produced in punch-throughs"};
202 BooleanArrayProperty
m_doAntiParticles{
this,
"DoAntiParticles", {},
"vector of bools to determine if anti-particles are created for each punch-through particle type"};
203 IntegerArrayProperty
m_correlatedParticle{
this,
"CorrelatedParticle", {},
"holds the pdg of the correlated particle for each given pdg"};
204 DoubleArrayProperty
m_minCorrEnergy{
this,
"MinCorrelationEnergy", {},
"holds the energy threshold below which no particle correlation is computed"};
205 DoubleArrayProperty
m_fullCorrEnergy{
this,
"FullCorrelationEnergy", {},
"holds the energy threshold above which a particle correlation is fully developed"};
206 DoubleArrayProperty
m_posAngleFactor{
this,
"ScalePosDeflectionAngles", {},
"tuning parameter to scale the position deflection angles"};
207 DoubleArrayProperty
m_momAngleFactor{
this,
"ScaleMomDeflectionAngles", {},
"tuning parameter to scale the momentum deflection angles"};
208 DoubleArrayProperty
m_minEnergy{
this,
"MinEnergy", {},
"punch-through particles minimum energies"};
209 IntegerArrayProperty
m_maxNumParticles{
this,
"MaxNumParticles", {},
"maximum number of punch-through particles for each particle type"};
210 DoubleArrayProperty
m_numParticlesFactor{
this,
"NumParticlesFactor", {},
"scale the number of punch-through particles"};
211 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,...