diff --git a/DetectorDescription/DetDescrCnvSvc/DetDescrCnvSvc/DetDescrCnvSvc.h b/DetectorDescription/DetDescrCnvSvc/DetDescrCnvSvc/DetDescrCnvSvc.h index ad206290e1072d9eb72f8c8b4bd8b2728c8f969b..935ff52d0232648743cb93c646ad9ea0d99011e0 100755 --- a/DetectorDescription/DetDescrCnvSvc/DetDescrCnvSvc/DetDescrCnvSvc.h +++ b/DetectorDescription/DetDescrCnvSvc/DetDescrCnvSvc/DetDescrCnvSvc.h @@ -116,7 +116,9 @@ private: BooleanProperty m_compact_ids_only; BooleanProperty m_do_checks; BooleanProperty m_do_neighbours; - BooleanProperty m_useCSC; + BooleanProperty m_hasCSC; + BooleanProperty m_hasSTgc; + BooleanProperty m_hasMM; }; #endif diff --git a/DetectorDescription/DetDescrCnvSvc/python/DetDescrCnvSvcConfig.py b/DetectorDescription/DetDescrCnvSvc/python/DetDescrCnvSvcConfig.py index 766bc227aaaa37db52d3a3d60f29da70b0bc85b9..180fb79ed88f2bd2929a4a4db3b14832ac188cf8 100644 --- a/DetectorDescription/DetDescrCnvSvc/python/DetDescrCnvSvcConfig.py +++ b/DetectorDescription/DetDescrCnvSvc/python/DetDescrCnvSvcConfig.py @@ -2,12 +2,19 @@ from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator +from AtlasGeoModel.CommonGMJobProperties import CommonGeometryFlags +from AtlasGeoModel.MuonGMJobProperties import MuonGeometryFlags + def DetDescrCnvSvcCfg(configFlags=None): from DetDescrCnvSvc.DetDescrCnvSvcConf import DetDescrCnvSvc from GaudiSvc.GaudiSvcConf import EvtPersistencySvc acc=ComponentAccumulator() # Specify primary Identifier dictionary to be use - detDescrCnvSvc=DetDescrCnvSvc(IdDictName = "IdDictParser/ATLAS_IDS.xml",IdDictFromRDB = True) + detDescrCnvSvc=DetDescrCnvSvc(IdDictName = "IdDictParser/ATLAS_IDS.xml", + IdDictFromRDB = True, + HasCSC=MuonGeometryFlags.hasCSC(), + HasSTgc=(CommonGeometryFlags.Run() in ["RUN3", "RUN4"]), + HasMM=(CommonGeometryFlags.Run() in ["RUN3", "RUN4"])) acc.addService(detDescrCnvSvc) acc.addService(EvtPersistencySvc("EventPersistencySvc",CnvServices=[detDescrCnvSvc.getName(),])) #No service handle yet??? return acc diff --git a/DetectorDescription/DetDescrCnvSvc/python/DetStoreConfig.py b/DetectorDescription/DetDescrCnvSvc/python/DetStoreConfig.py index bd28efe427e00b512c96fa5149459594d1be8461..9125a9d7a203c322ad5645c63642cc7d67b49092 100755 --- a/DetectorDescription/DetDescrCnvSvc/python/DetStoreConfig.py +++ b/DetectorDescription/DetDescrCnvSvc/python/DetStoreConfig.py @@ -15,9 +15,15 @@ def _setupDetStoreConfig(): # now configure the Detector Description converter service from DetDescrCnvSvc.DetDescrCnvSvcConf import DetDescrCnvSvc + from AtlasGeoModel.CommonGMJobProperties import CommonGeometryFlags + from AtlasGeoModel.MuonGMJobProperties import MuonGeometryFlags # Create DetDescrCnvSvc and add to SvcMgr # Specify primary Identifier dictionary to be used - svcMgr += DetDescrCnvSvc(IdDictName = "IdDictParser/ATLAS_IDS.xml") + # and whether CSC/sTgc/MM muon chambers are part of the detector + svcMgr += DetDescrCnvSvc(IdDictName = "IdDictParser/ATLAS_IDS.xml", + HasCSC=MuonGeometryFlags.hasCSC(), + HasSTgc=(CommonGeometryFlags.Run() in ["RUN3", "RUN4"]), + HasMM=(CommonGeometryFlags.Run() in ["RUN3", "RUN4"])) #theApp.CreateSvc += [ svcMgr.DetDescrCnvSvc.getFullName() ] svcMgr.EventPersistencySvc.CnvServices += [ "DetDescrCnvSvc" ] diff --git a/DetectorDescription/DetDescrCnvSvc/share/DetStore.py b/DetectorDescription/DetDescrCnvSvc/share/DetStore.py index f232011fb67cf4c938a4b406d74a18089366d4c8..ed0a1eea70a81a1e636e7f596e4b56117d96731a 100755 --- a/DetectorDescription/DetDescrCnvSvc/share/DetStore.py +++ b/DetectorDescription/DetDescrCnvSvc/share/DetStore.py @@ -23,3 +23,9 @@ EventPersistencySvc.CnvServices = [ "DetDescrCnvSvc" ] # Specify primary Identifier dictionary to be used DetDescrCnvSvc.IdDictName = "IdDictParser/ATLAS_IDS.xml"; +# Specify whether CSC/sTgc/MM muon chambers are part of the detector +from AtlasGeoModel.CommonGMJobProperties import CommonGeometryFlags +from AtlasGeoModel.MuonGMJobProperties import MuonGeometryFlags +DetDescrCnvSvc.HasCSC = MuonGeometryFlags.hasCSC() +DetDescrCnvSvc.HasSTgc = (CommonGeometryFlags.Run() in ["RUN3", "RUN4"]) +DetDescrCnvSvc.HasMM = (CommonGeometryFlags.Run() in ["RUN3", "RUN4"]) diff --git a/DetectorDescription/DetDescrCnvSvc/share/DetStore_joboptions.py b/DetectorDescription/DetDescrCnvSvc/share/DetStore_joboptions.py index d4955980d316cc7e89af8419f41dce7fcf21e0a9..271a604577583e6092e343ecb4521261a83b1f5a 100755 --- a/DetectorDescription/DetDescrCnvSvc/share/DetStore_joboptions.py +++ b/DetectorDescription/DetDescrCnvSvc/share/DetStore_joboptions.py @@ -17,6 +17,13 @@ EventPersistencySvc.CnvServices += [ "DetDescrCnvSvc" ] DetDescrCnvSvc = Service( "DetDescrCnvSvc" ) DetDescrCnvSvc.IdDictName = "IdDictParser/ATLAS_IDS.xml" +# Specify whether CSC/sTgc/MM muon chambers are part of the detector +from AtlasGeoModel.CommonGMJobProperties import CommonGeometryFlags +from AtlasGeoModel.MuonGMJobProperties import MuonGeometryFlags +DetDescrCnvSvc.HasCSC = MuonGeometryFlags.hasCSC() +DetDescrCnvSvc.HasSTgc = (CommonGeometryFlags.Run() in ["RUN3", "RUN4"]) +DetDescrCnvSvc.HasMM = (CommonGeometryFlags.Run() in ["RUN3", "RUN4"]) + # Specify the tag to be used # DetDescrCnvSvc.IdDictGlobalTag = "initial_layout" diff --git a/DetectorDescription/DetDescrCnvSvc/src/DetDescrCnvSvc.cxx b/DetectorDescription/DetDescrCnvSvc/src/DetDescrCnvSvc.cxx index 19b79de296d464155908f4b4eabb8c63c5a64fc5..0a205148ef409fb4e4a73257062674f630efd45e 100755 --- a/DetectorDescription/DetDescrCnvSvc/src/DetDescrCnvSvc.cxx +++ b/DetectorDescription/DetDescrCnvSvc/src/DetDescrCnvSvc.cxx @@ -37,7 +37,9 @@ DetDescrCnvSvc::DetDescrCnvSvc(const std::string& name, ISvcLocator* svc) m_compact_ids_only(false), m_do_checks(false), m_do_neighbours(true), - m_useCSC(true) + m_hasCSC(true), + m_hasSTgc(true), + m_hasMM(true) { declareProperty("DetectorManagers", m_detMgrs); declareProperty("DetectorNodes", m_detNodes ); @@ -51,7 +53,9 @@ DetDescrCnvSvc::DetDescrCnvSvc(const std::string& name, ISvcLocator* svc) declareProperty("CompactIDsOnly", m_compact_ids_only); declareProperty("DoIdChecks", m_do_checks); declareProperty("DoInitNeighbours", m_do_neighbours); - declareProperty("UseCSC", m_useCSC); + declareProperty("HasCSC", m_hasCSC); + declareProperty("HasSTgc", m_hasSTgc); + declareProperty("HasMM", m_hasMM); declareProperty("AtlasIDFileName", m_idDictATLASName); declareProperty("InDetIDFileName", m_idDictInDetName); @@ -197,7 +201,7 @@ DetDescrCnvSvc::initialize() { if (status != StatusCode::SUCCESS) return status; status = addToDetStore(4170, "MDTIDHELPER"); if (status != StatusCode::SUCCESS) return status; - if (m_useCSC) { + if (m_hasCSC) { status = addToDetStore(4171, "CSCIDHELPER"); if (status != StatusCode::SUCCESS) return status; } @@ -205,11 +209,14 @@ DetDescrCnvSvc::initialize() { if (status != StatusCode::SUCCESS) return status; status = addToDetStore(4173, "TGCIDHELPER"); if (status != StatusCode::SUCCESS) return status; - // for nSW - status = addToDetStore(4174, "STGCIDHELPER"); - if (status != StatusCode::SUCCESS) return status; - status = addToDetStore(4175, "MMIDHELPER"); - if (status != StatusCode::SUCCESS) return status; + if (m_hasSTgc) { + status = addToDetStore(4174, "STGCIDHELPER"); + if (status != StatusCode::SUCCESS) return status; + } + if (m_hasMM) { + status = addToDetStore(4175, "MMIDHELPER"); + if (status != StatusCode::SUCCESS) return status; + } status = addToDetStore(108133391, "CaloLVL1_ID"); if (status != StatusCode::SUCCESS) return status; status = addToDetStore(123500438, "CaloCell_ID"); diff --git a/DetectorDescription/GeoModel/AtlasGeoModel/python/MuonGM.py b/DetectorDescription/GeoModel/AtlasGeoModel/python/MuonGM.py index 56d170421cfc5f2dc966ae4b7103a7b637a55f83..f0c58ddd7e30a27c42919bb3f866d43299c98f97 100755 --- a/DetectorDescription/GeoModel/AtlasGeoModel/python/MuonGM.py +++ b/DetectorDescription/GeoModel/AtlasGeoModel/python/MuonGM.py @@ -2,6 +2,8 @@ from AthenaCommon.JobProperties import jobproperties from AthenaCommon.DetFlags import DetFlags +from AtlasGeoModel.CommonGMJobProperties import CommonGeometryFlags +from AtlasGeoModel.MuonGMJobProperties import MuonGeometryFlags if ( jobproperties.Global.DetGeo() == "ctbh8" or jobproperties.Global.DetGeo() == "ctbh6" ): print " CTB layout for Muon Spectrometer is not supported anymore" @@ -11,7 +13,9 @@ elif ( DetFlags.detdescr.Muon_on() ): GeoModelSvc = GeoModelSvc() from MuonGeoModel.MuonGeoModelConf import MuonDetectorTool - GeoModelSvc.DetectorTools += [ MuonDetectorTool() ] + GeoModelSvc.DetectorTools += [ MuonDetectorTool(HasCSC=MuonGeometryFlags.hasCSC(), + HasSTgc=(CommonGeometryFlags.Run() in ["RUN3", "RUN4"]), + HasMM=(CommonGeometryFlags.Run() in ["RUN3", "RUN4"])) ] import os GeoModelSvc.DetectorTools[ "MuonDetectorTool" ].BuildFromNova = 0 if ( ( not DetFlags.simulate.any_on() or DetFlags.overlay.any_on() ) and "AthSimulation_DIR" not in os.environ ): diff --git a/DetectorDescription/GeoModel/AtlasGeoModel/python/MuonGMJobProperties.py b/DetectorDescription/GeoModel/AtlasGeoModel/python/MuonGMJobProperties.py new file mode 100755 index 0000000000000000000000000000000000000000..2ca7e13f32b814ee63b968c794f6c1ab0f57dfb3 --- /dev/null +++ b/DetectorDescription/GeoModel/AtlasGeoModel/python/MuonGMJobProperties.py @@ -0,0 +1,72 @@ +# Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration + +from AthenaCommon.JobProperties import JobProperty, JobPropertyContainer, jobproperties +from AtlasGeoModel.CommonGMJobProperties import CommonGMFlags, CommonGeometryFlags + +# ------------------------------------------------------------------------------------- +# Muon geometry flags initialization +# ------------------------------------------------------------------------------------- +class MuonGMFlags(CommonGMFlags, object): + + def __init__(self, geoTag="none"): + super(MuonGMFlags, self).__init__() + + def InitializeGeometryParameters(self): + dbId,dbSwitches,dbParam = self.dbGeomCursor.GetCurrentLeafContent("MuonSwitches") + _layoutName=None + _hasCsc=True + if len(dbId)>0: + key=dbId[0] + if "LAYOUTNAME" in dbParam: _layoutName = dbSwitches[key][dbParam.index("LAYOUTNAME")] + if "HASCSC" in dbParam: _hasCsc = dbSwitches[key][dbParam.index("HASCSC")] + + self.__dict__["Layout"] = (_layoutName if _layoutName else "UNDEFINED") + if _hasCsc == 0: self.__dict__["HasCSC"] = False + else: self.__dict__["HasCSC"] = True + + def dump(self): + print "MuonGMFlags:" + print "Layout = ",self.__dict__["Layout"] + print "HasCSC = ",self.__dict__["HasCSC"] + + +class GeoLayout(JobProperty): + """ geometry layout """ + statusOn = True + allowedTypes = ['str'] + StoredValue = 'UNDEFINED' + +class hasCSC(JobProperty): + """ does the layout contain CSC chambers? """ + statusOn = True + allowedTypes = ['bool'] + StoredValue = True + + +class MuonGeometryFlags_JobProperties(JobPropertyContainer): + """ The geometry flag/job property container """ + + def __init__(self, context=""): + JobPropertyContainer.__init__(self,context) + return + def setupValuesFromDB(self,geoTagName="none"): + MuonGeoFlags = MuonGMFlags(geoTagName) + self.GeoLayout.set_Value_and_Lock(MuonGeoFlags.getValue("Layout")) + self.hasCSC.set_Value_and_Lock(MuonGeoFlags.getValue("HasCSC")) + + def reset(self,geoTagName="none"): + self.GeoLayout.unlock() + self.hasCSC.unlock() + + def dump(self): + print "Layout = ", self.GeoLayout() + print "HasCSC = ", self.hasCSC() + + +jobproperties.add_Container(MuonGeometryFlags_JobProperties) +jobproperties.MuonGeometryFlags_JobProperties.add_JobProperty(GeoLayout) +jobproperties.MuonGeometryFlags_JobProperties.add_JobProperty(hasCSC) + +MuonGeometryFlags = jobproperties.MuonGeometryFlags_JobProperties +MuonGeometryFlags.setupValuesFromDB() + diff --git a/DetectorDescription/IdDictParser/data/IdDictMuonSpectrometer_R.09.AsymNSW.xml b/DetectorDescription/IdDictParser/data/IdDictMuonSpectrometer_R.09.AsymNSW.xml index b5137581a9269927a3a9c14c6283c5cedc7a6238..eaec7ae0625e8300405d3177dd02452a121bbecb 100755 --- a/DetectorDescription/IdDictParser/data/IdDictMuonSpectrometer_R.09.AsymNSW.xml +++ b/DetectorDescription/IdDictParser/data/IdDictMuonSpectrometer_R.09.AsymNSW.xml @@ -1472,7 +1472,7 @@ <range field="stationEta" values="-1" /> <range field="stationPhi" minvalue="1" maxvalue="8" /> <range field="technology" value="CSC" /> - <range field="chamberLayer" minvalue="1" maxvalue="2" /> + <range field="chamberLayer" minvalue="2" maxvalue="2" /> <range field="wireLayer" minvalue="1" maxvalue="4" /> <range field="cscMeasuresPhi" value="0" /> <range field="cscStrip" minvalue="1" maxvalue="192" /> @@ -1483,7 +1483,7 @@ <range field="stationEta" values="-1" /> <range field="stationPhi" minvalue="1" maxvalue="8" /> <range field="technology" value="CSC" /> - <range field="chamberLayer" minvalue="1" maxvalue="2" /> + <range field="chamberLayer" minvalue="2" maxvalue="2" /> <range field="wireLayer" minvalue="1" maxvalue="4" /> <range field="cscMeasuresPhi" value="1" /> <range field="cscStrip" minvalue="1" maxvalue="48" /> @@ -1494,7 +1494,7 @@ <range field="stationEta" values="-1" /> <range field="stationPhi" minvalue="1" maxvalue="8" /> <range field="technology" value="CSC" /> - <range field="chamberLayer" minvalue="1" maxvalue="2" /> + <range field="chamberLayer" minvalue="2" maxvalue="2" /> <range field="wireLayer" minvalue="1" maxvalue="4" /> <range field="cscMeasuresPhi" value="0" /> <range field="cscStrip" minvalue="1" maxvalue="192" /> @@ -1505,7 +1505,7 @@ <range field="stationEta" values="-1" /> <range field="stationPhi" minvalue="1" maxvalue="8" /> <range field="technology" value="CSC" /> - <range field="chamberLayer" minvalue="1" maxvalue="2" /> + <range field="chamberLayer" minvalue="2" maxvalue="2" /> <range field="wireLayer" minvalue="1" maxvalue="4" /> <range field="cscMeasuresPhi" value="1" /> <range field="cscStrip" minvalue="1" maxvalue="48" /> diff --git a/DetectorDescription/RegionSelector/python/RegSelConfig.py b/DetectorDescription/RegionSelector/python/RegSelConfig.py index ae3d1e19701836f71696066588c24b8a24975c8e..91c00c2ef984d0a8735547fe8cf3a1745244d942 100644 --- a/DetectorDescription/RegionSelector/python/RegSelConfig.py +++ b/DetectorDescription/RegionSelector/python/RegSelConfig.py @@ -64,38 +64,43 @@ def regSelCfg( flags ): PrintHashId = True, PrintTable = False) - if flags.Detector.GeometryRPC: + # by default, all 'enableX' flags of RegSelSvc are set to True, so turn them off if not needed + if not flags.Detector.GeometryRPC: + regSel.enableRPC = False + else: regSel.enableMuon = True - regSel.enableRPC = True from MuonRegionSelector.MuonRegionSelectorConf import RPC_RegionSelectorTable regSel.RPCRegionSelectorTable = RPC_RegionSelectorTable(name = "RPC_RegionSelectorTable") - if flags.Detector.GeometryMDT: + if not flags.Detector.GeometryMDT: + regSel.enableMDT = False + else: regSel.enableMuon = True - regSel.enableMDT = True from MuonRegionSelector.MuonRegionSelectorConf import MDT_RegionSelectorTable regSel.MDTRegionSelectorTable = MDT_RegionSelectorTable(name = "MDT_RegionSelectorTable") - if flags.Detector.GeometryTGC: + if not flags.Detector.GeometryTGC: + regSel.enableTGC = False + else: regSel.enableMuon = True - regSel.enableTGC = True from MuonRegionSelector.MuonRegionSelectorConf import TGC_RegionSelectorTable regSel.TGCRegionSelectorTable = TGC_RegionSelectorTable(name = "TGC_RegionSelectorTable") - if flags.Detector.GeometryCSC: + if not flags.Detector.GeometryCSC: + regSel.enableCSC = False + else: regSel.enableMuon = True - regSel.enableCSC = True from MuonRegionSelector.MuonRegionSelectorConf import CSC_RegionSelectorTable regSel.CSCRegionSelectorTable = CSC_RegionSelectorTable(name = "CSC_RegionSelectorTable") + if not flags.Detector.GeometryMM: + regSel.enableMM = False - if flags.Detector.GeometryMM: - regSel.enableMM = True + if not flags.Detector.GeometrysTGC: + regSel.enablesTGC = False acc.addService( regSel ) - - return acc if __name__ == "__main__": @@ -107,15 +112,24 @@ if __name__ == "__main__": from AthenaConfiguration.TestDefaults import defaultTestFiles from AthenaCommon.Constants import DEBUG - ConfigFlags.Detector.GeometryPixel = True - ConfigFlags.Detector.GeometrySCT = True - ConfigFlags.Detector.GeometryTRT = True - ConfigFlags.Detector.GeometryLAr = True - ConfigFlags.Detector.GeometryTile = True - ConfigFlags.Detector.GeometryMDT = True + from AtlasGeoModel.CommonGMJobProperties import CommonGeometryFlags + from AtlasGeoModel.MuonGMJobProperties import MuonGeometryFlags + + ConfigFlags.Detector.GeometryPixel = True + ConfigFlags.Detector.GeometrySCT = True + ConfigFlags.Detector.GeometryTRT = True + ConfigFlags.Detector.GeometryLAr = True + ConfigFlags.Detector.GeometryTile = True + ConfigFlags.Detector.GeometryMDT = True ConfigFlags.Detector.GeometryTGC = True - ConfigFlags.Detector.GeometryCSC = True - ConfigFlags.Detector.GeometryRPC = True + ConfigFlags.Detector.GeometryRPC = True + ConfigFlags.Detector.GeometryCSC = True + if not MuonGeometryFlags.hasCSC(): ConfigFlags.Detector.GeometryCSC = False + ConfigFlags.Detector.GeometryMM = True + ConfigFlags.Detector.GeometrysTGC = True + if not (CommonGeometryFlags.Run() in ["RUN3", "RUN4"]): + ConfigFlags.Detector.GeometryMM = False + ConfigFlags.Detector.GeometrysTGC = False ConfigFlags.Input.Files = defaultTestFiles.RAW ConfigFlags.Input.isMC = False diff --git a/DetectorDescription/RegionSelector/python/RegSelSvcDefault.py b/DetectorDescription/RegionSelector/python/RegSelSvcDefault.py index 195b697ea499575f02283a467616148e53e0527e..f8121be32d05071e62fac9a12fbc608d074e53ac 100755 --- a/DetectorDescription/RegionSelector/python/RegSelSvcDefault.py +++ b/DetectorDescription/RegionSelector/python/RegSelSvcDefault.py @@ -8,6 +8,9 @@ from AthenaCommon.SystemOfUnits import * # loads MeV etc... # import the base class from RegionSelector.RegionSelectorConf import RegSelSvc +from AtlasGeoModel.CommonGMJobProperties import CommonGeometryFlags +from AtlasGeoModel.MuonGMJobProperties import MuonGeometryFlags + class RegSelSvcDefault ( RegSelSvc ) : def __init__(self, name="RegSelSvcDefault"): @@ -106,17 +109,17 @@ class RegSelSvcDefault ( RegSelSvc ) : tgcTable = TGC_RegionSelectorTable(name = "TGC_RegionSelectorTable") mlog.debug(tgcTable) - if DetFlags.detdescr.CSC_on(): + if MuonGeometryFlags.hasCSC() and DetFlags.detdescr.CSC_on(): from MuonRegionSelector.MuonRegionSelectorConf import CSC_RegionSelectorTable cscTable = CSC_RegionSelectorTable(name = "CSC_RegionSelectorTable") mlog.debug(cscTable) - if DetFlags.detdescr.Micromegas_on(): + if (CommonGeometryFlags.Run() in ["RUN3", "RUN4"]) and DetFlags.detdescr.Micromegas_on(): from MuonRegionSelector.MuonRegionSelectorConf import MM_RegionSelectorTable mmTable = MM_RegionSelectorTable(name = "MM_RegionSelectorTable") mlog.debug(mmTable) - if DetFlags.detdescr.sTGC_on(): + if (CommonGeometryFlags.Run() in ["RUN3", "RUN4"]) and DetFlags.detdescr.sTGC_on(): from MuonRegionSelector.MuonRegionSelectorConf import sTGC_RegionSelectorTable stgcTable = sTGC_RegionSelectorTable(name = "sTGC_RegionSelectorTable") mlog.debug(stgcTable) @@ -194,15 +197,15 @@ class RegSelSvcDefault ( RegSelSvc ) : self.enableTGC = True else: self.enableTGC = False - if DetFlags.detdescr.CSC_on(): + if MuonGeometryFlags.hasCSC() and DetFlags.detdescr.CSC_on(): self.enableCSC = True else: self.enableCSC = False - if DetFlags.detdescr.sTGC_on(): + if (CommonGeometryFlags.Run() in ["RUN3", "RUN4"]) and DetFlags.detdescr.sTGC_on(): self.enablesTGC = True else: self.enablesTGC = False - if DetFlags.detdescr.Micromegas_on(): + if (CommonGeometryFlags.Run() in ["RUN3", "RUN4"]) and DetFlags.detdescr.Micromegas_on(): self.enableMM = True else: self.enableMM = False diff --git a/MuonSpectrometer/Amdcsimrec/AmdcAth/share/AmdcAth_GeometryTasks.py b/MuonSpectrometer/Amdcsimrec/AmdcAth/share/AmdcAth_GeometryTasks.py index b8011bbeab2edcfa69a0f1fa3162dc412365da6c..6ecbaeb484a2792fae15ee9c5dbbbdf71b2a3110 100644 --- a/MuonSpectrometer/Amdcsimrec/AmdcAth/share/AmdcAth_GeometryTasks.py +++ b/MuonSpectrometer/Amdcsimrec/AmdcAth/share/AmdcAth_GeometryTasks.py @@ -59,6 +59,18 @@ if DoNSWDBlob : # GeoModel is needed to make a test build of the volumes - in case of bugs it crashes database_layout="" include("MuonGeoModel/MuonGeoModel_MinimalSetup.py") + # after the above include, GeoModelSvc should be setup, now use a recent layout to start from + GeoModelSvc.AtlasVersion='ATLAS-R3S-2021-01-00-00' + # since we have chosen a symmetric NSW layout and we execute this jobOptions file outside of a + # standard job transform, set the MuonDetectorTool and DetDescrCnvSvc properties by hand + GeoModelSvc.DetectorTools[ "MuonDetectorTool" ].HasCSC = False + GeoModelSvc.DetectorTools[ "MuonDetectorTool" ].HasSTgc = True + GeoModelSvc.DetectorTools[ "MuonDetectorTool" ].HasMM = True + if hasattr(svcMgr,'DetDescrCnvSvc'): + svcMgr.DetDescrCnvSvc.HasCSC=False + svcMgr.DetDescrCnvSvc.HasSTgc=True + svcMgr.DetDescrCnvSvc.HasMM=True + # include writing settings for MuonAGDD include("MuonAGDD/NSWAGDD_BlobProduction.py") @@ -78,5 +90,17 @@ if CheckAGDDBlob : if CheckNSWDBlob : # to get the AGDD blob from a dedicated layout (needs database_layout to be defined) include("MuonGeoModel/MuonGeoModel_MinimalSetup.py") + # after the above include, GeoModelSvc should be setup, now use a recent layout to start from + GeoModelSvc.AtlasVersion='ATLAS-R3S-2021-01-00-00' + # since we have chosen a symmetric NSW layout and we execute this jobOptions file outside of a + # standard job transform, set the MuonDetectorTool and DetDescrCnvSvc properties by hand + GeoModelSvc.DetectorTools[ "MuonDetectorTool" ].HasCSC = False + GeoModelSvc.DetectorTools[ "MuonDetectorTool" ].HasSTgc = True + GeoModelSvc.DetectorTools[ "MuonDetectorTool" ].HasMM = True + if hasattr(svcMgr,'DetDescrCnvSvc'): + svcMgr.DetDescrCnvSvc.HasCSC=False + svcMgr.DetDescrCnvSvc.HasSTgc=True + svcMgr.DetDescrCnvSvc.HasMM=True + # include checking settings for NSWAGDD include("MuonAGDD/NSWAGDD_BlobCheck.py") diff --git a/MuonSpectrometer/MuonCnv/MuonByteStreamCnvTest/python/MuonByteStreamCnvTestConfigDb.py b/MuonSpectrometer/MuonCnv/MuonByteStreamCnvTest/python/MuonByteStreamCnvTestConfigDb.py index 3ef199eef9065e9352c839c4fa97d19f852c3194..fbe52aa38e9fbdeb570a52c7fe2ef3f86d43a0e3 100644 --- a/MuonSpectrometer/MuonCnv/MuonByteStreamCnvTest/python/MuonByteStreamCnvTestConfigDb.py +++ b/MuonSpectrometer/MuonCnv/MuonByteStreamCnvTest/python/MuonByteStreamCnvTestConfigDb.py @@ -13,9 +13,11 @@ addAlgorithm("MuonByteStreamCnvTest.MuonByteStreamCnvTestConfig.getRpcDigitToRpc addAlgorithm("MuonByteStreamCnvTest.MuonByteStreamCnvTestConfig.getTgcDigitToTgcRDO" , "TgcDigitToTgcRDO") addAlgorithm("MuonByteStreamCnvTest.MuonByteStreamCnvTestConfig.getSTGC_DigitToRDO" , "STGC_DigitToRDO") addAlgorithm("MuonByteStreamCnvTest.MuonByteStreamCnvTestConfig.getMM_DigitToRDO" , "MM_DigitToRDO") + addAlgorithm("MuonByteStreamCnvTest.MuonByteStreamCnvTestConfig.getSigMdtDigitToMdtRDO" , "SigMdtDigitToMdtRDO") addAlgorithm("MuonByteStreamCnvTest.MuonByteStreamCnvTestConfig.getSigRpcDigitToRpcRDO" , "SigRpcDigitToRpcRDO") addAlgorithm("MuonByteStreamCnvTest.MuonByteStreamCnvTestConfig.getSigTgcDigitToTgcRDO" , "SigTgcDigitToTgcRDO") + addAlgorithm("MuonByteStreamCnvTest.MuonByteStreamCnvTestConfig.getOverlayCscDigitToCscRDO" , "OverlayCscDigitToCscRDO") addAlgorithm("MuonByteStreamCnvTest.MuonByteStreamCnvTestConfig.getOverlayMdtDigitToMdtRDO" , "OverlayMdtDigitToMdtRDO") addAlgorithm("MuonByteStreamCnvTest.MuonByteStreamCnvTestConfig.getOverlayRpcDigitToRpcRDO" , "OverlayRpcDigitToRpcRDO") diff --git a/MuonSpectrometer/MuonCnv/MuonByteStreamCnvTest/share/jobOptions_MuonRDOToDigit.py b/MuonSpectrometer/MuonCnv/MuonByteStreamCnvTest/share/jobOptions_MuonRDOToDigit.py index df5c8403394dee84d037d51a6da832d7a9c85728..d41e97860fd3ff3af0cc961fd13017b84cb26577 100644 --- a/MuonSpectrometer/MuonCnv/MuonByteStreamCnvTest/share/jobOptions_MuonRDOToDigit.py +++ b/MuonSpectrometer/MuonCnv/MuonByteStreamCnvTest/share/jobOptions_MuonRDOToDigit.py @@ -2,6 +2,9 @@ include.block ("MuonByteStreamCnvTest/jobOptions_MuonRDOToDigit.py") from AthenaCommon.CfgGetter import getPublicTool +from AtlasGeoModel.CommonGMJobProperties import CommonGeometryFlags +from AtlasGeoModel.MuonGMJobProperties import MuonGeometryFlags + ## configure the tool from MuonByteStreamCnvTest.MuonByteStreamCnvTestConf import MuonRdoToMuonDigitTool @@ -9,11 +12,15 @@ MuonRdoToMuonDigitTool = MuonRdoToMuonDigitTool ( DecodeMdtRDO = True, DecodeRpcRDO = True, DecodeTgcRDO = True, - DecodeCscRDO = True, - DecodeSTGC_RDO = False, - DecodeMM_RDO = False ) + DecodeCscRDO = MuonGeometryFlags.hasCSC(), + DecodeSTGC_RDO = (CommonGeometryFlags.Run() in ["RUN3", "RUN4"]), + DecodeMM_RDO = (CommonGeometryFlags.Run() in ["RUN3", "RUN4"]), + cscRdoDecoderTool=("Muon::CscRDO_Decoder" if MuonGeometryFlags.hasCSC() else ""), + stgcRdoDecoderTool=("Muon::STGC_RDO_Decoder" if (CommonGeometryFlags.Run() in ["RUN3", "RUN4"]) else ""), + mmRdoDecoderTool=("Muon::MM_RDO_Decoder" if (CommonGeometryFlags.Run() in ["RUN3", "RUN4"]) else "") + ) -MuonRdoToMuonDigitTool.cscCalibTool = getPublicTool("CscCalibTool") +if MuonGeometryFlags.hasCSC(): MuonRdoToMuonDigitTool.cscCalibTool = getPublicTool("CscCalibTool") ToolSvc += MuonRdoToMuonDigitTool diff --git a/MuonSpectrometer/MuonCnv/MuonByteStreamCnvTest/src/MuonRdoToMuonDigitTool.cxx b/MuonSpectrometer/MuonCnv/MuonByteStreamCnvTest/src/MuonRdoToMuonDigitTool.cxx index e8189038d8a6d287fc1d66f04a3bd7f769d04306..b3248960c9ca20f5212d564e050b21b60fed67bc 100644 --- a/MuonSpectrometer/MuonCnv/MuonByteStreamCnvTest/src/MuonRdoToMuonDigitTool.cxx +++ b/MuonSpectrometer/MuonCnv/MuonByteStreamCnvTest/src/MuonRdoToMuonDigitTool.cxx @@ -103,11 +103,8 @@ MuonRdoToMuonDigitTool::MuonRdoToMuonDigitTool(const std::string& type,const std declareProperty("DecodeCscRDO", m_decodeCscRDO = true); declareProperty("DecodeRpcRDO", m_decodeRpcRDO = true); declareProperty("DecodeTgcRDO", m_decodeTgcRDO = true); - // Keep the NSW decoders off as they will cause issues with tests - // or are simply not needed in 21.3 currently - // Alexandre.laurier@cern.ch - August 2019 - declareProperty("DecodeSTGC_RDO", m_decodesTgcRDO = false); - declareProperty("DecodeMM_RDO", m_decodeMmRDO = false); + declareProperty("DecodeSTGC_RDO", m_decodesTgcRDO = true); + declareProperty("DecodeMM_RDO", m_decodeMmRDO = true); declareProperty("cscCalibTool", m_cscCalibTool); declareProperty("mdtRdoDecoderTool", m_mdtRdoDecoderTool); @@ -130,6 +127,10 @@ StatusCode MuonRdoToMuonDigitTool::initialize() { ATH_CHECK( m_acSvc.retrieve() ); ATH_CHECK( m_muonIdHelperTool.retrieve() ); + if (m_decodeCscRDO && !m_muonIdHelperTool->hasCSC()) m_decodeCscRDO = false; + if (m_decodesTgcRDO && !m_muonIdHelperTool->hasSTgc()) m_decodesTgcRDO = false; + if (m_decodeMmRDO && !m_muonIdHelperTool->hasMM()) m_decodeMmRDO = false; + // get RPC cablingSvc ServiceHandle<IRPCcablingServerSvc> RpcCabGet ("RPCcablingServerSvc", name()); ATH_CHECK( RpcCabGet.retrieve() ); @@ -138,7 +139,6 @@ StatusCode MuonRdoToMuonDigitTool::initialize() { /** CSC calibratin tool for the Condtiions Data base access */ ATH_CHECK( m_cscCalibTool.retrieve() ); - ATH_CHECK(m_mdtRdoKey.initialize(m_decodeMdtRDO)); ATH_CHECK(m_mdtDigitKey.initialize(m_decodeMdtRDO)); ATH_CHECK(m_cscRdoKey.initialize(m_decodeCscRDO)); @@ -152,7 +152,6 @@ StatusCode MuonRdoToMuonDigitTool::initialize() { ATH_CHECK(m_mmRdoKey.initialize(m_decodeMmRDO)); ATH_CHECK(m_mmDigitKey.initialize(m_decodeMmRDO)); - if (m_decodeMdtRDO) ATH_CHECK( m_mdtRdoDecoderTool.retrieve() ); if (m_decodeCscRDO) ATH_CHECK( m_cscRdoDecoderTool.retrieve() ); if (m_decodeRpcRDO) ATH_CHECK( m_rpcRdoDecoderTool.retrieve() ); diff --git a/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondSvc/src/CscCoolStrSvc.cxx b/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondSvc/src/CscCoolStrSvc.cxx index 56f83e201a3315de48e1b58a0a50032b1344556e..92c2d5eda4867d8da31652e49e800c3fcaf90c85 100755 --- a/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondSvc/src/CscCoolStrSvc.cxx +++ b/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondSvc/src/CscCoolStrSvc.cxx @@ -14,6 +14,7 @@ #include <sstream> #include <vector> +#include <TString.h> // for Form #include <algorithm>//for transform #include <cctype> //for toupper #include <inttypes.h> @@ -77,8 +78,8 @@ namespace MuonCalib { declareProperty("DoMerge", m_doMerge = true); declareProperty("DoCaching", m_doCaching = true); declareProperty("OnlineOfflineConvertPhiFlip", m_onlineOfflinePhiFlip = true); - declareProperty("PhiSwapVersion1Strings", m_phiSwapVersion1Strings = true); - + declareProperty("ReadPSlopeFromDatabase", m_pslopeFromDB = false); + declareProperty("PSlope", m_pslope = m_DEFAULT_PSLOPE); } //------------------------------------------------------------------- @@ -239,48 +240,6 @@ namespace MuonCalib { // Loop over csc detector elements and add in the hash ids std::vector<Identifier> modules = m_cscId->idVector(); - //typedef std::vector<Identifier>::const_iterator csc_id; - - /* - print out all strip hashes - csc_id firstId = modules.begin(); - csc_id lastId = modules.end(); - - IdentifierHash moduleHashId; - IdentifierHash channelHashId; - - for(; firstId != lastId; ++firstId) { - Identifier id = *firstId; - if (m_cscId->validElement(id)) { - if(!m_cscId->get_hash(id, moduleHashId, &m_moduleContext)) { - std::cout << "The CSC Chamber hash id is " << moduleHashId - << " for " << m_cscId->show_to_string(id,&m_moduleContext) << std::endl; - std::cout << "*****The strips in this Chamber ********************" << std::endl; - std::vector<Identifier> vect; - m_cscId->idChannels(id, vect); - for (unsigned int i=0; i<vect.size(); ++i) { - if(!m_cscId->get_hash(vect[i], channelHashId, &m_channelContext)) { - std::cout << "The CSC strip hash id is " << channelHashId - << " for " << m_cscId->show_to_string(vect[i],&m_channelContext) << std::endl; - } - } - } - else { - m_log << MSG::ERROR << "Unable to set csc hash id for det elem " - << "context begin_index = " << m_moduleContext.begin_index() - << " context end_index = " << m_moduleContext.end_index() - << " the idenitifier is " - << endmsg; - id.show(); - } - } else { - m_log << MSG::ERROR << "Invalid CSC id " << endmsg; - id.show(); - } - } - */ - ///////// - //Prepare local cache. m_dbCache = new CscCondDataContainer(); m_dbCache->clear(); @@ -308,8 +267,20 @@ namespace MuonCalib { return StatusCode::FAILURE; } - //bool noneFailed = true; - //bool anySucceed = false; + if (m_pslopeFromDB) { + ATH_MSG_WARNING("You have activated the retrieval of the pslope per CSC channel from the COOL database. " + << "Please make sure that a correct PSLOPE database is in place which uses geometrical CSC hashes in hex format " + << "as keys and different values of the pslopes for the different CSC channels as values, otherwise please run " + << "with the ReadPSlopeFromDatabase property set to false"); + } else { + if (!(m_pslope>0 && m_pslope<1)) { + ATH_MSG_FATAL("The Pslope cannot be set to a value <=0 or >=1"); + return StatusCode::FAILURE; + } else if (m_pslope != m_DEFAULT_PSLOPE) { + ATH_MSG_WARNING("You have manually set the Pslope property (to " << m_pslope << "). Please check if this is really intended."); + } + } + //Initialized each parameter for(unsigned int parItr = 0 ; parItr < numPars; parItr++) { @@ -321,6 +292,10 @@ namespace MuonCalib { std::string category = m_parCatVec[parItr]; std::string defaultVal = m_parDefaultVec[parItr] ; + if (!m_pslopeFromDB) { + // in this case, we do not need to read the pslopes from the database, thus, we do not need a CscCondDataCollection + if (sgKey=="CSC_PSLOPE") continue; + } if(m_debug) m_log << MSG::DEBUG << "Entering new parameter." << "\nName:\t" << name @@ -403,7 +378,7 @@ namespace MuonCalib { m_parSGKeyMap[sgKey] = coll; if( name == "rms" ) m_rmsCondData = dynamic_cast<CscCondDataCollection<float>*>(coll); - else if( name == "pslope" ) m_slopeCondData = dynamic_cast<CscCondDataCollection<float>*>(coll); + else if( m_pslopeFromDB && name == "pslope" ) m_slopeCondData = dynamic_cast<CscCondDataCollection<float>*>(coll); else if( name == "noise" ) m_noiseCondData = dynamic_cast<CscCondDataCollection<float>*>(coll); else if( name == "f001" ) m_f001CondData = dynamic_cast<CscCondDataCollection<float>*>(coll); else if( name == "ped" ) m_pedestalCondData = dynamic_cast<CscCondDataCollection<float>*>(coll); @@ -594,8 +569,11 @@ namespace MuonCalib { return getVal(val,*m_rmsCondData,index); } bool CscCoolStrSvc::getSlope( float& val, const unsigned int & index) const { - if( !m_slopeCondData ) { - m_log << MSG::WARNING << " No slope data available" << endmsg; + if (!m_pslopeFromDB) { + val = m_pslope; + return true; + } else if( !m_slopeCondData ) { + ATH_MSG_WARNING(" No slope data available"); return false; } return getVal(val,*m_slopeCondData,index); @@ -945,42 +923,18 @@ namespace MuonCalib { continue; } - string version; - ss >> version; - - if(version == "1" or atoi(version.c_str()) == 1) - { - if(!cacheVersion1(ss,coll).isSuccess()) { - m_log << MSG::FATAL << "Failed caching from COOL string." << endmsg; + if(version == "02-00") { + if(!cache(ss,coll).isSuccess()) { + ATH_MSG_FATAL( "Failed caching from COOL string."); return StatusCode::FAILURE; } + } else { + ATH_MSG_FATAL( "Did not recognize CSC COOL string version " << version << ". Currently, only version 02-00 is supported. The keys of the database have to be geometrical CSC hashes in hex format."); + return StatusCode::FAILURE; } - else if(version == "02-00") { - if(!cacheVersion2(ss,coll).isSuccess()) { - m_log << MSG::FATAL << "Failed caching from COOL string." << endmsg; - return StatusCode::FAILURE; - } - } - else - { - //Old version was treated as an actual number rather than string. It was always - //set to 1 or sometimes 1.00000, so we convert to integer here and check - m_log << MSG::WARNING << "Don't recognize CSC COOL string version " << version << - " for parameter " << coll->getParName() << ". Will treat as default version " << m_defaultDatabaseReadVersion << endmsg; - if(m_defaultDatabaseReadVersion == "1"){ - if(!cacheVersion1(ss,coll).isSuccess()) { - m_log << MSG::FATAL << "Failed caching from COOL." << endmsg; - return StatusCode::FAILURE; - } - } - else if(m_defaultDatabaseReadVersion == "02-00") - if(!cacheVersion1(ss,coll).isSuccess()) { - m_log << MSG::FATAL << "Failed caching from COOL." << endmsg; - return StatusCode::FAILURE; - } - } + }//end cool channel loop if(!numCoolChannelsFound) { m_log << MSG::ERROR << "Found no COOL channels!" << endmsg; @@ -993,83 +947,8 @@ namespace MuonCalib { return StatusCode::SUCCESS; }//end cache parameter - - //------------------------------------------------------------------- - StatusCode CscCoolStrSvc::cacheVersion1(istringstream & ss, CscCondDataCollectionBase * const coll) { - - if(m_debug) m_log << MSG::DEBUG << "Caching " << coll->getParName() - << " (category " << coll->getParCat() << "). Database string is version 1" - << endmsg; - if(coll->getParCat() != "CHANNEL") - { - m_log << MSG::ERROR << coll->getParCat() - << " is not a valid parameter category for version 1!" << endmsg; - return StatusCode::RECOVERABLE; - } - - unsigned int numUpdated = 0; - string indexStr,valueStr; - - const int & numEntries = coll->getSize(); - //Loop over strips in chamber. We don't usually expect i to reach maxIndex - //We just have this upper limit to prevent a bug causing an endless loop. - for(int cnt = 0; cnt < numEntries; cnt++) - { - ss >> indexStr; - - //If we read END for the next value, we have reached end of database - //string. This is the expected way we'll exit this loop - if(indexStr == "END") - break; //reached end of database string - - int index = atoi(indexStr.c_str()); - - if(m_phiSwapVersion1Strings){ - Identifier chanId; - m_cscId->get_id((IdentifierHash)index, chanId, &m_channelContext); - int stationEta = m_cscId->stationEta(chanId); // +1 Wheel A -1 Wheel C - int measuresPhi = m_cscId->measuresPhi(chanId); // 0 eta 1 phi - if(stationEta > 0 && measuresPhi ==1){ - int stationName = m_cscId->stationName(chanId); // CSL or CSS - int stationPhi = m_cscId->stationPhi(chanId); // PhiSector from 1-8 - int chamberLayer = m_cscId->chamberLayer(chanId); // Either 1 or 2 (but always 2) - //if( chamberLayer == 1 ) chamberLayer = 2 ;//m_log << MSG::WARNING << "Bad chamberLayer " << endmsg; - int wireLayer = m_cscId->wireLayer(chanId); // layer in chamber 1-4 - int strip = 49 - m_cscId->strip(chanId); - - Identifier newId = m_cscId->channelID(stationName,stationEta,stationPhi,chamberLayer, wireLayer,measuresPhi,strip); - IdentifierHash hash ; - m_cscId->get_channel_hash(newId, hash); - - if(m_verbose) - m_log << MSG::VERBOSE << "Swapped phi strip " - << m_cscId->show_to_string(chanId) << " (" << index - << ") to " << m_cscId->show_to_string(newId) << " (" << hash << ")" << endmsg; - - index = hash; - } - else if (m_verbose) m_log << MSG::VERBOSE << "Not swapping " << m_cscId->show_to_string(chanId) << endmsg; - } - - if(m_verbose) m_log << MSG::VERBOSE << "[cache version 1] Recording index " << index << " for paramter " << coll->getParName() << endmsg; - - //Put next word in string into collection as a data entry at [index] - if(!coll->recordFromSS(ss, index).isSuccess()) - { - m_log << MSG::WARNING << "Failed caching to index " << index << " for parameter " << coll->getParName() << " (data string version 1). Likely tried to recache to same index twice." << endmsg; - } - - if(m_debug) numUpdated++; - }//end index loop - - if(m_debug) m_log << MSG::DEBUG << "Number chans updated for this channel is " << numUpdated << endmsg; - - return(StatusCode::SUCCESS); - }//end cache version 1 - - //------------------------------------------------------------------- - StatusCode CscCoolStrSvc::cacheVersion2(istringstream & ss, CscCondDataCollectionBase * const coll) { + StatusCode CscCoolStrSvc::cache(istringstream & ss, CscCondDataCollectionBase * const coll) { if(m_debug) m_log << MSG::DEBUG << "Caching " << coll->getParName() << " (category " << coll->getParCat() << "). Database string is version 2" @@ -1085,14 +964,14 @@ namespace MuonCalib { } const string & cat = coll->getParCat(); - const int & numEntries = coll->getSize(); + const unsigned int & numEntries = coll->getSize(); string str = ""; if ( cat!="ASM" ) { //Loop over strips in chamber. We don't usually expect cnt to reach numEntries //We just have this upper limit to prevent a bug causing an endless loop. - for(int cnt = 0; cnt < numEntries; cnt++) { + for(unsigned int cnt = 0; cnt < numEntries; cnt++) { ss >> str; //See if at end of data string @@ -1105,7 +984,7 @@ namespace MuonCalib { unsigned int index = 0; if(cat != "CSC") { if(!stringIdToIndex(str, cat, index).isSuccess()) { - m_log << MSG::ERROR << "Failed converting string Id to index in cacheVersion2" + m_log << MSG::ERROR << "Failed converting string Id to index" << endmsg; return StatusCode::RECOVERABLE; } @@ -1115,12 +994,15 @@ namespace MuonCalib { if(m_verbose) m_log << MSG::VERBOSE << "[cache version 2 (CHANNEL) ] Recording " << str << " at index " << index << endmsg; + if (index==UINT_MAX) continue; + if (index>=numEntries) continue; + //Now str has a value in it. We pass it to the collection. istringstream valueSS(str); if(!coll->recordFromSS(valueSS, index).isSuccess()) { m_log << MSG::WARNING << "Failed caching to index " << index << " for parameter" << coll->getParName() - << " (data string version 2). Likely tried to recache to same index twice." + << ". Likely tried to recache to same index twice." << " Likely a bug when the data was orginally put in COOL." << endmsg; } if(m_debug) numUpdated++; @@ -1153,7 +1035,7 @@ namespace MuonCalib { unsigned int index = 0; IdentifierHash hashIdentifier; - for ( int cnt = 0; cnt < numEntries; cnt++ ) // Only works for chamberLayer=2 + for (unsigned int cnt = 0; cnt < numEntries; cnt++ ) // Only works for chamberLayer=2 { ss >> asmIDstr; /* asm cool tag id string which is ASM[#:1-5]_[StationEtaString:AorC][stationPhi:1-8]_[stationName:50-51] xxx 3 x 5 6 x x9 */ @@ -1191,11 +1073,28 @@ namespace MuonCalib { // Now for given asmID, loop over strip and layer for ( int iStrip = stripSince; iStrip < stripUntil; iStrip++ ) { for ( int iLayer = layerSince; iLayer < layerUntil; iLayer++ ) - { chanId = m_cscId->channelID(stationName, stationEta, stationPhi, chamberLayer, - iLayer, measuresPhi, iStrip); - m_cscId->get_channel_hash(chanId, hashIdentifier); + { + // The following call of channelID with check=true ensures that the identifier is checked to be physically valid. + // This is currently required to be checked when running with layouts which do not contain all CSCs anymore, since the + // CSCCool database contains still all CSCs. A clean fix would be to have a dedicated database for every layout. + bool isValid = true; + chanId = m_cscId->channelID(stationName, stationEta, stationPhi, chamberLayer, iLayer, measuresPhi, iStrip, true, &isValid); + static bool conversionFailPrinted = false; + if (!isValid) { + if (!conversionFailPrinted) { + ATH_MSG_WARNING("Failed to retrieve offline identifier from ASM cool string " << asmIDstr + << ". This is likely due to the fact that the CSCCool database contains more entries than " + << "the detector layout."); + conversionFailPrinted = true; + } + continue; + } + if (m_cscId->get_channel_hash(chanId, hashIdentifier)) { + ATH_MSG_WARNING("Failed to retrieve channel hash for identifier " << chanId.get_compact()); + } + index = (int)hashIdentifier; - if ( m_verbose ) m_log << MSG::VERBOSE << "[cache version 2 (ASM)] Recording " + if ( m_verbose ) m_log << MSG::VERBOSE << "(ASM) Recording " << valueStr << " at index " << index << "\nstationName " << stationName <<"\nstationEta " << stationEta @@ -1205,7 +1104,11 @@ namespace MuonCalib { << "\nmeasuresPhi " << measuresPhi << "\niStrip " << iStrip << endmsg; - //Now valueStr has a value in it. We pass it to the collection. + + if (index==UINT_MAX) continue; + if (index>=numEntries) continue; + + //Now valueStr has a value in it. We pass it to the collection. istringstream valueSS(valueStr); if ( !coll->recordFromSS(valueSS, index).isSuccess() ) { m_log << MSG::WARNING << "Failed caching to index " << index @@ -1306,13 +1209,6 @@ namespace MuonCalib { if (wireLayer<=2) iASM=3; else iASM=4; } - /* Never gonna reach this code - else - { - m_log << MSG::ERROR << "Could not assign iASM in CscCoolStrSvc::offlineToAsmId" << endmsg; - return StatusCode::RECOVERABLE; - } - */ std::stringstream ss; ss << "ASM" << iASM << "_" << stationEtaString << stationPhi << "_" << stationName; @@ -1367,7 +1263,21 @@ namespace MuonCalib { } elementId = m_cscId->elementID(stationName,eta,phi); - channelId = m_cscId->channelID(stationName,eta,phi,chamLay,wireLay,measuresPhi,strip); + // The following call of channelID with check=true ensures that the identifier is checked to be physically valid. + // This is currently required to be checked when running with layouts which do not contain all CSCs anymore, since the + // CSCCool database contains still all CSCs. A clean fix would be to have a dedicated database for every layout. + bool isValid = true; + channelId = m_cscId->channelID(stationName,eta,phi,chamLay,wireLay,measuresPhi,strip,true,&isValid); + static bool conversionFailPrinted = false; + if (!isValid) { + if (!conversionFailPrinted) { + ATH_MSG_WARNING("Failed to retrieve offline identifier from online identifier " << onlineId + << ". This is likely due to the fact that the CSCCool database contains more entries than " + << "the detector layout."); + conversionFailPrinted = true; + } + return StatusCode::FAILURE; + } return StatusCode::SUCCESS; } @@ -1417,8 +1327,8 @@ namespace MuonCalib { unsigned int stationName = m_cscId->stationName(id); if(m_cscId->stationName(id) >= 50 ) stationName = stationName - 50; else { - m_log <<MSG::ERROR << "stationName: " << stationName << " is not CSC - emergency stop." << endmsg; - throw; + ATH_MSG_ERROR("stationName: " << stationName << " is not CSC - emergency stop."); + throw std::runtime_error(Form("File: %s, Line: %d\nCscCoolStrSvc::getLayerHash() - given identifier is no CSC identifier", __FILE__, __LINE__)); } unsigned int stationEta = (m_cscId->stationEta(id) == 1 ? 1 :0); unsigned int stationPhi = m_cscId->stationPhi(id) -1; @@ -1498,20 +1408,6 @@ namespace MuonCalib { unsigned int phi = ((onlineId >> 13)&0x7); unsigned int eta = (((onlineId >> 12)&0x1)); - /* According to coverity 105392, this never becomes true - if(stationName > 1 - || phi > 7 - || eta > 1 - ) { - m_log <<MSG::ERROR << "when creating chamber cool channel, inputs were:\nstationName: " - << stationName - << "\nPhi: " << phi - << "\neta: " << eta - << endmsg; - return StatusCode::RECOVERABLE; - } - */ - chamCoolChan = m_chamberCoolChannels[stationName][eta][phi]; if(chamCoolChan < 1 || chamCoolChan > 32) { m_log << MSG::ERROR << "created chamber cool channel is " @@ -1532,13 +1428,6 @@ namespace MuonCalib { onlineId = m_onlineChannelIdsFromChamberCoolChannel[chamCoolChan-1]; return StatusCode::SUCCESS; } - /* - indexToCoolChan(const unsigned int & index, std::string & cat, unsigned int & coolChan) { - - - } - */ - //----------------------------------------------------------------------------------- StatusCode CscCoolStrSvc::getParCat(const std::string & parName, std::string & val) const{ @@ -1617,13 +1506,14 @@ namespace MuonCalib { Identifier chamberId; Identifier channelId; if(!onlineToOfflineIds(chanAddress, chamberId, channelId).isSuccess()){ - m_log << MSG::ERROR << "Cannon get offline Ids from online Id" << hex << chanAddress << dec << endmsg; + index = UINT_MAX; + return StatusCode::SUCCESS; } if(cat == "CHAMBER") { IdentifierHash chamberHash; - m_cscId->get_module_hash(chamberId,chamberHash); + m_cscId->get_geo_module_hash(chamberId,chamberHash); index = (unsigned int)chamberHash; } else if(cat == "LAYER") diff --git a/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondSvc/src/CscCoolStrSvc.h b/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondSvc/src/CscCoolStrSvc.h index 201f21be89d09cc2b696a19f2caf894384f30c00..50e301b2134192153e1531df2cc10a1712f3f123 100755 --- a/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondSvc/src/CscCoolStrSvc.h +++ b/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondSvc/src/CscCoolStrSvc.h @@ -166,11 +166,7 @@ namespace MuonCalib { /**cacheParameter caches a parameter from the COOL database into the local mirror*/ StatusCode cacheParameter(const std::string & parKey); - /**cacheParameterVersion1 caches a parameter from the COOL database of the old - format. - */ - StatusCode cacheVersion1(std::istringstream &, CscCondDataCollectionBase * const); - StatusCode cacheVersion2(std::istringstream &, CscCondDataCollectionBase * const); + StatusCode cache(std::istringstream &, CscCondDataCollectionBase * const); int swapChamberLayerReturnHash(const Identifier & id) const; @@ -249,8 +245,21 @@ namespace MuonCalib { bool m_doMerge; bool m_doCaching; bool m_onlineOfflinePhiFlip; - bool m_phiSwapVersion1Strings; - }; + + /** + * The pslope is the gain of each CSC channel. It was intended to be retrieved by calibration with the pulser runs, + * but the pulses caused overload in the amplifiers because every channel fires at once. This leads to errors that are + * larger than the variation between channels. Consequently, the pslope is the same for all channels. + * In the future, one could try to calibrate from data. The support for the pslope in the database is maintained by having + * a boolean property ReadPSlopeFromDatabase. If it is set to false, the value of the property PSlope is used for all channels. + */ + bool m_pslopeFromDB; + float m_pslope; + /** + * The CSC gain was originally 5.304 ADC counts per fC, but later increased to + * 5.7 ADC counts per fC, so the pslope equals 1/5.7 = 0.175438 + */ + const float m_DEFAULT_PSLOPE = 0.175; }; } #include "CscCoolStrSvc.icc" diff --git a/MuonSpectrometer/MuonConfig/python/MuonConfigFlags.py b/MuonSpectrometer/MuonConfig/python/MuonConfigFlags.py index c38ad35fe384705f35dc8e41b861d80b162fc864..eefcbd8b58c7f9aa4656d5e68f15070ac648e7e5 100644 --- a/MuonSpectrometer/MuonConfig/python/MuonConfigFlags.py +++ b/MuonSpectrometer/MuonConfig/python/MuonConfigFlags.py @@ -63,7 +63,6 @@ def createMuonConfigFlags(): mcf.addFlag("Muon.useTGCPriorNextBC",False) # Use TGC measurements from Prior and Next Bunch Crossings. These measurements are available in the real data since somewhere in 2008. mcf.addFlag("Muon.useAlignmentCorrections",False) # Apply alignment corrections to MuonGeoModel. The corrections are read from a COOL database mcf.addFlag("Muon.useWireSagCorrections",False) # tApply wire sag corrections. - # doNSWNewThirdChain redundant - check e.g. Detector.GeometryCSC # makePRDs - surely this is top level and redundant with makeRIO? diff --git a/MuonSpectrometer/MuonConfig/python/MuonGeometryConfig.py b/MuonSpectrometer/MuonConfig/python/MuonGeometryConfig.py index 83030726352b9d69127f6ebae670e08d8646c9b6..79e7846d7ce4ee292bdf9337ca68c6042843c4fd 100644 --- a/MuonSpectrometer/MuonConfig/python/MuonGeometryConfig.py +++ b/MuonSpectrometer/MuonConfig/python/MuonGeometryConfig.py @@ -6,6 +6,8 @@ from MuonGeoModel.MuonGeoModelConf import MuonDetectorTool from MuonIdHelpers.MuonIdHelpersConf import Muon__MuonIdHelperTool from AGDD2GeoSvc.AGDD2GeoSvcConf import AGDDtoGeoSvc from MuonAGDD.MuonAGDDConf import MuonAGDDTool, NSWAGDDTool +from AtlasGeoModel.CommonGMJobProperties import CommonGeometryFlags +from AtlasGeoModel.MuonGMJobProperties import MuonGeometryFlags def MuonGeoModelCfg(flags): acc = ComponentAccumulator() @@ -15,7 +17,11 @@ def MuonGeoModelCfg(flags): gms=gmsAcc.getPrimary() acc.merge(gmsAcc) - detTool = MuonDetectorTool() + detTool = MuonDetectorTool( + HasCSC=MuonGeometryFlags.hasCSC(), + HasSTgc=(CommonGeometryFlags.Run() in ["RUN3", "RUN4"]), + HasMM=(CommonGeometryFlags.Run() in ["RUN3", "RUN4"]) + ) detTool.UseConditionDb = 1 detTool.UseIlinesFromGM = 1 detTool.BuildFromNova = 0 @@ -103,6 +109,10 @@ def MuonGeoModelCfg(flags): gms.DetectorTools += [ detTool ] # Temporary, until we move to services/private tools - acc.addPublicTool( Muon__MuonIdHelperTool() ) + acc.addPublicTool( Muon__MuonIdHelperTool("MuonIdHelperTool", + HasCSC=MuonGeometryFlags.hasCSC(), + HasSTgc=(CommonGeometryFlags.Run() in ["RUN3", "RUN4"]), + HasMM=(CommonGeometryFlags.Run() in ["RUN3", "RUN4"]) + ) ) return acc diff --git a/MuonSpectrometer/MuonConfig/share/MuonDataDecodeTest.ref b/MuonSpectrometer/MuonConfig/share/MuonDataDecodeTest.ref index a844bec92587b549586a7d94712f4bf1bc7d8851..fff661ad2a86a99cba90ad12a12aefa29cea4297 100644 --- a/MuonSpectrometer/MuonConfig/share/MuonDataDecodeTest.ref +++ b/MuonSpectrometer/MuonConfig/share/MuonDataDecodeTest.ref @@ -33,6 +33,8 @@ RpcRdoToRpcPrepData 0 INFO Retrieved DecodingTool = TgcRdoToTgcPrepData.TgcRdoToTgcPrepDa... 0 INFO initialize() successful in TgcRdoToTgcPrepData.TgcRdoToTgcPrepDataTool TgcRdoToTgcPrepData 0 INFO Retrieved DecodingTool = PrivateToolHandle('Muon::TgcRdoToPrepDataTool/TgcRdoToTgcPrepDataTool') MdtRdoToMdtPrepData.MdtRdoToMdtPrepDa... 0 INFO Processing configuration for layouts with BMG chambers. +MdtRdoToMdtPrepData.MdtRdoToMdtPrepDa... 0 WARNING Cannot retrieve sTgcIdHelper, please consider setting HasSTgc property to false in the future when running a layout without sTGC chambers +MdtRdoToMdtPrepData.MdtRdoToMdtPrepDa... 0 WARNING Cannot retrieve MmIdHelper, please consider setting HasMM property to false in the future when running a layout without MicroMegas chambers MdtRdoToMdtPrepData.MdtRdoToMdtPrepDa... 0 INFO Processing configuration for layouts with BME chambers. MdtRdoToMdtPrepData.MdtRdoToMdtPrepDa... 0 INFO Processing configuration for layouts with BMG chambers. MdtRdoToMdtPrepData 0 INFO Retrieved DecodingTool = PrivateToolHandle('Muon::MdtRdoToPrepDataTool/MdtRdoToMdtPrepDataTool') diff --git a/MuonSpectrometer/MuonConfig/share/MuonDataDecodeTest_Cache.ref b/MuonSpectrometer/MuonConfig/share/MuonDataDecodeTest_Cache.ref index a844bec92587b549586a7d94712f4bf1bc7d8851..14f08c85061462fe6c1d4d33b4be7a3dec864a10 100644 --- a/MuonSpectrometer/MuonConfig/share/MuonDataDecodeTest_Cache.ref +++ b/MuonSpectrometer/MuonConfig/share/MuonDataDecodeTest_Cache.ref @@ -1,3 +1,5 @@ +MuonCacheCreator.MuonIdHelperTool 0 WARNING Cannot retrieve sTgcIdHelper, please consider setting HasSTgc property to false in the future when running a layout without sTGC chambers +MuonCacheCreator.MuonIdHelperTool 0 WARNING Cannot retrieve MmIdHelper, please consider setting HasMM property to false in the future when running a layout without MicroMegas chambers RpcRawDataProvider 0 INFO RpcRawDataProvider::initialize RpcRawDataProvider 0 INFO 'DoSeededDecoding':False RpcRawDataProvider.RPC_RawDataProvide... 0 INFO initialize() successful in RpcRawDataProvider.RPC_RawDataProviderToolMT @@ -33,6 +35,8 @@ RpcRdoToRpcPrepData 0 INFO Retrieved DecodingTool = TgcRdoToTgcPrepData.TgcRdoToTgcPrepDa... 0 INFO initialize() successful in TgcRdoToTgcPrepData.TgcRdoToTgcPrepDataTool TgcRdoToTgcPrepData 0 INFO Retrieved DecodingTool = PrivateToolHandle('Muon::TgcRdoToPrepDataTool/TgcRdoToTgcPrepDataTool') MdtRdoToMdtPrepData.MdtRdoToMdtPrepDa... 0 INFO Processing configuration for layouts with BMG chambers. +MdtRdoToMdtPrepData.MdtRdoToMdtPrepDa... 0 WARNING Cannot retrieve sTgcIdHelper, please consider setting HasSTgc property to false in the future when running a layout without sTGC chambers +MdtRdoToMdtPrepData.MdtRdoToMdtPrepDa... 0 WARNING Cannot retrieve MmIdHelper, please consider setting HasMM property to false in the future when running a layout without MicroMegas chambers MdtRdoToMdtPrepData.MdtRdoToMdtPrepDa... 0 INFO Processing configuration for layouts with BME chambers. MdtRdoToMdtPrepData.MdtRdoToMdtPrepDa... 0 INFO Processing configuration for layouts with BMG chambers. MdtRdoToMdtPrepData 0 INFO Retrieved DecodingTool = PrivateToolHandle('Muon::MdtRdoToPrepDataTool/MdtRdoToMdtPrepDataTool') diff --git a/MuonSpectrometer/MuonDetDescr/MuonReadoutGeometry/src/MuonDetectorManager.cxx b/MuonSpectrometer/MuonDetDescr/MuonReadoutGeometry/src/MuonDetectorManager.cxx index c5b14339521103fdfd071378bee79d93211a4e82..f654ba0f5a3af8234d632002de9503dd5a3b8513 100644 --- a/MuonSpectrometer/MuonDetDescr/MuonReadoutGeometry/src/MuonDetectorManager.cxx +++ b/MuonSpectrometer/MuonDetDescr/MuonReadoutGeometry/src/MuonDetectorManager.cxx @@ -1081,7 +1081,7 @@ void MuonDetectorManager::addCscReadoutElement (const CscReadoutElement* x, Iden } //add here the CscDetectorElement and/or add this readoutElement to the DetectorElement - IdentifierHash idh = x->collectionHash(); + IdentifierHash idh = x->detectorElementHash(); if ( idh< CscDetElMaxHash ) { if ( !(m_cscDEArray[idh]) ) diff --git a/MuonSpectrometer/MuonDetDescr/MuonRegionSelector/share/MuonRegionSelectorTable_jobOptions.py b/MuonSpectrometer/MuonDetDescr/MuonRegionSelector/share/MuonRegionSelectorTable_jobOptions.py index 6935c3d90c57d1dccd9db872593e6eb18e3d2a45..ecdf575e962a3a871b569e224d0e22e26d2cca1e 100644 --- a/MuonSpectrometer/MuonDetDescr/MuonRegionSelector/share/MuonRegionSelectorTable_jobOptions.py +++ b/MuonSpectrometer/MuonDetDescr/MuonRegionSelector/share/MuonRegionSelectorTable_jobOptions.py @@ -14,6 +14,9 @@ topSequence = AlgSequence() # get ToolSvc ToolSvc = Service( "ToolSvc" ) +from AtlasGeoModel.CommonGMJobProperties import CommonGeometryFlags +from AtlasGeoModel.MuonGMJobProperties import MuonGeometryFlags + #### RPC #### if DetFlags.detdescr.RPC_on(): @@ -40,7 +43,7 @@ else : #### CSC #### -if DetFlags.detdescr.CSC_on(): +if MuonGeometryFlags.hasCSC() and DetFlags.detdescr.CSC_on(): from MuonRegionSelector.MuonRegionSelectorConf import CSC_RegionSelectorTable CSC_RegionSelectorTable = CSC_RegionSelectorTable(name = "CSC_RegionSelectorTable") @@ -63,7 +66,7 @@ else : #### New small wheel #### -if DetFlags.detdescr.Micromegas_on(): +if (CommonGeometryFlags.Run() in ["RUN3", "RUN4"]) and DetFlags.detdescr.Micromegas_on(): from MuonRegionSelector.MuonRegionSelectorConf import MM_RegionSelectorTable MM_RegionSelectorTable = MM_RegionSelectorTable(name = "MM_RegionSelectorTable") @@ -73,7 +76,7 @@ else : MM_RegionSelectorTable = None -if DetFlags.detdescr.sTGC_on(): +if (CommonGeometryFlags.Run() in ["RUN3", "RUN4"]) and DetFlags.detdescr.sTGC_on(): from MuonRegionSelector.MuonRegionSelectorConf import sTGC_RegionSelectorTable sTGC_RegionSelectorTable = sTGC_RegionSelectorTable(name = "sTGC_RegionSelectorTable") diff --git a/MuonSpectrometer/MuonDigitization/CSC_Digitization/CSC_Digitization/CSC_Digitizer.h b/MuonSpectrometer/MuonDigitization/CSC_Digitization/CSC_Digitization/CSC_Digitizer.h index a28a571c0c8153edd98e45925673a77e9be61197..a3a78d7cae1b345c5a666ae52c373e4f1c118a18 100644 --- a/MuonSpectrometer/MuonDigitization/CSC_Digitization/CSC_Digitization/CSC_Digitizer.h +++ b/MuonSpectrometer/MuonDigitization/CSC_Digitization/CSC_Digitization/CSC_Digitizer.h @@ -9,6 +9,7 @@ #include <vector> #include <map> #include <cassert> +#include <TString.h> // for Form #include "GaudiKernel/StatusCode.h" @@ -88,14 +89,13 @@ public: std::map<IdentifierHash,std::vector<float> >& data_SampleMap, CLHEP::HepRandomEngine* rndmEngine); - // input parameters should be as form of cscHelper returned value.... - IdentifierHash getHashId(int eta, int phiSector, int chamberLayer, int chamberType, int wireLayer, int stripId, int maxStrip, int measuresPhi) { - - int etaIndex = (eta==-1) ? 1 : 2; - - IdentifierHash hashId = (stripId-1)+maxStrip*(wireLayer-1)+4*maxStrip*(chamberLayer-1) - +8*maxStrip*(phiSector-1)+64*maxStrip*(etaIndex-1)+m_hashOffset[chamberType][measuresPhi]; - + // input parameters should be as form of cscHelper returned value... + IdentifierHash getHashId(const std::string &stationName, const int eta, const int phiSector, const int chamberLayer, const int wireLayer, const int stripId, const int measuresPhi) { + Identifier realHitId = m_cscIdHelper->channelID(stationName, eta, phiSector, chamberLayer, wireLayer, measuresPhi, stripId); + IdentifierHash hashId; + if (m_cscIdHelper->get_channel_hash(realHitId, hashId)) { + throw std::runtime_error(Form("File: %s, Line: %d\nCSC_Digitizer::getHashId() - Failed to retrieve channel hash from identifier %llu", __FILE__, __LINE__, realHitId.get_compact())); + } return hashId; } @@ -138,7 +138,6 @@ private: double m_Polia; double * m_sprob; - size_t m_hashOffset[2][2]; double m_timeWindowLowerOffset; double m_timeWindowUpperOffset; double m_bunchTime; @@ -197,12 +196,7 @@ inline void CSC_Digitizer::fillSampleMaps(const IdentifierHash hashId, } else { - std::vector<float> samples = m_pcalib->getSamplesFromBipolarFunc(driftTime, stripCharge); - if (data_map[hashId].empty()) { - for (unsigned int i=0; i< samples.size(); ++i ) { - data_map[hashId].push_back(samples[i]); - } - } + data_map.insert ( std::pair<IdentifierHash,std::vector<float>>(hashId,m_pcalib->getSamplesFromBipolarFunc(driftTime, stripCharge)) ); hashVec.push_back(hashId); } } diff --git a/MuonSpectrometer/MuonDigitization/CSC_Digitization/src/CSC_Digitizer.cxx b/MuonSpectrometer/MuonDigitization/CSC_Digitization/src/CSC_Digitizer.cxx index e96bf31173626c679efe517a55976991ca6ca220..8cb15191d0174bf77f86e1b4d698d8f3313c609f 100644 --- a/MuonSpectrometer/MuonDigitization/CSC_Digitization/src/CSC_Digitizer.cxx +++ b/MuonSpectrometer/MuonDigitization/CSC_Digitization/src/CSC_Digitizer.cxx @@ -89,11 +89,6 @@ StatusCode CSC_Digitizer::initialize() { *(m_sprob+i) = sump; } - //intialize hash offsets - m_hashOffset[0][0] = 0; - m_hashOffset[0][1] = 24576; - m_hashOffset[1][0] = m_hashOffset[0][1]+6144; - m_hashOffset[1][1] = m_hashOffset[0][1]+m_hashOffset[1][0]; return StatusCode::SUCCESS; } @@ -326,7 +321,7 @@ StatusCode CSC_Digitizer::digitize_hit (const CSCSimHit * cscHit, << " wireLayer= " << wireLayer << " strip = " << j << " charge = " << stripCharge << std::endl; - IdentifierHash hashId = getHashId(eta, phi, chamberLayer, chamberType, wireLayer, j, maxStrip, measuresPhi); + IdentifierHash hashId = getHashId(stationName, eta, phi, chamberLayer, wireLayer, j, measuresPhi); fillSampleMaps (hashId, driftTime, stripCharge, hashVec, data_SampleMap); fillSampleMaps (hashId, driftTime, stripCharge, hashVec, data_SampleMapOddPhase, 1); // IdentifierHash hashId = (j-1)+maxStrip*(wireLayer-1)+4*maxStrip*(chamberLayer-1) @@ -361,7 +356,7 @@ StatusCode CSC_Digitizer::digitize_hit (const CSCSimHit * cscHit, // corrStripId = 47-corrStripId; // } - IdentifierHash hashId = getHashId(eta, phi, chamberLayer, chamberType, wireLayer, j, maxStrip, measuresPhi); + IdentifierHash hashId = getHashId(stationName, eta, phi, chamberLayer, wireLayer, j, measuresPhi); fillSampleMaps (hashId, driftTime, stripCharge, hashVec, data_SampleMap); fillSampleMaps (hashId, driftTime, stripCharge, hashVec, data_SampleMapOddPhase, 1); @@ -616,7 +611,7 @@ StatusCode CSC_Digitizer::digitize_hit (const CSCSimHit * cscHit, << " wireLayer= " << wireLayer << " strip = " << j << " charge = " << stripCharge << std::endl; - IdentifierHash hashId = getHashId(eta, phi, chamberLayer, chamberType, wireLayer, j, maxStrip, measuresPhi); + IdentifierHash hashId = getHashId(stationName, eta, phi, chamberLayer, wireLayer, j, measuresPhi); fillSampleMaps (hashId, driftTime, stripCharge, hashVec, data_SampleMap); // IdentifierHash hashId = (j-1)+maxStrip*(wireLayer-1)+4*maxStrip*(chamberLayer-1) // +8*maxStrip*(phi-1)+64*maxStrip*(etaIndex-1)+m_hashOffset[chamberType][measuresPhi]; @@ -650,7 +645,7 @@ StatusCode CSC_Digitizer::digitize_hit (const CSCSimHit * cscHit, // corrStripId = 47-corrStripId; // } - IdentifierHash hashId = getHashId(eta, phi, chamberLayer, chamberType, wireLayer, j, maxStrip, measuresPhi); + IdentifierHash hashId = getHashId(stationName, eta, phi, chamberLayer, wireLayer, j, measuresPhi); fillSampleMaps (hashId, driftTime, stripCharge, hashVec, data_SampleMap); // IdentifierHash hashId = (j-1)+maxStrip*(wireLayer-1)+4*maxStrip*(chamberLayer-1) @@ -918,7 +913,7 @@ StatusCode CSC_Digitizer::digitize_hit (const CSCSimHit * cscHit, // IdentifierHash hashId = (j-1)+maxStrip*(wireLayer-1)+4*maxStrip*(chamberLayer-1) // +8*maxStrip*(phi-1)+64*maxStrip*(etaIndex-1)+m_hashOffset[chamberType][measuresPhi]; - IdentifierHash hashId = getHashId(eta, phi, chamberLayer, chamberType, wireLayer, j, maxStrip, measuresPhi); + IdentifierHash hashId = getHashId(stationName, eta, phi, chamberLayer, wireLayer, j, measuresPhi); // fillMaps (hashId, stripCharge, hashVec, data_map); fillMaps (hashId, driftTime, stripCharge, hashVec, data_map); @@ -952,7 +947,7 @@ StatusCode CSC_Digitizer::digitize_hit (const CSCSimHit * cscHit, // corrStripId = 47-corrStripId; // } - IdentifierHash hashId = getHashId(eta, phi, chamberLayer, chamberType, wireLayer, j, maxStrip, measuresPhi); + IdentifierHash hashId = getHashId(stationName, eta, phi, chamberLayer, wireLayer, j, measuresPhi); // IdentifierHash hashId = (j-1)+maxStrip*(wireLayer-1)+4*maxStrip*(chamberLayer-1) // +8*maxStrip*(phi-1)+64*maxStrip*(etaIndex-1)+m_hashOffset[chamberType][measuresPhi]; diff --git a/MuonSpectrometer/MuonG4/NSW_Sim/share/jobOptions.NSW_Sim.py b/MuonSpectrometer/MuonG4/NSW_Sim/share/jobOptions.NSW_Sim.py index 87cc3a9368c9d628645b836b545068d02fd98a95..18737bcf8d1245b9f84d5e3113218415922d905c 100644 --- a/MuonSpectrometer/MuonG4/NSW_Sim/share/jobOptions.NSW_Sim.py +++ b/MuonSpectrometer/MuonG4/NSW_Sim/share/jobOptions.NSW_Sim.py @@ -59,8 +59,6 @@ simFlags.EventFilter.set_On() ## No magnetic field #simFlags.MagneticField.set_Off() -simFlags.SimulateNewSmallWheel=True - ## Register callback functions at various init stages #def test_preInit(): # print "CALLBACK AT PREINIT" diff --git a/MuonSpectrometer/MuonGeoModel/MuonGeoModel/MuonDetectorFactory001.h b/MuonSpectrometer/MuonGeoModel/MuonGeoModel/MuonDetectorFactory001.h index 50ce13f549c4f81797c3db61b719c22b576414c5..db1368e0e51e7deb54b4cb62e68de3f39de12e62 100755 --- a/MuonSpectrometer/MuonGeoModel/MuonGeoModel/MuonDetectorFactory001.h +++ b/MuonSpectrometer/MuonGeoModel/MuonGeoModel/MuonDetectorFactory001.h @@ -62,7 +62,9 @@ public: inline void setMdtDeformationFlag(int mdtDeformationFlag); inline void setMdtAsBuiltParaFlag(int mdtAsBuiltParaFlag); inline void setFineClashFixingFlag(int value); - inline void useCSC(bool value); + inline void hasCSC(bool value); + inline void hasSTgc(bool value); + inline void hasMM(bool value); private: @@ -89,7 +91,9 @@ private: int m_mdtAsBuiltParaFlag; bool m_dumpMemoryBreakDown; int m_enableFineClashFixing; - bool m_useCSC; + bool m_hasCSC; + bool m_hasSTgc; + bool m_hasMM; std::vector<std::string> m_selectedStations; std::vector<int> m_selectedStEta; @@ -135,7 +139,9 @@ void MuonDetectorFactory001::setMdtDeformationFlag(int value){m_mdtDeformationFl void MuonDetectorFactory001::setMdtAsBuiltParaFlag(int value){m_mdtAsBuiltParaFlag = value;} void MuonDetectorFactory001::setDumpMemoryBreakDown(bool value){m_dumpMemoryBreakDown = value;} void MuonDetectorFactory001::setFineClashFixingFlag(int value){m_enableFineClashFixing = value;} -void MuonDetectorFactory001::useCSC(bool value){m_useCSC = value;} +void MuonDetectorFactory001::hasCSC(bool value){m_hasCSC = value;} +void MuonDetectorFactory001::hasSTgc(bool value){m_hasSTgc = value;} +void MuonDetectorFactory001::hasMM(bool value){m_hasMM = value;} } // namespace MuonGM diff --git a/MuonSpectrometer/MuonGeoModel/MuonGeoModel/MuonDetectorTool.h b/MuonSpectrometer/MuonGeoModel/MuonGeoModel/MuonDetectorTool.h index 0e63ad68af8aa3569c20dd31856196608ef01bf1..5fb55f2c1aa3151b1089c08eeb512efa58ca28e0 100755 --- a/MuonSpectrometer/MuonGeoModel/MuonGeoModel/MuonDetectorTool.h +++ b/MuonSpectrometer/MuonGeoModel/MuonGeoModel/MuonDetectorTool.h @@ -58,7 +58,9 @@ private: int m_fillCache_initTime; bool m_dumpMemoryBreakDown; int m_enableFineClashFixing; - bool m_useCSC; + bool m_hasCSC; + bool m_hasSTgc; + bool m_hasMM; int m_stationSelection; std::vector<std::string> m_selectedStations; std::vector<int> m_selectedStEta; diff --git a/MuonSpectrometer/MuonGeoModel/src/MuonDetectorFactory001.cxx b/MuonSpectrometer/MuonGeoModel/src/MuonDetectorFactory001.cxx index 8bef8f8ec3576e94b1cb94800f44ed7bee835745..03fb19cb298aeededad3e6b30cfea2891ea56820 100755 --- a/MuonSpectrometer/MuonGeoModel/src/MuonDetectorFactory001.cxx +++ b/MuonSpectrometer/MuonGeoModel/src/MuonDetectorFactory001.cxx @@ -90,7 +90,7 @@ namespace MuonGM { : m_includeCutouts(0), m_includeCutoutsBog(0), m_includeCtbBis(0), m_rdb(1), m_controlAlines(0), m_minimalGeoFlag(0), m_controlCscIntAlines(0), m_dumpAlines(false), m_dumpCscIntAlines(false), m_useCscIntAlinesFromGM(true), m_caching(0), m_cacheFillingFlag(0), m_mdtDeformationFlag(0), - m_mdtAsBuiltParaFlag(0), m_dumpMemoryBreakDown(false), m_useCSC(true), m_muon(NULL), m_manager(NULL), + m_mdtAsBuiltParaFlag(0), m_dumpMemoryBreakDown(false), m_hasCSC(true), m_hasSTgc(true), m_hasMM(true), m_muon(NULL), m_manager(NULL), m_pDetStore(pDetStore), m_pRDBAccess(0) { MsgStream log(Athena::getMessageSvc(), "MuonGeoModel"); @@ -195,139 +195,42 @@ namespace MuonGM { StatusCode sc =StatusCode::SUCCESS; - // if (m_idhfromconverters != 0) - // { - - const MdtIdHelper* mdtidh = nullptr; + const DataHandle<MdtIdHelper> mdtidh; sc = m_pDetStore->retrieve(mdtidh,"MDTIDHELPER"); if (sc.isFailure())log<<MSG::ERROR<<" not found MDT "<<endmsg; else log<<MSG::INFO<<"MDTIDHELPER retrieved from DetStore"<<endmsg; m_manager->set_mdtIdHelper(mdtidh); - const RpcIdHelper* rpcidh = nullptr; + const DataHandle<RpcIdHelper> rpcidh; sc = m_pDetStore->retrieve(rpcidh,"RPCIDHELPER"); if (sc.isFailure() )log<<MSG::ERROR<<" not found RPC "<<endmsg; else log<<MSG::INFO<<"RPCIDHELPER retrieved from DetStore"<<endmsg; m_manager->set_rpcIdHelper(rpcidh); - const TgcIdHelper* tgcidh = nullptr; + const DataHandle<TgcIdHelper> tgcidh; sc = m_pDetStore->retrieve(tgcidh,"TGCIDHELPER"); if (sc.isFailure() )log<<MSG::ERROR<<" not found TGC "<<endmsg; else log<<MSG::INFO<<"TGCIDHELPER retrieved from DetStore"<<endmsg; m_manager->set_tgcIdHelper(tgcidh); - if (m_useCSC) { + if (m_hasCSC) { const DataHandle<CscIdHelper> cscidh; sc = m_pDetStore->retrieve(cscidh,"CSCIDHELPER"); if (sc.isFailure() )log<<MSG::ERROR<<" not found CSC "<<endmsg; else log<<MSG::INFO<<"CSCIDHELPER retrieved from DetStore"<<endmsg; m_manager->set_cscIdHelper(cscidh); } - - //for nSW - const sTgcIdHelper* stgcidh = nullptr; - sc = m_pDetStore->retrieve(stgcidh,"STGCIDHELPER"); - if (sc.isFailure() )log<<MSG::ERROR<<" not found sTGC "<<endmsg; - else log<<MSG::INFO<<"STGCIDHELPER retrieved from DetStore"<<endmsg; - m_manager->set_stgcIdHelper(stgcidh); - - const MmIdHelper* mmidh = nullptr; - sc = m_pDetStore->retrieve(mmidh,"MMIDHELPER"); - if (sc.isFailure() )log<<MSG::ERROR<<" not found MicroMegas "<<endmsg; - else log<<MSG::INFO<<"MMIDHELPER retrieved from DetStore"<<endmsg; - m_manager->set_mmIdHelper(mmidh); - - - - // } - // else - // { - - // // hand-made IdHelper Initialization - // // MdtIdHelper - // bool mdtidhInitialized=false; - // MdtIdHelper *mdtidh = new MdtIdHelper; - // const IdDictManager * idDictMgr = 0; - // sc = m_pDetStore->retrieve(idDictMgr, "IdDict"); - // if (sc.isFailure()) { - // log<<MSG::ERROR << " Could not get IdDictManager !" << endmsg; - // throw std::runtime_error("Error in MuonDetectorFactory, could not get IdDictManager"); - // } - - - // // if (StatusCode::SUCCESS == sc) { - // if (idDictMgr) { - // if (!idDictMgr->initializeHelper(*mdtidh)) { // Returns 1 if there is a problem - // mdtidhInitialized=true; - // log<<MSG::INFO << " MdtIdHelper has been initialised! " - // << endmsg; - // } - // else - // { - // log<<MSG::WARNING<<" IdDictManager found BUT initializeHelper =" - // <<idDictMgr->initializeHelper(*mdtidh)<<endmsg; - // } - // } - // else log<<MSG::WARNING<<" IdDictManager not found in the Detector Store"<<endmsg; - // // } - // // else log<<MSG::ERROR<<" FAILURE:: IdDictManager not found in the Detector Store" - // //<<endmsg; - // if (!mdtidhInitialized) { - // log<<MSG::ERROR << " Cannot initialize MdtIdHelper ! " - // << endmsg; - // delete mdtidh; - // mdtidh=NULL; - // throw std::runtime_error("Error in MuonDetectorFactory, cannot initialize MdtIdHelper"); - // } - // m_manager->set_mdtIdHelper(mdtidh); - - // // CscIdHelper - // bool cscidhInitialized=false; - // CscIdHelper *cscidh = new CscIdHelper; - // if (!idDictMgr->initializeHelper(*cscidh)) { // Returns 1 if there is a problem - // cscidhInitialized=true; - // log<<MSG::INFO << " CscIdHelper has been initialised! " - // << endmsg; - // } - // if (!cscidhInitialized) { - // log<<MSG::ERROR << " Cannot initialize CscIdHelper ! " << endmsg; - // delete cscidh; - // cscidh=NULL; - // throw std::runtime_error("Error in MuonDetectorFactory, cannot initialize CscIdHelper"); - // return; - // } - // m_manager->set_cscIdHelper(cscidh); - - // // RpcIdHelper - // bool rpcidhInitialized=false; - // RpcIdHelper *rpcidh = new RpcIdHelper; - // if (!idDictMgr->initializeHelper(*rpcidh)) { // Returns 1 if there is a problem - // rpcidhInitialized=true; - // log<<MSG::INFO << " RpcIdHelper has been initialised! " << endmsg; - // } - // if (!rpcidhInitialized) { - // log<<MSG::ERROR << " Cannot initialize RpcIdHelper ! " << endmsg; - // delete rpcidh; - // rpcidh=NULL; - // throw std::runtime_error("Error in MuonDetectorFactory, cannot initialize RpcIdHelper"); - // return; - // } - // m_manager->set_rpcIdHelper(rpcidh); - - // // TgcIdHelper - // bool tgcidhInitialized=false; - // TgcIdHelper *tgcidh = new TgcIdHelper; - // if (!idDictMgr->initializeHelper(*tgcidh)) { // Returns 1 if there is a problem - // tgcidhInitialized=true; - // log<<MSG::INFO << " TgcIdHelper has been initialised! " << endmsg; - // } - // if (!tgcidhInitialized) { - // log<<MSG::ERROR << " Cannot initialize TgcIdHelper ! " << endmsg; - // delete tgcidh; - // tgcidh=NULL; - // throw std::runtime_error("Error in MuonDetectorFactory, cannot initialize TgcIdHelper"); - // return; - // } - // m_manager->set_tgcIdHelper(tgcidh); - // //} - + if (m_hasSTgc) { + const DataHandle<sTgcIdHelper> stgcidh; + sc = m_pDetStore->retrieve(stgcidh,"STGCIDHELPER"); + if (sc.isFailure() )log<<MSG::ERROR<<" not found sTGC "<<endmsg; + else log<<MSG::INFO<<"STGCIDHELPER retrieved from DetStore"<<endmsg; + m_manager->set_stgcIdHelper(stgcidh); + } + if (m_hasMM) { + const DataHandle<MmIdHelper> mmidh; + sc = m_pDetStore->retrieve(mmidh,"MMIDHELPER"); + if (sc.isFailure() )log<<MSG::ERROR<<" not found MicroMegas "<<endmsg; + else log<<MSG::INFO<<"MMIDHELPER retrieved from DetStore"<<endmsg; + m_manager->set_mmIdHelper(mmidh); + } if (m_dumpMemoryBreakDown) { diff --git a/MuonSpectrometer/MuonGeoModel/src/MuonDetectorTool.cxx b/MuonSpectrometer/MuonGeoModel/src/MuonDetectorTool.cxx index 2db10702b07c29604ce6314a85f695aa63108860..4941b230524fbbe884f6f2c6403f329be1005beb 100755 --- a/MuonSpectrometer/MuonGeoModel/src/MuonDetectorTool.cxx +++ b/MuonSpectrometer/MuonGeoModel/src/MuonDetectorTool.cxx @@ -41,7 +41,9 @@ MuonDetectorTool::MuonDetectorTool( const std::string& type, const std::string& m_fillCache_initTime(0), m_dumpMemoryBreakDown(false), m_enableFineClashFixing(0), - m_useCSC(true), + m_hasCSC(true), + m_hasSTgc(true), + m_hasMM(true), m_stationSelection(0), m_controlAlines(111111), m_dumpAlines(false), @@ -72,7 +74,9 @@ MuonDetectorTool::MuonDetectorTool( const std::string& type, const std::string& declareProperty("DumpMemoryBreakDown" , m_dumpMemoryBreakDown = false); // declareProperty("EnableFineClashFixing" , m_enableFineClashFixing = 0); - declareProperty("UseCSC", m_useCSC); + declareProperty("HasCSC", m_hasCSC); + declareProperty("HasSTgc", m_hasSTgc); + declareProperty("HasMM", m_hasMM); // declareProperty("StationSelection" , m_stationSelection = 0); declareProperty("SelectedStations" , m_selectedStations); @@ -320,7 +324,9 @@ MuonDetectorTool::create() theFactory.setMdtDeformationFlag(m_enableMdtDeformations); theFactory.setMdtAsBuiltParaFlag(m_enableMdtAsBuiltParameters); theFactory.setFineClashFixingFlag(m_enableFineClashFixing); - theFactory.useCSC(m_useCSC); + theFactory.hasCSC(m_hasCSC); + theFactory.hasSTgc(m_hasSTgc); + theFactory.hasMM(m_hasMM); if ( m_stationSelection > 0 ) theFactory.setSelection(m_selectedStations, m_selectedStEta, m_selectedStPhi); theFactory.setRDBAccess(access); diff --git a/MuonSpectrometer/MuonGeoModelTest/share/jobOptions.NSW_SimGeantinos.py b/MuonSpectrometer/MuonGeoModelTest/share/jobOptions.NSW_SimGeantinos.py index a531a57025951ff77ede629d0b4b856d1fb24675..fefa0cdee2b276ac55d81bca27b8de98660a5016 100644 --- a/MuonSpectrometer/MuonGeoModelTest/share/jobOptions.NSW_SimGeantinos.py +++ b/MuonSpectrometer/MuonGeoModelTest/share/jobOptions.NSW_SimGeantinos.py @@ -49,8 +49,6 @@ simFlags.EventFilter.set_Off() ## No magnetic field #simFlags.MagneticField.set_Off() -simFlags.SimulateNewSmallWheel=True - ## Register callback functions at various init stages #def test_preInit(): # print "CALLBACK AT PREINIT" diff --git a/MuonSpectrometer/MuonIdHelpers/MuonIdHelpers/CscIdHelper.h b/MuonSpectrometer/MuonIdHelpers/MuonIdHelpers/CscIdHelper.h index 9cf4eaa3706bdc7d460b540a13c645ff376e3945..70b79924b1582ad2724f6b99daef2dae7a509476 100644 --- a/MuonSpectrometer/MuonIdHelpers/MuonIdHelpers/CscIdHelper.h +++ b/MuonSpectrometer/MuonIdHelpers/MuonIdHelpers/CscIdHelper.h @@ -70,12 +70,21 @@ class CscIdHelper : public MuonIdHelper ///////////// compact identifier stuff begins ////////////////////////////////////// /// Initialization from the identifier dictionary - virtual int initialize_from_dictionary(const IdDictMgr& dict_mgr); - virtual int get_module_hash (const Identifier& id, - IdentifierHash& hash_id ) const; - virtual int get_detectorElement_hash (const Identifier& id, - IdentifierHash& hash_id ) const; - virtual int get_channel_hash(const Identifier&, IdentifierHash&) const; + int initialize_from_dictionary(const IdDictMgr& dict_mgr) override; + + // need to overwrite get_module_hash and get_detectorElement_hash for Run2 geometries (since they contain both + // CSC chamberLayer 1 and 2 although only chamberLayer 2 is actually built into ATLAS) + // function checks whether chamberLayer 1 identifiers are around and in this case returns the correct module hash + int get_module_hash(const Identifier& id, IdentifierHash& hash_id ) const override; + int get_detectorElement_hash (const Identifier& id, IdentifierHash& hash_id) const override; + + // in some parts of athena (still) hashes which encode geometrical information for the CSCs are around, + // therefore, need those additional hash functions here (feel free to fix it in the future) + int get_geo_module_hash(const Identifier& id, IdentifierHash& hash_id ) const; + int get_geo_detectorElement_hash(const Identifier& id, IdentifierHash& hash_id ) const; + int get_geo_channel_hash(const Identifier&, IdentifierHash&) const; + + ///////////// compact identifier stuff ends ////////////////////////////////////// @@ -102,13 +111,13 @@ class CscIdHelper : public MuonIdHelper // Access to levels: missing field returns 0 - int channel(const Identifier& id) const; + int channel(const Identifier& id) const override; int chamberLayer(const Identifier& id) const; int wireLayer(const Identifier& id) const; - bool measuresPhi(const Identifier& id) const; + bool measuresPhi(const Identifier& id) const override; int strip(const Identifier& id) const; - int gasGap(const Identifier& id) const; //Returns chamber Layer here + int gasGap(const Identifier& id) const override; //Returns chamber Layer here int sector(const Identifier& id) const; // Access to min and max of level ranges @@ -163,10 +172,7 @@ class CscIdHelper : public MuonIdHelper IdDictFieldImplementation m_mea_impl; IdDictFieldImplementation m_str_impl; - // Create hash from compact - virtual int get_hash_calc (const Identifier& compact_id, - IdentifierHash& hash_id, - const IdContext* context) const; + int get_geo_hash_calc (const Identifier& compact_id, IdentifierHash& hash_id, const IdContext* context) const; // Private validation of levels @@ -214,8 +220,8 @@ class CscIdHelper : public MuonIdHelper mutable unsigned int m_etaStripMax; mutable unsigned int m_phiStripMax; - inline virtual void create_mlog() const; - + inline void create_mlog() const override; + bool m_hasChamLay1; }; // For backwards compatibility diff --git a/MuonSpectrometer/MuonIdHelpers/src/CscIdHelper.cxx b/MuonSpectrometer/MuonIdHelpers/src/CscIdHelper.cxx index ad1f4a751203e2e45d5be7139929d5fad299d6ab..9e8e2584c443d230d98fbab40e8d7a631bbaaf8e 100644 --- a/MuonSpectrometer/MuonIdHelpers/src/CscIdHelper.cxx +++ b/MuonSpectrometer/MuonIdHelpers/src/CscIdHelper.cxx @@ -30,7 +30,7 @@ inline void CscIdHelper::create_mlog() const /// Constructor/Destructor CscIdHelper::CscIdHelper() : MuonIdHelper(), m_CHAMBERLAYER_INDEX(0), - m_WIRELAYER_INDEX(0), m_MEASURESPHI_INDEX(0), m_etaStripMax(0), m_phiStripMax(0) {} + m_WIRELAYER_INDEX(0), m_MEASURESPHI_INDEX(0), m_etaStripMax(0), m_phiStripMax(0), m_hasChamLay1(false) {} /// Destructor @@ -340,6 +340,8 @@ int CscIdHelper::initialize_from_dictionary(const IdDictMgr& dict_mgr) << "Initializing CSC hash indices for finding neighbors ... " << endmsg; status = init_neighbors(); + // check whether the current layout contains chamberLayer 1 Identifiers (pre-Run3) in the vector of module Identifiers + if (m_module_vec.size() && chamberLayer(m_module_vec.at(0))==1) m_hasChamLay1 = true; m_init = true; return (status); } @@ -367,11 +369,24 @@ int CscIdHelper::init_id_to_hashes() { return 0; } -int CscIdHelper::get_module_hash(const Identifier& id, - IdentifierHash& hash_id) const { - //Identifier moduleId = elementID(id); - //IdContext context = module_context(); - //return get_hash(moduleId,hash_id,&context); + +int CscIdHelper::get_module_hash(const Identifier& id, IdentifierHash& hash_id) const { + // if the current layout contains Identifiers for CSC chamberLayer 1, need to call the + // get_module_hash function with an Identifier which is actually from chamberLayer 1 + if (m_hasChamLay1) return MuonIdHelper::get_module_hash(parentID(id), hash_id); + // otherwise just use the default implementation + return MuonIdHelper::get_module_hash(id, hash_id); +} +int CscIdHelper::get_detectorElement_hash(const Identifier& id, IdentifierHash& hash_id) const { + // if the current layout contains Identifiers for CSC chamberLayer 1, need to call the + // get_detectorElement_hash function with an Identifier which is actually from chamberLayer 1 + if (m_hasChamLay1) return MuonIdHelper::get_detectorElement_hash(parentID(id), hash_id); + // otherwise just use the default implementation + return MuonIdHelper::get_detectorElement_hash(id, hash_id); +} + +int CscIdHelper::get_geo_module_hash(const Identifier& id, + IdentifierHash& hash_id) const { int station = this->stationName(id); int eta = this->stationEta(id) + 2; // for negative etas int phi = this->stationPhi(id); @@ -379,7 +394,7 @@ int CscIdHelper::get_module_hash(const Identifier& id, return 0; } -int CscIdHelper::get_detectorElement_hash(const Identifier& id, +int CscIdHelper::get_geo_detectorElement_hash(const Identifier& id, IdentifierHash& hash_id) const { //Identifier multilayerId = multilayerID(id); //IdContext context = multilayer_context(); @@ -392,9 +407,9 @@ int CscIdHelper::get_detectorElement_hash(const Identifier& id, return 0; } -int CscIdHelper::get_channel_hash(const Identifier& id, IdentifierHash& hash_id) const { +int CscIdHelper::get_geo_channel_hash(const Identifier& id, IdentifierHash& hash_id) const { const IdContext context=this->channel_context(); - return get_hash_calc(id,hash_id,&context); + return get_geo_hash_calc(id,hash_id,&context); } void CscIdHelper::idChannels (const Identifier& id, std::vector<Identifier>& vect) const { @@ -835,12 +850,16 @@ bool CscIdHelper::validElement(const Identifier& id, int stationName, (stationEta > stationEtaMax(id)) || (0 == stationEta) ) { - (*m_Log) << MSG::WARNING - << "Invalid stationEta=" << stationEta - << " for stationName=" << name - << " stationEtaMin=" << stationEtaMin(id) - << " stationEtaMax=" << stationEtaMax(id) - << endmsg; + static bool stationWarningPrinted=false; + if (!stationWarningPrinted) { + (*m_Log) << MSG::WARNING + << "Invalid stationEta=" << stationEta + << " for stationName=" << name + << " stationEtaMin=" << stationEtaMin(id) + << " stationEtaMax=" << stationEtaMax(id) + << endmsg; + stationWarningPrinted=true; + } return false; } if ((stationPhi < stationPhiMin(id)) || @@ -909,7 +928,7 @@ bool CscIdHelper::validChannel(const Identifier& id, int stationName, int statio } // Create hash from compact -int CscIdHelper::get_hash_calc (const Identifier& compact_id, +int CscIdHelper::get_geo_hash_calc (const Identifier& compact_id, IdentifierHash& hash_id, const IdContext* context) const { @@ -922,10 +941,10 @@ int CscIdHelper::get_hash_calc (const Identifier& compact_id, if (0 == begin) { // No hashes yet for ids with prefixes if (m_MODULE_INDEX == end) { - result = this->get_module_hash(compact_id, hash_id); + result = get_geo_module_hash(compact_id, hash_id); } else if (m_DETECTORELEMENT_INDEX == end) { - result = this->get_detectorElement_hash(compact_id, hash_id); + result = get_geo_detectorElement_hash(compact_id, hash_id); } else if (m_CHANNEL_INDEX == end) { int stationIndex = stationName(compact_id); diff --git a/MuonSpectrometer/MuonIdHelpers/src/MuonIdHelper.cxx b/MuonSpectrometer/MuonIdHelpers/src/MuonIdHelper.cxx index 57ae5f84fc392aeb15b9dead949d529eeec73fe1..fffc9f36b32096d0db20c80145ca005198816f1d 100644 --- a/MuonSpectrometer/MuonIdHelpers/src/MuonIdHelper.cxx +++ b/MuonSpectrometer/MuonIdHelpers/src/MuonIdHelper.cxx @@ -511,7 +511,8 @@ int MuonIdHelper::init_hashes(void) { m_module_vec[nids] = (*first); nids++; } - + // sort the vector of identifiers to be able to use std::lower_bound to find hashes + std::sort(m_module_vec.begin(), m_module_vec.end()); return (0); } @@ -569,7 +570,8 @@ int MuonIdHelper::init_detectorElement_hashes(void) { m_detectorElement_vec[nids] = (*first); nids++; } - + // sort the vector of identifiers to be able to use std::lower_bound to find hashes + std::sort(m_detectorElement_vec.begin(), m_detectorElement_vec.end()); return (0); } @@ -620,7 +622,8 @@ int MuonIdHelper::init_channel_hashes(void) { << endmsg; return (1); } - + // sort the vector of identifiers to be able to use std::lower_bound to find hashes + std::sort(m_channel_vec.begin(), m_channel_vec.end()); return (0); } diff --git a/MuonSpectrometer/MuonIdHelpers/src/MuonIdHelperTool.cxx b/MuonSpectrometer/MuonIdHelpers/src/MuonIdHelperTool.cxx index 65bdfdcea1a07be0bc9e252664568cf8f0d264fa..23b109dcb005bae5ad62481cbeb10994f3c30369 100644 --- a/MuonSpectrometer/MuonIdHelpers/src/MuonIdHelperTool.cxx +++ b/MuonSpectrometer/MuonIdHelpers/src/MuonIdHelperTool.cxx @@ -35,7 +35,6 @@ namespace Muon { ATH_MSG_WARNING(" Cannot retrieve CscIdHelper, please consider setting HasCSC property to false in the future when running a layout without CSC chambers"); m_hasCSC = false; m_cscIdHelper = nullptr; - } } else m_cscIdHelper = nullptr; if ( detStore()->retrieve( m_rpcIdHelper ).isFailure() ) { diff --git a/MuonSpectrometer/MuonReconstruction/MuonPatternFinders/MuonPatternFinderTools/MuonHoughPatternTools/src/MuonLayerHoughTool.cxx b/MuonSpectrometer/MuonReconstruction/MuonPatternFinders/MuonPatternFinderTools/MuonHoughPatternTools/src/MuonLayerHoughTool.cxx index cd2517643afaa704c65a712fbdd0aa6864c314b0..fb1125527feeea3046d799dfff9cb0f4ed7879f4 100644 --- a/MuonSpectrometer/MuonReconstruction/MuonPatternFinders/MuonPatternFinderTools/MuonHoughPatternTools/src/MuonLayerHoughTool.cxx +++ b/MuonSpectrometer/MuonReconstruction/MuonPatternFinders/MuonPatternFinderTools/MuonHoughPatternTools/src/MuonLayerHoughTool.cxx @@ -2284,35 +2284,41 @@ namespace Muon { } // loop over all available CSC collection identifiers and order them per sector - it = m_muonIdHelperTool->cscIdHelper().module_begin(); - it_end = m_muonIdHelperTool->cscIdHelper().module_end(); - for( ;it!=it_end; ++it ){ - IdentifierHash hash; - m_muonIdHelperTool->cscIdHelper().get_module_hash(*it,hash); - insertHash(hash,*it); + if (m_muonIdHelperTool->hasCSC()) { + it = m_muonIdHelperTool->cscIdHelper().module_begin(); + it_end = m_muonIdHelperTool->cscIdHelper().module_end(); + for( ;it!=it_end; ++it ){ + IdentifierHash hash; + m_muonIdHelperTool->cscIdHelper().get_module_hash(*it,hash); + insertHash(hash,*it); + } } // loop over all available MM collection identifiers and order them per sector - it = m_muonIdHelperTool->mmIdHelper().detectorElement_begin(); - it_end = m_muonIdHelperTool->mmIdHelper().detectorElement_end(); - for( ;it!=it_end; ++it ){ - IdentifierHash hash; - m_muonIdHelperTool->mmIdHelper().get_module_hash(*it,hash); - insertHash(hash,*it); + if (m_muonIdHelperTool->hasMM()) { + it = m_muonIdHelperTool->mmIdHelper().detectorElement_begin(); + it_end = m_muonIdHelperTool->mmIdHelper().detectorElement_end(); + for( ;it!=it_end; ++it ){ + IdentifierHash hash; + m_muonIdHelperTool->mmIdHelper().get_module_hash(*it,hash); + insertHash(hash,*it); + } } // loop over all available STGC collection identifiers and order them per sector - it = m_muonIdHelperTool->stgcIdHelper().detectorElement_begin(); - it_end = m_muonIdHelperTool->stgcIdHelper().detectorElement_end(); - for( ;it!=it_end; ++it ){ - IdentifierHash hash; - m_muonIdHelperTool->stgcIdHelper().get_module_hash(*it,hash); - int sector = m_muonIdHelperTool->sector(*it); - insertHash(sector,hash,*it); - int sectorU = sector != 1 ? sector-1 : 16; - int sectorD = sector != 16 ? sector+1 : 1; - insertHash(sectorU,hash,*it); - insertHash(sectorD,hash,*it); + if (m_muonIdHelperTool->hasSTgc()) { + it = m_muonIdHelperTool->stgcIdHelper().detectorElement_begin(); + it_end = m_muonIdHelperTool->stgcIdHelper().detectorElement_end(); + for( ;it!=it_end; ++it ){ + IdentifierHash hash; + m_muonIdHelperTool->stgcIdHelper().get_module_hash(*it,hash); + int sector = m_muonIdHelperTool->sector(*it); + insertHash(sector,hash,*it); + int sectorU = sector != 1 ? sector-1 : 16; + int sectorD = sector != 16 ? sector+1 : 1; + insertHash(sectorU,hash,*it); + insertHash(sectorD,hash,*it); + } } // loop over all available TGC collection identifiers and order them per sector diff --git a/MuonSpectrometer/MuonReconstruction/MuonRecExample/python/MooreTools.py b/MuonSpectrometer/MuonReconstruction/MuonRecExample/python/MooreTools.py index fa3aad58c5cfa173b6a5a9da0d11a969b9fa76eb..6f36e7242dbef588f8c8088254e6a0cc40273aeb 100644 --- a/MuonSpectrometer/MuonReconstruction/MuonRecExample/python/MooreTools.py +++ b/MuonSpectrometer/MuonReconstruction/MuonRecExample/python/MooreTools.py @@ -35,6 +35,8 @@ from MuonRecUtils import logMuon,ConfiguredBase,ExtraFlags from MuonRecFlags import muonRecFlags from MuonStandaloneFlags import muonStandaloneFlags +from AtlasGeoModel.MuonGMJobProperties import MuonGeometryFlags +from AtlasGeoModel.CommonGMJobProperties import CommonGeometryFlags #============================================================== # call setDefaults to update flags @@ -118,8 +120,8 @@ class MooSegmentCombinationFinder(CfgMgr.Muon__MooSegmentCombinationFinder,Confi kwargs.setdefault( "Csc2dSegmentMaker","Csc2dSegmentMaker" ) kwargs.setdefault( "Csc4dSegmentMaker", "Csc4dSegmentMaker" ) else: - kwargs.setdefault( "Csc2dSegmentMaker", None ) - kwargs.setdefault( "Csc4dSegmentMaker", None ) + kwargs.setdefault( "Csc2dSegmentMaker", "" ) + kwargs.setdefault( "Csc4dSegmentMaker", "" ) if muonStandaloneFlags.printSummary(): kwargs.setdefault( "DoSummary", True ) @@ -333,9 +335,9 @@ def MuonSeededSegmentFinder(name="MuonSeededSegmentFinder",**kwargs): kwargs.setdefault("SegmentMaker", segMaker) kwargs.setdefault("SegmentMakerNoHoles", segMaker) - if muonRecFlags.doNSWNewThirdChain(): + if not MuonGeometryFlags.hasCSC(): kwargs.setdefault("CscPrepDataContainer","") - else: + if not (CommonGeometryFlags.Run() in ["RUN3", "RUN4"]): kwargs.setdefault("sTgcPrepDataContainer","") kwargs.setdefault("MMPrepDataContainer","") @@ -346,7 +348,7 @@ def MuonSeededSegmentFinder(name="MuonSeededSegmentFinder",**kwargs): def MuonRefitTool(name,**kwargs): if not muonRecFlags.doCSCs(): - kwargs["CscRotCreator"] = None + kwargs["CscRotCreator"] = "" # To activate the tuning of meas. errors using alignment constants from DB # kwargs.setdefault("AlignmentErrorTool", getPublicTool("MuonAlignmentErrorTool")) # kwargs.setdefault("DeweightBEE", False) @@ -363,7 +365,8 @@ def MuonErrorOptimisationTool(name,extraFlags=None,**kwargs): fitter=getattr(extraFlags,"Fitter",None) if fitter is not None: cloneArgs["Fitter"] = fitter - + if not MuonGeometryFlags.hasCSC(): + cloneArgs["CscRotCreator"] = "" if "RefitTool" not in kwargs: if namePrefix or namePostfix: cloneName = namePrefix+"MuonRefitTool"+namePostfix @@ -403,19 +406,20 @@ def MuonChamberHoleRecoveryTool(name="MuonChamberHoleRecoveryTool",extraFlags=No if doSegmentT0Fit: kwargs.setdefault("AddMeasurements", False) - if muonRecFlags.doCSCs: + if muonRecFlags.doCSCs(): if muonRecFlags.enableErrorTuning() or globalflags.DataSource() == 'data': kwargs.setdefault("CscRotCreator","CscBroadClusterOnTrackCreator") else: kwargs.setdefault("CscRotCreator","CscClusterOnTrackCreator") else: # no CSCs # switch off whatever is set - kwargs["CscRotCreator"] = None + kwargs["CscRotCreator"] = "" + kwargs["CscPrepDataContainer"] = "" # add in missing C++ dependency. TODO: fix in C++ getPublicTool("ResidualPullCalculator") - if not muonRecFlags.doNSWNewThirdChain(): + if (CommonGeometryFlags.Run() in ["RUN3", "RUN4"]): kwargs.setdefault("sTgcPrepDataContainer","") kwargs.setdefault("MMPrepDataContainer","") @@ -521,7 +525,10 @@ getPublicTool("MCTBFitter") getPublicTool("MCTBSLFitter") getPublicTool("MCTBFitterMaterialFromTrack") getPublicTool("MuonSeededSegmentFinder") -getPublicTool("MuonChamberHoleRecoveryTool") +mCHRT = getPublicTool("MuonChamberHoleRecoveryTool") +if not MuonGeometryFlags.hasCSC(): + mCHRT.CscRotCreator = "" + mCHRT.CscPrepDataContainer = "" getPublicTool("MuonTrackSelectorTool") getPublicTool("MuonTrackExtrapolationTool") getPublicTool("MuonSegmentRegionRecoveryTool") diff --git a/MuonSpectrometer/MuonReconstruction/MuonRecExample/python/MuPatTools.py b/MuonSpectrometer/MuonReconstruction/MuonRecExample/python/MuPatTools.py index 18c6af537e434977fce6523e70d43a0e553d0225..a324bef94d25d420d3bc4d7ce2b5ec575cb88a00 100644 --- a/MuonSpectrometer/MuonReconstruction/MuonRecExample/python/MuPatTools.py +++ b/MuonSpectrometer/MuonReconstruction/MuonRecExample/python/MuPatTools.py @@ -23,6 +23,7 @@ from MuonStandaloneFlags import muonStandaloneFlags from MuonRecUtils import logMuon,ConfiguredBase from AthenaCommon.CfgGetter import getPrivateTool,getPrivateToolClone,getPublicTool,getPublicToolClone,getService,getServiceClone +from AtlasGeoModel.MuonGMJobProperties import MuonGeometryFlags #============================================================== @@ -34,6 +35,8 @@ class MuPatCandidateTool(CfgMgr.Muon__MuPatCandidateTool,ConfiguredBase): def __init__(self,name='MuPatCandidateTool',**kwargs): self.applyUserDefaults(kwargs,name) + if not MuonGeometryFlags.hasCSC(): + kwargs["CscRotCreator"] = "" super(MuPatCandidateTool,self).__init__(name,**kwargs) MuPatCandidateTool.setDefaultProperties( SegmentExtender = "" ) @@ -46,13 +49,13 @@ class MuPatHitTool(CfgMgr.Muon__MuPatHitTool,ConfiguredBase): self.applyUserDefaults(kwargs,name) if not muonRecFlags.doCSCs(): # overwrite whatever is set - kwargs["CscRotCreator"] = None + kwargs["CscRotCreator"] = "" super(MuPatHitTool,self).__init__(name,**kwargs) getPublicTool("ResidualPullCalculator") MuPatHitTool.setDefaultProperties( - CscRotCreator = "FixedErrorMuonClusterOnTrackCreator" , + CscRotCreator = ("FixedErrorMuonClusterOnTrackCreator" if MuonGeometryFlags.hasCSC() else ""), MdtRotCreator = "MdtDriftCircleOnTrackCreatorPreFit" ) # end of class MuPatHitTool diff --git a/MuonSpectrometer/MuonReconstruction/MuonRecExample/python/MuonRecExampleConfigDb.py b/MuonSpectrometer/MuonReconstruction/MuonRecExample/python/MuonRecExampleConfigDb.py index 5b57f848d9a515b3e27756987a272f91e517f25f..60d718995f97a74a0d2a01b1a3d01b58387b2c51 100644 --- a/MuonSpectrometer/MuonReconstruction/MuonRecExample/python/MuonRecExampleConfigDb.py +++ b/MuonSpectrometer/MuonReconstruction/MuonRecExample/python/MuonRecExampleConfigDb.py @@ -8,6 +8,9 @@ from AthenaCommon.CfgGetter import addTool, addToolClone, addService, addAlgorit from AthenaCommon.Constants import * # FATAL,ERROR etc. +from AtlasGeoModel.CommonGMJobProperties import CommonGeometryFlags +from AtlasGeoModel.MuonGMJobProperties import MuonGeometryFlags + addNamesToSkipIfNotAvailable( "MuonIsolationTool" ) addTypesOnlyToSkip( "ICaloNoiseTool" ) @@ -60,7 +63,7 @@ addTool("MuonRecExample.MuonRecTools.MuonStraightLineExtrapolator", "MuonStraigh addTool("Trk::KalmanUpdator", "MuonMeasUpdator") -addTool("Muon::MuonIdHelperTool", "MuonIdHelperTool") +addTool("Muon::MuonIdHelperTool", "MuonIdHelperTool", HasCSC=MuonGeometryFlags.hasCSC(), HasSTgc=(CommonGeometryFlags.Run() in ["RUN3", "RUN4"]), HasMM=(CommonGeometryFlags.Run() in ["RUN3", "RUN4"])) addTool("Muon::MuonTrackTruthTool", "MuonTrackTruthTool") @@ -72,10 +75,7 @@ addTool("MuonRecExample.MuonRecTools.MuonEDMPrinterTool", "MuonEDMPrinterTool") addTool("MuonRecExample.MuonRecTools.MuonKalmanTrackFitter","MuonKalmanTrackFitter") -# TODO: this should be cleaned up: all clients should use one and the same MuonTrackSummaryTool instance name -# currently both names are used (with and without the "Tool" ending -addTool("MuonRecExample.MuonRecTools.MuonTrackSummaryHelper","MuonTrackSummaryHelper") -addTool("MuonRecExample.MuonRecTools.MuonTrackSummaryHelper","MuonTrackSummaryHelperTool") +addTool("MuonRecExample.MuonRecTools.MuonTrackSummaryHelperTool","MuonTrackSummaryHelperTool") addTool("MuonRecExample.MuonRecTools.MuonTrackSummaryTool","MuonTrackSummaryTool") @@ -85,7 +85,7 @@ addTool( "MuonRecExample.MuonRecTools.MuonChi2TrackFitter", "MuonChi2TrackFitter addTool( "MuonRecExample.MuonRecTools.MuonChi2TrackFitter", "MuonChi2SLTrackFitter", StraightLine=True ) addTool( "MuonRecExample.MuonRecTools.MuonSegmentMomentum", "MuonSegmentMomentum" ) -addTool( "MuonRecExample.MuonRecTools.MuonSegmentMomentumFromField", "MuonSegmentMomentumFromField" ) +addTool( "MuonRecExample.MuonRecTools.MuonSegmentMomentumFromField", "MuonSegmentMomentumFromField", HasCSC=MuonGeometryFlags.hasCSC(), HasSTgc=(CommonGeometryFlags.Run() in ["RUN3", "RUN4"])) addTool( "MuonRecExample.MuonRecTools.MuonPhiHitSelector", "MuonPhiHitSelector" ) @@ -121,12 +121,12 @@ addTool("Trk::ResidualPullCalculator","ResidualPullCalculator", addTool( "MuonRecExample.MuonPrdProviderToolsConfig.RpcPrepDataProviderTool", "RpcPrepDataProviderTool" ) addTool( "MuonRecExample.MuonPrdProviderToolsConfig.MdtPrepDataProviderTool", "MdtPrepDataProviderTool" ) addTool( "MuonRecExample.MuonPrdProviderToolsConfig.TgcPrepDataProviderTool", "TgcPrepDataProviderTool" ) -addTool( "MuonRecExample.MuonPrdProviderToolsConfig.CscPrepDataProviderTool", "CscPrepDataProviderTool" ) -addTool( "MuonRecExample.MuonPrdProviderToolsConfig.MM_PrepDataProviderTool", "MM_PrepDataProviderTool" ) -addTool( "MuonRecExample.MuonPrdProviderToolsConfig.STGC_PrepDataProviderTool", "STGC_PrepDataProviderTool" ) - -#addAlgorithm("MuonRecExample.MuonPrdProviderToolsConfig.CscRdoToCscPrepData", "CscRdoToCscPrepData") - +if MuonGeometryFlags.hasCSC(): + addTool( "MuonRecExample.MuonPrdProviderToolsConfig.CscPrepDataProviderTool", "CscPrepDataProviderTool" ) + addAlgorithm("MuonRecExample.MuonPrdProviderToolsConfig.CscRdoToCscPrepData", "CscRdoToCscPrepData") +if (CommonGeometryFlags.Run() in ["RUN3", "RUN4"]): + addTool( "MuonRecExample.MuonPrdProviderToolsConfig.MM_PrepDataProviderTool", "MM_PrepDataProviderTool" ) + addTool( "MuonRecExample.MuonPrdProviderToolsConfig.STGC_PrepDataProviderTool", "STGC_PrepDataProviderTool" ) ################################################################################ # Tools from MuonRecExample.MooreTools @@ -153,7 +153,8 @@ addToolClone("MdtMathSegmentFinder", "MCTBMdtMathSegmentFinder", UseChamberTheta addTool("MuonRecExample.MooreTools.MuonSeededSegmentFinder", "MuonSeededSegmentFinder") -addTool( "MuonRecExample.MooreTools.MuonRefitTool", "MuonRefitTool") +addTool( "MuonRecExample.MooreTools.MuonRefitTool", "MuonRefitTool", CscRotCreator=("Muon::CscClusterOnTrackCreator/CscClusterOnTrackCreator" if MuonGeometryFlags.hasCSC() else "")) + addTool("MuonRecExample.MooreTools.MuonErrorOptimisationTool","MuonErrorOptimisationTool") @@ -162,12 +163,11 @@ addTool( "MuonRecExample.MooreTools.MuonTrackCleaner", "MuonTrackCleaner" ) addToolClone( "MuonClusterOnTrackCreator", "FixedErrorMuonClusterOnTrackCreator", DoFixedErrorCscEta = True, FixedErrorCscEta = .5 ) -addTool( "MuonRecExample.MuonRecTools.CscClusterOnTrackCreator", "CscClusterOnTrackCreator" ) - +if MuonGeometryFlags.hasCSC(): + addTool( "MuonRecExample.MuonRecTools.CscClusterOnTrackCreator", "CscClusterOnTrackCreator" ) + addTool( "MuonRecExample.MuonRecTools.CscBroadClusterOnTrackCreator", "CscBroadClusterOnTrackCreator" ) -addTool( "MuonRecExample.MuonRecTools.CscBroadClusterOnTrackCreator", "CscBroadClusterOnTrackCreator" ) - -addTool( "MuonRecExample.MooreTools.MuonChamberHoleRecoveryTool", "MuonChamberHoleRecoveryTool" ) +addTool( "MuonRecExample.MooreTools.MuonChamberHoleRecoveryTool", "MuonChamberHoleRecoveryTool", CscRotCreator=("Muon::CscClusterOnTrackCreator/CscClusterOnTrackCreator" if MuonGeometryFlags.hasCSC() else ""), CscPrepDataContainer=("CSC_Clusters" if MuonGeometryFlags.hasCSC() else "")) addTool( "MuonRecExample.MooreTools.MuonSegmentRegionRecoveryTool", "MuonSegmentRegionRecoveryTool" ) @@ -209,21 +209,21 @@ addTool( "MuonRecExample.MooreTools.MooTrackFitter", "MooSLTrackFitter", addTool( "MuonRecExample.MooreTools.MooTrackBuilder", "MooTrackBuilderTemplate") +if MuonGeometryFlags.hasCSC(): + addTool("MuonRecExample.CscTools.CscAlignmentTool","CscAlignmentTool") + addTool("MuonRecExample.CscTools.CscClusterUtilTool","CscClusterUtilTool") + addTool("MuonRecExample.CscTools.QratCscClusterFitter","QratCscClusterFitter") + addTool("MuonRecExample.CscTools.CscPeakThresholdClusterBuilderTool","CscPeakThresholdClusterBuilderTool") + addTool("MuonRecExample.CscTools.CscThresholdClusterBuilderTool","CscThresholdClusterBuilderTool") + addTool("MuonRecExample.CscTools.CalibCscStripFitter","CalibCscStripFitter") + addTool("MuonRecExample.CscTools.SimpleCscClusterFitter","SimpleCscClusterFitter") + addTool("MuonRecExample.CscTools.CscSplitClusterFitter","CscSplitClusterFitter") + + addTool("MuonRecExample.CscTools.Csc2dSegmentMaker","Csc2dSegmentMaker") + addTool("MuonRecExample.CscTools.Csc4dSegmentMaker","Csc4dSegmentMaker") + addTool("MuonRecExample.CscTools.CscSegmentUtilTool","CscSegmentUtilTool") -addTool("MuonRecExample.CscTools.CscAlignmentTool","CscAlignmentTool") -addTool("MuonRecExample.CscTools.CscClusterUtilTool","CscClusterUtilTool") -addTool("MuonRecExample.CscTools.QratCscClusterFitter","QratCscClusterFitter") -addTool("MuonRecExample.CscTools.CscPeakThresholdClusterBuilderTool","CscPeakThresholdClusterBuilderTool") -addTool("MuonRecExample.CscTools.CscThresholdClusterBuilderTool","CscThresholdClusterBuilderTool") -addTool("MuonRecExample.CscTools.CalibCscStripFitter","CalibCscStripFitter") -addTool("MuonRecExample.CscTools.SimpleCscClusterFitter","SimpleCscClusterFitter") -addTool("MuonRecExample.CscTools.CscSplitClusterFitter","CscSplitClusterFitter") - -addTool("MuonRecExample.CscTools.Csc2dSegmentMaker","Csc2dSegmentMaker") -addTool("MuonRecExample.CscTools.Csc4dSegmentMaker","Csc4dSegmentMaker") -addTool("MuonRecExample.CscTools.CscSegmentUtilTool","CscSegmentUtilTool") - -addAlgorithm("MuonRecExample.CscTools.CscThresholdClusterBuilder","CscThresholdClusterBuilder") + addAlgorithm("MuonRecExample.CscTools.CscThresholdClusterBuilder","CscThresholdClusterBuilder") ################################################################################ # Tools from MuonRecExample.NSWTools (NSW - MicroMegas and STgc reconstruction tools) @@ -236,9 +236,9 @@ addTool("MuonRecExample.NSWTools.SimpleSTgcClusterBuilderTool","SimpleSTgcCluste # Tools from MuonRecExample.MuPatTools ################################################################################ -addTool( "MuonRecExample.MuPatTools.MuPatCandidateTool","MuPatCandidateTool") +addTool( "MuonRecExample.MuPatTools.MuPatCandidateTool","MuPatCandidateTool", CscRotCreator=("Muon::CscClusterOnTrackCreator/CscClusterOnTrackCreator" if MuonGeometryFlags.hasCSC() else "")) -addTool( "MuonRecExample.MuPatTools.MuPatHitTool", "MuPatHitTool" ) +addTool( "MuonRecExample.MuPatTools.MuPatHitTool", "MuPatHitTool", CscRotCreator=("Muon::CscClusterOnTrackCreator/CscClusterOnTrackCreator" if MuonGeometryFlags.hasCSC() else "")) ################################################################################ diff --git a/MuonSpectrometer/MuonReconstruction/MuonRecExample/python/MuonRecFlags.py b/MuonSpectrometer/MuonReconstruction/MuonRecExample/python/MuonRecFlags.py index 99b0c627f50ab77917594dda53e98396f24e30ac..5b40f2398a4775ea55197cb104fc88af9f1b8a16 100644 --- a/MuonSpectrometer/MuonReconstruction/MuonRecExample/python/MuonRecFlags.py +++ b/MuonSpectrometer/MuonReconstruction/MuonRecExample/python/MuonRecFlags.py @@ -30,18 +30,11 @@ class doVP1(JobProperty): allowedTypes=['bool'] StoredValue=False - ## Run the integrated muon reconstruction algorithm class doStandalone(JobProperty): statusOn=True allowedTypes=['bool'] StoredValue=True - -## Run the new third chain configuration for the NSW -class doNSWNewThirdChain(JobProperty): - StatusOn=True - allowedType=['bool'] - StoredValue=False ## Run clusterization class doCreateClusters(JobProperty): @@ -257,7 +250,7 @@ class doTGCs(JobProperty): class dosTGCs(JobProperty): statusOn=True allowedTypes=['bool'] - StoredValue=False # Off by default until it can be autoconfigured + StoredValue=True def _do_action(self): muonRecFlags.sync_DetFlags("sTGC") @@ -269,7 +262,7 @@ class dosTGCs(JobProperty): class doMicromegas(JobProperty): statusOn=True allowedTypes=['bool'] - StoredValue=False # Off by default until it can be autoconfigured + StoredValue=True def _do_action(self): muonRecFlags.sync_DetFlags("Micromegas") @@ -412,6 +405,8 @@ class MuonRec(JobPropertyContainer): setDefault(self.doRPCs,True) setDefault(self.doTGCs,True) setDefault(self.doCSCs,True) + setDefault(self.dosTGCs,True) + setDefault(self.doMicromegas,True) setDefault(self.doMSVertex,True) setDefault(self.useWireSagCorrections,False) setDefault(self.enableErrorTuning,True) @@ -474,7 +469,7 @@ class MuonRec(JobPropertyContainer): ## @brief Synchronise Muon DetFlags with MuonRecFlags and RecFlags ## ## @arg @c technologies is string with comma separated list of technologies to include in the update. Default="MDT,RPC,CSC,TGC" - def sync_DetFlags(self,technologies="MDT,RPC,CSC,TGC"): + def sync_DetFlags(self,technologies="MDT,RPC,CSC,TGC,sTGC,Micromegas"): self.setDefaults() global rec from AthenaCommon.DetFlags import DetFlags @@ -559,6 +554,8 @@ class MuonRec(JobPropertyContainer): RPC_on = self.doRPCs() CSC_on = self.doCSCs() TGC_on = self.doTGCs() + sTGC_on = self.dosTGCs() + Micromegas_on = self.doMicromegas() techList = technologies.split(',') for f in flagsOn: for tech in techList: diff --git a/MuonSpectrometer/MuonReconstruction/MuonRecExample/python/MuonRecTools.py b/MuonSpectrometer/MuonReconstruction/MuonRecExample/python/MuonRecTools.py index 0b61ca4db4d8f8680bc8c2b27211f488b7414d8a..f652f639d221c06af4f644387bb12f0db3d4840e 100644 --- a/MuonSpectrometer/MuonReconstruction/MuonRecExample/python/MuonRecTools.py +++ b/MuonSpectrometer/MuonReconstruction/MuonRecExample/python/MuonRecTools.py @@ -33,6 +33,8 @@ from AthenaCommon.CfgGetter import getPrivateTool,getPrivateToolClone,getPublicT # temporarily for backwards compat. TO BE REMOVED from AthenaCommon.CfgGetter import addTool,addToolClone,addService +from AtlasGeoModel.CommonGMJobProperties import CommonGeometryFlags +from AtlasGeoModel.MuonGMJobProperties import MuonGeometryFlags #-------------------------------------------------------------------------------- # Hit-on-track creation tools @@ -231,6 +233,13 @@ def MuonExtrapolator(name='MuonExtrapolator',**kwargs): return CfgMgr.Trk__Extrapolator(name,**kwargs) # end of factory function MuonExtrapolator +def MuonIdHelperTool(name="MuonIdHelperTool",**kwargs): + from MuonIdHelpers.MuonIdHelpersConf import Muon__MuonIdHelperTool + kwargs.setdefault("HasCSC", MuonGeometryFlags.hasCSC()) + kwargs.setdefault("HasSTgc", (CommonGeometryFlags.Run() in ["RUN3", "RUN4"])) + kwargs.setdefault("HasMM", (CommonGeometryFlags.Run() in ["RUN3", "RUN4"])) + return Muon__MuonIdHelperTool(name,**kwargs) + def MuonStraightLineExtrapolator(name="MuonStraightLineExtrapolator",**kwargs): kwargs.setdefault("Propagators",["Trk::STEP_Propagator/MuonStraightLinePropagator"]) kwargs.setdefault("STEP_Propagator","Trk::STEP_Propagator/MuonStraightLinePropagator") @@ -252,12 +261,12 @@ class MuonEDMPrinterTool(Muon__MuonEDMPrinterTool,ConfiguredBase): def __init__(self,name='MuonEDMPrinterTool',**kwargs): self.applyUserDefaults(kwargs,name) super(MuonEDMPrinterTool,self).__init__(name,**kwargs) - getPublicTool("MuonIdHelperTool") + kwargs.setdefault("MuonIdHelperTool", "MuonIdHelperTool") getService("MuonEDMHelperSvc") # end of class MuonEDMPrinterTool -def MuonTrackSummaryHelper(name="MuonTrackSummaryHelper",**kwargs): +def MuonTrackSummaryHelperTool(name="MuonTrackSummaryHelperTool",**kwargs): AtlasTrackingGeometrySvc = getService("AtlasTrackingGeometrySvc") kwargs.setdefault("TrackingGeometryName", AtlasTrackingGeometrySvc.TrackingGeometryName) kwargs.setdefault("DoHolesOnTrack", False) @@ -275,7 +284,7 @@ class MuonTrackSummaryTool(Trk__TrackSummaryTool,ConfiguredBase): def __init__(self,name="MuonTrackSummaryTool",**kwargs): self.applyUserDefaults(kwargs,name) - kwargs.setdefault("MuonSummaryHelperTool", "MuonTrackSummaryHelper" ) + kwargs.setdefault("MuonSummaryHelperTool", "MuonTrackSummaryHelperTool" ) kwargs.setdefault("doSharedHits", False ) kwargs.setdefault("AddDetailedMuonSummary", True ) super(MuonTrackSummaryTool,self).__init__(name,**kwargs) @@ -462,8 +471,9 @@ if DetFlags.detdescr.Muon_on() and rec.doMuon(): getPublicTool("MuonEDMPrinterTool") getPublicTool("MuonSegmentMomentum") getPublicTool("MuonClusterOnTrackCreator") - getPrivateTool("CscClusterOnTrackCreator") - getPrivateTool("CscBroadClusterOnTrackCreator") + if MuonGeometryFlags.hasCSC(): + getPrivateTool("CscClusterOnTrackCreator") + getPrivateTool("CscBroadClusterOnTrackCreator") getPublicTool("MdtDriftCircleOnTrackCreator") getPublicTool("MdtTubeHitOnTrackCreator") diff --git a/MuonSpectrometer/MuonReconstruction/MuonRecExample/python/MuonStandalone.py b/MuonSpectrometer/MuonReconstruction/MuonRecExample/python/MuonStandalone.py index ff4dc1f73473a958e177f191e7d2dcb30adf05c4..97bec01feb792b51f87906d26af035d3d7002582 100644 --- a/MuonSpectrometer/MuonReconstruction/MuonRecExample/python/MuonStandalone.py +++ b/MuonSpectrometer/MuonReconstruction/MuonRecExample/python/MuonStandalone.py @@ -22,6 +22,8 @@ from AthenaCommon.CfgGetter import getPublicTool,getPublicToolClone,getPrivateTo from RecExConfig.ObjKeyStore import cfgKeyStore import sys + +from AtlasGeoModel.MuonGMJobProperties import MuonGeometryFlags #============================================================== # call setDefaults to update default flags @@ -85,7 +87,9 @@ class MuonStandalone(ConfiguredMuonRec): if muonStandaloneFlags.segmentOrigin == 'TruthTracking': SegmentLocation = "ThirdChainSegments" - if muonRecFlags.doNSWNewThirdChain(): + # we assume that RUN3 or RUN4 means that at least one sTgc and one MM chamber is present + from AtlasGeoModel.CommonGMJobProperties import CommonGeometryFlags + if (CommonGeometryFlags.Run() in ["RUN3", "RUN4"]): getPublicTool("MuonLayerHoughTool") self.addAlg( CfgMgr.MuonLayerHoughAlg( "MuonLayerHoughAlg", PrintSummary = muonStandaloneFlags.printSummary() ) ) if not muonStandaloneFlags.patternsOnly(): @@ -102,17 +106,18 @@ class MuonStandalone(ConfiguredMuonRec): MuonPatternSegmentMaker = getPublicTool("MuonPatternSegmentMaker"), MuonTruthSummaryTool = None, PrintSummary = muonStandaloneFlags.printSummary() ) - if( muonRecFlags.doCSCs() ): + # we check whether the layout contains any CSC chamber and if yes, we check that the user also wants to use the CSCs in reconstruction + if MuonGeometryFlags.hasCSC() and muonRecFlags.doCSCs(): getPublicTool("CscSegmentUtilTool") getPublicTool("Csc2dSegmentMaker") getPublicTool("Csc4dSegmentMaker") else: - MuonSegmentFinderAlg.Csc2dSegmentMaker = None - MuonSegmentFinderAlg.Csc4dSegmentMaker = None + MuonSegmentFinderAlg.Csc2dSegmentMaker = "" + MuonSegmentFinderAlg.Csc4dSegmentMaker = "" self.addAlg( MuonSegmentFinderAlg ) else: getPublicTool("MuonLayerHoughTool") - self.addAlg( CfgMgr.MooSegmentFinderAlg( "MuonSegmentMaker", + self.addAlg( CfgMgr.MooSegmentFinderAlg("MuonSegmentMaker", SegmentFinder = getPublicToolClone("MuonSegmentFinder","MooSegmentFinder", DoSummary=muonStandaloneFlags.printSummary()), MuonClusterSegmentFinderTool=getPublicTool("MuonClusterSegmentFinder"), @@ -128,15 +133,15 @@ class MuonStandalone(ConfiguredMuonRec): self.addAlg(CfgMgr.MooSegmentFinderAlg("MuonSegmentMaker_NCB", SegmentFinder = getPublicToolClone("MooSegmentFinder_NCB","MuonSegmentFinder", - DoSummary=False, - Csc2dSegmentMaker = getPublicToolClone("Csc2dSegmentMaker_NCB","Csc2dSegmentMaker", + DoSummary=False, + Csc2dSegmentMaker = (getPublicToolClone("Csc2dSegmentMaker_NCB","Csc2dSegmentMaker", segmentTool = getPublicToolClone("CscSegmentUtilTool_NCB", "CscSegmentUtilTool", TightenChi2 = False, - IPconstraint=False)), - Csc4dSegmentMaker = getPublicToolClone("Csc4dSegmentMaker_NCB","Csc4dSegmentMaker", - segmentTool = getPublicTool("CscSegmentUtilTool_NCB")), - DoMdtSegments=False,DoSegmentCombinations=False,DoSegmentCombinationCleaning=False), + IPconstraint=False)) if MuonGeometryFlags.hasCSC() else ""), + Csc4dSegmentMaker = (getPublicToolClone("Csc4dSegmentMaker_NCB","Csc4dSegmentMaker", + segmentTool = getPublicTool("CscSegmentUtilTool_NCB")) if MuonGeometryFlags.hasCSC() else ""), + DoMdtSegments=False,DoSegmentCombinations=False,DoSegmentCombinationCleaning=False), MuonPatternCombinationLocation = "NCB_MuonHoughPatternCombinations", MuonSegmentOutputLocation = "NCB_MuonSegments", UseCSC = muonRecFlags.doCSCs(), diff --git a/MuonSpectrometer/MuonReconstruction/MuonRecExample/share/MuonRDO_to_PRD_jobOptions.py b/MuonSpectrometer/MuonReconstruction/MuonRecExample/share/MuonRDO_to_PRD_jobOptions.py index 806c64f6a499ad0da5b23cd7bb9cde8cb0de1031..6bc428a45a8351af496a4d7e323e2e6b0e87026c 100644 --- a/MuonSpectrometer/MuonReconstruction/MuonRecExample/share/MuonRDO_to_PRD_jobOptions.py +++ b/MuonSpectrometer/MuonReconstruction/MuonRecExample/share/MuonRDO_to_PRD_jobOptions.py @@ -19,7 +19,10 @@ beamFlags = jobproperties.Beam from AthenaCommon.CfgGetter import getAlgorithm from MuonRecExample.MuonPrdProviderToolsConfig import RpcPrepDataProviderTool, MdtPrepDataProviderTool, TgcPrepDataProviderTool, CscPrepDataProviderTool -if muonRecFlags.doCSCs() and DetFlags.makeRIO.CSC_on() and (DetFlags.haveRDO.CSC_on() or DetFlags.digitize.CSC_on()): +from AtlasGeoModel.CommonGMJobProperties import CommonGeometryFlags +from AtlasGeoModel.MuonGMJobProperties import MuonGeometryFlags + +if MuonGeometryFlags.hasCSC() and muonRecFlags.doCSCs() and DetFlags.makeRIO.CSC_on() and (DetFlags.haveRDO.CSC_on() or DetFlags.digitize.CSC_on()): topSequence += getAlgorithm("CscRdoToCscPrepData", tryDefaultConfigurable=True) topSequence.CscRdoToCscPrepData.CscRdoToCscPrepDataTool = CscPrepDataProviderTool() @@ -36,11 +39,11 @@ if muonRecFlags.doTGCs() and DetFlags.makeRIO.TGC_on() and (DetFlags.haveRDO.TGC topSequence.TgcRdoToTgcPrepData.DecodingTool = TgcPrepDataProviderTool() if not muonRecFlags.doFastDigitization(): - if muonRecFlags.dosTGCs() and DetFlags.makeRIO.sTGC_on() and (DetFlags.haveRDO.sTGC_on() or DetFlags.digitize.sTGC_on()): - topSequence += getAlgorithm("StgcRdoToStgcPrepData", tryDefaultConfigurable=True) - - if muonRecFlags.doMicromegas() and DetFlags.makeRIO.Micromegas_on() and (DetFlags.haveRDO.Micromegas_on() or DetFlags.digitize.Micromegas_on()): - topSequence += getAlgorithm("MM_RdoToMM_PrepData", tryDefaultConfigurable=True) + if (CommonGeometryFlags.Run() in ["RUN3", "RUN4"]): + if muonRecFlags.dosTGCs() and DetFlags.makeRIO.sTGC_on() and (DetFlags.haveRDO.sTGC_on() or DetFlags.digitize.sTGC_on()): + topSequence += getAlgorithm("StgcRdoToStgcPrepData", tryDefaultConfigurable=True) + if muonRecFlags.doMicromegas() and DetFlags.makeRIO.Micromegas_on() and (DetFlags.haveRDO.Micromegas_on() or DetFlags.digitize.Micromegas_on()): + topSequence += getAlgorithm("MM_RdoToMM_PrepData", tryDefaultConfigurable=True) # # Remove hits from part of the detector to mimic dead channels @@ -48,7 +51,7 @@ if not muonRecFlags.doFastDigitization(): if muonRecFlags.doPrdSelect(): include("MuonPrdSelector/MuonPrdSelector_jobOptions.py") -if muonRecFlags.doCSCs() and DetFlags.makeRIO.CSC_on(): +if MuonGeometryFlags.hasCSC() and muonRecFlags.doCSCs() and DetFlags.makeRIO.CSC_on(): topSequence += getAlgorithm("CscThresholdClusterBuilder") diff --git a/MuonSpectrometer/MuonReconstruction/MuonRecExample/share/MuonRecLoadTools.py b/MuonSpectrometer/MuonReconstruction/MuonRecExample/share/MuonRecLoadTools.py index 079c08c909bee84818bcf27b5c5e1afe1069ef3f..ce6126b5ce9254224b5a1668665adf240c03c239 100644 --- a/MuonSpectrometer/MuonReconstruction/MuonRecExample/share/MuonRecLoadTools.py +++ b/MuonSpectrometer/MuonReconstruction/MuonRecExample/share/MuonRecLoadTools.py @@ -9,7 +9,7 @@ MuonMaterialUpdator = CfgGetter.getPublicTool("MuonMaterialEffectsUpda MuonPropagator = CfgGetter.getPublicTool('MuonPropagator') MuonExtrapolator = CfgGetter.getPublicTool('MuonExtrapolator') MuonMeasUpdator = CfgGetter.getPublicTool('MuonMeasUpdator') -MuonTrackSummaryHelperTool = CfgGetter.getPublicTool("MuonTrackSummaryHelper") +MuonTrackSummaryHelperTool = CfgGetter.getPublicTool("MuonTrackSummaryHelperTool") MuonTrackSummaryTool = CfgGetter.getPublicTool("MuonTrackSummaryTool") AtlasExtrapolator = CfgGetter.getPublicTool("AtlasExtrapolator") MuonChi2TrackFitter = CfgGetter.getPublicTool('MuonChi2TrackFitter') diff --git a/MuonSpectrometer/MuonReconstruction/MuonRecExample/share/MuonRecOutputItemList_jobOptions.py b/MuonSpectrometer/MuonReconstruction/MuonRecExample/share/MuonRecOutputItemList_jobOptions.py index 15e48f63178ce3c9fa0f5c71246bc4822c283e3a..b17a073aa5ef581c0fbfad9935da6c6bd5065143 100644 --- a/MuonSpectrometer/MuonReconstruction/MuonRecExample/share/MuonRecOutputItemList_jobOptions.py +++ b/MuonSpectrometer/MuonReconstruction/MuonRecExample/share/MuonRecOutputItemList_jobOptions.py @@ -3,6 +3,9 @@ from RecExConfig.RecFlags import rec from MuonRecExample.MuonRecFlags import muonRecFlags from AthenaCommon.BeamFlags import jobproperties +from AtlasGeoModel.CommonGMJobProperties import CommonGeometryFlags +from AtlasGeoModel.MuonGMJobProperties import MuonGeometryFlags + #AOD list, also added to the ESD MuonAODList = [] @@ -62,10 +65,10 @@ if DetFlags.detdescr.Muon_on() and rec.doWriteESD(): #PRDs - if muonRecFlags.doNSWNewThirdChain(): + if (CommonGeometryFlags.Run() in ["RUN3", "RUN4"]): MuonESDList+=["Muon::MMPrepDataContainer#MM_Measurements"] MuonESDList+=["Muon::sTgcPrepDataContainer#STGC_Measurements"] - if muonRecFlags.doCSCs: + if MuonGeometryFlags.hasCSC(): MuonESDList+=["Muon::CscPrepDataContainer#CSC_Clusters"] MuonESDList+=["Muon::CscStripPrepDataContainer#CSC_Measurements"] MuonESDList+=["Muon::RpcPrepDataContainer#RPC_Measurements"] @@ -99,12 +102,12 @@ if DetFlags.detdescr.Muon_on() and rec.doWriteESD(): MuonESDList+=["TrackTruthCollection#MuonSpectrometerTracksTruth"] if muonRecFlags.writeSDOs(): - if muonRecFlags.doCSCs: + if MuonGeometryFlags.hasCSC(): MuonESDList+=["CscSimDataCollection#CSC_SDO"] MuonESDList+=["MuonSimDataCollection#MDT_SDO"] MuonESDList+=["MuonSimDataCollection#RPC_SDO"] MuonESDList+=["MuonSimDataCollection#TGC_SDO"] - if muonRecFlags.doNSWNewThirdChain(): + if (CommonGeometryFlags.Run() in ["RUN3", "RUN4"]): MuonESDList+=["MuonSimDataCollection#STGC_SDO"] MuonESDList+=["MuonSimDataCollection#MM_SDO"] diff --git a/MuonSpectrometer/MuonReconstruction/MuonRecExample/share/MuonRec_jobOptions.py b/MuonSpectrometer/MuonReconstruction/MuonRecExample/share/MuonRec_jobOptions.py index 8e5ffcfe8fdd002a49bdf79ad4188f5389f121c9..a65b657cd605803f13985851390dfbc32c4c612f 100644 --- a/MuonSpectrometer/MuonReconstruction/MuonRecExample/share/MuonRec_jobOptions.py +++ b/MuonSpectrometer/MuonReconstruction/MuonRecExample/share/MuonRec_jobOptions.py @@ -14,6 +14,7 @@ from MuonRecExample.MuonRecFlags import muonRecFlags from MuonRecExample.ConfiguredMuonRec import GetConfiguredMuonRec from MuonRecExample.MuonRecUtils import logMuon, logMuonResil from MuonRecExample.MuonStandaloneFlags import muonStandaloneFlags +from MuonRecExample.MuonRecTools import MuonIdHelperTool from AthenaCommon.AlgSequence import AlgSequence from AthenaCommon.AppMgr import ServiceMgr @@ -25,10 +26,23 @@ from RecExConfig.RecAlgsFlags import recAlgs from MuonRecExample.MuonAlignFlags import muonAlignFlags from AthenaCommon.AppMgr import ToolSvc +from AtlasGeoModel.CommonGMJobProperties import CommonGeometryFlags +from AtlasGeoModel.MuonGMJobProperties import MuonGeometryFlags + muonRecFlags.setDefaults() topSequence = AlgSequence() +# ESDtoAOD and AODtoTAG need a configured MuonIdHelperTool (e.g. for the RPC_ResidualPullCalculator) +# Since it is not automatically created by the job configuration (as for RDOtoESD), +# do it here manually (hope this will be fixed with the movement to the new configuration for release 22) +if rec.readESD() or rec.readAOD(): + MuonIdHelperTool() + +if muonRecFlags.doCSCs() and not MuonGeometryFlags.hasCSC(): muonRecFlags.doCSCs = False +if muonRecFlags.dosTGCs() and (CommonGeometryFlags.Run() not in ["RUN3", "RUN4"]): muonRecFlags.dosTGCs = False +if muonRecFlags.doMicromegas() and (CommonGeometryFlags.Run() not in ["RUN3", "RUN4"]): muonRecFlags.doMicromegas = False + if muonRecFlags.doDigitization(): include("MuonRecExample/MuonDigitization_jobOptions.py") @@ -46,7 +60,7 @@ if (rec.readRDO() or rec.readESD()) and muonRecFlags.prdToxAOD(): topSequence += CfgMgr.MDT_PrepDataToxAOD() topSequence += CfgMgr.RPC_PrepDataToxAOD() topSequence += CfgMgr.TGC_PrepDataToxAOD() - topSequence += CfgMgr.CSC_PrepDataToxAOD() + if MuonGeometryFlags.hasCSC(): topSequence += CfgMgr.CSC_PrepDataToxAOD() if muonRecFlags.doCreateClusters(): topSequence += CfgMgr.RPC_PrepDataToxAOD("RPC_ClusterToxAOD",InputContainerName="RPC_Clusters") @@ -67,14 +81,13 @@ if rec.readESD() and DetFlags.readRIOPool.TGC_on(): include("MuonTGC_CnvTools/TgcPrepDataReplicationAlg_jopOptions.py") if muonRecFlags.doFastDigitization(): - - #if DetFlags.Micromegas_on() and DetFlags.digitize.Micromegas_on(): - from MuonFastDigitization.MuonFastDigitizationConf import MM_FastDigitizer - topSequence += MM_FastDigitizer("MM_FastDigitizer") - - #if DetFlags.sTGC_on() and DetFlags.digitize.sTGC_on(): - from MuonFastDigitization.MuonFastDigitizationConf import sTgcFastDigitizer - topSequence += sTgcFastDigitizer("sTgcFastDigitizer") + if CommonGeometryFlags.Run() in ["RUN3", "RUN4"]: + #if DetFlags.Micromegas_on() and DetFlags.digitize.Micromegas_on(): + from MuonFastDigitization.MuonFastDigitizationConf import MM_FastDigitizer + topSequence += MM_FastDigitizer("MM_FastDigitizer") + #if DetFlags.sTGC_on() and DetFlags.digitize.sTGC_on(): + from MuonFastDigitization.MuonFastDigitizationConf import sTgcFastDigitizer + topSequence += sTgcFastDigitizer("sTgcFastDigitizer") # filter TrackRecordCollection (true particles in muon spectrometer) @@ -102,8 +115,9 @@ if rec.doTruth() and DetFlags.makeRIO.Muon_on(): from MCTruthClassifier.MCTruthClassifierConf import MCTruthClassifier from AthenaCommon import CfgGetter topSequence.MuonTruthDecorationAlg.MCTruthClassifier = CfgGetter.getPublicTool(MCTruthClassifier(name="MCTruthClassifier",ParticleCaloExtensionTool="")) - if muonRecFlags.doNSWNewThirdChain(): - topSequence.MuonTruthDecorationAlg.SDOs=["RPC_SDO","TGC_SDO","MDT_SDO","MM_SDO","sTGC_SDO"] + topSequence.MuonTruthDecorationAlg.SDOs=["RPC_SDO","TGC_SDO","MDT_SDO"] + if CommonGeometryFlags.Run() in ["RUN3", "RUN4"]: + topSequence.MuonTruthDecorationAlg.SDOs+=["MM_SDO","sTGC_SDO"] try: from PyUtils.MetaReaderPeeker import metadata @@ -137,7 +151,7 @@ if muonRecFlags.doStandalone(): from TrkTruthAlgs.TrkTruthAlgsConf import TrackTruthSelector from TrkTruthAlgs.TrkTruthAlgsConf import TrackParticleTruthAlg col = "MuonSpectrometerTracks" - topSequence += MuonDetailedTrackTruthMaker(name="MuonStandaloneDetailedTrackTruthMaker", TrackCollectionNames = [col] ) + topSequence += MuonDetailedTrackTruthMaker(name="MuonStandaloneDetailedTrackTruthMaker", TrackCollectionNames = [col], HasCSC=MuonGeometryFlags.hasCSC(), HasSTgc=(CommonGeometryFlags.Run() in ["RUN3", "RUN4"]), HasMM=(CommonGeometryFlags.Run() in ["RUN3", "RUN4"])) topSequence += TrackTruthSelector(name= col + "Selector", DetailedTrackTruthName = col + "DetailedTruth", OutputName = col + "Truth") @@ -145,11 +159,7 @@ if muonRecFlags.doStandalone(): TrackTruthName=col+"Truth", TrackParticleName = "MuonSpectrometerTrackParticles" ) - topSequence += Muon__MuonSegmentTruthAssociationAlg("MuonSegmentTruthAssociationAlg") - - if muonRecFlags.doNSWNewThirdChain(): - topSequence.MuonSegmentTruthAssociationAlg.doNSW=True - topSequence.MuonStandaloneDetailedTrackTruthMaker.doNSW=True + topSequence += Muon__MuonSegmentTruthAssociationAlg("MuonSegmentTruthAssociationAlg", HasCSC=MuonGeometryFlags.hasCSC(), HasSTgc=(CommonGeometryFlags.Run() in ["RUN3", "RUN4"]), HasMM=(CommonGeometryFlags.Run() in ["RUN3", "RUN4"])) try: from PyUtils.MetaReaderPeeker import metadata diff --git a/MuonSpectrometer/MuonReconstruction/MuonRecExample/share/MuonRec_myTopOptions.py b/MuonSpectrometer/MuonReconstruction/MuonRecExample/share/MuonRec_myTopOptions.py index 7376593be5d6c24486425cc68e31b934a2d23fbe..a46b760648ead587f6e53c09be74057b11206a41 100644 --- a/MuonSpectrometer/MuonReconstruction/MuonRecExample/share/MuonRec_myTopOptions.py +++ b/MuonSpectrometer/MuonReconstruction/MuonRecExample/share/MuonRec_myTopOptions.py @@ -74,7 +74,6 @@ muonRecFlags.doTrackPerformance = True muonRecFlags.TrackPerfSummaryLevel = 2 muonRecFlags.TrackPerfDebugLevel = 5 muonRecFlags.doCSCs = True -muonRecFlags.doNSWNewThirdChain = True # flags to tweak standalone muon reconstruction if doMig5: diff --git a/MuonSpectrometer/MuonReconstruction/MuonRecExample/share/MuonRec_myTopOptions_MT.py b/MuonSpectrometer/MuonReconstruction/MuonRecExample/share/MuonRec_myTopOptions_MT.py index dcc289d8dd2caa969d04da1fe38cfaf0490152fc..89d5d42909026e0805451992663c9acad09d7ff6 100644 --- a/MuonSpectrometer/MuonReconstruction/MuonRecExample/share/MuonRec_myTopOptions_MT.py +++ b/MuonSpectrometer/MuonReconstruction/MuonRecExample/share/MuonRec_myTopOptions_MT.py @@ -61,7 +61,6 @@ muonRecFlags.doTrackPerformance = True muonRecFlags.TrackPerfSummaryLevel = 2 muonRecFlags.TrackPerfDebugLevel = 5 muonRecFlags.doCSCs = True -muonRecFlags.doNSWNewThirdChain = False # flags to tweak standalone muon reconstruction if doMig5: diff --git a/MuonSpectrometer/MuonReconstruction/MuonRecExample/share/MuonTrackPerformance_jobOptions.py b/MuonSpectrometer/MuonReconstruction/MuonRecExample/share/MuonTrackPerformance_jobOptions.py index 5e48bcd4efacc2057cc25d09227487851a8de32e..24f3bad94f2dd3e8c92c1c161969e15dbd9a7783 100644 --- a/MuonSpectrometer/MuonReconstruction/MuonRecExample/share/MuonTrackPerformance_jobOptions.py +++ b/MuonSpectrometer/MuonReconstruction/MuonRecExample/share/MuonTrackPerformance_jobOptions.py @@ -15,5 +15,3 @@ if muonRecFlags.doStandalone: DoTruth = rec.doTruth(), DoTrackDebug = muonRecFlags.TrackPerfDebugLevel() ) - if muonRecFlags.doNSWNewThirdChain(): - topSequence.MuonStandalonePerformanceAlg.useNSW=True diff --git a/MuonSpectrometer/MuonReconstruction/MuonTrackMakers/MuonTrackMakerTools/MuonTrackFinderTools/src/MuonChamberHoleRecoveryTool.cxx b/MuonSpectrometer/MuonReconstruction/MuonTrackMakers/MuonTrackMakerTools/MuonTrackFinderTools/src/MuonChamberHoleRecoveryTool.cxx index 382730ed63e4c2c59e9623f21416c15c611bf77d..0f95d2378d14bc2d40cd9e3abec117b0eef67286 100644 --- a/MuonSpectrometer/MuonReconstruction/MuonTrackMakers/MuonTrackMakerTools/MuonTrackFinderTools/src/MuonChamberHoleRecoveryTool.cxx +++ b/MuonSpectrometer/MuonReconstruction/MuonTrackMakers/MuonTrackMakerTools/MuonTrackFinderTools/src/MuonChamberHoleRecoveryTool.cxx @@ -1314,7 +1314,7 @@ namespace Muon { return 0; } IdentifierHash hash_id; - m_idHelperTool->cscIdHelper().get_module_hash(detElId,hash_id ); + m_idHelperTool->cscIdHelper().get_geo_module_hash(detElId,hash_id ); CscPrepDataContainer::const_iterator colIt = cscPrdContainer->indexFind(hash_id); if( colIt == cscPrdContainer->end() ){ diff --git a/MuonSpectrometer/MuonReconstruction/MuonTrackMakers/MuonTrackMakerTools/MuonTrackFinderTools/src/MuonSegmentRegionRecoveryTool.cxx b/MuonSpectrometer/MuonReconstruction/MuonTrackMakers/MuonTrackMakerTools/MuonTrackFinderTools/src/MuonSegmentRegionRecoveryTool.cxx index 730d75520a33bae7b8f6d7c4d8ddeab2b33fc300..b868f3d5a0f6a15c70897714f8ef142df607a5ad 100644 --- a/MuonSpectrometer/MuonReconstruction/MuonTrackMakers/MuonTrackMakerTools/MuonTrackFinderTools/src/MuonSegmentRegionRecoveryTool.cxx +++ b/MuonSpectrometer/MuonReconstruction/MuonTrackMakers/MuonTrackMakerTools/MuonTrackFinderTools/src/MuonSegmentRegionRecoveryTool.cxx @@ -108,7 +108,6 @@ MuonSegmentRegionRecoveryTool::MuonSegmentRegionRecoveryTool(const std::string& declareProperty("ExcludeEES", m_excludeEES = true); declareProperty("OnlyEO", m_onlyEO = false); declareProperty("UseFitterOutlierLogic", m_useFitterOutlierLogic = true ); - declareProperty("DoNSW", m_doNSW = true); // assume that if NSW no CSC chambers are present } MuonSegmentRegionRecoveryTool::~MuonSegmentRegionRecoveryTool() {} @@ -262,10 +261,6 @@ void MuonSegmentRegionRecoveryTool::addHashes( DETID type, const IRoiDescriptor& ATH_MSG_VERBOSE(" excluding " << *it << " " << m_idHelperTool->toStringChamber(chId) ); continue; } - if ( m_doNSW && m_idHelperTool->stationIndex(chId) == MuonStationIndex::EI && abs(m_idHelperTool->stationEta(chId)) < 4) { - ATH_MSG_VERBOSE(" NSW excluding " << *it << " " << m_idHelperTool->toStringChamber(chId) ); - continue; - } ATH_MSG_VERBOSE(" -- hash " << *it << " " << m_idHelperTool->toStringChamber(chId) ); } if ( type == CSC ) { @@ -370,19 +365,12 @@ void MuonSegmentRegionRecoveryTool::collectCrossedChambers( const Trk::Track& tr RoiDescriptor roi( etamin, etamax, phimin, phimax ); - // addHashes(MDT,etamin,etamax,phimin,phimax,data.mdt,data.mdtTrack); - // addHashes(RPC,etamin,etamax,phimin,phimax,data.rpc,data.rpcTrack); - // addHashes(TGC,etamin,etamax,phimin,phimax,data.tgc,data.tgcTrack); - // addHashes(CSC,etamin,etamax,phimin,phimax,data.csc,data.cscTrack); - - addHashes(MDT, roi, data.mdt, data.mdtTrack); - addHashes(RPC, roi, data.rpc, data.rpcTrack); - addHashes(TGC, roi, data.tgc, data.tgcTrack); - if (!m_doNSW) addHashes(CSC, roi, data.csc, data.cscTrack); - // New Small Wheel - addHashes(STGC, roi, data.stgc, data.stgcTrack); - addHashes(MM, roi, data.mm, data.mmTrack); - + if ((&(m_idHelperTool->mdtIdHelper())) && (m_idHelperTool->mdtIdHelper().isInitialized())) addHashes(MDT, roi, data.mdt, data.mdtTrack); + if ((&(m_idHelperTool->rpcIdHelper())) && (m_idHelperTool->rpcIdHelper().isInitialized())) addHashes(RPC, roi, data.rpc, data.rpcTrack); + if ((&(m_idHelperTool->tgcIdHelper())) && (m_idHelperTool->tgcIdHelper().isInitialized())) addHashes(TGC, roi, data.tgc, data.tgcTrack); + if ((&(m_idHelperTool->cscIdHelper())) && (m_idHelperTool->cscIdHelper().isInitialized())) addHashes(CSC, roi, data.csc, data.cscTrack); + if ((&(m_idHelperTool->stgcIdHelper())) && (m_idHelperTool->stgcIdHelper().isInitialized())) addHashes(STGC, roi, data.stgc, data.stgcTrack); + if ((&(m_idHelperTool->mmIdHelper())) && (m_idHelperTool->mmIdHelper().isInitialized())) addHashes(MM, roi, data.mm, data.mmTrack); std::set<IdentifierHash>::iterator hsit = data.mdt.begin(); std::set<IdentifierHash>::iterator hsit_end = data.mdt.end(); @@ -1002,7 +990,7 @@ const Trk::Track* MuonSegmentRegionRecoveryTool::addMissingChambers( const Trk:: } data.tgcCols = newtcols; - if (!m_doNSW) { + if ((&(m_idHelperTool->cscIdHelper())) && (m_idHelperTool->cscIdHelper().isInitialized())) { m_seededSegmentFinder->extractCscPrdCols( data.csc, data.cscCols ); std::vector<const CscPrepDataCollection*>::const_iterator cit = data.cscCols.begin(); std::vector<const CscPrepDataCollection*>::const_iterator cit_end = data.cscCols.end(); @@ -1026,10 +1014,8 @@ const Trk::Track* MuonSegmentRegionRecoveryTool::addMissingChambers( const Trk:: } } - if(m_doNSW) { - // New Small Wheel - // sTGC - unsigned int nstates = states.size(); + unsigned int nstates = states.size(); + if ((&(m_idHelperTool->stgcIdHelper())) && (m_idHelperTool->stgcIdHelper().isInitialized())) { m_seededSegmentFinder->extractsTgcPrdCols( data.stgc, data.stgcCols ); std::vector<const sTgcPrepDataCollection*>::const_iterator stit = data.stgcCols.begin(); std::vector<const sTgcPrepDataCollection*>::const_iterator stit_end = data.stgcCols.end(); @@ -1052,8 +1038,9 @@ const Trk::Track* MuonSegmentRegionRecoveryTool::addMissingChambers( const Trk:: } } data.stgcCols = newstcols; + } - // MM + if ((&(m_idHelperTool->mmIdHelper())) && (m_idHelperTool->mmIdHelper().isInitialized())) { m_seededSegmentFinder->extractMMPrdCols( data.mm, data.mmCols ); ATH_MSG_DEBUG(" extractMMPrdCols data.mmCols.size() " << data.mmCols.size()); std::vector<const MMPrepDataCollection*>::const_iterator mit = data.mmCols.begin(); @@ -1076,7 +1063,6 @@ const Trk::Track* MuonSegmentRegionRecoveryTool::addMissingChambers( const Trk:: } } data.mmCols = newmcols; - } if ( !states.empty() ) { diff --git a/MuonSpectrometer/MuonReconstruction/MuonTrackMakers/MuonTrackMakerTools/MuonTrackFinderTools/src/MuonSegmentRegionRecoveryTool.h b/MuonSpectrometer/MuonReconstruction/MuonTrackMakers/MuonTrackMakerTools/MuonTrackFinderTools/src/MuonSegmentRegionRecoveryTool.h index 78331cb2ec621b04e98c66a2a8f806b21538ce51..3ed7479072b04bd85d53d3a9d2b9c6d9a33cfaab 100644 --- a/MuonSpectrometer/MuonReconstruction/MuonTrackMakers/MuonTrackMakerTools/MuonTrackFinderTools/src/MuonSegmentRegionRecoveryTool.h +++ b/MuonSpectrometer/MuonReconstruction/MuonTrackMakers/MuonTrackMakerTools/MuonTrackFinderTools/src/MuonSegmentRegionRecoveryTool.h @@ -186,7 +186,6 @@ namespace Muon { bool m_excludeEES; bool m_onlyEO; bool m_useFitterOutlierLogic; - bool m_doNSW; }; } diff --git a/MuonSpectrometer/MuonTruthAlgs/MuonTruthAlgs/MuonDetailedTrackTruthMaker.h b/MuonSpectrometer/MuonTruthAlgs/MuonTruthAlgs/MuonDetailedTrackTruthMaker.h index d80866d3548dc5d676c4a98b1d79afa2d6e19641..50984d9b38695577afbc5157cc3f9549722839ac 100755 --- a/MuonSpectrometer/MuonTruthAlgs/MuonTruthAlgs/MuonDetailedTrackTruthMaker.h +++ b/MuonSpectrometer/MuonTruthAlgs/MuonTruthAlgs/MuonDetailedTrackTruthMaker.h @@ -48,8 +48,9 @@ private: // Tool Handle for truth tool ToolHandle<Trk::IDetailedTrackTruthBuilder> m_truthTool; - bool m_useNSW; bool m_hasCSC; + bool m_hasSTgc; + bool m_hasMM; }; diff --git a/MuonSpectrometer/MuonTruthAlgs/src/MuonDetailedTrackTruthMaker.cxx b/MuonSpectrometer/MuonTruthAlgs/src/MuonDetailedTrackTruthMaker.cxx index ab3f407d5fccfc9c79f120cf06ee24600892f0b6..87559597aa5c234841e7650103d785d4bb86fa09 100755 --- a/MuonSpectrometer/MuonTruthAlgs/src/MuonDetailedTrackTruthMaker.cxx +++ b/MuonSpectrometer/MuonTruthAlgs/src/MuonDetailedTrackTruthMaker.cxx @@ -15,8 +15,9 @@ MuonDetailedTrackTruthMaker::MuonDetailedTrackTruthMaker(const std::string &name m_truthTool("Trk::DetailedTrackTruthBuilder") { declareProperty("TruthTool", m_truthTool); - declareProperty("doNSW",m_useNSW=false); declareProperty("HasCSC",m_hasCSC=true); + declareProperty("HasSTgc",m_hasSTgc=true); + declareProperty("HasMM",m_hasMM=true); } // Initialize method @@ -33,10 +34,9 @@ StatusCode MuonDetailedTrackTruthMaker::initialize() ATH_MSG_DEBUG("Retrieved tool " << m_truthTool ); } - if (m_hasCSC) { - if(m_useNSW) m_PRD_TruthNames={"sTGC_TruthMap","MM_TruthMap","RPC_TruthMap","TGC_TruthMap","MDT_TruthMap","CSC_TruthMap"}; - } else { - if(m_useNSW) m_PRD_TruthNames={"sTGC_TruthMap","MM_TruthMap","RPC_TruthMap","TGC_TruthMap","MDT_TruthMap"}; + if (m_hasSTgc && m_hasMM) { + if (m_hasCSC) m_PRD_TruthNames={"sTGC_TruthMap","MM_TruthMap","RPC_TruthMap","TGC_TruthMap","MDT_TruthMap","CSC_TruthMap"}; + else m_PRD_TruthNames={"sTGC_TruthMap","MM_TruthMap","RPC_TruthMap","TGC_TruthMap","MDT_TruthMap"}; } if(m_detailedTrackTruthNames.empty()){ diff --git a/MuonSpectrometer/MuonTruthAlgs/src/MuonSegmentTruthAssociationAlg.cxx b/MuonSpectrometer/MuonTruthAlgs/src/MuonSegmentTruthAssociationAlg.cxx index 885769b4dc2e1216b4498962ba9ece20c04ba7dd..b28edd5b96feb659148faf0110335c5ef7e72540 100644 --- a/MuonSpectrometer/MuonTruthAlgs/src/MuonSegmentTruthAssociationAlg.cxx +++ b/MuonSpectrometer/MuonTruthAlgs/src/MuonSegmentTruthAssociationAlg.cxx @@ -22,10 +22,15 @@ namespace Muon { AthAlgorithm(name,pSvcLocator), m_idHelper("Muon::MuonIdHelperTool/MuonIdHelperTool"), m_printer("Muon::MuonEDMPrinterTool/MuonEDMPrinterTool"), - m_muonTrackTruthTool("Muon::MuonTrackTruthTool/MuonTrackTruthTool") + m_muonTrackTruthTool("Muon::MuonTrackTruthTool/MuonTrackTruthTool"), + m_hasCSC(true), + m_hasSTgc(true), + m_hasMM(true) { declareProperty("BarcodeOffset", m_barcodeOffset = 1000000 ,"barcode offset for matching truth particles"); - declareProperty("doNSW",m_useNSW=false,"NSW flag"); + declareProperty("HasCSC",m_hasCSC=true); + declareProperty("HasSTgc",m_hasSTgc=true); + declareProperty("HasMM",m_hasMM=true); } // Initialize method: @@ -39,9 +44,9 @@ namespace Muon { ATH_CHECK(m_muonTruthSegmentContainerName.initialize()); ATH_CHECK(m_muonSegmentCollectionName.initialize()); ATH_CHECK(m_mcEventColl.initialize()); - if(!m_useNSW) m_muonSimData={"MDT_SDO", "RPC_SDO", "TGC_SDO"}; + if(!(m_hasSTgc && m_hasMM)) m_muonSimData={"MDT_SDO", "RPC_SDO", "TGC_SDO"}; ATH_CHECK(m_muonSimData.initialize()); - ATH_CHECK(m_cscSimData.initialize(!m_useNSW)); + if (m_hasCSC) ATH_CHECK(m_cscSimData.initialize(true)); ATH_CHECK(m_trackRecord.initialize()); return StatusCode::SUCCESS; } @@ -111,7 +116,7 @@ namespace Muon { if(!simDataMap.isPresent()) continue; muonSimData.push_back(simDataMap.cptr()); } - if(!m_useNSW){ + if(!m_hasCSC){ SG::ReadHandle<CscSimDataCollection> cscSimDataMap(m_cscSimData); if(!cscSimDataMap.isValid()){ ATH_MSG_WARNING(cscSimDataMap.key()<<" not valid"); diff --git a/MuonSpectrometer/MuonTruthAlgs/src/MuonSegmentTruthAssociationAlg.h b/MuonSpectrometer/MuonTruthAlgs/src/MuonSegmentTruthAssociationAlg.h index b26fc2978554bc3eab89e320401f121e4100c62e..f8b353fb4d63882d69dbe124309e0cf3319e8827 100644 --- a/MuonSpectrometer/MuonTruthAlgs/src/MuonSegmentTruthAssociationAlg.h +++ b/MuonSpectrometer/MuonTruthAlgs/src/MuonSegmentTruthAssociationAlg.h @@ -51,7 +51,9 @@ private: SG::ReadHandleKey<CscSimDataCollection> m_cscSimData{this,"CSC_SDO_Container","CSC_SDO","CSC SDO"}; SG::ReadHandleKey<TrackRecordCollection> m_trackRecord{this,"TrackRecord","MuonEntryLayerFilter","Track Record Collection"}; int m_barcodeOffset; - bool m_useNSW; + bool m_hasCSC; + bool m_hasSTgc; + bool m_hasMM; }; } // namespace Muon diff --git a/MuonSpectrometer/MuonValidation/MuonGeomValidation/MuonGeomRTT/test/test_amdc_mgm-test_layout.sh b/MuonSpectrometer/MuonValidation/MuonGeomValidation/MuonGeomRTT/test/test_amdc_mgm-test_layout.sh index cc6b82ed7d0a7a82cf05e35e0df2331e7926c732..5c69d798dca42ad647d2174137124e74c8c741ff 100755 --- a/MuonSpectrometer/MuonValidation/MuonGeomValidation/MuonGeomRTT/test/test_amdc_mgm-test_layout.sh +++ b/MuonSpectrometer/MuonValidation/MuonGeomValidation/MuonGeomRTT/test/test_amdc_mgm-test_layout.sh @@ -19,7 +19,7 @@ echo $AtlasVersion if [ ${AtlasVersion:0:4} == "21.0" ]; then DetDesVer='"ATLAS-R2-2016-01-00-01"' elif [ ${AtlasVersion:0:4} == "21.3" ]; then - DetDesVer='"ATLAS-R3-2021-00-00-00"' + DetDesVer='"ATLAS-R3-2021-01-00-00"' else DetDesVer='"ATLAS-R2-2015-03-04-00"' fi diff --git a/MuonSpectrometer/MuonValidation/MuonGeomValidation/MuonGeomRTT/test/test_checkgeo_nswd.sh b/MuonSpectrometer/MuonValidation/MuonGeomValidation/MuonGeomRTT/test/test_checkgeo_nswd.sh index 621baf43087db5f7a414623aba646f2217e3a992..dd0efcf83562c2043e60a9a29f281f9fcef0f771 100755 --- a/MuonSpectrometer/MuonValidation/MuonGeomValidation/MuonGeomRTT/test/test_checkgeo_nswd.sh +++ b/MuonSpectrometer/MuonValidation/MuonGeomValidation/MuonGeomRTT/test/test_checkgeo_nswd.sh @@ -13,7 +13,7 @@ art.py createpoolfile set -x -get_files stations.v2.03.xml -athena.py AmdcAth/AmdcAth_GeometryTasks.py -c "input_nsw_xml='stations.v2.03.xml';database_layout='MuonSpectrometer-R.08.01-NSW';CheckNSWDBlob=True;" +get_files stations.v2.06.xml +athena.py AmdcAth/AmdcAth_GeometryTasks.py -c "input_nsw_xml='stations.v2.06.xml';database_layout='MuonSpectrometer-R.09.00.NSW';CheckNSWDBlob=True;" echo "art-result: $?" \ No newline at end of file diff --git a/MuonSpectrometer/MuonValidation/MuonGeomValidation/MuonGeomRTT/test/test_gengeo_nswd.sh b/MuonSpectrometer/MuonValidation/MuonGeomValidation/MuonGeomRTT/test/test_gengeo_nswd.sh index e715566be404a0f9d68d04fe129230ef889e7dec..540abcca852d8c0d4cb42d735eac60896f943234 100755 --- a/MuonSpectrometer/MuonValidation/MuonGeomValidation/MuonGeomRTT/test/test_gengeo_nswd.sh +++ b/MuonSpectrometer/MuonValidation/MuonGeomValidation/MuonGeomRTT/test/test_gengeo_nswd.sh @@ -12,8 +12,8 @@ art.py createpoolfile set -x -get_files stations.v2.03.xml -wget http://atlas.web.cern.ch/Atlas/GROUPS/MUON/AMDB/amdb_simrec.r.08.01 -athena.py AmdcAth/AmdcAth_GeometryTasks.py -c "input_nsw_xml='stations.v2.03.xml'; input_amdb_simrec='amdb_simrec.r.08.01'; DoNSWDBlob=True;" +get_files stations.v2.06.xml +wget http://atlas.web.cern.ch/Atlas/GROUPS/MUON/AMDB/amdb_simrec.r.09.00 +athena.py AmdcAth/AmdcAth_GeometryTasks.py -c "input_nsw_xml='stations.v2.06.xml'; input_amdb_simrec='amdb_simrec.r.09.00';database_layout='MuonSpectrometer-R.09.00.NSW';DoNSWDBlob=True;" echo "art-result: $?" \ No newline at end of file diff --git a/MuonSpectrometer/MuonValidation/MuonGeomValidation/MuonGeomRTT/test/test_muon_gm_check.sh b/MuonSpectrometer/MuonValidation/MuonGeomValidation/MuonGeomRTT/test/test_muon_gm_check.sh index 2663867a770dd1acc146e9e25bb98b1245fc925d..9f7c46720219ebf269d446a2332b68351d996ca1 100755 --- a/MuonSpectrometer/MuonValidation/MuonGeomValidation/MuonGeomRTT/test/test_muon_gm_check.sh +++ b/MuonSpectrometer/MuonValidation/MuonGeomValidation/MuonGeomRTT/test/test_muon_gm_check.sh @@ -19,7 +19,7 @@ echo $AtlasVersion if [ ${AtlasVersion:0:4} == "21.0" ]; then DetDesVer='"ATLAS-R2-2016-01-00-01"' elif [ ${AtlasVersion:0:4} == "21.3" ]; then - DetDesVer='"ATLAS-R3-2021-00-00-00"' + DetDesVer='"ATLAS-R3-2021-01-00-00"' else DetDesVer='"ATLAS-R2-2015-03-04-00"' fi diff --git a/MuonSpectrometer/MuonValidation/MuonRecValidation/MuonRecRTT/test/test_nsw_singlemuon_evntgen.sh b/MuonSpectrometer/MuonValidation/MuonRecValidation/MuonRecRTT/test/test_nsw_singlemuon_evntgen.sh index f15b1aa3d9e2aed61b68ed65d1296571f4107ada..5fa7619134dcc3bce01f60fd3edc0845a6166a31 100755 --- a/MuonSpectrometer/MuonValidation/MuonRecValidation/MuonRecRTT/test/test_nsw_singlemuon_evntgen.sh +++ b/MuonSpectrometer/MuonValidation/MuonRecValidation/MuonRecRTT/test/test_nsw_singlemuon_evntgen.sh @@ -11,7 +11,7 @@ set -x AtlasG4_tf.py --inputEVNTFile /cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/MuonRecRTT/NSW/evntgen/*.root \ --conditionsTag OFLCOND-RUN12-SDR-25 \ --DataRunNumber 222500 \ - --geometryVersion ATLAS-R3-2021-00-00-00_VALIDATION \ + --geometryVersion ATLAS-R3-2021-01-00-00_VALIDATION \ --outputHITSFile NSW_SingleMuon_EvntGen.hits.pool.root \ --maxEvents -1 diff --git a/MuonSpectrometer/MuonValidation/MuonRecValidation/MuonRecRTT/test/test_nsw_singlemuon_recon.sh b/MuonSpectrometer/MuonValidation/MuonRecValidation/MuonRecRTT/test/test_nsw_singlemuon_recon.sh index 65ef53ad3ffa109ba6188ea429260aed538afd69..f00585a9418db6052b8e9c648b98445361974990 100755 --- a/MuonSpectrometer/MuonValidation/MuonRecValidation/MuonRecRTT/test/test_nsw_singlemuon_recon.sh +++ b/MuonSpectrometer/MuonValidation/MuonRecValidation/MuonRecRTT/test/test_nsw_singlemuon_recon.sh @@ -9,7 +9,7 @@ set -x Reco_tf.py \ - --preExec 'all:from MuonRecExample.MuonRecFlags import muonRecFlags,muonStandaloneFlags;muonRecFlags.doFastDigitization=False; muonRecFlags.useLooseErrorTuning.set_Value_and_Lock(True);muonRecFlags.doCSCs=False;muonRecFlags.doNSWNewThirdChain=True;muonRecFlags.dosTGCs=True;muonRecFlags.doMicromegas=True;muonStandaloneFlags.printSummary=True;muonRecFlags.doTrackPerformance=True;muonRecFlags.TrackPerfSummaryLevel=2;muonRecFlags.TrackPerfDebugLevel=5;rec.doTrigger=False;rec.doInDet=True;rec.doCalo=True;rec.doLArg=True;rec.doEgamma=False;rec.doTile=True;rec.doLucid=False;rec.doZdc=False;rec.doJetMissingETTag=False;from MuonCombinedRecExample.MuonCombinedRecFlags import muonCombinedRecFlags;muonCombinedRecFlags.doCaloTrkMuId=True;muonCombinedRecFlags.doMuGirlLowBeta=False;muonCombinedRecFlags.doMuGirl=True;muonCombinedRecFlags.doCombinedFit=True;muonCombinedRecFlags.doMuonSegmentTagger=True;svcMgr.MessageSvc.defaultLimit = 1000;svcMgr.MessageSvc.debugLimit = 1000;svcMgr.MessageSvc.verboseLimit = 1000' \ + --preExec 'all:from MuonRecExample.MuonRecFlags import muonRecFlags,muonStandaloneFlags;muonRecFlags.doFastDigitization=False; muonRecFlags.useLooseErrorTuning.set_Value_and_Lock(True);muonStandaloneFlags.printSummary=True;muonRecFlags.doTrackPerformance=True;muonRecFlags.TrackPerfSummaryLevel=2;muonRecFlags.TrackPerfDebugLevel=5;rec.doTrigger=False;rec.doInDet=True;rec.doCalo=True;rec.doLArg=True;rec.doEgamma=False;rec.doTile=True;rec.doLucid=False;rec.doZdc=False;rec.doJetMissingETTag=False;from MuonCombinedRecExample.MuonCombinedRecFlags import muonCombinedRecFlags;muonCombinedRecFlags.doCaloTrkMuId=True;muonCombinedRecFlags.doMuGirlLowBeta=False;muonCombinedRecFlags.doMuGirl=True;muonCombinedRecFlags.doCombinedFit=True;muonCombinedRecFlags.doMuonSegmentTagger=True;svcMgr.MessageSvc.defaultLimit = 1000;svcMgr.MessageSvc.debugLimit = 1000;svcMgr.MessageSvc.verboseLimit = 1000' \ --ignorePatterns 'ToolSvc.MM_PrepDataProviderTool.+.ERROR.' \ --ignoreErrors FALSE \ --outputESDFile nsw.ESD.pool.root \ diff --git a/MuonSpectrometer/MuonValidation/MuonRecValidation/MuonTrackPerformance/MuonTrackPerformance/MuonTrackPerformanceAlg.h b/MuonSpectrometer/MuonValidation/MuonRecValidation/MuonTrackPerformance/MuonTrackPerformance/MuonTrackPerformanceAlg.h index 80403020a835fb9c6791a89c015696eff9175ffe..423518ac754f66c99343bf9026dcd3a361c30064 100644 --- a/MuonSpectrometer/MuonValidation/MuonRecValidation/MuonTrackPerformance/MuonTrackPerformance/MuonTrackPerformanceAlg.h +++ b/MuonSpectrometer/MuonValidation/MuonRecValidation/MuonTrackPerformance/MuonTrackPerformance/MuonTrackPerformanceAlg.h @@ -297,7 +297,6 @@ private: bool m_isCombined; bool m_doSegments; bool m_writeToFile; - bool m_doNSW; bool m_doStau; ToolHandle<Muon::MuonIdHelperTool> m_idHelperTool; diff --git a/MuonSpectrometer/MuonValidation/MuonRecValidation/MuonTrackPerformance/src/MuonTrackPerformanceAlg.cxx b/MuonSpectrometer/MuonValidation/MuonRecValidation/MuonTrackPerformance/src/MuonTrackPerformanceAlg.cxx index d1f37bcec921ba1be0ddf334dc44729867db0cd0..53867c3c62a68d9c9b113e15b916bb61d05cce1f 100644 --- a/MuonSpectrometer/MuonValidation/MuonRecValidation/MuonTrackPerformance/src/MuonTrackPerformanceAlg.cxx +++ b/MuonSpectrometer/MuonValidation/MuonRecValidation/MuonTrackPerformance/src/MuonTrackPerformanceAlg.cxx @@ -68,7 +68,6 @@ MuonTrackPerformanceAlg::MuonTrackPerformanceAlg(const std::string& name, ISvcLo declareProperty("MuonMomentumCutSim",m_momentumCutSim = 2000. ); declareProperty("LowMomentumThreshold",m_momentumCut = 2000. ); declareProperty("DoSegments",m_doSegments = false ); - declareProperty("useNSW",m_doNSW=false); declareProperty("doStau",m_doStau=false); declareProperty("TrackType",m_trackType=2); declareProperty("ProduceEventListMissedTracks", m_doEventListMissed = 0, "0: off, 1: two station, 2: + one station" ); @@ -125,9 +124,9 @@ StatusCode MuonTrackPerformanceAlg::initialize() ATH_CHECK(m_eventInfoKey.initialize()); ATH_CHECK(m_mcEventColl.initialize(m_doTruth)); - if(!m_doNSW) m_muonSimData={"MDT_SDO", "RPC_SDO", "TGC_SDO"}; + if(!(m_idHelperTool->hasSTgc() && m_idHelperTool->hasMM())) m_muonSimData={"MDT_SDO", "RPC_SDO", "TGC_SDO"}; if(m_doTruth) ATH_CHECK(m_muonSimData.initialize()); - ATH_CHECK(m_cscSimData.initialize(m_doTruth && !m_doNSW)); + ATH_CHECK(m_cscSimData.initialize(m_doTruth && m_idHelperTool->hasCSC())); ATH_CHECK(m_trackRecord.initialize(m_doTruth)); return StatusCode::SUCCESS; @@ -162,17 +161,19 @@ bool MuonTrackPerformanceAlg::handleSegmentTruth( const std::vector<const Muon:: if( trackTruth.mdts.missedChambers.size() > 0 ){ if( m_debug ) *m_log << MSG::DEBUG << "Missing mdt chamber " << endmsg; } - if(!m_doNSW){ + if(m_idHelperTool->hasCSC()){ if( trackTruth.cscs.missedChambers.size() > 0 ){ if( m_debug ) *m_log << MSG::DEBUG << "Missing csc chamber " << endmsg; } } - else{ + if(m_idHelperTool->hasSTgc()){ if( trackTruth.stgcs.missedChambers.size() > 0 ){ - if( m_debug ) *m_log << MSG::DEBUG << "Missing tgc chamber " << endmsg; + if( m_debug ) *m_log << MSG::DEBUG << "Missing stgc chamber " << endmsg; } + } + if(m_idHelperTool->hasMM()){ if( trackTruth.mms.missedChambers.size() > 0 ){ - if( m_debug ) *m_log << MSG::DEBUG << "Missing tgc chamber " << endmsg; + if( m_debug ) *m_log << MSG::DEBUG << "Missing mm chamber " << endmsg; } } if( trackTruth.rpcs.missedChambers.size() > 0 ){ @@ -309,8 +310,10 @@ bool MuonTrackPerformanceAlg::goodTruthTrack( const Muon::IMuonTrackTruthTool::T } if( !selectPdg(trackRecord->GetPDGCode()) ) return false; if( m_isCombined && fabs(trackRecord->GetMomentum().eta()) > 2.5 ) return false; - if(!m_doNSW) return entry.mdtHits.size() + entry.cscHits.size() > 4; - else return entry.mdtHits.size() + entry.mmHits.size() > 4; + int hits = entry.mdtHits.size(); + if(m_idHelperTool->hasCSC()) hits += entry.cscHits.size(); + if(m_idHelperTool->hasMM()) hits += entry.mmHits.size(); + return (hits > 4); } bool MuonTrackPerformanceAlg::handleTrackTruth( const TrackCollection& trackCollection ) { @@ -332,7 +335,7 @@ bool MuonTrackPerformanceAlg::handleTrackTruth( const TrackCollection& trackColl muonSimData.push_back(simDataMap.cptr()); } const CscSimDataCollection* cscSimData=NULL; - if(!m_doNSW){ + if(m_idHelperTool->hasCSC()){ SG::ReadHandle<CscSimDataCollection> cscSimDataMap(m_cscSimData); if(!cscSimDataMap.isValid()){ ATH_MSG_WARNING(cscSimDataMap.key()<<" not valid"); @@ -728,16 +731,17 @@ std::string MuonTrackPerformanceAlg::print( const Muon::IMuonTrackTruthTool::Tru MuonSimDataCollection::const_iterator mit_end = trackTruth.mdtHits.end(); for( ;mit!=mit_end;++mit ) allIds.insert(mit->first); - if(!m_doNSW){ + if(m_idHelperTool->hasCSC()){ CscSimDataCollection::const_iterator cit = trackTruth.cscHits.begin(); CscSimDataCollection::const_iterator cit_end = trackTruth.cscHits.end(); for( ;cit!=cit_end;++cit ) allIds.insert(m_idHelperTool->layerId(cit->first)); } - else{ + if(m_idHelperTool->hasSTgc()){ mit = trackTruth.stgcHits.begin(); mit_end = trackTruth.stgcHits.end(); for( ;mit!=mit_end;++mit ) allIds.insert(m_idHelperTool->layerId(mit->first)); - + } + if(m_idHelperTool->hasMM()){ mit = trackTruth.mmHits.begin(); mit_end = trackTruth.mmHits.end(); for( ;mit!=mit_end;++mit ) allIds.insert(m_idHelperTool->layerId(mit->first)); @@ -1167,29 +1171,25 @@ MuonTrackPerformanceAlg::TrackData* MuonTrackPerformanceAlg::evaluateTrackTruthO // handle missing chambers insertTechnology( truthTrack.mdts.missedChambers, truthTrack.mdts.missedHits, m_minMdtHits, 0, trackData->missingChambers ); - if(!m_doNSW) insertTechnology( truthTrack.cscs.missedChambers, truthTrack.cscs.missedHits, m_minCscEtaHits, m_minCscPhiHits, trackData->missingChambers ); - else{ - insertTechnology( truthTrack.stgcs.missedChambers, truthTrack.stgcs.missedHits, m_minsTgcEtaHits, m_minsTgcPhiHits, trackData->missingChambers ); - insertTechnology( truthTrack.mms.missedChambers, truthTrack.mms.missedHits, m_minMMEtaHits, 0, trackData->missingChambers ); - } + if(m_idHelperTool->hasCSC()) insertTechnology( truthTrack.cscs.missedChambers, truthTrack.cscs.missedHits, m_minCscEtaHits, m_minCscPhiHits, trackData->missingChambers ); + if(m_idHelperTool->hasSTgc()) insertTechnology( truthTrack.stgcs.missedChambers, truthTrack.stgcs.missedHits, m_minsTgcEtaHits, m_minsTgcPhiHits, trackData->missingChambers ); + if(m_idHelperTool->hasMM()) insertTechnology( truthTrack.mms.missedChambers, truthTrack.mms.missedHits, m_minMMEtaHits, 0, trackData->missingChambers ); insertTechnology( truthTrack.rpcs.missedChambers, truthTrack.rpcs.missedHits, m_minRpcEtaHits, m_minRpcPhiHits, trackData->missingChambers ); insertTechnology( truthTrack.tgcs.missedChambers, truthTrack.tgcs.missedHits, m_minTgcEtaHits, m_minTgcPhiHits, trackData->missingChambers ); // handle wrong chambers insertTechnology( truthTrack.mdts.wrongChambers, truthTrack.mdts.wrongHits, m_minMdtHits, 0, trackData->wrongChambers ); - if(!m_doNSW) insertTechnology( truthTrack.cscs.wrongChambers, truthTrack.cscs.wrongHits, m_minCscEtaHits, m_minCscPhiHits, trackData->wrongChambers ); - else{ - insertTechnology( truthTrack.stgcs.wrongChambers, truthTrack.stgcs.wrongHits, m_minsTgcEtaHits, m_minsTgcPhiHits, trackData->wrongChambers ); - insertTechnology( truthTrack.mms.wrongChambers, truthTrack.mms.wrongHits, m_minMMEtaHits, 0, trackData->wrongChambers ); - } + if(m_idHelperTool->hasCSC()) insertTechnology( truthTrack.cscs.wrongChambers, truthTrack.cscs.wrongHits, m_minCscEtaHits, m_minCscPhiHits, trackData->wrongChambers ); + if(m_idHelperTool->hasSTgc()) insertTechnology( truthTrack.stgcs.wrongChambers, truthTrack.stgcs.wrongHits, m_minsTgcEtaHits, m_minsTgcPhiHits, trackData->wrongChambers ); + if(m_idHelperTool->hasMM()) insertTechnology( truthTrack.mms.wrongChambers, truthTrack.mms.wrongHits, m_minMMEtaHits, 0, trackData->wrongChambers ); insertTechnology( truthTrack.rpcs.wrongChambers, truthTrack.rpcs.wrongHits, m_minRpcEtaHits, m_minRpcPhiHits, trackData->wrongChambers ); insertTechnology( truthTrack.tgcs.wrongChambers, truthTrack.tgcs.wrongHits, m_minTgcEtaHits, m_minTgcPhiHits, trackData->wrongChambers ); // handle layer information for precision chambers std::set<Muon::MuonStationIndex::StIndex> dummyList; insertStationLayers( truthTrack.mdts.matchedChambers, dummyList, trackData->layers ); - if(!m_doNSW) insertStationLayers( truthTrack.cscs.matchedChambers, dummyList, trackData->layers ); - else insertStationLayers( truthTrack.mms.matchedChambers, dummyList, trackData->layers ); + if(m_idHelperTool->hasCSC()) insertStationLayers( truthTrack.cscs.matchedChambers, dummyList, trackData->layers ); + if(m_idHelperTool->hasMM()) insertStationLayers( truthTrack.mms.matchedChambers, dummyList, trackData->layers ); insertStationLayers( trackData->missingChambers, trackData->layers, trackData->missingLayers, true ); insertStationLayers( trackData->wrongChambers, trackData->layers, trackData->wrongLayers,true ); @@ -1197,7 +1197,7 @@ MuonTrackPerformanceAlg::TrackData* MuonTrackPerformanceAlg::evaluateTrackTruthO // handle layer information for precision chambers insertStationLayers( truthTrack.rpcs.matchedChambers, dummyList, trackData->layersTrigger ); insertStationLayers( truthTrack.tgcs.matchedChambers, dummyList, trackData->layersTrigger ); - if(m_doNSW) insertStationLayers( truthTrack.stgcs.matchedChambers, dummyList, trackData->layersTrigger ); + if(m_idHelperTool->hasSTgc()) insertStationLayers( truthTrack.stgcs.matchedChambers, dummyList, trackData->layersTrigger ); insertStationLayers( trackData->missingChambers, trackData->layersTrigger, trackData->missingLayersTrigger, false ); insertStationLayers( trackData->wrongChambers, trackData->layersTrigger, trackData->wrongLayersTrigger, false ); @@ -1352,7 +1352,7 @@ MuonTrackPerformanceAlg::TrackData* MuonTrackPerformanceAlg::createTrackData( co chambers[chId].insert(mit->first); } - if(!m_doNSW){ + if(m_idHelperTool->hasCSC()){ CscSimDataCollection::const_iterator cit = trackTruth.cscHits.begin(); CscSimDataCollection::const_iterator cit_end = trackTruth.cscHits.end(); for( ;cit!=cit_end;++cit ) { @@ -1360,14 +1360,15 @@ MuonTrackPerformanceAlg::TrackData* MuonTrackPerformanceAlg::createTrackData( co chambers[chId].insert(m_idHelperTool->layerId(cit->first)); } } - else{ + if(m_idHelperTool->hasSTgc()){ mit = trackTruth.stgcHits.begin(); mit_end = trackTruth.stgcHits.end(); for( ;mit!=mit_end;++mit ) { Identifier chId = m_idHelperTool->chamberId(mit->first); chambers[chId].insert(mit->first); } - + } + if(m_idHelperTool->hasMM()){ mit = trackTruth.mmHits.begin(); mit_end = trackTruth.mmHits.end(); for( ;mit!=mit_end;++mit ) { diff --git a/Reconstruction/MuonIdentification/MuonCombinedRecExample/python/CombinedMuonTrackSummary.py b/Reconstruction/MuonIdentification/MuonCombinedRecExample/python/CombinedMuonTrackSummary.py index 20ad317777458fca36f52906d93018ac953bf25f..ecb10cf512a08a02668b2f71782d065f00b6935e 100644 --- a/Reconstruction/MuonIdentification/MuonCombinedRecExample/python/CombinedMuonTrackSummary.py +++ b/Reconstruction/MuonIdentification/MuonCombinedRecExample/python/CombinedMuonTrackSummary.py @@ -18,7 +18,7 @@ from AthenaCommon.GlobalFlags import globalflags beamFlags = jobproperties.Beam atlasExtrapolator = getPublicTool('AtlasExtrapolator') -muonTrackSummaryHelper = getPublicTool('MuonTrackSummaryHelper') +muonTrackSummaryHelper = getPublicTool('MuonTrackSummaryHelperTool') # load InDetHoleSearchTool diff --git a/Reconstruction/MuonIdentification/MuonCombinedRecExample/python/MuGirlTagTool.py b/Reconstruction/MuonIdentification/MuonCombinedRecExample/python/MuGirlTagTool.py index 8a767ea6c207c6ddf4ad5341279864f15e56f260..3659b269598e4f7d392d916abe5b8760c755662f 100644 --- a/Reconstruction/MuonIdentification/MuonCombinedRecExample/python/MuGirlTagTool.py +++ b/Reconstruction/MuonIdentification/MuonCombinedRecExample/python/MuGirlTagTool.py @@ -15,11 +15,12 @@ from MuonCombinedRecExample.MuonCombinedRecFlags import muonCombinedRecFlags from MuonRecExample.MooreTools import MuonSeededSegmentFinder, MuonChamberHoleRecoveryTool from MuonRecExample.MuonRecTools import DCMathSegmentMaker -from MuonRecExample.MuonRecFlags import muonRecFlags - ###logfile from AthenaCommon.Logging import log +from AtlasGeoModel.CommonGMJobProperties import CommonGeometryFlags +from AtlasGeoModel.MuonGMJobProperties import MuonGeometryFlags + ############################################################################### ### Configure MuGirlTag### def MuGirlTagToolBase(name, configureForTrigger, doStau, **kwargs ): @@ -61,15 +62,18 @@ def DCMathStauSegmentMaker( name="DCMathStauSegmentMaker", **kwargs ): def MuonStauChamberHoleRecoveryTool(name="MuonStauChamberHoleRecoveryTool",**kwargs): kwargs.setdefault("MdtRotCreator", getPublicTool("MdtDriftCircleOnTrackCreatorStau") ) + if not MuonGeometryFlags.hasCSC(): + kwargs.setdefault("CscRotCreator", "" ) + kwargs.setdefault("CscPrepDataContainer", "" ) return MuonChamberHoleRecoveryTool(name,**kwargs) def MuonStauSeededSegmentFinder( name="MuonStauSeededSegmentFinder", **kwargs ): kwargs.setdefault("MdtRotCreator", getPublicTool("MdtDriftCircleOnTrackCreatorStau") ) kwargs.setdefault("SegmentMaker", getPublicTool("DCMathStauSegmentMaker") ) kwargs.setdefault("SegmentMakerNoHoles", getPublicTool("DCMathStauSegmentMaker") ) - if muonRecFlags.doNSWNewThirdChain(): + if not MuonGeometryFlags.hasCSC(): kwargs.setdefault("CscPrepDataContainer","") - else: + if not (CommonGeometryFlags.Run() in ["RUN3", "RUN4"]): kwargs.setdefault("sTgcPrepDataContainer","") kwargs.setdefault("MMPrepDataContainer","") diff --git a/Reconstruction/MuonIdentification/MuonCombinedRecExample/python/MuonCombinedFitTools.py b/Reconstruction/MuonIdentification/MuonCombinedRecExample/python/MuonCombinedFitTools.py index 57d7e65dad60241c98c3d1b4b0e2937b89d15f8a..9b67411d056071a4e6cc2237e8b8f38f5936e1fd 100644 --- a/Reconstruction/MuonIdentification/MuonCombinedRecExample/python/MuonCombinedFitTools.py +++ b/Reconstruction/MuonIdentification/MuonCombinedRecExample/python/MuonCombinedFitTools.py @@ -28,6 +28,8 @@ from IOVDbSvc.CondDB import conddb from AthenaCommon.GlobalFlags import globalflags from RecExConfig.RecFlags import rec +from AtlasGeoModel.MuonGMJobProperties import MuonGeometryFlags + GeV = 1000 mm = 1 @@ -195,7 +197,7 @@ def CombinedMuonTrackBuilderFit( name='CombinedMuonTrackBuilderFit', **kwargs ): from AthenaCommon.AppMgr import ToolSvc kwargs.setdefault("CaloEnergyParam" , getPublicTool("MuidCaloEnergyToolParam") ) kwargs.setdefault("CaloTSOS" , getPublicTool("MuidCaloTrackStateOnSurface") ) - kwargs.setdefault("CscRotCreator" , getPublicTool("CscClusterOnTrackCreator") ) + kwargs.setdefault("CscRotCreator" , (getPublicTool("CscClusterOnTrackCreator") if MuonGeometryFlags.hasCSC() else "") ) kwargs.setdefault("Fitter" , getPublicTool("iPatFitter") ) kwargs.setdefault("SLFitter" , getPublicTool("iPatSLFitter") ) kwargs.setdefault("MaterialAllocator" , getPublicTool("MuidMaterialAllocator") ) @@ -236,7 +238,7 @@ def CombinedMuonTrackBuilder( name='CombinedMuonTrackBuilder', **kwargs ): import MuonCombinedRecExample.CombinedMuonTrackSummary kwargs.setdefault("CaloEnergyParam" , getPublicTool("MuidCaloEnergyToolParam") ) kwargs.setdefault("CaloTSOS" , getPublicTool("MuidCaloTrackStateOnSurface") ) - kwargs.setdefault("CscRotCreator" , getPublicTool("CscClusterOnTrackCreator") ) + kwargs.setdefault("CscRotCreator" , (getPublicTool("CscClusterOnTrackCreator") if MuonGeometryFlags.hasCSC() else "") ) kwargs.setdefault("Fitter" , getPublicTool("iPatFitter") ) kwargs.setdefault("SLFitter" , getPublicTool("iPatSLFitter") ) kwargs.setdefault("MaterialAllocator" , getPublicTool("MuidMaterialAllocator") ) @@ -280,10 +282,9 @@ def CombinedMuonTrackBuilder( name='CombinedMuonTrackBuilder', **kwargs ): "MuonErrorOptimisationTool", PrepareForFit = False, RecreateStartingParameters = False, - RefitTool = getPublicToolClone("MuidRefitTool", - "MuonRefitTool", - AlignmentErrors = useAlignErrs, - Fitter = getPublicTool("iPatFitter")))) + RefitTool = getPublicToolClone("MuidRefitTool", "MuonRefitTool", AlignmentErrors = useAlignErrs, Fitter = getPublicTool("iPatFitter"), + CscRotCreator=("Muon::CscClusterOnTrackCreator/CscClusterOnTrackCreator" if MuonGeometryFlags.hasCSC() else "")) + )) if muonRecFlags.doSegmentT0Fit(): @@ -343,10 +344,9 @@ def OutwardsCombinedMuonTrackBuilder( name = 'OutwardsCombinedMuonTrackBuilder', if muonRecFlags.enableErrorTuning(): kwargs.setdefault("MuonErrorOptimizer", getPublicToolClone("OutwardsErrorOptimisationTool", "MuidErrorOptimisationTool", PrepareForFit=False,RecreateStartingParameters=False, - RefitTool = getPublicToolClone("OutwardsRefitTool", - "MuonRefitTool", - AlignmentErrors = False, - Fitter = getPublicTool("MuonCombinedTrackFitter")))) + RefitTool = getPublicToolClone("OutwardsRefitTool", "MuonRefitTool", AlignmentErrors = False, Fitter = getPublicTool("MuonCombinedTrackFitter"), + CscRotCreator=("Muon::CscClusterOnTrackCreator/CscClusterOnTrackCreator" if MuonGeometryFlags.hasCSC() else "")) + )) return CfgMgr.Rec__OutwardsCombinedMuonTrackBuilder(name,**kwargs) # tools for ID/MS match quality and recovery of incorrect spectrometer station association diff --git a/Reconstruction/MuonIdentification/MuonCombinedRecExample/share/MuonCombinedRec_myTopOptions.py b/Reconstruction/MuonIdentification/MuonCombinedRecExample/share/MuonCombinedRec_myTopOptions.py index 1445305ce6619e89a462f0a6427176d880ec3e19..2a56b4c813fecf1850d451524ebd07d67d7dfb48 100644 --- a/Reconstruction/MuonIdentification/MuonCombinedRecExample/share/MuonCombinedRec_myTopOptions.py +++ b/Reconstruction/MuonIdentification/MuonCombinedRecExample/share/MuonCombinedRec_myTopOptions.py @@ -269,7 +269,6 @@ AODFlags.FastSimulation = False AODFlags.Streaming = False AODFlags.MuonTrackSlimmer = False -#muonRecFlags.doNSWNewThirdChain = True #muonCombinedRecFlags.doCombinedFit = True muonCombinedRecFlags.doStatisticalCombination = True muonCombinedRecFlags.doMuGirl = True diff --git a/Reconstruction/MuonIdentification/MuonCombinedRecExample/share/MuonCombinedRec_postprocessing.py b/Reconstruction/MuonIdentification/MuonCombinedRecExample/share/MuonCombinedRec_postprocessing.py index 06de9e36fb3a795ee1a93675da8dadf242a0a7dd..8c8d7593fac968466d050ceea381d585f9251f0f 100644 --- a/Reconstruction/MuonIdentification/MuonCombinedRecExample/share/MuonCombinedRec_postprocessing.py +++ b/Reconstruction/MuonIdentification/MuonCombinedRecExample/share/MuonCombinedRec_postprocessing.py @@ -26,8 +26,9 @@ if rec.doTruth() and muonCombinedRecFlags.doxAOD() and rec.doMuonCombined(): topSequence+= MuonDetailedTrackTruthMaker("MuonCombinedDetailedTrackTruthMaker") topSequence.MuonCombinedDetailedTrackTruthMaker.TrackCollectionNames = cols topSequence.MuonCombinedDetailedTrackTruthMaker.DetailedTrackTruthNames = fcols - if muonRecFlags.doNSWNewThirdChain(): - topSequence.MuonCombinedDetailedTrackTruthMaker.doNSW=True + topSequence.MuonCombinedDetailedTrackTruthMaker.HasCSC = MuonGeometryFlags.hasCSC() + topSequence.MuonCombinedDetailedTrackTruthMaker.HasSTgc = (CommonGeometryFlags.Run() in ["RUN3", "RUN4"]) + topSequence.MuonCombinedDetailedTrackTruthMaker.HasMM = (CommonGeometryFlags.Run() in ["RUN3", "RUN4"]) from TrkTruthAlgs.TrkTruthAlgsConf import TrackParticleTruthAlg for i in range(0, len(fcols)): diff --git a/Reconstruction/MuonIdentification/MuonCombinedRecExample/share/MuonCombinedTrackPerformance_jobOptions.py b/Reconstruction/MuonIdentification/MuonCombinedRecExample/share/MuonCombinedTrackPerformance_jobOptions.py index 2a2a39e64ec8266dcc704ef142c6cb0dea9db229..d10fc9e0b2057824c03aefa6e097a0238b514a7a 100644 --- a/Reconstruction/MuonIdentification/MuonCombinedRecExample/share/MuonCombinedTrackPerformance_jobOptions.py +++ b/Reconstruction/MuonIdentification/MuonCombinedRecExample/share/MuonCombinedTrackPerformance_jobOptions.py @@ -31,10 +31,6 @@ if muonCombinedRecFlags.doxAOD(): DoTrackDebug = muonCombinedRecFlags.TrackPerfDebugLevel(), TrackType = 5, IsCombined = False ) - if muonRecFlags.doNSWNewThirdChain(): - topSequence.ExtrapolatedMuonPerformanceAlg.useNSW=True - topSequence.CombinedMuonPerformanceAlg.useNSW=True - topSequence.MSOnlyExtrapolatedMuonPerformanceAlg.useNSW=True if muonCombinedRecFlags.doMuGirlLowBeta(): topSequence += MuonTrackPerformanceAlg("CombinedStauPerformanceAlg", @@ -52,10 +48,6 @@ if muonCombinedRecFlags.doxAOD(): #DoTruth = rec.doTruth(), #DoTrackDebug = muonCombinedRecFlags.TrackPerfDebugLevel(), #IsCombined = False ) - if muonRecFlags.doNSWNewThirdChain(): - #topSequence.ExtrapolatedStauPerformanceAlg.useNSW=True - topSequence.CombinedStauPerformanceAlg.useNSW=True - from MuonTrackPerformance.MuonTrackPerformanceConf import MuonSegmentPerformanceAlg topSequence += MuonSegmentPerformanceAlg(name="MuonSegmentPerformanceAlg") diff --git a/Reconstruction/RecBackground/RecBackgroundAlgs/share/RecBackground_jobOptions.py b/Reconstruction/RecBackground/RecBackgroundAlgs/share/RecBackground_jobOptions.py index e0f7704df5791869ea5c426a7437210666ee2a02..9937ad41a639135cb5d12da4e485fbd455f787ce 100644 --- a/Reconstruction/RecBackground/RecBackgroundAlgs/share/RecBackground_jobOptions.py +++ b/Reconstruction/RecBackground/RecBackgroundAlgs/share/RecBackground_jobOptions.py @@ -2,11 +2,13 @@ include.block ('RecBackgroundAlgs/RecBackground_jobOptions.py') from RecExConfig.RecFlags import rec from AthenaCommon.DetFlags import DetFlags +from AtlasGeoModel.MuonGMJobProperties import MuonGeometryFlags + if rec.doInDet() and rec.doMuon() and rec.doCalo() and \ DetFlags.detdescr.Muon_on() and DetFlags.detdescr.Calo_on() and DetFlags.detdescr.ID_on() : include ("LArCellRec/LArCollisionTime_jobOptions.py") from RecBackgroundAlgs.RecBackgroundAlgsConf import BeamBackgroundFiller - BeamBackgroundFiller=BeamBackgroundFiller() + BeamBackgroundFiller=BeamBackgroundFiller(cscSegmentContainerKey=("NCB_MuonSegments" if MuonGeometryFlags.hasCSC() else "")) topSequence+=BeamBackgroundFiller from BCM_BackgroundAlgs.BCM_BackgroundAlgsConf import BcmCollisionTimeAlg diff --git a/Reconstruction/RecBackground/RecBackgroundAlgs/src/BeamBackgroundFiller.cxx b/Reconstruction/RecBackground/RecBackgroundAlgs/src/BeamBackgroundFiller.cxx index ae0ba58e4b1f1d4b2f2c9401bb34ee144d3b8335..872fc7ff659a6265c468014633bb746831da3207 100644 --- a/Reconstruction/RecBackground/RecBackgroundAlgs/src/BeamBackgroundFiller.cxx +++ b/Reconstruction/RecBackground/RecBackgroundAlgs/src/BeamBackgroundFiller.cxx @@ -75,7 +75,7 @@ StatusCode BeamBackgroundFiller::initialize() { CHECK( m_idHelperTool.retrieve() ); CHECK( m_idToFixedIdTool.retrieve() ); - ATH_CHECK(m_cscSegmentContainerReadHandleKey.initialize()); + if (m_idHelperTool->hasCSC()) ATH_CHECK(m_cscSegmentContainerReadHandleKey.initialize()); ATH_CHECK(m_mdtSegmentContainerReadHandleKey.initialize()); ATH_CHECK(m_caloClusterContainerReadHandleKey.initialize()); ATH_CHECK(m_jetContainerReadHandleKey.initialize()); @@ -127,39 +127,41 @@ void BeamBackgroundFiller::FillMatchMatrix() m_matchMatrix.clear(); m_resultClus.clear(); - // select only the CSC segments with the global direction parallel to the beam pipe - SG::ReadHandle<Trk::SegmentCollection> cscSegmentReadHandle(m_cscSegmentContainerReadHandleKey); - - if (!cscSegmentReadHandle.isValid()) { - ATH_MSG_WARNING("Invalid ReadHandle to Trk::SegmentCollection with name: " << m_cscSegmentContainerReadHandleKey); - } - else { - ATH_MSG_DEBUG(m_cscSegmentContainerReadHandleKey << " retrieved from StoreGate"); - - unsigned int cscSegmentCounter = 0; - for (auto thisCSCSegment : *cscSegmentReadHandle){ - cscSegmentCounter++; - const Muon::MuonSegment* seg = dynamic_cast<const Muon::MuonSegment*>(thisCSCSegment); - - if (!seg) std::abort(); - - Identifier id = m_edmHelperSvc->chamberId(*seg); - if ( !id.is_valid() ) continue; - if ( !m_idHelperTool->isMuon(id) ) continue; - - if ( !m_idHelperTool->isCsc(id) ) continue; - - const Amg::Vector3D& globalPos = seg->globalPosition(); - const Amg::Vector3D& globalDir = seg->globalDirection(); - double thetaPos = globalPos.theta(); - double thetaDir = globalDir.theta(); - - double d2r = TMath::Pi()/180.; - if( TMath::Cos(2.*(thetaPos-thetaDir)) > TMath::Cos(2.*m_cutThetaCsc*d2r) ) continue; - - ElementLink<Trk::SegmentCollection> segLink; - segLink.toIndexedElement(*cscSegmentReadHandle, cscSegmentCounter-1); - m_indexSeg.push_back(segLink); + if (m_idHelperTool->hasCSC()) { + // select only the CSC segments with the global direction parallel to the beam pipe + SG::ReadHandle<Trk::SegmentCollection> cscSegmentReadHandle(m_cscSegmentContainerReadHandleKey); + + if (!cscSegmentReadHandle.isValid()) { + ATH_MSG_WARNING("Invalid ReadHandle to Trk::SegmentCollection with name: " << m_cscSegmentContainerReadHandleKey); + } + else { + ATH_MSG_DEBUG(m_cscSegmentContainerReadHandleKey << " retrieved from StoreGate"); + + unsigned int cscSegmentCounter = 0; + for (auto thisCSCSegment : *cscSegmentReadHandle){ + cscSegmentCounter++; + const Muon::MuonSegment* seg = dynamic_cast<const Muon::MuonSegment*>(thisCSCSegment); + + if (!seg) std::abort(); + + Identifier id = m_edmHelperSvc->chamberId(*seg); + if ( !id.is_valid() ) continue; + if ( !m_idHelperTool->isMuon(id) ) continue; + + if ( !m_idHelperTool->isCsc(id) ) continue; + + const Amg::Vector3D& globalPos = seg->globalPosition(); + const Amg::Vector3D& globalDir = seg->globalDirection(); + double thetaPos = globalPos.theta(); + double thetaDir = globalDir.theta(); + + double d2r = TMath::Pi()/180.; + if( TMath::Cos(2.*(thetaPos-thetaDir)) > TMath::Cos(2.*m_cutThetaCsc*d2r) ) continue; + + ElementLink<Trk::SegmentCollection> segLink; + segLink.toIndexedElement(*cscSegmentReadHandle, cscSegmentCounter-1); + m_indexSeg.push_back(segLink); + } } } diff --git a/Reconstruction/RecExample/RecExCommon/share/CombinedRec_config.py b/Reconstruction/RecExample/RecExCommon/share/CombinedRec_config.py index 36779212565123795ffcacb6e9ba2e22b76a9a26..7c046ebf5ebd673c806c2f67f9ce5f258ba8419b 100755 --- a/Reconstruction/RecExample/RecExCommon/share/CombinedRec_config.py +++ b/Reconstruction/RecExample/RecExCommon/share/CombinedRec_config.py @@ -60,7 +60,7 @@ if rec.doESD() and recAlgs.doTrackParticleCellAssociation() and DetFlags.ID_on() # functionality : energy flow # pdr.flag_domain('eflow') -if recAlgs.doEFlow() and ( rec.readESD() or ( DetFlags.haveRIO.ID_on() and DetFlags.haveRIO.Calo_allOn() and DetFlags.haveRIO.Muon_allOn()) ) : +if recAlgs.doEFlow() and (rec.readESD() or (DetFlags.haveRIO.ID_on() and DetFlags.haveRIO.Calo_allOn() and rec.doMuon())): try: include( "eflowRec/eflowRec_jobOptions.py" ) except Exception: diff --git a/Reconstruction/RecExample/RecExRecoTest/share/RecExRecoTest_ART_muons_fromESD.py b/Reconstruction/RecExample/RecExRecoTest/share/RecExRecoTest_ART_muons_fromESD.py index 428977e8310dea2b817e3f54e6ca906a0d461be5..1e7b06f81a814587e41fbb0518fc98807f529c01 100644 --- a/Reconstruction/RecExample/RecExRecoTest/share/RecExRecoTest_ART_muons_fromESD.py +++ b/Reconstruction/RecExample/RecExRecoTest/share/RecExRecoTest_ART_muons_fromESD.py @@ -56,7 +56,6 @@ muonRecFlags.doTrackPerformance = True muonRecFlags.TrackPerfSummaryLevel = 2 muonRecFlags.TrackPerfDebugLevel = 5 muonRecFlags.doCSCs = True -muonRecFlags.doNSWNewThirdChain = True muonStandaloneFlags.printSummary = True muonCombinedRecFlags.doTrackPerformance = True diff --git a/Reconstruction/RecExample/RecJobTransformTests/share/RecJobTransformTests_MuonRec_myTopOptions_MT.py b/Reconstruction/RecExample/RecJobTransformTests/share/RecJobTransformTests_MuonRec_myTopOptions_MT.py index f2bf473e4967ebbe4709f620418d0f5a0c699222..0286d27b0716013a6729ec1fcc0d12672beca521 100644 --- a/Reconstruction/RecExample/RecJobTransformTests/share/RecJobTransformTests_MuonRec_myTopOptions_MT.py +++ b/Reconstruction/RecExample/RecJobTransformTests/share/RecJobTransformTests_MuonRec_myTopOptions_MT.py @@ -61,7 +61,6 @@ muonRecFlags.doTrackPerformance = True muonRecFlags.TrackPerfSummaryLevel = 2 muonRecFlags.TrackPerfDebugLevel = 5 muonRecFlags.doCSCs = True -muonRecFlags.doNSWNewThirdChain = False # flags to tweak standalone muon reconstruction if doMig5: diff --git a/Simulation/G4Atlas/G4AtlasApps/python/SimAtlasKernel.py b/Simulation/G4Atlas/G4AtlasApps/python/SimAtlasKernel.py index bb3b79eb6f9461ddecbf68181ee774a4019d0091..6ccb5ad359e1f622b0f7eb093b282614b3921825 100644 --- a/Simulation/G4Atlas/G4AtlasApps/python/SimAtlasKernel.py +++ b/Simulation/G4Atlas/G4AtlasApps/python/SimAtlasKernel.py @@ -53,7 +53,7 @@ class AtlasSimSkeleton(SimSkeleton): DetFlags.sTGC_setOff() DetFlags.Micromegas_setOff() from AtlasGeoModel.CommonGMJobProperties import CommonGeometryFlags - if ( hasattr(simFlags, 'SimulateNewSmallWheel') and simFlags.SimulateNewSmallWheel() ) or CommonGeometryFlags.Run()=="RUN3" : + if CommonGeometryFlags.Run() in ["RUN3", "RUN4"]: DetFlags.sTGC_setOn() DetFlags.Micromegas_setOn() @@ -174,23 +174,6 @@ class AtlasSimSkeleton(SimSkeleton): from MuonGeoModel.MuonGeoModelConf import MuonDetectorTool MuonDetectorTool = MuonDetectorTool() MuonDetectorTool.FillCacheInitTime = 0 # default is 1 - from AtlasGeoModel.CommonGMJobProperties import CommonGeometryFlags - if ( hasattr(simFlags, 'SimulateNewSmallWheel') and simFlags.SimulateNewSmallWheel() ) or CommonGeometryFlags.Run()=="RUN3" : - AtlasG4Eng.G4Eng.log.info("Removing the original small wheel") - MuonDetectorTool.StationSelection = 2 - MuonDetectorTool.SelectedStations = [ "EIL1" ] - MuonDetectorTool.SelectedStations += [ "EIL2" ] - MuonDetectorTool.SelectedStations += [ "EIL6" ] - MuonDetectorTool.SelectedStations += [ "EIL7" ] - MuonDetectorTool.SelectedStations += [ "EIS*" ] - MuonDetectorTool.SelectedStations += [ "EIL10" ] - MuonDetectorTool.SelectedStations += [ "EIL11" ] - MuonDetectorTool.SelectedStations += [ "EIL12" ] - MuonDetectorTool.SelectedStations += [ "EIL17" ] - MuonDetectorTool.SelectedStations += [ "CSS*" ] - MuonDetectorTool.SelectedStations += [ "CSL*" ] - MuonDetectorTool.SelectedStations += [ "T4E*" ] - MuonDetectorTool.SelectedStations += [ "T4F*" ] ## Additional material in the muon system from AGDD2GeoSvc.AGDD2GeoSvcConf import AGDDtoGeoSvc @@ -199,7 +182,8 @@ class AtlasSimSkeleton(SimSkeleton): if not "MuonAGDDTool/MuonSpectrometer" in AGDD2Geo.Builders: ToolSvc += CfgGetter.getPublicTool("MuonSpectrometer", checkType=True) AGDD2Geo.Builders += ["MuonAGDDTool/MuonSpectrometer"] - if ( hasattr(simFlags, 'SimulateNewSmallWheel') and simFlags.SimulateNewSmallWheel() ) or CommonGeometryFlags.Run()=="RUN3" : + from AtlasGeoModel.CommonGMJobProperties import CommonGeometryFlags + if CommonGeometryFlags.Run() in ["RUN3", "RUN4"]: if not "NSWAGDDTool/NewSmallWheel" in AGDD2Geo.Builders: ToolSvc += CfgGetter.getPublicTool("NewSmallWheel", checkType=True) AGDD2Geo.Builders += ["NSWAGDDTool/NewSmallWheel"] diff --git a/Simulation/G4Atlas/G4AtlasApps/python/SimSkeleton.py b/Simulation/G4Atlas/G4AtlasApps/python/SimSkeleton.py index 06a9ee195e413bf8e33d953f0e16ad92441e4d19..9e76433cbe37d72daaf6ef58460b13a2f5cdadcf 100644 --- a/Simulation/G4Atlas/G4AtlasApps/python/SimSkeleton.py +++ b/Simulation/G4Atlas/G4AtlasApps/python/SimSkeleton.py @@ -100,11 +100,12 @@ class SimSkeleton(object): if DetFlags.Muon_on(): stream1.ItemList += ["RPCSimHitCollection#*", "TGCSimHitCollection#*", - "CSCSimHitCollection#*", "MDTSimHitCollection#*", "TrackRecordCollection#MuonExitLayer"] + from AtlasGeoModel.MuonGMJobProperties import MuonGeometryFlags + if MuonGeometryFlags.hasCSC(): stream1.ItemList += ["CSCSimHitCollection#*"] from AtlasGeoModel.CommonGMJobProperties import CommonGeometryFlags - if ( hasattr(simFlags, 'SimulateNewSmallWheel') and simFlags.SimulateNewSmallWheel() ) or CommonGeometryFlags.Run()=="RUN3" : + if (CommonGeometryFlags.Run() in ["RUN3", "RUN4"]): stream1.ItemList += ["sTGCSimHitCollection#*"] stream1.ItemList += ["MMSimHitCollection#*"] ## Lucid diff --git a/Simulation/G4Atlas/G4AtlasApps/python/atlas_flags.py b/Simulation/G4Atlas/G4AtlasApps/python/atlas_flags.py index 642e4e9913e0421254da4f2ee084b40e646b5c2b..30f4ab0bc3dd1692a9c702e31fc2c959e969b072 100644 --- a/Simulation/G4Atlas/G4AtlasApps/python/atlas_flags.py +++ b/Simulation/G4Atlas/G4AtlasApps/python/atlas_flags.py @@ -326,15 +326,6 @@ class VertexOverrideEventFile(JobProperty): allowedTypes = ['str'] StoredValues = 'VertexOverrideEventFile.txt' -class SimulateNewSmallWheel(JobProperty): - """ - Will this job simulate the New Small Wheel in the Muon - Spectrometer? - """ - statusOn = False - allowedTypes = ['bool'] - StoredValue = False - class BeamEffectOptions(JobProperty): """ Set options for beam effects transport diff --git a/Simulation/G4Atlas/G4AtlasApps/share/G4Atlas.flat.configuration.py b/Simulation/G4Atlas/G4AtlasApps/share/G4Atlas.flat.configuration.py index dce8e404f5d51659cd0ef4930c8a07e8c92279b5..11c7546cc62f6ddc39cbba3e4df262b6fa33dfe5 100644 --- a/Simulation/G4Atlas/G4AtlasApps/share/G4Atlas.flat.configuration.py +++ b/Simulation/G4Atlas/G4AtlasApps/share/G4Atlas.flat.configuration.py @@ -31,9 +31,12 @@ DetFlags.DBM_setOff() DetFlags.sTGC_setOff() DetFlags.Micromegas_setOff() from AtlasGeoModel.CommonGMJobProperties import CommonGeometryFlags -if ( hasattr(simFlags, 'SimulateNewSmallWheel') and simFlags.SimulateNewSmallWheel() ) or CommonGeometryFlags.Run()=="RUN3" : +if (CommonGeometryFlags.Run() in ["RUN3", "RUN4"]): DetFlags.sTGC_setOn() DetFlags.Micromegas_setOn() +from AtlasGeoModel.MuonGMJobProperties import MuonGeometryFlags +if not MuonGeometryFlags.hasCSC(): + DetFlags.CSC_setOff() ## Switch off tasks DetFlags.pileup.all_setOff() @@ -119,33 +122,13 @@ if simFlags.SimulateCavern.get_Value(): gms.AlignCallbacks = False ## Muon GeoModel tweaks if DetFlags.Muon_on(): - ## Turn off caching in the muon system - from MuonGeoModel.MuonGeoModelConf import MuonDetectorTool - MuonDetectorTool = MuonDetectorTool() - MuonDetectorTool.FillCacheInitTime = 0 # default is 1 - if ( hasattr(simFlags, 'SimulateNewSmallWheel') and simFlags.SimulateNewSmallWheel() ) or CommonGeometryFlags.Run()=="RUN3" : - MuonDetectorTool.StationSelection = 2 - MuonDetectorTool.SelectedStations = [ "EIL1" ] - MuonDetectorTool.SelectedStations += [ "EIL2" ] - MuonDetectorTool.SelectedStations += [ "EIL6" ] - MuonDetectorTool.SelectedStations += [ "EIL7" ] - MuonDetectorTool.SelectedStations += [ "EIS*" ] - MuonDetectorTool.SelectedStations += [ "EIL10" ] - MuonDetectorTool.SelectedStations += [ "EIL11" ] - MuonDetectorTool.SelectedStations += [ "EIL12" ] - MuonDetectorTool.SelectedStations += [ "EIL17" ] - MuonDetectorTool.SelectedStations += [ "CSS*" ] - MuonDetectorTool.SelectedStations += [ "CSL*" ] - MuonDetectorTool.SelectedStations += [ "T4E*" ] - MuonDetectorTool.SelectedStations += [ "T4F*" ] - ## Additional material in the muon system from AGDD2GeoSvc.AGDD2GeoSvcConf import AGDDtoGeoSvc AGDD2Geo = AGDDtoGeoSvc() from AthenaCommon import CfgGetter if not "MuonAGDDTool/MuonSpectrometer" in AGDD2Geo.Builders.__str__(): AGDD2Geo.Builders += [CfgGetter.getPrivateTool("MuonSpectrometer", checkType=True)] - if ( hasattr(simFlags, 'SimulateNewSmallWheel') and simFlags.SimulateNewSmallWheel() ) or CommonGeometryFlags.Run()=="RUN3" : + if (CommonGeometryFlags.Run() in ["RUN3", "RUN4"]): if not "NSWAGDDTool/NewSmallWheel" in AGDD2Geo.Builders.__str__(): AGDD2Geo.Builders += [CfgGetter.getPrivateTool("NewSmallWheel", checkType=True)] theApp.CreateSvc += ["AGDDtoGeoSvc"] @@ -223,10 +206,10 @@ if not simFlags.ISFRun: if DetFlags.Muon_on(): stream1.ItemList += ["RPCSimHitCollection#*", "TGCSimHitCollection#*", - "CSCSimHitCollection#*", "MDTSimHitCollection#*", "TrackRecordCollection#MuonExitLayer"] - if ( hasattr(simFlags, 'SimulateNewSmallWheel') and simFlags.SimulateNewSmallWheel() ) or CommonGeometryFlags.Run()=="RUN3" : + if MuonGeometryFlags.hasCSC(): stream1.ItemList += ["CSCSimHitCollection#*"] + if (CommonGeometryFlags.Run() in ["RUN3", "RUN4"]): stream1.ItemList += ["sTGCSimHitCollection#*"] stream1.ItemList += ["MMSimHitCollection#*"] diff --git a/Simulation/G4Atlas/G4AtlasApps/share/Tile2000_2003.flat.configuration.py b/Simulation/G4Atlas/G4AtlasApps/share/Tile2000_2003.flat.configuration.py index 46af4a7f9b6302867c4aa965c8891c8f60c7a0b4..c26cfff953ad91b93fe4d48e0d072d0bdaab3ab6 100644 --- a/Simulation/G4Atlas/G4AtlasApps/share/Tile2000_2003.flat.configuration.py +++ b/Simulation/G4Atlas/G4AtlasApps/share/Tile2000_2003.flat.configuration.py @@ -192,10 +192,6 @@ if not simFlags.ISFRun: "CSCSimHitCollection#*", "MDTSimHitCollection#*", "TrackRecordCollection#MuonExitLayer"] - from AtlasGeoModel.CommonGMJobProperties import CommonGeometryFlags - if ( hasattr(simFlags, 'SimulateNewSmallWheel') and simFlags.SimulateNewSmallWheel() ) or CommonGeometryFlags.Run()=="RUN3" : - stream1.ItemList += ["sTGCSimHitCollection#*"] - stream1.ItemList += ["MMSimHitCollection#*"] ## Lucid if DetFlags.Lucid_on(): diff --git a/Simulation/G4Atlas/G4AtlasTests/share/postInclude.DCubeTest.py b/Simulation/G4Atlas/G4AtlasTests/share/postInclude.DCubeTest.py index 1cccc0734743b55c9a5bab3a38df1bfb57422b22..b8149d319e8fda97962ae76bfc3fdf0e5a28fee4 100644 --- a/Simulation/G4Atlas/G4AtlasTests/share/postInclude.DCubeTest.py +++ b/Simulation/G4Atlas/G4AtlasTests/share/postInclude.DCubeTest.py @@ -50,10 +50,11 @@ if DetFlags.Muon_on(): job.G4TestAlg.SimTestTools += [CfgGetter.getPrivateTool("MDTHitsTestTool", checkType=True)] job.G4TestAlg.SimTestTools += [CfgGetter.getPrivateTool("RPCHitsTestTool", checkType=True)] from AtlasGeoModel.CommonGMJobProperties import CommonGeometryFlags - if ( hasattr(simFlags, 'SimulateNewSmallWheel') and simFlags.SimulateNewSmallWheel() ) or CommonGeometryFlags.Run()=="RUN3" : + if (CommonGeometryFlags.Run() in ["RUN3", "RUN4"]): job.G4TestAlg.SimTestTools += [CfgGetter.getPrivateTool("MMHitsTestTool", checkType=True)] job.G4TestAlg.SimTestTools += [CfgGetter.getPrivateTool("sTGCHitsTestTool", checkType=True)] - else: + from AtlasGeoModel.MuonGMJobProperties import MuonGeometryFlags + if MuonGeometryFlags.hasCSC(): job.G4TestAlg.SimTestTools += [CfgGetter.getPrivateTool("CSCHitsTestTool", checkType=True)] job.G4TestAlg.SimTestTools += [CfgGetter.getPrivateTool("TGCHitsTestTool", checkType=True)] if DetFlags.Truth_on(): diff --git a/Simulation/G4Atlas/G4AtlasTests/share/postInclude.NSW.config.simu.py b/Simulation/G4Atlas/G4AtlasTests/share/postInclude.NSW.config.simu.py index 7d8d26b2650d4779cb6c1b150bae18d30711ea36..d3ef1c97c5e8e61e4bf8f17fabccdade857f492d 100644 --- a/Simulation/G4Atlas/G4AtlasTests/share/postInclude.NSW.config.simu.py +++ b/Simulation/G4Atlas/G4AtlasTests/share/postInclude.NSW.config.simu.py @@ -1,6 +1,4 @@ # needed to get the right dictionary from IdDictParser from GeoModelSvc.GeoModelSvcConf import GeoModelSvc GeoModelSvc = GeoModelSvc() -GeoModelSvc.MuonVersionOverride="MuonSpectrometer-R.07.00-NSW" -from AthenaCommon.AppMgr import ServiceMgr -if 'ReadAGDD' in ServiceMgr.AGDDtoGeoSvc.Builders["NewSmallWheel"].__slots__ : ServiceMgr.AGDDtoGeoSvc.Builders["NewSmallWheel"].ReadAGDD=False +GeoModelSvc.MuonVersionOverride="MuonSpectrometer-R.09.00.AsymNSW" diff --git a/Simulation/G4Atlas/G4AtlasTools/python/G4AtlasToolsConfig.py b/Simulation/G4Atlas/G4AtlasTools/python/G4AtlasToolsConfig.py index 5b5f9f37331a7adb56c4a1d54e2c2a51cc41c826..3240bdc2b0d74a560dfff3538002c2e0903f49ed 100644 --- a/Simulation/G4Atlas/G4AtlasTools/python/G4AtlasToolsConfig.py +++ b/Simulation/G4Atlas/G4AtlasTools/python/G4AtlasToolsConfig.py @@ -128,20 +128,16 @@ def generateMuonSensitiveDetectorList(): if DetFlags.simulate.MDT_on() : SensitiveDetectorList += [ 'MDTSensitiveDetectorCosmics' ] if DetFlags.simulate.RPC_on() : SensitiveDetectorList += [ 'RPCSensitiveDetectorCosmics' ] if DetFlags.simulate.TGC_on() : SensitiveDetectorList += [ 'TGCSensitiveDetectorCosmics' ] + if DetFlags.simulate.CSC_on() : SensitiveDetectorList += [ 'CSCSensitiveDetectorCosmics' ] else: if DetFlags.simulate.MDT_on() : SensitiveDetectorList += [ 'MDTSensitiveDetector' ] if DetFlags.simulate.RPC_on() : SensitiveDetectorList += [ 'RPCSensitiveDetector' ] if DetFlags.simulate.TGC_on() : SensitiveDetectorList += [ 'TGCSensitiveDetector' ] + if DetFlags.simulate.CSC_on() : SensitiveDetectorList += [ 'CSCSensitiveDetector' ] from AtlasGeoModel.CommonGMJobProperties import CommonGeometryFlags - if ( hasattr(simFlags, 'SimulateNewSmallWheel') and simFlags.SimulateNewSmallWheel() ) or CommonGeometryFlags.Run()=="RUN3" : + if (CommonGeometryFlags.Run() in ["RUN3", "RUN4"]): if DetFlags.simulate.sTGC_on() : SensitiveDetectorList += [ 'sTGCSensitiveDetector' ] if DetFlags.simulate.Micromegas_on() : SensitiveDetectorList += [ 'MicromegasSensitiveDetector' ] - elif DetFlags.simulate.CSC_on(): - # CSCs built instead of NSW - if jobproperties.Beam.beamType() == 'cosmics': - SensitiveDetectorList += [ 'CSCSensitiveDetectorCosmics' ] - else: - SensitiveDetectorList += [ 'CSCSensitiveDetector' ] return SensitiveDetectorList def generateEnvelopeSensitiveDetectorList(): diff --git a/Simulation/ISF/ISF_Config/share/AllDet_detDescr.py b/Simulation/ISF/ISF_Config/share/AllDet_detDescr.py index a7973c4ec9eccc45deed6e37f200cc54d55b795c..eb8305d13058dc4aa498d179b6bfe2e596717390 100644 --- a/Simulation/ISF/ISF_Config/share/AllDet_detDescr.py +++ b/Simulation/ISF/ISF_Config/share/AllDet_detDescr.py @@ -21,7 +21,11 @@ if DetFlags.detdescr.any_on(): protectedInclude( "TileConditions/TileConditions_jobOptions.py" ) if DetFlags.detdescr.Muon_on(): - protectedInclude ("AmdcAth/AmdcAth_jobOptions.py") + protectedInclude ("AmdcAth/AmdcAth_jobOptions.py") + + from AtlasGeoModel.MuonGMJobProperties import MuonGeometryFlags + if not MuonGeometryFlags.hasCSC(): + DetFlags.CSC_setOff() # MagneticField Service if DetFlags.detdescr.BField_on(): diff --git a/Simulation/ISF/ISF_Example/python/ISF_Output.py b/Simulation/ISF/ISF_Example/python/ISF_Output.py index 4c37e151661c82f55c9970c65528f838db9fb86a..2e751ae2451d7b6677eafbaaca183d7b57d11f49 100644 --- a/Simulation/ISF/ISF_Example/python/ISF_Output.py +++ b/Simulation/ISF/ISF_Example/python/ISF_Output.py @@ -41,11 +41,12 @@ def getHITSStreamItemList(): if DetFlags.Muon_on(): hitsItemList += ["RPCSimHitCollection#*", "TGCSimHitCollection#*", - "CSCSimHitCollection#*", "MDTSimHitCollection#*", "TrackRecordCollection#MuonExitLayer"] + from AtlasGeoModel.MuonGMJobProperties import MuonGeometryFlags + if MuonGeometryFlags.hasCSC(): hitsItemList += ["CSCSimHitCollection#*"] from AtlasGeoModel.CommonGMJobProperties import CommonGeometryFlags - if ( hasattr(simFlags, 'SimulateNewSmallWheel') and simFlags.SimulateNewSmallWheel() ) or CommonGeometryFlags.Run()=="RUN3" : + if (CommonGeometryFlags.Run() in ["RUN3", "RUN4"]): hitsItemList += ["sTGCSimHitCollection#*"] hitsItemList += ["MMSimHitCollection#*"] hitsItemList += ["GenericMuonSimHitCollection#*"] diff --git a/Simulation/Tests/SimCoreTests/test/test_AtlasG4_NSWSimTest_NewGeoConf.sh b/Simulation/Tests/SimCoreTests/test/test_AtlasG4_NSWSimTest_NewGeoConf.sh index 0ad7462dc027a486e68481cd565efd5530ff3d85..b5b10f7fc58d3e2f1f68a7f4782485fdd94722dd 100755 --- a/Simulation/Tests/SimCoreTests/test/test_AtlasG4_NSWSimTest_NewGeoConf.sh +++ b/Simulation/Tests/SimCoreTests/test/test_AtlasG4_NSWSimTest_NewGeoConf.sh @@ -13,7 +13,7 @@ AtlasG4_tf.py \ --outputHITSFile 'test.HITS.pool.root' \ --maxEvents '200' \ --randomSeed '10' \ ---geometryVersion 'ATLAS-R3-2021-00-00-00_VALIDATION' \ +--geometryVersion 'ATLAS-R3-2021-01-00-00_VALIDATION' \ --conditionsTag 'OFLCOND-RUN12-SDR-25' \ --physicsList 'FTFP_BERT' \ --postInclude 'G4AtlasTests/postInclude.DCubeTest.py,PyJobTransforms/UseFrontier.py' \ diff --git a/Simulation/Tests/SimCoreTests/test/test_AtlasG4_NSWSimTest_OldGeoConf.sh b/Simulation/Tests/SimCoreTests/test/test_AtlasG4_NSWSimTest_OldGeoConf.sh index 0ee749fe28508361da2efdc2cbfa267e2a26cd29..1231e23895a633475c4434cd31fea59670504970 100755 --- a/Simulation/Tests/SimCoreTests/test/test_AtlasG4_NSWSimTest_OldGeoConf.sh +++ b/Simulation/Tests/SimCoreTests/test/test_AtlasG4_NSWSimTest_OldGeoConf.sh @@ -18,7 +18,7 @@ AtlasG4_tf.py \ --physicsList 'FTFP_BERT' \ --DBRelease 'current' \ --postInclude 'G4AtlasTests/postInclude.DCubeTest.py,G4AtlasTests/postInclude.NSW.config.simu.py' \ ---preExec 'simFlags.ReleaseGeoModel=False;simFlags.SimulateNewSmallWheel=True;' \ +--preExec 'simFlags.ReleaseGeoModel=False;' \ --imf False rc=$? diff --git a/Tools/FullChainTransforms/share/FastChainSkeleton.EVGENtoRDO.py b/Tools/FullChainTransforms/share/FastChainSkeleton.EVGENtoRDO.py index 3d7d254f7cdcd3ab346a1f8d48cf83396492808b..0d849955625d3bfadf728b1d99d35c49c02b6bb3 100644 --- a/Tools/FullChainTransforms/share/FastChainSkeleton.EVGENtoRDO.py +++ b/Tools/FullChainTransforms/share/FastChainSkeleton.EVGENtoRDO.py @@ -294,10 +294,10 @@ if checkHGTDOff is not None: ## Tidy up DBM DetFlags: temporary measure DetFlags.DBM_setOff() -if hasattr(simFlags, 'SimulateNewSmallWheel'): - if simFlags.SimulateNewSmallWheel(): - DetFlags.sTGC_setOn() - DetFlags.Micromegas_setOn() +from AtlasGeoModel.CommonGMJobProperties import CommonGeometryFlags +if (CommonGeometryFlags.Run() in ["RUN3", "RUN4"]): + DetFlags.sTGC_setOn() + DetFlags.Micromegas_setOn() #if simFlags.ForwardDetectors.statusOn: # if DetFlags.geometry.FwdRegion_on(): @@ -771,36 +771,14 @@ if ISF_Flags.UsingGeant4(): gms.AlignCallbacks = False ## Muon GeoModel tweaks if DetFlags.Muon_on(): - ## Turn off caching in the muon system - from MuonGeoModel.MuonGeoModelConf import MuonDetectorTool - MuonDetectorTool = MuonDetectorTool() - MuonDetectorTool.FillCacheInitTime = 0 # default is 1 - if hasattr(simFlags, 'SimulateNewSmallWheel'): - if simFlags.SimulateNewSmallWheel(): - MuonDetectorTool.StationSelection = 2 - MuonDetectorTool.SelectedStations = [ "EIL1" ] - MuonDetectorTool.SelectedStations += [ "EIL2" ] - MuonDetectorTool.SelectedStations += [ "EIL6" ] - MuonDetectorTool.SelectedStations += [ "EIL7" ] - MuonDetectorTool.SelectedStations += [ "EIS*" ] - MuonDetectorTool.SelectedStations += [ "EIL10" ] - MuonDetectorTool.SelectedStations += [ "EIL11" ] - MuonDetectorTool.SelectedStations += [ "EIL12" ] - MuonDetectorTool.SelectedStations += [ "EIL17" ] - MuonDetectorTool.SelectedStations += [ "CSS*" ] - MuonDetectorTool.SelectedStations += [ "CSL*" ] - MuonDetectorTool.SelectedStations += [ "T4E*" ] - MuonDetectorTool.SelectedStations += [ "T4F*" ] - ## Additional material in the muon system from AGDD2GeoSvc.AGDD2GeoSvcConf import AGDDtoGeoSvc AGDD2Geo = AGDDtoGeoSvc() if not "MuonAGDDTool/MuonSpectrometer" in AGDD2Geo.Builders.__str__(): AGDD2Geo.Builders += [CfgGetter.getPrivateTool("MuonSpectrometer", checkType=True)] - if hasattr(simFlags, 'SimulateNewSmallWheel'): - if simFlags.SimulateNewSmallWheel(): - if not "NSWAGDDTool/NewSmallWheel" in AGDD2Geo.Builders.__str__(): - AGDD2Geo.Builders += [CfgGetter.getPrivateTool("NewSmallWheel", checkType=True)] + if (CommonGeometryFlags.Run() in ["RUN3", "RUN4"]): + if not "NSWAGDDTool/NewSmallWheel" in AGDD2Geo.Builders.__str__(): + AGDD2Geo.Builders += [CfgGetter.getPrivateTool("NewSmallWheel", checkType=True)] theApp.CreateSvc += ["AGDDtoGeoSvc"] ServiceMgr += AGDD2Geo diff --git a/Tools/PROCTools/python/RunTier0TestsTools.py b/Tools/PROCTools/python/RunTier0TestsTools.py index ebd759127d843cdf3e08a47d0b0a51a687bacffa..0959c82c458afd16a93b673e2989bcaa208015a1 100644 --- a/Tools/PROCTools/python/RunTier0TestsTools.py +++ b/Tools/PROCTools/python/RunTier0TestsTools.py @@ -24,9 +24,9 @@ ciRefFileMap = { 's3126-22.0' : 'v7', # OverlayTier0Test_required-test 'overlay-d1498-21.0' : 'v2', - 'overlay-d1498-22.0' : 'v20', + 'overlay-d1498-22.0' : 'v21', 'overlay-bkg-21.0' : 'v1', - 'overlay-bkg-22.0' : 'v1', + 'overlay-bkg-22.0' : 'v2', } diff --git a/Trigger/TrigAlgorithms/TrigMuonEF/python/TrigMuonEFConfig.py b/Trigger/TrigAlgorithms/TrigMuonEF/python/TrigMuonEFConfig.py index a4750441f1b55179e3d073f1e503f63f99507ccd..e1c67d57e24f5e44011b90bf06161a2806c39fed 100755 --- a/Trigger/TrigAlgorithms/TrigMuonEF/python/TrigMuonEFConfig.py +++ b/Trigger/TrigAlgorithms/TrigMuonEF/python/TrigMuonEFConfig.py @@ -20,6 +20,10 @@ from MuonCombinedRecExample.MuonCombinedRecFlags import muonCombinedRecFlags from TrkDetDescrSvc.AtlasTrackingGeometrySvc import AtlasTrackingGeometrySvc +from MuonRecExample.MuonRecFlags import muonRecFlags +from AtlasGeoModel.CommonGMJobProperties import CommonGeometryFlags +from AtlasGeoModel.MuonGMJobProperties import MuonGeometryFlags + #Offline calorimeter isolation tool #from TrackInCaloTools import TrackInCaloTools #TMEFTrackInCaloTools = TrackInCaloTools.TrackInCaloTools(name='MuonIsoTrackInCaloTools') @@ -101,7 +105,7 @@ def TMEF_CaloTrackStateOnSurface(name='TMEF_CaloTrackStateOnSurface',**kwargs): def TMEF_TrackSummaryTool(name='TMEF_TrackSummaryTool',**kwargs): # always setup muon tool - kwargs.setdefault("MuonSummaryHelperTool", "MuonTrackSummaryHelper") + kwargs.setdefault("MuonSummaryHelperTool", "MuonTrackSummaryHelperTool") kwargs.setdefault("doSharedHits", False) # only add ID tool if ID is on if DetFlags.detdescr.ID_on(): @@ -160,7 +164,6 @@ def TMEF_TrackCleaner(name = 'TMEF_TrackCleaner',**kwargs): if not TriggerFlags.run2Config == '2016': kwargs.setdefault("Iterate", False) kwargs.setdefault("RecoverOutliers", False) - from MuonRecExample.MuonRecFlags import muonRecFlags if muonRecFlags.doSegmentT0Fit(): kwargs.setdefault("RecoverOutliers", False) return CfgMgr.Muon__MuonTrackCleaner(name,**kwargs) @@ -207,7 +210,6 @@ def TMEF_CombinedMuonTrackBuilder(name='TMEF_CombinedMuonTrackBuilder',**kwargs) # extra w.r.t. Muid Offline kwargs.setdefault("Cleaner", "TMEF_TrackCleaner") - from MuonRecExample.MuonRecFlags import muonRecFlags if muonRecFlags.doSegmentT0Fit(): kwargs.setdefault("MdtRotCreator", "") @@ -222,7 +224,9 @@ def TMEF_CombinedMuonTrackBuilder(name='TMEF_CombinedMuonTrackBuilder',**kwargs) RefitTool = CfgGetter.getPublicToolClone("TMEF_MuidRefitTool", "MuonRefitTool", AlignmentErrors = False, - Fitter = CfgGetter.getPublicTool("iPatFitter")))) + Fitter = CfgGetter.getPublicTool("iPatFitter"), + CscRotCreator=("Muon::CscClusterOnTrackCreator/CscClusterOnTrackCreator" if MuonGeometryFlags.hasCSC() else "")) + )) return CfgMgr.Rec__CombinedMuonTrackBuilder(name,**kwargs) @@ -400,7 +404,10 @@ def TMEF_MuonLayerSegmentFinderTool(name="TMEF_MuonLayerSegmentFinderTool",**kwa kwargs.setdefault('MuonRecoValidationTool','') kwargs.setdefault('MuonPRDSelectionTool','TMEF_MuonPRDSelectionTool') kwargs.setdefault('MuonClusterSegmentFinder','TMEF_MuonClusterSegmentFinder') - kwargs.setdefault('NSWMuonClusterSegmentFinderTool','TMEF_MuonClusterSegmentFinderTool') + if not MuonGeometryFlags.hasCSC(): + kwargs.setdefault('Csc2DSegmentMaker', '') + kwargs.setdefault('Csc4DSegmentMaker', '') + if (CommonGeometryFlags.Run() in ["RUN3", "RUN4"]): kwargs.setdefault('NSWMuonClusterSegmentFinderTool','TMEF_MuonClusterSegmentFinderTool') return CfgMgr.Muon__MuonLayerSegmentFinderTool(name,**kwargs) def TMEF_MuonInsideOutRecoTool(name="TMEF_MuonInsideOutRecoTool",**kwargs): @@ -467,10 +474,12 @@ class TrigMuonEFStandaloneTrackToolConfig (TrigMuonEFStandaloneTrackTool): def __init__( self, name="TrigMuonEFStandaloneTrackTool", **kwargs ): super( TrigMuonEFStandaloneTrackToolConfig, self ).__init__( name, **kwargs ) - self.CscClusterProvider = CfgGetter.getPublicTool("CscThresholdClusterBuilderTool") + if MuonGeometryFlags.hasCSC(): self.CscClusterProvider = CfgGetter.getPublicTool("CscThresholdClusterBuilderTool") self.SegmentsFinderTool = CfgGetter.getPublicToolClone( "TMEF_SegmentsFinderTool","MooSegmentFinder", - HoughPatternFinder = CfgGetter.getPublicTool("MuonLayerHoughTool")) + HoughPatternFinder = CfgGetter.getPublicTool("MuonLayerHoughTool"), + Csc2dSegmentMaker=("Csc2dSegmentMaker/Csc2dSegmentMaker" if MuonGeometryFlags.hasCSC() else ""), + Csc4dSegmentMaker=("Csc4dSegmentMaker/Csc4dSegmentMaker" if MuonGeometryFlags.hasCSC() else "")) CfgGetter.getPublicTool("MuonHoughPatternFinderTool").RecordAll=False CfgGetter.getPublicTool("MuonLayerHoughTool").DoTruth=False @@ -482,21 +491,20 @@ class TrigMuonEFStandaloneTrackToolConfig (TrigMuonEFStandaloneTrackTool): self.DecodeMdtBS = DetFlags.readRDOBS.MDT_on() self.DecodeRpcBS = DetFlags.readRDOBS.RPC_on() self.DecodeTgcBS = DetFlags.readRDOBS.TGC_on() - self.DecodeCscBS = DetFlags.readRDOBS.CSC_on() + if MuonGeometryFlags.hasCSC(): self.DecodeCscBS = DetFlags.readRDOBS.CSC_on() # use seeded decoding if (TriggerFlags.MuonSlice.doEFRoIDrivenAccess()): self.useMdtSeededDecoding = True self.useRpcSeededDecoding = True self.useTgcSeededDecoding = True - self.useCscSeededDecoding = True + if MuonGeometryFlags.hasCSC(): self.useCscSeededDecoding = True # use ROB based seeded decoding instead of PRD based self.useTgcRobDecoding = False # neither available nor needed self.useCscRobDecoding = False # neither available nor needed - from MuonRecExample.MuonRecFlags import muonRecFlags self.useRpcData=muonRecFlags.doRPCs() self.useTgcData=muonRecFlags.doTGCs() self.useCscData=muonRecFlags.doCSCs() diff --git a/Trigger/TrigAlgorithms/TrigMuonEF/python/TrigMuonEFConfigDb.py b/Trigger/TrigAlgorithms/TrigMuonEF/python/TrigMuonEFConfigDb.py index e16fd57c85258799f81d311a72c324aeb7cb46c1..d3869717033fe465a42f6033ae096a3f39c33e7a 100644 --- a/Trigger/TrigAlgorithms/TrigMuonEF/python/TrigMuonEFConfigDb.py +++ b/Trigger/TrigAlgorithms/TrigMuonEF/python/TrigMuonEFConfigDb.py @@ -1,6 +1,7 @@ # Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration from AthenaCommon.CfgGetter import addAlgorithm,addTool,addService +from AtlasGeoModel.MuonGMJobProperties import MuonGeometryFlags addTool("TrigMuonEF.TrigMuonEFConfig.TrigMuonEFStandaloneTrackToolConfig", "TrigMuonEFStandaloneTrackTool") @@ -41,7 +42,7 @@ addTool("TrigMuonEF.TrigMuonEFConfig.TMEF_TrkMaterialProviderTool", "TMEF_TrkMat addTool("TrigMuonEF.TrigMuonEFConfig.TMEF_MuonCandidateTrackBuilderTool", "TMEF_MuonCandidateTrackBuilderTool") addTool("TrigMuonEF.TrigMuonEFConfig.TMEF_MuonInsideOutRecoTool", "TMEF_MuonInsideOutRecoTool") addTool("TrigMuonEF.TrigMuonEFConfig.TMEF_MuonPRDSelectionTool", "TMEF_MuonPRDSelectionTool") -addTool("TrigMuonEF.TrigMuonEFConfig.TMEF_MuonLayerSegmentFinderTool", "TMEF_MuonLayerSegmentFinderTool") +addTool("TrigMuonEF.TrigMuonEFConfig.TMEF_MuonLayerSegmentFinderTool", "TMEF_MuonLayerSegmentFinderTool", Csc2DSegmentMaker=("Csc2dSegmentMaker/Csc2dSegmentMaker" if MuonGeometryFlags.hasCSC() else ""), Csc4DSegmentMaker=("Csc4dSegmentMaker/Csc4dSegmentMaker" if MuonGeometryFlags.hasCSC() else "")) addTool("TrigMuonEF.TrigMuonEFConfig.TMEF_MuonClusterSegmentFinderTool", "TMEF_MuonClusterSegmentFinderTool") addTool("TrigMuonEF.TrigMuonEFConfig.TMEF_MuonClusterSegmentFinder", "TMEF_MuonClusterSegmentFinder") diff --git a/Trigger/TrigAlgorithms/TrigMuonEF/python/TrigMuonEFCosmicConfig.py b/Trigger/TrigAlgorithms/TrigMuonEF/python/TrigMuonEFCosmicConfig.py index 9c49ae81a959197e9606ffccd5bcd9c9d34fde55..46042b2cf02471b42c8593adafc955545d14d1ae 100755 --- a/Trigger/TrigAlgorithms/TrigMuonEF/python/TrigMuonEFCosmicConfig.py +++ b/Trigger/TrigAlgorithms/TrigMuonEF/python/TrigMuonEFCosmicConfig.py @@ -15,6 +15,7 @@ from AthenaCommon import CfgMgr, CfgGetter from MuonRecExample import MuonRecTools from MuonRecExample.MuonRecFlags import muonRecFlags +from AtlasGeoModel.MuonGMJobProperties import MuonGeometryFlags #from MuonRecExample.MuonRecUtils import AlgToolFactory,ServiceFactory,ConfiguredBase,getProperty from TrigTimeMonitor.TrigTimeHistToolConfig import TrigTimeHistToolConfig @@ -254,7 +255,7 @@ ToolSvc += TMEF_MooTrackBuilderCosmic #from MuonCombiTrackMaker.MuonCombiTrackMakerConf import Muon__MuonChamberHoleRecoveryTool TMEF_MuonChamberHoleRecoveryToolCosmic = CfgMgr.Muon__MuonChamberHoleRecoveryTool("TMEF_MuonChamberHoleRecoveryToolCosmic", - CscRotCreator = None, + CscRotCreator = "", MdtRotCreator = TMEF_MdtDriftCircleOnTrackCreatorCosmic ) ToolSvc += TMEF_MuonChamberHoleRecoveryToolCosmic @@ -324,7 +325,7 @@ ToolSvc += TMEF_MuonAmbiProcessorCosmic # particle creation, Analysis::Muon building and CBNT filling need summary helpers # indet and muon TrackSummaryHelper's: take existing public instances when available from TrkTrackSummaryTool.TrkTrackSummaryToolConf import Trk__TrackSummaryTool -MuonTrackSummaryHelperTool = MuonRecTools.getPublicTool("MuonTrackSummaryHelper") +MuonTrackSummaryHelperTool = MuonRecTools.getPublicTool("MuonTrackSummaryHelperTool") from AthenaCommon.DetFlags import DetFlags @@ -353,7 +354,7 @@ class TrigMuonEFSegmentFinderCosmicConfig (TrigMuonEFSegmentFinder): def __init__( self, name="TrigMuonEFSegmentFinderCosmic" ): super( TrigMuonEFSegmentFinderCosmicConfig, self ).__init__( name ) - self.CscClusterProvider = CfgGetter.getPublicTool("CscThresholdClusterBuilderTool") + if MuonGeometryFlags.hasCSC(): self.CscClusterProvider = CfgGetter.getPublicTool("CscThresholdClusterBuilderTool") from MuonRecExample.MooreTools import MooSegmentCombinationFinder self.SegmentsFinderTool = MooSegmentCombinationFinder("SegmentsFinderToolCosmic") diff --git a/Trigger/TrigT1/TrigT1NSW/share/NSWL1.py b/Trigger/TrigT1/TrigT1NSW/share/NSWL1.py index aa8962fc0d6477297b1c82f6ba51ed11e99e121d..abf77b9733086b828e5414b176a965ce0bf22a92 100755 --- a/Trigger/TrigT1/TrigT1NSW/share/NSWL1.py +++ b/Trigger/TrigT1/TrigT1NSW/share/NSWL1.py @@ -34,7 +34,7 @@ from AthenaCommon.AthenaCommonFlags import athenaCommonFlags athenaCommonFlags.AllowIgnoreConfigError=False #This job will stop if an include fails. from AthenaCommon.GlobalFlags import globalflags globalflags.ConditionsTag.set_Value_and_Lock("OFLCOND-RUN12-SDR-25") -globalflags.DetDescrVersion.set_Value_and_Lock("ATLAS-R3-2021-00-00-00") +globalflags.DetDescrVersion.set_Value_and_Lock("ATLAS-R3S-2021-01-00-00") from RecExConfig.RecFlags import rec as recFlags recFlags.doNameAuditor = True @@ -82,11 +82,14 @@ from AtlasGeoModel import GeoModelInit from GeoModelSvc.GeoModelSvcConf import GeoModelSvc GeoModelSvc = GeoModelSvc() +# use the symmetric NSW layout (no CSCs anymore) GeoModelSvc.MuonVersionOverride = "MuonSpectrometer-R.09.00.NSW" from MuonGeoModel.MuonGeoModelConf import MuonDetectorTool -MuonDetectorTool=MuonDetectorTool(UseCSC=False) +MuonDetectorTool=MuonDetectorTool(HasCSC=False, HasSTgc=True, HasMM=True) DetDescrCnvSvc = Service( "DetDescrCnvSvc" ) -DetDescrCnvSvc.UseCSC = False +DetDescrCnvSvc.HasCSC = False +DetDescrCnvSvc.HasSTgc = True +DetDescrCnvSvc.HasMM = True diff --git a/Trigger/TrigValidation/TrigMuonValidation/share/TrigMuonValidation_RTT_options.py b/Trigger/TrigValidation/TrigMuonValidation/share/TrigMuonValidation_RTT_options.py index d0a43ac964bb0047687311747971b18d1527e7c9..907e52acc97e67947e94e0889582c4481b476f80 100755 --- a/Trigger/TrigValidation/TrigMuonValidation/share/TrigMuonValidation_RTT_options.py +++ b/Trigger/TrigValidation/TrigMuonValidation/share/TrigMuonValidation_RTT_options.py @@ -16,6 +16,7 @@ rec.doAOD=False rec.doWriteTAG=False rec.doTrigger=True +from AtlasGeoModel.MuonGMJobProperties import MuonGeometryFlags def muonOnly(): TriggerFlags.Slices_all_setOff() @@ -43,7 +44,7 @@ from TrkTruthAlgs.TrkTruthAlgsConf import TrackParticleTruthAlg cols = ["HLT_TrackCollection_forCB","HLT_TrackCollection_MuonEFCombTrkTracks"] colsTP = ["HLT_xAOD__TrackParticleContainer_MuonEFInfo_ExtrapTrackParticles","HLT_xAOD__TrackParticleContainer_MuonEFInfo_CombTrackParticles"] -topSequence += MuonDetailedTrackTruthMaker(name="TrigMuEFDetailedTrackTruthMaker", TrackCollectionNames = cols,OutputLevel=INFO ) +topSequence += MuonDetailedTrackTruthMaker(name="TrigMuEFDetailedTrackTruthMaker", TrackCollectionNames=cols, OutputLevel=INFO, HasCSC=MuonGeometryFlags.hasCSC()) for i in range(0, len(cols) ): topSequence += TrackTruthSelector(name= cols[i] + "Selector", diff --git a/Trigger/TrigValidation/TrigMuonValidation/share/TrigMuonValidation_RTT_options_EFonly.py b/Trigger/TrigValidation/TrigMuonValidation/share/TrigMuonValidation_RTT_options_EFonly.py index bb214111a5d49a46ed85194e0708d9804ec45fed..42f8551e5dfb81bc1a4e591c0b9a340b11fc38d8 100755 --- a/Trigger/TrigValidation/TrigMuonValidation/share/TrigMuonValidation_RTT_options_EFonly.py +++ b/Trigger/TrigValidation/TrigMuonValidation/share/TrigMuonValidation_RTT_options_EFonly.py @@ -16,6 +16,7 @@ rec.doAOD=False rec.doWriteTAG=False rec.doTrigger=True +from AtlasGeoModel.MuonGMJobProperties import MuonGeometryFlags def muonOnly(): TriggerFlags.Slices_all_setOff() @@ -43,7 +44,7 @@ from TrkTruthAlgs.TrkTruthAlgsConf import TrackParticleTruthAlg cols = ["HLT_TrackCollection_forCB","HLT_TrackCollection_MuonEFCombTrkTracks"] colsTP = ["HLT_xAOD__TrackParticleContainer_MuonEFInfo_ExtrapTrackParticles","HLT_xAOD__TrackParticleContainer_MuonEFInfo_CombTrackParticles"] -topSequence += MuonDetailedTrackTruthMaker(name="TrigMuEFonlyDetailedTrackTruthMaker", TrackCollectionNames = cols,OutputLevel=INFO ) +topSequence += MuonDetailedTrackTruthMaker(name="TrigMuEFonlyDetailedTrackTruthMaker", TrackCollectionNames=cols, OutputLevel=INFO, HasCSC=MuonGeometryFlags.hasCSC()) for i in range(0, len(cols) ): topSequence += TrackTruthSelector(name= cols[i] + "Selector", diff --git a/Trigger/TriggerCommon/TriggerJobOpts/python/Lvl1SimulationConfig.py b/Trigger/TriggerCommon/TriggerJobOpts/python/Lvl1SimulationConfig.py index 67dca94d4ba3b0eb2a774fac4e7a6cf2a2afcb1e..ee30381aa7dca849326594f2b2cf666f8bf29594 100644 --- a/Trigger/TriggerCommon/TriggerJobOpts/python/Lvl1SimulationConfig.py +++ b/Trigger/TriggerCommon/TriggerJobOpts/python/Lvl1SimulationConfig.py @@ -100,7 +100,12 @@ def Lvl1SimulationSequence( flags = None ): DecodeTgcRDO = True, DecodeCscRDO = False, DecodeSTGC_RDO = False, - DecodeMM_RDO = False ) + DecodeMM_RDO = False, + # for those subdetectors where the decoding is turned off, no need to create a RDO_Decoder ToolHandle + mdtRdoDecoderTool="", + cscRdoDecoderTool="", + stgcRdoDecoderTool="", + mmRdoDecoderTool="") MuonRdoToMuonDigitTool.cscCalibTool = "CscCalibTool" from AthenaCommon.AppMgr import ToolSvc diff --git a/Trigger/TriggerCommon/TriggerJobOpts/python/Lvl1TriggerGetter.py b/Trigger/TriggerCommon/TriggerJobOpts/python/Lvl1TriggerGetter.py index 17460af419abcdc2420827ba53766908a0004714..5f5e2a9bf8840593430fe94584bc842ab3bb7dbf 100644 --- a/Trigger/TriggerCommon/TriggerJobOpts/python/Lvl1TriggerGetter.py +++ b/Trigger/TriggerCommon/TriggerJobOpts/python/Lvl1TriggerGetter.py @@ -85,7 +85,12 @@ class Lvl1SimulationGetter (Configured): DecodeTgcRDO = True, DecodeCscRDO = False, DecodeSTGC_RDO = False, - DecodeMM_RDO = False) + DecodeMM_RDO = False, + # for those subdetectors where the decoding is turned off, no need to create a RDO_Decoder ToolHandle + mdtRdoDecoderTool="", + cscRdoDecoderTool="", + stgcRdoDecoderTool="", + mmRdoDecoderTool="") from AthenaCommon.AppMgr import ToolSvc ToolSvc += MuonRdoToMuonDigitTool from MuonByteStreamCnvTest.MuonByteStreamCnvTestConf import MuonRdoToMuonDigit diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Muon/MuonSequenceSetup.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Muon/MuonSequenceSetup.py index 99a9423203d253e66e2c9497b53af86376dd0ba0..80b338cff5e1613c6d6d65462b6b420d66a329b2 100644 --- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Muon/MuonSequenceSetup.py +++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Muon/MuonSequenceSetup.py @@ -17,7 +17,6 @@ from MuonRecExample.MuonRecFlags import muonRecFlags muonRecFlags.doTrackPerformance = True muonRecFlags.TrackPerfSummaryLevel = 2 muonRecFlags.TrackPerfDebugLevel = 5 -muonRecFlags.doNSWNewThirdChain = False muonCombinedRecFlags.doCaloTrkMuId = False muonCombinedRecFlags.printSummary = False diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Muon/MuonSetup.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Muon/MuonSetup.py index 9e1d2c9bd947e1cdb03c45bea26884c87028ce93..a3712f5f28a2ce93e76b0fc6dd7a26ba9b1e0c14 100644 --- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Muon/MuonSetup.py +++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Muon/MuonSetup.py @@ -552,7 +552,7 @@ def muEFSARecoSequence( RoIs, name ): theTrackCleaner = getPublicToolClone("TrigMuonTrackCleanerSA_"+name, "MuonTrackCleaner", Fitter='TMEF_iPatFitter', SLFitter='TMEF_iPatFitter') from TrkTrackSummaryTool.TrkTrackSummaryToolConf import Trk__TrackSummaryTool - trkSummaryTool = Trk__TrackSummaryTool( 'TrigMuonTrackSummarySA',MuonSummaryHelperTool=getPublicTool('MuonTrackSummaryHelper'), doSharedHits=False) + trkSummaryTool = Trk__TrackSummaryTool( 'TrigMuonTrackSummarySA',MuonSummaryHelperTool=getPublicTool('MuonTrackSummaryHelperTool'), doSharedHits=False) ToolSvc += Trk__TrackSummaryTool('TrigMuonTrackSummarySA') theTrackQueryNoFit = getPublicToolClone("TrigMuonTrackQueryNoFitSA_"+name, "MuonTrackQuery", Fitter="") @@ -696,7 +696,7 @@ def muEFCBRecoSequence( RoIs, name ): theTrackCleaner = getPublicToolClone("TrigMuonTrackCleaner_"+name, "MuonTrackCleaner", Fitter='TMEF_iPatFitter', SLFitter='TMEF_iPatFitter') from TrkTrackSummaryTool.TrkTrackSummaryToolConf import Trk__TrackSummaryTool - trkSummaryTool = Trk__TrackSummaryTool( 'TrigMuonTrackSummary',MuonSummaryHelperTool=getPublicTool('MuonTrackSummaryHelper'), doSharedHits=False) + trkSummaryTool = Trk__TrackSummaryTool( 'TrigMuonTrackSummary',MuonSummaryHelperTool=getPublicTool('MuonTrackSummaryHelperTool'), doSharedHits=False) if DetFlags.detdescr.ID_on(): from InDetTrigRecExample.InDetTrigConfigRecLoadTools import InDetTrigTrackSummaryHelperTool trkSummaryTool.InDetSummaryHelperTool=InDetTrigTrackSummaryHelperTool @@ -796,7 +796,7 @@ def muEFInsideOutRecoSequence(RoIs, name): from TrkTrackSummaryTool.TrkTrackSummaryToolConf import Trk__TrackSummaryTool - trkSummaryTool = Trk__TrackSummaryTool( 'TrigMuonTrackSummary',MuonSummaryHelperTool=getPublicTool('MuonTrackSummaryHelper'), doSharedHits=False) + trkSummaryTool = Trk__TrackSummaryTool( 'TrigMuonTrackSummary',MuonSummaryHelperTool=getPublicTool('MuonTrackSummaryHelperTool'), doSharedHits=False) if DetFlags.detdescr.ID_on(): from InDetTrigRecExample.InDetTrigConfigRecLoadTools import InDetTrigTrackSummaryHelperTool trkSummaryTool.InDetSummaryHelperTool=InDetTrigTrackSummaryHelperTool diff --git a/graphics/VP1/VP1Algs/share/vp1.py b/graphics/VP1/VP1Algs/share/vp1.py index bbbdea853a74f3aac4016adecbd33a4dfbe82c8f..cc15db9922a92becbb17a892ff0ff82fe252947c 100644 --- a/graphics/VP1/VP1Algs/share/vp1.py +++ b/graphics/VP1/VP1Algs/share/vp1.py @@ -90,8 +90,8 @@ if (vp1InputFiles == []): # Set geometry version if (not "DetDescrVersion" in dir()): if (vp1NSW): - print("You set the '-nsw' flag, so the Geometry Tag 'ATLAS-R3-2021-00-00-00' will be used...") - DetDescrVersion="ATLAS-R3-2021-00-00-00" + print("You set the '-nsw' flag, so the Geometry Tag 'ATLAS-R3S-2021-01-00-00' will be used...") + DetDescrVersion="ATLAS-R3S-2021-01-00-00" globalflags.DetDescrVersion.set_Value_and_Lock(DetDescrVersion) else: #DetDescrVersion = "ATLAS-GEO-20-00-01" # old