13using Athena::Units::cm;
30 return StatusCode::SUCCESS;
43 for (
const auto& key :
m_keys) {
47 if (FormatTool->AddToEvent(
dataTypeName(), key.key() +
"_xAOD", &data).isFailure()) {
57 return StatusCode::SUCCESS;
88 for ( ; VertexItr != cont->
end(); ++VertexItr) {
90 ATH_MSG_DEBUG(
" Vertex #" << counter++ <<
" : x = " << (*VertexItr)->x()/
cm <<
", y = "
91 << (*VertexItr)->y()/
cm <<
", z[GeV] = " << (*VertexItr)->z()/
cm
92 <<
", vertexType = " << (*VertexItr)->vertexType()
93 <<
", chiSquared = " << (*VertexItr)->chiSquared()
94 <<
", numberDoF = " << (*VertexItr)->numberDoF());
100 vertexType.emplace_back(
DataType((*VertexItr)->vertexType()));
102 if ((*VertexItr)->vertexType() == 1 ){
103 primVxCand.emplace_back( 1 );
105 primVxCand.emplace_back( 0 );
110 covMatrix.emplace_back(
DataType(
"2 -.1 .5 -.01 0.002 .01"));
113 if ( (*VertexItr)->numberDoF() != 0 ){
114 chi2val = (*VertexItr)->chiSquared()/(*VertexItr)->numberDoF() ;
124 const std::vector< ElementLink< xAOD::TrackParticleContainer > > tpLinks = (*VertexItr)->trackParticleLinks();
127 unsigned int tp_size = tpLinks.size();
128 numTracks.emplace_back(
DataType( tp_size ));
130 for(
unsigned int tp = 0; tp<tp_size; ++tp)
135 <<
", collection : " << tpl.
key()
136 <<
", Tracks : " << tp <<
" out of " << tp_size <<
", own count: " << trkCnt++);
138 if ( tpl.
index() < 1000 ){
149 const std::size_t nEntries =
x.size();
154 DataMap[
"vertexType"] = std::move(vertexType);
155 DataMap[
"primVxCand"] = std::move(primVxCand);
156 DataMap[
"covMatrix multiple=\"6\""] = std::move(covMatrix);
157 const std::size_t nTracks = numTracks.size();
158 DataMap[
"numTracks"] = std::move(numTracks);
159 DataMap[
"sgkey"] = std::move(sgkey);
165 double NTracksPerVertex = tracks.size()*1./nTracks;
166 std::string tag =
"tracks multiple=\"" +
DataType(NTracksPerVertex).toString()+
"\"";
167 DataMap[tag] = std::move(tracks);
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_DEBUG(x,...)
#define ATH_MSG_WARNING(x,...)
Wrapper to avoid constant divisions when using units.
DataModel_detail::const_iterator< DataVector > const_iterator
const_iterator end() const noexcept
Return a const_iterator pointing past the end of the collection.
const_iterator begin() const noexcept
Return a const_iterator pointing at the beginning of the collection.
index_type index() const
Get the index of the element inside of its container.
sgkey_t key() const
Get the key that we reference, as a hash.
xAODVertexRetriever(const std::string &type, const std::string &name, const IInterface *parent)
Standard Constructor.
const DataMap getData(const xAOD::VertexContainer *)
Puts the variables into a DataMap.
virtual StatusCode retrieve(ToolHandle< IFormatTool > &FormatTool)
For each Vertex collections retrieve basic parameters.
virtual StatusCode initialize()
virtual std::string dataTypeName() const
Return the name of the data type that is generated by this retriever.
Gaudi::Property< std::string > m_tracksName
SG::ReadHandleKeyArray< xAOD::VertexContainer > m_keys
virtual bool isValid() override final
Can the handle be successfully dereferenced?
double chi2(TH1 *h0, TH1 *h1)
This header is shared inbetween the C-style server thread and the C++ Athena ServerSvc.
std::map< std::string, DataVect > DataMap
std::vector< DataType > DataVect
Defines a map with a key and a vector of DataType objects e.g.
VertexContainer_v1 VertexContainer
Definition of the current "Vertex container version".