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
41 changes: 41 additions & 0 deletions 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 <vector>
#include <string>
#include <unordered_map>
Expand Down Expand Up @@ -395,10 +395,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 398 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 401 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 @@ -413,7 +413,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 416 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 @@ -428,7 +428,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 431 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 @@ -568,7 +568,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 571 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 @@ -578,7 +578,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 581 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 @@ -641,6 +641,47 @@
// iterators
using EMGlobalMuonSelfId = EMGlobalMuonSelfIds::iterator;

// Dummy data for MC
namespace emdummydata
{
DECLARE_SOA_COLUMN(A, a, float);
DECLARE_SOA_COLUMN(B, b, float);
DECLARE_SOA_COLUMN(C, c, float);
DECLARE_SOA_COLUMN(D, d, float);
DECLARE_SOA_COLUMN(E, e, float);
DECLARE_SOA_COLUMN(F, f, float);
DECLARE_SOA_COLUMN(G, g, float);
DECLARE_SOA_COLUMN(H, h, float);
DECLARE_SOA_COLUMN(I, i, float);
DECLARE_SOA_COLUMN(J, j, float);
DECLARE_SOA_COLUMN(K, k, float);
DECLARE_SOA_COLUMN(L, l, float);
DECLARE_SOA_COLUMN(M, m, float);
DECLARE_SOA_COLUMN(N, n, float);
DECLARE_SOA_COLUMN(O, o, float);
DECLARE_SOA_COLUMN(P, p, float);
DECLARE_SOA_COLUMN(Q, q, float);
DECLARE_SOA_COLUMN(R, r, float);
DECLARE_SOA_COLUMN(S, s, float);
DECLARE_SOA_COLUMN(T, t, float);
DECLARE_SOA_COLUMN(U, u, float);
DECLARE_SOA_COLUMN(V, v, float);
DECLARE_SOA_COLUMN(W, w, float);
DECLARE_SOA_COLUMN(X, x, float);
DECLARE_SOA_COLUMN(Y, y, float);
DECLARE_SOA_COLUMN(Z, z, float);
} // namespace emdummydata
DECLARE_SOA_TABLE(EMDummyDatas, "AOD", "EMDUMMYDATA",
o2::soa::Index<>,
emdummydata::A, emdummydata::B, emdummydata::C, emdummydata::D, emdummydata::E,
emdummydata::F, emdummydata::G, emdummydata::H, emdummydata::I, emdummydata::J,
emdummydata::K, emdummydata::L, emdummydata::M, emdummydata::N, emdummydata::O,
emdummydata::P, emdummydata::Q, emdummydata::R, emdummydata::S, emdummydata::T,
emdummydata::U, emdummydata::V, emdummydata::W, emdummydata::X, emdummydata::Y,
emdummydata::Z);

// iterators
using EMDummyData = EMDummyDatas::iterator;
} // namespace o2::aod

#endif // PWGEM_DILEPTON_DATAMODEL_DILEPTONTABLES_H_
24 changes: 20 additions & 4 deletions PWGEM/Dilepton/TableProducer/associateMCinfoDilepton.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -33,25 +33,27 @@ using namespace o2::framework;
using namespace o2::framework::expressions;
using namespace o2::soa;

using MyCollisionsMC = soa::Join<aod::Collisions, aod::McCollisionLabels, aod::EvSels, aod::EMEvSels>;
using TracksMC = soa::Join<aod::TracksIU, aod::McTrackLabels>;
using FwdTracksMC = soa::Join<aod::FwdTracks, aod::McFwdTrackLabels>;

struct AssociateMCInfoDilepton {
enum SubSystem {
kElectron = 0x1,
kFwdMuon = 0x2,
kPCM = 0x4,
};

using MyCollisionsMC = soa::Join<aod::Collisions, aod::McCollisionLabels, aod::EvSels, aod::EMEvSels>;
using TracksMC = soa::Join<aod::TracksIU, aod::McTrackLabels>;
using FwdTracksMC = soa::Join<aod::FwdTracks, aod::McFwdTrackLabels>;

Produces<o2::aod::EMMCEvents> mcevents;
Produces<o2::aod::EMMCEventLabels> mceventlabels;
Produces<o2::aod::EMMCParticles> emmcparticles;
Produces<o2::aod::EMMCGenVectorMesons> emmcgenvms;
Produces<o2::aod::V0LegMCLabels> v0legmclabels;
Produces<o2::aod::EMPrimaryElectronMCLabels> emprimaryelectronmclabels;
Produces<o2::aod::EMPrimaryMuonMCLabels> emprimarymuonmclabels;
Produces<o2::aod::EMDummyDatas> emdummydata;

Configurable<int> n_dummy_loop{"n_dummy_loop", 0, "for loop runs over n times"};
Configurable<float> down_scaling_omega{"down_scaling_omega", 1.1, "down scaling factor to store omega"};
Configurable<float> down_scaling_phi{"down_scaling_phi", 1.1, "down scaling factor to store phi"};
Configurable<float> min_eta_gen_primary{"min_eta_gen_primary", -1.5, "min rapidity Y to store generated information"}; // smearing is applied at analysis stage. set wider value.
Expand Down Expand Up @@ -642,6 +644,19 @@ struct AssociateMCInfoDilepton {
skimmingMC<kPCM>(collisions, bcs, mccollisions, mcTracks, o2tracks, nullptr, v0photons, v0legs, nullptr, nullptr);
}

void processGenDummy(MyCollisionsMC const&)
{
for (int i = 0; i < n_dummy_loop; i++) {
emdummydata(
0.f, 0.f, 0.f, 0.f, 0.f,
0.f, 0.f, 0.f, 0.f, 0.f,
0.f, 0.f, 0.f, 0.f, 0.f,
0.f, 0.f, 0.f, 0.f, 0.f,
0.f, 0.f, 0.f, 0.f, 0.f,
0.f);
}
}

void processDummy(MyCollisionsMC const&) {}

PROCESS_SWITCH(AssociateMCInfoDilepton, processMC_Electron, "create em mc event table for Electron", false);
Expand All @@ -650,6 +665,7 @@ struct AssociateMCInfoDilepton {
PROCESS_SWITCH(AssociateMCInfoDilepton, processMC_Electron_FwdMuon_PCM, "create em mc event table for PCM, Electron, FwdMuon", false);
PROCESS_SWITCH(AssociateMCInfoDilepton, processMC_Electron_PCM, "create em mc event table for PCM, Electron", false);
PROCESS_SWITCH(AssociateMCInfoDilepton, processMC_PCM, "create em mc event table for PCM", false);
PROCESS_SWITCH(AssociateMCInfoDilepton, processGenDummy, "produce dummy data", false);
PROCESS_SWITCH(AssociateMCInfoDilepton, processDummy, "processDummy", true);
};

Expand Down
Loading