27 : PairProduction(0), Bremsstrahlung(0),MuonBremsstrahlung(0),
28 MultipleScattering(0), EnergyLoss(0),
29 NuclearInteraction(0),
30 pTmin(999.),
random(engine), use_hardcoded(1)
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 doMuonBremsstrahlung = matEff.
getParameter<
bool>(
"MuonBremsstrahlung");
46 double radLen = matEff.
getParameter<
double>(
"RadiationLength");
50 if ( doPairProduction ) {
52 double photonEnergy = matEff.
getParameter<
double>(
"photonEnergy");
58 if ( doBremsstrahlung ) {
60 double bremEnergy = matEff.
getParameter<
double>(
"bremEnergy");
61 double bremEnergyFraction = matEff.
getParameter<
double>(
"bremEnergyFraction");
68 if ( doMuonBremsstrahlung ) {
70 double bremEnergy = matEff.
getParameter<
double>(
"bremEnergy");
71 double bremEnergyFraction = matEff.
getParameter<
double>(
"bremEnergyFraction");
87 if ( doMultipleScattering ) {
93 if ( doNuclearInteraction ) {
96 std::vector<double> pionEnergies
100 std::vector<int> pionTypes
104 std::vector<std::string> pionNames
108 std::vector<double> pionMasses
112 std::vector<double> pionPMin
116 std::vector<double> lengthRatio
117 = matEff.
getParameter<std::vector<double> >(
"lengthRatio");
127 std::vector<double> theRatios
135 std::vector< std::vector<double> >
ratios;
136 ratios.resize(pionTypes.size());
137 for (
unsigned i=0;
i<pionTypes.size(); ++
i ) {
138 for (
unsigned j=0;
j<pionEnergies.size(); ++
j ) {
139 ratios[
i].push_back(theRatios[
i*pionEnergies.size() +
j ]);
160 std::map<int,int> idMap;
162 std::vector<int> idProtons
164 for (
unsigned i=0;
i<idProtons.size(); ++
i )
165 idMap[idProtons[
i]] = 2212;
167 std::vector<int> idAntiProtons
169 for (
unsigned i=0;
i<idAntiProtons.size(); ++
i )
170 idMap[idAntiProtons[
i]] = -2212;
172 std::vector<int> idNeutrons
174 for (
unsigned i=0;
i<idNeutrons.size(); ++
i )
175 idMap[idNeutrons[
i]] = 2112;
177 std::vector<int> idAntiNeutrons
179 for (
unsigned i=0;
i<idAntiNeutrons.size(); ++
i )
180 idMap[idAntiNeutrons[
i]] = -2112;
182 std::vector<int> idK0Ls
184 for (
unsigned i=0;
i<idK0Ls.size(); ++
i )
185 idMap[idK0Ls[
i]] = 130;
187 std::vector<int> idKplusses
189 for (
unsigned i=0;
i<idKplusses.size(); ++
i )
190 idMap[idKplusses[
i]] = 321;
192 std::vector<int> idKminusses
194 for (
unsigned i=0;
i<idKminusses.size(); ++
i )
195 idMap[idKminusses[
i]] = -321;
197 std::vector<int> idPiplusses
199 for (
unsigned i=0;
i<idPiplusses.size(); ++
i )
200 idMap[idPiplusses[
i]] = 211;
202 std::vector<int> idPiminusses
204 for (
unsigned i=0;
i<idPiminusses.size(); ++
i )
205 idMap[idPiminusses[
i]] = -211;
210 pionMasses, pionPMin, pionEnergy,
211 lengthRatio, ratios, idMap,
212 inputFile, distAlgo, distCut,
random);
268 edm::LogWarning(
"MaterialEffects") <<
" WARNING: A non valid vertex was found in photon conv. -> " << ivertex << std::endl;
275 if ( myTrack.
pid() == 22 )
return;
282 &&
abs(myTrack.
pid()) < 1000000) {
307 int daughId = mySimEvent.
addSimTrack(&(*DaughterIter), ivertex);
320 edm::LogWarning(
"MaterialEffects") <<
" WARNING: A non valid vertex was found in nucl. int. -> " << ivertex << std::endl;
327 if ( myTrack.
charge() == 0 )
return;
355 edm::LogWarning(
"MaterialEffects") <<
" WARNING: A non valid vertex was found in brem -> " << ivertex << std::endl;
386 edm::LogWarning(
"MaterialEffects") <<
" WARNING: A non valid vertex was found in muon brem -> " << ivertex << std::endl;
432 double rad = myTrack.
R();
433 double zed = fabs(myTrack.
Z());
441 for (
unsigned int iLayer=0; iLayer < layer.
fudgeNumber(); ++iLayer ) {
454 return radlen * factor;
462 layer.
disk()->normalVector() :
const double Z[kNumberCalorimeter]
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.
MaterialEffects(const edm::ParameterSet &matEff, const RandomEngine *engine)
Constructor.
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
const RandomEngine * random
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.
int pid() const
get the HEP particle ID number
MuonBremsstrahlungSimulator * MuonBremsstrahlung
double R() const
vertex radius
BoundDisk * disk() const
Returns the surface.
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 Z() const
z of vertex
RHEP_const_iter endDaughters() const
Returns const iterator to the end of the daughters list.
void save()
Save nuclear interaction information.
const FSimVertex & vertex() const
Origin vertex.
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
double radLengths(const TrackerLayer &layer, ParticlePropagator &myTrack)
The number of radiation lengths traversed.
void updateState(ParticlePropagator &myTrack, double radlen)
Compute the material effect (calls the sub class)
double X() const
x of vertex
BremsstrahlungSimulator * Bremsstrahlung
void interact(FSimEvent &simEvent, const TrackerLayer &layer, ParticlePropagator &PP, unsigned i)
GlobalVector theNormalVector
double fudgeMin(unsigned iFudge) const
EnergyLossSimulator * EnergyLoss
NuclearInteractionSimulator * NuclearInteraction
const MediumProperties & mediumProperties() const
void save()
Save current nuclear interaction (for later use)
MultipleScatteringSimulator * MultipleScattering
Global3DVector GlobalVector
FSimTrack & track(int id) const
Return track with given Id.