Project
Loading...
Searching...
No Matches
FairGeoNode.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 FAIRGEONODE_H
9#define FAIRGEONODE_H
10
11#include "FairGeoBasicShape.h" // for FairGeoBasicShape
12#include "FairGeoMedium.h" // for FairGeoMedium
13#include "FairGeoTransform.h" // for FairGeoTransform
14#include "FairGeoVolume.h" // for FairGeoVolume
15
16#include <Rtypes.h> // for Bool_t, FairGeoNode::Class, etc
17#include <TObjArray.h> // for TObjArray
18#include <TString.h> // for TString
19#include <iosfwd> // for fstream
20
21class FairGeoVector;
22class TArrayD;
23class TGeoVolume;
24class TList;
25
34
40{
41 private:
43 FairGeoNode& operator=(const FairGeoNode&);
44
45 protected:
46 Bool_t active;
49 Bool_t created;
51 TGeoVolume* rootVolume;
56 TObjArray* fDaughterList;
57 // const char* fTruncName; //
58 TString fTruncName;
59
60 public:
63 virtual ~FairGeoNode();
64 void AddDaughter(FairGeoNode* fNode) { fDaughterList->AddLast(fNode); }
65 TObjArray* GetListOfDaughters() { return fDaughterList; }
67 Bool_t isTopNode() { return static_cast<Bool_t>((volumeType == kFairGeoTopNode)); }
68 Bool_t isRefNode() { return static_cast<Bool_t>((volumeType == kFairGeoRefNode)); }
69 Bool_t isKeepin() { return static_cast<Bool_t>((volumeType == kFairGeoKeepin)); }
70 Bool_t isModule() { return static_cast<Bool_t>((volumeType == kFairGeoModule)); }
71 Int_t getCopyNo();
75 Bool_t isActive() { return active; }
77 TArrayD* getParameters();
81 TGeoVolume* getRootVolume() { return rootVolume; }
82 TList* getTree();
83 Bool_t isSensitive();
84 Bool_t isCreated() { return created; }
85 void setCreated() { created = kTRUE; }
86 void setName(const Text_t* s);
90 void setMother(FairGeoNode* s);
91 void setMedium(FairGeoMedium* med) { medium = med; }
92 void setActive(Bool_t a = kTRUE) { active = a; }
95 void setRootVolume(TGeoVolume* p) { rootVolume = p; }
100 void clear();
101 void print();
102 Bool_t write(std::fstream&);
103 Int_t compare(FairGeoNode&);
104
105 void setTruncName(const char* aName) { fTruncName = aName; }
106 const char* getTruncName()
107 {
108 if (fTruncName.Length() > 0) {
109 return fTruncName.Data();
110 } else {
111 return GetName();
112 }
113 }
114
116};
117
118// -------------------- inlines --------------------------
119
120inline void FairGeoNode::setName(const Text_t* s)
121{
122 // Sets the name of the volume
123 fName = s;
124 fName.ToUpper();
125}
126
128{
129 // Sets the shape of the volume
130 if (s) {
131 pShape = s;
132 shape = pShape->GetName();
133 }
134}
135
137{
138 // Sets the mother of the volume
139 if (moth) {
140 pMother = moth;
141 mother = pMother->GetName();
142 pMother->AddDaughter(this);
143 }
144}
145
147{
148 if (medium) {
149 return medium->isSensitive();
150 } else {
151 return kFALSE;
152 }
153}
154
155#endif /* !FAIRGEONODE_H */
EFairGeoNodeType
Definition FairGeoNode.h:27
@ kFairGeoRefNode
Definition FairGeoNode.h:32
@ kFairGeoKeepin
Definition FairGeoNode.h:29
@ kFairGeoElement
Definition FairGeoNode.h:28
@ kFairGeoTopNode
Definition FairGeoNode.h:31
@ kFairGeoModule
Definition FairGeoNode.h:30
Timeframe settings Average distance in cm of events merged into Randomize distance around average distance of merged events Simulate correct bunch interactions instead of placing only the average number of events A value[n] sets TFlen for[n] collisions in Number of bunches per trainsort Number of bunch trains Instantaneous interaction rate Do not simulate border Total number of collisions to be placed in the interior of all time Do not select random but walk over array of events in stride steps h Event generator settings h configStandalone Use CPU for GPU Force usage of the specified GPU device no CPU fallback Continue processing after an error s
Bool_t isSensitive()
FairGeoTransform * getPosition()
TObjArray * GetListOfDaughters()
Definition FairGeoNode.h:65
EFairGeoNodeType getVolumeType()
Definition FairGeoNode.h:66
TList * getTree()
Int_t compare(FairGeoNode &)
FairGeoBasicShape * pShape
Definition FairGeoNode.h:52
Bool_t isActive()
Definition FairGeoNode.h:75
void AddDaughter(FairGeoNode *fNode)
Definition FairGeoNode.h:64
Int_t getCopyNo()
void setName(const Text_t *s)
Bool_t created
Definition FairGeoNode.h:49
Bool_t isSensitive()
void setActive(Bool_t a=kTRUE)
Definition FairGeoNode.h:92
void setMedium(FairGeoMedium *med)
Definition FairGeoNode.h:91
Bool_t isRefNode()
Definition FairGeoNode.h:68
FairGeoMedium * medium
/‍** pointer to the mother volume *‍/
Definition FairGeoNode.h:54
void setLabTransform(FairGeoTransform &)
Bool_t write(std::fstream &)
FairGeoNode * getMotherNode()
Definition FairGeoNode.h:73
virtual ~FairGeoNode()
FairGeoNode * copyNode
Definition FairGeoNode.h:50
FairGeoBasicShape * getShapePointer()
Definition FairGeoNode.h:72
Bool_t isTopNode()
Definition FairGeoNode.h:67
void setVolumeType(EFairGeoNodeType t)
Definition FairGeoNode.h:87
FairGeoTransform * getLabTransform()
EFairGeoNodeType volumeType
Definition FairGeoNode.h:48
Bool_t isKeepin()
Definition FairGeoNode.h:69
Bool_t isModule()
Definition FairGeoNode.h:70
FairGeoTransform center
Definition FairGeoNode.h:47
void setVolumePar(FairGeoNode &)
void setRootVolume(TGeoVolume *p)
Definition FairGeoNode.h:95
FairGeoTransform & getCenterPosition()
Definition FairGeoNode.h:76
Bool_t calcModuleTransform(FairGeoTransform &)
void setTruncName(const char *aName)
TObjArray * fDaughterList
Definition FairGeoNode.h:56
Bool_t active
Definition FairGeoNode.h:46
TString fTruncName
Definition FairGeoNode.h:58
void setCreated()
Definition FairGeoNode.h:85
TGeoVolume * getRootVolume()
Definition FairGeoNode.h:81
TArrayD * getParameters()
void setCenterPosition(const FairGeoTransform &t)
Definition FairGeoNode.h:93
FairGeoNode * getCopyNode()
Definition FairGeoNode.h:80
FairGeoTransform * calcLabTransform()
void setCopyNode(FairGeoNode *p)
Definition FairGeoNode.h:94
FairGeoMedium * getMedium()
Definition FairGeoNode.h:74
TGeoVolume * rootVolume
Definition FairGeoNode.h:51
Bool_t isCreated()
Definition FairGeoNode.h:84
FairGeoNode * pMother
Definition FairGeoNode.h:53
Bool_t calcRefPos(FairGeoVector &)
void setShape(FairGeoBasicShape *s)
FairGeoTransform * labTransform
Definition FairGeoNode.h:55
void setMother(FairGeoNode *s)
ClassDef(FairGeoNode, 1)
const char * getTruncName()
GLboolean GLboolean GLboolean GLboolean a
Definition glcorearb.h:1233