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

#include <MaterialMapping.h>

Inheritance diagram for Trk::MaterialMapping:
Collaboration diagram for Trk::MaterialMapping:

Public Member Functions

 MaterialMapping (const std::string &name, ISvcLocator *pSvcLocator)
 Standard Athena-Algorithm Constructor. More...
 
 ~MaterialMapping ()
 Default Destructor. More...
 
StatusCode initialize ()
 standard Athena-Algorithm method More...
 
StatusCode execute ()
 standard Athena-Algorithm method More...
 
StatusCode finalize ()
 standard Athena-Algorithm method More...
 
virtual StatusCode sysInitialize () override
 Override sysInitialize. More...
 
virtual const DataObjIDColl & extraOutputDeps () const override
 Return the list of extra output dependencies. 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 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
 

Protected Member Functions

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...
 

Private Types

typedef ServiceHandle< StoreGateSvcStoreGateSvc_t
 

Private Member Functions

bool associateHit (const Trk::Layer &tvol, const Amg::Vector3D &pos, const Amg::Vector3D &layerHitPosition, double stepl, const Trk::Material &mat)
 Associate the Step to the Layer. More...
 
void registerVolume (const Trk::TrackingVolume &tvol, int lvl)
 Output information with Level. More...
 
void assignLayerMaterialProperties (Trk::TrackingVolume &tvol, Trk::LayerMaterialMap *propSet)
 create the LayerMaterialRecord *‍/ More...
 
void insertLayerMaterialRecord (const Trk::Layer &lay)
 
StatusCode handleTrackingGeometry ()
 Retrieve the TrackingGeometry and its informations. More...
 
const TrackingGeometrytrackingGeometry () const
 
void throwFailedToGetTrackingGeometry () const
 
const TrackingGeometryretrieveTrackingGeometry (const EventContext &ctx) const
 
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

bool m_checkForEmptyHits
 use extrapoaltion engine to check for empty hits More...
 
ToolHandle< IExtrapolationEnginem_extrapolationEngine
 
std::string m_mappingVolumeName
 
const Trk::TrackingVolumem_mappingVolume
 
SG::ReadHandleKey< MaterialStepCollectionm_inputMaterialStepCollection
 output / input steering More...
 
std::string m_outputLayerMaterialSetName
 
double m_etaCutOff
 general steering More...
 
int m_etaSide
 needed for debugging: -1 negative | 0 all | 1 positive More...
 
bool m_useLayerThickness
 use the actual layer thickness More...
 
int m_associationType
 
ToolHandle< ILayerMaterialAnalyserm_layerMaterialRecordAnalyser
 
ToolHandleArray< ILayerMaterialAnalyserm_layerMaterialAnalysers
 
ToolHandleArray< ILayerMaterialCreatorm_layerMaterialCreators
 
bool m_mapMaterial
 Mapper and Inspector. More...
 
ToolHandle< IMaterialMapperm_materialMapper
 
bool m_mapComposition
 map the composition of the material More...
 
double m_minCompositionFraction
 minimal fraction to be accounted for the composition recording More...
 
Trk::ElementTablem_elementTable
 the accumulated element table More...
 
SG::ReadHandleKey< Trk::ElementTablem_inputEventElementTable
 input event table More...
 
std::map< const Layer *, LayerMaterialRecordm_layerRecords
 this is the general record for the search More...
 
std::map< const Layer *, bool > m_layersRecordedPerEvent
 these are the layers hit per event - for empty hit scaling More...
 
double m_accumulatedMaterialXX0
 the accumulated material information More...
 
double m_accumulatedRhoS
 
size_t m_mapped
 
size_t m_unmapped
 
size_t m_skippedOutside
 
int m_layerMaterialScreenOutput
 
SG::ReadCondHandleKey< TrackingGeometrym_trackingGeometryReadKey
 
DataObjIDColl m_extendedExtraObjects
 
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

A simple algorithm that throws random points through detector and associates them with the given/found layer.

Author
Andre.nosp@m.as.S.nosp@m.alzbu.nosp@m.rger.nosp@m.@cern.nosp@m..ch

Definition at line 72 of file MaterialMapping.h.

Member Typedef Documentation

◆ StoreGateSvc_t

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

Definition at line 388 of file AthCommonDataStore.h.

Constructor & Destructor Documentation

◆ MaterialMapping()

Trk::MaterialMapping::MaterialMapping ( const std::string &  name,
ISvcLocator *  pSvcLocator 
)

Standard Athena-Algorithm Constructor.

Definition at line 36 of file MaterialMapping.cxx.

37 : AthAlgorithm(name,pSvcLocator),
38  m_checkForEmptyHits(true),
39  m_mappingVolumeName("Atlas"),
40  m_mappingVolume(nullptr),
41  m_inputMaterialStepCollection("MaterialStepRecords"),
42  m_etaCutOff(6.0),
43  m_etaSide(0),
44  m_useLayerThickness(false),
46  m_mapMaterial(true),
47  m_mapComposition(false),
49  m_elementTable(nullptr),
50  m_inputEventElementTable("ElementTable"),
53  m_mapped(0),
54  m_unmapped(0),
57 #ifdef TRKDETDESCR_MEMUSAGE
58  ,m_memoryLogger()
59 #endif
60 {
61  // the name of the volume to map
62  declareProperty("MappingVolumeName" , m_mappingVolumeName);
63  // the extrapolation engine
64  declareProperty("CheckForEmptyHits" , m_checkForEmptyHits);
65  // general steering
66  declareProperty("EtaCutOff" , m_etaCutOff);
67  declareProperty("EtaSide" , m_etaSide);
68  // the toolhandle of the MaterialMapper to be used
69  declareProperty("MapMaterial" , m_mapMaterial);
70  // Composition related parameters
71  declareProperty("MapComposition" , m_mapComposition);
72  declareProperty("MinCompositionFraction" , m_minCompositionFraction);
73  // Steer the layer thickness
74  declareProperty("UseActualLayerThicknesss" , m_useLayerThickness);
75  // some job setup
76  declareProperty("MaterialAssociationType" , m_associationType);
77  declareProperty("InputMaterialStepCollection" , m_inputMaterialStepCollection);
78  declareProperty("InputElementTable" , m_inputEventElementTable);
79  // Output screen stuff
80  declareProperty("MaterialScreenOutputLevel" , m_layerMaterialScreenOutput);
81 
82 }

◆ ~MaterialMapping()

Trk::MaterialMapping::~MaterialMapping ( )
default

Default Destructor.

Member Function Documentation

◆ assignLayerMaterialProperties()

void Trk::MaterialMapping::assignLayerMaterialProperties ( Trk::TrackingVolume tvol,
Trk::LayerMaterialMap propSet 
)
private

create the LayerMaterialRecord *‍/

Definition at line 356 of file MaterialMapping.cxx.

358 {
359 
360  if (!propSet) return;
361 
362  ATH_MSG_INFO("Processing TrackingVolume: "<< tvol.volumeName() );
363 
364  // ----------------------------------- loop over confined layers ------------------------------------------
365  Trk::BinnedArray< Trk::Layer >* confinedLayers = tvol.confinedLayers();
366  if (confinedLayers) {
367  // get the objects in a vector-like format
369  ATH_MSG_INFO("--> found : "<< layers.size() << "confined Layers");
370  // the iterator over the vector
371  // loop over layers
372  for (Trk::Layer* layer : layers) {
373  // assign the material and output
374  if (layer && (*layer).layerIndex().value() ) {
375  ATH_MSG_INFO(" > LayerIndex: "<< (*layer).layerIndex() );
376  // set the material!
377  if (propSet) {
378  // find the pair
379  auto curIt = propSet->find((*layer).layerIndex());
380  if (curIt != propSet->end()) {
381  ATH_MSG_INFO("LayerMaterial assigned for Layer with index: "<< (*layer).layerIndex() );
382  // set it to the layer
383  layer->assignMaterialProperties(*((*curIt).second), 1.);
384  }
385  }
386  }
387  }
388  }
389 
390  // ----------------------------------- loop over confined volumes -----------------------------
392  if (confinedVolumes) {
393  // get the objects in a vector-like format
395  ATH_MSG_INFO("--> found : "<< volumes.size() << "confined TrackingVolumes");
396  // loop over volumes
397  for (const auto & volume : volumes) {
398  // assing the material and output
399  if (volume)
400  assignLayerMaterialProperties(*volume, propSet); // call itself recursively
401  }
402  }
403 }

◆ associateHit()

bool Trk::MaterialMapping::associateHit ( const Trk::Layer tvol,
const Amg::Vector3D pos,
const Amg::Vector3D layerHitPosition,
double  stepl,
const Trk::Material mat 
)
private

Associate the Step to the Layer.

Definition at line 311 of file MaterialMapping.cxx.

316 {
317  // get the intersection with the layer
318  ++m_mapped;
319  // get the layer
320  const Trk::Layer* layer = &associatedLayer;
321 
322  // get the associated volume
323  const Trk::TrackingVolume* associatedVolume = trackingGeometry().lowestTrackingVolume(pos);
324 
325  // try to find the layer material record
326  auto clIter = m_layerRecords.find(layer);
327  if (clIter != m_layerRecords.end() ){
328  // remember that you actually hit this layer
330  // LayerMaterialRecord found, add the hit
331  (*clIter).second.associateGeantinoHit(positionOnLayer, stepl, mat);
332  ATH_MSG_VERBOSE("- associate Geantino Information at intersection [r/z] = " << positionOnLayer.perp() << "/"<< positionOnLayer.z() );
333  ATH_MSG_VERBOSE(" mapping distance = " << (pos-positionOnLayer).mag() );
334  ATH_MSG_VERBOSE("- associate Geantino Information ( s, s/x0 , x0 , l0, a, z, rho ) = "
335  << stepl << ", "<< stepl/mat.X0 << ", "<< mat.X0 << ", "<< mat.L0 << ", "<< mat.A << ", "<< mat.Z << ", "<< mat.rho );
336  m_accumulatedMaterialXX0 += stepl/mat.X0;
337  m_accumulatedRhoS += stepl*mat.rho;
338  ATH_MSG_VERBOSE("- accumulated material information X/x0 = " << m_accumulatedMaterialXX0);
339  ATH_MSG_VERBOSE("- accumulated effective densitity rho*s = " << m_accumulatedRhoS);
340  ATH_MSG_VERBOSE("- to layer with index "<< layer->layerIndex().value() << " from '"<< associatedVolume->volumeName() << "'.");
341  // record the plain information w/o correction & intersection
342  if (m_mapMaterial && !m_materialMapper.empty()){
343  Trk::AssociatedMaterial am(pos, stepl, mat, 1., associatedVolume, layer);
344  m_materialMapper->recordMaterialHit(am, positionOnLayer);
345  ATH_MSG_VERBOSE(" - associated material produced as : " << am);
346  }
347 
348  } else if (layer) {
349  ATH_MSG_WARNING("- associate hit - the layer with index " << layer->layerIndex().value() << " was not found - should not happen!");
350  }
351  // return
352  return true;
353 }

◆ declareGaudiProperty() [1/4]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< Algorithm > >::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< Algorithm > >::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< Algorithm > >::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< Algorithm > >::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< Algorithm > >::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< Algorithm > >::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< Algorithm > >::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< Algorithm > >::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< Algorithm > >::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< Algorithm > >::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< Algorithm > >::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< Algorithm > >::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< Algorithm > >::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; }

◆ execute()

StatusCode Trk::MaterialMapping::execute ( )

standard Athena-Algorithm method

Definition at line 116 of file MaterialMapping.cxx.

117 {
118  ATH_MSG_VERBOSE("MaterialMapping execute() start");
119 
120  // ------------------------------- get the trackingGeometry at first place
121  if (!m_mappingVolume) {
122  StatusCode retrieveCode = handleTrackingGeometry();
123  if (retrieveCode.isFailure()){
124  ATH_MSG_INFO("Could not retrieve mapping volume from tracking geometry. Exiting.");
125  return retrieveCode;
126  }
127  }
128  if (m_mappingVolume)
129  ATH_MSG_VERBOSE("Mapping volume correctly retrieved from tracking geometry");
130 
131 
133 
134  // --------- prepare the element table ---------------------------------------------------
135 
136  if (m_mapComposition) {
138  (*m_elementTable) += (*eTableEvent); // accummulate the table
139  }
140 
141 
142  // event parameters - associated asteps, and layers hit per event
143  int associatedSteps = 0;
145  m_accumulatedRhoS = 0.;
146  m_layersRecordedPerEvent.clear();
147  // clearing the recorded layers per event
148  if (materialStepCollection.isValid() && !materialStepCollection->empty()){
149 
150  // get the number of material steps
151  size_t materialSteps = materialStepCollection->size();
152  ATH_MSG_DEBUG("[+] Successfully read "<< materialSteps << " geantino steps");
153 
154  // create a direction out of the last material step
155  double dirx = (*materialStepCollection)[materialSteps-1]->hitX();
156  double diry = (*materialStepCollection)[materialSteps-1]->hitY();
157  double dirz = (*materialStepCollection)[materialSteps-1]->hitZ();
158  Amg::Vector3D direction = Amg::Vector3D(dirx,diry,dirz).unit();
159 
160  double eta = direction.eta();
161  // skip the event if the eta cut is not met
162  if ( fabs(eta) > m_etaCutOff || (m_etaSide && m_etaSide*eta < 0.) ) {
163  ATH_MSG_VERBOSE("[-] Event is outside eta acceptance of " << m_etaCutOff << ". Skipping it.");
164  return StatusCode::SUCCESS;
165  }
166 
167  // now propagate through the full detector and collect the layers
168  Trk::NeutralCurvilinearParameters ncP(Amg::Vector3D(0.,0.,0.), direction, 0.);
169  // create a neutral extrapolation cell
171  ecc.navigationCurvilinear = false;
172  ecc.addConfigurationMode(Trk::ExtrapolationMode::StopAtBoundary);
173  ecc.addConfigurationMode(Trk::ExtrapolationMode::CollectPassive);
174  ecc.addConfigurationMode(Trk::ExtrapolationMode::CollectBoundary);
175 
176  // let's extrapolate through the detector and remember which layers (with material) should have been hit
177  std::vector< std::pair<const Trk::Layer*, Amg::Vector3D> > layersAndHits;
178  // call the extrapolation engine
179  Trk::ExtrapolationCode eCode = m_extrapolationEngine->extrapolate(ecc);
180  // end the parameters if there
181  if (eCode.isSuccess()){
182  // name of passive surfaces found
183  size_t nLayersHit = ecc.extrapolationSteps.size();
184  ATH_MSG_VERBOSE("[+] Extrapolation to layers did succeed and found " << nLayersHit << " layers.");
185  // reserve the size of the vectors
186  layersAndHits.reserve(nLayersHit);
187  // for screen output
188  size_t ilayer = 0;
189  // find all the intersected material - remember the last parameters
190  const Trk::NeutralParameters* parameters = nullptr;
191  // loop over the collected information
192  for (auto& es : ecc.extrapolationSteps){
193  // continue if we have parameters
194  parameters = es.parameters;
195  if (parameters){
196  const Trk::Surface& pSurface = parameters->associatedSurface();
197  // get the surface with associated layer (that has material)
198  ATH_MSG_VERBOSE("[L] Testing layer with associatedLayer() " << pSurface.associatedLayer() << " and materialLayer() " << pSurface.materialLayer() );
199  //
200  if ( ( pSurface.associatedLayer() && pSurface.associatedLayer()->layerMaterialProperties() ) || pSurface.materialLayer() ){
201  // material layer
202  const Trk::Layer* mLayer = pSurface.materialLayer() ? pSurface.materialLayer() : pSurface.associatedLayer();
203  // record that one
204  std::pair<const Trk::Layer*, Amg::Vector3D> layerHitPair(mLayer, parameters->position());
205  ATH_MSG_VERBOSE("[L] Layer " << ++ilayer << " with index " << mLayer->layerIndex().value() << " hit at " << Amg::toString(parameters->position()));
206  layersAndHits.push_back(layerHitPair);
207  }
208  delete parameters;
209  }
210  }
211  // cleanup of the final hits
212  if (ecc.endParameters != parameters) delete ecc.endParameters;
213 
214  // we have no layers and Hits
215  if (layersAndHits.empty()){
216  ATH_MSG_VERBOSE("[!] No Layer was intersected - skipping.");
217  return StatusCode::SUCCESS;
218  }
219 
220  // layers are ordered, hence you can move the starting point along
221  size_t currentLayer = 0;
222  // loop through hits and find the closest layer, the start point moves outwards as we go
223  for ( const Trk::MaterialStep* step : *materialStepCollection ) {
224  // verbose output
225  ATH_MSG_VERBOSE("[L] starting from layer " << currentLayer << " from layer collection for this step.");
226  // step length and position
227  double t = step->steplength();
228  Amg::Vector3D pos(step->hitX(), step->hitY(), step->hitZ());
229  // skip if :
230  // -- 0) no mapping volume exists
231  // -- 1) outside the mapping volume
232  // -- 2) outside the eta acceptance
233  if (!m_mappingVolume || !(m_mappingVolume->inside(pos)) || fabs(pos.eta()) > m_etaCutOff ){
235  continue;
236  }
237  // now find the closest layer
238  // (a) if the currentLayer is the last layer and the hit is still inside -> assign
239  if (currentLayer < nLayersHit-1) {
240  // search through the layers - this is the reference distance for projection
241  double currentDistance = (pos-layersAndHits[currentLayer].second).mag();
242  ATH_MSG_VERBOSE("- current distance is " << currentDistance << " from " << Amg::toString(pos) << " and " << Amg::toString(layersAndHits[currentLayer].second) );
243  for (size_t testLayer = (currentLayer+1); testLayer < nLayersHit; ++testLayer){
244  // calculate teh distance to the testLayer
245  double testDistance = (pos-layersAndHits[testLayer].second).mag();
246  ATH_MSG_VERBOSE("[L] Testing layer " << testLayer << " from layer collection for this step.");
247  ATH_MSG_VERBOSE("- test distance is " << testDistance << " from " << Amg::toString(pos) << " and " << Amg::toString(layersAndHits[testLayer].second) );
248  if ( testDistance < currentDistance ){
249  // screen output
250  ATH_MSG_VERBOSE("[L] Skipping over to current layer " << testLayer << " because " << testDistance << " < " << currentDistance);
251  // the test distance did shrink - update currentLayer
252  currentLayer = testLayer;
253  currentDistance = testDistance;
254  } else {
255  // stick to the layer you have
256  break;
257  }
258  }
259  }
260  // the currentLayer *should* be correct now
261  const Trk::Layer* assignedLayer = layersAndHits[currentLayer].first;
262  Amg::Vector3D assignedPosition = layersAndHits[currentLayer].second;
263  // associate the hit
264  // (1) count it
265  ++associatedSteps;
266  // (2) associate it
267  associateHit(*assignedLayer, pos, assignedPosition, t, step->fullMaterial());
268  } // loop over material Steps
269 
270  // check for the empty hits - they need to be taken into account
271  ATH_MSG_VERBOSE("Found " << layersAndHits.size() << " intersected layers - while having " << m_layersRecordedPerEvent.size() << " recorded ones.");
272 
273  // now - cross-chek if you have additional layers
274  for ( auto& lhp : layersAndHits){
275  // check if you find the layer int he already done record-map : not found - we need to do an empty hit scaling
276  if (m_layersRecordedPerEvent.find(lhp.first) == m_layersRecordedPerEvent.end()){
277  // try to find the layer material record
278  auto clIter = m_layerRecords.find(lhp.first);
279  if (clIter != m_layerRecords.end() ){
280  (*clIter).second.associateEmptyHit(lhp.second);
281  ATH_MSG_VERBOSE("- to layer with index "<< lhp.first->layerIndex().value() << " with empty hit detected.");
282  } else
283  ATH_MSG_WARNING("- no Layer found in the associated map! Should not happen.");
284  }
285  }
286 
287  // check whether the event was good for at least one hit
288  if (associatedSteps) {
289  ATH_MSG_VERBOSE("There are associated steps, need to call finalizeEvent() & record to the MaterialMapper.");
290  // finalize the event --------------------- Layers ---------------------------------------------
291  for (auto& lRecord : m_layerRecords ) {
292  // associated material
293  Trk::AssociatedMaterial* assMatHit = lRecord.second.finalizeEvent((*lRecord.first));
294  // record the full layer hit
295  if (assMatHit && !m_materialMapper.empty()) m_materialMapper->recordLayerHit(*assMatHit, true);
296  delete assMatHit;
297  // call the material mapper finalize method
298  ATH_MSG_VERBOSE("Calling finalizeEvent on the MaterialMapper ...");
299  }
300  } // the event had at least one associated hit
301 
302  } // end of eCode.success : needed for new mapping schema
303 
304  } // material steps existed
305 
306 
307  return StatusCode::SUCCESS;
308 }

◆ extraDeps_update_handler()

void AthCommonDataStore< AthCommonMsg< Algorithm > >::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

◆ extraOutputDeps()

const DataObjIDColl & AthAlgorithm::extraOutputDeps ( ) const
overridevirtualinherited

Return the list of extra output dependencies.

This list is extended to include symlinks implied by inheritance relations.

Definition at line 50 of file AthAlgorithm.cxx.

51 {
52  // If we didn't find any symlinks to add, just return the collection
53  // from the base class. Otherwise, return the extended collection.
54  if (!m_extendedExtraObjects.empty()) {
56  }
57  return Algorithm::extraOutputDeps();
58 }

◆ finalize()

StatusCode Trk::MaterialMapping::finalize ( )

standard Athena-Algorithm method

Definition at line 406 of file MaterialMapping.cxx.

407 {
408 
409  ATH_MSG_INFO("========================================================================================= ");
410  ATH_MSG_INFO("finalize() starts ...");
411 
412 #ifdef TRKDETDESCR_MEMUSAGE
413  m_memoryLogger.refresh(getpid());
414  ATH_MSG_INFO("[ memory usage ] Start building of material maps: " );
415  ATH_MSG_INFO( m_memoryLogger );
416 #endif
417 
418  // create a dedicated LayerMaterialMap by layerMaterialCreator;
419  std::map< std::string, Trk::LayerMaterialMap* > layerMaterialMaps;
420  for ( auto& lmcIter : m_layerMaterialCreators ){
421  ATH_MSG_INFO("-> Creating material map '"<< lmcIter->layerMaterialName() << "' from creator "<< lmcIter.typeAndName() );
422  layerMaterialMaps[lmcIter->layerMaterialName()] = new Trk::LayerMaterialMap();
423  }
424 
425  ATH_MSG_INFO( m_layerRecords.size() << " LayerMaterialRecords to be finalized for this material mapping run.");
426 
427  // loop over the layers and output the stuff --- fill the associatedLayerMaterialProperties
428  for ( auto& lIter : m_layerRecords ) {
429  // Get the key map, the layer & the volume name
430  const Trk::Layer* layer = lIter.first;
431  Trk::LayerIndex layerKey = layer->layerIndex();
432  // get the enclosing tracking volume
433  const Trk::TrackingVolume* eVolume = layer->enclosingTrackingVolume();
434  // assign the string
435  std::string vName = eVolume ? (eVolume->volumeName()) : " BoundaryCollection ";
436  ATH_MSG_INFO("Finalize MaterialAssociation for Layer "<< layerKey.value() << " in " << vName );
437  // normalize - use m_finalizeRunDebug
438  (lIter.second).finalizeRun(m_mapComposition);
439  // output the material to the analyser if registered
440  if (!m_layerMaterialRecordAnalyser.empty() && m_layerMaterialRecordAnalyser->analyseLayerMaterial(*layer, lIter.second).isFailure() )
441  ATH_MSG_WARNING("Could not analyse the LayerMaterialRecord for layer "<< layerKey.value() );
442  // check if we have analysers per creator
443  bool analyse = (m_layerMaterialCreators.size() == m_layerMaterialAnalysers.size());
444  // and now use the creators to make the maps out of the LayerMaterialRecord
445  size_t ilmc = 0;
446  for ( auto& lmcIter : m_layerMaterialCreators ){
447  // call the creator and register in the according map
448 #ifdef TRKDETDESCR_MEMUSAGE
449  m_memoryLogger.refresh(getpid());
450  ATH_MSG_INFO("[ memory usage ] Before building the map for Layer "<< layerKey.value() );
451  ATH_MSG_INFO( m_memoryLogger );
452 #endif
453  const Trk::LayerMaterialProperties* lMaterial = lmcIter->createLayerMaterial(lIter.second);
454 #ifdef TRKDETDESCR_MEMUSAGE
455  m_memoryLogger.refresh(getpid());
456  ATH_MSG_INFO("[ memory usage ] After building the map for Layer "<< layerKey.value() );
457  ATH_MSG_INFO( m_memoryLogger );
458 #endif
459  if (lMaterial)
460  ATH_MSG_VERBOSE("LayerMaterial map created as "<< *lMaterial );
461  // insert the created map for the given layer
462  (*layerMaterialMaps[lmcIter->layerMaterialName()])[layerKey.value()] = lMaterial;
463  // analyse the it if configured
464  if (analyse && lMaterial && (m_layerMaterialAnalysers[ilmc]->analyseLayerMaterial(*layer, *lMaterial)).isFailure() )
465  ATH_MSG_WARNING("Could not analyse created LayerMaterialProperties for layer "<< layerKey.value() );
466  ++ilmc;
467  }
468  }
469 
470  ATH_MSG_INFO("Finalize map synchronization and write the maps to the DetectorStore.");
471 
472  for (auto& ilmIter : layerMaterialMaps ){
473  // elementTable handling - if existent
474  if (m_mapComposition){
476  ilmIter.second->updateElementTable(tElementTable);
477  if (ilmIter.second->elementTable()){
478  ATH_MSG_INFO("ElementTable for LayerMaterialMap '" << ilmIter.first << "' found and syncrhonized." );
479  ATH_MSG_INFO( *(ilmIter.second->elementTable()) );
480  }
481  }
482  // detector store writing
483  if ( (detStore()->record(ilmIter.second, ilmIter.first, false)).isFailure()){
484  ATH_MSG_ERROR( "Writing of LayerMaterialMap with name '" << ilmIter.first << "' was not successful." );
485  delete ilmIter.second;
486  } else ATH_MSG_INFO( "LayerMaterialMap: " << ilmIter.first << " written to the DetectorStore!" );
487  }
488  delete m_elementTable;
489 
490 #ifdef TRKDETDESCR_MEMUSAGE
491  m_memoryLogger.refresh(getpid());
492  ATH_MSG_INFO( "[ memory usage ] At the end of the material map creation.");
493  ATH_MSG_INFO( m_memoryLogger );
494 #endif
495 
496  ATH_MSG_INFO( "========================================================================================= " );
497  ATH_MSG_INFO( " -> Total mapped hits : " << m_mapped );
498  double unmapped = (m_unmapped+m_mapped) ? double(m_unmapped)/double(m_unmapped+m_mapped) : 0.;
499  ATH_MSG_INFO( " -> Total (rel.) unmapped hits : " << m_unmapped << " (" << unmapped << ")" );
500  ATH_MSG_INFO( " -> Skipped (outisde) : " << m_skippedOutside );
501  ATH_MSG_INFO( "========================================================================================= " );
502  ATH_MSG_INFO( "finalize() successful");
503  return StatusCode::SUCCESS;
504 }

◆ handleTrackingGeometry()

StatusCode Trk::MaterialMapping::handleTrackingGeometry ( )
private

Retrieve the TrackingGeometry and its informations.

Definition at line 507 of file MaterialMapping.cxx.

508 {
509  // either get a string volume or the highest one
510  const Trk::TrackingVolume* trackingVolume = trackingGeometry().highestTrackingVolume();
511 
512  // prepare the mapping volume
514 
515  // register the confined layers from the TrackingVolume
516  registerVolume(*trackingVolume, 0);
517 
518  ATH_MSG_INFO("Add "<< m_layerRecords.size() << " confined volume layers to mapping setup.");
519  ATH_MSG_INFO("Add "<< trackingGeometry().numBoundaryLayers() << " boundary layers to mapping setup.");
520 
521  // register the layers from boundary surfaces
522  for (const auto bLayerIter : trackingGeometry().boundaryLayers())
523  insertLayerMaterialRecord(*(bLayerIter.first));
524 
525  ATH_MSG_INFO("Map for "<< m_layerRecords.size() << " layers booked & prepared for mapping procedure");
526 
527  return StatusCode::SUCCESS;
528 
529 }

◆ initialize()

StatusCode Trk::MaterialMapping::initialize ( )

standard Athena-Algorithm method

Definition at line 88 of file MaterialMapping.cxx.

89 {
90 
91  ATH_MSG_INFO("initialize()");
92 
94 
95  ATH_CHECK(m_extrapolationEngine.retrieve());
96 
97  if ( !m_materialMapper.empty() )
98  ATH_CHECK( m_materialMapper.retrieve() );
99 
100  if ( !m_layerMaterialRecordAnalyser.empty() )
102 
103  if ( !m_layerMaterialCreators.empty() )
104  ATH_CHECK( m_layerMaterialCreators.retrieve() );
105 
106  if ( !m_layerMaterialAnalysers.empty() )
107  ATH_CHECK( m_layerMaterialAnalysers.retrieve() );
108 
111 
112  return StatusCode::SUCCESS;
113 }

◆ inputHandles()

virtual std::vector<Gaudi::DataHandle*> AthCommonDataStore< AthCommonMsg< Algorithm > >::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.

◆ insertLayerMaterialRecord()

void Trk::MaterialMapping::insertLayerMaterialRecord ( const Trk::Layer lay)
private

Definition at line 585 of file MaterialMapping.cxx.

585  {
586  // first occurrance, create a new LayerMaterialRecord
587  // - get the bin utility for the binned material (if necessary)
588  // - get the material first
589  const Trk::LayerMaterialProperties* layerMaterialProperties = lay.layerMaterialProperties();
590  // - dynamic cast to the BinnedLayerMaterial
591  const Trk::BinnedLayerMaterial* layerBinnedMaterial
592  = dynamic_cast<const Trk::BinnedLayerMaterial*>(layerMaterialProperties);
593  // get the binned array
594  const Trk::BinUtility* layerMaterialBinUtility = (layerBinnedMaterial) ? layerBinnedMaterial->binUtility() : nullptr;
595  // now fill the layer material record
596  if (layerMaterialBinUtility){
597  // create a new Layer Material record in the map
599  layerMaterialBinUtility,
601  // and fill it into the map
602  m_layerRecords[&lay] = lmr;
603  }
604 }

◆ msg() [1/2]

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

Definition at line 24 of file AthCommonMsg.h.

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

◆ msg() [2/2]

MsgStream& AthCommonMsg< Algorithm >::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< Algorithm >::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< Algorithm > >::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.

◆ registerVolume()

void Trk::MaterialMapping::registerVolume ( const Trk::TrackingVolume tvol,
int  lvl 
)
private

Output information with Level.

private void Method to map the layer material

Definition at line 532 of file MaterialMapping.cxx.

533 {
534  int sublevel = lvl+1;
535 
536  for (int indent=0; indent<sublevel; ++indent)
537  std::cout << " ";
538  std::cout << "TrackingVolume name: "<< tvol.volumeName() << std::endl;
539 
540  // all those to be processed
541  std::vector<const Trk::Layer*> volumeLayers;
542 
543  // collect all material layers that have layerMaterial
544  const Trk::BinnedArray< Trk::Layer >* confinedLayers = tvol.confinedLayers();
545  if (confinedLayers) {
546  // this go ahead with the layers
548  for (int indent=0; indent<sublevel; ++indent)
549  std::cout << " ";
550  std::cout << "- found : "<< layers.size() << "confined Layers"<< std::endl;
551  // loop over and fill them
552  auto clIter = layers.begin();
553  auto clIterE = layers.end();
554  for ( ; clIter != clIterE; ++clIter ) {
555  // only take layers with MaterialProperties defined and which are within the mapping volume
556  const Amg::Vector3D& sReferencePoint = (*clIter)->surfaceRepresentation().globalReferencePoint();
557  bool insideMappingVolume = m_mappingVolume ? m_mappingVolume->inside(sReferencePoint) : true;
558  if ((*clIter)->layerMaterialProperties() && insideMappingVolume)
559  volumeLayers.push_back((*clIter));
560  }
561  }
562 
563  // now create LayerMaterialRecords for all
564  for ( auto& lIter : volumeLayers )
566 
567  // step dopwn the navigation tree to reach the confined volumes
568  const Trk::BinnedArray<Trk::TrackingVolume >* confinedVolumes = tvol.confinedVolumes();
569  if (confinedVolumes) {
571 
572  for (int indent=0; indent<sublevel; ++indent)
573  std::cout << " ";
574  std::cout << "- found : "<< volumes.size() << "confined TrackingVolumes"<< std::endl;
575  // loop over the confined volumes
576  auto volumesIter = volumes.begin();
577  for (; volumesIter != volumes.end(); ++volumesIter)
578  if (*volumesIter) {
579  registerVolume(**volumesIter, sublevel);
580  }
581  }
582 
583 }

◆ 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< Algorithm > >::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< Algorithm > >::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  }

◆ retrieveTrackingGeometry()

const TrackingGeometry* Trk::MaterialMapping::retrieveTrackingGeometry ( const EventContext &  ctx) const
inlineprivate

Definition at line 186 of file MaterialMapping.h.

188  {
190  if (!handle.isValid()) {
191  ATH_MSG_FATAL("Could not load TrackingGeometry with name '"
192  << m_trackingGeometryReadKey.key() << "'. Aborting.");
194  }
195  return handle.cptr();
196  }

◆ sysInitialize()

StatusCode AthAlgorithm::sysInitialize ( )
overridevirtualinherited

Override sysInitialize.

Override sysInitialize from the base class.

Loop through all output handles, and if they're WriteCondHandles, automatically register them and this Algorithm with the CondSvc

Scan through all outputHandles, and if they're WriteCondHandles, register them with the CondSvc

Reimplemented from AthCommonDataStore< AthCommonMsg< Algorithm > >.

Reimplemented in AthAnalysisAlgorithm, AthFilterAlgorithm, PyAthena::Alg, and AthHistogramAlgorithm.

Definition at line 66 of file AthAlgorithm.cxx.

66  {
68 
69  if (sc.isFailure()) {
70  return sc;
71  }
72  ServiceHandle<ICondSvc> cs("CondSvc",name());
73  for (auto h : outputHandles()) {
74  if (h->isCondition() && h->mode() == Gaudi::DataHandle::Writer) {
75  // do this inside the loop so we don't create the CondSvc until needed
76  if ( cs.retrieve().isFailure() ) {
77  ATH_MSG_WARNING("no CondSvc found: won't autoreg WriteCondHandles");
78  return StatusCode::SUCCESS;
79  }
80  if (cs->regHandle(this,*h).isFailure()) {
81  sc = StatusCode::FAILURE;
82  ATH_MSG_ERROR("unable to register WriteCondHandle " << h->fullKey()
83  << " with CondSvc");
84  }
85  }
86  }
87  return sc;
88 }

◆ sysStart()

virtual StatusCode AthCommonDataStore< AthCommonMsg< Algorithm > >::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.

◆ throwFailedToGetTrackingGeometry()

void Trk::MaterialMapping::throwFailedToGetTrackingGeometry ( ) const
private

Definition at line 606 of file MaterialMapping.cxx.

606  {
607  std::stringstream msg;
608  msg << "Failed to get conditions data " << m_trackingGeometryReadKey.key() << ".";
609  throw std::runtime_error(msg.str());
610 }

◆ trackingGeometry()

const Trk::TrackingGeometry & Trk::MaterialMapping::trackingGeometry ( ) const
inlineprivate

Definition at line 211 of file MaterialMapping.h.

212 {
213  const Trk::TrackingGeometry* tracking_geometry =
214  retrieveTrackingGeometry(Gaudi::Hive::currentContext());
215  if (!tracking_geometry) {
216  ATH_MSG_FATAL("Did not get valid TrackingGeometry. Aborting.");
217  throw GaudiException("MaterialMapping",
218  "Problem with TrackingGeometry loading.",
219  StatusCode::FAILURE);
220  }
221  return *tracking_geometry;
222 }

◆ updateVHKA()

void AthCommonDataStore< AthCommonMsg< Algorithm > >::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_accumulatedMaterialXX0

double Trk::MaterialMapping::m_accumulatedMaterialXX0
private

the accumulated material information

Definition at line 175 of file MaterialMapping.h.

◆ m_accumulatedRhoS

double Trk::MaterialMapping::m_accumulatedRhoS
private

Definition at line 176 of file MaterialMapping.h.

◆ m_associationType

int Trk::MaterialMapping::m_associationType
private

Definition at line 134 of file MaterialMapping.h.

◆ m_checkForEmptyHits

bool Trk::MaterialMapping::m_checkForEmptyHits
private

use extrapoaltion engine to check for empty hits

Definition at line 115 of file MaterialMapping.h.

◆ m_detStore

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

Pointer to StoreGate (detector store by default)

Definition at line 393 of file AthCommonDataStore.h.

◆ m_elementTable

Trk::ElementTable* Trk::MaterialMapping::m_elementTable
private

the accumulated element table

Definition at line 165 of file MaterialMapping.h.

◆ m_etaCutOff

double Trk::MaterialMapping::m_etaCutOff
private

general steering

Definition at line 131 of file MaterialMapping.h.

◆ m_etaSide

int Trk::MaterialMapping::m_etaSide
private

needed for debugging: -1 negative | 0 all | 1 positive

Definition at line 132 of file MaterialMapping.h.

◆ m_evtStore

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

Pointer to StoreGate (event store by default)

Definition at line 390 of file AthCommonDataStore.h.

◆ m_extendedExtraObjects

DataObjIDColl AthAlgorithm::m_extendedExtraObjects
privateinherited

Definition at line 79 of file AthAlgorithm.h.

◆ m_extrapolationEngine

ToolHandle<IExtrapolationEngine> Trk::MaterialMapping::m_extrapolationEngine
private
Initial value:
{
this,
"ExtrapolationEngine",
"",
"Extrapolation Engine"
}

Definition at line 116 of file MaterialMapping.h.

◆ m_inputEventElementTable

SG::ReadHandleKey<Trk::ElementTable> Trk::MaterialMapping::m_inputEventElementTable
private

input event table

Definition at line 167 of file MaterialMapping.h.

◆ m_inputMaterialStepCollection

SG::ReadHandleKey<MaterialStepCollection> Trk::MaterialMapping::m_inputMaterialStepCollection
private

output / input steering

Definition at line 127 of file MaterialMapping.h.

◆ m_layerMaterialAnalysers

ToolHandleArray<ILayerMaterialAnalyser> Trk::MaterialMapping::m_layerMaterialAnalysers
private
Initial value:
{
this,
"LayerMaterialAnalysers",
{},
"Layer material analysers per creator (if wanted)"
}

Definition at line 142 of file MaterialMapping.h.

◆ m_layerMaterialCreators

ToolHandleArray<ILayerMaterialCreator> Trk::MaterialMapping::m_layerMaterialCreators
private
Initial value:
{
this,
"LayerMaterialCreators",
{},
"Layer material creators"
}

Definition at line 148 of file MaterialMapping.h.

◆ m_layerMaterialRecordAnalyser

ToolHandle<ILayerMaterialAnalyser> Trk::MaterialMapping::m_layerMaterialRecordAnalyser
private
Initial value:
{
this,
"LayerMaterialRecordAnalyser",
"",
"Layer material analyser for the layer material record"
}

Definition at line 136 of file MaterialMapping.h.

◆ m_layerMaterialScreenOutput

int Trk::MaterialMapping::m_layerMaterialScreenOutput
private

Definition at line 183 of file MaterialMapping.h.

◆ m_layerRecords

std::map<const Layer*, LayerMaterialRecord> Trk::MaterialMapping::m_layerRecords
private

this is the general record for the search

Definition at line 171 of file MaterialMapping.h.

◆ m_layersRecordedPerEvent

std::map<const Layer*, bool> Trk::MaterialMapping::m_layersRecordedPerEvent
private

these are the layers hit per event - for empty hit scaling

Definition at line 173 of file MaterialMapping.h.

◆ m_mapComposition

bool Trk::MaterialMapping::m_mapComposition
private

map the composition of the material

Definition at line 161 of file MaterialMapping.h.

◆ m_mapMaterial

bool Trk::MaterialMapping::m_mapMaterial
private

Mapper and Inspector.

Definition at line 156 of file MaterialMapping.h.

◆ m_mapped

size_t Trk::MaterialMapping::m_mapped
private

Definition at line 179 of file MaterialMapping.h.

◆ m_mappingVolume

const Trk::TrackingVolume* Trk::MaterialMapping::m_mappingVolume
private

Definition at line 124 of file MaterialMapping.h.

◆ m_mappingVolumeName

std::string Trk::MaterialMapping::m_mappingVolumeName
private

Definition at line 123 of file MaterialMapping.h.

◆ m_materialMapper

ToolHandle<IMaterialMapper> Trk::MaterialMapping::m_materialMapper
private
Initial value:
{ this,
"MaterialMapper",
"",
"IMaterialMapper algTool" }

Definition at line 157 of file MaterialMapping.h.

◆ m_minCompositionFraction

double Trk::MaterialMapping::m_minCompositionFraction
private

minimal fraction to be accounted for the composition recording

Definition at line 162 of file MaterialMapping.h.

◆ m_outputLayerMaterialSetName

std::string Trk::MaterialMapping::m_outputLayerMaterialSetName
private

Definition at line 128 of file MaterialMapping.h.

◆ m_skippedOutside

size_t Trk::MaterialMapping::m_skippedOutside
private

Definition at line 181 of file MaterialMapping.h.

◆ m_trackingGeometryReadKey

SG::ReadCondHandleKey<TrackingGeometry> Trk::MaterialMapping::m_trackingGeometryReadKey
private
Initial value:
{
this,
"TrackingGeometryReadKey",
"",
"Key of the TrackingGeometry conditions data."
}

Definition at line 198 of file MaterialMapping.h.

◆ m_unmapped

size_t Trk::MaterialMapping::m_unmapped
private

Definition at line 180 of file MaterialMapping.h.

◆ m_useLayerThickness

bool Trk::MaterialMapping::m_useLayerThickness
private

use the actual layer thickness

Definition at line 133 of file MaterialMapping.h.

◆ m_varHandleArraysDeclared

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

Definition at line 399 of file AthCommonDataStore.h.

◆ m_vhka

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

Definition at line 398 of file AthCommonDataStore.h.


The documentation for this class was generated from the following files:
Trk::MaterialMapping::m_layerMaterialCreators
ToolHandleArray< ILayerMaterialCreator > m_layerMaterialCreators
Definition: MaterialMapping.h:148
Trk::MaterialMapping::m_layerRecords
std::map< const Layer *, LayerMaterialRecord > m_layerRecords
this is the general record for the search
Definition: MaterialMapping.h:171
python.SystemOfUnits.second
int second
Definition: SystemOfUnits.py:120
Trk::ExtrapolationMode::CollectPassive
@ CollectPassive
Definition: ExtrapolationCell.h:57
test_pyathena.eta
eta
Definition: test_pyathena.py:10
ATH_MSG_FATAL
#define ATH_MSG_FATAL(x)
Definition: AthMsgStreamMacros.h:34
SG::ReadCondHandle
Definition: ReadCondHandle.h:44
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
Trk::Volume::inside
bool inside(const Amg::Vector3D &gp, double tol=0.) const
Inside() method for checks.
Definition: Volume.cxx:90
Trk::ExtrapolationMode::CollectBoundary
@ CollectBoundary
Definition: ExtrapolationCell.h:58
Trk::MaterialMapping::m_trackingGeometryReadKey
SG::ReadCondHandleKey< TrackingGeometry > m_trackingGeometryReadKey
Definition: MaterialMapping.h:198
SG::ReadHandle
Definition: StoreGate/StoreGate/ReadHandle.h:70
Trk::MaterialMapping::m_inputEventElementTable
SG::ReadHandleKey< Trk::ElementTable > m_inputEventElementTable
input event table
Definition: MaterialMapping.h:167
AthCommonDataStore< AthCommonMsg< Algorithm > >::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
Definition: AthCommonDataStore.h:145
mat
GeoMaterial * mat
Definition: LArDetectorConstructionTBEC.cxx:55
Trk::MaterialMapping::registerVolume
void registerVolume(const Trk::TrackingVolume &tvol, int lvl)
Output information with Level.
Definition: MaterialMapping.cxx:532
Trk::MaterialMapping::m_layersRecordedPerEvent
std::map< const Layer *, bool > m_layersRecordedPerEvent
these are the layers hit per event - for empty hit scaling
Definition: MaterialMapping.h:173
module_driven_slicing.layers
layers
Definition: module_driven_slicing.py:114
Trk::MaterialMapping::m_etaCutOff
double m_etaCutOff
general steering
Definition: MaterialMapping.h:131
AthCommonDataStore< AthCommonMsg< Algorithm > >::m_evtStore
StoreGateSvc_t m_evtStore
Pointer to StoreGate (event store by default)
Definition: AthCommonDataStore.h:390
AthCommonDataStore< AthCommonMsg< Algorithm > >::m_vhka
std::vector< SG::VarHandleKeyArray * > m_vhka
Definition: AthCommonDataStore.h:398
Trk::MaterialMapping::handleTrackingGeometry
StatusCode handleTrackingGeometry()
Retrieve the TrackingGeometry and its informations.
Definition: MaterialMapping.cxx:507
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
ATH_MSG_VERBOSE
#define ATH_MSG_VERBOSE(x)
Definition: AthMsgStreamMacros.h:28
Trk::MaterialMapping::m_unmapped
size_t m_unmapped
Definition: MaterialMapping.h:180
python.compareNtuple.vName
vName
Definition: compareNtuple.py:23
Trk::MaterialMapping::trackingGeometry
const TrackingGeometry & trackingGeometry() const
Definition: MaterialMapping.h:211
Trk::MaterialMapping::throwFailedToGetTrackingGeometry
void throwFailedToGetTrackingGeometry() const
Definition: MaterialMapping.cxx:606
Trk::LayerMaterialMap
Definition: LayerMaterialMap.h:32
AthenaPoolTestRead.sc
sc
Definition: AthenaPoolTestRead.py:27
AthCommonDataStore< AthCommonMsg< Algorithm > >::detStore
const ServiceHandle< StoreGateSvc > & detStore() const
The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.
Definition: AthCommonDataStore.h:95
SG::VarHandleKeyArray::setOwner
virtual void setOwner(IDataHandleHolder *o)=0
Trk::MaterialMapping::m_minCompositionFraction
double m_minCompositionFraction
minimal fraction to be accounted for the composition recording
Definition: MaterialMapping.h:162
IDTPMcnv.htype
htype
Definition: IDTPMcnv.py:27
Trk::MaterialMapping::m_accumulatedMaterialXX0
double m_accumulatedMaterialXX0
the accumulated material information
Definition: MaterialMapping.h:175
Trk::TrackingVolume::confinedLayers
const LayerArray * confinedLayers() const
Return the subLayer array.
Trk::MaterialStep
Definition: MaterialStep.h:34
Trk::MaterialMapping::m_associationType
int m_associationType
Definition: MaterialMapping.h:134
Trk::MaterialMapping::m_skippedOutside
size_t m_skippedOutside
Definition: MaterialMapping.h:181
Trk::TrackingGeometry::highestTrackingVolume
const TrackingVolume * highestTrackingVolume() const
return the world
python.utils.AtlRunQueryDQUtils.p
p
Definition: AtlRunQueryDQUtils.py:210
AthCommonDataStore
Definition: AthCommonDataStore.h:52
Amg::toString
std::string toString(const Translation3D &translation, int precision=4)
GeoPrimitvesToStringConverter.
Definition: GeoPrimitivesToStringConverter.h:40
AthAlgorithm::sysInitialize
virtual StatusCode sysInitialize() override
Override sysInitialize.
Definition: AthAlgorithm.cxx:66
Trk::MaterialMapping::assignLayerMaterialProperties
void assignLayerMaterialProperties(Trk::TrackingVolume &tvol, Trk::LayerMaterialMap *propSet)
create the LayerMaterialRecord *‍/
Definition: MaterialMapping.cxx:356
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
geometry_dat_to_json.indent
indent
Definition: geometry_dat_to_json.py:36
AthCommonDataStore< AthCommonMsg< Algorithm > >::outputHandles
virtual std::vector< Gaudi::DataHandle * > outputHandles() const override
Return this algorithm's output handles.
Trk::MaterialMapping::m_etaSide
int m_etaSide
needed for debugging: -1 negative | 0 all | 1 positive
Definition: MaterialMapping.h:132
Trk::LayerIndex
Definition: LayerIndex.h:37
Trk::TrackingGeometry
Definition: TrackingGeometry.h:67
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
Trk::MaterialMapping::m_mapComposition
bool m_mapComposition
map the composition of the material
Definition: MaterialMapping.h:161
TRT::Hit::layer
@ layer
Definition: HitInfo.h:79
Trk::ExtrapolationCode::isSuccess
bool isSuccess() const
return success
Definition: ExtrapolationCell.h:153
Trk::LayerMaterialProperties
Definition: LayerMaterialProperties.h:62
Trk::ExtrapolationCode
Definition: ExtrapolationCell.h:105
Trk::MaterialMapping::m_elementTable
Trk::ElementTable * m_elementTable
the accumulated element table
Definition: MaterialMapping.h:165
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
AthCommonDataStore< AthCommonMsg< Algorithm > >::m_detStore
StoreGateSvc_t m_detStore
Pointer to StoreGate (detector store by default)
Definition: AthCommonDataStore.h:393
Trk::Surface::materialLayer
const Trk::Layer * materialLayer() const
return the material Layer
Trk::ParametersBase
Definition: ParametersBase.h:55
SG::VarHandleKey::initialize
StatusCode initialize(bool used=true)
If this object is used as a property, then this should be called during the initialize phase.
Definition: AthToolSupport/AsgDataHandles/Root/VarHandleKey.cxx:103
Trk::CurvilinearParametersT
Definition: CurvilinearParametersT.h:48
Trk::BinnedLayerMaterial
Definition: BinnedLayerMaterial.h:33
xAOD::double
double
Definition: CompositeParticle_v1.cxx:159
Trk::MaterialMapping::m_mappingVolumeName
std::string m_mappingVolumeName
Definition: MaterialMapping.h:123
Trk::LayerIndex::value
int value() const
layerIndex expressed in an integer
Definition: LayerIndex.h:71
Trk::MaterialMapping::m_layerMaterialAnalysers
ToolHandleArray< ILayerMaterialAnalyser > m_layerMaterialAnalysers
Definition: MaterialMapping.h:142
Trk::AssociatedMaterial
Definition: AssociatedMaterial.h:33
Trk::MaterialMapping::m_extrapolationEngine
ToolHandle< IExtrapolationEngine > m_extrapolationEngine
Definition: MaterialMapping.h:116
SG::VarHandleKeyArray::renounce
virtual void renounce()=0
Trk::BinUtility
Definition: BinUtility.h:39
SG::HandleClassifier::type
std::conditional< std::is_base_of< SG::VarHandleKeyArray, T >::value, VarHandleKeyArrayType, type2 >::type type
Definition: HandleClassifier.h:54
Trk::LayerMaterialRecord
Definition: LayerMaterialRecord.h:42
Trk::MaterialMapping::m_materialMapper
ToolHandle< IMaterialMapper > m_materialMapper
Definition: MaterialMapping.h:157
Trk::MaterialMapping::m_mapped
size_t m_mapped
Definition: MaterialMapping.h:179
Trk::TrackingVolume::volumeName
const std::string & volumeName() const
Returns the VolumeName - for debug reason, might be depreciated later.
merge_scale_histograms.doc
string doc
Definition: merge_scale_histograms.py:9
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:221
Trk::MaterialMapping::m_accumulatedRhoS
double m_accumulatedRhoS
Definition: MaterialMapping.h:176
Trk::BinnedArray::arrayObjects
virtual BinnedArraySpan< T *const > arrayObjects()=0
Return all objects of the Array non-const we can still modify the T.
Trk::Layer::thickness
double thickness() const
Return the Thickness of the Layer.
Trk::MaterialAssociationType
MaterialAssociationType
Definition: MaterialAssociationType.h:13
Amg::Vector3D
Eigen::Matrix< double, 3, 1 > Vector3D
Definition: GeoPrimitives.h:47
Trk::MaterialMapping::m_layerMaterialRecordAnalyser
ToolHandle< ILayerMaterialAnalyser > m_layerMaterialRecordAnalyser
Definition: MaterialMapping.h:136
python.LumiBlobConversion.pos
pos
Definition: LumiBlobConversion.py:18
Trk::MaterialMapping::m_useLayerThickness
bool m_useLayerThickness
use the actual layer thickness
Definition: MaterialMapping.h:133
Trk::MaterialMapping::m_mapMaterial
bool m_mapMaterial
Mapper and Inspector.
Definition: MaterialMapping.h:156
Trk::Surface::associatedLayer
const Trk::Layer * associatedLayer() const
return the associated Layer
Trk::MaterialMapping::associateHit
bool associateHit(const Trk::Layer &tvol, const Amg::Vector3D &pos, const Amg::Vector3D &layerHitPosition, double stepl, const Trk::Material &mat)
Associate the Step to the Layer.
Definition: MaterialMapping.cxx:311
Trk::BinnedLayerMaterial::binUtility
virtual const BinUtility * binUtility() const override
Return the BinUtility.
Definition: BinnedLayerMaterial.h:121
AthAlgorithm::m_extendedExtraObjects
DataObjIDColl m_extendedExtraObjects
Definition: AthAlgorithm.h:79
Trk::ExtrapolationCell
Definition: ExtrapolationCell.h:231
Trk::MaterialMapping::m_checkForEmptyHits
bool m_checkForEmptyHits
use extrapoaltion engine to check for empty hits
Definition: MaterialMapping.h:115
a
TList * a
Definition: liststreamerinfos.cxx:10
Trk::SharedObject
std::shared_ptr< T > SharedObject
Definition: SharedObject.h:24
Trk::ElementTable
Definition: ElementTable.h:24
h
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
Trk::TrackingVolume::confinedVolumes
const TrackingVolumeArray * confinedVolumes() const
Return the subLayer array.
AthCommonMsg< Algorithm >::msg
MsgStream & msg() const
Definition: AthCommonMsg.h:24
Trk::Layer::layerMaterialProperties
const LayerMaterialProperties * layerMaterialProperties() const
getting the LayerMaterialProperties including full/pre/post update
Trk::TrackingGeometry::trackingVolume
const TrackingVolume * trackingVolume(const std::string &name) const
return the tracking Volume by name, 0 if it doesn't exist
Trk::TrackingGeometry::lowestTrackingVolume
const TrackingVolume * lowestTrackingVolume(const Amg::Vector3D &gp) const
return the lowest tracking Volume
Definition: TrackingGeometry.cxx:53
SG::VarHandleBase::vhKey
SG::VarHandleKey & vhKey()
Return a non-const reference to the HandleKey.
Definition: StoreGate/src/VarHandleBase.cxx:623
LArCellBinning.step
step
Definition: LArCellBinning.py:158
Trk::MaterialMapping::insertLayerMaterialRecord
void insertLayerMaterialRecord(const Trk::Layer &lay)
Definition: MaterialMapping.cxx:585
physics_parameters.parameters
parameters
Definition: physics_parameters.py:144
AthAlgorithm::AthAlgorithm
AthAlgorithm()
Default constructor:
python.Bindings.keys
keys
Definition: Control/AthenaPython/python/Bindings.py:798
Trk::MaterialMapping::m_mappingVolume
const Trk::TrackingVolume * m_mappingVolume
Definition: MaterialMapping.h:124
LHEF::Writer
Pythia8::Writer Writer
Definition: Prophecy4fMerger.cxx:12
Trk::MaterialMapping::m_inputMaterialStepCollection
SG::ReadHandleKey< MaterialStepCollection > m_inputMaterialStepCollection
output / input steering
Definition: MaterialMapping.h:127
Trk::BinnedArray
Definition: BinnedArray.h:38
Trk::MaterialMapping::retrieveTrackingGeometry
const TrackingGeometry * retrieveTrackingGeometry(const EventContext &ctx) const
Definition: MaterialMapping.h:186
Trk::Surface
Definition: Tracking/TrkDetDescr/TrkSurfaces/TrkSurfaces/Surface.h:75
Trk::ExtrapolationMode::StopAtBoundary
@ StopAtBoundary
Definition: ExtrapolationCell.h:55
Trk::TrackingVolume
Definition: TrackingVolume.h:121
Trk::BinnedArraySpan
std::span< T > BinnedArraySpan
Definition: BinnedArray.h:34
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::MaterialMapping::m_layerMaterialScreenOutput
int m_layerMaterialScreenOutput
Definition: MaterialMapping.h:183
HitType::unmapped
@ unmapped
fitman.k
k
Definition: fitman.py:528
Trk::Layer
Definition: Layer.h:73
ServiceHandle< ICondSvc >
Trk::Layer::layerIndex
const LayerIndex & layerIndex() const
get the layerIndex