|
ATLAS Offline Software
|
Go to the documentation of this file.
15 #include "CoralBase/Blob.h"
20 #include "Gaudi/Property.h"
31 ISvcLocator* pSvcLocator ) :
53 return StatusCode::SUCCESS;
74 const EventContext& ctx = Gaudi::Hive::currentContext();
80 return StatusCode::FAILURE;
87 return StatusCode::FAILURE;
94 coral::AttributeListSpecification*
spec =
new coral::AttributeListSpecification();
95 spec->extend(
"Shape",
"blob");
96 spec->extend(
"ShapeDer",
"blob");
97 spec->extend(
"TimeOffset",
"blob");
98 spec->extend<
unsigned>(
"nSamples");
99 spec->extend<
unsigned>(
"version");
103 const unsigned blobSize=hashMax*
nSamples;
107 attrList[
"version"].setValue(0U);
116 attrList[
"nSamples"].setValue(
nSamples);
117 shapeBlob.resize(blobSize*
sizeof(
float));
118 shapeDerBlob.resize(blobSize*
sizeof(
float));
119 toBlob.resize(hashMax*
sizeof(
float));
121 float *pShape=
static_cast<float*
>(shapeBlob.startingAddress());
122 float *pShapeDer=
static_cast<float*
>(shapeDerBlob.startingAddress());
123 float *pTimeOffset=
static_cast<float*
>(toBlob.startingAddress());
127 for (
unsigned i=0;
i<blobSize;++
i) {
133 for (
unsigned i=0;
i<hashMax;++
i) {
138 unsigned nTotalIds=0;
141 for (;scIt!=scIt_e;++scIt) {
149 const std::vector<Identifier> &cellIds=
m_scidTool->superCellToOfflineID(scId);
150 if (cellIds.empty()) {
151 ATH_MSG_ERROR(
"Got empty vector of cell ids for super cell id 0x"
153 return StatusCode::FAILURE;
158 const HWIdentifier scOnlId=cablingSC->createSignalChannelID(scId);
161 auto shape=cellShape->
Shape(
cabling->createSignalChannelID(cellId),0);
162 auto shapeDer=cellShape->
ShapeDer(
cabling->createSignalChannelID(cellId),0);
166 ATH_MSG_ERROR(
"Expected" <<
nSamples <<
", Shape:" << shape.size() <<
", ShapeDer:" << shapeDer.size());
167 return StatusCode::FAILURE;
180 coll->
add(0,attrList);
182 ATH_MSG_INFO(
"Total number of SuperCells:" << nTotalIds <<
", Tile:" << nTileIds
183 <<
", LAr: " << nTotalIds-nTileIds);
187 return StatusCode::SUCCESS;
def retrieve(aClass, aKey=None)
IdentifierHash channel_Hash(HWIdentifier channelId) const
Create channel_hash from channel_Id.
LArShapeToSCShape()
Default constructor:
This file defines the class for a collection of AttributeLists where each one is associated with a ch...
SG::ReadCondHandleKey< LArOnOffIdMapping > m_cablingKeySC
virtual ShapeRef_t ShapeDer(const HWIdentifier &id, int gain, int tbin=0, int mode=0) const =0
value_type get_compact() const
Get the compact id.
id_iterator cell_end(void) const
end iterator over full set of Identifiers (LAr + Tiles)
const std::string & key() const
Return the StoreGate ID for the referenced object.
bool is_tile(const Identifier id) const
test if the id belongs to the Tiles
virtual ~LArShapeToSCShape()
Destructor:
This class is a collection of AttributeLists where each one is associated with a channel number....
Defines a common ERRORCODE enum for LAr-Calibration objects.
const ServiceHandle< StoreGateSvc > & detStore() const
The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.
SG::ReadCondHandleKey< LArOnOffIdMapping > m_cablingKey
Helper class for offline supercell identifiers.
::StatusCode StatusCode
StatusCode definition for legacy code.
Helper class for offline supercell identifiers.
#define CHECK(...)
Evaluate an expression and check for errors.
id_iterator cell_begin(void) const
begin iterator over full set of Identifiers (LAr + Tiles)
virtual StatusCode execute() override
size_type channelHashMax(void) const
Define channel hash tables max size.
Helpers for checking error return status codes and reporting errors.
StatusCode initialize(bool used=true)
virtual StatusCode initialize() override
ToolHandle< ICaloSuperCellIDTool > m_scidTool
This is a "hash" representation of an Identifier. This encodes a 32 bit index which can be used to lo...
bool add(ChanNum chanNum, const AttributeList &attributeList)
Adding in chan/attrList pairs.
virtual ShapeRef_t Shape(const HWIdentifier &id, int gain, int tbin=0, int mode=0) const =0