Project
Loading...
Searching...
No Matches
testHitProcessingManager.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 HitProcessingTest class
13#define BOOST_TEST_MAIN
14#define BOOST_TEST_DYN_LINK
15#include <algorithm>
16#include <boost/test/unit_test.hpp>
18#include <TFile.h>
19#include <TTree.h>
20#include <string>
21
22namespace o2
23{
24namespace steer
25{
26
27BOOST_AUTO_TEST_CASE(HitProcessingTest)
28{
29 // make some mockup sim files
30 auto makefile = [](std::string name, int n) {
31 TFile file(name.c_str(), "RECREATE");
32 TTree tree("o2sim", "");
33 tree.SetEntries(n);
34 tree.Write();
35 file.Close();
36 };
37
39 makefile("o2sim_1.root", 4); // 4 background events
40 mgr.addInputFile("o2sim_1.root"); // add background file
41 makefile("o2sim_2.root", 5);
42 mgr.addInputFile("o2sim_2.root"); // add background file
43 makefile("o2sim_s_1.root", 5);
44 mgr.addInputSignalFile("o2sim_s_1.root", 1); // signals of type 1
45 makefile("o2sim_s_2.root", 20);
46 mgr.addInputSignalFile("o2sim_s_2.root", 2); // signals of type 2
47 makefile("o2sim_s_3.root", 13);
48 mgr.addInputSignalFile("o2sim_s_3.root", 1); // signals of type 1
49
50 // setup run (without giving number of collision)
51 mgr.setupRun(100);
52}
53} // namespace steer
54} // namespace o2
static HitProcessingManager & instance()
get access to singleton instance
GLdouble n
Definition glcorearb.h:1982
GLuint const GLchar * name
Definition glcorearb.h:781
BOOST_AUTO_TEST_CASE(HitProcessingTest)
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...
std::unique_ptr< TTree > tree((TTree *) flIn.Get(std::string(o2::base::NameConf::CTFTREENAME).c_str()))