You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[SC] Adding possibility to use float for calculations (#6870)
* [SC] Adding possibility to use float for calculations
- setting default values for omega tau
- adding function to calculate the drift path for an electron
- adding simple debug function
- poisson solver: cleaning + using more than 1000 phi bins
* fixing function name getChargeCyl -> getDensityCyl
* fixing typo
* fixing error during compiling of macro
staticconstexprunsignedintFDIM = 3; ///< dimensions of the grid (only 3 supported)
141
-
staticconstexprunsignedintFZ = 0; ///< index for x coordinate
142
-
staticconstexprunsignedintFR = 1; ///< index for y coordinate
143
-
staticconstexprunsignedintFPHI = 2; ///< index for z coordinate
144
-
const Vector<DataT, FDIM> mMin{}; ///< min vertices positions of the grid
145
-
const Vector<DataT, FDIM> mMax{}; ///< max vertices positions of the grid
146
-
const Vector<DataT, FDIM> mSpacing{}; ///< spacing of the grid
147
-
const Vector<DataT, FDIM> mInvSpacing{}; ///< inverse spacing of grid
148
-
const Vector<DataT, FDIM> sMaxIndex{{static_cast<double>(mParamGrid.NZVertices - 1.), static_cast<double>(mParamGrid.NRVertices - 1), static_cast<double>(mParamGrid.NPhiVertices - 1)}}; ///< max index which is on the grid in all dimensions
149
-
const Vector<int, FDIM> sNdim{{static_cast<int>(mParamGrid.NZVertices), static_cast<int>(mParamGrid.NRVertices), static_cast<int>(mParamGrid.NPhiVertices)}}; ///< number of vertices for each dimension
150
-
std::vector<DataT> mZVertices{}; ///< positions of vertices in x direction
151
-
std::vector<DataT> mRVertices{}; ///< positions of vertices in y direction
152
-
std::vector<DataT> mPhiVertices{}; ///< positions of vertices in z direction
140
+
staticconstexprunsignedintFDIM = 3; ///< dimensions of the grid (only 3 supported)
141
+
staticconstexprunsignedintFZ = 0; ///< index for x coordinate
142
+
staticconstexprunsignedintFR = 1; ///< index for y coordinate
143
+
staticconstexprunsignedintFPHI = 2; ///< index for z coordinate
144
+
const Vector<DataT, FDIM> mMin{}; ///< min vertices positions of the grid
145
+
const Vector<DataT, FDIM> mMax{}; ///< max vertices positions of the grid
146
+
const Vector<DataT, FDIM> mSpacing{}; ///< spacing of the grid
147
+
const Vector<DataT, FDIM> mInvSpacing{}; ///< inverse spacing of grid
148
+
const Vector<DataT, FDIM> sMaxIndex{{static_cast<DataT>(mParamGrid.NZVertices - 1.), static_cast<DataT>(mParamGrid.NRVertices - 1), static_cast<DataT>(mParamGrid.NPhiVertices - 1)}}; ///< max index which is on the grid in all dimensions
149
+
const Vector<int, FDIM> sNdim{{static_cast<int>(mParamGrid.NZVertices), static_cast<int>(mParamGrid.NRVertices), static_cast<int>(mParamGrid.NPhiVertices)}}; ///< number of vertices for each dimension
150
+
std::vector<DataT> mZVertices{}; ///< positions of vertices in x direction
151
+
std::vector<DataT> mRVertices{}; ///< positions of vertices in y direction
152
+
std::vector<DataT> mPhiVertices{}; ///< positions of vertices in z direction
Copy file name to clipboardExpand all lines: Detectors/TPC/spacecharge/include/TPCSpaceCharge/SpaceCharge.h
+24-5Lines changed: 24 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -28,6 +28,7 @@
28
28
29
29
classTH3;
30
30
classTH3D;
31
+
classTH3F;
31
32
32
33
namespaceo2
33
34
{
@@ -50,11 +51,15 @@ class SpaceCharge
50
51
using DataContainer = DataContainer3D<DataT>;
51
52
using GridProp = GridProperties<DataT>;
52
53
using TriCubic = TriCubicInterpolator<DataT>;
54
+
using TH3DataT = std::conditional_t<std::is_same<DataT, double>::value, TH3D, TH3F>; // datatype for TH3 (TH3F for DataT==float and TH3D for DataT==double)
53
55
54
56
public:
55
57
/// default constructor
56
58
/// grid granularity has to set before constructing an object using the static function setGrid(nZVertices, nRVertices, nPhiVertices)!
/// helper function to set the loop over the sides for the tpc
365
+
/// \param sides set for which sides the distortions/corrections will be calculated. sides=0: A- and C-Side, sides=1: A-Side only, sides=2: C-Side only
366
+
intgetSideStart(constintsides)
367
+
{
368
+
if (sides==2) {
369
+
return1;
370
+
}
371
+
return0;
372
+
}
373
+
374
+
/// helper function to set the loop over the sides for the tpc
375
+
/// \param sides set for which sides the distortions/corrections will be calculated. sides=0: A- and C-Side, sides=1: A-Side only, sides=2: C-Side only
0 commit comments