Project
Loading...
Searching...
No Matches
testNumberOfPadsPerFeeId.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 MCHRaw NofPadsPerFeeId
13#define BOOST_TEST_MAIN
14#define BOOST_TEST_DYN_LINK
15
16#include <boost/test/unit_test.hpp>
20#include <iostream>
21#include <vector>
22
23using namespace o2::mch::raw;
24
25int nofPadsPerFeeId(uint16_t feeid)
26{
27 int npads{0};
30 for (auto solar : solars) {
31 auto dualSampas = getDualSampas<ElectronicMapperGenerated>(solar);
32 for (auto ds : dualSampas) {
34 for (auto channel = 0; channel < 64; channel++) {
35 auto paduid = seg.findPadByFEE(ds.dsId(), channel);
36 if (seg.isValid(paduid)) {
37 npads++;
38 }
39 }
40 }
41 }
42 return npads;
43}
44
45BOOST_AUTO_TEST_CASE(NumberOfPadsPerFeeId)
46{
57
66
69
80
91
102
113
118
120}
121
122BOOST_AUTO_TEST_CASE(TotalNumberOfPads)
123{
124 int npads{0};
125 for (auto feeid = 0; feeid < 64; feeid++) {
126 npads += nofPadsPerFeeId(feeid);
127 }
128#ifdef MCH_MAPPING_RUN3_AND_ABOVE
129 BOOST_CHECK_EQUAL(npads, 1063528);
130#else
131 BOOST_CHECK_EQUAL(npads, 1064008);
132#endif
133}
o2::mch::mapping::CathodeSegmentation seg
int findPadByFEE(int dualSampaId, int dualSampaChannel) const
bool isValid(int catPadIndex) const
Not every integer is a valid catPadIndex. This method will tell if catPadIndex is a valid one.
A Segmentation lets you find pads of a detection element and then inspect those pads.
O2MCHMAPPINGIMPL3_EXPORT const Segmentation & segmentation(int detElemId)
std::set< uint16_t > getSolarUIDsPerFeeId< ElectronicMapperGenerated >(uint16_t feeid)
std::function< std::optional< uint16_t >(FeeLinkId)> createFeeLink2SolarMapper< ElectronicMapperGenerated >()
std::set< DsDetId > getDualSampas< ElectronicMapperGenerated >(uint16_t solarId)
BOOST_AUTO_TEST_CASE(FlatHisto)
int nofPadsPerFeeId(uint16_t feeid)
o2::mch::DsIndex ds
BOOST_CHECK_EQUAL(triggersD.size(), triggers.size())