CMS 3D CMS Logo

NuclearInteractionSimulator.h
Go to the documentation of this file.
1 #ifndef FastSimulation_MaterialEffects_NuclearInteractionSimulator_H
2 #define FastSimulation_MaterialEffects_NuclearInteractionSimulator_H
3 
18 
19 #include <vector>
20 #include <map>
21 #include <string>
22 #include <fstream>
23 
24 class TFile;
25 class TTree;
26 class TBranch;
27 class NUEvent;
28 
29 class ParticlePropagator;
31 //class DaqMonitorBEInterface;
32 
34 public:
36  NuclearInteractionSimulator(std::vector<double>& hadronEnergies,
37  std::vector<int>& hadronTypes,
38  std::vector<std::string>& hadronNames,
39  std::vector<double>& hadronMasses,
40  std::vector<double>& hadronPMin,
41  double pionEnergy,
42  std::vector<double>& lengthRatio,
43  std::vector<std::vector<double> >& ratios,
44  std::map<int, int>& idMap,
46  unsigned int distAlgo,
47  double distCut);
48 
51 
53  void save() override;
54 
57 
58 private:
61 
63  double distanceToPrimary(const RawParticle& Particle, const RawParticle& aDaughter) const;
64 
66  unsigned index(int thePid);
67 
68  std::vector<double> thePionEN;
69  std::vector<int> thePionID;
70  std::vector<std::string> thePionNA;
71  std::vector<double> thePionMA;
72  std::vector<double> thePionPMin;
73  double thePionEnergy;
74  std::vector<double> theLengthRatio;
75  std::vector<std::vector<double> > theRatios;
76 
77  TFile* theFile;
78  std::vector<std::vector<TTree*> > theTrees;
79  std::vector<std::vector<TBranch*> > theBranches;
80  std::vector<std::vector<NUEvent*> > theNUEvents;
81  std::vector<std::vector<unsigned> > theCurrentEntry;
82  std::vector<std::vector<unsigned> > theCurrentInteraction;
83  std::vector<std::vector<unsigned> > theNumberOfEntries;
84  std::vector<std::vector<unsigned> > theNumberOfInteractions;
85  std::vector<std::vector<std::string> > theFileNames;
86  std::vector<std::vector<double> > thePionCM;
87 
88  std::map<int, int> theIDMap;
89  unsigned ien4;
90  unsigned theDistAlgo;
91  double theDistCut;
92 
93  std::ofstream myOutputFile;
94  unsigned myOutputBuffer;
95 
97 
98  // DaqMonitorBEInterface * dbe;
99  // MonitorElement* hAfter;
100  // MonitorElement* hAfter2;
101  // MonitorElement* hAfter3;
102  // MonitorElement* htot;
103  // MonitorElement* helas;
104  // MonitorElement* hinel;
105  // MonitorElement* hscatter;
106  // MonitorElement* hscatter2;
107 };
108 #endif
NuclearInteractionSimulator::theDistAlgo
unsigned theDistAlgo
Definition: NuclearInteractionSimulator.h:90
NuclearInteractionSimulator::theNumberOfEntries
std::vector< std::vector< unsigned > > theNumberOfEntries
Definition: NuclearInteractionSimulator.h:83
RawParticle
Definition: RawParticle.h:37
MaterialEffectsSimulator.h
NuclearInteractionSimulator::index
unsigned index(int thePid)
Return a hashed index for a given pid.
Definition: NuclearInteractionSimulator.cc:631
NuclearInteractionSimulator::myOutputBuffer
unsigned myOutputBuffer
Definition: NuclearInteractionSimulator.h:94
NuclearInteractionSimulator
Definition: NuclearInteractionSimulator.h:33
NuclearInteractionSimulator::thePionEnergy
double thePionEnergy
Definition: NuclearInteractionSimulator.h:73
NuclearInteractionSimulator::theIDMap
std::map< int, int > theIDMap
Definition: NuclearInteractionSimulator.h:88
NuclearInteractionSimulator::thePionEN
std::vector< double > thePionEN
Definition: NuclearInteractionSimulator.h:68
NuclearInteractionSimulator::theFile
TFile * theFile
Definition: NuclearInteractionSimulator.h:77
DQMStore.h
NuclearInteractionSimulator::compute
void compute(ParticlePropagator &Particle, RandomEngineAndDistribution const *) override
Generate a nuclear interaction according to the probability that it happens.
Definition: NuclearInteractionSimulator.cc:189
NuclearInteractionSimulator::thePionPMin
std::vector< double > thePionPMin
Definition: NuclearInteractionSimulator.h:72
NuclearInteractionSimulator::theCurrentInteraction
std::vector< std::vector< unsigned > > theCurrentInteraction
Definition: NuclearInteractionSimulator.h:82
NuclearInteractionSimulator::thePionNA
std::vector< std::string > thePionNA
Definition: NuclearInteractionSimulator.h:70
NuclearInteractionSimulator::read
bool read(std::string inputFile)
Read former nuclear interaction (from previous run)
Definition: NuclearInteractionSimulator.cc:574
NuclearInteractionSimulator::theNUEvents
std::vector< std::vector< NUEvent * > > theNUEvents
Definition: NuclearInteractionSimulator.h:80
NuclearInteractionSimulator::myOutputFile
std::ofstream myOutputFile
Definition: NuclearInteractionSimulator.h:93
NuclearInteractionSimulator::thePionCM
std::vector< std::vector< double > > thePionCM
Definition: NuclearInteractionSimulator.h:86
NuclearInteractionSimulator::save
void save() override
Save current nuclear interaction (for later use)
Definition: NuclearInteractionSimulator.cc:528
NuclearInteractionSimulator::theDistCut
double theDistCut
Definition: NuclearInteractionSimulator.h:91
MaterialEffects_cfi.hadronEnergies
hadronEnergies
Definition: MaterialEffects_cfi.py:46
bJpsiMuMuTrigSettings_cff.hadronPMin
hadronPMin
Definition: bJpsiMuMuTrigSettings_cff.py:12
MaterialEffectsSimulator
Definition: MaterialEffectsSimulator.h:25
MaterialEffects_cfi.hadronMasses
hadronMasses
Definition: MaterialEffects_cfi.py:59
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
NuclearInteractionSimulator::theNumberOfInteractions
std::vector< std::vector< unsigned > > theNumberOfInteractions
Definition: NuclearInteractionSimulator.h:84
NuclearInteractionSimulator::theRatios
std::vector< std::vector< double > > theRatios
Definition: NuclearInteractionSimulator.h:75
NuclearInteractionSimulator::theBranches
std::vector< std::vector< TBranch * > > theBranches
Definition: NuclearInteractionSimulator.h:79
NuclearInteractionSimulator::NuclearInteractionSimulator
NuclearInteractionSimulator(std::vector< double > &hadronEnergies, std::vector< int > &hadronTypes, std::vector< std::string > &hadronNames, std::vector< double > &hadronMasses, std::vector< double > &hadronPMin, double pionEnergy, std::vector< double > &lengthRatio, std::vector< std::vector< double > > &ratios, std::map< int, int > &idMap, std::string inputFile, unsigned int distAlgo, double distCut)
Constructor.
Definition: NuclearInteractionSimulator.cc:25
MaterialEffects_cfi.ratios
ratios
Definition: MaterialEffects_cfi.py:70
NuclearInteractionSimulator::ien4
unsigned ien4
Definition: NuclearInteractionSimulator.h:89
ParticlePropagator
Definition: ParticlePropagator.h:28
dtResolutionTest_cfi.inputFile
inputFile
Definition: dtResolutionTest_cfi.py:14
MaterialEffects_cfi.pionEnergy
pionEnergy
Definition: MaterialEffects_cfi.py:121
NuclearInteractionSimulator::theTrees
std::vector< std::vector< TTree * > > theTrees
Definition: NuclearInteractionSimulator.h:78
NuclearInteractionSimulator::theCurrentEntry
std::vector< std::vector< unsigned > > theCurrentEntry
Definition: NuclearInteractionSimulator.h:81
MaterialEffects_cfi.hadronTypes
hadronTypes
Definition: MaterialEffects_cfi.py:51
MaterialEffects_cfi.hadronNames
hadronNames
Definition: MaterialEffects_cfi.py:55
NuclearInteractionSimulator::thePionID
std::vector< int > thePionID
Definition: NuclearInteractionSimulator.h:69
NuclearInteractionSimulator::~NuclearInteractionSimulator
~NuclearInteractionSimulator() override
Default Destructor.
Definition: NuclearInteractionSimulator.cc:170
NuclearInteractionSimulator::theLengthRatio
std::vector< double > theLengthRatio
Definition: NuclearInteractionSimulator.h:74
NuclearInteractionSimulator::currentValuesWereSet
bool currentValuesWereSet
Definition: NuclearInteractionSimulator.h:96
NuclearInteractionSimulator::distanceToPrimary
double distanceToPrimary(const RawParticle &Particle, const RawParticle &aDaughter) const
Compute distance between secondary and primary.
Definition: NuclearInteractionSimulator.cc:497
NuclearInteractionSimulator::theFileNames
std::vector< std::vector< std::string > > theFileNames
Definition: NuclearInteractionSimulator.h:85
MaterialEffects_cfi.distCut
distCut
Definition: MaterialEffects_cfi.py:128
Particle
Definition: Particle.py:1
MaterialEffects_cfi.distAlgo
distAlgo
Definition: MaterialEffects_cfi.py:127
NUEvent
Definition: NUEvent.h:6
NuclearInteractionSimulator::thePionMA
std::vector< double > thePionMA
Definition: NuclearInteractionSimulator.h:71
MaterialEffects_cfi.lengthRatio
lengthRatio
Default is 0.020 for algo 1;.
Definition: MaterialEffects_cfi.py:131
RandomEngineAndDistribution
Definition: RandomEngineAndDistribution.h:18