27 : PairProduction(nullptr),
28 Bremsstrahlung(nullptr),
29 MuonBremsstrahlung(nullptr),
30 MultipleScattering(nullptr),
32 NuclearInteraction(nullptr),
39 bool doPairProduction = matEff.
getParameter<
bool>(
"PairProduction");
40 bool doBremsstrahlung = matEff.
getParameter<
bool>(
"Bremsstrahlung");
41 bool doEnergyLoss = matEff.
getParameter<
bool>(
"EnergyLoss");
42 bool doMultipleScattering = matEff.
getParameter<
bool>(
"MultipleScattering");
43 bool doNuclearInteraction = matEff.
getParameter<
bool>(
"NuclearInteraction");
44 bool doG4NuclInteraction = matEff.
getParameter<
bool>(
"G4NuclearInteraction");
45 bool doMuonBremsstrahlung = matEff.
getParameter<
bool>(
"MuonBremsstrahlung");
50 double radLen = matEff.
getParameter<
double>(
"RadiationLength");
54 if (doPairProduction) {
55 double photonEnergy = matEff.
getParameter<
double>(
"photonEnergy");
59 if (doBremsstrahlung) {
60 double bremEnergy = matEff.
getParameter<
double>(
"bremEnergy");
61 double bremEnergyFraction = matEff.
getParameter<
double>(
"bremEnergyFraction");
65 if (doMuonBremsstrahlung) {
66 double bremEnergy = matEff.
getParameter<
double>(
"bremEnergy");
67 double bremEnergyFraction = matEff.
getParameter<
double>(
"bremEnergyFraction");
78 if (doMultipleScattering) {
82 if (doNuclearInteraction) {
84 std::vector<double> hadronEnergies = matEff.
getUntrackedParameter<std::vector<double> >(
"hadronEnergies");
90 std::vector<std::string> hadronNames = matEff.
getUntrackedParameter<std::vector<std::string> >(
"hadronNames");
93 std::vector<double> hadronMasses = matEff.
getUntrackedParameter<std::vector<double> >(
"hadronMasses");
99 std::vector<double> lengthRatio = matEff.
getParameter<std::vector<double> >(
"lengthRatio");
116 std::vector<std::vector<double> >
ratios;
117 ratios.resize(hadronTypes.size());
118 for (
unsigned i = 0;
i < hadronTypes.size(); ++
i) {
119 for (
unsigned j = 0;
j < hadronEnergies.size(); ++
j) {
120 ratios[
i].push_back(theRatios[
i * hadronEnergies.size() +
j]);
125 double pionEnergy = matEff.
getParameter<
double>(
"pionEnergy");
129 unsigned distAlgo = matEff.
getParameter<
unsigned>(
"distAlgo");
137 std::map<int, int> idMap;
140 for (
unsigned i = 0;
i < idProtons.size(); ++
i)
141 idMap[idProtons[
i]] = 2212;
144 for (
unsigned i = 0;
i < idAntiProtons.size(); ++
i)
145 idMap[idAntiProtons[
i]] = -2212;
148 for (
unsigned i = 0;
i < idNeutrons.size(); ++
i)
149 idMap[idNeutrons[
i]] = 2112;
152 for (
unsigned i = 0;
i < idAntiNeutrons.size(); ++
i)
153 idMap[idAntiNeutrons[
i]] = -2112;
156 for (
unsigned i = 0;
i < idK0Ls.size(); ++
i)
157 idMap[idK0Ls[
i]] = 130;
160 for (
unsigned i = 0;
i < idKplusses.size(); ++
i)
161 idMap[idKplusses[
i]] = 321;
164 for (
unsigned i = 0;
i < idKminusses.size(); ++
i)
165 idMap[idKminusses[
i]] = -321;
168 for (
unsigned i = 0;
i < idPiplusses.size(); ++
i)
169 idMap[idPiplusses[
i]] = 211;
172 for (
unsigned i = 0;
i < idPiminusses.size(); ++
i)
173 idMap[idPiminusses[
i]] = -211;
176 if (doG4NuclInteraction) {
251 <<
" WARNING: A non valid vertex was found in photon conv. -> " << ivertex << std::endl;
286 int daughId = mySimEvent.
addSimTrack(&(*DaughterIter), ivertex);
299 <<
" WARNING: A non valid vertex was found in nucl. int. -> " << ivertex << std::endl;
330 <<
" WARNING: A non valid vertex was found in brem -> " << ivertex << std::endl;
355 <<
" WARNING: A non valid vertex was found in muon brem -> " << ivertex << std::endl;
394 double zed = fabs(myTrack.
particle().
Z());
402 for (
unsigned int iLayer = 0; iLayer < layer.
fudgeNumber(); ++iLayer) {
413 return radlen * factor;
417 return layer.
forward() ? layer.
disk()->normalVector()
int addSimVertex(const XYZTLorentzVector &decayVertex, int im=-1, FSimVertexType::VertexType type=FSimVertexType::ANY)
Add a new vertex to the Event and to the various lists.
T getUntrackedParameter(std::string const &, T const &) const
RHEP_const_iter beginDaughters() const
Returns const iterator to the beginning of the daughters list.
unsigned nDaughters() const
Returns the number of daughters.
unsigned int layerNumber() const
Returns the layer number.
bool forward() const
Is the layer forward ?
double fudgeFactor(unsigned iFudge) const
int closestDaughterId()
The id of the closest charged daughter (filled for nuclear interactions only)
void setNormalVector(const GlobalVector &normal)
Sets the vector normal to the surface traversed.
~MaterialEffects()
Default destructor.
PairProductionSimulator * PairProduction
int addSimTrack(const RawParticle *p, int iv, int ig=-1, const HepMC::GenVertex *ev=nullptr)
Add a new track to the Event and to the various lists.
GlobalVector normalVector(const TrackerLayer &layer, ParticlePropagator &myTrack) const
The vector normal to the surface traversed.
void setClosestDaughterId(int id)
Set the index of the closest charged daughter.
void updateState(ParticlePropagator &myTrack, double radlen, RandomEngineAndDistribution const *)
Compute the material effect (calls the sub class)
int pid() const
get the HEP particle ID number
RawParticle const & particle() const
The particle being propagated.
MaterialEffectsSimulator * NuclearInteraction
MuonBremsstrahlungSimulator * MuonBremsstrahlung
constexpr std::array< uint8_t, layerIndexSize > layer
double R() const
vertex radius
double fudgeMax(unsigned iFudge) const
std::vector< RawParticle >::const_iterator RHEP_const_iter
const math::XYZTLorentzVector & position() const
Temporary (until CMSSW moves to Mathcore) - No ! Actually very useful.
double Y() const
y of vertex
double Py() const
y of the momentum
double Pt() const
transverse momentum
double Z() const
z of vertex
BoundDisk const * disk() const
Returns the surface.
Abs< T >::type abs(const T &t)
RHEP_const_iter endDaughters() const
Returns const iterator to the end of the daughters list.
void save()
Save nuclear interaction information.
double Pz() const
z of the momentum
double charge() const
get the MEASURED charge
unsigned int fudgeNumber() const
Set a fudge factor for material inhomogeneities in this layer.
const BoundSurface & surface() const
Returns the surface.
const XYZTLorentzVector & vertex() const
the vertex fourvector
void interact(FSimEvent &simEvent, const TrackerLayer &layer, ParticlePropagator &PP, unsigned i, RandomEngineAndDistribution const *)
double radLengths(const TrackerLayer &layer, ParticlePropagator &myTrack)
The number of radiation lengths traversed.
T getParameter(std::string const &) const
std::pair< OmniClusterRef, TrackingParticleRef > P
double X() const
x of vertex
BremsstrahlungSimulator * Bremsstrahlung
double Px() const
x of the momentum
double E() const
energy of the momentum
GlobalVector theNormalVector
double fudgeMin(unsigned iFudge) const
const FSimVertex vertex() const
Origin vertex.
EnergyLossSimulator * EnergyLoss
Log< level::Warning, false > LogWarning
const MediumProperties & mediumProperties() const
virtual void save()
Used by NuclearInteractionSimulator to save last sampled event.
MultipleScatteringSimulator * MultipleScattering
Global3DVector GlobalVector
MaterialEffects(const edm::ParameterSet &matEff)
Constructor.
FSimTrack & track(int id) const
Return track with given Id.