File indexing completed on 2024-04-06 12:11:16
0001 #ifndef FastSimulation_MaterialEffects_NuclearInteractionSimulator_H
0002 #define FastSimulation_MaterialEffects_NuclearInteractionSimulator_H
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016 #include "FastSimulation/MaterialEffects/interface/MaterialEffectsSimulator.h"
0017 #include "DQMServices/Core/interface/DQMStore.h"
0018
0019 #include <vector>
0020 #include <map>
0021 #include <string>
0022 #include <fstream>
0023
0024 class TFile;
0025 class TTree;
0026 class TBranch;
0027 class NUEvent;
0028
0029 class ParticlePropagator;
0030 class RandomEngineAndDistribution;
0031
0032
0033 class NuclearInteractionSimulator : public MaterialEffectsSimulator {
0034 public:
0035
0036 NuclearInteractionSimulator(std::vector<double>& hadronEnergies,
0037 std::vector<int>& hadronTypes,
0038 std::vector<std::string>& hadronNames,
0039 std::vector<double>& hadronMasses,
0040 std::vector<double>& hadronPMin,
0041 double pionEnergy,
0042 std::vector<double>& lengthRatio,
0043 std::vector<std::vector<double> >& ratios,
0044 std::map<int, int>& idMap,
0045 std::string inputFile,
0046 unsigned int distAlgo,
0047 double distCut);
0048
0049
0050 ~NuclearInteractionSimulator() override;
0051
0052
0053 void save() override;
0054
0055
0056 bool read(std::string inputFile);
0057
0058 private:
0059
0060 void compute(ParticlePropagator& Particle, RandomEngineAndDistribution const*) override;
0061
0062
0063 double distanceToPrimary(const RawParticle& Particle, const RawParticle& aDaughter) const;
0064
0065
0066 unsigned index(int thePid);
0067
0068 std::vector<double> thePionEN;
0069 std::vector<int> thePionID;
0070 std::vector<std::string> thePionNA;
0071 std::vector<double> thePionMA;
0072 std::vector<double> thePionPMin;
0073 double thePionEnergy;
0074 std::vector<double> theLengthRatio;
0075 std::vector<std::vector<double> > theRatios;
0076
0077 TFile* theFile;
0078 std::vector<std::vector<TTree*> > theTrees;
0079 std::vector<std::vector<TBranch*> > theBranches;
0080 std::vector<std::vector<NUEvent*> > theNUEvents;
0081 std::vector<std::vector<unsigned> > theCurrentEntry;
0082 std::vector<std::vector<unsigned> > theCurrentInteraction;
0083 std::vector<std::vector<unsigned> > theNumberOfEntries;
0084 std::vector<std::vector<unsigned> > theNumberOfInteractions;
0085 std::vector<std::vector<std::string> > theFileNames;
0086 std::vector<std::vector<double> > thePionCM;
0087
0088 std::map<int, int> theIDMap;
0089 unsigned ien4;
0090 unsigned theDistAlgo;
0091 double theDistCut;
0092
0093 std::ofstream myOutputFile;
0094 unsigned myOutputBuffer;
0095
0096 bool currentValuesWereSet;
0097
0098
0099
0100
0101
0102
0103
0104
0105
0106
0107 };
0108 #endif