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

#include <FullLinearizedTrackFactory.h>

Inheritance diagram for Trk::FullLinearizedTrackFactory:
Collaboration diagram for Trk::FullLinearizedTrackFactory:

Public Member Functions

virtual StatusCode initialize () override
 Standard AlgToolMethods. More...
 
 FullLinearizedTrackFactory (const std::string &t, const std::string &n, const IInterface *p)
 Default constructor due to Athena interface. More...
 
 ~FullLinearizedTrackFactory ()
 Destructor. More...
 
virtual void linearize (VxTrackAtVertex &theTrack, const Amg::Vector3D &linPoint) const override
 Interface for VxTrackAtVertex: Takes a MeasuredPerigee from VxTrackAtVertex and a Lineariztion point. More...
 
virtual LinearizedTracklinearizedTrack (const TrackParameters *param, const Amg::Vector3D &linPoint) const override
 Linearization method: Takes a MeasuredPerigee and a LinearizationPoint. More...
 
virtual LinearizedTracklinearizedTrack (const NeutralParameters *param, const Amg::Vector3D &linPoint) const override
 Linearization method: Takes a MeasuredPerigee and a LinearizationPoint. 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 ()
 AlgTool interface methods. 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

ToolHandle< Trk::IExtrapolatorm_extrapolator
 
SG::ReadCondHandleKey< AtlasFieldCacheCondObjm_fieldCacheCondObjInputKey {this, "AtlasFieldCacheCondObj", "fieldCondObj", "Name of the Magnetic Field conditions object key"}
 
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

A concrete implementation of the linearized track factory. This factory linearizes the measurement equation in the vicinity of a given point (see ILinearizedTrackFactory class, [1] Billoir and Qian et al. NIM A311 (1992) 139-150 and [2] R. Fruehwirth et al. Comp. Phys. Comm 96(1996) 189-208 for more info). In the current implementation the ATLAS perigee parametrization of helix (d_0,z_0,phi_p,theta_p,q/p ) and full equations of motion ae used without any approximations or expansion. For the method of the calculation see: (to be published, so far contact the authors)

The result of a calculation is stored in the Trk::LinearizedTrack object, which is a private member of Trk::VxTrackAtVertex.

Author
Kirill Prokofiev (University of Sheffield)
N. Giacinto Piacquadio (for the Freiburg Group)

Changes:

David Shope david.nosp@m..ric.nosp@m.hard..nosp@m.shop.nosp@m.e@cer.nosp@m.n.ch (2016-06-01)

EDM Migration to xAOD - replace Trk::Vertex with Amg::Vector3D

Definition at line 55 of file FullLinearizedTrackFactory.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

◆ FullLinearizedTrackFactory()

Trk::FullLinearizedTrackFactory::FullLinearizedTrackFactory ( const std::string &  t,
const std::string &  n,
const IInterface *  p 
)

Default constructor due to Athena interface.

Definition at line 27 of file FullLinearizedTrackFactory.cxx.

27  {
28  declareProperty("Extrapolator", m_extrapolator);
29  declareInterface<IVertexLinearizedTrackFactory>(this);
30  }
31 

◆ ~FullLinearizedTrackFactory()

Trk::FullLinearizedTrackFactory::~FullLinearizedTrackFactory ( )
default

Destructor.

Member Function Documentation

◆ 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

◆ initialize()

StatusCode Trk::FullLinearizedTrackFactory::initialize ( )
overridevirtual

Standard AlgToolMethods.

Definition at line 36 of file FullLinearizedTrackFactory.cxx.

44  {

◆ 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()

static const InterfaceID& Trk::IVertexLinearizedTrackFactory::interfaceID ( )
inlinestaticinherited

AlgTool interface methods.

Definition at line 78 of file IVertexLinearizedTrackFactory.h.

78 { return IID_IVertexLinearizedTrackFactory; };

◆ linearize()

void Trk::FullLinearizedTrackFactory::linearize ( VxTrackAtVertex theTrack,
const Amg::Vector3D linPoint 
) const
overridevirtual

Interface for VxTrackAtVertex: Takes a MeasuredPerigee from VxTrackAtVertex and a Lineariztion point.

Produces a new PerigeeLinearizedState and stores its pointer as a private
member of VxTrackAtVertex

Implements Trk::IVertexLinearizedTrackFactory.

Definition at line 45 of file FullLinearizedTrackFactory.cxx.

◆ linearizedTrack() [1/2]

LinearizedTrack * Trk::FullLinearizedTrackFactory::linearizedTrack ( const NeutralParameters param,
const Amg::Vector3D linPoint 
) const
overridevirtual

Linearization method: Takes a MeasuredPerigee and a LinearizationPoint.

Creates a new PerigeeLinearizedTrackState and returns its pointer.

Implements Trk::IVertexLinearizedTrackFactory.

Definition at line 233 of file FullLinearizedTrackFactory.cxx.

233  {
234  if (!neutralPars) return nullptr;
235  Amg::Vector3D lp =linPoint;
236  PerigeeSurface perigeeSurface(lp);
237 
238  //no material effects for neutral particles
239  /*
240  const Amg::Vector3D gMomentum = neutralPars->momentum();
241  const Amg::Vector3D gDirection = neutralPars->position() - lp;
242  const double extrapolationDirection = gMomentum.dot( gDirection);
243  MaterialUpdateMode mode = (extrapolationDirection < 0) ?
244  Trk::addNoise : // parameters upstream of vertex
245  Trk::removeNoise ; // parameters downstream of vertex -> go back
246  */
247  const NeutralParameters* parsAtVertex =
248  m_extrapolator->extrapolate(*neutralPars,
249  perigeeSurface, Trk::anyDirection, true).release();
250 
251  if (dynamic_cast<const Trk::NeutralPerigee*>(parsAtVertex)==nullptr ||
252  parsAtVertex->covariance()==nullptr ) {
253  ATH_MSG_INFO ("Could not extrapolate Perigee to vertex pos: x " << lp.x() << " y " <<
254  lp.y() << " z " << lp.z() << ". Should not happen. ");
255 
256  if (dynamic_cast<const Trk::NeutralPerigee*>(neutralPars) && neutralPars->covariance()) {
257  if (parsAtVertex) delete parsAtVertex; // in case extrapolation made other parameters
258  parsAtVertex = neutralPars->clone();
259  } else {
260  delete parsAtVertex; return nullptr;
261  }
262  }
263 
264  // positions, phi, theta
265  AmgVector(5) param = parsAtVertex->parameters();
266  Amg::Vector3D expPoint = parsAtVertex->position();
267 
268  double phi_v = param(Trk::phi);
269  double sin_phi_v = sin(phi_v);
270  double cos_phi_v = cos(phi_v);
271  double th = param(Trk::theta);
272  double tan_th = tan(th);
273  double q_ov_p = param(Trk::qOverP);
274 
275  //momentum
276  Amg::Vector3D expMomentum(phi_v, th, q_ov_p);
277  double X = expPoint(0) - lp.x();
278  double Y = expPoint(1) - lp.y();
279 
280  AmgVector(5) parAtExpansionPoint; parAtExpansionPoint.setZero();
281  parAtExpansionPoint[0] = Y*cos_phi_v-X*sin_phi_v;
282 
283  //very easy for a neutral track!
284  //phi doesn't change...
285 
286  double phiAtEp=phi_v;
287  parAtExpansionPoint[2] = phiAtEp;
288  parAtExpansionPoint[1] = expPoint[2] - lp.z() - 1./tan_th*(X*cos_phi_v+Y*sin_phi_v);
289  parAtExpansionPoint[3] = th;
290  parAtExpansionPoint[4] = q_ov_p;
291 
292  //jacobian elements
293  AmgMatrix(5,3) positionJacobian; positionJacobian.setZero();
294 
295  //first row
296  positionJacobian(0,0) = -sin_phi_v;
297  positionJacobian(0,1) = +cos_phi_v;
298 
299  //second raw
300  positionJacobian(1,0) = -cos_phi_v/tan_th;
301  positionJacobian(1,1) = -sin_phi_v/tan_th;
302  positionJacobian(1,2) = 1.;
303 
304 // std::cout<<"My position Jacobian: "<<positionJacobian<<std::endl;
305 
306  //momentum jacobian and related stuff
307  AmgMatrix(5,3) momentumJacobian; momentumJacobian.setZero();
308  momentumJacobian(2,0) = 1.;
309  momentumJacobian(3,1) = 1.;
310  momentumJacobian(4,2) = 1.;
311 // std::cout<<"My momentum Jacobian "<<momentumJacobian<<std::endl;
312 
313  AmgVector(5) constantTerm = parAtExpansionPoint - positionJacobian*expPoint - momentumJacobian*expMomentum;
314 // std::cout<<"My constant term: "<<constantTerm<<std::endl;
315 
316  LinearizedTrack* toreturn=new LinearizedTrack(parsAtVertex->parameters(),
317  *parsAtVertex->covariance(),
318  lp,
319  positionJacobian,
320  momentumJacobian,
321  expPoint,
322  expMomentum,
323  constantTerm);
324 
325  //delete MeasuredPerigee object created by the Extrapolator
326  delete parsAtVertex;
327  //return new linearized track
328  return toreturn;
329  }
330 
331 

◆ linearizedTrack() [2/2]

LinearizedTrack * Trk::FullLinearizedTrackFactory::linearizedTrack ( const TrackParameters param,
const Amg::Vector3D linPoint 
) const
overridevirtual

Linearization method: Takes a MeasuredPerigee and a LinearizationPoint.

Creates a new PerigeeLinearizedTrackState and returns its pointer.

Implements Trk::IVertexLinearizedTrackFactory.

Definition at line 53 of file FullLinearizedTrackFactory.cxx.

67  : // parameters upstream of vertex
68  Trk::removeNoise ; // parameters downstream of vertex -> go back
69 
70  const TrackParameters* parsAtVertex =
71  m_extrapolator->extrapolate(
72  Gaudi::Hive::currentContext(),
73  *trackPars,
74  perigeeSurface, Trk::anyDirection, true, Trk::pion, mode).release();
75 
76  if (dynamic_cast<const Trk::Perigee*>(parsAtVertex)==nullptr ||
77  parsAtVertex->covariance()==nullptr ) {
78  ATH_MSG_INFO ("Could not extrapolate Perigee to vertex pos: x " << lp.x() << " y " <<
79  lp.y() << " z " << lp.z() << ". Normal if outside ID acceptance ");
80 
81  if (dynamic_cast<const Trk::Perigee*>(trackPars) && trackPars->covariance()) {
82  if (parsAtVertex) delete parsAtVertex; // in case extrapolation made other parameters
83  parsAtVertex = trackPars->clone();
84  } else {
85  delete parsAtVertex; return nullptr;
86  }
87  }
88 
89  if (parsAtVertex && parsAtVertex->covariance() && parsAtVertex->covariance()->determinant()<=0)
90  {
91  ATH_MSG_DEBUG ("The track covariance matrix det after extrapolation is: " << parsAtVertex->covariance()->determinant() <<
92  " --> Using non extrapolated track parameters");
93  delete parsAtVertex;
94  parsAtVertex=trackPars->clone();
95  }
96 
97  // positions
98  AmgVector(5) param = parsAtVertex->parameters();
99  Amg::Vector3D expPoint = parsAtVertex->position();
100 
101  //phi_v and functions
102  double phi_v = param(Trk::phi);
103  double sin_phi_v = sin(phi_v);
104  double cos_phi_v = cos(phi_v);
105 
106  //theta and functions
107  double th = param(Trk::theta);
108  double sin_th = sin(th);
109  double tan_th = tan(th);
110 
111  //q over p
112  double q_ov_p = param(Trk::qOverP);
113  int sgn_h = (q_ov_p<0.)? -1:1;
114  Amg::Vector3D expMomentum(phi_v, th, q_ov_p);
115 
116  // magnetic field
117 
118  SG::ReadCondHandle<AtlasFieldCacheCondObj> readHandle{m_fieldCacheCondObjInputKey, Gaudi::Hive::currentContext()};
119  const AtlasFieldCacheCondObj* fieldCondObj{*readHandle};
120 
121  MagField::AtlasFieldCache fieldCache;
122  fieldCondObj->getInitializedCache (fieldCache);
123 
124  double mField[3];
125  fieldCache.getField(expPoint.data(),mField);
126 
127  double B_z=mField[2]*299.792;//Magnetic field is returned in kT.
128  //The scaling is a factor of c needed for computing rho.
129 
130  // signed radius and rotation variables
131  // (if momentum or mag field is absent, the curvature radius is infinite)
132 
133  double rho;
134  if(mField[2] == 0. || fabs(q_ov_p) <= 1e-15) rho = 1e+15 ;
135  else rho = sin_th / (q_ov_p * B_z);
136 
137  // std:: cout<<"calculated rho "<< rho<<std::endl;
138  double X = expPoint(0) - lp.x() + rho*sin_phi_v;
139  double Y = expPoint(1) - lp.y() - rho*cos_phi_v;
140  double SS = (X * X + Y * Y);
141  double S = sqrt(SS);
142 
143  //calculated parameters at expansion point
144  //q_over_p and theta stay constant along trajectory
145  AmgVector(5) parAtExpansionPoint; parAtExpansionPoint.setZero();
146  parAtExpansionPoint[0] = rho - sgn_h * S;
147 
148 //calculation of phi at expansion point
149  double phiAtEp;
150  int sgnY = (Y<0)? -1:1;
151  int sgnX = (X<0)? -1:1;
152  double pi = TMath::Pi();//acos(-1.);
153 
154  if(fabs(X)>fabs(Y)) phiAtEp = sgn_h*sgnX* acos(-sgn_h * Y / S);
155  else
156  {
157  phiAtEp = asin(sgn_h * X / S);
158  if( (sgn_h * sgnY)> 0) phiAtEp = sgn_h * sgnX * pi - phiAtEp;
159  }
160 
161  parAtExpansionPoint[2] = phiAtEp;
162  parAtExpansionPoint[1] = expPoint(2) - lp.z() + rho*(phi_v - parAtExpansionPoint[2])/tan_th;
163  parAtExpansionPoint[3] = th;
164  parAtExpansionPoint[4] = q_ov_p;
165 // std::cout<<"Calculated parameters at expansion point: "<<parAtExpansionPoint<<std::endl;
166 // std::cout<<"Difference: "<<predStateParameters-parAtExpansionPoint<<std::endl;
167 
168  //jacobian elements
169  AmgMatrix(5,3) positionJacobian; positionJacobian.setZero();
170 
171  //first row
172  positionJacobian(0,0) = -sgn_h * X / S;
173  positionJacobian(0,1) = -sgn_h * Y / S;
174 
175  //second row
176  positionJacobian(1,0) = rho * Y / (tan_th * SS);
177  positionJacobian(1,1) = -rho * X / (tan_th * SS);
178  positionJacobian(1,2) = 1.;
179 
180  //third row
181  positionJacobian(2,0) = -Y / SS;
182  positionJacobian(2,1) = X / SS;
183 // std::cout<<"My position Jacobian: "<<positionJacobian<<std::endl;
184 
185  //momentum jacobian and related stuff
186  AmgMatrix(5,3) momentumJacobian; momentumJacobian.setZero();
187  double R = X*cos_phi_v + Y * sin_phi_v;
188  double Q = X*sin_phi_v - Y * cos_phi_v;
189  double d_phi = parAtExpansionPoint[2] - phi_v;
190 
191  //first row
192  momentumJacobian(0,0) = -sgn_h * rho * R / S ;
193 
194  double qOvS_red = 1 - sgn_h * Q / S;
195  momentumJacobian(0,1) = qOvS_red * rho / tan_th;
196  momentumJacobian(0,2) = - qOvS_red * rho / q_ov_p;
197 
198  //second row
199  momentumJacobian(1,0) = (1 - rho*Q/SS )*rho/tan_th;
200  momentumJacobian(1,1) = (d_phi + rho * R / (SS * tan_th * tan_th) ) * rho;
201  momentumJacobian(1,2) = (d_phi - rho * R /SS ) * rho / (q_ov_p*tan_th);
202 
203  //third row
204  momentumJacobian(2,0) = rho * Q / SS;
205  momentumJacobian(2,1) = -rho * R / (SS*tan_th);
206  momentumJacobian(2,2) = rho * R / (q_ov_p*SS);
207 
208  //last two rows:
209  momentumJacobian(3,1) = 1.;
210  momentumJacobian(4,2) = 1.;
211 // std::cout<<"My momentum Jacobian "<<momentumJacobian<<std::endl;
212 
213  AmgVector(5) constantTerm = parAtExpansionPoint - positionJacobian*expPoint - momentumJacobian*expMomentum;
214 // std::cout<<"My constant term: "<<constantTerm<<std::endl;
215 
216  LinearizedTrack* toreturn=new LinearizedTrack(parsAtVertex->parameters(),
217  *parsAtVertex->covariance(),
218  lp,
219  positionJacobian,
220  momentumJacobian,
221  expPoint,
222  expMomentum,
223  constantTerm);
224 
225  //delete Perigee object created by the Extrapolator
226  delete parsAtVertex;
227  //return new linearized track
228  return toreturn;
229  }
230 
231  LinearizedTrack * FullLinearizedTrackFactory::linearizedTrack(const NeutralParameters * neutralPars,

◆ 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  }

◆ 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_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_extrapolator

ToolHandle< Trk::IExtrapolator > Trk::FullLinearizedTrackFactory::m_extrapolator
private

Definition at line 103 of file FullLinearizedTrackFactory.h.

◆ m_fieldCacheCondObjInputKey

SG::ReadCondHandleKey<AtlasFieldCacheCondObj> Trk::FullLinearizedTrackFactory::m_fieldCacheCondObjInputKey {this, "AtlasFieldCacheCondObj", "fieldCondObj", "Name of the Magnetic Field conditions object key"}
private

Definition at line 104 of file FullLinearizedTrackFactory.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:
Trk::anyDirection
@ anyDirection
Definition: PropDirection.h:22
Trk::y
@ y
Definition: ParamDefs.h:62
Trk::FullLinearizedTrackFactory::m_extrapolator
ToolHandle< Trk::IExtrapolator > m_extrapolator
Definition: FullLinearizedTrackFactory.h:103
Trk::AmgMatrix
AmgMatrix(3, 3) NeutralParticleParameterCalculator
Definition: NeutralParticleParameterCalculator.cxx:233
python.PerfMonSerializer.p
def p
Definition: PerfMonSerializer.py:743
SG
Forward declaration.
Definition: CaloCellPacker_400_500.h:32
Trk::z
@ z
global position (cartesian)
Definition: ParamDefs.h:63
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
AtlasFieldCacheCondObj
Definition: AtlasFieldCacheCondObj.h:19
AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
Definition: AthCommonDataStore.h:145
Trk::ParametersT
Dummy class used to allow special convertors to be called for surfaces owned by a detector element.
Definition: EMErrorDetail.h:25
CSV_InDetExporter.new
new
Definition: CSV_InDetExporter.py:145
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
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
drawFromPickle.cos
cos
Definition: drawFromPickle.py:36
const
bool const RAWDATA *ch2 const
Definition: LArRodBlockPhysicsV0.cxx:562
Trk::TrackParameters
ParametersBase< 5, Charged > TrackParameters
Definition: Tracking/TrkEvent/TrkParameters/TrkParameters/TrackParameters.h:24
JetTiledMap::S
@ S
Definition: TiledEtaPhiMap.h:44
Trk::FullLinearizedTrackFactory::linearizedTrack
virtual LinearizedTrack * linearizedTrack(const TrackParameters *param, const Amg::Vector3D &linPoint) const override
Linearization method: Takes a MeasuredPerigee and a LinearizationPoint.
Definition: FullLinearizedTrackFactory.cxx:53
pi
#define pi
Definition: TileMuonFitter.cxx:65
Monitored::X
@ X
Definition: HistogramFillerUtils.h:24
SG::VarHandleKeyArray::setOwner
virtual void setOwner(IDataHandleHolder *o)=0
python.TriggerHandler.th
th
Definition: TriggerHandler.py:296
AthCommonDataStore
Definition: AthCommonDataStore.h:52
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
Trk::NeutralParameters
ParametersBase< 5, Neutral > NeutralParameters
Definition: NeutralParameters.h:25
Trk::theta
@ theta
Definition: ParamDefs.h:72
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
AmgVector
AmgVector(4) T2BSTrackFilterTool
Definition: T2BSTrackFilterTool.cxx:114
Trk::pion
@ pion
Definition: ParticleHypothesis.h:29
Preparation.mode
mode
Definition: Preparation.py:95
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
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
Monitored::Y
@ Y
Definition: HistogramFillerUtils.h:24
Trk::FullLinearizedTrackFactory::FullLinearizedTrackFactory
FullLinearizedTrackFactory(const std::string &t, const std::string &n, const IInterface *p)
Default constructor due to Athena interface.
Definition: FullLinearizedTrackFactory.cxx:27
Trk
Ensure that the ATLAS eigen extensions are properly loaded.
Definition: FakeTrackBuilder.h:9
Amg
Definition of ATLAS Math & Geometry primitives (Amg)
Definition: AmgStringHelpers.h:19
merge_scale_histograms.doc
string doc
Definition: merge_scale_histograms.py:9
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:192
Trk::FullLinearizedTrackFactory::~FullLinearizedTrackFactory
~FullLinearizedTrackFactory()
Destructor.
Amg::Vector3D
Eigen::Matrix< double, 3, 1 > Vector3D
Definition: GeoPrimitives.h:47
calibdata.delete
list delete
Definition: calibdata.py:46
DiTauMassTools::MaxHistStrategyV2::e
e
Definition: PhysicsAnalysis/TauID/DiTauMassTools/DiTauMassTools/HelperFunctions.h:26
a
TList * a
Definition: liststreamerinfos.cxx:10
h
MagField::AtlasFieldCache
Local cache for magnetic field (based on MagFieldServices/AtlasFieldSvcTLS.h)
Definition: AtlasFieldCache.h:43
Trk::qOverP
@ qOverP
perigee
Definition: ParamDefs.h:73
if
if(febId1==febId2)
Definition: LArRodBlockPhysicsV0.cxx:569
SG::VarHandleBase::vhKey
SG::VarHandleKey & vhKey()
Return a non-const reference to the HandleKey.
Definition: StoreGate/src/VarHandleBase.cxx:616
MagField::AtlasFieldCache::getField
void getField(const double *ATH_RESTRICT xyz, double *ATH_RESTRICT bxyz, double *ATH_RESTRICT deriv=nullptr)
get B field value at given position xyz[3] is in mm, bxyz[3] is in kT if deriv[9] is given,...
Definition: AtlasFieldCache.cxx:42
physics_parameters.parameters
parameters
Definition: physics_parameters.py:144
declareProperty
#define declareProperty(n, p, h)
Definition: BaseFakeBkgTool.cxx:15
Trk::phi
@ phi
Definition: ParamDefs.h:81
python.Bindings.keys
keys
Definition: Control/AthenaPython/python/Bindings.py:790
drawFromPickle.sin
sin
Definition: drawFromPickle.py:36
Trk::x
@ x
Definition: ParamDefs.h:61
Trk::removeNoise
@ removeNoise
Definition: MaterialUpdateMode.h:20
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::FullLinearizedTrackFactory::m_fieldCacheCondObjInputKey
SG::ReadCondHandleKey< AtlasFieldCacheCondObj > m_fieldCacheCondObjInputKey
Definition: FullLinearizedTrackFactory.h:105
fitman.rho
rho
Definition: fitman.py:532
fitman.k
k
Definition: fitman.py:528