ATLAS Offline Software
Loading...
Searching...
No Matches
STGC_RawData.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3*/
4
5#ifndef MUONRDO_STGCRAWDATA_H
6#define MUONRDO_STGCRAWDATA_H
7
8#include <iostream>
9#include "Identifier/Identifier.h"
10
11class MsgStream;
12
13namespace Muon {
14class STGC_RawData final{
15 friend class STGC_RawDataCnv_p1;
16 friend class STGC_RawDataCnv_p2;
17 friend class STGC_RawDataCnv_p3;
18
19 private:
20
21 // offline identifier
23
24 // readout data
25 // keeping time in two variables: a float and an int. The float variable is kept for backward compatibility
26 float m_time{0};
27 unsigned int m_tdo{0}; // time converted to TDC counts
28 unsigned int m_charge{0};
29 uint16_t m_bcTag{0};
30
31 bool m_isDead{false};
33
34
35 public:
36 STGC_RawData (const Identifier id);
37 STGC_RawData () = default;
38 STGC_RawData(const STGC_RawData&) = default;
42 ~STGC_RawData() = default;
43
44 STGC_RawData(const Identifier id, const uint16_t bcTag, const float time,
45 const unsigned int charge, const bool isDead,
46 const bool timeAndChargeInCounts);
47
48 STGC_RawData (const Identifier id, const uint16_t bcTag, const float time, const unsigned int tdo,
49 const unsigned int charge, const bool isDead, const bool timeAndChargeInCounts );
50
51
52 const Identifier identify() const { return m_id; }
53
54 // access functions
55 float time() const {return m_time;}
56 unsigned int tdo() const {return m_tdo;}
57 unsigned int charge() const {return m_charge;}
58 uint16_t bcTag() const {return m_bcTag;}
59
60 bool isDead() const {return m_isDead;}
62
63 // Lower time bound of digits selected at the end of digitization.
64 // As of June 2022, the main event is assigned to relative_BCID=3, which is set to correspond
65 // to the time interval [-12.5ns, +12.5ns]. The digits within the BC window [-3, +4] are kept.
66 // Therefore the lower time bound is -87.5 ns.
67 static constexpr double s_lowerTimeBound{-87.5};
68
69 // BC window
70 static constexpr int s_BCWindow{8};
71
72 // A Simple constant to convert time to TDC counts in the absence of time calibration.
73 // This constant should be used only to preserve backward compatibility, since it doesn't have
74 // physical meaning and the value is arbitrary. The value is chosen to be greater than
75 // 25 ns plus the absolute value of the time corresponding to the first bunch crossing defined in
76 // sTGC_Digitization/python/sTGC_DigitizationConfig.py, which is -100ns as of 2022-05-01.
77 // Therefore, after time-tdo conversion, the resulting TDC count is positive.
78 static constexpr int s_timeTdoShift{200};
79};
80}
81
83MsgStream& operator << ( MsgStream& sl, const Muon::STGC_RawData& coll);
84
86std::ostream& operator << ( std::ostream& sl, const Muon::STGC_RawData& coll);
87
88#endif
89
MsgStream & operator<<(MsgStream &sl, const Muon::STGC_RawData &coll)
Overload of << operator for MsgStream for debug output.
STGC_RawData(const STGC_RawData &)=default
bool timeAndChargeInCounts() const
static constexpr int s_BCWindow
static constexpr double s_lowerTimeBound
unsigned int charge() const
STGC_RawData(STGC_RawData &&)=default
unsigned int m_charge
uint16_t bcTag() const
const Identifier identify() const
unsigned int tdo() const
friend class STGC_RawDataCnv_p1
STGC_RawData(const Identifier id)
STGC_RawData & operator=(STGC_RawData &&)=default
STGC_RawData()=default
friend class STGC_RawDataCnv_p3
~STGC_RawData()=default
static constexpr int s_timeTdoShift
friend class STGC_RawDataCnv_p2
float time() const
STGC_RawData & operator=(const STGC_RawData &)=default
bool isDead() const
unsigned int m_tdo
NRpcCablingAlg reads raw condition data and writes derived condition data to the condition store.