Geant4
10.03
Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
File Members
G4MultiSensitiveDetector.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
#ifndef G4MULTISENSITIVEDETECTOR_H
28
#define G4MULTISENSITIVEDETECTOR_H
29
30
#include "
G4VSensitiveDetector.hh
"
31
#include <vector>
32
33
//class description:
34
//This class allows to assign multiple sensitive detectors to a single
35
//logical-volume.
36
//SDs are added to this proxy and an instance of the proxy is assigned
37
//to the logical volume. Calls to SD methods are forwarded to ALL
38
//user-defined SD that are added.
39
40
class
G4MultiSensitiveDetector
:
public
G4VSensitiveDetector
41
{
42
public
:
43
G4MultiSensitiveDetector
(
G4String
name
);
44
//Second optional parameter allows to append to the SDname a random string
45
G4MultiSensitiveDetector
(
const
G4MultiSensitiveDetector
&rhs);
46
//Cosntructors. The name of the instance must be unique
47
virtual
~G4MultiSensitiveDetector
();
48
49
G4MultiSensitiveDetector
&
operator=
(
const
G4MultiSensitiveDetector
& rhs);
50
public
:
51
//interface from G4VSensitiveDetector starts here.
52
//See G4VSensitiveDetector for documentation.
53
//All these methods forward the call to each of the SD
54
//attached to this proxy.
55
virtual
void
Initialize
(
G4HCofThisEvent
*);
56
virtual
void
EndOfEvent
(
G4HCofThisEvent
*);
57
virtual
void
clear
();
58
virtual
void
DrawAll
();
59
virtual
void
PrintAll
();
60
protected
:
61
//The return value is an AND of the called SDs return values.
62
//This method will call the "Hit(G4Step*)" method of all
63
//added SDs. Note that the ROhist of this method is not used
64
virtual
G4bool
ProcessHits
(
G4Step
*aStep,
G4TouchableHistory
*ROhist);
65
//The following method does not have a meaning for this concrete class
66
virtual
G4int
GetCollectionID
(
G4int
i)
final
;
67
public
:
68
//Note, that cloning works only if all the contained SDs are also
69
//clonable.
70
virtual
G4VSensitiveDetector
*
Clone
()
const
;
71
public
:
72
//===== Main interface of this special SD
73
using
sds_t
= std::vector<G4VSensitiveDetector*>;
74
using
sdsConstIter
= sds_t::const_iterator;
75
G4VSensitiveDetector
*
GetSD
(
const
int
i)
const
{
return
fSensitiveDetectors
[i]; }
76
sds_t::size_type
GetSize
()
const
{
return
fSensitiveDetectors
.size(); }
77
sdsConstIter
GetBegin
()
const
{
return
fSensitiveDetectors
.begin(); }
78
sdsConstIter
GetEnd
()
const
{
return
fSensitiveDetectors
.end(); }
79
void
ClearSDs
() {
fSensitiveDetectors
.clear(); }
80
void
AddSD
(
G4VSensitiveDetector
* sd) {
fSensitiveDetectors
.push_back(sd); }
81
private
:
82
sds_t
fSensitiveDetectors
;
83
};
84
85
#endif //G4MULTISENSITIVEDETECTOR_H
G4MultiSensitiveDetector::PrintAll
virtual void PrintAll()
Definition:
G4MultiSensitiveDetector.cc:102
G4MultiSensitiveDetector::fSensitiveDetectors
sds_t fSensitiveDetectors
Definition:
G4MultiSensitiveDetector.hh:82
G4MultiSensitiveDetector::GetCollectionID
virtual G4int GetCollectionID(G4int i) final
Definition:
G4MultiSensitiveDetector.cc:117
G4VSensitiveDetector
Definition:
G4VSensitiveDetector.hh:50
G4MultiSensitiveDetector::GetBegin
sdsConstIter GetBegin() const
Definition:
G4MultiSensitiveDetector.hh:77
G4MultiSensitiveDetector::Clone
virtual G4VSensitiveDetector * Clone() const
Definition:
G4MultiSensitiveDetector.cc:128
G4MultiSensitiveDetector::DrawAll
virtual void DrawAll()
Definition:
G4MultiSensitiveDetector.cc:96
G4MultiSensitiveDetector::Initialize
virtual void Initialize(G4HCofThisEvent *)
Definition:
G4MultiSensitiveDetector.cc:74
G4MultiSensitiveDetector::EndOfEvent
virtual void EndOfEvent(G4HCofThisEvent *)
Definition:
G4MultiSensitiveDetector.cc:82
G4InuclParticleNames::name
const char * name(G4int ptype)
Definition:
G4InuclParticleNames.hh:77
G4MultiSensitiveDetector::AddSD
void AddSD(G4VSensitiveDetector *sd)
Definition:
G4MultiSensitiveDetector.hh:80
G4int
int G4int
Definition:
G4Types.hh:78
G4MultiSensitiveDetector::ProcessHits
virtual G4bool ProcessHits(G4Step *aStep, G4TouchableHistory *ROhist)
Definition:
G4MultiSensitiveDetector.cc:108
G4VSensitiveDetector.hh
G4bool
bool G4bool
Definition:
G4Types.hh:79
G4MultiSensitiveDetector::sds_t
std::vector< G4VSensitiveDetector * > sds_t
Definition:
G4MultiSensitiveDetector.hh:73
G4MultiSensitiveDetector::sdsConstIter
sds_t::const_iterator sdsConstIter
Definition:
G4MultiSensitiveDetector.hh:74
G4MultiSensitiveDetector
Definition:
G4MultiSensitiveDetector.hh:40
G4Step
Definition:
G4Step.hh:76
G4MultiSensitiveDetector::ClearSDs
void ClearSDs()
Definition:
G4MultiSensitiveDetector.hh:79
G4MultiSensitiveDetector::~G4MultiSensitiveDetector
virtual ~G4MultiSensitiveDetector()
Definition:
G4MultiSensitiveDetector.cc:49
G4MultiSensitiveDetector::GetEnd
sdsConstIter GetEnd() const
Definition:
G4MultiSensitiveDetector.hh:78
G4MultiSensitiveDetector::G4MultiSensitiveDetector
G4MultiSensitiveDetector(G4String name)
Definition:
G4MultiSensitiveDetector.cc:40
G4TouchableHistory
Definition:
G4TouchableHistory.hh:53
G4MultiSensitiveDetector::operator=
G4MultiSensitiveDetector & operator=(const G4MultiSensitiveDetector &rhs)
Definition:
G4MultiSensitiveDetector.cc:63
G4HCofThisEvent
Definition:
G4HCofThisEvent.hh:64
G4MultiSensitiveDetector::GetSize
sds_t::size_type GetSize() const
Definition:
G4MultiSensitiveDetector.hh:76
G4MultiSensitiveDetector::GetSD
G4VSensitiveDetector * GetSD(const int i) const
Definition:
G4MultiSensitiveDetector.hh:75
G4MultiSensitiveDetector::clear
virtual void clear()
Definition:
G4MultiSensitiveDetector.cc:90
G4String
Definition:
G4String.hh:45
geant4.10.03
source
digits_hits
detector
include
G4MultiSensitiveDetector.hh
Generated on Thu Feb 14 2002 02:28:02 for Geant4 by
1.8.8