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
15 changes: 15 additions & 0 deletions PWGDQ/Core/HistogramsLibrary.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -1046,6 +1046,21 @@ void o2::aod::dqhistograms::DefineHistograms(HistogramManager* hm, const char* h
}
}
}
if (subGroupStr.Contains("emcal")) {
hm->AddHistogram(histClass, "EMCalEnergy", "EMCal cluster energy", false, 500, 0.0, 50.0, VarManager::kEMCalEnergy);
hm->AddHistogram(histClass, "EMCalCoreEnergy", "EMCal cluster core energy", false, 500, 0.0, 50.0, VarManager::kEMCalCoreEnergy);
hm->AddHistogram(histClass, "EMCalEta_Phi", "EMCal cluster #eta vs #varphi", false, 100, -1.0, 1.0, VarManager::kEMCalEta, 180, 0.0, TMath::TwoPi(), VarManager::kEMCalPhi);
hm->AddHistogram(histClass, "EMCalM02", "EMCal cluster M02", false, 200, 0.0, 2.0, VarManager::kEMCalM02);
hm->AddHistogram(histClass, "EMCalM20", "EMCal cluster M20", false, 200, 0.0, 2.0, VarManager::kEMCalM20);
hm->AddHistogram(histClass, "EMCalNCells", "EMCal cluster no. cells", false, 50, -0.5, 49.5, VarManager::kEMCalNCells);
hm->AddHistogram(histClass, "EMCalTime", "EMCal cluster time", false, 400, -100.0, 100.0, VarManager::kEMCalTime);
hm->AddHistogram(histClass, "EMCalEnergy_Time", "EMCal cluster energy vs time", false, 100, 0.0, 50.0, VarManager::kEMCalEnergy, 200, -100.0, 100.0, VarManager::kEMCalTime);
if (subGroupStr.Contains("emcalmatch")) {
hm->AddHistogram(histClass, "EMCalEoverP", "EMCal E/p", false, 300, 0.0, 3.0, VarManager::kEMCalEoverP);
hm->AddHistogram(histClass, "Pt_EMCalEoverP", "p_{T} vs EMCal E/p", false, 200, 0.0, 20.0, VarManager::kPt, 300, 0.0, 3.0, VarManager::kEMCalEoverP);
hm->AddHistogram(histClass, "EMCalMatchDeltaEta_DeltaPhi", "EMCal matching #Delta#eta vs #Delta#varphi", false, 100, -0.1, 0.1, VarManager::kEMCalMatchDeltaEta, 100, -0.1, 0.1, VarManager::kEMCalMatchDeltaPhi);
}
}
if (subGroupStr.Contains("muon")) {
if (!subGroupStr.Contains("ambiguity")) {
hm->AddHistogram(histClass, "MuonNClusters", "", false, 100, 0.0, 10.0, VarManager::kMuonNClusters);
Expand Down
48 changes: 48 additions & 0 deletions PWGDQ/Core/VarManager.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -999,6 +999,38 @@ void VarManager::SetDefaultVarNames()
fgVariableUnits[kTRDsignal] = "";
fgVariableNames[kTOFbeta] = "TOF #beta";
fgVariableUnits[kTOFbeta] = "";
fgVariableNames[kEMCalEnergy] = "EMCal cluster energy";
fgVariableUnits[kEMCalEnergy] = "GeV";
fgVariableNames[kEMCalCoreEnergy] = "EMCal cluster core energy";
fgVariableUnits[kEMCalCoreEnergy] = "GeV";
fgVariableNames[kEMCalRawEnergy] = "EMCal cluster raw energy";
fgVariableUnits[kEMCalRawEnergy] = "GeV";
fgVariableNames[kEMCalEta] = "EMCal cluster #eta";
fgVariableUnits[kEMCalEta] = "";
fgVariableNames[kEMCalPhi] = "EMCal cluster #varphi";
fgVariableUnits[kEMCalPhi] = "rad.";
fgVariableNames[kEMCalM02] = "EMCal cluster M02";
fgVariableUnits[kEMCalM02] = "";
fgVariableNames[kEMCalM20] = "EMCal cluster M20";
fgVariableUnits[kEMCalM20] = "";
fgVariableNames[kEMCalNCells] = "EMCal cluster no. cells";
fgVariableUnits[kEMCalNCells] = "";
fgVariableNames[kEMCalTime] = "EMCal cluster time";
fgVariableUnits[kEMCalTime] = "ns";
fgVariableNames[kEMCalIsExotic] = "EMCal cluster is exotic";
fgVariableUnits[kEMCalIsExotic] = "";
fgVariableNames[kEMCalDistanceToBadChannel] = "EMCal cluster distance to bad channel";
fgVariableUnits[kEMCalDistanceToBadChannel] = "";
fgVariableNames[kEMCalNLM] = "EMCal cluster no. local maxima";
fgVariableUnits[kEMCalNLM] = "";
fgVariableNames[kEMCalDefinition] = "EMCal cluster definition";
fgVariableUnits[kEMCalDefinition] = "";
fgVariableNames[kEMCalEoverP] = "E_{EMCal}/p_{track}";
fgVariableUnits[kEMCalEoverP] = "";
fgVariableNames[kEMCalMatchDeltaEta] = "#Delta#eta (track-cluster)";
fgVariableUnits[kEMCalMatchDeltaEta] = "";
fgVariableNames[kEMCalMatchDeltaPhi] = "#Delta#varphi (track-cluster)";
fgVariableUnits[kEMCalMatchDeltaPhi] = "";
fgVariableNames[kTrackLength] = "track length";
fgVariableUnits[kTrackLength] = "cm";
fgVariableNames[kTrackDCAxy] = "DCA_{xy}";
Expand Down Expand Up @@ -2272,6 +2304,22 @@ void VarManager::SetDefaultVarNames()
fgVarNamesMap["kTRDsignal"] = kTRDsignal;
fgVarNamesMap["kTRDPattern"] = kTRDPattern;
fgVarNamesMap["kTOFbeta"] = kTOFbeta;
fgVarNamesMap["kEMCalEnergy"] = kEMCalEnergy;
fgVarNamesMap["kEMCalCoreEnergy"] = kEMCalCoreEnergy;
fgVarNamesMap["kEMCalRawEnergy"] = kEMCalRawEnergy;
fgVarNamesMap["kEMCalEta"] = kEMCalEta;
fgVarNamesMap["kEMCalPhi"] = kEMCalPhi;
fgVarNamesMap["kEMCalM02"] = kEMCalM02;
fgVarNamesMap["kEMCalM20"] = kEMCalM20;
fgVarNamesMap["kEMCalNCells"] = kEMCalNCells;
fgVarNamesMap["kEMCalTime"] = kEMCalTime;
fgVarNamesMap["kEMCalIsExotic"] = kEMCalIsExotic;
fgVarNamesMap["kEMCalDistanceToBadChannel"] = kEMCalDistanceToBadChannel;
fgVarNamesMap["kEMCalNLM"] = kEMCalNLM;
fgVarNamesMap["kEMCalDefinition"] = kEMCalDefinition;
fgVarNamesMap["kEMCalEoverP"] = kEMCalEoverP;
fgVarNamesMap["kEMCalMatchDeltaEta"] = kEMCalMatchDeltaEta;
fgVarNamesMap["kEMCalMatchDeltaPhi"] = kEMCalMatchDeltaPhi;
fgVarNamesMap["kTrackLength"] = kTrackLength;
fgVarNamesMap["kTrackDCAxy"] = kTrackDCAxy;
fgVarNamesMap["kTrackDCAxyProng1"] = kTrackDCAxyProng1;
Expand Down
55 changes: 54 additions & 1 deletion PWGDQ/Core/VarManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,8 @@ class VarManager : public TObject
MFTCov = BIT(27),
TrackTOFService = BIT(28),
ParticleMC = BIT(29),
MuonDca = BIT(30)
MuonDca = BIT(30),
TrackEMCal = BIT(31) // NOTE: last free bit of the uint32 track fill maps; used both for aod::EMCALClusters and ReducedEMCals
};

enum PairCandidateType {
Expand Down Expand Up @@ -193,6 +194,11 @@ class VarManager : public TObject
kMuonIsPropagated = 7 // whether the muon was propagated already
};

enum EMCalClusterFilteringBits {
kEMCalClusterIsMatched = 0, // cluster has at least one matched track (from EMCALMatchedTracks)
kEMCalClusterUserCutsBits = 1 // first bit for the user EMCal cluster selections
};

public:
enum Variables {
kNothing = -1,
Expand Down Expand Up @@ -633,6 +639,22 @@ class VarManager : public TObject
kIsDalitzLeg, // Up to 8 dalitz selections
kBarrelNAssocsInBunch = kIsDalitzLeg + 8, // number of in bunch collision associations
kBarrelNAssocsOutOfBunch, // number of out of bunch collision associations
kEMCalEnergy, // EMCal cluster energy
kEMCalCoreEnergy, // EMCal cluster core energy
kEMCalRawEnergy, // EMCal cluster raw energy
kEMCalEta, // EMCal cluster pseudorapidity
kEMCalPhi, // EMCal cluster azimuthal angle
kEMCalM02, // EMCal shower shape long axis
kEMCalM20, // EMCal shower shape short axis
kEMCalNCells, // number of cells in the EMCal cluster
kEMCalTime, // EMCal cluster time
kEMCalIsExotic, // exotic EMCal cluster flag
kEMCalDistanceToBadChannel, // distance of the EMCal cluster to the closest bad channel
kEMCalNLM, // number of local maxima of the EMCal cluster
kEMCalDefinition, // EMCal cluster definition
kEMCalEoverP, // EMCal cluster energy over matched track momentum
kEMCalMatchDeltaEta, // eta residual of the matched EMCal cluster w.r.t. the track
kEMCalMatchDeltaPhi, // phi residual of the matched EMCal cluster w.r.t. the track
kNBarrelTrackVariables,

// Muon track variables
Expand Down Expand Up @@ -1407,6 +1429,8 @@ class VarManager : public TObject
static void FillTrack(T const& track, float* values = nullptr);
template <uint32_t fillMap, typename T>
static void FillPhoton(T const& photon, float* values = nullptr);
template <typename T>
static void FillTrackEMCal(T const& cluster, float trackP = -1.0f, float deltaEta = -999.0f, float deltaPhi = -999.0f, float* values = nullptr);
template <uint32_t fillMap, typename T, typename C>
static void FillTrackCollision(T const& track, C const& collision, float* values = nullptr);
template <int candidateType, uint32_t fillMap, typename T1, typename T2, typename C>
Expand Down Expand Up @@ -3440,6 +3464,35 @@ void VarManager::FillPhoton(T const& track, float* values)
}
}

template <typename T>
void VarManager::FillTrackEMCal(T const& cluster, float trackP, float deltaEta, float deltaPhi, float* values)
{
// Fill the EMCal cluster quantities; the cluster can be either an aod::EMCALCluster (skimming)
// or an aod::ReducedEMCal (analysis on skimmed data), the column schemas are identical.
// trackP: momentum of the matched track, used to compute E/p when called in a track-cluster matching context;
// the default (negative) value leaves E/p at the -999 sentinel, as for tracks without a matched cluster.
if (!values) {
values = fgValues;
}

values[kEMCalEnergy] = cluster.energy();
values[kEMCalCoreEnergy] = cluster.coreEnergy();
values[kEMCalRawEnergy] = cluster.rawEnergy();
values[kEMCalEta] = cluster.eta();
values[kEMCalPhi] = cluster.phi();
values[kEMCalM02] = cluster.m02();
values[kEMCalM20] = cluster.m20();
values[kEMCalNCells] = cluster.nCells();
values[kEMCalTime] = cluster.time();
values[kEMCalIsExotic] = cluster.isExotic();
values[kEMCalDistanceToBadChannel] = cluster.distanceToBadChannel();
values[kEMCalNLM] = cluster.nlm();
values[kEMCalDefinition] = cluster.definition();
values[kEMCalEoverP] = (trackP > 0.0f ? cluster.energy() / trackP : -999.0f);
values[kEMCalMatchDeltaEta] = deltaEta;
values[kEMCalMatchDeltaPhi] = deltaPhi;
}

template <typename U, typename T>
void VarManager::FillTrackMC(const U& mcStack, T const& track, float* values)
{
Expand Down
43 changes: 43 additions & 0 deletions PWGDQ/DataModel/ReducedInfoTables.h
Original file line number Diff line number Diff line change
Expand Up @@ -366,6 +366,39 @@ DECLARE_SOA_TABLE(ReducedFITs, "AOD", "REDUCEDFIT", //! FIT detector information

using ReducedFIT = ReducedFITs::iterator;

namespace reducedemcal
{
// EMCal cluster information (from aod::EMCALClusters, see PWGJE/DataModel/EMCALClusters.h)
DECLARE_SOA_INDEX_COLUMN(ReducedEvent, reducedevent); //!
DECLARE_SOA_BITMAP_COLUMN(FilteringFlags, filteringFlags, 64); //! Bitmap of the cluster selections
DECLARE_SOA_COLUMN(Energy, energy, float); //! cluster energy (GeV)
DECLARE_SOA_COLUMN(CoreEnergy, coreEnergy, float); //! cluster core energy (GeV)
DECLARE_SOA_COLUMN(RawEnergy, rawEnergy, float); //! raw cluster energy (GeV)
DECLARE_SOA_COLUMN(Eta, eta, float); //! cluster pseudorapidity (calculated using vertex)
DECLARE_SOA_COLUMN(Phi, phi, float); //! cluster azimuthal angle (calculated using vertex)
DECLARE_SOA_COLUMN(M02, m02, float); //! shower shape long axis
DECLARE_SOA_COLUMN(M20, m20, float); //! shower shape short axis
DECLARE_SOA_COLUMN(NCells, nCells, int); //! number of cells in cluster
DECLARE_SOA_COLUMN(Time, time, float); //! cluster time (ns)
DECLARE_SOA_COLUMN(IsExotic, isExotic, bool); //! flag to mark cluster as exotic
DECLARE_SOA_COLUMN(DistanceToBadChannel, distanceToBadChannel, float); //! distance to bad channel
DECLARE_SOA_COLUMN(NLM, nlm, int); //! number of local maxima
DECLARE_SOA_COLUMN(Definition, definition, int); //! cluster definition, see EMCALClusterDefinition.h
DECLARE_SOA_COLUMN(IsAmbiguous, isAmbiguous, bool); //! true for clusters from BCs with no or multiple collisions
} // namespace reducedemcal

// Skimmed EMCal cluster information; standalone table (not joinable to the barrel track tables),
// the matching to barrel tracks is stored as an index column in the ReducedTracksBarrelEMCal table
DECLARE_SOA_TABLE(ReducedEMCals, "AOD", "REDUCEDEMCAL", //!
o2::soa::Index<>, reducedemcal::ReducedEventId, reducedemcal::FilteringFlags,
reducedemcal::Energy, reducedemcal::CoreEnergy, reducedemcal::RawEnergy,
reducedemcal::Eta, reducedemcal::Phi, reducedemcal::M02, reducedemcal::M20,
reducedemcal::NCells, reducedemcal::Time, reducedemcal::IsExotic,
reducedemcal::DistanceToBadChannel, reducedemcal::NLM, reducedemcal::Definition,
reducedemcal::IsAmbiguous);

using ReducedEMCal = ReducedEMCals::iterator;

namespace reducedtrack
{
// basic track information
Expand Down Expand Up @@ -399,6 +432,9 @@ DECLARE_SOA_DYNAMIC_COLUMN(Pz, pz, //!
[](float pt, float eta) -> float { return pt * std::sinh(eta); });
DECLARE_SOA_DYNAMIC_COLUMN(P, p, //!
[](float pt, float eta) -> float { return pt * std::cosh(eta); });
DECLARE_SOA_INDEX_COLUMN(ReducedEMCal, matchedEMCalCluster); //! matching index pointing to the ReducedEMCals table, -1 if no matched cluster
DECLARE_SOA_COLUMN(EMCalMatchDeltaEta, emcalMatchDeltaEta, float); //! eta residual of the matched EMCal cluster w.r.t. the track
DECLARE_SOA_COLUMN(EMCalMatchDeltaPhi, emcalMatchDeltaPhi, float); //! phi residual of the matched EMCal cluster w.r.t. the track
} // namespace reducedtrack

// basic track information
Expand Down Expand Up @@ -447,11 +483,18 @@ DECLARE_SOA_TABLE(ReducedTracksBarrelPID, "AOD", "RTBARRELPID", //!
DECLARE_SOA_TABLE(ReducedTracksBarrelInfo, "AOD", "RTBARRELINFO",
reducedtrack::CollisionId, collision::PosX, collision::PosY, collision::PosZ, reducedtrack::TrackId);

// barrel track EMCal matching information (joined with ReducedTracks);
// one entry per skimmed barrel track, the index is -1 for tracks without a matched cluster
DECLARE_SOA_TABLE(ReducedTracksBarrelEMCal, "AOD", "RTBARRELEMCAL", //!
reducedtrack::ReducedEMCalId,
reducedtrack::EMCalMatchDeltaEta, reducedtrack::EMCalMatchDeltaPhi);

using ReducedTrack = ReducedTracks::iterator;
using ReducedTrackBarrel = ReducedTracksBarrel::iterator;
using ReducedTrackBarrelCov = ReducedTracksBarrelCov::iterator;
using ReducedTrackBarrelPID = ReducedTracksBarrelPID::iterator;
using ReducedTrackBarrelInfo = ReducedTracksBarrelInfo::iterator;
using ReducedTrackBarrelEMCal = ReducedTracksBarrelEMCal::iterator;

namespace reducedtrackMC
{
Expand Down
Loading
Loading