Commit 3e91cc50 authored by Vakhtang Tsulaia's avatar Vakhtang Tsulaia
Browse files

Merge branch 'nsw_trigmerge' into 'master'

NSW Trigger RDO merging tool

See merge request atlas/athena!47122
parents 724ec2ff 4bd8c4a5
......@@ -16,6 +16,9 @@ class NSW_TrigRawDataSegment
public:
NSW_TrigRawDataSegment();
NSW_TrigRawDataSegment(uint8_t deltaTheta, uint8_t phiIndex, uint8_t rIndex, uint8_t spare,
bool lowRes, bool phiRes, bool monitor);
NSW_TrigRawDataSegment(uint8_t deltaTheta, uint8_t phiIndex, uint8_t rIndex,
bool lowRes, bool phiRes);
......@@ -24,19 +27,32 @@ class NSW_TrigRawDataSegment
uint8_t deltaTheta() {return m_deltaTheta;}
uint8_t phiIndex() {return m_phiIndex;}
uint8_t rIndex() {return m_rIndex;}
uint8_t spare() {return m_spare;}
bool lowRes() {return m_lowRes;}
bool phiRes() {return m_phiRes;}
bool monitor() {return m_monitor;}
void setDeltaTheta(uint8_t deltaTheta) { m_deltaTheta=deltaTheta; }
void setPhiIndex(uint8_t phiIndex) { m_phiIndex=phiIndex; }
void setRIndex(uint8_t rIndex) { m_rIndex=rIndex; }
void setSpare(uint8_t spare) {m_spare=spare; }
void setLowRes(bool lowRes) {m_lowRes=lowRes;}
void setPhiRes(bool phiRes) {m_phiRes=phiRes;}
void setMonitor(bool monitor) {m_monitor=monitor;}
private:
uint8_t m_deltaTheta;
uint8_t m_phiIndex;
uint8_t m_rIndex;
uint8_t m_spare;
bool m_lowRes;
bool m_phiRes;
bool m_monitor;
};
}
......
......@@ -8,16 +8,31 @@ Muon::NSW_TrigRawDataSegment::NSW_TrigRawDataSegment() :
m_deltaTheta(0),
m_phiIndex(0),
m_rIndex(0),
m_spare(0),
m_lowRes(false),
m_phiRes(false)
m_phiRes(false),
m_monitor(false)
{ }
Muon::NSW_TrigRawDataSegment::NSW_TrigRawDataSegment(uint8_t deltaTheta, uint8_t phiIndex, uint8_t rIndex, uint8_t spare,
bool lowRes, bool phiRes, bool monitor ) :
m_deltaTheta(deltaTheta),
m_phiIndex(phiIndex),
m_rIndex(rIndex),
m_spare(spare),
m_lowRes(lowRes),
m_phiRes(phiRes),
m_monitor(monitor)
{ }
Muon::NSW_TrigRawDataSegment::NSW_TrigRawDataSegment(uint8_t deltaTheta, uint8_t phiIndex, uint8_t rIndex,
bool lowRes, bool phiRes ) :
bool lowRes, bool phiRes) :
m_deltaTheta(deltaTheta),
m_phiIndex(phiIndex),
m_rIndex(rIndex),
m_spare(0),
m_lowRes(lowRes),
m_phiRes(phiRes)
m_phiRes(phiRes),
m_monitor(0)
{ }
/*
Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
*/
#ifndef TRIGGERPROCESSORTOOL_H
#define TRIGGERPROCESSORTOOL_H
#include "AthenaBaseComps/AthAlgTool.h"
#include "MuonRDO/NSW_PadTriggerDataContainer.h"
#include "MuonRDO/NSW_TrigRawDataContainer.h"
namespace NSWL1 {
class TriggerProcessorTool : public AthAlgTool {
public:
TriggerProcessorTool(const std::string& type,
const std::string& name,
const IInterface* parent);
virtual ~TriggerProcessorTool();
virtual StatusCode initialize() override;
StatusCode mergeRDO();
private:
SG::WriteHandleKey<Muon::NSW_TrigRawDataContainer> m_trigRdoContainerKey{this,"NSW_TrigRawData","Write handle key for NSW TrigRawData"};
SG::ReadHandleKey<Muon::NSW_PadTriggerDataContainer> m_padTriggerContainerKey{this,"NSWPADTRGRDO","Name of the pad trigger RDO"};
};
}
#endif // TRIGGERPROCESSORTOOL_H
/*
Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
*/
#include "TrigT1NSWSimTools/TriggerProcessorTool.h"
namespace NSWL1 {
TriggerProcessorTool::TriggerProcessorTool(const std::string& type, const std::string& name, const IInterface* parent) :
AthAlgTool(type,name,parent)
{
}
TriggerProcessorTool::~TriggerProcessorTool() { }
StatusCode TriggerProcessorTool::initialize() {
ATH_MSG_DEBUG("In initialize()");
ATH_CHECK(m_trigRdoContainerKey.initialize());
ATH_CHECK(m_padTriggerContainerKey.initialize());
return StatusCode::SUCCESS;
}
StatusCode TriggerProcessorTool::mergeRDO() {
SG::WriteHandle<Muon::NSW_TrigRawDataContainer> trigRdoContainer(m_trigRdoContainerKey);
ATH_CHECK(trigRdoContainer.record(std::make_unique<Muon::NSW_TrigRawDataContainer>()));
ATH_MSG_DEBUG("Recorded NSW_TrigRawDataContainer called " << trigRdoContainer.name() << " in store " << trigRdoContainer.store());
/// retrieve the stgc pad trigger container
SG::ReadHandle<Muon::NSW_PadTriggerDataContainer> padTriggerContainer(m_padTriggerContainerKey);
if (!padTriggerContainer.isValid()) {
ATH_MSG_ERROR("Could not find the STGC Pad Trigger container with name: " << padTriggerContainer.name() <<
" in store " << padTriggerContainer.store() );
return StatusCode::SUCCESS;
}
for ( const Muon::NSW_PadTriggerData* padTriggerData : *padTriggerContainer ) {
Muon::NSW_TrigRawData* trigRawData = new Muon::NSW_TrigRawData(padTriggerData->sectorID(),padTriggerData->BCID());
for ( const Muon::NSW_PadTriggerSegment* padTriggerSegment : *padTriggerData) {
Muon::NSW_TrigRawDataSegment* trigRawDataSegment = new Muon::NSW_TrigRawDataSegment();
uint8_t bandID = padTriggerSegment->bandID();
uint8_t phiID = padTriggerSegment->phiID();
trigRawDataSegment->setRIndex(bandID);
trigRawDataSegment->setPhiIndex(phiID);
// set STGC
trigRawDataSegment->setPhiRes(false);
trigRawData->push_back(trigRawDataSegment);
}
trigRdoContainer->push_back(trigRawData);
}
return StatusCode::SUCCESS;
}
}
......@@ -7,6 +7,7 @@
#include "TrigT1NSWSimTools/MMStripTdsOfflineTool.h"
#include "TrigT1NSWSimTools/MMFPGAOfflineTool.h"
#include "TrigT1NSWSimTools/MMTriggerTool.h"
#include "TrigT1NSWSimTools/TriggerProcessorTool.h"
using NSWL1::PadTdsOfflineTool;
using NSWL1::PadTriggerLogicOfflineTool;
......@@ -17,6 +18,7 @@ using NSWL1::StripSegmentTool;
using NSWL1::MMStripTdsOfflineTool;
using NSWL1::MMFPGAOfflineTool;
using NSWL1::MMTriggerTool;
using NSWL1::TriggerProcessorTool;
DECLARE_COMPONENT( PadTdsOfflineTool )
DECLARE_COMPONENT( PadTriggerLogicOfflineTool )
......@@ -27,3 +29,4 @@ DECLARE_COMPONENT( StripSegmentTool )
DECLARE_COMPONENT( MMStripTdsOfflineTool )
DECLARE_COMPONENT( MMFPGAOfflineTool )
DECLARE_COMPONENT( MMTriggerTool )
DECLARE_COMPONENT( TriggerProcessorTool )
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment