MUSIC unknown
Analysis for the MUSIC active-target ionization chamber
Loading...
Searching...
No Matches
HitAdapter.hpp File Reference

Converting SOLARIS hits into the CoMPASS-shaped form the pipeline uses. More...

#include "BinaryUtils.hpp"
#include <Rtypes.h>
Include dependency graph for HitAdapter.hpp:

Go to the source code of this file.

Namespaces

namespace  SOLFlags
 SOLARIS status flag bits, from the SOLARIS DAQ source.
namespace  SOLPack
 Layout of the packed word MapSOLFlagsToCoMPASS() returns.

Functions

UInt_t MapSOLFlagsToCoMPASS (UShort_t sol_flags_high, UShort_t sol_flags_low)
 Pack SOLARIS flags into a CoMPASS-compatible word.
UShort_t SOLFlagsLowFrom (UInt_t mapped)
 Recover the SOLARIS low-priority word from a packed value.
UShort_t SOLFlagsHighFrom (UInt_t mapped)
 Recover the SOLARIS high-priority word from a packed value.
RawHit SOLHitToRawHit (const SOLHit &sol)
 Adapt one SOLARIS hit into the pipeline's RawHit.
std::vector< RawHit > SOLHitsToRawHits (const std::vector< SOLHit > &sol_hits)
 Adapt a whole run's SOLARIS hits.

Variables

const Int_t SOLPack::LOW_SHIFT = 16
 Where flags_low starts.
const UInt_t SOLPack::LOW_MASK = 0x7FF
 flags_low bits 0-10.
const Int_t SOLPack::HIGH_SHIFT = 27
 Where the flags_high remnant starts.
const Int_t SOLPack::HIGH_SKIP = 2
 flags_high bits 0-1 are not carried here.
const UInt_t SOLPack::HIGH_MASK = 0x1F
 flags_high bits 2-6.
High-priority word, 8 bits
const UInt_t SOLFlags::PILEUP = 0x01
 bit 0
const UInt_t SOLFlags::EVENT_SATURATION = 0x04
 bit 2
const UInt_t SOLFlags::POST_SATURATION = 0x08
 bit 3
const UInt_t SOLFlags::CHARGE_OVERFLOW = 0x10
 bit 4
const UInt_t SOLFlags::SCA_SELECTED = 0x20
 bit 5
const UInt_t SOLFlags::FINE_TS_VALID = 0x40
 bit 6
Low-priority word, 12 bits
const UInt_t SOLFlags::EXT_INHIBIT = 0x0001
 bit 0
const UInt_t SOLFlags::UNDER_SAT = 0x0002
 bit 1
const UInt_t SOLFlags::OVER_SAT = 0x0004
 bit 2
const UInt_t SOLFlags::EXT_TRIGGER = 0x0008
 bit 3
const UInt_t SOLFlags::GLOBAL_TRIGGER = 0x0010
 bit 4
const UInt_t SOLFlags::SW_TRIGGER = 0x0020
 bit 5
const UInt_t SOLFlags::SELF_TRIGGER = 0x0040
 bit 6
const UInt_t SOLFlags::LVDS_TRIGGER = 0x0080
 bit 7
const UInt_t SOLFlags::TRIGGER_64CH = 0x0100
 bit 8
const UInt_t SOLFlags::ITLA_TRIGGER = 0x0200
 bit 9
const UInt_t SOLFlags::ITLB_TRIGGER = 0x0400
 bit 10

Detailed Description

Converting SOLARIS hits into the CoMPASS-shaped form the pipeline uses.

The pipeline was written against CoMPASS. Rather than fork every downstream stage for the SOLARIS era, SOLARIS hits are adapted into RawHit with CoMPASS-compatible flag bits, so EventBuilder, the timing filters and everything after them work unchanged.

Definition in file HitAdapter.hpp.

Function Documentation

◆ MapSOLFlagsToCoMPASS()

UInt_t MapSOLFlagsToCoMPASS ( UShort_t sol_flags_high,
UShort_t sol_flags_low )
inline

Pack SOLARIS flags into a CoMPASS-compatible word.

The three conditions that have CoMPASS equivalents are mapped onto them, so downstream flag checks work unchanged. The remainder is packed above per SOLPack.

Parameters
sol_flags_highSOLARIS high-priority flag word.
sol_flags_lowSOLARIS low-priority flag word.
Returns
The packed word, for RawHit::flags.
Note
An earlier layout used shifts of 16 and 20, which overlapped in bits 20-23: flags_high bits 4-7 and flags_low bits 0-3 were ORed on top of each other and neither could be read back. Each word is now masked to the width it actually defines.

Definition at line 94 of file HitAdapter.hpp.

Referenced by RunFusedPipelineForFile(), and SOLHitToRawHit().

◆ SOLFlagsHighFrom()

UShort_t SOLFlagsHighFrom ( UInt_t mapped)
inline

Recover the SOLARIS high-priority word from a packed value.

Parameters
mappedWord from MapSOLFlagsToCoMPASS().
Returns
flags_high bits 2-6, in their original positions.
Note
Bit 0, pileup, is not carried here — read CoMPASSData::PILEUP instead. Bits 1 and 7 are undefined by the format.

Definition at line 144 of file HitAdapter.hpp.

◆ SOLFlagsLowFrom()

UShort_t SOLFlagsLowFrom ( UInt_t mapped)
inline

Recover the SOLARIS low-priority word from a packed value.

Parameters
mappedWord from MapSOLFlagsToCoMPASS().
Returns
flags_low, bits 0-10.
Note
Use this rather than open-coding the shift, so the layout stays defined in one place.

Definition at line 133 of file HitAdapter.hpp.

◆ SOLHitsToRawHits()

std::vector< RawHit > SOLHitsToRawHits ( const std::vector< SOLHit > & sol_hits)
inline

Adapt a whole run's SOLARIS hits.

Parameters
sol_hitsHits to convert.
Returns
The adapted hits, in the same order.

Definition at line 173 of file HitAdapter.hpp.

◆ SOLHitToRawHit()

RawHit SOLHitToRawHit ( const SOLHit & sol)
inline

Adapt one SOLARIS hit into the pipeline's RawHit.

Parameters
solHit to convert.
Returns
The adapted hit.
Note
Board is always 0: the SOLARIS digitiser presents a flat channel space with no board dimension. Timestamps are scaled from nanoseconds to the picoseconds the pipeline works in.

Definition at line 159 of file HitAdapter.hpp.

Referenced by SOLHitsToRawHits().