ATLAS Offline Software
Public Member Functions | Static Public Member Functions | Protected Member Functions | Private Types | Private Member Functions | Private Attributes | List of all members
JiveXML::VertexRetriever Class Reference

Retrieves all Trk::VxCandidate objects. More...

#include <VertexRetriever.h>

Inheritance diagram for JiveXML::VertexRetriever:
Collaboration diagram for JiveXML::VertexRetriever:

Public Member Functions

 VertexRetriever (const std::string &t, const std::string &n, const IInterface *p)
 Standard constructor. More...
 
virtual StatusCode retrieve (ToolHandle< IFormatTool > &FormatTool)
 Retrieve all the data. More...
 
virtual std::string dataTypeName () const
 Return the name of the data type. More...
 
ServiceHandle< StoreGateSvc > & evtStore ()
 The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc. More...
 
const ServiceHandle< StoreGateSvc > & evtStore () const
 The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc. More...
 
const ServiceHandle< StoreGateSvc > & detStore () const
 The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc. More...
 
virtual StatusCode sysInitialize () override
 Perform system initialization for an algorithm. More...
 
virtual StatusCode sysStart () override
 Handle START transition. More...
 
virtual std::vector< Gaudi::DataHandle * > inputHandles () const override
 Return this algorithm's input handles. More...
 
virtual std::vector< Gaudi::DataHandle * > outputHandles () const override
 Return this algorithm's output handles. More...
 
Gaudi::Details::PropertyBase & declareProperty (Gaudi::Property< T > &t)
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, SG::VarHandleKey &hndl, const std::string &doc, const SG::VarHandleKeyType &)
 Declare a new Gaudi property. More...
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, SG::VarHandleBase &hndl, const std::string &doc, const SG::VarHandleType &)
 Declare a new Gaudi property. More...
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, SG::VarHandleKeyArray &hndArr, const std::string &doc, const SG::VarHandleKeyArrayType &)
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, T &property, const std::string &doc, const SG::NotHandleType &)
 Declare a new Gaudi property. More...
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, T &property, const std::string &doc="none")
 Declare a new Gaudi property. More...
 
void updateVHKA (Gaudi::Details::PropertyBase &)
 
MsgStream & msg () const
 
MsgStream & msg (const MSG::Level lvl) const
 
bool msgLvl (const MSG::Level lvl) const
 

Static Public Member Functions

static const InterfaceID & interfaceID ()
 Return the interface identifier. More...
 

Protected Member Functions

void renounceArray (SG::VarHandleKeyArray &handlesArray)
 remove all handles from I/O resolution More...
 
std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > renounce (T &h)
 
void extraDeps_update_handler (Gaudi::Details::PropertyBase &ExtraDeps)
 Add StoreName to extra input/output deps as needed. More...
 

Private Types

typedef ServiceHandle< StoreGateSvcStoreGateSvc_t
 

Private Member Functions

virtual StatusCode fillPerigeeList ()
 Retrieve measured perigee, automatically switch between Trk::Track and Rec::TrackParticle depending on selected input collection for tracks. More...
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
 specialization for handling Gaudi::Property<SG::VarHandleKey> More...
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleKeyArrayType &)
 specialization for handling Gaudi::Property<SG::VarHandleKeyArray> More...
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleType &)
 specialization for handling Gaudi::Property<SG::VarHandleBase> More...
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T > &t, const SG::NotHandleType &)
 specialization for handling everything that's not a Gaudi::Property<SG::VarHandleKey> or a <SG::VarHandleKeyArray> More...
 

Private Attributes

std::string m_primaryVertexKey
 StoreGate key for primary vertex candidate collection. More...
 
std::string m_secondaryVertexKey
 StoreGate key for secondary vertex candidate collection. More...
 
std::string m_conversionVertexKey
 StoreGate key for conversion candidate collection. More...
 
bool m_doWriteHLT
 wether to write HLTAutoKey objects More...
 
bool m_doWritePrimAndSecVertexOnly
 write primary and secondary vertizes only - placeholder, to be removed More...
 
std::string m_trackCollection
 StoreGate key for track collection for association. More...
 
float m_chi2Cut
 Chi^2 over NumberOfDegreesOfFreedom cut. More...
 
const std::string m_typeName
 The data type that is generated by this retriever. More...
 
std::vector< const Trk::Perigee * > m_perigeeVector
 
StoreGateSvc_t m_evtStore
 Pointer to StoreGate (event store by default) More...
 
StoreGateSvc_t m_detStore
 Pointer to StoreGate (detector store by default) More...
 
std::vector< SG::VarHandleKeyArray * > m_vhka
 
bool m_varHandleArraysDeclared
 

Detailed Description

Retrieves all Trk::VxCandidate objects.

Definition at line 33 of file VertexRetriever.h.

Member Typedef Documentation

◆ StoreGateSvc_t

typedef ServiceHandle<StoreGateSvc> AthCommonDataStore< AthCommonMsg< AlgTool > >::StoreGateSvc_t
privateinherited

Definition at line 388 of file AthCommonDataStore.h.

Constructor & Destructor Documentation

◆ VertexRetriever()

JiveXML::VertexRetriever::VertexRetriever ( const std::string &  type,
const std::string &  name,
const IInterface *  parent 
)

Standard constructor.

This is the standard AthAlgTool constructor.

Parameters
typeAlgTool type name
nameAlgTool instance name
parentAlgTools parent owning this tool

Definition at line 36 of file VertexRetriever.cxx.

36  :
38  m_typeName("RVx"){
39 
40  //Declare the interface
41  declareInterface<IDataRetriever>(this);
42 
43  //Declare AlgTool properties
44  declareProperty("PrimaryVertexCollection", m_primaryVertexKey = "VxPrimaryCandidate", "Vertices to use as primary vertex");
45  declareProperty("SecondaryVertexCollection", m_secondaryVertexKey = "SecVertices", "Vertices to use as secondary vertex");
46  declareProperty("ConversionVertexCollection", m_conversionVertexKey = "ConversionCandidate", "Vertices to use as conversion vertex");
47  declareProperty("DoWritePrimAndSecVertexOnly", m_doWritePrimAndSecVertexOnly = false,
48  "if true only write primary and secondary vertex, placeholder to be removed");
49  declareProperty("DoWriteHLT", m_doWriteHLT = false, "whether to write HLTAutoKey objects");
50  declareProperty("TrackCollection", m_trackCollection = "Tracks");
51  declareProperty("Chi2OverDOFCut", m_chi2Cut = 10.); // <10 is 'tight', <100 is 'loose'
52  }

Member Function Documentation

◆ dataTypeName()

virtual std::string JiveXML::VertexRetriever::dataTypeName ( ) const
inlinevirtual

Return the name of the data type.

Implements JiveXML::IDataRetriever.

Definition at line 45 of file VertexRetriever.h.

45 { return m_typeName; };

◆ declareGaudiProperty() [1/4]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< AlgTool > >::declareGaudiProperty ( Gaudi::Property< T > &  hndl,
const SG::VarHandleKeyArrayType  
)
inlineprivateinherited

specialization for handling Gaudi::Property<SG::VarHandleKeyArray>

Definition at line 170 of file AthCommonDataStore.h.

172  {
173  return *AthCommonDataStore<PBASE>::declareProperty(hndl.name(),
174  hndl.value(),
175  hndl.documentation());
176 
177  }

◆ declareGaudiProperty() [2/4]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< AlgTool > >::declareGaudiProperty ( Gaudi::Property< T > &  hndl,
const SG::VarHandleKeyType  
)
inlineprivateinherited

specialization for handling Gaudi::Property<SG::VarHandleKey>

Definition at line 156 of file AthCommonDataStore.h.

158  {
159  return *AthCommonDataStore<PBASE>::declareProperty(hndl.name(),
160  hndl.value(),
161  hndl.documentation());
162 
163  }

◆ declareGaudiProperty() [3/4]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< AlgTool > >::declareGaudiProperty ( Gaudi::Property< T > &  hndl,
const SG::VarHandleType  
)
inlineprivateinherited

specialization for handling Gaudi::Property<SG::VarHandleBase>

Definition at line 184 of file AthCommonDataStore.h.

186  {
187  return *AthCommonDataStore<PBASE>::declareProperty(hndl.name(),
188  hndl.value(),
189  hndl.documentation());
190  }

◆ declareGaudiProperty() [4/4]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< AlgTool > >::declareGaudiProperty ( Gaudi::Property< T > &  t,
const SG::NotHandleType  
)
inlineprivateinherited

specialization for handling everything that's not a Gaudi::Property<SG::VarHandleKey> or a <SG::VarHandleKeyArray>

Definition at line 199 of file AthCommonDataStore.h.

200  {
201  return PBASE::declareProperty(t);
202  }

◆ declareProperty() [1/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty ( const std::string &  name,
SG::VarHandleBase hndl,
const std::string &  doc,
const SG::VarHandleType  
)
inlineinherited

Declare a new Gaudi property.

Parameters
nameName of the property.
hndlObject holding the property value.
docDocumentation string for the property.

This is the version for types that derive from SG::VarHandleBase. The property value object is put on the input and output lists as appropriate; then we forward to the base class.

Definition at line 245 of file AthCommonDataStore.h.

249  {
250  this->declare(hndl.vhKey());
251  hndl.vhKey().setOwner(this);
252 
253  return PBASE::declareProperty(name,hndl,doc);
254  }

◆ declareProperty() [2/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty ( const std::string &  name,
SG::VarHandleKey hndl,
const std::string &  doc,
const SG::VarHandleKeyType  
)
inlineinherited

Declare a new Gaudi property.

Parameters
nameName of the property.
hndlObject holding the property value.
docDocumentation string for the property.

This is the version for types that derive from SG::VarHandleKey. The property value object is put on the input and output lists as appropriate; then we forward to the base class.

Definition at line 221 of file AthCommonDataStore.h.

225  {
226  this->declare(hndl);
227  hndl.setOwner(this);
228 
229  return PBASE::declareProperty(name,hndl,doc);
230  }

◆ declareProperty() [3/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty ( const std::string &  name,
SG::VarHandleKeyArray hndArr,
const std::string &  doc,
const SG::VarHandleKeyArrayType  
)
inlineinherited

Definition at line 259 of file AthCommonDataStore.h.

263  {
264 
265  // std::ostringstream ost;
266  // ost << Algorithm::name() << " VHKA declareProp: " << name
267  // << " size: " << hndArr.keys().size()
268  // << " mode: " << hndArr.mode()
269  // << " vhka size: " << m_vhka.size()
270  // << "\n";
271  // debug() << ost.str() << endmsg;
272 
273  hndArr.setOwner(this);
274  m_vhka.push_back(&hndArr);
275 
276  Gaudi::Details::PropertyBase* p = PBASE::declareProperty(name, hndArr, doc);
277  if (p != 0) {
278  p->declareUpdateHandler(&AthCommonDataStore<PBASE>::updateVHKA, this);
279  } else {
280  ATH_MSG_ERROR("unable to call declareProperty on VarHandleKeyArray "
281  << name);
282  }
283 
284  return p;
285 
286  }

◆ declareProperty() [4/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty ( const std::string &  name,
T &  property,
const std::string &  doc,
const SG::NotHandleType  
)
inlineinherited

Declare a new Gaudi property.

Parameters
nameName of the property.
propertyObject holding the property value.
docDocumentation string for the property.

This is the generic version, for types that do not derive from SG::VarHandleKey. It just forwards to the base class version of declareProperty.

Definition at line 333 of file AthCommonDataStore.h.

337  {
338  return PBASE::declareProperty(name, property, doc);
339  }

◆ declareProperty() [5/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty ( const std::string &  name,
T &  property,
const std::string &  doc = "none" 
)
inlineinherited

Declare a new Gaudi property.

Parameters
nameName of the property.
propertyObject holding the property value.
docDocumentation string for the property.

This dispatches to either the generic declareProperty or the one for VarHandle/Key/KeyArray.

Definition at line 352 of file AthCommonDataStore.h.

355  {
356  typedef typename SG::HandleClassifier<T>::type htype;
357  return declareProperty (name, property, doc, htype());
358  }

◆ declareProperty() [6/6]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty ( Gaudi::Property< T > &  t)
inlineinherited

Definition at line 145 of file AthCommonDataStore.h.

145  {
146  typedef typename SG::HandleClassifier<T>::type htype;
148  }

◆ detStore()

const ServiceHandle<StoreGateSvc>& AthCommonDataStore< AthCommonMsg< AlgTool > >::detStore ( ) const
inlineinherited

The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 95 of file AthCommonDataStore.h.

95 { return m_detStore; }

◆ evtStore() [1/2]

ServiceHandle<StoreGateSvc>& AthCommonDataStore< AthCommonMsg< AlgTool > >::evtStore ( )
inlineinherited

The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 85 of file AthCommonDataStore.h.

85 { return m_evtStore; }

◆ evtStore() [2/2]

const ServiceHandle<StoreGateSvc>& AthCommonDataStore< AthCommonMsg< AlgTool > >::evtStore ( ) const
inlineinherited

The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 90 of file AthCommonDataStore.h.

90 { return m_evtStore; }

◆ extraDeps_update_handler()

void AthCommonDataStore< AthCommonMsg< AlgTool > >::extraDeps_update_handler ( Gaudi::Details::PropertyBase &  ExtraDeps)
protectedinherited

Add StoreName to extra input/output deps as needed.

use the logic of the VarHandleKey to parse the DataObjID keys supplied via the ExtraInputs and ExtraOuputs Properties to add the StoreName if it's not explicitly given

◆ fillPerigeeList()

StatusCode JiveXML::VertexRetriever::fillPerigeeList ( )
privatevirtual

Retrieve measured perigee, automatically switch between Trk::Track and Rec::TrackParticle depending on selected input collection for tracks.

read TrackParticleCollection to compare Perigee and ordering

Definition at line 84 of file VertexRetriever.cxx.

84  {
85 
87 // from:
88 // http://atlas-sw.cern.ch/cgi-bin/viewcvs-all.cgi/users/jsvirzi/PhysicsAnalysis/Atlas_ESD_Analysis/src/Atlas_ESD_Analysis.cxx?root=atlas&view=co
90 // InnerDetector/InDetMonitoring/InDetAlignmentMonitoring/TrackSplitterTool.cxx
92 // const Trk::Perigee* trackPerigee = inputTrack->perigeeParameters();
93 // const Trk::perigee* perigee = dynamic_cast<const Trk::perigee*>( trackPerigee );
94 // double m_d0 = perigee->parameters()[Trk::d0];
95 
96  const Rec::TrackParticleContainer* tracks = nullptr ;
97  const TrackCollection* trktracks = nullptr ;
98 
99  size_t found;
100  std::string searchStr = "TrackParticle";
101  found=m_trackCollection.find(searchStr);
102 
103  m_perigeeVector.clear(); // need to clear, otherwise accumulates over events
104  if (found!=std::string::npos){ // User selected a Rec::TrackParticle Collection
105  if (evtStore()->retrieve(tracks, m_trackCollection).isFailure()){
106  if (msgLvl(MSG::WARNING)) msg(MSG::WARNING) << "Unable to retrieve track collection"
107  << m_trackCollection << " for association "<< endmsg;
108  } else {
109  if (msgLvl(MSG::DEBUG)) msg(MSG::DEBUG) << "Retrieved " <<
111 
113  for(track=tracks->begin();track!=tracks->end();++track) {
114  const Trk::Perigee *perigee = (*track)->perigee();
115 // if(perigee == 0) continue; // not skip ! need to keep order for index !
116  m_perigeeVector.push_back( perigee ); // this perigee match works !
117  }
118  }
119  }else{ // it's a Trk::Tracks collection
120  if (msgLvl(MSG::DEBUG)) msg(MSG::DEBUG) << " User selected a Trk::Track collection ! " << endmsg;
121 
122  if (evtStore()->retrieve(trktracks, m_trackCollection).isFailure()){
123  if (msgLvl(MSG::WARNING)) msg(MSG::WARNING) << "Unable to retrieve track collection"
124  << m_trackCollection << " for association "<< endmsg;
125  } else {
126  if (msgLvl(MSG::DEBUG)) msg(MSG::DEBUG) << "Retrieved " <<
129  for(track=trktracks->begin();track!=trktracks->end();++track) {
130  const Trk::Perigee* trackPerigee = (*track)->perigeeParameters();
131  //const Trk::Perigee *perigee = dynamic_cast<const Trk::Perigee*>( trackPerigee );
132 // if(perigee == 0) continue; // not skip ! need to keep order for index !
133 // m_perigeeVector.push_back( perigee );
134  m_perigeeVector.push_back( trackPerigee );
135  }
136  }
137  }
138  return StatusCode::SUCCESS;
139  }

◆ inputHandles()

virtual std::vector<Gaudi::DataHandle*> AthCommonDataStore< AthCommonMsg< AlgTool > >::inputHandles ( ) const
overridevirtualinherited

Return this algorithm's input handles.

We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.

◆ interfaceID()

const InterfaceID & JiveXML::IDataRetriever::interfaceID ( )
inlinestaticinherited

Return the interface identifier.

Definition at line 40 of file IDataRetriever.h.

40 { return IID_IDataRetriever; }

◆ msg() [1/2]

MsgStream& AthCommonMsg< AlgTool >::msg ( ) const
inlineinherited

Definition at line 24 of file AthCommonMsg.h.

24  {
25  return this->msgStream();
26  }

◆ msg() [2/2]

MsgStream& AthCommonMsg< AlgTool >::msg ( const MSG::Level  lvl) const
inlineinherited

Definition at line 27 of file AthCommonMsg.h.

27  {
28  return this->msgStream(lvl);
29  }

◆ msgLvl()

bool AthCommonMsg< AlgTool >::msgLvl ( const MSG::Level  lvl) const
inlineinherited

Definition at line 30 of file AthCommonMsg.h.

30  {
31  return this->msgLevel(lvl);
32  }

◆ outputHandles()

virtual std::vector<Gaudi::DataHandle*> AthCommonDataStore< AthCommonMsg< AlgTool > >::outputHandles ( ) const
overridevirtualinherited

Return this algorithm's output handles.

We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.

◆ renounce()

std::enable_if_t<std::is_void_v<std::result_of_t<decltype(&T::renounce)(T)> > && !std::is_base_of_v<SG::VarHandleKeyArray, T> && std::is_base_of_v<Gaudi::DataHandle, T>, void> AthCommonDataStore< AthCommonMsg< AlgTool > >::renounce ( T &  h)
inlineprotectedinherited

Definition at line 380 of file AthCommonDataStore.h.

381  {
382  h.renounce();
383  PBASE::renounce (h);
384  }

◆ renounceArray()

void AthCommonDataStore< AthCommonMsg< AlgTool > >::renounceArray ( SG::VarHandleKeyArray handlesArray)
inlineprotectedinherited

remove all handles from I/O resolution

Definition at line 364 of file AthCommonDataStore.h.

364  {
365  handlesArray.renounce();
366  }

◆ retrieve()

StatusCode JiveXML::VertexRetriever::retrieve ( ToolHandle< IFormatTool > &  FormatTool)
virtual

Retrieve all the data.

For all vertex collections retrieve all data.

  • loop over vertices in all collections
  • for each vertex get basic coordinates and fit parameters
  • find index in track collection for each track associated with this vertex
    Parameters
    FormatToolthe tool that will create formated output from the DataMap

Step 1: Fill in all the basic parameters that should be always there

Step 2: Get track associations

Implements JiveXML::IDataRetriever.

Definition at line 148 of file VertexRetriever.cxx.

148  {
149 
150  //Get an iterator over all vertex collections,
151  //return if there are none
152  SG::ConstIterator<VxContainer> vtxCollectionItr, vtxCollectionsEnd;
153  if (evtStore()->retrieve(vtxCollectionItr,vtxCollectionsEnd).isFailure()) {
154  if (msgLvl(MSG::DEBUG )) msg(MSG::DEBUG ) << "No VxContainer containers found in this event" << endmsg;
155  return StatusCode::SUCCESS;
156  }
157 
158  //See if we can find the requested secondary vertex collection
159  const VxContainer* secondaryVtxCollection;
160  if (evtStore()->retrieve(secondaryVtxCollection,m_secondaryVertexKey).isFailure()) {
161  if (msgLvl(MSG::DEBUG )) msg(MSG::DEBUG ) << "No Secondary vertex container found at SecVertices" << endmsg;
162  }else{
163  if (msgLvl(MSG::DEBUG )) msg(MSG::DEBUG ) << "Secondary vertex container size: " << secondaryVtxCollection->size() << endmsg;
164  }
165 
166  //See if we can find the requested primary vertex collection
167  const VxContainer* primaryVtxCollection;
168  if ( evtStore()->retrieve(primaryVtxCollection,m_primaryVertexKey).isFailure()) {
169  if (msgLvl(MSG::WARNING)) msg(MSG::WARNING) << "Primary vertex container "
170  << m_primaryVertexKey << " not found" << endmsg;
171  }
172 
173  //Declare all the data vectors we want to retrieve
174  DataVect x;
175  DataVect y;
176  DataVect z;
177  DataVect primVxCand;
178  DataVect chi2;
179  DataVect sgkey;
181  DataVect numTracks;
182  DataVect tracks;
184 
185  //Loop over all vertex containers
186  for ( ; vtxCollectionItr != vtxCollectionsEnd; ++vtxCollectionItr ) {
187 
188  //Check whether we should ignore HLTAutoKey collections
189  if ( (!m_doWriteHLT) && ( vtxCollectionItr.key().find("HLT") != std::string::npos)){
190  if (msgLvl(MSG::DEBUG)) msg(MSG::DEBUG) << "Ignoring HLT collection " << vtxCollectionItr.key() << endmsg;
191  continue;
192  }
193 
194  //Get size of current container
195  VxContainer::size_type NVtx = vtxCollectionItr->size();
196 
197  //Be a bit verbose
198  if (msgLvl(MSG::DEBUG)) msg(MSG::DEBUG) << "Reading vertex container " << vtxCollectionItr.key()
199  << " with " << NVtx << " entries" << endmsg;
200 
201  //Declare all the data vectors we want to retrieve and reserve space
202  x.reserve(x.size()+NVtx);
203  y.reserve(y.size()+NVtx);
204  z.reserve(z.size()+NVtx);
205  primVxCand.reserve(primVxCand.size()+NVtx);
206  chi2.reserve(chi2.size()+NVtx);
207  sgkey.reserve(sgkey.size()+NVtx);
208  covMatrix.reserve(covMatrix.size()+NVtx);
209  numTracks.reserve(numTracks.size()+NVtx);
210  vertexType.reserve(numTracks.size()+NVtx);
211 
213  if (!sc.isFailure()) {
214  if (msgLvl(MSG::DEBUG)) msg(MSG::DEBUG) << "Perigee list filled with " << m_perigeeVector.size()
215  << " entries " << endmsg;
216  }
217 
218  //Loop over vertices
219  VxContainer::const_iterator vertexItr = vtxCollectionItr->begin();
220  for ( ; vertexItr != vtxCollectionItr->end(); ++vertexItr) {
222 // if ( m_doWritePrimAndSecVertexOnly && vtxCollectionItr.key() == m_conversionVertexKey ){
223 // if (msgLvl(MSG::DEBUG)){ msg(MSG::DEBUG) << " DoWritePrimAndSecVertexOnly switch true - skipping "
224 // << vtxCollectionItr.key() << endmsg; }
225 // continue; }
227 
231  //Get fit quality object
232  Trk::FitQuality fitQuality = (*vertexItr)->recVertex().fitQuality();
233 
234  //degrees of freedom might be zero - beware
235  float this_chi2 = -1;
236  if ( fitQuality.doubleNumberDoF() != 0 ){
238  }
239  //Cut: on Chi^2 over NumberOfDegreesOfFreedom only for ConversionCandidate
240  if ( this_chi2 > m_chi2Cut && ( vtxCollectionItr.key() == m_conversionVertexKey )) continue;
241 
242  float this_x = (*vertexItr)->recVertex().position().x()/10.; //Atlantis units are cm
243  float this_y = (*vertexItr)->recVertex().position().y()/10.;
244  float this_z = (*vertexItr)->recVertex().position().z()/10.;
245  float R = std::hypot (this_x, this_y); // distance from beamline
246 
247  if (msgLvl(MSG::DEBUG)){ msg(MSG::DEBUG) << " Collection: " << vtxCollectionItr.key()
248  << ", this_chi2: " << this_chi2 << " - chi2: " << fitQuality.chiSquared()
249 // << " ," << (*vertexItr)->recVertex().position().x()/10. << " ," << (*vertexItr)->recVertex().position().x()*CLHEP::cm
250  << ", R: " << R << endmsg; }
251 
252  chi2.emplace_back( this_chi2 );
253  x.emplace_back( this_x );
254  y.emplace_back( this_y );
255  z.emplace_back( this_z );
256 
257  // from: Tracking/TrkEvent/TrkEventPrimitives/VertexType.h
258  const Trk::VertexType vtx_type = (*vertexItr)->vertexType();
259  vertexType.emplace_back( vtx_type );
260  if (msgLvl(MSG::DEBUG)){ msg(MSG::DEBUG) << " collection " << vtxCollectionItr.key() << ": VertexType: " << vtx_type << endmsg; }
261 
262  //Store primary vertex candidate flag
263  if ( &(*vtxCollectionItr) == primaryVtxCollection ){
264  if ( Trk::PriVtx == vtx_type ){ primVxCand.emplace_back( 1 ); // type 1 'real' primary vertex
265  }else{ primVxCand.emplace_back( 0 ); } // hack ! 'type 3 pileup' Should properly use 'vertexType'
266  }else if ( &(*vtxCollectionItr) == secondaryVtxCollection ){
267  primVxCand.emplace_back( 2 ); // normally those are 'type 9 Kshort'
268  }else{
269  primVxCand.emplace_back( 0 );
270  }
271 
272 // !!! This doesn't work after Migration. 'errorposition' not known anymore ? jpt Dec'13 !!!
274  //double scale = (CLHEP::cm*CLHEP::cm)/(CLHEP::mm*CLHEP::mm); // in order to convert the covMatrix elements from (mm)^2 to (cm)^2 divide them by 100
275  //double precision = 10000; //// otherwise you sometimes loose precision by putting only 6 decimal points into the xml
276  //for (int i = 0;i<3; i++)
277  //for (int j = 0; j<i+1; j++ )
278  //covMatrix.push_back (DataType((*vertexItr)->recVertex().errorPosition().covariance()[i][j]/scale*precision ));
279 //-----------
284  covMatrix.emplace_back("2 -.1 .5 -.01 0.002 .01");
285 
291 //---- association from:
292 //---- from http://alxr.usatlas.bnl.gov/lxr/source/atlas/Reconstruction/tauRec/src/PhotonConversionPID.cxx
293 
294  const std::vector<Trk::VxTrackAtVertex*>* trklist = (*vertexItr)->vxTrackAtVertex();
295 
296  if (msgLvl(MSG::DEBUG)) msg(MSG::DEBUG) << "Tracks at vertex: " << trklist->size() << endmsg;
297 
298  numTracks.emplace_back( trklist->size() );
299  sgkey.emplace_back( m_trackCollection ); // sgkey in current scheme is _not_ a multiple !
300 
301  tracks.emplace_back( -1 );
302  }
303  } // loop over vertex containers
304 
305  //Finally add all retrieved data to the data map
307  dataMap["x"] = x;
308  dataMap["y"] = y;
309  dataMap["z"] = z;
310  dataMap["primVxCand"] = primVxCand;
311  dataMap["chi2"] = chi2;
312  dataMap["covMatrix multiple=\"6\""] = covMatrix;
313  dataMap["numTracks"] = numTracks;
314  dataMap["sgkey"] = sgkey;
315  dataMap["vertexType"] = vertexType;
316 
317  //If there had been any tracks, add a tag
318  if (!numTracks.empty()){
319  //Calculate average number of tracks per vertex
320  double NTracksPerVertex = tracks.size()*1./numTracks.size();
321  std::string tag = "tracks multiple=\"" +DataType(NTracksPerVertex).toString()+"\"";
322  dataMap[tag] = tracks;
324 // std::string tag2 = "sgkey multiple=\"" +DataType(NTracksPerVertex).toString()+"\"";
325 // dataMap[tag2] = sgkey;
326  }
327 
331  //return FormatTool->AddToEvent(dataTypeName(), "PrimSecConvRecVx", &dataMap);
332  return FormatTool->AddToEvent(dataTypeName(), "", &dataMap);
333 
334  } // end retrieve

◆ sysInitialize()

virtual StatusCode AthCommonDataStore< AthCommonMsg< AlgTool > >::sysInitialize ( )
overridevirtualinherited

Perform system initialization for an algorithm.

We override this to declare all the elements of handle key arrays at the end of initialization. See comments on updateVHKA.

Reimplemented in DerivationFramework::CfAthAlgTool, AthCheckedComponent< AthAlgTool >, AthCheckedComponent<::AthAlgTool >, and asg::AsgMetadataTool.

◆ sysStart()

virtual StatusCode AthCommonDataStore< AthCommonMsg< AlgTool > >::sysStart ( )
overridevirtualinherited

Handle START transition.

We override this in order to make sure that conditions handle keys can cache a pointer to the conditions container.

◆ updateVHKA()

void AthCommonDataStore< AthCommonMsg< AlgTool > >::updateVHKA ( Gaudi::Details::PropertyBase &  )
inlineinherited

Definition at line 308 of file AthCommonDataStore.h.

308  {
309  // debug() << "updateVHKA for property " << p.name() << " " << p.toString()
310  // << " size: " << m_vhka.size() << endmsg;
311  for (auto &a : m_vhka) {
312  std::vector<SG::VarHandleKey*> keys = a->keys();
313  for (auto k : keys) {
314  k->setOwner(this);
315  }
316  }
317  }

Member Data Documentation

◆ m_chi2Cut

float JiveXML::VertexRetriever::m_chi2Cut
private

Chi^2 over NumberOfDegreesOfFreedom cut.

Definition at line 65 of file VertexRetriever.h.

◆ m_conversionVertexKey

std::string JiveXML::VertexRetriever::m_conversionVertexKey
private

StoreGate key for conversion candidate collection.

Definition at line 56 of file VertexRetriever.h.

◆ m_detStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< AlgTool > >::m_detStore
privateinherited

Pointer to StoreGate (detector store by default)

Definition at line 393 of file AthCommonDataStore.h.

◆ m_doWriteHLT

bool JiveXML::VertexRetriever::m_doWriteHLT
private

wether to write HLTAutoKey objects

Definition at line 58 of file VertexRetriever.h.

◆ m_doWritePrimAndSecVertexOnly

bool JiveXML::VertexRetriever::m_doWritePrimAndSecVertexOnly
private

write primary and secondary vertizes only - placeholder, to be removed

Definition at line 60 of file VertexRetriever.h.

◆ m_evtStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< AlgTool > >::m_evtStore
privateinherited

Pointer to StoreGate (event store by default)

Definition at line 390 of file AthCommonDataStore.h.

◆ m_perigeeVector

std::vector<const Trk::Perigee*> JiveXML::VertexRetriever::m_perigeeVector
private

Definition at line 70 of file VertexRetriever.h.

◆ m_primaryVertexKey

std::string JiveXML::VertexRetriever::m_primaryVertexKey
private

StoreGate key for primary vertex candidate collection.

Definition at line 52 of file VertexRetriever.h.

◆ m_secondaryVertexKey

std::string JiveXML::VertexRetriever::m_secondaryVertexKey
private

StoreGate key for secondary vertex candidate collection.

Definition at line 54 of file VertexRetriever.h.

◆ m_trackCollection

std::string JiveXML::VertexRetriever::m_trackCollection
private

StoreGate key for track collection for association.

Definition at line 63 of file VertexRetriever.h.

◆ m_typeName

const std::string JiveXML::VertexRetriever::m_typeName
private

The data type that is generated by this retriever.

Definition at line 68 of file VertexRetriever.h.

◆ m_varHandleArraysDeclared

bool AthCommonDataStore< AthCommonMsg< AlgTool > >::m_varHandleArraysDeclared
privateinherited

Definition at line 399 of file AthCommonDataStore.h.

◆ m_vhka

std::vector<SG::VarHandleKeyArray*> AthCommonDataStore< AthCommonMsg< AlgTool > >::m_vhka
privateinherited

Definition at line 398 of file AthCommonDataStore.h.


The documentation for this class was generated from the following files:
common.sgkey
def sgkey(tool)
Definition: common.py:1028
JiveXML::VertexRetriever::m_perigeeVector
std::vector< const Trk::Perigee * > m_perigeeVector
Definition: VertexRetriever.h:70
DataModel_detail::const_iterator
Const iterator class for DataVector/DataList.
Definition: DVLIterator.h:82
AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
Definition: AthCommonDataStore.h:145
SG::detail::IteratorBase::key
const std::string & key() const
Get the key string with which the current object was stored.
Definition: SGIterator.cxx:155
Trk::ParametersT
Dummy class used to allow special convertors to be called for surfaces owned by a detector element.
Definition: EMErrorDetail.h:25
JiveXML::DataVect
std::vector< DataType > DataVect
Defines a map with a key and a vector of DataType objects e.g.
Definition: DataType.h:58
DataType
OFFLINE_FRAGMENTS_NAMESPACE::PointerType DataType
Definition: RoIBResultByteStreamTool.cxx:25
Trk::VertexType
VertexType
Definition: VertexType.h:25
AthCommonDataStore< AthCommonMsg< AlgTool > >::m_evtStore
StoreGateSvc_t m_evtStore
Pointer to StoreGate (event store by default)
Definition: AthCommonDataStore.h:390
AthCommonDataStore< AthCommonMsg< AlgTool > >::m_vhka
std::vector< SG::VarHandleKeyArray * > m_vhka
Definition: AthCommonDataStore.h:398
AthCommonMsg< AlgTool >::msgLvl
bool msgLvl(const MSG::Level lvl) const
Definition: AthCommonMsg.h:30
Trk::FitQualityOnSurface::doubleNumberDoF
double doubleNumberDoF() const
returns the number of degrees of freedom of the overall track or vertex fit as double
Definition: FitQuality.h:68
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
JiveXML::DataMap
std::map< std::string, DataVect > DataMap
Definition: DataType.h:59
x
#define x
AthenaPoolTestRead.sc
sc
Definition: AthenaPoolTestRead.py:27
SG::VarHandleKeyArray::setOwner
virtual void setOwner(IDataHandleHolder *o)=0
IDTPMcnv.htype
htype
Definition: IDTPMcnv.py:27
AthCommonDataStore< AthCommonMsg< AlgTool > >::evtStore
ServiceHandle< StoreGateSvc > & evtStore()
The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.
Definition: AthCommonDataStore.h:85
python.utils.AtlRunQueryDQUtils.p
p
Definition: AtlRunQueryDQUtils.py:210
AthCommonDataStore
Definition: AthCommonDataStore.h:52
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
JiveXML::VertexRetriever::m_conversionVertexKey
std::string m_conversionVertexKey
StoreGate key for conversion candidate collection.
Definition: VertexRetriever.h:56
JiveXML::VertexRetriever::m_chi2Cut
float m_chi2Cut
Chi^2 over NumberOfDegreesOfFreedom cut.
Definition: VertexRetriever.h:65
z
#define z
LArHistMerge_trf.dataMap
dataMap
Definition: LArHistMerge_trf.py:218
endmsg
#define endmsg
Definition: AnalysisConfig_Ntuple.cxx:63
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
xAOD::covMatrix
covMatrix
Definition: TrackMeasurement_v1.cxx:19
JiveXML::VertexRetriever::dataTypeName
virtual std::string dataTypeName() const
Return the name of the data type.
Definition: VertexRetriever.h:45
chi2
double chi2(TH1 *h0, TH1 *h1)
Definition: comparitor.cxx:522
test_pyathena.parent
parent
Definition: test_pyathena.py:15
Trk::FitQuality
Class to represent and store fit qualities from track reconstruction in terms of and number of degre...
Definition: FitQuality.h:97
AnalysisUtils::Delta::R
double R(const INavigable4Momentum *p1, const double v_eta, const double v_phi)
Definition: AnalysisMisc.h:49
AthCommonDataStore< AthCommonMsg< AlgTool > >::m_detStore
StoreGateSvc_t m_detStore
Pointer to StoreGate (detector store by default)
Definition: AthCommonDataStore.h:393
VxContainer
Definition: VxContainer.h:28
DataVector< Trk::Track >
AthAlgTool::AthAlgTool
AthAlgTool()
Default constructor:
JiveXML::VertexRetriever::m_trackCollection
std::string m_trackCollection
StoreGate key for track collection for association.
Definition: VertexRetriever.h:63
SG::VarHandleKeyArray::renounce
virtual void renounce()=0
SG::HandleClassifier::type
std::conditional< std::is_base_of< SG::VarHandleKeyArray, T >::value, VarHandleKeyArrayType, type2 >::type type
Definition: HandleClassifier.h:54
JiveXML::VertexRetriever::m_typeName
const std::string m_typeName
The data type that is generated by this retriever.
Definition: VertexRetriever.h:68
merge_scale_histograms.doc
string doc
Definition: merge_scale_histograms.py:9
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:221
Rec::TrackParticleContainer
Definition: Reconstruction/Particle/Particle/TrackParticleContainer.h:33
xAOD::vertexType
vertexType
Definition: Vertex_v1.cxx:166
Trk::GsfMeasurementUpdator::fitQuality
FitQualityOnSurface fitQuality(const MultiComponentState &, const MeasurementBase &)
Method for determining the chi2 of the multi-component state and the number of degrees of freedom.
Definition: GsfMeasurementUpdator.cxx:845
DataVector::end
const_iterator end() const noexcept
Return a const_iterator pointing past the end of the collection.
a
TList * a
Definition: liststreamerinfos.cxx:10
y
#define y
h
CondAlgsOpts.found
int found
Definition: CondAlgsOpts.py:101
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
DEBUG
#define DEBUG
Definition: page_access.h:11
AthCommonMsg< AlgTool >::msg
MsgStream & msg() const
Definition: AthCommonMsg.h:24
SG::VarHandleBase::vhKey
SG::VarHandleKey & vhKey()
Return a non-const reference to the HandleKey.
Definition: StoreGate/src/VarHandleBase.cxx:623
JiveXML::VertexRetriever::m_primaryVertexKey
std::string m_primaryVertexKey
StoreGate key for primary vertex candidate collection.
Definition: VertexRetriever.h:45
python.Bindings.keys
keys
Definition: Control/AthenaPython/python/Bindings.py:798
Trk::PriVtx
@ PriVtx
Primary Vertex.
Definition: VertexType.h:27
JiveXML::VertexRetriever::retrieve
virtual StatusCode retrieve(ToolHandle< IFormatTool > &FormatTool)
Retrieve all the data.
Definition: VertexRetriever.cxx:148
JiveXML::VertexRetriever::fillPerigeeList
virtual StatusCode fillPerigeeList()
Retrieve measured perigee, automatically switch between Trk::Track and Rec::TrackParticle depending o...
Definition: VertexRetriever.cxx:84
xAOD::track
@ track
Definition: TrackingPrimitives.h:512
CaloCondBlobAlgs_fillNoiseFromASCII.tag
string tag
Definition: CaloCondBlobAlgs_fillNoiseFromASCII.py:24
JiveXML::VertexRetriever::m_secondaryVertexKey
std::string m_secondaryVertexKey
StoreGate key for secondary vertex candidate collection.
Definition: VertexRetriever.h:54
JiveXML::VertexRetriever::m_doWriteHLT
bool m_doWriteHLT
wether to write HLTAutoKey objects
Definition: VertexRetriever.h:58
DataVector< Trk::VxCandidate >::size_type
BASE::size_type size_type
Definition: DataVector.h:813
DataVector::size
size_type size() const noexcept
Returns the number of elements in the collection.
SG::ConstIterator
Definition: SGIterator.h:163
AthCommonDataStore::declareGaudiProperty
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>
Definition: AthCommonDataStore.h:156
Trk::FitQualityOnSurface::chiSquared
double chiSquared() const
returns the of the overall track fit
Definition: FitQuality.h:56
JiveXML::VertexRetriever::m_doWritePrimAndSecVertexOnly
bool m_doWritePrimAndSecVertexOnly
write primary and secondary vertizes only - placeholder, to be removed
Definition: VertexRetriever.h:60
DataVector::begin
const_iterator begin() const noexcept
Return a const_iterator pointing at the beginning of the collection.
fitman.k
k
Definition: fitman.py:528