12#define _USE_MATH_DEFINES
47 TH1::AddDirectory(
false);
51 mMapHist[
"sharedClustersOverClusters"].emplace_back(std::make_unique<TH1F>(
"sharedClustersOverClusters",
"sharedClustersOverClusters;NSharedClusters/NClusters;Entries",
binsRatio.
bins,
binsRatio.
min,
binsRatio.
max));
52 mMapHist[
"clustersOverCrossedRow"].emplace_back(std::make_unique<TH1F>(
"clustersOverCrossedRow",
"clustersOverCrossedRow;NClusters/NCrossedRows;Entries",
binsRatio.
bins,
binsRatio.
min,
binsRatio.
max));
58 for (
const auto& pair : mMapHist) {
59 for (
auto& hist : pair.second) {
69 std::vector<unsigned char> mBufVec;
74 for (
auto const& track : (*tracks)) {
75 const auto dEdxTot = track.getdEdx().dEdxTotTPC;
76 const auto nCls = uint8_t(track.getNClusters());
77 const auto eta = track.getEta();
79 if (nCls < mCutMinNCls || dEdxTot < mCutMindEdxTot || std::fabs(eta) > mCutAbsEta) {
83 uint8_t shared = 200, found = 0, crossed = 0;
87 mMapHist[
"clusters"][0]->Fill(found);
88 mMapHist[
"sharedClusters"][0]->Fill(shared);
89 mMapHist[
"crossedRows"][0]->Fill(crossed);
90 mMapHist[
"sharedClustersOverClusters"][0]->Fill(
static_cast<float>(shared) /
static_cast<float>(found));
91 mMapHist[
"clustersOverCrossedRow"][0]->Fill(
static_cast<float>(found) /
static_cast<float>(crossed));
100 auto f = std::unique_ptr<TFile>(TFile::Open(
filename.c_str(),
"recreate"));
101 for (
const auto& [
name, histos] : mMapHist) {
103 arr.SetName(
name.data());
104 for (
auto& hist : histos) {
107 arr.Write(arr.GetName(), TObject::kSingleKey);
const binning binsCrossedRows
const binning binsClusters
const binning binsFoundClusters
const binning binsSharedClusters
ClassImp(o2::tpc::qc::TrackClusters)
static void countTPCClusters(const o2::tpc::TrackTPC &track, const gsl::span< const o2::tpc::TPCClRefElem > &tpcClusRefs, const gsl::span< const unsigned char > &tpcClusShMap, const o2::tpc::ClusterNativeAccess &tpcClusAcc, uint8_t &shared, uint8_t &found, uint8_t &crossed)
static void fillSharedClustersAndOccupancyMap(const o2::tpc::ClusterNativeAccess *cl, const gsl::span< const o2::tpc::TrackTPC > trks, const o2::tpc::TPCClRefElem *trackRef, uint8_t *shmap, uint32_t *ocmap=nullptr, uint32_t nHbfPerTf=0, const GPUParam *param=nullptr)
Shared cluster and crossed rows TPC quality control task.
void dumpToFile(std::string filename)
Dump results to a file.
void initializeHistograms()
Initialize all histograms.
void resetHistograms()
Reset all histograms.
bool processTrackAndClusters(const std::vector< o2::tpc::TrackTPC > *tracks, const o2::tpc::ClusterNativeAccess *clusterIndex, std::vector< o2::tpc::TPCClRefElem > *clusRefs)
GLuint const GLchar * name
unsigned int nClustersTotal