]>
Commit | Line | Data |
---|---|---|
023ae34b | 1 | #ifndef ALIITSINITGEOMETRY_H |
2 | #define ALIITSINITGEOMETRY_H | |
3 | /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * | |
4 | * See cxx source for full Copyright notice */ | |
5 | ||
6 | /* | |
7 | $Id$ | |
8 | */ | |
9 | ||
108bd0fe | 10 | ///////////////////////////////////////////////////////////////////// |
6b0f3880 | 11 | // Class to inilize AliITSgeom and the like for both simulation |
108bd0fe | 12 | // and reconstruction. |
6b0f3880 | 13 | ///////////////////////////////////////////////////////////////////// |
14 | ||
023ae34b | 15 | #include <TObject.h> |
023ae34b | 16 | #include <TString.h> |
012f0f4c | 17 | #include "AliITSgeom.h" |
023ae34b | 18 | |
108bd0fe | 19 | typedef enum { |
325d8c32 | 20 | kvDefault=0,kv11=11,kv11Hybrid=110 |
108bd0fe | 21 | } AliITSVersion_t; |
22 | ||
6b0f3880 | 23 | class TArrayD; |
24 | class TGeoHMatrix; | |
012f0f4c | 25 | class TDatime; |
023ae34b | 26 | |
27 | class AliITSInitGeometry : public TObject{ | |
28 | public: | |
012f0f4c | 29 | |
30 | AliITSInitGeometry();//Default Constructor | |
31 | AliITSInitGeometry(AliITSVersion_t version, | |
32 | Int_t minorversion=2);//Standard Constructor | |
023ae34b | 33 | //virtual ~AliITSInitGeometry(); // Destructor |
34 | // | |
012f0f4c | 35 | // Create and initialize geometry from TGeo |
36 | AliITSgeom* CreateAliITSgeom(); | |
37 | AliITSgeom* CreateAliITSgeom(Int_t major,Int_t minor); | |
38 | Bool_t InitAliITSgeom(AliITSgeom *geom);//Initilize geometry from gGeoManager | |
39 | // Getters and Setters | |
023ae34b | 40 | // Getters and Setters |
012f0f4c | 41 | void SetVersion(AliITSVersion_t maj,Int_t min) {// Set Major and Minor versions |
42 | fMajorVersion=maj;fMinorVersion=min;} | |
023ae34b | 43 | TString GetGeometryName()const {return fName;}// Return geometry name |
44 | void SetGeometryName(const Char_t *name){fName = name;}// Set Geometry name | |
108bd0fe | 45 | Int_t GetMajorVersion()const {return (Int_t)fMajorVersion;} // Return geometry major version |
023ae34b | 46 | Int_t GetMinorVersion()const{return fMinorVersion;}// Return geometry minor version |
023ae34b | 47 | Bool_t GetTiming()const{return fTiming;} // return routine timing flag |
48 | void SetTiming(Bool_t time=kTRUE){fTiming=time;}// Set routine timing (on) | |
49 | Bool_t GetSegGeom()const{return fSegGeom;} // return flag indecating the use of AliITSsegmentation or AliITSgeomS?D class in fShape. | |
50 | void SetSegGeom(Bool_t seg=kTRUE){fSegGeom = seg;}// Set the use of AliITSsegmentation class' instead of AliITSgeomS?D class in fShape | |
51 | Bool_t GetDecoding()const{return fDecode;}// Return flag indecating wether to use new/old decoding | |
52 | void SetDecoding(Bool_t newdec=kFALSE){fDecode = newdec;}// Set flag to use new/old decoding | |
012f0f4c | 53 | // Set debug level. debug=0 no debug info outputted. |
54 | void SetDebug(Int_t debug=0){fDebug=debug;}; | |
55 | // Retrun debug value | |
56 | Int_t GetDebug()const{return fDebug;}; | |
57 | // Decode module number into old layer, ladder, and detector numbers | |
58 | void DecodeDetectorLayers(Int_t mod,Int_t &lay,Int_t &lad,Int_t &det); | |
59 | // find module number by layer, and copy numbers | |
60 | void DecodeDetector(Int_t &mod,Int_t lay,Int_t cpn0, | |
61 | Int_t cpn1,Int_t cpn2) const; | |
62 | // Given module number, find copy numbers. | |
63 | void RecodeDetector(Int_t mod,Int_t &cpn0,Int_t &cpn1,Int_t &cpn2); | |
64 | // fills the string str with the major and minor version number | |
65 | Bool_t WriteVersionString(Char_t *str,Int_t length, | |
66 | AliITSVersion_t maj,Int_t min, | |
67 | const Char_t *cvsDate,const Char_t *cvsRev)const; | |
68 | // decodes the string str with the major and minor version number | |
69 | Bool_t ReadVersionString(const Char_t *str,Int_t length, | |
70 | AliITSVersion_t &maj,Int_t &min,TDatime &dt)const; | |
023ae34b | 71 | |
012f0f4c | 72 | static Bool_t SPDIsTGeoNative() {return !fgkOldSPDbarrel;} |
73 | static Bool_t SDDIsTGeoNative() {return !fgkOldSDDbarrel;} | |
74 | static Bool_t SSDIsTGeoNative() {return !fgkOldSSDbarrel;} | |
108bd0fe | 75 | |
012f0f4c | 76 | static Bool_t SDDconeIsTGeoNative() {return ! fgkOldSDDcone;} |
77 | static Bool_t SSDconeIsTGeoNative() {return ! fgkOldSSDcone;} | |
78 | static Bool_t SPDshieldIsTGeoNative() {return ! fgkOldSPDshield;} | |
79 | static Bool_t SDDshieldIsTGeoNative() {return ! fgkOldSDDshield; } | |
80 | static Bool_t SSDshieldIsTGeoNative() {return ! fgkOldSSDshield;} | |
81 | static Bool_t ServicesAreTGeoNative() {return ! fgkOldServices;} | |
82 | static Bool_t SupportIsTGeoNative() {return ! fgkOldSupports;} | |
108bd0fe | 83 | |
012f0f4c | 84 | private: |
85 | // Decode module number into old layer, ladder, and detector numbers | |
012f0f4c | 86 | void DecodeDetectorLayersv11(Int_t mod,Int_t &lay, |
717cdf18 | 87 | Int_t &lad,Int_t &det); |
012f0f4c | 88 | // find module number by layer, and copy numbers |
717cdf18 | 89 | void DecodeDetectorv11(Int_t &mod,Int_t lay,Int_t cpn0,Int_t cpn1, |
90 | Int_t cpn2)const; | |
012f0f4c | 91 | // Given module number, find copy numbers. |
92 | void RecodeDetectorv11(Int_t mod,Int_t &cpn0,Int_t &cpn1, | |
717cdf18 | 93 | Int_t &cpn2); |
012f0f4c | 94 | // Decode module number into old layer, ladder, and detector numbers |
95 | void DecodeDetectorv11Hybrid(Int_t &mod,Int_t lay,Int_t cpn0,Int_t cpn1, | |
96 | Int_t cpn2)const; | |
97 | // find module number by layer, and copy numbers | |
98 | void RecodeDetectorv11Hybrid(Int_t mod,Int_t &cpn0,Int_t &cpn1, | |
99 | Int_t &cpn2); | |
100 | // Given module number, find copy numbers. | |
101 | void DecodeDetectorLayersv11Hybrid(Int_t mod,Int_t &lay,Int_t &lad, | |
102 | Int_t &det); | |
103 | ||
325d8c32 | 104 | // Virtual MC code |
108bd0fe | 105 | Bool_t InitAliITSgeomV11Hybrid(AliITSgeom *geom); |
106 | Bool_t InitAliITSgeomV11(AliITSgeom *geom); | |
023ae34b | 107 | Bool_t GetTransformation(const TString &volumePath,TGeoHMatrix &mat); |
108 | Bool_t GetShape(const TString &volumePath,TString &shapeType,TArrayD &par); | |
012f0f4c | 109 | void TransposeTGeoHMatrix(TGeoHMatrix *m) const; |
023ae34b | 110 | |
012f0f4c | 111 | TString fName; // Geometry name |
112 | Int_t fMinorVersion; // Geometry minor version | |
113 | AliITSVersion_t fMajorVersion; // Geometry swich value | |
114 | Bool_t fTiming; // Flag to start inilization timing | |
115 | Bool_t fSegGeom; // Flag to switch between the old use of | |
116 | // AliITSgeomS?D class, or AliITSsegmentation | |
117 | // class in fShape of AliITSgeom class. | |
118 | Bool_t fDecode; // Flag for new/old decoding | |
119 | Int_t fDebug; // Debug flag | |
108bd0fe | 120 | |
121 | static const Bool_t fgkOldSPDbarrel; // use old geo for SPD ? | |
122 | static const Bool_t fgkOldSDDbarrel; // use old geo for SDD ? | |
123 | static const Bool_t fgkOldSSDbarrel; // use old geo for SSD ? | |
124 | static const Bool_t fgkOldSDDcone; // use old geo for SDD cone ? | |
125 | static const Bool_t fgkOldSSDcone; // use old geo for SSD cone? | |
126 | static const Bool_t fgkOldSPDshield; // use old geo for SPD shield ? | |
127 | static const Bool_t fgkOldSDDshield; // use old geo for SDD shield ? | |
128 | static const Bool_t fgkOldSSDshield; // use old geo for SDD shield ? | |
129 | static const Bool_t fgkOldServices; // use old geo for services ? | |
130 | static const Bool_t fgkOldSupports; // use old geo for supports ? | |
023ae34b | 131 | |
132 | ClassDef(AliITSInitGeometry,0) // create/Init AliITSgeom | |
133 | // 0 in ClassDef indicates that this class will not be "saved" in a file. | |
134 | }; | |
135 | ||
136 | #endif | |
137 |