Skip to content

Commit 6ac4130

Browse files
authored
Merge branch 'master' into patch-4
2 parents 5d419d0 + 6da4285 commit 6ac4130

File tree

56 files changed

+4757
-2234
lines changed

Some content is hidden

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

56 files changed

+4757
-2234
lines changed

Common/CCDB/AnalysisCCDBLinkDef.h

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

12+
/// \file AnalysisCCDBLinkDef.h
13+
/// \brief Dictionary definitions
14+
///
15+
/// \author Evgeny Kryshen <[email protected]>
16+
17+
#ifndef COMMON_CCDB_ANALYSISCCDBLINKDEF_H_
18+
#define COMMON_CCDB_ANALYSISCCDBLINKDEF_H_
19+
1220
#pragma link off all globals;
1321
#pragma link off all classes;
1422
#pragma link off all functions;
1523

1624
#pragma link C++ class EventSelectionParams + ;
1725
#pragma link C++ class TriggerAliases + ;
26+
#pragma link C++ class std::map < uint64_t, uint32_t> + ;
27+
28+
#endif // COMMON_CCDB_ANALYSISCCDBLINKDEF_H_

Common/DataModel/EventSelection.h

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,12 @@
88
// In applying this license CERN does not waive the privileges and immunities
99
// granted to it by virtue of its status as an Intergovernmental Organization
1010
// or submit itself to any jurisdiction.
11+
12+
/// \file EventSelection.h
13+
/// \brief Definitions of event selection tables
14+
///
15+
/// \author Evgeny Kryshen <[email protected]> and Igor Altsybeev <[email protected]>
16+
1117
#ifndef COMMON_DATAMODEL_EVENTSELECTION_H_
1218
#define COMMON_DATAMODEL_EVENTSELECTION_H_
1319

@@ -47,6 +53,7 @@ namespace evsel
4753
{
4854
DECLARE_SOA_BITMAP_COLUMN(Alias, alias, 32); //! Bitmask of fired trigger aliases (see TriggerAliases.h for definitions)
4955
DECLARE_SOA_BITMAP_COLUMN(Selection, selection, 64); //! Bitmask of selection flags (see EventSelectionParams.h for definitions)
56+
DECLARE_SOA_BITMAP_COLUMN(Rct, rct, 32); //! Bitmask of RCT flags
5057
DECLARE_SOA_COLUMN(Sel7, sel7, bool); //! Event selection decision based on V0A & V0C
5158
DECLARE_SOA_COLUMN(Sel8, sel8, bool); //! Event selection decision based on TVX
5259
DECLARE_SOA_INDEX_COLUMN_FULL(FoundBC, foundBC, int, BCs, "_foundBC"); //! BC entry index in BCs table (-1 if doesn't exist)
@@ -55,19 +62,20 @@ DECLARE_SOA_INDEX_COLUMN_FULL(FoundFV0, foundFV0, int, FV0As, "_foundFV0"); //!
5562
DECLARE_SOA_INDEX_COLUMN_FULL(FoundFDD, foundFDD, int, FDDs, "_foundFDD"); //! FDD entry index in FDDs table (-1 if doesn't exist)
5663
DECLARE_SOA_INDEX_COLUMN_FULL(FoundZDC, foundZDC, int, Zdcs, "_foundZDC"); //! ZDC entry index in ZDCs table (-1 if doesn't exist)
5764
DECLARE_SOA_COLUMN(BcInTF, bcInTF, int); //! Position of a (found) bunch crossing inside a given timeframe
58-
DECLARE_SOA_COLUMN(NumTracksInTimeRange, trackOccupancyInTimeRange, int); //! Occupancy in specified time interval by a number of tracks from nearby collisions
59-
DECLARE_SOA_COLUMN(SumAmpFT0CInTimeRange, ft0cOccupancyInTimeRange, float); //! Occupancy in specified time interval by a sum of FT0C amplitudes from nearby collisions
65+
DECLARE_SOA_COLUMN(NumTracksInTimeRange, trackOccupancyInTimeRange, int); //! Occupancy in specified time interval by a number of tracks from nearby collisions // o2-linter: disable=name/o2-column
66+
DECLARE_SOA_COLUMN(SumAmpFT0CInTimeRange, ft0cOccupancyInTimeRange, float); //! Occupancy in specified time interval by a sum of FT0C amplitudes from nearby collisions // o2-linter: disable=name/o2-column
6067
} // namespace evsel
6168

6269
// bc-joinable event selection decisions
6370
DECLARE_SOA_TABLE(BcSels, "AOD", "BCSEL", //!
64-
evsel::Alias, evsel::Selection, evsel::FoundFT0Id, evsel::FoundFV0Id, evsel::FoundFDDId, evsel::FoundZDCId);
71+
evsel::Alias, evsel::Selection, evsel::Rct, evsel::FoundFT0Id, evsel::FoundFV0Id, evsel::FoundFDDId, evsel::FoundZDCId);
6572
using BcSel = BcSels::iterator;
6673

6774
// collision-joinable event selection decisions
6875
DECLARE_SOA_TABLE(EvSels, "AOD", "EVSEL", //!
6976
evsel::Alias,
7077
evsel::Selection,
78+
evsel::Rct,
7179
evsel::Sel7,
7280
evsel::Sel8,
7381
evsel::FoundBCId,

Common/TableProducer/eventSelection.cxx

Lines changed: 35 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616

1717
#include <vector>
1818
#include <map>
19+
#include <string>
1920

2021
#include "Framework/ConfigParamSpec.h"
2122
#include "Framework/runDataProcessing.h"
@@ -80,13 +81,13 @@ struct BcSelectionTask {
8081
bool isPP = 1; // default value
8182
TriggerAliases* aliases = nullptr;
8283
EventSelectionParams* par = nullptr;
84+
std::map<uint64_t, uint32_t>* mapRCT = nullptr;
8385
std::map<int64_t, std::vector<int16_t>> mapInactiveChips; // number of inactive chips vs orbit per layer
8486
int64_t prevOrbitForInactiveChips = 0; // cached next stored orbit in the inactive chip map
8587
int64_t nextOrbitForInactiveChips = 0; // cached previous stored orbit in the inactive chip map
8688
bool isGoodITSLayer3 = true; // default value
8789
bool isGoodITSLayer0123 = true; // default value
8890
bool isGoodITSLayersAll = true; // default value
89-
9091
void init(InitContext&)
9192
{
9293
if (metadataInfo.isFullyDefined() && !doprocessRun2 && !doprocessRun3) { // Check if the metadata is initialized (only if not forced from the workflow configuration)
@@ -242,8 +243,9 @@ struct BcSelectionTask {
242243
histos.get<TH1>(HIST("hCounterTVX"))->Fill(Form("%d", bc.runNumber()), 1);
243244
}
244245

246+
uint32_t rct = 0;
245247
// Fill bc selection columns
246-
bcsel(alias, selection, foundFT0, foundFV0, foundFDD, foundZDC);
248+
bcsel(alias, selection, rct, foundFT0, foundFV0, foundFDD, foundZDC);
247249
}
248250
}
249251
PROCESS_SWITCH(BcSelectionTask, processRun2, "Process Run2 event selection", true);
@@ -311,6 +313,18 @@ struct BcSelectionTask {
311313
}
312314
} // loop over vector of inactive chip ids
313315
} // loop over orbits
316+
317+
// QC info
318+
std::map<std::string, std::string> metadata;
319+
metadata["run"] = Form("%d", run);
320+
ccdb->setFatalWhenNull(0);
321+
mapRCT = ccdb->getSpecific<std::map<uint64_t, uint32_t>>("Users/j/jian/RCT", ts, metadata);
322+
ccdb->setFatalWhenNull(1);
323+
if (mapRCT == nullptr) {
324+
LOGP(info, "rct object missing... inserting dummy rct flags");
325+
mapRCT = new std::map<uint64_t, uint32_t>;
326+
mapRCT->insert(std::pair<uint64_t, uint32_t>(sorTimestamp, 0));
327+
}
314328
}
315329

316330
// map from GlobalBC to BcId needed to find triggerBc
@@ -326,6 +340,13 @@ struct BcSelectionTask {
326340

327341
// bc loop
328342
for (auto bc : bcs) { // o2-linter: disable=const-ref-in-for-loop
343+
// store rct flags
344+
auto itrct = mapRCT->upper_bound(bc.timestamp());
345+
if (itrct != mapRCT->begin())
346+
itrct--;
347+
uint32_t rct = itrct->second;
348+
LOGP(debug, "sor={} eor={} ts={} rct={}", sorTimestamp, eorTimestamp, bc.timestamp(), rct);
349+
329350
uint32_t alias{0};
330351
// workaround for pp2022 (trigger info is shifted by -294 bcs)
331352
int32_t triggerBcId = mapGlobalBCtoBcId[bc.globalBC() + triggerBcShift];
@@ -424,7 +445,7 @@ struct BcSelectionTask {
424445
LOGP(debug, "prev inactive chips: {} {} {} {} {} {} {}", vPrevInactiveChips[0], vPrevInactiveChips[1], vPrevInactiveChips[2], vPrevInactiveChips[3], vPrevInactiveChips[4], vPrevInactiveChips[5], vPrevInactiveChips[6]);
425446
isGoodITSLayer3 = vPrevInactiveChips[3] <= maxInactiveChipsPerLayer->at(3) && vNextInactiveChips[3] <= maxInactiveChipsPerLayer->at(3);
426447
isGoodITSLayer0123 = true;
427-
for (int i = 0; i < 3; i++) {
448+
for (int i = 0; i < 4; i++) {
428449
isGoodITSLayer0123 &= vPrevInactiveChips[i] <= maxInactiveChipsPerLayer->at(i) && vNextInactiveChips[i] <= maxInactiveChipsPerLayer->at(i);
429450
}
430451
isGoodITSLayersAll = true;
@@ -506,7 +527,7 @@ struct BcSelectionTask {
506527
}
507528

508529
// Fill bc selection columns
509-
bcsel(alias, selection, foundFT0, foundFV0, foundFDD, foundZDC);
530+
bcsel(alias, selection, rct, foundFT0, foundFV0, foundFDD, foundZDC);
510531
}
511532
}
512533
PROCESS_SWITCH(BcSelectionTask, processRun3, "Process Run3 event selection", false);
@@ -677,6 +698,9 @@ struct EventSelectionTask {
677698
selection |= (spdClusters < par->fSPDClsVsTklA + nTkl * par->fSPDClsVsTklB) ? BIT(kNoSPDClsVsTklBG) : 0;
678699
selection |= !(nTkl < 6 && multV0C012 > par->fV0C012vsTklA + nTkl * par->fV0C012vsTklB) ? BIT(kNoV0C012vsTklBG) : 0;
679700

701+
// copy rct flags from bcsel table
702+
uint32_t rct = bc.rct_raw();
703+
680704
// apply int7-like selections
681705
bool sel7 = 1;
682706
for (int i = 0; i < kNsel; i++) {
@@ -702,7 +726,7 @@ struct EventSelectionTask {
702726
}
703727
}
704728

705-
evsel(alias, selection, sel7, sel8, foundBC, foundFT0, foundFV0, foundFDD, foundZDC, 0, 0, 0);
729+
evsel(alias, selection, rct, sel7, sel8, foundBC, foundFT0, foundFV0, foundFDD, foundZDC, 0, 0, 0);
706730
}
707731
PROCESS_SWITCH(EventSelectionTask, processRun2, "Process Run2 event selection", true);
708732

@@ -757,7 +781,8 @@ struct EventSelectionTask {
757781
int32_t foundFDD = bc.foundFDDId();
758782
int32_t foundZDC = bc.foundZDCId();
759783
int bcInTF = (bc.globalBC() - bcSOR) % nBCsPerTF;
760-
evsel(bc.alias_raw(), bc.selection_raw(), kFALSE, kFALSE, foundBC, foundFT0, foundFV0, foundFDD, foundZDC, bcInTF, -1, -1);
784+
uint32_t rct = 0;
785+
evsel(bc.alias_raw(), bc.selection_raw(), rct, kFALSE, kFALSE, foundBC, foundFT0, foundFV0, foundFDD, foundZDC, bcInTF, -1, -1);
761786
}
762787
return;
763788
}
@@ -1171,6 +1196,9 @@ struct EventSelectionTask {
11711196
selection |= (vNoCollInSameRofStandard[colIndex] && vNoCollInSameRofWithCloseVz[colIndex]) ? BIT(kNoCollInRofStandard) : 0;
11721197
selection |= vNoHighMultCollInPrevRof[colIndex] ? BIT(kNoHighMultCollInPrevRof) : 0;
11731198

1199+
// copy rct flags from bcsel table
1200+
uint32_t rct = bc.rct_raw();
1201+
11741202
// apply int7-like selections
11751203
bool sel7 = 0;
11761204

@@ -1190,7 +1218,7 @@ struct EventSelectionTask {
11901218

11911219
int bcInTF = (bc.globalBC() - bcSOR) % nBCsPerTF;
11921220

1193-
evsel(alias, selection, sel7, sel8, foundBC, foundFT0, foundFV0, foundFDD, foundZDC, bcInTF,
1221+
evsel(alias, selection, rct, sel7, sel8, foundBC, foundFT0, foundFV0, foundFDD, foundZDC, bcInTF,
11941222
vNumTracksITS567inFullTimeWin[colIndex], vSumAmpFT0CinFullTimeWin[colIndex]);
11951223
}
11961224
}

DPG/Tasks/AOTTrack/PID/ITS/qaPIDITS.cxx

Lines changed: 27 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
// In applying this license CERN does not waive the privileges and immunities
99
// granted to it by virtue of its status as an Intergovernmental Organization
1010
// or submit itself to any jurisdiction.
11-
1211
///
1312
/// \file qaPIDITS.cxx
1413
/// \author Nicolò Jacazio [email protected]
@@ -163,14 +162,28 @@ struct itsPidQa {
163162
ConfigurableAxis deltaBins{"deltaBins", {200, -1000.f, 1000.f}, "Binning in Delta (dEdx - expected dEdx)"};
164163
ConfigurableAxis expSigmaBins{"expSigmaBins", {200, 0.f, 200.f}, "Binning in expected Sigma"};
165164
ConfigurableAxis nSigmaBins{"nSigmaBins", {401, -10.025f, 10.025f}, "Binning in NSigma"};
166-
ConfigurableAxis dEdxBins{"dEdxBins", {5000, 0.f, 5000.f}, "Binning in dE/dx"};
165+
ConfigurableAxis avClsBins{"avClsBins", {200, 0, 20}, "Binning in average cluster size"};
167166
Configurable<int> trackSelection{"trackSelection", 1, "Track selection: 0 -> No Cut, 1 -> kGlobalTrack, 2 -> kGlobalTrackWoPtEta, 3 -> kGlobalTrackWoDCA, 4 -> kQualityTracks, 5 -> kInAcceptanceTracks"};
168167
Configurable<bool> applyRapidityCut{"applyRapidityCut", false, "Flag to apply rapidity cut"};
169168
Configurable<bool> enableDeDxPlot{"enableDeDxPlot", true, "Enables the dEdx plot (reduces memory footprint if off)"};
170169
Configurable<int16_t> minTPCNcls{"minTPCNcls", 0, "Minimum number or TPC Clusters for tracks"};
171170
ConfigurableAxis tpcNclsBins{"tpcNclsBins", {16, 0, 160}, "Binning in number of clusters in TPC"};
172171
Configurable<bool> fillTHnSparses{"fillTHnSparses", false, "Flag to fill multidimensional histograms for nsigma vs pt, eta, Ncls"};
173172

173+
template <typename TrackType>
174+
float averageClusterSizeTrk(const TrackType& track)
175+
{
176+
return o2::aod::ITSResponse::averageClusterSize(track.itsClusterSizes());
177+
}
178+
179+
float averageClusterSizePerCoslInv(uint32_t itsClusterSizes, float eta) { return o2::aod::ITSResponse::averageClusterSize(itsClusterSizes) * std::cosh(eta); }
180+
181+
template <typename TrackType>
182+
float averageClusterSizePerCoslInv(const TrackType& track)
183+
{
184+
return averageClusterSizePerCoslInv(track.itsClusterSizes(), track.eta());
185+
}
186+
174187
void init(o2::framework::InitContext&)
175188
{
176189
const AxisSpec vtxZAxis{100, -20, 20, "Vtx_{z} (cm)"};
@@ -183,8 +196,9 @@ struct itsPidQa {
183196
ptAxis.makeLogarithmic();
184197
pAxis.makeLogarithmic();
185198
}
186-
const AxisSpec dedxAxis{dEdxBins, "d#it{E}/d#it{x} Arb. units"};
187199
const AxisSpec chargeAxis{2, -2.f, 2.f, "Charge"};
200+
const AxisSpec avClsAxis{avClsBins, "<ITS Cls. Size>"};
201+
const AxisSpec avClsEffAxis{avClsBins, "<ITS Cls. Size> / cosh(#eta)"};
188202

189203
// Event properties
190204
auto h = histos.add<TH1>("event/evsel", "", kTH1D, {{10, 0.5, 10.5, "Ev. Sel."}});
@@ -231,6 +245,10 @@ struct itsPidQa {
231245
hNsigmaPos[id] = histos.add<TH2>(Form("nsigmaPos/%s", pN[id]), axisTitle, kTH2F, {pAxis, nSigmaAxis});
232246
hNsigmaNeg[id] = histos.add<TH2>(Form("nsigmaNeg/%s", pN[id]), axisTitle, kTH2F, {pAxis, nSigmaAxis});
233247
}
248+
histos.add("event/averageClusterSize", "", kTH2F, {ptAxis, avClsAxis});
249+
histos.add("event/averageClusterSizePerCoslInv", "", kTH2F, {ptAxis, avClsEffAxis});
250+
histos.add("event/SelectedAverageClusterSize", "", kTH2F, {ptAxis, avClsAxis});
251+
histos.add("event/SelectedAverageClusterSizePerCoslInv", "", kTH2F, {ptAxis, avClsEffAxis});
234252
LOG(info) << "QA PID ITS histograms:";
235253
histos.print();
236254
}
@@ -294,7 +312,9 @@ struct itsPidQa {
294312
histos.fill(HIST("event/length"), track.length());
295313
histos.fill(HIST("event/pt"), track.pt());
296314
histos.fill(HIST("event/p"), track.p());
297-
315+
const auto& t = tracks.iteratorAt(nTracks);
316+
histos.fill(HIST("event/averageClusterSize"), track.pt(), averageClusterSizeTrk(t));
317+
histos.fill(HIST("event/averageClusterSizePerCoslInv"), track.pt(), averageClusterSizePerCoslInv(t));
298318
bool discard = false;
299319
for (int id = 0; id < 9; id++) {
300320
if (std::abs(nsigmaTPC(track, id)) > tpcSelValues[id]) {
@@ -307,6 +327,9 @@ struct itsPidQa {
307327
if (discard) {
308328
continue;
309329
}
330+
histos.fill(HIST("event/SelectedAverageClusterSize"), track.pt(), averageClusterSizeTrk(t));
331+
histos.fill(HIST("event/SelectedAverageClusterSizePerCoslInv"), track.pt(), averageClusterSizePerCoslInv(t));
332+
310333
for (o2::track::PID::ID id = 0; id <= o2::track::PID::Last; id++) {
311334
if (!enableParticle[id]) {
312335
continue;
@@ -317,7 +340,6 @@ struct itsPidQa {
317340
}
318341
}
319342
const float nsigma = nsigmaITS(track, id);
320-
const auto& t = tracks.iteratorAt(nTracks);
321343
if (t.sign() > 0) {
322344
hNsigmaPos[id]->Fill(t.p(), nsigma);
323345
} else {

PWGCF/EbyEFluctuations/Tasks/CMakeLists.txt

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -44,12 +44,7 @@ o2physics_add_dpl_workflow(factorial-moments
4444
PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore O2Physics::PWGCFCore
4545
COMPONENT_NAME Analysis)
4646

47-
o2physics_add_dpl_workflow(netproton-cumulants-mc
48-
SOURCES netprotonCumulantsMc.cxx
49-
PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore O2Physics::PWGCFCore
50-
COMPONENT_NAME Analysis)
51-
52-
o2physics_add_dpl_workflow(kaon-isospin-fluctuations
53-
SOURCES kaonIsospinFluctuations.cxx
47+
o2physics_add_dpl_workflow(netcharge-fluctuations
48+
SOURCES netchargeFluctuations.cxx
5449
PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore O2Physics::PWGCFCore
5550
COMPONENT_NAME Analysis)

0 commit comments

Comments
 (0)