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
13 changes: 0 additions & 13 deletions PWGEM/PhotonMeson/Core/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,3 @@ o2physics_add_library(PWGEMPhotonMesonCore
EMBitFlags.cxx
EMNonLin.cxx
PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore O2Physics::MLCore O2Physics::PWGEMDileptonCore KFParticle::KFParticle)

o2physics_target_root_dictionary(PWGEMPhotonMesonCore
HEADERS V0PhotonCut.h
DalitzEECut.h
PHOSPhotonCut.h
EMCPhotonCut.h
PairCut.h
EMPhotonEventCut.h
CutsLibrary.h
HistogramsLibrary.h
EMBitFlags.h
EMNonLin.h
LINKDEF PWGEMPhotonMesonCoreLinkDef.h)
15 changes: 8 additions & 7 deletions PWGEM/PhotonMeson/Core/DalitzEECut.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,21 +24,19 @@

#include <Math/Vector4D.h> // IWYU pragma: keep (do not replace with Math/Vector4Dfwd.h)
#include <Math/Vector4Dfwd.h>
#include <TNamed.h>

#include <Rtypes.h>

#include <algorithm>
#include <cstdint>
#include <functional>
#include <set>
#include <string>
#include <utility>

class DalitzEECut : public TNamed
class DalitzEECut
{
public:
DalitzEECut() = default;
DalitzEECut(const char* name, const char* title) : TNamed(name, title) {}
DalitzEECut(const char* name, const char* title) : name(name), title(title) {}

enum class DalitzEECuts : int {
// pair cut
Expand Down Expand Up @@ -71,6 +69,9 @@ class DalitzEECut : public TNamed
kTPConly = 1,
};

const std::string getName() const { return name; }
const std::string getTitle() const { return title; }

template <is_track_with_extra TTrack1, is_track_with_extra TTrack2>
bool IsSelected(TTrack1 const& t1, TTrack2 const& t2, float bz) const
{
Expand Down Expand Up @@ -311,6 +312,8 @@ class DalitzEECut : public TNamed
bool IsPhotonConversionSelected() const { return mSelectPC; }

private:
std::string name;
std::string title;
static const std::pair<int8_t, std::set<uint8_t>> its_ib_any_Requirement;
static const std::pair<int8_t, std::set<uint8_t>> its_ib_1st_Requirement;
// pair cuts
Expand Down Expand Up @@ -353,8 +356,6 @@ class DalitzEECut : public TNamed
float mMinTPCNsigmaEl{-1e+10}, mMaxTPCNsigmaEl{+1e+10};
float mMinTPCNsigmaPi{0}, mMaxTPCNsigmaPi{0};
float mMinTOFNsigmaEl{-1e+10}, mMaxTOFNsigmaEl{+1e+10};

ClassDef(DalitzEECut, 2);
};

#endif // PWGEM_PHOTONMESON_CORE_DALITZEECUT_H_
14 changes: 7 additions & 7 deletions PWGEM/PhotonMeson/Core/EMCPhotonCut.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,9 @@
#include <Framework/HistogramSpec.h>

#include <TH2.h>
#include <TNamed.h>

#include <sys/types.h>

#include <Rtypes.h>

#include <cmath>
#include <concepts>
#include <cstddef>
Expand Down Expand Up @@ -102,11 +99,11 @@ struct TrackMatchingParams {
float c{-2.5f};
};

class EMCPhotonCut : public TNamed
class EMCPhotonCut
{
public:
EMCPhotonCut() = default;
EMCPhotonCut(const char* name, const char* title) : TNamed(name, title) {}
EMCPhotonCut(const char* name, const char* title) : name(name), title(title) {}

enum class EMCPhotonCuts : std::uint8_t {
// cluster cut
Expand All @@ -127,6 +124,9 @@ class EMCPhotonCut : public TNamed
kSecondary,
};

const std::string getName() const { return name; }
const std::string getTitle() const { return title; }

static const char* mCutNames[static_cast<int>(EMCPhotonCuts::kNCuts)];

static constexpr auto getClusterId(IsTrackIterator auto const& t)
Expand Down Expand Up @@ -651,6 +651,8 @@ class EMCPhotonCut : public TNamed
void print() const;

private:
std::string name;
std::string title;
// EMCal cluster cuts
int mDefinition{10}; ///< clusterizer definition
float mMinE{0.7f}; ///< minimum energy
Expand All @@ -673,8 +675,6 @@ class EMCPhotonCut : public TNamed
TrackMatchingParams mTrackMatchingPhiParams = {-1.f, 0.f, 0.f};
TrackMatchingParams mSecTrackMatchingEtaParams = {-1.f, 0.f, 0.f};
TrackMatchingParams mSecTrackMatchingPhiParams = {-1.f, 0.f, 0.f};

ClassDef(EMCPhotonCut, 3);
};

#endif // PWGEM_PHOTONMESON_CORE_EMCPHOTONCUT_H_
15 changes: 8 additions & 7 deletions PWGEM/PhotonMeson/Core/EMPhotonEventCut.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,13 @@
#include "Common/CCDB/EventSelectionParams.h"
#include "Common/CCDB/TriggerAliases.h"

#include <TNamed.h>
#include <string>

#include <Rtypes.h>

class EMPhotonEventCut : public TNamed
class EMPhotonEventCut
{
public:
EMPhotonEventCut() = default;
EMPhotonEventCut(const char* name, const char* title) : TNamed(name, title) {}
EMPhotonEventCut(const char* name, const char* title) : name(name), title(title) {}

enum class EMPhotonEventCuts : int {
kSel8 = 0,
Expand All @@ -52,6 +50,9 @@ class EMPhotonEventCut : public TNamed
kNCuts
};

const std::string getName() const { return name; }
const std::string getTitle() const { return title; }

template <typename T>
bool IsSelected(T const& collision) const
{
Expand Down Expand Up @@ -203,6 +204,8 @@ class EMPhotonEventCut : public TNamed
void SetRequireEMCHardwareTriggered(bool flag);

private:
std::string name;
std::string title;
bool mRequireSel8{false};
bool mRequireFT0AND{true};
float mMinZvtx{-10.f}, mMaxZvtx{+10.f};
Expand All @@ -222,8 +225,6 @@ class EMPhotonEventCut : public TNamed
bool mRequireGoodITSLayersAll{false};
bool mRequireEMCReadoutInMB{false};
bool mRequireEMCHardwareTriggered{false};

ClassDef(EMPhotonEventCut, 1);
};

#endif // PWGEM_PHOTONMESON_CORE_EMPHOTONEVENTCUT_H_
15 changes: 8 additions & 7 deletions PWGEM/PhotonMeson/Core/PHOSPhotonCut.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,13 @@

#include "PWGEM/PhotonMeson/Utils/TrackSelection.h"

#include <TNamed.h>
#include <string>

#include <Rtypes.h>

class PHOSPhotonCut : public TNamed
class PHOSPhotonCut
{
public:
PHOSPhotonCut() = default;
PHOSPhotonCut(const char* name, const char* title) : TNamed(name, title) {}
PHOSPhotonCut(const char* name, const char* title) : name(name), title(title) {}

enum class PHOSPhotonCuts : int {
kEnergy = 0,
Expand All @@ -35,6 +33,9 @@
kNCuts
};

const std::string getName() const { return name; }
const std::string getTitle() const { return title; }

static const char* mCutNames[static_cast<int>(PHOSPhotonCuts::kNCuts)];

// Temporary function to check if track passes selection criteria. To be replaced by framework filters.
Expand All @@ -53,17 +54,17 @@
}

// only temporary solution to avoid noisy channels.
if (-1.20 + 10.2 * sqrt(cluster.e()) < cluster.nCells()) {

Check failure on line 57 in PWGEM/PhotonMeson/Core/PHOSPhotonCut.h

View workflow job for this annotation

GitHub Actions / O2 linter

[std-prefix]

Use std:: prefix for names from the std namespace.
return false;
}
if (cluster.nCells() < -3.04 + 3.14 * sqrt(cluster.e())) {

Check failure on line 60 in PWGEM/PhotonMeson/Core/PHOSPhotonCut.h

View workflow job for this annotation

GitHub Actions / O2 linter

[magic-number]

Avoid magic numbers in expressions. Assign the value to a clearly named variable or constant.

Check failure on line 60 in PWGEM/PhotonMeson/Core/PHOSPhotonCut.h

View workflow job for this annotation

GitHub Actions / O2 linter

[std-prefix]

Use std:: prefix for names from the std namespace.
return false;
}

if (cluster.m20() < 0.1 || 2.0 < cluster.m20()) {

Check failure on line 64 in PWGEM/PhotonMeson/Core/PHOSPhotonCut.h

View workflow job for this annotation

GitHub Actions / O2 linter

[magic-number]

Avoid magic numbers in expressions. Assign the value to a clearly named variable or constant.
return false;
}
if (cluster.m02() > 4.0) {

Check failure on line 67 in PWGEM/PhotonMeson/Core/PHOSPhotonCut.h

View workflow job for this annotation

GitHub Actions / O2 linter

[magic-number]

Avoid magic numbers in expressions. Assign the value to a clearly named variable or constant.
return false;
}

Expand Down Expand Up @@ -96,9 +97,9 @@
void print() const;

private:
std::string name;
std::string title;
float mMinEnergy{0.1f}, mMaxEnergy{1e+10f};

ClassDef(PHOSPhotonCut, 2);
};

#endif // PWGEM_PHOTONMESON_CORE_PHOSPHOTONCUT_H_
27 changes: 0 additions & 27 deletions PWGEM/PhotonMeson/Core/PWGEMPhotonMesonCoreLinkDef.h

This file was deleted.

15 changes: 8 additions & 7 deletions PWGEM/PhotonMeson/Core/PairCut.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,22 +16,23 @@
#ifndef PWGEM_PHOTONMESON_CORE_PAIRCUT_H_
#define PWGEM_PHOTONMESON_CORE_PAIRCUT_H_

#include <TNamed.h>
#include <string>

#include <Rtypes.h>

class PairCut : public TNamed
class PairCut
{
public:
PairCut() = default;
PairCut(const char* name, const char* title) : TNamed(name, title) {}
PairCut(const char* name, const char* title) : name(name), title(title) {}

enum class PairCuts : int {
// v0 cut
kAsym = 0,
kNCuts
};

const std::string getName() const { return name; }
const std::string getTitle() const { return title; }

static const char* mCutNames[static_cast<int>(PairCuts::kNCuts)];

template <typename G1, typename G2>
Expand All @@ -50,7 +51,7 @@
{
switch (cut) {
case PairCuts::kAsym: {
float asym = abs(g1.e() - g2.e()) / (g1.e() + g2.e());

Check failure on line 54 in PWGEM/PhotonMeson/Core/PairCut.h

View workflow job for this annotation

GitHub Actions / O2 linter

[std-prefix]

Use std:: prefix for names from the std namespace.
// float asym = abs(g1.p() - g2.p()) / (g1.p() + g2.p());
return mMinAsym < asym && asym < mMaxAsym;
}
Expand All @@ -66,9 +67,9 @@
void print() const;

private:
std::string name;
std::string title;
float mMinAsym{-1e+10}, mMaxAsym{1e+10};

ClassDef(PairCut, 1);
};

#endif // PWGEM_PHOTONMESON_CORE_PAIRCUT_H_
12 changes: 6 additions & 6 deletions PWGEM/PhotonMeson/Core/V0PhotonCut.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,9 @@
#include <Framework/Logger.h>

#include <TH2.h>
#include <TNamed.h>

#include <sys/types.h>

#include <Rtypes.h>

#include <algorithm>
#include <cmath>
#include <concepts>
Expand Down Expand Up @@ -172,7 +169,7 @@
{
public:
V0PhotonCut() = default;
V0PhotonCut(const char* name, const char* title) : TNamed(name, title) {}
V0PhotonCut(const char* name, const char* title) : name(name), title(title) {}
~V0PhotonCut() override { delete mEmMlResponse; };

enum class V0PhotonCuts : int {
Expand Down Expand Up @@ -220,6 +217,9 @@
kRadAndAngle = 2
};

const std::string getName() const { return name; }
const std::string getTitle() const { return title; }

/// \brief add histograms to registry
/// \param fRegistry pointer to histogram registry
void addQAHistograms(o2::framework::HistogramRegistry* fRegistry = nullptr) const
Expand Down Expand Up @@ -894,12 +894,12 @@
float z = v0.vz(); // cm, measured secondary vertex of gamma->ee

float rxy = std::sqrt(x * x + y * y);
if (rxy < 7.0 || 14.0 < rxy) {

Check failure on line 897 in PWGEM/PhotonMeson/Core/V0PhotonCut.h

View workflow job for this annotation

GitHub Actions / O2 linter

[magic-number]

Avoid magic numbers in expressions. Assign the value to a clearly named variable or constant.
return false;
}

// r = 0.192 * z + 8.88 (cm) expected wire position in RZ plane.TMath::Tan(10.86 * o2::constants::math::Deg2Rad) = 0.192
if (rxy > 0.192 * z + 14.0) { // upper limit

Check failure on line 902 in PWGEM/PhotonMeson/Core/V0PhotonCut.h

View workflow job for this annotation

GitHub Actions / O2 linter

[magic-number]

Avoid magic numbers in expressions. Assign the value to a clearly named variable or constant.
return false;
}

Expand Down Expand Up @@ -1159,6 +1159,8 @@
void setDoQA(bool flag = false);

private:
std::string name;
std::string title;
static const std::pair<int8_t, std::set<uint8_t>> its_ib_Requirement;
static const std::pair<int8_t, std::set<uint8_t>> its_ob_Requirement;
static const std::pair<int8_t, std::set<uint8_t>> its_ob_Requirement_ITSTPC;
Expand Down Expand Up @@ -1242,8 +1244,6 @@
bool mDoQA{false}; ///< flag to decide if QA should be done or not
mutable uint nAccV0PerColl{0}; ///< running number of accepted v0 photons per collision used for QA
mutable int currentCollID{-1}; ///< running collision ID of v0 photon used for QA

ClassDef(V0PhotonCut, 5);
};

#endif // PWGEM_PHOTONMESON_CORE_V0PHOTONCUT_H_
14 changes: 7 additions & 7 deletions PWGEM/PhotonMeson/Tasks/MaterialBudgetMC.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -120,8 +120,8 @@
{
for (const auto& tagcut : tagcuts) {
for (const auto& probecut : probecuts) {
std::string cutname1 = tagcut.GetName();
std::string cutname2 = probecut.GetName();
std::string cutname1 = tagcut.getName();
std::string cutname2 = probecut.getName();

// if (cutname1 == cutname2) {
// continue;
Expand All @@ -133,7 +133,7 @@
THashList* list_pair_subsys_photoncut = reinterpret_cast<THashList*>(list_pair_subsys->FindObject(photon_cut_name.data()));

for (const auto& cut3 : cuts3) {
std::string pair_cut_name = cut3.GetName();
std::string pair_cut_name = cut3.getName();
o2::aod::pwgem::photon::histogram::AddHistClass(list_pair_subsys_photoncut, pair_cut_name.data());
THashList* list_pair_subsys_paircut = reinterpret_cast<THashList*>(list_pair_subsys_photoncut->FindObject(pair_cut_name.data()));
o2::aod::pwgem::photon::histogram::DefineHistograms(list_pair_subsys_paircut, "material_budget_study", "Pair");
Expand All @@ -160,8 +160,8 @@

// for V0s
for (const auto& cut : fProbeCuts) {
const char* cutname = cut.GetName();
THashList* list_v0_cut = o2::aod::pwgem::photon::histogram::AddHistClass(list_v0, cutname);
std::string cutname = cut.getName();
THashList* list_v0_cut = o2::aod::pwgem::photon::histogram::AddHistClass(list_v0, cutname.c_str());
o2::aod::pwgem::photon::histogram::DefineHistograms(list_v0_cut, "material_budget_study", "V0");
}

Expand Down Expand Up @@ -288,7 +288,7 @@
value[1] = photon.v0radius();
value[2] = RecoDecay::constrainAngle(phi_cp);
value[3] = eta_cp;
reinterpret_cast<THnSparseF*>(list_v0->FindObject(cut.GetName())->FindObject("hs_conv_point"))->Fill(value);
reinterpret_cast<THnSparseF*>(list_v0->FindObject(cut.getName().c_str())->FindObject("hs_conv_point"))->Fill(value);

} // end of photon loop
} // end of cut loop
Expand Down Expand Up @@ -381,7 +381,7 @@
value[3] = g2.v0radius();
value[4] = RecoDecay::constrainAngle(phi_cp2);
value[5] = eta_cp2;
reinterpret_cast<THnSparseF*>(list_pair_ss->FindObject(Form("%s_%s", tagcut.GetName(), probecut.GetName()))->FindObject(paircut.GetName())->FindObject("hs_conv_point_same"))->Fill(value);
reinterpret_cast<THnSparseF*>(list_pair_ss->FindObject(Form("%s_%s", tagcut.getName().c_str(), probecut.getName().c_str()))->FindObject(paircut.getName().c_str())->FindObject("hs_conv_point_same"))->Fill(value);
} // end of pair cut loop
} // end of g2 loop
} // end of g1 loop
Expand All @@ -391,7 +391,7 @@
}

Partition<MyCollisions> grouped_collisions = cfgCentMin < o2::aod::cent::centFT0M && o2::aod::cent::centFT0M < cfgCentMax; // this goes to same event.
Filter collisionFilter_common = nabs(o2::aod::collision::posZ) < 10.f && o2::aod::collision::numContrib > static_cast<uint16_t>(0) && o2::aod::evsel::sel8 == true;

Check failure on line 394 in PWGEM/PhotonMeson/Tasks/MaterialBudgetMC.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[magic-number]

Avoid magic numbers in expressions. Assign the value to a clearly named variable or constant.
Filter collisionFilter_centrality = (cfgCentMin < o2::aod::cent::centFT0M && o2::aod::cent::centFT0M < cfgCentMax) || (cfgCentMin < o2::aod::cent::centFT0A && o2::aod::cent::centFT0A < cfgCentMax) || (cfgCentMin < o2::aod::cent::centFT0C && o2::aod::cent::centFT0C < cfgCentMax);
using MyFilteredCollisions = soa::Filtered<MyCollisions>; // this goes to same event pairing.

Expand Down Expand Up @@ -422,7 +422,7 @@
}
reinterpret_cast<TH1F*>(fMainList->FindObject("Generated")->FindObject("hCollisionCounter"))->Fill(2.0);

if (collision.numContrib() < 0.5) {

Check failure on line 425 in PWGEM/PhotonMeson/Tasks/MaterialBudgetMC.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[magic-number]

Avoid magic numbers in expressions. Assign the value to a clearly named variable or constant.
continue;
}
reinterpret_cast<TH1F*>(fMainList->FindObject("Generated")->FindObject("hCollisionCounter"))->Fill(3.0);
Expand Down
4 changes: 2 additions & 2 deletions PWGEM/PhotonMeson/Tasks/SinglePhoton.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ struct SinglePhoton {
void add_histograms(THashList* list_photon, const std::string detname, TCuts1 const& cuts1)
{
for (auto& cut1 : cuts1) {
std::string cutname1 = cut1.GetName();
std::string cutname1 = cut1.getName();

THashList* list_photon_subsys = reinterpret_cast<THashList*>(list_photon->FindObject(detname.data()));
o2::aod::pwgem::photon::histogram::AddHistClass(list_photon_subsys, cutname1.data());
Expand Down Expand Up @@ -306,7 +306,7 @@ struct SinglePhoton {

auto photons1_coll = photons1.sliceBy(perCollision1, collision.globalIndex());
for (auto& cut : cuts1) {
THashList* list_photon_det_cut = static_cast<THashList*>(list_photon_det->FindObject(cut.GetName()));
THashList* list_photon_det_cut = static_cast<THashList*>(list_photon_det->FindObject(cut.getName().c_str()));
for (auto& photon : photons1_coll) {
if (!IsSelected<photontype>(photon, cut)) {
continue;
Expand Down
Loading
Loading