Geant4  v4-10.4-release
 모두 클래스 네임스페이스들 파일들 함수 변수 타입정의 열거형 타입 열거형 멤버 Friends 매크로 그룹들 페이지들
extended/exoticphysics/channeling/src/SensitiveDetectorHit.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 #include "SensitiveDetectorHit.hh"
28 #include "G4ios.hh"
29 #include "G4VVisManager.hh"
30 #include "G4Circle.hh"
31 #include "G4Colour.hh"
32 #include "G4AttDefStore.hh"
33 #include "G4AttDef.hh"
34 #include "G4AttValue.hh"
35 #include "G4UIcommand.hh"
36 #include "G4UnitsTable.hh"
37 #include "G4VisAttributes.hh"
38 #include "G4LogicalVolume.hh"
39 #include "G4SystemOfUnits.hh"
40 
41 #ifdef G4MULTITHREADED
44 #else
47 #endif
48 
49 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
50 
52  fLayerID = -1;
53 }
54 
55 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
56 
58  fLayerID = z;
59 }
60 
61 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
62 
64 }
65 
66 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
67 
70  fLayerID = right.fLayerID;
71  fWorldPos = right.fWorldPos;
72 }
73 
74 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
75 
79  fLayerID = right.fLayerID;
80  fWorldPos = right.fWorldPos;
81  return *this;
82 }
83 
84 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
85 
86 int SensitiveDetectorHit::operator==
87 (const SensitiveDetectorHit &/*right*/) const{
88  return 0;
89 }
90 
91 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
92 
95  if(pVVisManager)
96  {
97  G4Circle circle(fWorldPos);
98  circle.SetScreenSize(2);
99  circle.SetFillStyle(G4Circle::filled);
100  G4Colour colour(1.,1.,0.);
101  G4VisAttributes attribs(colour);
102  circle.SetVisAttributes(attribs);
103  pVVisManager->Draw(circle);
104  }
105 }
106 
107 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
108 
109 const std::map<G4String,G4AttDef>*
111  G4bool isNew;
112  std::map<G4String,G4AttDef>* store =
113  G4AttDefStore::GetInstance("SensitiveDetectorHit",isNew);
114  if (isNew) {
115  G4String ID("ID");
116  (*store)[ID] = G4AttDef(ID,"ID","Physics","","G4int");
117 
118  G4String Pos("Pos");
119  (*store)[Pos] =
120  G4AttDef(Pos, "Position","Physics","G4BestUnit","G4ThreeVector");
121  }
122  return store;
123 }
124 
125 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
126 
127 std::vector<G4AttValue>*
129  std::vector<G4AttValue>* values = new std::vector<G4AttValue>;
130 
131  values->push_back(G4AttValue("ID",
133  ""));
134 
135  values->push_back(G4AttValue("Pos",G4BestUnit(fWorldPos,"Length"),""));
136 
137  return values;
138 }
139 
140 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
141 
143  G4cout << fLayerID <<
144  "," << fWorldPos.x() <<
145  "," << fWorldPos.z() <<
146  "," << fWorldPos.y() << G4endl;
147 }
148 
149 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
virtual void Draw(const G4Circle &, const G4Transform3D &objectTransformation=G4Transform3D())=0
const SensitiveDetectorHit & operator=(const SensitiveDetectorHit &)
#define G4endl
Definition: G4ios.hh:61
ush Pos
Definition: deflate.h:92
Definition: G4VHit.hh:48
Double_t z
double z() const
#define G4ThreadLocal
Definition: tls.hh:69
static G4VVisManager * GetConcreteInstance()
bool G4bool
Definition: G4Types.hh:79
virtual std::vector< G4AttValue > * CreateAttValues() const
#define G4BestUnit(a, b)
#define G4_USE_G4BESTUNIT_FOR_VERBOSE 1
static G4String ConvertToString(G4bool boolVal)
Definition: G4UIcommand.cc:374
std::map< G4String, G4AttDef > * GetInstance(const G4String &storeKey, G4bool &isNew)
int G4int
Definition: G4Types.hh:78
virtual const std::map< G4String, G4AttDef > * GetAttDefs() const
G4GLOB_DLL std::ostream G4cout
double x() const
G4ThreadLocal G4Allocator< SensitiveDetectorHit > * SensitiveDetectorHitAllocator
double y() const