Project
Loading...
Searching...
No Matches
o2SimpleTracksAnalysis.cxx
Go to the documentation of this file.
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.
16
17#include <ROOT/RDataFrame.hxx>
18
19#include <cmath>
20
21using namespace ROOT::RDF;
22using namespace o2;
23using namespace o2::framework;
24
25namespace o2::aod
26{
27namespace tracks
28{
29DECLARE_SOA_COLUMN(Eta, eta, float);
30DECLARE_SOA_COLUMN(Phi, phi, float);
31} // namespace tracks
32
34} // namespace o2::aod
35
36// A dummy workflow which creates a few of the tables proposed by Ruben,
37// using ARROW
39{
40 // Workflow definition. A workflow can be one or more DataProcessors
41 // each implementing (part of) an analysis. Each DataProcessor has
42 // (at least) a name, some Inputs, some Outputs and they get arranged
43 // together accordingly.
44 WorkflowSpec workflow{
45 // Multiple DataProcessor specs
46 // can be provided per workflow
48 // The name of my analysis
49 "tracks-analysis",
50 Inputs{
51 // Dangling inputs of type AOD will be automatically picked up by DPL
52 // and an extra reader device will be instanciated to read them from
53 // file. In this particular case the signature AOD/TRACKPAR is
54 // associated to the basic trajectory parameters for a track described
55 // in Ruben's table. The first string is just a label so that the
56 // algorithm can be in principle be reused for different kind of
57 // tracks.
58 InputSpec{"Tracks", "DYN", "TRACKPAR"},
59 InputSpec{"TracksExtension", "AOD", "TRACKPAR"}},
60 // No outputs for the time being.
61 Outputs{
62 OutputSpec{{"derived"}, "AOD", "TRACKDERIVED"}},
64 // This is the actual per "message" loop, where a message could
65 // be the contents of a file or part of it.
66 // FIXME: Too much boilerplate.
67 adaptStateless([](InputRecord& inputs, DataAllocator& outputs) {
69 auto input1 = inputs.get<TableConsumer>("Tracks");
70 auto input2 = inputs.get<TableConsumer>("TracksExtension");
72 auto etaPhiBuilder = outputs.make<TableBuilder>(Output{"AOD", "TRACKDERIVED"});
73 auto etaPhiWriter = etaPhiBuilder->cursor<o2::aod::TracksDerived>();
74
75 auto tracks = aod::Tracks({input1->asArrowTable(), input2->asArrowTable()});
76
77 for (auto& track : tracks) {
78 auto phi = asin(track.snp()) + track.alpha() + M_PI;
79 auto eta = log(tan(0.25 * M_PI - 0.5 * atan(track.tgl())));
80 etaPhiWriter(0, eta, phi);
81 }
82 })}},
84 "phi-consumer",
85 Inputs{
86 InputSpec{"etaphi", "AOD", "TRACKDERIVED"}},
87 Outputs{},
89 adaptStateless([](InputRecord& inputs) {
90 auto input = inputs.get<TableConsumer>("etaphi");
92
93 auto h = tracks.Histo1D("fPhi");
94
95 TFile f("result1.root", "RECREATE");
96 h->SetName("Phi");
97 h->Write();
98 })}},
100 "eta-consumer",
101 Inputs{
102 InputSpec{"etaphi", "AOD", "TRACKDERIVED"}},
103 Outputs{},
105 adaptStateless([](InputRecord& inputs) {
106 auto input = inputs.get<TableConsumer>("etaphi");
108
109 auto h2 = tracks.Histo1D("fEta");
110
111 TFile f("result2.root", "RECREATE");
112 h2->SetName("Eta");
113 h2->Write();
114 })}}};
115 return workflow;
116}
#define DECLARE_SOA_COLUMN(_Name_, _Getter_, _Type_)
Definition ASoA.h:2440
configStandalone Reconstruction rec_tpc multiplier for the combined cluster track error during track following area in cm for the search of for z only used if decrease removal by when above this local occupancy rowx Shift of TPC revert cluster flag edge bit distance to edge exceeds this ZOffset for secondary multiple of radius max P of electron K BB bands crossing max P of electron p BB bands crossing max P of electron d BB bands crossing max P of electron t BB bands crossing min accepted dEdxMaxTPC of the track Additive extra cluster error for Y2 if edge flag set Additive extra cluster error for Y2 if single set Additive extra cluster error for Y2 if or single set Additive extra cluster error for Z2 if or single set Extra errors to add to track when crossing depending on addErrorsCECrossing Inner portion of y range in sector that is not used in searching for extrapolated track candidates factor2YS for track merging factor2K for track merging Margin in cm of Y position when rejecting edge clusters based on uncorrected track Y Max fraction of shared clusters for tracklet Except pad from cluster finding if total number of charges in a fragment is above this Except pad from cluster finding if number of consecutive charges in a fragment is above this Threshold where a timebin is considered disabling the noisy pad check for that pad Treat signal above this minimum as saturated Smoothing factor for the exponential Highly Ionising Particle tail filter Number of timebins to use for the averaging Add additional custom track errors when crossing relative as fraction of Do N fit passes in final fit of< 0:reject at max -n hits") AddOptionRTC(rejectIFCLowRadiusCluster, uint8_t, 1, "", 0, "Reject clusters that get the IFC mask error during refit") AddOptionRTC(dEdxTruncLow, uint8_t, 2, "", 0, "Low truncation threshold, fraction of 128") AddOptionRTC(dEdxTruncHigh, uint8_t, 77, "", 0, "High truncation threshold, fraction of 128") AddOptionRTC(extrapolationTracking, int8_t, 1, "", 0, "Enable Extrapolation Tracking(prolong tracks to adjacent sectors to find short segments)") AddOptionRTC(disableRefitAttachment, uint8_t, 0, "", 0, "Bitmask to disable certain attachment steps during refit(1:attachment, 2:propagation, 4:loop following, 8:mirroring)") AddOptionRTC(rejectionStrategy, uint8_t, o2::gpu::GPUSettings::RejectionStrategyA, "", 0, "Enable rejection of TPC clusters for compression(0=no, 1=strategy A, 2=strategy B)") AddOptionRTC(mergeLoopersAfterburner, uint8_t, 1, "", 0, "Run afterburner for additional looper merging") AddOptionRTC(compressionTypeMask, uint8_t, o2::gpu::GPUSettings::CompressionFull, "", 0, "TPC Compression mode bits(1=truncate charge/width LSB, 2=differences, 4=track-model)") AddOptionRTC(compressionSortOrder, uint8_t, o2::gpu::GPUSettings::SortTime, "", 0, "Sort order of TPC compression(0=time, 1=pad, 2=Z-time-pad, 3=Z-pad-time, 4=no sorting(use incoming order))") AddOptionRTC(sigBitsCharge, uint8_t, 4, "", 0, "Number of significant bits for TPC cluster charge in compression mode 1") AddOptionRTC(sigBitsWidth, uint8_t, 3, "", 0, "Number of significant bits for TPC cluster width in compression mode 1") AddOptionRTC(dropLoopers, uint8_t, 0, "", 0, "Drop looping tracks starting from second loop") AddOptionRTC(mergerInterpolateErrors, uint8_t, 1, "", 0, "Use interpolation instead of extrapolation for chi2 based cluster rejection") AddOptionRTC(mergerInterpolateRejectAlsoOnCurrentPosition, uint8_t, 1, "", 0, "When using mergerInterpolateErrors, reject based on chi2 twice computed with interpolated and current track position starting from NDF > mergerNonInterpolateRejectMinNDF Merge tracks accross the central electrode Enable PID response Add sub threshold clusters in TPC dEdx computation OR mask of TPC flags that will reject the cluster in alternative dEdx Reject edge clusters based on uncorrected track Y during track fit Increase decrease removal by when on this number of pads from the edge h configStandalone Reconstruction rec_trd Max chi2 for TRD tracklets to be matched to a track Chi2 cut for strict matching mode Number of sigmas for ITS TPC track time error estimate Addition to search road around track prolongation along Y in cm Optimal tracklet rphi resolution in tan(phi) dependence of tracklet error due to radial misalignment(centered at 0 angle)") AddOptionRTC(maxChi2Red
std::vector< o2::its::TrackITS > tracks
Class for time synchronization of RawReader instances.
decltype(auto) make(const Output &spec, Args... args)
The input API of the Data Processing Layer This class holds the inputs which are valid for processing...
decltype(auto) get(R binding, int part=0) const
std::shared_ptr< arrow::Table > asArrowTable()
Return the table in the message as a arrow::Table instance.
GLdouble f
Definition glcorearb.h:310
ROOT::RDataFrame doSingleLoopOn(std::unique_ptr< framework::TableConsumer > &input)
Do a single loop on all the entries of the input table.
Defining ITS Vertex explicitly as messageable.
Definition Cartesian.h:288
std::vector< DataProcessorSpec > WorkflowSpec
AlgorithmSpec::ProcessCallback adaptStateless(LAMBDA l)
std::vector< InputSpec > Inputs
std::vector< OutputSpec > Outputs
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...
WorkflowSpec defineDataProcessing(ConfigContext const &specs)
This function hooks up the the workflow specifications into the DPL driver.