27 : PairProduction(0), Bremsstrahlung(0),MuonBremsstrahlung(0),
28 MultipleScattering(0), EnergyLoss(0),
29 NuclearInteraction(0),
30 pTmin(999.),
random(engine)
34 bool doPairProduction = matEff.
getParameter<
bool>(
"PairProduction");
35 bool doBremsstrahlung = matEff.
getParameter<
bool>(
"Bremsstrahlung");
36 bool doEnergyLoss = matEff.
getParameter<
bool>(
"EnergyLoss");
37 bool doMultipleScattering = matEff.
getParameter<
bool>(
"MultipleScattering");
38 bool doNuclearInteraction = matEff.
getParameter<
bool>(
"NuclearInteraction");
39 bool doMuonBremsstrahlung = matEff.
getParameter<
bool>(
"MuonBremsstrahlung");
44 double radLen = matEff.
getParameter<
double>(
"RadiationLength");
48 if ( doPairProduction ) {
50 double photonEnergy = matEff.
getParameter<
double>(
"photonEnergy");
56 if ( doBremsstrahlung ) {
58 double bremEnergy = matEff.
getParameter<
double>(
"bremEnergy");
59 double bremEnergyFraction = matEff.
getParameter<
double>(
"bremEnergyFraction");
66 if ( doMuonBremsstrahlung ) {
68 double bremEnergy = matEff.
getParameter<
double>(
"bremEnergy");
69 double bremEnergyFraction = matEff.
getParameter<
double>(
"bremEnergyFraction");
85 if ( doMultipleScattering ) {
91 if ( doNuclearInteraction ) {
94 std::vector<double> pionEnergies
98 std::vector<int> pionTypes
102 std::vector<std::string> pionNames
106 std::vector<double> pionMasses
110 std::vector<double> pionPMin
114 std::vector<double> lengthRatio
115 = matEff.
getParameter<std::vector<double> >(
"lengthRatio");
125 std::vector<double> theRatios
133 std::vector< std::vector<double> > ratios;
134 ratios.resize(pionTypes.size());
135 for (
unsigned i=0;
i<pionTypes.size(); ++
i ) {
136 for (
unsigned j=0;
j<pionEnergies.size(); ++
j ) {
137 ratios[
i].push_back(theRatios[
i*pionEnergies.size() +
j ]);
158 std::map<int,int> idMap;
160 std::vector<int> idProtons
162 for (
unsigned i=0;
i<idProtons.size(); ++
i )
163 idMap[idProtons[
i]] = 2212;
165 std::vector<int> idAntiProtons
167 for (
unsigned i=0;
i<idAntiProtons.size(); ++
i )
168 idMap[idAntiProtons[
i]] = -2212;
170 std::vector<int> idNeutrons
172 for (
unsigned i=0;
i<idNeutrons.size(); ++
i )
173 idMap[idNeutrons[
i]] = 2112;
175 std::vector<int> idAntiNeutrons
177 for (
unsigned i=0;
i<idAntiNeutrons.size(); ++
i )
178 idMap[idAntiNeutrons[
i]] = -2112;
180 std::vector<int> idK0Ls
182 for (
unsigned i=0;
i<idK0Ls.size(); ++
i )
183 idMap[idK0Ls[
i]] = 130;
185 std::vector<int> idKplusses
187 for (
unsigned i=0;
i<idKplusses.size(); ++
i )
188 idMap[idKplusses[
i]] = 321;
190 std::vector<int> idKminusses
192 for (
unsigned i=0;
i<idKminusses.size(); ++
i )
193 idMap[idKminusses[
i]] = -321;
195 std::vector<int> idPiplusses
197 for (
unsigned i=0;
i<idPiplusses.size(); ++
i )
198 idMap[idPiplusses[
i]] = 211;
200 std::vector<int> idPiminusses
202 for (
unsigned i=0;
i<idPiminusses.size(); ++
i )
203 idMap[idPiminusses[
i]] = -211;
208 pionMasses, pionPMin, pionEnergy,
209 lengthRatio, ratios, idMap,
210 inputFile, distAlgo, distCut,
random);
266 edm::LogWarning(
"MaterialEffects") <<
" WARNING: A non valid vertex was found in photon conv. -> " << ivertex << std::endl;
273 if ( myTrack.
pid() == 22 )
return;
280 &&
abs(myTrack.
pid()) < 1000000) {
303 int daughId = mySimEvent.
addSimTrack(&(*DaughterIter), ivertex);
316 edm::LogWarning(
"MaterialEffects") <<
" WARNING: A non valid vertex was found in nucl. int. -> " << ivertex << std::endl;
323 if ( myTrack.
charge() == 0 )
return;
351 edm::LogWarning(
"MaterialEffects") <<
" WARNING: A non valid vertex was found in brem -> " << ivertex << std::endl;
382 edm::LogWarning(
"MaterialEffects") <<
" WARNING: A non valid vertex was found in muon brem -> " << ivertex << std::endl;
428 double rad = myTrack.
R();
429 double zed = fabs(myTrack.
Z());
437 for (
unsigned int iLayer=0; iLayer < layer.
fudgeNumber(); ++iLayer ) {
450 return radlen * factor;
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
GlobalVector normalVector() const
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
const MediumProperties * mediumProperties() const
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
void save()
Save current nuclear interaction (for later use)
MultipleScatteringSimulator * MultipleScattering
Global3DVector GlobalVector
FSimTrack & track(int id) const
Return track with given Id.