Geant4
9.6.p02
Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Groups
Pages
geant4_9_6_p02
source
digits_hits
detector
include
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
33
class
G4Step
;
34
class
G4HCofThisEvent
;
35
class
G4TouchableHistory
;
36
#include "
globals.hh
"
37
#include "
G4VSDFilter.hh
"
38
#include "
G4MultiFunctionalDetector.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
50
class
G4VPrimitiveScorer
51
{
52
friend
class
G4MultiFunctionalDetector
;
53
54
public
:
// with description
55
G4VPrimitiveScorer
(
G4String
name
,
G4int
depth=0);
56
virtual
~G4VPrimitiveScorer
();
57
58
protected
:
// with description
59
virtual
G4bool
ProcessHits
(
G4Step
*,
G4TouchableHistory
*)=0;
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
68
G4int
GetCollectionID
(
G4int
);
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
:
89
G4String
primitiveName
;
90
G4MultiFunctionalDetector
*
detector
;
91
G4VSDFilter
*
filter
;
92
G4int
verboseLevel
;
93
G4int
indexDepth
;
94
G4String
unitName
;
95
G4double
unitValue
;
96
97
public
:
// with description
98
// Set/Get methods
99
inline
void
SetMultiFunctionalDetector
(
G4MultiFunctionalDetector
*
d
)
100
{
detector
=
d
; }
101
inline
G4MultiFunctionalDetector
*
GetMultiFunctionalDetector
()
const
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
Generated on Sat May 25 2013 14:33:03 for Geant4 by
1.8.4