Geant4-11
source
digits_hits
scorer
src
G4SDKineticEnergyFilter.cc
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
//
28
// G4VSensitiveDetector
29
#include "
G4SDKineticEnergyFilter.hh
"
30
#include "
G4Step.hh
"
31
#include "
G4UnitsTable.hh
"
33
// class description:
34
//
35
// This is the class of a filter to be associated with a
36
// sensitive detector.
37
//
38
//
39
// Created: 2005-11-14 Tsukasa ASO.
40
//
42
43
G4SDKineticEnergyFilter::G4SDKineticEnergyFilter
(
G4String
name
,
G4double
elow,
44
G4double
ehigh)
45
:
G4VSDFilter
(
name
)
46
, fLowEnergy(elow)
47
, fHighEnergy(ehigh)
48
{
49
;
50
}
51
52
G4SDKineticEnergyFilter::~G4SDKineticEnergyFilter
() { ; }
53
54
G4bool
G4SDKineticEnergyFilter::Accept
(
const
G4Step
* aStep)
const
55
{
56
G4double
kinetic = aStep->
GetPreStepPoint
()->
GetKineticEnergy
();
57
if
(kinetic <
fLowEnergy
)
58
return
FALSE
;
59
if
(kinetic >=
fHighEnergy
)
60
return
FALSE
;
61
return
TRUE
;
62
}
63
64
void
G4SDKineticEnergyFilter::SetKineticEnergy
(
G4double
elow,
G4double
ehigh)
65
{
66
fLowEnergy
= elow;
67
fHighEnergy
= ehigh;
68
}
69
70
void
G4SDKineticEnergyFilter::show
()
71
{
72
G4cout
<<
" G4SDKineticEnergyFilter:: "
<<
GetName
() <<
" LowE "
73
<<
G4BestUnit
(
fLowEnergy
,
"Energy"
) <<
" HighE "
74
<<
G4BestUnit
(
fHighEnergy
,
"Energy"
) <<
G4endl
;
75
}
G4SDKineticEnergyFilter.hh
G4Step.hh
G4BestUnit
#define G4BestUnit(a, b)
Definition:
G4SteppingVerbose.cc:45
G4double
double G4double
Definition:
G4Types.hh:83
G4bool
bool G4bool
Definition:
G4Types.hh:86
G4UnitsTable.hh
G4endl
#define G4endl
Definition:
G4ios.hh:57
G4cout
G4GLOB_DLL std::ostream G4cout
TRUE
#define TRUE
Definition:
Globals.hh:27
FALSE
#define FALSE
Definition:
Globals.hh:23
G4SDKineticEnergyFilter::SetKineticEnergy
void SetKineticEnergy(G4double elow, G4double ehigh)
Definition:
G4SDKineticEnergyFilter.cc:64
G4SDKineticEnergyFilter::fHighEnergy
G4double fHighEnergy
Definition:
G4SDKineticEnergyFilter.hh:72
G4SDKineticEnergyFilter::~G4SDKineticEnergyFilter
virtual ~G4SDKineticEnergyFilter()
Definition:
G4SDKineticEnergyFilter.cc:52
G4SDKineticEnergyFilter::fLowEnergy
G4double fLowEnergy
Definition:
G4SDKineticEnergyFilter.hh:71
G4SDKineticEnergyFilter::show
void show()
Definition:
G4SDKineticEnergyFilter.cc:70
G4SDKineticEnergyFilter::G4SDKineticEnergyFilter
G4SDKineticEnergyFilter(G4String name, G4double elow=0.0, G4double ehigh=DBL_MAX)
Definition:
G4SDKineticEnergyFilter.cc:43
G4SDKineticEnergyFilter::Accept
virtual G4bool Accept(const G4Step *) const
Definition:
G4SDKineticEnergyFilter.cc:54
G4StepPoint::GetKineticEnergy
G4double GetKineticEnergy() const
G4Step
Definition:
G4Step.hh:62
G4Step::GetPreStepPoint
G4StepPoint * GetPreStepPoint() const
G4String
Definition:
G4String.hh:62
G4VSDFilter
Definition:
G4VSDFilter.hh:41
G4VSDFilter::GetName
G4String GetName() const
Definition:
G4VSDFilter.hh:55
G4InuclParticleNames::name
const char * name(G4int ptype)
Definition:
G4InuclParticleNames.hh:76
Generated by
1.9.3