ATLAS Offline Software
Functions
NSWL1::PadTriggerAdapter Namespace Reference

Functions

Muon::NSW_PadTriggerSegment segment (const NSWL1::PadTrigger &data)
 
StatusCode fillContainer (const std::unique_ptr< Muon::NSW_PadTriggerDataContainer > &out, const std::vector< std::unique_ptr< NSWL1::PadTrigger >> &triggers, const uint32_t l1id)
 

Function Documentation

◆ fillContainer()

StatusCode NSWL1::PadTriggerAdapter::fillContainer ( const std::unique_ptr< Muon::NSW_PadTriggerDataContainer > &  out,
const std::vector< std::unique_ptr< NSWL1::PadTrigger >> &  triggers,
const uint32_t  l1id 
)

Definition at line 17 of file PadTriggerAdapter.cxx.

19  {
20  using TriggerList = std::vector<const NSWL1::PadTrigger *>;
21  using TriggerMap = std::map<uint32_t, TriggerList>;
22  TriggerMap triggerMap;
23  // Filter by sector:
24  for (const auto &pt : triggers) {
25  // `sector` in range [0, 16)
26  auto sector = pt->triggerSectorNumber() - 1;
27  auto endcap = pt->sideId();
28  if (sector == -1 || endcap == -1) {
29  return StatusCode::FAILURE;
30  }
31  // Calculate hash, range [0, 32)
32  const uint32_t hash = 16 * endcap + sector;
33  auto it = triggerMap.find(hash);
34  if (it == triggerMap.end()) {
35  it = triggerMap.insert(std::make_pair(hash, TriggerList())).first;
36  }
37  it->second.push_back(pt.get());
38  }
39  for (const auto &item : triggerMap) {
40  const TriggerList &triggerList = item.second;
41  const auto pt = triggerList[0];
42  const bool sideA = static_cast<bool>(pt->sideId());
43  auto newCollection = new Muon::NSW_PadTriggerData(sideA, pt->triggerSectorNumber() - 1, pt->bctag(), l1id);
44  for (const auto& pt: triggerList) {
45  newCollection->addTrigger(pt->bandId(), pt->phiId(), 0);
46  }
47  if (out->addCollection(newCollection, out->numberOfCollections()).isFailure()) {
48  return StatusCode::FAILURE;
49  }
50  }
51  return StatusCode::SUCCESS;
52 }

◆ segment()

Muon::NSW_PadTriggerSegment NSWL1::PadTriggerAdapter::segment ( const NSWL1::PadTrigger data)

Definition at line 5 of file PadTriggerAdapter.cxx.

5  {
7  static_cast<uint8_t>(data.bandId()),
8  static_cast<uint8_t>(data.phiId()),
9  {static_cast<uint8_t>(data.trgSelectedLayersInner().size()),
10  static_cast<uint8_t>(data.trgSelectedLayersOuter().size())}
11  };
12 }
data
char data[hepevt_bytes_allocation_ATLAS]
Definition: HepEvt.cxx:11
xAOD::uint8_t
uint8_t
Definition: Muon_v1.cxx:557
xAOD::uint32_t
setEventNumber uint32_t
Definition: EventInfo_v1.cxx:127
skel.it
it
Definition: skel.GENtoEVGEN.py:396
test_pyathena.pt
pt
Definition: test_pyathena.py:11
python.AthDsoLogger.out
out
Definition: AthDsoLogger.py:71
python.TrigTLAMonitorAlgorithm.triggers
triggers
Definition: TrigTLAMonitorAlgorithm.py:196
Muon::NSW_PadTriggerData
Definition: NSW_PadTriggerData.h:19
RPDUtils::sideA
unsigned constexpr int sideA
Definition: RPDUtils.h:16
Muon::NSW_PadTriggerSegment
Definition: NSW_PadTriggerSegment.h:11
item
Definition: ItemListSvc.h:43
CaloCondBlobAlgs_fillNoiseFromASCII.hash
dictionary hash
Definition: CaloCondBlobAlgs_fillNoiseFromASCII.py:109