![]() |
|
|||
File indexing completed on 2025-02-23 09:19:40
0001 // 0002 // ******************************************************************** 0003 // * License and Disclaimer * 0004 // * * 0005 // * The Geant4 software is copyright of the Copyright Holders of * 0006 // * the Geant4 Collaboration. It is provided under the terms and * 0007 // * conditions of the Geant4 Software License, included in the file * 0008 // * LICENSE and available at http://cern.ch/geant4/license . These * 0009 // * include a list of copyright holders. * 0010 // * * 0011 // * Neither the authors of this software system, nor their employing * 0012 // * institutes,nor the agencies providing financial support for this * 0013 // * work make any representation or warranty, express or implied, * 0014 // * regarding this software system or assume any liability for its * 0015 // * use. Please see the license in the file LICENSE and URL above * 0016 // * for the full disclaimer and the limitation of liability. * 0017 // * * 0018 // * This code implementation is the result of the scientific and * 0019 // * technical work of the GEANT4 collaboration. * 0020 // * By using, copying, modifying or distributing the software (or * 0021 // * any work based on the software) you agree to acknowledge its * 0022 // * use in resulting scientific publications, and indicate your * 0023 // * acceptance of all terms of the Geant4 Software license. * 0024 // ******************************************************************** 0025 // 0026 /////////////////////////////////////////////////////////////////////////////// 0027 // File: CCalSDList.cc 0028 // Description: Records names of all SD objects 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 }
[ Source navigation ] | [ Diff markup ] | [ Identifier search ] | [ general search ] |
This page was automatically generated by the 2.3.7 LXR engine. The LXR team |
![]() ![]() |