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

#include <NeutralParticleParameterCalculator.h>

Inheritance diagram for Trk::NeutralParticleParameterCalculator:
Collaboration diagram for Trk::NeutralParticleParameterCalculator:

Public Member Functions

virtual StatusCode initialize () override
 
 NeutralParticleParameterCalculator (const std::string &t, const std::string &n, const IInterface *p)
 Default constructor due to Athena interface. More...
 
 ~NeutralParticleParameterCalculator ()
 Destructor. More...
 
virtual NeutralPerigeecreateNeutralTrackFromVertex (const xAOD::Vertex &) const override
 method that makes the parameters of a V0 or photon before decay to two tracks 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 ()
 

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

std::pair< AmgMatrix(3, 3), AmgMatrix(3, 3)> getPosMomentumAndMomentumCovMatrix (const Trk::LinearizedTrack *linTrack, const AmgMatrix(3, 3) &vrt_cov, const AmgMatrix(3, 3) &vrt_weight) const
 
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...
 

Static Private Member Functions

static AmgMatrix (3, 3) getPhiThetaQOverPToPxPyPzJacobian(double qOverP
 

Private Attributes

static double theta
 
static double double phi
 
ToolHandle< Trk::IVertexLinearizedTrackFactorym_LinearizedTrackFactory
 
bool m_linearizedTrackFactoryIsAvailable
 
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

Tool taking a two-track vertex and creating a neutral track from it. If the vertex is an extended vertex, it uses the full vertex-to-track covariance matrix (constrained vertex fit), if not, then it assumes all the correlations come simply from the fact that a common vertex is fit (unconstrained vertex fit), and reconstructs back the vertex-to-track correlations from the vertex and track cov. matrices. The former is used in egamma, while in JetFitter the latter is used.

Author
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-04-26)

EDM Migration to xAOD - remove method using VxCandidate

Definition at line 43 of file NeutralParticleParameterCalculator.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

◆ NeutralParticleParameterCalculator()

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

Default constructor due to Athena interface.

Definition at line 26 of file NeutralParticleParameterCalculator.cxx.

28  {
29  declareProperty("LinearizedTrackFactory",m_LinearizedTrackFactory);
30  declareInterface<INeutralParticleParameterCalculator>(this);
31  }
32 

◆ ~NeutralParticleParameterCalculator()

Trk::NeutralParticleParameterCalculator::~NeutralParticleParameterCalculator ( )
default

Destructor.

Member Function Documentation

◆ AmgMatrix()

static Trk::NeutralParticleParameterCalculator::AmgMatrix ( ,
 
)
staticprivate

◆ createNeutralTrackFromVertex()

NeutralPerigee * Trk::NeutralParticleParameterCalculator::createNeutralTrackFromVertex ( const xAOD::Vertex myVertex) const
overridevirtual

method that makes the parameters of a V0 or photon before decay to two tracks

Implements Trk::INeutralParticleParameterCalculator.

Definition at line 46 of file NeutralParticleParameterCalculator.cxx.

49  {
50  msg(MSG::WARNING) << " More or less than 2 tracks in Vertex. No Neutral Perigee could be created" << endmsg;
51  return nullptr;
52  }
53 
54  if ( !myVertex.trackParticleLinks()[0].isValid() || !myVertex.trackParticleLinks()[1].isValid() )
55  {
56  msg(MSG::WARNING) << " Track Particle Element link is not valid" << endmsg;
57  return nullptr;
58 
59  }
60  const xAOD::TrackParticle * myFirstTrack= myVertex.trackParticle( 0 );
61  const xAOD::TrackParticle * mySecondTrack=myVertex.trackParticle( 1 );
62 
63  const Trk::Perigee& myFirstPerigee = myFirstTrack->perigeeParameters();
64  const Trk::Perigee& mySecondPerigee = mySecondTrack->perigeeParameters();
65 
66  const AmgMatrix(3,3)& vrt_cov = myVertex.covariancePosition();
67  AmgMatrix(3,3) vrt_weight = myVertex.covariancePosition().inverse().eval();
68 
69  //need to recalculate the refitted covariance matrix of the tracks (yes, we don't have it yet)
70  std::pair<AmgMatrix(3,3),AmgMatrix(3,3)> PosMomAndMomCovFirstTrack;
71  std::pair<AmgMatrix(3,3),AmgMatrix(3,3)> PosMomAndMomCovSecondTrack;
72 
73 
74  //check if the linearizedTrackFactory is available...
76  msg(MSG::ERROR) << " No LinearizedTrackFactory is defined and no ExtendedVxCandidate is provided. Cannot obtain covariance matrix of neutral particle. Failed... " << endmsg;
77  return nullptr;
78  }
79 
80 
82 
83  const Trk::LinearizedTrack * myFirstLinearizedTrack = m_LinearizedTrackFactory->linearizedTrack(&myFirstPerigee, myVertex.position() );
84  const Trk::LinearizedTrack * mySecondLinearizedTrack= m_LinearizedTrackFactory->linearizedTrack(&mySecondPerigee, myVertex.position() );
85 
86  if (myFirstLinearizedTrack==nullptr||mySecondLinearizedTrack==nullptr)
87  {
88  msg(MSG::WARNING) << " Could not find one of the linearized tracks. No Neutral Perigee could be created" << endmsg;
89  if (myFirstLinearizedTrack) delete myFirstLinearizedTrack;
90  if (mySecondLinearizedTrack) delete mySecondLinearizedTrack;
91  return nullptr;
92  }
93 
94  PosMomAndMomCovFirstTrack=getPosMomentumAndMomentumCovMatrix(myFirstLinearizedTrack,
95  vrt_cov,
96  vrt_weight);
97 
98  PosMomAndMomCovSecondTrack=getPosMomentumAndMomentumCovMatrix(mySecondLinearizedTrack,
99  vrt_cov,
100  vrt_weight);
101 
102  delete myFirstLinearizedTrack;
103  delete mySecondLinearizedTrack;
104  } else {
105  msg(MSG::WARNING) << " getPosMomentumAndMomentumCovMatrix method failed " << endmsg;
106  return nullptr;
107  }
108 
109  const AmgVector(5) & myFirstPerigeeParameters=myFirstPerigee.parameters();
110  const AmgVector(5) & mySecondPerigeeParameters=mySecondPerigee.parameters();
111 
112  AmgMatrix(3,3) FirstJacobianToPxPyPz=getPhiThetaQOverPToPxPyPzJacobian(myFirstPerigeeParameters[Trk::qOverP],
113  myFirstPerigeeParameters[Trk::theta],
114  myFirstPerigeeParameters[Trk::phi0]);
115 
116  AmgMatrix(3,3) SecondJacobianToPxPyPz=getPhiThetaQOverPToPxPyPzJacobian(mySecondPerigeeParameters[Trk::qOverP],
117  mySecondPerigeeParameters[Trk::theta],
118  mySecondPerigeeParameters[Trk::phi0]);
119 
120 
121 
122  AmgMatrix(3,3) posMomentumCovFirst=PosMomAndMomCovFirstTrack.first*FirstJacobianToPxPyPz.transpose();
123  AmgMatrix(3,3) posMomentumCovSecond=PosMomAndMomCovSecondTrack.first*SecondJacobianToPxPyPz.transpose();
124 
125  AmgMatrix(3,3) momentumCovFirst=PosMomAndMomCovFirstTrack.second.similarity(FirstJacobianToPxPyPz);
126  AmgMatrix(3,3) momentumCovSecond=PosMomAndMomCovSecondTrack.second.similarity(SecondJacobianToPxPyPz);
127 
128 
129  //P1 P2 covariance matrix
130  AmgMatrix(3,3) covP1P2; covP1P2.setZero();
131 
132 
133  covP1P2=posMomentumCovFirst.transpose()*vrt_weight*posMomentumCovSecond;
134 
135  // no distinction between symmetric and non-symmetric square matrices in new EDM, drop checks.
136  // AmgMatrix(3,3) nonSymCovNewP = momentumCovFirst+momentumCovSecond+covP1P2+covP1P2.transpose();
137  AmgMatrix(3,3) covNewP = momentumCovFirst+momentumCovSecond+covP1P2+covP1P2.transpose();
138 
139  AmgMatrix(3,3) covNewXP=posMomentumCovFirst+posMomentumCovSecond;
140 
141  //now covNewP and covNewXP are the new covariance matrices with the new momentum
142  //calculate also new momentum
143  Amg::Vector3D newMomentum=myFirstPerigee.momentum()+mySecondPerigee.momentum();
144 
145  ATH_MSG_VERBOSE(" new momentum " << newMomentum << " new cov Momentum " << covNewP);
146  ATH_MSG_VERBOSE(" position " << myVertex.position() << " cov Pos - Momentum " << covNewXP);
147  ATH_MSG_VERBOSE(" old cov position " << vrt_cov);
148 
149  //Now you need to create the new neutral tracks
150  //NOT trivial, since no global representation exists...
151  //now you need first to go back with the momentum (px,py,pz -> phi,theta,q/p)
152 
153  Trk::JacobianPxyzToPhiThetaQoverPspherical JacobianToPhiThetaQOverP(newMomentum.phi(),
154  newMomentum.theta(),
155  1./newMomentum.mag());
156 
157  AmgMatrix(3,3) finalCovNewP=covNewP.similarity(JacobianToPhiThetaQOverP);
158  AmgMatrix(3,3) finalCovNewXP=covNewXP*JacobianToPhiThetaQOverP.transpose();
159 
160  double phi=newMomentum.phi();
161  double theta=newMomentum.theta();
162  double qOverP=1./newMomentum.mag();
163 
164  ATH_MSG_VERBOSE(" new phi: " << phi << " +/- " << sqrt(finalCovNewP(0,0)));
165  ATH_MSG_VERBOSE(" new theta: " << theta << " +/- " << sqrt(finalCovNewP(1,1)));
166  ATH_MSG_VERBOSE(" new P: " << 1./qOverP << " +/- " << 1./qOverP/qOverP*sqrt(finalCovNewP(2,2)));
167 
168  //now you still have 6 parameters! need to reduce them to 5!
169  //
170  //create the jacobian for a neutral particle
171 
172  double sin_phi_v=sin(phi);
173  double cos_phi_v=cos(phi);
174  double tan_th=tan(theta);
175 
176  //jacobian elements
177  AmgMatrix(5,6) globalNeutralJacobian; globalNeutralJacobian.setZero();
178  globalNeutralJacobian(0,0) = -sin_phi_v;
179  globalNeutralJacobian(0,1) = +cos_phi_v;
180  globalNeutralJacobian(1,0) = -cos_phi_v/tan_th;
181  globalNeutralJacobian(1,1) = -sin_phi_v/tan_th;
182  globalNeutralJacobian(1,2) = 1.;
183  globalNeutralJacobian(2,3) = 1.;
184  globalNeutralJacobian(3,4) = 1.;
185  globalNeutralJacobian(4,5) = 1.;
186 
187  AmgMatrix(6,6) fullTrkCov; fullTrkCov.setZero();
188  fullTrkCov.block<3,3>(0,3) = finalCovNewXP; // was .sub(1,4, finalCovNewXP);
189  fullTrkCov.block<3,3>(3,0) = finalCovNewXP.transpose(); // was .sub(4,1, finalCovNewXP.T());
190  fullTrkCov.block<3,3>(0,0) = vrt_cov; // was .sub(1,1, vrt_cov);
191  fullTrkCov.block<3,3>(3,3) = finalCovNewP; // was .sub(4,4, finalCovNewP);
192 
193  // no mechanism in new EDM: CLHEP::HepSymMatrix symFullTrkCov;
194  // no mechanism in new EDM: symFullTrkCov.assign(fullTrkCov);
195 
196  Trk::PerigeeSurface perSurface(myVertex.position());
197  AmgSymMatrix(5) covNeutral = AmgSymMatrix(5)(globalNeutralJacobian*fullTrkCov*globalNeutralJacobian.transpose());
198 
199  return new Trk::NeutralPerigee(0,0,phi,theta,qOverP,perSurface,std::move(covNeutral));
200  }
201 
202 

◆ 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

◆ getPosMomentumAndMomentumCovMatrix()

std::pair< AmgMatrix(3, 3), AmgMatrix(3, 3)> Trk::NeutralParticleParameterCalculator::getPosMomentumAndMomentumCovMatrix ( const Trk::LinearizedTrack linTrack,
const AmgMatrix(3, 3) &  vrt_cov,
const AmgMatrix(3, 3) &  vrt_weight 
) const
private

Definition at line 207 of file NeutralParticleParameterCalculator.cxx.

209  {
210 
211  const AmgMatrix(5,3) & A = linTrack->positionJacobian();
212  const AmgMatrix(5,3) & B = linTrack->momentumJacobian();
213  const AmgSymMatrix(5) & trkParametersWeight = linTrack->expectedWeightAtPCA();
214 
215  AmgSymMatrix(3) Sm = B.transpose()*(trkParametersWeight*B);
216  // same maths, but doesn't compile: AmgSymMatrix(3) Sm = trkParametersWeight.similarityT(B);
217  if (Sm.determinant() == 0.0) {
218  ATH_MSG_WARNING("S matrix can not be inverted, new type of check as part of Eigen, please monitor."
219  << endmsg << "Matrix Sm = " << Sm);
220  ATH_MSG_WARNING("This track is returned not refitted");
221  // throw std::string("Inversion of S matrix fails in track parameters refit");
222  }
223  Sm = Sm.inverse().eval();
224  AmgMatrix(3,3) posMomentumCovariance = -vrt_cov * A.transpose() * trkParametersWeight * B *Sm;
225  AmgMatrix(3,3) momentumCovariance = Sm + vrt_weight.similarityT(posMomentumCovariance);
226 
227  return std::pair<AmgMatrix(3,3),AmgMatrix(3,3)>(posMomentumCovariance,momentumCovariance);
228  }
229 
230 

◆ initialize()

StatusCode Trk::NeutralParticleParameterCalculator::initialize ( )
overridevirtual

Definition at line 37 of file NeutralParticleParameterCalculator.cxx.

37  { m_LinearizedTrackFactory.empty() } ));
39 
40  return StatusCode::SUCCESS;
41  }
42 
43 

◆ 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::INeutralParticleParameterCalculator::interfaceID ( )
inlinestaticinherited

Definition at line 42 of file INeutralParticleParameterCalculator.h.

42 { return IID_NeutralParticleParameterCalculator; };

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

ToolHandle<Trk::IVertexLinearizedTrackFactory> Trk::NeutralParticleParameterCalculator::m_LinearizedTrackFactory
private

Definition at line 71 of file NeutralParticleParameterCalculator.h.

◆ m_linearizedTrackFactoryIsAvailable

bool Trk::NeutralParticleParameterCalculator::m_linearizedTrackFactoryIsAvailable
private

Definition at line 72 of file NeutralParticleParameterCalculator.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.

◆ phi

double double Trk::NeutralParticleParameterCalculator::phi
private

Definition at line 69 of file NeutralParticleParameterCalculator.h.

◆ theta

double Trk::NeutralParticleParameterCalculator::theta
private

Definition at line 69 of file NeutralParticleParameterCalculator.h.


The documentation for this class was generated from the following files:
Trk::NeutralParticleParameterCalculator::theta
static double theta
Definition: NeutralParticleParameterCalculator.h:69
python.SystemOfUnits.second
int second
Definition: SystemOfUnits.py:120
Trk::NeutralParticleParameterCalculator::m_linearizedTrackFactoryIsAvailable
bool m_linearizedTrackFactoryIsAvailable
Definition: NeutralParticleParameterCalculator.h:72
python.PerfMonSerializer.p
def p
Definition: PerfMonSerializer.py:743
Trk::NeutralPerigee
ParametersT< 5, Neutral, PerigeeSurface > NeutralPerigee
Definition: NeutralParameters.h:30
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
xAOD::Vertex_v1::trackParticleLinks
const TrackParticleLinks_t & trackParticleLinks() const
Get all the particles associated with the vertex.
CSV_InDetExporter.new
new
Definition: CSV_InDetExporter.py:145
plotBeamSpotVxVal.cov
cov
Definition: plotBeamSpotVxVal.py:201
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
xAOD::Vertex_v1::position
const Amg::Vector3D & position() const
Returns the 3-pos.
Trk::NeutralParticleParameterCalculator::m_LinearizedTrackFactory
ToolHandle< Trk::IVertexLinearizedTrackFactory > m_LinearizedTrackFactory
Definition: NeutralParticleParameterCalculator.h:71
Trk::NeutralParticleParameterCalculator::getPosMomentumAndMomentumCovMatrix
std::pair< AmgMatrix(3, 3), AmgMatrix(3, 3)> getPosMomentumAndMomentumCovMatrix(const Trk::LinearizedTrack *linTrack, const AmgMatrix(3, 3) &vrt_cov, const AmgMatrix(3, 3) &vrt_weight) const
Definition: NeutralParticleParameterCalculator.cxx:208
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
drawFromPickle.cos
cos
Definition: drawFromPickle.py:36
ATH_MSG_VERBOSE
#define ATH_MSG_VERBOSE(x)
Definition: AthMsgStreamMacros.h:28
Trk::NeutralParticleParameterCalculator::AmgMatrix
static AmgMatrix(3, 3) getPhiThetaQOverPToPxPyPzJacobian(double qOverP
similarity
Matrix< Scalar, OtherDerived::RowsAtCompileTime, OtherDerived::RowsAtCompileTime > similarity(const MatrixBase< OtherDerived > &m) const
Definition: AmgMatrixBasePlugin.h:130
SG::VarHandleKeyArray::setOwner
virtual void setOwner(IDataHandleHolder *o)=0
dqt_zlumi_alleff_HIST.A
A
Definition: dqt_zlumi_alleff_HIST.py:110
Trk::AmgSymMatrix
AmgSymMatrix(5) &GXFTrackState
Definition: GXFTrackState.h:156
xAOD::TrackParticle_v1::perigeeParameters
const Trk::Perigee & perigeeParameters() const
Returns the Trk::MeasuredPerigee track parameters.
Definition: TrackParticle_v1.cxx:485
AthCommonDataStore
Definition: AthCommonDataStore.h:52
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
ParticleGun_EoverP_Config.momentum
momentum
Definition: ParticleGun_EoverP_Config.py:63
endmsg
#define endmsg
Definition: AnalysisConfig_Ntuple.cxx:63
AmgVector
AmgVector(4) T2BSTrackFilterTool
Definition: T2BSTrackFilterTool.cxx:114
drawFromPickle.tan
tan
Definition: drawFromPickle.py:36
xAOD::Vertex_v1::trackParticle
const TrackParticle * trackParticle(size_t i) const
Get the pointer to a given track that was used in vertex reco.
Definition: Vertex_v1.cxx:249
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
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
dqt_zlumi_alleff_HIST.B
B
Definition: dqt_zlumi_alleff_HIST.py:110
Trk::NeutralParticleParameterCalculator::phi
static double double phi
Definition: NeutralParticleParameterCalculator.h:69
Amg::Vector3D
Eigen::Matrix< double, 3, 1 > Vector3D
Definition: GeoPrimitives.h:47
similarityT
Matrix< Scalar, OtherDerived::RowsAtCompileTime, OtherDerived::RowsAtCompileTime > similarityT(const MatrixBase< OtherDerived > &m) const
similarityT method : yields ms = m^T*s*m
Definition: AmgMatrixBasePlugin.h:138
a
TList * a
Definition: liststreamerinfos.cxx:10
h
CSV_InDetExporter.old
old
Definition: CSV_InDetExporter.py:145
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
DeMoScan.first
bool first
Definition: DeMoScan.py:534
Trk::NeutralParticleParameterCalculator::~NeutralParticleParameterCalculator
~NeutralParticleParameterCalculator()
Destructor.
AthCommonMsg< AlgTool >::msg
MsgStream & msg() const
Definition: AthCommonMsg.h:24
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
declareProperty
#define declareProperty(n, p, h)
Definition: BaseFakeBkgTool.cxx:15
python.Bindings.keys
keys
Definition: Control/AthenaPython/python/Bindings.py:790
xAOD::TrackParticle_v1
Class describing a TrackParticle.
Definition: TrackParticle_v1.h:43
drawFromPickle.sin
sin
Definition: drawFromPickle.py:36
AthCommonDataStore::declareGaudiProperty
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>
Definition: AthCommonDataStore.h:156
mag
Scalar mag() const
mag method
Definition: AmgMatrixBasePlugin.h:25
Trk::phi0
@ phi0
Definition: ParamDefs.h:71
fitman.k
k
Definition: fitman.py:528
Trk::LinearizedTrack
Definition: LinearizedTrack.h:43