]> git.uio.no Git - u/mrichter/AliRoot.git/blob - ITS/AliITSInitGeometry.h
Removing unsupported code related to beam test setups, old trackers and old geometries
[u/mrichter/AliRoot.git] / ITS / AliITSInitGeometry.h
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
10 /////////////////////////////////////////////////////////////////////
11 // Class to inilize AliITSgeom and the like for both simulation
12 //  and reconstruction.
13 /////////////////////////////////////////////////////////////////////
14
15 #include <TObject.h>
16 #include <TString.h>
17 #include "AliITSgeom.h"
18
19 typedef enum {
20   kvDefault=0,kvPPRcourseasymm=6,kvPPRasymmFMD=10,
21   kv11=11,kv11Hybrid=110
22 } AliITSVersion_t;
23
24 class TArrayD;
25 class TGeoHMatrix;
26 class TDatime;
27
28 class AliITSInitGeometry : public TObject{
29  public:
30
31     AliITSInitGeometry();//Default Constructor
32     AliITSInitGeometry(AliITSVersion_t version,
33                        Int_t minorversion=2);//Standard Constructor
34     //virtual ~AliITSInitGeometry(); // Destructor
35     //
36     // Create and initialize geometry from TGeo
37     AliITSgeom* CreateAliITSgeom();
38     AliITSgeom* CreateAliITSgeom(Int_t major,Int_t minor); 
39     Bool_t InitAliITSgeom(AliITSgeom *geom);//Initilize geometry from gGeoManager
40     // Getters and Setters
41     // Getters and Setters
42     void    SetVersion(AliITSVersion_t maj,Int_t min) {// Set Major and Minor versions
43         fMajorVersion=maj;fMinorVersion=min;}
44     TString GetGeometryName()const {return fName;}// Return geometry name
45     void    SetGeometryName(const Char_t *name){fName = name;}// Set Geometry name
46     Int_t   GetMajorVersion()const {return (Int_t)fMajorVersion;} // Return geometry major version
47     Int_t   GetMinorVersion()const{return fMinorVersion;}// Return geometry minor version
48     Bool_t  GetTiming()const{return fTiming;} // return routine timing flag
49     void    SetTiming(Bool_t time=kTRUE){fTiming=time;}// Set routine timing (on)
50     Bool_t  GetSegGeom()const{return fSegGeom;} // return flag indecating the use of AliITSsegmentation or AliITSgeomS?D class in fShape.
51     void    SetSegGeom(Bool_t seg=kTRUE){fSegGeom = seg;}// Set the use of AliITSsegmentation class' instead of AliITSgeomS?D class in fShape
52     Bool_t  GetDecoding()const{return fDecode;}// Return flag indecating wether to use new/old decoding
53     void    SetDecoding(Bool_t newdec=kFALSE){fDecode = newdec;}// Set flag to use new/old decoding
54      // Set debug level. debug=0 no debug info outputted.
55     void    SetDebug(Int_t debug=0){fDebug=debug;};
56     // Retrun debug value
57     Int_t   GetDebug()const{return fDebug;};
58     // Decode module number into old layer, ladder, and detector numbers
59     void DecodeDetectorLayers(Int_t mod,Int_t &lay,Int_t &lad,Int_t &det);
60     // find module number by layer, and copy numbers
61     void DecodeDetector(Int_t &mod,Int_t lay,Int_t cpn0,
62                         Int_t cpn1,Int_t cpn2) const;
63     // Given module number, find copy numbers.
64     void RecodeDetector(Int_t mod,Int_t &cpn0,Int_t &cpn1,Int_t &cpn2);
65    // fills the string str with the major and minor version number
66     Bool_t WriteVersionString(Char_t *str,Int_t length,
67                               AliITSVersion_t maj,Int_t min,
68                               const Char_t *cvsDate,const Char_t *cvsRev)const;
69     // decodes the string str with the major and minor version number
70     Bool_t ReadVersionString(const Char_t *str,Int_t length,
71                              AliITSVersion_t &maj,Int_t &min,TDatime &dt)const;
72
73     static Bool_t SPDIsTGeoNative() {return !fgkOldSPDbarrel;}
74     static Bool_t SDDIsTGeoNative() {return !fgkOldSDDbarrel;}
75     static Bool_t SSDIsTGeoNative() {return !fgkOldSSDbarrel;}
76
77     static Bool_t SDDconeIsTGeoNative()   {return ! fgkOldSDDcone;} 
78     static Bool_t SSDconeIsTGeoNative()   {return ! fgkOldSSDcone;}
79     static Bool_t SPDshieldIsTGeoNative() {return ! fgkOldSPDshield;}
80     static Bool_t SDDshieldIsTGeoNative() {return ! fgkOldSDDshield; }
81     static Bool_t SSDshieldIsTGeoNative() {return ! fgkOldSSDshield;}
82     static Bool_t ServicesAreTGeoNative() {return ! fgkOldServices;}
83     static Bool_t SupportIsTGeoNative()   {return ! fgkOldSupports;}
84
85  private:
86     // Decode module number into old layer, ladder, and detector numbers
87     void DecodeDetectorLayersvPPRcourseasymm(Int_t mod,Int_t &lay,
88                                    Int_t &lad,Int_t &det) const {
89         lay=lad=det=mod;/*Dummy*/};
90     // find module number by layer, and copy numbers
91     void DecodeDetectorvPPRcourseasymm(Int_t &mod,Int_t lay,Int_t cpn0,
92                              Int_t cpn1,Int_t cpn2) const{
93         mod=lay=cpn0=cpn1=cpn2;/*Dummy*/};
94     // Given module number, find copy numbers.
95     void RecodeDetectorvPPRcourseasymm(Int_t mod,Int_t &cpn0,Int_t &cpn1,
96                              Int_t &cpn2) const {
97         cpn0=cpn1=cpn2=mod;/*Dummy*/};
98     // Decode module number into old layer, ladder, and detector numbers
99     void DecodeDetectorLayersvPPRasymmFMD(Int_t mod,Int_t &lay,
100                                          Int_t &lad,Int_t &det);
101     // find module number by layer, and copy numbers
102     void DecodeDetectorvPPRasymmFMD(Int_t &mod,Int_t lay,Int_t cpn0,
103                                     Int_t cpn1,Int_t cpn2) const;
104     // Given module number, find copy numbers.
105     void RecodeDetectorvPPRasymmFMD(Int_t mod,Int_t &cpn0,Int_t &cpn1,
106                                     Int_t &cpn2);
107     // Decode module number into old layer, ladder, and detector numbers
108     void DecodeDetectorLayersv11(Int_t mod,Int_t &lay,
109                                          Int_t &lad,Int_t &det)const{
110         lay=lad=det=mod;};
111     // find module number by layer, and copy numbers
112     void DecodeDetectorv11(Int_t &mod,Int_t lay,Int_t cpn0,
113                                     Int_t cpn1,Int_t cpn2) const{
114         mod=lay=cpn0=cpn1=cpn2;};
115     // Given module number, find copy numbers.
116     void RecodeDetectorv11(Int_t mod,Int_t &cpn0,Int_t &cpn1,
117                                     Int_t &cpn2)const{
118         cpn0=cpn1=cpn2=mod;};
119     // Decode module number into old layer, ladder, and detector numbers
120     void DecodeDetectorv11Hybrid(Int_t &mod,Int_t lay,Int_t cpn0,Int_t cpn1,
121                                  Int_t cpn2)const;
122     // find module number by layer, and copy numbers
123     void RecodeDetectorv11Hybrid(Int_t mod,Int_t &cpn0,Int_t &cpn1,
124                                     Int_t &cpn2);
125     // Given module number, find copy numbers.
126     void DecodeDetectorLayersv11Hybrid(Int_t mod,Int_t &lay,Int_t &lad,
127                                     Int_t &det);
128                    
129     // Virtual MC code reproduction
130     Bool_t InitAliITSgeomPPRasymmFMD(AliITSgeom *geom);
131     Bool_t InitAliITSgeomV11Hybrid(AliITSgeom *geom);
132     Bool_t InitAliITSgeomV11(AliITSgeom *geom);
133     Bool_t InitGeomShapePPRasymmFMD(AliITSDetector idet,Bool_t *initSeg,
134                                        TArrayD &shapePar,AliITSgeom *geom);
135     Bool_t InitSegmentationPPRasymmFMD(AliITSDetector idet,Bool_t *initSeg,
136                                        TArrayD &shapePar,AliITSgeom *geom);
137     Bool_t GetTransformation(const TString &volumePath,TGeoHMatrix &mat);
138     Bool_t GetShape(const TString &volumePath,TString &shapeType,TArrayD &par);
139     void TransposeTGeoHMatrix(TGeoHMatrix *m) const;
140
141     TString         fName;         // Geometry name
142     Int_t           fMinorVersion; // Geometry minor version
143     AliITSVersion_t fMajorVersion; // Geometry swich value
144     Bool_t          fTiming;       // Flag to start inilization timing
145     Bool_t          fSegGeom;      // Flag to switch between the old use of
146                                    // AliITSgeomS?D class, or AliITSsegmentation
147                                    // class in fShape of AliITSgeom class.
148     Bool_t          fDecode;       // Flag for new/old decoding
149     Int_t           fDebug;        // Debug flag
150
151     static const Bool_t fgkOldSPDbarrel;   // use old geo for SPD ?
152     static const Bool_t fgkOldSDDbarrel;   // use old geo for SDD ?
153     static const Bool_t fgkOldSSDbarrel;   // use old geo for SSD ?
154     static const Bool_t fgkOldSDDcone;    // use old geo for SDD cone ?
155     static const Bool_t fgkOldSSDcone;    // use old geo for SSD cone?
156     static const Bool_t fgkOldSPDshield;  // use old geo for SPD shield ?
157     static const Bool_t fgkOldSDDshield;  // use old geo for SDD shield ?
158     static const Bool_t fgkOldSSDshield;  // use old geo for SDD shield ?
159     static const Bool_t fgkOldServices;  // use old geo for services ?
160     static const Bool_t fgkOldSupports;  // use old geo for supports ?
161
162     ClassDef(AliITSInitGeometry,0) // create/Init AliITSgeom
163     // 0 in ClassDef indicates that this class will not be "saved" in a file.
164 };
165
166 #endif
167