Project
Loading...
Searching...
No Matches
testTrackMCH.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#include <boost/test/tools/old/interface.hpp>
13#define BOOST_TEST_MODULE MCH TrackMCH
14#define BOOST_TEST_DYN_LINK
15#include <boost/test/unit_test.hpp>
16#include <boost/test/data/test_case.hpp>
17#include <boost/test/data/monomorphic.hpp>
18
20
21BOOST_AUTO_TEST_CASE(TrackIRMatchesTrackTime)
22{
23 uint16_t bc{10};
24 uint32_t orbit{2000};
25 uint32_t orbitRef = orbit - 120;
27 o2::InteractionRecord irRef{0, orbitRef};
28
30
31 auto bcDiff = ir.differenceInBC(irRef);
32 float tMean = o2::constants::lhc::LHCBunchSpacingMUS * bcDiff;
34 track.setTimeMUS(tMean, tErr);
35
36 o2::InteractionRecord trackIR = track.getMeanIR(orbitRef);
37 BOOST_CHECK_EQUAL(ir, trackIR);
38}
39
40BOOST_AUTO_TEST_CASE(TrackIRMatchesNegativeTrackTime)
41{
42 uint16_t bc{10};
43 uint32_t orbit{2000};
44 uint32_t orbitRef = orbit + 1;
46 o2::InteractionRecord irRef{0, orbitRef};
47
49
50 auto bcDiff = ir.differenceInBC(irRef);
51 float tMean = o2::constants::lhc::LHCBunchSpacingMUS * bcDiff;
53 track.setTimeMUS(tMean, tErr);
54
55 o2::InteractionRecord trackIR = track.getMeanIR(orbitRef);
56 BOOST_CHECK_EQUAL(ir, trackIR);
57}
uint64_t orbit
Definition RawEventData.h:6
uint64_t bc
Definition RawEventData.h:5
Definition of the MCH track.
MCH track external format.
Definition TrackMCH.h:34
void setTimeMUS(const Time &t)
Definition TrackMCH.h:117
InteractionRecord getMeanIR(uint32_t refOrbit) const
interaction record corresponding to the mean track time
Definition TrackMCH.cxx:91
constexpr double LHCBunchSpacingMUS
int64_t differenceInBC(const InteractionRecord &other) const
BOOST_AUTO_TEST_CASE(TrackIRMatchesTrackTime)
o2::InteractionRecord ir(0, 0)
BOOST_CHECK_EQUAL(triggersD.size(), triggers.size())