Skip to content

Commit 1eb3b41

Browse files
dsekihatalibuild
andauthored
[PWGEM/Dilepton] reduce charged track size (#12497)
Co-authored-by: ALICE Action Bot <alibuild@cern.ch>
1 parent da7b964 commit 1eb3b41

File tree

4 files changed

+62
-2
lines changed

4 files changed

+62
-2
lines changed

PWGEM/Dilepton/DataModel/dileptonTables.h

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -769,12 +769,19 @@ DECLARE_SOA_COLUMN(CollisionId, collisionId, int); //!
769769
DECLARE_SOA_COLUMN(TrackId, trackId, int); //!
770770
DECLARE_SOA_COLUMN(Sign, sign, int8_t); //!
771771
DECLARE_SOA_COLUMN(TrackBit, trackBit, uint16_t); //!
772+
DECLARE_SOA_DYNAMIC_COLUMN(Pt, pt, [](float signed1Pt) -> float { return 1.f / std::fabs(signed1Pt); });
772773
} // namespace emprimarytrack
773774

774775
DECLARE_SOA_TABLE_VERSIONED(EMPrimaryTracks_000, "AOD", "EMPRIMARYTRACK", 0, //! primary charged track table for 2PC
775776
o2::soa::Index<>, emprimarytrack::CollisionId, emprimarytrack::TrackId, emprimarytrack::Sign, track::Pt, track::Eta, track::Phi, emprimarytrack::TrackBit);
776777

777-
using EMPrimaryTracks = EMPrimaryTracks_000;
778+
DECLARE_SOA_TABLE_VERSIONED(EMPrimaryTracks_001, "AOD", "EMPRIMARYTRACK", 1, //! primary charged track table for 2PC
779+
o2::soa::Index<>, emprimarytrack::CollisionId, emprimarytrack::TrackId,
780+
track::Signed1Pt, track::Eta, track::Phi, emprimarytrack::TrackBit,
781+
// dynamic column
782+
track::Sign<track::Signed1Pt>, emprimarytrack::Pt<track::Signed1Pt>);
783+
784+
using EMPrimaryTracks = EMPrimaryTracks_001;
778785
// iterators
779786
using EMPrimaryTrack = EMPrimaryTracks::iterator;
780787

PWGEM/Dilepton/TableProducer/skimmerPrimaryTrack.cxx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -331,7 +331,7 @@ struct skimmerPrimaryTrack {
331331
trackBit |= static_cast<uint16_t>(RefTrackBit::kDCAxy03cm);
332332
}
333333

334-
emprimarytracks(collision.globalIndex(), track.globalIndex(), track.sign(), pt, eta, phi, trackBit);
334+
emprimarytracks(collision.globalIndex(), track.globalIndex(), track.sign() / pt, eta, phi, trackBit);
335335
// prmtrackeventidtmp(collision.globalIndex());
336336

337337
stored_trackIds.emplace_back(std::pair<int, int>{collision.globalIndex(), track.globalIndex()});

PWGEM/Dilepton/Tasks/Converters/CMakeLists.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,3 +35,8 @@ o2physics_add_dpl_workflow(electron-converter4
3535
PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore
3636
COMPONENT_NAME Analysis)
3737

38+
o2physics_add_dpl_workflow(track-converter1
39+
SOURCES trackConverter1.cxx
40+
PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore
41+
COMPONENT_NAME Analysis)
42+
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
// Copyright 2019-2020 CERN and copyright holders of ALICE O2.
2+
// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
3+
// All rights not expressly granted are reserved.
4+
//
5+
// This software is distributed under the terms of the GNU General Public
6+
// License v3 (GPL Version 3), copied verbatim in the file "COPYING".
7+
//
8+
// In applying this license CERN does not waive the privileges and immunities
9+
// granted to it by virtue of its status as an Intergovernmental Organization
10+
// or submit itself to any jurisdiction.
11+
//
12+
// ========================
13+
//
14+
// This code runs loop over ULS ee pars for virtual photon QC.
15+
// Please write to: daiki.sekihata@cern.ch
16+
17+
#include "PWGEM/Dilepton/DataModel/dileptonTables.h"
18+
19+
#include "Framework/ASoAHelpers.h"
20+
#include "Framework/AnalysisTask.h"
21+
#include "Framework/runDataProcessing.h"
22+
23+
using namespace o2;
24+
using namespace o2::aod;
25+
using namespace o2::framework;
26+
using namespace o2::framework::expressions;
27+
using namespace o2::soa;
28+
29+
struct trackConverter1 {
30+
Produces<aod::EMPrimaryTracks_001> track_001;
31+
32+
void process(aod::EMPrimaryTracks_000 const& tracks)
33+
{
34+
for (auto& track : tracks) {
35+
track_001(track.collisionId(),
36+
track.trackId(),
37+
track.sign() / track.pt(),
38+
track.eta(),
39+
track.phi(),
40+
track.trackBit());
41+
} // end of track loop
42+
}
43+
};
44+
45+
WorkflowSpec defineDataProcessing(ConfigContext const& cfgc)
46+
{
47+
return WorkflowSpec{adaptAnalysisTask<trackConverter1>(cfgc, TaskName{"track-converter1"})};
48+
}

0 commit comments

Comments
 (0)