Skip to content

Commit 7bf15e8

Browse files
authored
Merge branch 'AliceO2Group:master' into pjpsi_femto
2 parents 61598cc + ff88fbb commit 7bf15e8

File tree

71 files changed

+6946
-1259
lines changed

Some content is hidden

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

71 files changed

+6946
-1259
lines changed

ALICE3/TableProducer/OTF/onTheFlyTofPid.cxx

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,8 @@
5555
#include "DetectorsVertexing/HelixHelper.h"
5656
#include "TableHelper.h"
5757
#include "ALICE3/Core/DelphesO2TrackSmearer.h"
58+
#include "TEfficiency.h"
59+
#include "THashList.h"
5860

5961
using namespace o2;
6062
using namespace o2::framework;
@@ -117,6 +119,8 @@ struct OnTheFlyTofPid {
117119
Configurable<int> nBinsTimeRes{"nBinsTimeRes", 400, "number of bins plots time resolution"};
118120
Configurable<int> nBinsRelativeEtaPt{"nBinsRelativeEtaPt", 400, "number of bins plots pt and eta relative errors"};
119121
Configurable<int> nBinsEta{"nBinsEta", 400, "number of bins plot relative eta error"};
122+
Configurable<int> nBinsMult{"nBinsMult", 200, "number of bins in multiplicity"};
123+
Configurable<float> maxMultRange{"maxMultRange", 1000.f, "upper limit in multiplicity plots"};
120124
} plotsConfig;
121125

122126
o2::base::Propagator::MatCorrType matCorr = o2::base::Propagator::MatCorrType::USEMatCorrNONE;
@@ -129,6 +133,7 @@ struct OnTheFlyTofPid {
129133

130134
// for handling basic QA histograms if requested
131135
HistogramRegistry histos{"Histos", {}, OutputObjHandlingPolicy::AnalysisObject};
136+
OutputObj<THashList> listEfficiency{"efficiency"};
132137
static constexpr int kParticles = 5;
133138

134139
void init(o2::framework::InitContext& initContext)
@@ -179,13 +184,16 @@ struct OnTheFlyTofPid {
179184
}
180185

181186
if (plotsConfig.doQAplots) {
182-
const AxisSpec axisdNdeta{200, 0.0f, 1000.0f, Form("dN/d#eta in |#eta| < %f", simConfig.multiplicityEtaRange.value)};
187+
const AxisSpec axisdNdeta{plotsConfig.nBinsMult, 0.0f, plotsConfig.maxMultRange, Form("dN/d#eta in |#eta| < %f", simConfig.multiplicityEtaRange.value)};
183188

184189
histos.add("h1dNdeta", "h2dNdeta", kTH1F, {axisdNdeta});
185190
histos.add("h2dEventTime", "h2dEventTime", kTH2F, {{200, -1000, 1000, "computed"}, {200, -1000, 1000, "generated"}});
186191
histos.add("h1dEventTimegen", "h1dEventTimegen", kTH1F, {{200, -1000, 1000, "generated"}});
187192
histos.add("h1dEventTimerec", "h1dEventTimerec", kTH1F, {{200, -1000, 1000, "computed"}});
193+
histos.add("h1dEventTimedelta", "h1dEventTimedelta", kTH1F, {{200, -1000, 1000, "generated - computed"}});
188194
histos.add("h2dEventTimeres", "h2dEventTimeres", kTH2F, {axisdNdeta, {300, 0, 300, "resolution"}});
195+
listEfficiency.setObject(new THashList);
196+
listEfficiency->Add(new TEfficiency("effEventTime", "effEventTime", plotsConfig.nBinsMult, 0.0f, plotsConfig.maxMultRange));
189197

190198
const AxisSpec axisMomentum{static_cast<int>(plotsConfig.nBinsP), 0.0f, +10.0f, "#it{p} (GeV/#it{c})"};
191199
const AxisSpec axisMomentumSmall{static_cast<int>(plotsConfig.nBinsP), 0.0f, +1.0f, "#it{p} (GeV/#it{c})"};
@@ -564,8 +572,9 @@ struct OnTheFlyTofPid {
564572
// Now we compute the event time for the tracks
565573

566574
std::array<float, 2> tzero = {0.f, 0.f};
575+
bool etStatus = false;
567576
if (simConfig.considerEventTime.value) {
568-
const bool etStatus = eventTime(tracksWithTime, tzero);
577+
etStatus = eventTime(tracksWithTime, tzero);
569578
if (!etStatus) {
570579
LOG(warning) << "Event time calculation failed with " << tracksWithTime.size() << " tracks";
571580
}
@@ -576,6 +585,10 @@ struct OnTheFlyTofPid {
576585
histos.fill(HIST("h1dEventTimegen"), eventCollisionTimePS);
577586
histos.fill(HIST("h1dEventTimerec"), tzero[0]);
578587
histos.fill(HIST("h2dEventTimeres"), dNdEta, tzero[1]);
588+
if (etStatus) {
589+
histos.fill(HIST("h1dEventTimedelta"), eventCollisionTimePS - tzero[0]);
590+
}
591+
static_cast<TEfficiency*>(listEfficiency->At(0))->Fill(etStatus, dNdEta);
579592
}
580593

581594
// Then we do a second loop to compute the measured quantities with the measured event time

ALICE3/TableProducer/OTF/onTheFlyTracker.cxx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -870,6 +870,9 @@ struct OnTheFlyTracker {
870870
posClusterCandidate[2] = gRandom->Gaus(posClusterCandidate[2], currentTrackingLayer.resZ);
871871
}
872872

873+
if (std::isnan(phi))
874+
continue; // Catch when getXatLabR misses layer[i]
875+
873876
// towards adding cluster: move to track alpha
874877
double alpha = cascadeTrack.getAlpha();
875878
double xyz1[3]{

ALICE3/TableProducer/alice3-multicharm.cxx

Lines changed: 36 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -522,21 +522,28 @@ struct alice3multicharm {
522522
if (std::fabs(xi.dcaXY()) < xiFromXiC_dcaXYconstant || std::fabs(xi.dcaZ()) < xiFromXiC_dcaZconstant)
523523
continue; // likely a primary xi
524524

525+
histos.fill(HIST("hDCAxyXi"), std::fabs(xi.dcaXY() * 1e+4));
526+
histos.fill(HIST("hDCAzXi"), std::fabs(xi.dcaZ() * 1e+4));
527+
525528
if (xiCand.cascRadius() < minXiRadius)
526529
continue;
527530

531+
histos.fill(HIST("hMinXiDecayRadius"), xiCand.cascRadius());
528532
for (auto const& pi1c : tracksPiFromXiCgrouped) {
529533
if (mcSameMotherCheck && !checkSameMother(xi, pi1c))
530534
continue;
531535
if (xiCand.posTrackId() == pi1c.globalIndex() || xiCand.negTrackId() == pi1c.globalIndex() || xiCand.bachTrackId() == pi1c.globalIndex())
532536
continue; // avoid using any track that was already used
537+
533538
if (pi1c.pt() < minPiCPt)
534539
continue; // too low momentum
535540

541+
histos.fill(HIST("hPi1cPt"), pi1c.pt());
536542
double pi1cTOFDiffInner = std::fabs(pi1c.innerTOFTrackTimeReco() - pi1c.innerTOFExpectedTimePi());
537543
if (pi1cTOFDiffInner > piFromXiC_tofDiffInner)
538544
continue; // did not arrive at expected time
539545

546+
histos.fill(HIST("hInnerTOFTrackTimeRecoPi1c"), pi1cTOFDiffInner);
540547
// second pion from XiC decay for starts here
541548
for (auto const& pi2c : tracksPiFromXiCgrouped) {
542549
if (mcSameMotherCheck && !checkSameMother(xi, pi2c))
@@ -551,10 +558,12 @@ struct alice3multicharm {
551558
if (pi2c.pt() < minPiCPt)
552559
continue; // too low momentum
553560

561+
histos.fill(HIST("hPi2cPt"), pi2c.pt());
554562
double pi2cTOFDiffInner = std::fabs(pi2c.innerTOFTrackTimeReco() - pi2c.innerTOFExpectedTimePi());
555563
if (pi2cTOFDiffInner > piFromXiC_tofDiffInner)
556564
continue; // did not arrive at expected time
557565

566+
histos.fill(HIST("hInnerTOFTrackTimeRecoPi2c"), pi2cTOFDiffInner);
558567
// if I am here, it means this is a triplet to be considered for XiC vertexing.
559568
// will now attempt to build a three-body decay candidate with these three track rows.
560569

@@ -563,6 +572,8 @@ struct alice3multicharm {
563572
if (!buildDecayCandidateThreeBody(xi, pi1c, pi2c, o2::constants::physics::MassXiMinus, o2::constants::physics::MassPionCharged, o2::constants::physics::MassPionCharged))
564573
continue; // failed at building candidate
565574

575+
histos.fill(HIST("hDCAXiCDaughters"), thisXiCcandidate.dca * 1e+4);
576+
566577
if (std::fabs(thisXiCcandidate.mass - o2::constants::physics::MassXiCPlus) > massWindowXiC)
567578
continue; // out of mass region
568579

@@ -578,10 +589,13 @@ struct alice3multicharm {
578589
if (xicDecayRadius2D < minXiCRadius)
579590
continue; // do not take if radius too small, likely a primary combination
580591

581-
histos.fill(HIST("hXiRadiusVsXicRadius"), xiCand.cascRadius() * 1e+4, xicDecayRadius2D * 1e+4);
592+
histos.fill(HIST("hMinXiCDecayRadius"), xicDecayRadius2D * 1e+4);
593+
582594
if (xicDecayRadius2D > xiCand.cascRadius())
583595
continue;
584596

597+
histos.fill(HIST("hXiRadiusVsXicRadius"), xiCand.cascRadius() * 1e+4, xicDecayRadius2D * 1e+4);
598+
585599
o2::dataformats::DCA dcaInfo;
586600
float xicdcaXY = 1e+10, xicdcaZ = 1e+10;
587601
o2::track::TrackParCov xicTrackCopy(xicTrack); // paranoia
@@ -596,6 +610,8 @@ struct alice3multicharm {
596610
if (std::fabs(xicdcaXY) < xiCFromXiCC_dcaXY || std::fabs(xicdcaZ) < xiCFromXiCC_dcaZ)
597611
continue; // likely a primary xic
598612

613+
histos.fill(HIST("hDCAxyXiC"), std::fabs(xicdcaXY * 1e+4));
614+
histos.fill(HIST("hDCAzXiC"), std::fabs(xicdcaZ * 1e+4));
599615
histos.fill(HIST("hMassXiC"), thisXiCcandidate.mass);
600616

601617
// attempt XiCC finding
@@ -610,16 +626,22 @@ struct alice3multicharm {
610626
if (picc.pt() < minPiCCPt)
611627
continue; // too low momentum
612628

629+
histos.fill(HIST("hPiccPt"), picc.pt());
630+
613631
double piccTOFDiffInner = std::fabs(picc.innerTOFTrackTimeReco() - picc.innerTOFExpectedTimePi());
614632
if (piccTOFDiffInner > piFromXiCC_tofDiffInner)
615633
continue; // did not arrive at expected time
616634

635+
histos.fill(HIST("hInnerTOFTrackTimeRecoPicc"), piccTOFDiffInner);
636+
617637
o2::track::TrackParCov piccTrack = getTrackParCov(picc);
618638
nCombinationsCC++;
619639
histos.fill(HIST("hCharmBuilding"), 2.0f);
620640
if (!buildDecayCandidateTwoBody(xicTrack, piccTrack, o2::constants::physics::MassXiCPlus, o2::constants::physics::MassPionCharged))
621641
continue; // failed at building candidate
622642

643+
histos.fill(HIST("hDCAXiCCDaughters"), thisXiCCcandidate.dca * 1e+4);
644+
623645
const std::array<float, 3> momentumCC = {
624646
thisXiCCcandidate.prong0mom[0] + thisXiCCcandidate.prong1mom[0],
625647
thisXiCCcandidate.prong0mom[1] + thisXiCCcandidate.prong1mom[1],
@@ -630,15 +652,20 @@ struct alice3multicharm {
630652
if (xiccDecayRadius2D < minXiCCRadius)
631653
continue; // do not take if radius too small, likely a primary combination
632654

655+
histos.fill(HIST("hMinXiCCDecayRadius"), xiccDecayRadius2D * 1e+4);
656+
633657
double totalMomentumC = std::hypot(momentumC[0], momentumC[1], momentumC[2]);
634658
double decayLengthXiC = std::hypot(
635659
thisXiCcandidate.xyz[0] - thisXiCCcandidate.xyz[0],
636660
thisXiCcandidate.xyz[1] - thisXiCCcandidate.xyz[1],
637661
thisXiCcandidate.xyz[2] - thisXiCCcandidate.xyz[2]);
638662
double xicProperLength = decayLengthXiC * thisXiCcandidate.mass / totalMomentumC;
663+
639664
if (xicProperLength < xicMinProperLength || xicProperLength > xicMaxProperLength)
640665
continue; // likely background
641666

667+
histos.fill(HIST("hProperLengthXiC"), xicProperLength * 1e+4);
668+
642669
double xicDistanceFromPV = std::hypot(
643670
thisXiCcandidate.xyz[0] - collision.posX(),
644671
thisXiCcandidate.xyz[1] - collision.posY(),
@@ -647,6 +674,8 @@ struct alice3multicharm {
647674
if (xicDecayDistanceFromPV < xicMinDecayDistanceFromPV)
648675
continue; // too close to PV
649676

677+
histos.fill(HIST("hMinxicDecayDistanceFromPV"), xicDecayDistanceFromPV * 1e+4);
678+
650679
double totalMomentumCC = std::hypot(momentumCC[0], momentumCC[1], momentumCC[2]);
651680
double decayLengthXiCC = std::hypot(
652681
thisXiCCcandidate.xyz[0] - collision.posX(),
@@ -656,10 +685,12 @@ struct alice3multicharm {
656685
if (xiccProperLength < xiccMinProperLength || xiccProperLength > xicMaxProperLength)
657686
continue; // likely background
658687

659-
histos.fill(HIST("hXicRadiusVsXiccRadius"), xicDecayRadius2D * 1e+4, xiccDecayRadius2D * 1e+4);
688+
histos.fill(HIST("hProperLengthXiCC"), xiccProperLength * 1e+4);
660689
if (xiccDecayRadius2D > xicDecayRadius2D)
661690
continue; // XiCC should decay before XiC
662691

692+
histos.fill(HIST("hXicRadiusVsXiccRadius"), xicDecayRadius2D * 1e+4, xiccDecayRadius2D * 1e+4);
693+
663694
float xiccdcaXY = 1e+10, xiccdcaZ = 1e+10;
664695
if (xiccTrack.propagateToDCA(primaryVertex, magneticField, &dcaInfo)) {
665696
xiccdcaXY = dcaInfo.getY();
@@ -669,29 +700,12 @@ struct alice3multicharm {
669700
if (std::fabs(xiccdcaXY) > xiCC_dcaXY || std::fabs(xiccdcaZ) > xiCC_dcaZ)
670701
continue; // not pointing to PV
671702

703+
histos.fill(HIST("hDCAxyXiCC"), std::fabs(xiccdcaXY * 1e+4));
704+
histos.fill(HIST("hDCAzXiCC"), std::fabs(xiccdcaZ * 1e+4));
705+
672706
if (std::fabs(thisXiCcandidate.eta) > xiccMaxEta)
673707
continue; // not in central barrel
674708

675-
histos.fill(HIST("hMinxicDecayDistanceFromPV"), xicDecayDistanceFromPV * 1e+4);
676-
histos.fill(HIST("hInnerTOFTrackTimeRecoPi1c"), pi1cTOFDiffInner);
677-
histos.fill(HIST("hInnerTOFTrackTimeRecoPi2c"), pi2cTOFDiffInner);
678-
histos.fill(HIST("hInnerTOFTrackTimeRecoPicc"), piccTOFDiffInner);
679-
histos.fill(HIST("hDCAXiCDaughters"), thisXiCcandidate.dca * 1e+4);
680-
histos.fill(HIST("hDCAXiCCDaughters"), thisXiCCcandidate.dca * 1e+4);
681-
histos.fill(HIST("hProperLengthXiCC"), xiccProperLength * 1e+4);
682-
histos.fill(HIST("hProperLengthXiC"), xicProperLength * 1e+4);
683-
histos.fill(HIST("hMinXiCCDecayRadius"), xiccDecayRadius2D * 1e+4);
684-
histos.fill(HIST("hMinXiCDecayRadius"), xicDecayRadius2D * 1e+4);
685-
histos.fill(HIST("hMinXiDecayRadius"), xiCand.cascRadius());
686-
histos.fill(HIST("hPi1cPt"), pi1c.pt());
687-
histos.fill(HIST("hPi2cPt"), pi2c.pt());
688-
histos.fill(HIST("hPiccPt"), picc.pt());
689-
histos.fill(HIST("hDCAxyXi"), std::fabs(xi.dcaXY() * 1e+4));
690-
histos.fill(HIST("hDCAzXi"), std::fabs(xi.dcaZ() * 1e+4));
691-
histos.fill(HIST("hDCAxyXiC"), std::fabs(xicdcaXY * 1e+4));
692-
histos.fill(HIST("hDCAzXiC"), std::fabs(xicdcaZ * 1e+4));
693-
histos.fill(HIST("hDCAxyXiCC"), std::fabs(xiccdcaXY * 1e+4));
694-
histos.fill(HIST("hDCAzXiCC"), std::fabs(xiccdcaZ * 1e+4));
695709
histos.fill(HIST("hCharmBuilding"), 3.0f);
696710
histos.fill(HIST("hMassXiCC"), thisXiCCcandidate.mass);
697711
histos.fill(HIST("hPtXiCC"), thisXiCCcandidate.pt);

Common/CCDB/CMakeLists.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,6 @@ o2physics_target_root_dictionary(AnalysisCCDB
2121
HEADERS ctpRateFetcher.h
2222
HEADERS RCTSelectionFlags.h
2323
LINKDEF AnalysisCCDBLinkDef.h)
24+
25+
o2physics_add_header_only_library(RCTSelectionFlags
26+
HEADERS RCTSelectionFlags.h)

Common/Core/TableHelper.h

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020

2121
#include <string>
2222

23+
#include "Framework/Configurable.h"
2324
#include "Framework/InitContext.h"
2425
#include "Framework/RunningWorkflowInfo.h"
2526

@@ -95,4 +96,15 @@ bool getTaskOptionValue(o2::framework::InitContext& initContext, const std::stri
9596
return false;
9697
}
9798

99+
/// Function to check for a specific configurable from another task in the current workflow and fetch its value. Useful for tasks that need to know the value of a configurable in another task.
100+
/// @param initContext initContext of the init function
101+
/// @param taskName name of the task to check for
102+
/// @param value Task configurable to inherit from (name and values are used)
103+
/// @param verbose if true, print debug messages
104+
template <typename ValueType>
105+
bool getTaskOptionValue(o2::framework::InitContext& initContext, const std::string& taskName, ValueType& configurable, const bool verbose = true)
106+
{
107+
return getTaskOptionValue(initContext, taskName, configurable.name, configurable.value, verbose);
108+
}
109+
98110
#endif // COMMON_CORE_TABLEHELPER_H_

0 commit comments

Comments
 (0)