FairRoot
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
FairGeoVolume.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 FAIRGEOVOLUME_H
9 #define FAIRGEOVOLUME_H
10 
11 #include "FairGeoMedium.h" // for FairGeoMedium
12 #include "FairGeoTransform.h" // for FairGeoTransform
13 #include "FairGeoVector.h" // for FairGeoVector
14 
15 #include <Rtypes.h> // for Int_t, Text_t, Double_t, etc
16 #include <TNamed.h> // for TNamed
17 #include <TObjArray.h> // for TObjArray
18 #include <TString.h> // for TString
19 #include <stddef.h> // for NULL
20 
25 class FairGeoVolume : public TNamed
26 {
27  private:
28  FairGeoVolume& operator=(const FairGeoVolume&);
29 
30  protected:
31  TString shape;
32  TString mother;
33  TObjArray* points;
37  Int_t nPoints;
38  Int_t fHadFormat; //
39  Int_t fgMCid;
41  public:
42  inline FairGeoVolume();
44  virtual ~FairGeoVolume();
45  const TString& getName() const { return fName; }
46  const TString& getShape() const { return shape; }
47  const TString& getMother() const { return mother; }
51  Int_t getNumPoints() { return nPoints; }
52  inline FairGeoVector* getPoint(const Int_t n);
53  inline void setName(const Text_t* s);
55  inline void setShape(const Text_t* s);
56  inline void setMother(const Text_t* s);
57  void createPoints(const Int_t);
58  void setPoint(const Int_t, const Double_t, const Double_t, const Double_t);
59  void setPoint(const Int_t, const FairGeoVector&);
60  virtual void clear();
61  virtual void print();
62  virtual void setHadFormat(Int_t i) { fHadFormat = i; }
63  Double_t getVolParameter(Int_t nPoint, Int_t pos);
64  Int_t getMCid() { return fgMCid; }
65  void setMCid(Int_t MCid) { fgMCid = MCid; }
66 
67  ClassDef(FairGeoVolume, 1); //
68 };
69 
70 // -------------------- inlines --------------------------
71 
73  : TNamed()
74  , shape("")
75  , mother("")
76  , points(NULL)
77  , transform(FairGeoTransform())
78  , fLabTransform(FairGeoTransform())
79  , fMedium(0)
80  , nPoints(0)
81  , fHadFormat(0)
82  , fgMCid(0)
83 {}
84 
85 inline FairGeoVector* FairGeoVolume::getPoint(const Int_t n)
86 {
87  if (points && n < nPoints) {
88  return static_cast<FairGeoVector*>(points->At(n));
89  } else {
90  return 0;
91  }
92 }
93 
94 inline void FairGeoVolume::setName(const Text_t* s)
95 {
96  fName = s;
97  fName.ToUpper();
98 }
99 
100 inline void FairGeoVolume::setShape(const Text_t* s)
101 {
102  shape = s;
103  shape.ToUpper();
104 }
105 
106 inline void FairGeoVolume::setMother(const Text_t* s)
107 {
108  mother = s;
109  mother.ToUpper();
110 }
111 
112 #endif /* !FAIRGEOVOLUME_H */
virtual ~FairGeoVolume()
Int_t getMCid()
Definition: FairGeoVolume.h:64
void setVolumePar(FairGeoVolume &)
const TString & getMother() const
Definition: FairGeoVolume.h:47
TString mother
Definition: FairGeoVolume.h:32
void setPoint(const Int_t, const Double_t, const Double_t, const Double_t)
ClassDef(FairGeoVolume, 1)
virtual void setHadFormat(Int_t i)
Definition: FairGeoVolume.h:62
void setName(const Text_t *s)
Definition: FairGeoVolume.h:94
const TString & getName() const
Definition: FairGeoVolume.h:45
Double_t getVolParameter(Int_t nPoint, Int_t pos)
FairGeoTransform fLabTransform
Definition: FairGeoVolume.h:35
void setMother(const Text_t *s)
void setMCid(Int_t MCid)
Definition: FairGeoVolume.h:65
FairGeoMedium & getMedium()
Definition: FairGeoVolume.h:50
void createPoints(const Int_t)
FairGeoVector * getPoint(const Int_t n)
Definition: FairGeoVolume.h:85
Int_t getNumPoints()
Definition: FairGeoVolume.h:51
virtual void clear()
FairGeoTransform & getLabTransform()
Definition: FairGeoVolume.h:49
FairGeoTransform transform
Definition: FairGeoVolume.h:34
FairGeoMedium fMedium
Definition: FairGeoVolume.h:36
void setShape(const Text_t *s)
FairGeoTransform & getTransform()
Definition: FairGeoVolume.h:48
const TString & getShape() const
Definition: FairGeoVolume.h:46
virtual void print()
TObjArray * points
Definition: FairGeoVolume.h:33