43 return StatusCode::SUCCESS;
50 if (!h_JetCollectionName.
isValid()) {
52 return StatusCode::FAILURE;
57 ATH_CHECK( h_VxSecVertexInfoName.
record(std::make_unique<Trk::VxSecVertexInfoContainer>()));
59 if (h_JetCollectionName->empty()) {
61 return StatusCode::SUCCESS;
68 ATH_MSG_ERROR(
"cannot retrieve jet container particle EL decoration with key " << h_TracksToTag.
decorKey() );
69 return StatusCode::FAILURE;
76 if (!h_VertexCollectionName.
isValid()) {
78 return StatusCode::FAILURE;
80 unsigned int nVertexes = h_VertexCollectionName->size();
83 return StatusCode::SUCCESS;
85 for (
const auto *fz : *h_VertexCollectionName) {
93 if (! primaryVertex) {
105 for (
const auto *jetIter : *h_JetCollectionName) {
108 const std::vector<ElementLink< xAOD::IParticleContainer > >& tracksInJet
109 = h_TracksToTag(jetToTag);
111 if(tracksInJet.empty()){
113 h_VxSecVertexInfoName->push_back(
nullptr);
117 if (!trackContainer) {
118 trackContainer = tracksInJet.front().getDataPtr();
121 std::vector<const xAOD::IParticle*> inputIParticles;
124 inputIParticles.reserve(tracksInJet.size());
125 for (
const auto& iparticle : tracksInJet)
127 inputIParticles.push_back(*iparticle);
133 h_VxSecVertexInfoName->push_back(myVertexInfo);
139 std::vector<std::string> decorationNames =
141 std::vector<SG::auxid_t> decorIDs;
142 decorIDs.reserve (decorationNames.size());
144 for (
const std::string& s : decorationNames) {
147 decorIDs.push_back (
id);
154 if (trackContainer) {
159 trackContainer_nc->lockDecoration (
id);
163 return StatusCode::SUCCESS;
#define ATH_CHECK
Evaluate an expression and check for errors.
Handle mappings between names and auxid_t.
Handle class for reading a decoration on an object.
Handle class for reading from StoreGate.
Define macros for attributes used to control the static checker.
#define ATLAS_THREAD_SAFE
ToolHandle< InDet::ISecVertexInJetFinder > m_secVertexFinderToolHandle
SG::ReadDecorHandleKey< xAOD::JetContainer > m_TracksToTag
virtual StatusCode execute(const EventContext &ctx) const override final
JetSecVtxFindingAlg(const std::string &name, ISvcLocator *pSvcLocator)
Constructors and destructors.
SG::ReadHandleKey< xAOD::VertexContainer > m_VertexCollectionName
CxxUtils::CachedValue< std::vector< SG::auxid_t > > m_decorIDs
List of the track decorations that we produce.
SG::ReadHandleKey< xAOD::JetContainer > m_JetCollectionName
SG::WriteHandleKey< Trk::VxSecVertexInfoContainer > m_VxSecVertexInfoName
virtual StatusCode initialize() override final
Main routines specific to an ATHENA algorithm.
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)
An algorithm that can be simultaneously executed in multiple threads.
DataModel_detail::const_iterator< DataVector > const_iterator
static AuxTypeRegistry & instance()
Return the singleton registry instance.
Handle class for reading a decoration on an object.
const std::string & decorKey() const
Return the name of the decoration alias (CONT.DECOR).
bool isAvailable()
Test to see if this variable exists in the store, for the referenced object.
virtual bool isValid() override final
Can the handle be successfully dereferenced?
StatusCode record(std::unique_ptr< T > data)
Record a const object to the store.
const std::vector< xAOD::Vertex * > & vertices() const
size_t nTrackParticles() const
Get the number of tracks associated with this vertex.
The namespace of all packages in PhysicsAnalysis/JetTagging.
static const auxid_t null_auxid
To signal no aux data item.
size_t auxid_t
Identifier for a particular aux data item.
Jet_v1 Jet
Definition of the current "jet version".
Vertex_v1 Vertex
Define the latest version of the vertex class.
DataVector< IParticle > IParticleContainer
Simple convenience declaration of IParticleContainer.