![Logo](../../ATLAS-Logo-Square-Blue-RGB.png) |
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 |
|
) |
| |
◆ ~HadIntProcessorParametric()
iFatras::HadIntProcessorParametric::~HadIntProcessorParametric |
( |
| ) |
|
|
virtualdefault |
◆ absorptionLength()
interface for calculation of absorption length
absorption length
Definition at line 230 of file HadIntProcessorParametric.cxx.
232 double al =
mat->l0();
243 al *= 1./(1.+
exp(-0.5*(
p-270.)*(
p-270.)/60./60.));
◆ doHadIntOnLayer()
◆ doHadronicInteraction()
Definition at line 661 of file HadIntProcessorParametric.cxx.
677 if (processSecondaries && !ispVec.empty() ) {
678 for (
auto *childParticle : ispVec) {
680 if (!childParticle->getTruthBinding()) {
681 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 252 of file HadIntProcessorParametric.cxx.
262 double E = sqrt(
p*
p +
m*
m);
265 double multiplicity_max = 0.25 *
E/1000. + 18.;
268 double randx , randy,
arg = 0.;
284 arg =
exp(-0.5*( (randx-p1)/p2 +
exp(-(randx-p1)/p2) ) );
285 if (randy < arg && randx>3 && randx<multiplicity_max)
break;
288 randx *= (1.2-0.4*
exp(-0.001*
p));
290 int Npart = (
int)randx;
294 ATH_MSG_VERBOSE(
"[ had ] Number of particles smaller than 3, parameterisation not valid."
295 <<
" Doing Nothing");
300 <<
" with " << Npart <<
" outgoing particles " );
305 ATH_MSG_DEBUG(
"[ had ] create hadronic shower for particle with PDG ID "
306 <<
parent->pdgCode() <<
" and barcode "
329 <<
E <<
" | " <<
m <<
" | " <<
p <<
" | " );
333 ATH_MSG_VERBOSE(
"[ had ] interaction initiated by a secondary particle, no children saved " );
341 double chargedist = 0.;
342 std::vector<double>
charge(Npart);
343 std::vector<Trk::ParticleHypothesis> childType(Npart);
344 std::vector<double> newm(Npart);
345 std::vector<int> pdgid(Npart);
373 for (
int i=0;
i<Npart;
i++) {
375 if (chargedist<pif) {
382 if ( chargedist<2*pif) {
389 if (chargedist<3*pif) {
396 if (chargedist<3*pif+nef) {
403 if (chargedist<3*pif+nef+prf) {
418 for (
int i=1;
i<Npart;
i++) {
420 childType[
i]=childType[0];
451 std::vector<double>
mom(Npart);
452 std::vector<double>
th(Npart);
453 std::vector<double> ph(Npart);
456 double eps = 2./Npart;
458 mom[0] = 0.5*
pow(eps,rnd);
466 double ptot =
mom[0];
469 for (
int i=1;
i<Npart-2;
i++) {
473 if (ptemp.mag()<1-ptot) {
474 while ( fabs(ptemp.mag()-
mom[
i])>1-ptot-
mom[
i] ){
479 double p_rem=1-ptot-
mom[
i];
480 double cthmax = fmin(1.,(-ptemp.mag()*ptemp.mag()-
mom[
i]*
mom[
i]+p_rem*p_rem)/2/ptemp.mag()/
mom[
i]);
483 theta = acos( (cthmax+1.)*rnd-1.);
486 HepGeom::Vector3D<double> dnewHep = HepGeom::RotateZ3D(ptemp.phi())*HepGeom::RotateY3D(ptemp.theta())*
test;
490 ptemp +=
mom[
i]*dnew;
496 mom[Npart-1] = 1-ptot-
mom[Npart-2];
498 if (ptemp.mag()<1-ptot) {
499 while (
mom[Npart-1]+
mom[Npart-2]<ptemp.mag()) {
501 mom[Npart-1] = 1-ptot-
mom[Npart-2];
504 if (ptemp.mag()<fabs(
mom[Npart-1]-
mom[Npart-2]) ) {
510 double cth =(-ptemp.mag()*ptemp.mag()-
mom[Npart-2]*
mom[Npart-2]+
mom[Npart-1]*
mom[Npart-1])/2/ptemp.mag()/
mom[Npart-2];
511 if (fabs(cth)>1.) cth = (cth>0.) ? 1. : -1.;
516 HepGeom::Vector3D<double> dnewHep = HepGeom::RotateZ3D(ptemp.phi())*HepGeom::RotateY3D(ptemp.theta())*
test;
519 th[Npart-2]=dnew.theta();
520 ph[Npart-2]=dnew.phi();
521 ptemp +=
mom[Npart-2]*dnew;
523 th[Npart-1]=dlast.theta();
524 ph[Npart-1]=dlast.phi();
529 for (
int i=0;
i<Npart;
i++) etot += sqrt(
mom[
i]*
mom[
i]+newm[
i]*newm[
i]);
531 for (
int i=0;
i<Npart;
i++) summ += newm[
i];
535 float scale = sqrt(summ*summ+2*summ*
p+
m*
m)/etot;
537 for (
int i=0;
i<Npart;
i++) {
543 CLHEP::HepLorentzVector bv(
p*particleDir.unit().x(),
p*particleDir.unit().y(),
p*particleDir.unit().z(),sqrt(etot*etot+
p*
p));
544 std::vector<CLHEP::HepLorentzVector> childBoost(Npart);
552 for (
int i=0;
i<Npart;
i++) {
557 CLHEP::HepLorentzVector newp(childP.x(),childP.y(),childP.z(),sqrt(
mom[
i]*
mom[
i]+newm[
i]*newm[
i]));
558 CLHEP::HepLorentzVector childPB = newp.boost(bv.boostVector());
559 childBoost[
i]=childPB;
571 unsigned short numChildren = 0;
573 for (
int i=0;
i<Npart;
i++) {
574 if (pdgid[
i]<10000) {
578 eout += childBoost[
i].e();
625 ++childrenIt; numChildren++;
641 truth.updateChildParticleProperties();
655 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 ITHistSvc* tHistSvc =
nullptr;
137 if (service(
"THistSvc",tHistSvc).isFailure())
138 ATH_MSG_ERROR(
"initialize() Could not find Hist Service -> Switching ValidationMode Off !" );
141 ATH_MSG_VERBOSE(
"Booking hadronic interaction validation TTree ... " );
172 ATH_MSG_ERROR(
"initialize() Could not register the validation Tree -> Switching ValidationMode Off !" );
175 ATH_MSG_INFO(
"TTree for Hadronic Interactions validation booked." );
179 return StatusCode::SUCCESS;
◆ recordHadState()
interface for processing of the presampled nuclear interaction
Definition at line 702 of file HadIntProcessorParametric.cxx.
717 if (!ispVec.empty() ) {
718 for (
auto *childParticle : ispVec) {
720 if (!childParticle->getTruthBinding()) {
721 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
Scalar phi() const
phi method
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
Scalar theta() const
theta method
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
def time(flags, cells_name, *args, **kw)
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