|
ATLAS Offline Software
|
Go to the documentation of this file.
12 #include "CoralBase/Blob.h"
17 ISvcLocator* pSvcLocator ) :
20 m_onlineID(nullptr), m_onlineSCID(nullptr)
28 return StatusCode::SUCCESS;
34 const std::string&
outputName,
const unsigned nGain) {
37 unsigned nCopiedEMPS=0;
40 coral::AttributeListSpecification*
spec =
new coral::AttributeListSpecification();
41 spec->extend(blobName,
"blob");
42 spec->extend<
unsigned>(
"version");
43 std::unique_ptr<CondAttrListCollection> coll= std::make_unique<CondAttrListCollection>(
true);
45 std::ifstream myfile(
input);
47 std::vector< std::vector<float> >
values;
56 while (std::getline(myfile,
line)) {
57 std::stringstream st(
line);
59 st>>std::dec>>
id>>std::dec>>
value;
82 auto attrList = std::make_unique<coral::AttributeList>(*
spec);
83 (*attrList)[
"version"].setValue(0U);
86 float* pblob=
static_cast<float*
>(
blob.startingAddress());
91 unsigned coolChan=
gain;
93 coll->add(coolChan,*attrList.release());
96 ATH_MSG_INFO(
"Converted " << blobName <<
" to inline storage. Total number of channels=" <<
nChannels );
97 ATH_MSG_INFO(
"Number of channels filled with default value (1.0) " << nDefault <<
" (including disconnected)" );
99 ATH_MSG_INFO(
"\t Number of low gain EMBPS channels copied from medium gain" << nCopiedEMPS );
101 if (
sc.isFailure()) {
113 std::vector<std::vector<std::vector<float> > > vofc_a;
114 std::vector<std::vector<std::vector<float> > > vofc_b;
122 std::ifstream myfile(
input);
126 unsigned long id, id1;
127 unsigned hash, hash1;
128 char mychar, mychar1;
129 while (std::getline(myfile,
line),std::getline(myfile,
line1)) {
130 std::stringstream st(
line);
131 st>>std::hex>>
id>>std::dec>>
hash;
132 std::stringstream st1(
line1);
133 st>>std::hex>>id1>>std::dec>>hash1;
135 if(
id != id1 ||
hash != hash1) {
142 if(mychar !=
'a' || mychar1 !=
'b') {
153 coral::AttributeListSpecification*
spec =
new coral::AttributeListSpecification();
154 spec->extend(
"OFCa",
"blob");
155 spec->extend(
"OFCb",
"blob");
156 spec->extend(
"TimeOffset",
"blob");
157 spec->extend<
unsigned>(
"nSamples");
158 spec->extend<
unsigned>(
"version");
159 auto collOFC = std::make_unique<CondAttrListCollection>(
true);
165 auto attrList = std::make_unique<coral::AttributeList>(*
spec);
166 (*attrList)[
"version"].setValue(0U);
171 (*attrList)[
"nSamples"].setValue(
m_nsample);
176 float* pOfca=
static_cast<float*
>(ofcaBlob.startingAddress());
177 float* pOfcb=
static_cast<float*
>(ofcbBlob.startingAddress());
178 float* pTimeOffset=
static_cast<float*
>(toBlob.startingAddress());
191 message <<
"Number of samples don't match. Expect " <<
m_nsample <<
", got " << ofca.size() <<
".";
206 message <<
"Number of samples don't match. Expect " <<
m_nsample <<
", got " << ofcb.size() <<
".";
212 pTimeOffset[
hs]=timeOffset;
216 collOFC->add(
gain,*(attrList.release()));
220 if (
sc.isFailure()) {
226 ATH_MSG_INFO(
"Number of channels filled with default OFCs {1,1,1,1} " << nDefault <<
" (including disconnected)" );
249 myfile.unsetf(std::ios_base::skipws);
252 unsigned line_count =
std::count( std::istream_iterator<char>(myfile),
253 std::istream_iterator<char>(),
'\n');
257 return StatusCode::FAILURE;
270 myfile.unsetf(std::ios_base::skipws);
273 unsigned line_count =
std::count( std::istream_iterator<char>(myfile),
274 std::istream_iterator<char>(),
'\n');
279 return StatusCode::FAILURE;
285 return StatusCode::SUCCESS;
301 if (
cabling->isOnlineConnected(chid)) {
def retrieve(aClass, aKey=None)
unsigned constexpr int nChannels
IdentifierHash channel_Hash(HWIdentifier channelId) const
Create channel_hash from channel_Id.
This file defines the class for a collection of AttributeLists where each one is associated with a ch...
Gaudi::Property< std::string > m_OFCInput
Input files.
void ofcFlat(const std::string &input, const std::string &outputName)
Gaudi::Property< bool > m_checkCompletness
Gaudi::Property< std::string > m_BlobName
const std::string & key() const
Return the StoreGate ID for the referenced object.
virtual StatusCode stop() override
LArFlatFromFile()
Default constructor:
const ServiceHandle< StoreGateSvc > & detStore() const
The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.
virtual StatusCode initialize() override
const LArOnline_SuperCellID * m_onlineSCID
::StatusCode StatusCode
StatusCode definition for legacy code.
HWIdentifier channel_Id(int barrel_ec, int pos_neg, int feedthrough, int slot, int channel) const
create channel identifier from fields
const LArOnlineID * m_onlineID
void singleFloatFlat(const char *blobName, const std::string &input, const std::string &outputName, const unsigned nGain)
Gaudi::Property< unsigned > m_ngain
Gaudi::Property< std::string > m_SingleInput
size_type channelHashMax(void) const
Define channel hash tables max size.
StatusCode initialize(bool used=true)
Gaudi::Property< bool > m_isSC
void errIfConnected(const HWIdentifier chid, const int gain, const std::string &objName, const std::string &message="") const
bool isEMBPS(const HWIdentifier id) const
SG::ReadCondHandleKey< LArOnOffIdMapping > m_cablingKey
Gaudi::Property< unsigned > m_nsample
std::string channel_name(const HWIdentifier id) const
Return a string corresponding to a feedthrough name given an identifier.
Proxy for accessing a range of float values like a vector.
Gaudi::Property< std::string > m_Folder