Loading [MathJax]/extensions/tex2jax.js
ATLAS Offline Software
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
LArHVCorrMaker.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 // Include files
11 #include "CoralBase/Blob.h"
15 
16 #include <cmath>
17 #include <unistd.h>
18 
19 
20 
21 
22 //---------------------------------------------------------------------------
24 = default;
25 
26 //---------------------------------------------------------------------------
28 {
29  ATH_MSG_INFO ( " in initialize " );
32  return StatusCode::SUCCESS;
33 }
34 
35 
36 //---------------------------------------------------------------------------
38 {
39  return StatusCode::SUCCESS;
40 }
41 
42 
43 //---------------------------------------------------------------------------
45 {
46  ATH_MSG_INFO ( " in stop" );
47 
48  const EventContext& ctx = Gaudi::Hive::currentContext();
49 
51 
53 
54  const LArOnlineID_Base* lar_on_id = nullptr;
55  if(m_isSC) {
56  const LArOnline_SuperCellID* scid=nullptr;
57  ATH_CHECK( detStore()->retrieve(scid,"LArOnline_SuperCellID") );
58  lar_on_id=scid;
59  } else {
60  const LArOnlineID* lid=nullptr;
61  ATH_CHECK( detStore()->retrieve(lid,"LArOnlineID") );
62  lar_on_id=lid;
63  }
64 
65  const unsigned hashMax=lar_on_id->channelHashMax();
66  coral::AttributeListSpecification* spec = new coral::AttributeListSpecification;
67  spec->extend("HVScaleCorr", "blob");
68  spec->extend<unsigned>("version");
69  auto coll = std::make_unique<CondAttrListCollection>(true);
70  coral::AttributeList attrList(*spec);
71  spec->release();
72  attrList["version"].setValue(0U);
73  coral::Blob& blob=attrList["HVScaleCorr"].data<coral::Blob>();
74  blob.resize(hashMax*sizeof(float));
75  float* pblob=static_cast<float*>(blob.startingAddress());
76  //Loop over online hash (to make sure that *every* field of the blob gets filled
77  for (unsigned hs=0;hs<hashMax;++hs) {
78  float value=1.0;
79  if (cabling->isOnlineConnectedFromHash(hs)) {
80  const Identifier id=cabling->cnvToIdentifierFromHash(hs);
81  const HWIdentifier hwid = cabling->createSignalChannelID (id);
82  ATH_MSG_VERBOSE("Filling value for id " << id.get_identifier32().get_compact());
83  value=scaleCorr->HVScaleCorr(hwid);
84  }
85  pblob[hs]=value;
86  }
87 
88  if(m_isSC) {
89  coll->add(0,attrList); //Add as channel 0 to AttrListCollection
90  } else {
91  coll->add(1,attrList); //Add as channel 1 to AttrListCollection
92  }
93 
94  ATH_CHECK( detStore()->record(std::move(coll), m_folderName) );
95  return StatusCode::SUCCESS;
96 }
python.PyKernel.retrieve
def retrieve(aClass, aKey=None)
Definition: PyKernel.py:110
LArHVScaleCorrFlat.h
LArHVCorrMaker.h
CondAttrListCollection.h
This file defines the class for a collection of AttributeLists where each one is associated with a ch...
SG::ReadCondHandle
Definition: ReadCondHandle.h:44
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
CaloCondBlobAlgs_fillNoiseFromASCII.spec
spec
Definition: CaloCondBlobAlgs_fillNoiseFromASCII.py:47
LArHVCorrMaker::initialize
virtual StatusCode initialize() override
Definition: LArHVCorrMaker.cxx:27
ReadCellNoiseFromCool.cabling
cabling
Definition: ReadCellNoiseFromCool.py:154
python.subdetectors.tile.Blob
Blob
Definition: tile.py:17
athena.value
value
Definition: athena.py:124
LArHVCorr.h
python.PyKernel.AttributeList
AttributeList
Definition: PyKernel.py:36
LArHVCorrMaker::m_scaleCorrKey
SG::ReadCondHandleKey< ILArHVScaleCorr > m_scaleCorrKey
Definition: LArHVCorrMaker.h:47
ATH_MSG_VERBOSE
#define ATH_MSG_VERBOSE(x)
Definition: AthMsgStreamMacros.h:28
HWIdentifier
Definition: HWIdentifier.h:13
AthenaAttributeList.h
ReadCondHandle.h
AthCommonDataStore< AthCommonMsg< Algorithm > >::detStore
const ServiceHandle< StoreGateSvc > & detStore() const
The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.
Definition: AthCommonDataStore.h:95
LArHVCorrMaker::m_cablingKey
SG::ReadCondHandleKey< LArOnOffIdMapping > m_cablingKey
Definition: LArHVCorrMaker.h:49
CreatePhysValWebPage.hs
hs
Definition: CreatePhysValWebPage.py:107
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
LArOnlineID_Base
Helper for the Liquid Argon Calorimeter cell identifiers.
Definition: LArOnlineID_Base.h:105
LArOnlineID_Base::channelHashMax
size_type channelHashMax(void) const
Define channel hash tables max size.
Definition: LArOnlineID_Base.cxx:1897
SG::CondHandleKey::initialize
StatusCode initialize(bool used=true)
LArOnlineID
Definition: LArOnlineID.h:20
LArHVCorrMaker::m_isSC
BooleanProperty m_isSC
Definition: LArHVCorrMaker.h:44
LArOnline_SuperCellID
Definition: LArOnline_SuperCellID.h:20
LArHVCorrMaker::m_folderName
Gaudi::Property< std::string > m_folderName
Definition: LArHVCorrMaker.h:42
LArOnline_SuperCellID.h
ILArHVScaleCorr::HVScaleCorr
virtual const float & HVScaleCorr(const HWIdentifier &id) const =0
LArHVCorrMaker::stop
virtual StatusCode stop() override
Definition: LArHVCorrMaker.cxx:44
LArHVCorrMaker::execute
virtual StatusCode execute() override
Definition: LArHVCorrMaker.cxx:37
LArHVCorrMaker::~LArHVCorrMaker
virtual ~LArHVCorrMaker()
CaloCondBlobAlgs_fillNoiseFromASCII.blob
blob
Definition: CaloCondBlobAlgs_fillNoiseFromASCII.py:96
LArOnlineID.h
Identifier
Definition: IdentifierFieldParser.cxx:14