ATLAS Offline Software
FCALChannelMapBuilder.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3 */
4 
6 #include "LArReadoutGeometry/FCAL_ChannelMap.h"
7 
11 
12 #include "StoreGate/StoreGateSvc.h"
13 
15  , IRDBAccessSvc* paramSvc
16  , IMessageSvc* msgSvc)
17 {
18  MsgStream log(msgSvc, "buildFcalChannelMap");
19  FCAL_ChannelMap* cmap = new FCAL_ChannelMap(0);
20 
21  std::vector<IRDBRecordset_ptr> recordsets { paramSvc->getRecordsetPtr("FCalElecMod1","")
22  , paramSvc->getRecordsetPtr("FCalElecMod2","")
23  , paramSvc->getRecordsetPtr("FCalElecMod3","") };
24 
25  for(const IRDBRecordset_ptr& recordset : recordsets) {
26  for(const IRDBRecord_ptr& rec : *recordset) {
27  cmap->add_tube(rec->getString("TILENAME")
28  , rec->getInt("MODNUMBER")
29  , rec->getInt("IDENTIFIER")
30  , rec->getInt("I")
31  , rec->getInt("J")
32  , rec->getDouble("X")
33  , rec->getDouble("Y")
34  , rec->getString("HVFEEDTHROUGHID"));
35  }
36  }
37 
38  cmap->finish();
39 
40  StatusCode sc = detStore->record(cmap,"FCAL_ChannelMap");
41  if(sc.isFailure()) {
42  log << MSG::FATAL << "Failed to build FCAL Channel Map" << endmsg;
43  }
44 
45  return sc;
46 }
python.Constants.FATAL
int FATAL
Definition: Control/AthenaCommon/python/Constants.py:19
IRDBAccessSvc::getRecordsetPtr
virtual IRDBRecordset_ptr getRecordsetPtr(const std::string &node, const std::string &tag, const std::string &tag2node="", const std::string &connName="ATLASDD")=0
Provides access to the Recordset object containing HVS-tagged data.
FCAL_ChannelMap
This class contains the tube and tile maps for the FCAL A tile is of a set of FCAL tubes.
Definition: LArCalorimeter/LArGeoModel/LArReadoutGeometry/LArReadoutGeometry/FCAL_ChannelMap.h:34
FCAL_ChannelMap::add_tube
void add_tube(const std::string &tileName, int mod, int id, int i, int j, double xCm, double yCm)
Definition: LArCalorimeter/LArGeoModel/LArReadoutGeometry/src/FCAL_ChannelMap.cxx:69
FCALChannelMapBuilder.h
Helper function for building FCAL Channel Map.
AthenaPoolTestRead.sc
sc
Definition: AthenaPoolTestRead.py:27
StoreGateSvc
The Athena Transient Store API.
Definition: StoreGateSvc.h:128
IRDBAccessSvc.h
Definition of the abstract IRDBAccessSvc interface.
StdJOSetup.msgSvc
msgSvc
Provide convenience handles for various services.
Definition: StdJOSetup.py:36
IRDBAccessSvc
IRDBAccessSvc is an abstract interface to the athena service that provides the following functionalit...
Definition: IRDBAccessSvc.h:45
endmsg
#define endmsg
Definition: AnalysisConfig_Ntuple.cxx:63
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
LArGeo::buildFcalChannelMap
StatusCode buildFcalChannelMap(StoreGateSvc *detStore, IRDBAccessSvc *paramSvc, IMessageSvc *msgSvc)
Definition: FCALChannelMapBuilder.cxx:14
IRDBRecordset_ptr
std::shared_ptr< IRDBRecordset > IRDBRecordset_ptr
Definition: IRDBAccessSvc.h:25
python.PyKernel.detStore
detStore
Definition: PyKernel.py:41
FCAL_ChannelMap::finish
void finish()
Definition: LArCalorimeter/LArGeoModel/LArReadoutGeometry/src/FCAL_ChannelMap.cxx:55
IRDBRecord.h
Definition of the abstract IRDBRecord interface.
IRDBRecord_ptr
std::unique_ptr< IRDBRecord > IRDBRecord_ptr
Definition: IRDBRecordset.h:23
python.CaloCondTools.log
log
Definition: CaloCondTools.py:20
IRDBRecordset.h
Definition of the abstract IRDBRecordset interface.
StoreGateSvc.h