Geant4  10.03.p03
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
CCalDetector Class Referenceabstract

#include <CCalDetector.hh>

Inheritance diagram for CCalDetector:
Collaboration diagram for CCalDetector:

Public Member Functions

 CCalDetector (const G4String &name)
 
virtual ~CCalDetector ()
 
void constructHierarchy ()
 
void construct ()
 
void addDetector (CCalDetector *)
 
G4String Name () const
 
G4String baseFileName () const
 
G4String File () const
 
CCalDetectorgetDaughter (int i) const
 
int getNDaughters () const
 
G4bool operator== (const CCalDetector &left) const
 
G4bool operator!= (const CCalDetector &left) const
 

Protected Member Functions

virtual int readFile ()=0
 
virtual void constructDaughters ()=0
 
int buildFromFile ()
 

Protected Attributes

G4String detectorName
 
G4String fileName
 
G4String pathName
 
CCalDetectorTable theDetectorsInside
 
int constructFlag
 

Friends

std::ostream & operator<< (std::ostream &, const CCalDetector &)
 

Detailed Description

Definition at line 49 of file CCalDetector.hh.

Constructor & Destructor Documentation

CCalDetector::CCalDetector ( const G4String name)

Definition at line 44 of file CCalDetector.cc.

44  : detectorName(name)
45 {
46  if (getenv("CCAL_GEOMPATH"))
47  pathName = getenv("CCAL_GEOMPATH");
48  else
49  G4Exception("CCalDetector::CCalDetector","ccal001",
51  "Environment variable CCAL_GEOMPATH not defined");
52 
53 #ifdef ddebug
54  G4cout << "CCAL_GEOMPATH=" << pathName << G4endl;
55 #endif
56  fileName =
58  constructFlag =
60 }
G4String getFileName(const G4String &n)
G4GLOB_DLL std::ostream G4cout
G4String pathName
G4String fileName
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
Definition: G4Exception.cc:41
static CCalGeometryConfiguration * getInstance()
G4String detectorName
#define G4endl
Definition: G4ios.hh:61
int getConstructFlag(const G4String &n)

Here is the call graph for this function:

CCalDetector::~CCalDetector ( )
virtual

Definition at line 62 of file CCalDetector.cc.

62  {
63  CCalDetectorTable::iterator ite;
64  for (ite=theDetectorsInside.begin(); ite !=theDetectorsInside.end(); ite++) {
65  delete *ite;
66  }
67  theDetectorsInside.clear();
68 }
CCalDetectorTable theDetectorsInside

Member Function Documentation

void CCalDetector::addDetector ( CCalDetector det)

Definition at line 95 of file CCalDetector.cc.

95  {
96  theDetectorsInside.push_back(det);
97 }
CCalDetectorTable theDetectorsInside

Here is the caller graph for this function:

G4String CCalDetector::baseFileName ( ) const
inline

Definition at line 78 of file CCalDetector.hh.

78 {return fileName;}
G4String fileName
int CCalDetector::buildFromFile ( )
protected

Definition at line 103 of file CCalDetector.cc.

103  {
104  return readFile();
105 }
virtual int readFile()=0

Here is the call graph for this function:

Here is the caller graph for this function:

void CCalDetector::construct ( )

Definition at line 70 of file CCalDetector.cc.

70  {
71 #ifdef debug
72  G4cout << "===> Entering CCalDetector::construct() for " << Name() << G4endl;
73 #endif
74  int isgood = 0;
75 
76  //If constructFlag is unset we don't go into all this bussines
77  if (constructFlag!=0) {
78 
79  if (!isgood)
80  isgood = buildFromFile();
81 
82  if (isgood) {
84  for (unsigned int i=0; i < theDetectorsInside.size(); i++) {
85  theDetectorsInside[i]->constructHierarchy();
86  }
87  }
88  }
89 #ifdef debug
90  G4cout << "===> Exiting CCalDetector::construct() for " << Name() << G4endl;
91 #endif
92 }
virtual void constructDaughters()=0
G4String Name() const
Definition: CCalDetector.hh:77
G4GLOB_DLL std::ostream G4cout
int buildFromFile()
CCalDetectorTable theDetectorsInside
#define G4endl
Definition: G4ios.hh:61

Here is the call graph for this function:

Here is the caller graph for this function:

virtual void CCalDetector::constructDaughters ( )
protectedpure virtual

Implemented in CCalHcal, CCalEcal, CCalG4Hcal, CCalHall, and CCalG4Hall.

Here is the caller graph for this function:

void CCalDetector::constructHierarchy ( )
inline

Definition at line 66 of file CCalDetector.hh.

66 { construct();}
void construct()
Definition: CCalDetector.cc:70

Here is the call graph for this function:

Here is the caller graph for this function:

G4String CCalDetector::File ( ) const
inline

Definition at line 79 of file CCalDetector.hh.

79 {return fileName+".geom";}
G4String fileName

Here is the caller graph for this function:

CCalDetector* CCalDetector::getDaughter ( int  i) const
inline

Definition at line 80 of file CCalDetector.hh.

80 {return theDetectorsInside[i];}
CCalDetectorTable theDetectorsInside
int CCalDetector::getNDaughters ( ) const
inline

Definition at line 81 of file CCalDetector.hh.

81 {return theDetectorsInside.size();}
CCalDetectorTable theDetectorsInside
G4String CCalDetector::Name ( ) const
inline

Definition at line 77 of file CCalDetector.hh.

77 {return detectorName;}
G4String detectorName

Here is the caller graph for this function:

G4bool CCalDetector::operator!= ( const CCalDetector left) const
inline

Definition at line 90 of file CCalDetector.hh.

90  {
91  return (detectorName!=left.detectorName);
92  }
G4String detectorName
G4bool CCalDetector::operator== ( const CCalDetector left) const
inline

Definition at line 87 of file CCalDetector.hh.

87  {
88  return (detectorName==left.detectorName);
89  }
G4String detectorName
virtual int CCalDetector::readFile ( )
protectedpure virtual

Implemented in CCalHcal, CCalEcal, and CCalHall.

Here is the caller graph for this function:

Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream &  os,
const CCalDetector det 
)
friend

Definition at line 111 of file CCalDetector.cc.

111  {
112  os << "Detector \"" << det.detectorName
113  << "\" read from " << det.fileName << "." << G4endl;
114 
115  os << "With " << det.theDetectorsInside.size()
116  << " detectors inside { "<< G4endl;
117 
118  for (unsigned int i=0; i<det.theDetectorsInside.size(); i++)
119  os << det.theDetectorsInside[i] << G4endl;
120 
121  os << "}" << G4endl;
122 
123  return os;
124 }
G4String fileName
G4String detectorName
CCalDetectorTable theDetectorsInside
#define G4endl
Definition: G4ios.hh:61

Member Data Documentation

int CCalDetector::constructFlag
protected

Definition at line 122 of file CCalDetector.hh.

G4String CCalDetector::detectorName
protected

Definition at line 116 of file CCalDetector.hh.

G4String CCalDetector::fileName
protected

Definition at line 117 of file CCalDetector.hh.

G4String CCalDetector::pathName
protected

Definition at line 118 of file CCalDetector.hh.

CCalDetectorTable CCalDetector::theDetectorsInside
protected

Definition at line 120 of file CCalDetector.hh.


The documentation for this class was generated from the following files: