00001 // 00002 // ******************************************************************** 00003 // * License and Disclaimer * 00004 // * * 00005 // * The Geant4 software is copyright of the Copyright Holders of * 00006 // * the Geant4 Collaboration. It is provided under the terms and * 00007 // * conditions of the Geant4 Software License, included in the file * 00008 // * LICENSE and available at http://cern.ch/geant4/license . These * 00009 // * include a list of copyright holders. * 00010 // * * 00011 // * Neither the authors of this software system, nor their employing * 00012 // * institutes,nor the agencies providing financial support for this * 00013 // * work make any representation or warranty, express or implied, * 00014 // * regarding this software system or assume any liability for its * 00015 // * use. Please see the license in the file LICENSE and URL above * 00016 // * for the full disclaimer and the limitation of liability. * 00017 // * * 00018 // * This code implementation is the result of the scientific and * 00019 // * technical work of the GEANT4 collaboration. * 00020 // * By using, copying, modifying or distributing the software (or * 00021 // * any work based on the software) you agree to acknowledge its * 00022 // * use in resulting scientific publications, and indicate your * 00023 // * acceptance of all terms of the Geant4 Software license. * 00024 // ******************************************************************** 00025 // 00026 // 00027 // $Id$ 00028 // 00029 // G4VSensitiveDetector 00030 #include "G4VSensitiveDetector.hh" 00031 #include "G4SDManager.hh" 00032 00033 G4VSensitiveDetector::G4VSensitiveDetector(G4String name) 00034 :verboseLevel(0),active(true),ROgeometry(0),filter(0) 00035 { 00036 size_t sLast = name.last('/'); 00037 if(sLast==std::string::npos) 00038 { // detector name only 00039 SensitiveDetectorName = name; 00040 thePathName = "/"; 00041 } 00042 else 00043 { // name conatin the directory path 00044 SensitiveDetectorName = name; 00045 SensitiveDetectorName.remove(0,sLast+1); 00046 thePathName = name; 00047 thePathName.remove(sLast+1,name.length()-sLast); 00048 if(thePathName(0)!='/') thePathName.prepend("/"); 00049 } 00050 fullPathName = thePathName + SensitiveDetectorName; 00051 } 00052 00053 G4VSensitiveDetector::G4VSensitiveDetector(const G4VSensitiveDetector &right) 00054 { 00055 SensitiveDetectorName = right.SensitiveDetectorName; 00056 thePathName = right.thePathName; 00057 fullPathName = right.fullPathName; 00058 verboseLevel = right.verboseLevel; 00059 active = right.active; 00060 ROgeometry = right.ROgeometry; 00061 filter = right.filter; 00062 } 00063 00064 G4VSensitiveDetector::~G4VSensitiveDetector() 00065 { 00066 } 00067 00068 const G4VSensitiveDetector & G4VSensitiveDetector::operator=(const G4VSensitiveDetector &right) 00069 { 00070 SensitiveDetectorName = right.SensitiveDetectorName; 00071 thePathName = right.thePathName; 00072 fullPathName = right.fullPathName; 00073 verboseLevel = right.verboseLevel; 00074 active = right.active; 00075 ROgeometry = right.ROgeometry; 00076 filter = right.filter; 00077 return *this; 00078 } 00079 00080 G4int G4VSensitiveDetector::operator==(const G4VSensitiveDetector &right) const 00081 { 00082 return (this==&right); 00083 } 00084 00085 G4int G4VSensitiveDetector::operator!=(const G4VSensitiveDetector &right) const 00086 { 00087 return (this!=&right); 00088 } 00089 00090 G4int G4VSensitiveDetector::GetCollectionID(G4int i) 00091 { 00092 return G4SDManager::GetSDMpointer()->GetCollectionID(SensitiveDetectorName+"/"+collectionName[i]); 00093 } 00094 00095 //----- following methoods are abstract methods to be 00096 //----- implemented in the concrete classes 00097 00098 void G4VSensitiveDetector::Initialize(G4HCofThisEvent*) 00099 { 00100 } 00101 00102 void G4VSensitiveDetector::EndOfEvent(G4HCofThisEvent*) 00103 { 00104 } 00105 00106 void G4VSensitiveDetector::clear() 00107 { 00108 } 00109 00110 void G4VSensitiveDetector::DrawAll() 00111 { 00112 } 00113 00114 void G4VSensitiveDetector::PrintAll() 00115 { 00116 } 00117