Skip to content

Commit

Permalink
Merge 1519b94 into sapling-pr-archive-ktf
Browse files Browse the repository at this point in the history
  • Loading branch information
ktf authored Feb 3, 2025
2 parents 2d4e674 + 1519b94 commit aabc407
Show file tree
Hide file tree
Showing 434 changed files with 1,391 additions and 9,669 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,7 @@ class PIDResponse
float mMIP = 50.f;
float mChargeFactor = 2.299999952316284f;

#ifndef GPUCA_ALIROOT_LIB
ClassDefNV(PIDResponse, 1);
#endif
};

GPUd() void PIDResponse::setBetheBlochParams(const float betheBlochParams[5])
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ class Tracklet64
GPUd() float getPadColFloat(bool applyShift) const { return getPositionFloat() + getMCMCol() * constants::NCOLMCM + 8.f + (applyShift ? 1.f : 0.f); }

// pad column number inside pad row as int can be off by +-1 pad (same function name as for TRD digit)
GPUd() int getPadCol(bool applyShift = false) const { return GPUCA_NAMESPACE::gpu::CAMath::Float2IntRn(getPadColFloat(applyShift)); }
GPUd() int getPadCol(bool applyShift = false) const { return o2::gpu::CAMath::Float2IntRn(getPadColFloat(applyShift)); }

// translate local position into global y (in cm) not taking into account calibrations (ExB, vDrift, t0)
GPUd() float getUncalibratedY(bool applyShift = false) const { return (getPadColFloat(applyShift) - (constants::NCOLUMN / 2.f)) * getPadWidth(); }
Expand Down
2 changes: 1 addition & 1 deletion Detectors/AOD/src/AODProducerWorkflowSpec.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -1442,7 +1442,7 @@ void AODProducerWorkflowDPL::countTPCClusters(const o2::globaltracking::RecoCont
o2::tpc::TrackTPC::getClusterReference(tpcClusRefs, i, sectorIndex, rowIndex, clusterIndex, track.getClusterRef());
unsigned int absoluteIndex = tpcClusAcc.clusterOffset[sectorIndex][rowIndex] + clusterIndex;
clMap[rowIndex] = true;
if (tpcClusShMap[absoluteIndex] & GPUCA_NAMESPACE::gpu::GPUTPCGMMergedTrackHit::flagShared) {
if (tpcClusShMap[absoluteIndex] & o2::gpu::GPUTPCGMMergedTrackHit::flagShared) {
if (!shMap[rowIndex]) {
counters.shared++;
}
Expand Down
30 changes: 15 additions & 15 deletions Detectors/GLOQC/include/GLOQC/ITSTPCMatchingQCParams.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,26 +17,26 @@
#include "CommonUtils/ConfigurableParam.h"
#include "CommonUtils/ConfigurableParamHelper.h"

namespace o2
{
namespace gloqc
namespace o2::gloqc
{

// There are configurable params for TPC-ITS matching
struct ITSTPCMatchingQCParams : public o2::conf::ConfigurableParamHelper<ITSTPCMatchingQCParams> {

float minPtITSCut = 0.f;
float etaITSCut = 1e10f;
int nBinsPt = 100;
float minPtITSCut = 0.1;
float etaITSCut = 1.4;
int32_t minNITSClustersCut = 0;
int32_t maxChi2PerClusterITS = 100000;
float minPtTPCCut = 0.1f;
float etaTPCCut = 0.9f;
float maxChi2PerClusterITS = 1e10;
float minPtTPCCut = 0.1;
float etaTPCCut = 1.4;
int32_t minNTPCClustersCut = 60;
float minDCACut = 100.f;
float minDCACutY = 10.f;
float minPtCut = 0.f;
float maxPtCut = 1e10f;
float etaCut = 1.e10f;
float minDCACut = 100.;
float minDCACutY = 10.;
float minPtCut = 0.1;
float maxPtCut = 20;
float etaCut = 1.4;
float etaNo0Cut = 0.05;
float cutK0Mass = 0.05f;
float maxEtaK0 = 0.8f;
float K0Scaling = 1.f;
Expand All @@ -52,7 +52,7 @@ struct ITSTPCMatchingQCParams : public o2::conf::ConfigurableParamHelper<ITSTPCM
O2ParamDef(ITSTPCMatchingQCParams, "ITSTPCMatchingQC");
};

} // namespace gloqc
} // end namespace o2
} // namespace o2::gloqc
// end namespace o2

#endif
81 changes: 38 additions & 43 deletions Detectors/GLOQC/include/GLOQC/MatchITSTPCQC.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,10 @@
#include "DataFormatsGlobalTracking/RecoContainer.h"
#include "Framework/ProcessingContext.h"
#include "SimulationDataFormat/MCCompLabel.h"
#include "SimulationDataFormat/MCTrack.h"
#include "Steer/MCKinematicsReader.h"
#include "ReconstructionDataFormats/PID.h"
#include "DCAFitter/DCAFitterN.h"
#include "GPUO2InterfaceConfiguration.h"
// #include "GPUSettingsO2.h"
#include "GPUParam.h"
#include "GPUParam.inc"

Expand All @@ -56,11 +54,15 @@ struct LblInfo {
class MatchITSTPCQC
{
public:
enum matchType : int { TPC = 0,
ITS,
SIZE };
enum matchType : uint8_t { TPC = 0,
ITS,
SIZE };

MatchITSTPCQC() = default;
MatchITSTPCQC(const MatchITSTPCQC&) = delete;
MatchITSTPCQC(MatchITSTPCQC&&) = delete;
MatchITSTPCQC& operator=(const MatchITSTPCQC&) = delete;
MatchITSTPCQC& operator=(MatchITSTPCQC&&) = delete;
~MatchITSTPCQC();

bool init();
Expand Down Expand Up @@ -136,6 +138,9 @@ class MatchITSTPCQC
TH1D* getHisto1OverPtPhysPrimDen(matchType m) const { return m1OverPtPhysPrimDen[m]; }
TEfficiency* getFractionITSTPCmatchPhysPrim1OverPt(matchType m) const { return mFractionITSTPCmatchPhysPrim1OverPt[m]; }

TH3F* getHistoEtaPhiPtNum(matchType m) const { return mEtaPhiPtNum[m]; }
TH3F* getHistoEtaPhiPtDen(matchType m) const { return mEtaPhiPtDen[m]; }

TH3F* getHistoK0MassVsPtVsOccpp() const { return mK0MassVsPtVsOccpp; }
TH3F* getHistoK0MassVsPtVsOccPbPb() const { return mK0MassVsPtVsOccPbPb; }

Expand Down Expand Up @@ -190,6 +195,10 @@ class MatchITSTPCQC
publisher->startPublishing(m1OverPtDen[i]);
publisher->startPublishing(mFractionITSTPCmatch1OverPt[i]);

// 3D eta/phi/pt
publisher->startPublishing(mEtaPhiPtNum[i]);
publisher->startPublishing(mEtaPhiPtDen[i]);

if (mUseTrkPID) { // Vs Tracking PID hypothesis
for (int j = 0; j < o2::track::PID::NIDs; ++j) {
// Pt
Expand Down Expand Up @@ -253,14 +262,14 @@ class MatchITSTPCQC
// ITS track
void setMinPtITSCut(float v) { mPtITSCut = v; };
void setEtaITSCut(float v) { mEtaITSCut = v; }; // TODO: define 2 different values for min and max (**)
void setMinNClustersITS(float v) { mMinNClustersITS = v; }
void setMinNClustersITS(int v) { mMinNClustersITS = v; }
void setMaxChi2PerClusterITS(float v) { mMaxChi2PerClusterITS = v; }
// TO DO: define an agreed way to implement the setter for ITS matching (min. # layers, which layers)
// [...] --> exploit the method TrackCuts::setRequireHitsInITSLayers(...)
// TPC track
void setMinPtTPCCut(float v) { mPtTPCCut = v; };
void setEtaTPCCut(float v) { mEtaTPCCut = v; }; // TODO: define 2 different values for min and max (***)
void setMinNTPCClustersCut(float v) { mNTPCClustersCut = v; }
void setMinNTPCClustersCut(int v) { mNTPCClustersCut = v; }
void setMinDCAtoBeamPipeCut(std::array<float, 2> v)
{
setMinDCAtoBeamPipeDistanceCut(v[0]);
Expand All @@ -269,9 +278,11 @@ class MatchITSTPCQC
void setMinDCAtoBeamPipeDistanceCut(float v) { mDCATPCCut = v; }
void setMinDCAtoBeamPipeYCut(float v) { mDCATPCCutY = v; }
// ITS-TPC kinematics
void setNBinsPt(int v) { mPtBins = v; }
void setPtCut(float v) { mPtCut = v; }
void setMaxPtCut(float v) { mPtMaxCut = v; }
void setEtaCut(float v) { mEtaCut = v; } // TODO: define 2 different values for min and max (*)
void setEtaCut(float v) { mEtaCut = v; }
void setEtaNo0Cut(float v) { mEtaNo0Cut = v; }

// K0
void setMaxK0Eta(float v) { mMaxEtaK0 = v; }
Expand All @@ -286,33 +297,11 @@ class MatchITSTPCQC
void setK0Scaling(float v) { mK0Scaling = v; }
float getK0Scaling() const { return mK0Scaling; }
void setK0MaxDCA(float v) { mK0MaxDCA = v; }
float getK0MaxDCA() { return mK0MaxDCA; }
float getK0MaxDCA() const { return mK0MaxDCA; }
void setK0MinCosPA(float v) { mK0MinCosPA = v; }
float getK0MinCosPA() const { return mK0MinCosPA; }

void printParams()
{
LOG(info) << "minPtITSCut = " << mPtITSCut;
LOG(info) << "etaITSCut = " << mEtaITSCut;
LOG(info) << "minNITSClustersCut = " << mMinNClustersITS;
LOG(info) << "maxChi2PerClusterITS = " << mMaxChi2PerClusterITS;
LOG(info) << "minPtTPCCut = " << mPtTPCCut;
LOG(info) << "etaTPCCut = " << mEtaTPCCut;
LOG(info) << "minNTPCClustersCut = " << mNTPCClustersCut;
LOG(info) << "minDCACut = " << mDCATPCCut;
LOG(info) << "minDCACutY = " << mDCATPCCutY;
LOG(info) << "minPtCut = " << mPtCut;
LOG(info) << "maxPtCut = " << mPtMaxCut;
LOG(info) << "etaCut = " << mEtaCut;
LOG(info) << "cutK0Mass = " << mCutK0Mass;
LOG(info) << "maxEtaK0 = " << mMaxEtaK0;
LOG(info) << "minTPCOccpp = " << mMinTPCOccpp;
LOG(info) << "maxTPCOccpp = " << mMaxTPCOccpp;
LOG(info) << "nBinsTPCOccpp = " << mNBinsTPCOccpp;
LOG(info) << "minTPCOccPbPb = " << mMinTPCOccPbPb;
LOG(info) << "maxTPCOccPbPb = " << mMaxTPCOccPbPb;
LOG(info) << "nBinsTPCOccPbPb = " << mNBinsTPCOccPbPb;
}
void printParams() const;

private:
std::shared_ptr<o2::globaltracking::DataRequest> mDataRequest;
Expand Down Expand Up @@ -406,31 +395,37 @@ class MatchITSTPCQC
TH1D* m1OverPtPhysPrimNum[matchType::SIZE] = {};
TH1D* m1OverPtPhysPrimDen[matchType::SIZE] = {};
TEfficiency* mFractionITSTPCmatchPhysPrim1OverPt[matchType::SIZE] = {};
// 3D Efficiency in eta/phi/pt
TH3F* mEtaPhiPtNum[matchType::SIZE] = {};
TH3F* mEtaPhiPtDen[matchType::SIZE] = {};

void setEfficiency(TEfficiency* eff, TH1* hnum, TH1* hden, bool is2D = false);
template <int DIM = 1, bool DEBUG = false>
void setEfficiency(TEfficiency* eff, TH1* hnum, TH1* hden);

int mNTPCSelectedTracks = 0;
int mNITSSelectedTracks = 0;
int mNITSTPCSelectedTracks[matchType::SIZE] = {0, 0};

// cut values
// ITS track
float mPtITSCut = 0.f; // min pT for ITS track
float mEtaITSCut = 1e10f; // eta window for ITS track --> TODO: define 2 different values for min and max (**)
int mMinNClustersITS = 0; // min number of ITS clusters
float mMaxChi2PerClusterITS{1e10f}; // max its fit chi2 per ITS cluster
std::vector<std::pair<int8_t, std::set<uint8_t>>> mRequiredITSHits{}; // vector of ITS requirements (minNRequiredHits in specific requiredLayers)
float mPtITSCut = 0.1f; // min pT for ITS track
float mEtaITSCut = 1.4f; // eta window for ITS track --> TODO: define 2 different values for min and max (**)
int mMinNClustersITS = 0; // min number of ITS clusters
float mMaxChi2PerClusterITS{1e10f}; // max its fit chi2 per ITS cluster
std::vector<std::pair<int8_t, std::set<uint8_t>>> mRequiredITSHits; // vector of ITS requirements (minNRequiredHits in specific requiredLayers)
// TPC track
float mPtTPCCut = 0.1f; // min pT for TPC track
float mEtaTPCCut = 1.4f; // eta window for TPC track --> TODO: define 2 different values for min and max (***)
int32_t mNTPCClustersCut = 60; // minimum number of TPC clusters for TPC track
float mDCATPCCut = 100.f; // max DCA 3D to PV for TPC track
float mDCATPCCutY = 10.f; // max DCA xy to PV for TPC track
// ITS-TPC kinematics
int mPtBins = 100;
float mPtCut = 0.1f;
float mPtMaxCut = 1e10f;
float mEtaCut = 1e10f; // 1e10f as defaults of Detectors/GlobalTracking/include/GlobalTracking/TrackCuts.h
// TODO: define 2 different values for min and max (*)
float mPtMaxCut = 20;
float mEtaCut = 1.4f;
float mEtaNo0Cut = 0.05f;
// TODO: define 2 different values for min and max (*)

// for V0s
o2::vertexing::DCAFitterN<2> mFitterV0;
Expand All @@ -447,7 +442,7 @@ class MatchITSTPCQC
std::shared_ptr<o2::gpu::GPUParam> mParam = nullptr;
int mNHBPerTF = 0;
int mNTPCOccBinLength = 0; ///< TPC occ. histo bin length in TBs
float mNTPCOccBinLengthInv;
float mNTPCOccBinLengthInv{};
std::vector<float> mTBinClOcc; ///< TPC occupancy histo: i-th entry is the integrated occupancy for ~1 orbit starting from the TB = i*mNTPCOccBinLength
gsl::span<const unsigned int> mTPCRefitterOccMap; ///< externally set TPC clusters occupancy map
bool mIsHI = false;
Expand All @@ -462,7 +457,7 @@ class MatchITSTPCQC
float mK0MaxDCA = 0.01; // max DCA to select the K0
float mK0MinCosPA = 0.995; // min cosPA to select the K0

ClassDefNV(MatchITSTPCQC, 3);
ClassDefNV(MatchITSTPCQC, 4);
};
} // namespace gloqc
} // namespace o2
Expand Down
Loading

0 comments on commit aabc407

Please sign in to comment.