|
ATLAS Offline Software
|
#include <PhotonConversionTool.h>
|
void | recordChilds (double time, const Amg::Vector3D &vertex, const Amg::Vector3D &photonDirection, double childEnergy, double photonEnergy, const Amg::Vector3D &childDirection, Trk::ParticleHypothesis childType=Trk::electron) const |
| record childs - create interface already for mu-/mu+ pair production More...
|
|
ISF::ISFParticleVector | getChilds (const ISF::ISFParticle *parent, double time, const Amg::Vector3D &vertex, const Amg::Vector3D &photonDirection, double childEnergy, double photonEnergy, const Amg::Vector3D &childDirection, Trk::ParticleHypothesis childType) const |
| get childs - for layer update More...
|
|
double | childEnergyFraction (const Trk::MaterialProperties &mprop, double gammaMom) const |
| simulate the child energy More...
|
|
double | childEnergyFraction (double gammaMom) const |
|
Amg::Vector3D | childDirection (const Amg::Vector3D &gammaMom, double childE) const |
| simulate the one child direction - the second one is given clear then More...
|
|
double | phi1 (double delta) const |
| helper functions for the Phi1/phi2 More...
|
|
double | phi2 (double delta) const |
| helper functions for the Phi1/phi2 More...
|
|
The photon conversion tool, to be called by the MaterialUpdator.
- Author
- Sarka.nosp@m..Tod.nosp@m.orova.nosp@m.@cer.nosp@m.n.ch
Definition at line 48 of file PhotonConversionTool.h.
◆ PhotonConversionTool()
iFatras::PhotonConversionTool::PhotonConversionTool |
( |
const std::string & |
t, |
|
|
const std::string & |
n, |
|
|
const IInterface * |
p |
|
) |
| |
AlgTool constructor for PhotonConversionTool.
Definition at line 60 of file PhotonConversionTool.cxx.
89 declareProperty(
"ParticleBroker" ,
m_particleBroker ,
"ISF ParticleBroker Svc" );
90 declareProperty(
"TruthRecordSvc" ,
m_truthRecordSvc ,
"ISF Particle Truth Svc" );
92 declareProperty(
"PhysicsProcessCode" ,
m_processCode ,
"MCTruth Physics Process Code");
99 declareProperty(
"RandomNumberService" ,
m_rndGenSvc ,
"Random number generator");
100 declareProperty(
"RandomStreamName" ,
m_randomEngineName ,
"Name of the random number stream");
◆ ~PhotonConversionTool()
iFatras::PhotonConversionTool::~PhotonConversionTool |
( |
| ) |
|
|
virtualdefault |
◆ childDirection()
simulate the one child direction - the second one is given clear then
Definition at line 558 of file PhotonConversionTool.cxx.
576 double u = -
log(r2*r3)/
a;
578 theta *= (
r1 < 0.25 ) ?
u :
u*s_oneOverThree;
580 ATH_MSG_VERBOSE(
"[ conv ] Simulated angle to photon = " << theta <<
"." );
583 CLHEP::Hep3Vector gammaMomHep( gammaMom.x(), gammaMom.y(), gammaMom.z() );
584 CLHEP::Hep3Vector newDirectionHep(gammaMomHep.unit());
585 double x = -newDirectionHep.y();
586 double y = newDirectionHep.x();
589 if (newDirectionHep.z()*newDirectionHep.z() > 0.999999)
592 CLHEP::Hep3Vector deflectorHep(
x,
y,
z);
594 newDirectionHep.rotate(theta, deflectorHep);
596 newDirectionHep.rotate(psi,gammaMomHep);
606 Amg::Vector3D newDirection( newDirectionHep.x(), newDirectionHep.y(), newDirectionHep.z() );
◆ childEnergyFraction() [1/2]
simulate the child energy
Definition at line 449 of file PhotonConversionTool.cxx.
456 double oneOverZpow = 1./
pow(Z,s_oneOverThree);
457 double alphaZsquare = (s_alpha*s_alpha*
Z*
Z);
459 double fZ = alphaZsquare*(1./(1.+alphaZsquare)+0.20206-0.0369*alphaZsquare+0.0083*alphaZsquare*alphaZsquare);
460 double FZ = (8./3)*
log(Z)+8.*fZ;
462 double deltaMax =
exp((42.24-FZ)*.1195)-0.952;
464 double deltaMin = 4.*
epsilon0*136.*oneOverZpow;
466 double epsilon1 = 0.5-0.5*sqrt(1.-deltaMin/deltaMax);
469 double Phi1 =
phi1(deltaMin);
470 double Phi2 =
phi2(deltaMin);
472 double F10 = 3.*Phi1 - Phi2 - FZ;
473 double F20 = 1.5*Phi1 + 0.5*Phi2 - FZ;
475 double N1 = (0.25-epsilonMin+epsilonMin*epsilonMin)*F10;
481 double epsilon = 0.5 - (0.5 - epsilonMin)*
pow(CLHEP::RandFlat::shoot(
m_randomEngine),s_oneOverThree);
483 double delta = 136.*
epsilon0*oneOverZpow/(epsilon-epsilon*epsilon);
484 double F1 = 3.*
phi1(delta)-
phi2(delta)-FZ;
491 double epsilon = epsilonMin + (0.5-epsilonMin)*CLHEP::RandFlat::shoot(
m_randomEngine);
493 double delta = 136.*
epsilon0*oneOverZpow/(epsilon-epsilon*epsilon);
494 double F2 = 1.5*
phi1(delta)-0.5*
phi2(delta)-FZ;
◆ childEnergyFraction() [2/2]
double iFatras::PhotonConversionTool::childEnergyFraction |
( |
double |
gammaMom | ) |
const |
|
private |
Definition at line 504 of file PhotonConversionTool.cxx.
511 double oneOverZpow = 1./
pow(Z,s_oneOverThree);
512 double alphaZsquare = (s_alpha*s_alpha*
Z*
Z);
514 double fZ = alphaZsquare*(1./(1.+alphaZsquare)+0.20206-0.0369*alphaZsquare+0.0083*alphaZsquare*alphaZsquare);
515 double FZ = (8./3)*
log(Z)+8.*fZ;
517 double deltaMax =
exp((42.24-FZ)*.1195)-0.952;
519 double deltaMin = 4.*
epsilon0*136.*oneOverZpow;
521 double epsilon1 = 0.5-0.5*sqrt(1.-deltaMin/deltaMax);
524 double Phi1 =
phi1(deltaMin);
525 double Phi2 =
phi2(deltaMin);
527 double F10 = 3.*Phi1 - Phi2 - FZ;
528 double F20 = 1.5*Phi1 + 0.5*Phi2 - FZ;
530 double N1 = (0.25-epsilonMin+epsilonMin*epsilonMin)*F10;
536 double epsilon = 0.5 - (0.5 - epsilonMin)*
pow(CLHEP::RandFlat::shoot(
m_randomEngine),s_oneOverThree);
538 double delta = 136.*
epsilon0*oneOverZpow/(epsilon-epsilon*epsilon);
539 double F1 = 3.*
phi1(delta)-
phi2(delta)-FZ;
546 double epsilon = epsilonMin + (0.5-epsilonMin)*CLHEP::RandFlat::shoot(
m_randomEngine);
548 double delta = 136.*
epsilon0*oneOverZpow/(epsilon-epsilon*epsilon);
549 double F2 = 1.5*
phi1(delta)-0.5*
phi2(delta)-FZ;
◆ doConversion()
bool iFatras::PhotonConversionTool::doConversion |
( |
double |
time, |
|
|
const Trk::NeutralParameters & |
parm, |
|
|
const Trk::ExtendedMaterialProperties * |
extMatProp = 0 |
|
) |
| const |
interface for processing of the presampled pair production
Definition at line 611 of file PhotonConversionTool.cxx.
619 double childEnergy =
p*efrac;
627 ATH_MSG_VERBOSE(
"[ conv ] Child energy simulated as : " << childEnergy <<
" MeV" );
◆ doConversionOnLayer()
interface for processing of the presampled nuclear interactions on layer
Definition at line 643 of file PhotonConversionTool.cxx.
651 double childEnergy =
p*efrac;
659 ATH_MSG_VERBOSE(
"[ conv ] Child energy simulated as : " << childEnergy <<
" MeV" );
◆ finalize()
StatusCode iFatras::PhotonConversionTool::finalize |
( |
| ) |
|
◆ getChilds()
get childs - for layer update
Definition at line 315 of file PhotonConversionTool.cxx.
328 CLHEP::HepLorentzVector vtmp;
329 CLHEP::Hep3Vector photonDirectionHep( photonDirection.x(), photonDirection.y(), photonDirection.z() );
331 vtmp = CLHEP::HepLorentzVector(photonEnergy*photonDirectionHep, photonEnergy)
332 - CLHEP::HepLorentzVector(
p1*childDirectionHep, childEnergy);
334 double p2 = vtmp.vect().mag();
338 double charge1, charge2;
339 charge1 = charge2 = 0.;
390 truth.updateChildParticleProperties();
393 for (
auto *childParticle :
children) {
394 if (!childParticle->getTruthBinding()) {
395 ATH_MSG_ERROR(
"Could not retrieve TruthBinding from child ISFParticle "<< *childParticle);
◆ initialize()
StatusCode iFatras::PhotonConversionTool::initialize |
( |
| ) |
|
AlgTool initailize method.
Definition at line 112 of file PhotonConversionTool.cxx.
119 return StatusCode::FAILURE;
123 return StatusCode::FAILURE;
129 return StatusCode::FAILURE;
135 return StatusCode::FAILURE;
156 SmartIF<ITHistSvc> tHistSvc{Gaudi::svcLocator()->service(
"THistSvc")};
158 ATH_MSG_ERROR(
"initialize() Could not find Hist Service -> Switching ValidationMode Off !" );
162 ATH_MSG_ERROR(
"initialize() Could not register the validation Tree -> Switching ValidationMode Off !" );
169 return StatusCode::SUCCESS;
◆ pairProduction()
interface for processing of the pair production
Definition at line 402 of file PhotonConversionTool.cxx.
421 double p0 = -7.01612e-03;
422 double p1 = 7.69040e-02;
423 double p2 = -6.07682e-01;
427 double attenuation =
exp( -7.777
e-01*pathCorrection*mprop.
thicknessInX0()*(1.-xi) );
429 ATH_MSG_VERBOSE(
"[ conv ] Propability of conversion = " << (1.-attenuation) * 100. <<
" %." );
◆ phi1()
double iFatras::PhotonConversionTool::phi1 |
( |
double |
delta | ) |
const |
|
inlineprivate |
helper functions for the Phi1/phi2
Definition at line 157 of file PhotonConversionTool.h.
159 return 20.867 - 3.242 * delta + 0.625*delta*delta;
161 return 21.12 - 4.184*
log(delta+0.952);
◆ phi2()
double iFatras::PhotonConversionTool::phi2 |
( |
double |
delta | ) |
const |
|
inlineprivate |
helper functions for the Phi1/phi2
Definition at line 164 of file PhotonConversionTool.h.
166 return 20.209 - 1.930 * delta + 0.086*delta*delta;
167 return 21.12 - 4.184*
log(delta+0.952);
◆ recordChilds()
record childs - create interface already for mu-/mu+ pair production
Definition at line 186 of file PhotonConversionTool.cxx.
203 CLHEP::HepLorentzVector vtmp;
204 CLHEP::Hep3Vector photonDirectionHep( photonDirection.x(), photonDirection.y(), photonDirection.z() );
206 vtmp = CLHEP::HepLorentzVector(photonEnergy*photonDirectionHep, photonEnergy)
207 - CLHEP::HepLorentzVector(
p1*childDirectionHep, childEnergy);
209 double p2 = vtmp.vect().mag();
213 double charge1, charge2;
214 charge1 = charge2 = 0.;
294 truth.updateChildParticleProperties();
298 for (
auto *childParticle :
children) {
300 if (!childParticle->getTruthBinding()) {
301 ATH_MSG_ERROR(
"Could not retrieve TruthBinding from child ISFParticle "<< *childParticle);
◆ m_childEnergyScaleFactor
double iFatras::PhotonConversionTool::m_childEnergyScaleFactor |
|
private |
◆ m_conversionChildAngle
float iFatras::PhotonConversionTool::m_conversionChildAngle |
|
mutableprivate |
◆ m_conversionChildEnergy
float iFatras::PhotonConversionTool::m_conversionChildEnergy |
|
mutableprivate |
◆ m_conversionPhotonEnergy
float iFatras::PhotonConversionTool::m_conversionPhotonEnergy |
|
mutableprivate |
◆ m_conversionPointR
float iFatras::PhotonConversionTool::m_conversionPointR |
|
mutableprivate |
◆ m_conversionPointX
float iFatras::PhotonConversionTool::m_conversionPointX |
|
mutableprivate |
◆ m_conversionPointY
float iFatras::PhotonConversionTool::m_conversionPointY |
|
mutableprivate |
◆ m_conversionPointZ
float iFatras::PhotonConversionTool::m_conversionPointZ |
|
mutableprivate |
◆ m_conversionProbScaleFactor
double iFatras::PhotonConversionTool::m_conversionProbScaleFactor |
|
private |
◆ m_droppedConversions
int iFatras::PhotonConversionTool::m_droppedConversions |
|
mutableprivate |
◆ m_minChildEnergy
double iFatras::PhotonConversionTool::m_minChildEnergy |
|
private |
◆ m_particleBroker
◆ m_processCode
int iFatras::PhotonConversionTool::m_processCode |
|
private |
◆ m_randomEngine
CLHEP::HepRandomEngine* iFatras::PhotonConversionTool::m_randomEngine |
|
private |
◆ m_randomEngineName
std::string iFatras::PhotonConversionTool::m_randomEngineName |
|
private |
◆ m_recordedConversions
int iFatras::PhotonConversionTool::m_recordedConversions |
|
mutableprivate |
◆ m_referenceMaterial
bool iFatras::PhotonConversionTool::m_referenceMaterial |
|
private |
◆ m_rndGenSvc
◆ m_truthRecordSvc
◆ m_validationMode
bool iFatras::PhotonConversionTool::m_validationMode |
|
private |
◆ m_validationTool
◆ m_validationTree
TTree* iFatras::PhotonConversionTool::m_validationTree |
|
private |
◆ m_validationTreeDescription
std::string iFatras::PhotonConversionTool::m_validationTreeDescription |
|
private |
◆ m_validationTreeFolder
std::string iFatras::PhotonConversionTool::m_validationTreeFolder |
|
private |
◆ m_validationTreeName
std::string iFatras::PhotonConversionTool::m_validationTreeName |
|
private |
◆ s_pdgToHypo
The documentation for this class was generated from the following files:
Trk::ParticleHypothesis convert(int pdg, bool &stable, bool &exiting, double charge=1.) const
Converter method : PDG -> Particle Hyptothesis.
const Amg::Vector3D & position() const
Access method for the position.
void setProcess(int proc)
static ParticleClipboard & getInstance()
get the singleton instance
float thicknessInX0() const
Return the radiationlength fraction.
#define ATH_MSG_VERBOSE(x)
@ u
Enums for curvilinear frames.
std::vector< ISF::ISFParticle * > ISFParticleVector
ISFParticle vector.
constexpr int UNDEFINED_ID
void setGeneration(int gen)
constexpr double mass[PARTICLEHYPOTHESES]
the array of masses
constexpr int SIM_STATUS_THRESHOLD
Constant definiting the status threshold for simulated particles, eg. can be used to separate generat...
void setUserInformation(ParticleUserInformation *userInfo)
Eigen::Matrix< double, 3, 1 > Vector3D
const ISF::ISFParticle * getParticle() const
get the particle from the clipboard
const Amg::Vector3D & momentum() const
Access method for the momentum.
float averageZ() const
Returns the average Z of the material.
constexpr int pow(int base, int exp) noexcept