Skip to content

Commit

Permalink
Merge branch 'AliceO2Group:master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
Archita-Dash authored Dec 12, 2024
2 parents 93c926d + a8d5ca2 commit b7fc704
Show file tree
Hide file tree
Showing 37 changed files with 1,469 additions and 918 deletions.
5 changes: 5 additions & 0 deletions Common/TableProducer/Converters/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -88,3 +88,8 @@ o2physics_add_dpl_workflow(trackqa-converter
SOURCES trackQAConverter.cxx
PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore
COMPONENT_NAME Analysis)

o2physics_add_dpl_workflow(trackqa-converter-002
SOURCES trackQA002Converter.cxx
PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore
COMPONENT_NAME Analysis)
97 changes: 97 additions & 0 deletions Common/TableProducer/Converters/trackQA002Converter.cxx
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
// Copyright 2019-2020 CERN and copyright holders of ALICE O2.
// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
// All rights not expressly granted are reserved.
//
// This software is distributed under the terms of the GNU General Public
// License v3 (GPL Version 3), copied verbatim in the file "COPYING".
//
// In applying this license CERN does not waive the privileges and immunities
// granted to it by virtue of its status as an Intergovernmental Organization
// or submit itself to any jurisdiction.
#include <limits>

#include "Framework/runDataProcessing.h"
#include "Framework/AnalysisTask.h"
#include "Framework/AnalysisDataModel.h"

using namespace o2;
using namespace o2::framework;

struct TrackQAConverter002 {
Produces<aod::TracksQA_002> tracksQA_002;

void process000(aod::TracksQA_000 const& tracksQA_002)
{
for (const auto& trackQA : tracksQA_000) {
tracksQA_002(
trackQA.trackId(),
trackQA.tpcTime0(),
trackQA.tpcdcaR(),
trackQA.tpcdcaZ(),
trackQA.tpcClusterByteMask(),
trackQA.tpcdEdxMax0R(),
trackQA.tpcdEdxMax1R(),
trackQA.tpcdEdxMax2R(),
trackQA.tpcdEdxMax3R(),
trackQA.tpcdEdxTot0R(),
trackQA.tpcdEdxTot1R(),
trackQA.tpcdEdxTot2R(),
trackQA.tpcdEdxTot3R(),
// dummy values, not available in _000
std::numeric_limits<int8_t>::min(), // deltaRefContParamY
std::numeric_limits<int8_t>::min(), // deltaRefContParamZ
std::numeric_limits<int8_t>::min(), // deltaRefContParamSnp
std::numeric_limits<int8_t>::min(), // deltaRefContParamTgl
std::numeric_limits<int8_t>::min(), // deltaRefContParamQ2Pt
std::numeric_limits<int8_t>::min(), // deltaRefGloParamY
std::numeric_limits<int8_t>::min(), // deltaRefGloParamZ
std::numeric_limits<int8_t>::min(), // deltaRefGloParamSnp
std::numeric_limits<int8_t>::min(), // deltaRefGloParamTgl
std::numeric_limits<int8_t>::min(), // deltaRefGloParamQ2Pt
std::numeric_limits<int8_t>::min(), // dTofdX
std::numeric_limits<int8_t>::min()); // dTofdY
}
}
PROCESS_SWITCH(TrackQAConverter002, process000, "process v000-to-v002 conversion", false);

void process001(aod::TracksQA_001 const& tracksQA_002)
{
for (const auto& trackQA : tracksQA_001) {
tracksQA_002(
trackQA.trackId(),
trackQA.tpcTime0(),
trackQA.tpcdcaR(),
trackQA.tpcdcaZ(),
trackQA.tpcClusterByteMask(),
trackQA.tpcdEdxMax0R(),
trackQA.tpcdEdxMax1R(),
trackQA.tpcdEdxMax2R(),
trackQA.tpcdEdxMax3R(),
trackQA.tpcdEdxTot0R(),
trackQA.tpcdEdxTot1R(),
trackQA.tpcdEdxTot2R(),
trackQA.tpcdEdxTot3R(),
trackQA.deltaRefContParamY(),
trackQA.deltaRefITSParamZ(),
trackQA.deltaRefContParamSnp(),
trackQA.deltaRefContParamTgl(),
trackQA.deltaRefContParamQ2Pt(),
trackQA.deltaRefGloParamY(),
trackQA.deltaRefGloParamZ(),
trackQA.deltaRefGloParamSnp(),
trackQA.deltaRefGloParamTgl(),
trackQA.deltaRefGloParamQ2Pt(),
// dummy values, not available in _001
std::numeric_limits<int8_t>::min(), // dTofdX
std::numeric_limits<int8_t>::min()); // dTofdY
}
}
PROCESS_SWITCH(TrackQAConverter002, process001, "process v001-to-v002 conversion", false);
};

WorkflowSpec defineDataProcessing(ConfigContext const& cfgc)
{
return WorkflowSpec{
adaptAnalysisTask<TrackQAConverter002>(cfgc),
};
}
44 changes: 27 additions & 17 deletions PWGCF/Flow/TableProducer/zdcQVectors.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,7 @@ struct ZdcQVectors {
for (int step = 0; step < 6; step++) {
registry.add<TH2>(Form("step%i/QA/hSPplaneA", step), "hSPplaneA", kTH2D, {{100, -4, 4}, axisCent10});
registry.add<TH2>(Form("step%i/QA/hSPplaneC", step), "hSPplaneC", kTH2D, {{100, -4, 4}, axisCent10});
registry.add<TH2>(Form("step%i/QA/hSPplaneFull", step), "hSPplaneFull", kTH2D, {{100, -4, 4}, axisCent10});
for (const auto& side : sides) {
hQxvsQy[step] = registry.add<TH2>(Form("step%i/hZN%s_Qx_vs_Qy", step, side), Form("hZN%s_Qx_vs_Qy", side), kTH2F, {axisQ, axisQ});
}
Expand Down Expand Up @@ -328,6 +329,14 @@ struct ZdcQVectors {
registry.fill(HIST("step0/QA/hQXC_vs_vz"), v[2], q[0][0][2]);
registry.fill(HIST("step0/QA/hQYC_vs_vz"), v[2], q[0][0][3]);

// add psi!!
double psiA = 1.0 * std::atan2(q[0][0][2], q[0][0][0]);
registry.fill(HIST("step0/QA/hSPplaneA"), psiA, centrality, 1);
double psiC = 1.0 * std::atan2(q[0][0][3], q[0][0][1]);
registry.fill(HIST("step0/QA/hSPplaneC"), psiC, centrality, 1);
double psiFull = 1.0 * std::atan2(q[0][0][2] + q[0][0][3], q[0][0][0] + q[0][0][1]);
registry.fill(HIST("step0/QA/hSPplaneFull"), psiFull, centrality, 1);

static constexpr std::string_view SubDir[] = {"step1/", "step2/", "step3/", "step4/", "step5/"};
static_for<0, 4>([&](auto Ind) {
constexpr int Index = Ind.value;
Expand Down Expand Up @@ -361,11 +370,12 @@ struct ZdcQVectors {
registry.fill(HIST(SubDir[Index]) + HIST("QA/hQXC_vs_vz"), v[2], q[iteration][indexRt][2]);
registry.fill(HIST(SubDir[Index]) + HIST("QA/hQYC_vs_vz"), v[2], q[iteration][indexRt][3]);

// add psi!!
double psiA = 1.0 * std::atan2(q[iteration][indexRt][2], q[iteration][indexRt][0]);
psiA = 1.0 * std::atan2(q[iteration][indexRt][2], q[iteration][indexRt][0]);
registry.fill(HIST(SubDir[Index]) + HIST("QA/hSPplaneA"), psiA, centrality, 1);
double psiC = 1.0 * std::atan2(q[iteration][indexRt][3], q[iteration][indexRt][1]);
psiC = 1.0 * std::atan2(q[iteration][indexRt][3], q[iteration][indexRt][1]);
registry.fill(HIST(SubDir[Index]) + HIST("QA/hSPplaneC"), psiC, centrality, 1);
psiFull = 1.0 * std::atan2(q[iteration][indexRt][2] + q[iteration][indexRt][3], q[iteration][indexRt][0] + q[iteration][indexRt][1]);
registry.fill(HIST(SubDir[Index]) + HIST("QA/hSPplaneFull"), psiFull, centrality, 1);
});
}

Expand Down Expand Up @@ -471,20 +481,17 @@ struct ZdcQVectors {
} else if (hist->InheritsFrom("THnSparse")) {
std::vector<int> sparsePars;
THnSparseD* h = reinterpret_cast<THnSparseD*>(hist);
if (step == 0 && iteration > 0) {
// Axis(0) is runnuber, but we don't need this
sparsePars.push_back(h->GetAxis(1)->FindBin(centrality));
sparsePars.push_back(h->GetAxis(2)->FindBin(v[0]));
sparsePars.push_back(h->GetAxis(3)->FindBin(v[1]));
sparsePars.push_back(h->GetAxis(4)->FindBin(v[2]));
}
sparsePars.push_back(h->GetAxis(0)->FindBin(centrality));
sparsePars.push_back(h->GetAxis(1)->FindBin(v[0]));
sparsePars.push_back(h->GetAxis(2)->FindBin(v[1]));
sparsePars.push_back(h->GetAxis(3)->FindBin(v[2]));

for (std::size_t i = 0; i < sparsePars.size() + 1; i++) {
h->GetAxis(i + 1)->SetRange(sparsePars[i], sparsePars[i]);
for (std::size_t i = 0; i < sparsePars.size(); i++) {
h->GetAxis(i)->SetRange(sparsePars[i], sparsePars[i]);
}
calibConstant = h->Projection(5)->GetMean();
calibConstant = h->Projection(4)->GetMean();

if (h->Projection(sparsePars.size())->GetEntries() < cfgMinEntriesSparseBin) {
if (h->Projection(4)->GetEntries() < cfgMinEntriesSparseBin) {
LOGF(debug, "1 entry in sparse bin! Not used... (increase binsize)");
calibConstant = 0;
isSelected = false;
Expand Down Expand Up @@ -694,7 +701,8 @@ struct ZdcQVectors {
if (cal.atIteration == 0) {
if (counter < 1)
LOGF(warning, "Calibation files missing!!! Output created with q-vectors right after energy gain eq. !!");
fillAllRegistries(0, 0);
if (isSelected)
fillAllRegistries(0, 0);
spTableZDC(runnumber, centrality, v[0], v[1], v[2], q[0][0][0], q[0][0][1], q[0][0][2], q[0][0][3], isSelected, 0, 0);
counter++;
return;
Expand Down Expand Up @@ -722,8 +730,10 @@ struct ZdcQVectors {

if (counter < 1)
LOGF(info, "Output created with q-vectors at iteration %i and step %i!!!!", cal.atIteration, cal.atStep + 1);
fillAllRegistries(cal.atIteration, cal.atStep + 1);
registry.fill(HIST("QA/centrality_after"), centrality);
if (isSelected) {
fillAllRegistries(cal.atIteration, cal.atStep + 1);
registry.fill(HIST("QA/centrality_after"), centrality);
}
spTableZDC(runnumber, centrality, v[0], v[1], v[2], q[cal.atIteration][cal.atStep][0], q[cal.atIteration][cal.atStep][1], q[cal.atIteration][cal.atStep][2], q[cal.atIteration][cal.atStep][3], isSelected, cal.atIteration, cal.atStep);
counter++;
return;
Expand Down
17 changes: 10 additions & 7 deletions PWGCF/Flow/Tasks/FlowTask.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,8 @@ struct FlowTask {
O2_DEFINE_CONFIGURABLE(cfgCutDCAzPtDepEnabled, bool, false, "switch of DCAz pt dependent cut")
O2_DEFINE_CONFIGURABLE(cfgTrkSelSwitch, bool, false, "switch for self-defined track selection")
O2_DEFINE_CONFIGURABLE(cfgTrkSelRun3ITSMatch, bool, false, "GlobalTrackRun3ITSMatching::Run3ITSall7Layers selection")
O2_DEFINE_CONFIGURABLE(cfgRejectionTPCsectorOverlap, bool, true, "rejection for TPC sector overlap")
O2_DEFINE_CONFIGURABLE(cfgShowTPCsectorOverlap, bool, true, "Draw TPC sector overlap")
O2_DEFINE_CONFIGURABLE(cfgRejectionTPCsectorOverlap, bool, false, "rejection for TPC sector overlap")
O2_DEFINE_CONFIGURABLE(cfgUseAdditionalEventCut, bool, false, "Use additional event cut on mult correlations")
O2_DEFINE_CONFIGURABLE(cfgTriggerkTVXinTRD, bool, true, "TRD triggered")
O2_DEFINE_CONFIGURABLE(cfgEvSelkNoSameBunchPileup, bool, true, "rejects collisions which are associated with the same found-by-T0 bunch crossing")
Expand Down Expand Up @@ -401,7 +402,7 @@ struct FlowTask {
fT0AV0ASigma->SetParameters(463.4144, 6.796509e-02, -9.097136e-07, 7.971088e-12, -2.600581e-17);
}

if (cfgRejectionTPCsectorOverlap) {
if (cfgShowTPCsectorOverlap) {
fPhiCutLow = new TF1("fPhiCutLow", "0.06/x+pi/18.0-0.06", 0, 100);
fPhiCutHigh = new TF1("fPhiCutHigh", "0.1/x+pi/18.0+0.06", 0, 100);
}
Expand Down Expand Up @@ -591,7 +592,7 @@ struct FlowTask {
template <typename TTrack>
bool trackSelected(TTrack track)
{
if (cfgCutDCAzPtDepEnabled && (track.dcaZ() > (0.004f + 0.013f / track.pt())))
if (cfgCutDCAzPtDepEnabled && (fabs(track.dcaZ()) > (0.004f + 0.013f / track.pt())))
return false;

if (cfgTrkSelSwitch) {
Expand All @@ -615,8 +616,10 @@ struct FlowTask {
phimodn += TMath::Pi() / 18.0; // to center gap in the middle
phimodn = fmod(phimodn, TMath::Pi() / 9.0);
registry.fill(HIST("pt_phi_bef"), track.pt(), phimodn);
if (phimodn < fPhiCutHigh->Eval(track.pt()) && phimodn > fPhiCutLow->Eval(track.pt()))
return false; // reject track
if (cfgRejectionTPCsectorOverlap) {
if (phimodn < fPhiCutHigh->Eval(track.pt()) && phimodn > fPhiCutLow->Eval(track.pt()))
return false; // reject track
}
registry.fill(HIST("pt_phi_aft"), track.pt(), phimodn);
return true;
}
Expand Down Expand Up @@ -703,7 +706,7 @@ struct FlowTask {
double sum_ptSquare_wSquare_WithinGap08 = 0., sum_pt_wSquare_WithinGap08 = 0.;
int Magnetfield = 0;
double NTracksCorrected = 0;
if (cfgRejectionTPCsectorOverlap) {
if (cfgShowTPCsectorOverlap) {
// magnet field dependence cut
Magnetfield = getMagneticField(bc.timestamp());
}
Expand All @@ -714,7 +717,7 @@ struct FlowTask {
for (auto& track : tracks) {
if (!trackSelected(track))
continue;
if (cfgRejectionTPCsectorOverlap && !RejectionTPCoverlap(track, Magnetfield))
if (cfgShowTPCsectorOverlap && !RejectionTPCoverlap(track, Magnetfield))
continue;
bool WithinPtPOI = (cfgCutPtPOIMin < track.pt()) && (track.pt() < cfgCutPtPOIMax); // within POI pT range
bool WithinPtRef = (cfgCutPtRefMin < track.pt()) && (track.pt() < cfgCutPtRefMax); // within RF pT range
Expand Down
Loading

0 comments on commit b7fc704

Please sign in to comment.