Skip to content

Commit 22eacb3

Browse files
committed
Ultra-central collisions with ZDC
1 parent 1663c69 commit 22eacb3

File tree

2 files changed

+290
-0
lines changed

2 files changed

+290
-0
lines changed

PWGLF/Tasks/GlobalEventProperties/CMakeLists.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,7 @@
99
# granted to it by virtue of its status as an Intergovernmental Organization
1010
# or submit itself to any jurisdiction.
1111

12+
o2physics_add_dpl_workflow(ucc-zdc-analysis
13+
SOURCES ucc-zdc-analysis.cxx
14+
PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore
15+
COMPONENT_NAME Analysis)
Lines changed: 286 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,286 @@
1+
// Copyright 2019-2020 CERN and copyright holders of ALICE O2.
2+
// See https://alice-o2.web.cern.ch/copyright for details of the copyright
3+
// holders. All rights not expressly granted are reserved.
4+
//
5+
// This software is distributed under the terms of the GNU General Public
6+
// License v3 (GPL Version 3), copied verbatim in the file "COPYING".
7+
//
8+
// In applying this license CERN does not waive the privileges and immunities
9+
// granted to it by virtue of its status as an Intergovernmental Organization
10+
// or submit itself to any jurisdiction.
11+
///
12+
/// \brief This task is an empty skeleton that fills a simple eta histogram.
13+
/// it is meant to be a blank page for further developments.
14+
/// \author everyone
15+
16+
#include "Common/CCDB/EventSelectionParams.h"
17+
#include "Common/CCDB/TriggerAliases.h"
18+
#include "Common/Core/TrackSelection.h"
19+
#include "Common/DataModel/Centrality.h"
20+
#include "Common/DataModel/EventSelection.h"
21+
#include "Common/DataModel/Multiplicity.h"
22+
#include "Common/DataModel/TrackSelectionTables.h"
23+
#include "Framework/AnalysisDataModel.h"
24+
#include "Framework/AnalysisTask.h"
25+
#include "Framework/HistogramRegistry.h"
26+
#include "Framework/runDataProcessing.h"
27+
#include "ReconstructionDataFormats/GlobalTrackID.h"
28+
#include "ReconstructionDataFormats/Track.h"
29+
30+
using namespace o2;
31+
using namespace o2::framework;
32+
using namespace o2::framework::expressions;
33+
using namespace o2::aod::evsel;
34+
35+
using ColEvSels = soa::Join<aod::Collisions, aod::EvSels>;
36+
using BCsRun3 = soa::Join<aod::BCs, aod::Timestamps, aod::BcSels,
37+
aod::Run3MatchedToBCSparse>;
38+
39+
struct UCCZDC {
40+
// Configurable number of bins
41+
Configurable<int> nBinsAmp{"nBinsAmp", 1025, "nbinsAmp"};
42+
Configurable<float> MaxZN{"MaxZN", 4099.5, "Max ZN signal"};
43+
Configurable<float> MaxZP{"MaxZP", 3099.5, "Max ZP signal"};
44+
Configurable<float> MaxZEM{"MaxZEM", 3099.5, "Max ZEM signal"};
45+
Configurable<int> nBinsTDC{"nBinsTDC", 480, "nbinsTDC"};
46+
47+
Configurable<int> nBinsFit{"nBinsFit", 1000, "nbinsFit"};
48+
Configurable<float> MaxMultFV0{"MaxMultFV0", 3000, "Max FV0 signal"};
49+
Configurable<float> MaxMultFT0{"MaxMultFT0", 3000, "Max FT0 signal"};
50+
Configurable<float> MaxMultFDD{"MaxMultFDD", 80000, "Max FDD signal"};
51+
52+
// Histogram registry: an object to hold your histograms
53+
HistogramRegistry histos{
54+
"histos", {}, OutputObjHandlingPolicy::AnalysisObject};
55+
56+
void init(InitContext const&) {
57+
// define axes you want to use
58+
const AxisSpec axisEvent{3, 0., +3.0, ""};
59+
const AxisSpec axisEta{30, -1.5, +1.5, "#eta"};
60+
61+
// create histograms
62+
histos.add("etaHistogram", "etaHistogram", kTH1F, {axisEta});
63+
histos.add("hEventCounter", "Event counter", kTH1F, {axisEvent});
64+
histos.add("ZNAcomm", "; ZNA common energy; Entries",
65+
{HistType::kTH1F, {{nBinsAmp, -0.5, MaxZN}}});
66+
histos.add("ZNCcomm", "; ZNC common energy; Entries",
67+
{HistType::kTH1F, {{nBinsAmp, -0.5, MaxZN}}});
68+
histos.add("ZNAcoll", "ZNAcoll; ZNA amplitude; Entries",
69+
{HistType::kTH1F, {{nBinsAmp, -0.5, MaxZN}}});
70+
histos.add("ZPAcoll", "ZPAcoll; ZPA amplitude; Entries",
71+
{HistType::kTH1F, {{nBinsAmp, -0.5, MaxZP}}});
72+
histos.add("ZNCcoll", "ZNCcoll; ZNC amplitude; Entries",
73+
{HistType::kTH1F, {{nBinsAmp, -0.5, MaxZN}}});
74+
histos.add("ZPCcoll", "ZPCcoll; ZPC amplitude; Entries",
75+
{HistType::kTH1F, {{nBinsAmp, -0.5, MaxZP}}});
76+
histos.add("ZEM1coll", "ZEM1coll; ZEM1 amplitude; Entries",
77+
{HistType::kTH1F, {{nBinsAmp, -0.5, MaxZEM}}});
78+
histos.add("ZEM2coll", "ZEM2coll; ZEM2 amplitude; Entries",
79+
{HistType::kTH1F, {{nBinsAmp, -0.5, MaxZEM}}});
80+
histos.add("ZNvsZEMcoll", "ZNvsZEMcoll; ZEM; ZNA+ZNC",
81+
{HistType::kTH2F,
82+
{{{nBinsAmp, -0.5, MaxZEM}, {nBinsAmp, -0.5, 2. * MaxZN}}}});
83+
histos.add("ZNAvsZNCcoll", "ZNAvsZNCcoll; ZNC; ZNA",
84+
{HistType::kTH2F,
85+
{{{nBinsAmp, -0.5, MaxZN}, {nBinsAmp, -0.5, MaxZN}}}});
86+
histos.add("ZPAvsZPCcoll", "ZPAvsZPCcoll; ZPA; ZPC",
87+
{HistType::kTH2F,
88+
{{{nBinsAmp, -0.5, MaxZP}, {nBinsAmp, -0.5, MaxZP}}}});
89+
histos.add("ZNAvsZPAcoll", "ZNAvsZPAcoll; ZPA; ZNA",
90+
{HistType::kTH2F,
91+
{{{nBinsAmp, -0.5, MaxZP}, {nBinsAmp, -0.5, MaxZN}}}});
92+
histos.add("ZNCvsZPCcoll", "ZNCvsZPCcoll; ZPC; ZNC",
93+
{HistType::kTH2F,
94+
{{{nBinsAmp, -0.5, MaxZP}, {nBinsAmp, -0.5, MaxZN}}}});
95+
//
96+
histos.add("ZNCvstdccoll", "ZNCvstdccoll; time ZNC; ZNC",
97+
{HistType::kTH2F,
98+
{{{nBinsTDC, -13.5, 11.45}, {nBinsAmp, -0.5, MaxZN}}}});
99+
histos.add("ZNAvstdccoll", "ZNAvstdccoll; time ZNA; ZNA",
100+
{HistType::kTH2F,
101+
{{{nBinsTDC, -13.5, 11.45}, {nBinsAmp, -0.5, MaxZN}}}});
102+
histos.add("ZPCvstdccoll", "ZPCvstdccoll; time ZPC; ZPC",
103+
{HistType::kTH2F,
104+
{{{nBinsTDC, -13.5, 11.45}, {nBinsAmp, -0.5, MaxZP}}}});
105+
histos.add("ZPAvstdccoll", "ZPAvstdccoll; time ZPA; ZPA",
106+
{HistType::kTH2F,
107+
{{{nBinsTDC, -13.5, 11.45}, {nBinsAmp, -0.5, MaxZP}}}});
108+
histos.add("ZEM1vstdccoll", "ZEM1vstdccoll; time ZEM1; ZEM1",
109+
{HistType::kTH2F,
110+
{{{nBinsTDC, -13.5, 11.45}, {nBinsAmp, -0.5, MaxZEM}}}});
111+
histos.add("ZEM2vstdccoll", "ZEM2vstdccoll; time ZEM2; ZEM2",
112+
{HistType::kTH2F,
113+
{{{nBinsTDC, -13.5, 11.45}, {nBinsAmp, -0.5, MaxZEM}}}});
114+
histos.add("debunch", "ZN sum vs. ZN diff.",
115+
{HistType::kTH2F, {{{240, -12., 12.}, {240, -12., 12.}}}});
116+
// histos.add("centroidZNA", "ZNA centroid",
117+
// {HistType::kTH2F, {{{350, -1.75, 1.75}, {350,
118+
// -1.75, 1.75}}}});
119+
120+
// if (processZdcCollAss) {
121+
// histos.add("centroidZNC", "ZNC centroid",
122+
// {HistType::kTH2F, {{{350, -1.75, 1.75}, {350,
123+
// -1.75, 1.75}}}});
124+
// }
125+
histos.add("ZNvsFV0Acorrel", "ZNvsFV0Acorrel",
126+
{HistType::kTH2F,
127+
{{{nBinsFit, 0., MaxMultFV0}, {nBinsAmp, -0.5, 2. * MaxZN}}}});
128+
histos.add("ZNvsFT0correl", "ZNvsFT0correl",
129+
{HistType::kTH2F,
130+
{{{nBinsFit, 0., MaxMultFT0}, {nBinsAmp, -0.5, 2. * MaxZN}}}});
131+
}
132+
133+
void processZdcCollAss(
134+
ColEvSels const& cols, BCsRun3 const& /*bcs*/, aod::Zdcs const& /*zdcs*/,
135+
aod::FV0As const& /*fv0as*/, aod::FT0s const& /*ft0s*/,
136+
soa::Join<aod::Tracks, aod::TracksExtra, aod::TracksDCA> const& tracks) {
137+
for (auto& collision : cols) {
138+
histos.fill(HIST("hEventCounter"), 0.5);
139+
if (!collision.sel8()) {
140+
return;
141+
}
142+
143+
histos.fill(HIST("hEventCounter"), 1.5);
144+
145+
const auto& foundBC = collision.foundBC_as<BCsRun3>();
146+
if (foundBC.has_zdc()) {
147+
histos.fill(HIST("hEventCounter"), 2.5);
148+
149+
const auto& zdcread = foundBC.zdc();
150+
auto aZNA = zdcread.amplitudeZNA();
151+
auto aZNC = zdcread.amplitudeZNC();
152+
auto aZPA = zdcread.amplitudeZPA();
153+
auto aZPC = zdcread.amplitudeZPC();
154+
auto aZEM1 = zdcread.amplitudeZEM1();
155+
auto aZEM2 = zdcread.amplitudeZEM2();
156+
auto tZEM1 = zdcread.timeZEM1();
157+
auto tZEM2 = zdcread.timeZEM2();
158+
auto tZNA = zdcread.timeZNA();
159+
auto tZNC = zdcread.timeZNC();
160+
auto tZPA = zdcread.timeZPA();
161+
auto tZPC = zdcread.timeZPC();
162+
float multT0A{0.};
163+
float multT0C{0.};
164+
float multV0A{0.};
165+
166+
if (foundBC.has_ft0()) {
167+
for (auto amplitude : foundBC.ft0().amplitudeA()) {
168+
multT0A += amplitude;
169+
}
170+
for (auto amplitude : foundBC.ft0().amplitudeC()) {
171+
multT0C += amplitude;
172+
}
173+
} else {
174+
multT0A = multT0C = -999;
175+
}
176+
177+
if (foundBC.has_fv0a()) {
178+
for (auto amplitude : foundBC.fv0a().amplitude()) {
179+
multV0A += amplitude;
180+
}
181+
} else {
182+
multV0A = -999;
183+
}
184+
185+
histos.get<TH1>(HIST("ZNAcomm"))->Fill(zdcread.energyCommonZNA());
186+
histos.get<TH1>(HIST("ZNCcomm"))->Fill(zdcread.energyCommonZNC());
187+
histos.get<TH1>(HIST("ZNAcoll"))->Fill(aZNA);
188+
histos.get<TH1>(HIST("ZNCcoll"))->Fill(aZNC);
189+
histos.get<TH1>(HIST("ZPAcoll"))->Fill(aZPA);
190+
histos.get<TH1>(HIST("ZPCcoll"))->Fill(aZPC);
191+
histos.get<TH2>(HIST("ZNvsZEMcoll"))->Fill(aZEM1 + aZEM2, aZNA + aZNC);
192+
histos.get<TH2>(HIST("ZNAvsZNCcoll"))->Fill(aZNC, aZNA);
193+
histos.get<TH2>(HIST("ZPAvsZPCcoll"))->Fill(aZPC, aZPA);
194+
histos.get<TH2>(HIST("ZNAvsZPAcoll"))->Fill(aZPA, aZNA);
195+
histos.get<TH2>(HIST("ZNCvsZPCcoll"))->Fill(aZPC, aZNC);
196+
197+
histos.get<TH1>(HIST("ZEM1coll"))->Fill(aZEM1);
198+
histos.get<TH1>(HIST("ZEM2coll"))->Fill(aZEM2);
199+
histos.get<TH2>(HIST("ZNCvstdccoll"))->Fill(tZNC, aZNC);
200+
histos.get<TH2>(HIST("ZNAvstdccoll"))->Fill(tZNA, aZNA);
201+
histos.get<TH2>(HIST("ZPCvstdccoll"))->Fill(tZPC, aZPC);
202+
histos.get<TH2>(HIST("ZPAvstdccoll"))->Fill(tZPA, aZPA);
203+
histos.get<TH2>(HIST("ZEM1vstdccoll"))->Fill(tZEM1, aZEM1);
204+
histos.get<TH2>(HIST("ZEM2vstdccoll"))->Fill(tZEM2, aZEM2);
205+
histos.get<TH2>(HIST("debunch"))->Fill(tZNA - tZNC, tZNA + tZNC);
206+
207+
histos.get<TH2>(HIST("ZNvsFV0Acorrel"))
208+
->Fill(multV0A / 100., aZNA + aZNC);
209+
histos.get<TH2>(HIST("ZNvsFT0correl"))
210+
->Fill((multT0A + multT0C) / 100., aZNC + aZNA);
211+
} // foundBC.has_zdc()
212+
213+
for (auto& track : tracks) {
214+
if (track.tpcNClsCrossedRows() < 70) continue;
215+
if (fabs(track.dcaXY()) > 0.2) continue;
216+
217+
histos.fill(HIST("etaHistogram"), track.eta());
218+
}
219+
}
220+
}
221+
PROCESS_SWITCH(UCCZDC, processZdcCollAss,
222+
"Processing ZDC w. collision association", true);
223+
224+
// void processZdcCorrela(
225+
// soa::Join<aod::Collisions, aod::EvSels>::iterator const& coll,
226+
// BCsRun3 const& /*bcs*/, aod::Zdcs const& /*zdcs*/,
227+
// aod::FV0As const& /*fv0as*/, aod::FT0s const& /*ft0s*/,
228+
// aod::FDDs const& /*fdds*/) {
229+
// const auto& foundBC = coll.foundBC_as<BCsRun3>();
230+
//
231+
// // FT0
232+
// float multT0A = 0.;
233+
// float multT0C = 0.;
234+
// if (foundBC.has_ft0()) {
235+
// for (auto amplitude : foundBC.ft0().amplitudeA()) {
236+
// multT0A += amplitude;
237+
// }
238+
// for (auto amplitude : foundBC.ft0().amplitudeC()) {
239+
// multT0C += amplitude;
240+
// }
241+
// } else {
242+
// multT0A = multT0C = -999;
243+
// }
244+
// // FV0
245+
// float multV0A = 0;
246+
// if (foundBC.has_fv0a()) {
247+
// for (auto amplitude : foundBC.fv0a().amplitude()) {
248+
// multV0A += amplitude;
249+
// }
250+
// } else {
251+
// multV0A = -999;
252+
// }
253+
// // FDD
254+
// float multFDA = 0;
255+
// float multFDC = 0;
256+
// if (foundBC.has_fdd()) {
257+
// auto const& fdd = foundBC.fdd();
258+
// for (auto const& amplitude : fdd.chargeA()) {
259+
// multFDA += amplitude;
260+
// }
261+
// for (auto const& amplitude : fdd.chargeC()) {
262+
// multFDC += amplitude;
263+
// }
264+
// } else {
265+
// multFDA = multFDC = -999;
266+
// }
267+
//
268+
// if (foundBC.has_zdc()) {
269+
// const auto& zdcread = foundBC.zdc();
270+
// auto aZNA = zdcread.amplitudeZNA();
271+
// auto aZNC = zdcread.amplitudeZNC();
272+
// histos.get<TH2>(HIST("ZNvsFV0Acorrel"))
273+
// ->Fill(multV0A / 100., aZNA + aZNC);
274+
// histos.get<TH2>(HIST("ZNvsFT0correl"))
275+
// ->Fill((multT0A + multT0C) / 100., aZNC + aZNA);
276+
// histos.get<TH2>(HIST("ZNvsFDDcorrel"))
277+
// ->Fill(multFDC + multFDA, aZNC + aZNA);
278+
// }
279+
// }
280+
// PROCESS_SWITCH(UCCZDC, processZdcCorrela,
281+
// "Processing ZDC vs. mult. w. collision association", true);
282+
};
283+
284+
WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) {
285+
return WorkflowSpec{adaptAnalysisTask<UCCZDC>(cfgc)};
286+
}

0 commit comments

Comments
 (0)