Geant4
11.4.0
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4VMoleculeCounter.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
// G4VMoleculeCounter.cc
27
// Geant4
28
//
29
// Created by Mathieu Karamitros on 02/11/2016.
30
// Modified by Christian Velten on 10/27/2024.
31
//
32
//
33
34
#include "
G4VMoleculeCounter.hh
"
35
36
#include "
G4MoleculeCounterTemplates.hh
"
37
#include "
G4ios.hh
"
38
39
//------------------------------------------------------------------------------
40
41
G4VMoleculeCounter::G4VMoleculeCounter
() :
G4VMoleculeCounterInternalBase
() {}
42
43
G4VMoleculeCounter::G4VMoleculeCounter
(
const
G4String
& name, MoleculeCounterType type)
44
:
G4VMoleculeCounterInternalBase
(
name
), fType(type)
45
{}
46
47
//------------------------------------------------------------------------------
48
49
void
G4VMoleculeCounter::SetSensitiveToStepping
(
G4bool
flag)
50
{
51
if
(
fType
==
MoleculeCounterType::Basic
&& flag) {
52
G4ExceptionDescription
errMsg;
53
errMsg <<
"Cannot set a molecule counter of type 'Basic' to be sensitive to stepping!"
54
<<
G4endl
;
55
G4Exception
(
"G4VMoleculeCounter::SetSensitiveToStepping"
,
"NOT_ALLOWED"
,
FatalException
, errMsg);
56
}
57
fSensitiveToStepping
= flag;
58
}
59
60
//------------------------------------------------------------------------------
61
62
G4bool
G4VMoleculeCounter::IsReactantIgnored
(
const
G4MoleculeDefinition
* molecule)
const
63
{
64
return
G4::MoleculeCounter::Contains
(
fIgnoredMolecules
, molecule);
65
}
66
67
//------------------------------------------------------------------------------
68
69
G4bool
G4VMoleculeCounter::IsReactantIgnored
(
const
G4MolecularConfiguration
* reactant)
const
70
{
71
return
G4::MoleculeCounter::Contains
(
fIgnoredReactants
, reactant);
72
}
FatalException
@ FatalException
Definition
G4ExceptionSeverity.hh:67
G4Exception
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
Definition
G4Exception.cc:59
G4ExceptionDescription
std::ostringstream G4ExceptionDescription
Definition
G4Exception.hh:40
G4MoleculeCounterTemplates.hh
G4bool
bool G4bool
Definition
G4Types.hh:86
G4VMoleculeCounter.hh
G4ios.hh
G4endl
#define G4endl
Definition
G4ios.hh:67
G4MolecularConfiguration
Definition
G4MolecularConfiguration.hh:98
G4MoleculeDefinition
Definition
G4MoleculeDefinition.hh:77
G4String
Definition
G4String.hh:62
G4VMoleculeCounterInternalBase
Definition
G4VMoleculeCounterInternalBase.hh:63
G4VMoleculeCounterInternalBase::G4VMoleculeCounter
friend class G4VMoleculeCounter
Definition
G4VMoleculeCounterInternalBase.hh:64
G4VMoleculeCounter::fSensitiveToStepping
G4bool fSensitiveToStepping
Definition
G4VMoleculeCounter.hh:96
G4VMoleculeCounter::fIgnoredMolecules
std::set< const G4MoleculeDefinition * > fIgnoredMolecules
Definition
G4VMoleculeCounter.hh:99
G4VMoleculeCounter::IsReactantIgnored
G4bool IsReactantIgnored(const G4MoleculeDefinition *) const
Definition
G4VMoleculeCounter.cc:62
G4VMoleculeCounter::fIgnoredReactants
std::set< const G4MolecularConfiguration * > fIgnoredReactants
Definition
G4VMoleculeCounter.hh:100
G4VMoleculeCounter::SetSensitiveToStepping
void SetSensitiveToStepping(G4bool=true)
Definition
G4VMoleculeCounter.cc:49
G4VMoleculeCounter::fType
MoleculeCounterType fType
Definition
G4VMoleculeCounter.hh:94
G4VMoleculeCounter::Basic
@ Basic
Definition
G4VMoleculeCounter.hh:58
G4InuclParticleNames::name
const char * name(G4int ptype)
Definition
G4InuclParticleNames.hh:76
G4::MoleculeCounter::Contains
G4bool Contains(const std::set< T > &_set, const T &_value)
Definition
G4MoleculeCounterTemplates.hh:54
geant4-v11.4.0
source
processes
electromagnetic
dna
molecules
management
src
G4VMoleculeCounter.cc
Generated by
1.16.1