ATLAS Offline Software
Public Member Functions | Private Attributes | List of all members
ShowerLib::StepInfo Class Reference

Class to collect information about G4 steps. More...

#include <StepInfo.h>

Collaboration diagram for ShowerLib::StepInfo:

Public Member Functions

 StepInfo ()
 empty default constructor More...
 
 StepInfo (const StepInfo &first, const StepInfo &second)
 
void setP (const CLHEP::Hep3Vector &p)
 set position More...
 
void setX (const double x)
 set x position More...
 
void setY (const double y)
 set y position More...
 
void setZ (const double z)
 set z position More...
 
void setE (const double t)
 set depoisted energy More...
 
void setTime (const double t)
 set time More...
 
void setValid (const bool flag)
 set validity More...
 
CLHEP::Hep3Vector position () const
 return spacial position More...
 
double x () const
 return x position More...
 
double y () const
 return y position More...
 
double z () const
 return z position More...
 
double dep () const
 return deposited energy More...
 
double time () const
 return time of hit More...
 
bool valid () const
 return validity flag More...
 
double diff2 (const StepInfo &other) const
 return spactial distance squared More...
 
StepInfooperator+= (const StepInfo &other)
 energy weighted sum More...
 

Private Attributes

CLHEP::Hep3Vector m_pos
 spatial position More...
 
double m_dep
 deposited energy More...
 
double m_time
 time More...
 
bool m_valid
 flag, if hit is valid More...
 

Detailed Description

Class to collect information about G4 steps.

   This class is designed to transfer hit information,
   i.e. position, energy deposition and time, from
   G4 simulation to the clustering algorithm
Author
Wolfgang Ehrenfeld, University of Hamburg, Germany
Sasha Glazov, DESY Hamburg, Germany
Version
Id
StepInfo.h 511332 2012-07-25 16:15:07Z ssnyder

Definition at line 34 of file StepInfo.h.

Constructor & Destructor Documentation

◆ StepInfo() [1/2]

ShowerLib::StepInfo::StepInfo ( )
inline

empty default constructor

Definition at line 40 of file StepInfo.h.

40 : m_dep(0.), m_time(0.), m_valid(true) {}

◆ StepInfo() [2/2]

ShowerLib::StepInfo::StepInfo ( const StepInfo first,
const StepInfo second 
)
inline

Definition at line 96 of file StepInfo.h.

97  {
98  double esum = first.m_dep + second.m_dep;
99  double w1 = 0;
100  double w2 = 0;
101 
102  if (esum > 0) {
103  w1 = first.m_dep/esum;
104  w2 = second.m_dep/esum;
105  }
106 
107  m_pos = w1*first.m_pos + w2*second.m_pos;
108  m_time = w1*first.m_time + w2*second.m_time;
109  m_dep = esum;
110  m_valid = true;
111  }

Member Function Documentation

◆ dep()

double ShowerLib::StepInfo::dep ( ) const
inline

return deposited energy

Definition at line 70 of file StepInfo.h.

70 { return m_dep; }

◆ diff2()

double ShowerLib::StepInfo::diff2 ( const StepInfo other) const
inline

return spactial distance squared

Definition at line 113 of file StepInfo.h.

114  {
115  return (this->position().diff2(other.position()));
116  }

◆ operator+=()

StepInfo & ShowerLib::StepInfo::operator+= ( const StepInfo other)
inline

energy weighted sum

Definition at line 118 of file StepInfo.h.

119  {
120  double esum = m_dep + other.m_dep;
121  double w1 = 0;
122  double w2 = 0;
123 
124  if (esum > 0) {
125  w1 = m_dep/esum;
126  w2 = other.m_dep/esum;
127  } else {
128  std::cout << "Error: hit combination: sum of deposited energy is zero!" << std::endl;
129  }
130 
131  m_pos = w1*m_pos + w2*other.m_pos;
132  m_dep += other.m_dep;
133 
134  return *this;
135  }

◆ position()

CLHEP::Hep3Vector ShowerLib::StepInfo::position ( ) const
inline

return spacial position

Definition at line 62 of file StepInfo.h.

62 { return m_pos; }

◆ setE()

void ShowerLib::StepInfo::setE ( const double  t)
inline

set depoisted energy

Definition at line 55 of file StepInfo.h.

55 { m_dep = t; }

◆ setP()

void ShowerLib::StepInfo::setP ( const CLHEP::Hep3Vector &  p)
inline

set position

Definition at line 47 of file StepInfo.h.

47 { m_pos = p; }

◆ setTime()

void ShowerLib::StepInfo::setTime ( const double  t)
inline

set time

Definition at line 57 of file StepInfo.h.

57 { m_time = t; }

◆ setValid()

void ShowerLib::StepInfo::setValid ( const bool  flag)
inline

set validity

Definition at line 59 of file StepInfo.h.

59 { m_valid = flag; }

◆ setX()

void ShowerLib::StepInfo::setX ( const double  x)
inline

set x position

Definition at line 49 of file StepInfo.h.

49 { return m_pos.setX(x); }

◆ setY()

void ShowerLib::StepInfo::setY ( const double  y)
inline

set y position

Definition at line 51 of file StepInfo.h.

51 { return m_pos.setY(y); }

◆ setZ()

void ShowerLib::StepInfo::setZ ( const double  z)
inline

set z position

Definition at line 53 of file StepInfo.h.

53 { return m_pos.setZ(z); }

◆ time()

double ShowerLib::StepInfo::time ( ) const
inline

return time of hit

Definition at line 72 of file StepInfo.h.

72 { return m_time; }

◆ valid()

bool ShowerLib::StepInfo::valid ( ) const
inline

return validity flag

Definition at line 74 of file StepInfo.h.

74 { return m_valid; }

◆ x()

double ShowerLib::StepInfo::x ( ) const
inline

return x position

Definition at line 64 of file StepInfo.h.

64 { return m_pos.x(); }

◆ y()

double ShowerLib::StepInfo::y ( ) const
inline

return y position

Definition at line 66 of file StepInfo.h.

66 { return m_pos.y(); }

◆ z()

double ShowerLib::StepInfo::z ( ) const
inline

return z position

Definition at line 68 of file StepInfo.h.

68 { return m_pos.z(); }

Member Data Documentation

◆ m_dep

double ShowerLib::StepInfo::m_dep
private

deposited energy

Definition at line 88 of file StepInfo.h.

◆ m_pos

CLHEP::Hep3Vector ShowerLib::StepInfo::m_pos
private

spatial position

Definition at line 87 of file StepInfo.h.

◆ m_time

double ShowerLib::StepInfo::m_time
private

time

Definition at line 89 of file StepInfo.h.

◆ m_valid

bool ShowerLib::StepInfo::m_valid
private

flag, if hit is valid

Definition at line 90 of file StepInfo.h.


The documentation for this class was generated from the following file:
python.SystemOfUnits.second
int second
Definition: SystemOfUnits.py:120
python.PerfMonSerializer.p
def p
Definition: PerfMonSerializer.py:743
ShowerLib::StepInfo::position
CLHEP::Hep3Vector position() const
return spacial position
Definition: StepInfo.h:62
ShowerLib::StepInfo::m_dep
double m_dep
deposited energy
Definition: StepInfo.h:88
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
ShowerLib::StepInfo::m_pos
CLHEP::Hep3Vector m_pos
spatial position
Definition: StepInfo.h:87
ShowerLib::StepInfo::m_valid
bool m_valid
flag, if hit is valid
Definition: StepInfo.h:90
ShowerLib::StepInfo::y
double y() const
return y position
Definition: StepInfo.h:66
master.flag
bool flag
Definition: master.py:29
ShowerLib::StepInfo::x
double x() const
return x position
Definition: StepInfo.h:64
InDetDD::other
@ other
Definition: InDetDD_Defs.h:16
DeMoScan.first
bool first
Definition: DeMoScan.py:534
ShowerLib::StepInfo::diff2
double diff2(const StepInfo &other) const
return spactial distance squared
Definition: StepInfo.h:113
ShowerLib::StepInfo::z
double z() const
return z position
Definition: StepInfo.h:68
ShowerLib::StepInfo::m_time
double m_time
time
Definition: StepInfo.h:89