Geant4.10
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Protected Member Functions | Protected Attributes | Static Protected Attributes | Friends
CCalDetector Class Referenceabstract

#include <CCalDetector.hh>

Inheritance diagram for CCalDetector:
CCalEcal CCalHall CCalHcal CCalG4Ecal CCalG4Hall CCalG4Hcal

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
 
CCalDetectorTable theDetectorsInside
 
int constructFlag
 

Static Protected Attributes

static G4String pathName = getenv("CCAL_GEOMPATH")
 

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.

References constructFlag, fileName, G4cout, G4endl, CCalGeometryConfiguration::getConstructFlag(), CCalGeometryConfiguration::getFileName(), CCalGeometryConfiguration::getInstance(), and pathName.

44  : detectorName(name) {
45 #ifdef ddebug
46  G4cout << "CCAL_GEOMPATH=" << pathName << G4endl;
47 #endif
48  fileName =
50  constructFlag =
52 }
G4String getFileName(const G4String &n)
G4GLOB_DLL std::ostream G4cout
static G4String pathName
G4String fileName
static CCalGeometryConfiguration * getInstance()
G4String detectorName
#define G4endl
Definition: G4ios.hh:61
int getConstructFlag(const G4String &n)
CCalDetector::~CCalDetector ( )
virtual

Definition at line 54 of file CCalDetector.cc.

References theDetectorsInside.

54  {
55  CCalDetectorTable::iterator ite;
56  for (ite=theDetectorsInside.begin(); ite !=theDetectorsInside.end(); ite++) {
57  delete *ite;
58  }
59  theDetectorsInside.clear();
60 }
CCalDetectorTable theDetectorsInside

Member Function Documentation

void CCalDetector::addDetector ( CCalDetector det)

Definition at line 87 of file CCalDetector.cc.

References theDetectorsInside.

Referenced by CCalG4Hall::constructDaughters(), and CCalHall::constructDaughters().

87  {
88  theDetectorsInside.push_back(det);
89 }
CCalDetectorTable theDetectorsInside
G4String CCalDetector::baseFileName ( ) const
inline

Definition at line 78 of file CCalDetector.hh.

References fileName.

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

Definition at line 95 of file CCalDetector.cc.

References readFile().

Referenced by construct().

95  {
96  return readFile();
97 }
virtual int readFile()=0
void CCalDetector::construct ( )

Definition at line 62 of file CCalDetector.cc.

References buildFromFile(), constructDaughters(), constructFlag, G4cout, G4endl, Name(), and theDetectorsInside.

Referenced by constructHierarchy().

62  {
63 #ifdef debug
64  G4cout << "===> Entering CCalDetector::construct() for " << Name() << G4endl;
65 #endif
66  int isgood = 0;
67 
68  //If constructFlag is unset we don't go into all this bussines
69  if (constructFlag!=0) {
70 
71  if (!isgood)
72  isgood = buildFromFile();
73 
74  if (isgood) {
76  for (unsigned int i=0; i < theDetectorsInside.size(); i++) {
77  theDetectorsInside[i]->constructHierarchy();
78  }
79  }
80  }
81 #ifdef debug
82  G4cout << "===> Exiting CCalDetector::construct() for " << Name() << G4endl;
83 #endif
84 }
virtual void constructDaughters()=0
G4String Name() const
Definition: CCalDetector.hh:77
G4GLOB_DLL std::ostream G4cout
int buildFromFile()
Definition: CCalDetector.cc:95
CCalDetectorTable theDetectorsInside
#define G4endl
Definition: G4ios.hh:61
virtual void CCalDetector::constructDaughters ( )
protectedpure virtual

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

Referenced by construct().

void CCalDetector::constructHierarchy ( )
inline

Definition at line 66 of file CCalDetector.hh.

References construct().

Referenced by CCalDetectorConstruction::Construct().

66 { construct();}
void construct()
Definition: CCalDetector.cc:62
G4String CCalDetector::File ( ) const
inline

Definition at line 79 of file CCalDetector.hh.

References fileName.

Referenced by CCalHall::readFile(), CCalEcal::readFile(), and CCalHcal::readFile().

79 {return fileName+".geom";}
G4String fileName
CCalDetector* CCalDetector::getDaughter ( int  i) const
inline

Definition at line 80 of file CCalDetector.hh.

References theDetectorsInside.

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

Definition at line 81 of file CCalDetector.hh.

References theDetectorsInside.

81 {return theDetectorsInside.size();}
CCalDetectorTable theDetectorsInside
G4String CCalDetector::Name ( ) const
inline
G4bool CCalDetector::operator!= ( const CCalDetector left) const
inline

Definition at line 90 of file CCalDetector.hh.

References detectorName.

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.

References detectorName.

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

Implemented in CCalHcal, CCalEcal, and CCalHall.

Referenced by buildFromFile().

Friends And Related Function Documentation

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

Definition at line 103 of file CCalDetector.cc.

103  {
104  os << "Detector \"" << det.detectorName
105  << "\" read from " << det.fileName << "." << G4endl;
106 
107  os << "With " << det.theDetectorsInside.size()
108  << " detectors inside { "<< G4endl;
109 
110  for (unsigned int i=0; i<det.theDetectorsInside.size(); i++)
111  os << det.theDetectorsInside[i] << G4endl;
112 
113  os << "}" << G4endl;
114 
115  return os;
116 }
G4String fileName
G4String detectorName
CCalDetectorTable theDetectorsInside
#define G4endl
Definition: G4ios.hh:61

Field Documentation

int CCalDetector::constructFlag
protected

Definition at line 123 of file CCalDetector.hh.

Referenced by CCalDetector(), and construct().

G4String CCalDetector::detectorName
protected

Definition at line 117 of file CCalDetector.hh.

Referenced by Name(), operator!=(), operator<<(), and operator==().

G4String CCalDetector::fileName
protected

Definition at line 118 of file CCalDetector.hh.

Referenced by baseFileName(), CCalDetector(), File(), and operator<<().

G4String CCalDetector::pathName = getenv("CCAL_GEOMPATH")
staticprotected
CCalDetectorTable CCalDetector::theDetectorsInside
protected

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