29 return (dEta * dEta + dPhi * dPhi) < dr2;
60 return StatusCode::FAILURE;
63 return StatusCode::SUCCESS;
71 if (!clusters.isValid())
74 return StatusCode::FAILURE;
77 if (!tracks.isValid())
80 return StatusCode::FAILURE;
83 if (!vertexHandle.isValid())
86 return StatusCode::FAILURE;
92 std::vector<const xAOD::Vertex *> vertices;
93 vertices.reserve(vertexHandle->size());
98 vertices.push_back(vtx);
106 return StatusCode::SUCCESS;
119 filteredTracks = tracks.ptr();
124 double minTrkEta = std::numeric_limits<double>::infinity();
125 double maxTrkEta = -std::numeric_limits<double>::infinity();
127 std::vector<std::tuple<bool, const xAOD::TrackParticle *, TrackExtension>> extensions;
128 extensions.reserve(filteredTracks->
size());
134 minTrkEta = std::min(minTrkEta, ext.eta);
135 maxTrkEta = std::max(maxTrkEta, ext.eta);
138 isPV =
m_tvaTool->isCompatible(*track, *priVtx);
140 isPV =
m_tvaTool->getUniqueMatchVertex(*track, vertices) == priVtx;
141 extensions.push_back(std::make_tuple(isPV, track, ext));
147 double eta = iclus->eta();
148 if (iclus->e() < 0.0 ||
156 double phi = iclus->phi();
159 for (
const std::tuple<bool, const xAOD::TrackParticle *, TrackExtension> &ext : extensions)
164 totalSum += std::get<1>(ext)->pt();
165 if (std::get<0>(ext))
166 PVSum += std::get<1>(ext)->pt();
168 decCVF(*iclus) = totalSum == 0 ? -1 : PVSum / totalSum;
170 return StatusCode::SUCCESS;
Scalar eta() const
pseudorapidity method
Scalar phi() const
phi method
DataVector adapter that acts like it holds const pointers.
#define CHECK(...)
Evaluate an expression and check for errors.
Some common helper functions used by decoration handles.
Handle class for reading from StoreGate.
Handle class for adding a decoration to an object.
An algorithm that can be simultaneously executed in multiple threads.
DataVector adapter that acts like it holds const pointers.
value_type push_back(value_type pElem)
Add an element to the end of the collection.
const DV * asDataVector() const
Return a pointer to this object, as a const DataVector.
size_type size() const noexcept
Returns the number of elements in the collection.
ToolHandle< InDet::IInDetTrackSelectionTool > m_trackSelTool
SG::ReadHandleKey< xAOD::CaloClusterContainer > m_inputClusterKey
Gaudi::Property< bool > m_useCompatible
ToolHandle< IExtendTrackToLayerTool > m_extensionTool
SG::WriteDecorHandleKey< xAOD::CaloClusterContainer > m_outputCVFKey
ToolHandle< CP::ITrackVertexAssociationTool > m_tvaTool
CVFAlg(const std::string &name, ISvcLocator *pSvcLocator)
Constructor.
Gaudi::Property< double > m_clusterMatchDR
bool m_useTrackSelTool
Is a track selection tool being used?
virtual StatusCode execute(const EventContext &ctx) const override
Run the algorithm.
SG::ReadHandleKey< xAOD::VertexContainer > m_inputVertexKey
virtual StatusCode initialize() override
Initialise the algorithm.
SG::ReadHandleKey< xAOD::TrackParticleContainer > m_inputTrackKey
VxType::VertexType vertexType() const
The type of the vertex.
It used to be useful piece of code for replacing actual SG with other store of similar functionality ...
std::string contKeyFromKey(const std::string &key)
Extract the container part of key.
@ VIEW_ELEMENTS
this data object is a view, it does not own its elmts
SG::ReadCondHandle< T > makeHandle(const SG::ReadCondHandleKey< T > &key, const EventContext &ctx=Gaudi::Hive::currentContext())
bool dPhi(const xAOD::TauJet &tau, const xAOD::CaloVertexedTopoCluster &cluster, float &out)
bool dEta(const xAOD::TauJet &tau, const xAOD::CaloVertexedTopoCluster &cluster, float &out)
CaloCluster_v1 CaloCluster
Define the latest version of the calorimeter cluster class.
TrackParticle_v1 TrackParticle
Reference the current persistent version:
Vertex_v1 Vertex
Define the latest version of the vertex class.
TrackParticleContainer_v1 TrackParticleContainer
Definition of the current "TrackParticle container version".