ATLAS Offline Software
Public Types | Public Member Functions | Static Public Attributes | Protected Attributes | Private Attributes | Friends | List of all members
Analysis::ParticleShallowClone Class Reference

#include <ParticleShallowClone.h>

Inheritance diagram for Analysis::ParticleShallowClone:
Collaboration diagram for Analysis::ParticleShallowClone:

Public Types

typedef P4PxPyPzE momentum_type
 publish the type of the base class (ie: 'traits-itize' it) More...
 
enum  Kind {
  P4EETAPHIM, P4IPTCOTTHPHIM, P4PTETAPHIM, P4PXPYPZE,
  UNKNOWN
}
 

Public Member Functions

 ParticleShallowClone ()
 The default constructor. More...
 
 ParticleShallowClone (const MasterLink_t &theMasterLink)
 Standard constructor with an ElementLink to the original particle. More...
 
 ParticleShallowClone (const MasterLink_t &theMasterLink, const I4Momentum *the4Mom, const ChargeType theCharge=std::numeric_limits< ChargeType >::quiet_NaN(), const ElementLink< VxContainer > *theOriginLink=0)
 Standard constructor with an ElementLink to the original particle and all other parameters explicitly given. More...
 
const MasterLink_tgetMasterLink () const
 Copy constructor. More...
 
const Master_tgetMasterPtr () const
 Get a const pointer to the original "master" particle. More...
 
virtual AthenaBarCode_t getAthenaBarCode () const
 Public getter. More...
 
virtual bool hasSameAthenaBarCode (const IAthenaBarCode &) const
 Comparing & Versioning Control. More...
 
virtual bool hasSameAthenaBarCodeExceptVersion (const IAthenaBarCode &) const
 Comparing & Versioning Control. More...
 
virtual AthenaBarCodeVersion_t getVersion () const
 Comparing & Versioning Control. More...
 
virtual void fillToken (INavigationToken &) const
 Implement method from INavigable (forwareded to the orignal "master" particle) More...
 
virtual void fillToken (INavigationToken &, const std::any &) const
 Implement method from INavigable (forwareded to the orignal "master" particle) More...
 
virtual ParticleDataType::DataType dataType () const
 Return enum indicating real data, fast, or full simulation Return Type has a DataType enum with the following values: {Data = 0, Full = 1, FastShower = 2, Fast = 3, True = 4} (forwareded to the orignal "master" particle) More...
 
virtual const Trk::RecVertexorigin () const
 Return a RecVertex corresponding to particle's Origin (used directly from this shallow clone particle) More...
 
virtual const ElementLink< VxContainer > & originLink () const
 Return an ElementLink corresponding to particle's Origin (used directly from this shallow clone particle) More...
 
virtual bool hasCharge () const
 method to check if charge information is available (used directly from this shallow clone particle) More...
 
virtual ChargeType charge () const
 returns charge as a typedef ChargeType currently Charge Type is a double for jets this may be changed to an int and ask jets to extend this interface (used directly from this shallow clone particle) More...
 
virtual bool hasPdgId () const
 method to check if particle id information is available (forwareded to the orignal "master" particle) More...
 
virtual int pdgId () const
 Return particle id (forwareded to the orignal "master" particle)
More...
 
virtual void set_charge (ChargeType theCharge)
 Set method to set the charge of this shallow clone particle (the original "master" particle remains unaffected) More...
 
virtual void set_origin (const VxContainer *theContainer, int index)
 Set method to set the charge of this shallow clone particle (the original "master" particle remains unaffected) More...
 
virtual void set_origin (const VxContainer *theContainer, const Trk::VxCandidate *vertex)
 Set method to set the charge of this shallow clone particle (the original "master" particle remains unaffected) More...
 
const momentum_typemomentumBase () const
 access to underlying base type (I4Momentum-like) More...
 
momentum_typemomentumBase ()
 
virtual double px () const
 get px data member More...
 
virtual double py () const
 get py data member More...
 
virtual double pz () const
 get pz data member More...
 
virtual double e () const
 get energy data member More...
 
virtual void setPx (double thePx)
 set Px data member More...
 
virtual void setPy (double thePy)
 set Py data member More...
 
virtual void setPz (double thePz)
 set Pz data member More...
 
virtual void setE (double theE)
 set energy data member More...
 
virtual void set4Mom (const I4Momentum &theI4Mom)
 set all 4-mom from another I4Momentum reference
More...
 
virtual void set4Mom (const I4Momentum *const theI4Mom)
 set all 4-mom from another I4Momentum pointer
More...
 
virtual void set4Mom (const CLHEP::HepLorentzVector &theHlv)
 set all 4-mom from CLHEP HepLorentzVector
More...
 
virtual const I4MomentumErrorerrors () const
 Access to errors, if available; returns 0 if no errors. More...
 
double pxi () const
 Experimental : inlined function to get px without going through virtual inheritance. More...
 
double pyi () const
 Experimental : inlined function to get py without going through virtual inheritance. More...
 
double pzi () const
 Experimental : inlined function to get pz without going through virtual inheritance. More...
 
double ei () const
 Experimental : inlined function to get e without going through virtual inheritance. More...
 
double pti () const
 Experimental : inlined function to get pt without going through virtual inheritance. More...
 
virtual double m () const
 mass More...
 
virtual double m2 () const
 mass squared More...
 
virtual double eta () const
 pseudo rapidity More...
 
virtual double phi () const
 phi in [-pi,pi[ More...
 
virtual double p () const
 momentum magnitude More...
 
virtual double p2 () const
 square of momentum magnitude More...
 
virtual double pt () const
 transverse momentum More...
 
virtual double et () const
 transverse energy defined to be e*sin(theta) More...
 
virtual double iPt () const
 inverse of transverse momentum More...
 
virtual double rapidity () const
 rapidity More...
 
virtual double cosPhi () const
 cosinus phi More...
 
virtual double sinPhi () const
 sinus phi More...
 
virtual double tanTh () const
 tan theta More...
 
virtual double cotTh () const
 cottan theta More...
 
virtual double cosTh () const
 cosinus theta More...
 
virtual double sinTh () const
 sinus theta More...
 
virtual CLHEP::HepLorentzVector hlv () const
 CLHEP HepLorentzVector. More...
 
virtual I4Momentum::Kind kind () const
 tells what kind of P4XYZT this is More...
 
virtual std::ostream & dump (std::ostream &out) const
 Print I4Momentum content. More...
 
virtual void setAthenaBarCode (AthenaBarCode_t)
 
virtual void newVersion ()
 
virtual void setVersion (AthenaBarCodeVersion_t)
 

Static Public Attributes

static const AthenaBarCode_t UNDEFINEDBARCODE = (AthenaBarCode_t)(-1)
 
static const AthenaBarCode_t UNDEFINEDVERSION = UNDEFINEDBARCODE
 

Protected Attributes

double m_px
 
double m_py
 
double m_pz
 
double m_e
 

Private Attributes

MasterLink_t m_masterLink
 The persistent pointer (ElementLink) to the original "master" particle. More...
 
ElementLink< VxContainerm_originLink
 Persistent pointer (ElementLink) to the origin of this particle. More...
 
bool m_hasCharge
 Switch to tell if this particle has a charge. More...
 
ChargeType m_charge
 Value of the charge of the particle (this has real meaning, only if hasCharge() returns true) More...
 

Friends

class ::ParticleShallowCloneCnv_p1
 

Detailed Description

Definition at line 49 of file ParticleShallowClone.h.

Member Typedef Documentation

◆ momentum_type

publish the type of the base class (ie: 'traits-itize' it)

Definition at line 56 of file ParticleShallowClone.h.

Member Enumeration Documentation

◆ Kind

enum I4Momentum::Kind
inherited
Enumerator
P4EETAPHIM 
P4IPTCOTTHPHIM 
P4PTETAPHIM 
P4PXPYPZE 
UNKNOWN 

Definition at line 33 of file I4Momentum.h.

Constructor & Destructor Documentation

◆ ParticleShallowClone() [1/3]

Analysis::ParticleShallowClone::ParticleShallowClone ( )
inline

The default constructor.

Definition at line 62 of file ParticleShallowClone.h.

62  :
63  P4Momentum_t ( ),
64  m_masterLink ( ),
65  m_originLink ( ),
66  m_hasCharge ( false ),
67  m_charge ( 0.0 )
68  {
69  }

◆ ParticleShallowClone() [2/3]

Analysis::ParticleShallowClone::ParticleShallowClone ( const MasterLink_t theMasterLink)
inlineexplicit

Standard constructor with an ElementLink to the original particle.

The user must ensure that the ElementLink is vaild, i.e., that the particle it is pointing to still exists, before calling the constructor!

Definition at line 75 of file ParticleShallowClone.h.

75  :
76  P4Momentum_t ( *theMasterLink ),
77  m_originLink ( (*theMasterLink)->originLink() ),
78  m_hasCharge ( (*theMasterLink)->hasCharge() ),
79  m_charge ( (*theMasterLink)->charge() )
80  {
81  // Assign the ElementLink to the original master particle,
82  // including searching until we don't have a ParticleShallowClone any more
83  const ParticleShallowClone* pscPtr = dynamic_cast<const ParticleShallowClone*>(*theMasterLink);
84  m_masterLink = pscPtr ? pscPtr->getMasterLink() : theMasterLink;
85  }

◆ ParticleShallowClone() [3/3]

Analysis::ParticleShallowClone::ParticleShallowClone ( const MasterLink_t theMasterLink,
const I4Momentum the4Mom,
const ChargeType  theCharge = std::numeric_limits<ChargeType>::quiet_NaN(),
const ElementLink< VxContainer > *  theOriginLink = 0 
)
inline

Standard constructor with an ElementLink to the original particle and all other parameters explicitly given.

The user must ensure that the ElementLink is vaild, i.e., that the particle it is pointing to still exists, before calling the constructor!

Definition at line 92 of file ParticleShallowClone.h.

95  :
96  P4Momentum_t ( the4Mom )
97  {
98  // Assign the ElementLink to the original master particle,
99  // including searching until we don't have a ParticleShallowClone any more
100  const ParticleShallowClone* pscPtr = dynamic_cast<const ParticleShallowClone*>(*theMasterLink);
101  m_masterLink = pscPtr ? pscPtr->getMasterLink() : theMasterLink;
102 
103  // Check if a charge was given. Is so, use it. If not, get the one from the orignal master particle
104  if ( std::isnan(theCharge) )
105  {
106  m_hasCharge = (*theMasterLink)->hasCharge();
107  m_charge = (*theMasterLink)->charge();
108  }
109  else
110  {
111  m_hasCharge = true;
112  m_charge = theCharge;
113  }
114 
115  // Check if an origin was given. Is so, use it. If not, get the one from the orignal master particle
116  if ( theOriginLink )
117  {
118  m_originLink = *theOriginLink;
119  }
120  else
121  {
122  m_originLink = (*theMasterLink)->originLink();
123  }
124  }

Member Function Documentation

◆ charge()

ChargeType Analysis::ParticleShallowClone::charge ( ) const
inlinevirtual

returns charge as a typedef ChargeType currently Charge Type is a double for jets this may be changed to an int and ask jets to extend this interface (used directly from this shallow clone particle)

Implements IParticle.

Definition at line 377 of file ParticleShallowClone.h.

378 {
379  return m_charge;
380 }

◆ cosPhi()

double P4PxPyPzEBase::cosPhi ( ) const
virtualinherited

cosinus phi

Implements I4Momentum.

Reimplemented in Nav4MomWrapper< Navigable_t, P4Momentum_t >.

Definition at line 77 of file P4PxPyPzEBase.cxx.

78 {
79  return this->px()/this->pt();
80 }

◆ cosTh()

double P4PxPyPzEBase::cosTh ( ) const
virtualinherited

cosinus theta

Implements I4Momentum.

Reimplemented in Nav4MomWrapper< Navigable_t, P4Momentum_t >.

Definition at line 98 of file P4PxPyPzEBase.cxx.

99 {
100 
101  return this->pz()/this->p();
102 
103 }

◆ cotTh()

double P4PxPyPzEBase::cotTh ( ) const
virtualinherited

cottan theta

Implements I4Momentum.

Reimplemented in Nav4MomWrapper< Navigable_t, P4Momentum_t >.

Definition at line 92 of file P4PxPyPzEBase.cxx.

93 {
94  return this->pz()/this->pt();
95 }

◆ dataType()

ParticleDataType::DataType Analysis::ParticleShallowClone::dataType ( ) const
inlinevirtual

Return enum indicating real data, fast, or full simulation Return Type has a DataType enum with the following values: {Data = 0, Full = 1, FastShower = 2, Fast = 3, True = 4} (forwareded to the orignal "master" particle)

Implements IParticle.

Definition at line 351 of file ParticleShallowClone.h.

352 {
353  return (*m_masterLink)->dataType();
354 }

◆ dump()

std::ostream & P4PxPyPzEBase::dump ( std::ostream &  out) const
virtualinherited

Print I4Momentum content.

Implements I4Momentum.

Reimplemented in Nav4MomWrapper< Navigable_t, P4Momentum_t >, and Rec::TrackParticle.

Definition at line 152 of file P4PxPyPzEBase.cxx.

153 {
154 
155  std::stringstream outx;
156  outx << "[px,py,pz,e] ="
157  << std::right << std::scientific << std::setprecision(8)
158  << std::setw(16) << this->px()
159  << std::setw(16) << this->py()
160  << std::setw(16) << this->pz()
161  << std::setw(16) << this->e();
162 
163  out<<outx.str();
164 
165  return out;
166 
167 }

◆ e()

double P4PxPyPzE::e ( ) const
inlinevirtualinherited

get energy data member

Implements I4Momentum.

Reimplemented in Nav4MomWrapper< Navigable_t, P4Momentum_t >.

Definition at line 132 of file P4PxPyPzE.h.

133 { return m_e;}

◆ ei()

double P4PxPyPzE::ei ( ) const
inlineinherited

Experimental : inlined function to get e without going through virtual inheritance.

Definition at line 179 of file P4PxPyPzE.h.

180 { return m_e;}

◆ errors()

const I4MomentumError * P4PxPyPzE::errors ( ) const
virtualinherited

Access to errors, if available; returns 0 if no errors.

Reimplemented from P4PxPyPzEBase.

Reimplemented in Nav4MomWrapper< Navigable_t, P4Momentum_t >.

Definition at line 7 of file P4PxPyPzE.cxx.

8 {
9  return 0;
10 }

◆ et()

double P4PxPyPzEBase::et ( ) const
virtualinherited

transverse energy defined to be e*sin(theta)

Implements I4Momentum.

Reimplemented in Nav4MomWrapper< Navigable_t, P4Momentum_t >.

Definition at line 125 of file P4PxPyPzEBase.cxx.

126  {
127  //to be improved
128  return this->e()*this->sinTh();
129  }

◆ eta()

double P4PxPyPzEBase::eta ( ) const
virtualinherited

pseudo rapidity

Implements I4Momentum.

Reimplemented in Nav4MomWrapper< Navigable_t, P4Momentum_t >.

Definition at line 32 of file P4PxPyPzEBase.cxx.

33 {
34  const double e=this->e();
35 
36  const double px=this->px();
37  const double py=this->py();
38  const double pz=this->pz();
39  // FIXME: should we use a more underflow-friendly formula:
40  // sqrt(a**2 + b**2)
41  // => y.sqrt(1+(x/y)**2) where y=max(|a|,|b|) and x=min(|a|,|b|)
42  const double p =std::sqrt (px*px + py*py + pz*pz);
43  if (p==0.0) return 0.0;
44  if (p==+pz) return +std::numeric_limits<double>::infinity();
45  if (p==-pz) return -std::numeric_limits<double>::infinity();
46  //PO flip if negative e
47  return (e>0 ? 1. : -1.)* 0.5*log((p+pz)/(p-pz));
48 }

◆ fillToken() [1/2]

void Analysis::ParticleShallowClone::fillToken ( INavigationToken theToken) const
inlinevirtual

Implement method from INavigable (forwareded to the orignal "master" particle)

Implements INavigable.

Definition at line 335 of file ParticleShallowClone.h.

336 {
337  (*m_masterLink)->fillToken(theToken);
338  return;
339 }

◆ fillToken() [2/2]

void Analysis::ParticleShallowClone::fillToken ( INavigationToken theToken,
const std::any &  theOther 
) const
inlinevirtual

Implement method from INavigable (forwareded to the orignal "master" particle)

Implements INavigable.

Definition at line 342 of file ParticleShallowClone.h.

343 {
344  (*m_masterLink)->fillToken(theToken, theOther);
345  return;
346 }

◆ getAthenaBarCode()

AthenaBarCode_t Analysis::ParticleShallowClone::getAthenaBarCode ( ) const
inlinevirtual

Public getter.

Reimplemented from IAthenaBarCode.

Definition at line 309 of file ParticleShallowClone.h.

310 {
311  return (*m_masterLink)->getAthenaBarCode();
312 }

◆ getMasterLink()

const MasterLink_t & Analysis::ParticleShallowClone::getMasterLink ( ) const
inline

Copy constructor.

The default destructor All public methods that are new to this class Get a const ElementLink reference to the original "master" particle

Definition at line 286 of file ParticleShallowClone.h.

287 {
288  return m_masterLink;
289 }

◆ getMasterPtr()

const Master_t * Analysis::ParticleShallowClone::getMasterPtr ( ) const
inline

Get a const pointer to the original "master" particle.

Definition at line 293 of file ParticleShallowClone.h.

294 {
295  if ( m_masterLink.isValid() )
296  {
297  return *m_masterLink;
298  }
299  else
300  {
301  //ATH_MSG_ERROR ( "You tried to implicitly cast from an ParticleShallowClone to a INavigable4Momentum, but the pointed-at INavigable4Momentum doesn't exist! Returning NULL..." );
302  return 0;
303  }
304 }

◆ getVersion()

AthenaBarCodeVersion_t Analysis::ParticleShallowClone::getVersion ( ) const
inlinevirtual

Comparing & Versioning Control.

Reimplemented from IAthenaBarCode.

Definition at line 327 of file ParticleShallowClone.h.

328 {
329  return (*m_masterLink)->getVersion();
330 }

◆ hasCharge()

bool Analysis::ParticleShallowClone::hasCharge ( ) const
inlinevirtual

method to check if charge information is available (used directly from this shallow clone particle)

Implements IParticle.

Definition at line 371 of file ParticleShallowClone.h.

372 {
373  return m_hasCharge;
374 }

◆ hasPdgId()

bool Analysis::ParticleShallowClone::hasPdgId ( ) const
inlinevirtual

method to check if particle id information is available (forwareded to the orignal "master" particle)

Implements IParticle.

Definition at line 383 of file ParticleShallowClone.h.

384 {
385  return (*m_masterLink)->hasPdgId();
386 }

◆ hasSameAthenaBarCode()

bool Analysis::ParticleShallowClone::hasSameAthenaBarCode ( const IAthenaBarCode obj) const
inlinevirtual

Comparing & Versioning Control.

Reimplemented from IAthenaBarCode.

Definition at line 315 of file ParticleShallowClone.h.

316 {
317  return (*m_masterLink)->hasSameAthenaBarCode(obj);
318 }

◆ hasSameAthenaBarCodeExceptVersion()

bool Analysis::ParticleShallowClone::hasSameAthenaBarCodeExceptVersion ( const IAthenaBarCode obj) const
inlinevirtual

Comparing & Versioning Control.

Reimplemented from IAthenaBarCode.

Definition at line 321 of file ParticleShallowClone.h.

322 {
323  return (*m_masterLink)->hasSameAthenaBarCodeExceptVersion(obj);
324 }

◆ hlv()

CLHEP::HepLorentzVector P4PxPyPzEBase::hlv ( ) const
virtualinherited

CLHEP HepLorentzVector.

Implements I4Momentum.

Reimplemented in Nav4MomWrapper< Navigable_t, P4Momentum_t >.

Definition at line 147 of file P4PxPyPzEBase.cxx.

148 { return CLHEP::HepLorentzVector(this->px(),this->py(),this->pz(),this->e());
149 
150 }

◆ iPt()

double P4PxPyPzEBase::iPt ( ) const
virtualinherited

inverse of transverse momentum

Implements I4Momentum.

Reimplemented in Nav4MomWrapper< Navigable_t, P4Momentum_t >.

Definition at line 131 of file P4PxPyPzEBase.cxx.

132  { return 1./this->pt();
133  }

◆ kind()

virtual I4Momentum::Kind P4PxPyPzEBase::kind ( ) const
inlinevirtualinherited

tells what kind of P4XYZT this is

Implements I4Momentum.

Reimplemented in Nav4MomWrapper< Navigable_t, P4Momentum_t >.

Definition at line 59 of file P4PxPyPzEBase.h.

59 { return I4Momentum::P4PXPYPZE; };

◆ m()

double P4PxPyPzEBase::m ( ) const
virtualinherited

mass

Implements I4Momentum.

Reimplemented in Nav4MomWrapper< Navigable_t, P4Momentum_t >.

Definition at line 25 of file P4PxPyPzEBase.cxx.

26 {
27  const double m2 = this->m2();
28 
29  return m2 < 0.0 ? -std::sqrt(-m2) : std::sqrt (m2);
30 }

◆ m2()

double P4PxPyPzEBase::m2 ( ) const
virtualinherited

mass squared

Implements I4Momentum.

Reimplemented in Nav4MomWrapper< Navigable_t, P4Momentum_t >.

Definition at line 14 of file P4PxPyPzEBase.cxx.

15 {
16  const double px=this->px();
17  const double py=this->py();
18  const double pz=this->pz();
19  const double e =this->e();
20 
21  const double m2 = e*e - (px*px + py*py + pz*pz);
22  return m2;
23 }

◆ momentumBase() [1/2]

Analysis::ParticleShallowClone::momentum_type & Analysis::ParticleShallowClone::momentumBase ( )
inline

Definition at line 425 of file ParticleShallowClone.h.

426 {
427  return *this;
428 }

◆ momentumBase() [2/2]

const Analysis::ParticleShallowClone::momentum_type & Analysis::ParticleShallowClone::momentumBase ( ) const
inline

access to underlying base type (I4Momentum-like)

Definition at line 419 of file ParticleShallowClone.h.

420 {
421  return *this;
422 }

◆ newVersion()

virtual void IAthenaBarCode::newVersion ( )
inlinevirtualinherited

Reimplemented in Rec::TrackParticle, ParticleSigStateImpl< INavigable_t, I4Momentum_t, IParticle_t >, ParticleSigStateImpl< Navigable< INavigable4MomentumCollection, double >, P4ImplPxPyPzE >, ParticleSigStateImpl< Navigable< DataVector< INavigable4Momentum >, double, std::vector< std::pair< ElementLink< DataVector< INavigable4Momentum > >, double > > >, P4ImplPxPyPzE, ParticleEvent::Base >, ParticleImpl< INavigable_t, I4Momentum_t, IParticle_t >, ParticleImpl< NavigableTerminalNode, P4ImplEEtaPhiM, ParticleEvent::Base >, ParticleImpl< TruthParticleNavigation, TruthParticleMomentum, TruthParticleBase >, ParticleImpl< CompositeParticleNavigation, P4ImplPxPyPzE, ParticleEvent::Base >, ParticleImpl< NavigableTerminalNode, P4PtEtaPhiM >, ParticleImpl< ::Analysis::TauJetNavigation, ::P4ImplEEtaPhiM >, ParticleImpl< Navigable< DataVector< INavigable4Momentum >, double, std::vector< std::pair< ElementLink< DataVector< INavigable4Momentum > >, double > > >, P4ImplPxPyPzE, ParticleEvent::Base >, ParticleImpl< egammaNavigation, P4ImplEEtaPhiM >, ParticleImpl< ::Analysis::MuonNavigation, ::P4ImplIPtCotThPhiM >, ParticleImpl< NavigableTerminalNode, P4ImplPxPyPzE, ParticleEvent::Base >, ParticleImpl< NavigableTerminalNode, P4ImplIPtCotThPhiM, ParticleEvent::Base >, ParticleImpl< NeutrinoNavigation, P4ImplPxPyPzE >, and AthenaBarCodeBase.

Definition at line 89 of file AthenaKernel/AthenaKernel/IAthenaBarCode.h.

89  {
90  // throw std::runtime_error("IAthenaBarCode::newVersion():: can't newVersion() in the dummy implementation");
91  }

◆ origin()

const Trk::RecVertex * Analysis::ParticleShallowClone::origin ( ) const
inlinevirtual

Return a RecVertex corresponding to particle's Origin (used directly from this shallow clone particle)

Implements IParticle.

Definition at line 357 of file ParticleShallowClone.h.

358 {
359  return (!m_originLink.isValid())
360  ? 0
361  : &(**m_originLink).recVertex();
362 }

◆ originLink()

const ElementLink< VxContainer > & Analysis::ParticleShallowClone::originLink ( ) const
inlinevirtual

Return an ElementLink corresponding to particle's Origin (used directly from this shallow clone particle)

Implements IParticle.

Definition at line 365 of file ParticleShallowClone.h.

366 {
367  return m_originLink;
368 }

◆ p()

double P4PxPyPzEBase::p ( ) const
virtualinherited

momentum magnitude

Implements I4Momentum.

Reimplemented in Nav4MomWrapper< Navigable_t, P4Momentum_t >.

Definition at line 68 of file P4PxPyPzEBase.cxx.

69 {
70  //PO return the correc
71  const double e=this->e();
72 
73  return (e>0 ? 1. : -1.)*std::sqrt(this->p2());
74 }

◆ p2()

double P4PxPyPzEBase::p2 ( ) const
virtualinherited

square of momentum magnitude

Implements I4Momentum.

Reimplemented in Nav4MomWrapper< Navigable_t, P4Momentum_t >.

Definition at line 59 of file P4PxPyPzEBase.cxx.

60 {
61  const double px=this->px();
62  const double py=this->py();
63  const double pz=this->pz();
64 
65  return px*px+py*py+pz*pz;
66 }

◆ pdgId()

int Analysis::ParticleShallowClone::pdgId ( ) const
inlinevirtual

Return particle id (forwareded to the orignal "master" particle)

Implements IParticle.

Definition at line 389 of file ParticleShallowClone.h.

390 {
391  return (*m_masterLink)->pdgId();
392 }

◆ phi()

double P4PxPyPzEBase::phi ( ) const
virtualinherited

phi in [-pi,pi[

Implements I4Momentum.

Reimplemented in Nav4MomWrapper< Navigable_t, P4Momentum_t >.

Definition at line 50 of file P4PxPyPzEBase.cxx.

51 {
52  const double e=this->e();
53  const double px= (e>0 ? 1. : -1.)*this->px();
54  const double py= (e>0 ? 1. : -1.)*this->py();
55  return px == 0.0 && py == 0.0 ? 0.0 : atan2(py,px);
56 }

◆ pt()

double P4PxPyPzEBase::pt ( ) const
virtualinherited

transverse momentum

Implements I4Momentum.

Reimplemented in Nav4MomWrapper< Navigable_t, P4Momentum_t >.

Definition at line 114 of file P4PxPyPzEBase.cxx.

115 {
116  const double e=this->e();
117  const double px=this->px();
118  const double py=this->py();
119  //PO flip sign if negative energy
120  return (e>0 ? 1. : -1.)*std::sqrt(px*px+py*py);
121 
122  }

◆ pti()

double P4PxPyPzE::pti ( ) const
inlineinherited

Experimental : inlined function to get pt without going through virtual inheritance.

Definition at line 182 of file P4PxPyPzE.h.

183 { const double thePx=pxi();
184  const double thePy=pyi();
185  return sqrt(thePx*thePx+thePy*thePy);}

◆ px()

double P4PxPyPzE::px ( ) const
inlinevirtualinherited

get px data member

Implements I4Momentum.

Reimplemented in Nav4MomWrapper< Navigable_t, P4Momentum_t >.

Definition at line 122 of file P4PxPyPzE.h.

123 { return m_px;}

◆ pxi()

double P4PxPyPzE::pxi ( ) const
inlineinherited

Experimental : inlined function to get px without going through virtual inheritance.

Definition at line 170 of file P4PxPyPzE.h.

171 { return m_px;}

◆ py()

double P4PxPyPzE::py ( ) const
inlinevirtualinherited

get py data member

Implements I4Momentum.

Reimplemented in Nav4MomWrapper< Navigable_t, P4Momentum_t >.

Definition at line 126 of file P4PxPyPzE.h.

127 { return m_py;}

◆ pyi()

double P4PxPyPzE::pyi ( ) const
inlineinherited

Experimental : inlined function to get py without going through virtual inheritance.

Definition at line 173 of file P4PxPyPzE.h.

174 { return m_py;}

◆ pz()

double P4PxPyPzE::pz ( ) const
inlinevirtualinherited

get pz data member

Implements I4Momentum.

Reimplemented in Nav4MomWrapper< Navigable_t, P4Momentum_t >.

Definition at line 129 of file P4PxPyPzE.h.

130 { return m_pz;}

◆ pzi()

double P4PxPyPzE::pzi ( ) const
inlineinherited

Experimental : inlined function to get pz without going through virtual inheritance.

Definition at line 176 of file P4PxPyPzE.h.

177 { return m_pz;}

◆ rapidity()

double P4PxPyPzEBase::rapidity ( ) const
virtualinherited

rapidity

Implements I4Momentum.

Reimplemented in Nav4MomWrapper< Navigable_t, P4Momentum_t >.

Definition at line 136 of file P4PxPyPzEBase.cxx.

137 {
138  const double e =this->e();
139  const double pz=this->pz();
140  if (e==0.0) return 0.0;
141  if (e==+pz) return +std::numeric_limits<double>::infinity();
142  if (e==-pz) return -std::numeric_limits<double>::infinity();
143  //PO invariant under flipping of 4-mom with neg E
144  return 0.5*std::log((e+pz)/(e-pz));
145 }

◆ set4Mom() [1/3]

void P4PxPyPzE::set4Mom ( const CLHEP::HepLorentzVector &  theHlv)
inlinevirtualinherited

set all 4-mom from CLHEP HepLorentzVector

Reimplemented from P4PxPyPzEBase.

Reimplemented in Nav4MomWrapper< Navigable_t, P4Momentum_t >, and Rec::TrackParticle.

Definition at line 161 of file P4PxPyPzE.h.

162 {
163  m_px=theHlv.px();
164  m_py=theHlv.py();
165  m_pz=theHlv.pz();
166  m_e=theHlv.e();
167 }

◆ set4Mom() [2/3]

void P4PxPyPzE::set4Mom ( const I4Momentum theI4Mom)
inlinevirtualinherited

set all 4-mom from another I4Momentum reference

Reimplemented from P4PxPyPzEBase.

Reimplemented in Nav4MomWrapper< Navigable_t, P4Momentum_t >, and Rec::TrackParticle.

Definition at line 147 of file P4PxPyPzE.h.

148 {
149  m_px=theI4Mom.px();
150  m_py=theI4Mom.py();
151  m_pz=theI4Mom.pz();
152  m_e=theI4Mom.e();
153 }

◆ set4Mom() [3/3]

void P4PxPyPzE::set4Mom ( const I4Momentum *const  theI4Mom)
inlinevirtualinherited

set all 4-mom from another I4Momentum pointer

Reimplemented from P4PxPyPzEBase.

Reimplemented in Nav4MomWrapper< Navigable_t, P4Momentum_t >, and Rec::TrackParticle.

Definition at line 155 of file P4PxPyPzE.h.

156 {
157  this->set4Mom(*theI4Mom);
158 }

◆ set_charge()

void Analysis::ParticleShallowClone::set_charge ( ChargeType  theCharge)
inlinevirtual

Set method to set the charge of this shallow clone particle (the original "master" particle remains unaffected)

Definition at line 395 of file ParticleShallowClone.h.

396 {
397  m_charge = theCharge;
398  m_hasCharge = true;
399  return;
400 }

◆ set_origin() [1/2]

void Analysis::ParticleShallowClone::set_origin ( const VxContainer theContainer,
const Trk::VxCandidate vertex 
)
inlinevirtual

Set method to set the charge of this shallow clone particle (the original "master" particle remains unaffected)

Definition at line 410 of file ParticleShallowClone.h.

412 {
414  ( vertex,*theContainer );
415  return;
416 }

◆ set_origin() [2/2]

void Analysis::ParticleShallowClone::set_origin ( const VxContainer theContainer,
int  index 
)
inlinevirtual

Set method to set the charge of this shallow clone particle (the original "master" particle remains unaffected)

Definition at line 403 of file ParticleShallowClone.h.

404 {
406  return;
407 }

◆ setAthenaBarCode()

virtual void IAthenaBarCode::setAthenaBarCode ( AthenaBarCode_t  )
inlinevirtualinherited

Reimplemented in Rec::TrackParticle, ParticleSigStateImpl< INavigable_t, I4Momentum_t, IParticle_t >, ParticleSigStateImpl< Navigable< INavigable4MomentumCollection, double >, P4ImplPxPyPzE >, ParticleSigStateImpl< Navigable< DataVector< INavigable4Momentum >, double, std::vector< std::pair< ElementLink< DataVector< INavigable4Momentum > >, double > > >, P4ImplPxPyPzE, ParticleEvent::Base >, ParticleImpl< INavigable_t, I4Momentum_t, IParticle_t >, ParticleImpl< NavigableTerminalNode, P4ImplEEtaPhiM, ParticleEvent::Base >, ParticleImpl< TruthParticleNavigation, TruthParticleMomentum, TruthParticleBase >, ParticleImpl< CompositeParticleNavigation, P4ImplPxPyPzE, ParticleEvent::Base >, ParticleImpl< NavigableTerminalNode, P4PtEtaPhiM >, ParticleImpl< ::Analysis::TauJetNavigation, ::P4ImplEEtaPhiM >, ParticleImpl< Navigable< DataVector< INavigable4Momentum >, double, std::vector< std::pair< ElementLink< DataVector< INavigable4Momentum > >, double > > >, P4ImplPxPyPzE, ParticleEvent::Base >, ParticleImpl< egammaNavigation, P4ImplEEtaPhiM >, ParticleImpl< ::Analysis::MuonNavigation, ::P4ImplIPtCotThPhiM >, ParticleImpl< NavigableTerminalNode, P4ImplPxPyPzE, ParticleEvent::Base >, ParticleImpl< NavigableTerminalNode, P4ImplIPtCotThPhiM, ParticleEvent::Base >, ParticleImpl< NeutrinoNavigation, P4ImplPxPyPzE >, and AthenaBarCodeBase.

Definition at line 71 of file AthenaKernel/AthenaKernel/IAthenaBarCode.h.

71  {
72  // throw std::runtime_error("IAthenaBarCode::setAthenaBarCode():: can't set AthenaBarCode in the dummy implementation");
73  }

◆ setE()

void P4PxPyPzE::setE ( double  theE)
inlinevirtualinherited

set energy data member

Definition at line 144 of file P4PxPyPzE.h.

145 { m_e=theE;}

◆ setPx()

void P4PxPyPzE::setPx ( double  thePx)
inlinevirtualinherited

set Px data member

Definition at line 135 of file P4PxPyPzE.h.

136 { m_px=thePx;}

◆ setPy()

void P4PxPyPzE::setPy ( double  thePy)
inlinevirtualinherited

set Py data member

Definition at line 138 of file P4PxPyPzE.h.

139 { m_py=thePy;}

◆ setPz()

void P4PxPyPzE::setPz ( double  thePz)
inlinevirtualinherited

set Pz data member

Definition at line 141 of file P4PxPyPzE.h.

142 { m_pz=thePz;}

◆ setVersion()

virtual void IAthenaBarCode::setVersion ( AthenaBarCodeVersion_t  )
inlinevirtualinherited

Reimplemented in Rec::TrackParticle, ParticleSigStateImpl< INavigable_t, I4Momentum_t, IParticle_t >, ParticleSigStateImpl< Navigable< INavigable4MomentumCollection, double >, P4ImplPxPyPzE >, ParticleSigStateImpl< Navigable< DataVector< INavigable4Momentum >, double, std::vector< std::pair< ElementLink< DataVector< INavigable4Momentum > >, double > > >, P4ImplPxPyPzE, ParticleEvent::Base >, ParticleImpl< INavigable_t, I4Momentum_t, IParticle_t >, ParticleImpl< NavigableTerminalNode, P4ImplEEtaPhiM, ParticleEvent::Base >, ParticleImpl< TruthParticleNavigation, TruthParticleMomentum, TruthParticleBase >, ParticleImpl< CompositeParticleNavigation, P4ImplPxPyPzE, ParticleEvent::Base >, ParticleImpl< NavigableTerminalNode, P4PtEtaPhiM >, ParticleImpl< ::Analysis::TauJetNavigation, ::P4ImplEEtaPhiM >, ParticleImpl< Navigable< DataVector< INavigable4Momentum >, double, std::vector< std::pair< ElementLink< DataVector< INavigable4Momentum > >, double > > >, P4ImplPxPyPzE, ParticleEvent::Base >, ParticleImpl< egammaNavigation, P4ImplEEtaPhiM >, ParticleImpl< ::Analysis::MuonNavigation, ::P4ImplIPtCotThPhiM >, ParticleImpl< NavigableTerminalNode, P4ImplPxPyPzE, ParticleEvent::Base >, ParticleImpl< NavigableTerminalNode, P4ImplIPtCotThPhiM, ParticleEvent::Base >, ParticleImpl< NeutrinoNavigation, P4ImplPxPyPzE >, and AthenaBarCodeBase.

Definition at line 93 of file AthenaKernel/AthenaKernel/IAthenaBarCode.h.

93  {
94  // throw std::runtime_error("IAthenaBarCode::setVersion():: can't setVersion() in the dummy implementation");
95  }

◆ sinPhi()

double P4PxPyPzEBase::sinPhi ( ) const
virtualinherited

sinus phi

Implements I4Momentum.

Reimplemented in Nav4MomWrapper< Navigable_t, P4Momentum_t >.

Definition at line 82 of file P4PxPyPzEBase.cxx.

83 {
84  return this->py()/this->pt();
85 }

◆ sinTh()

double P4PxPyPzEBase::sinTh ( ) const
virtualinherited

sinus theta

Implements I4Momentum.

Reimplemented in Nav4MomWrapper< Navigable_t, P4Momentum_t >.

Definition at line 106 of file P4PxPyPzEBase.cxx.

107 {
108 
109  return this->pt()/this->p();
110 
111 }

◆ tanTh()

double P4PxPyPzEBase::tanTh ( ) const
virtualinherited

tan theta

Implements I4Momentum.

Reimplemented in Nav4MomWrapper< Navigable_t, P4Momentum_t >.

Definition at line 87 of file P4PxPyPzEBase.cxx.

88 {
89  return this->pt()/this->pz();
90 }

Friends And Related Function Documentation

◆ ::ParticleShallowCloneCnv_p1

friend class ::ParticleShallowCloneCnv_p1
friend

Definition at line 260 of file ParticleShallowClone.h.

Member Data Documentation

◆ m_charge

ChargeType Analysis::ParticleShallowClone::m_charge
private

Value of the charge of the particle (this has real meaning, only if hasCharge() returns true)

Definition at line 274 of file ParticleShallowClone.h.

◆ m_e

double P4PxPyPzE::m_e
protectedinherited

Definition at line 92 of file P4PxPyPzE.h.

◆ m_hasCharge

bool Analysis::ParticleShallowClone::m_hasCharge
private

Switch to tell if this particle has a charge.

Definition at line 269 of file ParticleShallowClone.h.

◆ m_masterLink

MasterLink_t Analysis::ParticleShallowClone::m_masterLink
private

The persistent pointer (ElementLink) to the original "master" particle.

Definition at line 263 of file ParticleShallowClone.h.

◆ m_originLink

ElementLink< VxContainer > Analysis::ParticleShallowClone::m_originLink
private

Persistent pointer (ElementLink) to the origin of this particle.

Definition at line 266 of file ParticleShallowClone.h.

◆ m_px

double P4PxPyPzE::m_px
protectedinherited

Definition at line 89 of file P4PxPyPzE.h.

◆ m_py

double P4PxPyPzE::m_py
protectedinherited

Definition at line 90 of file P4PxPyPzE.h.

◆ m_pz

double P4PxPyPzE::m_pz
protectedinherited

Definition at line 91 of file P4PxPyPzE.h.

◆ UNDEFINEDBARCODE

const AthenaBarCode_t IAthenaBarCode::UNDEFINEDBARCODE = (AthenaBarCode_t)(-1)
staticinherited

Definition at line 52 of file AthenaKernel/AthenaKernel/IAthenaBarCode.h.

◆ UNDEFINEDVERSION

const AthenaBarCode_t IAthenaBarCode::UNDEFINEDVERSION = UNDEFINEDBARCODE
staticinherited

Definition at line 53 of file AthenaKernel/AthenaKernel/IAthenaBarCode.h.


The documentation for this class was generated from the following file:
I4Momentum::py
virtual double py() const =0
y component of momentum
P4PxPyPzEBase::p
virtual double p() const
momentum magnitude
Definition: P4PxPyPzEBase.cxx:68
Analysis::ParticleShallowClone::m_hasCharge
bool m_hasCharge
Switch to tell if this particle has a charge.
Definition: ParticleShallowClone.h:269
index
Definition: index.py:1
I4Momentum::P4IPTCOTTHPHIM
@ P4IPTCOTTHPHIM
Definition: I4Momentum.h:33
P4Momentum_t
P4PxPyPzE P4Momentum_t
Definition: ParticleShallowClone.h:42
python.AthDsoLogger.out
out
Definition: AthDsoLogger.py:71
Analysis::ParticleShallowClone::m_charge
ChargeType m_charge
Value of the charge of the particle (this has real meaning, only if hasCharge() returns true)
Definition: ParticleShallowClone.h:274
P4PxPyPzEBase::sinTh
virtual double sinTh() const
sinus theta
Definition: P4PxPyPzEBase.cxx:106
Analysis::ParticleShallowClone::m_originLink
ElementLink< VxContainer > m_originLink
Persistent pointer (ElementLink) to the origin of this particle.
Definition: ParticleShallowClone.h:266
P4PxPyPzE::m_py
double m_py
Definition: P4PxPyPzE.h:90
P4PxPyPzE::m_pz
double m_pz
Definition: P4PxPyPzE.h:91
P4PxPyPzEBase::p2
virtual double p2() const
square of momentum magnitude
Definition: P4PxPyPzEBase.cxx:59
P4PxPyPzE::pxi
double pxi() const
Experimental : inlined function to get px without going through virtual inheritance.
Definition: P4PxPyPzE.h:170
I4Momentum::pz
virtual double pz() const =0
z component of momentum
P4PxPyPzE::m_px
double m_px
Definition: P4PxPyPzE.h:89
I4Momentum::e
virtual double e() const =0
energy
P4PxPyPzEBase::pt
virtual double pt() const
transverse momentum
Definition: P4PxPyPzEBase.cxx:114
I4Momentum::P4PTETAPHIM
@ P4PTETAPHIM
Definition: I4Momentum.h:33
I4Momentum::UNKNOWN
@ UNKNOWN
Definition: I4Momentum.h:33
Trk::vertex
@ vertex
Definition: MeasurementType.h:21
P4PxPyPzE::m_e
double m_e
Definition: P4PxPyPzE.h:92
Analysis::ParticleShallowClone::ParticleShallowClone
ParticleShallowClone()
The default constructor.
Definition: ParticleShallowClone.h:62
python.CaloCondTools.log
log
Definition: CaloCondTools.py:20
P4PxPyPzE::set4Mom
virtual void set4Mom(const I4Momentum &theI4Mom)
set all 4-mom from another I4Momentum reference
Definition: P4PxPyPzE.h:147
Analysis::ParticleShallowClone::m_masterLink
MasterLink_t m_masterLink
The persistent pointer (ElementLink) to the original "master" particle.
Definition: ParticleShallowClone.h:263
python.PyAthena.obj
obj
Definition: PyAthena.py:132
P4PxPyPzE::pyi
double pyi() const
Experimental : inlined function to get py without going through virtual inheritance.
Definition: P4PxPyPzE.h:173
P4PxPyPzEBase::m2
virtual double m2() const
mass squared
Definition: P4PxPyPzEBase.cxx:14
I4Momentum::P4EETAPHIM
@ P4EETAPHIM
Definition: I4Momentum.h:33
I4Momentum::px
virtual double px() const =0
x component of momentum
I4Momentum::P4PXPYPZE
@ P4PXPYPZE
Definition: I4Momentum.h:33