Geant4  10.03.p01
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
G4MultiFunctionalDetector Class Reference

#include <G4MultiFunctionalDetector.hh>

Inheritance diagram for G4MultiFunctionalDetector:
Collaboration diagram for G4MultiFunctionalDetector:

Public Member Functions

 G4MultiFunctionalDetector (G4String)
 
G4bool RegisterPrimitive (G4VPrimitiveScorer *)
 
G4bool RemovePrimitive (G4VPrimitiveScorer *)
 
G4int GetNumberOfPrimitives () const
 
G4VPrimitiveScorerGetPrimitive (G4int id) const
 
virtual ~G4MultiFunctionalDetector ()
 
virtual void Initialize (G4HCofThisEvent *)
 
virtual void EndOfEvent (G4HCofThisEvent *)
 
virtual void clear ()
 
virtual void DrawAll ()
 
virtual void PrintAll ()
 
- Public Member Functions inherited from G4VSensitiveDetector
 G4VSensitiveDetector (G4String name)
 
 G4VSensitiveDetector (const G4VSensitiveDetector &right)
 
virtual ~G4VSensitiveDetector ()
 
G4VSensitiveDetectoroperator= (const G4VSensitiveDetector &right)
 
G4int operator== (const G4VSensitiveDetector &right) const
 
G4int operator!= (const G4VSensitiveDetector &right) const
 
G4bool Hit (G4Step *aStep)
 
void SetROgeometry (G4VReadOutGeometry *value)
 
void SetFilter (G4VSDFilter *value)
 
G4int GetNumberOfCollections () const
 
G4String GetCollectionName (G4int id) const
 
void SetVerboseLevel (G4int vl)
 
void Activate (G4bool activeFlag)
 
G4bool isActive () const
 
G4String GetName () const
 
G4String GetPathName () const
 
G4String GetFullPathName () const
 
G4VReadOutGeometryGetROgeometry () const
 
G4VSDFilterGetFilter () const
 
virtual G4VSensitiveDetectorClone () const
 

Protected Member Functions

virtual G4bool ProcessHits (G4Step *, G4TouchableHistory *)
 
- Protected Member Functions inherited from G4VSensitiveDetector
virtual G4int GetCollectionID (G4int i)
 

Protected Attributes

std::vector< G4VPrimitiveScorer * > primitives
 
- Protected Attributes inherited from G4VSensitiveDetector
G4CollectionNameVector collectionName
 
G4String SensitiveDetectorName
 
G4String thePathName
 
G4String fullPathName
 
G4int verboseLevel
 
G4bool active
 
G4VReadOutGeometryROgeometry
 
G4VSDFilterfilter
 

Detailed Description

Definition at line 48 of file G4MultiFunctionalDetector.hh.

Constructor & Destructor Documentation

G4MultiFunctionalDetector::G4MultiFunctionalDetector ( G4String  name)

Definition at line 38 of file G4MultiFunctionalDetector.cc.

40 {;}
G4VSensitiveDetector(G4String name)
G4MultiFunctionalDetector::~G4MultiFunctionalDetector ( )
virtual

Definition at line 42 of file G4MultiFunctionalDetector.cc.

43 {
44  for(auto pr : primitives) delete pr;
45  primitives.clear();
46 }
std::vector< G4VPrimitiveScorer * > primitives

Member Function Documentation

void G4MultiFunctionalDetector::clear ( )
virtual

Reimplemented from G4VSensitiveDetector.

Definition at line 109 of file G4MultiFunctionalDetector.cc.

110 {
111  for(auto pr : primitives)
112  { pr->clear(); }
113 }
std::vector< G4VPrimitiveScorer * > primitives
void G4MultiFunctionalDetector::DrawAll ( )
virtual

Reimplemented from G4VSensitiveDetector.

Definition at line 115 of file G4MultiFunctionalDetector.cc.

116 {
117  for(auto pr : primitives)
118  { pr->DrawAll(); }
119 }
std::vector< G4VPrimitiveScorer * > primitives
void G4MultiFunctionalDetector::EndOfEvent ( G4HCofThisEvent HC)
virtual

Reimplemented from G4VSensitiveDetector.

Definition at line 103 of file G4MultiFunctionalDetector.cc.

104 {
105  for(auto pr : primitives)
106  { pr->EndOfEvent(HC); }
107 }
std::vector< G4VPrimitiveScorer * > primitives
G4int G4MultiFunctionalDetector::GetNumberOfPrimitives ( ) const
inline

Definition at line 62 of file G4MultiFunctionalDetector.hh.

63  { return primitives.size(); }
std::vector< G4VPrimitiveScorer * > primitives

Here is the caller graph for this function:

G4VPrimitiveScorer* G4MultiFunctionalDetector::GetPrimitive ( G4int  id) const
inline

Definition at line 64 of file G4MultiFunctionalDetector.hh.

65  { return primitives[id]; }
std::vector< G4VPrimitiveScorer * > primitives

Here is the caller graph for this function:

void G4MultiFunctionalDetector::Initialize ( G4HCofThisEvent HC)
virtual

Reimplemented from G4VSensitiveDetector.

Definition at line 97 of file G4MultiFunctionalDetector.cc.

98 {
99  for(auto pr : primitives)
100  { pr->Initialize(HC); }
101 }
std::vector< G4VPrimitiveScorer * > primitives
void G4MultiFunctionalDetector::PrintAll ( )
virtual

Reimplemented from G4VSensitiveDetector.

Definition at line 121 of file G4MultiFunctionalDetector.cc.

122 {
123  for(auto pr : primitives)
124  { pr->PrintAll(); }
125 }
std::vector< G4VPrimitiveScorer * > primitives
G4bool G4MultiFunctionalDetector::ProcessHits ( G4Step aStep,
G4TouchableHistory aTH 
)
protectedvirtual

Implements G4VSensitiveDetector.

Definition at line 48 of file G4MultiFunctionalDetector.cc.

49 {
50  if(aStep->GetStepLength()>0. || aStep->GetTotalEnergyDeposit()>0.){
51  for(auto pr : primitives)
52  { pr->HitPrimitive(aStep,aTH); }
53  }
54  return true;
55 }
G4double GetStepLength() const
std::vector< G4VPrimitiveScorer * > primitives
G4double GetTotalEnergyDeposit() const

Here is the call graph for this function:

G4bool G4MultiFunctionalDetector::RegisterPrimitive ( G4VPrimitiveScorer aPS)

Definition at line 57 of file G4MultiFunctionalDetector.cc.

58 {
59  for(auto pr : primitives)
60  {
61  if(pr==aPS)
62  {
64  ED << "Primitive <" << aPS->GetName() << "> is already defined in <" << SensitiveDetectorName
65  << ">." << G4endl << "Method RegisterPrimitive() is ignored." << G4endl;
66  G4Exception("G4MultiFunctionalDetector::RegisterPrimitive","Det0101",
67  JustWarning,ED);
68  return false;
69  }
70  }
71  primitives.push_back(aPS);
72  aPS->SetMultiFunctionalDetector(this);
75  {
76  // This G4MultiFunctionalDetector has already been registered to G4SDManager.
77  // Make sure this new primitive is registered as well.
79  }
80  return true;
81 }
void AddNewCollection(G4String SDname, G4String DCname)
Definition: G4SDManager.cc:92
G4String GetName() const
std::ostringstream G4ExceptionDescription
Definition: globals.hh:76
std::vector< G4VPrimitiveScorer * > primitives
G4VSensitiveDetector * FindSensitiveDetector(G4String dName, G4bool warning=true)
Definition: G4SDManager.cc:128
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
Definition: G4Exception.cc:41
static G4SDManager * GetSDMpointer()
Definition: G4SDManager.cc:40
#define G4endl
Definition: G4ios.hh:61
void SetMultiFunctionalDetector(G4MultiFunctionalDetector *d)
G4CollectionNameVector collectionName

Here is the call graph for this function:

Here is the caller graph for this function:

G4bool G4MultiFunctionalDetector::RemovePrimitive ( G4VPrimitiveScorer aPS)

Definition at line 83 of file G4MultiFunctionalDetector.cc.

84 {
85  auto pr = std::find(primitives.begin(),primitives.end(),aPS);
86  if(pr!=primitives.end())
87  {
88  primitives.erase(pr);
89  aPS->SetMultiFunctionalDetector(nullptr);
90  return true;
91  }
92  G4cerr << "Primitive <" << aPS->GetName() << "> is not defined in <" << SensitiveDetectorName
93  << ">." << G4endl << "Method RemovePrimitive() is ignored." << G4endl;
94  return false;
95 }
G4String GetName() const
std::vector< G4VPrimitiveScorer * > primitives
#define G4endl
Definition: G4ios.hh:61
void SetMultiFunctionalDetector(G4MultiFunctionalDetector *d)
G4GLOB_DLL std::ostream G4cerr

Here is the call graph for this function:

Member Data Documentation

std::vector<G4VPrimitiveScorer*> G4MultiFunctionalDetector::primitives
protected

Definition at line 57 of file G4MultiFunctionalDetector.hh.


The documentation for this class was generated from the following files: