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 230 of file HadIntProcessorParametric.cxx.

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

◆ 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 691 of file HadIntProcessorParametric.cxx.

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

◆ 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 661 of file HadIntProcessorParametric.cxx.

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

◆ finalize()

StatusCode iFatras::HadIntProcessorParametric::finalize ( )

AlgTool finalize method.

Definition at line 183 of file HadIntProcessorParametric.cxx.

184 {
185  ATH_MSG_DEBUG( "finalize() successful" );
186  return StatusCode::SUCCESS;
187 }

◆ 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 252 of file HadIntProcessorParametric.cxx.

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

◆ 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 190 of file HadIntProcessorParametric.cxx.

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

◆ 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  ITHistSvc* tHistSvc = nullptr;
136  // now register the Tree
137  if (service("THistSvc",tHistSvc).isFailure())
138  ATH_MSG_ERROR( "initialize() Could not find Hist Service -> Switching ValidationMode Off !" );
139  else {
140 
141  ATH_MSG_VERBOSE( "Booking hadronic interaction validation TTree ... " );
142 
143  // create the new Tree
145 
146  // counter for boundary surfaces
147  m_hadIntValidationTree->Branch("HadIntPointX" , &m_hadIntPointX, "hintX/F");
148  m_hadIntValidationTree->Branch("HadIntPointY" , &m_hadIntPointY, "hintY/F");
149  m_hadIntValidationTree->Branch("HadIntPointR" , &m_hadIntPointR, "hintR/F");
150  m_hadIntValidationTree->Branch("HadIntPointZ" , &m_hadIntPointZ, "hintZ/F");
151  m_hadIntValidationTree->Branch("HadIntMotherPdg" , &m_hadIntMotherPdg, "hintMotherPdg/I");
152  m_hadIntValidationTree->Branch("HadIntMotherBarcode" , &m_hadIntMotherBarcode, "hintMotherBarcode/I");
153  m_hadIntValidationTree->Branch("HadIntMotherP" , &m_hadIntMotherP, "hintMotherP/F");
154  m_hadIntValidationTree->Branch("HadIntMotherPt" , &m_hadIntMotherPt, "hintMotherPt/F");
155  m_hadIntValidationTree->Branch("HadIntMotherPhi" , &m_hadIntMotherPhi, "hintMotherPhi/F");
156  m_hadIntValidationTree->Branch("HadIntMotherEta" , &m_hadIntMotherEta, "hintMohterEta/F");
157 
158  m_hadIntValidationTree->Branch("HadIntChildren" , &m_hadIntChildren, "hintcs/I");
159  m_hadIntValidationTree->Branch("HadIntChildE " , &m_hadIntChildE, "hintce/F");
160  m_hadIntValidationTree->Branch("HadIntChildPdg" , m_hadIntChildPdg, "hintChildPdg[hintcs]/I");
161  m_hadIntValidationTree->Branch("HadIntChildP" , m_hadIntChildP, "hintChildP[hintcs]/F");
162  m_hadIntValidationTree->Branch("HadIntChildPcms" , m_hadIntChildPcms, "hintChildPcms[hintcs]/F");
163  m_hadIntValidationTree->Branch("HadIntChildTh" , m_hadIntChildTh, "hintChildTh[hintcs]/F");
164  m_hadIntValidationTree->Branch("HadIntChildThc" , m_hadIntChildThc, "hintChildThc[hintcs]/F");
165  m_hadIntValidationTree->Branch("HadIntChildPhi" , m_hadIntChildPhi, "hintChildPhi[hintcs]/F");
166  m_hadIntValidationTree->Branch("HadIntChildEta" , m_hadIntChildEta, "hintChildEta[hintcs]/F");
167  m_hadIntValidationTree->Branch("HadIntChildDeltaPhi", m_hadIntChildDeltaPhi, "hintChildPhi[hintcs]/F");
168  m_hadIntValidationTree->Branch("HadIntChildDeltaEta", m_hadIntChildDeltaEta, "hintChildEta[hintcs]/F");
169 
170 
171  if ((tHistSvc->regTree(m_hadIntValidationTreeFolder, m_hadIntValidationTree)).isFailure()) {
172  ATH_MSG_ERROR("initialize() Could not register the validation Tree -> Switching ValidationMode Off !" );
174  } else
175  ATH_MSG_INFO( "TTree for Hadronic Interactions validation booked." );
176  }
177  } // ------------- end of validation mode -----------------------------------------------------------------
178  ATH_MSG_DEBUG( "finalize() successful" );
179  return StatusCode::SUCCESS;
180 }

◆ 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 702 of file HadIntProcessorParametric.cxx.

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

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
python.PerfMonSerializer.p
def p
Definition: PerfMonSerializer.py:743
phi
Scalar phi() const
phi method
Definition: AmgMatrixBasePlugin.h:64
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
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:53
theta
Scalar theta() const
theta method
Definition: AmgMatrixBasePlugin.h:71
conifer::pow
constexpr int pow(int x)
Definition: conifer.h:20
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:702
python.SystemOfUnits.MeV
int MeV
Definition: SystemOfUnits.py:154
Trk::MaterialProperties::thicknessInX0
float thicknessInX0() const
Return the radiationlength fraction.
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:252
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:144
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
dqt_zlumi_pandas.mass
mass
Definition: dqt_zlumi_pandas.py:170
iFatras::HadIntProcessorParametric::m_hadIntChildTh
float m_hadIntChildTh[MAXHADINTCHILDREN]
nutple variable : hadronic interaction child phi
Definition: HadIntProcessorParametric.h:152
Trk::MaterialProperties::thickness
float thickness() const
Return the thickness in mm.
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:92
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:113
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
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:55
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:38
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:494
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
CaloSwCorrections.time
def time(flags, cells_name, *args, **kw)
Definition: CaloSwCorrections.py:242
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
declareProperty
#define declareProperty(n, p, h)
Definition: BaseFakeBkgTool.cxx:15
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:302
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
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:230
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