Skip to content

Commit a24fd98

Browse files
author
Bong-Hwi Lim
committed
Merge remote-tracking branch 'upstream/master' into reso-omega2012-ml
# Conflicts: # PWGLF/Tasks/Resonances/k1AnalysisMicro.cxx
2 parents a65ab42 + b286a24 commit a24fd98

266 files changed

Lines changed: 17569 additions & 3544 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎ALICE3/TableProducer/OTF/onTheFlyTofPid.cxx‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -166,8 +166,8 @@ struct OnTheFlyTofPid {
166166
std::array<std::array<std::shared_ptr<TH2>, NParticles>, NParticles> h2dOuterDeltaTrue;
167167

168168
struct ParticleInfo {
169-
std::string_view texName{};
170-
std::string_view name{};
169+
std::string_view texName;
170+
std::string_view name;
171171
ParticleId type{};
172172
int pdgCode{};
173173
double mass{};
@@ -347,7 +347,7 @@ struct OnTheFlyTofPid {
347347
if (!doQaForParticle(Particles[iHyp].pdgCode)) {
348348
continue;
349349
}
350-
const auto& pNameHypo = Particles[iHyp].texName;
350+
const auto& pNameHypo = Particles[iHyp].name;
351351

352352
const std::string nameTitleInner = std::format("h2dInnerNsigmaTrue{}Vs{}", pNameTrue, pNameHypo);
353353
const std::string nameTitleOuter = std::format("h2dOuterNsigmaTrue{}Vs{}", pNameTrue, pNameHypo);

‎Common/DataModel/Multiplicity.h‎

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,7 @@ DECLARE_SOA_COLUMN(TimeToNeNext, timeToNeNext, float); //!
103103
DECLARE_SOA_COLUMN(FT0TriggerMask, ft0TriggerMask, uint8_t); //!
104104
DECLARE_SOA_COLUMN(MultFV0AOuter, multFV0AOuter, float); //! FV0 without innermost ring
105105
DECLARE_SOA_COLUMN(MultFT0AOuter, multFT0AOuter, float); //! FT0A without innermost ring
106+
DECLARE_SOA_COLUMN(MultFT0COuter, multFT0COuter, float); //! FT0C without innermost ring
106107

107108
// Timing information
108109
DECLARE_SOA_COLUMN(TimeZNA, timeZNA, float); //!
@@ -144,7 +145,7 @@ DECLARE_SOA_TABLE(MFTMults, "AOD", "MFTMULT", //! Multiplicity with MFT
144145
DECLARE_SOA_TABLE(FITExtraMults, "AOD", "FITEXTRAMULT", //! Extra information from FIT detectors
145146
mult::MultFV0AOuter,
146147
mult::MultFT0AOuter,
147-
mult::FT0TriggerMask);
148+
mult::MultFT0COuter);
148149

149150
using BarrelMults = soa::Join<TrackletMults, TPCMults, PVMults>;
150151
using Mults = soa::Join<BarrelMults, FV0Mults, FT0Mults, FDDMults, ZDCMults>;
@@ -216,6 +217,8 @@ DECLARE_SOA_TABLE_VERSIONED(MultMCExtras_001, "AOD", "MULTMCEXTRA", 1, //! Table
216217
using MultMCExtras = MultMCExtras_001;
217218
using MultMCExtra = MultMCExtras::iterator;
218219
using MultsExtraMC = MultMCExtras; // for backwards compatibility with previous naming scheme
220+
template <aod::is_origin_hash O>
221+
using MultsExtraMCFrom = MultMCExtras_001From<O>;
219222

220223
// crosslinks
221224
namespace mult
@@ -311,6 +314,22 @@ DECLARE_SOA_TABLE_VERSIONED(MultBCs_001, "AOD", "MULTBC", 1, //!
311314
mult::MultFV0AOuter,
312315
mult::MultFT0AOuter);
313316

317+
DECLARE_SOA_TABLE_VERSIONED(MultBCs_002, "AOD", "MULTBC", 2, //!
318+
mult::MultFT0A,
319+
mult::MultFT0C,
320+
mult::MultFV0A,
321+
mult::MultFDDA,
322+
mult::MultFDDC,
323+
mult::MultZNA,
324+
mult::MultZNC,
325+
mult::MultZEM1,
326+
mult::MultZEM2,
327+
mult::MultZPA,
328+
mult::MultZPC,
329+
mult::MultFV0AOuter,
330+
mult::MultFT0AOuter,
331+
mult::MultFT0COuter);
332+
314333
DECLARE_SOA_TABLE(MultBcSel_000, "AOD", "MULTBCSEL", //! BC selection bits joinable with multBCs
315334
evsel::Selection);
316335

@@ -339,7 +358,7 @@ DECLARE_SOA_TABLE(TimeBCs, "AOD", "TIMEBC", //!
339358
mult::TimeZPA,
340359
mult::TimeZPC)
341360

342-
using MultBCs = MultBCs_001;
361+
using MultBCs = MultBCs_002;
343362
using MultBcSel = MultBcSel_001;
344363
using MultBC = MultBCs::iterator;
345364

‎Common/DataModel/ZDCLightIons.h‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,8 @@ DECLARE_SOA_COLUMN(CentralityFt0c, centralityFt0c, float); //! Centrality
5656
DECLARE_SOA_COLUMN(CentralityFt0a, centralityFt0a, float); //! Centrality
5757
DECLARE_SOA_COLUMN(CentralityFt0m, centralityFt0m, float); //! Centrality
5858
DECLARE_SOA_COLUMN(Timestamp, timestamp, uint64_t); //! Timestamp
59-
DECLARE_SOA_COLUMN(SelectionBits, selectionBits, uint8_t); //! Selection Flags
59+
DECLARE_SOA_COLUMN(SelectionBits, selectionBits, uint8_t); //! Selection flags x collisions
60+
DECLARE_SOA_COLUMN(BcMask, bcMask, uint8_t); //! Selection flags x BC
6061
} // namespace zdclightions
6162

6263
DECLARE_SOA_TABLE(ZDCLightIons, "AOD", "ZDCTABLELIGHTIONS",
@@ -92,7 +93,8 @@ DECLARE_SOA_TABLE(ZDCLightIons, "AOD", "ZDCTABLELIGHTIONS",
9293
zdclightions::CentralityFt0a,
9394
zdclightions::CentralityFt0m,
9495
zdclightions::Timestamp,
95-
zdclightions::SelectionBits);
96+
zdclightions::SelectionBits,
97+
zdclightions::BcMask);
9698
} // namespace o2::aod
9799

98100
#endif // COMMON_DATAMODEL_ZDCLIGHTIONS_H_

‎Common/TableProducer/Converters/CMakeLists.txt‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,3 +118,8 @@ o2physics_add_dpl_workflow(mult-bcs-converter
118118
SOURCES multBCsConverter.cxx
119119
PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore
120120
COMPONENT_NAME Analysis)
121+
122+
o2physics_add_dpl_workflow(mult-bcs-002-converter
123+
SOURCES multBCs002Converter.cxx
124+
PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore
125+
COMPONENT_NAME Analysis)
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
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 holders.
3+
// 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+
/// \file multBCs002Converter.cxx
13+
/// \brief Converts MultBCs table from version 001 to 002
14+
/// \author Jesper Karlsson Gumrpecht
15+
16+
#include "Common/DataModel/Multiplicity.h"
17+
18+
#include <Framework/AnalysisDataModel.h>
19+
#include <Framework/AnalysisHelpers.h>
20+
#include <Framework/AnalysisTask.h>
21+
#include <Framework/runDataProcessing.h>
22+
23+
struct MultBCs002Converter {
24+
o2::framework::Produces<o2::aod::MultBCs_002> multBC;
25+
static constexpr float DummyValue = -1.f;
26+
void process(o2::aod::MultBCs_001 const& multBCs)
27+
{
28+
multBC.reserve(multBCs.size());
29+
for (const auto& multbc : multBCs) {
30+
multBC(multbc.multFT0A(),
31+
multbc.multFT0C(),
32+
multbc.multFV0A(),
33+
multbc.multFDDA(),
34+
multbc.multFDDC(),
35+
multbc.multZNA(),
36+
multbc.multZNC(),
37+
multbc.multZEM1(),
38+
multbc.multZEM2(),
39+
multbc.multZPA(),
40+
multbc.multZPC(),
41+
multbc.multFV0AOuter(),
42+
multbc.multFT0AOuter(),
43+
DummyValue /* dummy amplitude for FT0C Outer */);
44+
}
45+
}
46+
};
47+
48+
o2::framework::WorkflowSpec defineDataProcessing(o2::framework::ConfigContext const& cfgc)
49+
{
50+
return o2::framework::WorkflowSpec{adaptAnalysisTask<MultBCs002Converter>(cfgc)};
51+
}

‎Common/TableProducer/multiplicityExtraTable.cxx‎

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@ using namespace o2;
4444
using namespace o2::framework;
4545
using namespace o2::framework::expressions;
4646
using BCPattern = std::bitset<o2::constants::lhc::LHCMaxBunches>;
47-
const int nBCsPerOrbit = o2::constants::lhc::LHCMaxBunches;
4847

4948
struct MultiplicityExtraTable {
5049
Produces<aod::MultBCs> multBC;
@@ -62,6 +61,7 @@ struct MultiplicityExtraTable {
6261
Configurable<float> bcDownscaleFactor{"bcDownscaleFactor", 2, "Downscale factor for BC table (0: save nothing, 1: save all)"};
6362
Configurable<float> minFT0CforBCTable{"minFT0CforBCTable", 25.0f, "Minimum FT0C amplitude to fill BC table to reduce data"};
6463
Configurable<bool> saveOnlyBCsWithCollisions{"saveOnlyBCsWithCollisions", true, "save only BCs with collisions in them"};
64+
Configurable<bool> requestMinSignalForFT0C{"requestMinSignalForFT0C", true, "save only BCs with minimum FT0C signal"};
6565

6666
Configurable<float> bcTableFloatPrecision{"bcTableFloatPrecision", 0.1, "float precision in bc table for data reduction"};
6767

@@ -126,14 +126,14 @@ struct MultiplicityExtraTable {
126126
float multFT0C = 0.f;
127127
if (bc.has_ft0()) {
128128
auto ft0 = bc.ft0();
129-
for (const auto amplitude : ft0.amplitudeC()) {
129+
for (const auto amplitude : ft0.amplitudeC()) { // o2-linter: disable=const-ref-in-for-loop (cheap float copy)
130130
multFT0C += amplitude;
131131
}
132132
} else {
133133
multFT0C = -999.0f;
134134
}
135135

136-
if (multFT0C < minFT0CforBCTable) {
136+
if (requestMinSignalForFT0C && multFT0C < minFT0CforBCTable) {
137137
continue; // skip this event
138138
}
139139

@@ -166,6 +166,7 @@ struct MultiplicityExtraTable {
166166
float multFDDA = 0.f;
167167
float multFDDC = 0.f;
168168
float multFT0AOuter = 0.f;
169+
float multFT0COuter = 0.f;
169170
float multFV0AOuter = 0.f;
170171

171172
// ZDC amplitudes
@@ -196,7 +197,7 @@ struct MultiplicityExtraTable {
196197

197198
// initialize - from Arvind
198199
newRunNumber = bc.runNumber();
199-
int localBC = bc.globalBC() % nBCsPerOrbit;
200+
int localBC = bc.globalBC() % o2::constants::lhc::LHCMaxBunches;
200201

201202
if (newRunNumber != oldRunNumber) {
202203
auto soreor = o2::ccdb::BasicCCDBManager::getRunDuration(ccdbApi, newRunNumber);
@@ -224,8 +225,12 @@ struct MultiplicityExtraTable {
224225
multFT0AOuter += ft0.amplitudeA()[ii];
225226
}
226227
}
227-
for (const auto amplitude : ft0.amplitudeC()) {
228-
multFT0C += amplitude;
228+
for (size_t ii = 0; ii < ft0.amplitudeC().size(); ++ii) {
229+
multFT0C += ft0.amplitudeC()[ii];
230+
static constexpr int MaxChannelIdInnerRingFT0C = 48;
231+
if (ft0.channelC()[ii] > MaxChannelIdInnerRingFT0C) {
232+
multFT0COuter += ft0.amplitudeC()[ii];
233+
}
229234
}
230235
posZFT0 = ft0.posZ();
231236
posZFT0valid = ft0.isValidTime();
@@ -261,10 +266,10 @@ struct MultiplicityExtraTable {
261266
std::bitset<8> fFDDTriggers = fdd.triggerMask();
262267
multFDDTriggerBits = static_cast<uint8_t>(fFDDTriggers.to_ulong());
263268

264-
for (const auto amplitude : fdd.chargeA()) {
269+
for (const auto amplitude : fdd.chargeA()) { // o2-linter: disable=const-ref-in-for-loop (cheap float copy)
265270
multFDDA += amplitude;
266271
}
267-
for (const auto amplitude : fdd.chargeC()) {
272+
for (const auto amplitude : fdd.chargeC()) { // o2-linter: disable=const-ref-in-for-loop (cheap float copy)
268273
multFDDC += amplitude;
269274
}
270275

@@ -313,7 +318,8 @@ struct MultiplicityExtraTable {
313318
tru(multZPA),
314319
tru(multZPC),
315320
tru(multFV0AOuter),
316-
tru(multFT0AOuter));
321+
tru(multFT0AOuter),
322+
tru(multFT0COuter));
317323

318324
multBcSel(
319325
bc.selection_raw(),

‎Common/TableProducer/zdcTaskLightIons.cxx‎

Lines changed: 64 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@
1818
#include "Common/DataModel/EventSelection.h"
1919
#include "Common/DataModel/ZDCLightIons.h"
2020

21+
#include <CCDB/BasicCCDBManager.h>
22+
#include <CommonConstants/LHCConstants.h>
23+
#include <DataFormatsParameters/GRPLHCIFData.h>
2124
#include <Framework/AnalysisDataModel.h>
2225
#include <Framework/AnalysisHelpers.h>
2326
#include <Framework/AnalysisTask.h>
@@ -31,7 +34,10 @@
3134
#include <TH1.h>
3235
#include <TH2.h>
3336

37+
#include <bitset>
3438
#include <cstdint>
39+
#include <map>
40+
#include <string>
3541

3642
using namespace o2;
3743
using namespace o2::aod;
@@ -45,6 +51,14 @@ using ColEvSels = soa::Join<aod::Collisions, aod::EvSels, aod::CentFT0As, aod::C
4551
struct ZdcTaskLightIons {
4652

4753
Produces<aod::ZDCLightIons> zdcTableLI;
54+
Service<o2::ccdb::BasicCCDBManager> ccdb;
55+
static const int nBCsPerOrbit = o2::constants::lhc::LHCMaxBunches;
56+
std::bitset<nBCsPerOrbit> beamPatternA;
57+
std::bitset<nBCsPerOrbit> beamPatternC;
58+
std::bitset<nBCsPerOrbit> bcPatternB;
59+
std::bitset<nBCsPerOrbit> bcPatternA;
60+
std::bitset<nBCsPerOrbit> bcPatternC;
61+
std::bitset<nBCsPerOrbit> bcPatternE;
4862

4963
// Configurable parameters
5064
Configurable<int> nBinsTiming{"nBinsTiming", 200, "n bins for debunching histo"};
@@ -78,6 +92,14 @@ struct ZdcTaskLightIons {
7892
nEventSelections
7993
};
8094

95+
enum bcMaskBits {
96+
bcMask_beamB,
97+
bcMask_beamA,
98+
bcMask_beamC,
99+
bcMask_beamE,
100+
nBits
101+
};
102+
81103
void init(InitContext const&)
82104
{
83105
registry.add("zdcDebunchHist", "ZN sum vs. diff; ZNA-ZNC (ns); ZNA+ZNC (ns)", {HistType::kTH2D, {{nBinsTiming, -20., 20.}, {nBinsTiming, -20., 20.}}});
@@ -158,9 +180,46 @@ struct ZdcTaskLightIons {
158180

159181
void processZDCBC(BCsRun3 const& bcs, aod::Zdcs const& /*zdcs*/)
160182
{
183+
auto& ccdbMgr = o2::ccdb::BasicCCDBManager::instance();
184+
uint64_t timeStamp = bcs.iteratorAt(0).timestamp();
185+
std::map<std::string, std::string> metadata;
186+
// use getSpecific to set metadata to avoid crashes related to specific run number
187+
auto grplhcif = ccdbMgr.getSpecific<o2::parameters::GRPLHCIFData>("GLO/Config/GRPLHCIF", timeStamp, metadata);
188+
// auto grplhcif = ccdb->getForTimeStamp<o2::parameters::GRPLHCIFData>("GLO/Config/GRPLHCIF", timeStamp);
189+
if (grplhcif == nullptr) {
190+
LOG(fatal) << "GRPLHCIFData not in database, timestamp:" << timeStamp;
191+
}
192+
193+
beamPatternA = grplhcif->getBunchFilling().getBeamPattern(0);
194+
beamPatternC = grplhcif->getBunchFilling().getBeamPattern(1);
195+
bcPatternB = grplhcif->getBunchFilling().getBCPattern();
196+
bcPatternA = beamPatternA & ~beamPatternC;
197+
bcPatternC = ~beamPatternA & beamPatternC;
198+
bcPatternE = ~beamPatternA & ~beamPatternC;
199+
161200
for (const auto& bc : bcs) {
201+
162202
if (bc.has_zdc()) {
163203

204+
// int64_t timestamp = bc.timestamp();
205+
auto timestampFromSOR = (bc.timestamp() - grplhcif->getFillNumberTime()) / 1e3; // Convert to seconds
206+
207+
int bcInOrbit = bc.globalBC() % nBCsPerOrbit;
208+
209+
uint8_t maskSel = 0;
210+
if (bcPatternB[bcInOrbit]) {
211+
maskSel |= (uint8_t)(0x1u << bcMask_beamB);
212+
}
213+
if (bcPatternA[bcInOrbit]) {
214+
maskSel |= (uint8_t)(0x1u << bcMask_beamA);
215+
}
216+
if (bcPatternC[bcInOrbit]) {
217+
maskSel |= (uint8_t)(0x1u << bcMask_beamC);
218+
}
219+
if (bcPatternE[bcInOrbit]) {
220+
maskSel |= (uint8_t)(0x1u << bcMask_beamE);
221+
}
222+
164223
auto tdcZNA = bc.zdc().timeZNA();
165224
auto tdcZNC = bc.zdc().timeZNC();
166225
auto tdcZPA = bc.zdc().timeZPA();
@@ -225,8 +284,9 @@ struct ZdcTaskLightIons {
225284
-1, -1, -1,
226285
-1.,
227286
-1, -1, -1,
228-
bc.timestamp(),
229-
-1);
287+
timestampFromSOR,
288+
0,
289+
maskSel);
230290
}
231291
}
232292
}
@@ -333,7 +393,8 @@ struct ZdcTaskLightIons {
333393
zv,
334394
centralityFT0C, centralityFT0A, centralityFT0M,
335395
foundBC.timestamp(),
336-
evSelection);
396+
evSelection,
397+
0);
337398
}
338399
}
339400
}

0 commit comments

Comments
 (0)