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
12 changes: 6 additions & 6 deletions PWGEM/Dilepton/DataModel/dileptonTables.h
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
// Copyright 2019-2020 CERN and copyright holders of ALICE O2.
// 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 warning 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 warning 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 warning 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 @@ -144,17 +144,17 @@
DECLARE_SOA_DYNAMIC_COLUMN(EP4BTot, ep4btot, [](float q4x, float q4y) -> float { return std::atan2(q4y, q4x) / 4.0; });
} // namespace emevent

DECLARE_SOA_TABLE(EMEvents_000, "AOD", "EMEVENT", //! Main event information table
o2::soa::Index<>, emevent::CollisionId, bc::RunNumber, bc::GlobalBC, evsel::Alias, evsel::Selection, timestamp::Timestamp,
collision::PosX, collision::PosY, collision::PosZ,
collision::NumContrib, evsel::NumTracksInTimeRange, emevent::Sel8<evsel::Selection>);

DECLARE_SOA_TABLE_VERSIONED(EMEvents_001, "AOD", "EMEVENT", 1, //! Main event information table
o2::soa::Index<>, emevent::CollisionId, bc::RunNumber, bc::GlobalBC, evsel::Alias, evsel::Selection, timestamp::Timestamp,
collision::PosX, collision::PosY, collision::PosZ,
collision::NumContrib, evsel::NumTracksInTimeRange, evsel::SumAmpFT0CInTimeRange, emevent::Sel8<evsel::Selection>);

using EMEvents = EMEvents_001;
DECLARE_SOA_TABLE_VERSIONED(EMEvents_002, "AOD", "EMEVENT", 2, //! Main event information table
o2::soa::Index<>, emevent::CollisionId, bc::RunNumber, bc::GlobalBC, evsel::Alias, evsel::Selection, evsel::Rct, timestamp::Timestamp,
collision::PosX, collision::PosY, collision::PosZ,
collision::NumContrib, evsel::NumTracksInTimeRange, evsel::SumAmpFT0CInTimeRange, emevent::Sel8<evsel::Selection>);

using EMEvents = EMEvents_002;
using EMEvent = EMEvents::iterator;

DECLARE_SOA_TABLE(EMEventsCov, "AOD", "EMEVENTCOV", //! joinable to EMEvents
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 warning 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 warning 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 warning 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 warning 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 @@ -567,7 +567,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 warning on line 570 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 @@ -577,7 +577,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 warning on line 580 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
2 changes: 1 addition & 1 deletion PWGEM/Dilepton/TableProducer/createEMEventDilepton.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ struct CreateEMEventDilepton {

registry.fill(HIST("hEventCounter"), 2);

event(collision.globalIndex(), bc.runNumber(), bc.globalBC(), collision.alias_raw(), collision.selection_raw(), bc.timestamp(),
event(collision.globalIndex(), bc.runNumber(), bc.globalBC(), collision.alias_raw(), collision.selection_raw(), collision.rct_raw(), bc.timestamp(),
collision.posX(), collision.posY(), collision.posZ(),
collision.numContrib(), collision.trackOccupancyInTimeRange(), collision.ft0cOccupancyInTimeRange());

Expand Down
24 changes: 22 additions & 2 deletions PWGEM/Dilepton/TableProducer/eventSelection.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,19 @@
// This code produces event selection table for PWG-EM.
// Please write to: daiki.sekihata@cern.ch

#include <string>
#include "Framework/runDataProcessing.h"
#include "Framework/AnalysisTask.h"
#include "Framework/AnalysisDataModel.h"
#include "Framework/ASoAHelpers.h"
#include "Common/CCDB/RCTSelectionFlags.h"
#include "PWGEM/Dilepton/DataModel/dileptonTables.h"

using namespace o2;
using namespace o2::framework;
using namespace o2::framework::expressions;
using namespace o2::soa;
// using namespace o2::aod::rctsel;

using MyCollisions = soa::Join<aod::Collisions, aod::EvSels>;
using MyCollisions_Cent = soa::Join<MyCollisions, aod::Mults, aod::CentFT0Ms, aod::CentFT0As, aod::CentFT0Cs>;
Expand All @@ -38,7 +41,13 @@ struct EMEventSelection {
Configurable<int> cfgCentEstimator{"cfgCentEstimator", 2, "FT0M:0, FT0A:1, FT0C:2"};
Configurable<float> cfgCentMin{"cfgCentMin", -1.f, "min. centrality"};
Configurable<float> cfgCentMax{"cfgCentMax", 999.f, "max. centrality"};
Configurable<std::string> cfgRCTLabel{"cfgRCTLabel", "CBT_hadronPID", "select 1 [CBT, CBT_hadron, CBT_muon_glo] see O2Physics/Common/CCDB/RCTSelectionFlags.h"};
Configurable<bool> cfgCheckZDC{"cfgCheckZDC", false, "set ZDC flag for PbPb"};
Configurable<bool> cfgTreatLimitedAcceptanceAsBad{"cfgTreatLimitedAcceptanceAsBad", false, "reject all events where the detectors relevant for the specified Runlist are flagged as LimitedAcceptance"};

// Configurable<std::vector<RCTSelectionFlags>> cfgRCTFlags{"cfgRCTFlags", std::vector<RCTSelectionFlags>{kFT0Bad, kITSBad, kTPCBadTracking, kTPCBadPID, kTOFBad}, "see O2Physics/Common/CCDB/RCTSelectionFlags.h for bit information"};

Configurable<float> cfgZvtxMin{"cfgZvtxMin", -1e+10, "min. Zvtx"};
Configurable<float> cfgZvtxMax{"cfgZvtxMax", 1e+10, "max. Zvtx"};
Configurable<bool> cfgRequireSel8{"cfgRequireSel8", false, "require sel8 in event cut"};
Configurable<bool> cfgRequireFT0AND{"cfgRequireFT0AND", false, "require FT0AND in event cut"};
Expand All @@ -52,7 +61,13 @@ struct EMEventSelection {
Configurable<float> cfgFT0COccupancyMax{"cfgFT0COccupancyMax", 1000000000, "max. occupancy"};
Configurable<bool> cfgRequireNoCollInTimeRangeStandard{"cfgRequireNoCollInTimeRangeStandard", false, "require no collision in time range standard"};

void init(InitContext&) {}
o2::aod::rctsel::RCTFlagsChecker rctChecker;

void init(InitContext&)
{
// rctChecker = o2::aod::rctsel::RCTFlagsChecker(cfgRCTLabel.value, cfgCheckZDC.value, cfgTreatLimitedAcceptanceAsBad.value);
rctChecker.init(cfgRCTLabel.value, cfgCheckZDC.value, cfgTreatLimitedAcceptanceAsBad.value);
}

template <typename TCollision>
bool isSelectedEvent(TCollision const& collision)
Expand All @@ -63,7 +78,7 @@ struct EMEventSelection {
}
}

if (std::fabs(collision.posZ()) > cfgZvtxMax) {
if (collision.posZ() < cfgZvtxMin || cfgZvtxMax < collision.posZ()) {
return false;
}

Expand Down Expand Up @@ -106,6 +121,11 @@ struct EMEventSelection {
}
}

if (!rctChecker.checkTable(collision)) {
// LOGF(info, "rejected by RCT flag");
return false;
}

return true;
}

Expand Down
2 changes: 1 addition & 1 deletion PWGEM/Dilepton/TableProducer/filterDielectronEvent.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -1565,7 +1565,7 @@ struct createEMEvent2VP {

registry.fill(HIST("hEventCounter"), 1);

event(collision.globalIndex(), bc.runNumber(), bc.globalBC(), collision.alias_raw(), collision.selection_raw(), bc.timestamp(),
event(collision.globalIndex(), bc.runNumber(), bc.globalBC(), collision.alias_raw(), collision.selection_raw(), collision.rct_raw(), bc.timestamp(),
collision.posX(), collision.posY(), collision.posZ(),
collision.numContrib(), collision.trackOccupancyInTimeRange(), collision.ft0cOccupancyInTimeRange());

Expand Down
4 changes: 2 additions & 2 deletions PWGEM/Dilepton/TableProducer/skimmerSecondaryElectron.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -383,7 +383,7 @@ struct skimmerSecondaryElectron {
continue;
}

event(collision.globalIndex(), bc.runNumber(), bc.globalBC(), collision.alias_raw(), collision.selection_raw(), bc.timestamp(),
event(collision.globalIndex(), bc.runNumber(), bc.globalBC(), collision.alias_raw(), collision.selection_raw(), collision.rct_raw(), bc.timestamp(),
collision.posX(), collision.posY(), collision.posZ(),
collision.numContrib(), collision.trackOccupancyInTimeRange(), collision.ft0cOccupancyInTimeRange());
event_mult(collision.multFT0A(), collision.multFT0C(), collision.multNTracksPV(), collision.multNTracksPVeta1(), collision.multNTracksPVetaHalf());
Expand Down Expand Up @@ -444,7 +444,7 @@ struct skimmerSecondaryElectron {
continue;
}

event(collision.globalIndex(), bc.runNumber(), bc.globalBC(), collision.alias_raw(), collision.selection_raw(), bc.timestamp(),
event(collision.globalIndex(), bc.runNumber(), bc.globalBC(), collision.alias_raw(), collision.selection_raw(), collision.rct_raw(), bc.timestamp(),
collision.posX(), collision.posY(), collision.posZ(),
collision.numContrib(), collision.trackOccupancyInTimeRange(), collision.ft0cOccupancyInTimeRange());
event_mult(collision.multFT0A(), collision.multFT0C(), collision.multNTracksPV(), collision.multNTracksPVeta1(), collision.multNTracksPVetaHalf());
Expand Down
4 changes: 2 additions & 2 deletions PWGEM/Dilepton/Tasks/Converters/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
# or submit itself to any jurisdiction.


o2physics_add_dpl_workflow(event-converter1
SOURCES eventConverter1.cxx
o2physics_add_dpl_workflow(event-converter2
SOURCES eventConverter2.cxx
PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore
COMPONENT_NAME Analysis)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,30 +25,31 @@ using namespace o2::framework;
using namespace o2::framework::expressions;
using namespace o2::soa;

struct eventConverter1 {
Produces<aod::EMEvents_001> event_001;
struct eventConverter2 {
Produces<aod::EMEvents_002> event_002;

void process(aod::EMEvents_000 const& collisions)
void process(aod::EMEvents_001 const& collisions)
{
for (auto& collision : collisions) {
event_001(
event_002(
collision.globalIndex(),
collision.runNumber(),
collision.globalBC(),
collision.alias_raw(),
collision.selection_raw(),
0,
collision.timestamp(),
collision.posX(),
collision.posY(),
collision.posZ(),
collision.numContrib(),
collision.trackOccupancyInTimeRange(),
-1.f);
collision.ft0cOccupancyInTimeRange());
} // end of collision loop
}
};

WorkflowSpec defineDataProcessing(ConfigContext const& cfgc)
{
return WorkflowSpec{adaptAnalysisTask<eventConverter1>(cfgc, TaskName{"event-converter1"})};
return WorkflowSpec{adaptAnalysisTask<eventConverter2>(cfgc, TaskName{"event-converter2"})};
}
2 changes: 1 addition & 1 deletion PWGEM/PhotonMeson/TableProducer/createEMEventPhoton.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ struct CreateEMEventPhoton {
registry.fill(HIST("hEventCounter"), 2);
}

event(collision.globalIndex(), bc.runNumber(), bc.globalBC(), collision.alias_raw(), collision.selection_raw(), bc.timestamp(),
event(collision.globalIndex(), bc.runNumber(), bc.globalBC(), collision.alias_raw(), collision.selection_raw(), collision.rct_raw(), bc.timestamp(),
collision.posX(), collision.posY(), collision.posZ(),
collision.numContrib(), collision.trackOccupancyInTimeRange(), collision.ft0cOccupancyInTimeRange());

Expand Down
Loading