Skip to content

Commit 649891b

Browse files
authored
[DPG] Add run info option and reorganize includes (#13025)
1 parent 5e5df95 commit 649891b

File tree

1 file changed

+27
-8
lines changed

1 file changed

+27
-8
lines changed

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

0 commit comments

Comments
 (0)