Skip to content
Merged
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
21 changes: 8 additions & 13 deletions PWGEM/PhotonMeson/Core/Pi0EtaToGammaGamma.h
Original file line numberDiff line numberDiff line change
Expand Up@@ -435,7 +435,7 @@ struct Pi0EtaToGammaGamma {

/// \brief Calculate background (using rotation background method only for EMCal!)
template <typename TPhotons>
void RotationBackground(const ROOT::Math::PtEtaPhiMVector& meson, ROOT::Math::PtEtaPhiMVector photon1, ROOT::Math::PtEtaPhiMVector photon2, TPhotons const& photons_coll, unsigned int ig1, unsigned int ig2, EMCPhotonCut const& cut, aod::SkimEMCMTs const&)
void RotationBackground(const ROOT::Math::PtEtaPhiMVector& meson, ROOT::Math::PtEtaPhiMVector photon1, ROOT::Math::PtEtaPhiMVector photon2, TPhotons const& photons_coll, unsigned int ig1, unsigned int ig2)
{
// if less than 3 clusters are present skip event since we need at least 3 clusters
if (photons_coll.size() < 3) {
Expand All@@ -452,9 +452,6 @@ struct Pi0EtaToGammaGamma {
// only combine rotated photons with other photons
continue;
}
if (!cut.template IsSelected<aod::SkimEMCMTs>(photon)) {
continue;
}

ROOT::Math::PtEtaPhiMVector photon3(photon.pt(), photon.eta(), photon.phi(), 0.);
ROOT::Math::PtEtaPhiMVector mother1 = photon1 + photon3;
Expand DownExpand Up@@ -501,13 +498,12 @@ struct Pi0EtaToGammaGamma {
std::vector<std::pair<int, int>> used_photonIds; // <ndf, trackId>
std::vector<std::tuple<int, int, int, int>> used_dileptonIds; // <ndf, trackId>

template <typename TCollisions, typename TPhotons1, typename TPhotons2, typename TSubInfos1, typename TSubInfos2, typename TPreslice1, typename TPreslice2, typename TCut1, typename TCut2, typename TTracksMatchedWithEMC, typename TTracksMatchedWithPHOS>
template <typename TCollisions, typename TPhotons1, typename TPhotons2, typename TSubInfos1, typename TSubInfos2, typename TPreslice1, typename TPreslice2, typename TCut1, typename TCut2>
void runPairing(TCollisions const& collisions,
TPhotons1 const& photons1, TPhotons2 const& photons2,
TSubInfos1 const& /*subinfos1*/, TSubInfos2 const& /*subinfos2*/,
TPreslice1 const& perCollision1, TPreslice2 const& perCollision2,
TCut1 const& cut1, TCut2 const& cut2,
TTracksMatchedWithEMC const& tracks_emc, TTracksMatchedWithPHOS const& /*tracks_phos*/)
TCut1 const& cut1, TCut2 const& cut2)
{
for (auto& collision : collisions) {
initCCDB(collision);
Expand DownExpand Up@@ -583,7 +579,7 @@ struct Pi0EtaToGammaGamma {
fRegistry.fill(HIST("Pair/same/hs"), v12.M(), v12.Pt());

if constexpr (pairtype == PairType::kEMCEMC) {
RotationBackground<MyEMCClusters>(v12, v1, v2, photons2_per_collision, g1.globalIndex(), g2.globalIndex(), cut1, tracks_emc);
RotationBackground<MyEMCClusters>(v12, v1, v2, photons2_per_collision, g1.globalIndex(), g2.globalIndex());
}

std::pair<int, int> pair_tmp_id1 = std::make_pair(ndf, g1.globalIndex());
Expand DownExpand Up@@ -795,20 +791,19 @@ struct Pi0EtaToGammaGamma {
if constexpr (pairtype == PairType::kPCMPCM) {
auto v0photons = std::get<0>(std::tie(args...));
auto v0legs = std::get<1>(std::tie(args...));
runPairing(collisions, v0photons, v0photons, v0legs, v0legs, perCollision_pcm, perCollision_pcm, fV0PhotonCut, fV0PhotonCut, nullptr, nullptr);
runPairing(collisions, v0photons, v0photons, v0legs, v0legs, perCollision_pcm, perCollision_pcm, fV0PhotonCut, fV0PhotonCut);
} else if constexpr (pairtype == PairType::kPCMDalitzEE) {
auto v0photons = std::get<0>(std::tie(args...));
auto v0legs = std::get<1>(std::tie(args...));
auto emprimaryelectrons = std::get<2>(std::tie(args...));
// LOGF(info, "electrons.size() = %d, positrons.size() = %d", electrons.size(), positrons.size());
runPairing(collisions, v0photons, emprimaryelectrons, v0legs, emprimaryelectrons, perCollision_pcm, perCollision_electron, fV0PhotonCut, fDileptonCut, nullptr, nullptr);
runPairing(collisions, v0photons, emprimaryelectrons, v0legs, emprimaryelectrons, perCollision_pcm, perCollision_electron, fV0PhotonCut, fDileptonCut);
} else if constexpr (pairtype == PairType::kEMCEMC) {
auto emcclusters = std::get<0>(std::tie(args...));
auto emcmatchedtracks = std::get<1>(std::tie(args...));
runPairing(collisions, emcclusters, emcclusters, nullptr, nullptr, perCollision_emc, perCollision_emc, fEMCCut, fEMCCut, emcmatchedtracks, nullptr);
runPairing(collisions, emcclusters, emcclusters, nullptr, nullptr, perCollision_emc, perCollision_emc, fEMCCut, fEMCCut);
} else if constexpr (pairtype == PairType::kPHOSPHOS) {
auto phosclusters = std::get<0>(std::tie(args...));
runPairing(collisions, phosclusters, phosclusters, nullptr, nullptr, perCollision_phos, perCollision_phos, fPHOSCut, fPHOSCut, nullptr, nullptr);
runPairing(collisions, phosclusters, phosclusters, nullptr, nullptr, perCollision_phos, perCollision_phos, fPHOSCut, fPHOSCut);
}
// else if constexpr (pairtype == PairType::kPCMEMC) {
// auto v0photons = std::get<0>(std::tie(args...));
Expand Down
10 changes: 4 additions & 6 deletions PWGEM/PhotonMeson/Core/Pi0EtaToGammaGammaMC.h
Original file line numberDiff line numberDiff line change
Expand Up@@ -413,13 +413,12 @@ struct Pi0EtaToGammaGammaMC {
// Partition<MyMCMuons> muons_pos = o2::aod::emprimarymuon::sign > int8_t(0) && static_cast<float>(dileptoncuts.cfg_min_pt_track) < o2::aod::track::pt&& nabs(o2::aod::track::eta) < static_cast<float>(dileptoncuts.cfg_max_eta_track) && static_cast<float>(dileptoncuts.cfg_min_TPCNsigmaMu) < o2::aod::pidtpc::tpcNSigmaMu&& o2::aod::pidtpc::tpcNSigmaMu < static_cast<float>(dileptoncuts.cfg_max_TPCNsigmaMu);
// Partition<MyMCMuons> muons_neg = o2::aod::emprimarymuon::sign < int8_t(0) && static_cast<float>(dileptoncuts.cfg_min_pt_track) < o2::aod::track::pt && nabs(o2::aod::track::eta) < static_cast<float>(dileptoncuts.cfg_max_eta_track) && static_cast<float>(dileptoncuts.cfg_min_TPCNsigmaMu) < o2::aod::pidtpc::tpcNSigmaMu && o2::aod::pidtpc::tpcNSigmaMu < static_cast<float>(dileptoncuts.cfg_max_TPCNsigmaMu);

template <typename TCollisions, typename TPhotons1, typename TPhotons2, typename TSubInfos1, typename TSubInfos2, typename TPreslice1, typename TPreslice2, typename TCut1, typename TCut2, typename TTracksMatchedWithEMC, typename TTracksMatchedWithPHOS, typename TMCCollisions, typename TMCParticles>
template <typename TCollisions, typename TPhotons1, typename TPhotons2, typename TSubInfos1, typename TSubInfos2, typename TPreslice1, typename TPreslice2, typename TCut1, typename TCut2, typename TMCCollisions, typename TMCParticles>
void runTruePairing(TCollisions const& collisions,
TPhotons1 const& photons1, TPhotons2 const& photons2,
TSubInfos1 const& /*subinfos1*/, TSubInfos2 const& /*subinfos2*/,
TPreslice1 const& perCollision1, TPreslice2 const& perCollision2,
TCut1 const& cut1, TCut2 const& cut2,
TTracksMatchedWithEMC const& /*tracks_emc*/, TTracksMatchedWithPHOS const& /*tracks_phos*/,
TMCCollisions const& mccollisions, TMCParticles const& mcparticles)
{
for (auto& collision : collisions) {
Expand DownExpand Up@@ -665,19 +664,18 @@ struct Pi0EtaToGammaGammaMC {
if constexpr (pairtype == PairType::kPCMPCM) {
auto v0photons = std::get<0>(std::tie(args...));
auto v0legs = std::get<1>(std::tie(args...));
runTruePairing(collisions, v0photons, v0photons, v0legs, v0legs, perCollision_pcm, perCollision_pcm, fV0PhotonCut, fV0PhotonCut, nullptr, nullptr, mccollisions, mcparticles);
runTruePairing(collisions, v0photons, v0photons, v0legs, v0legs, perCollision_pcm, perCollision_pcm, fV0PhotonCut, fV0PhotonCut, mccollisions, mcparticles);
runGenInfo(collisions, mccollisions, mcparticles);
} else if constexpr (pairtype == PairType::kPCMDalitzEE) {
auto v0photons = std::get<0>(std::tie(args...));
auto v0legs = std::get<1>(std::tie(args...));
auto emprimaryelectrons = std::get<2>(std::tie(args...));
// LOGF(info, "electrons.size() = %d, positrons.size() = %d", electrons.size(), positrons.size());
runTruePairing(collisions, v0photons, emprimaryelectrons, v0legs, emprimaryelectrons, perCollision_pcm, perCollision_electron, fV0PhotonCut, fDileptonCut, nullptr, nullptr, mccollisions, mcparticles);
runTruePairing(collisions, v0photons, emprimaryelectrons, v0legs, emprimaryelectrons, perCollision_pcm, perCollision_electron, fV0PhotonCut, fDileptonCut, mccollisions, mcparticles);
runGenInfo(collisions, mccollisions, mcparticles);
} else if constexpr (pairtype == PairType::kEMCEMC) {
auto emcclusters = std::get<0>(std::tie(args...));
auto emcmatchedtracks = std::get<1>(std::tie(args...));
runTruePairing(collisions, emcclusters, emcclusters, nullptr, nullptr, perCollision_emc, perCollision_emc, fEMCCut, fEMCCut, emcmatchedtracks, nullptr, mccollisions, mcparticles);
runTruePairing(collisions, emcclusters, emcclusters, nullptr, nullptr, perCollision_emc, perCollision_emc, fEMCCut, fEMCCut, mccollisions, mcparticles);
runGenInfo(collisions, mccollisions, mcparticles);
}

Expand Down
13 changes: 5 additions & 8 deletions PWGEM/PhotonMeson/DataModel/gammaTables.h
Original file line numberDiff line numberDiff line change
Expand Up@@ -411,8 +411,8 @@ DECLARE_SOA_TABLE(McGammasTrue, "AOD", "MCGATRUE",

namespace skimmedcluster
{
DECLARE_SOA_INDEX_COLUMN(Collision, collision); //! collisionID used as index for matched clusters
DECLARE_SOA_INDEX_COLUMN(BC, bc); //! bunch crossing ID used as index for ambiguous clusters
DECLARE_SOA_INDEX_COLUMN(EMEvent, emevent); //!
DECLARE_SOA_COLUMN(CollisionId, collisionId, int); //!
DECLARE_SOA_COLUMN(ID, id, int); //! cluster ID identifying cluster in event
DECLARE_SOA_COLUMN(E, e, float); //! cluster energy (GeV)
DECLARE_SOA_COLUMN(Eta, eta, float); //! cluster pseudorapidity (calculated using vertex)
Expand DownExpand Up@@ -440,12 +440,9 @@ DECLARE_SOA_COLUMN(TrackPt, trackpt, std::vector<float>);
DECLARE_SOA_DYNAMIC_COLUMN(Pt, pt, [](float e, float eta, float m = 0) -> float { return sqrt(e * e - m * m) / cosh(eta); }); //! cluster pt, mass to be given as argument when getter is called!
} // namespace emccluster
DECLARE_SOA_TABLE(SkimEMCClusters, "AOD", "SKIMEMCCLUSTERS", //! table of skimmed EMCal clusters
o2::soa::Index<>, skimmedcluster::CollisionId, skimmedcluster::BCId, skimmedcluster::E, emccluster::CoreEnergy,
skimmedcluster::Eta, skimmedcluster::Phi, skimmedcluster::M02, skimmedcluster::M20, skimmedcluster::NCells, skimmedcluster::Time,
emccluster::IsExotic, skimmedcluster::DistanceToBadChannel, skimmedcluster::NLM, emccluster::Definition,
emccluster::TrackIds, emccluster::TrackEta, emccluster::TrackPhi, emccluster::TrackP, emccluster::TrackPt,
// dynamic column
emccluster::Pt<skimmedcluster::E, skimmedcluster::Eta>);
o2::soa::Index<>, skimmedcluster::CollisionId, skimmedcluster::E, skimmedcluster::Eta, skimmedcluster::Phi,
skimmedcluster::M02, skimmedcluster::NCells, skimmedcluster::Time, emccluster::IsExotic, emccluster::TrackEta,
emccluster::TrackPhi, emccluster::TrackP, emccluster::TrackPt, emccluster::Pt<skimmedcluster::E, skimmedcluster::Eta>);
using SkimEMCCluster = SkimEMCClusters::iterator;

DECLARE_SOA_TABLE(EMCEMEventIds, "AOD", "EMCEMEVENTID", emccluster::EMEventId); // To be joined with SkimEMCClusters table at analysis level.
Expand Down
43 changes: 23 additions & 20 deletions PWGEM/PhotonMeson/TableProducer/skimmerGammaCalo.cxx
Original file line numberDiff line numberDiff line change
Expand Up@@ -44,28 +44,26 @@ struct skimmerGammaCalo {
Configurable<float> maxTime{"maxTime", +200., "Maximum cluster time for time cut"};
Configurable<float> minM02{"minM02", 0.0, "Minimum M02 for M02 cut"};
Configurable<float> maxM02{"maxM02", 1.0, "Maximum M02 for M02 cut"};
Configurable<float> minE{"minE", 0.5, "Minimum energy for energy cut"};
Configurable<bool> hasPropagatedTracks{"hasPropagatedTracks", false, "temporary flag, only set to true when running over data which has the tracks propagated to EMCal/PHOS!"};

HistogramRegistry historeg{
"historeg",
{},
OutputObjHandlingPolicy::QAObject,
false,
true};
HistogramRegistry historeg{"output", {}, OutputObjHandlingPolicy::AnalysisObject, false, false};

void init(o2::framework::InitContext&)
{
historeg.add("hCaloClusterEIn", "hCaloClusterEIn", gHistoSpec_clusterE);
historeg.add("hCaloClusterEOut", "hCaloClusterEOut", gHistoSpec_clusterE);
historeg.add("hMTEtaPhi", "hMTEtaPhi", gHistoSpec_EtaPhi);
auto hCaloClusterFilter = historeg.add<TH1>("hCaloClusterFilter", "hCaloClusterFilter", kTH1I, {{4, 0, 4}});
historeg.add("hMTEtaPhi", "hMTEtaPhi", gHistoSpec_clusterTM_dEtadPhi);
auto hCaloClusterFilter = historeg.add<TH1>("hCaloClusterFilter", "hCaloClusterFilter", kTH1I, {{5, 0, 5}});
hCaloClusterFilter->GetXaxis()->SetBinLabel(1, "in");
hCaloClusterFilter->GetXaxis()->SetBinLabel(2, "time cut");
hCaloClusterFilter->GetXaxis()->SetBinLabel(3, "M02 cut");
hCaloClusterFilter->GetXaxis()->SetBinLabel(4, "out");
hCaloClusterFilter->GetXaxis()->SetBinLabel(2, "E cut");
hCaloClusterFilter->GetXaxis()->SetBinLabel(3, "time cut");
hCaloClusterFilter->GetXaxis()->SetBinLabel(4, "M02 cut");
hCaloClusterFilter->GetXaxis()->SetBinLabel(5, "out");

LOG(info) << "| Timing cut: " << minTime << " < t < " << maxTime << std::endl;
LOG(info) << "| M02 cut: " << minM02 << " < M02 < " << maxM02 << std::endl;
LOG(info) << "| E cut: E > " << minE << std::endl;
}

void processRec(aod::Collision const&, aod::EMCALClusters const& emcclusters, aod::EMCALClusterCells const& emcclustercells, aod::EMCALMatchedTracks const& emcmatchedtracks, aod::FullTracks const&)
Expand All@@ -74,14 +72,19 @@ struct skimmerGammaCalo {
historeg.fill(HIST("hCaloClusterEIn"), emccluster.energy());
historeg.fill(HIST("hCaloClusterFilter"), 0);

// Energy cut
if (emccluster.energy() < minE) {
historeg.fill(HIST("hCaloClusterFilter"), 1);
continue;
}
// timing cut
if (emccluster.time() > maxTime || emccluster.time() < minTime) {
historeg.fill(HIST("hCaloClusterFilter"), 1);
historeg.fill(HIST("hCaloClusterFilter"), 2);
continue;
}
// M02 cut
if (emccluster.nCells() > 1 && (emccluster.m02() > maxM02 || emccluster.m02() < minM02)) {
historeg.fill(HIST("hCaloClusterFilter"), 2);
historeg.fill(HIST("hCaloClusterFilter"), 3);
continue;
}

Expand DownExpand Up@@ -126,12 +129,10 @@ struct skimmerGammaCalo {
}

historeg.fill(HIST("hCaloClusterEOut"), emccluster.energy());
historeg.fill(HIST("hCaloClusterFilter"), 3);
historeg.fill(HIST("hCaloClusterFilter"), 4);

tableGammaEMCReco(emccluster.collisionId(), emccluster.id(),
emccluster.energy(), emccluster.coreEnergy(), emccluster.eta(), emccluster.phi(), emccluster.m02(),
emccluster.m20(), emccluster.nCells(), emccluster.time(), emccluster.isExotic(), emccluster.distanceToBadChannel(), emccluster.nlm(),
emccluster.definition(), vTrackIds, vEta, vPhi, vP, vPt);
tableGammaEMCReco(emccluster.collisionId(), emccluster.energy(), emccluster.eta(), emccluster.phi(), emccluster.m02(),
emccluster.nCells(), emccluster.time(), emccluster.isExotic(), vEta, vPhi, vP, vPt);
}
}
void processMC(aod::Collision const&, soa::Join<aod::EMCALClusters, aod::EMCALMCClusters> const& emcclusters, aod::McParticles const&)
Expand All@@ -140,14 +141,16 @@ struct skimmerGammaCalo {
historeg.fill(HIST("hCaloClusterEIn"), emccluster.energy());
historeg.fill(HIST("hCaloClusterFilter"), 0);

// Energy cut
if (emccluster.energy() < minE) {
continue;
}
// timing cut
if (emccluster.time() > maxTime || emccluster.time() < minTime) {
historeg.fill(HIST("hCaloClusterFilter"), 1);
continue;
}
// M02 cut
if (emccluster.nCells() > 1 && (emccluster.m02() > maxM02 || emccluster.m02() < minM02)) {
historeg.fill(HIST("hCaloClusterFilter"), 2);
continue;
}
std::vector<int32_t> mcLabels;
Expand Down
2 changes: 1 addition & 1 deletion PWGEM/PhotonMeson/Tasks/Pi0EtaToGammaGammaEMCEMC.cxx
Original file line numberDiff line numberDiff line change
Expand Up@@ -32,6 +32,6 @@ using MyEMCCluster = MyEMCClusters::iterator;
WorkflowSpec defineDataProcessing(ConfigContext const& cfgc)
{
return WorkflowSpec{
adaptAnalysisTask<Pi0EtaToGammaGamma<PairType::kEMCEMC, MyEMCClusters, aod::SkimEMCMTs>>(cfgc, TaskName{"pi0eta-to-gammagamma-emcemc"}),
adaptAnalysisTask<Pi0EtaToGammaGamma<PairType::kEMCEMC, MyEMCClusters>>(cfgc, TaskName{"pi0eta-to-gammagamma-emcemc"}),
};
}
2 changes: 1 addition & 1 deletion PWGEM/PhotonMeson/Tasks/Pi0EtaToGammaGammaMCEMCEMC.cxx
Original file line numberDiff line numberDiff line change
Expand Up@@ -32,6 +32,6 @@ using MyEMCCluster = MyEMCClusters::iterator;
WorkflowSpec defineDataProcessing(ConfigContext const& cfgc)
{
return WorkflowSpec{
adaptAnalysisTask<Pi0EtaToGammaGammaMC<PairType::kEMCEMC, MyEMCClusters, aod::SkimEMCMTs>>(cfgc, TaskName{"pi0eta-to-gammagamma-mc-emcemc"}),
adaptAnalysisTask<Pi0EtaToGammaGammaMC<PairType::kEMCEMC, MyEMCClusters>>(cfgc, TaskName{"pi0eta-to-gammagamma-mc-emcemc"}),
};
}
Loading