ATLAS Offline Software
Public Member Functions | Private Member Functions | Static Private Member Functions | Private Attributes | List of all members
iFatras::HadIntProcessorParametric Class Reference

#include <HadIntProcessorParametric.h>

Inheritance diagram for iFatras::HadIntProcessorParametric:
Collaboration diagram for iFatras::HadIntProcessorParametric:

Public Member Functions

 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
 

Private Member Functions

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 More...
 

Static Private Member Functions

static double absorptionLength (const Trk::MaterialProperties *mat, double p, double q, Trk::ParticleHypothesis particle=Trk::pion)
 interface for calculation of absorption length More...
 

Private Attributes

double m_minimumHadOutEnergy
 hadronic interaction setting More...
 
double m_childMomParam
 
bool m_cutChain
 
bool m_hadIntFromX0
 
double m_hadIntProbScale
 
double m_minimumHadInitialEnergy
 
ServiceHandle< ISF::IParticleBrokerm_particleBroker
 ISF services & Tools. More...
 
ServiceHandle< ISF::ITruthSvcm_truthRecordSvc
 
ServiceHandle< IAtRndmGenSvcm_rndGenSvc
 Random Generator service. More...
 
int m_processCode
 MCTruth process code for TruthIncidents created by this tool. More...
 
CLHEP::HepRandomEngine * m_randomEngine
 Random engine
More...
 
std::string m_randomEngineName
 Name of the random number stream. More...
 
bool m_validationMode
 
ToolHandle< IPhysicsValidationToolm_validationTool
 
bool m_hadIntValidation
 
std::string m_hadIntValidationTreeName
 validation tree name - to be acessed by this from root More...
 
std::string m_hadIntValidationTreeDescription
 validation tree description - second argument in TTree More...
 
std::string m_hadIntValidationTreeFolder
 stream/folder to for the TTree to be written out More...
 
TTree * m_hadIntValidationTree
 Root Validation Tree. More...
 
float m_hadIntPointX
 ntuple variable : hadronic interaction point x coordinate More...
 
float m_hadIntPointY
 ntuple variable : hadronic interaction point y coordinate More...
 
float m_hadIntPointR
 ntuple variable : hadronic interaction point r distance More...
 
float m_hadIntPointZ
 ntuple variable : hadronic interaction point z coordinate More...
 
int m_hadIntMotherPdg
 ntuple variable : hadronic interaction mother Pdg More...
 
int m_hadIntMotherBarcode
 ntuple variable : hadronic interaction mother barcode More...
 
float m_hadIntMotherP
 ntuple variable : hadronic interaction mother momentum More...
 
float m_hadIntMotherPt
 ntuple variable : hadronic interaction mother momentum More...
 
float m_hadIntMotherPhi
 ntuple variable : hadronic interaction mother phi More...
 
float m_hadIntMotherEta
 ntuple variable : hadronic interaction photon eta More...
 
int m_hadIntChildren
 nutple variable : hadronic interaction children numbers More...
 
float m_hadIntChildE
 nutple variable : hadronic interaction children total energy More...
 
float m_hadIntChildP [MAXHADINTCHILDREN] {}
 nutple variable : hadronic interaction child Energy More...
 
float m_hadIntChildPcms [MAXHADINTCHILDREN] {}
 nutple variable : hadronic interaction child Energy More...
 
int m_hadIntChildPdg [MAXHADINTCHILDREN] {}
 nutple variable : hadronic interaction child Pdg More...
 
float m_hadIntChildPhi [MAXHADINTCHILDREN] {}
 nutple variable : hadronic interaction child phi More...
 
float m_hadIntChildEta [MAXHADINTCHILDREN] {}
 nutple variable : hadronic interaction child eta More...
 
float m_hadIntChildTh [MAXHADINTCHILDREN] {}
 nutple variable : hadronic interaction child phi More...
 
float m_hadIntChildThc [MAXHADINTCHILDREN] {}
 nutple variable : hadronic interaction child eta More...
 
float m_hadIntChildDeltaPhi [MAXHADINTCHILDREN] {}
 nutple variable : hadronic interaction child delta phi More...
 
float m_hadIntChildDeltaEta [MAXHADINTCHILDREN] {}
 nutple variable : hadronic interaction child delta eta More...
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ 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.

40  :
41  base_class(t,n,p),
43  m_childMomParam(5.),
44  m_cutChain(false),
45  m_hadIntFromX0(false),
46  m_hadIntProbScale(1.0),
48  m_particleBroker("ISF_ParticleBroker", n),
49  m_truthRecordSvc("ISF_TruthRecordSvc", n),
50  m_rndGenSvc("AtDSFMTGenSvc", n),
51  m_processCode(121),
52  m_randomEngine(nullptr),
53  m_randomEngineName("FatrasRnd"),
54  m_validationMode(false),
55  m_validationTool(""),
56  m_hadIntValidation(false),
57  m_hadIntValidationTreeName("FatrasHadronicInteractions"),
58  m_hadIntValidationTreeDescription("Validation output from the HadIntProcessorParametric"),
59  m_hadIntValidationTreeFolder("/val/FatrasHadronicInteractions"),
60  m_hadIntValidationTree(nullptr),
61  m_hadIntPointX(0.),
62  m_hadIntPointY(0.),
63  m_hadIntPointR(0.),
64  m_hadIntPointZ(0.),
67  m_hadIntMotherP(0.),
68  m_hadIntMotherPt(0.),
72  m_hadIntChildE(0.)
73 {
74  // property setting
75  declareProperty("MinimumHadronicOutEnergy" , m_minimumHadOutEnergy);
76  declareProperty("HadronicChildMomParam" , m_childMomParam);
77  declareProperty("HadronicInteractionFromX0" , m_hadIntFromX0);
78  declareProperty("HadronicInteractionScaleFactor" , m_hadIntProbScale);
79  declareProperty("MinimumHadronicInitialEnergy" , m_minimumHadInitialEnergy);
80  // the steering --------------------------------------------------------------
81  declareProperty("ShortenHadIntChain" , m_cutChain);
82  declareProperty("ValidationMode" , m_validationMode);
83  declareProperty("PhysicsValidationTool" , m_validationTool);
84  declareProperty("HadronicInteractionValidation" , m_hadIntValidation);
85  // validation mode
86  declareProperty("RandomNumberService" , m_rndGenSvc , "Random number generator");
87  declareProperty("RandomStreamName" , m_randomEngineName , "Name of the random number stream");
88  // MC Truth Properties
89  declareProperty("PhysicsProcessCode" , m_processCode , "MCTruth Physics Process Code" );
90  // ISF Services and Tools
91  declareProperty("ParticleBroker" , m_particleBroker , "ISF ParticleBroker Svc" );
92  declareProperty("TruthRecordSvc" , m_truthRecordSvc , "ISF Particle Truth Svc" );
93 }

◆ ~HadIntProcessorParametric()

iFatras::HadIntProcessorParametric::~HadIntProcessorParametric ( )
virtualdefault

Destructor.

Member Function Documentation

◆ absorptionLength()

double iFatras::HadIntProcessorParametric::absorptionLength ( const Trk::MaterialProperties mat,
double  p,
double  q,
Trk::ParticleHypothesis  particle = Trk::pion 
)
staticprivate

interface for calculation of absorption length

absorption length

Definition at line 228 of file HadIntProcessorParametric.cxx.

229  {
230  double al = mat->l0();
231 
232  /* // these parametrization comes from comparison with G4 sampler, but give too many interactions
233  // not understood yet
234  if ( particle == Trk::pion ) al = ( 0.53+0.2*exp(-p/1000.) ) * mat->l0();
235  else if ( particle == Trk::kaon ) al = ( 0.1+0.65*exp(-p/5000.) ) * mat->l0();
236  else if ( particle == Trk::proton ) al = 0.57 * mat->l0();
237  else al = mat->l0();
238  */
239 
241  al *= 1./(1.+ exp(-0.5*(p-270.)*(p-270.)/60./60.));
242  }
243  if ( particle == Trk::proton || particle == Trk::neutron ) al *=0.7;
244  if ( particle == Trk::pion || particle == Trk::pi0) al *=0.9;
245 
246  return al;
247 }

◆ doHadIntOnLayer()

ISF::ISFParticleVector iFatras::HadIntProcessorParametric::doHadIntOnLayer ( const ISF::ISFParticle parent,
double  time,
const Amg::Vector3D position,
const Amg::Vector3D momentum,
const Trk::Material emat,
Trk::ParticleHypothesis  particle 
) const

Definition at line 689 of file HadIntProcessorParametric.cxx.

692  {
693  // called from McMaterialEffectsUpdator::interact and
694  // McMaterialEffectsUpdator::interactLay methods
695  return getHadState(parent, time, momentum.mag(), position, momentum.unit(), particle); // Registers TruthIncident internally
696 
697 }

◆ doHadronicInteraction()

bool iFatras::HadIntProcessorParametric::doHadronicInteraction ( double  time,
const Amg::Vector3D position,
const Amg::Vector3D momentum,
const Trk::Material emat,
Trk::ParticleHypothesis  particle,
bool  processSecondaries 
) const

Definition at line 659 of file HadIntProcessorParametric.cxx.

661  {
662  // Called by McMaterialEffectsUpdator::interact
663  // get parent particle
665  // something is seriously wrong if there is no parent particle
666  assert(parent);
667 
668  ISF::ISFParticleVector ispVec=getHadState(parent, time, momentum.mag(), position, momentum.unit(), particle); // Registers TruthIncident internally
669 
670 
671  // having no secondaries does not necessarily mean the interaction did not take place : TODO : add flag into ::getHadState
672  // if (!ispVec.size()) return false;
673 
674  // push onto ParticleStack
675  if (processSecondaries && !ispVec.empty() ) {
676  for (auto *childParticle : ispVec) {
677  //Check that the new ISFParticles have a valid TruthBinding
678  if (!childParticle->getTruthBinding()) {
679  ATH_MSG_ERROR("Could not retrieve TruthBinding from child ISFParticle "<< *childParticle);
680  }
681  m_particleBroker->push(childParticle, parent);
682  }
683  }
684 
685  return true;
686 
687 }

◆ finalize()

StatusCode iFatras::HadIntProcessorParametric::finalize ( )

AlgTool finalize method.

Definition at line 181 of file HadIntProcessorParametric.cxx.

182 {
183  ATH_MSG_DEBUG( "finalize() successful" );
184  return StatusCode::SUCCESS;
185 }

◆ getHadState()

ISF::ISFParticleVector iFatras::HadIntProcessorParametric::getHadState ( const ISF::ISFParticle parent,
double  time,
double  p,
const Amg::Vector3D vertex,
const Amg::Vector3D particleDir,
Trk::ParticleHypothesis  particle 
) const
private

collect secondaries for layer material update

Definition at line 250 of file HadIntProcessorParametric.cxx.

255 {
256  ISF::ISFParticleVector chDef(0);
257 
258  // sampling of hadronic interaction
260  double E = sqrt(p*p + m*m);
261 
262  // get the maximum multiplicity
263  double multiplicity_max = 0.25 * E/1000. + 18.;
264 
265  // multiplicity distribution
266  double randx , randy, arg = 0.;
267 
268  double p1 = 0.;
269  double p2 = 0.;
270 
271  if (E > 15000.) {
272  p1 = 8.69;
273  p2 = 2.34;
274  } else {
275  p1 = 6.77;
276  p2 = 2.02;
277  }
278 
279  for (;;) {
280  randx = 30. * CLHEP::RandFlat::shoot(m_randomEngine);
281  randy = 1. * CLHEP::RandFlat::shoot(m_randomEngine);
282  arg = exp(-0.5*( (randx-p1)/p2 + exp(-(randx-p1)/p2) ) );
283  if (randy < arg && randx>3 && randx<multiplicity_max) break;
284  }
285 
286  randx *= (1.2-0.4*exp(-0.001*p)); // trying to adjust
287 
288  int Npart = (int)randx;
289 
290  // protection against Npart < 3
291  if (Npart < 3) {
292  ATH_MSG_VERBOSE( "[ had ] Number of particles smaller than 3, parameterisation not valid."
293  << " Doing Nothing");
294  return chDef;
295  }
296 
297  ATH_MSG_VERBOSE( "[ had ] interaction of " << HepMC::barcode(parent)
298  << " with " << Npart << " outgoing particles " );
299 
300  // record the interaction
301 
302  // ------ now create the new hadrons ------
303  ATH_MSG_DEBUG( "[ had ] create hadronic shower for particle with PDG ID "
304  << parent->pdgCode() << " and barcode "
305  << HepMC::barcode(parent) );
306 
307 
308  // create the genParticles
309 
310  // validation if needed
312  m_hadIntPointX = vertex.x();
313  m_hadIntPointY = vertex.y();
314  m_hadIntPointZ = vertex.z();
315  m_hadIntPointR = vertex.perp();
316  m_hadIntMotherPdg = parent->pdgCode();
317  m_hadIntMotherBarcode = HepMC::barcode(parent); // FIXME barcode-based
318  m_hadIntMotherP = p;
319  m_hadIntMotherPt = p*particleDir.perp();
320  m_hadIntMotherPhi = particleDir.phi();
321  m_hadIntMotherEta = particleDir.eta();
322  // reset the children
323  m_hadIntChildren = 0;
324  }
325 
326  ATH_MSG_VERBOSE( "[ had ] incoming particle energy | mass | momentum "
327  << E << " | " << m << " | " << p << " | " );
328 
331  ATH_MSG_VERBOSE( "[ had ] interaction initiated by a secondary particle, no children saved " );
332  return chDef;
333  }
334 
335  int gen_part = 0;
336 
337  // new sampling: sample particle type and energy in the CMS frame of outgoing particles
338  // creation of shower particles
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);
344 
345  // children type sampling : simplified
346  //double pif = 0.19;
347  //double nef = 0.20;
348  //double prf = 0.20;
349 
350  // sample heavy particles (alpha) but don't save
351  double pif = 0.10;
352  double nef = 0.30;
353  double prf = 0.30;
354 
355  if ( particle == Trk::pion || particle == Trk::kaon || particle == Trk::pi0 || particle == Trk::k0 ) {
356  pif = 0.15;
357  nef = 0.25;
358  prf = 0.25;
359  }
360  if ( particle == Trk::proton ) {
361  pif = 0.06;
362  nef = 0.25;
363  prf = 0.35;
364  }
365  if ( particle == Trk::neutron ) {
366  pif = 0.03;
367  nef = 0.35;
368  prf = 0.17;
369  }
370 
371  for (int i=0; i<Npart; i++) {
372  chargedist = CLHEP::RandFlat::shoot(m_randomEngine);
373  if (chargedist<pif) {
374  charge[i]=0.;
375  childType[i]=Trk::pi0;
376  newm[i]=Trk::ParticleMasses::mass[Trk::pi0]; // MeV
377  pdgid[i]=111;
378  continue;
379  }
380  if ( chargedist<2*pif) {
381  charge[i]=1.;
382  childType[i]=Trk::pion;
383  newm[i]=Trk::ParticleMasses::mass[Trk::pion]; // MeV
384  pdgid[i]=211;
385  continue;
386  }
387  if (chargedist<3*pif) {
388  charge[i]=-1.;
389  childType[i]=Trk::pion;
390  newm[i]=Trk::ParticleMasses::mass[Trk::pion]; // MeV
391  pdgid[i]=-211;
392  continue;
393  }
394  if (chargedist<3*pif+nef) {
395  charge[i]=0.;
396  childType[i]=Trk::neutron;
397  newm[i]=939.565; // MeV
398  pdgid[i]=2112; // neutron
399  continue;
400  }
401  if (chargedist<3*pif+nef+prf) {
402  charge[i]=1.;
403  childType[i]=Trk::proton;
405  pdgid[i]=2212;
406  continue;
407  }
408  charge[i]=2.;
409  childType[i]=Trk::proton;
410  newm[i]=4000.;
411  pdgid[i]=20000;
412  }
413 
414  // move the incoming particle type forward
415  if ( childType[0] != particle ) {
416  for (int i=1; i<Npart; i++) {
417  if (childType[i]==particle) {
418  childType[i]=childType[0];
419  childType[0]=particle;
420  double cho = charge[i];
421  charge[i]=charge[0];
422  charge[0]=parent ? parent->charge() : cho;
423  newm[i]=Trk::ParticleMasses::mass[childType[i]]; // MeV
424  newm[0]=Trk::ParticleMasses::mass[childType[0]]; // MeV
425  break;
426  }
427  }
428  }
429 
430  /*
431  // sample momentum of daughters in CMS frame of outgoing particles [ exp(-par/p) ]
432  std::vector<double> mom;
433  mom.clear();mom.reserve(Npart);
434  double mom_n = 0.;
435  for (int _npart=0; _npart<Npart; _npart++) {
436  rand1 = CLHEP::RandFlat::shoot(m_randomEngine);
437  mom_n = -log(rand1)/m_childMomParam * p;
438  int ipos = _npart;
439  while ( ipos>0 && mom_n>mom[ipos-1]) ipos--;
440  mom.insert(mom.begin()+ipos,mom_n);
441  }
442 
443  // check if configuration acceptable - if not, resample hardest mom
444  double momR = 0.;
445  for (int i=1; i<Npart; i++) momR += mom[i];
446  if (momR < mom[0]) mom[0] = mom[1]+rand1*(momR-mom[1]);
447  */
448 
449  std::vector<double> mom(Npart);
450  std::vector<double> th(Npart);
451  std::vector<double> ph(Npart);
452 
453  // sample first particle energy fraction and random momentum direction
454  double eps = 2./Npart;
455  double rnd = CLHEP::RandFlat::shoot(m_randomEngine);
456  mom[0] = 0.5*pow(eps,rnd);
457  th[0] = acos( 2*CLHEP::RandFlat::shoot(m_randomEngine)-1.);
458  ph[0] = 2*M_PI*CLHEP::RandFlat::shoot(m_randomEngine);
459 
460  // toss particles around in a way which preserves the total momentum (0.,0.,0.) at this point
461  // TODO shoot first particle along the impact direction preferentially
462 
463  Amg::Vector3D ptemp(mom[0]*sin(th[0])*cos(ph[0]),mom[0]*sin(th[0])*sin(ph[0]),mom[0]*cos(th[0]));
464  double ptot = mom[0];
465 
466  double theta = 0.; double phi = 0.;
467  for (int i=1; i<Npart-2; i++) {
468  eps = 1./(Npart-i);
469  //mom[i] = pow(eps,CLHEP::RandFlat::shoot(m_randomEngine))*(1-ptot);
470  mom[i] = ( eps + CLHEP::RandFlat::shoot(m_randomEngine)*(1-eps))*(1-ptot);
471  if (ptemp.mag()<1-ptot) {
472  while ( fabs(ptemp.mag()-mom[i])>1-ptot-mom[i] ){
473  mom[i] = ( eps + CLHEP::RandFlat::shoot(m_randomEngine)*(1-eps))*(1-ptot);
474  }
475  }
476  // max p remaining
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]);
479  //if (cthmax<-1.) std::cout <<"problem in theta sampling:p_rem:ptot:pcurr:"<<p_rem<<","<<ptemp.mag()<<","<<mom[i]<< std::endl;
480  double rnd = CLHEP::RandFlat::shoot(m_randomEngine);
481  theta = acos( (cthmax+1.)*rnd-1.);
482  phi = 2*M_PI*CLHEP::RandFlat::shoot(m_randomEngine);
483  HepGeom::Vector3D<double> test(sin(theta)*cos(phi),sin(theta)*sin(phi),cos(theta));
484  HepGeom::Vector3D<double> dnewHep = HepGeom::RotateZ3D(ptemp.phi())*HepGeom::RotateY3D(ptemp.theta())*test;
485  Amg::Vector3D dnew( dnewHep.x(), dnewHep.y(), dnewHep.z() );
486  th[i]=dnew.theta();
487  ph[i]=dnew.phi();
488  ptemp += mom[i]*dnew;
489  ptot += mom[i];
490  }
491 
492  eps = 0.5;
493  mom[Npart-2] = pow(eps,CLHEP::RandFlat::shoot(m_randomEngine))*(1-ptot);
494  mom[Npart-1] = 1-ptot-mom[Npart-2];
495 
496  if (ptemp.mag()<1-ptot) {
497  while (mom[Npart-1]+mom[Npart-2]<ptemp.mag()) {
498  mom[Npart-2] = pow(eps,CLHEP::RandFlat::shoot(m_randomEngine))*(1-ptot);
499  mom[Npart-1] = 1-ptot-mom[Npart-2];
500  }
501  }
502  if (ptemp.mag()<fabs(mom[Npart-1]-mom[Npart-2]) ) {
503  double diff = ptemp.mag()*CLHEP::RandFlat::shoot(m_randomEngine);
504  double sum = mom[Npart-1]-mom[Npart-2];
505  mom[Npart-2]=0.5*(sum+diff);
506  mom[Npart-1]=0.5*(sum-diff);
507  }
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.;
510 
511  theta = acos(cth);
512  phi = 2*M_PI*CLHEP::RandFlat::shoot(m_randomEngine);
513  HepGeom::Vector3D<double> test(sin(theta)*cos(phi),sin(theta)*sin(phi),cos(theta));
514  HepGeom::Vector3D<double> dnewHep = HepGeom::RotateZ3D(ptemp.phi())*HepGeom::RotateY3D(ptemp.theta())*test;
515  Amg::Vector3D dnew( dnewHep.x(), dnewHep.y(), dnewHep.z() );
516 
517  th[Npart-2]=dnew.theta();
518  ph[Npart-2]=dnew.phi();
519  ptemp += mom[Npart-2]*dnew;
520  Amg::Vector3D dlast = -ptemp;
521  th[Npart-1]=dlast.theta();
522  ph[Npart-1]=dlast.phi();
523 
524  // particle sampled, rotate, boost and save final state
525  //CLHEP::HepLorentzVector bv(p*particleDir.unit().x(),p*particleDir.unit().y(),p*particleDir.unit().z(),s_currentGenParticle->momentum().e()+mtot);
526  double etot = 0.;
527  for (int i=0;i<Npart; i++) etot += sqrt(mom[i]*mom[i]+newm[i]*newm[i]);
528  double summ = 0.;
529  for (int i=0;i<Npart; i++) summ += newm[i];
530 
531  // std::cout <<"hadronic interaction: current energy, expected :"<< etot <<","<< sqrt(summ*summ+2*summ*p+m*m)<< std::endl;
532  // rescale (roughly) to the expected energy
533  float scale = sqrt(summ*summ+2*summ*p+m*m)/etot;
534  etot = 0.;
535  for (int i=0;i<Npart; i++) {
536  mom[i] *= scale;
537  etot += sqrt(mom[i]*mom[i]+newm[i]*newm[i]);
538  }
539 
540 
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);
543 
544  //std::cout <<"boost vector:"<<p<<","<<bv.e()<<","<<bv.m()<<std::endl;
545  //std::cout <<"etot, mother E,m:"<<etot<<","<<E<<","<<m<<std::endl;
546 
547  Amg::Vector3D in(0.,0.,0.);
548  Amg::Vector3D fin(0.,0.,0.);
549 
550  for (int i=0; i<Npart; i++) {
551  Amg::Vector3D dirCms(sin(th[i])*cos(ph[i]),sin(th[i])*sin(ph[i]),cos(th[i]));
552  //Amg::Vector3D rotDirCms=HepGeom::RotateZ3D(particleDir.phi())*HepGeom::RotateY3D(particleDir.theta())*dirCms;
553  Amg::Vector3D childP = mom[i]*dirCms;
554  in += childP;
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;
558  fin += Amg::Vector3D(childPB.x(),childPB.y(),childPB.z());
559  }
560 
561  double eout = 0.;
562 
563  // child particle vector for TruthIncident
564  // Reserve space for as many paricles as created due to hadr. int.
565  // However, the number of child particles for TruthIncident might be
566  // smaller due to (momentum) cuts
568  ISF::ISFParticleVector::iterator childrenIt = children.begin();
569  unsigned short numChildren = 0;
570 
571  for (int i=0; i<Npart; i++) {
572  if (pdgid[i]<10000) {
573  Amg::Vector3D childP = Amg::Vector3D(childBoost[i].x(),childBoost[i].y(),childBoost[i].z());
574  Amg::Vector3D chP = Amg::Vector3D(sin(th[i])*cos(ph[i]),sin(th[i])*sin(ph[i]),cos(th[i]));
575 
576  eout += childBoost[i].e();
577 
578  // validation if needed
581  m_hadIntChildP[m_hadIntChildren] = childP.mag();
583  m_hadIntChildTh[m_hadIntChildren] = childP.unit().dot(particleDir);
584  m_hadIntChildThc[m_hadIntChildren] =chP.dot(particleDir);
585  m_hadIntChildPhi[m_hadIntChildren] = childP.phi();
586  m_hadIntChildEta[m_hadIntChildren] = childP.eta();
588  // rescale the deltaPhi
589  deltaPhi -= deltaPhi > M_PI ? M_PI : 0.;
590  deltaPhi += deltaPhi < -M_PI ? M_PI : 0.;
594  }
595 
596  if (childP.mag()> m_minimumHadOutEnergy) {
597  // get the new particle
598  double mass = Trk::ParticleMasses::mass[ childType[i] ];
599 
600  // create the particle
601  const int status = 1 + HepMC::SIM_STATUS_THRESHOLD;
602  const int id = HepMC::UNDEFINED_ID;
604  childP,
605  mass,
606  charge[i],
607  pdgid[i],
608  status,
609  time,
610  *parent,
611  id
612  );
613  // in the validation mode, add process info
614  if (m_validationMode) {
616  validInfo->setProcess(m_processCode);
617  if (parent->getUserInformation()) validInfo->setGeneration(parent->getUserInformation()->generation()+1);
618  else validInfo->setGeneration(1); // assume parent is a primary track
619  child->setUserInformation(validInfo);
620  }
621  // record child for TruthIncident
622  *childrenIt = child;
623  ++childrenIt; numChildren++;
624  }
625 
626  gen_part++;
627  }
628  } // particle loop
629 
630  children.resize(numChildren);
631  ISF::ISFTruthIncident truth( const_cast<ISF::ISFParticle&>(*parent),
632  children,
634  parent->nextGeoID(),
636  m_truthRecordSvc->registerTruthIncident( truth);
637  // At this point we need to update the properties of the
638  // ISFParticles produced in the interaction
639  truth.updateChildParticleProperties();
640 
641  // save info for validation
642  if (m_validationMode && m_validationTool.isEnabled()) {
643  Amg::Vector3D* nMom = nullptr;
644  m_validationTool->saveISFVertexInfo(m_processCode,vertex,*parent,p*particleDir,nMom,children);
645  delete nMom;
646  }
647 
648 
649  m_hadIntChildE = eout;
650 
652 
653  ATH_MSG_VERBOSE( "[ had ] it was kinematically possible to create " << gen_part << " shower particles " );
654 
655  return children;
656 
657 }

◆ hadronicInteraction()

bool iFatras::HadIntProcessorParametric::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

Definition at line 188 of file HadIntProcessorParametric.cxx.

192 {
193  const Trk::MaterialProperties* extMprop = dynamic_cast<const Trk::MaterialProperties*>(&mprop);
194  double prob = 0.;
195 
196  // m_hadIntProbScale is used later, not here
197  if (extMprop && !m_hadIntFromX0) {
198 
199  double al = absorptionLength(extMprop, p, charge, particle); // in mm
200 
201  if (al>0.) prob = exp( (-1.)*pathCorrection*extMprop->thickness()/al );
202  else prob = exp( (-1.)*pathCorrection*extMprop->thicknessInL0());
203 
204  } else {
205  ATH_MSG_VERBOSE( " [ had ] Nuclear Interaction length not available, using appox. from X0" );
206  // using approximation lambda = 0.37 * Z * X0 instead -- giving a warning message
207  prob = exp( (-1.)*pathCorrection*mprop.thicknessInX0() / ( 0.37 * mprop.averageZ()) );
208  }
209 
210  if (msgLvl(MSG::VERBOSE))
211  ATH_MSG_VERBOSE( " [ had ] Probability of hadronic interaction = "
212  << (1. - prob) * 100. * m_hadIntProbScale << " %." );
213 
214  // apply a global scalor of the probability
215  // (1. - prob) is generally O(0.01), so this is the right way to scale it
216  // TODO fix time info (if needed)
217  if (CLHEP::RandFlat::shoot(m_randomEngine) < (1. - prob) * m_hadIntProbScale ) return recordHadState(0.,p,
218  position,
219  momentum.unit(),
220  particle); // Registers TruthIncident internally
221 
222  // no hadronic interactions were computed
223  return false;
224 }

◆ initialize()

StatusCode iFatras::HadIntProcessorParametric::initialize ( )

AlgTool initailize method.

Definition at line 101 of file HadIntProcessorParametric.cxx.

102 {
103 
104  ATH_MSG_DEBUG( "initialize()" );
105 
106  // get the random generator serice
107  if (m_rndGenSvc.retrieve().isFailure()){
108  ATH_MSG_FATAL( "Could not retrieve " << m_rndGenSvc );
109  return StatusCode::FAILURE;
110  } else
111  ATH_MSG_VERBOSE( "Successfully retrieved " << m_rndGenSvc );
112 
113  //Get own engine with own seeds:
115  if (!m_randomEngine) {
116  ATH_MSG_FATAL( "Could not get random engine '" << m_randomEngineName << "'" );
117  return StatusCode::FAILURE;
118  }
119 
120  // ISF Services
121  if (m_particleBroker.retrieve().isFailure()){
122  ATH_MSG_FATAL( "Could not retrieve " << m_particleBroker );
123  return StatusCode::FAILURE;
124  }
125  if (m_truthRecordSvc.retrieve().isFailure()){
126  ATH_MSG_FATAL( "Could not retrieve " << m_truthRecordSvc );
127  return StatusCode::FAILURE;
128  }
129 
130  // the validation setup -------------------------------- PART 3: Hadronic Interaction ---------------------
131  ATH_CHECK( m_validationTool.retrieve( DisableTool{ m_validationTool.empty() || !m_validationMode } ) );
132 
133  if (m_hadIntValidation){
134 
135  SmartIF<ITHistSvc> tHistSvc{Gaudi::svcLocator()->service("THistSvc")};
136  if (!tHistSvc) {
137  ATH_MSG_ERROR( "initialize() Could not find Hist Service -> Switching ValidationMode Off !" );
138  }
139  ATH_MSG_VERBOSE( "Booking hadronic interaction validation TTree ... " );
140 
141  // create the new Tree
143 
144  // counter for boundary surfaces
145  m_hadIntValidationTree->Branch("HadIntPointX" , &m_hadIntPointX, "hintX/F");
146  m_hadIntValidationTree->Branch("HadIntPointY" , &m_hadIntPointY, "hintY/F");
147  m_hadIntValidationTree->Branch("HadIntPointR" , &m_hadIntPointR, "hintR/F");
148  m_hadIntValidationTree->Branch("HadIntPointZ" , &m_hadIntPointZ, "hintZ/F");
149  m_hadIntValidationTree->Branch("HadIntMotherPdg" , &m_hadIntMotherPdg, "hintMotherPdg/I");
150  m_hadIntValidationTree->Branch("HadIntMotherBarcode" , &m_hadIntMotherBarcode, "hintMotherBarcode/I");
151  m_hadIntValidationTree->Branch("HadIntMotherP" , &m_hadIntMotherP, "hintMotherP/F");
152  m_hadIntValidationTree->Branch("HadIntMotherPt" , &m_hadIntMotherPt, "hintMotherPt/F");
153  m_hadIntValidationTree->Branch("HadIntMotherPhi" , &m_hadIntMotherPhi, "hintMotherPhi/F");
154  m_hadIntValidationTree->Branch("HadIntMotherEta" , &m_hadIntMotherEta, "hintMohterEta/F");
155 
156  m_hadIntValidationTree->Branch("HadIntChildren" , &m_hadIntChildren, "hintcs/I");
157  m_hadIntValidationTree->Branch("HadIntChildE " , &m_hadIntChildE, "hintce/F");
158  m_hadIntValidationTree->Branch("HadIntChildPdg" , m_hadIntChildPdg, "hintChildPdg[hintcs]/I");
159  m_hadIntValidationTree->Branch("HadIntChildP" , m_hadIntChildP, "hintChildP[hintcs]/F");
160  m_hadIntValidationTree->Branch("HadIntChildPcms" , m_hadIntChildPcms, "hintChildPcms[hintcs]/F");
161  m_hadIntValidationTree->Branch("HadIntChildTh" , m_hadIntChildTh, "hintChildTh[hintcs]/F");
162  m_hadIntValidationTree->Branch("HadIntChildThc" , m_hadIntChildThc, "hintChildThc[hintcs]/F");
163  m_hadIntValidationTree->Branch("HadIntChildPhi" , m_hadIntChildPhi, "hintChildPhi[hintcs]/F");
164  m_hadIntValidationTree->Branch("HadIntChildEta" , m_hadIntChildEta, "hintChildEta[hintcs]/F");
165  m_hadIntValidationTree->Branch("HadIntChildDeltaPhi", m_hadIntChildDeltaPhi, "hintChildPhi[hintcs]/F");
166  m_hadIntValidationTree->Branch("HadIntChildDeltaEta", m_hadIntChildDeltaEta, "hintChildEta[hintcs]/F");
167 
168 
169  if ((tHistSvc->regTree(m_hadIntValidationTreeFolder, m_hadIntValidationTree)).isFailure()) {
170  ATH_MSG_ERROR("initialize() Could not register the validation Tree -> Switching ValidationMode Off !" );
172  } else {
173  ATH_MSG_INFO( "TTree for Hadronic Interactions validation booked." );
174  }
175  } // ------------- end of validation mode -----------------------------------------------------------------
176  ATH_MSG_DEBUG( "finalize() successful" );
177  return StatusCode::SUCCESS;
178 }

◆ recordHadState()

bool iFatras::HadIntProcessorParametric::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

Definition at line 700 of file HadIntProcessorParametric.cxx.

703  {
704  // get parent particle
706  // something is seriously wrong if there is no parent particle
707  assert(parent);
708 
709  ISF::ISFParticleVector ispVec=getHadState(parent, time, p, vertex, particleDir, particle); // Registers TruthIncident internally
710 
711  // having no secondaries does not necessarily mean the interaction did not take place : TODO : add flag into ::getHadState
712  // if (!ispVec.size()) return false;
713 
714  // push onto ParticleStack
715  if (!ispVec.empty() ) {
716  for (auto *childParticle : ispVec) {
717  //Check that the new ISFParticles have a valid TruthBinding
718  if (!childParticle->getTruthBinding()) {
719  ATH_MSG_ERROR("Could not retrieve TruthBinding from child ISFParticle "<< *childParticle);
720  }
721  m_particleBroker->push(childParticle, parent);
722  }
723  }
724 
725  return true;
726 }

Member Data Documentation

◆ m_childMomParam

double iFatras::HadIntProcessorParametric::m_childMomParam
private

Definition at line 102 of file HadIntProcessorParametric.h.

◆ m_cutChain

bool iFatras::HadIntProcessorParametric::m_cutChain
private

Definition at line 103 of file HadIntProcessorParametric.h.

◆ m_hadIntChildDeltaEta

float iFatras::HadIntProcessorParametric::m_hadIntChildDeltaEta[MAXHADINTCHILDREN] {}
mutableprivate

nutple variable : hadronic interaction child delta eta

Definition at line 155 of file HadIntProcessorParametric.h.

◆ m_hadIntChildDeltaPhi

float iFatras::HadIntProcessorParametric::m_hadIntChildDeltaPhi[MAXHADINTCHILDREN] {}
mutableprivate

nutple variable : hadronic interaction child delta phi

Definition at line 154 of file HadIntProcessorParametric.h.

◆ m_hadIntChildE

float iFatras::HadIntProcessorParametric::m_hadIntChildE
mutableprivate

nutple variable : hadronic interaction children total energy

Definition at line 146 of file HadIntProcessorParametric.h.

◆ m_hadIntChildEta

float iFatras::HadIntProcessorParametric::m_hadIntChildEta[MAXHADINTCHILDREN] {}
mutableprivate

nutple variable : hadronic interaction child eta

Definition at line 151 of file HadIntProcessorParametric.h.

◆ m_hadIntChildP

float iFatras::HadIntProcessorParametric::m_hadIntChildP[MAXHADINTCHILDREN] {}
mutableprivate

nutple variable : hadronic interaction child Energy

Definition at line 147 of file HadIntProcessorParametric.h.

◆ m_hadIntChildPcms

float iFatras::HadIntProcessorParametric::m_hadIntChildPcms[MAXHADINTCHILDREN] {}
mutableprivate

nutple variable : hadronic interaction child Energy

Definition at line 148 of file HadIntProcessorParametric.h.

◆ m_hadIntChildPdg

int iFatras::HadIntProcessorParametric::m_hadIntChildPdg[MAXHADINTCHILDREN] {}
mutableprivate

nutple variable : hadronic interaction child Pdg

Definition at line 149 of file HadIntProcessorParametric.h.

◆ m_hadIntChildPhi

float iFatras::HadIntProcessorParametric::m_hadIntChildPhi[MAXHADINTCHILDREN] {}
mutableprivate

nutple variable : hadronic interaction child phi

Definition at line 150 of file HadIntProcessorParametric.h.

◆ m_hadIntChildren

int iFatras::HadIntProcessorParametric::m_hadIntChildren
mutableprivate

nutple variable : hadronic interaction children numbers

Definition at line 145 of file HadIntProcessorParametric.h.

◆ m_hadIntChildTh

float iFatras::HadIntProcessorParametric::m_hadIntChildTh[MAXHADINTCHILDREN] {}
mutableprivate

nutple variable : hadronic interaction child phi

Definition at line 152 of file HadIntProcessorParametric.h.

◆ m_hadIntChildThc

float iFatras::HadIntProcessorParametric::m_hadIntChildThc[MAXHADINTCHILDREN] {}
mutableprivate

nutple variable : hadronic interaction child eta

Definition at line 153 of file HadIntProcessorParametric.h.

◆ m_hadIntFromX0

bool iFatras::HadIntProcessorParametric::m_hadIntFromX0
private

Definition at line 104 of file HadIntProcessorParametric.h.

◆ m_hadIntMotherBarcode

int iFatras::HadIntProcessorParametric::m_hadIntMotherBarcode
mutableprivate

ntuple variable : hadronic interaction mother barcode

Definition at line 139 of file HadIntProcessorParametric.h.

◆ m_hadIntMotherEta

float iFatras::HadIntProcessorParametric::m_hadIntMotherEta
mutableprivate

ntuple variable : hadronic interaction photon eta

Definition at line 143 of file HadIntProcessorParametric.h.

◆ m_hadIntMotherP

float iFatras::HadIntProcessorParametric::m_hadIntMotherP
mutableprivate

ntuple variable : hadronic interaction mother momentum

Definition at line 140 of file HadIntProcessorParametric.h.

◆ m_hadIntMotherPdg

int iFatras::HadIntProcessorParametric::m_hadIntMotherPdg
mutableprivate

ntuple variable : hadronic interaction mother Pdg

Definition at line 138 of file HadIntProcessorParametric.h.

◆ m_hadIntMotherPhi

float iFatras::HadIntProcessorParametric::m_hadIntMotherPhi
mutableprivate

ntuple variable : hadronic interaction mother phi

Definition at line 142 of file HadIntProcessorParametric.h.

◆ m_hadIntMotherPt

float iFatras::HadIntProcessorParametric::m_hadIntMotherPt
mutableprivate

ntuple variable : hadronic interaction mother momentum

Definition at line 141 of file HadIntProcessorParametric.h.

◆ m_hadIntPointR

float iFatras::HadIntProcessorParametric::m_hadIntPointR
mutableprivate

ntuple variable : hadronic interaction point r distance

Definition at line 136 of file HadIntProcessorParametric.h.

◆ m_hadIntPointX

float iFatras::HadIntProcessorParametric::m_hadIntPointX
mutableprivate

ntuple variable : hadronic interaction point x coordinate

Definition at line 134 of file HadIntProcessorParametric.h.

◆ m_hadIntPointY

float iFatras::HadIntProcessorParametric::m_hadIntPointY
mutableprivate

ntuple variable : hadronic interaction point y coordinate

Definition at line 135 of file HadIntProcessorParametric.h.

◆ m_hadIntPointZ

float iFatras::HadIntProcessorParametric::m_hadIntPointZ
mutableprivate

ntuple variable : hadronic interaction point z coordinate

Definition at line 137 of file HadIntProcessorParametric.h.

◆ m_hadIntProbScale

double iFatras::HadIntProcessorParametric::m_hadIntProbScale
private

Definition at line 105 of file HadIntProcessorParametric.h.

◆ m_hadIntValidation

bool iFatras::HadIntProcessorParametric::m_hadIntValidation
private

Definition at line 126 of file HadIntProcessorParametric.h.

◆ m_hadIntValidationTree

TTree* iFatras::HadIntProcessorParametric::m_hadIntValidationTree
private

Root Validation Tree.

Definition at line 131 of file HadIntProcessorParametric.h.

◆ m_hadIntValidationTreeDescription

std::string iFatras::HadIntProcessorParametric::m_hadIntValidationTreeDescription
private

validation tree description - second argument in TTree

Definition at line 128 of file HadIntProcessorParametric.h.

◆ m_hadIntValidationTreeFolder

std::string iFatras::HadIntProcessorParametric::m_hadIntValidationTreeFolder
private

stream/folder to for the TTree to be written out

Definition at line 129 of file HadIntProcessorParametric.h.

◆ m_hadIntValidationTreeName

std::string iFatras::HadIntProcessorParametric::m_hadIntValidationTreeName
private

validation tree name - to be acessed by this from root

Definition at line 127 of file HadIntProcessorParametric.h.

◆ m_minimumHadInitialEnergy

double iFatras::HadIntProcessorParametric::m_minimumHadInitialEnergy
private

Definition at line 106 of file HadIntProcessorParametric.h.

◆ m_minimumHadOutEnergy

double iFatras::HadIntProcessorParametric::m_minimumHadOutEnergy
private

hadronic interaction setting

Definition at line 101 of file HadIntProcessorParametric.h.

◆ m_particleBroker

ServiceHandle<ISF::IParticleBroker> iFatras::HadIntProcessorParametric::m_particleBroker
private

ISF services & Tools.

Definition at line 110 of file HadIntProcessorParametric.h.

◆ m_processCode

int iFatras::HadIntProcessorParametric::m_processCode
private

MCTruth process code for TruthIncidents created by this tool.

Definition at line 116 of file HadIntProcessorParametric.h.

◆ m_randomEngine

CLHEP::HepRandomEngine* iFatras::HadIntProcessorParametric::m_randomEngine
private

Random engine

Definition at line 119 of file HadIntProcessorParametric.h.

◆ m_randomEngineName

std::string iFatras::HadIntProcessorParametric::m_randomEngineName
private

Name of the random number stream.

Definition at line 120 of file HadIntProcessorParametric.h.

◆ m_rndGenSvc

ServiceHandle<IAtRndmGenSvc> iFatras::HadIntProcessorParametric::m_rndGenSvc
private

Random Generator service.

Definition at line 114 of file HadIntProcessorParametric.h.

◆ m_truthRecordSvc

ServiceHandle<ISF::ITruthSvc> iFatras::HadIntProcessorParametric::m_truthRecordSvc
private

Definition at line 111 of file HadIntProcessorParametric.h.

◆ m_validationMode

bool iFatras::HadIntProcessorParametric::m_validationMode
private

Definition at line 123 of file HadIntProcessorParametric.h.

◆ m_validationTool

ToolHandle<IPhysicsValidationTool> iFatras::HadIntProcessorParametric::m_validationTool
private

Definition at line 124 of file HadIntProcessorParametric.h.


The documentation for this class was generated from the following files:
xAOD::iterator
JetConstituentVector::iterator iterator
Definition: JetConstituentVector.cxx:68
iFatras::HadIntProcessorParametric::m_rndGenSvc
ServiceHandle< IAtRndmGenSvc > m_rndGenSvc
Random Generator service.
Definition: HadIntProcessorParametric.h:114
Trk::proton
@ proton
Definition: ParticleHypothesis.h:31
ATH_MSG_FATAL
#define ATH_MSG_FATAL(x)
Definition: AthMsgStreamMacros.h:34
Trk::ParticleSwitcher::particle
constexpr ParticleHypothesis particle[PARTICLEHYPOTHESES]
the array of masses
Definition: ParticleHypothesis.h:76
Trk::k0
@ k0
Definition: ParticleHypothesis.h:35
python.SystemOfUnits.m
int m
Definition: SystemOfUnits.py:91
iFatras::HadIntProcessorParametric::m_minimumHadInitialEnergy
double m_minimumHadInitialEnergy
Definition: HadIntProcessorParametric.h:106
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
iFatras::HadIntProcessorParametric::m_truthRecordSvc
ServiceHandle< ISF::ITruthSvc > m_truthRecordSvc
Definition: HadIntProcessorParametric.h:111
CaloCellPos2Ntuple.int
int
Definition: CaloCellPos2Ntuple.py:24
Base_Fragment.mass
mass
Definition: Sherpa_i/share/common/Base_Fragment.py:59
iFatras::HadIntProcessorParametric::m_randomEngine
CLHEP::HepRandomEngine * m_randomEngine
Random engine
Definition: HadIntProcessorParametric.h:119
ISF::ParticleUserInformation::setProcess
void setProcess(int proc)
Definition: ParticleUserInformation.h:90
Trk::pi0
@ pi0
Definition: ParticleHypothesis.h:34
xAOD::deltaPhi
setSAddress setEtaMS setDirPhiMS setDirZMS setBarrelRadius setEndcapAlpha setEndcapRadius setInterceptInner setEtaMap setEtaBin setIsTgcFailure setDeltaPt deltaPhi
Definition: L2StandAloneMuon_v1.cxx:160
ISF::ParticleClipboard::getInstance
static ParticleClipboard & getInstance()
get the singleton instance
Definition: ParticleClipboard.h:61
mat
GeoMaterial * mat
Definition: LArDetectorConstructionTBEC.cxx:55
iFatras::HadIntProcessorParametric::recordHadState
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
Definition: HadIntProcessorParametric.cxx:700
python.SystemOfUnits.MeV
int MeV
Definition: SystemOfUnits.py:154
Trk::MaterialProperties::thicknessInX0
float thicknessInX0() const
Return the radiationlength fraction.
TRTCalib_cfilter.p1
p1
Definition: TRTCalib_cfilter.py:130
ISF::ISFParticle
Definition: ISFParticle.h:42
M_PI
#define M_PI
Definition: ActiveFraction.h:11
mc.diff
diff
Definition: mc.SFGenPy8_MuMu_DD.py:14
iFatras::HadIntProcessorParametric::m_hadIntMotherPt
float m_hadIntMotherPt
ntuple variable : hadronic interaction mother momentum
Definition: HadIntProcessorParametric.h:141
Trk::MaterialProperties::thicknessInL0
float thicknessInL0() const
Return the nuclear interaction length fraction.
iFatras::HadIntProcessorParametric::m_hadIntPointR
float m_hadIntPointR
ntuple variable : hadronic interaction point r distance
Definition: HadIntProcessorParametric.h:136
iFatras::HadIntProcessorParametric::getHadState
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
Definition: HadIntProcessorParametric.cxx:250
iFatras::HadIntProcessorParametric::m_hadIntChildPcms
float m_hadIntChildPcms[MAXHADINTCHILDREN]
nutple variable : hadronic interaction child Energy
Definition: HadIntProcessorParametric.h:148
TrigInDetValidation_Base.test
test
Definition: TrigInDetValidation_Base.py:147
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
drawFromPickle.cos
cos
Definition: drawFromPickle.py:36
ATH_MSG_VERBOSE
#define ATH_MSG_VERBOSE(x)
Definition: AthMsgStreamMacros.h:28
drawFromPickle.exp
exp
Definition: drawFromPickle.py:36
yodamerge_tmp.scale
scale
Definition: yodamerge_tmp.py:138
iFatras::HadIntProcessorParametric::m_processCode
int m_processCode
MCTruth process code for TruthIncidents created by this tool.
Definition: HadIntProcessorParametric.h:116
covarianceTool.prob
prob
Definition: covarianceTool.py:678
iFatras::HadIntProcessorParametric::m_hadIntPointZ
float m_hadIntPointZ
ntuple variable : hadronic interaction point z coordinate
Definition: HadIntProcessorParametric.h:137
x
#define x
iFatras::HadIntProcessorParametric::m_hadIntPointY
float m_hadIntPointY
ntuple variable : hadronic interaction point y coordinate
Definition: HadIntProcessorParametric.h:135
iFatras::HadIntProcessorParametric::m_hadIntChildTh
float m_hadIntChildTh[MAXHADINTCHILDREN]
nutple variable : hadronic interaction child phi
Definition: HadIntProcessorParametric.h:152
xAOD::phi
setEt phi
Definition: TrigEMCluster_v1.cxx:29
Trk::MaterialProperties::thickness
float thickness() const
Return the thickness in mm.
TRTCalib_cfilter.p2
p2
Definition: TRTCalib_cfilter.py:131
python.utils.AtlRunQueryDQUtils.p
p
Definition: AtlRunQueryDQUtils.py:210
ParticleGun_EoverP_Config.mom
mom
Definition: ParticleGun_EoverP_Config.py:63
python.TriggerHandler.th
th
Definition: TriggerHandler.py:296
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
convertTimingResiduals.sum
sum
Definition: convertTimingResiduals.py:55
ParticleGun_EoverP_Config.momentum
momentum
Definition: ParticleGun_EoverP_Config.py:63
ISF::ISFTruthIncident
Definition: ISFTruthIncident.h:35
lumiFormat.i
int i
Definition: lumiFormat.py:85
z
#define z
beamspotman.n
n
Definition: beamspotman.py:731
iFatras::HadIntProcessorParametric::m_hadIntChildDeltaPhi
float m_hadIntChildDeltaPhi[MAXHADINTCHILDREN]
nutple variable : hadronic interaction child delta phi
Definition: HadIntProcessorParametric.h:154
iFatras::HadIntProcessorParametric::m_hadIntMotherPdg
int m_hadIntMotherPdg
ntuple variable : hadronic interaction mother Pdg
Definition: HadIntProcessorParametric.h:138
iFatras::HadIntProcessorParametric::m_hadIntMotherEta
float m_hadIntMotherEta
ntuple variable : hadronic interaction photon eta
Definition: HadIntProcessorParametric.h:143
iFatras::HadIntProcessorParametric::m_hadIntValidationTreeName
std::string m_hadIntValidationTreeName
validation tree name - to be acessed by this from root
Definition: HadIntProcessorParametric.h:127
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
HepMC::barcode
int barcode(const T *p)
Definition: Barcode.h:16
ISF::ParticleUserInformation
Definition: ParticleUserInformation.h:52
Trk::pion
@ pion
Definition: ParticleHypothesis.h:29
ISF::ISFParticleVector
std::vector< ISF::ISFParticle * > ISFParticleVector
ISFParticle vector.
Definition: ISFParticleContainer.h:26
iFatras::HadIntProcessorParametric::m_hadIntFromX0
bool m_hadIntFromX0
Definition: HadIntProcessorParametric.h:104
iFatras::HadIntProcessorParametric::m_hadIntMotherBarcode
int m_hadIntMotherBarcode
ntuple variable : hadronic interaction mother barcode
Definition: HadIntProcessorParametric.h:139
HepMC::uniqueID
int uniqueID(const T &p)
Definition: MagicNumbers.h:116
test_pyathena.parent
parent
Definition: test_pyathena.py:15
iFatras::HadIntProcessorParametric::m_hadIntChildP
float m_hadIntChildP[MAXHADINTCHILDREN]
nutple variable : hadronic interaction child Energy
Definition: HadIntProcessorParametric.h:147
iFatras::HadIntProcessorParametric::m_hadIntMotherP
float m_hadIntMotherP
ntuple variable : hadronic interaction mother momentum
Definition: HadIntProcessorParametric.h:140
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
MAXHADINTCHILDREN
#define MAXHADINTCHILDREN
Definition: HadIntProcessorParametric.h:25
jobOption.theta
theta
Definition: jobOption.ParticleGun_fwd_sequence.py:13
Trk::neutron
@ neutron
Definition: ParticleHypothesis.h:33
iFatras::HadIntProcessorParametric::m_particleBroker
ServiceHandle< ISF::IParticleBroker > m_particleBroker
ISF services & Tools.
Definition: HadIntProcessorParametric.h:110
iFatras::HadIntProcessorParametric::m_hadIntMotherPhi
float m_hadIntMotherPhi
ntuple variable : hadronic interaction mother phi
Definition: HadIntProcessorParametric.h:142
HepMC::UNDEFINED_ID
constexpr int UNDEFINED_ID
Definition: MagicNumbers.h:56
ISF::ParticleUserInformation::setGeneration
void setGeneration(int gen)
Definition: ParticleUserInformation.h:92
create_dcsc_inputs_sqlite.arg
list arg
Definition: create_dcsc_inputs_sqlite.py:48
iFatras::HadIntProcessorParametric::m_hadIntValidationTree
TTree * m_hadIntValidationTree
Root Validation Tree.
Definition: HadIntProcessorParametric.h:131
iFatras::HadIntProcessorParametric::m_cutChain
bool m_cutChain
Definition: HadIntProcessorParametric.h:103
Trk::ParticleMasses::mass
constexpr double mass[PARTICLEHYPOTHESES]
the array of masses
Definition: ParticleHypothesis.h:53
HepMC::SIM_STATUS_THRESHOLD
constexpr int SIM_STATUS_THRESHOLD
Constant definiting the status threshold for simulated particles, eg. can be used to separate generat...
Definition: MagicNumbers.h:46
iFatras::HadIntProcessorParametric::m_childMomParam
double m_childMomParam
Definition: HadIntProcessorParametric.h:102
VP1PartSpect::E
@ E
Definition: VP1PartSpectFlags.h:21
charge
double charge(const T &p)
Definition: AtlasPID.h:756
iFatras::HadIntProcessorParametric::m_hadIntValidationTreeDescription
std::string m_hadIntValidationTreeDescription
validation tree description - second argument in TTree
Definition: HadIntProcessorParametric.h:128
ISF::ISFParticle::setUserInformation
void setUserInformation(ParticleUserInformation *userInfo)
iFatras::HadIntProcessorParametric::m_hadIntChildDeltaEta
float m_hadIntChildDeltaEta[MAXHADINTCHILDREN]
nutple variable : hadronic interaction child delta eta
Definition: HadIntProcessorParametric.h:155
Amg::Vector3D
Eigen::Matrix< double, 3, 1 > Vector3D
Definition: GeoPrimitives.h:47
iFatras::HadIntProcessorParametric::m_validationTool
ToolHandle< IPhysicsValidationTool > m_validationTool
Definition: HadIntProcessorParametric.h:124
Trk::kaon
@ kaon
Definition: ParticleHypothesis.h:30
ISF::ParticleClipboard::getParticle
const ISF::ISFParticle * getParticle() const
get the particle from the clipboard
Definition: ParticleClipboard.h:72
Trk::vertex
@ vertex
Definition: MeasurementType.h:21
iFatras::HadIntProcessorParametric::m_validationMode
bool m_validationMode
Definition: HadIntProcessorParametric.h:123
Trk::MaterialProperties
Definition: MaterialProperties.h:40
y
#define y
iFatras::HadIntProcessorParametric::m_minimumHadOutEnergy
double m_minimumHadOutEnergy
hadronic interaction setting
Definition: HadIntProcessorParametric.h:101
Trk::MaterialProperties::averageZ
float averageZ() const
Returns the average Z of the material.
iFatras::HadIntProcessorParametric::m_randomEngineName
std::string m_randomEngineName
Name of the random number stream.
Definition: HadIntProcessorParametric.h:120
iFatras::HadIntProcessorParametric::m_hadIntChildPhi
float m_hadIntChildPhi[MAXHADINTCHILDREN]
nutple variable : hadronic interaction child phi
Definition: HadIntProcessorParametric.h:150
iFatras::HadIntProcessorParametric::m_hadIntPointX
float m_hadIntPointX
ntuple variable : hadronic interaction point x coordinate
Definition: HadIntProcessorParametric.h:134
python.DecayParser.children
children
Definition: DecayParser.py:32
compute_lumi.fin
fin
Definition: compute_lumi.py:19
iFatras::HadIntProcessorParametric::m_hadIntChildEta
float m_hadIntChildEta[MAXHADINTCHILDREN]
nutple variable : hadronic interaction child eta
Definition: HadIntProcessorParametric.h:151
merge.status
status
Definition: merge.py:17
python.Constants.VERBOSE
int VERBOSE
Definition: Control/AthenaCommon/python/Constants.py:14
drawFromPickle.sin
sin
Definition: drawFromPickle.py:36
iFatras::HadIntProcessorParametric::m_hadIntValidation
bool m_hadIntValidation
Definition: HadIntProcessorParametric.h:126
HepMC::generations
int generations(const T &p)
Method to return how many interactions a particle has undergone during simulation (TODO migrate to be...
Definition: MagicNumbers.h:358
iFatras::HadIntProcessorParametric::m_hadIntChildE
float m_hadIntChildE
nutple variable : hadronic interaction children total energy
Definition: HadIntProcessorParametric.h:146
iFatras::HadIntProcessorParametric::m_hadIntProbScale
double m_hadIntProbScale
Definition: HadIntProcessorParametric.h:105
pow
constexpr int pow(int base, int exp) noexcept
Definition: ap_fixedTest.cxx:15
iFatras::HadIntProcessorParametric::m_hadIntChildPdg
int m_hadIntChildPdg[MAXHADINTCHILDREN]
nutple variable : hadronic interaction child Pdg
Definition: HadIntProcessorParametric.h:149
iFatras::HadIntProcessorParametric::m_hadIntValidationTreeFolder
std::string m_hadIntValidationTreeFolder
stream/folder to for the TTree to be written out
Definition: HadIntProcessorParametric.h:129
iFatras::HadIntProcessorParametric::m_hadIntChildren
int m_hadIntChildren
nutple variable : hadronic interaction children numbers
Definition: HadIntProcessorParametric.h:145
iFatras::HadIntProcessorParametric::absorptionLength
static double absorptionLength(const Trk::MaterialProperties *mat, double p, double q, Trk::ParticleHypothesis particle=Trk::pion)
interface for calculation of absorption length
Definition: HadIntProcessorParametric.cxx:228
ISF::fKillsPrimary
@ fKillsPrimary
Definition: ISFTruthIncident.h:25
iFatras::HadIntProcessorParametric::m_hadIntChildThc
float m_hadIntChildThc[MAXHADINTCHILDREN]
nutple variable : hadronic interaction child eta
Definition: HadIntProcessorParametric.h:153