30 pTmin(999.), use_hardcoded(
true)
36 bool doPairProduction = matEff.
getParameter<
bool>(
"PairProduction");
37 bool doBremsstrahlung = matEff.
getParameter<
bool>(
"Bremsstrahlung");
38 bool doEnergyLoss = matEff.
getParameter<
bool>(
"EnergyLoss");
39 bool doMultipleScattering = matEff.
getParameter<
bool>(
"MultipleScattering");
40 bool doNuclearInteraction = matEff.
getParameter<
bool>(
"NuclearInteraction");
41 bool doG4NuclInteraction = matEff.
getParameter<
bool>(
"G4NuclearInteraction");
42 bool doMuonBremsstrahlung = matEff.
getParameter<
bool>(
"MuonBremsstrahlung");
47 double radLen = matEff.
getParameter<
double>(
"RadiationLength");
51 if ( doPairProduction ) {
53 double photonEnergy = matEff.
getParameter<
double>(
"photonEnergy");
57 if ( doBremsstrahlung ) {
59 double bremEnergy = matEff.
getParameter<
double>(
"bremEnergy");
60 double bremEnergyFraction = matEff.
getParameter<
double>(
"bremEnergyFraction");
65 if ( doMuonBremsstrahlung ) {
67 double bremEnergy = matEff.
getParameter<
double>(
"bremEnergy");
68 double bremEnergyFraction = matEff.
getParameter<
double>(
"bremEnergyFraction");
83 if ( doMultipleScattering ) {
90 if ( doNuclearInteraction ) {
93 std::vector<double> hadronEnergies
97 std::vector<int> hadronTypes
101 std::vector<std::string> hadronNames
105 std::vector<double> hadronMasses
109 std::vector<double> hadronPMin
113 std::vector<double> lengthRatio
114 = matEff.
getParameter<std::vector<double> >(
"lengthRatio");
124 std::vector<double> theRatios
132 std::vector< std::vector<double> >
ratios;
133 ratios.resize(hadronTypes.size());
134 for (
unsigned i=0;
i<hadronTypes.size(); ++
i ) {
135 for (
unsigned j=0; j<hadronEnergies.size(); ++j ) {
136 ratios[
i].push_back(theRatios[
i*hadronEnergies.size() + j ]);
157 std::map<int,int> idMap;
159 std::vector<int> idProtons
161 for (
unsigned i=0;
i<idProtons.size(); ++
i )
162 idMap[idProtons[
i]] = 2212;
164 std::vector<int> idAntiProtons
166 for (
unsigned i=0;
i<idAntiProtons.size(); ++
i )
167 idMap[idAntiProtons[
i]] = -2212;
169 std::vector<int> idNeutrons
171 for (
unsigned i=0;
i<idNeutrons.size(); ++
i )
172 idMap[idNeutrons[
i]] = 2112;
174 std::vector<int> idAntiNeutrons
176 for (
unsigned i=0;
i<idAntiNeutrons.size(); ++
i )
177 idMap[idAntiNeutrons[
i]] = -2112;
179 std::vector<int> idK0Ls
181 for (
unsigned i=0;
i<idK0Ls.size(); ++
i )
182 idMap[idK0Ls[
i]] = 130;
184 std::vector<int> idKplusses
186 for (
unsigned i=0;
i<idKplusses.size(); ++
i )
187 idMap[idKplusses[
i]] = 321;
189 std::vector<int> idKminusses
191 for (
unsigned i=0;
i<idKminusses.size(); ++
i )
192 idMap[idKminusses[
i]] = -321;
194 std::vector<int> idPiplusses
196 for (
unsigned i=0;
i<idPiplusses.size(); ++
i )
197 idMap[idPiplusses[
i]] = 211;
199 std::vector<int> idPiminusses
201 for (
unsigned i=0;
i<idPiminusses.size(); ++
i )
202 idMap[idPiminusses[
i]] = -211;
205 if ( doG4NuclInteraction ) {
213 hadronMasses, hadronPMin, pionEnergy,
214 lengthRatio, ratios, idMap,
215 inputFile, distAlgo, distCut);
275 edm::LogWarning(
"MaterialEffects") <<
" WARNING: A non valid vertex was found in photon conv. -> " << ivertex << std::endl;
317 int daughId = mySimEvent.
addSimTrack(&(*DaughterIter), ivertex);
330 edm::LogWarning(
"MaterialEffects") <<
" WARNING: A non valid vertex was found in nucl. int. -> " << ivertex << std::endl;
365 edm::LogWarning(
"MaterialEffects") <<
" WARNING: A non valid vertex was found in brem -> " << ivertex << std::endl;
396 edm::LogWarning(
"MaterialEffects") <<
" WARNING: A non valid vertex was found in muon brem -> " << ivertex << std::endl;
443 double zed = fabs(myTrack.
particle().
Z());
451 for (
unsigned int iLayer=0; iLayer < layer.
fudgeNumber(); ++iLayer ) {
464 return radlen * factor;
472 layer.
disk()->normalVector() :
T getParameter(std::string const &) const
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.
int addSimTrack(const RawParticle *p, int iv, int ig=-1, const HepMC::GenVertex *ev=0)
Add a new track to the Event and to the various lists.
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
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
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.
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
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.