ATLAS Offline Software
TriggerProcessorTool.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3 */
4 
6 
7 namespace NSWL1 {
8 
9  TriggerProcessorTool::TriggerProcessorTool(const std::string& type, const std::string& name, const IInterface* parent) :
11  {
12  }
13 
15 
16  ATH_MSG_DEBUG("In initialize()");
17  return StatusCode::SUCCESS;
18  }
19 
21  const Muon::NSW_TrigRawDataContainer* stripTriggerContainer,
22  const Muon::NSW_TrigRawDataContainer* MMTriggerContainer,
23  Muon::NSW_TrigRawDataContainer* trigRdoContainer) const {
24  ATH_MSG_DEBUG("------------- TriggerProcessorTool::mergeRDO ---------------------");
25  ATH_MSG_DEBUG("Pad Trigger Container size: " << padTriggerContainer->size());
26  constexpr bool HAS_PHI_RESOLUTION{true};
27  constexpr uint8_t SPARE_IS_PAD{1};
28  for ( const auto padTriggerData : *padTriggerContainer ) {
29  ATH_MSG_DEBUG("Pad Trigger data: " << *padTriggerData);
30  const char sectorSide = (padTriggerData->sideA()) ? 'A' : 'C';
31  auto trigRawData = new Muon::NSW_TrigRawData(padTriggerData->getSecid(), sectorSide, padTriggerData->getBcid());
32  for (size_t it = 0; it < padTriggerData->getNumberOfTriggers(); ++it) {
33  auto trigRawDataSegment = new Muon::NSW_TrigRawDataSegment();
34  trigRawDataSegment->setRIndex(padTriggerData->getTriggerBandIds().at(it));
35  trigRawDataSegment->setPhiIndex(padTriggerData->getTriggerPhiIds().at(it));
36  trigRawDataSegment->setPhiRes(HAS_PHI_RESOLUTION);
37  trigRawDataSegment->setSpare(SPARE_IS_PAD);
38  trigRawData->push_back(trigRawDataSegment);
39  }
40  ATH_MSG_DEBUG("L1NSW-Pad Trigger Output: "
41  << "sectorSide=" << trigRawData->sectorSide() << " "
42  << "sectorId=" << trigRawData->sectorId() << " "
43  << "bcId=" << trigRawData->bcId());
44  for(const auto seg : *trigRawData){
45  ATH_MSG_DEBUG("\tPadSegment: "
46  << "deltaTheta=" << static_cast<int16_t>(seg->deltaTheta()) << " "
47  << "phiIndex=" << static_cast<int16_t>(seg->phiIndex()) << " "
48  << "rIndex=" << static_cast<int16_t>(seg->rIndex()) << " "
49  << "spare=" << static_cast<int16_t>(seg->spare()) << " "
50  << "lowRes=" << seg->lowRes() << " "
51  << "phiRes=" << seg->phiRes() << " "
52  << "monitor=" << seg->monitor());
53  }
54  trigRdoContainer->push_back(trigRawData);
55  }
56  ATH_MSG_DEBUG("After PadTrigger filling -> NSW Trigger RDO size: " << trigRdoContainer->size());
57 
58  for (const auto rawData : *stripTriggerContainer) {
59  Muon::NSW_TrigRawData* trigRawData = new Muon::NSW_TrigRawData(*rawData, true);
60  ATH_MSG_DEBUG("L1NSW-Strip Trigger Output: "
61  << "sectorSide=" << trigRawData->sectorSide() << " "
62  << "sectorId=" << trigRawData->sectorId() << " "
63  << "bcId=" << trigRawData->bcId());
64  for(const auto seg : *trigRawData){
65  ATH_MSG_DEBUG("\tStripSegment: "
66  << "deltaTheta=" << static_cast<int16_t>(seg->deltaTheta()) << " "
67  << "phiIndex=" << static_cast<int16_t>(seg->phiIndex()) << " "
68  << "rIndex=" << static_cast<int16_t>(seg->rIndex()) << " "
69  << "spare=" << static_cast<int16_t>(seg->spare()) << " "
70  << "lowRes=" << seg->lowRes() << " "
71  << "phiRes=" << seg->phiRes() << " "
72  << "monitor=" << seg->monitor());
73  }
74  trigRdoContainer->push_back(trigRawData);
75  }
76  ATH_MSG_DEBUG("After sTGC strip trigger filling -> NSW Trigger RDO size: " << trigRdoContainer->size());
77 
78  for (const auto rawData : *MMTriggerContainer) {
79  Muon::NSW_TrigRawData* trigRawData = new Muon::NSW_TrigRawData(*rawData, false);
80  ATH_MSG_DEBUG("L1NSW-MM Trigger Output: "
81  << "sectorSide=" << trigRawData->sectorSide() << " "
82  << "sectorId=" << trigRawData->sectorId() << " "
83  << "bcId=" << trigRawData->bcId());
84  for(const auto seg : *trigRawData){
85  ATH_MSG_DEBUG("\tMMSegment: "
86  << "deltaTheta=" << static_cast<int16_t>(seg->deltaTheta()) << " "
87  << "phiIndex=" << static_cast<int16_t>(seg->phiIndex()) << " "
88  << "rIndex=" << static_cast<int16_t>(seg->rIndex()) << " "
89  << "spare=" << static_cast<int16_t>(seg->spare()) << " "
90  << "lowRes=" << seg->lowRes() << " "
91  << "phiRes=" << seg->phiRes() << " "
92  << "monitor=" << seg->monitor());
93  }
94  trigRdoContainer->push_back(trigRawData);
95  }
96  ATH_MSG_DEBUG("After MMTrigger filling -> NSW Trigger RDO size: " << trigRdoContainer->size());
97 
98  return StatusCode::SUCCESS;
99  }
100 }
xAOD::uint8_t
uint8_t
Definition: Muon_v1.cxx:557
Muon::NSW_TrigRawData::sectorId
uint16_t sectorId() const
Definition: NSW_TrigRawData.h:25
Muon::NSW_PadTriggerDataContainer
Definition: NSW_PadTriggerDataContainer.h:15
Muon::NSW_TrigRawData
Definition: NSW_TrigRawData.h:15
skel.it
it
Definition: skel.GENtoEVGEN.py:396
IdentifiableContainerMT::size
size_t size() const
Duplicate of fullSize for backwards compatability.
Definition: IdentifiableContainerMT.h:206
xAOD::int16_t
setScaleOne setStatusOne setSaturated int16_t
Definition: gFexGlobalRoI_v1.cxx:55
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
test_pyathena.parent
parent
Definition: test_pyathena.py:15
NSWL1::TriggerProcessorTool::mergeRDO
StatusCode mergeRDO(const Muon::NSW_PadTriggerDataContainer *padTriggerContainer, const Muon::NSW_TrigRawDataContainer *stripTriggerContainer, const Muon::NSW_TrigRawDataContainer *MMTriggerContainer, Muon::NSW_TrigRawDataContainer *trigRdoContainer) const
Definition: TriggerProcessorTool.cxx:20
Muon::NSW_TrigRawDataSegment
Definition: NSW_TrigRawDataSegment.h:15
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:228
DataVector::push_back
value_type push_back(value_type pElem)
Add an element to the end of the collection.
NSWL1::TriggerProcessorTool::initialize
virtual StatusCode initialize() override
Definition: TriggerProcessorTool.cxx:14
NSWL1::TriggerProcessorTool::TriggerProcessorTool
TriggerProcessorTool(const std::string &type, const std::string &name, const IInterface *parent)
Definition: TriggerProcessorTool.cxx:9
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
Muon::NSW_TrigRawData::bcId
uint16_t bcId() const
Definition: NSW_TrigRawData.h:27
AthAlgTool
Definition: AthAlgTool.h:26
TriggerProcessorTool.h
Muon::NSW_TrigRawDataContainer
Definition: NSW_TrigRawDataContainer.h:14
NSWL1
A trigger trigger candidate for a stgc sector.
Definition: NSWL1Simulation.cxx:9
DataVector::size
size_type size() const noexcept
Returns the number of elements in the collection.
Muon::NSW_TrigRawData::sectorSide
char sectorSide() const
Definition: NSW_TrigRawData.h:26