11 #include "TLorentzVector.h"
21 VertexTrackIsolation::VertexTrackIsolation(
const std::string&
t,
const std::string&
n,
const IInterface*
p)
23 m_trackIsoTool(
"xAOD::TrackIsolationTool"),
24 m_trackContainerName(
"InDetTrackParticles"),
25 m_vertexContainerName(
"NONE"),
30 m_fixElecExclusion(false),
33 declareInterface<DerivationFramework::IAugmentationTool>(
this);
44 "New property to deal with track isolation per track, the default option "
45 "(m_doIsoPerTrk=false) preserves the old behavior");
71 return StatusCode::SUCCESS;
78 return StatusCode::SUCCESS;
85 if (theVtx1 == theVtx2)
91 bool firstTwoAreSame =
93 std::set<const xAOD::TrackParticle*>(
97 std::set<const xAOD::TrackParticle*>(
99 if (firstTwoAreSame && lastTwoAreSame)
104 std::set<const xAOD::TrackParticle*> vtxset1;
105 std::set<const xAOD::TrackParticle*> vtxset2;
110 return vtxset1 == vtxset2;
115 const std::vector<const xAOD::Vertex*>& theColl)
const {
116 for (
const auto vtxPtr : theColl) {
117 if (
isSame(vtxPtr, theVtx))
133 ATH_MSG_ERROR(
"Failed loading IdTrackparticleContainer container");
134 return StatusCode::FAILURE;
142 return StatusCode::FAILURE;
145 std::vector<const xAOD::Vertex*> outVtxContainer;
149 std::vector<xAOD::Iso::IsolationType> cones(
m_cones.size());
151 for (
unsigned int i = 0;
i <
m_cones.size();
i++)
156 return xAOD::Iso::coneSize(i) > xAOD::Iso::coneSize(j);
160 for (
auto vertex : *vertexContainer) {
163 for (std::vector<std::string>::const_iterator flagItr =
m_passFlags.begin(); flagItr !=
m_passFlags.end();
179 outVtxContainer.push_back(
vertex);
183 TLorentzVector candidate;
185 std::set<const xAOD::TrackParticle*> exclusionset;
187 for (
auto part :
vertex->trackParticleLinks()) {
189 candidate += (*part)->p4();
195 exclusionset.insert(
partID);
197 exclusionset.insert(*
part);
205 V0VertexLinksAcc(
"V0VertexLinks");
206 auto V0VertLink = V0VertexLinksAcc(*
vertex);
207 const xAOD::Vertex* V0Vert = V0VertLink.at(0).getDataPtr()->at(0);
209 candidate += (*part)->p4();
210 exclusionset.insert(*
part);
228 const string vtxType_name[3] = {
"SumPt",
"A0",
"Z0"};
239 for (
unsigned int i = 0;
i < cones.size();
i++) {
244 if(refVtx ==
nullptr){
251 m_trackIsoTool->trackIsolation(
result, candidate_slyTrack, cones, corrlist, refVtx, &exclusionset,
252 idTrackParticleContainer);
255 for (
unsigned int i = 0;
i < cones.size();
i++) {
258 variableName += vtxType_name[vertex_type];
264 for (
size_t i = 0;
i <
vertex->nTrackParticles();
i++) {
266 idTrackParticleContainer);
268 for (
unsigned int j = 0; j < cones.size(); j++) {
270 variableName += vtxType_name[vertex_type];
271 variableName +=
"_trk";
283 return StatusCode::SUCCESS;