Skip to content

Commit bea41ab

Browse files
committed
PWGEM/Dilepton: reduce charged track size
1 parent b0ae6d3 commit bea41ab

File tree

4 files changed

+61
-2
lines changed

4 files changed

+61
-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.signed1Pt(), 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: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
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 "Framework/runDataProcessing.h"
18+
#include "Framework/AnalysisTask.h"
19+
#include "Framework/ASoAHelpers.h"
20+
#include "PWGEM/Dilepton/DataModel/dileptonTables.h"
21+
22+
using namespace o2;
23+
using namespace o2::aod;
24+
using namespace o2::framework;
25+
using namespace o2::framework::expressions;
26+
using namespace o2::soa;
27+
28+
struct trackConverter1 {
29+
Produces<aod::EMPrimaryTracks_001> track_001;
30+
31+
void process(aod::EMPrimaryTracks_000 const& tracks)
32+
{
33+
for (auto& track : tracks) {
34+
track_001(track.collisionId(),
35+
track.trackId(),
36+
track.sign() / track.pt(),
37+
track.eta(),
38+
track.phi(),
39+
track.trackBit());
40+
} // end of track loop
41+
}
42+
};
43+
44+
WorkflowSpec defineDataProcessing(ConfigContext const& cfgc)
45+
{
46+
return WorkflowSpec{adaptAnalysisTask<trackConverter1>(cfgc, TaskName{"track-converter1"})};
47+
}

0 commit comments

Comments
 (0)