]> git.uio.no Git - u/mrichter/AliRoot.git/blob - ITS/AliITSInitGeometry.h
AliIT
[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
18 typedef enum {
19   kvPPRasymmFMD=10,kv11=11,kv11Hybrid=110,kvDefault=1
20 } AliITSVersion_t;
21
22
23 class AliITSgeom;
24 class TArrayD;
25 class TGeoHMatrix;
26
27 class AliITSInitGeometry : public TObject{
28  public:
29     AliITSInitGeometry(AliITSVersion_t 
30        version=kvPPRasymmFMD,Int_t minorversion=2);//Standard Constructor
31     //virtual ~AliITSInitGeometry(); // Destructor
32     //
33     AliITSgeom* CreateAliITSgeom(); // Create and intilize geometry from TGeom
34     Bool_t InitAliITSgeom(AliITSgeom *geom);//Initilize goemetry from gGeoManager
35     // Getters and Setters
36     TString GetGeometryName()const {return fName;}// Return geometry name
37     void    SetGeometryName(const Char_t *name){fName = name;}// Set Geometry name
38     Int_t   GetMajorVersion()const {return (Int_t)fMajorVersion;} // Return geometry major version
39     Int_t   GetMinorVersion()const{return fMinorVersion;}// Return geometry minor version
40     Bool_t  GetTiming()const{return fTiming;} // return routine timing flag
41     void    SetTiming(Bool_t time=kTRUE){fTiming=time;}// Set routine timing (on)
42     Bool_t  GetSegGeom()const{return fSegGeom;} // return flag indecating the use of AliITSsegmentation or AliITSgeomS?D class in fShape.
43     void    SetSegGeom(Bool_t seg=kTRUE){fSegGeom = seg;}// Set the use of AliITSsegmentation class' instead of AliITSgeomS?D class in fShape
44     Bool_t  GetDecoding()const{return fDecode;}// Return flag indecating wether to use new/old decoding
45     void    SetDecoding(Bool_t newdec=kFALSE){fDecode = newdec;}// Set flag to use new/old decoding
46
47     static const Bool_t SPDIsTGeoNative() {return !fgkOldSPDbarrel;}
48     static const Bool_t SDDIsTGeoNative() {return !fgkOldSDDbarrel;}
49     static const Bool_t SSDIsTGeoNative() {return !fgkOldSSDbarrel;}
50
51     static const Bool_t SDDconeIsTGeoNative()   {return ! fgkOldSDDcone;} 
52     static const Bool_t SSDconeIsTGeoNative()   {return ! fgkOldSSDcone;}
53     static const Bool_t SPDshieldIsTGeoNative() {return ! fgkOldSPDshield;}
54     static const Bool_t SDDshieldIsTGeoNative() {return ! fgkOldSDDshield; }
55     static const Bool_t SSDshieldIsTGeoNative() {return ! fgkOldSSDshield;}
56     static const Bool_t ServicesAreTGeoNative() {return ! fgkOldServices;}
57     static const Bool_t SupportIsTGeoNative()   {return ! fgkOldSupports;}
58
59  private:                  
60     // Virtual MC code reproduction
61     Bool_t InitAliITSgeomPPRasymmFMD(AliITSgeom *geom);
62     Bool_t InitAliITSgeomV11Hybrid(AliITSgeom *geom);
63     Bool_t InitAliITSgeomV11(AliITSgeom *geom);
64     Bool_t InitGeomShapePPRasymmFMD(AliITSDetector idet,Bool_t *initSeg,
65                                        TArrayD &shapePar,AliITSgeom *geom);
66     Bool_t InitSegmentationPPRasymmFMD(AliITSDetector idet,Bool_t *initSeg,
67                                        TArrayD &shapePar,AliITSgeom *geom);
68     Bool_t GetTransformation(const TString &volumePath,TGeoHMatrix &mat);
69     Bool_t GetShape(const TString &volumePath,TString &shapeType,TArrayD &par);
70     void DecodeDetectorLayers(Int_t mod,Int_t &lay,Int_t &lad,Int_t &det);
71     void DecodeDetector(Int_t &mod,Int_t lay,Int_t cpn0,
72                         Int_t cpn1,Int_t cpn2) const;
73     void RecodeDetector(Int_t mod,Int_t &cpn0,Int_t &cpn1,Int_t &cpn2);
74
75     TString   fName;          // Geometry name
76     Int_t           fMinorVersion;  // Geometry minor version
77     AliITSVersion_t fMajorVersion;  // Geometry swich value
78     Bool_t          fTiming;        // Flag to start inilization timing
79     Bool_t          fSegGeom;       // Flag to switch between the old use of
80                               // AliITSgeomS?D class, or AliITSsegmentation
81                               // class in fShape of AliITSgeom class.
82     Bool_t          fDecode;        // Flag for new/old decoding
83
84     static const Bool_t fgkOldSPDbarrel;   // use old geo for SPD ?
85     static const Bool_t fgkOldSDDbarrel;   // use old geo for SDD ?
86     static const Bool_t fgkOldSSDbarrel;   // use old geo for SSD ?
87     static const Bool_t fgkOldSDDcone;    // use old geo for SDD cone ?
88     static const Bool_t fgkOldSSDcone;    // use old geo for SSD cone?
89     static const Bool_t fgkOldSPDshield;  // use old geo for SPD shield ?
90     static const Bool_t fgkOldSDDshield;  // use old geo for SDD shield ?
91     static const Bool_t fgkOldSSDshield;  // use old geo for SDD shield ?
92     static const Bool_t fgkOldServices;  // use old geo for services ?
93     static const Bool_t fgkOldSupports;  // use old geo for supports ?
94
95     ClassDef(AliITSInitGeometry,0) // create/Init AliITSgeom
96     // 0 in ClassDef indicates that this class will not be "saved" in a file.
97 };
98
99 #endif
100