Skip to content

Commit 7789989

Browse files
authored
[Common,PWGLF] feat(nucleiSpectra): Add matching study histograms (#8775)
1 parent 4e9711e commit 7789989

File tree

2 files changed

+37
-0
lines changed

2 files changed

+37
-0
lines changed

Common/DataModel/PIDResponseITS.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,12 @@ struct ITSResponse {
8181
return (average * coslInv - exp) / resolution;
8282
};
8383

84+
template <o2::track::PID::ID id, typename T>
85+
static float nSigmaITS(const T& track)
86+
{
87+
return nSigmaITS<id>(track.itsClusterSizes(), track.p(), track.eta());
88+
}
89+
8490
static void setParameters(float p0, float p1, float p2, float p0_Z2, float p1_Z2, float p2_Z2, float p0_res, float p1_res, float p2_res)
8591
{
8692
if (mIsInitialized) {

PWGLF/TableProducer/Nuspex/nucleiSpectra.cxx

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
#include "Common/DataModel/Multiplicity.h"
3636
#include "Common/DataModel/EventSelection.h"
3737
#include "Common/DataModel/PIDResponse.h"
38+
#include "Common/DataModel/PIDResponseITS.h"
3839
#include "Common/DataModel/TrackSelectionTables.h"
3940
#include "Common/Core/PID/PIDTOF.h"
4041
#include "Common/TableProducer/PID/pidTOFBase.h"
@@ -203,6 +204,7 @@ std::shared_ptr<TH2> hGloTOFtracks[2];
203204
std::shared_ptr<TH2> hDeltaP[2][5];
204205
std::shared_ptr<THnSparse> hFlowHists[2][5];
205206
std::shared_ptr<THnSparse> hDCAHists[2][5];
207+
std::shared_ptr<THnSparse> hMatchingStudy[2];
206208
o2::base::MatLayerCylSet* lut = nullptr;
207209

208210
std::vector<NucleusCandidate> candidates;
@@ -463,6 +465,12 @@ struct nucleiSpectra {
463465
}
464466
}
465467

468+
if (doprocessMatching) {
469+
for (int iC{0}; iC < 2; ++iC) {
470+
nuclei::hMatchingStudy[iC] = spectra.add<THnSparse>(fmt::format("hMatchingStudy{}", nuclei::matter[iC]).data(), ";#it{p}_{T};#phi;#eta;n#sigma_{ITS};n#sigma{TPC};n#sigma_{TOF}", HistType::kTHnSparseF, {{20, 1., 9.}, {10, 0., o2::constants::math::TwoPI}, {10, -1., 1.}, {50, -5., 5.}, {50, -5., 5.}, {50, 0., 1.}});
471+
}
472+
}
473+
466474
nuclei::lut = o2::base::MatLayerCylSet::rectifyPtrFromFile(ccdb->get<o2::base::MatLayerCylSet>("GLO/Param/MatLUT"));
467475
// TrackTuner initialization
468476
if (cfgUseTrackTuner) {
@@ -890,6 +898,29 @@ struct nucleiSpectra {
890898
}
891899
}
892900
PROCESS_SWITCH(nucleiSpectra, processMC, "MC analysis", false);
901+
902+
void processMatching(soa::Join<aod::Collisions, aod::EvSels>::iterator const& collision, TrackCandidates const& tracks, aod::BCsWithTimestamps const&)
903+
{
904+
if (!eventSelection(collision)) {
905+
return;
906+
}
907+
o2::aod::ITSResponse itsResponse;
908+
for (auto& track : tracks) {
909+
if (std::abs(track.eta()) > cfgCutEta ||
910+
track.itsNCls() < 7 ||
911+
track.itsChi2NCl() > 36.f ||
912+
itsResponse.nSigmaITS<o2::track::PID::Helium3>(track) < -1.) {
913+
continue;
914+
}
915+
double expBethe{tpc::BetheBlochAleph(static_cast<double>(track.tpcInnerParam() * 2. / o2::constants::physics::MassHelium3), cfgBetheBlochParams->get(4, 0u), cfgBetheBlochParams->get(4, 1u), cfgBetheBlochParams->get(4, 2u), cfgBetheBlochParams->get(4, 3u), cfgBetheBlochParams->get(4, 4u))};
916+
double expSigma{expBethe * cfgBetheBlochParams->get(4, 5u)};
917+
double nSigmaTPC{(track.tpcSignal() - expBethe) / expSigma};
918+
int iC = track.signed1Pt() > 0;
919+
nuclei::hMatchingStudy[iC]->Fill(track.pt() * 2, track.phi(), track.eta(), itsResponse.nSigmaITS<o2::track::PID::Helium3>(track), nSigmaTPC, o2::pid::tof::Beta::GetBeta(track));
920+
}
921+
}
922+
923+
PROCESS_SWITCH(nucleiSpectra, processMatching, "Matching analysis", false);
893924
};
894925

895926
WorkflowSpec defineDataProcessing(ConfigContext const& cfgc)

0 commit comments

Comments
 (0)