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:
virtual StatusCode initialize () override
virtual StatusCode execute (const EventContext &) const override
virtual StatusCode stop () override
virtual StatusCode sysInitialize () override
 Override sysInitialize.
virtual bool isClonable () const override
 Specify if the algorithm is clonable.
virtual StatusCode sysExecute (const EventContext &ctx) override
 Execute an algorithm.
virtual const DataObjIDColl & extraOutputDeps () const override
 Return the list of extra output dependencies.
virtual bool filterPassed (const EventContext &ctx) const
 Get filter decision:
virtual void setFilterPassed (bool state, const EventContext &ctx) const
 Set filter decision:
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< StoreGateSvc > StoreGateSvc_t

Private Member Functions

 LArCompleteToFlat ()=delete
 Default constructor:
CondAttrListCollection * singleFloatFlat (const char *blobName, const LArConditionsContainer< LArSingleFloatP > *input, const std::string &outputName, const unsigned nGain, const bool withFCAL=true)
CondAttrListCollection * DAC2uAFlat (const ILArDAC2uA *input, const std::string &outputName)
CondAttrListCollection * uA2MeVFlat (const ILAruA2MeV *input, const std::string &outputName)
CondAttrListCollection * pedestalFlat (const ILArPedestal *input, const std::string &outputName)
CondAttrListCollection * rampFlat (const ILArRamp *input, const std::string &outputName)
CondAttrListCollection * ofcFlat (const ILArOFC *input, const std::string &outputName, const LArfSamplSC *weights=nullptr)
CondAttrListCollection * shapeFlat (const LArShapeComplete *input, const std::string &outputName)
CondAttrListCollection * noiseFlat (const ILArNoise *input, const std::string &outputName)
AthenaAttributeList * DSPThresholdsFlat (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 = 0
const LArOnlineID_Base * m_onlineID = nullptr
SG::ReadCondHandleKey< LArOnOffIdMapping > m_cablingKey {this,"CablingKey","LArOnOffIdMap","SG Key of LArOnOffIdMapping object"}
SG::ReadCondHandleKey< LArOnOffIdMapping > m_cablingKeySC {this,"CablingSCKey","LArOnOffIdMapSC","SG Key of LArOnOffIdMapping object"}
SG::ReadCondHandleKey< LArfSamplSC > m_weightsKeySC {this,"WeightsSCKey","","SG Key of weights object"}
StringProperty m_uA2MeVInput { this, "uA2MeVInput", "" }
 InputSGKeys.
StringProperty m_DAC2uAInput { this, "DAC2uAVInput", "" }
StringProperty m_HVScaleCorrInput { this, "HVScaleCorrInput", "" }
StringProperty m_PedestalInput { this, "PedestalInput", "" }
StringProperty m_RampInput { this, "RampInput", "" }
StringProperty m_MphysOverMcalInput { this, "MphysOverMcalInput", "" }
StringProperty m_noiseInput {this,"NoiseInput",""}
StringProperty m_flatName {this, "FolderBase","/LAR/ElecCalibFlat"}
std::string m_OFCInput
std::string m_OFCCaliInput
std::string m_ShapeInput
std::string m_DSPThresholdsInput
std::string m_nameOfSet
BooleanProperty m_isSC { this, "isSC", false }
IntegerProperty m_nGains {this,"nGains",3}
bool m_forceStop
bool m_fakeEMBPSLowGain
DataObjIDColl m_extendedExtraObjects
 Extra output dependency collection, extended by AthAlgorithmDHUpdate to add symlinks.
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 34 of file LArCompleteToFlat.h.

Member Typedef Documentation

◆ StoreGateSvc_t

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

Definition at line 376 of file AthCommonDataStore.h.

Constructor & Destructor Documentation

◆ LArCompleteToFlat() [1/2]

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

Constructor with parameters:

Definition at line 43 of file LArCompleteToFlat.cxx.

44 :
45 ::AthReentrantAlgorithm( name, pSvcLocator )
46{
47 declareProperty("OFCInput",m_OFCInput);//="LArOFC");
48 declareProperty("OFCCaliInput",m_OFCCaliInput);//="LArOFC");
49 declareProperty("ShapeInput",m_ShapeInput);//="LArShape");
50 declareProperty("DSPThresholdsInput",m_DSPThresholdsInput);//="LArDSPThresholds");
51 declareProperty("NameOfSet",m_nameOfSet); // for DSPThreshold
52
53 declareProperty("ForceStop",m_forceStop=true);
54
55 declareProperty("FakeEMBPSLowGain",m_fakeEMBPSLowGain=false);
56
57
58}
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)
std::string m_OFCCaliInput
std::string m_DSPThresholdsInput

◆ ~LArCompleteToFlat()

LArCompleteToFlat::~LArCompleteToFlat ( )
virtualdefault

Destructor:

◆ LArCompleteToFlat() [2/2]

LArCompleteToFlat::LArCompleteToFlat ( )
privatedelete

Default constructor:

Member Function Documentation

◆ DAC2uAFlat()

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

Definition at line 563 of file LArCompleteToFlat.cxx.

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

◆ declareGaudiProperty()

Gaudi::Details::PropertyBase & AthCommonDataStore< AthCommonMsg< Gaudi::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< Gaudi::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< Gaudi::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 612 of file LArCompleteToFlat.cxx.

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

◆ errIfConnected()

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

Definition at line 921 of file LArCompleteToFlat.cxx.

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

◆ evtStore()

ServiceHandle< StoreGateSvc > & AthCommonDataStore< AthCommonMsg< Gaudi::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()

virtual StatusCode LArCompleteToFlat::execute ( const EventContext & ) const
inlineoverridevirtual

Definition at line 49 of file LArCompleteToFlat.h.

49{return StatusCode::SUCCESS;}

◆ extraDeps_update_handler()

void AthCommonDataStore< AthCommonMsg< Gaudi::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 & AthCommonAlgorithm< Gaudi::Algorithm >::extraOutputDeps ( ) const
overridevirtualinherited

Return the list of extra output dependencies.

This list is extended to include symlinks implied by inheritance relations.

Definition at line 89 of file AthCommonAlgorithm.cxx.

54{
55 // If we didn't find any symlinks to add, just return the collection
56 // from the base class. Otherwise, return the extended collection.
57 if (!m_extendedExtraObjects.empty()) {
59 }
61}
Common base class for algorithms.

◆ filterPassed()

virtual bool AthCommonAlgorithm< Gaudi::Algorithm >::filterPassed ( const EventContext & ctx) const
inlinevirtualinherited

Get filter decision:

Definition at line 93 of file AthCommonAlgorithm.h.

93 {
94 return execState( ctx ).filterPassed();
95 }
virtual bool filterPassed(const EventContext &ctx) const
Get filter decision:

◆ initialize()

StatusCode LArCompleteToFlat::initialize ( )
overridevirtual

Definition at line 66 of file LArCompleteToFlat.cxx.

67{
68 ATH_CHECK( m_cablingKey.initialize() );
69 ATH_CHECK( m_cablingKeySC.initialize(m_isSC) );
70 ATH_CHECK( m_weightsKeySC.initialize(m_isSC && !m_weightsKeySC.empty()) );
71 return StatusCode::SUCCESS;
72}
#define ATH_CHECK
Evaluate an expression and check for errors.
SG::ReadCondHandleKey< LArfSamplSC > m_weightsKeySC

◆ inputHandles()

virtual std::vector< Gaudi::DataHandle * > AthCommonDataStore< AthCommonMsg< Gaudi::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.

◆ isClonable()

virtual bool AthCommonAlgorithm< Gaudi::Algorithm >::isClonable ( ) const
inlineoverridevirtualinherited

Specify if the algorithm is clonable.

Only relevant for non-reentrant algorithms. Actual number of clones needs to be set via the "Cardinality" property.

Reimplemented in AFP_DigiTop, AlgB, AlgT, BCM_Digitization, CscDigitBuilder, CscDigitToCscRDO, G4AtlasAlg, G4RunAlg, HGTD_Digitization, HiveAlgBase, InDet::GNNSeedingTrackMaker, InDet::SCT_Clusterization, InDet::SiSPGNNTrackMaker, InDet::SiSPSeededTrackFinder, InDet::SiTrackerSpacePointFinder, ISF::SimKernelMT, ITk::StripDigitization, ITkPixelCablingAlg, ITkStripCablingAlg, LArHitEMapMaker, LArTTL1Maker, LUCID_DigiTop, LVL1::L1TopoSimulation, MergeCalibHits, MergeGenericMuonSimHitColl, MergeHijingPars, MergeMcEventCollection, MergeTrackRecordCollection, MergeTruthJets, MergeTruthParticles, MuonDigitizer, PileUpMTAlg, PixelDigitization, RoIBResultToxAOD, SCT_ByteStreamErrorsTestAlg, SCT_CablingCondAlgFromCoraCool, SCT_CablingCondAlgFromText, SCT_ConditionsParameterTestAlg, SCT_ConditionsSummaryTestAlg, SCT_ConfigurationConditionsTestAlg, SCT_Digitization, SCT_FlaggedConditionTestAlg, SCT_LinkMaskingTestAlg, SCT_MajorityConditionsTestAlg, SCT_ModuleVetoTestAlg, SCT_MonitorConditionsTestAlg, SCT_PrepDataToxAOD, SCT_RawDataToxAOD, SCT_ReadCalibChipDataTestAlg, SCT_ReadCalibDataTestAlg, SCT_RODVetoTestAlg, SCT_SensorsTestAlg, SCT_SiliconConditionsTestAlg, SCT_StripVetoTestAlg, SCT_TdaqEnabledTestAlg, SCT_TestCablingAlg, SCTEventFlagWriter, SCTRawDataProvider, SCTSiLorentzAngleTestAlg, SCTSiPropertiesTestAlg, SGInputLoader, Simulation::BeamEffectsAlg, TileHitVecToCnt, TileMuonFitter, TilePulseForTileMuonReceiver, TileRawChannelMaker, TRTDigitization, and ZDC_DigiTop.

Definition at line 68 of file AthCommonAlgorithm.h.

68 {
69 return true;
70 }

◆ msg()

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

Definition at line 24 of file AthCommonMsg.h.

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

◆ msgLvl()

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

Definition at line 30 of file AthCommonMsg.h.

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

◆ noiseFlat()

CondAttrListCollection * LArCompleteToFlat::noiseFlat ( const ILArNoise * input,
const std::string & outputName )
private

Definition at line 657 of file LArCompleteToFlat.cxx.

657 {
658 ATH_MSG_INFO("LArCompleteToFlat::pedestalFlat, starting");
659
660 unsigned nChannels=0;
661
662 coral::AttributeListSpecification* spec = new coral::AttributeListSpecification();
663 spec->extend("Noise", "blob");
664 spec->extend<unsigned>("version");
665
666 CondAttrListCollection* coll=new CondAttrListCollection(true);
667
668 const unsigned nGain = m_isSC ? 1 : m_nGains.value();
669 for (unsigned gain=0;gain<nGain;++gain) {
670 coral::AttributeList* attrList = new coral::AttributeList(*spec);
671 (*attrList)["version"].setValue(0U);
672 coral::Blob& blob=(*attrList)["Noise"].data<coral::Blob>();
673 blob.resize(m_hashMax*sizeof(float));
674 float* pblob=static_cast<float*>(blob.startingAddress());
675 for (unsigned hs=0;hs<m_hashMax;++hs) {
676 const HWIdentifier chid=m_onlineID->channel_Id(hs);
677 float noiseVal=input->noise(chid,gain);
678 pblob[hs]=noiseVal;
679 ++nChannels;
680 }
681 coll->add(gain,*attrList);
682 }
683
684 StatusCode sc=detStore()->record(coll,outputName);//"/LAR/ElecCalibFlat/Noise");
685 if (sc.isFailure()) {
686 ATH_MSG_ERROR( "Failed to record CondAttrListCollection for noise with key " << outputName );
687 return nullptr;
688 }
689 ATH_MSG_INFO("Recoreded CondAttrListCollection for noise with key " << outputName );
690
691 ATH_MSG_INFO( "Converted Ramps to inline storage. Total number of channels " << nChannels );
692
693 return coll;
694}
IntegerProperty m_nGains
unsigned int constexpr nChannels
Definition RPDUtils.h:23

◆ ofcFlat()

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

Definition at line 203 of file LArCompleteToFlat.cxx.

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

◆ outputHandles()

virtual std::vector< Gaudi::DataHandle * > AthCommonDataStore< AthCommonMsg< Gaudi::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 138 of file LArCompleteToFlat.cxx.

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

◆ rampFlat()

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

Definition at line 451 of file LArCompleteToFlat.cxx.

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

Definition at line 368 of file AthCommonDataStore.h.

369 {
370 h.renounce();
372 }
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< Gaudi::Algorithm > >::renounceArray ( SG::VarHandleKeyArray & handlesArray)
inlineprotectedinherited

remove all handles from I/O resolution

Definition at line 352 of file AthCommonDataStore.h.

352 {
354 }

◆ setFilterPassed()

virtual void AthCommonAlgorithm< Gaudi::Algorithm >::setFilterPassed ( bool state,
const EventContext & ctx ) const
inlinevirtualinherited

Set filter decision:

Definition at line 99 of file AthCommonAlgorithm.h.

99 {
101 }
virtual void setFilterPassed(bool state, const EventContext &ctx) const
Set filter decision:

◆ shapeFlat()

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

Definition at line 332 of file LArCompleteToFlat.cxx.

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

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

◆ stop()

StatusCode LArCompleteToFlat::stop ( )
overridevirtual

Definition at line 698 of file LArCompleteToFlat.cxx.

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

◆ sysExecute()

StatusCode AthCommonAlgorithm< Gaudi::Algorithm >::sysExecute ( const EventContext & ctx)
overridevirtualinherited

Execute an algorithm.

We override this in order to work around an issue with the Algorithm base class storing the event context in a member variable that can cause crashes in MT jobs.

Reimplemented in AthAnalysisAlgorithm.

Definition at line 80 of file AthCommonAlgorithm.cxx.

41{
42 return BaseAlg::sysExecute (ctx);
43}

◆ sysInitialize()

StatusCode AthCommonAlgorithm< Gaudi::Algorithm >::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< Gaudi::Algorithm > >.

Reimplemented in AthAnalysisAlgorithm, AthHistogramAlgorithm, HypoBase, InputMakerBase, and PyAthena::Alg.

Definition at line 60 of file AthCommonAlgorithm.cxx.

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

◆ sysStart()

virtual StatusCode AthCommonDataStore< AthCommonMsg< Gaudi::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 588 of file LArCompleteToFlat.cxx.

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

◆ updateVHKA()

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

Definition at line 298 of file AthCommonDataStore.h.

298 {
299 for (auto &a : m_vhka) {
301 for (auto k : keys) {
302 k->setOwner(this);
303 }
304 }
305 }

Member Data Documentation

◆ m_cablingKey

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

Definition at line 74 of file LArCompleteToFlat.h.

74{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 75 of file LArCompleteToFlat.h.

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

◆ m_DAC2uAInput

StringProperty LArCompleteToFlat::m_DAC2uAInput { this, "DAC2uAVInput", "" }
private

Definition at line 80 of file LArCompleteToFlat.h.

80{ this, "DAC2uAVInput", "" }; // LArDAC2uA

◆ m_detStore

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

Pointer to StoreGate (detector store by default).

Definition at line 381 of file AthCommonDataStore.h.

◆ m_DSPThresholdsInput

std::string LArCompleteToFlat::m_DSPThresholdsInput
private

Definition at line 90 of file LArCompleteToFlat.h.

◆ m_evtStore

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

Pointer to StoreGate (event store by default).

Definition at line 378 of file AthCommonDataStore.h.

◆ m_extendedExtraObjects

DataObjIDColl AthCommonAlgorithm< Gaudi::Algorithm >::m_extendedExtraObjects
privateinherited

Extra output dependency collection, extended by AthAlgorithmDHUpdate to add symlinks.

Empty if no symlinks were found.

Definition at line 108 of file AthCommonAlgorithm.h.

◆ m_fakeEMBPSLowGain

bool LArCompleteToFlat::m_fakeEMBPSLowGain
private

Definition at line 98 of file LArCompleteToFlat.h.

◆ m_flatName

StringProperty LArCompleteToFlat::m_flatName {this, "FolderBase","/LAR/ElecCalibFlat"}
private

Definition at line 86 of file LArCompleteToFlat.h.

86{this, "FolderBase","/LAR/ElecCalibFlat"};

◆ m_forceStop

bool LArCompleteToFlat::m_forceStop
private

Definition at line 97 of file LArCompleteToFlat.h.

◆ m_hashMax

unsigned LArCompleteToFlat::m_hashMax = 0
private

Definition at line 71 of file LArCompleteToFlat.h.

◆ m_HVScaleCorrInput

StringProperty LArCompleteToFlat::m_HVScaleCorrInput { this, "HVScaleCorrInput", "" }
private

Definition at line 81 of file LArCompleteToFlat.h.

81{ this, "HVScaleCorrInput", "" }; // LArHVScaleCorr

◆ m_isSC

BooleanProperty LArCompleteToFlat::m_isSC { this, "isSC", false }
private

Definition at line 95 of file LArCompleteToFlat.h.

95{ this, "isSC", false };

◆ m_MphysOverMcalInput

StringProperty LArCompleteToFlat::m_MphysOverMcalInput { this, "MphysOverMcalInput", "" }
private

Definition at line 84 of file LArCompleteToFlat.h.

84{ this, "MphysOverMcalInput", "" }; // LArMphysOverMcal

◆ m_nameOfSet

std::string LArCompleteToFlat::m_nameOfSet
private

Definition at line 93 of file LArCompleteToFlat.h.

◆ m_nGains

IntegerProperty LArCompleteToFlat::m_nGains {this,"nGains",3}
private

Definition at line 96 of file LArCompleteToFlat.h.

96{this,"nGains",3};

◆ m_noiseInput

StringProperty LArCompleteToFlat::m_noiseInput {this,"NoiseInput",""}
private

Definition at line 85 of file LArCompleteToFlat.h.

85{this,"NoiseInput",""};

◆ m_OFCCaliInput

std::string LArCompleteToFlat::m_OFCCaliInput
private

Definition at line 88 of file LArCompleteToFlat.h.

◆ m_OFCInput

std::string LArCompleteToFlat::m_OFCInput
private

Definition at line 87 of file LArCompleteToFlat.h.

◆ m_onlineID

const LArOnlineID_Base* LArCompleteToFlat::m_onlineID = nullptr
private

Definition at line 72 of file LArCompleteToFlat.h.

◆ m_PedestalInput

StringProperty LArCompleteToFlat::m_PedestalInput { this, "PedestalInput", "" }
private

Definition at line 82 of file LArCompleteToFlat.h.

82{ this, "PedestalInput", "" }; // Pedestal

◆ m_RampInput

StringProperty LArCompleteToFlat::m_RampInput { this, "RampInput", "" }
private

Definition at line 83 of file LArCompleteToFlat.h.

83{ this, "RampInput", "" }; // LArRamp

◆ m_ShapeInput

std::string LArCompleteToFlat::m_ShapeInput
private

Definition at line 89 of file LArCompleteToFlat.h.

◆ m_uA2MeVInput

StringProperty LArCompleteToFlat::m_uA2MeVInput { this, "uA2MeVInput", "" }
private

InputSGKeys.

Definition at line 79 of file LArCompleteToFlat.h.

79{ this, "uA2MeVInput", "" }; // LAruA2MeV

◆ m_varHandleArraysDeclared

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

Definition at line 387 of file AthCommonDataStore.h.

◆ m_vhka

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

Definition at line 386 of file AthCommonDataStore.h.

◆ m_weightsKeySC

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

Definition at line 76 of file LArCompleteToFlat.h.

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

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