ATLAS Offline Software
Loading...
Searching...
No Matches
Trk::TrkDetDescrTPCnvTest Class Reference

Test the new TP Converter for writing and reading. More...

#include <TrkDetDescrTPCnvTest.h>

Inheritance diagram for Trk::TrkDetDescrTPCnvTest:
Collaboration diagram for Trk::TrkDetDescrTPCnvTest:

Public Member Functions

StatusCode runTest ()
StatusCode initialize ()
 standard Athena-Algorithm method
StatusCode execute (const EventContext &ctx)
 standard Athena-Algorithm method
StatusCode finalize ()
 standard Athena-Algorithm method
virtual StatusCode bookTree ()
virtual StatusCode initializeTest ()
 AthAlgorithm (const std::string &name, ISvcLocator *pSvcLocator)
 Standard Athena-Algorithm Constructor.
virtual StatusCode sysInitialize () override
 Override sysInitialize.
virtual bool isClonable () const override
 Specify if the algorithm is clonable.
virtual StatusCode sysExecute (const EventContext &ctx) override
 Execute an algorithm.
virtual const DataObjIDColl & extraOutputDeps () const override
 Return the list of extra output dependencies.
virtual bool filterPassed (const EventContext &ctx) const
 Get filter decision:
virtual void setFilterPassed (bool state, const EventContext &ctx) const
 Set filter decision:
ServiceHandle< StoreGateSvc > & evtStore ()
 The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.
const ServiceHandle< StoreGateSvc > & detStore () const
 The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.
virtual StatusCode sysStart () override
 Handle START transition.
virtual std::vector< Gaudi::DataHandle * > inputHandles () const override
 Return this algorithm's input handles.
virtual std::vector< Gaudi::DataHandle * > outputHandles () const override
 Return this algorithm's output handles.
Gaudi::Details::PropertyBase & declareProperty (Gaudi::Property< T, V, H > &t)
void updateVHKA (Gaudi::Details::PropertyBase &)
MsgStream & msg () const
bool msgLvl (const MSG::Level lvl) const

Protected Member Functions

virtual bool isReEntrant () const override final
 Legacy algorithms are not thread-safe.
void renounceArray (SG::VarHandleKeyArray &handlesArray)
 remove all handles from I/O resolution
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.

Protected Attributes

Rndm::Numbers * m_gaussDist = nullptr
 Random Number setup.
Rndm::Numbers * m_flatDist = nullptr
Gaudi::Property< size_t > m_numTests {this, "NumberOfTestsPerEvent", 100}
 number of tests

Private Types

typedef ServiceHandle< StoreGateSvcStoreGateSvc_t

Private Member Functions

Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
 specialization for handling Gaudi::Property<SG::VarHandleKey>

Private Attributes

Gaudi::Property< bool > m_writeMode {this, "WriteMode", true}
Gaudi::Property< std::string > m_materialStepCollectionName {this, "MaterialStepCollection", "RandomMaterialSteps"}
Gaudi::Property< std::string > m_layerMaterialCollectionName {this, "LayerMaterialMap", "RandomLayerMaterialMap"}
Gaudi::Property< std::string > m_elementTableName {this, "ElementTable", "RandomElementTable"}
DataObjIDColl m_extendedExtraObjects
 Extra output dependency collection, extended by AthAlgorithmDHUpdate to add symlinks.
StoreGateSvc_t m_evtStore
 Pointer to StoreGate (event store by default).
StoreGateSvc_t m_detStore
 Pointer to StoreGate (detector store by default).
std::vector< SG::VarHandleKeyArray * > m_vhka
bool m_varHandleArraysDeclared

Detailed Description

Test the new TP Converter for writing and reading.

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

Definition at line 27 of file TrkDetDescrTPCnvTest.h.

Member Typedef Documentation

◆ StoreGateSvc_t

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

Definition at line 388 of file AthCommonDataStore.h.

Member Function Documentation

◆ AthAlgorithm()

AthAlgorithm::AthAlgorithm ( const std::string & name,
ISvcLocator * pSvcLocator )
inherited

Standard Athena-Algorithm Constructor.

Definition at line 31 of file AthAlgorithm.cxx.

11 :
12 AthCommonAlgorithm<Gaudi::Algorithm>( name, pSvcLocator )
13{
14 // default cardinality for non-reentrant algorithms
15 setProperty( "Cardinality", 1 ).orThrow("Unable to set property 'Cardinality'", name);
16}
void setProperty(columnar::PythonToolHandle &self, const std::string &key, nb::object value)
AthCommonAlgorithm(const std::string &name, ISvcLocator *pSvcLocator)

◆ bookTree()

StatusCode Trk::TrkDetDescrUnitTestBase::bookTree ( )
virtualinherited

Reimplemented in Trk::MappingTest.

Definition at line 52 of file TrkDetDescrUnitTestBase.cxx.

52{ return StatusCode::SUCCESS; }

◆ declareGaudiProperty()

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

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

Definition at line 156 of file AthCommonDataStore.h.

158 {
160 hndl.value(),
161 hndl.documentation());
162
163 }
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)

◆ declareProperty()

Gaudi::Details::PropertyBase & AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::declareProperty ( Gaudi::Property< T, V, H > & t)
inlineinherited

Definition at line 145 of file AthCommonDataStore.h.

145 {
146 typedef typename SG::HandleClassifier<T>::type htype;
148 }
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>

◆ detStore()

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

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

Definition at line 95 of file AthCommonDataStore.h.

◆ evtStore()

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

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

Definition at line 85 of file AthCommonDataStore.h.

◆ execute()

StatusCode Trk::TrkDetDescrUnitTestBase::execute ( const EventContext & ctx)
virtualinherited

standard Athena-Algorithm method

Implements AthAlgorithm.

Definition at line 40 of file TrkDetDescrUnitTestBase.cxx.

41{
42 return runTest();
43}
virtual StatusCode runTest()=0

◆ extraDeps_update_handler()

void AthCommonDataStore< AthCommonMsg< Gaudi::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 & AthCommonAlgorithm< Gaudi::Algorithm >::extraOutputDeps ( ) const
overridevirtualinherited

Return the list of extra output dependencies.

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

Definition at line 89 of file AthCommonAlgorithm.cxx.

54{
55 // If we didn't find any symlinks to add, just return the collection
56 // from the base class. Otherwise, return the extended collection.
57 if (!m_extendedExtraObjects.empty()) {
59 }
61}
Common base class for algorithms.

◆ filterPassed()

virtual bool AthCommonAlgorithm< Gaudi::Algorithm >::filterPassed ( const EventContext & ctx) const
inlinevirtualinherited

Get filter decision:

Definition at line 93 of file AthCommonAlgorithm.h.

93 {
94 return execState( ctx ).filterPassed();
95 }
virtual bool filterPassed(const EventContext &ctx) const
Get filter decision:

◆ finalize()

StatusCode Trk::TrkDetDescrUnitTestBase::finalize ( )
inherited

standard Athena-Algorithm method

Definition at line 45 of file TrkDetDescrUnitTestBase.cxx.

46{
47
48 ATH_MSG_INFO( "finalize()" );
49 return StatusCode::SUCCESS;
50}
#define ATH_MSG_INFO(x,...)

◆ initialize()

StatusCode Trk::TrkDetDescrUnitTestBase::initialize ( )
inherited

standard Athena-Algorithm method

Definition at line 19 of file TrkDetDescrUnitTestBase.cxx.

20{
21 ATH_MSG_INFO( "Creating random number services, call bookTree() and initializeTest()" );
22
23 // intialize the random number generators
24 m_gaussDist = new Rndm::Numbers(randSvc(), Rndm::Gauss(0.,1.));
25 m_flatDist = new Rndm::Numbers(randSvc(), Rndm::Flat(0.,1.));
26
27 if (bookTree().isFailure()){
28 ATH_MSG_FATAL( "Could not book the TTree object" );
29 return StatusCode::FAILURE;
30 }
31
32 if (initializeTest().isFailure()){
33 ATH_MSG_FATAL( "Could not initialize the test" );
34 return StatusCode::FAILURE;
35 }
36
37 return StatusCode::SUCCESS;
38}
#define ATH_MSG_FATAL(x,...)
Rndm::Numbers * m_gaussDist
Random Number setup.

◆ initializeTest()

StatusCode Trk::TrkDetDescrUnitTestBase::initializeTest ( )
virtualinherited

Reimplemented in Trk::MappingTest, Trk::SurfaceIntersectionTest, and Trk::TrackingGeometryTest.

Definition at line 54 of file TrkDetDescrUnitTestBase.cxx.

54{ return StatusCode::SUCCESS; }

◆ inputHandles()

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

◆ isClonable()

virtual bool AthCommonAlgorithm< Gaudi::Algorithm >::isClonable ( ) const
inlineoverridevirtualinherited

Specify if the algorithm is clonable.

Only relevant for non-reentrant algorithms. Actual number of clones needs to be set via the "Cardinality" property.

Reimplemented in AFP_DigiTop, AlgB, AlgT, BCM_Digitization, CscDigitBuilder, CscDigitToCscRDO, G4AtlasAlg, G4RunAlg, HGTD_Digitization, HiveAlgBase, InDet::GNNSeedingTrackMaker, InDet::SCT_Clusterization, InDet::SiSPGNNTrackMaker, InDet::SiSPSeededTrackFinder, InDet::SiTrackerSpacePointFinder, ISF::SimKernelMT, ITk::StripDigitization, ITkPixelCablingAlg, ITkStripCablingAlg, LArHitEMapMaker, LArTTL1Maker, LUCID_DigiTop, LVL1::L1TopoSimulation, MergeCalibHits, MergeGenericMuonSimHitColl, MergeHijingPars, MergeMcEventCollection, MergeTrackRecordCollection, MergeTruthJets, MergeTruthParticles, MuonDigitizer, PileUpMTAlg, PixelDigitization, RoIBResultToxAOD, SCT_ByteStreamErrorsTestAlg, SCT_CablingCondAlgFromCoraCool, SCT_CablingCondAlgFromText, SCT_ConditionsParameterTestAlg, SCT_ConditionsSummaryTestAlg, SCT_ConfigurationConditionsTestAlg, SCT_Digitization, SCT_FlaggedConditionTestAlg, SCT_LinkMaskingTestAlg, SCT_MajorityConditionsTestAlg, SCT_ModuleVetoTestAlg, SCT_MonitorConditionsTestAlg, SCT_PrepDataToxAOD, SCT_RawDataToxAOD, SCT_ReadCalibChipDataTestAlg, SCT_ReadCalibDataTestAlg, SCT_RODVetoTestAlg, SCT_SensorsTestAlg, SCT_SiliconConditionsTestAlg, SCT_StripVetoTestAlg, SCT_TdaqEnabledTestAlg, SCT_TestCablingAlg, SCTEventFlagWriter, SCTRawDataProvider, SCTSiLorentzAngleTestAlg, SCTSiPropertiesTestAlg, SGInputLoader, Simulation::BeamEffectsAlg, TileHitVecToCnt, TileMuonFitter, TilePulseForTileMuonReceiver, TileRawChannelMaker, TRTDigitization, and ZDC_DigiTop.

Definition at line 68 of file AthCommonAlgorithm.h.

68 {
69 return true;
70 }

◆ isReEntrant()

virtual bool AthAlgorithm::isReEntrant ( ) const
inlinefinaloverrideprotectedvirtualinherited

Legacy algorithms are not thread-safe.

Definition at line 47 of file AthAlgorithm.h.

47{ return false; }

◆ msg()

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

Definition at line 24 of file AthCommonMsg.h.

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

◆ msgLvl()

bool AthCommonMsg< Gaudi::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< Gaudi::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.

◆ 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< Gaudi::Algorithm > >::renounce ( T & h)
inlineprotectedinherited

Definition at line 380 of file AthCommonDataStore.h.

381 {
382 h.renounce();
384 }
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)

◆ renounceArray()

void AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::renounceArray ( SG::VarHandleKeyArray & handlesArray)
inlineprotectedinherited

remove all handles from I/O resolution

Definition at line 364 of file AthCommonDataStore.h.

364 {
366 }

◆ runTest()

StatusCode Trk::TrkDetDescrTPCnvTest::runTest ( )
virtual

Implements Trk::TrkDetDescrUnitTestBase.

Definition at line 26 of file TrkDetDescrTPCnvTest.cxx.

27{
28 ATH_MSG_VERBOSE("Running the TrkDetDescrTPCnvTest Test");
29
30 // ----------------- WRITE MODE -----------------
31 if (m_writeMode){
32
33 ATH_MSG_VERBOSE("Test is running in write mode - writing out a file.");
34
35 // The Material STEP collection
37 for (size_t it = 0; it < TrkDetDescrUnitTestBase::m_numTests; ++it ){
38 msCollection->push_back(new Trk::MaterialStep(TrkDetDescrUnitTestBase::m_flatDist->shoot(),
47 }
48
49
50 ATH_MSG_VERBOSE("Recording MaterialStepCollection '" << m_materialStepCollectionName << "'.");
51
52 if (!m_materialStepCollectionName.empty() && (evtStore()->record(msCollection, m_materialStepCollectionName)).isFailure() ) {
53 ATH_MSG_WARNING("Could not record the material collection " << m_materialStepCollectionName);
54 return StatusCode::FAILURE;
55 }
56
57 ATH_MSG_VERBOSE("Recording LayerMaterialMap '" << m_layerMaterialCollectionName << "'.");
58
59 // The LayerMaterialMap
60 std::unique_ptr<Trk::LayerMaterialMap> lmMap(new Trk::LayerMaterialMap);
61
62 // (e) element Table
63 Trk::ElementTable* eTable = new Trk::ElementTable();
64 eTable->addElement(Trk::Material(TrkDetDescrUnitTestBase::m_flatDist->shoot(),
67 1,
68 TrkDetDescrUnitTestBase::m_flatDist->shoot()),"TestMaterial1");
69 eTable->addElement(Trk::Material(TrkDetDescrUnitTestBase::m_flatDist->shoot(),
72 2,
73 TrkDetDescrUnitTestBase::m_flatDist->shoot()),"TestMaterial2");
74 eTable->addElement(Trk::Material(TrkDetDescrUnitTestBase::m_flatDist->shoot(),
77 3,
78 TrkDetDescrUnitTestBase::m_flatDist->shoot()),"TestMaterial3");
79
80 if ( !m_elementTableName.empty() && (evtStore()->record(eTable, m_elementTableName)).isFailure() ) {
81 ATH_MSG_WARNING("Could not record the element table " << m_elementTableName);
82 return StatusCode::FAILURE;
83 }
84
85 // (a) homogeneous material
86 Trk::HomogeneousLayerMaterial* hml = new Trk::HomogeneousLayerMaterial(Trk::MaterialProperties(TrkDetDescrUnitTestBase::m_flatDist->shoot(),
93 (*lmMap)[Trk::LayerIndex(1)] = hml;
94
95 // (b) binned material
96 Trk::BinUtility rPhiZUtility(200,-M_PI, M_PI, Trk::closed, Trk::binRPhi);
97 rPhiZUtility += Trk::BinUtility(300,-250.,250., Trk::open, Trk::binZ);
98 std::vector< std::vector< const Trk::MaterialProperties* > > materialMatrix(300, std::vector<const Trk::MaterialProperties*>(200, (Trk::MaterialProperties*)nullptr) );
99 for (size_t iob = 0; iob < 300; ++iob)
100 for (size_t iib = 0; iib < 200; ++iib)
101 materialMatrix[iob][iib] = new Trk::MaterialProperties(TrkDetDescrUnitTestBase::m_flatDist->shoot(),
107 (*lmMap)[Trk::LayerIndex(2)] = new Trk::BinnedLayerMaterial(rPhiZUtility, materialMatrix, TrkDetDescrUnitTestBase::m_flatDist->shoot()) ;
108
109 // (c) compressed material
110 Trk::BinUtility zUtility(200,-100,100, Trk::open, Trk::binZ);
111
112 std::vector< const Trk::MaterialProperties*> materialVector;
113 std::vector< unsigned short int > materialIndices;
114 materialVector.reserve(200);
115 materialIndices.reserve(200);
116 for (size_t iib = 0; iib < 200; ++iib){
117 materialIndices.push_back(int(TrkDetDescrUnitTestBase::m_flatDist->shoot()*200));
118 materialVector.push_back(new Trk::MaterialProperties(TrkDetDescrUnitTestBase::m_flatDist->shoot(),
124
125 }
126 (*lmMap)[Trk::LayerIndex(3)] = new Trk::CompressedLayerMaterial(zUtility, materialVector, materialIndices);
127
128 // (d) compound material
129 Trk::BinUtility zUtilityC(200,-100,100, Trk::open, Trk::binZ);
130
131
132 Trk::ValueMatrix thicknessMatrix;
133 Trk::ValueMatrix x0Matrix;
134 Trk::ValueMatrix l0Matrix;
135 Trk::ValueMatrix aMatrix;
136 Trk::ValueMatrix zMatrix;
137 Trk::ValueMatrix rhoMatrix;
138 thicknessMatrix.reserve(25);
139 x0Matrix.reserve(25);
140 l0Matrix.reserve(25);
141 aMatrix.reserve(25);
142 zMatrix.reserve(25);
143 rhoMatrix.reserve(25);
144
145 std::vector< std::vector< Trk::MaterialComposition > > materialCompositionMatrix;
146
147 for (size_t iob = 0; iob < 200; ++iob){
148 // the vectors
149 std::vector<unsigned char> thicknessVector; thicknessVector.reserve(25);
150 std::vector<unsigned char> x0Vector; x0Vector.reserve(25);
151 std::vector<unsigned char> l0Vector; l0Vector.reserve(25);
152 std::vector<unsigned char> aVector; aVector.reserve(25);
153 std::vector<unsigned char> zVector; zVector.reserve(25);
154 std::vector<unsigned char> rhoVector; rhoVector.reserve(25);
155 std::vector< Trk::MaterialComposition > materialCompositionVector;
156 materialCompositionVector.reserve(25);
157 for (size_t iib = 0; iib < 25; ++iib){
158 x0Vector.push_back((unsigned char)(TrkDetDescrUnitTestBase::m_flatDist->shoot()*UCHAR_MAX));
159 l0Vector.push_back((unsigned char)(TrkDetDescrUnitTestBase::m_flatDist->shoot()*UCHAR_MAX));
160 aVector.push_back((unsigned char)(TrkDetDescrUnitTestBase::m_flatDist->shoot()*UCHAR_MAX));
161 zVector.push_back((unsigned char)(TrkDetDescrUnitTestBase::m_flatDist->shoot()*UCHAR_MAX));
162 rhoVector.push_back((unsigned char)(TrkDetDescrUnitTestBase::m_flatDist->shoot()*UCHAR_MAX));
163 std::vector< Trk::ElementFraction > elements;
164 elements.reserve(5);
165 for (size_t iic = 0; iic < 5; ++iic){
166 elements.emplace_back((unsigned char)(TrkDetDescrUnitTestBase::m_flatDist->shoot()*UCHAR_MAX),
167 (unsigned char)(TrkDetDescrUnitTestBase::m_flatDist->shoot()*UCHAR_MAX));
168 }
169 materialCompositionVector.emplace_back(elements);
170 }
171 thicknessMatrix.push_back(std::move(thicknessVector));
172 x0Matrix.push_back(std::move(x0Vector));
173 l0Matrix.push_back(std::move(l0Vector));
174 aMatrix.push_back(std::move(aVector));
175 zMatrix.push_back(std::move(zVector));
176 rhoMatrix.push_back(std::move(rhoVector));
177 materialCompositionMatrix.push_back(std::move(materialCompositionVector));
178 }
179
180 Trk::ValueStore thicknessBins;
181 thicknessBins.valueMin = 0.;
182 thicknessBins.valueStep = TrkDetDescrUnitTestBase::m_flatDist->shoot();
183 thicknessBins.valueBinMatrix = std::move(thicknessMatrix);
184
185 Trk::ValueStore x0Bins;
186 x0Bins.valueMin = 0.;
188 x0Bins.valueBinMatrix = std::move(x0Matrix);
189
190
191 Trk::ValueStore l0Bins;
192 l0Bins.valueMin = 0.;
194 l0Bins.valueBinMatrix = std::move(l0Matrix);
195
196 Trk::ValueStore aBins;
197 aBins.valueMin = 0.;
199 aBins.valueBinMatrix = std::move(aMatrix);
200
201 Trk::ValueStore zBins;
202 zBins.valueMin = 0.;
203 zBins.valueStep = TrkDetDescrUnitTestBase::m_flatDist->shoot();
204 zBins.valueBinMatrix = std::move(zMatrix);
205
206 Trk::ValueStore rhoBins;
207 rhoBins.valueMin = 0.;
209 rhoBins.valueBinMatrix = std::move(rhoMatrix);
210
211 (*lmMap)[Trk::LayerIndex(3)] = new Trk::CompoundLayerMaterial(zUtilityC,
212 thicknessBins,
213 x0Bins,
214 l0Bins,
215 aBins,
216 zBins,
217 rhoBins,
218 materialCompositionMatrix);
219
220 auto sharedElementTable = std::make_shared<Trk::ElementTable>(*eTable);
221 lmMap->updateElementTable(sharedElementTable);
222
223 if ( (evtStore()->record(lmMap.release(), m_layerMaterialCollectionName)).isFailure() ) {
224 ATH_MSG_WARNING("Could not record the material collection " << m_layerMaterialCollectionName);
225 return StatusCode::FAILURE;
226 }
227 } else {
228 //
229 ATH_MSG_VERBOSE("Test is running in READ mode, reading in a file.");
230
231 // ----------------- READ MODE -----------------
232 const Trk::LayerMaterialMap* lmMap = nullptr;
233 if ( (evtStore()->retrieve(lmMap, m_layerMaterialCollectionName)).isFailure() ) {
234 ATH_MSG_WARNING("Could not read the material collection " << m_layerMaterialCollectionName);
235 return StatusCode::FAILURE;
236 } else
237 ATH_MSG_INFO("Successfully read a LayerMaterialMap with size " << lmMap->size());
238
239 }
240
241 return StatusCode::SUCCESS;
242}
#define M_PI
#define ATH_MSG_WARNING(x,...)
#define ATH_MSG_VERBOSE(x,...)
value_type push_back(value_type pElem)
Add an element to the end of the collection.
void addElement(const Material &mat, const std::string &mname="")
Add material to the Table - if the elment is already filled ignore.
Gaudi::Property< std::string > m_elementTableName
Gaudi::Property< std::string > m_materialStepCollectionName
Gaudi::Property< bool > m_writeMode
Gaudi::Property< std::string > m_layerMaterialCollectionName
Gaudi::Property< size_t > m_numTests
number of tests
@ open
Definition BinningType.h:40
@ closed
Definition BinningType.h:41
std::vector< ValueVector > ValueMatrix
DataVector< Trk::MaterialStep > MaterialStepCollection
@ binRPhi
Definition BinningType.h:52
@ binZ
Definition BinningType.h:49

◆ setFilterPassed()

virtual void AthCommonAlgorithm< Gaudi::Algorithm >::setFilterPassed ( bool state,
const EventContext & ctx ) const
inlinevirtualinherited

Set filter decision:

Reimplemented in AthFilterAlgorithm.

Definition at line 99 of file AthCommonAlgorithm.h.

99 {
101 }
virtual void setFilterPassed(bool state, const EventContext &ctx) const
Set filter decision:

◆ sysExecute()

StatusCode AthCommonAlgorithm< Gaudi::Algorithm >::sysExecute ( const EventContext & ctx)
overridevirtualinherited

Execute an algorithm.

We override this in order to work around an issue with the Algorithm base class storing the event context in a member variable that can cause crashes in MT jobs.

Reimplemented in AthAnalysisAlgorithm.

Definition at line 80 of file AthCommonAlgorithm.cxx.

41{
42 return BaseAlg::sysExecute (ctx);
43}

◆ sysInitialize()

StatusCode AthCommonAlgorithm< Gaudi::Algorithm >::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< Gaudi::Algorithm > >.

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

Definition at line 60 of file AthCommonAlgorithm.cxx.

71 {
73
74 if (sc.isFailure()) {
75 return sc;
76 }
77
78 ServiceHandle<ICondSvc> cs("CondSvc",name());
79 for (auto h : outputHandles()) {
80 if (h->isCondition() && h->mode() == Gaudi::DataHandle::Writer) {
81 // do this inside the loop so we don't create the CondSvc until needed
82 if ( cs.retrieve().isFailure() ) {
83 ATH_MSG_WARNING("no CondSvc found: won't autoreg WriteCondHandles");
85 }
86 if (cs->regHandle(this,*h).isFailure()) {
88 ATH_MSG_ERROR("unable to register WriteCondHandle " << h->fullKey()
89 << " with CondSvc");
90 }
91 }
92 }
93 return sc;
94}
#define ATH_MSG_ERROR(x,...)
virtual StatusCode sysInitialize() override
virtual std::vector< Gaudi::DataHandle * > outputHandles() const override

◆ sysStart()

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

◆ updateVHKA()

void AthCommonDataStore< AthCommonMsg< Gaudi::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) {
313 for (auto k : keys) {
314 k->setOwner(this);
315 }
316 }
317 }

Member Data Documentation

◆ m_detStore

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

Pointer to StoreGate (detector store by default).

Definition at line 393 of file AthCommonDataStore.h.

◆ m_elementTableName

Gaudi::Property<std::string> Trk::TrkDetDescrTPCnvTest::m_elementTableName {this, "ElementTable", "RandomElementTable"}
private

Definition at line 43 of file TrkDetDescrTPCnvTest.h.

44{this, "ElementTable", "RandomElementTable"};

◆ m_evtStore

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

Pointer to StoreGate (event store by default).

Definition at line 390 of file AthCommonDataStore.h.

◆ m_extendedExtraObjects

DataObjIDColl AthCommonAlgorithm< Gaudi::Algorithm >::m_extendedExtraObjects
privateinherited

Extra output dependency collection, extended by AthAlgorithmDHUpdate to add symlinks.

Empty if no symlinks were found.

Definition at line 108 of file AthCommonAlgorithm.h.

◆ m_flatDist

Rndm::Numbers* Trk::TrkDetDescrUnitTestBase::m_flatDist = nullptr
protectedinherited

Definition at line 58 of file TrkDetDescrUnitTestBase.h.

◆ m_gaussDist

Rndm::Numbers* Trk::TrkDetDescrUnitTestBase::m_gaussDist = nullptr
protectedinherited

Random Number setup.

Definition at line 57 of file TrkDetDescrUnitTestBase.h.

◆ m_layerMaterialCollectionName

Gaudi::Property<std::string> Trk::TrkDetDescrTPCnvTest::m_layerMaterialCollectionName {this, "LayerMaterialMap", "RandomLayerMaterialMap"}
private

Definition at line 41 of file TrkDetDescrTPCnvTest.h.

42{this, "LayerMaterialMap", "RandomLayerMaterialMap"};

◆ m_materialStepCollectionName

Gaudi::Property<std::string> Trk::TrkDetDescrTPCnvTest::m_materialStepCollectionName {this, "MaterialStepCollection", "RandomMaterialSteps"}
private

Definition at line 39 of file TrkDetDescrTPCnvTest.h.

40{this, "MaterialStepCollection", "RandomMaterialSteps"};

◆ m_numTests

Gaudi::Property<size_t> Trk::TrkDetDescrUnitTestBase::m_numTests {this, "NumberOfTestsPerEvent", 100}
protectedinherited

number of tests

Definition at line 61 of file TrkDetDescrUnitTestBase.h.

61{this, "NumberOfTestsPerEvent", 100};

◆ m_varHandleArraysDeclared

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

Definition at line 399 of file AthCommonDataStore.h.

◆ m_vhka

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

Definition at line 398 of file AthCommonDataStore.h.

◆ m_writeMode

Gaudi::Property<bool> Trk::TrkDetDescrTPCnvTest::m_writeMode {this, "WriteMode", true}
private

Definition at line 37 of file TrkDetDescrTPCnvTest.h.

37{this, "WriteMode", true};

The documentation for this class was generated from the following files: