|
ATLAS Offline Software
|
Retrieves all Trk::VxCandidate
objects.
More...
#include <VertexRetriever.h>
|
| 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 |
|
Retrieves all Trk::VxCandidate
objects.
- Properties
- PrimaryVertexCollection
= 'VxPrimaryCandidate'
: StoreGate key for primary vertex candidate collection.
- IgnoreTrackAssociations
= False
:
- DoWritePrimAndSecVertexOnly
= False
: write primary and secondary vertizes only - placeholder, to be removed
- DoWriteHLT
= False
: wether to write HLTAutoKey objects
- Retrieved Data
- x, y, z : coordinates of vertex
- primVxCand : boolean for vertex candidate
- chi2 : \(\chi^2\) of vertex fit
- covMatrix : covariance matrix of vertex fit
- numTracks : number of tracks associated with the vertex
- tracks : indices of associated tracks in track collection
Definition at line 33 of file VertexRetriever.h.
◆ StoreGateSvc_t
◆ VertexRetriever()
JiveXML::VertexRetriever::VertexRetriever |
( |
const std::string & |
type, |
|
|
const std::string & |
name, |
|
|
const IInterface * |
parent |
|
) |
| |
Standard constructor.
This is the standard AthAlgTool constructor.
- Parameters
-
type | AlgTool type name |
name | AlgTool instance name |
parent | AlgTools parent owning this tool |
Definition at line 36 of file VertexRetriever.cxx.
41 declareInterface<IDataRetriever>(
this);
48 "if true only write primary and secondary vertex, placeholder to be removed");
◆ dataTypeName()
virtual std::string JiveXML::VertexRetriever::dataTypeName |
( |
| ) |
const |
|
inlinevirtual |
◆ declareGaudiProperty() [1/4]
specialization for handling Gaudi::Property<SG::VarHandleKeyArray>
Definition at line 170 of file AthCommonDataStore.h.
175 hndl.documentation());
◆ declareGaudiProperty() [2/4]
specialization for handling Gaudi::Property<SG::VarHandleKey>
Definition at line 156 of file AthCommonDataStore.h.
161 hndl.documentation());
◆ declareGaudiProperty() [3/4]
specialization for handling Gaudi::Property<SG::VarHandleBase>
Definition at line 184 of file AthCommonDataStore.h.
189 hndl.documentation());
◆ declareGaudiProperty() [4/4]
◆ declareProperty() [1/6]
Declare a new Gaudi property.
- Parameters
-
name | Name of the property. |
hndl | Object holding the property value. |
doc | Documentation 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.
250 this->declare(hndl.
vhKey());
251 hndl.
vhKey().setOwner(
this);
253 return PBASE::declareProperty(
name,hndl,
doc);
◆ declareProperty() [2/6]
Declare a new Gaudi property.
- Parameters
-
name | Name of the property. |
hndl | Object holding the property value. |
doc | Documentation 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.
229 return PBASE::declareProperty(
name,hndl,
doc);
◆ declareProperty() [3/6]
◆ declareProperty() [4/6]
Declare a new Gaudi property.
- Parameters
-
name | Name of the property. |
property | Object holding the property value. |
doc | Documentation 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.
338 return PBASE::declareProperty(
name, property,
doc);
◆ declareProperty() [5/6]
Declare a new Gaudi property.
- Parameters
-
name | Name of the property. |
property | Object holding the property value. |
doc | Documentation 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.
◆ declareProperty() [6/6]
◆ detStore()
◆ evtStore() [1/2]
◆ evtStore() [2/2]
◆ extraDeps_update_handler()
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.
100 std::string searchStr =
"TrackParticle";
104 if (
found!=std::string::npos){
106 if (
msgLvl(MSG::WARNING))
msg(MSG::WARNING) <<
"Unable to retrieve track collection"
123 if (
msgLvl(MSG::WARNING))
msg(MSG::WARNING) <<
"Unable to retrieve track collection"
130 const Trk::Perigee* trackPerigee = (*track)->perigeeParameters();
138 return StatusCode::SUCCESS;
◆ inputHandles()
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]
◆ msg() [2/2]
◆ msgLvl()
◆ outputHandles()
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()
◆ renounceArray()
◆ 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
-
FormatTool | the 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.
155 return StatusCode::SUCCESS;
169 if (
msgLvl(MSG::WARNING))
msg(MSG::WARNING) <<
"Primary vertex container "
186 for ( ; vtxCollectionItr != vtxCollectionsEnd; ++vtxCollectionItr ) {
189 if ( (!
m_doWriteHLT) && ( vtxCollectionItr.
key().find(
"HLT") != std::string::npos)){
199 <<
" with " << NVtx <<
" entries" <<
endmsg;
202 x.reserve(
x.size()+NVtx);
203 y.reserve(
y.size()+NVtx);
204 z.reserve(
z.size()+NVtx);
205 primVxCand.reserve(primVxCand.size()+NVtx);
209 numTracks.reserve(numTracks.size()+NVtx);
213 if (!
sc.isFailure()) {
220 for ( ; vertexItr != vtxCollectionItr->end(); ++vertexItr) {
235 float this_chi2 = -1;
242 float this_x = (*vertexItr)->recVertex().position().x()/10.;
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);
252 chi2.emplace_back( this_chi2 );
253 x.emplace_back( this_x );
254 y.emplace_back( this_y );
255 z.emplace_back( this_z );
263 if ( &(*vtxCollectionItr) == primaryVtxCollection ){
264 if (
Trk::PriVtx == vtx_type ){ primVxCand.emplace_back( 1 );
265 }
else{ primVxCand.emplace_back( 0 ); }
266 }
else if ( &(*vtxCollectionItr) == secondaryVtxCollection ){
267 primVxCand.emplace_back( 2 );
269 primVxCand.emplace_back( 0 );
284 covMatrix.emplace_back(
"2 -.1 .5 -.01 0.002 .01");
294 const std::vector<Trk::VxTrackAtVertex*>* trklist = (*vertexItr)->vxTrackAtVertex();
298 numTracks.emplace_back( trklist->size() );
301 tracks.emplace_back( -1 );
310 dataMap[
"primVxCand"] = primVxCand;
313 dataMap[
"numTracks"] = numTracks;
318 if (!numTracks.empty()){
320 double NTracksPerVertex = tracks.size()*1./numTracks.size();
321 std::string
tag =
"tracks multiple=\"" +
DataType(NTracksPerVertex).toString()+
"\"";
◆ sysInitialize()
◆ sysStart()
Handle START transition.
We override this in order to make sure that conditions handle keys can cache a pointer to the conditions container.
◆ updateVHKA()
◆ m_chi2Cut
float JiveXML::VertexRetriever::m_chi2Cut |
|
private |
◆ 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
◆ m_doWriteHLT
bool JiveXML::VertexRetriever::m_doWriteHLT |
|
private |
◆ 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
◆ m_perigeeVector
◆ 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
◆ m_vhka
The documentation for this class was generated from the following files:
std::vector< const Trk::Perigee * > m_perigeeVector
Const iterator class for DataVector/DataList.
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
const std::string & key() const
Get the key string with which the current object was stored.
Dummy class used to allow special convertors to be called for surfaces owned by a detector element.
std::vector< DataType > DataVect
Defines a map with a key and a vector of DataType objects e.g.
StoreGateSvc_t m_evtStore
Pointer to StoreGate (event store by default)
std::vector< SG::VarHandleKeyArray * > m_vhka
bool msgLvl(const MSG::Level lvl) const
double doubleNumberDoF() const
returns the number of degrees of freedom of the overall track or vertex fit as double
std::map< std::string, DataVect > DataMap
virtual void setOwner(IDataHandleHolder *o)=0
ServiceHandle< StoreGateSvc > & evtStore()
The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.
std::string m_conversionVertexKey
StoreGate key for conversion candidate collection.
float m_chi2Cut
Chi^2 over NumberOfDegreesOfFreedom cut.
::StatusCode StatusCode
StatusCode definition for legacy code.
virtual std::string dataTypeName() const
Return the name of the data type.
double chi2(TH1 *h0, TH1 *h1)
Class to represent and store fit qualities from track reconstruction in terms of and number of degre...
double R(const INavigable4Momentum *p1, const double v_eta, const double v_phi)
StoreGateSvc_t m_detStore
Pointer to StoreGate (detector store by default)
std::string m_trackCollection
StoreGate key for track collection for association.
virtual void renounce()=0
std::conditional< std::is_base_of< SG::VarHandleKeyArray, T >::value, VarHandleKeyArrayType, type2 >::type type
const std::string m_typeName
The data type that is generated by this retriever.
FitQualityOnSurface fitQuality(const MultiComponentState &, const MeasurementBase &)
Method for determining the chi2 of the multi-component state and the number of degrees of freedom.
const_iterator end() const noexcept
Return a const_iterator pointing past the end of the collection.
SG::VarHandleKey & vhKey()
Return a non-const reference to the HandleKey.
std::string m_primaryVertexKey
StoreGate key for primary vertex candidate collection.
virtual StatusCode retrieve(ToolHandle< IFormatTool > &FormatTool)
Retrieve all the data.
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.
bool m_doWriteHLT
wether to write HLTAutoKey objects
BASE::size_type size_type
size_type size() const noexcept
Returns the number of elements in the collection.
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>
double chiSquared() const
returns the of the overall track fit
bool m_doWritePrimAndSecVertexOnly
write primary and secondary vertizes only - placeholder, to be removed
const_iterator begin() const noexcept
Return a const_iterator pointing at the beginning of the collection.