Geant4  10.03.p02
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
CCalSensitiveDetectors Class Reference

#include <CCalSensitiveDetectors.hh>

Public Member Functions

 ~CCalSensitiveDetectors ()
 
std::vector< G4LogicalVolume * > getVolumes (const G4String &name, bool exists=0)
 
void registerVolume (const G4String &name, G4LogicalVolume *)
 
bool setSensitive (const G4String &string, G4VSensitiveDetector *sens)
 

Static Public Member Functions

static CCalSensitiveDetectorsgetInstance ()
 

Detailed Description

Definition at line 41 of file CCalSensitiveDetectors.hh.

Constructor & Destructor Documentation

CCalSensitiveDetectors::~CCalSensitiveDetectors ( )
inline

Definition at line 44 of file CCalSensitiveDetectors.hh.

44 {};

Member Function Documentation

CCalSensitiveDetectors * CCalSensitiveDetectors::getInstance ( )
static

Definition at line 38 of file CCalSensitiveDetectors.cc.

38  {
39  if (!theInstance) theInstance = new CCalSensitiveDetectors;
40  return theInstance;
41 }

Here is the caller graph for this function:

std::vector< G4LogicalVolume * > CCalSensitiveDetectors::getVolumes ( const G4String name,
bool  exists = 0 
)

Definition at line 54 of file CCalSensitiveDetectors.cc.

55  {
56 
57  mmslv::const_iterator mmscite;
58  std::pair<mmslv::iterator, mmslv::iterator> mmsdi;
59  mmsdi = theLVs.equal_range(string);
60  std::vector<G4LogicalVolume*> lvs;
61  for (mmscite = mmsdi.first; mmscite != mmsdi.second; mmscite++ ) {
62  lvs.push_back(const_cast<G4LogicalVolume*>((*mmscite).second));
63  }
64 
65  if (exist) G4cout << "CCalSensitiveDetector : " << lvs.size()
66  << " detectors for " << string << G4endl;
67 
68  return lvs;
69 }
G4GLOB_DLL std::ostream G4cout
#define G4endl
Definition: G4ios.hh:61
void CCalSensitiveDetectors::registerVolume ( const G4String name,
G4LogicalVolume logv 
)

Definition at line 44 of file CCalSensitiveDetectors.cc.

45  {
46 
47  theLVs.insert(mmslv::value_type(string, logv));
48 #ifdef debug
49  G4cout << "CCalSensitiveDetectors : Register " << logv->GetName()
50  << " in category " << string << G4endl;
51 #endif
52 }
G4GLOB_DLL std::ostream G4cout
#define G4endl
Definition: G4ios.hh:61
const G4String & GetName() const

Here is the call graph for this function:

Here is the caller graph for this function:

bool CCalSensitiveDetectors::setSensitive ( const G4String string,
G4VSensitiveDetector sens 
)

Definition at line 72 of file CCalSensitiveDetectors.cc.

73  {
74 
75  bool result=false;
76  mmslv::const_iterator mmscite;
77  std::pair<mmslv::iterator, mmslv::iterator> mmsdi;
78  mmsdi = theLVs.equal_range(string);
79  for (mmscite = mmsdi.first; mmscite != mmsdi.second; mmscite++ ) {
80  G4LogicalVolume* lv = const_cast<G4LogicalVolume*>((*mmscite).second);
81  lv ->SetSensitiveDetector(sens);
82  result = true;
83 #ifdef debug
84  G4cout << " Associate SD " << sens->GetName() << " to " << lv->GetName()
85  << G4endl;
86 #endif
87  }
88  return result;
89 
90 }
G4double G4ParticleHPJENDLHEData::G4double result
G4GLOB_DLL std::ostream G4cout
#define G4endl
Definition: G4ios.hh:61
const G4String & GetName() const
void SetSensitiveDetector(G4VSensitiveDetector *pSDetector)

Here is the call graph for this function:

Here is the caller graph for this function:


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