Skip to content

Commit 55a67d2

Browse files
Adding classes to calculate the space charge distortions and corrections (#4618)
* Adding classes to calculate the space charge distortions and corrections The distortions and corrections can be calculated by using the potential from a 3D histogram or an analytical formula as an input. These classes are much faster and consistent than the old methods located in GPU/TPCSpaceChargeBase. The old folder (GPU/TPCSpaceChargeBase) where all the previous classes were stored are deleted and all other classes and macros which used the old spacecharge classes are modified to be able to use the new spacecharge classes. * moved CGAL includes to base class * moved global objects in NearestNeighbour src file to own class * adding more grid sizes for calculation of distortions/corrections * fixed createResidualDistortionObject.C macro for new space charge classes and moved to space charge folder * clang format * changed macro calculateDistortionsCorrections.C to compile only * fixed z coordinate in distortElectron * removed CGAL package and replaced nearest neighbour searching by approximation of nearest neighbour
1 parent 6e54e78 commit 55a67d2

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+7889
-13348
lines changed

Detectors/TPC/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,4 @@ add_subdirectory(simulation)
1515
add_subdirectory(monitor)
1616
add_subdirectory(workflow)
1717
add_subdirectory(qc)
18+
add_subdirectory(spacecharge)

Detectors/TPC/reconstruction/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ o2_add_test_root_macro(macro/createTPCSpaceChargeCorrection.C
123123
PUBLIC_LINK_LIBRARIES O2::TPCReconstruction
124124
O2::CommonConstants
125125
O2::CommonUtils
126-
O2::TPCSpaceChargeBase
126+
O2::TPCSpaceCharge
127127
LABELS tpc)
128128

129129
o2_add_test_root_macro(macro/findKrBoxCluster.C

Detectors/TPC/reconstruction/macro/createTPCSpaceChargeCorrection.C

Lines changed: 63 additions & 111 deletions
Large diffs are not rendered by default.

Detectors/TPC/simulation/CMakeLists.txt

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,8 @@ o2_add_library(TPCSimulation
2121
src/PadResponse.cxx
2222
src/Point.cxx
2323
src/SAMPAProcessing.cxx
24-
src/SpaceCharge.cxx
2524
PUBLIC_LINK_LIBRARIES O2::DetectorsBase O2::SimulationDataFormat
26-
O2::TPCBase O2::TPCSpaceChargeBase
25+
O2::TPCBase O2::TPCSpaceCharge
2726
ROOT::Physics)
2827

2928
o2_target_root_dictionary(TPCSimulation
@@ -38,8 +37,7 @@ o2_target_root_dictionary(TPCSimulation
3837
include/TPCSimulation/GEMAmplification.h
3938
include/TPCSimulation/PadResponse.h
4039
include/TPCSimulation/Point.h
41-
include/TPCSimulation/SAMPAProcessing.h
42-
include/TPCSimulation/SpaceCharge.h)
40+
include/TPCSimulation/SAMPAProcessing.h)
4341

4442
o2_add_executable(digits-to-rawzs
4543
COMPONENT_NAME tpc
@@ -57,13 +55,6 @@ if(BUILD_TESTING)
5755
O2::SimulationDataFormat
5856
LABELS tpc)
5957

60-
o2_add_test_root_macro(macro/createResidualDistortionObject.C
61-
PUBLIC_LINK_LIBRARIES O2::TPCSpaceChargeBase
62-
O2::CommonUtils
63-
O2::CommonConstants
64-
O2::TPCSimulation
65-
LABELS tpc)
66-
6758
o2_add_test_root_macro(macro/laserTrackGenerator.C
6859
PUBLIC_LINK_LIBRARIES FairRoot::Base
6960
O2::DataFormatsTPC

Detectors/TPC/simulation/include/TPCSimulation/Digitizer.h

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
#include "TPCSimulation/DigitContainer.h"
1919
#include "TPCSimulation/PadResponse.h"
2020
#include "TPCSimulation/Point.h"
21-
#include "TPCSimulation/SpaceCharge.h"
21+
#include "TPCSpaceCharge/SpaceCharge.h"
2222

2323
#include "TPCBase/Mapper.h"
2424

@@ -52,6 +52,8 @@ class DigitContainer;
5252
class Digitizer
5353
{
5454
public:
55+
using SC = SpaceCharge<double, 129, 129, 180>;
56+
5557
/// Default constructor
5658
Digitizer() = default;
5759

@@ -109,20 +111,24 @@ class Digitizer
109111
/// \param nZSlices number of grid points in z, must be (2**N)+1
110112
/// \param nPhiBins number of grid points in phi
111113
/// \param nRBins number of grid points in r, must be (2**N)+1
112-
void setUseSCDistortions(SpaceCharge::SCDistortionType distortionType, const TH3* hisInitialSCDensity, int nRBins, int nPhiBins, int nZSlices);
114+
void setUseSCDistortions(SC::SCDistortionType distortionType, const TH3* hisInitialSCDensity);
113115
/// Enable the use of space-charge distortions and provide SpaceCharge object as input
114116
/// \param spaceCharge unique pointer to spaceCharge object
115-
void setUseSCDistortions(SpaceCharge* spaceCharge);
117+
void setUseSCDistortions(SC* spaceCharge);
118+
119+
/// Enable the use of space-charge distortions by providing global distortions and global corrections stored in a ROOT file
120+
/// The storage of the values should be done by the methods provided in the SpaceCharge class
121+
/// \param TFile file containing distortions and corrections
122+
void setUseSCDistortions(TFile& finp);
116123

117124
private:
118-
DigitContainer mDigitContainer; ///< Container for the Digits
119-
std::unique_ptr<SpaceCharge> mSpaceCharge; ///< Handler of space-charge distortions
120-
Sector mSector = -1; ///< ID of the currently processed sector
121-
float mEventTime = 0.f; ///< Time of the currently processed event
125+
DigitContainer mDigitContainer; ///< Container for the Digits
126+
std::unique_ptr<SC> mSpaceCharge; ///< Handler of space-charge distortions
127+
Sector mSector = -1; ///< ID of the currently processed sector
128+
float mEventTime = 0.f; ///< Time of the currently processed event
122129
// FIXME: whats the reason for hving this static?
123130
static bool mIsContinuous; ///< Switch for continuous readout
124131
bool mUseSCDistortions = false; ///< Flag to switch on the use of space-charge distortions
125-
126132
ClassDefNV(Digitizer, 1);
127133
};
128134
} // namespace tpc

Detectors/TPC/simulation/include/TPCSimulation/SpaceCharge.h

Lines changed: 0 additions & 244 deletions
This file was deleted.

0 commit comments

Comments
 (0)