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::TrackParticleRetriever Class Reference

Retrieves all TrackParticle (AOD) Collection objects This is a chopped version of the full (RDO/ESD) Trk::Track retriever TrigJiveXML/TrackRetriever. More...

#include <TrackParticleRetriever.h>

Inheritance diagram for JiveXML::TrackParticleRetriever:
Collaboration diagram for JiveXML::TrackParticleRetriever:

Public Member Functions

 TrackParticleRetriever (const std::string &type, const std::string &name, const IInterface *parent)
 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

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

const std::string m_typeName
 The data type that is generated by this retriever. More...
 
std::string m_PriorityTrackCollection
 First track collections to retrieve, shown as default in Atlantis. More...
 
std::vector< std::string > m_OtherTrackCollections
 Track collections to retrieve in the sequence they are given, all if empty. More...
 
bool m_doWriteHLT
 Wether to write HLTAutoKey objects. More...
 
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 TrackParticle (AOD) Collection objects This is a chopped version of the full (RDO/ESD) Trk::Track retriever TrigJiveXML/TrackRetriever.

Definition at line 34 of file TrackParticleRetriever.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

◆ TrackParticleRetriever()

JiveXML::TrackParticleRetriever::TrackParticleRetriever ( 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 24 of file TrackParticleRetriever.cxx.

24  :
26  m_typeName("Track"){
27 
28  //Declare the interface
29  declareInterface<IDataRetriever>(this);
30 
31  //Properties
32  declareProperty("PriorityTrackCollection", m_PriorityTrackCollection = "TrackParticleCandidate",
33  "Track collections to retrieve first, shown as default in Atlantis");
34  declareProperty("OtherTrackCollections" , m_OtherTrackCollections , "Track collections to retrieve, all if empty");
35  declareProperty("DoWriteHLT" , m_doWriteHLT = false, "Wether to write HLTAutoKey objects");
36  }

Member Function Documentation

◆ dataTypeName()

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

Return the name of the data type.

Implements JiveXML::IDataRetriever.

Definition at line 46 of file TrackParticleRetriever.h.

46 { 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

◆ 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::TrackParticleRetriever::retrieve ( ToolHandle< IFormatTool > &  FormatTool)
virtual

Retrieve all the data.

This is largely a chopped copy of TrkJiveXML/TrackRetriever.

For each track collection retrieve all data

  • loop over tracks in all collections
  • for each track get basic parameters
    Parameters
    FormatToolthe tool that will create formated output from the DataMap

Second step: Now loop over all collections and retrieve the actual values

General track fit info

get transformed covariance matrix

Implements JiveXML::IDataRetriever.

Definition at line 100 of file TrackParticleRetriever.cxx.

100  {
101 
102  //be verbose
103  if (msgLvl(MSG::DEBUG)) msg(MSG::DEBUG) << "Retrieving AOD TrackParticle" << endmsg;
104 
105  //Generate a list of requested track collections
106  typedef std::pair< Rec::TrackParticleContainer , std::string > tracksNamePair;
107  std::vector< tracksNamePair > requestedTrackColls;
108 
109  //First try to get hold of the priority track collection
110  const Rec::TrackParticleContainer* tracks = NULL ;
111  if (evtStore()->retrieve(tracks, m_PriorityTrackCollection).isFailure()){
112  if (msgLvl(MSG::WARNING)) msg(MSG::WARNING) << "Unable to retrieve requested priority track collection "
114  } else {
115  //Add this to the list of requested collections
116  requestedTrackColls.push_back(tracksNamePair(*tracks,m_PriorityTrackCollection));
117  }
118 
119  //If we have been given an explicit list, try to retrieve these in the order
120  //they were given
121 
123  for ( ; CollNameItr != m_OtherTrackCollections.end(); ++CollNameItr){
124  const Rec::TrackParticleContainer* tracks = NULL ;
125  if (evtStore()->retrieve(tracks, (*CollNameItr)).isFailure()){
126  if (msgLvl(MSG::WARNING)) msg(MSG::WARNING) << "Unable to retrieve requested track collection " << (*CollNameItr) << endmsg;
127  continue ;
128  }
129 
130 // This fails for me, compilation error. Leave it out for now.
131 // But this means some collections are written out twice ! jpt 24Jul09
132 // This is copy/paste from TrackRetriever, works with TrackCollection,
133 // but _not_ with Rec::TrackParticleContainer in completely identical code.
134  //Check if this collection is not already in the list
135 // if (std::find(requestedTrackColls.begin(), requestedTrackColls.end(),
136 // tracksNamePair(*tracks,*CollNameItr) ) == requestedTrackColls.end()){
137  //Add this to the list of requested collections
138  requestedTrackColls.push_back( tracksNamePair(*tracks,(*CollNameItr)) );
139 // }
140  }
141 
142  //If no collections had been requested explicitly, loop over all of them
143  if (m_OtherTrackCollections.empty()) {
144 
145  //Get an iterator over all other track collections
146  SG::ConstIterator<Rec::TrackParticleContainer> trackCollIter, trackCollEnd;
147  if ((evtStore()->retrieve(trackCollIter, trackCollEnd)).isFailure()){
148  if (msgLvl(MSG::WARNING)) msg(MSG::WARNING) << "Unable to retrieve track collection iterator" << endmsg;
149  return StatusCode::SUCCESS;
150  }
151 
152  //Next loop over all collections
153  for (; trackCollIter!=trackCollEnd; ++trackCollIter) {
154 
155  //hack to avoid double, as 'find' (further below) fails.
156  if ( trackCollIter.key() == m_PriorityTrackCollection ){ continue; }
157 
158  //Check if this is an HLT-AutoKey collection
159  if ((trackCollIter.key().find("HLT",0) != std::string::npos) && (!m_doWriteHLT)){
160  if (msgLvl(MSG::DEBUG)) msg(MSG::DEBUG) << "Ignoring HLT-AutoKey collection " << trackCollIter.key() << endmsg;
161  continue ;
162  }
163 
164  // Veto AtlfastTrackParticles as they have different parameter access method.
165  // Retrieving them will lead to runtime crash currently. jpt 04Aug07
166  if ( (trackCollIter.key() =="AtlfastTrackParticles")) {
167  if (msgLvl(MSG::DEBUG)) msg(MSG::DEBUG) << "Always ignoring collection " << trackCollIter.key() << endmsg;
168  continue ;
169  }
170 
171  //Next try to retrieve the actual collection
172  if (evtStore()->retrieve(tracks,trackCollIter.key()).isFailure()){
173  if (msgLvl(MSG::DEBUG)) msg(MSG::DEBUG) << "Unable to retrieve collection " << trackCollIter.key() << endmsg;
174  continue ;
175  }
176 
177 // this fails for me, leave it out. jpt 24Jul09
178  //Check if this collection is not already in the list
179 // if (std::find(requestedTrackColls.begin(), requestedTrackColls.end(),tracksNamePair(*tracks,trackCollIter.key())) != requestedTrackColls.end())
180 // continue ;
181  //Add this to the list of requested collections
182  requestedTrackColls.push_back(tracksNamePair(*tracks,trackCollIter.key()));
183  } //loop over all track collections
184  }
185 
191  //Loop over the collection list we have assembled above
192  std::vector<tracksNamePair>::iterator tracksNamePairItr = requestedTrackColls.begin();
193  for ( ; tracksNamePairItr != requestedTrackColls.end(); ++tracksNamePairItr){
194 
195  //save some typing by getting a handle on the collection pointer
196  const Rec::TrackParticleContainer* tpc =&((*tracksNamePairItr).first);
197  std::string collectionName = (*tracksNamePairItr).second;
198 
199  //Some sanity checks
200  if ( tpc->size() == 0){
201  if (msgLvl(MSG::DEBUG)) msg(MSG::DEBUG) << "Ignoring empty track collection " << collectionName << endmsg;
202  } else {
203  if (msgLvl(MSG::DEBUG)) msg(MSG::DEBUG) << "Retrieving data for track collection " << collectionName << endmsg;
204  }
205 
206  // Make a list of track-wise entries and reserve enough space
207  DataVect id; id.reserve(tpc->size());
208  DataVect chi2; chi2.reserve(tpc->size());
209  DataVect numDoF; numDoF.reserve(tpc->size());
210  DataVect trackAuthor; trackAuthor.reserve(tpc->size());
211  DataVect label; label.reserve(tpc->size());
212 
213  //Store wether this collection has perigee parameters
214  DataVect pt; pt.reserve(tpc->size());
215  DataVect d0; d0.reserve(tpc->size());
216  DataVect z0; z0.reserve(tpc->size());
217  DataVect phi0; phi0.reserve(tpc->size());
218  DataVect cotTheta; cotTheta.reserve(tpc->size());
219  DataVect covMatrix; covMatrix.reserve(tpc->size() * 15 );
220 
221  DataVect numPolyline; numPolyline.reserve(tpc->size());
222  DataVect polylineX;
223  DataVect polylineY;
224  DataVect polylineZ;
225 
226  std::string labelStr = "unknownHits";
227 
228  // Now loop over all tracks in the collection
230  for (tpcItr=tpc->begin(); tpcItr!=tpc->end(); ++tpcItr) {
231 
235  id.push_back(DataType(id.size())); //<! simple counter starting from 0
236  chi2.push_back(DataType((*tpcItr)->fitQuality()->chiSquared()));
237  numDoF.push_back(DataType((*tpcItr)->fitQuality()->numberDoF()));
238  trackAuthor.push_back( (*tpcItr)->info().trackFitter() );
239 
240  const Trk::TrackSummary* tSum = (*tpcItr)->trackSummary();
241  if(tSum){
243  int nSCTHits = tSum->get(Trk::numberOfSCTHits);
244  int nBLayerHits = tSum->get(Trk::numberOfInnermostPixelLayerHits);
245  int nTRTHits = tSum->get(Trk::numberOfTRTHits);
246  labelStr = "_PixelHits"+DataType( nPixelHits ).toString() + "_SCTHits"+DataType( nSCTHits ).toString() +
247  "_BLayerHits"+DataType( nBLayerHits ).toString() + "_TRTHits"+DataType( nTRTHits ).toString() ;
248  if (msgLvl(MSG::DEBUG)) msg(MSG::DEBUG) << "Author: " << (*tpcItr)->info().trackFitter() << " Pixel hits: " << nPixelHits
249  << ", SCT hits: " << nSCTHits << " BLayer hits: " << nBLayerHits
250  << ", TRT hits: " << nTRTHits << ", pT[GeV]= " << (*tpcItr)->perigee()->pT()/1000. << endmsg;
251  if (msgLvl(MSG::DEBUG)) msg(MSG::DEBUG) << "Label: " << labelStr << endmsg;
252  }
253 
254  if (((*tpcItr)->perigee()->parameters())[Trk::qOverP]==0) {
255  pt.push_back(DataType(9999.));
256  } else {
257  pt.push_back(DataType((*tpcItr)->perigee()->charge() * (*tpcItr)->perigee()->pT()/1000.));
258  }
259 
260  d0.push_back(DataType(((*tpcItr)->perigee()->parameters())[Trk::d0]/CLHEP::cm));
261  z0.push_back(DataType((*tpcItr)->perigee()->parameters()[Trk::z0]/CLHEP::cm));
262  phi0.push_back(DataType((*tpcItr)->perigee()->parameters()[Trk::phi0]));
263 
264  if ((*tpcItr)->perigee()->parameters()[Trk::theta] == 0.) {
265  cotTheta.push_back(DataType(9999.));
266  } else {
267  cotTheta.push_back(DataType(1./tan((*tpcItr)->perigee()->parameters()[Trk::theta])));
268  }
269 
270  // CLHEP->Eigen migration. jpt Dec'13
271  // https://twiki.cern.ch/twiki/bin/viewauth/Atlas/MigrationCLHEPtoEigen
272  // https://twiki.cern.ch/twiki/bin/viewauth/Atlas/MigrationToUpdatedEDM#Changes_to_TrkParameters
273 
275  AmgSymMatrix(5) covVert;
276  //covVert.clear();
277  const Trk::Perigee* per =
278  dynamic_cast<const Trk::Perigee*>((*tpcItr)->perigee());
279  const AmgSymMatrix(5)* covariance = per ? per->covariance() : NULL;
280  if (per && covariance) {
281  // do trafo to old format
282  double measuredTheta = (*tpcItr)->perigee()->parameters()[Trk::theta];
283  double measuredQoverp = (*tpcItr)->perigee()->parameters()[Trk::qOverP];
284  const Trk::JacobianThetaPToCotThetaPt theJac( measuredTheta, measuredQoverp );
285  covVert = covariance->similarity(theJac);
286  }else{
287  for ( int ii=0; ii<20; ii++){ // placeholder. Do this nicer.
288  covVert(ii) = 0.;
289  }
290  }
291  //Scale covariance matrix values to get good resolution with fixed
292  //precision in JiveXML data
293 
294  const long scale = 10000;
295 // Migration: Now only has diagonal elements from covariance matrix ?
296  covMatrix.push_back(DataType(covVert(0)*scale/100.)); // 5 elements
297  covMatrix.push_back(DataType(covVert(1)*scale/100.));
298  covMatrix.push_back(DataType(covVert(2)*scale/100.));
299  covMatrix.push_back(DataType(covVert(3)*scale/100.));
300  covMatrix.push_back(DataType(covVert(4)*scale/100.));
301 
302 // Used to be 15 elements before migration, so need to put 10 placeholders
303  for ( int i=0; i<10; i++){
304  covMatrix.push_back(DataType( 0. ));
305  }
306 /*
307  covMatrix.push_back(DataType(covVert[0][0]*scale/100.)); // 15 elements (diagonal +1half)
308  covMatrix.push_back(DataType(covVert[1][0]*scale/100.));
309  covMatrix.push_back(DataType(covVert[1][1]*scale/100.));
310  covMatrix.push_back(DataType(covVert[2][0]*scale/10.));
311  covMatrix.push_back(DataType(covVert[2][1]*scale/10.));
312  covMatrix.push_back(DataType(covVert[2][2]*scale/1.));
313  covMatrix.push_back(DataType(covVert[3][0]*scale/10.));
314  covMatrix.push_back(DataType(covVert[3][1]*scale/10.));
315  covMatrix.push_back(DataType(covVert[3][2]*scale/1.));
316  covMatrix.push_back(DataType(covVert[3][3]*scale/1.));
317  covMatrix.push_back(DataType(covVert[4][0]*scale/0.01));
318  covMatrix.push_back(DataType(covVert[4][1]*scale/0.01));
319  covMatrix.push_back(DataType(covVert[4][2]*scale/0.001));
320  covMatrix.push_back(DataType(covVert[4][3]*scale/0.001));
321  covMatrix.push_back(DataType(covVert[4][4]*scale/0.000001));
322 */
323  TrackParticleRetrieverHelpers::getPolylineFromTrackParticle( (*tpcItr),polylineX,polylineY,polylineZ,numPolyline);
324 
325  } // end loop over tracks in collection
326 
327  //Now fill everything in a datamap
329  // Start with mandatory entries
330  DataMap["id"] = id;
331  DataMap["chi2"] = chi2;
332  DataMap["numDoF"] = numDoF;
333  DataMap["trackAuthor"] = trackAuthor;
334  DataMap["numPolyline"] = numPolyline;
335  // DataMap["label"] = labelStr; // need to add into event.dtd first
336 
337  // if perigee parameters are not available, leave the corresponding subtags empty.
338  // This way atlantis knows that such tracks can only be displayed as polylines.
339  if (pt.size() > 0){
340  DataMap["pt"] = pt;
341  DataMap["d0"] = d0;
342  DataMap["z0"] = z0;
343  DataMap["phi0"] = phi0;
344  DataMap["cotTheta"] = cotTheta;
345  DataMap["covMatrix multiple=\"15\""] = covMatrix;
346  }
347 
348  // vectors with measurement, maximum 3 for TrackParticle (perigee, calo entry, muon entry)
349  if ( polylineX.size() > 0){
350  std::string numPolyPerTrack = DataType(polylineX.size()/((double)id.size())).toString();
351  DataMap["polylineX multiple=\"" + numPolyPerTrack + "\""] = polylineX;
352  DataMap["polylineY multiple=\"" + numPolyPerTrack + "\""] = polylineY;
353  DataMap["polylineZ multiple=\"" + numPolyPerTrack + "\""] = polylineZ;
354  }
355 
356  //forward data to formating tool
357  if ( FormatTool->AddToEvent(dataTypeName(), collectionName, &DataMap).isFailure())
358  return StatusCode::RECOVERABLE;
359 
360  //Be verbose
361  if (msgLvl(MSG::DEBUG)) msg(MSG::DEBUG) << dataTypeName() << " collection " << collectionName << " retrieved with " << id.size() << " entries"<< endmsg;
362  } //loop over track collections
363 
364  //All collections retrieved okay
365  return StatusCode::SUCCESS;
366 
367  } //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_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::TrackParticleRetriever::m_doWriteHLT
private

Wether to write HLTAutoKey objects.

Definition at line 59 of file TrackParticleRetriever.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_OtherTrackCollections

std::vector<std::string> JiveXML::TrackParticleRetriever::m_OtherTrackCollections
private

Track collections to retrieve in the sequence they are given, all if empty.

Definition at line 57 of file TrackParticleRetriever.h.

◆ m_PriorityTrackCollection

std::string JiveXML::TrackParticleRetriever::m_PriorityTrackCollection
private

First track collections to retrieve, shown as default in Atlantis.

Definition at line 55 of file TrackParticleRetriever.h.

◆ m_typeName

const std::string JiveXML::TrackParticleRetriever::m_typeName
private

The data type that is generated by this retriever.

Definition at line 50 of file TrackParticleRetriever.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:
xAOD::iterator
JetConstituentVector::iterator iterator
Definition: JetConstituentVector.cxx:68
Trk::numberOfPixelHits
@ numberOfPixelHits
number of pixel layers on track with absence of hits
Definition: Tracking/TrkEvent/TrkTrackSummary/TrkTrackSummary/TrackSummary.h:57
DataModel_detail::const_iterator
Const iterator class for DataVector/DataList.
Definition: DVLIterator.h:82
Trk::numberOfInnermostPixelLayerHits
@ numberOfInnermostPixelLayerHits
these are the hits in the 1st pixel layer
Definition: Tracking/TrkEvent/TrkTrackSummary/TrkTrackSummary/TrackSummary.h:53
AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
Definition: AthCommonDataStore.h:145
PlotCalibFromCool.label
label
Definition: PlotCalibFromCool.py:78
SG::detail::IteratorBase::key
const std::string & key() const
Get the key string with which the current object was stored.
Definition: SGIterator.cxx:155
InDetAccessor::phi0
@ phi0
Definition: InDetAccessor.h:33
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
JiveXML::TrackParticleRetriever::m_PriorityTrackCollection
std::string m_PriorityTrackCollection
First track collections to retrieve, shown as default in Atlantis.
Definition: TrackParticleRetriever.h:55
test_pyathena.pt
pt
Definition: test_pyathena.py:11
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
Trk::z0
@ z0
Definition: ParamDefs.h:64
AthCommonMsg< AlgTool >::msgLvl
bool msgLvl(const MSG::Level lvl) const
Definition: AthCommonMsg.h:30
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
const
bool const RAWDATA *ch2 const
Definition: LArRodBlockPhysicsV0.cxx:560
JiveXML::DataMap
std::map< std::string, DataVect > DataMap
Definition: DataType.h:59
yodamerge_tmp.scale
scale
Definition: yodamerge_tmp.py:138
IDTPM::nPixelHits
float nPixelHits(const U &p)
Definition: TrackParametersHelper.h:354
AmgSymMatrix
#define AmgSymMatrix(dim)
Definition: EventPrimitives.h:50
SG::VarHandleKeyArray::setOwner
virtual void setOwner(IDataHandleHolder *o)=0
JiveXML::TrackParticleRetriever::m_doWriteHLT
bool m_doWriteHLT
Wether to write HLTAutoKey objects.
Definition: TrackParticleRetriever.h:59
IDTPMcnv.htype
htype
Definition: IDTPMcnv.py:29
cm
const double cm
Definition: Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimParametrization/tools/FCAL_ChannelMap.cxx:25
python.setupRTTAlg.size
int size
Definition: setupRTTAlg.py:39
JiveXML::TrackParticleRetriever::retrieve
virtual StatusCode retrieve(ToolHandle< IFormatTool > &FormatTool)
Retrieve all the data.
Definition: TrackParticleRetriever.cxx:100
AthCommonDataStore< AthCommonMsg< AlgTool > >::evtStore
ServiceHandle< StoreGateSvc > & evtStore()
The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.
Definition: AthCommonDataStore.h:85
OfflineHitType::Perigee
@ Perigee
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
lumiFormat.i
int i
Definition: lumiFormat.py:85
IDTPM::nSCTHits
float nSCTHits(const U &p)
Definition: TrackParametersHelper.h:393
IDTPM::nTRTHits
float nTRTHits(const U &p)
Definition: TrackParametersHelper.h:446
Trk::theta
@ theta
Definition: ParamDefs.h:66
endmsg
#define endmsg
Definition: AnalysisConfig_Ntuple.cxx:63
Trk::numberOfSCTHits
@ numberOfSCTHits
number of SCT holes
Definition: Tracking/TrkEvent/TrkTrackSummary/TrkTrackSummary/TrackSummary.h:71
xAOD::covMatrix
covMatrix
Definition: TrackMeasurement_v1.cxx:19
chi2
double chi2(TH1 *h0, TH1 *h1)
Definition: comparitor.cxx:523
TRT::Track::d0
@ d0
Definition: InnerDetector/InDetCalibEvent/TRT_CalibData/TRT_CalibData/TrackInfo.h:62
test_pyathena.parent
parent
Definition: test_pyathena.py:15
drawFromPickle.tan
tan
Definition: drawFromPickle.py:36
AthCommonDataStore< AthCommonMsg< AlgTool > >::m_detStore
StoreGateSvc_t m_detStore
Pointer to StoreGate (detector store by default)
Definition: AthCommonDataStore.h:393
TRT::Track::z0
@ z0
Definition: InnerDetector/InDetCalibEvent/TRT_CalibData/TRT_CalibData/TrackInfo.h:63
AthAlgTool::AthAlgTool
AthAlgTool()
Default constructor:
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
Trk::numberOfTRTHits
@ numberOfTRTHits
number of TRT outliers
Definition: Tracking/TrkEvent/TrkTrackSummary/TrkTrackSummary/TrackSummary.h:79
Trk
Ensure that the ATLAS eigen extensions are properly loaded.
Definition: FakeTrackBuilder.h:9
merge_scale_histograms.doc
string doc
Definition: merge_scale_histograms.py:9
id
SG::auxid_t id
Definition: Control/AthContainers/Root/debug.cxx:227
Trk::TrackSummary
A summary of the information contained by a track.
Definition: Tracking/TrkEvent/TrkTrackSummary/TrkTrackSummary/TrackSummary.h:287
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:228
Trk::d0
@ d0
Definition: ParamDefs.h:63
Rec::TrackParticleContainer
Definition: Reconstruction/Particle/Particle/TrackParticleContainer.h:33
JiveXML::TrackParticleRetrieverHelpers::getPolylineFromTrackParticle
void getPolylineFromTrackParticle(const Rec::TrackParticle *track, DataVect &polylineX, DataVect &polylineY, DataVect &polylineZ, DataVect &numPolyline)
Get polyline hits if available.
Definition: TrackParticleRetriever.cxx:46
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
h
JiveXML::TrackParticleRetriever::dataTypeName
virtual std::string dataTypeName() const
Return the name of the data type.
Definition: TrackParticleRetriever.h:46
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
Trk::qOverP
@ qOverP
perigee
Definition: ParamDefs.h:67
if
if(febId1==febId2)
Definition: LArRodBlockPhysicsV0.cxx:567
SG::VarHandleBase::vhKey
SG::VarHandleKey & vhKey()
Return a non-const reference to the HandleKey.
Definition: StoreGate/src/VarHandleBase.cxx:623
TRT::Track::cotTheta
@ cotTheta
Definition: InnerDetector/InDetCalibEvent/TRT_CalibData/TRT_CalibData/TrackInfo.h:65
JiveXML::TrackParticleRetriever::m_typeName
const std::string m_typeName
The data type that is generated by this retriever.
Definition: TrackParticleRetriever.h:46
python.Bindings.keys
keys
Definition: Control/AthenaPython/python/Bindings.py:798
JiveXML::TrackParticleRetriever::m_OtherTrackCollections
std::vector< std::string > m_OtherTrackCollections
Track collections to retrieve in the sequence they are given, all if empty.
Definition: TrackParticleRetriever.h:57
Trk::TrackSummary::get
int get(const SummaryType &type) const
returns the summary information for the passed SummaryType.
Trk::JacobianThetaPToCotThetaPt
Definition: JacobianThetaPToCotThetaPt.h:41
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::phi0
@ phi0
Definition: ParamDefs.h:65
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