17#ifndef AliceO2_TPC_CalibPadGainTracks_H
18#define AliceO2_TPC_CalibPadGainTracks_H
37class GPUO2InterfaceRefit;
38class TPCFastTransformPOD;
44class ClusterNativeAccess;
106 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);
127 void doNotNomalize(
const bool doNotNormCharge) { mDoNotNormCharge = doNotNormCharge; }
144 void setRefGainMap(
const char* inpFile,
const char* mapName);
183 void dumpToFile(
const char* outFileName =
"calPadGainTracks.root",
const char* outName =
"calPadGain")
const;
219 gsl::span<const TrackTPC>* mTracks{
nullptr};
220 gsl::span<const TPCClRefElem>* mTPCTrackClIdxVecInput{
nullptr};
222 gsl::span<const unsigned char> mTPCRefitterShMap;
223 gsl::span<const unsigned int> mTPCRefitterOccMap;
224 std::vector<unsigned char> mBufVec;
227 float mFieldNominalGPUBz{-5};
231 float mDedxMax{-1.f};
233 float mTPCVDriftRef = -1.;
234 float mTPCVDriftCorrFact = 1.;
235 float mTPCVDrift = -1.;
236 float mTPCDriftTimeOffset = 0.;
237 int mMinClusters{50};
238 bool mPropagateTrack{
false};
239 bool mDoNotNormCharge{
false};
242 std::vector<std::vector<float>> mDEdxBuffer{};
243 std::vector<std::tuple<unsigned char, unsigned char, unsigned char, float>> mClTrk;
244 std::vector<float> mDedxTmp{};
245 std::unique_ptr<CalPad> mGainMapRef;
246 std::unique_ptr<CalibdEdxTrackTopologyPol> mCalibTrackTopologyPol;
268 void getTruncMean(
float low = 0.05f,
float high = 0.6f);
271 void drawRefGainMapHelper(
const bool type,
const Sector
sector,
const std::string
filename,
const float minZ,
const float maxZ)
const;
274 void reserveMemory();
276 void resizedEdxBuffer();
278 int getdEdxBufferIndex(
const int region)
const;
280 float getdEdxIROC(
const dEdxInfo& dedx)
const {
return (mChargeType ==
ChargeType::Max) ?
dedx.dEdxMaxIROC :
dedx.dEdxTotIROC; }
281 float getdEdxOROC1(
const dEdxInfo& dedx)
const {
return (mChargeType ==
ChargeType::Max) ?
dedx.dEdxMaxOROC1 :
dedx.dEdxTotOROC1; }
282 float getdEdxOROC2(
const dEdxInfo& dedx)
const {
return (mChargeType ==
ChargeType::Max) ?
dedx.dEdxMaxOROC2 :
dedx.dEdxTotOROC2; }
283 float getdEdxOROC3(
const dEdxInfo& dedx)
const {
return (mChargeType ==
ChargeType::Max) ?
dedx.dEdxMaxOROC3 :
dedx.dEdxTotOROC3; }
284 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 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 setTPCCorrMaps(const o2::gpu::TPCFastTransformPOD *maph)
set cluster correction maps helper
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