|
ATLAS Offline Software
|
#include <LArFlatFromFile.h>
|
| LArFlatFromFile (const std::string &name, ISvcLocator *pSvcLocator) |
| Constructor with parameters: More...
|
|
virtual | ~LArFlatFromFile ()=default |
| Destructor: More...
|
|
virtual StatusCode | initialize () override |
|
virtual StatusCode | execute () override |
|
virtual StatusCode | finalize () override |
|
virtual StatusCode | stop () override |
|
virtual StatusCode | sysInitialize () override |
| Override sysInitialize. More...
|
|
virtual const DataObjIDColl & | extraOutputDeps () const override |
| Return the list of extra output dependencies. More...
|
|
ServiceHandle< StoreGateSvc > & | evtStore () |
| The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc . More...
|
|
const ServiceHandle< StoreGateSvc > & | evtStore () const |
| The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc . More...
|
|
const ServiceHandle< StoreGateSvc > & | detStore () const |
| The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc . More...
|
|
virtual StatusCode | sysStart () override |
| Handle START transition. More...
|
|
virtual std::vector< Gaudi::DataHandle * > | inputHandles () const override |
| Return this algorithm's input handles. More...
|
|
virtual std::vector< Gaudi::DataHandle * > | outputHandles () const override |
| Return this algorithm's output handles. More...
|
|
Gaudi::Details::PropertyBase & | declareProperty (Gaudi::Property< T > &t) |
|
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, SG::VarHandleKey &hndl, const std::string &doc, const SG::VarHandleKeyType &) |
| Declare a new Gaudi property. More...
|
|
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, SG::VarHandleBase &hndl, const std::string &doc, const SG::VarHandleType &) |
| Declare a new Gaudi property. More...
|
|
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, SG::VarHandleKeyArray &hndArr, const std::string &doc, const SG::VarHandleKeyArrayType &) |
|
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, T &property, const std::string &doc, const SG::NotHandleType &) |
| Declare a new Gaudi property. More...
|
|
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, T &property, const std::string &doc="none") |
| Declare a new Gaudi property. More...
|
|
void | updateVHKA (Gaudi::Details::PropertyBase &) |
|
MsgStream & | msg () const |
|
MsgStream & | msg (const MSG::Level lvl) const |
|
bool | msgLvl (const MSG::Level lvl) const |
|
|
| LArFlatFromFile () |
| Default constructor: More...
|
|
void | singleFloatFlat (const char *blobName, const std::string &input, const std::string &outputName, const unsigned nGain) |
|
void | ofcFlat (const std::string &input, const std::string &outputName) |
|
void | errIfConnected (const HWIdentifier chid, const int gain, const std::string &objName, const std::string &message="") const |
|
Gaudi::Details::PropertyBase & | declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &) |
| specialization for handling Gaudi::Property<SG::VarHandleKey> More...
|
|
Gaudi::Details::PropertyBase & | declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleKeyArrayType &) |
| specialization for handling Gaudi::Property<SG::VarHandleKeyArray> More...
|
|
Gaudi::Details::PropertyBase & | declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleType &) |
| specialization for handling Gaudi::Property<SG::VarHandleBase> More...
|
|
Gaudi::Details::PropertyBase & | declareGaudiProperty (Gaudi::Property< T > &t, const SG::NotHandleType &) |
| specialization for handling everything that's not a Gaudi::Property<SG::VarHandleKey> or a <SG::VarHandleKeyArray> More...
|
|
|
unsigned | m_hashMax {} |
|
const LArOnlineID * | m_onlineID {} |
|
const LArOnline_SuperCellID * | m_onlineSCID {} |
|
SG::ReadCondHandleKey< LArOnOffIdMapping > | m_cablingKey {this,"CablingKey","LArOnOffIdMap","SG Key of LArOnOffIdMapping object"} |
|
Gaudi::Property< std::string > | m_OFCInput {this, "OFCInput","","Input file name"} |
| Input files. More...
|
|
Gaudi::Property< std::string > | m_SingleInput {this, "SingleInput","","Input file name"} |
|
Gaudi::Property< bool > | m_isSC {this,"SuperCells",false,"Run for SC ?"} |
|
Gaudi::Property< unsigned > | m_ngain {this,"NGains",1,"Number of gains to process"} |
|
Gaudi::Property< unsigned > | m_nsample {this,"NSamples",4,"Number of samples to process"} |
|
Gaudi::Property< std::string > | m_Folder {this, "Folder","","Folder to create"} |
|
Gaudi::Property< std::string > | m_BlobName {this, "Blob","","Blob name"} |
|
Gaudi::Property< bool > | m_checkCompletness {this, "checkInput", true, "Check if input file is complete"} |
|
bool | m_forceStop {} |
|
DataObjIDColl | m_extendedExtraObjects |
|
StoreGateSvc_t | m_evtStore |
| Pointer to StoreGate (event store by default) More...
|
|
StoreGateSvc_t | m_detStore |
| Pointer to StoreGate (detector store by default) More...
|
|
std::vector< SG::VarHandleKeyArray * > | m_vhka |
|
bool | m_varHandleArraysDeclared |
|
Definition at line 17 of file LArFlatFromFile.h.
◆ StoreGateSvc_t
◆ LArFlatFromFile() [1/2]
LArFlatFromFile::LArFlatFromFile |
( |
const std::string & |
name, |
|
|
ISvcLocator * |
pSvcLocator |
|
) |
| |
◆ ~LArFlatFromFile()
virtual LArFlatFromFile::~LArFlatFromFile |
( |
| ) |
|
|
virtualdefault |
◆ LArFlatFromFile() [2/2]
LArFlatFromFile::LArFlatFromFile |
( |
| ) |
|
|
private |
◆ declareGaudiProperty() [1/4]
specialization for handling Gaudi::Property<SG::VarHandleKeyArray>
Definition at line 170 of file AthCommonDataStore.h.
175 hndl.documentation());
◆ declareGaudiProperty() [2/4]
specialization for handling Gaudi::Property<SG::VarHandleKey>
Definition at line 156 of file AthCommonDataStore.h.
161 hndl.documentation());
◆ declareGaudiProperty() [3/4]
specialization for handling Gaudi::Property<SG::VarHandleBase>
Definition at line 184 of file AthCommonDataStore.h.
189 hndl.documentation());
◆ declareGaudiProperty() [4/4]
◆ declareProperty() [1/6]
Declare a new Gaudi property.
- Parameters
-
name | Name of the property. |
hndl | Object holding the property value. |
doc | Documentation string for the property. |
This is the version for types that derive from SG::VarHandleBase
. The property value object is put on the input and output lists as appropriate; then we forward to the base class.
Definition at line 245 of file AthCommonDataStore.h.
250 this->declare(hndl.
vhKey());
251 hndl.
vhKey().setOwner(
this);
253 return PBASE::declareProperty(
name,hndl,
doc);
◆ declareProperty() [2/6]
Declare a new Gaudi property.
- Parameters
-
name | Name of the property. |
hndl | Object holding the property value. |
doc | Documentation string for the property. |
This is the version for types that derive from SG::VarHandleKey
. The property value object is put on the input and output lists as appropriate; then we forward to the base class.
Definition at line 221 of file AthCommonDataStore.h.
229 return PBASE::declareProperty(
name,hndl,
doc);
◆ declareProperty() [3/6]
◆ declareProperty() [4/6]
Declare a new Gaudi property.
- Parameters
-
name | Name of the property. |
property | Object holding the property value. |
doc | Documentation string for the property. |
This is the generic version, for types that do not derive from SG::VarHandleKey
. It just forwards to the base class version of declareProperty
.
Definition at line 333 of file AthCommonDataStore.h.
338 return PBASE::declareProperty(
name, property,
doc);
◆ declareProperty() [5/6]
Declare a new Gaudi property.
- Parameters
-
name | Name of the property. |
property | Object holding the property value. |
doc | Documentation string for the property. |
This dispatches to either the generic declareProperty
or the one for VarHandle/Key/KeyArray.
Definition at line 352 of file AthCommonDataStore.h.
◆ declareProperty() [6/6]
◆ detStore()
◆ errIfConnected()
◆ evtStore() [1/2]
◆ evtStore() [2/2]
◆ execute()
virtual StatusCode LArFlatFromFile::execute |
( |
| ) |
|
|
inlineoverridevirtual |
◆ extraDeps_update_handler()
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
◆ extraOutputDeps()
const DataObjIDColl & AthAlgorithm::extraOutputDeps |
( |
| ) |
const |
|
overridevirtualinherited |
Return the list of extra output dependencies.
This list is extended to include symlinks implied by inheritance relations.
Definition at line 50 of file AthAlgorithm.cxx.
57 return Algorithm::extraOutputDeps();
◆ finalize()
virtual StatusCode LArFlatFromFile::finalize |
( |
| ) |
|
|
inlineoverridevirtual |
◆ initialize()
StatusCode LArFlatFromFile::initialize |
( |
| ) |
|
|
overridevirtual |
◆ inputHandles()
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() [1/2]
◆ msg() [2/2]
◆ msgLvl()
◆ ofcFlat()
void LArFlatFromFile::ofcFlat |
( |
const std::string & |
input, |
|
|
const std::string & |
outputName |
|
) |
| |
|
private |
Definition at line 109 of file LArFlatFromFile.cxx.
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)" );
◆ outputHandles()
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()
◆ renounceArray()
◆ singleFloatFlat()
void LArFlatFromFile::singleFloatFlat |
( |
const char * |
blobName, |
|
|
const std::string & |
input, |
|
|
const std::string & |
outputName, |
|
|
const unsigned |
nGain |
|
) |
| |
|
private |
Definition at line 33 of file LArFlatFromFile.cxx.
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()) {
◆ stop()
StatusCode LArFlatFromFile::stop |
( |
| ) |
|
|
overridevirtual |
Definition at line 232 of file LArFlatFromFile.cxx.
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;
◆ sysInitialize()
StatusCode AthAlgorithm::sysInitialize |
( |
| ) |
|
|
overridevirtualinherited |
◆ sysStart()
Handle START transition.
We override this in order to make sure that conditions handle keys can cache a pointer to the conditions container.
◆ updateVHKA()
◆ m_BlobName
Gaudi::Property<std::string> LArFlatFromFile::m_BlobName {this, "Blob","","Blob name"} |
|
private |
◆ m_cablingKey
◆ m_checkCompletness
Gaudi::Property<bool> LArFlatFromFile::m_checkCompletness {this, "checkInput", true, "Check if input file is complete"} |
|
private |
◆ m_detStore
◆ m_evtStore
◆ m_extendedExtraObjects
DataObjIDColl AthAlgorithm::m_extendedExtraObjects |
|
privateinherited |
◆ m_Folder
Gaudi::Property<std::string> LArFlatFromFile::m_Folder {this, "Folder","","Folder to create"} |
|
private |
◆ m_forceStop
bool LArFlatFromFile::m_forceStop {} |
|
private |
◆ m_hashMax
unsigned LArFlatFromFile::m_hashMax {} |
|
private |
◆ m_isSC
Gaudi::Property<bool> LArFlatFromFile::m_isSC {this,"SuperCells",false,"Run for SC ?"} |
|
private |
◆ m_ngain
Gaudi::Property<unsigned> LArFlatFromFile::m_ngain {this,"NGains",1,"Number of gains to process"} |
|
private |
◆ m_nsample
Gaudi::Property<unsigned> LArFlatFromFile::m_nsample {this,"NSamples",4,"Number of samples to process"} |
|
private |
◆ m_OFCInput
Gaudi::Property<std::string> LArFlatFromFile::m_OFCInput {this, "OFCInput","","Input file name"} |
|
private |
◆ m_onlineID
◆ m_onlineSCID
◆ m_SingleInput
Gaudi::Property<std::string> LArFlatFromFile::m_SingleInput {this, "SingleInput","","Input file name"} |
|
private |
◆ m_varHandleArraysDeclared
◆ m_vhka
The documentation for this class was generated from the following files:
def retrieve(aClass, aKey=None)
unsigned constexpr int nChannels
IdentifierHash channel_Hash(HWIdentifier channelId) const
Create channel_hash from channel_Id.
Gaudi::Property< std::string > m_OFCInput
Input files.
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
void ofcFlat(const std::string &input, const std::string &outputName)
StoreGateSvc_t m_evtStore
Pointer to StoreGate (event store by default)
std::vector< SG::VarHandleKeyArray * > m_vhka
Gaudi::Property< bool > m_checkCompletness
Gaudi::Property< std::string > m_BlobName
const std::string & key() const
Return the StoreGate ID for the referenced object.
const ServiceHandle< StoreGateSvc > & detStore() const
The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.
virtual void setOwner(IDataHandleHolder *o)=0
const LArOnline_SuperCellID * m_onlineSCID
virtual StatusCode sysInitialize() override
Override sysInitialize.
virtual std::vector< Gaudi::DataHandle * > outputHandles() const override
Return this algorithm's output handles.
::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
StoreGateSvc_t m_detStore
Pointer to StoreGate (detector store by default)
Gaudi::Property< std::string > m_SingleInput
virtual void renounce()=0
std::conditional< std::is_base_of< SG::VarHandleKeyArray, T >::value, VarHandleKeyArrayType, type2 >::type type
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
DataObjIDColl m_extendedExtraObjects
#define ATH_MSG_WARNING(x)
bool isEMBPS(const HWIdentifier id) const
SG::VarHandleKey & vhKey()
Return a non-const reference to the HandleKey.
AthAlgorithm()
Default constructor:
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.
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>
Proxy for accessing a range of float values like a vector.
Gaudi::Property< std::string > m_Folder