ATLAS Offline Software
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
ShowerLib::IShowerLib Class Referenceabstract

Class for shower library shower lib interface. More...

#include <IShowerLib.h>

Inheritance diagram for ShowerLib::IShowerLib:
Collaboration diagram for ShowerLib::IShowerLib:

Public Member Functions

virtual ~IShowerLib ()
 empty destructor More...
 
virtual std::vector< EnergySpot > * getShower (const G4Track *track, ShowerLibStatistics *stats, int randomShift) const =0
 get shower for given G4 track More...
 
virtual double getContainmentZ (const G4Track *track) const =0
 get average length of showers for the given energy More...
 
virtual double getContainmentR (const G4Track *track) const =0
 get average lateral spread of the showers for the given energy More...
 
virtual bool storeShower (HepMC::ConstGenParticlePtr genParticle, const Shower *shower)=0
 store shower in the library More...
 
virtual bool writeToROOT (TFile *dest)=0
 write library to ROOT file More...
 
virtual ShowerLibStatisticscreateStatistics () const =0
 
const std::string statistics () const
 print library statistics More...
 
virtual const std::string detector () const
 get detector tag More...
 
virtual int particle_id () const
 get particle tag More...
 
virtual const std::string release () const
 get Release tag More...
 
virtual void release (const std::string &release)
 set Release tag More...
 
virtual const std::string geometry () const
 get Geometry tag More...
 
virtual void geometry (const std::string &geometry)
 set Geometry tag More...
 
virtual const std::string geantVersion () const
 get geant version tag More...
 
virtual void geantVersion (const std::string &version)
 set geant version tag More...
 
virtual const std::string physicsList () const
 get geant 4 physics list name More...
 
virtual void physicsList (const std::string &list)
 set geant 4 physics list name More...
 
virtual const std::string comment () const
 get comment More...
 
virtual void comment (const std::string &comment)
 set given string as comment More...
 
virtual void addComment (const std::string &comment)
 add given string to comment More...
 
virtual const std::string getName () const
 

Protected Member Functions

 IShowerLib ()
 default constructor More...
 
bool readMeta (TTree *source)
 read metadata from the given TTree More...
 
bool writeMeta (TTree *dest) const
 write metadata to the given TTree More...
 
virtual const std::string printParameters () const =0
 

Protected Attributes

std::string m_detector
 name of the detector More...
 
int m_particle
 ID of the generated particles. More...
 
std::string m_release
 atlas software release More...
 
std::string m_geometry
 atlas geometry version More...
 
std::string m_geantVersion
 geant 4 version More...
 
std::string m_physicsList
 used geant 4 physics list More...
 
std::string m_comment
 comment More...
 
bool m_filled
 is the library read from ROOT or from structure file More...
 

Detailed Description

Class for shower library shower lib interface.

   Define interface for top level shower library access
Author
Wolfgang Ehrenfeld, University of Hamburg, Germany
Sasha Glazov, DESY Hamburg, Germany
Version
$Id: IShowerLib.h 576158 2013-12-18 16:58:58Z gsedov $

Definition at line 40 of file IShowerLib.h.

Constructor & Destructor Documentation

◆ ~IShowerLib()

virtual ShowerLib::IShowerLib::~IShowerLib ( )
inlinevirtual

empty destructor

Definition at line 45 of file IShowerLib.h.

45 {}

◆ IShowerLib()

ShowerLib::IShowerLib::IShowerLib ( )
inlineprotected

default constructor

Definition at line 98 of file IShowerLib.h.

98 : m_detector("NotSet"), m_particle(0), m_release("NotSet"), m_geometry("NotSet"), m_geantVersion("NotSet"), m_physicsList("NotSet"), m_filled(false) {}

Member Function Documentation

◆ addComment()

void ShowerLib::IShowerLib::addComment ( const std::string &  comment)
inlinevirtual

add given string to comment

Definition at line 141 of file IShowerLib.h.

141 { m_comment += comment; }

◆ comment() [1/2]

const std::string ShowerLib::IShowerLib::comment ( ) const
inlinevirtual

get comment

Definition at line 139 of file IShowerLib.h.

139 { return m_comment; }

◆ comment() [2/2]

void ShowerLib::IShowerLib::comment ( const std::string &  comment)
inlinevirtual

set given string as comment

Definition at line 140 of file IShowerLib.h.

140 { m_comment = comment; }

◆ createStatistics()

virtual ShowerLibStatistics* ShowerLib::IShowerLib::createStatistics ( ) const
pure virtual

◆ detector()

const std::string ShowerLib::IShowerLib::detector ( ) const
inlinevirtual

get detector tag

Definition at line 121 of file IShowerLib.h.

121 { return m_detector; }

◆ geantVersion() [1/2]

const std::string ShowerLib::IShowerLib::geantVersion ( ) const
inlinevirtual

get geant version tag

Definition at line 133 of file IShowerLib.h.

133 { return m_geantVersion; }

◆ geantVersion() [2/2]

void ShowerLib::IShowerLib::geantVersion ( const std::string &  version)
inlinevirtual

set geant version tag

Definition at line 134 of file IShowerLib.h.

134 { m_geantVersion = version; }

◆ geometry() [1/2]

const std::string ShowerLib::IShowerLib::geometry ( ) const
inlinevirtual

get Geometry tag

Definition at line 130 of file IShowerLib.h.

130 { return m_geometry; }

◆ geometry() [2/2]

void ShowerLib::IShowerLib::geometry ( const std::string &  geometry)
inlinevirtual

set Geometry tag

Definition at line 131 of file IShowerLib.h.

131 { m_geometry = geometry; }

◆ getContainmentR()

virtual double ShowerLib::IShowerLib::getContainmentR ( const G4Track *  track) const
pure virtual

get average lateral spread of the showers for the given energy

Implemented in ShowerLib::FCALDistEtaEnergyShowerLib, ShowerLib::FCALDistEnergyShowerLib, ShowerLib::EtaEnergyShowerLib, and ShowerLib::TestShowerLib.

◆ getContainmentZ()

virtual double ShowerLib::IShowerLib::getContainmentZ ( const G4Track *  track) const
pure virtual

◆ getName()

virtual const std::string ShowerLib::IShowerLib::getName ( ) const
inlinevirtual

◆ getShower()

virtual std::vector<EnergySpot>* ShowerLib::IShowerLib::getShower ( const G4Track *  track,
ShowerLibStatistics stats,
int  randomShift 
) const
pure virtual

◆ particle_id()

int ShowerLib::IShowerLib::particle_id ( ) const
inlinevirtual

get particle tag

Definition at line 124 of file IShowerLib.h.

124 { return m_particle; }

◆ physicsList() [1/2]

const std::string ShowerLib::IShowerLib::physicsList ( ) const
inlinevirtual

get geant 4 physics list name

Definition at line 136 of file IShowerLib.h.

136 { return m_physicsList; }

◆ physicsList() [2/2]

void ShowerLib::IShowerLib::physicsList ( const std::string &  list)
inlinevirtual

set geant 4 physics list name

Definition at line 137 of file IShowerLib.h.

137 { m_physicsList = list; }

◆ printParameters()

virtual const std::string ShowerLib::IShowerLib::printParameters ( ) const
protectedpure virtual

◆ readMeta()

bool ShowerLib::IShowerLib::readMeta ( TTree *  source)
protected

read metadata from the given TTree

Definition at line 16 of file IShowerLib.cxx.

16  {
17  char detector[40];
18  char release[40];
19  char geometry[40];
20  char geant[40];
21  char physics[40];
22  char comment[100];
23  source->SetBranchAddress("detector",&detector);
24  source->SetBranchAddress("particle",&m_particle);
25  source->SetBranchAddress("release",&release);
26  source->SetBranchAddress("geometry",&geometry);
27  source->SetBranchAddress("geantVersion",&geant);
28  source->SetBranchAddress("physicsList",&physics);
29  source->SetBranchAddress("comment",&comment);
30  source->GetEntry(0);
34  m_geantVersion = geant;
35  m_physicsList = physics;
37  return true;
38  }

◆ release() [1/2]

const std::string ShowerLib::IShowerLib::release ( ) const
inlinevirtual

get Release tag

Definition at line 127 of file IShowerLib.h.

127 { return m_release; }

◆ release() [2/2]

void ShowerLib::IShowerLib::release ( const std::string &  release)
inlinevirtual

set Release tag

Definition at line 128 of file IShowerLib.h.

128 { m_release = release; }

◆ statistics()

const std::string ShowerLib::IShowerLib::statistics ( ) const

print library statistics

Definition at line 71 of file IShowerLib.cxx.

71  {
72 
73  if (m_filled) {
74  std::stringstream out;
75 
76  out << "======================================================" << std::endl;
77  out << " Statistics of the shower library " << std::endl;
78  out << "======================================================" << std::endl;
79  out << "Library Type: "<< getName() <<" PARTICLE: " << m_particle << " DETECTOR: "<< m_detector << std::endl;
80  out << m_release << " " << m_geometry << " " << m_geantVersion << " " << m_physicsList << std::endl;
81  if (printParameters().length() > 0)
82  out << printParameters() << std::endl;
83  out << m_comment << std::endl;
84  return out.str();
85  } else { //statistics for the genlib, shorter version
86  std::stringstream out;
87  out << getName() <<" PARTICLE: " << m_particle << " DETECTOR: "<< m_detector << ", ";
88  out << m_release << " " << m_geometry << " " << m_geantVersion << " " << m_physicsList << std::endl;
89  if (printParameters().length() > 0)
90  out << printParameters() << std::endl;
91  out << m_comment << std::endl;
92  return out.str();
93  }
94  }

◆ storeShower()

virtual bool ShowerLib::IShowerLib::storeShower ( HepMC::ConstGenParticlePtr  genParticle,
const Shower shower 
)
pure virtual

◆ writeMeta()

bool ShowerLib::IShowerLib::writeMeta ( TTree *  dest) const
protected

write metadata to the given TTree

Definition at line 40 of file IShowerLib.cxx.

40  {
41  char detector[40];
42  char release[40];
43  char geometry[40];
44  char geant[40];
45  char physics[40];
46  char comment[100];
47  int particle(m_particle);
48  m_detector.copy(detector,39,0);
49  detector[m_detector.length()] = '\0';
50  m_release.copy(release,39,0);
51  release[m_release.length()] = '\0';
52  m_geometry.copy(geometry,39,0);
53  geometry[m_geometry.length()] = '\0';
54  m_geantVersion.copy(geant,39,0);
55  geant[m_geantVersion.length()] = '\0';
56  m_physicsList.copy(physics,39,0);
57  physics[m_physicsList.length()] = '\0';
58  m_comment.copy(comment,99,0);
59  comment[m_comment.length()] = '\0';
60  source->Branch("detector",&detector,"detector/C");
61  source->Branch("particle",&particle,"particle/I");
62  source->Branch("release",&release,"release/C");
63  source->Branch("geometry",&geometry,"geometry/C");
64  source->Branch("geantVersion",&geant,"geantVersion/C");
65  source->Branch("physicsList",&physics,"physicsList/C");
66  source->Branch("comment",&comment,"comment/C");
67  source->Fill();
68  return true;
69  }

◆ writeToROOT()

virtual bool ShowerLib::IShowerLib::writeToROOT ( TFile *  dest)
pure virtual

Member Data Documentation

◆ m_comment

std::string ShowerLib::IShowerLib::m_comment
protected

comment

Definition at line 112 of file IShowerLib.h.

◆ m_detector

std::string ShowerLib::IShowerLib::m_detector
protected

name of the detector

Definition at line 106 of file IShowerLib.h.

◆ m_filled

bool ShowerLib::IShowerLib::m_filled
protected

is the library read from ROOT or from structure file

Definition at line 114 of file IShowerLib.h.

◆ m_geantVersion

std::string ShowerLib::IShowerLib::m_geantVersion
protected

geant 4 version

Definition at line 110 of file IShowerLib.h.

◆ m_geometry

std::string ShowerLib::IShowerLib::m_geometry
protected

atlas geometry version

Definition at line 109 of file IShowerLib.h.

◆ m_particle

int ShowerLib::IShowerLib::m_particle
protected

ID of the generated particles.

Definition at line 107 of file IShowerLib.h.

◆ m_physicsList

std::string ShowerLib::IShowerLib::m_physicsList
protected

used geant 4 physics list

Definition at line 111 of file IShowerLib.h.

◆ m_release

std::string ShowerLib::IShowerLib::m_release
protected

atlas software release

Definition at line 108 of file IShowerLib.h.


The documentation for this class was generated from the following files:
ShowerLib::IShowerLib::m_detector
std::string m_detector
name of the detector
Definition: IShowerLib.h:106
ShowerLib::IShowerLib::release
virtual const std::string release() const
get Release tag
Definition: IShowerLib.h:127
Trk::ParticleSwitcher::particle
constexpr ParticleHypothesis particle[PARTICLEHYPOTHESES]
the array of masses
Definition: ParticleHypothesis.h:76
ShowerLib::IShowerLib::detector
virtual const std::string detector() const
get detector tag
Definition: IShowerLib.h:121
ShowerLib::IShowerLib::m_release
std::string m_release
atlas software release
Definition: IShowerLib.h:108
ShowerLib::IShowerLib::printParameters
virtual const std::string printParameters() const =0
ShowerLib::IShowerLib::m_comment
std::string m_comment
comment
Definition: IShowerLib.h:112
python.AthDsoLogger.out
out
Definition: AthDsoLogger.py:71
ShowerLib::IShowerLib::getName
virtual const std::string getName() const
Definition: IShowerLib.h:93
ShowerLib::IShowerLib::m_filled
bool m_filled
is the library read from ROOT or from structure file
Definition: IShowerLib.h:114
ShowerLib::IShowerLib::m_particle
int m_particle
ID of the generated particles.
Definition: IShowerLib.h:107
ShowerLib::IShowerLib::m_geometry
std::string m_geometry
atlas geometry version
Definition: IShowerLib.h:109
histSizes.list
def list(name, path='/')
Definition: histSizes.py:38
ShowerLib::IShowerLib::m_geantVersion
std::string m_geantVersion
geant 4 version
Definition: IShowerLib.h:110
ShowerLib::IShowerLib::geometry
virtual const std::string geometry() const
get Geometry tag
Definition: IShowerLib.h:130
get_generator_info.version
version
Definition: get_generator_info.py:33
ShowerLib::IShowerLib::comment
virtual const std::string comment() const
get comment
Definition: IShowerLib.h:139
ShowerLib::IShowerLib::m_physicsList
std::string m_physicsList
used geant 4 physics list
Definition: IShowerLib.h:111
copySelective.source
string source
Definition: copySelective.py:32
length
double length(const pvec &v)
Definition: FPGATrackSimLLPDoubletHoughTransformTool.cxx:26