Skip to content

Commit 1463d37

Browse files
Merge branch 'AliceO2Group:master' into master
2 parents c8eaf10 + 907006c commit 1463d37

9 files changed

Lines changed: 419 additions & 356 deletions

File tree

DPG/Tasks/AOTTrack/qaEventTrack.cxx

Lines changed: 27 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,19 +23,23 @@
2323

2424
#include "qaEventTrack.h"
2525

26-
#include "Framework/AnalysisTask.h"
27-
#include "Framework/HistogramRegistry.h"
28-
#include "Framework/runDataProcessing.h"
29-
#include "Framework/AnalysisDataModel.h"
30-
#include "Framework/O2DatabasePDGPlugin.h"
31-
#include "ReconstructionDataFormats/DCA.h"
26+
#include "Common/Core/MetadataHelper.h"
27+
#include "Common/Core/TrackSelection.h"
28+
#include "Common/Core/TrackSelectionDefaults.h"
3229
#include "Common/Core/trackUtilities.h"
3330
#include "Common/DataModel/EventSelection.h"
3431
#include "Common/DataModel/TrackSelectionTables.h"
35-
#include "Common/Core/TrackSelection.h"
36-
#include "Common/Core/TrackSelectionDefaults.h"
3732
#include "Common/TableProducer/PID/pidTOFBase.h"
3833

34+
#include <Framework/AnalysisDataModel.h>
35+
#include <Framework/AnalysisTask.h>
36+
#include <Framework/HistogramRegistry.h>
37+
#include <Framework/O2DatabasePDGPlugin.h>
38+
#include <Framework/runDataProcessing.h>
39+
#include <ReconstructionDataFormats/DCA.h>
40+
41+
#include <TH1.h>
42+
3943
#include <string>
4044
#include <vector>
4145

@@ -44,6 +48,8 @@ using namespace o2::framework;
4448
using namespace o2::framework::expressions;
4549
using namespace o2::dataformats;
4650

51+
o2::common::core::MetadataHelper metadataInfo;
52+
4753
// TODO: add PID wagons as dependency + include impact parameter studies (same or separate task in workflow??)
4854

4955
//--------------------------------------------------------------------------------------------------
@@ -68,6 +74,9 @@ struct qaEventTrack {
6874
// option to apply a timeframe cut
6975
Configurable<bool> tfCut{"tfCut", false, "applies timeframe cut"};
7076

77+
// option to add run info to the histograms
78+
Configurable<bool> addRunInfo{"addRunInfo", true, "add run info (pass, data) to the histograms"};
79+
7180
// options to select only specific tracks
7281
Configurable<int> trackSelection{"trackSelection", 1, "Track selection: 0 -> No Cut, 1 -> kGlobalTrack, 2 -> kGlobalTrackWoPtEta, 3 -> kGlobalTrackWoDCA, 4 -> kQualityTracks, 5 -> kInAcceptanceTracks"};
7382
Configurable<int> selectCharge{"selectCharge", 0, "select charge +1 or -1 (0 means no selection)"};
@@ -166,6 +175,14 @@ struct qaEventTrack {
166175
}
167176
}
168177

178+
if (addRunInfo) {
179+
auto hRunInfo = histos.add<TH1>("hRunInfo", "Run info", kTH1D, {{1, 0.5, 1.5, "Run info"}});
180+
// hRunInfo->SetBit(TH1::kCanRebin); // allow dynamic bin creation based on label
181+
if (metadataInfo.isFullyDefined()) {
182+
hRunInfo->Fill(metadataInfo.makeMetadataLabel().c_str(), 1.0);
183+
}
184+
}
185+
169186
//
170187
// Next section setups overwrite of configurableAxis if overwriteAxisRangeForPbPb is used.
171188
//
@@ -1153,6 +1170,8 @@ struct qaEventTrack {
11531170

11541171
WorkflowSpec defineDataProcessing(ConfigContext const& cfgc)
11551172
{
1173+
// Parse the metadata
1174+
metadataInfo.initMetadata(cfgc);
11561175
return WorkflowSpec{adaptAnalysisTask<qaEventTrack>(cfgc)};
11571176
}
11581177

PWGCF/Flow/TableProducer/zdcQVectors.cxx

Lines changed: 19 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,6 @@ struct ZdcQVectors {
148148
O2_DEFINE_CONFIGURABLE(cfgEvSelsCentMin, float, 0, "Minimum cenrality for selected events");
149149
O2_DEFINE_CONFIGURABLE(cfgEvSelsCentMax, float, 90, "Maximum cenrality for selected events");
150150

151-
O2_DEFINE_CONFIGURABLE(cfgUseShift, bool, false, "Use shift for PsiA and PsiC ZDC");
152151
O2_DEFINE_CONFIGURABLE(cfgCCDBdir_Shift, std::string, "Users/c/ckoster/ZDC/LHC23_PbPb_pass5/Shift", "CCDB directory for Shift ZDC");
153152

154153
// define my.....
@@ -258,10 +257,10 @@ struct ZdcQVectors {
258257
registry.add<TProfile>("QA/ZNA_Energy", "ZNA_Energy", kTProfile, {{8, 0, 8}});
259258
registry.add<TProfile>("QA/ZNC_Energy", "ZNC_Energy", kTProfile, {{8, 0, 8}});
260259

261-
registry.add<TH1>("QA/psiZDCA", "psiZDCA", kTH1D, {{100, -4, 4}});
262-
registry.add<TH1>("QA/psiZDCA_shift", "psiZDCA_shift", kTH1D, {{100, -4, 4}});
263-
registry.add<TH1>("QA/psiZDCC", "psiZDCC", kTH1D, {{100, -4, 4}});
264-
registry.add<TH1>("QA/psiZDCC_shift", "psiZDCC_shift", kTH1D, {{100, -4, 4}});
260+
registry.add<TH2>("QA/psiZDCA", "psiZDCA", kTH2D, {{100, -4, 4}, {100, 0, 100}});
261+
registry.add<TH2>("QA/psiZDCA_shift", "psiZDCA_shift", kTH2D, {{100, -4, 4}, {100, 0, 100}});
262+
registry.add<TH2>("QA/psiZDCC", "psiZDCC", kTH2D, {{100, -4, 4}, {100, 0, 100}});
263+
registry.add<TH2>("QA/psiZDCC_shift", "psiZDCC_shift", kTH2D, {{100, -4, 4}, {100, 0, 100}});
265264

266265
registry.add<TProfile>("QA/before/ZNA_pmC", "ZNA_pmC", kTProfile, {{1, 0, 1.}});
267266
registry.add<TProfile>("QA/before/ZNA_pm1", "ZNA_pm1", kTProfile, {{1, 0, 1.}});
@@ -923,7 +922,7 @@ struct ZdcQVectors {
923922
double deltaPsiZDCA = 0;
924923
double deltaPsiZDCC = 0;
925924

926-
if (cfgUseShift && !cfgCCDBdir_Shift.value.empty()) {
925+
if (!cfgCCDBdir_Shift.value.empty()) {
927926
if (lastRunNumber != runnumber) {
928927
cal.isShiftProfileFound = false;
929928
LOGF(info, "Getting shift profile from CCDB for runnumber: %d", runnumber);
@@ -939,19 +938,21 @@ struct ZdcQVectors {
939938
}
940939
}
941940

942-
float coeffshiftxZDCC = 0.0;
943-
float coeffshiftyZDCC = 0.0;
944-
float coeffshiftxZDCA = 0.0;
945-
float coeffshiftyZDCA = 0.0;
946-
947941
for (int ishift = 1; ishift <= nshift; ishift++) {
948942
registry.fill(HIST("shift/ShiftZDCC"), centrality, 0.5, ishift - 0.5, std::sin(ishift * 1.0 * psiZDCC));
949943
registry.fill(HIST("shift/ShiftZDCC"), centrality, 1.5, ishift - 0.5, std::cos(ishift * 1.0 * psiZDCC));
950944
registry.fill(HIST("shift/ShiftZDCA"), centrality, 0.5, ishift - 0.5, std::sin(ishift * 1.0 * psiZDCA));
951945
registry.fill(HIST("shift/ShiftZDCA"), centrality, 1.5, ishift - 0.5, std::cos(ishift * 1.0 * psiZDCA));
946+
}
952947

948+
float coeffshiftxZDCC = 0.0;
949+
float coeffshiftyZDCC = 0.0;
950+
float coeffshiftxZDCA = 0.0;
951+
float coeffshiftyZDCA = 0.0;
952+
953+
for (int ishift = 1; ishift <= nshift; ishift++) {
953954
if (cal.isShiftProfileFound) {
954-
int binshiftxZDCC = cal.shiftprofileC->FindBin(centrality, 0.5, ishift - 0.5);
955+
int binshiftxZDCC = cal.shiftprofileC->FindBin(centrality, 0.5, ishift - 0.5); // bin 0.5
955956
int binshiftyZDCC = cal.shiftprofileC->FindBin(centrality, 1.5, ishift - 0.5);
956957
int binshiftxZDCA = cal.shiftprofileA->FindBin(centrality, 0.5, ishift - 0.5);
957958
int binshiftyZDCA = cal.shiftprofileA->FindBin(centrality, 1.5, ishift - 0.5);
@@ -965,8 +966,8 @@ struct ZdcQVectors {
965966
if (binshiftyZDCA > 0)
966967
coeffshiftyZDCA = cal.shiftprofileA->GetBinContent(binshiftyZDCA);
967968
}
968-
deltaPsiZDCC += ((2 / (1.0 * ishift)) * (-coeffshiftxZDCC * std::cos(ishift * 1.0 * psiZDCC) + coeffshiftyZDCC * std::sin(ishift * 1.0 * psiZDCC)));
969-
deltaPsiZDCA += ((2 / (1.0 * ishift)) * (-coeffshiftxZDCA * std::cos(ishift * 1.0 * psiZDCA) + coeffshiftyZDCA * std::sin(ishift * 1.0 * psiZDCA)));
969+
deltaPsiZDCC += ((2 / (1.0 * ishift)) * (-1.0 * coeffshiftxZDCC * std::cos(ishift * 1.0 * psiZDCC) + coeffshiftyZDCC * std::sin(ishift * 1.0 * psiZDCC)));
970+
deltaPsiZDCA += ((2 / (1.0 * ishift)) * (-1.0 * coeffshiftxZDCA * std::cos(ishift * 1.0 * psiZDCA) + coeffshiftyZDCA * std::sin(ishift * 1.0 * psiZDCA)));
970971
}
971972

972973
psiZDCCshift += deltaPsiZDCC;
@@ -977,10 +978,10 @@ struct ZdcQVectors {
977978
psiZDCAshift = std::atan2(std::sin(psiZDCAshift), std::cos(psiZDCAshift));
978979

979980
if (cfgFillCommonRegistry) {
980-
registry.fill(HIST("QA/psiZDCA"), psiZDCA);
981-
registry.fill(HIST("QA/psiZDCC"), psiZDCC);
982-
registry.fill(HIST("QA/psiZDCA_shift"), psiZDCAshift);
983-
registry.fill(HIST("QA/psiZDCC_shift"), psiZDCCshift);
981+
registry.fill(HIST("QA/psiZDCA"), psiZDCA, centrality);
982+
registry.fill(HIST("QA/psiZDCC"), psiZDCC, centrality);
983+
registry.fill(HIST("QA/psiZDCA_shift"), psiZDCAshift, centrality);
984+
registry.fill(HIST("QA/psiZDCC_shift"), psiZDCCshift, centrality);
984985
}
985986

986987
double qXaShift = std::hypot(qRec[1], qRec[0]) * std::cos(psiZDCAshift);

0 commit comments

Comments
 (0)