|
18 | 18 | /// \author Raymond Ehlers (raymond.ehlers@cern.ch) ORNL, Florian Jonas (florian.jonas@cern.ch) |
19 | 19 | /// |
20 | 20 |
|
21 | | -#include <algorithm> |
| 21 | +#include <gsl/span> |
| 22 | +#include <fairlogger/Logger.h> |
| 23 | +#include <cstdint> |
| 24 | +#include <cstddef> |
22 | 25 | #include <memory> |
| 26 | +#include <sstream> |
23 | 27 | #include <unordered_map> |
24 | 28 | #include <cmath> |
25 | 29 | #include <string> |
26 | 30 | #include <tuple> |
| 31 | +#include <utility> |
27 | 32 | #include <vector> |
28 | 33 | #include <random> |
29 | 34 |
|
30 | 35 | #include "CCDB/BasicCCDBManager.h" |
31 | 36 | #include "Framework/runDataProcessing.h" |
32 | | -#include "Framework/AnalysisTask.h" |
33 | 37 | #include "Framework/AnalysisDataModel.h" |
| 38 | +#include "Framework/AnalysisTask.h" |
| 39 | +#include "Framework/AnalysisHelpers.h" |
34 | 40 | #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" |
35 | 47 |
|
36 | 48 | #include "DetectorsBase/GeometryManager.h" |
37 | 49 |
|
| 50 | +#include "PWGJE/DataModel/EMCALClusterDefinition.h" |
38 | 51 | #include "PWGJE/DataModel/EMCALClusters.h" |
39 | 52 | #include "PWGJE/DataModel/EMCALMatchedCollisions.h" |
40 | 53 |
|
41 | 54 | #include "Common/DataModel/EventSelection.h" |
42 | 55 | #include "Common/DataModel/TrackSelectionTables.h" |
| 56 | +#include "DataFormatsEMCAL/ClusterLabel.h" |
43 | 57 | #include "DataFormatsEMCAL/Cell.h" |
44 | 58 | #include "DataFormatsEMCAL/CellLabel.h" |
45 | 59 | #include "DataFormatsEMCAL/Constants.h" |
|
49 | 63 | #include "EMCALBase/NonlinearityHandler.h" |
50 | 64 | #include "EMCALReconstruction/Clusterizer.h" |
51 | 65 | #include "PWGJE/Core/JetUtilities.h" |
| 66 | +#include "GPUROOTCartesianFwd.h" |
52 | 67 | #include "TVector2.h" |
| 68 | +#include "TH1.h" |
53 | 69 |
|
54 | 70 | using namespace o2; |
55 | 71 | using namespace o2::framework; |
@@ -97,6 +113,7 @@ struct EmcalCorrectionTask { |
97 | 113 | Configurable<bool> isMC{"isMC", false, "States if run over MC"}; |
98 | 114 | 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"}; |
99 | 115 | 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."}; |
100 | 117 |
|
101 | 118 | // Require EMCAL cells (CALO type 1) |
102 | 119 | Filter emccellfilter = aod::calo::caloType == selectedCellType; |
@@ -206,22 +223,26 @@ struct EmcalCorrectionTask { |
206 | 223 | // Setup QA hists. |
207 | 224 | // NOTE: This is not comprehensive. |
208 | 225 | 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}); |
215 | 236 | mHistManager.add("hCellTowerID", "hCellTowerID", O2HistType::kTH1D, {{20000, 0, 20000}}); |
216 | 237 | mHistManager.add("hCellEtaPhi", "hCellEtaPhi", O2HistType::kTH2F, {etaAxis, phiAxis}); |
217 | 238 | mHistManager.add("hHGCellTimeEnergy", "hCellTime", O2HistType::kTH2F, {{300, -30, 30}, cellEnergyBins}); // Cell time vs energy for high gain cells (low energies) |
218 | 239 | mHistManager.add("hLGCellTimeEnergy", "hCellTime", O2HistType::kTH2F, {{300, -30, 30}, cellEnergyBins}); // Cell time vs energy for low gain cells (high energies) |
219 | 240 | // NOTE: Reversed column and row because it's more natural for presentation. |
220 | 241 | 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}); |
223 | 244 | mHistManager.add("hClusterEtaPhi", "hClusterEtaPhi", O2HistType::kTH2F, {etaAxis, phiAxis}); |
224 | | - mHistManager.add("hClusterTime", "hClusterTime", O2HistType::kTH1F, {timeAxis}); |
| 245 | + mHistManager.add("hClusterTime", "hClusterTime", O2HistType::kTH1D, {timeAxis}); |
225 | 246 | mHistManager.add("hGlobalTrackEtaPhi", "hGlobalTrackEtaPhi", O2HistType::kTH2F, {etaAxis, phiAxis}); |
226 | 247 | mHistManager.add("hGlobalTrackMult", "hGlobalTrackMult", O2HistType::kTH1D, {{200, -0.5, 199.5, "N_{trk}"}}); |
227 | 248 | mHistManager.add("hCollisionType", "hCollisionType;;#it{count}", O2HistType::kTH1D, {{3, -0.5, 2.5}}); |
@@ -251,9 +272,15 @@ struct EmcalCorrectionTask { |
251 | 272 | hBC->GetXaxis()->SetBinLabel(6, "no EMCal cells and with collision"); |
252 | 273 | hBC->GetXaxis()->SetBinLabel(7, "no EMCal cells and mult. collisions"); |
253 | 274 | 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}); |
257 | 284 | } |
258 | 285 |
|
259 | 286 | // 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 { |
721 | 748 | mHistManager.fill(HIST("hClusterNLM"), cluster.getNExMax()); |
722 | 749 | mHistManager.fill(HIST("hClusterTime"), cluster.getClusterTime()); |
723 | 750 | 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 | + } |
724 | 757 | if (indexMapPair && trackGlobalIndex) { |
725 | 758 | for (unsigned int iTrack = 0; iTrack < std::get<0>(*indexMapPair)[iCluster].size(); iTrack++) { |
726 | 759 | if (std::get<0>(*indexMapPair)[iCluster][iTrack] >= 0) { |
|
0 commit comments