Geant4 11.4.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 )

Streaming operator.

Definition at line 1270 of file G4SmartVoxelHeader.cc.

1271{
1272 os << "Axis = " << G4int(h.faxis) << G4endl;
1273 G4SmartVoxelProxy *collectNode=nullptr, *collectHead=nullptr;
1274 std::size_t collectNodeNo = 0;
1275 std::size_t collectHeadNo = 0;
1276 std::size_t i, j;
1277 G4bool haveHeaders = false;
1278
1279 for (i=0; i<h.fslices.size(); ++i)
1280 {
1281 os << "Slice #" << i << " = ";
1282 if (h.fslices[i]->IsNode())
1283 {
1284 if (h.fslices[i]!=collectNode)
1285 {
1286 os << "{";
1287 for (std::size_t k=0; k<h.fslices[i]->GetNode()->GetNoContained(); ++k)
1288 {
1289 os << " " << h.fslices[i]->GetNode()->GetVolume((G4int)k);
1290 }
1291 os << " }" << G4endl;
1292 collectNode = h.fslices[i];
1293 collectNodeNo = i;
1294 }
1295 else
1296 {
1297 os << "As slice #" << collectNodeNo << G4endl;
1298 }
1299 }
1300 else
1301 {
1302 haveHeaders=true;
1303 if (h.fslices[i] != collectHead)
1304 {
1305 os << "Header" << G4endl;
1306 collectHead = h.fslices[i];
1307 collectHeadNo = i;
1308 }
1309 else
1310 {
1311 os << "As slice #" << collectHeadNo << G4endl;
1312 }
1313 }
1314 }
1315
1316 if (haveHeaders)
1317 {
1318 collectHead=nullptr;
1319 for (j=0; j<h.fslices.size(); ++j)
1320 {
1321 if (h.fslices[j]->IsHeader())
1322 {
1323 os << "Header at Slice #" << j << " = ";
1324 if (h.fslices[j] != collectHead)
1325 {
1326 os << G4endl
1327 << (*(h.fslices[j]->GetHeader()));
1328 collectHead = h.fslices[j];
1329 collectHeadNo = j;
1330 }
1331 else
1332 {
1333 os << "As slice #" << collectHeadNo << G4endl;
1334 }
1335 }
1336 }
1337 }
1338 return os;
1339}
bool G4bool
Definition G4Types.hh:86
int G4int
Definition G4Types.hh:85
#define G4endl
Definition G4ios.hh:67
G4SmartVoxelProxy is a class for proxying smart voxels. The class represents either a header (in turn...