Geant4  v4-10.4-release
 모두 클래스 네임스페이스들 파일들 함수 변수 타입정의 열거형 타입 열거형 멤버 Friends 매크로 그룹들 페이지들
G4VSensitiveDetector.cc
이 파일의 문서화 페이지로 가기
1 //
2 // ********************************************************************
3 // * License and Disclaimer *
4 // * *
5 // * The Geant4 software is copyright of the Copyright Holders of *
6 // * the Geant4 Collaboration. It is provided under the terms and *
7 // * conditions of the Geant4 Software License, included in the file *
8 // * LICENSE and available at http://cern.ch/geant4/license . These *
9 // * include a list of copyright holders. *
10 // * *
11 // * Neither the authors of this software system, nor their employing *
12 // * institutes,nor the agencies providing financial support for this *
13 // * work make any representation or warranty, express or implied, *
14 // * regarding this software system or assume any liability for its *
15 // * use. Please see the license in the file LICENSE and URL above *
16 // * for the full disclaimer and the limitation of liability. *
17 // * *
18 // * This code implementation is the result of the scientific and *
19 // * technical work of the GEANT4 collaboration. *
20 // * By using, copying, modifying or distributing the software (or *
21 // * any work based on the software) you agree to acknowledge its *
22 // * use in resulting scientific publications, and indicate your *
23 // * acceptance of all terms of the Geant4 Software license. *
24 // ********************************************************************
25 //
26 //
27 // $Id: G4VSensitiveDetector.cc 94771 2015-12-09 09:44:05Z gcosmo $
28 //
29 // G4VSensitiveDetector
30 #include "G4VSensitiveDetector.hh"
31 #include "G4SDManager.hh"
32 
34 :verboseLevel(0),active(true),
35  ROgeometry(nullptr),filter(nullptr)
36 {
37  size_t sLast = name.last('/');
38  if(sLast==std::string::npos)
39  { // detector name only
41  thePathName = "/";
42  }
43  else
44  { // name conatin the directory path
46  SensitiveDetectorName.remove(0,sLast+1);
47  thePathName = name;
48  thePathName.remove(sLast+1,name.length()-sLast);
49  if(thePathName(0)!='/') thePathName.prepend("/");
50  }
52 }
53 
55 {
57  thePathName = right.thePathName;
58  fullPathName = right.fullPathName;
59  verboseLevel = right.verboseLevel;
60  active = right.active;
61  ROgeometry = right.ROgeometry;
62  filter = right.filter;
63 }
64 
66 {
67 }
68 
70 {
72  msg << "Derived class does not implement cloning,\n"
73  << "but Clone method called.\n"
74  << "Cannot continue;";
75  G4Exception("G4VSensitiveDetector::Clone","Det0010",FatalException,msg);
76  return nullptr;
77 }
78 
80 {
81  if (this == &right ) return *this;
83  thePathName = right.thePathName;
84  fullPathName = right.fullPathName;
85  verboseLevel = right.verboseLevel;
86  active = right.active;
87  ROgeometry = right.ROgeometry;
88  filter = right.filter;
89  return *this;
90 }
91 
93 {
94  return (this==&right);
95 }
96 
98 {
99  return (this!=&right);
100 }
101 
103 {
105 }
106 
107 //----- following methoods are abstract methods to be
108 //----- implemented in the concrete classes
109 
111 {
112 }
113 
115 {
116 }
117 
119 {
120 }
121 
123 {
124 }
125 
127 {
128 }
129 
virtual G4int GetCollectionID(G4int i)
G4int GetCollectionID(G4String colName)
Definition: G4SDManager.cc:135
G4String & remove(str_size)
const XML_Char * name
Definition: expat.h:151
G4int operator==(const G4VSensitiveDetector &right) const
std::ostringstream G4ExceptionDescription
Definition: G4Exception.hh:45
G4VReadOutGeometry * ROgeometry
G4VSensitiveDetector & operator=(const G4VSensitiveDetector &right)
virtual void EndOfEvent(G4HCofThisEvent *)
G4VSensitiveDetector(G4String name)
virtual void Initialize(G4HCofThisEvent *)
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
Definition: G4Exception.hh:65
static G4SDManager * GetSDMpointer()
Definition: G4SDManager.cc:40
int G4int
Definition: G4Types.hh:78
G4int last(char) const
G4CollectionNameVector collectionName
G4int operator!=(const G4VSensitiveDetector &right) const
G4String & prepend(const char *)
virtual G4VSensitiveDetector * Clone() const