|
ATLAS Offline Software
|
Go to the documentation of this file.
13 #ifndef PARTICLEEVENT_PARTICLESIGSTATEIMPL_H
14 #define PARTICLEEVENT_PARTICLESIGSTATEIMPL_H 1
25 #include "AthLinks/ElementLink.h"
38 template<
class INavigable_t,
113 const std::any&
weight )
const;
142 virtual double px()
const;
146 virtual double py()
const;
150 virtual double pz()
const;
154 virtual double m()
const;
158 virtual double m2()
const;
162 virtual double p()
const;
166 virtual double p2()
const;
174 virtual double eta()
const;
178 virtual double phi()
const;
182 virtual double e()
const;
186 virtual double et()
const;
190 virtual double pt()
const;
194 virtual double iPt()
const;
222 virtual CLHEP::HepLorentzVector
hlv()
const;
232 virtual std::ostream&
dump( std::ostream&
out )
const;
365 template<
class INavigable_t,
class I4Momentum_t,
class IParticle_t>
379 m_nStates ( nStates ),
380 m_currentState( defaultState )
391 template<
class INavigable_t,
class I4Momentum_t,
class IParticle_t>
403 m_part ( rhs.m_part ),
404 m_nStates ( rhs.m_nStates ),
405 m_currentState( rhs.m_currentState )
408 template<
class INavigable_t,
class I4Momentum_t,
class IParticle_t>
414 if (
this != &rhs ) {
415 IAthenaBarCode::operator=(rhs);
416 INavigable::operator=(rhs);
417 I4Momentum::operator=(rhs);
418 INavigable4Momentum::operator=(rhs);
419 IParticle::operator=( rhs );
423 m_nStates = rhs.m_nStates;
424 m_currentState = rhs.m_currentState;
429 template<
class INavigable_t,
class I4Momentum_t,
class IParticle_t>
433 IParticle_t>::~ParticleSigStateImpl()
436 template<
class INavigable_t,
class I4Momentum_t,
class IParticle_t>
439 IParticle_t>::navigableBase()
const
444 template<
class INavigable_t,
class I4Momentum_t,
class IParticle_t>
449 if(hasSignalState(
s))
450 return m_mom[
int(
s)];
455 template<
class INavigable_t,
class I4Momentum_t,
class IParticle_t>
458 IParticle_t>::momentumBase()
const
460 if(hasSignalState(m_currentState))
461 return m_mom[
int(m_currentState)];
466 template<
class INavigable_t,
class I4Momentum_t,
class IParticle_t>
469 IParticle_t>::particleBase()
const
474 template<
class INavigable_t,
class I4Momentum_t,
class IParticle_t>
482 template<
class INavigable_t,
class I4Momentum_t,
class IParticle_t>
486 const std::any&
weight )
const
491 template<
class INavigable_t,
class I4Momentum_t,
class IParticle_t>
496 return momentumBase(
s).px();
499 template<
class INavigable_t,
class I4Momentum_t,
class IParticle_t>
504 return momentumBase(
s).py();
507 template<
class INavigable_t,
class I4Momentum_t,
class IParticle_t>
512 return momentumBase(
s).pz();
515 template<
class INavigable_t,
class I4Momentum_t,
class IParticle_t>
520 return momentumBase(
s).m();
523 template<
class INavigable_t,
class I4Momentum_t,
class IParticle_t>
528 return momentumBase(
s).m2();
531 template<
class INavigable_t,
class I4Momentum_t,
class IParticle_t>
536 return momentumBase(
s).p();
539 template<
class INavigable_t,
class I4Momentum_t,
class IParticle_t>
544 return momentumBase(
s).p2();
547 template<
class INavigable_t,
class I4Momentum_t,
class IParticle_t>
555 template<
class INavigable_t,
class I4Momentum_t,
class IParticle_t>
560 return momentumBase(
s).eta();
563 template<
class INavigable_t,
class I4Momentum_t,
class IParticle_t>
568 return momentumBase(
s).phi();
571 template<
class INavigable_t,
class I4Momentum_t,
class IParticle_t>
576 return momentumBase(
s).e();
579 template<
class INavigable_t,
class I4Momentum_t,
class IParticle_t>
584 return momentumBase(
s).et();
587 template<
class INavigable_t,
class I4Momentum_t,
class IParticle_t>
592 return momentumBase(
s).pt();
595 template<
class INavigable_t,
class I4Momentum_t,
class IParticle_t>
600 return momentumBase(
s).
iPt();
603 template<
class INavigable_t,
class I4Momentum_t,
class IParticle_t>
608 return momentumBase(
s).
cosPhi();
611 template<
class INavigable_t,
class I4Momentum_t,
class IParticle_t>
616 return momentumBase(
s).
sinPhi();
619 template<
class INavigable_t,
class I4Momentum_t,
class IParticle_t>
624 return momentumBase(
s).
tanTh();
627 template<
class INavigable_t,
class I4Momentum_t,
class IParticle_t>
632 return momentumBase(
s).
cosTh();
635 template<
class INavigable_t,
class I4Momentum_t,
class IParticle_t>
640 return momentumBase(
s).
sinTh();
643 template<
class INavigable_t,
class I4Momentum_t,
class IParticle_t>
648 return momentumBase(
s).
cotTh();
652 template<
class INavigable_t,
class I4Momentum_t,
class IParticle_t>
657 return momentumBase(
s).
hlv();
660 template<
class INavigable_t,
class I4Momentum_t,
class IParticle_t>
665 return momentumBase(
s).errors();
668 template<
class INavigable_t,
class I4Momentum_t,
class IParticle_t>
673 return momentumBase().px();
676 template<
class INavigable_t,
class I4Momentum_t,
class IParticle_t>
681 return momentumBase().py();
684 template<
class INavigable_t,
class I4Momentum_t,
class IParticle_t>
689 return momentumBase().pz();
692 template<
class INavigable_t,
class I4Momentum_t,
class IParticle_t>
697 return momentumBase().m();
700 template<
class INavigable_t,
class I4Momentum_t,
class IParticle_t>
705 return momentumBase().m2();
708 template<
class INavigable_t,
class I4Momentum_t,
class IParticle_t>
713 return momentumBase().p();
716 template<
class INavigable_t,
class I4Momentum_t,
class IParticle_t>
721 return momentumBase().p2();
724 template<
class INavigable_t,
class I4Momentum_t,
class IParticle_t>
727 IParticle_t>::rapidity()
const
732 template<
class INavigable_t,
class I4Momentum_t,
class IParticle_t>
737 return momentumBase().eta();
740 template<
class INavigable_t,
class I4Momentum_t,
class IParticle_t>
745 return momentumBase().phi();
748 template<
class INavigable_t,
class I4Momentum_t,
class IParticle_t>
753 return momentumBase().e();
756 template<
class INavigable_t,
class I4Momentum_t,
class IParticle_t>
761 return momentumBase().et();
764 template<
class INavigable_t,
class I4Momentum_t,
class IParticle_t>
769 return momentumBase().pt();
772 template<
class INavigable_t,
class I4Momentum_t,
class IParticle_t>
775 IParticle_t>::iPt()
const
777 return momentumBase().
iPt();
780 template<
class INavigable_t,
class I4Momentum_t,
class IParticle_t>
783 IParticle_t>::cosPhi()
const
785 return momentumBase().
cosPhi();
788 template<
class INavigable_t,
class I4Momentum_t,
class IParticle_t>
791 IParticle_t>::sinPhi()
const
793 return momentumBase().
sinPhi();
796 template<
class INavigable_t,
class I4Momentum_t,
class IParticle_t>
799 IParticle_t>::tanTh()
const
801 return momentumBase().
tanTh();
804 template<
class INavigable_t,
class I4Momentum_t,
class IParticle_t>
807 IParticle_t>::cosTh()
const
809 return momentumBase().
cosTh();
812 template<
class INavigable_t,
class I4Momentum_t,
class IParticle_t>
815 IParticle_t>::sinTh()
const
817 return momentumBase().
sinTh();
820 template<
class INavigable_t,
class I4Momentum_t,
class IParticle_t>
823 IParticle_t>::cotTh()
const
825 return momentumBase().
cotTh();
829 template<
class INavigable_t,
class I4Momentum_t,
class IParticle_t>
832 IParticle_t>::hlv()
const
834 return momentumBase().
hlv();
837 template<
class INavigable_t,
class I4Momentum_t,
class IParticle_t>
842 return momentumBase().errors();
845 template<
class INavigable_t,
class I4Momentum_t,
class IParticle_t>
848 IParticle_t>::kind()
const
850 return momentumBase().
kind();
853 template<
class INavigable_t,
class I4Momentum_t,
class IParticle_t>
858 momentumBase().dump (
out );
864 template<
class INavigable_t,
class I4Momentum_t,
class IParticle_t>
869 return m_part.dataType();
872 template<
class INavigable_t,
class I4Momentum_t,
class IParticle_t>
875 IParticle_t>::origin()
const
880 template<
class INavigable_t,
class I4Momentum_t,
class IParticle_t>
883 IParticle_t>::originLink()
const
888 template<
class INavigable_t,
class I4Momentum_t,
class IParticle_t>
891 IParticle_t>::hasCharge()
const
893 return m_part.hasCharge();
896 template<
class INavigable_t,
class I4Momentum_t,
class IParticle_t>
901 return m_part.charge();
904 template<
class INavigable_t,
class I4Momentum_t,
class IParticle_t>
907 IParticle_t>::hasPdgId()
const
912 template<
class INavigable_t,
class I4Momentum_t,
class IParticle_t>
915 IParticle_t>::pdgId()
const
917 return m_part.
pdgId();
925 template<
class INavigable_t,
class I4Momentum_t,
class IParticle_t>
928 IParticle_t>::getAthenaBarCode()
const
933 template<
class INavigable_t,
class I4Momentum_t,
class IParticle_t>
942 template<
class INavigable_t,
class I4Momentum_t,
class IParticle_t>
950 template<
class INavigable_t,
class I4Momentum_t,
class IParticle_t>
958 template<
class INavigable_t,
class I4Momentum_t,
class IParticle_t>
961 IParticle_t>::getVersion()
const
963 return particleBase().getAthenaBarCodeImpl().
getVersion();
966 template<
class INavigable_t,
class I4Momentum_t,
class IParticle_t>
969 IParticle_t>::newVersion()
971 particleBase().getAthenaBarCodeImpl().
newVersion();
974 template<
class INavigable_t,
class I4Momentum_t,
class IParticle_t>
979 particleBase().getAthenaBarCodeImpl().
setVersion(newversion);
990 template<
class INavigable_t,
class I4Momentum_t,
class IParticle_t>
993 IParticle_t>::navigableBase()
998 template<
class INavigable_t,
class I4Momentum_t,
class IParticle_t>
1003 if(hasSignalState(
s))
1004 return m_mom[
int(
s)];
1009 template<
class INavigable_t,
class I4Momentum_t,
class IParticle_t>
1012 IParticle_t>::momentumBase()
1014 if(hasSignalState(m_currentState))
1015 return m_mom[
int(m_currentState)];
1020 template<
class INavigable_t,
class I4Momentum_t,
class IParticle_t>
1023 IParticle_t>::particleBase()
1031 template<
class INavigable_t,
class I4Momentum_t,
class IParticle_t>
1036 return momentumBase(
s).
set4Mom( p4 );
1039 template<
class INavigable_t,
class I4Momentum_t,
class IParticle_t>
1044 return momentumBase(
s).
set4Mom( p4 );
1048 template<
class INavigable_t,
class I4Momentum_t,
class IParticle_t>
1051 IParticle_t>::set4Mom(
const CLHEP::HepLorentzVector& hlv,
state_t s )
1053 return momentumBase(
s).
set4Mom( hlv );
1056 template<
class INavigable_t,
class I4Momentum_t,
class IParticle_t>
1061 return momentumBase().
set4Mom( p4 );
1064 template<
class INavigable_t,
class I4Momentum_t,
class IParticle_t>
1069 return momentumBase().
set4Mom( p4 );
1073 template<
class INavigable_t,
class I4Momentum_t,
class IParticle_t>
1076 IParticle_t>::set4Mom(
const CLHEP::HepLorentzVector& hlv )
1078 return momentumBase().
set4Mom( hlv );
1081 template<
class INavigable_t,
class I4Momentum_t,
class IParticle_t>
1089 template<
class INavigable_t,
class I4Momentum_t,
class IParticle_t>
1097 template<
class INavigable_t,
class I4Momentum_t,
class IParticle_t>
1100 IParticle_t>::set_pdgId(
int x )
1105 template<
class INavigable_t,
class I4Momentum_t,
class IParticle_t>
1114 template<
class INavigable_t,
class I4Momentum_t,
class IParticle_t>
1123 template<
class INavigable_t,
class I4Momentum_t,
class IParticle_t>
1131 template<
class INavigable_t,
class I4Momentum_t,
class IParticle_t>
1137 template<
class INavigable_t,
class I4Momentum_t,
class IParticle_t>
1143 return p4.dump(
out );
1146 template<
class INavigable_t,
class I4Momentum_t,
class IParticle_t>
1149 IParticle_t>::signalState()
const
1151 return m_currentState;
1154 template<
class INavigable_t,
class I4Momentum_t,
class IParticle_t>
1159 if(!hasSignalState(
s))
1168 template<
class INavigable_t,
class I4Momentum_t,
class IParticle_t>
1177 return (
int(
s) < m_nStates);
1180 template<
class INavigable_t,
class I4Momentum_t,
class IParticle_t>
1185 return (
s == m_currentState);
1188 template<
class INavigable_t,
class I4Momentum_t,
class IParticle_t>
1191 IParticle_t>::resetSignalState()
1198 #endif //> PARTICLEEVENT_PARTICLEIMPL_H
virtual double sinTh(state_t s) const
std::vector< I4Momentum_t > m_mom
The 4-momentum part Eventually, perhaps we can use a set since not all intermediate Signal States wil...
virtual double py(state_t s) const
virtual ~ParticleSigStateImpl()
Default destructor:
virtual double py() const
y component of momentum
virtual state_t signalState() const
Retrieve current signal state.
const momentum_type & momentumBase() const
virtual CLHEP::HepLorentzVector hlv() const
CLHEP HepLorentzVector.
bool hasSameAthenaBarCode(const IAthenaBarCode &) const
int m_nStates
Number of Signal States.
bool hasSameAthenaBarCodeExceptVersion(const IAthenaBarCode &) const
ParticleSigStateImpl & operator=(const ParticleSigStateImpl &rhs)
Assignment operator.
virtual double eta() const
pseudo rapidity
virtual double e() const
energy
navigable_type & navigableBase()
access to underlying base type (INavigable-like)
Scalar phi() const
phi method
virtual bool hasSignalState(state_t s) const
check if signal state exists for current implementation
virtual void set4Mom(const I4Momentum *const p4, state_t s)
virtual bool hasPdgId() const
method to check if particle id information is available
Scalar eta() const
pseudorapidity method
virtual const I4MomentumError * errors(state_t s) const
virtual double px() const
We re-define here extra class routines that will allow direct access to signal state kinematics witho...
virtual double sinTh() const
sinus theta
virtual double cosPhi(state_t s) const
virtual double rapidity(state_t s) const
virtual double e(state_t s) const
ParticleSigStateImpl(int nStates=1, state_t defaultState=state_t(0))
Default constructor.
virtual const ElementLink< VxContainer > & originLink() const
Return an ElementLink corresponding to particle's Origin.
std::vector< I4Momentum_t > & momentumVector()
access the vector of momentum
virtual void set_charge(ChargeType x)
P4SignalState::State state_t
virtual double pz(state_t s) const
virtual double iPt(state_t s) const
const particle_type & particleBase() const
access to underlying base type (IParticle-like)
ParticleSigStateImpl< INavigable_t, I4Momentum_t, IParticle_t > self_type
publish the type of the base class (ie: 'traits-itize' it)
ParticleSigStateImpl(const ParticleSigStateImpl &rhs)
Copy constructor.
const momentum_type & momentumBase(state_t s) const
access to underlying base type (I4Momentum-like)
AthenaBarCodeVersion_t getVersion() const
virtual double tanTh(state_t s) const
virtual double sinPhi(state_t s) const
particle_type & particleBase()
access to underlying base type (IParticle-like)
virtual double px(state_t s) const
virtual double m(state_t s) const
Trk::RecVertex inherits from Trk::Vertex.
I4Momentum_t momentum_type
publish the type of the base class (ie: 'traits-itize' it)
virtual ParticleDataType::DataType dataType() const
Return enum indicating real data, fast, or full simulation Return Type has a DataType enum with the f...
momentum_type & momentumBase()
virtual double p() const
mass momentum magnitude
virtual double pt(state_t s) const
virtual double phi(state_t s) const
virtual double cosPhi() const
cosinus phi
IParticle_t particle_type
publish the type of the base class (ie: 'traits-itize' it)
virtual double m() const
mass
uint64_t AthenaBarCode_t
barcode for all INav4Mom classes
virtual double iPt() const
inverse of transverse momentum
INavigable_t m_nav
The navigable part.
virtual double et() const
transverse energy defined to be e*sin(theta)
virtual void set_origin(const VxContainer *theContainer, const Trk::VxCandidate *vertex)
virtual bool hasCharge() const
method to check if charge information is available
virtual std::ostream & dump(std::ostream &out) const
Print I4Momentum content.
virtual void set4Mom(const CLHEP::HepLorentzVector &hlv)
set 4Momentum (will throw exception if cannot be implemented)
virtual double m2(state_t s) const
virtual bool isAtSignalState(state_t s) const
check if we are at the passed state
virtual double rapidity() const
rapidity
virtual CLHEP::HepLorentzVector hlv(state_t s) const
obtain the CLHEP HepLorentzVector
virtual void set_dataType(ParticleDataType::DataType x)
virtual void set4Mom(const I4Momentum *const p4)
set 4Momentum (will throw exception if cannot be implemented)
void setAthenaBarCode(AthenaBarCode_t)
virtual void resetSignalState()
reset the signal state
virtual void fillToken(INavigationToken &thisToken) const
const navigable_type & navigableBase() const
access to underlying base type (INavigable-like)
virtual double phi() const
phi in [-pi,pi[
void setVersion(AthenaBarCodeVersion_t newversion)
virtual void set_origin(const ElementLink< VxContainer > &origin)
virtual int pdgId() const
Return particle id.
momentum_type & momentumBase(state_t s)
access to underlying base type (I4Momentum-like)
state_t m_currentState
Current Signal State.
virtual const I4MomentumError * errors() const
Access to errors, if available; returns 0 if no errors.
virtual double eta(state_t s) const
virtual const Trk::RecVertex * origin() const
Return a RecVertex corresponding to particle Origin
double charge(const T &p)
double ChargeType
typedef ChargeType used to anticipate changes here
virtual double p2(state_t s) const
virtual bool setSignalState(state_t s)
set the current signal state
INavigable_t navigable_type
publish the type of the base class (ie: 'traits-itize' it)
virtual double cotTh(state_t s) const
virtual double tanTh() const
tan theta
virtual double pt() const
transverse momentum
virtual ChargeType charge() const
returns charge as a typedef ChargeType currently Charge Type is a double for jets this may be changed...
virtual double p2() const
square of momentum magnitude
virtual double m2() const
mass squared
int nStates()
access the number of state
virtual double sinPhi() const
sinus phi
AthenaBarCode_t getAthenaBarCode() const
AthenaBarCode_t AthenaBarCodeVersion_t
std::ostream & operator<<(std::ostream &out, const ParticleSigStateImpl< INavigable_t, I4Momentum_t, IParticle_t > &p4)
virtual void set_origin(const VxContainer *theContainer, int index)
virtual double et(state_t s) const
virtual void fillToken(INavigationToken &thisToken, const std::any &weight) const
virtual void set4Mom(const CLHEP::HepLorentzVector &hlv, state_t s)
virtual double cosTh() const
cosinus theta
virtual double cosTh(state_t s) const
virtual double pz() const
z component of momentum
Define macros for attributes used to control the static checker.
IParticle_t m_part
The particle-id part.
virtual void set4Mom(const I4Momentum &p4, state_t s)
virtual I4Momentum::Kind kind() const
add Kind which tells what kind (P4XYZ) the underlying implementation has
virtual double p(state_t s) const
virtual void set_pdgId(int x)
virtual double cotTh() const
cottan theta
virtual void set4Mom(const I4Momentum &p4)
set 4Momentum (will throw exception if cannot be implemented)