Skip to content

Commit fcef305

Browse files
authored
[PWGEM/Dilepton] support RCT flag (#10841)
1 parent afffef2 commit fcef305

File tree

8 files changed

+42
-21
lines changed

8 files changed

+42
-21
lines changed

PWGEM/Dilepton/DataModel/dileptonTables.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -144,17 +144,17 @@ DECLARE_SOA_DYNAMIC_COLUMN(EP4BNeg, ep4bneg, [](float q4x, float q4y) -> float {
144144
DECLARE_SOA_DYNAMIC_COLUMN(EP4BTot, ep4btot, [](float q4x, float q4y) -> float { return std::atan2(q4y, q4x) / 4.0; });
145145
} // namespace emevent
146146

147-
DECLARE_SOA_TABLE(EMEvents_000, "AOD", "EMEVENT", //! Main event information table
148-
o2::soa::Index<>, emevent::CollisionId, bc::RunNumber, bc::GlobalBC, evsel::Alias, evsel::Selection, timestamp::Timestamp,
149-
collision::PosX, collision::PosY, collision::PosZ,
150-
collision::NumContrib, evsel::NumTracksInTimeRange, emevent::Sel8<evsel::Selection>);
151-
152147
DECLARE_SOA_TABLE_VERSIONED(EMEvents_001, "AOD", "EMEVENT", 1, //! Main event information table
153148
o2::soa::Index<>, emevent::CollisionId, bc::RunNumber, bc::GlobalBC, evsel::Alias, evsel::Selection, timestamp::Timestamp,
154149
collision::PosX, collision::PosY, collision::PosZ,
155150
collision::NumContrib, evsel::NumTracksInTimeRange, evsel::SumAmpFT0CInTimeRange, emevent::Sel8<evsel::Selection>);
156151

157-
using EMEvents = EMEvents_001;
152+
DECLARE_SOA_TABLE_VERSIONED(EMEvents_002, "AOD", "EMEVENT", 2, //! Main event information table
153+
o2::soa::Index<>, emevent::CollisionId, bc::RunNumber, bc::GlobalBC, evsel::Alias, evsel::Selection, evsel::Rct, timestamp::Timestamp,
154+
collision::PosX, collision::PosY, collision::PosZ,
155+
collision::NumContrib, evsel::NumTracksInTimeRange, evsel::SumAmpFT0CInTimeRange, emevent::Sel8<evsel::Selection>);
156+
157+
using EMEvents = EMEvents_002;
158158
using EMEvent = EMEvents::iterator;
159159

160160
DECLARE_SOA_TABLE(EMEventsCov, "AOD", "EMEVENTCOV", //! joinable to EMEvents

PWGEM/Dilepton/TableProducer/createEMEventDilepton.cxx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ struct CreateEMEventDilepton {
182182

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

185-
event(collision.globalIndex(), bc.runNumber(), bc.globalBC(), collision.alias_raw(), collision.selection_raw(), bc.timestamp(),
185+
event(collision.globalIndex(), bc.runNumber(), bc.globalBC(), collision.alias_raw(), collision.selection_raw(), collision.rct_raw(), bc.timestamp(),
186186
collision.posX(), collision.posY(), collision.posZ(),
187187
collision.numContrib(), collision.trackOccupancyInTimeRange(), collision.ft0cOccupancyInTimeRange());
188188

PWGEM/Dilepton/TableProducer/eventSelection.cxx

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,16 +14,19 @@
1414
// This code produces event selection table for PWG-EM.
1515
// Please write to: daiki.sekihata@cern.ch
1616

17+
#include <string>
1718
#include "Framework/runDataProcessing.h"
1819
#include "Framework/AnalysisTask.h"
1920
#include "Framework/AnalysisDataModel.h"
2021
#include "Framework/ASoAHelpers.h"
22+
#include "Common/CCDB/RCTSelectionFlags.h"
2123
#include "PWGEM/Dilepton/DataModel/dileptonTables.h"
2224

2325
using namespace o2;
2426
using namespace o2::framework;
2527
using namespace o2::framework::expressions;
2628
using namespace o2::soa;
29+
// using namespace o2::aod::rctsel;
2730

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

48+
// Configurable<std::vector<RCTSelectionFlags>> cfgRCTFlags{"cfgRCTFlags", std::vector<RCTSelectionFlags>{kFT0Bad, kITSBad, kTPCBadTracking, kTPCBadPID, kTOFBad}, "see O2Physics/Common/CCDB/RCTSelectionFlags.h for bit information"};
49+
50+
Configurable<float> cfgZvtxMin{"cfgZvtxMin", -1e+10, "min. Zvtx"};
4251
Configurable<float> cfgZvtxMax{"cfgZvtxMax", 1e+10, "max. Zvtx"};
4352
Configurable<bool> cfgRequireSel8{"cfgRequireSel8", false, "require sel8 in event cut"};
4453
Configurable<bool> cfgRequireFT0AND{"cfgRequireFT0AND", false, "require FT0AND in event cut"};
@@ -52,7 +61,13 @@ struct EMEventSelection {
5261
Configurable<float> cfgFT0COccupancyMax{"cfgFT0COccupancyMax", 1000000000, "max. occupancy"};
5362
Configurable<bool> cfgRequireNoCollInTimeRangeStandard{"cfgRequireNoCollInTimeRangeStandard", false, "require no collision in time range standard"};
5463

55-
void init(InitContext&) {}
64+
o2::aod::rctsel::RCTFlagsChecker rctChecker;
65+
66+
void init(InitContext&)
67+
{
68+
// rctChecker = o2::aod::rctsel::RCTFlagsChecker(cfgRCTLabel.value, cfgCheckZDC.value, cfgTreatLimitedAcceptanceAsBad.value);
69+
rctChecker.init(cfgRCTLabel.value, cfgCheckZDC.value, cfgTreatLimitedAcceptanceAsBad.value);
70+
}
5671

5772
template <typename TCollision>
5873
bool isSelectedEvent(TCollision const& collision)
@@ -63,7 +78,7 @@ struct EMEventSelection {
6378
}
6479
}
6580

66-
if (std::fabs(collision.posZ()) > cfgZvtxMax) {
81+
if (collision.posZ() < cfgZvtxMin || cfgZvtxMax < collision.posZ()) {
6782
return false;
6883
}
6984

@@ -106,6 +121,11 @@ struct EMEventSelection {
106121
}
107122
}
108123

124+
if (!rctChecker.checkTable(collision)) {
125+
// LOGF(info, "rejected by RCT flag");
126+
return false;
127+
}
128+
109129
return true;
110130
}
111131

PWGEM/Dilepton/TableProducer/filterDielectronEvent.cxx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1565,7 +1565,7 @@ struct createEMEvent2VP {
15651565

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

1568-
event(collision.globalIndex(), bc.runNumber(), bc.globalBC(), collision.alias_raw(), collision.selection_raw(), bc.timestamp(),
1568+
event(collision.globalIndex(), bc.runNumber(), bc.globalBC(), collision.alias_raw(), collision.selection_raw(), collision.rct_raw(), bc.timestamp(),
15691569
collision.posX(), collision.posY(), collision.posZ(),
15701570
collision.numContrib(), collision.trackOccupancyInTimeRange(), collision.ft0cOccupancyInTimeRange());
15711571

PWGEM/Dilepton/TableProducer/skimmerSecondaryElectron.cxx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -383,7 +383,7 @@ struct skimmerSecondaryElectron {
383383
continue;
384384
}
385385

386-
event(collision.globalIndex(), bc.runNumber(), bc.globalBC(), collision.alias_raw(), collision.selection_raw(), bc.timestamp(),
386+
event(collision.globalIndex(), bc.runNumber(), bc.globalBC(), collision.alias_raw(), collision.selection_raw(), collision.rct_raw(), bc.timestamp(),
387387
collision.posX(), collision.posY(), collision.posZ(),
388388
collision.numContrib(), collision.trackOccupancyInTimeRange(), collision.ft0cOccupancyInTimeRange());
389389
event_mult(collision.multFT0A(), collision.multFT0C(), collision.multNTracksPV(), collision.multNTracksPVeta1(), collision.multNTracksPVetaHalf());
@@ -444,7 +444,7 @@ struct skimmerSecondaryElectron {
444444
continue;
445445
}
446446

447-
event(collision.globalIndex(), bc.runNumber(), bc.globalBC(), collision.alias_raw(), collision.selection_raw(), bc.timestamp(),
447+
event(collision.globalIndex(), bc.runNumber(), bc.globalBC(), collision.alias_raw(), collision.selection_raw(), collision.rct_raw(), bc.timestamp(),
448448
collision.posX(), collision.posY(), collision.posZ(),
449449
collision.numContrib(), collision.trackOccupancyInTimeRange(), collision.ft0cOccupancyInTimeRange());
450450
event_mult(collision.multFT0A(), collision.multFT0C(), collision.multNTracksPV(), collision.multNTracksPVeta1(), collision.multNTracksPVetaHalf());

PWGEM/Dilepton/Tasks/Converters/CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@
1010
# or submit itself to any jurisdiction.
1111

1212

13-
o2physics_add_dpl_workflow(event-converter1
14-
SOURCES eventConverter1.cxx
13+
o2physics_add_dpl_workflow(event-converter2
14+
SOURCES eventConverter2.cxx
1515
PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore
1616
COMPONENT_NAME Analysis)
1717

PWGEM/Dilepton/Tasks/Converters/eventConverter1.cxx renamed to PWGEM/Dilepton/Tasks/Converters/eventConverter2.cxx

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,30 +25,31 @@ using namespace o2::framework;
2525
using namespace o2::framework::expressions;
2626
using namespace o2::soa;
2727

28-
struct eventConverter1 {
29-
Produces<aod::EMEvents_001> event_001;
28+
struct eventConverter2 {
29+
Produces<aod::EMEvents_002> event_002;
3030

31-
void process(aod::EMEvents_000 const& collisions)
31+
void process(aod::EMEvents_001 const& collisions)
3232
{
3333
for (auto& collision : collisions) {
34-
event_001(
34+
event_002(
3535
collision.globalIndex(),
3636
collision.runNumber(),
3737
collision.globalBC(),
3838
collision.alias_raw(),
3939
collision.selection_raw(),
40+
0,
4041
collision.timestamp(),
4142
collision.posX(),
4243
collision.posY(),
4344
collision.posZ(),
4445
collision.numContrib(),
4546
collision.trackOccupancyInTimeRange(),
46-
-1.f);
47+
collision.ft0cOccupancyInTimeRange());
4748
} // end of collision loop
4849
}
4950
};
5051

5152
WorkflowSpec defineDataProcessing(ConfigContext const& cfgc)
5253
{
53-
return WorkflowSpec{adaptAnalysisTask<eventConverter1>(cfgc, TaskName{"event-converter1"})};
54+
return WorkflowSpec{adaptAnalysisTask<eventConverter2>(cfgc, TaskName{"event-converter2"})};
5455
}

PWGEM/PhotonMeson/TableProducer/createEMEventPhoton.cxx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ struct CreateEMEventPhoton {
160160
registry.fill(HIST("hEventCounter"), 2);
161161
}
162162

163-
event(collision.globalIndex(), bc.runNumber(), bc.globalBC(), collision.alias_raw(), collision.selection_raw(), bc.timestamp(),
163+
event(collision.globalIndex(), bc.runNumber(), bc.globalBC(), collision.alias_raw(), collision.selection_raw(), collision.rct_raw(), bc.timestamp(),
164164
collision.posX(), collision.posY(), collision.posZ(),
165165
collision.numContrib(), collision.trackOccupancyInTimeRange(), collision.ft0cOccupancyInTimeRange());
166166

0 commit comments

Comments
 (0)