|
ATLAS Offline Software
|
Go to the documentation of this file.
11 #include "GaudiKernel/IToolSvc.h"
12 #include "GaudiKernel/MsgStream.h"
15 #include "CoralBase/AttributeListException.h"
16 #include "CoralBase/Blob.h"
29 #include "TBufferFile.h"
58 m_klass = TClass::GetClass(
"LArHVPathologiesDb");
61 return StatusCode::FAILURE;
68 return StatusCode::SUCCESS;
73 return StatusCode::SUCCESS;
115 if (writeHandle.isValid()) {
117 return StatusCode::SUCCESS;
124 ATH_MSG_ERROR(
"Do not have AthenaAttributeList for pathology");
125 return StatusCode::FAILURE;
127 writeHandle.addDependency(fldrHdl);
131 writeHandle.addDependency(caloMgrHandle);
134 const unsigned blobVersion=(*attrList)[
"blobVersion"].data<
unsigned int>();
139 return StatusCode::FAILURE;
144 TBufferFile buf(TBuffer::kRead,
blob.size(), blob_data,
false);
145 std::unique_ptr<LArHVPathologiesDb> hvpathdb
148 auto hvpath = std::make_unique<LArHVPathology>(hvpathdb.get());
150 fillElectMap(calodetdescrmgr, hvpath.get(), writeHandle);
153 if(writeHandle.record(std::move(hvpath)).isFailure()) {
156 <<
" with EventRange " << writeHandle.getRange()
157 <<
" into Conditions Store");
158 return StatusCode::FAILURE;
161 return StatusCode::SUCCESS;
163 }
catch (coral::AttributeListException &
e) {
165 return StatusCode::FAILURE;
168 return StatusCode::SUCCESS;
179 ATH_MSG_WARNING(
"Do not have HV mapping, will not fill LArHVPathology electIndMap !!!");
184 std::lock_guard<std::mutex> lock(
m_mut);
186 std::map<std::pair<Identifier, unsigned int>, std::vector<unsigned short> > &elecMap = hvpath->
getElecMap();
188 std::vector<unsigned short>
list;
189 std::vector<HWIdentifier> hwlineId;
190 unsigned int HVline = 0;
199 unsigned int nelec =
cell->getNumElectrodes();
200 for(
auto hwid:hwlineId) {
203 for (
unsigned int i=0;
i<nelec;
i++) {
205 for (
unsigned int igap=0;igap<2;igap++) {
206 if ((
unsigned)electrode.
hvLineNo(igap,hvCabling)==HVline) {
207 list.push_back(2*
i+igap);
212 elecMap.insert(std::make_pair(std::make_pair(
id,HVline) ,
list));
220 unsigned int nelec =
cell->getNumElectrodes();
221 for(
auto hwid:hwlineId) {
224 for (
unsigned int i=0;
i<nelec;
i++) {
226 for (
unsigned int igap=0;igap<2;igap++) {
227 if ((
unsigned)electrode.
hvLineNo(igap,hvCabling)==HVline) {
228 list.push_back(2*
i+igap);
233 elecMap.insert(std::make_pair(std::make_pair(
id,HVline),
list));
242 for(
auto hwid:hwlineId) {
245 for (
unsigned int igap=0;igap<2;igap++) {
246 if ((
unsigned)hvmodule.
hvLineNo(igap,hvCabling)==HVline) {
247 list.push_back(igap);
250 elecMap.insert(std::make_pair(std::make_pair(
id,HVline),
list));
260 for(
auto hwid:hwlineId) {
263 for (
unsigned int igap=0;igap<2;igap++) {
264 if ((
unsigned)hvmodule.
hvLineNo(igap,hvCabling)==HVline) {
265 list.push_back(igap);
268 elecMap.insert(std::make_pair(std::make_pair(
id,HVline),
list));
280 unsigned int nsubgaps =
cell->getNumSubgaps();
281 for(
auto hwid:hwlineId) {
284 for (
unsigned int i=0;
i<nsubgaps;
i++) {
286 if ((
unsigned)subgap.
hvLineNo(hvCabling)==HVline) {
290 elecMap.insert(std::make_pair(std::make_pair(
id,HVline),
list));
301 unsigned int nlines =
tile->getNumHVLines();
302 for(
auto hwid:hwlineId) {
305 for (
unsigned int i=0;
i<nlines;
i++) {
308 if ((
unsigned)
line2->hvLineNo(hvCabling)==HVline) {
313 elecMap.insert(std::make_pair(std::make_pair(
id,HVline),
list));
def retrieve(aClass, aKey=None)
SG::ReadCondHandleKey< CaloDetDescrManager > m_caloMgrKey
virtual StatusCode initialize() override
GeoIntrusivePtr< const HECCell > HECCellConstLink
@Class: HECCellConstLink
const LArFCAL_ID * m_larfcal_id
LAr EMEC Detector Element.
Smart Pointer to EMEC Cells. This reference counted link allocates on demand. It audits the total poi...
LArHVPathologyDbCondAlg(const std::string &name, ISvcLocator *pSvcLocator)
const LArEM_ID * em_idHelper() const
access to EM idHelper
const CaloDetDescrElement * get_element(const Identifier &cellId) const
get element by its identifier
void getHVLineInCell(const Identifier &offId, std::vector< HWIdentifier > &hvlineId) const
Returns a vector<HVLineID> given an input offlineID.
int hv_line(const HWIdentifier id) const
Return the HV line number from an HighVoltage line identifier.
std::map< std::pair< Identifier, unsigned int >, std::vector< unsigned short > > & getElecMap()
void fillElectMap(const CaloDetDescrManager *calodetdescrmgr, LArHVPathology *hvpath, SG::WriteCondHandle< LArHVPathology > &writeHandle) const
int sampling(const Identifier id) const
return sampling according to :
LAr EMB Detector Element.
virtual StatusCode execute(const EventContext &ctx) const override
GeoIntrusivePtr< const EMBCell > EMBCellConstLink
const LArHEC_ID * hec_idHelper() const
access to HEC idHelper
const ServiceHandle< StoreGateSvc > & detStore() const
The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.
LAr HEC Detector Element.
An algorithm that can be simultaneously executed in multiple threads.
A tile of the forward calorimeter readout geometry.
const LArEM_ID * m_larem_id
int hvLineNo(int iGap, const LArHVIdMapping *hvIdMapping) const
const std::vector< Identifier > & channel_ids() const
provide acces to channel id vector, accessed via hash
SG::ReadCondHandleKey< AthenaAttributeList > m_pathologyFolderKey
::StatusCode StatusCode
StatusCode definition for legacy code.
LAr FCAL Detector Element.
int hvLineNo(const LArHVIdMapping *hvIdMapping) const
const LArHVLineID * m_hvlineHelper
int hvLineNo(int iGap, const LArHVIdMapping *hvIdMapping) const
An AttributeList represents a logical row of attributes in a metadata table. The name and type of eac...
Helper class for offline cell identifiers.
virtual StatusCode finalize() override
int hvLineNo(int iGap, const LArHVIdMapping *hvIdMapping) const
int barrel_ec(const Identifier id) const
return barrel_ec according to :
StatusCode initialize(bool used=true)
virtual ~LArHVPathologyDbCondAlg()
This class provides the client interface for accessing the detector description information common to...
#define ATH_MSG_WARNING(x)
Describes one HV Module within the EMEc Presampler.
#define ATLAS_THREAD_SAFE
const LArOnlineID * m_laronline_id
const std::vector< Identifier > & channel_ids() const
provide access to channel id vector, accessed via hash
const std::vector< Identifier > & channel_ids() const
provide access to channel id vector, accessed via hash
Define macros for attributes used to control the static checker.
SG::WriteCondHandleKey< LArHVPathology > m_hvPathologyKey
const LArHEC_ID * m_larhec_id
int hvLineNo(int iGap, const LArHVIdMapping *hvIdMapping) const
Describes one HV Module within the EMB Presampler.
const LArFCAL_ID * fcal_idHelper() const
access to FCAL idHelper
Calo Subsystem specific Detector Elements + Dummy element for testing.
SG::ReadCondHandleKey< LArHVIdMapping > m_hvMappingKey
void addDependency(const EventIDRange &range)