26 : PairProduction(0), Bremsstrahlung(0),MuonBremsstrahlung(0),
27 MultipleScattering(0), EnergyLoss(0),
28 NuclearInteraction(0),
29 pTmin(999.), use_hardcoded(1)
35 bool doPairProduction = matEff.
getParameter<
bool>(
"PairProduction");
36 bool doBremsstrahlung = matEff.
getParameter<
bool>(
"Bremsstrahlung");
37 bool doEnergyLoss = matEff.
getParameter<
bool>(
"EnergyLoss");
38 bool doMultipleScattering = matEff.
getParameter<
bool>(
"MultipleScattering");
39 bool doNuclearInteraction = matEff.
getParameter<
bool>(
"NuclearInteraction");
40 bool doMuonBremsstrahlung = matEff.
getParameter<
bool>(
"MuonBremsstrahlung");
45 double radLen = matEff.
getParameter<
double>(
"RadiationLength");
49 if ( doPairProduction ) {
51 double photonEnergy = matEff.
getParameter<
double>(
"photonEnergy");
55 if ( doBremsstrahlung ) {
57 double bremEnergy = matEff.
getParameter<
double>(
"bremEnergy");
58 double bremEnergyFraction = matEff.
getParameter<
double>(
"bremEnergyFraction");
63 if ( doMuonBremsstrahlung ) {
65 double bremEnergy = matEff.
getParameter<
double>(
"bremEnergy");
66 double bremEnergyFraction = matEff.
getParameter<
double>(
"bremEnergyFraction");
82 if ( doMultipleScattering ) {
88 if ( doNuclearInteraction ) {
91 std::vector<double> pionEnergies
95 std::vector<int> pionTypes
99 std::vector<std::string> pionNames
103 std::vector<double> pionMasses
107 std::vector<double> pionPMin
111 std::vector<double> lengthRatio
112 = matEff.
getParameter<std::vector<double> >(
"lengthRatio");
122 std::vector<double> theRatios
130 std::vector< std::vector<double> >
ratios;
131 ratios.resize(pionTypes.size());
132 for (
unsigned i=0;
i<pionTypes.size(); ++
i ) {
133 for (
unsigned j=0;
j<pionEnergies.size(); ++
j ) {
134 ratios[
i].push_back(theRatios[
i*pionEnergies.size() +
j ]);
155 std::map<int,int> idMap;
157 std::vector<int> idProtons
159 for (
unsigned i=0;
i<idProtons.size(); ++
i )
160 idMap[idProtons[
i]] = 2212;
162 std::vector<int> idAntiProtons
164 for (
unsigned i=0;
i<idAntiProtons.size(); ++
i )
165 idMap[idAntiProtons[
i]] = -2212;
167 std::vector<int> idNeutrons
169 for (
unsigned i=0;
i<idNeutrons.size(); ++
i )
170 idMap[idNeutrons[
i]] = 2112;
172 std::vector<int> idAntiNeutrons
174 for (
unsigned i=0;
i<idAntiNeutrons.size(); ++
i )
175 idMap[idAntiNeutrons[
i]] = -2112;
177 std::vector<int> idK0Ls
179 for (
unsigned i=0;
i<idK0Ls.size(); ++
i )
180 idMap[idK0Ls[
i]] = 130;
182 std::vector<int> idKplusses
184 for (
unsigned i=0;
i<idKplusses.size(); ++
i )
185 idMap[idKplusses[
i]] = 321;
187 std::vector<int> idKminusses
189 for (
unsigned i=0;
i<idKminusses.size(); ++
i )
190 idMap[idKminusses[
i]] = -321;
192 std::vector<int> idPiplusses
194 for (
unsigned i=0;
i<idPiplusses.size(); ++
i )
195 idMap[idPiplusses[
i]] = 211;
197 std::vector<int> idPiminusses
199 for (
unsigned i=0;
i<idPiminusses.size(); ++
i )
200 idMap[idPiminusses[
i]] = -211;
205 pionMasses, pionPMin, pionEnergy,
206 lengthRatio, ratios, idMap,
207 inputFile, distAlgo, distCut);
262 edm::LogWarning(
"MaterialEffects") <<
" WARNING: A non valid vertex was found in photon conv. -> " << ivertex << std::endl;
269 if ( myTrack.
pid() == 22 )
return;
276 &&
abs(myTrack.
pid()) < 1000000) {
301 int daughId = mySimEvent.
addSimTrack(&(*DaughterIter), ivertex);
314 edm::LogWarning(
"MaterialEffects") <<
" WARNING: A non valid vertex was found in nucl. int. -> " << ivertex << std::endl;
321 if ( myTrack.
charge() == 0 )
return;
349 edm::LogWarning(
"MaterialEffects") <<
" WARNING: A non valid vertex was found in brem -> " << ivertex << std::endl;
380 edm::LogWarning(
"MaterialEffects") <<
" WARNING: A non valid vertex was found in muon brem -> " << ivertex << std::endl;
426 double rad = myTrack.
R();
427 double zed = fabs(myTrack.
Z());
435 for (
unsigned int iLayer=0; iLayer < layer.
fudgeNumber(); ++iLayer ) {
448 return radlen * factor;
456 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.
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
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 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.
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
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.
double X() const
x of vertex
BremsstrahlungSimulator * Bremsstrahlung
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
MaterialEffects(const edm::ParameterSet &matEff)
Constructor.
FSimTrack & track(int id) const
Return track with given Id.