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: 34 additions & 7 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,18 +8,20 @@
// 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>
#include "Common/Core/RecoDecay.h"
#include "Framework/AnalysisDataModel.h"
#include "Common/DataModel/PIDResponse.h"
#include "Common/DataModel/Centrality.h"
#include "Common/DataModel/EventSelection.h"
#include "Common/DataModel/TrackSelectionTables.h"
#include "Common/DataModel/Multiplicity.h"
#include "Common/DataModel/Centrality.h"
#include "Common/DataModel/PIDResponse.h"
#include "Common/DataModel/Qvectors.h"
#include "Common/DataModel/TrackSelectionTables.h"

#include "Framework/AnalysisDataModel.h"

#include <string>
#include <unordered_map>
#include <vector>

#ifndef PWGEM_DILEPTON_DATAMODEL_DILEPTONTABLES_H_
#define PWGEM_DILEPTON_DATAMODEL_DILEPTONTABLES_H_
Expand Down Expand Up @@ -395,10 +397,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 400 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 403 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 +415,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 418 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 +430,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 433 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 +570,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 573 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 +580,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 583 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 +643,31 @@
// iterators
using EMGlobalMuonSelfId = EMGlobalMuonSelfIds::iterator;

DECLARE_SOA_TABLE_VERSIONED(EMPrimaryTracks_000, "AOD", "EMPRIMARYTRACK", 0, //!
o2::soa::Index<>, emprimaryelectron::CollisionId,
emprimaryelectron::TrackId, emprimaryelectron::Sign,
track::Pt, track::Eta, track::Phi, track::DcaXY, track::DcaZ,
track::TPCNClsFindable, track::TPCNClsFindableMinusFound, track::TPCNClsFindableMinusCrossedRows, track::TPCNClsShared, track::TPCChi2NCl,
track::ITSClusterSizes, track::ITSChi2NCl, track::DetectorMap,

// dynamic column
track::TPCNClsFound<track::TPCNClsFindable, track::TPCNClsFindableMinusFound>,
track::TPCNClsCrossedRows<track::TPCNClsFindable, track::TPCNClsFindableMinusCrossedRows>,
track::TPCCrossedRowsOverFindableCls<track::TPCNClsFindable, track::TPCNClsFindableMinusCrossedRows>,
track::TPCFoundOverFindableCls<track::TPCNClsFindable, track::TPCNClsFindableMinusFound>,
track::TPCFractionSharedCls<track::TPCNClsShared, track::TPCNClsFindable, track::TPCNClsFindableMinusFound>,
track::v001::ITSClusterMap<track::ITSClusterSizes>, track::v001::ITSNCls<track::ITSClusterSizes>, track::v001::ITSNClsInnerBarrel<track::ITSClusterSizes>,
track::HasITS<track::DetectorMap>, track::HasTPC<track::DetectorMap>, track::HasTRD<track::DetectorMap>, track::HasTOF<track::DetectorMap>,
emprimaryelectron::Signed1Pt<track::Pt, emprimaryelectron::Sign>,
emprimaryelectron::P<track::Pt, track::Eta>,
emprimaryelectron::Px<track::Pt, track::Phi>,
emprimaryelectron::Py<track::Pt, track::Phi>,
emprimaryelectron::Pz<track::Pt, track::Eta>);

using EMPrimaryTracks = EMPrimaryTracks_000;
// iterators
using EMPrimaryTrack = EMPrimaryTracks::iterator;

// Dummy data for MC
namespace emdummydata
{
Expand Down
4 changes: 2 additions & 2 deletions PWGEM/Dilepton/DataModel/lmeeMLTables.h
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ DECLARE_SOA_DYNAMIC_COLUMN(MeanClusterSizeITSob, meanClusterSizeITSob, [](uint32
} // namespace emprimarytrack

// reconstructed track information
DECLARE_SOA_TABLE(EMPrimaryTracks, "AOD", "EMPTRACK", //!
DECLARE_SOA_TABLE(EMMLPrimaryTracks, "AOD", "EMMLPTRACK", //!
o2::soa::Index<>, collision::NumContrib, evsel::NumTracksInTimeRange, evsel::SumAmpFT0CInTimeRange,
track::Pt, track::Eta, track::Phi, track::Tgl, emprimarytrack::Sign,
track::DcaXY, track::DcaZ, track::CYY, track::CZZ, track::CZY,
Expand All @@ -101,7 +101,7 @@ DECLARE_SOA_TABLE(EMPrimaryTracks, "AOD", "EMPTRACK", //!
emprimarytrack::MeanClusterSizeITSob<track::ITSClusterSizes>);

// iterators
using EMPrimaryTrack = EMPrimaryTracks::iterator;
using EMMLPrimaryTrack = EMMLPrimaryTracks::iterator;

} // namespace o2::aod

Expand Down
5 changes: 5 additions & 0 deletions PWGEM/Dilepton/TableProducer/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,11 @@ o2physics_add_dpl_workflow(skimmer-primary-muon
PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore O2::GlobalTracking
COMPONENT_NAME Analysis)

o2physics_add_dpl_workflow(skimmer-primary-track
SOURCES skimmerPrimaryTrack.cxx
PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore
COMPONENT_NAME Analysis)

o2physics_add_dpl_workflow(skimmer-secondary-electron
SOURCES skimmerSecondaryElectron.cxx
PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore
Expand Down
15 changes: 9 additions & 6 deletions PWGEM/Dilepton/TableProducer/filterEoI.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,13 @@
// This code filters events that are interesting for dilepton analyses.
// Please write to: daiki.sekihata@cern.ch

#include "Framework/runDataProcessing.h"
#include "Framework/AnalysisTask.h"
#include "Framework/AnalysisDataModel.h"
#include "Framework/ASoAHelpers.h"
#include "PWGEM/Dilepton/DataModel/dileptonTables.h"

#include "Framework/ASoAHelpers.h"
#include "Framework/AnalysisDataModel.h"
#include "Framework/AnalysisTask.h"
#include "Framework/runDataProcessing.h"

using namespace o2;
using namespace o2::framework;
using namespace o2::framework::expressions;
Expand All @@ -31,6 +32,8 @@ struct filterEoI {
kFwdMuon = 0x2,
};
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"};

HistogramRegistry fRegistry{"output"};
void init(o2::framework::InitContext&)
Expand All @@ -57,14 +60,14 @@ struct filterEoI {

if constexpr (static_cast<bool>(system & kElectron)) {
auto electrons_coll = electrons.sliceBy(perCollision_el, collision.globalIndex());
if (electrons_coll.size() > 0) {
if (electrons_coll.size() >= minNElectrons) {
does_electron_exist = true;
fRegistry.fill(HIST("hEventCounter"), 2);
}
}
if constexpr (static_cast<bool>(system & kFwdMuon)) {
auto muons_coll = muons.sliceBy(perCollision_mu, collision.globalIndex());
if (muons_coll.size() > 0) {
if (muons_coll.size() >= minNMuons) {
does_fwdmuon_exist = true;
fRegistry.fill(HIST("hEventCounter"), 3);
}
Expand Down
2 changes: 1 addition & 1 deletion PWGEM/Dilepton/TableProducer/skimmerPrimaryElectron.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ using MyTrackMC = MyTracksMC::iterator;

struct skimmerPrimaryElectron {
SliceCache cache;
Preslice<aod::Tracks> perCol = o2::aod::track::collisionId;
Preslice<aod::TracksIU> perCol = o2::aod::track::collisionId;
Produces<aod::EMPrimaryElectrons> emprimaryelectrons;
Produces<aod::EMPrimaryElectronsCov> emprimaryelectronscov;

Expand Down
Loading
Loading