CbmRoot
Loading...
Searching...
No Matches
GeoVolume.cxx
Go to the documentation of this file.
1/* Copyright (C) 2025 GSI Helmholtzzentrum fuer Schwerionenforschung, Darmstadt
2 SPDX-License-Identifier: GPL-3.0-only
3 Authors: Sergei Zharko [committer] */
4
9
11
12#include <sstream>
13
15
16// ---------------------------------------------------------------------------------------------------------------------
17//
18GeoVolume::GeoVolume(double xMin, double xMax, double yMin, double yMax, double zMin, double zMax)
19 : fX(Dimension{xMin, xMax})
20 , fY(Dimension{yMin, yMax})
21 , fZ(Dimension{zMin, zMax})
22{
23}
24
25// ---------------------------------------------------------------------------------------------------------------------
26//
27GeoVolume::GeoVolume(std::pair<double, double> x, std::pair<double, double> y, std::pair<double, double> z)
28 : GeoVolume(x.first, x.second, y.first, y.second, z.first, z.second)
29{
30}
31
32// ---------------------------------------------------------------------------------------------------------------------
33//
35{
36 fX += other.fX;
37 fY += other.fY;
38 fZ += other.fZ;
39 return *this;
40}
41
42// ---------------------------------------------------------------------------------------------------------------------
43//
44bool GeoVolume::HasOverlapWith(const GeoVolume& other) const
45{
46 return fX.HasOverlapWith(other.fX) && fY.HasOverlapWith(other.fY) && fZ.HasOverlapWith(other.fZ);
47}
48
49// ---------------------------------------------------------------------------------------------------------------------
50//
51std::string GeoVolume::ToString() const
52{
53 std::stringstream msg;
54 msg << "zRef = " << fZ.Center() << "zMin = " << fZ.lo << ", zMax = " << fZ.up << ", xMin = " << fX.lo
55 << ", xMax = " << fX.up << ", yMin = " << fY.lo << ", yMax = " << fY.up;
56 return msg.str();
57}
A class for a geometrical volume representation in the reconstruction setup.
bool first
GeoVolume()=default
Default constructor.
A representation of a geometrical volume of different tracking stations.
Definition GeoVolume.h:25
bool HasOverlapWith(const GeoVolume &other) const
Checks, if the volume overlaps with another volume.
Definition GeoVolume.cxx:44
Dimension fX
x dimension
Definition GeoVolume.h:144
Dimension fZ
z dimension
Definition GeoVolume.h:146
Dimension fY
y dimension
Definition GeoVolume.h:145
GeoVolume & operator+=(const GeoVolume &other)
Compound assignment of another volume.
Definition GeoVolume.cxx:34
std::string ToString() const
String representation of the class.
Definition GeoVolume.cxx:51
GeoVolume()=default
Default constructor.
A volume dimension representation.
Definition GeoVolume.h:28