Geant4-11
Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | Private Member Functions | Private Attributes
G4ScoringBox Class Reference

#include <G4ScoringBox.hh>

Inheritance diagram for G4ScoringBox:
G4VScoringMesh

Public Types

using EventScore = G4THitsMap< G4double >
 
using MeshScoreMap = std::map< G4String, RunScore * >
 
enum class  MeshShape {
  box , cylinder , sphere , realWorldLogVol ,
  probe , undefined = -1
}
 
using RunScore = G4THitsMap< G4StatDouble >
 

Public Member Functions

void Accumulate (G4THitsMap< G4double > *map)
 
void Accumulate (G4THitsMap< G4StatDouble > *map)
 
void Activate (G4bool vl=true)
 
virtual void Construct (G4VPhysicalVolume *fWorldPhys)
 
void Draw (RunScore *map, G4VScoreColorMap *colorMap, G4int axflg=111)
 
void DrawColumn (RunScore *map, G4VScoreColorMap *colorMap, G4int idxProj, G4int idxColumn)
 
void DrawMesh (const G4String &psName, G4int idxPlane, G4int iColumn, G4VScoreColorMap *colorMap)
 
void DrawMesh (const G4String &psName, G4VScoreColorMap *colorMap, G4int axflg=111)
 
void Dump ()
 
G4bool FindPrimitiveScorer (const G4String &psname)
 
 G4ScoringBox (G4String wName)
 
void GeometryHasBeenDestroyed ()
 
G4double GetAngleSpan () const
 
G4int GetCopyNumberLevel () const
 
G4String GetCurrentPSUnit ()
 
void GetDivisionAxisNames (G4String divisionAxisNames[3])
 
G4LogicalVolumeGetMeshElementLogical () const
 
void GetNumberOfSegments (G4int nSegment[3])
 
G4ParallelWorldProcessGetParallelWorldProcess () const
 
G4VPrimitiveScorerGetPrimitiveScorer (const G4String &name)
 
G4String GetPSUnit (const G4String &psname)
 
G4double GetPSUnitValue (const G4String &psname)
 
G4RotationMatrix GetRotationMatrix () const
 
MeshScoreMap GetScoreMap () const
 
MeshShape GetShape () const
 
G4ThreeVector GetSize () const
 
G4double GetStartAngle () const
 
G4ThreeVector GetTranslation () const
 
const G4StringGetWorldName () const
 
G4bool IsActive () const
 
G4bool IsCurrentPrimitiveScorerNull ()
 
G4bool LayeredMassFlg ()
 
void List () const
 
void Merge (const G4VScoringMesh *scMesh)
 
G4bool ReadyForQuantity () const
 
void ResetScore ()
 
void RotateX (G4double delta)
 
void RotateY (G4double delta)
 
void RotateZ (G4double delta)
 
void SetAngles (G4double, G4double)
 
void SetCenterPosition (G4double centerPosition[3])
 
void SetCopyNumberLevel (G4int val)
 
void SetCurrentPrimitiveScorer (const G4String &name)
 
void SetCurrentPSUnit (const G4String &unit)
 
void SetDrawPSName (const G4String &psname)
 
void SetFilter (G4VSDFilter *filter)
 
void SetMeshElementLogical (G4LogicalVolume *val)
 
void SetNullToCurrentPrimitiveScorer ()
 
void SetNumberOfSegments (G4int nSegment[3])
 
void SetParallelWorldProcess (G4ParallelWorldProcess *proc)
 
void SetPrimitiveScorer (G4VPrimitiveScorer *ps)
 
void SetSegmentDirection (G4int dir)
 
void SetSize (G4double size[3])
 
void SetVerboseLevel (G4int vl)
 
virtual void WorkerConstruct (G4VPhysicalVolume *fWorldPhys)
 
 ~G4ScoringBox ()
 

Protected Member Functions

virtual void SetupGeometry (G4VPhysicalVolume *fWorldPhys)
 

Protected Attributes

G4int copyNumberLevel
 
G4bool fActive
 
G4double fAngle [2]
 
G4ThreeVector fCenterPosition
 
G4bool fConstructed
 
G4VPrimitiveScorerfCurrentPS
 
G4String fDivisionAxisNames [3]
 
G4String fDrawPSName
 
G4String fDrawUnit
 
G4double fDrawUnitValue
 
G4bool fGeometryHasBeenDestroyed
 
MeshScoreMap fMap
 
G4LogicalVolumefMeshElementLogical
 
G4MultiFunctionalDetectorfMFD
 
G4int fNSegment [3]
 
G4ParallelWorldProcessfParallelWorldProcess
 
G4RotationMatrixfRotationMatrix
 
MeshShape fShape
 
G4double fSize [3]
 
G4String fWorldName
 
G4bool layeredMassFlg
 
G4bool nMeshIsSet
 
G4bool sizeIsSet
 
G4int verboseLevel
 

Private Member Functions

G4int GetIndex (G4int x, G4int y, G4int z) const
 
G4ThreeVector GetReplicaPosition (G4int x, G4int y, G4int z)
 
void GetXYZ (G4int index, G4int q[3]) const
 

Private Attributes

G4int fSegmentDirection
 

Detailed Description

Definition at line 42 of file G4ScoringBox.hh.

Member Typedef Documentation

◆ EventScore

Definition at line 66 of file G4VScoringMesh.hh.

◆ MeshScoreMap

using G4VScoringMesh::MeshScoreMap = std::map<G4String, RunScore*>
inherited

Definition at line 68 of file G4VScoringMesh.hh.

◆ RunScore

Definition at line 67 of file G4VScoringMesh.hh.

Member Enumeration Documentation

◆ MeshShape

enum class G4VScoringMesh::MeshShape
stronginherited
Enumerator
box 
cylinder 
sphere 
realWorldLogVol 
probe 
undefined 

Definition at line 57 of file G4VScoringMesh.hh.

58 {
59 box,
60 cylinder,
61 sphere,
62 realWorldLogVol,
63 probe,
64 undefined = -1
65 };

Constructor & Destructor Documentation

◆ G4ScoringBox()

G4ScoringBox::G4ScoringBox ( G4String  wName)

Definition at line 54 of file G4ScoringBox.cc.

55 : G4VScoringMesh(wName)
57{
59 fDivisionAxisNames[0] = "X";
60 fDivisionAxisNames[1] = "Y";
61 fDivisionAxisNames[2] = "Z";
62}
G4int fSegmentDirection
Definition: G4ScoringBox.hh:70
G4String fDivisionAxisNames[3]
G4VScoringMesh(const G4String &wName)

References G4VScoringMesh::box, G4VScoringMesh::fDivisionAxisNames, and G4VScoringMesh::fShape.

◆ ~G4ScoringBox()

G4ScoringBox::~G4ScoringBox ( )

Definition at line 64 of file G4ScoringBox.cc.

64{}

Member Function Documentation

◆ Accumulate() [1/2]

void G4VScoringMesh::Accumulate ( G4THitsMap< G4double > *  map)
inherited

Definition at line 386 of file G4VScoringMesh.cc.

387{
388 G4String psName = map->GetName();
389 MeshScoreMap::const_iterator fMapItr = fMap.find(psName);
390 *(fMapItr->second) += *map;
391
392 if(verboseLevel > 9)
393 {
394 G4cout << G4endl;
395 G4cout << "G4VScoringMesh::Accumulate()" << G4endl;
396 G4cout << " PS name : " << psName << G4endl;
397 if(fMapItr == fMap.end())
398 {
399 G4cout << " " << psName << " was not found." << G4endl;
400 }
401 else
402 {
403 G4cout << " map size : " << map->GetSize() << G4endl;
404 map->PrintAllHits();
405 }
406 G4cout << G4endl;
407 }
408}
#define G4endl
Definition: G4ios.hh:57
G4GLOB_DLL std::ostream G4cout
MeshScoreMap fMap

References G4VScoringMesh::fMap, G4cout, G4endl, anonymous_namespace{G4QuasiElRatios.cc}::map, and G4VScoringMesh::verboseLevel.

◆ Accumulate() [2/2]

void G4VScoringMesh::Accumulate ( G4THitsMap< G4StatDouble > *  map)
inherited

Definition at line 410 of file G4VScoringMesh.cc.

411{
412 G4String psName = map->GetName();
413 MeshScoreMap::const_iterator fMapItr = fMap.find(psName);
414 *(fMapItr->second) += *map;
415
416 if(verboseLevel > 9)
417 {
418 G4cout << G4endl;
419 G4cout << "G4VScoringMesh::Accumulate()" << G4endl;
420 G4cout << " PS name : " << psName << G4endl;
421 if(fMapItr == fMap.end())
422 {
423 G4cout << " " << psName << " was not found." << G4endl;
424 }
425 else
426 {
427 G4cout << " map size : " << map->GetSize() << G4endl;
428 map->PrintAllHits();
429 }
430 G4cout << G4endl;
431 }
432}

References G4VScoringMesh::fMap, G4cout, G4endl, anonymous_namespace{G4QuasiElRatios.cc}::map, and G4VScoringMesh::verboseLevel.

◆ Activate()

void G4VScoringMesh::Activate ( G4bool  vl = true)
inlineinherited

Definition at line 95 of file G4VScoringMesh.hh.

95{ fActive = vl; }

References G4VScoringMesh::fActive.

◆ Construct()

void G4VScoringMesh::Construct ( G4VPhysicalVolume fWorldPhys)
virtualinherited

Definition at line 434 of file G4VScoringMesh.cc.

435{
436 if(fConstructed)
437 {
439 {
440 SetupGeometry(fWorldPhys);
442 }
443 if(verboseLevel > 0)
444 G4cout << fWorldName << " --- All quantities are reset." << G4endl;
445 ResetScore();
446 }
447 else
448 {
449 fConstructed = true;
450 SetupGeometry(fWorldPhys);
451 }
452}
virtual void SetupGeometry(G4VPhysicalVolume *fWorldPhys)=0
G4bool fGeometryHasBeenDestroyed

References G4VScoringMesh::fConstructed, G4VScoringMesh::fGeometryHasBeenDestroyed, G4VScoringMesh::fWorldName, G4cout, G4endl, G4VScoringMesh::ResetScore(), G4VScoringMesh::SetupGeometry(), and G4VScoringMesh::verboseLevel.

Referenced by G4RunManager::ConstructScoringWorlds().

◆ Draw()

void G4ScoringBox::Draw ( RunScore map,
G4VScoreColorMap colorMap,
G4int  axflg = 111 
)
virtual

Implements G4VScoringMesh.

Definition at line 247 of file G4ScoringBox.cc.

248{
250 if(pVisManager)
251 {
252 // cell vectors
253 std::vector<std::vector<std::vector<double>>> cell; // cell[X][Y][Z]
254 std::vector<double> ez;
255 for(int z = 0; z < fNSegment[2]; z++)
256 ez.push_back(0.);
257 std::vector<std::vector<double>> eyz;
258 for(int y = 0; y < fNSegment[1]; y++)
259 eyz.push_back(ez);
260 for(int x = 0; x < fNSegment[0]; x++)
261 cell.push_back(eyz);
262
263 std::vector<std::vector<double>> xycell; // xycell[X][Y]
264 std::vector<double> ey;
265 for(int y = 0; y < fNSegment[1]; y++)
266 ey.push_back(0.);
267 for(int x = 0; x < fNSegment[0]; x++)
268 xycell.push_back(ey);
269
270 std::vector<std::vector<double>> yzcell; // yzcell[Y][Z]
271 for(int y = 0; y < fNSegment[1]; y++)
272 yzcell.push_back(ez);
273
274 std::vector<std::vector<double>> xzcell; // xzcell[X][Z]
275 for(int x = 0; x < fNSegment[0]; x++)
276 xzcell.push_back(ez);
277
278 // projections
279 G4int q[3];
280 std::map<G4int, G4StatDouble*>::iterator itr = map->GetMap()->begin();
281 for(; itr != map->GetMap()->end(); itr++)
282 {
283 GetXYZ(itr->first, q);
284
285 xycell[q[0]][q[1]] += (itr->second->sum_wx()) / fDrawUnitValue;
286 yzcell[q[1]][q[2]] += (itr->second->sum_wx()) / fDrawUnitValue;
287 xzcell[q[0]][q[2]] += (itr->second->sum_wx()) / fDrawUnitValue;
288 }
289
290 // search max. & min. values in each slice
291 G4double xymin = DBL_MAX, yzmin = DBL_MAX, xzmin = DBL_MAX;
292 G4double xymax = 0., yzmax = 0., xzmax = 0.;
293 for(int x = 0; x < fNSegment[0]; x++)
294 {
295 for(int y = 0; y < fNSegment[1]; y++)
296 {
297 if(xymin > xycell[x][y])
298 xymin = xycell[x][y];
299 if(xymax < xycell[x][y])
300 xymax = xycell[x][y];
301 }
302 for(int z = 0; z < fNSegment[2]; z++)
303 {
304 if(xzmin > xzcell[x][z])
305 xzmin = xzcell[x][z];
306 if(xzmax < xzcell[x][z])
307 xzmax = xzcell[x][z];
308 }
309 }
310 for(int y = 0; y < fNSegment[1]; y++)
311 {
312 for(int z = 0; z < fNSegment[2]; z++)
313 {
314 if(yzmin > yzcell[y][z])
315 yzmin = yzcell[y][z];
316 if(yzmax < yzcell[y][z])
317 yzmax = yzcell[y][z];
318 }
319 }
320
321 G4VisAttributes att;
322 att.SetForceSolid(true);
323 att.SetForceAuxEdgeVisible(true);
324 G4double thick = 0.01;
325
326 G4Scale3D scale;
327 if(axflg / 100 == 1)
328 {
329 pVisManager->BeginDraw();
330
331 // xy plane
332 if(colorMap->IfFloatMinMax())
333 {
334 colorMap->SetMinMax(xymin, xymax);
335 }
336 G4ThreeVector zhalf(0., 0., fSize[2] / fNSegment[2] - thick);
337 for(int x = 0; x < fNSegment[0]; x++)
338 {
339 for(int y = 0; y < fNSegment[1]; y++)
340 {
341 G4ThreeVector pos(GetReplicaPosition(x, y, 0) - zhalf);
342 G4ThreeVector pos2(GetReplicaPosition(x, y, fNSegment[2] - 1) +
343 zhalf);
344 G4Transform3D trans, trans2;
346 {
347 trans = G4Rotate3D(*fRotationMatrix).inverse() * G4Translate3D(pos);
348 trans = G4Translate3D(fCenterPosition) * trans;
349 trans2 =
350 G4Rotate3D(*fRotationMatrix).inverse() * G4Translate3D(pos2);
351 trans2 = G4Translate3D(fCenterPosition) * trans2;
352 }
353 else
354 {
357 }
358 G4double c[4];
359 colorMap->GetMapColor(xycell[x][y], c);
360 att.SetColour(c[0], c[1], c[2]); //, c[3]);
361
362 G4Box xyplate("xy", fSize[0] / fNSegment[0], fSize[1] / fNSegment[1],
363 thick);
364 G4Polyhedron* poly = xyplate.GetPolyhedron();
365 poly->Transform(trans);
366 poly->SetVisAttributes(&att);
367 pVisManager->Draw(*poly);
368
369 G4Box xyplate2 = xyplate;
370 G4Polyhedron* poly2 = xyplate2.GetPolyhedron();
371 poly2->Transform(trans2);
372 poly2->SetVisAttributes(&att);
373 pVisManager->Draw(*poly2);
374
375 /*
376 G4double nodes[][3] =
377 {{-fSize[0]/fNSegment[0], -fSize[1]/fNSegment[1], 0.},
378 { fSize[0]/fNSegment[0], -fSize[1]/fNSegment[1], 0.},
379 { fSize[0]/fNSegment[0], fSize[1]/fNSegment[1], 0.},
380 {-fSize[0]/fNSegment[0], fSize[1]/fNSegment[1], 0.}};
381 G4int facets[][4] = {{4, 3, 2, 1}};
382 G4int facets2[][4] = {{1, 2, 3, 4}};
383
384 G4Polyhedron poly, poly2;
385 poly.createPolyhedron(4, 1, nodes, facets);
386 poly.Transform(trans);
387 poly.SetVisAttributes(att);
388 pVisManager->Draw(poly);
389
390 poly2.createPolyhedron(4, 1, nodes, facets2);
391 poly2.Transform(trans2);
392 poly2.SetVisAttributes(att);
393 pVisManager->Draw(poly2);
394 */
395 }
396 }
397 pVisManager->EndDraw();
398 }
399 axflg = axflg % 100;
400 if(axflg / 10 == 1)
401 {
402 pVisManager->BeginDraw();
403
404 // yz plane
405 if(colorMap->IfFloatMinMax())
406 {
407 colorMap->SetMinMax(yzmin, yzmax);
408 }
409 G4ThreeVector xhalf(fSize[0] / fNSegment[0] - thick, 0., 0.);
410 for(int y = 0; y < fNSegment[1]; y++)
411 {
412 for(int z = 0; z < fNSegment[2]; z++)
413 {
414 G4ThreeVector pos(GetReplicaPosition(0, y, z) - xhalf);
415 G4ThreeVector pos2(GetReplicaPosition(fNSegment[0] - 1, y, z) +
416 xhalf);
417 G4Transform3D trans, trans2;
419 {
420 trans = G4Rotate3D(*fRotationMatrix).inverse() * G4Translate3D(pos);
421 trans = G4Translate3D(fCenterPosition) * trans;
422 trans2 =
423 G4Rotate3D(*fRotationMatrix).inverse() * G4Translate3D(pos2);
424 trans2 = G4Translate3D(fCenterPosition) * trans2;
425 }
426 else
427 {
430 }
431 G4double c[4];
432 colorMap->GetMapColor(yzcell[y][z], c);
433 att.SetColour(c[0], c[1], c[2]); //, c[3]);
434
435 G4Box yzplate("yz", thick, // fSize[0]/fNSegment[0]*0.001,
436 fSize[1] / fNSegment[1], fSize[2] / fNSegment[2]);
437 G4Polyhedron* poly = yzplate.GetPolyhedron();
438 poly->Transform(trans);
439 poly->SetVisAttributes(&att);
440 pVisManager->Draw(*poly);
441
442 G4Box yzplate2 = yzplate;
443 G4Polyhedron* poly2 = yzplate2.GetPolyhedron();
444 poly2->Transform(trans2);
445 poly2->SetVisAttributes(&att);
446 pVisManager->Draw(*poly2);
447
448 /*
449 G4double nodes[][3] =
450 {{0., -fSize[1]/fNSegment[1], -fSize[2]/fNSegment[2]},
451 {0., fSize[1]/fNSegment[1], -fSize[2]/fNSegment[2]},
452 {0., fSize[1]/fNSegment[1], fSize[2]/fNSegment[2]},
453 {0., -fSize[1]/fNSegment[1], fSize[2]/fNSegment[2]}};
454 G4int facets[][4] = {{4, 3, 2, 1}};
455 G4int facets2[][4] = {{1, 2, 3, 4}};
456
457 G4Polyhedron poly, poly2;
458 poly.createPolyhedron(4, 1, nodes, facets);
459 poly.Transform(trans);
460 poly.SetVisAttributes(att);
461 pVisManager->Draw(poly);
462
463 poly2.createPolyhedron(4, 1, nodes, facets2);
464 poly2.Transform(trans2);
465 poly2.SetVisAttributes(att);
466 pVisManager->Draw(poly2);
467 */
468 }
469 }
470 pVisManager->EndDraw();
471 }
472 axflg = axflg % 10;
473 if(axflg == 1)
474 {
475 pVisManager->BeginDraw();
476
477 // xz plane
478 if(colorMap->IfFloatMinMax())
479 {
480 colorMap->SetMinMax(xzmin, xzmax);
481 }
482 G4ThreeVector yhalf(0., fSize[1] / fNSegment[1] - thick, 0.);
483 for(int x = 0; x < fNSegment[0]; x++)
484 {
485 for(int z = 0; z < fNSegment[2]; z++)
486 {
487 G4ThreeVector pos(GetReplicaPosition(x, 0, z) - yhalf);
488 G4ThreeVector pos2(GetReplicaPosition(x, fNSegment[1] - 1, z) +
489 yhalf);
490 G4Transform3D trans, trans2;
492 {
493 trans = G4Rotate3D(*fRotationMatrix).inverse() * G4Translate3D(pos);
494 trans = G4Translate3D(fCenterPosition) * trans;
495 trans2 =
496 G4Rotate3D(*fRotationMatrix).inverse() * G4Translate3D(pos2);
497 trans2 = G4Translate3D(fCenterPosition) * trans2;
498 }
499 else
500 {
503 }
504 G4double c[4];
505 colorMap->GetMapColor(xzcell[x][z], c);
506 att.SetColour(c[0], c[1], c[2]); //, c[3]);
507
508 G4Box xzplate("xz", fSize[0] / fNSegment[0],
509 thick, // fSize[1]/fNSegment[1]*0.001,
510 fSize[2] / fNSegment[2]);
511 G4Polyhedron* poly = xzplate.GetPolyhedron();
512 poly->Transform(trans);
513 poly->SetVisAttributes(&att);
514 pVisManager->Draw(*poly);
515
516 G4Box xzplate2 = xzplate;
517 G4Polyhedron* poly2 = xzplate2.GetPolyhedron();
518 poly2->Transform(trans2);
519 poly2->SetVisAttributes(&att);
520 pVisManager->Draw(*poly2);
521
522 /*
523 G4double nodes[][3] =
524 {{-fSize[1]/fNSegment[1], 0., -fSize[2]/fNSegment[2]},
525 { fSize[1]/fNSegment[1], 0., -fSize[2]/fNSegment[2]},
526 { fSize[1]/fNSegment[1], 0., fSize[2]/fNSegment[2]},
527 {-fSize[1]/fNSegment[1], 0., fSize[2]/fNSegment[2]}};
528 G4int facets[][4] = {{1, 2, 3, 4}};
529 G4int facets2[][4] = {{4, 3, 2, 1}};
530
531 G4Polyhedron poly, poly2;
532 poly.createPolyhedron(4, 1, nodes, facets);
533 poly.Transform(trans);
534 poly.SetVisAttributes(att);
535 pVisManager->Draw(poly);
536
537 poly2.createPolyhedron(4, 1, nodes, facets2);
538 poly2.Transform(trans2);
539 poly2.SetVisAttributes(att);
540 pVisManager->Draw(poly2);
541 */
542 }
543 }
544 pVisManager->EndDraw();
545 }
546 }
547 colorMap->SetPSUnit(fDrawUnit);
548 colorMap->SetPSName(fDrawPSName);
549 colorMap->DrawColorChart();
550}
static const G4double pos
HepGeom::Translate3D G4Translate3D
HepGeom::Rotate3D G4Rotate3D
double G4double
Definition: G4Types.hh:83
int G4int
Definition: G4Types.hh:85
Definition: G4Box.hh:56
virtual G4Polyhedron * GetPolyhedron() const
Definition: G4CSGSolid.cc:129
void GetXYZ(G4int index, G4int q[3]) const
G4ThreeVector GetReplicaPosition(G4int x, G4int y, G4int z)
virtual void DrawColorChart(G4int nPoint=5)
G4bool IfFloatMinMax() const
void SetMinMax(G4double minVal, G4double maxVal)
void SetPSUnit(G4String &unit)
virtual void GetMapColor(G4double val, G4double color[4])=0
void SetPSName(G4String &psName)
G4RotationMatrix * fRotationMatrix
G4double fDrawUnitValue
G4String fDrawPSName
G4double fSize[3]
G4ThreeVector fCenterPosition
virtual void EndDraw()=0
static G4VVisManager * GetConcreteInstance()
virtual void Draw(const G4Circle &, const G4Transform3D &objectTransformation=G4Transform3D())=0
virtual void BeginDraw(const G4Transform3D &objectTransformation=G4Transform3D())=0
void SetColour(const G4Colour &)
void SetForceAuxEdgeVisible(G4bool=true)
void SetForceSolid(G4bool=true)
void SetVisAttributes(const G4VisAttributes *)
Definition: G4Visible.cc:96
Transform3D inverse() const
Definition: Transform3D.cc:141
HepPolyhedron & Transform(const G4Transform3D &t)
#define DBL_MAX
Definition: templates.hh:62

References G4VVisManager::BeginDraw(), DBL_MAX, G4VVisManager::Draw(), G4VScoreColorMap::DrawColorChart(), G4VVisManager::EndDraw(), G4VScoringMesh::fCenterPosition, G4VScoringMesh::fDrawPSName, G4VScoringMesh::fDrawUnit, G4VScoringMesh::fDrawUnitValue, G4VScoringMesh::fNSegment, G4VScoringMesh::fRotationMatrix, G4VScoringMesh::fSize, G4VVisManager::GetConcreteInstance(), G4VScoreColorMap::GetMapColor(), G4CSGSolid::GetPolyhedron(), GetReplicaPosition(), GetXYZ(), G4VScoreColorMap::IfFloatMinMax(), HepGeom::Transform3D::inverse(), anonymous_namespace{G4QuasiElRatios.cc}::map, pos, G4VisAttributes::SetColour(), G4VisAttributes::SetForceAuxEdgeVisible(), G4VisAttributes::SetForceSolid(), G4VScoreColorMap::SetMinMax(), G4VScoreColorMap::SetPSName(), G4VScoreColorMap::SetPSUnit(), G4Visible::SetVisAttributes(), and HepPolyhedron::Transform().

◆ DrawColumn()

void G4ScoringBox::DrawColumn ( RunScore map,
G4VScoreColorMap colorMap,
G4int  idxProj,
G4int  idxColumn 
)
virtual

Implements G4VScoringMesh.

Definition at line 575 of file G4ScoringBox.cc.

577{
578 G4int iColumn[3] = { 2, 0, 1 };
579 if(idxColumn < 0 || idxColumn >= fNSegment[iColumn[idxProj]])
580 {
581 G4cerr << "ERROR : Column number " << idxColumn
582 << " is out of scoring mesh [0," << fNSegment[iColumn[idxProj]] - 1
583 << "]. Method ignored." << G4endl;
584 return;
585 }
587 if(pVisManager)
588 {
589 pVisManager->BeginDraw();
590
591 // cell vectors
592 std::vector<std::vector<std::vector<double>>> cell; // cell[X][Y][Z]
593 std::vector<double> ez;
594 for(int z = 0; z < fNSegment[2]; z++)
595 ez.push_back(0.);
596 std::vector<std::vector<double>> eyz;
597 for(int y = 0; y < fNSegment[1]; y++)
598 eyz.push_back(ez);
599 for(int x = 0; x < fNSegment[0]; x++)
600 cell.push_back(eyz);
601
602 std::vector<std::vector<double>> xycell; // xycell[X][Y]
603 std::vector<double> ey;
604 for(int y = 0; y < fNSegment[1]; y++)
605 ey.push_back(0.);
606 for(int x = 0; x < fNSegment[0]; x++)
607 xycell.push_back(ey);
608
609 std::vector<std::vector<double>> yzcell; // yzcell[Y][Z]
610 for(int y = 0; y < fNSegment[1]; y++)
611 yzcell.push_back(ez);
612
613 std::vector<std::vector<double>> xzcell; // xzcell[X][Z]
614 for(int x = 0; x < fNSegment[0]; x++)
615 xzcell.push_back(ez);
616
617 // projections
618 G4int q[3];
619 std::map<G4int, G4StatDouble*>::iterator itr = map->GetMap()->begin();
620 for(; itr != map->GetMap()->end(); itr++)
621 {
622 GetXYZ(itr->first, q);
623
624 if(idxProj == 0 && q[2] == idxColumn)
625 { // xy plane
626 xycell[q[0]][q[1]] += (itr->second->sum_wx()) / fDrawUnitValue;
627 }
628 if(idxProj == 1 && q[0] == idxColumn)
629 { // yz plane
630 yzcell[q[1]][q[2]] += (itr->second->sum_wx()) / fDrawUnitValue;
631 }
632 if(idxProj == 2 && q[1] == idxColumn)
633 { // zx plane
634 xzcell[q[0]][q[2]] += (itr->second->sum_wx()) / fDrawUnitValue;
635 }
636 }
637
638 // search max. & min. values in each slice
639 G4double xymin = DBL_MAX, yzmin = DBL_MAX, xzmin = DBL_MAX;
640 G4double xymax = 0., yzmax = 0., xzmax = 0.;
641 for(int x = 0; x < fNSegment[0]; x++)
642 {
643 for(int y = 0; y < fNSegment[1]; y++)
644 {
645 if(xymin > xycell[x][y])
646 xymin = xycell[x][y];
647 if(xymax < xycell[x][y])
648 xymax = xycell[x][y];
649 }
650 for(int z = 0; z < fNSegment[2]; z++)
651 {
652 if(xzmin > xzcell[x][z])
653 xzmin = xzcell[x][z];
654 if(xzmax < xzcell[x][z])
655 xzmax = xzcell[x][z];
656 }
657 }
658 for(int y = 0; y < fNSegment[1]; y++)
659 {
660 for(int z = 0; z < fNSegment[2]; z++)
661 {
662 if(yzmin > yzcell[y][z])
663 yzmin = yzcell[y][z];
664 if(yzmax < yzcell[y][z])
665 yzmax = yzcell[y][z];
666 }
667 }
668
669 G4VisAttributes att;
670 att.SetForceSolid(true);
671 att.SetForceAuxEdgeVisible(true);
672
673 G4Scale3D scale;
674 // xy plane
675 if(idxProj == 0)
676 {
677 if(colorMap->IfFloatMinMax())
678 {
679 colorMap->SetMinMax(xymin, xymax);
680 }
681 for(int x = 0; x < fNSegment[0]; x++)
682 {
683 for(int y = 0; y < fNSegment[1]; y++)
684 {
685 G4Box xyplate("xy", fSize[0] / fNSegment[0], fSize[1] / fNSegment[1],
686 fSize[2] / fNSegment[2]);
687
688 G4ThreeVector pos(GetReplicaPosition(x, y, idxColumn));
689 G4Transform3D trans;
691 {
692 trans = G4Rotate3D(*fRotationMatrix).inverse() * G4Translate3D(pos);
693 trans = G4Translate3D(fCenterPosition) * trans;
694 }
695 else
696 {
698 }
699 G4double c[4];
700 colorMap->GetMapColor(xycell[x][y], c);
701 att.SetColour(c[0], c[1], c[2]);
702
703 G4Polyhedron* poly = xyplate.GetPolyhedron();
704 poly->Transform(trans);
705 poly->SetVisAttributes(att);
706 pVisManager->Draw(*poly);
707 }
708 }
709 }
710 else
711 // yz plane
712 if(idxProj == 1)
713 {
714 if(colorMap->IfFloatMinMax())
715 {
716 colorMap->SetMinMax(yzmin, yzmax);
717 }
718 for(int y = 0; y < fNSegment[1]; y++)
719 {
720 for(int z = 0; z < fNSegment[2]; z++)
721 {
722 G4Box yzplate("yz", fSize[0] / fNSegment[0], fSize[1] / fNSegment[1],
723 fSize[2] / fNSegment[2]);
724
725 G4ThreeVector pos(GetReplicaPosition(idxColumn, y, z));
726 G4Transform3D trans;
728 {
729 trans = G4Rotate3D(*fRotationMatrix).inverse() * G4Translate3D(pos);
730 trans = G4Translate3D(fCenterPosition) * trans;
731 }
732 else
733 {
735 }
736 G4double c[4];
737 colorMap->GetMapColor(yzcell[y][z], c);
738 att.SetColour(c[0], c[1], c[2]); //, c[3]);
739
740 G4Polyhedron* poly = yzplate.GetPolyhedron();
741 poly->Transform(trans);
742 poly->SetVisAttributes(att);
743 pVisManager->Draw(*poly);
744 }
745 }
746 }
747 else
748 // xz plane
749 if(idxProj == 2)
750 {
751 if(colorMap->IfFloatMinMax())
752 {
753 colorMap->SetMinMax(xzmin, xzmax);
754 }
755 for(int x = 0; x < fNSegment[0]; x++)
756 {
757 for(int z = 0; z < fNSegment[2]; z++)
758 {
759 G4Box xzplate("xz", fSize[0] / fNSegment[0], fSize[1] / fNSegment[1],
760 fSize[2] / fNSegment[2]);
761
762 G4ThreeVector pos(GetReplicaPosition(x, idxColumn, z));
763 G4Transform3D trans;
765 {
766 trans = G4Rotate3D(*fRotationMatrix).inverse() * G4Translate3D(pos);
767 trans = G4Translate3D(fCenterPosition) * trans;
768 }
769 else
770 {
772 }
773 G4double c[4];
774 colorMap->GetMapColor(xzcell[x][z], c);
775 att.SetColour(c[0], c[1], c[2]); //, c[3]);
776
777 G4Polyhedron* poly = xzplate.GetPolyhedron();
778 poly->Transform(trans);
779 poly->SetVisAttributes(att);
780 pVisManager->Draw(*poly);
781 }
782 }
783 }
784 pVisManager->EndDraw();
785 }
786
787 colorMap->SetPSUnit(fDrawUnit);
788 colorMap->SetPSName(fDrawPSName);
789 colorMap->DrawColorChart();
790}
G4GLOB_DLL std::ostream G4cerr

References G4VVisManager::BeginDraw(), DBL_MAX, G4VVisManager::Draw(), G4VScoreColorMap::DrawColorChart(), G4VVisManager::EndDraw(), G4VScoringMesh::fCenterPosition, G4VScoringMesh::fDrawPSName, G4VScoringMesh::fDrawUnit, G4VScoringMesh::fDrawUnitValue, G4VScoringMesh::fNSegment, G4VScoringMesh::fRotationMatrix, G4VScoringMesh::fSize, G4cerr, G4endl, G4VVisManager::GetConcreteInstance(), G4VScoreColorMap::GetMapColor(), G4CSGSolid::GetPolyhedron(), GetReplicaPosition(), GetXYZ(), G4VScoreColorMap::IfFloatMinMax(), HepGeom::Transform3D::inverse(), anonymous_namespace{G4QuasiElRatios.cc}::map, pos, G4VisAttributes::SetColour(), G4VisAttributes::SetForceAuxEdgeVisible(), G4VisAttributes::SetForceSolid(), G4VScoreColorMap::SetMinMax(), G4VScoreColorMap::SetPSName(), G4VScoreColorMap::SetPSUnit(), G4Visible::SetVisAttributes(), and HepPolyhedron::Transform().

◆ DrawMesh() [1/2]

void G4VScoringMesh::DrawMesh ( const G4String psName,
G4int  idxPlane,
G4int  iColumn,
G4VScoreColorMap colorMap 
)
inherited

Definition at line 368 of file G4VScoringMesh.cc.

370{
371 fDrawPSName = psName;
372 MeshScoreMap::const_iterator fMapItr = fMap.find(psName);
373 if(fMapItr != fMap.end())
374 {
375 fDrawUnit = GetPSUnit(psName);
377 DrawColumn(fMapItr->second, colorMap, idxPlane, iColumn);
378 }
379 else
380 {
381 G4cerr << "Scorer <" << psName << "> is not defined. Method ignored."
382 << G4endl;
383 }
384}
G4double GetPSUnitValue(const G4String &psname)
G4String GetPSUnit(const G4String &psname)
virtual void DrawColumn(RunScore *map, G4VScoreColorMap *colorMap, G4int idxProj, G4int idxColumn)=0

References G4VScoringMesh::DrawColumn(), G4VScoringMesh::fDrawPSName, G4VScoringMesh::fDrawUnit, G4VScoringMesh::fDrawUnitValue, G4VScoringMesh::fMap, G4cerr, G4endl, G4VScoringMesh::GetPSUnit(), and G4VScoringMesh::GetPSUnitValue().

◆ DrawMesh() [2/2]

void G4VScoringMesh::DrawMesh ( const G4String psName,
G4VScoreColorMap colorMap,
G4int  axflg = 111 
)
inherited

Definition at line 350 of file G4VScoringMesh.cc.

352{
353 fDrawPSName = psName;
354 MeshScoreMap::const_iterator fMapItr = fMap.find(psName);
355 if(fMapItr != fMap.end())
356 {
357 fDrawUnit = GetPSUnit(psName);
359 Draw(fMapItr->second, colorMap, axflg);
360 }
361 else
362 {
363 G4cerr << "Scorer <" << psName << "> is not defined. Method ignored."
364 << G4endl;
365 }
366}
virtual void Draw(RunScore *map, G4VScoreColorMap *colorMap, G4int axflg=111)=0

References G4VScoringMesh::Draw(), G4VScoringMesh::fDrawPSName, G4VScoringMesh::fDrawUnit, G4VScoringMesh::fDrawUnitValue, G4VScoringMesh::fMap, G4cerr, G4endl, G4VScoringMesh::GetPSUnit(), and G4VScoringMesh::GetPSUnitValue().

Referenced by G4VSceneHandler::AddCompound(), and G4ScoringManager::DrawMesh().

◆ Dump()

void G4VScoringMesh::Dump ( )
inherited

Definition at line 338 of file G4VScoringMesh.cc.

339{
340 G4cout << "scoring mesh name: " << fWorldName << G4endl;
341 G4cout << "# of G4THitsMap : " << fMap.size() << G4endl;
342 for(auto mp : fMap)
343 {
344 G4cout << "[" << mp.first << "]" << G4endl;
345 mp.second->PrintAllHits();
346 }
347 G4cout << G4endl;
348}

References G4VScoringMesh::fMap, G4VScoringMesh::fWorldName, G4cout, and G4endl.

◆ FindPrimitiveScorer()

G4bool G4VScoringMesh::FindPrimitiveScorer ( const G4String psname)
inherited

Definition at line 223 of file G4VScoringMesh.cc.

224{
225 MeshScoreMap::iterator itr = fMap.find(psname);
226 if(itr == fMap.end())
227 return false;
228 return true;
229}

References G4VScoringMesh::fMap.

Referenced by G4ScoreQuantityMessenger::CheckMeshPS().

◆ GeometryHasBeenDestroyed()

void G4VScoringMesh::GeometryHasBeenDestroyed ( )
inlineinherited

◆ GetAngleSpan()

G4double G4VScoringMesh::GetAngleSpan ( ) const
inlineinherited

Definition at line 129 of file G4VScoringMesh.hh.

129{ return fAngle[1]; }
G4double fAngle[2]

References G4VScoringMesh::fAngle.

Referenced by G4ScoreQuantityMessenger::SetNewValue().

◆ GetCopyNumberLevel()

G4int G4VScoringMesh::GetCopyNumberLevel ( ) const
inlineinherited

Definition at line 263 of file G4VScoringMesh.hh.

263{ return copyNumberLevel; }

References G4VScoringMesh::copyNumberLevel.

Referenced by G4ScoreQuantityMessenger::SetNewValue().

◆ GetCurrentPSUnit()

G4String G4VScoringMesh::GetCurrentPSUnit ( )
inherited

Definition at line 244 of file G4VScoringMesh.cc.

245{
246 G4String unit = "";
247 if(!fCurrentPS)
248 {
249 G4String msg = "ERROR : G4VScoringMesh::GetCurrentPSUnit() : ";
250 msg += " Current primitive scorer is null.";
251 G4cerr << msg << G4endl;
252 }
253 else
254 {
255 unit = fCurrentPS->GetUnit();
256 }
257 return unit;
258}
const G4String & GetUnit() const
G4VPrimitiveScorer * fCurrentPS

References G4VScoringMesh::fCurrentPS, G4cerr, G4endl, and G4VPrimitiveScorer::GetUnit().

Referenced by G4ScoreQuantityMessenger::SetNewValue().

◆ GetDivisionAxisNames()

void G4VScoringMesh::GetDivisionAxisNames ( G4String  divisionAxisNames[3])
inherited

Definition at line 287 of file G4VScoringMesh.cc.

288{
289 for(int i = 0; i < 3; i++)
290 divisionAxisNames[i] = fDivisionAxisNames[i];
291}

References G4VScoringMesh::fDivisionAxisNames.

Referenced by G4VScoreWriter::DumpAllQuantitiesToFile(), and G4VScoreWriter::DumpQuantityToFile().

◆ GetIndex()

G4int G4ScoringBox::GetIndex ( G4int  x,
G4int  y,
G4int  z 
) const
private

Definition at line 570 of file G4ScoringBox.cc.

571{
572 return x + y * fNSegment[0] + z * fNSegment[0] * fNSegment[1];
573}

References G4VScoringMesh::fNSegment.

◆ GetMeshElementLogical()

G4LogicalVolume * G4VScoringMesh::GetMeshElementLogical ( ) const
inlineinherited

Definition at line 232 of file G4VScoringMesh.hh.

233 {
234 return fMeshElementLogical;
235 }

References G4VScoringMesh::fMeshElementLogical.

Referenced by G4WorkerRunManager::ConstructScoringWorlds().

◆ GetNumberOfSegments()

void G4VScoringMesh::GetNumberOfSegments ( G4int  nSegment[3])
inherited

Definition at line 140 of file G4VScoringMesh.cc.

141{
142 for(int i = 0; i < 3; i++)
143 nSegment[i] = fNSegment[i];
144}

References G4VScoringMesh::fNSegment.

Referenced by G4GMocrenFileSceneHandler::AddSolid(), G4ScoreQuantityMessenger::SetNewValue(), and G4VScoreWriter::SetScoringMesh().

◆ GetParallelWorldProcess()

G4ParallelWorldProcess * G4VScoringMesh::GetParallelWorldProcess ( ) const
inlineinherited

Definition at line 246 of file G4VScoringMesh.hh.

247 {
249 }
G4ParallelWorldProcess * fParallelWorldProcess

References G4VScoringMesh::fParallelWorldProcess.

Referenced by G4RunManager::ConstructScoringWorlds(), and G4WorkerRunManager::ConstructScoringWorlds().

◆ GetPrimitiveScorer()

G4VPrimitiveScorer * G4VScoringMesh::GetPrimitiveScorer ( const G4String name)
inherited

◆ GetPSUnit()

G4String G4VScoringMesh::GetPSUnit ( const G4String psname)
inherited

Definition at line 231 of file G4VScoringMesh.cc.

232{
233 MeshScoreMap::iterator itr = fMap.find(psname);
234 if(itr == fMap.end())
235 {
236 return G4String("");
237 }
238 else
239 {
240 return GetPrimitiveScorer(psname)->GetUnit();
241 }
242}
G4VPrimitiveScorer * GetPrimitiveScorer(const G4String &name)

References G4VScoringMesh::fMap, G4VScoringMesh::GetPrimitiveScorer(), and G4VPrimitiveScorer::GetUnit().

Referenced by G4VScoringMesh::DrawMesh(), G4VScoreWriter::DumpAllQuantitiesToFile(), and G4VScoreWriter::DumpQuantityToFile().

◆ GetPSUnitValue()

G4double G4VScoringMesh::GetPSUnitValue ( const G4String psname)
inherited

Definition at line 274 of file G4VScoringMesh.cc.

275{
276 MeshScoreMap::iterator itr = fMap.find(psname);
277 if(itr == fMap.end())
278 {
279 return 1.;
280 }
281 else
282 {
283 return GetPrimitiveScorer(psname)->GetUnitValue();
284 }
285}
G4double GetUnitValue() const

References G4VScoringMesh::fMap, G4VScoringMesh::GetPrimitiveScorer(), and G4VPrimitiveScorer::GetUnitValue().

Referenced by G4VScoringMesh::DrawMesh(), G4VScoreWriter::DumpAllQuantitiesToFile(), and G4VScoreWriter::DumpQuantityToFile().

◆ GetReplicaPosition()

G4ThreeVector G4ScoringBox::GetReplicaPosition ( G4int  x,
G4int  y,
G4int  z 
)
private

Definition at line 552 of file G4ScoringBox.cc.

553{
554 G4ThreeVector width(fSize[0] / fNSegment[0], fSize[1] / fNSegment[1],
555 fSize[2] / fNSegment[2]);
556 G4ThreeVector pos(-fSize[0] + 2 * (x + 0.5) * width.x(),
557 -fSize[1] + 2 * (y + 0.5) * width.y(),
558 -fSize[2] + 2 * (z + 0.5) * width.z());
559
560 return pos;
561}

References G4VScoringMesh::fNSegment, G4VScoringMesh::fSize, pos, CLHEP::Hep3Vector::x(), CLHEP::Hep3Vector::y(), and CLHEP::Hep3Vector::z().

Referenced by Draw(), and DrawColumn().

◆ GetRotationMatrix()

G4RotationMatrix G4VScoringMesh::GetRotationMatrix ( ) const
inlineinherited

Definition at line 141 of file G4VScoringMesh.hh.

142 {
144 return *fRotationMatrix;
145 else
147 }
static DLL_API const HepRotation IDENTITY
Definition: Rotation.h:366

References G4VScoringMesh::fRotationMatrix, and CLHEP::HepRotation::IDENTITY.

Referenced by G4GMocrenFileSceneHandler::AddSolid().

◆ GetScoreMap()

MeshScoreMap G4VScoringMesh::GetScoreMap ( ) const
inlineinherited

◆ GetShape()

MeshShape G4VScoringMesh::GetShape ( ) const
inlineinherited

◆ GetSize()

G4ThreeVector G4VScoringMesh::GetSize ( ) const
inherited

Definition at line 105 of file G4VScoringMesh.cc.

106{
107 if(sizeIsSet)
108 return G4ThreeVector(fSize[0], fSize[1], fSize[2]);
109 else
110 return G4ThreeVector(0., 0., 0.);
111}
CLHEP::Hep3Vector G4ThreeVector

References G4VScoringMesh::fSize, and G4VScoringMesh::sizeIsSet.

Referenced by G4GMocrenFileSceneHandler::AddSolid(), G4ScoreQuantityMessenger::SetNewValue(), and G4ScoringMessenger::SetNewValue().

◆ GetStartAngle()

G4double G4VScoringMesh::GetStartAngle ( ) const
inlineinherited

Definition at line 128 of file G4VScoringMesh.hh.

128{ return fAngle[0]; }

References G4VScoringMesh::fAngle.

Referenced by G4ScoreQuantityMessenger::SetNewValue().

◆ GetTranslation()

G4ThreeVector G4VScoringMesh::GetTranslation ( ) const
inlineinherited

Definition at line 133 of file G4VScoringMesh.hh.

133{ return fCenterPosition; }

References G4VScoringMesh::fCenterPosition.

Referenced by G4GMocrenFileSceneHandler::AddSolid().

◆ GetWorldName()

const G4String & G4VScoringMesh::GetWorldName ( ) const
inlineinherited

◆ GetXYZ()

void G4ScoringBox::GetXYZ ( G4int  index,
G4int  q[3] 
) const
private

Definition at line 563 of file G4ScoringBox.cc.

564{
565 q[0] = index / (fNSegment[2] * fNSegment[1]);
566 q[1] = (index - q[0] * fNSegment[2] * fNSegment[1]) / fNSegment[2];
567 q[2] = index - q[1] * fNSegment[2] - q[0] * fNSegment[2] * fNSegment[1];
568}

References G4VScoringMesh::fNSegment.

Referenced by Draw(), and DrawColumn().

◆ IsActive()

G4bool G4VScoringMesh::IsActive ( ) const
inlineinherited

Definition at line 93 of file G4VScoringMesh.hh.

93{ return fActive; }

References G4VScoringMesh::fActive.

Referenced by G4VSceneHandler::AddCompound(), and G4PSHitsModel::DescribeYourselfTo().

◆ IsCurrentPrimitiveScorerNull()

G4bool G4VScoringMesh::IsCurrentPrimitiveScorerNull ( )
inlineinherited

Definition at line 164 of file G4VScoringMesh.hh.

165 {
166 if(fCurrentPS == nullptr)
167 return true;
168 else
169 return false;
170 }

References G4VScoringMesh::fCurrentPS.

Referenced by G4ScoreQuantityMessenger::SetNewValue().

◆ LayeredMassFlg()

G4bool G4VScoringMesh::LayeredMassFlg ( )
inlineinherited

◆ List()

void G4ScoringBox::List ( ) const
virtual

Reimplemented from G4VScoringMesh.

Definition at line 238 of file G4ScoringBox.cc.

239{
240 G4cout << "G4ScoringBox : " << fWorldName << " --- Shape: Box mesh" << G4endl;
241 G4cout << " Size (x, y, z): (" << fSize[0] / cm << ", " << fSize[1] / cm
242 << ", " << fSize[2] / cm << ") [cm]" << G4endl;
243
245}
static constexpr double cm
Definition: G4SIunits.hh:99
virtual void List() const

References cm, G4VScoringMesh::fSize, G4VScoringMesh::fWorldName, G4cout, G4endl, and G4VScoringMesh::List().

◆ Merge()

void G4VScoringMesh::Merge ( const G4VScoringMesh scMesh)
inherited

Definition at line 476 of file G4VScoringMesh.cc.

477{
478 const MeshScoreMap scMap = scMesh->GetScoreMap();
479
480 MeshScoreMap::const_iterator fMapItr = fMap.begin();
481 MeshScoreMap::const_iterator mapItr = scMap.begin();
482 for(; fMapItr != fMap.end(); fMapItr++)
483 {
484 if(verboseLevel > 9)
485 G4cout << "G4VScoringMesh::Merge()" << fMapItr->first << G4endl;
486 *(fMapItr->second) += *(mapItr->second);
487 mapItr++;
488 }
489}
std::map< G4String, RunScore * > MeshScoreMap
MeshScoreMap GetScoreMap() const

References G4VScoringMesh::fMap, G4cout, G4endl, G4VScoringMesh::GetScoreMap(), and G4VScoringMesh::verboseLevel.

Referenced by G4ScoringManager::Merge().

◆ ReadyForQuantity()

G4bool G4VScoringMesh::ReadyForQuantity ( ) const
inlineinherited

Definition at line 192 of file G4VScoringMesh.hh.

192{ return (sizeIsSet && nMeshIsSet); }

References G4VScoringMesh::nMeshIsSet, and G4VScoringMesh::sizeIsSet.

Referenced by G4VScoringMesh::SetPrimitiveScorer().

◆ ResetScore()

void G4VScoringMesh::ResetScore ( )
inherited

Definition at line 75 of file G4VScoringMesh.cc.

76{
77 if(verboseLevel > 9)
78 G4cout << "G4VScoringMesh::ResetScore() is called." << G4endl;
79 for(auto mp : fMap)
80 {
81 if(verboseLevel > 9)
82 G4cout << "G4VScoringMesh::ResetScore()" << mp.first << G4endl;
83 mp.second->clear();
84 }
85}

References G4VScoringMesh::fMap, G4cout, G4endl, and G4VScoringMesh::verboseLevel.

Referenced by G4VScoringMesh::Construct(), and G4VScoringMesh::WorkerConstruct().

◆ RotateX()

void G4VScoringMesh::RotateX ( G4double  delta)
inherited

Definition at line 145 of file G4VScoringMesh.cc.

146{
147 if(!fRotationMatrix)
149 fRotationMatrix->rotateX(delta);
150}
CLHEP::HepRotation G4RotationMatrix
HepRotation & rotateX(double delta)
Definition: Rotation.cc:61

References G4VScoringMesh::fRotationMatrix, and CLHEP::HepRotation::rotateX().

Referenced by G4ScoringMessenger::SetNewValue().

◆ RotateY()

void G4VScoringMesh::RotateY ( G4double  delta)
inherited

Definition at line 152 of file G4VScoringMesh.cc.

153{
154 if(!fRotationMatrix)
156 fRotationMatrix->rotateY(delta);
157}
HepRotation & rotateY(double delta)
Definition: Rotation.cc:74

References G4VScoringMesh::fRotationMatrix, and CLHEP::HepRotation::rotateY().

Referenced by G4ScoringMessenger::SetNewValue().

◆ RotateZ()

void G4VScoringMesh::RotateZ ( G4double  delta)
inherited

Definition at line 159 of file G4VScoringMesh.cc.

160{
161 if(!fRotationMatrix)
163 fRotationMatrix->rotateZ(delta);
164}
HepRotation & rotateZ(double delta)
Definition: Rotation.cc:87

References G4VScoringMesh::fRotationMatrix, and CLHEP::HepRotation::rotateZ().

Referenced by G4ScoringMessenger::SetNewValue().

◆ SetAngles()

void G4VScoringMesh::SetAngles ( G4double  startAngle,
G4double  spanAngle 
)
inherited

Definition at line 112 of file G4VScoringMesh.cc.

113{
114 fAngle[0] = startAngle;
115 fAngle[1] = spanAngle;
116}

References G4VScoringMesh::fAngle.

Referenced by G4ScoringMessenger::SetNewValue().

◆ SetCenterPosition()

void G4VScoringMesh::SetCenterPosition ( G4double  centerPosition[3])
inherited

Definition at line 118 of file G4VScoringMesh.cc.

119{
121 G4ThreeVector(centerPosition[0], centerPosition[1], centerPosition[2]);
122}

References G4VScoringMesh::fCenterPosition.

Referenced by G4ScoringMessenger::SetNewValue().

◆ SetCopyNumberLevel()

void G4VScoringMesh::SetCopyNumberLevel ( G4int  val)
inlineinherited

Definition at line 262 of file G4VScoringMesh.hh.

262{ copyNumberLevel = val; }

References G4VScoringMesh::copyNumberLevel.

◆ SetCurrentPrimitiveScorer()

void G4VScoringMesh::SetCurrentPrimitiveScorer ( const G4String name)
inherited

Definition at line 212 of file G4VScoringMesh.cc.

213{
215 if(!fCurrentPS)
216 {
217 G4cerr << "ERROR : G4VScoringMesh::SetCurrentPrimitiveScorer() : The "
218 "primitive scorer <"
219 << name << "> does not found." << G4endl;
220 }
221}

References G4VScoringMesh::fCurrentPS, G4cerr, G4endl, G4VScoringMesh::GetPrimitiveScorer(), and G4InuclParticleNames::name().

Referenced by G4ScoreQuantityMessenger::SetNewValue().

◆ SetCurrentPSUnit()

void G4VScoringMesh::SetCurrentPSUnit ( const G4String unit)
inherited

Definition at line 260 of file G4VScoringMesh.cc.

261{
262 if(!fCurrentPS)
263 {
264 G4String msg = "ERROR : G4VScoringMesh::GetCurrentPSUnit() : ";
265 msg += " Current primitive scorer is null.";
266 G4cerr << msg << G4endl;
267 }
268 else
269 {
270 fCurrentPS->SetUnit(unit);
271 }
272}
void SetUnit(const G4String &unit)

References G4VScoringMesh::fCurrentPS, G4cerr, G4endl, and G4VPrimitiveScorer::SetUnit().

Referenced by G4ScoreQuantityMessenger::SetNewValue().

◆ SetDrawPSName()

void G4VScoringMesh::SetDrawPSName ( const G4String psname)
inlineinherited

Definition at line 180 of file G4VScoringMesh.hh.

180{ fDrawPSName = psname; }

References G4VScoringMesh::fDrawPSName.

◆ SetFilter()

void G4VScoringMesh::SetFilter ( G4VSDFilter filter)
inherited

Definition at line 190 of file G4VScoringMesh.cc.

191{
192 if(!fCurrentPS)
193 {
194 G4cerr << "ERROR : G4VScoringMesh::SetSDFilter() : a quantity must be "
195 "defined first. This method is ignored."
196 << G4endl;
197 return;
198 }
199 if(verboseLevel > 0)
200 G4cout << "G4VScoringMesh::SetFilter() : " << filter->GetName()
201 << " is set to " << fCurrentPS->GetName() << G4endl;
202
203 G4VSDFilter* oldFilter = fCurrentPS->GetFilter();
204 if(oldFilter)
205 {
206 G4cout << "WARNING : G4VScoringMesh::SetFilter() : " << oldFilter->GetName()
207 << " is overwritten by " << filter->GetName() << G4endl;
208 }
209 fCurrentPS->SetFilter(filter);
210}
G4VSDFilter * GetFilter() const
void SetFilter(G4VSDFilter *f)
G4String GetName() const
Definition: G4VSDFilter.hh:55

References G4VScoringMesh::fCurrentPS, G4cerr, G4cout, G4endl, G4VPrimitiveScorer::GetFilter(), G4VPrimitiveScorer::GetName(), G4VSDFilter::GetName(), G4VPrimitiveScorer::SetFilter(), and G4VScoringMesh::verboseLevel.

Referenced by G4ScoreQuantityMessenger::FParticleCommand(), G4ScoreQuantityMessenger::FParticleWithEnergyCommand(), and G4ScoreQuantityMessenger::SetNewValue().

◆ SetMeshElementLogical()

void G4VScoringMesh::SetMeshElementLogical ( G4LogicalVolume val)
inlineinherited

Definition at line 228 of file G4VScoringMesh.hh.

229 {
231 }

References G4VScoringMesh::fMeshElementLogical.

Referenced by G4WorkerRunManager::ConstructScoringWorlds().

◆ SetNullToCurrentPrimitiveScorer()

void G4VScoringMesh::SetNullToCurrentPrimitiveScorer ( )
inlineinherited

Definition at line 186 of file G4VScoringMesh.hh.

186{ fCurrentPS = nullptr; }

References G4VScoringMesh::fCurrentPS.

Referenced by G4ScoreQuantityMessenger::CheckMeshPS().

◆ SetNumberOfSegments()

void G4VScoringMesh::SetNumberOfSegments ( G4int  nSegment[3])
inherited

Definition at line 123 of file G4VScoringMesh.cc.

124{
127 {
128 for(int i = 0; i < 3; i++)
129 fNSegment[i] = nSegment[i];
130 nMeshIsSet = true;
131 }
132 else
133 {
134 G4String message = " Number of bins has already been set and it cannot be changed.\n";
135 message += " This method is ignored.";
136 G4Exception("G4VScoringMesh::SetNumberOfSegments()",
137 "DigiHitsUtilsScoreVScoringMesh000", JustWarning, message);
138 }
139}
@ JustWarning
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
Definition: G4Exception.cc:35

References G4VScoringMesh::fNSegment, G4VScoringMesh::fShape, G4Exception(), JustWarning, G4VScoringMesh::nMeshIsSet, G4VScoringMesh::probe, and G4VScoringMesh::realWorldLogVol.

Referenced by G4ScoringProbe::G4ScoringProbe(), G4ScoringRealWorld::G4ScoringRealWorld(), G4ScoringProbe::LocateProbe(), G4ScoringMessenger::MeshBinCommand(), and G4ScoringRealWorld::SetupGeometry().

◆ SetParallelWorldProcess()

void G4VScoringMesh::SetParallelWorldProcess ( G4ParallelWorldProcess proc)
inlineinherited

◆ SetPrimitiveScorer()

void G4VScoringMesh::SetPrimitiveScorer ( G4VPrimitiveScorer ps)
inherited

Definition at line 166 of file G4VScoringMesh.cc.

167{
168 if(!ReadyForQuantity())
169 {
170 G4cerr << "ERROR : G4VScoringMesh::SetPrimitiveScorer() : "
171 << prs->GetName()
172 << " does not yet have mesh size or number of bins. Set them first."
173 << G4endl << "This Method is ignored." << G4endl;
174 return;
175 }
176 if(verboseLevel > 0)
177 G4cout << "G4VScoringMesh::SetPrimitiveScorer() : " << prs->GetName()
178 << " is registered."
179 << " 3D size: (" << fNSegment[0] << ", " << fNSegment[1] << ", "
180 << fNSegment[2] << ")" << G4endl;
181
182 prs->SetNijk(fNSegment[0], fNSegment[1], fNSegment[2]);
183 fCurrentPS = prs;
186 new G4THitsMap<G4StatDouble>(fWorldName, prs->GetName());
187 fMap[prs->GetName()] = map;
188}
G4bool RegisterPrimitive(G4VPrimitiveScorer *)
G4bool ReadyForQuantity() const

References G4VScoringMesh::fCurrentPS, G4VScoringMesh::fMap, G4VScoringMesh::fMFD, G4VScoringMesh::fNSegment, G4VScoringMesh::fWorldName, G4cerr, G4cout, G4endl, G4VPrimitiveScorer::GetName(), anonymous_namespace{G4QuasiElRatios.cc}::map, G4VScoringMesh::ReadyForQuantity(), G4MultiFunctionalDetector::RegisterPrimitive(), G4VPrimitiveScorer::SetNijk(), and G4VScoringMesh::verboseLevel.

Referenced by G4ScoreQuantityMessenger::SetNewValue().

◆ SetSegmentDirection()

void G4ScoringBox::SetSegmentDirection ( G4int  dir)
inline

Definition at line 59 of file G4ScoringBox.hh.

59{ fSegmentDirection = dir; }

References fSegmentDirection.

◆ SetSize()

void G4VScoringMesh::SetSize ( G4double  size[3])
inherited

Definition at line 87 of file G4VScoringMesh.cc.

88{
89 if(!sizeIsSet)
90 {
91 sizeIsSet = true;
92 for(int i = 0; i < 3; i++)
93 {
94 fSize[i] = size[i];
95 }
96 }
97 else
98 {
99 G4String message = " Mesh size has already been set and it cannot be changed.\n";
100 message += " This method is ignored.";
101 G4Exception("G4VScoringMesh::SetSize()",
102 "DigiHitsUtilsScoreVScoringMesh000", JustWarning, message);
103 }
104}

References G4VScoringMesh::fSize, G4Exception(), JustWarning, and G4VScoringMesh::sizeIsSet.

Referenced by G4ScoringProbe::G4ScoringProbe(), G4ScoringRealWorld::G4ScoringRealWorld(), and G4ScoringMessenger::SetNewValue().

◆ SetupGeometry()

void G4ScoringBox::SetupGeometry ( G4VPhysicalVolume fWorldPhys)
protectedvirtual

Implements G4VScoringMesh.

Definition at line 66 of file G4ScoringBox.cc.

67{
68 if(verboseLevel > 9)
69 G4cout << "G4ScoringBox::SetupGeometry() ..." << G4endl;
70
71 // World
72 G4VPhysicalVolume* scoringWorld = fWorldPhys;
73 G4LogicalVolume* worldLogical = scoringWorld->GetLogicalVolume();
74
75 // Scoring Mesh
76 if(verboseLevel > 9)
78 G4String boxName = fWorldName;
79
80 if(verboseLevel > 9)
81 G4cout << fSize[0] << ", " << fSize[1] << ", " << fSize[2] << G4endl;
82 G4VSolid* boxSolid = new G4Box(boxName + "0", fSize[0], fSize[1], fSize[2]);
83 G4LogicalVolume* boxLogical =
84 new G4LogicalVolume(boxSolid, 0, boxName + "_0");
85 new G4PVPlacement(fRotationMatrix, fCenterPosition, boxLogical, boxName + "0",
86 worldLogical, false, 0);
87
88 // G4double fsegment[3][3];
89 // G4int segOrder[3];
90 // GetSegmentOrder(fSegmentDirection, fNSegment, segOrder, fsegment);
91 // EAxis axis[3] = {kXAxis, kYAxis, kZAxis};
92
93 G4String layerName[2] = { boxName + "_1", boxName + "_2" };
94 G4VSolid* layerSolid[2];
95 G4LogicalVolume* layerLogical[2];
96
97 //-- fisrt nested layer (replicated to x direction)
98 if(verboseLevel > 9)
99 G4cout << "layer 1 :" << G4endl;
100 layerSolid[0] =
101 new G4Box(layerName[0], fSize[0] / fNSegment[0], fSize[1], fSize[2]);
102 layerLogical[0] = new G4LogicalVolume(layerSolid[0], 0, layerName[0]);
103 if(fNSegment[0] > 1)
104 {
105 if(verboseLevel > 9)
106 G4cout << "G4ScoringBox::Construct() : Replicate to x direction"
107 << G4endl;
109 {
110 new G4PVReplica(layerName[0], layerLogical[0], boxLogical, kXAxis,
111 fNSegment[0], fSize[0] / fNSegment[0] * 2.);
112 }
113 else
114 {
115 new G4PVDivision(layerName[0], layerLogical[0], boxLogical, kXAxis,
116 fNSegment[0], 0.);
117 }
118 }
119 else if(fNSegment[0] == 1)
120 {
121 if(verboseLevel > 9)
122 G4cout << "G4ScoringBox::Construct() : Placement" << G4endl;
123 new G4PVPlacement(0, G4ThreeVector(0., 0., 0.), layerLogical[0],
124 layerName[0], boxLogical, false, 0);
125 }
126 else
127 G4cerr << "ERROR : G4ScoringBox::SetupGeometry() : invalid parameter ("
128 << fNSegment[0] << ") "
129 << "in placement of the first nested layer." << G4endl;
130
131 if(verboseLevel > 9)
132 {
133 G4cout << fSize[0] / fNSegment[0] << ", " << fSize[1] << ", " << fSize[2]
134 << G4endl;
135 G4cout << layerName[0] << ": kXAxis, " << fNSegment[0] << ", "
136 << 2. * fSize[0] / fNSegment[0] << G4endl;
137 }
138
139 // second nested layer (replicated to y direction)
140 if(verboseLevel > 9)
141 G4cout << "layer 2 :" << G4endl;
142 layerSolid[1] = new G4Box(layerName[1], fSize[0] / fNSegment[0],
143 fSize[1] / fNSegment[1], fSize[2]);
144 layerLogical[1] = new G4LogicalVolume(layerSolid[1], 0, layerName[1]);
145 if(fNSegment[1] > 1)
146 {
147 if(verboseLevel > 9)
148 G4cout << "G4ScoringBox::Construct() : Replicate to y direction"
149 << G4endl;
151 {
152 new G4PVReplica(layerName[1], layerLogical[1], layerLogical[0], kYAxis,
153 fNSegment[1], fSize[1] / fNSegment[1] * 2.);
154 }
155 else
156 {
157 new G4PVDivision(layerName[1], layerLogical[1], layerLogical[0], kYAxis,
158 fNSegment[1], 0.);
159 }
160 }
161 else if(fNSegment[1] == 1)
162 {
163 if(verboseLevel > 9)
164 G4cout << "G4ScoringBox::Construct() : Placement" << G4endl;
165 new G4PVPlacement(0, G4ThreeVector(0., 0., 0.), layerLogical[1],
166 layerName[1], layerLogical[0], false, 0);
167 }
168 else
169 G4cerr << "ERROR : G4ScoringBox::SetupGeometry() : invalid parameter ("
170 << fNSegment[1] << ") "
171 << "in placement of the second nested layer." << G4endl;
172
173 if(verboseLevel > 9)
174 {
175 G4cout << fSize[0] / fNSegment[0] << ", " << fSize[1] / fNSegment[1] << ", "
176 << fSize[2] << G4endl;
177 G4cout << layerName[1] << ": kYAxis, " << fNSegment[1] << ", "
178 << 2. * fSize[1] / fNSegment[1] << G4endl;
179 }
180
181 // mesh elements (replicated to z direction)
182 if(verboseLevel > 9)
183 G4cout << "mesh elements :" << G4endl;
184 G4String elementName = boxName + "_3";
185 G4VSolid* elementSolid =
186 new G4Box(elementName, fSize[0] / fNSegment[0], fSize[1] / fNSegment[1],
187 fSize[2] / fNSegment[2]);
188 fMeshElementLogical = new G4LogicalVolume(elementSolid, 0, elementName);
189 if(fNSegment[2] > 1)
190 {
191 if(verboseLevel > 9)
192 G4cout << "G4ScoringBox::Construct() : Replicate to z direction"
193 << G4endl;
194
196 {
197 new G4PVReplica(elementName, fMeshElementLogical, layerLogical[1], kZAxis,
198 fNSegment[2], 2. * fSize[2] / fNSegment[2]);
199 }
200 else
201 {
202 new G4PVDivision(elementName, fMeshElementLogical, layerLogical[1],
203 kZAxis, fNSegment[2], 0.);
204 }
205 }
206 else if(fNSegment[2] == 1)
207 {
208 if(verboseLevel > 9)
209 G4cout << "G4ScoringBox::Construct() : Placement" << G4endl;
211 elementName, layerLogical[1], false, 0);
212 }
213 else
214 G4cerr << "ERROR : G4ScoringBox::SetupGeometry() : "
215 << "invalid parameter (" << fNSegment[2] << ") "
216 << "in mesh element placement." << G4endl;
217
218 if(verboseLevel > 9)
219 {
220 G4cout << fSize[0] / fNSegment[0] << ", " << fSize[1] / fNSegment[1] << ", "
221 << fSize[2] / fNSegment[2] << G4endl;
222 G4cout << elementName << ": kZAxis, " << fNSegment[2] << ", "
223 << 2. * fSize[2] / fNSegment[2] << G4endl;
224 }
225
226 // set the sensitive detector
228
229 // vis. attributes
230 G4VisAttributes* visatt = new G4VisAttributes(G4Colour(.5, .5, .5));
231 visatt->SetVisibility(false);
232 layerLogical[0]->SetVisAttributes(visatt);
233 layerLogical[1]->SetVisAttributes(visatt);
234 visatt->SetVisibility(true);
236}
void SetVisAttributes(const G4VisAttributes *pVA)
void SetSensitiveDetector(G4VSensitiveDetector *pSDetector)
static G4int GetReplicaLevel()
G4LogicalVolume * GetLogicalVolume() const
void SetVisibility(G4bool=true)
@ kYAxis
Definition: geomdefs.hh:56
@ kXAxis
Definition: geomdefs.hh:55
@ kZAxis
Definition: geomdefs.hh:57

References G4VScoringMesh::fCenterPosition, G4VScoringMesh::fMeshElementLogical, G4VScoringMesh::fMFD, G4VScoringMesh::fNSegment, G4VScoringMesh::fRotationMatrix, G4VScoringMesh::fSize, G4VScoringMesh::fWorldName, G4cerr, G4cout, G4endl, G4VPhysicalVolume::GetLogicalVolume(), G4ScoringManager::GetReplicaLevel(), kXAxis, kYAxis, kZAxis, G4LogicalVolume::SetSensitiveDetector(), G4LogicalVolume::SetVisAttributes(), G4VisAttributes::SetVisibility(), and G4VScoringMesh::verboseLevel.

◆ SetVerboseLevel()

void G4VScoringMesh::SetVerboseLevel ( G4int  vl)
inlineinherited

Definition at line 188 of file G4VScoringMesh.hh.

188{ verboseLevel = vl; }

References G4VScoringMesh::verboseLevel.

Referenced by G4ScoringManager::RegisterScoringMesh().

◆ WorkerConstruct()

void G4VScoringMesh::WorkerConstruct ( G4VPhysicalVolume fWorldPhys)
virtualinherited

Field Documentation

◆ copyNumberLevel

G4int G4VScoringMesh::copyNumberLevel
protectedinherited

◆ fActive

G4bool G4VScoringMesh::fActive
protectedinherited

Definition at line 202 of file G4VScoringMesh.hh.

Referenced by G4VScoringMesh::Activate(), and G4VScoringMesh::IsActive().

◆ fAngle

G4double G4VScoringMesh::fAngle[2]
protectedinherited

◆ fCenterPosition

G4ThreeVector G4VScoringMesh::fCenterPosition
protectedinherited

◆ fConstructed

G4bool G4VScoringMesh::fConstructed
protectedinherited

◆ fCurrentPS

G4VPrimitiveScorer* G4VScoringMesh::fCurrentPS
protectedinherited

◆ fDivisionAxisNames

G4String G4VScoringMesh::fDivisionAxisNames[3]
protectedinherited

◆ fDrawPSName

G4String G4VScoringMesh::fDrawPSName
protectedinherited

◆ fDrawUnit

G4String G4VScoringMesh::fDrawUnit
protectedinherited

◆ fDrawUnitValue

G4double G4VScoringMesh::fDrawUnitValue
protectedinherited

◆ fGeometryHasBeenDestroyed

G4bool G4VScoringMesh::fGeometryHasBeenDestroyed
protectedinherited

◆ fMap

MeshScoreMap G4VScoringMesh::fMap
protectedinherited

◆ fMeshElementLogical

G4LogicalVolume* G4VScoringMesh::fMeshElementLogical
protectedinherited

◆ fMFD

G4MultiFunctionalDetector* G4VScoringMesh::fMFD
protectedinherited

◆ fNSegment

G4int G4VScoringMesh::fNSegment[3]
protectedinherited

◆ fParallelWorldProcess

G4ParallelWorldProcess* G4VScoringMesh::fParallelWorldProcess
protectedinherited

◆ fRotationMatrix

G4RotationMatrix* G4VScoringMesh::fRotationMatrix
protectedinherited

◆ fSegmentDirection

G4int G4ScoringBox::fSegmentDirection
private

Definition at line 70 of file G4ScoringBox.hh.

Referenced by SetSegmentDirection().

◆ fShape

MeshShape G4VScoringMesh::fShape
protectedinherited

◆ fSize

G4double G4VScoringMesh::fSize[3]
protectedinherited

◆ fWorldName

G4String G4VScoringMesh::fWorldName
protectedinherited

◆ layeredMassFlg

G4bool G4VScoringMesh::layeredMassFlg
protectedinherited

◆ nMeshIsSet

G4bool G4VScoringMesh::nMeshIsSet
protectedinherited

◆ sizeIsSet

G4bool G4VScoringMesh::sizeIsSet
protectedinherited

◆ verboseLevel

G4int G4VScoringMesh::verboseLevel
protectedinherited

The documentation for this class was generated from the following files: