#ifndef ALIITSINITGEOMETRY_H
#define ALIITSINITGEOMETRY_H
#include <TObject.h>
#include <TString.h>
class AliITSgeom;
typedef enum {
kvDefault=0,kv11=11
} AliITSVersion_t;
class TArrayD;
class TGeoHMatrix;
class TDatime;
class AliITSInitGeometry : public TObject{
public:
AliITSInitGeometry();
AliITSInitGeometry(AliITSVersion_t version);
AliITSgeom* CreateAliITSgeom();
AliITSgeom* CreateAliITSgeom(Int_t major);
Bool_t InitAliITSgeom(AliITSgeom *geom);
void SetVersion(AliITSVersion_t maj) {
fMajorVersion=maj;}
TString GetGeometryName()const {return fName;}
void SetGeometryName(const Char_t *name){fName = name;}
Int_t GetMajorVersion()const {return (Int_t)fMajorVersion;}
Bool_t GetTiming()const{return fTiming;}
void SetTiming(Bool_t time=kTRUE){fTiming=time;}
Bool_t GetSegGeom()const{return fSegGeom;}
void SetSegGeom(Bool_t seg=kTRUE){fSegGeom = seg;}
Bool_t GetDecoding()const{return fDecode;}
void SetDecoding(Bool_t newdec=kFALSE){fDecode = newdec;}
void SetDebug(Int_t debug=0){fDebug=debug;};
Int_t GetDebug()const{return fDebug;};
void DecodeDetectorLayers(Int_t mod,Int_t &lay,Int_t &lad,Int_t &det);
void DecodeDetector(Int_t &mod,Int_t lay,Int_t cpn0,
Int_t cpn1,Int_t cpn2) const;
void RecodeDetector(Int_t mod,Int_t &cpn0,Int_t &cpn1,Int_t &cpn2);
Bool_t WriteVersionString(Char_t *str,Int_t length,
AliITSVersion_t maj)const;
private:
Bool_t ReadVersionString(const Char_t *str,AliITSVersion_t &maj)const;
void DecodeDetectorLayersv11(Int_t mod,Int_t &lay,
Int_t &lad,Int_t &det);
void DecodeDetectorv11(Int_t &mod,Int_t lay,Int_t cpn0,Int_t cpn1,
Int_t cpn2)const;
void RecodeDetectorv11(Int_t mod,Int_t &cpn0,Int_t &cpn1,
Int_t &cpn2);
Bool_t InitAliITSgeomV11(AliITSgeom *geom);
Bool_t GetTransformation(const TString &volumePath,TGeoHMatrix &mat);
Bool_t GetShape(const TString &volumePath,TString &shapeType,TArrayD &par);
void TransposeTGeoHMatrix(TGeoHMatrix *m) const;
TString fName;
AliITSVersion_t fMajorVersion;
Bool_t fTiming;
Bool_t fSegGeom;
Bool_t fDecode;
Int_t fDebug;
ClassDef(AliITSInitGeometry,0)
};
#endif