Warning, file /geant4/examples/advanced/composite_calorimeter/src/CCalSDList.cc was not indexed
or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025
0026
0027
0028
0029
0030 #include "CCalSDList.hh"
0031
0032 G4ThreadLocal CCalSDList* CCalSDList::theList = nullptr;
0033
0034
0035 CCalSDList::CCalSDList() {}
0036
0037
0038 CCalSDList::~CCalSDList() {}
0039
0040
0041 CCalSDList* CCalSDList::getInstance() {
0042 if ( theList == nullptr ) {
0043 static G4ThreadLocalSingleton< CCalSDList > inst;
0044 theList = inst.Instance();
0045 }
0046 return theList;
0047 }
0048
0049
0050 void CCalSDList::addCalo( nameType name ) {
0051 theList->caloSD.push_back(name);
0052 }
0053
0054
0055 void CCalSDList::addTracker( nameType name ) {
0056 theList->trackerSD.push_back(name);
0057 }
0058
0059
0060 nameType CCalSDList::getCaloSDName( G4int i ) {
0061 if (i>=theList->getNumberOfCaloSD() || i<0) {
0062 G4cout << "CCalSDList invalid calo SD no: " << i << " max is "
0063 << theList->getNumberOfCaloSD() << G4endl;
0064 return " ";
0065 } else
0066 return theList->caloSD[i];
0067 }
0068
0069
0070 nameType CCalSDList::getTrackerSDName( G4int i ) {
0071 if (i>=theList->getNumberOfTrackerSD() || i<0) {
0072 G4cout << "CCalSDList invalid tracker SD no: " << i << " max is "
0073 << theList->getNumberOfTrackerSD() << G4endl;
0074 return " ";
0075 } else {
0076 return theList->trackerSD[i];
0077 }
0078 }
0079
0080
0081 G4int CCalSDList::getNumberOfCaloSD() {
0082 return theList->caloSD.size();
0083 }
0084
0085
0086 G4int CCalSDList::getNumberOfTrackerSD() {
0087 return theList->trackerSD.size();
0088 }
0089
0090
0091 CCalSDList& CCalSDList::operator=( CCalSDList& ) {
0092 return *this;
0093 }