Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 13 additions & 3 deletions PWGDQ/Core/HistogramsLibrary.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -744,22 +744,22 @@
if (subGroupStr.Contains("tpcpid_fine")) {
// fine binning for pIN: steps in 10 MeV/c from 0 to 1 GeV/c and 100 MeV/c up to 10 GeV/c
std::array<double, 281> pIN_bins{};
for (int i = 0; i <= 200; i++) {

Check failure on line 747 in PWGDQ/Core/HistogramsLibrary.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[magic-number]

Avoid magic numbers in expressions. Assign the value to a clearly named variable or constant.
pIN_bins[i] = 0.01 * i;
}
for (int i = 1; i <= 80; i++) {

Check failure on line 750 in PWGDQ/Core/HistogramsLibrary.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[magic-number]

Avoid magic numbers in expressions. Assign the value to a clearly named variable or constant.
pIN_bins[200 + i] = 2. + 0.1 * i;
}
int nbins_pIN = static_cast<int>(pIN_bins.size()) - 1;

std::array<double, 201> TPCdEdx_bins{};
for (int i = 0; i <= 200; i++) {

Check failure on line 756 in PWGDQ/Core/HistogramsLibrary.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[magic-number]

Avoid magic numbers in expressions. Assign the value to a clearly named variable or constant.
TPCdEdx_bins[i] = i;
}
int nbins_TPCdEdx = static_cast<int>(TPCdEdx_bins.size()) - 1;

std::array<double, 101> nSigma_bins{};
for (int i = 0; i <= 100; i++) {

Check failure on line 762 in PWGDQ/Core/HistogramsLibrary.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[magic-number]

Avoid magic numbers in expressions. Assign the value to a clearly named variable or constant.
nSigma_bins[i] = -5. + 0.1 * i;
}
int nbins_nSigma = static_cast<int>(nSigma_bins.size()) - 1;
Expand Down Expand Up @@ -882,22 +882,22 @@
if (subGroupStr.Contains("tofpid_fine")) {
// fine binning for pIN: steps in 10 MeV/c from 0 to 1 GeV/c and 100 MeV/c up to 10 GeV/c
std::array<double, 281> pIN_bins{};
for (int i = 0; i <= 200; i++) {

Check failure on line 885 in PWGDQ/Core/HistogramsLibrary.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[magic-number]

Avoid magic numbers in expressions. Assign the value to a clearly named variable or constant.
pIN_bins[i] = 0.01 * i;
}
for (int i = 1; i <= 80; i++) {

Check failure on line 888 in PWGDQ/Core/HistogramsLibrary.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[magic-number]

Avoid magic numbers in expressions. Assign the value to a clearly named variable or constant.
pIN_bins[200 + i] = 2. + 0.1 * i;
}
int nbins_pIN = static_cast<int>(pIN_bins.size()) - 1;

std::array<double, 241> TOFbeta_bins{};
for (int i = 0; i <= 240; i++) {

Check failure on line 894 in PWGDQ/Core/HistogramsLibrary.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[magic-number]

Avoid magic numbers in expressions. Assign the value to a clearly named variable or constant.
TOFbeta_bins[i] = 0.005 * i;
}
int nbins_TOFbeta = static_cast<int>(TOFbeta_bins.size()) - 1;

std::array<double, 101> nSigma_bins{};
for (int i = 0; i <= 100; i++) {

Check failure on line 900 in PWGDQ/Core/HistogramsLibrary.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[magic-number]

Avoid magic numbers in expressions. Assign the value to a clearly named variable or constant.
nSigma_bins[i] = -5. + 0.1 * i;
}
int nbins_nSigma = static_cast<int>(nSigma_bins.size()) - 1;
Expand All @@ -919,10 +919,10 @@
const int kNvarsPID = 3;
const int kNbins_pIN = 169;
std::array<double, kNbins_pIN + 1> pIN_bins{};
for (int i = 0; i <= 140; i++) {

Check failure on line 922 in PWGDQ/Core/HistogramsLibrary.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[magic-number]

Avoid magic numbers in expressions. Assign the value to a clearly named variable or constant.
pIN_bins[i] = 0.01 * i + 0.1;
}
for (int i = 1; i <= 15; i++) {

Check failure on line 925 in PWGDQ/Core/HistogramsLibrary.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[magic-number]

Avoid magic numbers in expressions. Assign the value to a clearly named variable or constant.
pIN_bins[140 + i] = 1.5 + 0.1 * i;
}
for (int i = 1; i <= 14; i++) {
Expand Down Expand Up @@ -1257,15 +1257,25 @@
hm->AddHistogram(histClass, "Coschi", "", false, 25, coschiBins.data(), VarManager::kMCCosChi, 0, nullptr, -1, 0, nullptr, -1, "", "", "", -1, VarManager::kMCWeight);
}

if (groupStr.CompareTo("polarization-pseudoproper-gen") == 0) {
if (groupStr.CompareTo("polarization-pseudoproper-midy-he-gen") == 0) {
std::array<int, 4> varspTHE = {VarManager::kMCMass, VarManager::kMCPt, VarManager::kMCCosThetaHE, VarManager::kMCVertexingTauxyProjected};
std::array<int, 4> varspTCS = {VarManager::kMCMass, VarManager::kMCPt, VarManager::kMCCosThetaCS, VarManager::kMCVertexingTauxyProjected};
std::array<int, 4> varspTRM = {VarManager::kMCMass, VarManager::kMCPt, VarManager::kMCCosThetaRM, VarManager::kMCVertexingTauxyProjected};
std::array<int, 4> bins = {50, 20, 20, 1000};
std::array<double, 4> xmin = {2., 0., -1., -0.5};
std::array<double, 4> xmax = {4., 20., 1., 0.5};
hm->AddHistogram(histClass, "Mass_Pt_cosThetaHE_Tauxy", "", 4, varspTHE.data(), bins.data(), xmin.data(), xmax.data(), nullptr, -1, kFALSE);
}
if (groupStr.CompareTo("polarization-pseudoproper-midy-cs-gen") == 0) {
std::array<int, 4> varspTCS = {VarManager::kMCMass, VarManager::kMCPt, VarManager::kMCCosThetaCS, VarManager::kMCVertexingTauxyProjected};
std::array<int, 4> bins = {50, 20, 20, 1000};
std::array<double, 4> xmin = {2., 0., -1., -0.5};
std::array<double, 4> xmax = {4., 20., 1., 0.5};
hm->AddHistogram(histClass, "Mass_Pt_cosThetaCS_Tauxy", "", 4, varspTCS.data(), bins.data(), xmin.data(), xmax.data(), nullptr, -1, kFALSE);
}
if (groupStr.CompareTo("polarization-pseudoproper-midy-rand-gen") == 0) {
std::array<int, 4> varspTRM = {VarManager::kMCMass, VarManager::kMCPt, VarManager::kMCCosThetaRM, VarManager::kMCVertexingTauxyProjected};
std::array<int, 4> bins = {50, 20, 20, 1000};
std::array<double, 4> xmin = {2., 0., -1., -0.5};
std::array<double, 4> xmax = {4., 20., 1., 0.5};
hm->AddHistogram(histClass, "Mass_Pt_cosThetaRM_Tauxy", "", 4, varspTRM.data(), bins.data(), xmin.data(), xmax.data(), nullptr, -1, kFALSE);
}
if (groupStr.CompareTo("polarization-dielectron-pbpb-midy-he-gen") == 0) {
Expand Down
114 changes: 73 additions & 41 deletions PWGDQ/Tasks/dqEfficiency_withAssoc_direct.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -331,14 +331,14 @@ struct AnalysisEventSelection {

HistogramManager* fHistMan = nullptr;

AnalysisCompositeCut* fEventCut;
AnalysisCompositeCut* fEventCut = nullptr;

Service<o2::ccdb::BasicCCDBManager> fCCDB;
o2::ccdb::CcdbApi fCCDBApi;

std::map<int64_t, bool> fSelMap; // key: reduced event global index, value: event selection decision
std::map<uint64_t, std::vector<int64_t>> fBCCollMap; // key: global BC, value: vector of reduced event global indices
int fCurrentRun;
int fCurrentRun = 0;

void init(o2::framework::InitContext& context)
{
Expand Down Expand Up @@ -595,13 +595,13 @@ struct AnalysisTrackSelection {
Service<o2::ccdb::BasicCCDBManager> fCCDB;
Service<o2::pid::tof::TOFResponse> fTofResponse;

HistogramManager* fHistMan;
HistogramManager* fHistMan = nullptr;
std::vector<AnalysisCompositeCut*> fTrackCuts;
std::vector<MCSignal*> fMCSignals; // list of signals to be checked
std::vector<TString> fHistNamesReco;
std::vector<TString> fHistNamesMCMatched;

int fCurrentRun; // current run (needed to detect run changes for loading CCDB parameters)
int fCurrentRun = 0; // current run (needed to detect run changes for loading CCDB parameters)

std::map<int64_t, std::vector<int64_t>> fNAssocsInBunch; // key: track global index, value: vector of global index for events associated in-bunch (events that have in-bunch pileup or splitting)
std::map<int64_t, std::vector<int64_t>> fNAssocsOutOfBunch; // key: track global index, value: vector of global index for events associated out-of-bunch (events that have no in-bunch pileup)
Expand Down Expand Up @@ -938,9 +938,9 @@ struct AnalysisPrefilterSelection {
Configurable<bool> fPropTrack{"cfgPropTrack", false, "Propagate tracks to associated collision to recalculate DCA and momentum vector"};

std::map<uint32_t, uint32_t> fPrefilterMap;
AnalysisCompositeCut* fPairCut;
uint32_t fPrefilterMask;
int fPrefilterCutBit;
AnalysisCompositeCut* fPairCut = nullptr;
uint32_t fPrefilterMask = 0;
int fPrefilterCutBit = 0;

Preslice<aod::TrackAssoc> trackAssocsPerCollision = aod::track_association::collisionId;

Expand Down Expand Up @@ -1141,7 +1141,9 @@ struct AnalysisSameEventPairing {
Configurable<std::string> pair{"cfgPairCuts", "", "Comma separated list of pair cuts, !!! Use only if you know what you are doing, otherwise leave empty"};
Configurable<bool> fConfigQA{"cfgQA", false, "If true, fill QA histograms"};
Configurable<bool> fConfigMCtruthQA{"cfgMCtruthQA", false, "If true, fill QA histograms with default"};
Configurable<bool> fConfigPseudoQA{"cfgPseudoQA", false, "If true, fill QA histograms with pseudo-proper decay length analysis with polarization"};
Configurable<bool> fConfigPseudoHEQA{"cfgPseudoHEQA", false, "If true, fill QA histograms with pseudo-proper decay length analysis with polarization HE"};
Configurable<bool> fConfigPseudoCSQA{"cfgPseudoCSQA", false, "If true, fill QA histograms with pseudo-proper decay length analysis with polarization CS"};
Configurable<bool> fConfigPseudoRMQA{"cfgPseudoRMQA", false, "If true, fill QA histograms with pseudo-proper decay length analysis with polarization RM"};
Configurable<bool> fConfigTruthPbPbMIDYHE{"cfgTruthPbPbmidyHE", false, "If true, fill QA histograms with dielectron pairs in helicity frame"};
Configurable<bool> fConfigTruthPbPbMIDYCS{"cfgTruthPbPbmidyCS", false, "If true, fill QA histograms with dielectron pairs in collion-soper frame"};
Configurable<std::string> fConfigAddSEPHistogram{"cfgAddSEPHistogram", "", "Comma separated list of histograms"};
Expand Down Expand Up @@ -1204,14 +1206,14 @@ struct AnalysisSameEventPairing {
std::vector<AnalysisCut*> fMCGenAccCuts;
bool fUseMCGenAccCut = false;

uint32_t fTrackFilterMask; // mask for the track cuts required in this task to be applied on the barrel cuts produced upstream
uint32_t fMuonFilterMask; // mask for the muon cuts required in this task to be applied on the muon cuts produced upstream
int fNCutsBarrel;
int fNCutsMuon;
int fNPairCuts;
uint32_t fTrackFilterMask = 0; // mask for the track cuts required in this task to be applied on the barrel cuts produced upstream
uint32_t fMuonFilterMask = 0; // mask for the muon cuts required in this task to be applied on the muon cuts produced upstream
int fNCutsBarrel = 0;
int fNCutsMuon = 0;
int fNPairCuts = 0;
bool fHasTwoProngGenMCsignals = false;

bool fEnableBarrelHistos;
bool fEnableBarrelHistos = false;
// bool fEnableMuonHistos;

Preslice<soa::Join<aod::TrackAssoc, aod::BarrelTrackCuts, aod::Prefilter>> trackAssocsPerCollision = aod::track_association::collisionId;
Expand Down Expand Up @@ -1506,14 +1508,20 @@ struct AnalysisSameEventPairing {
if (fConfigOptions.fConfigMCtruthQA.value) {
histNames += Form("MCTruthGenPairSel_%s;", sig->GetName()); // after event selection
}
if (fConfigOptions.fConfigPseudoQA.value) {
histNames += Form("MCTruthGenPseudoPolPairSel_%s;", sig->GetName());
if (fConfigOptions.fConfigPseudoHEQA.value) {
histNames += Form("MCTruthGenPseudoPolPairHESel_%s;", sig->GetName());
}
if (fConfigOptions.fConfigPseudoCSQA.value) {
histNames += Form("MCTruthGenPseudoPolPairCSSel_%s;", sig->GetName());
}
if (fConfigOptions.fConfigPseudoRMQA.value) {
histNames += Form("MCTruthGenPseudoPolPairRMSel_%s;", sig->GetName());
}
if (fConfigOptions.fConfigTruthPbPbMIDYHE.value) {
histNames += Form("MCTruthGenPseudoPolPairSel_%s;", sig->GetName());
histNames += Form("MCTruthGenPoldielectronPbPbPairHESel_%s;", sig->GetName());
}
if (fConfigOptions.fConfigTruthPbPbMIDYCS.value) {
histNames += Form("MCTruthGenPseudoPolPairSel_%s;", sig->GetName());
histNames += Form("MCTruthGenPoldielectronPbPbPairCSSel_%s;", sig->GetName());
}
fHasTwoProngGenMCsignals = true;
}
Expand All @@ -1523,14 +1531,20 @@ struct AnalysisSameEventPairing {
if (fConfigOptions.fConfigMCtruthQA.value) {
histNames += Form("MCTruthGenPairSel_%s_%s;", sig->GetName(), cut->GetName()); // after event selection and MCgenAcc cut
}
if (fConfigOptions.fConfigPseudoQA.value) {
histNames += Form("MCTruthGenPseudoPolPairSel_%s_%s;", sig->GetName(), cut->GetName());
if (fConfigOptions.fConfigPseudoHEQA.value) {
histNames += Form("MCTruthGenPseudoPolPairHESel_%s_%s;", sig->GetName(), cut->GetName());
}
if (fConfigOptions.fConfigPseudoCSQA.value) {
histNames += Form("MCTruthGenPseudoPolPairCSSel_%s_%s;", sig->GetName(), cut->GetName());
}
if (fConfigOptions.fConfigPseudoRMQA.value) {
histNames += Form("MCTruthGenPseudoPolPairRMSel_%s_%s;", sig->GetName(), cut->GetName());
}
if (fConfigOptions.fConfigTruthPbPbMIDYHE.value) {
histNames += Form("MCTruthGenPoldielectronPbPbPairHESel_%s_%s;", sig->GetName(), cut->GetName());
}
if (fConfigOptions.fConfigTruthPbPbMIDYCS.value) {
histNames += Form("MCTruthGenPseudoPolPairCSSel_%s_%s;", sig->GetName(), cut->GetName());
histNames += Form("MCTruthGenPoldielectronPbPbPairCSSel_%s_%s;", sig->GetName(), cut->GetName());
}
}
}
Expand Down Expand Up @@ -2189,8 +2203,14 @@ struct AnalysisSameEventPairing {
if (fConfigOptions.fConfigMCtruthQA.value) {
fHistMan->FillHistClass(Form("MCTruthGenPairSel_%s", sig->GetName()), VarManager::fgValues);
}
if (fConfigOptions.fConfigPseudoQA.value) {
fHistMan->FillHistClass(Form("MCTruthGenPseudoPolPairSel_%s", sig->GetName()), VarManager::fgValues);
if (fConfigOptions.fConfigPseudoHEQA.value) {
fHistMan->FillHistClass(Form("MCTruthGenPseudoPolPairHESel_%s", sig->GetName()), VarManager::fgValues);
}
if (fConfigOptions.fConfigPseudoCSQA.value) {
fHistMan->FillHistClass(Form("MCTruthGenPseudoPolPairCSSel_%s", sig->GetName()), VarManager::fgValues);
}
if (fConfigOptions.fConfigPseudoRMQA.value) {
fHistMan->FillHistClass(Form("MCTruthGenPseudoPolPairRMSel_%s", sig->GetName()), VarManager::fgValues);
}
if (fConfigOptions.fConfigTruthPbPbMIDYHE.value) {
fHistMan->FillHistClass(Form("MCTruthGenPoldielectronPbPbPairHESel_%s", sig->GetName()), VarManager::fgValues);
Expand All @@ -2205,8 +2225,14 @@ struct AnalysisSameEventPairing {
if (fConfigOptions.fConfigMCtruthQA.value) {
fHistMan->FillHistClass(Form("MCTruthGenPairSel_%s_%s", sig->GetName(), cut->GetName()), VarManager::fgValues);
}
if (fConfigOptions.fConfigPseudoQA.value) {
fHistMan->FillHistClass(Form("MCTruthGenPseudoPolPairSel_%s_%s", sig->GetName(), cut->GetName()), VarManager::fgValues);
if (fConfigOptions.fConfigPseudoHEQA.value) {
fHistMan->FillHistClass(Form("MCTruthGenPseudoPolPairHESel_%s_%s", sig->GetName(), cut->GetName()), VarManager::fgValues);
}
if (fConfigOptions.fConfigPseudoCSQA.value) {
fHistMan->FillHistClass(Form("MCTruthGenPseudoPolPairCSSel_%s_%s", sig->GetName(), cut->GetName()), VarManager::fgValues);
}
if (fConfigOptions.fConfigPseudoRMQA.value) {
fHistMan->FillHistClass(Form("MCTruthGenPseudoPolPairRMSel_%s_%s", sig->GetName(), cut->GetName()), VarManager::fgValues);
}

if (fConfigOptions.fConfigTruthPbPbMIDYHE.value) {
Expand Down Expand Up @@ -2311,13 +2337,13 @@ struct AnalysisDileptonTrack {
Configurable<std::string> fConfigMCGenSignalHadronJSON{"cfgMCGenSignalHadronJSON", "", "generator level hadron signal (JSON format), used for MC level combinatorics"};
} fConfigMCOptions;

int fCurrentRun; // needed to detect if the run changed and trigger update of calibrations etc.
int fNCuts;
int fNLegCuts;
int fNPairCuts;
int fNCommonTrackCuts;
int fCurrentRun = 0; // needed to detect if the run changed and trigger update of calibrations etc.
int fNCuts = 0;
int fNLegCuts = 0;
int fNPairCuts = 0;
int fNCommonTrackCuts = 0;
std::map<int, int> fCommonTrackCutMap;
uint32_t fTrackCutBitMap; // track cut bit mask to be used in the selection of tracks associated with dileptons
uint32_t fTrackCutBitMap = 0; // track cut bit mask to be used in the selection of tracks associated with dileptons
// vector for single-lepton and track cut names for easy access when calling FillHistogramList()
std::vector<TString> fTrackCutNames;
std::vector<TString> fLegCutNames;
Expand All @@ -2334,14 +2360,14 @@ struct AnalysisDileptonTrack {
// Filter filterMuon = aod::dqanalysisflags::isMuonSelected > static_cast<uint32_t>(0);

// use two values array to avoid mixing up the quantities
float* fValuesDilepton;
float* fValuesHadron;
HistogramManager* fHistMan;
float* fValuesDilepton = nullptr;
float* fValuesHadron = nullptr;
HistogramManager* fHistMan = nullptr;

std::vector<MCSignal*> fRecMCSignals;
std::vector<MCSignal*> fGenMCSignals;
MCSignal* fDileptonLegSignal;
MCSignal* fHadronSignal;
MCSignal* fDileptonLegSignal = nullptr;
MCSignal* fHadronSignal = nullptr;

void init(o2::framework::InitContext& context)
{
Expand All @@ -2353,7 +2379,7 @@ struct AnalysisDileptonTrack {
bool isDummy = context.mOptions.get<bool>("processDummy");

if (isDummy) {
if (isBarrel || isMCGen /*|| isBarrelAsymmetric*/ /*|| isMuon*/) {
if (isBarrel || isMCGen) {
LOG(fatal) << "Dummy function is enabled even if there are normal process functions running! Fix your config!" << endl;
} else {
LOG(info) << "Dummy function is enabled. Skipping the rest of the init function" << endl;
Expand Down Expand Up @@ -2576,13 +2602,13 @@ struct AnalysisDileptonTrack {
fNLegCuts = fNCuts;

// loop over single lepton cuts
if (isBarrel /*|| isBarrelAsymmetric*/ /* || isMuon*/) {
if (isBarrel) {
for (int icut = 0; icut < fNLegCuts; ++icut) {

TString pairLegCutName;

// here we check that this cut is one of those used for building the dileptons
if (isBarrel /*|| isMuon*/) {
if (isBarrel) {
if (!cfgPairing_objArrayTrackCuts->FindObject(fTrackCutNames[icut].Data())) {
continue;
}
Expand Down Expand Up @@ -3215,8 +3241,14 @@ void DefineHistograms(HistogramManager* histMan, TString histClasses, const char
if (classStr.Contains("MCTruthGenPair")) {
dqhistograms::DefineHistograms(histMan, objArray->At(iclass)->GetName(), "mctruth_pair", histName);
}
if (classStr.Contains("MCTruthGenPseudoPolPair")) {
dqhistograms::DefineHistograms(histMan, objArray->At(iclass)->GetName(), "polarization-pseudoproper-gen", histName);
if (classStr.Contains("MCTruthGenPseudoPolPairHE")) {
dqhistograms::DefineHistograms(histMan, objArray->At(iclass)->GetName(), "polarization-pseudoproper-midy-he-gen", histName);
}
if (classStr.Contains("MCTruthGenPseudoPolPairCS")) {
dqhistograms::DefineHistograms(histMan, objArray->At(iclass)->GetName(), "polarization-pseudoproper-midy-cs-gen", histName);
}
if (classStr.Contains("MCTruthGenPseudoPolPairRM")) {
dqhistograms::DefineHistograms(histMan, objArray->At(iclass)->GetName(), "polarization-pseudoproper-midy-rand-gen", histName);
}
if (classStr.Contains("MCTruthGenPoldielectronPbPbPairHE")) {
dqhistograms::DefineHistograms(histMan, objArray->At(iclass)->GetName(), "polarization-dielectron-pbpb-midy-he-gen", histName);
Expand Down
Loading