ROOT logo
#ifndef ALIITSINITGEOMETRY_H
#define ALIITSINITGEOMETRY_H
/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
 * See cxx source for full Copyright notice                               */

/*
$Id$
*/

/////////////////////////////////////////////////////////////////////
// Class to inilize AliITSgeom and the like for both simulation
//  and reconstruction.
/////////////////////////////////////////////////////////////////////

#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();//Default Constructor
    AliITSInitGeometry(AliITSVersion_t version);//Standard Constructor
    //virtual ~AliITSInitGeometry(); // Destructor
    //
    // Create and initialize geometry from TGeo
    AliITSgeom* CreateAliITSgeom();
    AliITSgeom* CreateAliITSgeom(Int_t major); 
    Bool_t InitAliITSgeom(AliITSgeom *geom);//Initilize geometry from gGeoManager
    // Getters and Setters
    // Getters and Setters
    void    SetVersion(AliITSVersion_t maj) {// Set version
        fMajorVersion=maj;}
    TString GetGeometryName()const {return fName;}// Return geometry name
    void    SetGeometryName(const Char_t *name){fName = name;}// Set Geometry name
    Int_t   GetMajorVersion()const {return (Int_t)fMajorVersion;} // Return geometry major version
    Bool_t  GetTiming()const{return fTiming;} // return routine timing flag
    void    SetTiming(Bool_t time=kTRUE){fTiming=time;}// Set routine timing (on)
    Bool_t  GetSegGeom()const{return fSegGeom;} // return flag indecating the use of AliITSsegmentation or AliITSgeomS?D class in fShape.
    void    SetSegGeom(Bool_t seg=kTRUE){fSegGeom = seg;}// Set the use of AliITSsegmentation class' instead of AliITSgeomS?D class in fShape
    Bool_t  GetDecoding()const{return fDecode;}// Return flag indecating wether to use new/old decoding
    void    SetDecoding(Bool_t newdec=kFALSE){fDecode = newdec;}// Set flag to use new/old decoding
     // Set debug level. debug=0 no debug info outputted.
    void    SetDebug(Int_t debug=0){fDebug=debug;};
    // Retrun debug value
    Int_t   GetDebug()const{return fDebug;};
    // Decode module number into old layer, ladder, and detector numbers
    void DecodeDetectorLayers(Int_t mod,Int_t &lay,Int_t &lad,Int_t &det);
    // find module number by layer, and copy numbers
    void DecodeDetector(Int_t &mod,Int_t lay,Int_t cpn0,
                        Int_t cpn1,Int_t cpn2) const;
    // Given module number, find copy numbers.
    void RecodeDetector(Int_t mod,Int_t &cpn0,Int_t &cpn1,Int_t &cpn2);
   // fills the string str with the version number
    Bool_t WriteVersionString(Char_t *str,Int_t length,
                              AliITSVersion_t maj)const;

 private:
    // decodes the string str with the version number
    Bool_t ReadVersionString(const Char_t *str,AliITSVersion_t &maj)const;

    // Decode module number into old layer, ladder, and detector numbers
    void DecodeDetectorLayersv11(Int_t mod,Int_t &lay,
				 Int_t &lad,Int_t &det);
    // find module number by layer, and copy numbers
    void DecodeDetectorv11(Int_t &mod,Int_t lay,Int_t cpn0,Int_t cpn1,
			   Int_t cpn2)const;
    // Given module number, find copy numbers.
    void RecodeDetectorv11(Int_t mod,Int_t &cpn0,Int_t &cpn1,
			   Int_t &cpn2);		   
    // Virtual MC code 
    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;         // Geometry name
    AliITSVersion_t fMajorVersion; // Geometry swich value
    Bool_t          fTiming;       // Flag to start inilization timing
    Bool_t          fSegGeom;      // Flag to switch between the old use of
                                   // AliITSgeomS?D class, or AliITSsegmentation
                                   // class in fShape of AliITSgeom class.
    Bool_t          fDecode;       // Flag for new/old decoding
    Int_t           fDebug;        // Debug flag


    ClassDef(AliITSInitGeometry,0) // create/Init AliITSgeom
    // 0 in ClassDef indicates that this class will not be "saved" in a file.
};

#endif

 AliITSInitGeometry.h:1
 AliITSInitGeometry.h:2
 AliITSInitGeometry.h:3
 AliITSInitGeometry.h:4
 AliITSInitGeometry.h:5
 AliITSInitGeometry.h:6
 AliITSInitGeometry.h:7
 AliITSInitGeometry.h:8
 AliITSInitGeometry.h:9
 AliITSInitGeometry.h:10
 AliITSInitGeometry.h:11
 AliITSInitGeometry.h:12
 AliITSInitGeometry.h:13
 AliITSInitGeometry.h:14
 AliITSInitGeometry.h:15
 AliITSInitGeometry.h:16
 AliITSInitGeometry.h:17
 AliITSInitGeometry.h:18
 AliITSInitGeometry.h:19
 AliITSInitGeometry.h:20
 AliITSInitGeometry.h:21
 AliITSInitGeometry.h:22
 AliITSInitGeometry.h:23
 AliITSInitGeometry.h:24
 AliITSInitGeometry.h:25
 AliITSInitGeometry.h:26
 AliITSInitGeometry.h:27
 AliITSInitGeometry.h:28
 AliITSInitGeometry.h:29
 AliITSInitGeometry.h:30
 AliITSInitGeometry.h:31
 AliITSInitGeometry.h:32
 AliITSInitGeometry.h:33
 AliITSInitGeometry.h:34
 AliITSInitGeometry.h:35
 AliITSInitGeometry.h:36
 AliITSInitGeometry.h:37
 AliITSInitGeometry.h:38
 AliITSInitGeometry.h:39
 AliITSInitGeometry.h:40
 AliITSInitGeometry.h:41
 AliITSInitGeometry.h:42
 AliITSInitGeometry.h:43
 AliITSInitGeometry.h:44
 AliITSInitGeometry.h:45
 AliITSInitGeometry.h:46
 AliITSInitGeometry.h:47
 AliITSInitGeometry.h:48
 AliITSInitGeometry.h:49
 AliITSInitGeometry.h:50
 AliITSInitGeometry.h:51
 AliITSInitGeometry.h:52
 AliITSInitGeometry.h:53
 AliITSInitGeometry.h:54
 AliITSInitGeometry.h:55
 AliITSInitGeometry.h:56
 AliITSInitGeometry.h:57
 AliITSInitGeometry.h:58
 AliITSInitGeometry.h:59
 AliITSInitGeometry.h:60
 AliITSInitGeometry.h:61
 AliITSInitGeometry.h:62
 AliITSInitGeometry.h:63
 AliITSInitGeometry.h:64
 AliITSInitGeometry.h:65
 AliITSInitGeometry.h:66
 AliITSInitGeometry.h:67
 AliITSInitGeometry.h:68
 AliITSInitGeometry.h:69
 AliITSInitGeometry.h:70
 AliITSInitGeometry.h:71
 AliITSInitGeometry.h:72
 AliITSInitGeometry.h:73
 AliITSInitGeometry.h:74
 AliITSInitGeometry.h:75
 AliITSInitGeometry.h:76
 AliITSInitGeometry.h:77
 AliITSInitGeometry.h:78
 AliITSInitGeometry.h:79
 AliITSInitGeometry.h:80
 AliITSInitGeometry.h:81
 AliITSInitGeometry.h:82
 AliITSInitGeometry.h:83
 AliITSInitGeometry.h:84
 AliITSInitGeometry.h:85
 AliITSInitGeometry.h:86
 AliITSInitGeometry.h:87
 AliITSInitGeometry.h:88
 AliITSInitGeometry.h:89
 AliITSInitGeometry.h:90
 AliITSInitGeometry.h:91
 AliITSInitGeometry.h:92
 AliITSInitGeometry.h:93
 AliITSInitGeometry.h:94
 AliITSInitGeometry.h:95
 AliITSInitGeometry.h:96
 AliITSInitGeometry.h:97
 AliITSInitGeometry.h:98
 AliITSInitGeometry.h:99
 AliITSInitGeometry.h:100
 AliITSInitGeometry.h:101