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::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 89 of file JetFitterInitializationHelper.cxx.

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

◆ ~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 109 of file JetFitterInitializationHelper.cxx.

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

◆ 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 129 of file JetFitterInitializationHelper.cxx.

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

◆ 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 178 of file JetFitterInitializationHelper.cxx.

180  {
181 
182  //now create a new m_fittedPositions for the VxJetCandidate
183  //start from position...
184 
185  if (primaryVertex==nullptr) {
186  std::cout << "ERROR. No valid primary vertex pointer provided to the JetFitterInitializationHelper." << std::endl;
187  throw std::runtime_error ("No valid primary vertex pointer provided to the JetFitterInitializationHelper.");
188  }
189  AmgVector(5) startPosition;
190  startPosition[Trk::jet_xv]=primaryVertex->position().x();
191  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 162 of file JetFitterInitializationHelper.cxx.

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

◆ 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 193 of file JetFitterInitializationHelper.cxx.

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

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

286  {
287  std::cout << "Warning in JetFitterInitializationHelper.Inconsistency found. Pointer to VxVertexOnJetAxis should be different from zero. Skipping track..." << std::endl;
288  throw std::runtime_error ("Warning in JetFitterInitializationHelper.Inconsistency found. Pointer to VxVertexOnJetAxis should be different from zero. Skipping track...");
289  }
290  }
291 
292  int sizeOfRecVertex=myJetCandidate->getRecVertexPositions().position().rows();
293 
294  //if the size of the RecVertexPositions is not big enough, enlarge it...
295  if (numRow(numTrack)>sizeOfRecVertex) {
296 
297  //Added 2. October 2014 !! (BUG...)
298  myJetCandidate->setRecVertexPositions(myJetCandidate->getConstraintVertexPositions());
299 
300  Amg::VectorX myPosition = myJetCandidate->getRecVertexPositions().position();
301  Amg::MatrixX myCovariance = myJetCandidate->getRecVertexPositions().covariancePosition();
302  Amg::VectorX newPosition(numRow(numTrack)); newPosition.setZero();
303  newPosition.segment(0,myPosition.rows()) = myPosition;
304  Amg::MatrixX newCovariance(numRow(numTrack),numRow(numTrack));
305  newCovariance.setZero();
306  newCovariance.block(0,0,myCovariance.rows(),myCovariance.cols()) = myCovariance;
307  for (int i=sizeOfRecVertex;i<numRow(numTrack);++i) {
308  newCovariance(i,i)=500.*500.;
309  }
310 
311  RecVertexPositions newRecVertexPositions(newPosition,
312  newCovariance,
313  myJetCandidate->getRecVertexPositions().fitQuality().chiSquared(),
314  myJetCandidate->getRecVertexPositions().fitQuality().numberDoF());
315 
316 
317  Amg::VectorX myPositionLinearization = myJetCandidate->getLinearizationVertexPositions().position();
318  Amg::VectorX newPositionLinearization(numRow(numTrack));
319  newPositionLinearization.setZero();
320  newPositionLinearization.segment(0,myPositionLinearization.rows()) = myPositionLinearization;
321 
322  myJetCandidate->setRecVertexPositions(newRecVertexPositions);//needed here?
323  myJetCandidate->setConstraintVertexPositions(newRecVertexPositions);
324  myJetCandidate->setLinearizationVertexPositions(newPositionLinearization);
325 
326  } else if (numRow(numTrack)<sizeOfRecVertex) {
327  std::cout << "Strange: size of RecVertexPosition's position in JetFitterInitializationHelper is bigger than actual numTracks plus 5. CHECK..." << std::endl;
328  throw std::runtime_error ("Strange: size of RecVertexPosition's position in JetFitterInitializationHelper is bigger than actual numTracks plus 5. CHECK...");
329  }
330 
331  }
332  //succesfully initialized ordering (+ enlarging of RecVertexPositions if needed)
333  }
334 
335  void JetFitterInitializationHelper::linearizeAllTracks(VxJetCandidate* myJetCandidate,
336  bool signFlipTreatment,
337  double maxdistance) const {
338 
339  const VertexPositions & myLinVertexPosition=myJetCandidate->getLinearizationVertexPositions();
340  const Amg::VectorX & myPosition=myLinVertexPosition.position();
341 
342  const VxVertexOnJetAxis* myPrimary=myJetCandidate->getPrimaryVertex();
343  const std::vector<VxTrackAtVertex*> & primaryVectorTracks=myPrimary->getTracksAtVertex();
344 
345  Amg::Vector3D primary3Pos = myPosition.segment(0,3);
346  const Amg::Vector3D& primaryVertexPos(primary3Pos);
347 
348  const std::vector<VxTrackAtVertex*>::const_iterator primaryVectorTracksBegin=primaryVectorTracks.begin();
349  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:62
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:32
Amg::MatrixX
Eigen::Matrix< double, Eigen::Dynamic, Eigen::Dynamic > MatrixX
Dynamic Matrix - dynamic allocation.
Definition: EventPrimitives.h:29
python.PerfMonSerializer.p
def p
Definition: PerfMonSerializer.py:743
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:56
Trk::jet_theta
@ jet_theta
Definition: JetVtxParamDefs.h:28
AthCommonDataStore::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
Definition: AthCommonDataStore.h:145
LB_AnalMapSplitter.of
of
Definition: LB_AnalMapSplitter.py:48
conifer::pow
constexpr int pow(int x)
Definition: conifer.h:20
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:351
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:193
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:286
Trk::AmgSymMatrix
AmgSymMatrix(5) &GXFTrackState
Definition: GXFTrackState.h:156
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:92
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:129
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:192
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:534
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
Trk::jet_phi
@ jet_phi
Definition: JetVtxParamDefs.h:28
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::LinearizedTrack::linearizationPoint
const Amg::Vector3D & linearizationPoint() const
An access to an actual linearization point.
Definition: LinearizedTrack.h:154
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