Project
Loading...
Searching...
No Matches
testTPCDigitContainerReset.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#define BOOST_TEST_MODULE Test TPC DigitContainer reset
16#define BOOST_TEST_MAIN
17#define BOOST_TEST_DYN_LINK
18#include <boost/test/unit_test.hpp>
19#include <vector>
20#include <fmt/format.h>
25
26namespace o2::tpc
27{
28
29// A sector whose last time bins lie beyond the timeframe limit must not pass their labels to the next sector
30BOOST_AUTO_TEST_CASE(DigitContainer_noLabelCarryOver)
31{
32 auto& cdb = CDBInterface::instance();
33 cdb.setUseDefaults();
34 // limit the flush to one orbit (time bin 447) and propagate the ADC values unchanged
35 o2::conf::ConfigurableParam::updateFromString(fmt::format("DigiParams.maxOrbitsToDigitize=1;TPCEleParam.DigiMode={}", (int)DigitzationMode::PropagateADC));
36 const Mapper& mapper = Mapper::instance();
38
39 const GlobalPadNumber globalPad = mapper.getPadNumberInROC(PadROCPos(CRU(0).roc(), PadPos(10, 10)));
40 const MCCompLabel labelFirst(1, 1, 0, false);
41 const MCCompLabel labelSecond(2, 2, 0, false);
42
43 DigitContainer digitContainer;
44 digitContainer.reset();
45
46 // first sector: a signal beyond the timeframe limit, which the final flush does not reach
47 digitContainer.addDigit(labelFirst, CRU(0), 600, globalPad, 100);
48 std::vector<Digit> digits;
50 std::vector<CommonMode> commonMode;
51 digitContainer.fillOutputContainer(digits, labels, commonMode, Sector(0), 0, true, true);
52 BOOST_CHECK(digits.empty());
53
54 // second sector, as after Digitizer::setSector(): same pad, early time bin
55 digitContainer.reset();
56 digits.clear();
57 labels.clear();
58 commonMode.clear();
59 digitContainer.addDigit(labelSecond, CRU(10), 153, globalPad, 100);
60 digitContainer.fillOutputContainer(digits, labels, commonMode, Sector(1), 0, true, true);
61
62 BOOST_REQUIRE(digits.size() == 1);
63 const auto digitLabels = labels.getLabels(0);
64 BOOST_CHECK_EQUAL(digitLabels.size(), 1);
65 for (const auto& label : digitLabels) {
66 BOOST_CHECK(label == labelSecond);
67 }
68}
69
70} // namespace o2::tpc
Simple interface to the CDB manager.
Definition of the TPC Digit.
Definition of the Digit Container.
std::vector< o2::MCCompLabel > labels
uint32_t roc
Definition RawData.h:3
Definition of the SAMPA response.
static void updateFromString(std::string const &)
static CDBInterface & instance()
void fillOutputContainer(std::vector< Digit > &output, dataformats::MCTruthContainer< MCCompLabel > &mcTruth, std::vector< CommonMode > &commonModeOutput, const Sector &sector, TimeBin eventTimeBin=0, bool isContinuous=true, bool finalFlush=false)
void reset()
Reset the container.
void addDigit(const MCCompLabel &label, const CRU &cru, TimeBin timeBin, GlobalPadNumber globalPad, float signal)
static Mapper & instance(const std::string mappingDir="")
Definition Mapper.h:44
GlobalPadNumber getPadNumberInROC(const PadROCPos &rocPadPosition) const
Definition Mapper.h:96
Pad and row inside a ROC.
Definition PadROCPos.h:37
static SAMPAProcessing & instance()
GLuint GLsizei const GLchar * label
Definition glcorearb.h:2519
Global TPC definitions and constants.
BOOST_AUTO_TEST_CASE(ClusterHardware_test1)
@ PropagateADC
Just propagate the bare ADC value.
unsigned short GlobalPadNumber
global pad number
Definition Defs.h:114
BOOST_CHECK(tree)
BOOST_CHECK_EQUAL(triggersD.size(), triggers.size())
std::vector< Digit > digits