Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 12 additions & 3 deletions Common/Core/fwdtrackUtilities.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
#ifndef COMMON_CORE_FWDTRACKUTILITIES_H_
#define COMMON_CORE_FWDTRACKUTILITIES_H_

#include <Framework/AnalysisDataModel.h>
#include <Framework/DataTypes.h>
#include <GlobalTracking/MatchGlobalFwd.h>
#include <MCHTracking/TrackExtrap.h>
Expand Down Expand Up @@ -48,22 +47,32 @@ using SMatrix55 = ROOT::Math::SMatrix<double, 5, 5, ROOT::Math::MatRepSym<double
using SMatrix55Std = ROOT::Math::SMatrix<double, 5>;
using SMatrix5 = ROOT::Math::SVector<double, 5>;

template <typename T>
concept is_fwd_track = requires(T t) {
{ t.rAtAbsorberEnd() } -> std::same_as<float>;
};

template <typename T>
concept is_fwd_cov = requires(T t) {
{ t.sigmaX() } -> std::same_as<float>;
};

/// Produce TrackParCovFwds for MFT and FwdTracks, w/ or w/o cov, with z shift
template <typename TFwdTrack, typename... TCovariance>
o2::track::TrackParCovFwd getTrackParCovFwdShift(TFwdTrack const& track, float zshift, TCovariance const&... covOpt)
{
double chi2 = track.chi2();
if constexpr (sizeof...(covOpt) == 0) {
// No covariance passed
if constexpr (std::is_same_v<std::decay_t<TFwdTrack>, aod::FwdTracks::iterator>) {
if constexpr (is_fwd_track<TFwdTrack>) {
if (track.trackType() == o2::aod::fwdtrack::ForwardTrackTypeEnum::MuonStandaloneTrack) {
chi2 = track.chi2() * (2.f * track.nClusters() - 5.f);
}
}
} else {
// Covariance passed
using TCov = std::decay_t<decltype((covOpt, ...))>;
if constexpr (std::is_same_v<TCov, aod::FwdTracksCov::iterator>) {
if constexpr (is_fwd_cov<TCov>) {
if (track.trackType() == o2::aod::fwdtrack::ForwardTrackTypeEnum::MuonStandaloneTrack) {
chi2 = track.chi2() * (2.f * track.nClusters() - 5.f);
}
Expand Down
1 change: 0 additions & 1 deletion PWGDQ/Core/MixingHandler.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@

#include <Rtypes.h>

#include <algorithm>
#include <array>
#include <cstdint>
#include <iostream>
Expand Down
2 changes: 1 addition & 1 deletion PWGEM/Dilepton/Core/EMEventCut.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
#ifndef PWGEM_DILEPTON_CORE_EMEVENTCUT_H_
#define PWGEM_DILEPTON_CORE_EMEVENTCUT_H_

#include "PWGEM/Dilepton/DataModel/dileptonTables.h"
#include "PWGEM/Dilepton/DataModel/EvSelFlags.h"

#include <TNamed.h>

Expand Down
40 changes: 40 additions & 0 deletions PWGEM/Dilepton/DataModel/EvSelFlags.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
// Copyright 2019-2026 CERN and copyright holders of ALICE O2.
// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
// All rights not expressly granted are reserved.
//
// This software is distributed under the terms of the GNU General Public
// License v3 (GPL Version 3), copied verbatim in the file "COPYING".
//
// In applying this license CERN does not waive the privileges and immunities
// granted to it by virtue of its status as an Intergovernmental Organization
// or submit itself to any jurisdiction.

#ifndef PWGEM_DILEPTON_CORE_EVSELFLAGS_H
#define PWGEM_DILEPTON_CORE_EVSELFLAGS_H

namespace o2::aod::emevsel
{
// Event selection criteria. See O2Physics/Common/CCDB/EventSelectionParams.h
enum EventSelectionFlags {
kIsTriggerTVX = 0, // FT0 vertex (acceptable FT0C-FT0A time difference) at trigger level
kNoITSROFrameBorder, // bunch crossing is far from ITS RO Frame border
kNoTimeFrameBorder, // bunch crossing is far from Time Frame borders
kNoSameBunchPileup, // reject collisions in case of pileup with another collision in the same foundBC
kIsGoodZvtxFT0vsPV, // small difference between z-vertex from PV and from FT0
kIsVertexITSTPC, // at least one ITS-TPC track (reject vertices built from ITS-only tracks)
kIsVertexTOFmatched, // at least one of vertex contributors is matched to TOF
kIsVertexTRDmatched, // at least one of vertex contributors is matched to TRD
kNoCollInTimeRangeNarrow, // no other collisions in specified time range (narrower than Strict)
kNoCollInTimeRangeStrict, // no other collisions in specified time range
kNoCollInTimeRangeStandard, // no other collisions in specified time range with per-collision multiplicity above threshold
kNoCollInRofStrict, // no other collisions in this Readout Frame
kNoCollInRofStandard, // no other collisions in this Readout Frame with per-collision multiplicity above threshold
kNoHighMultCollInPrevRof, // veto an event if FT0C amplitude in previous ITS ROF is above threshold
kIsGoodITSLayer3, // number of inactive chips on ITS layer 3 is below maximum allowed value
kIsGoodITSLayer0123, // numbers of inactive chips on ITS layers 0-3 are below maximum allowed values
kIsGoodITSLayersAll, // numbers of inactive chips on all ITS layers are below maximum allowed values
kNsel // counter
};
} // namespace o2::aod::emevsel

#endif // PWGEM_DILEPTON_CORE_EVSELFLAGS_H
25 changes: 2 additions & 23 deletions PWGEM/Dilepton/DataModel/dileptonTables.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
// granted to it by virtue of its status as an Intergovernmental Organization
// or submit itself to any jurisdiction.

#include "EvSelFlags.h"

#include "Common/CCDB/EventSelectionParams.h"
#include "Common/Core/RecoDecay.h"
#include "Common/DataModel/Centrality.h"
Expand Down Expand Up @@ -66,28 +68,6 @@ namespace o2::aod

namespace emevsel
{
// Event selection criteria. See O2Physics/Common/CCDB/EventSelectionParams.h
enum EventSelectionFlags {
kIsTriggerTVX = 0, // FT0 vertex (acceptable FT0C-FT0A time difference) at trigger level
kNoITSROFrameBorder, // bunch crossing is far from ITS RO Frame border
kNoTimeFrameBorder, // bunch crossing is far from Time Frame borders
kNoSameBunchPileup, // reject collisions in case of pileup with another collision in the same foundBC
kIsGoodZvtxFT0vsPV, // small difference between z-vertex from PV and from FT0
kIsVertexITSTPC, // at least one ITS-TPC track (reject vertices built from ITS-only tracks)
kIsVertexTOFmatched, // at least one of vertex contributors is matched to TOF
kIsVertexTRDmatched, // at least one of vertex contributors is matched to TRD
kNoCollInTimeRangeNarrow, // no other collisions in specified time range (narrower than Strict)
kNoCollInTimeRangeStrict, // no other collisions in specified time range
kNoCollInTimeRangeStandard, // no other collisions in specified time range with per-collision multiplicity above threshold
kNoCollInRofStrict, // no other collisions in this Readout Frame
kNoCollInRofStandard, // no other collisions in this Readout Frame with per-collision multiplicity above threshold
kNoHighMultCollInPrevRof, // veto an event if FT0C amplitude in previous ITS ROF is above threshold
kIsGoodITSLayer3, // number of inactive chips on ITS layer 3 is below maximum allowed value
kIsGoodITSLayer0123, // numbers of inactive chips on ITS layers 0-3 are below maximum allowed values
kIsGoodITSLayersAll, // numbers of inactive chips on all ITS layers are below maximum allowed values
kNsel // counter
};

DECLARE_SOA_BITMAP_COLUMN(Selection, selection, 32); //! Bitmask of selection flags
DECLARE_SOA_DYNAMIC_COLUMN(Sel8, sel8, [](uint32_t selection_bit) -> bool { return (selection_bit & BIT(o2::aod::emevsel::kIsTriggerTVX)) && (selection_bit & BIT(o2::aod::emevsel::kNoTimeFrameBorder)) && (selection_bit & BIT(o2::aod::emevsel::kNoITSROFrameBorder)); });

Expand Down Expand Up @@ -149,7 +129,6 @@ uint32_t reduceSelectionBit(TBC const& bc)
}
return bitMap;
}

} // namespace emevsel

namespace emevent
Expand Down
13 changes: 7 additions & 6 deletions PWGEM/PhotonMeson/Core/DalitzEECut.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@

#include "PWGEM/Dilepton/Utils/EMTrackUtilities.h"
#include "PWGEM/Dilepton/Utils/PairUtilities.h"
#include "PWGEM/PhotonMeson/Utils/TrackSelection.h"

#include <CommonConstants/PhysicsConstants.h>
#include <Framework/ASoA.h>
Expand Down Expand Up @@ -86,7 +87,7 @@ class DalitzEECut
return true;
}

template <o2::soa::is_iterator TTrack1, o2::soa::is_iterator TTrack2>
template <is_track_with_extra TTrack1, is_track_with_extra TTrack2>
bool IsSelectedPair(TTrack1 const& t1, TTrack2 const& t2, const float bz) const
{
ROOT::Math::PtEtaPhiMVector v1(t1.pt(), t1.eta(), t1.phi(), o2::constants::physics::MassElectron);
Expand All @@ -108,7 +109,7 @@ class DalitzEECut
return true;
}

template <bool isML = false, o2::soa::is_iterator TTrack, typename TCollision = int>
template <bool isML = false, is_track_with_extra TTrack, typename TCollision = int>
bool IsSelectedTrack(TTrack const& track, TCollision const& = 0) const
{
if (!track.hasITS()) {
Expand Down Expand Up @@ -194,7 +195,7 @@ class DalitzEECut
return true;
}

template <o2::soa::is_iterator T>
template <is_track_with_extra T>
bool PassPID(T const& track) const
{
switch (mPIDScheme) {
Expand All @@ -212,15 +213,15 @@ class DalitzEECut
}
}

template <o2::soa::is_iterator T>
template <is_track_with_extra T>
bool PassTPConly(T const& track) const
{
bool is_el_included_TPC = mMinTPCNsigmaEl < track.tpcNSigmaEl() && track.tpcNSigmaEl() < mMaxTPCNsigmaEl;
bool is_pi_excluded_TPC = track.tpcNSigmaPi() < mMinTPCNsigmaPi || mMaxTPCNsigmaPi < track.tpcNSigmaPi();
return is_el_included_TPC && is_pi_excluded_TPC;
}

template <o2::soa::is_iterator T>
template <is_track_with_extra T>
bool PassTOFif(T const& track) const
{
bool is_el_included_TPC = mMinTPCNsigmaEl < track.tpcNSigmaEl() && track.tpcNSigmaEl() < mMaxTPCNsigmaEl;
Expand All @@ -229,7 +230,7 @@ class DalitzEECut
return is_el_included_TPC && is_pi_excluded_TPC && is_el_included_TOF;
}

template <o2::soa::is_iterator T>
template <is_track_with_extra T>
bool IsSelectedTrack(T const& track, const DalitzEECuts& cut) const
{
switch (cut) {
Expand Down
47 changes: 47 additions & 0 deletions PWGEM/PhotonMeson/Core/EMCPhotonCut.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@

#include "PWGJE/DataModel/EMCALClusters.h"

#include <Framework/HistogramRegistry.h>
#include <Framework/Logger.h>

#include <Rtypes.h>
Expand All @@ -27,6 +28,52 @@ ClassImp(EMCPhotonCut);

const char* EMCPhotonCut::mCutNames[static_cast<int>(EMCPhotonCut::EMCPhotonCuts::kNCuts)] = {"Definition", "Energy", "NCell", "M02", "Timing", "TrackMatching", "SecTrackMatching", "Exotic"};

void EMCPhotonCut::addQAHistograms(o2::framework::HistogramRegistry* fRegistry) const
{
if (mDoQA && fRegistry != nullptr) {
const o2::framework::AxisSpec thAxisClusterEnergy{500, 0, 50, "#it{E}_{cls} (GeV)"};
const o2::framework::AxisSpec thAxisMomentum{250, 0., 25., "#it{p}_{T} (GeV/#it{c})"};
const o2::framework::AxisSpec thAxisDEta{200, -0.1, 0.1, "#Delta#eta"};
const o2::framework::AxisSpec thAxisDPhi{200, -0.1, 0.1, "#Delta#varphi (rad)"};
const o2::framework::AxisSpec thAxisEnergy{500, 0., 50., "#it{E} (GeV)"};
const o2::framework::AxisSpec thAxisEta{320, -0.8, 0.8, "#eta"};
const o2::framework::AxisSpec thAxisPhi{500, 0, o2::constants::math::TwoPI, "#varphi (rad)"};
const o2::framework::AxisSpec thAxisNCell{51, -0.5, 50.5, "#it{N}_{cell}"};
const o2::framework::AxisSpec thAxisM02{200, 0, 2.0, "#it{M}_{02}"};
const o2::framework::AxisSpec thAxisTime{300, -150, +150, "#it{t}_{cls} (ns)"};
const o2::framework::AxisSpec thAxisEoverP{400, 0, 10., "#it{E}_{cls}/#it{p}_{track} (#it{c})"};

fRegistry->add("QA/Cluster/before/hE", "E_{cluster};#it{E}_{cluster} (GeV);#it{N}_{cluster}", o2::framework::HistType::kTH1D, {thAxisClusterEnergy}, true);
fRegistry->add("QA/Cluster/before/hPt", "Transverse momenta of clusters;#it{p}_{T} (GeV/c);#it{N}_{cluster}", o2::framework::HistType::kTH1D, {thAxisClusterEnergy}, true);
fRegistry->add("QA/Cluster/before/hNgamma", "Number of #gamma candidates per collision;#it{N}_{#gamma} per collision;#it{N}_{collisions}", o2::framework::HistType::kTH1D, {{1001, -0.5f, 1000.5f}}, true);
fRegistry->add("QA/Cluster/before/hEtaPhi", "#eta vs #varphi;#eta;#varphi (rad.)", o2::framework::HistType::kTH2F, {thAxisEta, thAxisPhi}, true);
fRegistry->add("QA/Cluster/before/hNCell", "#it{N}_{cells};N_{cells} (GeV);#it{E}_{cluster} (GeV)", o2::framework::HistType::kTH2F, {thAxisNCell, thAxisClusterEnergy}, true);
fRegistry->add("QA/Cluster/before/hM02", "Long ellipse axis;#it{M}_{02} (cm);#it{E}_{cluster} (GeV)", o2::framework::HistType::kTH2F, {thAxisM02, thAxisClusterEnergy}, true);
fRegistry->add("QA/Cluster/before/hTime", "Cluster time;#it{t}_{cls} (ns);#it{E}_{cluster} (GeV)", o2::framework::HistType::kTH2F, {thAxisTime, thAxisClusterEnergy}, true);

fRegistry->addClone("QA/Cluster/before/", "QA/Cluster/after/");

auto hClusterQualityCuts = fRegistry->add<TH2>("QA/Cluster/hClusterQualityCuts", "Energy at which clusters are removed by a given cut;;#it{E} (GeV)", o2::framework::HistType::kTH2F, {{static_cast<int>(EMCPhotonCut::EMCPhotonCuts::kNCuts) + 2, -0.5, static_cast<double>(EMCPhotonCut::EMCPhotonCuts::kNCuts) + 1.5}, thAxisClusterEnergy}, true);
hClusterQualityCuts->GetXaxis()->SetBinLabel(1, "In");
hClusterQualityCuts->GetXaxis()->SetBinLabel(2, "Definition");
hClusterQualityCuts->GetXaxis()->SetBinLabel(3, "Energy");
hClusterQualityCuts->GetXaxis()->SetBinLabel(4, "NCell");
hClusterQualityCuts->GetXaxis()->SetBinLabel(5, "M02");
hClusterQualityCuts->GetXaxis()->SetBinLabel(6, "Timing");
hClusterQualityCuts->GetXaxis()->SetBinLabel(7, "TM");
hClusterQualityCuts->GetXaxis()->SetBinLabel(8, "Sec. TM");
hClusterQualityCuts->GetXaxis()->SetBinLabel(9, "Exotic");
hClusterQualityCuts->GetXaxis()->SetBinLabel(10, "Out");

fRegistry->add("QA/Cluster/hTrackdEtadPhi", "d#eta vs. d#varphi of matched tracks;d#eta;d#varphi (rad.)", o2::framework::HistType::kTH2F, {thAxisDEta, thAxisDPhi}, true);
fRegistry->add("QA/Cluster/hTrackdEtaPt", "d#eta vs. track pT of matched tracks;d#eta;d#varphi (rad.)", o2::framework::HistType::kTH2F, {thAxisDEta, thAxisMomentum}, true);
fRegistry->add("QA/Cluster/hTrackdPhiPt", "d#varphi vs. track pT of matched tracks;d#eta;d#varphi (rad.)", o2::framework::HistType::kTH2F, {thAxisDPhi, thAxisMomentum}, true);
fRegistry->add("QA/Cluster/hSecTrackdEtadPhi", "d#eta vs. d#varphi of matched secondary tracks;d#eta;d#varphi (rad.)", o2::framework::HistType::kTH2F, {thAxisDEta, thAxisDPhi}, true);
fRegistry->add("QA/Cluster/hSecTrackdEtaPt", "d#eta vs. track pT of matched secondary tracks;d#eta;d#varphi (rad.)", o2::framework::HistType::kTH2F, {thAxisDEta, thAxisMomentum}, true);
fRegistry->add("QA/Cluster/hSecTrackdPhiPt", "d#varphi vs. track pT of matched secondary tracks;d#eta;d#varphi (rad.)", o2::framework::HistType::kTH2F, {thAxisDPhi, thAxisMomentum}, true);
}
}

void EMCPhotonCut::SetClusterizer(std::string clusterDefinitionString)
{
mDefinition = static_cast<int>(o2::aod::emcalcluster::getClusterDefinitionFromString(clusterDefinitionString));
Expand Down
Loading
Loading