Geant4  v4-10.4-release
 모두 클래스 네임스페이스들 파일들 함수 변수 타입정의 열거형 타입 열거형 멤버 Friends 매크로 그룹들 페이지들
G4NavigationHistory.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: G4NavigationHistory.cc 110271 2018-05-17 14:41:15Z gcosmo $
28 //
29 //
30 // G4NavigationHistory Implementation
31 //
32 // Author: P.Kent, August 96
33 //
34 // ----------------------------------------------------------------------
35 
36 #include "G4ios.hh"
37 #include "G4NavigationHistory.hh"
38 
40 {
42  return _instance;
43 }
44 
46  : fStackDepth(0)
47 {
49  Clear();
50 }
51 
53 {
55  if( GetMaxDepth() != h.GetMaxDepth() )
56  {
57  fNavHistory->resize( h.GetMaxDepth() );
58  }
59 
60  for ( G4int ilev=h.fStackDepth; ilev>=0; --ilev )
61  {
62  (*fNavHistory)[ilev] = (*h.fNavHistory)[ilev];
63  }
65 }
66 
68 {
70 }
71 
72 std::ostream&
73 operator << (std::ostream& os, const G4NavigationHistory& nav)
74 {
75  os << "History depth=" << nav.GetDepth() << G4endl;
76  for ( G4int i=0; i<=nav.GetDepth(); i++ )
77  {
78  os << "Level=["<<i<<"]: ";
79  if( nav.GetVolume(i) != 0 )
80  {
81  os << "Phys Name=["<< nav.GetVolume(i)->GetName()
82  << "] Type=[";
83  switch(nav.GetVolumeType(i))
84  {
85  case kNormal:
86  os << "N";
87  break;
88  case kReplica:
89  os << "R" << nav.GetReplicaNo(i);
90  break;
91  case kParameterised:
92  os << "P" << nav.GetReplicaNo(i);
93  break;
94  }
95  os << "]";
96  }
97  else
98  {
99  os << "Phys = <Null>";
100  }
101  os << G4endl;
102  }
103  return os;
104 }
std::ostream & operator<<(std::ostream &, const BasicVector3D< float > &)
#define G4endl
Definition: G4ios.hh:61
#define G4ThreadLocalStatic
Definition: tls.hh:68
void DeRegister(std::vector< G4NavigationLevel > *pLevels)
G4VPhysicalVolume * GetVolume(G4int n) const
static G4NavigationHistoryPool * GetInstance()
G4Allocator< G4NavigationHistory > *& aNavigHistoryAllocator()
G4int GetDepth() const
G4int GetMaxDepth() const
int G4int
Definition: G4Types.hh:78
std::vector< G4NavigationLevel > * fNavHistory
G4int GetReplicaNo(G4int n) const
std::vector< G4NavigationLevel > * GetLevels()
EVolume GetVolumeType(G4int n) const
const G4String & GetName() const