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< StoreGateSvcStoreGateSvc_t

Private Member Functions

 LArCompleteToFlat ()=delete
 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 = 0
const LArOnlineID_Basem_onlineID = nullptr
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"}
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", "" }
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 }
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 32 of file LArCompleteToFlat.h.

Member Typedef Documentation

◆ StoreGateSvc_t

typedef ServiceHandle<StoreGateSvc> AthCommonDataStore< AthCommonMsg< Gaudi::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 ::AthReentrantAlgorithm( name, pSvcLocator )
44{
45 declareProperty("OFCInput",m_OFCInput);//="LArOFC");
46 declareProperty("OFCCaliInput",m_OFCCaliInput);//="LArOFC");
47 declareProperty("ShapeInput",m_ShapeInput);//="LArShape");
48 declareProperty("DSPThresholdsInput",m_DSPThresholdsInput);//="LArDSPThresholds");
49 declareProperty("NameOfSet",m_nameOfSet); // for DSPThreshold
50
51 declareProperty("ForceStop",m_forceStop=true);
52
53 declareProperty("FakeEMBPSLowGain",m_fakeEMBPSLowGain=false);
54
55
56}
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 559 of file LArCompleteToFlat.cxx.

559 {
560 coral::AttributeListSpecification* spec = new coral::AttributeListSpecification();
561 spec->extend("DAC2uA", "blob");
562 spec->extend<unsigned>("version");
563 CondAttrListCollection* coll=new CondAttrListCollection(true);
564 coral::AttributeList* attrList = new coral::AttributeList(*spec);
565 (*attrList)["version"].setValue(0U);
566 coral::Blob& blob=(*attrList)["DAC2uA"].data<coral::Blob>();
567 blob.resize(m_hashMax*sizeof(float));
568 float* pblob=static_cast<float*>(blob.startingAddress());
569 for (unsigned hs=0;hs<m_hashMax;++hs) {
570 const HWIdentifier chid=m_onlineID->channel_Id(hs);
571 pblob[hs]=input->DAC2UA(chid);
572 }
573 coll->add(1,*attrList);
574 //delete attrList;//???
575 StatusCode sc=detStore()->record(coll,outputName);
576 if (sc.isFailure()) {
577 ATH_MSG_ERROR( "Failed to record CondAttrListCollection with key" << outputName );
578 return nullptr;
579 }
580 return coll;
581}
#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 608 of file LArCompleteToFlat.cxx.

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

903 {
904
905 const LArOnOffIdMapping* cabling(nullptr);
906 if(m_isSC){
907 SG::ReadCondHandle<LArOnOffIdMapping> cablingHdl{m_cablingKeySC};
908 cabling=*cablingHdl;
909 }else{
910 SG::ReadCondHandle<LArOnOffIdMapping> cablingHdl{m_cablingKey};
911 cabling=*cablingHdl;
912 }
913 if(!cabling) {
914 ATH_MSG_ERROR( "Do not have cabling mapping from key " << m_cablingKey.key() );
915 return;
916 }
917
918 if (cabling->isOnlineConnected(chid)) {
919 if (gain!=2 || !m_onlineID->isEMBPS(chid)) { //No LG Presampler calibration
920 ATH_MSG_ERROR( "No valid " << objName << " found for channel " << m_onlineID->channel_name(chid) << ", gain " << gain << ". ");
921 if (message) ATH_MSG_ERROR( message );
922 ATH_MSG_ERROR( " Filling with default value." );
923 }
924 }
925 }
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 47 of file LArCompleteToFlat.h.

47{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 64 of file LArCompleteToFlat.cxx.

65{
66 ATH_CHECK( m_cablingKey.initialize() );
67 ATH_CHECK( m_cablingKeySC.initialize(m_isSC) );
68 ATH_CHECK( m_weightsKeySC.initialize(m_isSC && !m_weightsKeySC.empty()) );
69 return StatusCode::SUCCESS;
70}
#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 }

◆ ofcFlat()

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

Definition at line 200 of file LArCompleteToFlat.cxx.

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

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

◆ rampFlat()

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

Definition at line 448 of file LArCompleteToFlat.cxx.

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

remove all handles from I/O resolution

Definition at line 364 of file AthCommonDataStore.h.

364 {
366 }

◆ setFilterPassed()

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

Set filter decision:

Reimplemented in AthFilterAlgorithm.

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 329 of file LArCompleteToFlat.cxx.

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

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

◆ stop()

StatusCode LArCompleteToFlat::stop ( )
overridevirtual

Definition at line 654 of file LArCompleteToFlat.cxx.

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

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

◆ updateVHKA()

void AthCommonDataStore< AthCommonMsg< Gaudi::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 }

Member Data Documentation

◆ m_cablingKey

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

Definition at line 71 of file LArCompleteToFlat.h.

71{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 72 of file LArCompleteToFlat.h.

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

◆ m_DAC2uAInput

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

Definition at line 77 of file LArCompleteToFlat.h.

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

◆ m_detStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< Gaudi::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 85 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 390 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 92 of file LArCompleteToFlat.h.

◆ m_forceStop

bool LArCompleteToFlat::m_forceStop
private

Definition at line 91 of file LArCompleteToFlat.h.

◆ m_hashMax

unsigned LArCompleteToFlat::m_hashMax = 0
private

Definition at line 68 of file LArCompleteToFlat.h.

◆ m_HVScaleCorrInput

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

Definition at line 78 of file LArCompleteToFlat.h.

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

◆ m_isSC

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

Definition at line 90 of file LArCompleteToFlat.h.

90{ this, "isSC", false };

◆ m_MphysOverMcalInput

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

Definition at line 81 of file LArCompleteToFlat.h.

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

◆ m_nameOfSet

std::string LArCompleteToFlat::m_nameOfSet
private

Definition at line 88 of file LArCompleteToFlat.h.

◆ m_OFCCaliInput

std::string LArCompleteToFlat::m_OFCCaliInput
private

Definition at line 83 of file LArCompleteToFlat.h.

◆ m_OFCInput

std::string LArCompleteToFlat::m_OFCInput
private

Definition at line 82 of file LArCompleteToFlat.h.

◆ m_onlineID

const LArOnlineID_Base* LArCompleteToFlat::m_onlineID = nullptr
private

Definition at line 69 of file LArCompleteToFlat.h.

◆ m_PedestalInput

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

Definition at line 79 of file LArCompleteToFlat.h.

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

◆ m_RampInput

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

Definition at line 80 of file LArCompleteToFlat.h.

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

◆ m_ShapeInput

std::string LArCompleteToFlat::m_ShapeInput
private

Definition at line 84 of file LArCompleteToFlat.h.

◆ m_uA2MeVInput

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

InputSGKeys.

Definition at line 76 of file LArCompleteToFlat.h.

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

◆ m_varHandleArraysDeclared

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

Definition at line 399 of file AthCommonDataStore.h.

◆ m_vhka

std::vector<SG::VarHandleKeyArray*> AthCommonDataStore< AthCommonMsg< Gaudi::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 73 of file LArCompleteToFlat.h.

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

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