FairRoot
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
FairGeoSet.h
Go to the documentation of this file.
1 /********************************************************************************
2  * Copyright (C) 2014 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH *
3  * *
4  * This software is distributed under the terms of the *
5  * GNU Lesser General Public Licence (LGPL) version 3, *
6  * copied verbatim in the file "LICENSE" *
7  ********************************************************************************/
8 #ifndef FAIRGEOSET_H
9 #define FAIRGEOSET_H
10 
11 #include "FairGeoNode.h"
12 
13 #include <Rtypes.h> // for Int_t, Bool_t, etc
14 #include <TList.h> // for TList
15 #include <TNamed.h> // for TNamed
16 #include <TString.h> // for TString
17 #include <iosfwd> // for fstream
18 
19 // class FairGeoNode;
20 class FairGeoShapes;
21 class FairGeoMedia;
22 class FairGeoBuilder;
23 class FairGeoTransform;
24 class TArrayI;
25 
30 class FairGeoSet : public TNamed
31 {
32  protected:
33  Int_t hadesGeo;
34 
35  class FairGeoCopyNode : public TNamed
36  {
37  public:
39  FairGeoCopyNode(const char* name, FairGeoNode* node)
40  : TNamed(name, "")
41  , pNode(node)
42  {}
43  // SetName(name);
44  //
45  // }
47 
48  private:
50  FairGeoCopyNode& operator=(const FairGeoCopyNode&);
51  };
52 
53  TList* volumes;
54  TList* masterNodes;
55  Int_t maxSectors;
57  Int_t maxModules;
58  TArrayI* modules;
60  TString geoFile;
61  TString author;
62  TString description;
64  FairGeoSet();
65  void readInout(std::fstream&);
66  void readTransform(std::fstream&, FairGeoTransform&);
67  Bool_t readVolumeParams(std::fstream&, FairGeoMedia*, FairGeoNode*, TList* l = 0);
68  Bool_t readKeepIn(std::fstream&, FairGeoMedia*, TString&);
69  Bool_t readModule(std::fstream&, FairGeoMedia*, TString&, TString&, Bool_t a = kFALSE);
70 
71  public:
72  virtual ~FairGeoSet();
73  void setShapes(FairGeoShapes* s) { pShapes = s; }
74  void setMasterNodes(TList* m) { masterNodes = m; }
75  void setGeomFile(const char* filename) { geoFile = filename; }
76  const char* getGeomFile() { return geoFile.Data(); }
77  Int_t getMaxSectors(void) { return maxSectors; }
78  Int_t getMaxModules(void) { return maxModules; }
79  Int_t getMaxKeepinVolumes(void) { return maxKeepinVolumes; }
80  void setModules(Int_t, Int_t*);
81  Int_t* getModules(void);
82  Int_t getModule(Int_t, Int_t);
83  FairGeoNode* getVolume(const char* name) { return dynamic_cast<FairGeoNode*>(volumes->FindObject(name)); }
84  FairGeoNode* getMasterNode(const char* name) { return dynamic_cast<FairGeoNode*>(masterNodes->FindObject(name)); }
85  TList* getListOfVolumes() { return volumes; }
87  void setAuthor(TString& s) { author = s; }
88  void setDescription(TString& s) { description = s; }
89  TString& getAuthor() { return author; }
90  TString& getDescription() { return description; }
91  virtual const char* getKeepinName(Int_t, Int_t) { return 0; }
92  virtual const char* getModuleName(Int_t) { return 0; }
93  virtual const char* getEleName(Int_t) { return 0; }
94  virtual Int_t getSecNumInMod(const TString&) { return -1; }
95  virtual Int_t getModNumInMod(const TString&) { return 0; }
96  virtual Bool_t read(std::fstream&, FairGeoMedia*);
97  virtual void addRefNodes() {}
98  virtual void write(std::fstream&);
99  virtual void print();
100  virtual Bool_t create(FairGeoBuilder*);
101  void compare(FairGeoSet&);
102  ClassDef(FairGeoSet, 0); //
103 
104  private:
105  FairGeoSet(const FairGeoSet&);
106  FairGeoSet& operator=(const FairGeoSet&);
107 };
108 
109 #endif /* !FAIRGEOSET_H */
Int_t getMaxModules(void)
Definition: FairGeoSet.h:78
virtual const char * getEleName(Int_t)
Definition: FairGeoSet.h:93
TList * masterNodes
Definition: FairGeoSet.h:54
void readTransform(std::fstream &, FairGeoTransform &)
Definition: FairGeoSet.cxx:161
FairGeoShapes * pShapes
Definition: FairGeoSet.h:59
virtual ~FairGeoSet()
Definition: FairGeoSet.cxx:58
Int_t getMaxSectors(void)
Definition: FairGeoSet.h:77
void compare(FairGeoSet &)
Definition: FairGeoSet.cxx:485
void setMasterNodes(TList *m)
Definition: FairGeoSet.h:74
FairGeoShapes * getShapes()
Definition: FairGeoSet.h:86
void setModules(Int_t, Int_t *)
Definition: FairGeoSet.cxx:67
TString description
Definition: FairGeoSet.h:62
virtual Bool_t create(FairGeoBuilder *)
Definition: FairGeoSet.cxx:452
virtual Bool_t read(std::fstream &, FairGeoMedia *)
Definition: FairGeoSet.cxx:116
Int_t maxSectors
Definition: FairGeoSet.h:55
virtual void write(std::fstream &)
Definition: FairGeoSet.cxx:432
virtual Int_t getSecNumInMod(const TString &)
Definition: FairGeoSet.h:94
virtual const char * getModuleName(Int_t)
Definition: FairGeoSet.h:92
virtual void addRefNodes()
Definition: FairGeoSet.h:97
TString & getAuthor()
Definition: FairGeoSet.h:89
TString & getDescription()
Definition: FairGeoSet.h:90
TString author
Definition: FairGeoSet.h:61
Int_t getMaxKeepinVolumes(void)
Definition: FairGeoSet.h:79
FairGeoNode * getVolume(const char *name)
Definition: FairGeoSet.h:83
void setShapes(FairGeoShapes *s)
Definition: FairGeoSet.h:73
Int_t * getModules(void)
Definition: FairGeoSet.cxx:90
virtual const char * getKeepinName(Int_t, Int_t)
Definition: FairGeoSet.h:91
TString geoFile
Definition: FairGeoSet.h:60
void setDescription(TString &s)
Definition: FairGeoSet.h:88
Bool_t readVolumeParams(std::fstream &, FairGeoMedia *, FairGeoNode *, TList *l=0)
Definition: FairGeoSet.cxx:173
Int_t maxModules
Definition: FairGeoSet.h:57
TList * getListOfVolumes()
Definition: FairGeoSet.h:85
ClassDef(FairGeoSet, 0)
Bool_t readModule(std::fstream &, FairGeoMedia *, TString &, TString &, Bool_t a=kFALSE)
Definition: FairGeoSet.cxx:346
void setAuthor(TString &s)
Definition: FairGeoSet.h:87
void setGeomFile(const char *filename)
Definition: FairGeoSet.h:75
FairGeoNode * getMasterNode(const char *name)
Definition: FairGeoSet.h:84
void readInout(std::fstream &)
Definition: FairGeoSet.cxx:145
virtual Int_t getModNumInMod(const TString &)
Definition: FairGeoSet.h:95
Int_t maxKeepinVolumes
Definition: FairGeoSet.h:56
const char * getGeomFile()
Definition: FairGeoSet.h:76
TList * volumes
Definition: FairGeoSet.h:53
Bool_t readKeepIn(std::fstream &, FairGeoMedia *, TString &)
Definition: FairGeoSet.cxx:308
Int_t hadesGeo
Definition: FairGeoSet.h:33
Int_t getModule(Int_t, Int_t)
Definition: FairGeoSet.cxx:99
virtual void print()
Definition: FairGeoSet.cxx:411
FairGeoCopyNode(const char *name, FairGeoNode *node)
Definition: FairGeoSet.h:39
TArrayI * modules
Definition: FairGeoSet.h:58