EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
FairGeoNode.h
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file FairGeoNode.h
1 #ifndef FAIRGEONODE_H
2 #define FAIRGEONODE_H
3 
4 #include "FairGeoVolume.h"
5 #include "FairGeoBasicShape.h"
6 //#include "FairGeoMedium.h"
7 #include "FairGeoTransform.h"
8 
9 //#include "TArrayD.h"
10 //#include "TObjArray.h"
11 #include "TGeoVolume.h"
12 
13 //#include <fstream>
14 //#include <iomanip>
15 
16 class FairGeoMedium;
17 class FairGeoVector;
18 class TArrayD;
19 class TObjArray;
20 //class TGeoVolume;
21 
28 };
29 
30 
35 class FairGeoNode : public FairGeoVolume
36 {
37  private:
38  FairGeoNode(const FairGeoNode&);
40  protected:
41  Bool_t active;
44  Bool_t created;
46  TGeoVolume* rootVolume;
51  TObjArray* fDaughterList;
52  //const char* fTruncName; //
53  TString fTruncName;
54  public:
55  FairGeoNode();
57  virtual ~FairGeoNode();
58  void AddDaughter(FairGeoNode* fNode) {fDaughterList->AddLast(fNode);}
59  TObjArray* GetListOfDaughters() {return fDaughterList;}
61  Bool_t isTopNode() { return (Bool_t)(volumeType == kFairGeoTopNode);}
62  Bool_t isRefNode() { return (Bool_t)(volumeType == kFairGeoRefNode);}
63  Bool_t isKeepin() { return (Bool_t)(volumeType == kFairGeoKeepin);}
64  Bool_t isModule() { return (Bool_t)(volumeType == kFairGeoModule);}
65  Int_t getCopyNo();
69  Bool_t isActive() {return active;}
71  TArrayD* getParameters();
75  TGeoVolume* getRootVolume() {return rootVolume;}
76  TList* getTree();
77  Bool_t isSensitive();
78  Bool_t isCreated() {return created;}
79  void setCreated() {created=kTRUE;}
80  void setName(const Text_t* s);
84  void setMother(FairGeoNode* s);
85  void setMedium(FairGeoMedium* med) {medium=med; }
86  void setActive(Bool_t a=kTRUE) {active=a;}
89  void setRootVolume(TGeoVolume* p) {rootVolume=p;}
93  Bool_t calcRefPos(FairGeoVector&);
94  void clear();
95  void print();
96  Bool_t write(std::fstream&);
97  Int_t compare(FairGeoNode&);
98 
99 
100  void setTruncName( const char* aName ) { fTruncName = aName;}
101  const char* getTruncName() {
102  if (fTruncName.Length()>0) { return fTruncName.Data(); }
103  else { return GetName(); }
104  }
105 
106  ClassDef(FairGeoNode,1) //
107 };
108 
109 // -------------------- inlines --------------------------
110 
111 inline void FairGeoNode::setName(const Text_t* s)
112 {
113  // Sets the name of the volume
114  fName=s;
115  fName.ToUpper();
116 }
117 
119 {
120  // Sets the shape of the volume
121  if (s) {
122  pShape=s;
123  shape=pShape->GetName();
124  }
125 }
126 
128 {
129  // Sets the mother of the volume
130  if (moth) {
131  pMother=moth;
132  mother=pMother->GetName();
133  pMother->AddDaughter(this);
134  }
135 }
136 
138 {
139  if (medium) { return medium->isSensitive(); }
140  else { return kFALSE; }
141 }
142 
143 #endif /* !FAIRGEONODE_H */