Geant4  v4-10.4-release
 모두 클래스 네임스페이스들 파일들 함수 변수 타입정의 열거형 타입 열거형 멤버 Friends 매크로 그룹들 페이지들
G4ScoringManager.hh
이 파일의 문서화 페이지로 가기
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: G4ScoringManager.hh 94772 2015-12-09 09:46:45Z gcosmo $
28 //
29 
30 #ifndef G4ScoringManager_h
31 #define G4ScoringManager_h 1
32 
33 #include "globals.hh"
34 #include "G4VScoringMesh.hh"
35 #include <vector>
36 #include <map>
37 class G4ScoringMessenger;
39 class G4VHitsCollection;
41 #include "G4VScoreWriter.hh"
42 
43 // class description:
44 //
45 // This is a singleton class which manages the interactive scoring.
46 // The user cannot access to the constructor. The pointer of the
47 // only existing object can be got via G4ScoringManager::GetScoringManager()
48 // static method. The first invokation of this static method makes
49 // the singleton object.
50 //
51 
52 typedef std::vector<G4VScoringMesh*> MeshVec;
53 typedef std::vector<G4VScoringMesh*>::iterator MeshVecItr;
54 typedef std::vector<G4VScoringMesh*>::const_iterator MeshVecConstItr;
55 typedef std::map<G4String,G4VScoreColorMap*> ColorMapDict;
56 typedef std::map<G4String,G4VScoreColorMap*>::iterator ColorMapDictItr;
57 typedef std::map<G4String,G4VScoreColorMap*>::const_iterator ColorMapDictConstItr;
58 typedef std::map<G4int,G4VScoringMesh*> MeshMap;
59 typedef std::map<G4int,G4VScoringMesh*>::iterator MeshMapItr;
60 typedef std::map<G4int,G4VScoringMesh*>::const_iterator MeshMapConstItr;
61 
63 {
64  public: // with description
66  // Returns the pointer to the singleton object.
67  public:
69 
70  public:
71  static void SetReplicaLevel(G4int);
72  static G4int GetReplicaLevel();
73 
74  protected:
76 
77  public:
79 
80  public: // with description
82  // Register a color map. Once registered, it is available by /score/draw and /score/drawColumn
83  // commands.
84 
85  public:
86  void Accumulate(G4VHitsCollection* map);
87  void Merge(const G4ScoringManager* scMan);
90  void List() const;
91  void Dump() const;
92  void DrawMesh(const G4String& meshName, const G4String& psName,
93  const G4String& colorMapName, G4int axflg=111);
94  void DrawMesh(const G4String& meshName, const G4String& psName,
95  G4int idxPlane, G4int iColumn, const G4String& colorMapName);
96  void DumpQuantityToFile(const G4String& meshName, const G4String& psName,
97  const G4String& fileName, const G4String& option = "");
98  void DumpAllQuantitiesToFile(const G4String& meshName,
99  const G4String& fileName,
100  const G4String& option = "");
101  G4VScoreColorMap* GetScoreColorMap(const G4String& mapName);
102  void ListScoreColorMaps();
103 
104  private:
110 
113 
117 
119  public:
120  inline void SetCurrentMesh(G4VScoringMesh* scm)
121  { fCurrentMesh = scm; }
123  { return fCurrentMesh; }
124  inline void CloseCurrentMesh()
125  { fCurrentMesh = 0; }
126  inline void SetVerboseLevel(G4int vl)
127  {
128  verboseLevel = vl;
129  for(MeshVecItr itr = fMeshVec.begin(); itr != fMeshVec.end(); itr++) {
130  (*itr)->SetVerboseLevel(vl);
131  }
132  if(writer) writer->SetVerboseLevel(vl);
133  }
134  inline G4int GetVerboseLevel() const
135  { return verboseLevel; }
136  inline size_t GetNumberOfMesh() const
137  { return fMeshVec.size(); }
139  {
141  fMeshVec.push_back(scm);
142  SetCurrentMesh(scm);
143  }
144  inline G4VScoringMesh* GetMesh(G4int i) const
145  { return fMeshVec[i]; }
146  inline G4String GetWorldName(G4int i) const
147  { return fMeshVec[i]->GetWorldName(); }
148 
149  public: // with description
151  {
152  if(writer) { delete writer; }
153  writer = sw;
155  }
156  // Replace score writers.
157 private:
158  //Disable copy constructor and assignement operator
161 };
162 
163 
164 
165 
166 #endif
167 
G4VScoreColorMap * fDefaultLinearColorMap
void SetCurrentMesh(G4VScoringMesh *scm)
void List() const
std::map< G4String, G4VScoreColorMap * >::iterator ColorMapDictItr
size_t GetNumberOfMesh() const
void SetScoreWriter(G4VScoreWriter *sw)
G4VScoringMesh * fCurrentMesh
G4ScoreQuantityMessenger * fQuantityMessenger
static void SetReplicaLevel(G4int)
void RegisterScoreColorMap(G4VScoreColorMap *colorMap)
G4VScoreColorMap * GetScoreColorMap(const G4String &mapName)
std::vector< G4VScoringMesh * >::iterator MeshVecItr
void SetVerboseLevel(G4int vl)
std::vector< G4VScoringMesh * > MeshVec
std::map< G4String, G4VScoreColorMap * >::const_iterator ColorMapDictConstItr
#define G4ThreadLocal
Definition: tls.hh:69
G4int GetVerboseLevel() const
void DrawMesh(const G4String &meshName, const G4String &psName, const G4String &colorMapName, G4int axflg=111)
G4VScoringMesh * GetCurrentMesh() const
void DumpAllQuantitiesToFile(const G4String &meshName, const G4String &fileName, const G4String &option="")
std::map< G4int, G4VScoringMesh * >::const_iterator MeshMapConstItr
G4ScoringMessenger * fMessenger
static G4ScoringManager * GetScoringManagerIfExist()
void Merge(const G4ScoringManager *scMan)
void SetVerboseLevel(G4int vl)
static G4ThreadLocal G4ScoringManager * fSManager
G4ScoringManager & operator=(const G4ScoringManager &)
void SetVerboseLevel(G4int vl)
std::vector< G4VScoringMesh * >::const_iterator MeshVecConstItr
int G4int
Definition: G4Types.hh:78
std::map< G4int, G4VScoringMesh * > MeshMap
void DumpQuantityToFile(const G4String &meshName, const G4String &psName, const G4String &fileName, const G4String &option="")
void Dump() const
G4VScoringMesh * GetMesh(G4int i) const
G4VScoreWriter * writer
std::map< G4int, G4VScoringMesh * >::iterator MeshMapItr
void Accumulate(G4VHitsCollection *map)
static G4ThreadLocal G4int replicaLevel
std::map< G4String, G4VScoreColorMap * > ColorMapDict
static G4ScoringManager * GetScoringManager()
G4VScoringMesh * FindMesh(G4VHitsCollection *map)
static G4int GetReplicaLevel()
ColorMapDict * fColorMapDict
void RegisterScoringMesh(G4VScoringMesh *scm)
G4String GetWorldName(G4int i) const