ATLAS Offline Software
Loading...
Searching...
No Matches
LArCompleteToFlat Class Reference

#include <LArCompleteToFlat.h>

Inheritance diagram for LArCompleteToFlat:
Collaboration diagram for LArCompleteToFlat:

Public Member Functions

 LArCompleteToFlat (const std::string &name, ISvcLocator *pSvcLocator)
 Constructor with parameters:
virtual ~LArCompleteToFlat ()
 Destructor:
StatusCode initialize ()
StatusCode execute ()
StatusCode finalize ()
virtual StatusCode stop ()
virtual StatusCode sysInitialize () override
 Override sysInitialize.
virtual const DataObjIDColl & extraOutputDeps () const override
 Return the list of extra output dependencies.
ServiceHandle< StoreGateSvc > & evtStore ()
 The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.
const ServiceHandle< StoreGateSvc > & detStore () const
 The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.
virtual StatusCode sysStart () override
 Handle START transition.
virtual std::vector< Gaudi::DataHandle * > inputHandles () const override
 Return this algorithm's input handles.
virtual std::vector< Gaudi::DataHandle * > outputHandles () const override
 Return this algorithm's output handles.
Gaudi::Details::PropertyBase & declareProperty (Gaudi::Property< T, V, H > &t)
void updateVHKA (Gaudi::Details::PropertyBase &)
MsgStream & msg () const
bool msgLvl (const MSG::Level lvl) const

Protected Member Functions

void renounceArray (SG::VarHandleKeyArray &handlesArray)
 remove all handles from I/O resolution
std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > renounce (T &h)
void extraDeps_update_handler (Gaudi::Details::PropertyBase &ExtraDeps)
 Add StoreName to extra input/output deps as needed.

Private Types

typedef ServiceHandle< StoreGateSvcStoreGateSvc_t

Private Member Functions

 LArCompleteToFlat ()
 Default constructor:
CondAttrListCollectionsingleFloatFlat (const char *blobName, const LArConditionsContainer< LArSingleFloatP > *input, const std::string &outputName, const unsigned nGain, const bool withFCAL=true)
CondAttrListCollectionDAC2uAFlat (const ILArDAC2uA *input, const std::string &outputName)
CondAttrListCollectionuA2MeVFlat (const ILAruA2MeV *input, const std::string &outputName)
CondAttrListCollectionpedestalFlat (const ILArPedestal *input, const std::string &outputName)
CondAttrListCollectionrampFlat (const ILArRamp *input, const std::string &outputName)
CondAttrListCollectionofcFlat (const ILArOFC *input, const std::string &outputName, const LArfSamplSC *weights=nullptr)
CondAttrListCollectionshapeFlat (const LArShapeComplete *input, const std::string &outputName)
AthenaAttributeListDSPThresholdsFlat (const LArDSPThresholdsComplete *input, const std::string &outputName)
void errIfConnected (const HWIdentifier chid, const int gain, const char *objName, const char *message=0) const
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
 specialization for handling Gaudi::Property<SG::VarHandleKey>

Private Attributes

unsigned m_hashMax
const LArOnlineID_Basem_onlineID
SG::ReadCondHandleKey< LArOnOffIdMappingm_cablingKey {this,"CablingKey","LArOnOffIdMap","SG Key of LArOnOffIdMapping object"}
SG::ReadCondHandleKey< LArOnOffIdMappingm_cablingKeySC {this,"CablingSCKey","LArOnOffIdMapSC","SG Key of LArOnOffIdMapping object"}
SG::ReadCondHandleKey< LArfSamplSCm_weightsKeySC {this,"WeightsSCKey","","SG Key of weights object"}
std::string m_uA2MeVInput
 InputSGKeys.
std::string m_DAC2uAInput
std::string m_HVScaleCorrInput
std::string m_PedestalInput
std::string m_RampInput
std::string m_MphysOverMcalInput
std::string m_OFCInput
std::string m_OFCCaliInput
std::string m_ShapeInput
std::string m_DSPThresholdsInput
std::string m_nameOfSet
bool m_isSC
bool m_forceStop
bool m_fakeEMBPSLowGain
DataObjIDColl m_extendedExtraObjects
StoreGateSvc_t m_evtStore
 Pointer to StoreGate (event store by default)
StoreGateSvc_t m_detStore
 Pointer to StoreGate (detector store by default)
std::vector< SG::VarHandleKeyArray * > m_vhka
bool m_varHandleArraysDeclared

Detailed Description

Definition at line 32 of file LArCompleteToFlat.h.

Member Typedef Documentation

◆ StoreGateSvc_t

typedef ServiceHandle<StoreGateSvc> AthCommonDataStore< AthCommonMsg< Algorithm > >::StoreGateSvc_t
privateinherited

Definition at line 388 of file AthCommonDataStore.h.

Constructor & Destructor Documentation

◆ LArCompleteToFlat() [1/2]

LArCompleteToFlat::LArCompleteToFlat ( const std::string & name,
ISvcLocator * pSvcLocator )

Constructor with parameters:

Definition at line 41 of file LArCompleteToFlat.cxx.

42 :
43 ::AthAlgorithm( name, pSvcLocator ),
44 m_hashMax(0),
45 m_onlineID(nullptr),
46 m_isSC(false)
47{
48 declareProperty("isSC",m_isSC);
49 declareProperty("uA2MeVInput",m_uA2MeVInput);//="LAruA2MeV");
50 declareProperty("DAC2uAVInput",m_DAC2uAInput);//="LArDAC2uA");
51 declareProperty("HVScaleCorrInput",m_HVScaleCorrInput);//="LArHVScaleCorr");
52 declareProperty("PedestalInput",m_PedestalInput);//="Pedestal");
53 declareProperty("RampInput",m_RampInput);//="LArRamp");
54 declareProperty("MphysOverMcalInput",m_MphysOverMcalInput);//="LArMphysOverMcal");
55 declareProperty("OFCInput",m_OFCInput);//="LArOFC");
56 declareProperty("OFCCaliInput",m_OFCCaliInput);//="LArOFC");
57 declareProperty("ShapeInput",m_ShapeInput);//="LArShape");
58 declareProperty("DSPThresholdsInput",m_DSPThresholdsInput);//="LArDSPThresholds");
59 declareProperty("NameOfSet",m_nameOfSet); // for DSPThreshold
60
61 declareProperty("ForceStop",m_forceStop=true);
62
63 declareProperty("FakeEMBPSLowGain",m_fakeEMBPSLowGain=false);
64
65
66}
AthAlgorithm()
Default constructor:
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)
std::string m_uA2MeVInput
InputSGKeys.
std::string m_OFCCaliInput
std::string m_HVScaleCorrInput
const LArOnlineID_Base * m_onlineID
std::string m_MphysOverMcalInput
std::string m_DAC2uAInput
std::string m_DSPThresholdsInput
std::string m_PedestalInput

◆ ~LArCompleteToFlat()

LArCompleteToFlat::~LArCompleteToFlat ( )
virtualdefault

Destructor:

◆ LArCompleteToFlat() [2/2]

LArCompleteToFlat::LArCompleteToFlat ( )
private

Default constructor:

Member Function Documentation

◆ DAC2uAFlat()

CondAttrListCollection * LArCompleteToFlat::DAC2uAFlat ( const ILArDAC2uA * input,
const std::string & outputName )
private

Definition at line 570 of file LArCompleteToFlat.cxx.

570 {
571 coral::AttributeListSpecification* spec = new coral::AttributeListSpecification();
572 spec->extend("DAC2uA", "blob");
573 spec->extend<unsigned>("version");
574 CondAttrListCollection* coll=new CondAttrListCollection(true);
575 coral::AttributeList* attrList = new coral::AttributeList(*spec);
576 (*attrList)["version"].setValue(0U);
577 coral::Blob& blob=(*attrList)["DAC2uA"].data<coral::Blob>();
578 blob.resize(m_hashMax*sizeof(float));
579 float* pblob=static_cast<float*>(blob.startingAddress());
580 for (unsigned hs=0;hs<m_hashMax;++hs) {
581 const HWIdentifier chid=m_onlineID->channel_Id(hs);
582 pblob[hs]=input->DAC2UA(chid);
583 }
584 coll->add(1,*attrList);
585 //delete attrList;//???
586 StatusCode sc=detStore()->record(coll,outputName);
587 if (sc.isFailure()) {
588 ATH_MSG_ERROR( "Failed to record CondAttrListCollection with key" << outputName );
589 return nullptr;
590 }
591 return coll;
592}
#define ATH_MSG_ERROR(x)
static Double_t sc
const ServiceHandle< StoreGateSvc > & detStore() const
::StatusCode StatusCode
StatusCode definition for legacy code.

◆ declareGaudiProperty()

Gaudi::Details::PropertyBase & AthCommonDataStore< AthCommonMsg< Algorithm > >::declareGaudiProperty ( Gaudi::Property< T, V, H > & hndl,
const SG::VarHandleKeyType &  )
inlineprivateinherited

specialization for handling Gaudi::Property<SG::VarHandleKey>

Definition at line 156 of file AthCommonDataStore.h.

158 {
160 hndl.value(),
161 hndl.documentation());
162
163 }

◆ declareProperty()

Gaudi::Details::PropertyBase & AthCommonDataStore< AthCommonMsg< Algorithm > >::declareProperty ( Gaudi::Property< T, V, H > & t)
inlineinherited

Definition at line 145 of file AthCommonDataStore.h.

145 {
146 typedef typename SG::HandleClassifier<T>::type htype;
148 }
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>

◆ detStore()

const ServiceHandle< StoreGateSvc > & AthCommonDataStore< AthCommonMsg< Algorithm > >::detStore ( ) const
inlineinherited

The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 95 of file AthCommonDataStore.h.

◆ DSPThresholdsFlat()

AthenaAttributeList * LArCompleteToFlat::DSPThresholdsFlat ( const LArDSPThresholdsComplete * input,
const std::string & outputName )
private

Definition at line 619 of file LArCompleteToFlat.cxx.

619 {
620
621 coral::AttributeListSpecification* spec = new coral::AttributeListSpecification();
622 spec->extend("tQThr", "blob");
623 spec->extend("samplesThr", "blob");
624 spec->extend("trigSumThr","blob");
625 //spec->extend<unsigned>("version");
626 spec->extend("Name","string");
627
628 coral::AttributeList* attrList = new coral::AttributeList(*spec);
629 //(*attrList)["version"].setValue(0U);
630 (*attrList)["Name"].setValue(m_nameOfSet);
631 coral::Blob& QBlob=(*attrList)["tQThr"].data<coral::Blob>();
632 coral::Blob& SamplesBlob=(*attrList)["samplesThr"].data<coral::Blob>();
633 coral::Blob& TrigBlob=(*attrList)["trigSumThr"].data<coral::Blob>();
634
635 QBlob.resize(m_hashMax*sizeof(float));
636 SamplesBlob.resize(m_hashMax*sizeof(float));
637 TrigBlob.resize(m_hashMax*sizeof(float));
638 float* ptQThr=static_cast<float*>(QBlob.startingAddress());
639 float* pSamplesThr=static_cast<float*>(SamplesBlob.startingAddress());
640 float* pTrigThr=static_cast<float*>(TrigBlob.startingAddress());
641
642 for (unsigned hs=0;hs<m_hashMax;++hs) {
643 const HWIdentifier chid=m_onlineID->channel_Id(hs);
644
645 ptQThr[hs] = input->tQThr(chid);
646 pSamplesThr[hs] = input->samplesThr(chid);
647 pTrigThr[hs] = input->trigSumThr(chid);
648
649 ATH_MSG_INFO( "hwid: "<<chid.getString()<<" "<<hs<<" | "<<ptQThr[hs]<<" : "<<pSamplesThr[hs]<<" | "<<pTrigThr[hs] );
650 }//end loop over hash ids
651
652 AthenaAttributeList* coll=new AthenaAttributeList(*attrList);
653
654 StatusCode sc=detStore()->record(coll,outputName);
655 if (sc.isFailure()) {
656 ATH_MSG_ERROR( "Failed to record AthenaAttributeList DSPThresholds with key " << outputName );
657 return nullptr;
658 }
659
660 return coll;
661}
#define ATH_MSG_INFO(x)
std::string getString() const
Provide a string form of the identifier - hexadecimal.

◆ errIfConnected()

void LArCompleteToFlat::errIfConnected ( const HWIdentifier chid,
const int gain,
const char * objName,
const char * message = 0 ) const
private

Definition at line 914 of file LArCompleteToFlat.cxx.

914 {
915
916 const LArOnOffIdMapping* cabling(nullptr);
917 if(m_isSC){
918 SG::ReadCondHandle<LArOnOffIdMapping> cablingHdl{m_cablingKeySC};
919 cabling=*cablingHdl;
920 }else{
921 SG::ReadCondHandle<LArOnOffIdMapping> cablingHdl{m_cablingKey};
922 cabling=*cablingHdl;
923 }
924 if(!cabling) {
925 ATH_MSG_ERROR( "Do not have cabling mapping from key " << m_cablingKey.key() );
926 return;
927 }
928
929 if (cabling->isOnlineConnected(chid)) {
930 if (gain!=2 || !m_onlineID->isEMBPS(chid)) { //No LG Presampler calibration
931 ATH_MSG_ERROR( "No valid " << objName << " found for channel " << m_onlineID->channel_name(chid) << ", gain " << gain << ". ");
932 if (message) ATH_MSG_ERROR( message );
933 ATH_MSG_ERROR( " Filling with default value." );
934 }
935 }
936 }
SG::ReadCondHandleKey< LArOnOffIdMapping > m_cablingKey
SG::ReadCondHandleKey< LArOnOffIdMapping > m_cablingKeySC

◆ evtStore()

ServiceHandle< StoreGateSvc > & AthCommonDataStore< AthCommonMsg< Algorithm > >::evtStore ( )
inlineinherited

The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 85 of file AthCommonDataStore.h.

◆ execute()

StatusCode LArCompleteToFlat::execute ( )
inline

Definition at line 47 of file LArCompleteToFlat.h.

47{return StatusCode::SUCCESS;}

◆ extraDeps_update_handler()

void AthCommonDataStore< AthCommonMsg< Algorithm > >::extraDeps_update_handler ( Gaudi::Details::PropertyBase & ExtraDeps)
protectedinherited

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.

51{
52 // If we didn't find any symlinks to add, just return the collection
53 // from the base class. Otherwise, return the extended collection.
54 if (!m_extendedExtraObjects.empty()) {
56 }
57 return Algorithm::extraOutputDeps();
58}
DataObjIDColl m_extendedExtraObjects

◆ finalize()

StatusCode LArCompleteToFlat::finalize ( )
inline

Definition at line 48 of file LArCompleteToFlat.h.

48{return StatusCode::SUCCESS;}

◆ initialize()

StatusCode LArCompleteToFlat::initialize ( )

Definition at line 75 of file LArCompleteToFlat.cxx.

76{
77 ATH_CHECK( m_cablingKey.initialize() );
78 ATH_CHECK( m_cablingKeySC.initialize(m_isSC) );
79 ATH_CHECK( m_weightsKeySC.initialize(m_isSC && !m_weightsKeySC.empty()) );
80 return StatusCode::SUCCESS;
81}
#define ATH_CHECK
Evaluate an expression and check for errors.
SG::ReadCondHandleKey< LArfSamplSC > m_weightsKeySC

◆ inputHandles()

virtual std::vector< Gaudi::DataHandle * > AthCommonDataStore< AthCommonMsg< Algorithm > >::inputHandles ( ) const
overridevirtualinherited

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()

MsgStream & AthCommonMsg< Algorithm >::msg ( ) const
inlineinherited

Definition at line 24 of file AthCommonMsg.h.

24 {
25 return this->msgStream();
26 }

◆ msgLvl()

bool AthCommonMsg< Algorithm >::msgLvl ( const MSG::Level lvl) const
inlineinherited

Definition at line 30 of file AthCommonMsg.h.

30 {
31 return this->msgLevel(lvl);
32 }

◆ ofcFlat()

CondAttrListCollection * LArCompleteToFlat::ofcFlat ( const ILArOFC * input,
const std::string & outputName,
const LArfSamplSC * weights = nullptr )
private

Definition at line 211 of file LArCompleteToFlat.cxx.

211 {
212
213 ATH_MSG_INFO("LArCompleteToFlat::ofcFlat, starting");
214 unsigned nChannels=0;
215 unsigned nCopiedEMPS=0;
216 unsigned nDefault=0;
217
218 coral::AttributeListSpecification* spec = new coral::AttributeListSpecification();
219 spec->extend("OFCa", "blob");
220 spec->extend("OFCb", "blob");
221 spec->extend("TimeOffset","blob");
222 spec->extend<unsigned>("nSamples");
223 spec->extend<unsigned>("version");
224 CondAttrListCollection* collOFC=new CondAttrListCollection(true);
225 int phase = 0;
226 const unsigned nGain = m_isSC ? 1 : 3;
227 for (unsigned gain=0;gain<nGain;++gain) {
228
229 //Auto-detect the number of samples (at least in theory, could be different for each gain)
230 unsigned nSamples=0;
231 for (unsigned hs=0;hs<m_hashMax && nSamples==0;++hs) {
232 const HWIdentifier chid=m_onlineID->channel_Id(hs);
233 LArOFCFlat::OFCRef_t ofca= input->OFC_a(chid,gain);
234 if ( input->nTimeBins(chid,gain) > 23 ){
235 phase = 23;
236 ofca = input->OFC_a(chid,gain,phase);
237 }
238
239 nSamples=ofca.size();
240 }
241 if (nSamples==0) {
242 ATH_MSG_ERROR( "All input OFCs for gain " << gain << " have 0 samples!" );
243 continue;//jump to the next gain
244 }
245
246 ATH_MSG_INFO( "Gain " << gain <<": Found " << nSamples << " OFC samples in input data" );
247
248 coral::AttributeList* attrList = new coral::AttributeList(*spec);
249 (*attrList)["version"].setValue(0U);
250 coral::Blob& ofcaBlob=(*attrList)["OFCa"].data<coral::Blob>();
251 coral::Blob& ofcbBlob=(*attrList)["OFCb"].data<coral::Blob>();
252 coral::Blob& toBlob=(*attrList)["TimeOffset"].data<coral::Blob>();
253
254 (*attrList)["nSamples"].setValue(nSamples);
255
256 ofcaBlob.resize(m_hashMax*sizeof(float)*nSamples);
257 ofcbBlob.resize(m_hashMax*sizeof(float)*nSamples);
258 toBlob.resize(m_hashMax*sizeof(float));
259 float* pOfca=static_cast<float*>(ofcaBlob.startingAddress());
260 float* pOfcb=static_cast<float*>(ofcbBlob.startingAddress());
261 float* pTimeOffset=static_cast<float*>(toBlob.startingAddress());
262 for (unsigned hs=0;hs<m_hashMax;++hs) {
263 const HWIdentifier chid=m_onlineID->channel_Id(hs);
264 LArOFCFlat::OFCRef_t ofca= input->OFC_a(chid,gain,phase);
265 LArOFCFlat::OFCRef_t ofcb= input->OFC_b(chid,gain,phase);
266 float timeOffset=input->timeOffset(chid,gain);
267 if (ofca.size()==0 && gain==2 && m_fakeEMBPSLowGain) {
268 ofca= input->OFC_a(chid,1,phase);
269 ofcb= input->OFC_b(chid,1,phase);
270 timeOffset=input->timeOffset(chid,1);
271 ++nCopiedEMPS;
272 }
273
274 if (ofca.size()==nSamples) {
275 for (unsigned i=0;i<nSamples;++i) {
276 if(std::isnan(ofca[i]) || std::isinf(ofca[i]) || (m_isSC && fabs(ofca[i])> 10.)) { // protection
277 pOfca[hs*nSamples+i]=1.0;
278 } else {
279 pOfca[hs*nSamples+i]=ofca[i];
280 }
281 }
282 }
283 else {
284 std::stringstream message;
285 message <<"Number of samples don't match. Expect " << nSamples << ", got " << ofca.size() << ".";
286 errIfConnected(chid,gain,"OFCa", message.str().c_str());
287 for (unsigned i=0;i<nSamples;++i) {
288 pOfca[hs*nSamples+i]=1.0;
289 }
290 ++nDefault;
291 }
292
293 if (ofcb.size()==nSamples) {
294 for (unsigned i=0;i<nSamples;++i) {
295 if(std::isnan(ofcb[i]) || std::isinf(ofcb[i]) || (m_isSC && fabs(ofcb[i])> 100.)) { // protection
296 pOfcb[hs*nSamples+i]=1.0;
297 } else {
298 pOfcb[hs*nSamples+i]=ofcb[i];
299 }
300 // FIXME: it should be replaced by proper conditions per channel
301 // HERE - multiplying HEC OFCb by 1.5 for SCs
302 // https://its.cern.ch/jira/browse/ATLLARONL-1784
303 //if (m_isSC && m_onlineID->isHECchannel(chid)){
304 // pOfcb[hs*nSamples+i]=ofcb[i]*1.5;
305 // ATH_MSG_WARNING("NOTE: this OFC for channel "<<chid<<" was multiplied by 1.5. This should be a HEC SC("<<m_onlineID->channel_name(chid)<<"). Was "<<ofcb[i]<<" now "<<pOfcb[hs*nSamples+i]);
306 //}
307 if (m_isSC && weights) pOfcb[hs*nSamples+i] *= weights->FSAMPL(chid);
308 if (weights && weights->FSAMPL(chid) != 1.) ATH_MSG_WARNING("NOTE: this OFC for channel "<<chid<<" was multiplied by "<<weights->FSAMPL(chid)<<" This should be a SC("<<m_onlineID->channel_name(chid)<<"). Was "<<ofcb[i]<<" now "<<pOfcb[hs*nSamples+i]);
309 }
310 }
311 else {
312 std::stringstream message;
313 message <<"Number of samples don't match. Expect " << nSamples << ", got " << ofcb.size() << ".";
314 errIfConnected(chid,gain,"OFCb", message.str().c_str());
315 for (unsigned i=0;i<nSamples;++i) {
316 pOfcb[hs*nSamples+i]=1.0;
317 }
318 }
319 pTimeOffset[hs]=timeOffset;
320 ++nChannels;
321
322 }//end loop over hash ids
323 collOFC->add(gain,*attrList);
324 }//end loop over gains
325
326 StatusCode sc=detStore()->record(collOFC,outputName);//"/LAR/ElecCalibFlat/OFC");
327 if (sc.isFailure()) {
328 ATH_MSG_ERROR( "Failed to record CondAttrListCollection OFC with key " << outputName );
329 return nullptr;
330 }
331
332 ATH_MSG_INFO( "Converted OFCs to inline storage. Total number of channels=" << nChannels );
333 ATH_MSG_INFO( "Number of channels filled with default OFCs {1,1,1,1} " << nDefault << " (including disconnected)" );
334 if (nCopiedEMPS)
335 ATH_MSG_INFO( "\t Number of low gain EMBPS channels copied from medium gain" << nCopiedEMPS );
336 return collOFC;
337}
#define ATH_MSG_WARNING(x)
void errIfConnected(const HWIdentifier chid, const int gain, const char *objName, const char *message=0) const
ILArOFC::OFCRef_t OFCRef_t
Definition LArOFCFlat.h:24
virtual const float & FSAMPL(const HWIdentifier &chid) const
unsigned int constexpr nChannels
Definition RPDUtils.h:23

◆ outputHandles()

virtual std::vector< Gaudi::DataHandle * > AthCommonDataStore< AthCommonMsg< Algorithm > >::outputHandles ( ) const
overridevirtualinherited

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.

◆ pedestalFlat()

CondAttrListCollection * LArCompleteToFlat::pedestalFlat ( const ILArPedestal * input,
const std::string & outputName )
private

Definition at line 147 of file LArCompleteToFlat.cxx.

147 {
148 ATH_MSG_INFO("LArCompleteToFlat::pedestalFlat, starting");
149
150 unsigned nChannels=0;
151 unsigned nCopiedEMPS=0;
152
153 coral::AttributeListSpecification* spec = new coral::AttributeListSpecification();
154 spec->extend("Pedestal", "blob");
155 spec->extend("PedestalRMS", "blob");
156 spec->extend<unsigned>("version");
157
158 CondAttrListCollection* collPed=new CondAttrListCollection(true);
159
160 const unsigned nGain = m_isSC ? 1 : 3;
161 for (unsigned gain=0;gain<nGain;++gain) {
162 coral::AttributeList* attrList = new coral::AttributeList(*spec);
163 (*attrList)["version"].setValue(0U);
164 coral::Blob& blobPed=(*attrList)["Pedestal"].data<coral::Blob>();
165 coral::Blob& blobRMS=(*attrList)["PedestalRMS"].data<coral::Blob>();
166 blobPed.resize(m_hashMax*sizeof(float));
167 blobRMS.resize(m_hashMax*sizeof(float));
168 float* pblobPed=static_cast<float*>(blobPed.startingAddress());
169 float* pblobRMS=static_cast<float*>(blobRMS.startingAddress());
170 int nDefault=0;
171 for (unsigned hs=0;hs<m_hashMax;++hs) {
172 const HWIdentifier chid=m_onlineID->channel_Id(hs);
173 float ped=input->pedestal(chid,gain);
174 float pedRMS=input->pedestalRMS(chid,gain);
175 if (gain==0){
176 if (ped<0){
177 ped = 1000;
178 pedRMS = 1;
179 ++nDefault;
180 }
181
182
183 }
184 if (ped<0 && gain==2 && m_fakeEMBPSLowGain) {
185 ped=input->pedestal(chid,1);
186 pedRMS=input->pedestalRMS(chid,1);
187 ++nCopiedEMPS;
188 }
189
190 pblobPed[hs]=ped;
191 pblobRMS[hs]=pedRMS;
192 ++nChannels;
193 }//end loop over hash ids
194 collPed->add(gain,*attrList);
195 ATH_MSG_INFO( "Number of channels filled with default Pedestal (1000) and PedestalRMS (1) "<< nDefault << " (including disconnected)" );
196 }//end loop over gains
197
198 StatusCode sc=detStore()->record(collPed,outputName);//"/LAR/ElecCalibFlat/Pedestal");
199 if (sc.isFailure()) {
200 ATH_MSG_ERROR( "Failed to record CondAttrListCollection for pedestal with key " << outputName );
201 return nullptr;
202 }
203 ATH_MSG_INFO( "Converted Pedestal to inline storage. Total number of channels=" << nChannels );
204 if (nCopiedEMPS)
205 ATH_MSG_INFO( "\t Number of low gain EMBPS channels copied from medium gain" << nCopiedEMPS );
206
207 return collPed;
208}

◆ rampFlat()

CondAttrListCollection * LArCompleteToFlat::rampFlat ( const ILArRamp * input,
const std::string & outputName )
private

Definition at line 459 of file LArCompleteToFlat.cxx.

459 {
460
461 ATH_MSG_INFO("LArCompleteToFlat::rampFlat, starting");
462
463 unsigned nChannels=0;
464 unsigned nCopiedEMPS=0;
465 unsigned nDefault=0;
466
467 coral::AttributeListSpecification* spec = new coral::AttributeListSpecification();
468 spec->extend("RampVec", "blob");
469 spec->extend<unsigned>("nPoints");
470 spec->extend<unsigned>("version");
471 CondAttrListCollection* coll=new CondAttrListCollection(true);
472
473 std::vector<float> defaultRamp={0.0,1.0};
474
475 const LArOnOffIdMapping* cabling(nullptr);
476 if(m_isSC){
477 SG::ReadCondHandle<LArOnOffIdMapping> cablingHdl{m_cablingKeySC};
478 cabling=*cablingHdl;
479 }else{
480 SG::ReadCondHandle<LArOnOffIdMapping> cablingHdl{m_cablingKey};
481 cabling=*cablingHdl;
482 }
483 if(!cabling) {
484 ATH_MSG_ERROR( "Do not have cabling mapping from key " << m_cablingKey.key() );
485 return coll;
486 }
487
488 const unsigned nGain = m_isSC ? 1 : 3;
489 for (unsigned gain=0;gain<nGain;++gain) {
490
491 unsigned nPoints=0;
492 for (unsigned hs=0;hs<m_hashMax && nPoints==0;++hs) {
493 const HWIdentifier chid=m_onlineID->channel_Id(hs);
494 const ILArRamp::RampRef_t ramp= input->ADC2DAC(chid,gain);
495 nPoints=ramp.size();
496 }
497 if (nPoints==0) {
498 ATH_MSG_ERROR( "All input Ramps for gain " << gain << " have 0 points!" );
499 continue;//jump to the next gain
500 }
501
502 defaultRamp.resize(nPoints,0.0); //fill remaining points if needed
503 ATH_MSG_INFO( "Gain " << gain << ": Found a ramp polynom of degree " << nPoints << " in input data" );
504 coral::AttributeList* attrList = new coral::AttributeList(*spec);
505 (*attrList)["version"].setValue(0U);
506 coral::Blob& blobRamp=(*attrList)["RampVec"].data<coral::Blob>();
507 (*attrList)["nPoints"].setValue(nPoints);
508 blobRamp.resize(m_hashMax*sizeof(float)*nPoints);
509 float* pblobRamp=static_cast<float*>(blobRamp.startingAddress());
510
511 for (unsigned hs=0;hs<m_hashMax;++hs) {
512 const HWIdentifier chid=m_onlineID->channel_Id(hs);
513 std::vector<float> rampVec(input->ADC2DAC(chid,gain).asVector());
514 if(rampVec.size()>=2 && rampVec[1]>500) {
515 ATH_MSG_WARNING("Protection against crazy ramp values, set 500");
516 rampVec[1]=500.;
517 }
518 if (rampVec.empty() && gain==2 && m_fakeEMBPSLowGain && cabling->isOnlineConnected(chid) ) {
519 rampVec=input->ADC2DAC(chid,1).asVector();
520 if(rampVec.empty()) {
521 ATH_MSG_WARNING("Filling EMBPS ramp with default values 0,10");
522 rampVec.resize(2);
523 rampVec[0]=0.;
524 rampVec[1]=10.;
525 } else {
526 rampVec[1]*=10.0;
527 if(rampVec[1]>500) {
528 ATH_MSG_WARNING("Protection against crazy ramp values, set 500");
529 rampVec[1]=500.;
530 }
531 }
532 ++nCopiedEMPS;
533 }
534
535 if (rampVec.size()>=nPoints) {
536 for (size_t i=0;i<nPoints;++i) {
537 pblobRamp[nPoints*hs+i]=rampVec[i];
538 }
539 }
540 else {
541 std::stringstream message;
542 message <<"Polynom degree doesn't match. Expect " << nPoints << ", got " << rampVec.size() << ".";
543 errIfConnected(chid,gain,"Ramp", message.str().c_str());
544 for (size_t i=0;i<nPoints;++i) {
545 pblobRamp[nPoints*hs+i]=defaultRamp[i];
546 }
547 ++nDefault;
548 }
549 ++nChannels;
550 }//end loop over hash ids
551 coll->add(gain,*attrList);
552 }//end loop over gains
553
554 StatusCode sc=detStore()->record(coll,outputName);//"/LAR/ElecCalibFlat/Ramp");
555 if (sc.isFailure()) {
556 ATH_MSG_ERROR( "Failed to record CondAttrListCollection for ramp with key " << outputName );
557 return nullptr;
558 }
559
560 ATH_MSG_INFO( "Converted Ramps to inline storage. Total number of channels " << nChannels );
561 ATH_MSG_INFO( "Number of channels filled with default ramp {0,1} " << nDefault << " (including disconnected)" );
562 if (nCopiedEMPS)
563 ATH_MSG_INFO( "\t Number of low gain EMBPS channels copied from medium gain (applied factor 10)" << nCopiedEMPS );
564
565
566 return coll;
567}
LArVectorProxy RampRef_t
This class defines the interface for accessing Ramp @stereotype Interface.
Definition ILArRamp.h:31

◆ renounce()

std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > AthCommonDataStore< AthCommonMsg< Algorithm > >::renounce ( T & h)
inlineprotectedinherited

Definition at line 380 of file AthCommonDataStore.h.

381 {
382 h.renounce();
384 }
std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > renounce(T &h)

◆ renounceArray()

void AthCommonDataStore< AthCommonMsg< Algorithm > >::renounceArray ( SG::VarHandleKeyArray & handlesArray)
inlineprotectedinherited

remove all handles from I/O resolution

Definition at line 364 of file AthCommonDataStore.h.

364 {
366 }

◆ shapeFlat()

CondAttrListCollection * LArCompleteToFlat::shapeFlat ( const LArShapeComplete * input,
const std::string & outputName )
private

Definition at line 340 of file LArCompleteToFlat.cxx.

340 {
341
342 ATH_MSG_INFO("LArCompleteToFlat::shapeFlat, starting");
343
344 unsigned nChannels=0;
345 unsigned nCopiedEMPS=0;
346 unsigned nDefault=0;
347
348 coral::AttributeListSpecification* spec = new coral::AttributeListSpecification();
349 spec->extend("Shape", "blob");
350 spec->extend("ShapeDer", "blob");
351 spec->extend("TimeOffset","blob");
352 spec->extend<unsigned>("nSamples");
353 spec->extend<unsigned>("version");
354 CondAttrListCollection* coll=new CondAttrListCollection(true);
355
356 const unsigned nGain = m_isSC ? 1 : 3;
357 for (unsigned gain=0;gain<nGain;++gain) {
358
359 unsigned nSamples=0;
360 for (unsigned hs=0;hs<m_hashMax && nSamples==0;++hs) {
361 const HWIdentifier chid=m_onlineID->channel_Id(hs);
362 ILArShape::ShapeRef_t shape= input->Shape(chid,gain);
363 nSamples=shape.size();
364 }
365 if (nSamples==0) {
366 ATH_MSG_ERROR( "All input Shapes for gain " << gain << " have 0 samples!" );
367 continue;//jump to the next gain
368 }
369
370 ATH_MSG_INFO( "Gain " << gain <<": Found " << nSamples << " shape samples in input data" );
371
372 coral::AttributeList* attrList = new coral::AttributeList(*spec);
373 (*attrList)["version"].setValue(0U);
374 coral::Blob& shapeBlob=(*attrList)["Shape"].data<coral::Blob>();
375 coral::Blob& shapeDerBlob=(*attrList)["ShapeDer"].data<coral::Blob>();
376 coral::Blob& toBlob=(*attrList)["TimeOffset"].data<coral::Blob>();
377
378 (*attrList)["nSamples"].setValue(nSamples);
379
380 shapeBlob.resize(m_hashMax*sizeof(float)*nSamples);
381 shapeDerBlob.resize(m_hashMax*sizeof(float)*nSamples);
382 toBlob.resize(m_hashMax*sizeof(float));
383 float* pShape=static_cast<float*>(shapeBlob.startingAddress());
384 float* pShapeDer=static_cast<float*>(shapeDerBlob.startingAddress());
385 float* pTimeOffset=static_cast<float*>(toBlob.startingAddress());
386 for (unsigned hs=0;hs<m_hashMax;++hs) {
387 const HWIdentifier chid=m_onlineID->channel_Id(hs);
388
389 ILArShape::ShapeRef_t shape= input->Shape(chid,gain);
390 ILArShape::ShapeRef_t shapeDer= input->ShapeDer(chid,gain);
391 float timeOffset=input->timeOffset(chid,gain);
392 if (shape.size()==0 && gain==2 && m_fakeEMBPSLowGain) {
393 shape=input->Shape(chid,1);
394 shapeDer=input->ShapeDer(chid,1);
395 timeOffset=input->timeOffset(chid,1);
396 ++nCopiedEMPS;
397 }
398
399 if (shape.size()==nSamples) {
400 for (unsigned i=0;i<nSamples;++i) {
401 if(std::isnan(shape[i]) || std::isinf(shape[i])) {
402 pShape[hs*nSamples+i]=0.0;
403 } else {
404 pShape[hs*nSamples+i]=shape[i];
405 }
406 }
407 }
408 else {
409 std::stringstream message;
410 message <<"Number of samples don't match. Expect " << nSamples << ", got " << shape.size() << ".";
411 errIfConnected(chid,gain,"Shape", message.str().c_str());
412 for (unsigned i=0;i<nSamples;++i) {
413 pShape[hs*nSamples+i]=0.0;
414 }
415 ++nDefault;
416 }
417
418
419 if (shapeDer.size()==nSamples) {
420 for (unsigned i=0;i<nSamples;++i) {
421 if(std::isnan(shapeDer[i]) || std::isinf(shapeDer[i])) {
422 pShapeDer[hs*nSamples+i]=0.0;
423 } else {
424 pShapeDer[hs*nSamples+i]=shapeDer[i];
425 }
426 }
427 }
428 else {
429 std::stringstream message;
430 message <<"Number of samples don't match. Expect " << nSamples << ", got " << shapeDer.size() << ".";
431 errIfConnected(chid,gain,"ShapeDer", message.str().c_str());
432 for (unsigned i=0;i<nSamples;++i) {
433 pShapeDer[hs*nSamples+i]=0.0;
434 }
435 }
436 pTimeOffset[hs]=timeOffset;
437 ++nChannels;
438
439 }//end loop over hash ids
440 coll->add(gain,*attrList);
441 }//end loop over gains
442
443 StatusCode sc=detStore()->record(coll,outputName);//"/LAR/ElecCalibFlat/SHAPE");
444 if (sc.isFailure()) {
445 ATH_MSG_ERROR( "Failed to record CondAttrListCollection Shape with key " << outputName );
446 return nullptr;
447 }
448
449 ATH_MSG_INFO( "Converted Shapes to inline storage. Total number of channels=" << nChannels );
450 ATH_MSG_INFO( "Number of channels filled with default shape {0,0,0,0} " << nDefault << " (including disconnected)" );
451 if (nCopiedEMPS)
452 ATH_MSG_INFO( "\t Number of low gain EMBPS channels copied from medium gain" << nCopiedEMPS );
453
454 return coll;
455}
LArVectorProxy ShapeRef_t
This class defines the interface for accessing Shape (Nsample variable, Dt = 25 ns fixed) @stereotype...
Definition ILArShape.h:26

◆ singleFloatFlat()

CondAttrListCollection * LArCompleteToFlat::singleFloatFlat ( const char * blobName,
const LArConditionsContainer< LArSingleFloatP > * input,
const std::string & outputName,
const unsigned nGain,
const bool withFCAL = true )
private

Definition at line 85 of file LArCompleteToFlat.cxx.

86 {
87
88 unsigned nChannels=0;
89 unsigned nCopiedEMPS=0;
90 unsigned nDefault=0;
91
92 coral::AttributeListSpecification* spec = new coral::AttributeListSpecification();
93 spec->extend(blobName, "blob");
94 spec->extend<unsigned>("version");
95 CondAttrListCollection* coll=new CondAttrListCollection(true);
96 for (unsigned gain=0;gain<nGain;++gain) {
97 coral::AttributeList* attrList = new coral::AttributeList(*spec);
98 (*attrList)["version"].setValue(0U);
99 coral::Blob& blob=(*attrList)[blobName].data<coral::Blob>();
100 blob.resize(m_hashMax*sizeof(float));
101 float* pblob=static_cast<float*>(blob.startingAddress());
102 for (unsigned hs=0;hs<m_hashMax;++hs) {
103 const HWIdentifier chid=m_onlineID->channel_Id(hs);
104 float value;
105 if (!withFCAL && m_onlineID->isFCALchannel(chid)) {
106 value=1.0; //Fill fcal channels with 1.0. for MPhysOverMcal
107 }
108 else
109 value=input->get(chid,gain).m_data;
110
111 if (value<0 && gain==2 && m_fakeEMBPSLowGain) {
112 //Fill medium gain for EMB PS low gain
113 value=input->get(chid,1).m_data;
114 ++nCopiedEMPS;
115 }
116 if (value < 0) {
117 errIfConnected(chid,gain,blobName);
118 value=1.0; //Default vaue is 1.0, since these are multiplicative constants
119 ++nDefault;
120 }
121 pblob[hs]=value;
122 ++nChannels;
123 }
124 unsigned coolChan=gain;
125 //Special case: Store single-gain constant in channel 1
126 //To avoid AttrList vs AttrListCollection confusion in Athena DB infrastructure
127 if (nGain==1) coolChan=1;
128
129 coll->add(coolChan,*attrList);
130 //delete attrList;//???
131 }
132
133 ATH_MSG_INFO( "Converted " << blobName << " to inline storage. Total number of channels=" << nChannels );
134 ATH_MSG_INFO( "Number of channels filled with default value (1.0) " << nDefault << " (including disconnected)" );
135 if (nCopiedEMPS)
136 ATH_MSG_INFO( "\t Number of low gain EMBPS channels copied from medium gain" << nCopiedEMPS );
137 StatusCode sc=detStore()->record(coll,outputName);
138 if (sc.isFailure()) {
139 ATH_MSG_ERROR( "Failed to record CondAttrListCollection with key" << outputName );
140 return nullptr;
141 }
142 return coll;
143}

◆ stop()

StatusCode LArCompleteToFlat::stop ( )
virtual

Definition at line 665 of file LArCompleteToFlat.cxx.

665 {
666 std::string flatName = "/LAR/ElecCalibFlat";
668 if(m_isSC){
669 flatName += "SC";
670 const LArOnline_SuperCellID* ll = nullptr;
671 sc = detStore()->retrieve(ll, "LArOnline_SuperCellID");
672 if (sc.isFailure()) {
673 ATH_MSG_ERROR( "Could not get LArOnlineID helper !" );
674 return StatusCode::FAILURE;
675 }
676 else {
677 m_onlineID = static_cast<const LArOnlineID_Base*>(ll);
678 ATH_MSG_DEBUG("Found the LArOnlineID helper");
679 }
680 }else{
681 const LArOnlineID* ll = nullptr;
682 sc = detStore()->retrieve(ll, "LArOnlineID");
683 if (sc.isFailure()) {
684 ATH_MSG_ERROR( "Could not get LArOnlineID helper !" );
685 return StatusCode::FAILURE;
686 }
687 else {
688 m_onlineID = static_cast<const LArOnlineID_Base*>(ll);
689 ATH_MSG_DEBUG(" Found the LArOnlineID helper. ");
690 }
691
692 }
693
694 m_hashMax=m_onlineID->channelHashMax();
695
696 if (!m_uA2MeVInput.empty()) {
697 const ILAruA2MeV* uA2MeVComplete = nullptr;
698 sc=detStore()->retrieve(uA2MeVComplete,m_uA2MeVInput);
699 if (sc.isFailure()) {
700 if(m_forceStop) {
701 ATH_MSG_ERROR( "Failed to get LAruA2MeV with key " << m_uA2MeVInput );
702 return sc;
703 } else {
704 ATH_MSG_WARNING( "Will not process LAruA2MeV" );
705 }
706 } else {
707 uA2MeVFlat(uA2MeVComplete, flatName+"/uA2MeV");
708 }
709 }//end if have m_uA2MeV
710
711
712 if (!m_DAC2uAInput.empty()) {
713 const ILArDAC2uA* DAC2uAComplete = nullptr;
714 sc=detStore()->retrieve(DAC2uAComplete,m_DAC2uAInput);
715 if (sc.isFailure()) {
716 if(m_forceStop) {
717 ATH_MSG_ERROR( "Failed to get LArDAC2uA with key " << m_DAC2uAInput );
718 return sc;
719 } else {
720 ATH_MSG_WARNING( "Will not process LArDAC2uA" );
721 }
722 } else {
723 DAC2uAFlat(DAC2uAComplete, flatName+"/DAC2uA");
724 }
725 }//end if have m_DAC2uAInput
726
727 if (!m_MphysOverMcalInput.empty()) {
728 const LArMphysOverMcalComplete* MphysOverMcalComplete = nullptr;
729 sc=detStore()->retrieve(MphysOverMcalComplete,m_MphysOverMcalInput);
730 if (sc.isFailure()) {
731 if(m_forceStop) {
732 ATH_MSG_ERROR( "Failed to get LArMphysOverMcal with key " << m_MphysOverMcalInput );
733 return sc;
734 } else {
735 ATH_MSG_WARNING( "Will not process LArMphysOverMcal" );
736 }
737 } else {
738 const int nGain = m_isSC ? 1 : 3;
739 //const bool wfcal = m_isSC ? true : false;
740 singleFloatFlat("MphysOverMcal", MphysOverMcalComplete, flatName+"/MphysOverMcal",nGain,false); //No MphysOverMCal for FCAL
741 }
742 }//end if have m_MphysOverMcalInput
743
744
745 if (!m_HVScaleCorrInput.empty()) {
746 const LArHVScaleCorrComplete* HVScaleCorrComplete = nullptr;
747 sc=detStore()->retrieve(HVScaleCorrComplete,m_HVScaleCorrInput);
748 if (sc.isFailure()) {
749 if(m_forceStop) {
750 ATH_MSG_ERROR( "Failed to get LArHVScaleCorr with key " << m_HVScaleCorrInput );
751 return sc;
752 } else {
753 ATH_MSG_WARNING( "Will not process LArHVScaleCorr" );
754 }
755 } else {
756 singleFloatFlat("HVScaleCorr", HVScaleCorrComplete, flatName+"/HVScaleCorr",1);
757 }
758 }//end if have m_HVScaleCorrInput
759
760 if (!m_PedestalInput.empty()) {
761 const LArPedestalComplete* pedComplete = nullptr;
762 sc=detStore()->retrieve(pedComplete,m_PedestalInput);
763 if (sc.isFailure()) {
764 if(m_forceStop) {
765 ATH_MSG_ERROR( "Failed to get LArPedestal" );
766 return sc;
767 } else {
768 ATH_MSG_WARNING( "Will not process LArPedestal" );
769 }
770 } else {
771 pedestalFlat(pedComplete,flatName+"/Pedestal");
772
773 /*
774 CondAttrListCollection* coll=pedestalFlat(pedComplete,"/LAR/ElecCalibFlat/Pedestal");
775 LArPedestalFlat* pf=new LArPedestalFlat(coll);
776
777 sc=detStore()->record(pf,"PedestalFlat");
778 if (sc.isFailure()) {
779 ATH_MSG_ERROR( "Failed to record LArPedestalFlat" );
780 }
781
782 ILArPedestal* iped=pf;
783 sc=detStore()->symLink(pf,iped);
784 if (sc.isFailure()) {
785 ATH_MSG_ERROR( "Failed to symlink LArPedestalFlat" );
786 }
787 }
788 */
789 }
790 }//end if have m_pedestalInput
791
792 //OFC:
793 if (!m_OFCInput.empty()) {
794 const LArOFCComplete* ofcComplete = nullptr;
795 sc=detStore()->retrieve(ofcComplete,m_OFCInput);
796 if (sc.isFailure()) {
797 if(m_forceStop) {
798 ATH_MSG_ERROR( "Failed to get LArOFCComplete object" );
799 return sc;
800 } else {
801 ATH_MSG_WARNING( "Will not process LArOFCComplete" );
802 }
803 } else {
804 const LArfSamplSC* weightsComplete(nullptr);
805 if(m_isSC && !m_weightsKeySC.empty()) {
806 SG::ReadCondHandle<LArfSamplSC> wHdl{m_weightsKeySC};
807 weightsComplete=*wHdl;
808 if(!weightsComplete) {
809 ATH_MSG_WARNING("Do not have OFCb weights !!!! Not applying");
810 }
811 }
812 ofcFlat(ofcComplete,flatName+"/OFC",weightsComplete);
813 }
814 }//end have m_OFCInput
815 if (!m_OFCCaliInput.empty()) {
816 const LArOFCComplete* ofcComplete = nullptr;
817 sc=detStore()->retrieve(ofcComplete,m_OFCCaliInput);
818 if (sc.isFailure()) {
819 if(m_forceStop) {
820 ATH_MSG_ERROR( "Failed to get LArOFCComplete object (cali)" );
821 return sc;
822 } else {
823 ATH_MSG_WARNING( "Will not process LArOFCComplete (cali)" );
824 }
825 } else {
826 ofcFlat(ofcComplete,flatName+"/OFCCali");
827
828 }
829 }//end have m_OFCInput
830 //Shape:
831 if (!m_ShapeInput.empty()) {
832 const LArShapeComplete* shapeComplete = nullptr;
833 sc=detStore()->retrieve(shapeComplete,m_ShapeInput);
834 if (sc.isFailure()) {
835 if(m_forceStop) {
836 ATH_MSG_ERROR( "Failed to get LArShapeComplete object" );
837 return sc;
838 } else {
839 ATH_MSG_WARNING( "Will not process LArShapeComplete" );
840 }
841 } else {
842 shapeFlat(shapeComplete,flatName+"/Shape");
843 /*
844 CondAttrListCollection* coll=shapeFlat(shapeComplete,"/LAR/ElecCalibFlat/Shape");
845
846 LArShapeFlat* sf=new LArShapeFlat(coll);
847
848 sc=detStore()->record(sf,"ShapeFlat");
849 if (sc.isFailure()) {
850 ATH_MSG_ERROR( "Failed to record LArShapeFlat" );
851 }
852
853 ILArShape* ishape=sf;
854 sc=detStore()->symLink(sf,ishape);
855 if (sc.isFailure()) {
856 ATH_MSG_ERROR( "Failed to symlink LArShapeFlat" );
857 }
858 */
859 }
860 }//end if have m_shapeInput
861
862 //Ramp
863 if (!m_RampInput.empty()) {
864 const LArRampComplete* rampComplete = nullptr;
865 sc=detStore()->retrieve(rampComplete,m_RampInput);
866 if (sc.isFailure()) {
867 if(m_forceStop) {
868 ATH_MSG_ERROR( "Failed to get LArRampComplete object" );
869 return sc;
870 } else {
871 ATH_MSG_WARNING( "Will not process LArRampComplete" );
872 }
873 } else {
874 rampFlat(rampComplete,flatName+"/Ramp");
875 }
876 }
877
878 if(!m_DSPThresholdsInput.empty()) {
879 //DSPThresh:
880 const LArDSPThresholdsComplete* DSPTComplete = nullptr;
881 sc=detStore()->retrieve(DSPTComplete,m_DSPThresholdsInput);
882 if (sc.isFailure()) {
883 if(m_forceStop) {
884 ATH_MSG_ERROR( "Failed to get LArDSPThresholdsComplete object" );
885 return sc;
886 } else {
887 ATH_MSG_WARNING( "Will not process LArDSPThresholdsComplete" );
888 }
889 }
890 DSPThresholdsFlat(DSPTComplete,"/LAR/Configuration/DSPThresholdFlat/Templates");
891 /*
892 AthenaAttributeList *cl=DSPThresholdsFlat(DSPTComplete,"/LAR/Configuration/DSPThresholdFlat/Templates");
893
894 LArDSPThresholdsFlat* df;
895 if(cl) {
896 df=new LArDSPThresholdsFlat(cl);
897
898 sc=detStore()->record(df,"DSPThresholdsFlat");
899 if (sc.isFailure()) {
900 ATH_MSG_ERROR( "Failed to record LArDSPThresholdsFlat" );
901 }
902 }
903 */
904 } //end if have m__DSPThresholdsInput
905
906
907 return StatusCode::SUCCESS;
908}
#define ATH_MSG_DEBUG(x)
CondAttrListCollection * rampFlat(const ILArRamp *input, const std::string &outputName)
CondAttrListCollection * ofcFlat(const ILArOFC *input, const std::string &outputName, const LArfSamplSC *weights=nullptr)
AthenaAttributeList * DSPThresholdsFlat(const LArDSPThresholdsComplete *input, const std::string &outputName)
CondAttrListCollection * singleFloatFlat(const char *blobName, const LArConditionsContainer< LArSingleFloatP > *input, const std::string &outputName, const unsigned nGain, const bool withFCAL=true)
CondAttrListCollection * uA2MeVFlat(const ILAruA2MeV *input, const std::string &outputName)
CondAttrListCollection * pedestalFlat(const ILArPedestal *input, const std::string &outputName)
CondAttrListCollection * shapeFlat(const LArShapeComplete *input, const std::string &outputName)
CondAttrListCollection * DAC2uAFlat(const ILArDAC2uA *input, const std::string &outputName)
long long ll

◆ sysInitialize()

StatusCode AthAlgorithm::sysInitialize ( )
overridevirtualinherited

Override sysInitialize.

Override sysInitialize from the base class.

Loop through all output handles, and if they're WriteCondHandles, automatically register them and this Algorithm with the CondSvc

Scan through all outputHandles, and if they're WriteCondHandles, register them with the CondSvc

Reimplemented from AthCommonDataStore< AthCommonMsg< Algorithm > >.

Reimplemented in AthAnalysisAlgorithm, AthFilterAlgorithm, AthHistogramAlgorithm, and PyAthena::Alg.

Definition at line 66 of file AthAlgorithm.cxx.

66 {
68
69 if (sc.isFailure()) {
70 return sc;
71 }
72 ServiceHandle<ICondSvc> cs("CondSvc",name());
73 for (auto h : outputHandles()) {
74 if (h->isCondition() && h->mode() == Gaudi::DataHandle::Writer) {
75 // do this inside the loop so we don't create the CondSvc until needed
76 if ( cs.retrieve().isFailure() ) {
77 ATH_MSG_WARNING("no CondSvc found: won't autoreg WriteCondHandles");
78 return StatusCode::SUCCESS;
79 }
80 if (cs->regHandle(this,*h).isFailure()) {
81 sc = StatusCode::FAILURE;
82 ATH_MSG_ERROR("unable to register WriteCondHandle " << h->fullKey()
83 << " with CondSvc");
84 }
85 }
86 }
87 return sc;
88}
virtual StatusCode sysInitialize() override
Override sysInitialize.
AthCommonDataStore(const std::string &name, T... args)
virtual std::vector< Gaudi::DataHandle * > outputHandles() const override

◆ sysStart()

virtual StatusCode AthCommonDataStore< AthCommonMsg< Algorithm > >::sysStart ( )
overridevirtualinherited

Handle START transition.

We override this in order to make sure that conditions handle keys can cache a pointer to the conditions container.

◆ uA2MeVFlat()

CondAttrListCollection * LArCompleteToFlat::uA2MeVFlat ( const ILAruA2MeV * input,
const std::string & outputName )
private

Definition at line 595 of file LArCompleteToFlat.cxx.

595 {
596 coral::AttributeListSpecification* spec = new coral::AttributeListSpecification();
597 spec->extend("uA2MeV", "blob");
598 spec->extend<unsigned>("version");
599 CondAttrListCollection* coll=new CondAttrListCollection(true);
600 coral::AttributeList* attrList = new coral::AttributeList(*spec);
601 (*attrList)["version"].setValue(0U);
602 coral::Blob& blob=(*attrList)["uA2MeV"].data<coral::Blob>();
603 blob.resize(m_hashMax*sizeof(float));
604 float* pblob=static_cast<float*>(blob.startingAddress());
605 for (unsigned hs=0;hs<m_hashMax;++hs) {
606 const HWIdentifier chid=m_onlineID->channel_Id(hs);
607 pblob[hs]=input->UA2MEV(chid);
608 }
609 coll->add(1,*attrList);
610 //delete attrList;//???
611 StatusCode sc=detStore()->record(coll,outputName);
612 if (sc.isFailure()) {
613 ATH_MSG_ERROR( "Failed to record CondAttrListCollection with key" << outputName );
614 return nullptr;
615 }
616 return coll;
617}

◆ updateVHKA()

void AthCommonDataStore< AthCommonMsg< Algorithm > >::updateVHKA ( Gaudi::Details::PropertyBase & )
inlineinherited

Definition at line 308 of file AthCommonDataStore.h.

308 {
309 // debug() << "updateVHKA for property " << p.name() << " " << p.toString()
310 // << " size: " << m_vhka.size() << endmsg;
311 for (auto &a : m_vhka) {
313 for (auto k : keys) {
314 k->setOwner(this);
315 }
316 }
317 }
std::vector< SG::VarHandleKeyArray * > m_vhka

Member Data Documentation

◆ m_cablingKey

SG::ReadCondHandleKey<LArOnOffIdMapping> LArCompleteToFlat::m_cablingKey {this,"CablingKey","LArOnOffIdMap","SG Key of LArOnOffIdMapping object"}
private

Definition at line 72 of file LArCompleteToFlat.h.

72{this,"CablingKey","LArOnOffIdMap","SG Key of LArOnOffIdMapping object"};

◆ m_cablingKeySC

SG::ReadCondHandleKey<LArOnOffIdMapping> LArCompleteToFlat::m_cablingKeySC {this,"CablingSCKey","LArOnOffIdMapSC","SG Key of LArOnOffIdMapping object"}
private

Definition at line 73 of file LArCompleteToFlat.h.

73{this,"CablingSCKey","LArOnOffIdMapSC","SG Key of LArOnOffIdMapping object"};

◆ m_DAC2uAInput

std::string LArCompleteToFlat::m_DAC2uAInput
private

Definition at line 78 of file LArCompleteToFlat.h.

◆ m_detStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< Algorithm > >::m_detStore
privateinherited

Pointer to StoreGate (detector store by default)

Definition at line 393 of file AthCommonDataStore.h.

◆ m_DSPThresholdsInput

std::string LArCompleteToFlat::m_DSPThresholdsInput
private

Definition at line 86 of file LArCompleteToFlat.h.

◆ m_evtStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< Algorithm > >::m_evtStore
privateinherited

Pointer to StoreGate (event store by default)

Definition at line 390 of file AthCommonDataStore.h.

◆ m_extendedExtraObjects

DataObjIDColl AthAlgorithm::m_extendedExtraObjects
privateinherited

Definition at line 79 of file AthAlgorithm.h.

◆ m_fakeEMBPSLowGain

bool LArCompleteToFlat::m_fakeEMBPSLowGain
private

Definition at line 93 of file LArCompleteToFlat.h.

◆ m_forceStop

bool LArCompleteToFlat::m_forceStop
private

Definition at line 92 of file LArCompleteToFlat.h.

◆ m_hashMax

unsigned LArCompleteToFlat::m_hashMax
private

Definition at line 69 of file LArCompleteToFlat.h.

◆ m_HVScaleCorrInput

std::string LArCompleteToFlat::m_HVScaleCorrInput
private

Definition at line 79 of file LArCompleteToFlat.h.

◆ m_isSC

bool LArCompleteToFlat::m_isSC
private

Definition at line 91 of file LArCompleteToFlat.h.

◆ m_MphysOverMcalInput

std::string LArCompleteToFlat::m_MphysOverMcalInput
private

Definition at line 82 of file LArCompleteToFlat.h.

◆ m_nameOfSet

std::string LArCompleteToFlat::m_nameOfSet
private

Definition at line 89 of file LArCompleteToFlat.h.

◆ m_OFCCaliInput

std::string LArCompleteToFlat::m_OFCCaliInput
private

Definition at line 84 of file LArCompleteToFlat.h.

◆ m_OFCInput

std::string LArCompleteToFlat::m_OFCInput
private

Definition at line 83 of file LArCompleteToFlat.h.

◆ m_onlineID

const LArOnlineID_Base* LArCompleteToFlat::m_onlineID
private

Definition at line 70 of file LArCompleteToFlat.h.

◆ m_PedestalInput

std::string LArCompleteToFlat::m_PedestalInput
private

Definition at line 80 of file LArCompleteToFlat.h.

◆ m_RampInput

std::string LArCompleteToFlat::m_RampInput
private

Definition at line 81 of file LArCompleteToFlat.h.

◆ m_ShapeInput

std::string LArCompleteToFlat::m_ShapeInput
private

Definition at line 85 of file LArCompleteToFlat.h.

◆ m_uA2MeVInput

std::string LArCompleteToFlat::m_uA2MeVInput
private

InputSGKeys.

Definition at line 77 of file LArCompleteToFlat.h.

◆ m_varHandleArraysDeclared

bool AthCommonDataStore< AthCommonMsg< Algorithm > >::m_varHandleArraysDeclared
privateinherited

Definition at line 399 of file AthCommonDataStore.h.

◆ m_vhka

std::vector<SG::VarHandleKeyArray*> AthCommonDataStore< AthCommonMsg< Algorithm > >::m_vhka
privateinherited

Definition at line 398 of file AthCommonDataStore.h.

◆ m_weightsKeySC

SG::ReadCondHandleKey<LArfSamplSC> LArCompleteToFlat::m_weightsKeySC {this,"WeightsSCKey","","SG Key of weights object"}
private

Definition at line 74 of file LArCompleteToFlat.h.

74{this,"WeightsSCKey","","SG Key of weights object"};

The documentation for this class was generated from the following files: