]> git.uio.no Git - u/mrichter/AliRoot.git/blob - ITS/UPGRADE/AliITSUInitGeometry.h
update in integrated v2 macro
[u/mrichter/AliRoot.git] / ITS / UPGRADE / AliITSUInitGeometry.h
1 #ifndef ALIITSUINITGEOMETRY_H
2 #define ALIITSUINITGEOMETRY_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: AliITSUInitGeometry.h $
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 class TArrayD;
20 class TGeoHMatrix;
21 class TDatime;
22
23 class AliITSUInitGeometry : public TObject{
24  public:
25
26     AliITSUInitGeometry();//Default Constructor
27     AliITSUInitGeometry(AliITSVersion_t version,Int_t minorversion=2);//Standard Constructor
28     //virtual ~AliITSUInitGeometry(); // Destructor
29     //
30     // Create and initialize geometry from TGeo
31     AliITSgeom* CreateAliITSgeom();
32     AliITSgeom* CreateAliITSgeom(Int_t major,Int_t minor); 
33     Bool_t InitAliITSgeom(AliITSgeom *geom);//Initilize geometry from gGeoManager
34     TString GetGeometryName()const {return fName;}// Return geometry name
35     void    SetGeometryName(const Char_t *name){fName = name;}// Set Geometry name
36     Bool_t  GetTiming()const{return fTiming;} // return routine timing flag
37     void    SetTiming(Bool_t time=kTRUE){fTiming=time;}// Set routine timing (on)
38     void    SetDebug(Int_t debug=0){fDebug=debug;};
39     // Retrun debug value
40     Int_t   GetDebug()const{return fDebug;};
41     // Decode module number into old layer, ladder, and detector numbers
42     void DecodeDetectorLayers(Int_t mod,Int_t &lay,Int_t &lad,Int_t &det);
43     // find module number by layer, and copy numbers
44     void  DecodeDetector(Int_t &mod,Int_t lay,Int_t cpn0,
45                          Int_t cpn1,Int_t cpn2) const;
46     // Given module number, find copy numbers.
47     void  RecodeDetector(Int_t mod,Int_t &cpn0,Int_t &cpn1,Int_t &cpn2);
48     Int_t GetNumberOfLayers();
49     Int_t GetNumberOfLadders(const Int_t lay) const;
50     Int_t GetNumberOfModules(const Int_t lay) const;
51     Int_t GetLayerDetTypeID(const Int_t lay) const;
52     //
53  private:
54     // Decode module number into old layer, ladder, and detector numbers
55     void DecodeDetectorLayersv11(Int_t mod,Int_t &lay,
56                                  Int_t &lad,Int_t &det);
57     // find module number by layer, and copy numbers
58     void DecodeDetectorv11(Int_t &mod,Int_t lay,Int_t cpn0,Int_t cpn1,
59                            Int_t cpn2)const;
60     // Given module number, find copy numbers.
61     void RecodeDetectorv11(Int_t mod,Int_t &cpn0,Int_t &cpn1,
62                            Int_t &cpn2);
63     // Decode module number into old layer, ladder, and detector numbers
64     void DecodeDetectorvUpgrade(Int_t &mod,Int_t lay,Int_t cpn0,Int_t cpn1,
65                                     Int_t cpn2)const;
66     // find module number by layer, and copy numbers
67     void RecodeDetectorvUpgrade(Int_t mod,Int_t &cpn0,Int_t &cpn1,
68                                     Int_t &cpn2);
69     // Given module number, find copy numbers.
70     void DecodeDetectorLayersvUpgrade(Int_t mod,Int_t &lay,Int_t &lad,
71                                     Int_t &det);
72                    
73     // Virtual MC code 
74     Bool_t InitAliITSgeomV11(AliITSgeom *geom);
75     Bool_t InitAliITSgeomVUpgrade(AliITSgeom *geom);
76     Bool_t GetTransformation(const TString &volumePath,TGeoHMatrix &mat);
77     Bool_t GetShape(const TString &volumePath,TString &shapeType,TArrayD &par);
78     void TransposeTGeoHMatrix(TGeoHMatrix *m) const;
79
80     TString         fName;         // Geometry name
81     Bool_t          fTiming;       // Flag to start inilization timing
82     Int_t           fDebug;        // Debug flag
83
84     ClassDef(AliITSUInitGeometry,0) // create/Init AliITSgeom
85     // 0 in ClassDef indicates that this class will not be "saved" in a file.
86 };
87
88 #endif
89