Belle II Software development
ARICHMergerMapping.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
9#pragma once
10
11#include <vector>
12#include <map>
13#include <TObject.h>
14
15//number of channels per HAPD
16#define N_MERGERS 72
17#define N_FEB2MERGER 6
18
19namespace Belle2 {
25
29 class ARICHMergerMapping : public TObject {
30
31 public:
32
35
42 unsigned getModuleID(unsigned mergerID, unsigned febSlot) const;
43
49 unsigned getMergerID(unsigned moduleID) const;
50
56 unsigned getFEBSlot(unsigned moduleID) const;
57
63 unsigned getMergerIDfromSN(unsigned mergerSN) const;
64
70 unsigned getMergerSN(unsigned mergerID) const;
71
79 void addMapping(unsigned moduleID, unsigned mergerID, unsigned febSlot, unsigned mergerSN);
80
84 void print() const;
85
86 private:
87
88 std::vector<uint16_t> m_merger2module;
89 std::vector<uint16_t> m_module2merger;
91 std::vector<bool> m_isMapped;
92 std::map<unsigned, unsigned> m_mergerID;
96 };
97
99} // namespace
The Class for ARICH mapping of modules to merger boards.
unsigned getMergerIDfromSN(unsigned mergerSN) const
Get ID of merger from serial number.
unsigned getModuleID(unsigned mergerID, unsigned febSlot) const
Get ID of module connected to merger at FEB slot.
std::vector< uint16_t > m_module2merger
map of modules to mergers
ARICHMergerMapping()
Default constructor.
std::vector< bool > m_isMapped
vector of mapped modules
ClassDef(ARICHMergerMapping, 2)
ClassDef, must be the last term before the closing {}.
std::vector< uint16_t > m_merger2module
map of mergers to modules
void addMapping(unsigned moduleID, unsigned mergerID, unsigned febSlot, unsigned mergerSN)
Add mapping entry.
unsigned getMergerID(unsigned moduleID) const
Get ID of merger to which module is connected.
unsigned getMergerSN(unsigned mergerID) const
Get serial number of marger from its ID.
void print() const
Pring mapping.
unsigned getFEBSlot(unsigned moduleID) const
Get FEB slot to which module is connected.
std::map< unsigned, unsigned > m_mergerID
map mergers ID to SN
Abstract base class for different kinds of events.