Definition at line 15 of file LArIdHelperStandalone.py.
◆ __init__()
def python.LArIdHelperStandalone.LArIdHelper.__init__ |
( |
|
self | ) |
|
Definition at line 16 of file LArIdHelperStandalone.py.
17 self._msg=logging.getLogger(
"LArIdHelper")
19 from ROOT
import IdDictParser
23 for dd
in os.getenv(
'XMLPATH').
split(os.pathsep):
24 d=dd+
"/IdDictParser/ATLAS_IDS.xml"
25 if os.access(d,os.R_OK):
29 self._msg.
error(
"unable to locate identifier dictionaries in $XMLPATH")
32 parser.register_external_entity(
"LArCalorimeter",xmlpath+
"/IdDictParser/IdDictLArCalorimeter_DC3-05-Comm-01.xml")
33 parser.register_external_entity(
"Calorimeter",xmlpath+
"/IdDictParser/IdDictCalorimeter_L1Onl.xml")
34 parser.register_external_entity(
"TileCalorimeter",xmlpath+
"/IdDictParser/IdDictTileCalorimeter.xml")
37 idd = parser.parse(xmlpath+
"/IdDictParser/ATLAS_IDS.xml")
38 from ROOT
import LArOnlineID
40 stat=self._larOnlHelper.initialize_from_dictionary(idd)
42 self._msg.
error(
"failed to init LArOnlineID")
46 from ROOT
import LArEM_ID, LArHEC_ID, LArFCAL_ID, LArMiniFCAL_ID, TileID
49 for subHelper
in (LArEM_ID, LArHEC_ID, LArFCAL_ID, LArMiniFCAL_ID, TileID):
51 helper.set_do_neighbours(
False)
52 stat=helper.initialize_from_dictionary(idd)
54 self._msg.
error(
"failed to init" +
str(subHelper))
56 self._allHelpers.
append(helper)
58 from ROOT
import CaloCell_ID
◆ caloHelper()
def python.LArIdHelperStandalone.LArIdHelper.caloHelper |
( |
|
self | ) |
|
◆ getCabling()
def python.LArIdHelperStandalone.LArIdHelper.getCabling |
( |
|
self | ) |
|
Definition at line 73 of file LArIdHelperStandalone.py.
74 if self._cabling:
return self._cabling
77 f=lardb.getFolder(
"/LAR/Identifier/OnOffIdMap")
78 ptr=f.findObject(cool.ValidityKeyMax-1,cool.ChannelId(0),
"LARIdentifierOnOffIdMap-RUN2-001")
79 payload=ptr.payload()[
"OnlineHashToOfflineId"]
81 nChans=
int(payload.size()/4)
83 self._cabling=ROOT.LArOnOffIdMapping(self._larOnlHelper,self._caloHelper)
84 onlHash2OflIdVec=self._cabling.getOnlHash2OflId()
85 oflHash2OnlIdVec=self._cabling.getOflHash2OnId()
92 idnum=int.from_bytes(on2off[i:i+4],
'little')
94 oflId=ROOT.Identifier(ROOT.Identifier32(idnum))
96 oflHash=self._caloHelper.calo_cell_hash(oflId)
97 onlHash=ROOT.IdentifierHash(iChan)
98 if oflHash.value()>=oflHash2OnlIdVec.size():
99 self._msg.
error(
"invalid offline hash %i", oflHash.value())
102 if onlHash.value()>=onlHash2OflIdVec.size():
103 self._msg.
error(
"invalid offline hash %i", onlHash.value())
106 onlId=self._larOnlHelper.channel_Id(onlHash)
107 onlHash2OflIdVec[iChan]=oflId
108 oflHash2OnlIdVec[oflHash.value()]=onlId
117 self._msg.
info(
"Found identifier mapping for %i connected channels", nConnected)
◆ larOnlHelper()
def python.LArIdHelperStandalone.LArIdHelper.larOnlHelper |
( |
|
self | ) |
|
◆ _allHelpers
python.LArIdHelperStandalone.LArIdHelper._allHelpers |
|
private |
◆ _cabling
python.LArIdHelperStandalone.LArIdHelper._cabling |
|
private |
◆ _caloHelper
python.LArIdHelperStandalone.LArIdHelper._caloHelper |
|
private |
◆ _larOnlHelper
python.LArIdHelperStandalone.LArIdHelper._larOnlHelper |
|
private |
◆ _msg
python.LArIdHelperStandalone.LArIdHelper._msg |
|
private |
The documentation for this class was generated from the following file: