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
21 class TFlukaMCGeometry :public TNamed {
24 enum EFlukaLatticeTypes {
25 kLttcOutside = 999999999,
26 kLttcVirtual = 1000000000
30 TFlukaMCGeometry(const char* name, const char* title);
31 virtual ~TFlukaMCGeometry();
34 Int_t GetMedium() const;
35 Int_t *GetRegionList(Int_t imed, Int_t &nreg);
36 Int_t *GetMaterialList(Int_t imat, Int_t &nreg);
37 Int_t GetFlukaMaterial(Int_t imed) const;
38 Int_t GetLastMaterialIndex() const {return fLastMaterial;}
39 virtual Int_t NofVolumes() const;
40 // FLUKA specific methods
41 void CreateFlukaMatFile(const char *fname=0);
42 void CreatePemfFile();
43 void PrintHeader(ofstream &out, const char *text) const;
44 Bool_t IsDebugging() const {return fDebug;}
45 void SetDebugMode(Bool_t flag=kTRUE) {fDebug = flag;}
46 void SetMreg(Int_t mreg, Int_t lttc);
47 void SetCurrentRegion(Int_t mreg, Int_t latt);
48 void GetCurrentRegion(Int_t &mreg, Int_t &latt) const {mreg=fCurrentRegion; latt=fCurrentLattice;}
49 Int_t GetDummyRegion() const {return fDummyRegion;}
50 Int_t GetDummyLattice() const {return kLttcVirtual;}
51 void SetNextRegion(Int_t mreg, Int_t latt);
52 void GetNextRegion(Int_t &mreg, Int_t &latt) const {mreg=fNextRegion; latt=fNextLattice;}
53 TGeoMaterial *GetMakeWrongMaterial(Double_t z);
54 TObjArray *GetMatList() {return fMatList;}
55 TObjArray *GetMatNames() {return fMatNames;}
56 Int_t GetElementIndex(Int_t z) const;
57 Int_t RegionId() const;
58 void ToFlukaString(TString &str) const;
59 void FlukaMatName(TString &str) const;
60 void WritePegFile(Int_t imat, Int_t *NoStern, Int_t *ElemError,
61 Int_t *MixError, Int_t *countGas) const;
62 Double_t * GetISSB(Double_t rho, Int_t nElem, Double_t *zelem, Double_t *welem ) const;
64 Double_t* CreateDoubleArray(Float_t* array, Int_t size) const;
65 void Vname(const char *name, char *vname) const;
68 TFlukaMCGeometry(const TFlukaMCGeometry& rhs);
69 TFlukaMCGeometry& operator=(const TFlukaMCGeometry& /*rhs*/) {return (*this);}
71 static TFlukaMCGeometry* fgInstance; // singleton instance
72 Bool_t fDebug; // debug flag
73 Int_t fLastMaterial; // last FLUKA material index
74 Int_t fDummyRegion; // index of dummy region
75 Int_t fCurrentRegion; // current region number
76 Int_t fCurrentLattice; // current lattice history
77 Int_t fNextRegion; // next region number
78 Int_t fNextLattice; // next lattice history
79 Int_t *fRegionList; //! region list matching a given medium number
80 Int_t fIndmat; // material index where pemf file creation starts
81 TObjArray *fMatList; //! material list as known by FLUKA
82 TObjArray *fMatNames; //! list of FLUKA material names
83 ClassDef(TFlukaMCGeometry,1) //Virtual MonteCarlo Interface
86 #endif //ROOT_TFlukaMCGeometry