ATLAS Offline Software
Loading...
Searching...
No Matches
Muon::NSWMMTP_ROD_Decoder Class Reference

#include <NSWMMTP_ROD_Decoder.h>

Inheritance diagram for Muon::NSWMMTP_ROD_Decoder:
Collaboration diagram for Muon::NSWMMTP_ROD_Decoder:

Public Member Functions

 NSWMMTP_ROD_Decoder (const std::string &type, const std::string &name, const IInterface *parent)
StatusCode fillCollection (const OFFLINE_FRAGMENTS_NAMESPACE::ROBFragment &fragment, xAOD::NSWMMTPRDOContainer &rdoContainer) const override
StatusCode initialize () override
 DeclareInterfaceID (Muon::INSWMMTP_ROD_Decoder, 1, 0)
ServiceHandle< StoreGateSvc > & evtStore ()
 The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.
const ServiceHandle< StoreGateSvc > & detStore () const
 The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.
virtual StatusCode sysInitialize () override
 Perform system initialization for an algorithm.
virtual StatusCode sysStart () override
 Handle START transition.
virtual std::vector< Gaudi::DataHandle * > inputHandles () const override
 Return this algorithm's input handles.
virtual std::vector< Gaudi::DataHandle * > outputHandles () const override
 Return this algorithm's output handles.
Gaudi::Details::PropertyBase & declareProperty (Gaudi::Property< T, V, H > &t)
void updateVHKA (Gaudi::Details::PropertyBase &)
MsgStream & msg () const
bool msgLvl (const MSG::Level lvl) const

Protected Member Functions

void renounceArray (SG::VarHandleKeyArray &handlesArray)
 remove all handles from I/O resolution
std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > renounce (T &h)
void extraDeps_update_handler (Gaudi::Details::PropertyBase &ExtraDeps)
 Add StoreName to extra input/output deps as needed.

Private Types

typedef ServiceHandle< StoreGateSvcStoreGateSvc_t

Private Member Functions

Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
 specialization for handling Gaudi::Property<SG::VarHandleKey>

Private Attributes

ServiceHandle< Muon::IMuonIdHelperSvcm_idHelperSvc {this, "MuonIdHelperSvc", "Muon::MuonIdHelperSvc/MuonIdHelperSvc"}
StoreGateSvc_t m_evtStore
 Pointer to StoreGate (event store by default)
StoreGateSvc_t m_detStore
 Pointer to StoreGate (detector store by default)
std::vector< SG::VarHandleKeyArray * > m_vhka
bool m_varHandleArraysDeclared

Detailed Description

Definition at line 16 of file NSWMMTP_ROD_Decoder.h.

Member Typedef Documentation

◆ StoreGateSvc_t

typedef ServiceHandle<StoreGateSvc> AthCommonDataStore< AthCommonMsg< AlgTool > >::StoreGateSvc_t
privateinherited

Definition at line 388 of file AthCommonDataStore.h.

Constructor & Destructor Documentation

◆ NSWMMTP_ROD_Decoder()

Muon::NSWMMTP_ROD_Decoder::NSWMMTP_ROD_Decoder ( const std::string & type,
const std::string & name,
const IInterface * parent )

Definition at line 17 of file NSWMMTP_ROD_Decoder.cxx.

18: AthAlgTool(type, name, parent)
19{
20 declareInterface<INSWMMTP_ROD_Decoder>( this );
21}
AthAlgTool()
Default constructor:

Member Function Documentation

◆ declareGaudiProperty()

Gaudi::Details::PropertyBase & AthCommonDataStore< AthCommonMsg< AlgTool > >::declareGaudiProperty ( Gaudi::Property< T, V, H > & hndl,
const SG::VarHandleKeyType &  )
inlineprivateinherited

specialization for handling Gaudi::Property<SG::VarHandleKey>

Definition at line 156 of file AthCommonDataStore.h.

158 {
160 hndl.value(),
161 hndl.documentation());
162
163 }
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)

◆ DeclareInterfaceID()

Muon::INSWMMTP_ROD_Decoder::DeclareInterfaceID ( Muon::INSWMMTP_ROD_Decoder ,
1 ,
0  )
inherited

◆ declareProperty()

Gaudi::Details::PropertyBase & AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty ( Gaudi::Property< T, V, H > & t)
inlineinherited

Definition at line 145 of file AthCommonDataStore.h.

145 {
146 typedef typename SG::HandleClassifier<T>::type htype;
148 }
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>

◆ detStore()

const ServiceHandle< StoreGateSvc > & AthCommonDataStore< AthCommonMsg< AlgTool > >::detStore ( ) const
inlineinherited

The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 95 of file AthCommonDataStore.h.

◆ evtStore()

ServiceHandle< StoreGateSvc > & AthCommonDataStore< AthCommonMsg< AlgTool > >::evtStore ( )
inlineinherited

The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 85 of file AthCommonDataStore.h.

◆ extraDeps_update_handler()

void AthCommonDataStore< AthCommonMsg< AlgTool > >::extraDeps_update_handler ( Gaudi::Details::PropertyBase & ExtraDeps)
protectedinherited

Add StoreName to extra input/output deps as needed.

use the logic of the VarHandleKey to parse the DataObjID keys supplied via the ExtraInputs and ExtraOuputs Properties to add the StoreName if it's not explicitly given

◆ fillCollection()

StatusCode Muon::NSWMMTP_ROD_Decoder::fillCollection ( const OFFLINE_FRAGMENTS_NAMESPACE::ROBFragment & fragment,
xAOD::NSWMMTPRDOContainer & rdoContainer ) const
overridevirtual

Implements Muon::INSWMMTP_ROD_Decoder.

Definition at line 29 of file NSWMMTP_ROD_Decoder.cxx.

30{
31
32 try {
33 fragment.check();
34 } catch (eformat::Issue &ex) {
35 ATH_MSG_WARNING(ex.what());
36 return StatusCode::SUCCESS;
37 }
38
39
40 const Muon::nsw::NSWTriggerCommonDecoder decoder{fragment, "MML1A"};
41
42 if (decoder.has_error()) {
43 ATH_MSG_DEBUG("NSW MMTP Common Decoder found exceptions while reading this MML1A fragment from " + std::to_string(fragment.rob_source_id()) + ". Skipping. Error id: "+std::to_string(decoder.error_id()));
44 return StatusCode::SUCCESS;
45 }
46
47 if (decoder.get_elinks().size()!=3 && decoder.get_elinks().size()!=5) {
48 // this is a severe requirement: a single elink missing would imply the whole event is problematic
49 ATH_MSG_DEBUG("NSW MMTP Common Decoder didn't give 3 or 5 elinks in output: something off with this fragment. Skipping.");
50 return StatusCode::SUCCESS;
51 }
52
53 //for all the 3/5 elinks expected, the MMTP header parameters should be the same by design
54 //checking consistency of a fraction of the header
55 bool consistent = true;
56 const auto l0 = static_cast<const Muon::nsw::NSWTriggerMML1AElink*>(decoder.get_elinks()[0].get());
57 for(const auto& baseLink: decoder.get_elinks()) {
58 const auto l = static_cast<const Muon::nsw::NSWTriggerMML1AElink*>(baseLink.get());
59 if (l0->head_sectID() != l->head_sectID()) {consistent = false; break;}
60 if (l0->L1ID() != l->L1ID()) {consistent = false; break;}
61 if (l0->l1a_versionID() != l->l1a_versionID()) {consistent = false; break;}
62 if (l0->l1a_req_BCID() != l->l1a_req_BCID()) {consistent = false; break;}
63 }
64 if (!consistent) {
65 ATH_MSG_DEBUG("NSW MMTP Common Decoder found inconsistent header parameters in the elinks: something off with this fragment. Skipping.");
66 return StatusCode::SUCCESS;
67 }
68
69 //TODO add checks: engines, timeouts, constants and elinks ID vs stream IDs
70
72 rdoContainer.push_back(rdo);
73
74 //this info is redundant with elinkID in the decoded packet! Wanna add a check in the future?
75 uint32_t sid = fragment.rob_source_id ();
76 eformat::helper::SourceIdentifier source_id (sid);
77 //eformat::SubDetector s = source_id.subdetector_id ();
78 uint16_t m = source_id.module_id ();
79
80 //ROD info
81 rdo->set_sourceID(sid);
82 rdo->set_moduleID(m);
83 rdo->set_ROD_L1ID(fragment.rod_lvl1_id ());
84 rdo->set_ROD_BCID(fragment.rod_bc_id ());
85
86 //TP head
87 rdo->set_EC(l0->head_EC());
88 rdo->set_sectID(l0->head_sectID());
89 rdo->set_L1ID(l0->L1ID());
90 rdo->set_BCID(l0->head_BCID());
91
92 //TP L1A head
93 rdo->set_l1a_request_BCID(l0->l1a_local_req_BCID());
94 rdo->set_l1a_release_BCID(l0->l1a_local_rel_BCID());
95 rdo->set_l1a_window_open(l0->l1a_open_BCID());
96 rdo->set_l1a_window_center(l0->l1a_req_BCID());
97 rdo->set_l1a_window_close(l0->l1a_close_BCID());
98 rdo->set_l1a_window_open_offset(l0->l1a_open_BCID_offset());
99 rdo->set_l1a_window_center_offset(l0->l1a_req_BCID_offset());
100 rdo->set_l1a_window_close_offset(l0->l1a_close_BCID_offset());
101
102 //L1A data quality
103 rdo->set_l1a_timeout(l0->l1a_timeout());
104 rdo->set_l1a_engines(l0->l1a_engine_snapshot());
105
106 for(const auto& baseLink: decoder.get_elinks()){
107 const auto l = dynamic_cast<const Muon::nsw::NSWTriggerMML1AElink*>(baseLink.get());
108
109 if (l->l1a_timeout()==0) {ATH_MSG_DEBUG("NSW MMTP Common Decoder reporting timeout condition: unclear if current event can be trusted");}
110
111 for (const auto& a: l->art_packets()) {
112 for (const auto& c: a->channels()) {
113 rdo->art_BCID().push_back(a->art_BCID());
114 rdo->art_layer().push_back(c.first);
115 rdo->art_channel().push_back(c.second);
116 }
117 }
118 for (const auto& t: l->trig_packets()) {
119 rdo->trig_globalX().push_back(t->trig_globalX());
120 rdo->trig_globalU().push_back(t->trig_globalU());
121 rdo->trig_BCID().push_back(t->trig_BCID());
122 rdo->trig_dTheta().push_back(t->trig_dTheta());
123 rdo->trig_ROI_rID().push_back(t->trig_rBin());
124 rdo->trig_ROI_phiID().push_back(t->trig_phiBin());
125 }
126
127 }
128
129
130 return StatusCode::SUCCESS;
131}
#define ATH_MSG_WARNING(x)
#define ATH_MSG_DEBUG(x)
static Double_t a
value_type push_back(value_type pElem)
Add an element to the end of the collection.
T * get(TKey *tobj)
get a TObject* from a TKey* (why can't a TObject be a TKey?)
Definition hcg.cxx:130
l
Printing final latex table to .tex output file.
setWord1 uint16_t
NSWMMTPRDO_v1 NSWMMTPRDO
Define the version of the NSW MM RDO class.
Definition NSWMMTPRDO.h:13
setEventNumber uint32_t

◆ initialize()

StatusCode Muon::NSWMMTP_ROD_Decoder::initialize ( )
override

Definition at line 24 of file NSWMMTP_ROD_Decoder.cxx.

24 {
25 ATH_CHECK(m_idHelperSvc.retrieve());
26 return StatusCode::SUCCESS;
27}
#define ATH_CHECK
Evaluate an expression and check for errors.
ServiceHandle< Muon::IMuonIdHelperSvc > m_idHelperSvc

◆ inputHandles()

virtual std::vector< Gaudi::DataHandle * > AthCommonDataStore< AthCommonMsg< AlgTool > >::inputHandles ( ) const
overridevirtualinherited

Return this algorithm's input handles.

We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.

◆ msg()

MsgStream & AthCommonMsg< AlgTool >::msg ( ) const
inlineinherited

Definition at line 24 of file AthCommonMsg.h.

24 {
25 return this->msgStream();
26 }

◆ msgLvl()

bool AthCommonMsg< AlgTool >::msgLvl ( const MSG::Level lvl) const
inlineinherited

Definition at line 30 of file AthCommonMsg.h.

30 {
31 return this->msgLevel(lvl);
32 }

◆ outputHandles()

virtual std::vector< Gaudi::DataHandle * > AthCommonDataStore< AthCommonMsg< AlgTool > >::outputHandles ( ) const
overridevirtualinherited

Return this algorithm's output handles.

We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.

◆ renounce()

std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > AthCommonDataStore< AthCommonMsg< AlgTool > >::renounce ( T & h)
inlineprotectedinherited

Definition at line 380 of file AthCommonDataStore.h.

381 {
382 h.renounce();
384 }
std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > renounce(T &h)

◆ renounceArray()

void AthCommonDataStore< AthCommonMsg< AlgTool > >::renounceArray ( SG::VarHandleKeyArray & handlesArray)
inlineprotectedinherited

remove all handles from I/O resolution

Definition at line 364 of file AthCommonDataStore.h.

364 {
366 }

◆ sysInitialize()

virtual StatusCode AthCommonDataStore< AthCommonMsg< AlgTool > >::sysInitialize ( )
overridevirtualinherited

Perform system initialization for an algorithm.

We override this to declare all the elements of handle key arrays at the end of initialization. See comments on updateVHKA.

Reimplemented in asg::AsgMetadataTool, AthCheckedComponent< AthAlgTool >, AthCheckedComponent<::AthAlgTool >, and DerivationFramework::CfAthAlgTool.

◆ sysStart()

virtual StatusCode AthCommonDataStore< AthCommonMsg< AlgTool > >::sysStart ( )
overridevirtualinherited

Handle START transition.

We override this in order to make sure that conditions handle keys can cache a pointer to the conditions container.

◆ updateVHKA()

void AthCommonDataStore< AthCommonMsg< AlgTool > >::updateVHKA ( Gaudi::Details::PropertyBase & )
inlineinherited

Definition at line 308 of file AthCommonDataStore.h.

308 {
309 // debug() << "updateVHKA for property " << p.name() << " " << p.toString()
310 // << " size: " << m_vhka.size() << endmsg;
311 for (auto &a : m_vhka) {
313 for (auto k : keys) {
314 k->setOwner(this);
315 }
316 }
317 }
std::vector< SG::VarHandleKeyArray * > m_vhka

Member Data Documentation

◆ m_detStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< AlgTool > >::m_detStore
privateinherited

Pointer to StoreGate (detector store by default)

Definition at line 393 of file AthCommonDataStore.h.

◆ m_evtStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< AlgTool > >::m_evtStore
privateinherited

Pointer to StoreGate (event store by default)

Definition at line 390 of file AthCommonDataStore.h.

◆ m_idHelperSvc

ServiceHandle<Muon::IMuonIdHelperSvc> Muon::NSWMMTP_ROD_Decoder::m_idHelperSvc {this, "MuonIdHelperSvc", "Muon::MuonIdHelperSvc/MuonIdHelperSvc"}
private

Definition at line 28 of file NSWMMTP_ROD_Decoder.h.

28{this, "MuonIdHelperSvc", "Muon::MuonIdHelperSvc/MuonIdHelperSvc"};

◆ m_varHandleArraysDeclared

bool AthCommonDataStore< AthCommonMsg< AlgTool > >::m_varHandleArraysDeclared
privateinherited

Definition at line 399 of file AthCommonDataStore.h.

◆ m_vhka

std::vector<SG::VarHandleKeyArray*> AthCommonDataStore< AthCommonMsg< AlgTool > >::m_vhka
privateinherited

Definition at line 398 of file AthCommonDataStore.h.


The documentation for this class was generated from the following files: