Skip to content
Open
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
12 changes: 6 additions & 6 deletions PWGEM/PhotonMeson/TableProducer/bcWiseClusterSkimmer.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ struct bcWiseClusterSkimmer {
}

/// \brief Process EMCAL clusters (either ambigous or unique)
template <typename Clusters>
template <o2::soa::is_table Clusters>
void processClusters(Clusters const& clusters, const int bcID)
{
for (const auto& cluster : clusters) {
Expand All @@ -161,7 +161,7 @@ struct bcWiseClusterSkimmer {
}
}

template <typename Clusters>
template <o2::soa::is_table Clusters>
void processClusterMCInfo(Clusters const& clusters, const int bcID, aod::McParticles const& mcParticles)
{
for (const auto& cluster : clusters) {
Expand Down Expand Up @@ -298,8 +298,8 @@ struct bcWiseClusterSkimmer {
collisionTable(bcTable.lastIndex(), convertForStorage<int16_t>(collision.posZ(), kZVtx));
}

template <typename TMCParticle, typename TMCParticles>
bool isGammaGammaDecay(TMCParticle mcParticle, TMCParticles mcParticles)
template <o2::soa::is_iterator TMCParticle, o2::soa::is_table TMCParticles>
bool isGammaGammaDecay(TMCParticle const& mcParticle, TMCParticles const& mcParticles)
{
auto daughtersIds = mcParticle.daughtersIds();
if (daughtersIds.size() != 2)
Expand All @@ -311,8 +311,8 @@ struct bcWiseClusterSkimmer {
return true;
}

template <typename TMCParticle, typename TMCParticles>
bool isAccepted(TMCParticle mcParticle, TMCParticles mcParticles)
template <o2::soa::is_iterator TMCParticle, o2::soa::is_table TMCParticles>
bool isAccepted(TMCParticle const& mcParticle, TMCParticles const& mcParticles)
{
auto daughtersIds = mcParticle.daughtersIds();
if (daughtersIds.size() != 2)
Expand Down
2 changes: 1 addition & 1 deletion PWGEM/PhotonMeson/Utils/EventHistograms.h
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ inline void addEventHistograms(o2::framework::HistogramRegistry* fRegistry)
fRegistry->addClone("Event/before/", "Event/after/");
}

template <const int ev_id, typename TCollision>
template <const int ev_id, o2::soa::is_iterator TCollision>
void fillEventInfo(o2::framework::HistogramRegistry* fRegistry, TCollision const& collision, float weight = 1.)
{
const float maxZ = 10.f;
Expand Down
2 changes: 1 addition & 1 deletion PWGEM/PhotonMeson/Utils/HNMUtilities.h
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ inline int getSMNumber(float eta, float phi)
}

/// \brief Store photons from EMC clusters and V0s in a vector and possibly add a eta and phi offset for alignment of EMCal clusters
template <typename C, typename V>
template <o2::soa::is_table C, o2::soa::is_table V>
void storeGammasInVector(C clusters, V v0s, std::vector<Photon>& vPhotons, std::array<float, 20> EMCEtaShift, std::array<float, 20> EMCPhiShift)
{
vPhotons.clear();
Expand Down
22 changes: 12 additions & 10 deletions PWGEM/PhotonMeson/Utils/MCUtilities.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
#ifndef PWGEM_PHOTONMESON_UTILS_MCUTILITIES_H_
#define PWGEM_PHOTONMESON_UTILS_MCUTILITIES_H_

#include <Framework/ASoA.h>

#include <TPDGCode.h>

#include <algorithm>
Expand All @@ -26,7 +28,7 @@
//_______________________________________________________________________
namespace o2::aod::pwgem::photonmeson::utils::mcutil
{
template <typename TTrack>
template <o2::soa::is_iterator TTrack>
bool IsPhysicalPrimary(TTrack const& mctrack)
{
// This is to check mctrack is ALICE physical primary.
Expand All @@ -37,7 +39,7 @@ bool IsPhysicalPrimary(TTrack const& mctrack)
}
}
//_______________________________________________________________________
template <typename TCollision, typename T, typename TMCs>
template <o2::soa::is_iterator TCollision, o2::soa::is_iterator T, o2::soa::is_table TMCs>
int IsFromWD(TCollision const&, T const& mctrack, TMCs const& mcTracks)
{
// is this particle from weak decay?
Expand Down Expand Up @@ -69,7 +71,7 @@ int IsFromWD(TCollision const&, T const& mctrack, TMCs const& mcTracks)
return -1;
}
//_______________________________________________________________________
template <typename T, typename TMCs>
template <o2::soa::is_iterator T, o2::soa::is_table TMCs>
int IsXFromY(T const& mctrack, TMCs const& mcTracks, const int pdgX, const int pdgY)
{
// is photon from pi0? returns index of mother photon
Expand All @@ -91,7 +93,7 @@ int IsXFromY(T const& mctrack, TMCs const& mcTracks, const int pdgX, const int p
//_______________________________________________________________________
// Go up the decay chain of a mcparticle looking for a mother with the given pdg codes, if found return this mothers daughter
// E.g. Find the gamma that was created in a pi0 or eta decay
template <typename T, typename TMCs, typename TTargetPDGs>
template <o2::soa::is_iterator T, o2::soa::is_table TMCs, typename TTargetPDGs>
int FindMotherInChain(T const& mcparticle, TMCs const& mcparticles, TTargetPDGs const& motherpdgs, const int Depth = 50) // o2-linter: disable=pdg/explicit-code (false positive)
{
if (!mcparticle.has_mothers() || Depth < 1) {
Expand All @@ -107,7 +109,7 @@ int FindMotherInChain(T const& mcparticle, TMCs const& mcparticles, TTargetPDGs
}
}
//_______________________________________________________________________
template <typename T, typename TMCs>
template <o2::soa::is_iterator T, o2::soa::is_table TMCs>
int IsEleFromPC(T const& mctrack, TMCs const& mcTracks)
{
// is election from photon conversion? returns index of mother photon
Expand All @@ -130,7 +132,7 @@ int IsEleFromPC(T const& mctrack, TMCs const& mcTracks)
return -1;
}
//_______________________________________________________________________
template <typename TMCParticle, typename TMCParticles, typename TTargetPDGs>
template <o2::soa::is_iterator TMCParticle, o2::soa::is_table TMCParticles, typename TTargetPDGs>
bool IsInAcceptanceNonDerived(TMCParticle const& mcparticle, TMCParticles const& mcparticles, TTargetPDGs target_pdgs, const float ymin, const float ymax, const float phimin, const float phimax)
{
// contents in vector of daughter ID is different.
Expand Down Expand Up @@ -181,7 +183,7 @@ bool IsInAcceptanceNonDerived(TMCParticle const& mcparticle, TMCParticles const&
return true;
}
//_______________________________________________________________________
template <typename TMCParticle, typename TMCParticles, typename TTargetPDGs>
template <o2::soa::is_iterator TMCParticle, o2::soa::is_table TMCParticles, typename TTargetPDGs>
bool IsInAcceptance(TMCParticle const& mcparticle, TMCParticles const& mcparticles, TTargetPDGs target_pdgs, const float ymin, const float ymax, const float phimin, const float phimax)
{
if (mcparticle.y() < ymin || ymax < mcparticle.y()) {
Expand Down Expand Up @@ -229,7 +231,7 @@ bool IsInAcceptance(TMCParticle const& mcparticle, TMCParticles const& mcparticl
return true;
}
//_______________________________________________________________________
template <typename TMCPhoton, typename TMCParticles>
template <o2::soa::is_iterator TMCPhoton, o2::soa::is_table TMCParticles>
bool IsConversionPointInAcceptance(TMCPhoton const& mcphoton, const float max_r_gen, const float max_eta_gen, const float margin_z_mc, TMCParticles const& mcparticles)
{
if (std::abs(mcphoton.pdgCode()) != kGamma) {
Expand Down Expand Up @@ -264,8 +266,8 @@ bool IsConversionPointInAcceptance(TMCPhoton const& mcphoton, const float max_r_
return true;
}
//_______________________________________________________________________
template <typename TMCParticle, typename TMCParticles>
bool isGammaGammaDecay(TMCParticle mcParticle, TMCParticles mcParticles)
template <o2::soa::is_iterator TMCParticle, o2::soa::is_table TMCParticles>
bool isGammaGammaDecay(TMCParticle const& mcParticle, TMCParticles const& mcParticles)
{
auto daughtersIds = mcParticle.daughtersIds();
if (daughtersIds.size() != 2) { // o2-linter: disable=magic-number (2 is not that magic in this context)
Expand Down
2 changes: 1 addition & 1 deletion PWGEM/PhotonMeson/Utils/NMHistograms.h
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ inline void addNMHistograms(o2::framework::HistogramRegistry* fRegistry, bool is
}
}

template <typename TDiphoton, typename TMCParitlce, typename TMCParticles, typename TMCCollisions>
template <typename TDiphoton, o2::soa::is_iterator TMCParitlce, o2::soa::is_table TMCParticles, o2::soa::is_table TMCCollisions>
void fillTruePairInfo(o2::framework::HistogramRegistry* fRegistry, TDiphoton const& v12, TMCParitlce const& mcparticle, TMCParticles const& mcparticles, TMCCollisions const&, const TF1* f1fd_k0s_to_pi0 = nullptr, float eventWeight = 1.f)
{
int pdg = std::abs(mcparticle.pdgCode());
Expand Down
7 changes: 4 additions & 3 deletions PWGEM/PhotonMeson/Utils/PairUtilities.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,10 @@
#ifndef PWGEM_PHOTONMESON_UTILS_PAIRUTILITIES_H_
#define PWGEM_PHOTONMESON_UTILS_PAIRUTILITIES_H_

#include "Common/Core/RecoDecay.h"
#include <Common/Core/RecoDecay.h>

#include <CommonConstants/MathConstants.h>
#include <Framework/ASoA.h>

#include <cmath>

Expand Down Expand Up @@ -47,7 +48,7 @@ enum PairType {
kNpair,
};

template <typename U1, typename U2, typename TG1, typename TG2, typename TCut1, typename TCut2>
template <typename U1, typename U2, o2::soa::is_iterator TG1, o2::soa::is_iterator TG2, typename TCut1, typename TCut2>
bool IsSelectedPair(TG1 const& g1, TG2 const& g2, TCut1 const& cut1, TCut2 const& cut2)
{
bool is_g1_selected = false;
Expand All @@ -57,7 +58,7 @@ bool IsSelectedPair(TG1 const& g1, TG2 const& g2, TCut1 const& cut1, TCut2 const
return (is_g1_selected && is_g2_selected);
}

template <typename TV0Leg, typename TCluster>
template <o2::soa::is_iterator TV0Leg, o2::soa::is_iterator TCluster>
bool DoesV0LegMatchWithCluster(TV0Leg const& v0leg, TCluster const& cluster, const float max_deta, const float max_dphi, const float max_Ep_width)
{
float deta = v0leg.eta() - cluster.eta();
Expand Down
32 changes: 17 additions & 15 deletions PWGEM/PhotonMeson/Utils/TrackSelection.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
#ifndef PWGEM_PHOTONMESON_UTILS_TRACKSELECTION_H_
#define PWGEM_PHOTONMESON_UTILS_TRACKSELECTION_H_

#include <Framework/ASoA.h>

#include <TPDGCode.h>

#include <cmath>
Expand All @@ -30,7 +32,7 @@ namespace o2::pwgem::photonmeson
* @param track track
* @return true if has both
*/
template <typename TTrack>
template <o2::soa::is_iterator TTrack>
inline bool isITSTPCTrack(TTrack const& track)
{
return track.hasITS() && track.hasTPC();
Expand All @@ -43,7 +45,7 @@ inline bool isITSTPCTrack(TTrack const& track)
* @param track track
* @return true if has both
*/
template <typename TTrack>
template <o2::soa::is_iterator TTrack>
inline bool isTPCTRDTrack(TTrack const& track)
{
return !track.hasITS() && track.hasTPC() && track.hasTRD() && !track.hasTOF();
Expand All @@ -56,7 +58,7 @@ inline bool isTPCTRDTrack(TTrack const& track)
* @param track track
* @return true if has all
*/
template <typename TTrack>
template <o2::soa::is_iterator TTrack>
inline bool isITSTPCTRDTrack(TTrack const& track)
{
return track.hasITS() && track.hasTPC() && track.hasTRD() && !track.hasTOF();
Expand All @@ -68,7 +70,7 @@ inline bool isITSTPCTRDTrack(TTrack const& track)
* @param track track
* @return true if has both
*/
template <typename TTrack>
template <o2::soa::is_iterator TTrack>
inline bool isTPCTOFTrack(TTrack const& track)
{
return !track.hasITS() && track.hasTPC() && !track.hasTRD() && track.hasTOF();
Expand All @@ -80,7 +82,7 @@ inline bool isTPCTOFTrack(TTrack const& track)
* @param track track
* @return true if has all
*/
template <typename TTrack>
template <o2::soa::is_iterator TTrack>
inline bool isTPCTRDTOFTrack(TTrack const& track)
{
return !track.hasITS() && track.hasTPC() && track.hasTRD() && track.hasTOF();
Expand All @@ -92,7 +94,7 @@ inline bool isTPCTRDTOFTrack(TTrack const& track)
* @param track track
* @return true if has all
*/
template <typename TTrack>
template <o2::soa::is_iterator TTrack>
inline bool isITSTPCTRDTOFTrack(TTrack const& track)
{
return track.hasITS() && track.hasTPC() && track.hasTRD() && track.hasTOF();
Expand All @@ -105,7 +107,7 @@ inline bool isITSTPCTRDTOFTrack(TTrack const& track)
* @param track track
* @return true if tracks is TPC-only
*/
template <typename TTrack>
template <o2::soa::is_iterator TTrack>
inline bool isTPConlyTrack(TTrack const& track)
{
return !track.hasITS() && track.hasTPC() && !track.hasTRD() && !track.hasTOF();
Expand All @@ -118,7 +120,7 @@ inline bool isTPConlyTrack(TTrack const& track)
* @param track track
* @return true if tracks is ITS-only
*/
template <typename TTrack>
template <o2::soa::is_iterator TTrack>
inline bool isITSonlyTrack(TTrack const& track)
{
return track.hasITS() && !track.hasTPC() && !track.hasTRD() && !track.hasTOF();
Expand All @@ -132,7 +134,7 @@ inline bool isITSonlyTrack(TTrack const& track)
* @param track1 track from daughter 1
* @return true if V0 pairs are ITSTPC-tracks
*/
template <typename TTrack>
template <o2::soa::is_iterator TTrack>
inline bool isITSTPC_ITSTPC(TTrack const& track0, TTrack const& track1)
{
return isITSTPCTrack(track0) && isITSTPCTrack(track1);
Expand All @@ -146,7 +148,7 @@ inline bool isITSTPC_ITSTPC(TTrack const& track0, TTrack const& track1)
* @param track1 track from daughter 1
* @return true if one is TPC-only and the other ITSTPC
*/
template <typename TTrack>
template <o2::soa::is_iterator TTrack>
inline bool isITSTPC_TPConly(TTrack const& track0, TTrack const& track1)
{
return (isITSTPCTrack(track0) && isTPConlyTrack(track1)) || (isITSTPCTrack(track1) && isTPConlyTrack(track0));
Expand All @@ -160,7 +162,7 @@ inline bool isITSTPC_TPConly(TTrack const& track0, TTrack const& track1)
* @param track1 track from daughter 1
* @return true if one is ITS-only and the other ITSTPC
*/
template <typename TTrack>
template <o2::soa::is_iterator TTrack>
inline bool isITSTPC_ITSonly(TTrack const& track0, TTrack const& track1)
{
return (isITSTPCTrack(track0) && isITSonlyTrack(track1)) || (isITSTPCTrack(track1) && isITSonlyTrack(track0));
Expand All @@ -174,7 +176,7 @@ inline bool isITSTPC_ITSonly(TTrack const& track0, TTrack const& track1)
* @param track1 track from daughter 1
* @return true if both are TPC-only tracks
*/
template <typename TTrack>
template <o2::soa::is_iterator TTrack>
inline bool isTPConly_TPConly(TTrack const& track0, TTrack const& track1)
{
return isTPConlyTrack(track0) && isTPConlyTrack(track1);
Expand All @@ -188,7 +190,7 @@ inline bool isTPConly_TPConly(TTrack const& track0, TTrack const& track1)
* @param track1 track from daughter 1
* @return true if both are ITS-only tracks
*/
template <typename TTrack>
template <o2::soa::is_iterator TTrack>
inline bool isITSonly_ITSonly(TTrack const& track0, TTrack const& track1)
{
return isITSonlyTrack(track0) && isITSonlyTrack(track1);
Expand All @@ -202,7 +204,7 @@ inline bool isITSonly_ITSonly(TTrack const& track0, TTrack const& track1)
* @param track1 track from daughter 1
* @return true if either one is ITS-only while the other one is TPC-only
*/
template <typename TTrack>
template <o2::soa::is_iterator TTrack>
inline bool isTPConly_ITSonly(TTrack const& track0, TTrack const& track1)
{
return (isTPConlyTrack(track0) && isITSonlyTrack(track1)) || (isTPConlyTrack(track1) && isITSonlyTrack(track0));
Expand All @@ -215,7 +217,7 @@ inline bool isTPConly_ITSonly(TTrack const& track0, TTrack const& track1)
* @param mc2 MCParticle 1
* @return true if the mother particle is the expected type and the same for both
*/
template <PDG_t motherType, typename T>
template <PDG_t motherType, o2::soa::is_iterator T>
inline bool checkMCParticles(T const& mc1, T const& mc2)
{
if (std::abs(mc1.pdgCode()) != kElectron || std::abs(mc2.pdgCode()) != kElectron) {
Expand Down
Loading