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

#include <VertexSeedFinderTestAlg.h>

Inheritance diagram for Trk::VertexSeedFinderTestAlg:
Collaboration diagram for Trk::VertexSeedFinderTestAlg:

Public Member Functions

virtual StatusCode initialize () override
 Standard Gaudi initialize method.
virtual StatusCode execute (const EventContext &ctx) override
 Execute the algorithm.
 AthAlgorithm (const std::string &name, ISvcLocator *pSvcLocator)
 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.

Private Types

typedef ServiceHandle< StoreGateSvcStoreGateSvc_t

Private Member Functions

StatusCode makeMcEventCollection (const EventContext &ctx) const
 Make a test McEventCollection.
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
 specialization for handling Gaudi::Property<SG::VarHandleKey>

Private Attributes

Gaudi::Property< std::vector< double > > m_priVert { this, "PriVert", {}, "Primary vertex 2D position" }
Gaudi::Property< std::vector< double > > m_expected1 { this, "Expected1", {}, "First expected result" }
Gaudi::Property< std::vector< double > > m_expected2 { this, "Expected2", {}, "Second expected result" }
Gaudi::Property< std::vector< double > > m_expected3 { this, "Expected3", {}, "Third expected result" }
Gaudi::Property< std::vector< float > > m_expected1PhiModes { this, "Expected1PhiModes", {}, "" }
Gaudi::Property< std::vector< float > > m_expected1RModes { this, "Expected1RModes", {}, "" }
Gaudi::Property< std::vector< float > > m_expected1ZModes { this, "Expected1ZModes", {}, "" }
Gaudi::Property< std::vector< float > > m_expected1Weights { this, "Expected1Weights", {}, "" }
Gaudi::Property< std::vector< int > > m_expected1Indices { this, "Expected1Indices", {}, "" }
Gaudi::Property< std::vector< double > > m_expected1CorrDist { this, "Expected1CorrDist", {}, "" }
Gaudi::Property< unsigned int > m_npart3 { this, "NPart3", 1000, "Number of test particles." }
SG::WriteHandleKey< McEventCollectionm_mcEventCollectionKey { this, "McEventCollectionKey", "", "Test MC Collecton" }
ToolHandle< Trk::IVertexSeedFinderm_finder { this, "VertexSeedFinderTool", "", "Tool to test." }
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

Definition at line 27 of file VertexSeedFinderTestAlg.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 )

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)

◆ 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::VertexSeedFinderTestAlg::execute ( const EventContext & ctx)
overridevirtual

Execute the algorithm.

Standard Gaudi execute method.

Implements AthAlgorithm.

Definition at line 136 of file VertexSeedFinderTestAlg.cxx.

137{
138 ATH_MSG_INFO ("execute");
139
140 double vx = 0;
141 double vy = 0;
142 if (!m_priVert.empty()) {
143 if (m_priVert.size() != 2) std::abort();
144 vx = m_priVert[0];
145 vy = m_priVert[1];
146 }
147
148 Amg::Vector3D pos0 { 0, 0, 0 };
149
150 Amg::Vector3D pos1a { 2*mm, 1*mm, -10*mm };
151 Amg::Vector3D mom1a { 400*MeV, 600*MeV, 200*MeV };
152 Amg::Vector3D pos1b { 1*mm, 2*mm, -3*mm };
153 Amg::Vector3D mom1b { 600*MeV, 400*MeV, -200*MeV };
154 Amg::Vector3D pos1c { 1.2*mm, 1.3*mm, -7*mm };
155 Amg::Vector3D mom1c { 300*MeV, 1000*MeV, 100*MeV };
156
157 auto p1a = std::make_unique<Trk::Perigee>(pos1a, mom1a, 1, pos0, cov5());
158 auto p1b = std::make_unique<Trk::Perigee>(pos1b, mom1b, -1, pos0, cov5());
159 auto p1c = std::make_unique<Trk::Perigee>(pos1c, mom1c, -1, pos0, cov5());
160
161 std::vector<const Trk::TrackParameters*> v1a { p1a.get(), p1b.get(), p1c.get() };
162 std::vector<const Trk::TrackParameters*> v1b { p1c.get(), p1a.get(), p1b.get() };
163
164 if (!m_expected1.empty()) {
165 ATH_MSG_INFO ("testing 1");
166 Amg::Vector3D p = m_finder->findSeed (vx, vy, v1a);
167 assertVec3D ("1a", p, m_expected1);
168
169 std::unique_ptr<Trk::IMode3dInfo> info;
170 p = m_finder->findSeed (vx, vy, info, v1b);
171 assertVec3D ("1b", p, m_expected1);
172
173 if (!m_expected1PhiModes.empty()) {
174 std::vector<float> phi;
175 std::vector<float> r;
176 std::vector<float> z;
177 std::vector<float> w;
178 size_t sz = info->Modes1d (phi, r, z, w);
179 assert (sz == phi.size());
180 assert (sz == r.size());
181 assert (sz == z.size());
182 assert (sz == w.size());
183 assertVector ("phiModes", phi, m_expected1PhiModes);
184 assertVector ("rModes", r, m_expected1RModes);
185 assertVector ("zModes", z, m_expected1ZModes);
186 assertVector ("weights", w, m_expected1Weights);
187 }
188
189 if (!m_expected1Indices.empty()) {
190 std::vector<const Trk::TrackParameters*> p;
191 size_t sz = info->perigeesAtSeed (p, v1a);
192 assert (sz == p.size());
193 std::vector<int> ndx;
194 for (const Trk::TrackParameters* pp : p) {
195 auto it = std::find (v1a.begin(), v1a.end(), pp);
196 assert (it != v1a.end());
197 ndx.push_back (it - v1a.begin());
198 }
199 assert (ndx == m_expected1Indices);
200 }
201
202 if (!m_expected1CorrDist.empty()) {
203 double cXY = 0;
204 double cZ = 0;
205 info->getCorrelationDistance (cXY, cZ);
206 assert (Athena_test::isEqual (cXY, m_expected1CorrDist[0], 1e-5));
207 assert (Athena_test::isEqual (cZ, m_expected1CorrDist[1], 1e-5));
208 }
209 }
210
211 xAOD::Vertex vert1;
212 initVertex (vert1);
213
214 if (!m_expected2.empty()) {
215 ATH_MSG_INFO ("testing 2");
216 Amg::Vector3D p = m_finder->findSeed (vx, vy, v1a, &vert1);
217 assertVec3D ("2a", p, m_expected2);
218
219 p = m_finder->findSeed (vx, vy, v1b, &vert1);
220 assertVec3D ("2b", p, m_expected2);
221 }
222
223 std::vector<std::unique_ptr<Trk::Perigee> > perigees;
224 std::vector<const Trk::TrackParameters*> pvec;
225 Athena_test::normal_distribution<double> xdist (1*mm, 0.1*mm);
226 Athena_test::normal_distribution<double> ydist (-0.7*mm, 0.1*mm);
227 Athena_test::normal_distribution<double> z1dist (12*mm, 1*mm);
228 Athena_test::normal_distribution<double> z2dist (-3*mm, 0.5*mm);
229 Athena_test::uniform_real_distribution<double> ptdist (0.1*GeV, 100*GeV);
230 Athena_test::uniform_real_distribution<double> phidist (-M_PI, M_PI);
231 Athena_test::uniform_real_distribution<double> etadist (-4, 4);
232 Athena_test::URNG rng;
233 for (unsigned int i=0; i < m_npart3; i++) {
234 double x = xdist(rng);
235 double y = ydist(rng);
236 double z;
237 if ((i%3) == 0) {
238 z = z2dist(rng);
239 }
240 else {
241 z = z1dist(rng);
242 }
243
244 Amg::Vector3D pos { x, y, z };
245 double pt = ptdist(rng);
246 double phi = phidist(rng);
247 double eta = etadist(rng);
248 Amg::Vector3D mom { pt*cos(phi), pt*sin(phi), pt*sinh(eta) };
249 double charge = etadist(rng) > 0 ? 1 : -1;
250 perigees.emplace_back (std::make_unique<Trk::Perigee> (pos, mom, charge, pos0,
251 cov5()));
252 pvec.push_back (perigees.back().get());
253 }
254
255 if (!m_mcEventCollectionKey.empty()) {
257 }
258
259 if (!m_expected3.empty()) {
260 ATH_MSG_INFO ("testing 3");
261 if (m_expected3.size() == 3) {
262 Amg::Vector3D p = m_finder->findSeed (vx, vy, pvec);
263 assertVec3D ("3a", p, m_expected3);
264 }
265 else {
266 std::vector<Amg::Vector3D> seeds = m_finder->findMultiSeeds (pvec);
267 if (seeds.size() != m_expected3.size()/3) {
268 std::cerr << "VertexSeedFinderTestAlg size mismatch 3b "
269 << seeds.size() << " / " << m_expected3.size()/3 << "\n";
270 std::abort();
271 }
272 int i = 0;
273 for (const auto& seed : seeds) {
274 assertVec3D ("3b", seed, m_expected3, i);
275 i += 3;
276 }
277 }
278 }
279
280 return StatusCode::SUCCESS;
281}
#define M_PI
Scalar eta() const
pseudorapidity method
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_INFO(x)
double charge(const T &p)
Definition AtlasPID.h:997
std::array< fp_t, 2 > pvec
static const double MeV
static Double_t sz
Gaudi::Property< std::vector< float > > m_expected1RModes
Gaudi::Property< std::vector< double > > m_expected1CorrDist
ToolHandle< Trk::IVertexSeedFinder > m_finder
Gaudi::Property< std::vector< double > > m_priVert
Gaudi::Property< std::vector< float > > m_expected1PhiModes
Gaudi::Property< unsigned int > m_npart3
Gaudi::Property< std::vector< double > > m_expected2
Gaudi::Property< std::vector< float > > m_expected1Weights
StatusCode makeMcEventCollection(const EventContext &ctx) const
Make a test McEventCollection.
Gaudi::Property< std::vector< int > > m_expected1Indices
Gaudi::Property< std::vector< float > > m_expected1ZModes
SG::WriteHandleKey< McEventCollection > m_mcEventCollectionKey
Gaudi::Property< std::vector< double > > m_expected1
Gaudi::Property< std::vector< double > > m_expected3
int r
Definition globals.cxx:22
Eigen::Matrix< double, 3, 1 > Vector3D
bool isEqual(double x1, double x2, double thresh=1e-6)
Definition FLOATassert.h:26
uint32_t rng()
Definition FillerAlg.cxx:40
@ x
Definition ParamDefs.h:55
@ z
global position (cartesian)
Definition ParamDefs.h:57
@ y
Definition ParamDefs.h:56
@ phi
Definition ParamDefs.h:75
ParametersBase< TrackParametersDim, Charged > TrackParameters
Vertex_v1 Vertex
Define the latest version of the vertex class.

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

◆ initialize()

StatusCode Trk::VertexSeedFinderTestAlg::initialize ( )
overridevirtual

Standard Gaudi initialize method.

Definition at line 125 of file VertexSeedFinderTestAlg.cxx.

126{
127 ATH_CHECK( m_finder.retrieve() );
129 return StatusCode::SUCCESS;
130}

◆ 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; }

◆ makeMcEventCollection()

StatusCode Trk::VertexSeedFinderTestAlg::makeMcEventCollection ( const EventContext & ctx) const
private

Make a test McEventCollection.

Definition at line 288 of file VertexSeedFinderTestAlg.cxx.

289{
290 auto *evt1 = new HepMC::GenEvent();
291 auto *evt2 = new HepMC::GenEvent();
292 auto *evt3 = new HepMC::GenEvent();
293 auto v1 = HepMC::newGenVertexPtr(HepMC::FourVector{1*mm, 2*mm, 12*mm,0.0});
294 auto v2 = HepMC::newGenVertexPtr(HepMC::FourVector{0.3*mm,-0.7*mm,-3*mm,0.0});
295 auto v3 = HepMC::newGenVertexPtr(HepMC::FourVector{0.6*mm, 0.2*mm, 7*mm,0.0});
299
300 Athena_test::uniform_real_distribution<double> ptdist (0.1*GeV, 100*GeV);
301 Athena_test::uniform_real_distribution<double> phidist (-M_PI, M_PI);
302 Athena_test::uniform_real_distribution<double> etadist (-4, 4);
303 Athena_test::URNG rng (123);
304 for (unsigned int i = 0; i < 1000; i++) {
305 double pt = ptdist(rng);
306 double phi = phidist(rng);
307 double eta = etadist(rng);
308 double e = pt*sinh(eta);
309 double charge = etadist(rng) > 0 ? 1 : -1;
311 auto p = HepMC::newGenParticlePtr ( mom, charge * 11, 1 );
312
313 double vrand = etadist(rng);
314 if (vrand < 0) {
315 HepMC::signal_process_vertex(evt1)->add_particle_out (p);
316 }
317 else if (vrand < 3) {
318 HepMC::signal_process_vertex(evt2)->add_particle_out (p);
319 }
320 else {
321 HepMC::signal_process_vertex(evt3)->add_particle_out (p);
322 }
323 }
324
325 auto evtcoll = std::make_unique<McEventCollection>();
329 evtcoll->push_back (evt1);
330 evtcoll->push_back (evt2);
331 evtcoll->push_back (evt3);
332
333 SG::WriteHandle<McEventCollection> h (m_mcEventCollectionKey, ctx);
334 ATH_CHECK( h.record (std::move (evtcoll)) );
335 return StatusCode::SUCCESS;
336}
HepMC3::FourVector FourVector
void set_signal_process_vertex(GenEvent *e, T &v)
Definition GenEvent.h:591
ConstGenVertexPtr signal_process_vertex(const GenEvent *e)
Definition GenEvent.h:597
GenParticlePtr newGenParticlePtr(const HepMC3::FourVector &mom=HepMC3::FourVector::ZERO_VECTOR(), int pid=0, int status=0)
Definition GenParticle.h:21
void fillBarcodesAttribute(GenEvent *e)
Definition GenEvent.h:393
GenVertexPtr newGenVertexPtr(const HepMC3::FourVector &pos=HepMC3::FourVector::ZERO_VECTOR(), const int i=0)
Definition GenVertex.h:25
HepMC3::GenEvent GenEvent
Definition GenEvent.h:39

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

◆ 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)
#define ATH_MSG_WARNING(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_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_expected1

Gaudi::Property<std::vector<double> > Trk::VertexSeedFinderTestAlg::m_expected1 { this, "Expected1", {}, "First expected result" }
private

Definition at line 47 of file VertexSeedFinderTestAlg.h.

48{ this, "Expected1", {}, "First expected result" };

◆ m_expected1CorrDist

Gaudi::Property<std::vector<double> > Trk::VertexSeedFinderTestAlg::m_expected1CorrDist { this, "Expected1CorrDist", {}, "" }
private

Definition at line 64 of file VertexSeedFinderTestAlg.h.

65{ this, "Expected1CorrDist", {}, "" };

◆ m_expected1Indices

Gaudi::Property<std::vector<int> > Trk::VertexSeedFinderTestAlg::m_expected1Indices { this, "Expected1Indices", {}, "" }
private

Definition at line 62 of file VertexSeedFinderTestAlg.h.

63{ this, "Expected1Indices", {}, "" };

◆ m_expected1PhiModes

Gaudi::Property<std::vector<float> > Trk::VertexSeedFinderTestAlg::m_expected1PhiModes { this, "Expected1PhiModes", {}, "" }
private

Definition at line 54 of file VertexSeedFinderTestAlg.h.

55{ this, "Expected1PhiModes", {}, "" };

◆ m_expected1RModes

Gaudi::Property<std::vector<float> > Trk::VertexSeedFinderTestAlg::m_expected1RModes { this, "Expected1RModes", {}, "" }
private

Definition at line 56 of file VertexSeedFinderTestAlg.h.

57{ this, "Expected1RModes", {}, "" };

◆ m_expected1Weights

Gaudi::Property<std::vector<float> > Trk::VertexSeedFinderTestAlg::m_expected1Weights { this, "Expected1Weights", {}, "" }
private

Definition at line 60 of file VertexSeedFinderTestAlg.h.

61{ this, "Expected1Weights", {}, "" };

◆ m_expected1ZModes

Gaudi::Property<std::vector<float> > Trk::VertexSeedFinderTestAlg::m_expected1ZModes { this, "Expected1ZModes", {}, "" }
private

Definition at line 58 of file VertexSeedFinderTestAlg.h.

59{ this, "Expected1ZModes", {}, "" };

◆ m_expected2

Gaudi::Property<std::vector<double> > Trk::VertexSeedFinderTestAlg::m_expected2 { this, "Expected2", {}, "Second expected result" }
private

Definition at line 49 of file VertexSeedFinderTestAlg.h.

50{ this, "Expected2", {}, "Second expected result" };

◆ m_expected3

Gaudi::Property<std::vector<double> > Trk::VertexSeedFinderTestAlg::m_expected3 { this, "Expected3", {}, "Third expected result" }
private

Definition at line 51 of file VertexSeedFinderTestAlg.h.

52{ this, "Expected3", {}, "Third expected result" };

◆ 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_finder

ToolHandle<Trk::IVertexSeedFinder> Trk::VertexSeedFinderTestAlg::m_finder { this, "VertexSeedFinderTool", "", "Tool to test." }
private

Definition at line 73 of file VertexSeedFinderTestAlg.h.

74{ this, "VertexSeedFinderTool", "", "Tool to test." };

◆ m_mcEventCollectionKey

SG::WriteHandleKey<McEventCollection> Trk::VertexSeedFinderTestAlg::m_mcEventCollectionKey { this, "McEventCollectionKey", "", "Test MC Collecton" }
private

Definition at line 70 of file VertexSeedFinderTestAlg.h.

71{ this, "McEventCollectionKey", "", "Test MC Collecton" };

◆ m_npart3

Gaudi::Property<unsigned int> Trk::VertexSeedFinderTestAlg::m_npart3 { this, "NPart3", 1000, "Number of test particles." }
private

Definition at line 67 of file VertexSeedFinderTestAlg.h.

68{ this, "NPart3", 1000, "Number of test particles." };

◆ m_priVert

Gaudi::Property<std::vector<double> > Trk::VertexSeedFinderTestAlg::m_priVert { this, "PriVert", {}, "Primary vertex 2D position" }
private

Definition at line 45 of file VertexSeedFinderTestAlg.h.

46{ this, "PriVert", {}, "Primary vertex 2D position" };

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


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