ATLAS Offline Software
Loading...
Searching...
No Matches
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
 StepInfo (const StepInfo &first, const StepInfo &second)
void setP (const CLHEP::Hep3Vector &p)
 set position
void setX (const double x)
 set x position
void setY (const double y)
 set y position
void setZ (const double z)
 set z position
void setE (const double t)
 set depoisted energy
void setTime (const double t)
 set time
void setValid (const bool flag)
 set validity
CLHEP::Hep3Vector position () const
 return spacial position
double x () const
 return x position
double y () const
 return y position
double z () const
 return z position
double dep () const
 return deposited energy
double time () const
 return time of hit
bool valid () const
 return validity flag
double diff2 (const StepInfo &other) const
 return spactial distance squared
StepInfooperator+= (const StepInfo &other)
 energy weighted sum

Private Attributes

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

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) {}
double m_dep
deposited energy
Definition StepInfo.h:88
bool m_valid
flag, if hit is valid
Definition StepInfo.h:90
double m_time
time
Definition StepInfo.h:89

◆ 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 }
CLHEP::Hep3Vector m_pos
spatial position
Definition StepInfo.h:87
bool first
Definition DeMoScan.py:534

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 }
double diff2(const StepInfo &other) const
return spactial distance squared
Definition StepInfo.h:113
CLHEP::Hep3Vector position() const
return spacial position
Definition StepInfo.h:62

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

◆ setP()

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

set position

Definition at line 47 of file StepInfo.h.

◆ 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; }
bool flag
Definition master.py:29

◆ 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); }
double x() const
return x position
Definition StepInfo.h:64

◆ 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); }
double y() const
return y position
Definition StepInfo.h:66

◆ 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); }
double z() const
return z position
Definition StepInfo.h:68

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