Skip to content

Commit 26bac63

Browse files
adding a check if weight histogram dose not have finner binning thn those of pt axis of dstar
1 parent 224eb87 commit 26bac63

File tree

1 file changed

+13
-7
lines changed

1 file changed

+13
-7
lines changed

PWGHF/D2H/Tasks/taskDstarToD0Pi.cxx

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -61,16 +61,13 @@ struct HfTaskDstarToD0Pi {
6161
Configurable<bool> isCentStudy{"isCentStudy", true, "Flag to select centrality study"};
6262
Configurable<bool> qaEnabled{"qaEnabled", true, "Flag to enable QA histograms"};
6363
Configurable<bool> studyD0ToPiKPi0{"studyD0ToPiKPi0", false, "Flag to study D*->D0(piKpi0)pi channel"};
64-
Configurable<bool> ptShapeStudy{"ptShapeStudy", true, "Flag to enable pT shape study"};
64+
Configurable<bool> ptShapeStudy{"ptShapeStudy", false, "Flag to enable pT shape study"};
6565

6666
// CCDB configuration
67-
// Configurable<bool> useWeight{"useWeight", true, "Flag to use weights from CCDB"};
68-
// Configurable<int> nWeights{"nWeights", 6, "Number of weights to be used from CCDB"};
6967
Configurable<std::string> ccdbUrl{"ccdbUrl", "http://alice-ccdb.cern.ch", "url of the ccdb repository"};
7068
Configurable<std::string> ccdbPathForWeight{"ccdbPathForWeight", "", "CCDB path for pt shape weights"};
7169
Configurable<int64_t> timestampCCDB{"timestampCCDB", -1, "CCDB timestamp for pt shape weights"};
7270
Configurable<std::string> weightFileName{"weightFileName", "Weights.root", "Name of the weight file to be used for pt shape study"};
73-
// Configurable<std::vector<double>> centRangesForWeights{"centRangesForWeights", {0.0, 5.0, 10.0, 30.0, 50.0, 70.0, 100.0}, "Centrality ranges for weights. Size of ranges should be equal to nWeights + 1"};
7471

7572
Configurable<double> yCandDstarRecoMax{"yCandDstarRecoMax", 0.8, "max. candidate Dstar rapidity"};
7673
Configurable<double> yCandDstarGenMax{"yCandDstarGenMax", 0.5, "max. rapidity of Generator level Particle"};
@@ -89,7 +86,7 @@ struct HfTaskDstarToD0Pi {
8986
NonPrompt = 1
9087
};
9188

92-
// follwing commented axes can be removed if not needed
89+
// follwing comment can be removed if extra axes not needed
9390
// std::vector<AxisSpec> axesPtVsCentVsBDTVsPvContribVsPtB;
9491
// std::vector<AxisSpec> axesPtVsCentVsPvContribVsPtB;
9592
// std::vector<AxisSpec> axesPtVsBDTVsPtB;
@@ -151,7 +148,7 @@ struct HfTaskDstarToD0Pi {
151148
AxisSpec axisPvContrib = {binningPvContrib, "PV Contribution"};
152149
AxisSpec const axisPt = {vecPtBins, "#it{p}_{T} (GeV/#it{c})"};
153150

154-
// can be removed if not needed
151+
// follwing comment can be removed if extra axes not needed
155152
// AxisSpec axisPtFine = {vecPtBins, "#it{p}_{T} (GeV/#it{c})"};
156153
// if (ptShapeStudy){
157154
// axisPtFine = {binningPtFine, "pT (GeV/c)"};
@@ -163,7 +160,7 @@ struct HfTaskDstarToD0Pi {
163160
axesPtVsCentVsPvContrib = {axisPt, axisCentrality, axisPvContrib};
164161
axesPtVsBDT = {axisPt, axisBDTScoreBackground, axisBDTScorePrompt, axisBDTScoreNonPrompt};
165162

166-
// can be removed if
163+
// follwing comment can be removed if extra axes not needed
167164
// if (ptShapeStudy){
168165
// axesPtVsCentVsBDTVsPvContribVsPtB = {axisPt, axisCentrality, axisBDTScoreBackground, axisBDTScorePrompt, axisBDTScoreNonPrompt, axisPvContrib, axisPtFine};
169166
// axesPtVsCentVsPvContribVsPtB = {axisPt, axisCentrality, axisPvContrib, axisPtFine};
@@ -346,6 +343,15 @@ struct HfTaskDstarToD0Pi {
346343
LOGF(fatal, "Histogram %s not found in weight file!", weightHistNames[weightType::NonPrompt].c_str());
347344
return;
348345
}
346+
// checking if bin wdith of weight histograms are not finner than pT axis of Dstar
347+
if (hWeights[weightType::Prompt]->GetXaxis()->GetBinWidth(1) >= vecPtBins[1] - vecPtBins[0]) {
348+
LOGF(fatal, "Bin width of weight histogram should be finer than pT axis of Dstar!");
349+
return;
350+
}
351+
if (hWeights[weightType::NonPrompt]->GetXaxis()->GetBinWidth(1) >= vecPtBins[1] - vecPtBins[0]) {
352+
LOGF(fatal, "Bin width of weight histogram should be finer than pT axis of Dstar!");
353+
return;
354+
}
349355
hWeights[weightType::Prompt]->SetDirectory(nullptr);
350356
hWeights[weightType::NonPrompt]->SetDirectory(nullptr);
351357

0 commit comments

Comments
 (0)