ATLAS Offline Software
Loading...
Searching...
No Matches
CmxRoIByteStreamAuxCnv.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
3*/
4
5// ============================================================================
6// Includes
7// ============================================================================
8// STD
9// ============================================================================
10#include <vector>
11#include <cstdint>
12#include <memory>
13#include <algorithm>
14// ============================================================================
15// Athena
16// ============================================================================
19
22
24#include "GaudiKernel/DataObject.h"
25#include "GaudiKernel/IOpaqueAddress.h"
26#include "GaudiKernel/IRegistry.h"
27#include "GaudiKernel/ISvcLocator.h"
28#include "GaudiKernel/StatusCode.h"
29
33
34// ============================================================================
35// TrigT1
36// ============================================================================
38// ============================================================================
39// xAOD
40// ============================================================================
44// ============================================================================
45// Local
46// ============================================================================
49#include "../ToString.h"
50// ============================================================================
51
52namespace LVL1BS {
54 Converter(storageType(), classID(), svcloc),
55 AthMessaging(svcloc != 0 ? msgSvc() : 0, "CmxRoIByteStreamAuxCnv"),
56 m_name("CmxRoIByteStreamAuxCnv"),
57 m_readTool("LVL1BS::JepRoiByteStreamV2Tool/JepRoiByteStreamV2Tool")
58{
59}
60
64
69
70// Init method gets all necessary services etc.
71
73 ATH_MSG_DEBUG("Initializing " << m_name);
74
75 CHECK(Converter::initialize());
76 CHECK(m_readTool.retrieve());
77
78 return StatusCode::SUCCESS;
79}
80
81// createObj should create the RDO from bytestream.
82StatusCode CmxRoIByteStreamAuxCnv::createObj(IOpaqueAddress* pAddr,
83 DataObject*& pObj) {
84 ATH_MSG_DEBUG("createObj() called");
85 // -------------------------------------------------------------------------
86 ByteStreamAddress *pBS_Addr = dynamic_cast<ByteStreamAddress *>(pAddr);
87 CHECK(pBS_Addr != nullptr);
88 // -------------------------------------------------------------------------
89 const std::string nm = *(pBS_Addr->par());
90 ATH_MSG_DEBUG("Creating Objects " << nm);
91
94 container.setStore(aux);
95 // -------------------------------------------------------------------------
96 LVL1::CMXRoI source;
97 StatusCode sc = m_readTool->convert(nm, &source);
98 if (sc.isFailure()) {
99 ATH_MSG_ERROR("Failed to create objects");
100 delete aux;
101 return sc;
102 }
103
104 xAOD::CMXRoI* item = new xAOD::CMXRoI();
105 container.push_back(item);
106
107 item->initialize(source.ex(), source.ey(), source.et(),
108 source.exError(), source.eyError(), source.etError(),
109 //source.sumEtHits(), source.missingEtHits(),
110 // amazurov: values for EtHits and missingEtHits are swaped in source
111 source.missingEtHits(), source.sumEtHits(),
112 source.missingEtSigHits(),
116 source.exError(LVL1::CMXRoI::SumType::MASKED),
117 source.eyError(LVL1::CMXRoI::SumType::MASKED),
118 source.etError(LVL1::CMXRoI::SumType::MASKED),
119 // source.sumEtHits(LVL1::CMXRoI::SumType::MASKED), source.missingEtHits(LVL1::CMXRoI::SumType::MASKED)
120 // amazurov: values for EtHits and missingEtHits are swaped in source
121 source.missingEtHits(LVL1::CMXRoI::SumType::MASKED), source.sumEtHits(LVL1::CMXRoI::SumType::MASKED)
122 );
123
124 // -------------------------------------------------------------------------
125 //ATH_MSG_VERBOSE(ToString(container));
126 ATH_MSG_DEBUG("Number of readed CMXRoI: " << aux->size());
127 // -------------------------------------------------------------------------
128 pObj = SG::asStorable(aux);
129 return StatusCode::SUCCESS;
130}
131
132// createRep should create the bytestream from RDOs.
133StatusCode CmxRoIByteStreamAuxCnv::createRep(DataObject* /*pObj*/,
134 IOpaqueAddress*& /*pAddr*/) {
135 return StatusCode::FAILURE;
136}
137
138} // end namespace
#define ATH_MSG_ERROR(x)
#define ATH_MSG_DEBUG(x)
a traits class that associates a CLID to a type T It also detects whether T inherits from Gaudi DataO...
Helpers for checking error return status codes and reporting errors.
#define CHECK(...)
Evaluate an expression and check for errors.
uint32_t CLID
The Class ID type.
static Double_t sc
Defines the ROB data entity. The ROB data is an abstract entity that is used to decouple the raw even...
convert to and from a SG storable
AthMessaging(IMessageSvc *msgSvc, const std::string &name)
Constructor.
IOpaqueAddress for ByteStreamCnvSvc, with ROB ids.
static constexpr long storageType()
virtual StatusCode createObj(IOpaqueAddress *pAddr, DataObject *&pObj)
Create TriggerTowers from ByteStream.
virtual StatusCode createRep(DataObject *pObj, IOpaqueAddress *&pAddr)
Create ByteStream from TriggerTowers.
ToolHandle< JepRoiByteStreamV2Tool > m_readTool
Do the main job - retrieve objects from robs.
std::string m_name
Converter name.
DataObject * asStorable(SG::DataObjectSharedPtr< T > pObject)
CMXRoI_v1 CMXRoI
Define the latest version of the CMXRoI class.
CMXRoIAuxContainer_v1 CMXRoIAuxContainer
Define the latest version of the CMXRoI auxiliary info.
CMXRoIContainer_v1 CMXRoIContainer
Define the latest version of the CMXRoI container.