|
ATLAS Offline Software
|
#include <HadIntProcessorParametric.h>
|
| HadIntProcessorParametric (const std::string &, const std::string &, const IInterface *) |
| AlgTool constructor for HadIntProcessorParametric. More...
|
|
virtual | ~HadIntProcessorParametric () |
| Destructor. More...
|
|
StatusCode | initialize () |
| AlgTool initailize method. More...
|
|
StatusCode | finalize () |
| AlgTool finalize method. More...
|
|
bool | hadronicInteraction (const Amg::Vector3D &position, const Amg::Vector3D &momentum, double p, double E, double charge, const Trk::MaterialProperties &mprop, double pathCorrection, Trk::ParticleHypothesis particle=Trk::pion) const |
| interface for processing of the nuclear interactions More...
|
|
bool | recordHadState (double time, double p, const Amg::Vector3D &vertex, const Amg::Vector3D &particleDir, Trk::ParticleHypothesis particle) const |
| interface for processing of the presampled nuclear interaction More...
|
|
bool | doHadronicInteraction (double time, const Amg::Vector3D &position, const Amg::Vector3D &momentum, const Trk::Material *emat, Trk::ParticleHypothesis particle, bool processSecondaries) const |
|
ISF::ISFParticleVector | doHadIntOnLayer (const ISF::ISFParticle *parent, double time, const Amg::Vector3D &position, const Amg::Vector3D &momentum, const Trk::Material *emat, Trk::ParticleHypothesis particle) const |
|
Parametric implementation of nuclear interactions to be used in Fatras. The parameterisation is gathered from Geant4.
- Author
- Andre.nosp@m.as.S.nosp@m.alzbu.nosp@m.rger.nosp@m.@cern.nosp@m..ch, Carst.nosp@m.en.M.nosp@m.agass.nosp@m.@cer.nosp@m.n.ch
Definition at line 54 of file HadIntProcessorParametric.h.
◆ HadIntProcessorParametric()
iFatras::HadIntProcessorParametric::HadIntProcessorParametric |
( |
const std::string & |
t, |
|
|
const std::string & |
n, |
|
|
const IInterface * |
p |
|
) |
| |
AlgTool constructor for HadIntProcessorParametric.
Definition at line 40 of file HadIntProcessorParametric.cxx.
81 declareProperty(
"ShortenHadIntChain" ,
m_cutChain);
86 declareProperty(
"RandomNumberService" ,
m_rndGenSvc ,
"Random number generator");
87 declareProperty(
"RandomStreamName" ,
m_randomEngineName ,
"Name of the random number stream");
89 declareProperty(
"PhysicsProcessCode" ,
m_processCode ,
"MCTruth Physics Process Code" );
91 declareProperty(
"ParticleBroker" ,
m_particleBroker ,
"ISF ParticleBroker Svc" );
92 declareProperty(
"TruthRecordSvc" ,
m_truthRecordSvc ,
"ISF Particle Truth Svc" );
◆ ~HadIntProcessorParametric()
iFatras::HadIntProcessorParametric::~HadIntProcessorParametric |
( |
| ) |
|
|
virtualdefault |
◆ absorptionLength()
interface for calculation of absorption length
absorption length
Definition at line 228 of file HadIntProcessorParametric.cxx.
230 double al =
mat->l0();
241 al *= 1./(1.+
exp(-0.5*(
p-270.)*(
p-270.)/60./60.));
◆ doHadIntOnLayer()
◆ doHadronicInteraction()
Definition at line 659 of file HadIntProcessorParametric.cxx.
675 if (processSecondaries && !ispVec.empty() ) {
676 for (
auto *childParticle : ispVec) {
678 if (!childParticle->getTruthBinding()) {
679 ATH_MSG_ERROR(
"Could not retrieve TruthBinding from child ISFParticle "<< *childParticle);
◆ finalize()
StatusCode iFatras::HadIntProcessorParametric::finalize |
( |
| ) |
|
◆ getHadState()
collect secondaries for layer material update
Definition at line 250 of file HadIntProcessorParametric.cxx.
260 double E = sqrt(
p*
p +
m*
m);
263 double multiplicity_max = 0.25 *
E/1000. + 18.;
266 double randx , randy,
arg = 0.;
283 if (randy < arg && randx>3 && randx<multiplicity_max)
break;
286 randx *= (1.2-0.4*
exp(-0.001*
p));
288 int Npart = (
int)randx;
292 ATH_MSG_VERBOSE(
"[ had ] Number of particles smaller than 3, parameterisation not valid."
293 <<
" Doing Nothing");
298 <<
" with " << Npart <<
" outgoing particles " );
303 ATH_MSG_DEBUG(
"[ had ] create hadronic shower for particle with PDG ID "
304 <<
parent->pdgCode() <<
" and barcode "
327 <<
E <<
" | " <<
m <<
" | " <<
p <<
" | " );
331 ATH_MSG_VERBOSE(
"[ had ] interaction initiated by a secondary particle, no children saved " );
339 double chargedist = 0.;
340 std::vector<double>
charge(Npart);
341 std::vector<Trk::ParticleHypothesis> childType(Npart);
342 std::vector<double> newm(Npart);
343 std::vector<int> pdgid(Npart);
371 for (
int i=0;
i<Npart;
i++) {
373 if (chargedist<pif) {
380 if ( chargedist<2*pif) {
387 if (chargedist<3*pif) {
394 if (chargedist<3*pif+nef) {
401 if (chargedist<3*pif+nef+prf) {
416 for (
int i=1;
i<Npart;
i++) {
418 childType[
i]=childType[0];
449 std::vector<double>
mom(Npart);
450 std::vector<double>
th(Npart);
451 std::vector<double> ph(Npart);
454 double eps = 2./Npart;
456 mom[0] = 0.5*
pow(eps,rnd);
464 double ptot =
mom[0];
467 for (
int i=1;
i<Npart-2;
i++) {
471 if (ptemp.mag()<1-ptot) {
472 while ( fabs(ptemp.mag()-
mom[
i])>1-ptot-
mom[
i] ){
477 double p_rem=1-ptot-
mom[
i];
478 double cthmax = fmin(1.,(-ptemp.mag()*ptemp.mag()-
mom[
i]*
mom[
i]+p_rem*p_rem)/2/ptemp.mag()/
mom[
i]);
481 theta = acos( (cthmax+1.)*rnd-1.);
484 HepGeom::Vector3D<double> dnewHep = HepGeom::RotateZ3D(ptemp.phi())*HepGeom::RotateY3D(ptemp.theta())*
test;
488 ptemp +=
mom[
i]*dnew;
494 mom[Npart-1] = 1-ptot-
mom[Npart-2];
496 if (ptemp.mag()<1-ptot) {
497 while (
mom[Npart-1]+
mom[Npart-2]<ptemp.mag()) {
499 mom[Npart-1] = 1-ptot-
mom[Npart-2];
502 if (ptemp.mag()<fabs(
mom[Npart-1]-
mom[Npart-2]) ) {
508 double cth =(-ptemp.mag()*ptemp.mag()-
mom[Npart-2]*
mom[Npart-2]+
mom[Npart-1]*
mom[Npart-1])/2/ptemp.mag()/
mom[Npart-2];
509 if (fabs(cth)>1.) cth = (cth>0.) ? 1. : -1.;
514 HepGeom::Vector3D<double> dnewHep = HepGeom::RotateZ3D(ptemp.phi())*HepGeom::RotateY3D(ptemp.theta())*
test;
517 th[Npart-2]=dnew.theta();
518 ph[Npart-2]=dnew.phi();
519 ptemp +=
mom[Npart-2]*dnew;
521 th[Npart-1]=dlast.theta();
522 ph[Npart-1]=dlast.phi();
527 for (
int i=0;
i<Npart;
i++) etot += sqrt(
mom[
i]*
mom[
i]+newm[
i]*newm[
i]);
529 for (
int i=0;
i<Npart;
i++) summ += newm[
i];
533 float scale = sqrt(summ*summ+2*summ*
p+
m*
m)/etot;
535 for (
int i=0;
i<Npart;
i++) {
541 CLHEP::HepLorentzVector bv(
p*particleDir.unit().x(),
p*particleDir.unit().y(),
p*particleDir.unit().z(),sqrt(etot*etot+
p*
p));
542 std::vector<CLHEP::HepLorentzVector> childBoost(Npart);
550 for (
int i=0;
i<Npart;
i++) {
555 CLHEP::HepLorentzVector newp(childP.x(),childP.y(),childP.z(),sqrt(
mom[
i]*
mom[
i]+newm[
i]*newm[
i]));
556 CLHEP::HepLorentzVector childPB = newp.boost(bv.boostVector());
557 childBoost[
i]=childPB;
569 unsigned short numChildren = 0;
571 for (
int i=0;
i<Npart;
i++) {
572 if (pdgid[
i]<10000) {
576 eout += childBoost[
i].e();
623 ++childrenIt; numChildren++;
639 truth.updateChildParticleProperties();
653 ATH_MSG_VERBOSE(
"[ had ] it was kinematically possible to create " << gen_part <<
" shower particles " );
◆ hadronicInteraction()
◆ initialize()
StatusCode iFatras::HadIntProcessorParametric::initialize |
( |
| ) |
|
AlgTool initailize method.
Definition at line 101 of file HadIntProcessorParametric.cxx.
109 return StatusCode::FAILURE;
117 return StatusCode::FAILURE;
123 return StatusCode::FAILURE;
127 return StatusCode::FAILURE;
135 SmartIF<ITHistSvc> tHistSvc{Gaudi::svcLocator()->service(
"THistSvc")};
137 ATH_MSG_ERROR(
"initialize() Could not find Hist Service -> Switching ValidationMode Off !" );
139 ATH_MSG_VERBOSE(
"Booking hadronic interaction validation TTree ... " );
170 ATH_MSG_ERROR(
"initialize() Could not register the validation Tree -> Switching ValidationMode Off !" );
173 ATH_MSG_INFO(
"TTree for Hadronic Interactions validation booked." );
177 return StatusCode::SUCCESS;
◆ recordHadState()
interface for processing of the presampled nuclear interaction
Definition at line 700 of file HadIntProcessorParametric.cxx.
715 if (!ispVec.empty() ) {
716 for (
auto *childParticle : ispVec) {
718 if (!childParticle->getTruthBinding()) {
719 ATH_MSG_ERROR(
"Could not retrieve TruthBinding from child ISFParticle "<< *childParticle);
◆ m_childMomParam
double iFatras::HadIntProcessorParametric::m_childMomParam |
|
private |
◆ m_cutChain
bool iFatras::HadIntProcessorParametric::m_cutChain |
|
private |
◆ m_hadIntChildDeltaEta
float iFatras::HadIntProcessorParametric::m_hadIntChildDeltaEta[MAXHADINTCHILDREN] {} |
|
mutableprivate |
◆ m_hadIntChildDeltaPhi
float iFatras::HadIntProcessorParametric::m_hadIntChildDeltaPhi[MAXHADINTCHILDREN] {} |
|
mutableprivate |
◆ m_hadIntChildE
float iFatras::HadIntProcessorParametric::m_hadIntChildE |
|
mutableprivate |
◆ m_hadIntChildEta
◆ m_hadIntChildP
◆ m_hadIntChildPcms
◆ m_hadIntChildPdg
◆ m_hadIntChildPhi
◆ m_hadIntChildren
int iFatras::HadIntProcessorParametric::m_hadIntChildren |
|
mutableprivate |
◆ m_hadIntChildTh
◆ m_hadIntChildThc
◆ m_hadIntFromX0
bool iFatras::HadIntProcessorParametric::m_hadIntFromX0 |
|
private |
◆ m_hadIntMotherBarcode
int iFatras::HadIntProcessorParametric::m_hadIntMotherBarcode |
|
mutableprivate |
◆ m_hadIntMotherEta
float iFatras::HadIntProcessorParametric::m_hadIntMotherEta |
|
mutableprivate |
◆ m_hadIntMotherP
float iFatras::HadIntProcessorParametric::m_hadIntMotherP |
|
mutableprivate |
◆ m_hadIntMotherPdg
int iFatras::HadIntProcessorParametric::m_hadIntMotherPdg |
|
mutableprivate |
◆ m_hadIntMotherPhi
float iFatras::HadIntProcessorParametric::m_hadIntMotherPhi |
|
mutableprivate |
◆ m_hadIntMotherPt
float iFatras::HadIntProcessorParametric::m_hadIntMotherPt |
|
mutableprivate |
◆ m_hadIntPointR
float iFatras::HadIntProcessorParametric::m_hadIntPointR |
|
mutableprivate |
◆ m_hadIntPointX
float iFatras::HadIntProcessorParametric::m_hadIntPointX |
|
mutableprivate |
◆ m_hadIntPointY
float iFatras::HadIntProcessorParametric::m_hadIntPointY |
|
mutableprivate |
◆ m_hadIntPointZ
float iFatras::HadIntProcessorParametric::m_hadIntPointZ |
|
mutableprivate |
◆ m_hadIntProbScale
double iFatras::HadIntProcessorParametric::m_hadIntProbScale |
|
private |
◆ m_hadIntValidation
bool iFatras::HadIntProcessorParametric::m_hadIntValidation |
|
private |
◆ m_hadIntValidationTree
TTree* iFatras::HadIntProcessorParametric::m_hadIntValidationTree |
|
private |
◆ m_hadIntValidationTreeDescription
std::string iFatras::HadIntProcessorParametric::m_hadIntValidationTreeDescription |
|
private |
◆ m_hadIntValidationTreeFolder
std::string iFatras::HadIntProcessorParametric::m_hadIntValidationTreeFolder |
|
private |
◆ m_hadIntValidationTreeName
std::string iFatras::HadIntProcessorParametric::m_hadIntValidationTreeName |
|
private |
◆ m_minimumHadInitialEnergy
double iFatras::HadIntProcessorParametric::m_minimumHadInitialEnergy |
|
private |
◆ m_minimumHadOutEnergy
double iFatras::HadIntProcessorParametric::m_minimumHadOutEnergy |
|
private |
◆ m_particleBroker
◆ m_processCode
int iFatras::HadIntProcessorParametric::m_processCode |
|
private |
◆ m_randomEngine
CLHEP::HepRandomEngine* iFatras::HadIntProcessorParametric::m_randomEngine |
|
private |
◆ m_randomEngineName
std::string iFatras::HadIntProcessorParametric::m_randomEngineName |
|
private |
◆ m_rndGenSvc
◆ m_truthRecordSvc
◆ m_validationMode
bool iFatras::HadIntProcessorParametric::m_validationMode |
|
private |
◆ m_validationTool
The documentation for this class was generated from the following files:
JetConstituentVector::iterator iterator
ServiceHandle< IAtRndmGenSvc > m_rndGenSvc
Random Generator service.
constexpr ParticleHypothesis particle[PARTICLEHYPOTHESES]
the array of masses
double m_minimumHadInitialEnergy
ServiceHandle< ISF::ITruthSvc > m_truthRecordSvc
CLHEP::HepRandomEngine * m_randomEngine
Random engine
void setProcess(int proc)
setSAddress setEtaMS setDirPhiMS setDirZMS setBarrelRadius setEndcapAlpha setEndcapRadius setInterceptInner setEtaMap setEtaBin setIsTgcFailure setDeltaPt deltaPhi
static ParticleClipboard & getInstance()
get the singleton instance
bool recordHadState(double time, double p, const Amg::Vector3D &vertex, const Amg::Vector3D &particleDir, Trk::ParticleHypothesis particle) const
interface for processing of the presampled nuclear interaction
float thicknessInX0() const
Return the radiationlength fraction.
float m_hadIntMotherPt
ntuple variable : hadronic interaction mother momentum
float thicknessInL0() const
Return the nuclear interaction length fraction.
float m_hadIntPointR
ntuple variable : hadronic interaction point r distance
ISF::ISFParticleVector getHadState(const ISF::ISFParticle *parent, double time, double p, const Amg::Vector3D &vertex, const Amg::Vector3D &particleDir, Trk::ParticleHypothesis particle) const
collect secondaries for layer material update
float m_hadIntChildPcms[MAXHADINTCHILDREN]
nutple variable : hadronic interaction child Energy
#define ATH_MSG_VERBOSE(x)
int m_processCode
MCTruth process code for TruthIncidents created by this tool.
float m_hadIntPointZ
ntuple variable : hadronic interaction point z coordinate
float m_hadIntPointY
ntuple variable : hadronic interaction point y coordinate
float m_hadIntChildTh[MAXHADINTCHILDREN]
nutple variable : hadronic interaction child phi
float thickness() const
Return the thickness in mm.
float m_hadIntChildDeltaPhi[MAXHADINTCHILDREN]
nutple variable : hadronic interaction child delta phi
int m_hadIntMotherPdg
ntuple variable : hadronic interaction mother Pdg
float m_hadIntMotherEta
ntuple variable : hadronic interaction photon eta
std::string m_hadIntValidationTreeName
validation tree name - to be acessed by this from root
std::vector< ISF::ISFParticle * > ISFParticleVector
ISFParticle vector.
int m_hadIntMotherBarcode
ntuple variable : hadronic interaction mother barcode
float m_hadIntChildP[MAXHADINTCHILDREN]
nutple variable : hadronic interaction child Energy
float m_hadIntMotherP
ntuple variable : hadronic interaction mother momentum
#define MAXHADINTCHILDREN
ServiceHandle< ISF::IParticleBroker > m_particleBroker
ISF services & Tools.
float m_hadIntMotherPhi
ntuple variable : hadronic interaction mother phi
constexpr int UNDEFINED_ID
void setGeneration(int gen)
TTree * m_hadIntValidationTree
Root Validation Tree.
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...
double charge(const T &p)
std::string m_hadIntValidationTreeDescription
validation tree description - second argument in TTree
void setUserInformation(ParticleUserInformation *userInfo)
float m_hadIntChildDeltaEta[MAXHADINTCHILDREN]
nutple variable : hadronic interaction child delta eta
Eigen::Matrix< double, 3, 1 > Vector3D
ToolHandle< IPhysicsValidationTool > m_validationTool
const ISF::ISFParticle * getParticle() const
get the particle from the clipboard
double m_minimumHadOutEnergy
hadronic interaction setting
float averageZ() const
Returns the average Z of the material.
std::string m_randomEngineName
Name of the random number stream.
float m_hadIntChildPhi[MAXHADINTCHILDREN]
nutple variable : hadronic interaction child phi
float m_hadIntPointX
ntuple variable : hadronic interaction point x coordinate
float m_hadIntChildEta[MAXHADINTCHILDREN]
nutple variable : hadronic interaction child eta
int generations(const T &p)
Method to return how many interactions a particle has undergone during simulation (TODO migrate to be...
float m_hadIntChildE
nutple variable : hadronic interaction children total energy
int m_hadIntChildPdg[MAXHADINTCHILDREN]
nutple variable : hadronic interaction child Pdg
std::string m_hadIntValidationTreeFolder
stream/folder to for the TTree to be written out
int m_hadIntChildren
nutple variable : hadronic interaction children numbers
static double absorptionLength(const Trk::MaterialProperties *mat, double p, double q, Trk::ParticleHypothesis particle=Trk::pion)
interface for calculation of absorption length
float m_hadIntChildThc[MAXHADINTCHILDREN]
nutple variable : hadronic interaction child eta