MUSIC
unknown
Analysis for the MUSIC active-target ionization chamber
Toggle main menu visibility
Loading...
Searching...
No Matches
HitAdapter.hpp
Go to the documentation of this file.
1
#ifndef HIT_ADAPTER_HPP
2
#define HIT_ADAPTER_HPP
3
4
#include "BinaryUtils.hpp"
5
#include <Rtypes.h>
6
17
19
namespace
SOLFlags
{
22
const
UInt_t
PILEUP
= 0x01;
23
const
UInt_t
EVENT_SATURATION
= 0x04;
24
const
UInt_t
POST_SATURATION
= 0x08;
25
const
UInt_t
CHARGE_OVERFLOW
= 0x10;
26
const
UInt_t
SCA_SELECTED
= 0x20;
27
const
UInt_t
FINE_TS_VALID
= 0x40;
29
32
const
UInt_t
EXT_INHIBIT
= 0x0001;
33
const
UInt_t
UNDER_SAT
= 0x0002;
34
const
UInt_t
OVER_SAT
= 0x0004;
35
const
UInt_t
EXT_TRIGGER
= 0x0008;
36
const
UInt_t
GLOBAL_TRIGGER
= 0x0010;
37
const
UInt_t
SW_TRIGGER
= 0x0020;
38
const
UInt_t
SELF_TRIGGER
= 0x0040;
39
const
UInt_t
LVDS_TRIGGER
= 0x0080;
40
const
UInt_t
TRIGGER_64CH
= 0x0100;
41
const
UInt_t
ITLA_TRIGGER
= 0x0200;
42
const
UInt_t
ITLB_TRIGGER
= 0x0400;
44
}
// namespace SOLFlags
45
70
namespace
SOLPack
{
71
const
Int_t
LOW_SHIFT
= 16;
72
const
UInt_t
LOW_MASK
= 0x7FF;
73
const
Int_t
HIGH_SHIFT
= 27;
74
const
Int_t
HIGH_SKIP
= 2;
75
const
UInt_t
HIGH_MASK
= 0x1F;
76
}
// namespace SOLPack
77
94
inline
UInt_t
MapSOLFlagsToCoMPASS
(UShort_t sol_flags_high,
95
UShort_t sol_flags_low) {
96
UInt_t mapped = 0;
97
98
// SOLARIS high-priority pileup -> CoMPASS PILEUP
99
if
(sol_flags_high &
SOLFlags::PILEUP
) {
100
mapped |= CoMPASSData::PILEUP;
101
}
102
103
// SOLARIS event saturation -> CoMPASS SATURATION_IN_GATE
104
if
(sol_flags_high &
SOLFlags::EVENT_SATURATION
) {
105
mapped |= CoMPASSData::SATURATION_IN_GATE;
106
}
107
108
// SOLARIS post-saturation -> CoMPASS INPUT_SATURATING
109
if
(sol_flags_high &
SOLFlags::POST_SATURATION
) {
110
mapped |= CoMPASSData::INPUT_SATURATING;
111
}
112
113
// The rest, packed per the layout above; each word is masked to its width:
114
// the old shifts (16, 20) overlapped in bits 20-23, making flags unreadable.
115
mapped |= (
static_cast<
UInt_t
>
(sol_flags_low) &
SOLPack::LOW_MASK
)
116
<<
SOLPack::LOW_SHIFT
;
117
mapped |= ((
static_cast<
UInt_t
>
(sol_flags_high) >>
SOLPack::HIGH_SKIP
) &
118
SOLPack::HIGH_MASK
)
119
<<
SOLPack::HIGH_SHIFT
;
120
121
return
mapped;
122
}
123
134
inline
RawHit
SOLHitToRawHit
(
const
SOLData &sol) {
135
RawHit raw;
136
raw.board = 0;
137
raw.channel = sol.channel;
138
raw.energy = sol.energy;
139
raw.timestamp = sol.timestamp * 1000;
140
raw.flags =
MapSOLFlagsToCoMPASS
(sol.flags_high, sol.flags_low);
141
return
raw;
142
}
143
144
#endif
MapSOLFlagsToCoMPASS
UInt_t MapSOLFlagsToCoMPASS(UShort_t sol_flags_high, UShort_t sol_flags_low)
Pack SOLARIS flags into a CoMPASS-compatible word.
Definition
HitAdapter.hpp:94
SOLHitToRawHit
RawHit SOLHitToRawHit(const SOLData &sol)
Adapt one SOLARIS hit into the pipeline's RawHit.
Definition
HitAdapter.hpp:134
SOLFlags
SOLARIS status flag bits, from the SOLARIS DAQ source.
Definition
HitAdapter.hpp:19
SOLFlags::EVENT_SATURATION
const UInt_t EVENT_SATURATION
bit 2
Definition
HitAdapter.hpp:23
SOLFlags::GLOBAL_TRIGGER
const UInt_t GLOBAL_TRIGGER
bit 4
Definition
HitAdapter.hpp:36
SOLFlags::LVDS_TRIGGER
const UInt_t LVDS_TRIGGER
bit 7
Definition
HitAdapter.hpp:39
SOLFlags::EXT_TRIGGER
const UInt_t EXT_TRIGGER
bit 3
Definition
HitAdapter.hpp:35
SOLFlags::ITLA_TRIGGER
const UInt_t ITLA_TRIGGER
bit 9
Definition
HitAdapter.hpp:41
SOLFlags::ITLB_TRIGGER
const UInt_t ITLB_TRIGGER
bit 10
Definition
HitAdapter.hpp:42
SOLFlags::POST_SATURATION
const UInt_t POST_SATURATION
bit 3
Definition
HitAdapter.hpp:24
SOLFlags::SW_TRIGGER
const UInt_t SW_TRIGGER
bit 5
Definition
HitAdapter.hpp:37
SOLFlags::CHARGE_OVERFLOW
const UInt_t CHARGE_OVERFLOW
bit 4
Definition
HitAdapter.hpp:25
SOLFlags::EXT_INHIBIT
const UInt_t EXT_INHIBIT
bit 0
Definition
HitAdapter.hpp:32
SOLFlags::SELF_TRIGGER
const UInt_t SELF_TRIGGER
bit 6
Definition
HitAdapter.hpp:38
SOLFlags::SCA_SELECTED
const UInt_t SCA_SELECTED
bit 5
Definition
HitAdapter.hpp:26
SOLFlags::UNDER_SAT
const UInt_t UNDER_SAT
bit 1
Definition
HitAdapter.hpp:33
SOLFlags::PILEUP
const UInt_t PILEUP
bit 0
Definition
HitAdapter.hpp:22
SOLFlags::FINE_TS_VALID
const UInt_t FINE_TS_VALID
bit 6
Definition
HitAdapter.hpp:27
SOLFlags::TRIGGER_64CH
const UInt_t TRIGGER_64CH
bit 8
Definition
HitAdapter.hpp:40
SOLFlags::OVER_SAT
const UInt_t OVER_SAT
bit 2
Definition
HitAdapter.hpp:34
SOLPack
Layout of the packed word MapSOLFlagsToCoMPASS() returns.
Definition
HitAdapter.hpp:70
SOLPack::HIGH_SHIFT
const Int_t HIGH_SHIFT
Where the flags_high remnant starts.
Definition
HitAdapter.hpp:73
SOLPack::LOW_MASK
const UInt_t LOW_MASK
flags_low bits 0-10.
Definition
HitAdapter.hpp:72
SOLPack::LOW_SHIFT
const Int_t LOW_SHIFT
Where flags_low starts.
Definition
HitAdapter.hpp:71
SOLPack::HIGH_SKIP
const Int_t HIGH_SKIP
flags_high bits 0-1 are not carried here.
Definition
HitAdapter.hpp:74
SOLPack::HIGH_MASK
const UInt_t HIGH_MASK
flags_high bits 2-6.
Definition
HitAdapter.hpp:75
tooling
include
HitAdapter.hpp
Generated by
1.17.0