Loading [MathJax]/extensions/tex2jax.js
ATLAS Offline Software
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
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...
 
BooleanProperty m_eLossCorrection
 
BooleanProperty m_eLossMpv
 
BooleanProperty m_mscCorrection
 
StringProperty m_sopPrefix_prop {this, "OutputPrefix", ""}
 
StringProperty m_sopPostfix_prop {this, "OutputPostfix", ""}
 
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 {
19  declareInterface<Trk::IMaterialEffectsEngine>(this);
20 }

◆ ~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 38 of file MaterialEffectsEngine.cxx.

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

◆ 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 91 of file MaterialEffectsEngine.cxx.

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

◆ 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 45 of file MaterialEffectsEngine.cxx.

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

◆ initialize()

StatusCode Trk::MaterialEffectsEngine::initialize ( )

AlgTool initialize method.

Definition at line 28 of file MaterialEffectsEngine.cxx.

29 {
32 
33  EX_MSG_DEBUG( "", "initialize","", "successful" );
34  return StatusCode::SUCCESS;
35 }

◆ 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 107 of file MaterialEffectsEngine.cxx.

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

◆ 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

BooleanProperty Trk::MaterialEffectsEngine::m_eLossCorrection
protected
Initial value:
{this, "EnergyLossCorrection", true,
"apply the energy loss correction"}

Definition at line 71 of file MaterialEffectsEngine.h.

◆ m_eLossMpv

BooleanProperty Trk::MaterialEffectsEngine::m_eLossMpv
protected
Initial value:
{this, "MostProbableEnergyLoss", true,
"apply the energy loss correction as most probable value"}

Definition at line 73 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

BooleanProperty Trk::MaterialEffectsEngine::m_mscCorrection
protected
Initial value:
{this, "MultipleScatteringCorrection", true,
"apply the multiple (coulomb) scattering correction"}

Definition at line 75 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_sopPostfix_prop

StringProperty Trk::MaterialEffectsEngine::m_sopPostfix_prop {this, "OutputPostfix", ""}
protected

Definition at line 79 of file MaterialEffectsEngine.h.

◆ m_sopPrefix

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

prefix for screen output

Definition at line 61 of file IMaterialEffectsEngine.h.

◆ m_sopPrefix_prop

StringProperty Trk::MaterialEffectsEngine::m_sopPrefix_prop {this, "OutputPrefix", ""}
protected

Definition at line 78 of file MaterialEffectsEngine.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
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::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::MaterialEffectsEngine::m_sopPrefix_prop
StringProperty m_sopPrefix_prop
Definition: MaterialEffectsEngine.h:78
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:107
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::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
python.LArMinBiasAlgConfig.int
int
Definition: LArMinBiasAlgConfig.py:59
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
Trk::MaterialEffectsEngine::m_sopPostfix_prop
StringProperty m_sopPostfix_prop
Definition: MaterialEffectsEngine.h:79
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
h
Trk::MaterialEffectsEngine::m_eLossCorrection
BooleanProperty m_eLossCorrection
Definition: MaterialEffectsEngine.h:71
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:629
Trk::MaterialEffectsEngine::m_mscCorrection
BooleanProperty m_mscCorrection
Definition: MaterialEffectsEngine.h:75
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
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