Retrieve all the data.
For all vertex collections retrieve all data.
143 {
144
146
147
148
149 SG::ConstIterator<VxContainer> vtxCollectionItr, vtxCollectionsEnd;
151 if (
msgLvl(MSG::DEBUG ))
msg(MSG::DEBUG ) <<
"No VxContainer containers found in this event" <<
endmsg;
152 return StatusCode::SUCCESS;
153 }
154
155
158 if (
msgLvl(MSG::DEBUG ))
msg(MSG::DEBUG ) <<
"No Secondary vertex container found at SecVertices" <<
endmsg;
159 }else{
160 if (
msgLvl(MSG::DEBUG ))
msg(MSG::DEBUG ) <<
"Secondary vertex container size: " << secondaryVtxCollection->
size() <<
endmsg;
161 }
162
163
166 if (
msgLvl(MSG::WARNING))
msg(MSG::WARNING) <<
"Primary vertex container "
168 }
169
170
181
182
183 for ( ; vtxCollectionItr != vtxCollectionsEnd; ++vtxCollectionItr ) {
184
185
186 if ( (!
m_doWriteHLT) && ( vtxCollectionItr.
key().find(
"HLT") != std::string::npos)){
187 if (
msgLvl(MSG::DEBUG))
msg(MSG::DEBUG) <<
"Ignoring HLT collection " << vtxCollectionItr.
key() <<
endmsg;
188 continue;
189 }
190
191
193
195 << " with " << NVtx << " entries");
196
197
198 x.reserve(
x.size()+NVtx);
199 y.reserve(
y.size()+NVtx);
200 z.reserve(
z.size()+NVtx);
201 primVxCand.reserve(primVxCand.size()+NVtx);
205 numTracks.reserve(numTracks.size()+NVtx);
207
209 if (!
sc.isFailure()) {
211 }
212
213
215 for ( ; vertexItr != vtxCollectionItr->end(); ++vertexItr) {
217
218
219
220
222
226
227 Trk::FitQuality
fitQuality = (*vertexItr)->recVertex().fitQuality();
228
229
230 float this_chi2 = -1;
233 }
234
236
237 float this_x = (*vertexItr)->recVertex().position().x()/10.;
238 float this_y = (*vertexItr)->recVertex().position().y()/10.;
239 float this_z = (*vertexItr)->recVertex().position().z()/10.;
240 float R = std::hypot (this_x, this_y);
241
244
245 << ", R: " << R);
246
247 chi2.emplace_back( this_chi2 );
248 x.emplace_back( this_x );
249 y.emplace_back( this_y );
250 z.emplace_back( this_z );
251
252
255 ATH_MSG_DEBUG(
" collection " << vtxCollectionItr.
key() <<
": VertexType: " << vtx_type);
256
257
258 if ( &(*vtxCollectionItr) == primaryVtxCollection ){
259 if (
Trk::PriVtx == vtx_type ){ primVxCand.emplace_back( 1 );
260 }else{ primVxCand.emplace_back( 0 ); }
261 }else if ( &(*vtxCollectionItr) == secondaryVtxCollection ){
262 primVxCand.emplace_back( 2 );
263 }else{
264 primVxCand.emplace_back( 0 );
265 }
266
267
269
270
271
272
273
274
279 covMatrix.emplace_back(
"2 -.1 .5 -.01 0.002 .01");
280
285
286
287
288
289 const std::vector<Trk::VxTrackAtVertex*>* trklist = (*vertexItr)->vxTrackAtVertex();
290
292
293 numTracks.emplace_back( trklist->size() );
295
296 tracks.emplace_back( -1 );
297 }
298 }
299
300
305 dataMap[
"primVxCand"] = primVxCand;
308 dataMap[
"numTracks"] = numTracks;
311
312
313 if (!numTracks.empty()){
314
315 double NTracksPerVertex = tracks.size()*1./numTracks.size();
316 std::string
tag =
"tracks multiple=\"" +
DataType(NTracksPerVertex).toString()+
"\"";
319
320
321 }
322
326
327 return FormatTool->AddToEvent(
dataTypeName(),
"", &dataMap);
328
329 }
Athena::TPCnvVers::Old VxContainer
ServiceHandle< StoreGateSvc > & evtStore()
bool msgLvl(const MSG::Level lvl) const
DataModel_detail::const_iterator< DataVector > const_iterator
typename DataVectorBase< Trk::VxCandidate >::Base::size_type size_type
size_type size() const noexcept
Returns the number of elements in the collection.
virtual std::string dataTypeName() const
Return the name of the data type.
virtual StatusCode fillPerigeeList()
Retrieve measured perigee, automatically switch between Trk::Track and Rec::TrackParticle depending o...
virtual StatusCode retrieve(ToolHandle< IFormatTool > &FormatTool)
Retrieve all the data.
const std::string & key() const
Get the key string with which the current object was stored.
double chiSquared() const
returns the of the overall track fit
double doubleNumberDoF() const
returns the number of degrees of freedom of the overall track or vertex fit as double
double chi2(TH1 *h0, TH1 *h1)
double R(const INavigable4Momentum *p1, const double v_eta, const double v_phi)
::StatusCode StatusCode
StatusCode definition for legacy code.
std::map< std::string, DataVect > DataMap
std::vector< DataType > DataVect
Defines a map with a key and a vector of DataType objects e.g.
FitQualityOnSurface fitQuality(const MultiComponentState &, const MeasurementBase &)
Method for determining the chi2 of the multi-component state and the number of degrees of freedom.
VertexType
This file defines the enums in the Trk namespace for the different vertex types.