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
5 changes: 5 additions & 0 deletions Common/TableProducer/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,11 @@ o2physics_add_dpl_workflow(mc-converter
PUBLIC_LINK_LIBRARIES
COMPONENT_NAME Analysis)

o2physics_add_dpl_workflow(tracksextra-converter
SOURCES tracksextraConverter.cxx
PUBLIC_LINK_LIBRARIES
COMPONENT_NAME Analysis)

o2physics_add_dpl_workflow(fdd-converter
SOURCES fddConverter.cxx
PUBLIC_LINK_LIBRARIES
Expand Down
70 changes: 70 additions & 0 deletions Common/TableProducer/tracksextraConverter.cxx
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
// 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.
//
// This software is distributed under the terms of the GNU General Public
// License v3 (GPL Version 3), copied verbatim in the file "COPYING".
//
// 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.
#include "Framework/runDataProcessing.h"
#include "Framework/AnalysisTask.h"
#include "Framework/AnalysisDataModel.h"

using namespace o2;
using namespace o2::framework;

// Converts TracksExtra table from version 000 to 001
struct tracksextraConverter {
Produces<aod::StoredTracksExtra_001> tracksExtra_001;
void process(aod::TracksExtra_000 const& tracksExtra_000)
{

// dummy itsClusterSizes, fill with overflows if a hit in the layer is present
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is overflow really the best choice? Not just 1 maybe?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it would be more difficult to distinguish whether this is a dummy entry or not as it is much more probable to have 1-size clusters than > 14-size clusters.


for (auto& track0 : tracksExtra_000) {

uint32_t itsClusterSizes = 0;
for (int layer = 0; layer < 7; layer++) {
if (track0.itsClusterMap() & (1 << layer)) {
itsClusterSizes |= (0xf << (layer * 4));
}
}

tracksExtra_001(track0.tpcInnerParam(),
track0.flags(),
itsClusterSizes,
track0.tpcNClsFindable(),
track0.tpcNClsFindableMinusFound(),
track0.tpcNClsFindableMinusCrossedRows(),
track0.tpcNClsShared(),
track0.trdPattern(),
track0.itsChi2NCl(),
track0.tpcChi2NCl(),
track0.trdChi2(),
track0.tofChi2(),
track0.tpcSignal(),
track0.trdSignal(),
track0.length(),
track0.tofExpMom(),
track0.trackEtaEmcal(),
track0.trackPhiEmcal(),
track0.trackTime(),
track0.trackTimeRes());
}
}
};

struct trackExtraSpawner {
// spawn the extended table for TracksExtra001 to avoid the call to the internal spawner and the circular dependency
Spawns<aod::TracksExtra_001> tracksExtra_001;
};

WorkflowSpec defineDataProcessing(ConfigContext const& cfgc)
{
return WorkflowSpec{
adaptAnalysisTask<tracksextraConverter>(cfgc),
adaptAnalysisTask<trackExtraSpawner>(cfgc),
};
}