ATLAS Offline Software
Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
CaloCompositeKineBase Class Referenceabstract

base class for kinematics of composite calo object More...

#include <CaloCompositeKineBase.h>

Inheritance diagram for CaloCompositeKineBase:
Collaboration diagram for CaloCompositeKineBase:

Public Types

enum  Kind {
  P4EETAPHIM, P4IPTCOTTHPHIM, P4PTETAPHIM, P4PXPYPZE,
  UNKNOWN
}
 

Public Member Functions

virtual ~CaloCompositeKineBase ()
 Destructor. More...
 
virtual double energy () const
 Return energy. More...
 
double energy_nonvirt () const
 Return energy (nonvirtual version) More...
 
void setRecoStatus (const CaloRecoStatus &recStatus)
 Set the reconstruction status. More...
 
void setRecoStatus (const CaloRecoStatus::StatusIndicator &recIndic)
 Set the reconstruction status indicator (recommended) More...
 
bool checkRecoStatus (const CaloRecoStatus::StatusIndicator &recIndic) const
 Check if a given indicator is set. More...
 
void removeRecoStatus (const CaloRecoStatus::StatusIndicator &recIndic)
 Remove a given indicator. More...
 
void removeRecoStatus ()
 Remove all indicators. More...
 
const CaloRecoStatusgetRecoStatus () const
 Retrieve the reconstruction status. More...
 
virtual double getBasicEnergy () const =0
 Return uncalibrated energy. More...
 
virtual void setBasicEnergy (double theEnergy)=0
 Set uncalibrated energy. More...
 
virtual double e () const
 get energy data member More...
 
virtual double eta () const
 get eta data member More...
 
virtual double phi () const
 get phi data member More...
 
virtual double m () const
 get mass data member More...
 
virtual void setE (double theE)
 set energy data member More...
 
virtual void setEta (double theEta)
 set eta data member More...
 
virtual void setPhi (double thePhi)
 set phi data member More...
 
virtual void setM (double theM)
 set mass 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 a CLHEP HepLorentzVector More...
 
virtual const I4MomentumErrorerrors () const
 Access to errors, if available; returns 0 if no errors. More...
 
virtual double px () const
 x component of momentum More...
 
virtual double py () const
 y component of momentum More...
 
virtual double pz () const
 z component of momentum More...
 
virtual double et () const
 transverse energy defined to be e*sin(theta) More...
 
virtual double p () const
 magnitude of 3-momentum. More...
 
virtual double p2 () const
 square of momentum magnitude More...
 
virtual double m2 () const
 mass squared More...
 
virtual double pt () const
 transverse momentum 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 cotTh () const
 cottan theta More...
 
virtual double cosTh () const
 cosinus theta More...
 
virtual double sinTh () const
 sinus theta More...
 
virtual double tanTh () const
 tan theta More...
 
virtual CLHEP::HepLorentzVector hlv () const
 HepLorentzVector Special implementation from Frank Paige : if negative energy, points in opposite direction but eta and phi still the same
More...
 
I4Momentum::Kind kind () const
 tells what kind of P4XYZT this is More...
 
virtual std::ostream & dump (std::ostream &out=std::cout) const
 Print I4Momentum content. More...
 

Protected Member Functions

 CaloCompositeKineBase ()
 Constructor. More...
 

Protected Attributes

CaloRecoStatus m_status
 Calorimeter reconstruction status. More...
 
double m_e
 
double m_eta
 
double m_phi
 
double m_m
 

Detailed Description

base class for kinematics of composite calo object

Abstract base class provides a complete interface to all kinematic quantities available for composite calorimeter reconstruction objects. This class basically extends the P4EEtaPhiM base class.

Definition at line 12 of file CaloCompositeKineBase.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

◆ ~CaloCompositeKineBase()

CaloCompositeKineBase::~CaloCompositeKineBase ( )
virtual

Destructor.

Definition at line 13 of file CaloCompositeKineBase.cxx.

14 { }

◆ CaloCompositeKineBase()

CaloCompositeKineBase::CaloCompositeKineBase ( )
protected

Constructor.

All kinematic variables are reset when constructed.

Definition at line 8 of file CaloCompositeKineBase.cxx.

9  : P4EEtaPhiM(0.,0.,0.,0.),
11 { }

Member Function Documentation

◆ checkRecoStatus()

bool CaloCompositeKineBase::checkRecoStatus ( const CaloRecoStatus::StatusIndicator recIndic) const
inline

Check if a given indicator is set.

Definition at line 91 of file CaloCompositeKineBase.h.

93 { return m_status.checkStatus(recIndic); }

◆ cosPhi()

double P4EEtaPhiMBase::cosPhi ( ) const
virtualinherited

cosinus phi

Implements I4Momentum.

Reimplemented in CaloCell, and CaloVertexedCell.

Definition at line 54 of file P4EEtaPhiMBase.cxx.

55 {
56  return std::cos(this->phi());
57 }

◆ cosTh()

double P4EEtaPhiMBase::cosTh ( ) const
virtualinherited

cosinus theta

Implements I4Momentum.

Reimplemented in CaloCell, and CaloVertexedCell.

Definition at line 82 of file P4EEtaPhiMBase.cxx.

83 {
84  return std::tanh(this->eta());
85 }

◆ cotTh()

double P4EEtaPhiMBase::cotTh ( ) const
virtualinherited

cottan theta

Implements I4Momentum.

Reimplemented in CaloCell.

Definition at line 77 of file P4EEtaPhiMBase.cxx.

78 {
79  return std::sinh(this->eta());
80 }

◆ dump()

std::ostream & P4EEtaPhiMBase::dump ( std::ostream &  out = std::cout) const
virtualinherited

Print I4Momentum content.

Implements I4Momentum.

Definition at line 159 of file P4EEtaPhiMBase.cxx.

160 {
161 
162  std::stringstream outx;
163  outx << "[e,eta,phi,m] ="
164  << std::right << std::scientific << std::setprecision(8)
165  << std::setw(16) << this->e()
166  << std::setw(16) << this->eta()
167  << std::setw(16) << this->phi()
168  << std::setw(16) << this->m();
169 
170  out<<outx.str();
171 
172  return out;
173 }

◆ e()

double P4EEtaPhiM::e ( ) const
inlinevirtualinherited

get energy data member

Implements I4Momentum.

Reimplemented in CaloTower, and CaloCluster.

Definition at line 102 of file P4EEtaPhiM.h.

103 { return m_e;}

◆ energy()

double CaloCompositeKineBase::energy ( ) const
inlinevirtual

Return energy.

Definition at line 70 of file CaloCompositeKineBase.h.

71 { return this->e(); }

◆ energy_nonvirt()

double CaloCompositeKineBase::energy_nonvirt ( ) const
inline

Return energy (nonvirtual version)

Definition at line 74 of file CaloCompositeKineBase.h.

75 { return this->m_e; }

◆ errors()

const I4MomentumError * P4EEtaPhiM::errors ( ) const
virtualinherited

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

Reimplemented from P4EEtaPhiMBase.

Definition at line 15 of file P4EEtaPhiM.cxx.

16 {
17  return 0;
18 }

◆ et()

double P4EEtaPhiMBase::et ( ) const
virtualinherited

transverse energy defined to be e*sin(theta)

Implements I4Momentum.

Reimplemented in CaloCell.

Definition at line 106 of file P4EEtaPhiMBase.cxx.

107  {
108  return this->e()*this->sinTh();
109  }

◆ eta()

double P4EEtaPhiM::eta ( ) const
inlinevirtualinherited

get eta data member

Implements I4Momentum.

Reimplemented in CaloTower, and CaloCluster.

Definition at line 105 of file P4EEtaPhiM.h.

106 { return m_eta;}

◆ getBasicEnergy()

virtual double CaloCompositeKineBase::getBasicEnergy ( ) const
pure virtual

Return uncalibrated energy.

Implemented in CaloCluster.

◆ getRecoStatus()

const CaloRecoStatus & CaloCompositeKineBase::getRecoStatus ( ) const
inline

Retrieve the reconstruction status.

Definition at line 78 of file CaloCompositeKineBase.h.

79 { return m_status; }

◆ hlv()

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

HepLorentzVector Special implementation from Frank Paige : if negative energy, points in opposite direction but eta and phi still the same

Implements I4Momentum.

Reimplemented in CaloCluster.

Definition at line 134 of file P4EEtaPhiMBase.cxx.

135 {
136  //minimize the number of calculation and dereference
137  const double theCosTh=this->cosTh();
138 
139  // DR from Frank Paige
140  // negative energy point in opposite direction
141  // BUT Eta and Phi still the same
142  // double theP=theE;
143 
144  const double theP=this->p();
145 
146  const double theSinTh=std::sqrt(1.-theCosTh*theCosTh);
147  const double thePt=theP*theSinTh;
148  const double thePx=thePt*this->cosPhi();
149  const double thePy=thePt*this->sinPhi();
150  const double thePz=theP*theCosTh;
151 
152 
153  return CLHEP::HepLorentzVector(thePx,thePy,thePz,this->e());
154 
155 }

◆ iPt()

double P4EEtaPhiMBase::iPt ( ) const
virtualinherited

inverse of transverse momentum

Implements I4Momentum.

Definition at line 111 of file P4EEtaPhiMBase.cxx.

112  { return 1./this->pt();
113  }

◆ kind()

I4Momentum::Kind P4EEtaPhiMBase::kind ( ) const
inlinevirtualinherited

tells what kind of P4XYZT this is

Implements I4Momentum.

Definition at line 65 of file P4EEtaPhiMBase.h.

65 { return I4Momentum::P4EETAPHIM; };

◆ m()

double P4EEtaPhiM::m ( ) const
inlinevirtualinherited

get mass data member

Implements I4Momentum.

Reimplemented in CaloTower, and CaloCluster.

Definition at line 111 of file P4EEtaPhiM.h.

112 { return m_m;}

◆ m2()

double P4EEtaPhiMBase::m2 ( ) const
virtualinherited

mass squared

Implements I4Momentum.

Definition at line 14 of file P4EEtaPhiMBase.cxx.

14  {
15  const double theM = this->m();
16  return theM*theM;
17 }

◆ p()

double P4EEtaPhiMBase::p ( ) const
virtualinherited

magnitude of 3-momentum.

Special implementation from Frank Paige : if negative energy p is negative but eta and phi still the same.

Implements I4Momentum.

Definition at line 21 of file P4EEtaPhiMBase.cxx.

22 {
23  const double theM=this->m();
24  const double theE=this->e();
25  // if (theM==0.) return theE ;
26  // else return sqrt(theE*theE-theM*theM);
27  //DR from Frank Paige
28  // if negative energy point in the opposite direction
29  // BUT eta and phi still the same !!!
30  if (theM==0.) {
31  return theE;
32  } else {
33  double eSign = (theE >= 0) ? +1 : -1;
34  return eSign*std::sqrt(theE*theE-theM*theM);
35  }
36 
37 }

◆ p2()

double P4EEtaPhiMBase::p2 ( ) const
virtualinherited

square of momentum magnitude

This p2() implementaion is derived from the (somewhat unusual) Frank Paige implementation used to calculate p() above. What we do is look at what would happen if we were to square the answer returned by Frank's algorithm:

(1) The "eSign" would square to +1 and disappear, (2) The sqrt would disappear leaving theE*theE-theM*theM (3) In the event that theM==0, this theE*theE would indeed still equal theE*theE-theM*theM, so we simply return this quantity.

Implements I4Momentum.

Definition at line 39 of file P4EEtaPhiMBase.cxx.

40 {
48  const double theM=this->m();
49  const double theE=this->e();
50 
51  return theE*theE-theM*theM;
52 }

◆ phi()

double P4EEtaPhiM::phi ( ) const
inlinevirtualinherited

get phi data member

Implements I4Momentum.

Reimplemented in CaloTower, and CaloCluster.

Definition at line 108 of file P4EEtaPhiM.h.

109 { return m_phi;}

◆ pt()

double P4EEtaPhiMBase::pt ( ) const
virtualinherited

transverse momentum

Implements I4Momentum.

Definition at line 101 of file P4EEtaPhiMBase.cxx.

102  {
103  return this->p()*this->sinTh();
104  }

◆ px()

double P4EEtaPhiMBase::px ( ) const
virtualinherited

x component of momentum

Implements I4Momentum.

Definition at line 122 of file P4EEtaPhiMBase.cxx.

123  { return this->pt()*this->cosPhi();
124  }

◆ py()

double P4EEtaPhiMBase::py ( ) const
virtualinherited

y component of momentum

Implements I4Momentum.

Definition at line 126 of file P4EEtaPhiMBase.cxx.

127  { return this->pt()*this->sinPhi();
128  }

◆ pz()

double P4EEtaPhiMBase::pz ( ) const
virtualinherited

z component of momentum

Implements I4Momentum.

Definition at line 130 of file P4EEtaPhiMBase.cxx.

131  { return this->p()*this->cosTh();
132  }

◆ rapidity()

double P4EEtaPhiMBase::rapidity ( ) const
virtualinherited

rapidity

Implements I4Momentum.

Definition at line 115 of file P4EEtaPhiMBase.cxx.

116  {
117  const double theE=this->e();
118  const double thePz=this->pz();
119  return 0.5*std::log((theE+thePz)/(theE-thePz));
120  }

◆ removeRecoStatus() [1/2]

void CaloCompositeKineBase::removeRecoStatus ( )
inline

Remove all indicators.

Definition at line 101 of file CaloCompositeKineBase.h.

102 { m_status.resetStatus(); }

◆ removeRecoStatus() [2/2]

void CaloCompositeKineBase::removeRecoStatus ( const CaloRecoStatus::StatusIndicator recIndic)
inline

Remove a given indicator.

Definition at line 96 of file CaloCompositeKineBase.h.

98 { m_status.resetStatus(recIndic); }

◆ set4Mom() [1/3]

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

set all 4-mom from a CLHEP HepLorentzVector

Reimplemented from P4EEtaPhiMBase.

Reimplemented in CaloCluster.

Definition at line 139 of file P4EEtaPhiM.h.

140 {
141  m_e=theHlv.e();
142  m_eta=theHlv.eta();
143  //FIXME protect against negative energy
144  //assert(m_e >= 0,"P4EEtaPhiM::set4Mom cannot have negative energy");
145  //assert(m_e >= 0);
146  // FIXME of the FIXME in fact it is not necessary to prtoect against negative energy
147  // and besides Seal assert does not work
148  // ASSERT( m_e >= 0 );
149  m_phi=theHlv.phi();
150  m_m=theHlv.m();
151 
152 
153 }

◆ set4Mom() [2/3]

void P4EEtaPhiM::set4Mom ( const I4Momentum theI4Mom)
inlinevirtualinherited

set all 4-mom from another I4Momentum reference

Reimplemented from P4EEtaPhiMBase.

Reimplemented in CaloCluster.

Definition at line 126 of file P4EEtaPhiM.h.

127 {
128  m_e=theI4Mom.e();
129  m_eta=theI4Mom.eta();
130  m_phi=theI4Mom.phi();
131  m_m=theI4Mom.m();
132 }

◆ set4Mom() [3/3]

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

set all 4-mom from another I4Momentum pointer

Reimplemented from P4EEtaPhiMBase.

Reimplemented in CaloCluster.

Definition at line 134 of file P4EEtaPhiM.h.

135 {
136  this->set4Mom(*theI4Mom);
137 }

◆ setBasicEnergy()

virtual void CaloCompositeKineBase::setBasicEnergy ( double  theEnergy)
pure virtual

Set uncalibrated energy.

Parameters
theEnergybasic energy signal

Implemented in CaloCluster.

◆ setE()

void P4EEtaPhiM::setE ( double  theE)
inlinevirtualinherited

set energy data member

Reimplemented in CaloCluster.

Definition at line 114 of file P4EEtaPhiM.h.

115 { m_e = theE;}

◆ setEta()

void P4EEtaPhiM::setEta ( double  theEta)
inlinevirtualinherited

set eta data member

Reimplemented in CaloCluster.

Definition at line 117 of file P4EEtaPhiM.h.

118 { m_eta = theEta;}

◆ setM()

void P4EEtaPhiM::setM ( double  theM)
inlinevirtualinherited

set mass data member

Reimplemented in CaloCluster.

Definition at line 123 of file P4EEtaPhiM.h.

124 { m_m = theM;}

◆ setPhi()

void P4EEtaPhiM::setPhi ( double  thePhi)
inlinevirtualinherited

set phi data member

Reimplemented in CaloCluster.

Definition at line 120 of file P4EEtaPhiM.h.

121 { m_phi = thePhi;}

◆ setRecoStatus() [1/2]

void CaloCompositeKineBase::setRecoStatus ( const CaloRecoStatus recStatus)
inline

Set the reconstruction status.

Definition at line 82 of file CaloCompositeKineBase.h.

83 { m_status = theStatus; }

◆ setRecoStatus() [2/2]

void CaloCompositeKineBase::setRecoStatus ( const CaloRecoStatus::StatusIndicator recIndic)
inline

Set the reconstruction status indicator (recommended)

Definition at line 86 of file CaloCompositeKineBase.h.

88 { m_status.setStatus(recIndic); }

◆ sinPhi()

double P4EEtaPhiMBase::sinPhi ( ) const
virtualinherited

sinus phi

Implements I4Momentum.

Reimplemented in CaloCell, and CaloVertexedCell.

Definition at line 59 of file P4EEtaPhiMBase.cxx.

60 {
61  return std::sin(this->phi());
62 }

◆ sinTh()

double P4EEtaPhiMBase::sinTh ( ) const
virtualinherited

sinus theta

Implements I4Momentum.

Reimplemented in CaloCell, and CaloVertexedCell.

Definition at line 87 of file P4EEtaPhiMBase.cxx.

88 {
89  // avoid numeric overflow if very large eta
90 
91  double aEta=std::abs(this->eta());
92  if ( aEta>710) {
93  aEta=710;
94  }
95 
96  return 1./std::cosh(aEta);
97 
98 }

◆ tanTh()

double P4EEtaPhiMBase::tanTh ( ) const
virtualinherited

tan theta

Implements I4Momentum.

Definition at line 64 of file P4EEtaPhiMBase.cxx.

65 {
66  // avoid numeric overflow if very large eta
67 
68  double theEta=this->eta();
69  if ( std::abs(theEta)>710) {
70  theEta=theEta>0 ? 710 : -710;
71  return 1./std::sinh(theEta);
72  }
73 
74  return 1./this->cotTh();
75 }

Member Data Documentation

◆ m_e

double P4EEtaPhiM::m_e
protectedinherited

Definition at line 75 of file P4EEtaPhiM.h.

◆ m_eta

double P4EEtaPhiM::m_eta
protectedinherited

Definition at line 76 of file P4EEtaPhiM.h.

◆ m_m

double P4EEtaPhiM::m_m
protectedinherited

Definition at line 78 of file P4EEtaPhiM.h.

◆ m_phi

double P4EEtaPhiM::m_phi
protectedinherited

Definition at line 77 of file P4EEtaPhiM.h.

◆ m_status

CaloRecoStatus CaloCompositeKineBase::m_status
protected

Calorimeter reconstruction status.

Definition at line 58 of file CaloCompositeKineBase.h.


The documentation for this class was generated from the following files:
P4EEtaPhiMBase::cotTh
virtual double cotTh() const
cottan theta
Definition: P4EEtaPhiMBase.cxx:77
P4EEtaPhiMBase::pz
virtual double pz() const
z component of momentum
Definition: P4EEtaPhiMBase.cxx:130
P4EEtaPhiMBase::pt
virtual double pt() const
transverse momentum
Definition: P4EEtaPhiMBase.cxx:101
CaloRecoStatus::resetStatus
virtual void resetStatus()
reset reconstruction status
Definition: CaloRecoStatus.h:122
CaloRecoStatus::setStatus
virtual void setStatus(const StatusIndicator &statusIndicator)
Set status.
Definition: CaloRecoStatus.h:107
P4EEtaPhiM::set4Mom
virtual void set4Mom(const I4Momentum &theI4Mom)
set all 4-mom from another I4Momentum reference
Definition: P4EEtaPhiM.h:126
P4EEtaPhiMBase::cosPhi
virtual double cosPhi() const
cosinus phi
Definition: P4EEtaPhiMBase.cxx:54
I4Momentum::P4IPTCOTTHPHIM
@ P4IPTCOTTHPHIM
Definition: I4Momentum.h:33
python.AthDsoLogger.out
out
Definition: AthDsoLogger.py:71
P4EEtaPhiM::m_e
double m_e
Definition: P4EEtaPhiM.h:75
drawFromPickle.cos
cos
Definition: drawFromPickle.py:36
P4EEtaPhiM::e
virtual double e() const
get energy data member
Definition: P4EEtaPhiM.h:102
P4EEtaPhiM::m_m
double m_m
Definition: P4EEtaPhiM.h:78
I4Momentum::e
virtual double e() const =0
energy
P4EEtaPhiMBase::cosTh
virtual double cosTh() const
cosinus theta
Definition: P4EEtaPhiMBase.cxx:82
I4Momentum::eta
virtual double eta() const =0
pseudo rapidity
I4Momentum::phi
virtual double phi() const =0
phi in [-pi,pi[
I4Momentum::P4PTETAPHIM
@ P4PTETAPHIM
Definition: I4Momentum.h:33
CaloRecoStatus::checkStatus
virtual bool checkStatus(const StatusIndicator &statusIndicator) const
Check status.
Definition: CaloRecoStatus.h:117
I4Momentum::UNKNOWN
@ UNKNOWN
Definition: I4Momentum.h:33
CaloCompositeKineBase::m_status
CaloRecoStatus m_status
Calorimeter reconstruction status.
Definition: CaloCompositeKineBase.h:58
P4EEtaPhiMBase::p
virtual double p() const
magnitude of 3-momentum.
Definition: P4EEtaPhiMBase.cxx:21
I4Momentum::m
virtual double m() const =0
mass
P4EEtaPhiMBase::sinTh
virtual double sinTh() const
sinus theta
Definition: P4EEtaPhiMBase.cxx:87
P4EEtaPhiMBase::sinPhi
virtual double sinPhi() const
sinus phi
Definition: P4EEtaPhiMBase.cxx:59
python.CaloCondTools.log
log
Definition: CaloCondTools.py:20
P4EEtaPhiM::P4EEtaPhiM
P4EEtaPhiM()
default constructor
Definition: P4EEtaPhiM.h:82
drawFromPickle.sin
sin
Definition: drawFromPickle.py:36
P4EEtaPhiM::m_phi
double m_phi
Definition: P4EEtaPhiM.h:77
I4Momentum::P4EETAPHIM
@ P4EETAPHIM
Definition: I4Momentum.h:33
CaloRecoStatus
reconstruction status indicator
Definition: CaloRecoStatus.h:12
I4Momentum::P4PXPYPZE
@ P4PXPYPZE
Definition: I4Momentum.h:33
P4EEtaPhiM::m_eta
double m_eta
Definition: P4EEtaPhiM.h:76