|
ATLAS Offline Software
|
#include <LArCaliWaveAverage.h>
|
| LArCaliWaveAverage (const std::string &name, ISvcLocator *pSvcLocator) |
|
| ~LArCaliWaveAverage () |
|
StatusCode | initialize () override final |
|
StatusCode | execute () override final |
|
StatusCode | stop () override final |
|
StatusCode | finalize () override final |
|
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 |
|
|
SG::ReadCondHandleKey< LArOnOffIdMapping > | m_cablingKey {this, "OnOffMap", "LArOnOffIdMap", "SG key for mapping object"} |
|
SG::ReadCondHandleKey< LArCaliWaveContainer > | m_keyInput {this, "KeyInput", "LArCaliWave", "SG key of input cali wave container"} |
|
SG::WriteCondHandleKey< LArCaliWaveContainer > | m_keyOutputCorr {this, "KeyOutputCorr", "LArCaliWaveCorr", "SG key for corrected container"} |
|
SG::WriteCondHandleKey< LArCaliWaveContainer > | m_keyOutputSymm {this, "KeyOutputSymm", "LArCaliWaveSymm", "SG key for symmetrized container"} |
|
const LArOnlineID * | m_onlineHelper |
|
const LArEM_ID * | m_emId |
|
const LArHEC_ID * | m_hecId |
|
const LArFCAL_ID * | m_fcalId |
|
std::string | m_groupingType |
|
std::vector< unsigned > | m_chids |
|
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 23 of file LArCaliWaveAverage.h.
◆ StoreGateSvc_t
◆ LArCaliWaveAverage()
LArCaliWaveAverage::LArCaliWaveAverage |
( |
const std::string & |
name, |
|
|
ISvcLocator * |
pSvcLocator |
|
) |
| |
◆ ~LArCaliWaveAverage()
LArCaliWaveAverage::~LArCaliWaveAverage |
( |
| ) |
|
|
default |
◆ 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()
◆ evtStore() [1/2]
◆ evtStore() [2/2]
◆ execute()
StatusCode LArCaliWaveAverage::execute |
( |
| ) |
|
|
finaloverride |
◆ 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()
StatusCode LArCaliWaveAverage::finalize |
( |
| ) |
|
|
inlinefinaloverride |
◆ initialize()
StatusCode LArCaliWaveAverage::initialize |
( |
| ) |
|
|
finaloverride |
Definition at line 34 of file LArCaliWaveAverage.cxx.
40 return StatusCode::FAILURE;
45 return StatusCode::FAILURE;
50 return StatusCode::FAILURE;
64 return StatusCode::FAILURE;
67 return StatusCode::SUCCESS;
◆ 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()
◆ 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()
◆ stop()
StatusCode LArCaliWaveAverage::stop |
( |
| ) |
|
|
finaloverride |
Definition at line 75 of file LArCaliWaveAverage.cxx.
81 if (! theLArCaliWaveContainer ) {
83 return StatusCode::FAILURE;
87 auto larCaliWaveContainerCorr = std::make_unique<LArCaliWaveContainer>();
89 ATH_CHECK( larCaliWaveContainerCorr->initialize() );
92 auto larCaliWaveContainerSymm = std::make_unique<LArCaliWaveContainer>();
95 if (larCaliWaveContainerSymm->initialize()) {
96 ATH_MSG_ERROR (
"Failed to initialize LArCaliWaveContainer object" );
97 return StatusCode::FAILURE;
104 return StatusCode::FAILURE;
113 if ( theSymmetricChannels.empty()) {
114 ATH_MSG_WARNING (
"No symmetric channels found for channel 0x" << MSG::hex << chid << MSG::dec <<
". Cannot average." );
118 ATH_MSG_INFO ( theSymmetricChannels.size() <<
" symmetric channels indentified for channel 0x" << MSG::hex << chid << MSG::dec );
126 if ( theCaliWaves.empty() ){
127 ATH_MSG_WARNING (
"No pulses found for channel 0x" << MSG::hex << chid << MSG::dec
128 <<
" in gain " <<
gain
129 <<
". Are you sure that readout is working? For the time being I'm skipping..." );
137 for (
unsigned iDAC=0;iDAC<theCaliWaves.size();++iDAC) {
139 int theDAC = theCaliWaves[iDAC].getDAC();
143 for (
unsigned iSym=0;iSym<theSymmetricChannels.size();++iSym) {
147 for (
unsigned kDAC=0;kDAC<theseCaliWaves.size();++kDAC) {
148 if ( theseCaliWaves[kDAC].getDAC() == theDAC ) {
154 theSymmetricWavesThisDAC.push_back(thisWave);
160 if ( !theSymmetricWavesThisDAC.empty() ) {
163 <<
" symmetric LArCaliWaves found for channel 0x" << MSG::hex << chid << MSG::dec
164 <<
" for DAC " << theDAC <<
" in gain " <<
gain
165 <<
". Now averaging ... " );
172 theAverageWaves.push_back(theAverageWave);
176 for (
unsigned kSym=0;kSym<theSymmetricWavesThisDAC.size();++kSym) {
177 theSymmetricWavesAll.push_back(theSymmetricWavesThisDAC[kSym]);
182 ATH_MSG_WARNING (
"No symmetrich waves found for channel 0x" << MSG::hex << chid << MSG::dec
183 <<
" for DAC " << theDAC <<
": no average will be computed." );
189 ATH_MSG_VERBOSE (
"Saving LArCaliWave vector to correction container." );
190 larCaliWaveContainerCorr->setPdata(chid,theAverageWaves,
gain);
193 ATH_MSG_VERBOSE (
"Saving LArCaliWave vector to symmetric waves' container (flag contains FT info)" );
194 larCaliWaveContainerSymm->setPdata(chid,theSymmetricWavesAll,
gain);
202 const EventIDBase
start{EventIDBase::UNDEFNUM, EventIDBase::UNDEFEVT, 0, 0, EventIDBase::UNDEFNUM, EventIDBase::UNDEFNUM};
203 const EventIDBase
stop{EventIDBase::UNDEFNUM, EventIDBase::UNDEFEVT, EventIDBase::UNDEFNUM-1, EventIDBase::UNDEFNUM-1, EventIDBase::UNDEFNUM, EventIDBase::UNDEFNUM};
206 const EventIDRange& crangeW(rangeW);
207 if(corrHdl.record(crangeW,larCaliWaveContainerCorr.release()).isFailure()) {
209 <<
" with EventRange " << crangeW <<
" into Conditions Store");
210 return StatusCode::FAILURE;
214 if(symHdl.record(crangeW,larCaliWaveContainerSymm.release()).isFailure()) {
216 <<
" with EventRange " << crangeW <<
" into Conditions Store");
217 return StatusCode::FAILURE;
220 return StatusCode::SUCCESS;
◆ SymmetricChannels()
Definition at line 227 of file LArCaliWaveAverage.cxx.
229 ATH_MSG_VERBOSE (
"Seeking symmetric cells for channel 0x" << MSG::hex << ChID << MSG::dec );
231 std::vector<HWIdentifier> theSymmetricChannels;
232 theSymmetricChannels.resize(0);
236 id =
cabling->cnvToIdentifier(ChID);
238 ATH_MSG_ERROR (
"LArCabling exception caught for channel 0x" << MSG::hex << ChID << MSG::dec );
239 return theSymmetricChannels;
303 ATH_MSG_ERROR (
"Sorry, still implemented for EM only :-(" );
304 return theSymmetricChannels;
309 for (
unsigned iFT = 0;iFT<nFT;++iFT) {
312 bool useThisChannel =
true;
316 for (
unsigned i=0;
i<ChannelsNotToUse.size();++
i) {
318 useThisChannel =
false;
323 if ( useThisChannel )
324 theSymmetricChannels.push_back(thisChID);
327 return theSymmetricChannels;
◆ 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()
◆ WaveAverage()
Definition at line 331 of file LArCaliWaveAverage.cxx.
333 if ( !ToBeAveraged.empty() ) {
338 for (
unsigned i=1;
i<ToBeAveraged.size();++
i) {
340 theWaveAverage = theWaveAverage + (
LArWave)ToBeAveraged[
i];
343 theWaveAverage = theWaveAverage * (1./
float(ToBeAveraged.size()));
346 ToBeAveraged[0].getErrors(),
347 ToBeAveraged[0].getTriggers(),
348 ToBeAveraged[0].getDt(),
349 ToBeAveraged[0].getDAC(),
350 ToBeAveraged[0].getIsPulsedInt(),
351 ToBeAveraged[0].getFlag() );
353 return theCaliWaveAverage;
◆ m_cablingKey
◆ m_chids
std::vector<unsigned> LArCaliWaveAverage::m_chids |
|
private |
◆ m_detStore
◆ m_emId
◆ m_evtStore
◆ m_extendedExtraObjects
DataObjIDColl AthAlgorithm::m_extendedExtraObjects |
|
privateinherited |
◆ m_fcalId
◆ m_groupingType
std::string LArCaliWaveAverage::m_groupingType |
|
private |
◆ m_hecId
◆ m_keyInput
◆ m_keyOutputCorr
◆ m_keyOutputSymm
◆ m_onlineHelper
◆ m_varHandleArraysDeclared
◆ m_vhka
The documentation for this class was generated from the following files:
def retrieve(aClass, aKey=None)
const LArOnlineID * m_onlineHelper
SG::ReadCondHandleKey< LArOnOffIdMapping > m_cablingKey
const LArEM_ID * em_idHelper() const
access to EM idHelper
bool is_lar_fcal(Identifier id) const
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
const std::vector< double > & getWave() const
Wave parameters.
int slot(const HWIdentifier id) const
Return the slot number of a hardware cell identifier: slot = [1,15] Slot-ID in top part of the crat...
StoreGateSvc_t m_evtStore
Pointer to StoreGate (event store by default)
std::vector< SG::VarHandleKeyArray * > m_vhka
#define ATH_MSG_VERBOSE(x)
const std::string & key() const
Return the StoreGate ID for the referenced object.
int barrel_ec(const HWIdentifier id) const
Return the position barrel or endcap of a hardware cell identifier: barrel_ec = [0,...
const LArHEC_ID * hec_idHelper() const
access to HEC idHelper
Liquid Argon Cumulative Wave Container.
const ServiceHandle< StoreGateSvc > & detStore() const
The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.
virtual void setOwner(IDataHandleHolder *o)=0
int channel(const HWIdentifier id) const
Return the channel number of a hardware cell identifier channel = [0,127] in all FEB.
virtual StatusCode sysInitialize() override
Override sysInitialize.
std::vector< unsigned > m_chids
virtual std::vector< Gaudi::DataHandle * > outputHandles() const override
Return this algorithm's output handles.
::StatusCode StatusCode
StatusCode definition for legacy code.
ConstReference get(const HWIdentifier id, unsigned int gain=0) const
get data with online identifier
const LArFCAL_ID * m_fcalId
HWIdentifier channel_Id(int barrel_ec, int pos_neg, int feedthrough, int slot, int channel) const
create channel identifier from fields
int pos_neg(const HWIdentifier id) const
Return the side of a hardware cell identifier pos_neg = [0,1] positive-side or negative-side Barrel...
SG::WriteCondHandleKey< LArCaliWaveContainer > m_keyOutputSymm
bool is_lar_hec(Identifier id) const
Helper class for offline cell identifiers.
StoreGateSvc_t m_detStore
Pointer to StoreGate (detector store by default)
SG::ReadCondHandleKey< LArCaliWaveContainer > m_keyInput
virtual void renounce()=0
std::conditional< std::is_base_of< SG::VarHandleKeyArray, T >::value, VarHandleKeyArrayType, type2 >::type type
const LArHEC_ID * m_hecId
StatusCode initialize(bool used=true)
std::string m_groupingType
StatusCode stop() override final
DataObjIDColl m_extendedExtraObjects
int feedthrough(const HWIdentifier id) const
Return the feedthrough of a hardware cell identifier : feedthrough = [0,31] Barrel - A/C side or H/...
SG::WriteCondHandleKey< LArCaliWaveContainer > m_keyOutputCorr
bool is_em_barrel(const Identifier id) const
test if the id belongs to the EM barrel
#define ATH_MSG_WARNING(x)
LArCaliWave WaveAverage(const std::vector< LArCaliWave > &ToBeAveraged)
SG::VarHandleKey & vhKey()
Return a non-const reference to the HandleKey.
void setFlag(const unsigned flag)
set flag
AthAlgorithm()
Default constructor:
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>
Exception class for LAr Identifiers.
const LArFCAL_ID * fcal_idHelper() const
access to FCAL idHelper
bool is_em_endcap(const Identifier id) const
test if the id belongs to the EM Endcap
std::vector< HWIdentifier > SymmetricChannels(HWIdentifier ChID, const std::vector< unsigned > &ChannelsNotToUse, const LArOnOffIdMapping *cabling)