Skip to content

Commit d2b88de

Browse files
committed
Merge branch 'master' into localtestPWGUD
2 parents d911fec + f571f6d commit d2b88de

File tree

6 files changed

+398
-231
lines changed

6 files changed

+398
-231
lines changed

PWGJE/TableProducer/emcalCorrectionTask.cxx

Lines changed: 47 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -18,28 +18,42 @@
1818
/// \author Raymond Ehlers (raymond.ehlers@cern.ch) ORNL, Florian Jonas (florian.jonas@cern.ch)
1919
///
2020

21-
#include <algorithm>
21+
#include <gsl/span>
22+
#include <fairlogger/Logger.h>
23+
#include <cstdint>
24+
#include <cstddef>
2225
#include <memory>
26+
#include <sstream>
2327
#include <unordered_map>
2428
#include <cmath>
2529
#include <string>
2630
#include <tuple>
31+
#include <utility>
2732
#include <vector>
2833
#include <random>
2934

3035
#include "CCDB/BasicCCDBManager.h"
3136
#include "Framework/runDataProcessing.h"
32-
#include "Framework/AnalysisTask.h"
3337
#include "Framework/AnalysisDataModel.h"
38+
#include "Framework/AnalysisTask.h"
39+
#include "Framework/AnalysisHelpers.h"
3440
#include "Framework/ASoA.h"
41+
#include "Framework/Configurable.h"
42+
#include "Framework/Expressions.h"
43+
#include "Framework/HistogramSpec.h"
44+
#include "Framework/HistogramRegistry.h"
45+
#include "Framework/InitContext.h"
46+
#include "Framework/WorkflowSpec.h"
3547

3648
#include "DetectorsBase/GeometryManager.h"
3749

50+
#include "PWGJE/DataModel/EMCALClusterDefinition.h"
3851
#include "PWGJE/DataModel/EMCALClusters.h"
3952
#include "PWGJE/DataModel/EMCALMatchedCollisions.h"
4053

4154
#include "Common/DataModel/EventSelection.h"
4255
#include "Common/DataModel/TrackSelectionTables.h"
56+
#include "DataFormatsEMCAL/ClusterLabel.h"
4357
#include "DataFormatsEMCAL/Cell.h"
4458
#include "DataFormatsEMCAL/CellLabel.h"
4559
#include "DataFormatsEMCAL/Constants.h"
@@ -49,7 +63,9 @@
4963
#include "EMCALBase/NonlinearityHandler.h"
5064
#include "EMCALReconstruction/Clusterizer.h"
5165
#include "PWGJE/Core/JetUtilities.h"
66+
#include "GPUROOTCartesianFwd.h"
5267
#include "TVector2.h"
68+
#include "TH1.h"
5369

5470
using namespace o2;
5571
using namespace o2::framework;
@@ -97,6 +113,7 @@ struct EmcalCorrectionTask {
97113
Configurable<bool> isMC{"isMC", false, "States if run over MC"};
98114
Configurable<bool> applyCellTimeCorrection{"applyCellTimeCorrection", true, "apply a correction to the cell time for data and MC: Shift both average cell times to 0 and smear MC time distribution to fit data better. For MC requires isMC to be true"};
99115
Configurable<float> trackMinPt{"trackMinPt", 0.3, "Minimum pT for tracks to perform track matching, to reduce computing time. Tracks below a certain pT will be loopers anyway."};
116+
Configurable<bool> fillQA{"fillQA", false, "Switch to turn on QA histograms."};
100117

101118
// Require EMCAL cells (CALO type 1)
102119
Filter emccellfilter = aod::calo::caloType == selectedCellType;
@@ -206,22 +223,26 @@ struct EmcalCorrectionTask {
206223
// Setup QA hists.
207224
// NOTE: This is not comprehensive.
208225
using O2HistType = o2::framework::HistType;
209-
o2::framework::AxisSpec energyAxis{200, 0., 100., "E (GeV)"},
210-
timeAxis{300, -100, 200., "t (ns)"},
211-
etaAxis{160, -0.8, 0.8, "#eta"},
212-
phiAxis{72, 0, 2 * 3.14159, "phi"},
213-
nlmAxis{50, -0.5, 49.5, "NLM"};
214-
mHistManager.add("hCellE", "hCellE", O2HistType::kTH1F, {energyAxis});
226+
o2::framework::AxisSpec energyAxis{200, 0., 100., "#it{E} (GeV)"},
227+
timeAxis{300, -100, 200., "#it{t} (ns)"},
228+
etaAxis{160, -0.8, 0.8, "#it{#eta}"},
229+
phiAxis{72, 0, 2 * 3.14159, "#it{#varphi} (rad)"},
230+
nlmAxis{50, -0.5, 49.5, "NLM"},
231+
fCrossAxis{100, 0., 1., "F_{+}"},
232+
sigmaLongAxis{100, 0., 1.0, "#sigma^{2}_{long}"},
233+
sigmaShortAxis{100, 0., 1.0, "#sigma^{2}_{short}"},
234+
nCellAxis{60, -0.5, 59.5, "#it{n}_{cells}"};
235+
mHistManager.add("hCellE", "hCellE", O2HistType::kTH1D, {energyAxis});
215236
mHistManager.add("hCellTowerID", "hCellTowerID", O2HistType::kTH1D, {{20000, 0, 20000}});
216237
mHistManager.add("hCellEtaPhi", "hCellEtaPhi", O2HistType::kTH2F, {etaAxis, phiAxis});
217238
mHistManager.add("hHGCellTimeEnergy", "hCellTime", O2HistType::kTH2F, {{300, -30, 30}, cellEnergyBins}); // Cell time vs energy for high gain cells (low energies)
218239
mHistManager.add("hLGCellTimeEnergy", "hCellTime", O2HistType::kTH2F, {{300, -30, 30}, cellEnergyBins}); // Cell time vs energy for low gain cells (high energies)
219240
// NOTE: Reversed column and row because it's more natural for presentation.
220241
mHistManager.add("hCellRowCol", "hCellRowCol;Column;Row", O2HistType::kTH2D, {{96, -0.5, 95.5}, {208, -0.5, 207.5}});
221-
mHistManager.add("hClusterE", "hClusterE", O2HistType::kTH1F, {energyAxis});
222-
mHistManager.add("hClusterNLM", "hClusterNLM", O2HistType::kTH1F, {nlmAxis});
242+
mHistManager.add("hClusterE", "hClusterE", O2HistType::kTH1D, {energyAxis});
243+
mHistManager.add("hClusterNLM", "hClusterNLM", O2HistType::kTH1D, {nlmAxis});
223244
mHistManager.add("hClusterEtaPhi", "hClusterEtaPhi", O2HistType::kTH2F, {etaAxis, phiAxis});
224-
mHistManager.add("hClusterTime", "hClusterTime", O2HistType::kTH1F, {timeAxis});
245+
mHistManager.add("hClusterTime", "hClusterTime", O2HistType::kTH1D, {timeAxis});
225246
mHistManager.add("hGlobalTrackEtaPhi", "hGlobalTrackEtaPhi", O2HistType::kTH2F, {etaAxis, phiAxis});
226247
mHistManager.add("hGlobalTrackMult", "hGlobalTrackMult", O2HistType::kTH1D, {{200, -0.5, 199.5, "N_{trk}"}});
227248
mHistManager.add("hCollisionType", "hCollisionType;;#it{count}", O2HistType::kTH1D, {{3, -0.5, 2.5}});
@@ -251,9 +272,15 @@ struct EmcalCorrectionTask {
251272
hBC->GetXaxis()->SetBinLabel(6, "no EMCal cells and with collision");
252273
hBC->GetXaxis()->SetBinLabel(7, "no EMCal cells and mult. collisions");
253274
hBC->GetXaxis()->SetBinLabel(8, "all BC");
254-
if (isMC) {
255-
mHistManager.add("hContributors", "hContributors;contributor per cell hit;#it{counts}", O2HistType::kTH1I, {{20, 0, 20}});
256-
mHistManager.add("hMCParticleEnergy", "hMCParticleEnergy;#it{E} (GeV/#it{c});#it{counts}", O2HistType::kTH1F, {energyAxis});
275+
if (isMC.value) {
276+
mHistManager.add("hContributors", "hContributors;contributor per cell hit;#it{counts}", O2HistType::kTH1D, {{20, 0, 20}});
277+
mHistManager.add("hMCParticleEnergy", "hMCParticleEnergy;#it{E} (GeV/#it{c});#it{counts}", O2HistType::kTH1D, {energyAxis});
278+
}
279+
if (fillQA.value) {
280+
mHistManager.add("hClusterNCellE", "hClusterNCellE", O2HistType::kTH2D, {energyAxis, nCellAxis});
281+
mHistManager.add("hClusterFCrossE", "hClusterFCrossE", O2HistType::kTH2D, {energyAxis, fCrossAxis});
282+
mHistManager.add("hClusterFCrossSigmaLongE", "hClusterFCrossSigmaLongE", O2HistType::kTH3F, {energyAxis, fCrossAxis, sigmaLongAxis});
283+
mHistManager.add("hClusterFCrossSigmaShortE", "hClusterFCrossSigmaShortE", O2HistType::kTH3F, {energyAxis, fCrossAxis, sigmaShortAxis});
257284
}
258285

259286
// For some runs, LG cells require an extra time shift of 2 * 8.8ns due to problems in the time calibration
@@ -721,6 +748,12 @@ struct EmcalCorrectionTask {
721748
mHistManager.fill(HIST("hClusterNLM"), cluster.getNExMax());
722749
mHistManager.fill(HIST("hClusterTime"), cluster.getClusterTime());
723750
mHistManager.fill(HIST("hClusterEtaPhi"), pos.Eta(), TVector2::Phi_0_2pi(pos.Phi()));
751+
if (fillQA.value) {
752+
mHistManager.fill(HIST("hClusterNCellE"), cluster.E(), cluster.getNCells());
753+
mHistManager.fill(HIST("hClusterFCrossE"), cluster.E(), cluster.getFCross());
754+
mHistManager.fill(HIST("hClusterFCrossSigmaLongE"), cluster.E(), cluster.getFCross(), cluster.getM02());
755+
mHistManager.fill(HIST("hClusterFCrossSigmaShortE"), cluster.E(), cluster.getFCross(), cluster.getM20());
756+
}
724757
if (indexMapPair && trackGlobalIndex) {
725758
for (unsigned int iTrack = 0; iTrack < std::get<0>(*indexMapPair)[iCluster].size(); iTrack++) {
726759
if (std::get<0>(*indexMapPair)[iCluster][iTrack] >= 0) {

PWGJE/Tasks/emcClusterMonitor.cxx

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -100,31 +100,31 @@ struct ClusterMonitor {
100100
const AxisSpec thAxisCellTimeMean{1500, -600, 900, "#LT#it{t}_{cell}#GT (ns)"};
101101

102102
// event properties
103-
mHistManager.add("eventsAll", "Number of events", o2HistType::kTH1F, {{1, 0.5, 1.5}});
104-
mHistManager.add("eventsSelected", "Number of events", o2HistType::kTH1F, {{1, 0.5, 1.5}});
105-
mHistManager.add("eventBCAll", "Bunch crossing ID of event (all events)", o2HistType::kTH1F, {bcAxis});
106-
mHistManager.add("eventBCSelected", "Bunch crossing ID of event (selected events)", o2HistType::kTH1F, {bcAxis});
107-
mHistManager.add("eventVertexZAll", "z-vertex of event (all events)", o2HistType::kTH1F, {{200, -20, 20}});
108-
mHistManager.add("eventVertexZSelected", "z-vertex of event (selected events)", o2HistType::kTH1F, {{200, -20, 20}});
109-
mHistManager.add("numberOfClustersEvents", "number of clusters per event (selected events)", o2HistType::kTH1F, {numberClustersAxis});
110-
mHistManager.add("numberOfClustersBC", "number of clusters per bunch crossing (ambiguous BCs)", o2HistType::kTH1F, {numberClustersAxis});
111-
mHistManager.add("numberOfClustersEventsRejected", "number of clusters per event (rejected events)", o2HistType::kTH1F, {numberClustersAxis});
103+
mHistManager.add("eventsAll", "Number of events", o2HistType::kTH1D, {{1, 0.5, 1.5}});
104+
mHistManager.add("eventsSelected", "Number of events", o2HistType::kTH1D, {{1, 0.5, 1.5}});
105+
mHistManager.add("eventBCAll", "Bunch crossing ID of event (all events)", o2HistType::kTH1D, {bcAxis});
106+
mHistManager.add("eventBCSelected", "Bunch crossing ID of event (selected events)", o2HistType::kTH1D, {bcAxis});
107+
mHistManager.add("eventVertexZAll", "z-vertex of event (all events)", o2HistType::kTH1D, {{200, -20, 20}});
108+
mHistManager.add("eventVertexZSelected", "z-vertex of event (selected events)", o2HistType::kTH1D, {{200, -20, 20}});
109+
mHistManager.add("numberOfClustersEvents", "number of clusters per event (selected events)", o2HistType::kTH1D, {numberClustersAxis});
110+
mHistManager.add("numberOfClustersBC", "number of clusters per bunch crossing (ambiguous BCs)", o2HistType::kTH1D, {numberClustersAxis});
111+
mHistManager.add("numberOfClustersEventsRejected", "number of clusters per event (rejected events)", o2HistType::kTH1D, {numberClustersAxis});
112112
mHistManager.add("numberOfClustersSMEvents", "number of clusters per supermodule per event (selected events)", o2HistType::kTH2F, {numberClustersAxis, {20, -0.5, 19.5, "SupermoduleID"}});
113113
mHistManager.add("numberOfClustersSMBC", "number of clusters per supermodule per bunch crossing (ambiguous BCs)", o2HistType::kTH2F, {numberClustersAxis, {20, -0.5, 19.5, "SupermoduleID"}});
114114

115115
// cluster properties (matched clusters)
116-
mHistManager.add("clusterE", "Energy of cluster", o2HistType::kTH1F, {energyAxis});
117-
mHistManager.add("clusterEMatched", "Energy of cluster (with match)", o2HistType::kTH1F, {energyAxis});
116+
mHistManager.add("clusterE", "Energy of cluster", o2HistType::kTH1D, {energyAxis});
117+
mHistManager.add("clusterEMatched", "Energy of cluster (with match)", o2HistType::kTH1D, {energyAxis});
118118
mHistManager.add("clusterESupermodule", "Energy of the cluster vs. supermoduleID", o2HistType::kTH2F, {energyAxis, supermoduleAxis});
119-
mHistManager.add("clusterE_SimpleBinning", "Energy of cluster", o2HistType::kTH1F, {{2000, 0, 200}});
119+
mHistManager.add("clusterE_SimpleBinning", "Energy of cluster", o2HistType::kTH1D, {{2000, 0, 200}});
120120
mHistManager.add("clusterEtaPhi", "Eta and phi of cluster", o2HistType::kTH2F, {{100, -1, 1}, {100, 0, 2 * TMath::Pi()}});
121-
mHistManager.add("clusterM02", "M02 of cluster", o2HistType::kTH1F, {{400, 0, 5}});
122-
mHistManager.add("clusterM20", "M20 of cluster", o2HistType::kTH1F, {{400, 0, 2.5}});
123-
mHistManager.add("clusterNLM", "Number of local maxima of cluster", o2HistType::kTH1I, {{10, 0, 10}});
124-
mHistManager.add("clusterNCells", "Number of cells in cluster", o2HistType::kTH1I, {{50, 0, 50}});
125-
mHistManager.add("clusterDistanceToBadChannel", "Distance to bad channel", o2HistType::kTH1F, {{100, 0, 100}});
121+
mHistManager.add("clusterM02", "M02 of cluster", o2HistType::kTH1D, {{400, 0, 5}});
122+
mHistManager.add("clusterM20", "M20 of cluster", o2HistType::kTH1D, {{400, 0, 2.5}});
123+
mHistManager.add("clusterNLM", "Number of local maxima of cluster", o2HistType::kTH1D, {{10, 0, 10}});
124+
mHistManager.add("clusterNCells", "Number of cells in cluster", o2HistType::kTH1D, {{50, 0, 50}});
125+
mHistManager.add("clusterDistanceToBadChannel", "Distance to bad channel", o2HistType::kTH1D, {{100, 0, 100}});
126126
mHistManager.add("clusterTimeVsE", "Cluster time vs energy", o2HistType::kTH2F, {timeAxis, energyAxis});
127-
mHistManager.add("clusterAmpFractionLeadingCell", "Fraction of energy in leading cell", o2HistType::kTH1F, {{100, 0, 1}});
127+
mHistManager.add("clusterAmpFractionLeadingCell", "Fraction of energy in leading cell", o2HistType::kTH1D, {{100, 0, 1}});
128128
mHistManager.add("clusterCellTimeDiff", "Cell time difference in clusters", o2HistType::kTH1D, {thAxisCellTimeDiff});
129129
mHistManager.add("clusterCellTimeMean", "Mean cell time per cluster", o2HistType::kTH1D, {thAxisCellTimeMean});
130130

PWGJE/Tasks/jetHadronRecoil.cxx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,8 @@ struct JetHadronRecoil {
116116

117117
HistogramRegistry registry{"registry",
118118
{{"hNtrig", "number of triggers;trigger type;entries", {HistType::kTH1F, {{2, 0, 2}}}},
119+
{"hSignalTriggersPtHard", "Signal triggers vs PtHard", {HistType::kTH1F, {{20, 0, 5}}}},
120+
{"hReferenceTriggersPtHard", "Reference triggers vs PtHard", {HistType::kTH1F, {{20, 0, 5}}}},
119121
{"hZvtxSelected", "Z vertex position;Z_{vtx};entries", {HistType::kTH1F, {{80, -20, 20}}}},
120122
{"hPtTrack", "Track p_{T};p_{T};entries", {HistType::kTH1F, {{200, 0, 200}}}},
121123
{"hEtaTrack", "Track #eta;#eta;entries", {HistType::kTH1F, {{100, -1.0, 1.0}}}},
@@ -243,6 +245,7 @@ struct JetHadronRecoil {
243245
registry.fill(HIST("hNtrig"), 1.5, weight);
244246
registry.fill(HIST("hSigEventTriggers"), nTT, weight);
245247
registry.fill(HIST("hRhoSignal"), rho, weight);
248+
registry.fill(HIST("hSignalTriggersPtHard"), ptTT / pTHat, weight);
246249
}
247250
if (!isSigCol) {
248251
registry.fill(HIST("hNtrig"), 0.5, weight);
@@ -251,6 +254,7 @@ struct JetHadronRecoil {
251254
for (double shift = 0.0; shift <= 2.0; shift += 0.1) {
252255
registry.fill(HIST("hRhoReferenceShift"), rho + shift, shift, weight);
253256
}
257+
registry.fill(HIST("hReferenceTriggersPtHard"), ptTT / pTHat, weight);
254258
}
255259
}
256260

PWGLF/DataModel/LFHypernucleiKfTables.h

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ DECLARE_SOA_COLUMN(Svx, svx, float); //!
4545
DECLARE_SOA_COLUMN(Svy, svy, float); //!
4646
DECLARE_SOA_COLUMN(Svz, svz, float); //!
4747
DECLARE_SOA_COLUMN(Occupancy, occupancy, int); //!
48+
DECLARE_SOA_COLUMN(RunNumber, runNumber, int); //!
4849
DECLARE_SOA_DYNAMIC_COLUMN(Pt, pt, [](float px, float py) { return RecoDecay::pt(std::array{px, py}); });
4950
DECLARE_SOA_DYNAMIC_COLUMN(Y, y, [](float E, float pz) { return 0.5 * std::log((E + pz) / (E - pz)); });
5051
DECLARE_SOA_DYNAMIC_COLUMN(Mass, mass, [](float E, float px, float py, float pz) { return std::sqrt(E * E - px * px - py * py - pz * pz); });
@@ -80,7 +81,8 @@ DECLARE_SOA_TABLE(HypKfColls, "AOD", "HYPKFCOLL",
8081
cent::CentFT0A,
8182
cent::CentFT0C,
8283
cent::CentFT0M,
83-
hykfmc::Occupancy);
84+
hykfmc::Occupancy,
85+
hykfmc::RunNumber);
8486
using HypKfColl = HypKfColls::iterator;
8587

8688
namespace hykftrk
@@ -102,22 +104,22 @@ DECLARE_SOA_DYNAMIC_COLUMN(Y, y, [](float pt, float eta, float mass) { return st
102104
DECLARE_SOA_DYNAMIC_COLUMN(Lambda, lambda, [](float eta) { return 1. / std::cosh(eta); });
103105
DECLARE_SOA_DYNAMIC_COLUMN(ItsNcluster, itsNcluster, [](uint32_t itsClusterSizes) {
104106
uint8_t n = 0;
105-
for (uint8_t i = 0; i < 7; i++) {
107+
for (uint8_t i = 0; i < 0x08; i++) {
106108
if (itsClusterSizes >> (4 * i) & 15)
107109
n++;
108110
}
109111
return n;
110112
});
111113
DECLARE_SOA_DYNAMIC_COLUMN(ItsFirstLayer, itsFirstLayer, [](uint32_t itsClusterSizes) {
112-
for (int i = 0; i < 8; i++) {
114+
for (int i = 0; i < 0x08; i++) {
113115
if (itsClusterSizes >> (4 * i) & 15)
114116
return i;
115117
}
116118
return -999;
117119
});
118120
DECLARE_SOA_DYNAMIC_COLUMN(ItsMeanClsSize, itsMeanClsSize, [](uint32_t itsClusterSizes) {
119121
int sum = 0, n = 0;
120-
for (int i = 0; i < 8; i++) {
122+
for (int i = 0; i < 0x08; i++) {
121123
sum += (itsClusterSizes >> (4 * i) & 15);
122124
if (itsClusterSizes >> (4 * i) & 15)
123125
n++;
@@ -194,9 +196,9 @@ DECLARE_SOA_DYNAMIC_COLUMN(Eta, eta, [](float px, float py, float pz) { return R
194196
DECLARE_SOA_DYNAMIC_COLUMN(Phi, phi, [](float px, float py) { return RecoDecay::phi(std::array{px, py}); });
195197
DECLARE_SOA_DYNAMIC_COLUMN(P, p, [](float px, float py, float pz) { return RecoDecay::p(px, py, pz); }); //
196198
DECLARE_SOA_DYNAMIC_COLUMN(Y, y, [](float px, float py, float pz, float mass) { return RecoDecay::y(std::array{px, py, pz}, mass); });
197-
DECLARE_SOA_DYNAMIC_COLUMN(McTrue, mcTrue, [](int hypKfMcPartId) { return hypKfMcPartId > 0; });
199+
DECLARE_SOA_DYNAMIC_COLUMN(McTrue, mcTrue, [](int hypKfMcPartId) { return hypKfMcPartId >= 0; });
198200
DECLARE_SOA_DYNAMIC_COLUMN(IsMatter, isMatter, [](int8_t species) { return species > 0; });
199-
DECLARE_SOA_DYNAMIC_COLUMN(Cascade, cascade, [](int hypDaughter) { return hypDaughter > 0; });
201+
DECLARE_SOA_DYNAMIC_COLUMN(Cascade, cascade, [](int hypDaughter) { return hypDaughter >= 0; });
200202
} // namespace hykfhyp
201203

202204
DECLARE_SOA_TABLE(HypKfHypNucs, "AOD", "HYPKFHYPNUC",

0 commit comments

Comments
 (0)