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
56 changes: 28 additions & 28 deletions PWGEM/Dilepton/DataModel/dileptonTables.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,33 +37,33 @@
namespace o2::aod
{

namespace pwgem::dilepton::swt
{
enum class swtAliases : int { // software trigger aliases for EM
kHighTrackMult = 0,
kHighFt0cFv0Mult,
kSingleE,
kLMeeIMR,
kLMeeHMR,
kDiElectron,
kSingleMuLow,
kSingleMuHigh,
kDiMuon,
kNaliases
};

const std::unordered_map<std::string, int> aliasLabels = {
{"fHighTrackMult", static_cast<int>(o2::aod::pwgem::dilepton::swt::swtAliases::kHighTrackMult)},
{"fHighFt0cFv0Mult", static_cast<int>(o2::aod::pwgem::dilepton::swt::swtAliases::kHighFt0cFv0Mult)},
{"fSingleE", static_cast<int>(o2::aod::pwgem::dilepton::swt::swtAliases::kSingleE)},
{"fLMeeIMR", static_cast<int>(o2::aod::pwgem::dilepton::swt::swtAliases::kLMeeIMR)},
{"fLMeeHMR", static_cast<int>(o2::aod::pwgem::dilepton::swt::swtAliases::kLMeeHMR)},
{"fDiElectron", static_cast<int>(o2::aod::pwgem::dilepton::swt::swtAliases::kDiElectron)},
{"fSingleMuLow", static_cast<int>(o2::aod::pwgem::dilepton::swt::swtAliases::kSingleMuLow)},
{"fSingleMuHigh", static_cast<int>(o2::aod::pwgem::dilepton::swt::swtAliases::kSingleMuHigh)},
{"fDiMuon", static_cast<int>(o2::aod::pwgem::dilepton::swt::swtAliases::kDiMuon)},
};
} // namespace pwgem::dilepton::swt
// namespace pwgem::dilepton::swt
// {
// enum class swtAliases : int { // software trigger aliases for EM
// kHighTrackMult = 0,
// kHighFt0cFv0Mult,
// kSingleE,
// kLMeeIMR,
// kLMeeHMR,
// kDiElectron,
// kSingleMuLow,
// kSingleMuHigh,
// kDiMuon,
// kNaliases
// };
//
// const std::unordered_map<std::string, int> aliasLabels = {
// {"fHighTrackMult", static_cast<int>(o2::aod::pwgem::dilepton::swt::swtAliases::kHighTrackMult)},
// {"fHighFt0cFv0Mult", static_cast<int>(o2::aod::pwgem::dilepton::swt::swtAliases::kHighFt0cFv0Mult)},
// {"fSingleE", static_cast<int>(o2::aod::pwgem::dilepton::swt::swtAliases::kSingleE)},
// {"fLMeeIMR", static_cast<int>(o2::aod::pwgem::dilepton::swt::swtAliases::kLMeeIMR)},
// {"fLMeeHMR", static_cast<int>(o2::aod::pwgem::dilepton::swt::swtAliases::kLMeeHMR)},
// {"fDiElectron", static_cast<int>(o2::aod::pwgem::dilepton::swt::swtAliases::kDiElectron)},
// {"fSingleMuLow", static_cast<int>(o2::aod::pwgem::dilepton::swt::swtAliases::kSingleMuLow)},
// {"fSingleMuHigh", static_cast<int>(o2::aod::pwgem::dilepton::swt::swtAliases::kSingleMuHigh)},
// {"fDiMuon", static_cast<int>(o2::aod::pwgem::dilepton::swt::swtAliases::kDiMuon)},
// };
// } // namespace pwgem::dilepton::swt

namespace emevsel
{
Expand Down Expand Up @@ -257,11 +257,11 @@
namespace emeventnorm
{
DECLARE_SOA_DYNAMIC_COLUMN(PosZ, posZ, [](int8_t posZint8) -> float { return (posZint8 < 0 ? std::nextafter(posZint8 * 0.5f, -std::numeric_limits<float>::infinity()) : std::nextafter(posZint8 * 0.5f, std::numeric_limits<float>::infinity())); }); //! posZ is multiplied by 2 in createEMEventDileton.cxx
DECLARE_SOA_DYNAMIC_COLUMN(CentFT0M, centFT0M, [](uint8_t centuint8) -> float { return centuint8 < 100 ? std::nextafter(centuint8 * 0.01f, std::numeric_limits<float>::infinity()) : std::nextafter(centuint8 - 110.f, std::numeric_limits<float>::infinity()); }); //! centrality is multiplied by 100 in createEMEventDilepton.cxx

Check failure on line 260 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.
DECLARE_SOA_DYNAMIC_COLUMN(CentFT0A, centFT0A, [](uint8_t centuint8) -> float { return centuint8 < 100 ? std::nextafter(centuint8 * 0.01f, std::numeric_limits<float>::infinity()) : std::nextafter(centuint8 - 110.f, std::numeric_limits<float>::infinity()); }); //! centrality is multiplied by 100 in createEMEventDilepton.cxx

Check failure on line 261 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.
DECLARE_SOA_DYNAMIC_COLUMN(CentFT0C, centFT0C, [](uint8_t centuint8) -> float { return centuint8 < 100 ? std::nextafter(centuint8 * 0.01f, std::numeric_limits<float>::infinity()) : std::nextafter(centuint8 - 110.f, std::numeric_limits<float>::infinity()); }); //! centrality is multiplied by 100 in createEMEventDilepton.cxx

Check failure on line 262 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.
DECLARE_SOA_DYNAMIC_COLUMN(CentNTPV, centNTPV, [](uint8_t centuint8) -> float { return centuint8 < 100 ? std::nextafter(centuint8 * 0.01f, std::numeric_limits<float>::infinity()) : std::nextafter(centuint8 - 110.f, std::numeric_limits<float>::infinity()); }); //! centrality is multiplied by 100 in createEMEventDilepton.cxx

Check failure on line 263 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.
DECLARE_SOA_DYNAMIC_COLUMN(CentNGlobal, centNGlobal, [](uint8_t centuint8) -> float { return centuint8 < 100 ? std::nextafter(centuint8 * 0.01f, std::numeric_limits<float>::infinity()) : std::nextafter(centuint8 - 110.f, std::numeric_limits<float>::infinity()); }); //! centrality is multiplied by 100 in createEMEventDilepton.cxx

Check failure on line 264 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.
} // namespace emeventnorm

// namespace emcent
Expand Down Expand Up @@ -708,7 +708,7 @@
DECLARE_SOA_DYNAMIC_COLUMN(Tgl, tgl, [](float eta) -> float { return std::tan(o2::constants::math::PIHalf - 2 * std::atan(std::exp(-eta))); });
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 711 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 @@ -723,7 +723,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 726 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 @@ -738,7 +738,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 741 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 @@ -1044,7 +1044,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 1047 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 @@ -1054,7 +1054,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 1057 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 @@ -1221,7 +1221,7 @@

namespace emthinevent
{
DECLARE_SOA_COLUMN(EP2, ep2, float); //!
DECLARE_SOA_COLUMN(EP2, ep2, float); //!
DECLARE_SOA_COLUMN(Centrality, centrality, float); //!
} // namespace emthinevent
DECLARE_SOA_TABLE_VERSIONED(EMThinEvents_000, "AOD", "EMTHINEVENT", 0, //! Thin event information table
Expand Down
48 changes: 24 additions & 24 deletions PWGEM/Dilepton/TableProducer/skimmerOTS.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ struct skimmerOTS {

// CCDB options
Configurable<std::string> ccdburl{"ccdb-url", "http://alice-ccdb.cern.ch", "url of the ccdb repository"};
Configurable<std::string> cfg_swt_names{"cfg_swt_names", "fLMeeIMR,fLMeeHMR", "comma-separated software trigger names"}; // !trigger names have to be pre-registered in dileptonTable.h for bit operation!
Configurable<std::string> cfg_swt_names{"cfg_swt_names", "fLMeeIMR,fLMeeHMR", "comma-separated software trigger names"};
o2::framework::Configurable<std::string> ccdbPathSoftwareTrigger{"ccdbPathSoftwareTrigger", "EventFiltering/Zorro/", "ccdb path for ZORRO objects"};
Configurable<uint64_t> bcMarginForSoftwareTrigger{"bcMarginForSoftwareTrigger", 100, "Number of BCs of margin for software triggers"};

Expand All @@ -58,10 +58,10 @@ struct skimmerOTS {
Zorro zorro;
std::vector<int> mTOIidx;
uint64_t mNinspectedTVX{0};
std::vector<uint64_t> mScalers;
std::vector<uint64_t> mSelections;
std::vector<int> mTOICounters;
std::vector<int> mATCounters;
// std::vector<uint64_t> mScalers;
// std::vector<uint64_t> mSelections;
// std::vector<int> mTOICounters;
// std::vector<int> mATCounters;

HistogramRegistry registry{"registry"};

Expand All @@ -87,28 +87,28 @@ struct skimmerOTS {
hCollisionCounter->GetXaxis()->SetBinLabel(idx + 2, swt_names[idx].data());
}

const int ntrg = static_cast<int>(o2::aod::pwgem::dilepton::swt::swtAliases::kNaliases);
// const int ntrg = static_cast<int>(o2::aod::pwgem::dilepton::swt::swtAliases::kNaliases);
mNinspectedTVX = 0;
mScalers.resize(ntrg);
mSelections.resize(ntrg);
mTOICounters.resize(ntrg);
mATCounters.resize(ntrg);
for (int idx = 0; idx < ntrg; idx++) {
mTOICounters[idx] = 0;
mATCounters[idx] = 0;
mScalers[idx] = 0;
mSelections[idx] = 0;
}
// mScalers.resize(ntrg);
// mSelections.resize(ntrg);
// mTOICounters.resize(ntrg);
// mATCounters.resize(ntrg);
// for (int idx = 0; idx < ntrg; idx++) {
// // mTOICounters[idx] = 0;
// // mATCounters[idx] = 0;
// // mScalers[idx] = 0;
// // mSelections[idx] = 0;
// }
}

~skimmerOTS()
{
swt_names.clear();
swt_names.shrink_to_fit();
mTOICounters.clear();
mTOICounters.shrink_to_fit();
mATCounters.clear();
mATCounters.shrink_to_fit();
// mTOICounters.clear();
// mTOICounters.shrink_to_fit();
// mATCounters.clear();
// mATCounters.shrink_to_fit();
}

template <typename TBC>
Expand All @@ -128,10 +128,10 @@ struct skimmerOTS {

for (size_t idx = 0; idx < mTOIidx.size(); idx++) {
auto swtname = swt_names[idx];
int emswtId = o2::aod::pwgem::dilepton::swt::aliasLabels.at(swtname);
mScalers[emswtId] = zorro.getScalers()->GetBinContent(mTOIidx[idx] + 2);
mSelections[emswtId] = zorro.getSelections()->GetBinContent(mTOIidx[idx] + 2);
LOGF(info, "Trigger of Interest : index = %d in Zorro, %d in EM, scaler = %llu, selection = %llu", mTOIidx[idx], emswtId, mScalers[emswtId], mSelections[emswtId]);
// int emswtId = o2::aod::pwgem::dilepton::swt::aliasLabels.at(swtname);
uint64_t nScalers = zorro.getScalers()->GetBinContent(mTOIidx[idx] + 2);
uint64_t nSelections = zorro.getSelections()->GetBinContent(mTOIidx[idx] + 2);
LOGF(info, "Trigger of Interest : index = %d in Zorro, scaler = %llu, selection = %llu", mTOIidx[idx], nScalers, nSelections);
}
mRunNumber = bc.runNumber();
}
Expand Down
Loading