ATLAS Offline Software
Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | Private Types | Private Member Functions | Private Attributes | List of all members
Trk::MaterialEffectsEngine Class Reference

#include <MaterialEffectsEngine.h>

Inheritance diagram for Trk::MaterialEffectsEngine:
Collaboration diagram for Trk::MaterialEffectsEngine:

Public Member Functions

 MaterialEffectsEngine (const std::string &, const std::string &, const IInterface *)
 Constructor. More...
 
 ~MaterialEffectsEngine ()
 Destructor. More...
 
StatusCode initialize ()
 AlgTool initialize method. More...
 
StatusCode finalize ()
 AlgTool finalize method. More...
 
virtual ExtrapolationCode handleMaterial (ExCellCharged &ecCharged, PropDirection dir=alongMomentum, MaterialUpdateStage matupstage=fullUpdate) const
 charged extrapolation More...
 
virtual ExtrapolationCode handleMaterial (ExCellNeutral &ecNeutral, PropDirection dir=alongMomentum, MaterialUpdateStage matupstage=fullUpdate) const
 neutral extrapolation - only for Fatras, dummy implementation here More...
 
ServiceHandle< StoreGateSvc > & evtStore ()
 The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc. More...
 
const ServiceHandle< StoreGateSvc > & evtStore () const
 The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc. More...
 
const ServiceHandle< StoreGateSvc > & detStore () const
 The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc. More...
 
virtual StatusCode sysInitialize () override
 Perform system initialization for an algorithm. More...
 
virtual StatusCode sysStart () override
 Handle START transition. More...
 
virtual std::vector< Gaudi::DataHandle * > inputHandles () const override
 Return this algorithm's input handles. More...
 
virtual std::vector< Gaudi::DataHandle * > outputHandles () const override
 Return this algorithm's output handles. More...
 
Gaudi::Details::PropertyBase & declareProperty (Gaudi::Property< T > &t)
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, SG::VarHandleKey &hndl, const std::string &doc, const SG::VarHandleKeyType &)
 Declare a new Gaudi property. More...
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, SG::VarHandleBase &hndl, const std::string &doc, const SG::VarHandleType &)
 Declare a new Gaudi property. More...
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, SG::VarHandleKeyArray &hndArr, const std::string &doc, const SG::VarHandleKeyArrayType &)
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, T &property, const std::string &doc, const SG::NotHandleType &)
 Declare a new Gaudi property. More...
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, T &property, const std::string &doc="none")
 Declare a new Gaudi property. More...
 
void updateVHKA (Gaudi::Details::PropertyBase &)
 
MsgStream & msg () const
 
MsgStream & msg (const MSG::Level lvl) const
 
bool msgLvl (const MSG::Level lvl) const
 

Static Public Member Functions

static const InterfaceID & interfaceID ()
 AlgTool interface methods. More...
 

Protected Member Functions

TrackParametersupdateTrackParameters (Trk::TrackParameters &parameters, Trk::ExCellCharged &eCell, Trk::PropDirection dir, Trk::MaterialUpdateStage matupstage) const
 charged extrapolation More...
 
void renounceArray (SG::VarHandleKeyArray &handlesArray)
 remove all handles from I/O resolution More...
 
std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > renounce (T &h)
 
void extraDeps_update_handler (Gaudi::Details::PropertyBase &ExtraDeps)
 Add StoreName to extra input/output deps as needed. More...
 

Protected Attributes

MaterialInteraction m_interactionFormulae
 the formulas concentrated More...
 
bool m_eLossCorrection
 apply the energy loss correction More...
 
bool m_eLossMpv
 apply the energy loss correction as most probable value More...
 
bool m_mscCorrection
 apply the multiple (coulomb) scattering correction More...
 
std::string m_sopPrefix
 prefix for screen output More...
 
std::string m_sopPostfix
 prefix for screen output More...
 

Private Types

typedef ServiceHandle< StoreGateSvcStoreGateSvc_t
 

Private Member Functions

Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
 specialization for handling Gaudi::Property<SG::VarHandleKey> More...
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleKeyArrayType &)
 specialization for handling Gaudi::Property<SG::VarHandleKeyArray> More...
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleType &)
 specialization for handling Gaudi::Property<SG::VarHandleBase> More...
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T > &t, const SG::NotHandleType &)
 specialization for handling everything that's not a Gaudi::Property<SG::VarHandleKey> or a <SG::VarHandleKeyArray> More...
 

Private Attributes

StoreGateSvc_t m_evtStore
 Pointer to StoreGate (event store by default) More...
 
StoreGateSvc_t m_detStore
 Pointer to StoreGate (detector store by default) More...
 
std::vector< SG::VarHandleKeyArray * > m_vhka
 
bool m_varHandleArraysDeclared
 

Detailed Description

Material effects engine interface for charged and neutral (fast track simulation) , the update is alwyas on the:

Author
Andreas Salzburger -at - cern.ch

Definition at line 38 of file MaterialEffectsEngine.h.

Member Typedef Documentation

◆ StoreGateSvc_t

typedef ServiceHandle<StoreGateSvc> AthCommonDataStore< AthCommonMsg< AlgTool > >::StoreGateSvc_t
privateinherited

Definition at line 388 of file AthCommonDataStore.h.

Constructor & Destructor Documentation

◆ MaterialEffectsEngine()

Trk::MaterialEffectsEngine::MaterialEffectsEngine ( const std::string &  t,
const std::string &  n,
const IInterface *  p 
)

Constructor.

Definition at line 16 of file MaterialEffectsEngine.cxx.

17 : AthAlgTool(t,n,p),
18  m_eLossCorrection(true),
19  m_eLossMpv(true),
20  m_mscCorrection(true)
21 {
22  declareInterface<Trk::IMaterialEffectsEngine>(this);
23  // steering of the screen outoput (SOP)
24  declareProperty("OutputPrefix" , m_sopPrefix);
25  declareProperty("OutputPostfix" , m_sopPostfix);
26  // steering of the material effects engine behaviour
27  declareProperty("EnergyLossCorrection" , m_eLossCorrection);
28  declareProperty("MostProbableEnergyLoss" , m_eLossMpv);
29  declareProperty("MultipleScatteringCorrection" , m_mscCorrection);
30 }

◆ ~MaterialEffectsEngine()

Trk::MaterialEffectsEngine::~MaterialEffectsEngine ( )
default

Destructor.

Member Function Documentation

◆ declareGaudiProperty() [1/4]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< AlgTool > >::declareGaudiProperty ( Gaudi::Property< T > &  hndl,
const SG::VarHandleKeyArrayType  
)
inlineprivateinherited

specialization for handling Gaudi::Property<SG::VarHandleKeyArray>

Definition at line 170 of file AthCommonDataStore.h.

172  {
173  return *AthCommonDataStore<PBASE>::declareProperty(hndl.name(),
174  hndl.value(),
175  hndl.documentation());
176 
177  }

◆ declareGaudiProperty() [2/4]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< AlgTool > >::declareGaudiProperty ( Gaudi::Property< T > &  hndl,
const SG::VarHandleKeyType  
)
inlineprivateinherited

specialization for handling Gaudi::Property<SG::VarHandleKey>

Definition at line 156 of file AthCommonDataStore.h.

158  {
159  return *AthCommonDataStore<PBASE>::declareProperty(hndl.name(),
160  hndl.value(),
161  hndl.documentation());
162 
163  }

◆ declareGaudiProperty() [3/4]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< AlgTool > >::declareGaudiProperty ( Gaudi::Property< T > &  hndl,
const SG::VarHandleType  
)
inlineprivateinherited

specialization for handling Gaudi::Property<SG::VarHandleBase>

Definition at line 184 of file AthCommonDataStore.h.

186  {
187  return *AthCommonDataStore<PBASE>::declareProperty(hndl.name(),
188  hndl.value(),
189  hndl.documentation());
190  }

◆ declareGaudiProperty() [4/4]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< AlgTool > >::declareGaudiProperty ( Gaudi::Property< T > &  t,
const SG::NotHandleType  
)
inlineprivateinherited

specialization for handling everything that's not a Gaudi::Property<SG::VarHandleKey> or a <SG::VarHandleKeyArray>

Definition at line 199 of file AthCommonDataStore.h.

200  {
201  return PBASE::declareProperty(t);
202  }

◆ declareProperty() [1/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty ( const std::string &  name,
SG::VarHandleBase hndl,
const std::string &  doc,
const SG::VarHandleType  
)
inlineinherited

Declare a new Gaudi property.

Parameters
nameName of the property.
hndlObject holding the property value.
docDocumentation string for the property.

This is the version for types that derive from SG::VarHandleBase. The property value object is put on the input and output lists as appropriate; then we forward to the base class.

Definition at line 245 of file AthCommonDataStore.h.

249  {
250  this->declare(hndl.vhKey());
251  hndl.vhKey().setOwner(this);
252 
253  return PBASE::declareProperty(name,hndl,doc);
254  }

◆ declareProperty() [2/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty ( const std::string &  name,
SG::VarHandleKey hndl,
const std::string &  doc,
const SG::VarHandleKeyType  
)
inlineinherited

Declare a new Gaudi property.

Parameters
nameName of the property.
hndlObject holding the property value.
docDocumentation string for the property.

This is the version for types that derive from SG::VarHandleKey. The property value object is put on the input and output lists as appropriate; then we forward to the base class.

Definition at line 221 of file AthCommonDataStore.h.

225  {
226  this->declare(hndl);
227  hndl.setOwner(this);
228 
229  return PBASE::declareProperty(name,hndl,doc);
230  }

◆ declareProperty() [3/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty ( const std::string &  name,
SG::VarHandleKeyArray hndArr,
const std::string &  doc,
const SG::VarHandleKeyArrayType  
)
inlineinherited

Definition at line 259 of file AthCommonDataStore.h.

263  {
264 
265  // std::ostringstream ost;
266  // ost << Algorithm::name() << " VHKA declareProp: " << name
267  // << " size: " << hndArr.keys().size()
268  // << " mode: " << hndArr.mode()
269  // << " vhka size: " << m_vhka.size()
270  // << "\n";
271  // debug() << ost.str() << endmsg;
272 
273  hndArr.setOwner(this);
274  m_vhka.push_back(&hndArr);
275 
276  Gaudi::Details::PropertyBase* p = PBASE::declareProperty(name, hndArr, doc);
277  if (p != 0) {
278  p->declareUpdateHandler(&AthCommonDataStore<PBASE>::updateVHKA, this);
279  } else {
280  ATH_MSG_ERROR("unable to call declareProperty on VarHandleKeyArray "
281  << name);
282  }
283 
284  return p;
285 
286  }

◆ declareProperty() [4/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty ( const std::string &  name,
T &  property,
const std::string &  doc,
const SG::NotHandleType  
)
inlineinherited

Declare a new Gaudi property.

Parameters
nameName of the property.
propertyObject holding the property value.
docDocumentation string for the property.

This is the generic version, for types that do not derive from SG::VarHandleKey. It just forwards to the base class version of declareProperty.

Definition at line 333 of file AthCommonDataStore.h.

337  {
338  return PBASE::declareProperty(name, property, doc);
339  }

◆ declareProperty() [5/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty ( const std::string &  name,
T &  property,
const std::string &  doc = "none" 
)
inlineinherited

Declare a new Gaudi property.

Parameters
nameName of the property.
propertyObject holding the property value.
docDocumentation string for the property.

This dispatches to either the generic declareProperty or the one for VarHandle/Key/KeyArray.

Definition at line 352 of file AthCommonDataStore.h.

355  {
356  typedef typename SG::HandleClassifier<T>::type htype;
357  return declareProperty (name, property, doc, htype());
358  }

◆ declareProperty() [6/6]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty ( Gaudi::Property< T > &  t)
inlineinherited

Definition at line 145 of file AthCommonDataStore.h.

145  {
146  typedef typename SG::HandleClassifier<T>::type htype;
148  }

◆ detStore()

const ServiceHandle<StoreGateSvc>& AthCommonDataStore< AthCommonMsg< AlgTool > >::detStore ( ) const
inlineinherited

The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 95 of file AthCommonDataStore.h.

95 { return m_detStore; }

◆ evtStore() [1/2]

ServiceHandle<StoreGateSvc>& AthCommonDataStore< AthCommonMsg< AlgTool > >::evtStore ( )
inlineinherited

The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 85 of file AthCommonDataStore.h.

85 { return m_evtStore; }

◆ evtStore() [2/2]

const ServiceHandle<StoreGateSvc>& AthCommonDataStore< AthCommonMsg< AlgTool > >::evtStore ( ) const
inlineinherited

The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 90 of file AthCommonDataStore.h.

90 { return m_evtStore; }

◆ extraDeps_update_handler()

void AthCommonDataStore< AthCommonMsg< AlgTool > >::extraDeps_update_handler ( Gaudi::Details::PropertyBase &  ExtraDeps)
protectedinherited

Add StoreName to extra input/output deps as needed.

use the logic of the VarHandleKey to parse the DataObjID keys supplied via the ExtraInputs and ExtraOuputs Properties to add the StoreName if it's not explicitly given

◆ finalize()

StatusCode Trk::MaterialEffectsEngine::finalize ( )

AlgTool finalize method.

Definition at line 45 of file MaterialEffectsEngine.cxx.

46 {
47  EX_MSG_DEBUG( "", "finalize","", "successful" );
48  return StatusCode::SUCCESS;
49 }

◆ handleMaterial() [1/2]

Trk::ExtrapolationCode Trk::MaterialEffectsEngine::handleMaterial ( Trk::ExCellCharged eCell,
Trk::PropDirection  dir = alongMomentum,
Trk::MaterialUpdateStage  matupstage = fullUpdate 
) const
virtual

charged extrapolation

Implements Trk::IMaterialEffectsEngine.

Definition at line 98 of file MaterialEffectsEngine.cxx.

101 {
102 
103  // the Extrapolator made sure that the layer is the lead layer && the parameters are the lead parameters
104  if (eCell.leadLayer && eCell.leadLayer->layerMaterialProperties()){
105  EX_MSG_DEBUG( ++eCell.navigationStep, "layer", eCell.leadLayer->layerIndex().value(), "handleMaterial for charged parameters called.");
106  // update the track parameters
107  eCell.leadParameters = updateTrackParameters(*eCell.leadParameters,eCell,dir,matupstage);
108  }
109  // only in case of post update it should not return InProgress
111 }

◆ handleMaterial() [2/2]

Trk::ExtrapolationCode Trk::MaterialEffectsEngine::handleMaterial ( Trk::ExCellNeutral eCell,
Trk::PropDirection  dir = alongMomentum,
Trk::MaterialUpdateStage  matupstage = fullUpdate 
) const
virtual

neutral extrapolation - only for Fatras, dummy implementation here

neutral extrapolation - just collect material

Implements Trk::IMaterialEffectsEngine.

Definition at line 52 of file MaterialEffectsEngine.cxx.

55 {
56 
57  // the Extrapolator made sure that the layer is the lead layer && the parameters are the lead parameters
58  if (eCell.leadLayer && eCell.leadLayer->layerMaterialProperties()){
59  EX_MSG_DEBUG( ++eCell.navigationStep, "layer", eCell.leadLayer->layerIndex().value(), "handleMaterial for neutral parameters called - collect material.");
60  // now calculate the pathCorrection from the layer surface - it is signed, gives you the relative direction to the layer
61  const Trk::Layer* layer = eCell.leadLayer;
62  // path correction
63  double pathCorrection = layer->surfaceRepresentation().pathCorrection(eCell.leadParameters->position(),dir*(eCell.leadParameters->momentum()));
64  // the relative direction wrt with the layer
65  Trk::PropDirection rlDir = (pathCorrection >= 0. ? Trk::alongMomentum : Trk::oppositeMomentum);
66  // multiply by the pre-and post-update factor
67  double mFactor = layer->layerMaterialProperties()->factor(rlDir, matupstage);
68  if (mFactor == 0.){
69  EX_MSG_VERBOSE(eCell.navigationStep, "layer", layer->layerIndex().value(), "material collection with " << (matupstage > 0. ? "pre " : "post ") << "factor 0.");
70  // return the parameters untouched -
72  }
73  pathCorrection = mFactor*pathCorrection;
74  // screen output
75  EX_MSG_VERBOSE(eCell.navigationStep, "layer", layer->layerIndex().value(), "material update with corr factor = " << pathCorrection);
76  // get the actual material bin
77  const Trk::MaterialProperties* materialProperties = layer->layerMaterialProperties()->fullMaterial(eCell.leadParameters->position());
78  // and let's check if there's acutally something to do
79  if (materialProperties && std::abs(pathCorrection)>0.){
80  // thickness in X0
81  double thicknessInX0 = materialProperties->thicknessInX0();
82  // check if material filling was requested
84  EX_MSG_VERBOSE(eCell.navigationStep, "layer", layer->layerIndex().value(), "collecting material of [t/X0] = " << thicknessInX0);
85  eCell.stepMaterial(eCell.leadParameters->associatedSurface(), layer, eCell.leadParameters->position(), pathCorrection, materialProperties);
86  } else {
87  EX_MSG_VERBOSE(eCell.navigationStep, "layer", layer->layerIndex().value(), "adding material of [t/X0] = " << thicknessInX0);
88  eCell.addMaterial(pathCorrection, materialProperties);
89  }
90  }
91  }
92  // only in case of post update it should not return InProgress
94 }

◆ initialize()

StatusCode Trk::MaterialEffectsEngine::initialize ( )

AlgTool initialize method.

Definition at line 38 of file MaterialEffectsEngine.cxx.

39 {
40  EX_MSG_DEBUG( "", "initialize","", "successful" );
41  return StatusCode::SUCCESS;
42 }

◆ inputHandles()

virtual std::vector<Gaudi::DataHandle*> AthCommonDataStore< AthCommonMsg< AlgTool > >::inputHandles ( ) const
overridevirtualinherited

Return this algorithm's input handles.

We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.

◆ interfaceID()

static const InterfaceID& Trk::IMaterialEffectsEngine::interfaceID ( )
inlinestaticinherited

AlgTool interface methods.

Definition at line 47 of file IMaterialEffectsEngine.h.

47 { return IID_IMaterialEffectsEngine; }

◆ msg() [1/2]

MsgStream& AthCommonMsg< AlgTool >::msg ( ) const
inlineinherited

Definition at line 24 of file AthCommonMsg.h.

24  {
25  return this->msgStream();
26  }

◆ msg() [2/2]

MsgStream& AthCommonMsg< AlgTool >::msg ( const MSG::Level  lvl) const
inlineinherited

Definition at line 27 of file AthCommonMsg.h.

27  {
28  return this->msgStream(lvl);
29  }

◆ msgLvl()

bool AthCommonMsg< AlgTool >::msgLvl ( const MSG::Level  lvl) const
inlineinherited

Definition at line 30 of file AthCommonMsg.h.

30  {
31  return this->msgLevel(lvl);
32  }

◆ outputHandles()

virtual std::vector<Gaudi::DataHandle*> AthCommonDataStore< AthCommonMsg< AlgTool > >::outputHandles ( ) const
overridevirtualinherited

Return this algorithm's output handles.

We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.

◆ renounce()

std::enable_if_t<std::is_void_v<std::result_of_t<decltype(&T::renounce)(T)> > && !std::is_base_of_v<SG::VarHandleKeyArray, T> && std::is_base_of_v<Gaudi::DataHandle, T>, void> AthCommonDataStore< AthCommonMsg< AlgTool > >::renounce ( T &  h)
inlineprotectedinherited

Definition at line 380 of file AthCommonDataStore.h.

381  {
382  h.renounce();
383  PBASE::renounce (h);
384  }

◆ renounceArray()

void AthCommonDataStore< AthCommonMsg< AlgTool > >::renounceArray ( SG::VarHandleKeyArray handlesArray)
inlineprotectedinherited

remove all handles from I/O resolution

Definition at line 364 of file AthCommonDataStore.h.

364  {
365  handlesArray.renounce();
366  }

◆ sysInitialize()

virtual StatusCode AthCommonDataStore< AthCommonMsg< AlgTool > >::sysInitialize ( )
overridevirtualinherited

Perform system initialization for an algorithm.

We override this to declare all the elements of handle key arrays at the end of initialization. See comments on updateVHKA.

Reimplemented in DerivationFramework::CfAthAlgTool, AthCheckedComponent< AthAlgTool >, AthCheckedComponent<::AthAlgTool >, and asg::AsgMetadataTool.

◆ sysStart()

virtual StatusCode AthCommonDataStore< AthCommonMsg< AlgTool > >::sysStart ( )
overridevirtualinherited

Handle START transition.

We override this in order to make sure that conditions handle keys can cache a pointer to the conditions container.

◆ updateTrackParameters()

Trk::TrackParameters * Trk::MaterialEffectsEngine::updateTrackParameters ( Trk::TrackParameters parameters,
Trk::ExCellCharged eCell,
Trk::PropDirection  dir,
Trk::MaterialUpdateStage  matupstage 
) const
protected

charged extrapolation

dE/dl ionization energy loss per path unit

multiple scattering as function of dInX0

Definition at line 114 of file MaterialEffectsEngine.cxx.

118 {
119  // now calculate the pathCorrection from the layer surface - it is signed, gives you the relative direction to the layer
120  const Trk::Layer* layer = eCell.leadLayer;
121  // path correction
122  double pathCorrection = layer->surfaceRepresentation().pathCorrection(parameters.position(),dir*(parameters.momentum()));
123  // the relative direction wrt with the layer
124  Trk::PropDirection rlDir = (pathCorrection >= 0. ? Trk::alongMomentum : Trk::oppositeMomentum);
125  // multiply by the pre-and post-update factor
126  double mFactor = layer->layerMaterialProperties()->factor(rlDir, matupstage);
127  if (mFactor == 0.){
128  EX_MSG_VERBOSE(eCell.navigationStep, "layer", layer->layerIndex().value(), "material update with " << (matupstage > 0. ? "pre " : "post ") << "factor 0. No update done.");
129  // return the parameters untouched -
130  return (&parameters);
131  }
132  pathCorrection = mFactor*pathCorrection;
133  // screen output
134  EX_MSG_VERBOSE(eCell.navigationStep, "layer", layer->layerIndex().value(), "material update with corr factor = " << pathCorrection);
135  // get the actual material bin
136  const Trk::MaterialProperties* materialProperties = layer->layerMaterialProperties()->fullMaterial(parameters.position());
137  // and let's check if there's acutally something to do
138  if (materialProperties && std::abs(pathCorrection)>0. &&
140  // and add them
141  int sign = int(eCell.materialUpdateMode);
142  // a simple cross-check if the parameters are the initial ones
143  AmgVector(5) uParameters = parameters.parameters();
144  std::unique_ptr<AmgSymMatrix(5)> uCovariance =
145  parameters.covariance()
146  ? std::make_unique<AmgSymMatrix(5)>(*parameters.covariance())
147  : nullptr;
148  // get the material itself & its parameters
149  const Trk::Material& material = materialProperties->material();
150  double thicknessInX0 = materialProperties->thicknessInX0();
151  double thickness = materialProperties->thickness();
152  // calculate energy loss and multiple scattering
153  double p = parameters.momentum().mag();
154  double m = Trk::ParticleMasses::mass[eCell.pHypothesis];
155  double E = sqrt(p*p+m*m);
156  double beta = p/E;
157  // (A) - energy loss correction
159  double sigmaP = 0.;
160  double kazl = 0.;
162  double dEdl = sign*dir*Trk::MaterialInteraction::dEdl_ionization(p, material, eCell.pHypothesis, sigmaP, kazl);
163  double dE = thickness*pathCorrection*dEdl;
164  sigmaP *= thickness*pathCorrection;
165  // calcuate the new momentum
166  double newP = sqrt((E+dE)*(E+dE)-m*m);
167  uParameters[Trk::qOverP] = parameters.charge()/newP;
168  double sigmaDeltaE = thickness*pathCorrection*sigmaP;
169  double sigmaQoverP = sigmaDeltaE/std::pow(beta*p,2);
170  // update the covariance if needed
171  if (uCovariance)
172  (*uCovariance)(Trk::qOverP, Trk::qOverP) += sign*sigmaQoverP*sigmaQoverP;
173  }
174  // (B) - update the covariance if needed
175  if (uCovariance && m_mscCorrection){
177  double sigmaMS = Trk::MaterialInteraction::sigmaMS(thicknessInX0*pathCorrection, p, beta);
178  double sinTheta = sin(parameters.parameters()[Trk::theta]);
179  double sigmaDeltaPhiSq = sigmaMS*sigmaMS/(sinTheta*sinTheta);
180  double sigmaDeltaThetaSq = sigmaMS*sigmaMS;
181  // add or remove @TODO implement check for covariance matrix -> 0
182  (*uCovariance)(Trk::phi,Trk::phi) += sign*sigmaDeltaPhiSq;
183  (*uCovariance)(Trk::theta, Trk::theta) += sign*sigmaDeltaThetaSq;
184  }
185  // check if material filling was requested
187  EX_MSG_VERBOSE(eCell.navigationStep, "layer", layer->layerIndex().value(), "collecting material of [t/X0] = " << thicknessInX0);
188  eCell.stepMaterial(parameters.associatedSurface(), layer, parameters.position(), pathCorrection, materialProperties);
189  } else {
190  EX_MSG_VERBOSE(eCell.navigationStep, "layer", layer->layerIndex().value(), "adding material of [t/X0] = " << thicknessInX0);
191  eCell.addMaterial(pathCorrection, materialProperties);
192  }
193  // now either create new ones or update - only start parameters can not be updated
194  if (eCell.leadParameters != eCell.startParameters ){
195  EX_MSG_VERBOSE(eCell.navigationStep, "layer", layer->layerIndex().value(), "material update on non-initial parameters.");
196  if (uCovariance)
197  parameters.updateParameters(uParameters,*uCovariance);
198  else
199  parameters.updateParameters(uParameters);
200  } else {
201  EX_MSG_VERBOSE(eCell.navigationStep, "layer", layer->layerIndex().value(), "material update on initial parameters, creating new ones.");
202  // create new parameters
203  const Trk::Surface& tSurface = parameters.associatedSurface();
204  Trk::TrackParameters* tParameters = tSurface.createUniqueTrackParameters(uParameters[Trk::loc1],
205  uParameters[Trk::loc2],
206  uParameters[Trk::phi],
207  uParameters[Trk::theta],
208  uParameters[Trk::qOverP],
209  *uCovariance).release();
210  // these are newly created
211  return tParameters;
212  }
213  }
214  //note aliasing input ...
215  return (&parameters);
216 }

◆ updateVHKA()

void AthCommonDataStore< AthCommonMsg< AlgTool > >::updateVHKA ( Gaudi::Details::PropertyBase &  )
inlineinherited

Definition at line 308 of file AthCommonDataStore.h.

308  {
309  // debug() << "updateVHKA for property " << p.name() << " " << p.toString()
310  // << " size: " << m_vhka.size() << endmsg;
311  for (auto &a : m_vhka) {
312  std::vector<SG::VarHandleKey*> keys = a->keys();
313  for (auto k : keys) {
314  k->setOwner(this);
315  }
316  }
317  }

Member Data Documentation

◆ m_detStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< AlgTool > >::m_detStore
privateinherited

Pointer to StoreGate (detector store by default)

Definition at line 393 of file AthCommonDataStore.h.

◆ m_eLossCorrection

bool Trk::MaterialEffectsEngine::m_eLossCorrection
protected

apply the energy loss correction

Definition at line 71 of file MaterialEffectsEngine.h.

◆ m_eLossMpv

bool Trk::MaterialEffectsEngine::m_eLossMpv
protected

apply the energy loss correction as most probable value

Definition at line 72 of file MaterialEffectsEngine.h.

◆ m_evtStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< AlgTool > >::m_evtStore
privateinherited

Pointer to StoreGate (event store by default)

Definition at line 390 of file AthCommonDataStore.h.

◆ m_interactionFormulae

MaterialInteraction Trk::MaterialEffectsEngine::m_interactionFormulae
protected

the formulas concentrated

Definition at line 70 of file MaterialEffectsEngine.h.

◆ m_mscCorrection

bool Trk::MaterialEffectsEngine::m_mscCorrection
protected

apply the multiple (coulomb) scattering correction

Definition at line 73 of file MaterialEffectsEngine.h.

◆ m_sopPostfix

std::string Trk::IMaterialEffectsEngine::m_sopPostfix
protectedinherited

prefix for screen output

Definition at line 62 of file IMaterialEffectsEngine.h.

◆ m_sopPrefix

std::string Trk::IMaterialEffectsEngine::m_sopPrefix
protectedinherited

prefix for screen output

Definition at line 61 of file IMaterialEffectsEngine.h.

◆ m_varHandleArraysDeclared

bool AthCommonDataStore< AthCommonMsg< AlgTool > >::m_varHandleArraysDeclared
privateinherited

Definition at line 399 of file AthCommonDataStore.h.

◆ m_vhka

std::vector<SG::VarHandleKeyArray*> AthCommonDataStore< AthCommonMsg< AlgTool > >::m_vhka
privateinherited

Definition at line 398 of file AthCommonDataStore.h.


The documentation for this class was generated from the following files:
Trk::MaterialInteraction::dEdl_ionization
static double dEdl_ionization(double p, const Material &mat, ParticleHypothesis particle, double &sigma, double &kazL)
dE/dl ionization energy loss per path unit
Definition: MaterialInteraction.cxx:117
Trk::MaterialInteraction::sigmaMS
static double sigmaMS(double dInX0, double p, double beta)
multiple scattering as function of dInX0
Definition: MaterialInteraction.cxx:278
python.SystemOfUnits.m
int m
Definition: SystemOfUnits.py:91
ParticleMasses
CaloCellPos2Ntuple.int
int
Definition: CaloCellPos2Ntuple.py:24
Base_Fragment.mass
mass
Definition: Sherpa_i/share/common/Base_Fragment.py:59
make_unique
std::unique_ptr< T > make_unique(Args &&... args)
Definition: SkimmingToolEXOT5.cxx:23
Trk::oppositeMomentum
@ oppositeMomentum
Definition: PropDirection.h:21
AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
Definition: AthCommonDataStore.h:145
Trk::IMaterialEffectsEngine::m_sopPrefix
std::string m_sopPrefix
prefix for screen output
Definition: IMaterialEffectsEngine.h:61
Trk::ExtrapolationCell::pHypothesis
ParticleHypothesis pHypothesis
what particle hypothesis to be used, default : pion
Definition: ExtrapolationCell.h:279
Trk::MaterialProperties::thicknessInX0
float thicknessInX0() const
Return the radiationlength fraction.
AthCommonDataStore< AthCommonMsg< AlgTool > >::m_evtStore
StoreGateSvc_t m_evtStore
Pointer to StoreGate (event store by default)
Definition: AthCommonDataStore.h:390
AthCommonDataStore< AthCommonMsg< AlgTool > >::m_vhka
std::vector< SG::VarHandleKeyArray * > m_vhka
Definition: AthCommonDataStore.h:398
Trk::loc2
@ loc2
generic first and second local coordinate
Definition: ParamDefs.h:35
Trk::ExtrapolationCell::stepMaterial
void stepMaterial(const Surface &sf, const Layer *lay, const Amg::Vector3D &position, double sfactor, const MaterialProperties *mprop=nullptr)
fill or attach material, jacobian, step length
Definition: ExtrapolationCell.h:637
Trk::alongMomentum
@ alongMomentum
Definition: PropDirection.h:20
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
const
bool const RAWDATA *ch2 const
Definition: LArRodBlockPhysicsV0.cxx:560
Trk::MaterialEffectsEngine::updateTrackParameters
TrackParameters * updateTrackParameters(Trk::TrackParameters &parameters, Trk::ExCellCharged &eCell, Trk::PropDirection dir, Trk::MaterialUpdateStage matupstage) const
charged extrapolation
Definition: MaterialEffectsEngine.cxx:114
Trk::ExtrapolationCell::leadLayer
const Layer * leadLayer
the lead Layer - carrying the navigation stream
Definition: ExtrapolationCell.h:249
SG::VarHandleKeyArray::setOwner
virtual void setOwner(IDataHandleHolder *o)=0
IDTPMcnv.htype
htype
Definition: IDTPMcnv.py:29
Trk::MaterialEffectsEngine::m_mscCorrection
bool m_mscCorrection
apply the multiple (coulomb) scattering correction
Definition: MaterialEffectsEngine.h:73
Trk::AmgSymMatrix
AmgSymMatrix(5) &GXFTrackState
Definition: GXFTrackState.h:156
Trk::ExtrapolationCell::navigationStep
int navigationStep
a counter of the navigation Step
Definition: ExtrapolationCell.h:268
Trk::PropDirection
PropDirection
Definition: PropDirection.h:19
python.utils.AtlRunQueryDQUtils.p
p
Definition: AtlRunQueryDQUtils.py:210
AthCommonDataStore
Definition: AthCommonDataStore.h:52
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
ParticleGun_EoverP_Config.momentum
momentum
Definition: ParticleGun_EoverP_Config.py:63
Trk::Surface::createUniqueTrackParameters
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.
beamspotman.n
n
Definition: beamspotman.py:731
Trk::theta
@ theta
Definition: ParamDefs.h:66
AmgVector
AmgVector(4) T2BSTrackFilterTool
Definition: T2BSTrackFilterTool.cxx:114
TRT::Hit::layer
@ layer
Definition: HitInfo.h:79
sign
int sign(int a)
Definition: TRT_StrawNeighbourSvc.h:107
AthCommonDataStore< AthCommonMsg< AlgTool > >::m_detStore
StoreGateSvc_t m_detStore
Pointer to StoreGate (detector store by default)
Definition: AthCommonDataStore.h:393
Trk::ParametersBase
Definition: ParametersBase.h:55
Trk::ExtrapolationCell::startParameters
T * startParameters
by reference - need to be defined
Definition: ExtrapolationCell.h:233
Trk::LayerIndex::value
int value() const
layerIndex expressed in an integer
Definition: LayerIndex.h:71
AthAlgTool::AthAlgTool
AthAlgTool()
Default constructor:
Trk::ExtrapolationCell::checkConfigurationMode
bool checkConfigurationMode(ExtrapolationMode::eMode em) const
check the configuration mode
Definition: ExtrapolationCell.h:352
beamspotman.dir
string dir
Definition: beamspotman.py:623
SG::VarHandleKeyArray::renounce
virtual void renounce()=0
SG::HandleClassifier::type
std::conditional< std::is_base_of< SG::VarHandleKeyArray, T >::value, VarHandleKeyArrayType, type2 >::type type
Definition: HandleClassifier.h:54
Trk
Ensure that the ATLAS eigen extensions are properly loaded.
Definition: FakeTrackBuilder.h:9
Trk::ExtrapolationCell::materialUpdateMode
MaterialUpdateMode materialUpdateMode
how to deal with the material effect, default: addNoise
Definition: ExtrapolationCell.h:282
merge_scale_histograms.doc
string doc
Definition: merge_scale_histograms.py:9
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:228
Trk::IMaterialEffectsEngine::m_sopPostfix
std::string m_sopPostfix
prefix for screen output
Definition: IMaterialEffectsEngine.h:62
VP1PartSpect::E
@ E
Definition: VP1PartSpectFlags.h:21
Trk::ExtrapolationMode::CollectMaterial
@ CollectMaterial
Definition: ExtrapolationCell.h:59
EX_MSG_DEBUG
#define EX_MSG_DEBUG(navstep, step, idx, x)
Definition: ExtrapolationMacros.h:13
EX_MSG_VERBOSE
#define EX_MSG_VERBOSE(navstep, step, idx, x)
Definition: ExtrapolationMacros.h:14
Trk::MaterialProperties
Definition: MaterialProperties.h:40
Trk::ExtrapolationCell::addMaterial
void addMaterial(double sfactor, const MaterialProperties *mprop=nullptr)
fill or attach material, jacobian, step length
Definition: ExtrapolationCell.h:606
a
TList * a
Definition: liststreamerinfos.cxx:10
Trk::ExtrapolationCell::leadParameters
T * leadParameters
the one last truely valid parameter in the stream
Definition: ExtrapolationCell.h:246
Trk::MaterialEffectsEngine::m_eLossCorrection
bool m_eLossCorrection
apply the energy loss correction
Definition: MaterialEffectsEngine.h:71
h
Trk::qOverP
@ qOverP
perigee
Definition: ParamDefs.h:67
if
if(febId1==febId2)
Definition: LArRodBlockPhysicsV0.cxx:567
Trk::Layer::layerMaterialProperties
const LayerMaterialProperties * layerMaterialProperties() const
getting the LayerMaterialProperties including full/pre/post update
SG::VarHandleBase::vhKey
SG::VarHandleKey & vhKey()
Return a non-const reference to the HandleKey.
Definition: StoreGate/src/VarHandleBase.cxx:623
physics_parameters.parameters
parameters
Definition: physics_parameters.py:144
Trk::phi
@ phi
Definition: ParamDefs.h:75
python.Bindings.keys
keys
Definition: Control/AthenaPython/python/Bindings.py:798
drawFromPickle.sin
sin
Definition: drawFromPickle.py:36
MuonParameters::beta
@ beta
Definition: MuonParamDefs.h:144
Trk::loc1
@ loc1
Definition: ParamDefs.h:34
Trk::Surface
Definition: Tracking/TrkDetDescr/TrkSurfaces/TrkSurfaces/Surface.h:75
pow
constexpr int pow(int base, int exp) noexcept
Definition: ap_fixedTest.cxx:15
Material
@ Material
Definition: MaterialTypes.h:8
AthCommonDataStore::declareGaudiProperty
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>
Definition: AthCommonDataStore.h:156
mag
Scalar mag() const
mag method
Definition: AmgMatrixBasePlugin.h:26
Trk::MaterialEffectsEngine::m_eLossMpv
bool m_eLossMpv
apply the energy loss correction as most probable value
Definition: MaterialEffectsEngine.h:72
fitman.k
k
Definition: fitman.py:528
Trk::ExtrapolationCode::InProgress
@ InProgress
Definition: ExtrapolationCell.h:111
Trk::Layer
Definition: Layer.h:73
Trk::Layer::layerIndex
const LayerIndex & layerIndex() const
get the layerIndex