16 def __init__(self):
17 self._msg=logging.getLogger("LArIdHelper")
18
19 from ROOT import IdDictParser
21
22 xmlpath=None
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):
26 xmlpath=dd
27 break
28 if not xmlpath:
29 self._msg.
error(
"unable to locate identifier dictionaries in $XMLPATH")
30 sys.exit(-1)
31
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")
35
36
37 idd = parser.parse(xmlpath+"/IdDictParser/ATLAS_IDS.xml")
38 from ROOT import LArOnlineID
40 stat=self._larOnlHelper.initialize_from_dictionary(idd)
41 if stat==1:
42 self._msg.
error(
"failed to init LArOnlineID")
43 sys.exit(-1)
44
45
46 from ROOT import LArEM_ID, LArHEC_ID, LArFCAL_ID, LArMiniFCAL_ID, TileID
47
48 self._allHelpers=[]
49 for subHelper in (LArEM_ID, LArHEC_ID, LArFCAL_ID, LArMiniFCAL_ID, TileID):
50 helper=subHelper()
51 helper.set_do_neighbours(False)
52 stat=helper.initialize_from_dictionary(idd)
53 if stat==1:
54 self._msg.
error(
"failed to init" + str(subHelper))
55 else:
56 self._allHelpers.append(helper)
57 pass
58 from ROOT import CaloCell_ID
60 self._caloHelper.initialize_from_dictionary(idd)
61
62
63
64 self._cabling=None
65 return
66
67
Helper class for offline cell identifiers.
std::vector< std::string > split(const std::string &s, const std::string &t=":")