Geant4 9.6.0
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4VPrimitiveScorer.hh
Go to the documentation of this file.
1//
2// ********************************************************************
3// * License and Disclaimer *
4// * *
5// * The Geant4 software is copyright of the Copyright Holders of *
6// * the Geant4 Collaboration. It is provided under the terms and *
7// * conditions of the Geant4 Software License, included in the file *
8// * LICENSE and available at http://cern.ch/geant4/license . These *
9// * include a list of copyright holders. *
10// * *
11// * Neither the authors of this software system, nor their employing *
12// * institutes,nor the agencies providing financial support for this *
13// * work make any representation or warranty, express or implied, *
14// * regarding this software system or assume any liability for its *
15// * use. Please see the license in the file LICENSE and URL above *
16// * for the full disclaimer and the limitation of liability. *
17// * *
18// * This code implementation is the result of the scientific and *
19// * technical work of the GEANT4 collaboration. *
20// * By using, copying, modifying or distributing the software (or *
21// * any work based on the software) you agree to acknowledge its *
22// * use in resulting scientific publications, and indicate your *
23// * acceptance of all terms of the Geant4 Software license. *
24// ********************************************************************
25//
26//
27// $Id$
28//
29
30#ifndef G4VPrimitiveScorer_h
31#define G4VPrimitiveScorer_h 1
32
33class G4Step;
34class G4HCofThisEvent;
36#include "globals.hh"
37#include "G4VSDFilter.hh"
39
40// class description:
41//
42// This is the base class of the sensitive detector which owns
43// only one hits collection.
44// A concrete class object derived from this base class can be
45// used either as a sensitive detector or to be registered to
46// G4MultiFunctionalDetector to define multiple functionalities.
47//
48//
49
51{
53
54 public: // with description
55 G4VPrimitiveScorer(G4String name, G4int depth=0);
56 virtual ~G4VPrimitiveScorer();
57
58 protected: // with description
60 // This is the method must be implemented in each concrete class.
61
62 virtual G4int GetIndex(G4Step*);
63 // This is a function mapping from copy number(s) to an index of
64 // the hit collection. In the default implementation, just the
65 // copy number of the physical volume is taken.
66
67 public: // with description
69 // This method returns the ID of its hitsCollection. This mehod
70 // gives valid value only after it is registered to G4MultiFunctionalDetector
71 // and the G4MultiFunctionalDetector is registered to G4SDManager.
72
73 virtual void Initialize(G4HCofThisEvent*);
74 virtual void EndOfEvent(G4HCofThisEvent*);
75 virtual void clear();
76 virtual void DrawAll();
77 virtual void PrintAll();
78 // These five methods are exactly identical to those in G4VSensitiveDetector.
79 // These methods are invoked by G4SDManager through G4MultiFunctionalDetector.
80
81 void SetUnit(const G4String& unit) { unitName = unit; }
82 const G4String& GetUnit() const { return unitName; }
83 G4double GetUnitValue() const { return unitValue; }
84
85 protected:
86 void CheckAndSetUnit(const G4String& unit,const G4String& category);
87
88 protected:
96
97 public: // with description
98 // Set/Get methods
100 { detector = d; }
102 { return detector; }
103 inline G4String GetName() const
104 { return primitiveName; }
105 inline void SetFilter(G4VSDFilter* f)
106 { filter = f; }
107 inline G4VSDFilter* GetFilter() const
108 { return filter; }
109 inline void SetVerboseLevel(G4int vl)
110 { verboseLevel = vl; }
111 inline G4int GetVerboseLevel() const
112 { return verboseLevel; }
113
114 private:
115 inline G4bool HitPrimitive(G4Step*aStep,G4TouchableHistory*ROhis)
116 {
117 if(filter)
118 { if(!(filter->Accept(aStep))) return false; }
119 return ProcessHits(aStep,ROhis);
120 }
121
122 protected:
123 G4int fNi, fNj, fNk; // used for 3D scorers
124 public:
125 inline void SetNijk(G4int i,G4int j,G4int k)
126 { fNi = i; fNj = j; fNk = k; }
127};
128
129
130
131#endif
132
double G4double
Definition: G4Types.hh:64
int G4int
Definition: G4Types.hh:66
bool G4bool
Definition: G4Types.hh:67
Definition: G4Step.hh:78
virtual void DrawAll()
void SetUnit(const G4String &unit)
virtual void Initialize(G4HCofThisEvent *)
virtual G4int GetIndex(G4Step *)
void SetMultiFunctionalDetector(G4MultiFunctionalDetector *d)
virtual void PrintAll()
G4VSDFilter * GetFilter() const
void SetNijk(G4int i, G4int j, G4int k)
virtual void EndOfEvent(G4HCofThisEvent *)
void SetFilter(G4VSDFilter *f)
G4String GetName() const
G4MultiFunctionalDetector * GetMultiFunctionalDetector() const
void SetVerboseLevel(G4int vl)
const G4String & GetUnit() const
G4MultiFunctionalDetector * detector
virtual G4bool ProcessHits(G4Step *, G4TouchableHistory *)=0
G4int GetCollectionID(G4int)
G4int GetVerboseLevel() const
void CheckAndSetUnit(const G4String &unit, const G4String &category)
G4double GetUnitValue() const
virtual G4bool Accept(const G4Step *) const =0