ATLAS Offline Software
Loading...
Searching...
No Matches
VP1TrkInitializer.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3*/
4
9
10#include "GaudiKernel/IToolSvc.h"
11
14#include <QtCoreVersion>
15
16//____________________________________________________________________
17VP1TrkInitializer::VP1TrkInitializer(const std::string& name, ISvcLocator* svcLocator):
18 AthAlgorithm(name, svcLocator)
19{
20 // Tool initialization
21 declareProperty("ForceExtrapolatorTools",m_forceExtrapolatorTools=false);
22 declareProperty("ForceFitterTools",m_forceFitterTools=false);
23}
24
25//____________________________________________________________________
29
30//____________________________________________________________________
32{
33 msg(MSG::INFO) << " in initialize() " << endmsg;
34
35 // Initialize tools (if needed)
37 QStringList tooltypes;
38 tooltypes << "Trk::Extrapolator";
39 initTools<Trk::IExtrapolator>(tooltypes,QString("VP1_JOBCFG_EXTRA_VP1_EXTRAPOLATORS"));
40 }
41
43 QStringList tooltypes;
44 tooltypes << "Trk::KalmanFitter"
45 << "Trk::GlobalChi2Fitter"
46 << "Trk::GaussianSumFilter"
47 << "Trk::DistributedKalmanFilter"
48 << "Trk::DeterministicAnnealingFilter";
49 initTools<Trk::ITrackFitter>(tooltypes,QString("VP1_JOBCFG_EXTRA_VP1_FITTERS"));
50 }
51
52 return StatusCode::SUCCESS;
53}
54
55//____________________________________________________________________
57{
58 msg(MSG::DEBUG) <<" in execute() " << endmsg;
59 return StatusCode::SUCCESS;
60}
61
62//____________________________________________________________________
64{
65 msg(MSG::INFO) <<" in finalize() " << endmsg;
66 return StatusCode::SUCCESS;
67}
68
69// Private method
70template <typename T>
71void VP1TrkInitializer::initTools(QStringList& toolTypes, QString env)
72{
73 VP1ToolAccessHelper toolAccessHelper(toolSvc());
74 VP1AvailableToolsHelper availTools(toolSvc());
75 availTools.addMonitoredTypes(toolTypes);
76 QStringList existingTools = availTools.availableTools();
77
78#if QTCORE_VERSION >= 0x050E00
79 for (const QString& key : VP1QtUtils::environmentVariableValue(env).split(';',Qt::SkipEmptyParts))
80#else
81 for (const QString& key : VP1QtUtils::environmentVariableValue(env).split(';',QString::SkipEmptyParts))
82#endif
83 {
84 if (existingTools.contains(key))
85 continue;
86 msg(MSG::DEBUG) << "Attempting creation of fittertool with tooltype/key " << key.toStdString() << endmsg;
87 T* tool = toolAccessHelper.getToolPointer<T>(key,false/*silent*/,true/*create if not exists*/);
88 if (!tool) {
89 msg(MSG::WARNING) << "Could not create tool with type/key " << key.toStdString() << endmsg;
90 }
91 }
92}
#define endmsg
AthAlgorithm(const std::string &name, ISvcLocator *pSvcLocator)
Constructor with parameters:
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)
MsgStream & msg() const
void addMonitoredTypes(const QStringList &, const QStringList &ignoreList=QStringList())
static QString environmentVariableValue(const QString &name)
toolT * getToolPointer(const QString &toolname, bool silent=false, bool createIfNotExists=false)
void initTools(QStringList &toolTypes, QString env)
VP1TrkInitializer(const std::string &name, ISvcLocator *pSvcLocator)
std::vector< std::string > split(const std::string &s, const std::string &t=":")
Definition hcg.cxx:177