forked from cms-sw/cmssw
-
Notifications
You must be signed in to change notification settings - Fork 6
/
TotemDAQMapping.h
62 lines (47 loc) · 1.82 KB
/
TotemDAQMapping.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
/****************************************************************************
*
* This is a part of TOTEM offline software.
* Authors:
* Maciej Wróbel (wroblisko@gmail.com)
* Jan Kašpar (jan.kaspar@cern.ch)
*
****************************************************************************/
#ifndef CondFormats_CTPPSReadoutObjects_TotemDAQMapping
#define CondFormats_CTPPSReadoutObjects_TotemDAQMapping
#include "CondFormats/CTPPSReadoutObjects/interface/TotemFramePosition.h"
#include "CondFormats/CTPPSReadoutObjects/interface/TotemSymbId.h"
#include <map>
//----------------------------------------------------------------------------------------------------
/**
*\brief Contains mappind data related to a VFAT.
*/
class TotemVFATInfo
{
public:
/// the symbolic id
TotemSymbID symbolicID;
/// the hardware ID (16 bit)
unsigned int hwID;
friend std::ostream& operator << (std::ostream& s, const TotemVFATInfo &fp);
};
//----------------------------------------------------------------------------------------------------
/**
*\brief The mapping between FramePosition and VFATInfo.
*/
class TotemDAQMapping
{
public:
std::map<TotemFramePosition, TotemVFATInfo> VFATMapping;
/// Hw Id mapping for Totem Timing (dynamical mapping in Sampic)
struct TotemTimingPlaneChannelPair
{
int plane;
int channel;
TotemTimingPlaneChannelPair(const int& plane=-1, const int& channel=-1) : plane(plane), channel(channel) {};
};
std::map<uint8_t, TotemTimingPlaneChannelPair> totemTimingChannelMap;
void insert(const TotemFramePosition &fp, const TotemVFATInfo &vi);
/// Given the hardware ID, returns the corresponding Plane, Channel pair (TotemTimingPlaneChannelPair)
const TotemTimingPlaneChannelPair getTimingChannel( const uint8_t hwId ) const;
};
#endif