20 declareInterface<Trk::IMaterialEffectsEngine>(
this);
35 return StatusCode::SUCCESS;
42 return StatusCode::SUCCESS;
61 double mFactor = layer->layerMaterialProperties()->factor(rlDir, matupstage);
63 EX_MSG_VERBOSE(eCell.
navigationStep,
"layer", layer->layerIndex().value(),
"material collection with " << (matupstage > 0. ?
"pre " :
"post ") <<
"factor 0.");
67 pathCorrection = mFactor*pathCorrection;
73 if (materialProperties && std::abs(pathCorrection)>0.){
82 eCell.
addMaterial(pathCorrection, materialProperties);
116 double pathCorrection = layer->surfaceRepresentation().pathCorrection(parameters.position(),dir*(parameters.momentum()));
120 double mFactor = layer->layerMaterialProperties()->factor(rlDir, matupstage);
122 EX_MSG_VERBOSE(eCell.
navigationStep,
"layer", layer->layerIndex().value(),
"material update with " << (matupstage > 0. ?
"pre " :
"post ") <<
"factor 0. No update done.");
124 return (¶meters);
126 pathCorrection = mFactor*pathCorrection;
130 const Trk::MaterialProperties* materialProperties = layer->layerMaterialProperties()->fullMaterial(parameters.position());
132 if (materialProperties && std::abs(pathCorrection)>0. &&
137 AmgVector(5) uParameters = parameters.parameters();
139 parameters.covariance()
140 ? std::make_unique<AmgSymMatrix(5)>(*parameters.covariance())
145 double thickness = materialProperties->
thickness();
147 double p = parameters.momentum().mag();
149 double E = sqrt(p*p+m*m);
157 double dE = thickness*pathCorrection*dEdl;
158 sigmaP *= thickness*pathCorrection;
160 double newP = sqrt((E+dE)*(E+dE)-m*m);
161 uParameters[
Trk::qOverP] = parameters.charge()/newP;
162 double sigmaDeltaE = thickness*pathCorrection*sigmaP;
163 double sigmaQoverP = sigmaDeltaE/std::pow(beta*p,2);
172 double sinTheta = sin(parameters.parameters()[
Trk::theta]);
173 double sigmaDeltaPhiSq = sigmaMS*sigmaMS/(sinTheta*sinTheta);
174 double sigmaDeltaThetaSq = sigmaMS*sigmaMS;
182 eCell.
stepMaterial(parameters.associatedSurface(), layer, parameters.position(), pathCorrection, materialProperties);
185 eCell.
addMaterial(pathCorrection, materialProperties);
191 parameters.updateParameters(uParameters,*uCovariance);
193 parameters.updateParameters(uParameters);
195 EX_MSG_VERBOSE(eCell.
navigationStep,
"layer", layer->layerIndex().value(),
"material update on initial parameters, creating new ones.");
197 const Trk::Surface& tSurface = parameters.associatedSurface();
206 *uCovariance).release();
212 return (¶meters);
#define AmgSymMatrix(dim)
std::string m_sopPostfix
prefix for screen output
std::string m_sopPrefix
prefix for screen output
int value() const
layerIndex expressed in an integer
Base Class for a Detector Layer in the Tracking realm.
const LayerMaterialProperties * layerMaterialProperties() const
getting the LayerMaterialProperties including full/pre/post update
const LayerIndex & layerIndex() const
get the layerIndex
virtual ExtrapolationCode handleMaterial(ExCellCharged &ecCharged, PropDirection dir=alongMomentum, MaterialUpdateStage matupstage=fullUpdate) const
charged extrapolation
StatusCode initialize()
AlgTool initialize method.
~MaterialEffectsEngine()
Destructor.
StatusCode finalize()
AlgTool finalize method.
MaterialEffectsEngine(const std::string &, const std::string &, const IInterface *)
Constructor.
BooleanProperty m_mscCorrection
TrackParameters * updateTrackParameters(Trk::TrackParameters ¶meters, Trk::ExCellCharged &eCell, Trk::PropDirection dir, Trk::MaterialUpdateStage matupstage) const
charged extrapolation
StringProperty m_sopPostfix_prop
StringProperty m_sopPrefix_prop
BooleanProperty m_eLossCorrection
Material with information about thickness of material.
float thicknessInX0() const
Return the radiationlength fraction.
const Material & material() const
Return the stored Material.
float thickness() const
Return the thickness in mm.
A common object to be contained by.
const Amg::Vector3D & momentum() const
Access method for the momentum.
const Amg::Vector3D & position() const
Access method for the position.
virtual const Surface & associatedSurface() const override=0
Access to the Surface associated to the Parameters.
Abstract Base Class for tracking surfaces.
virtual ChargedTrackParametersUniquePtr createUniqueTrackParameters(double l1, double l2, double phi, double theat, double qop, const std::optional< AmgSymMatrix(5)> &cov=std::nullopt) const =0
Use the Surface as a ParametersBase constructor, from local parameters - charged.
constexpr double mass[PARTICLEHYPOTHESES]
the array of masses
PropDirection
PropDirection, enum for direction of the propagation.
MaterialUpdateStage
This is a steering enum to tell which material update stage:
@ loc2
generic first and second local coordinate
ExtrapolationCell< TrackParameters > ExCellCharged
ParametersBase< TrackParametersDim, Charged > TrackParameters
ExtrapolationCell< NeutralParameters > ExCellNeutral
static double dEdl_ionization(double p, const Material &mat, ParticleHypothesis particle, double &sigma, double &kazL)
dE/dl ionization energy loss per path unit
static double sigmaMS(double dInX0, double p, double beta)
multiple scattering as function of dInX0