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 ] [ 10.5.p1 ] [ 10.6 ] [ 10.6.p1 ] [ 10.6.p2 ] [ 10.6.p3 ] [ 10.7 ] [ 10.7.p1 ] [ 10.7.p2 ] [ 10.7.p3 ] [ 10.7.p4 ] [ 11.0 ] [ 11.0.p1 ] [ 11.0.p2 ] [ 11.0.p3, ] [ 11.0.p4 ] [ 11.1 ] [ 11.1.1 ] [ 11.1.2 ] [ 11.1.3 ] [ 11.2 ] [ 11.2.1 ] [ 11.2.2 ] [ 11.3.0 ]

Diff markup

Differences between /digits_hits/utils/include/G4VScoringMesh.hh (Version 11.3.0) and /digits_hits/utils/include/G4VScoringMesh.hh (Version 10.6.p2)


  1 //                                                  1 //
  2 // *******************************************      2 // ********************************************************************
  3 // * License and Disclaimer                         3 // * License and Disclaimer                                           *
  4 // *                                                4 // *                                                                  *
  5 // * The  Geant4 software  is  copyright of th      5 // * The  Geant4 software  is  copyright of the Copyright Holders  of *
  6 // * the Geant4 Collaboration.  It is provided      6 // * the Geant4 Collaboration.  It is provided  under  the terms  and *
  7 // * conditions of the Geant4 Software License      7 // * conditions of the Geant4 Software License,  included in the file *
  8 // * LICENSE and available at  http://cern.ch/      8 // * LICENSE and available at  http://cern.ch/geant4/license .  These *
  9 // * include a list of copyright holders.           9 // * include a list of copyright holders.                             *
 10 // *                                               10 // *                                                                  *
 11 // * Neither the authors of this software syst     11 // * Neither the authors of this software system, nor their employing *
 12 // * institutes,nor the agencies providing fin     12 // * institutes,nor the agencies providing financial support for this *
 13 // * work  make  any representation or  warran     13 // * work  make  any representation or  warranty, express or implied, *
 14 // * regarding  this  software system or assum     14 // * regarding  this  software system or assume any liability for its *
 15 // * use.  Please see the license in the file      15 // * use.  Please see the license in the file  LICENSE  and URL above *
 16 // * for the full disclaimer and the limitatio     16 // * for the full disclaimer and the limitation of liability.         *
 17 // *                                               17 // *                                                                  *
 18 // * This  code  implementation is the result      18 // * This  code  implementation is the result of  the  scientific and *
 19 // * technical work of the GEANT4 collaboratio     19 // * technical work of the GEANT4 collaboration.                      *
 20 // * By using,  copying,  modifying or  distri     20 // * By using,  copying,  modifying or  distributing the software (or *
 21 // * any work based  on the software)  you  ag     21 // * any work based  on the software)  you  agree  to acknowledge its *
 22 // * use  in  resulting  scientific  publicati     22 // * use  in  resulting  scientific  publications,  and indicate your *
 23 // * acceptance of all terms of the Geant4 Sof     23 // * acceptance of all terms of the Geant4 Software license.          *
 24 // *******************************************     24 // ********************************************************************
 25 //                                                 25 //
 26 // G4VScoringMesh                              << 
 27 //                                                 26 //
 28 // Class description:                          << 
 29 //                                                 27 //
 30 // This class represents a multi-functional de <<  28 
 31 // command-based scorer for parallel world sco << 
 32 // parallel world mesh geometry                << 
 33 //                                             << 
 34 // Author: Makoto Asai                         << 
 35 // ------------------------------------------- << 
 36 #ifndef G4VScoringMesh_h                           29 #ifndef G4VScoringMesh_h
 37 #define G4VScoringMesh_h 1                         30 #define G4VScoringMesh_h 1
 38                                                    31 
 39 #include "globals.hh"                              32 #include "globals.hh"
 40 #include "G4THitsMap.hh"                           33 #include "G4THitsMap.hh"
 41 #include "G4RotationMatrix.hh"                     34 #include "G4RotationMatrix.hh"
 42 #include "G4StatDouble.hh"                         35 #include "G4StatDouble.hh"
 43                                                    36 
 44 #include <map>                                 << 
 45                                                << 
 46 class G4VPhysicalVolume;                           37 class G4VPhysicalVolume;
 47 class G4LogicalVolume;                             38 class G4LogicalVolume;
 48 class G4MultiFunctionalDetector;                   39 class G4MultiFunctionalDetector;
 49 class G4VPrimitiveScorer;                          40 class G4VPrimitiveScorer;
 50 class G4VSDFilter;                                 41 class G4VSDFilter;
 51 class G4VScoreColorMap;                            42 class G4VScoreColorMap;
 52 class G4ParallelWorldProcess;                      43 class G4ParallelWorldProcess;
 53                                                    44 
                                                   >>  45 #include <map>
                                                   >>  46 
                                                   >>  47 // class description:
                                                   >>  48 //
                                                   >>  49 //  This class represents a multi-functional detector to be used by command-based scorer
                                                   >>  50 //  For parallel world scorer, this class creates a parallel world mesh geometry
                                                   >>  51 //
                                                   >>  52 
 54 class G4VScoringMesh                               53 class G4VScoringMesh
 55 {                                                  54 {
 56  public:                                       <<  55 public:
 57   enum class MeshShape                         <<  56   enum class MeshShape { box, cylinder, sphere, realWorldLogVol, undefined = -1};
 58   {                                            <<  57   using EventScore = G4THitsMap< G4double >;
 59     box,                                       <<  58   using RunScore = G4THitsMap< G4StatDouble >;
 60     cylinder,                                  <<  59   using MeshScoreMap = std::map< G4String, RunScore* >;
 61     sphere,                                    << 
 62     realWorldLogVol,                           << 
 63     probe,                                     << 
 64     undefined = -1                             << 
 65   };                                           << 
 66   using EventScore   = G4THitsMap<G4double>;   << 
 67   using RunScore     = G4THitsMap<G4StatDouble << 
 68   using MeshScoreMap = std::map<G4String, RunS << 
 69                                                << 
 70  public:                                       << 
 71                                                    60 
                                                   >>  61 public:
 72   G4VScoringMesh(const G4String& wName);           62   G4VScoringMesh(const G4String& wName);
 73   virtual ~G4VScoringMesh() = default;         <<  63   virtual ~G4VScoringMesh();
 74                                                    64 
 75   virtual void Construct(G4VPhysicalVolume* fW <<  65 public: // with description
 76   virtual void WorkerConstruct(G4VPhysicalVolu <<  66   // a pure virtual function to construct this mesh geometry
                                                   >>  67   void Construct(G4VPhysicalVolume* fWorldPhys);
 77                                                    68 
 78   // list infomration of this mesh             <<  69   void WorkerConstruct(G4VPhysicalVolume* fWorldPhys);
 79   virtual void List() const;                   <<  70 
                                                   >>  71 protected:
                                                   >>  72   virtual void SetupGeometry(G4VPhysicalVolume * fWorldPhys) = 0;
 80                                                    73 
                                                   >>  74 public: // with description
                                                   >>  75   // list infomration of this mesh 
                                                   >>  76   virtual void List() const;
                                                   >>  77   
                                                   >>  78 public: // with description
 81   // get the world name                            79   // get the world name
 82   // If this ScoringMesh is for parallel world <<  80   // If this ScoringMesh is for parallel world, it returns the name of the parallel world
 83   // parallel world If this ScoringMesh is for <<  81   // If this ScoringMesh is for real world logical volume, it returns name of logical volume
 84   // returns name of logical volume            <<  82   inline const G4String& GetWorldName() const
 85   inline const G4String& GetWorldName() const  <<  83   { return fWorldName; }
 86   // get whether this mesh is active or not        84   // get whether this mesh is active or not
 87   inline G4bool IsActive() const { return fAct <<  85   inline G4bool IsActive() const
                                                   >>  86   { return fActive; }
 88   // set an activity of this mesh                  87   // set an activity of this mesh
 89   inline void Activate(G4bool vl = true) { fAc <<  88   inline void Activate(G4bool vl = true)
                                                   >>  89   { fActive = vl; }
 90   // get the shape of this mesh                    90   // get the shape of this mesh
 91   inline MeshShape GetShape() const { return f <<  91   inline MeshShape GetShape() const
                                                   >>  92   { return fShape; }
 92   // accumulate hits in a registered primitive     93   // accumulate hits in a registered primitive scorer
 93   void Accumulate(G4THitsMap<G4double>* map);  <<  94   void Accumulate(G4THitsMap<G4double> * map);
 94   void Accumulate(G4THitsMap<G4StatDouble>* ma <<  95   void Accumulate(G4THitsMap<G4StatDouble> * map);
 95   // merge same kind of meshes                     96   // merge same kind of meshes
 96   void Merge(const G4VScoringMesh* scMesh);    <<  97   void Merge(const G4VScoringMesh * scMesh);
 97   // dump information of primitive socrers reg     98   // dump information of primitive socrers registered in this mesh
 98   void Dump();                                     99   void Dump();
 99   // draw a projected quantity on a current vi    100   // draw a projected quantity on a current viewer
100   void DrawMesh(const G4String& psName, G4VSco << 101   void DrawMesh(const G4String& psName,G4VScoreColorMap* colorMap,G4int axflg=111);
101                 G4int axflg = 111);            << 
102   // draw a column of a quantity on a current     102   // draw a column of a quantity on a current viewer
103   void DrawMesh(const G4String& psName, G4int  << 103   void DrawMesh(const G4String& psName,G4int idxPlane,G4int iColumn,G4VScoreColorMap* colorMap);
104                 G4VScoreColorMap* colorMap);   << 
105   // draw a projected quantity on a current vi    104   // draw a projected quantity on a current viewer
106   virtual void Draw(RunScore* map, G4VScoreCol << 105   virtual void Draw(RunScore * map, G4VScoreColorMap* colorMap, G4int axflg=111) = 0;
107                     G4int axflg = 111) = 0;    << 
108   // draw a column of a quantity on a current     106   // draw a column of a quantity on a current viewer
109   virtual void DrawColumn(RunScore* map, G4VSc << 107   virtual void DrawColumn(RunScore * map, G4VScoreColorMap* colorMap,
110                           G4int idxProj, G4int << 108         G4int idxProj, G4int idxColumn) = 0;
111   // reset registered primitive scorers           109   // reset registered primitive scorers
112   void ResetScore();                              110   void ResetScore();
113                                                   111 
114   // Following set/get methods make sense only    112   // Following set/get methods make sense only for parallel world scoring mesh
115   // set size of this mesh                        113   // set size of this mesh
116   void SetSize(G4double size[3]);                 114   void SetSize(G4double size[3]);
117   // get size of this mesh                        115   // get size of this mesh
118   G4ThreeVector GetSize() const;                  116   G4ThreeVector GetSize() const;
119   // set starting and span angles (used only f << 
120   void SetAngles(G4double, G4double);          << 
121   // get angles (used only for tube segment)   << 
122   inline G4double GetStartAngle() const { retu << 
123   inline G4double GetAngleSpan() const { retur << 
124   // set position of center of this mesh          117   // set position of center of this mesh
125   void SetCenterPosition(G4double centerPositi    118   void SetCenterPosition(G4double centerPosition[3]);
126   // get position of center of this mesh          119   // get position of center of this mesh
127   G4ThreeVector GetTranslation() const { retur << 120   G4ThreeVector GetTranslation() const {return fCenterPosition;}
128   // set a rotation angle around the x axis       121   // set a rotation angle around the x axis
129   void RotateX(G4double delta);                   122   void RotateX(G4double delta);
130   // set a rotation angle around the y axis       123   // set a rotation angle around the y axis
131   void RotateY(G4double delta);                   124   void RotateY(G4double delta);
132   // set a rotation angle around the z axis       125   // set a rotation angle around the z axis
133   void RotateZ(G4double delta);                   126   void RotateZ(G4double delta);
134   // get a rotation matrix                        127   // get a rotation matrix
135   inline G4RotationMatrix GetRotationMatrix()  << 128   G4RotationMatrix GetRotationMatrix() const {
136   {                                            << 129     if(fRotationMatrix) return *fRotationMatrix;
137     if(fRotationMatrix != nullptr)             << 130     else return G4RotationMatrix::IDENTITY;
138       return *fRotationMatrix;                 << 
139     return G4RotationMatrix::IDENTITY;         << 
140   }                                               131   }
141                                                   132 
142   // set number of segments of this mesh          133   // set number of segments of this mesh
143   void SetNumberOfSegments(G4int nSegment[3]);    134   void SetNumberOfSegments(G4int nSegment[3]);
144   // get number of segments of this mesh          135   // get number of segments of this mesh
145   void GetNumberOfSegments(G4int nSegment[3]);    136   void GetNumberOfSegments(G4int nSegment[3]);
146                                                   137 
147   // register a primitive scorer to the MFD &  << 138   // register a primitive scorer to the MFD & set it to the current primitive scorer
148   // scorer                                    << 139   void SetPrimitiveScorer(G4VPrimitiveScorer * ps);
149   void SetPrimitiveScorer(G4VPrimitiveScorer*  << 
150   // register a filter to a current primtive s    140   // register a filter to a current primtive scorer
151   void SetFilter(G4VSDFilter* filter);         << 141   void SetFilter(G4VSDFilter * filter);
152   // set a primitive scorer to the current one    142   // set a primitive scorer to the current one by the name
153   void SetCurrentPrimitiveScorer(const G4Strin << 143   void SetCurrentPrimitiveScorer(const G4String & name);
154   // find registered primitive scorer by the n    144   // find registered primitive scorer by the name
155   G4bool FindPrimitiveScorer(const G4String& p << 145   G4bool FindPrimitiveScorer(const G4String & psname);
156   // get whether current primitive scorer is s    146   // get whether current primitive scorer is set or not
157   inline G4bool IsCurrentPrimitiveScorerNull() << 147   G4bool IsCurrentPrimitiveScorerNull() {
158   {                                            << 148     if(fCurrentPS == nullptr) return true;
159     return fCurrentPS == nullptr;              << 149     else return false;
160   }                                               150   }
161   // get unit of primitive scorer by the name     151   // get unit of primitive scorer by the name
162   G4String GetPSUnit(const G4String& psname);  << 152   G4String GetPSUnit(const G4String & psname);
163   // get unit of current primitive scorer         153   // get unit of current primitive scorer
164   G4String GetCurrentPSUnit();                    154   G4String GetCurrentPSUnit();
165   // set unit of current primitive scorer         155   // set unit of current primitive scorer
166   void SetCurrentPSUnit(const G4String& unit);    156   void SetCurrentPSUnit(const G4String& unit);
167   // get unit value of primitive scorer by the    157   // get unit value of primitive scorer by the name
168   G4double GetPSUnitValue(const G4String& psna << 158   G4double GetPSUnitValue(const G4String & psname);
169   // set PS name to be drawn                      159   // set PS name to be drawn
170   inline void SetDrawPSName(const G4String& ps << 160   void SetDrawPSName(const G4String & psname) {fDrawPSName = psname;}
171                                                   161 
172   // get axis names of the hierarchical divisi    162   // get axis names of the hierarchical division in the divided order
173   void GetDivisionAxisNames(G4String divisionA    163   void GetDivisionAxisNames(G4String divisionAxisNames[3]);
174                                                   164 
175   // set current  primitive scorer to NULL        165   // set current  primitive scorer to NULL
176   void SetNullToCurrentPrimitiveScorer() { fCu << 166   void SetNullToCurrentPrimitiveScorer() {fCurrentPS = nullptr;}
177   // set verbose level                            167   // set verbose level
178   inline void SetVerboseLevel(G4int vl) { verb << 168   inline void SetVerboseLevel(G4int vl) 
                                                   >> 169   { verboseLevel = vl; }
179   // get the primitive scorer map                 170   // get the primitive scorer map
180   inline MeshScoreMap GetScoreMap() const { re << 171   inline MeshScoreMap GetScoreMap() const 
                                                   >> 172   { return fMap; }
181   // get whether this mesh setup has been read    173   // get whether this mesh setup has been ready
182   inline G4bool ReadyForQuantity() const { ret << 174   inline G4bool ReadyForQuantity() const
                                                   >> 175   { return (sizeIsSet && nMeshIsSet); }
183                                                   176 
184   // protected:                                << 177 protected:
185   // get registered primitive socrer by the na    178   // get registered primitive socrer by the name
186   G4VPrimitiveScorer* GetPrimitiveScorer(const << 179   G4VPrimitiveScorer * GetPrimitiveScorer(const G4String & name);
187                                                << 
188   inline void SetMeshElementLogical(G4LogicalV << 
189   {                                            << 
190     fMeshElementLogical = val;                 << 
191   }                                            << 
192   inline G4LogicalVolume* GetMeshElementLogica << 
193   {                                            << 
194     return fMeshElementLogical;                << 
195   }                                            << 
196                                                   180 
197   inline void SetParallelWorldProcess(G4Parall << 181 protected:
198   {                                            << 182   G4String  fWorldName;
199     fParallelWorldProcess = proc;              << 183   G4VPrimitiveScorer * fCurrentPS;
200   }                                            << 184   G4bool    fConstructed;
201   inline G4ParallelWorldProcess* GetParallelWo << 185   G4bool    fActive;
202   {                                            << 
203     return fParallelWorldProcess;              << 
204   }                                            << 
205   inline void GeometryHasBeenDestroyed()       << 
206   {                                            << 
207     fGeometryHasBeenDestroyed = true;          << 
208     fMeshElementLogical       = nullptr;       << 
209   }                                            << 
210                                                << 
211   // Geometry hirarchy level (bottom = 0) to b << 
212   // This is used only for real-world scorer   << 
213   inline void SetCopyNumberLevel(G4int val) {  << 
214   inline G4int GetCopyNumberLevel() const { re << 
215                                                << 
216   inline G4bool LayeredMassFlg() { return laye << 
217                                                << 
218  protected:                                    << 
219                                                << 
220   // a pure virtual function to construct this << 
221   virtual void SetupGeometry(G4VPhysicalVolume << 
222                                                << 
223  protected:                                    << 
224                                                << 
225   G4String fWorldName;                         << 
226   G4VPrimitiveScorer* fCurrentPS;              << 
227   G4bool fConstructed;                         << 
228   G4bool fActive;                              << 
229   MeshShape fShape;                               186   MeshShape fShape;
230                                                   187 
231   G4double fSize[3];                              188   G4double fSize[3];
232   G4double fAngle[2];                          << 
233   G4ThreeVector fCenterPosition;                  189   G4ThreeVector fCenterPosition;
234   G4RotationMatrix* fRotationMatrix;           << 190   G4RotationMatrix * fRotationMatrix;
235   G4int fNSegment[3];                             191   G4int fNSegment[3];
236                                                   192 
237   MeshScoreMap fMap;                              193   MeshScoreMap fMap;
238   G4MultiFunctionalDetector* fMFD;             << 194   G4MultiFunctionalDetector * fMFD;
239                                                   195 
240   G4int verboseLevel;                             196   G4int verboseLevel;
241                                                   197 
242   G4bool sizeIsSet;                               198   G4bool sizeIsSet;
243   G4bool nMeshIsSet;                              199   G4bool nMeshIsSet;
244                                                   200 
245   G4String fDrawUnit;                             201   G4String fDrawUnit;
246   G4double fDrawUnitValue;                        202   G4double fDrawUnitValue;
247   G4String fDrawPSName;                           203   G4String fDrawPSName;
248                                                   204 
249   G4String fDivisionAxisNames[3];                 205   G4String fDivisionAxisNames[3];
250                                                   206 
251   G4LogicalVolume* fMeshElementLogical;        << 207   G4LogicalVolume * fMeshElementLogical;
252                                                   208 
                                                   >> 209 public:
                                                   >> 210   inline void SetMeshElementLogical(G4LogicalVolume* val)
                                                   >> 211   { fMeshElementLogical = val; }
                                                   >> 212   inline G4LogicalVolume* GetMeshElementLogical() const
                                                   >> 213   { return fMeshElementLogical; }
                                                   >> 214 
                                                   >> 215 protected:
253   G4ParallelWorldProcess* fParallelWorldProces    216   G4ParallelWorldProcess* fParallelWorldProcess;
254   G4bool fGeometryHasBeenDestroyed;               217   G4bool fGeometryHasBeenDestroyed;
255                                                << 218 public:
256   G4int copyNumberLevel;                       << 219   inline void SetParallelWorldProcess(G4ParallelWorldProcess* proc)
                                                   >> 220   { fParallelWorldProcess = proc; }
                                                   >> 221   inline G4ParallelWorldProcess* GetParallelWorldProcess() const
                                                   >> 222   { return fParallelWorldProcess; }
                                                   >> 223   inline void GeometryHasBeenDestroyed()
                                                   >> 224   {
                                                   >> 225     fGeometryHasBeenDestroyed = true;
                                                   >> 226     fMeshElementLogical = nullptr;
                                                   >> 227   }
257                                                   228 
258   // This flag may be set to true for Probe sc << 229 protected:
259   // There is no public set method for this bo << 230   G4int copyNumberLevel;
260   // to true through SetMaterial() method of P << 231 public:
261   G4bool layeredMassFlg;                       << 232   // Geometry hirarchy level (bottom = 0) to be used as the copy number
                                                   >> 233   // This is used only for real-world scorer
                                                   >> 234   inline void SetCopyNumberLevel(G4int val)
                                                   >> 235   { copyNumberLevel = val; }
                                                   >> 236   inline G4int GetCopyNumberLevel() const
                                                   >> 237   { return copyNumberLevel; }
262 };                                                238 };
263                                                   239 
264 #endif                                            240 #endif
                                                   >> 241 
265                                                   242