1 #ifndef TFLUKAMCGEOMETRY_H
2 #define TFLUKAMCGEOMETRY_H
3 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * See cxx source for full Copyright notice */
7 // Class TFlukaMCGeometry
8 // --------------------
9 // Implementation of the TVirtualMCGeometry interface
10 // for defining and using TGeo geometry with FLUKA.
12 // Author: Andrei Gheata 10/07/2003
18 class TFlukaMCGeometry :public TNamed {
21 enum EFlukaLatticeTypes {
22 kLttcOutside = 999999999,
23 kLttcVirtual = 1000000000
27 TFlukaMCGeometry(const char* name, const char* title);
28 virtual ~TFlukaMCGeometry();
31 Int_t GetMedium() const;
32 Int_t *GetRegionList(Int_t imed, Int_t &nreg);
33 Int_t *GetMaterialList(Int_t imat, Int_t &nreg);
34 Int_t GetFlukaMaterial(Int_t imed) const;
35 Int_t GetLastMaterialIndex() const {return fLastMaterial;}
36 virtual Int_t NofVolumes() const;
38 // FLUKA specific methods
39 void CreateFlukaMatFile(const char *fname=0);
40 void PrintHeader(ofstream &out, const char *text) const;
41 Bool_t IsDebugging() const {return fDebug;}
42 void SetDebugMode(Bool_t flag=kTRUE) {fDebug = flag;}
43 void SetMreg(Int_t mreg);
44 void SetCurrentRegion(Int_t mreg, Int_t latt);
45 void GetCurrentRegion(Int_t &mreg, Int_t &latt) const {mreg=fCurrentRegion; latt=fCurrentLattice;}
46 void SetNextRegion(Int_t mreg, Int_t latt);
47 void GetNextRegion(Int_t &mreg, Int_t &latt) const {mreg=fNextRegion; latt=fNextLattice;}
48 TGeoMaterial *GetMakeWrongMaterial(Double_t z);
49 TObjArray *GetMatList() {return fMatList;}
50 TObjArray *GetMatNames() {return fMatNames;}
51 Int_t GetElementIndex(Int_t z) const;
52 Int_t RegionId() const;
53 void ToFlukaString(TString &str) const;
54 void FlukaMatName(TString &str) const;
55 void WritePegFile(Int_t imat, Int_t *NoStern, Int_t *ElemError,
56 Int_t *MixError, Int_t *countGas) const;
57 Double_t * GetISSB(Double_t rho, Int_t nElem, Double_t *zelem, Double_t *welem ) const;
59 Double_t* CreateDoubleArray(Float_t* array, Int_t size) const;
60 void Vname(const char *name, char *vname) const;
63 TFlukaMCGeometry(const TFlukaMCGeometry& rhs);
64 TFlukaMCGeometry& operator=(const TFlukaMCGeometry& rhs) {return (*this);}
66 static TFlukaMCGeometry* fgInstance; // singleton instance
67 Bool_t fDebug; // debug flag
68 Int_t fLastMaterial; // last FLUKA material index
69 Int_t fCurrentRegion; // current region number
70 Int_t fCurrentLattice; // current lattice history
71 Int_t fNextRegion; // next region number
72 Int_t fNextLattice; // next lattice history
73 Int_t *fRegionList; //! region list matching a given medium number
74 TObjArray *fMatList; //! material list as known by FLUKA
75 TObjArray *fMatNames; //! list of FLUKA material names
76 ClassDef(TFlukaMCGeometry,1) //Virtual MonteCarlo Interface
79 #endif //ROOT_TFlukaMCGeometry