ATLAS Offline Software
NSW_PadTriggerData.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3 */
5 #include <iostream>
6 
7 namespace Muon {
10  uint32_t ec,
11  uint32_t fragid,
12  uint32_t secid,
13  uint32_t spare,
14  uint32_t orbit,
15  uint32_t bcid,
16  uint32_t l1id,
17  uint32_t orbitid,
18  uint32_t orbit1,
20  uint32_t hit_n,
21  uint32_t pfeb_n,
22  uint32_t trigger_n,
23  uint32_t bcid_n,
24  const uint32_vt& hit_relbcid,
25  const uint32_vt& hit_pfeb,
26  const uint32_vt& hit_tdschannel,
27  const uint32_vt& hit_vmmchannel,
28  const uint32_vt& hit_vmm,
29  const uint32_vt& hit_padchannel,
30  const uint32_vt& pfeb_addr,
31  const uint32_vt& pfeb_nchan,
32  const uint32_vt& pfeb_disconnected,
33  const uint32_vt& trigger_bandid,
34  const uint32_vt& trigger_phiid,
35  const uint32_vt& trigger_relbcid,
36  const uint32_vt& bcid_rel,
37  const uint32_vt& bcid_status,
38  const uint32_vt& bcid_multzero,
39  const uint32_vt& bcid_multiplicity):
40  m_sourceid(sourceid),
41  m_flags(flags),
42  m_ec(ec),
43  m_fragid(fragid),
44  m_secid(secid),
45  m_spare(spare),
46  m_orbit(orbit),
47  m_bcid(bcid),
48  m_l1id(l1id),
49  m_orbitid(orbitid),
50  m_orbit1(orbit1),
51  m_status(status),
52  m_hit_n(hit_n),
53  m_pfeb_n(pfeb_n),
54  m_trigger_n(trigger_n),
55  m_bcid_n(bcid_n),
56  m_hit_relbcid(hit_relbcid),
57  m_hit_pfeb(hit_pfeb),
58  m_hit_tdschannel(hit_tdschannel),
59  m_hit_vmmchannel(hit_vmmchannel),
60  m_hit_vmm(hit_vmm),
61  m_hit_padchannel(hit_padchannel),
62  m_pfeb_addr(pfeb_addr),
63  m_pfeb_nchan(pfeb_nchan),
64  m_pfeb_disconnected(pfeb_disconnected),
65  m_trigger_bandid(trigger_bandid),
66  m_trigger_phiid(trigger_phiid),
67  m_trigger_relbcid(trigger_relbcid),
68  m_bcid_rel(bcid_rel),
69  m_bcid_status(bcid_status),
70  m_bcid_multzero(bcid_multzero),
71  m_bcid_multiplicity(bcid_multiplicity)
72 {
75  m_trigger_n = static_cast<uint32_t>(m_trigger_bandid.size());
76 }
77 
79 {
80  m_sourceid = (side_A ? SIDE_A : SIDE_C) + 0x20 + sector;
81  m_secid = sector;
82  m_bcid = bcid;
83  m_l1id = l1id;
84 }
85 
86 std::string NSW_PadTriggerData::string() const {
87  std::stringstream sstream{};
88  sstream << "Source ID: " << std::hex << getSourceid() << std::dec << " N(hits): " << getNumberOfHits() << " N(triggers) " << getNumberOfTriggers();
89  return sstream.str();
90 }
91 
92 std::tuple< uint32_vt, uint32_vt, uint32_vt >
93 NSW_PadTriggerData::filterNonNulls(const uint32_vt & bandids, const uint32_vt & phiids, const uint32_vt & bcids) {
94  uint32_vt bandidsFiltered{}, phiidsFiltered{}, bcidsFiltered{};
95  for (size_t it = 0; it < bandids.size(); ++it) {
96  if (bandids.at(it) == NULL_BANDID and phiids.at(it) == NULL_PHIID) {
97  continue;
98  }
99  bandidsFiltered.push_back(bandids.at(it));
100  phiidsFiltered .push_back(phiids.at(it));
101  bcidsFiltered .push_back(bcids.at(it));
102  }
103  return std::make_tuple(bandidsFiltered, phiidsFiltered, bcidsFiltered);
104 }
105 
107  m_trigger_bandid.push_back(bandid);
108  m_trigger_phiid.push_back(phiid);
109  m_trigger_relbcid.push_back(relbcid);
110  m_trigger_n += 1;
111 }
112 
114  return m_sourceid < SIDE_C;
115 }
116 
118  return not sideA();
119 }
120 
122  return m_secid % 2 == 0;
123 }
124 
126  return not largeSector();
127 }
128 
129 std::ostream& operator<<(std::ostream& stream, const NSW_PadTriggerData& rhs) {
130  return stream << rhs.string();
131 }
132 
133 MsgStream& operator<<(MsgStream& stream, const NSW_PadTriggerData& rhs) {
134  return stream << rhs.string();
135 }
136 
137 } // namespace Muon
Muon::NSW_PadTriggerData::largeSector
bool largeSector() const
Definition: NSW_PadTriggerData.cxx:121
xAOD::uint32_t
setEventNumber uint32_t
Definition: EventInfo_v1.cxx:127
AthenaPoolTestRead.flags
flags
Definition: AthenaPoolTestRead.py:8
Muon::NSW_PadTriggerData::SIDE_C
static constexpr uint32_t SIDE_C
Definition: NSW_PadTriggerData.h:144
skel.it
it
Definition: skel.GENtoEVGEN.py:396
Muon::NSW_PadTriggerData::filterNonNulls
static std::tuple< uint32_vt, uint32_vt, uint32_vt > filterNonNulls(const uint32_vt &bandids, const uint32_vt &phiids, const uint32_vt &bcids)
Definition: NSW_PadTriggerData.cxx:93
Muon::NSW_PadTriggerData::m_secid
uint32_t m_secid
Definition: NSW_PadTriggerData.h:112
Muon::uint32_vt
std::vector< uint32_t > uint32_vt
Definition: NSW_PadTriggerData_p1.h:7
Muon::NSW_PadTriggerData::NULL_BANDID
static constexpr uint32_t NULL_BANDID
Definition: NSW_PadTriggerData.h:141
Muon
NRpcCablingAlg reads raw condition data and writes derived condition data to the condition store.
Definition: TrackSystemController.h:45
AthenaPoolTestWrite.stream
string stream
Definition: AthenaPoolTestWrite.py:12
Muon::NSW_PadTriggerData::SIDE_A
static constexpr uint32_t SIDE_A
Definition: NSW_PadTriggerData.h:143
Muon::NSW_PadTriggerData::m_trigger_n
uint32_t m_trigger_n
Definition: NSW_PadTriggerData.h:122
Muon::NSW_PadTriggerData::m_l1id
uint32_t m_l1id
Definition: NSW_PadTriggerData.h:116
Muon::NSW_PadTriggerData::sideA
bool sideA() const
Definition: NSW_PadTriggerData.cxx:113
NSW_PadTriggerData.h
Muon::NSW_PadTriggerData::getSourceid
uint32_t getSourceid() const
Definition: NSW_PadTriggerData.h:59
Muon::NSW_PadTriggerData
Definition: NSW_PadTriggerData.h:19
Muon::NSW_PadTriggerData::m_trigger_bandid
uint32_vt m_trigger_bandid
Definition: NSW_PadTriggerData.h:133
Muon::NSW_PadTriggerData::getNumberOfHits
uint32_t getNumberOfHits() const
Definition: NSW_PadTriggerData.h:71
Muon::NSW_PadTriggerData::m_trigger_relbcid
uint32_vt m_trigger_relbcid
Definition: NSW_PadTriggerData.h:135
xAOD::bcid
setEventNumber setTimeStamp bcid
Definition: EventInfo_v1.cxx:133
Muon::NSW_PadTriggerData::string
std::string string() const
Definition: NSW_PadTriggerData.cxx:86
Muon::operator<<
std::ostream & operator<<(std::ostream &ostr, const Muon::HedgehogBoard &board)
Definition: HedgehogBoard.cxx:11
Muon::NSW_PadTriggerData::addTrigger
void addTrigger(uint32_t bandid, uint32_t phiid, uint32_t relbcid)
Definition: NSW_PadTriggerData.cxx:106
Muon::NSW_PadTriggerData::getNumberOfTriggers
uint32_t getNumberOfTriggers() const
Definition: NSW_PadTriggerData.h:73
Muon::NSW_PadTriggerData::sideC
bool sideC() const
Definition: NSW_PadTriggerData.cxx:117
merge.status
status
Definition: merge.py:17
Muon::NSW_PadTriggerData::smallSector
bool smallSector() const
Definition: NSW_PadTriggerData.cxx:125
Muon::NSW_PadTriggerData::NSW_PadTriggerData
NSW_PadTriggerData(uint32_t sourceid, uint32_t flags, uint32_t ec, uint32_t fragid, uint32_t secid, uint32_t spare, uint32_t orbit, uint32_t bcid, uint32_t l1id, uint32_t orbitid, uint32_t orbit1, uint32_t status, uint32_t hit_n, uint32_t pfeb_n, uint32_t trigger_n, uint32_t bcid_n, const uint32_vt &hit_relbcid, const uint32_vt &hit_pfeb, const uint32_vt &hit_tdschannel, const uint32_vt &hit_vmmchannel, const uint32_vt &hit_vmm, const uint32_vt &hit_padchannel, const uint32_vt &pfeb_addr, const uint32_vt &pfeb_nchan, const uint32_vt &pfeb_disconnected, const uint32_vt &trigger_bandid, const uint32_vt &trigger_phiid, const uint32_vt &trigger_relbcid, const uint32_vt &bcid_rel, const uint32_vt &bcid_status, const uint32_vt &bcid_multzero, const uint32_vt &bcid_multiplicity)
Definition: NSW_PadTriggerData.cxx:8
Muon::NSW_PadTriggerData::m_trigger_phiid
uint32_vt m_trigger_phiid
Definition: NSW_PadTriggerData.h:134
Muon::NSW_PadTriggerData::m_sourceid
uint32_t m_sourceid
Definition: NSW_PadTriggerData.h:108
Muon::NSW_PadTriggerData::NULL_PHIID
static constexpr uint32_t NULL_PHIID
Definition: NSW_PadTriggerData.h:142
Muon::NSW_PadTriggerData::m_bcid
uint32_t m_bcid
Definition: NSW_PadTriggerData.h:115