41 declareInterface<IDataRetriever>(
this);
48 "if true only write primary and secondary vertex, placeholder to be removed");
64 double diff1 = ( per1->parameters()[
Trk::d0] -
66 double diff2 = ( per1->parameters()[
Trk::z0] -
68 double diff3 = ( per1->parameters()[
Trk::phi0] -
70 double diff4 = ( per1->
charge() -
72 double diff5 = ( per1->
pT() -
75 matched = diff1+diff2+diff3+diff4+diff5 == 0.;
96 std::string searchStr =
"TrackParticle";
100 if (found!=std::string::npos){
109 for(
const auto track : *tracks) {
124 for(
const auto track : *tracks) {
125 const Trk::Perigee* trackPerigee = track->perigeeParameters();
133 return StatusCode::SUCCESS;
151 if (
msgLvl(MSG::DEBUG ))
msg(MSG::DEBUG ) <<
"No VxContainer containers found in this event" <<
endmsg;
152 return StatusCode::SUCCESS;
158 if (
msgLvl(MSG::DEBUG ))
msg(MSG::DEBUG ) <<
"No Secondary vertex container found at SecVertices" <<
endmsg;
160 if (
msgLvl(MSG::DEBUG ))
msg(MSG::DEBUG ) <<
"Secondary vertex container size: " << secondaryVtxCollection->
size() <<
endmsg;
166 if (
msgLvl(MSG::WARNING))
msg(MSG::WARNING) <<
"Primary vertex container "
183 for ( ; vtxCollectionItr != vtxCollectionsEnd; ++vtxCollectionItr ) {
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;
195 <<
" with " << NVtx <<
" entries");
198 x.reserve(
x.size()+NVtx);
199 y.reserve(
y.size()+NVtx);
200 z.reserve(
z.size()+NVtx);
201 primVxCand.reserve(primVxCand.size()+NVtx);
203 sgkey.reserve(sgkey.size()+NVtx);
204 covMatrix.reserve(covMatrix.size()+NVtx);
205 numTracks.reserve(numTracks.size()+NVtx);
206 vertexType.reserve(numTracks.size()+NVtx);
209 if (!
sc.isFailure()) {
215 for ( ; vertexItr != vtxCollectionItr->end(); ++vertexItr) {
230 float this_chi2 = -1;
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);
243 <<
", this_chi2: " << this_chi2 <<
" - chi2: " << fitQuality.
chiSquared()
247 chi2.emplace_back( this_chi2 );
248 x.emplace_back( this_x );
249 y.emplace_back( this_y );
250 z.emplace_back( this_z );
254 vertexType.emplace_back( vtx_type );
255 ATH_MSG_DEBUG(
" collection " << vtxCollectionItr.
key() <<
": VertexType: " << vtx_type);
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 );
264 primVxCand.emplace_back( 0 );
279 covMatrix.emplace_back(
"2 -.1 .5 -.01 0.002 .01");
289 const std::vector<Trk::VxTrackAtVertex*>* trklist = (*vertexItr)->vxTrackAtVertex();
293 numTracks.emplace_back( trklist->size() );
296 tracks.emplace_back( -1 );
305 dataMap[
"primVxCand"] = primVxCand;
306 dataMap[
"chi2"] =
chi2;
307 dataMap[
"covMatrix multiple=\"6\""] = covMatrix;
308 dataMap[
"numTracks"] = numTracks;
309 dataMap[
"sgkey"] = sgkey;
310 dataMap[
"vertexType"] = vertexType;
313 if (!numTracks.empty()){
315 double NTracksPerVertex = tracks.size()*1./numTracks.size();
316 std::string tag =
"tracks multiple=\"" +
DataType(NTracksPerVertex).toString()+
"\"";
317 dataMap[tag] = tracks;
327 return FormatTool->AddToEvent(
dataTypeName(),
"", &dataMap);
#define ATH_MSG_WARNING(x)
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)
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.
std::string m_trackCollection
StoreGate key for track collection for association.
std::vector< const Trk::Perigee * > m_perigeeVector
std::string m_conversionVertexKey
StoreGate key for conversion candidate collection.
virtual StatusCode fillPerigeeList()
Retrieve measured perigee, automatically switch between Trk::Track and Rec::TrackParticle depending o...
std::string m_secondaryVertexKey
StoreGate key for secondary vertex candidate collection.
const std::string m_typeName
The data type that is generated by this retriever.
virtual StatusCode retrieve(ToolHandle< IFormatTool > &FormatTool)
Retrieve all the data.
VertexRetriever(const std::string &t, const std::string &n, const IInterface *p)
Standard constructor.
float m_chi2Cut
Chi^2 over NumberOfDegreesOfFreedom cut.
bool m_doWriteHLT
wether to write HLTAutoKey objects
std::string m_primaryVertexKey
StoreGate key for primary vertex candidate collection.
bool m_doWritePrimAndSecVertexOnly
write primary and secondary vertizes only - placeholder, to be removed
a const_iterator facade to DataHandle.
virtual bool isValid() override final
Can the handle be successfully dereferenced?
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
Class to represent and store fit qualities from track reconstruction in terms of and number of degre...
double charge() const
Returns the charge.
double pT() const
Access method for transverse momentum.
double chi2(TH1 *h0, TH1 *h1)
This header is shared inbetween the C-style server thread and the C++ Athena ServerSvc.
void manualPerigeeMatch(const Trk::Perigee *per1, const Trk::Perigee *per2, bool &matched)
Manually match measured perigee d0,z0,phi0 of Trk::Track and Rec::TrackParticle, some problem with di...
std::map< std::string, DataVect > DataMap
std::vector< DataType > DataVect
Defines a map with a key and a vector of DataType objects e.g.
VertexType
This file defines the enums in the Trk namespace for the different vertex types.
ParametersT< TrackParametersDim, Charged, PerigeeSurface > Perigee