CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions | Private Attributes | Static Private Attributes
fastsim::NuclearInteraction Class Reference

Implementation of nuclear interactions of hadrons in the tracker layers (based on fully simulated interactions). More...

Inheritance diagram for fastsim::NuclearInteraction:
fastsim::InteractionModel

Public Member Functions

void interact (fastsim::Particle &particle, const SimplifiedGeometry &layer, std::vector< std::unique_ptr< fastsim::Particle > > &secondaries, const RandomEngineAndDistribution &random) override
 Perform the interaction. More...
 
 NuclearInteraction (const std::string &name, const edm::ParameterSet &cfg)
 Constructor. More...
 
 ~NuclearInteraction () override
 Default destructor. More...
 
- Public Member Functions inherited from fastsim::InteractionModel
const std::string getName ()
 Return (unique) name of this interaction. More...
 
virtual void interact (Particle &particle, const SimplifiedGeometry &layer, std::vector< std::unique_ptr< Particle > > &secondaries, const RandomEngineAndDistribution &random)=0
 Perform the interaction. More...
 
 InteractionModel (std::string name)
 Constructor. More...
 
virtual void registerProducts (edm::ProducesCollector) const
 In case interaction produces and stores content in the event (e.g. TrackerSimHits). More...
 
virtual void storeProducts (edm::Event &iEvent)
 In case interaction produces and stores content in the event (e.g. TrackerSimHits). More...
 
virtual ~InteractionModel ()
 Default destructor. More...
 

Private Member Functions

unsigned index (int thePid)
 Return a hashed index for a given particle ID. More...
 
XYZVector orthogonal (const XYZVector &aVector) const
 Return an orthogonal vector. More...
 
bool read (std::string inputFile)
 Read the nuclear interactions from a file, so you can reproduce the events (e.g. in case of a crash). More...
 
void save ()
 Save the nuclear interactions to a file, so you can reproduce the events (e.g. in case of a crash). More...
 

Private Attributes

const std::vector< int > antineutronsID = {-2112, -3122, -3112, -3312, -3322}
 PdgID of anti-neutrons. More...
 
const std::vector< int > antiprotonsID = {-2212, -3222}
 PdgID of anti-protons. More...
 
bool currentValuesWereSet
 Read data from file that was created in a previous run. More...
 
unsigned ien4
 Find the index for which EN = 4. More...
 
std::string inputFile
 Directory/Name of input file in case you want to read interactions from file. More...
 
const std::vector< int > K0LsID = {130, 310}
 PdgID of K0. More...
 
const std::vector< int > KminussesID = {-321}
 PdgID of K-. More...
 
const std::vector< int > KplussesID = {321}
 PdgID of K+. More...
 
unsigned myOutputBuffer
 Needed to save interactions to file. More...
 
std::ofstream myOutputFile
 Output file to save interactions. More...
 
const std::vector< int > neutronsID = {2112, 3122, 3112, 3312, 3322, 3334, -3334}
 PdgID of neutrons. More...
 
const std::vector< int > PiminussesID = {-211}
 PdgID of pi-. More...
 
const std::vector< int > PiplussesID = {211}
 PdgID of pt+. More...
 
const std::vector< int > protonsID = {2212, 3222, -101, -102, -103, -104}
 PdgID of protons. More...
 
std::vector< std::vector< TBranch * > > theBranches
 Necessary to read the FullSim interactions. More...
 
std::vector< std::vector< unsigned > > theCurrentEntry
 Necessary to read the FullSim interactions. More...
 
std::vector< std::vector< unsigned > > theCurrentInteraction
 Necessary to read the FullSim interactions. More...
 
double theDistCut
 Cut on deltaR for the FastSim Tracking (ClosestChargedDaughter algorithm) More...
 
TFile * theFile = nullptr
 Necessary to read the FullSim interactions. More...
 
std::vector< std::vector< std::string > > theFileNames
 Necessary to read the FullSim interactions. More...
 
std::vector< std::vector< double > > theHadronCM
 Necessary to read the FullSim interactions. More...
 
const std::vector< double > theHadronEN
 Filled into 'theRatiosMap' (evolution of the interaction lengths with energy) More...
 
double theHadronEnergy
 Minimum energy for nuclear interaction. More...
 
const std::vector< int > theHadronID = {211, -211, 130, 321, -321, 2212, -2212, 2112, -2112}
 ID of the hadrons. More...
 
const std::vector< double > theHadronMA
 Masses of the hadrons. More...
 
const std::vector< std::string > theHadronNA
 Names of the hadrons. More...
 
const std::vector< double > theHadronPMin = {0.7, 0.0, 1.0, 1.0, 0.0, 1.1, 0.0, 1.1, 0.0}
 Smallest momentum for inelastic interactions. More...
 
const std::vector< double > theLengthRatio
 Inelastic interaction length at p(Hadron) = 5 GeV/c (relativ to radionLength of material) More...
 
std::vector< std::vector< NUEvent * > > theNUEvents
 Necessary to read the FullSim interactions. More...
 
std::vector< std::vector< unsigned > > theNumberOfEntries
 Necessary to read the FullSim interactions. More...
 
std::vector< std::vector< unsigned > > theNumberOfInteractions
 Necessary to read the FullSim interactions. More...
 
const std::vector< double > theRatios
 Filled into 'theRatiosMap' (evolution of the interaction lengths with energy) More...
 
std::vector< std::vector< TTree * > > theTrees
 Necessary to read the FullSim interactions. More...
 

Static Private Attributes

static std::map< int, int > theIDMap
 Build the ID map (i.e., what is to be considered as a proton, etc...) More...
 
static std::vector< std::vector< double > > theRatiosMap
 The evolution of the interaction lengths with energy. More...
 

Detailed Description

Implementation of nuclear interactions of hadrons in the tracker layers (based on fully simulated interactions).

Computes the probability for hadrons to interact with a nucleon of the tracker material (inelastically) and then reads a nuclear interaction randomly from multiple fully simulated files. Also, another implementation of nuclear interactions can be used that is based on G4 (NuclearInteractionFTF).

Definition at line 58 of file NuclearInteraction.cc.

Constructor & Destructor Documentation

◆ NuclearInteraction()

fastsim::NuclearInteraction::NuclearInteraction ( const std::string &  name,
const edm::ParameterSet cfg 
)

Constructor.

Definition at line 348 of file NuclearInteraction.cc.

References antineutronsID, antiprotonsID, looper::cfg, gather_cfg::cout, currentValuesWereSet, Exception, corrVsCorr::filename, contentValuesFiles::fullPath, edm::FileInPath::fullPath(), mps_fire::i, EcalPhiSymFlatTableProducers_cfi::id, ien4, fastsim::initializeOnce, inputFile, dqmiolumiharvest::j, K0LsID, KminussesID, KplussesID, myOutputBuffer, myOutputFile, neutronsID, PiminussesID, PiplussesID, protonsID, read(), mathSSE::sqrt(), AlCaHLTBitMon_QueryRunRegistry::string, theBranches, theCurrentEntry, theCurrentInteraction, theDistCut, theFile, theFileNames, theHadronCM, theHadronEN, theHadronEnergy, theHadronID, theHadronMA, theHadronNA, theIDMap, theNUEvents, theNumberOfEntries, theNumberOfInteractions, theRatios, theRatiosMap, theTrees, to_string(), and ticlDumper_cff::treeName.

350  // Full path to FullSim root file
352 
353  // Read from config file
354  theDistCut = cfg.getParameter<double>("distCut");
355  theHadronEnergy = cfg.getParameter<double>("hadronEnergy");
356  inputFile = cfg.getUntrackedParameter<std::string>("inputFile", "");
357 
358  // The evolution of the interaction lengths with energy
359  // initialize once for all possible instances
360  std::call_once(initializeOnce, [this]() {
361  theRatiosMap.resize(theHadronID.size());
362  for (unsigned i = 0; i < theHadronID.size(); ++i) {
363  for (unsigned j = 0; j < theHadronEN.size(); ++j) {
364  theRatiosMap[i].push_back(theRatios[i * theHadronEN.size() + j]);
365  }
366  }
367 
368  // Build the ID map (i.e., what is to be considered as a proton, etc...)
369  // Protons
370  for (const auto& id : protonsID)
371  theIDMap[id] = 2212;
372  // Anti-Protons
373  for (const auto& id : antiprotonsID)
374  theIDMap[id] = -2212;
375  // Neutrons
376  for (const auto& id : neutronsID)
377  theIDMap[id] = 2112;
378  // Anti-Neutrons
379  for (const auto& id : antineutronsID)
380  theIDMap[id] = -2112;
381  // K0L's
382  for (const auto& id : K0LsID)
383  theIDMap[id] = 130;
384  // K+'s
385  for (const auto& id : KplussesID)
386  theIDMap[id] = 321;
387  // K-'s
388  for (const auto& id : KminussesID)
389  theIDMap[id] = -321;
390  // pi+'s
391  for (const auto& id : PiplussesID)
392  theIDMap[id] = 211;
393  // pi-'s
394  for (const auto& id : PiminussesID)
395  theIDMap[id] = -211;
396  });
397 
398  // Prepare the map of files
399  // Loop over the particle names
400  TFile* aVFile = nullptr;
401  std::vector<TTree*> aVTree(theHadronEN.size());
402  std::vector<TBranch*> aVBranch(theHadronEN.size());
403  std::vector<NUEvent*> aVNUEvents(theHadronEN.size());
404  std::vector<unsigned> aVCurrentEntry(theHadronEN.size());
405  std::vector<unsigned> aVCurrentInteraction(theHadronEN.size());
406  std::vector<unsigned> aVNumberOfEntries(theHadronEN.size());
407  std::vector<unsigned> aVNumberOfInteractions(theHadronEN.size());
408  std::vector<std::string> aVFileName(theHadronEN.size());
409  std::vector<double> aVHadronCM(theHadronEN.size());
410  theTrees.resize(theHadronNA.size());
411  theBranches.resize(theHadronNA.size());
412  theNUEvents.resize(theHadronNA.size());
413  theCurrentEntry.resize(theHadronNA.size());
414  theCurrentInteraction.resize(theHadronNA.size());
415  theNumberOfEntries.resize(theHadronNA.size());
416  theNumberOfInteractions.resize(theHadronNA.size());
417  theFileNames.resize(theHadronNA.size());
418  theHadronCM.resize(theHadronNA.size());
419  theFile = aVFile;
420  for (unsigned iname = 0; iname < theHadronNA.size(); ++iname) {
421  theTrees[iname] = aVTree;
422  theBranches[iname] = aVBranch;
423  theNUEvents[iname] = aVNUEvents;
424  theCurrentEntry[iname] = aVCurrentEntry;
425  theCurrentInteraction[iname] = aVCurrentInteraction;
426  theNumberOfEntries[iname] = aVNumberOfEntries;
427  theNumberOfInteractions[iname] = aVNumberOfInteractions;
428  theFileNames[iname] = aVFileName;
429  theHadronCM[iname] = aVHadronCM;
430  }
431 
432  // Read the information from a previous run (to keep reproducibility)
433  currentValuesWereSet = this->read(inputFile);
435  std::cout << "***WARNING*** You are reading nuclear-interaction information from the file " << inputFile
436  << " created in an earlier run." << std::endl;
437 
438  // Open the file for saving the information of the current run
439  myOutputFile.open("NuclearInteractionOutputFile.txt");
440  myOutputBuffer = 0;
441 
442  // Open the root file
443  edm::FileInPath myDataFile("FastSimulation/MaterialEffects/data/NuclearInteractions.root");
444  fullPath = myDataFile.fullPath();
445  theFile = TFile::Open(fullPath.c_str());
446 
447  // Open the trees
448  for (unsigned iname = 0; iname < theHadronNA.size(); ++iname) {
449  for (unsigned iene = 0; iene < theHadronEN.size(); ++iene) {
450  std::ostringstream filename;
451  double theEne = theHadronEN[iene];
452  filename << "NuclearInteractionsVal_" << theHadronNA[iname] << "_E" << theEne << ".root";
453  theFileNames[iname][iene] = filename.str();
454 
455  std::string treeName = "NuclearInteractions_" + theHadronNA[iname] + "_E" + std::to_string(int(theEne));
456  theTrees[iname][iene] = (TTree*)theFile->Get(treeName.c_str());
457 
458  if (!theTrees[iname][iene])
459  throw cms::Exception("FastSimulation/MaterialEffects") << "Tree with name " << treeName << " not found ";
460  theBranches[iname][iene] = theTrees[iname][iene]->GetBranch("nuEvent");
461  if (!theBranches[iname][iene])
462  throw cms::Exception("FastSimulation/MaterialEffects")
463  << "Branch with name nuEvent not found in " << theFileNames[iname][iene];
464 
465  theNUEvents[iname][iene] = new NUEvent();
466  theBranches[iname][iene]->SetAddress(&theNUEvents[iname][iene]);
467  theNumberOfEntries[iname][iene] = theTrees[iname][iene]->GetEntries();
468 
469  if (currentValuesWereSet) {
470  theTrees[iname][iene]->GetEntry(theCurrentEntry[iname][iene]);
471  unsigned NInteractions = theNUEvents[iname][iene]->nInteractions();
472  theNumberOfInteractions[iname][iene] = NInteractions;
473  }
474 
475  // Compute the corresponding cm energies of the nuclear interactions
476  XYZTLorentzVector Proton(0., 0., 0., 0.986);
477  XYZTLorentzVector Reference(
478  0.,
479  0.,
480  std::sqrt(theHadronEN[iene] * theHadronEN[iene] - theHadronMA[iname] * theHadronMA[iname]),
481  theHadronEN[iene]);
482  theHadronCM[iname][iene] = (Reference + Proton).M();
483  }
484  }
485 
486  // Find the index for which EN = 4. (or thereabout)
487  ien4 = 0;
488  while (theHadronEN[ien4] < 4.0)
489  ++ien4;
490 
491  gROOT->cd();
492 }
const std::vector< int > antineutronsID
PdgID of anti-neutrons.
const std::vector< int > PiplussesID
PdgID of pt+.
std::vector< std::vector< unsigned > > theCurrentInteraction
Necessary to read the FullSim interactions.
double theDistCut
Cut on deltaR for the FastSim Tracking (ClosestChargedDaughter algorithm)
const std::vector< int > KminussesID
PdgID of K-.
std::vector< std::vector< unsigned > > theNumberOfEntries
Necessary to read the FullSim interactions.
bool currentValuesWereSet
Read data from file that was created in a previous run.
const std::vector< int > KplussesID
PdgID of K+.
std::vector< std::vector< std::string > > theFileNames
Necessary to read the FullSim interactions.
TFile * theFile
Necessary to read the FullSim interactions.
static std::vector< std::vector< double > > theRatiosMap
The evolution of the interaction lengths with energy.
std::vector< std::vector< double > > theHadronCM
Necessary to read the FullSim interactions.
std::vector< std::vector< NUEvent * > > theNUEvents
Necessary to read the FullSim interactions.
static std::string to_string(const XMLCh *ch)
const std::vector< int > protonsID
PdgID of protons.
Base class for any interaction model between a particle and a tracker layer.
const std::vector< double > theRatios
Filled into &#39;theRatiosMap&#39; (evolution of the interaction lengths with energy)
const std::vector< int > K0LsID
PdgID of K0.
Definition: NUEvent.h:6
const std::vector< int > antiprotonsID
PdgID of anti-protons.
static std::map< int, int > theIDMap
Build the ID map (i.e., what is to be considered as a proton, etc...)
T sqrt(T t)
Definition: SSEVec.h:23
std::ofstream myOutputFile
Output file to save interactions.
const std::vector< int > neutronsID
PdgID of neutrons.
double theHadronEnergy
Minimum energy for nuclear interaction.
bool read(std::string inputFile)
Read the nuclear interactions from a file, so you can reproduce the events (e.g. in case of a crash)...
unsigned ien4
Find the index for which EN = 4.
const std::vector< double > theHadronMA
Masses of the hadrons.
std::vector< std::vector< TBranch * > > theBranches
Necessary to read the FullSim interactions.
const std::vector< int > PiminussesID
PdgID of pi-.
const std::vector< double > theHadronEN
Filled into &#39;theRatiosMap&#39; (evolution of the interaction lengths with energy)
std::vector< std::vector< unsigned > > theNumberOfInteractions
Necessary to read the FullSim interactions.
static std::once_flag initializeOnce
const std::vector< int > theHadronID
ID of the hadrons.
std::string inputFile
Directory/Name of input file in case you want to read interactions from file.
std::vector< std::vector< TTree * > > theTrees
Necessary to read the FullSim interactions.
const std::vector< std::string > theHadronNA
Names of the hadrons.
math::XYZTLorentzVector XYZTLorentzVector
Definition: RawParticle.h:25
std::vector< std::vector< unsigned > > theCurrentEntry
Necessary to read the FullSim interactions.
unsigned myOutputBuffer
Needed to save interactions to file.

◆ ~NuclearInteraction()

fastsim::NuclearInteraction::~NuclearInteraction ( )
override

Default destructor.

Definition at line 494 of file NuclearInteraction.cc.

References cuy::save, and makeListRunsInFiles::theFile.

494  {
495  // Close all local files
496  // Among other things, this allows the TROOT destructor to end up
497  // without crashing, while trying to close these files from outside
498  theFile->Close();
499  delete theFile;
500 
501  for (auto& vEvents : theNUEvents) {
502  for (auto evtPtr : vEvents) {
503  delete evtPtr;
504  }
505  }
506 
507  // Save data
508  save();
509  // Close the output file
510  myOutputFile.close();
511 }
TFile * theFile
Necessary to read the FullSim interactions.
std::vector< std::vector< NUEvent * > > theNUEvents
Necessary to read the FullSim interactions.
std::ofstream myOutputFile
Output file to save interactions.
void save()
Save the nuclear interactions to a file, so you can reproduce the events (e.g. in case of a crash)...

Member Function Documentation

◆ index()

unsigned fastsim::NuclearInteraction::index ( int  thePid)
private

Return a hashed index for a given particle ID.

Definition at line 897 of file NuclearInteraction.cc.

897  {
898  // Find hashed particle ID
899  unsigned myIndex = 0;
900  while (thePid != theHadronID[myIndex])
901  ++myIndex;
902  return myIndex;
903 }
const std::vector< int > theHadronID
ID of the hadrons.

◆ interact()

void fastsim::NuclearInteraction::interact ( fastsim::Particle particle,
const SimplifiedGeometry layer,
std::vector< std::unique_ptr< fastsim::Particle > > &  secondaries,
const RandomEngineAndDistribution random 
)
override

Perform the interaction.

Parameters
particleThe particle that interacts with the matter.
layerThe detector layer that interacts with the particle.
secondariesParticles that are produced in the interaction (if any).
randomThe Random Engine.

Definition at line 513 of file NuclearInteraction.cc.

References A, funct::abs(), fastsim::Particle::charge(), HBHEDarkening_cff::energy, JetChargeProducer_cfi::exp, NUEvent::NUInteraction::first, RandomEngineAndDistribution::flatShoot(), NUEvent::NUParticle::id, NUEvent::NUInteraction::last, CrabHelper::log, M_PI, NUEvent::NUParticle::mass, fastsim::Particle::momentum(), EgammaValidation_cff::pdgId, fastsim::Particle::pdgId(), ALCARECOTkAlMinBias_cff::pMin, fastsim::Particle::position(), funct::pow(), NUEvent::NUParticle::px, NUEvent::NUParticle::py, NUEvent::NUParticle::pz, fastsim::Particle::simTrackIndex(), funct::sin(), slope, mathSSE::sqrt(), tauSpinnerTable_cfi::theta, and HLT_2024v14_cff::zAxis.

516  {
517  int pdgId = particle.pdgId();
518  //
519  // no valid PDGid
520  //
521  if (abs(pdgId) <= 100 || abs(pdgId) >= 1000000) {
522  return;
523  }
524 
525  double radLengths = layer.getThickness(particle.position(), particle.momentum());
526  // TEC layers have some fudge factor for nuclear interactions
527  radLengths *= layer.getNuclearInteractionThicknessFactor();
528  //
529  // no material
530  //
531  if (radLengths < 1E-10) {
532  return;
533  }
534 
535  // In case the events are not read from (old) saved file, then pick a random event from FullSim file
536  if (!currentValuesWereSet) {
537  currentValuesWereSet = true;
538  for (unsigned iname = 0; iname < theHadronNA.size(); ++iname) {
539  for (unsigned iene = 0; iene < theHadronEN.size(); ++iene) {
540  theCurrentEntry[iname][iene] = (unsigned)(theNumberOfEntries[iname][iene] * random.flatShoot());
541 
542  theTrees[iname][iene]->GetEntry(theCurrentEntry[iname][iene]);
543  unsigned NInteractions = theNUEvents[iname][iene]->nInteractions();
544  theNumberOfInteractions[iname][iene] = NInteractions;
545 
546  theCurrentInteraction[iname][iene] = (unsigned)(theNumberOfInteractions[iname][iene] * random.flatShoot());
547  }
548  }
549  }
550 
551  // Momentum of interacting hadron
552  double pHadron = std::sqrt(particle.momentum().Vect().Mag2());
553 
554  //
555  // The hadron has not enough momentum to create some relevant final state
556  //
557  if (pHadron < theHadronEnergy) {
558  return;
559  }
560 
561  // The particle type
562  std::map<int, int>::const_iterator thePit = theIDMap.find(pdgId);
563  // Use map for unique ID (e.g. proton = {2212, 3222, -101, -102, -103, -104})
564  int thePid = (thePit != theIDMap.end() ? thePit->second : pdgId);
565 
566  // Is this particle type foreseen?
567  unsigned fPid = abs(thePid);
568  if (fPid != 211 && fPid != 130 && fPid != 321 && fPid != 2112 && fPid != 2212) {
569  return;
570  }
571 
572  // The hashed ID
573  unsigned thePidIndex = index(thePid);
574  // The inelastic interaction length at p(Hadron) = 5 GeV/c
575  double theInelasticLength = radLengths * theLengthRatio[thePidIndex];
576 
577  // The elastic interaction length
578  // The baroque parameterization is a fit to Fig. 40.13 of the PDG
579  double ee = pHadron > 0.6 ? exp(-std::sqrt((pHadron - 0.6) / 1.122)) : exp(std::sqrt((0.6 - pHadron) / 1.122));
580  double theElasticLength = (0.8753 * ee + 0.15) * theInelasticLength;
581 
582  // The total interaction length
583  double theTotalInteractionLength = theInelasticLength + theElasticLength;
584 
585  //
586  // Probability to interact is dl/L0 (maximum for 4 GeV Hadron)
587  //
588  double aNuclInteraction = -std::log(random.flatShoot());
589  if (aNuclInteraction > theTotalInteractionLength) {
590  return;
591  }
592 
593  // The elastic part
594  double elastic = random.flatShoot();
595  if (elastic < theElasticLength / theTotalInteractionLength) {
596  // Characteristic scattering angle for the elastic part
597  // A of silicon
598  double A = 28.0855;
599  double theta0 = std::sqrt(3.) / std::pow(A, 1. / 3.) * particle.momentum().mass() / pHadron;
600 
601  // Draw an angle with theta/theta0*exp[(-theta/2theta0)**2] shape
602  double theta = theta0 * std::sqrt(-2. * std::log(random.flatShoot()));
603  double phi = 2. * M_PI * random.flatShoot();
604 
605  // Rotate the particle accordingly
606  ROOT::Math::AxisAngle rotation1(orthogonal(particle.momentum().Vect()), theta);
607  ROOT::Math::AxisAngle rotation2(particle.momentum().Vect(), phi);
608  // Rotate!
609  XYZVector rotated = rotation2((rotation1(particle.momentum().Vect())));
610 
611  // Create a daughter if the kink is large enough
612  if (std::sin(theta) > theDistCut) {
613  secondaries.emplace_back(
615  particle.position(),
616  XYZTLorentzVector(rotated.X(), rotated.Y(), rotated.Z(), particle.momentum().E())));
617 
618  // Set the ClosestCharged Daughter thing for tracking
619  if (particle.charge() != 0) {
620  secondaries.back()->setMotherDeltaR(particle.momentum());
621  secondaries.back()->setMotherPdgId(pdgId);
622  secondaries.back()->setMotherSimTrackIndex(particle.simTrackIndex());
623  }
624 
625  // The particle is destroyed
626  particle.momentum().SetXYZT(0., 0., 0., 0.);
627  } else {
628  // If kink is small enough just rotate particle
629  particle.momentum().SetXYZT(rotated.X(), rotated.Y(), rotated.Z(), particle.momentum().E());
630  }
631  // The inelastic part
632  } else {
633  // Avoid multiple map access
634  const std::vector<double>& aHadronCM = theHadronCM[thePidIndex];
635  const std::vector<double>& aRatios = theRatiosMap[thePidIndex];
636  // Find the file with the closest c.m energy
637  // The target nucleon
638  XYZTLorentzVector Proton(0., 0., 0., 0.939);
639  // The current particle
640  const XYZTLorentzVector& Hadron = (const XYZTLorentzVector&)particle.momentum();
641  // The smallest momentum for inelastic interactions
642  double pMin = theHadronPMin[thePidIndex];
643  // The corresponding smallest four vector
644  XYZTLorentzVector Hadron0(0., 0., pMin, std::sqrt(pMin * pMin + particle.momentum().M2()));
645 
646  // The current centre-of-mass energy
647  double ecm = (Proton + Hadron).M();
648 
649  // Get the files of interest (closest c.m. energies)
650  unsigned ene1 = 0;
651  unsigned ene2 = 0;
652  // The smallest centre-of-mass energy
653  double ecm1 = (Proton + Hadron0).M();
654 
655  double ecm2 = aHadronCM[0];
656  double ratio1 = 0.;
657  double ratio2 = aRatios[0];
658  if (ecm > aHadronCM[0] && ecm < aHadronCM[aHadronCM.size() - 1]) {
659  for (unsigned ene = 1; ene < aHadronCM.size() && ecm > aHadronCM[ene - 1]; ++ene) {
660  if (ecm < aHadronCM[ene]) {
661  ene2 = ene;
662  ene1 = ene2 - 1;
663  ecm1 = aHadronCM[ene1];
664  ecm2 = aHadronCM[ene2];
665  ratio1 = aRatios[ene1];
666  ratio2 = aRatios[ene2];
667  }
668  }
669  } else if (ecm > aHadronCM[aHadronCM.size() - 1]) {
670  ene1 = aHadronCM.size() - 1;
671  ene2 = aHadronCM.size() - 2;
672  ecm1 = aHadronCM[ene1];
673  ecm2 = aHadronCM[ene2];
674  ratio1 = aRatios[ene2];
675  ratio2 = aRatios[ene2];
676  }
677 
678  // The inelastic part of the cross section depends cm energy
679  double slope = (std::log10(ecm) - std::log10(ecm1)) / (std::log10(ecm2) - std::log10(ecm1));
680  double inelastic = ratio1 + (ratio2 - ratio1) * slope;
681  double inelastic4 = pHadron < 4. ? aRatios[ien4] : 1.;
682 
683  // Simulate an inelastic interaction
684  if (elastic > 1. - (inelastic * theInelasticLength) / theTotalInteractionLength) {
685  // Avoid mutliple map access
686  std::vector<unsigned>& aCurrentInteraction = theCurrentInteraction[thePidIndex];
687  std::vector<unsigned>& aNumberOfInteractions = theNumberOfInteractions[thePidIndex];
688  std::vector<NUEvent*>& aNUEvents = theNUEvents[thePidIndex];
689 
690  // Choice of the file to read according the the log10(ecm) distance
691  // and protection against low momentum proton and neutron that never interacts
692  // (i.e., empty files)
693  unsigned ene;
694  if (random.flatShoot() < slope || aNumberOfInteractions[ene1] == 0) {
695  ene = ene2;
696  } else {
697  ene = ene1;
698  }
699 
700  // The boost characteristics
701  XYZTLorentzVector theBoost = Proton + Hadron;
702  theBoost /= theBoost.e();
703 
704  // Check we are not either at the end of an interaction bunch
705  // or at the end of a file
706  if (aCurrentInteraction[ene] == aNumberOfInteractions[ene]) {
707  std::vector<unsigned>& aCurrentEntry = theCurrentEntry[thePidIndex];
708  std::vector<unsigned>& aNumberOfEntries = theNumberOfEntries[thePidIndex];
709  std::vector<TTree*>& aTrees = theTrees[thePidIndex];
710  ++aCurrentEntry[ene];
711 
712  aCurrentInteraction[ene] = 0;
713  if (aCurrentEntry[ene] == aNumberOfEntries[ene]) {
714  aCurrentEntry[ene] = 0;
715  }
716 
717  unsigned myEntry = aCurrentEntry[ene];
718  aTrees[ene]->GetEntry(myEntry);
719  aNumberOfInteractions[ene] = aNUEvents[ene]->nInteractions();
720  }
721 
722  // Read the interaction
723  NUEvent::NUInteraction anInteraction = aNUEvents[ene]->theNUInteractions()[aCurrentInteraction[ene]];
724 
725  unsigned firstTrack = anInteraction.first;
726  unsigned lastTrack = anInteraction.last;
727 
728  // Some rotation around the boost axis, for more randomness
729  XYZVector theAxis = theBoost.Vect().Unit();
730  double theAngle = random.flatShoot() * 2. * M_PI;
731  ROOT::Math::AxisAngle axisRotation(theAxis, theAngle);
732  ROOT::Math::Boost axisBoost(theBoost.x(), theBoost.y(), theBoost.z());
733 
734  // A rotation to bring the particles back to the Hadron direction
735  XYZVector zAxis(0., 0., 1.);
736  XYZVector orthAxis = (zAxis.Cross(theBoost.Vect())).Unit();
737  double orthAngle = acos(theBoost.Vect().Unit().Z());
738  ROOT::Math::AxisAngle orthRotation(orthAxis, orthAngle);
739 
740  // Loop on the nuclear interaction products
741  for (unsigned iTrack = firstTrack; iTrack <= lastTrack; ++iTrack) {
742  NUEvent::NUParticle aParticle = aNUEvents[ene]->theNUParticles()[iTrack];
743 
744  // Add a RawParticle with the proper energy in the c.m. frame of
745  // the nuclear interaction
746  double energy = std::sqrt(aParticle.px * aParticle.px + aParticle.py * aParticle.py +
747  aParticle.pz * aParticle.pz + aParticle.mass * aParticle.mass / (ecm * ecm));
748 
749  XYZTLorentzVector daugtherMomentum(aParticle.px * ecm, aParticle.py * ecm, aParticle.pz * ecm, energy * ecm);
750 
751  // Rotate to the collision axis
752  XYZVector rotated = orthRotation(daugtherMomentum.Vect());
753  // Rotate around the boost axis for more randomness
754  rotated = axisRotation(rotated);
755 
756  // Rotated the daughter
757  daugtherMomentum.SetXYZT(rotated.X(), rotated.Y(), rotated.Z(), daugtherMomentum.E());
758 
759  // Boost it in the lab frame
760  daugtherMomentum = axisBoost(daugtherMomentum);
761 
762  // Create secondary
763  secondaries.emplace_back(new fastsim::Particle(aParticle.id, particle.position(), daugtherMomentum));
764 
765  // The closestCharged Daughter thing for tracking
766  // BUT: 'aParticle' also has to be charged, only then the mother should be set
767  // Unfortunately, NUEvent::NUParticle does not contain any info about the charge
768  // Did some tests and effect is absolutely negligible!
769  if (particle.charge() != 0) {
770  secondaries.back()->setMotherDeltaR(particle.momentum());
771  secondaries.back()->setMotherPdgId(pdgId);
772  secondaries.back()->setMotherSimTrackIndex(particle.simTrackIndex());
773  }
774  }
775 
776  // The particle is destroyed
777  particle.momentum().SetXYZT(0., 0., 0., 0.);
778 
779  // This is a note from previous version of code but I don't understand it:
780  // ERROR The way this loops through the events breaks
781  // replay. Which events are retrieved depends on
782  // which previous events were processed.
783 
784  // Increment for next time
785  ++aCurrentInteraction[ene];
786 
787  // Simulate a stopping hadron (low momentum)
788  } else if (pHadron < 4. && elastic > 1. - (inelastic4 * theInelasticLength) / theTotalInteractionLength) {
789  // The particle is destroyed
790  particle.momentum().SetXYZT(0., 0., 0., 0.);
791  }
792  }
793 }
std::vector< std::vector< unsigned > > theCurrentInteraction
Necessary to read the FullSim interactions.
double theDistCut
Cut on deltaR for the FastSim Tracking (ClosestChargedDaughter algorithm)
static const double slope[3]
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
std::vector< std::vector< unsigned > > theNumberOfEntries
Necessary to read the FullSim interactions.
bool currentValuesWereSet
Read data from file that was created in a previous run.
const math::XYZTLorentzVector & position() const
Return position of the particle.
Definition: Particle.h:140
static std::vector< std::vector< double > > theRatiosMap
The evolution of the interaction lengths with energy.
std::vector< std::vector< double > > theHadronCM
Necessary to read the FullSim interactions.
std::vector< std::vector< NUEvent * > > theNUEvents
Necessary to read the FullSim interactions.
const std::vector< double > theLengthRatio
Inelastic interaction length at p(Hadron) = 5 GeV/c (relativ to radionLength of material) ...
static std::map< int, int > theIDMap
Build the ID map (i.e., what is to be considered as a proton, etc...)
T sqrt(T t)
Definition: SSEVec.h:23
unsigned index(int thePid)
Return a hashed index for a given particle ID.
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
int simTrackIndex() const
Return index of the SimTrack.
Definition: Particle.h:153
math::XYZTLorentzVector XYZTLorentzVector
#define M_PI
double theHadronEnergy
Minimum energy for nuclear interaction.
int pdgId() const
Return pdgId of the particle.
Definition: Particle.h:134
XYZVector orthogonal(const XYZVector &aVector) const
Return an orthogonal vector.
const std::vector< double > theHadronPMin
Smallest momentum for inelastic interactions.
const math::XYZTLorentzVector & momentum() const
Return momentum of the particle.
Definition: Particle.h:143
unsigned ien4
Find the index for which EN = 4.
double charge() const
Return charge of the particle.
Definition: Particle.h:137
const std::vector< double > theHadronEN
Filled into &#39;theRatiosMap&#39; (evolution of the interaction lengths with energy)
std::vector< std::vector< unsigned > > theNumberOfInteractions
Necessary to read the FullSim interactions.
Definition: APVGainStruct.h:7
double flatShoot(double xmin=0.0, double xmax=1.0) const
Definition of a generic FastSim Particle which can be propagated through the detector (formerly Parti...
Definition: Particle.h:16
std::vector< std::vector< TTree * > > theTrees
Necessary to read the FullSim interactions.
math::XYZVector XYZVector
Definition: RawParticle.h:26
const std::vector< std::string > theHadronNA
Names of the hadrons.
Power< A, B >::type pow(const A &a, const B &b)
Definition: Power.h:29
math::XYZTLorentzVector XYZTLorentzVector
Definition: RawParticle.h:25
std::vector< std::vector< unsigned > > theCurrentEntry
Necessary to read the FullSim interactions.

◆ orthogonal()

XYZVector fastsim::NuclearInteraction::orthogonal ( const XYZVector aVector) const
private

Return an orthogonal vector.

Definition at line 905 of file NuclearInteraction.cc.

References x, y, and z.

905  {
906  double x = fabs(aVector.X());
907  double y = fabs(aVector.Y());
908  double z = fabs(aVector.Z());
909 
910  if (x < y)
911  return x < z ? XYZVector(0., aVector.Z(), -aVector.Y()) : XYZVector(aVector.Y(), -aVector.X(), 0.);
912  else
913  return y < z ? XYZVector(-aVector.Z(), 0., aVector.X()) : XYZVector(aVector.Y(), -aVector.X(), 0.);
914 }
math::XYZVector XYZVector
float x

◆ read()

bool fastsim::NuclearInteraction::read ( std::string  inputFile)
private

Read the nuclear interactions from a file, so you can reproduce the events (e.g. in case of a crash).

Definition at line 840 of file NuclearInteraction.cc.

References makeListRunsInFiles::inputFile, mysort::results, findQualityFiles::size, and edm_modernize_messagelogger::stat.

Referenced by edmIntegrityCheck.PublishToFileSystem::get(), and NuclearInteraction().

840  {
841  std::ifstream myInputFile;
842  struct stat results;
843  //
844  unsigned size1 = theCurrentEntry.size() * theCurrentEntry.begin()->size();
845  std::vector<unsigned> theCurrentEntries;
846  theCurrentEntries.resize(size1);
847  size1 *= sizeof(unsigned);
848  //
849  unsigned size2 = theCurrentInteraction.size() * theCurrentInteraction.begin()->size();
850  std::vector<unsigned> theCurrentInteractions;
851  theCurrentInteractions.resize(size2);
852  size2 *= sizeof(unsigned);
853  //
854  unsigned size = 0;
855 
856  // Open the file (if any), otherwise return false
857  myInputFile.open(inputFile.c_str());
858  if (myInputFile.is_open()) {
859  // Get the size of the file
860  if (stat(inputFile.c_str(), &results) == 0)
861  size = results.st_size;
862  else
863  return false; // Something is wrong with that file !
864 
865  // Position the pointer just before the last record
866  myInputFile.seekg(size - size1 - size2);
867  myInputFile.read((char*)(&theCurrentEntries.front()), size1);
868  myInputFile.read((char*)(&theCurrentInteractions.front()), size2);
869  myInputFile.close();
870 
871  // Read the current entries
872  std::vector<std::vector<unsigned> >::iterator aCurrentEntry = theCurrentEntry.begin();
873  std::vector<std::vector<unsigned> >::iterator lastCurrentEntry = theCurrentEntry.end();
874  unsigned allEntries = 0;
875  for (; aCurrentEntry != lastCurrentEntry; ++aCurrentEntry) {
876  unsigned size = aCurrentEntry->size();
877  for (unsigned iene = 0; iene < size; ++iene)
878  (*aCurrentEntry)[iene] = theCurrentEntries[allEntries++];
879  }
880 
881  // Read the current interactions
882  std::vector<std::vector<unsigned> >::iterator aCurrentInteraction = theCurrentInteraction.begin();
883  std::vector<std::vector<unsigned> >::iterator lastCurrentInteraction = theCurrentInteraction.end();
884  unsigned allInteractions = 0;
885  for (; aCurrentInteraction != lastCurrentInteraction; ++aCurrentInteraction) {
886  unsigned size = aCurrentInteraction->size();
887  for (unsigned iene = 0; iene < size; ++iene)
888  (*aCurrentInteraction)[iene] = theCurrentInteractions[allInteractions++];
889  }
890 
891  return true;
892  }
893 
894  return false;
895 }
size
Write out results.
std::vector< std::vector< unsigned > > theCurrentInteraction
Necessary to read the FullSim interactions.
results
Definition: mysort.py:8
std::string inputFile
Directory/Name of input file in case you want to read interactions from file.
std::vector< std::vector< unsigned > > theCurrentEntry
Necessary to read the FullSim interactions.

◆ save()

void fastsim::NuclearInteraction::save ( )
private

Save the nuclear interactions to a file, so you can reproduce the events (e.g. in case of a crash).

Definition at line 795 of file NuclearInteraction.cc.

795  {
796  // Size of buffer
797  ++myOutputBuffer;
798 
799  // Periodically close the current file and open a new one
800  if (myOutputBuffer / 1000 * 1000 == myOutputBuffer) {
801  myOutputFile.close();
802  myOutputFile.open("NuclearInteractionOutputFile.txt");
803  }
804  //
805  unsigned size1 = theCurrentEntry.size() * theCurrentEntry.begin()->size();
806  std::vector<unsigned> theCurrentEntries;
807  theCurrentEntries.resize(size1);
808  size1 *= sizeof(unsigned);
809  //
810  unsigned size2 = theCurrentInteraction.size() * theCurrentInteraction.begin()->size();
811  std::vector<unsigned> theCurrentInteractions;
812  theCurrentInteractions.resize(size2);
813  size2 *= sizeof(unsigned);
814 
815  // Save the current entries
816  std::vector<std::vector<unsigned> >::const_iterator aCurrentEntry = theCurrentEntry.begin();
817  std::vector<std::vector<unsigned> >::const_iterator lastCurrentEntry = theCurrentEntry.end();
818  unsigned allEntries = 0;
819  for (; aCurrentEntry != lastCurrentEntry; ++aCurrentEntry) {
820  unsigned size = aCurrentEntry->size();
821  for (unsigned iene = 0; iene < size; ++iene)
822  theCurrentEntries[allEntries++] = (*aCurrentEntry)[iene];
823  }
824 
825  // Save the current interactions
826  std::vector<std::vector<unsigned> >::const_iterator aCurrentInteraction = theCurrentInteraction.begin();
827  std::vector<std::vector<unsigned> >::const_iterator lastCurrentInteraction = theCurrentInteraction.end();
828  unsigned allInteractions = 0;
829  for (; aCurrentInteraction != lastCurrentInteraction; ++aCurrentInteraction) {
830  unsigned size = aCurrentInteraction->size();
831  for (unsigned iene = 0; iene < size; ++iene)
832  theCurrentInteractions[allInteractions++] = (*aCurrentInteraction)[iene];
833  }
834  // Write to file
835  myOutputFile.write((const char*)(&theCurrentEntries.front()), size1);
836  myOutputFile.write((const char*)(&theCurrentInteractions.front()), size2);
837  myOutputFile.flush();
838 }
size
Write out results.
std::vector< std::vector< unsigned > > theCurrentInteraction
Necessary to read the FullSim interactions.
std::ofstream myOutputFile
Output file to save interactions.
std::vector< std::vector< unsigned > > theCurrentEntry
Necessary to read the FullSim interactions.
unsigned myOutputBuffer
Needed to save interactions to file.

Member Data Documentation

◆ antineutronsID

const std::vector<int> fastsim::NuclearInteraction::antineutronsID = {-2112, -3122, -3112, -3312, -3322}
private

PdgID of anti-neutrons.

Definition at line 333 of file NuclearInteraction.cc.

Referenced by NuclearInteraction().

◆ antiprotonsID

const std::vector<int> fastsim::NuclearInteraction::antiprotonsID = {-2212, -3222}
private

PdgID of anti-protons.

Definition at line 331 of file NuclearInteraction.cc.

Referenced by NuclearInteraction().

◆ currentValuesWereSet

bool fastsim::NuclearInteraction::currentValuesWereSet
private

Read data from file that was created in a previous run.

Definition at line 115 of file NuclearInteraction.cc.

Referenced by NuclearInteraction().

◆ ien4

unsigned fastsim::NuclearInteraction::ien4
private

Find the index for which EN = 4.

Definition at line 110 of file NuclearInteraction.cc.

Referenced by NuclearInteraction().

◆ inputFile

std::string fastsim::NuclearInteraction::inputFile
private

Directory/Name of input file in case you want to read interactions from file.

Definition at line 93 of file NuclearInteraction.cc.

Referenced by NuclearInteraction().

◆ K0LsID

const std::vector<int> fastsim::NuclearInteraction::K0LsID = {130, 310}
private

PdgID of K0.

Definition at line 334 of file NuclearInteraction.cc.

Referenced by NuclearInteraction().

◆ KminussesID

const std::vector<int> fastsim::NuclearInteraction::KminussesID = {-321}
private

PdgID of K-.

Definition at line 336 of file NuclearInteraction.cc.

Referenced by NuclearInteraction().

◆ KplussesID

const std::vector<int> fastsim::NuclearInteraction::KplussesID = {321}
private

PdgID of K+.

Definition at line 335 of file NuclearInteraction.cc.

Referenced by NuclearInteraction().

◆ myOutputBuffer

unsigned fastsim::NuclearInteraction::myOutputBuffer
private

Needed to save interactions to file.

Definition at line 113 of file NuclearInteraction.cc.

Referenced by NuclearInteraction().

◆ myOutputFile

std::ofstream fastsim::NuclearInteraction::myOutputFile
private

Output file to save interactions.

Definition at line 112 of file NuclearInteraction.cc.

Referenced by NuclearInteraction().

◆ neutronsID

const std::vector<int> fastsim::NuclearInteraction::neutronsID = {2112, 3122, 3112, 3312, 3322, 3334, -3334}
private

PdgID of neutrons.

Definition at line 332 of file NuclearInteraction.cc.

Referenced by NuclearInteraction().

◆ PiminussesID

const std::vector<int> fastsim::NuclearInteraction::PiminussesID = {-211}
private

PdgID of pi-.

Definition at line 338 of file NuclearInteraction.cc.

Referenced by NuclearInteraction().

◆ PiplussesID

const std::vector<int> fastsim::NuclearInteraction::PiplussesID = {211}
private

PdgID of pt+.

Definition at line 337 of file NuclearInteraction.cc.

Referenced by NuclearInteraction().

◆ protonsID

const std::vector<int> fastsim::NuclearInteraction::protonsID = {2212, 3222, -101, -102, -103, -104}
private

PdgID of protons.

Definition at line 330 of file NuclearInteraction.cc.

Referenced by NuclearInteraction().

◆ theBranches

std::vector<std::vector<TBranch*> > fastsim::NuclearInteraction::theBranches
private

Necessary to read the FullSim interactions.

Definition at line 101 of file NuclearInteraction.cc.

Referenced by NuclearInteraction().

◆ theCurrentEntry

std::vector<std::vector<unsigned> > fastsim::NuclearInteraction::theCurrentEntry
private

Necessary to read the FullSim interactions.

Definition at line 103 of file NuclearInteraction.cc.

Referenced by NuclearInteraction().

◆ theCurrentInteraction

std::vector<std::vector<unsigned> > fastsim::NuclearInteraction::theCurrentInteraction
private

Necessary to read the FullSim interactions.

Definition at line 104 of file NuclearInteraction.cc.

Referenced by NuclearInteraction().

◆ theDistCut

double fastsim::NuclearInteraction::theDistCut
private

Cut on deltaR for the FastSim Tracking (ClosestChargedDaughter algorithm)

Definition at line 91 of file NuclearInteraction.cc.

Referenced by NuclearInteraction().

◆ theFile

TFile* fastsim::NuclearInteraction::theFile = nullptr
private

Necessary to read the FullSim interactions.

Definition at line 99 of file NuclearInteraction.cc.

Referenced by NuclearInteraction().

◆ theFileNames

std::vector<std::vector<std::string> > fastsim::NuclearInteraction::theFileNames
private

Necessary to read the FullSim interactions.

Definition at line 107 of file NuclearInteraction.cc.

Referenced by NuclearInteraction().

◆ theHadronCM

std::vector<std::vector<double> > fastsim::NuclearInteraction::theHadronCM
private

Necessary to read the FullSim interactions.

Definition at line 108 of file NuclearInteraction.cc.

Referenced by NuclearInteraction().

◆ theHadronEN

const std::vector<double> fastsim::NuclearInteraction::theHadronEN
private
Initial value:
= {
1.0, 2.0, 3.0, 4.0, 5.0, 7.0, 9.0, 12.0, 15.0, 20.0, 30.0, 50.0, 100.0, 200.0, 300.0, 500.0, 700.0, 1000.0}

Filled into 'theRatiosMap' (evolution of the interaction lengths with energy)

Definition at line 127 of file NuclearInteraction.cc.

Referenced by NuclearInteraction().

◆ theHadronEnergy

double fastsim::NuclearInteraction::theHadronEnergy
private

Minimum energy for nuclear interaction.

Definition at line 92 of file NuclearInteraction.cc.

Referenced by NuclearInteraction().

◆ theHadronID

const std::vector<int> fastsim::NuclearInteraction::theHadronID = {211, -211, 130, 321, -321, 2212, -2212, 2112, -2112}
private

ID of the hadrons.

Definition at line 133 of file NuclearInteraction.cc.

Referenced by NuclearInteraction().

◆ theHadronMA

const std::vector<double> fastsim::NuclearInteraction::theHadronMA
private
Initial value:
= {
0.13957, 0.13957, 0.497648, 0.493677, 0.493677, 0.93827, 0.93827, 0.939565, 0.939565}

Masses of the hadrons.

Definition at line 138 of file NuclearInteraction.cc.

Referenced by NuclearInteraction().

◆ theHadronNA

const std::vector<std::string> fastsim::NuclearInteraction::theHadronNA
private
Initial value:
= {
"piplus", "piminus", "K0L", "Kplus", "Kminus", "p", "pbar", "n", "nbar"}

Names of the hadrons.

Definition at line 135 of file NuclearInteraction.cc.

Referenced by NuclearInteraction().

◆ theHadronPMin

const std::vector<double> fastsim::NuclearInteraction::theHadronPMin = {0.7, 0.0, 1.0, 1.0, 0.0, 1.1, 0.0, 1.1, 0.0}
private

Smallest momentum for inelastic interactions.

Definition at line 141 of file NuclearInteraction.cc.

◆ theIDMap

std::map< int, int > fastsim::NuclearInteraction::theIDMap
staticprivate

Build the ID map (i.e., what is to be considered as a proton, etc...)

Definition at line 124 of file NuclearInteraction.cc.

Referenced by NuclearInteraction().

◆ theLengthRatio

const std::vector<double> fastsim::NuclearInteraction::theLengthRatio
private
Initial value:
= {
0.2257,
0.2294,
0.3042,
0.2591,
0.2854,
0.3101,
0.5216,
0.3668,
0.4898}

Inelastic interaction length at p(Hadron) = 5 GeV/c (relativ to radionLength of material)

Definition at line 143 of file NuclearInteraction.cc.

◆ theNUEvents

std::vector<std::vector<NUEvent*> > fastsim::NuclearInteraction::theNUEvents
private

Necessary to read the FullSim interactions.

Definition at line 102 of file NuclearInteraction.cc.

Referenced by NuclearInteraction().

◆ theNumberOfEntries

std::vector<std::vector<unsigned> > fastsim::NuclearInteraction::theNumberOfEntries
private

Necessary to read the FullSim interactions.

Definition at line 105 of file NuclearInteraction.cc.

Referenced by NuclearInteraction().

◆ theNumberOfInteractions

std::vector<std::vector<unsigned> > fastsim::NuclearInteraction::theNumberOfInteractions
private

Necessary to read the FullSim interactions.

Definition at line 106 of file NuclearInteraction.cc.

Referenced by NuclearInteraction().

◆ theRatios

const std::vector<double> fastsim::NuclearInteraction::theRatios
private

Filled into 'theRatiosMap' (evolution of the interaction lengths with energy)

Definition at line 154 of file NuclearInteraction.cc.

Referenced by NuclearInteraction().

◆ theRatiosMap

std::vector< std::vector< double > > fastsim::NuclearInteraction::theRatiosMap
staticprivate

The evolution of the interaction lengths with energy.

Definition at line 122 of file NuclearInteraction.cc.

Referenced by NuclearInteraction().

◆ theTrees

std::vector<std::vector<TTree*> > fastsim::NuclearInteraction::theTrees
private

Necessary to read the FullSim interactions.

Definition at line 100 of file NuclearInteraction.cc.

Referenced by NuclearInteraction().