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::Trk2dDistanceSeeder Class Referencefinal

#include <Trk2dDistanceSeeder.h>

Inheritance diagram for Trk::Trk2dDistanceSeeder:
Collaboration diagram for Trk::Trk2dDistanceSeeder:

Public Member Functions

 Trk2dDistanceSeeder (const std::string &t, const std::string &n, const IInterface *p)
 
virtual ~Trk2dDistanceSeeder ()
 
virtual StatusCode initialize () override
 
virtual StatusCode finalize () override
 
TwoPointOnTrack GetSeed (const TwoTracks &mytracks, TwoPoints *twopoints=nullptr) const
 
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

double getBField (const Perigee &p, MagField::AtlasFieldCache &cache) 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...
 

Private Attributes

bool m_solveAmbiguityUsingZ
 
SG::ReadCondHandleKey< AtlasFieldCacheCondObjm_fieldCacheCondObjInputKey {this, "AtlasFieldCacheCondObj", "fieldCondObj", "Name of the Magnetic Field conditions object key"}
 
StoreGateSvc_t m_evtStore
 Pointer to StoreGate (event store by default) More...
 
StoreGateSvc_t m_detStore
 Pointer to StoreGate (detector store by default) More...
 
std::vector< SG::VarHandleKeyArray * > m_vhka
 
bool m_varHandleArraysDeclared
 

Detailed Description

AlgoTool calculates the points of minimum distance between two tracks on the transverse plane, which is analytically well defined (intersection of two circles). In case of double intersection different possibilities were considered; at the end I found reasonably good to choose the intersection point where the tracks are nearest in the z coordinate...

changes: 11-11-2007 Intersection case completely rewritten after having done analytical calculation (sign come out of calculation!)

Author
Giaci.nosp@m.nto..nosp@m.Piacq.nosp@m.uadi.nosp@m.o@phy.nosp@m.sik..nosp@m.uni-f.nosp@m.reib.nosp@m.urg.d.nosp@m.e

Definition at line 35 of file Trk2dDistanceSeeder.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

◆ Trk2dDistanceSeeder()

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

Definition at line 143 of file Trk2dDistanceSeeder.cxx.

143  :
144  AthAlgTool(t,n,p),
146  {
147  declareProperty("SolveAmbiguityUsingZ",m_solveAmbiguityUsingZ);
148  declareInterface<Trk2dDistanceSeeder>(this);
149  }

◆ ~Trk2dDistanceSeeder()

Trk::Trk2dDistanceSeeder::~Trk2dDistanceSeeder ( )
virtualdefault

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

◆ finalize()

StatusCode Trk::Trk2dDistanceSeeder::finalize ( )
overridevirtual

Definition at line 161 of file Trk2dDistanceSeeder.cxx.

162  {
163  ATH_MSG_DEBUG( "Finalize successful" );
164  return StatusCode::SUCCESS;
165  }

◆ getBField()

double Trk::Trk2dDistanceSeeder::getBField ( const Perigee p,
MagField::AtlasFieldCache cache 
) const
private

Definition at line 423 of file Trk2dDistanceSeeder.cxx.

424  {
425  double magnFieldVect[3];
426  double posXYZ[3];
427  posXYZ[0] = p.associatedSurface().center().x();
428  posXYZ[1] = p.associatedSurface().center().y();
429  posXYZ[2] = p.associatedSurface().center().z();
430 
431  cache.getField(posXYZ,magnFieldVect);
432  const double bfield = magnFieldVect[2]*299.792;//should be in GeV/mm
433  if (bfield==0. || std::isnan(bfield)) {
434  ATH_MSG_DEBUG( "Could not find a magnetic field different from zero: very very strange" );
435  return 0.60407; //Value in GeV/mm (ATLAS units)
436  }
437  ATH_MSG_DEBUG( "Magnetic field projection of z axis in the perigee position is: " << bfield << " GeV/mm " );
438 
439  return bfield;
440  }

◆ GetSeed()

TwoPointOnTrack Trk::Trk2dDistanceSeeder::GetSeed ( const TwoTracks mytracks,
TwoPoints twopoints = nullptr 
) const

Definition at line 169 of file Trk2dDistanceSeeder.cxx.

171  {
172  SG::ReadCondHandle<AtlasFieldCacheCondObj> readHandle{m_fieldCacheCondObjInputKey, Gaudi::Hive::currentContext()};
173  const AtlasFieldCacheCondObj* fieldCondObj{*readHandle};
174 
175  MagField::AtlasFieldCache fieldCache;
176  fieldCondObj->getInitializedCache (fieldCache);
177 
178  const double bfield1 = getBField (mytracks.getFirstPerigee(), fieldCache);
179  const double bfield2 = getBField (mytracks.getSecondPerigee(), fieldCache);
180 
181  //phitanpoca here means not the tan to poca (which is phi0) but the direction from perigee to the center of curvature (I don't know
182  //why I chose this strange name, sorry!)
183  const double phitanpoca1=getphipoca(mytracks.getFirstPerigee());
184  const double phitanpoca2=getphipoca(mytracks.getSecondPerigee());
185 
186  //Temporary abs1 and abs2 are the signed radius quantities (later we will reduce it to unsigned quantities)
187  double abs1 = getRadiusOfCurvature(mytracks.getFirstPerigee(), bfield1);
188  double abs2 = getRadiusOfCurvature(mytracks.getSecondPerigee(),bfield2);
189 
190  const double sgnr1 = abs1>0 ? 1. : -1.;
191  const double sgnr2 = abs2>0 ? 1. : -1.;
192 
193  //component x of center of curv of first particle
194  const std::pair<Amg::Vector3D,Amg::Vector3D> centersofcurv
195  (getCenterOfCurvature(mytracks.getFirstPerigee(),abs1,phitanpoca1),
196  getCenterOfCurvature(mytracks.getSecondPerigee(),abs2,phitanpoca2));
197 
198 #ifdef TRK2DDISTANCESEEDER_DEBUG
199  ATH_MSG_DEBUG( " Center of track number 1: " << centersofcurv.first << " center of track 2 " << centersofcurv.second );
200 #endif
201 
202  const double distance2d = dist2d(centersofcurv.first,centersofcurv.second);
203 
204  abs1 = std::abs(abs1);
205  abs2 = std::abs(abs2);
206 
207 
208 #ifdef TRK2DDISTANCESEEDER_DEBUG
209  ATH_MSG_DEBUG( "abs1: " << abs1 << " abs2: " << abs2 );
210  ATH_MSG_DEBUG( "phitanpoca1: " << phitanpoca1 << " phitanpoca2: " << phitanpoca2 );
211  ATH_MSG_DEBUG( "distance2d " << distance2d );
212 #endif
213 
214  double phi1 = 0;
215  double phi2 = 0;
216 
217  // Strictly redundant with phi1 and phi2 above, but needed to get results
218  // that are rounded identically with the pre-MT version.
219  double phi1poca = 0;
220  double phi2poca = 0;
221 
222  //first case (the two circles are the one distinct from the other)
223  if (distance2d > (abs1+abs2)) {
224 
225 #ifdef TRK2DDISTANCESEEDER_DEBUG
226  ATH_MSG_DEBUG ("Distinct circles " );
227 #endif
228 
229  phi1 = safeAtan2(centersofcurv.second.y()-centersofcurv.first.y(),
230  centersofcurv.second.x()-centersofcurv.first.x());
231 
232  if (sgnr2<0) {
233  phi2=phi1;
234  } else {
235  phi2=oppositeangle(phi1);
236  }
237 
238  if (sgnr1<0) {
239  phi1=oppositeangle(phi1);
240  }
241 
242  //Now you are worried that the solution has to be the one nearest to the original phi...
243  phi1=takenearest(phi1,phitanpoca1);
244  phi2=takenearest(phi2,phitanpoca2);
245  }
246  else {
247  //second case(if distance2d<abs1+abs2 we have still two cases
248  //1) one circle inside the other (nobody is touched) (if |abs2-abs1|>d)
249  //2) two intersections (if |abs2-abs1|<d)
250  // -->(case with one intersection seems me of no physical interest)
251  if (fabs(abs2-abs1)>=distance2d) {
252 
253 #ifdef TRK2DDISTANCESEEDER_DEBUG
254  ATH_MSG_DEBUG( " one circle inside the other " );
255 #endif
256 
257  //1)
258  if (abs2<abs1) {
259 
260 #ifdef TRK2DDISTANCESEEDER_DEBUG
261  ATH_MSG_DEBUG(" second radius smaller than first " );
262 #endif
263  phi1 = safeAtan2(centersofcurv.second.y()-centersofcurv.first.y(),
264  centersofcurv.second.x()-centersofcurv.first.x());
265  phi2=phi1;
266  }
267  else {
268 
269 #ifdef TRK2DDISTANCESEEDER_DEBUG
270  ATH_MSG_DEBUG( " first radius smaller than second " );
271 #endif
272 
273 
274  phi1 = safeAtan2(-(centersofcurv.second.y()-centersofcurv.first.y()),
275  -(centersofcurv.second.x()-centersofcurv.first.x()));
276  phi2=phi1;
277  }
278 
279  //adjust the sign, taking into account possible q(1,2)<0
280  if (sgnr2<0) {
281  phi2=oppositeangle(phi2);
282  }
283 
284  if (sgnr1<0) {
285  phi1=oppositeangle(phi1);
286  }
287 
288  phi1=takenearest(setphipoca(phi1),setphipoca(phitanpoca1));
289  phi2=takenearest(setphipoca(phi2),setphipoca(phitanpoca2));
290  phi1poca = setphipoca(phi1);
291  phi2poca = setphipoca(phi2);
292  }
293  else {
294 
295  //Do it easier...
296  const double projection2=(square(abs1)-square(abs2)-square(distance2d))/2./distance2d;
297  const double cosinus2=projection2/sgnr2/abs2;
298 
299 
300 #ifdef TRK2DDISTANCESEEDER_DEBUG
301  const double projection1=(square(abs2)-square(abs1)-square(distance2d))/2./distance2d;
302  const double cosinus1=projection1/sgnr1/abs1;
303  ATH_MSG_DEBUG( "projection1: " << projection1 << " cosinus1 " << cosinus1
304  << "projection2: " << projection2 << " cosinus2 " << cosinus2 );
305 #endif
306 
307  const double phibase2 =
308  safeAtan2(centersofcurv.second.y() - centersofcurv.first.y(),
309  centersofcurv.second.x() - centersofcurv.first.x());
310 
311  const double addtophi2=
312  safeAcos(cosinus2);
313 
314 #ifdef TRK2DDISTANCESEEDER_DEBUG
315  ATH_MSG_DEBUG( " phibase2 is : " << phibase2 << " add to phi " << addtophi2 );
316 #endif
317 
318  const std::pair<double,double> possiblephiontrack2(phibase2+addtophi2,phibase2-addtophi2);
319 
320 #ifdef TRK2DDISTANCESEEDER_DEBUG
321  ATH_MSG_DEBUG( "the two phis are: " << possiblephiontrack2.first << " and " << possiblephiontrack2.second );
322 #endif
323 
324  const std::pair<double,double>
325  possiblecosphitrack1((centersofcurv.second.x()-centersofcurv.first.x()
326  +sgnr2*abs2*std::cos(possiblephiontrack2.first))/sgnr1/abs1,
327  (centersofcurv.second.x()-centersofcurv.first.x()
328  +sgnr2*abs2*std::cos(possiblephiontrack2.second))/sgnr1/abs1);
329 
330  const std::pair<double,double>
331  possiblesigntrack1(sgnr1*(centersofcurv.second.y()-centersofcurv.first.y()
332  +sgnr2*abs2*std::sin(possiblephiontrack2.first))>0?1.:-1.,
333  sgnr1*(centersofcurv.second.y()-centersofcurv.first.y()
334  +sgnr2*abs2*std::sin(possiblephiontrack2.second))>0?1.:-1.);
335 
336  const std::pair<double,double>
337  possiblephiontrack1(possiblesigntrack1.first*safeAcos(possiblecosphitrack1.first),
338  possiblesigntrack1.second*safeAcos(possiblecosphitrack1.second));
339 
340 
341  const std::pair<PointOnTrack,PointOnTrack>
342  possiblepointsontrack1(PointOnTrack(mytracks.getFirstPerigee(),
343  takenearest(setphipoca(possiblephiontrack1.first),
344  setphipoca(phitanpoca1))),
345  PointOnTrack(mytracks.getFirstPerigee(),
346  takenearest(setphipoca(possiblephiontrack1.second),
347  setphipoca(phitanpoca1))));
348 
349  const std::pair<PointOnTrack,PointOnTrack>
350  possiblepointsontrack2(PointOnTrack(mytracks.getSecondPerigee(),
351  takenearest(setphipoca(possiblephiontrack2.first),
352  setphipoca(phitanpoca2))),
353  PointOnTrack(mytracks.getSecondPerigee(),
354  takenearest(setphipoca(possiblephiontrack2.second),
355  setphipoca(phitanpoca2))));
356 
357 
358  const std::pair<Amg::Vector3D,Amg::Vector3D>
359  possiblepoints1(getSeedPoint(possiblepointsontrack1.first.getPerigee(),centersofcurv.first,
360  abs1*sgnr1,possiblepointsontrack1.first.getPhiPoint()),
361  getSeedPoint(possiblepointsontrack1.second.getPerigee(),centersofcurv.first,
362  abs1*sgnr1,possiblepointsontrack1.second.getPhiPoint()));
363 
364  const std::pair<Amg::Vector3D,Amg::Vector3D>
365  possiblepoints2(getSeedPoint(possiblepointsontrack2.first.getPerigee(),centersofcurv.second,
366  abs2*sgnr2,possiblepointsontrack2.first.getPhiPoint()),
367  getSeedPoint(possiblepointsontrack2.second.getPerigee(),centersofcurv.second,
368  abs2*sgnr2,possiblepointsontrack2.second.getPhiPoint()));
369 
370 
371 #ifdef TRK2DDISTANCESEEDER_DEBUG
372  ATH_MSG_DEBUG( "Point 1a: x " << possiblepoints1.first.x() << " y " << possiblepoints1.first.y() );
373  ATH_MSG_DEBUG( "Point 2a: x " << possiblepoints2.first.x() << " y " << possiblepoints2.first.y() );
374  ATH_MSG_DEBUG( "Point 1b: x " << possiblepoints1.second.x() << " y " << possiblepoints1.second.y() );
375  ATH_MSG_DEBUG( "Point 2b: x " << possiblepoints2.second.x() << " y " << possiblepoints2.second.y() );
376  ATH_MSG_DEBUG( "Distance between 1a and 2a:" << fabs(possiblepoints1.first.z()-possiblepoints2.first.z()) <<
377  "Distance between 1a and 2a:" << fabs(possiblepoints1.second.z()-possiblepoints2.second.z()) );
378 #endif
379 
380 
381  //now discover what couple of points are the nearest ones
383  {
384  if (fabs(possiblepoints1.first.z()-possiblepoints2.first.z())<
385  fabs(possiblepoints1.second.z()-possiblepoints2.second.z()))
386  {
387  phi1poca = possiblepointsontrack1.first.getPhiPoint();
388  phi2poca = possiblepointsontrack2.first.getPhiPoint();
389  } else {
390  phi1poca = possiblepointsontrack1.second.getPhiPoint();
391  phi2poca = possiblepointsontrack2.second.getPhiPoint();
392  }
393  }
394  else
395  {
396  if (sqrt(possiblepoints1.first.x()*possiblepoints1.first.x()+possiblepoints1.first.y()*possiblepoints1.first.y())<
397  sqrt(possiblepoints2.first.x()*possiblepoints2.first.x()+possiblepoints2.first.y()*possiblepoints2.first.y()))
398  {
399  phi1poca = possiblepointsontrack1.first.getPhiPoint();
400  phi2poca = possiblepointsontrack2.first.getPhiPoint();
401  } else {
402  phi1poca = possiblepointsontrack1.second.getPhiPoint();
403  phi2poca = possiblepointsontrack2.second.getPhiPoint();
404  }
405  }
406  phi1=goFromPhipocaToPhi(phi1poca);
407  phi2=goFromPhipocaToPhi(phi2poca);
408  }
409  }
410 
411  if (twopoints) {
412  *twopoints = TwoPoints (getSeedPoint(centersofcurv.first,
413  abs1*sgnr1,setphipoca(phi1)),
414  getSeedPoint(centersofcurv.second,
415  abs2*sgnr2,setphipoca(phi2)));
416  }
417 
418  return std::make_pair (PointOnTrack (mytracks.getFirstPerigee(), phi1poca),
419  PointOnTrack (mytracks.getSecondPerigee(),phi2poca));
420  }

◆ initialize()

StatusCode Trk::Trk2dDistanceSeeder::initialize ( )
overridevirtual

Definition at line 153 of file Trk2dDistanceSeeder.cxx.

154  {
157  ATH_MSG_DEBUG( "Initialize successful" );
158  return StatusCode::SUCCESS;
159  }

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

Definition at line 39 of file Trk2dDistanceSeeder.h.

40  {
41  return IID_Trk2dDistanceSeeder;
42  };

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

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

Definition at line 65 of file Trk2dDistanceSeeder.h.

◆ m_solveAmbiguityUsingZ

bool Trk::Trk2dDistanceSeeder::m_solveAmbiguityUsingZ
private

Definition at line 63 of file Trk2dDistanceSeeder.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:
SG::ReadCondHandle
Definition: ReadCondHandle.h:44
AtlasFieldCacheCondObj
Definition: AtlasFieldCacheCondObj.h:19
AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
Definition: AthCommonDataStore.h:145
initialize
void initialize()
Definition: run_EoverP.cxx:894
AthCommonDataStore< AthCommonMsg< AlgTool > >::m_evtStore
StoreGateSvc_t m_evtStore
Pointer to StoreGate (event store by default)
Definition: AthCommonDataStore.h:390
AthCommonDataStore< AthCommonMsg< AlgTool > >::m_vhka
std::vector< SG::VarHandleKeyArray * > m_vhka
Definition: AthCommonDataStore.h:398
Trk::TwoPoints
std::pair< Amg::Vector3D, Amg::Vector3D > TwoPoints
Definition: SeedFinderParamDefs.h:20
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
drawFromPickle.cos
cos
Definition: drawFromPickle.py:36
Trk::Trk2dDistanceSeeder::getBField
double getBField(const Perigee &p, MagField::AtlasFieldCache &cache) const
Definition: Trk2dDistanceSeeder.cxx:423
SG::VarHandleKeyArray::setOwner
virtual void setOwner(IDataHandleHolder *o)=0
IDTPMcnv.htype
htype
Definition: IDTPMcnv.py:29
python.utils.AtlRunQueryDQUtils.p
p
Definition: AtlRunQueryDQUtils.py:210
AthCommonDataStore
Definition: AthCommonDataStore.h:52
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
beamspotman.n
n
Definition: beamspotman.py:731
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
AthCommonDataStore< AthCommonMsg< AlgTool > >::m_detStore
StoreGateSvc_t m_detStore
Pointer to StoreGate (detector store by default)
Definition: AthCommonDataStore.h:393
Trk::Trk2dDistanceSeeder::m_solveAmbiguityUsingZ
bool m_solveAmbiguityUsingZ
Definition: Trk2dDistanceSeeder.h:63
AthAlgTool::AthAlgTool
AthAlgTool()
Default constructor:
SG::VarHandleKeyArray::renounce
virtual void renounce()=0
SG::HandleClassifier::type
std::conditional< std::is_base_of< SG::VarHandleKeyArray, T >::value, VarHandleKeyArrayType, type2 >::type type
Definition: HandleClassifier.h:54
Trk::Trk2dDistanceSeeder::m_fieldCacheCondObjInputKey
SG::ReadCondHandleKey< AtlasFieldCacheCondObj > m_fieldCacheCondObjInputKey
Definition: Trk2dDistanceSeeder.h:66
merge_scale_histograms.doc
string doc
Definition: merge_scale_histograms.py:9
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:228
SG::CondHandleKey::initialize
StatusCode initialize(bool used=true)
a
TList * a
Definition: liststreamerinfos.cxx:10
h
MagField::AtlasFieldCache
Local cache for magnetic field (based on MagFieldServices/AtlasFieldSvcTLS.h)
Definition: AtlasFieldCache.h:43
SG::VarHandleBase::vhKey
SG::VarHandleKey & vhKey()
Return a non-const reference to the HandleKey.
Definition: StoreGate/src/VarHandleBase.cxx:623
MagField::AtlasFieldCache::getField
void getField(const double *ATH_RESTRICT xyz, double *ATH_RESTRICT bxyz, double *ATH_RESTRICT deriv=nullptr)
get B field value at given position xyz[3] is in mm, bxyz[3] is in kT if deriv[9] is given,...
Definition: AtlasFieldCache.cxx:42
python.Bindings.keys
keys
Definition: Control/AthenaPython/python/Bindings.py:798
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
fitman.k
k
Definition: fitman.py:528