FairRoot/PandaRoot
Public Member Functions | Protected Attributes | List of all members
PndGeoCave Class Reference

#include <PndGeoCave.h>

Inheritance diagram for PndGeoCave:

Public Member Functions

 PndGeoCave ()
 
 ~PndGeoCave ()
 
const char * getModuleName (Int_t)
 
Bool_t read (std::fstream &, FairGeoMedia *)
 
void addRefNodes ()
 
void write (std::fstream &)
 
void print ()
 

Protected Attributes

TString name
 

Detailed Description

Definition at line 8 of file PndGeoCave.h.

Constructor & Destructor Documentation

PndGeoCave::PndGeoCave ( )

Definition at line 20 of file PndGeoCave.cxx.

20  : name("cave") {
21  // Constructor
22  fName="cave";
23  maxModules=1;
24 }
TString name
Definition: PndGeoCave.h:10
PndGeoCave::~PndGeoCave ( )
inline

Definition at line 13 of file PndGeoCave.h.

13 {}

Member Function Documentation

void PndGeoCave::addRefNodes ( )

Definition at line 71 of file PndGeoCave.cxx.

References name.

71  {
72  // Adds the reference node
73  FairGeoNode* volu=getVolume(name);
74  if (volu) masterNodes->Add(new FairGeoNode(*volu));
75 }
TString name
Definition: PndGeoCave.h:10
const char* PndGeoCave::getModuleName ( Int_t  )
inline

Definition at line 14 of file PndGeoCave.h.

References name.

14 {return name.Data();}
TString name
Definition: PndGeoCave.h:10
void PndGeoCave::print ( )

Definition at line 91 of file PndGeoCave.cxx.

References name.

91  {
92  // Prints the geometry
93  FairGeoNode* volu=getVolume(name);
94  if (volu) {
95  FairGeoBasicShape* sh=volu->getShapePointer();
96  FairGeoMedium* med=volu->getMedium();
97  if (sh&&med) {
98  cout<<volu->GetName()<<'\n'<<sh->GetName()<<'\n'<<med->GetName()<<'\n';
99  sh->printPoints(volu);
100  }
101  }
102 }
TString name
Definition: PndGeoCave.h:10
Bool_t PndGeoCave::read ( std::fstream &  ,
FairGeoMedia *   
)

Definition at line 26 of file PndGeoCave.cxx.

References Bool_t, medium, n, name, shape, and TString.

26  {
27  // Reads the geometry from file
28  if (!media) return kFALSE;
29  const Int_t maxbuf=256;
30  char buf[maxbuf];
31  FairGeoNode* volu=0;
32  FairGeoMedium* medium;
33  Bool_t rc=kTRUE;
34  do {
35  fin.getline(buf,maxbuf);
36  if (buf[0]!='\0' && buf[0]!='/' && !fin.eof()) {
37  if (strcmp(buf,name)==0) {
38  volu=new FairGeoNode;
39  volu->SetName(buf);
40  volu->setVolumeType(kFairGeoTopNode);
41  volu->setActive();
42  fin.getline(buf,maxbuf);
43  TString shape(buf);
44  FairGeoBasicShape* sh=pShapes->selectShape(shape);
45  if (sh) volu->setShape(sh);
46  else rc=kFALSE;
47  fin.getline(buf,maxbuf);
48  medium=media->getMedium(buf);
49  if (!medium) {
50  medium=new FairGeoMedium();
51  media->addMedium(medium);
52  }
53  volu->setMedium(medium);
54  Int_t n=0;
55  if (sh) n=sh->readPoints(&fin,volu);
56  if (n<=0) rc=kFALSE;
57  } else rc=kFALSE;
58  }
59  } while (rc && !volu && !fin.eof());
60  if (volu && rc) {
61  volumes->Add(volu);
62  masterNodes->Add(new FairGeoNode(*volu));
63  } else {
64  delete volu;
65  volu=0;
66  rc=kFALSE;
67  }
68  return rc;
69 }
int n
TGeoShape * shape
TString medium
TString name
Definition: PndGeoCave.h:10
void PndGeoCave::write ( std::fstream &  )

Definition at line 77 of file PndGeoCave.cxx.

References name.

77  {
78  // Writes the geometry to file
79  fout.setf(ios::fixed,ios::floatfield);
80  FairGeoNode* volu=getVolume(name);
81  if (volu) {
82  FairGeoBasicShape* sh=volu->getShapePointer();
83  FairGeoMedium* med=volu->getMedium();
84  if (sh&&med) {
85  fout<<volu->GetName()<<'\n'<<sh->GetName()<<'\n'<<med->GetName()<<'\n';
86  sh->writePoints(&fout,volu);
87  }
88  }
89 }
TString name
Definition: PndGeoCave.h:10

Member Data Documentation

TString PndGeoCave::name
protected

Definition at line 10 of file PndGeoCave.h.

Referenced by getModuleName().


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