Geant4 VMC Version 6.6
Loading...
Searching...
No Matches
TG4SensitiveDetector.h
Go to the documentation of this file.
1#ifndef TG4_SENSITIVE_DETECTOR_H
2#define TG4_SENSITIVE_DETECTOR_H
3
4//------------------------------------------------
5// The Geant4 Virtual Monte Carlo package
6// Copyright (C) 2007 - 2015 Ivana Hrivnacova
7// All rights reserved.
8//
9// For the licensing terms see geant4_vmc/LICENSE.
10// Contact: root-vmc@cern.ch
11//-------------------------------------------------
12
17
18#include <G4VSensitiveDetector.hh>
19#include <globals.hh>
20
21class TG4StepManager;
22
23class TVirtualMCApplication;
24class TVirtualMCSensitiveDetector;
25
38
40{
41 public:
42 TG4SensitiveDetector(G4String sdName, G4int mediumID);
44 TVirtualMCSensitiveDetector* userSD, G4int mediumID, G4bool exclusiveSD);
45 virtual ~TG4SensitiveDetector();
46
47 // methods
48 virtual G4bool ProcessHits(G4Step* step, G4TouchableHistory* history);
49 virtual G4bool ProcessHitsOnBoundary(G4Step* step);
50 virtual void ProcessHitsOnTrackStart();
51 // Was user process hits
52
53 // static get method
54 static G4int GetTotalNofSensitiveDetectors();
55
56 // get methods
57 G4int GetID() const;
58 G4int GetMediumID() const;
59 TVirtualMCSensitiveDetector* GetUserSD() const;
60
61 protected:
62 void UserProcessHits();
63
64 // data members
68 TVirtualMCApplication* fMCApplication;
70 TVirtualMCSensitiveDetector* fUserSD;
71
72 private:
79
80 // data members
81 static G4ThreadLocal G4int fgSDCounter;
82
83 // data members
84 G4int fID;
85 G4int fMediumID;
87 std::map<G4LogicalVolume*, G4int> fLVToVolIdMap;
88};
89
90// inline methods
91
97
98inline G4int TG4SensitiveDetector::GetID() const
99{
101 return fID;
102}
103
105{
107 return fMediumID;
108}
109
110inline TVirtualMCSensitiveDetector* TG4SensitiveDetector::GetUserSD() const
111{
113 return fUserSD;
114}
115
116#endif // TG4_SENSITIVE_DETECTOR_H
Sensitive detector class for calling a user defined stepping function.
static G4int GetTotalNofSensitiveDetectors()
virtual void ProcessHitsOnTrackStart()
virtual G4bool ProcessHitsOnBoundary(G4Step *step)
virtual G4bool ProcessHits(G4Step *step, G4TouchableHistory *history)
TVirtualMCApplication * fMCApplication
Cached pointer to thread-local VMC application.
TG4StepManager * fStepManager
Cached pointer to thread-local step manager.
TG4SensitiveDetector(const TG4SensitiveDetector &right)
Not implemented.
TG4SensitiveDetector & operator=(const TG4SensitiveDetector &right)
Not implemented.
TVirtualMCSensitiveDetector * fUserSD
User sensitive detector.
std::map< G4LogicalVolume *, G4int > fLVToVolIdMap
map logical volume -> volume id
TG4SensitiveDetector()
Not implemented.
G4int fID
sensitive detector ID
TVirtualMCSensitiveDetector * GetUserSD() const
static G4ThreadLocal G4int fgSDCounter
sensitive detector counter
Geant4 implementation of the TVirtualMC interface methods for access to Geant4 at step level.