EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
FstGeoParData.h
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file FstGeoParData.h
1 //
2 // AYK (ayk@bnl.gov), 2014/08/07
3 //
4 // FST MAPS geometry description file;
5 //
6 
7 #include <TMath.h>
8 
9 #include <MapsGeoParData.h>
10 #include <MapsMimosaAssembly.h>
11 
12 #ifndef _FST_GEO_PAR_DATA_
13 #define _FST_GEO_PAR_DATA_
14 
15 #if _OLD_
16 class FstStave: public TObject {
17  public:
18  FstStave() { ResetVars(); };
19  FstStave(unsigned mimosaChipNum, double vOffset, bool yRot,
20  bool zRot): mMimosaChipNum(mimosaChipNum),
21  mVoffset(vOffset), mYrot(yRot), mZrot(zRot) {};
22  ~FstStave() {};
23 
24  void ResetVars() {
25  mMimosaChipNum = 0;
26  mVoffset = 0.0;
27  mYrot = mZrot = false;
28  };
29 
30  // It is assumed, that a stave is composed of short identical sections
31  // which contain Mimosa chip and all th ecable, support, cooling, etc stuff;
32  UInt_t mMimosaChipNum; // number of Mimosa chips
33  Double_t mVoffset; // vertical offset wrt the disc center
34  Bool_t mYrot; // "true" if rotated around disc Y axis
35  Bool_t mZrot; // "true" if rotated around disc Z axis
36 
37  ClassDef(FstStave,3);
38 };
39 #endif
40 
41 class FstDisc: public TObject {
42  public:
43  FstDisc() { ResetVars(); };
44  FstDisc(MapsMimosaAssembly *chipAssembly, double minRadius, double maxRadius,
45  double staveSpacing):
46  mChipAssembly(chipAssembly), mMinRadius(minRadius), mMaxRadius(maxRadius),
47  mStaveSpacing(staveSpacing) { mTransformation = 0; };
48  // This not exactly intelligent, but for now I want to duplicate same disc
49  // entries with their own Z-offset and phi rotation rather than creating
50  // an intermediate class {disc*, z, phi};
51  FstDisc(const FstDisc *sample, double beamLineOffset, double asimuthalOffset) {
52  *this = *sample;
53 
54  TGeoRotation *rw = asimuthalOffset ? new TGeoRotation() : 0;
55  if (asimuthalOffset) rw->RotateZ(asimuthalOffset);
56 
57  mTransformation = new TGeoCombiTrans(0.0, 0.0, 0.1 * beamLineOffset, rw);
58  };
59  FstDisc(const FstDisc *sample, TGeoMatrix *transformation) {
60  *this = *sample;
61  mTransformation = transformation;
62  };
63  ~FstDisc() {};
64 
65  void ResetVars() {
66  mChipAssembly = 0;
67 
68  mTransformation = 0;
70  };
71 
72  MapsMimosaAssembly *mChipAssembly; // all the details of the chip assembly
73  Double_t mMinRadius; // min radius disc can afford to occupy
74  Double_t mMaxRadius; // max radius disc can afford to occupy
75  Double_t mStaveSpacing; // stave-to-stave distance (except for central ones)
76 
77  TGeoMatrix *mTransformation; // 3D transformation
78 
79  ClassDef(FstDisc,6);
80 };
81 
83 {
84  private:
85 
86  public:
87  FstGeoParData(const char *detName = 0, int version = -1, int subVersion = 0):
88  MapsGeoParData(detName, version, subVersion) {};
90 
91  // Missing asimuthal rotation is the only reasonable default value here I guess;
92  void AddDisc(const FstDisc *disc, double beamLineOffset, double asimuthalOffset = 0.0) {
93  mDiscs.push_back(new FstDisc(disc, beamLineOffset, asimuthalOffset));
94  };
95  void AddDisc(const FstDisc *disc, TGeoMatrix *transformation) {
96  mDiscs.push_back(new FstDisc(disc, transformation));
97  };
98 
99  int ConstructGeometry(bool root = true, bool gdml = false, bool check = false);
100 
101  private:
102  std::vector <FstDisc*> mDiscs; // FST (or BST) discs
103 
105 };
106 
107 #endif