Project
Loading...
Searching...
No Matches
testMFTCATrackerDPLContract.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
12#define BOOST_TEST_MODULE MFTCATrackerDPLContract
13#define BOOST_TEST_MAIN
14#define BOOST_TEST_DYN_LINK
15#include <boost/test/unit_test.hpp>
16
17#include <algorithm>
18#include <string>
19
23
24using namespace o2::framework;
25
26namespace
27{
28bool hasInput(const std::vector<InputSpec>& specs, const std::string& binding)
29{
30 return std::any_of(specs.begin(), specs.end(), [&binding](const InputSpec& s) { return s.binding == binding; });
31}
32
33bool hasOutput(const std::vector<OutputSpec>& specs, const std::string& desc)
34{
35 return std::any_of(specs.begin(), specs.end(),
36 [&desc](const OutputSpec& s) { return DataSpecUtils::describe(s).find(desc) != std::string::npos; });
37}
38} // namespace
39
40BOOST_AUTO_TEST_CASE(NonMCContractKeepsTheExistingMFTProducts)
41{
42 const auto spec = o2::mft::getCATrackerSpec({.useMC = false});
43 BOOST_CHECK(hasInput(spec.inputs, "compClusters"));
44 BOOST_CHECK(hasInput(spec.inputs, "patterns"));
45 BOOST_CHECK(hasInput(spec.inputs, "ROframes"));
46 BOOST_CHECK(hasInput(spec.inputs, "cldict"));
47 BOOST_CHECK(hasInput(spec.inputs, "mftTGeo"));
48 BOOST_CHECK(!hasInput(spec.inputs, "labels"));
49 BOOST_CHECK(!hasInput(spec.inputs, "IRFramesITS"));
50
51 BOOST_CHECK(hasOutput(spec.outputs, "TRACKS"));
52 BOOST_CHECK(hasOutput(spec.outputs, "TRACKCLSID"));
53 BOOST_CHECK(hasOutput(spec.outputs, "MFTTrackROF"));
54 BOOST_CHECK(hasOutput(spec.outputs, "TRACKSEEDPAT"));
55 BOOST_CHECK(!hasOutput(spec.outputs, "TRACKSMCTR"));
56}
57
58BOOST_AUTO_TEST_CASE(MCAndIRFrameContractRemainOptional)
59{
60 const auto spec = o2::mft::getCATrackerSpec({.useMC = true, .irFrames = o2::mft::ca::IRFrameSource::Upstream});
61 BOOST_CHECK(hasInput(spec.inputs, "labels"));
62 BOOST_CHECK(hasInput(spec.inputs, "IRFramesITS"));
63 BOOST_CHECK(hasOutput(spec.outputs, "TRACKSMCTR"));
64}
65
66BOOST_AUTO_TEST_CASE(DeviceNameIsStableForWriterAssessmentAndAlignmentConsumers)
67{
68 const auto spec = o2::mft::getCATrackerSpec({.useMC = false, .geometry = o2::mft::ca::GeometrySource::Full});
69 BOOST_CHECK_EQUAL(spec.name, "mft-ca-tracker");
70 BOOST_CHECK(!hasInput(spec.inputs, "mftTGeo"));
71}
std::string binding
Timeframe settings Average distance in cm of events merged into Randomize distance around average distance of merged events Simulate correct bunch interactions instead of placing only the average number of events A value[n] sets TFlen for[n] collisions in Number of bunches per trainsort Number of bunch trains Instantaneous interaction rate Do not simulate border Total number of collisions to be placed in the interior of all time Do not select random but walk over array of events in stride steps h Event generator settings h configStandalone Use CPU for GPU Force usage of the specified GPU device no CPU fallback Continue processing after an error s
Defining ITS Vertex explicitly as messageable.
Definition Cartesian.h:288
o2::framework::DataProcessorSpec getCATrackerSpec(const ca::TrackerOptions &options)
BOOST_AUTO_TEST_CASE(NonMCContractKeepsTheExistingMFTProducts)
BOOST_CHECK(tree)
BOOST_CHECK_EQUAL(triggersD.size(), triggers.size())