Implementation of nuclear interactions of hadrons in the tracker layers (based on fully simulated interactions). More...
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... | |
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... | |
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.
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, triggerObjects_cff::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, and theTrees.
|
override |
Default destructor.
Definition at line 496 of file NuclearInteraction.cc.
References cuy::save, and interactiveExample::theFile.
|
private |
Return a hashed index for a given particle ID.
Definition at line 899 of file NuclearInteraction.cc.
Referenced by BeautifulSoup.PageElement::insert().
|
overridevirtual |
Perform the interaction.
particle | The particle that interacts with the matter. |
layer | The detector layer that interacts with the particle. |
secondaries | Particles that are produced in the interaction (if any). |
random | The Random Engine. |
Implements fastsim::InteractionModel.
Definition at line 515 of file NuclearInteraction.cc.
References funct::abs(), fastsim::Particle::charge(), HCALHighEnergyHPDFilter_cfi::energy, JetChargeProducer_cfi::exp, NUEvent::NUInteraction::first, RandomEngineAndDistribution::flatShoot(), NUEvent::NUParticle::id, NUEvent::NUInteraction::last, phase1PixelTopology::layer, dqm-mbProfile::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(), theta(), and HLT_FULL_cff::zAxis.
|
private |
Read the nuclear interactions from a file, so you can reproduce the events (e.g. in case of a crash).
Definition at line 842 of file NuclearInteraction.cc.
References dtResolutionTest_cfi::inputFile, bookConverter::results, findQualityFiles::size, and edm_modernize_messagelogger::stat.
Referenced by edmIntegrityCheck.PublishToFileSystem::get(), and NuclearInteraction().
|
private |
Save the nuclear interactions to a file, so you can reproduce the events (e.g. in case of a crash).
Definition at line 797 of file NuclearInteraction.cc.
References findQualityFiles::size.
|
private |
PdgID of anti-neutrons.
Definition at line 333 of file NuclearInteraction.cc.
Referenced by NuclearInteraction().
|
private |
PdgID of anti-protons.
Definition at line 331 of file NuclearInteraction.cc.
Referenced by NuclearInteraction().
|
private |
Read data from file that was created in a previous run.
Definition at line 115 of file NuclearInteraction.cc.
Referenced by NuclearInteraction().
|
private |
Find the index for which EN = 4.
Definition at line 110 of file NuclearInteraction.cc.
Referenced by NuclearInteraction().
|
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().
|
private |
PdgID of K0.
Definition at line 334 of file NuclearInteraction.cc.
Referenced by NuclearInteraction().
|
private |
PdgID of K-.
Definition at line 336 of file NuclearInteraction.cc.
Referenced by NuclearInteraction().
|
private |
PdgID of K+.
Definition at line 335 of file NuclearInteraction.cc.
Referenced by NuclearInteraction().
|
private |
Needed to save interactions to file.
Definition at line 113 of file NuclearInteraction.cc.
Referenced by NuclearInteraction().
|
private |
Output file to save interactions.
Definition at line 112 of file NuclearInteraction.cc.
Referenced by NuclearInteraction().
|
private |
PdgID of neutrons.
Definition at line 332 of file NuclearInteraction.cc.
Referenced by NuclearInteraction().
|
private |
PdgID of pi-.
Definition at line 338 of file NuclearInteraction.cc.
Referenced by NuclearInteraction().
|
private |
PdgID of pt+.
Definition at line 337 of file NuclearInteraction.cc.
Referenced by NuclearInteraction().
|
private |
PdgID of protons.
Definition at line 330 of file NuclearInteraction.cc.
Referenced by NuclearInteraction().
|
private |
Necessary to read the FullSim interactions.
Definition at line 101 of file NuclearInteraction.cc.
Referenced by NuclearInteraction().
|
private |
Necessary to read the FullSim interactions.
Definition at line 103 of file NuclearInteraction.cc.
Referenced by NuclearInteraction().
|
private |
Necessary to read the FullSim interactions.
Definition at line 104 of file NuclearInteraction.cc.
Referenced by NuclearInteraction().
|
private |
Cut on deltaR for the FastSim Tracking (ClosestChargedDaughter algorithm)
Definition at line 91 of file NuclearInteraction.cc.
Referenced by NuclearInteraction().
|
private |
Necessary to read the FullSim interactions.
Definition at line 99 of file NuclearInteraction.cc.
Referenced by NuclearInteraction().
|
private |
Necessary to read the FullSim interactions.
Definition at line 107 of file NuclearInteraction.cc.
Referenced by NuclearInteraction().
|
private |
Necessary to read the FullSim interactions.
Definition at line 108 of file NuclearInteraction.cc.
Referenced by NuclearInteraction().
|
private |
Filled into 'theRatiosMap' (evolution of the interaction lengths with energy)
Definition at line 127 of file NuclearInteraction.cc.
Referenced by NuclearInteraction().
|
private |
Minimum energy for nuclear interaction.
Definition at line 92 of file NuclearInteraction.cc.
Referenced by NuclearInteraction().
|
private |
ID of the hadrons.
Definition at line 133 of file NuclearInteraction.cc.
Referenced by NuclearInteraction().
|
private |
Masses of the hadrons.
Definition at line 138 of file NuclearInteraction.cc.
Referenced by NuclearInteraction().
|
private |
Names of the hadrons.
Definition at line 135 of file NuclearInteraction.cc.
Referenced by NuclearInteraction().
|
private |
Smallest momentum for inelastic interactions.
Definition at line 141 of file NuclearInteraction.cc.
|
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().
|
private |
Inelastic interaction length at p(Hadron) = 5 GeV/c (relativ to radionLength of material)
Definition at line 143 of file NuclearInteraction.cc.
|
private |
Necessary to read the FullSim interactions.
Definition at line 102 of file NuclearInteraction.cc.
Referenced by NuclearInteraction().
|
private |
Necessary to read the FullSim interactions.
Definition at line 105 of file NuclearInteraction.cc.
Referenced by NuclearInteraction().
|
private |
Necessary to read the FullSim interactions.
Definition at line 106 of file NuclearInteraction.cc.
Referenced by NuclearInteraction().
|
private |
Filled into 'theRatiosMap' (evolution of the interaction lengths with energy)
Definition at line 154 of file NuclearInteraction.cc.
Referenced by NuclearInteraction().
|
staticprivate |
The evolution of the interaction lengths with energy.
Definition at line 122 of file NuclearInteraction.cc.
Referenced by NuclearInteraction().
|
private |
Necessary to read the FullSim interactions.
Definition at line 100 of file NuclearInteraction.cc.
Referenced by NuclearInteraction().