Project
Loading...
Searching...
No Matches
o2::tpc::SpaceCharge< DataT > Class Template Reference

#include <SpaceCharge.h>

Public Types

enum class  IntegrationStrategy { Trapezoidal = 0 , Simpson = 1 , Root = 2 , SimpsonIterative = 3 }
 numerical integration strategys More...
 
enum class  Type { Distortions = 0 , Corrections = 1 }
 
enum class  GlobalDistType { Standard = 0 , Fast = 1 , None = 2 }
 
enum class  GlobalDistCorrMethod { LocalDistCorr , ElectricalField }
 
enum class  MisalignmentType { ShiftedClip , RotatedClip , RodShift }
 
enum class  FCType { IFC , OFC }
 

Public Member Functions

 SpaceCharge (const int bfield, const unsigned short nZVertices=129, const unsigned short nRVertices=129, const unsigned short nPhiVertices=360, const bool initBuffers=false)
 
 SpaceCharge ()
 constructor for empty object. Can be used when buffers are loaded from file
 
 SpaceCharge (SpaceCharge &&)=default
 default move constructor
 
SpaceChargeoperator= (SpaceCharge &&)=default
 move assignment
 
void fillChargeDensityFromHisto (const TH3 &hisSCDensity3D)
 
void fillChargeDensityFromHisto (const TH3 &hisSCDensity3D_A, const TH3 &hisSCDensity3D_C)
 
void fillChargeDensityFromHisto (const char *file, const char *nameA, const char *nameC)
 
void fillChargeDensityFromCalDet (const std::vector< CalDet< float > > &calSCDensity3D)
 
void fillChargeFromIDCs (std::vector< CalDet< float > > &idcZero, const CalDet< float > &mapIBF, const float ionDriftTimeMS=200, const bool normToPadArea=true)
 
void fillChargeFromCalDet (const std::vector< CalDet< float > > &calCharge3D)
 
void fillChargeDensityFromFile (TFile &fInp, const char *name)
 
void calculateDistortionsCorrections (const o2::tpc::Side side, const bool calcVectors=false)
 
void setChargeDensityFromFormula (const AnalyticalFields< DataT > &formulaStruct)
 
void setPotentialBoundaryFromFormula (const AnalyticalFields< DataT > &formulaStruct)
 
void addBoundaryPotential (const SpaceCharge< DataT > &other, const Side side, const float scaling=1)
 
void resetBoundaryPotentialToZeroInRangeZ (float zMin, float zMax, const Side side)
 setting the boundary potential to 0 for z<zMin and z>zMax
 
void setPotentialFromFormula (const AnalyticalFields< DataT > &formulaStruct)
 
void mirrorPotential (const Side sideRef, const Side sideMirrored)
 
void setSimOneSector ()
 
void setDefaultStaticDistortionsGEMFrameChargeUp (const Side side, const DataT deltaPotential=1000)
 
void setPotentialBoundaryGEMFrameAlongR (const std::function< DataT(DataT)> &potentialFunc, const Side side)
 
void setPotentialBoundaryGEMFrameIROCBottomAlongPhi (const std::function< DataT(DataT)> &potentialFunc, const Side side)
 
void setPotentialBoundaryGEMFrameIROCTopAlongPhi (const std::function< DataT(DataT)> &potentialFunc, const Side side)
 
void setPotentialBoundaryGEMFrameOROC1BottomAlongPhi (const std::function< DataT(DataT)> &potentialFunc, const Side side)
 
void setPotentialBoundaryGEMFrameOROC1TopAlongPhi (const std::function< DataT(DataT)> &potentialFunc, const Side side)
 
void setPotentialBoundaryGEMFrameOROC2BottomAlongPhi (const std::function< DataT(DataT)> &potentialFunc, const Side side)
 
void setPotentialBoundaryGEMFrameOROC2TopAlongPhi (const std::function< DataT(DataT)> &potentialFunc, const Side side)
 
void setPotentialBoundaryGEMFrameOROC3BottomAlongPhi (const std::function< DataT(DataT)> &potentialFunc, const Side side)
 
void setPotentialBoundaryGEMFrameOROC3TopAlongPhi (const std::function< DataT(DataT)> &potentialFunc, const Side side)
 
void setPotentialBoundaryGEMFrameOROC3ToOFCPhi (const std::function< DataT(DataT)> &potentialFunc, const Side side)
 
void setPotentialBoundaryGEMFrameIROCToIFCPhi (const std::function< DataT(DataT)> &potentialFunc, const Side side)
 setting the potential from the IROC to the inner field cage
 
void setPotentialBoundaryInnerRadius (const std::function< DataT(DataT)> &potentialFunc, const Side side)
 
void setPotentialBoundaryOuterRadius (const std::function< DataT(DataT)> &potentialFunc, const Side side)
 
void poissonSolver (const Side side, const DataT stoppingConvergence=1e-6, const int symmetry=0)
 
void poissonSolver (const DataT stoppingConvergence=1e-6, const int symmetry=0)
 
void calcEField (const Side side)
 
void setEFieldFromFormula (const AnalyticalFields< DataT > &formulaStruct)
 
void scaleChargeDensity (const DataT scalingFactor, const Side side)
 
void scaleChargeDensitySector (const float scalingFactor, const Sector sector)
 
void scaleChargeDensityStack (const float scalingFactor, const Sector sector, const GEMstack stack)
 scaling the space-charge density for given stack
 
void addChargeDensity (const SpaceCharge< DataT > &otherSC)
 
template<typename ElectricFields = AnalyticalFields<DataT>>
void calcLocalDistortionsCorrections (const Type type, const ElectricFields &formulaStruct)
 
template<typename ElectricFields = AnalyticalFields<DataT>>
void calcLocalDistortionCorrectionVector (const ElectricFields &formulaStruct)
 
template<typename ElectricFields = AnalyticalFields<DataT>>
void calcLocalDistortionsCorrectionsRK4 (const Type type, const Side side)
 
template<typename Fields = AnalyticalFields<DataT>>
void calcGlobalCorrections (const Fields &formulaStruct, const int type=3)
 
void calcGlobalCorrectionsEField (const Side side, const int type=3)
 calculate the global corrections using the electric fields (interface for python)
 
template<typename Fields = AnalyticalFields<DataT>>
void calcGlobalDistortions (const Fields &formulaStruct, const int maxIterations=3 *sSteps *129)
 
void init ()
 
void calcGlobalDistWithGlobalCorrIterative (const DistCorrInterpolator< DataT > &globCorr, const int maxIter=100, const DataT approachZ=1, const DataT approachR=1, const DataT approachPhi=1, const DataT diffCorr=50e-6, const SpaceCharge< DataT > *scSCale=nullptr, float scale=0)
 
void calcGlobalDistWithGlobalCorrIterative (const Side side, const SpaceCharge< DataT > *scSCale=nullptr, float scale=0, const int maxIter=100, const DataT approachZ=1, const DataT approachR=1, const DataT approachPhi=1, const DataT diffCorr=50e-6)
 
void calcGlobalDistWithGlobalCorrIterative (const SpaceCharge< DataT > *scSCale=nullptr, float scale=0, const int maxIter=100, const DataT approachZ=1, const DataT approachR=1, const DataT approachPhi=1, const DataT diffCorr=50e-6)
 
void calcGlobalCorrWithGlobalDistIterative (const Side side, const SpaceCharge< DataT > *scSCale=nullptr, float scale=0, const int maxIter=100, const DataT approachZ=1, const DataT approachR=1, const DataT approachPhi=1, const DataT diffCorr=50e-6)
 
void calcGlobalCorrWithGlobalDistIterative (const SpaceCharge< DataT > *scSCale=nullptr, float scale=0, const int maxIter=100, const DataT approachZ=1, const DataT approachR=1, const DataT approachPhi=1, const DataT diffCorr=50e-6)
 
void calcGlobalDistWithGlobalCorrIterativeLinearCartesian (const Side side, const SpaceCharge< DataT > *scSCale=nullptr, float scale=0, const int maxIter=100, const DataT approachX=1, const DataT approachY=1, const DataT approachZ=1, const DataT diffCorr=50e-6)
 
void calcGlobalDistWithGlobalCorrIterativeLinearCartesian (const SpaceCharge< DataT > *scSCale=nullptr, float scale=0, const int maxIter=100, const DataT approachX=1, const DataT approachY=1, const DataT approachZ=1, const DataT diffCorr=50e-6)
 
void calcGlobalCorrWithGlobalDistIterativeLinearCartesian (const Side side, const SpaceCharge< DataT > *scSCale=nullptr, float scale=0, const int maxIter=100, const DataT approachX=1, const DataT approachY=1, const DataT approachZ=1, const DataT diffCorr=50e-6)
 
void calcGlobalCorrWithGlobalDistIterativeLinearCartesian (const SpaceCharge< DataT > *scSCale=nullptr, float scale=0, const int maxIter=100, const DataT approachX=1, const DataT approachY=1, const DataT approachZ=1, const DataT diffCorr=50e-6)
 
unsigned short getNZVertices () const
 
unsigned short getNRVertices () const
 
unsigned short getNPhiVertices () const
 
auto getC0 () const
 
auto getC1 () const
 
auto getC2 () const
 
int getBField () const
 
const auto & getPotential (const Side side) const &
 
void setPotential (int iz, int ir, int iphi, Side side, float val)
 setting the potential directly for given vertex
 
DataT getDensityCyl (const DataT z, const DataT r, const DataT phi, const Side side) const
 
DataT getPotentialCyl (const DataT z, const DataT r, const DataT phi, const Side side) const
 
std::vector< float > getPotentialCyl (const std::vector< DataT > &z, const std::vector< DataT > &r, const std::vector< DataT > &phi, const Side side) const
 get the potential for list of given coordinate
 
void getElectricFieldsCyl (const DataT z, const DataT r, const DataT phi, const Side side, DataT &eZ, DataT &eR, DataT &ePhi) const
 
void getLocalCorrectionsCyl (const DataT z, const DataT r, const DataT phi, const Side side, DataT &lcorrZ, DataT &lcorrR, DataT &lcorrRPhi) const
 
void getLocalCorrectionsCyl (const std::vector< DataT > &z, const std::vector< DataT > &r, const std::vector< DataT > &phi, const Side side, std::vector< DataT > &lcorrZ, std::vector< DataT > &lcorrR, std::vector< DataT > &lcorrRPhi) const
 
void getCorrectionsCyl (const DataT z, const DataT r, const DataT phi, const Side side, DataT &corrZ, DataT &corrR, DataT &corrRPhi) const
 
void getCorrectionsCyl (const std::vector< DataT > &z, const std::vector< DataT > &r, const std::vector< DataT > &phi, const Side side, std::vector< DataT > &corrZ, std::vector< DataT > &corrR, std::vector< DataT > &corrRPhi) const
 
void getCorrections (const DataT x, const DataT y, const DataT z, const Side side, DataT &corrX, DataT &corrY, DataT &corrZ) const
 
void getCorrectionsAnalytical (const DataT x, const DataT y, const DataT z, const Side side, DataT &corrX, DataT &corrY, DataT &corrZ) const
 
void getLocalDistortionsCyl (const DataT z, const DataT r, const DataT phi, const Side side, DataT &ldistZ, DataT &ldistR, DataT &ldistRPhi) const
 
void getLocalDistortionsCyl (const std::vector< DataT > &z, const std::vector< DataT > &r, const std::vector< DataT > &phi, const Side side, std::vector< DataT > &ldistZ, std::vector< DataT > &ldistR, std::vector< DataT > &ldistRPhi) const
 
void getLocalDistortionVectorCyl (const DataT z, const DataT r, const DataT phi, const Side side, DataT &lvecdistZ, DataT &lvecdistR, DataT &lvecdistRPhi) const
 
void getLocalDistortionVectorCyl (const std::vector< DataT > &z, const std::vector< DataT > &r, const std::vector< DataT > &phi, const Side side, std::vector< DataT > &lvecdistZ, std::vector< DataT > &lvecdistR, std::vector< DataT > &lvecdistRPhi) const
 
void getLocalCorrectionVectorCyl (const DataT z, const DataT r, const DataT phi, const Side side, DataT &lveccorrZ, DataT &lveccorrR, DataT &lveccorrRPhi) const
 
void getLocalCorrectionVectorCyl (const std::vector< DataT > &z, const std::vector< DataT > &r, const std::vector< DataT > &phi, const Side side, std::vector< DataT > &lveccorrZ, std::vector< DataT > &lveccorrR, std::vector< DataT > &lveccorrRPhi) const
 
void getDistortionsCyl (const DataT z, const DataT r, const DataT phi, const Side side, DataT &distZ, DataT &distR, DataT &distRPhi) const
 
void getDistortionsCyl (const std::vector< DataT > &z, const std::vector< DataT > &r, const std::vector< DataT > &phi, const Side side, std::vector< DataT > &distZ, std::vector< DataT > &distR, std::vector< DataT > &distRPhi) const
 
void getDistortions (const DataT x, const DataT y, const DataT z, const Side side, DataT &distX, DataT &distY, DataT &distZ) const
 
void getDistortionsAnalytical (const DataT x, const DataT y, const DataT z, const Side side, DataT &distX, DataT &distY, DataT &distZ) const
 
void setDistortionsCorrectionsAnalytical (const AnalyticalDistCorr< DataT > &formula)
 set distortions and corrections by an analytical formula
 
const auto & getDistortionsCorrectionsAnalytical () const &
 
void setUseAnalyticalDistCorr (const bool useAna)
 setting usage of the analytical formula for the distortions and corrections
 
bool getUseAnalyticalDistCorr () const
 
void correctElectron (GlobalPosition3D &point)
 
void distortElectron (GlobalPosition3D &point, const SpaceCharge< DataT > *scSCale=nullptr, float scale=0) const
 
void setDistortionLookupTables (const DataContainer &distdZ, const DataContainer &distdR, const DataContainer &distdRPhi, const Side side)
 
void setFromFile (std::string_view file, const Side side)
 
void setFromFile (std::string_view file)
 
DataT getGridSpacingR (const Side side) const
 Get grid spacing in r direction.
 
DataT getGridSpacingZ (const Side side) const
 Get grid spacing in z direction.
 
DataT getGridSpacingPhi (const Side side) const
 Get grid spacing in phi direction.
 
DataT getRMin (const Side side) const
 Get inner radius of tpc.
 
DataT getZMin (const Side side) const
 Get min z position which is used during the calaculations.
 
DataT getPhiMin (const Side side) const
 Get min phi.
 
DataT getRMax (const Side side) const
 Get max r.
 
DataT getZMax (const Side side) const
 Get max z.
 
DataT getPhiMax (const Side side) const
 Get max phi.
 
const RegularGridgetGrid3D (const Side side) const
 Get the grid object.
 
NumericalFields< DataTgetElectricFieldsInterpolator (const Side side) const
 
DistCorrInterpolator< DataTgetLocalDistInterpolator (const Side side) const
 
DistCorrInterpolator< DataTgetLocalCorrInterpolator (const Side side) const
 
DistCorrInterpolator< DataTgetGlobalDistInterpolator (const Side side) const
 
DistCorrInterpolator< DataTgetGlobalCorrInterpolator (const Side side) const
 
DataT getLocalDistR (const size_t iz, const size_t ir, const size_t iphi, const Side side) const
 
DataT getLocalDistZ (const size_t iz, const size_t ir, const size_t iphi, const Side side) const
 
DataT getLocalDistRPhi (const size_t iz, const size_t ir, const size_t iphi, const Side side) const
 
DataT getLocalVecDistR (const size_t iz, const size_t ir, const size_t iphi, const Side side) const
 
DataT getLocalVecDistZ (const size_t iz, const size_t ir, const size_t iphi, const Side side) const
 
DataT getLocalVecDistRPhi (const size_t iz, const size_t ir, const size_t iphi, const Side side) const
 
DataT getLocalCorrR (const size_t iz, const size_t ir, const size_t iphi, const Side side) const
 
DataT getLocalCorrZ (const size_t iz, const size_t ir, const size_t iphi, const Side side) const
 
DataT getLocalCorrRPhi (const size_t iz, const size_t ir, const size_t iphi, const Side side) const
 
DataT getLocalVecCorrR (const size_t iz, const size_t ir, const size_t iphi, const Side side) const
 
DataT getLocalVecCorrZ (const size_t iz, const size_t ir, const size_t iphi, const Side side) const
 
DataT getLocalVecCorrRPhi (const size_t iz, const size_t ir, const size_t iphi, const Side side) const
 
DataT getGlobalDistR (const size_t iz, const size_t ir, const size_t iphi, const Side side) const
 
DataT getGlobalDistZ (const size_t iz, const size_t ir, const size_t iphi, const Side side) const
 
DataT getGlobalDistRPhi (const size_t iz, const size_t ir, const size_t iphi, const Side side) const
 
DataT getGlobalCorrR (const size_t iz, const size_t ir, const size_t iphi, const Side side) const
 
DataT getGlobalCorrZ (const size_t iz, const size_t ir, const size_t iphi, const Side side) const
 
DataT getGlobalCorrRPhi (const size_t iz, const size_t ir, const size_t iphi, const Side side) const
 
DataT getEr (const size_t iz, const size_t ir, const size_t iphi, const Side side) const
 
DataT getEz (const size_t iz, const size_t ir, const size_t iphi, const Side side) const
 
DataT getEphi (const size_t iz, const size_t ir, const size_t iphi, const Side side) const
 
DataT getDensity (const size_t iz, const size_t ir, const size_t iphi, const Side side) const
 
DataT getPotential (const size_t iz, const size_t ir, const size_t iphi, const Side side) const
 
DataT getPhiVertex (const size_t indexPhi, const Side side) const
 
DataT getRVertex (const size_t indexR, const Side side) const
 
DataT getZVertex (const size_t indexZ, const Side side) const
 
void setOmegaTauT1T2 (const DataT omegaTau=0.32f, const DataT t1=1, const DataT t2=1)
 
void setC0C1 (const DataT c0, const DataT c1)
 
void setC2 (const DataT c2)
 
void initBField (const int field)
 
void setSimExBMisalignment (const bool simExBMisalignment)
 enable/disable calculation of distortions due to ExB misalignment
 
bool getSimExBMisalignment () const
 
void setSimEDistortions (const bool simEDistortions)
 calculate distortions due to electric fields (space charge, boundary potential...)
 
bool getSimEDistortions () const
 
void setUseInitialSCDensity (const bool useInitialSCDensity)
 
void dumpToFile (std::string_view file, const Side side, std::string_view option) const
 
void dumpToFile (std::string_view file) const
 
void dumpMetaData (std::string_view file, std::string_view option, const bool overwriteExisting=false) const
 
void readMetaData (std::string_view file)
 
void dumpToTree (const char *outFileName, const Side side, const int nZPoints=50, const int nRPoints=150, const int nPhiPoints=180, const bool randomize=false) const
 
void dumpToTree (const char *outFileName, const o2::tpc::Sector &sector, const int nZPoints=50) const
 
int dumpElectricFields (std::string_view file, const Side side, std::string_view option) const
 
void setElectricFieldsFromFile (std::string_view file, const Side side)
 
int dumpPotential (std::string_view file, const Side side, std::string_view option) const
 
void setPotentialFromFile (std::string_view file, const Side side)
 
void fillPotential (const DataT potential, const size_t iz, const size_t ir, const size_t iphi, const Side side)
 
int dumpDensity (std::string_view file, const Side side, std::string_view option) const
 
void setDensityFromFile (std::string_view file, const Side side)
 
void fillDensity (const DataT density, const size_t iz, const size_t ir, const size_t iphi, const Side side)
 
void averageDensityPerSector (const Side side)
 average the sc density across all sectors per side
 
int dumpGlobalDistortions (std::string_view file, const Side side, std::string_view option) const
 
int dumpAnalyticalCorrectionsDistortions (TFile &outf) const
 
void setAnalyticalCorrectionsDistortionsFromFile (std::string_view inpf)
 
void setGlobalDistortionsFromFile (std::string_view file, const Side side)
 
template<typename DataTIn = DataT>
void setGlobalDistortionsFromFile (TFile &inpf, const Side side)
 
int dumpGlobalCorrections (std::string_view file, const Side side, std::string_view option) const
 
int dumpGlobalCorrections (TFile &outf, const Side side) const
 
void setGlobalCorrectionsFromFile (std::string_view file, const Side side)
 
template<typename DataTIn = DataT>
void setGlobalCorrectionsFromFile (TFile &inpf, const Side side)
 
int dumpLocalCorrections (std::string_view file, const Side side, std::string_view option) const
 
void setLocalCorrectionsFromFile (std::string_view file, const Side side)
 
int dumpLocalDistortions (std::string_view file, const Side side, std::string_view option) const
 
int dumpLocalDistCorrVectors (std::string_view file, const Side side, std::string_view option) const
 
void setLocalDistortionsFromFile (std::string_view file, const Side side)
 
void setLocalDistCorrVectorsFromFile (std::string_view file, const Side side)
 
DataT regulateZ (const DataT posZ, const Side side) const
 
DataT regulateR (const DataT posR, const Side side) const
 set r coordinate between 'RMIN - 4 * GRIDSPACINGR' and 'RMAX + 2 * GRIDSPACINGR'. the r coordinate is not clamped to RMIN and RMAX to ensure correct interpolation at the borders of the grid.
 
DataT regulatePhi (const DataT posPhi, const Side side) const
 set phi coordinate between min phi max phi
 
std::vector< std::pair< std::vector< o2::math_utils::Point3D< float > >, std::array< DataT, 3 > > > calculateElectronDriftPath (const std::vector< GlobalPosition3D > &elePos, const int nSamplingPoints, const std::string_view outFile="electron_tracks.root") const
 
bool checkGridFromFile (std::string_view file, std::string_view tree)
 
void setDeltaVoltageCopperRodShiftIFC (const float deltaPot, const Side side, const int sector)
 
void setDeltaVoltageCopperRodShiftOFC (const float deltaPot, const Side side, const int sector)
 
void setDeltaVoltageStripsShiftIFC (const float deltaPot, const Side side, const int sector)
 
void setDeltaVoltageStripsShiftOFC (const float deltaPot, const Side side, const int sector)
 
void setDeltaVoltageRotatedClipIFC (const float deltaPot, const Side side, const int sector)
 
void setDeltaVoltageRotatedClipOFC (const float deltaPot, const Side side, const int sector)
 
void setIFCChargeUpRisingPot (const float deltaPot, const float zMaxDeltaPot, const int type, const float zStart, const float offs, const Side side)
 
void setIFCChargeUpFallingPot (const float deltaPot, const float zMaxDeltaPot, const int type, const float zEnd, const float offs, const Side side)
 
void setGlobalCorrections (const std::function< void(int sector, DataT gx, DataT gy, DataT gz, DataT &gCx, DataT &gCy, DataT &gCz)> &gCorr, const Side side)
 
void setROCMisalignmentShiftZ (const int sector, const int type, const float potential)
 
void setROCMisalignmentRotationAlongX (const int sector, const int type, const float potentialMin, const float potentialMax)
 
void setROCMisalignmentRotationAlongY (const int sector, const int type, const float potentialMin, const float potentialMax)
 
void subtractGlobalCorrections (const SpaceCharge< DataT > &otherSC, const Side side)
 
void subtractGlobalDistortions (const SpaceCharge< DataT > &otherSC, const Side side)
 
void scaleCorrections (const float scaleFac, const Side side)
 
void setMetaData (const SCMetaData &meta)
 setting meta data for this object
 
const auto & getMetaData () const
 
void printMetaData () const
 
float getMeanLumi () const
 
void setMeanLumi (float lumi)
 
void initAfterReadingFromFile ()
 
float getDCAr (float tgl, const int nPoints, const float phi, o2::utils::TreeStreamRedirector *pcstream=nullptr) const
 
template<typename ElectricFields >
void calcLocalDistortionsCorrections (const SpaceCharge< DataT >::Type type, const ElectricFields &formulaStruct)
 
template<typename ElectricFields >
void calcLocalDistortionsCorrectionsRK4 (const SpaceCharge< DataT >::Type type, const Side side)
 
template<typename Formulas >
void calcGlobalCorrections (const Formulas &formulaStruct, const int type)
 

Static Public Member Functions

static void convertIDCsToCharge (std::vector< CalDet< float > > &idcZero, const CalDet< float > &mapIBF, const float ionDriftTimeMS=200, const bool normToPadArea=true)
 
static void unsetSimOneSector ()
 unsetting simulation of one sector
 
static DataT getRadiusFromCartesian (const DataT x, const DataT y)
 convert x and y coordinates from cartesian to the radius in polar coordinates
 
static DataT getPhiFromCartesian (const DataT x, const DataT y)
 convert x and y coordinates from cartesian to phi in polar coordinates
 
static DataT getXFromPolar (const DataT r, const DataT phi)
 convert radius and phi coordinates from polar coordinates to x cartesian coordinates
 
static DataT getYFromPolar (const DataT r, const DataT phi)
 convert radius and phi coordinates from polar coordinates to y cartesian coordinate
 
static constexpr DataT getEzField (const Side side)
 Get constant electric field.
 
static Side getSide (const DataT z)
 
static int getStepWidth ()
 Get the step width which is used for the calculation of the correction/distortions in units of the z-bin.
 
static void setNStep (const int nSteps)
 
static int getNStep ()
 
static int getNThreads ()
 get the number of threads used for some of the calculations
 
static void setNThreads (const int nThreads)
 set the number of threads used for some of the calculations
 
static void setNumericalIntegrationStrategy (const IntegrationStrategy strategy)
 
static IntegrationStrategy getNumericalIntegrationStrategy ()
 
static void setGlobalDistType (const GlobalDistType globalDistType)
 
static GlobalDistType getGlobalDistType ()
 
static void setGlobalDistCorrMethod (const GlobalDistCorrMethod globalDistCorrMethod)
 
static GlobalDistCorrMethod getGlobalDistCorrMethod ()
 
static void setSimpsonNIteratives (const int nIter)
 
static int getSimpsonNIteratives ()
 
static void setSCDistortionType (SCDistortionType distortionType)
 
static SCDistortionType getSCDistortionType ()
 Get the space-charge distortions model.
 
static void makeElectronDriftPathGif (const char *inpFile, TH2F &hBorder, const int type=0, const int gifSpeed=2, const int maxsamplingpoints=100, const char *outName="electron_drift_path")
 
static void normalizeHistoQVEps0 (TH3 &histoIonsPhiRZ)
 
static int getOMPMaxThreads ()
 

Detailed Description

template<typename DataT = double>
class o2::tpc::SpaceCharge< DataT >
Template Parameters
DataTthe data type which is used during the calculations
Nznumber of vertices in z direction
Nrnumber of vertices in r direction
Nphinumber of vertices in phi direction

this class provides the algorithms for calculating the global distortions and corrections from the space charge density. The calculations can be done by a realistic space charge histogram as an input or by an analytical formula. An example of of the usage can be found in 'macro/calculateDistortionsCorrections.C'

Definition at line 72 of file SpaceCharge.h.

Member Enumeration Documentation

◆ FCType

template<typename DataT = double>
enum class o2::tpc::SpaceCharge::FCType
strong
Enumerator
IFC 

inner field cage

OFC 

outer field cage

Definition at line 128 of file SpaceCharge.h.

◆ GlobalDistCorrMethod

template<typename DataT = double>
enum class o2::tpc::SpaceCharge::GlobalDistCorrMethod
strong
Enumerator
LocalDistCorr 

using local dis/corr interpolator for calculation of global distortions/corrections

ElectricalField 

using electric field for calculation of global distortions/corrections

Definition at line 117 of file SpaceCharge.h.

◆ GlobalDistType

template<typename DataT = double>
enum class o2::tpc::SpaceCharge::GlobalDistType
strong
Enumerator
Standard 

classical method (start calculation of global distortion at each voxel in the tpc and follow electron drift to readout -slow-)

Fast 

interpolation of global corrections (use the global corrections to apply an iterative approach to obtain the global distortions -fast-)

None 

dont calculate global distortions

Definition at line 111 of file SpaceCharge.h.

◆ IntegrationStrategy

template<typename DataT = double>
enum class o2::tpc::SpaceCharge::IntegrationStrategy
strong

numerical integration strategys

Enumerator
Trapezoidal 

trapezoidal integration (https://en.wikipedia.org/wiki/Trapezoidal_rule). straight electron drift line assumed: z0->z1, r0->r0, phi0->phi0

Simpson 

simpon integration. see: https://en.wikipedia.org/wiki/Simpson%27s_rule. straight electron drift line assumed: z0->z1, r0->r0, phi0->phi0

Root 

Root integration. straight electron drift line assumed: z0->z1, r0->r0, phi0->phi0.

SimpsonIterative 

simpon integration, but using an iterative method to approximate the drift path. No straight electron drift line assumed: z0->z1, r0->r1, phi0->phi1

Definition at line 100 of file SpaceCharge.h.

◆ MisalignmentType

template<typename DataT = double>
enum class o2::tpc::SpaceCharge::MisalignmentType
strong
Enumerator
ShiftedClip 

shifted copper rod clip

RotatedClip 

rotated mylar strips from FC

RodShift 

shifted copper rod

Definition at line 122 of file SpaceCharge.h.

◆ Type

template<typename DataT = double>
enum class o2::tpc::SpaceCharge::Type
strong
Enumerator
Distortions 

distortions

Corrections 

corrections

Definition at line 106 of file SpaceCharge.h.

Constructor & Destructor Documentation

◆ SpaceCharge() [1/3]

template<typename DataT >
SpaceCharge::SpaceCharge ( const int  bfield,
const unsigned short  nZVertices = 129,
const unsigned short  nRVertices = 129,
const unsigned short  nPhiVertices = 360,
const bool  initBuffers = false 
)

constructor grid granularity has to set before constructing an object using the static function setGrid(nZVertices, nRVertices, nPhiVertices)!

Parameters
bfieldmagnetic field (-5, -2, 0, 2, 5)
nZVerticesgrid vertices in z direction
nRVerticesgrid vertices in r direction
nPhiVerticesgrid vertices in phi direction
initBuffersinitialize all buffers

Definition at line 61 of file SpaceCharge.cxx.

◆ SpaceCharge() [2/3]

template<typename DataT >
SpaceCharge::SpaceCharge ( )

constructor for empty object. Can be used when buffers are loaded from file

Definition at line 71 of file SpaceCharge.cxx.

◆ SpaceCharge() [3/3]

template<typename DataT = double>
o2::tpc::SpaceCharge< DataT >::SpaceCharge ( SpaceCharge< DataT > &&  )
default

default move constructor

Member Function Documentation

◆ addBoundaryPotential()

template<typename DataT >
void SpaceCharge::addBoundaryPotential ( const SpaceCharge< DataT > &  other,
const Side  side,
const float  scaling = 1 
)

adding the boundary potential from other sc object which same number of vertices!

Parameters
otherother SC object which boundary potential witll be added
scalingsclaing factor which used to scale the others boundary potential

Definition at line 3584 of file SpaceCharge.cxx.

◆ addChargeDensity()

template<typename DataT >
void SpaceCharge::addChargeDensity ( const SpaceCharge< DataT > &  otherSC)

add space charge density from other object (this.mDensity = this.mDensity + other.mDensity)

Parameters
otherSCother space-charge object, which charge will be added to current object

Definition at line 3415 of file SpaceCharge.cxx.

◆ averageDensityPerSector()

template<typename DataT >
void SpaceCharge::averageDensityPerSector ( const Side  side)

average the sc density across all sectors per side

Definition at line 3907 of file SpaceCharge.cxx.

◆ calcEField()

template<typename DataT >
void SpaceCharge::calcEField ( const Side  side)

step 2: calculate numerically the electric field from the potential

Parameters
sideside of the TPC

Definition at line 610 of file SpaceCharge.cxx.

◆ calcGlobalCorrections() [1/2]

template<typename DataT = double>
template<typename Fields = AnalyticalFields<DataT>>
void o2::tpc::SpaceCharge< DataT >::calcGlobalCorrections ( const Fields &  formulaStruct,
const int  type = 3 
)

step 4: calculate global corrections by using the electric field or the local corrections

Parameters
formulaStructstruct containing a method to evaluate the electric field Er, Ez, Ephi or the local corrections
typehow to treat the corrections at regions where the corrected value is out of the TPC volume: type=0: use last valid correction value, type=1 do linear extrapolation, type=2 do parabolic extrapolation, type=3 do NOT abort when reaching the CE or the IFC to get a smooth estimate of the corrections

◆ calcGlobalCorrections() [2/2]

template<typename DataT = double>
template<typename Formulas >
void o2::tpc::SpaceCharge< DataT >::calcGlobalCorrections ( const Formulas &  formulaStruct,
const int  type 
)

Definition at line 1587 of file SpaceCharge.cxx.

◆ calcGlobalCorrectionsEField()

template<typename DataT = double>
void o2::tpc::SpaceCharge< DataT >::calcGlobalCorrectionsEField ( const Side  side,
const int  type = 3 
)
inline

calculate the global corrections using the electric fields (interface for python)

Definition at line 340 of file SpaceCharge.h.

◆ calcGlobalCorrWithGlobalDistIterative() [1/2]

template<typename DataT >
void SpaceCharge::calcGlobalCorrWithGlobalDistIterative ( const Side  side,
const SpaceCharge< DataT > *  scSCale = nullptr,
float  scale = 0,
const int  maxIter = 100,
const DataT  approachZ = 1,
const DataT  approachR = 1,
const DataT  approachPhi = 1,
const DataT  diffCorr = 50e-6 
)

calculate global corrections from global distortions

Parameters
scSCalepossible second sc object
scalescaling for second sc object

Definition at line 722 of file SpaceCharge.cxx.

◆ calcGlobalCorrWithGlobalDistIterative() [2/2]

template<typename DataT >
void SpaceCharge::calcGlobalCorrWithGlobalDistIterative ( const SpaceCharge< DataT > *  scSCale = nullptr,
float  scale = 0,
const int  maxIter = 100,
const DataT  approachZ = 1,
const DataT  approachR = 1,
const DataT  approachPhi = 1,
const DataT  diffCorr = 50e-6 
)

Definition at line 728 of file SpaceCharge.cxx.

◆ calcGlobalCorrWithGlobalDistIterativeLinearCartesian() [1/2]

template<typename DataT >
void SpaceCharge::calcGlobalCorrWithGlobalDistIterativeLinearCartesian ( const Side  side,
const SpaceCharge< DataT > *  scSCale = nullptr,
float  scale = 0,
const int  maxIter = 100,
const DataT  approachX = 1,
const DataT  approachY = 1,
const DataT  approachZ = 1,
const DataT  diffCorr = 50e-6 
)

Calculate global corrections using the global distortions by scaling with second distortion object, which will be consistent with scaled corrections in cartesian coordinates

Parameters
sideSide of the TPC
scSCalepossible second sc object
scalescaling for second sc object

Definition at line 878 of file SpaceCharge.cxx.

◆ calcGlobalCorrWithGlobalDistIterativeLinearCartesian() [2/2]

template<typename DataT >
void SpaceCharge::calcGlobalCorrWithGlobalDistIterativeLinearCartesian ( const SpaceCharge< DataT > *  scSCale = nullptr,
float  scale = 0,
const int  maxIter = 100,
const DataT  approachX = 1,
const DataT  approachY = 1,
const DataT  approachZ = 1,
const DataT  diffCorr = 50e-6 
)

Definition at line 884 of file SpaceCharge.cxx.

◆ calcGlobalDistortions()

template<typename DataT >
template<typename Fields >
void SpaceCharge::calcGlobalDistortions ( const Fields &  formulaStruct,
const int  maxIterations = 3 * sSteps * 129 
)

step 5: calculate global distortions by using the electric field or the local distortions (SLOW)

Parameters
formulaStructstruct containing a method to evaluate the electric field Er, Ez, Ephi or the local distortions
maxIterationsmaximum steps which are are performed to reach the central electrode (in general this is not necessary, but in case of problems this value aborts the calculation)

Definition at line 1503 of file SpaceCharge.cxx.

◆ calcGlobalDistWithGlobalCorrIterative() [1/3]

template<typename DataT >
void SpaceCharge::calcGlobalDistWithGlobalCorrIterative ( const DistCorrInterpolator< DataT > &  globCorr,
const int  maxIter = 100,
const DataT  approachZ = 1,
const DataT  approachR = 1,
const DataT  approachPhi = 1,
const DataT  diffCorr = 50e-6,
const SpaceCharge< DataT > *  scSCale = nullptr,
float  scale = 0 
)

step 5: calculate global distortions using the global corrections (FAST)

Parameters
globCorrinterpolator for global corrections
maxItermaximum iterations per global distortion
approachZwhen the difference between the desired z coordinate and the position of the global correction is deltaZ, approach the desired z coordinate by deltaZ * approachZ.
approachRwhen the difference between the desired r coordinate and the position of the global correction is deltaR, approach the desired r coordinate by deltaR * approachR.
approachPhiwhen the difference between the desired phi coordinate and the position of the global correction is deltaPhi, approach the desired phi coordinate by deltaPhi * approachPhi.
diffCorrif the absolute differences from the interpolated values for the global corrections from the last iteration compared to the current iteration is smaller than this value, set converged to true for current global distortion
typewhether to calculate distortions or corrections

Definition at line 700 of file SpaceCharge.cxx.

◆ calcGlobalDistWithGlobalCorrIterative() [2/3]

template<typename DataT >
void SpaceCharge::calcGlobalDistWithGlobalCorrIterative ( const Side  side,
const SpaceCharge< DataT > *  scSCale = nullptr,
float  scale = 0,
const int  maxIter = 100,
const DataT  approachZ = 1,
const DataT  approachR = 1,
const DataT  approachPhi = 1,
const DataT  diffCorr = 50e-6 
)

step 5: calculate global distortions using the global corrections (FAST)

Parameters
scSCalepossible second sc object
scalescaling for second sc object

Definition at line 706 of file SpaceCharge.cxx.

◆ calcGlobalDistWithGlobalCorrIterative() [3/3]

template<typename DataT >
void SpaceCharge::calcGlobalDistWithGlobalCorrIterative ( const SpaceCharge< DataT > *  scSCale = nullptr,
float  scale = 0,
const int  maxIter = 100,
const DataT  approachZ = 1,
const DataT  approachR = 1,
const DataT  approachPhi = 1,
const DataT  diffCorr = 50e-6 
)

Definition at line 712 of file SpaceCharge.cxx.

◆ calcGlobalDistWithGlobalCorrIterativeLinearCartesian() [1/2]

template<typename DataT >
void SpaceCharge::calcGlobalDistWithGlobalCorrIterativeLinearCartesian ( const Side  side,
const SpaceCharge< DataT > *  scSCale = nullptr,
float  scale = 0,
const int  maxIter = 100,
const DataT  approachX = 1,
const DataT  approachY = 1,
const DataT  approachZ = 1,
const DataT  diffCorr = 50e-6 
)

Calculate global distortions using the global corrections by scaling with second distortion object, which will be consistent with scaled corrections in cartesian coordinates (as done in the tracking)

Parameters
sideSide of the TPC
scSCalepossible second sc object
scalescaling for second sc object

Definition at line 862 of file SpaceCharge.cxx.

◆ calcGlobalDistWithGlobalCorrIterativeLinearCartesian() [2/2]

template<typename DataT >
void SpaceCharge::calcGlobalDistWithGlobalCorrIterativeLinearCartesian ( const SpaceCharge< DataT > *  scSCale = nullptr,
float  scale = 0,
const int  maxIter = 100,
const DataT  approachX = 1,
const DataT  approachY = 1,
const DataT  approachZ = 1,
const DataT  diffCorr = 50e-6 
)

Definition at line 868 of file SpaceCharge.cxx.

◆ calcLocalDistortionCorrectionVector()

template<typename DataT >
template<typename ElectricFields >
void SpaceCharge::calcLocalDistortionCorrectionVector ( const ElectricFields &  formulaStruct)

step 3b: calculate the local distortion and correction vectors with an electric field

Parameters
formulaStructstruct containing a method to evaluate the electric field Er, Ez, Ephi (analytical formula or by TriCubic interpolator)

Definition at line 1336 of file SpaceCharge.cxx.

◆ calcLocalDistortionsCorrections() [1/2]

template<typename DataT = double>
template<typename ElectricFields >
void o2::tpc::SpaceCharge< DataT >::calcLocalDistortionsCorrections ( const SpaceCharge< DataT >::Type  type,
const ElectricFields &  formulaStruct 
)

Definition at line 1252 of file SpaceCharge.cxx.

◆ calcLocalDistortionsCorrections() [2/2]

template<typename DataT = double>
template<typename ElectricFields = AnalyticalFields<DataT>>
void o2::tpc::SpaceCharge< DataT >::calcLocalDistortionsCorrections ( const Type  type,
const ElectricFields &  formulaStruct 
)

step 3: calculate the local distortions and corrections with an electric field

Parameters
typecalculate local corrections or local distortions: type = o2::tpc::SpaceCharge<>::Type::Distortions or o2::tpc::SpaceCharge<>::Type::Corrections
formulaStructstruct containing a method to evaluate the electric field Er, Ez, Ephi (analytical formula or by TriCubic interpolator)

◆ calcLocalDistortionsCorrectionsRK4() [1/2]

template<typename DataT = double>
template<typename ElectricFields >
void o2::tpc::SpaceCharge< DataT >::calcLocalDistortionsCorrectionsRK4 ( const SpaceCharge< DataT >::Type  type,
const Side  side 
)

Definition at line 1372 of file SpaceCharge.cxx.

◆ calcLocalDistortionsCorrectionsRK4() [2/2]

template<typename DataT = double>
template<typename ElectricFields = AnalyticalFields<DataT>>
void o2::tpc::SpaceCharge< DataT >::calcLocalDistortionsCorrectionsRK4 ( const Type  type,
const Side  side 
)

step 3b: calculate the local distortions and corrections with the local distortion/correction vectors using Runge Kutta 4. calcLocalDistortionCorrectionVector() has to be called before this function

Parameters
typecalculate local corrections or local distortions: type = o2::tpc::SpaceCharge<>::Type::Distortions or o2::tpc::SpaceCharge<>::Type::Corrections
sideside of the TPC

◆ calculateDistortionsCorrections()

template<typename DataT >
void SpaceCharge::calculateDistortionsCorrections ( const o2::tpc::Side  side,
const bool  calcVectors = false 
)
Parameters
sideside of the TPC
calcVectorsset to calculate also the local distortion and local correction vectors

Definition at line 111 of file SpaceCharge.cxx.

◆ calculateElectronDriftPath()

template<typename DataT >
std::vector< std::pair< std::vector< o2::math_utils::Point3D< float > >, std::array< DataT, 3 > > > SpaceCharge::calculateElectronDriftPath ( const std::vector< GlobalPosition3D > &  elePos,
const int  nSamplingPoints,
const std::string_view  outFile = "electron_tracks.root" 
) const

function to calculate the drift paths of the electron whose starting position is delivered. Electric fields must be set!

Parameters
elePosglobal position of the start position of the electron
nSamplingPointsnumber of output points of the electron drift path
outFilename of the output debug file (if empty no file is created)
Returns
returns the input electron a vector of 3D-points describing the drift path of the electron

Definition at line 2195 of file SpaceCharge.cxx.

◆ checkGridFromFile()

template<typename DataT >
bool SpaceCharge::checkGridFromFile ( std::string_view  file,
std::string_view  tree 
)

compare currently set grid with stored grid (in case the grid definition differs this instance will be newly initalizes with correct grid)

Returns
returns true if input could be loaded
Parameters
fileinput file
treetree in input file

Definition at line 3222 of file SpaceCharge.cxx.

◆ convertIDCsToCharge()

template<typename DataT >
void SpaceCharge::convertIDCsToCharge ( std::vector< CalDet< float > > &  idcZero,
const CalDet< float > &  mapIBF,
const float  ionDriftTimeMS = 200,
const bool  normToPadArea = true 
)
static

Convert the IDCs to the number of ions for the ion backflow (primary ionization is not considered)

Parameters
idcZeromap containing the IDCs values which will be converted to the space-charge density
mapIBFmap contains the pad-by-pad IBF in %
ionDriftTimeMSion drift time in ms
normToPadAreanormalize IDCs to pad area (should always be true as the normalization is performed in IDCFactorization::calcIDCZero

Definition at line 3472 of file SpaceCharge.cxx.

◆ correctElectron()

template<typename DataT >
void SpaceCharge::correctElectron ( GlobalPosition3D point)

Correct electron position using correction lookup tables

Parameters
point3D coordinates of the electron

Definition at line 1741 of file SpaceCharge.cxx.

◆ distortElectron()

template<typename DataT >
void SpaceCharge::distortElectron ( GlobalPosition3D point,
const SpaceCharge< DataT > *  scSCale = nullptr,
float  scale = 0 
) const

Distort electron position using distortion lookup tables

Parameters
point3D coordinates of the electron
scSCaleother sc object which is used for scaling of the distortions
scalescaling value

Definition at line 1756 of file SpaceCharge.cxx.

◆ dumpAnalyticalCorrectionsDistortions()

template<typename DataT >
int SpaceCharge::dumpAnalyticalCorrectionsDistortions ( TFile &  outf) const

write analytical corrections and distortions to file

Parameters
outfoutput file where the analytical corrections and distortions will be written to

Definition at line 2794 of file SpaceCharge.cxx.

◆ dumpDensity()

template<typename DataT >
int SpaceCharge::dumpDensity ( std::string_view  file,
const Side  side,
std::string_view  option 
) const

write density to root file using RDataFrame

Parameters
fileoutput file where the electrical fields will be written to
sideof the TPC
option"RECREATE" or "UPDATE"

Definition at line 3210 of file SpaceCharge.cxx.

◆ dumpElectricFields()

template<typename DataT >
int SpaceCharge::dumpElectricFields ( std::string_view  file,
const Side  side,
std::string_view  option 
) const

write electric fields to file using RDataFrame

Parameters
fileoutput file where the electrical fields will be written to
sideof the TPC
option"RECREATE" or "UPDATE"

Definition at line 2967 of file SpaceCharge.cxx.

◆ dumpGlobalCorrections() [1/2]

template<typename DataT >
int SpaceCharge::dumpGlobalCorrections ( std::string_view  file,
const Side  side,
std::string_view  option 
) const

write global correction to root file using RDataFrame

Parameters
fileoutput file where the electrical fields will be written to
sideof the TPC
option"RECREATE" or "UPDATE"

Definition at line 3044 of file SpaceCharge.cxx.

◆ dumpGlobalCorrections() [2/2]

template<typename DataT >
int SpaceCharge::dumpGlobalCorrections ( TFile &  outf,
const Side  side 
) const

write global corrections to root file (deprecated)

Parameters
outfoutput file where the global corrections will be written to
sideof the TPC

Definition at line 3254 of file SpaceCharge.cxx.

◆ dumpGlobalDistortions()

template<typename DataT >
int SpaceCharge::dumpGlobalDistortions ( std::string_view  file,
const Side  side,
std::string_view  option 
) const

write global distortions to root file using RDataFrame

Parameters
fileoutput file where the electrical fields will be written to
sideof the TPC
option"RECREATE" or "UPDATE"

Definition at line 2999 of file SpaceCharge.cxx.

◆ dumpLocalCorrections()

template<typename DataT >
int SpaceCharge::dumpLocalCorrections ( std::string_view  file,
const Side  side,
std::string_view  option 
) const

write local corrections to root file using RDataFrame

Parameters
fileoutput file where the electrical fields will be written to
sideof the TPC
option"RECREATE" or "UPDATE"

Definition at line 3090 of file SpaceCharge.cxx.

◆ dumpLocalDistCorrVectors()

template<typename DataT >
int SpaceCharge::dumpLocalDistCorrVectors ( std::string_view  file,
const Side  side,
std::string_view  option 
) const

write local corrections to root file using RDataFrame

Parameters
fileoutput file where the electrical fields will be written to
sideof the TPC
option"RECREATE" or "UPDATE"

Definition at line 3137 of file SpaceCharge.cxx.

◆ dumpLocalDistortions()

template<typename DataT >
int SpaceCharge::dumpLocalDistortions ( std::string_view  file,
const Side  side,
std::string_view  option 
) const

write local corrections to root file using RDataFrame

Parameters
fileoutput file where the electrical fields will be written to
sideof the TPC
option"RECREATE" or "UPDATE"

Definition at line 3122 of file SpaceCharge.cxx.

◆ dumpMetaData()

template<typename DataT >
void SpaceCharge::dumpMetaData ( std::string_view  file,
std::string_view  option,
const bool  overwriteExisting = false 
) const

dump meta data to file (mC0, mC1, mC2, RegularGrid)

Parameters
fileoutput file
option"RECREATE" or "UPDATE"
overwriteExistingoverwrite existing meta data in file

Definition at line 3292 of file SpaceCharge.cxx.

◆ dumpPotential()

template<typename DataT >
int SpaceCharge::dumpPotential ( std::string_view  file,
const Side  side,
std::string_view  option 
) const

write potential to root file using RDataFrame

Parameters
fileoutput file where the electrical fields will be written to
sideof the TPC
option"RECREATE" or "UPDATE"

Definition at line 3186 of file SpaceCharge.cxx.

◆ dumpToFile() [1/2]

template<typename DataT >
void SpaceCharge::dumpToFile ( std::string_view  file) const

write all fields etc to a file for both sides

Parameters
fileoutput file where the electrical fields will be written to

Definition at line 3285 of file SpaceCharge.cxx.

◆ dumpToFile() [2/2]

template<typename DataT >
void SpaceCharge::dumpToFile ( std::string_view  file,
const Side  side,
std::string_view  option 
) const

write all fields etc to a file

Parameters
fileoutput file where the electrical fields will be written to
sideof the TPC
option"RECREATE" or "UPDATE"

Definition at line 3268 of file SpaceCharge.cxx.

◆ dumpToTree() [1/2]

template<typename DataT >
void SpaceCharge::dumpToTree ( const char outFileName,
const o2::tpc::Sector sector,
const int  nZPoints = 50 
) const

dump to tree evaluated on the pads for given sector

Parameters
outFileNamename of the output file
sectorTPC sector for which the TTree is created
nZPointsnumber of points in z to consider

Definition at line 2653 of file SpaceCharge.cxx.

◆ dumpToTree() [2/2]

template<typename DataT >
void SpaceCharge::dumpToTree ( const char outFileName,
const Side  side,
const int  nZPoints = 50,
const int  nRPoints = 150,
const int  nPhiPoints = 180,
const bool  randomize = false 
) const

dump sc density, potential, electric fields, global distortions/corrections to tree

Parameters
outFileNamename of the output file
sideof the TPC
nZPointsnumber of vertices of the output in z
nRPointsnumber of vertices of the output in r
nPhiPointsnumber of vertices of the output in phi
randomizerandomize points

Adding other TTree as friend: TFile f1("file_1.root"); TTree* tree1 = (TTree*)f1.Get("tree"); tree1->BuildIndex("globalIndex")

TFile f2("file_2.root"); TTree* tree2 = (TTree*)f2.Get("tree"); tree2->BuildIndex("globalIndex"); tree1->AddFriend(tree2, "t2");

Definition at line 2422 of file SpaceCharge.cxx.

◆ fillChargeDensityFromCalDet()

template<typename DataT >
void SpaceCharge::fillChargeDensityFromCalDet ( const std::vector< CalDet< float > > &  calSCDensity3D)

step 0: set the space charge density from std::vector<CalDet> containing the space charge density. Each entry in the object corresponds to one z slice

Parameters
calSCDensity3Dpad-by-pad CalDet for the space charge density

Definition at line 1091 of file SpaceCharge.cxx.

◆ fillChargeDensityFromFile()

template<typename DataT >
void SpaceCharge::fillChargeDensityFromFile ( TFile &  fInp,
const char name 
)

step 0: set the charge density from TH3 histogram containing the space charge density

Parameters
fInpinput file containing a histogram for the space charge density
namethe name of the space charge density histogram in the file

Definition at line 1083 of file SpaceCharge.cxx.

◆ fillChargeDensityFromHisto() [1/3]

template<typename DataT >
void SpaceCharge::fillChargeDensityFromHisto ( const char file,
const char nameA,
const char nameC 
)

step 0: set the space-charge density from two TH3 histograms containing the space charge density for A and C side separately which are stored in a ROOT file

Parameters
filepath to root file containing the space-charge density
nameAname of the space-charge density histogram for the A-side
nameCname of the space-charge density histogram for the C-side

Definition at line 3428 of file SpaceCharge.cxx.

◆ fillChargeDensityFromHisto() [2/3]

template<typename DataT >
void SpaceCharge::fillChargeDensityFromHisto ( const TH3 &  hisSCDensity3D)

step 0: set the charge density from TH3 histogram containing the space charge density

Parameters
hisSCDensity3Dhistogram for the space charge density

Definition at line 1106 of file SpaceCharge.cxx.

◆ fillChargeDensityFromHisto() [3/3]

template<typename DataT >
void SpaceCharge::fillChargeDensityFromHisto ( const TH3 &  hisSCDensity3D_A,
const TH3 &  hisSCDensity3D_C 
)

step 0: set the space-charge density from two TH3 histograms containing the space-charge density for A and C side seperately

Parameters
hisSCDensity3D_Ahistogram for the space charge density for A-side
hisSCDensity3D_Chistogram for the space charge density for C-side

Definition at line 3443 of file SpaceCharge.cxx.

◆ fillChargeFromCalDet()

template<typename DataT >
void SpaceCharge::fillChargeFromCalDet ( const std::vector< CalDet< float > > &  calCharge3D)

step 0: set the charge (number of ions) from std::vector<CalDet> containing the charge. Each entry in the object corresponds to one z slice. Normalization to the space charge is also done automatically

Parameters
calCharge3Dhistogram for the charge

Definition at line 1098 of file SpaceCharge.cxx.

◆ fillChargeFromIDCs()

template<typename DataT >
void SpaceCharge::fillChargeFromIDCs ( std::vector< CalDet< float > > &  idcZero,
const CalDet< float > &  mapIBF,
const float  ionDriftTimeMS = 200,
const bool  normToPadArea = true 
)

Convert the IDCs to the number of ions for the ion backflow (primary ionization is not considered)

Parameters
idcZeromap containing the IDCs which will be converted to the space-charge density
mapIBFmap contains the pad-by-pad IBF in %
ionDriftTimeMSion drift time in ms
normToPadAreanormalize IDCs to pad area (should always be true as the normalization is performed in IDCFactorization::calcIDCZero

Definition at line 3522 of file SpaceCharge.cxx.

◆ fillDensity()

template<typename DataT = double>
void o2::tpc::SpaceCharge< DataT >::fillDensity ( const DataT  density,
const size_t  iz,
const size_t  ir,
const size_t  iphi,
const Side  side 
)
inline

set the space charge density directly

Parameters
densityspace charege density which will be set
izvertex in z dimension
irvertex in r dimension
iphivertex in phi dimension
sideof the TPC

Definition at line 1020 of file SpaceCharge.h.

◆ fillPotential()

template<typename DataT = double>
void o2::tpc::SpaceCharge< DataT >::fillPotential ( const DataT  potential,
const size_t  iz,
const size_t  ir,
const size_t  iphi,
const Side  side 
)
inline

set the potential directly

Parameters
potentialpotential which will be set
izvertex in z dimension
irvertex in r dimension
iphivertex in phi dimension
sideof the TPC

Definition at line 1001 of file SpaceCharge.h.

◆ getBField()

template<typename DataT = double>
int o2::tpc::SpaceCharge< DataT >::getBField ( ) const
inline
Returns
returns BField in kG

Definition at line 405 of file SpaceCharge.h.

◆ getC0()

template<typename DataT = double>
auto o2::tpc::SpaceCharge< DataT >::getC0 ( ) const
inline
Returns
returns parameter C0

Definition at line 396 of file SpaceCharge.h.

◆ getC1()

template<typename DataT = double>
auto o2::tpc::SpaceCharge< DataT >::getC1 ( ) const
inline
Returns
returns parameter C1

Definition at line 399 of file SpaceCharge.h.

◆ getC2()

template<typename DataT = double>
auto o2::tpc::SpaceCharge< DataT >::getC2 ( ) const
inline
Returns
returns parameter C2

Definition at line 402 of file SpaceCharge.h.

◆ getCorrections()

template<typename DataT >
void SpaceCharge::getCorrections ( const DataT  x,
const DataT  y,
const DataT  z,
const Side  side,
DataT corrX,
DataT corrY,
DataT corrZ 
) const

get the global corrections for given coordinate

Parameters
xglobal x coordinate
yglobal y coordinate
zglobal z coordinate
corrXreturns corrections in x direction
corrYreturns corrections in y direction
corrZreturns corrections in z direction

Definition at line 1881 of file SpaceCharge.cxx.

◆ getCorrectionsAnalytical()

template<typename DataT = double>
void o2::tpc::SpaceCharge< DataT >::getCorrectionsAnalytical ( const DataT  x,
const DataT  y,
const DataT  z,
const Side  side,
DataT corrX,
DataT corrY,
DataT corrZ 
) const
inline

get the analytical global corrections for given coordinate

Parameters
xglobal x coordinate
yglobal y coordinate
zglobal z coordinate
corrXreturns corrections in x direction
corrYreturns corrections in y direction
corrZreturns corrections in z direction

Definition at line 488 of file SpaceCharge.h.

◆ getCorrectionsCyl() [1/2]

template<typename DataT >
void SpaceCharge::getCorrectionsCyl ( const DataT  z,
const DataT  r,
const DataT  phi,
const Side  side,
DataT corrZ,
DataT corrR,
DataT corrRPhi 
) const

get the global correction for given coordinate

Parameters
zglobal z coordinate
rglobal r coordinate
phiglobal phi coordinate
corrZreturns correction in z direction
corrRreturns correction in r direction
corrRPhireturns correction in rphi direction

Definition at line 1860 of file SpaceCharge.cxx.

◆ getCorrectionsCyl() [2/2]

template<typename DataT >
void SpaceCharge::getCorrectionsCyl ( const std::vector< DataT > &  z,
const std::vector< DataT > &  r,
const std::vector< DataT > &  phi,
const Side  side,
std::vector< DataT > &  corrZ,
std::vector< DataT > &  corrR,
std::vector< DataT > &  corrRPhi 
) const

get the global correction for given coordinates

Parameters
zglobal z coordinates
rglobal r coordinates
phiglobal phi coordinates
corrZreturns corrections in z direction
corrRreturns corrections in r direction
corrRPhireturns corrections in rphi direction

Definition at line 1868 of file SpaceCharge.cxx.

◆ getDCAr()

template<typename DataT >
float SpaceCharge::getDCAr ( float  tgl,
const int  nPoints,
const float  phi,
o2::utils::TreeStreamRedirector pcstream = nullptr 
) const

get DCA in RPhi for high pt track

Parameters
tgltgl of the track
nPointsnumber of points used to calculate the DCAr
pcstreamif provided debug output is being created

Definition at line 3985 of file SpaceCharge.cxx.

◆ getDensity()

template<typename DataT = double>
DataT o2::tpc::SpaceCharge< DataT >::getDensity ( const size_t  iz,
const size_t  ir,
const size_t  iphi,
const Side  side 
) const
inline

Get density for vertex

Parameters
izvertex in z dimension
irvertex in r dimension
iphivertex in phi dimension
sideside of the TPC

Definition at line 838 of file SpaceCharge.h.

◆ getDensityCyl()

template<typename DataT >
DataT SpaceCharge::getDensityCyl ( const DataT  z,
const DataT  r,
const DataT  phi,
const Side  side 
) const

get the space charge density for given coordinate

Parameters
zglobal z coordinate
rglobal r coordinate
phiglobal phi coordinate

Definition at line 1807 of file SpaceCharge.cxx.

◆ getDistortions()

template<typename DataT >
void SpaceCharge::getDistortions ( const DataT  x,
const DataT  y,
const DataT  z,
const Side  side,
DataT distX,
DataT distY,
DataT distZ 
) const

get the global distortions for given coordinate

Parameters
xglobal x coordinate
yglobal y coordinate
zglobal z coordinate
distXreturns distortion in x direction
distYreturns distortion in y direction
distZreturns distortion in z direction

Definition at line 1988 of file SpaceCharge.cxx.

◆ getDistortionsAnalytical()

template<typename DataT = double>
void o2::tpc::SpaceCharge< DataT >::getDistortionsAnalytical ( const DataT  x,
const DataT  y,
const DataT  z,
const Side  side,
DataT distX,
DataT distY,
DataT distZ 
) const
inline

get the global distortions for given coordinate for a possible analytical formula if it was specified

Parameters
xglobal x coordinate
yglobal y coordinate
zglobal z coordinate
distXreturns distortion in x direction
distYreturns distortion in y direction
distZreturns distortion in z direction

Definition at line 578 of file SpaceCharge.h.

◆ getDistortionsCorrectionsAnalytical()

template<typename DataT = double>
const auto & o2::tpc::SpaceCharge< DataT >::getDistortionsCorrectionsAnalytical ( ) const &
inline
Returns
returns analytical distortions/corrections

Definition at line 584 of file SpaceCharge.h.

◆ getDistortionsCyl() [1/2]

template<typename DataT >
void SpaceCharge::getDistortionsCyl ( const DataT  z,
const DataT  r,
const DataT  phi,
const Side  side,
DataT distZ,
DataT distR,
DataT distRPhi 
) const

get the global distortions for given coordinate

Parameters
zglobal z coordinate
rglobal r coordinate
phiglobal phi coordinate
distZreturns distortion in z direction
distRreturns distortion in r direction
distRPhireturns distortion in rphi direction

Definition at line 1967 of file SpaceCharge.cxx.

◆ getDistortionsCyl() [2/2]

template<typename DataT >
void SpaceCharge::getDistortionsCyl ( const std::vector< DataT > &  z,
const std::vector< DataT > &  r,
const std::vector< DataT > &  phi,
const Side  side,
std::vector< DataT > &  distZ,
std::vector< DataT > &  distR,
std::vector< DataT > &  distRPhi 
) const

get the global distortions for given coordinate

Parameters
zglobal z coordinates
rglobal r coordinates
phiglobal phi coordinates
distZreturns distortions in z direction
distRreturns distortions in r direction
distRPhireturns distortions in rphi direction

Definition at line 1975 of file SpaceCharge.cxx.

◆ getElectricFieldsCyl()

template<typename DataT >
void SpaceCharge::getElectricFieldsCyl ( const DataT  z,
const DataT  r,
const DataT  phi,
const Side  side,
DataT eZ,
DataT eR,
DataT ePhi 
) const

get the electric field for given coordinate

Parameters
zglobal z coordinate
rglobal r coordinate
phiglobal phi coordinate
eZreturns correction in z direction
eRreturns correction in r direction
ePhireturns correction in phi direction

Definition at line 1831 of file SpaceCharge.cxx.

◆ getElectricFieldsInterpolator()

template<typename DataT >
NumericalFields< DataT > SpaceCharge::getElectricFieldsInterpolator ( const Side  side) const

Get struct containing interpolators for the electrical fields

Parameters
sideside of the TPC

Definition at line 1033 of file SpaceCharge.cxx.

◆ getEphi()

template<typename DataT = double>
DataT o2::tpc::SpaceCharge< DataT >::getEphi ( const size_t  iz,
const size_t  ir,
const size_t  iphi,
const Side  side 
) const
inline

Get global electric Field Ephi for vertex

Parameters
izvertex in z dimension
irvertex in r dimension
iphivertex in phi dimension
sideside of the TPC

Definition at line 831 of file SpaceCharge.h.

◆ getEr()

template<typename DataT = double>
DataT o2::tpc::SpaceCharge< DataT >::getEr ( const size_t  iz,
const size_t  ir,
const size_t  iphi,
const Side  side 
) const
inline

Get global electric Field Er for vertex

Parameters
izvertex in z dimension
irvertex in r dimension
iphivertex in phi dimension
sideside of the TPC

Definition at line 817 of file SpaceCharge.h.

◆ getEz()

template<typename DataT = double>
DataT o2::tpc::SpaceCharge< DataT >::getEz ( const size_t  iz,
const size_t  ir,
const size_t  iphi,
const Side  side 
) const
inline

Get global electric Field Ez for vertex

Parameters
izvertex in z dimension
irvertex in r dimension
iphivertex in phi dimension
sideside of the TPC

Definition at line 824 of file SpaceCharge.h.

◆ getEzField()

template<typename DataT = double>
static constexpr DataT o2::tpc::SpaceCharge< DataT >::getEzField ( const Side  side)
inlinestaticconstexpr

Get constant electric field.

Definition at line 640 of file SpaceCharge.h.

◆ getGlobalCorrInterpolator()

template<typename DataT >
DistCorrInterpolator< DataT > SpaceCharge::getGlobalCorrInterpolator ( const Side  side) const

Get struct containing interpolators for global corrections dR, dZ, dPhi

Parameters
sideside of the TPC

Definition at line 1073 of file SpaceCharge.cxx.

◆ getGlobalCorrR()

template<typename DataT = double>
DataT o2::tpc::SpaceCharge< DataT >::getGlobalCorrR ( const size_t  iz,
const size_t  ir,
const size_t  iphi,
const Side  side 
) const
inline

Get global correction dR for vertex

Parameters
izvertex in z dimension
irvertex in r dimension
iphivertex in phi dimension
sideside of the TPC

Definition at line 796 of file SpaceCharge.h.

◆ getGlobalCorrRPhi()

template<typename DataT = double>
DataT o2::tpc::SpaceCharge< DataT >::getGlobalCorrRPhi ( const size_t  iz,
const size_t  ir,
const size_t  iphi,
const Side  side 
) const
inline

Get global correction dRPhi for vertex

Parameters
izvertex in z dimension
irvertex in r dimension
iphivertex in phi dimension
sideside of the TPC

Definition at line 810 of file SpaceCharge.h.

◆ getGlobalCorrZ()

template<typename DataT = double>
DataT o2::tpc::SpaceCharge< DataT >::getGlobalCorrZ ( const size_t  iz,
const size_t  ir,
const size_t  iphi,
const Side  side 
) const
inline

Get global correction dZ for vertex

Parameters
izvertex in z dimension
irvertex in r dimension
iphivertex in phi dimension
sideside of the TPC

Definition at line 803 of file SpaceCharge.h.

◆ getGlobalDistCorrMethod()

template<typename DataT = double>
static GlobalDistCorrMethod o2::tpc::SpaceCharge< DataT >::getGlobalDistCorrMethod ( )
inlinestatic

Definition at line 915 of file SpaceCharge.h.

◆ getGlobalDistInterpolator()

template<typename DataT >
DistCorrInterpolator< DataT > SpaceCharge::getGlobalDistInterpolator ( const Side  side) const

Get struct containing interpolators for global distortions dR, dZ, dPhi

Parameters
sideside of the TPC

Definition at line 1063 of file SpaceCharge.cxx.

◆ getGlobalDistR()

template<typename DataT = double>
DataT o2::tpc::SpaceCharge< DataT >::getGlobalDistR ( const size_t  iz,
const size_t  ir,
const size_t  iphi,
const Side  side 
) const
inline

Get global distortion dR for vertex

Parameters
izvertex in z dimension
irvertex in r dimension
iphivertex in phi dimension
sideside of the TPC

Definition at line 775 of file SpaceCharge.h.

◆ getGlobalDistRPhi()

template<typename DataT = double>
DataT o2::tpc::SpaceCharge< DataT >::getGlobalDistRPhi ( const size_t  iz,
const size_t  ir,
const size_t  iphi,
const Side  side 
) const
inline

Get global distortion dRPhi for vertex

Parameters
izvertex in z dimension
irvertex in r dimension
iphivertex in phi dimension
sideside of the TPC

Definition at line 789 of file SpaceCharge.h.

◆ getGlobalDistType()

template<typename DataT = double>
static GlobalDistType o2::tpc::SpaceCharge< DataT >::getGlobalDistType ( )
inlinestatic

Definition at line 912 of file SpaceCharge.h.

◆ getGlobalDistZ()

template<typename DataT = double>
DataT o2::tpc::SpaceCharge< DataT >::getGlobalDistZ ( const size_t  iz,
const size_t  ir,
const size_t  iphi,
const Side  side 
) const
inline

Get global distortion dZ for vertex

Parameters
izvertex in z dimension
irvertex in r dimension
iphivertex in phi dimension
sideside of the TPC

Definition at line 782 of file SpaceCharge.h.

◆ getGrid3D()

template<typename DataT = double>
const RegularGrid & o2::tpc::SpaceCharge< DataT >::getGrid3D ( const Side  side) const
inline

Get the grid object.

Definition at line 664 of file SpaceCharge.h.

◆ getGridSpacingPhi()

template<typename DataT = double>
DataT o2::tpc::SpaceCharge< DataT >::getGridSpacingPhi ( const Side  side) const
inline

Get grid spacing in phi direction.

Definition at line 637 of file SpaceCharge.h.

◆ getGridSpacingR()

template<typename DataT = double>
DataT o2::tpc::SpaceCharge< DataT >::getGridSpacingR ( const Side  side) const
inline

Get grid spacing in r direction.

Definition at line 631 of file SpaceCharge.h.

◆ getGridSpacingZ()

template<typename DataT = double>
DataT o2::tpc::SpaceCharge< DataT >::getGridSpacingZ ( const Side  side) const
inline

Get grid spacing in z direction.

Definition at line 634 of file SpaceCharge.h.

◆ getLocalCorrectionsCyl() [1/2]

template<typename DataT >
void SpaceCharge::getLocalCorrectionsCyl ( const DataT  z,
const DataT  r,
const DataT  phi,
const Side  side,
DataT lcorrZ,
DataT lcorrR,
DataT lcorrRPhi 
) const

get the local correction for given coordinate

Parameters
zglobal z coordinate
rglobal r coordinate
phiglobal phi coordinate
lcorrZreturns local correction in z direction
lcorrRreturns local correction in r direction
lcorrRPhireturns local correction in rphi direction

Definition at line 1839 of file SpaceCharge.cxx.

◆ getLocalCorrectionsCyl() [2/2]

template<typename DataT >
void SpaceCharge::getLocalCorrectionsCyl ( const std::vector< DataT > &  z,
const std::vector< DataT > &  r,
const std::vector< DataT > &  phi,
const Side  side,
std::vector< DataT > &  lcorrZ,
std::vector< DataT > &  lcorrR,
std::vector< DataT > &  lcorrRPhi 
) const

get the local correction for given coordinates

Parameters
zglobal z coordinates
rglobal r coordinates
phiglobal phi coordinates
lcorrZreturns local corrections in z direction
lcorrRreturns local corrections in r direction
lcorrRPhireturns local corrections in rphi direction

Definition at line 1847 of file SpaceCharge.cxx.

◆ getLocalCorrectionVectorCyl() [1/2]

template<typename DataT >
void SpaceCharge::getLocalCorrectionVectorCyl ( const DataT  z,
const DataT  r,
const DataT  phi,
const Side  side,
DataT lveccorrZ,
DataT lveccorrR,
DataT lveccorrRPhi 
) const

get the local correction vector for given coordinate

Parameters
zglobal z coordinate
rglobal r coordinate
phiglobal phi coordinate
ldistZreturns local correction vector in z direction
ldistRreturns local correction vector in r direction
ldistRPhireturns local correction vector in rphi direction

Definition at line 1946 of file SpaceCharge.cxx.

◆ getLocalCorrectionVectorCyl() [2/2]

template<typename DataT >
void SpaceCharge::getLocalCorrectionVectorCyl ( const std::vector< DataT > &  z,
const std::vector< DataT > &  r,
const std::vector< DataT > &  phi,
const Side  side,
std::vector< DataT > &  lveccorrZ,
std::vector< DataT > &  lveccorrR,
std::vector< DataT > &  lveccorrRPhi 
) const

get the local correction vector for given coordinate

Parameters
zglobal z coordinates
rglobal r coordinates
phiglobal phi coordinates
ldistZreturns local correction vectors in z direction
ldistRreturns local correction vectors in r direction
ldistRPhireturns local correction vectors in rphi direction

Definition at line 1954 of file SpaceCharge.cxx.

◆ getLocalCorrInterpolator()

template<typename DataT >
DistCorrInterpolator< DataT > SpaceCharge::getLocalCorrInterpolator ( const Side  side) const

Get struct containing interpolators for local corrections dR, dZ, dPhi

Parameters
sideside of the TPC

Definition at line 1053 of file SpaceCharge.cxx.

◆ getLocalCorrR()

template<typename DataT = double>
DataT o2::tpc::SpaceCharge< DataT >::getLocalCorrR ( const size_t  iz,
const size_t  ir,
const size_t  iphi,
const Side  side 
) const
inline
Parameters
izvertex in z dimension
irvertex in r dimension
iphivertex in phi dimension
sideside of the TPC
Returns
returns local correction dR for given vertex

Definition at line 733 of file SpaceCharge.h.

◆ getLocalCorrRPhi()

template<typename DataT = double>
DataT o2::tpc::SpaceCharge< DataT >::getLocalCorrRPhi ( const size_t  iz,
const size_t  ir,
const size_t  iphi,
const Side  side 
) const
inline
Parameters
izvertex in z dimension
irvertex in r dimension
iphivertex in phi dimension
sideside of the TPC
Returns
returns local correction dRPhi for given vertex

Definition at line 747 of file SpaceCharge.h.

◆ getLocalCorrZ()

template<typename DataT = double>
DataT o2::tpc::SpaceCharge< DataT >::getLocalCorrZ ( const size_t  iz,
const size_t  ir,
const size_t  iphi,
const Side  side 
) const
inline
Parameters
izvertex in z dimension
irvertex in r dimension
iphivertex in phi dimension
sideside of the TPC
Returns
returns local correction dZ for given vertex

Definition at line 740 of file SpaceCharge.h.

◆ getLocalDistInterpolator()

template<typename DataT >
DistCorrInterpolator< DataT > SpaceCharge::getLocalDistInterpolator ( const Side  side) const

Get struct containing interpolators for local distortions dR, dZ, dPhi

Parameters
sideside of the TPC

Definition at line 1043 of file SpaceCharge.cxx.

◆ getLocalDistortionsCyl() [1/2]

template<typename DataT >
void SpaceCharge::getLocalDistortionsCyl ( const DataT  z,
const DataT  r,
const DataT  phi,
const Side  side,
DataT ldistZ,
DataT ldistR,
DataT ldistRPhi 
) const

get the local distortions for given coordinate

Parameters
zglobal z coordinate
rglobal r coordinate
phiglobal phi coordinate
ldistZreturns local distortion in z direction
ldistRreturns local distortion in r direction
ldistRPhireturns local distortion in rphi direction

Definition at line 1904 of file SpaceCharge.cxx.

◆ getLocalDistortionsCyl() [2/2]

template<typename DataT >
void SpaceCharge::getLocalDistortionsCyl ( const std::vector< DataT > &  z,
const std::vector< DataT > &  r,
const std::vector< DataT > &  phi,
const Side  side,
std::vector< DataT > &  ldistZ,
std::vector< DataT > &  ldistR,
std::vector< DataT > &  ldistRPhi 
) const

get the local distortions for given coordinates

Parameters
zglobal z coordinates
rglobal r coordinates
phiglobal phi coordinates
ldistZreturns local distortions in z direction
ldistRreturns local distortions in r direction
ldistRPhireturns local distortions in rphi direction

Definition at line 1912 of file SpaceCharge.cxx.

◆ getLocalDistortionVectorCyl() [1/2]

template<typename DataT >
void SpaceCharge::getLocalDistortionVectorCyl ( const DataT  z,
const DataT  r,
const DataT  phi,
const Side  side,
DataT lvecdistZ,
DataT lvecdistR,
DataT lvecdistRPhi 
) const

get the local distortion vector for given coordinates

Parameters
zglobal z coordinate
rglobal r coordinate
phiglobal phi coordinate
lvecdistZreturns local distortion vector in z direction
lvecdistRreturns local distortion vector in r direction
lvecdistRPhireturns local distortion vector in rphi direction

Definition at line 1925 of file SpaceCharge.cxx.

◆ getLocalDistortionVectorCyl() [2/2]

template<typename DataT >
void SpaceCharge::getLocalDistortionVectorCyl ( const std::vector< DataT > &  z,
const std::vector< DataT > &  r,
const std::vector< DataT > &  phi,
const Side  side,
std::vector< DataT > &  lvecdistZ,
std::vector< DataT > &  lvecdistR,
std::vector< DataT > &  lvecdistRPhi 
) const

get the local distortion vector for given coordinate

Parameters
zglobal z coordinates
rglobal r coordinates
phiglobal phi coordinates
lvecdistZreturns local distortion vectors in z direction
lvecdistRreturns local distortion vectors in r direction
lvecdistRPhireturns local distortion vectors in rphi direction

Definition at line 1933 of file SpaceCharge.cxx.

◆ getLocalDistR()

template<typename DataT = double>
DataT o2::tpc::SpaceCharge< DataT >::getLocalDistR ( const size_t  iz,
const size_t  ir,
const size_t  iphi,
const Side  side 
) const
inline
Parameters
izvertex in z dimension
irvertex in r dimension
iphivertex in phi dimension
sideside of the TPC
Returns
returns local distortion dR for given vertex

Definition at line 691 of file SpaceCharge.h.

◆ getLocalDistRPhi()

template<typename DataT = double>
DataT o2::tpc::SpaceCharge< DataT >::getLocalDistRPhi ( const size_t  iz,
const size_t  ir,
const size_t  iphi,
const Side  side 
) const
inline
Parameters
izvertex in z dimension
irvertex in r dimension
iphivertex in phi dimension
sideside of the TPC
Returns
returns local distortion dRPhi for given vertex

Definition at line 705 of file SpaceCharge.h.

◆ getLocalDistZ()

template<typename DataT = double>
DataT o2::tpc::SpaceCharge< DataT >::getLocalDistZ ( const size_t  iz,
const size_t  ir,
const size_t  iphi,
const Side  side 
) const
inline
Parameters
izvertex in z dimension
irvertex in r dimension
iphivertex in phi dimension
sideside of the TPC
Returns
returns local distortion dZ for given vertex

Definition at line 698 of file SpaceCharge.h.

◆ getLocalVecCorrR()

template<typename DataT = double>
DataT o2::tpc::SpaceCharge< DataT >::getLocalVecCorrR ( const size_t  iz,
const size_t  ir,
const size_t  iphi,
const Side  side 
) const
inline
Parameters
izvertex in z dimension
irvertex in r dimension
iphivertex in phi dimension
sideside of the TPC
Returns
returns local correction vector dR for given vertex

Definition at line 754 of file SpaceCharge.h.

◆ getLocalVecCorrRPhi()

template<typename DataT = double>
DataT o2::tpc::SpaceCharge< DataT >::getLocalVecCorrRPhi ( const size_t  iz,
const size_t  ir,
const size_t  iphi,
const Side  side 
) const
inline
Parameters
izvertex in z dimension
irvertex in r dimension
iphivertex in phi dimension
sideside of the TPC
Returns
returns local correction vector dRPhi for given vertex

Definition at line 768 of file SpaceCharge.h.

◆ getLocalVecCorrZ()

template<typename DataT = double>
DataT o2::tpc::SpaceCharge< DataT >::getLocalVecCorrZ ( const size_t  iz,
const size_t  ir,
const size_t  iphi,
const Side  side 
) const
inline
Parameters
izvertex in z dimension
irvertex in r dimension
iphivertex in phi dimension
sideside of the TPC
Returns
returns local correction vector dZ for given vertex

Definition at line 761 of file SpaceCharge.h.

◆ getLocalVecDistR()

template<typename DataT = double>
DataT o2::tpc::SpaceCharge< DataT >::getLocalVecDistR ( const size_t  iz,
const size_t  ir,
const size_t  iphi,
const Side  side 
) const
inline
Parameters
izvertex in z dimension
irvertex in r dimension
iphivertex in phi dimension
sideside of the TPC
Returns
returns local distortion vector dR for given vertex

Definition at line 712 of file SpaceCharge.h.

◆ getLocalVecDistRPhi()

template<typename DataT = double>
DataT o2::tpc::SpaceCharge< DataT >::getLocalVecDistRPhi ( const size_t  iz,
const size_t  ir,
const size_t  iphi,
const Side  side 
) const
inline
Parameters
izvertex in z dimension
irvertex in r dimension
iphivertex in phi dimension
sideside of the TPC
Returns
returns local distortion vector dRPhi for given vertex

Definition at line 726 of file SpaceCharge.h.

◆ getLocalVecDistZ()

template<typename DataT = double>
DataT o2::tpc::SpaceCharge< DataT >::getLocalVecDistZ ( const size_t  iz,
const size_t  ir,
const size_t  iphi,
const Side  side 
) const
inline
Parameters
izvertex in z dimension
irvertex in r dimension
iphivertex in phi dimension
sideside of the TPC
Returns
returns local distortion vector dZ for given vertex

Definition at line 719 of file SpaceCharge.h.

◆ getMeanLumi()

template<typename DataT = double>
float o2::tpc::SpaceCharge< DataT >::getMeanLumi ( ) const
inline

Definition at line 1224 of file SpaceCharge.h.

◆ getMetaData()

template<typename DataT = double>
const auto & o2::tpc::SpaceCharge< DataT >::getMetaData ( ) const
inline

Definition at line 1222 of file SpaceCharge.h.

◆ getNPhiVertices()

template<typename DataT = double>
unsigned short o2::tpc::SpaceCharge< DataT >::getNPhiVertices ( ) const
inline
Returns
returns number of vertices in phi direction

Definition at line 393 of file SpaceCharge.h.

◆ getNRVertices()

template<typename DataT = double>
unsigned short o2::tpc::SpaceCharge< DataT >::getNRVertices ( ) const
inline
Returns
returns number of vertices in r direction

Definition at line 390 of file SpaceCharge.h.

◆ getNStep()

template<typename DataT = double>
static int o2::tpc::SpaceCharge< DataT >::getNStep ( )
inlinestatic

Definition at line 898 of file SpaceCharge.h.

◆ getNThreads()

template<typename DataT = double>
static int o2::tpc::SpaceCharge< DataT >::getNThreads ( )
inlinestatic

get the number of threads used for some of the calculations

Definition at line 901 of file SpaceCharge.h.

◆ getNumericalIntegrationStrategy()

template<typename DataT = double>
static IntegrationStrategy o2::tpc::SpaceCharge< DataT >::getNumericalIntegrationStrategy ( )
inlinestatic

Definition at line 909 of file SpaceCharge.h.

◆ getNZVertices()

template<typename DataT = double>
unsigned short o2::tpc::SpaceCharge< DataT >::getNZVertices ( ) const
inline
Returns
returns number of vertices in z direction

Definition at line 387 of file SpaceCharge.h.

◆ getOMPMaxThreads()

template<typename DataT >
int SpaceCharge::getOMPMaxThreads ( )
static
Returns
returns max threads

Definition at line 105 of file SpaceCharge.cxx.

◆ getPhiFromCartesian()

template<typename DataT = double>
static DataT o2::tpc::SpaceCharge< DataT >::getPhiFromCartesian ( const DataT  x,
const DataT  y 
)
inlinestatic

convert x and y coordinates from cartesian to phi in polar coordinates

Definition at line 596 of file SpaceCharge.h.

◆ getPhiMax()

template<typename DataT = double>
DataT o2::tpc::SpaceCharge< DataT >::getPhiMax ( const Side  side) const
inline

Get max phi.

Definition at line 658 of file SpaceCharge.h.

◆ getPhiMin()

template<typename DataT = double>
DataT o2::tpc::SpaceCharge< DataT >::getPhiMin ( const Side  side) const
inline

Get min phi.

Definition at line 649 of file SpaceCharge.h.

◆ getPhiVertex()

template<typename DataT = double>
DataT o2::tpc::SpaceCharge< DataT >::getPhiVertex ( const size_t  indexPhi,
const Side  side 
) const
inline

Get phi vertex position for index in phi direction

Parameters
indexPhiindex in phi direction

Definition at line 852 of file SpaceCharge.h.

◆ getPotential() [1/2]

template<typename DataT = double>
const auto & o2::tpc::SpaceCharge< DataT >::getPotential ( const Side  side) const &
inline

Definition at line 407 of file SpaceCharge.h.

◆ getPotential() [2/2]

template<typename DataT = double>
DataT o2::tpc::SpaceCharge< DataT >::getPotential ( const size_t  iz,
const size_t  ir,
const size_t  iphi,
const Side  side 
) const
inline

Get potential for vertex

Parameters
izvertex in z dimension
irvertex in r dimension
iphivertex in phi dimension
sideside of the TPC

Definition at line 845 of file SpaceCharge.h.

◆ getPotentialCyl() [1/2]

template<typename DataT >
DataT SpaceCharge::getPotentialCyl ( const DataT  z,
const DataT  r,
const DataT  phi,
const Side  side 
) const

get the potential for given coordinate

Parameters
zglobal z coordinate
rglobal r coordinate
phiglobal phi coordinate

Definition at line 1813 of file SpaceCharge.cxx.

◆ getPotentialCyl() [2/2]

template<typename DataT >
std::vector< float > SpaceCharge::getPotentialCyl ( const std::vector< DataT > &  z,
const std::vector< DataT > &  r,
const std::vector< DataT > &  phi,
const Side  side 
) const

get the potential for list of given coordinate

Definition at line 1819 of file SpaceCharge.cxx.

◆ getRadiusFromCartesian()

template<typename DataT = double>
static DataT o2::tpc::SpaceCharge< DataT >::getRadiusFromCartesian ( const DataT  x,
const DataT  y 
)
inlinestatic

convert x and y coordinates from cartesian to the radius in polar coordinates

Definition at line 593 of file SpaceCharge.h.

◆ getRMax()

template<typename DataT = double>
DataT o2::tpc::SpaceCharge< DataT >::getRMax ( const Side  side) const
inline

Get max r.

Definition at line 652 of file SpaceCharge.h.

◆ getRMin()

template<typename DataT = double>
DataT o2::tpc::SpaceCharge< DataT >::getRMin ( const Side  side) const
inline

Get inner radius of tpc.

Definition at line 643 of file SpaceCharge.h.

◆ getRVertex()

template<typename DataT = double>
DataT o2::tpc::SpaceCharge< DataT >::getRVertex ( const size_t  indexR,
const Side  side 
) const
inline

Get r vertex position for index in r direction

Parameters
indexRindex in r direction

Definition at line 856 of file SpaceCharge.h.

◆ getSCDistortionType()

template<typename DataT = double>
static SCDistortionType o2::tpc::SpaceCharge< DataT >::getSCDistortionType ( )
inlinestatic

Get the space-charge distortions model.

Definition at line 924 of file SpaceCharge.h.

◆ getSide()

template<typename DataT = double>
static Side o2::tpc::SpaceCharge< DataT >::getSide ( const DataT  z)
inlinestatic

Definition at line 661 of file SpaceCharge.h.

◆ getSimEDistortions()

template<typename DataT = double>
bool o2::tpc::SpaceCharge< DataT >::getSimEDistortions ( ) const
inline
Returns
returns if distortions due to electric fields will be simulated during distortion calculations

Definition at line 892 of file SpaceCharge.h.

◆ getSimExBMisalignment()

template<typename DataT = double>
bool o2::tpc::SpaceCharge< DataT >::getSimExBMisalignment ( ) const
inline
Returns
returns if ExB misalignment will be simulated during distortion calculations

Definition at line 886 of file SpaceCharge.h.

◆ getSimpsonNIteratives()

template<typename DataT = double>
static int o2::tpc::SpaceCharge< DataT >::getSimpsonNIteratives ( )
inlinestatic

Definition at line 918 of file SpaceCharge.h.

◆ getStepWidth()

template<typename DataT = double>
static int o2::tpc::SpaceCharge< DataT >::getStepWidth ( )
inlinestatic

Get the step width which is used for the calculation of the correction/distortions in units of the z-bin.

Definition at line 848 of file SpaceCharge.h.

◆ getUseAnalyticalDistCorr()

template<typename DataT = double>
bool o2::tpc::SpaceCharge< DataT >::getUseAnalyticalDistCorr ( ) const
inline
Returns
returns if the analytical formula will be used in the distortElectron() and getCorrections() function

Definition at line 590 of file SpaceCharge.h.

◆ getXFromPolar()

template<typename DataT = double>
static DataT o2::tpc::SpaceCharge< DataT >::getXFromPolar ( const DataT  r,
const DataT  phi 
)
inlinestatic

convert radius and phi coordinates from polar coordinates to x cartesian coordinates

Definition at line 599 of file SpaceCharge.h.

◆ getYFromPolar()

template<typename DataT = double>
static DataT o2::tpc::SpaceCharge< DataT >::getYFromPolar ( const DataT  r,
const DataT  phi 
)
inlinestatic

convert radius and phi coordinates from polar coordinates to y cartesian coordinate

Definition at line 602 of file SpaceCharge.h.

◆ getZMax()

template<typename DataT = double>
DataT o2::tpc::SpaceCharge< DataT >::getZMax ( const Side  side) const
inline

Get max z.

Definition at line 655 of file SpaceCharge.h.

◆ getZMin()

template<typename DataT = double>
DataT o2::tpc::SpaceCharge< DataT >::getZMin ( const Side  side) const
inline

Get min z position which is used during the calaculations.

Definition at line 646 of file SpaceCharge.h.

◆ getZVertex()

template<typename DataT = double>
DataT o2::tpc::SpaceCharge< DataT >::getZVertex ( const size_t  indexZ,
const Side  side 
) const
inline

Get z vertex position for index in z direction

Parameters
indexZindex in z direction

Definition at line 860 of file SpaceCharge.h.

◆ init()

template<typename DataT >
void SpaceCharge::init ( )

TODO is there a faster way to get the drift velocity

TODO fix hard coded values (ezField, t1, t2): export to Constants.h or get from somewhere?

TODO use this parameterization or fixed value(s) from Magboltz calculations?

Definition at line 2055 of file SpaceCharge.cxx.

◆ initAfterReadingFromFile()

template<typename DataT >
void SpaceCharge::initAfterReadingFromFile ( )

Definition at line 3978 of file SpaceCharge.cxx.

◆ initBField()

template<typename DataT >
void SpaceCharge::initBField ( const int  field)

set magnetic field which can be used for ExB misalignment distortions

Parameters
fieldmagnetic field (-5, -2, 0, 2, 5)

Definition at line 2838 of file SpaceCharge.cxx.

◆ makeElectronDriftPathGif()

template<typename DataT >
void SpaceCharge::makeElectronDriftPathGif ( const char inpFile,
TH2F &  hBorder,
const int  type = 0,
const int  gifSpeed = 2,
const int  maxsamplingpoints = 100,
const char outName = "electron_drift_path" 
)
static
Parameters
inpFileinput file containing the electron tracks tree, which is the output file of calculateElectronDriftPath()
hBorderhistogram which defines the borders for the drawing and also the axis titles
typesetting dimensions: type=0: radius vs z, type=0: radius vs phi
gifSpeedspeed of the output gif file (fastest is 2, slowest is 99)
maxsamplingpointsmaximum number of frames which will be drawn (higher number increases processing time)
outNamename of the output file

Definition at line 2324 of file SpaceCharge.cxx.

◆ mirrorPotential()

template<typename DataT >
void SpaceCharge::mirrorPotential ( const Side  sideRef,
const Side  sideMirrored 
)

mirror potential from one side to the other side

Parameters
sideRefside which contains the reference potential
sideMirroredside where the potential will be set from sideRef

Definition at line 509 of file SpaceCharge.cxx.

◆ normalizeHistoQVEps0()

template<typename DataT >
void SpaceCharge::normalizeHistoQVEps0 ( TH3 &  histoIonsPhiRZ)
static

normalize a histogram containing the charge to the space charge density

Parameters
histoIonsPhiRZhistogram which will be normalized to the sapce charge density

Definition at line 2775 of file SpaceCharge.cxx.

◆ operator=()

template<typename DataT = double>
SpaceCharge & o2::tpc::SpaceCharge< DataT >::operator= ( SpaceCharge< DataT > &&  )
default

move assignment

◆ poissonSolver() [1/2]

template<typename DataT >
void SpaceCharge::poissonSolver ( const DataT  stoppingConvergence = 1e-6,
const int  symmetry = 0 
)

step 1: use the O2TPCPoissonSolver class to numerically calculate the potential with set space charge density and boundary conditions from potential for A and C side in parallel

Parameters
stoppingConvergencestopping criterion used in the poisson solver
symmetryuse symmetry or not in the poisson solver

Definition at line 579 of file SpaceCharge.cxx.

◆ poissonSolver() [2/2]

template<typename DataT >
void SpaceCharge::poissonSolver ( const Side  side,
const DataT  stoppingConvergence = 1e-6,
const int  symmetry = 0 
)

step 1: use the O2TPCPoissonSolver class to numerically calculate the potential with set space charge density and boundary conditions from potential

Parameters
sideside of the TPC
stoppingConvergencestopping criterion used in the poisson solver
symmetryuse symmetry or not in the poisson solver

Definition at line 569 of file SpaceCharge.cxx.

◆ printMetaData()

template<typename DataT = double>
void o2::tpc::SpaceCharge< DataT >::printMetaData ( ) const
inline

Definition at line 1223 of file SpaceCharge.h.

◆ readMetaData()

template<typename DataT >
void SpaceCharge::readMetaData ( std::string_view  file)

set meta data from file (mC0, mC1, mC2, RegularGrid)

Parameters
fileinput file to read from

Definition at line 3321 of file SpaceCharge.cxx.

◆ regulatePhi()

template<typename DataT = double>
DataT o2::tpc::SpaceCharge< DataT >::regulatePhi ( const DataT  posPhi,
const Side  side 
) const
inline

set phi coordinate between min phi max phi

Definition at line 1113 of file SpaceCharge.h.

◆ regulateR()

template<typename DataT >
DataT SpaceCharge::regulateR ( const DataT  posR,
const Side  side 
) const

set r coordinate between 'RMIN - 4 * GRIDSPACINGR' and 'RMAX + 2 * GRIDSPACINGR'. the r coordinate is not clamped to RMIN and RMAX to ensure correct interpolation at the borders of the grid.

Definition at line 198 of file SpaceCharge.cxx.

◆ regulateZ()

template<typename DataT = double>
DataT o2::tpc::SpaceCharge< DataT >::regulateZ ( const DataT  posZ,
const Side  side 
) const
inline

set z coordinate between min z max z

Parameters
posZz position which will be regulated if needed

Definition at line 1107 of file SpaceCharge.h.

◆ resetBoundaryPotentialToZeroInRangeZ()

template<typename DataT >
void SpaceCharge::resetBoundaryPotentialToZeroInRangeZ ( float  zMin,
float  zMax,
const Side  side 
)

setting the boundary potential to 0 for z<zMin and z>zMax

Definition at line 3624 of file SpaceCharge.cxx.

◆ scaleChargeDensity()

template<typename DataT = double>
void o2::tpc::SpaceCharge< DataT >::scaleChargeDensity ( const DataT  scalingFactor,
const Side  side 
)
inline

scale the space charge density by a scaling factor: sc_new = sc * scalingFactor

Parameters
scalingFactorfactor to scale the space-charge density
sideside for which the space-charge density will be scaled

Definition at line 302 of file SpaceCharge.h.

◆ scaleChargeDensitySector()

template<typename DataT >
void SpaceCharge::scaleChargeDensitySector ( const float  scalingFactor,
const Sector  sector 
)

scale the space-charge for one sector: space-charge density *= scalingFactor;

Parameters
scalingFactorscaling factor for the space-charge density

Definition at line 3935 of file SpaceCharge.cxx.

◆ scaleChargeDensityStack()

template<typename DataT >
void SpaceCharge::scaleChargeDensityStack ( const float  scalingFactor,
const Sector  sector,
const GEMstack  stack 
)

scaling the space-charge density for given stack

Definition at line 3953 of file SpaceCharge.cxx.

◆ scaleCorrections()

template<typename DataT >
void SpaceCharge::scaleCorrections ( const float  scaleFac,
const Side  side 
)

scale corrections by factor

Parameters
scaleFacglobal corrections are multiplied by this factor

Definition at line 3899 of file SpaceCharge.cxx.

◆ setAnalyticalCorrectionsDistortionsFromFile()

template<typename DataT >
void SpaceCharge::setAnalyticalCorrectionsDistortionsFromFile ( std::string_view  inpf)

set analytical corrections and distortions from file

Parameters
inpfinput file where the analytical corrections and distortions are stored

Definition at line 2805 of file SpaceCharge.cxx.

◆ setC0C1()

template<typename DataT = double>
void o2::tpc::SpaceCharge< DataT >::setC0C1 ( const DataT  c0,
const DataT  c1 
)
inline
Parameters
c0coefficient C0 (compare Jim Thomas's notes for definitions)
c1coefficient C1 (compare Jim Thomas's notes for definitions)

Definition at line 869 of file SpaceCharge.h.

◆ setC2()

template<typename DataT = double>
void o2::tpc::SpaceCharge< DataT >::setC2 ( const DataT  c2)
inline
Parameters
c2coefficient C2

Definition at line 876 of file SpaceCharge.h.

◆ setChargeDensityFromFormula()

template<typename DataT >
void SpaceCharge::setChargeDensityFromFormula ( const AnalyticalFields< DataT > &  formulaStruct)

step 0: this function fills the internal storage for the charge density using an analytical formula

Parameters
formulaStructstruct containing a method to evaluate the density

Definition at line 212 of file SpaceCharge.cxx.

◆ setDefaultStaticDistortionsGEMFrameChargeUp()

template<typename DataT >
void SpaceCharge::setDefaultStaticDistortionsGEMFrameChargeUp ( const Side  side,
const DataT  deltaPotential = 1000 
)

setting default potential (same potential for all GEM frames. The default value of 1000V are matched to distortions observed in laser data without X-Ray etc.

Parameters
sideside of the TPC where the potential will be set
deltaPotentialdelta potential which will be set at the GEM frames

Definition at line 229 of file SpaceCharge.cxx.

◆ setDeltaVoltageCopperRodShiftIFC()

template<typename DataT = double>
void o2::tpc::SpaceCharge< DataT >::setDeltaVoltageCopperRodShiftIFC ( const float  deltaPot,
const Side  side,
const int  sector 
)
inline

Define delta potential due to a possible shifted copper rod (delta potential spike at the copper rods) at the IFC

Parameters
deltaPotdelta potential which will be set at the copper rod

Definition at line 1145 of file SpaceCharge.h.

◆ setDeltaVoltageCopperRodShiftOFC()

template<typename DataT = double>
void o2::tpc::SpaceCharge< DataT >::setDeltaVoltageCopperRodShiftOFC ( const float  deltaPot,
const Side  side,
const int  sector 
)
inline

Define delta potential due to a possible shifted copper rod (delta potential spike at the copper rods) at the OFC

Parameters
deltaPotdelta potential which will be set at the copper rod

Definition at line 1149 of file SpaceCharge.h.

◆ setDeltaVoltageRotatedClipIFC()

template<typename DataT = double>
void o2::tpc::SpaceCharge< DataT >::setDeltaVoltageRotatedClipIFC ( const float  deltaPot,
const Side  side,
const int  sector 
)
inline

Define delta potential due to rotated clip at IFC. Only possible at sector 11 and 11+18. The delta potential increases linearly from neighbouring rod to the specified rod, the sign of the delta potential inverts and increases linearly to 0 to the other nerighbouring rod

Parameters
deltaPotdelta potential which will be set at the copper rod

Definition at line 1162 of file SpaceCharge.h.

◆ setDeltaVoltageRotatedClipOFC()

template<typename DataT = double>
void o2::tpc::SpaceCharge< DataT >::setDeltaVoltageRotatedClipOFC ( const float  deltaPot,
const Side  side,
const int  sector 
)
inline

Define delta potential due to rotated clip at OFC. Only possible at sector 3 and 3+18. The delta potential increases linearly from neighbouring rod to the specified rod, the sign of the delta potential inverts and increases linearly to 0 to the other nerighbouring rod

Parameters
deltaPotdelta potential which will be set at the copper rod

Definition at line 1167 of file SpaceCharge.h.

◆ setDeltaVoltageStripsShiftIFC()

template<typename DataT = double>
void o2::tpc::SpaceCharge< DataT >::setDeltaVoltageStripsShiftIFC ( const float  deltaPot,
const Side  side,
const int  sector 
)
inline

Define delta potential due to shifted copper rod and field cage strips at IFC (maximum of the delta potential at the copper rod and linear decreasing up to left and right neighbouring rods)

Parameters
deltaPotdelta potential which will be set at the copper rod

Definition at line 1153 of file SpaceCharge.h.

◆ setDeltaVoltageStripsShiftOFC()

template<typename DataT = double>
void o2::tpc::SpaceCharge< DataT >::setDeltaVoltageStripsShiftOFC ( const float  deltaPot,
const Side  side,
const int  sector 
)
inline

Define delta potential due to shifted copper rod and field cage strips at OFC (maximum of the delta potential at the copper rod and linear decreasing up to left and right neighbouring rods)

Parameters
deltaPotdelta potential which will be set at the copper rod

Definition at line 1157 of file SpaceCharge.h.

◆ setDensityFromFile()

template<typename DataT >
void SpaceCharge::setDensityFromFile ( std::string_view  file,
const Side  side 
)

set density from root file using RDataFrame

Parameters
fileoutput file where the electrical fields will be written to
sideof the TPC

Definition at line 3242 of file SpaceCharge.cxx.

◆ setDistortionLookupTables()

template<typename DataT >
void SpaceCharge::setDistortionLookupTables ( const DataContainer distdZ,
const DataContainer distdR,
const DataContainer distdRPhi,
const Side  side 
)

set the distortions directly from a look up table

Parameters
distdZdistortions in z direction
distdRdistortions in r direction
distdRPhidistortions in rphi direction
sideside of the TPC

Definition at line 2084 of file SpaceCharge.cxx.

◆ setDistortionsCorrectionsAnalytical()

template<typename DataT = double>
void o2::tpc::SpaceCharge< DataT >::setDistortionsCorrectionsAnalytical ( const AnalyticalDistCorr< DataT > &  formula)
inline

set distortions and corrections by an analytical formula

Definition at line 581 of file SpaceCharge.h.

◆ setEFieldFromFormula()

template<typename DataT >
void SpaceCharge::setEFieldFromFormula ( const AnalyticalFields< DataT > &  formulaStruct)

step 2a: set the electric field from an analytical formula

Parameters
formulaStructstruct containing a method to evaluate the electric fields

Definition at line 589 of file SpaceCharge.cxx.

◆ setElectricFieldsFromFile()

template<typename DataT >
void SpaceCharge::setElectricFieldsFromFile ( std::string_view  file,
const Side  side 
)

set electric field from root file using RDataFrame

Parameters
fileoutput file where the electrical fields will be written to
sideof the TPC

Definition at line 2982 of file SpaceCharge.cxx.

◆ setFromFile() [1/2]

template<typename DataT >
void SpaceCharge::setFromFile ( std::string_view  file)

set the density, potential, electric fields, local distortions/corrections, global distortions/corrections from a file for both sides. Missing objects in the file are ignored.

Parameters
fileoutput file where the electrical fields will be written to

Definition at line 3389 of file SpaceCharge.cxx.

◆ setFromFile() [2/2]

template<typename DataT >
void SpaceCharge::setFromFile ( std::string_view  file,
const Side  side 
)

set the density, potential, electric fields, local distortions/corrections, global distortions/corrections from a file. Missing objects in the file are ignored.

Parameters
fileoutput file where the electrical fields will be written to
sideof the TPC

Definition at line 3376 of file SpaceCharge.cxx.

◆ setGlobalCorrections()

template<typename DataT >
void SpaceCharge::setGlobalCorrections ( const std::function< void(int sector, DataT gx, DataT gy, DataT gz, DataT &gCx, DataT &gCy, DataT &gCz)> &  gCorr,
const Side  side 
)

setting the global corrections directly from input function provided in global coordinates

Parameters
gCorrfunction returning global corrections for given global coordinate

Definition at line 3740 of file SpaceCharge.cxx.

◆ setGlobalCorrectionsFromFile() [1/2]

template<typename DataT >
void SpaceCharge::setGlobalCorrectionsFromFile ( std::string_view  file,
const Side  side 
)

set global corrections from root file using RDataFrame

Parameters
fileoutput file where the electrical fields will be written to
sideof the TPC

Definition at line 3059 of file SpaceCharge.cxx.

◆ setGlobalCorrectionsFromFile() [2/2]

template<typename DataT >
template<typename DataTIn >
void SpaceCharge::setGlobalCorrectionsFromFile ( TFile &  inpf,
const Side  side 
)

set global corrections from root file (deprecated)

Parameters
inpfinput file where the global corrections are stored
sideof the TPC

Definition at line 3078 of file SpaceCharge.cxx.

◆ setGlobalDistCorrMethod()

template<typename DataT = double>
static void o2::tpc::SpaceCharge< DataT >::setGlobalDistCorrMethod ( const GlobalDistCorrMethod  globalDistCorrMethod)
inlinestatic

Definition at line 914 of file SpaceCharge.h.

◆ setGlobalDistortionsFromFile() [1/2]

template<typename DataT >
void SpaceCharge::setGlobalDistortionsFromFile ( std::string_view  file,
const Side  side 
)

set global distortions from root file using RDataFrame

Parameters
fileoutput file where the electrical fields will be written to
sideof the TPC

Definition at line 3014 of file SpaceCharge.cxx.

◆ setGlobalDistortionsFromFile() [2/2]

template<typename DataT >
template<typename DataTIn >
void SpaceCharge::setGlobalDistortionsFromFile ( TFile &  inpf,
const Side  side 
)

set global distortions from root file (deprecated)

Parameters
inpfinput file where the global distortions are stored
sideof the TPC

Definition at line 3032 of file SpaceCharge.cxx.

◆ setGlobalDistType()

template<typename DataT = double>
static void o2::tpc::SpaceCharge< DataT >::setGlobalDistType ( const GlobalDistType  globalDistType)
inlinestatic

Definition at line 911 of file SpaceCharge.h.

◆ setIFCChargeUpFallingPot()

template<typename DataT >
void SpaceCharge::setIFCChargeUpFallingPot ( const float  deltaPot,
const float  zMaxDeltaPot,
const int  type,
const float  zEnd,
const float  offs,
const Side  side 
)

IFC charge up: set a linear rising delta potential from the CE to given z position which falls linear down to 0 at the readout

Parameters
deltaPotmaximum value of the delta potential in V
zMaxDeltaPotz position where the maximum delta potential of deltaPot will be set
typefunction which is used to set falling potential: 0=linear falling off, 1=1/x falling off, 2=1/x steeply falling, 3=linear with offset
offsif offs != 0 the potential doesnt fall to 0. E.g. deltaPot=400V and offs=-10V -> Potential falls from 400V at zMaxDeltaPot to -10V at z=250cm

Definition at line 3696 of file SpaceCharge.cxx.

◆ setIFCChargeUpRisingPot()

template<typename DataT >
void SpaceCharge::setIFCChargeUpRisingPot ( const float  deltaPot,
const float  zMaxDeltaPot,
const int  type,
const float  zStart,
const float  offs,
const Side  side 
)

IFC charge up: set a linear rising delta potential from the CE to given z

Parameters
deltaPotmaximum value of the delta potential in V
zMaxDeltaPotz position where the maximum delta potential of deltaPot will be set
typefunctional form of the delta potential: 0=linear, 1= 1/x, 2=flat, 3=linear falling, 4=flat no z dependence
zStartusually at 0 to start the rising of the potential at the IFC

Definition at line 3658 of file SpaceCharge.cxx.

◆ setLocalCorrectionsFromFile()

template<typename DataT >
void SpaceCharge::setLocalCorrectionsFromFile ( std::string_view  file,
const Side  side 
)

set local corrections from root file using RDataFrame

Parameters
fileoutput file where the electrical fields will be written to
sideof the TPC

Definition at line 3105 of file SpaceCharge.cxx.

◆ setLocalDistCorrVectorsFromFile()

template<typename DataT >
void SpaceCharge::setLocalDistCorrVectorsFromFile ( std::string_view  file,
const Side  side 
)

set local distortions from root file using RDataFrame

Parameters
fileoutput file where the electrical fields will be written to
sideof the TPC

Definition at line 3169 of file SpaceCharge.cxx.

◆ setLocalDistortionsFromFile()

template<typename DataT >
void SpaceCharge::setLocalDistortionsFromFile ( std::string_view  file,
const Side  side 
)

set local distortions from root file using RDataFrame

Parameters
fileoutput file where the electrical fields will be written to
sideof the TPC

Definition at line 3152 of file SpaceCharge.cxx.

◆ setMeanLumi()

template<typename DataT = double>
void o2::tpc::SpaceCharge< DataT >::setMeanLumi ( float  lumi)
inline

Definition at line 1225 of file SpaceCharge.h.

◆ setMetaData()

template<typename DataT = double>
void o2::tpc::SpaceCharge< DataT >::setMetaData ( const SCMetaData meta)
inline

setting meta data for this object

Definition at line 1221 of file SpaceCharge.h.

◆ setNStep()

template<typename DataT = double>
static void o2::tpc::SpaceCharge< DataT >::setNStep ( const int  nSteps)
inlinestatic

set number of steps used for calculation of distortions/corrections per z bin

Parameters
nStepsnumber of steps per z bin

Definition at line 896 of file SpaceCharge.h.

◆ setNThreads()

template<typename DataT = double>
static void o2::tpc::SpaceCharge< DataT >::setNThreads ( const int  nThreads)
inlinestatic

set the number of threads used for some of the calculations

Definition at line 904 of file SpaceCharge.h.

◆ setNumericalIntegrationStrategy()

template<typename DataT = double>
static void o2::tpc::SpaceCharge< DataT >::setNumericalIntegrationStrategy ( const IntegrationStrategy  strategy)
inlinestatic

set which kind of numerical integration is used for calcution of the integrals int Er/Ez dz, int Ephi/Ez dz, int Ez dz

Parameters
strategynumerical integration strategy. see enum IntegrationStrategy for the different types

Definition at line 908 of file SpaceCharge.h.

◆ setOmegaTauT1T2()

template<typename DataT >
void SpaceCharge::setOmegaTauT1T2 ( const DataT  omegaTau = 0.32f,
const DataT  t1 = 1,
const DataT  t2 = 1 
)
Parameters
omegaTau\omega \tau value
t1value for t1 see: ???
t2value for t2 see: ???

Definition at line 3404 of file SpaceCharge.cxx.

◆ setPotential()

template<typename DataT >
void SpaceCharge::setPotential ( int  iz,
int  ir,
int  iphi,
Side  side,
float  val 
)

setting the potential directly for given vertex

Definition at line 4044 of file SpaceCharge.cxx.

◆ setPotentialBoundaryFromFormula()

template<typename DataT >
void SpaceCharge::setPotentialBoundaryFromFormula ( const AnalyticalFields< DataT > &  formulaStruct)

step 0: this function fills the boundary of the potential using an analytical formula. The boundary is used in the PoissonSolver.

Parameters
formulaStructstruct containing a method to evaluate the potential

Definition at line 523 of file SpaceCharge.cxx.

◆ setPotentialBoundaryGEMFrameAlongR()

template<typename DataT >
void SpaceCharge::setPotentialBoundaryGEMFrameAlongR ( const std::function< DataT(DataT)> &  potentialFunc,
const Side  side 
)

setting the boundary potential of the GEM stack along the radius

Parameters
potentialFuncpotential funtion as a function of the radius
Sideof the TPC

Definition at line 263 of file SpaceCharge.cxx.

◆ setPotentialBoundaryGEMFrameIROCBottomAlongPhi()

template<typename DataT = double>
void o2::tpc::SpaceCharge< DataT >::setPotentialBoundaryGEMFrameIROCBottomAlongPhi ( const std::function< DataT(DataT)> &  potentialFunc,
const Side  side 
)
inline

setting the boundary potential of the IROC on the bottom along phi

Parameters
potentialFuncpotential funtion as a function of global phi
Sideof the TPC

Definition at line 225 of file SpaceCharge.h.

◆ setPotentialBoundaryGEMFrameIROCToIFCPhi()

template<typename DataT = double>
void o2::tpc::SpaceCharge< DataT >::setPotentialBoundaryGEMFrameIROCToIFCPhi ( const std::function< DataT(DataT)> &  potentialFunc,
const Side  side 
)
inline

setting the potential from the IROC to the inner field cage

Definition at line 268 of file SpaceCharge.h.

◆ setPotentialBoundaryGEMFrameIROCTopAlongPhi()

template<typename DataT = double>
void o2::tpc::SpaceCharge< DataT >::setPotentialBoundaryGEMFrameIROCTopAlongPhi ( const std::function< DataT(DataT)> &  potentialFunc,
const Side  side 
)
inline

setting the boundary potential of the IROC on the top along phi

Parameters
potentialFuncpotential funtion as a function of global phi
Sideof the TPC

Definition at line 230 of file SpaceCharge.h.

◆ setPotentialBoundaryGEMFrameOROC1BottomAlongPhi()

template<typename DataT = double>
void o2::tpc::SpaceCharge< DataT >::setPotentialBoundaryGEMFrameOROC1BottomAlongPhi ( const std::function< DataT(DataT)> &  potentialFunc,
const Side  side 
)
inline

setting the boundary potential of the OROC1 on the bottom along phi

Parameters
potentialFuncpotential funtion as a function of global phi
Sideof the TPC

Definition at line 235 of file SpaceCharge.h.

◆ setPotentialBoundaryGEMFrameOROC1TopAlongPhi()

template<typename DataT = double>
void o2::tpc::SpaceCharge< DataT >::setPotentialBoundaryGEMFrameOROC1TopAlongPhi ( const std::function< DataT(DataT)> &  potentialFunc,
const Side  side 
)
inline

setting the boundary potential of the OROC1 on the top along phi

Parameters
potentialFuncpotential funtion as a function of global phi
Sideof the TPC

Definition at line 240 of file SpaceCharge.h.

◆ setPotentialBoundaryGEMFrameOROC2BottomAlongPhi()

template<typename DataT = double>
void o2::tpc::SpaceCharge< DataT >::setPotentialBoundaryGEMFrameOROC2BottomAlongPhi ( const std::function< DataT(DataT)> &  potentialFunc,
const Side  side 
)
inline

setting the boundary potential of the OROC2 on the bottom along phi

Parameters
potentialFuncpotential funtion as a function of global phi
Sideof the TPC

Definition at line 245 of file SpaceCharge.h.

◆ setPotentialBoundaryGEMFrameOROC2TopAlongPhi()

template<typename DataT = double>
void o2::tpc::SpaceCharge< DataT >::setPotentialBoundaryGEMFrameOROC2TopAlongPhi ( const std::function< DataT(DataT)> &  potentialFunc,
const Side  side 
)
inline

setting the boundary potential of the OROC2 on the top along phi

Parameters
potentialFuncpotential funtion as a function of global phi
Sideof the TPC

Definition at line 250 of file SpaceCharge.h.

◆ setPotentialBoundaryGEMFrameOROC3BottomAlongPhi()

template<typename DataT = double>
void o2::tpc::SpaceCharge< DataT >::setPotentialBoundaryGEMFrameOROC3BottomAlongPhi ( const std::function< DataT(DataT)> &  potentialFunc,
const Side  side 
)
inline

setting the boundary potential of the OROC3 on the bottom along phi

Parameters
potentialFuncpotential funtion as a function of global phi
Sideof the TPC

Definition at line 255 of file SpaceCharge.h.

◆ setPotentialBoundaryGEMFrameOROC3ToOFCPhi()

template<typename DataT = double>
void o2::tpc::SpaceCharge< DataT >::setPotentialBoundaryGEMFrameOROC3ToOFCPhi ( const std::function< DataT(DataT)> &  potentialFunc,
const Side  side 
)
inline

setting the boundary potential of the OROC3 on the top along phi

Parameters
potentialFuncpotential funtion as a function of global phi
Sideof the TPC

Definition at line 265 of file SpaceCharge.h.

◆ setPotentialBoundaryGEMFrameOROC3TopAlongPhi()

template<typename DataT = double>
void o2::tpc::SpaceCharge< DataT >::setPotentialBoundaryGEMFrameOROC3TopAlongPhi ( const std::function< DataT(DataT)> &  potentialFunc,
const Side  side 
)
inline

setting the boundary potential of the OROC3 on the top along phi

Parameters
potentialFuncpotential funtion as a function of global phi
Sideof the TPC

Definition at line 260 of file SpaceCharge.h.

◆ setPotentialBoundaryInnerRadius()

template<typename DataT >
void SpaceCharge::setPotentialBoundaryInnerRadius ( const std::function< DataT(DataT)> &  potentialFunc,
const Side  side 
)

setting the boundary potential for the inner TPC radius along r

Parameters
potentialFuncpotential funtion as a function of z
Sideof the TPC

Definition at line 464 of file SpaceCharge.cxx.

◆ setPotentialBoundaryOuterRadius()

template<typename DataT >
void SpaceCharge::setPotentialBoundaryOuterRadius ( const std::function< DataT(DataT)> &  potentialFunc,
const Side  side 
)

setting the boundary potential for the outer TPC radius along r

Parameters
potentialFuncpotential funtion as a function of z
Sideof the TPC

Definition at line 478 of file SpaceCharge.cxx.

◆ setPotentialFromFile()

template<typename DataT >
void SpaceCharge::setPotentialFromFile ( std::string_view  file,
const Side  side 
)

set potential from root file using RDataFrame

Parameters
fileoutput file where the electrical fields will be written to
sideof the TPC

Definition at line 3198 of file SpaceCharge.cxx.

◆ setPotentialFromFormula()

template<typename DataT >
void SpaceCharge::setPotentialFromFormula ( const AnalyticalFields< DataT > &  formulaStruct)

step 0: this function fills the potential using an analytical formula

Parameters
formulaStructstruct containing a method to evaluate the potential

Definition at line 492 of file SpaceCharge.cxx.

◆ setROCMisalignmentRotationAlongX()

template<typename DataT >
void SpaceCharge::setROCMisalignmentRotationAlongX ( const int  sector,
const int  type,
const float  potentialMin,
const float  potentialMax 
)

set misalignment of ROC for rotation along local x

Parameters
sectorsector for which the misalignment in z will be applied (if sector=-1 all sectors are shifted)
type0=IROC, 1=OROC, 2=IROC+OROC
potentialminimum delta potential
potentialmaximum delta potential

Definition at line 3790 of file SpaceCharge.cxx.

◆ setROCMisalignmentRotationAlongY()

template<typename DataT >
void SpaceCharge::setROCMisalignmentRotationAlongY ( const int  sector,
const int  type,
const float  potentialMin,
const float  potentialMax 
)

set misalignment of ROC for rotation along local y

Parameters
sectorsector for which the misalignment in z will be applied (if sector=-1 all sectors are shifted)
type0=IROC, 1=OROC, 2=IROC+OROC
potentialminimum delta potential
potentialmaximum delta potential

Definition at line 3796 of file SpaceCharge.cxx.

◆ setROCMisalignmentShiftZ()

template<typename DataT >
void SpaceCharge::setROCMisalignmentShiftZ ( const int  sector,
const int  type,
const float  potential 
)

set misalignment of ROC for shift in z

Parameters
sectorsector for which the misalignment in z will be applied (if sector=-1 all sectors are shifted)
type0=IROC, 1=OROC, 2=IROC+OROC
potentialdelta potential on which the ROCs are set

Definition at line 3784 of file SpaceCharge.cxx.

◆ setSCDistortionType()

template<typename DataT = double>
static void o2::tpc::SpaceCharge< DataT >::setSCDistortionType ( SCDistortionType  distortionType)
inlinestatic

Set the space-charge distortions model

Parameters
distortionTypedistortion type (constant or realistic)

Definition at line 922 of file SpaceCharge.h.

◆ setSimEDistortions()

template<typename DataT = double>
void o2::tpc::SpaceCharge< DataT >::setSimEDistortions ( const bool  simEDistortions)
inline

calculate distortions due to electric fields (space charge, boundary potential...)

Definition at line 889 of file SpaceCharge.h.

◆ setSimExBMisalignment()

template<typename DataT = double>
void o2::tpc::SpaceCharge< DataT >::setSimExBMisalignment ( const bool  simExBMisalignment)
inline

enable/disable calculation of distortions due to ExB misalignment

Definition at line 883 of file SpaceCharge.h.

◆ setSimOneSector()

template<typename DataT >
void SpaceCharge::setSimOneSector ( )

simulate only one sector instead of 18 per side. This makes currently only sense for the static distortions (ToDo: simplify usage) phi max will be restricted to 2Pi/18 for this instance and for global instance of poisson solver

Definition at line 3359 of file SpaceCharge.cxx.

◆ setSimpsonNIteratives()

template<typename DataT = double>
static void o2::tpc::SpaceCharge< DataT >::setSimpsonNIteratives ( const int  nIter)
inlinestatic

Definition at line 917 of file SpaceCharge.h.

◆ setUseAnalyticalDistCorr()

template<typename DataT = double>
void o2::tpc::SpaceCharge< DataT >::setUseAnalyticalDistCorr ( const bool  useAna)
inline

setting usage of the analytical formula for the distortions and corrections

Definition at line 587 of file SpaceCharge.h.

◆ setUseInitialSCDensity()

template<typename DataT = double>
void o2::tpc::SpaceCharge< DataT >::setUseInitialSCDensity ( const bool  useInitialSCDensity)
inline

Definition at line 926 of file SpaceCharge.h.

◆ subtractGlobalCorrections()

template<typename DataT >
void SpaceCharge::subtractGlobalCorrections ( const SpaceCharge< DataT > &  otherSC,
const Side  side 
)

substract global corrections from other sc object (global corrections -= other.global corrections) can be used to calculate the derivative: (this - other)/normalization for normalization see scaleCorrections()

Definition at line 3883 of file SpaceCharge.cxx.

◆ subtractGlobalDistortions()

template<typename DataT >
void SpaceCharge::subtractGlobalDistortions ( const SpaceCharge< DataT > &  otherSC,
const Side  side 
)

substract global distortions from other sc object (global distortions -= other.global distortions) can be used to calculate the derivative: (this - other)/normalization

Definition at line 3891 of file SpaceCharge.cxx.

◆ unsetSimOneSector()

template<typename DataT >
void SpaceCharge::unsetSimOneSector ( )
static

unsetting simulation of one sector

Definition at line 3370 of file SpaceCharge.cxx.


The documentation for this class was generated from the following files: