]> git.uio.no Git - u/mrichter/AliRoot.git/blob - TGeant4/TG4SDServices.h
Enable clusterizing from any Digits branch
[u/mrichter/AliRoot.git] / TGeant4 / TG4SDServices.h
1 // $Id$
2 // Category: digits+hits
3 //
4 // Sensitive detectors services
5 // The class provides service methods for accessing to Geant4 geometry,
6 // namely using AliMC volumes identifiers
7 // (implemented via TG4VSensitiveDetector instances).
8
9 #ifndef TG4_SD_SERVICES_H
10 #define TG4_SD_SERVICES_H
11
12 #include <globals.hh>
13
14 #include <Rtypes.h>
15
16 class TG4VSensitiveDetector;
17
18 class G4LogicalVolume;
19 class G4VSensitiveDetector;
20
21 class TG4SDServices
22 {
23   public:
24     TG4SDServices();
25     // --> protected
26     // TG4SDServices(const TG4SDServices& right);
27     virtual ~TG4SDServices();
28
29     // static methods
30     static TG4SDServices* Instance();
31
32     // methods
33     void PrintStatistics(G4bool open, G4bool close) const;
34
35     // get methods
36           // volume IDs conversions
37     G4int GetVolumeID(const G4String& volumeName) const;
38     G4int GetVolumeID(G4LogicalVolume* volume) const;
39     G4String         GetVolumeName(G4int volumeId) const;
40     G4LogicalVolume* GetLogicalVolume(G4int volumeId) const;   
41     G4int            GetMediumId(G4int volumeId) const; 
42           // SDs
43     Int_t NofSensitiveDetectors() const; 
44     TG4VSensitiveDetector* GetSensitiveDetector(G4VSensitiveDetector* sd) const;  
45
46   protected:
47     TG4SDServices(const TG4SDServices& right);
48
49     // operators
50     TG4SDServices& operator=(const TG4SDServices& right);
51   
52     // static data members
53     static TG4SDServices* fgInstance;   //this instance
54 };
55
56 // inline methods
57 inline TG4SDServices* TG4SDServices::Instance() 
58 { return fgInstance; }
59
60 #endif //TG4_SD_SERVICES_H
61