61 G4cout <<
"G4ScoringCylinder::SetupGeometry() ..." <<
G4endl;
85 tubsName +
"0", worldLogical,
false, 0);
91 G4String layerName[2] = { tubsName +
"1", tubsName +
"2" };
98 layerSolid[0] =
new G4Tubs(layerName[0],
104 layerLogical[0] =
new G4LogicalVolume(layerSolid[0],
nullptr, layerName[0]);
108 G4cout <<
"G4ScoringCylinder::Construct() : Replicate along z direction"
113 G4cout <<
"G4ScoringCylinder::Construct() : Replica" <<
G4endl;
120 G4cout <<
"G4ScoringCylinder::Construct() : Division" <<
G4endl;
128 G4cout <<
"G4ScoringCylinder::Construct() : Placement" <<
G4endl;
130 layerName[0], tubsLogical,
false, 0);
134 G4cerr <<
"G4ScoringCylinder::SetupGeometry() : invalid parameter ("
136 <<
"in placement of the first nested layer." <<
G4endl;
145 layerLogical[1] =
new G4LogicalVolume(layerSolid[1],
nullptr, layerName[1]);
149 G4cout <<
"G4ScoringCylinder::Construct() : Replicate along phi direction"
154 G4cout <<
"G4ScoringCylinder::Construct() : Replica" <<
G4endl;
161 G4cout <<
"G4ScoringCylinder::Construct() : Division" <<
G4endl;
169 G4cout <<
"G4ScoringCylinder::Construct() : Placement" <<
G4endl;
171 layerName[1], layerLogical[0],
false, 0);
174 G4cerr <<
"ERROR : G4ScoringCylinder::SetupGeometry() : invalid parameter ("
176 <<
"in placement of the second nested layer." <<
G4endl;
181 G4String elementName = tubsName +
"3";
189 G4cout <<
"G4ScoringCylinder::Construct() : Replicate along r direction"
195 G4cout <<
"G4ScoringCylinder::Construct() : Replica" <<
G4endl;
203 G4cout <<
"G4ScoringCylinder::Construct() : Division" <<
G4endl;
210 G4cerr <<
"G4ScoringCylinder::SetupGeometry() : "
211 <<
"invalid parameter (" <<
fNSegment[IR] <<
") "
212 <<
"in mesh element placement." <<
G4endl;
220 visatt->SetVisibility(
true);
234 <<
" --- Shape: Cylindrical mesh" <<
G4endl;
236 G4cout <<
" Size (Rmin, Rmax, Dz): (" <<
fSize[0] / cm <<
", "
238 G4cout <<
" Angle (start, span): (" <<
fAngle[0] / deg <<
", "
248 if(pVisManager !=
nullptr)
251 std::vector<double> ephi;
252 for(
int phi = 0; phi <
fNSegment[IPHI]; phi++)
255 std::vector<std::vector<double>> zphicell;
257 zphicell.push_back(ephi);
259 std::vector<std::vector<double>> rphicell;
261 rphicell.push_back(ephi);
265 auto itr = map->
GetMap()->begin();
266 for(; itr != map->
GetMap()->end(); itr++)
275 zphicell[q[IZ]][q[IPHI]] += (itr->second->sum_wx()) /
fDrawUnitValue;
276 rphicell[q[IR]][q[IPHI]] += (itr->second->sum_wx()) /
fDrawUnitValue;
281 G4double zphimax = 0., rphimax = 0.;
282 for(
int iphi = 0; iphi <
fNSegment[IPHI]; iphi++)
284 for(
int iz = 0; iz <
fNSegment[IZ]; iz++)
286 if(zphimin > zphicell[iz][iphi])
287 zphimin = zphicell[iz][iphi];
288 if(zphimax < zphicell[iz][iphi])
289 zphimax = zphicell[iz][iphi];
291 for(
int ir = 0; ir <
fNSegment[IR]; ir++)
293 if(rphimin > rphicell[ir][iphi])
294 rphimin = rphicell[ir][iphi];
295 if(rphimax < rphicell[ir][iphi])
296 rphimax = rphicell[ir][iphi];
321 for(
int phi = 0; phi <
fNSegment[IPHI]; phi++)
332 angle, dphi * 0.99999);
354 pVisManager->
Draw(*poly);
371 for(
int phi = 0; phi <
fNSegment[IPHI]; phi++)
378 G4Tubs cylindern(
"z-phi", rs[0], rs[1], 0.001, angle, dphi * 0.99999);
379 G4Tubs cylinderp = cylindern;
405 pVisManager->
Draw(*polyn);
410 pVisManager->
Draw(*polyp);
440 if(idxColumn < 0 || idxColumn >=
fNSegment[projAxis])
442 G4cerr <<
"Warning : Column number " << idxColumn
443 <<
" is out of scoring mesh [0," <<
fNSegment[projAxis] - 1
444 <<
"]. Method ignored." <<
G4endl;
448 if(pVisManager !=
nullptr)
451 std::vector<std::vector<std::vector<double>>> cell;
452 std::vector<double> ephi;
453 for(
int phi = 0; phi <
fNSegment[IPHI]; phi++)
455 std::vector<std::vector<double>> ezphi;
457 ezphi.push_back(ephi);
459 cell.push_back(ezphi);
461 std::vector<std::vector<double>> rzcell;
462 std::vector<double> ez;
466 rzcell.push_back(ez);
468 std::vector<std::vector<double>> zphicell;
470 zphicell.push_back(ephi);
472 std::vector<std::vector<double>> rphicell;
474 rphicell.push_back(ephi);
478 auto itr = map->
GetMap()->begin();
479 for(; itr != map->
GetMap()->end(); itr++)
488 if(projAxis == IR && q[IR] == idxColumn)
490 zphicell[q[IZ]][q[IPHI]] += (itr->second->sum_wx()) /
fDrawUnitValue;
492 if(projAxis == IZ && q[IZ] == idxColumn)
494 rphicell[q[IR]][q[IPHI]] += (itr->second->sum_wx()) /
fDrawUnitValue;
496 if(projAxis == IPHI && q[IPHI] == idxColumn)
504 G4double rzmax = 0., zphimax = 0., rphimax = 0.;
507 for(
int phi = 0; phi <
fNSegment[IPHI]; phi++)
509 if(rphimin > rphicell[r][phi])
510 rphimin = rphicell[r][phi];
511 if(rphimax < rphicell[r][phi])
512 rphimax = rphicell[r][phi];
516 if(rzmin > rzcell[r][z])
517 rzmin = rzcell[r][z];
518 if(rzmax < rzcell[r][z])
519 rzmax = rzcell[r][z];
524 for(
int phi = 0; phi <
fNSegment[IPHI]; phi++)
526 if(zphimin > zphicell[z][phi])
527 zphimin = zphicell[z][phi];
528 if(zphimax < zphicell[z][phi])
529 zphimax = zphicell[z][phi];
553 for(
int phi = 0; phi <
fNSegment[IPHI]; phi++)
582 pVisManager->
Draw(*poly);
588 else if(projAxis == IZ)
596 for(
int phi = 0; phi <
fNSegment[IPHI]; phi++)
604 G4Tubs cylinder(
"r-phi", rs[0], rs[1], dz, angle, dphi * 0.99999);
625 pVisManager->
Draw(*poly);
631 else if(projAxis == IPHI)
669 pVisManager->
Draw(*poly);
691 q[j] = (index - q[i] * jk) /
fNSegment[k];
692 q[k] = index - q[j] *
fNSegment[k] - q[i] * jk;
703void G4ScoringCylinder::DumpVolumes()
711void G4ScoringCylinder::DumpSolids(
G4int lvl)
713 G4cout <<
"*********** List of registered solids *************" <<
G4endl;
715 auto itr = store->begin();
716 for(; itr != store->end(); itr++)
724 G4cout << (*itr)->GetName() <<
"\t volume = "
725 <<
G4BestUnit((*itr)->GetCubicVolume(),
"Volume")
736void G4ScoringCylinder::DumpLogVols(
G4int lvl)
738 G4cout <<
"*********** List of registered logical volumes *************"
741 auto itr = store->begin();
742 for(; itr != store->end(); itr++)
744 G4cout << (*itr)->GetName()
745 <<
"\t Solid = " << (*itr)->GetSolid()->GetName();
746 if((*itr)->GetMaterial() !=
nullptr)
748 G4cout <<
"\t Material = " << (*itr)->GetMaterial()->GetName() <<
G4endl;
757 if((*itr)->GetRegion() !=
nullptr)
759 G4cout << (*itr)->GetRegion()->GetName();
765 G4cout <<
"\t sensitive detector = ";
766 if((*itr)->GetSensitiveDetector() !=
nullptr)
768 G4cout << (*itr)->GetSensitiveDetector()->GetName();
775 G4cout <<
"\t daughters = " << (*itr)->GetNoDaughters();
776 if((*itr)->GetNoDaughters() > 0)
778 switch((*itr)->CharacteriseDaughters())
784 G4cout <<
" (replica : " << (*itr)->GetDaughter(0)->GetMultiplicity()
788 G4cout <<
" (parameterized : "
789 << (*itr)->GetDaughter(0)->GetMultiplicity() <<
")";
797 if((*itr)->GetMaterial() !=
nullptr)
809void G4ScoringCylinder::DumpPhysVols(
G4int lvl)
811 G4cout <<
"*********** List of registered physical volumes *************"
814 auto itr = store->begin();
815 for(; itr != store->end(); itr++)
823 G4cout << (*itr)->GetName() <<
"\t logical volume = "
824 << (*itr)->GetLogicalVolume()->GetName()
825 <<
"\t mother logical = ";
826 if((*itr)->GetMotherLogical() !=
nullptr)
828 G4cout << (*itr)->GetMotherLogical()->GetName();
837 G4cout << (*itr)->GetName() <<
"\t logical volume = "
838 << (*itr)->GetLogicalVolume()->GetName()
839 <<
"\t mother logical = ";
840 if((*itr)->GetMotherLogical() !=
nullptr)
842 G4cout << (*itr)->GetMotherLogical()->GetName();
849 switch((*itr)->VolumeType())
858 G4cout <<
"parameterized";
CLHEP::Hep3Vector G4ThreeVector
G4GLOB_DLL std::ostream G4cerr
G4GLOB_DLL std::ostream G4cout
virtual G4Polyhedron * GetPolyhedron() const
static G4LogicalVolumeStore * GetInstance()
void SetVisAttributes(const G4VisAttributes *pVA)
void SetSensitiveDetector(G4VSensitiveDetector *pSDetector)
static G4PhysicalVolumeStore * GetInstance()
void GetRZPhi(G4int index, G4int q[3]) const
void SetupGeometry(G4VPhysicalVolume *fWorldPhys) override
void Draw(RunScore *map, G4VScoreColorMap *colorMap, G4int axflg=111) override
void List() const override
G4ScoringCylinder(G4String wName)
void DrawColumn(RunScore *map, G4VScoreColorMap *colorMap, G4int idxProj, G4int idxColumn) override
static G4int GetReplicaLevel()
static G4SolidStore * GetInstance()
G4LogicalVolume * GetLogicalVolume() const
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
virtual void List() const
G4MultiFunctionalDetector * fMFD
G4String fDivisionAxisNames[3]
G4LogicalVolume * fMeshElementLogical
G4ThreeVector fCenterPosition
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 *)
HepPolyhedron & Transform(const G4Transform3D &t)