Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 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
2 changes: 1 addition & 1 deletion PWGEM/Dilepton/DataModel/dileptonTables.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2019-2020 CERN and copyright holders of ALICE O2.

Check failure on line 1 in PWGEM/Dilepton/DataModel/dileptonTables.h

View workflow job for this annotation

GitHub Actions / O2 linter

[doc/file]

Provide mandatory file documentation.
// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
// All rights not expressly granted are reserved.
//
Expand All @@ -8,7 +8,7 @@
// 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.

Check failure on line 11 in PWGEM/Dilepton/DataModel/dileptonTables.h

View workflow job for this annotation

GitHub Actions / O2 linter

[doc/file]

Documentation for \author is missing, incorrect or misplaced.

Check failure on line 11 in PWGEM/Dilepton/DataModel/dileptonTables.h

View workflow job for this annotation

GitHub Actions / O2 linter

[doc/file]

Documentation for \brief is missing, incorrect or misplaced.

Check failure on line 11 in PWGEM/Dilepton/DataModel/dileptonTables.h

View workflow job for this annotation

GitHub Actions / O2 linter

[doc/file]

Documentation for \file is missing, incorrect or misplaced.
#include "Common/Core/RecoDecay.h"
#include "Common/DataModel/Centrality.h"
#include "Common/DataModel/EventSelection.h"
Expand Down Expand Up @@ -409,10 +409,10 @@
DECLARE_SOA_DYNAMIC_COLUMN(Px, px, [](float pt, float phi) -> float { return pt * std::cos(phi); });
DECLARE_SOA_DYNAMIC_COLUMN(Py, py, [](float pt, float phi) -> float { return pt * std::sin(phi); });
DECLARE_SOA_DYNAMIC_COLUMN(Pz, pz, [](float pt, float eta) -> float { return pt * std::sinh(eta); });
DECLARE_SOA_DYNAMIC_COLUMN(Theta, theta, [](float tgl) -> float { return M_PI_2 - std::atan(tgl); });

Check failure on line 412 in PWGEM/Dilepton/DataModel/dileptonTables.h

View workflow job for this annotation

GitHub Actions / O2 linter

[external-pi]

Use the PI constant (and its multiples and fractions) defined in o2::constants::math.
DECLARE_SOA_DYNAMIC_COLUMN(MeanClusterSizeITS, meanClusterSizeITS, [](uint32_t itsClusterSizes) -> float {
int total_cluster_size = 0, nl = 0;
for (unsigned int layer = 0; layer < 7; layer++) {

Check failure on line 415 in PWGEM/Dilepton/DataModel/dileptonTables.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.
int cluster_size_per_layer = (itsClusterSizes >> (layer * 4)) & 0xf;
if (cluster_size_per_layer > 0) {
nl++;
Expand All @@ -427,7 +427,7 @@
});
DECLARE_SOA_DYNAMIC_COLUMN(MeanClusterSizeITSib, meanClusterSizeITSib, [](uint32_t itsClusterSizes) -> float {
int total_cluster_size = 0, nl = 0;
for (unsigned int layer = 0; layer < 3; layer++) {

Check failure on line 430 in PWGEM/Dilepton/DataModel/dileptonTables.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.
int cluster_size_per_layer = (itsClusterSizes >> (layer * 4)) & 0xf;
if (cluster_size_per_layer > 0) {
nl++;
Expand All @@ -442,7 +442,7 @@
});
DECLARE_SOA_DYNAMIC_COLUMN(MeanClusterSizeITSob, meanClusterSizeITSob, [](uint32_t itsClusterSizes) -> float {
int total_cluster_size = 0, nl = 0;
for (unsigned int layer = 3; layer < 7; layer++) {

Check failure on line 445 in PWGEM/Dilepton/DataModel/dileptonTables.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.
int cluster_size_per_layer = (itsClusterSizes >> (layer * 4)) & 0xf;
if (cluster_size_per_layer > 0) {
nl++;
Expand Down Expand Up @@ -614,7 +614,7 @@
DECLARE_SOA_DYNAMIC_COLUMN(NClustersMFT, nClustersMFT, //! Number of MFT clusters
[](uint64_t mftClusterSizesAndTrackFlags) -> uint8_t {
uint8_t nClusters = 0;
for (int layer = 0; layer < 10; layer++) {

Check failure on line 617 in PWGEM/Dilepton/DataModel/dileptonTables.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.
if ((mftClusterSizesAndTrackFlags >> (layer * 6)) & 0x3F) {
nClusters++;
}
Expand All @@ -624,7 +624,7 @@
DECLARE_SOA_DYNAMIC_COLUMN(MFTClusterMap, mftClusterMap, //! MFT cluster map, one bit per a layer, starting from the innermost
[](uint64_t mftClusterSizesAndTrackFlags) -> uint16_t {
uint16_t clmap = 0;
for (unsigned int layer = 0; layer < 10; layer++) {

Check failure on line 627 in PWGEM/Dilepton/DataModel/dileptonTables.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.
if ((mftClusterSizesAndTrackFlags >> (layer * 6)) & 0x3f) {
clmap |= (1 << layer);
}
Expand Down Expand Up @@ -725,7 +725,7 @@
// iterators
using EMPrimaryTrack = EMPrimaryTracks::iterator;

DECLARE_SOA_TABLE(EMPrimaryTrackEMEventIds, "AOD", "PRMTRACKEMEVENTID", emprimarytrack::EMEventId); // To be joined with EMPrimaryTracks table at analysis level.
DECLARE_SOA_TABLE(EMPrimaryTrackEMEventIds, "AOD", "PRMTRKEMEVENTID", emprimarytrack::EMEventId); // To be joined with EMPrimaryTracks table at analysis level.
// iterators
using EMPrimaryTrackEMEventId = EMPrimaryTrackEMEventIds::iterator;

Expand Down
61 changes: 48 additions & 13 deletions PWGEM/Dilepton/TableProducer/filterEoI.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
// Please write to: daiki.sekihata@cern.ch

#include "PWGEM/Dilepton/DataModel/dileptonTables.h"
#include "PWGEM/PhotonMeson/DataModel/gammaTables.h"

#include "Framework/ASoAHelpers.h"
#include "Framework/AnalysisDataModel.h"
Expand All @@ -30,32 +31,39 @@ struct filterEoI {
enum SubSystem {
kElectron = 0x1,
kFwdMuon = 0x2,
kPCM = 0x4,
};
Produces<o2::aod::EMEoIs> emeoi;
Configurable<int> minNElectrons{"minNElectrons", 1, "min number of e+ and e- at midrapidity"};
Configurable<int> minNMuons{"minNMuons", 1, "min number of mu+ and mu- at forward rapidity"};
Configurable<int> minNElectrons{"minNElectrons", 1, "min number of e+ or e- at midrapidity"};
Configurable<int> minNMuons{"minNMuons", 1, "min number of mu+ or mu- at forward rapidity"};
Configurable<int> minNV0s{"minNV0s", 1, "min number of v0 photons at midrapidity"};

HistogramRegistry fRegistry{"output"};
void init(o2::framework::InitContext&)
{
auto hEventCounter = fRegistry.add<TH1>("hEventCounter", "hEventCounter", kTH1D, {{5, 0.5f, 5.5f}});
auto hEventCounter = fRegistry.add<TH1>("hEventCounter", "hEventCounter", kTH1D, {{8, 0.5f, 8.5f}});
hEventCounter->GetXaxis()->SetBinLabel(1, "all");
hEventCounter->GetXaxis()->SetBinLabel(2, "event with electron");
hEventCounter->GetXaxis()->SetBinLabel(3, "event with forward muon");
hEventCounter->GetXaxis()->SetBinLabel(4, "event with electron or forward muon");
hEventCounter->GetXaxis()->SetBinLabel(5, "event with electron and forward muon");
hEventCounter->GetXaxis()->SetBinLabel(4, "event with v0");
hEventCounter->GetXaxis()->SetBinLabel(5, "event with electron or forward muon");
hEventCounter->GetXaxis()->SetBinLabel(6, "event with electron and forward muon");
hEventCounter->GetXaxis()->SetBinLabel(7, "event with electron or forward muon or v0");
hEventCounter->GetXaxis()->SetBinLabel(8, "event with electron and forward muon and v0");
}

SliceCache cache;
Preslice<aod::EMPrimaryElectrons> perCollision_el = aod::emprimaryelectron::collisionId;
Preslice<aod::EMPrimaryMuons> perCollision_mu = aod::emprimarymuon::collisionId;
Preslice<aod::V0PhotonsKF> perCollision_v0 = aod::v0photonkf::collisionId;

template <uint8_t system, typename TCollisions, typename TElectrons, typename TMuons>
void selectEoI(TCollisions const& collisions, TElectrons const& electrons, TMuons const& muons)
template <uint8_t system, typename TCollisions, typename TElectrons, typename TMuons, typename TV0s>
void selectEoI(TCollisions const& collisions, TElectrons const& electrons, TMuons const& muons, TV0s const& v0s)
{
for (const auto& collision : collisions) {
bool does_electron_exist = false;
bool does_fwdmuon_exist = false;
bool does_pcm_exist = false;
fRegistry.fill(HIST("hEventCounter"), 1);

if constexpr (static_cast<bool>(system & kElectron)) {
Expand All @@ -72,15 +80,28 @@ struct filterEoI {
fRegistry.fill(HIST("hEventCounter"), 3);
}
}
if constexpr (static_cast<bool>(system & kPCM)) {
auto v0s_coll = v0s.sliceBy(perCollision_v0, collision.globalIndex());
if (v0s_coll.size() >= minNV0s) {
does_pcm_exist = true;
fRegistry.fill(HIST("hEventCounter"), 4);
}
}

if (does_electron_exist || does_fwdmuon_exist) {
fRegistry.fill(HIST("hEventCounter"), 4);
fRegistry.fill(HIST("hEventCounter"), 5);
}
if (does_electron_exist && does_fwdmuon_exist) {
fRegistry.fill(HIST("hEventCounter"), 5);
fRegistry.fill(HIST("hEventCounter"), 6);
}
if (does_electron_exist || does_fwdmuon_exist || does_pcm_exist) {
fRegistry.fill(HIST("hEventCounter"), 7);
}
if (does_electron_exist && does_fwdmuon_exist && does_pcm_exist) {
fRegistry.fill(HIST("hEventCounter"), 8);
}

emeoi(does_electron_exist || does_fwdmuon_exist);
emeoi(does_electron_exist || does_fwdmuon_exist || does_pcm_exist);

} // end of collision loop

Expand All @@ -89,19 +110,31 @@ struct filterEoI {
void process_Electron(aod::Collisions const& collisions, aod::EMPrimaryElectrons const& electrons)
{
const uint8_t sysflag = kElectron;
selectEoI<sysflag>(collisions, electrons, nullptr);
selectEoI<sysflag>(collisions, electrons, nullptr, nullptr);
}

void process_FwdMuon(aod::Collisions const& collisions, aod::EMPrimaryMuons const& muons)
{
const uint8_t sysflag = kFwdMuon;
selectEoI<sysflag>(collisions, nullptr, muons);
selectEoI<sysflag>(collisions, nullptr, muons, nullptr);
}

void process_Electron_FwdMuon(aod::Collisions const& collisions, aod::EMPrimaryElectrons const& electrons, aod::EMPrimaryMuons const& muons)
{
const uint8_t sysflag = kElectron | kFwdMuon;
selectEoI<sysflag>(collisions, electrons, muons);
selectEoI<sysflag>(collisions, electrons, muons, nullptr);
}

void process_PCM(aod::Collisions const& collisions, aod::V0PhotonsKF const& v0s)
{
const uint8_t sysflag = kPCM;
selectEoI<sysflag>(collisions, nullptr, nullptr, v0s);
}

void process_Electron_FwdMuon_PCM(aod::Collisions const& collisions, aod::EMPrimaryElectrons const& electrons, aod::EMPrimaryMuons const& muons, aod::V0PhotonsKF const& v0s)
{
const uint8_t sysflag = kElectron | kFwdMuon | kPCM;
selectEoI<sysflag>(collisions, electrons, muons, v0s);
}

void processDummy(aod::Collisions const& collisions)
Expand All @@ -113,7 +146,9 @@ struct filterEoI {

PROCESS_SWITCH(filterEoI, process_Electron, "create filter bit for Electron", false);
PROCESS_SWITCH(filterEoI, process_FwdMuon, "create filter bit for Forward Muon", false);
PROCESS_SWITCH(filterEoI, process_PCM, "create filter bit for PCM", false);
PROCESS_SWITCH(filterEoI, process_Electron_FwdMuon, "create filter bit for Electron, FwdMuon", false);
PROCESS_SWITCH(filterEoI, process_Electron_FwdMuon_PCM, "create filter bit for Electron, FwdMuon, PCM", false);
PROCESS_SWITCH(filterEoI, processDummy, "processDummy", true);
};
WorkflowSpec defineDataProcessing(ConfigContext const& cfgc)
Expand Down
21 changes: 10 additions & 11 deletions PWGEM/Dilepton/TableProducer/skimmerPrimaryMuon.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -203,8 +203,8 @@ struct skimmerPrimaryMuon {
return true;
}

template <typename TCollision, typename TFwdTrack, typename TFwdTracks, typename TMFTTracks>
void fillFwdTrackTable(TCollision const& collision, TFwdTrack fwdtrack, TFwdTracks const&, TMFTTracks const&, const bool isAmbiguous)
template <typename TFwdTracks, typename TMFTTracks, typename TCollision, typename TFwdTrack>
void fillFwdTrackTable(TCollision const& collision, TFwdTrack fwdtrack, const bool isAmbiguous)
{
if (fwdtrack.trackType() == o2::aod::fwdtrack::ForwardTrackTypeEnum::GlobalMuonTrack && fwdtrack.chi2MatchMCHMFT() > maxMatchingChi2MCHMFT) {
return;
Expand Down Expand Up @@ -381,7 +381,6 @@ struct skimmerPrimaryMuon {

SliceCache cache;

PresliceUnsorted<aod::FwdTracks> perMFTTrack = o2::aod::fwdtrack::matchMFTTrackId;
Preslice<aod::FwdTracks> perCollision = o2::aod::fwdtrack::collisionId;
Preslice<aod::FwdTrackAssoc> fwdtrackIndicesPerCollision = aod::track_association::collisionId;
PresliceUnsorted<aod::FwdTrackAssoc> fwdtrackIndicesPerFwdTrack = aod::track_association::fwdtrackId;
Expand All @@ -401,7 +400,7 @@ struct skimmerPrimaryMuon {
if (fwdtrack.trackType() != o2::aod::fwdtrack::ForwardTrackTypeEnum::GlobalMuonTrack && fwdtrack.trackType() != o2::aod::fwdtrack::ForwardTrackTypeEnum::MuonStandaloneTrack) {
continue;
}
fillFwdTrackTable(collision, fwdtrack, fwdtracks, mfttracks, false);
fillFwdTrackTable<MyFwdTracks, aod::MFTTracks>(collision, fwdtrack, false);
} // end of fwdtrack loop
} // end of collision loop
}
Expand Down Expand Up @@ -430,7 +429,7 @@ struct skimmerPrimaryMuon {
if (fwdtrack.trackType() != o2::aod::fwdtrack::ForwardTrackTypeEnum::GlobalMuonTrack && fwdtrack.trackType() != o2::aod::fwdtrack::ForwardTrackTypeEnum::MuonStandaloneTrack) {
continue;
}
fillFwdTrackTable(collision, fwdtrack, fwdtracks, mfttracks, mapAmb[fwdtrack.globalIndex()]);
fillFwdTrackTable<MyFwdTracks, aod::MFTTracks>(collision, fwdtrack, mapAmb[fwdtrack.globalIndex()]);
} // end of fwdtrack loop
} // end of collision loop
mapAmb.clear();
Expand All @@ -456,7 +455,7 @@ struct skimmerPrimaryMuon {
if (fwdtrack.trackType() != o2::aod::fwdtrack::ForwardTrackTypeEnum::GlobalMuonTrack && fwdtrack.trackType() != o2::aod::fwdtrack::ForwardTrackTypeEnum::MuonStandaloneTrack) {
continue;
}
fillFwdTrackTable(collision, fwdtrack, fwdtracks, mfttracks, false);
fillFwdTrackTable<MyFwdTracks, aod::MFTTracks>(collision, fwdtrack, false);
} // end of fwdtrack loop
} // end of collision loop
}
Expand Down Expand Up @@ -487,7 +486,7 @@ struct skimmerPrimaryMuon {
if (fwdtrack.trackType() != o2::aod::fwdtrack::ForwardTrackTypeEnum::GlobalMuonTrack && fwdtrack.trackType() != o2::aod::fwdtrack::ForwardTrackTypeEnum::MuonStandaloneTrack) {
continue;
}
fillFwdTrackTable(collision, fwdtrack, fwdtracks, mfttracks, mapAmb[fwdtrack.globalIndex()]);
fillFwdTrackTable<MyFwdTracks, aod::MFTTracks>(collision, fwdtrack, mapAmb[fwdtrack.globalIndex()]);
} // end of fwdtrack loop
} // end of collision loop
mapAmb.clear();
Expand All @@ -514,7 +513,7 @@ struct skimmerPrimaryMuon {
if (fwdtrack.trackType() != o2::aod::fwdtrack::ForwardTrackTypeEnum::GlobalMuonTrack && fwdtrack.trackType() != o2::aod::fwdtrack::ForwardTrackTypeEnum::MuonStandaloneTrack) {
continue;
}
fillFwdTrackTable(collision, fwdtrack, fwdtracks, mfttracks, false);
fillFwdTrackTable<MyFwdTracksMC, MFTTracksMC>(collision, fwdtrack, false);
} // end of fwdtrack loop
} // end of collision loop
}
Expand Down Expand Up @@ -548,7 +547,7 @@ struct skimmerPrimaryMuon {
if (fwdtrack.trackType() != o2::aod::fwdtrack::ForwardTrackTypeEnum::GlobalMuonTrack && fwdtrack.trackType() != o2::aod::fwdtrack::ForwardTrackTypeEnum::MuonStandaloneTrack) {
continue;
}
fillFwdTrackTable(collision, fwdtrack, fwdtracks, mfttracks, mapAmb[fwdtrack.globalIndex()]);
fillFwdTrackTable<MyFwdTracksMC, MFTTracksMC>(collision, fwdtrack, mapAmb[fwdtrack.globalIndex()]);
} // end of fwdtrack loop
} // end of collision loop
mapAmb.clear();
Expand Down Expand Up @@ -606,8 +605,8 @@ struct associateSameMFT {
em_same_mft_ids(self_Ids);
self_Ids.clear();
self_Ids.shrink_to_fit();
} else { // for standalone muons
em_same_mft_ids(std::vector<int>{}); // empty
} else {
em_same_mft_ids(std::vector<int>{}); // empty for standalone muons
}
} // end of muon loop
}
Expand Down
Loading