Project
Loading...
Searching...
No Matches
LaserTrackFilterSpec.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.
11
14
15#include <algorithm>
16#include <iterator>
17
20#include "Framework/Task.h"
24
25using namespace o2::framework;
26
27namespace o2::tpc
28{
29
31{
32 public:
34 {
35 }
36
38 {
39 const auto tracks = pc.inputs().get<gsl::span<TrackTPC>>("tracks");
40 std::copy_if(tracks.begin(), tracks.end(), std::back_inserter(mLaserTracks),
41 [this](const auto& track) { return isLaserTrackCandidate(track); });
42
43 LOGP(info, "Filtered {} laser track candidates out of {} total tpc tracks", mLaserTracks.size(), tracks.size());
44
45 sendOutput(pc.outputs());
46 }
47
51
52 private:
53 std::vector<TrackTPC> mLaserTracks;
54
55 //________________________________________________________________
56 void sendOutput(DataAllocator& output)
57 {
58 output.snapshot(Output{"TPC", "LASERTRACKS", 0}, mLaserTracks);
59 mLaserTracks.clear();
60 }
61
62 bool isLaserTrackCandidate(const TrackTPC& track)
63 {
64 if (track.getP() < 1) {
65 return false;
66 }
67
68 if (track.getNClusters() < 80) {
69 //return false;
70 }
71
72 if (track.hasBothSidesClusters()) {
73 return false;
74 }
75
76 const auto& parOutLtr = track.getOuterParam();
77 if (parOutLtr.getX() < 220) {
78 return false;
79 }
80
81 const int side = track.hasCSideClusters();
83 return false;
84 }
85
86 return true;
87 }
88};
89
91{
93
94 std::vector<OutputSpec> outputs;
95 outputs.emplace_back("TPC", "LASERTRACKS", 0, o2::framework::Lifetime::Timeframe);
96
97 return DataProcessorSpec{
98 "tpc-laser-track-filter",
99 Inputs{{"tracks", "TPC", "TRACKS", 0}},
100 outputs,
101 AlgorithmSpec{adaptFromTask<device>()},
102 Options{}};
103}
104
105} // namespace o2::tpc
calibration using laser tracks
void output(const std::map< std::string, ChannelStat > &channels)
Definition rawdump.cxx:197
uint32_t side
Definition RawData.h:0
static bool hasNearbyLaserRod(const TrackPar &param, int side)
check if param is closer to a laser rod than 1/4 of a sector width
void init(o2::framework::InitContext &ic) final
void run(o2::framework::ProcessingContext &pc) final
void endOfStream(o2::framework::EndOfStreamContext &ec) final
This is invoked whenever we have an EndOfStream event.
Defining PrimaryVertex explicitly as messageable.
Definition TFIDInfo.h:20
std::vector< ConfigParamSpec > Options
std::vector< InputSpec > Inputs
Global TPC definitions and constants.
Definition SimTraits.h:167
DataProcessorSpec getLaserTrackFilter()