|
ATLAS Offline Software
|
#include <VertexSeedFinderTestAlg.h>
|
virtual StatusCode | initialize () override |
| Standard Gaudi initialize method. More...
|
|
virtual StatusCode | execute () override |
| Execute the algorithm. More...
|
|
| AthAlgorithm (const std::string &name, ISvcLocator *pSvcLocator) |
| Constructor with parameters: 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 |
|
|
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< McEventCollection > | m_mcEventCollectionKey { this, "McEventCollectionKey", "", "Test MC Collecton" } |
|
ToolHandle< Trk::IVertexSeedFinder > | m_finder { this, "VertexSeedFinderTool", "", "Tool to test." } |
|
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 |
|
Definition at line 27 of file VertexSeedFinderTestAlg.h.
◆ StoreGateSvc_t
◆ AthAlgorithm()
AthAlgorithm::AthAlgorithm |
Constructor with parameters:
Definition at line 51 of file AthAlgorithm.cxx.
32 std::make_unique<AthenaBaseComps::AthAlgorithmDHUpdate>
34 std::move (m_updateDataHandles));
◆ declareGaudiProperty() [1/4]
specialization for handling Gaudi::Property<SG::VarHandleKeyArray>
Definition at line 170 of file AthCommonDataStore.h.
175 hndl.documentation());
◆ declareGaudiProperty() [2/4]
specialization for handling Gaudi::Property<SG::VarHandleKey>
Definition at line 156 of file AthCommonDataStore.h.
161 hndl.documentation());
◆ declareGaudiProperty() [3/4]
specialization for handling Gaudi::Property<SG::VarHandleBase>
Definition at line 184 of file AthCommonDataStore.h.
189 hndl.documentation());
◆ declareGaudiProperty() [4/4]
◆ declareProperty() [1/6]
Declare a new Gaudi property.
- Parameters
-
name | Name of the property. |
hndl | Object holding the property value. |
doc | Documentation 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.
250 this->declare(hndl.
vhKey());
251 hndl.
vhKey().setOwner(
this);
253 return PBASE::declareProperty(
name,hndl,
doc);
◆ declareProperty() [2/6]
Declare a new Gaudi property.
- Parameters
-
name | Name of the property. |
hndl | Object holding the property value. |
doc | Documentation 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.
229 return PBASE::declareProperty(
name,hndl,
doc);
◆ declareProperty() [3/6]
◆ declareProperty() [4/6]
Declare a new Gaudi property.
- Parameters
-
name | Name of the property. |
property | Object holding the property value. |
doc | Documentation 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.
338 return PBASE::declareProperty(
name, property,
doc);
◆ declareProperty() [5/6]
Declare a new Gaudi property.
- Parameters
-
name | Name of the property. |
property | Object holding the property value. |
doc | Documentation 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.
◆ declareProperty() [6/6]
◆ detStore()
◆ evtStore() [1/2]
◆ evtStore() [2/2]
◆ execute()
StatusCode Trk::VertexSeedFinderTestAlg::execute |
( |
| ) |
|
|
overridevirtual |
Execute the algorithm.
Standard Gaudi execute method.
Definition at line 136 of file VertexSeedFinderTestAlg.cxx.
139 const EventContext& ctx = Gaudi::Hive::currentContext();
158 auto p1a = std::make_unique<Trk::Perigee>(pos1a, mom1a, 1, pos0, cov5());
159 auto p1b = std::make_unique<Trk::Perigee>(pos1b, mom1b, -1, pos0, cov5());
160 auto p1c = std::make_unique<Trk::Perigee>(pos1c, mom1c, -1, pos0, cov5());
162 std::vector<const Trk::TrackParameters*> v1a { p1a.get(), p1b.get(), p1c.get() };
163 std::vector<const Trk::TrackParameters*> v1b { p1c.get(), p1a.get(), p1b.get() };
170 std::unique_ptr<Trk::IMode3dInfo>
info;
175 std::vector<float>
phi;
176 std::vector<float>
r;
177 std::vector<float>
z;
178 std::vector<float>
w;
180 assert (
sz ==
phi.size());
181 assert (
sz ==
r.size());
182 assert (
sz ==
z.size());
183 assert (
sz ==
w.size());
191 std::vector<const Trk::TrackParameters*>
p;
192 size_t sz =
info->perigeesAtSeed (
p, v1a);
193 assert (
sz ==
p.size());
194 std::vector<int> ndx;
197 assert (
it != v1a.end());
198 ndx.push_back (
it - v1a.begin());
206 info->getCorrelationDistance (cXY, cZ);
220 p =
m_finder->findSeed (vx, vy, v1b, &vert1);
224 std::vector<std::unique_ptr<Trk::Perigee> > perigees;
225 std::vector<const Trk::TrackParameters*>
pvec;
235 double x = xdist(
rng);
236 double y = ydist(
rng);
246 double pt = ptdist(
rng);
247 double phi = phidist(
rng);
248 double eta = etadist(
rng);
250 double charge = etadist(
rng) > 0 ? 1 : -1;
251 perigees.emplace_back (std::make_unique<Trk::Perigee> (
pos,
mom,
charge, pos0,
253 pvec.push_back (perigees.back().get());
267 std::vector<Amg::Vector3D> seeds =
m_finder->findMultiSeeds (
pvec);
269 std::cerr <<
"VertexSeedFinderTestAlg size mismatch 3b "
270 << seeds.size() <<
" / " <<
m_expected3.size()/3 <<
"\n";
274 for (
const auto& seed : seeds) {
281 return StatusCode::SUCCESS;
◆ extraDeps_update_handler()
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.
57 return Algorithm::extraOutputDeps();
◆ initialize()
StatusCode Trk::VertexSeedFinderTestAlg::initialize |
( |
| ) |
|
|
overridevirtual |
◆ inputHandles()
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.
◆ makeMcEventCollection()
StatusCode Trk::VertexSeedFinderTestAlg::makeMcEventCollection |
( |
const EventContext & |
ctx | ) |
const |
|
private |
Make a test McEventCollection.
Definition at line 289 of file VertexSeedFinderTestAlg.cxx.
291 auto *evt1 =
new HepMC::GenEvent();
292 auto *evt2 =
new HepMC::GenEvent();
293 auto *evt3 =
new HepMC::GenEvent();
305 for (
unsigned int i = 0;
i < 1000;
i++) {
306 double pt = ptdist(
rng);
307 double phi = phidist(
rng);
308 double eta = etadist(
rng);
309 double e =
pt*sinh(eta);
310 double charge = etadist(
rng) > 0 ? 1 : -1;
314 double vrand = etadist(
rng);
318 else if (vrand < 3) {
326 auto evtcoll = std::make_unique<McEventCollection>();
330 evtcoll->push_back (evt1);
331 evtcoll->push_back (evt2);
332 evtcoll->push_back (evt3);
336 return StatusCode::SUCCESS;
◆ msg() [1/2]
◆ msg() [2/2]
◆ msgLvl()
◆ outputHandles()
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()
◆ renounceArray()
◆ sysInitialize()
StatusCode AthAlgorithm::sysInitialize |
( |
| ) |
|
|
overridevirtualinherited |
◆ sysStart()
Handle START transition.
We override this in order to make sure that conditions handle keys can cache a pointer to the conditions container.
◆ updateVHKA()
◆ m_detStore
◆ m_evtStore
◆ m_expected1
Gaudi::Property<std::vector<double> > Trk::VertexSeedFinderTestAlg::m_expected1 { this, "Expected1", {}, "First expected result" } |
|
private |
◆ m_expected1CorrDist
Gaudi::Property<std::vector<double> > Trk::VertexSeedFinderTestAlg::m_expected1CorrDist { this, "Expected1CorrDist", {}, "" } |
|
private |
◆ m_expected1Indices
Gaudi::Property<std::vector<int> > Trk::VertexSeedFinderTestAlg::m_expected1Indices { this, "Expected1Indices", {}, "" } |
|
private |
◆ m_expected1PhiModes
Gaudi::Property<std::vector<float> > Trk::VertexSeedFinderTestAlg::m_expected1PhiModes { this, "Expected1PhiModes", {}, "" } |
|
private |
◆ m_expected1RModes
Gaudi::Property<std::vector<float> > Trk::VertexSeedFinderTestAlg::m_expected1RModes { this, "Expected1RModes", {}, "" } |
|
private |
◆ m_expected1Weights
Gaudi::Property<std::vector<float> > Trk::VertexSeedFinderTestAlg::m_expected1Weights { this, "Expected1Weights", {}, "" } |
|
private |
◆ m_expected1ZModes
Gaudi::Property<std::vector<float> > Trk::VertexSeedFinderTestAlg::m_expected1ZModes { this, "Expected1ZModes", {}, "" } |
|
private |
◆ m_expected2
Gaudi::Property<std::vector<double> > Trk::VertexSeedFinderTestAlg::m_expected2 { this, "Expected2", {}, "Second expected result" } |
|
private |
◆ m_expected3
Gaudi::Property<std::vector<double> > Trk::VertexSeedFinderTestAlg::m_expected3 { this, "Expected3", {}, "Third expected result" } |
|
private |
◆ m_extendedExtraObjects
DataObjIDColl AthAlgorithm::m_extendedExtraObjects |
|
privateinherited |
◆ m_finder
◆ m_mcEventCollectionKey
◆ m_npart3
Gaudi::Property<unsigned int> Trk::VertexSeedFinderTestAlg::m_npart3 { this, "NPart3", 1000, "Number of test particles." } |
|
private |
◆ m_priVert
Gaudi::Property<std::vector<double> > Trk::VertexSeedFinderTestAlg::m_priVert { this, "PriVert", {}, "Primary vertex 2D position" } |
|
private |
◆ m_varHandleArraysDeclared
◆ m_vhka
The documentation for this class was generated from the following files:
Gaudi::Property< std::vector< int > > m_expected1Indices
@ z
global position (cartesian)
Gaudi::Property< unsigned int > m_npart3
std::string find(const std::string &s)
return a remapped string
SG::WriteHandleKey< McEventCollection > m_mcEventCollectionKey
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
Gaudi::Property< std::vector< float > > m_expected1Weights
Gaudi::Property< std::vector< float > > m_expected1RModes
StoreGateSvc_t m_evtStore
Pointer to StoreGate (event store by default)
std::vector< SG::VarHandleKeyArray * > m_vhka
bool empty() const
Test if the key is blank.
Gaudi::Property< std::vector< double > > m_expected2
void fillBarcodesAttribute(GenEvent *)
Gaudi::Property< std::vector< float > > m_expected1PhiModes
virtual void setOwner(IDataHandleHolder *o)=0
Gaudi::Property< std::vector< double > > m_expected3
Gaudi::Property< std::vector< double > > m_expected1CorrDist
ToolHandle< Trk::IVertexSeedFinder > m_finder
void set_signal_process_vertex(GenEvent *e, T v)
virtual StatusCode sysInitialize() override
Override sysInitialize.
virtual std::vector< Gaudi::DataHandle * > outputHandles() const override
Return this algorithm's output handles.
GenVertexPtr newGenVertexPtr(const HepMC::FourVector &pos=HepMC::FourVector(0.0, 0.0, 0.0, 0.0), const int i=0)
::StatusCode StatusCode
StatusCode definition for legacy code.
bool isEqual(double x1, double x2, double thresh=1e-6)
StatusCode makeMcEventCollection(const EventContext &ctx) const
Make a test McEventCollection.
StoreGateSvc_t m_detStore
Pointer to StoreGate (detector store by default)
Gaudi::Property< std::vector< float > > m_expected1ZModes
StatusCode initialize(bool used=true)
If this object is used as a property, then this should be called during the initialize phase.
Gaudi::Property< std::vector< double > > m_priVert
virtual void renounce()=0
std::conditional< std::is_base_of< SG::VarHandleKeyArray, T >::value, VarHandleKeyArrayType, type2 >::type type
double charge(const T &p)
Eigen::Matrix< double, 3, 1 > Vector3D
DataObjIDColl m_extendedExtraObjects
GenParticlePtr newGenParticlePtr(const HepMC::FourVector &mom=HepMC::FourVector(0.0, 0.0, 0.0, 0.0), int pid=0, int status=0)
Class describing a Vertex.
#define ATH_MSG_WARNING(x)
Generator compatible with the C++11 STL UniformRandomNumberGenerator.
SG::VarHandleKey & vhKey()
Return a non-const reference to the HandleKey.
Gaudi::Property< std::vector< double > > m_expected1
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>
GenVertex * signal_process_vertex(const GenEvent *e)