Geant4.10
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Protected Member Functions
CCalHcal Class Reference

#include <CCalHcal.hh>

Inheritance diagram for CCalHcal:
CCalDetector CCalG4Hcal

Public Member Functions

 CCalHcal (const G4String &name)
 
virtual ~CCalHcal ()
 
G4String getGenMat () const
 
double getDy_2Cal () const
 
double getDx_2Cal () const
 
double getXposCal () const
 
G4String getBoxMat () const
 
int getNBox () const
 
double getDy_2Box () const
 
double getDx_2Box () const
 
double getWallThickBox () const
 
double getXposBox (unsigned int i) const
 
int getNLayerScnt () const
 
int getTypeScnt (unsigned int i) const
 
int getMotherScnt (unsigned int i) const
 
double getXposScnt (unsigned int i) const
 
int getNLayerAbs () const
 
int getTypeAbs (unsigned int i) const
 
int getMotherAbs (unsigned int i) const
 
double getXposAbs (unsigned int i) const
 
G4String getAbsMat () const
 
int getNAbsorber () const
 
double getDy_2Abs () const
 
double getDx_2Abs (unsigned int i) const
 
G4String getScntMat () const
 
G4String getWrapMat () const
 
G4String getPlasMat () const
 
int getNScintillator () const
 
double getDy_2ScntLay (unsigned int i) const
 
double getDx_2ScntLay (unsigned int i) const
 
double getDx_2Wrap (unsigned int i) const
 
double getDx_2FrontP (unsigned int i) const
 
double getDx_2BackP (unsigned int i) const
 
double getDx_2Scnt (unsigned int i) const
 
- Public Member Functions inherited from CCalDetector
 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 ()
 
virtual void constructDaughters ()
 
- Protected Member Functions inherited from CCalDetector
int buildFromFile ()
 

Additional Inherited Members

- Protected Attributes inherited from CCalDetector
G4String detectorName
 
G4String fileName
 
CCalDetectorTable theDetectorsInside
 
int constructFlag
 
- Static Protected Attributes inherited from CCalDetector
static G4String pathName = getenv("CCAL_GEOMPATH")
 

Detailed Description

Definition at line 35 of file CCalHcal.hh.

Constructor & Destructor Documentation

CCalHcal::CCalHcal ( const G4String name)

Definition at line 37 of file CCalHcal.cc.

37  :
38  CCalDetector(name),xposBox(0),typeLayerScnt(0),mothLayerScnt(0),
39  xposLayerScnt(0),typeLayerAbs(0),mothLayerAbs(0),xposLayerAbs(0),
40  dx_2Absorber(0),dy_2ScntLayer(0),dx_2ScntLayer(0),dx_2Wrapper(0),
41  dx_2FrontPlastic(0),dx_2BackPlastic(0),dx_2Scintillator(0) {}
CCalDetector(const G4String &name)
Definition: CCalDetector.cc:44
CCalHcal::~CCalHcal ( )
virtual

Definition at line 43 of file CCalHcal.cc.

43  {
44  if (xposBox)
45  delete[] xposBox;
46  if (typeLayerScnt)
47  delete[] typeLayerScnt;
48  if (mothLayerScnt)
49  delete[] mothLayerScnt;
50  if (xposLayerScnt)
51  delete[] xposLayerScnt;
52  if (typeLayerAbs)
53  delete[] typeLayerAbs;
54  if (mothLayerAbs)
55  delete[] mothLayerAbs;
56  if (xposLayerAbs)
57  delete[] xposLayerAbs;
58  if (dx_2Absorber)
59  delete[] dx_2Absorber;
60  if (dy_2ScntLayer)
61  delete[] dy_2ScntLayer;
62  if (dx_2ScntLayer)
63  delete[] dx_2ScntLayer;
64  if (dx_2Wrapper)
65  delete[] dx_2Wrapper;
66  if (dx_2FrontPlastic)
67  delete[] dx_2FrontPlastic;
68  if (dx_2BackPlastic)
69  delete[] dx_2BackPlastic;
70  if (dx_2Scintillator)
71  delete[] dx_2Scintillator;
72 }

Member Function Documentation

void CCalHcal::constructDaughters ( )
protectedvirtual

Implements CCalDetector.

Reimplemented in CCalG4Hcal.

Definition at line 192 of file CCalHcal.cc.

192  {
193 }
G4String CCalHcal::getAbsMat ( ) const
inline

Definition at line 60 of file CCalHcal.hh.

Referenced by CCalG4Hcal::constructAbsorberLayer().

60 {return absMaterial;}
G4String CCalHcal::getBoxMat ( ) const
inline

Definition at line 46 of file CCalHcal.hh.

Referenced by CCalG4Hcal::constructIn().

46 {return boxMaterial;}
double CCalHcal::getDx_2Abs ( unsigned int  i) const
inline

Definition at line 63 of file CCalHcal.hh.

Referenced by CCalG4Hcal::constructAbsorberLayer().

63 {return dx_2Absorber[i];}
double CCalHcal::getDx_2BackP ( unsigned int  i) const
inline

Definition at line 72 of file CCalHcal.hh.

Referenced by CCalG4Hcal::constructScintillatorLayer().

72 {return dx_2BackPlastic[i];}
double CCalHcal::getDx_2Box ( ) const
inline

Definition at line 49 of file CCalHcal.hh.

Referenced by CCalG4Hcal::constructIn().

49 {return dx_2Box;}
double CCalHcal::getDx_2Cal ( ) const
inline

Definition at line 44 of file CCalHcal.hh.

Referenced by CCalG4Hcal::constructIn().

44 {return dx_2Cal;}
double CCalHcal::getDx_2FrontP ( unsigned int  i) const
inline

Definition at line 71 of file CCalHcal.hh.

Referenced by CCalG4Hcal::constructScintillatorLayer().

71 {return dx_2FrontPlastic[i];}
double CCalHcal::getDx_2Scnt ( unsigned int  i) const
inline

Definition at line 73 of file CCalHcal.hh.

Referenced by CCalG4Hcal::constructScintillatorLayer().

73 {return dx_2Scintillator[i];}
double CCalHcal::getDx_2ScntLay ( unsigned int  i) const
inline

Definition at line 69 of file CCalHcal.hh.

Referenced by CCalG4Hcal::constructScintillatorLayer().

69 {return dx_2ScntLayer[i];}
double CCalHcal::getDx_2Wrap ( unsigned int  i) const
inline

Definition at line 70 of file CCalHcal.hh.

Referenced by CCalG4Hcal::constructScintillatorLayer().

70 {return dx_2Wrapper[i];}
double CCalHcal::getDy_2Abs ( ) const
inline

Definition at line 62 of file CCalHcal.hh.

Referenced by CCalG4Hcal::constructAbsorberLayer().

62 {return dy_2Absorber;}
double CCalHcal::getDy_2Box ( ) const
inline

Definition at line 48 of file CCalHcal.hh.

Referenced by CCalG4Hcal::constructIn().

48 {return dy_2Box;}
double CCalHcal::getDy_2Cal ( ) const
inline

Definition at line 43 of file CCalHcal.hh.

Referenced by CCalG4Hcal::constructIn().

43 {return dy_2Cal;}
double CCalHcal::getDy_2ScntLay ( unsigned int  i) const
inline

Definition at line 68 of file CCalHcal.hh.

Referenced by CCalG4Hcal::constructScintillatorLayer().

68 {return dy_2ScntLayer[i];}
G4String CCalHcal::getGenMat ( ) const
inline

Definition at line 42 of file CCalHcal.hh.

Referenced by CCalG4Hcal::constructIn(), and CCalG4Hcal::constructScintillatorLayer().

42 {return genMaterial;}
int CCalHcal::getMotherAbs ( unsigned int  i) const
inline

Definition at line 58 of file CCalHcal.hh.

Referenced by CCalG4Hcal::constructIn().

58 {return mothLayerAbs[i];}
int CCalHcal::getMotherScnt ( unsigned int  i) const
inline

Definition at line 54 of file CCalHcal.hh.

Referenced by CCalG4Hcal::constructIn().

54 {return mothLayerScnt[i];}
int CCalHcal::getNAbsorber ( ) const
inline

Definition at line 61 of file CCalHcal.hh.

Referenced by CCalG4Hcal::constructIn().

61 {return nAbsorber;}
int CCalHcal::getNBox ( ) const
inline

Definition at line 47 of file CCalHcal.hh.

Referenced by CCalG4Hcal::constructIn().

47 {return nBox;}
int CCalHcal::getNLayerAbs ( ) const
inline

Definition at line 56 of file CCalHcal.hh.

Referenced by CCalG4Hcal::constructIn().

56 {return nLayerAbs;}
int CCalHcal::getNLayerScnt ( ) const
inline

Definition at line 52 of file CCalHcal.hh.

Referenced by CCalG4Hcal::constructIn().

52 {return nLayerScnt;}
int CCalHcal::getNScintillator ( ) const
inline

Definition at line 67 of file CCalHcal.hh.

Referenced by CCalG4Hcal::constructIn().

67 {return nScintillator;}
G4String CCalHcal::getPlasMat ( ) const
inline

Definition at line 66 of file CCalHcal.hh.

Referenced by CCalG4Hcal::constructScintillatorLayer().

66 {return plasMaterial;}
G4String CCalHcal::getScntMat ( ) const
inline

Definition at line 64 of file CCalHcal.hh.

Referenced by CCalG4Hcal::constructScintillatorLayer().

64 {return scntMaterial;}
int CCalHcal::getTypeAbs ( unsigned int  i) const
inline

Definition at line 57 of file CCalHcal.hh.

Referenced by CCalG4Hcal::constructIn().

57 {return typeLayerAbs[i];}
int CCalHcal::getTypeScnt ( unsigned int  i) const
inline

Definition at line 53 of file CCalHcal.hh.

Referenced by CCalG4Hcal::constructIn().

53 {return typeLayerScnt[i];}
double CCalHcal::getWallThickBox ( ) const
inline

Definition at line 50 of file CCalHcal.hh.

Referenced by CCalG4Hcal::constructIn().

50 {return wallThickBox;}
G4String CCalHcal::getWrapMat ( ) const
inline

Definition at line 65 of file CCalHcal.hh.

Referenced by CCalG4Hcal::constructScintillatorLayer().

65 {return wrapMaterial;}
double CCalHcal::getXposAbs ( unsigned int  i) const
inline

Definition at line 59 of file CCalHcal.hh.

Referenced by CCalG4Hcal::constructIn().

59 {return xposLayerAbs[i];}
double CCalHcal::getXposBox ( unsigned int  i) const
inline

Definition at line 51 of file CCalHcal.hh.

Referenced by CCalG4Hcal::constructIn().

51 {return xposBox[i];}
double CCalHcal::getXposCal ( ) const
inline

Definition at line 45 of file CCalHcal.hh.

Referenced by CCalG4Hcal::constructIn().

45 {return xposCal;}
double CCalHcal::getXposScnt ( unsigned int  i) const
inline

Definition at line 55 of file CCalHcal.hh.

Referenced by CCalG4Hcal::constructIn().

55 {return xposLayerScnt[i];}
int CCalHcal::readFile ( )
protectedvirtual

Implements CCalDetector.

Definition at line 74 of file CCalHcal.cc.

References CCalDetector::File(), findDO(), G4cout, G4endl, jump(), openGeomFile(), CCalDetector::pathName, readName(), and tab().

74  {
75  ///////////////////////////////////////////////////////////////
76  //Let's open the file
77  G4cout << " ==> Opening file " << File() << " to read elements..."
78  << G4endl;
79 
80  std::ifstream is;
81  bool ok = openGeomFile(is, pathName, File());
82  if (!ok)
83  return 0;
84 
85  // Find *DO HCal
86  findDO(is, G4String("HCal"));
87 
88  // Calorimeter boundaries
89  readName(is,genMaterial);
90  is >> dy_2Cal >> dx_2Cal >> xposCal >> jump;
91 #ifdef debug
92  G4cout << tab << "General material: " << genMaterial << " Size " << dy_2Cal
93  << ", " << dx_2Cal << " Position " << xposCal << G4endl;
94 #endif
95 
96  // Boxes
97  readName(is,boxMaterial);
98  is >> nBox >> dy_2Box >> dx_2Box >> wallThickBox;
99  int i = 0;
100  xposBox = new double[nBox];
101  for (i=0; i<nBox; i++)
102  is >> xposBox[i];
103 #ifdef debug
104  G4cout << tab << "Box material: " << boxMaterial << " Size " << dy_2Box
105  << ", " << dx_2Box << " Wall Thickness " << wallThickBox << " number "
106  << nBox << " position ";
107  for (i=0; i<nBox; i++)
108  G4cout << i << " " << xposBox[i] << " ";
109  G4cout << G4endl;
110 #endif
111 
112  // Layers of scintillators
113  G4String rubbish;
114  readName(is,rubbish);
115  is >> nLayerScnt;
116  typeLayerScnt = new int[nLayerScnt];
117  mothLayerScnt = new int[nLayerScnt];
118  xposLayerScnt = new double[nLayerScnt];
119  for (i=0; i<nLayerScnt; i++)
120  is >> typeLayerScnt[i] >> mothLayerScnt[i] >> xposLayerScnt[i];
121 #ifdef debug
122  G4cout << tab << nLayerScnt << " Layers of scintillators of type/mother box/"
123  << "position" << G4endl;
124  for (i=0; i<nLayerScnt; i++)
125  G4cout << tab << i << " " << typeLayerScnt[i] << " " << mothLayerScnt[i]
126  << " " << xposLayerScnt[i] << G4endl;
127 #endif
128 
129  // Layers of absorbers
130  readName(is,rubbish);
131  is >> nLayerAbs;
132  typeLayerAbs = new int[nLayerAbs];
133  mothLayerAbs = new int[nLayerAbs];
134  xposLayerAbs = new double[nLayerAbs];
135  for (i=0; i<nLayerAbs; i++)
136  is >> typeLayerAbs[i] >> mothLayerAbs[i] >> xposLayerAbs[i];
137 #ifdef debug
138  G4cout << tab << nLayerAbs << " Layers of absorbers of type/mother box/"
139  << "position" << G4endl;
140  for (i=0; i<nLayerAbs; i++)
141  G4cout << tab << i << " " << typeLayerAbs[i] << " " << mothLayerAbs[i]
142  << " " << xposLayerAbs[i] << G4endl;
143 #endif
144 
145  // Absorber parameters
146  readName(is,absMaterial);
147  is >> nAbsorber >> dy_2Absorber;
148  dx_2Absorber = new double[nAbsorber];
149  for (i=0; i<nAbsorber; i++)
150  is >> dx_2Absorber[i];
151 #ifdef debug
152  G4cout << "\tAbsorber mad of " << absMaterial << " with " << nAbsorber
153  << " types and size " << dy_2Absorber;
154  for (i=0; i<nAbsorber; i++)
155  G4cout << " " << i << " " << dx_2Absorber[i];
156  G4cout << G4endl;
157 #endif
158 
159  // Scintillator parameters
160  readName(is,scntMaterial);
161  readName(is,wrapMaterial);
162  readName(is,plasMaterial);
163  is >> nScintillator;
164  dy_2ScntLayer = new double[nScintillator];
165  dx_2ScntLayer = new double[nScintillator];
166  dx_2Wrapper = new double[nScintillator];
167  dx_2FrontPlastic = new double[nScintillator];
168  dx_2BackPlastic = new double[nScintillator];
169  dx_2Scintillator = new double[nScintillator];
170  for (i=0; i<nScintillator; i++)
171  is >> dy_2ScntLayer[i] >> dx_2ScntLayer[i] >> dx_2Wrapper[i]
172  >> dx_2FrontPlastic[i] >> dx_2BackPlastic[i] >> dx_2Scintillator[i];
173 #ifdef debug
174  G4cout << tab << nScintillator << " Scintillator layers made of "
175  << scntMaterial << " " << wrapMaterial << " and " << plasMaterial
176  << " of sizes " << G4endl;
177  for (i=0; i<nScintillator; i++)
178  G4cout << tab << i << " " << dy_2ScntLayer[i] << " " << dx_2ScntLayer[i]
179  << " " << dx_2Wrapper[i] << " " << dx_2FrontPlastic[i] << " "
180  << dx_2BackPlastic[i] << " " << dx_2Scintillator[i] << G4endl;
181 #endif
182 
183  ///////////////////////////////////////////////////////////////
184  // Close the file
185  G4cout << " ==> Closing file " << File() << G4endl;
186  is.close();
187 
188  return 1;
189 
190 }
bool openGeomFile(std::ifstream &is, const G4String &pathname, const G4String &filename)
Definition: CCalutils.cc:116
std::istream & jump(std::istream &)
Definition: CCalutils.cc:95
std::ifstream & findDO(std::ifstream &, const G4String &)
Definition: CCalutils.cc:72
std::ifstream & readName(std::ifstream &, G4String &)
Definition: CCalutils.cc:53
G4GLOB_DLL std::ostream G4cout
std::ostream & tab(std::ostream &)
Definition: CCalutils.cc:89
static G4String pathName
#define G4endl
Definition: G4ios.hh:61
G4String File() const
Definition: CCalDetector.hh:79

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