Loading [MathJax]/jax/input/TeX/config.js
ATLAS Offline Software
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
Public Member Functions | Static Public Member Functions | Protected Member Functions | Private Types | Private Member Functions | Private Attributes | List of all members
Trk::JetFitterInitializationHelper Class Reference

Februar 2007 (c) Atlas Detector Reconstruction Software. More...

#include <JetFitterInitializationHelper.h>

Inheritance diagram for Trk::JetFitterInitializationHelper:
Collaboration diagram for Trk::JetFitterInitializationHelper:

Public Member Functions

virtual StatusCode initialize () override
 
 JetFitterInitializationHelper (const std::string &t, const std::string &n, const IInterface *p)
 Constructor. More...
 
 ~JetFitterInitializationHelper ()
 Destructor. More...
 
VxJetCandidateinitializeJetCandidate (const std::vector< const Trk::ITrackLink * > &vectorOfLink, const RecVertex *primaryVertex, const Amg::Vector3D *jetdirection=0, const Amg::Vector3D *linearizationjetdirection=0) const
 Initialize the JetCandidate using a vector of Trk::ITrackLink* - needed for example if you run on ESD (Track*), but you have additional neutral tracks (TrackParticleBase*) IMPORTANT: Ownership of ITrackLink objects is taken OVER. More...
 
VxJetCandidateinitializeJetCandidate (const std::vector< const Trk::Track * > &vectorOfT, const RecVertex *primaryVertex, const Amg::Vector3D *jetdirection=0, const Amg::Vector3D *linearizationjetdirection=0) const
 Initialize the Jet Candidate using a vector of Tracks, the primary vertex of the event (origin of the flight axis along which the tracks will be constrained) and the jet direction. More...
 
VxJetCandidateinitializeJetCandidate (const std::vector< const Trk::TrackParticleBase * > &vectorOfTP, const RecVertex *primaryVertex, const Amg::Vector3D *jetdirection=0, const Amg::Vector3D *linearizationjetdirection=0) const
 Initialize the Jet Candidate using a vector of TrackParticles, the primary vertex of the event (origin of the flight axis along which the tracks will be constrained) and the jet direction. More...
 
void linearizeAllTracks (VxJetCandidate *, bool signfliptreatment=false, double maxdistance=1.) const
 Calls the linearization of all the tracks (adds the Linearized Track data member to every VxTrackAtVertex (VxTrackOnJetAxis) involved in the fit). 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 ()
 
static void updateTrackNumbering (VxJetCandidate *)
 Does the update of the ordering of the vertices along the jetaxis. 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

VxJetCandidateinitializeJetClusters (VxJetCandidate *myJetCandidate, const RecVertex *primaryVertex, const Amg::Vector3D *jetdirection=0, const Amg::Vector3D *linearizationjetdirection=0) const
 Internal method to initialized a VxJetCandidate. More...
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
 specialization for handling Gaudi::Property<SG::VarHandleKey> More...
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleKeyArrayType &)
 specialization for handling Gaudi::Property<SG::VarHandleKeyArray> More...
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleType &)
 specialization for handling Gaudi::Property<SG::VarHandleBase> More...
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T > &t, const SG::NotHandleType &)
 specialization for handling everything that's not a Gaudi::Property<SG::VarHandleKey> or a <SG::VarHandleKeyArray> More...
 

Private Attributes

ToolHandle< IVertexLinearizedTrackFactorym_linearizedFactory
 
float m_errphiJetAxis
 Error on phi on the flight direction you want to initialize the fit with (set errphiJetAxis by JobOptions, default is 0.07). More...
 
float m_erretaJetAxis
 Error on eta on the flight direction you want to initialize the fit with (set erretaJetAxis by JobOptions, default is 0.065) 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

Februar 2007 (c) Atlas Detector Reconstruction Software.

Author
Giacinto Piacquadio (University of Freiburg)
Christian Weiser (University of Freiburg)

(In case of problems, please contact: nicol.nosp@m.a.gi.nosp@m.acint.nosp@m.o.pi.nosp@m.acqua.nosp@m.dio@.nosp@m.cern..nosp@m.ch)

This class is used to initialize a VxJetCandidate, which is the class to be provided to the 'JetFitter' algorithm in order to perform the fit of all the vertices on the JetAxis. For using it, please look at the doxygen documentation of its methods.

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

◆ JetFitterInitializationHelper()

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

Constructor.

Definition at line 92 of file JetFitterInitializationHelper.cxx.

96  {
97 
99  if(sc.isFailure()) {
100  ATH_MSG_ERROR( " Unable to retrieve "<<m_linearizedFactory );
101  return StatusCode::FAILURE;
102  }
103 

◆ ~JetFitterInitializationHelper()

Trk::JetFitterInitializationHelper::~JetFitterInitializationHelper ( )
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::JetFitterInitializationHelper::initialize ( )
overridevirtual

Definition at line 112 of file JetFitterInitializationHelper.cxx.

113  : Ownership of ITrackLink objects is taken OVER
114  */
115 
116  VxJetCandidate * JetFitterInitializationHelper::initializeJetCandidate(const std::vector<const Trk::ITrackLink*> & vectorOfLink,
117  const RecVertex* primaryVertex,
118  const Amg::Vector3D* jetdirection,
119  const Amg::Vector3D* linearizationjetdirection) const
120  {
121 
122  ATH_MSG_VERBOSE (" Entered initializeJetCandidate() ");
123 

◆ initializeJetCandidate() [1/3]

VxJetCandidate * Trk::JetFitterInitializationHelper::initializeJetCandidate ( const std::vector< const Trk::ITrackLink * > &  vectorOfLink,
const RecVertex primaryVertex,
const Amg::Vector3D jetdirection = 0,
const Amg::Vector3D linearizationjetdirection = 0 
) const

Initialize the JetCandidate using a vector of Trk::ITrackLink* - needed for example if you run on ESD (Track*), but you have additional neutral tracks (TrackParticleBase*) IMPORTANT: Ownership of ITrackLink objects is taken OVER.

Definition at line 132 of file JetFitterInitializationHelper.cxx.

134  {
135  std::vector<Trk::VxTrackAtVertex*> temp_vector_tracksAtVertex;
136  Trk::VxTrackAtVertex* newVxTrack=new Trk::VxTrackAtVertex((*vectorOfLinkIter)->clone());
137  temp_vector_tracksAtVertex.push_back(newVxTrack);
138  setOfTracks->push_back(newVxTrack);
139  setOfVertices.push_back(new Trk::VxVertexOnJetAxis(temp_vector_tracksAtVertex));
140  }
141  myJetCandidate->setVerticesOnJetAxis(setOfVertices);
142  return initializeJetClusters(myJetCandidate,primaryVertex,jetdirection,linearizationjetdirection);
143 
144  }
145 
146 
147 
148 
149  VxJetCandidate * JetFitterInitializationHelper::initializeJetCandidate(const std::vector<const Trk::TrackParticleBase*> & vectorOfTP,
150  const RecVertex* primaryVertex,
151  const Amg::Vector3D* jetdirection,
152  const Amg::Vector3D* linearizationjetdirection) const {
153 
154 
155  //creates VxJetCandidate. Constructor takes care of adding VxTrackAtVertex
156  //and creating one VxVertexOnJetAxis for each added track
157 
158  VxJetCandidate* myJetCandidate=new VxJetCandidate(vectorOfTP);
159 
160 

◆ initializeJetCandidate() [2/3]

VxJetCandidate * Trk::JetFitterInitializationHelper::initializeJetCandidate ( const std::vector< const Trk::Track * > &  vectorOfT,
const RecVertex primaryVertex,
const Amg::Vector3D jetdirection = 0,
const Amg::Vector3D linearizationjetdirection = 0 
) const

Initialize the Jet Candidate using a vector of Tracks, the primary vertex of the event (origin of the flight axis along which the tracks will be constrained) and the jet direction.

Definition at line 181 of file JetFitterInitializationHelper.cxx.

183  {
184 
185  //now create a new m_fittedPositions for the VxJetCandidate
186  //start from position...
187 
188  if (primaryVertex==nullptr) {
189  std::cout << "ERROR. No valid primary vertex pointer provided to the JetFitterInitializationHelper." << std::endl;
190  throw std::runtime_error ("No valid primary vertex pointer provided to the JetFitterInitializationHelper.");
191  }
192  AmgVector(5) startPosition;
193  startPosition[Trk::jet_xv]=primaryVertex->position().x();
194  startPosition[Trk::jet_yv]=primaryVertex->position().y();

◆ initializeJetCandidate() [3/3]

VxJetCandidate * Trk::JetFitterInitializationHelper::initializeJetCandidate ( const std::vector< const Trk::TrackParticleBase * > &  vectorOfTP,
const RecVertex primaryVertex,
const Amg::Vector3D jetdirection = 0,
const Amg::Vector3D linearizationjetdirection = 0 
) const

Initialize the Jet Candidate using a vector of TrackParticles, the primary vertex of the event (origin of the flight axis along which the tracks will be constrained) and the jet direction.

Definition at line 165 of file JetFitterInitializationHelper.cxx.

168  {
169 
170 
171  //creates VxJetCandidate. Constructor takes care of adding VxTrackAtVertex
172  //and creating one VxVertexOnJetAxis for each added track
173 
174  VxJetCandidate* myJetCandidate=new VxJetCandidate(vectorOfT);
175 
176  return initializeJetClusters(myJetCandidate,primaryVertex,jetdirection,linearizationjetdirection);
177 
178  }
179 

◆ initializeJetClusters()

VxJetCandidate * Trk::JetFitterInitializationHelper::initializeJetClusters ( VxJetCandidate myJetCandidate,
const RecVertex primaryVertex,
const Amg::Vector3D jetdirection = 0,
const Amg::Vector3D linearizationjetdirection = 0 
) const
private

Internal method to initialized a VxJetCandidate.

Definition at line 196 of file JetFitterInitializationHelper.cxx.

197  {
198  startPosition[Trk::jet_theta]=jetdirection->theta();
199  startPosition[Trk::jet_phi]=jetdirection->phi();
200  } else {
201  std::cout << "JetFitterInitializationHelper: Error! no starting jet direction provided. Using (0,0)" << std::endl;
202  startPosition[Trk::jet_theta]=0;
203  startPosition[Trk::jet_phi]=0;
204  }
205 
206  //override default setting...
207  std::pair<double,double> phiAndThetaError(m_errphiJetAxis,m_erretaJetAxis);
208 
209  /*
210  if (jetdirection!=0)
211  {
212 
213  //override default setting...
214  phiAndThetaError=getPhiAndThetaError(*jetdirection);
215 
216  std::cout << " Using phi error: " << phiAndThetaError.first << " and eta error: " << phiAndThetaError.second << " for pt: " << jetdirection->perp() <<
217  " and eta: " << jetdirection->pseudoRapidity() << std::endl;
218 
219  }
220  */
221 
222  AmgSymMatrix(3) primaryCovariance(primaryVertex->covariancePosition().block<3,3>(0,0));
223  AmgSymMatrix(5) startCovariance; startCovariance.setZero();
224  startCovariance.block<3,3>(0,0) = primaryCovariance;
225  startCovariance(Trk::jet_theta,Trk::jet_theta) =
226  std::pow(phiAndThetaError.second*sin(startPosition(Trk::jet_theta)),2);
227  startCovariance(Trk::jet_phi,Trk::jet_phi) = std::pow(phiAndThetaError.first,2);
228 
229  RecVertexPositions startRecVertexPositions(startPosition,
230  startCovariance,
231  0.,0.);
232 
233  //initialize the RecVertexPositions object of the VxJetCandidate
234  myJetCandidate->setRecVertexPositions(startRecVertexPositions);
235  myJetCandidate->setConstraintVertexPositions(startRecVertexPositions);
236 
237  VertexPositions linVertexPositions;
238  if (linearizationjetdirection!=nullptr) {
239  Amg::VectorX linPosition=startPosition;
240  linPosition[Trk::jet_theta]=linearizationjetdirection->theta();
241  linPosition[Trk::jet_phi]=linearizationjetdirection->phi();
242  linVertexPositions=VertexPositions(linPosition);
243  } else {
244  linVertexPositions=startRecVertexPositions;
245  }
246 
247  myJetCandidate->setLinearizationVertexPositions(linVertexPositions);
248  //initialize the linearizationPosition exactly to the same object or
249  //to something custom if requested by an additional argument
250 
251  updateTrackNumbering(myJetCandidate);
252 
253  const VxVertexOnJetAxis* primaryVertexJC(myJetCandidate->getPrimaryVertex());
254 
255  if (primaryVertexJC==nullptr) {
256 
257  // VxVertexOnJetAxis* newPrimaryVertex=new VxVertexOnJetAxis();
258  VxVertexOnJetAxis newPrimaryVertex;
259  //set numVertex of primaryVertex to -10
260  newPrimaryVertex.setNumVertex(-10);
261  // newPrimaryVertex->setLinearizationPosition(0.);//should be the same as default, but...
262  myJetCandidate->setPrimaryVertex(&newPrimaryVertex);
263 
264  } else {
265 
266  ATH_MSG_WARNING ("Primary Vertex was already initialized. Check...");
267 
268  }
269  return myJetCandidate;
270  }
271 
272 
273  void JetFitterInitializationHelper::updateTrackNumbering(VxJetCandidate* myJetCandidate) {
274 
275  const std::vector<VxVertexOnJetAxis*> & associatedVertices=myJetCandidate->getVerticesOnJetAxis();
276 
277  const std::vector<VxVertexOnJetAxis*>::const_iterator VtxBegin=associatedVertices.begin();
278  const std::vector<VxVertexOnJetAxis*>::const_iterator VtxEnd=associatedVertices.end();
279 
280  int numTrack(0);//start from 0 in counting the vertex "clusters"
281  //Horrible but a map is not suited here
282 
283  if (!associatedVertices.empty()) {//Was that your intention? to be checked... 15.03.2007
284  for (std::vector<VxVertexOnJetAxis*>::const_iterator VtxIter=VtxBegin;VtxIter!=VtxEnd;++VtxIter) {
285  VxVertexOnJetAxis* myVertex=(*VtxIter);
286  if (myVertex!=nullptr) {

◆ 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::JetFitterInitializationHelper::interfaceID ( )
inlinestatic

Definition at line 48 of file JetFitterInitializationHelper.h.

48  {
49  return IID_JetFitterInitializationHelper;
50  }

◆ linearizeAllTracks()

void Trk::JetFitterInitializationHelper::linearizeAllTracks ( VxJetCandidate myJetCandidate,
bool  signfliptreatment = false,
double  maxdistance = 1. 
) const

Calls the linearization of all the tracks (adds the Linearized Track data member to every VxTrackAtVertex (VxTrackOnJetAxis) involved in the fit).

If the track was already initialized previously, then linearization is done only if the distance to the previous linearization point is bigger than what specified in mm ( default is 1 mm ).

Definition at line 354 of file JetFitterInitializationHelper.cxx.

355  {
356 
357 // std::cout << " New track to linearize at PV" << primaryVertexPos << std::endl;
358 
359  const Trk::LinearizedTrack* linTrack=(*primaryVectorIter)->linState();
360 
361  if (linTrack!=nullptr) {
362  // std::cout << "distance is: " << (linTrack->linearizationPoint()-primary3Pos).mag() << std::endl;
363  if ((linTrack->linearizationPoint()-primary3Pos).mag()>maxdistance) {
364  // std::cout << " redoing linearization" << std::endl;
365  m_linearizedFactory->linearize(**primaryVectorIter,primaryVertexPos);
366  }
367  } else {
368  // std::cout << " linearizing for the first time " << std::endl;
369  m_linearizedFactory->linearize(**primaryVectorIter,primaryVertexPos);
370  }
371 
372 
373  }
374 
375  const std::vector<VxVertexOnJetAxis*> & associatedVertices=myJetCandidate->getVerticesOnJetAxis();
376 
377  const std::vector<VxVertexOnJetAxis*>::const_iterator VtxBegin=associatedVertices.begin();
378  const std::vector<VxVertexOnJetAxis*>::const_iterator VtxEnd=associatedVertices.end();
379 
380  for (std::vector<VxVertexOnJetAxis*>::const_iterator VtxIter=VtxBegin;VtxIter!=VtxEnd;++VtxIter) {
381 
382  int numVertex=(*VtxIter)->getNumVertex();
383  Amg::Vector3D secondaryVertexPos(getSingleVtxPositionWithSignFlip(myPosition,numVertex,signFlipTreatment));
384 
385 // std::cout << " Considering linearization at n. vertex " << numVertex << " pos " << secondaryVertexPos << std::endl;
386 
387  const std::vector<VxTrackAtVertex*> & tracksAtVertex=(*VtxIter)->getTracksAtVertex();
388 
389  const std::vector<VxTrackAtVertex*>::const_iterator TracksBegin=tracksAtVertex.begin();
390  const std::vector<VxTrackAtVertex*>::const_iterator TracksEnd=tracksAtVertex.end();
391 
392  for (std::vector<VxTrackAtVertex*>::const_iterator TrackVectorIter=TracksBegin;
393  TrackVectorIter!=TracksEnd;++TrackVectorIter) {
394 
395  const Trk::LinearizedTrack* linTrack=(*TrackVectorIter)->linState();
396 
397  if (linTrack!=nullptr) {
398  // std::cout << "distance not primary is: " << (linTrack->linearizationPoint()-secondaryVertexPos.position()).mag() << std::endl;
399  if ((linTrack->linearizationPoint()-secondaryVertexPos).mag()>maxdistance) {
400  // std::cout << " redoing linearization" << std::endl;
401  m_linearizedFactory->linearize(**TrackVectorIter,secondaryVertexPos);
402  }
403  } else {
404  // std::cout << " linearizing for the first time " << std::endl;
405  m_linearizedFactory->linearize(**TrackVectorIter,secondaryVertexPos);
406  }
407 
408 
409 
410  }
411 
412  }
413 
414  }//end linearizeAllTracks
415 
416 }//end namespace

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

◆ updateTrackNumbering()

void Trk::JetFitterInitializationHelper::updateTrackNumbering ( VxJetCandidate myJetCandidate)
static

Does the update of the ordering of the vertices along the jetaxis.

This is needed after you make a change to the number of clusters (initially single tracks) of the VxJetCandidate, because you need to have for each VxVertexOnJetAxis a number stored which tells you where the corresponding position along the jet axis is stored in the RecVertexPositions (position + covariance matrix), which is then used to read/store the fit result.

The method initializeJetClusters already calls this update during its initialization of the VxJetCandidate.

Definition at line 289 of file JetFitterInitializationHelper.cxx.

289  {
290  std::cout << "Warning in JetFitterInitializationHelper.Inconsistency found. Pointer to VxVertexOnJetAxis should be different from zero. Skipping track..." << std::endl;
291  throw std::runtime_error ("Warning in JetFitterInitializationHelper.Inconsistency found. Pointer to VxVertexOnJetAxis should be different from zero. Skipping track...");
292  }
293  }
294 
295  int sizeOfRecVertex=myJetCandidate->getRecVertexPositions().position().rows();
296 
297  //if the size of the RecVertexPositions is not big enough, enlarge it...
298  if (numRow(numTrack)>sizeOfRecVertex) {
299 
300  //Added 2. October 2014 !! (BUG...)
301  myJetCandidate->setRecVertexPositions(myJetCandidate->getConstraintVertexPositions());
302 
303  Amg::VectorX myPosition = myJetCandidate->getRecVertexPositions().position();
304  Amg::MatrixX myCovariance = myJetCandidate->getRecVertexPositions().covariancePosition();
305  Amg::VectorX newPosition(numRow(numTrack)); newPosition.setZero();
306  newPosition.segment(0,myPosition.rows()) = myPosition;
307  Amg::MatrixX newCovariance(numRow(numTrack),numRow(numTrack));
308  newCovariance.setZero();
309  newCovariance.block(0,0,myCovariance.rows(),myCovariance.cols()) = myCovariance;
310  for (int i=sizeOfRecVertex;i<numRow(numTrack);++i) {
311  newCovariance(i,i)=500.*500.;
312  }
313 
314  RecVertexPositions newRecVertexPositions(newPosition,
315  newCovariance,
316  myJetCandidate->getRecVertexPositions().fitQuality().chiSquared(),
317  myJetCandidate->getRecVertexPositions().fitQuality().numberDoF());
318 
319 
320  Amg::VectorX myPositionLinearization = myJetCandidate->getLinearizationVertexPositions().position();
321  Amg::VectorX newPositionLinearization(numRow(numTrack));
322  newPositionLinearization.setZero();
323  newPositionLinearization.segment(0,myPositionLinearization.rows()) = myPositionLinearization;
324 
325  myJetCandidate->setRecVertexPositions(newRecVertexPositions);//needed here?
326  myJetCandidate->setConstraintVertexPositions(newRecVertexPositions);
327  myJetCandidate->setLinearizationVertexPositions(newPositionLinearization);
328 
329  } else if (numRow(numTrack)<sizeOfRecVertex) {
330  std::cout << "Strange: size of RecVertexPosition's position in JetFitterInitializationHelper is bigger than actual numTracks plus 5. CHECK..." << std::endl;
331  throw std::runtime_error ("Strange: size of RecVertexPosition's position in JetFitterInitializationHelper is bigger than actual numTracks plus 5. CHECK...");
332  }
333 
334  }
335  //succesfully initialized ordering (+ enlarging of RecVertexPositions if needed)
336  }
337 
338  void JetFitterInitializationHelper::linearizeAllTracks(VxJetCandidate* myJetCandidate,
339  bool signFlipTreatment,
340  double maxdistance) const {
341 
342  const VertexPositions & myLinVertexPosition=myJetCandidate->getLinearizationVertexPositions();
343  const Amg::VectorX & myPosition=myLinVertexPosition.position();
344 
345  const VxVertexOnJetAxis* myPrimary=myJetCandidate->getPrimaryVertex();
346  const std::vector<VxTrackAtVertex*> & primaryVectorTracks=myPrimary->getTracksAtVertex();
347 
348  Amg::Vector3D primary3Pos = myPosition.segment(0,3);
349  const Amg::Vector3D& primaryVertexPos(primary3Pos);
350 
351  const std::vector<VxTrackAtVertex*>::const_iterator primaryVectorTracksBegin=primaryVectorTracks.begin();
352  const std::vector<VxTrackAtVertex*>::const_iterator primaryVectorTracksEnd=primaryVectorTracks.end();

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

float Trk::JetFitterInitializationHelper::m_erretaJetAxis
private

Error on eta on the flight direction you want to initialize the fit with (set erretaJetAxis by JobOptions, default is 0.065)

This should be substituted with a parameterization of the calorimeter resolution, which should depend on phi and eta.

Definition at line 158 of file JetFitterInitializationHelper.h.

◆ m_errphiJetAxis

float Trk::JetFitterInitializationHelper::m_errphiJetAxis
private

Error on phi on the flight direction you want to initialize the fit with (set errphiJetAxis by JobOptions, default is 0.07).

This should be substituted with a parameterization of the calorimeter resolution, which should depend on phi and eta.

Definition at line 148 of file JetFitterInitializationHelper.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_linearizedFactory

ToolHandle<IVertexLinearizedTrackFactory> Trk::JetFitterInitializationHelper::m_linearizedFactory
private

Definition at line 138 of file JetFitterInitializationHelper.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::y
@ y
Definition: ParamDefs.h:56
python.SystemOfUnits.second
int second
Definition: SystemOfUnits.py:120
Amg::VectorX
Eigen::Matrix< double, Eigen::Dynamic, 1 > VectorX
Dynamic Vector - dynamic allocation.
Definition: EventPrimitives.h:30
Amg::MatrixX
Eigen::Matrix< double, Eigen::Dynamic, Eigen::Dynamic > MatrixX
Dynamic Matrix - dynamic allocation.
Definition: EventPrimitives.h:27
Trk::VxTrackAtVertex
The VxTrackAtVertex is a common class for all present TrkVertexFitters The VxTrackAtVertex is designe...
Definition: VxTrackAtVertex.h:77
LArConditions2Ntuple.objects
objects
Definition: LArConditions2Ntuple.py:63
Trk::jet_theta
@ jet_theta
Definition: JetVtxParamDefs.h:28
AthCommonDataStore::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
Definition: AthCommonDataStore.h:145
AthCommonDataStore< AthCommonMsg< AlgTool > >::m_evtStore
StoreGateSvc_t m_evtStore
Pointer to StoreGate (event store by default)
Definition: AthCommonDataStore.h:390
Trk::JetFitterInitializationHelper::m_linearizedFactory
ToolHandle< IVertexLinearizedTrackFactory > m_linearizedFactory
Definition: JetFitterInitializationHelper.h:138
AthCommonDataStore< AthCommonMsg< AlgTool > >::m_vhka
std::vector< SG::VarHandleKeyArray * > m_vhka
Definition: AthCommonDataStore.h:398
Trk::VxVertexOnJetAxis
VxVertexOnJetAxis inherits from Vertex.
Definition: VxVertexOnJetAxis.h:79
Trk::jet_xv
@ jet_xv
Definition: JetVtxParamDefs.h:27
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
ATH_MSG_VERBOSE
#define ATH_MSG_VERBOSE(x)
Definition: AthMsgStreamMacros.h:28
Trk::JetFitterInitializationHelper::linearizeAllTracks
void linearizeAllTracks(VxJetCandidate *, bool signfliptreatment=false, double maxdistance=1.) const
Calls the linearization of all the tracks (adds the Linearized Track data member to every VxTrackAtVe...
Definition: JetFitterInitializationHelper.cxx:354
AthenaPoolTestRead.sc
sc
Definition: AthenaPoolTestRead.py:27
Trk::JetFitterInitializationHelper::initializeJetClusters
VxJetCandidate * initializeJetClusters(VxJetCandidate *myJetCandidate, const RecVertex *primaryVertex, const Amg::Vector3D *jetdirection=0, const Amg::Vector3D *linearizationjetdirection=0) const
Internal method to initialized a VxJetCandidate.
Definition: JetFitterInitializationHelper.cxx:196
SG::VarHandleKeyArray::setOwner
virtual void setOwner(IDataHandleHolder *o)=0
Trk::JetFitterInitializationHelper::updateTrackNumbering
static void updateTrackNumbering(VxJetCandidate *)
Does the update of the ordering of the vertices along the jetaxis.
Definition: JetFitterInitializationHelper.cxx:289
IDTPMcnv.htype
htype
Definition: IDTPMcnv.py:29
Trk::AmgSymMatrix
AmgSymMatrix(5) &GXFTrackState
Definition: GXFTrackState.h:156
python.utils.AtlRunQueryDQUtils.p
p
Definition: AtlRunQueryDQUtils.py:210
Trk::JetFitterInitializationHelper::m_errphiJetAxis
float m_errphiJetAxis
Error on phi on the flight direction you want to initialize the fit with (set errphiJetAxis by JobOpt...
Definition: JetFitterInitializationHelper.h:148
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
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
AmgVector
AmgVector(4) T2BSTrackFilterTool
Definition: T2BSTrackFilterTool.cxx:114
Trk::jet_yv
@ jet_yv
Definition: JetVtxParamDefs.h:27
Trk::JetFitterInitializationHelper::initializeJetCandidate
VxJetCandidate * initializeJetCandidate(const std::vector< const Trk::ITrackLink * > &vectorOfLink, const RecVertex *primaryVertex, const Amg::Vector3D *jetdirection=0, const Amg::Vector3D *linearizationjetdirection=0) const
Initialize the JetCandidate using a vector of Trk::ITrackLink* - needed for example if you run on ESD...
Definition: JetFitterInitializationHelper.cxx:132
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
merge_scale_histograms.doc
string doc
Definition: merge_scale_histograms.py:9
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:240
Amg::Vector3D
Eigen::Matrix< double, 3, 1 > Vector3D
Definition: GeoPrimitives.h:47
a
TList * a
Definition: liststreamerinfos.cxx:10
h
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
DeMoScan.first
bool first
Definition: DeMoScan.py:536
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:629
Trk::jet_phi
@ jet_phi
Definition: JetVtxParamDefs.h:28
python.Bindings.keys
keys
Definition: Control/AthenaPython/python/Bindings.py:798
drawFromPickle.sin
sin
Definition: drawFromPickle.py:36
Trk::x
@ x
Definition: ParamDefs.h:55
Trk::LinearizedTrack::linearizationPoint
const Amg::Vector3D & linearizationPoint() const
An access to an actual linearization point.
Definition: LinearizedTrack.h:154
pow
constexpr int pow(int base, int exp) noexcept
Definition: ap_fixedTest.cxx:15
Trk::JetFitterInitializationHelper::m_erretaJetAxis
float m_erretaJetAxis
Error on eta on the flight direction you want to initialize the fit with (set erretaJetAxis by JobOpt...
Definition: JetFitterInitializationHelper.h:158
AthCommonDataStore::declareGaudiProperty
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>
Definition: AthCommonDataStore.h:156
fitman.k
k
Definition: fitman.py:528
Trk::LinearizedTrack
Definition: LinearizedTrack.h:43