Geant4 10.7.0
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4SmartVoxelHeader.cc File Reference
#include "G4SmartVoxelHeader.hh"
#include "G4ios.hh"
#include "G4LogicalVolume.hh"
#include "G4VPhysicalVolume.hh"
#include "G4VoxelLimits.hh"
#include "voxeldefs.hh"
#include "G4AffineTransform.hh"
#include "G4VSolid.hh"
#include "G4VPVParameterisation.hh"

Go to the source code of this file.

Functions

std::ostream & operator<< (std::ostream &os, const G4SmartVoxelHeader &h)
 

Function Documentation

◆ operator<<()

std::ostream & operator<< ( std::ostream &  os,
const G4SmartVoxelHeader h 
)

Definition at line 1296 of file G4SmartVoxelHeader.cc.

1297{
1298 os << "Axis = " << G4int(h.faxis) << G4endl;
1299 G4SmartVoxelProxy *collectNode=nullptr, *collectHead=nullptr;
1300 G4int collectNodeNo = 0;
1301 G4int collectHeadNo = 0;
1302 size_t i, j;
1303 G4bool haveHeaders = false;
1304
1305 for (i=0; i<h.fslices.size(); ++i)
1306 {
1307 os << "Slice #" << i << " = ";
1308 if (h.fslices[i]->IsNode())
1309 {
1310 if (h.fslices[i]!=collectNode)
1311 {
1312 os << "{";
1313 for (size_t k=0; k<h.fslices[i]->GetNode()->GetNoContained(); ++k)
1314 {
1315 os << " " << h.fslices[i]->GetNode()->GetVolume(k);
1316 }
1317 os << " }" << G4endl;
1318 collectNode = h.fslices[i];
1319 collectNodeNo = i;
1320 }
1321 else
1322 {
1323 os << "As slice #" << collectNodeNo << G4endl;
1324 }
1325 }
1326 else
1327 {
1328 haveHeaders=true;
1329 if (h.fslices[i] != collectHead)
1330 {
1331 os << "Header" << G4endl;
1332 collectHead = h.fslices[i];
1333 collectHeadNo = i;
1334 }
1335 else
1336 {
1337 os << "As slice #" << collectHeadNo << G4endl;
1338 }
1339 }
1340 }
1341
1342 if (haveHeaders)
1343 {
1344 collectHead=0;
1345 for (j=0; j<h.fslices.size(); ++j)
1346 {
1347 if (h.fslices[j]->IsHeader())
1348 {
1349 os << "Header at Slice #" << j << " = ";
1350 if (h.fslices[j] != collectHead)
1351 {
1352 os << G4endl
1353 << (*(h.fslices[j]->GetHeader()));
1354 collectHead = h.fslices[j];
1355 collectHeadNo = j;
1356 }
1357 else
1358 {
1359 os << "As slice #" << collectHeadNo << G4endl;
1360 }
1361 }
1362 }
1363 }
1364 return os;
1365}
bool G4bool
Definition: G4Types.hh:86
int G4int
Definition: G4Types.hh:85
#define G4endl
Definition: G4ios.hh:57