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");
54 if (doPairProduction) {
59 if (doBremsstrahlung) {
65 if (doMuonBremsstrahlung) {
78 if (doMultipleScattering) {
82 if (doNuclearInteraction) {
116 std::vector<std::vector<double> >
ratios;
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) {
177 double elimit = matEff.
getParameter<
double>(
"EkinBertiniGeV") * CLHEP::GeV;
178 double eth = matEff.
getParameter<
double>(
"EkinLimitGeV") * CLHEP::GeV;
251 <<
" WARNING: A non valid vertex was found in photon conv. -> " << ivertex << std::endl;
267 if (
layer.layerNumber() >= 19 &&
layer.layerNumber() <= 27)
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());
399 if (
layer.fudgeNumber())
402 for (
unsigned int iLayer = 0; iLayer <
layer.fudgeNumber(); ++iLayer) {
404 if ((
layer.forward() &&
layer.fudgeMin(iLayer) < rad && rad <
layer.fudgeMax(iLayer)) ||
405 (!
layer.forward() &&
layer.fudgeMin(iLayer) < zed && zed <
layer.fudgeMax(iLayer))) {
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.
FSimTrack & track(int id) const
Return track with given Id.
T getParameter(std::string const &) const
double Pz() const
z of the momentum
RHEP_const_iter endDaughters() const
Returns const iterator to the end of the daughters list.
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.
int pid() const
get the HEP particle ID number
double Z() const
z of vertex
~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.
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)
double E() const
energy of the momentum
const FSimVertex vertex() const
Origin vertex.
MaterialEffectsSimulator * NuclearInteraction
double charge() const
get the MEASURED charge
MuonBremsstrahlungSimulator * MuonBremsstrahlung
T getUntrackedParameter(std::string const &, T const &) const
double Pt() const
transverse momentum
std::vector< RawParticle >::const_iterator RHEP_const_iter
double Py() const
y of the momentum
Abs< T >::type abs(const T &t)
RawParticle const & particle() const
The particle being propagated.
void save()
Save nuclear interaction information.
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.
const math::XYZTLorentzVector & position() const
Temporary (until CMSSW moves to Mathcore) - No ! Actually very useful.
RHEP_const_iter beginDaughters() const
Returns const iterator to the beginning of the daughters list.
std::pair< OmniClusterRef, TrackingParticleRef > P
BremsstrahlungSimulator * Bremsstrahlung
double Y() const
y of vertex
double R() const
vertex radius
double X() const
x of vertex
GlobalVector theNormalVector
lengthRatio
Default is 0.020 for algo 1;.
EnergyLossSimulator * EnergyLoss
Log< level::Warning, false > LogWarning
GlobalVector normalVector(const TrackerLayer &layer, ParticlePropagator &myTrack) const
The vector normal to the surface traversed.
unsigned nDaughters() const
Returns the number of daughters.
virtual void save()
Used by NuclearInteractionSimulator to save last sampled event.
MultipleScatteringSimulator * MultipleScattering
Global3DVector GlobalVector
const XYZTLorentzVector & vertex() const
the vertex fourvector
double Px() const
x of the momentum
MaterialEffects(const edm::ParameterSet &matEff)
Constructor.