Project
Loading...
Searching...
No Matches
testLTOFIntegration.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 Test TrackLTIntegral class
13#define BOOST_TEST_MAIN
14#define BOOST_TEST_DYN_LINK
15#include <boost/test/unit_test.hpp>
20
21namespace o2
22{
23
24// L,ToF container update test
25BOOST_AUTO_TEST_CASE(TrackLTIntegral)
26{
28 trc.setQ2Pt(2);
29 trc.setSnp(0.1);
30 auto trc1 = trc;
31 trc1.setTgl(0.5);
33 const int nStep = 100;
34 const float dx2x0 = 0.01f;
35 for (int i = 0; i < nStep; i++) {
36 lt.addStep(1., trc.getP2Inv());
37 lt1.addStep(1., trc1.getP2Inv());
38 lt1.addX2X0(dx2x0);
39 }
40 trc.printParam();
41 lt.print();
42 trc1.printParam();
43 lt1.print();
44 float tc = lt.getL() * 1000.f / o2::constants::physics::LightSpeedCm2NS; // fastest time
45 printf("TOF @ speed of light: %7.1f ps\n", tc);
46 for (int i = 1; i < lt.getNTOFs(); i++) {
47 BOOST_CHECK(tc < lt.getTOF(i)); // nothing is faster than the light
48 BOOST_CHECK(lt1.getTOF(i) < lt.getTOF(i)); // higher P track is faster
49 }
50 BOOST_CHECK_CLOSE(lt1.getX2X0(), nStep * dx2x0, 1e-4);
51}
52
53} // namespace o2
particle ids, masses, names class definition
Base track model for the Barrel, params only, w/o covariance.
int32_t i
Header to collect physics constants.
Track Length and TOF integral.
constexpr float LightSpeedCm2NS
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...
BOOST_AUTO_TEST_CASE(FlatHisto)
BOOST_CHECK(tree)