17#ifndef AliceO2_TPC_CalibPadGainTracks_H
18#define AliceO2_TPC_CalibPadGainTracks_H
38class GPUO2InterfaceRefit;
39class CorrectionMapsHelper;
45class ClusterNativeAccess;
107 void setMembers(gsl::span<const o2::tpc::TrackTPC>* vTPCTracksArrayInp, gsl::span<const o2::tpc::TPCClRefElem>* tpcTrackClIdxVecInput,
const o2::tpc::ClusterNativeAccess& clIndex, gsl::span<const unsigned char> TPCRefitterShMap, gsl::span<const unsigned int> TPCRefitterOccMap);
128 void doNotNomalize(
const bool doNotNormCharge) { mDoNotNormCharge = doNotNormCharge; }
145 void setRefGainMap(
const char* inpFile,
const char* mapName);
184 void dumpToFile(
const char* outFileName =
"calPadGainTracks.root",
const char* outName =
"calPadGain")
const;
220 gsl::span<const TrackTPC>* mTracks{
nullptr};
221 gsl::span<const TPCClRefElem>* mTPCTrackClIdxVecInput{
nullptr};
223 gsl::span<const unsigned char> mTPCRefitterShMap;
224 gsl::span<const unsigned int> mTPCRefitterOccMap;
225 std::vector<unsigned char> mBufVec;
228 float mFieldNominalGPUBz{-5};
232 float mDedxMax{-1.f};
234 float mTPCVDriftRef = -1.;
235 float mTPCVDriftCorrFact = 1.;
236 float mTPCVDrift = -1.;
237 float mTPCDriftTimeOffset = 0.;
238 int mMinClusters{50};
239 bool mPropagateTrack{
false};
240 bool mDoNotNormCharge{
false};
243 std::vector<std::vector<float>> mDEdxBuffer{};
244 std::vector<std::tuple<unsigned char, unsigned char, unsigned char, float>> mClTrk;
245 std::vector<float> mDedxTmp{};
246 std::unique_ptr<CalPad> mGainMapRef;
247 std::unique_ptr<CalibdEdxTrackTopologyPol> mCalibTrackTopologyPol;
269 void getTruncMean(
float low = 0.05f,
float high = 0.6f);
272 void drawRefGainMapHelper(
const bool type,
const Sector
sector,
const std::string
filename,
const float minZ,
const float maxZ)
const;
275 void reserveMemory();
277 void resizedEdxBuffer();
279 int getdEdxBufferIndex(
const int region)
const;
281 float getdEdxIROC(
const dEdxInfo& dedx)
const {
return (mChargeType ==
ChargeType::Max) ?
dedx.dEdxMaxIROC :
dedx.dEdxTotIROC; }
282 float getdEdxOROC1(
const dEdxInfo& dedx)
const {
return (mChargeType ==
ChargeType::Max) ?
dedx.dEdxMaxOROC1 :
dedx.dEdxTotOROC1; }
283 float getdEdxOROC2(
const dEdxInfo& dedx)
const {
return (mChargeType ==
ChargeType::Max) ?
dedx.dEdxMaxOROC2 :
dedx.dEdxTotOROC2; }
284 float getdEdxOROC3(
const dEdxInfo& dedx)
const {
return (mChargeType ==
ChargeType::Max) ?
dedx.dEdxMaxOROC3 :
dedx.dEdxTotOROC3; }
285 float getdEdxTPC(
const dEdxInfo& dedx)
const {
return (mChargeType ==
ChargeType::Max) ?
dedx.dEdxMaxTPC :
dedx.dEdxTotTPC; }
base class for the pad-by-pad residual gain calibration this class can be used to store for each pad ...
@ region
normalization per region
void setTPCCorrMaps(o2::gpu::CorrectionMapsHelper *maph)
set cluster correction maps helper
void setTPCVDrift(const o2::tpc::VDriftCorrFact &v)
set VDrift correction
void setPolTopologyCorrectionFromContainer(const CalibdEdxTrackTopologyPolContainer &polynomials)
void doNotNomalize(const bool doNotNormCharge)
void setdEdxMin(const float mindedx)
void setMomentumRange(const float momMin, const float momMax)
~CalibPadGainTracks()=default
default destructor
void setRefGainMap(const char *inpFile, const char *mapName)
void loadPolTopologyCorrectionFromFile(std::string_view fileName)
void processTracks(const int nMaxTracks=-1)
void setdEdxMax(const float maxdEdx)
void setFieldNominalGPUBz(const float field)
bool getdoNotNomalize() const
float getFieldNominalGPUBz() const
bool getPropagateTrack() const
void setdEdxRegion(const DEdxRegion dedx)
set how the dedx is calculated which is used for normalizing the cluster charge
@ sector
use the dE/dx from the whole sector
@ chamber
use the dE/dx from IROC and OROC
@ stack
use the dE/dx from IROC, OROC1, OROC2, OROC3
float getMinNClusters() const
void setPropagateTrack(const bool propagate)
void drawReferenceGainMapSector(const int sector, const std::string filename="GainMapSector.pdf", const float minZ=0, const float maxZ=-1) const
CalibPadGainTracks(const bool initCalPad=true)
void setMaxEta(const float eta)
void setMinNClusters(const int nCl)
void setRefGainMap(const CalPad &gainmap)
DEdxType
mode of normalizing qmax
@ dedxTrack
normalize qMax using the truncated mean from the track
@ dedxTracking
normalize qMax using the dEdx which was calculated during the tracking
@ dedxBB
normalize qMax by evaluating a Bethe Bloch fit. THIS is yet not implemented and shouldnt be used.
void setChargeType(const ChargeType chargeType)
void dumpToFile(const char *outFileName="calPadGainTracks.root", const char *outName="calPadGain") const
void setMembers(gsl::span< const o2::tpc::TrackTPC > *vTPCTracksArrayInp, gsl::span< const o2::tpc::TPCClRefElem > *tpcTrackClIdxVecInput, const o2::tpc::ClusterNativeAccess &clIndex, gsl::span< const unsigned char > TPCRefitterShMap, gsl::span< const unsigned int > TPCRefitterOccMap)
void drawReferenceGainMapSide(const o2::tpc::Side side, const std::string filename="GainMapSide.pdf", const float minZ=0, const float maxZ=-1) const
void setMode(DEdxType iMode)
void dumpReferenceExtractedGainMap(const char *outFileName="GainMapRefExtracted.root", const char *outName="GainMap") const
static constexpr int MAXSECTOR
GLint GLint GLsizei GLint GLenum GLenum type
GLfloat GLfloat GLfloat GLfloat GLfloat GLfloat maxZ
PadSubset
Definition of the different pad subsets.
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...
simple struct to enable writing the MultivariatePolynomialCT to file