89{
90
92
93
94 unsigned int nTracks = importedTrackParticles->size();
95 if (nTracks==0) return StatusCode::SUCCESS;
96
97
98 std::vector<bool> trackMask(nTracks,false);
100 int nVtxTot =0;
101 int nVtxPass=0;
102
103 std::unordered_map<std::string, SG::ReadDecorHandle<xAOD::VertexContainer, Char_t>> handles;
106 auto it = handles.emplace(std::piecewise_construct, std::forward_as_tuple(
key.key()), std::forward_as_tuple(key, ctx));
107 if(!(*
it.first).second.isPresent())
return StatusCode::FAILURE;
108 }
109
110
112 SG::ThinningHandle<xAOD::VertexContainer> vertexContainer(name, ctx);
113 std::vector<bool> vtxMask(vertexContainer->size(), false);
114
115
117 for(auto vtxItr = vertexContainer->begin(); vtxItr!=vertexContainer->end(); ++vtxItr, ++k) {
119 nVtxTot++;
120
121
123 for(std::vector<std::string>::const_iterator flagItr =
m_passFlags.begin(); flagItr!=
m_passFlags.end(); ++flagItr) {
124 std::string lookupstr =
name.key() +
'.' + (*flagItr);
125 const auto&
handle = handles.at(lookupstr);
128 break;
129 }
130 }
131
133
135 nVtxPass++;
136
137
139
140
141 TLorentzVector centreCandidate;
144 }
145
146 for(
uint i=0;
i<nTracks; ++
i) {
147 if(!trackMask[i]) {
150 }
151 }
152 }
153
155
156 for(
uint i=0;
i<nTracks; ++
i) {
157 if(!trackMask[i]) {
159
163 }
164 }
165 }
166 }
167 }
168 }
169 }
170
171
172 vertexContainer.keep(vtxMask);
173 }
174
175
176 m_npass += std::accumulate(trackMask.begin(), trackMask.end(), 0);
180
181 importedTrackParticles.keep(trackMask);
182 }
183
184 return StatusCode::SUCCESS;
185}
SG::ReadDecorHandleKeyArray< xAOD::VertexContainer > m_passArray
virtual FourMom_t p4() const override final
The full 4-momentum of the particle.
size_t nTrackParticles() const
Get the number of tracks associated with this vertex.
const TrackParticle * trackParticle(size_t i) const
Get the pointer to a given track that was used in vertex reco.
virtual void handle(const Incident &inc)
Handle end of run incidents to save the metadata at that point.
float j(const xAOD::IParticle &, const xAOD::TrackMeasurementValidation &hit, const Eigen::Matrix3d &jab_inv)
TrackParticle_v1 TrackParticle
Reference the current persistent version:
Vertex_v1 Vertex
Define the latest version of the vertex class.