Belle II Software development
CDCCrossTalkClasses.h
1/**************************************************************************
2 * basf2 (Belle II Analysis Software Framework) *
3 * Author: The Belle II Collaboration *
4 * *
5 * See git log for contributors and copyright holders. *
6 * This file is licensed under LGPL-3.0, see LICENSE.md. *
7 **************************************************************************/
8#pragma once
9
10// Convenience classes used by CDCCrossTalkLibrary DB object
11
12using std::array;
13
14namespace Belle2 {
21 struct asicChannel {
22 Short_t TDC;
23 Short_t ADC;
24 Short_t TOT;
25 };
26
28 typedef array<asicChannel, 8> asicChannels;
29
32 Short_t ADC;
33 Short_t Channel;
34 };
35
37 struct adcAsicTuple {
38 Short_t ADC;
39 Short_t Channel;
41 };
42
43
45 struct adc_search {
47 bool operator()(const adcAsicTuple& lhs, const adcAsicTuple& rhs)
48 {
49 if (lhs.Channel == rhs.Channel) {
50 return lhs.ADC < rhs.ADC;
51 } else {
52 return lhs.Channel < rhs.Channel;
53 }
54 }
55
57 bool operator()(const adcChannelPair& lhs, const adcAsicTuple& rhs)
58 {
59 if (lhs.Channel == rhs.Channel) {
60 return lhs.ADC < rhs.ADC;
61 } else {
62 return lhs.Channel < rhs.Channel;
63 }
64 }
65
67 bool operator()(const adcAsicTuple& lhs, const adcChannelPair& rhs)
68 {
69 if (lhs.Channel == rhs.Channel) {
70 return lhs.ADC < rhs.ADC;
71 } else {
72 return lhs.Channel < rhs.Channel;
73 }
74 }
75 };
77} // end namespace Belle2
array< asicChannel, 8 > asicChannels
fixed sized array of ASIC channels
Abstract base class for different kinds of events.
tuple to store ADC,Channel -> 8 asicChannels
Short_t Channel
Channel number info (between 0 and 8)
asicChannels record
8-channel record
Short_t Channel
Channel number info (between 0 and 8)
functions to search in the sorted list of tuples
bool operator()(const adcAsicTuple &lhs, const adcChannelPair &rhs)
Order accroding to channel/ADC value.
bool operator()(const adcChannelPair &lhs, const adcAsicTuple &rhs)
Order accroding to channel/ADC value.
bool operator()(const adcAsicTuple &lhs, const adcAsicTuple &rhs)
Order accroding to channel/ADC value.
record to be used to store ASIC info
Short_t TOT
Time over threshold.