Skip to content

Commit 37dc3e4

Browse files
authored
Merge branch 'AliceO2Group:master' into master
2 parents de54935 + be3b634 commit 37dc3e4

File tree

7 files changed

+283
-219
lines changed

7 files changed

+283
-219
lines changed

ALICE3/TableProducer/OTF/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,6 @@ o2physics_add_dpl_workflow(onthefly-tofpid
2020
COMPONENT_NAME Analysis)
2121

2222
o2physics_add_dpl_workflow(onthefly-richpid
23-
SOURCES onTheFlyRICHPID.cxx
23+
SOURCES onTheFlyRichPid.cxx
2424
PUBLIC_LINK_LIBRARIES O2::Framework O2::DetectorsBase O2Physics::AnalysisCore O2::ReconstructionDataFormats O2::DetectorsCommonDataFormats O2Physics::ALICE3Core
2525
COMPONENT_NAME Analysis)

ALICE3/TableProducer/OTF/onTheFlyRICHPID.cxx renamed to ALICE3/TableProducer/OTF/onTheFlyRichPid.cxx

Lines changed: 54 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,33 @@
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-
//
13-
// Task to add a table of track parameters propagated to the primary vertex
14-
//
11+
///
12+
/// \file onTheFlyRichPid.cxx
13+
///
14+
/// \brief This task goes straight from a combination of track table and mcParticles
15+
/// and a projective bRICH configuration to a table of TOF NSigmas for the particles
16+
/// being analysed. It currently contemplates 5 particle types:
17+
/// electrons, pions, kaons, protons and muons
18+
///
19+
/// More particles could be added but would have to be added to the LUT
20+
/// being used in the onTheFly tracker task.
21+
///
22+
/// \warning Geometry parameters are configurable, but resolution values should be adapted.
23+
/// Since angular resolution depends on the specific geometric details, it is better to
24+
/// calculate it from full simulation and add new input. Alternatively, an analytical
25+
/// expression can be provided as a function of the main parameters.
26+
/// Latest version: analytical parametrization of angular resolution !!!
27+
///
28+
/// \author David Dobrigkeit Chinellato, UNICAMP
29+
/// \author Nicola Nicassio, University and INFN Bari
30+
/// \since May 22, 2024
31+
///
1532

1633
#include <utility>
1734
#include <cmath>
35+
#include <vector>
36+
#include <map>
37+
#include <string>
1838

1939
#include <TPDGCode.h>
2040

@@ -42,28 +62,9 @@
4262
#include "TString.h"
4363
#include "ALICE3/DataModel/OTFRICH.h"
4464
#include "DetectorsVertexing/HelixHelper.h"
45-
4665
#include "TableHelper.h"
4766
#include "ALICE3/Core/DelphesO2TrackSmearer.h"
4867

49-
/// \file onTheFlyRichPid.cxx
50-
///
51-
/// \brief This task goes straight from a combination of track table and mcParticles
52-
/// and a projective bRICH configuration to a table of TOF NSigmas for the particles
53-
/// being analysed. It currently contemplates 5 particle types:
54-
/// electrons, pions, kaons, protons and muons.
55-
///
56-
/// More particles could be added but would have to be added to the LUT
57-
/// being used in the onTheFly tracker task.
58-
///
59-
/// \warning Geometry parameters are configurable, but resolution values should be adapted.
60-
/// Since angular resolution depends on the specific geometric details, it is better to
61-
/// calculate it from full simulation and add new input. Alternatively, an analytical
62-
/// expression can be provided as a function of the main parameters.
63-
/// Latest version: analytical parametrization of angular resolution !!!
64-
///
65-
/// \author David Dobrigkeit Chinellato, UNICAMP, Nicola Nicassio, University and INFN Bari
66-
6768
using namespace o2;
6869
using namespace o2::framework;
6970
using namespace o2::constants::math;
@@ -143,11 +144,13 @@ struct OnTheFlyRichPid {
143144
Configurable<float> bRICHPixelSize{"bRICHPixelSize", 0.1, "barrel RICH pixel size (cm)"};
144145
Configurable<float> bRichGapRefractiveIndex{"bRichGapRefractiveIndex", 1.000283, "barrel RICH gap refractive index"};
145146

146-
Configurable<std::string> lutEl{"lutEl", "lutCovm.el.dat", "LUT for electrons"};
147-
Configurable<std::string> lutMu{"lutMu", "lutCovm.mu.dat", "LUT for muons"};
148-
Configurable<std::string> lutPi{"lutPi", "lutCovm.pi.dat", "LUT for pions"};
149-
Configurable<std::string> lutKa{"lutKa", "lutCovm.ka.dat", "LUT for kaons"};
150-
Configurable<std::string> lutPr{"lutPr", "lutCovm.pr.dat", "LUT for protons"};
147+
struct : ConfigurableGroup {
148+
Configurable<std::string> lutEl{"lutEl", "inherit", "LUT for electrons (if inherit, inherits from otf tracker task)"};
149+
Configurable<std::string> lutMu{"lutMu", "inherit", "LUT for muons (if inherit, inherits from otf tracker task)"};
150+
Configurable<std::string> lutPi{"lutPi", "inherit", "LUT for pions (if inherit, inherits from otf tracker task)"};
151+
Configurable<std::string> lutKa{"lutKa", "inherit", "LUT for kaons (if inherit, inherits from otf tracker task)"};
152+
Configurable<std::string> lutPr{"lutPr", "inherit", "LUT for protons (if inherit, inherits from otf tracker task)"};
153+
} simConfig;
151154

152155
o2::base::Propagator::MatCorrType matCorr = o2::base::Propagator::MatCorrType::USEMatCorrNONE;
153156

@@ -257,9 +260,7 @@ struct OnTheFlyRichPid {
257260
aerogel_rindex[2 * i_central_mirror - i] = bRichRefractiveIndexSector[i - i_central_mirror];
258261
mProjectiveLengthInner = R_min * t; // <-- At the end of the loop this will be the maximum Z
259262
}
260-
}
261-
// Even number of sectors
262-
else {
263+
} else { // Even number of sectors
263264
float two_half_gap = 1.0;
264265
int i_central_mirror = static_cast<int>((number_of_sectors_in_z) / 2.0);
265266
float m_val = std::tan(0.0);
@@ -315,18 +316,33 @@ struct OnTheFlyRichPid {
315316
// std::cout << std::endl << std::endl;
316317
}
317318

318-
void init(o2::framework::InitContext& /*initContext*/)
319+
void init(o2::framework::InitContext& initContext)
319320
{
320321
pRandomNumberGenerator.SetSeed(0); // fully randomize
321322

323+
// Check if inheriting the LUT configuration
324+
auto configLutPath = [&](Configurable<std::string>& lut) {
325+
if (lut.value != "inherit") {
326+
return;
327+
}
328+
if (!getTaskOptionValue(initContext, "on-the-fly-tracker", lut.name, lut.value, true)) {
329+
LOG(fatal) << "Could not get " << lut.name << " from on-the-fly-tracker task";
330+
}
331+
};
332+
configLutPath(simConfig.lutEl);
333+
configLutPath(simConfig.lutMu);
334+
configLutPath(simConfig.lutPi);
335+
configLutPath(simConfig.lutKa);
336+
configLutPath(simConfig.lutPr);
337+
322338
// Load LUT for pt and eta smearing
323339
if (flagIncludeTrackAngularRes && flagRICHLoadDelphesLUTs) {
324340
std::map<int, const char*> mapPdgLut;
325-
const char* lutElChar = lutEl->c_str();
326-
const char* lutMuChar = lutMu->c_str();
327-
const char* lutPiChar = lutPi->c_str();
328-
const char* lutKaChar = lutKa->c_str();
329-
const char* lutPrChar = lutPr->c_str();
341+
const char* lutElChar = simConfig.lutEl->c_str();
342+
const char* lutMuChar = simConfig.lutMu->c_str();
343+
const char* lutPiChar = simConfig.lutPi->c_str();
344+
const char* lutKaChar = simConfig.lutKa->c_str();
345+
const char* lutPrChar = simConfig.lutPr->c_str();
330346

331347
LOGF(info, "Will load electron lut file ..: %s for RICH PID", lutElChar);
332348
LOGF(info, "Will load muon lut file ......: %s for RICH PID", lutMuChar);
@@ -340,7 +356,7 @@ struct OnTheFlyRichPid {
340356
mapPdgLut.insert(std::make_pair(321, lutKaChar));
341357
mapPdgLut.insert(std::make_pair(2212, lutPrChar));
342358

343-
for (auto e : mapPdgLut) {
359+
for (const auto& e : mapPdgLut) {
344360
if (!mSmearer.loadTable(e.first, e.second)) {
345361
LOG(fatal) << "Having issue with loading the LUT " << e.first << " " << e.second;
346362
}

DPG/Tasks/AOTEvent/eventSelectionQa.cxx

Lines changed: 22 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -346,12 +346,15 @@ struct EventSelectionQaTask {
346346
histos.add("occupancyQA/hOccupancyByFT0CvsByTracks", "", kTH2D, {{150, 0, 15000}, {150, 0, 150000}});
347347

348348
// 3D histograms: nGlobalTracks with cls567 as y-axis, V0A as x-axis:
349-
const AxisSpec axisNtracks{160, -0.5, 4000 - 0.5, "n tracks"};
350-
const AxisSpec axisNtracksGlobal{120, -0.5, 3000 - 0.5, "n tracks"};
349+
const AxisSpec axisNtracksPV{160, -0.5, 4000 - 0.5, "n ITS PV tracks"};
350+
const AxisSpec axisNtracksPVTPC{120, -0.5, 3000 - 0.5, "n ITS-TPC PV tracks"};
351+
const AxisSpec axisNtracksTPConly{120, -0.5, 6000 - 0.5, "n TPC-only tracks"};
351352
const AxisSpec axisMultV0AForOccup{20, 0., static_cast<float>(200000), "mult V0A"};
352353
const AxisSpec axisOccupancyTracks{150, 0., 15000, "occupancy (n ITS tracks weighted)"};
353-
histos.add("occupancyQA/hNumTracksPV_vs_V0A_vs_occupancy", "", kTH3F, {axisMultV0AForOccup, axisNtracks, axisOccupancyTracks});
354-
histos.add("occupancyQA/hNumTracksPVTPC_vs_V0A_vs_occupancy", "", kTH3F, {axisMultV0AForOccup, axisNtracksGlobal, axisOccupancyTracks});
354+
histos.add("occupancyQA/hNumTracksPV_vs_V0A_vs_occupancy", "", kTH3F, {axisMultV0AForOccup, axisNtracksPV, axisOccupancyTracks});
355+
histos.add("occupancyQA/hNumTracksPVTPC_vs_V0A_vs_occupancy", "", kTH3F, {axisMultV0AForOccup, axisNtracksPVTPC, axisOccupancyTracks});
356+
histos.add("occupancyQA/hNumTracksTPConly_vs_V0A_vs_occupancy", "", kTH3F, {axisMultV0AForOccup, axisNtracksTPConly, axisOccupancyTracks});
357+
histos.add("occupancyQA/hNumTracksTPConlyNoITS_vs_V0A_vs_occupancy", "", kTH3F, {axisMultV0AForOccup, axisNtracksTPConly, axisOccupancyTracks});
355358

356359
histos.add("occupancyQA/hITSTracks_ev1_vs_ev2_2coll_in_ROF", ";nITStracks event #1;nITStracks event #2", kTH2D, {{200, 0., 6000}, {200, 0., 6000}});
357360
histos.add("occupancyQA/hITSTracks_ev1_vs_ev2_2coll_in_ROF_UPC", ";nITStracks event #1;nITStracks event #2", kTH2D, {{41, -0.5, 40.5}, {41, -0.5, 40.5}});
@@ -1108,18 +1111,30 @@ struct EventSelectionQaTask {
11081111
// count tracks of different types
11091112
auto tracksGrouped = tracks.sliceBy(perCollision, colIndex);
11101113
int nPV = 0;
1114+
int nTPConly = 0;
1115+
// int nTPConlyWithDeDxCut = 0;
1116+
int nTPConlyNoITS = 0;
11111117
int nContributorsAfterEtaTPCCuts = 0;
11121118
bool isTVX = col.selection_bit(kIsTriggerTVX);
11131119
for (const auto& track : tracksGrouped) {
11141120
int trackBcDiff = bcDiff + track.trackTime() / o2::constants::lhc::LHCBunchSpacingNS;
1121+
1122+
if (track.hasTPC() && std::fabs(track.eta()) < 0.8 && track.pt() > 0.2 && track.tpcNClsFound() > 50 && track.tpcNClsCrossedRows() > 50 && track.tpcChi2NCl() < 4) {
1123+
nTPConly++;
1124+
// if (track.tpcSignal() > 20)
1125+
// nTPConlyWithDeDxCut++;
1126+
if (!track.hasITS())
1127+
nTPConlyNoITS++;
1128+
}
1129+
11151130
if (!track.isPVContributor())
11161131
continue;
11171132

11181133
if (track.itsNCls() >= 5)
11191134
vTracksITS567perColl[colIndex]++;
11201135

11211136
// high-quality contributors for ROF border QA and occupancy study
1122-
if (isTVX && std::fabs(track.eta()) < 0.8 && track.pt() > 0.2 && track.itsNCls() >= 5) {
1137+
if (std::fabs(track.eta()) < 0.8 && track.pt() > 0.2 && track.itsNCls() >= 5) {
11231138
nPV++;
11241139
if (track.tpcNClsFound() > 70 && track.tpcNClsCrossedRows() > 80 && track.itsChi2NCl() < 36 && track.tpcChi2NCl() < 4) {
11251140
nContributorsAfterEtaTPCCuts++;
@@ -1154,6 +1169,8 @@ struct EventSelectionQaTask {
11541169
histos.fill(HIST("occupancyQA/hOccupancyByFT0CvsByTracks"), occupancyByTracks, occupancyByFT0C);
11551170
histos.fill(HIST("occupancyQA/hNumTracksPV_vs_V0A_vs_occupancy"), multV0A, nPV, occupancyByTracks);
11561171
histos.fill(HIST("occupancyQA/hNumTracksPVTPC_vs_V0A_vs_occupancy"), multV0A, nContributorsAfterEtaTPCCuts, occupancyByTracks);
1172+
histos.fill(HIST("occupancyQA/hNumTracksTPConly_vs_V0A_vs_occupancy"), multV0A, nTPConly, occupancyByTracks);
1173+
histos.fill(HIST("occupancyQA/hNumTracksTPConlyNoITS_vs_V0A_vs_occupancy"), multV0A, nTPConlyNoITS, occupancyByTracks);
11571174

11581175
// dE/dx QA for a narrow pT bin
11591176
for (const auto& track : tracksGrouped) {

PWGCF/TwoParticleCorrelations/Tasks/corrSparse.cxx

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -65,11 +65,12 @@ struct CorrSparse {
6565
O2_DEFINE_CONFIGURABLE(cfgMinMixEventNum, int, 5, "Minimum number of events to mix")
6666
O2_DEFINE_CONFIGURABLE(cfgMinMult, int, 0, "Minimum multiplicity for collision")
6767
O2_DEFINE_CONFIGURABLE(cfgMaxMult, int, 10, "Maximum multiplicity for collision")
68-
O2_DEFINE_CONFIGURABLE(cfgMergingCut, float, 0.0, "Merging cut on track merge")
68+
O2_DEFINE_CONFIGURABLE(cfgMergingCut, float, 0.02, "Merging cut on track merge")
69+
O2_DEFINE_CONFIGURABLE(cfgApplyTwoTrackEfficiency, bool, true, "Apply two track efficiency for tpc tpc")
6970
O2_DEFINE_CONFIGURABLE(cfgRadiusLow, float, 0.8, "Low radius for merging cut")
7071
O2_DEFINE_CONFIGURABLE(cfgRadiusHigh, float, 2.5, "High radius for merging cut")
71-
O2_DEFINE_CONFIGURABLE(etaMftTrackMin, float, 3.6, "Minimum eta for MFT track")
72-
O2_DEFINE_CONFIGURABLE(etaMftTrackMax, float, 2.5, "Maximum eta for MFT track")
72+
O2_DEFINE_CONFIGURABLE(etaMftTrackMin, float, -3.6, "Minimum eta for MFT track")
73+
O2_DEFINE_CONFIGURABLE(etaMftTrackMax, float, -2.5, "Maximum eta for MFT track")
7374
O2_DEFINE_CONFIGURABLE(nClustersMftTrack, int, 5, "Minimum number of clusters for MFT track")
7475
O2_DEFINE_CONFIGURABLE(cfgSampleSize, double, 10, "Sample size for mixed event")
7576

@@ -97,7 +98,7 @@ struct CorrSparse {
9798

9899
// make the filters and cuts.
99100
Filter collisionFilter = (nabs(aod::collision::posZ) < cfgZVtxCut) && (aod::evsel::sel8) == true;
100-
Filter trackFilter = (nabs(aod::track::eta) < cfgEtaCut) && (aod::track::pt > cfgPtCutMin) && (aod::track::pt < cfgPtCutMax) && ((requireGlobalTrackInFilter()) || (aod::track::isGlobalTrackSDD == (uint8_t) true));
101+
Filter trackFilter = (nabs(aod::track::eta) < cfgEtaCut) && (cfgPtCutMin < aod::track::pt) && (cfgPtCutMax > aod::track::pt) && ((requireGlobalTrackInFilter()) || (aod::track::isGlobalTrackSDD == (uint8_t) true));
101102

102103
// Define the outputs
103104
OutputObj<CorrelationContainer> same{Form("sameEvent_%i_%i", static_cast<int>(cfgMinMult), static_cast<int>(cfgMaxMult))};
@@ -160,7 +161,7 @@ struct CorrSparse {
160161
bool isAcceptedMftTrack(TTrackAssoc const& mftTrack)
161162
{
162163
// cut on the eta of MFT tracks
163-
if (mftTrack.eta() > etaMftTrackMax || mftTrack.eta() < etaMftTrackMin) {
164+
if (mftTrack.eta() < etaMftTrackMin || mftTrack.eta() > etaMftTrackMax) {
164165
return false;
165166
}
166167

@@ -266,7 +267,7 @@ struct CorrSparse {
266267
float deltaPhi = RecoDecay::constrainAngle(track1.phi() - track2.phi(), -PIHalf);
267268
float deltaEta = track1.eta() - track2.eta();
268269

269-
if (std::abs(deltaEta) < cfgMergingCut) {
270+
if (cfgApplyTwoTrackEfficiency && std::abs(deltaEta) < cfgMergingCut) {
270271

271272
double dPhiStarHigh = getDPhiStar(track1, track2, cfgRadiusHigh, magneticField);
272273
double dPhiStarLow = getDPhiStar(track1, track2, cfgRadiusLow, magneticField);
@@ -355,9 +356,6 @@ struct CorrSparse {
355356
if ((tracks1.size() < cfgMinMult || tracks1.size() >= cfgMaxMult))
356357
continue;
357358

358-
if ((tracks2.size() < cfgMinMult || tracks2.size() >= cfgMaxMult))
359-
continue;
360-
361359
fillCorrelations<CorrelationContainer::kCFStepReconstructed>(tracks1, tracks2, collision1.posZ(), MixedEvent, getMagneticField(bc.timestamp()));
362360
}
363361
} else {

0 commit comments

Comments
 (0)