19 declareInterface<Trk::IMaterialEffectsEngine>(
this);
34 return StatusCode::SUCCESS;
41 return StatusCode::SUCCESS;
60 double mFactor = layer->layerMaterialProperties()->factor(rlDir, matupstage);
62 EX_MSG_VERBOSE(eCell.
navigationStep,
"layer", layer->layerIndex().value(),
"material collection with " << (matupstage > 0. ?
"pre " :
"post ") <<
"factor 0.");
66 pathCorrection = mFactor*pathCorrection;
72 if (materialProperties && std::abs(pathCorrection)>0.){
81 eCell.
addMaterial(pathCorrection, materialProperties);
115 double pathCorrection = layer->surfaceRepresentation().pathCorrection(parameters.position(),dir*(parameters.momentum()));
119 double mFactor = layer->layerMaterialProperties()->factor(rlDir, matupstage);
121 EX_MSG_VERBOSE(eCell.
navigationStep,
"layer", layer->layerIndex().value(),
"material update with " << (matupstage > 0. ?
"pre " :
"post ") <<
"factor 0. No update done.");
123 return (¶meters);
125 pathCorrection = mFactor*pathCorrection;
129 const Trk::MaterialProperties* materialProperties = layer->layerMaterialProperties()->fullMaterial(parameters.position());
131 if (materialProperties && std::abs(pathCorrection)>0. &&
136 AmgVector(5) uParameters = parameters.parameters();
138 parameters.covariance()
139 ? std::make_unique<AmgSymMatrix(5)>(*parameters.covariance())
144 double thickness = materialProperties->
thickness();
146 double p = parameters.momentum().mag();
148 double E = sqrt(p*p+m*m);
156 double dE = thickness*pathCorrection*dEdl;
157 sigmaP *= thickness*pathCorrection;
159 double newP = sqrt((E+dE)*(E+dE)-m*m);
160 uParameters[
Trk::qOverP] = parameters.charge()/newP;
161 double sigmaDeltaE = thickness*pathCorrection*sigmaP;
162 double sigmaQoverP = sigmaDeltaE/std::pow(beta*p,2);
171 double sinTheta = sin(parameters.parameters()[
Trk::theta]);
172 double sigmaDeltaPhiSq = sigmaMS*sigmaMS/(sinTheta*sinTheta);
173 double sigmaDeltaThetaSq = sigmaMS*sigmaMS;
181 eCell.
stepMaterial(parameters.associatedSurface(), layer, parameters.position(), pathCorrection, materialProperties);
184 eCell.
addMaterial(pathCorrection, materialProperties);
190 parameters.updateParameters(uParameters,*uCovariance);
192 parameters.updateParameters(uParameters);
194 EX_MSG_VERBOSE(eCell.
navigationStep,
"layer", layer->layerIndex().value(),
"material update on initial parameters, creating new ones.");
196 const Trk::Surface& tSurface = parameters.associatedSurface();
202 *uCovariance).release();
208 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, 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