diff --git a/Calorimeter/CaloBadChannelTool/CaloBadChannelTool/CaloBadChanTool.h b/Calorimeter/CaloBadChannelTool/CaloBadChannelTool/CaloBadChanTool.h index e6e6c9aa44acbbeab8a75a40253b7c9e44d5ae0e..8654daa65403356e412952ce1e32db66dfd26c12 100644 --- a/Calorimeter/CaloBadChannelTool/CaloBadChannelTool/CaloBadChanTool.h +++ b/Calorimeter/CaloBadChannelTool/CaloBadChannelTool/CaloBadChanTool.h @@ -28,8 +28,8 @@ public: private: - ToolHandle<ICaloBadChanTool> m_larBCT; - ToolHandle<ICaloBadChanTool> m_tileBCT; + ToolHandle<ICaloBadChanTool> m_larBCT{this, "LArBadChanTool", "LArBadChanTool", "LAr bad channel tool"}; + ToolHandle<ICaloBadChanTool> m_tileBCT{this, "TileBadChanTool", "TileBadChanTool", "Tile bad channel tool"}; const CaloCell_ID* m_caloID; }; diff --git a/Calorimeter/CaloBadChannelTool/src/CaloBadChanTool.cxx b/Calorimeter/CaloBadChannelTool/src/CaloBadChanTool.cxx index 0786f77c5cf4f782895dd026460660adf62ac076..52ce2b512c97c066d1d1a2a8aad454cbf98ed89e 100644 --- a/Calorimeter/CaloBadChannelTool/src/CaloBadChanTool.cxx +++ b/Calorimeter/CaloBadChannelTool/src/CaloBadChanTool.cxx @@ -10,8 +10,6 @@ CaloBadChanTool::CaloBadChanTool(const std::string& type, const std::string& name, const IInterface* parent) : AthAlgTool( type, name, parent), - m_larBCT("LArBadChanTool"), - m_tileBCT("TileBadChanTool"), m_caloID(nullptr) { declareInterface<ICaloBadChanTool>(this); diff --git a/Calorimeter/CaloMonitoring/share/CaloBaselineMon_jobOpt.py b/Calorimeter/CaloMonitoring/share/CaloBaselineMon_jobOpt.py index 8fdbd564f344f327d69e830b3127e19ef57f9d37..a363ce96e208d4a637b3086c9b86e8c28ba76c69 100644 --- a/Calorimeter/CaloMonitoring/share/CaloBaselineMon_jobOpt.py +++ b/Calorimeter/CaloMonitoring/share/CaloBaselineMon_jobOpt.py @@ -53,5 +53,5 @@ CaloBaseline = CaloBaselineMon( bcidtoolMon_BCIDmax = tmp_CaloBaselineMon["bcidtoolMon_BCIDmax"], ) -ToolSvc += CaloBaseline +#ToolSvc += CaloBaseline CaloMon.AthenaMonTools += [ CaloBaseline ] diff --git a/Calorimeter/CaloMonitoring/share/CaloCellVecMonCollisions_jobOpt.py b/Calorimeter/CaloMonitoring/share/CaloCellVecMonCollisions_jobOpt.py index ed1acda369454c0a3d54e460dad4144cfc3d24a0..2891da86e2ed9b67899795986ed5d6a30bfdd699 100644 --- a/Calorimeter/CaloMonitoring/share/CaloCellVecMonCollisions_jobOpt.py +++ b/Calorimeter/CaloMonitoring/share/CaloCellVecMonCollisions_jobOpt.py @@ -207,8 +207,8 @@ else: -ToolSvc+=LArCellMon -ToolSvc+=TileCalCellMon +#ToolSvc+=LArCellMon +#ToolSvc+=TileCalCellMon CaloMon.AthenaMonTools += [LArCellMon,TileCalCellMon] diff --git a/Calorimeter/CaloMonitoring/share/CaloCellVecMonCosmics_jobOpt.py b/Calorimeter/CaloMonitoring/share/CaloCellVecMonCosmics_jobOpt.py index b21aba6cf5686da755c98d4dbbf110a64f078b04..9e0866c50f977fee4771b48b5dbe77c1f847ffb2 100755 --- a/Calorimeter/CaloMonitoring/share/CaloCellVecMonCosmics_jobOpt.py +++ b/Calorimeter/CaloMonitoring/share/CaloCellVecMonCosmics_jobOpt.py @@ -190,8 +190,8 @@ else: -ToolSvc+=LArCellMon -ToolSvc+=TileCalCellMon +#ToolSvc+=LArCellMon +#ToolSvc+=TileCalCellMon CaloMon.AthenaMonTools += [LArCellMon,TileCalCellMon] diff --git a/Calorimeter/CaloMonitoring/share/CaloClusterVecMonCollisions_jobOpt.py b/Calorimeter/CaloMonitoring/share/CaloClusterVecMonCollisions_jobOpt.py index f2c7566a6721ede9ea7bf1c527be60e2384d91f9..7fb007a8c1db52432f2f3c6784233364a0b14095 100644 --- a/Calorimeter/CaloMonitoring/share/CaloClusterVecMonCollisions_jobOpt.py +++ b/Calorimeter/CaloMonitoring/share/CaloClusterVecMonCollisions_jobOpt.py @@ -77,6 +77,6 @@ CaloClusterMonNoTA = CaloClusterVecMon( hiEthresh = 20.0, ) -ToolSvc += CaloClusterMonNoTA +#ToolSvc += CaloClusterMonNoTA CaloMon.AthenaMonTools += [ CaloClusterMonNoTA ] diff --git a/Calorimeter/CaloMonitoring/share/CaloClusterVecMonCosmics_jobOpt.py b/Calorimeter/CaloMonitoring/share/CaloClusterVecMonCosmics_jobOpt.py index 59a52cc99b65a5b9d59dee222f0d07c8d63d99a6..40dfea3b48a14aa0d78fb4f86476fc98f3da24b7 100755 --- a/Calorimeter/CaloMonitoring/share/CaloClusterVecMonCosmics_jobOpt.py +++ b/Calorimeter/CaloMonitoring/share/CaloClusterVecMonCosmics_jobOpt.py @@ -79,6 +79,6 @@ CaloClustMonCosmicsNoTA = CaloClusterVecMon( hiEthresh = 20.0, ) -ToolSvc += CaloClustMonCosmicsNoTA +#ToolSvc += CaloClustMonCosmicsNoTA CaloMon.AthenaMonTools += [ CaloClustMonCosmicsNoTA ] diff --git a/Calorimeter/CaloMonitoring/share/CaloTowerVecMonCollisions_jobOptions.py b/Calorimeter/CaloMonitoring/share/CaloTowerVecMonCollisions_jobOptions.py index 1bc31c506c735c246ef235f9ca19810f747b880f..b41074e564392a398f59f06265fdf42d9b7287ea 100755 --- a/Calorimeter/CaloMonitoring/share/CaloTowerVecMonCollisions_jobOptions.py +++ b/Calorimeter/CaloMonitoring/share/CaloTowerVecMonCollisions_jobOptions.py @@ -68,5 +68,5 @@ CaloTowerMonNoTA = CaloTowerVecMon( fill_TotalE=True, ) -ToolSvc += CaloTowerMonNoTA +#ToolSvc += CaloTowerMonNoTA CaloMon.AthenaMonTools += [ CaloTowerMonNoTA ] diff --git a/Calorimeter/CaloMonitoring/share/CaloTowerVecMonCosmics_jobOptions.py b/Calorimeter/CaloMonitoring/share/CaloTowerVecMonCosmics_jobOptions.py index 0096c14360cc334a5633a43305a813c8f176c5e4..1658dd6c0c69acd3b2a1ac66f644c59752687449 100755 --- a/Calorimeter/CaloMonitoring/share/CaloTowerVecMonCosmics_jobOptions.py +++ b/Calorimeter/CaloMonitoring/share/CaloTowerVecMonCosmics_jobOptions.py @@ -67,5 +67,5 @@ CaloTowerMonCosmicsNoTA = CaloTowerVecMon( fill_TotalE=True, ) -ToolSvc += CaloTowerMonCosmicsNoTA +#ToolSvc += CaloTowerMonCosmicsNoTA CaloMon.AthenaMonTools += [ CaloTowerMonCosmicsNoTA ] diff --git a/Calorimeter/CaloMonitoring/share/CaloTransverseBalanceVecMonCollisions_jobOptions.py b/Calorimeter/CaloMonitoring/share/CaloTransverseBalanceVecMonCollisions_jobOptions.py index 6d7101155f337a503998b7e25636be74cfab3925..b807bd8b58b17e292ec96024ad83a9395575367c 100644 --- a/Calorimeter/CaloMonitoring/share/CaloTransverseBalanceVecMonCollisions_jobOptions.py +++ b/Calorimeter/CaloMonitoring/share/CaloTransverseBalanceVecMonCollisions_jobOptions.py @@ -25,7 +25,7 @@ Calo_LArNoisyAlg = TRUE, photonPTCut = 20*GeV, ) -ToolSvc += CaloTransverseBalanceMonNoTA +#ToolSvc += CaloTransverseBalanceMonNoTA CaloMon.AthenaMonTools += [ CaloTransverseBalanceMonNoTA ] diff --git a/Calorimeter/CaloMonitoring/share/EMClusterVecMonCollisions_jobOpt.py b/Calorimeter/CaloMonitoring/share/EMClusterVecMonCollisions_jobOpt.py index 47c89be682c03ae48c99e873c991682d35ac0368..72386e7ff3a1df8758cfee9fcd75bd0e2f9432ca 100644 --- a/Calorimeter/CaloMonitoring/share/EMClusterVecMonCollisions_jobOpt.py +++ b/Calorimeter/CaloMonitoring/share/EMClusterVecMonCollisions_jobOpt.py @@ -85,5 +85,5 @@ EMCaloClusterMonNoTA = CaloClusterVecMon( hiEthresh = 20.0, ) -ToolSvc += EMCaloClusterMonNoTA +#ToolSvc += EMCaloClusterMonNoTA CaloMon.AthenaMonTools += [ EMCaloClusterMonNoTA ] diff --git a/Calorimeter/CaloMonitoring/share/EMClusterVecMonCosmics_jobOpt.py b/Calorimeter/CaloMonitoring/share/EMClusterVecMonCosmics_jobOpt.py index e67dd87077c564ec367453bf07ea4929e7bea50f..9c98ab45a86bb41c4a96f3df2d24163f0fa74916 100755 --- a/Calorimeter/CaloMonitoring/share/EMClusterVecMonCosmics_jobOpt.py +++ b/Calorimeter/CaloMonitoring/share/EMClusterVecMonCosmics_jobOpt.py @@ -85,6 +85,6 @@ EMCaloClusterMonCosmicsNoTA = CaloClusterVecMon( hiEthresh = 20.0, ) -ToolSvc += EMCaloClusterMonCosmicsNoTA +#ToolSvc += EMCaloClusterMonCosmicsNoTA CaloMon.AthenaMonTools += [ EMCaloClusterMonCosmicsNoTA ] diff --git a/Calorimeter/CaloMonitoring/share/LArMuIDClusterVecMonCosmics_jobOpt.py b/Calorimeter/CaloMonitoring/share/LArMuIDClusterVecMonCosmics_jobOpt.py index df66aa7a679eae9f8f5908041daaebecdd80dbae..69c569f1dc7d6503d3ef532504230f1710be5057 100755 --- a/Calorimeter/CaloMonitoring/share/LArMuIDClusterVecMonCosmics_jobOpt.py +++ b/Calorimeter/CaloMonitoring/share/LArMuIDClusterVecMonCosmics_jobOpt.py @@ -65,5 +65,5 @@ LArCosmicsClusterMon = CaloClusterVecMon( hiEthresh = 5.0, ) -ToolSvc += LArCosmicsClusterMon +#ToolSvc += LArCosmicsClusterMon CaloMon.AthenaMonTools += [ LArCosmicsClusterMon] diff --git a/Calorimeter/CaloRec/python/CaloCellGetter.py b/Calorimeter/CaloRec/python/CaloCellGetter.py index 68c1f66bb87f8b016e85f022ef20726b2c9da8f7..c488906aa4ab2d547f8133dc34933297a2f3ca75 100644 --- a/Calorimeter/CaloRec/python/CaloCellGetter.py +++ b/Calorimeter/CaloRec/python/CaloCellGetter.py @@ -404,9 +404,6 @@ class CaloCellGetter (Configured) : mlog.error("could not access bad channel tool Quit") print traceback.format_exc() return False - ToolSvc += theLArBadChannelTool - - theLArBadFebMaskingTool.badChannelTool = theLArBadChannelTool theCaloCellMaker.CaloCellMakerToolNames += [theLArBadFebMaskingTool] # @@ -518,15 +515,16 @@ class CaloCellGetter (Configured) : if doHVCorr: - from LArCellRec.LArCellHVCorrDefault import LArCellHVCorrDefault - theLArCellHVCorr=LArCellHVCorrDefault() + from LArCellRec.LArCellRecConf import LArCellHVCorrAlg + theLArCellHVCorrAlg = LArCellHVCorrAlg() + svcMgr.ToolSvc += theLArCellHVCorrAlg try: from CaloRec.CaloRecConf import CaloCellContainerCorrectorTool from CaloIdentifier import SUBCALO theHVCorrTool = CaloCellContainerCorrectorTool("HVCorrTool", CaloNums=[ SUBCALO.LAREM, SUBCALO.LARHEC, SUBCALO.LARFCAL ], - CellCorrectionToolNames=[ theLArCellHVCorr]) + CellCorrectionToolNames=[ theLArCellHVCorrAlg]) except: mlog.error("could not get handle to HVCorrTool Quit") print traceback.format_exc() diff --git a/Calorimeter/CaloTools/CaloTools/CaloNoiseToolDB.h b/Calorimeter/CaloTools/CaloTools/CaloNoiseToolDB.h index ac6c35cd5b6e30d80b96e1b940f3b1bb21651e2c..12ebd0a3d2294da59e883425d5256be756574c1c 100644 --- a/Calorimeter/CaloTools/CaloTools/CaloNoiseToolDB.h +++ b/Calorimeter/CaloTools/CaloTools/CaloNoiseToolDB.h @@ -264,8 +264,8 @@ private: float m_lumi0; //Functions - StatusCode initialize(); - StatusCode finalize(); + virtual StatusCode initialize() override final; + virtual StatusCode finalize() override final; // private methods to access database float getA(SYSTEM sysId, unsigned int cellHash, CaloGain::CaloGain caloGain) const; diff --git a/Calorimeter/CaloTools/src/CaloNoiseToolDB.cxx b/Calorimeter/CaloTools/src/CaloNoiseToolDB.cxx index f14b411bff9c082cc357a9f438ed6cfd3b01217a..cb2780af98b6e58209a1ca6d354da0f13df0032d 100644 --- a/Calorimeter/CaloTools/src/CaloNoiseToolDB.cxx +++ b/Calorimeter/CaloTools/src/CaloNoiseToolDB.cxx @@ -11,7 +11,6 @@ //=== TileCalibBlobObjs #include "CaloCondBlobObjs/CaloCondBlobFlt.h" #include "CaloCondBlobObjs/CaloCondUtils.h" - #include "CLHEP/Random/RandomEngine.h" #include "CLHEP/Random/RandGauss.h" diff --git a/Calorimeter/CaloUtils/CMakeLists.txt b/Calorimeter/CaloUtils/CMakeLists.txt index 59c792330c0b796dcfb67e76de8a215844f1ffef..60922cc97bc57ac5b98a5014c3baf826e6060966 100644 --- a/Calorimeter/CaloUtils/CMakeLists.txt +++ b/Calorimeter/CaloUtils/CMakeLists.txt @@ -83,13 +83,13 @@ atlas_add_test( CaloVertexedCluster_test atlas_add_test( CaloTowerStore_test SCRIPT test/CaloTowerStore_test.sh - EXTRA_PATTERNS "[0-9] [A-Z]+ 20[123][0-9]|Reading file|^CORAL/Services/ConnectionService (Info|Warning)|^RelationalDatabase Info|^Data source lookup|^DetDescrCnvSvc +INFO|^CORAL/RelationalPlugins/frontier Info|^PluginManager Info|^RalSessionMgr Warning|^DBReplicaSvc +INFO|IOVDbSvc +INFO|^Py:Athena +INFO|^EventInfoMgtInit: Got release|^TEnvRec::ChangeValue|^PoolSvc +INFO|^PoolSvc +WARNING Unable to locate catalog|being retired|including file|Deaccess DbDatabase|^IoComponentMgr +INFO|File version|Global positioning|^Domain|duplicate entry|already loaded|RootDbase: all good|frontier.c|^Py:ConfigurableDb +(WARNING|INFO)|ApplicationMgr +INFO|INFO [sS]top|^CaloIdMgrDetDes.*INFO|^TTOnlineIDDetDe.*INFO|^CaloIDHelper_ID.*INFO|^AtlasDetectorID +INFO|^AthenaEventLoopMgrWARNING|^CaloDM_IDDetDes.*INFO|^CaloLVL1_IDDetD.*INFO|^LArFCAL_ID +INFO|^LArMiniFCAL_IDD.*INFO|^LArHEC_ID +INFO|^LArMiniFCAL_ID +INFO|TileTBIdDetDesc.*INFO|^TileIDDetDescrCnv +INFO|CaloCell_IDDetD.*INFO|TileID +INFO|^LArFCAL_IDDetDe.*INFO|^TileTBIDDetDesc.*INFO|^LArEM_ID +INFO|^LArHEC_IDDetDes.*INFO|^LArEM_IDDetDesc.*INFO|^EndcapDMConst.*INFO|^GeoModelSvc +INFO|USHAPE|U-shape|XMLFileCatalog Info|No IOVSvcTool associated|^RalSessionMgr Info|RDBMS technology|INFO Found unknown streamer checksum|^GUID: Class pool::DbString has GUID|^AthenaRootStrea.* INFO|INFO TileDddbManager|^CORAL/" + EXTRA_PATTERNS "[0-9] [A-Z]+ 20[123][0-9]|Reading file|^CORAL/Services/ConnectionService (Info|Warning)|^RelationalDatabase Info|^Data source lookup|^DetDescrCnvSvc +INFO|^CORAL/RelationalPlugins/frontier Info|^PluginManager Info|^RalSessionMgr Warning|^DBReplicaSvc +INFO|IOVDbSvc +INFO|^Py:Athena +INFO|^EventInfoMgtInit: Got release|^TEnvRec::ChangeValue|^PoolSvc +INFO|^PoolSvc +WARNING Unable to locate catalog|being retired|including file|Deaccess DbDatabase|^IoComponentMgr +INFO|File version|Global positioning|^Domain|duplicate entry|already loaded|RootDbase: all good|frontier.c|^Py:ConfigurableDb +(WARNING|INFO)|ApplicationMgr +INFO|INFO [sS]top|^CaloIdMgrDetDes.*INFO|^TTOnlineIDDetDe.*INFO|^CaloIDHelper_ID.*INFO|^AtlasDetectorID +INFO|^AthenaEventLoopMgrWARNING|^CaloDM_IDDetDes.*INFO|^CaloLVL1_IDDetD.*INFO|^LArFCAL_ID +INFO|^LArMiniFCAL_IDD.*INFO|^LArHEC_ID +INFO|^LArMiniFCAL_ID +INFO|TileTBIdDetDesc.*INFO|^TileIDDetDescrCnv +INFO|CaloCell_IDDetD.*INFO|TileID +INFO|^LArFCAL_IDDetDe.*INFO|^TileTBIDDetDesc.*INFO|^LArEM_ID +INFO|^LArHEC_IDDetDes.*INFO|^LArEM_IDDetDesc.*INFO|^EndcapDMConst.*INFO|^GeoModelSvc +INFO|USHAPE|U-shape|Cs Tube|XMLFileCatalog Info|No IOVSvcTool associated|^RalSessionMgr Info|RDBMS technology|INFO Found unknown streamer checksum|^GUID: Class pool::DbString has GUID|^AthenaRootStrea.* INFO|INFO TileDddbManager|^CORAL/" PROPERTIES TIMEOUT 500 ) atlas_add_test( CaloTowerBuilderTool_test SCRIPT test/CaloTowerBuilderTool_test.sh - EXTRA_PATTERNS "[0-9] [A-Z]+ 20[123][0-9]|Reading file|^CORAL/Services/ConnectionService (Info|Warning)|^RelationalDatabase Info|^Data source lookup|^DetDescrCnvSvc +INFO|^CORAL/RelationalPlugins/frontier Info|^PluginManager Info|^RalSessionMgr Warning|^DBReplicaSvc +INFO|IOVDbSvc +INFO|^Py:Athena +INFO|^EventInfoMgtInit: Got release|^TEnvRec::ChangeValue|^PoolSvc +INFO|^PoolSvc +WARNING Unable to locate catalog|being retired|including file|Deaccess DbDatabase|^IoComponentMgr +INFO|File version|Global positioning|^Domain|duplicate entry|already loaded|RootDbase: all good|frontier.c|^Py:ConfigurableDb +(WARNING|INFO)|ApplicationMgr +INFO|INFO [sS]top|^CaloIdMgrDetDes.*INFO|^TTOnlineIDDetDe.*INFO|^CaloIDHelper_ID.*INFO|^AtlasDetectorID +INFO|^AthenaEventLoopMgrWARNING|^CaloDM_IDDetDes.*INFO|^CaloLVL1_IDDetD.*INFO|^LArFCAL_ID +INFO|^LArMiniFCAL_IDD.*INFO|^LArHEC_ID +INFO|^LArMiniFCAL_ID +INFO|TileTBIdDetDesc.*INFO|^TileIDDetDescrCnv +INFO|CaloCell_IDDetD.*INFO|TileID +INFO|^LArFCAL_IDDetDe.*INFO|^TileTBIDDetDesc.*INFO|^LArEM_ID +INFO|^LArHEC_IDDetDes.*INFO|^LArEM_IDDetDesc.*INFO|^EndcapDMConstru.*INFO|^GeoModelSvc +INFO|USHAPE|U-shape|XMLFileCatalog Info|No IOVSvcTool associated|^RalSessionMgr Info|RDBMS technology|INFO Found unknown streamer checksum|^GUID: Class pool::DbString has GUID|^AthenaRootStrea.* INFO|INFO TileDddbManager|oracle Info" - ENVIRONMENT "ATLAS_REFERENCE_TAG=CaloUtils/CaloUtils-01-00-07" + EXTRA_PATTERNS "[0-9] [A-Z]+ 20[123][0-9]|Reading file|^CORAL/Services/ConnectionService (Info|Warning)|^RelationalDatabase Info|^Data source lookup|^DetDescrCnvSvc +INFO|^CORAL/RelationalPlugins/frontier Info|^PluginManager Info|^RalSessionMgr Warning|^DBReplicaSvc +INFO|IOVDbSvc +INFO|^Py:Athena +INFO|^EventInfoMgtInit: Got release|^TEnvRec::ChangeValue|^PoolSvc +INFO|^PoolSvc +WARNING Unable to locate catalog|being retired|including file|Deaccess DbDatabase|^IoComponentMgr +INFO|File version|Global positioning|^Domain|duplicate entry|already loaded|RootDbase: all good|frontier.c|^Py:ConfigurableDb +(WARNING|INFO)|ApplicationMgr +INFO|INFO [sS]top|^CaloIdMgrDetDes.*INFO|^TTOnlineIDDetDe.*INFO|^CaloIDHelper_ID.*INFO|^AtlasDetectorID +INFO|^AthenaEventLoopMgrWARNING|^CaloDM_IDDetDes.*INFO|^CaloLVL1_IDDetD.*INFO|^LArFCAL_ID +INFO|^LArMiniFCAL_IDD.*INFO|^LArHEC_ID +INFO|^LArMiniFCAL_ID +INFO|TileTBIdDetDesc.*INFO|^TileIDDetDescrCnv +INFO|CaloCell_IDDetD.*INFO|TileID +INFO|^LArFCAL_IDDetDe.*INFO|^TileTBIDDetDesc.*INFO|^LArEM_ID +INFO|^LArHEC_IDDetDes.*INFO|^LArEM_IDDetDesc.*INFO|^EndcapDMConstru.*INFO|^GeoModelSvc +INFO|USHAPE|U-shape|Cs Tube|XMLFileCatalog Info|No IOVSvcTool associated|^RalSessionMgr Info|RDBMS technology|INFO Found unknown streamer checksum|^GUID: Class pool::DbString has GUID|^AthenaRootStrea.* INFO|INFO TileDddbManager|oracle Info" + ENVIRONMENT "ATLAS_REFERENCE_TAG=CaloUtils/CaloUtils-01-00-08" PROPERTIES TIMEOUT 500 ) # Install files from the package: diff --git a/Calorimeter/CaloUtils/share/CaloTowerBuilderTool_test.py b/Calorimeter/CaloUtils/share/CaloTowerBuilderTool_test.py index f98f1e3e4248b41dc7cd49209fca39e1d16a65e8..30ca3c442d6757a8c8c99413be3a6bc2f935274e 100644 --- a/Calorimeter/CaloUtils/share/CaloTowerBuilderTool_test.py +++ b/Calorimeter/CaloUtils/share/CaloTowerBuilderTool_test.py @@ -43,4 +43,7 @@ topSequence += CaloUtilsConf.CaloTowerBuilderToolTestAlg ('towertest') theApp.EvtMax = 1 -#theApp.getHandle().Dlls += [ 'CaloUtils' ] + +# Suppress useless GeoModelSvc messages. +from AthenaCommon import Constants +GeoModelSvc().OutputLevel=Constants.WARNING diff --git a/Calorimeter/CaloUtils/share/CaloTowerStore_test.py b/Calorimeter/CaloUtils/share/CaloTowerStore_test.py index d54aa465d1e8fe4e5ae3454bf140e978e7b9c689..601beabad3eba7b4808fc2cd28df65077ee3eb2d 100644 --- a/Calorimeter/CaloUtils/share/CaloTowerStore_test.py +++ b/Calorimeter/CaloUtils/share/CaloTowerStore_test.py @@ -38,4 +38,6 @@ topSequence += CaloTowerStoreTestAlg ('towertest') theApp.EvtMax = 1 -#theApp.getHandle().Dlls += [ 'CaloUtils' ] +# Suppress useless GeoModelSvc messages. +from AthenaCommon import Constants +GeoModelSvc().OutputLevel=Constants.WARNING diff --git a/Calorimeter/CaloUtils/share/CaloTowerStore_test.ref b/Calorimeter/CaloUtils/share/CaloTowerStore_test.ref index 4f499af78f763006e6039b77c1c3479bc21cf52c..fbf195315ba8cc1e9245198a5ec5dec729f8672a 100644 --- a/Calorimeter/CaloUtils/share/CaloTowerStore_test.ref +++ b/Calorimeter/CaloUtils/share/CaloTowerStore_test.ref @@ -1,21 +1,15 @@ -Sat Mar 3 18:17:13 CET 2018 +Fri Oct 19 19:57:07 CEST 2018 Preloading tcmalloc_minimal.so Py:Athena INFO including file "AthenaCommon/Preparation.py" -Py:Athena INFO using release [AthenaWorkDir-22.0.1] [x86_64-slc6-gcc62-opt] [atlas-work3/2b49d03691a] -- built on [2018-03-03T1713] +Py:Athena INFO using release [AthenaWorkDir-22.0.1] [x86_64-slc6-gcc62-dbg] [atlas-work3/88b41a9d745] -- built on [2018-10-19T1947] Py:Athena INFO including file "AthenaCommon/Atlas.UnixStandardJob.py" Py:Athena INFO executing ROOT6Setup Py:Athena INFO including file "AthenaCommon/Execution.py" Py:Athena INFO including file "CaloUtils/CaloTowerStore_test.py" SetGeometryVersion.py obtained major release version 22 Py:Athena INFO including file "IdDictDetDescrCnv/IdDictDetDescrCnv_joboptions.py" -Py:ConfigurableDb INFO Read module info for 5461 configurables from 57 genConfDb files -Py:ConfigurableDb WARNING Found 2 duplicates among the 57 genConfDb files : -Py:ConfigurableDb WARNING -------------------------------------------------- -Py:ConfigurableDb WARNING -<component name>: <module> - [ <duplicates> ] -Py:ConfigurableDb WARNING -------------------------------------------------- -Py:ConfigurableDb WARNING -IDTrackCaloDepositsDecoratorTool: MuonTPTools.MuonTPToolsConf - ['DerivationFrameworkMuons.DerivationFrameworkMuonsConf'] -Py:ConfigurableDb WARNING -MuonTPExtrapolationTool: MuonTPTools.MuonTPToolsConf - ['DerivationFrameworkMuons.DerivationFrameworkMuonsConf'] -Py:ConfigurableDb WARNING Fix your cmt/requirements file !! +Py:ConfigurableDb INFO Read module info for 5522 configurables from 57 genConfDb files +Py:ConfigurableDb INFO No duplicates have been found: that's good ! EventInfoMgtInit: Got release version Athena-22.0.1 Py:IOVDbSvc.CondDB INFO Setting up conditions DB access to instance OFLP200 Py:Athena INFO including file "CaloIdCnv/CaloIdCnv_joboptions.py" @@ -25,10 +19,11 @@ Py:Athena INFO including file "CaloConditions/CaloTTIdMap_ATLAS_jobOp Py:Athena INFO including file "TileIdCnv/TileIdCnv_jobOptions.py" Py:Athena INFO including file "AthenaCommon/runbatch.py" [?1034hApplicationMgr INFO Updating Gaudi::PluginService::SetDebug(level) to level= 'PluginDebugLevel':0 +ApplicationMgr INFO Updating Gaudi::PluginService::SetDebug(level) to level= 'PluginDebugLevel':0 ApplicationMgr SUCCESS ==================================================================================================================================== - Welcome to ApplicationMgr (GaudiCoreSvc v30r1) - running on lxplus076.cern.ch on Sat Mar 3 18:17:26 2018 + Welcome to ApplicationMgr (GaudiCoreSvc v30r3) + running on lxplus055.cern.ch on Fri Oct 19 19:57:23 2018 ==================================================================================================================================== ApplicationMgr INFO Successfully loaded modules : AthenaServices ApplicationMgr INFO Application Manager Configured successfully @@ -36,8 +31,7 @@ ApplicationMgr INFO Updating Gaudi::PluginService::SetDebug(level) to leve StatusCodeSvc INFO initialize AthDictLoaderSvc INFO in initialize... AthDictLoaderSvc INFO acquired Dso-registry -ClassIDSvc INFO getRegistryEntries: read 2546 CLIDRegistry entries for module ALL -ChronoStatSvc INFO Number of skipped events for MemStat-1 +ClassIDSvc INFO getRegistryEntries: read 3219 CLIDRegistry entries for module ALL CoreDumpSvc INFO install f-a-t-a-l handler... (flag = -1) CoreDumpSvc INFO Handling signals: 11(Segmentation fault) 7(Bus error) 4(Illegal instruction) 8(Floating point exception) MetaDataSvc INFO Initializing MetaDataSvc - package version AthenaServices-00-00-00 @@ -45,9 +39,9 @@ AthenaPoolCnvSvc INFO Initializing AthenaPoolCnvSvc - package version Athena PoolSvc INFO io_register[PoolSvc](xmlcatalog_file:PoolFileCatalog.xml) [ok] PoolSvc INFO Set connectionsvc retry/timeout/IDLE timeout to 'ConnectionRetrialPeriod':300/ 'ConnectionRetrialTimeOut':3600/ 'ConnectionTimeOut':5 seconds with connection cleanup disabled PoolSvc INFO Frontier compression level set to 5 -DBReplicaSvc INFO Frontier server at (serverurl=http://atlasfrontier-local.cern.ch:8000/atlr)(serverurl=http://atlasfrontier-ai.cern.ch:8000/atlr)(serverurl=http://lcgft-atlas.gridpp.rl.ac.uk:3128/frontierATLAS)(serverurl=http://ccfrontier.in2p3.fr:23128/ccin2p3-AtlasFrontier)(proxyurl=http://ca-proxy.cern.ch:3128)(proxyurl=http://ca-proxy-meyrin.cern.ch:3128)(proxyurl=http://ca-proxy-wigner.cern.ch:3128) will be considered for COOL data -DBReplicaSvc INFO Read replica configuration from /cvmfs/atlas-nightlies.cern.ch/repo/sw/master/2018-03-02T2152/Athena/22.0.1/InstallArea/x86_64-slc6-gcc62-opt/share/dbreplica.config -DBReplicaSvc INFO Total of 10 servers found for host lxplus076.cern.ch [ATLF ATLAS_COOLPROD atlas_dd ATLAS_CONFIG INT8R INTR ATONR_COOL ATONR_CONF DEVDB11 ATLF ] +DBReplicaSvc INFO Frontier server at (serverurl=http://atlasfrontier-local.cern.ch:8000/atlr)(serverurl=http://atlasfrontier-ai.cern.ch:8000/atlr)(serverurl=http://lcgft-atlas.gridpp.rl.ac.uk:3128/frontierATLAS)(serverurl=http://ccfrontier.in2p3.fr:23128/ccin2p3-AtlasFrontier)(proxyurl=http://ca-proxy.cern.ch:3128)(proxyurl=http://ca-proxy-meyrin.cern.ch:3128)(proxyurl=http://ca-proxy-wigner.cern.ch:3128)(proxyurl=http://atlasbpfrontier.cern.ch:3127)(proxyurl=http://atlasbpfrontier.fnal.gov:3127) will be considered for COOL data +DBReplicaSvc INFO Read replica configuration from /cvmfs/atlas-nightlies.cern.ch/repo/sw/master/2018-10-18T2313/Athena/22.0.1/InstallArea/x86_64-slc6-gcc62-dbg/share/dbreplica.config +DBReplicaSvc INFO Total of 10 servers found for host lxplus055.cern.ch [ATLF ATLAS_COOLPROD atlas_dd ATLAS_CONFIG INT8R INTR ATONR_COOL ATONR_CONF DEVDB11 ATLF ] PoolSvc INFO Successfully setup replica sorting algorithm PoolSvc INFO Setting up APR FileCatalog and Streams PoolSvc WARNING Unable to locate catalog for prfile:poolcond/PoolCat_oflcond.xml check your ATLAS_POOLCOND_PATH and DATAPATH variables @@ -76,6 +70,9 @@ IOVDbSvc INFO Added taginfo remove for /CALO/Ofl/Identifier/CaloTTOn IOVDbSvc INFO Added taginfo remove for /CALO/Ofl/Identifier/CaloTTPpmRxIdMapAtlas IOVDbSvc INFO Added taginfo remove for /LAR/LArCellPositionShift IOVDbSvc INFO Added taginfo remove for /LAR/Identifier/LArTTCellMapAtlas +ClassIDSvc INFO getRegistryEntries: read 2132 CLIDRegistry entries for module ALL +ClassIDSvc INFO getRegistryEntries: read 17 CLIDRegistry entries for module ALL +ClassIDSvc INFO getRegistryEntries: read 18 CLIDRegistry entries for module ALL DetDescrCnvSvc INFO initializing DetDescrCnvSvc INFO Found DetectorStore service DetDescrCnvSvc INFO filling proxies for detector managers @@ -121,13 +118,6 @@ GeoModelSvc::RD...WARNING Getting PixTBMatComponents with default tag GeoModelSvc::RD...WARNING Getting PixTBMaterials with default tag GeoModelSvc::RD...WARNING Getting InDetMatComponents with default tag GeoModelSvc::RD...WARNING Getting InDetMaterials with default tag -ClassIDSvc INFO getRegistryEntries: read 5183 CLIDRegistry entries for module ALL -GeoModelSvc.LAr... INFO Keys for LAr are ATLAS-R2-2016-01-00-01 ATLAS -GeoModelSvc.LAr... INFO Building LAr version LAr-Revised-17-01 while ATLAS version is ATLAS-R2-2016-01-00-01 -GeoModelSvc.LAr... INFO LAr Geometry Options: -GeoModelSvc.LAr... INFO Sagging = false -GeoModelSvc.LAr... INFO Barrel = ON -GeoModelSvc.LAr... INFO Endcap = ON BarrelConstruction INFO Getting primary numbers for ATLAS, ATLAS-R2-2016-01-00-01 BarrelConstruction INFO Makes detailed absorber sandwich ? 1 1 BarrelConstruction INFO Use sagging in geometry ? 0 @@ -135,7 +125,7 @@ BarrelConstruction INFO Use sagging in geometry ? 0 multi-layered version of absorbers activated, mlabs == 1 ================================================ EventPersistenc... INFO Added successfully Conversion service:DetDescrCnvSvc -ClassIDSvc INFO getRegistryEntries: read 66 CLIDRegistry entries for module ALL +ClassIDSvc INFO getRegistryEntries: read 5819 CLIDRegistry entries for module ALL CaloIDHelper_ID... INFO in createObj: creating a TileTBID helper object in the detector store IdDictDetDescrCnv INFO in initialize IdDictDetDescrCnv INFO in createObj: creating a IdDictManager object in the detector store @@ -159,14 +149,11 @@ IdDictDetDescrCnv INFO Dictionary MuonSpectrometer version R.03 IdDictDetDescrCnv INFO Dictionary TileCalorimeter version fullAtlasAndTestBeam DetDescr tag TileIdentifier-00 file IdDictParser/IdDictTileCalorimeter.xml TileTBID INFO initialize_from_dictionary AtlasDetectorID INFO initialize_from_dictionary - OK -ClassIDSvc INFO getRegistryEntries: read 115 CLIDRegistry entries for module ALL EndcapDMConstru... INFO Start building EC electronics geometry ============== EMEC Construction =============== multi-layered version of absorbers activated, mlabs == 1 ================================================ EndcapDMConstru... INFO Start building EC electronics geometry -GeoModelSvc INFO GeoModelSvc.LArDetectorToolNV SZ= 21964Kb Time = 0.55S -GeoModelSvc.Til... INFO Entering TileDetectorTool::create() TileDddbManager INFO m_tag = ATLAS-R2-2016-01-00-01 TileDddbManager INFO n_tiglob = 5 TileDddbManager INFO n_timod = 320 @@ -174,13 +161,14 @@ TileDddbManager INFO n_cuts = 9 TileDddbManager INFO n_saddle = 1 TileDddbManager INFO n_tilb = 21 TileDddbManager INFO n_tileSwitches = 1 +ClassIDSvc INFO getRegistryEntries: read 213 CLIDRegistry entries for module ALL CaloIDHelper_ID... INFO in createObj: creating a TileID helper object in the detector store AtlasDetectorID INFO initialize_from_dictionary - OK -TileNeighbour INFO Reading file /cvmfs/atlas-nightlies.cern.ch/repo/sw/master/2018-03-02T2152/Athena/22.0.1/InstallArea/x86_64-slc6-gcc62-opt/share/TileNeighbour_reduced.txt +TileNeighbour INFO Reading file /cvmfs/atlas-nightlies.cern.ch/repo/sw/master/2018-10-18T2313/Athena/22.0.1/InstallArea/x86_64-slc6-gcc62-dbg/share/TileNeighbour_reduced.txt TileHWIDDetDesc... INFO in createObj: creating a TileHWID helper object in the detector store TileHWID INFO initialize_from_dictionary AtlasDetectorID INFO initialize_from_dictionary - OK -ClassIDSvc INFO getRegistryEntries: read 6 CLIDRegistry entries for module ALL +ClassIDSvc INFO getRegistryEntries: read 55 CLIDRegistry entries for module ALL CaloIDHelper_ID... INFO in createObj: creating a CaloCell_ID helper object in the detector store CaloIDHelper_ID... INFO in createObj: creating a LArEM_ID helper object in the detector store AtlasDetectorID INFO initialize_from_dictionary - OK @@ -188,43 +176,14 @@ CaloIDHelper_ID... INFO in createObj: creating a LArHEC_ID helper object in th AtlasDetectorID INFO initialize_from_dictionary - OK CaloIDHelper_ID... INFO in createObj: creating a LArFCAL_ID helper object in the detector store AtlasDetectorID INFO initialize_from_dictionary - OK -LArFCAL_Base_ID INFO Reading file /cvmfs/atlas-nightlies.cern.ch/repo/sw/master/2018-03-02T2152/Athena/22.0.1/InstallArea/x86_64-slc6-gcc62-opt/share/FCal2DNeighbors-April2011.txt -LArFCAL_Base_ID INFO Reading file /cvmfs/atlas-nightlies.cern.ch/repo/sw/master/2018-03-02T2152/Athena/22.0.1/InstallArea/x86_64-slc6-gcc62-opt/share/FCal3DNeighborsNext-April2011.txt -LArFCAL_Base_ID INFO Reading file /cvmfs/atlas-nightlies.cern.ch/repo/sw/master/2018-03-02T2152/Athena/22.0.1/InstallArea/x86_64-slc6-gcc62-opt/share/FCal3DNeighborsPrev-April2011.txt +LArFCAL_Base_ID INFO Reading file /cvmfs/atlas-nightlies.cern.ch/repo/sw/master/2018-10-18T2313/Athena/22.0.1/InstallArea/x86_64-slc6-gcc62-dbg/share/FCal2DNeighbors-April2011.txt +LArFCAL_Base_ID INFO Reading file /cvmfs/atlas-nightlies.cern.ch/repo/sw/master/2018-10-18T2313/Athena/22.0.1/InstallArea/x86_64-slc6-gcc62-dbg/share/FCal3DNeighborsNext-April2011.txt +LArFCAL_Base_ID INFO Reading file /cvmfs/atlas-nightlies.cern.ch/repo/sw/master/2018-10-18T2313/Athena/22.0.1/InstallArea/x86_64-slc6-gcc62-dbg/share/FCal3DNeighborsPrev-April2011.txt CaloIDHelper_ID... INFO in createObj: creating a LArMiniFCAL_ID helper object in the detector store AtlasDetectorID INFO initialize_from_dictionary - OK LArMiniFCAL_ID INFO initialize_from_dict - LArCalorimeter dictionary does NOT contain miniFCAL description. Unable to initialize LArMiniFCAL_ID. AtlasDetectorID INFO initialize_from_dictionary - OK -GeoModelSvc.Til... INFO U-shape parameter from database is: 1 -GeoModelSvc.Til... INFO Glue parameter from database is: 1 -GeoModelSvc.Til... INFO Entering TileAtlasFactory::create() -GeoModelSvc.Til... INFO Tile Geometry with Saddle supports, starting from TileCal-CSC-02 xxx -GeoModelSvc.Til... INFO => New BFingerLengthPos 430.5 -GeoModelSvc.Til... INFO => New BFingerLengthNeg 420.5 -GeoModelSvc.Til... INFO Positioning barrel with translation 0 -GeoModelSvc.Til... INFO Positioning positive barrel finger with translation 3035.25 -GeoModelSvc.Til... INFO Positioning negative barrel finger with translation -3030.25 -GeoModelSvc.Til... INFO Positioning positive ext.barrel with translation 4854.75 -GeoModelSvc.Til... INFO Positioning positive ext.barrel finger with translation ztrans= 6338.5 -GeoModelSvc.Til... INFO Positioning positive ext.barrel saddle with translation ztrans= 6192.5 -GeoModelSvc.Til... INFO Positive ITC envelope parameters: PLUG1 Rmin= 3438.85 Rmax= 4250 dzITC1= 154.5 -GeoModelSvc.Til... INFO PLUG2 Rmin= 2981 Rmax= 3440 dzITC2= 47.425 -GeoModelSvc.Til... INFO Positioning positive ITC with translation 3405 -GeoModelSvc.Til... INFO Positioning positive Gap with translation 3552 -GeoModelSvc.Til... INFO Positioning positive Crack with translation 3536 -GeoModelSvc.Til... INFO Positioning negative ext.barrel with translation ztrans -4854.75 -GeoModelSvc.Til... INFO Positioning negative ext.barrel finger with translation ztrans= -6338.5 -GeoModelSvc.Til... INFO Positioning negative ext.barrel saddle with translation ztrans= -6192.5 -GeoModelSvc.Til... INFO Negative ITC envelope parameters: PLUG1 Rmin= 3438.85 Rmax= 4250 dzITC1= 154.5 -GeoModelSvc.Til... INFO PLUG2 Rmin= 2981 Rmax= 3440 dzITC2= 47.425 -GeoModelSvc.Til... INFO Positioning negative ITC with translation -3405 -GeoModelSvc.Til... INFO Positioning negative Gap with translation -3552 -GeoModelSvc.Til... INFO Positioning negative Crack with translation -3536 -GeoModelSvc.Til... INFO Global positioning of barrel with rotation (0,0,0)) and translation (0,0,0) CLHEP::cm -GeoModelSvc.Til... INFO Global positioning of positive ext.barrel with rotation (0,0,0)) and translation (0,0,0) CLHEP::cm -GeoModelSvc.Til... INFO Global positioning of negative ext.barrel with rotation (0,0,0)) and translation (0,0,1) CLHEP::cm TileDetDescrMan... INFO Entering create_elements() -GeoModelSvc INFO GeoModelSvc.TileDetectorTool SZ= 4520Kb Time = 0.18S ClassIDSvc INFO getRegistryEntries: read 65 CLIDRegistry entries for module ALL AthenaEventLoopMgr INFO Initializing AthenaEventLoopMgr - package version AthenaServices-00-00-00 CondInputLoader INFO Initializing CondInputLoader... @@ -233,11 +192,10 @@ CondInputLoader INFO Will create WriteCondHandle dependencies for the follo HistogramPersis...WARNING Histograms saving not required. ApplicationMgr INFO Application Manager Initialized successfully ApplicationMgr INFO Application Manager Started successfully -ClassIDSvc INFO getRegistryEntries: read 2217 CLIDRegistry entries for module ALL AthenaEventLoopMgr INFO ===>>> start of run 1 <<<=== EventPersistenc... INFO Added successfully Conversion service:AthenaPoolCnvSvc EventPersistenc... INFO Added successfully Conversion service:TagInfoMgr -ClassIDSvc INFO getRegistryEntries: read 114 CLIDRegistry entries for module ALL +ClassIDSvc INFO getRegistryEntries: read 2366 CLIDRegistry entries for module ALL IOVDbSvc INFO Opening COOL connection for COOLOFL_LAR/OFLP200 IOVDbSvc INFO HVS tag OFLCOND-SDR-BS14T-IBL-06 resolved to LARAlign-mc11-00 for folder /LAR/Align IOVDbSvc INFO HVS tag OFLCOND-SDR-BS14T-IBL-06 resolved to LArCellPositionShift-ideal for folder /LAR/LArCellPositionShift @@ -248,10 +206,9 @@ Domain[ROOT_All] INFO > Access DbDomain READ [ROOT_All] Domain[ROOT_All] INFO -> Access DbDatabase READ [ROOT_All] 06C9EAE8-6F5B-E011-BAAA-003048F0E7AC Domain[ROOT_All] INFO /cvmfs/atlas-condb.cern.ch/repo/conditions/cond09/cond09_mc.000029.gen.COND/cond09_mc.000029.gen.COND._0002.pool.root RootDatabase.open INFO /cvmfs/atlas-condb.cern.ch/repo/conditions/cond09/cond09_mc.000029.gen.COND/cond09_mc.000029.gen.COND._0002.pool.root File version:52200 -ClassIDSvc INFO getRegistryEntries: read 48 CLIDRegistry entries for module ALL CaloMgrDetDescrCnv INFO in createObj: creating a Calo Detector Manager object in the detector store CaloIdMgrDetDes... INFO in createObj: creating a CaloDescrManager object in the detector store -ClassIDSvc INFO getRegistryEntries: read 61 CLIDRegistry entries for module ALL +ClassIDSvc INFO getRegistryEntries: read 193 CLIDRegistry entries for module ALL CaloIDHelper_ID... INFO in createObj: creating a CaloDM_ID helper object in the detector store CaloDM_ID INFO initialize_from_dictionary AtlasDetectorID INFO initialize_from_dictionary - OK @@ -268,12 +225,12 @@ CaloIDHelper_ID... INFO in createObj: creating a LArHEC_SuperCell_ID helper ob AtlasDetectorID INFO initialize_from_dictionary - OK CaloIDHelper_ID... INFO in createObj: creating a LArFCAL_SuperCell_ID helper object in the detector store AtlasDetectorID INFO initialize_from_dictionary - OK -LArFCAL_Base_ID INFO Reading file /cvmfs/atlas-nightlies.cern.ch/repo/sw/master/2018-03-02T2152/Athena/22.0.1/InstallArea/x86_64-slc6-gcc62-opt/share/FCalSuperCells2DNeighborsNew-April2014.txt -LArFCAL_Base_ID INFO Reading file /cvmfs/atlas-nightlies.cern.ch/repo/sw/master/2018-03-02T2152/Athena/22.0.1/InstallArea/x86_64-slc6-gcc62-opt/share/FCalSuperCells3DNeighborsNextNew-April2014.txt -LArFCAL_Base_ID INFO Reading file /cvmfs/atlas-nightlies.cern.ch/repo/sw/master/2018-03-02T2152/Athena/22.0.1/InstallArea/x86_64-slc6-gcc62-opt/share/FCalSuperCells3DNeighborsPrevNew-April2014.txt +LArFCAL_Base_ID INFO Reading file /cvmfs/atlas-nightlies.cern.ch/repo/sw/master/2018-10-18T2313/Athena/22.0.1/InstallArea/x86_64-slc6-gcc62-dbg/share/FCalSuperCells2DNeighborsNew-April2014.txt +LArFCAL_Base_ID INFO Reading file /cvmfs/atlas-nightlies.cern.ch/repo/sw/master/2018-10-18T2313/Athena/22.0.1/InstallArea/x86_64-slc6-gcc62-dbg/share/FCalSuperCells3DNeighborsNextNew-April2014.txt +LArFCAL_Base_ID INFO Reading file /cvmfs/atlas-nightlies.cern.ch/repo/sw/master/2018-10-18T2313/Athena/22.0.1/InstallArea/x86_64-slc6-gcc62-dbg/share/FCalSuperCells3DNeighborsPrevNew-April2014.txt CaloIDHelper_ID... INFO in createObj: creating a Tile_SuperCell_ID helper object in the detector store AtlasDetectorID INFO initialize_from_dictionary - OK -TileNeighbour INFO Reading file /cvmfs/atlas-nightlies.cern.ch/repo/sw/master/2018-03-02T2152/Athena/22.0.1/InstallArea/x86_64-slc6-gcc62-opt/share/TileSuperCellNeighbour.txt +TileNeighbour INFO Reading file /cvmfs/atlas-nightlies.cern.ch/repo/sw/master/2018-10-18T2313/Athena/22.0.1/InstallArea/x86_64-slc6-gcc62-dbg/share/TileSuperCellNeighbour.txt AtlasDetectorID INFO initialize_from_dictionary - OK CaloIdMgrDetDes... INFO Finished CaloIdMgrDetDes... INFO Initializing CaloIdMgr from values in CaloIdMgrDetDescrCnv @@ -284,9 +241,9 @@ AthenaEventLoopMgr INFO ===>>> start processing event #1, run #1 0 events p test1 AthenaEventLoopMgr INFO ===>>> done processing event #1, run #1 1 events processed so far <<<=== /cvmfs/atlas-co... INFO Database being retired... -Domain[ROOT_All] INFO -> Deaccess DbDatabase READ [ROOT_All] 8667C6F2-1559-DE11-A611-000423D9A21A -/cvmfs/atlas-co... INFO Database being retired... Domain[ROOT_All] INFO -> Deaccess DbDatabase READ [ROOT_All] 06C9EAE8-6F5B-E011-BAAA-003048F0E7AC +/cvmfs/atlas-co... INFO Database being retired... +Domain[ROOT_All] INFO -> Deaccess DbDatabase READ [ROOT_All] 8667C6F2-1559-DE11-A611-000423D9A21A Domain[ROOT_All] INFO > Deaccess DbDomain READ [ROOT_All] Domain[ROOT_All] INFO > Deaccess DbDomain READ [ROOT_All] ApplicationMgr INFO Application Manager Stopped successfully @@ -294,25 +251,25 @@ IncidentProcAlg1 INFO Finalize CondInputLoader INFO Finalizing CondInputLoader... IncidentProcAlg2 INFO Finalize IdDictDetDescrCnv INFO in finalize -IOVDbSvc INFO Folder /LAR/Align (PoolRef) db-read 1/1 objs/chan/bytes 1/1/170 (( 1.19 ))s +IOVDbSvc INFO Folder /LAR/Align (PoolRef) db-read 1/1 objs/chan/bytes 1/1/170 (( 0.07 ))s IOVDbSvc INFO Folder /CALO/Ofl/Identifier/CaloTTOnAttrIdMapAtlas (PoolRef) db-read 0/0 objs/chan/bytes 0/1/0 (( 0.00 ))s IOVDbSvc INFO Folder /CALO/Ofl/Identifier/CaloTTOnOffIdMapAtlas (PoolRef) db-read 0/0 objs/chan/bytes 0/1/0 (( 0.00 ))s IOVDbSvc INFO Folder /CALO/Ofl/Identifier/CaloTTPpmRxIdMapAtlas (PoolRef) db-read 0/0 objs/chan/bytes 0/1/0 (( 0.00 ))s -IOVDbSvc INFO Folder /LAR/LArCellPositionShift (PoolRef) db-read 1/1 objs/chan/bytes 1/1/195 (( 0.97 ))s -IOVDbSvc INFO Folder /LAR/Identifier/LArTTCellMapAtlas (PoolRef) db-read 1/0 objs/chan/bytes 1/1/173 (( 1.08 ))s +IOVDbSvc INFO Folder /LAR/LArCellPositionShift (PoolRef) db-read 1/1 objs/chan/bytes 1/1/195 (( 0.02 ))s +IOVDbSvc INFO Folder /LAR/Identifier/LArTTCellMapAtlas (PoolRef) db-read 1/0 objs/chan/bytes 1/1/173 (( 0.03 ))s IOVDbSvc WARNING Folder /LAR/Identifier/LArTTCellMapAtlas is requested but no data retrieved -IOVDbSvc INFO Total payload read from COOL: 538 bytes in (( 3.24 ))s +IOVDbSvc INFO Total payload read from COOL: 538 bytes in (( 0.11 ))s IOVDbSvc INFO Connection sqlite://;schema=mycool.db;dbname=OFLP200 : nConnect: 0 nFolders: 0 ReadTime: (( 0.00 ))s -IOVDbSvc INFO Connection COOLOFL_LAR/OFLP200 : nConnect: 2 nFolders: 3 ReadTime: (( 3.24 ))s +IOVDbSvc INFO Connection COOLOFL_LAR/OFLP200 : nConnect: 2 nFolders: 3 ReadTime: (( 0.11 ))s IOVDbSvc INFO Connection COOLOFL_CALO/OFLP200 : nConnect: 1 nFolders: 3 ReadTime: (( 0.00 ))s AthDictLoaderSvc INFO in finalize... ToolSvc INFO Removing all tools created by ToolSvc *****Chrono***** INFO **************************************************************************************************** *****Chrono***** INFO The Final CPU consumption ( Chrono ) Table (ordered) *****Chrono***** INFO **************************************************************************************************** -cObjR_ALL INFO Time User : Tot= 480 [ms] Ave/Min/Max= 240(+- 220)/ 20/ 460 [ms] #= 2 -cObj_ALL INFO Time User : Tot= 0.59 [s] Ave/Min/Max=0.295(+-0.225)/ 0.07/ 0.52 [s] #= 2 -ChronoStatSvc INFO Time User : Tot= 3.07 [s] #= 1 +cObjR_ALL INFO Time User : Tot= 0.63 [s] Ave/Min/Max=0.315(+-0.305)/ 0.01/ 0.62 [s] #= 2 +cObj_ALL INFO Time User : Tot= 0.81 [s] Ave/Min/Max=0.405(+-0.295)/ 0.11/ 0.7 [s] #= 2 +ChronoStatSvc INFO Time User : Tot= 18.2 [s] #= 1 *****Chrono***** INFO **************************************************************************************************** ChronoStatSvc.f... INFO Service finalized successfully ApplicationMgr INFO Application Manager Finalized successfully diff --git a/Control/AthContainers/Root/debug.cxx b/Control/AthContainers/Root/debug.cxx index 3409d06d5ec8f7b7d5f6872ea9c556f3d12ec7b2..909642272281625f9c8e1a6a47a58121f861b83e 100644 --- a/Control/AthContainers/Root/debug.cxx +++ b/Control/AthContainers/Root/debug.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration */ // $Id$ @@ -62,7 +62,14 @@ void print_aux_vars (const SG::auxid_set_t& auxids) for (SG::auxid_t id : ids) { std::cout << id << " " << reg.getClassName(id) << "::" << reg.getName(id) << " " - << "[" << reg.getTypeName(id) << "]\n"; + << "[" << reg.getTypeName(id); + + SG::AuxTypeRegistry::Flags flags = reg.getFlags(id); + if (flags & SG::AuxTypeRegistry::Flags::Atomic) { + std::cout << " (atomic)"; + } + + std::cout << "]\n"; } } @@ -211,12 +218,13 @@ std::string aux_var_as_string (SG::auxid_t auxid, const void* p) CONVERT1 (char) CONVERT1 (unsigned char) CONVERT1 (long) - CONVERT1 (unsigned long) + CONVERT1 (unsigned long) CONVERT1 (long long) CONVERT1 (unsigned long long) CONVERT1 (float) CONVERT1 (double) CONVERT1 (bool) + CONVERT1 (std::string) //else os << "<??? " << AthContainers_detail::typeinfoName(*ti) << ">"; return os.str(); diff --git a/Control/AthViews/AthViews/ViewHelper.h b/Control/AthViews/AthViews/ViewHelper.h index 7bc2e0ec8d271d2e2c227277de9876b320794cb3..e60808e84258aa6e5a5c508b2163d8d7f5528f8a 100644 --- a/Control/AthViews/AthViews/ViewHelper.h +++ b/Control/AthViews/AthViews/ViewHelper.h @@ -97,11 +97,11 @@ namespace ViewHelper for ( SG::View* view : *ViewVector ) { //Make a context with the view attached - EventContext * viewContext = new EventContext( SourceContext ); + auto viewContext = std::make_unique< EventContext >( SourceContext ); viewContext->setExtension( Atlas::ExtendedEventContext( view, extendedContext->conditionsRun() ) ); //Attach the view to the named node - StatusCode sc = Scheduler->scheduleEventView( &SourceContext, NodeName, viewContext ); + StatusCode sc = Scheduler->scheduleEventView( &SourceContext, NodeName, std::move( viewContext ) ); if ( !sc.isSuccess() ) { return StatusCode::FAILURE; diff --git a/Control/AthViews/share/ViewScheduling.py b/Control/AthViews/share/ViewScheduling.py index 6c4aa88a71dbc52e78414dc5a0be6dfd4c751e8a..80fd3f355679bd1e855a38c1bc4b8fddfa79a508 100644 --- a/Control/AthViews/share/ViewScheduling.py +++ b/Control/AthViews/share/ViewScheduling.py @@ -18,6 +18,7 @@ from AthenaCommon.AlgScheduler import AlgScheduler AlgScheduler.ShowControlFlow( True ) AlgScheduler.ShowDataDependencies( True ) +AlgScheduler.EnableConditions( True ) # Control flow from AthenaCommon.AlgSequence import AthSequencer diff --git a/Control/AthenaConfiguration/CMakeLists.txt b/Control/AthenaConfiguration/CMakeLists.txt index 167bec4f2df6eec80e94e685b29caeed1f901a09..2bd8475dcd62251df558d0b0b0010e127fe6ab30 100644 --- a/Control/AthenaConfiguration/CMakeLists.txt +++ b/Control/AthenaConfiguration/CMakeLists.txt @@ -11,7 +11,7 @@ atlas_subdir( AthenaConfiguration ) # Install files from the package: atlas_install_python_modules( python/*.py ) atlas_install_runtime(python/*.pkl ) -atlas_install_scripts( share/confTool.py ) +atlas_install_scripts( share/confTool.py python/iconfTool/iconfTool ) atlas_add_test( ComponentAccumulatorTest SCRIPT python -m unittest -v AthenaConfiguration.ComponentAccumulator diff --git a/Control/AthenaConfiguration/python/ComponentAccumulator.py b/Control/AthenaConfiguration/python/ComponentAccumulator.py index eb251c7f2c89f2bf70c3d36c8055a736e17201b0..aec522a4eda4949132068da6f10a5efcf78c554d 100644 --- a/Control/AthenaConfiguration/python/ComponentAccumulator.py +++ b/Control/AthenaConfiguration/python/ComponentAccumulator.py @@ -362,15 +362,15 @@ class ComponentAccumulator(object): if other is None: return - if isinstance(other,collections.Sequence): #Check if we got more than one argument - if len(other)==0: - raise ConfigurationError("Merge called with empty sequence as argument") - for par in other[1:]: - if par is not None: #possible improvment: Check type of par and try to merge if applicable (service, public tool) - self._msg.warning("Merge called with a sequence of potentially un-merged components") - raise RuntimeError() - other=other[0] - + if isinstance(other,collections.Sequence): + self._msg.error("Merge called with a: %s " % str(type(other)) + " of length: %d " % len(other)) + self._msg.error("where elements are of type : " + ", ".join([ str(type(x).__name__) for x in other]) ) + if len(other) > 1 and isinstance(other[0], ComponentAccumulator): + self._msg.error("Try calling mergeAll") + raise RuntimeError("Merge can not handle a sequence: " + ", ".join([ str(type(x).__name__) for x in other]) +", call mergeAll instead" ) + else: + raise RuntimeError("Merge can not handle a sequence: " + ", ".join([ str(type(x).__name__) for x in other]) +"" ) + if not isinstance(other,ComponentAccumulator): raise TypeError("Attempt merge wrong type %s. Only instances of ComponentAccumulator can be added" % type(other).__name__) @@ -861,3 +861,14 @@ class MultipleParrentsInSequences( unittest.TestCase ): self.assertEquals( s['seq1']["Members"], "['AthSequencer/seqReco']", "After pickling recoSeq missing in seq1 " + s['seq1']["Members"]) self.assertEquals( s['seq2']["Members"], "['AthSequencer/seqReco']", "After pickling recoSeq missing in seq2 " + s['seq2']["Members"]) self.assertEquals( s['seqReco']["Members"], "['ConfigurablePyAlgorithm/recoAlg']", "After pickling seqReco is corrupt " + s['seqReco']["Members"] ) + +class FailedMerging( unittest.TestCase ): + def runTest( self ): + topCA = ComponentAccumulator() + + def badMerge(): + someCA = ComponentAccumulator() + topCA.merge( (someCA, 1, "hello") ) + self.assertRaises(RuntimeError, badMerge ) + + diff --git a/Control/AthenaConfiguration/python/iconfTool/gui/__init__.py b/Control/AthenaConfiguration/python/iconfTool/gui/__init__.py new file mode 100755 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/Control/AthenaConfiguration/python/iconfTool/gui/modals.py b/Control/AthenaConfiguration/python/iconfTool/gui/modals.py new file mode 100644 index 0000000000000000000000000000000000000000..7bd10b10cb1773446ed07f653b467bbab61982b4 --- /dev/null +++ b/Control/AthenaConfiguration/python/iconfTool/gui/modals.py @@ -0,0 +1,34 @@ +#!/usr/bin/env python2.7 +# -*- coding: utf-8 -*- + +# Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration + +import curses.textpad + + +class Modal(object): + def __init__(self, start_x, start_y, width, height): + self.width = width + self.height = height + self.start_x = start_x + self.start_y = start_y + self.window = curses.newwin(height, width, start_y, start_x) + self.window.box() + self.refresh() + + def refresh(self): + self.window.refresh() + + def destroy(self): + del self.window + + +class SearchModal(Modal): + def __init__(self, start_x, start_y, width, height): + super(SearchModal, self).__init__(start_x, start_y, width, height) + self.search_window = self.window.derwin(self.height - 2, + self.width - 2, 1, 1) + self.search = curses.textpad.Textbox(self.search_window) + + def edit(self): + return self.search.edit().strip() diff --git a/Control/AthenaConfiguration/python/iconfTool/gui/pad.py b/Control/AthenaConfiguration/python/iconfTool/gui/pad.py new file mode 100644 index 0000000000000000000000000000000000000000..a828bef9c33009b3f1e6cecba4af59a451f5bb79 --- /dev/null +++ b/Control/AthenaConfiguration/python/iconfTool/gui/pad.py @@ -0,0 +1,287 @@ +#!/usr/bin/env python2.7 +# -*- coding: utf-8 -*- + +# Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration + +import curses + +import logging + +logger = logging.getLogger('iconfTool.' + __name__) + + +class Pad(object): + def __init__(self, data_structure, width, height, start_x=0): + self.structure = data_structure + self.structure_list = self.structure.get_list() + self.root_items_names = {element.name for element in + self.structure_list} + self.width = width + self.start_x = start_x + self.MAX_PAD_HEIGHT = 32000 + self.pad = curses.newpad(self.MAX_PAD_HEIGHT, width) + self.actual_offset = 0 + self.pad_height = height - 1 + + self.mark_character = ' ' + self.styles = None + self.lines = [] + self.search_text = '' + + self.initialize_styles() + self.draw_all_structures() + self.actual_y = 0 + self.initialize_cursor() + self.refresh() + + def initialize_styles(self): + curses.init_pair(1, curses.COLOR_BLACK, + curses.COLOR_WHITE) # Sets up color pair + highlighted = curses.color_pair(1) # highlighted menu option + normal = curses.A_NORMAL # non-highlighted menu option + curses.init_pair(3, curses.COLOR_GREEN, curses.COLOR_BLACK) + marked = curses.color_pair(3) + self.styles = {'normal': normal, 'highlighted': highlighted, + 'marked': marked} + + def reload_data(self, data_structure): + self.structure = data_structure + self.structure_list = self.structure.get_list() + self.load_root_items_set() + self.filter(self.search_text) # Filter also draws structures + + def initialize_cursor(self): + # Highlight cursor on initial position + if self.lines_empty(): + return + try: + if self.actual_y >= len(self.lines): + self.actual_y = 0 + element = self.lines[self.actual_y] + curses.setsyx(self.actual_y, element.x_pos + 1) + self.pad.addch(curses.getsyx()[0], curses.getsyx()[1], + element.get_mark_character(), + self.styles['highlighted']) + curses.curs_set(0) + except IndexError: + # Handle situation when self.lines list is empty + pass + + def draw_structure(self, structure, start_y): + """start_y - starting vertical position where elements will be drawn""" + if start_y >= self.MAX_PAD_HEIGHT: + return + style = self.styles['marked' if structure.is_marked() else 'normal'] + self.pad.addstr(start_y, structure.x_pos, + '[{}] {}'.format(structure.get_mark_character(), + structure.get_name()), style) + self.lines.insert(start_y, structure) + start_y += 1 + if structure.type == 'GROUP' and structure.show_children: + for child in structure.children: + start_y = self.draw_structure(child, start_y) + return start_y + + def draw_all_structures(self): + self.lines = [] + start_y = 0 + for i in self.structure_list: + if start_y >= self.MAX_PAD_HEIGHT: + break + start_y = self.draw_structure(i, start_y) + self.refresh() + + def refresh(self): + self.pad.refresh(self.actual_offset, 0, 0, self.start_x, + self.pad_height, self.width + self.start_x - 2) + cursor_pos = curses.getsyx() + curses.setsyx(cursor_pos[0], cursor_pos[1] - self.start_x) + + def lines_empty(self): + return len(self.lines) == 0 + + def clear(self): + self.pad.clear() + self.refresh() + + def redraw(self, reinit_cursor=False): + cursor_pos = curses.getsyx() + self.pad.clear() + self.draw_all_structures() + if self.lines_empty(): + return + if reinit_cursor or cursor_pos[1] == 0: + self.actual_offset = 0 + self.actual_y = 0 + self.initialize_cursor() + else: + element = self.lines[self.actual_y] + self.pad.move(self.actual_y, cursor_pos[1]) + self.pad.addch(self.actual_y, cursor_pos[1] - 1, + element.get_mark_character(), + self.styles['highlighted']) + self.refresh() + + def filter(self, text, strict=False): + """ If is strict then it leaves only elements which fits to text + If not then it leaves whole structures in which text appear somewhere + """ + self.search_text = text if text else '' + if len(self.search_text) > 0: + if strict: + self.structure_list = self.structure.get_filtered_by_text(text) + else: + self.structure_list = filter( + lambda el: el.check_filter(self.search_text), + self.structure.get_list()) + else: + self.structure_list = self.structure.get_list() + self.redraw(True) + + def show_diff_only(self): + self.structure_list = self.structure.get_filtered_by_mark() + self.redraw(True) + + def show_all(self): + self.structure_list = self.structure.get_list() + self.redraw(True) + + def get_character(self, y, x): + current_character = chr(self.pad.inch(y, x) & 0xFF) + return current_character + + def move_cursor(self, number): + cursor_pos = self.hide_cursor() + self.actual_y += number + if self.actual_y < len(self.lines): + self.set_cursor(cursor_pos[0] + number, + self.lines[self.actual_y].x_pos + 1) + + def hide_cursor(self): + cursor_pos = curses.getsyx() + current_character = self.get_character( + cursor_pos[0] + self.actual_offset, cursor_pos[1] - 1) + self.pad.addch(cursor_pos[0] + self.actual_offset, cursor_pos[1] - 1, + current_character, + self.styles['normal']) + return cursor_pos + + def show_cursor(self): + cursor_pos = curses.getsyx() + current_character = self.get_character( + cursor_pos[0] + self.actual_offset, cursor_pos[1] - 1) + self.pad.addch(cursor_pos[0] + self.actual_offset, cursor_pos[1] - 1, + current_character, + self.styles['highlighted']) + self.refresh() + + def set_cursor(self, y, x): + curses.setsyx(y, x) + cursor_pos = curses.getsyx() + current_character = self.get_character( + cursor_pos[0] + self.actual_offset, cursor_pos[1]) + self.pad.addch(cursor_pos[0] + self.actual_offset, cursor_pos[1], + current_character, + self.styles['highlighted']) + self.refresh() + + def scroll(self, number): + self.actual_offset += number + self.refresh() + + def scroll_to_element(self, new_y): + self.actual_y = new_y + self.hide_cursor() + # Handle the situation when element is above current view + if new_y < self.actual_offset: + self.actual_offset = new_y - 1 + if self.actual_offset < 0: + self.actual_offset = 0 + elif new_y > self.actual_offset + self.pad_height: + self.actual_offset = new_y - 1 + if self.actual_offset + self.pad_height > len(self.lines): + self.actual_offset = len(self.lines) - self.pad_height + self.set_cursor(new_y - self.actual_offset, + self.lines[new_y].x_pos + 1) + + def get_index_by_name(self, name): + for index, element in enumerate(self.lines): + if element.parent is None and element.name == name: + return index + return -1 + + def move_down(self): + if self.actual_y < len(self.lines) - 1: + self.move_cursor(1) + cursor_pos = curses.getsyx() + if cursor_pos[0] > self.pad_height - 4: + self.scroll(1) + + def move_up(self): + if len(self.lines) == 0: + return + if self.actual_y >= 1: + self.move_cursor(-1) + cursor_pos = curses.getsyx() + if cursor_pos[0] < 4 and self.actual_offset > 0: + self.scroll(-1) + + def expand(self): + if self.actual_y >= len(self.lines): + return + element = self.lines[self.actual_y] + if element.type == 'GROUP': + element.show_children = True + self.redraw() + + def collapse(self): + if self.actual_y >= len(self.lines): + return + element = self.lines[self.actual_y] + if element.type == 'GROUP': + element.show_children = False + self.redraw() + + def set_as_checked(self): + element = self.lines[self.actual_y] + if element.checked: + element.set_as_unchecked() + self.structure.remove_from_checked(element) + else: + element.set_as_checked() + self.structure.add_to_checked(element) + self.redraw() + + def go_to_reference(self): + if self.actual_y >= len(self.lines): + return + element = self.lines[self.actual_y] + if not element.type == 'SINGLE': + return + reference_name = element.get_reference_name() + if reference_name not in self.root_items_names: + return + # Cancel eventual search result + self.filter(None) + index = self.get_index_by_name(reference_name) + if index != -1: + self.scroll_to_element(index) + else: + # Scroll to first element if name was not found + # (should never happen as the name is checked + # in root_items_names first) + self.scroll_to_element(0) + + def handle_event(self, event): + if event == curses.KEY_DOWN: + self.move_down() + elif event == curses.KEY_UP: + self.move_up() + elif event == curses.KEY_RIGHT: + self.expand() + elif event == curses.KEY_LEFT: + self.collapse() + elif event == ord(' '): + self.set_as_checked() + elif event == ord('g'): + self.go_to_reference() diff --git a/Control/AthenaConfiguration/python/iconfTool/gui/wrappers.py b/Control/AthenaConfiguration/python/iconfTool/gui/wrappers.py new file mode 100644 index 0000000000000000000000000000000000000000..4909846834d603e87c38981f55d9de37165b831f --- /dev/null +++ b/Control/AthenaConfiguration/python/iconfTool/gui/wrappers.py @@ -0,0 +1,165 @@ +#!/usr/bin/env python2.7 +# -*- coding: utf-8 -*- + +# Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration + +import curses +import logging + +from gui.modals import SearchModal +from gui.pad import Pad + +logger = logging.getLogger('iconfTool.' + __name__) + + +class GuiLoader(object): + def __init__(self, data_loader): + self.data_loader = data_loader + self.data_structure = self.data_loader.get_data() + self.width, self.height, self.pad_height = (0, 0, 0) + self.pad = None + self.actual_offset = 0 + self.screen = None + + def _initialize_window(self): + self.height, self.width = self.screen.getmaxyx() + self.window = curses.newwin(self.height, self.width, 0, 0) + self.pad = Pad(self.data_structure, self.width, self.height) + self.pad_height = self.height - 1 + self.pad.refresh() + + def _initialize(self, stdscreen): + self.screen = stdscreen + self.screen.refresh() + self._initialize_window() + self._start_event_loop() + + def load_gui(self): + curses.wrapper(self._initialize) + + def search(self, strict=False): + search_size = 50 + b_starty = 0 + b_startx = self.width - search_size - 2 + b_width = search_size + b_height = 3 + cursor_pos = curses.getsyx() + search = SearchModal(b_startx, b_starty, b_width, b_height) + text = search.edit() + curses.setsyx(cursor_pos[0], cursor_pos[1]) + self.pad.filter(text, strict) + + def refresh_whole_screen(self): + self.window.refresh() + self.pad.refresh() + + def _start_event_loop(self): + while True: + event = self.screen.getch() + if event == ord('q'): + break + elif event == ord('f'): + self.search() + elif event == ord('m'): + self.search(True) + elif event == ord('r'): + self.data_structure = self.data_loader.get_data() + self.pad.reload_data(self.data_structure) + else: + self.pad.handle_event(event) + + +class DoublePad(object): + def __init__(self, data_loader): + self.data_loader = data_loader + self.data_structure, self.diff_structure = self.data_loader.get_data() + self.width, self.height, self.pad_height = (0, 0, 0) + self.pad = None + self.diff_pad = None + self.current_pad = None + self.inactive_pad = None + self.actual_offset = 0 + self.screen = None + self.show_diff_only = False + + def _initialize_window(self): + self.height, self.width = self.screen.getmaxyx() + self.window = curses.newwin(self.height, self.width, 0, 0) + self.pad = Pad(self.data_structure, self.width / 2 - 1, self.height) + self.diff_pad = Pad(self.diff_structure, self.width / 2 - 1, + self.height, self.width / 2 + 2) + self.pad_height = self.height - 1 + self.current_pad, self.inactive_pad = self.pad, self.diff_pad + self.diff_pad.hide_cursor() + self.diff_pad.refresh() + self.pad.refresh() + + def _initialize(self, stdscreen): + self.screen = stdscreen + self.screen.refresh() + self._initialize_window() + self._start_event_loop() + + def load_gui(self): + curses.wrapper(self._initialize) + + def search(self, strict=False): + search_size = 50 + b_starty = 0 + b_startx = self.width - search_size - 2 + b_width = search_size + b_height = 3 + cursor_pos = curses.getsyx() + search = SearchModal(b_startx, b_starty, b_width, b_height) + text = search.edit() + curses.setsyx(cursor_pos[0], cursor_pos[1]) + self.current_pad.filter(text, strict) + self.inactive_pad.filter(text, strict) + + def refresh_whole_screen(self): + self.window.refresh() + self.current_pad.refresh() + self.inactive_pad.refresh() + + def change_actual_pad(self): + if self.inactive_pad.lines_empty(): + return + self.current_pad.hide_cursor() + self.current_pad, self.inactive_pad = self.inactive_pad, \ + self.current_pad + self.inactive_pad.refresh() + self.current_pad.refresh() + self.current_pad.show_cursor() + + def switch_to_diff(self): + if self.show_diff_only: + self.current_pad.show_all() + self.inactive_pad.show_all() + self.show_diff_only = False + else: + self.current_pad.show_diff_only() + self.inactive_pad.show_diff_only() + self.show_diff_only = True + + def _start_event_loop(self): + while True: + event = self.screen.getch() + if event == ord('q'): + break + elif event == ord('\t'): + self.change_actual_pad() + elif event == ord('f'): + self.search() + elif event == ord('m'): + self.search(True) + elif event == ord('d'): + self.switch_to_diff() + elif event == ord('r'): + self.pad.clear() + self.diff_pad.clear() + self.data_structure, self.diff_structure = \ + self.data_loader.get_data() + self.pad.reload_data(self.data_structure) + self.diff_pad.reload_data(self.diff_structure) + else: + self.current_pad.handle_event(event) diff --git a/Control/AthenaConfiguration/python/iconfTool/iconfTool b/Control/AthenaConfiguration/python/iconfTool/iconfTool new file mode 100755 index 0000000000000000000000000000000000000000..e9eb6550328bda7232551dd21ae4c6f50a9a2516 --- /dev/null +++ b/Control/AthenaConfiguration/python/iconfTool/iconfTool @@ -0,0 +1,68 @@ +#!/usr/bin/env python2.7 +# -*- coding: utf-8 -*- + +# Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration + +import argparse +import logging + + +# Logging configuration +logging_file = 'run.log' +# Creating or cleaning log file +with open(logging_file, 'w'): + pass +handler = logging.FileHandler(logging_file) +handler.setLevel(logging.DEBUG) +formatter = logging.Formatter('%(asctime)s [%(levelname)s] %(message)s') +handler.setFormatter(formatter) + +logger = logging.getLogger('iconfTool') +logger.setLevel(logging.DEBUG) +logger.addHandler(handler) + + +from gui.wrappers import GuiLoader, DoublePad +from models.loaders import ComponentsFileLoader, ComponentsDiffFileLoader +from utils import serialization + + +if __name__ == '__main__': + + parser = argparse.ArgumentParser() + parser.add_argument('-i', '--input', type=str, help='Input file path') + parser.add_argument('-d', '--diff', type=str, help='Diff input file path') + parser.add_argument('-nr', '--no-replace', action='store_true', + help='Disable replacing references in structure') + parser.add_argument('-c', '--config', type=str, + help='Path to configuration file, where marked ' + 'elements identificators are saved') + args = parser.parse_args() + + if not args.input: + msg = 'Missing input file' + logger.error(msg) + exit(msg) + + if args.config: + try: + checked_elements = serialization.load_strings_set(args.config) + except TypeError: + logger.warning( + 'Cannot load checked elements from configuration file') + checked_elements = set() + else: + checked_elements = set() + + if args.diff: + loader = ComponentsDiffFileLoader(args.input, args.diff, + args.no_replace, checked_elements) + gui_loader = DoublePad(loader) + else: + loader = ComponentsFileLoader(args.input, args.no_replace) + gui_loader = GuiLoader(loader) + + gui_loader.load_gui() + + if args.config: + serialization.save_object(args.config, checked_elements) diff --git a/Control/AthenaConfiguration/python/iconfTool/models/__init__.py b/Control/AthenaConfiguration/python/iconfTool/models/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/Control/AthenaConfiguration/python/iconfTool/models/element.py b/Control/AthenaConfiguration/python/iconfTool/models/element.py new file mode 100644 index 0000000000000000000000000000000000000000..82558a5a6b270ad97c68fe519f599cedc9755c5b --- /dev/null +++ b/Control/AthenaConfiguration/python/iconfTool/models/element.py @@ -0,0 +1,146 @@ +#!/usr/bin/env python2.7 +# -*- coding: utf-8 -*- + +# Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration + +import logging + +logger = logging.getLogger('iconfTool.' + __name__) + +INDENT = 3 + + +class Element(object): + def __init__(self, name, x_pos, parent=None): + self.name = '{}'.format(name) # handles situation when name is not str + self.x_pos = x_pos + self.parent = parent + self.show_children = False + self.marked = False # For diff displaying + self.checked = False # For disabling diff highlight + self.replaced = False # To prevent replacing multiple times + self.hash = None + self.generate_hash() + + def get_name(self): + return self.name + + def update_xpos(self, new_xpos): + self.x_pos = new_xpos + + def get_as_flat_list(self): + return [self] + + def mark(self): + self.marked = True + + def has_parent(self, name_string): + parent = self.parent + while parent: + if parent.get_name() == name_string: + return True + parent = parent.parent # Go level up + return False + + def set_parent(self, parent): + self.parent = parent + self.generate_hash() + + def generate_hash(self): + base = self.get_name() + if self.parent: + base = self.parent.hash + base + self.hash = str(hash(base)) + + def is_checked(self): + if self.checked: + return True + parent = self.parent + while parent and parent.marked: + if parent.checked: + return True + parent = parent.parent + return False + + def is_marked(self): + return self.marked and not self.is_checked() + + def set_as_checked(self): + self.checked = True + + def set_as_unchecked(self): + self.checked = False + + def get_mark_character(self): + return ' ' if not self.checked else 'X' + + def sort_children(self): + pass + + +class GroupingElement(Element): + def __init__(self, name, x_pos, parent=None): + super(GroupingElement, self).__init__(name, x_pos, parent) + self.type = 'GROUP' + self.children = [] + + def check_filter(self, filter_text): + if filter_text in self.get_name(): + return True + for child in self.children: + if child.check_filter(filter_text): + return True + return False + + def add_child(self, child): + self.children.append(child) + child.parent = self + + def update_xpos(self, new_xpos): + self.x_pos = new_xpos + for child in self.children: + child.update_xpos(new_xpos + INDENT) + + def get_as_flat_list(self): + return [self] + [child.get_as_flat_list() for child in self.children] + + def mark(self): + self.marked = True + for child in self.children: + child.mark() + + def sort_children(self): + self.children.sort(key=lambda c: c.get_name().lower()) + for child in self.children: + if child.type == 'GROUP': + child.sort_children() + + +class SingleElement(Element): + def __init__(self, name, x_pos, parent=None): + super(SingleElement, self).__init__(name, x_pos, parent) + self.type = 'SINGLE' + self.value_type = False + + def check_filter(self, filter_text): + return filter_text in self.get_name() + + def get_reference_name(self): + return self.name.split('/')[-1] if type(self.name) is str \ + else str(self.name) + + +class ValueElement(SingleElement): + def __init__(self, name, x_pos, value, parent=None): + """ Value must be initialized first as it is used in hash generating + """ + self.value = value + super(ValueElement, self).__init__(name, x_pos, parent) + self.value_type = True + + def get_name(self): + return '{} = {}'.format(self.name, self.value) + + def get_reference_name(self): + return self.value.split('/')[-1] if type(self.value) == str \ + else str(self.value) diff --git a/Control/AthenaConfiguration/python/iconfTool/models/loaders.py b/Control/AthenaConfiguration/python/iconfTool/models/loaders.py new file mode 100644 index 0000000000000000000000000000000000000000..5cafc52f3c7fc23a669af75a7a64390e1540b609 --- /dev/null +++ b/Control/AthenaConfiguration/python/iconfTool/models/loaders.py @@ -0,0 +1,95 @@ +#!/usr/bin/env python2.7 +# -*- coding: utf-8 -*- + +# Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration + +import pickle +import logging + +from models.structure import ComponentsStructure + +logger = logging.getLogger('iconfTool.' + __name__) + + +class ComponentsFileLoader(object): + def __init__(self, file_path, no_replace, checked_elements=set()): + self.file_path = file_path + self.no_replace = no_replace + self.checked_elements = checked_elements + + def _load_file_data(self): + f = open(self.file_path, 'rb') + st = pickle.load(f) + f.close() + return dict(st) + + def load_structure(self): + data = self._load_file_data() + structure = ComponentsStructure(data, self.no_replace, + self.checked_elements) + structure.generate() + return structure + + def get_data(self): + return self.load_structure() + + +class ComponentsDiffFileLoader(object): + def __init__(self, file_path, diff_file_path, no_replace, + checked_elements): + self.main_loader = ComponentsFileLoader(file_path, no_replace, + checked_elements) + self.diff_loader = ComponentsFileLoader(diff_file_path, no_replace, + checked_elements) + + def get_data(self): + structure = self.main_loader.load_structure() + diff_structure = self.diff_loader.load_structure() + self.mark_differences(structure.get_list(), diff_structure.get_list()) + return structure, diff_structure + + def equal(self, first, second): + return first.get_name() == second.get_name() \ + and first.x_pos == second.x_pos and first.type == second.type + + def mark_differences(self, structure, diff_structure): + i, j = 0, 0 + while i < len(structure) and j < len(diff_structure): + if self.equal(structure[i], diff_structure[j]): + if structure[i].type == 'GROUP': + self.mark_differences(structure[i].children, + diff_structure[j].children) + i += 1 + j += 1 + continue + + # Find equal element in diff structure + for tmp_j in range(j, len(diff_structure)): + if self.equal(structure[i], diff_structure[tmp_j]): + for marking_j in range(j, tmp_j): + diff_structure[marking_j].mark() + j = tmp_j + break + else: + # Not found equal element in diff structure + # Find equal element in first structure + for tmp_i in range(i, len(structure)): + if self.equal(structure[tmp_i], diff_structure[j]): + for marking_i in range(i, tmp_i): + structure[marking_i].mark() + i = tmp_i + break + else: + structure[i].mark() + diff_structure[j].mark() + i += 1 + j += 1 + + # Mark remaining elements in both structures + while i < len(structure): + structure[i].mark() + i += 1 + + while j < len(diff_structure): + diff_structure[j].mark() + j += 1 diff --git a/Control/AthenaConfiguration/python/iconfTool/models/structure.py b/Control/AthenaConfiguration/python/iconfTool/models/structure.py new file mode 100644 index 0000000000000000000000000000000000000000..15af721498a5a479419094941bf30933a129bdb0 --- /dev/null +++ b/Control/AthenaConfiguration/python/iconfTool/models/structure.py @@ -0,0 +1,262 @@ +#!/usr/bin/env python2.7 +# -*- coding: utf-8 -*- + +# Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration + +import ast +import copy +import sys +import logging + +from models.element import SingleElement, GroupingElement, ValueElement + +logger = logging.getLogger('iconfTool.' + __name__) +INDENT = 3 + + +class Structure(object): + def __init__(self, flags_dict, checked_elements=set()): + self.flags_dict = flags_dict + self.structure = {} + self.checked_elements = checked_elements # Set of checked elements + # hashed + + def generate_structure_dict(self): + """ Split dictionary keys into nested structure + e.g. Test1.Test2: Value -> Test1: {Test2: Value} + """ + structure_dict = {} + for flag, value in self.flags_dict.iteritems(): + groups = flag.split('.') + structure_point = structure_dict + for i in range(len(groups) - 1): + if groups[i] not in structure_point: + structure_point[groups[i]] = {} + elif type(structure_point[groups[i]]) is str: + structure_point[groups[i]] = { + structure_point[groups[i]]: {}} + structure_point = structure_point[groups[i]] + if groups: + last = groups[-1] + structure_point[last] = value + return structure_dict + + def generate_for_element(self, grouping_element, structure): + child_x_pos = grouping_element.x_pos + INDENT + for child in structure: + try: + # Handles situation when list or dict is provided as a string + structure[child] = ast.literal_eval(structure[child]) + except (ValueError, SyntaxError): + pass + + if type(structure[child]) is dict: + group = GroupingElement(child, child_x_pos, grouping_element) + if group.hash in self.checked_elements: + group.set_as_checked() + self.generate_for_element(group, structure[child]) + grouping_element.add_child(group) + elif type(structure[child]) is list: + group = GroupingElement(child, child_x_pos, grouping_element) + if group.hash in self.checked_elements: + group.set_as_checked() + for el in structure[child]: + no_value_child = SingleElement(el, child_x_pos + INDENT) + if no_value_child.hash in self.checked_elements: + no_value_child.set_as_checked() + group.add_child(no_value_child) + grouping_element.add_child(group) + else: + flag = ValueElement(child, child_x_pos, structure[child], + grouping_element) + if flag.hash in self.checked_elements: + flag.set_as_checked() + grouping_element.add_child(flag) + + def generate(self, x_pos=0): + structure_dict = self.generate_structure_dict() + roots = [] + for root in structure_dict: + if type(structure_dict[root]) == dict: + root_group = GroupingElement(root, x_pos) + self.generate_for_element(root_group, structure_dict[root]) + roots.append(root_group) + else: + flag = ValueElement(root, x_pos, structure_dict[root]) + roots.append(flag) + return sorted(roots, key=lambda r: r.name.lower()) + + def add_to_checked(self, element): + hash_value = element.hash + self.checked_elements.add(hash_value) + + def remove_from_checked(self, element): + hash_value = element.hash + if hash_value in self.checked_elements: + self.checked_elements.remove(hash_value) + + +class ComponentsStructure(Structure): + def __init__(self, flags_dict, no_replace, checked_elements): + super(ComponentsStructure, self).__init__(flags_dict, checked_elements) + self.roots_dict = {} + self.structure_list = [] + self.no_replace = no_replace + self.filter = None # Filter object used in search + + def replace_references(self, element, nesting=0): + element.replaced = True + if element.type != 'GROUP': + return + for i, child in enumerate(element.children): + if element.children[i].type == 'SINGLE': + ref_name = element.children[i].get_reference_name() + if ref_name in self.roots_dict and not element.has_parent( + self.roots_dict[ref_name].get_name()): + element.children[i] = copy.deepcopy( + self.roots_dict[ref_name]) + element.children[i].parent = element + element.update_xpos(element.x_pos) + if element.children[i].type == 'GROUP' \ + and not element.children[i].replaced: + # Single element can have been transformed into grouping + # element in previous section + self.replace_references(element.children[i], nesting + 1) + + def generate(self, x_pos=0): + structure_dict = self.generate_structure_dict() + self.structure_list = [] + for root_name in structure_dict: + if type(structure_dict[root_name]) == dict: + root_group = GroupingElement(root_name, x_pos) + if root_group.hash in self.checked_elements: + root_group.set_as_checked() + self.generate_for_element(root_group, + structure_dict[root_name]) + self.structure_list.append(root_group) + self.roots_dict[root_name] = root_group + else: + flag = ValueElement(root_name, x_pos, + structure_dict[root_name]) + if flag.hash in self.checked_elements: + flag.set_as_checked() + self.structure_list.append(flag) + if not self.no_replace: + counter = 1 + print('{} structures to reconstruct'.format( + len(self.structure_list))) + for root in self.structure_list: + sys.stdout.write('\rReconstructing {}...'.format(counter)) + sys.stdout.flush() + counter += 1 + self.replace_references(root) + sys.stdout.write('\rStructures reconstructed\n') + sys.stdout.flush() + self.sort() + self.filter = ComponentsStructureFilter(self.structure_list) + + def get_list(self): + self.filter.reset() + return self.structure_list + + def get_as_flat_list(self): + self.filter.reset() + return [root.get_as_flat_list() for root in self.structure_list] + + def get_filtered_by_text(self, filter_text): + return self.filter.generate_by_text(filter_text) + + def get_filtered_by_mark(self): + return self.filter.generate_by_mark() + + def sort(self): + self.structure_list.sort(key=lambda el: el.get_name().lower()) + for element in self.structure_list: + element.sort_children() + + +class ComponentsStructureFilter(object): + def __init__(self, structure): + self.structure = structure + self.output = [] # Found elements with their parents + self.found_elements = [] # Elements which are stored in the original + self.filter_called = False # Used to restore found elements to + # previous state + + def reset(self): + if not self.filter_called: + return + for element in self.found_elements: + if element.parent: + element.update_xpos(element.parent.x_pos + INDENT) + self.output = [] + self.found_elements = [] + self.filter_called = False + + def generate_by_text(self, filter_text): + self.reset() + self.browse_and_save_by_text(self.structure, filter_text) + for element in self.output: + element.update_xpos(0) + self.filter_called = True + return self.output + + def browse_and_save_by_text(self, elements, filter_text): + filtered = filter(lambda el: filter_text in el.get_name(), + elements) + if len(filtered) > 0: + # All elements are on the same level and therefore have + # the same parents + first = filtered[0] + if first.parent and first.parent.parent: + root_parent = copy.copy(first.parent.parent) + direct_parent = copy.copy(first.parent) + direct_parent.children = filtered + root_parent.children = [direct_parent] + self.output.append(root_parent) + self.found_elements += filtered + elif first.parent: + direct_parent = copy.copy(first.parent) + direct_parent.children = filtered + self.output.append(direct_parent) + self.found_elements += filtered + else: + self.output += filtered + self.found_elements += filtered + for element in elements: + if element.type == 'GROUP': + self.browse_and_save_by_text(element.children, filter_text) + + def generate_by_mark(self): + self.reset() + self.browse_and_save_by_mark(self.structure) + for element in self.output: + element.update_xpos(0) + self.filter_called = True + return self.output + + def browse_and_save_by_mark(self, elements): + filtered = [el for el in elements if el.is_marked()] + to_check = [el for el in elements if not el.is_marked()] + if len(filtered) > 0: + # All elements are on the same level and therefore have + # the same parents + first = filtered[0] + if first.parent and first.parent.parent: + root_parent = copy.copy(first.parent.parent) + direct_parent = copy.copy(first.parent) + direct_parent.children = filtered + root_parent.children = [direct_parent] + self.output.append(root_parent) + self.found_elements += filtered + elif first.parent: + direct_parent = copy.copy(first.parent) + direct_parent.children = filtered + self.output.append(direct_parent) + self.found_elements += filtered + else: + self.output += filtered + self.found_elements += filtered + for element in to_check: + if element.type == 'GROUP': + self.browse_and_save_by_mark(element.children) diff --git a/Control/AthenaConfiguration/python/iconfTool/utils/__init__.py b/Control/AthenaConfiguration/python/iconfTool/utils/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/Control/AthenaConfiguration/python/iconfTool/utils/serialization.py b/Control/AthenaConfiguration/python/iconfTool/utils/serialization.py new file mode 100644 index 0000000000000000000000000000000000000000..7728e8fd752c291f97d462e9d60818a40dbec740 --- /dev/null +++ b/Control/AthenaConfiguration/python/iconfTool/utils/serialization.py @@ -0,0 +1,19 @@ +import pickle + + +def save_object(file_path, obj): + f = open(file_path, 'wb') + pickle.dump(obj, f) + f.close() + + +def load_strings_set(file_path): + f = open(file_path, 'rb') + s = pickle.load(f) + f.close() + if type(s) != set: + raise TypeError('Saved object is not a set') + for element in s: + if type(element) != str: + raise TypeError('Set element is not a string') + return s diff --git a/Control/AthenaKernel/share/ClassName_test.ref b/Control/AthenaKernel/share/ClassName_test.ref old mode 100755 new mode 100644 diff --git a/Control/AthenaMonitoring/share/DataQualitySteering_jobOptions.py b/Control/AthenaMonitoring/share/DataQualitySteering_jobOptions.py index 57d87b85bb61400dbdc9d75b2ae58ab3b7131e19..226531f5e14d9f248811da349383eabb5155a461 100644 --- a/Control/AthenaMonitoring/share/DataQualitySteering_jobOptions.py +++ b/Control/AthenaMonitoring/share/DataQualitySteering_jobOptions.py @@ -37,11 +37,6 @@ if DQMonFlags.doMonitoring(): include("AthenaMonitoring/AtlasReadyFilterTool_jobOptions.py") include("AthenaMonitoring/FilledBunchFilterTool_jobOptions.py") - # Ugly hack to get list of tools in job at this point - # We will compare the list at the end of the script to get the monitoring - # tools - monToolSet_before = set(ToolSvc.getChildren()) - #---------------------------# # Inner detector monitoring # #---------------------------# @@ -254,9 +249,17 @@ if DQMonFlags.doMonitoring(): #--------------------------# if rec.triggerStream()=='express': include("AthenaMonitoring/AtlasReadyFilterTool_jobOptions.py") - monToolSet_after = set(ToolSvc.getChildren()) + local_logger.debug('DQ Post-Setup Configuration') - for tool in monToolSet_after-monToolSet_before: + + # now the DQ tools are private, extract them from the set of monitoring algorithms + toolset = set() + from AthenaMonitoring.AthenaMonitoringConf import AthenaMonManager + for _ in topSequence: + if isinstance(_, AthenaMonManager): + toolset.update(_.AthenaMonTools) + + for tool in toolset: # stop lumi access if we're in MC or enableLumiAccess == False if 'EnableLumi' in dir(tool): if globalflags.DataSource.get_Value() == 'geant4' or not DQMonFlags.enableLumiAccess(): @@ -282,6 +285,4 @@ if DQMonFlags.doMonitoring(): postprocfunc(tool) del postprocfunc - del monToolSet_before, monToolSet_after - del local_logger diff --git a/Control/AthenaMonitoring/src/AthenaMonManager.cxx b/Control/AthenaMonitoring/src/AthenaMonManager.cxx index a030c385383ef591dbd6f43ca3433832ad910745..84b54ae598e2d26c0e74d7fdd6ad05c7c9c4206f 100755 --- a/Control/AthenaMonitoring/src/AthenaMonManager.cxx +++ b/Control/AthenaMonitoring/src/AthenaMonManager.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration */ // ********************************************************************** @@ -219,7 +219,10 @@ std::string strToLower( const std::string& str ); AthenaMonManager:: AthenaMonManager( const std::string& name, ISvcLocator* pSvcLocator ) - : AthAlgorithm( name, pSvcLocator ), m_THistSvc(0), m_d(new Imp(this, name)) + : AthAlgorithm( name, pSvcLocator ) + , m_monTools( this ) + , m_THistSvc(0) + , m_d(new Imp(this, name)) { declareProperty( "AthenaMonTools", m_monTools ); declareProperty( "CheckEveryNoEvents", m_d->m_everyNevents ); diff --git a/Control/CLIDComps/CMakeLists.txt b/Control/CLIDComps/CMakeLists.txt index bac701c5ed1b6d593e2cb74932977c7ca11510f8..3c833dccb5cb325ef8f775aaf8452360684cf84d 100644 --- a/Control/CLIDComps/CMakeLists.txt +++ b/Control/CLIDComps/CMakeLists.txt @@ -42,7 +42,7 @@ atlas_add_test( ClassIDSvc_test atlas_add_test( clid SCRIPT test/_clid_unittest.py - EXTRA_PATTERNS "Ran 2 tests in" ) + EXTRA_PATTERNS "Ran 3 tests in" ) # Install files from the package: atlas_install_python_modules( python/*.py ) diff --git a/Control/CLIDComps/share/clid b/Control/CLIDComps/share/clid index 9ab951d083e21a2261f595e2129c043506986a28..e9720b9aa880d2b523504f9c6d188f64d833d4ff 100755 --- a/Control/CLIDComps/share/clid +++ b/Control/CLIDComps/share/clid @@ -1,4 +1,4 @@ -exec python -tx "$0" "$@" +#!/usr/bin/env python ## @file clid # @brief CLI to Athena CLID DB. "clid -h" for help @@ -9,19 +9,10 @@ import sys, os from CLIDComps.clidGenerator import clidGenerator from optparse import OptionParser -# -def help_examples(prog): - print "Usage Examples: " - print ' ',prog,' -m LArCell' - print ' ',prog,' 2001' - print ' ',prog,' --cliddb=clid.db -f "Cr"' - - - # # options and their arguments. # -parser = OptionParser(usage="%prog [options] [class name] OR [clid] (Enter %prog -h for help)", version="%prog - Athena CLID Generator v 2.0") +parser = OptionParser(usage="%prog [options] [class name] OR [clid] (Enter %prog -h for help)", version="%prog - Athena CLID Generator v 2.1") parser.add_option("-b", "--cliddb", dest="cliddb", help="Reconcile generated CLID with CLID DataBase CLIDDB", metavar="CLIDDB") @@ -31,16 +22,16 @@ parser.add_option("-f", "--find", action="append", dest="relist", help="Find entry whose ClassName or CLID matches regex. \n (See Python re module for syntax of REGEX.)", metavar="REGEX") +parser.add_option("-c", "--condcont", action="store_true", dest="condcont", + help="Create the CLID of the conditions container", default=False) parser.add_option("-m", "--macro", action="store_true", dest="macro", - help="Print StoreGate CLASS_DEF macro line", default=False) + help="Print StoreGate CLASS_DEF or CONDCONT_DEF macro line", default=False) parser.add_option("-s", "--silent", action="store_true", dest="silent", help=" Be more silent on output. Print _only_ result. \n (N.B. Overrides -m option.)", default=False) # #load options # (options, args) = parser.parse_args() -#print options -#print args if len(args) != 1 and options.relist == None: parser.error("takes exactly 1 argument") @@ -62,7 +53,11 @@ for a in args: i = int(a) except: n = a - c = cgen.genClidFromName(a) + if options.condcont: + if n.startswith('CondCont'): + parser.error('Class %s is already of type CondCont. Run without -c option.' % a) + n = 'CondCont<%s>' % a + c = cgen.genClidFromName(n) else: n = cgen.getNameFromClid(i) c = i @@ -71,7 +66,11 @@ for a in args: if options.debug: print c,n,'(',hash(n),hash(n)&cgen._clidGenerator__mask,"%8x"%c,')' else: - if options.macro: print "CLASS_DEF(",n,",",c,", 1 )" + if options.macro: + if options.condcont: + print "CONDCONT_DEF(",a,",",c,")" + else: + print "CLASS_DEF(",n,",",c,", 1 )" else: if options.silent: print c else: diff --git a/Control/CLIDComps/share/clid.ref b/Control/CLIDComps/share/clid.ref index 2242aaf0601f0768a6f63ccff92038fea0dda663..fc81fb68578995bf19885c94f30f75b135b1dbdc 100644 --- a/Control/CLIDComps/share/clid.ref +++ b/Control/CLIDComps/share/clid.ref @@ -1,5 +1,5 @@ -.. +... ---------------------------------------------------------------------- -Ran 2 tests in 0.027s +Ran 3 tests in 0.027s OK diff --git a/Control/CLIDComps/test/_clid_unittest.py b/Control/CLIDComps/test/_clid_unittest.py index c17411ce8634ead07619432de435568f3b24b567..bb509b18175f2e6bb741c5d8fdc4d36b92525d00 100755 --- a/Control/CLIDComps/test/_clid_unittest.py +++ b/Control/CLIDComps/test/_clid_unittest.py @@ -1,12 +1,12 @@ #!/usr/bin/env python -# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +# Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration ## @file clid_unittest.py # @brief Unit tests for clidGenerator """Unit tests for clidGenerator.""" -import os, sys, unittest +import os, sys, unittest, subprocess from CLIDComps.clidGenerator import clidGenerator @@ -38,6 +38,14 @@ class CLIDTestCase( TestFixture ): self.assertEqual( 245732527, self.cgen.genClidFromName("DataObject") ) self.assertEqual( 205083834, self.cgen.genClidFromName("Data<Foo23_45___Bar_, dsfl__>") ) +## test the 'clid' command line script +class CLIDScriptTest( unittest.TestCase ): + def testScript( self ): + self.assertEqual( 245732527, int(subprocess.check_output(['clid','-s','DataObject']))) + self.assertEqual( subprocess.check_output(['clid','-sc','DataObject']), + subprocess.check_output(['clid','-s','CondCont<DataObject>']) ) + + ## run tests if in standalone mode if __name__ == '__main__': unittest.main() diff --git a/Control/StoreGate/src/SGHiveMgrSvc.cxx b/Control/StoreGate/src/SGHiveMgrSvc.cxx index 756c1c9d43e2fc60851ed7b983082953bde6cefc..2accce685b8e9998b7ad7992687c6d43ced353b2 100644 --- a/Control/StoreGate/src/SGHiveMgrSvc.cxx +++ b/Control/StoreGate/src/SGHiveMgrSvc.cxx @@ -3,6 +3,7 @@ */ #include "GaudiKernel/IIncidentSvc.h" +#include "GaudiKernel/ConcurrencyFlags.h" #include "AthenaKernel/CloneService.h" #include "AthenaKernel/errorcheck.h" #include "AthenaKernel/StoreID.h" @@ -66,6 +67,7 @@ StatusCode HiveMgrSvc::setNumberOfStores(size_t slots) { m_slots.resize(slots); m_nSlots = slots; m_freeSlots.store(slots); + Gaudi::Concurrency::ConcurrencyFlags::setNumConcEvents( slots ); return StatusCode::SUCCESS; } } @@ -217,6 +219,8 @@ StatusCode HiveMgrSvc::initialize() { } m_freeSlots.store( m_nSlots ); + Gaudi::Concurrency::ConcurrencyFlags::setNumConcEvents( m_nSlots ); + return selectStore(0); } diff --git a/DataQuality/DataQualityConfigurations/config/HLT/HLTOfflineShift/heavyions_run.config b/DataQuality/DataQualityConfigurations/config/HLT/HLTOfflineShift/heavyions_run.config index c3155f7d675aad9b43af03ed3c0c2cdcf42ade4d..a9060d89ae6e2528bf08f20295b145613370f0c7 100644 --- a/DataQuality/DataQualityConfigurations/config/HLT/HLTOfflineShift/heavyions_run.config +++ b/DataQuality/DataQualityConfigurations/config/HLT/HLTOfflineShift/heavyions_run.config @@ -6,79 +6,20 @@ # HLT Offline Shifter ####################### +#REMOVED as obsolete +#Just kept algorithms + ####################### # Output ####################### -output top_level { - - output HLT { - output OfflineShifter { - output Et-Pt-Spectra { - output BPhys { - } -## output Egamma { -## } - output Jets { - output a4ionemsubjesFS { - } - output j30_ion_L1TE50 { - } - output j50_ion_L1J10 { - } - output j100_ion_L1TE50 { - } - } - output Muons { - } - } - output Eta-Phi-Maps { - output BPhys { - } - output Jets { - output a4ionemsubjesFS { - } - output j30_ion_L1TE50 { - } - output j50_ion_L1J10 { - } - output j100_ion_L1TE50 { - } - } -## output MET { -## } - output Muons { - } -## output Egamma { -## } - } - output InvariantMasses { - } -## output Misc { -## output Bjet { -## } -## output InDet { -## } -## output Muons { -## } -## output MET { -## } -## output Egamma { -## } -## output MinBias { -## } -## } - output Multiplicities { -## output Bjet { -## } - output Jets { - } - output Muons { - } - } - } - } -} +#output top_level { +# +# output HLT { +# output OfflineShifter { +# } +# } +#} ####################### @@ -86,615 +27,6 @@ output top_level { ####################### -####################### -## Eta-Phi-Maps -####################### - -dir HLT { - - dir BphysMon { - dir shifter { - dir BMuMu { - hist TrigBphys_BMuMu_eta@Shifter { - algorithm = HLT_Histogram_Not_Empty_with_Ref&GatherData -## algorithm = HLT_PassInput - output = HLT/OfflineShifter/Eta-Phi-Maps/BPhys - description = Pseudorapidity of J/psi, the histogram is filled from a particular HLT_2muX_bDimu chain - } - } - } - } - -## dir EgammaSigTE { -## dir OfflineElectron { -## hist egEtaPhiMap@ElectronShifter { -#### algorithm = HLT_PassInput -## algorithm = HLT_Histogram_Not_Empty_with_Ref&GatherData -## output = HLT/OfflineShifter/Eta-Phi-Maps/Egamma -## description = Histogram should not be empty. If it is, contact the egamma expert-on-call. -## } -## } -## dir OfflinePhoton { -## hist egEtaPhiMap@PhotonShifter { -#### algorithm = HLT_PassInput -## algorithm = HLT_Histogram_Not_Empty_with_Ref&GatherData -## output = HLT/OfflineShifter/Eta-Phi-Maps/Egamma -## description = Histogram should not be empty. If it is, contact the egamma expert-on-call. -## } -## } -## } - - dir JetMon { - dir HLT { - dir a4ionemsubjesFS { - hist HLTJet_phi_vs_eta@a4ionemsubjesFSShifter { - algorithm = HLTjet_Bins_Diff_FromAvg - output = HLT/OfflineShifter/Eta-Phi-Maps/Jets/a4ionemsubjesFS - description = Eta vs Phi plot: this distribution should not show hotspots. Red means: at least one bin is at least 40 sigma above average. Check that there is sufficient statistics to claim a hotspot. - } - } - dir j30_ion_L1TE50 { - hist HLTJet_phi_vs_eta@j30_ion_L1TE50Shifter { - algorithm = HLTjet_Bins_Diff_FromAvg - output = HLT/OfflineShifter/Eta-Phi-Maps/Jets/j30_ion_L1TE50 - description = Eta vs Phi plot: this distribution should not show hotspots. Red means: at least one bin is at least 40 sigma above average. Check that there is sufficient statistics to claim a hotspot. - } - } - dir j50_ion_L1J10 { - hist HLTJet_phi_vs_eta@j50_ion_L1J10Shifter { - algorithm = HLTjet_Bins_Diff_FromAvg - output = HLT/OfflineShifter/Eta-Phi-Maps/Jets/j50_ion_L1J10 - description = Eta vs Phi plot: this distribution should not show hotspots. Red means: at least one bin is at least 40 sigma above average. Check that there is sufficient statistics to claim a hotspot. - } - } - dir j100_ion_L1TE50 { - hist HLTJet_phi_vs_eta@j100_ion_L1TE50Shifter { - algorithm = HLTjet_Bins_Diff_FromAvg - output = HLT/OfflineShifter/Eta-Phi-Maps/Jets/j100_ion_L1TE50 - description = Eta vs Phi plot: this distribution should not show hotspots. Red means: at least one bin is at least 40 sigma above average. Check that there is sufficient statistics to claim a hotspot. - } - } - -## dir a10tcemsubFS { -## hist HLTJet_phi_vs_eta@a10tcemsubFSShifter { -## algorithm = HLT_Histogram_Not_Empty_with_Ref&GatherData -#### algorithm = HLT_PassInput -## output = HLT/OfflineShifter/Eta-Phi-Maps/Jets -## description = Particular attention should be paid in checking hot regions. The distribution should not show peaks. -## } -## } -## dir a4tcemjesFS { -## hist HLTJet_phi_vs_eta@a4tcemjesFSShifter { -## algorithm = HLT_Histogram_Not_Empty_with_Ref&GatherData -#### algorithm = HLT_PassInput -## output = HLT/OfflineShifter/Eta-Phi-Maps/Jets -## description = Particular attention should be paid in checking hot regions. The distribution should not show peaks. -## } -## } -## dir a4tcemjesPS { -## hist HLTJet_phi_vs_eta@a4tcemjesPSShifter { -## algorithm = HLT_Histogram_Not_Empty_with_Ref&GatherData -#### algorithm = HLT_PassInput -## output = HLT/OfflineShifter/Eta-Phi-Maps/Jets -## description = Particular attention should be paid in checking hot regions. The distribution should not show peaks. -## } -## } -## dir a4tcemsubFS { -## hist HLTJet_phi_vs_eta@a4tcemsubFSShifter { -## algorithm = HLT_Histogram_Not_Empty_with_Ref&GatherData -#### algorithm = HLT_PassInput -## output = HLT/OfflineShifter/Eta-Phi-Maps/Jets -## description = Particular attention should be paid in checking hot regions. The distribution should not show peaks. -## } -#### } -## dir a4tcemsubjesFS { -## hist HLTJet_phi_vs_eta@a4tcemsubjesFSShifter { -## algorithm = HLT_Histogram_Not_Empty_with_Ref&GatherData -#### algorithm = HLT_PassInput -## output = HLT/OfflineShifter/Eta-Phi-Maps/Jets -## description = Particular attention should be paid in checking hot regions. The distribution should not show peaks. -## } -## } -## dir a4tclcwjesFS { -## hist HLTJet_phi_vs_eta@a4tclcwjesFSShifter { -## algorithm = HLT_Histogram_Not_Empty_with_Ref&GatherData -#### algorithm = HLT_PassInput -## output = HLT/OfflineShifter/Eta-Phi-Maps/Jets -## description = Particular attention should be paid in checking hot regions. The distribution should not show peaks. -## } -## } -## dir j25 { -## hist HLTJet_phi_vs_eta@j25Shifter { -## algorithm = HLT_Histogram_Not_Empty_with_Ref&GatherData -#### algorithm = HLT_PassInput -## output = HLT/OfflineShifter/Eta-Phi-Maps/Jets/j25 -## description = Particular attention should be paid in checking hot regions. The distribution should not show peaks. -## } -## } -## dir j60 { -## hist HLTJet_phi_vs_eta@j60Shifter { -## algorithm = HLT_Histogram_Not_Empty_with_Ref&GatherData -#### algorithm = HLT_PassInput -## output = HLT/OfflineShifter/Eta-Phi-Maps/Jets/j60 -## description = Particular attention should be paid in checking hot regions. The distribution should not show peaks. -## } -## } - } -## dir OF { -## dir AntiKt10LCTopoJets { -## hist OFJet_phi_vs_eta@AntiKt10LCTopoJetsShifter { -## algorithm = HLT_Histogram_Not_Empty_with_Ref&GatherData -## output = HLT/OfflineShifter/Eta-Phi-Maps/Jets -## description = Particular attention should be paid in checking hot regions. The distribution should not show peaks. -## } -## } -## dir AntiKt4EMTopoJets { -## hist OFJet_phi_vs_eta@AntiKt4EMTopoJetsShifter { -## algorithm = HLT_Histogram_Not_Empty_with_Ref&GatherData -## output = HLT/OfflineShifter/Eta-Phi-Maps/Jets -## description = Particular attention should be paid in checking hot regions. The distribution should not show peaks. -## } -## } -## dir AntiKt4LCTopoJets { -## hist OFJet_phi_vs_eta@AntiKt4LCTopoJetsShifter { -## algorithm = HLT_Histogram_Not_Empty_with_Ref&GatherData -## output = HLT/OfflineShifter/Eta-Phi-Maps/Jets -## description = Particular attention should be paid in checking hot regions. The distribution should not show peaks. -## } -## } -## } - } ## end dir JetMon - - -## dir METMon { -## dir Shifter { -## dir HLT { -## hist HLT_MET_etaphi@Shifter { -## algorithm = HLT_Histogram_Not_Empty_with_Ref&GatherData -#### algorithm = HLT_PassInput -## output = HLT/OfflineShifter/Eta-Phi-Maps/MET -## description = Particular attention should be paid in checking hot regions. The distribution should not show peaks. -## } -## hist HLT_MET_etaphi_etweight@Shifter { -## algorithm = HLT_Histogram_Not_Empty_with_Ref&GatherData -#### algorithm = HLT_PassInput -## output = HLT/OfflineShifter/Eta-Phi-Maps/MET -## description = Particular attention should be paid in checking hot regions. When HLT_MET_etaphi show peaks, this plot is a good check if the peaks are problematic or not. If this plot has no peak, it means the peaks in HLT_MET_etaphi are from low energy hot sopts and has no real harm. When HLT_MET_etaphi does not have peaks, it is all right even if this plot show peaks because those peaks are due to a few very high pt jets. -## } -## } -## } -## } - - dir MuonMon { - dir muComb { - hist muComb_eta_vs_phi@Shifter { - description = The L2muonCB eta-phi map. There should be no hole. -## algorithm = HLT_Histogram_Not_Empty_with_Ref&GatherData -## algorithm = HLT_PassInput - algorithm = alg_eta_vs_phi - output = HLT/OfflineShifter/Eta-Phi-Maps/Muons - } - } - dir muFast { - hist muFast_eta_vs_phi@Shifter { - description = The L2muonSA eta-phi map. There should not be additional hole other than those in HLT/TRMUO/Shift/Etaphi. -## algorithm = HLT_Histogram_Not_Empty_with_Ref&GatherData -## algorithm = HLT_PassInput - algorithm = alg_eta_vs_phi - output = HLT/OfflineShifter/Eta-Phi-Maps/Muons - } - } - dir MuonEF { - hist EFCB_eta_vs_phi@Shifter { - description = The EFCB eta-phi map. There should be no hole. -## algorithm = HLT_Histogram_Not_Empty_with_Ref&GatherData -## algorithm = HLT_PassInput - algorithm = alg_eta_vs_phi - output = HLT/OfflineShifter/Eta-Phi-Maps/Muons - } - } - } - - - - -#################### -## Et-Pt-Spectra -#################### - - dir BphysMon { - dir shifter { - dir Containers { - dir HLT_xAOD__TrigBphysContainer_EFBMuMuFex { - hist TrigBphys_HLT_xAOD__TrigBphysContainer_EFBMuMuFex_pTsum@Shifter { - algorithm = HLT_Histogram_Not_Empty_with_Ref&GatherData -## algorithm = HLT_PassInput - output = HLT/OfflineShifter/Et-Pt-Spectra/BPhys - description = Sum of J/psi muons pT from the EF container. May be slightly different from reference due to different menu (the container is used for a few chains at once) - } - } -## dir HLT_xAOD__TrigBphysContainer_L2BMuMuFex { -## hist TrigBphys_HLT_xAOD__TrigBphysContainer_L2BMuMuFex_pTsum@Shifter { -## algorithm = HLT_Histogram_Not_Empty_with_Ref&GatherData -#### algorithm = HLT_PassInput -## output = HLT/OfflineShifter/Et-Pt-Spectra/BPhys -## description = Sum of J/psi muons pT from the L2 container. May be slightly different from reference due to different menu (the container is used for a few chains at once) -## } -## } - } - dir BMuMu { - hist TrigBphys_BMuMu_pTsum@Shifter { - algorithm = HLT_Histogram_Not_Empty_with_Ref&GatherData -## algorithm = HLT_PassInput - output = HLT/OfflineShifter/Et-Pt-Spectra/BPhys - description = Sum of J/psi muons pT, the histogram is filled from a particular HLT_2muX_bDimu chain - } -## hist TrigBphys_BMuMu_eta@Shifter { -## algorithm = HLT_Histogram_Not_Empty_with_Ref&GatherData -#### algorithm = HLT_PassInput -## output = HLT/OfflineShifter/Et-Pt-Spectra/BPhys -## description = Pseudorapidity of J/psi, the histogram is filled from a particular HLT_2muX_bDimu chain -## } - } - } - } - - -## dir EgammaSigTE { -## dir OfflineElectron { -## hist egEt@ShifterElectron { -## algorithm = HLT_Histogram_Not_Empty_with_Ref&GatherData -#### algorithm = HLT_PassInput -## output = HLT/OfflineShifter/Et-Pt-Spectra/Egamma -## description = Histogram should not be empty. If so, contact the egamma expert-on-call. -## } -## } -## dir OfflinePhoton { -## hist egEt@ShifterPhoton { -## algorithm = HLT_Histogram_Not_Empty_with_Ref&GatherData -## output = HLT/OfflineShifter/Et-Pt-Spectra/Egamma -## description = Histogram should not be empty. If so, contact the egamma expert-on-call. -## } -## } -## } - - - dir JetMon { - dir HLT { - dir a4ionemsubjesFS { - hist HLTJet_Et@a4ionemsubjesFSShifter { - display = LogY - algorithm = HLTjet_KolmogorovTest_MaxDist - output = HLT/OfflineShifter/Et-Pt-Spectra/Jets/a4ionemsubjesFS - description = Red means: mean of the histogram different from reference. Et plot: This plot should be close to the reference. Red can be due to: [1] The histogram threshold is not the same as HLT threshold. [2] Slope of the histogram significantly different from reference. [3] Strange shape, i.e. bumps at high Et. - } - } - dir j30_ion_L1TE50 { - hist HLTJet_Et@j30_ion_L1TE50Shifter { - display = LogY - algorithm = HLTjet_KolmogorovTest_MaxDist - output = HLT/OfflineShifter/Et-Pt-Spectra/Jets/j30_ion_L1TE50 - description = Red means: mean of the histogram different from reference. Et plot: This plot should be close to the reference. Red can be due to: [1] The histogram threshold is not the same as HLT threshold. [2] Slope of the histogram significantly different from reference. [3] Strange shape, i.e. bumps at high Et. - } - } - dir j50_ion_L1J10 { - hist HLTJet_Et@j50_ion_L1J10Shifter { - display = LogY - algorithm = HLTjet_KolmogorovTest_MaxDist - output = HLT/OfflineShifter/Et-Pt-Spectra/Jets/j50_ion_L1J10 - description = Red means: mean of the histogram different from reference. Et plot: This plot should be close to the reference. Red can be due to: [1] The histogram threshold is not the same as HLT threshold. [2] Slope of the histogram significantly different from reference. [3] Strange shape, i.e. bumps at high Et. - } - } - dir j100_ion_L1TE50 { - hist HLTJet_Et@j100_ion_L1TE50Shifter { - display = LogY - algorithm = HLTjet_KolmogorovTest_MaxDist - output = HLT/OfflineShifter/Et-Pt-Spectra/Jets/j100_ion_L1TE50 - description = Red means: mean of the histogram different from reference. Et plot: This plot should be close to the reference. Red can be due to: [1] The histogram threshold is not the same as HLT threshold. [2] Slope of the histogram significantly different from reference. [3] Strange shape, i.e. bumps at high Et. - } - } - -## dir a10tcemsubFS { -## hist HLTJet_HighEt@a10tcemsubFSShifter { -## display = LogY -## algorithm = HLT_Histogram_Not_Empty_with_Ref&GatherData -#### algorithm = HLT_PassInput -## output = HLT/OfflineShifter/Et-Pt-Spectra/Jets -## description = The distribution should not be broad. Check with reference when available. -## } -## } -## dir a4tcemjesFS { -## hist HLTJet_HighEt@a4tcemjesFSShifter { -## display = LogY -## algorithm = HLT_Histogram_Not_Empty_with_Ref&GatherData -#### algorithm = HLT_PassInput -## output = HLT/OfflineShifter/Et-Pt-Spectra/Jets -## description = The distribution should not be broad. Check with reference when available. -## } -## } -## dir a4tcemjesPS { -## hist HLTJet_HighEt@a4tcemjesPSShifter { -## display = LogY -## algorithm = HLT_Histogram_Not_Empty_with_Ref&GatherData -#### algorithm = HLT_PassInput -## output = HLT/OfflineShifter/Et-Pt-Spectra/Jets -## description = The distribution should not be broad. Check with reference when available. -## } -## } -## dir a4tcemsubFS { -## hist HLTJet_HighEt@a4tcemsubFSShifter { -## display = LogY -## algorithm = HLT_Histogram_Not_Empty_with_Ref&GatherData -## algorithm = HLT_PassInput -## output = HLT/OfflineShifter/Et-Pt-Spectra/Jets -## description = The distribution should not be broad. Check with reference when available. -## } -## } -## dir a4tcemsubjesFS { -## hist HLTJet_HighEt@a4tcemsubjesFSShifter { -## display = LogY -## algorithm = HLT_Histogram_Not_Empty_with_Ref&GatherData -#### algorithm = HLT_PassInput -## output = HLT/OfflineShifter/Et-Pt-Spectra/Jets -## description = The distribution should not be broad. Check with reference when available. -## } -## } -## dir a4tclcwjesFS { -## hist HLTJet_HighEt@a4tclcwjesFSShifter { -## display = LogY -## algorithm = HLT_Histogram_Not_Empty_with_Ref&GatherData -#### algorithm = HLT_PassInput -## output = HLT/OfflineShifter/Et-Pt-Spectra/Jets -## description = The distribution should not be broad. Check with reference when available. -## } -## } -## dir j25 { -## hist HLTJet_HighEt@j25Shifter { -## display = LogY -## algorithm = HLT_Histogram_Not_Empty_with_Ref&GatherData -#### algorithm = HLT_PassInput -## output = HLT/OfflineShifter/Et-Pt-Spectra/Jets/j25 -## description = The distribution should not be broad. Check with reference when available. -## } -## } -## dir j60 { -## hist HLTJet_HighEt@j60Shifter { -## display = LogY -## algorithm = HLT_Histogram_Not_Empty_with_Ref&GatherData -#### algorithm = HLT_PassInput -## output = HLT/OfflineShifter/Et-Pt-Spectra/Jets/j60 -## description = The distribution should not be broad. Check with reference when available. -## } -## } - } ## end dir HLT - - -## dir OF { -## dir AntiKt10LCTopoJets { -## hist OFJet_HighEt@AntiKt10LCTopoJetsShifter { -## display = LogY -## algorithm = HLT_Histogram_Not_Empty_with_Ref&GatherData -## output = HLT/OfflineShifter/Et-Pt-Spectra/Jets -## description = The distribution should not be broad. Check with reference when available. -## } -## } -## dir AntiKt4EMTopoJets { -## hist OFJet_HighEt@AntiKt4EMTopoJetsShifter { -## display = LogY -## algorithm = HLT_Histogram_Not_Empty_with_Ref&GatherData -## output = HLT/OfflineShifter/Et-Pt-Spectra/Jets -## description = The distribution should not be broad. Check with reference when available. -## } -## } -## dir AntiKt4LCTopoJets { -## hist OFJet_HighEt@AntiKt4LCTopoJetsShifter { -## display = LogY -## algorithm = HLT_Histogram_Not_Empty_with_Ref&GatherData -## output = HLT/OfflineShifter/Et-Pt-Spectra/Jets -## description = The distribution should not be broad. Check with reference when available. -## } -## } -## } - } ##end dir JetMon - - dir MuonMon { - dir muComb { - hist muComb_pt@Shifter { - description = L2muonCB muon pt distribution. Check with reference when available. -## algorithm = HLT_Histogram_Not_Empty_with_Ref&GatherData -## algorithm = HLT_PassInput - algorithm = TRMUO_GatherData - output = HLT/OfflineShifter/Et-Pt-Spectra/Muons - } - } - dir muFast { - hist muFast_pt@Shifter { - description = L2muonSA muon pt distribution. Check with reference when available. There might be a spike at 100 GeV, which is the overflow and not a problem. -## algorithm = HLT_PassInput -## algorithm = HLT_Histogram_Not_Empty_with_Ref&GatherData - algorithm = TRMUO_GatherData - output = HLT/OfflineShifter/Et-Pt-Spectra/Muons - } - } - dir MuonEF { - hist EFCB_pt@Shifter { - description = EFCB muon pt distribution. Check with reference when available. -## algorithm = HLT_PassInput -## algorithm = HLT_Histogram_Not_Empty_with_Ref&GatherData - algorithm = TRMUO_GatherData - output = HLT/OfflineShifter/Et-Pt-Spectra/Muons - } - } - } - - - -##################### -## InvariantMasses -##################### - - dir BphysMon { - dir shifter { - dir Containers { - dir HLT_xAOD__TrigBphysContainer_EFBMuMuFex { - hist TrigBphys_HLT_xAOD__TrigBphysContainer_EFBMuMuFex_mass@Shifter { - algorithm = HLT_Histogram_Not_Empty_with_Ref&GatherData -## algorithm = HLT_PassInput - output = HLT/OfflineShifter/InvariantMasses - description = Dimuon invariant mass, the histogram is filled from the EF container which is used for a few chains at once - } - } -## dir HLT_xAOD__TrigBphysContainer_L2BMuMuFex { -## hist TrigBphys_HLT_xAOD__TrigBphysContainer_L2BMuMuFex_mass@Shifter { -## algorithm = HLT_Histogram_Not_Empty_with_Ref&GatherData -#### algorithm = HLT_PassInput -## output = HLT/OfflineShifter/InvariantMasses -## description = Dimuon invariant mass, the histogram is filled from the L2 container which is used for a few chains at once -## } -## } - } - dir BMuMu { - hist TrigBphys_BMuMu_mass@Shifter { - algorithm = HLT_Histogram_Not_Empty_with_Ref&GatherData -## algorithm = HLT_PassInput - output = HLT/OfflineShifter/InvariantMasses - description = Dimuon invariant mass, the histogram is filled from a particular HLT_2muX_bDimu chain. Normally J/psi and Upsilon mass peaks should be seen - } - } - } - } - -#################### -## Misc -#################### - - -## dir METMon { -## dir Shifter { -## dir HLT { -## hist HLT_MET@Shifter { -## algorithm = HLT_Histogram_Not_Empty_with_Ref&GatherData -## output = HLT/OfflineShifter/Misc/MET -## description = Normal: No spikes, with a single peak structure at low MET and a falling distribution. Abnormal: Spike in MET, shifter should contact expert-on-call. -## } -## hist HLT_MEx@Shifter { -## algorithm = HLT_Histogram_Not_Empty_with_Ref&GatherData -## output = HLT/OfflineShifter/Misc/MET -## description = Normal: No spikes, with a single peak structure at 0. Abnormal: Spike other than the central peak, shifter should contact expert-on-call. -## } -## hist HLT_MEy@Shifter { -## algorithm = HLT_Histogram_Not_Empty_with_Ref&GatherData -## output = HLT/OfflineShifter/Misc/MET -## description = Normal: No spikes, with a single peak structure at 0. Abnormal: Spike other than the central peak, shifter should contact expert-on-call. -## } -## hist HLT_SumEt@Shifter { -## algorithm = HLT_Histogram_Not_Empty_with_Ref&GatherData -## output = HLT/OfflineShifter/Misc/MET -## description = Normal: No spikes, with a single peak structure at low SumEt and a falling distribution. Abnormal: Spike in MET, shifter should contact expert-on-call. -## } -## hist Eff_HLT_xe80@Shifter { -## algorithm = HLT_Histogram_Not_Empty_with_Ref&GatherData -#### algorithm = HLT_PassInput -## output = HLT/OfflineShifter/Misc/MET -## description = Normal: Near zero in lower MEt and a quick rise to 1.0 then flat at 1.0 in higher MEt. Abnormal: The rise does not reach 1.0 or go beyond 1.0, or the high MEt region is not flat, shifter should contact expert-on-call. -## } -## } -## } -## dir Expert { -## dir HLT { -## hist HLT_MET_status@Shifter { -## display = TCanvas(1050,500),LogY -## algorithm = HLTmet_AlgErrorBits -## output = HLT/OfflineShifter/Misc/MET -## description = Normal: GlobalError bin is empty (not filled). Abnormal But Not Critical: 1. Bytestream conversion errors in some components (TileBar, Gap1,2,3, Ext1,2). 2. BadCellQuality in one or more components. Abnormal and Critical: Global Error bit is set "GlobError" or Missing Components - Cross check with compN_EF_MET_status@Shifter (in this folder). -## } -## hist HLT_MET_lin1@Shifter { -## display = <AxisRange(0,100,"X")>,LogY -#### algorithm = HLT_PassInput -## algorithm = HLT_Histogram_Not_Empty_with_Ref&GatherData -## output = HLT/OfflineShifter/Misc/MET -## description = Normal: No spikes, with a single dip structure and a falling distribution. Abnormal: Spike in EF_MET at low (< 10 GeV) MET shifter should contact expert-on-call. -## } -## hist compN_compEt_lin@Shifter { -## display = TCanvas(1050,500) -## algorithm = HLT_PassInput -#### algorithm = HLT_Histogram_Not_Empty_with_Ref&GatherData -## output = HLT/OfflineShifter/Misc/MET -## description = Normal: All components (X bins) are filled. Abnormal: One or more components are empty. -## } -## hist compN_HLT_MET_status@Shifter { -## display = TCanvas(1050,500),LogZ -## algorithm = HLT_PassInput -#### algorithm = HLT_Histogram_Not_Empty_with_Ref&GatherData -## output = HLT/OfflineShifter/Misc/MET -## description = Normal: "Processed" Bit must always be set (and filled). Abnormal But Not Critical: 1. Bytestream conversion errors in some components (TileBar, Gap1,2,3, Ext1,2); 2. BadCellQuality in one or more components. Abnormal and Critical: Global Error bit is set "GlobError" or Missing components or Error in one or more components "CompError". -## } -## } -## } -## } - -## dir MinBiasMon { -## dir IDMinbias { -## dir mb_sptrk { -## hist PixTot@OfflineShifter { -## output = HLT/OfflineShifter/Misc/MinBias -#### algorithm = HLT_Histogram_Not_Empty_with_Ref&GatherData -## algorithm = HLT_PassInput -## description = TODO -## } -## hist SctTot@IffkubeShifter { -## output = HLT/OfflineShifter/Misc/MinBias -#### algorithm = HLT_Histogram_Not_Empty_with_Ref&GatherData -## algorithm = HLT_PassInput -## description = TODO -## } -## } -## } -## dir MBTS { -## dir mb_mbts_L1MBTS_2 { -## hist Occupancy@OfflineShifter { -## output = HLT/OfflineShifter/Misc/MinBias -#### algorithm = HLT_Histogram_Not_Empty_with_Ref&GatherData -## algorithm = HLT_PassInput -## description = TODO -## } -## } -## } -## } - - -################# -## Multiplicity -################# - - - - dir JetMon { - dir HLT { - dir a4ionemsubjesFS { - hist HLTJet_n@a4ionemsubjesFSShifter { - display = LogY - algorithm = HLTjet_KolmogorovTest_MaxDist - output = HLT/OfflineShifter/Multiplicities/Jets - description = Red means: mean of the histogram different from reference. NJet plot: this plot should be close to the reference. Red can be due to: [1] Low statistics wrt reference. [2] Current bunch spacing different from reference. [3] Strange shape. i.e. bumps at high multiplicity. - } - } - } ## end dir HLT - } ## end dir JetMon - - dir MuonMon { - dir Common { - hist Offline_Number_Of_Muon { - description = Check with the reference when available. -## algorithm = HLT_Histogram_Not_Empty_with_Ref&GatherData - algorithm = HLT_Histogram_Not_Empty_with_Ref&GatherData - output = HLT/OfflineShifter/Multiplicities/Muons - } - } - } -} - - ############## # Algorithms @@ -731,13 +63,6 @@ algorithm ShifterFermiFit100_mu18_IDTrkNoCut_tight_pT_EF_eff { MinStat = 1000 } -##algorithm ShifterFermiFit100_tau125_IDTrkNoCut_pT_L2S_B_eff { -## libname = libdqm_algorithms.so -## name = Simple_fermi_Fit -## thresholds = ShifterThreshold100_tau125_IDTrkNoCut_pT_L2S_B_eff -## MinStat = 300 -##} - # mu22 Shifter algorithm TRMUO_fermi_fit_mu22_ESid_muFast_upstream_Fit { @@ -773,7 +98,6 @@ algorithm TRMUO_fermi_fit_mu22_ESid_MuGirlEF_upstream_Fit { ImproveFit = 1.0 } -## EBK added algorithm algorithm HLT_All_Bins_Filled { libname = libdqm_algorithms.so name = All_Bins_Filled @@ -788,10 +112,6 @@ thresholds ShifterThreshold { warning = 0.90 error = 0.65 } -# limits Threshold { -# } -# limits Resolution { -# } } thresholds ShifterThresholdOff { @@ -808,13 +128,6 @@ thresholds ShifterThreshold100 { } } -##thresholds ShifterThreshold100_tau125_IDTrkNoCut_pT_L2S_B_eff { -## limits Plateau { -## warning = 85.0 -## error = 65.0 -## } -##} - #for Shift mu22 @@ -883,37 +196,4 @@ thresholds th_TRMUO_fermi_fit_mu22_ESid_MuGirlEF_upstream { } -############ REMOVE before submitting!!! (Just added while HLTjet is masked ############# - -##algorithm HLTjet_KolmogorovTest_MaxDist { -## libname = libdqm_algorithms.so -## name = KolmogorovTest_MaxDist -## thresholds = HLTjet_KolmogorovThresh -## MinStat = 100 -## reference = CentrallyManagedReferences -##} -## -##algorithm HLTjet_Bins_Diff_FromAvg { -## libname = libdqm_algorithms.so -## name = Bins_Diff_FromAvg -## thresholds = HLTjet_NBinsThresh -## MinStat = 100 -## ignoreval = 0 -## GreaterThan = 1 -## LessThan = 0 -## NSigma = 40 -## reference = CentrallyManagedReferences -##} -## -##thresholds HLTjet_KolmogorovThresh { -## limits MaxDist { -## warning = 0.05 -## error = 0.15 -## } -##} -## -##thresholds HLTjet_NBinsThresh { -## limits NBins { -## error = 1 -## } -##} + diff --git a/DataQuality/DataQualityConfigurations/config/TRT/collisions_run.config b/DataQuality/DataQualityConfigurations/config/TRT/collisions_run.config index 552993d5eac547746d1a5cad8640d61dc3c5a860..71bfb76254750f1a8a6b93cb7eedd76fa6833472 100644 --- a/DataQuality/DataQualityConfigurations/config/TRT/collisions_run.config +++ b/DataQuality/DataQualityConfigurations/config/TRT/collisions_run.config @@ -122,7 +122,7 @@ dir TRT { output = InnerDetector/TRT/_Expert } hist hHLhitOnTrack { - algorithm = TRT_SideBand_Relative/HLhitOnTrack + algorithm = KolmogorovTest_HLhitOnTrack output = InnerDetector/TRT/TRTB display = Draw=HIST } @@ -300,7 +300,7 @@ dir TRT { output = InnerDetector/TRT/_Expert } hist hHLhitOnTrack_A { - algorithm = TRT_SideBand_Relative/HLhitOnTrack + algorithm = KolmogorovTest_HLhitOnTrack output = InnerDetector/TRT/TRTEA display = Draw=HIST } @@ -456,7 +456,7 @@ dir TRT { output = InnerDetector/TRT/_Expert } hist hHLhitOnTrack_C { - algorithm = TRT_SideBand_Relative/HLhitOnTrack + algorithm = KolmogorovTest_HLhitOnTrack output = InnerDetector/TRT/TRTEC display = Draw=HIST } @@ -868,13 +868,15 @@ algorithm TRT_OutlierAndFlatnessTest { MinStat = 1 Ignore0 = 0 FitCircular = 1 - + StoreOutlierBins = 1 + algorithm AvgHLOcc { reference = stream=physics_Main:CentrallyManagedReferences_Main;CentrallyManagedReferences thresholds = TRT_OutlierAndFlatnessTest/AvgHLOcc CheckSigmaDev = 0 CheckRelDev = 1 - RelDev = 0.02 + RelDev = 0.03 + DivideByReference = 1 } algorithm AvgLLOcc { reference = stream=physics_Main:CentrallyManagedReferences_Main;CentrallyManagedReferences @@ -905,7 +907,7 @@ algorithm TRT_OutlierAndFlatnessTest { thresholds = TRT_OutlierAndFlatnessTest/NumTrksDetPhi CheckSigmaDev = 0 CheckRelDev = 1 - RelDev = 0.02 + RelDev = 0.05 DivideByReference = 1 } algorithm EvtPhaseDetPhi { @@ -1003,6 +1005,13 @@ algorithm TRT_BinContentDump { name = BinContentDump } +algorithm KolmogorovTest_HLhitOnTrack { + libname = libdqm_algorithms.so + name = KolmogorovTest_MaxDist + thresholds = Kolmogorov_HLhTr + reference = stream=physics_Main:CentrallyManagedReferences_Main;CentrallyManagedReferences +} + algorithm TRT_GatherData { libname = libdqm_algorithms.so name = GatherData @@ -1028,11 +1037,18 @@ algorithm TRT_Bins_GreaterThan_Threshold { # Thresholds ############################################################ +thresholds Kolmogorov_HLhTr { + limits MaxDist { + warning = 0.05 + error = 0.1 + } +} + thresholds TRT_OutlierAndFlatnessTest { thresholds AvgHLOcc { limits Number_of_outlier_bins { warning = 0 - error = 1 + error = 3 } limits Max_rel_sym_deviation { warning = 0.05 diff --git a/DataQuality/DataQualityTools/share/DataQualityMon_All_jobOptions.py b/DataQuality/DataQualityTools/share/DataQualityMon_All_jobOptions.py deleted file mode 100644 index 9b63f1c9fdd6a220c43822d22c34b9111ca34e95..0000000000000000000000000000000000000000 --- a/DataQuality/DataQualityTools/share/DataQualityMon_All_jobOptions.py +++ /dev/null @@ -1,131 +0,0 @@ -# **************************************** -# Application configuration for monitoring -# **************************************** - -doAlign=True -doMet=True -doJet=True -doEgamma=True -doPixel=False -doTile=False - - - -## get a handle on the top sequence of algorithms -from AthenaCommon.AlgSequence import AlgSequence -topSequence = AlgSequence() - -## add an AthenaMonManager algorithm to the list of algorithms to be ran -from AthenaMonitoring.AthenaMonitoringConf import AthenaMonManager -topSequence += AthenaMonManager( "PrimaryManager" ) - -from AthenaCommon.AppMgr import ServiceMgr as svcMgr -svcMgr.MessageSvc.OutputLevel = OutputLevel - -svcMgr.MessageSvc.OutputLevel = WARNING - -# ************************ -# Monitoring configuration -# ************************ - -if not hasattr(svcMgr, 'THistSvc'): - from GaudiSvc.GaudiSvcConf import THistSvc - ServiceMgr += THistSvc() - -## Setup the output file(s): -THistSvc = Service( "THistSvc" ) - -## The string "TestMon" in the argument below is the 'FileKey' -## used by Athena to access the output file internally -THistSvc.Output += ["MonHist DATAFILE='Monitor.root' OPT='RECREATE'"] - - -from TrkExTools.AtlasExtrapolator import AtlasExtrapolator -AtlasExtrapolator = AtlasExtrapolator() -ToolSvc += AtlasExtrapolator - -from AthenaCommon.AppMgr import ToolSvc as toolSvc - -## AthenaMonManager is the Algorithm that manages many classes inheriting -## from ManagedMonitorToolBase -monMan = Algorithm( "PrimaryManager" ) - -## FileKey must match that given to THistSvc -monMan.FileKey = "MonHist" - -## Set global monitoring parameters: see the AthenaMonManager class -## in the Control/AthenaMonitoring package -monMan.ManualDataTypeSetup = True -monMan.DataType = "userDefined" -monMan.Environment = "user" -monMan.ManualRunLBSetup = True -monMan.Run = 1 -monMan.LumiBlock = 1 - -#------------------# -# MET monitoring # -#------------------# -if (doMet): - monMan.AthenaMonTools += [ "METMonTool/METMonTool" ] - toolSvc.METMonTool.ProcessNEvents = 1000 - toolSvc.METMonTool.PreScale = 0 - toolSvc.METMonTool.jetColKey = "Cone4TowerJets" - -#------------------# -# Jet monitoring # -#------------------# -if (doJet): - include("DataQualityTools/JetMonitoring.py") - - -#-------------------# -# egamma monitoring # -#-------------------# -if (doEgamma): - monMan.AthenaMonTools += [ "egammaMonTool/egMonTool" ] -## set the monitored containers - toolSvc.egMonTool.ElectronContainer = "ElectronCollection" - toolSvc.egMonTool.PhotonContainer = "PhotonCollection" - toolSvc.egMonTool.EMTrackMatchContainer = "egDetailContainer" - toolSvc.egMonTool.EMShowerContainer = "egDetailContainer" - toolSvc.egMonTool.EMConvertContainer = "egDetailContainer" - -#----------------------# -# Alignment Monitoring # -#----------------------# -if (doAlign): - monMan.AthenaMonTools += [ "IDAlignMonGenericTracks"] - monMan.AthenaMonTools += [ "IDAlignMonZmumu"] - monMan.AthenaMonTools += [ "IDAlignMonEfficiencies"] - monMan.AthenaMonTools += [ "IDAlignMonTruthComparison"] - monMan.AthenaMonTools += [ "IDAlignMonResiduals"] - #monMan.AthenaMonTools += [ "IDAlignMonCosmics"] - #monMan.AthenaMonTools += [ "IDAlignMonElectrons"] - #monMan.AthenaMonTools += [ "IDAlignMonJpsiUpsilon"] - -if (doTile): - monMan.AthenaMonTools += [ "TileMonitoring" ] - -#------------------# -# pixel monitoring # -#------------------# -if (doPixel): -# monMan.AthenaMonTools += [ "PixelSpacePointsMon" ] - monMan.AthenaMonTools += [ "PixelRDOMon" ] - monMan.AthenaMonTools += [ "PixelClusterMon" ] - monMan.AthenaMonTools += [ "PixelTrackMon" ] - monMan.AthenaMonTools += [ "PixelTimingMon" ] -# toolSvc.PixelSpacePointsMon.Pixel_SpacePointContainerName = "PixelSpacePoints" - toolSvc.PixelRDOMon.RDOName = "PixelRDOs" - toolSvc.PixelRDOMon.doA = True - toolSvc.PixelRDOMon.doB = True - toolSvc.PixelRDOMon.doC = True - toolSvc.PixelClusterMon.Pixel_SiClusterContainerName = "PixelClusters" -# toolSvc.TrackTool.TrackName = "SCT_Cosmic_Tracks" - toolSvc.PixelTrackMon.TrackName = "Tracks" - toolSvc.PixelTimingMon.RDOName = "PixelRDOs" - toolSvc.PixelTimingMon.EvtMax = 15000 #number of events to show in the time profile - toolSvc.PixelTimingMon.TimeStep = 100 #number of events per bin - - - diff --git a/DataQuality/DataQualityTools/share/DataQualityMon_jobOptions.py b/DataQuality/DataQualityTools/share/DataQualityMon_jobOptions.py index ffa3aa481033162accfdcac55e566fa611d9652e..da955be17dfda7884556b23028bb66fdef4025b0 100644 --- a/DataQuality/DataQualityTools/share/DataQualityMon_jobOptions.py +++ b/DataQuality/DataQualityTools/share/DataQualityMon_jobOptions.py @@ -57,12 +57,6 @@ from AthenaCommon.JobProperties import jobproperties if not 'InDetKeys' in dir(): from InDetRecExample.InDetKeys import InDetKeys -#if (jobproperties.Beam.beamType()=="collisions"): -# IDTrkContNames = [ InDetKeys.UnslimmedTracks() ] -# -#else: -# IDTrkContNames = [ InDetKeys.TRTTracks() ] - IDTrkContNames = [ InDetKeys.Tracks() ] isCosmics=False @@ -73,44 +67,6 @@ if jobproperties.Beam.beamType()=='cosmics': isBeam=False if DQMonFlags.monManEnvironment != 'tier0ESD': - from TrkExTools.AtlasExtrapolator import AtlasExtrapolator - DefaultExtrapolator = AtlasExtrapolator() - ToolSvc += DefaultExtrapolator - - # Import Muon Trk Eff tool ---> Obsolete - #from DataQualityTools.DataQualityToolsConf import DQTMuTrkEff - #DQTMuTrkMon = DQTMuTrkEff(name = 'DQTMuTrkMon', - # doInDet = rec.doInDet(), - # doMuons = rec.doMuon(), - # doTile = rec.doTile(), - # doCalo = muonCombinedRecFlags.doCaloTrkMuId(), - # applyCaloCuts = True, - # caloCutOpen = 0.0, - # caloCutLow = 25.0, - # caloCutNormal = 50.0, - # trackName = IDTrkContNames, - # trackTag = ["indet" ], - # trackPostfix = ["" ], #eventually it can be "Up" "Low" - # mooreMuContainerNameVec = ["MooreTracks", "ConvertedMBoyTracks"], - # caloMuContainerNameVec = ["CaloESDMuonCollection"], - # tileMuContainerName = "TileCosmicMuonHT", - # setVertexLimit = True, - # maxD0 = 100.0, - # maxZ0 = 200.0, - # histoPathBase = "/GLOBAL/DQTEff", - # maxConeSize = 0.01, - # doRunCosmics = isCosmics, - # doRunBeam = isBeam, - # doOfflineHists = isOffline, - # doOnlineHists = isOnline - # ); - # - # - #DQTMuTrkMon.extrapolator = DefaultExtrapolator - # - #ToolSvc += DQTMuTrkMon; - #ManagedAthenaGlobalMon.AthenaMonTools += [ DQTMuTrkMon ]; - # Import Det Synch tool if DQMonFlags.monManEnvironment in ('tier0Raw', 'tier0') and globalflags.DataSource.get_Value() != 'geant4': from DataQualityTools.DataQualityToolsConf import DQTDetSynchMonTool @@ -122,7 +78,7 @@ if DQMonFlags.monManEnvironment != 'tier0ESD': doOnlineHists = isOnline ); - ToolSvc += DQTDetSynchMon; + #ToolSvc += DQTDetSynchMon; ManagedAthenaGlobalMon.AthenaMonTools += [ DQTDetSynchMon ]; if rec.doCalo and CALOCLUSTER: @@ -136,23 +92,10 @@ if DQMonFlags.monManEnvironment != 'tier0ESD': doOnlineHists = isOnline ); - ToolSvc += DQTCaloClusterTool; + #ToolSvc += DQTCaloClusterTool; ManagedAthenaGlobalMon.AthenaMonTools += [ DQTCaloClusterTool ]; - # Import GlobalWFinder tool ---> Obsolete - #from DataQualityTools.DataQualityToolsConf import DQTGlobalWFinderTool - #DQTGlobalWFinderTool = DQTGlobalWFinderTool(name = 'DQTGlobalWFinderTool', - # histoPathBase = "/GLOBAL/DQTGlobalWFinder", - # doOfflineHists = isOffline, - # doOnlineHists = isOnline, - # doRunCosmics = isCosmics, - # doRunBeam = isBeam - # ); - # - #ToolSvc += DQTGlobalWFinderTool; - #ManagedAthenaGlobalMon.AthenaMonTools += [ DQTGlobalWFinderTool ]; - # Import BackgroundMon tool if DQMonFlags.useTrigger(): @@ -168,7 +111,7 @@ if DQMonFlags.monManEnvironment != 'tier0ESD': doTrigger = rec.doTrigger() ); - ToolSvc += DQTBackgroundMon; + #ToolSvc += DQTBackgroundMon; ManagedAthenaGlobalMon.AthenaMonTools += [ DQTBackgroundMon ]; @@ -181,54 +124,6 @@ if DQMonFlags.monManEnvironment != 'tier0ESD': MinSCTHits=0 MinPtCut=500 - # Import MuonID tool - #from DataQualityTools.DataQualityToolsConf import DQTMuonIDTrackTool - #DQTMuonIDTrackMon = DQTMuonIDTrackTool(name = 'DQTMuonIDTrackMon', - # histoPathBase = "/GLOBAL/DQTMuonVsInDet", - # doOfflineHists = isOffline, - # doOnlineHists = isOnline, - # doRunCosmics = isCosmics, - # doRunBeam = isBeam, - # MinSCTHits = MinSCTHits, - # MinPtCut = MinPtCut - # ); - - #DQTMuonIDTrackMon.ExtrapolationTool = DefaultExtrapolator - #ToolSvc += DQTMuonIDTrackMon; - #ManagedAthenaGlobalMon.AthenaMonTools += [ DQTMuonIDTrackMon ]; - - # Import ElectronQuality Tool ---> Obsolete - #from DataQualityTools.DataQualityToolsConf import DQTElectronQualityTool - #DQTElectronQualityTool = DQTElectronQualityTool(name = 'DQTElectronQualityTool', - # histoPathBase = "/GLOBAL/DQTElectronQuality", - # doRunCosmics = isCosmics, - # doRunBeam = isBeam, - # doOfflineHists = isOffline, - # doOnlineHists = isOnline - # ); - # - #ToolSvc += DQTElectronQualityTool; - #ManagedAthenaGlobalMon.AthenaMonTools += [ DQTElectronQualityTool ]; - - # Import Rate Mon Tool ---> Obsolete - #from DataQualityTools.DataQualityToolsConf import DQTRateMonTool - #DQTRateMonTool = DQTRateMonTool(name = 'DQTRateMonTool', - # histoPathBase = "/GLOBAL/DQTRateMon", - # doOfflineHists = isOffline, - # doOnlineHists = isOnline, - # doRunCosmics = isCosmics, - # doRunBeam = isBeam, - # doTrigger = rec.doTrigger(), - # JetCollectionName = JetCollectionKey, - # triggerList = listOfTriggers - # ); - #ToolSvc += DQTRateMonTool; - #ManagedAthenaGlobalMon.AthenaMonTools += [ DQTRateMonTool ]; - - - #This does not seem needed anymore - #include( "MuonCommRecExample/ReadMuCTPI_jobOptions.py" ) - if not rec.doMuon: try: svcMgr.ByteStreamAddressProviderSvc.TypeNames.remove("RpcPadContainer/RPCPAD") @@ -246,11 +141,9 @@ DQTDataFlowMon = DQTDataFlowMonTool(name = 'DQTDataFlowMon', histoPathBase = '/GLOBAL/DQTDataFlow', releaseString = releaseString ); -ToolSvc += DQTDataFlowMon +#ToolSvc += DQTDataFlowMon ManagedAthenaGlobalMon.AthenaMonTools += [ DQTDataFlowMon ] -#print ManagedAthenaGlobalMon; -#if isBeam==True and (DQMonFlags.monManEnvironment == 'tier0ESD' or DQMonFlags.monManEnvironment == 'online' or DQMonFlags.monManEnvironment == 'tier0' or DQMonFlags.monManEnvironment == 'tier0Raw' ) and rec.doInDet(): if isBeam==True and (DQMonFlags.monManEnvironment != 'tier0Raw') and rec.doInDet() and DQMonFlags.useTrigger(): topSequence += AthenaMonManager( "GlobalMonPhysicsManager" ) @@ -277,7 +170,7 @@ if isBeam==True and (DQMonFlags.monManEnvironment != 'tier0Raw') and rec.doInDet MuonSelectionTool = ToolSvc.DQTMuonSelectionTool, IsolationSelectionTool = ToolSvc.DQTIsoGradientTool ) - ToolSvc += MyDQTGlobalWZFinderTool; + #ToolSvc += MyDQTGlobalWZFinderTool; ManagedAthenaGlobalPhysMon.AthenaMonTools += [ MyDQTGlobalWZFinderTool ]; from DataQualityTools.DataQualityToolsConf import DQTLumiMonTool @@ -297,6 +190,6 @@ if isBeam==True and (DQMonFlags.monManEnvironment != 'tier0Raw') and rec.doInDet TriggerChain = 'CATEGORY_primary_single_ele', TrigDecisionTool = monTrigDecTool if DQMonFlags.useTrigger() else "", ) - ToolSvc += [DQTLumiMonToolAnyTrigger, DQTLumiMonToolMu, DQTLumiMonToolEl] + #ToolSvc += [DQTLumiMonToolAnyTrigger, DQTLumiMonToolMu, DQTLumiMonToolEl] ManagedAthenaGlobalPhysMon.AthenaMonTools += [ DQTLumiMonToolAnyTrigger, DQTLumiMonToolMu, DQTLumiMonToolEl] diff --git a/Database/AthenaPOOL/AthenaPoolCnvSvc/src/AthenaPoolCnvSvc.cxx b/Database/AthenaPOOL/AthenaPoolCnvSvc/src/AthenaPoolCnvSvc.cxx index 012694429ff25357cf23d4a3b3bdfc958c9315d7..926842c7e398c92f2b8e4c3282d4201341ba1a52 100644 --- a/Database/AthenaPOOL/AthenaPoolCnvSvc/src/AthenaPoolCnvSvc.cxx +++ b/Database/AthenaPOOL/AthenaPoolCnvSvc/src/AthenaPoolCnvSvc.cxx @@ -330,7 +330,7 @@ StatusCode AthenaPoolCnvSvc::connectOutput(const std::string& outputConnectionSp m_streamClientFiles.push_back(outputConnectionSpec); } try { - if (!m_poolSvc->connect(pool::ITransaction::UPDATE).isSuccess()) { + if (!m_poolSvc->connect(pool::ITransaction::UPDATE, IPoolSvc::kOutputStream).isSuccess()) { ATH_MSG_ERROR("connectOutput FAILED to open an UPDATE transaction."); return(StatusCode::FAILURE); } diff --git a/Database/AthenaPOOL/AthenaPoolExample/AthenaPoolExampleAlgorithms/share/AthenaPoolExample_Copy.ref b/Database/AthenaPOOL/AthenaPoolExample/AthenaPoolExampleAlgorithms/share/AthenaPoolExample_Copy.ref index 7cc4b77e0e3cce3f5bb4a130a76593ca4a10d7dd..8c82082b20847a228ea244eac65f953b6928ca8c 100644 --- a/Database/AthenaPOOL/AthenaPoolExample/AthenaPoolExampleAlgorithms/share/AthenaPoolExample_Copy.ref +++ b/Database/AthenaPOOL/AthenaPoolExample/AthenaPoolExampleAlgorithms/share/AthenaPoolExample_Copy.ref @@ -1,24 +1,19 @@ -Wed May 23 21:51:53 CEST 2018 +Fri Oct 19 21:07:10 CEST 2018 Preloading tcmalloc_minimal.so Athena INFO including file "AthenaCommon/Preparation.py" Athena INFO including file "AthenaCommon/Atlas.UnixStandardJob.py" Athena INFO executing ROOT6Setup Athena INFO including file "AthenaCommon/Execution.py" Athena INFO including file "AthenaPoolExampleAlgorithms/AthenaPoolExample_CopyJobOptions.py" -Py:ConfigurableDb INFO Read module info for 5481 configurables from 47 genConfDb files -Py:ConfigurableDb WARNING Found 1 duplicates among the 47 genConfDb files : -Py:ConfigurableDb WARNING -------------------------------------------------- -Py:ConfigurableDb WARNING -<component name>: <module> - [ <duplicates> ] -Py:ConfigurableDb WARNING -------------------------------------------------- -Py:ConfigurableDb WARNING -TrackTools: DerivationFrameworkTileCal.DerivationFrameworkTileCalConf - ['TileD3PDMaker.TileD3PDMakerConf'] -Py:ConfigurableDb WARNING Fix your cmt/requirements file !! +Py:ConfigurableDb INFO Read module info for 5521 configurables from 57 genConfDb files +Py:ConfigurableDb INFO No duplicates have been found: that's good ! Athena INFO including file "AthenaCommon/runbatch.py" [?1034hApplicationMgr INFO Updating Gaudi::PluginService::SetDebug(level) to level= 'PluginDebugLevel':0 ApplicationMgr INFO Updating Gaudi::PluginService::SetDebug(level) to level= 'PluginDebugLevel':0 ApplicationMgr SUCCESS ==================================================================================================================================== - Welcome to ApplicationMgr (GaudiCoreSvc v30r2) - running on lxplus083.cern.ch on Wed May 23 21:52:20 2018 + Welcome to ApplicationMgr (GaudiCoreSvc v30r3) + running on lxplus060.cern.ch on Fri Oct 19 21:07:26 2018 ==================================================================================================================================== ApplicationMgr INFO Successfully loaded modules : AthenaServices ApplicationMgr INFO Application Manager Configured successfully @@ -26,13 +21,12 @@ ApplicationMgr INFO Updating Gaudi::PluginService::SetDebug(level) to leve StatusCodeSvc INFO initialize AthDictLoaderSvc INFO in initialize... AthDictLoaderSvc INFO acquired Dso-registry -ClassIDSvc INFO getRegistryEntries: read 2322 CLIDRegistry entries for module ALL -ChronoStatSvc INFO Number of skipped events for MemStat-1 +ClassIDSvc INFO getRegistryEntries: read 2946 CLIDRegistry entries for module ALL CoreDumpSvc INFO install f-a-t-a-l handler... (flag = -1) AthenaEventLoopMgr INFO Initializing AthenaEventLoopMgr - package version AthenaServices-00-00-00 Stream1 DEBUG Property update for OutputLevel : new value = 2 Stream1.Stream1... DEBUG Property update for OutputLevel : new value = 2 -ClassIDSvc INFO getRegistryEntries: read 717 CLIDRegistry entries for module ALL +ClassIDSvc INFO getRegistryEntries: read 637 CLIDRegistry entries for module ALL Stream1 DEBUG In initialize Stream1 DEBUG Found IDecisionSvc. DecisionSvc INFO Inserting stream: Stream1 with no Algs @@ -42,12 +36,13 @@ MetaDataSvc INFO Initializing MetaDataSvc - package version AthenaServi AthenaPoolCnvSvc DEBUG Property update for OutputLevel : new value = 2 AthenaPoolCnvSvc INFO Initializing AthenaPoolCnvSvc - package version AthenaPoolCnvSvc-00-00-00 PoolSvc DEBUG Property update for OutputLevel : new value = 2 +PoolSvc DEBUG Service base class initialized successfully PoolSvc INFO io_register[PoolSvc](xmlcatalog_file:Catalog1.xml) [ok] PoolSvc INFO Set connectionsvc retry/timeout/IDLE timeout to 'ConnectionRetrialPeriod':300/ 'ConnectionRetrialTimeOut':3600/ 'ConnectionTimeOut':5 seconds with connection cleanup disabled PoolSvc INFO Frontier compression level set to 5 -DBReplicaSvc INFO Frontier server at (serverurl=http://atlasfrontier-local.cern.ch:8000/atlr)(serverurl=http://atlasfrontier-ai.cern.ch:8000/atlr)(serverurl=http://lcgft-atlas.gridpp.rl.ac.uk:3128/frontierATLAS)(serverurl=http://ccfrontier.in2p3.fr:23128/ccin2p3-AtlasFrontier)(proxyurl=http://ca-proxy.cern.ch:3128)(proxyurl=http://ca-proxy-meyrin.cern.ch:3128)(proxyurl=http://ca-proxy-wigner.cern.ch:3128) will be considered for COOL data -DBReplicaSvc INFO Read replica configuration from /cvmfs/atlas-nightlies.cern.ch/repo/sw/master/2018-05-22T2053/Athena/22.0.1/InstallArea/x86_64-slc6-gcc62-opt/share/dbreplica.config -DBReplicaSvc INFO Total of 10 servers found for host lxplus083.cern.ch [ATLF ATLAS_COOLPROD atlas_dd ATLAS_CONFIG INT8R INTR ATONR_COOL ATONR_CONF DEVDB11 ATLF ] +DBReplicaSvc INFO Frontier server at (serverurl=http://atlasfrontier-local.cern.ch:8000/atlr)(serverurl=http://atlasfrontier-ai.cern.ch:8000/atlr)(serverurl=http://lcgft-atlas.gridpp.rl.ac.uk:3128/frontierATLAS)(serverurl=http://ccfrontier.in2p3.fr:23128/ccin2p3-AtlasFrontier)(proxyurl=http://ca-proxy.cern.ch:3128)(proxyurl=http://ca-proxy-meyrin.cern.ch:3128)(proxyurl=http://ca-proxy-wigner.cern.ch:3128)(proxyurl=http://atlasbpfrontier.cern.ch:3127)(proxyurl=http://atlasbpfrontier.fnal.gov:3127) will be considered for COOL data +DBReplicaSvc INFO Read replica configuration from /cvmfs/atlas-nightlies.cern.ch/repo/sw/master/2018-10-18T2340/Athena/22.0.1/InstallArea/x86_64-slc6-gcc8-opt/share/dbreplica.config +DBReplicaSvc INFO Total of 10 servers found for host lxplus060.cern.ch [ATLF ATLAS_COOLPROD atlas_dd ATLAS_CONFIG INT8R INTR ATONR_COOL ATONR_CONF DEVDB11 ATLF ] PoolSvc INFO Successfully setup replica sorting algorithm PoolSvc DEBUG OutputLevel is PoolSvc INFO Setting up APR FileCatalog and Streams @@ -56,6 +51,7 @@ DbSession INFO Open DbSession Domain[ROOT_All] INFO > Access DbDomain READ [ROOT_All] EventSelector DEBUG Property update for OutputLevel : new value = 2 EventSelector INFO Initializing EventSelector - package version EventSelectorAthenaPool-00-00-00 +EventSelector DEBUG Service base class initialized successfully EventSelector INFO reinitialization... EventSelector INFO EventSelection with query EventSelector DEBUG Try item: "SimplePoolFile1.root" from the collection list. @@ -123,6 +119,7 @@ MetaDataHdr(Dat... DEBUG Opening MetaDataHdr(Dat... DEBUG attributes# = 1 MetaDataHdr(Dat... DEBUG Branch container 'DataHeader' MetaDataHdr(Dat... DEBUG Opened container MetaDataHdr(DataHeader) of type ROOT_Tree +ClassIDSvc INFO getRegistryEntries: read 1643 CLIDRegistry entries for module ALL EventPersistenc... INFO Added successfully Conversion service:AthenaPoolCnvSvc SimplePoolFile1... DEBUG --> Access DbContainer READ [ROOT_Tree] MetaDataHdrForm(DataHeaderForm) MetaDataHdrForm... DEBUG Opening @@ -130,6 +127,7 @@ MetaDataHdrForm... DEBUG attributes# = 1 MetaDataHdrForm... DEBUG Branch container 'DataHeaderForm' MetaDataHdrForm... DEBUG Opened container MetaDataHdrForm(DataHeaderForm) of type ROOT_Tree AthenaPoolAddre... DEBUG Property update for OutputLevel : new value = 2 +AthenaPoolAddre... DEBUG Service base class initialized successfully Stream1 DEBUG Found StoreGateSvc store. Stream1 DEBUG Found MetaDataStore store. OutputStreamSeq... INFO Initializing OutputStreamSequencerSvc - package version AthenaServices-00-00-00 @@ -154,9 +152,14 @@ AthenaEventLoopMgr INFO Setup EventSelector service EventSelector ApplicationMgr INFO Application Manager Initialized successfully EventSelector DEBUG Try item: "SimplePoolFile1.root" from the collection list. ApplicationMgr INFO Application Manager Started successfully +RootDatabase.se... DEBUG Request tree cache +RootDatabase.se... DEBUG File name SimplePoolFile1.root +RootDatabase.se... DEBUG Got tree CollectionTree read entry -1 +RootDatabase.se... DEBUG Using Tree cache. Size: -1 Nevents to learn with: -1 +AthenaPoolCnvSvc DEBUG setAttribute TREE_CACHE to -1 for db: SimplePoolFile1.root and cont: CollectionTree +ClassIDSvc INFO getRegistryEntries: read 339 CLIDRegistry entries for module ALL EventSelector DEBUG Get AttributeList from the collection EventSelector DEBUG AttributeList size 3 -ClassIDSvc INFO getRegistryEntries: read 1681 CLIDRegistry entries for module ALL EventSelector DEBUG record AthenaAttribute, name = Token = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=00000202][OID=00000006-00000000]. EventSelector DEBUG record AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=00000202][OID=00000006-00000000]. EventSelector DEBUG found AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=00000202][OID=00000006-00000000] @@ -174,14 +177,12 @@ AthenaPoolAddre... DEBUG The current Event contains: 3 objects AthenaPoolAddre... DEBUG loadAddresses: DataObject address, clid = 2101, name = McEventInfo AthenaPoolAddre... DEBUG loadAddresses: DataObject address, clid = 9102, name = MyHits AlgResourcePool INFO TopAlg list empty. Recovering the one of Application Manager -ClassIDSvc INFO getRegistryEntries: read 5 CLIDRegistry entries for module ALL SimplePoolFile1... DEBUG --> Access DbContainer READ [ROOT_Tree] CollectionTree(EventInfo_p4/McEventInfo) CollectionTree(... DEBUG Opening CollectionTree(... DEBUG attributes# = 1 CollectionTree(... DEBUG Branch container 'EventInfo_p4_McEventInfo' CollectionTree(... DEBUG Opened container CollectionTree(EventInfo_p4/McEventInfo) of type ROOT_Tree AthenaPoolConve... INFO massageEventInfo: unable to get OverrideRunNumberFromInput property from EventSelector -ClassIDSvc INFO getRegistryEntries: read 15 CLIDRegistry entries for module ALL AthenaEventLoopMgr INFO ===>>> start of run 1 <<<=== AthenaEventLoopMgr INFO ===>>> start processing event #0, run #1 0 events processed so far <<<=== DbSession INFO Open DbSession @@ -212,6 +213,7 @@ SimplePoolRepli... DEBUG --->Adding Assoc :????/##Params [200] (2 , ffffffff) SimplePoolRepli... DEBUG ---->ClassID:???? ##Params DEBUG No objects passing selection criteria... Container has 0 Entries in total. AthenaPoolCnvSvc DEBUG setAttribute CONTAINER_SPLITLEVEL to 99 for db: SimplePoolReplica1.root and cont: TTree=POOLContainerForm(DataHeaderForm) +ClassIDSvc INFO getRegistryEntries: read 20 CLIDRegistry entries for module ALL Stream1 DEBUG addItemObjects(2101,"*") called Stream1 DEBUG Key:* Stream1 DEBUG Added object 2101,"McEventInfo" @@ -631,6 +633,7 @@ Stream1 DEBUG Collected objects: Stream1 DEBUG Object/count: EventInfo_McEventInfo, 20 Stream1 DEBUG Object/count: ExampleHitContainer_MyHits, 20 AthenaEventLoopMgr INFO ===>>> done processing event #19, run #1 20 events processed so far <<<=== +EventSelector INFO Disconnecting input sourceID: ???? Domain[ROOT_All] INFO -> Deaccess DbDatabase READ [ROOT_All] ???? Domain[ROOT_All] INFO > Deaccess DbDomain READ [ROOT_All] AthenaEventLoopMgr INFO No more events in event selection @@ -684,11 +687,11 @@ ToolSvc INFO Removing all tools created by ToolSvc *****Chrono***** INFO **************************************************************************************************** commitOutput INFO Time User : Tot= 0 [us] Ave/Min/Max= 0(+- 0)/ 0/ 0 [us] #= 21 cRep_ALL INFO Time User : Tot= 0 [us] Ave/Min/Max= 0(+- 0)/ 0/ 0 [us] #= 62 -cRepR_ALL INFO Time User : Tot= 10 [ms] Ave/Min/Max= 0.12(+- 1.09)/ 0/ 10 [ms] #= 83 -fRep_ALL INFO Time User : Tot= 20 [ms] Ave/Min/Max=0.323(+- 1.77)/ 0/ 10 [ms] #= 62 -cObjR_ALL INFO Time User : Tot= 10 [ms] Ave/Min/Max=0.154(+- 1.23)/ 0/ 10 [ms] #= 65 -cObj_ALL INFO Time User : Tot= 70 [ms] Ave/Min/Max= 1.13(+- 5.11)/ 0/ 30 [ms] #= 62 -ChronoStatSvc INFO Time User : Tot= 1.96 [s] #= 1 +cObjR_ALL INFO Time User : Tot= 0 [us] Ave/Min/Max= 0(+- 0)/ 0/ 0 [us] #= 65 +fRep_ALL INFO Time User : Tot= 30 [ms] Ave/Min/Max=0.484(+- 2.15)/ 0/ 10 [ms] #= 62 +cRepR_ALL INFO Time User : Tot= 30 [ms] Ave/Min/Max=0.361(+- 1.87)/ 0/ 10 [ms] #= 83 +cObj_ALL INFO Time User : Tot= 40 [ms] Ave/Min/Max=0.645(+- 3.04)/ 0/ 20 [ms] #= 62 +ChronoStatSvc INFO Time User : Tot= 1.01 [s] #= 1 *****Chrono***** INFO **************************************************************************************************** ChronoStatSvc.f... INFO Service finalized successfully ApplicationMgr INFO Application Manager Finalized successfully diff --git a/Database/AthenaPOOL/AthenaPoolExample/AthenaPoolExampleAlgorithms/share/AthenaPoolExample_RCond.ref b/Database/AthenaPOOL/AthenaPoolExample/AthenaPoolExampleAlgorithms/share/AthenaPoolExample_RCond.ref index 1f54fbaa0dc0968ff669c99e4373c09bce1de23e..c7043ff5c2af0916c25f78652faaed4afe9cb55d 100644 --- a/Database/AthenaPOOL/AthenaPoolExample/AthenaPoolExampleAlgorithms/share/AthenaPoolExample_RCond.ref +++ b/Database/AthenaPOOL/AthenaPoolExample/AthenaPoolExampleAlgorithms/share/AthenaPoolExample_RCond.ref @@ -1,19 +1,19 @@ -Wed Jul 18 20:12:05 CEST 2018 +Fri Oct 19 21:10:30 CEST 2018 Preloading tcmalloc_minimal.so Athena INFO including file "AthenaCommon/Preparation.py" Athena INFO including file "AthenaCommon/Atlas.UnixStandardJob.py" Athena INFO executing ROOT6Setup Athena INFO including file "AthenaCommon/Execution.py" Athena INFO including file "AthenaPoolExampleAlgorithms/AthenaPoolExample_RCondJobOptions.py" -Py:ConfigurableDb INFO Read module info for 5511 configurables from 52 genConfDb files +Py:ConfigurableDb INFO Read module info for 5521 configurables from 57 genConfDb files Py:ConfigurableDb INFO No duplicates have been found: that's good ! Athena INFO including file "AthenaCommon/runbatch.py" [?1034hApplicationMgr INFO Updating Gaudi::PluginService::SetDebug(level) to level= 'PluginDebugLevel':0 ApplicationMgr INFO Updating Gaudi::PluginService::SetDebug(level) to level= 'PluginDebugLevel':0 ApplicationMgr SUCCESS ==================================================================================================================================== - Welcome to ApplicationMgr (GaudiCoreSvc v30r2) - running on lxplus052.cern.ch on Wed Jul 18 20:12:13 2018 + Welcome to ApplicationMgr (GaudiCoreSvc v30r3) + running on lxplus060.cern.ch on Fri Oct 19 21:10:46 2018 ==================================================================================================================================== ApplicationMgr INFO Successfully loaded modules : AthenaServices ApplicationMgr INFO Application Manager Configured successfully @@ -21,10 +21,10 @@ ApplicationMgr INFO Updating Gaudi::PluginService::SetDebug(level) to leve StatusCodeSvc INFO initialize AthDictLoaderSvc INFO in initialize... AthDictLoaderSvc INFO acquired Dso-registry -ClassIDSvc INFO getRegistryEntries: read 2428 CLIDRegistry entries for module ALL +ClassIDSvc INFO getRegistryEntries: read 2946 CLIDRegistry entries for module ALL CoreDumpSvc INFO install f-a-t-a-l handler... (flag = -1) AthenaEventLoopMgr INFO Initializing AthenaEventLoopMgr - package version AthenaServices-00-00-00 -ClassIDSvc INFO getRegistryEntries: read 916 CLIDRegistry entries for module ALL +ClassIDSvc INFO getRegistryEntries: read 836 CLIDRegistry entries for module ALL ReadCond DEBUG Property update for OutputLevel : new value = 2 ReadCond INFO in initialize() ReadCond DEBUG input handles: 0 @@ -40,9 +40,9 @@ PoolSvc DEBUG Property update for OutputLevel : new value = 2 PoolSvc DEBUG Service base class initialized successfully PoolSvc INFO Set connectionsvc retry/timeout/IDLE timeout to 'ConnectionRetrialPeriod':300/ 'ConnectionRetrialTimeOut':3600/ 'ConnectionTimeOut':5 seconds with connection cleanup disabled PoolSvc INFO Frontier compression level set to 5 -DBReplicaSvc INFO Frontier server at (serverurl=http://atlasfrontier-local.cern.ch:8000/atlr)(serverurl=http://atlasfrontier-ai.cern.ch:8000/atlr)(serverurl=http://lcgft-atlas.gridpp.rl.ac.uk:3128/frontierATLAS)(serverurl=http://ccfrontier.in2p3.fr:23128/ccin2p3-AtlasFrontier)(proxyurl=http://ca-proxy.cern.ch:3128)(proxyurl=http://ca-proxy-meyrin.cern.ch:3128)(proxyurl=http://ca-proxy-wigner.cern.ch:3128) will be considered for COOL data -DBReplicaSvc INFO Read replica configuration from /cvmfs/atlas-nightlies.cern.ch/repo/sw/master/2018-07-17T2058/Athena/22.0.1/InstallArea/x86_64-slc6-gcc62-opt/share/dbreplica.config -DBReplicaSvc INFO Total of 10 servers found for host lxplus052.cern.ch [ATLF ATLAS_COOLPROD atlas_dd ATLAS_CONFIG INT8R INTR ATONR_COOL ATONR_CONF DEVDB11 ATLF ] +DBReplicaSvc INFO Frontier server at (serverurl=http://atlasfrontier-local.cern.ch:8000/atlr)(serverurl=http://atlasfrontier-ai.cern.ch:8000/atlr)(serverurl=http://lcgft-atlas.gridpp.rl.ac.uk:3128/frontierATLAS)(serverurl=http://ccfrontier.in2p3.fr:23128/ccin2p3-AtlasFrontier)(proxyurl=http://ca-proxy.cern.ch:3128)(proxyurl=http://ca-proxy-meyrin.cern.ch:3128)(proxyurl=http://ca-proxy-wigner.cern.ch:3128)(proxyurl=http://atlasbpfrontier.cern.ch:3127)(proxyurl=http://atlasbpfrontier.fnal.gov:3127) will be considered for COOL data +DBReplicaSvc INFO Read replica configuration from /cvmfs/atlas-nightlies.cern.ch/repo/sw/master/2018-10-18T2340/Athena/22.0.1/InstallArea/x86_64-slc6-gcc8-opt/share/dbreplica.config +DBReplicaSvc INFO Total of 10 servers found for host lxplus060.cern.ch [ATLF ATLAS_COOLPROD atlas_dd ATLAS_CONFIG INT8R INTR ATONR_COOL ATONR_CONF DEVDB11 ATLF ] PoolSvc INFO Successfully setup replica sorting algorithm PoolSvc DEBUG OutputLevel is PoolSvc INFO Setting up APR FileCatalog and Streams @@ -117,6 +117,7 @@ MetaDataHdr(Dat... DEBUG Opening MetaDataHdr(Dat... DEBUG attributes# = 1 MetaDataHdr(Dat... DEBUG Branch container 'DataHeader' MetaDataHdr(Dat... DEBUG Opened container MetaDataHdr(DataHeader) of type ROOT_Tree +ClassIDSvc INFO getRegistryEntries: read 2012 CLIDRegistry entries for module ALL EventPersistenc... INFO Added successfully Conversion service:AthenaPoolCnvSvc SimplePoolFile1... DEBUG --> Access DbContainer READ [ROOT_Tree] MetaDataHdrForm(DataHeaderForm) MetaDataHdrForm... DEBUG Opening @@ -230,6 +231,10 @@ POOLContainer(D... DEBUG attributes# = 1 POOLContainer(D... DEBUG Branch container 'DataHeader' POOLContainer(D... DEBUG Opened container POOLContainer(DataHeader) of type ROOT_Tree ApplicationMgr INFO Application Manager Started successfully +RootDatabase.se... DEBUG Request tree cache +RootDatabase.se... DEBUG File name SimplePoolFile1.root +RootDatabase.se... DEBUG Got tree CollectionTree read entry -1 +RootDatabase.se... DEBUG Using Tree cache. Size: -1 Nevents to learn with: -1 MetaDataSvc DEBUG handle() BeginInputFile for SimplePoolFile1.root MetaDataSvc DEBUG initInputMetaDataStore: file name SimplePoolFile1.root SimplePoolFile1... DEBUG --> Access DbContainer READ [ROOT_Tree] MetaDataHdr(DataHeader) @@ -237,11 +242,11 @@ MetaDataHdr(Dat... DEBUG Opening MetaDataHdr(Dat... DEBUG attributes# = 1 MetaDataHdr(Dat... DEBUG Branch container 'DataHeader' MetaDataHdr(Dat... DEBUG Opened container MetaDataHdr(DataHeader) of type ROOT_Tree +ClassIDSvc INFO getRegistryEntries: read 2 CLIDRegistry entries for module ALL MetaDataSvc DEBUG Loaded input meta data store proxies MetaDataSvc DEBUG calling beginInputFile for ToolSvc.IOVDbMetaDataTool EventSelector DEBUG Get AttributeList from the collection EventSelector DEBUG AttributeList size 0 -ClassIDSvc INFO getRegistryEntries: read 1714 CLIDRegistry entries for module ALL EventSelector DEBUG record AthenaAttribute, name = Token = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=00000202][OID=00000006-00000000]. EventSelector DEBUG record AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=00000202][OID=00000006-00000000]. EventSelector DEBUG found AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=00000202][OID=00000006-00000000] @@ -260,7 +265,6 @@ CollectionTree(... DEBUG attributes# = 1 CollectionTree(... DEBUG Branch container 'EventInfo_p4_McEventInfo' CollectionTree(... DEBUG Opened container CollectionTree(EventInfo_p4/McEventInfo) of type ROOT_Tree AthenaPoolConve... INFO massageEventInfo: unable to get OverrideRunNumberFromInput property from EventSelector -ClassIDSvc INFO getRegistryEntries: read 15 CLIDRegistry entries for module ALL AthenaEventLoopMgr INFO ===>>> start of run 1 <<<=== AthenaEventLoopMgr INFO ===>>> start processing event #0, run #1 0 events processed so far <<<=== ReadCond DEBUG in execute() @@ -298,7 +302,6 @@ ReadData INFO EventType: Event type: sim/data - is sim , testbeam/a ReadData INFO TagInfo: ReadData INFO EventInfo event: 0 run: 1 ReadData INFO Get Smart data ptr 1 -ClassIDSvc INFO getRegistryEntries: read 10 CLIDRegistry entries for module ALL ReadData INFO Could not find ExampleTrackContainer/MyTracks SimplePoolFile1... DEBUG --> Access DbContainer READ [ROOT_Tree] CollectionTree(ExampleHitContainer_p1/MyHits) CollectionTree(... DEBUG Opening @@ -945,6 +948,7 @@ ReadData INFO Hit x = 1930.12 y = 46.5449 z = -1856.17 detector = Du AthenaEventLoopMgr INFO ===>>> done processing event #19, run #1 20 events processed so far <<<=== Domain[ROOT_All] INFO -> Deaccess DbDatabase READ [ROOT_All] ???? MetaDataSvc DEBUG handle() EndInputFile for FID:???? +EventSelector INFO Disconnecting input sourceID: ???? MetaDataSvc DEBUG handle() LastInputFile for end AthenaEventLoopMgr INFO No more events in event selection MetaDataSvc DEBUG calling metaDataStop for ToolSvc.IOVDbMetaDataTool @@ -960,9 +964,9 @@ ToolSvc INFO Removing all tools created by ToolSvc *****Chrono***** INFO **************************************************************************************************** *****Chrono***** INFO The Final CPU consumption ( Chrono ) Table (ordered) *****Chrono***** INFO **************************************************************************************************** -cObjR_ALL INFO Time User : Tot= 0 [us] Ave/Min/Max= 0(+- 0)/ 0/ 0 [us] #= 70 -cObj_ALL INFO Time User : Tot= 20 [ms] Ave/Min/Max=0.308(+- 1.73)/ 0/ 10 [ms] #= 65 -ChronoStatSvc INFO Time User : Tot= 0.82 [s] #= 1 +cObjR_ALL INFO Time User : Tot= 0 [us] Ave/Min/Max= 0(+- 0)/ 0/ 0 [us] #= 49 +cObj_ALL INFO Time User : Tot= 30 [ms] Ave/Min/Max=0.652(+- 2.47)/ 0/ 10 [ms] #= 46 +ChronoStatSvc INFO Time User : Tot= 0.98 [s] #= 1 *****Chrono***** INFO **************************************************************************************************** ChronoStatSvc.f... INFO Service finalized successfully ApplicationMgr INFO Application Manager Finalized successfully diff --git a/Database/AthenaPOOL/AthenaPoolExample/AthenaPoolExampleAlgorithms/share/AthenaPoolExample_RMeta.ref b/Database/AthenaPOOL/AthenaPoolExample/AthenaPoolExampleAlgorithms/share/AthenaPoolExample_RMeta.ref index af6a39289c3a44b4a977cb552d0e2432d1038f0a..6edaf6b1c7b890ddcfbb7aa67e667079e542b184 100644 --- a/Database/AthenaPOOL/AthenaPoolExample/AthenaPoolExampleAlgorithms/share/AthenaPoolExample_RMeta.ref +++ b/Database/AthenaPOOL/AthenaPoolExample/AthenaPoolExampleAlgorithms/share/AthenaPoolExample_RMeta.ref @@ -1,19 +1,19 @@ -Wed Jul 18 19:56:25 CEST 2018 +Fri Oct 19 21:01:34 CEST 2018 Preloading tcmalloc_minimal.so Athena INFO including file "AthenaCommon/Preparation.py" Athena INFO including file "AthenaCommon/Atlas.UnixStandardJob.py" Athena INFO executing ROOT6Setup Athena INFO including file "AthenaCommon/Execution.py" Athena INFO including file "AthenaPoolExampleAlgorithms/AthenaPoolExample_RMetaJobOptions.py" -Py:ConfigurableDb INFO Read module info for 5511 configurables from 52 genConfDb files +Py:ConfigurableDb INFO Read module info for 5521 configurables from 57 genConfDb files Py:ConfigurableDb INFO No duplicates have been found: that's good ! Athena INFO including file "AthenaCommon/runbatch.py" [?1034hApplicationMgr INFO Updating Gaudi::PluginService::SetDebug(level) to level= 'PluginDebugLevel':0 ApplicationMgr INFO Updating Gaudi::PluginService::SetDebug(level) to level= 'PluginDebugLevel':0 ApplicationMgr SUCCESS ==================================================================================================================================== - Welcome to ApplicationMgr (GaudiCoreSvc v30r2) - running on lxplus052.cern.ch on Wed Jul 18 19:56:33 2018 + Welcome to ApplicationMgr (GaudiCoreSvc v30r3) + running on lxplus060.cern.ch on Fri Oct 19 21:01:54 2018 ==================================================================================================================================== ApplicationMgr INFO Successfully loaded modules : AthenaServices ApplicationMgr INFO Application Manager Configured successfully @@ -21,10 +21,10 @@ ApplicationMgr INFO Updating Gaudi::PluginService::SetDebug(level) to leve StatusCodeSvc INFO initialize AthDictLoaderSvc INFO in initialize... AthDictLoaderSvc INFO acquired Dso-registry -ClassIDSvc INFO getRegistryEntries: read 2428 CLIDRegistry entries for module ALL +ClassIDSvc INFO getRegistryEntries: read 2946 CLIDRegistry entries for module ALL CoreDumpSvc INFO install f-a-t-a-l handler... (flag = -1) AthenaEventLoopMgr INFO Initializing AthenaEventLoopMgr - package version AthenaServices-00-00-00 -ClassIDSvc INFO getRegistryEntries: read 916 CLIDRegistry entries for module ALL +ClassIDSvc INFO getRegistryEntries: read 836 CLIDRegistry entries for module ALL ReadData DEBUG Property update for OutputLevel : new value = 2 ReadData INFO in initialize() MetaDataSvc DEBUG Property update for OutputLevel : new value = 2 @@ -37,9 +37,9 @@ PoolSvc INFO io_register[PoolSvc](xmlcatalog_file:Catalog2.xml) [ok PoolSvc INFO io_register[PoolSvc](xmlcatalog_file:PoolFileCatalog.xml) [ok] PoolSvc INFO Set connectionsvc retry/timeout/IDLE timeout to 'ConnectionRetrialPeriod':300/ 'ConnectionRetrialTimeOut':3600/ 'ConnectionTimeOut':5 seconds with connection cleanup disabled PoolSvc INFO Frontier compression level set to 5 -DBReplicaSvc INFO Frontier server at (serverurl=http://atlasfrontier-local.cern.ch:8000/atlr)(serverurl=http://atlasfrontier-ai.cern.ch:8000/atlr)(serverurl=http://lcgft-atlas.gridpp.rl.ac.uk:3128/frontierATLAS)(serverurl=http://ccfrontier.in2p3.fr:23128/ccin2p3-AtlasFrontier)(proxyurl=http://ca-proxy.cern.ch:3128)(proxyurl=http://ca-proxy-meyrin.cern.ch:3128)(proxyurl=http://ca-proxy-wigner.cern.ch:3128) will be considered for COOL data -DBReplicaSvc INFO Read replica configuration from /cvmfs/atlas-nightlies.cern.ch/repo/sw/master/2018-07-17T2058/Athena/22.0.1/InstallArea/x86_64-slc6-gcc62-opt/share/dbreplica.config -DBReplicaSvc INFO Total of 10 servers found for host lxplus052.cern.ch [ATLF ATLAS_COOLPROD atlas_dd ATLAS_CONFIG INT8R INTR ATONR_COOL ATONR_CONF DEVDB11 ATLF ] +DBReplicaSvc INFO Frontier server at (serverurl=http://atlasfrontier-local.cern.ch:8000/atlr)(serverurl=http://atlasfrontier-ai.cern.ch:8000/atlr)(serverurl=http://lcgft-atlas.gridpp.rl.ac.uk:3128/frontierATLAS)(serverurl=http://ccfrontier.in2p3.fr:23128/ccin2p3-AtlasFrontier)(proxyurl=http://ca-proxy.cern.ch:3128)(proxyurl=http://ca-proxy-meyrin.cern.ch:3128)(proxyurl=http://ca-proxy-wigner.cern.ch:3128)(proxyurl=http://atlasbpfrontier.cern.ch:3127)(proxyurl=http://atlasbpfrontier.fnal.gov:3127) will be considered for COOL data +DBReplicaSvc INFO Read replica configuration from /cvmfs/atlas-nightlies.cern.ch/repo/sw/master/2018-10-18T2340/Athena/22.0.1/InstallArea/x86_64-slc6-gcc8-opt/share/dbreplica.config +DBReplicaSvc INFO Total of 10 servers found for host lxplus060.cern.ch [ATLF ATLAS_COOLPROD atlas_dd ATLAS_CONFIG INT8R INTR ATONR_COOL ATONR_CONF DEVDB11 ATLF ] PoolSvc INFO Successfully setup replica sorting algorithm PoolSvc DEBUG OutputLevel is PoolSvc INFO Setting up APR FileCatalog and Streams @@ -116,6 +116,7 @@ MetaDataHdr(Dat... DEBUG Opening MetaDataHdr(Dat... DEBUG attributes# = 1 MetaDataHdr(Dat... DEBUG Branch container 'DataHeader' MetaDataHdr(Dat... DEBUG Opened container MetaDataHdr(DataHeader) of type ROOT_Tree +ClassIDSvc INFO getRegistryEntries: read 2012 CLIDRegistry entries for module ALL EventPersistenc... INFO Added successfully Conversion service:AthenaPoolCnvSvc SimplePoolFile5... DEBUG --> Access DbContainer READ [ROOT_Tree] MetaDataHdrForm(DataHeaderForm) MetaDataHdrForm... DEBUG Opening @@ -194,6 +195,10 @@ POOLContainer(D... DEBUG attributes# = 1 POOLContainer(D... DEBUG Branch container 'DataHeader' POOLContainer(D... DEBUG Opened container POOLContainer(DataHeader) of type ROOT_Tree ApplicationMgr INFO Application Manager Started successfully +RootDatabase.se... DEBUG Request tree cache +RootDatabase.se... DEBUG File name SimplePoolFile5.root +RootDatabase.se... DEBUG Got tree CollectionTree read entry -1 +RootDatabase.se... DEBUG Using Tree cache. Size: -1 Nevents to learn with: -1 MetaDataSvc DEBUG handle() BeginInputFile for SimplePoolFile5.root MetaDataSvc DEBUG initInputMetaDataStore: file name SimplePoolFile5.root SimplePoolFile5... DEBUG --> Access DbContainer READ [ROOT_Tree] MetaDataHdr(DataHeader) @@ -201,6 +206,7 @@ MetaDataHdr(Dat... DEBUG Opening MetaDataHdr(Dat... DEBUG attributes# = 1 MetaDataHdr(Dat... DEBUG Branch container 'DataHeader' MetaDataHdr(Dat... DEBUG Opened container MetaDataHdr(DataHeader) of type ROOT_Tree +ClassIDSvc INFO getRegistryEntries: read 2 CLIDRegistry entries for module ALL MetaDataSvc DEBUG Loaded input meta data store proxies MetaDataSvc DEBUG calling beginInputFile for ToolSvc.IOVDbMetaDataTool MetaDataSvc DEBUG calling beginInputFile for ToolSvc.AthPoolEx::ReadMeta @@ -209,7 +215,6 @@ MetaData(Exampl... DEBUG Opening MetaData(Exampl... DEBUG attributes# = 1 MetaData(Exampl... DEBUG Branch container 'ExampleHitContainer_p1_PedestalWriteData' MetaData(Exampl... DEBUG Opened container MetaData(ExampleHitContainer_p1/PedestalWriteData) of type ROOT_Tree -ClassIDSvc INFO getRegistryEntries: read 1724 CLIDRegistry entries for module ALL ToolSvc.AthPool... INFO Pedestal x = 193136 y = -5580.01 z = -175208 string = <..........o..........o..........o..........o..........o..........o..........o..........o..........o..........o..........o..........o..........o..........o..........o..........o..........o..........o..........o..........o> EventSelector DEBUG Get AttributeList from the collection EventSelector DEBUG AttributeList size 0 @@ -231,7 +236,6 @@ CollectionTree(... DEBUG attributes# = 1 CollectionTree(... DEBUG Branch container 'EventInfo_p4_McEventInfo' CollectionTree(... DEBUG Opened container CollectionTree(EventInfo_p4/McEventInfo) of type ROOT_Tree AthenaPoolConve... INFO massageEventInfo: unable to get OverrideRunNumberFromInput property from EventSelector -ClassIDSvc INFO getRegistryEntries: read 15 CLIDRegistry entries for module ALL AthenaEventLoopMgr INFO ===>>> start of run 0 <<<=== AthenaEventLoopMgr INFO ===>>> start processing event #0, run #0 0 events processed so far <<<=== ReadData DEBUG in execute() @@ -858,6 +862,7 @@ AthenaEventLoopMgr INFO ===>>> done processing event #19, run #0 20 events Domain[ROOT_All] INFO -> Deaccess DbDatabase READ [ROOT_All] ???? Domain[ROOT_All] INFO > Deaccess DbDomain READ [ROOT_All] MetaDataSvc DEBUG handle() EndInputFile for FID:???? +EventSelector INFO Disconnecting input sourceID: ???? MetaDataSvc DEBUG handle() LastInputFile for end AthenaEventLoopMgr INFO No more events in event selection MetaDataSvc DEBUG calling metaDataStop for ToolSvc.IOVDbMetaDataTool @@ -872,9 +877,9 @@ ToolSvc.AthPool... INFO in finalize() *****Chrono***** INFO **************************************************************************************************** *****Chrono***** INFO The Final CPU consumption ( Chrono ) Table (ordered) *****Chrono***** INFO **************************************************************************************************** -cObjR_ALL INFO Time User : Tot= 0 [us] Ave/Min/Max= 0(+- 0)/ 0/ 0 [us] #= 67 -cObj_ALL INFO Time User : Tot= 20 [ms] Ave/Min/Max=0.312(+- 1.74)/ 0/ 10 [ms] #= 64 -ChronoStatSvc INFO Time User : Tot= 0.78 [s] #= 1 +cObjR_ALL INFO Time User : Tot= 10 [ms] Ave/Min/Max=0.213(+- 1.44)/ 0/ 10 [ms] #= 47 +cObj_ALL INFO Time User : Tot= 50 [ms] Ave/Min/Max= 1.11(+- 4.33)/ 0/ 20 [ms] #= 45 +ChronoStatSvc INFO Time User : Tot= 0.98 [s] #= 1 *****Chrono***** INFO **************************************************************************************************** ChronoStatSvc.f... INFO Service finalized successfully ApplicationMgr INFO Application Manager Finalized successfully diff --git a/Database/AthenaPOOL/AthenaPoolExample/AthenaPoolExampleAlgorithms/share/AthenaPoolExample_ReWrite.ref b/Database/AthenaPOOL/AthenaPoolExample/AthenaPoolExampleAlgorithms/share/AthenaPoolExample_ReWrite.ref index 9dfc969acb6d0ef83eea519d764e802cd9a78457..38797111b19cc7567c6f4d6788878817370be858 100644 --- a/Database/AthenaPOOL/AthenaPoolExample/AthenaPoolExampleAlgorithms/share/AthenaPoolExample_ReWrite.ref +++ b/Database/AthenaPOOL/AthenaPoolExample/AthenaPoolExampleAlgorithms/share/AthenaPoolExample_ReWrite.ref @@ -1,19 +1,19 @@ -Wed Jul 18 18:24:33 CEST 2018 +Fri Oct 19 20:56:49 CEST 2018 Preloading tcmalloc_minimal.so Athena INFO including file "AthenaCommon/Preparation.py" Athena INFO including file "AthenaCommon/Atlas.UnixStandardJob.py" Athena INFO executing ROOT6Setup Athena INFO including file "AthenaCommon/Execution.py" Athena INFO including file "AthenaPoolExampleAlgorithms/AthenaPoolExample_RWJobOptions.py" -Py:ConfigurableDb INFO Read module info for 5511 configurables from 52 genConfDb files +Py:ConfigurableDb INFO Read module info for 5521 configurables from 57 genConfDb files Py:ConfigurableDb INFO No duplicates have been found: that's good ! Athena INFO including file "AthenaCommon/runbatch.py" [?1034hApplicationMgr INFO Updating Gaudi::PluginService::SetDebug(level) to level= 'PluginDebugLevel':0 ApplicationMgr INFO Updating Gaudi::PluginService::SetDebug(level) to level= 'PluginDebugLevel':0 ApplicationMgr SUCCESS ==================================================================================================================================== - Welcome to ApplicationMgr (GaudiCoreSvc v30r2) - running on lxplus052.cern.ch on Wed Jul 18 18:24:41 2018 + Welcome to ApplicationMgr (GaudiCoreSvc v30r3) + running on lxplus060.cern.ch on Fri Oct 19 20:57:03 2018 ==================================================================================================================================== ApplicationMgr INFO Successfully loaded modules : AthenaServices ApplicationMgr INFO Application Manager Configured successfully @@ -21,10 +21,10 @@ ApplicationMgr INFO Updating Gaudi::PluginService::SetDebug(level) to leve StatusCodeSvc INFO initialize AthDictLoaderSvc INFO in initialize... AthDictLoaderSvc INFO acquired Dso-registry -ClassIDSvc INFO getRegistryEntries: read 2428 CLIDRegistry entries for module ALL +ClassIDSvc INFO getRegistryEntries: read 2946 CLIDRegistry entries for module ALL CoreDumpSvc INFO install f-a-t-a-l handler... (flag = -1) AthenaEventLoopMgr INFO Initializing AthenaEventLoopMgr - package version AthenaServices-00-00-00 -ClassIDSvc INFO getRegistryEntries: read 916 CLIDRegistry entries for module ALL +ClassIDSvc INFO getRegistryEntries: read 836 CLIDRegistry entries for module ALL ReadData DEBUG Property update for OutputLevel : new value = 2 ReadData INFO in initialize() MetaDataSvc DEBUG Property update for OutputLevel : new value = 2 @@ -36,9 +36,9 @@ PoolSvc DEBUG Property update for OutputLevel : new value = 2 PoolSvc DEBUG Service base class initialized successfully PoolSvc INFO Set connectionsvc retry/timeout/IDLE timeout to 'ConnectionRetrialPeriod':300/ 'ConnectionRetrialTimeOut':3600/ 'ConnectionTimeOut':5 seconds with connection cleanup disabled PoolSvc INFO Frontier compression level set to 5 -DBReplicaSvc INFO Frontier server at (serverurl=http://atlasfrontier-local.cern.ch:8000/atlr)(serverurl=http://atlasfrontier-ai.cern.ch:8000/atlr)(serverurl=http://lcgft-atlas.gridpp.rl.ac.uk:3128/frontierATLAS)(serverurl=http://ccfrontier.in2p3.fr:23128/ccin2p3-AtlasFrontier)(proxyurl=http://ca-proxy.cern.ch:3128)(proxyurl=http://ca-proxy-meyrin.cern.ch:3128)(proxyurl=http://ca-proxy-wigner.cern.ch:3128) will be considered for COOL data -DBReplicaSvc INFO Read replica configuration from /cvmfs/atlas-nightlies.cern.ch/repo/sw/master/2018-07-17T2058/Athena/22.0.1/InstallArea/x86_64-slc6-gcc62-opt/share/dbreplica.config -DBReplicaSvc INFO Total of 10 servers found for host lxplus052.cern.ch [ATLF ATLAS_COOLPROD atlas_dd ATLAS_CONFIG INT8R INTR ATONR_COOL ATONR_CONF DEVDB11 ATLF ] +DBReplicaSvc INFO Frontier server at (serverurl=http://atlasfrontier-local.cern.ch:8000/atlr)(serverurl=http://atlasfrontier-ai.cern.ch:8000/atlr)(serverurl=http://lcgft-atlas.gridpp.rl.ac.uk:3128/frontierATLAS)(serverurl=http://ccfrontier.in2p3.fr:23128/ccin2p3-AtlasFrontier)(proxyurl=http://ca-proxy.cern.ch:3128)(proxyurl=http://ca-proxy-meyrin.cern.ch:3128)(proxyurl=http://ca-proxy-wigner.cern.ch:3128)(proxyurl=http://atlasbpfrontier.cern.ch:3127)(proxyurl=http://atlasbpfrontier.fnal.gov:3127) will be considered for COOL data +DBReplicaSvc INFO Read replica configuration from /cvmfs/atlas-nightlies.cern.ch/repo/sw/master/2018-10-18T2340/Athena/22.0.1/InstallArea/x86_64-slc6-gcc8-opt/share/dbreplica.config +DBReplicaSvc INFO Total of 10 servers found for host lxplus060.cern.ch [ATLF ATLAS_COOLPROD atlas_dd ATLAS_CONFIG INT8R INTR ATONR_COOL ATONR_CONF DEVDB11 ATLF ] PoolSvc INFO Successfully setup replica sorting algorithm PoolSvc DEBUG OutputLevel is PoolSvc INFO Setting up APR FileCatalog and Streams @@ -118,6 +118,7 @@ MetaDataHdr(Dat... DEBUG Opening MetaDataHdr(Dat... DEBUG attributes# = 1 MetaDataHdr(Dat... DEBUG Branch container 'DataHeader' MetaDataHdr(Dat... DEBUG Opened container MetaDataHdr(DataHeader) of type ROOT_Tree +ClassIDSvc INFO getRegistryEntries: read 2343 CLIDRegistry entries for module ALL EventPersistenc... INFO Added successfully Conversion service:AthenaPoolCnvSvc SimplePoolFile1... DEBUG --> Access DbContainer READ [ROOT_Tree] MetaDataHdrForm(DataHeaderForm) MetaDataHdrForm... DEBUG Opening @@ -143,7 +144,7 @@ WriteTag INFO in initialize() MagicWriteTag INFO in initialize() Stream1 DEBUG Property update for OutputLevel : new value = 2 Stream1.Stream1... DEBUG Property update for OutputLevel : new value = 2 -ClassIDSvc INFO getRegistryEntries: read 2045 CLIDRegistry entries for module ALL +ClassIDSvc INFO getRegistryEntries: read 2 CLIDRegistry entries for module ALL Stream1 DEBUG In initialize Stream1 DEBUG Found IDecisionSvc. DecisionSvc INFO Inserting stream: Stream1 with no Algs @@ -170,7 +171,7 @@ Stream1 DEBUG Adding private ToolHandle tool Stream1.Stream1Tool (At Stream1 DEBUG Data Deps for Stream1 RegStream1 DEBUG Property update for OutputLevel : new value = 2 RegStream1.RegS... DEBUG Property update for OutputLevel : new value = 2 -ClassIDSvc INFO getRegistryEntries: read 336 CLIDRegistry entries for module ALL +ClassIDSvc INFO getRegistryEntries: read 337 CLIDRegistry entries for module ALL RegStream1 DEBUG In initialize RegStream1 DEBUG Found IDecisionSvc. DecisionSvc INFO Inserting stream: RegStream1 with no Algs @@ -193,6 +194,11 @@ AthenaEventLoopMgr INFO Setup EventSelector service EventSelector ApplicationMgr INFO Application Manager Initialized successfully EventSelector DEBUG Try item: "SimplePoolFile1.root" from the collection list. ApplicationMgr INFO Application Manager Started successfully +RootDatabase.se... DEBUG Request tree cache +RootDatabase.se... DEBUG File name SimplePoolFile1.root +RootDatabase.se... DEBUG Got tree CollectionTree read entry -1 +RootDatabase.se... DEBUG Using Tree cache. Size: -1 Nevents to learn with: -1 +AthenaPoolCnvSvc DEBUG setAttribute TREE_CACHE to -1 for db: SimplePoolFile1.root and cont: CollectionTree MetaDataSvc DEBUG handle() BeginInputFile for SimplePoolFile1.root MetaDataSvc DEBUG initInputMetaDataStore: file name SimplePoolFile1.root MetaDataSvc DEBUG Loaded input meta data store proxies @@ -222,7 +228,6 @@ CollectionTree(... DEBUG attributes# = 1 CollectionTree(... DEBUG Branch container 'EventInfo_p4_McEventInfo' CollectionTree(... DEBUG Opened container CollectionTree(EventInfo_p4/McEventInfo) of type ROOT_Tree AthenaPoolConve... INFO massageEventInfo: unable to get OverrideRunNumberFromInput property from EventSelector -ClassIDSvc INFO getRegistryEntries: read 15 CLIDRegistry entries for module ALL AthenaEventLoopMgr INFO ===>>> start of run 1 <<<=== AthenaEventLoopMgr INFO ===>>> start processing event #0, run #1 0 events processed so far <<<=== ReadData DEBUG in execute() @@ -256,7 +261,6 @@ ReadData INFO Hit x = 20.4945 y = 63.5816 z = 48.1358 detector = Dum ReadData INFO Hit x = 23.7045 y = 57.9027 z = 46.3159 detector = DummyHitDetector ReadData INFO Hit x = 26.9145 y = 52.2238 z = 44.9265 detector = DummyHitDetector ReadData INFO Hit x = 30.1245 y = 46.5449 z = 43.831 detector = DummyHitDetector -ClassIDSvc INFO getRegistryEntries: read 10 CLIDRegistry entries for module ALL ReWriteData DEBUG in execute() ReWriteData INFO Hit x = 1.2345 y = 97.655 z = 226.672 detector = DummyHitDetector ReWriteData INFO Hit x = 4.4445 y = 91.9761 z = 94.7318 detector = DummyHitDetector @@ -315,6 +319,7 @@ SimplePoolFile3... DEBUG --->Adding Assoc :????/##Params [200] (2 , ffffffff) SimplePoolFile3... DEBUG ---->ClassID:???? ##Params DEBUG No objects passing selection criteria... Container has 0 Entries in total. AthenaPoolCnvSvc DEBUG setAttribute CONTAINER_SPLITLEVEL to 99 for db: SimplePoolFile3.root and cont: TTree=POOLContainerForm(DataHeaderForm) +ClassIDSvc INFO getRegistryEntries: read 25 CLIDRegistry entries for module ALL Stream1 DEBUG addItemObjects(2101,"*") called Stream1 DEBUG Key:* Stream1 DEBUG Added object 2101,"McEventInfo" @@ -1916,6 +1921,7 @@ RegStream1 DEBUG Setting tagKey to MagicTag RegStream1 DEBUG Not class requested by Tool, skipping (222376821,"Stream1") AthenaEventLoopMgr INFO ===>>> done processing event #19, run #1 20 events processed so far <<<=== MetaDataSvc DEBUG handle() EndInputFile for FID:???? +EventSelector INFO Disconnecting input sourceID: ???? Domain[ROOT_All] INFO -> Deaccess DbDatabase READ [ROOT_All] ???? Domain[ROOT_All] INFO > Deaccess DbDomain READ [ROOT_All] MetaDataSvc DEBUG handle() LastInputFile for end @@ -1978,11 +1984,11 @@ ToolSvc INFO Removing all tools created by ToolSvc *****Chrono***** INFO **************************************************************************************************** commitOutput INFO Time User : Tot= 0 [us] Ave/Min/Max= 0(+- 0)/ 0/ 0 [us] #= 21 cRep_ALL INFO Time User : Tot= 0 [us] Ave/Min/Max= 0(+- 0)/ 0/ 0 [us] #= 62 -cObjR_ALL INFO Time User : Tot= 0 [us] Ave/Min/Max= 0(+- 0)/ 0/ 0 [us] #= 66 -cRepR_ALL INFO Time User : Tot= 20 [ms] Ave/Min/Max=0.123(+- 1.56)/ 0/ 20 [ms] #=163 -fRep_ALL INFO Time User : Tot= 30 [ms] Ave/Min/Max=0.484(+- 2.8)/ 0/ 20 [ms] #= 62 -cObj_ALL INFO Time User : Tot= 30 [ms] Ave/Min/Max=0.476(+- 2.13)/ 0/ 10 [ms] #= 63 -ChronoStatSvc INFO Time User : Tot= 0.89 [s] #= 1 +cObjR_ALL INFO Time User : Tot= 10 [ms] Ave/Min/Max=0.152(+- 1.22)/ 0/ 10 [ms] #= 66 +fRep_ALL INFO Time User : Tot= 20 [ms] Ave/Min/Max=0.323(+- 1.77)/ 0/ 10 [ms] #= 62 +cRepR_ALL INFO Time User : Tot= 20 [ms] Ave/Min/Max=0.123(+- 1.1)/ 0/ 10 [ms] #=163 +cObj_ALL INFO Time User : Tot= 40 [ms] Ave/Min/Max=0.635(+- 2.44)/ 0/ 10 [ms] #= 63 +ChronoStatSvc INFO Time User : Tot= 0.96 [s] #= 1 *****Chrono***** INFO **************************************************************************************************** ChronoStatSvc.f... INFO Service finalized successfully ApplicationMgr INFO Application Manager Finalized successfully diff --git a/Database/AthenaPOOL/AthenaPoolExample/AthenaPoolExampleAlgorithms/share/AthenaPoolExample_ReWriteAgain.ref b/Database/AthenaPOOL/AthenaPoolExample/AthenaPoolExampleAlgorithms/share/AthenaPoolExample_ReWriteAgain.ref index 01051bf9a6d5f309db01d94c5c1787f8067dd0b1..fc3ee51601d964b6883fcf9351605c6836819351 100644 --- a/Database/AthenaPOOL/AthenaPoolExample/AthenaPoolExampleAlgorithms/share/AthenaPoolExample_ReWriteAgain.ref +++ b/Database/AthenaPOOL/AthenaPoolExample/AthenaPoolExampleAlgorithms/share/AthenaPoolExample_ReWriteAgain.ref @@ -1,19 +1,19 @@ -Wed Jul 18 18:50:57 CEST 2018 +Fri Oct 19 21:07:30 CEST 2018 Preloading tcmalloc_minimal.so Athena INFO including file "AthenaCommon/Preparation.py" Athena INFO including file "AthenaCommon/Atlas.UnixStandardJob.py" Athena INFO executing ROOT6Setup Athena INFO including file "AthenaCommon/Execution.py" Athena INFO including file "AthenaPoolExampleAlgorithms/AthenaPoolExample_ReWriteAgainJobOptions.py" -Py:ConfigurableDb INFO Read module info for 5511 configurables from 52 genConfDb files +Py:ConfigurableDb INFO Read module info for 5521 configurables from 57 genConfDb files Py:ConfigurableDb INFO No duplicates have been found: that's good ! Athena INFO including file "AthenaCommon/runbatch.py" [?1034hApplicationMgr INFO Updating Gaudi::PluginService::SetDebug(level) to level= 'PluginDebugLevel':0 ApplicationMgr INFO Updating Gaudi::PluginService::SetDebug(level) to level= 'PluginDebugLevel':0 ApplicationMgr SUCCESS ==================================================================================================================================== - Welcome to ApplicationMgr (GaudiCoreSvc v30r2) - running on lxplus052.cern.ch on Wed Jul 18 18:51:05 2018 + Welcome to ApplicationMgr (GaudiCoreSvc v30r3) + running on lxplus060.cern.ch on Fri Oct 19 21:07:46 2018 ==================================================================================================================================== ApplicationMgr INFO Successfully loaded modules : AthenaServices ApplicationMgr INFO Application Manager Configured successfully @@ -21,10 +21,10 @@ ApplicationMgr INFO Updating Gaudi::PluginService::SetDebug(level) to leve StatusCodeSvc INFO initialize AthDictLoaderSvc INFO in initialize... AthDictLoaderSvc INFO acquired Dso-registry -ClassIDSvc INFO getRegistryEntries: read 2428 CLIDRegistry entries for module ALL +ClassIDSvc INFO getRegistryEntries: read 2946 CLIDRegistry entries for module ALL CoreDumpSvc INFO install f-a-t-a-l handler... (flag = -1) AthenaEventLoopMgr INFO Initializing AthenaEventLoopMgr - package version AthenaServices-00-00-00 -ClassIDSvc INFO getRegistryEntries: read 916 CLIDRegistry entries for module ALL +ClassIDSvc INFO getRegistryEntries: read 836 CLIDRegistry entries for module ALL ReadData DEBUG Property update for OutputLevel : new value = 2 ReadData INFO in initialize() MetaDataSvc DEBUG Property update for OutputLevel : new value = 2 @@ -36,9 +36,9 @@ PoolSvc DEBUG Property update for OutputLevel : new value = 2 PoolSvc DEBUG Service base class initialized successfully PoolSvc INFO Set connectionsvc retry/timeout/IDLE timeout to 'ConnectionRetrialPeriod':300/ 'ConnectionRetrialTimeOut':3600/ 'ConnectionTimeOut':5 seconds with connection cleanup disabled PoolSvc INFO Frontier compression level set to 5 -DBReplicaSvc INFO Frontier server at (serverurl=http://atlasfrontier-local.cern.ch:8000/atlr)(serverurl=http://atlasfrontier-ai.cern.ch:8000/atlr)(serverurl=http://lcgft-atlas.gridpp.rl.ac.uk:3128/frontierATLAS)(serverurl=http://ccfrontier.in2p3.fr:23128/ccin2p3-AtlasFrontier)(proxyurl=http://ca-proxy.cern.ch:3128)(proxyurl=http://ca-proxy-meyrin.cern.ch:3128)(proxyurl=http://ca-proxy-wigner.cern.ch:3128) will be considered for COOL data -DBReplicaSvc INFO Read replica configuration from /cvmfs/atlas-nightlies.cern.ch/repo/sw/master/2018-07-17T2058/Athena/22.0.1/InstallArea/x86_64-slc6-gcc62-opt/share/dbreplica.config -DBReplicaSvc INFO Total of 10 servers found for host lxplus052.cern.ch [ATLF ATLAS_COOLPROD atlas_dd ATLAS_CONFIG INT8R INTR ATONR_COOL ATONR_CONF DEVDB11 ATLF ] +DBReplicaSvc INFO Frontier server at (serverurl=http://atlasfrontier-local.cern.ch:8000/atlr)(serverurl=http://atlasfrontier-ai.cern.ch:8000/atlr)(serverurl=http://lcgft-atlas.gridpp.rl.ac.uk:3128/frontierATLAS)(serverurl=http://ccfrontier.in2p3.fr:23128/ccin2p3-AtlasFrontier)(proxyurl=http://ca-proxy.cern.ch:3128)(proxyurl=http://ca-proxy-meyrin.cern.ch:3128)(proxyurl=http://ca-proxy-wigner.cern.ch:3128)(proxyurl=http://atlasbpfrontier.cern.ch:3127)(proxyurl=http://atlasbpfrontier.fnal.gov:3127) will be considered for COOL data +DBReplicaSvc INFO Read replica configuration from /cvmfs/atlas-nightlies.cern.ch/repo/sw/master/2018-10-18T2340/Athena/22.0.1/InstallArea/x86_64-slc6-gcc8-opt/share/dbreplica.config +DBReplicaSvc INFO Total of 10 servers found for host lxplus060.cern.ch [ATLF ATLAS_COOLPROD atlas_dd ATLAS_CONFIG INT8R INTR ATONR_COOL ATONR_CONF DEVDB11 ATLF ] PoolSvc INFO Successfully setup replica sorting algorithm PoolSvc DEBUG OutputLevel is PoolSvc INFO Setting up APR FileCatalog and Streams @@ -112,6 +112,7 @@ MetaDataHdr(Dat... DEBUG Opening MetaDataHdr(Dat... DEBUG attributes# = 1 MetaDataHdr(Dat... DEBUG Branch container 'DataHeader' MetaDataHdr(Dat... DEBUG Opened container MetaDataHdr(DataHeader) of type ROOT_Tree +ClassIDSvc INFO getRegistryEntries: read 2340 CLIDRegistry entries for module ALL EventPersistenc... INFO Added successfully Conversion service:AthenaPoolCnvSvc SimplePoolRepli... DEBUG --> Access DbContainer READ [ROOT_Tree] MetaDataHdrForm(DataHeaderForm) MetaDataHdrForm... DEBUG Opening @@ -137,7 +138,7 @@ WriteTag INFO in initialize() MagicWriteTag INFO in initialize() Stream1 DEBUG Property update for OutputLevel : new value = 2 Stream1.Stream1... DEBUG Property update for OutputLevel : new value = 2 -ClassIDSvc INFO getRegistryEntries: read 2042 CLIDRegistry entries for module ALL +ClassIDSvc INFO getRegistryEntries: read 2 CLIDRegistry entries for module ALL Stream1 DEBUG In initialize Stream1 DEBUG Found IDecisionSvc. DecisionSvc INFO Inserting stream: Stream1 with no Algs @@ -164,7 +165,7 @@ Stream1 DEBUG Adding private ToolHandle tool Stream1.Stream1Tool (At Stream1 DEBUG Data Deps for Stream1 RegStream1 DEBUG Property update for OutputLevel : new value = 2 RegStream1.RegS... DEBUG Property update for OutputLevel : new value = 2 -ClassIDSvc INFO getRegistryEntries: read 336 CLIDRegistry entries for module ALL +ClassIDSvc INFO getRegistryEntries: read 337 CLIDRegistry entries for module ALL RegStream1 DEBUG In initialize RegStream1 DEBUG Found IDecisionSvc. DecisionSvc INFO Inserting stream: RegStream1 with no Algs @@ -244,6 +245,11 @@ POOLContainer(D... DEBUG attributes# = 1 POOLContainer(D... DEBUG Branch container 'DataHeader' POOLContainer(D... DEBUG Opened container POOLContainer(DataHeader) of type ROOT_Tree ApplicationMgr INFO Application Manager Started successfully +RootDatabase.se... DEBUG Request tree cache +RootDatabase.se... DEBUG File name SimplePoolReplica1.root +RootDatabase.se... DEBUG Got tree CollectionTree read entry -1 +RootDatabase.se... DEBUG Using Tree cache. Size: -1 Nevents to learn with: -1 +AthenaPoolCnvSvc DEBUG setAttribute TREE_CACHE to -1 for db: SimplePoolReplica1.root and cont: CollectionTree MetaDataSvc DEBUG handle() BeginInputFile for SimplePoolReplica1.root MetaDataSvc DEBUG initInputMetaDataStore: file name SimplePoolReplica1.root SimplePoolRepli... DEBUG --> Access DbContainer READ [ROOT_Tree] MetaDataHdr(DataHeader) @@ -273,7 +279,6 @@ CollectionTree(... DEBUG attributes# = 1 CollectionTree(... DEBUG Branch container 'EventInfo_p4_McEventInfo' CollectionTree(... DEBUG Opened container CollectionTree(EventInfo_p4/McEventInfo) of type ROOT_Tree AthenaPoolConve... INFO massageEventInfo: unable to get OverrideRunNumberFromInput property from EventSelector -ClassIDSvc INFO getRegistryEntries: read 15 CLIDRegistry entries for module ALL AthenaEventLoopMgr INFO ===>>> start of run 1 <<<=== AthenaEventLoopMgr INFO ===>>> start processing event #0, run #1 0 events processed so far <<<=== ReadData DEBUG in execute() @@ -307,7 +312,6 @@ ReadData INFO Hit x = 20.4945 y = 63.5816 z = 48.1358 detector = Dum ReadData INFO Hit x = 23.7045 y = 57.9027 z = 46.3159 detector = DummyHitDetector ReadData INFO Hit x = 26.9145 y = 52.2238 z = 44.9265 detector = DummyHitDetector ReadData INFO Hit x = 30.1245 y = 46.5449 z = 43.831 detector = DummyHitDetector -ClassIDSvc INFO getRegistryEntries: read 10 CLIDRegistry entries for module ALL ReWriteData DEBUG in execute() ReWriteData INFO Hit x = 1.2345 y = 97.655 z = 226.672 detector = DummyHitDetector ReWriteData INFO Hit x = 4.4445 y = 91.9761 z = 94.7318 detector = DummyHitDetector @@ -365,6 +369,7 @@ SimplePoolFile3... DEBUG --->Adding Assoc :????/##Params [200] (2 , ffffffff) SimplePoolFile3... DEBUG ---->ClassID:???? ##Params DEBUG No objects passing selection criteria... Container has 0 Entries in total. AthenaPoolCnvSvc DEBUG setAttribute CONTAINER_SPLITLEVEL to 99 for db: SimplePoolFile3.root and cont: TTree=POOLContainerForm(DataHeaderForm) +ClassIDSvc INFO getRegistryEntries: read 25 CLIDRegistry entries for module ALL Stream1 DEBUG addItemObjects(2101,"*") called Stream1 DEBUG Key:* Stream1 DEBUG Added object 2101,"McEventInfo" @@ -456,7 +461,6 @@ SimplePoolFile3... DEBUG --->Adding Assoc :????/POOLCollectionTree(MagicNumber) SimplePoolFile3... DEBUG ---->ClassID:???? AthenaPoolCnvSvc DEBUG setAttribute BRANCH_BASKET_SIZE to 256000 for db: SimplePoolFile3.root and cont: POOLContainer(DataHeader) AthenaPoolCnvSvc DEBUG setAttribute BRANCH_BASKET_SIZE to 1024000 for db: SimplePoolFile3.root and cont: POOLContainerForm(DataHeaderForm) -ClassIDSvc INFO getRegistryEntries: read 3 CLIDRegistry entries for module ALL RegStream1 DEBUG RegistrationStream execute RegStream1 DEBUG getRefs: Not DataHeader, skipping (40774349,"MagicTag") RegStream1 DEBUG get ref for (222376821,"Stream1") @@ -529,6 +533,7 @@ WriteTag INFO EventInfo event: 1 run: 1 WriteTag INFO registered all data MagicWriteTag INFO EventInfo event: 1 run: 1 MagicWriteTag INFO registered all data +ClassIDSvc INFO getRegistryEntries: read 3 CLIDRegistry entries for module ALL Stream1 DEBUG addItemObjects(2101,"*") called Stream1 DEBUG Key:* Stream1 DEBUG Added object 2101,"McEventInfo" @@ -1973,6 +1978,7 @@ AthenaEventLoopMgr INFO ===>>> done processing event #19, run #1 20 events Domain[ROOT_All] INFO -> Deaccess DbDatabase READ [ROOT_All] ???? Domain[ROOT_All] INFO > Deaccess DbDomain READ [ROOT_All] MetaDataSvc DEBUG handle() EndInputFile for FID:???? +EventSelector INFO Disconnecting input sourceID: ???? MetaDataSvc DEBUG handle() LastInputFile for end AthenaEventLoopMgr INFO No more events in event selection Stream1 DEBUG handle() incident type: MetaDataStop @@ -2032,13 +2038,13 @@ ToolSvc INFO Removing all tools created by ToolSvc *****Chrono***** INFO **************************************************************************************************** *****Chrono***** INFO The Final CPU consumption ( Chrono ) Table (ordered) *****Chrono***** INFO **************************************************************************************************** +commitOutput INFO Time User : Tot= 0 [us] Ave/Min/Max= 0(+- 0)/ 0/ 0 [us] #= 21 cRep_ALL INFO Time User : Tot= 0 [us] Ave/Min/Max= 0(+- 0)/ 0/ 0 [us] #= 62 -commitOutput INFO Time User : Tot= 10 [ms] Ave/Min/Max=0.476(+- 2.13)/ 0/ 10 [ms] #= 21 cObjR_ALL INFO Time User : Tot= 10 [ms] Ave/Min/Max=0.154(+- 1.23)/ 0/ 10 [ms] #= 65 -fRep_ALL INFO Time User : Tot= 30 [ms] Ave/Min/Max=0.484(+- 2.8)/ 0/ 20 [ms] #= 62 -cObj_ALL INFO Time User : Tot= 30 [ms] Ave/Min/Max=0.476(+- 2.13)/ 0/ 10 [ms] #= 63 -cRepR_ALL INFO Time User : Tot= 30 [ms] Ave/Min/Max=0.184(+- 1.74)/ 0/ 20 [ms] #=163 -ChronoStatSvc INFO Time User : Tot= 0.91 [s] #= 1 +cRepR_ALL INFO Time User : Tot= 20 [ms] Ave/Min/Max=0.123(+- 1.56)/ 0/ 20 [ms] #=163 +fRep_ALL INFO Time User : Tot= 40 [ms] Ave/Min/Max=0.645(+- 3.04)/ 0/ 20 [ms] #= 62 +cObj_ALL INFO Time User : Tot= 40 [ms] Ave/Min/Max=0.635(+- 3.02)/ 0/ 20 [ms] #= 63 +ChronoStatSvc INFO Time User : Tot= 1.12 [s] #= 1 *****Chrono***** INFO **************************************************************************************************** ChronoStatSvc.f... INFO Service finalized successfully ApplicationMgr INFO Application Manager Finalized successfully diff --git a/Database/AthenaPOOL/AthenaPoolExample/AthenaPoolExampleAlgorithms/share/AthenaPoolExample_ReWriteNext.ref b/Database/AthenaPOOL/AthenaPoolExample/AthenaPoolExampleAlgorithms/share/AthenaPoolExample_ReWriteNext.ref index 54dd59069d7e3c9dced8b1ec58b6d0f0d1a43175..2e5e28b1cd6430d37c18a46788ce3a94d4128bb7 100644 --- a/Database/AthenaPOOL/AthenaPoolExample/AthenaPoolExampleAlgorithms/share/AthenaPoolExample_ReWriteNext.ref +++ b/Database/AthenaPOOL/AthenaPoolExample/AthenaPoolExampleAlgorithms/share/AthenaPoolExample_ReWriteNext.ref @@ -1,19 +1,19 @@ -Wed Jul 18 18:51:08 CEST 2018 +Fri Oct 19 21:15:56 CEST 2018 Preloading tcmalloc_minimal.so Athena INFO including file "AthenaCommon/Preparation.py" Athena INFO including file "AthenaCommon/Atlas.UnixStandardJob.py" Athena INFO executing ROOT6Setup Athena INFO including file "AthenaCommon/Execution.py" Athena INFO including file "AthenaPoolExampleAlgorithms/AthenaPoolExample_ReWriteNextJobOptions.py" -Py:ConfigurableDb INFO Read module info for 5511 configurables from 52 genConfDb files +Py:ConfigurableDb INFO Read module info for 5521 configurables from 57 genConfDb files Py:ConfigurableDb INFO No duplicates have been found: that's good ! Athena INFO including file "AthenaCommon/runbatch.py" [?1034hApplicationMgr INFO Updating Gaudi::PluginService::SetDebug(level) to level= 'PluginDebugLevel':0 ApplicationMgr INFO Updating Gaudi::PluginService::SetDebug(level) to level= 'PluginDebugLevel':0 ApplicationMgr SUCCESS ==================================================================================================================================== - Welcome to ApplicationMgr (GaudiCoreSvc v30r2) - running on lxplus052.cern.ch on Wed Jul 18 18:51:17 2018 + Welcome to ApplicationMgr (GaudiCoreSvc v30r3) + running on lxplus060.cern.ch on Fri Oct 19 21:16:21 2018 ==================================================================================================================================== ApplicationMgr INFO Successfully loaded modules : AthenaServices ApplicationMgr INFO Application Manager Configured successfully @@ -21,10 +21,10 @@ ApplicationMgr INFO Updating Gaudi::PluginService::SetDebug(level) to leve StatusCodeSvc INFO initialize AthDictLoaderSvc INFO in initialize... AthDictLoaderSvc INFO acquired Dso-registry -ClassIDSvc INFO getRegistryEntries: read 2428 CLIDRegistry entries for module ALL +ClassIDSvc INFO getRegistryEntries: read 2946 CLIDRegistry entries for module ALL CoreDumpSvc INFO install f-a-t-a-l handler... (flag = -1) AthenaEventLoopMgr INFO Initializing AthenaEventLoopMgr - package version AthenaServices-00-00-00 -ClassIDSvc INFO getRegistryEntries: read 916 CLIDRegistry entries for module ALL +ClassIDSvc INFO getRegistryEntries: read 836 CLIDRegistry entries for module ALL ReadData DEBUG Property update for OutputLevel : new value = 2 ReadData INFO in initialize() MetaDataSvc DEBUG Property update for OutputLevel : new value = 2 @@ -36,9 +36,9 @@ PoolSvc DEBUG Property update for OutputLevel : new value = 2 PoolSvc DEBUG Service base class initialized successfully PoolSvc INFO Set connectionsvc retry/timeout/IDLE timeout to 'ConnectionRetrialPeriod':300/ 'ConnectionRetrialTimeOut':3600/ 'ConnectionTimeOut':5 seconds with connection cleanup disabled PoolSvc INFO Frontier compression level set to 5 -DBReplicaSvc INFO Frontier server at (serverurl=http://atlasfrontier-local.cern.ch:8000/atlr)(serverurl=http://atlasfrontier-ai.cern.ch:8000/atlr)(serverurl=http://lcgft-atlas.gridpp.rl.ac.uk:3128/frontierATLAS)(serverurl=http://ccfrontier.in2p3.fr:23128/ccin2p3-AtlasFrontier)(proxyurl=http://ca-proxy.cern.ch:3128)(proxyurl=http://ca-proxy-meyrin.cern.ch:3128)(proxyurl=http://ca-proxy-wigner.cern.ch:3128) will be considered for COOL data -DBReplicaSvc INFO Read replica configuration from /cvmfs/atlas-nightlies.cern.ch/repo/sw/master/2018-07-17T2058/Athena/22.0.1/InstallArea/x86_64-slc6-gcc62-opt/share/dbreplica.config -DBReplicaSvc INFO Total of 10 servers found for host lxplus052.cern.ch [ATLF ATLAS_COOLPROD atlas_dd ATLAS_CONFIG INT8R INTR ATONR_COOL ATONR_CONF DEVDB11 ATLF ] +DBReplicaSvc INFO Frontier server at (serverurl=http://atlasfrontier-local.cern.ch:8000/atlr)(serverurl=http://atlasfrontier-ai.cern.ch:8000/atlr)(serverurl=http://lcgft-atlas.gridpp.rl.ac.uk:3128/frontierATLAS)(serverurl=http://ccfrontier.in2p3.fr:23128/ccin2p3-AtlasFrontier)(proxyurl=http://ca-proxy.cern.ch:3128)(proxyurl=http://ca-proxy-meyrin.cern.ch:3128)(proxyurl=http://ca-proxy-wigner.cern.ch:3128)(proxyurl=http://atlasbpfrontier.cern.ch:3127)(proxyurl=http://atlasbpfrontier.fnal.gov:3127) will be considered for COOL data +DBReplicaSvc INFO Read replica configuration from /cvmfs/atlas-nightlies.cern.ch/repo/sw/master/2018-10-18T2340/Athena/22.0.1/InstallArea/x86_64-slc6-gcc8-opt/share/dbreplica.config +DBReplicaSvc INFO Total of 10 servers found for host lxplus060.cern.ch [ATLF ATLAS_COOLPROD atlas_dd ATLAS_CONFIG INT8R INTR ATONR_COOL ATONR_CONF DEVDB11 ATLF ] PoolSvc INFO Successfully setup replica sorting algorithm PoolSvc DEBUG OutputLevel is PoolSvc INFO Setting up APR FileCatalog and Streams @@ -118,6 +118,7 @@ MetaDataHdr(Dat... DEBUG Opening MetaDataHdr(Dat... DEBUG attributes# = 1 MetaDataHdr(Dat... DEBUG Branch container 'DataHeader' MetaDataHdr(Dat... DEBUG Opened container MetaDataHdr(DataHeader) of type ROOT_Tree +ClassIDSvc INFO getRegistryEntries: read 2343 CLIDRegistry entries for module ALL EventPersistenc... INFO Added successfully Conversion service:AthenaPoolCnvSvc SimplePoolFile3... DEBUG --> Access DbContainer READ [ROOT_Tree] MetaDataHdrForm(DataHeaderForm) MetaDataHdrForm... DEBUG Opening @@ -143,7 +144,7 @@ WriteTag INFO in initialize() MagicWriteTag INFO in initialize() Stream1 DEBUG Property update for OutputLevel : new value = 2 Stream1.Stream1... DEBUG Property update for OutputLevel : new value = 2 -ClassIDSvc INFO getRegistryEntries: read 2045 CLIDRegistry entries for module ALL +ClassIDSvc INFO getRegistryEntries: read 2 CLIDRegistry entries for module ALL Stream1 DEBUG In initialize Stream1 DEBUG Found IDecisionSvc. DecisionSvc INFO Inserting stream: Stream1 with no Algs @@ -170,7 +171,7 @@ Stream1 DEBUG Adding private ToolHandle tool Stream1.Stream1Tool (At Stream1 DEBUG Data Deps for Stream1 RegStream1 DEBUG Property update for OutputLevel : new value = 2 RegStream1.RegS... DEBUG Property update for OutputLevel : new value = 2 -ClassIDSvc INFO getRegistryEntries: read 336 CLIDRegistry entries for module ALL +ClassIDSvc INFO getRegistryEntries: read 337 CLIDRegistry entries for module ALL RegStream1 DEBUG In initialize RegStream1 DEBUG Found IDecisionSvc. DecisionSvc INFO Inserting stream: RegStream1 with no Algs @@ -193,6 +194,11 @@ AthenaEventLoopMgr INFO Setup EventSelector service EventSelector ApplicationMgr INFO Application Manager Initialized successfully EventSelector DEBUG Try item: "SimplePoolFile3.root" from the collection list. ApplicationMgr INFO Application Manager Started successfully +RootDatabase.se... DEBUG Request tree cache +RootDatabase.se... DEBUG File name SimplePoolFile3.root +RootDatabase.se... DEBUG Got tree CollectionTree read entry -1 +RootDatabase.se... DEBUG Using Tree cache. Size: -1 Nevents to learn with: -1 +AthenaPoolCnvSvc DEBUG setAttribute TREE_CACHE to -1 for db: SimplePoolFile3.root and cont: CollectionTree MetaDataSvc DEBUG handle() BeginInputFile for SimplePoolFile3.root MetaDataSvc DEBUG initInputMetaDataStore: file name SimplePoolFile3.root MetaDataSvc DEBUG Loaded input meta data store proxies @@ -222,7 +228,6 @@ CollectionTree(... DEBUG attributes# = 1 CollectionTree(... DEBUG Branch container 'EventInfo_p4_McEventInfo' CollectionTree(... DEBUG Opened container CollectionTree(EventInfo_p4/McEventInfo) of type ROOT_Tree AthenaPoolConve... INFO massageEventInfo: unable to get OverrideRunNumberFromInput property from EventSelector -ClassIDSvc INFO getRegistryEntries: read 15 CLIDRegistry entries for module ALL AthenaEventLoopMgr INFO ===>>> start of run 1 <<<=== AthenaEventLoopMgr INFO ===>>> start processing event #0, run #1 0 events processed so far <<<=== ReadData DEBUG in execute() @@ -251,7 +256,6 @@ ReadData INFO Could not find ExampleHitContainer/MyHits ReWriteData DEBUG in execute() ReWriteData INFO registered all data WriteTag INFO EventInfo event: 0 run: 1 -ClassIDSvc INFO getRegistryEntries: read 10 CLIDRegistry entries for module ALL WriteTag INFO registered all data MagicWriteTag INFO EventInfo event: 0 run: 1 MagicWriteTag INFO registered all data @@ -283,6 +287,7 @@ SimplePoolFile4... DEBUG --->Adding Assoc :????/##Params [200] (2 , ffffffff) SimplePoolFile4... DEBUG ---->ClassID:???? ##Params DEBUG No objects passing selection criteria... Container has 0 Entries in total. AthenaPoolCnvSvc DEBUG setAttribute CONTAINER_SPLITLEVEL to 99 for db: SimplePoolFile4.root and cont: TTree=POOLContainerForm(DataHeaderForm) +ClassIDSvc INFO getRegistryEntries: read 25 CLIDRegistry entries for module ALL Stream1 DEBUG addItemObjects(2101,"*") called Stream1 DEBUG Key:* Stream1 DEBUG Added object 2101,"McEventInfo" @@ -1314,6 +1319,7 @@ RegStream1 DEBUG Setting tagKey to MagicTag RegStream1 DEBUG Not class requested by Tool, skipping (222376821,"Stream1") AthenaEventLoopMgr INFO ===>>> done processing event #19, run #1 20 events processed so far <<<=== MetaDataSvc DEBUG handle() EndInputFile for FID:???? +EventSelector INFO Disconnecting input sourceID: ???? Domain[ROOT_All] INFO -> Deaccess DbDatabase READ [ROOT_All] ???? Domain[ROOT_All] INFO > Deaccess DbDomain READ [ROOT_All] MetaDataSvc DEBUG handle() LastInputFile for end @@ -1375,12 +1381,12 @@ ToolSvc INFO Removing all tools created by ToolSvc *****Chrono***** INFO The Final CPU consumption ( Chrono ) Table (ordered) *****Chrono***** INFO **************************************************************************************************** cRep_ALL INFO Time User : Tot= 0 [us] Ave/Min/Max= 0(+- 0)/ 0/ 0 [us] #= 62 -cRepR_ALL INFO Time User : Tot= 0 [us] Ave/Min/Max= 0(+- 0)/ 0/ 0 [us] #=163 commitOutput INFO Time User : Tot= 0 [us] Ave/Min/Max= 0(+- 0)/ 0/ 0 [us] #= 21 +cObjR_ALL INFO Time User : Tot= 10 [ms] Ave/Min/Max=0.154(+- 1.23)/ 0/ 10 [ms] #= 65 +cRepR_ALL INFO Time User : Tot= 10 [ms] Ave/Min/Max=0.0613(+-0.781)/ 0/ 10 [ms] #=163 fRep_ALL INFO Time User : Tot= 20 [ms] Ave/Min/Max=0.323(+- 1.77)/ 0/ 10 [ms] #= 62 -cObjR_ALL INFO Time User : Tot= 0 [us] Ave/Min/Max= 0(+- 0)/ 0/ 0 [us] #= 65 -cObj_ALL INFO Time User : Tot= 20 [ms] Ave/Min/Max=0.317(+- 1.75)/ 0/ 10 [ms] #= 63 -ChronoStatSvc INFO Time User : Tot= 0.9 [s] #= 1 +cObj_ALL INFO Time User : Tot= 40 [ms] Ave/Min/Max=0.635(+- 3.51)/ 0/ 20 [ms] #= 63 +ChronoStatSvc INFO Time User : Tot= 1.16 [s] #= 1 *****Chrono***** INFO **************************************************************************************************** ChronoStatSvc.f... INFO Service finalized successfully ApplicationMgr INFO Application Manager Finalized successfully diff --git a/Database/AthenaPOOL/AthenaPoolExample/AthenaPoolExampleAlgorithms/share/AthenaPoolExample_Read.ref b/Database/AthenaPOOL/AthenaPoolExample/AthenaPoolExampleAlgorithms/share/AthenaPoolExample_Read.ref index 3e95edfc968b639ca611dd667728537cc1f488fd..f89f0d6e8b09228eb23d23d1c5c7a7e4c3780253 100644 --- a/Database/AthenaPOOL/AthenaPoolExample/AthenaPoolExampleAlgorithms/share/AthenaPoolExample_Read.ref +++ b/Database/AthenaPOOL/AthenaPoolExample/AthenaPoolExampleAlgorithms/share/AthenaPoolExample_Read.ref @@ -1,19 +1,19 @@ -Wed Jul 18 18:24:44 CEST 2018 +Fri Oct 19 20:57:10 CEST 2018 Preloading tcmalloc_minimal.so Athena INFO including file "AthenaCommon/Preparation.py" Athena INFO including file "AthenaCommon/Atlas.UnixStandardJob.py" Athena INFO executing ROOT6Setup Athena INFO including file "AthenaCommon/Execution.py" -Athena INFO including file "AthenaPoolExampleAlgorithms/AthenaPoolExample_ReadNoBNJobOptions.py" -Py:ConfigurableDb INFO Read module info for 5511 configurables from 52 genConfDb files +Athena INFO including file "AthenaPoolExampleAlgorithms/AthenaPoolExample_ReadJobOptions.py" +Py:ConfigurableDb INFO Read module info for 5521 configurables from 57 genConfDb files Py:ConfigurableDb INFO No duplicates have been found: that's good ! Athena INFO including file "AthenaCommon/runbatch.py" [?1034hApplicationMgr INFO Updating Gaudi::PluginService::SetDebug(level) to level= 'PluginDebugLevel':0 ApplicationMgr INFO Updating Gaudi::PluginService::SetDebug(level) to level= 'PluginDebugLevel':0 ApplicationMgr SUCCESS ==================================================================================================================================== - Welcome to ApplicationMgr (GaudiCoreSvc v30r2) - running on lxplus052.cern.ch on Wed Jul 18 18:24:53 2018 + Welcome to ApplicationMgr (GaudiCoreSvc v30r3) + running on lxplus060.cern.ch on Fri Oct 19 20:57:29 2018 ==================================================================================================================================== ApplicationMgr INFO Successfully loaded modules : AthenaServices ApplicationMgr INFO Application Manager Configured successfully @@ -21,10 +21,10 @@ ApplicationMgr INFO Updating Gaudi::PluginService::SetDebug(level) to leve StatusCodeSvc INFO initialize AthDictLoaderSvc INFO in initialize... AthDictLoaderSvc INFO acquired Dso-registry -ClassIDSvc INFO getRegistryEntries: read 2428 CLIDRegistry entries for module ALL +ClassIDSvc INFO getRegistryEntries: read 2946 CLIDRegistry entries for module ALL CoreDumpSvc INFO install f-a-t-a-l handler... (flag = -1) AthenaEventLoopMgr INFO Initializing AthenaEventLoopMgr - package version AthenaServices-00-00-00 -ClassIDSvc INFO getRegistryEntries: read 916 CLIDRegistry entries for module ALL +ClassIDSvc INFO getRegistryEntries: read 836 CLIDRegistry entries for module ALL ReadData DEBUG Property update for OutputLevel : new value = 2 ReadData INFO in initialize() MetaDataSvc DEBUG Property update for OutputLevel : new value = 2 @@ -35,9 +35,9 @@ PoolSvc DEBUG Property update for OutputLevel : new value = 2 PoolSvc DEBUG Service base class initialized successfully PoolSvc INFO Set connectionsvc retry/timeout/IDLE timeout to 'ConnectionRetrialPeriod':300/ 'ConnectionRetrialTimeOut':3600/ 'ConnectionTimeOut':5 seconds with connection cleanup disabled PoolSvc INFO Frontier compression level set to 5 -DBReplicaSvc INFO Frontier server at (serverurl=http://atlasfrontier-local.cern.ch:8000/atlr)(serverurl=http://atlasfrontier-ai.cern.ch:8000/atlr)(serverurl=http://lcgft-atlas.gridpp.rl.ac.uk:3128/frontierATLAS)(serverurl=http://ccfrontier.in2p3.fr:23128/ccin2p3-AtlasFrontier)(proxyurl=http://ca-proxy.cern.ch:3128)(proxyurl=http://ca-proxy-meyrin.cern.ch:3128)(proxyurl=http://ca-proxy-wigner.cern.ch:3128) will be considered for COOL data -DBReplicaSvc INFO Read replica configuration from /cvmfs/atlas-nightlies.cern.ch/repo/sw/master/2018-07-17T2058/Athena/22.0.1/InstallArea/x86_64-slc6-gcc62-opt/share/dbreplica.config -DBReplicaSvc INFO Total of 10 servers found for host lxplus052.cern.ch [ATLF ATLAS_COOLPROD atlas_dd ATLAS_CONFIG INT8R INTR ATONR_COOL ATONR_CONF DEVDB11 ATLF ] +DBReplicaSvc INFO Frontier server at (serverurl=http://atlasfrontier-local.cern.ch:8000/atlr)(serverurl=http://atlasfrontier-ai.cern.ch:8000/atlr)(serverurl=http://lcgft-atlas.gridpp.rl.ac.uk:3128/frontierATLAS)(serverurl=http://ccfrontier.in2p3.fr:23128/ccin2p3-AtlasFrontier)(proxyurl=http://ca-proxy.cern.ch:3128)(proxyurl=http://ca-proxy-meyrin.cern.ch:3128)(proxyurl=http://ca-proxy-wigner.cern.ch:3128)(proxyurl=http://atlasbpfrontier.cern.ch:3127)(proxyurl=http://atlasbpfrontier.fnal.gov:3127) will be considered for COOL data +DBReplicaSvc INFO Read replica configuration from /cvmfs/atlas-nightlies.cern.ch/repo/sw/master/2018-10-18T2340/Athena/22.0.1/InstallArea/x86_64-slc6-gcc8-opt/share/dbreplica.config +DBReplicaSvc INFO Total of 10 servers found for host lxplus060.cern.ch [ATLF ATLAS_COOLPROD atlas_dd ATLAS_CONFIG INT8R INTR ATONR_COOL ATONR_CONF DEVDB11 ATLF ] PoolSvc INFO Successfully setup replica sorting algorithm PoolSvc DEBUG OutputLevel is PoolSvc INFO Setting up APR FileCatalog and Streams @@ -161,6 +161,7 @@ MetaDataHdr(Dat... DEBUG Opening MetaDataHdr(Dat... DEBUG attributes# = 1 MetaDataHdr(Dat... DEBUG Branch container 'DataHeader' MetaDataHdr(Dat... DEBUG Opened container MetaDataHdr(DataHeader) of type ROOT_Tree +ClassIDSvc INFO getRegistryEntries: read 2015 CLIDRegistry entries for module ALL EventPersistenc... INFO Added successfully Conversion service:AthenaPoolCnvSvc SimplePoolFile1... DEBUG --> Access DbContainer READ [ROOT_Tree] MetaDataHdrForm(DataHeaderForm) MetaDataHdrForm... DEBUG Opening @@ -225,6 +226,7 @@ MetaDataHdr(Dat... DEBUG Opening MetaDataHdr(Dat... DEBUG attributes# = 1 MetaDataHdr(Dat... DEBUG Branch container 'DataHeader' MetaDataHdr(Dat... DEBUG Opened container MetaDataHdr(DataHeader) of type ROOT_Tree +ClassIDSvc INFO getRegistryEntries: read 2 CLIDRegistry entries for module ALL EmptyPoolFile.root DEBUG --> Access DbContainer READ [ROOT_Tree] MetaDataHdrForm(DataHeaderForm) MetaDataHdrForm... DEBUG Opening MetaDataHdrForm... DEBUG attributes# = 1 @@ -236,6 +238,10 @@ MetaDataSvc DEBUG handle() EndInputFile for eventless EmptyPoolFile.root Domain[ROOT_All] INFO -> Deaccess DbDatabase READ [ROOT_All] ???? EventSelector DEBUG Try item: "SimplePoolFile1.root" from the collection list. ApplicationMgr INFO Application Manager Started successfully +RootDatabase.se... DEBUG Request tree cache +RootDatabase.se... DEBUG File name SimplePoolFile1.root +RootDatabase.se... DEBUG Got tree CollectionTree read entry -1 +RootDatabase.se... DEBUG Using Tree cache. Size: -1 Nevents to learn with: -1 RootDatabase.se... DEBUG TREE_CACHE_LEARN_EVENTS = 6 RootDatabase.se... DEBUG Request tree cache RootDatabase.se... DEBUG File name SimplePoolFile1.root @@ -259,7 +265,6 @@ EventSelector INFO skipping event 9 EventSelector INFO skipping event 10 EventSelector DEBUG Get AttributeList from the collection EventSelector DEBUG AttributeList size 3 -ClassIDSvc INFO getRegistryEntries: read 1717 CLIDRegistry entries for module ALL EventSelector DEBUG record AthenaAttribute, name = Token = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=00000202][OID=00000006-0000000A]. EventSelector DEBUG record AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=00000202][OID=00000006-0000000A]. EventSelector DEBUG found AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=00000202][OID=00000006-0000000A] @@ -283,7 +288,6 @@ CollectionTree(... DEBUG attributes# = 1 CollectionTree(... DEBUG Branch container 'EventInfo_p4_McEventInfo' CollectionTree(... DEBUG Opened container CollectionTree(EventInfo_p4/McEventInfo) of type ROOT_Tree AthenaPoolConve... INFO massageEventInfo: unable to get OverrideRunNumberFromInput property from EventSelector -ClassIDSvc INFO getRegistryEntries: read 15 CLIDRegistry entries for module ALL AthenaEventLoopMgr INFO ===>>> start of run 1 <<<=== AthenaEventLoopMgr INFO ===>>> start processing event #10, run #1 0 events processed so far <<<=== ReadData DEBUG in execute() @@ -317,9 +321,8 @@ ReadData INFO Hit x = 1020.49 y = 63.5816 z = -951.864 detector = Du ReadData INFO Hit x = 1023.7 y = 57.9027 z = -953.684 detector = DummyHitDetector ReadData INFO Hit x = 1026.91 y = 52.2238 z = -955.073 detector = DummyHitDetector ReadData INFO Hit x = 1030.12 y = 46.5449 z = -956.169 detector = DummyHitDetector -ClassIDSvc INFO getRegistryEntries: read 10 CLIDRegistry entries for module ALL -PoolSvc INFO Database (SimplePoolFile1.root) attribute [BYTES_READ]: 27936 -PoolSvc INFO Database (SimplePoolFile1.root) attribute [READ_CALLS]: 24 +PoolSvc INFO Database (SimplePoolFile1.root) attribute [BYTES_READ]: 20092 +PoolSvc INFO Database (SimplePoolFile1.root) attribute [READ_CALLS]: 23 AthenaEventLoopMgr INFO ===>>> done processing event #10, run #1 1 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection EventSelector DEBUG AttributeList size 3 @@ -351,8 +354,8 @@ ReadData INFO Hit x = 1120.49 y = 63.5816 z = -1051.86 detector = Du ReadData INFO Hit x = 1123.7 y = 57.9027 z = -1053.68 detector = DummyHitDetector ReadData INFO Hit x = 1126.91 y = 52.2238 z = -1055.07 detector = DummyHitDetector ReadData INFO Hit x = 1130.12 y = 46.5449 z = -1056.17 detector = DummyHitDetector -PoolSvc INFO Database (SimplePoolFile1.root) attribute [BYTES_READ]: 27936 -PoolSvc INFO Database (SimplePoolFile1.root) attribute [READ_CALLS]: 24 +PoolSvc INFO Database (SimplePoolFile1.root) attribute [BYTES_READ]: 20092 +PoolSvc INFO Database (SimplePoolFile1.root) attribute [READ_CALLS]: 23 AthenaEventLoopMgr INFO ===>>> done processing event #11, run #1 2 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection EventSelector DEBUG AttributeList size 3 @@ -384,8 +387,8 @@ ReadData INFO Hit x = 1220.49 y = 63.5816 z = -1151.86 detector = Du ReadData INFO Hit x = 1223.7 y = 57.9027 z = -1153.68 detector = DummyHitDetector ReadData INFO Hit x = 1226.91 y = 52.2238 z = -1155.07 detector = DummyHitDetector ReadData INFO Hit x = 1230.12 y = 46.5449 z = -1156.17 detector = DummyHitDetector -PoolSvc INFO Database (SimplePoolFile1.root) attribute [BYTES_READ]: 27936 -PoolSvc INFO Database (SimplePoolFile1.root) attribute [READ_CALLS]: 24 +PoolSvc INFO Database (SimplePoolFile1.root) attribute [BYTES_READ]: 20092 +PoolSvc INFO Database (SimplePoolFile1.root) attribute [READ_CALLS]: 23 AthenaEventLoopMgr INFO ===>>> done processing event #12, run #1 3 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection EventSelector DEBUG AttributeList size 3 @@ -417,8 +420,8 @@ ReadData INFO Hit x = 1320.49 y = 63.5816 z = -1251.86 detector = Du ReadData INFO Hit x = 1323.7 y = 57.9027 z = -1253.68 detector = DummyHitDetector ReadData INFO Hit x = 1326.91 y = 52.2238 z = -1255.07 detector = DummyHitDetector ReadData INFO Hit x = 1330.12 y = 46.5449 z = -1256.17 detector = DummyHitDetector -PoolSvc INFO Database (SimplePoolFile1.root) attribute [BYTES_READ]: 27936 -PoolSvc INFO Database (SimplePoolFile1.root) attribute [READ_CALLS]: 24 +PoolSvc INFO Database (SimplePoolFile1.root) attribute [BYTES_READ]: 20092 +PoolSvc INFO Database (SimplePoolFile1.root) attribute [READ_CALLS]: 23 AthenaEventLoopMgr INFO ===>>> done processing event #13, run #1 4 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection EventSelector DEBUG AttributeList size 3 @@ -450,8 +453,8 @@ ReadData INFO Hit x = 1420.49 y = 63.5816 z = -1351.86 detector = Du ReadData INFO Hit x = 1423.7 y = 57.9027 z = -1353.68 detector = DummyHitDetector ReadData INFO Hit x = 1426.91 y = 52.2238 z = -1355.07 detector = DummyHitDetector ReadData INFO Hit x = 1430.12 y = 46.5449 z = -1356.17 detector = DummyHitDetector -PoolSvc INFO Database (SimplePoolFile1.root) attribute [BYTES_READ]: 27936 -PoolSvc INFO Database (SimplePoolFile1.root) attribute [READ_CALLS]: 24 +PoolSvc INFO Database (SimplePoolFile1.root) attribute [BYTES_READ]: 20092 +PoolSvc INFO Database (SimplePoolFile1.root) attribute [READ_CALLS]: 23 AthenaEventLoopMgr INFO ===>>> done processing event #14, run #1 5 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection EventSelector DEBUG AttributeList size 3 @@ -483,8 +486,8 @@ ReadData INFO Hit x = 1520.49 y = 63.5816 z = -1451.86 detector = Du ReadData INFO Hit x = 1523.7 y = 57.9027 z = -1453.68 detector = DummyHitDetector ReadData INFO Hit x = 1526.91 y = 52.2238 z = -1455.07 detector = DummyHitDetector ReadData INFO Hit x = 1530.12 y = 46.5449 z = -1456.17 detector = DummyHitDetector -PoolSvc INFO Database (SimplePoolFile1.root) attribute [BYTES_READ]: 27936 -PoolSvc INFO Database (SimplePoolFile1.root) attribute [READ_CALLS]: 24 +PoolSvc INFO Database (SimplePoolFile1.root) attribute [BYTES_READ]: 20092 +PoolSvc INFO Database (SimplePoolFile1.root) attribute [READ_CALLS]: 23 AthenaEventLoopMgr INFO ===>>> done processing event #15, run #1 6 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection EventSelector DEBUG AttributeList size 3 @@ -516,8 +519,8 @@ ReadData INFO Hit x = 1620.49 y = 63.5816 z = -1551.86 detector = Du ReadData INFO Hit x = 1623.7 y = 57.9027 z = -1553.68 detector = DummyHitDetector ReadData INFO Hit x = 1626.91 y = 52.2238 z = -1555.07 detector = DummyHitDetector ReadData INFO Hit x = 1630.12 y = 46.5449 z = -1556.17 detector = DummyHitDetector -PoolSvc INFO Database (SimplePoolFile1.root) attribute [BYTES_READ]: 27936 -PoolSvc INFO Database (SimplePoolFile1.root) attribute [READ_CALLS]: 24 +PoolSvc INFO Database (SimplePoolFile1.root) attribute [BYTES_READ]: 20092 +PoolSvc INFO Database (SimplePoolFile1.root) attribute [READ_CALLS]: 23 AthenaEventLoopMgr INFO ===>>> done processing event #16, run #1 7 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection EventSelector DEBUG AttributeList size 3 @@ -549,8 +552,8 @@ ReadData INFO Hit x = 1720.49 y = 63.5816 z = -1651.86 detector = Du ReadData INFO Hit x = 1723.7 y = 57.9027 z = -1653.68 detector = DummyHitDetector ReadData INFO Hit x = 1726.91 y = 52.2238 z = -1655.07 detector = DummyHitDetector ReadData INFO Hit x = 1730.12 y = 46.5449 z = -1656.17 detector = DummyHitDetector -PoolSvc INFO Database (SimplePoolFile1.root) attribute [BYTES_READ]: 27936 -PoolSvc INFO Database (SimplePoolFile1.root) attribute [READ_CALLS]: 24 +PoolSvc INFO Database (SimplePoolFile1.root) attribute [BYTES_READ]: 20092 +PoolSvc INFO Database (SimplePoolFile1.root) attribute [READ_CALLS]: 23 AthenaEventLoopMgr INFO ===>>> done processing event #17, run #1 8 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection EventSelector DEBUG AttributeList size 3 @@ -582,8 +585,8 @@ ReadData INFO Hit x = 1820.49 y = 63.5816 z = -1751.86 detector = Du ReadData INFO Hit x = 1823.7 y = 57.9027 z = -1753.68 detector = DummyHitDetector ReadData INFO Hit x = 1826.91 y = 52.2238 z = -1755.07 detector = DummyHitDetector ReadData INFO Hit x = 1830.12 y = 46.5449 z = -1756.17 detector = DummyHitDetector -PoolSvc INFO Database (SimplePoolFile1.root) attribute [BYTES_READ]: 27936 -PoolSvc INFO Database (SimplePoolFile1.root) attribute [READ_CALLS]: 24 +PoolSvc INFO Database (SimplePoolFile1.root) attribute [BYTES_READ]: 20092 +PoolSvc INFO Database (SimplePoolFile1.root) attribute [READ_CALLS]: 23 AthenaEventLoopMgr INFO ===>>> done processing event #18, run #1 9 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection EventSelector DEBUG AttributeList size 3 @@ -615,10 +618,11 @@ ReadData INFO Hit x = 1920.49 y = 63.5816 z = -1851.86 detector = Du ReadData INFO Hit x = 1923.7 y = 57.9027 z = -1853.68 detector = DummyHitDetector ReadData INFO Hit x = 1926.91 y = 52.2238 z = -1855.07 detector = DummyHitDetector ReadData INFO Hit x = 1930.12 y = 46.5449 z = -1856.17 detector = DummyHitDetector -PoolSvc INFO Database (SimplePoolFile1.root) attribute [BYTES_READ]: 27936 -PoolSvc INFO Database (SimplePoolFile1.root) attribute [READ_CALLS]: 24 +PoolSvc INFO Database (SimplePoolFile1.root) attribute [BYTES_READ]: 20092 +PoolSvc INFO Database (SimplePoolFile1.root) attribute [READ_CALLS]: 23 AthenaEventLoopMgr INFO ===>>> done processing event #19, run #1 10 events processed so far <<<=== MetaDataSvc DEBUG handle() EndInputFile for FID:???? +EventSelector INFO Disconnecting input sourceID: ???? Domain[ROOT_All] INFO -> Deaccess DbDatabase READ [ROOT_All] ???? Domain[ROOT_All] INFO > Deaccess DbDomain READ [ROOT_All] EventSelector DEBUG Try item: "EmptyPoolFile.root" from the collection list. @@ -670,6 +674,7 @@ MetaDataHdr(Dat... DEBUG Opening MetaDataHdr(Dat... DEBUG attributes# = 1 MetaDataHdr(Dat... DEBUG Branch container 'DataHeader' MetaDataHdr(Dat... DEBUG Opened container MetaDataHdr(DataHeader) of type ROOT_Tree +ClassIDSvc INFO getRegistryEntries: read 25 CLIDRegistry entries for module ALL EmptyPoolFile.root DEBUG --> Access DbContainer READ [ROOT_Tree] MetaDataHdrForm(DataHeaderForm) MetaDataHdrForm... DEBUG Opening MetaDataHdrForm... DEBUG attributes# = 1 @@ -741,10 +746,14 @@ SimplePoolFile2... DEBUG --->Reading Param:PFN=[SimplePoolFile2.root] SimplePoolFile2... DEBUG --->Reading Param:POOL_VSN=[1.1] SimplePoolFile2... DEBUG --->Reading Param:FORMAT_VSN=[1.1] ##Params DEBUG No objects passing selection criteria... Container has 4 Entries in total. -RootDatabase.se... DEBUG TREE_CACHE_LEARN_EVENTS = 6 RootDatabase.se... DEBUG Request tree cache RootDatabase.se... DEBUG File name SimplePoolFile2.root RootDatabase.se... DEBUG Got tree CollectionTree read entry -1 +RootDatabase.se... DEBUG Using Tree cache. Size: -1 Nevents to learn with: -1 +RootDatabase.se... DEBUG TREE_CACHE_LEARN_EVENTS = 6 +RootDatabase.se... DEBUG Request tree cache +RootDatabase.se... DEBUG File name SimplePoolFile2.root +RootDatabase.se... DEBUG Got tree CollectionTree read entry -1 RootDatabase.se... DEBUG Using Tree cache. Size: 100000 Nevents to learn with: 6 PoolSvc INFO Database (SimplePoolFile2.root) attribute [TREE_CACHE_LEARN_EVENTS]: 6 PoolSvc INFO Database (SimplePoolFile2.root) attribute [TREE_CACHE_SIZE]: 100000 @@ -812,8 +821,8 @@ ReadData INFO EventInfo event: 0 run: 1 ReadData INFO Get Smart data ptr 1 ReadData INFO Could not find ExampleTrackContainer/MyTracks ReadData INFO Could not find ExampleHitContainer/MyHits -PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 26630 -PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 27 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 18811 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 22 AthenaEventLoopMgr INFO ===>>> done processing event #0, run #1 11 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection EventSelector DEBUG AttributeList size 3 @@ -840,8 +849,8 @@ ReadData INFO EventInfo event: 1 run: 1 ReadData INFO Get Smart data ptr 1 ReadData INFO Could not find ExampleTrackContainer/MyTracks ReadData INFO Could not find ExampleHitContainer/MyHits -PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 26630 -PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 27 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 18811 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 22 AthenaEventLoopMgr INFO ===>>> done processing event #1, run #1 12 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection EventSelector DEBUG AttributeList size 3 @@ -868,8 +877,8 @@ ReadData INFO EventInfo event: 2 run: 1 ReadData INFO Get Smart data ptr 1 ReadData INFO Could not find ExampleTrackContainer/MyTracks ReadData INFO Could not find ExampleHitContainer/MyHits -PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 26630 -PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 27 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 18811 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 22 AthenaEventLoopMgr INFO ===>>> done processing event #2, run #1 13 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection EventSelector DEBUG AttributeList size 3 @@ -896,8 +905,8 @@ ReadData INFO EventInfo event: 3 run: 1 ReadData INFO Get Smart data ptr 1 ReadData INFO Could not find ExampleTrackContainer/MyTracks ReadData INFO Could not find ExampleHitContainer/MyHits -PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 26630 -PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 27 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 18811 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 22 AthenaEventLoopMgr INFO ===>>> done processing event #3, run #1 14 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection EventSelector DEBUG AttributeList size 3 @@ -924,8 +933,8 @@ ReadData INFO EventInfo event: 4 run: 1 ReadData INFO Get Smart data ptr 1 ReadData INFO Could not find ExampleTrackContainer/MyTracks ReadData INFO Could not find ExampleHitContainer/MyHits -PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 26630 -PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 27 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 18811 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 22 AthenaEventLoopMgr INFO ===>>> done processing event #4, run #1 15 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection EventSelector DEBUG AttributeList size 3 @@ -952,8 +961,8 @@ ReadData INFO EventInfo event: 5 run: 1 ReadData INFO Get Smart data ptr 1 ReadData INFO Could not find ExampleTrackContainer/MyTracks ReadData INFO Could not find ExampleHitContainer/MyHits -PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 26630 -PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 27 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 18811 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 22 AthenaEventLoopMgr INFO ===>>> done processing event #5, run #1 16 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection EventSelector DEBUG AttributeList size 3 @@ -980,8 +989,8 @@ ReadData INFO EventInfo event: 6 run: 1 ReadData INFO Get Smart data ptr 1 ReadData INFO Could not find ExampleTrackContainer/MyTracks ReadData INFO Could not find ExampleHitContainer/MyHits -PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 26630 -PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 27 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 18811 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 22 AthenaEventLoopMgr INFO ===>>> done processing event #6, run #1 17 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection EventSelector DEBUG AttributeList size 3 @@ -1008,8 +1017,8 @@ ReadData INFO EventInfo event: 7 run: 1 ReadData INFO Get Smart data ptr 1 ReadData INFO Could not find ExampleTrackContainer/MyTracks ReadData INFO Could not find ExampleHitContainer/MyHits -PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 26630 -PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 27 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 18811 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 22 AthenaEventLoopMgr INFO ===>>> done processing event #7, run #1 18 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection EventSelector DEBUG AttributeList size 3 @@ -1036,8 +1045,8 @@ ReadData INFO EventInfo event: 8 run: 1 ReadData INFO Get Smart data ptr 1 ReadData INFO Could not find ExampleTrackContainer/MyTracks ReadData INFO Could not find ExampleHitContainer/MyHits -PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 26630 -PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 27 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 18811 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 22 AthenaEventLoopMgr INFO ===>>> done processing event #8, run #1 19 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection EventSelector DEBUG AttributeList size 3 @@ -1064,8 +1073,8 @@ ReadData INFO EventInfo event: 9 run: 1 ReadData INFO Get Smart data ptr 1 ReadData INFO Could not find ExampleTrackContainer/MyTracks ReadData INFO Could not find ExampleHitContainer/MyHits -PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 26630 -PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 27 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 18811 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 22 AthenaEventLoopMgr INFO ===>>> done processing event #9, run #1 20 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection EventSelector DEBUG AttributeList size 3 @@ -1092,8 +1101,8 @@ ReadData INFO EventInfo event: 10 run: 1 ReadData INFO Get Smart data ptr 1 ReadData INFO Could not find ExampleTrackContainer/MyTracks ReadData INFO Could not find ExampleHitContainer/MyHits -PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 26630 -PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 27 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 18811 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 22 AthenaEventLoopMgr INFO ===>>> done processing event #10, run #1 21 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection EventSelector DEBUG AttributeList size 3 @@ -1120,8 +1129,8 @@ ReadData INFO EventInfo event: 11 run: 1 ReadData INFO Get Smart data ptr 1 ReadData INFO Could not find ExampleTrackContainer/MyTracks ReadData INFO Could not find ExampleHitContainer/MyHits -PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 26630 -PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 27 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 18811 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 22 AthenaEventLoopMgr INFO ===>>> done processing event #11, run #1 22 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection EventSelector DEBUG AttributeList size 3 @@ -1148,8 +1157,8 @@ ReadData INFO EventInfo event: 12 run: 1 ReadData INFO Get Smart data ptr 1 ReadData INFO Could not find ExampleTrackContainer/MyTracks ReadData INFO Could not find ExampleHitContainer/MyHits -PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 26630 -PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 27 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 18811 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 22 AthenaEventLoopMgr INFO ===>>> done processing event #12, run #1 23 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection EventSelector DEBUG AttributeList size 3 @@ -1176,8 +1185,8 @@ ReadData INFO EventInfo event: 13 run: 1 ReadData INFO Get Smart data ptr 1 ReadData INFO Could not find ExampleTrackContainer/MyTracks ReadData INFO Could not find ExampleHitContainer/MyHits -PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 26630 -PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 27 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 18811 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 22 AthenaEventLoopMgr INFO ===>>> done processing event #13, run #1 24 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection EventSelector DEBUG AttributeList size 3 @@ -1204,8 +1213,8 @@ ReadData INFO EventInfo event: 14 run: 1 ReadData INFO Get Smart data ptr 1 ReadData INFO Could not find ExampleTrackContainer/MyTracks ReadData INFO Could not find ExampleHitContainer/MyHits -PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 26630 -PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 27 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 18811 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 22 AthenaEventLoopMgr INFO ===>>> done processing event #14, run #1 25 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection EventSelector DEBUG AttributeList size 3 @@ -1232,8 +1241,8 @@ ReadData INFO EventInfo event: 15 run: 1 ReadData INFO Get Smart data ptr 1 ReadData INFO Could not find ExampleTrackContainer/MyTracks ReadData INFO Could not find ExampleHitContainer/MyHits -PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 26630 -PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 27 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 18811 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 22 AthenaEventLoopMgr INFO ===>>> done processing event #15, run #1 26 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection EventSelector DEBUG AttributeList size 3 @@ -1260,8 +1269,8 @@ ReadData INFO EventInfo event: 16 run: 1 ReadData INFO Get Smart data ptr 1 ReadData INFO Could not find ExampleTrackContainer/MyTracks ReadData INFO Could not find ExampleHitContainer/MyHits -PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 26630 -PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 27 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 18811 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 22 AthenaEventLoopMgr INFO ===>>> done processing event #16, run #1 27 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection EventSelector DEBUG AttributeList size 3 @@ -1288,8 +1297,8 @@ ReadData INFO EventInfo event: 17 run: 1 ReadData INFO Get Smart data ptr 1 ReadData INFO Could not find ExampleTrackContainer/MyTracks ReadData INFO Could not find ExampleHitContainer/MyHits -PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 26630 -PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 27 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 18811 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 22 AthenaEventLoopMgr INFO ===>>> done processing event #17, run #1 28 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection EventSelector DEBUG AttributeList size 3 @@ -1316,8 +1325,8 @@ ReadData INFO EventInfo event: 18 run: 1 ReadData INFO Get Smart data ptr 1 ReadData INFO Could not find ExampleTrackContainer/MyTracks ReadData INFO Could not find ExampleHitContainer/MyHits -PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 26630 -PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 27 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 18811 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 22 AthenaEventLoopMgr INFO ===>>> done processing event #18, run #1 29 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection EventSelector DEBUG AttributeList size 3 @@ -1344,8 +1353,8 @@ ReadData INFO EventInfo event: 19 run: 1 ReadData INFO Get Smart data ptr 1 ReadData INFO Could not find ExampleTrackContainer/MyTracks ReadData INFO Could not find ExampleHitContainer/MyHits -PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 26630 -PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 27 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 18811 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 22 AthenaEventLoopMgr INFO ===>>> done processing event #19, run #1 30 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection EventSelector DEBUG AttributeList size 3 @@ -1373,8 +1382,8 @@ ReadData INFO EventInfo event: 20 run: 2 ReadData INFO Get Smart data ptr 1 ReadData INFO Could not find ExampleTrackContainer/MyTracks ReadData INFO Could not find ExampleHitContainer/MyHits -PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 28245 -PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 31 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 19198 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 23 AthenaEventLoopMgr INFO ===>>> done processing event #20, run #2 31 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection EventSelector DEBUG AttributeList size 3 @@ -1401,8 +1410,8 @@ ReadData INFO EventInfo event: 21 run: 2 ReadData INFO Get Smart data ptr 1 ReadData INFO Could not find ExampleTrackContainer/MyTracks ReadData INFO Could not find ExampleHitContainer/MyHits -PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 28245 -PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 31 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 19198 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 23 AthenaEventLoopMgr INFO ===>>> done processing event #21, run #2 32 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection EventSelector DEBUG AttributeList size 3 @@ -1429,8 +1438,8 @@ ReadData INFO EventInfo event: 22 run: 2 ReadData INFO Get Smart data ptr 1 ReadData INFO Could not find ExampleTrackContainer/MyTracks ReadData INFO Could not find ExampleHitContainer/MyHits -PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 28245 -PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 31 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 19198 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 23 AthenaEventLoopMgr INFO ===>>> done processing event #22, run #2 33 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection EventSelector DEBUG AttributeList size 3 @@ -1457,8 +1466,8 @@ ReadData INFO EventInfo event: 23 run: 2 ReadData INFO Get Smart data ptr 1 ReadData INFO Could not find ExampleTrackContainer/MyTracks ReadData INFO Could not find ExampleHitContainer/MyHits -PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 28245 -PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 31 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 19198 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 23 AthenaEventLoopMgr INFO ===>>> done processing event #23, run #2 34 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection EventSelector DEBUG AttributeList size 3 @@ -1485,8 +1494,8 @@ ReadData INFO EventInfo event: 24 run: 2 ReadData INFO Get Smart data ptr 1 ReadData INFO Could not find ExampleTrackContainer/MyTracks ReadData INFO Could not find ExampleHitContainer/MyHits -PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 28245 -PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 31 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 19198 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 23 AthenaEventLoopMgr INFO ===>>> done processing event #24, run #2 35 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection EventSelector DEBUG AttributeList size 3 @@ -1513,8 +1522,8 @@ ReadData INFO EventInfo event: 25 run: 2 ReadData INFO Get Smart data ptr 1 ReadData INFO Could not find ExampleTrackContainer/MyTracks ReadData INFO Could not find ExampleHitContainer/MyHits -PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 28245 -PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 31 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 19198 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 23 AthenaEventLoopMgr INFO ===>>> done processing event #25, run #2 36 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection EventSelector DEBUG AttributeList size 3 @@ -1541,8 +1550,8 @@ ReadData INFO EventInfo event: 26 run: 2 ReadData INFO Get Smart data ptr 1 ReadData INFO Could not find ExampleTrackContainer/MyTracks ReadData INFO Could not find ExampleHitContainer/MyHits -PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 28245 -PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 31 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 19198 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 23 AthenaEventLoopMgr INFO ===>>> done processing event #26, run #2 37 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection EventSelector DEBUG AttributeList size 3 @@ -1569,8 +1578,8 @@ ReadData INFO EventInfo event: 27 run: 2 ReadData INFO Get Smart data ptr 1 ReadData INFO Could not find ExampleTrackContainer/MyTracks ReadData INFO Could not find ExampleHitContainer/MyHits -PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 28245 -PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 31 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 19198 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 23 AthenaEventLoopMgr INFO ===>>> done processing event #27, run #2 38 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection EventSelector DEBUG AttributeList size 3 @@ -1597,8 +1606,8 @@ ReadData INFO EventInfo event: 28 run: 2 ReadData INFO Get Smart data ptr 1 ReadData INFO Could not find ExampleTrackContainer/MyTracks ReadData INFO Could not find ExampleHitContainer/MyHits -PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 28245 -PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 31 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 19198 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 23 AthenaEventLoopMgr INFO ===>>> done processing event #28, run #2 39 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection EventSelector DEBUG AttributeList size 3 @@ -1625,8 +1634,8 @@ ReadData INFO EventInfo event: 29 run: 2 ReadData INFO Get Smart data ptr 1 ReadData INFO Could not find ExampleTrackContainer/MyTracks ReadData INFO Could not find ExampleHitContainer/MyHits -PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 28245 -PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 31 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 19198 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 23 AthenaEventLoopMgr INFO ===>>> done processing event #29, run #2 40 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection EventSelector DEBUG AttributeList size 3 @@ -1653,8 +1662,8 @@ ReadData INFO EventInfo event: 30 run: 2 ReadData INFO Get Smart data ptr 1 ReadData INFO Could not find ExampleTrackContainer/MyTracks ReadData INFO Could not find ExampleHitContainer/MyHits -PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 28245 -PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 31 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 19198 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 23 AthenaEventLoopMgr INFO ===>>> done processing event #30, run #2 41 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection EventSelector DEBUG AttributeList size 3 @@ -1681,8 +1690,8 @@ ReadData INFO EventInfo event: 31 run: 2 ReadData INFO Get Smart data ptr 1 ReadData INFO Could not find ExampleTrackContainer/MyTracks ReadData INFO Could not find ExampleHitContainer/MyHits -PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 28245 -PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 31 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 19198 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 23 AthenaEventLoopMgr INFO ===>>> done processing event #31, run #2 42 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection EventSelector DEBUG AttributeList size 3 @@ -1709,8 +1718,8 @@ ReadData INFO EventInfo event: 32 run: 2 ReadData INFO Get Smart data ptr 1 ReadData INFO Could not find ExampleTrackContainer/MyTracks ReadData INFO Could not find ExampleHitContainer/MyHits -PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 28245 -PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 31 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 19198 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 23 AthenaEventLoopMgr INFO ===>>> done processing event #32, run #2 43 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection EventSelector DEBUG AttributeList size 3 @@ -1737,8 +1746,8 @@ ReadData INFO EventInfo event: 33 run: 2 ReadData INFO Get Smart data ptr 1 ReadData INFO Could not find ExampleTrackContainer/MyTracks ReadData INFO Could not find ExampleHitContainer/MyHits -PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 28245 -PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 31 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 19198 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 23 AthenaEventLoopMgr INFO ===>>> done processing event #33, run #2 44 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection EventSelector DEBUG AttributeList size 3 @@ -1765,8 +1774,8 @@ ReadData INFO EventInfo event: 34 run: 2 ReadData INFO Get Smart data ptr 1 ReadData INFO Could not find ExampleTrackContainer/MyTracks ReadData INFO Could not find ExampleHitContainer/MyHits -PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 28245 -PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 31 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 19198 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 23 AthenaEventLoopMgr INFO ===>>> done processing event #34, run #2 45 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection EventSelector DEBUG AttributeList size 3 @@ -1793,8 +1802,8 @@ ReadData INFO EventInfo event: 35 run: 2 ReadData INFO Get Smart data ptr 1 ReadData INFO Could not find ExampleTrackContainer/MyTracks ReadData INFO Could not find ExampleHitContainer/MyHits -PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 28245 -PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 31 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 19198 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 23 AthenaEventLoopMgr INFO ===>>> done processing event #35, run #2 46 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection EventSelector DEBUG AttributeList size 3 @@ -1821,8 +1830,8 @@ ReadData INFO EventInfo event: 36 run: 2 ReadData INFO Get Smart data ptr 1 ReadData INFO Could not find ExampleTrackContainer/MyTracks ReadData INFO Could not find ExampleHitContainer/MyHits -PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 28245 -PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 31 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 19198 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 23 AthenaEventLoopMgr INFO ===>>> done processing event #36, run #2 47 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection EventSelector DEBUG AttributeList size 3 @@ -1849,8 +1858,8 @@ ReadData INFO EventInfo event: 37 run: 2 ReadData INFO Get Smart data ptr 1 ReadData INFO Could not find ExampleTrackContainer/MyTracks ReadData INFO Could not find ExampleHitContainer/MyHits -PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 28245 -PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 31 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 19198 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 23 AthenaEventLoopMgr INFO ===>>> done processing event #37, run #2 48 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection EventSelector DEBUG AttributeList size 3 @@ -1877,8 +1886,8 @@ ReadData INFO EventInfo event: 38 run: 2 ReadData INFO Get Smart data ptr 1 ReadData INFO Could not find ExampleTrackContainer/MyTracks ReadData INFO Could not find ExampleHitContainer/MyHits -PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 28245 -PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 31 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 19198 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 23 AthenaEventLoopMgr INFO ===>>> done processing event #38, run #2 49 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection EventSelector DEBUG AttributeList size 3 @@ -1905,10 +1914,11 @@ ReadData INFO EventInfo event: 39 run: 2 ReadData INFO Get Smart data ptr 1 ReadData INFO Could not find ExampleTrackContainer/MyTracks ReadData INFO Could not find ExampleHitContainer/MyHits -PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 28245 -PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 31 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 19198 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 23 AthenaEventLoopMgr INFO ===>>> done processing event #39, run #2 50 events processed so far <<<=== MetaDataSvc DEBUG handle() EndInputFile for FID:???? +EventSelector INFO Disconnecting input sourceID: ???? Domain[ROOT_All] INFO -> Deaccess DbDatabase READ [ROOT_All] ???? Domain[ROOT_All] INFO > Deaccess DbDomain READ [ROOT_All] EventSelector DEBUG Try item: "SimplePoolFile3.root" from the collection list. @@ -1974,6 +1984,10 @@ SimplePoolFile3... DEBUG --->Reading Param:PFN=[SimplePoolFile3.root] SimplePoolFile3... DEBUG --->Reading Param:POOL_VSN=[1.1] SimplePoolFile3... DEBUG --->Reading Param:FORMAT_VSN=[1.1] ##Params DEBUG No objects passing selection criteria... Container has 4 Entries in total. +RootDatabase.se... DEBUG Request tree cache +RootDatabase.se... DEBUG File name SimplePoolFile3.root +RootDatabase.se... DEBUG Got tree CollectionTree read entry -1 +RootDatabase.se... DEBUG Using Tree cache. Size: -1 Nevents to learn with: -1 RootDatabase.se... DEBUG TREE_CACHE_LEARN_EVENTS = 6 RootDatabase.se... DEBUG Request tree cache RootDatabase.se... DEBUG File name SimplePoolFile3.root @@ -2044,8 +2058,8 @@ ReadData INFO Track pt = 74.8928 eta = 3.1676 phi = 2.6161 detector DataProxy WARNING accessData: IOA pointer not set ReadData WARNING Could not follow ExampleTrackContainer/MyTracks ElementLinks to ExampleHitContainer/MyHits ReadData INFO Could not find ExampleHitContainer/MyHits -PoolSvc INFO Database (SimplePoolFile3.root) attribute [BYTES_READ]: 27294 -PoolSvc INFO Database (SimplePoolFile3.root) attribute [READ_CALLS]: 23 +PoolSvc INFO Database (SimplePoolFile3.root) attribute [BYTES_READ]: 18965 +PoolSvc INFO Database (SimplePoolFile3.root) attribute [READ_CALLS]: 21 AthenaEventLoopMgr INFO ===>>> done processing event #0, run #1 51 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection EventSelector DEBUG AttributeList size 3 @@ -2070,8 +2084,8 @@ ReadData INFO Track pt = 137.584 eta = -39.525 phi = 17.2679 detecto DataProxy WARNING accessData: IOA pointer not set ReadData WARNING Could not follow ExampleTrackContainer/MyTracks ElementLinks to ExampleHitContainer/MyHits ReadData INFO Could not find ExampleHitContainer/MyHits -PoolSvc INFO Database (SimplePoolFile3.root) attribute [BYTES_READ]: 27294 -PoolSvc INFO Database (SimplePoolFile3.root) attribute [READ_CALLS]: 23 +PoolSvc INFO Database (SimplePoolFile3.root) attribute [BYTES_READ]: 18965 +PoolSvc INFO Database (SimplePoolFile3.root) attribute [READ_CALLS]: 21 AthenaEventLoopMgr INFO ===>>> done processing event #1, run #1 52 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection EventSelector DEBUG AttributeList size 3 @@ -2096,8 +2110,8 @@ ReadData INFO Track pt = 228.154 eta = -6.2704 phi = 31.9197 detecto DataProxy WARNING accessData: IOA pointer not set ReadData WARNING Could not follow ExampleTrackContainer/MyTracks ElementLinks to ExampleHitContainer/MyHits ReadData INFO Could not find ExampleHitContainer/MyHits -PoolSvc INFO Database (SimplePoolFile3.root) attribute [BYTES_READ]: 27294 -PoolSvc INFO Database (SimplePoolFile3.root) attribute [READ_CALLS]: 23 +PoolSvc INFO Database (SimplePoolFile3.root) attribute [BYTES_READ]: 18965 +PoolSvc INFO Database (SimplePoolFile3.root) attribute [READ_CALLS]: 21 AthenaEventLoopMgr INFO ===>>> done processing event #2, run #1 53 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection EventSelector DEBUG AttributeList size 3 @@ -2122,8 +2136,8 @@ ReadData INFO Track pt = 324.306 eta = -15.8941 phi = 46.5715 detect DataProxy WARNING accessData: IOA pointer not set ReadData WARNING Could not follow ExampleTrackContainer/MyTracks ElementLinks to ExampleHitContainer/MyHits ReadData INFO Could not find ExampleHitContainer/MyHits -PoolSvc INFO Database (SimplePoolFile3.root) attribute [BYTES_READ]: 27294 -PoolSvc INFO Database (SimplePoolFile3.root) attribute [READ_CALLS]: 23 +PoolSvc INFO Database (SimplePoolFile3.root) attribute [BYTES_READ]: 18965 +PoolSvc INFO Database (SimplePoolFile3.root) attribute [READ_CALLS]: 21 AthenaEventLoopMgr INFO ===>>> done processing event #3, run #1 54 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection EventSelector DEBUG AttributeList size 3 @@ -2148,8 +2162,8 @@ ReadData INFO Track pt = 422.255 eta = -13.279 phi = 61.2233 detecto DataProxy WARNING accessData: IOA pointer not set ReadData WARNING Could not follow ExampleTrackContainer/MyTracks ElementLinks to ExampleHitContainer/MyHits ReadData INFO Could not find ExampleHitContainer/MyHits -PoolSvc INFO Database (SimplePoolFile3.root) attribute [BYTES_READ]: 27294 -PoolSvc INFO Database (SimplePoolFile3.root) attribute [READ_CALLS]: 23 +PoolSvc INFO Database (SimplePoolFile3.root) attribute [BYTES_READ]: 18965 +PoolSvc INFO Database (SimplePoolFile3.root) attribute [READ_CALLS]: 21 AthenaEventLoopMgr INFO ===>>> done processing event #4, run #1 55 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection EventSelector DEBUG AttributeList size 3 @@ -2174,8 +2188,8 @@ ReadData INFO Track pt = 520.987 eta = -12.3511 phi = 75.8751 detect DataProxy WARNING accessData: IOA pointer not set ReadData WARNING Could not follow ExampleTrackContainer/MyTracks ElementLinks to ExampleHitContainer/MyHits ReadData INFO Could not find ExampleHitContainer/MyHits -PoolSvc INFO Database (SimplePoolFile3.root) attribute [BYTES_READ]: 27294 -PoolSvc INFO Database (SimplePoolFile3.root) attribute [READ_CALLS]: 23 +PoolSvc INFO Database (SimplePoolFile3.root) attribute [BYTES_READ]: 18965 +PoolSvc INFO Database (SimplePoolFile3.root) attribute [READ_CALLS]: 21 AthenaEventLoopMgr INFO ===>>> done processing event #5, run #1 56 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection EventSelector DEBUG AttributeList size 3 @@ -2200,8 +2214,8 @@ ReadData INFO Track pt = 620.127 eta = -11.8468 phi = 90.5269 detect DataProxy WARNING accessData: IOA pointer not set ReadData WARNING Could not follow ExampleTrackContainer/MyTracks ElementLinks to ExampleHitContainer/MyHits ReadData INFO Could not find ExampleHitContainer/MyHits -PoolSvc INFO Database (SimplePoolFile3.root) attribute [BYTES_READ]: 27294 -PoolSvc INFO Database (SimplePoolFile3.root) attribute [READ_CALLS]: 23 +PoolSvc INFO Database (SimplePoolFile3.root) attribute [BYTES_READ]: 18965 +PoolSvc INFO Database (SimplePoolFile3.root) attribute [READ_CALLS]: 21 AthenaEventLoopMgr INFO ===>>> done processing event #6, run #1 57 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection EventSelector DEBUG AttributeList size 3 @@ -2226,8 +2240,8 @@ ReadData INFO Track pt = 719.507 eta = -11.5247 phi = 105.179 detect DataProxy WARNING accessData: IOA pointer not set ReadData WARNING Could not follow ExampleTrackContainer/MyTracks ElementLinks to ExampleHitContainer/MyHits ReadData INFO Could not find ExampleHitContainer/MyHits -PoolSvc INFO Database (SimplePoolFile3.root) attribute [BYTES_READ]: 27294 -PoolSvc INFO Database (SimplePoolFile3.root) attribute [READ_CALLS]: 23 +PoolSvc INFO Database (SimplePoolFile3.root) attribute [BYTES_READ]: 18965 +PoolSvc INFO Database (SimplePoolFile3.root) attribute [READ_CALLS]: 21 AthenaEventLoopMgr INFO ===>>> done processing event #7, run #1 58 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection EventSelector DEBUG AttributeList size 3 @@ -2252,8 +2266,8 @@ ReadData INFO Track pt = 819.038 eta = -11.2998 phi = 119.831 detect DataProxy WARNING accessData: IOA pointer not set ReadData WARNING Could not follow ExampleTrackContainer/MyTracks ElementLinks to ExampleHitContainer/MyHits ReadData INFO Could not find ExampleHitContainer/MyHits -PoolSvc INFO Database (SimplePoolFile3.root) attribute [BYTES_READ]: 27294 -PoolSvc INFO Database (SimplePoolFile3.root) attribute [READ_CALLS]: 23 +PoolSvc INFO Database (SimplePoolFile3.root) attribute [BYTES_READ]: 18965 +PoolSvc INFO Database (SimplePoolFile3.root) attribute [READ_CALLS]: 21 AthenaEventLoopMgr INFO ===>>> done processing event #8, run #1 59 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection EventSelector DEBUG AttributeList size 3 @@ -2278,8 +2292,8 @@ ReadData INFO Track pt = 918.671 eta = -11.1334 phi = 134.482 detect DataProxy WARNING accessData: IOA pointer not set ReadData WARNING Could not follow ExampleTrackContainer/MyTracks ElementLinks to ExampleHitContainer/MyHits ReadData INFO Could not find ExampleHitContainer/MyHits -PoolSvc INFO Database (SimplePoolFile3.root) attribute [BYTES_READ]: 27294 -PoolSvc INFO Database (SimplePoolFile3.root) attribute [READ_CALLS]: 23 +PoolSvc INFO Database (SimplePoolFile3.root) attribute [BYTES_READ]: 18965 +PoolSvc INFO Database (SimplePoolFile3.root) attribute [READ_CALLS]: 21 AthenaEventLoopMgr INFO ===>>> done processing event #9, run #1 60 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection EventSelector DEBUG AttributeList size 3 @@ -2304,8 +2318,8 @@ ReadData INFO Track pt = 1018.38 eta = -11.0052 phi = 149.134 detect DataProxy WARNING accessData: IOA pointer not set ReadData WARNING Could not follow ExampleTrackContainer/MyTracks ElementLinks to ExampleHitContainer/MyHits ReadData INFO Could not find ExampleHitContainer/MyHits -PoolSvc INFO Database (SimplePoolFile3.root) attribute [BYTES_READ]: 27294 -PoolSvc INFO Database (SimplePoolFile3.root) attribute [READ_CALLS]: 23 +PoolSvc INFO Database (SimplePoolFile3.root) attribute [BYTES_READ]: 18965 +PoolSvc INFO Database (SimplePoolFile3.root) attribute [READ_CALLS]: 21 AthenaEventLoopMgr INFO ===>>> done processing event #10, run #1 61 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection EventSelector DEBUG AttributeList size 3 @@ -2330,8 +2344,8 @@ ReadData INFO Track pt = 1118.13 eta = -10.9031 phi = 163.786 detect DataProxy WARNING accessData: IOA pointer not set ReadData WARNING Could not follow ExampleTrackContainer/MyTracks ElementLinks to ExampleHitContainer/MyHits ReadData INFO Could not find ExampleHitContainer/MyHits -PoolSvc INFO Database (SimplePoolFile3.root) attribute [BYTES_READ]: 27294 -PoolSvc INFO Database (SimplePoolFile3.root) attribute [READ_CALLS]: 23 +PoolSvc INFO Database (SimplePoolFile3.root) attribute [BYTES_READ]: 18965 +PoolSvc INFO Database (SimplePoolFile3.root) attribute [READ_CALLS]: 21 AthenaEventLoopMgr INFO ===>>> done processing event #11, run #1 62 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection EventSelector DEBUG AttributeList size 3 @@ -2356,8 +2370,8 @@ ReadData INFO Track pt = 1217.93 eta = -10.82 phi = 178.438 detector DataProxy WARNING accessData: IOA pointer not set ReadData WARNING Could not follow ExampleTrackContainer/MyTracks ElementLinks to ExampleHitContainer/MyHits ReadData INFO Could not find ExampleHitContainer/MyHits -PoolSvc INFO Database (SimplePoolFile3.root) attribute [BYTES_READ]: 27294 -PoolSvc INFO Database (SimplePoolFile3.root) attribute [READ_CALLS]: 23 +PoolSvc INFO Database (SimplePoolFile3.root) attribute [BYTES_READ]: 18965 +PoolSvc INFO Database (SimplePoolFile3.root) attribute [READ_CALLS]: 21 AthenaEventLoopMgr INFO ===>>> done processing event #12, run #1 63 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection EventSelector DEBUG AttributeList size 3 @@ -2382,8 +2396,8 @@ ReadData INFO Track pt = 1317.76 eta = -10.751 phi = 193.09 detector DataProxy WARNING accessData: IOA pointer not set ReadData WARNING Could not follow ExampleTrackContainer/MyTracks ElementLinks to ExampleHitContainer/MyHits ReadData INFO Could not find ExampleHitContainer/MyHits -PoolSvc INFO Database (SimplePoolFile3.root) attribute [BYTES_READ]: 27294 -PoolSvc INFO Database (SimplePoolFile3.root) attribute [READ_CALLS]: 23 +PoolSvc INFO Database (SimplePoolFile3.root) attribute [BYTES_READ]: 18965 +PoolSvc INFO Database (SimplePoolFile3.root) attribute [READ_CALLS]: 21 AthenaEventLoopMgr INFO ===>>> done processing event #13, run #1 64 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection EventSelector DEBUG AttributeList size 3 @@ -2408,8 +2422,8 @@ ReadData INFO Track pt = 1417.61 eta = -10.6927 phi = 207.741 detect DataProxy WARNING accessData: IOA pointer not set ReadData WARNING Could not follow ExampleTrackContainer/MyTracks ElementLinks to ExampleHitContainer/MyHits ReadData INFO Could not find ExampleHitContainer/MyHits -PoolSvc INFO Database (SimplePoolFile3.root) attribute [BYTES_READ]: 27294 -PoolSvc INFO Database (SimplePoolFile3.root) attribute [READ_CALLS]: 23 +PoolSvc INFO Database (SimplePoolFile3.root) attribute [BYTES_READ]: 18965 +PoolSvc INFO Database (SimplePoolFile3.root) attribute [READ_CALLS]: 21 AthenaEventLoopMgr INFO ===>>> done processing event #14, run #1 65 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection EventSelector DEBUG AttributeList size 3 @@ -2434,8 +2448,8 @@ ReadData INFO Track pt = 1517.49 eta = -10.6429 phi = 222.393 detect DataProxy WARNING accessData: IOA pointer not set ReadData WARNING Could not follow ExampleTrackContainer/MyTracks ElementLinks to ExampleHitContainer/MyHits ReadData INFO Could not find ExampleHitContainer/MyHits -PoolSvc INFO Database (SimplePoolFile3.root) attribute [BYTES_READ]: 27294 -PoolSvc INFO Database (SimplePoolFile3.root) attribute [READ_CALLS]: 23 +PoolSvc INFO Database (SimplePoolFile3.root) attribute [BYTES_READ]: 18965 +PoolSvc INFO Database (SimplePoolFile3.root) attribute [READ_CALLS]: 21 AthenaEventLoopMgr INFO ===>>> done processing event #15, run #1 66 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection EventSelector DEBUG AttributeList size 3 @@ -2460,8 +2474,8 @@ ReadData INFO Track pt = 1617.37 eta = -10.5997 phi = 237.045 detect DataProxy WARNING accessData: IOA pointer not set ReadData WARNING Could not follow ExampleTrackContainer/MyTracks ElementLinks to ExampleHitContainer/MyHits ReadData INFO Could not find ExampleHitContainer/MyHits -PoolSvc INFO Database (SimplePoolFile3.root) attribute [BYTES_READ]: 27294 -PoolSvc INFO Database (SimplePoolFile3.root) attribute [READ_CALLS]: 23 +PoolSvc INFO Database (SimplePoolFile3.root) attribute [BYTES_READ]: 18965 +PoolSvc INFO Database (SimplePoolFile3.root) attribute [READ_CALLS]: 21 AthenaEventLoopMgr INFO ===>>> done processing event #16, run #1 67 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection EventSelector DEBUG AttributeList size 3 @@ -2486,8 +2500,8 @@ ReadData INFO Track pt = 1717.27 eta = -10.562 phi = 251.697 detecto DataProxy WARNING accessData: IOA pointer not set ReadData WARNING Could not follow ExampleTrackContainer/MyTracks ElementLinks to ExampleHitContainer/MyHits ReadData INFO Could not find ExampleHitContainer/MyHits -PoolSvc INFO Database (SimplePoolFile3.root) attribute [BYTES_READ]: 27294 -PoolSvc INFO Database (SimplePoolFile3.root) attribute [READ_CALLS]: 23 +PoolSvc INFO Database (SimplePoolFile3.root) attribute [BYTES_READ]: 18965 +PoolSvc INFO Database (SimplePoolFile3.root) attribute [READ_CALLS]: 21 AthenaEventLoopMgr INFO ===>>> done processing event #17, run #1 68 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection EventSelector DEBUG AttributeList size 3 @@ -2512,8 +2526,8 @@ ReadData INFO Track pt = 1817.19 eta = -10.5288 phi = 266.349 detect DataProxy WARNING accessData: IOA pointer not set ReadData WARNING Could not follow ExampleTrackContainer/MyTracks ElementLinks to ExampleHitContainer/MyHits ReadData INFO Could not find ExampleHitContainer/MyHits -PoolSvc INFO Database (SimplePoolFile3.root) attribute [BYTES_READ]: 27294 -PoolSvc INFO Database (SimplePoolFile3.root) attribute [READ_CALLS]: 23 +PoolSvc INFO Database (SimplePoolFile3.root) attribute [BYTES_READ]: 18965 +PoolSvc INFO Database (SimplePoolFile3.root) attribute [READ_CALLS]: 21 AthenaEventLoopMgr INFO ===>>> done processing event #18, run #1 69 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection EventSelector DEBUG AttributeList size 3 @@ -2538,10 +2552,11 @@ ReadData INFO Track pt = 1917.11 eta = -10.4993 phi = 281 detector = DataProxy WARNING accessData: IOA pointer not set ReadData WARNING Could not follow ExampleTrackContainer/MyTracks ElementLinks to ExampleHitContainer/MyHits ReadData INFO Could not find ExampleHitContainer/MyHits -PoolSvc INFO Database (SimplePoolFile3.root) attribute [BYTES_READ]: 27294 -PoolSvc INFO Database (SimplePoolFile3.root) attribute [READ_CALLS]: 23 +PoolSvc INFO Database (SimplePoolFile3.root) attribute [BYTES_READ]: 18965 +PoolSvc INFO Database (SimplePoolFile3.root) attribute [READ_CALLS]: 21 AthenaEventLoopMgr INFO ===>>> done processing event #19, run #1 70 events processed so far <<<=== MetaDataSvc DEBUG handle() EndInputFile for FID:???? +EventSelector INFO Disconnecting input sourceID: ???? Domain[ROOT_All] INFO -> Deaccess DbDatabase READ [ROOT_All] ???? Domain[ROOT_All] INFO > Deaccess DbDomain READ [ROOT_All] MetaDataSvc DEBUG handle() LastInputFile for end @@ -2556,9 +2571,9 @@ ToolSvc INFO Removing all tools created by ToolSvc *****Chrono***** INFO **************************************************************************************************** *****Chrono***** INFO The Final CPU consumption ( Chrono ) Table (ordered) *****Chrono***** INFO **************************************************************************************************** -cObjR_ALL INFO Time User : Tot= 10 [ms] Ave/Min/Max=0.0518(+-0.718)/ 0/ 10 [ms] #=193 -cObj_ALL INFO Time User : Tot= 30 [ms] Ave/Min/Max=0.166(+- 1.28)/ 0/ 10 [ms] #=181 -ChronoStatSvc INFO Time User : Tot= 0.88 [s] #= 1 +cObjR_ALL INFO Time User : Tot= 10 [ms] Ave/Min/Max=0.0806(+-0.894)/ 0/ 10 [ms] #=124 +cObj_ALL INFO Time User : Tot= 40 [ms] Ave/Min/Max=0.351(+- 2.63)/ 0/ 20 [ms] #=114 +ChronoStatSvc INFO Time User : Tot= 1.05 [s] #= 1 *****Chrono***** INFO **************************************************************************************************** ChronoStatSvc.f... INFO Service finalized successfully ApplicationMgr INFO Application Manager Finalized successfully diff --git a/Database/AthenaPOOL/AthenaPoolExample/AthenaPoolExampleAlgorithms/share/AthenaPoolExample_ReadAgain.ref b/Database/AthenaPOOL/AthenaPoolExample/AthenaPoolExampleAlgorithms/share/AthenaPoolExample_ReadAgain.ref index f73977b1c84d60a61456a6d8dd23c9c1e583cffd..1092a16285b4d3d55b8987703a1502e372aa6098 100644 --- a/Database/AthenaPOOL/AthenaPoolExample/AthenaPoolExampleAlgorithms/share/AthenaPoolExample_ReadAgain.ref +++ b/Database/AthenaPOOL/AthenaPoolExample/AthenaPoolExampleAlgorithms/share/AthenaPoolExample_ReadAgain.ref @@ -1,19 +1,19 @@ -Sun Sep 30 16:38:24 CEST 2018 +Fri Oct 19 21:17:09 CEST 2018 Preloading tcmalloc_minimal.so Athena INFO including file "AthenaCommon/Preparation.py" Athena INFO including file "AthenaCommon/Atlas.UnixStandardJob.py" Athena INFO executing ROOT6Setup Athena INFO including file "AthenaCommon/Execution.py" Athena INFO including file "AthenaPoolExampleAlgorithms/AthenaPoolExample_ReadAgainJobOptions.py" -Py:ConfigurableDb INFO Read module info for 5499 configurables from 21 genConfDb files +Py:ConfigurableDb INFO Read module info for 5521 configurables from 57 genConfDb files Py:ConfigurableDb INFO No duplicates have been found: that's good ! Athena INFO including file "AthenaCommon/runbatch.py" -ApplicationMgr INFO Updating Gaudi::PluginService::SetDebug(level) to level= 'PluginDebugLevel':0 +[?1034hApplicationMgr INFO Updating Gaudi::PluginService::SetDebug(level) to level= 'PluginDebugLevel':0 ApplicationMgr INFO Updating Gaudi::PluginService::SetDebug(level) to level= 'PluginDebugLevel':0 ApplicationMgr SUCCESS ==================================================================================================================================== Welcome to ApplicationMgr (GaudiCoreSvc v30r3) - running on lxplus063.cern.ch on Sun Sep 30 16:38:31 2018 + running on lxplus060.cern.ch on Fri Oct 19 21:18:12 2018 ==================================================================================================================================== ApplicationMgr INFO Successfully loaded modules : AthenaServices ApplicationMgr INFO Application Manager Configured successfully @@ -24,7 +24,7 @@ AthDictLoaderSvc INFO acquired Dso-registry ClassIDSvc INFO getRegistryEntries: read 2946 CLIDRegistry entries for module ALL CoreDumpSvc INFO install f-a-t-a-l handler... (flag = -1) AthenaEventLoopMgr INFO Initializing AthenaEventLoopMgr - package version AthenaServices-00-00-00 -ClassIDSvc INFO getRegistryEntries: read 889 CLIDRegistry entries for module ALL +ClassIDSvc INFO getRegistryEntries: read 836 CLIDRegistry entries for module ALL ReadData DEBUG Property update for OutputLevel : new value = 2 ReadData INFO in initialize() MetaDataSvc DEBUG Property update for OutputLevel : new value = 2 @@ -36,8 +36,8 @@ PoolSvc DEBUG Service base class initialized successfully PoolSvc INFO Set connectionsvc retry/timeout/IDLE timeout to 'ConnectionRetrialPeriod':300/ 'ConnectionRetrialTimeOut':3600/ 'ConnectionTimeOut':5 seconds with connection cleanup disabled PoolSvc INFO Frontier compression level set to 5 DBReplicaSvc INFO Frontier server at (serverurl=http://atlasfrontier-local.cern.ch:8000/atlr)(serverurl=http://atlasfrontier-ai.cern.ch:8000/atlr)(serverurl=http://lcgft-atlas.gridpp.rl.ac.uk:3128/frontierATLAS)(serverurl=http://ccfrontier.in2p3.fr:23128/ccin2p3-AtlasFrontier)(proxyurl=http://ca-proxy.cern.ch:3128)(proxyurl=http://ca-proxy-meyrin.cern.ch:3128)(proxyurl=http://ca-proxy-wigner.cern.ch:3128)(proxyurl=http://atlasbpfrontier.cern.ch:3127)(proxyurl=http://atlasbpfrontier.fnal.gov:3127) will be considered for COOL data -DBReplicaSvc INFO Read replica configuration from /cvmfs/atlas-nightlies.cern.ch/repo/sw/master/2018-09-27T2055/Athena/22.0.1/InstallArea/x86_64-slc6-gcc62-opt/share/dbreplica.config -DBReplicaSvc INFO Total of 10 servers found for host lxplus063.cern.ch [ATLF ATLAS_COOLPROD atlas_dd ATLAS_CONFIG INT8R INTR ATONR_COOL ATONR_CONF DEVDB11 ATLF ] +DBReplicaSvc INFO Read replica configuration from /cvmfs/atlas-nightlies.cern.ch/repo/sw/master/2018-10-18T2340/Athena/22.0.1/InstallArea/x86_64-slc6-gcc8-opt/share/dbreplica.config +DBReplicaSvc INFO Total of 10 servers found for host lxplus060.cern.ch [ATLF ATLAS_COOLPROD atlas_dd ATLAS_CONFIG INT8R INTR ATONR_COOL ATONR_CONF DEVDB11 ATLF ] PoolSvc INFO Successfully setup replica sorting algorithm PoolSvc DEBUG OutputLevel is PoolSvc INFO Setting up APR FileCatalog and Streams @@ -155,7 +155,7 @@ MetaDataHdr(Dat... DEBUG Opening MetaDataHdr(Dat... DEBUG attributes# = 1 MetaDataHdr(Dat... DEBUG Branch container 'DataHeader' MetaDataHdr(Dat... DEBUG Opened container MetaDataHdr(DataHeader) of type ROOT_Tree -ClassIDSvc INFO getRegistryEntries: read 1961 CLIDRegistry entries for module ALL +ClassIDSvc INFO getRegistryEntries: read 2012 CLIDRegistry entries for module ALL EventPersistenc... INFO Added successfully Conversion service:AthenaPoolCnvSvc SimplePoolRepli... DEBUG --> Access DbContainer READ [ROOT_Tree] MetaDataHdrForm(DataHeaderForm) MetaDataHdrForm... DEBUG Opening @@ -292,10 +292,14 @@ POOLContainer(D... DEBUG attributes# = 1 POOLContainer(D... DEBUG Branch container 'DataHeader' POOLContainer(D... DEBUG Opened container POOLContainer(DataHeader) of type ROOT_Tree ApplicationMgr INFO Application Manager Started successfully -RootDatabase.se... DEBUG TREE_CACHE_LEARN_EVENTS = 6 RootDatabase.se... DEBUG Request tree cache RootDatabase.se... DEBUG File name SimplePoolReplica1.root RootDatabase.se... DEBUG Got tree CollectionTree read entry -1 +RootDatabase.se... DEBUG Using Tree cache. Size: -1 Nevents to learn with: -1 +RootDatabase.se... DEBUG TREE_CACHE_LEARN_EVENTS = 6 +RootDatabase.se... DEBUG Request tree cache +RootDatabase.se... DEBUG File name SimplePoolReplica1.root +RootDatabase.se... DEBUG Got tree CollectionTree read entry -1 RootDatabase.se... DEBUG Using Tree cache. Size: 100000 Nevents to learn with: 6 PoolSvc INFO Database (SimplePoolReplica1.root) attribute [TREE_CACHE_LEARN_EVENTS]: 6 PoolSvc INFO Database (SimplePoolReplica1.root) attribute [TREE_CACHE_SIZE]: 100000 @@ -343,7 +347,6 @@ CollectionTree(... DEBUG attributes# = 1 CollectionTree(... DEBUG Branch container 'EventInfo_p4_McEventInfo' CollectionTree(... DEBUG Opened container CollectionTree(EventInfo_p4/McEventInfo) of type ROOT_Tree AthenaPoolConve... INFO massageEventInfo: unable to get OverrideRunNumberFromInput property from EventSelector -ClassIDSvc INFO getRegistryEntries: read 15 CLIDRegistry entries for module ALL AthenaEventLoopMgr INFO ===>>> start of run 1 <<<=== AthenaEventLoopMgr INFO ===>>> start processing event #10, run #1 0 events processed so far <<<=== ReadData DEBUG in execute() @@ -377,8 +380,7 @@ ReadData INFO Hit x = 1020.49 y = 63.5816 z = -951.864 detector = Du ReadData INFO Hit x = 1023.7 y = 57.9027 z = -953.684 detector = DummyHitDetector ReadData INFO Hit x = 1026.91 y = 52.2238 z = -955.073 detector = DummyHitDetector ReadData INFO Hit x = 1030.12 y = 46.5449 z = -956.169 detector = DummyHitDetector -ClassIDSvc INFO getRegistryEntries: read 10 CLIDRegistry entries for module ALL -PoolSvc INFO Database (SimplePoolReplica1.root) attribute [BYTES_READ]: 19640 +PoolSvc INFO Database (SimplePoolReplica1.root) attribute [BYTES_READ]: 19648 PoolSvc INFO Database (SimplePoolReplica1.root) attribute [READ_CALLS]: 23 AthenaEventLoopMgr INFO ===>>> done processing event #10, run #1 1 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection @@ -411,7 +413,7 @@ ReadData INFO Hit x = 1120.49 y = 63.5816 z = -1051.86 detector = Du ReadData INFO Hit x = 1123.7 y = 57.9027 z = -1053.68 detector = DummyHitDetector ReadData INFO Hit x = 1126.91 y = 52.2238 z = -1055.07 detector = DummyHitDetector ReadData INFO Hit x = 1130.12 y = 46.5449 z = -1056.17 detector = DummyHitDetector -PoolSvc INFO Database (SimplePoolReplica1.root) attribute [BYTES_READ]: 19640 +PoolSvc INFO Database (SimplePoolReplica1.root) attribute [BYTES_READ]: 19648 PoolSvc INFO Database (SimplePoolReplica1.root) attribute [READ_CALLS]: 23 AthenaEventLoopMgr INFO ===>>> done processing event #11, run #1 2 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection @@ -444,7 +446,7 @@ ReadData INFO Hit x = 1220.49 y = 63.5816 z = -1151.86 detector = Du ReadData INFO Hit x = 1223.7 y = 57.9027 z = -1153.68 detector = DummyHitDetector ReadData INFO Hit x = 1226.91 y = 52.2238 z = -1155.07 detector = DummyHitDetector ReadData INFO Hit x = 1230.12 y = 46.5449 z = -1156.17 detector = DummyHitDetector -PoolSvc INFO Database (SimplePoolReplica1.root) attribute [BYTES_READ]: 19640 +PoolSvc INFO Database (SimplePoolReplica1.root) attribute [BYTES_READ]: 19648 PoolSvc INFO Database (SimplePoolReplica1.root) attribute [READ_CALLS]: 23 AthenaEventLoopMgr INFO ===>>> done processing event #12, run #1 3 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection @@ -477,7 +479,7 @@ ReadData INFO Hit x = 1320.49 y = 63.5816 z = -1251.86 detector = Du ReadData INFO Hit x = 1323.7 y = 57.9027 z = -1253.68 detector = DummyHitDetector ReadData INFO Hit x = 1326.91 y = 52.2238 z = -1255.07 detector = DummyHitDetector ReadData INFO Hit x = 1330.12 y = 46.5449 z = -1256.17 detector = DummyHitDetector -PoolSvc INFO Database (SimplePoolReplica1.root) attribute [BYTES_READ]: 19640 +PoolSvc INFO Database (SimplePoolReplica1.root) attribute [BYTES_READ]: 19648 PoolSvc INFO Database (SimplePoolReplica1.root) attribute [READ_CALLS]: 23 AthenaEventLoopMgr INFO ===>>> done processing event #13, run #1 4 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection @@ -510,7 +512,7 @@ ReadData INFO Hit x = 1420.49 y = 63.5816 z = -1351.86 detector = Du ReadData INFO Hit x = 1423.7 y = 57.9027 z = -1353.68 detector = DummyHitDetector ReadData INFO Hit x = 1426.91 y = 52.2238 z = -1355.07 detector = DummyHitDetector ReadData INFO Hit x = 1430.12 y = 46.5449 z = -1356.17 detector = DummyHitDetector -PoolSvc INFO Database (SimplePoolReplica1.root) attribute [BYTES_READ]: 19640 +PoolSvc INFO Database (SimplePoolReplica1.root) attribute [BYTES_READ]: 19648 PoolSvc INFO Database (SimplePoolReplica1.root) attribute [READ_CALLS]: 23 AthenaEventLoopMgr INFO ===>>> done processing event #14, run #1 5 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection @@ -543,7 +545,7 @@ ReadData INFO Hit x = 1520.49 y = 63.5816 z = -1451.86 detector = Du ReadData INFO Hit x = 1523.7 y = 57.9027 z = -1453.68 detector = DummyHitDetector ReadData INFO Hit x = 1526.91 y = 52.2238 z = -1455.07 detector = DummyHitDetector ReadData INFO Hit x = 1530.12 y = 46.5449 z = -1456.17 detector = DummyHitDetector -PoolSvc INFO Database (SimplePoolReplica1.root) attribute [BYTES_READ]: 19640 +PoolSvc INFO Database (SimplePoolReplica1.root) attribute [BYTES_READ]: 19648 PoolSvc INFO Database (SimplePoolReplica1.root) attribute [READ_CALLS]: 23 AthenaEventLoopMgr INFO ===>>> done processing event #15, run #1 6 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection @@ -576,7 +578,7 @@ ReadData INFO Hit x = 1620.49 y = 63.5816 z = -1551.86 detector = Du ReadData INFO Hit x = 1623.7 y = 57.9027 z = -1553.68 detector = DummyHitDetector ReadData INFO Hit x = 1626.91 y = 52.2238 z = -1555.07 detector = DummyHitDetector ReadData INFO Hit x = 1630.12 y = 46.5449 z = -1556.17 detector = DummyHitDetector -PoolSvc INFO Database (SimplePoolReplica1.root) attribute [BYTES_READ]: 19640 +PoolSvc INFO Database (SimplePoolReplica1.root) attribute [BYTES_READ]: 19648 PoolSvc INFO Database (SimplePoolReplica1.root) attribute [READ_CALLS]: 23 AthenaEventLoopMgr INFO ===>>> done processing event #16, run #1 7 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection @@ -609,7 +611,7 @@ ReadData INFO Hit x = 1720.49 y = 63.5816 z = -1651.86 detector = Du ReadData INFO Hit x = 1723.7 y = 57.9027 z = -1653.68 detector = DummyHitDetector ReadData INFO Hit x = 1726.91 y = 52.2238 z = -1655.07 detector = DummyHitDetector ReadData INFO Hit x = 1730.12 y = 46.5449 z = -1656.17 detector = DummyHitDetector -PoolSvc INFO Database (SimplePoolReplica1.root) attribute [BYTES_READ]: 19640 +PoolSvc INFO Database (SimplePoolReplica1.root) attribute [BYTES_READ]: 19648 PoolSvc INFO Database (SimplePoolReplica1.root) attribute [READ_CALLS]: 23 AthenaEventLoopMgr INFO ===>>> done processing event #17, run #1 8 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection @@ -642,7 +644,7 @@ ReadData INFO Hit x = 1820.49 y = 63.5816 z = -1751.86 detector = Du ReadData INFO Hit x = 1823.7 y = 57.9027 z = -1753.68 detector = DummyHitDetector ReadData INFO Hit x = 1826.91 y = 52.2238 z = -1755.07 detector = DummyHitDetector ReadData INFO Hit x = 1830.12 y = 46.5449 z = -1756.17 detector = DummyHitDetector -PoolSvc INFO Database (SimplePoolReplica1.root) attribute [BYTES_READ]: 19640 +PoolSvc INFO Database (SimplePoolReplica1.root) attribute [BYTES_READ]: 19648 PoolSvc INFO Database (SimplePoolReplica1.root) attribute [READ_CALLS]: 23 AthenaEventLoopMgr INFO ===>>> done processing event #18, run #1 9 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection @@ -675,7 +677,7 @@ ReadData INFO Hit x = 1920.49 y = 63.5816 z = -1851.86 detector = Du ReadData INFO Hit x = 1923.7 y = 57.9027 z = -1853.68 detector = DummyHitDetector ReadData INFO Hit x = 1926.91 y = 52.2238 z = -1855.07 detector = DummyHitDetector ReadData INFO Hit x = 1930.12 y = 46.5449 z = -1856.17 detector = DummyHitDetector -PoolSvc INFO Database (SimplePoolReplica1.root) attribute [BYTES_READ]: 19640 +PoolSvc INFO Database (SimplePoolReplica1.root) attribute [BYTES_READ]: 19648 PoolSvc INFO Database (SimplePoolReplica1.root) attribute [READ_CALLS]: 23 AthenaEventLoopMgr INFO ===>>> done processing event #19, run #1 10 events processed so far <<<=== Domain[ROOT_All] INFO -> Deaccess DbDatabase READ [ROOT_All] ???? @@ -731,6 +733,7 @@ MetaDataHdr(Dat... DEBUG Opening MetaDataHdr(Dat... DEBUG attributes# = 1 MetaDataHdr(Dat... DEBUG Branch container 'DataHeader' MetaDataHdr(Dat... DEBUG Opened container MetaDataHdr(DataHeader) of type ROOT_Tree +ClassIDSvc INFO getRegistryEntries: read 25 CLIDRegistry entries for module ALL EmptyPoolFile.root DEBUG --> Access DbContainer READ [ROOT_Tree] MetaDataHdrForm(DataHeaderForm) MetaDataHdrForm... DEBUG Opening MetaDataHdrForm... DEBUG attributes# = 1 @@ -802,6 +805,10 @@ SimplePoolFile2... DEBUG --->Reading Param:PFN=[SimplePoolFile2.root] SimplePoolFile2... DEBUG --->Reading Param:POOL_VSN=[1.1] SimplePoolFile2... DEBUG --->Reading Param:FORMAT_VSN=[1.1] ##Params DEBUG No objects passing selection criteria... Container has 4 Entries in total. +RootDatabase.se... DEBUG Request tree cache +RootDatabase.se... DEBUG File name SimplePoolFile2.root +RootDatabase.se... DEBUG Got tree CollectionTree read entry -1 +RootDatabase.se... DEBUG Using Tree cache. Size: -1 Nevents to learn with: -1 RootDatabase.se... DEBUG TREE_CACHE_LEARN_EVENTS = 6 RootDatabase.se... DEBUG Request tree cache RootDatabase.se... DEBUG File name SimplePoolFile2.root @@ -874,7 +881,7 @@ ReadData INFO EventInfo event: 0 run: 1 ReadData INFO Get Smart data ptr 1 ReadData INFO Could not find ExampleTrackContainer/MyTracks ReadData INFO Could not find ExampleHitContainer/MyHits -PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 18820 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 18805 PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 22 AthenaEventLoopMgr INFO ===>>> done processing event #0, run #1 11 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection @@ -902,7 +909,7 @@ ReadData INFO EventInfo event: 1 run: 1 ReadData INFO Get Smart data ptr 1 ReadData INFO Could not find ExampleTrackContainer/MyTracks ReadData INFO Could not find ExampleHitContainer/MyHits -PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 18820 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 18805 PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 22 AthenaEventLoopMgr INFO ===>>> done processing event #1, run #1 12 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection @@ -930,7 +937,7 @@ ReadData INFO EventInfo event: 2 run: 1 ReadData INFO Get Smart data ptr 1 ReadData INFO Could not find ExampleTrackContainer/MyTracks ReadData INFO Could not find ExampleHitContainer/MyHits -PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 18820 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 18805 PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 22 AthenaEventLoopMgr INFO ===>>> done processing event #2, run #1 13 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection @@ -958,7 +965,7 @@ ReadData INFO EventInfo event: 3 run: 1 ReadData INFO Get Smart data ptr 1 ReadData INFO Could not find ExampleTrackContainer/MyTracks ReadData INFO Could not find ExampleHitContainer/MyHits -PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 18820 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 18805 PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 22 AthenaEventLoopMgr INFO ===>>> done processing event #3, run #1 14 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection @@ -986,7 +993,7 @@ ReadData INFO EventInfo event: 4 run: 1 ReadData INFO Get Smart data ptr 1 ReadData INFO Could not find ExampleTrackContainer/MyTracks ReadData INFO Could not find ExampleHitContainer/MyHits -PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 18820 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 18805 PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 22 AthenaEventLoopMgr INFO ===>>> done processing event #4, run #1 15 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection @@ -1014,7 +1021,7 @@ ReadData INFO EventInfo event: 5 run: 1 ReadData INFO Get Smart data ptr 1 ReadData INFO Could not find ExampleTrackContainer/MyTracks ReadData INFO Could not find ExampleHitContainer/MyHits -PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 18820 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 18805 PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 22 AthenaEventLoopMgr INFO ===>>> done processing event #5, run #1 16 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection @@ -1042,7 +1049,7 @@ ReadData INFO EventInfo event: 6 run: 1 ReadData INFO Get Smart data ptr 1 ReadData INFO Could not find ExampleTrackContainer/MyTracks ReadData INFO Could not find ExampleHitContainer/MyHits -PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 18820 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 18805 PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 22 AthenaEventLoopMgr INFO ===>>> done processing event #6, run #1 17 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection @@ -1070,7 +1077,7 @@ ReadData INFO EventInfo event: 7 run: 1 ReadData INFO Get Smart data ptr 1 ReadData INFO Could not find ExampleTrackContainer/MyTracks ReadData INFO Could not find ExampleHitContainer/MyHits -PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 18820 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 18805 PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 22 AthenaEventLoopMgr INFO ===>>> done processing event #7, run #1 18 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection @@ -1098,7 +1105,7 @@ ReadData INFO EventInfo event: 8 run: 1 ReadData INFO Get Smart data ptr 1 ReadData INFO Could not find ExampleTrackContainer/MyTracks ReadData INFO Could not find ExampleHitContainer/MyHits -PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 18820 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 18805 PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 22 AthenaEventLoopMgr INFO ===>>> done processing event #8, run #1 19 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection @@ -1126,7 +1133,7 @@ ReadData INFO EventInfo event: 9 run: 1 ReadData INFO Get Smart data ptr 1 ReadData INFO Could not find ExampleTrackContainer/MyTracks ReadData INFO Could not find ExampleHitContainer/MyHits -PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 18820 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 18805 PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 22 AthenaEventLoopMgr INFO ===>>> done processing event #9, run #1 20 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection @@ -1154,7 +1161,7 @@ ReadData INFO EventInfo event: 10 run: 1 ReadData INFO Get Smart data ptr 1 ReadData INFO Could not find ExampleTrackContainer/MyTracks ReadData INFO Could not find ExampleHitContainer/MyHits -PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 18820 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 18805 PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 22 AthenaEventLoopMgr INFO ===>>> done processing event #10, run #1 21 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection @@ -1182,7 +1189,7 @@ ReadData INFO EventInfo event: 11 run: 1 ReadData INFO Get Smart data ptr 1 ReadData INFO Could not find ExampleTrackContainer/MyTracks ReadData INFO Could not find ExampleHitContainer/MyHits -PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 18820 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 18805 PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 22 AthenaEventLoopMgr INFO ===>>> done processing event #11, run #1 22 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection @@ -1210,7 +1217,7 @@ ReadData INFO EventInfo event: 12 run: 1 ReadData INFO Get Smart data ptr 1 ReadData INFO Could not find ExampleTrackContainer/MyTracks ReadData INFO Could not find ExampleHitContainer/MyHits -PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 18820 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 18805 PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 22 AthenaEventLoopMgr INFO ===>>> done processing event #12, run #1 23 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection @@ -1238,7 +1245,7 @@ ReadData INFO EventInfo event: 13 run: 1 ReadData INFO Get Smart data ptr 1 ReadData INFO Could not find ExampleTrackContainer/MyTracks ReadData INFO Could not find ExampleHitContainer/MyHits -PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 18820 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 18805 PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 22 AthenaEventLoopMgr INFO ===>>> done processing event #13, run #1 24 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection @@ -1266,7 +1273,7 @@ ReadData INFO EventInfo event: 14 run: 1 ReadData INFO Get Smart data ptr 1 ReadData INFO Could not find ExampleTrackContainer/MyTracks ReadData INFO Could not find ExampleHitContainer/MyHits -PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 18820 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 18805 PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 22 AthenaEventLoopMgr INFO ===>>> done processing event #14, run #1 25 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection @@ -1294,7 +1301,7 @@ ReadData INFO EventInfo event: 15 run: 1 ReadData INFO Get Smart data ptr 1 ReadData INFO Could not find ExampleTrackContainer/MyTracks ReadData INFO Could not find ExampleHitContainer/MyHits -PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 18820 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 18805 PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 22 AthenaEventLoopMgr INFO ===>>> done processing event #15, run #1 26 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection @@ -1322,7 +1329,7 @@ ReadData INFO EventInfo event: 16 run: 1 ReadData INFO Get Smart data ptr 1 ReadData INFO Could not find ExampleTrackContainer/MyTracks ReadData INFO Could not find ExampleHitContainer/MyHits -PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 18820 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 18805 PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 22 AthenaEventLoopMgr INFO ===>>> done processing event #16, run #1 27 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection @@ -1350,7 +1357,7 @@ ReadData INFO EventInfo event: 17 run: 1 ReadData INFO Get Smart data ptr 1 ReadData INFO Could not find ExampleTrackContainer/MyTracks ReadData INFO Could not find ExampleHitContainer/MyHits -PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 18820 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 18805 PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 22 AthenaEventLoopMgr INFO ===>>> done processing event #17, run #1 28 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection @@ -1378,7 +1385,7 @@ ReadData INFO EventInfo event: 18 run: 1 ReadData INFO Get Smart data ptr 1 ReadData INFO Could not find ExampleTrackContainer/MyTracks ReadData INFO Could not find ExampleHitContainer/MyHits -PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 18820 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 18805 PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 22 AthenaEventLoopMgr INFO ===>>> done processing event #18, run #1 29 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection @@ -1406,7 +1413,7 @@ ReadData INFO EventInfo event: 19 run: 1 ReadData INFO Get Smart data ptr 1 ReadData INFO Could not find ExampleTrackContainer/MyTracks ReadData INFO Could not find ExampleHitContainer/MyHits -PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 18820 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 18805 PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 22 AthenaEventLoopMgr INFO ===>>> done processing event #19, run #1 30 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection @@ -1435,8 +1442,8 @@ ReadData INFO EventInfo event: 20 run: 2 ReadData INFO Get Smart data ptr 1 ReadData INFO Could not find ExampleTrackContainer/MyTracks ReadData INFO Could not find ExampleHitContainer/MyHits -PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 20446 -PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 25 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 19192 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 23 AthenaEventLoopMgr INFO ===>>> done processing event #20, run #2 31 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection EventSelector DEBUG AttributeList size 3 @@ -1463,8 +1470,8 @@ ReadData INFO EventInfo event: 21 run: 2 ReadData INFO Get Smart data ptr 1 ReadData INFO Could not find ExampleTrackContainer/MyTracks ReadData INFO Could not find ExampleHitContainer/MyHits -PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 20446 -PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 25 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 19192 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 23 AthenaEventLoopMgr INFO ===>>> done processing event #21, run #2 32 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection EventSelector DEBUG AttributeList size 3 @@ -1491,8 +1498,8 @@ ReadData INFO EventInfo event: 22 run: 2 ReadData INFO Get Smart data ptr 1 ReadData INFO Could not find ExampleTrackContainer/MyTracks ReadData INFO Could not find ExampleHitContainer/MyHits -PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 20446 -PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 25 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 19192 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 23 AthenaEventLoopMgr INFO ===>>> done processing event #22, run #2 33 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection EventSelector DEBUG AttributeList size 3 @@ -1519,8 +1526,8 @@ ReadData INFO EventInfo event: 23 run: 2 ReadData INFO Get Smart data ptr 1 ReadData INFO Could not find ExampleTrackContainer/MyTracks ReadData INFO Could not find ExampleHitContainer/MyHits -PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 20446 -PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 25 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 19192 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 23 AthenaEventLoopMgr INFO ===>>> done processing event #23, run #2 34 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection EventSelector DEBUG AttributeList size 3 @@ -1547,8 +1554,8 @@ ReadData INFO EventInfo event: 24 run: 2 ReadData INFO Get Smart data ptr 1 ReadData INFO Could not find ExampleTrackContainer/MyTracks ReadData INFO Could not find ExampleHitContainer/MyHits -PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 20446 -PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 25 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 19192 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 23 AthenaEventLoopMgr INFO ===>>> done processing event #24, run #2 35 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection EventSelector DEBUG AttributeList size 3 @@ -1575,8 +1582,8 @@ ReadData INFO EventInfo event: 25 run: 2 ReadData INFO Get Smart data ptr 1 ReadData INFO Could not find ExampleTrackContainer/MyTracks ReadData INFO Could not find ExampleHitContainer/MyHits -PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 20446 -PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 25 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 19192 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 23 AthenaEventLoopMgr INFO ===>>> done processing event #25, run #2 36 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection EventSelector DEBUG AttributeList size 3 @@ -1603,8 +1610,8 @@ ReadData INFO EventInfo event: 26 run: 2 ReadData INFO Get Smart data ptr 1 ReadData INFO Could not find ExampleTrackContainer/MyTracks ReadData INFO Could not find ExampleHitContainer/MyHits -PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 20446 -PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 25 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 19192 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 23 AthenaEventLoopMgr INFO ===>>> done processing event #26, run #2 37 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection EventSelector DEBUG AttributeList size 3 @@ -1631,8 +1638,8 @@ ReadData INFO EventInfo event: 27 run: 2 ReadData INFO Get Smart data ptr 1 ReadData INFO Could not find ExampleTrackContainer/MyTracks ReadData INFO Could not find ExampleHitContainer/MyHits -PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 20446 -PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 25 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 19192 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 23 AthenaEventLoopMgr INFO ===>>> done processing event #27, run #2 38 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection EventSelector DEBUG AttributeList size 3 @@ -1659,8 +1666,8 @@ ReadData INFO EventInfo event: 28 run: 2 ReadData INFO Get Smart data ptr 1 ReadData INFO Could not find ExampleTrackContainer/MyTracks ReadData INFO Could not find ExampleHitContainer/MyHits -PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 20446 -PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 25 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 19192 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 23 AthenaEventLoopMgr INFO ===>>> done processing event #28, run #2 39 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection EventSelector DEBUG AttributeList size 3 @@ -1687,8 +1694,8 @@ ReadData INFO EventInfo event: 29 run: 2 ReadData INFO Get Smart data ptr 1 ReadData INFO Could not find ExampleTrackContainer/MyTracks ReadData INFO Could not find ExampleHitContainer/MyHits -PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 20446 -PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 25 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 19192 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 23 AthenaEventLoopMgr INFO ===>>> done processing event #29, run #2 40 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection EventSelector DEBUG AttributeList size 3 @@ -1715,8 +1722,8 @@ ReadData INFO EventInfo event: 30 run: 2 ReadData INFO Get Smart data ptr 1 ReadData INFO Could not find ExampleTrackContainer/MyTracks ReadData INFO Could not find ExampleHitContainer/MyHits -PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 20446 -PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 25 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 19192 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 23 AthenaEventLoopMgr INFO ===>>> done processing event #30, run #2 41 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection EventSelector DEBUG AttributeList size 3 @@ -1743,8 +1750,8 @@ ReadData INFO EventInfo event: 31 run: 2 ReadData INFO Get Smart data ptr 1 ReadData INFO Could not find ExampleTrackContainer/MyTracks ReadData INFO Could not find ExampleHitContainer/MyHits -PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 20446 -PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 25 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 19192 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 23 AthenaEventLoopMgr INFO ===>>> done processing event #31, run #2 42 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection EventSelector DEBUG AttributeList size 3 @@ -1771,8 +1778,8 @@ ReadData INFO EventInfo event: 32 run: 2 ReadData INFO Get Smart data ptr 1 ReadData INFO Could not find ExampleTrackContainer/MyTracks ReadData INFO Could not find ExampleHitContainer/MyHits -PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 20446 -PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 25 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 19192 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 23 AthenaEventLoopMgr INFO ===>>> done processing event #32, run #2 43 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection EventSelector DEBUG AttributeList size 3 @@ -1799,8 +1806,8 @@ ReadData INFO EventInfo event: 33 run: 2 ReadData INFO Get Smart data ptr 1 ReadData INFO Could not find ExampleTrackContainer/MyTracks ReadData INFO Could not find ExampleHitContainer/MyHits -PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 20446 -PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 25 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 19192 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 23 AthenaEventLoopMgr INFO ===>>> done processing event #33, run #2 44 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection EventSelector DEBUG AttributeList size 3 @@ -1827,8 +1834,8 @@ ReadData INFO EventInfo event: 34 run: 2 ReadData INFO Get Smart data ptr 1 ReadData INFO Could not find ExampleTrackContainer/MyTracks ReadData INFO Could not find ExampleHitContainer/MyHits -PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 20446 -PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 25 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 19192 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 23 AthenaEventLoopMgr INFO ===>>> done processing event #34, run #2 45 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection EventSelector DEBUG AttributeList size 3 @@ -1855,8 +1862,8 @@ ReadData INFO EventInfo event: 35 run: 2 ReadData INFO Get Smart data ptr 1 ReadData INFO Could not find ExampleTrackContainer/MyTracks ReadData INFO Could not find ExampleHitContainer/MyHits -PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 20446 -PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 25 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 19192 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 23 AthenaEventLoopMgr INFO ===>>> done processing event #35, run #2 46 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection EventSelector DEBUG AttributeList size 3 @@ -1883,8 +1890,8 @@ ReadData INFO EventInfo event: 36 run: 2 ReadData INFO Get Smart data ptr 1 ReadData INFO Could not find ExampleTrackContainer/MyTracks ReadData INFO Could not find ExampleHitContainer/MyHits -PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 20446 -PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 25 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 19192 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 23 AthenaEventLoopMgr INFO ===>>> done processing event #36, run #2 47 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection EventSelector DEBUG AttributeList size 3 @@ -1911,8 +1918,8 @@ ReadData INFO EventInfo event: 37 run: 2 ReadData INFO Get Smart data ptr 1 ReadData INFO Could not find ExampleTrackContainer/MyTracks ReadData INFO Could not find ExampleHitContainer/MyHits -PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 20446 -PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 25 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 19192 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 23 AthenaEventLoopMgr INFO ===>>> done processing event #37, run #2 48 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection EventSelector DEBUG AttributeList size 3 @@ -1939,8 +1946,8 @@ ReadData INFO EventInfo event: 38 run: 2 ReadData INFO Get Smart data ptr 1 ReadData INFO Could not find ExampleTrackContainer/MyTracks ReadData INFO Could not find ExampleHitContainer/MyHits -PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 20446 -PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 25 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 19192 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 23 AthenaEventLoopMgr INFO ===>>> done processing event #38, run #2 49 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection EventSelector DEBUG AttributeList size 3 @@ -1967,8 +1974,8 @@ ReadData INFO EventInfo event: 39 run: 2 ReadData INFO Get Smart data ptr 1 ReadData INFO Could not find ExampleTrackContainer/MyTracks ReadData INFO Could not find ExampleHitContainer/MyHits -PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 20446 -PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 25 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 19192 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 23 AthenaEventLoopMgr INFO ===>>> done processing event #39, run #2 50 events processed so far <<<=== MetaDataSvc DEBUG handle() EndInputFile for FID:???? EventSelector INFO Disconnecting input sourceID: ???? @@ -2037,10 +2044,14 @@ SimplePoolFile4... DEBUG --->Reading Param:PFN=[SimplePoolFile4.root] SimplePoolFile4... DEBUG --->Reading Param:POOL_VSN=[1.1] SimplePoolFile4... DEBUG --->Reading Param:FORMAT_VSN=[1.1] ##Params DEBUG No objects passing selection criteria... Container has 4 Entries in total. -RootDatabase.se... DEBUG TREE_CACHE_LEARN_EVENTS = 6 RootDatabase.se... DEBUG Request tree cache RootDatabase.se... DEBUG File name SimplePoolFile4.root RootDatabase.se... DEBUG Got tree CollectionTree read entry -1 +RootDatabase.se... DEBUG Using Tree cache. Size: -1 Nevents to learn with: -1 +RootDatabase.se... DEBUG TREE_CACHE_LEARN_EVENTS = 6 +RootDatabase.se... DEBUG Request tree cache +RootDatabase.se... DEBUG File name SimplePoolFile4.root +RootDatabase.se... DEBUG Got tree CollectionTree read entry -1 RootDatabase.se... DEBUG Using Tree cache. Size: 100000 Nevents to learn with: 6 PoolSvc INFO Database (SimplePoolFile4.root) attribute [TREE_CACHE_LEARN_EVENTS]: 6 PoolSvc INFO Database (SimplePoolFile4.root) attribute [TREE_CACHE_SIZE]: 100000 @@ -2107,7 +2118,7 @@ ReadData INFO Track pt = 74.8928 eta = 3.1676 phi = 2.6161 detector DataProxy WARNING accessData: IOA pointer not set ReadData WARNING Could not follow ExampleTrackContainer/MyTracks ElementLinks to ExampleHitContainer/MyHits ReadData INFO Could not find ExampleHitContainer/MyHits -PoolSvc INFO Database (SimplePoolFile4.root) attribute [BYTES_READ]: 19010 +PoolSvc INFO Database (SimplePoolFile4.root) attribute [BYTES_READ]: 19065 PoolSvc INFO Database (SimplePoolFile4.root) attribute [READ_CALLS]: 21 AthenaEventLoopMgr INFO ===>>> done processing event #0, run #1 51 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection @@ -2133,7 +2144,7 @@ ReadData INFO Track pt = 137.584 eta = -39.525 phi = 17.2679 detecto DataProxy WARNING accessData: IOA pointer not set ReadData WARNING Could not follow ExampleTrackContainer/MyTracks ElementLinks to ExampleHitContainer/MyHits ReadData INFO Could not find ExampleHitContainer/MyHits -PoolSvc INFO Database (SimplePoolFile4.root) attribute [BYTES_READ]: 19010 +PoolSvc INFO Database (SimplePoolFile4.root) attribute [BYTES_READ]: 19065 PoolSvc INFO Database (SimplePoolFile4.root) attribute [READ_CALLS]: 21 AthenaEventLoopMgr INFO ===>>> done processing event #1, run #1 52 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection @@ -2159,7 +2170,7 @@ ReadData INFO Track pt = 228.154 eta = -6.2704 phi = 31.9197 detecto DataProxy WARNING accessData: IOA pointer not set ReadData WARNING Could not follow ExampleTrackContainer/MyTracks ElementLinks to ExampleHitContainer/MyHits ReadData INFO Could not find ExampleHitContainer/MyHits -PoolSvc INFO Database (SimplePoolFile4.root) attribute [BYTES_READ]: 19010 +PoolSvc INFO Database (SimplePoolFile4.root) attribute [BYTES_READ]: 19065 PoolSvc INFO Database (SimplePoolFile4.root) attribute [READ_CALLS]: 21 AthenaEventLoopMgr INFO ===>>> done processing event #2, run #1 53 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection @@ -2185,7 +2196,7 @@ ReadData INFO Track pt = 324.306 eta = -15.8941 phi = 46.5715 detect DataProxy WARNING accessData: IOA pointer not set ReadData WARNING Could not follow ExampleTrackContainer/MyTracks ElementLinks to ExampleHitContainer/MyHits ReadData INFO Could not find ExampleHitContainer/MyHits -PoolSvc INFO Database (SimplePoolFile4.root) attribute [BYTES_READ]: 19010 +PoolSvc INFO Database (SimplePoolFile4.root) attribute [BYTES_READ]: 19065 PoolSvc INFO Database (SimplePoolFile4.root) attribute [READ_CALLS]: 21 AthenaEventLoopMgr INFO ===>>> done processing event #3, run #1 54 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection @@ -2211,7 +2222,7 @@ ReadData INFO Track pt = 422.255 eta = -13.279 phi = 61.2233 detecto DataProxy WARNING accessData: IOA pointer not set ReadData WARNING Could not follow ExampleTrackContainer/MyTracks ElementLinks to ExampleHitContainer/MyHits ReadData INFO Could not find ExampleHitContainer/MyHits -PoolSvc INFO Database (SimplePoolFile4.root) attribute [BYTES_READ]: 19010 +PoolSvc INFO Database (SimplePoolFile4.root) attribute [BYTES_READ]: 19065 PoolSvc INFO Database (SimplePoolFile4.root) attribute [READ_CALLS]: 21 AthenaEventLoopMgr INFO ===>>> done processing event #4, run #1 55 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection @@ -2237,7 +2248,7 @@ ReadData INFO Track pt = 520.987 eta = -12.3511 phi = 75.8751 detect DataProxy WARNING accessData: IOA pointer not set ReadData WARNING Could not follow ExampleTrackContainer/MyTracks ElementLinks to ExampleHitContainer/MyHits ReadData INFO Could not find ExampleHitContainer/MyHits -PoolSvc INFO Database (SimplePoolFile4.root) attribute [BYTES_READ]: 19010 +PoolSvc INFO Database (SimplePoolFile4.root) attribute [BYTES_READ]: 19065 PoolSvc INFO Database (SimplePoolFile4.root) attribute [READ_CALLS]: 21 AthenaEventLoopMgr INFO ===>>> done processing event #5, run #1 56 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection @@ -2263,7 +2274,7 @@ ReadData INFO Track pt = 620.127 eta = -11.8468 phi = 90.5269 detect DataProxy WARNING accessData: IOA pointer not set ReadData WARNING Could not follow ExampleTrackContainer/MyTracks ElementLinks to ExampleHitContainer/MyHits ReadData INFO Could not find ExampleHitContainer/MyHits -PoolSvc INFO Database (SimplePoolFile4.root) attribute [BYTES_READ]: 19010 +PoolSvc INFO Database (SimplePoolFile4.root) attribute [BYTES_READ]: 19065 PoolSvc INFO Database (SimplePoolFile4.root) attribute [READ_CALLS]: 21 AthenaEventLoopMgr INFO ===>>> done processing event #6, run #1 57 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection @@ -2289,7 +2300,7 @@ ReadData INFO Track pt = 719.507 eta = -11.5247 phi = 105.179 detect DataProxy WARNING accessData: IOA pointer not set ReadData WARNING Could not follow ExampleTrackContainer/MyTracks ElementLinks to ExampleHitContainer/MyHits ReadData INFO Could not find ExampleHitContainer/MyHits -PoolSvc INFO Database (SimplePoolFile4.root) attribute [BYTES_READ]: 19010 +PoolSvc INFO Database (SimplePoolFile4.root) attribute [BYTES_READ]: 19065 PoolSvc INFO Database (SimplePoolFile4.root) attribute [READ_CALLS]: 21 AthenaEventLoopMgr INFO ===>>> done processing event #7, run #1 58 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection @@ -2315,7 +2326,7 @@ ReadData INFO Track pt = 819.038 eta = -11.2998 phi = 119.831 detect DataProxy WARNING accessData: IOA pointer not set ReadData WARNING Could not follow ExampleTrackContainer/MyTracks ElementLinks to ExampleHitContainer/MyHits ReadData INFO Could not find ExampleHitContainer/MyHits -PoolSvc INFO Database (SimplePoolFile4.root) attribute [BYTES_READ]: 19010 +PoolSvc INFO Database (SimplePoolFile4.root) attribute [BYTES_READ]: 19065 PoolSvc INFO Database (SimplePoolFile4.root) attribute [READ_CALLS]: 21 AthenaEventLoopMgr INFO ===>>> done processing event #8, run #1 59 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection @@ -2341,7 +2352,7 @@ ReadData INFO Track pt = 918.671 eta = -11.1334 phi = 134.482 detect DataProxy WARNING accessData: IOA pointer not set ReadData WARNING Could not follow ExampleTrackContainer/MyTracks ElementLinks to ExampleHitContainer/MyHits ReadData INFO Could not find ExampleHitContainer/MyHits -PoolSvc INFO Database (SimplePoolFile4.root) attribute [BYTES_READ]: 19010 +PoolSvc INFO Database (SimplePoolFile4.root) attribute [BYTES_READ]: 19065 PoolSvc INFO Database (SimplePoolFile4.root) attribute [READ_CALLS]: 21 AthenaEventLoopMgr INFO ===>>> done processing event #9, run #1 60 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection @@ -2367,7 +2378,7 @@ ReadData INFO Track pt = 1018.38 eta = -11.0052 phi = 149.134 detect DataProxy WARNING accessData: IOA pointer not set ReadData WARNING Could not follow ExampleTrackContainer/MyTracks ElementLinks to ExampleHitContainer/MyHits ReadData INFO Could not find ExampleHitContainer/MyHits -PoolSvc INFO Database (SimplePoolFile4.root) attribute [BYTES_READ]: 19010 +PoolSvc INFO Database (SimplePoolFile4.root) attribute [BYTES_READ]: 19065 PoolSvc INFO Database (SimplePoolFile4.root) attribute [READ_CALLS]: 21 AthenaEventLoopMgr INFO ===>>> done processing event #10, run #1 61 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection @@ -2393,7 +2404,7 @@ ReadData INFO Track pt = 1118.13 eta = -10.9031 phi = 163.786 detect DataProxy WARNING accessData: IOA pointer not set ReadData WARNING Could not follow ExampleTrackContainer/MyTracks ElementLinks to ExampleHitContainer/MyHits ReadData INFO Could not find ExampleHitContainer/MyHits -PoolSvc INFO Database (SimplePoolFile4.root) attribute [BYTES_READ]: 19010 +PoolSvc INFO Database (SimplePoolFile4.root) attribute [BYTES_READ]: 19065 PoolSvc INFO Database (SimplePoolFile4.root) attribute [READ_CALLS]: 21 AthenaEventLoopMgr INFO ===>>> done processing event #11, run #1 62 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection @@ -2419,7 +2430,7 @@ ReadData INFO Track pt = 1217.93 eta = -10.82 phi = 178.438 detector DataProxy WARNING accessData: IOA pointer not set ReadData WARNING Could not follow ExampleTrackContainer/MyTracks ElementLinks to ExampleHitContainer/MyHits ReadData INFO Could not find ExampleHitContainer/MyHits -PoolSvc INFO Database (SimplePoolFile4.root) attribute [BYTES_READ]: 19010 +PoolSvc INFO Database (SimplePoolFile4.root) attribute [BYTES_READ]: 19065 PoolSvc INFO Database (SimplePoolFile4.root) attribute [READ_CALLS]: 21 AthenaEventLoopMgr INFO ===>>> done processing event #12, run #1 63 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection @@ -2445,7 +2456,7 @@ ReadData INFO Track pt = 1317.76 eta = -10.751 phi = 193.09 detector DataProxy WARNING accessData: IOA pointer not set ReadData WARNING Could not follow ExampleTrackContainer/MyTracks ElementLinks to ExampleHitContainer/MyHits ReadData INFO Could not find ExampleHitContainer/MyHits -PoolSvc INFO Database (SimplePoolFile4.root) attribute [BYTES_READ]: 19010 +PoolSvc INFO Database (SimplePoolFile4.root) attribute [BYTES_READ]: 19065 PoolSvc INFO Database (SimplePoolFile4.root) attribute [READ_CALLS]: 21 AthenaEventLoopMgr INFO ===>>> done processing event #13, run #1 64 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection @@ -2471,7 +2482,7 @@ ReadData INFO Track pt = 1417.61 eta = -10.6927 phi = 207.741 detect DataProxy WARNING accessData: IOA pointer not set ReadData WARNING Could not follow ExampleTrackContainer/MyTracks ElementLinks to ExampleHitContainer/MyHits ReadData INFO Could not find ExampleHitContainer/MyHits -PoolSvc INFO Database (SimplePoolFile4.root) attribute [BYTES_READ]: 19010 +PoolSvc INFO Database (SimplePoolFile4.root) attribute [BYTES_READ]: 19065 PoolSvc INFO Database (SimplePoolFile4.root) attribute [READ_CALLS]: 21 AthenaEventLoopMgr INFO ===>>> done processing event #14, run #1 65 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection @@ -2497,7 +2508,7 @@ ReadData INFO Track pt = 1517.49 eta = -10.6429 phi = 222.393 detect DataProxy WARNING accessData: IOA pointer not set ReadData WARNING Could not follow ExampleTrackContainer/MyTracks ElementLinks to ExampleHitContainer/MyHits ReadData INFO Could not find ExampleHitContainer/MyHits -PoolSvc INFO Database (SimplePoolFile4.root) attribute [BYTES_READ]: 19010 +PoolSvc INFO Database (SimplePoolFile4.root) attribute [BYTES_READ]: 19065 PoolSvc INFO Database (SimplePoolFile4.root) attribute [READ_CALLS]: 21 AthenaEventLoopMgr INFO ===>>> done processing event #15, run #1 66 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection @@ -2523,7 +2534,7 @@ ReadData INFO Track pt = 1617.37 eta = -10.5997 phi = 237.045 detect DataProxy WARNING accessData: IOA pointer not set ReadData WARNING Could not follow ExampleTrackContainer/MyTracks ElementLinks to ExampleHitContainer/MyHits ReadData INFO Could not find ExampleHitContainer/MyHits -PoolSvc INFO Database (SimplePoolFile4.root) attribute [BYTES_READ]: 19010 +PoolSvc INFO Database (SimplePoolFile4.root) attribute [BYTES_READ]: 19065 PoolSvc INFO Database (SimplePoolFile4.root) attribute [READ_CALLS]: 21 AthenaEventLoopMgr INFO ===>>> done processing event #16, run #1 67 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection @@ -2549,7 +2560,7 @@ ReadData INFO Track pt = 1717.27 eta = -10.562 phi = 251.697 detecto DataProxy WARNING accessData: IOA pointer not set ReadData WARNING Could not follow ExampleTrackContainer/MyTracks ElementLinks to ExampleHitContainer/MyHits ReadData INFO Could not find ExampleHitContainer/MyHits -PoolSvc INFO Database (SimplePoolFile4.root) attribute [BYTES_READ]: 19010 +PoolSvc INFO Database (SimplePoolFile4.root) attribute [BYTES_READ]: 19065 PoolSvc INFO Database (SimplePoolFile4.root) attribute [READ_CALLS]: 21 AthenaEventLoopMgr INFO ===>>> done processing event #17, run #1 68 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection @@ -2575,7 +2586,7 @@ ReadData INFO Track pt = 1817.19 eta = -10.5288 phi = 266.349 detect DataProxy WARNING accessData: IOA pointer not set ReadData WARNING Could not follow ExampleTrackContainer/MyTracks ElementLinks to ExampleHitContainer/MyHits ReadData INFO Could not find ExampleHitContainer/MyHits -PoolSvc INFO Database (SimplePoolFile4.root) attribute [BYTES_READ]: 19010 +PoolSvc INFO Database (SimplePoolFile4.root) attribute [BYTES_READ]: 19065 PoolSvc INFO Database (SimplePoolFile4.root) attribute [READ_CALLS]: 21 AthenaEventLoopMgr INFO ===>>> done processing event #18, run #1 69 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection @@ -2601,7 +2612,7 @@ ReadData INFO Track pt = 1917.11 eta = -10.4993 phi = 281 detector = DataProxy WARNING accessData: IOA pointer not set ReadData WARNING Could not follow ExampleTrackContainer/MyTracks ElementLinks to ExampleHitContainer/MyHits ReadData INFO Could not find ExampleHitContainer/MyHits -PoolSvc INFO Database (SimplePoolFile4.root) attribute [BYTES_READ]: 19010 +PoolSvc INFO Database (SimplePoolFile4.root) attribute [BYTES_READ]: 19065 PoolSvc INFO Database (SimplePoolFile4.root) attribute [READ_CALLS]: 21 AthenaEventLoopMgr INFO ===>>> done processing event #19, run #1 70 events processed so far <<<=== MetaDataSvc DEBUG handle() EndInputFile for FID:???? @@ -2620,9 +2631,9 @@ ToolSvc INFO Removing all tools created by ToolSvc *****Chrono***** INFO **************************************************************************************************** *****Chrono***** INFO The Final CPU consumption ( Chrono ) Table (ordered) *****Chrono***** INFO **************************************************************************************************** -cObjR_ALL INFO Time User : Tot= 20 [ms] Ave/Min/Max=0.104(+- 1.02)/ 0/ 10 [ms] #=192 -cObj_ALL INFO Time User : Tot= 70 [ms] Ave/Min/Max=0.387(+- 2.43)/ 0/ 20 [ms] #=181 -ChronoStatSvc INFO Time User : Tot= 0.89 [s] #= 1 +cObjR_ALL INFO Time User : Tot= 0 [us] Ave/Min/Max= 0(+- 0)/ 0/ 0 [us] #=124 +cObj_ALL INFO Time User : Tot= 50 [ms] Ave/Min/Max=0.439(+- 2.78)/ 0/ 20 [ms] #=114 +ChronoStatSvc INFO Time User : Tot= 1.05 [s] #= 1 *****Chrono***** INFO **************************************************************************************************** ChronoStatSvc.f... INFO Service finalized successfully ApplicationMgr INFO Application Manager Finalized successfully diff --git a/Database/AthenaPOOL/AthenaPoolExample/AthenaPoolExampleAlgorithms/share/AthenaPoolExample_ReadConcat.ref b/Database/AthenaPOOL/AthenaPoolExample/AthenaPoolExampleAlgorithms/share/AthenaPoolExample_ReadConcat.ref index 9fa6db27cc1072c92d3880fbcbe1c000e515e837..9d981c2841f22ceb545527ea025a8f984dbee0ed 100644 --- a/Database/AthenaPOOL/AthenaPoolExample/AthenaPoolExampleAlgorithms/share/AthenaPoolExample_ReadConcat.ref +++ b/Database/AthenaPOOL/AthenaPoolExample/AthenaPoolExampleAlgorithms/share/AthenaPoolExample_ReadConcat.ref @@ -1,18 +1,19 @@ -Tue Oct 9 17:11:10 CDT 2018 +Fri Oct 19 21:29:44 CEST 2018 Preloading tcmalloc_minimal.so Athena INFO including file "AthenaCommon/Preparation.py" Athena INFO including file "AthenaCommon/Atlas.UnixStandardJob.py" Athena INFO executing ROOT6Setup Athena INFO including file "AthenaCommon/Execution.py" Athena INFO including file "AthenaPoolExampleAlgorithms/AthenaPoolExample_ReadJobOptions.py" -Py:ConfigurableDb INFO Read module info for 5512 configurables from 127 genConfDb files +Py:ConfigurableDb INFO Read module info for 5521 configurables from 57 genConfDb files +Py:ConfigurableDb INFO No duplicates have been found: that's good ! Athena INFO including file "AthenaCommon/runbatch.py" [?1034hApplicationMgr INFO Updating Gaudi::PluginService::SetDebug(level) to level= 'PluginDebugLevel':0 ApplicationMgr INFO Updating Gaudi::PluginService::SetDebug(level) to level= 'PluginDebugLevel':0 ApplicationMgr SUCCESS ==================================================================================================================================== Welcome to ApplicationMgr (GaudiCoreSvc v30r3) - running on atlas8.hep.anl.gov on Tue Oct 9 17:11:24 2018 + running on lxplus060.cern.ch on Fri Oct 19 21:30:02 2018 ==================================================================================================================================== ApplicationMgr INFO Successfully loaded modules : AthenaServices ApplicationMgr INFO Application Manager Configured successfully @@ -34,9 +35,9 @@ PoolSvc DEBUG Property update for OutputLevel : new value = 2 PoolSvc DEBUG Service base class initialized successfully PoolSvc INFO Set connectionsvc retry/timeout/IDLE timeout to 'ConnectionRetrialPeriod':300/ 'ConnectionRetrialTimeOut':3600/ 'ConnectionTimeOut':5 seconds with connection cleanup disabled PoolSvc INFO Frontier compression level set to 5 -DBReplicaSvc INFO Frontier server at (serverurl=http://atlasfrontier-ai.cern.ch:8000/atlr)(serverurl=http://lcgft-atlas.gridpp.rl.ac.uk:3128/frontierATLAS)(serverurl=http://frontier-atlas.lcg.triumf.ca:3128/ATLAS_frontier)(serverurl=http://ccfrontier.in2p3.fr:23128/ccin2p3-AtlasFrontier)(proxyurl=http://atlasbpfrontier.cern.ch:3127)(proxyurl=http://atlasbpfrontier.fnal.gov:3127) will be considered for COOL data -DBReplicaSvc INFO Read replica configuration from /users/gemmeren/workarea/build/x86_64-slc6-gcc62-opt/share/dbreplica.config -DBReplicaSvc INFO Total of 1 servers found for host atlas8.hep.anl.gov [ATLF ] +DBReplicaSvc INFO Frontier server at (serverurl=http://atlasfrontier-local.cern.ch:8000/atlr)(serverurl=http://atlasfrontier-ai.cern.ch:8000/atlr)(serverurl=http://lcgft-atlas.gridpp.rl.ac.uk:3128/frontierATLAS)(serverurl=http://ccfrontier.in2p3.fr:23128/ccin2p3-AtlasFrontier)(proxyurl=http://ca-proxy.cern.ch:3128)(proxyurl=http://ca-proxy-meyrin.cern.ch:3128)(proxyurl=http://ca-proxy-wigner.cern.ch:3128)(proxyurl=http://atlasbpfrontier.cern.ch:3127)(proxyurl=http://atlasbpfrontier.fnal.gov:3127) will be considered for COOL data +DBReplicaSvc INFO Read replica configuration from /cvmfs/atlas-nightlies.cern.ch/repo/sw/master/2018-10-18T2340/Athena/22.0.1/InstallArea/x86_64-slc6-gcc8-opt/share/dbreplica.config +DBReplicaSvc INFO Total of 10 servers found for host lxplus060.cern.ch [ATLF ATLAS_COOLPROD atlas_dd ATLAS_CONFIG INT8R INTR ATONR_COOL ATONR_CONF DEVDB11 ATLF ] PoolSvc INFO Successfully setup replica sorting algorithm PoolSvc DEBUG OutputLevel is PoolSvc INFO Setting up APR FileCatalog and Streams @@ -154,7 +155,7 @@ MetaDataHdr(Dat... DEBUG Opening MetaDataHdr(Dat... DEBUG attributes# = 1 MetaDataHdr(Dat... DEBUG Branch container 'DataHeader' MetaDataHdr(Dat... DEBUG Opened container MetaDataHdr(DataHeader) of type ROOT_Tree -ClassIDSvc INFO getRegistryEntries: read 1961 CLIDRegistry entries for module ALL +ClassIDSvc INFO getRegistryEntries: read 2012 CLIDRegistry entries for module ALL EventPersistenc... INFO Added successfully Conversion service:AthenaPoolCnvSvc SimplePoolFile1... DEBUG --> Access DbContainer READ [ROOT_Tree] MetaDataHdrForm(DataHeaderForm) MetaDataHdrForm... DEBUG Opening @@ -291,6 +292,10 @@ POOLContainer(D... DEBUG attributes# = 1 POOLContainer(D... DEBUG Branch container 'DataHeader' POOLContainer(D... DEBUG Opened container POOLContainer(DataHeader) of type ROOT_Tree ApplicationMgr INFO Application Manager Started successfully +RootDatabase.se... DEBUG Request tree cache +RootDatabase.se... DEBUG File name SimplePoolFile1.root +RootDatabase.se... DEBUG Got tree CollectionTree read entry -1 +RootDatabase.se... DEBUG Using Tree cache. Size: -1 Nevents to learn with: -1 RootDatabase.se... DEBUG TREE_CACHE_LEARN_EVENTS = 6 RootDatabase.se... DEBUG Request tree cache RootDatabase.se... DEBUG File name SimplePoolFile1.root @@ -375,7 +380,7 @@ ReadData INFO Hit x = 1020.49 y = 63.5816 z = -951.864 detector = Du ReadData INFO Hit x = 1023.7 y = 57.9027 z = -953.684 detector = DummyHitDetector ReadData INFO Hit x = 1026.91 y = 52.2238 z = -955.073 detector = DummyHitDetector ReadData INFO Hit x = 1030.12 y = 46.5449 z = -956.169 detector = DummyHitDetector -PoolSvc INFO Database (SimplePoolFile1.root) attribute [BYTES_READ]: 19691 +PoolSvc INFO Database (SimplePoolFile1.root) attribute [BYTES_READ]: 19695 PoolSvc INFO Database (SimplePoolFile1.root) attribute [READ_CALLS]: 23 AthenaEventLoopMgr INFO ===>>> done processing event #10, run #1 1 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection @@ -408,7 +413,7 @@ ReadData INFO Hit x = 1120.49 y = 63.5816 z = -1051.86 detector = Du ReadData INFO Hit x = 1123.7 y = 57.9027 z = -1053.68 detector = DummyHitDetector ReadData INFO Hit x = 1126.91 y = 52.2238 z = -1055.07 detector = DummyHitDetector ReadData INFO Hit x = 1130.12 y = 46.5449 z = -1056.17 detector = DummyHitDetector -PoolSvc INFO Database (SimplePoolFile1.root) attribute [BYTES_READ]: 19691 +PoolSvc INFO Database (SimplePoolFile1.root) attribute [BYTES_READ]: 19695 PoolSvc INFO Database (SimplePoolFile1.root) attribute [READ_CALLS]: 23 AthenaEventLoopMgr INFO ===>>> done processing event #11, run #1 2 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection @@ -441,7 +446,7 @@ ReadData INFO Hit x = 1220.49 y = 63.5816 z = -1151.86 detector = Du ReadData INFO Hit x = 1223.7 y = 57.9027 z = -1153.68 detector = DummyHitDetector ReadData INFO Hit x = 1226.91 y = 52.2238 z = -1155.07 detector = DummyHitDetector ReadData INFO Hit x = 1230.12 y = 46.5449 z = -1156.17 detector = DummyHitDetector -PoolSvc INFO Database (SimplePoolFile1.root) attribute [BYTES_READ]: 19691 +PoolSvc INFO Database (SimplePoolFile1.root) attribute [BYTES_READ]: 19695 PoolSvc INFO Database (SimplePoolFile1.root) attribute [READ_CALLS]: 23 AthenaEventLoopMgr INFO ===>>> done processing event #12, run #1 3 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection @@ -474,7 +479,7 @@ ReadData INFO Hit x = 1320.49 y = 63.5816 z = -1251.86 detector = Du ReadData INFO Hit x = 1323.7 y = 57.9027 z = -1253.68 detector = DummyHitDetector ReadData INFO Hit x = 1326.91 y = 52.2238 z = -1255.07 detector = DummyHitDetector ReadData INFO Hit x = 1330.12 y = 46.5449 z = -1256.17 detector = DummyHitDetector -PoolSvc INFO Database (SimplePoolFile1.root) attribute [BYTES_READ]: 19691 +PoolSvc INFO Database (SimplePoolFile1.root) attribute [BYTES_READ]: 19695 PoolSvc INFO Database (SimplePoolFile1.root) attribute [READ_CALLS]: 23 AthenaEventLoopMgr INFO ===>>> done processing event #13, run #1 4 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection @@ -507,7 +512,7 @@ ReadData INFO Hit x = 1420.49 y = 63.5816 z = -1351.86 detector = Du ReadData INFO Hit x = 1423.7 y = 57.9027 z = -1353.68 detector = DummyHitDetector ReadData INFO Hit x = 1426.91 y = 52.2238 z = -1355.07 detector = DummyHitDetector ReadData INFO Hit x = 1430.12 y = 46.5449 z = -1356.17 detector = DummyHitDetector -PoolSvc INFO Database (SimplePoolFile1.root) attribute [BYTES_READ]: 19691 +PoolSvc INFO Database (SimplePoolFile1.root) attribute [BYTES_READ]: 19695 PoolSvc INFO Database (SimplePoolFile1.root) attribute [READ_CALLS]: 23 AthenaEventLoopMgr INFO ===>>> done processing event #14, run #1 5 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection @@ -540,7 +545,7 @@ ReadData INFO Hit x = 1520.49 y = 63.5816 z = -1451.86 detector = Du ReadData INFO Hit x = 1523.7 y = 57.9027 z = -1453.68 detector = DummyHitDetector ReadData INFO Hit x = 1526.91 y = 52.2238 z = -1455.07 detector = DummyHitDetector ReadData INFO Hit x = 1530.12 y = 46.5449 z = -1456.17 detector = DummyHitDetector -PoolSvc INFO Database (SimplePoolFile1.root) attribute [BYTES_READ]: 19691 +PoolSvc INFO Database (SimplePoolFile1.root) attribute [BYTES_READ]: 19695 PoolSvc INFO Database (SimplePoolFile1.root) attribute [READ_CALLS]: 23 AthenaEventLoopMgr INFO ===>>> done processing event #15, run #1 6 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection @@ -573,7 +578,7 @@ ReadData INFO Hit x = 1620.49 y = 63.5816 z = -1551.86 detector = Du ReadData INFO Hit x = 1623.7 y = 57.9027 z = -1553.68 detector = DummyHitDetector ReadData INFO Hit x = 1626.91 y = 52.2238 z = -1555.07 detector = DummyHitDetector ReadData INFO Hit x = 1630.12 y = 46.5449 z = -1556.17 detector = DummyHitDetector -PoolSvc INFO Database (SimplePoolFile1.root) attribute [BYTES_READ]: 19691 +PoolSvc INFO Database (SimplePoolFile1.root) attribute [BYTES_READ]: 19695 PoolSvc INFO Database (SimplePoolFile1.root) attribute [READ_CALLS]: 23 AthenaEventLoopMgr INFO ===>>> done processing event #16, run #1 7 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection @@ -606,7 +611,7 @@ ReadData INFO Hit x = 1720.49 y = 63.5816 z = -1651.86 detector = Du ReadData INFO Hit x = 1723.7 y = 57.9027 z = -1653.68 detector = DummyHitDetector ReadData INFO Hit x = 1726.91 y = 52.2238 z = -1655.07 detector = DummyHitDetector ReadData INFO Hit x = 1730.12 y = 46.5449 z = -1656.17 detector = DummyHitDetector -PoolSvc INFO Database (SimplePoolFile1.root) attribute [BYTES_READ]: 19691 +PoolSvc INFO Database (SimplePoolFile1.root) attribute [BYTES_READ]: 19695 PoolSvc INFO Database (SimplePoolFile1.root) attribute [READ_CALLS]: 23 AthenaEventLoopMgr INFO ===>>> done processing event #17, run #1 8 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection @@ -639,7 +644,7 @@ ReadData INFO Hit x = 1820.49 y = 63.5816 z = -1751.86 detector = Du ReadData INFO Hit x = 1823.7 y = 57.9027 z = -1753.68 detector = DummyHitDetector ReadData INFO Hit x = 1826.91 y = 52.2238 z = -1755.07 detector = DummyHitDetector ReadData INFO Hit x = 1830.12 y = 46.5449 z = -1756.17 detector = DummyHitDetector -PoolSvc INFO Database (SimplePoolFile1.root) attribute [BYTES_READ]: 19691 +PoolSvc INFO Database (SimplePoolFile1.root) attribute [BYTES_READ]: 19695 PoolSvc INFO Database (SimplePoolFile1.root) attribute [READ_CALLS]: 23 AthenaEventLoopMgr INFO ===>>> done processing event #18, run #1 9 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection @@ -672,7 +677,7 @@ ReadData INFO Hit x = 1920.49 y = 63.5816 z = -1851.86 detector = Du ReadData INFO Hit x = 1923.7 y = 57.9027 z = -1853.68 detector = DummyHitDetector ReadData INFO Hit x = 1926.91 y = 52.2238 z = -1855.07 detector = DummyHitDetector ReadData INFO Hit x = 1930.12 y = 46.5449 z = -1856.17 detector = DummyHitDetector -PoolSvc INFO Database (SimplePoolFile1.root) attribute [BYTES_READ]: 19691 +PoolSvc INFO Database (SimplePoolFile1.root) attribute [BYTES_READ]: 19695 PoolSvc INFO Database (SimplePoolFile1.root) attribute [READ_CALLS]: 23 AthenaEventLoopMgr INFO ===>>> done processing event #19, run #1 10 events processed so far <<<=== Domain[ROOT_All] INFO -> Deaccess DbDatabase READ [ROOT_All] ???? @@ -800,6 +805,10 @@ SimplePoolFile2... DEBUG --->Reading Param:PFN=[SimplePoolFile2.root] SimplePoolFile2... DEBUG --->Reading Param:POOL_VSN=[1.1] SimplePoolFile2... DEBUG --->Reading Param:FORMAT_VSN=[1.1] ##Params DEBUG No objects passing selection criteria... Container has 4 Entries in total. +RootDatabase.se... DEBUG Request tree cache +RootDatabase.se... DEBUG File name SimplePoolFile2.root +RootDatabase.se... DEBUG Got tree CollectionTree read entry -1 +RootDatabase.se... DEBUG Using Tree cache. Size: -1 Nevents to learn with: -1 RootDatabase.se... DEBUG TREE_CACHE_LEARN_EVENTS = 6 RootDatabase.se... DEBUG Request tree cache RootDatabase.se... DEBUG File name SimplePoolFile2.root @@ -872,7 +881,7 @@ ReadData INFO EventInfo event: 0 run: 1 ReadData INFO Get Smart data ptr 1 ReadData INFO Could not find ExampleTrackContainer/MyTracks ReadData INFO Could not find ExampleHitContainer/MyHits -PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 18812 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 18817 PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 22 AthenaEventLoopMgr INFO ===>>> done processing event #0, run #1 11 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection @@ -900,7 +909,7 @@ ReadData INFO EventInfo event: 1 run: 1 ReadData INFO Get Smart data ptr 1 ReadData INFO Could not find ExampleTrackContainer/MyTracks ReadData INFO Could not find ExampleHitContainer/MyHits -PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 18812 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 18817 PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 22 AthenaEventLoopMgr INFO ===>>> done processing event #1, run #1 12 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection @@ -928,7 +937,7 @@ ReadData INFO EventInfo event: 2 run: 1 ReadData INFO Get Smart data ptr 1 ReadData INFO Could not find ExampleTrackContainer/MyTracks ReadData INFO Could not find ExampleHitContainer/MyHits -PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 18812 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 18817 PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 22 AthenaEventLoopMgr INFO ===>>> done processing event #2, run #1 13 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection @@ -956,7 +965,7 @@ ReadData INFO EventInfo event: 3 run: 1 ReadData INFO Get Smart data ptr 1 ReadData INFO Could not find ExampleTrackContainer/MyTracks ReadData INFO Could not find ExampleHitContainer/MyHits -PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 18812 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 18817 PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 22 AthenaEventLoopMgr INFO ===>>> done processing event #3, run #1 14 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection @@ -984,7 +993,7 @@ ReadData INFO EventInfo event: 4 run: 1 ReadData INFO Get Smart data ptr 1 ReadData INFO Could not find ExampleTrackContainer/MyTracks ReadData INFO Could not find ExampleHitContainer/MyHits -PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 18812 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 18817 PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 22 AthenaEventLoopMgr INFO ===>>> done processing event #4, run #1 15 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection @@ -1012,7 +1021,7 @@ ReadData INFO EventInfo event: 5 run: 1 ReadData INFO Get Smart data ptr 1 ReadData INFO Could not find ExampleTrackContainer/MyTracks ReadData INFO Could not find ExampleHitContainer/MyHits -PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 18812 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 18817 PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 22 AthenaEventLoopMgr INFO ===>>> done processing event #5, run #1 16 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection @@ -1040,7 +1049,7 @@ ReadData INFO EventInfo event: 6 run: 1 ReadData INFO Get Smart data ptr 1 ReadData INFO Could not find ExampleTrackContainer/MyTracks ReadData INFO Could not find ExampleHitContainer/MyHits -PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 18812 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 18817 PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 22 AthenaEventLoopMgr INFO ===>>> done processing event #6, run #1 17 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection @@ -1068,7 +1077,7 @@ ReadData INFO EventInfo event: 7 run: 1 ReadData INFO Get Smart data ptr 1 ReadData INFO Could not find ExampleTrackContainer/MyTracks ReadData INFO Could not find ExampleHitContainer/MyHits -PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 18812 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 18817 PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 22 AthenaEventLoopMgr INFO ===>>> done processing event #7, run #1 18 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection @@ -1096,7 +1105,7 @@ ReadData INFO EventInfo event: 8 run: 1 ReadData INFO Get Smart data ptr 1 ReadData INFO Could not find ExampleTrackContainer/MyTracks ReadData INFO Could not find ExampleHitContainer/MyHits -PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 18812 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 18817 PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 22 AthenaEventLoopMgr INFO ===>>> done processing event #8, run #1 19 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection @@ -1124,7 +1133,7 @@ ReadData INFO EventInfo event: 9 run: 1 ReadData INFO Get Smart data ptr 1 ReadData INFO Could not find ExampleTrackContainer/MyTracks ReadData INFO Could not find ExampleHitContainer/MyHits -PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 18812 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 18817 PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 22 AthenaEventLoopMgr INFO ===>>> done processing event #9, run #1 20 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection @@ -1152,7 +1161,7 @@ ReadData INFO EventInfo event: 10 run: 1 ReadData INFO Get Smart data ptr 1 ReadData INFO Could not find ExampleTrackContainer/MyTracks ReadData INFO Could not find ExampleHitContainer/MyHits -PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 18812 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 18817 PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 22 AthenaEventLoopMgr INFO ===>>> done processing event #10, run #1 21 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection @@ -1180,7 +1189,7 @@ ReadData INFO EventInfo event: 11 run: 1 ReadData INFO Get Smart data ptr 1 ReadData INFO Could not find ExampleTrackContainer/MyTracks ReadData INFO Could not find ExampleHitContainer/MyHits -PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 18812 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 18817 PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 22 AthenaEventLoopMgr INFO ===>>> done processing event #11, run #1 22 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection @@ -1208,7 +1217,7 @@ ReadData INFO EventInfo event: 12 run: 1 ReadData INFO Get Smart data ptr 1 ReadData INFO Could not find ExampleTrackContainer/MyTracks ReadData INFO Could not find ExampleHitContainer/MyHits -PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 18812 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 18817 PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 22 AthenaEventLoopMgr INFO ===>>> done processing event #12, run #1 23 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection @@ -1236,7 +1245,7 @@ ReadData INFO EventInfo event: 13 run: 1 ReadData INFO Get Smart data ptr 1 ReadData INFO Could not find ExampleTrackContainer/MyTracks ReadData INFO Could not find ExampleHitContainer/MyHits -PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 18812 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 18817 PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 22 AthenaEventLoopMgr INFO ===>>> done processing event #13, run #1 24 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection @@ -1264,7 +1273,7 @@ ReadData INFO EventInfo event: 14 run: 1 ReadData INFO Get Smart data ptr 1 ReadData INFO Could not find ExampleTrackContainer/MyTracks ReadData INFO Could not find ExampleHitContainer/MyHits -PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 18812 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 18817 PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 22 AthenaEventLoopMgr INFO ===>>> done processing event #14, run #1 25 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection @@ -1292,7 +1301,7 @@ ReadData INFO EventInfo event: 15 run: 1 ReadData INFO Get Smart data ptr 1 ReadData INFO Could not find ExampleTrackContainer/MyTracks ReadData INFO Could not find ExampleHitContainer/MyHits -PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 18812 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 18817 PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 22 AthenaEventLoopMgr INFO ===>>> done processing event #15, run #1 26 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection @@ -1320,7 +1329,7 @@ ReadData INFO EventInfo event: 16 run: 1 ReadData INFO Get Smart data ptr 1 ReadData INFO Could not find ExampleTrackContainer/MyTracks ReadData INFO Could not find ExampleHitContainer/MyHits -PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 18812 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 18817 PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 22 AthenaEventLoopMgr INFO ===>>> done processing event #16, run #1 27 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection @@ -1348,7 +1357,7 @@ ReadData INFO EventInfo event: 17 run: 1 ReadData INFO Get Smart data ptr 1 ReadData INFO Could not find ExampleTrackContainer/MyTracks ReadData INFO Could not find ExampleHitContainer/MyHits -PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 18812 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 18817 PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 22 AthenaEventLoopMgr INFO ===>>> done processing event #17, run #1 28 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection @@ -1376,7 +1385,7 @@ ReadData INFO EventInfo event: 18 run: 1 ReadData INFO Get Smart data ptr 1 ReadData INFO Could not find ExampleTrackContainer/MyTracks ReadData INFO Could not find ExampleHitContainer/MyHits -PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 18812 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 18817 PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 22 AthenaEventLoopMgr INFO ===>>> done processing event #18, run #1 29 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection @@ -1404,7 +1413,7 @@ ReadData INFO EventInfo event: 19 run: 1 ReadData INFO Get Smart data ptr 1 ReadData INFO Could not find ExampleTrackContainer/MyTracks ReadData INFO Could not find ExampleHitContainer/MyHits -PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 18812 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 18817 PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 22 AthenaEventLoopMgr INFO ===>>> done processing event #19, run #1 30 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection @@ -1433,7 +1442,7 @@ ReadData INFO EventInfo event: 20 run: 2 ReadData INFO Get Smart data ptr 1 ReadData INFO Could not find ExampleTrackContainer/MyTracks ReadData INFO Could not find ExampleHitContainer/MyHits -PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 19199 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 19204 PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 23 AthenaEventLoopMgr INFO ===>>> done processing event #20, run #2 31 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection @@ -1461,7 +1470,7 @@ ReadData INFO EventInfo event: 21 run: 2 ReadData INFO Get Smart data ptr 1 ReadData INFO Could not find ExampleTrackContainer/MyTracks ReadData INFO Could not find ExampleHitContainer/MyHits -PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 19199 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 19204 PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 23 AthenaEventLoopMgr INFO ===>>> done processing event #21, run #2 32 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection @@ -1489,7 +1498,7 @@ ReadData INFO EventInfo event: 22 run: 2 ReadData INFO Get Smart data ptr 1 ReadData INFO Could not find ExampleTrackContainer/MyTracks ReadData INFO Could not find ExampleHitContainer/MyHits -PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 19199 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 19204 PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 23 AthenaEventLoopMgr INFO ===>>> done processing event #22, run #2 33 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection @@ -1517,7 +1526,7 @@ ReadData INFO EventInfo event: 23 run: 2 ReadData INFO Get Smart data ptr 1 ReadData INFO Could not find ExampleTrackContainer/MyTracks ReadData INFO Could not find ExampleHitContainer/MyHits -PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 19199 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 19204 PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 23 AthenaEventLoopMgr INFO ===>>> done processing event #23, run #2 34 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection @@ -1545,7 +1554,7 @@ ReadData INFO EventInfo event: 24 run: 2 ReadData INFO Get Smart data ptr 1 ReadData INFO Could not find ExampleTrackContainer/MyTracks ReadData INFO Could not find ExampleHitContainer/MyHits -PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 19199 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 19204 PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 23 AthenaEventLoopMgr INFO ===>>> done processing event #24, run #2 35 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection @@ -1573,7 +1582,7 @@ ReadData INFO EventInfo event: 25 run: 2 ReadData INFO Get Smart data ptr 1 ReadData INFO Could not find ExampleTrackContainer/MyTracks ReadData INFO Could not find ExampleHitContainer/MyHits -PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 19199 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 19204 PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 23 AthenaEventLoopMgr INFO ===>>> done processing event #25, run #2 36 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection @@ -1601,7 +1610,7 @@ ReadData INFO EventInfo event: 26 run: 2 ReadData INFO Get Smart data ptr 1 ReadData INFO Could not find ExampleTrackContainer/MyTracks ReadData INFO Could not find ExampleHitContainer/MyHits -PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 19199 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 19204 PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 23 AthenaEventLoopMgr INFO ===>>> done processing event #26, run #2 37 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection @@ -1629,7 +1638,7 @@ ReadData INFO EventInfo event: 27 run: 2 ReadData INFO Get Smart data ptr 1 ReadData INFO Could not find ExampleTrackContainer/MyTracks ReadData INFO Could not find ExampleHitContainer/MyHits -PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 19199 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 19204 PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 23 AthenaEventLoopMgr INFO ===>>> done processing event #27, run #2 38 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection @@ -1657,7 +1666,7 @@ ReadData INFO EventInfo event: 28 run: 2 ReadData INFO Get Smart data ptr 1 ReadData INFO Could not find ExampleTrackContainer/MyTracks ReadData INFO Could not find ExampleHitContainer/MyHits -PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 19199 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 19204 PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 23 AthenaEventLoopMgr INFO ===>>> done processing event #28, run #2 39 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection @@ -1685,7 +1694,7 @@ ReadData INFO EventInfo event: 29 run: 2 ReadData INFO Get Smart data ptr 1 ReadData INFO Could not find ExampleTrackContainer/MyTracks ReadData INFO Could not find ExampleHitContainer/MyHits -PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 19199 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 19204 PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 23 AthenaEventLoopMgr INFO ===>>> done processing event #29, run #2 40 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection @@ -1713,7 +1722,7 @@ ReadData INFO EventInfo event: 30 run: 2 ReadData INFO Get Smart data ptr 1 ReadData INFO Could not find ExampleTrackContainer/MyTracks ReadData INFO Could not find ExampleHitContainer/MyHits -PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 19199 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 19204 PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 23 AthenaEventLoopMgr INFO ===>>> done processing event #30, run #2 41 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection @@ -1741,7 +1750,7 @@ ReadData INFO EventInfo event: 31 run: 2 ReadData INFO Get Smart data ptr 1 ReadData INFO Could not find ExampleTrackContainer/MyTracks ReadData INFO Could not find ExampleHitContainer/MyHits -PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 19199 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 19204 PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 23 AthenaEventLoopMgr INFO ===>>> done processing event #31, run #2 42 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection @@ -1769,7 +1778,7 @@ ReadData INFO EventInfo event: 32 run: 2 ReadData INFO Get Smart data ptr 1 ReadData INFO Could not find ExampleTrackContainer/MyTracks ReadData INFO Could not find ExampleHitContainer/MyHits -PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 19199 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 19204 PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 23 AthenaEventLoopMgr INFO ===>>> done processing event #32, run #2 43 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection @@ -1797,7 +1806,7 @@ ReadData INFO EventInfo event: 33 run: 2 ReadData INFO Get Smart data ptr 1 ReadData INFO Could not find ExampleTrackContainer/MyTracks ReadData INFO Could not find ExampleHitContainer/MyHits -PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 19199 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 19204 PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 23 AthenaEventLoopMgr INFO ===>>> done processing event #33, run #2 44 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection @@ -1825,7 +1834,7 @@ ReadData INFO EventInfo event: 34 run: 2 ReadData INFO Get Smart data ptr 1 ReadData INFO Could not find ExampleTrackContainer/MyTracks ReadData INFO Could not find ExampleHitContainer/MyHits -PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 19199 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 19204 PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 23 AthenaEventLoopMgr INFO ===>>> done processing event #34, run #2 45 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection @@ -1853,7 +1862,7 @@ ReadData INFO EventInfo event: 35 run: 2 ReadData INFO Get Smart data ptr 1 ReadData INFO Could not find ExampleTrackContainer/MyTracks ReadData INFO Could not find ExampleHitContainer/MyHits -PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 19199 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 19204 PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 23 AthenaEventLoopMgr INFO ===>>> done processing event #35, run #2 46 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection @@ -1881,7 +1890,7 @@ ReadData INFO EventInfo event: 36 run: 2 ReadData INFO Get Smart data ptr 1 ReadData INFO Could not find ExampleTrackContainer/MyTracks ReadData INFO Could not find ExampleHitContainer/MyHits -PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 19199 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 19204 PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 23 AthenaEventLoopMgr INFO ===>>> done processing event #36, run #2 47 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection @@ -1909,7 +1918,7 @@ ReadData INFO EventInfo event: 37 run: 2 ReadData INFO Get Smart data ptr 1 ReadData INFO Could not find ExampleTrackContainer/MyTracks ReadData INFO Could not find ExampleHitContainer/MyHits -PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 19199 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 19204 PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 23 AthenaEventLoopMgr INFO ===>>> done processing event #37, run #2 48 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection @@ -1937,7 +1946,7 @@ ReadData INFO EventInfo event: 38 run: 2 ReadData INFO Get Smart data ptr 1 ReadData INFO Could not find ExampleTrackContainer/MyTracks ReadData INFO Could not find ExampleHitContainer/MyHits -PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 19199 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 19204 PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 23 AthenaEventLoopMgr INFO ===>>> done processing event #38, run #2 49 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection @@ -1965,7 +1974,7 @@ ReadData INFO EventInfo event: 39 run: 2 ReadData INFO Get Smart data ptr 1 ReadData INFO Could not find ExampleTrackContainer/MyTracks ReadData INFO Could not find ExampleHitContainer/MyHits -PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 19199 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 19204 PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 23 AthenaEventLoopMgr INFO ===>>> done processing event #39, run #2 50 events processed so far <<<=== MetaDataSvc DEBUG handle() EndInputFile for FID:???? @@ -2028,6 +2037,10 @@ POOLContainer(D... DEBUG Opening POOLContainer(D... DEBUG attributes# = 1 POOLContainer(D... DEBUG Branch container 'DataHeader' POOLContainer(D... DEBUG Opened container POOLContainer(DataHeader) of type ROOT_Tree +RootDatabase.se... DEBUG Request tree cache +RootDatabase.se... DEBUG File name SimplePoolFile3.root +RootDatabase.se... DEBUG Got tree CollectionTree read entry -1 +RootDatabase.se... DEBUG Using Tree cache. Size: -1 Nevents to learn with: -1 RootDatabase.se... DEBUG TREE_CACHE_LEARN_EVENTS = 6 RootDatabase.se... DEBUG Request tree cache RootDatabase.se... DEBUG File name SimplePoolFile3.root @@ -2093,7 +2106,7 @@ ReadData INFO Track pt = 74.8928 eta = 3.1676 phi = 2.6161 detector DataProxy WARNING accessData: IOA pointer not set ReadData WARNING Could not follow ExampleTrackContainer/MyTracks ElementLinks to ExampleHitContainer/MyHits ReadData INFO Could not find ExampleHitContainer/MyHits -PoolSvc INFO Database (SimplePoolFile3.root) attribute [BYTES_READ]: 18594 +PoolSvc INFO Database (SimplePoolFile3.root) attribute [BYTES_READ]: 18604 PoolSvc INFO Database (SimplePoolFile3.root) attribute [READ_CALLS]: 21 AthenaEventLoopMgr INFO ===>>> done processing event #0, run #1 51 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection @@ -2119,7 +2132,7 @@ ReadData INFO Track pt = 137.584 eta = -39.525 phi = 17.2679 detecto DataProxy WARNING accessData: IOA pointer not set ReadData WARNING Could not follow ExampleTrackContainer/MyTracks ElementLinks to ExampleHitContainer/MyHits ReadData INFO Could not find ExampleHitContainer/MyHits -PoolSvc INFO Database (SimplePoolFile3.root) attribute [BYTES_READ]: 18594 +PoolSvc INFO Database (SimplePoolFile3.root) attribute [BYTES_READ]: 18604 PoolSvc INFO Database (SimplePoolFile3.root) attribute [READ_CALLS]: 21 AthenaEventLoopMgr INFO ===>>> done processing event #1, run #1 52 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection @@ -2145,7 +2158,7 @@ ReadData INFO Track pt = 228.154 eta = -6.2704 phi = 31.9197 detecto DataProxy WARNING accessData: IOA pointer not set ReadData WARNING Could not follow ExampleTrackContainer/MyTracks ElementLinks to ExampleHitContainer/MyHits ReadData INFO Could not find ExampleHitContainer/MyHits -PoolSvc INFO Database (SimplePoolFile3.root) attribute [BYTES_READ]: 18594 +PoolSvc INFO Database (SimplePoolFile3.root) attribute [BYTES_READ]: 18604 PoolSvc INFO Database (SimplePoolFile3.root) attribute [READ_CALLS]: 21 AthenaEventLoopMgr INFO ===>>> done processing event #2, run #1 53 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection @@ -2171,7 +2184,7 @@ ReadData INFO Track pt = 324.306 eta = -15.8941 phi = 46.5715 detect DataProxy WARNING accessData: IOA pointer not set ReadData WARNING Could not follow ExampleTrackContainer/MyTracks ElementLinks to ExampleHitContainer/MyHits ReadData INFO Could not find ExampleHitContainer/MyHits -PoolSvc INFO Database (SimplePoolFile3.root) attribute [BYTES_READ]: 18594 +PoolSvc INFO Database (SimplePoolFile3.root) attribute [BYTES_READ]: 18604 PoolSvc INFO Database (SimplePoolFile3.root) attribute [READ_CALLS]: 21 AthenaEventLoopMgr INFO ===>>> done processing event #3, run #1 54 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection @@ -2197,7 +2210,7 @@ ReadData INFO Track pt = 422.255 eta = -13.279 phi = 61.2233 detecto DataProxy WARNING accessData: IOA pointer not set ReadData WARNING Could not follow ExampleTrackContainer/MyTracks ElementLinks to ExampleHitContainer/MyHits ReadData INFO Could not find ExampleHitContainer/MyHits -PoolSvc INFO Database (SimplePoolFile3.root) attribute [BYTES_READ]: 18594 +PoolSvc INFO Database (SimplePoolFile3.root) attribute [BYTES_READ]: 18604 PoolSvc INFO Database (SimplePoolFile3.root) attribute [READ_CALLS]: 21 AthenaEventLoopMgr INFO ===>>> done processing event #4, run #1 55 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection @@ -2223,7 +2236,7 @@ ReadData INFO Track pt = 520.987 eta = -12.3511 phi = 75.8751 detect DataProxy WARNING accessData: IOA pointer not set ReadData WARNING Could not follow ExampleTrackContainer/MyTracks ElementLinks to ExampleHitContainer/MyHits ReadData INFO Could not find ExampleHitContainer/MyHits -PoolSvc INFO Database (SimplePoolFile3.root) attribute [BYTES_READ]: 18594 +PoolSvc INFO Database (SimplePoolFile3.root) attribute [BYTES_READ]: 18604 PoolSvc INFO Database (SimplePoolFile3.root) attribute [READ_CALLS]: 21 AthenaEventLoopMgr INFO ===>>> done processing event #5, run #1 56 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection @@ -2249,7 +2262,7 @@ ReadData INFO Track pt = 620.127 eta = -11.8468 phi = 90.5269 detect DataProxy WARNING accessData: IOA pointer not set ReadData WARNING Could not follow ExampleTrackContainer/MyTracks ElementLinks to ExampleHitContainer/MyHits ReadData INFO Could not find ExampleHitContainer/MyHits -PoolSvc INFO Database (SimplePoolFile3.root) attribute [BYTES_READ]: 18594 +PoolSvc INFO Database (SimplePoolFile3.root) attribute [BYTES_READ]: 18604 PoolSvc INFO Database (SimplePoolFile3.root) attribute [READ_CALLS]: 21 AthenaEventLoopMgr INFO ===>>> done processing event #6, run #1 57 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection @@ -2275,7 +2288,7 @@ ReadData INFO Track pt = 719.507 eta = -11.5247 phi = 105.179 detect DataProxy WARNING accessData: IOA pointer not set ReadData WARNING Could not follow ExampleTrackContainer/MyTracks ElementLinks to ExampleHitContainer/MyHits ReadData INFO Could not find ExampleHitContainer/MyHits -PoolSvc INFO Database (SimplePoolFile3.root) attribute [BYTES_READ]: 18594 +PoolSvc INFO Database (SimplePoolFile3.root) attribute [BYTES_READ]: 18604 PoolSvc INFO Database (SimplePoolFile3.root) attribute [READ_CALLS]: 21 AthenaEventLoopMgr INFO ===>>> done processing event #7, run #1 58 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection @@ -2301,7 +2314,7 @@ ReadData INFO Track pt = 819.038 eta = -11.2998 phi = 119.831 detect DataProxy WARNING accessData: IOA pointer not set ReadData WARNING Could not follow ExampleTrackContainer/MyTracks ElementLinks to ExampleHitContainer/MyHits ReadData INFO Could not find ExampleHitContainer/MyHits -PoolSvc INFO Database (SimplePoolFile3.root) attribute [BYTES_READ]: 18594 +PoolSvc INFO Database (SimplePoolFile3.root) attribute [BYTES_READ]: 18604 PoolSvc INFO Database (SimplePoolFile3.root) attribute [READ_CALLS]: 21 AthenaEventLoopMgr INFO ===>>> done processing event #8, run #1 59 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection @@ -2327,7 +2340,7 @@ ReadData INFO Track pt = 918.671 eta = -11.1334 phi = 134.482 detect DataProxy WARNING accessData: IOA pointer not set ReadData WARNING Could not follow ExampleTrackContainer/MyTracks ElementLinks to ExampleHitContainer/MyHits ReadData INFO Could not find ExampleHitContainer/MyHits -PoolSvc INFO Database (SimplePoolFile3.root) attribute [BYTES_READ]: 18594 +PoolSvc INFO Database (SimplePoolFile3.root) attribute [BYTES_READ]: 18604 PoolSvc INFO Database (SimplePoolFile3.root) attribute [READ_CALLS]: 21 AthenaEventLoopMgr INFO ===>>> done processing event #9, run #1 60 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection @@ -2353,7 +2366,7 @@ ReadData INFO Track pt = 1018.38 eta = -11.0052 phi = 149.134 detect DataProxy WARNING accessData: IOA pointer not set ReadData WARNING Could not follow ExampleTrackContainer/MyTracks ElementLinks to ExampleHitContainer/MyHits ReadData INFO Could not find ExampleHitContainer/MyHits -PoolSvc INFO Database (SimplePoolFile3.root) attribute [BYTES_READ]: 18594 +PoolSvc INFO Database (SimplePoolFile3.root) attribute [BYTES_READ]: 18604 PoolSvc INFO Database (SimplePoolFile3.root) attribute [READ_CALLS]: 21 AthenaEventLoopMgr INFO ===>>> done processing event #10, run #1 61 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection @@ -2379,7 +2392,7 @@ ReadData INFO Track pt = 1118.13 eta = -10.9031 phi = 163.786 detect DataProxy WARNING accessData: IOA pointer not set ReadData WARNING Could not follow ExampleTrackContainer/MyTracks ElementLinks to ExampleHitContainer/MyHits ReadData INFO Could not find ExampleHitContainer/MyHits -PoolSvc INFO Database (SimplePoolFile3.root) attribute [BYTES_READ]: 18594 +PoolSvc INFO Database (SimplePoolFile3.root) attribute [BYTES_READ]: 18604 PoolSvc INFO Database (SimplePoolFile3.root) attribute [READ_CALLS]: 21 AthenaEventLoopMgr INFO ===>>> done processing event #11, run #1 62 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection @@ -2405,7 +2418,7 @@ ReadData INFO Track pt = 1217.93 eta = -10.82 phi = 178.438 detector DataProxy WARNING accessData: IOA pointer not set ReadData WARNING Could not follow ExampleTrackContainer/MyTracks ElementLinks to ExampleHitContainer/MyHits ReadData INFO Could not find ExampleHitContainer/MyHits -PoolSvc INFO Database (SimplePoolFile3.root) attribute [BYTES_READ]: 18594 +PoolSvc INFO Database (SimplePoolFile3.root) attribute [BYTES_READ]: 18604 PoolSvc INFO Database (SimplePoolFile3.root) attribute [READ_CALLS]: 21 AthenaEventLoopMgr INFO ===>>> done processing event #12, run #1 63 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection @@ -2431,7 +2444,7 @@ ReadData INFO Track pt = 1317.76 eta = -10.751 phi = 193.09 detector DataProxy WARNING accessData: IOA pointer not set ReadData WARNING Could not follow ExampleTrackContainer/MyTracks ElementLinks to ExampleHitContainer/MyHits ReadData INFO Could not find ExampleHitContainer/MyHits -PoolSvc INFO Database (SimplePoolFile3.root) attribute [BYTES_READ]: 18594 +PoolSvc INFO Database (SimplePoolFile3.root) attribute [BYTES_READ]: 18604 PoolSvc INFO Database (SimplePoolFile3.root) attribute [READ_CALLS]: 21 AthenaEventLoopMgr INFO ===>>> done processing event #13, run #1 64 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection @@ -2457,7 +2470,7 @@ ReadData INFO Track pt = 1417.61 eta = -10.6927 phi = 207.741 detect DataProxy WARNING accessData: IOA pointer not set ReadData WARNING Could not follow ExampleTrackContainer/MyTracks ElementLinks to ExampleHitContainer/MyHits ReadData INFO Could not find ExampleHitContainer/MyHits -PoolSvc INFO Database (SimplePoolFile3.root) attribute [BYTES_READ]: 18594 +PoolSvc INFO Database (SimplePoolFile3.root) attribute [BYTES_READ]: 18604 PoolSvc INFO Database (SimplePoolFile3.root) attribute [READ_CALLS]: 21 AthenaEventLoopMgr INFO ===>>> done processing event #14, run #1 65 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection @@ -2483,7 +2496,7 @@ ReadData INFO Track pt = 1517.49 eta = -10.6429 phi = 222.393 detect DataProxy WARNING accessData: IOA pointer not set ReadData WARNING Could not follow ExampleTrackContainer/MyTracks ElementLinks to ExampleHitContainer/MyHits ReadData INFO Could not find ExampleHitContainer/MyHits -PoolSvc INFO Database (SimplePoolFile3.root) attribute [BYTES_READ]: 18594 +PoolSvc INFO Database (SimplePoolFile3.root) attribute [BYTES_READ]: 18604 PoolSvc INFO Database (SimplePoolFile3.root) attribute [READ_CALLS]: 21 AthenaEventLoopMgr INFO ===>>> done processing event #15, run #1 66 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection @@ -2509,7 +2522,7 @@ ReadData INFO Track pt = 1617.37 eta = -10.5997 phi = 237.045 detect DataProxy WARNING accessData: IOA pointer not set ReadData WARNING Could not follow ExampleTrackContainer/MyTracks ElementLinks to ExampleHitContainer/MyHits ReadData INFO Could not find ExampleHitContainer/MyHits -PoolSvc INFO Database (SimplePoolFile3.root) attribute [BYTES_READ]: 18594 +PoolSvc INFO Database (SimplePoolFile3.root) attribute [BYTES_READ]: 18604 PoolSvc INFO Database (SimplePoolFile3.root) attribute [READ_CALLS]: 21 AthenaEventLoopMgr INFO ===>>> done processing event #16, run #1 67 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection @@ -2535,7 +2548,7 @@ ReadData INFO Track pt = 1717.27 eta = -10.562 phi = 251.697 detecto DataProxy WARNING accessData: IOA pointer not set ReadData WARNING Could not follow ExampleTrackContainer/MyTracks ElementLinks to ExampleHitContainer/MyHits ReadData INFO Could not find ExampleHitContainer/MyHits -PoolSvc INFO Database (SimplePoolFile3.root) attribute [BYTES_READ]: 18594 +PoolSvc INFO Database (SimplePoolFile3.root) attribute [BYTES_READ]: 18604 PoolSvc INFO Database (SimplePoolFile3.root) attribute [READ_CALLS]: 21 AthenaEventLoopMgr INFO ===>>> done processing event #17, run #1 68 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection @@ -2561,7 +2574,7 @@ ReadData INFO Track pt = 1817.19 eta = -10.5288 phi = 266.349 detect DataProxy WARNING accessData: IOA pointer not set ReadData WARNING Could not follow ExampleTrackContainer/MyTracks ElementLinks to ExampleHitContainer/MyHits ReadData INFO Could not find ExampleHitContainer/MyHits -PoolSvc INFO Database (SimplePoolFile3.root) attribute [BYTES_READ]: 18594 +PoolSvc INFO Database (SimplePoolFile3.root) attribute [BYTES_READ]: 18604 PoolSvc INFO Database (SimplePoolFile3.root) attribute [READ_CALLS]: 21 AthenaEventLoopMgr INFO ===>>> done processing event #18, run #1 69 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection @@ -2587,7 +2600,7 @@ ReadData INFO Track pt = 1917.11 eta = -10.4993 phi = 281 detector = DataProxy WARNING accessData: IOA pointer not set ReadData WARNING Could not follow ExampleTrackContainer/MyTracks ElementLinks to ExampleHitContainer/MyHits ReadData INFO Could not find ExampleHitContainer/MyHits -PoolSvc INFO Database (SimplePoolFile3.root) attribute [BYTES_READ]: 18594 +PoolSvc INFO Database (SimplePoolFile3.root) attribute [BYTES_READ]: 18604 PoolSvc INFO Database (SimplePoolFile3.root) attribute [READ_CALLS]: 21 AthenaEventLoopMgr INFO ===>>> done processing event #19, run #1 70 events processed so far <<<=== Domain[ROOT_All] INFO -> Deaccess DbDatabase READ [ROOT_All] ???? @@ -2606,9 +2619,9 @@ ToolSvc INFO Removing all tools created by ToolSvc *****Chrono***** INFO **************************************************************************************************** *****Chrono***** INFO The Final CPU consumption ( Chrono ) Table (ordered) *****Chrono***** INFO **************************************************************************************************** -cObjR_ALL INFO Time User : Tot= 30 [ms] Ave/Min/Max=0.242(+- 2.68)/ 0/ 30 [ms] #=124 -cObj_ALL INFO Time User : Tot= 100 [ms] Ave/Min/Max=0.877(+- 5.55)/ 0/ 50 [ms] #=114 -ChronoStatSvc INFO Time User : Tot= 1.4 [s] #= 1 +cObjR_ALL INFO Time User : Tot= 20 [ms] Ave/Min/Max=0.161(+- 1.26)/ 0/ 10 [ms] #=124 +cObj_ALL INFO Time User : Tot= 60 [ms] Ave/Min/Max=0.526(+- 2.91)/ 0/ 20 [ms] #=114 +ChronoStatSvc INFO Time User : Tot= 1.07 [s] #= 1 *****Chrono***** INFO **************************************************************************************************** ChronoStatSvc.f... INFO Service finalized successfully ApplicationMgr INFO Application Manager Finalized successfully diff --git a/Database/AthenaPOOL/AthenaPoolExample/AthenaPoolExampleAlgorithms/share/AthenaPoolExample_WCond.ref b/Database/AthenaPOOL/AthenaPoolExample/AthenaPoolExampleAlgorithms/share/AthenaPoolExample_WCond.ref index 682012b05f73369997fb0ab4f1fa07b2d0f6f2b1..026884eecfddf612da25894038d5103cd43b012a 100644 --- a/Database/AthenaPOOL/AthenaPoolExample/AthenaPoolExampleAlgorithms/share/AthenaPoolExample_WCond.ref +++ b/Database/AthenaPOOL/AthenaPoolExample/AthenaPoolExampleAlgorithms/share/AthenaPoolExample_WCond.ref @@ -1,19 +1,19 @@ -Wed Jul 18 20:11:52 CEST 2018 +Fri Oct 19 21:19:05 CEST 2018 Preloading tcmalloc_minimal.so Athena INFO including file "AthenaCommon/Preparation.py" Athena INFO including file "AthenaCommon/Atlas.UnixStandardJob.py" Athena INFO executing ROOT6Setup Athena INFO including file "AthenaCommon/Execution.py" Athena INFO including file "AthenaPoolExampleAlgorithms/AthenaPoolExample_WCondJobOptions.py" -Py:ConfigurableDb INFO Read module info for 5511 configurables from 52 genConfDb files +Py:ConfigurableDb INFO Read module info for 5521 configurables from 57 genConfDb files Py:ConfigurableDb INFO No duplicates have been found: that's good ! Athena INFO including file "AthenaCommon/runbatch.py" [?1034hApplicationMgr INFO Updating Gaudi::PluginService::SetDebug(level) to level= 'PluginDebugLevel':0 ApplicationMgr INFO Updating Gaudi::PluginService::SetDebug(level) to level= 'PluginDebugLevel':0 ApplicationMgr SUCCESS ==================================================================================================================================== - Welcome to ApplicationMgr (GaudiCoreSvc v30r2) - running on lxplus052.cern.ch on Wed Jul 18 20:12:02 2018 + Welcome to ApplicationMgr (GaudiCoreSvc v30r3) + running on lxplus060.cern.ch on Fri Oct 19 21:19:22 2018 ==================================================================================================================================== ApplicationMgr INFO Successfully loaded modules : AthenaServices ApplicationMgr INFO Application Manager Configured successfully @@ -21,10 +21,10 @@ ApplicationMgr INFO Updating Gaudi::PluginService::SetDebug(level) to leve StatusCodeSvc INFO initialize AthDictLoaderSvc INFO in initialize... AthDictLoaderSvc INFO acquired Dso-registry -ClassIDSvc INFO getRegistryEntries: read 2428 CLIDRegistry entries for module ALL +ClassIDSvc INFO getRegistryEntries: read 2946 CLIDRegistry entries for module ALL CoreDumpSvc INFO install f-a-t-a-l handler... (flag = -1) AthenaEventLoopMgr INFO Initializing AthenaEventLoopMgr - package version AthenaServices-00-00-00 -ClassIDSvc INFO getRegistryEntries: read 1249 CLIDRegistry entries for module ALL +ClassIDSvc INFO getRegistryEntries: read 1169 CLIDRegistry entries for module ALL Stream1 DEBUG Property update for OutputLevel : new value = 2 Stream1 DEBUG in initialize() ToolSvc.Stream1... INFO Initializing ToolSvc.Stream1Tool - package version AthenaServices-00-00-00 @@ -33,9 +33,9 @@ PoolSvc DEBUG Property update for OutputLevel : new value = 2 PoolSvc DEBUG Service base class initialized successfully PoolSvc INFO Set connectionsvc retry/timeout/IDLE timeout to 'ConnectionRetrialPeriod':300/ 'ConnectionRetrialTimeOut':3600/ 'ConnectionTimeOut':5 seconds with connection cleanup disabled PoolSvc INFO Frontier compression level set to 5 -DBReplicaSvc INFO Frontier server at (serverurl=http://atlasfrontier-local.cern.ch:8000/atlr)(serverurl=http://atlasfrontier-ai.cern.ch:8000/atlr)(serverurl=http://lcgft-atlas.gridpp.rl.ac.uk:3128/frontierATLAS)(serverurl=http://ccfrontier.in2p3.fr:23128/ccin2p3-AtlasFrontier)(proxyurl=http://ca-proxy.cern.ch:3128)(proxyurl=http://ca-proxy-meyrin.cern.ch:3128)(proxyurl=http://ca-proxy-wigner.cern.ch:3128) will be considered for COOL data -DBReplicaSvc INFO Read replica configuration from /cvmfs/atlas-nightlies.cern.ch/repo/sw/master/2018-07-17T2058/Athena/22.0.1/InstallArea/x86_64-slc6-gcc62-opt/share/dbreplica.config -DBReplicaSvc INFO Total of 10 servers found for host lxplus052.cern.ch [ATLF ATLAS_COOLPROD atlas_dd ATLAS_CONFIG INT8R INTR ATONR_COOL ATONR_CONF DEVDB11 ATLF ] +DBReplicaSvc INFO Frontier server at (serverurl=http://atlasfrontier-local.cern.ch:8000/atlr)(serverurl=http://atlasfrontier-ai.cern.ch:8000/atlr)(serverurl=http://lcgft-atlas.gridpp.rl.ac.uk:3128/frontierATLAS)(serverurl=http://ccfrontier.in2p3.fr:23128/ccin2p3-AtlasFrontier)(proxyurl=http://ca-proxy.cern.ch:3128)(proxyurl=http://ca-proxy-meyrin.cern.ch:3128)(proxyurl=http://ca-proxy-wigner.cern.ch:3128)(proxyurl=http://atlasbpfrontier.cern.ch:3127)(proxyurl=http://atlasbpfrontier.fnal.gov:3127) will be considered for COOL data +DBReplicaSvc INFO Read replica configuration from /cvmfs/atlas-nightlies.cern.ch/repo/sw/master/2018-10-18T2340/Athena/22.0.1/InstallArea/x86_64-slc6-gcc8-opt/share/dbreplica.config +DBReplicaSvc INFO Total of 10 servers found for host lxplus060.cern.ch [ATLF ATLAS_COOLPROD atlas_dd ATLAS_CONFIG INT8R INTR ATONR_COOL ATONR_CONF DEVDB11 ATLF ] PoolSvc INFO Successfully setup replica sorting algorithm PoolSvc DEBUG OutputLevel is PoolSvc INFO Setting up APR FileCatalog and Streams @@ -116,6 +116,7 @@ MetaDataHdr(Dat... DEBUG Opening MetaDataHdr(Dat... DEBUG attributes# = 1 MetaDataHdr(Dat... DEBUG Branch container 'DataHeader' MetaDataHdr(Dat... DEBUG Opened container MetaDataHdr(DataHeader) of type ROOT_Tree +ClassIDSvc INFO getRegistryEntries: read 2007 CLIDRegistry entries for module ALL EventPersistenc... INFO Added successfully Conversion service:AthenaPoolCnvSvc SimplePoolFile1... DEBUG --> Access DbContainer READ [ROOT_Tree] MetaDataHdrForm(DataHeaderForm) MetaDataHdrForm... DEBUG Opening @@ -133,7 +134,6 @@ ReadData DEBUG Data Deps for ReadData WriteCond DEBUG Property update for OutputLevel : new value = 2 WriteCond INFO in initialize() AthenaPoolAddre... DEBUG Cannot find DataHeader in DetectorStore. -ClassIDSvc INFO getRegistryEntries: read 1709 CLIDRegistry entries for module ALL WriteCond DEBUG input handles: 1 WriteCond DEBUG output handles: 0 WriteCond DEBUG Data Deps for WriteCond @@ -200,6 +200,10 @@ POOLContainer(D... DEBUG attributes# = 1 POOLContainer(D... DEBUG Branch container 'DataHeader' POOLContainer(D... DEBUG Opened container POOLContainer(DataHeader) of type ROOT_Tree ApplicationMgr INFO Application Manager Started successfully +RootDatabase.se... DEBUG Request tree cache +RootDatabase.se... DEBUG File name SimplePoolFile1.root +RootDatabase.se... DEBUG Got tree CollectionTree read entry -1 +RootDatabase.se... DEBUG Using Tree cache. Size: -1 Nevents to learn with: -1 MetaDataSvc DEBUG handle() BeginInputFile for SimplePoolFile1.root MetaDataSvc DEBUG initInputMetaDataStore: file name SimplePoolFile1.root SimplePoolFile1... DEBUG --> Access DbContainer READ [ROOT_Tree] MetaDataHdr(DataHeader) @@ -207,6 +211,7 @@ MetaDataHdr(Dat... DEBUG Opening MetaDataHdr(Dat... DEBUG attributes# = 1 MetaDataHdr(Dat... DEBUG Branch container 'DataHeader' MetaDataHdr(Dat... DEBUG Opened container MetaDataHdr(DataHeader) of type ROOT_Tree +ClassIDSvc INFO getRegistryEntries: read 2 CLIDRegistry entries for module ALL MetaDataSvc DEBUG Loaded input meta data store proxies MetaDataSvc DEBUG calling beginInputFile for ToolSvc.IOVDbMetaDataTool EventSelector DEBUG Get AttributeList from the collection @@ -229,7 +234,6 @@ CollectionTree(... DEBUG attributes# = 1 CollectionTree(... DEBUG Branch container 'EventInfo_p4_McEventInfo' CollectionTree(... DEBUG Opened container CollectionTree(EventInfo_p4/McEventInfo) of type ROOT_Tree AthenaPoolConve... INFO massageEventInfo: unable to get OverrideRunNumberFromInput property from EventSelector -ClassIDSvc INFO getRegistryEntries: read 15 CLIDRegistry entries for module ALL AthenaEventLoopMgr INFO ===>>> start of run 1 <<<=== AthenaEventLoopMgr INFO ===>>> start processing event #0, run #1 0 events processed so far <<<=== ReadData DEBUG in execute() @@ -263,7 +267,6 @@ ReadData INFO Hit x = 20.4945 y = 63.5816 z = 48.1358 detector = Dum ReadData INFO Hit x = 23.7045 y = 57.9027 z = 46.3159 detector = DummyHitDetector ReadData INFO Hit x = 26.9145 y = 52.2238 z = 44.9265 detector = DummyHitDetector ReadData INFO Hit x = 30.1245 y = 46.5449 z = 43.831 detector = DummyHitDetector -ClassIDSvc INFO getRegistryEntries: read 10 CLIDRegistry entries for module ALL WriteCond DEBUG in execute() WriteCond INFO Hit x = 1.2345 y = 97.655 z = 226.672 detector = DummyHitDetector WriteCond INFO Hit x = 4.4445 y = 91.9761 z = 94.7318 detector = DummyHitDetector @@ -1097,6 +1100,7 @@ AthenaEventLoopMgr INFO ===>>> done processing event #19, run #1 20 events Domain[ROOT_All] INFO -> Deaccess DbDatabase READ [ROOT_All] ???? Domain[ROOT_All] INFO > Deaccess DbDomain READ [ROOT_All] MetaDataSvc DEBUG handle() EndInputFile for FID:???? +EventSelector INFO Disconnecting input sourceID: ???? MetaDataSvc DEBUG handle() LastInputFile for end AthenaEventLoopMgr INFO No more events in event selection WriteCond INFO in finalize() @@ -1129,6 +1133,7 @@ SimplePoolFile4... DEBUG ---->ClassID:???? ##Params DEBUG No objects passing selection criteria... Container has 0 Entries in total. Stream1 INFO Identified a total of 1 objects to write out: Stream1 INFO 0: ExampleHitContainer#PedestalWriteData#PedestalWriteData +ClassIDSvc INFO getRegistryEntries: read 25 CLIDRegistry entries for module ALL StorageSvc INFO Building shape according to reflection information using shape ID for: StorageSvc INFO ExampleHitContainer_p1 [????] SimplePoolFile4... DEBUG --> Access DbContainer CREA/UPDA [ROOT_Tree] ConditionsContainer(ExampleHitContainer_p1/PedestalWriteData) @@ -1178,11 +1183,11 @@ ToolSvc INFO Removing all tools created by ToolSvc *****Chrono***** INFO **************************************************************************************************** commitOutput INFO Time User : Tot= 0 [us] #= 1 cRep_ALL INFO Time User : Tot= 0 [us] Ave/Min/Max= 0(+- 0)/ 0/ 0 [us] #= 2 -cObjR_ALL INFO Time User : Tot= 0 [us] Ave/Min/Max= 0(+- 0)/ 0/ 0 [us] #= 66 -fRep_ALL INFO Time User : Tot= 10 [ms] Ave/Min/Max= 5(+- 5)/ 0/ 10 [ms] #= 2 -cRepR_ALL INFO Time User : Tot= 10 [ms] Ave/Min/Max= 3.33(+- 4.71)/ 0/ 10 [ms] #= 3 -cObj_ALL INFO Time User : Tot= 30 [ms] Ave/Min/Max=0.476(+- 2.13)/ 0/ 10 [ms] #= 63 -ChronoStatSvc INFO Time User : Tot= 0.79 [s] #= 1 +fRep_ALL INFO Time User : Tot= 0 [us] Ave/Min/Max= 0(+- 0)/ 0/ 0 [us] #= 2 +cRepR_ALL INFO Time User : Tot= 0 [us] Ave/Min/Max= 0(+- 0)/ 0/ 0 [us] #= 3 +cObjR_ALL INFO Time User : Tot= 0 [us] Ave/Min/Max= 0(+- 0)/ 0/ 0 [us] #= 46 +cObj_ALL INFO Time User : Tot= 40 [ms] Ave/Min/Max=0.909(+- 4.17)/ 0/ 20 [ms] #= 44 +ChronoStatSvc INFO Time User : Tot= 0.95 [s] #= 1 *****Chrono***** INFO **************************************************************************************************** ChronoStatSvc.f... INFO Service finalized successfully ApplicationMgr INFO Application Manager Finalized successfully diff --git a/Database/AthenaPOOL/EventSelectorAthenaPool/src/EventSelectorAthenaPool.cxx b/Database/AthenaPOOL/EventSelectorAthenaPool/src/EventSelectorAthenaPool.cxx index 66dac58bcb6e8999d061fb4f5231a20846dbe715..f321763ad90f23c0dc8f1910f92aef3e5f0445c7 100755 --- a/Database/AthenaPOOL/EventSelectorAthenaPool/src/EventSelectorAthenaPool.cxx +++ b/Database/AthenaPOOL/EventSelectorAthenaPool/src/EventSelectorAthenaPool.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration */ /** @file EventSelectorAthenaPool.cxx @@ -488,6 +488,15 @@ StatusCode EventSelectorAthenaPool::next(IEvtSelector::Context& ctxt) const { delete (char*)tokenStr; tokenStr = nullptr; return(StatusCode::FAILURE); } + // Remove any old AttributeList + if (const AthenaAttributeList* oldAttrList = + eventStore()->tryRetrieve<AthenaAttributeList> (m_attrListKey.value())) + { + if (!eventStore()->removeDataAndProxy(oldAttrList).isSuccess()) { + ATH_MSG_ERROR("Cannot remove old AttributeList from StoreGate."); + return(StatusCode::FAILURE); + } + } AthenaAttributeList* athAttrList = new AthenaAttributeList(); if (!eventStore()->record(athAttrList, m_attrListKey.value()).isSuccess()) { ATH_MSG_ERROR("Cannot record AttributeList to StoreGate."); @@ -645,13 +654,6 @@ StatusCode EventSelectorAthenaPool::next(IEvtSelector::Context& ctxt) const { } break; } - const DataHandle<AthenaAttributeList> oldAttrList; - if (eventStore()->retrieve(oldAttrList, m_attrListKey.value()).isSuccess()) { - if (!eventStore()->removeDataAndProxy(oldAttrList.cptr()).isSuccess()) { - ATH_MSG_ERROR("Cannot remove old AttributeList from StoreGate."); - return(StatusCode::FAILURE); - } - } } else { if (!m_skipEventSequence.empty() && m_evtCount == m_skipEventSequence.front()) { m_skipEventSequence.erase(m_skipEventSequence.begin()); @@ -999,6 +1001,15 @@ PoolCollectionConverter* EventSelectorAthenaPool::getCollectionCnv(bool throwInc } //__________________________________________________________________________ StatusCode EventSelectorAthenaPool::recordAttributeList() const { + // Remove any old AttributeList + if (const AthenaAttributeList* oldAttrList = + eventStore()->tryRetrieve<AthenaAttributeList> (m_attrListKey.value())) + { + if (!eventStore()->removeDataAndProxy(oldAttrList).isSuccess()) { + ATH_MSG_ERROR("Cannot remove old AttributeList from StoreGate."); + return(StatusCode::FAILURE); + } + } // Get access to AttributeList ATH_MSG_DEBUG("Get AttributeList from the collection"); // MN: accessing only attribute list, ignoring token list diff --git a/Database/AthenaPOOL/PoolSvc/src/PoolSvc.cxx b/Database/AthenaPOOL/PoolSvc/src/PoolSvc.cxx index 1ffbeabd6a609ad92272ed1bd79889ee5ca8bcb7..60aa90d8ed8ba730294f2c022ac1f68a17cee0a7 100644 --- a/Database/AthenaPOOL/PoolSvc/src/PoolSvc.cxx +++ b/Database/AthenaPOOL/PoolSvc/src/PoolSvc.cxx @@ -204,7 +204,7 @@ StatusCode PoolSvc::setupPersistencySvc() { return(StatusCode::FAILURE); } m_contextMaxFile.insert(std::pair<unsigned int, int>(IPoolSvc::kInputStream, m_dbAgeLimit)); - if (!connect(pool::ITransaction::READ).isSuccess()) { + if (!connect(pool::ITransaction::READ, IPoolSvc::kInputStream).isSuccess()) { ATH_MSG_FATAL("Failed to connect Input PersistencySvc."); return(StatusCode::FAILURE); } @@ -313,6 +313,7 @@ void PoolSvc::setObjPtr(void*& obj, const Token* token) const { contextId = const_cast<PoolSvc*>(this)->getInputContext(auxString); } if (contextId >= m_persistencySvcVec.size()) { + ATH_MSG_WARNING("setObjPtr: Using default input Stream instead of id = " << contextId); contextId = IPoolSvc::kInputStream; } } @@ -343,7 +344,7 @@ unsigned int PoolSvc::getInputContext(const std::string& label, unsigned int max const unsigned int id = m_persistencySvcVec.size(); m_persistencySvcVec.push_back( pool::IPersistencySvc::create(*m_catalog).release() ); m_pers_mut.push_back(new CallMutex); - if (!connect(pool::ITransaction::READ).isSuccess()) { + if (!connect(pool::ITransaction::READ, id).isSuccess()) { ATH_MSG_ERROR("Failed to connect Input PersistencySvc."); return(IPoolSvc::kInputStream); } @@ -417,6 +418,7 @@ pool::ICollection* PoolSvc::createCollection(const std::string& collectionType, contextId = IPoolSvc::kOutputStream; } else { if (contextId > m_persistencySvcVec.size()) { + ATH_MSG_WARNING("createCollection: Using default input Stream instead of id = " << contextId); contextId = IPoolSvc::kInputStream; } else if (contextId == m_persistencySvcVec.size()) { contextId = const_cast<PoolSvc*>(this)->getInputContext(""); @@ -541,10 +543,12 @@ Token* PoolSvc::getToken(const std::string& connection, //__________________________________________________________________________ StatusCode PoolSvc::connect(pool::ITransaction::Type type, unsigned int contextId) const { std::lock_guard<CallMutex> lock(m_pool_mut); - if (type != pool::ITransaction::READ) { + if (type != pool::ITransaction::READ && contextId != IPoolSvc::kOutputStream) { + ATH_MSG_WARNING("connect: Using default output Stream instead of id = " << contextId); contextId = IPoolSvc::kOutputStream; } else { if (contextId > m_persistencySvcVec.size()) { + ATH_MSG_WARNING("connect: Using default input Stream instead of id = " << contextId); contextId = IPoolSvc::kInputStream; } else if (contextId == m_persistencySvcVec.size()) { contextId = const_cast<PoolSvc*>(this)->getInputContext(""); @@ -657,6 +661,7 @@ StatusCode PoolSvc::getAttribute(const std::string& optName, long tech, unsigned int contextId) const { if (contextId >= m_persistencySvcVec.size()) { + ATH_MSG_WARNING("getAttribute: Using default input Stream instead of id = " << contextId); contextId = IPoolSvc::kInputStream; } std::lock_guard<CallMutex> lock(*m_pers_mut[contextId]); @@ -730,6 +735,7 @@ StatusCode PoolSvc::setAttribute(const std::string& optName, long tech, unsigned int contextId) const { if (contextId >= m_persistencySvcVec.size()) { + ATH_MSG_WARNING("setAttribute: Using default output Stream instead of id = " << contextId); contextId = IPoolSvc::kOutputStream; } std::lock_guard<CallMutex> lock(*m_pers_mut[contextId]); @@ -755,6 +761,7 @@ StatusCode PoolSvc::setAttribute(const std::string& optName, const std::string& contName, unsigned int contextId) const { if (contextId >= m_persistencySvcVec.size()) { + ATH_MSG_WARNING("setAttribute: Using default output Stream instead of id = " << contextId); contextId = IPoolSvc::kOutputStream; } std::lock_guard<CallMutex> lock(*m_pers_mut[contextId]); @@ -946,6 +953,7 @@ PoolSvc::~PoolSvc() { std::unique_ptr<pool::IDatabase> PoolSvc::getDbHandle(unsigned int contextId, const std::string& dbName) const { pool::IDatabase* dbH = nullptr; if (contextId >= m_persistencySvcVec.size()) { + ATH_MSG_WARNING("getDbHandle: Using default input Stream instead of id = " << contextId); contextId = IPoolSvc::kInputStream; } pool::ISession& sesH = m_persistencySvcVec[contextId]->session(); diff --git a/DetectorDescription/GeoModel/GeoModelUtilities/GeoModelUtilities/GeoAlignmentStore.h b/DetectorDescription/GeoModel/GeoModelUtilities/GeoModelUtilities/GeoAlignmentStore.h index 6dbba6cc450931a52b51c0cd31c6e2cc2dd96654..57ea209176f5459656e252696c5afce66eee74ac 100755 --- a/DetectorDescription/GeoModel/GeoModelUtilities/GeoModelUtilities/GeoAlignmentStore.h +++ b/DetectorDescription/GeoModel/GeoModelUtilities/GeoModelUtilities/GeoAlignmentStore.h @@ -12,7 +12,7 @@ #include "CLHEP/Geometry/Transform3D.h" #include <stdexcept> -class GeoAlignmentStore final : public GeoVAlignmentStore +class GeoAlignmentStore : public GeoVAlignmentStore { public: GeoAlignmentStore() {} diff --git a/DetectorDescription/IRegionSelector/IRegionSelector/RegSelEnums.h b/DetectorDescription/IRegionSelector/IRegionSelector/RegSelEnums.h index d2d0c4c50c78f314d383bf5dbf4c9a94a2e2cd37..6760b837c8f394465fb7ba102d131581bb2abc61 100644 --- a/DetectorDescription/IRegionSelector/IRegionSelector/RegSelEnums.h +++ b/DetectorDescription/IRegionSelector/IRegionSelector/RegSelEnums.h @@ -34,7 +34,9 @@ enum DETID{ CSC, FCALEM, FCALHAD, - FTK + FTK, + MM, + STGC }; diff --git a/Event/xAOD/xAODCore/Root/PrintHelpers.cxx b/Event/xAOD/xAODCore/Root/PrintHelpers.cxx index 7c0ccd8dc48093a49196662989627f53589c4148..a6bb10f03d42b124b520af0a658d6ff82ba36c44 100644 --- a/Event/xAOD/xAODCore/Root/PrintHelpers.cxx +++ b/Event/xAOD/xAODCore/Root/PrintHelpers.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration */ // $Id: PrintHelpers.cxx 780624 2016-10-26 22:41:13Z ssnyder $ @@ -11,17 +11,49 @@ // EDM include(s): #include "AthContainers/AuxElement.h" #include "AthContainers/AuxTypeRegistry.h" +#include "AthContainers/tools/AtomicConstAccessor.h" // Local include(s): #include "xAODCore/tools/PrintHelpers.h" +namespace PrintHelpers { + +template <class T> struct VecPrintType { + typedef T type; +}; + +template <> struct VecPrintType<char> { + typedef int type; +}; + +template <> struct VecPrintType<int8_t> { + typedef int type; +}; + +template <> struct VecPrintType<uint8_t> { + typedef unsigned int type; +}; + +} // namespace PrintHelpers + + +template< typename T, typename U > +std::ostream& operator<< ( std::ostream& out, const std::pair< T, U >& p ) { + out << "("; + out << static_cast<typename PrintHelpers::VecPrintType<T>::type> (p.first); + out << ", "; + out << static_cast<typename PrintHelpers::VecPrintType<U>::type> (p.second); + out << ")"; + return out; +} + /// Helper operator to pretty-print the values of vectors template< typename T > std::ostream& operator<< ( std::ostream& out, const std::vector< T >& vec ) { out << "["; for( size_t i = 0; i < vec.size(); ++i ) { - out << vec[ i ]; + out << static_cast<typename PrintHelpers::VecPrintType<T>::type> (vec[ i ]); if( i < vec.size() - 1 ) { out << ", "; } @@ -85,10 +117,24 @@ std::ostream& operator<< ( std::ostream& out, const SG::AuxElement& obj ) { // The type of the variable: const std::type_info* ti = reg.getType( auxid ); - if( *ti == typeid( int8_t ) ) { - out << static_cast< int >( obj.auxdata< int8_t >( reg.getName( auxid ) ) ); + if( reg.getFlags( auxid ) & SG::AuxTypeRegistry::Atomic ) { + if( *ti == typeid( unsigned int ) ) { + SG::AtomicConstAccessor<unsigned int> acc( reg.getName( auxid ) ); + if ( acc.isAvailable( obj )) { + out << acc (obj); + } + } + else { + out << "(Unsupported atomic type)\n"; + } + } else if( *ti == typeid( int8_t ) ) { + if( obj.isAvailable< int8_t >( reg.getName( auxid ) ) ) { + out << static_cast< int >( obj.auxdata< int8_t >( reg.getName( auxid ) ) ); + } } else if( *ti == typeid( uint8_t ) ) { - out << static_cast< int >( obj.auxdata< uint8_t >( reg.getName( auxid ) ) ); + if( obj.isAvailable< uint8_t >( reg.getName( auxid ) ) ) { + out << static_cast< int >( obj.auxdata< uint8_t >( reg.getName( auxid ) ) ); + } } else if( *ti == typeid( int16_t ) ) { PRINTER( int16_t ); } else if( *ti == typeid( uint16_t ) ) { @@ -105,6 +151,8 @@ std::ostream& operator<< ( std::ostream& out, const SG::AuxElement& obj ) { PRINTER( long ); } else if( *ti == typeid( unsigned long ) ) { PRINTER( unsigned long ); + } else if( *ti == typeid( unsigned long long ) ) { + PRINTER( unsigned long long ); } else if( *ti == typeid( float ) ) { PRINTER( float ); } else if( *ti == typeid( double ) ) { @@ -113,6 +161,12 @@ std::ostream& operator<< ( std::ostream& out, const SG::AuxElement& obj ) { PRINTER( std::vector< float > ); } else if( *ti == typeid( std::vector< double > ) ) { PRINTER( std::vector< double > ); + } else if( *ti == typeid( std::vector< char > ) ) { + PRINTER( std::vector< char > ); + } else if( *ti == typeid( std::vector< int8_t > ) ) { + PRINTER( std::vector< int8_t > ); + } else if( *ti == typeid( std::vector< uint8_t > ) ) { + PRINTER( std::vector< uint8_t > ); } else if( *ti == typeid( std::vector< int16_t > ) ) { PRINTER( std::vector< int16_t > ); } else if( *ti == typeid( std::vector< uint16_t > ) ) { @@ -125,6 +179,11 @@ std::ostream& operator<< ( std::ostream& out, const SG::AuxElement& obj ) { PRINTER( std::vector< int64_t > ); } else if( *ti == typeid( std::vector< uint64_t > ) ) { PRINTER( std::vector< uint64_t > ); + } else if( *ti == typeid( std::vector< std::string > ) ) { + PRINTER( std::vector< std::string > ); + } else if( *ti == typeid( std::vector< std::pair<std::string, std::string> > ) ) { + typedef std::pair<std::string, std::string> Stringpair_t; + PRINTER( std::vector< Stringpair_t > ); } else { out << "N/A"; } diff --git a/ForwardDetectors/AFP/AFP_Monitoring/share/AFPMonitoring_jobOptions.py b/ForwardDetectors/AFP/AFP_Monitoring/share/AFPMonitoring_jobOptions.py index b2d3d5dd05cc710af2ed855369f1c60526baa3c4..92b72912247346dd9126ec2bd6c52fd7c3d0f64e 100644 --- a/ForwardDetectors/AFP/AFP_Monitoring/share/AFPMonitoring_jobOptions.py +++ b/ForwardDetectors/AFP/AFP_Monitoring/share/AFPMonitoring_jobOptions.py @@ -19,7 +19,7 @@ PreScale = 0, EnableLumi = True ) -ToolSvc += AFPSiHitsMonTool +#ToolSvc += AFPSiHitsMonTool AFPMonManager.AthenaMonTools += [ AFPSiHitsMonTool ] from AFP_Monitoring.AFP_MonitoringConf import AFPTechnicalMonitorTool @@ -29,5 +29,5 @@ PreScale = 0, EnableLumi = True ) -ToolSvc += AFPTechnicalMonTool +#ToolSvc += AFPTechnicalMonTool AFPMonManager.AthenaMonTools += [ AFPTechnicalMonTool ] diff --git a/ForwardDetectors/LUCID/LUCID_Monitoring/share/LUCIDMon_jobOptions.py b/ForwardDetectors/LUCID/LUCID_Monitoring/share/LUCIDMon_jobOptions.py index 24a3f6b78d3b9f726722248434a484ac297603b1..50923284a0b2bae67c576ca5bfe9e12ba3b60bda 100755 --- a/ForwardDetectors/LUCID/LUCID_Monitoring/share/LUCIDMon_jobOptions.py +++ b/ForwardDetectors/LUCID/LUCID_Monitoring/share/LUCIDMon_jobOptions.py @@ -14,6 +14,6 @@ from LUCID_Monitoring.LUCID_MonitoringConf import LUCID_HitsMoniTool LUCID_TestTool = LUCID_HitsMoniTool (name = "LUCID_HitsMoniTool") -ToolSvc += LUCID_TestTool +#ToolSvc += LUCID_TestTool LucidMon.AthenaMonTools += [ LUCID_TestTool ] diff --git a/Generators/GeneratorModules/python/EvgenAlg.py b/Generators/GeneratorModules/python/EvgenAlg.py index a719b4280e28e7f82e7eaf8c446a224cbce5fa54..64cd23ca74fb9204a674133648d984ea54dc091d 100644 --- a/Generators/GeneratorModules/python/EvgenAlg.py +++ b/Generators/GeneratorModules/python/EvgenAlg.py @@ -1,8 +1,7 @@ -# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +# Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration from AthenaPython import PyAthena -from AthenaPython.PyAthena import StatusCode, McEventCollection, HepMC, CLHEP -import McParticleEvent.Pythonizations +from AthenaPython.PyAthena import StatusCode import ROOT @@ -28,11 +27,14 @@ class EvgenAlg(PyAthena.Alg): def initialize(self): + import McParticleEvent.Pythonizations self.msg.debug("Initializing [%s]", self.name()) return self.genInitialize() def execute(self): + from AthenaPython.PyAthena import McEventCollection, HepMC + self.msg.debug("Executing [%s]", self.name()) ## Retrieve MC event collection or create a new one diff --git a/Generators/ParticleGun/python/__init__.py b/Generators/ParticleGun/python/__init__.py index 2d8418bdd0b17888e9ab14970cc84a71966771af..c03c4fc7c032984a448cb4c6d9e0810eebe413a1 100644 --- a/Generators/ParticleGun/python/__init__.py +++ b/Generators/ParticleGun/python/__init__.py @@ -1,11 +1,10 @@ -# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +# Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration from AthenaCommon.AppMgr import ServiceMgr as svcMgr from GeneratorModules.EvgenAlg import EvgenAlg from ParticleGun.samplers import * from ParticleGun.histsampling import TH1, TH2 -from AthenaPython.PyAthena import HepMC, StatusCode -import McParticleEvent.Pythonizations +from AthenaPython.PyAthena import StatusCode __author__ = "Andy Buckley <andy.buckley@cern.ch>" @@ -36,6 +35,7 @@ class ParticleGun(EvgenAlg): """ Pass the AtRndmGenSvc seed to Python's random module, or use a fixed value set via pg.randomSeed. """ + import McParticleEvent.Pythonizations seed = None ## Use self.randomSeed directly, or if it's None find a seed string from the ATLAS random number service if self.randomSeed is not None: @@ -67,6 +67,7 @@ class ParticleGun(EvgenAlg): """ ## Set event weight(s) # TODO: allow weighted sampling? + from AthenaPython.PyAthena import HepMC evt.weights().push_back(1.0) ## Make and fill particles diff --git a/HLT/Event/TrigByteStreamCnvSvc/src/TrigByteStreamCnvSvc.cxx b/HLT/Event/TrigByteStreamCnvSvc/src/TrigByteStreamCnvSvc.cxx index 7eb0c67dfaf9d2ea6abe463495f60dc803c33029..d57b540d025d154770a853452f5337cb5a451ed6 100644 --- a/HLT/Event/TrigByteStreamCnvSvc/src/TrigByteStreamCnvSvc.cxx +++ b/HLT/Event/TrigByteStreamCnvSvc/src/TrigByteStreamCnvSvc.cxx @@ -8,7 +8,6 @@ // Athena includes #include "AthenaKernel/EventContextClid.h" #include "ByteStreamCnvSvcBase/IROBDataProviderSvc.h" -#include "EventInfo/EventInfo.h" #include "StoreGate/StoreGateSvc.h" // TDAQ includes @@ -75,7 +74,12 @@ StatusCode TrigByteStreamCnvSvc::connectOutput(const std::string& /*outputFile*/ ATH_MSG_DEBUG("Creating new RawEventWrite for EventContext = " << *eventContext); // Create a new RawEventWrite and copy the header from the input RawEvent m_rawEventWrite = new RawEventWrite; - m_rawEventWrite->copy_header( m_robDataProviderSvc->getEvent(*eventContext)->start() ); + const uint32_t* inputRawEvent = m_robDataProviderSvc->getEvent(*eventContext)->start(); + if (!inputRawEvent) { + ATH_MSG_ERROR("Input RawEvent is nullptr, cannot create output"); + return StatusCode::FAILURE; + } + m_rawEventWrite->copy_header(inputRawEvent); ATH_MSG_VERBOSE("Created RawEventWrite pointer = " << m_rawEventWrite); diff --git a/HLT/Trigger/TrigControl/TrigKernel/TrigKernel/HltPscErrorCode.h b/HLT/Trigger/TrigControl/TrigKernel/TrigKernel/HltPscErrorCode.h index 08dd474ba45cb89ac2d353f94c0f7e189826598e..bb14aa33659a6401c4408d5452124a2fd0261886 100644 --- a/HLT/Trigger/TrigControl/TrigKernel/TrigKernel/HltPscErrorCode.h +++ b/HLT/Trigger/TrigControl/TrigKernel/TrigKernel/HltPscErrorCode.h @@ -10,17 +10,18 @@ // Definition of different error codes for the PSC namespace hltonl { - enum PSCErrorCode { - PSC_ERROR_UNCLASSIFIED = 0x0, - PSC_ERROR_NO_L1_RESULT = 0x1, - PSC_ERROR_SG_CLEAR_FAILED = 0x2, - PSC_ERROR_NO_EVENTINFO = 0x3, - PSC_ERROR_NO_VALID_EVENT = 0x4, - PSC_ERROR_NO_HLTRESULT_FOUND = 0x10, - PSC_ERROR_NO_HLTRESULT_RETRIEVED = 0x11, - PSC_ERROR_INVALID_CTP_RESULT = 0x101, - PSC_ERROR_ROB_BUILD_FAILED = 0x102, - NUM_PSC_ERROR_CODES = 9 + enum class PSCErrorCode : uint32_t { + UNCLASSIFIED = 0, + BEFORE_NEXT_EVENT = 1, + CANNOT_RETRIEVE_EVENT = 2, + NO_EVENT_INFO = 3, + SCHEDULING_FAILURE = 4, + CANNOT_ACCESS_SLOT = 5, + PROCESSING_FAILURE = 6, + NO_HLT_RESULT = 7, + OUTPUT_BUILD_FAILURE = 8, + OUTPUT_SEND_FAILURE = 9, + AFTER_RESULT_SENT = 10 }; /// helper class to map HLT PSC error code on a string name or a int index @@ -36,15 +37,17 @@ namespace hltonl { inline hltonl::MapPscErrorCode::MapPscErrorCode() { // add error codes and description - add(hltonl::PSC_ERROR_UNCLASSIFIED ,"PSC_ERROR_UNCLASSIFIED") ; - add(hltonl::PSC_ERROR_NO_L1_RESULT ,"PSC_ERROR_NO_L1_RESULT") ; - add(hltonl::PSC_ERROR_SG_CLEAR_FAILED ,"PSC_ERROR_SG_CLEAR_FAILED") ; - add(hltonl::PSC_ERROR_NO_EVENTINFO ,"PSC_ERROR_NO_EVENTINFO") ; - add(hltonl::PSC_ERROR_NO_VALID_EVENT ,"PSC_ERROR_NO_VALID_EVENT") ; - add(hltonl::PSC_ERROR_NO_HLTRESULT_FOUND ,"PSC_ERROR_NO_HLTRESULT_FOUND") ; - add(hltonl::PSC_ERROR_NO_HLTRESULT_RETRIEVED,"PSC_ERROR_NO_HLTRESULT_RETRIEVED") ; - add(hltonl::PSC_ERROR_INVALID_CTP_RESULT ,"PSC_ERROR_INVALID_CTP_RESULT") ; - add(hltonl::PSC_ERROR_ROB_BUILD_FAILED ,"PSC_ERROR_ROB_BUILD_FAILED") ; + add(hltonl::PSCErrorCode::UNCLASSIFIED, "PSCErrorCode::UNCLASSIFIED"); + add(hltonl::PSCErrorCode::BEFORE_NEXT_EVENT, "PSCErrorCode::BEFORE_NEXT_EVENT"); + add(hltonl::PSCErrorCode::CANNOT_RETRIEVE_EVENT, "PSCErrorCode::CANNOT_RETRIEVE_EVENT"); + add(hltonl::PSCErrorCode::NO_EVENT_INFO, "PSCErrorCode::NO_EVENT_INFO"); + add(hltonl::PSCErrorCode::SCHEDULING_FAILURE, "PSCErrorCode::SCHEDULING_FAILURE"); + add(hltonl::PSCErrorCode::CANNOT_ACCESS_SLOT, "PSCErrorCode::CANNOT_ACCESS_SLOT"); + add(hltonl::PSCErrorCode::PROCESSING_FAILURE, "PSCErrorCode::PROCESSING_FAILURE"); + add(hltonl::PSCErrorCode::NO_HLT_RESULT, "PSCErrorCode::NO_HLT_RESULT"); + add(hltonl::PSCErrorCode::OUTPUT_BUILD_FAILURE, "PSCErrorCode::OUTPUT_BUILD_FAILURE"); + add(hltonl::PSCErrorCode::OUTPUT_SEND_FAILURE, "PSCErrorCode::OUTPUT_SEND_FAILURE"); + add(hltonl::PSCErrorCode::AFTER_RESULT_SENT, "PSCErrorCode::AFTER_RESULT_SENT"); // return values in case of invalid code invalidCode("UNDEFINED",-1); } diff --git a/HLT/Trigger/TrigControl/TrigServices/CMakeLists.txt b/HLT/Trigger/TrigControl/TrigServices/CMakeLists.txt index 9cb8349e77b3c4fc403dda5543637469a43bae5b..a5e93225cf88d62d35548529e1c0831a5d09a24e 100644 --- a/HLT/Trigger/TrigControl/TrigServices/CMakeLists.txt +++ b/HLT/Trigger/TrigControl/TrigServices/CMakeLists.txt @@ -22,8 +22,6 @@ atlas_depends_on_subdirs( PUBLIC Trigger/TrigDataAccess/TrigROBDataProviderSvc Trigger/TrigEvent/TrigSteeringEvent PRIVATE - Control/CLIDSvc - Control/SGTools Database/AthenaPOOL/AthenaPoolUtilities Trigger/TrigConfiguration/TrigConfInterfaces Trigger/TrigEvent/TrigNavigation @@ -45,12 +43,12 @@ atlas_add_library( TrigServicesLib INCLUDE_DIRS ${TDAQ-COMMON_INCLUDE_DIRS} ${TDAQ_INCLUDE_DIRS} PRIVATE_INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} ${Boost_INCLUDE_DIRS} ${CORAL_INCLUDE_DIRS} LINK_LIBRARIES ${TDAQ-COMMON_LIBRARIES} ${TDAQ_LIBRARIES} AthenaBaseComps AthenaKernel ByteStreamCnvSvcLib ByteStreamData EventInfo xAODEventInfo GaudiKernel TrigKernel TrigSteeringEvent StoreGateLib SGtests ByteStreamCnvSvcBaseLib ByteStreamData_test TrigDataAccessMonitoringLib TrigROBDataProviderSvcLib TrigNavigationLib TrigMonitorBaseLib TrigInterfacesLib - PRIVATE_LINK_LIBRARIES ${ROOT_LIBRARIES} ${Boost_LIBRARIES} ${CORAL_LIBRARIES} SGTools AthenaPoolUtilities TrigSteering ) + PRIVATE_LINK_LIBRARIES ${ROOT_LIBRARIES} ${Boost_LIBRARIES} ${CORAL_LIBRARIES} AthenaPoolUtilities TrigSteering ) atlas_add_component( TrigServices src/components/*.cxx INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} ${Boost_INCLUDE_DIRS} ${CORAL_INCLUDE_DIRS} ${TDAQ-COMMON_INCLUDE_DIRS} ${TDAQ_INCLUDE_DIRS} - LINK_LIBRARIES ${ROOT_LIBRARIES} ${Boost_LIBRARIES} ${CORAL_LIBRARIES} ${TDAQ-COMMON_LIBRARIES} ${TDAQ_LIBRARIES} AthenaBaseComps AthenaKernel StoreGateLib SGtests ByteStreamCnvSvcBaseLib ByteStreamData ByteStreamData_test EventInfo xAODEventInfo GaudiKernel TrigKernel TrigDataAccessMonitoringLib TrigROBDataProviderSvcLib TrigSteeringEvent SGTools AthenaPoolUtilities TrigNavigationLib TrigMonitorBaseLib TrigInterfacesLib TrigServicesLib TrigSteering ) + LINK_LIBRARIES ${ROOT_LIBRARIES} ${Boost_LIBRARIES} ${CORAL_LIBRARIES} ${TDAQ-COMMON_LIBRARIES} ${TDAQ_LIBRARIES} AthenaBaseComps AthenaKernel StoreGateLib SGtests ByteStreamCnvSvcBaseLib ByteStreamData ByteStreamData_test EventInfo xAODEventInfo GaudiKernel TrigKernel TrigDataAccessMonitoringLib TrigROBDataProviderSvcLib TrigSteeringEvent AthenaPoolUtilities TrigNavigationLib TrigMonitorBaseLib TrigInterfacesLib TrigServicesLib TrigSteering ) # Install files from the package: atlas_install_python_modules( python/*.py ) diff --git a/HLT/Trigger/TrigControl/TrigServices/TrigServices/HltEventLoopMgr.h b/HLT/Trigger/TrigControl/TrigServices/TrigServices/HltEventLoopMgr.h index a6321e39450226387c8b311549f5e04840e763f5..b04c5c00edb252cf6bf6bf2de0da40d05ef6830c 100644 --- a/HLT/Trigger/TrigControl/TrigServices/TrigServices/HltEventLoopMgr.h +++ b/HLT/Trigger/TrigControl/TrigServices/TrigServices/HltEventLoopMgr.h @@ -8,6 +8,7 @@ // Trigger includes #include "TrigKernel/IHltTHistSvc.h" #include "TrigKernel/ITrigEventLoopMgr.h" +#include "TrigKernel/HltPscErrorCode.h" #include "TrigROBDataProviderSvc/ITrigROBDataProviderSvc.h" // Athena includes @@ -109,6 +110,10 @@ public: virtual StatusCode stopRun(); private: + // ------------------------- Helper types ------------------------------------ + /// Enum type returned by the drainScheduler method + enum class DrainSchedulerStatusCode {FAILURE=-2, RECOVERABLE=-1, SCHEDULER_EMPTY=0, SUCCESS=1}; + // ------------------------- Helper methods ---------------------------------- /// Check if running in partition @@ -138,21 +143,29 @@ private: /// Print the SOR record void printSORAttrList(const coral::AttributeList& atr) const; - /// Handle a failure to process an event - void failedEvent(const EventContext& eventContext, - const EventInfo* eventInfo=nullptr, - const HLT::HLTResultMT* hltResult=nullptr) const; + /** @brief Handle a failure to process an event + * @return FAILURE breaks the event loop + **/ + StatusCode failedEvent(hltonl::PSCErrorCode errorCode, + const EventContext& eventContext); /// The method executed by the event timeout monitoring thread void runEventTimer(); - // ------------------------- Reimplemented AthenaHiveEventLoopMgr helpers ---- /// Drain the scheduler from all actions that may be queued - int drainScheduler(); + DrainSchedulerStatusCode drainScheduler(); /// Clear an event slot in the whiteboard StatusCode clearWBSlot(size_t evtSlot) const; + /// Try to recover from a situation where scheduler and whiteboard see different number of free slots + StatusCode recoverFromStarvation(); + + /** @brief Try to drain the scheduler and clear all event data slots. + * Method of the last resort, used in attempts to recover from framework errors + **/ + StatusCode drainAllSlots(); + // ------------------------- Handles to required services/tools -------------- ServiceHandle<IIncidentSvc> m_incidentSvc; ServiceHandle<StoreGateSvc> m_evtStore; @@ -208,6 +221,13 @@ private: /// Hard event processing timeout FloatProperty m_softTimeoutFraction; + /// Tolerable number of recovered framework errors + IntegerProperty m_maxFrameworkErrors; + /// Name of the debug stream for events with HLT framework errors + StringProperty m_fwkErrorDebugStreamName; + /// Name of the debug stream for events with HLT algorithm errors + StringProperty m_algErrorDebugStreamName; + /// StoreGate key for recording EventContext SG::WriteHandleKey<EventContext> m_eventContextWHKey; /// StoreGate key for reading EventInfo @@ -251,6 +271,8 @@ private: int m_softTimeoutValue; /// Flag set to false if timer thread should be stopped std::atomic<bool> m_runEventTimer; + /// Counter of framework errors + int m_nFrameworkErrors; }; //============================================================================== diff --git a/HLT/Trigger/TrigControl/TrigServices/src/HltEventLoopMgr.cxx b/HLT/Trigger/TrigControl/TrigServices/src/HltEventLoopMgr.cxx index c84172c35123a7f2cc48aa9205774b8d8e895e8d..72a1bbd40426b6b0ca31417c1fa04dd4411819db 100644 --- a/HLT/Trigger/TrigControl/TrigServices/src/HltEventLoopMgr.cxx +++ b/HLT/Trigger/TrigControl/TrigServices/src/HltEventLoopMgr.cxx @@ -42,14 +42,28 @@ // System includes #include <sstream> +// ============================================================================= // Helper macros, typedefs and constants -#define ST_WHERE __FUNCTION__ << "(): " -#define HLT_EVTLOOP_CHECK(sc,errmsg,...) \ - if (sc.isFailure()) {\ - ATH_MSG_ERROR(ST_WHERE << errmsg); \ - failedEvent(__VA_ARGS__); \ - continue; \ +// ============================================================================= +// Base macro for handling failed events in a loop, see below for specific variants +#define HLT_LOOP_CHECK(scexpr,errmsg,errcode,evctx,retonfail) \ + { \ + StatusCode sccopy = scexpr; \ + if (sccopy.isFailure()) { \ + ATH_REPORT_ERROR(sccopy) << errmsg; \ + if (failedEvent(errcode,evctx).isFailure()) \ + return retonfail; \ + else \ + continue; \ + } \ } +// Handles failed event in the event loop, continues the loop if the failure is recoverable, +// otherwise returns StatusCode::FAILURE to break the loop +#define HLT_EVTLOOP_CHECK(scexpr,errmsg,errcode,evctx) \ + HLT_LOOP_CHECK(scexpr,errmsg,errcode,evctx,StatusCode::FAILURE) +// Same as above but returns DrainSchedulerStatusCode::FAILURE to break the loop +#define HLT_DRAINSCHED_CHECK(scexpr,errmsg,errcode,evctx) \ + HLT_LOOP_CHECK(scexpr,errmsg,errcode,evctx,DrainSchedulerStatusCode::FAILURE) using namespace boost::property_tree; using SOR = TrigSORFromPtreeHelper::SOR; @@ -73,7 +87,8 @@ HltEventLoopMgr::HltEventLoopMgr(const std::string& name, ISvcLocator* svcLoc) m_threadPoolSize(-1), m_evtSelContext(nullptr), m_softTimeoutValue(10000), - m_runEventTimer(true) + m_runEventTimer(true), + m_nFrameworkErrors(0) { ATH_MSG_VERBOSE("start of " << __FUNCTION__); @@ -96,6 +111,10 @@ HltEventLoopMgr::HltEventLoopMgr(const std::string& name, ISvcLocator* svcLoc) "Hard event processing timeout in milliseconds"); declareProperty("SoftTimeoutFraction", m_softTimeoutFraction=0.8, "Fraction of the hard timeout to be set as the soft timeout"); + declareProperty("MaxFrameworkErrors", m_maxFrameworkErrors=0, + "Tolerable number of recovered framework errors before exiting (<0 means all are tolerated)"); + declareProperty("FwkErrorDebugStreamName", m_fwkErrorDebugStreamName="HLTMissingData"); + declareProperty("AlgErrorDebugStreamName", m_algErrorDebugStreamName="HLTError"); declareProperty("EventContextWHKey", m_eventContextWHKey="EventContext"); declareProperty("EventInfoRHKey", m_eventInfoRHKey="ByteStreamEventInfo"); @@ -133,44 +152,47 @@ StatusCode HltEventLoopMgr::initialize() ATH_MSG_DEBUG(" ---> Read from DataFlow configuration: " << m_jobOptionsType); } catch (...) { - ATH_MSG_WARNING(ST_WHERE << "Could not set Property '" << m_jobOptionsType.name() << "' from DataFlow"); + ATH_REPORT_MESSAGE(MSG::WARNING) << "Could not set Property '" << m_jobOptionsType.name() << "' from DataFlow"; } if ( m_topAlgNames.value().empty() ) { if (setProperty(propMgr->getProperty("TopAlg")).isFailure()) { - ATH_MSG_WARNING(ST_WHERE << "Could not set the TopAlg property from ApplicationMgr"); + ATH_REPORT_MESSAGE(MSG::WARNING) << "Could not set the TopAlg property from ApplicationMgr"; } } } else { - ATH_MSG_WARNING(ST_WHERE << "Error retrieving IProperty interface of ApplicationMgr" ); + ATH_REPORT_MESSAGE(MSG::WARNING) << "Error retrieving IProperty interface of ApplicationMgr"; } // get JobOptionsSvc to read the configuration of NumConcurrentEvents and NumThreads ServiceHandle<IJobOptionsSvc> jobOptionsSvc("JobOptionsSvc", name()); if ((jobOptionsSvc.retrieve()).isFailure()) { - ATH_MSG_WARNING(ST_WHERE << "Could not find JobOptionsSvc to read configuration"); + ATH_REPORT_MESSAGE(MSG::WARNING) << "Could not find JobOptionsSvc to read configuration"; } // print properties - ATH_MSG_INFO(" ---> ApplicationName = " << m_applicationName); - ATH_MSG_INFO(" ---> PartitionName = " << m_partitionName); - ATH_MSG_INFO(" ---> JobOptionsType = " << m_jobOptionsType); - ATH_MSG_INFO(" ---> HardTimeout = " << m_hardTimeout); - ATH_MSG_INFO(" ---> SoftTimeoutFraction = " << m_softTimeoutFraction); - ATH_MSG_INFO(" ---> EventContextWHKey = " << m_eventContextWHKey.key()); - ATH_MSG_INFO(" ---> EventInfoRHKey = " << m_eventInfoRHKey.key()); + ATH_MSG_INFO(" ---> ApplicationName = " << m_applicationName); + ATH_MSG_INFO(" ---> PartitionName = " << m_partitionName); + ATH_MSG_INFO(" ---> JobOptionsType = " << m_jobOptionsType); + ATH_MSG_INFO(" ---> HardTimeout = " << m_hardTimeout); + ATH_MSG_INFO(" ---> SoftTimeoutFraction = " << m_softTimeoutFraction); + ATH_MSG_INFO(" ---> MaxFrameworkErrors = " << m_maxFrameworkErrors); + ATH_MSG_INFO(" ---> FwkErrorDebugStreamName = " << m_fwkErrorDebugStreamName); + ATH_MSG_INFO(" ---> AlgErrorDebugStreamName = " << m_algErrorDebugStreamName); + ATH_MSG_INFO(" ---> EventContextWHKey = " << m_eventContextWHKey.key()); + ATH_MSG_INFO(" ---> EventInfoRHKey = " << m_eventInfoRHKey.key()); if (jobOptionsSvc.isValid()) { const Gaudi::Details::PropertyBase* prop = jobOptionsSvc->getClientProperty("EventDataSvc","NSlots"); if (prop) - ATH_MSG_INFO(" ---> NumConcurrentEvents = " << *prop); + ATH_MSG_INFO(" ---> NumConcurrentEvents = " << *prop); else - ATH_MSG_WARNING(ST_WHERE << "Failed to retrieve the job property EventDataSvc.NSlots"); + ATH_REPORT_MESSAGE(MSG::WARNING) << "Failed to retrieve the job property EventDataSvc.NSlots"; prop = jobOptionsSvc->getClientProperty("AvalancheSchedulerSvc","ThreadPoolSize"); if (prop) - ATH_MSG_INFO(" ---> NumThreads = " << *prop); + ATH_MSG_INFO(" ---> NumThreads = " << *prop); else - ATH_MSG_WARNING(ST_WHERE << "Failed to retrieve the job property AvalancheSchedulerSvc.ThreadPoolSize"); + ATH_REPORT_MESSAGE(MSG::WARNING) << "Failed to retrieve the job property AvalancheSchedulerSvc.ThreadPoolSize"; } ATH_MSG_INFO(" ---> Enabled ROBs: size = " << m_enabledROBs.value().size() << (m_enabledROBs.value().size()==0 ? ". No check will be performed" : " ")); @@ -342,17 +364,17 @@ StatusCode HltEventLoopMgr::finalize() // Finalise top level algorithms for (auto& ita : m_topAlgList) { if (ita->sysFinalize().isFailure()) - ATH_MSG_WARNING(ST_WHERE << "Finalisation of algorithm " << ita->name() << " failed"); + ATH_REPORT_MESSAGE(MSG::WARNING) << "Finalisation of algorithm " << ita->name() << " failed"; } // Release top level algorithms SmartIF<IAlgManager> algMgr = serviceLocator()->as<IAlgManager>(); if (!algMgr.isValid()) { - ATH_MSG_WARNING(ST_WHERE << "Failed to retrieve AlgManager - cannot finalise top level algorithms"); + ATH_REPORT_MESSAGE(MSG::WARNING) << "Failed to retrieve AlgManager - cannot finalise top level algorithms"; } else { for (auto& ita : m_topAlgList) { if (algMgr->removeAlgorithm(ita).isFailure()) - ATH_MSG_WARNING(ST_WHERE << "Problems removing Algorithm " << ita->name()); + ATH_REPORT_MESSAGE(MSG::WARNING) << "Problems removing Algorithm " << ita->name(); } } m_topAlgList.clear(); @@ -390,27 +412,27 @@ StatusCode HltEventLoopMgr::finalize() #else // standard older than C++17 // Release service handles if (m_incidentSvc.release().isFailure()) - ATH_MSG_WARNING(ST_WHERE << "Failed to release service " << m_incidentSvc.typeAndName()); + ATH_REPORT_MESSAGE(MSG::WARNING) << "Failed to release service " << m_incidentSvc.typeAndName(); if (m_robDataProviderSvc.release().isFailure()) - ATH_MSG_WARNING(ST_WHERE << "Failed to release service " << m_robDataProviderSvc.typeAndName()); + ATH_REPORT_MESSAGE(MSG::WARNING) << "Failed to release service " << m_robDataProviderSvc.typeAndName(); if (m_evtStore.release().isFailure()) - ATH_MSG_WARNING(ST_WHERE << "Failed to release service " << m_evtStore.typeAndName()); + ATH_REPORT_MESSAGE(MSG::WARNING) << "Failed to release service " << m_evtStore.typeAndName(); if (m_detectorStore.release().isFailure()) - ATH_MSG_WARNING(ST_WHERE << "Failed to release service " << m_detectorStore.typeAndName()); + ATH_REPORT_MESSAGE(MSG::WARNING) << "Failed to release service " << m_detectorStore.typeAndName(); if (m_inputMetaDataStore.release().isFailure()) - ATH_MSG_WARNING(ST_WHERE << "Failed to release service " << m_inputMetaDataStore.typeAndName()); + ATH_REPORT_MESSAGE(MSG::WARNING) << "Failed to release service " << m_inputMetaDataStore.typeAndName(); if (m_THistSvc.release().isFailure()) - ATH_MSG_WARNING(ST_WHERE << "Failed to release service " << m_THistSvc.typeAndName()); + ATH_REPORT_MESSAGE(MSG::WARNING) << "Failed to release service " << m_THistSvc.typeAndName(); if (m_evtSelector.release().isFailure()) - ATH_MSG_WARNING(ST_WHERE << "Failed to release service " << m_evtSelector.typeAndName()); + ATH_REPORT_MESSAGE(MSG::WARNING) << "Failed to release service " << m_evtSelector.typeAndName(); if (m_outputCnvSvc.release().isFailure()) - ATH_MSG_WARNING(ST_WHERE << "Failed to release service " << m_outputCnvSvc.typeAndName()); + ATH_REPORT_MESSAGE(MSG::WARNING) << "Failed to release service " << m_outputCnvSvc.typeAndName(); // Release tool handles if (m_coolHelper.release().isFailure()) - ATH_MSG_WARNING(ST_WHERE << "Failed to release tool " << m_coolHelper.typeAndName()); + ATH_REPORT_MESSAGE(MSG::WARNING) << "Failed to release tool " << m_coolHelper.typeAndName(); if (m_hltResultBuilder.release().isFailure()) - ATH_MSG_WARNING(ST_WHERE << "Failed to release tool " << m_hltResultBuilder.typeAndName()); + ATH_REPORT_MESSAGE(MSG::WARNING) << "Failed to release tool " << m_hltResultBuilder.typeAndName(); // Release SmartIFs m_whiteboard.reset(); @@ -469,11 +491,7 @@ StatusCode HltEventLoopMgr::prepareForRun(const ptree& pt) // do the necessary resets // internalPrepareResets() was here - StatusCode sc = clearTemporaryStores(); - if (sc.isFailure()) { - ATH_MSG_ERROR(ST_WHERE << "Clearing temporary stores failed"); - return sc; - } + ATH_CHECK(clearTemporaryStores()); const SOR* sor; // update SOR in det store and get it back @@ -506,15 +524,15 @@ StatusCode HltEventLoopMgr::prepareForRun(const ptree& pt) } catch(const ptree_bad_path & e) { - ATH_MSG_ERROR(ST_WHERE << "Bad ptree path: \"" << e.path<ptree::path_type>().dump() << "\" - " << e.what()); + ATH_REPORT_MESSAGE(MSG::ERROR) << "Bad ptree path: \"" << e.path<ptree::path_type>().dump() << "\" - " << e.what(); } catch(const ptree_bad_data & e) { - ATH_MSG_ERROR(ST_WHERE << "Bad ptree data: \"" << e.data<ptree::data_type>() << "\" - " << e.what()); + ATH_REPORT_MESSAGE(MSG::ERROR) << "Bad ptree data: \"" << e.data<ptree::data_type>() << "\" - " << e.what(); } catch(const std::runtime_error& e) { - ATH_MSG_ERROR(ST_WHERE << "Runtime error: " << e.what()); + ATH_REPORT_MESSAGE(MSG::ERROR) << "Runtime error: " << e.what(); } ATH_MSG_VERBOSE("end of " << __FUNCTION__); @@ -544,7 +562,7 @@ StatusCode HltEventLoopMgr::hltUpdateAfterFork(const ptree& /*pt*/) ATH_MSG_DEBUG("Done a stop-start of CoreDumpSvc"); } else { - ATH_MSG_WARNING(ST_WHERE << "Could not retrieve CoreDumpSvc"); + ATH_REPORT_MESSAGE(MSG::WARNING) << "Could not retrieve CoreDumpSvc"; } // Start the timeout thread @@ -572,7 +590,7 @@ StatusCode HltEventLoopMgr::executeRun(int maxevt) ATH_MSG_VERBOSE("start of " << __FUNCTION__); StatusCode sc = nextEvent(maxevt); if (sc.isFailure()) { - ATH_MSG_ERROR(ST_WHERE << "Event loop failed"); + ATH_REPORT_ERROR(sc) << "Event loop failed"; // Extra clean-up may be needed here after the failure } @@ -603,8 +621,16 @@ StatusCode HltEventLoopMgr::nextEvent(int /*maxevt*/) bool events_available = true; // DataCollector has more events while (!loop_ended) { - ATH_MSG_DEBUG("Free slots = " << m_schedulerSvc->freeSlots()); - if (m_schedulerSvc->freeSlots()>0 && events_available) { + ATH_MSG_DEBUG("Free processing slots = " << m_schedulerSvc->freeSlots()); + ATH_MSG_DEBUG("Free event data slots = " << m_whiteboard->freeSlots()); + if (m_schedulerSvc->freeSlots() != m_whiteboard->freeSlots()) { + // Starvation detected - try to recover and return FAILURE if the recovery fails. This can only happen if there + // is an unhandled error after popping an event from the scheduler and before clearing the event data slot for + // this finished event. It's an extra protection in the unlikely case that failedEvent doesn't cover all errors. + ATH_CHECK(recoverFromStarvation()); + } + // Normal event processing + else if (m_schedulerSvc->freeSlots()>0 && events_available) { ATH_MSG_DEBUG("Free slots = " << m_schedulerSvc->freeSlots() << ". Reading the next event."); //------------------------------------------------------------------------ @@ -615,10 +641,10 @@ StatusCode HltEventLoopMgr::nextEvent(int /*maxevt*/) auto slot = m_whiteboard->allocateStore(m_localEventNumber); // returns npos on failure HLT_EVTLOOP_CHECK(((slot==std::string::npos) ? StatusCode(StatusCode::FAILURE) : StatusCode(StatusCode::SUCCESS)), "Failed to allocate slot for a new event", - EventContext()); + hltonl::PSCErrorCode::BEFORE_NEXT_EVENT, EventContext()); HLT_EVTLOOP_CHECK(m_whiteboard->selectStore(slot), "Failed to select event store slot number " << slot, - EventContext()); + hltonl::PSCErrorCode::BEFORE_NEXT_EVENT, EventContext()); // We can completely avoid using ThreadLocalContext if we store the EventContext in the event store. Any // service/tool method which does not allow to pass EventContext as argument, can const-retrieve it from the @@ -632,7 +658,7 @@ StatusCode HltEventLoopMgr::nextEvent(int /*maxevt*/) auto eventContext = SG::makeHandle(m_eventContextWHKey,*eventContextPtr); HLT_EVTLOOP_CHECK(eventContext.record(std::move(eventContextPtr)), "Failed to record new EventContext in the event store", - EventContext()); + hltonl::PSCErrorCode::BEFORE_NEXT_EVENT, EventContext()); // Reset the AlgExecStateSvc m_aess->reset(*eventContext); @@ -651,7 +677,7 @@ StatusCode HltEventLoopMgr::nextEvent(int /*maxevt*/) IOpaqueAddress* addr = nullptr; HLT_EVTLOOP_CHECK(m_evtSelector->createAddress(*m_evtSelContext, addr), "Event selector failed to create an IOpaqueAddress", - *eventContext); + hltonl::PSCErrorCode::BEFORE_NEXT_EVENT, *eventContext); //------------------------------------------------------------------------ // Get the next event @@ -665,15 +691,16 @@ StatusCode HltEventLoopMgr::nextEvent(int /*maxevt*/) events_available = false; sc = clearWBSlot(eventContext->slot()); if (sc.isFailure()) { - ATH_MSG_WARNING(ST_WHERE << "Failed to clear the whiteboard slot " << eventContext->slot() - << " after NoMoreEvents detected"); + ATH_REPORT_MESSAGE(MSG::WARNING) << "Failed to clear the whiteboard slot " << eventContext->slot() + << " after NoMoreEvents detected"; } continue; } catch (...) { sc = StatusCode::FAILURE; } - HLT_EVTLOOP_CHECK(sc, "Failed to get the next event", *eventContext); + HLT_EVTLOOP_CHECK(sc, "Failed to get the next event", + hltonl::PSCErrorCode::CANNOT_RETRIEVE_EVENT, *eventContext); //------------------------------------------------------------------------ // Set event processing start time for timeout monitoring and reset timeout flag @@ -689,12 +716,13 @@ StatusCode HltEventLoopMgr::nextEvent(int /*maxevt*/) //------------------------------------------------------------------------ // Load event proxies and get event info //------------------------------------------------------------------------ - HLT_EVTLOOP_CHECK(m_evtStore->loadEventProxies(), "Failed to load event proxies", *eventContext); + HLT_EVTLOOP_CHECK(m_evtStore->loadEventProxies(), "Failed to load event proxies", + hltonl::PSCErrorCode::NO_EVENT_INFO, *eventContext); auto eventInfo = SG::makeHandle(m_eventInfoRHKey,*eventContext); HLT_EVTLOOP_CHECK((eventInfo.isValid() ? StatusCode(StatusCode::SUCCESS) : StatusCode(StatusCode::FAILURE)), "Failed to retrieve EventInfo", - *eventContext); + hltonl::PSCErrorCode::NO_EVENT_INFO, *eventContext); ATH_MSG_DEBUG("Retrieved event info for the new event " << *eventInfo->event_ID()); @@ -710,8 +738,8 @@ StatusCode HltEventLoopMgr::nextEvent(int /*maxevt*/) // Need to pass the argument as void* because the IEventProcessor interface doesn't allow explicitly // passing EventContext to executeEvent HLT_EVTLOOP_CHECK(executeEvent( static_cast<void*>(eventContext.ptr()) ), - "Error processing event", - *eventContext, eventInfo.ptr()); + "Failed to schedule event processing", + hltonl::PSCErrorCode::SCHEDULING_FAILURE, *eventContext); //------------------------------------------------------------------------ // Set ThreadLocalContext to an invalid context @@ -722,15 +750,20 @@ StatusCode HltEventLoopMgr::nextEvent(int /*maxevt*/) } // End of if(free slots && events available) else { ATH_MSG_DEBUG("No free slots or no more events to process - draining the scheduler"); - int drainResult = drainScheduler(); - if (drainResult<0) { - ATH_MSG_ERROR(ST_WHERE << "Error draining scheduler"); + DrainSchedulerStatusCode drainResult = drainScheduler(); + if (drainResult==DrainSchedulerStatusCode::FAILURE) { + ATH_REPORT_MESSAGE(MSG::ERROR) << "Error in draining scheduler, exiting the event loop"; + return StatusCode::FAILURE; + } + if (drainResult==DrainSchedulerStatusCode::RECOVERABLE) { + ATH_REPORT_MESSAGE(MSG::WARNING) << "Recoverable error in draining scheduler, continuing the event loop"; continue; } - else if (drainResult==0 && !events_available) { + else if (drainResult==DrainSchedulerStatusCode::SCHEDULER_EMPTY && !events_available) { ATH_MSG_INFO("All events processed, finalising the event loop"); loop_ended = true; } + // else drainResult is SUCCESS, so we just continue } } @@ -755,7 +788,7 @@ StatusCode HltEventLoopMgr::executeEvent(void* pEvtContext) EventContext* eventContext = static_cast<EventContext*>(pEvtContext); if (!eventContext) { - ATH_MSG_ERROR(ST_WHERE << "Failed to cast the call parameter to EventContext*"); + ATH_REPORT_MESSAGE(MSG::ERROR) << "Failed to cast the call parameter to EventContext*"; return StatusCode::FAILURE; } @@ -766,9 +799,9 @@ StatusCode HltEventLoopMgr::executeEvent(void* pEvtContext) StatusCode addEventStatus = m_schedulerSvc->pushNewEvent(eventContext); // If this fails, we need to wait for something to complete - if (!addEventStatus.isSuccess()){ - ATH_MSG_ERROR(ST_WHERE << "Failed adding event " << eventContext->evt() << ", slot " << eventContext->slot() - << " to the scheduler"); + if (addEventStatus.isFailure()){ + ATH_REPORT_MESSAGE(MSG::ERROR) << "Failed adding event " << eventContext->evt() << ", slot " << eventContext->slot() + << " to the scheduler"; return StatusCode::FAILURE; } @@ -782,7 +815,7 @@ void HltEventLoopMgr::updateDFProps() ATH_MSG_VERBOSE("start of " << __FUNCTION__); ServiceHandle<IJobOptionsSvc> p_jobOptionsSvc("JobOptionsSvc", name()); if ((p_jobOptionsSvc.retrieve()).isFailure()) { - ATH_MSG_WARNING(ST_WHERE << "Could not find JobOptionsSvc to set DataFlow properties"); + ATH_REPORT_MESSAGE(MSG::WARNING) << "Could not find JobOptionsSvc to set DataFlow properties"; } else { auto dfprops = p_jobOptionsSvc->getProperties("DataFlowConfig"); @@ -792,7 +825,7 @@ void HltEventLoopMgr::updateDFProps() if(prop && m_applicationName.assign(*prop)) { ATH_MSG_DEBUG(" ---> Read from DataFlow configuration: " << m_applicationName); } else { - ATH_MSG_WARNING(ST_WHERE << "Could not set Property '" << pname << "' from DataFlow"); + ATH_REPORT_MESSAGE(MSG::WARNING) << "Could not set Property '" << pname << "' from DataFlow"; } // Partition name @@ -801,7 +834,7 @@ void HltEventLoopMgr::updateDFProps() if (prop && m_partitionName.assign(*prop)) { ATH_MSG_DEBUG(" ---> Read from DataFlow configuration: " << m_partitionName); } else { - ATH_MSG_WARNING(ST_WHERE << "Could not set Property '" << pname << "' from DataFlow"); + ATH_REPORT_MESSAGE(MSG::WARNING) << "Could not set Property '" << pname << "' from DataFlow"; } // get the list of enabled ROBs @@ -846,7 +879,7 @@ const SOR* HltEventLoopMgr::processRunParams(const ptree & pt) TrigSORFromPtreeHelper sorhelp{msgStream()}; const SOR* sor = sorhelp.fillSOR(pt.get_child("RunParams"),runStartEventContext); if(!sor) { - ATH_MSG_ERROR(ST_WHERE << "setup of SOR from ptree failed"); + ATH_REPORT_MESSAGE(MSG::ERROR) << "setup of SOR from ptree failed"; } ATH_MSG_VERBOSE("end of " << __FUNCTION__); @@ -901,7 +934,7 @@ void HltEventLoopMgr::updateMetadataStore(const coral::AttributeList & sor_attrl // Record ByteStreamMetadata in MetaData Store if(m_inputMetaDataStore->record(metadata,"ByteStreamMetadata").isFailure()) { - ATH_MSG_WARNING(ST_WHERE << "Unable to record MetaData in InputMetaDataStore"); + ATH_REPORT_MESSAGE(MSG::WARNING) << "Unable to record MetaData in InputMetaDataStore"; delete metadata; } else { @@ -910,28 +943,22 @@ void HltEventLoopMgr::updateMetadataStore(const coral::AttributeList & sor_attrl } -// ============================================================================== +// ============================================================================= StatusCode HltEventLoopMgr::clearTemporaryStores() { //---------------------------------------------------------------------------- // Clear the event store, if used in the event loop //---------------------------------------------------------------------------- - auto sc = m_evtStore->clearStore(); - ATH_MSG_DEBUG("clear of Event Store " << sc); - if(sc.isFailure()) { - ATH_MSG_ERROR(ST_WHERE << "clear of Event Store failed"); - return sc; - } + ATH_CHECK(m_evtStore->clearStore()); + ATH_MSG_DEBUG("Cleared the EventStore"); //---------------------------------------------------------------------------- // Clear the InputMetaDataStore //---------------------------------------------------------------------------- - sc = m_inputMetaDataStore->clearStore(); - ATH_MSG_DEBUG("clear of InputMetaDataStore store " << sc); - if(sc.isFailure()) - ATH_MSG_ERROR(ST_WHERE << "clear of InputMetaDataStore failed"); + ATH_CHECK(m_inputMetaDataStore->clearStore()); + ATH_MSG_DEBUG("Cleared the InputMetaDataStore"); - return sc; + return StatusCode::SUCCESS; } // ============================================================================= @@ -949,7 +976,7 @@ void HltEventLoopMgr::updateDetMask(const std::pair<uint64_t, uint64_t>& dm) ); } -// ============================================================================== +// ============================================================================= const coral::AttributeList& HltEventLoopMgr::getSorAttrList(const SOR* sor) const { if(sor->size() != 1) @@ -958,7 +985,7 @@ const coral::AttributeList& HltEventLoopMgr::getSorAttrList(const SOR* sor) cons // corresponding to the SOR should contain one single AttrList). Since // that's required by code ahead but not checked at compile time, we // explicitly guard against any potential future mistake with this check - ATH_MSG_ERROR(ST_WHERE << "Wrong SOR: size = " << sor->size()); + ATH_REPORT_MESSAGE(MSG::ERROR) << "Wrong SOR: size = " << sor->size(); throw std::runtime_error("SOR record should have one and one only attribute list, but it has " + sor->size()); } @@ -967,7 +994,7 @@ const coral::AttributeList& HltEventLoopMgr::getSorAttrList(const SOR* sor) cons return soral; } -// ============================================================================== +// ============================================================================= void HltEventLoopMgr::printSORAttrList(const coral::AttributeList& atr) const { unsigned long long sorTime_ns(atr["SORTime"].data<unsigned long long>()); @@ -999,17 +1026,208 @@ void HltEventLoopMgr::printSORAttrList(const coral::AttributeList& atr) const ATH_MSG_INFO(" RecordingEnabled = " << (atr["RecordingEnabled"].data<bool>() ? "true" : "false")); } -// ============================================================================== -void HltEventLoopMgr::failedEvent(const EventContext& /*eventContext*/, - const EventInfo* /*eventInfo*/, - const HLT::HLTResultMT* /*hltResult*/) const +// ============================================================================= +StatusCode HltEventLoopMgr::failedEvent(hltonl::PSCErrorCode errorCode, const EventContext& eventContext) { ATH_MSG_VERBOSE("start of " << __FUNCTION__); - // All error handling will be implemented here + + // Used by MsgSvc (and possibly others but not relevant here) + Gaudi::Hive::setCurrentContext(eventContext); + + auto drainAllAndProceed = [&]() -> StatusCode { + ATH_CHECK(drainAllSlots()); // break the event loop on failure + if ( m_maxFrameworkErrors.value()>=0 && ((++m_nFrameworkErrors)<=m_maxFrameworkErrors.value()) ) + return StatusCode::SUCCESS; // continue the event loop + else { + ATH_REPORT_MESSAGE(MSG::ERROR) + << "The number of tolerable framework errors for this HltEventLoopMgr instance, which is " + << m_maxFrameworkErrors.value() << ", was exceeded. Exiting the event loop."; + return StatusCode::FAILURE; // break the event loop + } + }; + + //---------------------------------------------------------------------------- + // Handle cases where we can only try to clear all slots and continue + //---------------------------------------------------------------------------- + + if (errorCode==hltonl::PSCErrorCode::BEFORE_NEXT_EVENT) { + ATH_REPORT_MESSAGE(MSG::ERROR) + << "Failure occurred with PSCErrorCode=" << hltonl::PrintPscErrorCode(errorCode) + << " meaning there was a framework error before requesting a new event. No output will be produced and all slots" + << " of this HltEventLoopMgr instance will be drained before proceeding."; + return drainAllAndProceed(); + } + else if (errorCode==hltonl::PSCErrorCode::AFTER_RESULT_SENT) { + ATH_REPORT_MESSAGE(MSG::ERROR) + << "Failure occurred with PSCErrorCode=" << hltonl::PrintPscErrorCode(errorCode) + << " meaning there was a framework error after HLT result was already sent out." + << " All slots of this HltEventLoopMgr instance will be drained before proceeding."; + return drainAllAndProceed(); + } + else if (errorCode==hltonl::PSCErrorCode::CANNOT_ACCESS_SLOT) { + ATH_REPORT_MESSAGE(MSG::ERROR) + << "Failed to access the slot for the processed event, cannot produce output. PSCErrorCode=" + << hltonl::PrintPscErrorCode(errorCode) + << ". All slots of this HltEventLoopMgr instance will be drained before proceeding, then either the loop will" + << " exit with a failure code or the failed event will reach a hard timeout."; + return drainAllAndProceed(); + } + else if (!eventContext.valid()) { + ATH_REPORT_MESSAGE(MSG::ERROR) + << "Failure occurred with an invalid EventContext. Likely there was a framework error before requesting a new" + << " event or after sending the result of a finished event. PSCErrorCode=" << hltonl::PrintPscErrorCode(errorCode) + << ". All slots of this HltEventLoopMgr instance will be drained before proceeding."; + return drainAllAndProceed(); + } + + //---------------------------------------------------------------------------- + // Make sure we are using the right store + //---------------------------------------------------------------------------- + if (m_whiteboard->selectStore(eventContext.slot()).isFailure()) { + return failedEvent(hltonl::PSCErrorCode::CANNOT_ACCESS_SLOT,eventContext); + } + + //---------------------------------------------------------------------------- + // Try to retrieve event info for printouts + //---------------------------------------------------------------------------- + auto eventInfo = SG::makeHandle(m_eventInfoRHKey,eventContext); + std::ostringstream ss; + if (eventInfo.isValid()) { + ss << *eventInfo->event_ID(); + } + std::string eventInfoString = ss.str(); + + if (errorCode==hltonl::PSCErrorCode::SCHEDULING_FAILURE) { + // Here we cannot be certain if the scheduler started processing the event or not, so we can only try to drain + // the scheduler and continue. Trying to create a debug stream result for this event and clear the event slot may + // lead to further problems if the event is being processed + ATH_REPORT_MESSAGE(MSG::ERROR) + << "Failure occurred with PSCErrorCode=" << hltonl::PrintPscErrorCode(errorCode) << ". Cannot determine if the" + << " event processing started or not. Current local event number is " << eventContext.evt() + << ", slot " << eventContext.slot() << ". " << eventInfoString + << " All slots of this HltEventLoopMgr instance will be drained before proceeding."; + return drainAllAndProceed(); + } + + //---------------------------------------------------------------------------- + // Create an HLT result for the failed event (copy one if it exists) + //---------------------------------------------------------------------------- + auto hltResultRH = SG::makeHandle(m_hltResultRHKey,eventContext); + if (!hltResultRH.isValid()) { + // Try to build a result if not available + m_hltResultBuilder->buildResult(eventContext).ignore(); + } + + std::unique_ptr<HLT::HLTResultMT> hltResultPtr; + if (!hltResultRH.isValid()) + hltResultPtr = std::make_unique<HLT::HLTResultMT>(); + else + hltResultPtr = std::make_unique<HLT::HLTResultMT>(*hltResultRH); + + SG::WriteHandleKey<HLT::HLTResultMT> hltResultWHK(m_hltResultRHKey.key()+"_FailedEvent"); + hltResultWHK.initialize(); + auto hltResultWH = SG::makeHandle(hltResultWHK,eventContext); + if (hltResultWH.record(std::move(hltResultPtr)).isFailure()) { + ATH_REPORT_MESSAGE(MSG::ERROR) + << "Failed to record the HLT Result in event store while handling a failed event. Likely an issue with the store." + << " PSCErrorCode=" << hltonl::PrintPscErrorCode(errorCode) << ", local event number " << eventContext.evt() + << ", slot " << eventContext.slot() << ". " << eventInfoString + << " All slots of this HltEventLoopMgr instance will be drained before proceeding."; + return drainAllAndProceed(); + } + + //---------------------------------------------------------------------------- + // Set error code and make sure the debug stream tag is added + //---------------------------------------------------------------------------- + hltResultWH->addStatusWord( static_cast<uint32_t>(errorCode) ); + bool debugStreamAdded = false; + std::string debugStreamName = (errorCode==hltonl::PSCErrorCode::PROCESSING_FAILURE) ? + m_algErrorDebugStreamName.value() : m_fwkErrorDebugStreamName.value(); + for (const auto& st : hltResultWH->getStreamTags()) { + if (st.name==debugStreamName && eformat::helper::string_to_tagtype(st.type)==eformat::DEBUG_TAG) { + debugStreamAdded = true; + break; + } + } + if (!debugStreamAdded) hltResultWH->addStreamTag({debugStreamName,eformat::DEBUG_TAG,true}); + + //---------------------------------------------------------------------------- + // Try to build and send the output + //---------------------------------------------------------------------------- + if (m_outputCnvSvc->connectOutput("").isFailure()) { + ATH_REPORT_MESSAGE(MSG::ERROR) + << "The output conversion service failed in connectOutput() while handling a failed event. No HLT result can be" + << " recorded for this event. PSCErrorCode=" << hltonl::PrintPscErrorCode(errorCode) << ", local event number " + << eventContext.evt() << ", slot " << eventContext.slot() << ". " << eventInfoString + << " All slots of this HltEventLoopMgr instance will be drained before proceeding."; + return drainAllAndProceed(); + } + + DataObject* hltResultDO = m_evtStore->accessData(hltResultWH.clid(),hltResultWH.key()); + if (!hltResultDO) { + ATH_REPORT_MESSAGE(MSG::ERROR) + << "Failed to retrieve DataObject for the HLT result object while handling a failed event. No HLT result" + << " can be recorded for this event. PSCErrorCode=" << hltonl::PrintPscErrorCode(errorCode) + << ", local event number " << eventContext.evt() << ", slot " << eventContext.slot() << ". " << eventInfoString + << " All slots of this HltEventLoopMgr instance will be drained before proceeding."; + return drainAllAndProceed(); + } + + IOpaqueAddress* addr = nullptr; + if (m_outputCnvSvc->createRep(hltResultDO,addr).isFailure() || !addr) { + ATH_REPORT_MESSAGE(MSG::ERROR) + << "Conversion of HLT result object to the output format failed while handling a failed event. No HLT result" + << " can be recorded for this event. PSCErrorCode=" << hltonl::PrintPscErrorCode(errorCode) + << ", local event number " << eventContext.evt() << ", slot " << eventContext.slot() << ". " << eventInfoString + << " All slots of this HltEventLoopMgr instance will be drained before proceeding."; + return drainAllAndProceed(); + } + + if (m_outputCnvSvc->commitOutput("",true).isFailure()) { + ATH_REPORT_MESSAGE(MSG::ERROR) + << "The output conversion service failed in commitOutput() while handling a failed event. No HLT result can be" + << " recorded for this event. PSCErrorCode=" << hltonl::PrintPscErrorCode(errorCode) << ", local event number " + << eventContext.evt() << ", slot " << eventContext.slot() << ". " << eventInfoString + << " All slots of this HltEventLoopMgr instance will be drained before proceeding."; + return drainAllAndProceed(); + } + + //---------------------------------------------------------------------------- + // Clear the event data slot + //---------------------------------------------------------------------------- + // Need to copy the event context because it's managed by the event store and clearWBSlot deletes it + EventContext eventContextCopy = eventContext; + if (clearWBSlot(eventContext.slot()).isFailure()) + return failedEvent(hltonl::PSCErrorCode::AFTER_RESULT_SENT,eventContextCopy); + + //---------------------------------------------------------------------------- + // Finish handling the failed event + //---------------------------------------------------------------------------- + + // Unless this is a processing (i.e. algorithm) failure, increment the number of framework failures + if (errorCode != hltonl::PSCErrorCode::PROCESSING_FAILURE) { + if ( (++m_nFrameworkErrors)>m_maxFrameworkErrors.value() ) { + ATH_REPORT_MESSAGE(MSG::ERROR) + << "Failure with PSCErrorCode=" << hltonl::PrintPscErrorCode(errorCode) << " was successfully handled, but the" + << " number of tolerable framework errors for this HltEventLoopMgr instance, which is " + << m_maxFrameworkErrors.value() << ", was exceeded. Current local event number is " << eventContextCopy.evt() + << ", slot " << eventContextCopy.slot() << ". " << eventInfoString + << " All slots of this HltEventLoopMgr instance will be drained and the loop will exit."; + ATH_CHECK(drainAllSlots()); + return StatusCode::FAILURE; + } + } + + // Even if handling the failed event succeeded, print an error message with failed event details + ATH_REPORT_MESSAGE(MSG::ERROR) + << "Failed event with PSCErrorCode=" << hltonl::PrintPscErrorCode(errorCode) << " Current local event number is " + << eventContextCopy.evt() << ", slot " << eventContextCopy.slot() << ". " << eventInfoString; + ATH_MSG_VERBOSE("end of " << __FUNCTION__); + return StatusCode::SUCCESS; // continue the event loop } -// ============================================================================== +// ============================================================================= void HltEventLoopMgr::runEventTimer() { ATH_MSG_VERBOSE("start of " << __FUNCTION__); @@ -1022,13 +1240,13 @@ void HltEventLoopMgr::runEventTimer() // iterate over all slots and check for timeout if (!m_isSlotProcessing.at(i)) continue; if (now > m_eventTimerStartPoint.at(i) + softDuration) { - EventContext ctx(i,0); // we only need the slot number for Athena::Timeout instance + EventContext ctx(0,i); // we only need the slot number for Athena::Timeout instance // don't duplicate the actions if the timeout was already reached if (!Athena::Timeout::instance(ctx).reached()) { auto procTime = now - m_eventTimerStartPoint.at(i); auto procTimeMillisec = std::chrono::duration_cast<std::chrono::milliseconds>(procTime); - ATH_MSG_ERROR(ST_WHERE << "Soft timeout in slot " << i << ". Processing time = " - << procTimeMillisec.count() << " ms"); + ATH_REPORT_MESSAGE(MSG::ERROR) << "Soft timeout in slot " << i << ". Processing time = " + << procTimeMillisec.count() << " ms"; setTimeout(Athena::Timeout::instance(ctx)); } } @@ -1037,12 +1255,13 @@ void HltEventLoopMgr::runEventTimer() ATH_MSG_VERBOSE("end of " << __FUNCTION__); } -// ============================================================================== +// ============================================================================= /** - * @brief Processes output of finished events and cleans up the slots - * @return -1 on failure; 0 if no more events left in the scheduler; otherwise number of popped and finalised events + * @brief Retrieves finished events from the scheduler, processes their output and cleans up the slots + * @return SUCCESS if at least one event was finished, SCHEDULER_EMPTY if there are no events being processed, + * RECOVERABLE if there was an error which was handled correctly, FAILURE if the error should break the event loop **/ -int HltEventLoopMgr::drainScheduler() +HltEventLoopMgr::DrainSchedulerStatusCode HltEventLoopMgr::drainScheduler() { ATH_MSG_VERBOSE("start of " << __FUNCTION__); @@ -1061,7 +1280,7 @@ int HltEventLoopMgr::drainScheduler() else { // Failure means there are no more events left in the scheduler ATH_MSG_DEBUG("Scheduler empty"); - return 0; + return DrainSchedulerStatusCode::SCHEDULER_EMPTY; } // Try to pop other events @@ -1074,7 +1293,7 @@ int HltEventLoopMgr::drainScheduler() // Post-process the finished events //---------------------------------------------------------------------------- bool atLeastOneFailed = false; - for (auto& thisFinishedEvtContext : finishedEvtContexts) { + for (EventContext* thisFinishedEvtContext : finishedEvtContexts) { StatusCode sc = StatusCode::SUCCESS; auto markFailed = [&sc,&atLeastOneFailed](){sc = StatusCode::FAILURE; atLeastOneFailed = true;}; @@ -1083,29 +1302,23 @@ int HltEventLoopMgr::drainScheduler() //-------------------------------------------------------------------------- // Check if the EventContext object exists if (!thisFinishedEvtContext) markFailed(); - HLT_EVTLOOP_CHECK(sc, "Detected nullptr EventContext while finalising a processed event", EventContext()); + HLT_DRAINSCHED_CHECK(sc, "Detected nullptr EventContext while finalising a processed event", + hltonl::PSCErrorCode::CANNOT_ACCESS_SLOT, EventContext()); // Set ThreadLocalContext to the currently processed finished context Gaudi::Hive::setCurrentContext(thisFinishedEvtContext); // Check the event processing status if (m_aess->eventStatus(*thisFinishedEvtContext) != EventStatus::Success) markFailed(); - HLT_EVTLOOP_CHECK(sc, - "Processing event with context " << *thisFinishedEvtContext << " failed with status " - << m_aess->eventStatus(*thisFinishedEvtContext), - *thisFinishedEvtContext); + HLT_DRAINSCHED_CHECK(sc, "Processing event with context " << *thisFinishedEvtContext + << " failed with status " << m_aess->eventStatus(*thisFinishedEvtContext), + hltonl::PSCErrorCode::PROCESSING_FAILURE, *thisFinishedEvtContext); // Select the whiteboard slot sc = m_whiteboard->selectStore(thisFinishedEvtContext->slot()); if (sc.isFailure()) atLeastOneFailed = true; - HLT_EVTLOOP_CHECK(sc, - "Failed to select event store slot " << thisFinishedEvtContext->slot(), - *thisFinishedEvtContext); - - // Retrieve EventInfo - auto eventInfo = SG::makeHandle(m_eventInfoRHKey); - if (!eventInfo.isValid()) markFailed(); - HLT_EVTLOOP_CHECK(sc, "Failed to retrieve EventInfo", *thisFinishedEvtContext); + HLT_DRAINSCHED_CHECK(sc, "Failed to select event store slot " << thisFinishedEvtContext->slot(), + hltonl::PSCErrorCode::CANNOT_ACCESS_SLOT, *thisFinishedEvtContext); // Fire EndProcessing incident - some services may depend on this m_incidentSvc->fireIncident(Incident(name(), IncidentType::EndProcessing, *thisFinishedEvtContext)); @@ -1116,34 +1329,38 @@ int HltEventLoopMgr::drainScheduler() // Call the result builder to record HLTResultMT in SG sc = m_hltResultBuilder->buildResult(*thisFinishedEvtContext); if (sc.isFailure()) atLeastOneFailed = true; - HLT_EVTLOOP_CHECK(sc, "Failed to create the HLT result object", *thisFinishedEvtContext, eventInfo.ptr()); + HLT_DRAINSCHED_CHECK(sc, "Failed to create the HLT result object", + hltonl::PSCErrorCode::NO_HLT_RESULT, *thisFinishedEvtContext); // Connect output (create the output container) - the argument is currently not used sc = m_outputCnvSvc->connectOutput(""); if (sc.isFailure()) atLeastOneFailed = true; - HLT_EVTLOOP_CHECK(sc, "Conversion service failed to connectOutput", *thisFinishedEvtContext, eventInfo.ptr()); + HLT_DRAINSCHED_CHECK(sc, "Conversion service failed to connectOutput", + hltonl::PSCErrorCode::OUTPUT_BUILD_FAILURE, *thisFinishedEvtContext); // Retrieve the HLT result and the corresponding DataObject - auto hltResult = SG::makeHandle(m_hltResultRHKey); + auto hltResult = SG::makeHandle(m_hltResultRHKey,*thisFinishedEvtContext); if (!hltResult.isValid()) markFailed(); - HLT_EVTLOOP_CHECK(sc, "Failed to retrieve the HLT result", *thisFinishedEvtContext, eventInfo.ptr()); + HLT_DRAINSCHED_CHECK(sc, "Failed to retrieve the HLT result", + hltonl::PSCErrorCode::NO_HLT_RESULT, *thisFinishedEvtContext); DataObject* hltResultDO = m_evtStore->accessData(hltResult.clid(),hltResult.key()); if (!hltResultDO) markFailed(); - HLT_EVTLOOP_CHECK(sc, "Failed to retrieve the HLTResult DataObject", - *thisFinishedEvtContext, eventInfo.ptr(), hltResult.ptr()); + HLT_DRAINSCHED_CHECK(sc, "Failed to retrieve the HLTResult DataObject", + hltonl::PSCErrorCode::NO_HLT_RESULT, *thisFinishedEvtContext); // Convert the HLT result to the output data format IOpaqueAddress* addr = nullptr; sc = m_outputCnvSvc->createRep(hltResultDO,addr); if (sc.isFailure()) atLeastOneFailed = true; - HLT_EVTLOOP_CHECK(sc, "Conversion service failed to convert HLTResult", - *thisFinishedEvtContext, eventInfo.ptr(), hltResult.ptr()); + HLT_DRAINSCHED_CHECK(sc, "Conversion service failed to convert HLTResult", + hltonl::PSCErrorCode::OUTPUT_BUILD_FAILURE, *thisFinishedEvtContext); // Commit output (write/send the output data) - the arguments are currently not used sc = m_outputCnvSvc->commitOutput("",true); - HLT_EVTLOOP_CHECK(sc, "Conversion service failed to commitOutput", - *thisFinishedEvtContext, eventInfo.ptr(), hltResult.ptr()); + if (sc.isFailure()) atLeastOneFailed = true; + HLT_DRAINSCHED_CHECK(sc, "Conversion service failed to commitOutput", + hltonl::PSCErrorCode::OUTPUT_SEND_FAILURE, *thisFinishedEvtContext); //-------------------------------------------------------------------------- // Flag idle slot to the timeout thread and reset the timer @@ -1161,32 +1378,96 @@ int HltEventLoopMgr::drainScheduler() //-------------------------------------------------------------------------- ATH_MSG_DEBUG("Clearing slot " << thisFinishedEvtContext->slot() << " (event " << thisFinishedEvtContext->evt() << ") of the whiteboard"); - // Not using HLT_EVTLOOP_CHECK here because the output was successfully created and committed, - // so we should not call failedEvent anymore - if (clearWBSlot(thisFinishedEvtContext->slot()).isFailure()) { - atLeastOneFailed = true; - ATH_MSG_ERROR(ST_WHERE << "Whiteboard slot " << thisFinishedEvtContext->slot() - << " could not be properly cleared"); - } - ATH_MSG_DEBUG("Finished processing event with context " << thisFinishedEvtContext); + HLT_DRAINSCHED_CHECK(clearWBSlot(thisFinishedEvtContext->slot()), + "Whiteboard slot " << thisFinishedEvtContext->slot() << " could not be properly cleared", + hltonl::PSCErrorCode::AFTER_RESULT_SENT, EventContext()); + + // Cannot print out EventContext anymore here because it was managed by event store and deleted in clearWBSlot + ATH_MSG_DEBUG("Finished processing event"); // Set ThreadLocalContext to an invalid context as we entering a context-less environment Gaudi::Hive::setCurrentContext( EventContext() ); } + // Set ThreadLocalContext to an invalid context again in case of failure breaking the loop above + if (atLeastOneFailed) Gaudi::Hive::setCurrentContext( EventContext() ); + ATH_MSG_VERBOSE("end of " << __FUNCTION__); - return ( atLeastOneFailed ? -1 : finishedEvtContexts.size() ); + return ( atLeastOneFailed ? DrainSchedulerStatusCode::RECOVERABLE : DrainSchedulerStatusCode::SUCCESS ); } -// ============================================================================== +// ============================================================================= StatusCode HltEventLoopMgr::clearWBSlot(size_t evtSlot) const { ATH_MSG_VERBOSE("start of " << __FUNCTION__); StatusCode sc = m_whiteboard->clearStore(evtSlot); if( !sc.isSuccess() ) { - ATH_MSG_WARNING(ST_WHERE << "Clear of event data store failed"); + ATH_REPORT_MESSAGE(MSG::WARNING) << "Clear of event data store failed"; } ATH_MSG_VERBOSE("end of " << __FUNCTION__ << ", returning m_whiteboard->freeStore(evtSlot=" << evtSlot << ")"); return m_whiteboard->freeStore(evtSlot); } + +// ============================================================================= +StatusCode HltEventLoopMgr::recoverFromStarvation() +{ + auto freeSlotsScheduler = m_schedulerSvc->freeSlots(); + auto freeSlotsWhiteboard = m_whiteboard->freeSlots(); + if (freeSlotsScheduler == freeSlotsWhiteboard) { + ATH_REPORT_MESSAGE(MSG::WARNING) + << "Starvation recovery was requested but not needed, so it was not attempted. " + << "This method should not have been called."; + return StatusCode::SUCCESS; + } + + if (drainAllSlots().isFailure()) { + ATH_REPORT_MESSAGE(MSG::ERROR) + << "Starvation recovery failed. Scheduler saw " << freeSlotsScheduler << " free slots, whereas whiteboard saw " + << freeSlotsWhiteboard << " free slots. Total number of slots is " << m_isSlotProcessing.size() + << ". Now scheduler sees " << m_schedulerSvc->freeSlots() << " free slots, whereas whiteboard sees " + << m_whiteboard->freeSlots() << " free slots"; + return StatusCode::FAILURE; + } + else { + ATH_REPORT_MESSAGE(MSG::WARNING) + << "Starvation detected, but successfully recovered. Scheduler saw " << freeSlotsScheduler << " free slots" + << ", whereas whiteboard saw " << freeSlotsWhiteboard << " free slots. All slots have been cleared, " + << " now scheduler sees " << m_schedulerSvc->freeSlots() << " free slots and whiteboard sees " + << m_whiteboard->freeSlots() << " free slots"; + return StatusCode::SUCCESS; + } +} + +// ============================================================================= +StatusCode HltEventLoopMgr::drainAllSlots() +{ + size_t nslots = m_isSlotProcessing.size(); // size is fixed in hltUpdateAfterFork after configuring scheduler + + // First try to drain the scheduler to free all processing slots + DrainSchedulerStatusCode drainResult = DrainSchedulerStatusCode::SUCCESS; + do { + drainResult = drainScheduler(); + // fail on recoverable, because it means an error while handling an error + // (drainAllSlots is a "clean up on failure" method) + if (drainResult == DrainSchedulerStatusCode::FAILURE || drainResult == DrainSchedulerStatusCode::RECOVERABLE) { + ATH_REPORT_MESSAGE(MSG::ERROR) << "Failed to drain the scheduler"; + return StatusCode::FAILURE; + } + } while (drainResult != DrainSchedulerStatusCode::SCHEDULER_EMPTY); // while there were still events to finish + + // Now try to clear all event data slots (should have no effect if done already) + for (size_t islot=0; islot<nslots; ++islot) { + if (clearWBSlot(islot).isFailure()) { + ATH_REPORT_MESSAGE(MSG::ERROR) << "Failed to clear whiteboard slot " << islot; + return StatusCode::FAILURE; + } + } + + // Check if the cleanup succeeded + if (m_schedulerSvc->freeSlots() == nslots && m_whiteboard->freeSlots() == nslots) { + return StatusCode::SUCCESS; + } + + return StatusCode::FAILURE; +} diff --git a/InnerDetector/InDetDigitization/TRT_Digitization/src/TRTProcessingOfStraw.cxx b/InnerDetector/InDetDigitization/TRT_Digitization/src/TRTProcessingOfStraw.cxx index cb6eeaa4243c7a31dc2ad0572e3b0494196f2345..cb60224e2fd77c3d7920b4da3fb7b1e42f8266d8 100644 --- a/InnerDetector/InDetDigitization/TRT_Digitization/src/TRTProcessingOfStraw.cxx +++ b/InnerDetector/InDetDigitization/TRT_Digitization/src/TRTProcessingOfStraw.cxx @@ -365,9 +365,11 @@ void TRTProcessingOfStraw::ProcessStraw ( hitCollConstIter i, if ( energyDeposit<30.0 ) { - double ArEmulationScaling_BA = 0.15; - double ArEmulationScaling_ECA = 0.28; - double ArEmulationScaling_ECB = 0.28; + // Improved Argon Emulation tuning October 2018 by Hassane Hamdaoui https://cds.cern.ch/record/2643784 + // Previously 0.15, 0.28, 0.28 + double ArEmulationScaling_BA = 0.05; + double ArEmulationScaling_ECA = 0.20; + double ArEmulationScaling_ECB = 0.20; // ROUGH GUESSES RIGHT NOW double KrEmulationScaling_BA = 0.20; diff --git a/InnerDetector/InDetExample/InDetAlignExample/ErrorScaling/InDetMonitoringAlignment.py b/InnerDetector/InDetExample/InDetAlignExample/ErrorScaling/InDetMonitoringAlignment.py index ee5428b469a4cae6b84a25db030eab2ec5989ca7..1a43536a99b3a0a86011e122354ab112a2ccc4f7 100755 --- a/InnerDetector/InDetExample/InDetAlignExample/ErrorScaling/InDetMonitoringAlignment.py +++ b/InnerDetector/InDetExample/InDetAlignExample/ErrorScaling/InDetMonitoringAlignment.py @@ -65,8 +65,8 @@ if not jobproperties.Beam.beamType()=='cosmics': #Adding the tools to the Tool Service - ToolSvc += m_alignMonTrackSelectorTool[0] - ToolSvc += m_alignMonTrackSelectorTool[1] + #ToolSvc += m_alignMonTrackSelectorTool[0] + #ToolSvc += m_alignMonTrackSelectorTool[1] #Here we start creating the custom Track Selection tools. @@ -83,8 +83,8 @@ if not jobproperties.Beam.beamType()=='cosmics': #Adding the TrackSelectionTools to the Tool Service - ToolSvc += m_alignMonTrackSelectionTool[0] - ToolSvc += m_alignMonTrackSelectionTool[1] + #ToolSvc += m_alignMonTrackSelectionTool[0] + #ToolSvc += m_alignMonTrackSelectionTool[1] #if (InDetFlags.doPrintConfigurables()): print m_alignMonTrackSelectionTool[0] @@ -100,7 +100,7 @@ if not jobproperties.Beam.beamType()=='cosmics': InDetAlignMonSivsTRT_noTrig = IDAlignMonSivsTRT (name = "InDetAlignMonSivsTRT_noTrig", trackSelection = m_alignMonTrackSelectionTool[0]) - ToolSvc += InDetAlignMonSivsTRT_noTrig + #ToolSvc += InDetAlignMonSivsTRT_noTrig if (InDetFlags.doPrintConfigurables()): print InDetAlignMonSivsTRT_noTrig @@ -111,7 +111,7 @@ if not jobproperties.Beam.beamType()=='cosmics': vxContainerName = InDetKeys.PrimaryVertices(), vxContainerWithBeamConstraint = InDetFlags.useBeamConstraint()) - ToolSvc += InDetAlignMonBeamSpot_noTrig + #ToolSvc += InDetAlignMonBeamSpot_noTrig if (InDetFlags.doPrintConfigurables()): print InDetAlignMonBeamSpot_noTrig @@ -159,7 +159,7 @@ else: CutLevel = "LoosePrimary", TrackSummaryTool = InDetTrackSummaryTool, Extrapolator = InDetExtrapolator)) - ToolSvc += m_alignMonTrackSelectorTool[i] + #ToolSvc += m_alignMonTrackSelectorTool[i] if (InDetFlags.doPrintConfigurables()): print m_alignMonTrackSelectorTool[i] @@ -176,7 +176,7 @@ else: if jobproperties.Beam.beamType()=='singlebeam': m_alignMonTrackSelectionTool[i].PassAllTracks = True - ToolSvc += m_alignMonTrackSelectionTool[i] + #ToolSvc += m_alignMonTrackSelectionTool[i] if (InDetFlags.doPrintConfigurables()): print m_alignMonTrackSelectionTool[i] @@ -200,7 +200,7 @@ else: if InDetAlignMonReadESD and InDetFlags.doRefit: #use refitted tracks if reading ESD InDetAlignMonResiduals_noTrig.tracksName = InDetKeys.RefittedTracks() -ToolSvc += InDetAlignMonResiduals_noTrig +#ToolSvc += InDetAlignMonResiduals_noTrig if (InDetFlags.doPrintConfigurables()): print InDetAlignMonResiduals_noTrig @@ -222,7 +222,7 @@ else: if InDetAlignMonReadESD and InDetFlags.doRefit:#use refitted tracks if reading ESD InDetAlignMonEfficiencies_noTrig.tracksName = InDetKeys.RefittedTracks() -ToolSvc += InDetAlignMonEfficiencies_noTrig +#ToolSvc += InDetAlignMonEfficiencies_noTrig if (InDetFlags.doPrintConfigurables()): print InDetAlignMonEfficiencies_noTrig @@ -242,7 +242,7 @@ else: if InDetAlignMonReadESD and InDetFlags.doRefit: #use refitted tracks if reading ESD InDetAlignMonGenericTracks_noTrig.tracksName = InDetKeys.RefittedTracks() -ToolSvc += InDetAlignMonGenericTracks_noTrig +#ToolSvc += InDetAlignMonGenericTracks_noTrig if (InDetFlags.doPrintConfigurables()): print InDetAlignMonGenericTracks_noTrig @@ -282,7 +282,7 @@ if jobproperties.Beam.beamType()=='cosmics': OutputUpperTracksName = m_upperTracksName[i], OutputLowerTracksName = m_lowerTracksName[i])) - ToolSvc += m_trackSplitter[i] + #ToolSvc += m_trackSplitter[i] if (InDetFlags.doPrintConfigurables()): print m_trackSplitter[i] @@ -303,7 +303,7 @@ if jobproperties.Beam.beamType()=='cosmics': DeltaQoverPtRange2D = m_deltaQoverPt2D[i], D0Range = m_d0Range[i])) - ToolSvc += m_trackSegmentsUpLow[i] + #ToolSvc += m_trackSegmentsUpLow[i] if (InDetFlags.doPrintConfigurables()): print m_trackSegmentsUpLow[i] @@ -341,7 +341,7 @@ if jobproperties.Beam.beamType()=='cosmics': DeltaQoverPtRange2D = m_deltaQoverPt2D_Sub[i], D0Range = m_d0Range_Sub[i])) - ToolSvc += m_trackSegments_Sub[i] + #ToolSvc += m_trackSegments_Sub[i] if (InDetFlags.doPrintConfigurables()): print m_trackSegments_Sub[i] @@ -382,11 +382,11 @@ else: vxContainerWithBeamConstraint = InDetFlags.useBeamConstraint()) if jobproperties.Beam.beamType()=='collisions' and hasattr(ToolSvc, 'DQFilledBunchFilterTool'): - InDetAlignMonSivsTRT.FilterTools.append(monFilledBunchFilterTool) - InDetAlignMonResiduals.FilterTools.append(monFilledBunchFilterTool) - InDetAlignMonEfficiencies.FilterTools.append(monFilledBunchFilterTool) - InDetAlignMonGenericTracks.FilterTools.append(monFilledBunchFilterTool) - InDetAlignMonBeamSpot.FilterTools.append(monFilledBunchFilterTool) + InDetAlignMonSivsTRT.FilterTools += [monFilledBunchFilterTool] + InDetAlignMonResiduals.FilterTools += [monFilledBunchFilterTool] + InDetAlignMonEfficiencies.FilterTools += [monFilledBunchFilterTool] + InDetAlignMonGenericTracks.FilterTools += [monFilledBunchFilterTool] + InDetAlignMonBeamSpot.FilterTools += [monFilledBunchFilterTool] InDetAlignMonSivsTRT.TrigDecisionTool = monTrigDecTool InDetAlignMonResiduals.TrigDecisionTool = monTrigDecTool @@ -406,19 +406,19 @@ else: InDetAlignMonGenericTracks.triggerChainName = "Jet_MinBias_Trigger" InDetAlignMonBeamSpot.histFolder = "IDAlignMon/BeamSpot/Jet_MinBias_Trigger" - ToolSvc += InDetAlignMonResiduals + #ToolSvc += InDetAlignMonResiduals if (InDetFlags.doPrintConfigurables()): print InDetAlignMonResiduals - ToolSvc += InDetAlignMonEfficiencies + #ToolSvc += InDetAlignMonEfficiencies if (InDetFlags.doPrintConfigurables()): print InDetAlignMonEfficiencies - ToolSvc += InDetAlignMonGenericTracks + #ToolSvc += InDetAlignMonGenericTracks if (InDetFlags.doPrintConfigurables()): print InDetAlignMonGenericTracks - ToolSvc += InDetAlignMonBeamSpot + #ToolSvc += InDetAlignMonBeamSpot if (InDetFlags.doPrintConfigurables()): print InDetAlignMonBeamSpot - ToolSvc += InDetAlignMonSivsTRT + #ToolSvc += InDetAlignMonSivsTRT if (InDetFlags.doPrintConfigurables()): print InDetAlignMonSivsTRT @@ -452,11 +452,11 @@ InDetAlignMonManager.AthenaMonTools += [ InDetAlignMonEfficiencies_noTri InDetAlignMonManager.AthenaMonTools += [ InDetAlignMonGenericTracks_noTrig ] if jobproperties.Beam.beamType()=='collisions' and hasattr(ToolSvc, 'DQFilledBunchFilterTool'): - InDetAlignMonSivsTRT_noTrig.FilterTools.append(monFilledBunchFilterTool) - InDetAlignMonResiduals_noTrig.FilterTools.append(monFilledBunchFilterTool) - InDetAlignMonEfficiencies_noTrig.FilterTools.append(monFilledBunchFilterTool) - InDetAlignMonGenericTracks_noTrig.FilterTools.append(monFilledBunchFilterTool) - InDetAlignMonBeamSpot_noTrig.FilterTools.append(monFilledBunchFilterTool) + InDetAlignMonSivsTRT_noTrig.FilterTools += [monFilledBunchFilterTool] + InDetAlignMonResiduals_noTrig.FilterTools += [monFilledBunchFilterTool] + InDetAlignMonEfficiencies_noTrig.FilterTools += [monFilledBunchFilterTool] + InDetAlignMonGenericTracks_noTrig.FilterTools += [monFilledBunchFilterTool] + InDetAlignMonBeamSpot_noTrig.FilterTools += [monFilledBunchFilterTool] if InDetAlignMonDoTruth: diff --git a/InnerDetector/InDetExample/InDetAlignExample/share/GenericTracks.py b/InnerDetector/InDetExample/InDetAlignExample/share/GenericTracks.py index 0716c1e49c1c0b3de8314a1a813f0c225155a9c7..e166be906dffc8338fd7b85ebb8f9c235c8e93ad 100644 --- a/InnerDetector/InDetExample/InDetAlignExample/share/GenericTracks.py +++ b/InnerDetector/InDetExample/InDetAlignExample/share/GenericTracks.py @@ -37,8 +37,8 @@ m_TrackSelectorTool_LoosePrimary = InDet__InDetTrackSelectionTool(name = CutLevel = "LoosePrimary", TrackSummaryTool = InDetTrackSummaryTool, Extrapolator = InDetExtrapolator) -ToolSvc += m_allSelection -ToolSvc += m_TrackSelectorTool_LoosePrimary +#ToolSvc += m_allSelection +#ToolSvc += m_TrackSelectorTool_LoosePrimary #m_TrackSelectorTool_AlignTracks = InDet__InDetTrackSelectionTool(name = "InDetTrackSelectorAlignTracks", @@ -80,7 +80,7 @@ LPSelection = InDetAlignMon__TrackSelectionTool( PrimVtxContainerName = InDetKeys.xAODVertexContainer(), UseIDTrackSelectionTool = True, IDTrackSelectionTool = m_TrackSelectorTool_LoosePrimary) -ToolSvc += LPSelection +#ToolSvc += LPSelection #AlignSelection = InDetAlignMon__TrackSelectionTool( @@ -99,7 +99,7 @@ if newInDetAlignAlg_Options["useTrackSelector"]: #PassAllTracks = True, ## Uncomment this line to bypass track slection IDTrackSelectionTool = trackSelectorNew) - ToolSvc += alignTrackSelection + #ToolSvc += alignTrackSelection from InDetAlignmentMonitoring.InDetAlignmentMonitoringConf import IDAlignMonGenericTracks @@ -132,7 +132,7 @@ InDetAlignMonResiduals = IDAlignMonResiduals( ) print InDetAlignMonResiduals -ToolSvc += InDetAlignMonResiduals +#ToolSvc += InDetAlignMonResiduals InDetAlignMonManager.AthenaMonTools += [ InDetAlignMonResiduals ] InDetAlignMonGenericTracks = IDAlignMonGenericTracks( @@ -146,7 +146,7 @@ InDetAlignMonGenericTracks = IDAlignMonGenericTracks( #NTracksRange = 10, VxPrimContainerName = InDetKeys.xAODVertexContainer() ) -ToolSvc += InDetAlignMonGenericTracks +#ToolSvc += InDetAlignMonGenericTracks InDetAlignMonManager.AthenaMonTools += [ InDetAlignMonGenericTracks ] if Cosmics: InDetAlignMonGenericTracks.d0Range = 500 @@ -164,7 +164,7 @@ InDetAlignMonSelectedTracksEfficiencies = IDAlignMonEfficiencies ( TRT_Manager = InDetKeys.TRT_Manager() ) -ToolSvc += InDetAlignMonSelectedTracksEfficiencies +#ToolSvc += InDetAlignMonSelectedTracksEfficiencies InDetAlignMonManager.AthenaMonTools += [ InDetAlignMonSelectedTracksEfficiencies ] @@ -194,7 +194,7 @@ InDetAlignMonResiduals = IDAlignMonResiduals( ) print InDetAlignMonResiduals -ToolSvc += InDetAlignMonResiduals +#ToolSvc += InDetAlignMonResiduals InDetAlignMonManager.AthenaMonTools += [ InDetAlignMonResiduals ] InDetAlignMonGenericTracks = IDAlignMonGenericTracks( @@ -208,7 +208,7 @@ InDetAlignMonGenericTracks = IDAlignMonGenericTracks( #NTracksRange = 10, VxPrimContainerName = InDetKeys.xAODVertexContainer() ) -ToolSvc += InDetAlignMonGenericTracks +#ToolSvc += InDetAlignMonGenericTracks InDetAlignMonManager.AthenaMonTools += [ InDetAlignMonGenericTracks ] if Cosmics: InDetAlignMonGenericTracks.d0Range = 500 @@ -226,7 +226,7 @@ InDetAlignMonSelectedTracksEfficiencies = IDAlignMonEfficiencies ( TRT_Manager = InDetKeys.TRT_Manager() ) -ToolSvc += InDetAlignMonSelectedTracksEfficiencies +#ToolSvc += InDetAlignMonSelectedTracksEfficiencies InDetAlignMonManager.AthenaMonTools += [ InDetAlignMonSelectedTracksEfficiencies ] @@ -256,7 +256,7 @@ InDetAlignMonResiduals = IDAlignMonResiduals( ) print InDetAlignMonResiduals -ToolSvc += InDetAlignMonResiduals +#ToolSvc += InDetAlignMonResiduals InDetAlignMonManager.AthenaMonTools += [ InDetAlignMonResiduals ] InDetAlignMonGenericTracks = IDAlignMonGenericTracks( @@ -270,7 +270,7 @@ InDetAlignMonGenericTracks = IDAlignMonGenericTracks( #NTracksRange = 10, VxPrimContainerName = InDetKeys.xAODVertexContainer() ) -ToolSvc += InDetAlignMonGenericTracks +#ToolSvc += InDetAlignMonGenericTracks InDetAlignMonManager.AthenaMonTools += [ InDetAlignMonGenericTracks ] if Cosmics: InDetAlignMonGenericTracks.d0Range = 500 @@ -288,7 +288,7 @@ InDetAlignMonSelectedTracksEfficiencies = IDAlignMonEfficiencies ( TRT_Manager = InDetKeys.TRT_Manager() ) -ToolSvc += InDetAlignMonSelectedTracksEfficiencies +#ToolSvc += InDetAlignMonSelectedTracksEfficiencies InDetAlignMonManager.AthenaMonTools += [ InDetAlignMonSelectedTracksEfficiencies ] #TriggerChainName is only the name passed to the monitoring folder @@ -299,7 +299,7 @@ if not Cosmics: extrapolator = InDetExtrapolator, vxContainerName = InDetKeys.PrimaryVertices(), vxContainerWithBeamConstraint = InDetFlags.useBeamConstraint()) - ToolSvc += InDetAlignMonBeamSpot_noTrig + #ToolSvc += InDetAlignMonBeamSpot_noTrig InDetAlignMonManager.AthenaMonTools += [ InDetAlignMonBeamSpot_noTrig ] ############################################### @@ -316,7 +316,7 @@ if Cosmics: OutputUpperTracksName = "TracksUpperSplit", OutputLowerTracksName = "TracksLowerSplit", OutputLevel = INFO) - ToolSvc += splittertoolcomb + #ToolSvc += splittertoolcomb print splittertoolcomb # tool to convert to xAOD::TrackParticles @@ -327,7 +327,7 @@ if Cosmics: ForceTrackSummaryUpdate = False, KeepParameters = True, OutputLevel = DEBUG) - ToolSvc += InDetxAODSplitParticleCreatorTool + #ToolSvc += InDetxAODSplitParticleCreatorTool #----- tools for track splliting ---- COMPLETED ---- # @@ -363,7 +363,7 @@ if Cosmics: nSharedSct = 0, TrackSummaryTool = InDetTrackSummaryTool, Extrapolator = InDetExtrapolator)) - ToolSvc += m_alignMonTrackSelectorTool[i] + #ToolSvc += m_alignMonTrackSelectorTool[i] if (InDetFlags.doPrintConfigurables()): print m_alignMonTrackSelectorTool[i] @@ -374,7 +374,7 @@ if Cosmics: #DoEventPhaseCut = True, TrackSelectorTool = m_alignMonTrackSelectorTool[i])) - ToolSvc += m_alignMonTrackSelectionTool[i] + #ToolSvc += m_alignMonTrackSelectionTool[i] if (InDetFlags.doPrintConfigurables()): print " <NewInDetAlignMonitoring> ** SELECTION ** m_alignMonTrackSelectionTool[",i,"] =", m_alignMonTrackSelectionToolName[i] print m_alignMonTrackSelectionTool[i] @@ -408,7 +408,7 @@ if Cosmics: OutputUpperTracksName = m_upperTracksName[i], OutputLowerTracksName = m_lowerTracksName[i], OutputLevel = INFO)) - ToolSvc += m_trackSplitter[i] # add the track splitter to the ToolSvc + #ToolSvc += m_trackSplitter[i] # add the track splitter to the ToolSvc if (InDetFlags.doPrintConfigurables()): print m_trackSplitter[i] print " " print " **** WARNING **** " @@ -440,7 +440,7 @@ if Cosmics: D0Range = m_d0Range[i], OutputLevel = WARNING)) - ToolSvc += m_trackSegmentsUpLow[i] + #ToolSvc += m_trackSegmentsUpLow[i] InDetAlignMonManager.AthenaMonTools += [ m_trackSegmentsUpLow[i] ] print " <NewInDetAlignMonitoring> step ",i, m_trackSegmentsUpLowName[i]," added to the ToolSvc" @@ -526,7 +526,7 @@ if Cosmics: RangeOfPullHistos = 5.00, OutputLevel = WARNING ) - ToolSvc += InDetAlignMonResiduals + #ToolSvc += InDetAlignMonResiduals InDetAlignMonManager.AthenaMonTools += [ InDetAlignMonResiduals ] InDetAlignMonGenericTracks = IDAlignMonGenericTracks( @@ -539,7 +539,7 @@ if Cosmics: z0Range = 1000, VxPrimContainerName = InDetKeys.xAODVertexContainer() ) - ToolSvc += InDetAlignMonGenericTracks + #ToolSvc += InDetAlignMonGenericTracks InDetAlignMonManager.AthenaMonTools += [ InDetAlignMonGenericTracks ] InDetAlignMonSelectedTracksEfficiencies = IDAlignMonEfficiencies ( @@ -553,7 +553,7 @@ if Cosmics: SCT_Manager = InDetKeys.SCT_Manager(), TRT_Manager = InDetKeys.TRT_Manager() ) - ToolSvc += InDetAlignMonSelectedTracksEfficiencies + #ToolSvc += InDetAlignMonSelectedTracksEfficiencies InDetAlignMonManager.AthenaMonTools += [ InDetAlignMonSelectedTracksEfficiencies ] diff --git a/InnerDetector/InDetExample/InDetAlignExample/share/InDetMonitoringAlignment_TRTAlignTracks.py b/InnerDetector/InDetExample/InDetAlignExample/share/InDetMonitoringAlignment_TRTAlignTracks.py index 8fcb4c46ed419b5ac68b1ac4dcf9e02d5bde0d2a..533fb0018bce2c88f61ab48dbafb0015eb133455 100644 --- a/InnerDetector/InDetExample/InDetAlignExample/share/InDetMonitoringAlignment_TRTAlignTracks.py +++ b/InnerDetector/InDetExample/InDetAlignExample/share/InDetMonitoringAlignment_TRTAlignTracks.py @@ -9,7 +9,7 @@ InDetAlignMonResidualsTRTAlign = IDAlignMonResiduals (name = 'InDetAlignMonResid trackSelection = InDetAlignMonTrackSelectionTool, TRT_Manager = InDetKeys.TRT_Manager()) -ToolSvc += InDetAlignMonResidualsTRTAlign +#ToolSvc += InDetAlignMonResidualsTRTAlign if (InDetFlags.doPrintConfigurables()): print InDetAlignMonResidualsTRTAlign @@ -22,7 +22,7 @@ InDetAlignMonEfficienciesTRTAlign = IDAlignMonEfficiencies (name = 'InDetAlignMo OutputLevel = ERROR, TRT_Manager = InDetKeys.TRT_Manager()) -ToolSvc += InDetAlignMonEfficienciesTRTAlign +#ToolSvc += InDetAlignMonEfficienciesTRTAlign if (InDetFlags.doPrintConfigurables()): print InDetAlignMonEfficienciesTRTAlign @@ -31,7 +31,7 @@ InDetAlignMonGenericTracksTRTAlign = IDAlignMonGenericTracks (name = 'InDetAlign trackSelection = InDetAlignMonTrackSelectionTool, VxPrimContainerName = InDetKeys.PrimaryVertices()) -ToolSvc += InDetAlignMonGenericTracksTRTAlign +#ToolSvc += InDetAlignMonGenericTracksTRTAlign if (InDetFlags.doPrintConfigurables()): print InDetAlignMonGenericTracksTRTAlign @@ -41,7 +41,7 @@ InDetTrackSplitterToolTRTAlign = InDet__InDetTrackSplitterTool(name = 'TrackSpli OutputLowerTracksName = 'TRTAlign_Lower', OutputLevel = ERROR) -ToolSvc += InDetTrackSplitterToolTRTAlign +#ToolSvc += InDetTrackSplitterToolTRTAlign if (InDetFlags.doPrintConfigurables()): print InDetTrackSplitterToolTRTAlign @@ -59,7 +59,7 @@ InDetAlignMonTrackSegmentsTRTAlign = IDAlignMonTrackSegments ( name = 'InDetAlig DeltaPhiRange2D = 0.05, OutputLevel = ERROR, D0Range = 800 ) -ToolSvc += InDetAlignMonTrackSegmentsTRTAlign +#ToolSvc += InDetAlignMonTrackSegmentsTRTAlign if (InDetFlags.doPrintConfigurables()): print InDetAlignMonTrackSegmentsTRTAlign diff --git a/InnerDetector/InDetExample/InDetAlignExample/share/NewInDetAlignMonitoring.py b/InnerDetector/InDetExample/InDetAlignExample/share/NewInDetAlignMonitoring.py index d0a82bfdcb49789dc1f9bd3000efb9c6b232560f..4fb06e79ac65113d58a8e9b156916614e1454b2f 100644 --- a/InnerDetector/InDetExample/InDetAlignExample/share/NewInDetAlignMonitoring.py +++ b/InnerDetector/InDetExample/InDetAlignExample/share/NewInDetAlignMonitoring.py @@ -61,7 +61,7 @@ InDetDetailedTrackSelector_Default = InDet__InDetDetailedTrackSelectorTool(name TrackSummaryTool = InDetTrackSummaryTool, Extrapolator = InDetExtrapolator) -ToolSvc += InDetDetailedTrackSelector_Default +#ToolSvc += InDetDetailedTrackSelector_Default # All tracks selection @@ -93,7 +93,7 @@ m_TrackSelectorTool_LoosePrimary = InDet__InDetTrackSelectionTool(name = -ToolSvc += m_TrackSelectorTool_LoosePrimary +#ToolSvc += m_TrackSelectorTool_LoosePrimary LPSelection = InDetAlignMon__TrackSelectionTool( @@ -105,8 +105,8 @@ LPSelection = InDetAlignMon__TrackSelectionTool( ) -ToolSvc += allSelection -ToolSvc += LPSelection +#ToolSvc += allSelection +#ToolSvc += LPSelection #Track selector: Defined in NewInDetAlignAlgSetup #trackSelector = The cuts are: @@ -135,7 +135,7 @@ if newInDetAlignAlg_Options["useTrackSelector"]: IDTrackSelectionTool = trackSelectorNew, UseIDTrackSelectionTool = True ) - ToolSvc += alignTrackSelection + #ToolSvc += alignTrackSelection from InDetAlignmentMonitoring.InDetAlignmentMonitoringConf import IDAlignMonResiduals @@ -170,7 +170,7 @@ for trackCollection in trackCollections: ) print InDetAlignMonResiduals - ToolSvc += InDetAlignMonResiduals + #ToolSvc += InDetAlignMonResiduals InDetAlignMonManager.AthenaMonTools += [ InDetAlignMonResiduals ] InDetAlignMonGenericTracks = IDAlignMonGenericTracks( @@ -190,7 +190,7 @@ for trackCollection in trackCollections: InDetAlignMonGenericTracks.d0Range = 500 InDetAlignMonGenericTracks.z0Range = 1000 - ToolSvc += InDetAlignMonGenericTracks + #ToolSvc += InDetAlignMonGenericTracks InDetAlignMonManager.AthenaMonTools += [ InDetAlignMonGenericTracks ] InDetAlignMonSelectedTracksEfficiencies = IDAlignMonEfficiencies ( @@ -205,7 +205,7 @@ for trackCollection in trackCollections: TRT_Manager = InDetKeys.TRT_Manager() ) - ToolSvc += InDetAlignMonSelectedTracksEfficiencies + #ToolSvc += InDetAlignMonSelectedTracksEfficiencies InDetAlignMonManager.AthenaMonTools += [ InDetAlignMonSelectedTracksEfficiencies ] @@ -233,7 +233,7 @@ if True: ) print InDetAlignMonResiduals - ToolSvc += InDetAlignMonResiduals + #ToolSvc += InDetAlignMonResiduals InDetAlignMonManager.AthenaMonTools += [ InDetAlignMonResiduals ] InDetAlignMonGenericTracks = IDAlignMonGenericTracks( @@ -247,7 +247,7 @@ if True: #NTracksRange = 10, VxPrimContainerName = InDetKeys.PrimaryVertices() ) - ToolSvc += InDetAlignMonGenericTracks + #ToolSvc += InDetAlignMonGenericTracks InDetAlignMonManager.AthenaMonTools += [ InDetAlignMonGenericTracks ] InDetAlignMonSelectedTracksEfficiencies = IDAlignMonEfficiencies ( @@ -262,7 +262,7 @@ if True: TRT_Manager = InDetKeys.TRT_Manager() ) - ToolSvc += InDetAlignMonSelectedTracksEfficiencies + #ToolSvc += InDetAlignMonSelectedTracksEfficiencies InDetAlignMonManager.AthenaMonTools += [ InDetAlignMonSelectedTracksEfficiencies ] @@ -297,7 +297,7 @@ if newInDetAlignAlg_Options["useTrackSelector"]: ) print InDetAlignMonResiduals - ToolSvc += InDetAlignMonResiduals + #ToolSvc += InDetAlignMonResiduals InDetAlignMonManager.AthenaMonTools += [ InDetAlignMonResiduals ] InDetAlignMonGenericTracks = IDAlignMonGenericTracks( @@ -309,7 +309,7 @@ if newInDetAlignAlg_Options["useTrackSelector"]: #doIPmaps = True, VxPrimContainerName = InDetKeys.PrimaryVertices() ) - ToolSvc += InDetAlignMonGenericTracks + #ToolSvc += InDetAlignMonGenericTracks InDetAlignMonManager.AthenaMonTools += [ InDetAlignMonGenericTracks ] InDetAlignMonSelectedTracksEfficiencies = IDAlignMonEfficiencies ( @@ -323,7 +323,7 @@ if newInDetAlignAlg_Options["useTrackSelector"]: SCT_Manager = InDetKeys.SCT_Manager(), TRT_Manager = InDetKeys.TRT_Manager() ) - ToolSvc += InDetAlignMonSelectedTracksEfficiencies + #ToolSvc += InDetAlignMonSelectedTracksEfficiencies InDetAlignMonManager.AthenaMonTools += [ InDetAlignMonSelectedTracksEfficiencies ] if not Cosmics: @@ -332,7 +332,7 @@ if not Cosmics: extrapolator = InDetExtrapolator, vxContainerName = InDetKeys.PrimaryVertices(), vxContainerWithBeamConstraint = InDetFlags.useBeamConstraint()) - ToolSvc += InDetAlignMonBeamSpot_noTrig + #ToolSvc += InDetAlignMonBeamSpot_noTrig InDetAlignMonManager.AthenaMonTools += [ InDetAlignMonBeamSpot_noTrig ] @@ -374,7 +374,7 @@ RefitAlignTrackSelection = InDetAlignMon__TrackSelectionTool( name = "InDetAlignMonAlignTrackSelectionTool", TrackSelectorTool = RefitTrackSelector), PrimVtxContainerName = InDetKeys.xAODVertexContainer(), -ToolSvc+= RefitAlignTrackSelection +#ToolSvc+= RefitAlignTrackSelection for trackCollection in RefitTrackCollections: @@ -400,7 +400,7 @@ for trackCollection in RefitTrackCollections: NSplitMap = 1, RangeOfPullHistos = 5 ) - ToolSvc += InDetAlignMonResiduals + #ToolSvc += InDetAlignMonResiduals InDetAlignMonManager.AthenaMonTools += [ InDetAlignMonResiduals ] InDetAlignMonGenericTracks = IDAlignMonGenericTracks( name = "InDetAlignMonGenericTracks_"+trackCollection, @@ -410,7 +410,7 @@ for trackCollection in RefitTrackCollections: triggerChainName = "all", VxPrimContainerName = InDetKeys.PrimaryVertices() ) - ToolSvc += InDetAlignMonGenericTracks + #ToolSvc += InDetAlignMonGenericTracks InDetAlignMonManager.AthenaMonTools += [ InDetAlignMonGenericTracks ] InDetAlignMonSelectedTracksEfficiencies = IDAlignMonEfficiencies ( @@ -423,7 +423,7 @@ for trackCollection in RefitTrackCollections: SCT_Manager = InDetKeys.SCT_Manager(), TRT_Manager = InDetKeys.TRT_Manager() ) - ToolSvc += InDetAlignMonSelectedTracksEfficiencies + #ToolSvc += InDetAlignMonSelectedTracksEfficiencies InDetAlignMonManager.AthenaMonTools += [ InDetAlignMonSelectedTracksEfficiencies ] ''' @@ -469,7 +469,7 @@ if Cosmics: nSharedSct = 0, TrackSummaryTool = InDetTrackSummaryTool, Extrapolator = InDetExtrapolator)) - ToolSvc += m_alignMonTrackSelectorTool[i] + #ToolSvc += m_alignMonTrackSelectorTool[i] if (InDetFlags.doPrintConfigurables()): print m_alignMonTrackSelectorTool[i] @@ -480,7 +480,7 @@ if Cosmics: #DoEventPhaseCut = True, TrackSelectorTool = m_alignMonTrackSelectorTool[i])) - ToolSvc += m_alignMonTrackSelectionTool[i] + #ToolSvc += m_alignMonTrackSelectionTool[i] if (InDetFlags.doPrintConfigurables()): print " <NewInDetAlignMonitoring> m_alignMonTrackSelectionTool[",i,"] =", m_alignMonTrackSelectionToolName[i] print m_alignMonTrackSelectionTool[i] @@ -518,7 +518,7 @@ if Cosmics: OutputLowerTracksName = m_lowerTracksName[i], OutputLevel = WARNING)) - ToolSvc += m_trackSplitter[i] + #ToolSvc += m_trackSplitter[i] if (InDetFlags.doPrintConfigurables()): print m_trackSplitter[i] print " <NewInDetAlignMonitoring> step ",i," -> defined track segment monitoring for",m_trackSegmentsUpLowName[i],"using", m_upperTracksName[i],"and", m_lowerTracksName[i], " 2*i+1=",2*i+1," m_alignMonTrackSelectionTool ? length=",len(m_alignMonTrackSelectionTool) @@ -540,7 +540,7 @@ if Cosmics: D0Range = m_d0Range[i], OutputLevel = WARNING)) - ToolSvc += m_trackSegmentsUpLow[i] + #ToolSvc += m_trackSegmentsUpLow[i] InDetAlignMonManager.AthenaMonTools += [ m_trackSegmentsUpLow[i] ] print " <NewInDetAlignMonitoring> step ",i, m_trackSegmentsUpLowName[i]," added to the ToolSvc" @@ -572,7 +572,7 @@ if Cosmics: OutputLevel = WARNING ) - ToolSvc += InDetAlignMonResiduals + #ToolSvc += InDetAlignMonResiduals InDetAlignMonManager.AthenaMonTools += [ InDetAlignMonResiduals ] print InDetAlignMonResiduals @@ -595,7 +595,7 @@ if Cosmics: InDetAlignMonGenericTracks.d0Range = 500 InDetAlignMonGenericTracks.z0Range = 1000 - ToolSvc += InDetAlignMonGenericTracks + #ToolSvc += InDetAlignMonGenericTracks InDetAlignMonManager.AthenaMonTools += [ InDetAlignMonGenericTracks ] print " <NewInDetAlignMonitoring> going to define InDetAlignMonSelectedTracksEfficiencies for track collection: ",trackCollection InDetAlignMonSelectedTracksEfficiencies = IDAlignMonEfficiencies ( @@ -610,7 +610,7 @@ if Cosmics: TRT_Manager = InDetKeys.TRT_Manager() ) - ToolSvc += InDetAlignMonSelectedTracksEfficiencies + #ToolSvc += InDetAlignMonSelectedTracksEfficiencies InDetAlignMonManager.AthenaMonTools += [ InDetAlignMonSelectedTracksEfficiencies ] # Lower track segments @@ -640,7 +640,7 @@ if Cosmics: OutputLevel = WARNING ) - ToolSvc += InDetAlignMonResiduals + #ToolSvc += InDetAlignMonResiduals InDetAlignMonManager.AthenaMonTools += [ InDetAlignMonResiduals ] print InDetAlignMonResiduals @@ -663,7 +663,7 @@ if Cosmics: InDetAlignMonGenericTracks.d0Range = 500 InDetAlignMonGenericTracks.z0Range = 1000 - ToolSvc += InDetAlignMonGenericTracks + #ToolSvc += InDetAlignMonGenericTracks InDetAlignMonManager.AthenaMonTools += [ InDetAlignMonGenericTracks ] print " <NewInDetAlignMonitoring> going to define InDetAlignMonSelectedTracksEfficiencies for track collection: ",trackCollection InDetAlignMonSelectedTracksEfficiencies = IDAlignMonEfficiencies ( @@ -678,7 +678,7 @@ if Cosmics: TRT_Manager = InDetKeys.TRT_Manager() ) - ToolSvc += InDetAlignMonSelectedTracksEfficiencies + #ToolSvc += InDetAlignMonSelectedTracksEfficiencies InDetAlignMonManager.AthenaMonTools += [ InDetAlignMonSelectedTracksEfficiencies ] # ^^^ @@ -720,7 +720,7 @@ if Cosmics: DeltaQoverPtRange2D = m_deltaQoverPt2D_Sub[i], D0Range = m_d0Range_Sub[i])) - ToolSvc += m_trackSegments_Sub[i] + #ToolSvc += m_trackSegments_Sub[i] if (InDetFlags.doPrintConfigurables()): print m_trackSegments_Sub[i] diff --git a/InnerDetector/InDetExample/InDetBeamSpotExample/share/MonitoringFragment.py b/InnerDetector/InDetExample/InDetBeamSpotExample/share/MonitoringFragment.py index 730a4fd8b1518bfb1ce5c3a2fe08f1b86a1865ff..8e83700844ad1fd69e34d02d0f22c86c41c8c72e 100644 --- a/InnerDetector/InDetExample/InDetBeamSpotExample/share/MonitoringFragment.py +++ b/InnerDetector/InDetExample/InDetBeamSpotExample/share/MonitoringFragment.py @@ -37,7 +37,7 @@ if not 'jobpostprocsteps' in jobConfig: jobConfig['jobpostprocsteps if not jobConfig['doMonitoringGlobal']: # Beam spot monitoring tool from GlobalMonitoring #from InDetGlobalMonitoring.InDetGlobalMonitoringConf import InDetGlobalBeamSpotMonTool - ToolSvc += CfgMgr.InDetGlobalBeamSpotMonTool(name = "InDetGlobalBeamSpotMonTool", + InDetGlobalBeamSpotMonTool = CfgMgr.InDetGlobalBeamSpotMonTool(name = "InDetGlobalBeamSpotMonTool", trackContainerName = jobConfig['TrackContainer'], vxContainerName = jobConfig['VertexContainer'], vxContainerWithBeamConstraint = jobConfig['VertexContainerWithBeamConstraint'], @@ -56,8 +56,8 @@ if not jobConfig['doMonitoringGlobal']: from AthenaMonitoring.AthenaMonitoringConf import DQFilledBunchFilterTool monFilledBunchFilterTool = DQFilledBunchFilterTool() monFilledBunchFilterTool.bunchCrossingTool = bunchCrossingTool - ToolSvc += monFilledBunchFilterTool - ToolSvc.InDetGlobalBeamSpotMonTool.FilterTools.append(monFilledBunchFilterTool) + #ToolSvc += monFilledBunchFilterTool + InDetGlobalBeamSpotMonTool.FilterTools.append(monFilledBunchFilterTool) print ToolSvc.InDetGlobalBeamSpotMonTool @@ -74,7 +74,7 @@ if not jobConfig['doMonitoringGlobal']: Run = 1, LumiBlock = 1) #topSequence.BeamSpotMonManager.AthenaMonTools += [ ToolSvc.InDetAlignMonBeamSpot ] - topSequence.BeamSpotMonManager.AthenaMonTools += [ ToolSvc.InDetGlobalBeamSpotMonTool ] + topSequence.BeamSpotMonManager.AthenaMonTools += [ InDetGlobalBeamSpotMonTool ] print topSequence.BeamSpotMonManager diff --git a/InnerDetector/InDetExample/InDetRecExample/share/InDetMonitoringAlignment.py b/InnerDetector/InDetExample/InDetRecExample/share/InDetMonitoringAlignment.py index 11d103a3851b545df6bb54177295e816e5e6dfeb..5d2278459e02cc2f373e626a087f4be7b9905b22 100755 --- a/InnerDetector/InDetExample/InDetRecExample/share/InDetMonitoringAlignment.py +++ b/InnerDetector/InDetExample/InDetRecExample/share/InDetMonitoringAlignment.py @@ -101,7 +101,7 @@ if not jobproperties.Beam.beamType()=='cosmics': InDetAlignMonSivsTRT_noTrig = IDAlignMonSivsTRT (name = "InDetAlignMonSivsTRT_noTrig", trackSelection = m_alignMonTrackSelectionTool[0]) - ToolSvc += InDetAlignMonSivsTRT_noTrig + #ToolSvc += InDetAlignMonSivsTRT_noTrig if (InDetFlags.doPrintConfigurables()): print InDetAlignMonSivsTRT_noTrig @@ -112,7 +112,7 @@ if not jobproperties.Beam.beamType()=='cosmics': vxContainerName = InDetKeys.PrimaryVertices(), vxContainerWithBeamConstraint = InDetFlags.useBeamConstraint()) - ToolSvc += InDetAlignMonBeamSpot_noTrig + #ToolSvc += InDetAlignMonBeamSpot_noTrig if (InDetFlags.doPrintConfigurables()): print InDetAlignMonBeamSpot_noTrig @@ -201,7 +201,7 @@ else: if InDetAlignMonReadESD and InDetFlags.doRefit: #use refitted tracks if reading ESD InDetAlignMonResiduals_noTrig.tracksName = InDetKeys.RefittedTracks() -ToolSvc += InDetAlignMonResiduals_noTrig +#ToolSvc += InDetAlignMonResiduals_noTrig if (InDetFlags.doPrintConfigurables()): print InDetAlignMonResiduals_noTrig @@ -223,7 +223,7 @@ else: if InDetAlignMonReadESD and InDetFlags.doRefit:#use refitted tracks if reading ESD InDetAlignMonEfficiencies_noTrig.tracksName = InDetKeys.RefittedTracks() -ToolSvc += InDetAlignMonEfficiencies_noTrig +#ToolSvc += InDetAlignMonEfficiencies_noTrig if (InDetFlags.doPrintConfigurables()): print InDetAlignMonEfficiencies_noTrig @@ -243,7 +243,7 @@ else: if InDetAlignMonReadESD and InDetFlags.doRefit: #use refitted tracks if reading ESD InDetAlignMonGenericTracks_noTrig.tracksName = InDetKeys.RefittedTracks() -ToolSvc += InDetAlignMonGenericTracks_noTrig +#ToolSvc += InDetAlignMonGenericTracks_noTrig if (InDetFlags.doPrintConfigurables()): print InDetAlignMonGenericTracks_noTrig @@ -304,7 +304,7 @@ if jobproperties.Beam.beamType()=='cosmics': DeltaQoverPtRange2D = m_deltaQoverPt2D[i], D0Range = m_d0Range[i])) - ToolSvc += m_trackSegmentsUpLow[i] + #ToolSvc += m_trackSegmentsUpLow[i] if (InDetFlags.doPrintConfigurables()): print m_trackSegmentsUpLow[i] @@ -342,7 +342,7 @@ if jobproperties.Beam.beamType()=='cosmics': DeltaQoverPtRange2D = m_deltaQoverPt2D_Sub[i], D0Range = m_d0Range_Sub[i])) - ToolSvc += m_trackSegments_Sub[i] + #ToolSvc += m_trackSegments_Sub[i] if (InDetFlags.doPrintConfigurables()): print m_trackSegments_Sub[i] @@ -383,11 +383,11 @@ else: vxContainerWithBeamConstraint = InDetFlags.useBeamConstraint()) if jobproperties.Beam.beamType()=='collisions' and hasattr(ToolSvc, 'DQFilledBunchFilterTool'): - InDetAlignMonSivsTRT.FilterTools.append(monFilledBunchFilterTool) - InDetAlignMonResiduals.FilterTools.append(monFilledBunchFilterTool) - InDetAlignMonEfficiencies.FilterTools.append(monFilledBunchFilterTool) - InDetAlignMonGenericTracks.FilterTools.append(monFilledBunchFilterTool) - InDetAlignMonBeamSpot.FilterTools.append(monFilledBunchFilterTool) + InDetAlignMonSivsTRT.FilterTools += [monFilledBunchFilterTool] + InDetAlignMonResiduals.FilterTools += [monFilledBunchFilterTool] + InDetAlignMonEfficiencies.FilterTools += [monFilledBunchFilterTool] + InDetAlignMonGenericTracks.FilterTools += [monFilledBunchFilterTool] + InDetAlignMonBeamSpot.FilterTools += [monFilledBunchFilterTool] InDetAlignMonSivsTRT.TrigDecisionTool = monTrigDecTool InDetAlignMonResiduals.TrigDecisionTool = monTrigDecTool @@ -415,19 +415,19 @@ else: InDetAlignMonGenericTracks.triggerChainName = "TriggerAwareMon" InDetAlignMonBeamSpot.histFolder = "IDAlignMon/BeamSpot/TriggerAwareMon" - ToolSvc += InDetAlignMonResiduals + #ToolSvc += InDetAlignMonResiduals if (InDetFlags.doPrintConfigurables()): print InDetAlignMonResiduals - ToolSvc += InDetAlignMonEfficiencies + #ToolSvc += InDetAlignMonEfficiencies if (InDetFlags.doPrintConfigurables()): print InDetAlignMonEfficiencies - ToolSvc += InDetAlignMonGenericTracks + #ToolSvc += InDetAlignMonGenericTracks if (InDetFlags.doPrintConfigurables()): print InDetAlignMonGenericTracks - ToolSvc += InDetAlignMonBeamSpot + #ToolSvc += InDetAlignMonBeamSpot if (InDetFlags.doPrintConfigurables()): print InDetAlignMonBeamSpot - ToolSvc += InDetAlignMonSivsTRT + #ToolSvc += InDetAlignMonSivsTRT if (InDetFlags.doPrintConfigurables()): print InDetAlignMonSivsTRT @@ -461,11 +461,11 @@ InDetAlignMonManager.AthenaMonTools += [ InDetAlignMonEfficiencies_noTri InDetAlignMonManager.AthenaMonTools += [ InDetAlignMonGenericTracks_noTrig ] if jobproperties.Beam.beamType()=='collisions' and hasattr(ToolSvc, 'DQFilledBunchFilterTool'): - InDetAlignMonSivsTRT_noTrig.FilterTools.append(monFilledBunchFilterTool) - InDetAlignMonResiduals_noTrig.FilterTools.append(monFilledBunchFilterTool) - InDetAlignMonEfficiencies_noTrig.FilterTools.append(monFilledBunchFilterTool) - InDetAlignMonGenericTracks_noTrig.FilterTools.append(monFilledBunchFilterTool) - InDetAlignMonBeamSpot_noTrig.FilterTools.append(monFilledBunchFilterTool) + InDetAlignMonSivsTRT_noTrig.FilterTools += [monFilledBunchFilterTool] + InDetAlignMonResiduals_noTrig.FilterTools += [monFilledBunchFilterTool] + InDetAlignMonEfficiencies_noTrig.FilterTools += [monFilledBunchFilterTool] + InDetAlignMonGenericTracks_noTrig.FilterTools += [monFilledBunchFilterTool] + InDetAlignMonBeamSpot_noTrig.FilterTools += [monFilledBunchFilterTool] if InDetAlignMonDoTruth: diff --git a/InnerDetector/InDetExample/InDetRecExample/share/InDetMonitoringGlobal.py b/InnerDetector/InDetExample/InDetRecExample/share/InDetMonitoringGlobal.py index 6e767c3f993f72ed39e49918092d2f3527d7470e..ed01c9192e03787fd093a07b778a437f1482c2f5 100644 --- a/InnerDetector/InDetExample/InDetRecExample/share/InDetMonitoringGlobal.py +++ b/InnerDetector/InDetExample/InDetRecExample/share/InDetMonitoringGlobal.py @@ -37,9 +37,9 @@ if InDetFlags.doMonitoringGlobal(): checkRate = 2000) if jobproperties.Beam.beamType()=='collisions' and hasattr(ToolSvc, 'DQFilledBunchFilterTool'): - InDetGlobalSynchMonTool.FilterTools.append(monFilledBunchFilterTool) + InDetGlobalSynchMonTool.FilterTools += [monFilledBunchFilterTool] - ToolSvc += InDetGlobalSynchMonTool + #ToolSvc += InDetGlobalSynchMonTool if (InDetFlags.doPrintConfigurables()): print InDetGlobalSynchMonTool @@ -52,7 +52,7 @@ if InDetFlags.doMonitoringGlobal(): from InDetGlobalMonitoring.InDetGlobalMonitoringConf import InDetGlobalErrorMonTool InDetGlobalErrorMonTool=InDetGlobalErrorMonTool( name = "InDetGlobalErrorMonTool" ) - ToolSvc += InDetGlobalErrorMonTool + #ToolSvc += InDetGlobalErrorMonTool if (InDetFlags.doPrintConfigurables()): print InDetGlobalErrorMonTool @@ -86,8 +86,8 @@ if InDetFlags.doMonitoringGlobal(): TrackSummaryTool = InDetTrackSummaryTool, Extrapolator = InDetExtrapolator) - ToolSvc += InDetTrackSelectionToolGlobalMon_Baseline - ToolSvc += InDetTrackSelectionToolGlobalMon_TightPrimary + #ToolSvc += InDetTrackSelectionToolGlobalMon_Baseline + #ToolSvc += InDetTrackSelectionToolGlobalMon_TightPrimary InDetGlobalTrackMonTool.Baseline_SelTool = InDetTrackSelectionToolGlobalMon_Baseline InDetGlobalTrackMonTool.Tight_SelTool = InDetTrackSelectionToolGlobalMon_TightPrimary @@ -101,9 +101,9 @@ if InDetFlags.doMonitoringGlobal(): InDetGlobalTrackMonTool.trackBin = 10 if jobproperties.Beam.beamType()=='collisions' and hasattr(ToolSvc, 'DQFilledBunchFilterTool'): - InDetGlobalTrackMonTool.FilterTools.append(monFilledBunchFilterTool) + InDetGlobalTrackMonTool.FilterTools += [monFilledBunchFilterTool] - ToolSvc += InDetGlobalTrackMonTool + #ToolSvc += InDetGlobalTrackMonTool if (InDetFlags.doPrintConfigurables()): print InDetGlobalTrackMonTool @@ -117,8 +117,8 @@ if InDetFlags.doMonitoringGlobal(): InDetGlobalPixelTool=InDetGlobalPixelTool( name = "InDetGlobalPixelTool") if jobproperties.Beam.beamType()=='collisions' and hasattr(ToolSvc, 'DQFilledBunchFilterTool'): - InDetGlobalPixelTool.FilterTools.append(monFilledBunchFilterTool) - ToolSvc += InDetGlobalPixelTool + InDetGlobalPixelTool.FilterTools += [monFilledBunchFilterTool] + #ToolSvc += InDetGlobalPixelTool if (InDetFlags.doPrintConfigurables()): print InDetGlobalPixelTool @@ -131,7 +131,7 @@ if InDetFlags.doMonitoringGlobal(): # InDetGlobalBCMTool=InDetGlobalBCMTool( name = "InDetGlobalBCMTool") # if jobproperties.Beam.beamType()=='collisions' and hasattr(ToolSvc, 'DQFilledBunchFilterTool'): - # InDetGlobalBCMTool.FilterTools.append(monFilledBunchFilterTool) + # InDetGlobalBCMTool.FilterTools += [monFilledBunchFilterTool] # ToolSvc += InDetGlobalBCMTool # if (InDetFlags.doPrintConfigurables()): # print InDetGlobalBCMTool @@ -150,8 +150,8 @@ if InDetFlags.doMonitoringGlobal(): useBeamspot = InDetFlags.useBeamConstraint()) if jobproperties.Beam.beamType()=='collisions' and hasattr(ToolSvc, 'DQFilledBunchFilterTool'): - InDetGlobalBeamSpotMonTool.FilterTools.append(monFilledBunchFilterTool) - ToolSvc += InDetGlobalBeamSpotMonTool + InDetGlobalBeamSpotMonTool.FilterTools += [monFilledBunchFilterTool] + #ToolSvc += InDetGlobalBeamSpotMonTool if (InDetFlags.doPrintConfigurables()): print InDetGlobalBeamSpotMonTool @@ -190,9 +190,9 @@ if InDetFlags.doMonitoringGlobal() or InDetFlags.doMonitoringPrimaryVertexingEnh vxContainerNameSplit = InDetKeys.PrimaryVerticesSplitStream(), doEnhancedMonitoring = InDetFlags.doMonitoringPrimaryVertexingEnhanced()) if jobproperties.Beam.beamType()=='collisions' and hasattr(ToolSvc, 'DQFilledBunchFilterTool'): - InDetGlobalPrimaryVertexMonTool.FilterTools.append(monFilledBunchFilterTool) + InDetGlobalPrimaryVertexMonTool.FilterTools += [monFilledBunchFilterTool] - ToolSvc += InDetGlobalPrimaryVertexMonTool + #ToolSvc += InDetGlobalPrimaryVertexMonTool if (InDetFlags.doPrintConfigurables()): print InDetGlobalPrimaryVertexMonTool @@ -219,13 +219,13 @@ if InDetFlags.doMonitoringGlobal(): OutputLevel=ERROR, PublicChainGroups = {"EFRandom": "EF_rd0_filled_NoAlg"} ) - ToolSvc += monTrigDecTool + #ToolSvc += monTrigDecTool if rec.doTrigger == True: InDetVertexMonitoring.TrigDecisionTool = monTrigDecTool InDetVertexMonitoring.TriggerChain = "EF_rd0_filled_NoAlg" - ToolSvc += InDetVertexMonitoring + #ToolSvc += InDetVertexMonitoring InDetGlobalManager.AthenaMonTools += [ InDetVertexMonitoring] diff --git a/InnerDetector/InDetExample/InDetRecExample/share/InDetMonitoringPixel.py b/InnerDetector/InDetExample/InDetRecExample/share/InDetMonitoringPixel.py index 8e079eb5984c13100408b83238f4478a30e22061..620e21a5e48147c4b2b55c0ea3aeae07bc536d84 100644 --- a/InnerDetector/InDetExample/InDetRecExample/share/InDetMonitoringPixel.py +++ b/InnerDetector/InDetExample/InDetRecExample/share/InDetMonitoringPixel.py @@ -49,9 +49,9 @@ if doAllHits: ##Other parameters if jobproperties.Beam.beamType()=='collisions' and hasattr(ToolSvc, 'DQFilledBunchFilterTool'): - InDetPixelMainsMon.FilterTools.append(monFilledBunchFilterTool) + InDetPixelMainsMon.FilterTools += [monFilledBunchFilterTool] - ToolSvc += InDetPixelMainsMon + #ToolSvc += InDetPixelMainsMon if (InDetFlags.doPrintConfigurables()): print InDetPixelMainsMon @@ -115,9 +115,9 @@ if doHitsOnTrack: ##Other parameters if jobproperties.Beam.beamType()=='collisions' and hasattr(ToolSvc, 'DQFilledBunchFilterTool'): - InDetPixelMainsMonOnTrack.FilterTools.append(monFilledBunchFilterTool) + InDetPixelMainsMonOnTrack.FilterTools += [monFilledBunchFilterTool] - ToolSvc += InDetPixelMainsMonOnTrack + #ToolSvc += InDetPixelMainsMonOnTrack if (InDetFlags.doPrintConfigurables()): print InDetPixelMainsMonOnTrack diff --git a/InnerDetector/InDetExample/InDetRecExample/share/InDetMonitoringSCT.py b/InnerDetector/InDetExample/InDetRecExample/share/InDetMonitoringSCT.py index 2f3957b4acafa5c99b0259ea6e017729a15b5ca5..f096a7097ca72320c092611b404d0354f30ad172 100755 --- a/InnerDetector/InDetExample/InDetRecExample/share/InDetMonitoringSCT.py +++ b/InnerDetector/InDetExample/InDetRecExample/share/InDetMonitoringSCT.py @@ -25,7 +25,7 @@ InDetSCTHitsTool = SCTHitsNoiseMonTool ( name = "InDetSC InDetSCTHitsTool.tracksName = InDetKeys.SCTTracks() if InDetFlags.doTrackSegmentsSCT() else InDetKeys.UnslimmedTracks() -ToolSvc += InDetSCTHitsTool +#ToolSvc += InDetSCTHitsTool if (InDetFlags.doPrintConfigurables()): print InDetSCTHitsTool @@ -41,9 +41,9 @@ InDetSCTTracksMonTool = SCTTracksMonTool ( name = "InDetSCTTracksMon InDetSCTTracksMonTool.tracksName = InDetKeys.SCTTracks() if InDetFlags.doTrackSegmentsSCT() else InDetKeys.UnslimmedTracks() if jobproperties.Beam.beamType()=='collisions' and hasattr(ToolSvc, 'DQFilledBunchFilterTool'): - InDetSCTTracksMonTool.FilterTools.append(monFilledBunchFilterTool) + InDetSCTTracksMonTool.FilterTools += [monFilledBunchFilterTool] -ToolSvc += InDetSCTTracksMonTool +#ToolSvc += InDetSCTTracksMonTool if (InDetFlags.doPrintConfigurables()): print InDetSCTTracksMonTool @@ -57,9 +57,9 @@ InDetSCTErrMonTool = SCTErrMonTool ( name = "InDetSCTErrMonTool", doNegativeEndcap = True) if jobproperties.Beam.beamType()=='collisions' and hasattr(ToolSvc, 'DQFilledBunchFilterTool'): - InDetSCTErrMonTool.FilterTools.append(monFilledBunchFilterTool) + InDetSCTErrMonTool.FilterTools += [monFilledBunchFilterTool] -ToolSvc += InDetSCTErrMonTool +#ToolSvc += InDetSCTErrMonTool if (InDetFlags.doPrintConfigurables()): print InDetSCTErrMonTool @@ -92,9 +92,9 @@ InDetSCTHitEffMonTool = SCTHitEffMonTool(name = "InDetSCTHitEffMonTool", InDetSCTHitEffMonTool.TrackName = InDetKeys.SCTTracks() if InDetFlags.doTrackSegmentsSCT() else InDetKeys.UnslimmedTracks() if jobproperties.Beam.beamType()=='collisions' and hasattr(ToolSvc, 'DQFilledBunchFilterTool'): - InDetSCTHitEffMonTool.FilterTools.append(monFilledBunchFilterTool) + InDetSCTHitEffMonTool.FilterTools += [monFilledBunchFilterTool] -ToolSvc += InDetSCTHitEffMonTool +#ToolSvc += InDetSCTHitEffMonTool if (InDetFlags.doPrintConfigurables()): print InDetSCTHitEffMonTool @@ -110,9 +110,9 @@ InDetSCTLorentzMonTool = SCTLorentzMonTool ( name = "InDetSCTLorentz InDetSCTLorentzMonTool.tracksName = InDetKeys.SCTTracks() if InDetFlags.doTrackSegmentsSCT() else InDetKeys.UnslimmedTracks() if jobproperties.Beam.beamType()=='collisions' and hasattr(ToolSvc, 'DQFilledBunchFilterTool'): - InDetSCTLorentzMonTool.FilterTools.append(monFilledBunchFilterTool) + InDetSCTLorentzMonTool.FilterTools += [monFilledBunchFilterTool] -ToolSvc += InDetSCTLorentzMonTool +#ToolSvc += InDetSCTLorentzMonTool if (InDetFlags.doPrintConfigurables()): print InDetSCTLorentzMonTool @@ -127,7 +127,7 @@ from RecExConfig.RecFlags import rec if not rec.doTrigger(): InDetSCTRatioNoiseMonTool.doTrigger=False -ToolSvc += InDetSCTRatioNoiseMonTool +#ToolSvc += InDetSCTRatioNoiseMonTool if (InDetFlags.doPrintConfigurables()): print InDetSCTRatioNoiseMonTool diff --git a/InnerDetector/InDetExample/InDetRecExample/share/InDetMonitoringTRT.py b/InnerDetector/InDetExample/InDetRecExample/share/InDetMonitoringTRT.py index fba45670ca97c03d483296fd96c07f8830725c6d..bfcfda5ad39a3c5e7cc7bef52f4f41c7e5c57899 100644 --- a/InnerDetector/InDetExample/InDetRecExample/share/InDetMonitoringTRT.py +++ b/InnerDetector/InDetExample/InDetRecExample/share/InDetMonitoringTRT.py @@ -92,9 +92,9 @@ InDetTRT_Monitoring_Tool = TRT_Monitoring_Tool (name = " ) if jobproperties.Beam.beamType()=='collisions' and hasattr(ToolSvc, 'DQFilledBunchFilterTool'): - InDetTRT_Monitoring_Tool.FilterTools.append(monFilledBunchFilterTool) + InDetTRT_Monitoring_Tool.FilterTools += [monFilledBunchFilterTool] -ToolSvc += InDetTRT_Monitoring_Tool +#ToolSvc += InDetTRT_Monitoring_Tool if (InDetFlags.doPrintConfigurables()): print InDetTRT_Monitoring_Tool diff --git a/InnerDetector/InDetExample/InDetRecExample/share/InDetRecCaloSeededROISelection.py b/InnerDetector/InDetExample/InDetRecExample/share/InDetRecCaloSeededROISelection.py index a67424b8dd021ad6ba7db36e0b5c6fdd89b77f97..e19d5ca3c31525e6885cf7b5c0fb1254a2c42dc3 100644 --- a/InnerDetector/InDetExample/InDetRecExample/share/InDetRecCaloSeededROISelection.py +++ b/InnerDetector/InDetExample/InDetRecExample/share/InDetRecCaloSeededROISelection.py @@ -15,8 +15,8 @@ egammaCaloClusterROISelector = ToolFactory( egammaCaloToolsConf.egammaCaloCluste name = 'caloClusterROISelector', egammaCheckEnergyDepositTool = egammaCheckEnergyDepositTool, EMEtRanges = [1500.,2500.,4000.], - EMFCuts = [0.9,0.85,0.8], - RetaCut = [0.7,0.65,0.6] + EMFCuts = [0.9,0.9,0.85], + RetaCut = [0.7,0.65,0.65] ) # # --- get the builder tool diff --git a/InnerDetector/InDetExample/InDetRecExample/share/InDetRecNtupleCreation.py b/InnerDetector/InDetExample/InDetRecExample/share/InDetRecNtupleCreation.py index 815a8b850baf0801b580481c55f7567ee9b32efd..627f02078af99e4570ce510ceefe760ed0f6093a 100644 --- a/InnerDetector/InDetExample/InDetRecExample/share/InDetRecNtupleCreation.py +++ b/InnerDetector/InDetExample/InDetRecExample/share/InDetRecNtupleCreation.py @@ -494,7 +494,7 @@ if InDetFlags.doPhysValMon(): # ToolSvc += InDetPhysValMonToolDBM # InDetPhysValMonManager.AthenaMonTools += [InDetPhysValMonToolDBM] - ToolSvc += InDetPhysValMonTool + #ToolSvc += InDetPhysValMonTool InDetPhysValMonManager.AthenaMonTools += [InDetPhysValMonTool] if (InDetFlags.doPrintConfigurables()): print InDetPhysValMonTool @@ -505,7 +505,7 @@ if InDetFlags.doPhysValMon(): InDetPhysValMonToolPU = InDetPhysValMonitoringTool (useTrackSelection = True, TrackSelectionTool = InDetTrackSelectorTool, TruthParticleContainerName = "SpclMCPU") - ToolSvc += InDetPhysValMonToolPU + #ToolSvc += InDetPhysValMonToolPU InDetPhysValMonManager.AthenaMonTools += [InDetPhysValMonToolPU] if (InDetFlags.doPrintConfigurables()): print InDetPhysValMonToolPU diff --git a/InnerDetector/InDetMonitoring/InDetAlignmentMonitoring/share/InDetMonitoringTRTCosmics.py b/InnerDetector/InDetMonitoring/InDetAlignmentMonitoring/share/InDetMonitoringTRTCosmics.py index 9bc957cf259a533a0dd51f0d4553cd728be9647e..827a13ad1d2d01b494060d543dd80cde22bf7a18 100644 --- a/InnerDetector/InDetMonitoring/InDetAlignmentMonitoring/share/InDetMonitoringTRTCosmics.py +++ b/InnerDetector/InDetMonitoring/InDetAlignmentMonitoring/share/InDetMonitoringTRTCosmics.py @@ -151,7 +151,7 @@ for i in range(5): trackSelection = InDetAlignMonTrackSelectionTool, TRT_Manager = InDetKeys.TRT_Manager()) ) - ToolSvc += InDetAlignMonResidualsList[i] + #ToolSvc += InDetAlignMonResidualsList[i] if (InDetFlags.doPrintConfigurables()): print InDetAlignMonResidualsList[i] @@ -164,7 +164,7 @@ for i in range(5): trackSelection = InDetAlignMonTrackSelectionTool, TRT_Manager = InDetKeys.TRT_Manager()) ) - ToolSvc += InDetAlignMonEfficienciesList[i] + #ToolSvc += InDetAlignMonEfficienciesList[i] if (InDetFlags.doPrintConfigurables()): print InDetAlignMonEfficienciesList[i] @@ -174,7 +174,7 @@ for i in range(5): trackSelection = InDetAlignMonTrackSelectionTool, VxPrimContainerName = InDetKeys.PrimaryVertices()) ) - ToolSvc += InDetAlignMonGenericTracksList[i] + #ToolSvc += InDetAlignMonGenericTracksList[i] if (InDetFlags.doPrintConfigurables()): print InDetAlignMonGenericTracksList[i] @@ -185,7 +185,7 @@ for i in range(5): OutputLowerTracksName = m_trkSplitterName[i]+"_Lower", OutputLevel = ERROR) ) - ToolSvc += InDetTrackSplitterToolList[i] + #ToolSvc += InDetTrackSplitterToolList[i] if (InDetFlags.doPrintConfigurables()): print InDetTrackSplitterToolList[i] @@ -204,7 +204,7 @@ for i in range(5): DeltaQoverPtRange = m_deltaQoverPt[i], OutputLevel = ERROR, D0Range = m_d0Range[i] )) - ToolSvc += InDetAlignMonTrackSegmentsList[i] + #ToolSvc += InDetAlignMonTrackSegmentsList[i] if (InDetFlags.doPrintConfigurables()): print InDetAlignMonTrackSegmentsList[i] #============================================================== @@ -237,7 +237,7 @@ for i in range(5): if InDetAlignMonDoTruth: InDetAlignMonManager.AthenaMonTools += [ InDetAlignMonTruthComparison ] -if not hasattr(ToolSvc, 'monTrigDecTool'): +if not hasattr(#ToolSvc, 'monTrigDecTool'): print "InDetAlignmentMonitoring_InDetRec_jobOptions.py: trigger decision tool not found: don't run trigger-aware monitoring" elif jobproperties.Beam.beamType()=='cosmics' or jobproperties.Beam.beamType()=='singlebeam': print "singlebeam or cosmics: don't run trigger-aware monitoring" diff --git a/InnerDetector/InDetMonitoring/InDetDiMuonMonitoring/share/InDetDiMuMon_jobOptions.py b/InnerDetector/InDetMonitoring/InDetDiMuonMonitoring/share/InDetDiMuMon_jobOptions.py index 5e6a2fc35940a793746e1a78cab4b20f497492d6..519dcb87adda54b78ae06c15c6279ea3ee03b0ee 100644 --- a/InnerDetector/InDetMonitoring/InDetDiMuonMonitoring/share/InDetDiMuMon_jobOptions.py +++ b/InnerDetector/InDetMonitoring/InDetDiMuonMonitoring/share/InDetDiMuMon_jobOptions.py @@ -55,7 +55,7 @@ if not rec.doHeavyIon(): # OutputLevel = 1) - ToolSvc += JpsiMon_NoTrig + #ToolSvc += JpsiMon_NoTrig if (InDetFlags.doPrintConfigurables()): print JpsiMon_NoTrig InDetDiMuMonManager.AthenaMonTools += [ JpsiMon_NoTrig ] @@ -75,7 +75,7 @@ if not rec.doHeavyIon(): doSaveFits = doSaveFits) # OutputLevel = 1) - ToolSvc += ZmumuMon_NoTrig + #ToolSvc += ZmumuMon_NoTrig if (InDetFlags.doPrintConfigurables()): print ZmumuMon_NoTrig InDetDiMuMonManager.AthenaMonTools += [ ZmumuMon_NoTrig ] @@ -100,7 +100,7 @@ if not rec.doHeavyIon(): doSaveFits = doSaveFits) JpsiMon_XpressTrig_idperf.TriggerChain = "HLT_mu4_mu4_idperf_bJpsimumu_noid" JpsiMon_XpressTrig_idperf.TrigDecisionTool = monTrigDecTool - ToolSvc += JpsiMon_XpressTrig_idperf + #ToolSvc += JpsiMon_XpressTrig_idperf if (InDetFlags.doPrintConfigurables()): print JpsiMon_XpressTrig_idperf InDetDiMuMonManager.AthenaMonTools += [ JpsiMon_XpressTrig_idperf ] @@ -119,7 +119,7 @@ if not rec.doHeavyIon(): doSaveFits = doSaveFits) JpsiMon_XpressTrig_2mu.TriggerChain = "HLT_2mu4" JpsiMon_XpressTrig_2mu.TrigDecisionTool = monTrigDecTool - ToolSvc += JpsiMon_XpressTrig_2mu + #ToolSvc += JpsiMon_XpressTrig_2mu if (InDetFlags.doPrintConfigurables()): print JpsiMon_XpressTrig_2mu InDetDiMuMonManager.AthenaMonTools += [ JpsiMon_XpressTrig_2mu ] @@ -140,7 +140,7 @@ if not rec.doHeavyIon(): doSaveFits = doSaveFits) ZmumuMon_XpressTrig_idperf.TriggerChain = "HLT_mu13_mu13_idperf_Zmumu" ZmumuMon_XpressTrig_idperf.TrigDecisionTool = monTrigDecTool - ToolSvc += ZmumuMon_XpressTrig_idperf + #ToolSvc += ZmumuMon_XpressTrig_idperf if (InDetFlags.doPrintConfigurables()): print ZmumuMon_XpressTrig_idperf InDetDiMuMonManager.AthenaMonTools += [ ZmumuMon_XpressTrig_idperf ] @@ -160,7 +160,7 @@ if not rec.doHeavyIon(): doSaveFits = doSaveFits) ZmumuMon_XpressTrig_2mu.TriggerChain = "HLT_2mu14" ZmumuMon_XpressTrig_2mu.TrigDecisionTool = monTrigDecTool - ToolSvc += ZmumuMon_XpressTrig_2mu + #ToolSvc += ZmumuMon_XpressTrig_2mu if (InDetFlags.doPrintConfigurables()): print ZmumuMon_XpressTrig_2mu InDetDiMuMonManager.AthenaMonTools += [ ZmumuMon_XpressTrig_2mu ] @@ -216,7 +216,7 @@ if rec.doHeavyIon(): # OutputLevel = 1) - ToolSvc += JpsiMon_NoTrig + #ToolSvc += JpsiMon_NoTrig if (InDetFlags.doPrintConfigurables()): print JpsiMon_NoTrig InDetDiMuMonManager.AthenaMonTools += [ JpsiMon_NoTrig ] @@ -236,7 +236,7 @@ if rec.doHeavyIon(): doSaveFits = doSaveFits) # OutputLevel = 1) - ToolSvc += ZmumuMon_NoTrig + #ToolSvc += ZmumuMon_NoTrig if (InDetFlags.doPrintConfigurables()): print ZmumuMon_NoTrig InDetDiMuMonManager.AthenaMonTools += [ ZmumuMon_NoTrig ] @@ -261,7 +261,7 @@ if rec.doHeavyIon(): doSaveFits = doSaveFits) JpsiMon_XpressTrig_idperf.TriggerChain = "HLT_mu4_mu4_idperf_bJpsimumu_noid" JpsiMon_XpressTrig_idperf.TrigDecisionTool = monTrigDecTool - ToolSvc += JpsiMon_XpressTrig_idperf + #ToolSvc += JpsiMon_XpressTrig_idperf if (InDetFlags.doPrintConfigurables()): print JpsiMon_XpressTrig_idperf InDetDiMuMonManager.AthenaMonTools += [ JpsiMon_XpressTrig_idperf ] @@ -280,7 +280,7 @@ if rec.doHeavyIon(): doSaveFits = doSaveFits) JpsiMon_XpressTrig_2mu.TriggerChain = "HLT_mu4_mu4noL1" JpsiMon_XpressTrig_2mu.TrigDecisionTool = monTrigDecTool - ToolSvc += JpsiMon_XpressTrig_2mu + #ToolSvc += JpsiMon_XpressTrig_2mu if (InDetFlags.doPrintConfigurables()): print JpsiMon_XpressTrig_2mu InDetDiMuMonManager.AthenaMonTools += [ JpsiMon_XpressTrig_2mu ] @@ -301,7 +301,7 @@ if rec.doHeavyIon(): doSaveFits = doSaveFits) ZmumuMon_XpressTrig_idperf.TriggerChain = "HLT_mu13_mu13_idperf_Zmumu" ZmumuMon_XpressTrig_idperf.TrigDecisionTool = monTrigDecTool - ToolSvc += ZmumuMon_XpressTrig_idperf + #ToolSvc += ZmumuMon_XpressTrig_idperf if (InDetFlags.doPrintConfigurables()): print ZmumuMon_XpressTrig_idperf InDetDiMuMonManager.AthenaMonTools += [ ZmumuMon_XpressTrig_idperf ] @@ -321,7 +321,7 @@ if rec.doHeavyIon(): doSaveFits = doSaveFits) ZmumuMon_XpressTrig_2mu.TriggerChain = "HLT_mu4_mu4noL1" ZmumuMon_XpressTrig_2mu.TrigDecisionTool = monTrigDecTool - ToolSvc += ZmumuMon_XpressTrig_2mu + #ToolSvc += ZmumuMon_XpressTrig_2mu if (InDetFlags.doPrintConfigurables()): print ZmumuMon_XpressTrig_2mu InDetDiMuMonManager.AthenaMonTools += [ ZmumuMon_XpressTrig_2mu ] diff --git a/InnerDetector/InDetMonitoring/InDetPerformanceMonitoring/share/IDPerfMon_jobOptions.py b/InnerDetector/InDetMonitoring/InDetPerformanceMonitoring/share/IDPerfMon_jobOptions.py index 2902259c7e75580c30d6395d95fee67c078ab3cb..fcc207decaf185f4655b329e942cf0eae6e649f0 100644 --- a/InnerDetector/InDetMonitoring/InDetPerformanceMonitoring/share/IDPerfMon_jobOptions.py +++ b/InnerDetector/InDetMonitoring/InDetPerformanceMonitoring/share/IDPerfMon_jobOptions.py @@ -4,14 +4,14 @@ IDPerfMonDoOutput = False from InDetPerformanceMonitoring.InDetPerformanceMonitoringConf import IDPerfMonZee IDPerfMonZee_noTrig = IDPerfMonZee (name = "IDPerfMonZee_noTrig", tracksName=InDetKeys.xAODTrackParticleContainer())# tracksName = "InDetTrackParticles")#InDetKeys.TrackParticles()) -ToolSvc += IDPerfMonZee_noTrig +#ToolSvc += IDPerfMonZee_noTrig if (InDetFlags.doPrintConfigurables()): print IDPerfMonZee_noTrig from InDetPerformanceMonitoring.InDetPerformanceMonitoringConf import IDPerfMonWenu IDPerfMonWenu_noTrig = IDPerfMonWenu (name = "IDPerfMonWenu_noTrig", tracksName=InDetKeys.xAODTrackParticleContainer()) # tracksName = "InDetTrackParticles")#InDetKeys.TrackParticles()) -ToolSvc += IDPerfMonWenu_noTrig +#ToolSvc += IDPerfMonWenu_noTrig if (InDetFlags.doPrintConfigurables()): print IDPerfMonWenu_noTrig @@ -59,17 +59,17 @@ else: IDPerfMonWenu_e24_tight_L1EM20VH.TriggerChain = "HLT_e24_tight_L1EM20VH" - ToolSvc += IDPerfMonZee_e24_medium_L1EM18VH + #ToolSvc += IDPerfMonZee_e24_medium_L1EM18VH if (InDetFlags.doPrintConfigurables()): print IDPerfMonZee_e24_medium_L1EM18VH - ToolSvc += IDPerfMonZee_e24_tight_L1EM20VH + #ToolSvc += IDPerfMonZee_e24_tight_L1EM20VH if (InDetFlags.doPrintConfigurables()): print IDPerfMonZee_e24_tight_L1EM20VH - ToolSvc += IDPerfMonWenu_e24_medium_L1EM18VH + #ToolSvc += IDPerfMonWenu_e24_medium_L1EM18VH if (InDetFlags.doPrintConfigurables()): print IDPerfMonWenu_e24_medium_L1EM18VH - ToolSvc += IDPerfMonWenu_e24_tight_L1EM20VH + #ToolSvc += IDPerfMonWenu_e24_tight_L1EM20VH if (InDetFlags.doPrintConfigurables()): print IDPerfMonWenu_e24_tight_L1EM20VH @@ -107,14 +107,14 @@ else: IDPerfMonWenu_e15_loose_ion.TriggerChain = "HLT_e15_loose_ion" - ToolSvc += IDPerfMonZee_e15_loose_ion + #ToolSvc += IDPerfMonZee_e15_loose_ion if (InDetFlags.doPrintConfigurables()): print IDPerfMonZee_e15_loose_ion - ToolSvc += IDPerfMonZee_2e10_loose_ion + #ToolSvc += IDPerfMonZee_2e10_loose_ion if (InDetFlags.doPrintConfigurables()): print IDPerfMonZee_2e10_loose_ion - ToolSvc += IDPerfMonWenu_e15_loose_ion + #ToolSvc += IDPerfMonWenu_e15_loose_ion if (InDetFlags.doPrintConfigurables()): print IDPerfMonWenu_e15_loose_ion diff --git a/InnerDetector/InDetMonitoring/InDetPerformanceMonitoring/share/TRT_Monitoring_RecExCommonAddOn_jobOptions.py b/InnerDetector/InDetMonitoring/InDetPerformanceMonitoring/share/TRT_Monitoring_RecExCommonAddOn_jobOptions.py index 5128256d212d4e5920f8f12ef5d94734b6d94efc..4e35201e49d0297a87bd9b0462f6803aca10e5df 100644 --- a/InnerDetector/InDetMonitoring/InDetPerformanceMonitoring/share/TRT_Monitoring_RecExCommonAddOn_jobOptions.py +++ b/InnerDetector/InDetMonitoring/InDetPerformanceMonitoring/share/TRT_Monitoring_RecExCommonAddOn_jobOptions.py @@ -42,7 +42,7 @@ TRT_Electron_Monitoring_Tool = TRT_Electron_Monitoring_Tool ( isOnline = True, doExpert = True) -ToolSvc += TRT_Electron_Monitoring_Tool +#ToolSvc += TRT_Electron_Monitoring_Tool TRTElectronMonManager.AthenaMonTools += [ TRT_Electron_Monitoring_Tool] diff --git a/InnerDetector/InDetMonitoring/InDetPerformanceMonitoring/share/TrackMonitoring.py b/InnerDetector/InDetMonitoring/InDetPerformanceMonitoring/share/TrackMonitoring.py index 6d4805c7162be5cf2d2b17e346be8602282ee63c..77939a9147591949dc116373d87a7ce4dff2c9cd 100644 --- a/InnerDetector/InDetMonitoring/InDetPerformanceMonitoring/share/TrackMonitoring.py +++ b/InnerDetector/InDetMonitoring/InDetPerformanceMonitoring/share/TrackMonitoring.py @@ -105,7 +105,7 @@ for trackCollection in trackCollections: ) print InDetAlignMonResiduals - ToolSvc += InDetAlignMonResiduals + #ToolSvc += InDetAlignMonResiduals InDetAlignMonManager.AthenaMonTools += [ InDetAlignMonResiduals ] InDetAlignMonGenericTracks = IDAlignMonGenericTracks( @@ -116,7 +116,7 @@ for trackCollection in trackCollections: triggerChainName = "all", VxPrimContainerName = InDetKeys.PrimaryVertices() ) - ToolSvc += InDetAlignMonGenericTracks + #ToolSvc += InDetAlignMonGenericTracks InDetAlignMonManager.AthenaMonTools += [ InDetAlignMonGenericTracks ] InDetAlignMonSelectedTracksEfficiencies = IDAlignMonEfficiencies ( @@ -129,7 +129,7 @@ for trackCollection in trackCollections: SCT_Manager = InDetKeys.SCT_Manager(), TRT_Manager = InDetKeys.TRT_Manager() ) - ToolSvc += InDetAlignMonSelectedTracksEfficiencies + #ToolSvc += InDetAlignMonSelectedTracksEfficiencies InDetAlignMonManager.AthenaMonTools += [ InDetAlignMonSelectedTracksEfficiencies ] @@ -143,7 +143,7 @@ InDetAlignMonBeamSpot_noTrig = InDetAlignMonBeamSpot (name = "InDetAlignMonBeam vxContainerWithBeamConstraint = InDetFlags.useBeamConstraint(), # vxContainerWithBeamConstraint = False, OutputLevel= 1) -ToolSvc += InDetAlignMonBeamSpot_noTrig +#ToolSvc += InDetAlignMonBeamSpot_noTrig InDetAlignMonManager.AthenaMonTools += [ InDetAlignMonBeamSpot_noTrig ] # write out BS info diff --git a/InnerDetector/InDetMonitoring/InDetPerformanceMonitoring/share/runJPsiMonitoring.py b/InnerDetector/InDetMonitoring/InDetPerformanceMonitoring/share/runJPsiMonitoring.py index f90a1878d15cff512a00394ff6f2f17db482d38b..fea6180843605db3f40d1e1c6489477f9e242173 100644 --- a/InnerDetector/InDetMonitoring/InDetPerformanceMonitoring/share/runJPsiMonitoring.py +++ b/InnerDetector/InDetMonitoring/InDetPerformanceMonitoring/share/runJPsiMonitoring.py @@ -165,7 +165,7 @@ JpsiMon = DiMuMon(name = "JpsiMon_NoTrig", doSaveFits = False, OutputLevel = VERBOSE) -ToolSvc += JpsiMon +#ToolSvc += JpsiMon from AthenaMonitoring.DQMonFlags import DQMonFlags from AthenaMonitoring.AthenaMonitoringConf import AthenaMonManager diff --git a/InnerDetector/InDetMonitoring/InDetPerformanceMonitoring/share/runJPsiMonitoring_data.py b/InnerDetector/InDetMonitoring/InDetPerformanceMonitoring/share/runJPsiMonitoring_data.py index e631cfc846dcfb8c0147a0138e8b88cc6e78c384..55dbdb9a9568cae4f77d6a2beecbea4b38c7b8a2 100644 --- a/InnerDetector/InDetMonitoring/InDetPerformanceMonitoring/share/runJPsiMonitoring_data.py +++ b/InnerDetector/InDetMonitoring/InDetPerformanceMonitoring/share/runJPsiMonitoring_data.py @@ -209,7 +209,7 @@ JpsiMon = DiMuMon(name = "JpsiMon_NoTrig", doSaveFits = False, OutputLevel = VERBOSE) -ToolSvc += JpsiMon +#ToolSvc += JpsiMon from AthenaMonitoring.DQMonFlags import DQMonFlags from AthenaMonitoring.AthenaMonitoringConf import AthenaMonManager diff --git a/InnerDetector/InDetMonitoring/InDetPerformanceMonitoring/share/runJPsiMonitoring_data_grid.py b/InnerDetector/InDetMonitoring/InDetPerformanceMonitoring/share/runJPsiMonitoring_data_grid.py index e8a2b27baa05fd8c69074ca30ba097f804237b78..6ccaaa845876f4de4bbb5f4a60873585e2e87797 100644 --- a/InnerDetector/InDetMonitoring/InDetPerformanceMonitoring/share/runJPsiMonitoring_data_grid.py +++ b/InnerDetector/InDetMonitoring/InDetPerformanceMonitoring/share/runJPsiMonitoring_data_grid.py @@ -209,7 +209,7 @@ JpsiMon = DiMuMon(name = "JpsiMon_NoTrig", doSaveFits = False, OutputLevel = VERBOSE) -ToolSvc += JpsiMon +#ToolSvc += JpsiMon from AthenaMonitoring.DQMonFlags import DQMonFlags from AthenaMonitoring.AthenaMonitoringConf import AthenaMonManager diff --git a/InnerDetector/InDetMonitoring/InDetPerformanceMonitoring/share/runKShortValidation.py b/InnerDetector/InDetMonitoring/InDetPerformanceMonitoring/share/runKShortValidation.py index 826ec5c782b14b2bf29aa488e0e258b926e0a067..e2cc543b8498d743c6c9ff9e4e69d01c63c69cd0 100644 --- a/InnerDetector/InDetMonitoring/InDetPerformanceMonitoring/share/runKShortValidation.py +++ b/InnerDetector/InDetMonitoring/InDetPerformanceMonitoring/share/runKShortValidation.py @@ -156,7 +156,7 @@ iDPerfMonKshort = IDPerfMonKshort(name = 'IDPerfMonKshort', VxPrimContainerName = "PrimaryVertices", OutputLevel = DEBUG) -ToolSvc += iDPerfMonKshort +#ToolSvc += iDPerfMonKshort from AthenaMonitoring.DQMonFlags import DQMonFlags from AthenaMonitoring.AthenaMonitoringConf import AthenaMonManager diff --git a/InnerDetector/InDetMonitoring/InDetPerformanceMonitoring/share/runKShortValidation_grid.py b/InnerDetector/InDetMonitoring/InDetPerformanceMonitoring/share/runKShortValidation_grid.py index 56f6c4a7d3c9faaac83ea2d960bb2cf7a26e348e..bbd5535cde07c067115cd563b233acd79fbd49e0 100644 --- a/InnerDetector/InDetMonitoring/InDetPerformanceMonitoring/share/runKShortValidation_grid.py +++ b/InnerDetector/InDetMonitoring/InDetPerformanceMonitoring/share/runKShortValidation_grid.py @@ -156,7 +156,7 @@ iDPerfMonKshort = IDPerfMonKshort(name = 'IDPerfMonKshort', VxPrimContainerName = "PrimaryVertices", OutputLevel = DEBUG) -ToolSvc += iDPerfMonKshort +#ToolSvc += iDPerfMonKshort from AthenaMonitoring.DQMonFlags import DQMonFlags from AthenaMonitoring.AthenaMonitoringConf import AthenaMonManager diff --git a/InnerDetector/InDetMonitoring/InDetPerformanceMonitoring/share/runMonitoringZmumuValidation.py b/InnerDetector/InDetMonitoring/InDetPerformanceMonitoring/share/runMonitoringZmumuValidation.py index 2a11112a33040f8308aeb52ee3e6e0df31447204..c396b86173348d26fd4e077bce4e52dacf6b2b4d 100644 --- a/InnerDetector/InDetMonitoring/InDetPerformanceMonitoring/share/runMonitoringZmumuValidation.py +++ b/InnerDetector/InDetMonitoring/InDetPerformanceMonitoring/share/runMonitoringZmumuValidation.py @@ -166,7 +166,7 @@ ZmumuMon = DiMuMon (name = "ZmumuMon_NoTrig", doSaveFits = False, OutputLevel = VERBOSE) -ToolSvc += ZmumuMon +#ToolSvc += ZmumuMon from AthenaMonitoring.DQMonFlags import DQMonFlags from AthenaMonitoring.AthenaMonitoringConf import AthenaMonManager diff --git a/InnerDetector/InDetMonitoring/InDetPerformanceMonitoring/share/runMonitoringZmumuValidation_data.py b/InnerDetector/InDetMonitoring/InDetPerformanceMonitoring/share/runMonitoringZmumuValidation_data.py index 51ca83cbdebfa2b7a68fbe109471779eb829e2d9..82b11748409fd5b1cc408ebab1171bf65576b5fe 100644 --- a/InnerDetector/InDetMonitoring/InDetPerformanceMonitoring/share/runMonitoringZmumuValidation_data.py +++ b/InnerDetector/InDetMonitoring/InDetPerformanceMonitoring/share/runMonitoringZmumuValidation_data.py @@ -154,7 +154,7 @@ ZmumuMon = DiMuMon (name = "ZmumuMon_NoTrig", doSaveFits = False, OutputLevel = DEBUG) -ToolSvc += ZmumuMon +#ToolSvc += ZmumuMon from AthenaMonitoring.DQMonFlags import DQMonFlags from AthenaMonitoring.AthenaMonitoringConf import AthenaMonManager diff --git a/InnerDetector/InDetMonitoring/InDetPerformanceMonitoring/share/runzmumu_runallmonitoring.py b/InnerDetector/InDetMonitoring/InDetPerformanceMonitoring/share/runzmumu_runallmonitoring.py index 3b6462ed756c13944bb99c08b802fd5ec5c4a39e..770e6b404725663f99c5d440b37b4ccc9f2a1f57 100644 --- a/InnerDetector/InDetMonitoring/InDetPerformanceMonitoring/share/runzmumu_runallmonitoring.py +++ b/InnerDetector/InDetMonitoring/InDetPerformanceMonitoring/share/runzmumu_runallmonitoring.py @@ -182,7 +182,7 @@ if dimuonmon == True: doSaveFits = False, # setDebug = True, OutputLevel = INFO) - ToolSvc += ZmumuMon + #ToolSvc += ZmumuMon from AthenaMonitoring.DQMonFlags import DQMonFlags from AthenaMonitoring.AthenaMonitoringConf import AthenaMonManager diff --git a/InnerDetector/InDetMonitoring/PixelMonitoring/PixelMonitoring/PixelMainMon.h b/InnerDetector/InDetMonitoring/PixelMonitoring/PixelMonitoring/PixelMainMon.h index 1de162d00c2aedbb49b9e8edef154fddd4e3f08c..12e994d3993773bc19f67338ddb8677ea2c59c9f 100755 --- a/InnerDetector/InDetMonitoring/PixelMonitoring/PixelMonitoring/PixelMainMon.h +++ b/InnerDetector/InDetMonitoring/PixelMonitoring/PixelMonitoring/PixelMainMon.h @@ -181,6 +181,7 @@ class PixelMainMon : public ManagedMonitorToolBase { const PixelID* m_pixelid; uint64_t m_event; + uint64_t m_event5min; time_t m_startTime; bool m_majorityDisabled; // check for each event, true if >50% modules disabled @@ -196,8 +197,8 @@ class PixelMainMon : public ManagedMonitorToolBase { int m_nGood_mod[PixLayerIBL2D3DDBM::COUNT]; int m_nActive_mod[PixLayerIBL2D3DDBM::COUNT]; - unsigned int m_nRefresh; - unsigned int m_nRefresh5min; + int m_nRefresh; + int m_nRefresh5min; const AtlasDetectorID* m_idHelper; diff --git a/InnerDetector/InDetMonitoring/PixelMonitoring/src/HelperFunctions.cxx b/InnerDetector/InDetMonitoring/PixelMonitoring/src/HelperFunctions.cxx index f806c4a6cf52d1e5e5bb437f0ef2e040e14f625a..607534d1a828f0b03bf7591a3a8dfe6c4bd41ceb 100644 --- a/InnerDetector/InDetMonitoring/PixelMonitoring/src/HelperFunctions.cxx +++ b/InnerDetector/InDetMonitoring/PixelMonitoring/src/HelperFunctions.cxx @@ -206,7 +206,7 @@ void PixelMainMon::formatPP0Histos(TProfile_LW* D_A, TProfile_LW* D_C, TProfile_ } void PixelMainMon::fillPP0Histos(PixelMon2DMapsLW* occupancy, TProfile_LW* D_A, TProfile_LW* D_C, TProfile_LW* B0, TProfile_LW* B1, TProfile_LW* B2, TProfile_LW* IBL_A, TProfile_LW* IBL_C) { - if (!(D_A && D_C && B0 && B1 && B2 && occupancy && m_status && m_event)) return; + if (!(D_A && D_C && B0 && B1 && B2 && occupancy && m_status && m_event5min)) return; unsigned int nbinx; unsigned int nbiny; // use FE occ for IBL, mod occ for the rest @@ -216,7 +216,7 @@ void PixelMainMon::fillPP0Histos(PixelMon2DMapsLW* occupancy, TProfile_LW* D_A, nbiny = occupancy->IBL->GetNbinsY(); for (unsigned int x = 1; x <= nbinx; ++x) { for (unsigned int y = 1; y <= nbiny; ++y) { - const auto content = occupancy->IBL->GetBinContent(x, y) / (1.0 * m_event); + const auto content = occupancy->IBL->GetBinContent(x, y) / (1.0 * m_event5min); if (m_status->IBL->GetBinContent(x, y)!=2) { if (x>0.5*nbinx) IBL_A->Fill(y, content); else IBL_C->Fill(y, content); @@ -228,7 +228,7 @@ void PixelMainMon::fillPP0Histos(PixelMon2DMapsLW* occupancy, TProfile_LW* D_A, nbiny = occupancy->B0->GetNbinsY(); for (unsigned int x = 1; x <= nbinx; ++x) { for (unsigned int y = 1; y <= nbiny; ++y) { - const auto content = occupancy->B0->GetBinContent(x, y) / (1.0 * m_event); + const auto content = occupancy->B0->GetBinContent(x, y) / (1.0 * m_event5min); if (m_status->B0->GetBinContent(x, y)!=2) { B0->Fill(y, content); } @@ -238,7 +238,7 @@ void PixelMainMon::fillPP0Histos(PixelMon2DMapsLW* occupancy, TProfile_LW* D_A, nbiny = occupancy->B1->GetNbinsY(); for (unsigned int x = 1; x <= nbinx; ++x) { for (unsigned int y = 1; y <= nbiny; ++y) { - const auto content = occupancy->B1->GetBinContent(x, y) / (1.0 * m_event); + const auto content = occupancy->B1->GetBinContent(x, y) / (1.0 * m_event5min); if (m_status->B1->GetBinContent(x, y)!=2) { B1->Fill(y, content); } @@ -248,7 +248,7 @@ void PixelMainMon::fillPP0Histos(PixelMon2DMapsLW* occupancy, TProfile_LW* D_A, nbiny = occupancy->B2->GetNbinsY(); for (unsigned int x = 1; x <= nbinx; ++x) { for (unsigned int y = 1; y <= nbiny; ++y) { - const auto content = occupancy->B2->GetBinContent(x, y) / (1.0 * m_event); + const auto content = occupancy->B2->GetBinContent(x, y) / (1.0 * m_event5min); if (m_status->B2->GetBinContent(x, y)!=2) { B2->Fill(y, content); } @@ -258,7 +258,7 @@ void PixelMainMon::fillPP0Histos(PixelMon2DMapsLW* occupancy, TProfile_LW* D_A, nbiny = occupancy->A->GetNbinsY(); for (unsigned int x = 1; x <= nbinx; ++x) { for (unsigned int y = 1; y <= nbiny; ++y) { - const auto content = occupancy->A->GetBinContent(x, y) / (1.0 * m_event); + const auto content = occupancy->A->GetBinContent(x, y) / (1.0 * m_event5min); if (m_status->A->GetBinContent(x, y)!=2) { D_A->Fill( (x-1)*8 + (y-1)/6 + 1, content); } @@ -268,7 +268,7 @@ void PixelMainMon::fillPP0Histos(PixelMon2DMapsLW* occupancy, TProfile_LW* D_A, nbiny = occupancy->C->GetNbinsY(); for (unsigned int x = 1; x <= nbinx; ++x) { for (unsigned int y = 1; y <= nbiny; ++y) { - const auto content = occupancy->C->GetBinContent(x, y) / (1.0 * m_event); + const auto content = occupancy->C->GetBinContent(x, y) / (1.0 * m_event5min); if (m_status->C->GetBinContent(x, y)!=2) { D_C->Fill( (x-1)*8 + (y-1)/6 + 1, content); } diff --git a/InnerDetector/InDetMonitoring/PixelMonitoring/src/PixelMainMon.cxx b/InnerDetector/InDetMonitoring/PixelMonitoring/src/PixelMainMon.cxx index f3c49d28fa188003fa2d48315eb2fa93020fefea..7482d602487a6488208ee098bd8f33cfaa85db42 100755 --- a/InnerDetector/InDetMonitoring/PixelMonitoring/src/PixelMainMon.cxx +++ b/InnerDetector/InDetMonitoring/PixelMonitoring/src/PixelMainMon.cxx @@ -123,6 +123,7 @@ PixelMainMon::PixelMainMon(const std::string& type, const std::string& name, con memset(m_nActive_mod, 0, sizeof(m_nActive_mod)); m_pixelid = 0; m_event = 0; + m_event5min = 0; m_startTime = 0; m_majorityDisabled = 0; m_lumiBlockNum = 0; @@ -710,10 +711,12 @@ StatusCode PixelMainMon::fillHistograms() { if(!(thisEventInfo.isValid())) { if (msgLvl(MSG::WARNING)) msg(MSG::WARNING) << "No EventInfo object found" << endmsg; } else { + m_currentTime = thisEventInfo->timeStamp(); m_currentBCID = thisEventInfo->bcid(); - unsigned int currentdiff = (m_currentTime - m_firstBookTime) / 100; - unsigned int currentdiff5min = (m_currentTime - m_firstBookTime) / 300; + int currentdiff = (int)(m_currentTime - m_firstBookTime) / 100; + int currentdiff5min = (int)(m_currentTime - m_firstBookTime) / 300; + // for 100 sec if (currentdiff > m_nRefresh) { m_doRefresh = true; @@ -725,8 +728,10 @@ StatusCode PixelMainMon::fillHistograms() { if (currentdiff5min > m_nRefresh5min) { m_doRefresh5min = true; m_nRefresh5min = currentdiff5min; + m_event5min = 1; } else { m_doRefresh5min = false; + m_event5min++; } } diff --git a/InnerDetector/InDetMonitoring/SCT_Monitoring/share/SCTMonitor_topOptions.py b/InnerDetector/InDetMonitoring/SCT_Monitoring/share/SCTMonitor_topOptions.py index 9689976b558063c6498a7bc3d5e40adc9e85d3d2..97d95b20c35abaeaa3e07ec2baf860e3a19365e5 100644 --- a/InnerDetector/InDetMonitoring/SCT_Monitoring/share/SCTMonitor_topOptions.py +++ b/InnerDetector/InDetMonitoring/SCT_Monitoring/share/SCTMonitor_topOptions.py @@ -71,7 +71,7 @@ from SCT_Monitoring.SCT_MonitoringConf import SCTInitialiseTool SCTInitTool = SCTInitialiseTool ( name = "SCTInitialiseTool" ) -ToolSvc += SCTInitTool +#ToolSvc += SCTInitTool SCTMonMan.AthenaMonTools += [SCTInitTool] #from AthenaCommon.AppMgr import ToolSvc as toolSvc @@ -89,7 +89,7 @@ SCTHitsTool.tracksName=InDetKeys.SCTTracks() #SCTHitsTool.tracksName="ExtendedTracks" -ToolSvc += SCTHitsTool +#ToolSvc += SCTHitsTool SCTMonMan.AthenaMonTools += [SCTHitsTool] from SCT_Monitoring.SCT_MonitoringConf import SCTTracksMonTool @@ -105,7 +105,7 @@ SCTTracksMonTool.CheckRate= 1000; SCTTracksMonTool.doPositiveEndcap= True; SCTTracksMonTool.doNegativeEndcap= True; SCTTracksMonTool.doUnbiasedCalc= True; -ToolSvc += SCTTracksMonTool; +#ToolSvc += SCTTracksMonTool; SCTMonMan.AthenaMonTools += [SCTTracksMonTool] from SCT_Monitoring.SCT_MonitoringConf import SCTErrMonTool @@ -117,7 +117,7 @@ SCTErrMonTool.histoPathBase="/stat"; SCTErrMonTool.CheckRate= 1000; SCTErrMonTool.doPositiveEndcap= True; SCTErrMonTool.doNegativeEndcap= True; -ToolSvc += SCTErrMonTool; +#ToolSvc += SCTErrMonTool; SCTMonMan.AthenaMonTools +=[SCTErrMonTool] @@ -154,7 +154,7 @@ if (InDetFlags.doPrintConfigurables()): SCTHitEffMonTool.HoleSearch=SCT_MonHoleSearch if globalflags.DataSource != "data": SCTHitEffMonTool.IsSim = True -ToolSvc+=SCTHitEffMonTool +#ToolSvc+=SCTHitEffMonTool SCTMonMan.AthenaMonTools += [SCTHitEffMonTool] from SCT_Monitoring.SCT_MonitoringConf import SCTTimeDependentMonTool diff --git a/InnerDetector/InDetRawEvent/InDetSimData/CMakeLists.txt b/InnerDetector/InDetRawEvent/InDetSimData/CMakeLists.txt index af0635263f47ff3bd98841aa143f68c10412c957..59c726afa36922e627ff0cbb6e0faeb056d68dd2 100644 --- a/InnerDetector/InDetRawEvent/InDetSimData/CMakeLists.txt +++ b/InnerDetector/InDetRawEvent/InDetSimData/CMakeLists.txt @@ -7,8 +7,7 @@ atlas_subdir( InDetSimData ) # Declare the package's dependencies: atlas_depends_on_subdirs( PUBLIC - Control/CLIDSvc - Control/SGTools + Control/AthenaKernel DetectorDescription/Identifier Generators/GeneratorObjects ) @@ -21,12 +20,12 @@ atlas_add_library( InDetSimData src/InDetSimDataCollection.cxx PUBLIC_HEADERS InDetSimData PRIVATE_INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} - LINK_LIBRARIES SGTools Identifier GeneratorObjects + LINK_LIBRARIES AthenaKernel Identifier GeneratorObjects PRIVATE_LINK_LIBRARIES ${ROOT_LIBRARIES} ) atlas_add_dictionary( InDetSimDataDict InDetSimData/InDetSimDataDict.h InDetSimData/selection.xml INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} - LINK_LIBRARIES ${ROOT_LIBRARIES} SGTools Identifier GeneratorObjects InDetSimData ) + LINK_LIBRARIES ${ROOT_LIBRARIES} Identifier GeneratorObjects InDetSimData ) diff --git a/InnerDetector/InDetRawEvent/InDetSimData/InDetSimData/InDetSimDataCollection.h b/InnerDetector/InDetRawEvent/InDetSimData/InDetSimData/InDetSimDataCollection.h index 0b9be947b512fc4deabdce5a6d9e9525dfbd978f..a282f8dfadb5683a6cbf43fbb92958b1a0469db1 100755 --- a/InnerDetector/InDetRawEvent/InDetSimData/InDetSimData/InDetSimDataCollection.h +++ b/InnerDetector/InDetRawEvent/InDetSimData/InDetSimData/InDetSimDataCollection.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration */ /*************************************************************************** @@ -14,7 +14,7 @@ # define INDETSIMDATA_INDETSIMDATACOLLECTION_H //<<<<<< INCLUDES >>>>>> -#include "CLIDSvc/CLASS_DEF.h" +#include "AthenaKernel/CLASS_DEF.h" #include "InDetSimData/InDetSimData.h" #include "Identifier/Identifier.h" #include <map> diff --git a/InnerDetector/InDetValidation/InDetPhysValMonitoring/run/PhysValITk_jobOptions.py b/InnerDetector/InDetValidation/InDetPhysValMonitoring/run/PhysValITk_jobOptions.py index 3c7f1523cd18390ba4202ab6948d156923e6a63c..1d0a386e0fea5fc4c8ce151e1652fa6fa80a43ed 100644 --- a/InnerDetector/InDetValidation/InDetPhysValMonitoring/run/PhysValITk_jobOptions.py +++ b/InnerDetector/InDetValidation/InDetPhysValMonitoring/run/PhysValITk_jobOptions.py @@ -214,7 +214,7 @@ InDetPhysValMonitoringTool.TruthParticleContainerName = "TruthParticles" # this will run over hardscatter tracks only: #InDetPhysValMonitoringTool.PileupSwitch = "HardScatter" InDetPhysValMonitoringTool.OutputLevel = INFO -ToolSvc += InDetPhysValMonitoringTool +#ToolSvc += InDetPhysValMonitoringTool monMan.AthenaMonTools += [InDetPhysValMonitoringTool] diff --git a/InnerDetector/InDetValidation/PixelRTT/share/PixelRTT_DigitizationValidation.py b/InnerDetector/InDetValidation/PixelRTT/share/PixelRTT_DigitizationValidation.py index 3e0e806bda158ee0d837d5ee0f8dfe624fc8347e..768262bf277a2aea741d1e4655405f2af8733c85 100644 --- a/InnerDetector/InDetValidation/PixelRTT/share/PixelRTT_DigitizationValidation.py +++ b/InnerDetector/InDetValidation/PixelRTT/share/PixelRTT_DigitizationValidation.py @@ -127,7 +127,7 @@ monMan = AthenaMonManager( "PixelMonManager" ) from PixelMonitoring.PixelMonitoringConf import * PixelMainsMon=PixelMainMon() -ToolSvc += PixelMainsMon +#ToolSvc += PixelMainsMon monMan.AthenaMonTools += [ PixelMainsMon ] print PixelMainsMon diff --git a/InnerDetector/InDetValidation/PixelRTT/share/PixelRTT_SimulationValidation.py b/InnerDetector/InDetValidation/PixelRTT/share/PixelRTT_SimulationValidation.py index 391db092dbe37e639c5bf2d03c753ea5345dc214..d669945428180f6c5f109c1a1616d60c44d49a51 100644 --- a/InnerDetector/InDetValidation/PixelRTT/share/PixelRTT_SimulationValidation.py +++ b/InnerDetector/InDetValidation/PixelRTT/share/PixelRTT_SimulationValidation.py @@ -207,7 +207,7 @@ monMan = AthenaMonManager( "PixelMonManager" ) from PixelMonitoring.PixelMonitoringConf import * PixelMainsMon=PixelMainMon() -ToolSvc += PixelMainsMon +#ToolSvc += PixelMainsMon monMan.AthenaMonTools += [ PixelMainsMon ] print PixelMainsMon diff --git a/LArCalorimeter/LArCOOLConditions/LArCOOLConditions/LArHVScaleCorrFlat.h b/LArCalorimeter/LArCOOLConditions/LArCOOLConditions/LArHVScaleCorrFlat.h index e7786b4a4e0f3c71169d5f667ebfbb50b9e40047..d4efd17665e292aa51e25cdf1a6394e0451796e5 100644 --- a/LArCalorimeter/LArCOOLConditions/LArCOOLConditions/LArHVScaleCorrFlat.h +++ b/LArCalorimeter/LArCOOLConditions/LArCOOLConditions/LArHVScaleCorrFlat.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration */ // Dear emacs, this is -*-c++-*- diff --git a/LArCalorimeter/LArCOOLConditions/src/LArHVScaleCorrFlat.cxx b/LArCalorimeter/LArCOOLConditions/src/LArHVScaleCorrFlat.cxx index 63a4b723e3449f0d10ed67108319f282c7b7c7e2..789143e6dbfe0822a376fd56fc5c335a4a652ddd 100644 --- a/LArCalorimeter/LArCOOLConditions/src/LArHVScaleCorrFlat.cxx +++ b/LArCalorimeter/LArCOOLConditions/src/LArHVScaleCorrFlat.cxx @@ -27,12 +27,13 @@ LArHVScaleCorrFlat::LArHVScaleCorrFlat(const CondAttrListCollection* attrList) { return; } + const float& LArHVScaleCorrFlat::HVScaleCorr(const HWIdentifier& chid) const { return getDataByHash(m_onlineHelper->channel_Hash(chid),0); } - // retrieving HVScaleCorr using offline ID +// retrieving HVScaleCorr using offline ID const float& LArHVScaleCorrFlat::HVScaleCorr(const Identifier& id) const { const HWIdentifier OnId = m_larCablingSvc->createSignalChannelID(id); return HVScaleCorr(OnId); diff --git a/LArCalorimeter/LArCafJobs/share/skeleton.LArNoise_fromraw.py b/LArCalorimeter/LArCafJobs/share/skeleton.LArNoise_fromraw.py index ad0f4dc6367a69019a2a8e27f47514783e65a56b..3db84b6326d316cd16c6f953b2bf8c26977ea2fe 100644 --- a/LArCalorimeter/LArCafJobs/share/skeleton.LArNoise_fromraw.py +++ b/LArCalorimeter/LArCafJobs/share/skeleton.LArNoise_fromraw.py @@ -313,7 +313,7 @@ if hasattr(runArgs,"outputHIST_LARNOISEFile"): theLArNoisyROMon.doHisto = True #theLArNoisyROMon.OutputLevel = DEBUG - ToolSvc += theLArNoisyROMon + #ToolSvc += theLArNoisyROMon from AthenaMonitoring.AthenaMonitoringConf import AthenaMonManager larRawMon=False larESDMon=True diff --git a/LArCalorimeter/LArCellRec/CMakeLists.txt b/LArCalorimeter/LArCellRec/CMakeLists.txt index 399532e7cb1d5b3b4a69d3513effa78fd7166b5a..5796f76f16b695d87ff36a7d509314ff48b9e98b 100644 --- a/LArCalorimeter/LArCellRec/CMakeLists.txt +++ b/LArCalorimeter/LArCellRec/CMakeLists.txt @@ -25,6 +25,7 @@ atlas_depends_on_subdirs( PUBLIC LArCalorimeter/LArIdentifier LArCalorimeter/LArRawEvent LArCalorimeter/LArRecConditions + LArCalorimeter/LArCOOLConditions LArCalorimeter/LArSimEvent Event/xAOD/xAODTrigL1Calo PRIVATE @@ -34,6 +35,7 @@ atlas_depends_on_subdirs( PUBLIC Generators/GeneratorObjects LArCalorimeter/LArRecEvent LArCalorimeter/LArCabling + LArCalorimeter/LArCOOLConditions Trigger/TrigT1/TrigT1CaloCalibConditions Trigger/TrigT1/TrigT1CaloCondSvc ) @@ -48,17 +50,17 @@ atlas_add_component( LArCellRec src/*.cxx src/components/*.cxx INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} ${CLHEP_INCLUDE_DIRS} ${HEPMC_INCLUDE_DIRS} ${TBB_INCLUDE_DIRS} - LINK_LIBRARIES ${ROOT_LIBRARIES} ${CLHEP_LIBRARIES} ${HEPMC_LIBRARIES} ${TBB_LIBRARIES} CaloConditions CaloDetDescrLib CaloEvent CaloIdentifier CaloRecLib CaloUtilsLib AthAllocators AthenaBaseComps AthenaKernel StoreGateLib SGtests AtlasDetDescr Identifier GaudiKernel LArIdentifier LArRawEvent LArRecConditions LArSimEvent CaloTriggerToolLib AthenaPoolUtilities xAODEventInfo xAODTrigL1Calo GeneratorObjects LArRecEvent LArCablingLib TrigT1CaloCalibConditions TrigT1CaloCondSvcLib ) + LINK_LIBRARIES ${ROOT_LIBRARIES} ${CLHEP_LIBRARIES} ${HEPMC_LIBRARIES} ${TBB_LIBRARIES} CaloConditions CaloDetDescrLib CaloEvent CaloIdentifier CaloRecLib CaloUtilsLib AthAllocators AthenaBaseComps AthenaKernel StoreGateLib SGtests AtlasDetDescr Identifier GaudiKernel LArIdentifier LArRawEvent LArRecConditions LArCOOLConditions LArSimEvent CaloTriggerToolLib AthenaPoolUtilities xAODEventInfo xAODTrigL1Calo GeneratorObjects LArRecEvent LArCablingLib TrigT1CaloCalibConditions TrigT1CaloCondSvcLib ) # Install files from the package: atlas_install_python_modules( python/*.py ) atlas_install_joboptions( share/*.py ) -atlas_add_test( LArBadFebMaskingTool_test - SCRIPT test/LArBadFebMaskingTool_test.sh - PROPERTIES TIMEOUT 600 - EXTRA_PATTERNS "LArDetectorToolNV|is still valid|no data retrieved|Database being retired|Reading file|Unable to locate catalog|Resolved path|DigitizationFlags|^Domain|created CondCont|no dictionary for class|^ +[+]|Reading LArPedestalMC|IOV callback|^DetectorStore|Cache alignment" ) +#atlas_add_test( LArBadFebMaskingTool_test +# SCRIPT test/LArBadFebMaskingTool_test.sh +# PROPERTIES TIMEOUT 600 +# EXTRA_PATTERNS "LArDetectorToolNV|is still valid|no data retrieved|Database being retired|Reading file|Unable to locate catalog|Resolved path|DigitizationFlags|^Domain|created CondCont|no dictionary for class|^ +[+]|Reading LArPedestalMC|IOV callback|^DetectorStore|Cache alignment" ) #atlas_add_test( LArCellDeadOTXCorr_test diff --git a/LArCalorimeter/LArCellRec/python/LArCellHVCorrDefault.py b/LArCalorimeter/LArCellRec/python/LArCellHVCorrDefault.py index d1be6a9c05b4642dd205c7349adf43e825f4a174..9bbdc84e67eb093dd6bf7227814b0b34f39577d2 100644 --- a/LArCalorimeter/LArCellRec/python/LArCellHVCorrDefault.py +++ b/LArCalorimeter/LArCellRec/python/LArCellHVCorrDefault.py @@ -18,6 +18,6 @@ def LArCellHVCorrDefault(name="LArCellHVCorrDefault"): from LArCellRec.LArCellRecConf import LArCellHVCorr theLArCellHVCorr = LArCellHVCorr(name) theLArCellHVCorr.HVCorrTool = theLArHVCorrTool - + svcMgr.ToolSvc += theLArCellHVCorr return theLArCellHVCorr diff --git a/LArCalorimeter/LArCellRec/src/LArBadFebMaskingTool.cxx b/LArCalorimeter/LArCellRec/src/LArBadFebMaskingTool.cxx index 2563520ad9c68e1bad952619b3465316bd824de2..58edf650cd1e848b381b555328615d8c843672bd 100644 --- a/LArCalorimeter/LArCellRec/src/LArBadFebMaskingTool.cxx +++ b/LArCalorimeter/LArCellRec/src/LArBadFebMaskingTool.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration */ /******************************************************************** @@ -23,9 +23,7 @@ PURPOSE: #include "CaloIdentifier/CaloCell_ID.h" #include "LArRawEvent/LArFebErrorSummary.h" #include "LArIdentifier/LArOnlineID.h" -#include "LArRecConditions/ILArBadChanTool.h" #include "LArRecConditions/LArBadFeb.h" -#include "LArCabling/LArCablingService.h" #include "LArRecEvent/LArEventBitInfo.h" #include "xAODEventInfo/EventInfo.h" #include "GaudiKernel/ThreadLocalContext.h" @@ -41,8 +39,6 @@ LArBadFebMaskingTool::LArBadFebMaskingTool( const std::string& name, const IInterface* parent) :base_class(type, name, parent), - m_badChannelTool(""), - m_cablingService("LArCablingService"), m_maskParity(true),m_maskSampleHeader(true),m_maskEVTID(true),m_maskScacStatus(true), m_maskScaOutOfRange(true),m_maskGainMismatch(true),m_maskTypeMismatch(true),m_maskNumOfSamples(true), m_maskEmptyDataBlock(true),m_maskDspBlockSize(true),m_maskCheckSum(true),m_maskMissingHeader(true), @@ -54,7 +50,6 @@ LArBadFebMaskingTool::LArBadFebMaskingTool( m_evt(0), m_mask(0) { - declareProperty("badChannelTool",m_badChannelTool); declareProperty("maskParity",m_maskParity); declareProperty("maskSampleHeader",m_maskSampleHeader); declareProperty("maskEVTID",m_maskEVTID); @@ -109,14 +104,10 @@ StatusCode LArBadFebMaskingTool::initialize() ATH_CHECK( detStore()->retrieve( caloIdMgr ) ); m_calo_id = caloIdMgr->getCaloCell_ID(); - // translate offline ID into online ID - ATH_CHECK( m_cablingService.retrieve() ); + ATH_CHECK( m_badFebKey.initialize()); + ATH_CHECK( m_cablingKey.initialize()); ATH_CHECK( detStore()->retrieve(m_onlineID, "LArOnlineID") ); - if (!m_badChannelTool.empty()) { - ATH_CHECK( m_badChannelTool.retrieve() ); - } - return StatusCode::SUCCESS; } @@ -166,6 +157,14 @@ StatusCode LArBadFebMaskingTool::process(CaloCellContainer * theCont ) flagBadEvent = true; } + + SG::ReadCondHandle<LArOnOffIdMapping> cablingHdl{m_cablingKey,ctx}; + const LArOnOffIdMapping* cabling=*cablingHdl; + + SG::ReadCondHandle<LArBadFebCont> badFebHdl{m_badFebKey,ctx}; + const LArBadFebCont* badFebs=*badFebHdl; + + // loop over all Febs std::vector<HWIdentifier>::const_iterator feb = m_onlineID->feb_begin(); @@ -190,12 +189,12 @@ StatusCode LArBadFebMaskingTool::process(CaloCellContainer * theCont ) ATH_MSG_DEBUG (" ierror,toMask " << ierror << " " << toMask1 << " "); } - if (!m_badChannelTool.empty()) { - LArBadFeb febstatus = m_badChannelTool->febStatus(febId); - inError = febstatus.inError(); - isDead = ( febstatus.deadReadout() | febstatus.deadAll() ); - ATH_MSG_DEBUG (" inError, isDead " << inError << " " << isDead); - } + + LArBadFeb febstatus = badFebs->status(febId); + inError = febstatus.inError(); + isDead = ( febstatus.deadReadout() | febstatus.deadAll() ); + ATH_MSG_DEBUG (" inError, isDead " << inError << " " << isDead); + if (toMask1 && !inError && !isDead) nbOfFebsInError = nbOfFebsInError + 1; @@ -203,8 +202,8 @@ StatusCode LArBadFebMaskingTool::process(CaloCellContainer * theCont ) m_mask++; for (int ch=0; ch<128; ++ch) { HWIdentifier hwid = m_onlineID->channel_Id(febId, ch); - if (m_cablingService->isOnlineConnected(hwid)) { - Identifier id = m_cablingService->cnvToIdentifier( hwid); + if (cabling->isOnlineConnected(hwid)) { + Identifier id = cabling->cnvToIdentifier( hwid); IdentifierHash theCellHashID = m_calo_id->calo_cell_hash(id); int index = theCont->findIndex(theCellHashID); if (index<0) { diff --git a/LArCalorimeter/LArCellRec/src/LArBadFebMaskingTool.h b/LArCalorimeter/LArCellRec/src/LArBadFebMaskingTool.h index 94339be06ff1601e29f02dd4c9e0cf5ee37293bc..d797bf40802f8fdffff521e873866af0ef18fd5b 100755 --- a/LArCalorimeter/LArCellRec/src/LArBadFebMaskingTool.h +++ b/LArCalorimeter/LArCellRec/src/LArBadFebMaskingTool.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration */ #ifndef LARCELLREC_LArBadFebMaskingTool_H @@ -19,17 +19,15 @@ #include "AthenaBaseComps/AthAlgTool.h" -#include "GaudiKernel/ToolHandle.h" #include "CaloInterface/ICaloCellMakerTool.h" -#include "AthenaKernel/IOVSvcDefs.h" #include "StoreGate/ReadHandleKey.h" -#include "LArRecConditions/ILArBadChanTool.h" +#include "StoreGate/ReadCondHandleKey.h" +#include "LArRecConditions/LArBadChannelCont.h" +#include "LArCabling/LArOnOffIdMapping.h" #include "xAODEventInfo/EventInfo.h" #include <atomic> -class LArCablingService; -class StoreGateSvc; class CaloCell_ID; class LArOnlineID; class LArFebErrorSummary; @@ -58,12 +56,13 @@ public: private: - /** handle to bad channel tool (to get problematic Feb into) + /** handle to get bad febs */ - ToolHandle<ILArBadChanTool> m_badChannelTool; - /** handle to LAr cabling service + SG::ReadCondHandleKey<LArBadFebCont> m_badFebKey{this,"BadFebKey","LArBadFeb","Key of Bad-Feb object"}; + /** handle to LAr cabling */ - ToolHandle<LArCablingService> m_cablingService; + SG::ReadCondHandleKey<LArOnOffIdMapping> m_cablingKey{this,"CablingKey","LArOnOffIdMap","SG Key of LArOnOffIdMapping object"}; + /** flags to select which errors to mask */ bool m_maskParity; diff --git a/LArCalorimeter/LArCellRec/src/LArCellDeadOTXCorr.h b/LArCalorimeter/LArCellRec/src/LArCellDeadOTXCorr.h index 7bf087626fd5add91e85070a065483c45605e2fb..ce74fb5c8aeeb521b0fa8e1914b3f27ab45885cc 100644 --- a/LArCalorimeter/LArCellRec/src/LArCellDeadOTXCorr.h +++ b/LArCalorimeter/LArCellRec/src/LArCellDeadOTXCorr.h @@ -31,12 +31,9 @@ // Headerfile #include "AthenaBaseComps/AthAlgTool.h" -//#include "GaudiKernel/ToolHandle.h" #include "GaudiKernel/Property.h" -//#include "StoreGate/StoreGateSvc.h" #include "StoreGate/ReadHandleKey.h" #include "CaloInterface/ICaloCellMakerTool.h" -//#include "AthenaKernel/IOVSvcDefs.h" #include "Identifier/Identifier.h" #include "CaloConditions/Array.h" #include "CaloRec/ToolWithConstantsMixin.h" @@ -53,12 +50,10 @@ #include <map> #include <atomic> -class LArCablingService; class StoreGateSvc; class CaloCell_ID; class LArOnlineID; class CaloLVL1_ID; -class ILArBadChanTool; class CaloTriggerTowerService; // class L1CaloTTIdTools; class CaloIdManager; @@ -99,13 +94,6 @@ class LArCellDeadOTXCorr private: - - - // get a handle to the tool helper - - //ToolHandle<ILArBadChanTool> m_badChannelTool; - //ToolHandle<LArCablingService> m_cablingService; - SG::ReadCondHandleKey<LArBadFebCont> m_badFebKey{this,"BadFebKey","LArBadFeb","Key of Bad-Feb object"}; SG::ReadCondHandleKey<LArOnOffIdMapping> m_cablingKey{this, "CablingKey", "LArOnOffIdMap","Cabling key"}; //std::string m_TTLocation; diff --git a/LArCalorimeter/LArCellRec/src/LArCellGainPathology.cxx b/LArCalorimeter/LArCellRec/src/LArCellGainPathology.cxx index 9eb09605cf524d9761180947afac81d2dce4a327..b05cf4dd6f7daf2f27008ab76f2c0cc1b3cccd84 100644 --- a/LArCalorimeter/LArCellRec/src/LArCellGainPathology.cxx +++ b/LArCalorimeter/LArCellRec/src/LArCellGainPathology.cxx @@ -24,7 +24,6 @@ PURPOSE: #include "CaloIdentifier/CaloCell_ID.h" #include "LArRawEvent/LArFebErrorSummary.h" #include "LArIdentifier/LArOnlineID.h" -#include "LArCabling/LArCablingService.h" ///////////////////////////////////////////////////////////////////// @@ -36,7 +35,6 @@ LArCellGainPathology::LArCellGainPathology( const std::string& name, const IInterface* parent) : AthAlgTool(type, name, parent), - m_cablingService("LArCablingService"), m_calo_id(nullptr), m_onlineID(nullptr) { @@ -57,7 +55,7 @@ StatusCode LArCellGainPathology::initialize() m_calo_id = caloIdMgr->getCaloCell_ID(); // translate offline ID into online ID - ATH_CHECK( m_cablingService.retrieve() ); + ATH_CHECK( m_cablingKey.initialize()); ATH_CHECK( detStore()->retrieve(m_onlineID, "LArOnlineID") ); return StatusCode::SUCCESS; @@ -72,6 +70,9 @@ StatusCode LArCellGainPathology::process(CaloCellContainer * theCont ) { ATH_MSG_DEBUG (" in LArCellGainPathology::process "); + SG::ReadCondHandle<LArOnOffIdMapping> cablingHdl{m_cablingKey}; + const LArOnOffIdMapping* cabling=*cablingHdl; + // loop over all Febs std::vector<HWIdentifier>::const_iterator feb = m_onlineID->feb_begin(); @@ -79,32 +80,29 @@ StatusCode LArCellGainPathology::process(CaloCellContainer * theCont ) for ( ; feb != feb_end; feb++) { - - // for debug - HWIdentifier febId = (*feb); - unsigned int ifeb = febId.get_identifier32().get_compact(); - ATH_MSG_DEBUG (" process Feb: " << ifeb << " "); + ATH_MSG_DEBUG (" process Feb: " << + feb->get_identifier32().get_compact()); // get information for channel 0-63 64-127 for (int i=0;i<2;i++) { int cha1 = i*64; int cha2 = i*64+63; - HWIdentifier hwid1 = m_onlineID->channel_Id(febId,cha1); - HWIdentifier hwid2 = m_onlineID->channel_Id(febId,cha2); - this->ApplyPathology(theCont,hwid1,hwid2); + HWIdentifier hwid1 = m_onlineID->channel_Id(*feb,cha1); + HWIdentifier hwid2 = m_onlineID->channel_Id(*feb,cha2); + this->ApplyPathology(theCont,hwid1,hwid2,cabling); } } return StatusCode::SUCCESS; } -void LArCellGainPathology::ApplyPathology(CaloCellContainer* theCont, HWIdentifier id1, HWIdentifier id2) +void LArCellGainPathology::ApplyPathology(CaloCellContainer* theCont, HWIdentifier id1, HWIdentifier id2,const LArOnOffIdMapping* cabling) { - CaloCell* cell1 = this->GetCell(theCont, id1); - CaloCell* cell2 = this->GetCell(theCont, id2); + CaloCell* cell1 = this->GetCell(theCont, id1,cabling); + CaloCell* cell2 = this->GetCell(theCont, id2,cabling); if (!cell1 || !cell2) return; @@ -135,11 +133,11 @@ void LArCellGainPathology::ApplyPathology(CaloCellContainer* theCont, HWIdentifi } -CaloCell* LArCellGainPathology::GetCell(CaloCellContainer* theCont, HWIdentifier id) +CaloCell* LArCellGainPathology::GetCell(CaloCellContainer* theCont, HWIdentifier id,const LArOnOffIdMapping* cabling) { CaloCell* aCell =0; - if (m_cablingService->isOnlineConnected(id)) { - Identifier id_off = m_cablingService->cnvToIdentifier(id); + if (cabling->isOnlineConnected(id)) { + Identifier id_off = cabling->cnvToIdentifier(id); IdentifierHash theCellHashID = m_calo_id->calo_cell_hash(id_off); int index = theCont->findIndex(theCellHashID); if (index>=0) { diff --git a/LArCalorimeter/LArCellRec/src/LArCellGainPathology.h b/LArCalorimeter/LArCellRec/src/LArCellGainPathology.h index d5df7db06032a10e73f7b29e10fb8fce9e2d9e47..e296b8b5059cebf27556819895be7934d57a2533 100644 --- a/LArCalorimeter/LArCellRec/src/LArCellGainPathology.h +++ b/LArCalorimeter/LArCellRec/src/LArCellGainPathology.h @@ -16,15 +16,13 @@ #include "AthenaBaseComps/AthAlgTool.h" -#include "GaudiKernel/ToolHandle.h" #include "CaloInterface/ICaloCellMakerTool.h" -#include "AthenaKernel/IOVSvcDefs.h" +#include "StoreGate/ReadCondHandleKey.h" +#include "LArCabling/LArOnOffIdMapping.h" + -class LArCablingService; -class StoreGateSvc; class CaloCell_ID; class LArOnlineID; -class ILArBadChanTool; class HWIdentifier; class CaloCell; @@ -52,15 +50,17 @@ public: private: /** method to apply pathology between a couple of cells */ - void ApplyPathology(CaloCellContainer* theCont, HWIdentifier id1, HWIdentifier id2); + void ApplyPathology(CaloCellContainer* theCont, HWIdentifier id1, HWIdentifier id, + const LArOnOffIdMapping* cabling); /** method to find cell from hardware id */ - CaloCell* GetCell(CaloCellContainer* theCont, HWIdentifier id); + CaloCell* GetCell(CaloCellContainer* theCont, HWIdentifier id, + const LArOnOffIdMapping* cabling); /** handle to LAr cabling service */ - ToolHandle<LArCablingService> m_cablingService; + SG::ReadCondHandleKey<LArOnOffIdMapping> m_cablingKey{this,"CablingKey","LArOnOffIdMap","SG Key of LArOnOffIdMapping object"}; /** pointers to storegateSvc and identifier helpers */ diff --git a/LArCalorimeter/LArCellRec/src/LArCellHVCorrAlg.cxx b/LArCalorimeter/LArCellRec/src/LArCellHVCorrAlg.cxx new file mode 100644 index 0000000000000000000000000000000000000000..9a21e3e0a1799f4616844567b168ffbb7af1751b --- /dev/null +++ b/LArCalorimeter/LArCellRec/src/LArCellHVCorrAlg.cxx @@ -0,0 +1,105 @@ +/* + Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration +*/ + +#include "LArCellHVCorrAlg.h" +#include "CaloEvent/CaloCell.h" +#include "CaloEvent/CaloCellContainer.h" + + +LArCellHVCorrAlg::LArCellHVCorrAlg (const std::string& type, + const std::string& name, + const IInterface* parent) : + CaloCellCorrection(type, name, parent) +{ + declareInterface<CaloCellCorrection>(this); +} + + +LArCellHVCorrAlg::~LArCellHVCorrAlg() {} + + +StatusCode LArCellHVCorrAlg::initialize() { + + ATH_CHECK(m_offlineHVScaleCorrKey.initialize()); + + return StatusCode::SUCCESS; +} + +StatusCode LArCellHVCorrAlg::execute(CaloCellContainer* cellCollection, const EventContext& ctx) const { + + // get offline HVScaleCorr + SG::ReadCondHandle<ILArHVScaleCorr> oflHVCorrHdl(m_offlineHVScaleCorrKey); + const ILArHVScaleCorr *oflHVCorr = *oflHVCorrHdl; + if(!oflHVCorr) { + ATH_MSG_ERROR("Do not have ofline HV corr. conditions object !!!!"); + return StatusCode::FAILURE; + } + + ATH_MSG_DEBUG("Executing CaloCellCorrection"); + + if (!cellCollection) { + ATH_MSG_ERROR( "Cell Correction tool receives invalid cell Collection" ); + return StatusCode::FAILURE; + } + + // Loop over all the CaloCell Objects and call Make Correction. + + for (CaloCell* cell : *cellCollection) { + MakeCorrection ( cell, ctx, oflHVCorr ); + } + + // Done, Return success + + return StatusCode::SUCCESS; + +} + + +void LArCellHVCorrAlg::MakeCorrection (CaloCell* theCell, + const EventContext& /*ctx*/) const // this method will be removed soon, but kept to make CI happy +{ + // get offline HVScaleCorr + SG::ReadCondHandle<ILArHVScaleCorr> oflHVCorrHdl(m_offlineHVScaleCorrKey); + const ILArHVScaleCorr *oflHVCorr = *oflHVCorrHdl; + if(!oflHVCorr) { + ATH_MSG_ERROR("Do not have ofline HV corr. conditions object !!!!"); + return; + } + float hvcorr = oflHVCorr->HVScaleCorr(theCell->ID()); + + if (hvcorr<0.9 ) { + if (hvcorr<0.4) { + ATH_MSG_WARNING( "HV corr for cell with id " << theCell->ID().get_identifier32().get_compact() + << " = " << hvcorr ); + } else ATH_MSG_DEBUG( "HV corr for cell with id " << theCell->ID().get_identifier32().get_compact() + << " = " << hvcorr ); + } + + + //hvcorr might be zero in case of problems with the DCS database + //we are not interested in corrections less the 1% + if (hvcorr<0.01) hvcorr=1.0; + + theCell->setEnergy(theCell->energy()*hvcorr); +} + +void LArCellHVCorrAlg::MakeCorrection (CaloCell* theCell, + const EventContext& /*ctx*/, const ILArHVScaleCorr* oflHVCorr ) const +{ + float hvcorr = oflHVCorr->HVScaleCorr(theCell->ID()); + + if (hvcorr<0.9 ) { + if (hvcorr<0.4) { + ATH_MSG_WARNING( "HV corr for cell with id " << theCell->ID().get_identifier32().get_compact() + << " = " << hvcorr ); + } else ATH_MSG_DEBUG( "HV corr for cell with id " << theCell->ID().get_identifier32().get_compact() + << " = " << hvcorr ); + } + + + //hvcorr might be zero in case of problems with the DCS database + if (hvcorr<0.01) hvcorr=1.0; + + theCell->setEnergy(theCell->energy()*hvcorr); +} diff --git a/LArCalorimeter/LArCellRec/src/LArCellHVCorrAlg.h b/LArCalorimeter/LArCellRec/src/LArCellHVCorrAlg.h new file mode 100644 index 0000000000000000000000000000000000000000..bc8571587f43c042c2f655381f25994c462cae33 --- /dev/null +++ b/LArCalorimeter/LArCellRec/src/LArCellHVCorrAlg.h @@ -0,0 +1,44 @@ +/* + Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration +*/ + +#ifndef LARCELLREC_LARCELLHVCORRALG_H +#define LARCELLREC_LARCELLHVCORRALG_H + + +#include "CaloUtils/CaloCellCorrection.h" +#include "GaudiKernel/ToolHandle.h" +#include "LArElecCalib/ILArHVScaleCorr.h" +#include "LArElecCalib/ILArCellHVCorrTool.h" +#include "StoreGate/ReadCondHandleKey.h" + +class CaloCell; +class CaloCellContainer; + + +class LArCellHVCorrAlg : public CaloCellCorrection { + +public: + + LArCellHVCorrAlg (const std::string& type, const std::string& name, + const IInterface* parent); + + ~LArCellHVCorrAlg(); + virtual StatusCode initialize() override final; + virtual StatusCode execute(CaloCellContainer* cellCollection, const EventContext& ctx) const override final; + + + //Implements the CaloCellCorrection interface + virtual void MakeCorrection (CaloCell* /*theCell*/, const EventContext& /*ctx*/) const override final; + void MakeCorrection (CaloCell* theCell, + const EventContext& ctx, const ILArHVScaleCorr* ofl=nullptr) const; + + + + private: + + SG::ReadCondHandleKey<ILArHVScaleCorr> m_offlineHVScaleCorrKey{this, "keyOfflineHVCorr", "LArHVScaleCorrRecomputed","Key for LArHVScaleCorr"}; + +}; + +#endif diff --git a/LArCalorimeter/LArCellRec/src/LArCellMaskingTool.cxx b/LArCalorimeter/LArCellRec/src/LArCellMaskingTool.cxx index 5f8697e1b53c5a7637d07305000e339b97208caf..e5212b082ea888f675bdce41a45a529d729ec33e 100644 --- a/LArCalorimeter/LArCellRec/src/LArCellMaskingTool.cxx +++ b/LArCalorimeter/LArCellRec/src/LArCellMaskingTool.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration */ /******************************************************************** @@ -10,9 +10,7 @@ PACKAGE: offline/Calorimeter/CaloRec ********************************************************************/ #include "LArCellMaskingTool.h" -#include "StoreGate/StoreGateSvc.h" #include "CaloEvent/CaloCellContainer.h" -#include "LArCabling/LArCablingService.h" ///////////////////////////////////////////////////////////////////// @@ -25,8 +23,7 @@ LArCellMaskingTool::LArCellMaskingTool( const IInterface* parent) : AthAlgTool(type, name, parent), m_onlineID(nullptr), - m_offlineID(nullptr), - m_larCablingSvc(nullptr) + m_offlineID(nullptr) { declareInterface<ICaloCellMakerTool>(this); //List of strings to determine detector parts to be masked. @@ -48,11 +45,8 @@ StatusCode LArCellMaskingTool::initialize() { ATH_CHECK( detStore()->retrieve(m_offlineID) ); ATH_CHECK( detStore()->retrieve(m_onlineID) ); - - IToolSvc* p_toolSvc = 0; - ATH_CHECK( service("ToolSvc", p_toolSvc) ); - ATH_CHECK( p_toolSvc->retrieveTool("LArCablingService",m_larCablingSvc) ); - + ATH_CHECK( m_cablingKey.initialize()); + // Get hash ranges m_offlinehashMax=m_offlineID->calo_cell_hash_max(); ATH_MSG_DEBUG ("CaloCell Hash Max: " << m_offlinehashMax); @@ -63,16 +57,14 @@ StatusCode LArCellMaskingTool::initialize() //Fill the bit map m_includedCellsMap.set(); // By default include all cells - StatusCode sc=fillIncludedCellsMap(); - ATH_MSG_INFO (" Will exclude " << m_includedCellsMap.size() - m_includedCellsMap.count() << " cells from CaloCellContainer"); - return sc; + return StatusCode::SUCCESS; } -StatusCode LArCellMaskingTool::fillIncludedCellsMap() { +StatusCode LArCellMaskingTool::fillIncludedCellsMap(const LArOnOffIdMapping* cabling) { std::vector<std::string>::const_iterator it=m_rejLArChannels.begin(); std::vector<std::string>::const_iterator it_e= m_rejLArChannels.end(); @@ -130,8 +122,8 @@ StatusCode LArCellMaskingTool::fillIncludedCellsMap() { nChannels++; try { chanId=m_onlineID->channel_Id(bec,pn,FT,slot,channel); - if (m_larCablingSvc->isOnlineConnected(chanId)) { - const Identifier cellId=m_larCablingSvc->cnvToIdentifier(chanId); + if (cabling->isOnlineConnected(chanId)) { + const Identifier cellId=cabling->cnvToIdentifier(chanId); const IdentifierHash cellhash=m_offlineID->calo_cell_hash(cellId); m_includedCellsMap.reset(cellhash); //std::cout << "Block channel: bec="<< bec << " pn=" << pn @@ -163,6 +155,15 @@ StatusCode LArCellMaskingTool::fillIncludedCellsMap() { StatusCode LArCellMaskingTool::process(CaloCellContainer * theCont ) { + if (! m_mapInitialized) { + //To make this (practically never used) method re-entrant, + //protect the following with a mutex + SG::ReadCondHandle<LArOnOffIdMapping> cablingHdl{m_cablingKey}; + const LArOnOffIdMapping* cabling=*cablingHdl; + ATH_CHECK(fillIncludedCellsMap(cabling)); + m_mapInitialized=true; + } + //Build bitmap to keep track which cells have been added to reducedCellContainer; unsigned cnt=0; CaloCellContainer::iterator it=theCont->begin(); diff --git a/LArCalorimeter/LArCellRec/src/LArCellMaskingTool.h b/LArCalorimeter/LArCellRec/src/LArCellMaskingTool.h index 3954526073be03f8db8ada1feb03c9b50f2c60b8..baa90be624d6e309c3d052d1453160eac2000210 100644 --- a/LArCalorimeter/LArCellRec/src/LArCellMaskingTool.h +++ b/LArCalorimeter/LArCellRec/src/LArCellMaskingTool.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration */ #ifndef LARCELLREC_LARCELLMASKINGTOOL_H @@ -11,11 +11,10 @@ #include "LArIdentifier/LArOnlineID.h" #include "CaloIdentifier/CaloCell_ID.h" #include "CaloInterface/ICaloCellMakerTool.h" +#include "StoreGate/ReadCondHandleKey.h" +#include "LArCabling/LArOnOffIdMapping.h" #include <bitset> -#include "LArCabling/LArCablingService.h" -class StoreGateSvc; -class MsgStream; class LArCellMaskingTool: public AthAlgTool, virtual public ICaloCellMakerTool @@ -37,15 +36,16 @@ public: virtual StatusCode finalize(); private: - StatusCode fillIncludedCellsMap(); + StatusCode fillIncludedCellsMap(const LArOnOffIdMapping* cabling); const LArOnlineID* m_onlineID; const CaloCell_ID* m_offlineID; - LArCablingService* m_larCablingSvc; + SG::ReadCondHandleKey<LArOnOffIdMapping> m_cablingKey{this,"CablingKey","LArOnOffIdMap","SG Key of LArOnOffIdMapping object"}; + std::vector<std::string> m_rejLArChannels; std::bitset<200000> m_includedCellsMap; //Slightly too big but who cares.... - + bool m_mapInitialized=false; IdentifierHash m_offlinehashMax; IdentifierHash m_onlinehashMax; }; diff --git a/LArCalorimeter/LArCellRec/src/components/LArCellRec_entries.cxx b/LArCalorimeter/LArCellRec/src/components/LArCellRec_entries.cxx index 4997767738c78dabf915dd497de501753b58c715..21c8d59a065c66c2d3b510816d51ddd5e8b24e3b 100644 --- a/LArCalorimeter/LArCellRec/src/components/LArCellRec_entries.cxx +++ b/LArCalorimeter/LArCellRec/src/components/LArCellRec_entries.cxx @@ -17,6 +17,7 @@ #include "../LArNoisyROTool.h" #include "../LArCollisionTimeAlg.h" #include "../LArTimeVetoAlg.h" +#include "../LArCellHVCorrAlg.h" DECLARE_COMPONENT( LArNoisyROAlg ) @@ -38,4 +39,5 @@ DECLARE_COMPONENT( LArCellDeadOTXCorr ) DECLARE_COMPONENT( LArNoisyROTool ) DECLARE_COMPONENT( LArCollisionTimeAlg ) DECLARE_COMPONENT( LArTimeVetoAlg ) +DECLARE_COMPONENT( LArCellHVCorrAlg ) diff --git a/LArCalorimeter/LArCnv/LArByteStream/CMakeLists.txt b/LArCalorimeter/LArCnv/LArByteStream/CMakeLists.txt index e854e96478fa961edaeb421fc68d3cf1930df47d..3f8b98f691931b9e978855379179be3a3d521084 100644 --- a/LArCalorimeter/LArCnv/LArByteStream/CMakeLists.txt +++ b/LArCalorimeter/LArCnv/LArByteStream/CMakeLists.txt @@ -29,8 +29,6 @@ atlas_depends_on_subdirs( LArCalorimeter/LArCabling PRIVATE Calorimeter/CaloInterface - Control/CLIDSvc - Control/SGTools DetectorDescription/AtlasDetDescr DetectorDescription/Identifier Event/ByteStreamCnvSvc @@ -49,7 +47,7 @@ atlas_add_library( LArByteStreamLib LArRecConditions LArRecEvent CaloDetDescrLib CaloUtilsLib StoreGateLib ByteStreamCnvSvcBaseLib LArRODLib LArRawUtilsLib LArRecUtilsLib LArCablingLib ByteStreamCnvSvcLib - PRIVATE_LINK_LIBRARIES SGTools AtlasDetDescr Identifier LArRawConditions ) + PRIVATE_LINK_LIBRARIES AtlasDetDescr Identifier LArRawConditions ) atlas_add_component( LArByteStream src/components/*.cxx diff --git a/LArCalorimeter/LArCnv/LArByteStream/src/LArAccumulatedCalibDigitContByteStreamCnv.cxx b/LArCalorimeter/LArCnv/LArByteStream/src/LArAccumulatedCalibDigitContByteStreamCnv.cxx index 433261bba98a9d382e1a6c36f6c1804665ee52d1..ad84f43c8d184ec1be359edaf87eb14945fe85c4 100644 --- a/LArCalorimeter/LArCnv/LArByteStream/src/LArAccumulatedCalibDigitContByteStreamCnv.cxx +++ b/LArCalorimeter/LArCnv/LArByteStream/src/LArAccumulatedCalibDigitContByteStreamCnv.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration */ #include "LArByteStream/LArAccumulatedCalibDigitContByteStreamCnv.h" @@ -21,7 +21,7 @@ #include "LArRawEvent/LArAccumulatedCalibDigitContainer.h" #include "StoreGate/StoreGateSvc.h" -#include "CLIDSvc/CLASS_DEF.h" +#include "AthenaKernel/CLASS_DEF.h" // Tool #include "GaudiKernel/IToolSvc.h" diff --git a/LArCalorimeter/LArCnv/LArByteStream/src/LArAccumulatedDigitContByteStreamCnv.cxx b/LArCalorimeter/LArCnv/LArByteStream/src/LArAccumulatedDigitContByteStreamCnv.cxx index d37117eaeb7a53e82434a8bf088a5cfca15e7f6b..db7e42b94fc682f5f79e0d497ccd17ba0397cba9 100644 --- a/LArCalorimeter/LArCnv/LArByteStream/src/LArAccumulatedDigitContByteStreamCnv.cxx +++ b/LArCalorimeter/LArCnv/LArByteStream/src/LArAccumulatedDigitContByteStreamCnv.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration */ #include "LArByteStream/LArAccumulatedDigitContByteStreamCnv.h" @@ -21,7 +21,7 @@ #include "LArRawEvent/LArAccumulatedDigitContainer.h" #include "StoreGate/StoreGateSvc.h" -#include "CLIDSvc/CLASS_DEF.h" +#include "AthenaKernel/CLASS_DEF.h" // Tool #include "GaudiKernel/IToolSvc.h" diff --git a/LArCalorimeter/LArCnv/LArByteStream/src/LArCalibDigitContByteStreamCnv.cxx b/LArCalorimeter/LArCnv/LArByteStream/src/LArCalibDigitContByteStreamCnv.cxx index a544a444f453a4d1a4a0200819cf6043d7b48508..1cd8b3e1817900a1ba453786adfd8acef0d337e8 100644 --- a/LArCalorimeter/LArCnv/LArByteStream/src/LArCalibDigitContByteStreamCnv.cxx +++ b/LArCalorimeter/LArCnv/LArByteStream/src/LArCalibDigitContByteStreamCnv.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration */ #include "LArByteStream/LArCalibDigitContByteStreamCnv.h" @@ -19,7 +19,7 @@ #include "LArRawEvent/LArCalibDigitContainer.h" #include "StoreGate/StoreGateSvc.h" -#include "CLIDSvc/CLASS_DEF.h" +#include "AthenaKernel/CLASS_DEF.h" // Tool #include "GaudiKernel/IToolSvc.h" diff --git a/LArCalorimeter/LArCnv/LArByteStream/src/LArDigitContByteStreamCnv.cxx b/LArCalorimeter/LArCnv/LArByteStream/src/LArDigitContByteStreamCnv.cxx index 7bbe99eb1a9e74136658e84bc67da11460386c0d..d12e94b5758148444204dc98d88478bd5e9afe46 100644 --- a/LArCalorimeter/LArCnv/LArByteStream/src/LArDigitContByteStreamCnv.cxx +++ b/LArCalorimeter/LArCnv/LArByteStream/src/LArDigitContByteStreamCnv.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration */ #include "LArByteStream/LArDigitContByteStreamCnv.h" @@ -22,7 +22,7 @@ #include "LArRawEvent/LArDigitContainer.h" #include "StoreGate/StoreGateSvc.h" -#include "CLIDSvc/CLASS_DEF.h" +#include "AthenaKernel/CLASS_DEF.h" // Tool #include "GaudiKernel/IToolSvc.h" diff --git a/LArCalorimeter/LArCnv/LArByteStream/src/LArFebHeaderContByteStreamCnv.cxx b/LArCalorimeter/LArCnv/LArByteStream/src/LArFebHeaderContByteStreamCnv.cxx index f165b901ee76d386421d0173400d285253a213a7..911f264ec322f8044f52d02c10d8a81d0c2d1898 100644 --- a/LArCalorimeter/LArCnv/LArByteStream/src/LArFebHeaderContByteStreamCnv.cxx +++ b/LArCalorimeter/LArCnv/LArByteStream/src/LArFebHeaderContByteStreamCnv.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration */ #include "LArByteStream/LArFebHeaderContByteStreamCnv.h" @@ -22,7 +22,7 @@ #include "LArRawEvent/LArFebHeaderContainer.h" #include "StoreGate/StoreGateSvc.h" -#include "CLIDSvc/CLASS_DEF.h" +#include "AthenaKernel/CLASS_DEF.h" // Tool #include "GaudiKernel/IToolSvc.h" diff --git a/LArCalorimeter/LArCnv/LArByteStream/src/LArRawChannelContByteStreamCnv.cxx b/LArCalorimeter/LArCnv/LArByteStream/src/LArRawChannelContByteStreamCnv.cxx index eb4c50dcad106a8440f85979b311717bb79d14ad..5686674e5a4d060f048136fcdceb6d51c9222321 100644 --- a/LArCalorimeter/LArCnv/LArByteStream/src/LArRawChannelContByteStreamCnv.cxx +++ b/LArCalorimeter/LArCnv/LArByteStream/src/LArRawChannelContByteStreamCnv.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration */ #include "LArByteStream/LArRawChannelContByteStreamCnv.h" @@ -22,7 +22,7 @@ #include "LArRawEvent/LArDigitContainer.h" #include "StoreGate/StoreGateSvc.h" -#include "CLIDSvc/CLASS_DEF.h" +#include "AthenaKernel/CLASS_DEF.h" // Tool #include "GaudiKernel/IToolSvc.h" diff --git a/LArCalorimeter/LArDetDescr/CMakeLists.txt b/LArCalorimeter/LArDetDescr/CMakeLists.txt index b49269de187b58ab9046b6d54e45ec1291bc8576..173c20bf3e9ff8ff391775ed9513e838a1f8242b 100644 --- a/LArCalorimeter/LArDetDescr/CMakeLists.txt +++ b/LArCalorimeter/LArDetDescr/CMakeLists.txt @@ -10,8 +10,7 @@ atlas_depends_on_subdirs( PUBLIC Calorimeter/CaloDetDescr Calorimeter/CaloGeoHelpers Control/AthenaBaseComps - Control/CLIDSvc - Control/SGTools + Control/AthenaKernel DetectorDescription/GeoModel/GeoModelKernel DetectorDescription/Identifier GaudiKernel @@ -35,7 +34,7 @@ atlas_add_component( LArDetDescr src/*.cxx src/components/*.cxx INCLUDE_DIRS ${Boost_INCLUDE_DIRS} ${CORAL_INCLUDE_DIRS} ${CLHEP_INCLUDE_DIRS} ${EIGEN_INCLUDE_DIRS} - LINK_LIBRARIES ${Boost_LIBRARIES} ${CORAL_LIBRARIES} ${CLHEP_LIBRARIES} ${EIGEN_LIBRARIES} CaloDetDescrLib CaloGeoHelpers AthenaBaseComps SGTools GeoModelKernel Identifier GaudiKernel LArReadoutGeometry CaloIdentifier StoreGateLib SGtests GeoModelUtilities GeoPrimitives ) + LINK_LIBRARIES ${Boost_LIBRARIES} ${CORAL_LIBRARIES} ${CLHEP_LIBRARIES} ${EIGEN_LIBRARIES} AthenaKernel CaloDetDescrLib CaloGeoHelpers AthenaBaseComps GeoModelKernel Identifier GaudiKernel LArReadoutGeometry CaloIdentifier StoreGateLib SGtests GeoModelUtilities GeoPrimitives ) # Install files from the package: atlas_install_headers( LArDetDescr ) diff --git a/LArCalorimeter/LArDetDescr/LArDetDescr/LArCellVolumeDB.h b/LArCalorimeter/LArDetDescr/LArDetDescr/LArCellVolumeDB.h index 380a69413bfcb30e9e6bd786332532c05737a555..f4c13272a35ba1b2be2af3d1560e0717fd5b9559 100755 --- a/LArCalorimeter/LArDetDescr/LArDetDescr/LArCellVolumeDB.h +++ b/LArCalorimeter/LArDetDescr/LArDetDescr/LArCellVolumeDB.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration */ #ifndef LARDETDESCR_LARCELLVOLUMEDB_H @@ -28,9 +28,7 @@ struct LArCellVolumeDB_t{ typedef std::vector<LArCellVolumeDB_t> LArCellVolumeDB; -#ifndef __CINT__ -#include "CLIDSvc/CLASS_DEF.h" +#include "AthenaKernel/CLASS_DEF.h" CLASS_DEF(LArCellVolumeDB, 34482670 ,1) -#endif #endif diff --git a/LArCalorimeter/LArElecCalib/CMakeLists.txt b/LArCalorimeter/LArElecCalib/CMakeLists.txt index b4fb1ced73423da2f95804d6d17d3022c9fcecd2..18646e099f0393d1dc74a3d251c0d89706e63b06 100644 --- a/LArCalorimeter/LArElecCalib/CMakeLists.txt +++ b/LArCalorimeter/LArElecCalib/CMakeLists.txt @@ -9,8 +9,6 @@ atlas_subdir( LArElecCalib ) atlas_depends_on_subdirs( PUBLIC Calorimeter/CaloIdentifier Control/AthenaKernel - Control/CLIDSvc - Control/SGTools DetectorDescription/Identifier GaudiKernel LArCalorimeter/LArIdentifier ) @@ -24,7 +22,7 @@ atlas_add_dictionary( LArElecCalibDict LArElecCalib/LArElecCalibDict.h LArElecCalib/selection.xml INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} ${EIGEN_INCLUDE_DIRS} - LINK_LIBRARIES ${ROOT_LIBRARIES} ${EIGEN_LIBRARIES} CaloIdentifier AthenaKernel SGTools Identifier GaudiKernel LArIdentifier ) + LINK_LIBRARIES ${ROOT_LIBRARIES} ${EIGEN_LIBRARIES} CaloIdentifier AthenaKernel Identifier GaudiKernel LArIdentifier ) # Install files from the package: atlas_install_headers( LArElecCalib ) diff --git a/LArCalorimeter/LArElecCalib/LArElecCalib/ILArAutoCorr.h b/LArCalorimeter/LArElecCalib/LArElecCalib/ILArAutoCorr.h index 66dae9af4458f9136a446f7716ea0af58d63d85d..e7ba923a99f43166f4e94aff60392f518b2f732f 100644 --- a/LArCalorimeter/LArElecCalib/LArElecCalib/ILArAutoCorr.h +++ b/LArCalorimeter/LArElecCalib/LArElecCalib/ILArAutoCorr.h @@ -1,12 +1,12 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration */ //Dear emacs, this is -*-c++-*- #ifndef LARELECCALIB_ILARAUTOCORR_H #define LARELECCALIB_ILARAUTOCORR_H -#include "CLIDSvc/CLASS_DEF.h" +#include "AthenaKernel/CLASS_DEF.h" #include "Identifier/HWIdentifier.h" #include "LArElecCalib/LArVectorProxy.h" diff --git a/LArCalorimeter/LArElecCalib/LArElecCalib/ILArCableAttenuation.h b/LArCalorimeter/LArElecCalib/LArElecCalib/ILArCableAttenuation.h index 51be574a548237911c5ba2095fad0f00a1bf0379..b0b48fb88d3fc4377c71168a71e137f5f2987090 100755 --- a/LArCalorimeter/LArElecCalib/LArElecCalib/ILArCableAttenuation.h +++ b/LArCalorimeter/LArElecCalib/LArElecCalib/ILArCableAttenuation.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration */ #ifndef LARCONDITIONS_ILARCABLEATTENUATION_H @@ -7,7 +7,7 @@ #include "Identifier/HWIdentifier.h" #include "LArElecCalib/LArCalibErrorCode.h" -#include "CLIDSvc/CLASS_DEF.h" +#include "AthenaKernel/CLASS_DEF.h" #include <vector> diff --git a/LArCalorimeter/LArElecCalib/LArElecCalib/ILArCableLength.h b/LArCalorimeter/LArElecCalib/LArElecCalib/ILArCableLength.h index 7c5e1f1fde5dadeaece03f10b2c723fdfbae70c7..15af1c95c5be1b503e8deac96dbd8728038e95a1 100755 --- a/LArCalorimeter/LArElecCalib/LArElecCalib/ILArCableLength.h +++ b/LArCalorimeter/LArElecCalib/LArElecCalib/ILArCableLength.h @@ -1,12 +1,12 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration */ #ifndef LARCONDITIONS_ILARCABLELENGTH_H #define LARCONDITIONS_ILARCABLELENGTH_H -#include "CLIDSvc/CLASS_DEF.h" +#include "AthenaKernel/CLASS_DEF.h" #include "LArElecCalib/LArCalibErrorCode.h" class HWIdentifier; diff --git a/LArCalorimeter/LArElecCalib/LArElecCalib/ILArCaliPulseParams.h b/LArCalorimeter/LArElecCalib/LArElecCalib/ILArCaliPulseParams.h index 61a3137623c70422bae09dfc1b504fc00601ae67..3822a878a7f5ac12293271320998809591c6f27f 100755 --- a/LArCalorimeter/LArElecCalib/LArElecCalib/ILArCaliPulseParams.h +++ b/LArCalorimeter/LArElecCalib/LArElecCalib/ILArCaliPulseParams.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration */ #ifndef LARCONDITIONS_ILARCALIPULSEPARAMS_H @@ -7,7 +7,7 @@ #include "Identifier/HWIdentifier.h" #include "LArElecCalib/LArCalibErrorCode.h" -#include "CLIDSvc/CLASS_DEF.h" +#include "AthenaKernel/CLASS_DEF.h" #include <vector> diff --git a/LArCalorimeter/LArElecCalib/LArElecCalib/ILArDAC2uA.h b/LArCalorimeter/LArElecCalib/LArElecCalib/ILArDAC2uA.h index 7b3078d3d01abaa96e9cef55dc639adf8f31ed3c..5414715e7367c35a34c11763ac4defaa76f22858 100644 --- a/LArCalorimeter/LArElecCalib/LArElecCalib/ILArDAC2uA.h +++ b/LArCalorimeter/LArElecCalib/LArElecCalib/ILArDAC2uA.h @@ -1,11 +1,11 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration */ #ifndef LARCONDITIONS_ILARDAC2UA_H #define LARCONDITIONS_ILARDAC2UA_H -#include "CLIDSvc/CLASS_DEF.h" +#include "AthenaKernel/CLASS_DEF.h" #include "Identifier/HWIdentifier.h" #include "Identifier/Identifier.h" #include "LArElecCalib/LArCalibErrorCode.h" diff --git a/LArCalorimeter/LArElecCalib/LArElecCalib/ILArDetCellParams.h b/LArCalorimeter/LArElecCalib/LArElecCalib/ILArDetCellParams.h index 157f4b6e7fa07b6350888f5cbdcabb949d954b54..e6bdefd19ac40a705667e7ea55140eb1c3f2b5c9 100755 --- a/LArCalorimeter/LArElecCalib/LArElecCalib/ILArDetCellParams.h +++ b/LArCalorimeter/LArElecCalib/LArElecCalib/ILArDetCellParams.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration */ #ifndef LARCONDITIONS_ILARDETCELLPARAMS_H @@ -7,7 +7,7 @@ #include "Identifier/HWIdentifier.h" #include "LArElecCalib/LArCalibErrorCode.h" -#include "CLIDSvc/CLASS_DEF.h" +#include "AthenaKernel/CLASS_DEF.h" class ILArDetCellParams { diff --git a/LArCalorimeter/LArElecCalib/LArElecCalib/ILArEMEC_Cphi.h b/LArCalorimeter/LArElecCalib/LArElecCalib/ILArEMEC_Cphi.h index a38b9a7c5545f3a17d6829a059242ccd27928581..4cf43c45c051081fd94845db0cb05ebe8410852e 100755 --- a/LArCalorimeter/LArElecCalib/LArElecCalib/ILArEMEC_Cphi.h +++ b/LArCalorimeter/LArElecCalib/LArElecCalib/ILArEMEC_Cphi.h @@ -1,11 +1,11 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration */ #ifndef LARCONDITIONS_ILAREMEC_CPHI_H #define LARCONDITIONS_ILAREMEC_CPHI_H -#include "CLIDSvc/CLASS_DEF.h" +#include "AthenaKernel/CLASS_DEF.h" #include "Identifier/HWIdentifier.h" #include "Identifier/Identifier.h" #include "LArElecCalib/LArCalibErrorCode.h" diff --git a/LArCalorimeter/LArElecCalib/LArElecCalib/ILArEMEC_HValpha.h b/LArCalorimeter/LArElecCalib/LArElecCalib/ILArEMEC_HValpha.h index 3aeca4f3e537bdb89e231708681540c640541f99..e29aa7740631bc0c6d5e0607904e60346d515df1 100755 --- a/LArCalorimeter/LArElecCalib/LArElecCalib/ILArEMEC_HValpha.h +++ b/LArCalorimeter/LArElecCalib/LArElecCalib/ILArEMEC_HValpha.h @@ -1,11 +1,11 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration */ #ifndef LARCONDITIONS_ILAREMEC_HVALPHA_H #define LARCONDITIONS_ILAREMEC_HVALPHA_H -#include "CLIDSvc/CLASS_DEF.h" +#include "AthenaKernel/CLASS_DEF.h" #include "Identifier/HWIdentifier.h" #include "Identifier/Identifier.h" #include "LArElecCalib/LArCalibErrorCode.h" diff --git a/LArCalorimeter/LArElecCalib/LArElecCalib/ILArEMEC_HVbeta.h b/LArCalorimeter/LArElecCalib/LArElecCalib/ILArEMEC_HVbeta.h index 2520080f87adbac82fd81f016d079de791986243..45dd6c1e6db4dfb023de4ad141557807e6e2a9ea 100755 --- a/LArCalorimeter/LArElecCalib/LArElecCalib/ILArEMEC_HVbeta.h +++ b/LArCalorimeter/LArElecCalib/LArElecCalib/ILArEMEC_HVbeta.h @@ -1,11 +1,11 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration */ #ifndef LARCONDITIONS_ILAREMEC_HVBETA_H #define LARCONDITIONS_ILAREMEC_HVBETA_H -#include "CLIDSvc/CLASS_DEF.h" +#include "AthenaKernel/CLASS_DEF.h" #include "Identifier/HWIdentifier.h" #include "Identifier/Identifier.h" #include "LArElecCalib/LArCalibErrorCode.h" diff --git a/LArCalorimeter/LArElecCalib/LArElecCalib/ILArFEBTimeOffset.h b/LArCalorimeter/LArElecCalib/LArElecCalib/ILArFEBTimeOffset.h index 8bcb2e9944101c2fb086d3e9c024684153fec3a9..5826a64690b53b9b2e504c8e94bdaeb1d094a2b0 100755 --- a/LArCalorimeter/LArElecCalib/LArElecCalib/ILArFEBTimeOffset.h +++ b/LArCalorimeter/LArElecCalib/LArElecCalib/ILArFEBTimeOffset.h @@ -1,12 +1,12 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration */ #ifndef ILARFEBTIMEOFFSET_H #define ILARFEBTIMEOFFSET_H #include "Identifier/HWIdentifier.h" -#include "CLIDSvc/CLASS_DEF.h" +#include "AthenaKernel/CLASS_DEF.h" class ILArFEBTimeOffset { public: diff --git a/LArCalorimeter/LArElecCalib/LArElecCalib/ILArGlobalTimeOffset.h b/LArCalorimeter/LArElecCalib/LArElecCalib/ILArGlobalTimeOffset.h index b871c57865421ba71533b15a4498d36cab0fbaef..1abbc3542c8ed5002c5032b568f9cf9d85afb2d0 100755 --- a/LArCalorimeter/LArElecCalib/LArElecCalib/ILArGlobalTimeOffset.h +++ b/LArCalorimeter/LArElecCalib/LArElecCalib/ILArGlobalTimeOffset.h @@ -1,11 +1,11 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration */ #ifndef ILARGLOBALTIMEOFFSET_H #define ILARGLOBALTIMEOFFSET_H -#include "CLIDSvc/CLASS_DEF.h" +#include "AthenaKernel/CLASS_DEF.h" class ILArGlobalTimeOffset { public: diff --git a/LArCalorimeter/LArElecCalib/LArElecCalib/ILArH6Oscillation.h b/LArCalorimeter/LArElecCalib/LArElecCalib/ILArH6Oscillation.h index d33a5966ff1b6f237fe29e28934d3667ecc954af..696e2a1b466eaae13dc7d98662ad4ac6e2220c4a 100755 --- a/LArCalorimeter/LArElecCalib/LArElecCalib/ILArH6Oscillation.h +++ b/LArCalorimeter/LArElecCalib/LArElecCalib/ILArH6Oscillation.h @@ -1,11 +1,11 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration */ #ifndef LARELECCALIB_ILARH6OSCILLATION_H #define LARELECCALIB_ILARH6OSCILLATION_H -#include "CLIDSvc/CLASS_DEF.h" +#include "AthenaKernel/CLASS_DEF.h" #include "Identifier/HWIdentifier.h" #include "Identifier/Identifier.h" #include "LArElecCalib/LArCalibErrorCode.h" diff --git a/LArCalorimeter/LArElecCalib/LArElecCalib/ILArHVScaleCorr.h b/LArCalorimeter/LArElecCalib/LArElecCalib/ILArHVScaleCorr.h index 5dc2ba4a8d9ecfa198fe53c90588fc06946af4cc..c24e83ada54319f4b48d5d2b837957dda1d2b738 100644 --- a/LArCalorimeter/LArElecCalib/LArElecCalib/ILArHVScaleCorr.h +++ b/LArCalorimeter/LArElecCalib/LArElecCalib/ILArHVScaleCorr.h @@ -1,11 +1,11 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration */ #ifndef LARCONDITIONS_ILARHVSCALRCORR_H #define LARCONDITIONS_ILARHVSCALRCORR_H -#include "CLIDSvc/CLASS_DEF.h" +#include "AthenaKernel/CLASS_DEF.h" #include "Identifier/HWIdentifier.h" #include "Identifier/Identifier.h" #include "LArElecCalib/LArCalibErrorCode.h" diff --git a/LArCalorimeter/LArElecCalib/LArElecCalib/ILArMinBias.h b/LArCalorimeter/LArElecCalib/LArElecCalib/ILArMinBias.h index 9981a6add6b3e64e5887e1f18ca2254a6c6383bb..429f26d9ca4790e176661d8ba906b5249357028f 100644 --- a/LArCalorimeter/LArElecCalib/LArElecCalib/ILArMinBias.h +++ b/LArCalorimeter/LArElecCalib/LArElecCalib/ILArMinBias.h @@ -1,11 +1,11 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration */ #ifndef LARCONDITIONS_ILARMINBIAS_H #define LARCONDITIONS_ILARMINBIAS_H -#include "CLIDSvc/CLASS_DEF.h" +#include "AthenaKernel/CLASS_DEF.h" #include "LArElecCalib/LArCalibErrorCode.h" class HWIdentifier; diff --git a/LArCalorimeter/LArElecCalib/LArElecCalib/ILArMinBiasAverage.h b/LArCalorimeter/LArElecCalib/LArElecCalib/ILArMinBiasAverage.h index d4a25ee173d6de3eb2764cdb9f42a2aa3a0c28db..de3af2a52b5ae6587faac33a6e9dbdc1707944bc 100755 --- a/LArCalorimeter/LArElecCalib/LArElecCalib/ILArMinBiasAverage.h +++ b/LArCalorimeter/LArElecCalib/LArElecCalib/ILArMinBiasAverage.h @@ -1,11 +1,11 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration */ #ifndef LARCONDITIONS_ILARMINBIASAVERAGE_H #define LARCONDITIONS_ILARMINBIASAVERAGE_H -#include "CLIDSvc/CLASS_DEF.h" +#include "AthenaKernel/CLASS_DEF.h" #include "LArElecCalib/LArCalibErrorCode.h" class HWIdentifier; diff --git a/LArCalorimeter/LArElecCalib/LArElecCalib/ILArMphysOverMcal.h b/LArCalorimeter/LArElecCalib/LArElecCalib/ILArMphysOverMcal.h index 8a8179e6ca5f555d7af80c6e9d79ace5cce31e7c..d00e1cd2530d6b064f9c184ff476594b14009f2e 100644 --- a/LArCalorimeter/LArElecCalib/LArElecCalib/ILArMphysOverMcal.h +++ b/LArCalorimeter/LArElecCalib/LArElecCalib/ILArMphysOverMcal.h @@ -1,11 +1,11 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration */ #ifndef LARCONDITIONS_ILARMPHYSOVERMCAL_H #define LARCONDITIONS_ILARMPHYSOVERMCAL_H -#include "CLIDSvc/CLASS_DEF.h" +#include "AthenaKernel/CLASS_DEF.h" #include "Identifier/HWIdentifier.h" #include "Identifier/Identifier.h" #include "LArElecCalib/LArCalibErrorCode.h" diff --git a/LArCalorimeter/LArElecCalib/LArElecCalib/ILArNoise.h b/LArCalorimeter/LArElecCalib/LArElecCalib/ILArNoise.h index 315736c43d918771d74d51b6fc205951c1c6f893..acc894823485acb559e055fba319a6efcf94a2bc 100644 --- a/LArCalorimeter/LArElecCalib/LArElecCalib/ILArNoise.h +++ b/LArCalorimeter/LArElecCalib/LArElecCalib/ILArNoise.h @@ -1,11 +1,11 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration */ #ifndef LARELECCALIB_ILARNOISE_H #define LARELECCALIB_ILARNOISE_H -#include "CLIDSvc/CLASS_DEF.h" +#include "AthenaKernel/CLASS_DEF.h" #include "LArElecCalib/LArCalibErrorCode.h" class HWIdentifier; diff --git a/LArCalorimeter/LArElecCalib/LArElecCalib/ILArOFC.h b/LArCalorimeter/LArElecCalib/LArElecCalib/ILArOFC.h index 1dcfb447315ed998c8ae8c20ce4e78784278a391..b495fd625e3e3d20f0e50030c9a2b93625c5f330 100644 --- a/LArCalorimeter/LArElecCalib/LArElecCalib/ILArOFC.h +++ b/LArCalorimeter/LArElecCalib/LArElecCalib/ILArOFC.h @@ -1,11 +1,11 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration */ #ifndef LARELECCALIB_ILAROFC_H #define LARELECCALIB_ILAROFC_H -#include "CLIDSvc/CLASS_DEF.h" +#include "AthenaKernel/CLASS_DEF.h" #include "LArElecCalib/LArVectorProxy.h" #include "Identifier/HWIdentifier.h" diff --git a/LArCalorimeter/LArElecCalib/LArElecCalib/ILArPedestal.h b/LArCalorimeter/LArElecCalib/LArElecCalib/ILArPedestal.h index bd42e4f6db61f4836d21446bf9e9f51c3d05ccb9..6ef1cd620d64513006d3ad8af99f11bf8bb77e36 100644 --- a/LArCalorimeter/LArElecCalib/LArElecCalib/ILArPedestal.h +++ b/LArCalorimeter/LArElecCalib/LArElecCalib/ILArPedestal.h @@ -1,11 +1,11 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration */ #ifndef LARELECCALIB_ILARPEDESTAL_H #define LARELECCALIB_ILARPEDESTAL_H -#include "CLIDSvc/CLASS_DEF.h" +#include "AthenaKernel/CLASS_DEF.h" #include "Identifier/HWIdentifier.h" #include "LArElecCalib/LArCalibErrorCode.h" diff --git a/LArCalorimeter/LArElecCalib/LArElecCalib/ILArPhysCaliTdiff.h b/LArCalorimeter/LArElecCalib/LArElecCalib/ILArPhysCaliTdiff.h index f8187936e483de021f116bb512c051afb24881a3..caa72fd4c78115ef6b564d1cb2438eee4c5bc937 100755 --- a/LArCalorimeter/LArElecCalib/LArElecCalib/ILArPhysCaliTdiff.h +++ b/LArCalorimeter/LArElecCalib/LArElecCalib/ILArPhysCaliTdiff.h @@ -1,14 +1,13 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration */ #ifndef LARCONDITIONS_ILARPHYSCALITDIFF_H #define LARCONDITIONS_ILARPHYSCALITDIFF_H -#include "CLIDSvc/CLASS_DEF.h" +#include "AthenaKernel/CLASS_DEF.h" #include "LArElecCalib/LArCalibErrorCode.h" -class Identifier; class HWIdentifier; class ILArPhysCaliTdiff { @@ -27,15 +26,8 @@ class ILArPhysCaliTdiff { // online ID virtual const float& Tdiff(const HWIdentifier& id , int gain ) const = 0 ; - // offline ID - virtual const float& Tdiff(const Identifier& id , int gain ) const =0; - enum {ERRORCODE = LArElecCalib::ERRORCODE}; - - -} ; +}; CLASS_DEF( ILArPhysCaliTdiff,121911021,1) - - #endif diff --git a/LArCalorimeter/LArElecCalib/LArElecCalib/ILArRamp.h b/LArCalorimeter/LArElecCalib/LArElecCalib/ILArRamp.h index 1c35751c63df522c4a8eacd2b3f0041f5a0df7e6..586c92692e7e124a5504b5c029bfbcada8e1a3a1 100644 --- a/LArCalorimeter/LArElecCalib/LArElecCalib/ILArRamp.h +++ b/LArCalorimeter/LArElecCalib/LArElecCalib/ILArRamp.h @@ -1,11 +1,11 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration */ #ifndef LARCONDITIONS_ILARRAMP_H #define LARCONDITIONS_ILARRAMP_H -#include "CLIDSvc/CLASS_DEF.h" +#include "AthenaKernel/CLASS_DEF.h" #include "Identifier/HWIdentifier.h" #include "LArElecCalib/LArVectorProxy.h" diff --git a/LArCalorimeter/LArElecCalib/LArElecCalib/ILArRinj.h b/LArCalorimeter/LArElecCalib/LArElecCalib/ILArRinj.h index f65875aeb3bec038022abdff7e097137542b5ffd..9ef64980057975b8cede0fdc4edeb0630cba2c20 100755 --- a/LArCalorimeter/LArElecCalib/LArElecCalib/ILArRinj.h +++ b/LArCalorimeter/LArElecCalib/LArElecCalib/ILArRinj.h @@ -1,11 +1,11 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration */ #ifndef LARCONDITIONS_ILARRINJ_H #define LARCONDITIONS_ILARRINJ_H -#include "CLIDSvc/CLASS_DEF.h" +#include "AthenaKernel/CLASS_DEF.h" #include "LArElecCalib/LArCalibErrorCode.h" class HWIdentifier; diff --git a/LArCalorimeter/LArElecCalib/LArElecCalib/ILArShape.h b/LArCalorimeter/LArElecCalib/LArElecCalib/ILArShape.h index 45946c8073a6afe48c850ba2bc2a0acdc4025b1f..dbd9b39368f7a06d9183dfa1620c322bce295d7b 100644 --- a/LArCalorimeter/LArElecCalib/LArElecCalib/ILArShape.h +++ b/LArCalorimeter/LArElecCalib/LArElecCalib/ILArShape.h @@ -1,11 +1,11 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration */ #ifndef LARCONDITIONS_ILARSHAPE_H #define LARCONDITIONS_ILARSHAPE_H -#include "CLIDSvc/CLASS_DEF.h" +#include "AthenaKernel/CLASS_DEF.h" #include "LArElecCalib/LArVectorProxy.h" class HWIdentifier; diff --git a/LArCalorimeter/LArElecCalib/LArElecCalib/ILArTdrift.h b/LArCalorimeter/LArElecCalib/LArElecCalib/ILArTdrift.h index 6f535e8573c8906e105cd4e2c34d74e50cf84d2c..352ac2bd507ef4ca75f254806f181e389eccfe81 100755 --- a/LArCalorimeter/LArElecCalib/LArElecCalib/ILArTdrift.h +++ b/LArCalorimeter/LArElecCalib/LArElecCalib/ILArTdrift.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration */ #ifndef LARCONDITIONS_ILARTDRIFT_H @@ -7,7 +7,7 @@ class HWIdentifier; #include "LArElecCalib/LArCalibErrorCode.h" -#include "CLIDSvc/CLASS_DEF.h" +#include "AthenaKernel/CLASS_DEF.h" class ILArTdrift { /** This class defines the interface for accessing Tdrift diff --git a/LArCalorimeter/LArElecCalib/LArElecCalib/ILArTshaper.h b/LArCalorimeter/LArElecCalib/LArElecCalib/ILArTshaper.h index cdec3701fe0dfd7749fb333c357be3d5ba4b9c27..31f9cca29ba72e5a0a92b525d52b8f134b34ab36 100755 --- a/LArCalorimeter/LArElecCalib/LArElecCalib/ILArTshaper.h +++ b/LArCalorimeter/LArElecCalib/LArElecCalib/ILArTshaper.h @@ -1,14 +1,13 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration */ #ifndef LARCONDITIONS_ILARTSHAPER_H #define LARCONDITIONS_ILARTSHAPER_H -#include "CLIDSvc/CLASS_DEF.h" +#include "AthenaKernel/CLASS_DEF.h" #include "LArElecCalib/LArCalibErrorCode.h" -class Identifier; -class HWIdentifier; +#include "Identifier/HWIdentifier.h" class ILArTshaper { /** This class defines the interface for accessing Tshaper @@ -26,9 +25,6 @@ class ILArTshaper { // online ID virtual const float& Tshaper(const HWIdentifier& id) const = 0 ; - // offline ID - virtual const float& Tshaper(const Identifier& id) const=0; - enum {ERRORCODE = LArElecCalib::ERRORCODE}; } ; diff --git a/LArCalorimeter/LArElecCalib/LArElecCalib/ILArWaveDerivedQuantities.h b/LArCalorimeter/LArElecCalib/LArElecCalib/ILArWaveDerivedQuantities.h index 93e476e9f5ad3425f8a9f8abe0ba9665dd0eded6..75a0aa000a0157d079652a0f6774b55e2735f834 100755 --- a/LArCalorimeter/LArElecCalib/LArElecCalib/ILArWaveDerivedQuantities.h +++ b/LArCalorimeter/LArElecCalib/LArElecCalib/ILArWaveDerivedQuantities.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration */ #ifndef LARCONDITIONS_ILARWAVEDERIVEDQUANTITIES_H @@ -7,9 +7,7 @@ #include "Identifier/HWIdentifier.h" #include "LArElecCalib/LArCalibErrorCode.h" -#include "CLIDSvc/CLASS_DEF.h" - -#include <vector> +#include "AthenaKernel/CLASS_DEF.h" class ILArWaveDerivedQuantities { @@ -31,17 +29,6 @@ class ILArWaveDerivedQuantities { virtual const float& rT0(const HWIdentifier& id , int gain ) const = 0 ; virtual const float& PosLobe(const HWIdentifier& id , int gain ) const = 0 ; virtual const unsigned& Flag(const HWIdentifier& CellID, int gain ) const = 0; - /* - // online ID - virtual const float& BaseLine(const Identifier& id , int gain ) const = 0 ; - virtual const float& MaxAmp(const Identifier& id , int gain ) const = 0 ; - virtual const float& TMaxAmp(const Identifier& id , int gain ) const = 0 ; - virtual const float& Width(const Identifier& id , int gain ) const = 0 ; - virtual const float& rT0(const Identifier& id , int gain ) const = 0 ; - virtual const float& PosLobe(const Identifier& id , int gain ) const = 0 ; - virtual const unsigned& Flag(const Identifier& CellID, int gain ) const = 0; - */ - enum {ERRORCODE = LArElecCalib::ERRORCODE}; } ; diff --git a/LArCalorimeter/LArElecCalib/LArElecCalib/ILArfSampl.h b/LArCalorimeter/LArElecCalib/LArElecCalib/ILArfSampl.h index b1353025b6bb429af9aed860d065242351d56fff..60c6b7eedbf3f74df0bd7fbe284eb6e666604569 100644 --- a/LArCalorimeter/LArElecCalib/LArElecCalib/ILArfSampl.h +++ b/LArCalorimeter/LArElecCalib/LArElecCalib/ILArfSampl.h @@ -1,11 +1,11 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration */ #ifndef LARCONDITIONS_ILARFSAMPL_H #define LARCONDITIONS_ILARFSAMPL_H -#include "CLIDSvc/CLASS_DEF.h" +#include "AthenaKernel/CLASS_DEF.h" #include "Identifier/HWIdentifier.h" #include "Identifier/Identifier.h" #include "LArElecCalib/LArCalibErrorCode.h" diff --git a/LArCalorimeter/LArElecCalib/LArElecCalib/ILAruA2MeV.h b/LArCalorimeter/LArElecCalib/LArElecCalib/ILAruA2MeV.h index b4046e099278910c6946f9bc022bbbd35acab814..d78b4ea7426fa29535b07ad75598a993c37989bb 100644 --- a/LArCalorimeter/LArElecCalib/LArElecCalib/ILAruA2MeV.h +++ b/LArCalorimeter/LArElecCalib/LArElecCalib/ILAruA2MeV.h @@ -1,11 +1,11 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration */ #ifndef LARCONDITIONS_ILARUA2MEV_H #define LARCONDITIONS_ILARUA2MEV_H -#include "CLIDSvc/CLASS_DEF.h" +#include "AthenaKernel/CLASS_DEF.h" #include "Identifier/HWIdentifier.h" #include "Identifier/Identifier.h" #include "LArElecCalib/LArCalibErrorCode.h" diff --git a/LArCalorimeter/LArExample/LArConditionsCommon/python/LArHVDB.py b/LArCalorimeter/LArExample/LArConditionsCommon/python/LArHVDB.py index b8cacff3ff8fa7e4289c0365c60db99603215a32..c12f428c4e942e138530d38216b004ce1d0602e7 100644 --- a/LArCalorimeter/LArExample/LArConditionsCommon/python/LArHVDB.py +++ b/LArCalorimeter/LArExample/LArConditionsCommon/python/LArHVDB.py @@ -22,8 +22,15 @@ if not conddb.isMC and not conddb.isOnline: condseq += hvpath from LArRecUtils.LArRecUtilsConf import LArHVCondAlg - hvcond = LArHVCondAlg(HVPathologies="LArHVPathology") + hvcond = LArHVCondAlg(HVPathologies="LArHVPathology",OutputHVData="LArHVData") + hvcond.OutputLevel=DEBUG condseq += hvcond + from LArRecUtils.LArRecUtilsConf import LArHVScaleCorrCondAlg + hvscale = LArHVScaleCorrCondAlg(keyHVdata="LArHVData",keyOutputCorr="LArHVScaleCorrRecomputed") + hvscale.UndoOnlineHVCorr=True + hvscale.OutputLevel=DEBUG + condseq += hvscale + if conddb.isMC: conddb.addFolderWithTag("LAR_OFL","/LAR/Identifier/HVLineToElectrodeMap","LARHVLineToElectrodeMap-001",className="AthenaAttributeList") diff --git a/LArCalorimeter/LArExample/LArConditionsCommon/share/LArConditionsCommon_comm_jobOptions.py b/LArCalorimeter/LArExample/LArConditionsCommon/share/LArConditionsCommon_comm_jobOptions.py index 9c4bf19e96b9108c8a4f50cb0fd729e7c82cb660..b32b92547c3d79b608df70ec70f0286b404cca30 100755 --- a/LArCalorimeter/LArExample/LArConditionsCommon/share/LArConditionsCommon_comm_jobOptions.py +++ b/LArCalorimeter/LArExample/LArConditionsCommon/share/LArConditionsCommon_comm_jobOptions.py @@ -114,8 +114,8 @@ def addLArFolder (db, obj, cls, qual=''): #Load HVScaleCorr. For run 2,these constants are also used by the CaloNoiseToolDB if (haveElecCalibInline): - from LArRecUtils.LArRecUtilsConf import LArFlatConditionsAlg_LArHVScaleCorrFlat_ as LArHVScaleCorrCondAlg - addLArFlatFolder (ONLDB, 'HVScaleCorr', LArHVScaleCorrCondAlg, sqlDB) + from LArRecUtils.LArRecUtilsConf import LArFlatConditionsAlg_LArHVScaleCorrFlat_ as LArHVScaleCorrCondFlatAlg + addLArFlatFolder (ONLDB, 'HVScaleCorr', LArHVScaleCorrCondFlatAlg, sqlDB) # TEMPORARY theLArCondSvc.HVScaleCorrInput="/LAR/ElecCalibFlat/HVScaleCorr" diff --git a/LArCalorimeter/LArG4/LArG4RunControl/CMakeLists.txt b/LArCalorimeter/LArG4/LArG4RunControl/CMakeLists.txt index e536614396a6a3a0856daccda4265b37b5a57022..6cc3b8ae4ce51e0ffcf540bfcac0e81603662b21 100644 --- a/LArCalorimeter/LArG4/LArG4RunControl/CMakeLists.txt +++ b/LArCalorimeter/LArG4/LArG4RunControl/CMakeLists.txt @@ -7,8 +7,7 @@ atlas_subdir( LArG4RunControl ) # Declare the package's dependencies: atlas_depends_on_subdirs( PUBLIC - Control/CLIDSvc - Control/SGTools + Control/AthenaKernel PRIVATE Control/StoreGate GaudiKernel ) @@ -29,12 +28,12 @@ atlas_add_library( LArG4RunControl INCLUDE_DIRS ${CLHEP_INCLUDE_DIRS} PRIVATE_INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} DEFINITIONS ${CLHEP_DEFINITIONS} - LINK_LIBRARIES ${CLHEP_LIBRARIES} SGTools StoreGateLib SGtests + LINK_LIBRARIES ${CLHEP_LIBRARIES} AthenaKernel StoreGateLib SGtests PRIVATE_LINK_LIBRARIES ${ROOT_LIBRARIES} GaudiKernel ) atlas_add_dictionary( LArG4RunControlDict LArG4RunControl/LArG4RunControlDict.h LArG4RunControl/selection.xml INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} ${CLHEP_INCLUDE_DIRS} - LINK_LIBRARIES ${ROOT_LIBRARIES} ${CLHEP_LIBRARIES} SGTools StoreGateLib SGtests GaudiKernel LArG4RunControl ) + LINK_LIBRARIES ${ROOT_LIBRARIES} ${CLHEP_LIBRARIES} StoreGateLib SGtests GaudiKernel LArG4RunControl ) diff --git a/LArCalorimeter/LArG4/LArG4RunControl/LArG4RunControl/LArG4TBPosOptions.h b/LArCalorimeter/LArG4/LArG4RunControl/LArG4RunControl/LArG4TBPosOptions.h index b3fca378f01ba51ac750a89e42bc0164230324d9..4f0e5b6bc3584f0cbd2561d5aa86e841e5e2b443 100755 --- a/LArCalorimeter/LArG4/LArG4RunControl/LArG4RunControl/LArG4TBPosOptions.h +++ b/LArCalorimeter/LArG4/LArG4RunControl/LArG4RunControl/LArG4TBPosOptions.h @@ -1,9 +1,9 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration */ -#ifndef _LArG4TBPosOptions_h_ -#define _LArG4TBPosOptions_h_ +#ifndef LARG4RUNCONTTROL_LARG4TBPOSOPTIONS_H +#define LARG4RUNCONTTROL_LARG4TBPOSOPTIONS_H #include "CLHEP/Units/SystemOfUnits.h" #include <string> // ----------------------------------------------------------------------// @@ -48,7 +48,7 @@ class LArG4TBPosOptions { }; #ifndef GAUDI_NEUTRAL -#include "CLIDSvc/CLASS_DEF.h" +#include "AthenaKernel/CLASS_DEF.h" CLASS_DEF(LArG4TBPosOptions, 321345482, 1) #endif diff --git a/LArCalorimeter/LArG4/LArG4RunControl/LArG4RunControl/LArGeoTB2004Options.h b/LArCalorimeter/LArG4/LArG4RunControl/LArG4RunControl/LArGeoTB2004Options.h index a0bc7cb00dfe16b48d5239ae350ec8c264acc777..156e4f2f7c46411472779bd281a683629a9bb2c3 100644 --- a/LArCalorimeter/LArG4/LArG4RunControl/LArG4RunControl/LArGeoTB2004Options.h +++ b/LArCalorimeter/LArG4/LArG4RunControl/LArG4RunControl/LArGeoTB2004Options.h @@ -1,9 +1,9 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration */ -#ifndef _LArGeoTB2004Options_h_ -#define _LArGeoTB2004Options_h_ +#ifndef LARG4RUNCONTROL_LARGEOTB2004OPTIONS_H +#define LARG4RUNCONTROL_LARGEOTB2004OPTIONS_H #include "CLHEP/Units/SystemOfUnits.h" // ----------------------------------------------------------------------// @@ -76,7 +76,7 @@ class LArGeoTB2004Options { }; #ifndef GAUDI_NEUTRAL -#include "CLIDSvc/CLASS_DEF.h" +#include "AthenaKernel/CLASS_DEF.h" CLASS_DEF(LArGeoTB2004Options, 120300909, 1) #endif diff --git a/LArCalorimeter/LArG4/LArG4RunControl/LArG4RunControl/LArGeoTBGeometricOptions.h b/LArCalorimeter/LArG4/LArG4RunControl/LArG4RunControl/LArGeoTBGeometricOptions.h index f1ac305846d55bf83404c1fb06a6f6dce283d826..239edede34a00df1f10fe00e1205bdf14bc8c911 100755 --- a/LArCalorimeter/LArG4/LArG4RunControl/LArG4RunControl/LArGeoTBGeometricOptions.h +++ b/LArCalorimeter/LArG4/LArG4RunControl/LArG4RunControl/LArGeoTBGeometricOptions.h @@ -1,9 +1,9 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration */ -#ifndef _LArGeoTBGeometricOptions_h_ -#define _LArGeoTBGeometricOptions_h_ +#ifndef LARG4RUNCONTROL_LARGEOTBGEOMETRICOPTIONS_H +#define LARG4RUNCONTROL_LARGEOTBGEOMETRICOPTIONS_H #include "CLHEP/Units/SystemOfUnits.h" // ----------------------------------------------------------------------// @@ -49,7 +49,7 @@ class LArGeoTBGeometricOptions { }; #ifndef GAUDI_NEUTRAL -#include "CLIDSvc/CLASS_DEF.h" +#include "AthenaKernel/CLASS_DEF.h" CLASS_DEF(LArGeoTBGeometricOptions, 205400553, 1) #endif diff --git a/LArCalorimeter/LArG4/LArG4RunControl/LArG4RunControl/LArGeoTBH1GeoOptions.h b/LArCalorimeter/LArG4/LArG4RunControl/LArG4RunControl/LArGeoTBH1GeoOptions.h index ba4713e0801f57a615adc8ac3b186946e7426c93..f99dd8680b882b976e0e9111b23300fbbac4c879 100755 --- a/LArCalorimeter/LArG4/LArG4RunControl/LArG4RunControl/LArGeoTBH1GeoOptions.h +++ b/LArCalorimeter/LArG4/LArG4RunControl/LArG4RunControl/LArGeoTBH1GeoOptions.h @@ -1,9 +1,9 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration */ -#ifndef _LArGeoTBH1GeoOptions_h_ -#define _LArGeoTBH1GeoOptions_h_ +#ifndef LARG4RUNCONTROL_LARGEOTBH1GEOOPTIONS_H +#define LARG4RUNCONTROL_LARGEOTBH1GEOOPTIONS_H #include "CLHEP/Units/SystemOfUnits.h" // ----------------------------------------------------------------------// @@ -47,7 +47,7 @@ class LArGeoTBH1GeoOptions { }; #ifndef GAUDI_NEUTRAL -#include "CLIDSvc/CLASS_DEF.h" +#include "AthenaKernel/CLASS_DEF.h" CLASS_DEF(LArGeoTBH1GeoOptions, 104187856, 1) #endif diff --git a/LArCalorimeter/LArG4TB/LArG4TBSimEvent/CMakeLists.txt b/LArCalorimeter/LArG4TB/LArG4TBSimEvent/CMakeLists.txt index a628805294a77afb4b62865bd6539efc3229056e..0a32bde9c9c0b55004324d745f30b4f6050ba899 100644 --- a/LArCalorimeter/LArG4TB/LArG4TBSimEvent/CMakeLists.txt +++ b/LArCalorimeter/LArG4TB/LArG4TBSimEvent/CMakeLists.txt @@ -7,8 +7,7 @@ atlas_subdir( LArG4TBSimEvent ) # Declare the package's dependencies: atlas_depends_on_subdirs( PUBLIC - Control/CLIDSvc - Control/SGTools + Control/AthenaKernel Simulation/HitManagement ) # External dependencies: @@ -22,12 +21,12 @@ atlas_add_library( LArG4TBSimEvent INCLUDE_DIRS ${CLHEP_INCLUDE_DIRS} PRIVATE_INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} DEFINITIONS ${CLHEP_DEFINITIONS} - LINK_LIBRARIES ${CLHEP_LIBRARIES} SGTools HitManagement + LINK_LIBRARIES ${CLHEP_LIBRARIES} AthenaKernel HitManagement PRIVATE_LINK_LIBRARIES ${ROOT_LIBRARIES} ) atlas_add_dictionary( LArG4TBSimEventDict LArG4TBSimEvent/LArG4TBSimEventDict.h LArG4TBSimEvent/selection.xml INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} ${CLHEP_INCLUDE_DIRS} - LINK_LIBRARIES ${ROOT_LIBRARIES} ${CLHEP_LIBRARIES} SGTools HitManagement LArG4TBSimEvent ) + LINK_LIBRARIES ${ROOT_LIBRARIES} ${CLHEP_LIBRARIES} HitManagement LArG4TBSimEvent ) diff --git a/LArCalorimeter/LArG4TB/LArG4TBSimEvent/LArG4TBSimEvent/LArG4H6FrontHitCollection.h b/LArCalorimeter/LArG4TB/LArG4TBSimEvent/LArG4TBSimEvent/LArG4H6FrontHitCollection.h index 04f2e98d24c4cf0592690c71b458f41cc88778c6..0ff00ec8dc2da532bc63f326d0a0f546952bbd37 100755 --- a/LArCalorimeter/LArG4TB/LArG4TBSimEvent/LArG4TBSimEvent/LArG4H6FrontHitCollection.h +++ b/LArCalorimeter/LArG4TB/LArG4TBSimEvent/LArG4TBSimEvent/LArG4H6FrontHitCollection.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration */ #ifndef LARTBFRONTHITCOLLECTION_H @@ -7,16 +7,12 @@ #include "LArG4TBSimEvent/LArG4H6FrontHit.h" #include "HitManagement/AthenaHitsVector.h" -#ifndef __CINT__ - #include "CLIDSvc/CLASS_DEF.h" -#endif +#include "AthenaKernel/CLASS_DEF.h" typedef AthenaHitsVector<LArG4H6FrontHit> LArG4H6FrontHitCollection; typedef AthenaHitsVector<LArG4H6FrontHit>::iterator LArG4H6FrontHitIterator; typedef AthenaHitsVector<LArG4H6FrontHit>::const_iterator LArG4H6FrontHitConstIterator; -#ifndef __CINT__ - CLASS_DEF(LArG4H6FrontHitCollection, 1250573243 , 1 ) -#endif +CLASS_DEF(LArG4H6FrontHitCollection, 1250573243 , 1 ) #endif diff --git a/LArCalorimeter/LArG4TB/LArG4TBSimEvent/LArG4TBSimEvent/LArG4H6LeakHitCollection.h b/LArCalorimeter/LArG4TB/LArG4TBSimEvent/LArG4TBSimEvent/LArG4H6LeakHitCollection.h index 2ed976fd1fbafa90abcd57353012e53a1821d7ca..6b6b14e303f53cbea76cce83af5a0b392666ed26 100755 --- a/LArCalorimeter/LArG4TB/LArG4TBSimEvent/LArG4TBSimEvent/LArG4H6LeakHitCollection.h +++ b/LArCalorimeter/LArG4TB/LArG4TBSimEvent/LArG4TBSimEvent/LArG4H6LeakHitCollection.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration */ #ifndef LARTBLEAKHITCOLLECTION_H @@ -7,16 +7,12 @@ #include "LArG4TBSimEvent/LArG4H6LeakHit.h" #include "HitManagement/AthenaHitsVector.h" -#ifndef __CINT__ - #include "CLIDSvc/CLASS_DEF.h" -#endif +#include "AthenaKernel/CLASS_DEF.h" typedef AthenaHitsVector<LArG4H6LeakHit> LArG4H6LeakHitCollection; typedef AthenaHitsVector<LArG4H6LeakHit>::iterator LArG4H6LeakHitIterator; typedef AthenaHitsVector<LArG4H6LeakHit>::const_iterator LArG4H6LeakHitConstIterator; -#ifndef __CINT__ - CLASS_DEF(LArG4H6LeakHitCollection, 1259234314 , 1 ) -#endif +CLASS_DEF(LArG4H6LeakHitCollection, 1259234314 , 1 ) #endif diff --git a/LArCalorimeter/LArG4TB/LArG4TBSimEvent/LArG4TBSimEvent/LArG4H6WarmTCHitCollection.h b/LArCalorimeter/LArG4TB/LArG4TBSimEvent/LArG4TBSimEvent/LArG4H6WarmTCHitCollection.h index c7bae29a38b1bc333cfc953d7da8369932d8b83c..8409fffbbbf4d5ab81170eb8d4a3857754cb210a 100755 --- a/LArCalorimeter/LArG4TB/LArG4TBSimEvent/LArG4TBSimEvent/LArG4H6WarmTCHitCollection.h +++ b/LArCalorimeter/LArG4TB/LArG4TBSimEvent/LArG4TBSimEvent/LArG4H6WarmTCHitCollection.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration */ #ifndef LARTBWARMTCHITCOLLECTION_H @@ -7,16 +7,12 @@ #include "LArG4TBSimEvent/LArG4H6WarmTCHit.h" #include "HitManagement/AthenaHitsVector.h" -#ifndef __CINT__ - #include "CLIDSvc/CLASS_DEF.h" -#endif +#include "AthenaKernel/CLASS_DEF.h" typedef AthenaHitsVector<LArG4H6WarmTCHit> LArG4H6WarmTCHitCollection; typedef AthenaHitsVector<LArG4H6WarmTCHit>::iterator LArG4H6WarmTCHitIterator; typedef AthenaHitsVector<LArG4H6WarmTCHit>::const_iterator LArG4H6WarmTCHitConstIterator; -#ifndef __CINT__ - CLASS_DEF(LArG4H6WarmTCHitCollection, 1319483403 , 1 ) -#endif +CLASS_DEF(LArG4H6WarmTCHitCollection, 1319483403 , 1 ) #endif diff --git a/LArCalorimeter/LArG4TB/LArG4TBSimEvent/LArG4TBSimEvent/LArTBFrontHitCollection.h b/LArCalorimeter/LArG4TB/LArG4TBSimEvent/LArG4TBSimEvent/LArTBFrontHitCollection.h index 56ba2d2fb91b0a20b3dca9741d6bbe81a8d7a285..772be5fb02cb1572c1ae685b2ec81868e7c39cfe 100755 --- a/LArCalorimeter/LArG4TB/LArG4TBSimEvent/LArG4TBSimEvent/LArTBFrontHitCollection.h +++ b/LArCalorimeter/LArG4TB/LArG4TBSimEvent/LArG4TBSimEvent/LArTBFrontHitCollection.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration */ #ifndef LARTBFRONTHITCOLLECTION_H @@ -7,16 +7,12 @@ #include "LArG4TBSimEvent/LArTBFrontHit.h" #include "HitManagement/AthenaHitsVector.h" -#ifndef __CINT__ - #include "CLIDSvc/CLASS_DEF.h" -#endif +#include "AthenaKernel/CLASS_DEF.h" typedef AthenaHitsVector<LArTBFrontHit> LArTBFrontHitCollection; typedef AthenaHitsVector<LArTBFrontHit>::iterator LArTBFrontHitIterator; typedef AthenaHitsVector<LArTBFrontHit>::const_iterator LArTBFrontHitConstIterator; -#ifndef __CINT__ - CLASS_DEF(LArTBFrontHitCollection, 176134262 , 1 ) -#endif +CLASS_DEF(LArTBFrontHitCollection, 176134262 , 1 ) #endif diff --git a/LArCalorimeter/LArG4TB/LArG4TBSimEvent/LArG4TBSimEvent/LArTBLeakHitCollection.h b/LArCalorimeter/LArG4TB/LArG4TBSimEvent/LArG4TBSimEvent/LArTBLeakHitCollection.h index 3e568dc76ea23712cc55fbfdd6ec33d507647b22..37a7aaefde810673981c02bc58b4783cadca7cef 100755 --- a/LArCalorimeter/LArG4TB/LArG4TBSimEvent/LArG4TBSimEvent/LArTBLeakHitCollection.h +++ b/LArCalorimeter/LArG4TB/LArG4TBSimEvent/LArG4TBSimEvent/LArTBLeakHitCollection.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration */ #ifndef LARTBLEAKHITCOLLECTION_H @@ -7,16 +7,12 @@ #include "LArG4TBSimEvent/LArTBLeakHit.h" #include "HitManagement/AthenaHitsVector.h" -#ifndef __CINT__ - #include "CLIDSvc/CLASS_DEF.h" -#endif +#include "AthenaKernel/CLASS_DEF.h" typedef AthenaHitsVector<LArTBLeakHit> LArTBLeakHitCollection; typedef AthenaHitsVector<LArTBLeakHit>::iterator LArTBLeakHitIterator; typedef AthenaHitsVector<LArTBLeakHit>::const_iterator LArTBLeakHitConstIterator; -#ifndef __CINT__ - CLASS_DEF(LArTBLeakHitCollection, 196013649 , 1 ) -#endif +CLASS_DEF(LArTBLeakHitCollection, 196013649 , 1 ) #endif diff --git a/LArCalorimeter/LArG4TB/LArG4TBSimEvent/LArG4TBSimEvent/LArTBWarmTCHitCollection.h b/LArCalorimeter/LArG4TB/LArG4TBSimEvent/LArG4TBSimEvent/LArTBWarmTCHitCollection.h index d348a7223dba10f9419d7f6d1622eb47d8bed3eb..7a0ecc371b424206bcc9b1544fd7b53927313e9f 100755 --- a/LArCalorimeter/LArG4TB/LArG4TBSimEvent/LArG4TBSimEvent/LArTBWarmTCHitCollection.h +++ b/LArCalorimeter/LArG4TB/LArG4TBSimEvent/LArG4TBSimEvent/LArTBWarmTCHitCollection.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration */ #ifndef LARTBWARMTCHITCOLLECTION_H @@ -7,16 +7,12 @@ #include "LArG4TBSimEvent/LArTBWarmTCHit.h" #include "HitManagement/AthenaHitsVector.h" -#ifndef __CINT__ - #include "CLIDSvc/CLASS_DEF.h" -#endif +#include "AthenaKernel/CLASS_DEF.h" typedef AthenaHitsVector<LArTBWarmTCHit> LArTBWarmTCHitCollection; typedef AthenaHitsVector<LArTBWarmTCHit>::iterator LArTBWarmTCHitIterator; typedef AthenaHitsVector<LArTBWarmTCHit>::const_iterator LArTBWarmTCHitConstIterator; -#ifndef __CINT__ - CLASS_DEF(LArTBWarmTCHitCollection, 96211162 , 1 ) -#endif +CLASS_DEF(LArTBWarmTCHitCollection, 96211162 , 1 ) #endif diff --git a/LArCalorimeter/LArGeoModel/LArHV/CMakeLists.txt b/LArCalorimeter/LArGeoModel/LArHV/CMakeLists.txt index 603c9b8b9c3a909d85204010e19aeaa262de85de..edbe76fe6d7232b2e5ce359c947711d75dded1e7 100644 --- a/LArCalorimeter/LArGeoModel/LArHV/CMakeLists.txt +++ b/LArCalorimeter/LArGeoModel/LArHV/CMakeLists.txt @@ -7,9 +7,8 @@ atlas_subdir( LArHV ) # Declare the package's dependencies: atlas_depends_on_subdirs( PUBLIC - Control/CLIDSvc + Control/AthenaKernel Control/IOVSvc - Control/SGTools Control/StoreGate DetectorDescription/GeoModel/GeoModelKernel PRIVATE @@ -23,6 +22,6 @@ atlas_depends_on_subdirs( PUBLIC atlas_add_library( LArHV src/*.cpp PUBLIC_HEADERS LArHV - LINK_LIBRARIES SGTools GeoModelKernel IOVSvcLib StoreGateLib SGtests LArCablingLib + LINK_LIBRARIES AthenaKernel GeoModelKernel IOVSvcLib StoreGateLib SGtests LArCablingLib PRIVATE_LINK_LIBRARIES AthenaPoolUtilities Identifier GaudiKernel LArIdentifier ) diff --git a/LArCalorimeter/LArGeoModel/LArHV/LArHV/LArHVManager.h b/LArCalorimeter/LArGeoModel/LArHV/LArHV/LArHVManager.h index 2fea6b2bed5ada4bfd2f36c0953e45b6f969d59e..92a2da7791edb2270073baca7be3473bdae8a3cb 100644 --- a/LArCalorimeter/LArGeoModel/LArHV/LArHV/LArHVManager.h +++ b/LArCalorimeter/LArGeoModel/LArHV/LArHV/LArHVManager.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration */ #ifndef LARHVMANAGER_H_HEADER_INCLUDED_E73E3A24 @@ -74,7 +74,7 @@ class LArHVManager }; -#include "CLIDSvc/CLASS_DEF.h" +#include "AthenaKernel/CLASS_DEF.h" CLASS_DEF(LArHVManager, 203332428, 1) #endif /* LARHVMANAGER_H_HEADER_INCLUDED_E73E3A24 */ diff --git a/LArCalorimeter/LArGeoModel/LArReadoutGeometry/CMakeLists.txt b/LArCalorimeter/LArGeoModel/LArReadoutGeometry/CMakeLists.txt index aa5d1a29e515774d8954889c5e5b861fd0b04959..c8973510949dd2781d8c37477d3ab2b0e110155e 100644 --- a/LArCalorimeter/LArGeoModel/LArReadoutGeometry/CMakeLists.txt +++ b/LArCalorimeter/LArGeoModel/LArReadoutGeometry/CMakeLists.txt @@ -7,8 +7,7 @@ atlas_subdir( LArReadoutGeometry ) # Declare the package's dependencies: atlas_depends_on_subdirs( PUBLIC - Control/CLIDSvc - Control/SGTools + Control/AthenaKernel DetectorDescription/GeoModel/GeoModelKernel DetectorDescription/GeoPrimitives DetectorDescription/Identifier @@ -33,6 +32,6 @@ atlas_add_library( LArReadoutGeometry INCLUDE_DIRS ${EIGEN_INCLUDE_DIRS} PRIVATE_INCLUDE_DIRS ${Boost_INCLUDE_DIRS} ${CORAL_INCLUDE_DIRS} ${CLHEP_INCLUDE_DIRS} PRIVATE_DEFINITIONS ${CLHEP_DEFINITIONS} - LINK_LIBRARIES ${EIGEN_LIBRARIES} SGTools GeoModelKernel GeoPrimitives Identifier LArHV StoreGateLib SGtests + LINK_LIBRARIES ${EIGEN_LIBRARIES} AthenaKernel GeoModelKernel GeoPrimitives Identifier LArHV StoreGateLib SGtests PRIVATE_LINK_LIBRARIES ${Boost_LIBRARIES} ${CORAL_LIBRARIES} ${CLHEP_LIBRARIES} GeoModelUtilities GaudiKernel ) diff --git a/LArCalorimeter/LArGeoModel/LArReadoutGeometry/LArReadoutGeometry/EMBDetectorManager.h b/LArCalorimeter/LArGeoModel/LArReadoutGeometry/LArReadoutGeometry/EMBDetectorManager.h index 89201984a72915a82ae79366ca38374f9c3a1c52..24a63de1ff77022c8267eaeb5c7666fce0a01245 100755 --- a/LArCalorimeter/LArGeoModel/LArReadoutGeometry/LArReadoutGeometry/EMBDetectorManager.h +++ b/LArCalorimeter/LArGeoModel/LArReadoutGeometry/LArReadoutGeometry/EMBDetectorManager.h @@ -1,10 +1,10 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration */ #ifndef EMBDetectorManager_h #define EMBDetectorManager_h 1 -#include "CLIDSvc/CLASS_DEF.h" +#include "AthenaKernel/CLASS_DEF.h" #include <vector> #include "GeoModelKernel/GeoVDetectorManager.h" #include "LArReadoutGeometry/EMBAccordionDetails.h" diff --git a/LArCalorimeter/LArGeoModel/LArReadoutGeometry/LArReadoutGeometry/EMECDetectorManager.h b/LArCalorimeter/LArGeoModel/LArReadoutGeometry/LArReadoutGeometry/EMECDetectorManager.h index 993a0e8c3b6ce9b52abd27b0fae68d555c638ab8..b69b7c1645960cb1247a82672d07b2597f2a7fb5 100755 --- a/LArCalorimeter/LArGeoModel/LArReadoutGeometry/LArReadoutGeometry/EMECDetectorManager.h +++ b/LArCalorimeter/LArGeoModel/LArReadoutGeometry/LArReadoutGeometry/EMECDetectorManager.h @@ -1,10 +1,10 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration */ #ifndef EMECDetectorManager_h #define EMECDetectorManager_h 1 -#include "CLIDSvc/CLASS_DEF.h" +#include "AthenaKernel/CLASS_DEF.h" #include "GeoModelKernel/GeoVDetectorManager.h" #include "LArHV/EMECHVManager.h" #include "LArHV/EMECPresamplerHVManager.h" diff --git a/LArCalorimeter/LArGeoModel/LArReadoutGeometry/LArReadoutGeometry/FCALDetectorManager.h b/LArCalorimeter/LArGeoModel/LArReadoutGeometry/LArReadoutGeometry/FCALDetectorManager.h index 45298b9f8f95a977a6a456f2e78a05da3f1d486a..70901e31b5fe820ed54f0783653a86eb35b80ad7 100755 --- a/LArCalorimeter/LArGeoModel/LArReadoutGeometry/LArReadoutGeometry/FCALDetectorManager.h +++ b/LArCalorimeter/LArGeoModel/LArReadoutGeometry/LArReadoutGeometry/FCALDetectorManager.h @@ -1,12 +1,12 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration */ #ifndef FCALDetectorManager_h #define FCALDetectorManager_h 1 #include "LArReadoutGeometry/FCAL_ChannelMap.h" #include "LArReadoutGeometry/FCALModule.h" -#include "CLIDSvc/CLASS_DEF.h" +#include "AthenaKernel/CLASS_DEF.h" #include <vector> #include "GeoModelKernel/GeoVDetectorManager.h" class FCALHVManager; diff --git a/LArCalorimeter/LArGeoModel/LArReadoutGeometry/LArReadoutGeometry/FCAL_ChannelMap.h b/LArCalorimeter/LArGeoModel/LArReadoutGeometry/LArReadoutGeometry/FCAL_ChannelMap.h index ba65c06f86523986ee334584d96dffd27f2b6534..93b5a5654310b0a25c3498102f30b709ec7c219f 100755 --- a/LArCalorimeter/LArGeoModel/LArReadoutGeometry/LArReadoutGeometry/FCAL_ChannelMap.h +++ b/LArCalorimeter/LArGeoModel/LArReadoutGeometry/LArReadoutGeometry/FCAL_ChannelMap.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration */ // *************************************************************************** @@ -274,7 +274,7 @@ m_invert_xy = flag; return ; } -#include "CLIDSvc/CLASS_DEF.h" +#include "AthenaKernel/CLASS_DEF.h" CLASS_DEF(FCAL_ChannelMap, 74242524, 1) #endif // LARDETDESCR_FCAL_CHANNELMAP_H diff --git a/LArCalorimeter/LArGeoModel/LArReadoutGeometry/LArReadoutGeometry/GeoStraightAccSection.h b/LArCalorimeter/LArGeoModel/LArReadoutGeometry/LArReadoutGeometry/GeoStraightAccSection.h index 4d4fe41336959021fa2260ede3f358f2ffe61d45..c70b041be0f667b5f01e959818c7ef99cfae9bee 100644 --- a/LArCalorimeter/LArGeoModel/LArReadoutGeometry/LArReadoutGeometry/GeoStraightAccSection.h +++ b/LArCalorimeter/LArGeoModel/LArReadoutGeometry/LArReadoutGeometry/GeoStraightAccSection.h @@ -1,11 +1,11 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration */ -#ifndef _GeoStraightAccSection_h_ -#define _GeoStraightAccSection_h_ +#ifndef LARREADOUTGEOMETRY_GEOSTRAIGHTACCSECTION_H +#define LARREADOUTGEOMETRY_GEOSTRAIGHTACCSECTION_H -#include "CLIDSvc/CLASS_DEF.h" +#include "AthenaKernel/CLASS_DEF.h" #include "GeoModelKernel/GeoXF.h" /** * @brief Record of All Electrode Straight Pieces diff --git a/LArCalorimeter/LArGeoModel/LArReadoutGeometry/LArReadoutGeometry/HECDetectorManager.h b/LArCalorimeter/LArGeoModel/LArReadoutGeometry/LArReadoutGeometry/HECDetectorManager.h index 4d447deffa89875b5d96bd4cf402fbdcfda2298d..364fc91e78bb6e265402034643010b74337e30ee 100755 --- a/LArCalorimeter/LArGeoModel/LArReadoutGeometry/LArReadoutGeometry/HECDetectorManager.h +++ b/LArCalorimeter/LArGeoModel/LArReadoutGeometry/LArReadoutGeometry/HECDetectorManager.h @@ -1,10 +1,10 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration */ #ifndef HECDetectorManager_h #define HECDetectorManager_h 1 -#include "CLIDSvc/CLASS_DEF.h" +#include "AthenaKernel/CLASS_DEF.h" #include "LArReadoutGeometry/HECLongBlock.h" #include "GeoModelKernel/GeoVDetectorManager.h" class HECDetDescr; diff --git a/LArCalorimeter/LArGeoModel/LArReadoutGeometry/LArReadoutGeometry/LArDetectorManager.h b/LArCalorimeter/LArGeoModel/LArReadoutGeometry/LArReadoutGeometry/LArDetectorManager.h index e84ba05249841da31ab10dc71bba52fa5fc49ae9..49bf4d5411eb631d769ba261215c8755dd7bc370 100755 --- a/LArCalorimeter/LArGeoModel/LArReadoutGeometry/LArReadoutGeometry/LArDetectorManager.h +++ b/LArCalorimeter/LArGeoModel/LArReadoutGeometry/LArReadoutGeometry/LArDetectorManager.h @@ -1,10 +1,10 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration */ #ifndef LArDetectorManager_h #define LArDetectorManager_h 1 -#include "CLIDSvc/CLASS_DEF.h" +#include "AthenaKernel/CLASS_DEF.h" #include "GeoModelKernel/GeoVDetectorManager.h" class EMBDetectorManager; class EMECDetectorManager; diff --git a/LArCalorimeter/LArIdentifier/CMakeLists.txt b/LArCalorimeter/LArIdentifier/CMakeLists.txt index 56227dc63f78fa57326ce54952ab5b9ee72dbbfe..696ba6bdc47961182169d66f223f060b90ac0557 100644 --- a/LArCalorimeter/LArIdentifier/CMakeLists.txt +++ b/LArCalorimeter/LArIdentifier/CMakeLists.txt @@ -7,14 +7,12 @@ atlas_subdir( LArIdentifier ) # Declare the package's dependencies: atlas_depends_on_subdirs( PUBLIC - Control/CLIDSvc - Control/SGTools + Control/AthenaKernel DetectorDescription/AtlasDetDescr DetectorDescription/IdDict DetectorDescription/Identifier PRIVATE Calorimeter/CaloIdentifier - Control/AthenaKernel Control/StoreGate DetectorDescription/IdDictParser GaudiKernel ) @@ -27,22 +25,22 @@ atlas_add_library( LArIdentifier src/*.cxx PUBLIC_HEADERS LArIdentifier PRIVATE_INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} - LINK_LIBRARIES SGTools AtlasDetDescr IdDict Identifier StoreGateLib SGtests + LINK_LIBRARIES AthenaKernel AtlasDetDescr IdDict Identifier StoreGateLib SGtests PRIVATE_LINK_LIBRARIES ${ROOT_LIBRARIES} CaloIdentifier AthenaKernel IdDictParser GaudiKernel ) atlas_add_dictionary( LArIdentifierDict LArIdentifier/LArIdentifierDict.h LArIdentifier/selection.xml INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} - LINK_LIBRARIES ${ROOT_LIBRARIES} SGTools AtlasDetDescr IdDict Identifier CaloIdentifier AthenaKernel StoreGateLib SGtests IdDictParser GaudiKernel LArIdentifier ) + LINK_LIBRARIES ${ROOT_LIBRARIES} AtlasDetDescr IdDict Identifier CaloIdentifier AthenaKernel StoreGateLib SGtests IdDictParser GaudiKernel LArIdentifier ) atlas_add_executable( test_laronlineid test/test_laronlineid.cxx INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} - LINK_LIBRARIES ${ROOT_LIBRARIES} SGTools AtlasDetDescr IdDict Identifier CaloIdentifier AthenaKernel StoreGateLib SGtests IdDictParser GaudiKernel LArIdentifier ) + LINK_LIBRARIES ${ROOT_LIBRARIES} AtlasDetDescr IdDict Identifier CaloIdentifier AthenaKernel StoreGateLib SGtests IdDictParser GaudiKernel LArIdentifier ) atlas_add_executable( test_larhvid test/test_larhvid.cxx INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} - LINK_LIBRARIES ${ROOT_LIBRARIES} SGTools AtlasDetDescr IdDict Identifier CaloIdentifier AthenaKernel StoreGateLib SGtests IdDictParser GaudiKernel LArIdentifier ) + LINK_LIBRARIES ${ROOT_LIBRARIES} AtlasDetDescr IdDict Identifier CaloIdentifier AthenaKernel StoreGateLib SGtests IdDictParser GaudiKernel LArIdentifier ) diff --git a/LArCalorimeter/LArIdentifier/LArIdentifier/LArElectrodeID.h b/LArCalorimeter/LArIdentifier/LArIdentifier/LArElectrodeID.h index ae6e5b040d36b35164f7a5d8ac6f908bcc76dd24..35440f1f8722af2903fc17d82a2f6c2862d62c47 100755 --- a/LArCalorimeter/LArIdentifier/LArIdentifier/LArElectrodeID.h +++ b/LArCalorimeter/LArIdentifier/LArIdentifier/LArElectrodeID.h @@ -1,11 +1,11 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration */ #ifndef LARIDENTIFIER_LARELECTRODEID_H #define LARIDENTIFIER_LARELECTRODEID_H -#include "CLIDSvc/CLASS_DEF.h" +#include "AthenaKernel/CLASS_DEF.h" #include "AtlasDetDescr/AtlasDetectorID.h" #include "Identifier/HWIdentifier.h" #include "Identifier/IdentifierHash.h" diff --git a/LArCalorimeter/LArIdentifier/LArIdentifier/LArHVLineID.h b/LArCalorimeter/LArIdentifier/LArIdentifier/LArHVLineID.h index ef6f1a3057a4c44b34f15b394ea17455a1025549..cef4286edf511d69704d7fb33d45e6ca260145a6 100755 --- a/LArCalorimeter/LArIdentifier/LArIdentifier/LArHVLineID.h +++ b/LArCalorimeter/LArIdentifier/LArIdentifier/LArHVLineID.h @@ -1,11 +1,11 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration */ #ifndef LARIDENTIFIER_LARHVLINEID_H #define LARIDENTIFIER_LARHVLINEID_H -#include "CLIDSvc/CLASS_DEF.h" +#include "AthenaKernel/CLASS_DEF.h" #include "AtlasDetDescr/AtlasDetectorID.h" #include "Identifier/HWIdentifier.h" #include "Identifier/IdentifierHash.h" diff --git a/LArCalorimeter/LArIdentifier/LArIdentifier/LArIdManager.h b/LArCalorimeter/LArIdentifier/LArIdentifier/LArIdManager.h index 20668fd2f244304426ed394483a52a89b5d311c3..9ae61deff763a990dc2d6bfe8b5327860b078a68 100755 --- a/LArCalorimeter/LArIdentifier/LArIdentifier/LArIdManager.h +++ b/LArCalorimeter/LArIdentifier/LArIdentifier/LArIdManager.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration */ /*************************************************************************** @@ -15,7 +15,7 @@ //<<<<<< INCLUDES >>>>>> -#include "CLIDSvc/CLASS_DEF.h" +#include "AthenaKernel/CLASS_DEF.h" #include "Identifier/HWIdentifier.h" #include "Identifier/IdentifierHash.h" diff --git a/LArCalorimeter/LArIdentifier/LArIdentifier/LArOnlineID_Base.h b/LArCalorimeter/LArIdentifier/LArIdentifier/LArOnlineID_Base.h index fd73570f3acf648625209740b128cec52e2ac4f7..457d2ba52a9bedd64cdf2b935568116072fe1d71 100755 --- a/LArCalorimeter/LArIdentifier/LArIdentifier/LArOnlineID_Base.h +++ b/LArCalorimeter/LArIdentifier/LArIdentifier/LArOnlineID_Base.h @@ -1,11 +1,11 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration */ #ifndef LARONLINEID_BASE_H #define LARONLINEID_BASE_H -#include "CLIDSvc/CLASS_DEF.h" +#include "AthenaKernel/CLASS_DEF.h" #include "AtlasDetDescr/AtlasDetectorID.h" #include "Identifier/HWIdentifier.h" #include "Identifier/IdentifierHash.h" diff --git a/LArCalorimeter/LArIdentifier/doc/used_packages.html b/LArCalorimeter/LArIdentifier/doc/used_packages.html index b73b7ea7aa6d612d64685e850717b49a2d6ae4b0..650cd6bd0479f6bd8fe23033c191b6805be8ad6d 100755 --- a/LArCalorimeter/LArIdentifier/doc/used_packages.html +++ b/LArCalorimeter/LArIdentifier/doc/used_packages.html @@ -5,7 +5,7 @@ <tr><td><a href="/afs/cern.ch/atlas/software/builds/AtlasCore/2.3.0/InstallArea/doc/IdDict/html/index.html">DetectorDescription/IdDict</a></td></tr> <tr><td><a href="/afs/cern.ch/user/l/lucotte/scratch0/12.3.0/InstallArea/doc/IdDictParser/html/index.html">DetectorDescription/IdDictParser</a></td></tr> <tr><td><a href="/afs/cern.ch/atlas/software/builds/AtlasCore/2.3.0/InstallArea/doc/AtlasSEAL/html/index.html">External/AtlasSEAL</a></td></tr> -<tr><td><a href="/afs/cern.ch/atlas/software/builds/AtlasCore/2.3.0/InstallArea/doc/CLIDSvc/html/index.html">Control/CLIDSvc</a></td></tr> +<tr><td><a href="/afs/cern.ch/atlas/software/builds/AtlasCore/2.3.0/InstallArea/doc/AthenaKernel/html/index.html">Control/AthenaKernel</a></td></tr> <tr><td><a href="/afs/cern.ch/atlas/software/builds/AtlasCore/2.3.0/InstallArea/doc/AtlasDetDescr/html/index.html">DetectorDescription/AtlasDetDescr</a></td></tr> <tr><td><a href="/afs/cern.ch/atlas/software/builds/AtlasCore/2.3.0/InstallArea/doc/StoreGate/html/index.html">Control/StoreGate</a></td></tr> <tr><td><a href="/afs/cern.ch/atlas/software/builds/AtlasConditions/2.3.0/InstallArea/doc/CaloIdentifier/html/index.html">Calorimeter/CaloIdentifier</a></td></tr> diff --git a/LArCalorimeter/LArL1Sim/LArL1Sim/LArTTL1Maker.h b/LArCalorimeter/LArL1Sim/LArL1Sim/LArTTL1Maker.h index ecfc704b451a1b300b7758f01113f238c4a81352..cd3974049346a79ddab690c784d26ff27a3a7186 100755 --- a/LArCalorimeter/LArL1Sim/LArL1Sim/LArTTL1Maker.h +++ b/LArCalorimeter/LArL1Sim/LArL1Sim/LArTTL1Maker.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration */ #ifndef LARL1SIM_LARTTL1MAKER_H @@ -22,8 +22,12 @@ #include "LArDigitization/LArHitEMap.h" #include "LArElecCalib/ILArfSampl.h" +#include "StoreGate/ReadCondHandleKey.h" +#include "StoreGate/ReadHandleKey.h" +#include "StoreGate/WriteHandleKey.h" -class StoreGateSvc; +#include "LArSimEvent/LArHitContainer.h" +#include "LArRawEvent/LArTTL1Container.h" class PileUpMergeSvc; class IAtRndmGenSvc; class ITriggerTime; @@ -81,7 +85,6 @@ class LArTTL1Maker : public AthAlgorithm, // // >>>>>>>> private algorithm parts // - StatusCode retrieveDatabase(); /** initialize hit map */ @@ -115,16 +118,14 @@ class LArTTL1Maker : public AthAlgorithm, /** Alorithm property: use trigger time or not*/ bool m_useTriggerTime; /** Alorithm property: name of the TriggerTimeTool*/ - StringProperty m_triggerTimeToolName; - /** pointer to the TriggerTimeTool */ - ITriggerTime* p_triggerTimeTool; - /** use HitEmap from detector store or no */ + ToolHandle<ITriggerTime> m_triggerTimeTool; + + /** use HitEmap from detector store or no */ bool m_useMapfromStore; - + int m_BeginRunPriority; - LArCablingService* m_cablingSvc; - CaloTriggerTowerService* m_ttSvc; + ToolHandle<CaloTriggerTowerService> m_ttSvc; /** pointer to the offline TT helper */ const CaloLVL1_ID* m_lvl1Helper; /** pointer to the offline EM helper */ @@ -134,7 +135,8 @@ class LArTTL1Maker : public AthAlgorithm, /** pointer to the offline FCAL helper */ const LArFCAL_ID* m_fcalHelper; /** Sampling fractions retrieved from DB */ - const DataHandle<ILArfSampl> m_dd_fSampl; + //const DataHandle<ILArfSampl> m_dd_fSampl; + SG::ReadCondHandleKey<ILArfSampl> m_fSamplKey; /** number of sampling (in depth) */ static const short s_NBDEPTHS = 4 ; @@ -211,26 +213,13 @@ class LArTTL1Maker : public AthAlgorithm, /** hit map */ LArHitEMap* m_hitmap; // map of hits in cell - /** list of hit containers */ - std::vector <std::string> m_HitContainer; - -/** algorithm property: sub-detectors to be simulated */ - std::string m_SubDetectors; /** algorithm property: container name for the EM TTL1s */ - std::string m_EmTTL1ContainerName; + SG::WriteHandleKey<LArTTL1Container> m_EmTTL1ContainerName; /** algorithm property: container name for the HAD TTL1s */ - std::string m_HadTTL1ContainerName; - -/** algorithm property: container name of the EMB hits */ - std::string m_EmBarrelHitContainerName; -/** algorithm property: container name of the EMEC hits */ - std::string m_EmEndCapHitContainerName; -/** algorithm property: container name of the HEC hits */ - std::string m_HecHitContainerName; -/** algorithm property: container name of the FCAL hits */ - std::string m_ForWardHitContainerName; + SG::WriteHandleKey<LArTTL1Container> m_HadTTL1ContainerName; + std::array<SG::ReadHandleKey<LArHitContainer>,4> m_xxxHitContainerName; /** algorithm property: noise (in all sub-detectors) is on if true */ bool m_NoiseOnOff; @@ -244,8 +233,6 @@ class LArTTL1Maker : public AthAlgorithm, float m_debugThresh; /** algorithm property: switch chrono on */ bool m_chronoTest; -/** key to access of fSamplKey */ - std::string m_fSamplKey; /** key for saving truth */ std::string m_truthHitsContainer; @@ -253,15 +240,3 @@ class LArTTL1Maker : public AthAlgorithm, }; #endif - - - - - - - - - - - - diff --git a/LArCalorimeter/LArL1Sim/src/LArTTL1Maker.cxx b/LArCalorimeter/LArL1Sim/src/LArTTL1Maker.cxx index c171342d92098956e10277ecc598ccbe78d96614..672667e2f9f895a0415b93b7bd4c4b5ce72a0b0c 100755 --- a/LArCalorimeter/LArL1Sim/src/LArTTL1Maker.cxx +++ b/LArCalorimeter/LArL1Sim/src/LArTTL1Maker.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration */ // +======================================================================+ @@ -23,7 +23,7 @@ #include "GaudiKernel/ServiceHandle.h" #include "LArRawEvent/LArTTL1.h" -#include "LArRawEvent/LArTTL1Container.h" + #include "LArSimEvent/LArHitContainer.h" #include "LArDigitization/LArHitList.h" @@ -32,7 +32,6 @@ #include "CaloIdentifier/CaloID_Exception.h" #include "CaloIdentifier/CaloLVL1_ID.h" #include "LArIdentifier/LArIdManager.h" -#include "LArCabling/LArCablingService.h" #include "CaloTriggerTool/CaloTriggerTowerService.h" // // ........ Event Header Files: @@ -43,13 +42,8 @@ // // ........ Gaudi needed includes // -#include "GaudiKernel/Property.h" -#include "GaudiKernel/IService.h" #include "GaudiKernel/IChronoStatSvc.h" -#include "GaudiKernel/IToolSvc.h" -#include "GaudiKernel/ListItem.h" #include "GaudiKernel/IIncidentSvc.h" -#include "StoreGate/StoreGateSvc.h" #include "PathResolver/PathResolver.h" // Pile up @@ -74,8 +68,13 @@ LArTTL1Maker::LArTTL1Maker(const std::string& name, ISvcLocator* pSvcLocator) : , m_atRndmGenSvc("AtRndmGenSvc",name) , m_rndmEngineName("LArTTL1Maker") , m_rndmEngine(0) - , m_hitmap(0) + , m_ttSvc("CaloTriggerTowerService") , m_fSamplKey("LArfSampl") + , m_hitmap(0) + , m_EmTTL1ContainerName{"LArTTL1EM"} + , m_HadTTL1ContainerName{"LArTTL1HAD"} + , m_xxxHitContainerName{{std::string("LArHitEMB"),std::string("LArHitEMEC"), std::string("LArHitHEC"),std::string("LArHitFCAL")}} + // + -------------------------------------------------------------------- + // + Author ........: F. Ledroit + // + Creation date .: 09/01/2003 + @@ -88,27 +87,24 @@ LArTTL1Maker::LArTTL1Maker(const std::string& name, ISvcLocator* pSvcLocator) : m_chronSvc = 0; m_mergeSvc = 0; m_useTriggerTime = false; - m_triggerTimeToolName = "CosmicTriggerTimeTool"; - p_triggerTimeTool = 0; + //m_triggerTimeToolName = "CosmicTriggerTimeTool"; + //p_triggerTimeTool = 0; m_useMapfromStore = true; m_BeginRunPriority = 100; - m_cablingSvc = 0; - m_ttSvc = 0; m_lvl1Helper = 0; m_emHelper = 0; m_hecHelper = 0; m_fcalHelper = 0; - m_SubDetectors = "LAr_All"; m_EmTTL1ContainerName = "LArTTL1EM"; m_HadTTL1ContainerName = "LArTTL1HAD"; - m_EmBarrelHitContainerName = "LArHitEMB"; - m_EmEndCapHitContainerName = "LArHitEMEC"; - m_HecHitContainerName = "LArHitHEC"; - m_ForWardHitContainerName = "LArHitFCAL"; + //m_EmBarrelHitContainerName = "LArHitEMB"; + //m_EmEndCapHitContainerName = "LArHitEMEC"; + //m_HecHitContainerName = "LArHitHEC"; + //m_ForWardHitContainerName = "LArHitFCAL"; m_NoiseOnOff = true; m_PileUp = false; @@ -137,13 +133,12 @@ LArTTL1Maker::LArTTL1Maker(const std::string& name, ISvcLocator* pSvcLocator) : // ........ declare the private data as properties // - declareProperty("SubDetectors",m_SubDetectors); declareProperty("RndmSvc", m_atRndmGenSvc); - declareProperty("EmBarrelHitContainerName",m_EmBarrelHitContainerName); - declareProperty("EmEndCapHitContainerName",m_EmEndCapHitContainerName); - declareProperty("HecHitContainerName",m_HecHitContainerName); - declareProperty("ForWardHitContainerName",m_ForWardHitContainerName); + declareProperty("EmBarrelHitContainerName", m_xxxHitContainerName[0]); + declareProperty("EmEndCapHitContainerName",m_xxxHitContainerName[1]); + declareProperty("HecHitContainerName",m_xxxHitContainerName[2]); + declareProperty("ForWardHitContainerName",m_xxxHitContainerName[3]); declareProperty("EmTTL1ContainerName",m_EmTTL1ContainerName); declareProperty("HadTTL1ContainerName",m_HadTTL1ContainerName); @@ -152,7 +147,7 @@ LArTTL1Maker::LArTTL1Maker(const std::string& name, ISvcLocator* pSvcLocator) : declareProperty("PileUp",m_PileUp); declareProperty("UseTriggerTime",m_useTriggerTime); - declareProperty("TriggerTimeToolName",m_triggerTimeToolName); + declareProperty("TriggerTimeToolName",m_triggerTimeTool); declareProperty("EmBarrelCalibrationCoeffs",m_calibCoeffEmb); declareProperty("EmEndCapCalibrationCoeffs",m_calibCoeffEmec); @@ -167,7 +162,8 @@ LArTTL1Maker::LArTTL1Maker(const std::string& name, ISvcLocator* pSvcLocator) : declareProperty("useMapFromStore",m_useMapfromStore,"Use LArHitEMap already filled from detector store"); - declareProperty("TruthHitsContainer",m_truthHitsContainer="","Specify a value to get a pair of LArTTL1 containers with the truth hits in them"); + declareProperty("TruthHitsContainer",m_truthHitsContainer="","Specify a value to get a pair of LArTTL1 containers with the truth hits in them"); + declareProperty("LArfSamplKey",m_fSamplKey); // return; @@ -224,7 +220,7 @@ StatusCode LArTTL1Maker::initialize() // if (m_useTriggerTime) { - ATH_MSG_INFO ( "use Trigger Time service " << m_triggerTimeToolName ); + ATH_MSG_INFO ( "use Trigger Time service " << m_triggerTimeTool ); } else { @@ -275,23 +271,12 @@ StatusCode LArTTL1Maker::initialize() } if (m_useTriggerTime) { - IToolSvc* p_toolSvc = 0; - ATH_CHECK( service("ToolSvc", p_toolSvc) ); - - IAlgTool* algtool(0); - ListItem theTool(m_triggerTimeToolName.value()); - StatusCode sc = p_toolSvc->retrieveTool(theTool.type(), theTool.name(),algtool); - if (sc.isFailure()) { - ATH_MSG_ERROR - ( "Unable to find tool for " << m_triggerTimeToolName.value() ); - p_triggerTimeTool = 0; - } - else { - p_triggerTimeTool=dynamic_cast<ITriggerTime*>(algtool); - ATH_MSG_DEBUG ( "retrieved TriggerTime tool: " - << m_triggerTimeToolName.value() ); - } + ATH_CHECK(m_triggerTimeTool.retrieve()); + } + else { + m_triggerTimeTool.disable(); } + // // ..... need LAr and CaloIdManager to retrieve all needed helpers @@ -324,11 +309,7 @@ StatusCode LArTTL1Maker::initialize() ATH_CHECK( detStore()->retrieve(m_fcalHelper) ); ATH_MSG_DEBUG ( "Successfully retrieved LArFCAL helper from DetectorStore" ); - // ..... need cabling services, to get channels associated to each TT - IToolSvc* toolSvc = nullptr; - ATH_CHECK( service( "ToolSvc",toolSvc ) ); - ATH_CHECK( toolSvc->retrieveTool("LArCablingService",m_cablingSvc) ); - ATH_CHECK( toolSvc->retrieveTool("CaloTriggerTowerService",m_ttSvc) ); + ATH_CHECK( m_ttSvc.retrieve()); // Incident Service: IIncidentSvc* incSvc = nullptr; @@ -344,6 +325,20 @@ StatusCode LArTTL1Maker::initialize() return StatusCode::FAILURE ; } + ATH_CHECK(m_fSamplKey.initialize()); + + //Initialize read-handle keys + if (!m_PileUp) { + for (auto& dhk : m_xxxHitContainerName) { + ATH_CHECK(dhk.initialize()); + } + } + + + ATH_CHECK(m_EmTTL1ContainerName.initialize()); + ATH_CHECK(m_HadTTL1ContainerName.initialize()); + + ATH_MSG_DEBUG ( "Initialization completed successfully" ); return StatusCode::SUCCESS; } @@ -354,12 +349,6 @@ void LArTTL1Maker::handle(const Incident& /* inc*/ ) { ATH_MSG_DEBUG ( "LArTTL1Maker handle()" ); - StatusCode sc = this->retrieveDatabase(); - if (sc.isFailure()) { - ATH_MSG_ERROR ( " Error from retrieveDatabase " ); - } - - // // ...... init hit map // @@ -377,17 +366,6 @@ void LArTTL1Maker::handle(const Incident& /* inc*/ ) return; } -StatusCode LArTTL1Maker::retrieveDatabase() -{ -// can not do all that in initialize with the new calibration classes/Iov service - - ATH_MSG_DEBUG ( "LArTTL1Maker retrieveDatabase()" ); - ATH_CHECK (detStore()->retrieve(m_dd_fSampl,m_fSamplKey) ); - return StatusCode::SUCCESS; -} - - - StatusCode LArTTL1Maker::execute() { // +======================================================================+ @@ -406,6 +384,10 @@ StatusCode LArTTL1Maker::execute() if(m_chronoTest) { m_chronSvc->chronoStart( "fill LArHitEMap " ); } + + SG::ReadCondHandle<ILArfSampl> fSamplhdl(m_fSamplKey); + const ILArfSampl* fSampl=*fSamplhdl; + int totHit=0; if ( this->fillEMap(totHit) == StatusCode::FAILURE ) return StatusCode::FAILURE; @@ -425,27 +407,21 @@ StatusCode LArTTL1Maker::execute() // .....get the trigger time if requested // double trigtime=0; - if (m_useTriggerTime && p_triggerTimeTool) { - trigtime = p_triggerTimeTool->time(); + if (m_useTriggerTime) { + trigtime = m_triggerTimeTool->time(); } ATH_MSG_DEBUG ( "Trigger time used : " << trigtime ); // // ....... create the LAr TTL1 Containers // - LArTTL1Container *ttL1ContainerEm = new LArTTL1Container(); - if ( ttL1ContainerEm == 0 ){ - ATH_MSG_ERROR ( "Could not allocate a new LArTTL1Container" ); - return StatusCode::FAILURE; - } - LArTTL1Container *ttL1ContainerHad = new LArTTL1Container(); - if ( ttL1ContainerHad == 0 ){ - ATH_MSG_ERROR ( "Could not allocate a second new LArTTL1Container" ); - delete ttL1ContainerEm; - return StatusCode::FAILURE; - } + SG::WriteHandle<LArTTL1Container> ttL1ContainerEm(m_EmTTL1ContainerName); + ATH_CHECK(ttL1ContainerEm.record(std::make_unique<LArTTL1Container>())); + SG::WriteHandle<LArTTL1Container> ttL1ContainerHad(m_HadTTL1ContainerName); + ATH_CHECK(ttL1ContainerHad.record(std::make_unique<LArTTL1Container>())); + LArTTL1Container *truth_ttL1ContainerEm=0; LArTTL1Container *truth_ttL1ContainerHad=0; if(m_truthHitsContainer.size()>0) { @@ -453,13 +429,7 @@ StatusCode LArTTL1Maker::execute() truth_ttL1ContainerHad = new LArTTL1Container(); } - // - // ...... register the TTL1 containers into the TES - // - ATH_CHECK( evtStore()->record( ttL1ContainerEm , m_EmTTL1ContainerName) ); - ATH_CHECK( evtStore()->record( ttL1ContainerHad , m_HadTTL1ContainerName) ); - // // ... initialise vectors for sums of energy in each TT // unsigned int nbTT = (unsigned int)m_lvl1Helper->tower_hash_max() ; @@ -533,7 +503,7 @@ StatusCode LArTTL1Maker::execute() // ....... determine the sampling fraction //........ and the relative (layer) gains for this cellId // - const float cellSampFraction = m_dd_fSampl->FSAMPL(cellId); + const float cellSampFraction = fSampl->FSAMPL(cellId); const float inv_cellSampFraction = 1. / cellSampFraction; // std::cout << "cellid, SF= " << m_lvl1Helper->show_to_string(cellId) << " " << cellSampFraction << std::endl; float relGain = 0.; @@ -943,14 +913,7 @@ StatusCode LArTTL1Maker::execute() << " , " << ttL1ContainerHad->size() ); - // - // ...... lock the TTL1 containers - // - ATH_CHECK( evtStore()->setConst( ttL1ContainerEm ) ); - ATH_CHECK( evtStore()->setConst( ttL1ContainerHad ) ); - return StatusCode::SUCCESS; - } @@ -1369,25 +1332,25 @@ StatusCode LArTTL1Maker::fillEMap(int& totHit) // // ............ loop over the wanted hit containers (one per sub-detector) // - - for (unsigned int iHitContainer=0;iHitContainer<m_HitContainer.size();iHitContainer++) - { - // - // ..... Get the pointer to the Hit Container from StoreGate - // - ATH_MSG_VERBOSE ( " asking for: " << m_HitContainer[iHitContainer] ); - + + // std::vector<const LArHitContainer*> hitContainers; + // SG::ReadHandle<LArHitContainer> emBarrelHitsHdl(m_EmBarrelHitContainerName); + // hitContainers.push_back(emBarrelHitsHdl); + // SG::ReadHandle<LArHitContainer> emEndCapHitsHdl(m_EmEndCapHitContainerName); + // hitContainers.push_back(emEndCapHitsHdl); + // SG::ReadHandle<LArHitContainer> hecHitsHdl( m_HecHitContainerName); + // hitContainers.push_back(hecCapHitsHdl); + // SG::ReadHandle<LArHitContainer> fcalHitsHdl( m_ForWardHitContainerName); + // hitContainers.push_back(fcalHitsHdl); + + for (auto& dhk : m_xxxHitContainerName) + { if (!m_PileUp) { - const LArHitContainer* hit_container = nullptr; - ATH_CHECK( evtStore()->retrieve( hit_container, - m_HitContainer[iHitContainer] ) ); - - ATH_MSG_VERBOSE ( "number of hits: " << hit_container->size() ); - // // ....... loop over hits and get informations // + SG::ReadHandle<LArHitContainer> hit_container(dhk); LArHitContainer::const_iterator hititer; for(hititer=hit_container->begin();hititer != hit_container->end();hititer++) { cellId = (*hititer)->cellID(); @@ -1419,8 +1382,7 @@ StatusCode LArTTL1Maker::fillEMap(int& totHit) // ...retrieve list of pairs (time,container) from PileUp service // - if (!(m_mergeSvc->retrieveSubEvtsData(m_HitContainer[iHitContainer] - ,hitContList).isSuccess()) && hitContList.size()==0) { + if (!(m_mergeSvc->retrieveSubEvtsData(dhk.key(),hitContList).isSuccess()) && hitContList.size()==0) { ATH_MSG_ERROR ( "Could not fill TimedHitContList" ); return StatusCode::FAILURE; } @@ -2214,61 +2176,7 @@ StatusCode LArTTL1Maker::initHitMap() static std::vector<bool> SubDetFlag; for (int i=0; i < LArHitEMap::NUMDET ; i++) { - SubDetFlag.push_back(false); - } - -// -// ......... make the LArHit container name list -// - if ( m_SubDetectors == "LAr_All" ) - { - m_HitContainer.push_back(m_EmBarrelHitContainerName); - SubDetFlag[LArHitEMap::EMBARREL_INDEX] = true; - m_HitContainer.push_back(m_EmEndCapHitContainerName); - SubDetFlag[LArHitEMap::EMENDCAP_INDEX] = true; - m_HitContainer.push_back(m_HecHitContainerName); - SubDetFlag[LArHitEMap::HADENDCAP_INDEX] = true; - m_HitContainer.push_back(m_ForWardHitContainerName); - SubDetFlag[LArHitEMap::FORWARD_INDEX] = true; - } - else if ( m_SubDetectors == "LAr_Em" ) - { - m_HitContainer.push_back(m_EmBarrelHitContainerName); - SubDetFlag[LArHitEMap::EMBARREL_INDEX] = true; - m_HitContainer.push_back(m_EmEndCapHitContainerName); - SubDetFlag[LArHitEMap::EMENDCAP_INDEX] = true; - } - else if ( m_SubDetectors == "LAr_EmBarrel" ) - { - m_HitContainer.push_back(m_EmBarrelHitContainerName); - SubDetFlag[LArHitEMap::EMBARREL_INDEX] = true; - } - else if ( m_SubDetectors == "LAr_EmEndCap" ) - { - m_HitContainer.push_back(m_EmEndCapHitContainerName); - SubDetFlag[LArHitEMap::EMENDCAP_INDEX] = true; - } - else if ( m_SubDetectors == "LAr_HEC" ) - { - m_HitContainer.push_back(m_HecHitContainerName); - SubDetFlag[LArHitEMap::HADENDCAP_INDEX] = true; - } - else if ( m_SubDetectors == "LAr_Fcal" ) - { - m_HitContainer.push_back(m_ForWardHitContainerName); - SubDetFlag[LArHitEMap::FORWARD_INDEX] = true; - } - else - { - // - //........ Unknown case - // - ATH_MSG_FATAL - ( "Invalid SubDetector property : " << m_SubDetectors - << "Valid ones are: LAr_All, LAr_Em, LAr_EmBarrel, " - << "LAr_EmEndCap, LAr_HEC and LAr_Fcal " ); - - return(StatusCode::FAILURE); + SubDetFlag.push_back(true); } // diff --git a/LArCalorimeter/LArMonTools/share/LArAffectedRegions_jobOptions.py b/LArCalorimeter/LArMonTools/share/LArAffectedRegions_jobOptions.py index 0ec5810a22d77206dfebfff895030038aaa13230..be4e8df6b4cf1f4cfd26a3912adc1b7185f5d36b 100644 --- a/LArCalorimeter/LArMonTools/share/LArAffectedRegions_jobOptions.py +++ b/LArCalorimeter/LArMonTools/share/LArAffectedRegions_jobOptions.py @@ -11,5 +11,5 @@ theLArAffectedRegions = LArAffectedRegions(name="LArAffectedRegions", ProcessNEvents = EventBlockSize, IsOnline = athenaCommonFlags.isOnline() ) -ToolSvc += theLArAffectedRegions +#ToolSvc += theLArAffectedRegions LArMon.AthenaMonTools+=[ theLArAffectedRegions ] diff --git a/LArCalorimeter/LArMonTools/share/LArCollisionTimeMonTool_jobOptions.py b/LArCalorimeter/LArMonTools/share/LArCollisionTimeMonTool_jobOptions.py index d30e83ce2281887764c4a014c7ad4b06a9d178cd..1f4183b57fda21fa7393371fd26d1e016ba608f9 100755 --- a/LArCalorimeter/LArMonTools/share/LArCollisionTimeMonTool_jobOptions.py +++ b/LArCalorimeter/LArMonTools/share/LArCollisionTimeMonTool_jobOptions.py @@ -47,6 +47,6 @@ LArCluCollTimeMonTool=LArCollisionTimeMonTool(Key="ClusterCollTime", # --- register with toolservice --- -ToolSvc += [LArCollisionTimeMon,LArCluCollTimeMonTool] +#ToolSvc += [LArCollisionTimeMon,LArCluCollTimeMonTool] LArMon.AthenaMonTools+=[ LArCollisionTimeMon,LArCluCollTimeMonTool ] diff --git a/LArCalorimeter/LArMonTools/share/LArCosmicsMonTool_jobOptions.py b/LArCalorimeter/LArMonTools/share/LArCosmicsMonTool_jobOptions.py index 7202e20a15ac38ee6e283d5de3e64952fa3b1487..ab537b3c1e33c3d0307b11dbab93a1ed6cb5884a 100755 --- a/LArCalorimeter/LArMonTools/share/LArCosmicsMonTool_jobOptions.py +++ b/LArCalorimeter/LArMonTools/share/LArCosmicsMonTool_jobOptions.py @@ -17,7 +17,7 @@ theLArCosmicsMonTool = LArCosmicsMonTool(name="LArCosmicsMonTool", theLArCosmicsMonTool.LArPedestalKey='LArPedestal' -ToolSvc += theLArCosmicsMonTool +#ToolSvc += theLArCosmicsMonTool LArMon.AthenaMonTools+=[ theLArCosmicsMonTool ] diff --git a/LArCalorimeter/LArMonTools/share/LArCoverage_jobOptions.py b/LArCalorimeter/LArMonTools/share/LArCoverage_jobOptions.py index 107cee42bada6d713ea4f340dfa10e57573f76a9..5592310562393dfc7554570289229aac875dbe04 100755 --- a/LArCalorimeter/LArMonTools/share/LArCoverage_jobOptions.py +++ b/LArCalorimeter/LArMonTools/share/LArCoverage_jobOptions.py @@ -10,7 +10,7 @@ theLArCoverage = LArCoverage(name="LArCoverage", LArBadChannelMask = theLArBadChannelsMasker, Nevents = 40 ) -ToolSvc += theLArCoverage +#ToolSvc += theLArCoverage LArMon.AthenaMonTools+=[ theLArCoverage ] # BadChannelTool configuration @@ -18,11 +18,11 @@ from LArBadChannelTool.LArBadChannelToolConf import LArBadChanTool theLArBadChannelTool=LArBadChanTool() theLArBadChannelTool.ReadFromASCII=False ToolSvc+=theLArBadChannelTool -ToolSvc.LArCoverage.LArBadChannelTool=theLArBadChannelTool +LArCoverage.LArBadChannelTool=theLArBadChannelTool # CaloNoiseTool configuration from CaloTools.CaloNoiseToolDefault import CaloNoiseToolDefault theLArCoverageCaloNoiseTool=CaloNoiseToolDefault() ToolSvc+=theLArCoverageCaloNoiseTool -ToolSvc.LArCoverage.LArCaloNoiseTool=theLArCoverageCaloNoiseTool +LArCoverage.LArCaloNoiseTool=theLArCoverageCaloNoiseTool diff --git a/LArCalorimeter/LArMonTools/share/LArDigitMon_jobOptions.py b/LArCalorimeter/LArMonTools/share/LArDigitMon_jobOptions.py index b53662da5c690ac4598e96d7b2a4305075417a91..53e50475097b6b4fc12932965dc9b0aa41516699 100644 --- a/LArCalorimeter/LArMonTools/share/LArDigitMon_jobOptions.py +++ b/LArCalorimeter/LArMonTools/share/LArDigitMon_jobOptions.py @@ -51,7 +51,7 @@ theLArDigitMon = LArDigitMon(name="LArDigitMon", theLArDigitMon.LArPedestalKey='LArPedestal' -ToolSvc += theLArDigitMon +#ToolSvc += theLArDigitMon LArMon.AthenaMonTools+=[ theLArDigitMon ] diff --git a/LArCalorimeter/LArMonTools/share/LArFEBMon_calibEMB_jobOptions.py b/LArCalorimeter/LArMonTools/share/LArFEBMon_calibEMB_jobOptions.py index 4c05a18713e478a30e0acfb199974c3f3f3d70d8..38d2afc96924dbbfdcb3e9501e0692f1c01185df 100644 --- a/LArCalorimeter/LArMonTools/share/LArFEBMon_calibEMB_jobOptions.py +++ b/LArCalorimeter/LArMonTools/share/LArFEBMon_calibEMB_jobOptions.py @@ -12,7 +12,7 @@ theLArFEBMon = LArFEBMon(name="LArFEBMon", IgnoreMissingHeaderPS = False, IgnoreMissingHeaderEMB = False ) -ToolSvc += theLArFEBMon +#ToolSvc += theLArFEBMon LArMon.AthenaMonTools+=[ theLArFEBMon ] # BadChannelTool configuration @@ -20,7 +20,7 @@ from LArBadChannelTool.LArBadChannelToolConf import LArBadChanTool theLArBadChannelTool=LArBadChanTool() theLArBadChannelTool.ReadFromASCII=False ToolSvc+=theLArBadChannelTool -ToolSvc.LArFEBMon.LArBadChannelTool=theLArBadChannelTool +LArFEBMon.LArBadChannelTool=theLArBadChannelTool #to change an option later, do e.g #ToolSvc.LArFEBMon.maxOfTimingHisto =100 diff --git a/LArCalorimeter/LArMonTools/share/LArFEBMon_calibPS_jobOptions.py b/LArCalorimeter/LArMonTools/share/LArFEBMon_calibPS_jobOptions.py index 05612b1b3a63a9aba5f46d96ee3b1bca76f23466..55e3efa8b84c0671c6851139b073dc1a6bd2b3f9 100644 --- a/LArCalorimeter/LArMonTools/share/LArFEBMon_calibPS_jobOptions.py +++ b/LArCalorimeter/LArMonTools/share/LArFEBMon_calibPS_jobOptions.py @@ -12,7 +12,7 @@ theLArFEBMon = LArFEBMon(name="LArFEBMon", IgnoreMissingHeaderPS = False, IgnoreMissingHeaderEMB = True ) -ToolSvc += theLArFEBMon +#ToolSvc += theLArFEBMon LArMon.AthenaMonTools+=[ theLArFEBMon ] # BadChannelTool configuration @@ -20,7 +20,7 @@ from LArBadChannelTool.LArBadChannelToolConf import LArBadChanTool theLArBadChannelTool=LArBadChanTool() theLArBadChannelTool.ReadFromASCII=False ToolSvc+=theLArBadChannelTool -ToolSvc.LArFEBMon.LArBadChannelTool=theLArBadChannelTool +LArFEBMon.LArBadChannelTool=theLArBadChannelTool #to change an option later, do e.g #ToolSvc.LArFEBMon.maxOfTimingHisto =100 diff --git a/LArCalorimeter/LArMonTools/share/LArFEBMon_jobOptions.py b/LArCalorimeter/LArMonTools/share/LArFEBMon_jobOptions.py index 963fc86abdc51b265563d8475373cd7a390c93a2..7fd60162092b063853a3207d1064fc1e02c32376 100755 --- a/LArCalorimeter/LArMonTools/share/LArFEBMon_jobOptions.py +++ b/LArCalorimeter/LArMonTools/share/LArFEBMon_jobOptions.py @@ -23,7 +23,7 @@ theLArFEBMon = LArFEBMon(name="LArFEBMon", keyDSPThresholds = keyDSPThr, IsOnline = OnlineMode ) -ToolSvc += theLArFEBMon +#ToolSvc += theLArFEBMon LArMon.AthenaMonTools+=[ theLArFEBMon ] # BadChannelTool configuration @@ -31,7 +31,7 @@ from LArBadChannelTool.LArBadChannelToolConf import LArBadChanTool theLArBadChannelTool=LArBadChanTool() theLArBadChannelTool.ReadFromASCII=False ToolSvc+=theLArBadChannelTool -ToolSvc.LArFEBMon.LArBadChannelTool=theLArBadChannelTool +LArFEBMon.LArBadChannelTool=theLArBadChannelTool #to change an option later, do e.g #ToolSvc.LArFEBMon.maxOfTimingHisto =100 diff --git a/LArCalorimeter/LArMonTools/share/LArHVCorrectionMonTool_jobOptions.py b/LArCalorimeter/LArMonTools/share/LArHVCorrectionMonTool_jobOptions.py index afb699fed6efc1bcbffe29998728ab5c581b0a47..fd59b161c941b6f3386e9fb1cf76e057766c423c 100644 --- a/LArCalorimeter/LArMonTools/share/LArHVCorrectionMonTool_jobOptions.py +++ b/LArCalorimeter/LArMonTools/share/LArHVCorrectionMonTool_jobOptions.py @@ -13,6 +13,6 @@ theLArHVCorrTool=LArHVCorrToolDefault() ToolSvc+=theLArHVCorrTool theLArHVCorrectionMonTool.HVCorrTool = theLArHVCorrTool -ToolSvc += theLArHVCorrectionMonTool +#ToolSvc += theLArHVCorrectionMonTool LArMon.AthenaMonTools+=[ theLArHVCorrectionMonTool ] diff --git a/LArCalorimeter/LArMonTools/share/LArNoiseMonTools_jobOptions.py b/LArCalorimeter/LArMonTools/share/LArNoiseMonTools_jobOptions.py index 099afd11ad0e181ed160173366b1b0dfc3c202a3..da016a6b05fb7f835bfe52c6b97cea054eca130f 100755 --- a/LArCalorimeter/LArMonTools/share/LArNoiseMonTools_jobOptions.py +++ b/LArCalorimeter/LArMonTools/share/LArNoiseMonTools_jobOptions.py @@ -16,7 +16,7 @@ theLArFebNoiseMonTool = LArFebNoiseMonTool(name="LArFebNoiseMonTool", ## SingleTriggerSlot = 1 ) -ToolSvc += theLArFebNoiseMonTool +#ToolSvc += theLArFebNoiseMonTool LArMon.AthenaMonTools+=[ theLArFebNoiseMonTool ] # ToolSvc.LArFebNoiseMonTool.OutputLevel=DEBUG @@ -34,7 +34,7 @@ theLArFebNoiseMonToolAlt = LArFebNoiseMonTool(name="LArFebNoiseMonToolAlt", ## SingleTriggerSlot = 1 ) -ToolSvc += theLArFebNoiseMonToolAlt +#ToolSvc += theLArFebNoiseMonToolAlt LArMon.AthenaMonTools+=[ theLArFebNoiseMonToolAlt ] # ToolSvc.LArFebNoiseMonToolAlt.OutputLevel=DEBUG diff --git a/LArCalorimeter/LArMonTools/share/LArNoisyROMon_jobOptions.py b/LArCalorimeter/LArMonTools/share/LArNoisyROMon_jobOptions.py index b4df2a108e71e5339faaa7b2b9e0c70fc836b6dd..fc77b15b8c35700aa3365e7dde32386acd896223 100644 --- a/LArCalorimeter/LArMonTools/share/LArNoisyROMon_jobOptions.py +++ b/LArCalorimeter/LArMonTools/share/LArNoisyROMon_jobOptions.py @@ -63,5 +63,5 @@ if rec.doTrigger or LArNoisyROMonForceTrigger: else: theLArNoisyROMon.doTrigger = False -ToolSvc += theLArNoisyROMon +#ToolSvc += theLArNoisyROMon LArMon.AthenaMonTools += [theLArNoisyROMon] diff --git a/LArCalorimeter/LArMonTools/share/LArNoisyROMon_standalone.py b/LArCalorimeter/LArMonTools/share/LArNoisyROMon_standalone.py index 04ca306ebd8010ad51f08e69ee166e7c494b9557..9b87160e8c9e84df371b565dba342d069f6f7209 100644 --- a/LArCalorimeter/LArMonTools/share/LArNoisyROMon_standalone.py +++ b/LArCalorimeter/LArMonTools/share/LArNoisyROMon_standalone.py @@ -164,7 +164,7 @@ theLArNoisyROMon.BadFEBCut = larNoisyROFlags.BadFEBCut() #LArNoisyROFEBCutHelper theLArNoisyROMon.doTrigger = False theLArNoisyROMon.doHisto = False -ToolSvc += theLArNoisyROMon +#ToolSvc += theLArNoisyROMon LArMon.AthenaMonTools += [theLArNoisyROMon] ######### diff --git a/LArCalorimeter/LArMonTools/share/LArOddCellsMonTool_jobOptions.py b/LArCalorimeter/LArMonTools/share/LArOddCellsMonTool_jobOptions.py index 7362ac50b71a7c407cf1ebf2da52b672cecf9d4f..234b2ae7bd3385a82801d8e433f81782d5747a72 100755 --- a/LArCalorimeter/LArMonTools/share/LArOddCellsMonTool_jobOptions.py +++ b/LArCalorimeter/LArMonTools/share/LArOddCellsMonTool_jobOptions.py @@ -68,7 +68,7 @@ if DQMonFlags.useTrigger() and not athenaCommonFlags.isOnline(): if StreamFromFile=='express': theLArOddCellsMonTool.monitoredStreams=["RNDM"] -ToolSvc += theLArOddCellsMonTool +#ToolSvc += theLArOddCellsMonTool LArMon.AthenaMonTools+=[ theLArOddCellsMonTool ] @@ -93,7 +93,7 @@ if (MaskBadChannel) : "highNoiseHG","highNoiseMG","highNoiseLG" ] ToolSvc+=theLArOddCellsMasker - ToolSvc.LArOddCellsMonTool.LArBadChannelMask=theLArOddCellsMasker + LArOddCellsMonTool.LArBadChannelMask=theLArOddCellsMasker #ToolSvc.LArOddCellsMonTool.OutputLevel = DEBUG diff --git a/LArCalorimeter/LArMonTools/share/LArRODMonTool_jobOptions.py b/LArCalorimeter/LArMonTools/share/LArRODMonTool_jobOptions.py index fe66877dcb9b53a8590955979142a443cc9d1d58..4a05a843f7233723a1342e5b9ec39c17938544cd 100755 --- a/LArCalorimeter/LArMonTools/share/LArRODMonTool_jobOptions.py +++ b/LArCalorimeter/LArMonTools/share/LArRODMonTool_jobOptions.py @@ -125,7 +125,7 @@ theLArRODMonTool.LArPedestalKey='LArPedestal' from LArRecUtils.LArADC2MeVToolDefault import LArADC2MeVToolDefault theLArRODMonTool.ADC2MeVTool=LArADC2MeVToolDefault() -ToolSvc += theLArRODMonTool +#ToolSvc += theLArRODMonTool LArMon.AthenaMonTools+=[ theLArRODMonTool ] #theLArRODMonTool.OutputLevel = DEBUG diff --git a/LArCalorimeter/LArMonTools/share/LArRawChannelMonTool_jobOptions.py b/LArCalorimeter/LArMonTools/share/LArRawChannelMonTool_jobOptions.py index a57bf84d92b61baadd050b0ac77fd8fbdb3f1f17..e35295c70d4fe13f8fe5feeb7ff33b1cf1b3657f 100755 --- a/LArCalorimeter/LArMonTools/share/LArRawChannelMonTool_jobOptions.py +++ b/LArCalorimeter/LArMonTools/share/LArRawChannelMonTool_jobOptions.py @@ -166,5 +166,5 @@ if DQMonFlags.useTrigger() and not athenaCommonFlags.isOnline(): LArRawChannelMon.TriggerChain= LArRawChannelMonTool_TriggerChain # --- register with toolservice --- -ToolSvc += LArRawChannelMon +#ToolSvc += LArRawChannelMon LArMon.AthenaMonTools+=[ LArRawChannelMon ] diff --git a/LArCalorimeter/LArRawConditions/LArRawConditions/LArPedestalMC.h b/LArCalorimeter/LArRawConditions/LArRawConditions/LArPedestalMC.h index ea680b02b796ec5d27e2128efcc091c1bc5fb3c8..f6b8c12f7f63a6c515b2fcc2dca5961080163c0e 100755 --- a/LArCalorimeter/LArRawConditions/LArRawConditions/LArPedestalMC.h +++ b/LArCalorimeter/LArRawConditions/LArRawConditions/LArPedestalMC.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration */ #ifndef LARRAWCONDITIONS_LARPEDESTALMC_H @@ -9,8 +9,6 @@ #include <vector> -class LArCablingService ; - /** Implementation of the interface ILArfSampl for MC: only one constant is needed for MC * * @author S. Laplace diff --git a/LArCalorimeter/LArRawConditions/LArRawConditions/LArPhysCaliTdiffComplete.h b/LArCalorimeter/LArRawConditions/LArRawConditions/LArPhysCaliTdiffComplete.h index 20d2298919c5571b9059a4aeecad141e3594f0b7..0f526a5c4d4bdc973ec169d3cd8c9a56ad60bcae 100755 --- a/LArCalorimeter/LArRawConditions/LArRawConditions/LArPhysCaliTdiffComplete.h +++ b/LArCalorimeter/LArRawConditions/LArRawConditions/LArPhysCaliTdiffComplete.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration */ #ifndef LARRAWCONDITIONS_LARPHYSCALITDIFFCOMPLETE_H @@ -9,12 +9,8 @@ #include "LArRawConditions/LArPhysCaliTdiffP.h" #include "LArRawConditions/LArConditionsContainer.h" -#include <vector> - -class LArCablingService ; - /** This class implements the ILArPhysCaliTdiff interface - * +` * * @author M. Fanti * @version 0-0-1 , 21/07/05 * @@ -35,10 +31,7 @@ class LArPhysCaliTdiffComplete: public ILArPhysCaliTdiff, // retrieving PhysCaliTdiff using online ID virtual const float& Tdiff(const HWIdentifier& CellID, int gain) const ; - - // retrieving PhysCaliTdiff using offline ID - virtual const float& Tdiff(const Identifier& CellID, int gain) const; - + // set method filling the data members individually // (if one wants to fill this class not using the DB) void set(const HWIdentifier& CellID, int gain, diff --git a/LArCalorimeter/LArRawConditions/LArRawConditions/LArShapeMC.h b/LArCalorimeter/LArRawConditions/LArRawConditions/LArShapeMC.h index 2cac9746e23ae261abf10deff1b2d0d8ddf16642..918b9c4daf33f9558bf0707b59e61b7ae6eb3d0a 100755 --- a/LArCalorimeter/LArRawConditions/LArRawConditions/LArShapeMC.h +++ b/LArCalorimeter/LArRawConditions/LArRawConditions/LArShapeMC.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration */ #ifndef LARRAWCONDITIONS_LARSHAPEMC_H @@ -13,7 +13,6 @@ #include <vector> -class LArCablingService; class ILArMCSymTool; /** Implementation of the interface ILArShape for MC diff --git a/LArCalorimeter/LArRawConditions/LArRawConditions/LArWFParamsComplete.h b/LArCalorimeter/LArRawConditions/LArRawConditions/LArWFParamsComplete.h index 6a5813457d6ea42c47fd248b65dba5979e1c58c7..5f50df100c5ad9722ba0bd707913ef6acb16ced3 100755 --- a/LArCalorimeter/LArRawConditions/LArRawConditions/LArWFParamsComplete.h +++ b/LArCalorimeter/LArRawConditions/LArRawConditions/LArWFParamsComplete.h @@ -37,8 +37,7 @@ class LArWFParamsComplete :public LArConditionsContainer<LArWFParams> // retrieving coefficients using offline/online ID virtual const LArWFParams& getParams(const HWIdentifier& CellID, int gain) const ; - virtual const LArWFParams& getParams(const Identifier& CellID, int gain) const ; - + // set method filling the data members individually (if one // wants to fill this class not using the DB) void set(const HWIdentifier& CellID, int gain, LArWFParams theParams); diff --git a/LArCalorimeter/LArRawConditions/LArRawConditions/LArWaveDerivedQuantitiesComplete.h b/LArCalorimeter/LArRawConditions/LArRawConditions/LArWaveDerivedQuantitiesComplete.h index 9b302e64bd22aa8957d054fdae82dddc05890524..d2b3cbc63fd256666f819fe1d6433eace0fd174b 100755 --- a/LArCalorimeter/LArRawConditions/LArRawConditions/LArWaveDerivedQuantitiesComplete.h +++ b/LArCalorimeter/LArRawConditions/LArRawConditions/LArWaveDerivedQuantitiesComplete.h @@ -41,16 +41,7 @@ class LArWaveDerivedQuantitiesComplete: public ILArWaveDerivedQuantities , virtual const float& Jitter(const HWIdentifier& CellID, int gain ) const; virtual const unsigned& Flag(const HWIdentifier& CellID, int gain ) const; - // retrieving WaveDerivedQuantities using offline ID - virtual const float& BaseLine(const Identifier& CellID, int gain ) const; - virtual const float& MaxAmp(const Identifier& CellID, int gain ) const; - virtual const float& TMaxAmp(const Identifier& CellID, int gain ) const; - virtual const float& Width(const Identifier& CellID, int gain ) const; - virtual const float& rT0(const Identifier& CellID, int gain ) const; - virtual const float& PosLobe(const Identifier& CellID, int gain ) const; - virtual const float& Jitter(const Identifier& CellID, int gain ) const; - virtual const unsigned& Flag(const Identifier& CellID, int gain ) const; - + // set method filling the data members individually void set(const HWIdentifier& CellID, int gain, float baseline, diff --git a/LArCalorimeter/LArRawConditions/src/LArPhysCaliTdiffComplete.cxx b/LArCalorimeter/LArRawConditions/src/LArPhysCaliTdiffComplete.cxx index ae289346cd6106c698f45279ead7946031282062..76ce873fd24ebbd4b5ece2b6ae57705e97aa12da 100755 --- a/LArCalorimeter/LArRawConditions/src/LArPhysCaliTdiffComplete.cxx +++ b/LArCalorimeter/LArRawConditions/src/LArPhysCaliTdiffComplete.cxx @@ -44,32 +44,6 @@ const float& LArPhysCaliTdiffComplete::Tdiff(const HWIdentifier& CellID, int gai return t.m_Tdiff; } -const float& LArPhysCaliTdiffComplete::Tdiff(const Identifier& CellID, int gain) const -{ - HWIdentifier OnId; - // translate offline ID into online ID - ISvcLocator* svcLoc = Gaudi::svcLocator( ); - IToolSvc* toolSvc; - StatusCode sc = svcLoc->service( "ToolSvc",toolSvc ); - if(sc.isSuccess()) { - LArCablingService* cablingService; - sc = toolSvc->retrieveTool("LArCablingService",cablingService); - if(sc.isFailure()){ - MsgStream logstr(Athena::getMessageSvc(), "LArPhysCaliTdiffComplete"); - logstr << MSG::WARNING << "Could not retrieve LArCablingService Tool " << endmsg; - static float empty = ERRORCODE ; - return empty; - } - OnId = cablingService->createSignalChannelID(CellID); - } else { - MsgStream logstr(Athena::getMessageSvc(), "LArPhysCaliTdiffComplete"); - logstr << MSG::WARNING << "Could not retrieve ToolSvc " << endmsg; - static float empty = ERRORCODE ; - return empty; - } - return Tdiff(OnId, gain); -} - diff --git a/LArCalorimeter/LArRawConditions/src/LArShapeMC.cxx b/LArCalorimeter/LArRawConditions/src/LArShapeMC.cxx index b265f6c70a725dd0529e1d4850d62b2104825d5d..42803293a3dc5c56afdcb381f0e37d223f2f3ab0 100755 --- a/LArCalorimeter/LArRawConditions/src/LArShapeMC.cxx +++ b/LArCalorimeter/LArRawConditions/src/LArShapeMC.cxx @@ -1,21 +1,12 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration */ #include "LArRawConditions/LArShapeMC.h" #include "AthenaKernel/getMessageSvc.h" -#include "GaudiKernel/IMessageSvc.h" - -#include "GaudiKernel/Bootstrap.h" -#include "GaudiKernel/ISvcLocator.h" -#include "GaudiKernel/IToolSvc.h" -#include "AthenaKernel/getMessageSvc.h" #include "GaudiKernel/MsgStream.h" #include "LArElecCalib/ILArMCSymTool.h" -#include <iostream> -using namespace std ; - LArShapeMC::LArShapeMC() : ILArShape(), LArConditionsContainer<LArShapeP1>(), m_larmcsym("LArMCSymTool") @@ -107,39 +98,7 @@ void do_get_shape (const std::vector<float>& shape, } } } - - -#if 0 -bool setup_cabling_service (const Identifier& CellID, - HWIdentifier& OnId) -{ - ISvcLocator* svcLoc = Gaudi::svcLocator( ); - IToolSvc* toolSvc; - StatusCode sc = svcLoc->service( "ToolSvc",toolSvc ); - if(sc.isFailure()) { - MsgStream logstr(Athena::getMessageSvc(), "LArShapeMC"); - logstr << MSG::ERROR << "Could not retrieve ToolSvc " << endmsg; - return false; - } - - LArCablingService* cablingService; - sc = toolSvc->retrieveTool("LArCablingService",cablingService); - if(sc.isFailure()){ - MsgStream logstr(Athena::getMessageSvc(), "LArShapeMC"); - logstr << MSG::ERROR << "Could not retrieve LArCablingService Tool " - << endmsg; - return false; - } - - OnId = cablingService->createSignalChannelID(CellID); - - return true; -} -#endif - - -} // anonymous namespace - +} //anonymous namespace /* * retrieve Shape diff --git a/LArCalorimeter/LArRawConditions/src/LArWFParamsComplete.cxx b/LArCalorimeter/LArRawConditions/src/LArWFParamsComplete.cxx index 1a301ad791933d2a7b2502b8b8dc28b5794511a6..3df54e38dfd1ae38936d08f8276b657039f656a0 100755 --- a/LArCalorimeter/LArRawConditions/src/LArWFParamsComplete.cxx +++ b/LArCalorimeter/LArRawConditions/src/LArWFParamsComplete.cxx @@ -1,20 +1,8 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration */ #include "LArRawConditions/LArWFParamsComplete.h" -#include "GaudiKernel/IMessageSvc.h" - -#include "LArIdentifier/LArOnlineID.h" -#include "LArCabling/LArCablingService.h" - -#include "GaudiKernel/Bootstrap.h" -#include "GaudiKernel/ISvcLocator.h" -#include "GaudiKernel/IToolSvc.h" - -#include "AthenaKernel/getMessageSvc.h" -#include <iostream> -//using namespace std ; LArWFParams LArWFParamsComplete::s_dummyParams = LArWFParams() ; @@ -28,47 +16,11 @@ LArWFParamsComplete::~LArWFParamsComplete() {} /* Fill transient object in ATHENA ***************************************** */ void LArWFParamsComplete::set(const HWIdentifier& CellID, int gain, LArWFParams theParams) { - - setPdata(CellID, theParams, gain); - + setPdata(CellID, theParams, gain); } /* retrieve WF params using online ID **************************** */ -const LArWFParams& LArWFParamsComplete::getParams(const HWIdentifier& CellID, int gain) const -{ - +const LArWFParams& LArWFParamsComplete::getParams(const HWIdentifier& CellID, int gain) const { return get(CellID,gain); - } - -/* retrieve WF params using offline ID **************************** - */ -const LArWFParams& LArWFParamsComplete::getParams(const Identifier& CellID, int gain) const -{ - HWIdentifier OnId; - - // translate offline ID into online ID - ISvcLocator* svcLoc = Gaudi::svcLocator( ); - IToolSvc* toolSvc; - StatusCode sc = svcLoc->service( "ToolSvc",toolSvc ); - if(sc.isSuccess()) { - LArCablingService* cablingService; - sc = toolSvc->retrieveTool("LArCablingService",cablingService); - if(sc.isFailure()){ - MsgStream logstr(Athena::getMessageSvc(), "LArOFCComplete"); - logstr << MSG::WARNING << "Could not retrieve LArCablingService Tool " << endmsg; - //static std::vector<float> empty; - return s_dummyParams; - } - OnId = cablingService->createSignalChannelID(CellID); - - } else { - MsgStream logstr(Athena::getMessageSvc(), "LArWFParamsComplete"); - logstr << MSG::WARNING << "Could not retrieve ToolSvc " << endmsg; - //static std::vector<float> empty; - return s_dummyParams ; - } - return get(OnId, gain); -} - diff --git a/LArCalorimeter/LArRawConditions/src/LArWaveDerivedQuantitiesComplete.cxx b/LArCalorimeter/LArRawConditions/src/LArWaveDerivedQuantitiesComplete.cxx index 0a42a29235476bbf6daca9fbfb2d3c654857da38..a0a1a8c9c8b157e1f68d244ca67a544666f3eaa2 100755 --- a/LArCalorimeter/LArRawConditions/src/LArWaveDerivedQuantitiesComplete.cxx +++ b/LArCalorimeter/LArRawConditions/src/LArWaveDerivedQuantitiesComplete.cxx @@ -4,19 +4,6 @@ #include "LArRawConditions/LArWaveDerivedQuantitiesComplete.h" -#include "GaudiKernel/IMessageSvc.h" - -#include "LArIdentifier/LArOnlineID.h" -#include "LArCabling/LArCablingService.h" - -#include "GaudiKernel/Bootstrap.h" -#include "GaudiKernel/ISvcLocator.h" -#include "GaudiKernel/IToolSvc.h" - -#include "AthenaKernel/getMessageSvc.h" -#include <iostream> -using namespace std ; - LArWaveDerivedQuantitiesComplete::LArWaveDerivedQuantitiesComplete() {} LArWaveDerivedQuantitiesComplete::~LArWaveDerivedQuantitiesComplete() {} @@ -97,217 +84,3 @@ const unsigned& LArWaveDerivedQuantitiesComplete::Flag(const HWIdentifier& CellI const LArWaveDerivedQuantitiesP& t = get(CellID,gain) ; return (t.m_flag); } - - -const float& LArWaveDerivedQuantitiesComplete::BaseLine(const Identifier& CellID, int gain) const -{ - HWIdentifier OnId; - // translate offline ID into online ID - ISvcLocator* svcLoc = Gaudi::svcLocator( ); - IToolSvc* toolSvc; - StatusCode sc = svcLoc->service( "ToolSvc",toolSvc ); - if(sc.isSuccess()) { - LArCablingService* cablingService; - sc = toolSvc->retrieveTool("LArCablingService",cablingService); - if(sc.isFailure()){ - MsgStream logstr(Athena::getMessageSvc(), "LArWaveDerivedQuantitiesComplete"); - logstr << MSG::WARNING << "Could not retrieve LArCablingService Tool " << endmsg; - static float empty = ERRORCODE ; - return empty; - } - OnId = cablingService->createSignalChannelID(CellID); - } else { - MsgStream logstr(Athena::getMessageSvc(), "LArWaveDerivedQuantitiesComplete"); - logstr << MSG::WARNING << "Could not retrieve ToolSvc " << endmsg; - static float empty = ERRORCODE ; - return empty; - } - return BaseLine(OnId, gain); -} - - -const float& LArWaveDerivedQuantitiesComplete::MaxAmp(const Identifier& CellID, int gain) const -{ - HWIdentifier OnId; - // translate offline ID into online ID - ISvcLocator* svcLoc = Gaudi::svcLocator( ); - IToolSvc* toolSvc; - StatusCode sc = svcLoc->service( "ToolSvc",toolSvc ); - if(sc.isSuccess()) { - LArCablingService* cablingService; - sc = toolSvc->retrieveTool("LArCablingService",cablingService); - if(sc.isFailure()){ - MsgStream logstr(Athena::getMessageSvc(), "LArWaveDerivedQuantitiesComplete"); - logstr << MSG::WARNING << "Could not retrieve LArCablingService Tool " << endmsg; - static float empty = ERRORCODE ; - return empty; - } - OnId = cablingService->createSignalChannelID(CellID); - } else { - MsgStream logstr(Athena::getMessageSvc(), "LArWaveDerivedQuantitiesComplete"); - logstr << MSG::WARNING << "Could not retrieve ToolSvc " << endmsg; - static float empty = ERRORCODE ; - return empty; - } - return MaxAmp(OnId, gain); -} - - -const float& LArWaveDerivedQuantitiesComplete::TMaxAmp(const Identifier& CellID, int gain) const -{ - HWIdentifier OnId; - // translate offline ID into online ID - ISvcLocator* svcLoc = Gaudi::svcLocator( ); - IToolSvc* toolSvc; - StatusCode sc = svcLoc->service( "ToolSvc",toolSvc ); - if(sc.isSuccess()) { - LArCablingService* cablingService; - sc = toolSvc->retrieveTool("LArCablingService",cablingService); - if(sc.isFailure()){ - MsgStream logstr(Athena::getMessageSvc(), "LArWaveDerivedQuantitiesComplete"); - logstr << MSG::WARNING << "Could not retrieve LArCablingService Tool " << endmsg; - static float empty = ERRORCODE ; - return empty; - } - OnId = cablingService->createSignalChannelID(CellID); - } else { - MsgStream logstr(Athena::getMessageSvc(), "LArWaveDerivedQuantitiesComplete"); - logstr << MSG::WARNING << "Could not retrieve ToolSvc " << endmsg; - static float empty = ERRORCODE ; - return empty; - } - return TMaxAmp(OnId, gain); -} - -const float& LArWaveDerivedQuantitiesComplete::Width(const Identifier& CellID, int gain) const -{ - HWIdentifier OnId; - // translate offline ID into online ID - ISvcLocator* svcLoc = Gaudi::svcLocator( ); - IToolSvc* toolSvc; - StatusCode sc = svcLoc->service( "ToolSvc",toolSvc ); - if(sc.isSuccess()) { - LArCablingService* cablingService; - sc = toolSvc->retrieveTool("LArCablingService",cablingService); - if(sc.isFailure()){ - MsgStream logstr(Athena::getMessageSvc(), "LArWaveDerivedQuantitiesComplete"); - logstr << MSG::WARNING << "Could not retrieve LArCablingService Tool " << endmsg; - static float empty = ERRORCODE ; - return empty; - } - OnId = cablingService->createSignalChannelID(CellID); - } else { - MsgStream logstr(Athena::getMessageSvc(), "LArWaveDerivedQuantitiesComplete"); - logstr << MSG::WARNING << "Could not retrieve ToolSvc " << endmsg; - static float empty = ERRORCODE ; - return empty; - } - return Width(OnId, gain); -} - - -const float& LArWaveDerivedQuantitiesComplete::rT0(const Identifier& CellID, int gain) const -{ - HWIdentifier OnId; - // translate offline ID into online ID - ISvcLocator* svcLoc = Gaudi::svcLocator( ); - IToolSvc* toolSvc; - StatusCode sc = svcLoc->service( "ToolSvc",toolSvc ); - if(sc.isSuccess()) { - LArCablingService* cablingService; - sc = toolSvc->retrieveTool("LArCablingService",cablingService); - if(sc.isFailure()){ - MsgStream logstr(Athena::getMessageSvc(), "LArWaveDerivedQuantitiesComplete"); - logstr << MSG::WARNING << "Could not retrieve LArCablingService Tool " << endmsg; - static float empty = ERRORCODE ; - return empty; - } - OnId = cablingService->createSignalChannelID(CellID); - } else { - MsgStream logstr(Athena::getMessageSvc(), "LArWaveDerivedQuantitiesComplete"); - logstr << MSG::WARNING << "Could not retrieve ToolSvc " << endmsg; - static float empty = ERRORCODE ; - return empty; - } - return rT0(OnId, gain); -} - - -const float& LArWaveDerivedQuantitiesComplete::PosLobe(const Identifier& CellID, int gain) const -{ - HWIdentifier OnId; - // translate offline ID into online ID - ISvcLocator* svcLoc = Gaudi::svcLocator( ); - IToolSvc* toolSvc; - StatusCode sc = svcLoc->service( "ToolSvc",toolSvc ); - if(sc.isSuccess()) { - LArCablingService* cablingService; - sc = toolSvc->retrieveTool("LArCablingService",cablingService); - if(sc.isFailure()){ - MsgStream logstr(Athena::getMessageSvc(), "LArWaveDerivedQuantitiesComplete"); - logstr << MSG::WARNING << "Could not retrieve LArCablingService Tool " << endmsg; - static float empty = ERRORCODE ; - return empty; - } - OnId = cablingService->createSignalChannelID(CellID); - } else { - MsgStream logstr(Athena::getMessageSvc(), "LArWaveDerivedQuantitiesComplete"); - logstr << MSG::WARNING << "Could not retrieve ToolSvc " << endmsg; - static float empty = ERRORCODE ; - return empty; - } - return PosLobe(OnId, gain); -} - - -const float& LArWaveDerivedQuantitiesComplete::Jitter(const Identifier& CellID, int gain) const -{ - HWIdentifier OnId; - // translate offline ID into online ID - ISvcLocator* svcLoc = Gaudi::svcLocator( ); - IToolSvc* toolSvc; - StatusCode sc = svcLoc->service( "ToolSvc",toolSvc ); - if(sc.isSuccess()) { - LArCablingService* cablingService; - sc = toolSvc->retrieveTool("LArCablingService",cablingService); - if(sc.isFailure()){ - MsgStream logstr(Athena::getMessageSvc(), "LArWaveDerivedQuantitiesComplete"); - logstr << MSG::WARNING << "Could not retrieve LArCablingService Tool " << endmsg; - static float empty = ERRORCODE ; - return empty; - } - OnId = cablingService->createSignalChannelID(CellID); - } else { - MsgStream logstr(Athena::getMessageSvc(), "LArWaveDerivedQuantitiesComplete"); - logstr << MSG::WARNING << "Could not retrieve ToolSvc " << endmsg; - static float empty = ERRORCODE ; - return empty; - } - return Jitter(OnId, gain); -} - -const unsigned& LArWaveDerivedQuantitiesComplete::Flag(const Identifier& CellID, int gain) const -{ - HWIdentifier OnId; - // translate offline ID into online ID - ISvcLocator* svcLoc = Gaudi::svcLocator( ); - IToolSvc* toolSvc; - StatusCode sc = svcLoc->service( "ToolSvc",toolSvc ); - if(sc.isSuccess()) { - LArCablingService* cablingService; - sc = toolSvc->retrieveTool("LArCablingService",cablingService); - if(sc.isFailure()){ - MsgStream logstr(Athena::getMessageSvc(), "LArWaveDerivedQuantitiesComplete"); - logstr << MSG::WARNING << "Could not retrieve LArCablingService Tool " << endmsg; - static unsigned empty = ERRORCODE ; - return empty; - } - OnId = cablingService->createSignalChannelID(CellID); - } else { - MsgStream logstr(Athena::getMessageSvc(), "LArWaveDerivedQuantitiesComplete"); - logstr << MSG::WARNING << "Could not retrieve ToolSvc " << endmsg; - static unsigned empty = ERRORCODE ; - return empty; - } - return Flag(OnId, gain); -} diff --git a/LArCalorimeter/LArRecConditions/CMakeLists.txt b/LArCalorimeter/LArRecConditions/CMakeLists.txt index c083aa31167e6d8992a8e00937054140069277bb..a2a15271ea40337f57dacea1fdf75285868b895c 100644 --- a/LArCalorimeter/LArRecConditions/CMakeLists.txt +++ b/LArCalorimeter/LArRecConditions/CMakeLists.txt @@ -11,7 +11,10 @@ atlas_depends_on_subdirs( PUBLIC LArCalorimeter/LArIdentifier Control/AthenaKernel DetectorDescription/Identifier - GaudiKernel ) + GaudiKernel + PRIVATE + LArCalorimeter/LArElecCalib + LArCalorimeter/LArCabling ) # External dependencies: find_package( ROOT COMPONENTS Core Tree MathCore Hist RIO pthread ) @@ -34,4 +37,4 @@ atlas_add_test (test_LArBadChannelCont SOURCES test/test_LArBadChannelCont.cxx LINK_LIBRARIES Identifier CxxUtils StoreGateLib LArRecConditions - ) \ No newline at end of file + ) diff --git a/LArCalorimeter/LArRecConditions/LArRecConditions/LArBadChannelCont.h b/LArCalorimeter/LArRecConditions/LArRecConditions/LArBadChannelCont.h index 33c9b0a32fbc5c6655abe8f23fbde4c627c5383e..285799f464505bdada07f403d505726d91c12a7f 100644 --- a/LArCalorimeter/LArRecConditions/LArRecConditions/LArBadChannelCont.h +++ b/LArCalorimeter/LArRecConditions/LArRecConditions/LArBadChannelCont.h @@ -105,7 +105,7 @@ private: //Template instantiation for LArBadChannel typedef LArBadXCont<LArBadChannel> LArBadChannelCont; -#include "CLIDSvc/CLASS_DEF.h" +#include "AthenaKernel/CLASS_DEF.h" CLASS_DEF(LArBadChannelCont,64272230,1) #include "AthenaKernel/CondCont.h" CLASS_DEF( CondCont<LArBadChannelCont>,144954956 , 1 ) diff --git a/LArCalorimeter/LArRecConditions/LArRecConditions/LArCalibLineMapping.h b/LArCalorimeter/LArRecConditions/LArRecConditions/LArCalibLineMapping.h index 59a7f83fb502bdc7d79fcd59097fcaee36f43485..84ef422d6e12cdd8ac3935832ca4601e4d08d430 100644 --- a/LArCalorimeter/LArRecConditions/LArRecConditions/LArCalibLineMapping.h +++ b/LArCalorimeter/LArRecConditions/LArRecConditions/LArCalibLineMapping.h @@ -1,7 +1,7 @@ //Dear emacs, this is -*-c++-*- /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration */ #ifndef LARRECCONDITIONS_LARCALIBLINEMAPPING_ @@ -38,7 +38,7 @@ inline const std::vector<HWIdentifier>& LArCalibLineMapping::calibSlotLineFromHa } -#include "CLIDSvc/CLASS_DEF.h" +#include "AthenaKernel/CLASS_DEF.h" CLASS_DEF( LArCalibLineMapping,142865765 , 1) #include "AthenaKernel/CondCont.h" CLASS_DEF( CondCont<LArCalibLineMapping>, 30856397 , 1) diff --git a/LArCalorimeter/LArRecConditions/LArRecConditions/LArFebRodMapping.h b/LArCalorimeter/LArRecConditions/LArRecConditions/LArFebRodMapping.h index b422a7673737218acb1a2a3b56cf742b3051cac6..b62d0c10320c179992664cbe2eea4f8bcea6b18d 100644 --- a/LArCalorimeter/LArRecConditions/LArRecConditions/LArFebRodMapping.h +++ b/LArCalorimeter/LArRecConditions/LArRecConditions/LArFebRodMapping.h @@ -1,7 +1,7 @@ //Dear emacs, this is -*-c++-*- /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration */ #ifndef LARRECCONDITIONS_LARFEBRODMAPPING_H @@ -47,7 +47,7 @@ inline const std::vector<HWIdentifier>& LArFebRodMapping::getLArRoModIDvec() con return m_readoutModuleIDVec; } -#include "CLIDSvc/CLASS_DEF.h" +#include "AthenaKernel/CLASS_DEF.h" CLASS_DEF( LArFebRodMapping, 204177791 , 1) #include "AthenaKernel/CondCont.h" CLASS_DEF( CondCont<LArFebRodMapping>, 244452853 , 1) diff --git a/LArCalorimeter/LArRecConditions/LArRecConditions/LArHVCorr.h b/LArCalorimeter/LArRecConditions/LArRecConditions/LArHVCorr.h new file mode 100755 index 0000000000000000000000000000000000000000..e6685020f2d77541e92510ccafdf51fbc4576a1b --- /dev/null +++ b/LArCalorimeter/LArRecConditions/LArRecConditions/LArHVCorr.h @@ -0,0 +1,48 @@ +/* + Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration +*/ + + +#ifndef LARHVCORR_H +#define LARHVCORR_H + +#include "Identifier/IdentifierHash.h" +#include "LArElecCalib/ILArHVScaleCorr.h" +#include "LArCabling/LArOnOffIdMapping.h" +#include "CaloIdentifier/CaloCell_ID.h" + +#include <vector> + +class CaloCell_ID; +class MsgStream; + +class LArHVCorr : public ILArHVScaleCorr { + + friend class LArHVCondAlg; //The conditions alg filling this object + + public: + LArHVCorr(const std::vector<float>& vVec, const LArOnOffIdMapping* cabling, const CaloCell_ID* caloidhelper); + ~LArHVCorr () { if(m_log) delete m_log; } + + + // retrieving HVScaleCorr using online ID + virtual const float& HVScaleCorr(const HWIdentifier& chid) const override final; + + // retrieving HVScaleCorr using offline ID + virtual const float& HVScaleCorr(const Identifier& id) const override final; + + + private: + const LArOnOffIdMapping* m_larCablingSvc; + const CaloCell_ID* m_calo_id; + MsgStream* m_log; + + std::vector<float> m_hvCorr; + const float m_badCorr; +}; + +#include "AthenaKernel/CondCont.h" +CLASS_DEF( LArHVCorr, 52206080, 1) +CONDCONT_DEF( LArHVCorr, 24667986 ); + +#endif diff --git a/LArCalorimeter/LArRecConditions/LArRecConditions/LArHVData.h b/LArCalorimeter/LArRecConditions/LArRecConditions/LArHVData.h index bb3e3314580577614c2567dddffc199a1d8bebdd..71f230f854fe63ea71970ca743c2549d211143ed 100755 --- a/LArCalorimeter/LArRecConditions/LArRecConditions/LArHVData.h +++ b/LArCalorimeter/LArRecConditions/LArRecConditions/LArHVData.h @@ -36,7 +36,7 @@ class LArHVData { float weight; }; - const std::set<Identifier>& getUpdatedCells(); + const std::set<Identifier>& getUpdatedCells() const; /** brief Given a Offline Readout ID, return values of HV and Weight */ @@ -56,11 +56,11 @@ class LArHVData { }; inline -const std::set<Identifier>& LArHVData::getUpdatedCells() { +const std::set<Identifier>& LArHVData::getUpdatedCells() const { return m_updatedCells; } -#include "CLIDSvc/CLASS_DEF.h" +#include "AthenaKernel/CLASS_DEF.h" CLASS_DEF( LArHVData, 94850034, 1) #include "AthenaKernel/CondCont.h" CLASS_DEF( CondCont<LArHVData>, 35533232, 1) diff --git a/LArCalorimeter/LArRecConditions/LArRecConditions/LArHVIdMapping.h b/LArCalorimeter/LArRecConditions/LArRecConditions/LArHVIdMapping.h index 1019af05128f4dfae92fa30af8bb0ac93f5db6bf..18e6861f96abc5a75e3605deab1188eb15fc95a2 100644 --- a/LArCalorimeter/LArRecConditions/LArRecConditions/LArHVIdMapping.h +++ b/LArCalorimeter/LArRecConditions/LArRecConditions/LArHVIdMapping.h @@ -69,7 +69,7 @@ class LArHVIdMapping { -#include "CLIDSvc/CLASS_DEF.h" +#include "AthenaKernel/CLASS_DEF.h" CLASS_DEF( LArHVIdMapping, 260112632 , 1) #include "AthenaKernel/CondCont.h" CLASS_DEF( CondCont<LArHVIdMapping>, 92552832 , 1) diff --git a/LArCalorimeter/LArRecConditions/LArRecConditions/LArHVPathology.h b/LArCalorimeter/LArRecConditions/LArRecConditions/LArHVPathology.h index eff12bba0e3d4463a01729feaaad322e3c6ef5d8..9a575f1f4cfa39a0c4d430c09275821a02bac0e2 100644 --- a/LArCalorimeter/LArRecConditions/LArRecConditions/LArHVPathology.h +++ b/LArCalorimeter/LArRecConditions/LArRecConditions/LArHVPathology.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration */ #ifndef LARHVPATHOLOGY_H @@ -42,7 +42,7 @@ inline LArHVPathology::LArHVPathology(const LArHVPathologiesDb* in) { } } -#include "CLIDSvc/CLASS_DEF.h" +#include "AthenaKernel/CLASS_DEF.h" CLASS_DEF( LArHVPathology, 180546408, 1) #include "AthenaKernel/CondCont.h" CLASS_DEF( CondCont<LArHVPathology>, 24283336, 1) diff --git a/LArCalorimeter/LArRecConditions/src/LArHVCorr.cxx b/LArCalorimeter/LArRecConditions/src/LArHVCorr.cxx new file mode 100644 index 0000000000000000000000000000000000000000..37dbe97d629decce8f1813fc2a9125f73c6427db --- /dev/null +++ b/LArCalorimeter/LArRecConditions/src/LArHVCorr.cxx @@ -0,0 +1,28 @@ +/* + Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration +*/ + +#include "LArRecConditions/LArHVCorr.h" +#include "AthenaKernel/getMessageSvc.h" + +LArHVCorr::LArHVCorr(const std::vector<float>& vVec, const LArOnOffIdMapping* cabling, const CaloCell_ID* caloidhelper): + m_larCablingSvc(cabling), + m_calo_id(caloidhelper), + m_log(nullptr), + m_badCorr(0.) { + + m_log=new MsgStream(Athena::getMessageSvc(), "LArHVCorr") + ; + m_hvCorr = vVec; +} + +// retrieving HVScaleCorr using offline ID +const float& LArHVCorr::HVScaleCorr(const Identifier& id) const { + if(m_calo_id->sub_calo(id) < CaloCell_Base_ID::TILE) + return m_hvCorr[m_calo_id->calo_cell_hash(id)]; + else return m_badCorr; +} + +const float& LArHVCorr::HVScaleCorr(const HWIdentifier& id) const { + return HVScaleCorr(m_larCablingSvc->cnvToIdentifier(id)); +} diff --git a/LArCalorimeter/LArRecUtils/CMakeLists.txt b/LArCalorimeter/LArRecUtils/CMakeLists.txt index 7caba479de84b45abc995a4e2d1e997f9058805a..84f7383c982369792f5024e790965f09312a2fe4 100644 --- a/LArCalorimeter/LArRecUtils/CMakeLists.txt +++ b/LArCalorimeter/LArRecUtils/CMakeLists.txt @@ -48,13 +48,13 @@ atlas_add_library( LArRecUtilsLib INCLUDE_DIRS ${CORAL_INCLUDE_DIRS} PRIVATE_INCLUDE_DIRS ${Boost_INCLUDE_DIRS} ${CLHEP_INCLUDE_DIRS} ${EIGEN_INCLUDE_DIRS} PRIVATE_DEFINITIONS ${CLHEP_DEFINITIONS} - LINK_LIBRARIES ${CORAL_LIBRARIES} ${EIGEN_LIBRARIES} CaloEvent CaloIdentifier AthenaBaseComps AthenaKernel AthAllocators AthenaPoolUtilities Identifier GaudiKernel LArIdentifier LArRawConditions LArRawEvent LArRecEvent CaloDetDescrLib CaloUtilsLib StoreGateLib SGtests LArCablingLib LArRawUtilsLib LArRecConditions + LINK_LIBRARIES ${CORAL_LIBRARIES} ${EIGEN_LIBRARIES} CaloEvent CaloIdentifier AthenaBaseComps AthenaKernel AthAllocators AthenaPoolUtilities Identifier GaudiKernel LArIdentifier LArRawEvent LArRecEvent CaloDetDescrLib CaloUtilsLib StoreGateLib SGtests LArCablingLib LArRawUtilsLib LArRecConditions LArRawConditions PRIVATE_LINK_LIBRARIES ${Boost_LIBRARIES} ${CLHEP_LIBRARIES} ${EIGEN_LIBRARIES} TestTools CaloGeoHelpers SGTools xAODEventInfo LArCOOLConditions PathResolver ) atlas_add_component( LArRecUtils src/components/*.cxx INCLUDE_DIRS ${Boost_INCLUDE_DIRS} ${CORAL_INCLUDE_DIRS} ${CLHEP_INCLUDE_DIRS} ${EIGEN_INCLUDE_DIRS} - LINK_LIBRARIES ${Boost_LIBRARIES} ${CORAL_LIBRARIES} ${CLHEP_LIBRARIES} ${EIGEN_LIBRARIES} CaloDetDescrLib CaloEvent CaloIdentifier CaloUtilsLib AthenaBaseComps AthenaKernel AthAllocators StoreGateLib SGtests AthenaPoolUtilities Identifier GaudiKernel LArCablingLib LArIdentifier LArRawConditions LArRawEvent LArRecEvent TestTools CaloGeoHelpers SGTools xAODEventInfo LArCOOLConditions LArRawUtilsLib PathResolver LArRecUtilsLib LArRecConditions) + LINK_LIBRARIES ${Boost_LIBRARIES} ${CORAL_LIBRARIES} ${CLHEP_LIBRARIES} ${EIGEN_LIBRARIES} CaloDetDescrLib CaloEvent CaloIdentifier CaloUtilsLib AthenaBaseComps AthenaKernel AthAllocators StoreGateLib SGtests AthenaPoolUtilities Identifier GaudiKernel LArCablingLib LArIdentifier LArRawConditions LArRawEvent LArRecEvent TestTools CaloGeoHelpers SGTools xAODEventInfo LArCOOLConditions LArRawUtilsLib PathResolver LArRecUtilsLib LArRecConditions LArRawConditions) atlas_add_test( dummy_test SOURCES @@ -69,5 +69,5 @@ atlas_install_joboptions( share/*.py ) atlas_add_test( LArFCalTowerBuilderTool SCRIPT ${CMAKE_CURRENT_SOURCE_DIR}/test/LArFCalTowerBuilderTool_test.sh PROPERTIES TIMEOUT 300 - EXTRA_PATTERNS "[0-9] [A-Z]+ 20[123][0-9]|Reading file|^CORAL/Services/ConnectionService (Info|Warning)|^RelationalDatabase Info|^Data source lookup|^DetDescrCnvSvc +INFO|^CORAL/RelationalPlugins/frontier Info|^PluginManager Info|^RalSessionMgr Warning|^DBReplicaSvc +INFO|IOVDbSvc +INFO|^Py:Athena +INFO|^EventInfoMgtInit: Got release|^TEnvRec::ChangeValue|^PoolSvc +INFO|being retired|including file|Deaccess DbDatabase|^IoComponentMgr +INFO|File version|Global positioning|^Domain|duplicate entry|already loaded|RootDbase: all good|frontier.c|^Py:ConfigurableDb +(WARNING|INFO)|ApplicationMgr +INFO|INFO [sS]top|^CaloIdMgrDetDes.*INFO|^TTOnlineIDDetDe.*INFO|^CaloIDHelper_ID.*INFO|^AtlasDetectorID +INFO|^AthenaEventLoopMgrWARNING|^CaloDM_IDDetDes.*INFO|^CaloLVL1_IDDetD.*INFO|^LArFCAL_ID +INFO|^LArMiniFCAL_IDD.*INFO|^LArHEC_ID +INFO|^LArMiniFCAL_ID +INFO|TileTBIdDetDesc.*INFO|^TileIDDetDescrCnv +INFO|CaloCell_IDDetD.*INFO|TileID +INFO|^LArFCAL_IDDetDe.*INFO|^TileTBIDDetDesc.*INFO|^LArEM_ID +INFO|^LArHEC_IDDetDes.*INFO|^LArEM_IDDetDesc.*INFO|^EndcapDMConstru.*INFO|^GeoModelSvc +INFO|U-shape parameter|XMLFileCatalog Info|No IOVSvcTool associated|^RalSessionMgr Info|RDBMS technology|^AthenaRootStre.* INFO|^GUID: Class pool::DbString has GUID|INFO TileDddbManager|^HGTD_ID *INFO|Unable to locate catalog|^CORAL/|TFile::Init" + EXTRA_PATTERNS "[0-9] [A-Z]+ 20[123][0-9]|Reading file|^CORAL/Services/ConnectionService (Info|Warning)|^RelationalDatabase Info|^Data source lookup|^DetDescrCnvSvc +INFO|^CORAL/RelationalPlugins/frontier Info|^PluginManager Info|^RalSessionMgr Warning|^DBReplicaSvc +INFO|IOVDbSvc +INFO|^Py:Athena +INFO|^EventInfoMgtInit: Got release|^TEnvRec::ChangeValue|^PoolSvc +INFO|being retired|including file|Deaccess DbDatabase|^IoComponentMgr +INFO|File version|Global positioning|^Domain|duplicate entry|already loaded|RootDbase: all good|frontier.c|^Py:ConfigurableDb +(WARNING|INFO)|ApplicationMgr +INFO|INFO [sS]top|^CaloIdMgrDetDes.*INFO|^TTOnlineIDDetDe.*INFO|^CaloIDHelper_ID.*INFO|^AtlasDetectorID +INFO|^AthenaEventLoopMgrWARNING|^CaloDM_IDDetDes.*INFO|^CaloLVL1_IDDetD.*INFO|^LArFCAL_ID +INFO|^LArMiniFCAL_IDD.*INFO|^LArHEC_ID +INFO|^LArMiniFCAL_ID +INFO|TileTBIdDetDesc.*INFO|^TileIDDetDescrCnv +INFO|CaloCell_IDDetD.*INFO|TileID +INFO|^LArFCAL_IDDetDe.*INFO|^TileTBIDDetDesc.*INFO|^LArEM_ID +INFO|^LArHEC_IDDetDes.*INFO|^LArEM_IDDetDesc.*INFO|^EndcapDMConstru.*INFO|^GeoModelSvc +INFO|U-shape parameter|Cs Tube parameter|XMLFileCatalog Info|No IOVSvcTool associated|^RalSessionMgr Info|RDBMS technology|^AthenaRootStre.* INFO|^GUID: Class pool::DbString has GUID|INFO TileDddbManager|^HGTD_ID *INFO|Unable to locate catalog|^CORAL/|TFile::Init" ) diff --git a/LArCalorimeter/LArRecUtils/python/LArHVCorrToolDefault.py b/LArCalorimeter/LArRecUtils/python/LArHVCorrToolDefault.py index 13f1ba413e6bbe19a7f40f8438917e85fd28f0a0..93c7a423fad8e5158ccceff00e9ea79581bb989d 100644 --- a/LArCalorimeter/LArRecUtils/python/LArHVCorrToolDefault.py +++ b/LArCalorimeter/LArRecUtils/python/LArHVCorrToolDefault.py @@ -37,6 +37,7 @@ def LArHVCorrToolDefault (name="LArHVCorrToolDefault", **kw): tool.doTdrift = False tool.DeltaTupdate = 0 # seconds (if 0, no time-dependent update applied) #tool.OutputLevel = 2 # 2 = DEBUG + mlog.info("in data case") # example to force some HV corection factors for some regions # tool.fixHVCorr = ["1 1 3 2.1 2.3 0.1963 0.3926 2.","1 1 3 2.1 2.3 0.7854 0.98175 2.","1 1 3 2.1 2.3 1.7672 1.9635 2.","1 1 3 -2.5 -2.3 1.3745 1.5708 2."] diff --git a/LArCalorimeter/LArRecUtils/share/LArFCalTowerBuilderTool.ref b/LArCalorimeter/LArRecUtils/share/LArFCalTowerBuilderTool.ref index e0646cb97fba42519ba15dcadc173aa3d5d53448..897a28461385e4c93a899b055f0e855026f11a02 100644 --- a/LArCalorimeter/LArRecUtils/share/LArFCalTowerBuilderTool.ref +++ b/LArCalorimeter/LArRecUtils/share/LArFCalTowerBuilderTool.ref @@ -1,21 +1,15 @@ -Sat Mar 3 19:04:49 CET 2018 +Fri Oct 19 20:13:23 CEST 2018 Preloading tcmalloc_minimal.so Py:Athena INFO including file "AthenaCommon/Preparation.py" -Py:Athena INFO using release [AthenaWorkDir-22.0.1] [x86_64-slc6-gcc62-opt] [atlas-work3/2b49d03691a] -- built on [2018-03-03T1713] +Py:Athena INFO using release [AthenaWorkDir-22.0.1] [x86_64-slc6-gcc62-dbg] [atlas-work3/88b41a9d745] -- built on [2018-10-19T1947] Py:Athena INFO including file "AthenaCommon/Atlas.UnixStandardJob.py" Py:Athena INFO executing ROOT6Setup Py:Athena INFO including file "AthenaCommon/Execution.py" Py:Athena INFO including file "LArRecUtils/LArFCalTowerBuilderTool_test.py" SetGeometryVersion.py obtained major release version 22 Py:Athena INFO including file "IdDictDetDescrCnv/IdDictDetDescrCnv_joboptions.py" -Py:ConfigurableDb INFO Read module info for 5461 configurables from 57 genConfDb files -Py:ConfigurableDb WARNING Found 2 duplicates among the 57 genConfDb files : -Py:ConfigurableDb WARNING -------------------------------------------------- -Py:ConfigurableDb WARNING -<component name>: <module> - [ <duplicates> ] -Py:ConfigurableDb WARNING -------------------------------------------------- -Py:ConfigurableDb WARNING -IDTrackCaloDepositsDecoratorTool: MuonTPTools.MuonTPToolsConf - ['DerivationFrameworkMuons.DerivationFrameworkMuonsConf'] -Py:ConfigurableDb WARNING -MuonTPExtrapolationTool: MuonTPTools.MuonTPToolsConf - ['DerivationFrameworkMuons.DerivationFrameworkMuonsConf'] -Py:ConfigurableDb WARNING Fix your cmt/requirements file !! +Py:ConfigurableDb INFO Read module info for 5522 configurables from 57 genConfDb files +Py:ConfigurableDb INFO No duplicates have been found: that's good ! EventInfoMgtInit: Got release version Athena-22.0.1 Py:IOVDbSvc.CondDB INFO Setting up conditions DB access to instance OFLP200 Py:Athena INFO including file "CaloIdCnv/CaloIdCnv_joboptions.py" @@ -23,22 +17,21 @@ Py:Athena INFO including file "CaloConditions/CaloConditions_jobOptio Py:Athena INFO including file "CaloConditions/LArTTCellMap_ATLAS_jobOptions.py" Py:Athena INFO including file "CaloConditions/CaloTTIdMap_ATLAS_jobOptions.py" Py:Athena INFO including file "TileIdCnv/TileIdCnv_jobOptions.py" +Py:Athena INFO including file "AthenaCommon/runbatch.py" [?1034hApplicationMgr INFO Updating Gaudi::PluginService::SetDebug(level) to level= 'PluginDebugLevel':0 +ApplicationMgr INFO Updating Gaudi::PluginService::SetDebug(level) to level= 'PluginDebugLevel':0 ApplicationMgr SUCCESS ==================================================================================================================================== - Welcome to ApplicationMgr (GaudiCoreSvc v30r1) - running on lxplus076.cern.ch on Sat Mar 3 19:05:00 2018 + Welcome to ApplicationMgr (GaudiCoreSvc v30r3) + running on lxplus055.cern.ch on Fri Oct 19 20:13:36 2018 ==================================================================================================================================== ApplicationMgr INFO Successfully loaded modules : AthenaServices ApplicationMgr INFO Application Manager Configured successfully ApplicationMgr INFO Updating Gaudi::PluginService::SetDebug(level) to level= 'PluginDebugLevel':0 -ApplicationMgr INFO Successfully loaded modules : LArRecUtils -Py:Athena INFO including file "AthenaCommon/runbatch.py" StatusCodeSvc INFO initialize AthDictLoaderSvc INFO in initialize... AthDictLoaderSvc INFO acquired Dso-registry -ClassIDSvc INFO getRegistryEntries: read 13819 CLIDRegistry entries for module ALL -ChronoStatSvc INFO Number of skipped events for MemStat-1 +ClassIDSvc INFO getRegistryEntries: read 3219 CLIDRegistry entries for module ALL CoreDumpSvc INFO install f-a-t-a-l handler... (flag = -1) CoreDumpSvc INFO Handling signals: 11(Segmentation fault) 7(Bus error) 4(Illegal instruction) 8(Floating point exception) MetaDataSvc INFO Initializing MetaDataSvc - package version AthenaServices-00-00-00 @@ -46,9 +39,9 @@ AthenaPoolCnvSvc INFO Initializing AthenaPoolCnvSvc - package version Athena PoolSvc INFO io_register[PoolSvc](xmlcatalog_file:PoolFileCatalog.xml) [ok] PoolSvc INFO Set connectionsvc retry/timeout/IDLE timeout to 'ConnectionRetrialPeriod':300/ 'ConnectionRetrialTimeOut':3600/ 'ConnectionTimeOut':5 seconds with connection cleanup disabled PoolSvc INFO Frontier compression level set to 5 -DBReplicaSvc INFO Frontier server at (serverurl=http://atlasfrontier-local.cern.ch:8000/atlr)(serverurl=http://atlasfrontier-ai.cern.ch:8000/atlr)(serverurl=http://lcgft-atlas.gridpp.rl.ac.uk:3128/frontierATLAS)(serverurl=http://ccfrontier.in2p3.fr:23128/ccin2p3-AtlasFrontier)(proxyurl=http://ca-proxy.cern.ch:3128)(proxyurl=http://ca-proxy-meyrin.cern.ch:3128)(proxyurl=http://ca-proxy-wigner.cern.ch:3128) will be considered for COOL data -DBReplicaSvc INFO Read replica configuration from /cvmfs/atlas-nightlies.cern.ch/repo/sw/master/2018-03-02T2152/Athena/22.0.1/InstallArea/x86_64-slc6-gcc62-opt/share/dbreplica.config -DBReplicaSvc INFO Total of 10 servers found for host lxplus076.cern.ch [ATLF ATLAS_COOLPROD atlas_dd ATLAS_CONFIG INT8R INTR ATONR_COOL ATONR_CONF DEVDB11 ATLF ] +DBReplicaSvc INFO Frontier server at (serverurl=http://atlasfrontier-local.cern.ch:8000/atlr)(serverurl=http://atlasfrontier-ai.cern.ch:8000/atlr)(serverurl=http://lcgft-atlas.gridpp.rl.ac.uk:3128/frontierATLAS)(serverurl=http://ccfrontier.in2p3.fr:23128/ccin2p3-AtlasFrontier)(proxyurl=http://ca-proxy.cern.ch:3128)(proxyurl=http://ca-proxy-meyrin.cern.ch:3128)(proxyurl=http://ca-proxy-wigner.cern.ch:3128)(proxyurl=http://atlasbpfrontier.cern.ch:3127)(proxyurl=http://atlasbpfrontier.fnal.gov:3127) will be considered for COOL data +DBReplicaSvc INFO Read replica configuration from /cvmfs/atlas-nightlies.cern.ch/repo/sw/master/2018-10-18T2313/Athena/22.0.1/InstallArea/x86_64-slc6-gcc62-dbg/share/dbreplica.config +DBReplicaSvc INFO Total of 10 servers found for host lxplus055.cern.ch [ATLF ATLAS_COOLPROD atlas_dd ATLAS_CONFIG INT8R INTR ATONR_COOL ATONR_CONF DEVDB11 ATLF ] PoolSvc INFO Successfully setup replica sorting algorithm PoolSvc INFO Setting up APR FileCatalog and Streams PoolSvc WARNING Unable to locate catalog for prfile:poolcond/PoolCat_oflcond.xml check your ATLAS_POOLCOND_PATH and DATAPATH variables @@ -77,6 +70,9 @@ IOVDbSvc INFO Added taginfo remove for /CALO/Ofl/Identifier/CaloTTOn IOVDbSvc INFO Added taginfo remove for /CALO/Ofl/Identifier/CaloTTPpmRxIdMapAtlas IOVDbSvc INFO Added taginfo remove for /LAR/LArCellPositionShift IOVDbSvc INFO Added taginfo remove for /LAR/Identifier/LArTTCellMapAtlas +ClassIDSvc INFO getRegistryEntries: read 2132 CLIDRegistry entries for module ALL +ClassIDSvc INFO getRegistryEntries: read 17 CLIDRegistry entries for module ALL +ClassIDSvc INFO getRegistryEntries: read 18 CLIDRegistry entries for module ALL DetDescrCnvSvc INFO initializing DetDescrCnvSvc INFO Found DetectorStore service DetDescrCnvSvc INFO filling proxies for detector managers @@ -122,13 +118,6 @@ GeoModelSvc::RD...WARNING Getting PixTBMatComponents with default tag GeoModelSvc::RD...WARNING Getting PixTBMaterials with default tag GeoModelSvc::RD...WARNING Getting InDetMatComponents with default tag GeoModelSvc::RD...WARNING Getting InDetMaterials with default tag -ClassIDSvc INFO getRegistryEntries: read 3456 CLIDRegistry entries for module ALL -GeoModelSvc.LAr... INFO Keys for LAr are ATLAS-R2-2016-01-00-01 ATLAS -GeoModelSvc.LAr... INFO Building LAr version LAr-Revised-17-01 while ATLAS version is ATLAS-R2-2016-01-00-01 -GeoModelSvc.LAr... INFO LAr Geometry Options: -GeoModelSvc.LAr... INFO Sagging = false -GeoModelSvc.LAr... INFO Barrel = ON -GeoModelSvc.LAr... INFO Endcap = ON BarrelConstruction INFO Getting primary numbers for ATLAS, ATLAS-R2-2016-01-00-01 BarrelConstruction INFO Makes detailed absorber sandwich ? 1 1 BarrelConstruction INFO Use sagging in geometry ? 0 @@ -136,7 +125,7 @@ BarrelConstruction INFO Use sagging in geometry ? 0 multi-layered version of absorbers activated, mlabs == 1 ================================================ EventPersistenc... INFO Added successfully Conversion service:DetDescrCnvSvc -ClassIDSvc INFO getRegistryEntries: read 66 CLIDRegistry entries for module ALL +ClassIDSvc INFO getRegistryEntries: read 5819 CLIDRegistry entries for module ALL CaloIDHelper_ID... INFO in createObj: creating a TileTBID helper object in the detector store IdDictDetDescrCnv INFO in initialize IdDictDetDescrCnv INFO in createObj: creating a IdDictManager object in the detector store @@ -160,14 +149,11 @@ IdDictDetDescrCnv INFO Dictionary MuonSpectrometer version R.03 IdDictDetDescrCnv INFO Dictionary TileCalorimeter version fullAtlasAndTestBeam DetDescr tag TileIdentifier-00 file IdDictParser/IdDictTileCalorimeter.xml TileTBID INFO initialize_from_dictionary AtlasDetectorID INFO initialize_from_dictionary - OK -ClassIDSvc INFO getRegistryEntries: read 115 CLIDRegistry entries for module ALL EndcapDMConstru... INFO Start building EC electronics geometry ============== EMEC Construction =============== multi-layered version of absorbers activated, mlabs == 1 ================================================ EndcapDMConstru... INFO Start building EC electronics geometry -GeoModelSvc INFO GeoModelSvc.LArDetectorToolNV SZ= 21964Kb Time = 0.55S -GeoModelSvc.Til... INFO Entering TileDetectorTool::create() TileDddbManager INFO m_tag = ATLAS-R2-2016-01-00-01 TileDddbManager INFO n_tiglob = 5 TileDddbManager INFO n_timod = 320 @@ -175,13 +161,14 @@ TileDddbManager INFO n_cuts = 9 TileDddbManager INFO n_saddle = 1 TileDddbManager INFO n_tilb = 21 TileDddbManager INFO n_tileSwitches = 1 +ClassIDSvc INFO getRegistryEntries: read 213 CLIDRegistry entries for module ALL CaloIDHelper_ID... INFO in createObj: creating a TileID helper object in the detector store AtlasDetectorID INFO initialize_from_dictionary - OK -TileNeighbour INFO Reading file /cvmfs/atlas-nightlies.cern.ch/repo/sw/master/2018-03-02T2152/Athena/22.0.1/InstallArea/x86_64-slc6-gcc62-opt/share/TileNeighbour_reduced.txt +TileNeighbour INFO Reading file /cvmfs/atlas-nightlies.cern.ch/repo/sw/master/2018-10-18T2313/Athena/22.0.1/InstallArea/x86_64-slc6-gcc62-dbg/share/TileNeighbour_reduced.txt TileHWIDDetDesc... INFO in createObj: creating a TileHWID helper object in the detector store TileHWID INFO initialize_from_dictionary AtlasDetectorID INFO initialize_from_dictionary - OK -ClassIDSvc INFO getRegistryEntries: read 6 CLIDRegistry entries for module ALL +ClassIDSvc INFO getRegistryEntries: read 55 CLIDRegistry entries for module ALL CaloIDHelper_ID... INFO in createObj: creating a CaloCell_ID helper object in the detector store CaloIDHelper_ID... INFO in createObj: creating a LArEM_ID helper object in the detector store AtlasDetectorID INFO initialize_from_dictionary - OK @@ -189,50 +176,21 @@ CaloIDHelper_ID... INFO in createObj: creating a LArHEC_ID helper object in th AtlasDetectorID INFO initialize_from_dictionary - OK CaloIDHelper_ID... INFO in createObj: creating a LArFCAL_ID helper object in the detector store AtlasDetectorID INFO initialize_from_dictionary - OK -LArFCAL_Base_ID INFO Reading file /cvmfs/atlas-nightlies.cern.ch/repo/sw/master/2018-03-02T2152/Athena/22.0.1/InstallArea/x86_64-slc6-gcc62-opt/share/FCal2DNeighbors-April2011.txt -LArFCAL_Base_ID INFO Reading file /cvmfs/atlas-nightlies.cern.ch/repo/sw/master/2018-03-02T2152/Athena/22.0.1/InstallArea/x86_64-slc6-gcc62-opt/share/FCal3DNeighborsNext-April2011.txt -LArFCAL_Base_ID INFO Reading file /cvmfs/atlas-nightlies.cern.ch/repo/sw/master/2018-03-02T2152/Athena/22.0.1/InstallArea/x86_64-slc6-gcc62-opt/share/FCal3DNeighborsPrev-April2011.txt +LArFCAL_Base_ID INFO Reading file /cvmfs/atlas-nightlies.cern.ch/repo/sw/master/2018-10-18T2313/Athena/22.0.1/InstallArea/x86_64-slc6-gcc62-dbg/share/FCal2DNeighbors-April2011.txt +LArFCAL_Base_ID INFO Reading file /cvmfs/atlas-nightlies.cern.ch/repo/sw/master/2018-10-18T2313/Athena/22.0.1/InstallArea/x86_64-slc6-gcc62-dbg/share/FCal3DNeighborsNext-April2011.txt +LArFCAL_Base_ID INFO Reading file /cvmfs/atlas-nightlies.cern.ch/repo/sw/master/2018-10-18T2313/Athena/22.0.1/InstallArea/x86_64-slc6-gcc62-dbg/share/FCal3DNeighborsPrev-April2011.txt CaloIDHelper_ID... INFO in createObj: creating a LArMiniFCAL_ID helper object in the detector store AtlasDetectorID INFO initialize_from_dictionary - OK LArMiniFCAL_ID INFO initialize_from_dict - LArCalorimeter dictionary does NOT contain miniFCAL description. Unable to initialize LArMiniFCAL_ID. AtlasDetectorID INFO initialize_from_dictionary - OK -GeoModelSvc.Til... INFO U-shape parameter from database is: 1 -GeoModelSvc.Til... INFO Glue parameter from database is: 1 -GeoModelSvc.Til... INFO Entering TileAtlasFactory::create() -GeoModelSvc.Til... INFO Tile Geometry with Saddle supports, starting from TileCal-CSC-02 xxx -GeoModelSvc.Til... INFO => New BFingerLengthPos 430.5 -GeoModelSvc.Til... INFO => New BFingerLengthNeg 420.5 -GeoModelSvc.Til... INFO Positioning barrel with translation 0 -GeoModelSvc.Til... INFO Positioning positive barrel finger with translation 3035.25 -GeoModelSvc.Til... INFO Positioning negative barrel finger with translation -3030.25 -GeoModelSvc.Til... INFO Positioning positive ext.barrel with translation 4854.75 -GeoModelSvc.Til... INFO Positioning positive ext.barrel finger with translation ztrans= 6338.5 -GeoModelSvc.Til... INFO Positioning positive ext.barrel saddle with translation ztrans= 6192.5 -GeoModelSvc.Til... INFO Positive ITC envelope parameters: PLUG1 Rmin= 3438.85 Rmax= 4250 dzITC1= 154.5 -GeoModelSvc.Til... INFO PLUG2 Rmin= 2981 Rmax= 3440 dzITC2= 47.425 -GeoModelSvc.Til... INFO Positioning positive ITC with translation 3405 -GeoModelSvc.Til... INFO Positioning positive Gap with translation 3552 -GeoModelSvc.Til... INFO Positioning positive Crack with translation 3536 -GeoModelSvc.Til... INFO Positioning negative ext.barrel with translation ztrans -4854.75 -GeoModelSvc.Til... INFO Positioning negative ext.barrel finger with translation ztrans= -6338.5 -GeoModelSvc.Til... INFO Positioning negative ext.barrel saddle with translation ztrans= -6192.5 -GeoModelSvc.Til... INFO Negative ITC envelope parameters: PLUG1 Rmin= 3438.85 Rmax= 4250 dzITC1= 154.5 -GeoModelSvc.Til... INFO PLUG2 Rmin= 2981 Rmax= 3440 dzITC2= 47.425 -GeoModelSvc.Til... INFO Positioning negative ITC with translation -3405 -GeoModelSvc.Til... INFO Positioning negative Gap with translation -3552 -GeoModelSvc.Til... INFO Positioning negative Crack with translation -3536 -GeoModelSvc.Til... INFO Global positioning of barrel with rotation (0,0,0)) and translation (0,0,0) CLHEP::cm -GeoModelSvc.Til... INFO Global positioning of positive ext.barrel with rotation (0,0,0)) and translation (0,0,0) CLHEP::cm -GeoModelSvc.Til... INFO Global positioning of negative ext.barrel with rotation (0,0,0)) and translation (0,0,1) CLHEP::cm TileDetDescrMan... INFO Entering create_elements() -GeoModelSvc INFO GeoModelSvc.TileDetectorTool SZ= 4520Kb Time = 0.21S ClassIDSvc INFO getRegistryEntries: read 65 CLIDRegistry entries for module ALL AthenaEventLoopMgr INFO Initializing AthenaEventLoopMgr - package version AthenaServices-00-00-00 CondInputLoader INFO Initializing CondInputLoader... CondInputLoader INFO Adding base classes: CondInputLoader INFO Will create WriteCondHandle dependencies for the following DataObjects: +ClassIDSvc INFO getRegistryEntries: read 11031 CLIDRegistry entries for module ALL CaloIdMgrDetDes... INFO in createObj: creating a CaloDescrManager object in the detector store -ClassIDSvc INFO getRegistryEntries: read 318 CLIDRegistry entries for module ALL CaloIDHelper_ID... INFO in createObj: creating a CaloDM_ID helper object in the detector store CaloDM_ID INFO initialize_from_dictionary AtlasDetectorID INFO initialize_from_dictionary - OK @@ -249,12 +207,12 @@ CaloIDHelper_ID... INFO in createObj: creating a LArHEC_SuperCell_ID helper ob AtlasDetectorID INFO initialize_from_dictionary - OK CaloIDHelper_ID... INFO in createObj: creating a LArFCAL_SuperCell_ID helper object in the detector store AtlasDetectorID INFO initialize_from_dictionary - OK -LArFCAL_Base_ID INFO Reading file /cvmfs/atlas-nightlies.cern.ch/repo/sw/master/2018-03-02T2152/Athena/22.0.1/InstallArea/x86_64-slc6-gcc62-opt/share/FCalSuperCells2DNeighborsNew-April2014.txt -LArFCAL_Base_ID INFO Reading file /cvmfs/atlas-nightlies.cern.ch/repo/sw/master/2018-03-02T2152/Athena/22.0.1/InstallArea/x86_64-slc6-gcc62-opt/share/FCalSuperCells3DNeighborsNextNew-April2014.txt -LArFCAL_Base_ID INFO Reading file /cvmfs/atlas-nightlies.cern.ch/repo/sw/master/2018-03-02T2152/Athena/22.0.1/InstallArea/x86_64-slc6-gcc62-opt/share/FCalSuperCells3DNeighborsPrevNew-April2014.txt +LArFCAL_Base_ID INFO Reading file /cvmfs/atlas-nightlies.cern.ch/repo/sw/master/2018-10-18T2313/Athena/22.0.1/InstallArea/x86_64-slc6-gcc62-dbg/share/FCalSuperCells2DNeighborsNew-April2014.txt +LArFCAL_Base_ID INFO Reading file /cvmfs/atlas-nightlies.cern.ch/repo/sw/master/2018-10-18T2313/Athena/22.0.1/InstallArea/x86_64-slc6-gcc62-dbg/share/FCalSuperCells3DNeighborsNextNew-April2014.txt +LArFCAL_Base_ID INFO Reading file /cvmfs/atlas-nightlies.cern.ch/repo/sw/master/2018-10-18T2313/Athena/22.0.1/InstallArea/x86_64-slc6-gcc62-dbg/share/FCalSuperCells3DNeighborsPrevNew-April2014.txt CaloIDHelper_ID... INFO in createObj: creating a Tile_SuperCell_ID helper object in the detector store AtlasDetectorID INFO initialize_from_dictionary - OK -TileNeighbour INFO Reading file /cvmfs/atlas-nightlies.cern.ch/repo/sw/master/2018-03-02T2152/Athena/22.0.1/InstallArea/x86_64-slc6-gcc62-opt/share/TileSuperCellNeighbour.txt +TileNeighbour INFO Reading file /cvmfs/atlas-nightlies.cern.ch/repo/sw/master/2018-10-18T2313/Athena/22.0.1/InstallArea/x86_64-slc6-gcc62-dbg/share/TileSuperCellNeighbour.txt AtlasDetectorID INFO initialize_from_dictionary - OK CaloIdMgrDetDes... INFO Finished CaloIdMgrDetDes... INFO Initializing CaloIdMgr from values in CaloIdMgrDetDescrCnv @@ -265,7 +223,7 @@ ApplicationMgr INFO Application Manager Started successfully AthenaEventLoopMgr INFO ===>>> start of run 1 <<<=== EventPersistenc... INFO Added successfully Conversion service:AthenaPoolCnvSvc EventPersistenc... INFO Added successfully Conversion service:TagInfoMgr -ClassIDSvc INFO getRegistryEntries: read 114 CLIDRegistry entries for module ALL +ClassIDSvc INFO getRegistryEntries: read 109 CLIDRegistry entries for module ALL IOVDbSvc INFO Opening COOL connection for COOLOFL_LAR/OFLP200 IOVDbSvc INFO HVS tag OFLCOND-SDR-BS14T-IBL-06 resolved to LARAlign-mc11-00 for folder /LAR/Align IOVDbSvc INFO HVS tag OFLCOND-SDR-BS14T-IBL-06 resolved to LArCellPositionShift-ideal for folder /LAR/LArCellPositionShift @@ -276,9 +234,7 @@ Domain[ROOT_All] INFO > Access DbDomain READ [ROOT_All] Domain[ROOT_All] INFO -> Access DbDatabase READ [ROOT_All] 06C9EAE8-6F5B-E011-BAAA-003048F0E7AC Domain[ROOT_All] INFO /cvmfs/atlas-condb.cern.ch/repo/conditions/cond09/cond09_mc.000029.gen.COND/cond09_mc.000029.gen.COND._0002.pool.root RootDatabase.open INFO /cvmfs/atlas-condb.cern.ch/repo/conditions/cond09/cond09_mc.000029.gen.COND/cond09_mc.000029.gen.COND._0002.pool.root File version:52200 -ClassIDSvc INFO getRegistryEntries: read 48 CLIDRegistry entries for module ALL CaloMgrDetDescrCnv INFO in createObj: creating a Calo Detector Manager object in the detector store -ClassIDSvc INFO getRegistryEntries: read 61 CLIDRegistry entries for module ALL Domain[ROOT_All] INFO -> Access DbDatabase READ [ROOT_All] 8667C6F2-1559-DE11-A611-000423D9A21A Domain[ROOT_All] INFO /cvmfs/atlas-condb.cern.ch/repo/conditions/cond08/cond08_mc.000003.gen.COND/cond08_mc.000003.gen.COND._0064.pool.root RootDatabase.open INFO /cvmfs/atlas-condb.cern.ch/repo/conditions/cond08/cond08_mc.000003.gen.COND/cond08_mc.000003.gen.COND._0064.pool.root File version:52200 @@ -6687,9 +6643,9 @@ towers 6399 100 64 0 AthenaEventLoopMgr INFO ===>>> done processing event #1, run #1 1 events processed so far <<<=== /cvmfs/atlas-co... INFO Database being retired... -Domain[ROOT_All] INFO -> Deaccess DbDatabase READ [ROOT_All] 8667C6F2-1559-DE11-A611-000423D9A21A -/cvmfs/atlas-co... INFO Database being retired... Domain[ROOT_All] INFO -> Deaccess DbDatabase READ [ROOT_All] 06C9EAE8-6F5B-E011-BAAA-003048F0E7AC +/cvmfs/atlas-co... INFO Database being retired... +Domain[ROOT_All] INFO -> Deaccess DbDatabase READ [ROOT_All] 8667C6F2-1559-DE11-A611-000423D9A21A Domain[ROOT_All] INFO > Deaccess DbDomain READ [ROOT_All] Domain[ROOT_All] INFO > Deaccess DbDomain READ [ROOT_All] ApplicationMgr INFO Application Manager Stopped successfully @@ -6697,25 +6653,25 @@ IncidentProcAlg1 INFO Finalize CondInputLoader INFO Finalizing CondInputLoader... IncidentProcAlg2 INFO Finalize IdDictDetDescrCnv INFO in finalize -IOVDbSvc INFO Folder /LAR/Align (PoolRef) db-read 1/1 objs/chan/bytes 1/1/170 (( 1.18 ))s +IOVDbSvc INFO Folder /LAR/Align (PoolRef) db-read 1/1 objs/chan/bytes 1/1/170 (( 0.08 ))s IOVDbSvc INFO Folder /CALO/Ofl/Identifier/CaloTTOnAttrIdMapAtlas (PoolRef) db-read 0/0 objs/chan/bytes 0/1/0 (( 0.00 ))s IOVDbSvc INFO Folder /CALO/Ofl/Identifier/CaloTTOnOffIdMapAtlas (PoolRef) db-read 0/0 objs/chan/bytes 0/1/0 (( 0.00 ))s IOVDbSvc INFO Folder /CALO/Ofl/Identifier/CaloTTPpmRxIdMapAtlas (PoolRef) db-read 0/0 objs/chan/bytes 0/1/0 (( 0.00 ))s -IOVDbSvc INFO Folder /LAR/LArCellPositionShift (PoolRef) db-read 1/1 objs/chan/bytes 1/1/195 (( 0.96 ))s -IOVDbSvc INFO Folder /LAR/Identifier/LArTTCellMapAtlas (PoolRef) db-read 1/0 objs/chan/bytes 1/1/173 (( 1.18 ))s +IOVDbSvc INFO Folder /LAR/LArCellPositionShift (PoolRef) db-read 1/1 objs/chan/bytes 1/1/195 (( 0.02 ))s +IOVDbSvc INFO Folder /LAR/Identifier/LArTTCellMapAtlas (PoolRef) db-read 1/0 objs/chan/bytes 1/1/173 (( 0.03 ))s IOVDbSvc WARNING Folder /LAR/Identifier/LArTTCellMapAtlas is requested but no data retrieved -IOVDbSvc INFO Total payload read from COOL: 538 bytes in (( 3.32 ))s +IOVDbSvc INFO Total payload read from COOL: 538 bytes in (( 0.13 ))s IOVDbSvc INFO Connection sqlite://;schema=mycool.db;dbname=OFLP200 : nConnect: 0 nFolders: 0 ReadTime: (( 0.00 ))s -IOVDbSvc INFO Connection COOLOFL_LAR/OFLP200 : nConnect: 2 nFolders: 3 ReadTime: (( 3.32 ))s +IOVDbSvc INFO Connection COOLOFL_LAR/OFLP200 : nConnect: 2 nFolders: 3 ReadTime: (( 0.13 ))s IOVDbSvc INFO Connection COOLOFL_CALO/OFLP200 : nConnect: 1 nFolders: 3 ReadTime: (( 0.00 ))s AthDictLoaderSvc INFO in finalize... ToolSvc INFO Removing all tools created by ToolSvc *****Chrono***** INFO **************************************************************************************************** *****Chrono***** INFO The Final CPU consumption ( Chrono ) Table (ordered) *****Chrono***** INFO **************************************************************************************************** -cObjR_ALL INFO Time User : Tot= 460 [ms] Ave/Min/Max= 230(+- 210)/ 20/ 440 [ms] #= 2 -cObj_ALL INFO Time User : Tot= 0.52 [s] Ave/Min/Max= 0.26(+- 0.23)/ 0.03/ 0.49 [s] #= 2 -ChronoStatSvc INFO Time User : Tot= 2.74 [s] #= 1 +cObjR_ALL INFO Time User : Tot= 0.69 [s] Ave/Min/Max=0.345(+-0.325)/ 0.02/ 0.67 [s] #= 2 +cObj_ALL INFO Time User : Tot= 0.84 [s] Ave/Min/Max= 0.42(+- 0.35)/ 0.07/ 0.77 [s] #= 2 +ChronoStatSvc INFO Time User : Tot= 19.2 [s] #= 1 *****Chrono***** INFO **************************************************************************************************** ChronoStatSvc.f... INFO Service finalized successfully ApplicationMgr INFO Application Manager Finalized successfully diff --git a/LArCalorimeter/LArRecUtils/share/LArFCalTowerBuilderTool_test.py b/LArCalorimeter/LArRecUtils/share/LArFCalTowerBuilderTool_test.py index 1426be48d3e5863c253588cc30a0cc5a22665212..2c95824f09c11c4f7f802fe9bc51ee65dde4d13f 100644 --- a/LArCalorimeter/LArRecUtils/share/LArFCalTowerBuilderTool_test.py +++ b/LArCalorimeter/LArRecUtils/share/LArFCalTowerBuilderTool_test.py @@ -42,4 +42,7 @@ topSequence += LArRecUtilsConf.LArFCalTowerBuilderToolTestAlg ('towertest') theApp.EvtMax = 1 -theApp.getHandle().Dlls += [ 'LArRecUtils' ] +# Suppress useless GeoModelSvc messages. +from AthenaCommon import Constants +GeoModelSvc().OutputLevel=Constants.WARNING + diff --git a/LArCalorimeter/LArRecUtils/src/LArHVScaleCorrCondAlg.cxx b/LArCalorimeter/LArRecUtils/src/LArHVScaleCorrCondAlg.cxx new file mode 100644 index 0000000000000000000000000000000000000000..2ba05844981847cecb870de915b1aaab25059ba4 --- /dev/null +++ b/LArCalorimeter/LArRecUtils/src/LArHVScaleCorrCondAlg.cxx @@ -0,0 +1,656 @@ +/* + Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration +*/ + +#include "LArHVScaleCorrCondAlg.h" +#include "AthenaKernel/errorcheck.h" +#include "GaudiKernel/IIncidentSvc.h" +#include "CaloDetDescr/CaloDetDescrElement.h" +#include "xAODEventInfo/EventInfo.h" + +#include "AthenaPoolUtilities/CondAttrListCollection.h" +#include "AthenaPoolUtilities/AthenaAttributeList.h" +#include "CoralBase/Blob.h" + +#include "GaudiKernel/IChronoStatSvc.h" +#include "CLHEP/Units/SystemOfUnits.h" +#include "LArIdentifier/LArElectrodeID.h" + +#include <cmath> +#include <bitset> + +using CLHEP::microsecond; +using CLHEP::second; + +LArHVScaleCorrCondAlg::LArHVScaleCorrCondAlg(const std::string& name, ISvcLocator* pSvcLocator) + : + AthAlgorithm(name, pSvcLocator ), m_condSvc("CondSvc",name), + m_lar_on_id(nullptr), + m_calocell_id(nullptr), + m_larem_id(nullptr), + m_larhec_id(nullptr), + m_larfcal_id(nullptr), + m_electrodeID(nullptr) +{ + + m_deltatupdate = 0; + m_T0 = 90.371; // parameter for vdrift + + declareProperty("fixHVCorr", m_fixHVStrings); + declareProperty("DeltaTupdate", m_deltatupdate); + declareProperty("UpdateIfChanged",m_updateIfChanged=true,"Update HV regions for which the HV has acutally changed"); + declareProperty("UndoOnlineHVCorr",m_undoOnlineHVCorr=true,"Undo the HVCorr done online"); + +} + + +LArHVScaleCorrCondAlg::~LArHVScaleCorrCondAlg() { +} + +StatusCode LArHVScaleCorrCondAlg::initialize() { + ATH_MSG_DEBUG("LArHVScaleCorrCondAlg initialize() begin"); + + // CondSvc + ATH_CHECK( m_condSvc.retrieve() ); + + // retrieve id helpers + ATH_CHECK(detStore()->retrieve(m_lar_on_id,"LArOnlineID")); + ATH_CHECK(detStore()->retrieve(m_calocell_id,"CaloCell_ID")); + ATH_CHECK(detStore()->retrieve( m_caloIdMgr )); + + m_larem_id = m_caloIdMgr->getEM_ID(); + m_larhec_id = m_caloIdMgr->getHEC_ID(); + m_larfcal_id = m_caloIdMgr->getFCAL_ID(); + + ATH_CHECK(detStore()->retrieve(m_calodetdescrmgr)); + + ATH_CHECK(detStore()->retrieve(m_electrodeID)); + + ATH_CHECK(this->buildFixHVList()); + + //Initialize hash-ranges + //FIXME: Hardcoded numbers are not ideal + //But the identifier helpers don't provide them. + + const unsigned A=1; + const unsigned C=0; + //Offline hash ranges: + m_hashRanges[A].resize(NHVPARTITION); + m_hashRanges[C].resize(NHVPARTITION); + m_hashRanges[C][EMECIW]=std::make_pair<IdentifierHash,IdentifierHash>(0,896); + m_hashRanges[C][EMECPS]=std::make_pair<IdentifierHash,IdentifierHash>(896,1664); + m_hashRanges[C][EMECOW]=std::make_pair<IdentifierHash,IdentifierHash>(1664,31872); + m_hashRanges[C][EMBPS]=std::make_pair<IdentifierHash,IdentifierHash>(31872,35776); + m_hashRanges[C][EMB]=std::make_pair<IdentifierHash,IdentifierHash>(35776,86656); + m_hashRanges[A][EMBPS]=std::make_pair<IdentifierHash,IdentifierHash>(86656,90560); + m_hashRanges[A][EMB]=std::make_pair<IdentifierHash,IdentifierHash>(90560,141440); + m_hashRanges[A][EMECPS]=std::make_pair<IdentifierHash,IdentifierHash>(141440,142208); + m_hashRanges[A][EMECOW]=std::make_pair<IdentifierHash,IdentifierHash>(142208,172416); + m_hashRanges[A][EMECIW]=std::make_pair<IdentifierHash,IdentifierHash>(172416,173312); + m_hashRanges[C][HEC]=std::make_pair<IdentifierHash,IdentifierHash>(173312,176128); + m_hashRanges[A][HEC]=std::make_pair<IdentifierHash,IdentifierHash>(176128,178944); + m_hashRanges[C][FCAL]=std::make_pair<IdentifierHash,IdentifierHash>(178944,180706); + m_hashRanges[A][FCAL]=std::make_pair<IdentifierHash,IdentifierHash>(180706,182468); + + m_completeRange.push_back(std::make_pair<IdentifierHash,IdentifierHash>(0,182468)); + + + if (m_updateIfChanged) + ATH_MSG_INFO( "Will re-compute HV correction for channels with updated voltage" ); + else { + if (m_deltatupdate) ATH_MSG_INFO( "Will re-compute HV corrections after " << m_deltatupdate <<" seconds." ); + ATH_MSG_INFO( "Will re-compute HV corrections for each new LumiBlock" ); + } + + ATH_CHECK(m_cablingKey.initialize()); + ATH_CHECK(m_hvKey.initialize()); + if(!m_updateIfChanged) ATH_CHECK(m_eventInfoKey.initialize()); + if(m_undoOnlineHVCorr) ATH_CHECK(m_onlineHVScaleCorrKey.initialize()); + + ATH_CHECK(m_outputHVScaleCorrKey.initialize()); + + // Register write handle + ATH_CHECK(m_condSvc->regHandle(this, m_outputHVScaleCorrKey)); + + ATH_MSG_DEBUG("LArHVScaleCorrCondAlg initialize() end"); + return StatusCode::SUCCESS; +} + +StatusCode LArHVScaleCorrCondAlg::execute() { + + // test validity of write handle + SG::WriteCondHandle<ILArHVScaleCorr> writeHandle(m_outputHVScaleCorrKey); + if (writeHandle.isValid()) { + ATH_MSG_DEBUG( "Found valid " << writeHandle.fullKey() << " handle."); + return StatusCode::SUCCESS; + } + + // get DCS HVData + SG::ReadCondHandle<LArHVData> hvDataHdl(m_hvKey); + const LArHVData *hvdata = *hvDataHdl; + + // Online HVScaleCorr (if needed to subtract) + const LArHVScaleCorrFlat *onlHVCorr = nullptr; + if(m_undoOnlineHVCorr) { + SG::ReadCondHandle<ILArHVScaleCorr> onlHVCorrHdl(m_onlineHVScaleCorrKey); + onlHVCorr = dynamic_cast<const LArHVScaleCorrFlat*>(*onlHVCorrHdl); + if(!onlHVCorr) { + ATH_MSG_ERROR("Do not have online HV corr. conditions object, but asked to undo !!!!"); + return StatusCode::FAILURE; + } + + } + + // Define validity of the output cond object + EventIDRange rangeW; + if(!hvDataHdl.range(rangeW)) { + ATH_MSG_ERROR("Failed to retrieve validity range for " << hvDataHdl.key()); + return StatusCode::FAILURE; + } + + std::vector<float> vScale; + vScale.resize(182468,(float)1.0); + + ATH_MSG_DEBUG("LArHVScaleCorrCondAlg execute()"); + if (m_updateIfChanged) { + const std::set<Identifier>& updatedCells=hvdata->getUpdatedCells(); + if (updatedCells.size()) { + const HASHRANGEVEC hashranges=this->cellsIDsToPartition(updatedCells); + StatusCode sc=this->getScale(hashranges, vScale, hvdata, onlHVCorr); + if (sc.isFailure()) { + ATH_MSG_ERROR( " LArHVScaleCorrCondAlg::LoadCalibration error in getScale" ); + return sc; + } + } + else { + ATH_MSG_DEBUG("No real voltage change, no update necessary"); + return StatusCode::SUCCESS; + } + }//end if updateIfChanges + else { + static unsigned int timestamp_old = 0; + static unsigned int lumiblock_old = 0; + static unsigned int run_old = 0; + SG::ReadHandle<xAOD::EventInfo> eventInfo (m_eventInfoKey); + if (not eventInfo.isValid()) { + ATH_MSG_WARNING(" Cannot access to event info, will recompute on every event"); + m_updateIfChanged = true; + return StatusCode::SUCCESS; + } + const unsigned int lumiblock = eventInfo->lumiBlock(); + const unsigned int run = eventInfo->runNumber(); + const unsigned int timestamp = eventInfo->timeStamp(); + + ATH_MSG_DEBUG("run|lbn|timestamp [CURRENT][CACHED] --> [ " + << run << " | " << lumiblock << " | " << timestamp << " ] [ " + << run_old << " | " << lumiblock_old << " | " << timestamp_old << " ] "); + + const bool updateAfterDeltaT = ( m_deltatupdate && (timestamp - timestamp_old) >= m_deltatupdate ); + const unsigned int deltat = m_deltatupdate > 0?m_deltatupdate:120; + + if (lumiblock != lumiblock_old || run != run_old || updateAfterDeltaT ) { + + timestamp_old = timestamp; + lumiblock_old = lumiblock; + run_old = run; + + const EventIDBase start{run, EventIDBase::UNDEFEVT, timestamp, 0, lumiblock, EventIDBase::UNDEFNUM}; + const EventIDBase stop{run, EventIDBase::UNDEFEVT, timestamp+deltat, 0, lumiblock+1, EventIDBase::UNDEFNUM}; + const EventIDRange rangeWLB{start, stop}; + + rangeW = EventIDRange::intersect(rangeW,rangeWLB); + const std::set<Identifier>& updatedCells=hvdata->getUpdatedCells(); + if (updatedCells.size()) { + IChronoStatSvc* chrono; + if (StatusCode::SUCCESS!=service("ChronoStatSvc" , chrono )) { + ATH_MSG_ERROR("cannot find chronostat " ); + return StatusCode::FAILURE; + } + std::string chronoName = "LArHVScaleCorrCondAlg"; + chrono -> chronoStart( chronoName); + StatusCode sc=this->getScale(m_completeRange, vScale, hvdata, onlHVCorr); + if (sc.isFailure()) { + ATH_MSG_ERROR( " LArHVScaleCorrCondAlg::LoadCalibration error in getScale" ); + return sc; + } + chrono -> chronoStop( chronoName ); + ATH_MSG_DEBUG("LArHVScaleCorrCondAlg Chrono stop : delta " + << chrono->chronoDelta (chronoName,IChronoStatSvc::USER ) + * (microsecond / second) << " second "); + + } + }//end if + }//end else m_updateIfChanged + + // and now record output object + SG::ReadCondHandle<LArOnOffIdMapping> larCablingHdl(m_cablingKey); + const LArOnOffIdMapping* cabling=*larCablingHdl; + if(!cabling) { + ATH_MSG_ERROR("Could not get LArOnOffIdMapping !!"); + return StatusCode::FAILURE; + } + std::unique_ptr<LArHVCorr> hvCorr = std::make_unique<LArHVCorr>(vScale, cabling, m_calocell_id ); + //LArHVScaleCorrFlat * hvCorr = new LArHVScaleCorrFlat(vScale); + const EventIDRange crangeW(rangeW); + if(writeHandle.record(crangeW,hvCorr.release()).isFailure()) { + ATH_MSG_ERROR("Could not record LArHVCorr object with " << writeHandle.key() + << " with EventRange " << crangeW << " into Conditions Store"); + return StatusCode::FAILURE; + } + + ATH_MSG_INFO("recorded new " << writeHandle.key() << " with range " << crangeW << " into Conditions Store"); + + return StatusCode::SUCCESS; +} + + +StatusCode LArHVScaleCorrCondAlg::finalize() +{ + return StatusCode::SUCCESS; +} + + +// *** compute global ADC2MeV factor from subfactors *** +StatusCode LArHVScaleCorrCondAlg::getScale(const HASHRANGEVEC& hashranges, std::vector<float> &vScale, const LArHVData *hvdata, const LArHVScaleCorrFlat *onlHVCorr) const { + + unsigned nChannelsUpdates=0; + + HASHRANGEVEC::const_iterator rit=hashranges.begin(); + HASHRANGEVEC::const_iterator rit_e=hashranges.end(); + for (;rit!=rit_e;++rit) { + for (size_t idx=rit->first;idx<rit->second;++idx) { + const IdentifierHash oflHash(idx); + float mycorr; + float mynorm; + + double d=.2; // nominal gap in cm + double nominal=2000.; // nominal HV in Volts + double T=88.; // temperature in Kelvin + + bool isbarrelEM=false; + bool isFCAL1=false; + + unsigned int subdet=99; + unsigned int layer=99; + const CaloDetDescrElement* calodde = m_calodetdescrmgr->get_element(oflHash); + if (!calodde) { + ATH_MSG_WARNING( "No DDE found for cell " << oflHash ); + continue; + } + const Identifier offid=calodde->identify(); + const float eta_raw = calodde->eta_raw(); + const float phi_raw = calodde->phi_raw(); + + + // EM calorimeter + if (m_larem_id->is_lar_em(offid)) { + // barrel + if (abs(m_larem_id->barrel_ec(offid))==1) { + subdet=0; + layer = m_larem_id->sampling(offid); + // EMB + if (m_larem_id->sampling(offid)>0) { + d=0.209; + nominal=2000.; + T=88.37; + isbarrelEM=true; + } + // EMBPS + else { + nominal = 2000.; + T = 88.37; + const int ieta=m_larem_id->eta(offid); + if (ieta>=0 && ieta<16) d = 0.196; //cm + else if (ieta>=16 && ieta<32) d = 0.193; //cm + else if (ieta>=32 && ieta<48) d = 0.2; //cm + else d = 0.190; //cm + } + } + // endcap + else { + subdet=1; + layer = m_larem_id->sampling(offid); + // End-Cap pre-sampler + if (abs(m_larem_id->barrel_ec(offid))==2 && m_larem_id->sampling(offid)==0){ + T = 88.65; // temperature remainder Calorimeter + nominal = -2000.; + d = 0.2; + } + //EMEC + else { + T = 88.65; + float aeta_raw = std::fabs(eta_raw); + double Zsamp; + if ( m_larem_id->sampling(offid)==1 && m_larem_id->region(offid)>=0 ) Zsamp = 3760.; //mm + else if ( m_larem_id->sampling(offid)==2 && m_larem_id->region(offid)<=1 ) Zsamp = 3880.; //mm + else if(aeta_raw< 2.) Zsamp=4200.-40.*(aeta_raw-1.5); + else Zsamp = 4180. - 160.*(aeta_raw-2.); + nominal = EMEC_nominal(aeta_raw); + d = EMEC_gap(aeta_raw, Zsamp)*0.1; //cm + }//end EMEC + }//end endcap + }//end is-em + // Forward Calorimeter + else if ( m_larfcal_id->is_lar_fcal(offid)) { + subdet=3; + layer = m_larfcal_id->module(offid); + T = 88.65; + if (m_larfcal_id->module(offid)==1){ + d =0.0269; //cm + nominal = 250.; + isFCAL1=true; + } + else if (m_larfcal_id->module(offid)==2){ + d =0.0376;//cm + nominal = 375.; + } + else { + d =0.0508;//cm + nominal = 500.; + } + } + // Hadronic Calorimeter + else if ( m_larhec_id->is_lar_hec(offid)) { + subdet=2; + layer = m_larhec_id->sampling(offid); + T = 88.65; + nominal = 1800.; + d = 0.196;//cm + } + T = T - m_T0; + + const double E_nominal = champ_e(nominal,d); + std::vector<LArHVData::HV_t> hvlist; + StatusCode sc = hvdata->getHV(offid,hvlist); + + if (sc.isFailure() || hvlist.size()==0) { + mycorr=1.; + mynorm=1.; + ATH_MSG_WARNING( " HV value no found for cell " << m_larem_id->show_to_string(offid) ); + } + + else { + // dump values + bool notfound=false; + for (unsigned int i=0;i<hvlist.size();i++) { + // log << MSG::DEBUG << " " << hvlist[i].hv; + if (hvlist[i].hv<-10000) notfound=true; + } + // log << MSG::DEBUG ); + + if (notfound) { + ATH_MSG_WARNING( " At least one HV value not found in database for cell " << m_larem_id->show_to_string(offid) ); + } + + mycorr=0.; + mynorm=0.; + for (unsigned int i=0;i<hvlist.size();i++) { + double E = champ_e(hvlist[i].hv,d); + + // dont correct if E is very close to E nominal to avoid small glitches + if (std::fabs(E_nominal)>1e-3) { + const double deviation = std::fabs((E-E_nominal)/E_nominal); + if (deviation<1e-3) E = E_nominal; + } + +// barrel accordion + if (isbarrelEM) { + const double corr = this->Scale_barrel(hvlist[i].hv)*hvlist[i].weight; + mycorr += corr; + } +//FCAL module 1 + else if (isFCAL1) { + const double corr = this->Scale_FCAL1(hvlist[i].hv) * hvlist[i].weight; + mycorr+=corr; + } +// other subdetectors + else { + const double corr = Respo(E,E_nominal,T)*hvlist[i].weight; + mycorr+= corr; + } + mynorm += hvlist[i].weight; + } + } + + + if (mycorr>1e-2) mycorr = mynorm/mycorr; + else mycorr=1.; + +// Add protection against correction factor > 10 + if (mycorr>10.) { + ATH_MSG_DEBUG("Correction factor > 10, ignore it... for cell " << m_larem_id->show_to_string(offid) << " " << mycorr); + mycorr=1.; + } + + for (unsigned int ii=0;ii<m_HVfix.size();ii++) { + if (subdet == m_HVfix[ii].subdet && layer >= m_HVfix[ii].layer_min && layer <= m_HVfix[ii].layer_max && + eta_raw >= m_HVfix[ii].eta_min && eta_raw < m_HVfix[ii].eta_max && + phi_raw >= m_HVfix[ii].phi_min && phi_raw < m_HVfix[ii].phi_max ) { + ATH_MSG_DEBUG("Overwrite correction for cell " << m_larem_id->show_to_string(offid) << " " << m_HVfix[ii].corr); + mycorr = m_HVfix[ii].corr; + } + } + + ++nChannelsUpdates; + if(onlHVCorr) { // undo the online one + float hvonline = onlHVCorr->HVScaleCorr(offid); + if (hvonline>0. && hvonline<100.) mycorr = mycorr/hvonline; + + } + vScale[idx]=mycorr; + }// end loop over cells + }//end loop over ranges' + ATH_MSG_DEBUG("(re)computed HV scale corrections for " << nChannelsUpdates << " channels"); + return StatusCode::SUCCESS; +} + +float LArHVScaleCorrCondAlg::champ_e(float hv, float d) const +{ + float e1; + if (hv < -3000.){ + return -1000.; + } + else + e1 = fabs(hv)/(d*1e3); + if ( e1 < 0.01 ) e1 = 0.01; + return e1; +} + +float LArHVScaleCorrCondAlg::vdrift(float e, float tempe) const +{ + const float T = tempe; + static const float P[6] = {-0.01481,-0.0075,0.141,12.4,1.627,0.317}; + if ( e < -999.) return 0.; + float vd = (P[0]*T+1)*( P[2]*e*log(1+ (P[3]/e)) + P[4]*pow(e,P[5])) + P[1]*T; // vdrift formula walcowialk mm/micro_s + return vd; +} + +float LArHVScaleCorrCondAlg::InvCharge(float e) const +// returns 1/charge from recombination effect +{ + float q = 1.; + if ( e > 2.) q=(1.+0.36/e); + else if (e>1e-6) q =(1.04+0.25/e); + return q; +} + +float LArHVScaleCorrCondAlg::Respo(float e, float e_nominal,float tempe) const +{ + if (e < -999.) return 1.; + if (e < 0.01) return 0; + if ( e > e_nominal ) return 1; + float resp = (InvCharge(e_nominal)*vdrift(e,tempe))/(InvCharge(e)*vdrift(e_nominal,tempe)); + return resp; +} + +float LArHVScaleCorrCondAlg::t_drift(float e, float e_nominal, float d, float tempe) const +{ + if ( e < -999.) return (d*1e4)/vdrift(e_nominal, tempe) ; + if (e > e_nominal ) e = e_nominal; + return (d*1e4)/vdrift(e, tempe); // ns +} + +float LArHVScaleCorrCondAlg::EMEC_nominal(const float aeta) const +{ + if ( aeta<1.5 ) return 2500.; + else if (aeta<1.6) return 2300.; + else if (aeta<1.8 ) return 2100.; + else if (aeta < 2.0 ) return 1700.; + else if (aeta < 2.1 ) return 1500.; + else if (aeta < 2.3 ) return 1250.; + else if (aeta < 2.5 ) return 1000.; + else if (aeta < 2.8 ) return 2300.; + else return 1800.; +} + +float LArHVScaleCorrCondAlg::EMEC_gap(const float aeta, float Zeta) const +{ + float EMECg; + if (aeta<=2.5 ) EMECg = 0.9 +1.9*( ( Zeta - 40. )/(10*sinh(aeta)) - 60.)/140.; + else EMECg = 1.8 + 1.3*( ( Zeta - 40. )/(10*sinh(aeta)) - 30.)/40.; + return EMECg; +} + +float LArHVScaleCorrCondAlg::Scale_FCAL1(const float hv) const +{ + if (hv<5.0) return 0; + const float R0=-2.612; + const float alpha=2.336; + const float beta=0.079; + const float scale=R0+alpha*pow(hv,beta); + return scale; +} + + + +float LArHVScaleCorrCondAlg::Scale_barrel(const float hv) const +{ + const float hvref[18]={1.,50.,100.,150.,200.,300.,400.,500.,600.,700.,800.,900.,1000.,1200.,1400.,1600.,1800.,2000.}; + const float hvmax = 1998.; + const float facteur[18]={0.,0.1209,0.2135,0.2829,0.3390,0.4270,0.4961,0.5556,0.6065,0.6527,0.6906, + 0.7290,0.7626,0.8224,0.8754,0.9190,0.9606,1.}; + +// 0 HV, returns 0 response + if (hv<-999.) { + return 0; + } + else if (hv<hvref[0]) { + float resp=facteur[0]; + return resp; + } +// 2000 HV, returns response=1 + if (hv>hvmax) { + float resp=facteur[17]; + return resp; + } + +// intermediate HV, find values between which to extrapolate + int i1,i2; + i1=1; + for (int i=0;i<18;i++) { + if (hv<hvref[i]) { + i1=i-1; + break; + } + } + i2=i1+1; + float resp=0.; + +// if lowHV>=50 V, logarithmic extrapolation + if (i1>0) { + const float b=(log(facteur[i2])-log(facteur[i1]))/(log(hvref[i2])-log(hvref[i1])); + const float a=log(facteur[i2])-b*log(hvref[i2]); + resp = exp(a+b*log(hv)); + } +// if between 0 and 50 V, scales linearly + else { + resp=facteur[0]*(hv/hvref[0]); + } + //std::cout << " hv,i1,i2,resp " << hv << " " << i1 << " " << i2 << " " << resp << std::endl; + return resp; +} + + + + +// *** Build list of correction to hardcode by jobOptions +StatusCode LArHVScaleCorrCondAlg::buildFixHVList() { + + m_HVfix.clear(); + std::vector<std::string>::const_iterator itrStringID=m_fixHVStrings.begin(); + for (;itrStringID!=m_fixHVStrings.end();++itrStringID) { + std::string theString=*itrStringID; + std::stringstream is; + is << theString << std::endl; + + unsigned int iDetector,ilayer_min,ilayer_max; + float eta_min,eta_max,phi_min,phi_max,corr; + is >> iDetector >> ilayer_min >> ilayer_max >> eta_min >> eta_max >> phi_min >> phi_max >> corr; + + HVfix_t myfix; + myfix.subdet = iDetector; + myfix.layer_min = ilayer_min; + myfix.layer_max = ilayer_max; + myfix.eta_min = eta_min; + myfix.eta_max = eta_max; + myfix.phi_min = phi_min; + myfix.phi_max = phi_max; + myfix.corr = corr; + m_HVfix.push_back(myfix); + } + + ATH_MSG_INFO( " Number of regions with overwritten HV corrections from jobOptions " << m_HVfix.size() ); + + + return StatusCode::SUCCESS; +} + + +LArHVScaleCorrCondAlg::HASHRANGEVEC LArHVScaleCorrCondAlg::cellsIDsToPartition(const std::set<Identifier>& cellsIDvec) const { + HASHRANGEVEC ranges; + if (cellsIDvec.size()>=m_electrodeID->electrodeHashMax()) { + ranges.push_back(std::make_pair<IdentifierHash,IdentifierHash>(0,182468)); + } + else { + std::bitset<NHVPARTITION> hasPartition[2]; + std::set<Identifier>::const_iterator it=cellsIDvec.begin(); + std::set<Identifier>::const_iterator it_e=cellsIDvec.end(); + for (;it!=it_e;++it) { + const Identifier elId=*it; + const int zside=m_calocell_id->pos_neg(elId); + const int sample=m_calocell_id->calo_sample(elId); + switch (sample) { + case 1: case 2: case 3: //EMB + hasPartition[zside].set(EMB); + break; + case 0: // EMBPS + hasPartition[zside].set(EMBPS); + break; + case 5: case 6: case 7: //EMEC + if (m_calocell_id->is_em_endcap_outer(elId)) + hasPartition[zside].set(EMECOW); + else + hasPartition[zside].set(EMECIW); + break; + case 4: //EMECPS + hasPartition[zside].set(EMECPS); + break; + case 8: case 9: case 10: case 11: //HEC + hasPartition[zside].set(HEC); + break; + case 21: case 22: case 23: + hasPartition[zside].set(FCAL); + break; + default: //Ignore + break; + }//end switch statement + }//end loop over IDs + for (unsigned z=0;z<2;++z) { //Loop over detector sides + for (unsigned i=0;i<NHVPARTITION;++i) { + if (hasPartition[z].test(i)) ranges.push_back(m_hashRanges[z][i]); + } //end loop over partitions + }// end loop over sides + }//end else not complete + return ranges; +} + diff --git a/LArCalorimeter/LArRecUtils/src/LArHVScaleCorrCondAlg.h b/LArCalorimeter/LArRecUtils/src/LArHVScaleCorrCondAlg.h new file mode 100644 index 0000000000000000000000000000000000000000..799375ae743659b197dddaa9794498211f6a5ebf --- /dev/null +++ b/LArCalorimeter/LArRecUtils/src/LArHVScaleCorrCondAlg.h @@ -0,0 +1,128 @@ +/* + Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration +*/ +// Rewritten from LArHVScaleCorrTool + +#ifndef LARRECUTILS_LArHVSCALEcORRCONDALG_H +#define LARRECUTILS_LArHVSCALECORRCONDALG_H + +#include "AthenaBaseComps/AthAlgorithm.h" + +#include "GaudiKernel/ICondSvc.h" + +#include "StoreGate/DataHandle.h" +#include "StoreGate/ReadCondHandleKey.h" +#include "StoreGate/WriteCondHandleKey.h" + +#include "LArIdentifier/LArOnlineID.h" +#include "CaloIdentifier/CaloIdManager.h" +#include "CaloIdentifier/LArID.h" +#include "CaloDetDescr/CaloDetDescrManager.h" +#include "LArRecConditions/LArHVData.h" +#include "LArRecConditions/LArHVIdMapping.h" +#include "LArCabling/LArOnOffIdMapping.h" + +#include "LArRawConditions/LArHVScaleCorrComplete.h" +#include "LArRawConditions/LArTdriftComplete.h" +#include "LArCOOLConditions/LArHVScaleCorrFlat.h" +#include "LArRecConditions/LArHVCorr.h" + +#include "xAODEventInfo/EventInfo.h" + +class StoreGateSvc; +class LArElectrodeID; + +class LArHVScaleCorrCondAlg: public AthAlgorithm +{ + public: + + // constructor + LArHVScaleCorrCondAlg(const std::string& name, ISvcLocator* pSvcLocator); + + // destructor + virtual ~LArHVScaleCorrCondAlg(); + + virtual StatusCode initialize() override; + virtual StatusCode execute() override; + virtual StatusCode finalize() override; + + private: + + ServiceHandle<ICondSvc> m_condSvc; + const LArOnlineID* m_lar_on_id; + const CaloCell_ID* m_calocell_id; + const LArEM_ID* m_larem_id; + const LArHEC_ID* m_larhec_id; + const LArFCAL_ID* m_larfcal_id; + const LArElectrodeID* m_electrodeID; + const DataHandle<CaloIdManager> m_caloIdMgr; + const DataHandle<CaloDetDescrManager> m_calodetdescrmgr; + + SG::ReadCondHandleKey<LArOnOffIdMapping> m_cablingKey {this,"keyCabling", "LArOnOffIdMap", "Input key for Id mapping"} ; + SG::ReadCondHandleKey<LArHVData> m_hvKey {this, "keyHVdata", "LArHVData", "Input key for HV data from DCS"}; + SG::ReadHandleKey<xAOD::EventInfo> m_eventInfoKey{this, "eventInfoKey", "EventInfo", "Key for EventInfo object"}; + SG::ReadCondHandleKey<ILArHVScaleCorr> m_onlineHVScaleCorrKey{this, "keyOnlineHVCorr", "LArHVScaleCorr","Input key for HVScaleCorr from conditions database (used online)"}; + + SG::WriteCondHandleKey<ILArHVScaleCorr> m_outputHVScaleCorrKey{this, "keyOutputCorr", "LArHVScaleCorrRecomputed","Output key for LArHVScaleCorr"}; + + + float Scale_barrel(const float hv) const; + float Scale_FCAL1(const float hv) const; + float champ_e(float hv, float d) const; + float vdrift(float e,float tempe) const; + float InvCharge(float e) const; + float Respo(float e,float e_nominal,float tempe) const; + float t_drift (float e, float e_nominal,float d, float tempe) const; + float EMEC_nominal(const float eta_r) const; + float EMEC_gap(const float eta_r, float Zeta) const; + StatusCode buildFixHVList(); + float m_T0; + + /*########################################################################## + definitions of new functions and variables units + --------------------------------------------------------------------- + d gap distancia between cells in calorimeters cm + nominal subdetector nominal voltage volt + E electric field in the cell kvolt/cm + E_nominal nominal electric field in the cell kvolt/cm + T temperature of cryostat Kelvin + Zsamp Z coordinate for samplings in EMEC mm + champ_e computes electric field kvolt/cm + vdrift computes drift velocity mm/micro_s + Charge computes recombination charge Coulomb + Respo computes the correction factors to HV!=nominal - + t_drift computes drift times ns + EMEC_nominal finds nominal voltages in EMEC volt + EMEC_gap finds gap distances in EMEC mm + ########################################################################## + */ + + + bool m_doTdrift; + unsigned int m_deltatupdate; + bool m_updateIfChanged; + bool m_undoOnlineHVCorr; + + struct HVfix_t { + unsigned int subdet; // 0-1-2-3 for EMB-EMEC-HEC-FCAL + unsigned int layer_min; + unsigned int layer_max; + float eta_min; + float eta_max; + float phi_min; + float phi_max; + float corr; + }; + + std::vector<HVfix_t> m_HVfix; + std::vector<std::string> m_fixHVStrings; + + enum HVPARTITION {FCAL=0,HEC,EMECIW,EMECOW,EMECPS,EMB,EMBPS,NHVPARTITION}; //x2 for the side + typedef std::vector<std::pair<IdentifierHash,IdentifierHash> > HASHRANGEVEC; + HASHRANGEVEC m_hashRanges[2];//x2 for the side + HASHRANGEVEC m_completeRange; + HASHRANGEVEC cellsIDsToPartition(const std::set<Identifier>& cellsIDvec) const; + StatusCode getScale(const HASHRANGEVEC& hashranges, std::vector<float> &vScale, const LArHVData* hvdata, const LArHVScaleCorrFlat *onlHVCorr) const; +}; + +#endif diff --git a/LArCalorimeter/LArRecUtils/src/components/LArRecUtils_entries.cxx b/LArCalorimeter/LArRecUtils/src/components/LArRecUtils_entries.cxx index c2789fdacc63f06512f9c2bd1ebef4a3c01d295c..631b3c08cd06a9703de21667c310146384fd91bb 100644 --- a/LArCalorimeter/LArRecUtils/src/components/LArRecUtils_entries.cxx +++ b/LArCalorimeter/LArRecUtils/src/components/LArRecUtils_entries.cxx @@ -28,6 +28,7 @@ #include "../LArHVPathologyDbCondAlg.h" #include "../LArHVIdMappingAlg.h" #include "../LArHVCondAlg.h" +#include "../LArHVScaleCorrCondAlg.h" DECLARE_COMPONENT( LArADC2MeVTool ) @@ -88,3 +89,4 @@ DECLARE_COMPONENT( LArHVPathologyDbCondAlg ) DECLARE_COMPONENT( LArHVIdMappingAlg ) DECLARE_COMPONENT( LArOFCCondAlg ) DECLARE_COMPONENT( LArHVCondAlg ) +DECLARE_COMPONENT( LArHVScaleCorrCondAlg ) diff --git a/LArCalorimeter/LArSimEvent/CMakeLists.txt b/LArCalorimeter/LArSimEvent/CMakeLists.txt index ebc17c18a6a5d43d93c1b3e90d92ee94a87fe792..48067c191d90f80495a0196f3d53886ca663f7f4 100644 --- a/LArCalorimeter/LArSimEvent/CMakeLists.txt +++ b/LArCalorimeter/LArSimEvent/CMakeLists.txt @@ -8,8 +8,6 @@ atlas_subdir( LArSimEvent ) # Declare the package's dependencies: atlas_depends_on_subdirs( PUBLIC Control/AthenaKernel - Control/CLIDSvc - Control/SGTools DetectorDescription/Identifier Simulation/HitManagement PRIVATE @@ -26,12 +24,12 @@ atlas_add_library( LArSimEvent INCLUDE_DIRS ${CLHEP_INCLUDE_DIRS} PRIVATE_INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} DEFINITIONS ${CLHEP_DEFINITIONS} - LINK_LIBRARIES ${CLHEP_LIBRARIES} AthenaKernel SGTools Identifier HitManagement StoreGateLib SGtests + LINK_LIBRARIES ${CLHEP_LIBRARIES} AthenaKernel Identifier HitManagement StoreGateLib SGtests PRIVATE_LINK_LIBRARIES ${ROOT_LIBRARIES} ) atlas_add_dictionary( LArSimEventDict LArSimEvent/LArSimEventDict.h LArSimEvent/selection.xml INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} ${CLHEP_INCLUDE_DIRS} - LINK_LIBRARIES ${ROOT_LIBRARIES} ${CLHEP_LIBRARIES} AthenaKernel SGTools Identifier HitManagement StoreGateLib SGtests LArSimEvent ) + LINK_LIBRARIES ${ROOT_LIBRARIES} ${CLHEP_LIBRARIES} AthenaKernel Identifier HitManagement StoreGateLib SGtests LArSimEvent ) diff --git a/LArCalorimeter/LArSimEvent/LArSimEvent/LArHitContainer.h b/LArCalorimeter/LArSimEvent/LArSimEvent/LArHitContainer.h index af322f62dc5eefceb95b53284941661ce55a71e4..13793f16c0e9aef302550d582492627cfdfb811a 100755 --- a/LArCalorimeter/LArSimEvent/LArSimEvent/LArHitContainer.h +++ b/LArCalorimeter/LArSimEvent/LArSimEvent/LArHitContainer.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration */ // LArHitContainer @@ -18,7 +18,7 @@ #include "HitManagement/AthenaHitsVector.h" #include "LArSimEvent/LArHit.h" -#include "CLIDSvc/CLASS_DEF.h" +#include "AthenaKernel/CLASS_DEF.h" class LArHitContainer:public AthenaHitsVector<LArHit> diff --git a/LArCalorimeter/LArSimEvent/LArSimEvent/LArHitFloatContainer.h b/LArCalorimeter/LArSimEvent/LArSimEvent/LArHitFloatContainer.h index 0d2e03a3fa2b6c9589f56213d78eda422a8a1195..4e01584a778fbc9dd9299e17c85f359e22ef200e 100644 --- a/LArCalorimeter/LArSimEvent/LArSimEvent/LArHitFloatContainer.h +++ b/LArCalorimeter/LArSimEvent/LArSimEvent/LArHitFloatContainer.h @@ -1,12 +1,12 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration */ #ifndef LArSimEvent_LArHitFloatContainer_h #define LArSimEvent_LArHitFloatContainer_h #include "LArSimEvent/LArHitFloat.h" -#include "CLIDSvc/CLASS_DEF.h" +#include "AthenaKernel/CLASS_DEF.h" #include <vector> /** diff --git a/LArCalorimeter/LArTest/LArConditionsTest/CMakeLists.txt b/LArCalorimeter/LArTest/LArConditionsTest/CMakeLists.txt index 3114f7a8dddb7066e041647584465e75843e2a9c..60d7b422c35aee98ed3c9cb2b3e7139e6ccbb0ce 100644 --- a/LArCalorimeter/LArTest/LArConditionsTest/CMakeLists.txt +++ b/LArCalorimeter/LArTest/LArConditionsTest/CMakeLists.txt @@ -61,7 +61,7 @@ function (larconditions_run_test testName) @ONLY ) atlas_add_test( ${testName} SCRIPT ${CMAKE_CURRENT_BINARY_DIR}/larconditions_${testName}.sh - ENVIRONMENT ATLAS_REFERENCE_TAG=LArConditionsTest/LArConditionsTest-01-00-10 + ENVIRONMENT ATLAS_REFERENCE_TAG=LArConditionsTest/LArConditionsTest-01-00-11 PROPERTIES TIMEOUT 1200 EXTRA_PATTERNS "Data source lookup|Resolved path|Failed to connect to service|Release number|Sorting algorithm|Failed to connect|Failure while attempting to connect|Reading file|^CORAL/|being retired|^Domain|INFO GeoModelSvc|locate catalog|Cache alignment|COOL_DISABLE|Failed to get ContainerHandle|^RalSessionMgr Info|^RelationalDatabase Info|Bootstrap.py" ) diff --git a/LArCalorimeter/LArTest/LArConditionsTest/share/LArConditionsTestReadNoReg_jobOptions.py b/LArCalorimeter/LArTest/LArConditionsTest/share/LArConditionsTestReadNoReg_jobOptions.py index f61460bf8a69dfc55cf6eacfd3b088722e550841..04fff2ea97e8f3d4858bd7226931d9e402b48f42 100755 --- a/LArCalorimeter/LArTest/LArConditionsTest/share/LArConditionsTestReadNoReg_jobOptions.py +++ b/LArCalorimeter/LArTest/LArConditionsTest/share/LArConditionsTestReadNoReg_jobOptions.py @@ -131,3 +131,8 @@ ServiceMgr += getConfigurable( "CondProxyProvider" )() svcMgr.CondProxyProvider.InputCollections+=["LarCondTestNoReg.root"] conddb.setGlobalTag("OFLCOND-CSC-00-01-00") + +# Suppress useless GeoModelSvc messages. +from AthenaCommon import Constants +from GeoModelSvc.GeoModelSvcConf import GeoModelSvc +GeoModelSvc().OutputLevel=Constants.WARNING diff --git a/LArCalorimeter/LArTest/LArConditionsTest/share/LArConditionsTestWriteNoReg_jobOptions.py b/LArCalorimeter/LArTest/LArConditionsTest/share/LArConditionsTestWriteNoReg_jobOptions.py index c0901bce6bcf51a6910119e100d32aed75a604a7..60c6cf4802dedad8334978f8fafc34cd2db265a8 100755 --- a/LArCalorimeter/LArTest/LArConditionsTest/share/LArConditionsTestWriteNoReg_jobOptions.py +++ b/LArCalorimeter/LArTest/LArConditionsTest/share/LArConditionsTestWriteNoReg_jobOptions.py @@ -131,3 +131,8 @@ OutputConditionsAlg.ObjectList += [ "LArRampMC#/LArCalorimeter/LArTests/LArRamps #IOVDbSvc.dbConnection = "impl=cool;techno=oracle;devdb10:LARNOREG:ATLAS_COOLTEST:cool4devdb" conddb.setGlobalTag("OFLCOND-CSC-00-01-00") + +# Suppress useless GeoModelSvc messages. +from AthenaCommon import Constants +from GeoModelSvc.GeoModelSvcConf import GeoModelSvc +GeoModelSvc().OutputLevel=Constants.WARNING diff --git a/LArCalorimeter/LArTest/LArConditionsTest/share/LArConditionsTest_jobOptions.py b/LArCalorimeter/LArTest/LArConditionsTest/share/LArConditionsTest_jobOptions.py index ffaae8ab125368a46549679b8bbac36e0d938c1d..140295bcd4ac4981e651ad9003f63718dc0db7a3 100755 --- a/LArCalorimeter/LArTest/LArConditionsTest/share/LArConditionsTest_jobOptions.py +++ b/LArCalorimeter/LArTest/LArConditionsTest/share/LArConditionsTest_jobOptions.py @@ -127,3 +127,8 @@ PoolSvc.WriteCatalog = "file:Catalog1.xml" #CondProxyProvider.InputCollections = ["LArRawCond_dc2_a.pool.root"] conddb.setGlobalTag("OFLCOND-CSC-00-01-00") + +# Suppress useless GeoModelSvc messages. +from AthenaCommon import Constants +from GeoModelSvc.GeoModelSvcConf import GeoModelSvc +GeoModelSvc().OutputLevel=Constants.WARNING diff --git a/MuonSpectrometer/MuonCablings/MuonCablingData/CMakeLists.txt b/MuonSpectrometer/MuonCablings/MuonCablingData/CMakeLists.txt index 9cf5a09914d56482209e246c6936e68999ad74bf..73b2ac77171526980e73a25157f4729c685f478c 100644 --- a/MuonSpectrometer/MuonCablings/MuonCablingData/CMakeLists.txt +++ b/MuonSpectrometer/MuonCablings/MuonCablingData/CMakeLists.txt @@ -7,8 +7,7 @@ atlas_subdir( MuonCablingData ) # Declare the package's dependencies: atlas_depends_on_subdirs( PUBLIC - Control/CLIDSvc - Control/SGTools + Control/AthenaKernel GaudiKernel PRIVATE Control/StoreGate @@ -18,5 +17,5 @@ atlas_depends_on_subdirs( PUBLIC atlas_add_library( MuonCablingData src/*.cxx PUBLIC_HEADERS MuonCablingData - LINK_LIBRARIES SGTools GaudiKernel StoreGateLib SGtests MuonIdHelpersLib ) + LINK_LIBRARIES AthenaKernel GaudiKernel StoreGateLib SGtests MuonIdHelpersLib ) diff --git a/MuonSpectrometer/MuonCablings/MuonCablingData/MuonCablingData/MuonMDT_CablingMap.h b/MuonSpectrometer/MuonCablings/MuonCablingData/MuonCablingData/MuonMDT_CablingMap.h index 6d10f9e46911b3c1826fec21160412bb920f0068..95f64ac450de432205a90804e65613a306b045a5 100644 --- a/MuonSpectrometer/MuonCablings/MuonCablingData/MuonCablingData/MuonMDT_CablingMap.h +++ b/MuonSpectrometer/MuonCablings/MuonCablingData/MuonCablingData/MuonMDT_CablingMap.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration */ #ifndef MUONMDT_CABLING_MUONMDT_CABLINGMAP_H @@ -12,7 +12,7 @@ #include "MuonCablingData/MdtMapBase.h" -#include "CLIDSvc/CLASS_DEF.h" +#include "AthenaKernel/CLASS_DEF.h" /********************************************** * diff --git a/MuonSpectrometer/MuonCalib/CscCalib/CscCalibAlgs/share/CscCalcPedMon.py b/MuonSpectrometer/MuonCalib/CscCalib/CscCalibAlgs/share/CscCalcPedMon.py index d51b03feaeeb7cf1f491be7986f3a74d74dbce23..1a0485feb46e3885eaf9a28433b6c63518a96f4d 100644 --- a/MuonSpectrometer/MuonCalib/CscCalib/CscCalibAlgs/share/CscCalcPedMon.py +++ b/MuonSpectrometer/MuonCalib/CscCalib/CscCalibAlgs/share/CscCalcPedMon.py @@ -200,7 +200,7 @@ monMan.LumiBlock = 1 from MuonCalibMonitoring.MuonCalibMonitoringConf import CscCalibMonToolPed CscCalibMonTool = CscCalibMonToolPed ("CscCalibMonToolPed" ) -ToolSvc += CscCalibMonTool +#ToolSvc += CscCalibMonTool monMan.AthenaMonTools += [CscCalibMonTool] CscCalibMonTool.GetDebugForAllChannels = False CscCalibMonTool.StatusReportFileName = outputPre + "CalibReport.txt" diff --git a/MuonSpectrometer/MuonCalib/CscCalib/CscCalibAlgs/share/CscCalcSlopeMon.py b/MuonSpectrometer/MuonCalib/CscCalib/CscCalibAlgs/share/CscCalcSlopeMon.py index 4fcc24014f740b16946eac41a8bc932866ea3ea2..a01d39913eb87ea62f529879f48ee78ce16d15f0 100644 --- a/MuonSpectrometer/MuonCalib/CscCalib/CscCalibAlgs/share/CscCalcSlopeMon.py +++ b/MuonSpectrometer/MuonCalib/CscCalib/CscCalibAlgs/share/CscCalcSlopeMon.py @@ -161,7 +161,7 @@ from MuonCalibMonitoring.MuonCalibMonitoringConf import CscCalibMonToolSlope CscCalibMonTool = CscCalibMonToolSlope ( name = "CscCalibMonToolSlope" ) -ToolSvc += CscCalibMonTool +#ToolSvc += CscCalibMonTool ##CscCalibMonTool.OutputLevel = DEBUG monMan.AthenaMonTools += [CscCalibMonTool] #Conditions DB service @@ -170,7 +170,7 @@ monMan.AthenaMonTools += [CscCalibMonTool] from MuonCondSvc.CscCondDB import cscCondDB cscCondDB.addPedFolders() #Set to read pedestal and noise folders from the database cscCondDB.addPSlopeFolder() #Set to read slope folder from database -#if(ToolSvc.CscRdoContByteStreamTool.IsCosmicData) : +#if(#ToolSvc.CscRdoContByteStreamTool.IsCosmicData) : # cscCondDB.overrideBaseTag('Csc-cosmic-DEFAULTCOND') diff --git a/MuonSpectrometer/MuonCnv/MuonByteStream/CMakeLists.txt b/MuonSpectrometer/MuonCnv/MuonByteStream/CMakeLists.txt index 4274518522494530775d1ba16d8b53160a0c8b07..143bbc0b223c638aa09033b0cd8a367e2d719ae0 100644 --- a/MuonSpectrometer/MuonCnv/MuonByteStream/CMakeLists.txt +++ b/MuonSpectrometer/MuonCnv/MuonByteStream/CMakeLists.txt @@ -16,8 +16,6 @@ atlas_depends_on_subdirs( PUBLIC MuonSpectrometer/MuonCnv/MuonCnvToolInterfaces Trigger/TrigEvent/TrigSteeringEvent PRIVATE - Control/CLIDSvc - Control/SGTools Control/StoreGate MuonSpectrometer/MuonCablings/CSCcabling MuonSpectrometer/MuonCablings/RPCcablingInterface @@ -34,7 +32,7 @@ atlas_add_component( MuonByteStream src/*.cxx src/components/*.cxx INCLUDE_DIRS ${TDAQ-COMMON_INCLUDE_DIRS} - LINK_LIBRARIES ${TDAQ-COMMON_LIBRARIES} AthenaBaseComps ByteStreamCnvSvcBaseLib ByteStreamData ByteStreamData_test GaudiKernel SGTools StoreGateLib SGtests CSCcablingLib RPCcablingInterfaceLib MuonIdHelpersLib MuonRDO TrigSteeringEvent) + LINK_LIBRARIES ${TDAQ-COMMON_LIBRARIES} AthenaBaseComps ByteStreamCnvSvcBaseLib ByteStreamData ByteStreamData_test GaudiKernel StoreGateLib SGtests CSCcablingLib RPCcablingInterfaceLib MuonIdHelpersLib MuonRDO TrigSteeringEvent) # Install files from the package: atlas_install_headers( MuonByteStream ) diff --git a/MuonSpectrometer/MuonCnv/MuonByteStream/src/CscRdoContByteStreamCnv.cxx b/MuonSpectrometer/MuonCnv/MuonByteStream/src/CscRdoContByteStreamCnv.cxx index 11daf40a7c9ed7922b787ffb25117256358ddd58..f9906cb0fbf92d52b08b6f6326f150ea0e13b2d5 100644 --- a/MuonSpectrometer/MuonCnv/MuonByteStream/src/CscRdoContByteStreamCnv.cxx +++ b/MuonSpectrometer/MuonCnv/MuonByteStream/src/CscRdoContByteStreamCnv.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration */ #include "MuonByteStream/CscRdoContByteStreamCnv.h" @@ -19,7 +19,6 @@ #include "MuonRDO/CscRawDataCollectionIdHash.h" #include "StoreGate/StoreGateSvc.h" -#include "CLIDSvc/CLASS_DEF.h" #include <sstream> #include <inttypes.h> diff --git a/MuonSpectrometer/MuonCnv/MuonByteStream/src/MdtCsmContByteStreamCnv.cxx b/MuonSpectrometer/MuonCnv/MuonByteStream/src/MdtCsmContByteStreamCnv.cxx index dcfbfb9c63e20cf52e3bf99708d5ab65ecaa413b..e0361c0a62f47a6ae719c206c3729f684e0d7ac5 100644 --- a/MuonSpectrometer/MuonCnv/MuonByteStream/src/MdtCsmContByteStreamCnv.cxx +++ b/MuonSpectrometer/MuonCnv/MuonByteStream/src/MdtCsmContByteStreamCnv.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration */ #include "MuonByteStream/MdtCsmContByteStreamCnv.h" @@ -21,7 +21,6 @@ #include "StoreGate/StoreGateSvc.h" //#include "StoreGate/tools/ClassID_traits.h" -#include "CLIDSvc/CLASS_DEF.h" // Tool #include "GaudiKernel/IToolSvc.h" diff --git a/MuonSpectrometer/MuonCnv/MuonByteStream/src/RpcPadContByteStreamCnv.cxx b/MuonSpectrometer/MuonCnv/MuonByteStream/src/RpcPadContByteStreamCnv.cxx index 16bab97188c979f61d9398d1e74ad4057f1da490..12b58e33455ee9376aa67884eac3346a00c4b7d3 100644 --- a/MuonSpectrometer/MuonCnv/MuonByteStream/src/RpcPadContByteStreamCnv.cxx +++ b/MuonSpectrometer/MuonCnv/MuonByteStream/src/RpcPadContByteStreamCnv.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration */ #include "MuonByteStream/RpcPadContByteStreamCnv.h" @@ -25,7 +25,6 @@ #include "RPCcablingInterface/IRPCcablingServerSvc.h" #include "StoreGate/StoreGateSvc.h" -#include "CLIDSvc/CLASS_DEF.h" // Tool #include "GaudiKernel/IToolSvc.h" diff --git a/MuonSpectrometer/MuonCnv/MuonByteStream/src/TgcRdoContByteStreamCnv.cxx b/MuonSpectrometer/MuonCnv/MuonByteStream/src/TgcRdoContByteStreamCnv.cxx index 46aacb6ff046686bfa4063590a0c64f36f220208..50666364ece6dc726cad3b11db5f01d2b00e67f9 100644 --- a/MuonSpectrometer/MuonCnv/MuonByteStream/src/TgcRdoContByteStreamCnv.cxx +++ b/MuonSpectrometer/MuonCnv/MuonByteStream/src/TgcRdoContByteStreamCnv.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration */ #include "MuonByteStream/TgcRdoContByteStreamCnv.h" @@ -17,7 +17,6 @@ #include "MuonRDO/TgcRdoIdHash.h" #include "StoreGate/StoreGateSvc.h" -#include "CLIDSvc/CLASS_DEF.h" #include <sstream> #include <inttypes.h> diff --git a/MuonSpectrometer/MuonCnv/MuonCSC_CnvTools/CMakeLists.txt b/MuonSpectrometer/MuonCnv/MuonCSC_CnvTools/CMakeLists.txt index 516fef28d3170283f071f6a15351ce791b908710..66b960fd49dc1e2ca2318e0aa5b87da0dffe6939 100644 --- a/MuonSpectrometer/MuonCnv/MuonCSC_CnvTools/CMakeLists.txt +++ b/MuonSpectrometer/MuonCnv/MuonCSC_CnvTools/CMakeLists.txt @@ -12,8 +12,6 @@ atlas_depends_on_subdirs( PUBLIC PRIVATE Control/AthenaBaseComps Control/AthenaKernel - Control/CLIDSvc - Control/SGTools Control/StoreGate DetectorDescription/Identifier Event/ByteStreamCnvSvcBase @@ -40,7 +38,7 @@ atlas_add_component( MuonCSC_CnvTools src/*.cxx src/components/*.cxx INCLUDE_DIRS ${TDAQ-COMMON_INCLUDE_DIRS} ${CLHEP_INCLUDE_DIRS} - LINK_LIBRARIES ${TDAQ-COMMON_LIBRARIES} ${CLHEP_LIBRARIES} ByteStreamData ByteStreamData_test GaudiKernel AthenaBaseComps AthenaKernel SGTools StoreGateLib SGtests Identifier ByteStreamCnvSvcBaseLib EventInfo EventPrimitives CSCcablingLib MuonContainerManager MuonReadoutGeometry MuonDigitContainer MuonIdHelpersLib MuonRDO MuonPrepRawData TrkSurfaces ) + LINK_LIBRARIES ${TDAQ-COMMON_LIBRARIES} ${CLHEP_LIBRARIES} ByteStreamData ByteStreamData_test GaudiKernel AthenaBaseComps AthenaKernel StoreGateLib SGtests Identifier ByteStreamCnvSvcBaseLib EventInfo EventPrimitives CSCcablingLib MuonContainerManager MuonReadoutGeometry MuonDigitContainer MuonIdHelpersLib MuonRDO MuonPrepRawData TrkSurfaces ) # Install files from the package: atlas_install_headers( MuonCSC_CnvTools ) diff --git a/MuonSpectrometer/MuonCnv/MuonCSC_CnvTools/src/CscRdoContByteStreamTool.cxx b/MuonSpectrometer/MuonCnv/MuonCSC_CnvTools/src/CscRdoContByteStreamTool.cxx index eb1130c5819769e00bbf09d9e56fdc3a93492ca6..b9283823da64ec858a927f4cfb05bfce762c30e5 100644 --- a/MuonSpectrometer/MuonCnv/MuonCSC_CnvTools/src/CscRdoContByteStreamTool.cxx +++ b/MuonSpectrometer/MuonCnv/MuonCSC_CnvTools/src/CscRdoContByteStreamTool.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration */ #include "CscRdoContByteStreamTool.h" @@ -9,7 +9,7 @@ #include "MuonIdHelpers/CscIdHelper.h" #include "StoreGate/StoreGate.h" -#include "CLIDSvc/CLASS_DEF.h" +#include "AthenaKernel/CLASS_DEF.h" #include <map> diff --git a/MuonSpectrometer/MuonCnv/MuonMDT_CnvTools/CMakeLists.txt b/MuonSpectrometer/MuonCnv/MuonMDT_CnvTools/CMakeLists.txt index 99cacd2b16f264fa0c55cb5be392f4d23d08d9e3..e83946c57bb3747aff54163d08a1d628c0849c90 100644 --- a/MuonSpectrometer/MuonCnv/MuonMDT_CnvTools/CMakeLists.txt +++ b/MuonSpectrometer/MuonCnv/MuonMDT_CnvTools/CMakeLists.txt @@ -11,8 +11,6 @@ atlas_depends_on_subdirs( PUBLIC GaudiKernel PRIVATE Control/AthenaBaseComps - Control/CLIDSvc - Control/SGTools Control/StoreGate DetectorDescription/AtlasDetDescr DetectorDescription/Identifier @@ -36,7 +34,7 @@ atlas_add_component( MuonMDT_CnvTools src/*.cxx src/components/*.cxx INCLUDE_DIRS ${TDAQ-COMMON_INCLUDE_DIRS} - LINK_LIBRARIES ${TDAQ-COMMON_LIBRARIES} ByteStreamData ByteStreamData_test GaudiKernel AthenaBaseComps SGTools StoreGateLib SGtests AtlasDetDescr Identifier ByteStreamCnvSvcBaseLib MuonMDT_CablingLib MdtCalibSvcLib MuonCalibEvent MuonContainerManager MuonReadoutGeometry MuonDigitContainer MuonIdHelpersLib MuonRDO MuonPrepRawData ) + LINK_LIBRARIES ${TDAQ-COMMON_LIBRARIES} ByteStreamData ByteStreamData_test GaudiKernel AthenaBaseComps StoreGateLib SGtests AtlasDetDescr Identifier ByteStreamCnvSvcBaseLib MuonMDT_CablingLib MdtCalibSvcLib MuonCalibEvent MuonContainerManager MuonReadoutGeometry MuonDigitContainer MuonIdHelpersLib MuonRDO MuonPrepRawData ) # Install files from the package: atlas_install_headers( MuonMDT_CnvTools ) diff --git a/MuonSpectrometer/MuonCnv/MuonMDT_CnvTools/src/MdtCsmContByteStreamTool.cxx b/MuonSpectrometer/MuonCnv/MuonMDT_CnvTools/src/MdtCsmContByteStreamTool.cxx index 8252859543db0b2faf6a35e590f556a650ef7a7e..83dfa98295a0ca00265e51817fb31f729f7e4233 100755 --- a/MuonSpectrometer/MuonCnv/MuonMDT_CnvTools/src/MdtCsmContByteStreamTool.cxx +++ b/MuonSpectrometer/MuonCnv/MuonMDT_CnvTools/src/MdtCsmContByteStreamTool.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration */ #include "MdtCsmContByteStreamTool.h" @@ -14,7 +14,7 @@ #include "StoreGate/StoreGate.h" //#include "StoreGate/tools/ClassID_traits.h" -#include "CLIDSvc/CLASS_DEF.h" +#include "AthenaKernel/CLASS_DEF.h" #include "ByteStreamData/RawEvent.h" #include <map> diff --git a/MuonSpectrometer/MuonCnv/MuonMDT_CnvTools/src/MdtRdoToPrepDataTool.cxx b/MuonSpectrometer/MuonCnv/MuonMDT_CnvTools/src/MdtRdoToPrepDataTool.cxx index a1d5ee7a99ace5a9a36f6fa3c49769d40e579f2a..9ccfcfab2cc66375103dde8164b5409bc8383c74 100644 --- a/MuonSpectrometer/MuonCnv/MuonMDT_CnvTools/src/MdtRdoToPrepDataTool.cxx +++ b/MuonSpectrometer/MuonCnv/MuonMDT_CnvTools/src/MdtRdoToPrepDataTool.cxx @@ -23,11 +23,6 @@ #include "MuonMDT_Cabling/MuonMDT_CablingSvc.h" -// BS access -#include "ByteStreamCnvSvcBase/IROBDataProviderSvc.h" -#include "MuonCnvToolInterfaces/IMuonRawDataProviderTool.h" -#include "MuonMDT_CnvTools/IMDT_RDO_Decoder.h" - #include "MuonPrepRawData/MdtTwinPrepData.h" // TWIN TUBES using namespace MuonGM; @@ -47,7 +42,6 @@ Muon::MdtRdoToPrepDataTool::MdtRdoToPrepDataTool(const std::string& t, m_invSpeed(1./299.792458), //m_mdtPrepDataContainer("MDT_DriftCircles"), m_calibratePrepData(true), - m_rawDataProviderTool("Muon::MDT_RawDataProviderTool/MDT_RawDataProviderTool", this), m_mdtDecoder("Muon::MdtRDO_Decoder/MdtRDO_Decoder", this), m_idHelper("Muon::MuonIdHelperTool/MuonIdHelperTool", this), m_fullEventDone(false), @@ -58,16 +52,11 @@ Muon::MdtRdoToPrepDataTool::MdtRdoToPrepDataTool(const std::string& t, { declareInterface<Muon::IMuonRdoToPrepDataTool>(this); - // tools - declareProperty ("RawDataProviderTool", m_rawDataProviderTool); - // template for property decalration declareProperty("CalibratePrepData", m_calibratePrepData = true ); declareProperty("DecodeData", m_decodeData = true ); declareProperty("SortPrepData", m_sortPrepData = false ); - declareProperty("useBStoRdoTool", m_useBStoRdoTool=false ); - // + TWIN TUBE declareProperty("UseTwin", m_useTwin = true); declareProperty("UseAllBOLTwin", m_useAllBOLTwin = false); @@ -109,10 +98,6 @@ StatusCode Muon::MdtRdoToPrepDataTool::initialize() return StatusCode::FAILURE; } - - // Get MdtRawDataProviderTool - ATH_CHECK(m_rawDataProviderTool.retrieve( DisableTool{ !m_useBStoRdoTool } )); - /// create an empty MDT PrepData container for filling m_mdtHelper = m_muonMgr->mdtIdHelper(); @@ -183,7 +168,7 @@ StatusCode Muon::MdtRdoToPrepDataTool::finalize() StatusCode Muon::MdtRdoToPrepDataTool::decode( const std::vector<uint32_t>& robIds ) { const std::vector<IdentifierHash>& chamberHashInRobs = m_mdtCabling->getChamberHashVec(robIds); - return decode(robIds,chamberHashInRobs); + return decode(chamberHashInRobs); } Muon::MdtRdoToPrepDataTool::SetupMdtPrepDataContainerStatus Muon::MdtRdoToPrepDataTool::setupMdtPrepDataContainer() { @@ -214,7 +199,7 @@ const MdtCsmContainer* Muon::MdtRdoToPrepDataTool::getRdoContainer() { return nullptr; } -StatusCode Muon::MdtRdoToPrepDataTool::decode( const std::vector<uint32_t>& robIds, const std::vector<IdentifierHash>& chamberHashInRobs ) +StatusCode Muon::MdtRdoToPrepDataTool::decode( const std::vector<IdentifierHash>& chamberHashInRobs ) { // setup output container SetupMdtPrepDataContainerStatus containerRecordStatus = setupMdtPrepDataContainer(); @@ -227,11 +212,6 @@ StatusCode Muon::MdtRdoToPrepDataTool::decode( const std::vector<uint32_t>& robI return StatusCode::SUCCESS; } - if (m_useBStoRdoTool && m_rawDataProviderTool->convert(robIds).isFailure()) { - ATH_MSG_FATAL("BS conversion into RDOs failed"); - return StatusCode::FAILURE; - } - //left unused, needed by other decode function and further down the code. std::vector<IdentifierHash> idWithDataVect; processPRDHashes(chamberHashInRobs,idWithDataVect); @@ -383,15 +363,6 @@ StatusCode Muon::MdtRdoToPrepDataTool::decode( std::vector<IdentifierHash>& idVe // if requesting full event, set the full event done flag to true if (sizeVectorRequested == 0) m_fullEventDone=true; - // ask MdtRawDataProviderTool to decode the list of robs and to fill the rdo IDC - if (m_useBStoRdoTool) { - StatusCode sc = (sizeVectorRequested == 0 ) ? m_rawDataProviderTool->convert() : m_rawDataProviderTool->convert(idVect); - if( sc.isFailure()) { - ATH_MSG_FATAL("BS conversion into RDOs failed"); - return StatusCode::FAILURE; - } - } - // seeded or unseeded decoding if (sizeVectorRequested != 0) { processPRDHashes(idVect,idWithDataVect); diff --git a/MuonSpectrometer/MuonCnv/MuonMDT_CnvTools/src/MdtRdoToPrepDataTool.h b/MuonSpectrometer/MuonCnv/MuonMDT_CnvTools/src/MdtRdoToPrepDataTool.h index 27c505935d416d6e904a22e8b2fa395bf72708a9..2ce6429151841cfafd09c97fba707c6904866704 100644 --- a/MuonSpectrometer/MuonCnv/MuonMDT_CnvTools/src/MdtRdoToPrepDataTool.h +++ b/MuonSpectrometer/MuonCnv/MuonMDT_CnvTools/src/MdtRdoToPrepDataTool.h @@ -75,8 +75,7 @@ namespace Muon /** Decode method - declared in Muon::IMuonRdoToPrepDataTool*/ StatusCode decode( std::vector<IdentifierHash>& idVect, std::vector<IdentifierHash>& selectedIdVect ); - //new decode methods for Rob based readout - StatusCode decode( const std::vector<uint32_t>& robIds, const std::vector<IdentifierHash>& chamberHashInRobs ); + //new decode method for Rob based readout StatusCode decode( const std::vector<uint32_t>& robIds ); StatusCode processCsm(const MdtCsm *rdoColl, std::vector<IdentifierHash>& idWithDataVect); @@ -102,7 +101,10 @@ namespace Muon enum SetupMdtPrepDataContainerStatus { FAILED = 0, ADDED, ALREADYCONTAINED }; - + + // decode method for Rob based readout + StatusCode decode( const std::vector<IdentifierHash>& chamberHashInRobs ); + SetupMdtPrepDataContainerStatus setupMdtPrepDataContainer(); void processRDOContainer( std::vector<IdentifierHash>& idWithDataVect ); @@ -136,10 +138,7 @@ namespace Muon bool m_decodeData; //!< toggle on/off the decoding of MDT RDO into MdtPrepData bool m_sortPrepData; //!< Toggle on/off the sorting of the MdtPrepData - bool m_useBStoRdoTool; - // handle tp the MDT_RawDataProviderTool - ToolHandle<Muon::IMuonRawDataProviderTool> m_rawDataProviderTool; ToolHandle<Muon::IMDT_RDO_Decoder> m_mdtDecoder; ToolHandle<Muon::MuonIdHelperTool> m_idHelper; diff --git a/MuonSpectrometer/MuonCnv/MuonRPC_CnvTools/CMakeLists.txt b/MuonSpectrometer/MuonCnv/MuonRPC_CnvTools/CMakeLists.txt index b20009ae8e35c2d2bc6980fa6b4a18de2910ee24..b37251a746e694b74bf4dae131f808eb4afea4d8 100644 --- a/MuonSpectrometer/MuonCnv/MuonRPC_CnvTools/CMakeLists.txt +++ b/MuonSpectrometer/MuonCnv/MuonRPC_CnvTools/CMakeLists.txt @@ -12,8 +12,6 @@ atlas_depends_on_subdirs( PUBLIC PRIVATE Control/AthenaBaseComps Control/AthenaKernel - Control/CLIDSvc - Control/SGTools Control/StoreGate Event/ByteStreamCnvSvcBase MuonSpectrometer/MuonCablings/RPCcablingInterface @@ -37,7 +35,7 @@ atlas_add_component( MuonRPC_CnvTools src/*.cxx src/components/*.cxx INCLUDE_DIRS ${TDAQ-COMMON_INCLUDE_DIRS} - LINK_LIBRARIES ${TDAQ-COMMON_LIBRARIES} ByteStreamData ByteStreamData_test GaudiKernel AthenaBaseComps AthenaKernel SGTools StoreGateLib SGtests ByteStreamCnvSvcBaseLib RPCcablingInterfaceLib MuonContainerManager MuonCondInterface MuonReadoutGeometry MuonDigitContainer MuonIdHelpersLib MuonRDO MuonPrepRawData MuonTrigCoinData TrkSurfaces TrigT1RPChardwareLib RPChardware ) + LINK_LIBRARIES ${TDAQ-COMMON_LIBRARIES} ByteStreamData ByteStreamData_test GaudiKernel AthenaBaseComps AthenaKernel StoreGateLib SGtests ByteStreamCnvSvcBaseLib RPCcablingInterfaceLib MuonContainerManager MuonCondInterface MuonReadoutGeometry MuonDigitContainer MuonIdHelpersLib MuonRDO MuonPrepRawData MuonTrigCoinData TrkSurfaces TrigT1RPChardwareLib RPChardware ) # Install files from the package: atlas_install_headers( MuonRPC_CnvTools ) diff --git a/MuonSpectrometer/MuonCnv/MuonRPC_CnvTools/src/RpcPadContByteStreamTool.cxx b/MuonSpectrometer/MuonCnv/MuonRPC_CnvTools/src/RpcPadContByteStreamTool.cxx index 682932873dbc53abffe1ddad95e0578639b5e54f..f7bedc19928a07f7c67d749de10307033e8abb09 100755 --- a/MuonSpectrometer/MuonCnv/MuonRPC_CnvTools/src/RpcPadContByteStreamTool.cxx +++ b/MuonSpectrometer/MuonCnv/MuonRPC_CnvTools/src/RpcPadContByteStreamTool.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration */ #include "RpcPadContByteStreamTool.h" @@ -16,7 +16,7 @@ //#include "StoreGate/StoreGate.h" //#include "StoreGate/tools/ClassID_traits.h" -#include "CLIDSvc/CLASS_DEF.h" +#include "AthenaKernel/CLASS_DEF.h" #include <map> diff --git a/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondCool/doc/used_packages.html b/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondCool/doc/used_packages.html index e3999b90cdeefbaa652ea79a7e2e88489dff8a6c..a8ed0ee572d768dbcae9a1c216c0b5e194253078 100644 --- a/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondCool/doc/used_packages.html +++ b/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondCool/doc/used_packages.html @@ -3,7 +3,6 @@ <tr><td><a href="http://cern.ch/atlas-computing/links/buildDirectory/AtlasCore/13.0.10/InstallArea/doc/AtlasPolicy/html/index.html">AtlasPolicy</a></td></tr> <tr><td><a href="http://cern.ch/atlas-computing/links/buildDirectory/AtlasCore/13.0.10/InstallArea/doc/Identifier/html/index.html">DetectorDescription/Identifier</a></td></tr> <tr><td><a href="http://cern.ch/atlas-computing/links/buildDirectory/AtlasCore/13.0.10/InstallArea/doc/TestPolicy/html/index.html">TestPolicy</a></td></tr> -<tr><td><a href="http://cern.ch/atlas-computing/links/buildDirectory/AtlasCore/13.0.10/InstallArea/doc/CLIDSvc/html/index.html">Control/CLIDSvc</a></td></tr> <tr><td><a href="http://cern.ch/atlas-computing/links/buildDirectory/AtlasConditions/13.0.10/InstallArea/doc/MuonIdHelpers/html/index.html">MuonSpectrometer/MuonIdHelpers</a></td></tr> <tr><td><a href="http://cern.ch/atlas-computing/links/buildDirectory/AtlasCore/13.0.10/InstallArea/doc/CondDBObjects/html/index.html">Database/CondDBObjects</a></td></tr> <tr><td><a href="http://cern.ch/atlas-computing/links/buildDirectory/AtlasCore/13.0.10/InstallArea/doc/AtlasSEAL/html/index.html">External/AtlasSEAL</a></td></tr> diff --git a/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondSvc/MuonCondSvc/MuonAlignmentErrorData.h b/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondSvc/MuonCondSvc/MuonAlignmentErrorData.h index b745c5ae5f99f440c2577d34485d4857bb91e249..31e5b23ffbc187d2a9e791b7dd41954a01c8fd5a 100644 --- a/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondSvc/MuonCondSvc/MuonAlignmentErrorData.h +++ b/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondSvc/MuonCondSvc/MuonAlignmentErrorData.h @@ -49,7 +49,7 @@ private: }; -#include "CLIDSvc/CLASS_DEF.h" +#include "AthenaKernel/CLASS_DEF.h" CLASS_DEF( MuonAlignmentErrorData, 115867308, 1) #include "AthenaKernel/CondCont.h" CLASS_DEF( CondCont<MuonAlignmentErrorData>, 265772564, 0) diff --git a/MuonSpectrometer/MuonConfig/python/MuonCablingConfig.py b/MuonSpectrometer/MuonConfig/python/MuonCablingConfig.py index daf94b6caa6ba74cd2182cb229f9c1ca59016e32..731a9db819cccbd5668da8f2ab94ec1e20c662d4 100644 --- a/MuonSpectrometer/MuonConfig/python/MuonCablingConfig.py +++ b/MuonSpectrometer/MuonConfig/python/MuonCablingConfig.py @@ -6,7 +6,7 @@ from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator from MuonConfig.MuonGeometryConfig import MuonGeoModelCfg -def RPCCablingConfig(flags): +def RPCCablingConfigCfg(flags): acc = ComponentAccumulator() # TODO check if we actually need this here? @@ -50,7 +50,7 @@ def RPCCablingConfig(flags): return acc, rpcCablingSvc -def TGCCablingConfig(flags): +def TGCCablingConfigCfg(flags): acc = ComponentAccumulator() # TODO check if we actually need this here? @@ -81,8 +81,10 @@ if __name__ == '__main__': from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator acc = ComponentAccumulator() - acc.merge(RPCCablingConfig(ConfigFlags )) - acc.merge(TGCCablingConfig(ConfigFlags )) + result,svc = RPCCablingConfigCfg(ConfigFlags) + acc.merge( result ) + result,svc = TGCCablingConfigCfg(ConfigFlags) + acc.merge( result ) f=open('MuonCabling.pkl','w') acc.store(f) diff --git a/MuonSpectrometer/MuonConfig/python/MuonRIO_OnTrackCreatorConfig.py b/MuonSpectrometer/MuonConfig/python/MuonRIO_OnTrackCreatorConfig.py index 9aa6b8d5b6f7290430823f8c7801521d3e6d853b..b024830c47d22901ab09ef263568845925b1fafc 100644 --- a/MuonSpectrometer/MuonConfig/python/MuonRIO_OnTrackCreatorConfig.py +++ b/MuonSpectrometer/MuonConfig/python/MuonRIO_OnTrackCreatorConfig.py @@ -12,7 +12,7 @@ def CscClusterOnTrackCreatorCfg(flags,**kwargs): result=ComponentAccumulator() - acc, qrat = MuonConfig.MuonSegmentFindingConfig.QratCscClusterFitterCfg(flags) + acc, qrat = QratCscClusterFitterCfg(flags) result.addPublicTool(qrat) result.merge(acc) diff --git a/MuonSpectrometer/MuonConfig/python/MuonReconstructionConfig.py b/MuonSpectrometer/MuonConfig/python/MuonReconstructionConfig.py index 00d03f611e9468bef1093b86c45208f624b844ee..767d6bd8736e907937620346e6b283f71994bcb7 100644 --- a/MuonSpectrometer/MuonConfig/python/MuonReconstructionConfig.py +++ b/MuonSpectrometer/MuonConfig/python/MuonReconstructionConfig.py @@ -1,19 +1,22 @@ # Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration +# Core configuration from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator -from AthenaCommon import CfgMgr -from AthenaCommon.CfgGetter import getPublicTool,getPublicToolClone,getPrivateTool +# Local +from MuonConfig.MuonSegmentFindingConfig import MuonSegmentFindingCfg + def MuonReconstructionCfg(flags): # TODO - add lots! # https://gitlab.cern.ch/atlas/athena/blob/master/MuonSpectrometer/MuonReconstruction/MuonRecExample/python/MuonStandalone.py result=ComponentAccumulator() - from MuonConfig.MuonSegmentFindingConfig import MuonSegmentFindingCfg result.merge( MuonSegmentFindingCfg(flags) ) return result if __name__=="__main__": + # To run this, do e.g. + # python ../athena/MuonSpectrometer/MuonConfig/python/MuonReconstructionConfig.py from AthenaCommon.Configurable import Configurable Configurable.configurableRun3Behavior=1 @@ -22,20 +25,25 @@ if __name__=="__main__": from AthenaConfiguration.AllConfigFlags import ConfigFlags log.setLevel(DEBUG) - - ConfigFlags.Input.isMC=False + from AthenaCommon.Logging import log + log.debug('About to set up Segment Finding.') + ConfigFlags.Input.Files = ["myESD.pool.root"] + ConfigFlags.Muon.doCSCs = False ConfigFlags.lock() cfg=ComponentAccumulator() + # This is a temporary fix! Should be private! + from MuonRecHelperTools.MuonRecHelperToolsConf import Muon__MuonEDMHelperTool + muon_edm_helper_tool = Muon__MuonEDMHelperTool("MuonEDMHelperTool", MuonExtrapolator=None) # Don't bring in this dependency yet! + cfg.addPublicTool( muon_edm_helper_tool ) + from AthenaPoolCnvSvc.PoolReadConfig import PoolReadCfg cfg.merge(PoolReadCfg(ConfigFlags)) - - acc=MuonReconstructionCfg(ConfigFlags) - - cfg.merge(acc) + + cfg.merge(MuonReconstructionCfg(ConfigFlags)) - f=open("MuonReconstruction.pkl","w") + f=open("MuonSegmentFinding.pkl","w") cfg.store(f) f.close() diff --git a/MuonSpectrometer/MuonConfig/python/MuonSegmentFindingConfig.py b/MuonSpectrometer/MuonConfig/python/MuonSegmentFindingConfig.py index 3d7da112aadaaa5962a4edd2de71a93ef7dc6c4b..37b51447225bf3959149813fb97e362f4e6483b5 100644 --- a/MuonSpectrometer/MuonConfig/python/MuonSegmentFindingConfig.py +++ b/MuonSpectrometer/MuonConfig/python/MuonSegmentFindingConfig.py @@ -801,7 +801,7 @@ def MuonSegmentFindingCfg(flags, **kwargs): if __name__=="__main__": # To run this, do e.g. - # python ../athena/MuonSpectrometer/MuonConfig/python/MuonSegmentFinding.py + # python ../athena/MuonSpectrometer/MuonConfig/python/MuonSegmentFindingConfig.py from AthenaCommon.Configurable import Configurable Configurable.configurableRun3Behavior=1 diff --git a/MuonSpectrometer/MuonDetDescr/MuonReadoutGeometry/MuonReadoutGeometry/MuonDetectorManager.h b/MuonSpectrometer/MuonDetDescr/MuonReadoutGeometry/MuonReadoutGeometry/MuonDetectorManager.h index c5a8e95e846bdcaa85f8f13fc5a84ac6b5edcd1a..b170efc64c2910cc8bf9342d36c83f752697d8e7 100644 --- a/MuonSpectrometer/MuonDetDescr/MuonReadoutGeometry/MuonReadoutGeometry/MuonDetectorManager.h +++ b/MuonSpectrometer/MuonDetDescr/MuonReadoutGeometry/MuonReadoutGeometry/MuonDetectorManager.h @@ -48,7 +48,7 @@ namespace MuonGM { class MdtReadoutElement; class MuonClusterReadoutElement; class MuonStation; - // for nSW + // New Small Wheel class sTgcReadoutElement; class MMReadoutElement; @@ -108,19 +108,22 @@ namespace MuonGM { const RpcReadoutElement* getRpcReadoutElement(Identifier) const;//!< access via extended identifier (requires unpacking) const TgcReadoutElement* getTgcReadoutElement(Identifier) const;//!< access via extended identifier (requires unpacking) const CscReadoutElement* getCscReadoutElement(Identifier) const;//!< access via extended identifier (requires unpacking) + // New Small Wheel const MMReadoutElement* getMMReadoutElement(Identifier) const;//!< access via extended identifier (requires unpacking) const sTgcReadoutElement* getsTgcReadoutElement(Identifier) const;//!< access via extended identifier (requires unpacking) const MuonClusterReadoutElement* getMuonClusterReadoutElement(Identifier) const;//!< access via extended identifier (requires unpacking) + const MdtReadoutElement* getMdtReadoutElement(int i1, int i2, int i3, int i4) const; //!< access via internally defined array indices; not friendly to users + // FIX: New Small Wheel ? No equivalent in .cxx file const sTgcReadoutElement* getsTgcReadoutElement(int i1, int i2, int i3, int i4) const; //!< access via internally defined array indices; not friendly to users - const MMReadoutElement* getMMReadoutElement(int i1, int i2, int i3, int i4) const; //!< access via internally defined array indices; not friendly to users + // const RpcReadoutElement* getRpcReadoutElement(int i1, int i2, int i3, int i4, int i5) const; //!< access via internally defined array indices; not friendly to users @@ -131,6 +134,7 @@ namespace MuonGM { const CscReadoutElement* getCscReadoutElement(int i1, int i2, int i3, int i4) const; //!< access via internally defined array indices; not friendly to users + const MdtReadoutElement* getMdtRElement_fromIdFields(int i1, int i2, int i3, int i4) const; //!< access via extended identifier field (no unpacking) @@ -153,6 +157,7 @@ namespace MuonGM { inline const RpcReadoutElement* getRpcReadoutElement(IdentifierHash id) const;//!< access via detector-element hash id inline const TgcReadoutElement* getTgcReadoutElement(IdentifierHash id) const;//!< access via detector-element hash id inline const CscReadoutElement* getCscReadoutElement(IdentifierHash id) const;//!< access via detector-element hash id + // TODO: New Small Wheel // void addMdtDetectorElement(MdtDetectorElement*); // void addRpcDetectorElement(RpcDetectorElement*); @@ -165,18 +170,22 @@ namespace MuonGM { inline const RpcDetectorElement* getRpcDetectorElement(IdentifierHash id) const; inline const TgcDetectorElement* getTgcDetectorElement(IdentifierHash id) const; inline const CscDetectorElement* getCscDetectorElement(IdentifierHash id) const; + // TODO: New Small Wheel inline unsigned int nMuonStation() const; //!< Number of MuonStations + inline unsigned int nMdtRE() const;//!< Number of Mdt ReadoutElements - inline unsigned int nsTgcRE() const;//!< Number of Mdt ReadoutElements - inline unsigned int nMMRE() const;//!< Number of Mdt ReadoutElements + inline unsigned int nsTgcRE() const;//!< Number of sTgc ReadoutElements + inline unsigned int nMMRE() const;//!< Number of MM ReadoutElements inline unsigned int nCscRE() const;//!< Number of Csc ReadoutElements inline unsigned int nRpcRE() const;//!< Number of Rpc ReadoutElements inline unsigned int nTgcRE() const;//!< Number of Tgc ReadoutElements + inline unsigned int nMdtDE() const;//!< Number of Mdt DetectorElements inline unsigned int nCscDE() const;//!< Number of Csc DetectorElements inline unsigned int nRpcDE() const;//!< Number of Rpc DetectorElements inline unsigned int nTgcDE() const;//!< Number of Tgc DetectorElements + // TODO: New Small Wheel // Geometry versioning inline std::string geometryVersion() const; //!< it can be Rome-Initial or P03, or ... it's the name of the layout @@ -189,7 +198,7 @@ namespace MuonGM { inline const CscIdHelper* cscIdHelper() const; inline const RpcIdHelper* rpcIdHelper() const; inline const TgcIdHelper* tgcIdHelper() const; - // for nSW + // New Small Wheel inline const sTgcIdHelper* stgcIdHelper() const; inline const MmIdHelper* mmIdHelper() const; @@ -198,7 +207,7 @@ namespace MuonGM { inline void set_cscIdHelper(const CscIdHelper* idh); inline void set_rpcIdHelper(const RpcIdHelper* idh); inline void set_tgcIdHelper(const TgcIdHelper* idh); - // for nSW + // New Small Wheel inline void set_stgcIdHelper(const sTgcIdHelper* idh); inline void set_mmIdHelper(const MmIdHelper* idh); @@ -211,6 +220,7 @@ namespace MuonGM { inline const GenericCSCCache* getGenericCscDescriptor() const; inline void setGenericTgcDescriptor(const GenericTGCCache& tc); inline const GenericTGCCache* getGenericTgcDescriptor() const; + // TODO: New Small Wheel inline void setCachingFlag(int value); inline int cachingFlag() const; @@ -244,6 +254,7 @@ namespace MuonGM { CscRElMaxHash = 130, RpcRElMaxHash = 1200, TgcRElMaxHash = 1600 + // TODO: New Small Wheel }; enum detElementHashMax @@ -252,6 +263,7 @@ namespace MuonGM { CscDetElMaxHash = 65, RpcDetElMaxHash = 650, TgcDetElMaxHash = 1600 + // TODO: New Small Wheel }; @@ -326,6 +338,7 @@ namespace MuonGM { void clearRpcCache() const; void clearCscCache() const; void clearTgcCache() const; + // New Small Wheel void clearsTgcCache() const; void clearMMCache() const; @@ -333,6 +346,7 @@ namespace MuonGM { void refreshRpcCache() const; void refreshCscCache() const; void refreshTgcCache() const; + // New Small Wheel void refreshsTgcCache() const; void refreshMMCache() const; @@ -340,6 +354,7 @@ namespace MuonGM { void fillRpcCache() const; void fillCscCache() const; void fillTgcCache() const; + // New Small Wheel void fillsTgcCache() const; void fillMMCache() const; @@ -388,6 +403,7 @@ namespace MuonGM { GenericMDTCache m_genericMDT; GenericRPCCache m_genericRPC; GenericTGCCache m_genericTGC; + // TODO: New Small Wheel // Geometry versioning @@ -399,7 +415,7 @@ namespace MuonGM { const CscIdHelper* m_cscIdHelper; const RpcIdHelper* m_rpcIdHelper; const TgcIdHelper* m_tgcIdHelper; - //for nSW + // New Small Wheel const sTgcIdHelper* m_stgcIdHelper; const MmIdHelper* m_mmIdHelper; @@ -422,6 +438,7 @@ namespace MuonGM { unsigned int m_n_cscRE; unsigned int m_n_rpcRE; unsigned int m_n_tgcRE; + // New Small Wheel unsigned int m_n_stgRE; unsigned int m_n_mmcRE; @@ -429,6 +446,7 @@ namespace MuonGM { unsigned int m_n_cscDE; unsigned int m_n_rpcDE; unsigned int m_n_tgcDE; + // TODO: New Small Wheel // pointers to the XxxDetectorElements (with granularity a la EDM) std::vector<TgcReadoutParams*> m_TgcReadoutParamsVec; @@ -438,6 +456,7 @@ namespace MuonGM { RpcDetectorElement* m_rpcDEArray[RpcDetElMaxHash]; TgcDetectorElement* m_tgcDEArray[TgcDetElMaxHash]; CscDetectorElement* m_cscDEArray[CscDetElMaxHash]; + // TODO: New Small Wheel mutable ALineMapContainer * m_aLineContainer; mutable BLineMapContainer * m_bLineContainer; @@ -456,7 +475,7 @@ namespace MuonGM { const CscIdHelper* MuonDetectorManager::cscIdHelper() const {return m_cscIdHelper;} const RpcIdHelper* MuonDetectorManager::rpcIdHelper() const {return m_rpcIdHelper;} const TgcIdHelper* MuonDetectorManager::tgcIdHelper() const {return m_tgcIdHelper;} - //for nSW + // New Small Wheel const sTgcIdHelper* MuonDetectorManager::stgcIdHelper() const {return m_stgcIdHelper;} const MmIdHelper* MuonDetectorManager::mmIdHelper() const {return m_mmIdHelper;} @@ -464,7 +483,7 @@ namespace MuonGM { void MuonDetectorManager::set_cscIdHelper(const CscIdHelper* idh) {m_cscIdHelper = idh;} void MuonDetectorManager::set_rpcIdHelper(const RpcIdHelper* idh) {m_rpcIdHelper = idh;} void MuonDetectorManager::set_tgcIdHelper(const TgcIdHelper* idh) {m_tgcIdHelper = idh;} - //for nSW + // New Small Wheel void MuonDetectorManager::set_stgcIdHelper(const sTgcIdHelper* idh) {m_stgcIdHelper = idh;} void MuonDetectorManager::set_mmIdHelper(const MmIdHelper* idh) {m_mmIdHelper = idh;} @@ -534,10 +553,12 @@ namespace MuonGM { unsigned int MuonDetectorManager::nTgcRE() const {return m_n_tgcRE;} unsigned int MuonDetectorManager::nsTgcRE() const {return m_n_stgRE;} unsigned int MuonDetectorManager::nMMRE() const {return m_n_mmcRE;} + unsigned int MuonDetectorManager::nMdtDE() const {return m_n_mdtDE;} unsigned int MuonDetectorManager::nCscDE() const {return m_n_cscDE;} unsigned int MuonDetectorManager::nRpcDE() const {return m_n_rpcDE;} - unsigned int MuonDetectorManager::nTgcDE() const {return m_n_tgcDE;} + unsigned int MuonDetectorManager::nTgcDE() const {return m_n_tgcDE;} + // TODO: New Small Wheel ALineMapContainer* MuonDetectorManager::ALineContainer() const @@ -689,6 +710,7 @@ namespace MuonGM { #endif return m_rpcDEArray[id]; } +// TODO: New Small Wheel (missing all the above functions) } // namespace MuonGM diff --git a/MuonSpectrometer/MuonDetDescr/MuonReadoutGeometry/src/MuonDetectorManager.cxx b/MuonSpectrometer/MuonDetDescr/MuonReadoutGeometry/src/MuonDetectorManager.cxx index 39df08b75c46f4374554e42b22f7634cf27c7657..963f94fc2e53aa48cd36cf145ff9fcbce4758e29 100644 --- a/MuonSpectrometer/MuonDetDescr/MuonReadoutGeometry/src/MuonDetectorManager.cxx +++ b/MuonSpectrometer/MuonDetDescr/MuonReadoutGeometry/src/MuonDetectorManager.cxx @@ -661,6 +661,9 @@ const MuonClusterReadoutElement* MuonDetectorManager::getMuonClusterReadoutEleme if( m_tgcIdHelper->is_tgc(id) ) return getTgcReadoutElement(id); if( m_rpcIdHelper->is_rpc(id) ) return getRpcReadoutElement(id); if( m_cscIdHelper->is_csc(id) ) return getCscReadoutElement(id); + // New Small Wheel + if( m_mmIdHelper->is_mm(id) ) return getMMReadoutElement(id); + if( m_stgcIdHelper->is_stgc(id) ) return getsTgcReadoutElement(id); return 0; } diff --git a/MuonSpectrometer/MuonIdHelpers/CMakeLists.txt b/MuonSpectrometer/MuonIdHelpers/CMakeLists.txt index 898ea4c700980842ac7b8d9776364f8981f7b076..63cde433cf1ac09158c016a79d6ee95f2d383432 100644 --- a/MuonSpectrometer/MuonIdHelpers/CMakeLists.txt +++ b/MuonSpectrometer/MuonIdHelpers/CMakeLists.txt @@ -12,8 +12,7 @@ if( NOT XAOD_STANDALONE ) atlas_depends_on_subdirs( PUBLIC Control/AthenaBaseComps - Control/CLIDSvc - Control/SGTools + Control/AthenaKernel DetectorDescription/AtlasDetDescr DetectorDescription/IdDict DetectorDescription/Identifier @@ -26,7 +25,7 @@ endif() if( NOT XAOD_STANDALONE ) set( extra_sources src/*.cxx ) set( extra_libraries - LINK_LIBRARIES AthenaBaseComps SGTools AtlasDetDescr IdDict Identifier + LINK_LIBRARIES AthenaKernel AthenaBaseComps AtlasDetDescr IdDict Identifier PRIVATE_LINK_LIBRARIES IdDictParser GaudiKernel ) endif() diff --git a/MuonSpectrometer/MuonIdHelpers/MuonIdHelpers/MuonIdHelper.h b/MuonSpectrometer/MuonIdHelpers/MuonIdHelpers/MuonIdHelper.h index 793876521182158de7065472e277771406fbaf7b..8d42af5f264d3af5df2caf369b507c5dfd21c4f8 100644 --- a/MuonSpectrometer/MuonIdHelpers/MuonIdHelpers/MuonIdHelper.h +++ b/MuonSpectrometer/MuonIdHelpers/MuonIdHelpers/MuonIdHelper.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration */ // ****************************************************************************** @@ -21,7 +21,7 @@ #include "IdDict/IdDictDefs.h" #include "Identifier/Range.h" #include "Identifier/IdHelper.h" -#include "CLIDSvc/CLASS_DEF.h" +#include "AthenaKernel/CLASS_DEF.h" #include <cassert> #include <string> diff --git a/MuonSpectrometer/MuonReconstruction/MuonRecEvent/MuonChamberT0s/CMakeLists.txt b/MuonSpectrometer/MuonReconstruction/MuonRecEvent/MuonChamberT0s/CMakeLists.txt index 5f961eaab0af9debc751736d57f210f5cfcf1fe4..49e9b0ebfb083dee48e63e9565c1b38f89058fe8 100644 --- a/MuonSpectrometer/MuonReconstruction/MuonRecEvent/MuonChamberT0s/CMakeLists.txt +++ b/MuonSpectrometer/MuonReconstruction/MuonRecEvent/MuonChamberT0s/CMakeLists.txt @@ -7,8 +7,7 @@ atlas_subdir( MuonChamberT0s ) # Declare the package's dependencies: atlas_depends_on_subdirs( PUBLIC - Control/CLIDSvc - Control/SGTools + Control/AthenaKernel DetectorDescription/Identifier ) # External dependencies: @@ -19,12 +18,12 @@ atlas_add_library( MuonChamberT0s src/*.cxx PUBLIC_HEADERS MuonChamberT0s PRIVATE_INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} - LINK_LIBRARIES SGTools Identifier + LINK_LIBRARIES AthenaKernel Identifier PRIVATE_LINK_LIBRARIES ${ROOT_LIBRARIES} ) atlas_add_dictionary( MuonChamberT0sDict MuonChamberT0s/MuonChamberT0sDict.h MuonChamberT0s/selection.xml INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} - LINK_LIBRARIES ${ROOT_LIBRARIES} SGTools Identifier MuonChamberT0s ) + LINK_LIBRARIES ${ROOT_LIBRARIES} Identifier MuonChamberT0s ) diff --git a/MuonSpectrometer/MuonReconstruction/MuonRecEvent/MuonChamberT0s/MuonChamberT0s/ChamberT0s.h b/MuonSpectrometer/MuonReconstruction/MuonRecEvent/MuonChamberT0s/MuonChamberT0s/ChamberT0s.h index bf015b718c8ba70cd861ce8a91165f9989f246df..0d0132dad952be1db7efefe803f5d0169ff9eee4 100755 --- a/MuonSpectrometer/MuonReconstruction/MuonRecEvent/MuonChamberT0s/MuonChamberT0s/ChamberT0s.h +++ b/MuonSpectrometer/MuonReconstruction/MuonRecEvent/MuonChamberT0s/MuonChamberT0s/ChamberT0s.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration */ /////////////////////////////////////////////////////////////////// @@ -10,7 +10,7 @@ #define MUONCHAMBERT0S_CHAMBERT0S_H #include "Identifier/Identifier.h" -#include "CLIDSvc/CLASS_DEF.h" +#include "AthenaKernel/CLASS_DEF.h" #include <algorithm> #include <ext/functional> diff --git a/MuonSpectrometer/MuonReconstruction/MuonRecExample/python/MuonPrdProviderToolsConfig.py b/MuonSpectrometer/MuonReconstruction/MuonRecExample/python/MuonPrdProviderToolsConfig.py index c17f9c239a0c1121d243713a3c81ffe015cf129c..68fd3c51c465f137ded03af4cdc0b29f38b843b8 100644 --- a/MuonSpectrometer/MuonReconstruction/MuonRecExample/python/MuonPrdProviderToolsConfig.py +++ b/MuonSpectrometer/MuonReconstruction/MuonRecExample/python/MuonPrdProviderToolsConfig.py @@ -43,13 +43,6 @@ def MdtPrepDataProviderTool(name="MdtPrepDataProviderTool", **kwargs): getService("MdtCalibrationSvc") include("AmdcAth/AmdcAth_jobOptions.py") - # If we run trigger from BS, then the RDO to PRD tools need to automatically run BS to RDO tools - kwargs.setdefault("useBStoRdoTool", DetFlags.readRDOBS.MDT_on() and recAlgs.doTrigger()) - #kwargs.setdefault("RawDataProviderTool", "MdtRawDataProviderTool") -### TODO: in C++ do not retrieve tool if useBStoRdoTool==False -## if not kwargs["useBStoRdoTool"]: -## kwargs["RawDataProviderTool"] = None # empty tool - if source == 'data': kwargs.setdefault("UseTwin", True) diff --git a/MuonSpectrometer/MuonReconstruction/MuonRecTools/MuonAmbiTrackSelectionTool/src/MuonAmbiTrackSelectionTool.cxx b/MuonSpectrometer/MuonReconstruction/MuonRecTools/MuonAmbiTrackSelectionTool/src/MuonAmbiTrackSelectionTool.cxx index cad29e9bfc53b4ca30755dbb54e022a57e65e410..b8de8906f1a688aa473a026c99853f68b9dbb1e9 100644 --- a/MuonSpectrometer/MuonReconstruction/MuonRecTools/MuonAmbiTrackSelectionTool/src/MuonAmbiTrackSelectionTool.cxx +++ b/MuonSpectrometer/MuonReconstruction/MuonRecTools/MuonAmbiTrackSelectionTool/src/MuonAmbiTrackSelectionTool.cxx @@ -25,13 +25,13 @@ //================ Constructor ================================================= Muon::MuonAmbiTrackSelectionTool::MuonAmbiTrackSelectionTool(const std::string& t, - const std::string& n, - const IInterface* p ) + const std::string& n, + const IInterface* p ) : - AthAlgTool(t,n,p), + AthAlgTool(t, n, p), m_assoTool("Trk::PRD_AssociationTool/PRD_AssociationTool"), m_printer("Muon::MuonEDMPrinterTool/MuonEDMPrinterTool"), - m_idHelperTool("Muon::MuonIdHelperTool/MuonIdHelperTool") + m_idHelperTool("Muon::MuonIdHelperTool/MuonIdHelperTool") { declareInterface<IAmbiTrackSelectionTool>(this); @@ -53,25 +53,25 @@ Muon::MuonAmbiTrackSelectionTool::~MuonAmbiTrackSelectionTool() StatusCode Muon::MuonAmbiTrackSelectionTool::initialize() { - + StatusCode sc = AthAlgTool::initialize(); if (sc.isFailure()) return sc; sc = m_assoTool.retrieve(); - if (sc.isFailure()) - { - ATH_MSG_ERROR("Failed to retrieve tool " << m_assoTool); - return StatusCode::FAILURE; - } + if (sc.isFailure()) + { + ATH_MSG_ERROR("Failed to retrieve tool " << m_assoTool); + return StatusCode::FAILURE; + } else ATH_MSG_DEBUG("Retrieved tool " << m_assoTool); sc = m_printer.retrieve(); - if (sc.isSuccess()){ + if (sc.isSuccess()) { ATH_MSG_DEBUG("Retrieved " << m_printer); - }else{ - ATH_MSG_ERROR("Could not get " << m_printer); + } else { + ATH_MSG_ERROR("Could not get " << m_printer); return sc; } @@ -87,102 +87,103 @@ StatusCode Muon::MuonAmbiTrackSelectionTool::finalize() } //============================================================================================ -const Trk::Track* Muon::MuonAmbiTrackSelectionTool::getCleanedOutTrack(const Trk::Track* ptrTrack, const Trk::TrackScore /*score*/) +const Trk::Track* Muon::MuonAmbiTrackSelectionTool::getCleanedOutTrack(const Trk::Track* ptrTrack, const Trk::TrackScore /*score*/) { unsigned int numshared = 0; unsigned int numhits = 0; - - if( !ptrTrack ) return 0; + + if ( !ptrTrack ) return 0; // get all TSOS const DataVector<const Trk::TrackStateOnSurface>* tsos = ptrTrack->trackStateOnSurfaces(); - - + + ATH_MSG_VERBOSE("New Track " << m_printer->print(*ptrTrack)); - std::map<Muon::MuonStationIndex::StIndex,int> sharedPrecisionPerLayer; - std::map<Muon::MuonStationIndex::StIndex,int> precisionPerLayer; - + std::map<Muon::MuonStationIndex::StIndex, int> sharedPrecisionPerLayer; + std::map<Muon::MuonStationIndex::StIndex, int> precisionPerLayer; + // loop over TSOS DataVector<const Trk::TrackStateOnSurface>::const_iterator iTsos = tsos->begin(); - DataVector<const Trk::TrackStateOnSurface>::const_iterator iTsosEnd = tsos->end(); + DataVector<const Trk::TrackStateOnSurface>::const_iterator iTsosEnd = tsos->end(); for ( ; iTsos != iTsosEnd ; ++iTsos) { - + // get measurment from TSOS const Trk::MeasurementBase* meas = (*iTsos)->measurementOnTrack(); if (!meas) continue; // only look at measurements - if( !(*iTsos)->type(Trk::TrackStateOnSurface::Measurement ) ) continue; - + if ( !(*iTsos)->type(Trk::TrackStateOnSurface::Measurement ) ) continue; + const Trk::RIO_OnTrack* rot = dynamic_cast <const Trk::RIO_OnTrack*> (meas); if (!rot) { // we are only interested in precision hits since only they have the resolution to distinguish between close-by tracks // so we only take competing ROTs if they are CSC eta hits const Trk::CompetingRIOsOnTrack* competingROT = dynamic_cast <const Trk::CompetingRIOsOnTrack*> (meas); - if(competingROT){ + if (competingROT) { const unsigned int numROTs = competingROT->numberOfContainedROTs(); - for( unsigned int i=0;i<numROTs;++i ){ + for ( unsigned int i = 0; i < numROTs; ++i ) { const Trk::RIO_OnTrack* rot = &competingROT->rioOnTrack(i); - if( !rot || !rot->prepRawData() || !m_idHelperTool->isMuon(rot->identify()) ) continue; + if ( !rot || !rot->prepRawData() || !m_idHelperTool->isMuon(rot->identify()) ) continue; //only use precision hits for muon track overlap - if(!m_idHelperTool->isMdt(rot->identify()) && !(m_idHelperTool->isCsc(rot->identify()) && !m_idHelperTool->measuresPhi(rot->identify())) && !m_idHelperTool->isMM(rot->identify()) && !m_idHelperTool->issTgc(rot->identify())) continue; - Muon::MuonStationIndex::StIndex stIndex = m_idHelperTool->stationIndex(rot->identify()); - ++precisionPerLayer[stIndex]; - if ( m_assoTool->isUsed(*(rot->prepRawData()))) { - ATH_MSG_VERBOSE("Track overlap found! " << m_idHelperTool->toString(rot->identify())); - ++numshared; - ++sharedPrecisionPerLayer[stIndex]; - } - } + if (!m_idHelperTool->isMdt(rot->identify()) && !(m_idHelperTool->isCsc(rot->identify()) && !m_idHelperTool->measuresPhi(rot->identify())) && !m_idHelperTool->isMM(rot->identify()) && !m_idHelperTool->issTgc(rot->identify())) continue; + Muon::MuonStationIndex::StIndex stIndex = m_idHelperTool->stationIndex(rot->identify()); + ++precisionPerLayer[stIndex]; + if ( m_assoTool->isUsed(*(rot->prepRawData()))) { + ATH_MSG_VERBOSE("Track overlap found! " << m_idHelperTool->toString(rot->identify())); + ++numshared; + ++sharedPrecisionPerLayer[stIndex]; + } + } } - }else{ + } else { - if(!m_idHelperTool->isMuon(rot->identify())) continue; - if(!m_idHelperTool->isMdt(rot->identify()) && !(m_idHelperTool->isCsc(rot->identify()) && !m_idHelperTool->measuresPhi(rot->identify())) && !m_idHelperTool->isMM(rot->identify()) && !m_idHelperTool->issTgc(rot->identify())) continue; //only precision hits used for overlap + if (!m_idHelperTool->isMuon(rot->identify())) continue; + if (!m_idHelperTool->isMdt(rot->identify()) && !(m_idHelperTool->isCsc(rot->identify()) && !m_idHelperTool->measuresPhi(rot->identify())) && !m_idHelperTool->isMM(rot->identify()) && !m_idHelperTool->issTgc(rot->identify())) continue; //only precision hits used for overlap ++numhits; + Muon::MuonStationIndex::StIndex stIndex = m_idHelperTool->stationIndex(rot->identify()); ++precisionPerLayer[stIndex]; // allow no overlap if ( m_assoTool->isUsed(*(rot->prepRawData()))) { - ATH_MSG_VERBOSE("Track overlap found! " << m_idHelperTool->toString(rot->identify())); - ++numshared; - ++sharedPrecisionPerLayer[stIndex]; + ATH_MSG_VERBOSE("Track overlap found! " << m_idHelperTool->toString(rot->identify())); + ++numshared; + ++sharedPrecisionPerLayer[stIndex]; } } } - if( numhits == 0 ) { + if ( numhits == 0 ) { ATH_MSG_WARNING("Got track without Muon hits " << m_printer->print(*ptrTrack)); return 0; } - double overlapFraction = (double)numshared/(double)numhits; + double overlapFraction = (double)numshared / (double)numhits; - ATH_MSG_DEBUG("Track "<< ptrTrack<<" has "<< numhits <<" hit, shared " << numshared - << " overlap fraction " << overlapFraction << " layers " << precisionPerLayer.size() - << " shared " << sharedPrecisionPerLayer.size() ); + ATH_MSG_DEBUG("Track " << ptrTrack << " has " << numhits << " hit, shared " << numshared + << " overlap fraction " << overlapFraction << " layers " << precisionPerLayer.size() + << " shared " << sharedPrecisionPerLayer.size() ); - if( overlapFraction > m_maxOverlapFraction ) { - if( m_keepPartial ){ - if( sharedPrecisionPerLayer.empty() ) { - ATH_MSG_DEBUG("Track is not sharing precision hits, keeping "); - return ptrTrack; + if ( overlapFraction > m_maxOverlapFraction ) { + if ( m_keepPartial ) { + if ( sharedPrecisionPerLayer.empty() ) { + ATH_MSG_DEBUG("Track is not sharing precision hits, keeping "); + return ptrTrack; } - if( overlapFraction < 0.25 && precisionPerLayer.size() > 2 && precisionPerLayer.size() - sharedPrecisionPerLayer.size() == 1 ) { - ATH_MSG_DEBUG("Three station track differing by one precision layer, keeping "); - return ptrTrack; + if ( overlapFraction < 0.25 && precisionPerLayer.size() > 2 && precisionPerLayer.size() - sharedPrecisionPerLayer.size() == 1 ) { + ATH_MSG_DEBUG("Three station track differing by one precision layer, keeping "); + return ptrTrack; } - if( overlapFraction < 0.35 && precisionPerLayer.size() > 2 && precisionPerLayer.size() - sharedPrecisionPerLayer.size() > 1 && m_keepMoreThanOne) { - ATH_MSG_DEBUG("Three station track differing by more than one precision layer, keeping "); - return ptrTrack; + if ( overlapFraction < 0.35 && precisionPerLayer.size() > 2 && precisionPerLayer.size() - sharedPrecisionPerLayer.size() > 1 && m_keepMoreThanOne) { + ATH_MSG_DEBUG("Three station track differing by more than one precision layer, keeping "); + return ptrTrack; } } return 0; } - + return ptrTrack; } diff --git a/MuonSpectrometer/MuonReconstruction/MuonRecTools/MuonRecToolInterfaces/MuonRecToolInterfaces/IMuonSeededSegmentFinder.h b/MuonSpectrometer/MuonReconstruction/MuonRecTools/MuonRecToolInterfaces/MuonRecToolInterfaces/IMuonSeededSegmentFinder.h index 322128b6ea786ad27fd78c99e07ba781104206aa..61d4ddebe52974919bee4e69ceb4e2afd6c9d6da 100644 --- a/MuonSpectrometer/MuonReconstruction/MuonRecTools/MuonRecToolInterfaces/MuonRecToolInterfaces/IMuonSeededSegmentFinder.h +++ b/MuonSpectrometer/MuonReconstruction/MuonRecTools/MuonRecToolInterfaces/MuonRecToolInterfaces/IMuonSeededSegmentFinder.h @@ -4,7 +4,7 @@ #ifndef MUON_IMUONSEEDEDSEGMENTFINDER #define MUON_IMUONSEEDEDSEGMENTFINDER - + #include "GaudiKernel/IAlgTool.h" #include "TrkParameters/TrackParameters.h" #include "Identifier/Identifier.h" @@ -15,55 +15,66 @@ #include "MuonPrepRawData/RpcPrepDataCollection.h" #include "MuonPrepRawData/TgcPrepDataCollection.h" #include "MuonPrepRawData/CscPrepDataCollection.h" +// New Small Wheel +#include "MuonPrepRawData/sTgcPrepDataCollection.h" +#include "MuonPrepRawData/MMPrepDataCollection.h" + #include <set> #include <vector> -static const InterfaceID IID_IMuonSeededSegmentFinder("Muon::IMuonSeededSegmentFinder",1,0); +static const InterfaceID IID_IMuonSeededSegmentFinder("Muon::IMuonSeededSegmentFinder", 1, 0); namespace Muon { - class MuonSegment; +class MuonSegment; } namespace Muon { - /** @brief The IMuonSegmentMaker is a pure virtual interface for tools to find tracks starting from MuonSegmentCombinations */ - class IMuonSeededSegmentFinder : virtual public IAlgTool - { - public: - /** access to tool interface */ - static const InterfaceID& interfaceID(); +/** @brief The IMuonSegmentMaker is a pure virtual interface for tools to find tracks starting from MuonSegmentCombinations */ +class IMuonSeededSegmentFinder : virtual public IAlgTool +{ +public: + /** access to tool interface */ + static const InterfaceID& interfaceID(); + + /** @brief find segments in a set of chambers starting from seeding TrackParameters */ + virtual std::vector<const MuonSegment*>* find( const Trk::TrackParameters& pars, const std::set<Identifier>& chIds ) const = 0; + + /** @brief find segments in a set of chambers starting from seeding TrackParameters (version with Hashes) */ + virtual std::vector<const MuonSegment*>* find( const Trk::TrackParameters& pars, const std::set<IdentifierHash>& chIdHs ) const = 0; - /** @brief find segments in a set of chambers starting from seeding TrackParameters */ - virtual std::vector<const MuonSegment*>* find( const Trk::TrackParameters& pars, const std::set<Identifier>& chIds ) const = 0; - - /** @brief find segments in a set of chambers starting from seeding TrackParameters (version with Hashes) */ - virtual std::vector<const MuonSegment*>* find( const Trk::TrackParameters& pars, const std::set<IdentifierHash>& chIdHs ) const = 0; + /** @brief find segments in a set of MdtPrepData starting from seeding TrackParameters */ + virtual std::vector<const MuonSegment*>* find( const Trk::TrackParameters& pars, const std::vector<const MdtPrepData*>& mdtPrds ) const = 0; - /** @brief find segments in a set of MdtPrepData starting from seeding TrackParameters */ - virtual std::vector<const MuonSegment*>* find( const Trk::TrackParameters& pars, const std::vector<const MdtPrepData*>& mdtPrds ) const = 0; + /** @brief retrieve MDT PRD collections for the given hashes */ + virtual void extractMdtPrdCols( const std::set<IdentifierHash>& chIdHs, std::vector<const MdtPrepDataCollection*>& target ) const = 0; - /** @brief retrieve MDT PRD collections for the given hashes */ - virtual void extractMdtPrdCols( const std::set<IdentifierHash>& chIdHs, std::vector<const MdtPrepDataCollection*>& target ) const = 0; + /** @brief retrieve RPC PRD collections for the given hashes */ + virtual void extractRpcPrdCols( const std::set<IdentifierHash>& chIdHs, std::vector<const RpcPrepDataCollection*>& target ) const = 0; - /** @brief retrieve RPC PRD collections for the given hashes */ - virtual void extractRpcPrdCols( const std::set<IdentifierHash>& chIdHs, std::vector<const RpcPrepDataCollection*>& target ) const = 0; + /** @brief retrieve TGC PRD collections for the given hashes */ + virtual void extractTgcPrdCols( const std::set<IdentifierHash>& chIdHs, std::vector<const TgcPrepDataCollection*>& target ) const = 0; - /** @brief retrieve TGC PRD collections for the given hashes */ - virtual void extractTgcPrdCols( const std::set<IdentifierHash>& chIdHs, std::vector<const TgcPrepDataCollection*>& target ) const = 0; + /** @brief retrieve CSC PRD collections for the given hashes */ + virtual void extractCscPrdCols( const std::set<IdentifierHash>& chIdHs, std::vector<const CscPrepDataCollection*>& target ) const = 0; - /** @brief retrieve CSC PRD collections for the given hashes */ - virtual void extractCscPrdCols( const std::set<IdentifierHash>& chIdHs, std::vector<const CscPrepDataCollection*>& target ) const = 0; + // New Small Wheel + /** @brief retrieve STGC PRD collections for the given hashes */ + virtual void extractsTgcPrdCols( const std::set<IdentifierHash>& chIdHs, std::vector<const sTgcPrepDataCollection*>& target ) const = 0; + /** @brief retrieve MM PRD collections for the given hashes */ + virtual void extractMMPrdCols( const std::set<IdentifierHash>& chIdHs, std::vector<const MMPrepDataCollection*>& target ) const = 0; - }; - - inline const InterfaceID& IMuonSeededSegmentFinder::interfaceID() - { - return IID_IMuonSeededSegmentFinder; - } + +}; + +inline const InterfaceID& IMuonSeededSegmentFinder::interfaceID() +{ + return IID_IMuonSeededSegmentFinder; +} } // end of name space -#endif +#endif diff --git a/MuonSpectrometer/MuonReconstruction/MuonRecTools/MuonTrackSummaryHelperTool/src/MuonTrackSummaryHelperTool.cxx b/MuonSpectrometer/MuonReconstruction/MuonRecTools/MuonTrackSummaryHelperTool/src/MuonTrackSummaryHelperTool.cxx index 0aa1bc75c19b2cb16e86b35e0a88b6443a61f0c6..21896b4c3f42b0ab5f0ae2baee3e3c66ff0d1e5d 100755 --- a/MuonSpectrometer/MuonReconstruction/MuonRecTools/MuonTrackSummaryHelperTool/src/MuonTrackSummaryHelperTool.cxx +++ b/MuonSpectrometer/MuonReconstruction/MuonRecTools/MuonTrackSummaryHelperTool/src/MuonTrackSummaryHelperTool.cxx @@ -376,6 +376,15 @@ void Muon::MuonTrackSummaryHelperTool::addDetailedTrackSummary( const Trk::Track } if( pars->associatedSurface().associatedDetectorElement() ){ Identifier id = pars->associatedSurface().associatedDetectorElement()->identify(); + bool issTgc = m_idHelperTool->issTgc(id); + if(issTgc) { +// get the identifier for phi or eta holes + Identifier idh = pars->associatedSurface().associatedDetectorElementIdentifier(); + if(idh.is_valid()) { + id = idh; +// ATH_MSG_VERBOSE(" For sTGC hole use associatedDetectorElementIdentifier "); + } + } if( !id.is_valid() || !m_idHelperTool->isMuon(id) ) continue; Identifier chId = m_idHelperTool->chamberId(id); //Identifier layId = m_idHelperTool->layerId(id); @@ -408,9 +417,22 @@ void Muon::MuonTrackSummaryHelperTool::addDetailedTrackSummary( const Trk::Track currentChamberSummary = &trackSummary.m_chamberHitSummary.back(); currentChamberPars = pars; } - Trk::MuonTrackSummary::ChamberHitSummary::Projection& proj = - isFirst ? currentChamberSummary->m_first : currentChamberSummary->m_second; - ++proj.nholes; + if(!issTgc) { + Trk::MuonTrackSummary::ChamberHitSummary::Projection& proj = + isFirst ? currentChamberSummary->m_first : currentChamberSummary->m_second; + ++proj.nholes; + } else { +// sTgc holes keep track of phi and eta + if( m_idHelperTool->measuresPhi(id) ) { + ATH_MSG_VERBOSE(" counting sTGC phi hole "); + Trk::MuonTrackSummary::ChamberHitSummary::Projection& proj = currentChamberSummary->m_second; + ++proj.nholes; + } else { + ATH_MSG_VERBOSE(" counting sTGC eta hole "); + Trk::MuonTrackSummary::ChamberHitSummary::Projection& proj = currentChamberSummary->m_first; + ++proj.nholes; + } + } } continue; } @@ -562,9 +584,20 @@ void Muon::MuonTrackSummaryHelperTool::addDetailedTrackSummary( const Trk::Track } void Muon::MuonTrackSummaryHelperTool::updateHoleContent( Trk::MuonTrackSummary::ChamberHitSummary& chamberHitSummary ) const { -// ATH_MSG_INFO("updateHoleContent " << m_idHelperTool->toString(chamberHitSummary.chamberId()) +// ATH_MSG_DEBUG("updateHoleContent " << m_idHelperTool->toString(chamberHitSummary.chamberId()) // << " nphi " << chamberHitSummary.phiProjection().nhits << " holes " << chamberHitSummary.phiProjection().nholes // << " neta " << chamberHitSummary.etaProjection().nhits << " holes " << chamberHitSummary.etaProjection().nholes ); + + if( m_idHelperTool->issTgc(chamberHitSummary.chamberId()) ){ + ATH_MSG_DEBUG(" holes eta " << chamberHitSummary.etaProjection().nholes + << " phi " << chamberHitSummary.phiProjection().nholes ); + } + + if( m_idHelperTool->issTgc(chamberHitSummary.chamberId()) + || m_idHelperTool->isMM(chamberHitSummary.chamberId()) ){ + return; + } + bool isCsc = m_idHelperTool->isCsc(chamberHitSummary.chamberId()); int neta = isCsc ? 4 : 2; int nphi = isCsc ? 4 : 2; diff --git a/MuonSpectrometer/MuonReconstruction/MuonTrackMakers/MuonTrackMakerTools/MuonTrackFinderTools/src/MuonChamberHoleRecoveryTool.cxx b/MuonSpectrometer/MuonReconstruction/MuonTrackMakers/MuonTrackMakerTools/MuonTrackFinderTools/src/MuonChamberHoleRecoveryTool.cxx index 0bfbfaf05a0185185121e0eea0e574a3cb21117d..1e4a73712a2323c7643acf210b4f1898571ffb26 100644 --- a/MuonSpectrometer/MuonReconstruction/MuonTrackMakers/MuonTrackMakerTools/MuonTrackFinderTools/src/MuonChamberHoleRecoveryTool.cxx +++ b/MuonSpectrometer/MuonReconstruction/MuonTrackMakers/MuonTrackMakerTools/MuonTrackFinderTools/src/MuonChamberHoleRecoveryTool.cxx @@ -27,6 +27,10 @@ #include "MuonRIO_OnTrack/CscClusterOnTrack.h" #include "MuonRIO_OnTrack/RpcClusterOnTrack.h" #include "MuonRIO_OnTrack/TgcClusterOnTrack.h" +// New Small Wheel +#include "MuonRIO_OnTrack/sTgcClusterOnTrack.h" +#include "MuonRIO_OnTrack/MMClusterOnTrack.h" + #include "MuonCompetingRIOsOnTrack/CompetingMuonClustersOnTrack.h" #include "MuonPrepRawData/MuonCluster.h" @@ -44,6 +48,10 @@ #include "MuonIdHelpers/RpcIdHelper.h" #include "MuonIdHelpers/CscIdHelper.h" #include "MuonIdHelpers/TgcIdHelper.h" +// New Small Wheel +#include "MuonIdHelpers/sTgcIdHelper.h" +#include "MuonIdHelpers/MmIdHelper.h" + #include "EventPrimitives/EventPrimitivesHelpers.h" #include "GeoPrimitives/GeoPrimitivesToStringConverter.h" @@ -71,10 +79,6 @@ namespace Muon { - declareProperty("MdtPrepDataContainer", m_key_mdt="MDT_DriftCircles"); - declareProperty("CscPrepDataContainer", m_key_csc="CSC_Clusters"); - declareProperty("TgcPrepDataContainer", m_key_tgc="TGC_Measurements"); - declareProperty("RpcPrepDataContainer", m_key_rpc="RPC_Measurements"); declareProperty("MuonStationIntersectSvc", m_intersectSvc); declareProperty("Extrapolator", m_extrapolator); declareProperty("MdtRotCreator", m_mdtRotCreator); @@ -93,7 +97,7 @@ namespace Muon { } - MuonChamberHoleRecoveryTool::~MuonChamberHoleRecoveryTool(){} + MuonChamberHoleRecoveryTool::~MuonChamberHoleRecoveryTool() {} StatusCode MuonChamberHoleRecoveryTool::initialize() @@ -104,22 +108,25 @@ namespace Muon { ATH_CHECK( m_printer.retrieve() ); ATH_CHECK( m_extrapolator.retrieve() ); ATH_CHECK( m_mdtRotCreator.retrieve() ); - - if( !m_cscRotCreator.empty() ) { + + if ( !m_cscRotCreator.empty() ) { ATH_CHECK( m_cscRotCreator.retrieve() ); - }else{ + } else { ATH_MSG_INFO("CSC rot creation disabled" ); } - + ATH_CHECK( m_clusRotCreator.retrieve() ); ATH_CHECK( m_pullCalculator.retrieve() ); ATH_CHECK( m_idHelperTool.retrieve() ); ATH_CHECK( m_intersectSvc.retrieve() ); - + ATH_CHECK(m_key_mdt.initialize()); ATH_CHECK(m_key_csc.initialize()); ATH_CHECK(m_key_tgc.initialize()); ATH_CHECK(m_key_rpc.initialize()); + ATH_CHECK(m_key_stgc.initialize()); + ATH_CHECK(m_key_mm.initialize()); + return StatusCode::SUCCESS; } @@ -147,483 +154,602 @@ namespace Muon { // loop over track and calculate residuals const DataVector<const Trk::TrackStateOnSurface>* trkstates = track.trackStateOnSurfaces(); - if( !trkstates ){ + if ( !trkstates ) { ATH_MSG_DEBUG(" track without states, discarding track " ); return 0; } - if( msgLvl(MSG::DEBUG) ) { - msg(MSG::DEBUG) << " performing hole search track " << std::endl + if ( msgLvl(MSG::DEBUG) ) { + msg(MSG::DEBUG) << " performing hole search track " << std::endl << m_printer->print(track ); - if( msgLvl(MSG::VERBOSE) ){ + if ( msgLvl(MSG::VERBOSE) ) { msg(MSG::VERBOSE) << std::endl << m_printer->printMeasurements( track ); } msg(MSG::DEBUG) << endmsg; } - // vector to store states, the boolean indicated whether the state was create in this routine (true) or belongs to the track (false) - // If any new state is created, all states will be cloned and a new track will beformed from them. - std::vector< std::pair<bool,const Trk::TrackStateOnSurface* > > newStates; - newStates.reserve(trkstates->size()+5); - + // vector to store states, the boolean indicated whether the state was created in this routine (true) + // or belongs to the track (false). + // If any new state is created, all states will be cloned and a new track will be formed from them. + std::vector< std::pair<bool, const Trk::TrackStateOnSurface* > > newStates; + newStates.reserve(trkstates->size() + 5); + std::vector<const Trk::TrackStateOnSurface*> states; states.reserve(trkstates->size()); - states.insert(states.end(),trkstates->begin(),trkstates->end()); - + states.insert(states.end(), trkstates->begin(), trkstates->end()); + std::set<MuonStationIndex::StIndex> stations; Identifier currentMdtChId; unsigned int nholes = 0; // loop over TSOSs std::vector<const Trk::TrackStateOnSurface*>::const_iterator tsit = states.begin(); std::vector<const Trk::TrackStateOnSurface*>::const_iterator tsit_end = states.end(); - for( ; tsit!=tsit_end ; ++tsit ){ + for ( ; tsit != tsit_end ; ++tsit ) { - if( !*tsit ) continue; //sanity check + if ( !*tsit ) continue; //sanity check // drop existing holes on track - if( (*tsit)->type(Trk::TrackStateOnSurface::Hole) ) { + if ( (*tsit)->type(Trk::TrackStateOnSurface::Hole) ) { ATH_MSG_VERBOSE(" new TSOS is holes state, dropping " ); ++nholes; continue; } - + // check whether state is a measurement const Trk::TrackParameters* pars = (*tsit)->trackParameters(); - if( !pars ) { + if ( !pars ) { ATH_MSG_VERBOSE(" new TSOS without parameters, copying " ); - newStates.push_back( std::make_pair(false,*tsit) ); + newStates.push_back( std::make_pair(false, *tsit) ); continue; } - + // check whether state is a measurement const Trk::MeasurementBase* meas = (*tsit)->measurementOnTrack(); - if( !meas ) { + if ( !meas ) { ATH_MSG_VERBOSE(" new TSOS without measurement, copying " ); - newStates.push_back( std::make_pair(false,*tsit) ); + newStates.push_back( std::make_pair(false, *tsit) ); continue; } - + Identifier id = m_helperTool->getIdentifier(*meas); // Not a ROT, else it would have had an identifier. Keep the TSOS. - if( !id.is_valid() || !m_idHelperTool->mdtIdHelper().is_muon(id) ){ - if( msgLvl(MSG::VERBOSE)){ - if(!id.is_valid() ) ATH_MSG_VERBOSE(" new TSOS without valid identifier, copying " ); - else if( !m_idHelperTool->mdtIdHelper().is_muon(id) ) ATH_MSG_VERBOSE(" new TSOS with none muon identifier, copying " ); + if ( !id.is_valid() || !m_idHelperTool->mdtIdHelper().is_muon(id) ) { + if ( msgLvl(MSG::VERBOSE)) { + if (!id.is_valid() ) ATH_MSG_VERBOSE(" new TSOS without valid identifier, copying " ); + else if ( !m_idHelperTool->mdtIdHelper().is_muon(id) ) ATH_MSG_VERBOSE(" new TSOS with none muon identifier, copying " ); } - newStates.push_back( std::make_pair(false,*tsit) ); + newStates.push_back( std::make_pair(false, *tsit) ); continue; } - - if( m_idHelperTool->isMdt(id) ) { + + if ( m_idHelperTool->isMdt(id) ) { // get station index Identifier chId = m_idHelperTool->chamberId(id); MuonStationIndex::StIndex stIndex = m_idHelperTool->stationIndex(chId); stations.insert(stIndex); - + // MDT case: Run hole search in chamber. tsit = insertMdtsWithHoleSearch( tsit, tsit_end, newStates ); continue; - - }else if( m_idHelperTool->isTrigger(id) || m_idHelperTool->isCsc(id) || m_idHelperTool->isMM(id) || m_idHelperTool->issTgc(id) ) { - - // TGC case: Look for missing layers in chamber, add them to track + } else if ( m_idHelperTool->isTrigger(id) || m_idHelperTool->isCsc(id) || m_idHelperTool->isMM(id) || m_idHelperTool->issTgc(id) ) { + // Non-MDT case: Look for missing layers in chamber, add them to track tsit = insertClustersWithHoleSearch( tsit, tsit_end, newStates ); continue; - - }else{ + } else { ATH_MSG_WARNING(" unknown Identifier " ); } - + } - - if( newStates.size() + nholes < states.size() ) + + if ( newStates.size() + nholes < states.size() ) ATH_MSG_DEBUG("Invalid number of states: collected " << newStates.size() - << " holes " << nholes << " original " << states.size() ); - + << " holes " << nholes << " original " << states.size() ); + // NOTE: no return ? + ATH_MSG_DEBUG(" track has stations: " << stations.size() << " original states " << states.size() << " new states " << newStates.size() ); // states were added, create a new track DataVector<const Trk::TrackStateOnSurface>* trackStateOnSurfaces = new DataVector<const Trk::TrackStateOnSurface>(); trackStateOnSurfaces->reserve( newStates.size() ); - - std::vector< std::pair<bool,const Trk::TrackStateOnSurface* > >::iterator nit = newStates.begin(); - std::vector< std::pair<bool,const Trk::TrackStateOnSurface* > >::iterator nit_end = newStates.end(); - for( ;nit!=nit_end;++nit ){ + + std::vector< std::pair<bool, const Trk::TrackStateOnSurface* > >::iterator nit = newStates.begin(); + std::vector< std::pair<bool, const Trk::TrackStateOnSurface* > >::iterator nit_end = newStates.end(); + for ( ; nit != nit_end; ++nit ) { // add states. If nit->first is true we have a new state. If it is false the state is from the old track and has to be cloned trackStateOnSurfaces->push_back( nit->first ? nit->second : nit->second->clone() ); } - Trk::Track* newTrack = new Trk::Track( track.info(), trackStateOnSurfaces, track.fitQuality() ? track.fitQuality()->clone():0 ); + Trk::Track* newTrack = new Trk::Track( track.info(), trackStateOnSurfaces, track.fitQuality() ? track.fitQuality()->clone() : 0 ); - return newTrack; + return newTrack; } -std::vector<const Trk::TrackStateOnSurface*>::const_iterator -MuonChamberHoleRecoveryTool::insertClustersWithHoleSearch( std::vector<const Trk::TrackStateOnSurface*>::const_iterator tsit, - std::vector<const Trk::TrackStateOnSurface*>::const_iterator tsit_end, - std::vector< std::pair<bool,const Trk::TrackStateOnSurface* > >& states + std::vector<const Trk::TrackStateOnSurface*>::const_iterator + MuonChamberHoleRecoveryTool::insertClustersWithHoleSearch( std::vector<const Trk::TrackStateOnSurface*>::const_iterator tsit, + std::vector<const Trk::TrackStateOnSurface*>::const_iterator tsit_end, + std::vector< std::pair<bool, const Trk::TrackStateOnSurface* > >& states ) const { // iterator should point to a valid element - if( tsit == tsit_end ) { + if ( tsit == tsit_end ) { ATH_MSG_WARNING(" iterator pointing to end of vector, this should no happen " ); return --tsit; } - + // check whether state is a measurement const Trk::MeasurementBase* meas = (*tsit)->measurementOnTrack(); const Trk::TrackParameters* pars = (*tsit)->trackParameters(); - if( !meas || !pars ){ - if( tsit+1 == tsit_end ) --tsit; + if ( !meas || !pars ) { + if ( tsit + 1 == tsit_end ) --tsit; return tsit; } - + // loop over states until we reached the last tgc hit in this detector element // keep trackof the identifiers and the states std::set<Identifier> layIds; Identifier* detectorElId = 0; // pointer to detector element ID, created when finding the first TGC - std::vector< std::pair<bool,const Trk::TrackStateOnSurface* > > newStates; - for( ;tsit!=tsit_end;++tsit ){ + std::vector< std::pair<bool, const Trk::TrackStateOnSurface* > > newStates; + for ( ; tsit != tsit_end; ++tsit ) { + + if ( !*tsit ) continue; - if( !*tsit ) continue; - // skip existing holes as they will be recalculated - if( (*tsit)->type(Trk::TrackStateOnSurface::Hole) ) continue; + if ( (*tsit)->type(Trk::TrackStateOnSurface::Hole) ) continue; // check whether state is a measurement, keep if not const Trk::MeasurementBase* meas = (*tsit)->measurementOnTrack(); - if( !meas ) { - newStates.push_back( std::make_pair(false,*tsit) ); + if ( !meas ) { + newStates.push_back( std::make_pair(false, *tsit) ); continue; } - + // get identifier, keep state if it has no identifier. Identifier id = m_helperTool->getIdentifier(*meas); - if( !id.is_valid() ) { - newStates.push_back( std::make_pair(false,*tsit) ); + if ( !id.is_valid() ) { + newStates.push_back( std::make_pair(false, *tsit) ); continue; } // get chamber Id Identifier detElId = m_idHelperTool->detElId(id); - if( !detectorElId ) detectorElId = new Identifier( detElId ); - + if ( !detectorElId ) detectorElId = new Identifier( detElId ); + // check whether we are still in the same chamber, stop loop if not - if( detElId != *detectorElId ) break; - - // sanity check, this SHOULD be a RPC, TGC or CSC measurement - if( !( m_idHelperTool->isTrigger(id) || m_idHelperTool->isCsc(id) || m_idHelperTool->isMM(id) || m_idHelperTool->issTgc(id) ) ){ - newStates.push_back( std::make_pair(false,*tsit) ); + if ( detElId != *detectorElId ) break; + + // sanity check, this SHOULD be a RPC, TGC, MM, STGC or CSC measurement + if ( !( m_idHelperTool->isTrigger(id) || m_idHelperTool->isCsc(id) || m_idHelperTool->isMM(id) || m_idHelperTool->issTgc(id) ) ) { + newStates.push_back( std::make_pair(false, *tsit) ); ATH_MSG_WARNING(" Identifier should be TGC/RPC/CSC/MM/STGC: " << m_idHelperTool->toString(id) ); continue; } - - + + // split competing ROTs into constituents const CompetingMuonClustersOnTrack* comp = dynamic_cast<const CompetingMuonClustersOnTrack*>(meas); - if( comp ) { + if ( comp ) { std::vector<const MuonClusterOnTrack*>::const_iterator clit = comp->containedROTs().begin(); std::vector<const MuonClusterOnTrack*>::const_iterator clit_end = comp->containedROTs().end(); - for( ;clit!=clit_end;++clit ){ + for ( ; clit != clit_end; ++clit ) { // get layer Identifier and insert it into set Identifier layId = m_idHelperTool->layerId( (*clit)->identify() ); layIds.insert(layId); } - }else{ + } else { // get layer Identifier and insert it into set Identifier layId = m_idHelperTool->layerId(id); layIds.insert(layId); } - if( msgLvl(MSG::VERBOSE) ) { + if ( msgLvl(MSG::VERBOSE) ) { msg(MSG::VERBOSE) << " new hit " << m_idHelperTool->toString(id); - if( comp ) msg(MSG::VERBOSE) << " competing, layers: " << layIds.size(); + if ( comp ) msg(MSG::VERBOSE) << " competing, layers: " << layIds.size(); msg(MSG::VERBOSE) << endmsg; } - newStates.push_back( std::make_pair(false,*tsit) ); + newStates.push_back( std::make_pair(false, *tsit) ); } - + // create holes - if( detectorElId ){ - createHoleTSOSsForClusterChamber( *detectorElId,*pars,layIds,newStates ); + if ( detectorElId ) { + createHoleTSOSsForClusterChamber( *detectorElId, *pars, layIds, newStates ); delete detectorElId; - }else{ + } else { ATH_MSG_WARNING(" no chamber identifier set, this should not happen " ); } - + // sort all states in this chamber - std::stable_sort(newStates.begin(),newStates.end(),SortTSOSByDistanceToPars(pars) ); - - // insert the states into - states.insert( states.end(),newStates.begin(),newStates.end() ); - + std::stable_sort(newStates.begin(), newStates.end(), SortTSOSByDistanceToPars(pars) ); + + // insert the states into + states.insert( states.end(), newStates.begin(), newStates.end() ); + // iterator should point to the last TGC in this chamber return --tsit; } - -std::vector<const Trk::TrackStateOnSurface*>::const_iterator -MuonChamberHoleRecoveryTool::insertMdtsWithHoleSearch( std::vector<const Trk::TrackStateOnSurface*>::const_iterator tsit, - std::vector<const Trk::TrackStateOnSurface*>::const_iterator tsit_end, - std::vector< std::pair<bool,const Trk::TrackStateOnSurface* > >& states + std::vector<const Trk::TrackStateOnSurface*>::const_iterator + MuonChamberHoleRecoveryTool::insertMdtsWithHoleSearch( std::vector<const Trk::TrackStateOnSurface*>::const_iterator tsit, + std::vector<const Trk::TrackStateOnSurface*>::const_iterator tsit_end, + std::vector< std::pair<bool, const Trk::TrackStateOnSurface* > >& states ) const { // iterator should point to a valid element - if( tsit == tsit_end ) { + if ( tsit == tsit_end ) { ATH_MSG_WARNING(" iterator pointing to end of vector, this should no happen " ); return --tsit; } - + // check whether state is a measurement const Trk::MeasurementBase* meas = (*tsit)->measurementOnTrack(); const Trk::TrackParameters* pars = (*tsit)->trackParameters(); - if( !meas || !pars ){ - if( tsit+1 == tsit_end ) --tsit; + if ( !meas || !pars ) { + if ( tsit + 1 == tsit_end ) --tsit; return tsit; } - + // this should be a MDT const MdtDriftCircleOnTrack* mdtFirst = dynamic_cast<const MdtDriftCircleOnTrack*>(meas); - if( !mdtFirst ){ + if ( !mdtFirst ) { ATH_MSG_WARNING("Bad hit: not a MDT " << m_idHelperTool->toString(m_helperTool->getIdentifier(*meas)) ); - if( tsit+1 == tsit_end ) --tsit; + if ( tsit + 1 == tsit_end ) --tsit; return tsit; } - + // get chamber identifier MuonStationIndex::ChIndex currentChIndex = m_idHelperTool->chamberIndex(mdtFirst->identify()); Identifier chId = m_idHelperTool->chamberId(mdtFirst->identify()); - + // to correctly handle low pt tracks average the direction of the track in the chamber const Trk::TrackParameters* parsLast = 0; - + // loop over states until we reached the last mdt hit in this chamber // keep trackof the identifiers and the states std::set<Identifier> ids; - std::vector< std::pair<bool,const Trk::TrackStateOnSurface* > > newStates; - for( ;tsit!=tsit_end;++tsit ){ + std::vector< std::pair<bool, const Trk::TrackStateOnSurface* > > newStates; + for ( ; tsit != tsit_end; ++tsit ) { - if( !*tsit ) continue; + if ( !*tsit ) continue; // skip existing holes as they will be recalculated - if( (*tsit)->type(Trk::TrackStateOnSurface::Hole) ) continue; - + if ( (*tsit)->type(Trk::TrackStateOnSurface::Hole) ) continue; + // check whether state is a measurement const Trk::MeasurementBase* meas = (*tsit)->measurementOnTrack(); - if( !meas ) { - newStates.push_back( std::make_pair(false,*tsit) ); + if ( !meas ) { + newStates.push_back( std::make_pair(false, *tsit) ); continue; } - + // don't break on pseudo measurements const Trk::PseudoMeasurementOnTrack* psmeas = dynamic_cast<const Trk::PseudoMeasurementOnTrack*>(meas); - if( psmeas ){ - newStates.push_back( std::make_pair(false,*tsit) ); + if ( psmeas ) { + newStates.push_back( std::make_pair(false, *tsit) ); continue; } // only use MDTs const MdtDriftCircleOnTrack* mdt = dynamic_cast<const MdtDriftCircleOnTrack*>(meas); - if( !mdt ) break; - + if ( !mdt ) break; + const Identifier& id = mdt->identify(); - + // check whether we are still in the same chamber layer - if( currentChIndex != m_idHelperTool->chamberIndex(id) ) break; + if ( currentChIndex != m_idHelperTool->chamberIndex(id) ) break; ids.insert(id); // insert identifier - newStates.push_back( std::make_pair(false,*tsit) ); + newStates.push_back( std::make_pair(false, *tsit) ); - // get pointer to last parameters + // get pointer to last parameters parsLast = (*tsit)->trackParameters(); } - + // check if chamber index is already processed bool doHoleSearch = true; - if( m_checkForBadSort ){ - if( m_chamberLayersOnTrack.count(currentChIndex) ){ - if( m_detectBadSort ) ATH_MSG_WARNING("Detected badly sorted track, not adding holes in current chamber"); + if ( m_checkForBadSort ) { + if ( m_chamberLayersOnTrack.count(currentChIndex) ) { + if ( m_detectBadSort ) ATH_MSG_WARNING("Detected badly sorted track, not adding holes in current chamber"); else ATH_MSG_DEBUG("Detected badly sorted track, not adding holes in current chamber"); doHoleSearch = false; - }else{ + } else { m_chamberLayersOnTrack.insert(currentChIndex); } } - - if( doHoleSearch ){ - + + if ( doHoleSearch ) { + // ensure that we are not passing in the same parameters - if( parsLast == pars ) parsLast = 0; - + if ( parsLast == pars ) parsLast = 0; + // create holes - createHoleTSOSsForMdtChamber( chId,*pars, parsLast,ids,newStates ); + createHoleTSOSsForMdtChamber( chId, *pars, parsLast, ids, newStates ); - ATH_MSG_DEBUG(" Chamber " << m_idHelperTool->toStringChamber(chId) + ATH_MSG_DEBUG(" Chamber " << m_idHelperTool->toStringChamber(chId) << " has hits " << ids.size() << " new states " << newStates.size() - ids.size() ); - + // sort all states in this chamber - std::stable_sort(newStates.begin(),newStates.end(),SortTSOSByDistanceToPars(pars) ); + std::stable_sort(newStates.begin(), newStates.end(), SortTSOSByDistanceToPars(pars) ); } - - // insert the states into - states.insert( states.end(),newStates.begin(),newStates.end() ); - + + // insert the states into + states.insert( states.end(), newStates.begin(), newStates.end() ); + // iterator should point to the last MDT in this chamber return --tsit; } - + void MuonChamberHoleRecoveryTool::createHoleTSOSsForClusterChamber( const Identifier& detElId, const Trk::TrackParameters& pars, - std::set<Identifier>& layIds, - std::vector< std::pair<bool,const Trk::TrackStateOnSurface* > >& states ) const { + std::set<Identifier>& layIds, + std::vector< std::pair<bool, const Trk::TrackStateOnSurface* > >& states ) const { + + ATH_MSG_VERBOSE(" performing holes search in chamber " << m_idHelperTool->toString(detElId) ); + + if ( m_idHelperTool->isCsc(detElId) ) createHoleTSOSsForCscChamber(detElId, pars, layIds, states); + else if ( m_idHelperTool->isTgc(detElId) ) createHoleTSOSsForTgcChamber(detElId, pars, layIds, states); + else if ( m_idHelperTool->isRpc(detElId) ) createHoleTSOSsForRpcChamber(detElId, pars, layIds, states); + else if ( m_idHelperTool->isMM(detElId) ) createHoleTSOSsForMmChamber(detElId, pars, layIds, states); + else if ( m_idHelperTool->issTgc(detElId) ) createHoleTSOSsForStgcChamber(detElId, pars, layIds, states); + // else if( m_idHelperTool->isMM(detElId) || m_idHelperTool->issTgc(detElId) ) ATH_MSG_DEBUG(" NSW hole recovery not implemented yet"); + else ATH_MSG_WARNING(" unexpected Identifier, cannot perform holes search" ); + } - ATH_MSG_VERBOSE(" performing holes search in chamber " << m_idHelperTool->toString(detElId) ); - if( m_idHelperTool->isCsc(detElId) ) createHoleTSOSsForCscChamber(detElId,pars,layIds,states); - else if( m_idHelperTool->isTgc(detElId) ) createHoleTSOSsForTgcChamber(detElId,pars,layIds,states); - else if( m_idHelperTool->isRpc(detElId) ) createHoleTSOSsForRpcChamber(detElId,pars,layIds,states); - else if( m_idHelperTool->isMM(detElId) || m_idHelperTool->issTgc(detElId) ) ATH_MSG_DEBUG(" NSW hole recovery not implemented yet"); - else ATH_MSG_WARNING(" unexpected Identifier, cannot perform holes search" ); + void MuonChamberHoleRecoveryTool::createHoleTSOSsForStgcChamber( const Identifier& detElId, const Trk::TrackParameters& pars, + std::set<Identifier>& layIds, + std::vector< std::pair<bool, const Trk::TrackStateOnSurface* > >& states ) const { + // get detector element + const MuonGM::sTgcReadoutElement* detEl = m_detMgr->getsTgcReadoutElement(detElId); + if ( !detEl ) { + ATH_MSG_WARNING(" No detector element found for " << m_idHelperTool->toStringChamber(detElId) ); + return; + } + + // get list of layers with a hole + unsigned int nGasGaps = detEl->numberOfLayers(false); + int multilayer = m_idHelperTool->stgcIdHelper().multilayer(detElId); + LayerHoleVec holeVec = holesInClusterChamber( pars, detElId, layIds, nGasGaps ); + if ( holeVec.empty() ) return; + + // create identifiers from LayerHoleVec + std::set<Identifier> chHoles; + LayerHoleVec::iterator it = holeVec.begin(); + LayerHoleVec::iterator it_end = holeVec.end(); + + Identifier layId = m_idHelperTool->stgcIdHelper().channelID(detElId, multilayer, it->first, 1, 1); + bool measuresPhi1 = m_idHelperTool->measuresPhi(layId); + layId = m_idHelperTool->stgcIdHelper().channelID(detElId, multilayer, it->first, 0, 1); + bool measuresPhi0 = m_idHelperTool->measuresPhi(layId); + layId = m_idHelperTool->stgcIdHelper().channelID(detElId, multilayer, it->first, 2, 1); + bool measuresPhi2 = m_idHelperTool->measuresPhi(layId); + + ATH_MSG_DEBUG(" createHoleTSOSsFor StgcChamber measuresPhi type 0" << (int) measuresPhi0 << " measuresPhi type 1 " << (int) measuresPhi1 << " measuresPhi type 2 " << (int) measuresPhi2 ); + for ( ; it != it_end; ++it ) { + // the second gas gap of the three layer stations does not have a phi measurement + // type = 0 1 and 2 pad/eta/wires + // Identifier id = m_idHelper->channelID(parentId, m_idHelper->multilayer(layid), m_idHelper->gasGap(layid),type,1,m_checkIds); + if (it->second == 0) { + // eta strip + chHoles.insert( m_idHelperTool->stgcIdHelper().channelID(detElId, multilayer, it->first, 1, 1) ); + } else { + if (abs(m_idHelperTool->stationEta(detElId)) > 2) { + // wires + chHoles.insert( m_idHelperTool->stgcIdHelper().channelID(detElId, multilayer, it->first, 2, 1) ); + } else { + // pads + chHoles.insert( m_idHelperTool->stgcIdHelper().channelID(detElId, multilayer, it->first, 0, 1) ); + } + } + } + + if ( chHoles.empty() ) return; + + // loop over Tgc Prds and try to find prds of tubes with holes + const sTgcPrepDataCollection* prdCol = findStgcPrdCollection( detElId ); + if ( !prdCol ) { + ATH_MSG_DEBUG(" Retrieval of sTgcPrepDataCollection failed!! " ); + return; + } + + // copy TGC prds into generic MuonCluster vector + std::vector<const MuonCluster*> prds; + prds.reserve(prdCol->size()); + sTgcPrepDataCollection::const_iterator hit = prdCol->begin(); + sTgcPrepDataCollection::const_iterator hit_end = prdCol->end(); + for ( ; hit != hit_end; ++hit ) { + if ( detElId == m_idHelperTool->detElId( (*hit)->identify() ) ) prds.push_back(*hit); + } + + createHoleTSOSsForClusterChamber( detElId, pars, layIds, chHoles, prds, states ); + + return ; + } + + void MuonChamberHoleRecoveryTool::createHoleTSOSsForMmChamber( const Identifier& detElId, const Trk::TrackParameters& pars, + std::set<Identifier>& layIds, + std::vector< std::pair<bool, const Trk::TrackStateOnSurface* > >& states ) const { + // get detector element + const MuonGM::MMReadoutElement* detEl = m_detMgr->getMMReadoutElement(detElId); + if ( !detEl ) { + ATH_MSG_WARNING(" No detector element found for " << m_idHelperTool->toStringChamber(detElId) ); + return; + } + + // get list of layers with a hole + unsigned int nGasGaps = detEl->numberOfLayers(false); + int multilayer = m_idHelperTool->mmIdHelper().multilayer(detElId); + LayerHoleVec holeVec = holesInClusterChamber( pars, detElId, layIds, nGasGaps ); + if ( holeVec.empty() ) return; + + // create identifiers from LayerHoleVec + std::set<Identifier> chHoles; + LayerHoleVec::iterator it = holeVec.begin(); + LayerHoleVec::iterator it_end = holeVec.end(); + for ( ; it != it_end; ++it ) { + // eta strip + if (it->second == 0) chHoles.insert( m_idHelperTool->mmIdHelper().channelID(detElId, multilayer, it->first, 1) ); + } + + if ( chHoles.empty() ) return; + + // loop over MM Prds and try to find prds of tubes with holes + const MMPrepDataCollection* prdCol = findMmPrdCollection( detElId ); + if ( !prdCol ) { + ATH_MSG_DEBUG(" Retrieval of MMPrepDataCollection failed!! " ); + return; + } + + // copy MM prds into generic MuonCluster vector + std::vector<const MuonCluster*> prds; + prds.reserve(prdCol->size()); + MMPrepDataCollection::const_iterator hit = prdCol->begin(); + MMPrepDataCollection::const_iterator hit_end = prdCol->end(); + for ( ; hit != hit_end; ++hit ) { + if ( detElId == m_idHelperTool->detElId( (*hit)->identify() ) ) prds.push_back(*hit); + } + + createHoleTSOSsForClusterChamber( detElId, pars, layIds, chHoles, prds, states ); + + return ; } void MuonChamberHoleRecoveryTool::createHoleTSOSsForCscChamber( const Identifier& detElId, const Trk::TrackParameters& pars, - std::set<Identifier>& layIds, - std::vector< std::pair<bool,const Trk::TrackStateOnSurface* > >& states ) const { + std::set<Identifier>& layIds, + std::vector< std::pair<bool, const Trk::TrackStateOnSurface* > >& states ) const { // get list of layers with a hole unsigned int nGasGaps = 4; - LayerHoleVec holeVec = holesInClusterChamber( pars,detElId,layIds, nGasGaps ); - if( holeVec.empty() ) return; - + LayerHoleVec holeVec = holesInClusterChamber( pars, detElId, layIds, nGasGaps ); + if ( holeVec.empty() ) return; + // create identifiers from LayerHoleVec std::set<Identifier> chHoles; LayerHoleVec::iterator it = holeVec.begin(); LayerHoleVec::iterator it_end = holeVec.end(); - for( ;it!=it_end;++it ){ + for ( ; it != it_end; ++it ) { Identifier parentId = m_idHelperTool->cscIdHelper().parentID(detElId); - Identifier layId = m_idHelperTool->cscIdHelper().channelID(parentId,2,it->first,it->second,1); + Identifier layId = m_idHelperTool->cscIdHelper().channelID(parentId, 2, it->first, it->second, 1); bool measuresPhi = m_idHelperTool->measuresPhi(layId); // sanity check this should always be true!!! - if( measuresPhi != (bool)it->second ){ - ATH_MSG_WARNING(" Problem spotted creating CSC identifier, measures Phi not correctly set " ); + if ( measuresPhi != (bool)it->second ) { + ATH_MSG_WARNING(" Problem spotted creating CSC identifier, measures Phi not correctly set " ); continue; } ATH_MSG_VERBOSE(" adding hole layer " << m_idHelperTool->toString(layId) - << " layer " << it->first << " measPhi " << it->second ); + << " layer " << it->first << " measPhi " << it->second ); chHoles.insert( layId ); } - - if( chHoles.empty() ) return; - + + if ( chHoles.empty() ) return; + // loop over CSC Prds and try to find prds of tubes with holes const CscPrepDataCollection* prdCol = findCscPrdCollection( detElId ); - if( !prdCol ) { + if ( !prdCol ) { ATH_MSG_DEBUG(" Retrieval of CscPrepDataCollection failed!! " ); //return; } - + // copy CSC prds into generic MuonCluster vector std::vector<const MuonCluster*> prds; - if( prdCol ){ + if ( prdCol ) { prds.reserve(prdCol->size()); - prds.insert(prds.begin(),prdCol->begin(),prdCol->end()); + prds.insert(prds.begin(), prdCol->begin(), prdCol->end()); } - createHoleTSOSsForClusterChamber( detElId, pars, layIds, chHoles, prds, states ); + createHoleTSOSsForClusterChamber( detElId, pars, layIds, chHoles, prds, states ); } void MuonChamberHoleRecoveryTool::createHoleTSOSsForTgcChamber( const Identifier& detElId, const Trk::TrackParameters& pars, - std::set<Identifier>& layIds, - std::vector< std::pair<bool,const Trk::TrackStateOnSurface* > >& states ) const { - + std::set<Identifier>& layIds, + std::vector< std::pair<bool, const Trk::TrackStateOnSurface* > >& states ) const { + // get detector element const MuonGM::TgcReadoutElement* detEl = m_detMgr->getTgcReadoutElement(detElId); - if( !detEl ){ - ATH_MSG_WARNING(" No detector element found for " << m_idHelperTool->toStringChamber(detElId) ); + if ( !detEl ) { + ATH_MSG_WARNING(" No detector element found for " << m_idHelperTool->toStringChamber(detElId) ); return; - } - + } + // get list of layers with a hole unsigned int nGasGaps = detEl->Ngasgaps(); - LayerHoleVec holeVec = holesInClusterChamber( pars,detElId,layIds, nGasGaps ); - if( holeVec.empty() ) return; - + LayerHoleVec holeVec = holesInClusterChamber( pars, detElId, layIds, nGasGaps ); + if ( holeVec.empty() ) return; + // create identifiers from LayerHoleVec std::set<Identifier> chHoles; LayerHoleVec::iterator it = holeVec.begin(); LayerHoleVec::iterator it_end = holeVec.end(); - for( ;it!=it_end;++it ){ + for ( ; it != it_end; ++it ) { // the second gas gap of the three layer stations does not have a phi measurement - if( nGasGaps == 3 && it->first == 2 && it->second ) continue; - - chHoles.insert( m_idHelperTool->tgcIdHelper().channelID(detElId,it->first,it->second,1) ); + if ( nGasGaps == 3 && it->first == 2 && it->second ) continue; + + chHoles.insert( m_idHelperTool->tgcIdHelper().channelID(detElId, it->first, it->second, 1) ); } - if( chHoles.empty() ) return; - - // loop over Mdt Prds and try to find prds of tubes with holes + if ( chHoles.empty() ) return; + + // loop over Tgc Prds and try to find prds of tubes with holes const TgcPrepDataCollection* prdCol = findTgcPrdCollection( detElId ); - if( !prdCol ) { + if ( !prdCol ) { ATH_MSG_DEBUG(" Retrieval of TgcPrepDataCollection failed!! " ); return; } - + // copy TGC prds into generic MuonCluster vector std::vector<const MuonCluster*> prds; prds.reserve(prdCol->size()); TgcPrepDataCollection::const_iterator hit = prdCol->begin(); TgcPrepDataCollection::const_iterator hit_end = prdCol->end(); - for( ;hit!=hit_end;++hit ){ - if( detElId == m_idHelperTool->detElId( (*hit)->identify() ) ) prds.push_back(*hit); + for ( ; hit != hit_end; ++hit ) { + if ( detElId == m_idHelperTool->detElId( (*hit)->identify() ) ) prds.push_back(*hit); } //prds.insert(prds.begin(),prdCol->begin(),prdCol->end()); - - createHoleTSOSsForClusterChamber( detElId, pars, layIds, chHoles, prds, states ); - + + createHoleTSOSsForClusterChamber( detElId, pars, layIds, chHoles, prds, states ); + } void MuonChamberHoleRecoveryTool::createHoleTSOSsForRpcChamber( const Identifier& detElId, const Trk::TrackParameters& pars, - std::set<Identifier>& layIds, - std::vector< std::pair<bool,const Trk::TrackStateOnSurface* > >& states ) const { + std::set<Identifier>& layIds, + std::vector< std::pair<bool, const Trk::TrackStateOnSurface* > >& states ) const { // get list of layers with a hole unsigned int nGasGaps = 2; - LayerHoleVec holeVec = holesInClusterChamber( pars,detElId,layIds, nGasGaps ); - if( holeVec.empty() ) return; + LayerHoleVec holeVec = holesInClusterChamber( pars, detElId, layIds, nGasGaps ); + if ( holeVec.empty() ) return; const MuonGM::RpcReadoutElement* detEl = m_detMgr->getRpcReadoutElement(detElId); - if( !detEl ){ + if ( !detEl ) { ATH_MSG_WARNING("Could not find ReadoutElement for " << m_idHelperTool->toString(detElId) ); return; } int dbZ = detEl->getDoubletZ(); int dbPhi = detEl->getDoubletPhi(); - + ATH_MSG_DEBUG("Looking up RPC structure: dbZ " << dbZ << " dbPhi " << dbPhi << " nphi gp " << detEl->Nphigasgaps()); - + // create identifiers from LayerHoleVec std::set<Identifier> chHoles; LayerHoleVec::iterator it = holeVec.begin(); LayerHoleVec::iterator it_end = holeVec.end(); - for( ;it!=it_end;++it ){ - Identifier clusId = m_idHelperTool->rpcIdHelper().channelID(detElId,dbZ,dbPhi,it->first,it->second,1); + for ( ; it != it_end; ++it ) { + Identifier clusId = m_idHelperTool->rpcIdHelper().channelID(detElId, dbZ, dbPhi, it->first, it->second, 1); chHoles.insert( clusId ); ATH_MSG_VERBOSE("Adding hole " << m_idHelperTool->toString(clusId) ); } - - // loop over Mdt Prds and try to find prds of tubes with holes + + // loop over Rpc Prds and try to find prds of tubes with holes const RpcPrepDataCollection* prdCol = findRpcPrdCollection( detElId ); - if( !prdCol ) { + if ( !prdCol ) { ATH_MSG_DEBUG(" Retrieval of RpcPrepDataCollection failed!! " ); return; } - + // copy RPC prds into generic MuonCluster vector std::vector<const MuonCluster*> prds; prds.reserve(prdCol->size()); RpcPrepDataCollection::const_iterator hit = prdCol->begin(); RpcPrepDataCollection::const_iterator hit_end = prdCol->end(); - for( ;hit!=hit_end;++hit ){ - if( detElId == m_idHelperTool->detElId( (*hit)->identify() ) ) prds.push_back(*hit); + for ( ; hit != hit_end; ++hit ) { + if ( detElId == m_idHelperTool->detElId( (*hit)->identify() ) ) prds.push_back(*hit); } //prds.insert(prds.begin(),prdCol->begin(),prdCol->end()); - - createHoleTSOSsForClusterChamber( detElId, pars, layIds, chHoles, prds, states ); + + createHoleTSOSsForClusterChamber( detElId, pars, layIds, chHoles, prds, states ); } @@ -634,207 +760,216 @@ MuonChamberHoleRecoveryTool::insertMdtsWithHoleSearch( std::vector<const Trk::Tr }; void MuonChamberHoleRecoveryTool::createHoleTSOSsForClusterChamber( const Identifier& detElId, const Trk::TrackParameters& pars, - std::set<Identifier>& layIds, std::set<Identifier>& chHoles, + std::set<Identifier>& layIds, std::set<Identifier>& chHoles, const std::vector<const MuonCluster*>& prds, - std::vector< std::pair<bool,const Trk::TrackStateOnSurface* > >& states ) const { + std::vector< std::pair<bool, const Trk::TrackStateOnSurface* > >& states ) const { - if( msgLvl(MSG::DEBUG) ) { - msg() << " chamber " << m_idHelperTool->toString(detElId) + if ( msgLvl(MSG::DEBUG) ) { + msg() << " chamber " << m_idHelperTool->toString(detElId) << " PRDs in chamber " << prds.size() << " holes " << chHoles.size(); - if( msgLvl(MSG::VERBOSE) ) { - if( pars.covariance() ) msg() << MSG::VERBOSE << " extrapolation error " << Amg::error(*pars.covariance(),Trk::locX); + if ( msgLvl(MSG::VERBOSE) ) { + if ( pars.covariance() ) msg() << MSG::VERBOSE << " extrapolation error " << Amg::error(*pars.covariance(), Trk::locX); } msg() << endmsg; } std::vector<const Trk::TrackParameters*> parsToBeDeleted; - parsToBeDeleted.reserve(prds.size()+10); - - typedef std::map<Identifier,PullCluster> ClusterLayerMap; + parsToBeDeleted.reserve(prds.size() + 10); + + typedef std::map<Identifier, PullCluster> ClusterLayerMap; ClusterLayerMap clusterLayerMap; - + const Trk::TrkDetElementBase* detEl = 0; - if( m_idHelperTool->isTgc(detElId) ) detEl = m_detMgr->getTgcReadoutElement(detElId); - else if( m_idHelperTool->isRpc(detElId) ) detEl = m_detMgr->getRpcReadoutElement(detElId); - else if( m_idHelperTool->isCsc(detElId) ) detEl = m_detMgr->getCscReadoutElement(detElId); + if ( m_idHelperTool->isTgc(detElId) ) detEl = m_detMgr->getTgcReadoutElement(detElId); + else if ( m_idHelperTool->isRpc(detElId) ) detEl = m_detMgr->getRpcReadoutElement(detElId); + else if ( m_idHelperTool->isCsc(detElId) ) detEl = m_detMgr->getCscReadoutElement(detElId); + // New Small Wheel + else if ( m_idHelperTool->issTgc(detElId) ) detEl = m_detMgr->getsTgcReadoutElement(detElId); + else if ( m_idHelperTool->isMM(detElId) ) detEl = m_detMgr->getMMReadoutElement(detElId); unsigned int nNewHits = 0; // loop over prds std::vector<const MuonCluster*>::const_iterator it = prds.begin(); std::vector<const MuonCluster*>::const_iterator it_end = prds.end(); - for( ; it!=it_end;++it ){ + for ( ; it != it_end; ++it ) { // get Identifier, check whether we have a hole in that layer. If not go to next cluster const MuonCluster& clus = **it; - if( !detEl ) detEl = clus.detectorElement(); + if ( !detEl ) detEl = clus.detectorElement(); const Identifier& id = clus.identify(); Identifier layId = m_idHelperTool->layerId(id); - + // do not add hits in layers that are already on track - if( layIds.count(layId) ){ - continue; + if ( layIds.count(layId) ) { + continue; } const Trk::Surface& surf = clus.detectorElement()->surface(id); - + const Trk::TrackParameters* exPars = 0; - if( pars.associatedSurface() == surf ) { + if ( pars.associatedSurface() == surf ) { ATH_MSG_VERBOSE(" Same surface, cloning parameters " ); exPars = &pars; - }else{ - exPars = m_extrapolator->extrapolateDirectly(pars,surf,Trk::anyDirection,false,Trk::muon); - if( !exPars ) { + } else { + exPars = m_extrapolator->extrapolateDirectly(pars, surf, Trk::anyDirection, false, Trk::muon); + if ( !exPars ) { ATH_MSG_WARNING(" Propagation cluster PRD failed!! "); continue; } //parsToBeDeleted.push_back(exPars); } - if( msgLvl(MSG::VERBOSE) ) { - msg() << MSG::VERBOSE << " --- " << m_idHelperTool->toString(id) << " error " << Amg::error(clus.localCovariance(),Trk::locX); - if( exPars->covariance() ) msg() << MSG::VERBOSE << " measured parameters, error " << Amg::error(*exPars->covariance(),Trk::locX); + if ( msgLvl(MSG::VERBOSE) ) { + msg() << MSG::VERBOSE << " --- " << m_idHelperTool->toString(id) << " error " << Amg::error(clus.localCovariance(), Trk::locX); + if ( exPars->covariance() ) msg() << MSG::VERBOSE << " measured parameters, error " << Amg::error(*exPars->covariance(), Trk::locX); msg() << endmsg; } - + const MuonClusterOnTrack* clusterOnTrack = 0; - if( m_idHelperTool->isTrigger(clus.identify()) ){ + if ( m_idHelperTool->isTrigger(clus.identify()) || m_idHelperTool->isMM(clus.identify()) || m_idHelperTool->issTgc(clus.identify()) ) { clusterOnTrack = m_clusRotCreator->createRIO_OnTrack( clus, exPars->position(), exPars->momentum().unit() ); - }else{ + } else { if ( m_cscRotCreator.empty() ) { clusterOnTrack = 0; } else { clusterOnTrack = m_cscRotCreator->createRIO_OnTrack( clus, exPars->position(), exPars->momentum().unit() ); } } - if( !clusterOnTrack ) { - if( &pars != exPars ) delete exPars; + if ( !clusterOnTrack ) { + if ( &pars != exPars ) delete exPars; continue; } - + const Trk::ResidualPull* resPull = m_pullCalculator->residualPull( clusterOnTrack, exPars, Trk::ResidualPull::Unbiased ); - if( !resPull ){ - if( &pars != exPars ) delete exPars; + if ( !resPull ) { + if ( &pars != exPars ) delete exPars; delete clusterOnTrack; continue; } - if( resPull->pull().empty() ){ - if( &pars != exPars ) delete exPars; + if ( resPull->pull().empty() ) { + if ( &pars != exPars ) delete exPars; delete clusterOnTrack; delete resPull; continue; } - + double pullCut = m_idHelperTool->measuresPhi(id) ? m_associationPullCutPhi : m_associationPullCutEta; double pull = fabs(resPull->pull().front()); - Amg::Vector2D locExPos(exPars->parameters()[Trk::locX],exPars->parameters()[Trk::locY]); - bool inbounds = surf.insideBounds(locExPos,10.,10.); + Amg::Vector2D locExPos(exPars->parameters()[Trk::locX], exPars->parameters()[Trk::locY]); + bool inbounds = surf.insideBounds(locExPos, 10., 10.); - if( msgLvl(MSG::VERBOSE) ) { + if ( msgLvl(MSG::VERBOSE) ) { std::string boundStr = inbounds ? " inside bounds " : " outside bounds "; double residual = resPull->residual().front(); ATH_MSG_VERBOSE(" found prd: " << m_idHelperTool->toString(id) << " res " << residual << " pull " << pull << boundStr); } delete resPull; - + // check whether hit within cut and in bounds - if( pull < pullCut && inbounds ){ + if ( pull < pullCut && inbounds ) { // check whether there are other hits in the same layer with smaller residual, if not add ClusterLayerMap::iterator clit = clusterLayerMap.find(layId); - if( clit != clusterLayerMap.end() ){ - if( pull < clit->second.pull ) { + if ( clit != clusterLayerMap.end() ) { + if ( pull < clit->second.pull ) { clit->second.pull = pull; - if( &pars != clit->second.pars ) delete clit->second.pars; + if ( &pars != clit->second.pars ) delete clit->second.pars; delete clit->second.clus; clit->second.pars = exPars; clit->second.clus = clusterOnTrack; - }else{ - if( &pars != exPars ) delete exPars; + } else { + if ( &pars != exPars ) delete exPars; delete clusterOnTrack; } - }else{ + } else { PullCluster pullClus; pullClus.pull = pull; pullClus.pars = exPars; pullClus.clus = clusterOnTrack; clusterLayerMap[layId] = pullClus; } - }else{ - if( &pars != exPars ) delete exPars; + } else { + if ( &pars != exPars ) delete exPars; delete clusterOnTrack; } } - + // loop over cluster layer map and add the clusters to the state vector ClusterLayerMap::iterator clit = clusterLayerMap.begin(); ClusterLayerMap::iterator clit_end = clusterLayerMap.end(); - for( ;clit!=clit_end;++clit ){ - -// bool addMeasurements = true; - Trk::TrackStateOnSurface* tsos = MuonTSOSHelper::createMeasTSOS( clit->second.clus, clit->second.pars != &pars ? clit->second.pars : clit->second.pars->clone() , + for ( ; clit != clit_end; ++clit ) { + + // bool addMeasurements = true; + Trk::TrackStateOnSurface* tsos = MuonTSOSHelper::createMeasTSOS( clit->second.clus, clit->second.pars != &pars ? clit->second.pars : clit->second.pars->clone() , Trk::TrackStateOnSurface::Measurement ); -// addMeasurements ? Trk::TrackStateOnSurface::Measurement : Trk::TrackStateOnSurface::Outlier ); - states.push_back( std::make_pair(true,tsos) ); - ATH_MSG_VERBOSE(" added hit " << m_idHelperTool->toString(clit->second.clus->identify())); + // addMeasurements ? Trk::TrackStateOnSurface::Measurement : Trk::TrackStateOnSurface::Outlier ); + states.push_back( std::make_pair(true, tsos) ); + ATH_MSG_VERBOSE(" added hit " << m_idHelperTool->toString(clit->second.clus->identify())); ++nNewHits; } - + unsigned int nholes = 0; std::set<Identifier>::iterator hit = chHoles.begin(); std::set<Identifier>::iterator hit_end = chHoles.end(); - for( ;hit!=hit_end;++hit ){ + for ( ; hit != hit_end; ++hit ) { const Identifier& id = *hit; - - if( clusterLayerMap.count(id) ) continue; + + if ( clusterLayerMap.count(id) ) continue; // if no detEl yet try retrieving if from the detMgr - if( !detEl ) { - if( m_idHelperTool->isTgc(id) ) detEl = m_detMgr->getTgcReadoutElement(id); - else if( m_idHelperTool->isRpc(id) ) detEl = m_detMgr->getRpcReadoutElement(id); - else if( m_idHelperTool->isCsc(id) ) detEl = m_detMgr->getCscReadoutElement(id); - if( !detEl ){ + if ( !detEl ) { + if ( m_idHelperTool->isTgc(id) ) detEl = m_detMgr->getTgcReadoutElement(id); + else if ( m_idHelperTool->isRpc(id) ) detEl = m_detMgr->getRpcReadoutElement(id); + else if ( m_idHelperTool->isCsc(id) ) detEl = m_detMgr->getCscReadoutElement(id); + // New Small Wheel + else if ( m_idHelperTool->issTgc(id) ) detEl = m_detMgr->getsTgcReadoutElement(id); + else if ( m_idHelperTool->isMM(id) ) detEl = m_detMgr->getMMReadoutElement(id); + + + if ( !detEl ) { ATH_MSG_DEBUG("No detector element found for " << m_idHelperTool->toString(id) ); continue; } } const Trk::Surface& surf = detEl->surface(id); - + const Trk::TrackParameters* exPars = 0; - if( pars.associatedSurface() == surf ) { + if ( pars.associatedSurface() == surf ) { ATH_MSG_DEBUG(" Same surface, cloning parameters " ); exPars = &pars; - }else{ - exPars = m_extrapolator->extrapolateDirectly(pars,surf,Trk::anyDirection,false,Trk::muon); - if( !exPars ) { + } else { + exPars = m_extrapolator->extrapolateDirectly(pars, surf, Trk::anyDirection, false, Trk::muon); + if ( !exPars ) { ATH_MSG_DEBUG(" Propagation cluster hole failed!! "); continue; } parsToBeDeleted.push_back(exPars); } - + bool inBounds = false; - Amg::Vector2D locPos; - if( surf.globalToLocal(exPars->position(),exPars->momentum(),locPos) ){ - inBounds = surf.insideBounds(locPos,-100.,-100.); + Amg::Vector2D locPos;; + if ( surf.globalToLocal(exPars->position(), exPars->momentum(), locPos) ) { + inBounds = surf.insideBounds(locPos, -100., -100.); } - if( msgLvl(MSG::VERBOSE) ) { + if ( msgLvl(MSG::VERBOSE) ) { std::string boundStr = inBounds ? " inside bounds " : " outside bounds "; - ATH_MSG_VERBOSE(" new hole " << m_idHelperTool->toString(id) << " position " + ATH_MSG_VERBOSE(" new hole " << m_idHelperTool->toString(id) << " position " << exPars->parameters()[Trk::locR] << boundStr); } - - if( !inBounds ){ + + if ( !inBounds ) { continue; } + if ( msgLvl(MSG::VERBOSE) ) if (m_idHelperTool->issTgc(id)) ATH_MSG_VERBOSE(" new hole sTgc measuresPhi " << (int) m_idHelperTool->measuresPhi(id)); Trk::TrackStateOnSurface* tsos = MuonTSOSHelper::createHoleTSOS(exPars->clone()); - states.push_back( std::make_pair(true,tsos) ); + states.push_back( std::make_pair(true, tsos) ); ++nholes; //break; // only add one hole per det el } ATH_MSG_DEBUG(" chamber " << m_idHelperTool->toStringChamber(detElId) << " added hits " << nNewHits << " found holes " << nholes ); - + // clean up parameters std::for_each( parsToBeDeleted.begin(), parsToBeDeleted.end(), MuonDeleteObject<const Trk::TrackParameters>() ); @@ -842,204 +977,197 @@ MuonChamberHoleRecoveryTool::insertMdtsWithHoleSearch( std::vector<const Trk::Tr void MuonChamberHoleRecoveryTool::createHoleTSOSsForMdtChamber( const Identifier& chId, const Trk::TrackParameters& pars, const Trk::TrackParameters* parsLast, - std::set<Identifier>& ids, - std::vector< std::pair<bool,const Trk::TrackStateOnSurface* > >& states ) const { - + std::set<Identifier>& ids, + std::vector< std::pair<bool, const Trk::TrackStateOnSurface* > >& states ) const { + Amg::Vector3D direction = pars.momentum().unit(); - + // check whether we need to average the parameters - if( parsLast ) direction = (parsLast->position() - pars.position()).unit(); - - std::set<Identifier> chHoles = holesInMdtChamber( pars.position(),direction,chId,ids ); + if ( parsLast ) direction = (parsLast->position() - pars.position()).unit(); + std::set<Identifier> chHoles = holesInMdtChamber( pars.position(), direction, chId, ids ); ATH_MSG_VERBOSE(" chamber " << m_idHelperTool->toStringChamber(chId) << " has holes " << chHoles.size() ); - if( chHoles.empty() ) return; - - + if ( chHoles.empty() ) return; + + unsigned int nholes = 0; unsigned int nstates = 0; - + std::vector<const Trk::TrackParameters*> parsToBeDeleted; parsToBeDeleted.reserve(10); - + // set to store chambers that were already handled std::set<Identifier> chIds; - + // loop over holes, find prd data collection belonging to hole, recover hole std::set<Identifier>::iterator hit = chHoles.begin(); std::set<Identifier>::iterator hit_end = chHoles.end(); - for( ;hit!=hit_end; ++hit ){ - + for ( ; hit != hit_end; ++hit ) { + // only handle chamers once Identifier chIdentifier = m_idHelperTool->chamberId(*hit); - if( chIds.count(chIdentifier) ) continue; + if ( chIds.count(chIdentifier) ) continue; chIds.insert(chIdentifier); // loop over Mdt Prds and try to find prds of tubes with holes const MdtPrepDataCollection* mdtPrdCol = findMdtPrdCollection( chIdentifier ); - if( !mdtPrdCol ) { + if ( !mdtPrdCol ) { ATH_MSG_DEBUG(" Retrieval of MdtPrepDataCollection failed!! " ); break; } - + std::set<Identifier> associatedHoles; // holes in tubes that also have a prd - + MdtPrepDataCollection::const_iterator pit = mdtPrdCol->begin(); MdtPrepDataCollection::const_iterator pit_end = mdtPrdCol->end(); - for( ;pit!=pit_end; ++pit ){ + for ( ; pit != pit_end; ++pit ) { const MdtPrepData& mdtPrd = **pit; const Identifier& id = mdtPrd.identify(); // only consider holes - if( !chHoles.count(id) ) continue; + if ( !chHoles.count(id) ) continue; // ensure that Identifiers are not added twice - if( associatedHoles.count(id) ) continue; - + if ( associatedHoles.count(id) ) continue; + const Trk::Surface& surf = mdtPrd.detectorElement()->surface(id); - + const Trk::TrackParameters* exPars = 0; - if( pars.associatedSurface() == surf ){ + if ( pars.associatedSurface() == surf ) { exPars = &pars; - }else{ - exPars = m_extrapolator->extrapolateDirectly(pars,surf,Trk::anyDirection,false,Trk::muon); - if( !exPars ) { + } else { + exPars = m_extrapolator->extrapolateDirectly(pars, surf, Trk::anyDirection, false, Trk::muon); + if ( !exPars ) { ATH_MSG_WARNING(" Propagation to MDT prd failed!! "); continue; } parsToBeDeleted.push_back(exPars); } - + // calibrate Mdt PRD - const MdtDriftCircleOnTrack* mdtROT = m_mdtRotCreator->createRIO_OnTrack(mdtPrd,exPars->position(),&(exPars->momentum())); + const MdtDriftCircleOnTrack* mdtROT = m_mdtRotCreator->createRIO_OnTrack(mdtPrd, exPars->position(), &(exPars->momentum())); // sanity check - if( !mdtROT ){ + if ( !mdtROT ) { ATH_MSG_DEBUG(" failed to calibrate MdtPrepData " << m_idHelperTool->toString(id) ); continue; } - - + + const Trk::StraightLineSurface* slSurf = dynamic_cast<const Trk::StraightLineSurface*>( &mdtROT->associatedSurface() ); - if( !slSurf ){ + if ( !slSurf ) { ATH_MSG_WARNING(" dynamic cast to StraightLineSurface failed for mdt!!! " ); - }else{ + } else { // calculate Amg::Vector2D using surf to obtain sign Amg::Vector2D locPos; - if( !slSurf->globalToLocal(exPars->position(),exPars->momentum(),locPos) ){ + if ( !slSurf->globalToLocal(exPars->position(), exPars->momentum(), locPos) ) { ATH_MSG_DEBUG(" failed to calculate drift sign " ); - }else{ + } else { // calculate side Trk::DriftCircleSide side = locPos[Trk::driftRadius] < 0 ? Trk::LEFT : Trk::RIGHT; - - // cast away constness + + // cast away constness MdtDriftCircleOnTrack* changeMdtROT = const_cast<MdtDriftCircleOnTrack*>(mdtROT); // sanity check -// if( !changeMdtROT ){ -// ATH_MSG_WARNING(" failed to cast away constness of mdtROt " << m_idHelperTool->toString(id) ); -// continue; -// } - + // if( !changeMdtROT ){ + // ATH_MSG_WARNING(" failed to cast away constness of mdtROt " << m_idHelperTool->toString(id) ); + // continue; + // } + // update sign m_mdtRotCreator->updateSign( *changeMdtROT, side ); } } - + // check whether MDT ROT has sagged wire surface, if so redo propagation - if( slSurf != &mdtPrd.detectorElement()->surface(id) ){ - exPars = m_extrapolator->extrapolateDirectly(pars,*slSurf,Trk::anyDirection,false,Trk::muon); - if( !exPars ) { + if ( slSurf != &mdtPrd.detectorElement()->surface(id) ) { + exPars = m_extrapolator->extrapolateDirectly(pars, *slSurf, Trk::anyDirection, false, Trk::muon); + if ( !exPars ) { ATH_MSG_WARNING( " Propagation to sagged surface failed!! "); continue; } parsToBeDeleted.push_back(exPars); } - - if( msgLvl(MSG::VERBOSE) ) { + + if ( msgLvl(MSG::VERBOSE) ) { DistanceToPars distToPars(&pars); double distance = distToPars(exPars->position()); - msg(MSG::VERBOSE) << std::setprecision(4) - << " radius " << std::setw(7) << mdtROT->localParameters()[Trk::locR] + msg(MSG::VERBOSE) << std::setprecision(4) + << " radius " << std::setw(7) << mdtROT->localParameters()[Trk::locR] << " exPos " << std::setw(7) << exPars->parameters()[Trk::locR] << " distToPar " << distance << " "; } - + // pointer to resPull const Trk::ResidualPull* resPull = m_pullCalculator->residualPull( mdtROT, exPars, Trk::ResidualPull::Unbiased ); - if( !resPull ){ + if ( !resPull ) { delete mdtROT; continue; } - - + + double pull = resPull->pull().front(); double radialResidual = fabs(mdtROT->localParameters()[Trk::locR]) - fabs(exPars->parameters()[Trk::locR]); - + unsigned int hitFlag = 1; - if( mdtPrd.adc() < m_adcCut || mdtPrd.status() != MdtStatusDriftTime ) hitFlag = 3; // noise - else if( fabs(pull) < m_associationPullCutEta ) hitFlag = 0; // hit on track - else if( radialResidual > 0. ) hitFlag = 2; // out of time - - // else { - // // replace hit by tube hit - // delete mdtROT; - // mdtROT = m_tubeRotCreator->createRIO_OnTrack(mdtPrd,exPars->position()); - // } - + if ( mdtPrd.adc() < m_adcCut || mdtPrd.status() != MdtStatusDriftTime ) hitFlag = 3; // noise + else if ( fabs(pull) < m_associationPullCutEta ) hitFlag = 0; // hit on track + else if ( radialResidual > 0. ) hitFlag = 2; // out of time + bool inBounds = false; // calculate Amg::Vector2D using surf to obtain sign Amg::Vector2D locPos; - if( mdtROT->associatedSurface().globalToLocal(exPars->position(),exPars->momentum(),locPos) ){ + if ( mdtROT->associatedSurface().globalToLocal(exPars->position(), exPars->momentum(), locPos) ) { inBounds = mdtROT->associatedSurface().insideBounds(locPos); } - if( msgLvl(MSG::VERBOSE) ){ + if ( msgLvl(MSG::VERBOSE) ) { std::string idString = m_idHelperTool->toString( id ); - std::string boundCheck = inBounds ? "inBounds" : "outBounds"; + std::string boundCheck = inBounds ? "inBounds" : "outBounds"; msg(MSG::VERBOSE) << m_printer->print( *resPull ) << " " << idString << " " << boundCheck; std::string hitType = " delta"; - if( hitFlag == 0 ) hitType = " ROT"; - else if( hitFlag == 2 ) hitType = " Out of Time"; - else if( hitFlag == 3 ) hitType = " Noise"; + if ( hitFlag == 0 ) hitType = " ROT"; + else if ( hitFlag == 2 ) hitType = " Out of Time"; + else if ( hitFlag == 3 ) hitType = " Noise"; msg(MSG::VERBOSE) << hitType << endmsg; } delete resPull; - + // if we get here we are sure that this is not a hole associatedHoles.insert(id); - if( !inBounds ) { + if ( !inBounds ) { delete mdtROT; continue; } - Trk::TrackStateOnSurface* tsos = MuonTSOSHelper::createMeasTSOS( mdtROT, exPars->clone(), - (hitFlag != 0 || !m_addMeasurements) ? + Trk::TrackStateOnSurface* tsos = MuonTSOSHelper::createMeasTSOS( mdtROT, exPars->clone(), + (hitFlag != 0 || !m_addMeasurements) ? Trk::TrackStateOnSurface::Outlier : Trk::TrackStateOnSurface::Measurement ); - states.push_back( std::make_pair(true,tsos) ); + states.push_back( std::make_pair(true, tsos) ); ++nstates; - if( nstates == chHoles.size() ) { + if ( nstates == chHoles.size() ) { ATH_MSG_DEBUG(" recovered Mdts " << nstates << " all holes recovered " << nholes ); // clean up parameters std::for_each( parsToBeDeleted.begin(), parsToBeDeleted.end(), MuonDeleteObject<const Trk::TrackParameters>() ); return; } } - + std::set<Identifier>::iterator hit = chHoles.begin(); std::set<Identifier>::iterator hit_end = chHoles.end(); - for( ;hit!=hit_end;++hit ){ - if( associatedHoles.count(*hit) ) continue; + for ( ; hit != hit_end; ++hit ) { + if ( associatedHoles.count(*hit) ) continue; // only create holes in the current chamber Identifier ch = m_idHelperTool->chamberId(*hit); - if( ch != chIdentifier ) continue; + if ( ch != chIdentifier ) continue; const MuonGM::MdtReadoutElement* detEl = m_detMgr->getMdtReadoutElement(*hit); const Trk::Surface& surf = detEl->surface(*hit); - + const Trk::TrackParameters* exPars = 0; - if( pars.associatedSurface() == surf ){ + if ( pars.associatedSurface() == surf ) { exPars = &pars; - }else{ - exPars = m_extrapolator->extrapolateDirectly(pars,surf,Trk::anyDirection,false,Trk::muon); - if( !exPars ) { + } else { + exPars = m_extrapolator->extrapolateDirectly(pars, surf, Trk::anyDirection, false, Trk::muon); + if ( !exPars ) { ATH_MSG_WARNING(" Propagation to MDT hole failed!! "); continue; } @@ -1048,75 +1176,75 @@ MuonChamberHoleRecoveryTool::insertMdtsWithHoleSearch( std::vector<const Trk::Tr bool inBounds = false; Amg::Vector2D locPos; - if( surf.globalToLocal(exPars->position(),exPars->momentum(),locPos) ){ + if ( surf.globalToLocal(exPars->position(), exPars->momentum(), locPos) ) { // perform bound check do not count holes with 100. mm of bound edge - inBounds = surf.bounds().insideLoc2(locPos,-100.); - if( inBounds ) { - if( fabs( locPos[Trk::locR] ) > 14.4 ) inBounds = false; + inBounds = surf.bounds().insideLoc2(locPos, -100.); + if ( inBounds ) { + if ( fabs( locPos[Trk::locR] ) > 14.4 ) inBounds = false; } } - if( !inBounds ){ - ATH_MSG_VERBOSE(" discarding hole " << m_idHelperTool->toString(*hit) << " dist wire " - << exPars->parameters()[Trk::locR] << " outside bounds " ); + if ( !inBounds ) { + ATH_MSG_VERBOSE(" discarding hole " << m_idHelperTool->toString(*hit) << " dist wire " + << exPars->parameters()[Trk::locR] << " outside bounds " ); continue; } - ATH_MSG_VERBOSE(" new hole " << m_idHelperTool->toString(*hit) << " dist wire " - << exPars->parameters()[Trk::locR] ); + ATH_MSG_VERBOSE(" new hole " << m_idHelperTool->toString(*hit) << " dist wire " + << exPars->parameters()[Trk::locR] ); Trk::TrackStateOnSurface* tsos = MuonTSOSHelper::createHoleTSOS(exPars->clone()); - states.push_back( std::make_pair(true,tsos) ); + states.push_back( std::make_pair(true, tsos) ); ++nholes; ++nstates; - } + } } ATH_MSG_DEBUG(" new states " << nstates << " number of holes " << nholes ); - + // clean up parameters std::for_each( parsToBeDeleted.begin(), parsToBeDeleted.end(), MuonDeleteObject<const Trk::TrackParameters>() ); - + } - MuonChamberHoleRecoveryTool::LayerHoleVec + MuonChamberHoleRecoveryTool::LayerHoleVec MuonChamberHoleRecoveryTool::holesInClusterChamber( const Trk::TrackParameters& /*pars*/, const Identifier& /*detElId*/, const std::set<Identifier>& layIds, unsigned nGasGaps ) const { LayerHoleVec holes; // if the number of layers is equal to the number of gas gaps times two in the chamber, there are no holes - if( layIds.size() == 2*nGasGaps ) return holes; - + if ( layIds.size() == 2 * nGasGaps ) return holes; + // create layer matrix - typedef std::vector< std::pair<int,int> > LayerMatrix; - LayerMatrix layerMatrix(nGasGaps,std::make_pair(0,0)); + typedef std::vector< std::pair<int, int> > LayerMatrix; + LayerMatrix layerMatrix(nGasGaps, std::make_pair(0, 0)); // loop over layer identifiers and fill std::set<Identifier>::const_iterator it = layIds.begin(); std::set<Identifier>::const_iterator it_end = layIds.end(); - for( ;it!=it_end; ++it ){ + for ( ; it != it_end; ++it ) { int gasGap = m_idHelperTool->gasGap(*it); bool measuresPhi = m_idHelperTool->measuresPhi(*it); // sanity check - if( gasGap < 0 && gasGap >= (int)nGasGaps ){ + if ( gasGap < 0 && gasGap >= (int)nGasGaps ) { ATH_MSG_WARNING(" gas gap index out of range " << m_idHelperTool->toString(*it) ); continue; } // counter starts at 1! - if( measuresPhi ) layerMatrix[gasGap-1].second = 1; - else layerMatrix[gasGap-1].first = 1; + if ( measuresPhi ) layerMatrix[gasGap - 1].second = 1; + else layerMatrix[gasGap - 1].first = 1; } - + // loop over the matrix, if a field is zero we have a hole. unsigned int gasGap = 1; LayerMatrix::iterator lit = layerMatrix.begin(); LayerMatrix::iterator lit_end = layerMatrix.end(); - for( ;lit!=lit_end;++lit ){ + for ( ; lit != lit_end; ++lit ) { // check whether the eta or phi hit is missing, create a hole if that is the case - if( !lit->first ) holes.push_back( std::make_pair(gasGap,0) ); - if( !lit->second ) holes.push_back( std::make_pair(gasGap,1) ); + if ( !lit->first ) holes.push_back( std::make_pair(gasGap, 0) ); + if ( !lit->second ) holes.push_back( std::make_pair(gasGap, 1) ); ++gasGap; } - return holes; + return holes; } @@ -1124,31 +1252,29 @@ MuonChamberHoleRecoveryTool::insertMdtsWithHoleSearch( std::vector<const Trk::Tr const Amg::Vector3D& direction, const Identifier& chId, const std::set<Identifier>& tubeIds ) const { - + // calculate crossed tubes const MuonStationIntersect& intersect = m_intersectSvc->tubesCrossedByTrack( chId, position, direction ); // clear hole vector std::set<Identifier> holes; - for( unsigned int ii=0;ii<intersect.tubeIntersects().size();++ii ){ + for ( unsigned int ii = 0; ii < intersect.tubeIntersects().size(); ++ii ) { const MuonTubeIntersect& tint = intersect.tubeIntersects()[ii]; - - //if( m_idHelperTool->chamberId(tint.tubeId) != chId ) continue; - - if( tubeIds.count( tint.tubeId ) ) { + + if ( tubeIds.count( tint.tubeId ) ) { continue; } - if( msgLvl(MSG::VERBOSE) ){ - msg(MSG::VERBOSE) << " intersect " << m_idHelperTool->toString(tint.tubeId) + if ( msgLvl(MSG::VERBOSE) ) { + msg(MSG::VERBOSE) << " intersect " << m_idHelperTool->toString(tint.tubeId) << " dist wire " << tint.rIntersect << " dist to tube end " << tint.xIntersect; } - if( fabs( tint.rIntersect ) > 14.4 || tint.xIntersect > -10. ){ + if ( fabs( tint.rIntersect ) > 14.4 || tint.xIntersect > -10. ) { ATH_MSG_VERBOSE(" not counted" ); - }else{ - // check whether there is a hit in this tube - + } else { + // check whether there is a hit in this tube + ATH_MSG_VERBOSE(" hole tube" ); - + holes.insert( tint.tubeId ); } } @@ -1170,18 +1296,18 @@ MuonChamberHoleRecoveryTool::insertMdtsWithHoleSearch( std::vector<const Trk::Tr } IdentifierHash hash_id; m_idHelperTool->mdtIdHelper().get_module_hash(chId,hash_id ); - + MdtPrepDataContainer::const_iterator colIt = mdtPrdContainer->indexFind(hash_id); if( colIt == mdtPrdContainer->end() ){ - ATH_MSG_DEBUG(" MdtPrepDataCollection for: " << m_idHelperTool->toStringChamber(chId) - << " not found in container " ); + ATH_MSG_DEBUG(" MdtPrepDataCollection for: " << m_idHelperTool->toStringChamber(chId) + << " not found in container " ); return 0; } return *colIt; } const CscPrepDataCollection* MuonChamberHoleRecoveryTool::findCscPrdCollection( const Identifier& detElId ) const { - + SG::ReadHandle<Muon::CscPrepDataContainer> h_cscPrdCont(m_key_csc); const Muon::CscPrepDataContainer *cscPrdContainer; if (h_cscPrdCont.isValid()) { @@ -1193,11 +1319,11 @@ MuonChamberHoleRecoveryTool::insertMdtsWithHoleSearch( std::vector<const Trk::Tr } IdentifierHash hash_id; m_idHelperTool->cscIdHelper().get_module_hash(detElId,hash_id ); - + CscPrepDataContainer::const_iterator colIt = cscPrdContainer->indexFind(hash_id); if( colIt == cscPrdContainer->end() ){ - ATH_MSG_DEBUG(" CscPrepDataCollection for: " << m_idHelperTool->toStringChamber(detElId) - << " not found in container " ); + ATH_MSG_DEBUG(" CscPrepDataCollection for: " << m_idHelperTool->toStringChamber(detElId) + << " not found in container " ); return 0; } return *colIt; @@ -1227,7 +1353,7 @@ MuonChamberHoleRecoveryTool::insertMdtsWithHoleSearch( std::vector<const Trk::Tr } const RpcPrepDataCollection* MuonChamberHoleRecoveryTool::findRpcPrdCollection( const Identifier& detElId ) const { - + SG::ReadHandle<Muon::RpcPrepDataContainer> h_rpcPrdCont(m_key_rpc); const Muon::RpcPrepDataContainer *rpcPrdContainer; if(h_rpcPrdCont.isValid()) { @@ -1247,6 +1373,51 @@ MuonChamberHoleRecoveryTool::insertMdtsWithHoleSearch( std::vector<const Trk::Tr return *colIt; } + const sTgcPrepDataCollection* MuonChamberHoleRecoveryTool::findStgcPrdCollection( const Identifier& detElId ) const { + + SG::ReadHandle<Muon::sTgcPrepDataContainer> h_stgcPrdCont(m_key_stgc); + const Muon::sTgcPrepDataContainer *stgcPrdContainer; + if (h_stgcPrdCont.isValid()) { + stgcPrdContainer = h_stgcPrdCont.cptr(); + } + else{ + ATH_MSG_WARNING("Cannot retrieve stgcPrepDataContainer " << m_key_stgc.key() ); + return 0; + } + IdentifierHash hash_id; + m_idHelperTool->stgcIdHelper().get_module_hash(detElId, hash_id ); + + sTgcPrepDataContainer::const_iterator colIt = stgcPrdContainer->indexFind(hash_id); + if ( colIt == stgcPrdContainer->end() ) { + ATH_MSG_DEBUG(" StgcPrepDataCollection for: " << m_idHelperTool->toStringChamber(detElId) + << " not found in container " ); + return 0; + } + return *colIt; + } + + const MMPrepDataCollection* MuonChamberHoleRecoveryTool::findMmPrdCollection( const Identifier& detElId ) const { + SG::ReadHandle<Muon::MMPrepDataContainer> h_mmPrdCont(m_key_mm); + const Muon::MMPrepDataContainer *mmPrdContainer; + if (h_mmPrdCont.isValid()) { + mmPrdContainer = h_mmPrdCont.cptr(); + } + else{ + ATH_MSG_WARNING("Cannot retrieve stgcPrepDataContainer " << m_key_mm.key() ); + return 0; + } + + IdentifierHash hash_id; + m_idHelperTool->mmIdHelper().get_module_hash(detElId, hash_id ); + + MMPrepDataContainer::const_iterator colIt = mmPrdContainer->indexFind(hash_id); + if ( colIt == mmPrdContainer->end() ) { + ATH_MSG_DEBUG(" MmPrepDataCollection for: " << m_idHelperTool->toStringChamber(detElId) + << " not found in container " ); + return 0; + } + return *colIt; + } } diff --git a/MuonSpectrometer/MuonReconstruction/MuonTrackMakers/MuonTrackMakerTools/MuonTrackFinderTools/src/MuonChamberHoleRecoveryTool.h b/MuonSpectrometer/MuonReconstruction/MuonTrackMakers/MuonTrackMakerTools/MuonTrackFinderTools/src/MuonChamberHoleRecoveryTool.h index 87d8c37f77ff015ee6680a429826e2b10d057a20..c8ca59eceba12e76467342d19b7a13995bc7e8ad 100644 --- a/MuonSpectrometer/MuonReconstruction/MuonTrackMakers/MuonTrackMakerTools/MuonTrackFinderTools/src/MuonChamberHoleRecoveryTool.h +++ b/MuonSpectrometer/MuonReconstruction/MuonTrackMakers/MuonTrackMakerTools/MuonTrackFinderTools/src/MuonChamberHoleRecoveryTool.h @@ -32,6 +32,9 @@ class RpcIdHelper; class MdtIdHelper; class CscIdHelper; class TgcIdHelper; +// New Small Wheel +class sTgcIdHelper; +class MmIdHelper; namespace MuonGM { class MuonDetectorManager; @@ -75,7 +78,7 @@ namespace Muon { /** @brief destructor */ virtual ~MuonChamberHoleRecoveryTool (); - /** @brief AlgTool initilize */ + /** @brief AlgTool initialize */ StatusCode initialize(); /** @brief AlgTool finalize */ @@ -149,6 +152,16 @@ namespace Muon { void createHoleTSOSsForRpcChamber( const Identifier& detElId, const Trk::TrackParameters& pars, std::set<Identifier>& layIds, std::vector< std::pair<bool,const Trk::TrackStateOnSurface* > >& states ) const; + + // New Small Wheel + void createHoleTSOSsForStgcChamber( const Identifier& detElId, const Trk::TrackParameters& pars, + std::set<Identifier>& layIds, + std::vector< std::pair<bool,const Trk::TrackStateOnSurface* > >& states ) const; + + void createHoleTSOSsForMmChamber( const Identifier& detElId, const Trk::TrackParameters& pars, + std::set<Identifier>& layIds, + std::vector< std::pair<bool,const Trk::TrackStateOnSurface* > >& states ) const; + void createHoleTSOSsForClusterChamber( const Identifier& detElId, const Trk::TrackParameters& pars, std::set<Identifier>& layIds, std::set<Identifier>& chHoles, @@ -164,6 +177,9 @@ namespace Muon { const CscPrepDataCollection* findCscPrdCollection( const Identifier& detElId ) const; const TgcPrepDataCollection* findTgcPrdCollection( const Identifier& detElId ) const; const RpcPrepDataCollection* findRpcPrdCollection( const Identifier& detElId ) const; + // New Small Wheel + const sTgcPrepDataCollection* findStgcPrdCollection( const Identifier& detElId ) const; + const MMPrepDataCollection* findMmPrdCollection( const Identifier& detElId ) const; ServiceHandle<MuonStationIntersectSvc> m_intersectSvc; //<! pointer to hole search service @@ -179,11 +195,12 @@ namespace Muon { const MuonGM::MuonDetectorManager* m_detMgr; - SG::ReadHandleKey<Muon::MdtPrepDataContainer> m_key_mdt; //!< storegate location of the MdtPrepData - SG::ReadHandleKey<Muon::CscPrepDataContainer> m_key_csc; //!< storegate location of the CscPrepData - SG::ReadHandleKey<Muon::TgcPrepDataContainer> m_key_tgc; //!< storegate location of the TgcPrepData - SG::ReadHandleKey<Muon::RpcPrepDataContainer> m_key_rpc; //!< storegate location of the RpcPrepData - + SG::ReadHandleKey<Muon::MdtPrepDataContainer> m_key_mdt{this,"MdtPrepDataContainer","MDT_DriftCircles","MDT PRDs"}; + SG::ReadHandleKey<Muon::CscPrepDataContainer> m_key_csc{this,"CscPrepDataContainer","CSC_Clusters","CSC PRDS"}; + SG::ReadHandleKey<Muon::TgcPrepDataContainer> m_key_tgc{this,"TgcPrepDataContainer","TGC_Measurements","TGC PRDs"}; + SG::ReadHandleKey<Muon::RpcPrepDataContainer> m_key_rpc{this,"RpcPrepDataContainer","RPC_Measurements","RPC PRDs"}; + SG::ReadHandleKey<Muon::sTgcPrepDataContainer> m_key_stgc{this,"sTgcPrepDataContainer","STGC_Measurements","sTGC PRDs"}; + SG::ReadHandleKey<Muon::MMPrepDataContainer> m_key_mm{this,"MMPrepDataContainer","MM_Measurements","MM PRDs"}; bool m_addMeasurements; double m_associationPullCutEta; diff --git a/MuonSpectrometer/MuonReconstruction/MuonTrackMakers/MuonTrackMakerTools/MuonTrackFinderTools/src/MuonSeededSegmentFinder.cxx b/MuonSpectrometer/MuonReconstruction/MuonTrackMakers/MuonTrackMakerTools/MuonTrackFinderTools/src/MuonSeededSegmentFinder.cxx index 3e0fc3a3bc0227fd69f46c7ab8fc3f75ee804920..11d44de1450b42d7478ccbd3b8a245910f17bb72 100644 --- a/MuonSpectrometer/MuonReconstruction/MuonTrackMakers/MuonTrackMakerTools/MuonTrackFinderTools/src/MuonSeededSegmentFinder.cxx +++ b/MuonSpectrometer/MuonReconstruction/MuonTrackMakers/MuonTrackMakerTools/MuonTrackFinderTools/src/MuonSeededSegmentFinder.cxx @@ -58,16 +58,12 @@ namespace Muon { declareProperty("Propagator", m_propagator ); declareProperty("SegmentMaker", m_segMaker); declareProperty("SegmentMakerNoHoles", m_segMakerNoHoles); - declareProperty("MdtPrepDataContainer", m_key_mdt="MDT_DriftCircles"); - declareProperty("RpcPrepDataContainer", m_key_rpc="RPC_Measurements"); - declareProperty("TgcPrepDataContainer", m_key_tgc="TGC_Measurements"); - declareProperty("CscPrepDataContainer", m_key_csc="CSC_Clusters"); declareProperty("AdcCut", m_adcCut = 50 ); declareProperty("MdtSigmaFromTrack",m_maxSigma = 3); } - MuonSeededSegmentFinder::~MuonSeededSegmentFinder(){} + MuonSeededSegmentFinder::~MuonSeededSegmentFinder() {} StatusCode MuonSeededSegmentFinder::initialize() @@ -83,30 +79,33 @@ namespace Muon { ATH_CHECK(m_key_mdt.initialize()); ATH_CHECK(m_key_csc.initialize()); - ATH_CHECK(m_key_rpc.initialize()); ATH_CHECK(m_key_tgc.initialize()); - + ATH_CHECK(m_key_rpc.initialize()); + ATH_CHECK(m_key_stgc.initialize()); + ATH_CHECK(m_key_mm.initialize()); + return StatusCode::SUCCESS; } + + StatusCode MuonSeededSegmentFinder::finalize() { return StatusCode::SUCCESS; } - std::vector<const MuonSegment*>* MuonSeededSegmentFinder::find( const Trk::TrackParameters& pars, const std::set<Identifier>& chIds ) const { // get MdtPrepData collections correspondign to the chamber Identifiers std::vector<const MdtPrepData*> mdtPrds = extractPrds( chIds ); - - if( mdtPrds.empty() ){ + + if ( mdtPrds.empty() ) { ATH_MSG_DEBUG(" no MdtPrepData found "); return 0; } - + // find segments - return find(pars,mdtPrds); + return find(pars, mdtPrds); } std::vector<const MuonSegment*>* MuonSeededSegmentFinder::find( const Trk::TrackParameters& pars, const std::set<IdentifierHash>& chIdHs ) const { @@ -114,17 +113,17 @@ namespace Muon { // get MdtPrepData collections correspondign to the chamber Identifiers std::vector<const MdtPrepData*> mdtPrds = extractPrds( chIdHs ); - if( mdtPrds.empty() ){ + if ( mdtPrds.empty() ) { ATH_MSG_DEBUG(" no MdtPrepData found "); return 0; } - + // find segments - return find(pars,mdtPrds); + return find(pars, mdtPrds); } - - std::vector<const MuonSegment*>* MuonSeededSegmentFinder::find( const Trk::TrackParameters& pars, + + std::vector<const MuonSegment*>* MuonSeededSegmentFinder::find( const Trk::TrackParameters& pars, const std::vector<const MdtPrepData*>& mdtPrds ) const { // are we close to the chamber edge? @@ -135,38 +134,38 @@ namespace Muon { mdtROTs.reserve( mdtPrds.size() ); selectAndCalibrate( pars, mdtPrds, mdtROTs, doHoleSearch ); - if( mdtROTs.empty() ){ + if ( mdtROTs.empty() ) { ATH_MSG_DEBUG(" no MdtDriftCircles selected "); return 0; } // create track road double roadWidthEta = 1.; - if( pars.covariance() ){ - double trackError = Amg::error(*pars.covariance(),Trk::theta); + if ( pars.covariance() ) { + double trackError = Amg::error(*pars.covariance(), Trk::theta); ATH_MSG_DEBUG(" local track Error on theta " << trackError); - if( trackError < 0.2 ) trackError = 0.2; + if ( trackError < 0.2 ) trackError = 0.2; roadWidthEta = 5.*trackError; } Trk::TrackRoad road( pars.position(), pars.momentum(), roadWidthEta, 1. ); - + // create dummy vector<vector> std::vector< std::vector<const MdtDriftCircleOnTrack*> > mdtROTsVec; mdtROTsVec.push_back(mdtROTs); std::vector< std::vector<const MuonClusterOnTrack*> > clusterROTsVec; // call segment finder - std::vector<const MuonSegment*>* segments = doHoleSearch ? + std::vector<const MuonSegment*>* segments = doHoleSearch ? m_segMaker->find( road, mdtROTsVec, clusterROTsVec, true ) : m_segMakerNoHoles->find( road, mdtROTsVec, clusterROTsVec, true ); - + // delete ROTs std::for_each( mdtROTs.begin(), mdtROTs.end(), MuonDeleteObject<const MdtDriftCircleOnTrack>() ); - if( !segments ){ + if ( !segments ) { ATH_MSG_DEBUG(" No segments found "); return 0; - }else{ + } else { ATH_MSG_DEBUG(" Number of segments found: " << segments->size() << std::endl << m_printer->print(*segments)); } @@ -176,32 +175,32 @@ namespace Muon { std::vector<const MdtPrepData*> MuonSeededSegmentFinder::extractPrds( const std::set<Identifier>& chIds ) const { // set of IdHashes corresponding to these identifiers std::set<IdentifierHash> chIdHs; - + // loop over chambers and get collections std::set<Identifier>::const_iterator chit = chIds.begin(); std::set<Identifier>::const_iterator chit_end = chIds.end(); - for( ;chit!=chit_end;++chit ){ - - if( !m_idHelper->isMdt(*chit) ) { + for ( ; chit != chit_end; ++chit ) { + + if ( !m_idHelper->isMdt(*chit) ) { ATH_MSG_WARNING(" Requested chamber is not an MDT: " << m_idHelper->toStringChamber(*chit)); continue; } - + const MuonGM::MdtReadoutElement* detEl = m_detMgr->getMdtReadoutElement(*chit); - if( !detEl ) { + if ( !detEl ) { ATH_MSG_WARNING(" Requested chamber does not exist in geometry: " << m_idHelper->toStringChamber(*chit)); continue; } IdentifierHash hash_id = detEl->collectionHash(); chIdHs.insert(hash_id); } - - // vector to store pointers to collections + + // vector to store pointers to collections std::vector<const MdtPrepData*> mdtPrds = extractPrds( chIdHs ); - + return mdtPrds; - } - + } + std::vector<const MdtPrepData*> MuonSeededSegmentFinder::extractPrds( const std::set<IdentifierHash>& chIdHs ) const { SG::ReadHandle<Muon::MdtPrepDataContainer> h_mdtPrdCont(m_key_mdt); @@ -266,6 +265,7 @@ namespace Muon { } } + void MuonSeededSegmentFinder::extractRpcPrdCols( const std::set<IdentifierHash>& chIdHs, std::vector<const RpcPrepDataCollection*>& target ) const { @@ -299,6 +299,7 @@ namespace Muon { } } + void MuonSeededSegmentFinder::extractTgcPrdCols( const std::set<IdentifierHash>& chIdHs, std::vector<const TgcPrepDataCollection*>& target ) const { @@ -332,6 +333,7 @@ namespace Muon { } } + void MuonSeededSegmentFinder::extractCscPrdCols( const std::set<IdentifierHash>& chIdHs, std::vector<const CscPrepDataCollection*>& target ) const { @@ -366,45 +368,145 @@ namespace Muon { } } - void MuonSeededSegmentFinder::selectAndCalibrate( const Trk::TrackParameters& pars, + + // New Small Wheel + // sTGC + void MuonSeededSegmentFinder::extractsTgcPrdCols( const std::set<IdentifierHash>& chIdHs, + std::vector<const sTgcPrepDataCollection*>& target ) const { + + SG::ReadHandle<Muon::sTgcPrepDataContainer> h_stgcPrdCont(m_key_stgc); + const Muon::sTgcPrepDataContainer *stgcPrdContainer; + if(h_stgcPrdCont.isValid()) { + stgcPrdContainer = h_stgcPrdCont.cptr(); + } + else{ + ATH_MSG_WARNING("Cannot retrieve stgcPrepDataContainer " << m_key_stgc.key()); + return; + } + + + // loop over chambers and get collections + std::set<IdentifierHash>::const_iterator chit = chIdHs.begin(); + std::set<IdentifierHash>::const_iterator chit_end = chIdHs.end(); + for( ;chit!=chit_end;++chit ){ + sTgcPrepDataContainer::const_iterator colIt = stgcPrdContainer->indexFind(*chit); + if( colIt == stgcPrdContainer->end() || (*colIt)->empty() ){ + //ATH_MSG_DEBUG(" TgcPrepDataCollection for: " + // << m_idHelper->toStringChamber(*chit) << " not found in container "); + continue; + } + ATH_MSG_DEBUG(" Adding for: " + << m_idHelper->toStringChamber( (*colIt)->front()->identify() ) << " size " + << (*colIt)->size()); + + // reserve space for the new PRDs + target.push_back(*colIt); + } + + if(chIdHs.size()==0) { + // Temp fix because Region selector is not implemented + sTgcPrepDataContainer::const_iterator colIt = stgcPrdContainer->begin(); + sTgcPrepDataContainer::const_iterator colIt_end = stgcPrdContainer->end(); + for ( ; colIt != colIt_end; ++colIt ) { + if((*colIt)->size()>0) { + ATH_MSG_DEBUG(" Adding ALL Prds for: " + << m_idHelper->toStringChamber( (*colIt)->front()->identify() ) << " size " + << (*colIt)->size()); + // reserve space for the new PRDs + target.push_back(*colIt); + } + } + } + } + + // MM + void MuonSeededSegmentFinder::extractMMPrdCols( const std::set<IdentifierHash>& chIdHs, + std::vector<const MMPrepDataCollection*>& target ) const { + + SG::ReadHandle<Muon::MMPrepDataContainer> h_mmPrdCont(m_key_mm); + const Muon::MMPrepDataContainer *mmPrdContainer; + if(h_mmPrdCont.isValid()) { + mmPrdContainer = h_mmPrdCont.cptr(); + } + else{ + ATH_MSG_WARNING("Cannot retrieve mmPrepDataContainer " << m_key_mm.key()); + return; + } + + // loop over chambers and get collections + std::set<IdentifierHash>::const_iterator chit = chIdHs.begin(); + std::set<IdentifierHash>::const_iterator chit_end = chIdHs.end(); + for ( ; chit != chit_end; ++chit ) { + MMPrepDataContainer::const_iterator colIt = mmPrdContainer->indexFind(*chit); + if ( colIt == mmPrdContainer->end() || (*colIt)->empty() ) { + //ATH_MSG_DEBUG(" TgcPrepDataCollection for: " + // << m_idHelper->toStringChamber(*chit) << " not found in container "); + continue; + } + ATH_MSG_DEBUG(" Adding for: " + << m_idHelper->toStringChamber( (*colIt)->front()->identify() ) << " size " + << (*colIt)->size()); + + target.push_back(*colIt); + } + + if(chIdHs.size()==0) { + // Temp fix because Region selector is not implemented + MMPrepDataContainer::const_iterator colIt = mmPrdContainer->begin(); + MMPrepDataContainer::const_iterator colIt_end = mmPrdContainer->end(); + for ( ; colIt != colIt_end; ++colIt ) { + if((*colIt)->size()>0) { + ATH_MSG_DEBUG(" Adding ALL Prds for: " + << m_idHelper->toStringChamber( (*colIt)->front()->identify() ) << " size " + << (*colIt)->size()); + target.push_back(*colIt); + } + } + } + + } + + + + void MuonSeededSegmentFinder::selectAndCalibrate( const Trk::TrackParameters& pars, const std::vector<const MdtPrepData*>& mdtPrdCols, std::vector<const MdtDriftCircleOnTrack*>& mdtROTs, bool& doHoleSearch ) const { - + ATH_MSG_VERBOSE(" in selectAndCalibrate, get PRDs " << mdtPrdCols.size()); // loop over MdtPrepDataCollections std::vector<const MdtPrepData*>::const_iterator mit = mdtPrdCols.begin(); std::vector<const MdtPrepData*>::const_iterator mit_end = mdtPrdCols.end(); - for( ;mit!=mit_end;++mit ){ - if((*mit)->status() != 1) continue; + for ( ; mit != mit_end; ++mit ) { + if ((*mit)->status() != 1) continue; // calibrate MDT const MdtDriftCircleOnTrack* mdt = handleMdtPrd( pars, **mit, doHoleSearch ); - + // not selected - if( !mdt ) continue; - + if ( !mdt ) continue; + mdtROTs.push_back(mdt); } ATH_MSG_VERBOSE(" calibrated " << mdtROTs.size() << " prds out of " << mdtPrdCols.size() ); } - const MdtDriftCircleOnTrack* MuonSeededSegmentFinder::handleMdtPrd( const Trk::TrackParameters& pars, + const MdtDriftCircleOnTrack* MuonSeededSegmentFinder::handleMdtPrd( const Trk::TrackParameters& pars, const MdtPrepData& mdtPrd, bool& doHoleSearch ) const { - + // skip noise hits - if( mdtPrd.adc() < m_adcCut ) return 0; + if ( mdtPrd.adc() < m_adcCut ) return 0; // get surface of PRD const Identifier& id = mdtPrd.identify(); const MuonGM::MdtReadoutElement& detEl = *mdtPrd.detectorElement(); const Trk::StraightLineSurface& surf = detEl.surface(id); - + // propagate segment parameters to first measurement - const Trk::TrackParameters* exPars = m_propagator->propagate(pars,surf,Trk::anyDirection,false,m_magFieldProperties); - if( !exPars ) { + const Trk::TrackParameters* exPars = m_propagator->propagate(pars, surf, Trk::anyDirection, false, m_magFieldProperties); + if ( !exPars ) { ATH_MSG_DEBUG(" Propagation failed!! "); return 0; } @@ -412,68 +514,68 @@ namespace Muon { // calculate position on wire + error double distanceToWire = exPars->parameters()[Trk::locR]; double posAlongWire = exPars->parameters()[Trk::locZ]; - - double errorR = exPars->covariance() ? fabs(Amg::error(*exPars->covariance(),Trk::locR)) : 500.; - double errorZ = exPars->covariance() ? fabs(Amg::error(*exPars->covariance(),Trk::locZ)) : 300.; + + double errorR = exPars->covariance() ? fabs(Amg::error(*exPars->covariance(), Trk::locR)) : 500.; + double errorZ = exPars->covariance() ? fabs(Amg::error(*exPars->covariance(), Trk::locZ)) : 300.; // range check - bool isOnSurface = surf.isOnSurface(exPars->position(),true,5*errorR,5*errorZ); - + bool isOnSurface = surf.isOnSurface(exPars->position(), true, 5 * errorR, 5 * errorZ); + // get tube length int layer = m_idHelper->mdtIdHelper().tubeLayer(id); int tube = m_idHelper->mdtIdHelper().tube(id); - double halfTubeLength = 0.5*detEl.getActiveTubeLength(layer,tube); + double halfTubeLength = 0.5 * detEl.getActiveTubeLength(layer, tube); double tubeRadius = detEl.innerTubeRadius(); // take into account the tube width - double roadWidthR = 5*errorR + 4*tubeRadius; - double roadWidthZ = 5*errorZ + 100.; - - double driftdr = Amg::error(mdtPrd.localCovariance(),Trk::locR); - double nSigmaFromTrack = fabs(fabs(distanceToWire) - mdtPrd.localPosition()[Trk::locR])/sqrt(errorR*errorR+driftdr*driftdr); + double roadWidthR = 5 * errorR + 4 * tubeRadius; + double roadWidthZ = 5 * errorZ + 100.; + + double driftdr = Amg::error(mdtPrd.localCovariance(), Trk::locR); + double nSigmaFromTrack = fabs(fabs(distanceToWire) - mdtPrd.localPosition()[Trk::locR]) / sqrt(errorR * errorR + driftdr * driftdr); - if( msgLvl(MSG::VERBOSE) ) { + if ( msgLvl(MSG::VERBOSE) ) { std::string boundCheckStr = isOnSurface ? " onSurface" : " outOfSurface"; - msg() << MSG::VERBOSE << " " << m_idHelper->toString(mdtPrd.identify()) + msg() << MSG::VERBOSE << " " << m_idHelper->toString(mdtPrd.identify()) << " r " << distanceToWire << " range " << roadWidthR << " z " << posAlongWire << " range " << halfTubeLength + roadWidthZ << boundCheckStr; } //if( fabs(distanceToWire) > roadWidthR || fabs(posAlongWire) > halfTubeLength + roadWidthZ ){ - if(nSigmaFromTrack > m_maxSigma || fabs(posAlongWire) > halfTubeLength + roadWidthZ ){ - if( msgLvl(MSG::VERBOSE) ) msg() << " --- dropped" << endmsg; + if (nSigmaFromTrack > m_maxSigma || fabs(posAlongWire) > halfTubeLength + roadWidthZ ) { + if ( msgLvl(MSG::VERBOSE) ) msg() << " --- dropped" << endmsg; delete exPars; - return 0; + return 0; } // update hole search flag, set to false if we are close to the tube edge - if( doHoleSearch && fabs(posAlongWire) < halfTubeLength + roadWidthZ ) doHoleSearch = false; - + if ( doHoleSearch && fabs(posAlongWire) < halfTubeLength + roadWidthZ ) doHoleSearch = false; + // pointer to ROT - const MdtDriftCircleOnTrack* mdtROT = m_mdtRotCreator->createRIO_OnTrack(mdtPrd,exPars->position(), &(exPars->momentum())); - + const MdtDriftCircleOnTrack* mdtROT = m_mdtRotCreator->createRIO_OnTrack(mdtPrd, exPars->position(), &(exPars->momentum())); + // clean up pointers delete exPars; - // check whether ROT is create - if( !mdtROT ){ + // check whether ROT is created + if ( !mdtROT ) { ATH_MSG_DEBUG(" failed to calibrate MdtPrepData " << m_idHelper->toString(mdtPrd.identify())); return 0; } - - if( msgLvl(MSG::VERBOSE) ) { + + if ( msgLvl(MSG::VERBOSE) ) { double radius = mdtROT->localParameters()[Trk::locR]; double error = driftdr; double residual = radius - fabs(distanceToWire); - double fullError = sqrt( errorR*errorR + error*error ); - double radialPull = residual/fullError; + double fullError = sqrt( errorR * errorR + error * error ); + double radialPull = residual / fullError; std::string hitType; - if( fabs(radialPull) < 5 ) hitType = "onTrack"; - else if( fabs(radialPull) > 5 && residual > 0 ) hitType = "delta"; + if ( fabs(radialPull) < 5 ) hitType = "onTrack"; + else if ( fabs(radialPull) > 5 && residual > 0 ) hitType = "delta"; else hitType = "outOfTime"; msg() << " r_drift " << radius << " res " << residual << " pull " << radialPull << " " << hitType << endmsg; } diff --git a/MuonSpectrometer/MuonReconstruction/MuonTrackMakers/MuonTrackMakerTools/MuonTrackFinderTools/src/MuonSeededSegmentFinder.h b/MuonSpectrometer/MuonReconstruction/MuonTrackMakers/MuonTrackMakerTools/MuonTrackFinderTools/src/MuonSeededSegmentFinder.h index c47ec1611d41da445ebd0d72bdd665c6d464fe51..cdc9b00340635b29a092678018c3efcbd3ed7449 100644 --- a/MuonSpectrometer/MuonReconstruction/MuonTrackMakers/MuonTrackMakerTools/MuonTrackFinderTools/src/MuonSeededSegmentFinder.h +++ b/MuonSpectrometer/MuonReconstruction/MuonTrackMakers/MuonTrackMakerTools/MuonTrackFinderTools/src/MuonSeededSegmentFinder.h @@ -31,104 +31,118 @@ class RpcIdHelper; class MdtIdHelper; class CscIdHelper; class TgcIdHelper; +// New Small Wheel +class sTgcIdHelper; +class MmIdHelper; namespace Muon { - class IMdtDriftCircleOnTrackCreator; - class MuonIdHelperTool; - class MuonEDMPrinterTool; - class MdtDriftCircleOnTrack; - class MuonSegment; - class IMuonSegmentMaker; - class MdtPrepData; +class IMdtDriftCircleOnTrackCreator; +class MuonIdHelperTool; +class MuonEDMPrinterTool; +class MdtDriftCircleOnTrack; +class MuonSegment; +class IMuonSegmentMaker; +class MdtPrepData; } namespace MuonGM { - class MuonDetectorManager; +class MuonDetectorManager; } namespace Trk { - class IPropagator; +class IPropagator; } namespace Muon { - /** - @brief seeded segment finder that gets its data directly from storegate for a give set of Identifiers or IdentifierHashes - - */ - class MuonSeededSegmentFinder : virtual public IMuonSeededSegmentFinder, public AthAlgTool { - public: - /** @brief constructor */ - MuonSeededSegmentFinder(const std::string&,const std::string&,const IInterface*); - - /** @brief destructor */ - ~MuonSeededSegmentFinder (); - - /** @brief AlgTool initilize */ - StatusCode initialize(); - - /** @brief AlgTool finalize */ - StatusCode finalize(); - - /** @brief find segments in a set of chambers starting from seeding TrackParameters */ - std::vector<const MuonSegment*>* find( const Trk::TrackParameters& pars, const std::set<Identifier>& chIds ) const; - - /** @brief find segments in a set of chambers starting from seeding TrackParameters (version with Hashes) */ - std::vector<const MuonSegment*>* find( const Trk::TrackParameters& pars, const std::set<IdentifierHash>& chIdHs ) const; - - /** @brief find segments in a set of MdtPrepData starting from seeding TrackParameters */ - std::vector<const MuonSegment*>* find( const Trk::TrackParameters& pars, const std::vector<const MdtPrepData*>& mdtPrds ) const; - - - /** @brief retrieve MDT PRD collections for the given hashes */ - void extractMdtPrdCols( const std::set<IdentifierHash>& chIdHs, std::vector<const MdtPrepDataCollection*>& target ) const; - - /** @brief retrieve RPC PRD collections for the given hashes */ - void extractRpcPrdCols( const std::set<IdentifierHash>& chIdHs, std::vector<const RpcPrepDataCollection*>& target ) const; - - /** @brief retrieve TGC PRD collections for the given hashes */ - void extractTgcPrdCols( const std::set<IdentifierHash>& chIdHs, std::vector<const TgcPrepDataCollection*>& target ) const; - - /** @brief retrieve CSC PRD collections for the given hashes */ - void extractCscPrdCols( const std::set<IdentifierHash>& chIdHs, std::vector<const CscPrepDataCollection*>& target ) const; - - private: - /** @brief retrieve the MdtPrepDataCollections for the give Identifiers */ - std::vector<const MdtPrepData*> extractPrds( const std::set<Identifier>& chIds ) const; - - /** @brief retrieve the MdtPrepDataCollections for the give Identifier Hashes */ - std::vector<const MdtPrepData*> extractPrds( const std::set<IdentifierHash>& chIdHs ) const; - - /** @brief select a set of Mdt hits and calibrate them */ - void selectAndCalibrate( const Trk::TrackParameters& pars, - const std::vector<const MdtPrepData*>& mdtPrdCols, - std::vector<const MdtDriftCircleOnTrack*>& mdtROTs, - bool& doHoleSearch ) const; - - /** @brief select and calibrate a single MdtPrepData */ - const MdtDriftCircleOnTrack* handleMdtPrd( const Trk::TrackParameters& pars, - const MdtPrepData& mdtPrd, - bool& doHoleSearch ) const; - - - const MuonGM::MuonDetectorManager* m_detMgr; - - ToolHandle<Muon::IMuonSegmentMaker> m_segMaker; //!< actual segment maker with hole search - ToolHandle<Muon::IMuonSegmentMaker> m_segMakerNoHoles; //!< actual segment maker no hole search - ToolHandle<Trk::IPropagator> m_propagator; //!< propagator - ToolHandle<Muon::IMdtDriftCircleOnTrackCreator> m_mdtRotCreator; //!< IMdtDriftCircleOnTrackCreator - Trk::MagneticFieldProperties m_magFieldProperties; //!< magnetic field properties - ToolHandle<Muon::MuonIdHelperTool> m_idHelper; //!< IdHelper tool - ToolHandle<Muon::MuonEDMPrinterTool> m_printer; //!< EDM printer tool - - SG::ReadHandleKey<Muon::MdtPrepDataContainer> m_key_mdt; //!< storegate location of the MdtPrepData - SG::ReadHandleKey<Muon::RpcPrepDataContainer> m_key_rpc; //!< storegate location of the RpcPrepData - SG::ReadHandleKey<Muon::TgcPrepDataContainer> m_key_tgc; //!< storegate location of the TgcPrepData - SG::ReadHandleKey<Muon::CscPrepDataContainer> m_key_csc; //!< storegate location of the CscPrepData - - double m_adcCut; - double m_maxSigma; - }; +/** + @brief seeded segment finder that gets its data directly from storegate for a give set of Identifiers or IdentifierHashes + +*/ +class MuonSeededSegmentFinder : virtual public IMuonSeededSegmentFinder, public AthAlgTool { +public: + /** @brief constructor */ + MuonSeededSegmentFinder(const std::string&, const std::string&, const IInterface*); + + /** @brief destructor */ + ~MuonSeededSegmentFinder (); + + /** @brief AlgTool initilize */ + StatusCode initialize(); + + /** @brief AlgTool finalize */ + StatusCode finalize(); + + /** @brief find segments in a set of chambers starting from seeding TrackParameters */ + std::vector<const MuonSegment*>* find( const Trk::TrackParameters& pars, const std::set<Identifier>& chIds ) const; + + /** @brief find segments in a set of chambers starting from seeding TrackParameters (version with Hashes) */ + std::vector<const MuonSegment*>* find( const Trk::TrackParameters& pars, const std::set<IdentifierHash>& chIdHs ) const; + + /** @brief find segments in a set of MdtPrepData starting from seeding TrackParameters */ + std::vector<const MuonSegment*>* find( const Trk::TrackParameters& pars, const std::vector<const MdtPrepData*>& mdtPrds ) const; + + + /** @brief retrieve MDT PRD collections for the given hashes */ + void extractMdtPrdCols( const std::set<IdentifierHash>& chIdHs, std::vector<const MdtPrepDataCollection*>& target ) const; + + /** @brief retrieve RPC PRD collections for the given hashes */ + void extractRpcPrdCols( const std::set<IdentifierHash>& chIdHs, std::vector<const RpcPrepDataCollection*>& target ) const; + + /** @brief retrieve TGC PRD collections for the given hashes */ + void extractTgcPrdCols( const std::set<IdentifierHash>& chIdHs, std::vector<const TgcPrepDataCollection*>& target ) const; + + /** @brief retrieve CSC PRD collections for the given hashes */ + void extractCscPrdCols( const std::set<IdentifierHash>& chIdHs, std::vector<const CscPrepDataCollection*>& target ) const; + + // New Small Wheel + + /** @brief retrieve STGC PRD collections for the given hashes */ + void extractsTgcPrdCols( const std::set<IdentifierHash>& chIdHs, std::vector<const sTgcPrepDataCollection*>& target ) const; + + /** @brief retrieve MM PRD collections for the given hashes */ + void extractMMPrdCols( const std::set<IdentifierHash>& chIdHs, std::vector<const MMPrepDataCollection*>& target ) const; + + +private: + /** @brief retrieve the MdtPrepDataCollections for the give Identifiers */ + std::vector<const MdtPrepData*> extractPrds( const std::set<Identifier>& chIds ) const; + + /** @brief retrieve the MdtPrepDataCollections for the give Identifier Hashes */ + std::vector<const MdtPrepData*> extractPrds( const std::set<IdentifierHash>& chIdHs ) const; + + /** @brief select a set of Mdt hits and calibrate them */ + void selectAndCalibrate( const Trk::TrackParameters& pars, + const std::vector<const MdtPrepData*>& mdtPrdCols, + std::vector<const MdtDriftCircleOnTrack*>& mdtROTs, + bool& doHoleSearch ) const; + + /** @brief select and calibrate a single MdtPrepData */ + const MdtDriftCircleOnTrack* handleMdtPrd( const Trk::TrackParameters& pars, + const MdtPrepData& mdtPrd, + bool& doHoleSearch ) const; + + + const MuonGM::MuonDetectorManager* m_detMgr; + + ToolHandle<Muon::IMuonSegmentMaker> m_segMaker; //!< actual segment maker with hole search + ToolHandle<Muon::IMuonSegmentMaker> m_segMakerNoHoles; //!< actual segment maker no hole search + ToolHandle<Trk::IPropagator> m_propagator; //!< propagator + ToolHandle<Muon::IMdtDriftCircleOnTrackCreator> m_mdtRotCreator; //!< IMdtDriftCircleOnTrackCreator + Trk::MagneticFieldProperties m_magFieldProperties; //!< magnetic field properties + ToolHandle<Muon::MuonIdHelperTool> m_idHelper; //!< IdHelper tool + ToolHandle<Muon::MuonEDMPrinterTool> m_printer; //!< EDM printer tool + + SG::ReadHandleKey<Muon::MdtPrepDataContainer> m_key_mdt{this,"MdtPrepDataContainer","MDT_DriftCircles","MDT PRDs"}; + SG::ReadHandleKey<Muon::CscPrepDataContainer> m_key_csc{this,"CscPrepDataContainer","CSC_Clusters","CSC PRDS"}; + SG::ReadHandleKey<Muon::TgcPrepDataContainer> m_key_tgc{this,"TgcPrepDataContainer","TGC_Measurements","TGC PRDs"}; + SG::ReadHandleKey<Muon::RpcPrepDataContainer> m_key_rpc{this,"RpcPrepDataContainer","RPC_Measurements","RPC PRDs"}; + SG::ReadHandleKey<Muon::sTgcPrepDataContainer> m_key_stgc{this,"sTgcPrepDataContainer","STGC_Measurements","sTGC PRDs"}; + SG::ReadHandleKey<Muon::MMPrepDataContainer> m_key_mm{this,"MMPrepDataContainer","MM_Measurements","MM PRDs"}; + + double m_adcCut; + double m_maxSigma; +}; } diff --git a/MuonSpectrometer/MuonReconstruction/MuonTrackMakers/MuonTrackMakerTools/MuonTrackFinderTools/src/MuonSegmentRegionRecoveryTool.cxx b/MuonSpectrometer/MuonReconstruction/MuonTrackMakers/MuonTrackMakerTools/MuonTrackFinderTools/src/MuonSegmentRegionRecoveryTool.cxx index 34d603ee7b2339d7a993a03d4b75cb8cbc03e826..5bf7c4ed9aa7cb3b0a383100152991059e4eaf0f 100644 --- a/MuonSpectrometer/MuonReconstruction/MuonTrackMakers/MuonTrackMakerTools/MuonTrackFinderTools/src/MuonSegmentRegionRecoveryTool.cxx +++ b/MuonSpectrometer/MuonReconstruction/MuonTrackMakers/MuonTrackMakerTools/MuonTrackFinderTools/src/MuonSegmentRegionRecoveryTool.cxx @@ -31,11 +31,18 @@ #include "MuonPrepRawData/RpcPrepDataCollection.h" #include "MuonPrepRawData/TgcPrepDataCollection.h" #include "MuonPrepRawData/CscPrepDataCollection.h" +// New Small Wheel +#include "MuonPrepRawData/sTgcPrepDataCollection.h" +#include "MuonPrepRawData/MMPrepDataCollection.h" #include "MuonRIO_OnTrack/MdtDriftCircleOnTrack.h" #include "MuonRIO_OnTrack/RpcClusterOnTrack.h" #include "MuonRIO_OnTrack/TgcClusterOnTrack.h" #include "MuonRIO_OnTrack/CscClusterOnTrack.h" +// New Small Wheel +#include "MuonRIO_OnTrack/sTgcClusterOnTrack.h" +#include "MuonRIO_OnTrack/MMClusterOnTrack.h" + #include "MuonSegment/MuonSegment.h" #include "MuonCompetingRIOsOnTrack/CompetingMuonClustersOnTrack.h" @@ -70,924 +77,1125 @@ namespace Muon { - MuonSegmentRegionRecoveryTool::MuonSegmentRegionRecoveryTool(const std::string& ty,const std::string& na,const IInterface* pa) - : AthAlgTool(ty,na,pa), - m_seededSegmentFinder("Muon::MuonSeededSegmentFinder/MuonSeededSegmentFinder"), - m_trackSegmentMatchingTool("Muon::MooCandidateMatchingTool/MooCandidateMatchingTool"), - m_chamberHoleRecoveryTool("Muon::MuonChamberHoleRecoveryTool/MuonChamberHoleRecoveryTool"), - m_extrapolator("Trk::Extrapolator/MuonExtrapolator"), - m_fitter("Rec::CombinedMuonTrackBuilder/CombinedMuonTrackBuilder"), - m_intersectSvc("MuonStationIntersectSvc",name()), - m_idHelperTool("Muon::MuonIdHelperTool/MuonIdHelperTool"), - m_helperTool("Muon::MuonEDMHelperTool/MuonEDMHelperTool"), - m_printer("Muon::MuonEDMPrinterTool/MuonEDMPrinterTool"), - m_hitSummaryTool("Muon::MuonHitSummaryTool/MuonHitSummaryTool"), - m_regionSelector("RegSelSvc", name()) - { - declareInterface<IMuonHoleRecoveryTool>(this); - declareProperty("SeededSegmentFinder", m_seededSegmentFinder); - declareProperty("TrackSegmentMatchingTool",m_trackSegmentMatchingTool); - declareProperty("ChamberHoleRecoveryTool", m_chamberHoleRecoveryTool); - declareProperty("Extrapolator", m_extrapolator); - declareProperty("Fitter", m_fitter ); - declareProperty("MuonStationIntersectSvc", m_intersectSvc); - declareProperty("IdHelper", m_idHelperTool); - declareProperty("EDMHelper", m_helperTool); - declareProperty("EDMPrinter", m_printer); - declareProperty("HitSummaryTool", m_hitSummaryTool); - declareProperty("RegionSelector", m_regionSelector); - - declareProperty("DeltaEtaRegion", m_deta = 0.05); - declareProperty("DeltaPhiRegion", m_dphi = 0.1); - declareProperty("ExcludeEES", m_excludeEES = true); - declareProperty("OnlyEO", m_onlyEO = false); - declareProperty("UseFitterOutlierLogic", m_useFitterOutlierLogic = true ); +MuonSegmentRegionRecoveryTool::MuonSegmentRegionRecoveryTool(const std::string& ty, const std::string& na, const IInterface* pa) + : AthAlgTool(ty, na, pa), + m_seededSegmentFinder("Muon::MuonSeededSegmentFinder/MuonSeededSegmentFinder"), + m_trackSegmentMatchingTool("Muon::MooCandidateMatchingTool/MooCandidateMatchingTool"), + m_chamberHoleRecoveryTool("Muon::MuonChamberHoleRecoveryTool/MuonChamberHoleRecoveryTool"), + m_extrapolator("Trk::Extrapolator/MuonExtrapolator"), + m_fitter("Rec::CombinedMuonTrackBuilder/CombinedMuonTrackBuilder"), + m_intersectSvc("MuonStationIntersectSvc", name()), + m_idHelperTool("Muon::MuonIdHelperTool/MuonIdHelperTool"), + m_helperTool("Muon::MuonEDMHelperTool/MuonEDMHelperTool"), + m_printer("Muon::MuonEDMPrinterTool/MuonEDMPrinterTool"), + m_hitSummaryTool("Muon::MuonHitSummaryTool/MuonHitSummaryTool"), + m_regionSelector("RegSelSvc", name()) +{ + declareInterface<IMuonHoleRecoveryTool>(this); + declareProperty("SeededSegmentFinder", m_seededSegmentFinder); + declareProperty("TrackSegmentMatchingTool", m_trackSegmentMatchingTool); + declareProperty("ChamberHoleRecoveryTool", m_chamberHoleRecoveryTool); + declareProperty("Extrapolator", m_extrapolator); + declareProperty("Fitter", m_fitter ); + declareProperty("MuonStationIntersectSvc", m_intersectSvc); + declareProperty("IdHelper", m_idHelperTool); + declareProperty("EDMHelper", m_helperTool); + declareProperty("EDMPrinter", m_printer); + declareProperty("HitSummaryTool", m_hitSummaryTool); + declareProperty("RegionSelector", m_regionSelector); + + declareProperty("DeltaEtaRegion", m_deta = 0.05); + declareProperty("DeltaPhiRegion", m_dphi = 0.1); + 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() {} + +StatusCode MuonSegmentRegionRecoveryTool::initialize() +{ + + ATH_CHECK( detStore()->retrieve( m_detMgr ) ); + ATH_CHECK( m_helperTool.retrieve() ); + ATH_CHECK( m_intersectSvc.retrieve() ); + ATH_CHECK( m_printer.retrieve() ); + ATH_CHECK( m_seededSegmentFinder.retrieve() ); + + if ( !m_trackSegmentMatchingTool.empty() ) { + ATH_CHECK( m_trackSegmentMatchingTool.retrieve() ); + ATH_MSG_INFO("Using matching tool " << m_trackSegmentMatchingTool ); + } else { + ATH_MSG_DEBUG("No matching tool selected " ); } - - MuonSegmentRegionRecoveryTool::~MuonSegmentRegionRecoveryTool(){} - StatusCode MuonSegmentRegionRecoveryTool::initialize() - { + ATH_CHECK( m_chamberHoleRecoveryTool.retrieve() ); + ATH_CHECK( m_extrapolator.retrieve() ); + ATH_CHECK( m_fitter.retrieve() ); + ATH_CHECK( m_idHelperTool.retrieve() ); + ATH_CHECK( m_hitSummaryTool.retrieve() ); + ATH_CHECK( m_regionSelector.retrieve() ); - ATH_CHECK( detStore()->retrieve( m_detMgr ) ); - ATH_CHECK( m_helperTool.retrieve() ); - ATH_CHECK( m_intersectSvc.retrieve() ); - ATH_CHECK( m_printer.retrieve() ); - ATH_CHECK( m_seededSegmentFinder.retrieve() ); + return StatusCode::SUCCESS; +} - if( !m_trackSegmentMatchingTool.empty() ){ - ATH_CHECK( m_trackSegmentMatchingTool.retrieve() ); - ATH_MSG_INFO("Using matching tool " << m_trackSegmentMatchingTool ); - }else{ - ATH_MSG_DEBUG("No matching tool selected " ); - } +StatusCode MuonSegmentRegionRecoveryTool::finalize() +{ + return StatusCode::SUCCESS; +} - ATH_CHECK( m_chamberHoleRecoveryTool.retrieve() ); - ATH_CHECK( m_extrapolator.retrieve() ); - ATH_CHECK( m_fitter.retrieve() ); - ATH_CHECK( m_idHelperTool.retrieve() ); - ATH_CHECK( m_hitSummaryTool.retrieve() ); - ATH_CHECK( m_regionSelector.retrieve() ); - return StatusCode::SUCCESS; - } - - StatusCode MuonSegmentRegionRecoveryTool::finalize() - { - return StatusCode::SUCCESS; - } +Trk::Track* MuonSegmentRegionRecoveryTool::recover( const Trk::Track& track ) const { - - Trk::Track* MuonSegmentRegionRecoveryTool::recover( const Trk::Track& track ) const { + Trk::Track* result = recoverImp(track);; + if ( result ) ATH_MSG_DEBUG("Final track " << m_printer->print(*result) << std::endl << m_printer->printStations(*result) ); + else ATH_MSG_DEBUG("Track lost during recovery"); + return result; +} + +/**Algorithmic part + Strategy: + 1) Extrapolate back to MS entry record + 2) Collect hashes of chambers close to where the track passed + 3) Compare collected Hashes with the ones already on track + 4) Recover segments on the missing chambers by launching the SeededSegmentFinder +*/ - Trk::Track* result = recoverImp(track); - if( result ) ATH_MSG_DEBUG("Final track " << m_printer->print(*result) << std::endl << m_printer->printStations(*result) ); - else ATH_MSG_DEBUG("Track lost during recovery"); - return result; +Trk::Track* MuonSegmentRegionRecoveryTool::recoverImp( const Trk::Track& track ) const { + //Welcome into the implementation of the recovery method + ATH_MSG_VERBOSE(" Entering segment recovery method " << m_printer->print(track) << std::endl << m_printer->printStations(track) ); + + //First run the MuonChamberHoleRecoveryTool on the input track + const Trk::Track* chRecTrack = m_chamberHoleRecoveryTool->recover(track); + if (!chRecTrack) { + ATH_MSG_DEBUG(" MuonChamberHoleRecoveryTool failed to create a new track " + << " Returning input (unrecovered) track " ); + return new Trk::Track( track ); + } + ATH_MSG_VERBOSE(" After chamber hole recovery " << m_printer->print(track) << std::endl << m_printer->printStations(track) ); + + // only run this on single station EM tracks + if ( m_onlyEO ) { + // should be a sl track + if ( !m_helperTool->isSLTrack(*chRecTrack) ) return const_cast<Trk::Track*>(chRecTrack); + + // get hit summary + IMuonHitSummaryTool::CompactSummary hitSummary = m_hitSummaryTool->summary(*chRecTrack); + // should be single station + if ( hitSummary.stationLayers.size() != 1 || + !hitSummary.stationLayers.count(MuonStationIndex::EM) ) return const_cast<Trk::Track*>(chRecTrack); + ATH_MSG_DEBUG("Single station track, checking for EO hits"); } - /**Algorithmic part - Strategy: - 1) Extrapolate back to MS entry record - 2) Collect hashes of chambers close to where the track passed - 3) Compare collected Hashes with the ones already on track - 4) Recover segments on the missing chambers by launching the SeededSegmentFinder - */ - - Trk::Track* MuonSegmentRegionRecoveryTool::recoverImp( const Trk::Track& track ) const { - //Welcome into the implementation of the recovery method - ATH_MSG_VERBOSE(" Entering segment recovery method " << m_printer->print(track) << std::endl << m_printer->printStations(track) ); - - //First run the MuonChamberHoleRecoveryTool on the input track - const Trk::Track* chRecTrack = m_chamberHoleRecoveryTool->recover(track); - if(!chRecTrack){ - ATH_MSG_DEBUG(" MuonChamberHoleRecoveryTool failed to create a new track " - << " Returning input (unrecovered) track " ); - return new Trk::Track( track ); - } - ATH_MSG_VERBOSE(" After chamber hole recovery " << m_printer->print(track) << std::endl << m_printer->printStations(track) ); - - // only run this on single station EM tracks - if( m_onlyEO ){ - // should be a sl track - if( !m_helperTool->isSLTrack(*chRecTrack) ) return const_cast<Trk::Track*>(chRecTrack); - - // get hit summary - IMuonHitSummaryTool::CompactSummary hitSummary = m_hitSummaryTool->summary(*chRecTrack); - // should be single station - if( hitSummary.stationLayers.size() != 1 || - !hitSummary.stationLayers.count(MuonStationIndex::EM) ) return const_cast<Trk::Track*>(chRecTrack); - ATH_MSG_DEBUG("Single station track, checking for EO hits"); - } - - //1) Extrapolate back to MS entry record + //1) Extrapolate back to MS entry record // const Trk::TrackParameters* msEntryPars = goToMSEntryRecord( *chRecTrack ); // if(!msEntryPars) return chRecTrack; - - /** 2) Collect hashes of chambers close to where the track passed - 2a) Extrapolate forward to the next station - 2b) Launch selector to get IDHashes - 2c) push_back hashes for this station into a set - 2d) stop where outer layers are - 2e) the outcome of all of this is a std::set of collected hashes - (some are already on the track, no need to recover) */ - - - MuonData muonData; - // extract the hashes already on track - fillOnTrackChambers ( *chRecTrack, muonData ); - - // collect the hashes not in track close to the track - collectCrossedChambers( *chRecTrack, muonData ); - - //3b) compare the two std::sets and make a final std::set of not-yet-on-track Hashes - const Trk::Track* triggerRecTrack = addMissingChambers( *chRecTrack, muonData, false ); - if( triggerRecTrack ){ - if( chRecTrack != &track ) delete chRecTrack; - chRecTrack = triggerRecTrack; - } - - const Trk::Track* mdtRecTrack = addMissingChambers( *chRecTrack, muonData, true ); - if( mdtRecTrack ){ - if( chRecTrack != &track ) delete chRecTrack; - chRecTrack = mdtRecTrack; - } - - - const Trk::Track* mdtRecTrackWithHoles = findHoles( *chRecTrack, muonData ); - if( mdtRecTrackWithHoles ){ - if( chRecTrack != &track ) delete chRecTrack; - chRecTrack = mdtRecTrackWithHoles; - } - - //recovered track, success! - return const_cast<Trk::Track*>(chRecTrack); + + /** 2) Collect hashes of chambers close to where the track passed + 2a) Extrapolate forward to the next station + 2b) Launch selector to get IDHashes + 2c) push_back hashes for this station into a set + 2d) stop where outer layers are + 2e) the outcome of all of this is a std::set of collected hashes + (some are already on the track, no need to recover) */ + + + MuonData muonData; + // extract the hashes already on track + fillOnTrackChambers ( *chRecTrack, muonData ); + + // collect the hashes not in track close to the track + collectCrossedChambers( *chRecTrack, muonData ); + + //3b) compare the two std::sets and make a final std::set of not-yet-on-track Hashes + const Trk::Track* triggerRecTrack = addMissingChambers( *chRecTrack, muonData, false ); + if ( triggerRecTrack ) { + if ( chRecTrack != &track ) delete chRecTrack; + chRecTrack = triggerRecTrack; } - - - //// NO, NO, NO, should pass in an IRoiDescriptor - // void MuonSegmentRegionRecoveryTool::addHashes( DETID type, double etamin, double etamax, double phimin, double phimax, - void MuonSegmentRegionRecoveryTool::addHashes( DETID type, const IRoiDescriptor& roi, - std::set<IdentifierHash>& hashes, const std::set<IdentifierHash>& exclusion ) const { - - // if only looking at EO, skip all but MDT chambers - if( m_onlyEO && type != MDT ) return; - - std::vector<IdentifierHash> crossed; - - m_regionSelector->DetHashIDList(type, roi, crossed ); - - //if( type == MDT ) ATH_MSG_VERBOSE(" adding hashes for type " << type << " size " << crossed.size() << " eta,phi " << eta << " " << phi ); - for( std::vector<IdentifierHash>::iterator it = crossed.begin(); it!=crossed.end(); ++it ){ - if( !exclusion.count(*it) && !hashes.count(*it) ) { - if( type == MDT ) { - Identifier chId; - IdContext otCont = m_idHelperTool->mdtIdHelper().module_context(); - m_idHelperTool->mdtIdHelper().get_id(*it, chId, &otCont); - - if( m_excludeEES && m_idHelperTool->chamberIndex(chId) == MuonStationIndex::EES ){ - ATH_MSG_VERBOSE(" excluding " << *it << " " << m_idHelperTool->toStringChamber(chId) ); - continue; - } - if( m_onlyEO && m_idHelperTool->stationIndex(chId) != MuonStationIndex::EO ){ - ATH_MSG_VERBOSE(" excluding " << *it << " " << m_idHelperTool->toStringChamber(chId) ); - continue; - } - ATH_MSG_VERBOSE(" -- hash " << *it << " " << m_idHelperTool->toStringChamber(chId) ); - } - if( type == CSC ) { - Identifier chId; - IdContext otCont = m_idHelperTool->cscIdHelper().module_context(); - m_idHelperTool->cscIdHelper().get_id(*it, chId, &otCont); - ATH_MSG_VERBOSE(" -- csc hash " << *it << " " << m_idHelperTool->toStringChamber(chId) ); - } - hashes.insert(*it); - } - } + + const Trk::Track* mdtRecTrack = addMissingChambers( *chRecTrack, muonData, true ); + if ( mdtRecTrack ) { + if ( chRecTrack != &track ) delete chRecTrack; + chRecTrack = mdtRecTrack; } - void MuonSegmentRegionRecoveryTool::collectCrossedChambers( const Trk::Track& track, - MuonSegmentRegionRecoveryTool::MuonData& data ) const { - ATH_MSG_VERBOSE(" Collecting all crossed chambers" ); + const Trk::Track* mdtRecTrackWithHoles = findHoles( *chRecTrack, muonData ); + if ( mdtRecTrackWithHoles ) { + if ( chRecTrack != &track ) delete chRecTrack; + chRecTrack = mdtRecTrackWithHoles; + } + + //recovered track, success! + return const_cast<Trk::Track*>(chRecTrack); +} - const DataVector<const Trk::TrackStateOnSurface>* states = track.trackStateOnSurfaces(); - if( !states ){ - ATH_MSG_WARNING(" track without states, cannot perform cleaning "); - return; - } - - std::set<MuonStationIndex::StIndex> stations; - double etamin = 1e9; - double etamax= -1e9; - double phimin = 1e9; - double phimax= -1e9; - // loop over TSOSs - DataVector<const Trk::TrackStateOnSurface>::const_iterator tsit = states->begin(); - DataVector<const Trk::TrackStateOnSurface>::const_iterator tsit_end = states->end(); - - for( ; tsit!=tsit_end ; ++tsit ){ - - const Trk::TrackParameters* pars = (*tsit)->trackParameters(); - if( !pars ) continue; - - double rpos = pars->position().perp(); - double zpos = fabs(pars->position().z()); - double eta = pars->position().eta(); - double phi = pars->position().phi(); - if( msgLvl(MSG::DEBUG) ){ - msg() << "All State parameters: eta: " << eta << " ,phi: " << phi << " pos r " << rpos << " z " << zpos; - if( pars->covariance() ) msg() << MSG::DEBUG << " extrapolation error " << Amg::error(*pars->covariance(),Trk::locX); - msg() << endmsg; +//// NO, NO, NO, should pass in an IRoiDescriptor +// void MuonSegmentRegionRecoveryTool::addHashes( DETID type, double etamin, double etamax, double phimin, double phimax, +void MuonSegmentRegionRecoveryTool::addHashes( DETID type, const IRoiDescriptor& roi, + std::set<IdentifierHash>& hashes, const std::set<IdentifierHash>& exclusion ) const { + + // if only looking at EO, skip all but MDT chambers + if ( m_onlyEO && type != MDT ) return; + + std::vector<IdentifierHash> crossed; + + m_regionSelector->DetHashIDList(type, roi, crossed ); + + //if( type == MDT ) ATH_MSG_VERBOSE(" adding hashes for type " << type << " size " << crossed.size() << " eta,phi " << eta << " " << phi ); + for ( std::vector<IdentifierHash>::iterator it = crossed.begin(); it != crossed.end(); ++it ) { + if ( !exclusion.count(*it) && !hashes.count(*it) ) { + if ( type == MDT ) { + Identifier chId; + IdContext otCont = m_idHelperTool->mdtIdHelper().module_context(); + m_idHelperTool->mdtIdHelper().get_id(*it, chId, &otCont); + + if ( m_excludeEES && m_idHelperTool->chamberIndex(chId) == MuonStationIndex::EES ) { + ATH_MSG_VERBOSE(" excluding " << *it << " " << m_idHelperTool->toStringChamber(chId) ); + continue; + } + if ( m_onlyEO && m_idHelperTool->stationIndex(chId) != MuonStationIndex::EO ) { + 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( rpos < 2500 && zpos < 4000 ) continue; - - // check whether state is a measurement - const Trk::MeasurementBase* meas = (*tsit)->measurementOnTrack(); - if( !meas ) continue; - - Identifier id = m_helperTool->getIdentifier(*meas); - bool pseudo = !id.is_valid(); - - if( pseudo || !m_idHelperTool->mdtIdHelper().is_muon(id) ) continue; - - if( eta > etamax ) etamax = eta; - if( eta < etamin ) etamin = eta; - if( phi > phimax ) phimax = phi; - if( phi < phimin ) phimin = phi; - if( msgLvl(MSG::DEBUG) ){ - msg() << "Selected State parameters: eta: " << eta << " ,phi: " << phi << " pos r " << rpos << " z " << zpos; - if( pars->covariance() ) msg() << MSG::DEBUG << " extrapolation error " << Amg::error(*pars->covariance(),Trk::locX); - msg() << endmsg; + if ( type == CSC ) { + Identifier chId; + IdContext otCont = m_idHelperTool->cscIdHelper().module_context(); + m_idHelperTool->cscIdHelper().get_id(*it, chId, &otCont); + ATH_MSG_VERBOSE(" -- csc hash " << *it << " " << m_idHelperTool->toStringChamber(chId) ); } + // New Small Wheel + if ( type == STGC ) { + Identifier chId; +// IdContext otCont = m_idHelperTool->stgcIdHelper().module_context(); + IdContext otCont = m_idHelperTool->stgcIdHelper().detectorElement_context(); + m_idHelperTool->stgcIdHelper().get_id(*it, chId, &otCont); + ATH_MSG_VERBOSE(" -- stgc hash " << *it << " " << m_idHelperTool->toStringChamber(chId) ); + } + if ( type == MM ) { + Identifier chId; +// IdContext otCont = m_idHelperTool->mmIdHelper().module_context(); + IdContext otCont = m_idHelperTool->mmIdHelper().detectorElement_context(); + m_idHelperTool->mmIdHelper().get_id(*it, chId, &otCont); + ATH_MSG_VERBOSE(" -- mm hash " << *it << " " << m_idHelperTool->toStringChamber(chId) ); + } + hashes.insert(*it); + } + } +} - MuonStationIndex::StIndex stIndex = m_idHelperTool->stationIndex(id); - if( stations.count(stIndex) ) continue; - stations.insert(stIndex); - - - //At each station launch the Reg Sel and stuff the Id hashes in a vector - } - etamin -= m_deta; - etamax += m_deta; - phimin -= m_dphi; - phimax += m_dphi; - - ATH_MSG_DEBUG("Eta range: " << etamin << " " << etamax << " Phi range " << phimin << " " << phimax ); - if(etamin>etamax){ //something went wrong with the fit and no hits were selected in the loop - ATH_MSG_DEBUG("no hits selected, nothing further will be done"); - return; - } - - 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); - addHashes(CSC, roi, data.csc,data.cscTrack); - - - std::set<IdentifierHash>::iterator hsit = data.mdt.begin(); - std::set<IdentifierHash>::iterator hsit_end = data.mdt.end(); - for( ; hsit != hsit_end; ++hsit ){ - Identifier chId; - IdContext otCont = m_idHelperTool->mdtIdHelper().module_context(); - m_idHelperTool->mdtIdHelper().get_id(*hsit, chId, &otCont); - MuonStationIndex::ChIndex chIndex = m_idHelperTool->chamberIndex(chId); - data.mdtPerStation[chIndex].insert(*hsit); - ATH_MSG_VERBOSE(" chamberlayer " << MuonStationIndex::chName(chIndex) << " " << m_idHelperTool->toStringChamber(chId) ); - } - hsit = data.csc.begin(); - hsit_end = data.csc.end(); - for( ; hsit != hsit_end; ++hsit ){ - Identifier chId; - IdContext otCont = m_idHelperTool->cscIdHelper().module_context(); - m_idHelperTool->cscIdHelper().get_id(*hsit, chId, &otCont); - chId = m_idHelperTool->chamberId(chId); - MuonStationIndex::ChIndex chIndex = m_idHelperTool->chamberIndex(chId); - ATH_MSG_VERBOSE(" chamberlayer " << MuonStationIndex::chName(chIndex) << " " << m_idHelperTool->toString(chId) ); - } - } - - void MuonSegmentRegionRecoveryTool::fillOnTrackChambers ( const Trk::Track& track, MuonData& data ) const { - ATH_MSG_VERBOSE(" making set of already-on-track chambers" ); - - //Collect track PRD's - const DataVector<const Trk::TrackStateOnSurface>* states = track.trackStateOnSurfaces(); - if( !states ){ - ATH_MSG_WARNING(" track without states, cannot perform cleaning "); - return; + +void MuonSegmentRegionRecoveryTool::collectCrossedChambers( const Trk::Track& track, + MuonSegmentRegionRecoveryTool::MuonData& data ) const { + ATH_MSG_VERBOSE(" Collecting all crossed chambers" ); + + + const DataVector<const Trk::TrackStateOnSurface>* states = track.trackStateOnSurfaces(); + if ( !states ) { + ATH_MSG_WARNING(" track without states, cannot perform cleaning "); + return; + } + + std::set<MuonStationIndex::StIndex> stations; + double etamin = 1e9; + double etamax = -1e9; + double phimin = 1e9; + double phimax = -1e9; + // loop over TSOSs + DataVector<const Trk::TrackStateOnSurface>::const_iterator tsit = states->begin(); + DataVector<const Trk::TrackStateOnSurface>::const_iterator tsit_end = states->end(); + + for ( ; tsit != tsit_end ; ++tsit ) { + + const Trk::TrackParameters* pars = (*tsit)->trackParameters(); + if ( !pars ) continue; + + double rpos = pars->position().perp(); + double zpos = fabs(pars->position().z()); + double eta = pars->position().eta(); + double phi = pars->position().phi(); + if ( msgLvl(MSG::DEBUG) ) { + msg() << "All State parameters: eta: " << eta << " ,phi: " << phi << " pos r " << rpos << " z " << zpos; + if ( pars->covariance() ) msg() << MSG::DEBUG << " extrapolation error " << Amg::error(*pars->covariance(), Trk::locX); + msg() << endmsg; } + if ( rpos < 2500 && zpos < 4000 ) continue; - std::set<MuonStationIndex::StIndex> stations; + // check whether state is a measurement + const Trk::MeasurementBase* meas = (*tsit)->measurementOnTrack(); + if ( !meas ) continue; - // loop over TSOSs - DataVector<const Trk::TrackStateOnSurface>::const_iterator tsit = states->begin(); - DataVector<const Trk::TrackStateOnSurface>::const_iterator tsit_end = states->end(); - for( ; tsit!=tsit_end ; ++tsit ){ + Identifier id = m_helperTool->getIdentifier(*meas); + bool pseudo = !id.is_valid(); - const Trk::TrackParameters* pars = (*tsit)->trackParameters(); - if( !pars ) continue; + if ( pseudo || !m_idHelperTool->mdtIdHelper().is_muon(id) ) continue; - // check whether state is a measurement - const Trk::MeasurementBase* meas = (*tsit)->measurementOnTrack(); - if( !meas ) continue; + if ( eta > etamax ) etamax = eta; + if ( eta < etamin ) etamin = eta; + if ( phi > phimax ) phimax = phi; + if ( phi < phimin ) phimin = phi; + if ( msgLvl(MSG::DEBUG) ) { + msg() << "Selected State parameters: eta: " << eta << " ,phi: " << phi << " pos r " << rpos << " z " << zpos; + if ( pars->covariance() ) msg() << MSG::DEBUG << " extrapolation error " << Amg::error(*pars->covariance(), Trk::locX); + msg() << endmsg; + } - const Muon::MdtDriftCircleOnTrack* mdt = dynamic_cast<const Muon::MdtDriftCircleOnTrack*>(meas); - if(mdt && !data.mdtTrack.count(mdt->collectionHash()) ){ - data.mdtTrack.insert( mdt->collectionHash() ); - ATH_MSG_VERBOSE("Adding " << m_idHelperTool->toStringChamber(mdt->identify()) << " hash " << mdt->collectionHash() ); - continue; - } + MuonStationIndex::StIndex stIndex = m_idHelperTool->stationIndex(id); + if ( stations.count(stIndex) ) continue; + stations.insert(stIndex); - const MuonClusterOnTrack* clus = 0; - const CompetingMuonClustersOnTrack* compRot = dynamic_cast<const CompetingMuonClustersOnTrack*>(meas); - if( compRot ){ - clus = &compRot->rioOnTrack(0); - }else{ - clus = dynamic_cast<const MuonClusterOnTrack*>(meas); - } - if( !clus ) continue; - - const RpcClusterOnTrack* rpc=dynamic_cast<const RpcClusterOnTrack*>(clus); - if(rpc && !data.rpcTrack.count(rpc->collectionHash()) ){ - data.rpcTrack.insert( rpc->collectionHash() ); - ATH_MSG_VERBOSE("Adding " << m_idHelperTool->toStringChamber(clus->identify()) << " hash " << clus->collectionHash() ); - continue; - } - const TgcClusterOnTrack* tgc=dynamic_cast<const TgcClusterOnTrack*>(clus); - if(tgc && !data.tgcTrack.count(tgc->collectionHash()) ){ - data.tgcTrack.insert( tgc->collectionHash() ); - ATH_MSG_VERBOSE("Adding " << m_idHelperTool->toStringChamber(clus->identify()) << " hash " << clus->collectionHash() ); - continue; - } - const CscClusterOnTrack* csc=dynamic_cast<const CscClusterOnTrack*>(clus); - if(csc && !data.cscTrack.count(csc->collectionHash())){ - data.cscTrack.insert( csc->collectionHash() ); - ATH_MSG_VERBOSE("Adding " << m_idHelperTool->toStringChamber(clus->identify()) << " hash " << clus->collectionHash() ); - continue; - } + + //At each station launch the Reg Sel and stuff the Id hashes in a vector + } + etamin -= m_deta; + etamax += m_deta; + phimin -= m_dphi; + phimax += m_dphi; + + ATH_MSG_DEBUG("Eta range: " << etamin << " " << etamax << " Phi range " << phimin << " " << phimax ); + if (etamin > etamax) { //something went wrong with the fit and no hits were selected in the loop + ATH_MSG_DEBUG("no hits selected, nothing further will be done"); + return; + } + + 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); + + + std::set<IdentifierHash>::iterator hsit = data.mdt.begin(); + std::set<IdentifierHash>::iterator hsit_end = data.mdt.end(); + for ( ; hsit != hsit_end; ++hsit ) { + Identifier chId; + IdContext otCont = m_idHelperTool->mdtIdHelper().module_context(); + m_idHelperTool->mdtIdHelper().get_id(*hsit, chId, &otCont); + MuonStationIndex::ChIndex chIndex = m_idHelperTool->chamberIndex(chId); + data.mdtPerStation[chIndex].insert(*hsit); + ATH_MSG_VERBOSE(" chamberlayer " << MuonStationIndex::chName(chIndex) << " " << m_idHelperTool->toStringChamber(chId) ); + } + hsit = data.csc.begin(); + hsit_end = data.csc.end(); + for ( ; hsit != hsit_end; ++hsit ) { + Identifier chId; + IdContext otCont = m_idHelperTool->cscIdHelper().module_context(); + m_idHelperTool->cscIdHelper().get_id(*hsit, chId, &otCont); + chId = m_idHelperTool->chamberId(chId); + MuonStationIndex::ChIndex chIndex = m_idHelperTool->chamberIndex(chId); + ATH_MSG_VERBOSE(" chamberlayer " << MuonStationIndex::chName(chIndex) << " " << m_idHelperTool->toString(chId) ); + } +} + +void MuonSegmentRegionRecoveryTool::fillOnTrackChambers ( const Trk::Track& track, MuonData& data ) const { + ATH_MSG_VERBOSE(" making set of already-on-track chambers" ); + + //Collect track PRD's + const DataVector<const Trk::TrackStateOnSurface>* states = track.trackStateOnSurfaces(); + if ( !states ) { + ATH_MSG_WARNING(" track without states, cannot perform cleaning "); + return; + } + + std::set<MuonStationIndex::StIndex> stations; + + // loop over TSOSs + DataVector<const Trk::TrackStateOnSurface>::const_iterator tsit = states->begin(); + DataVector<const Trk::TrackStateOnSurface>::const_iterator tsit_end = states->end(); + for ( ; tsit != tsit_end ; ++tsit ) { + + const Trk::TrackParameters* pars = (*tsit)->trackParameters(); + if ( !pars ) continue; + + // check whether state is a measurement + const Trk::MeasurementBase* meas = (*tsit)->measurementOnTrack(); + if ( !meas ) continue; + + const Muon::MdtDriftCircleOnTrack* mdt = dynamic_cast<const Muon::MdtDriftCircleOnTrack*>(meas); + if (mdt && !data.mdtTrack.count(mdt->collectionHash()) ) { + data.mdtTrack.insert( mdt->collectionHash() ); + ATH_MSG_VERBOSE("Adding " << m_idHelperTool->toStringChamber(mdt->identify()) << " hash " << mdt->collectionHash() ); + continue; + } + + const MuonClusterOnTrack* clus = 0; + const CompetingMuonClustersOnTrack* compRot = dynamic_cast<const CompetingMuonClustersOnTrack*>(meas); + if ( compRot ) { + clus = &compRot->rioOnTrack(0); + } else { + clus = dynamic_cast<const MuonClusterOnTrack*>(meas); + } + if ( !clus ) continue; + + const RpcClusterOnTrack* rpc = dynamic_cast<const RpcClusterOnTrack*>(clus); + if (rpc && !data.rpcTrack.count(rpc->collectionHash()) ) { + data.rpcTrack.insert( rpc->collectionHash() ); + ATH_MSG_VERBOSE("Adding " << m_idHelperTool->toStringChamber(clus->identify()) << " hash " << clus->collectionHash() ); + continue; + } + const TgcClusterOnTrack* tgc = dynamic_cast<const TgcClusterOnTrack*>(clus); + if (tgc && !data.tgcTrack.count(tgc->collectionHash()) ) { + data.tgcTrack.insert( tgc->collectionHash() ); + ATH_MSG_VERBOSE("Adding " << m_idHelperTool->toStringChamber(clus->identify()) << " hash " << clus->collectionHash() ); + continue; + } + const CscClusterOnTrack* csc = dynamic_cast<const CscClusterOnTrack*>(clus); + if (csc && !data.cscTrack.count(csc->collectionHash())) { + data.cscTrack.insert( csc->collectionHash() ); + ATH_MSG_VERBOSE("Adding " << m_idHelperTool->toStringChamber(clus->identify()) << " hash " << clus->collectionHash() ); + continue; + } + // New Small Wheel + const sTgcClusterOnTrack* stgc = dynamic_cast<const sTgcClusterOnTrack*>(clus); + if (stgc && !data.stgcTrack.count(stgc->collectionHash()) ) { + data.stgcTrack.insert( stgc->collectionHash() ); + ATH_MSG_VERBOSE("Adding " << m_idHelperTool->toStringChamber(clus->identify()) << " hash " << clus->collectionHash() ); + continue; + } + const MMClusterOnTrack* mm = dynamic_cast<const MMClusterOnTrack*>(clus); + if (mm && !data.mmTrack.count(mm->collectionHash()) ) { + data.mmTrack.insert( mm->collectionHash() ); + ATH_MSG_VERBOSE("Adding " << m_idHelperTool->toStringChamber(clus->identify()) << " hash " << clus->collectionHash() ); + continue; } } +} - const Trk::Track* MuonSegmentRegionRecoveryTool::findHoles( const Trk::Track& track, MuonData& data ) const { +const Trk::Track* MuonSegmentRegionRecoveryTool::findHoles( const Trk::Track& track, MuonData& data ) const { - const DataVector<const Trk::TrackStateOnSurface>* oldStates = track.trackStateOnSurfaces(); - if( !oldStates ){ - ATH_MSG_WARNING(" track without states, cannot perform mdt hole search "); - return 0; + const DataVector<const Trk::TrackStateOnSurface>* oldStates = track.trackStateOnSurfaces(); + if ( !oldStates ) { + ATH_MSG_WARNING(" track without states, cannot perform mdt hole search "); + return 0; + } + + std::vector<const Trk::TrackStateOnSurface*> states; + unsigned int nholes = 0; + std::set<Identifier> chambersInSearch; + std::set<IdentifierHash>::const_iterator ith = data.mdt.begin(); + std::set<IdentifierHash>::const_iterator ith_end = data.mdt.end(); + for ( ; ith != ith_end; ith++ ) { + + // ignore hashes already on track + if ( data.mdtTrack.count(*ith) ) { + ATH_MSG_VERBOSE("Chamber already on track " << *ith ); + continue; + } + Identifier chId; + IdContext otCont = m_idHelperTool->mdtIdHelper().module_context(); + m_idHelperTool->mdtIdHelper().get_id(*ith, chId, &otCont); + + // ignore chambers that already had a hole search + if ( chambersInSearch.count(chId) ) { + ATH_MSG_VERBOSE("Chamber already on track " << *ith << " " << m_idHelperTool->toStringChamber(chId) ); + continue; + } + const MuonGM::MdtReadoutElement* detEl = m_detMgr->getMdtReadoutElement(chId); + if ( !detEl ) { + ATH_MSG_WARNING("Found no detector element for " << *ith ); + continue; + } + const Trk::TrackParameters* exPars = reachableDetEl(track, *detEl, true ); + if ( !exPars ) { + ATH_MSG_DEBUG("Did not reach " << m_idHelperTool->toStringChamber(chId) << " hash " << *ith ); + continue; } + //Identifier chId = m_idHelperTool->chamberId(detEl->identify()); + ATH_MSG_DEBUG("Reached " << m_idHelperTool->toStringChamber(chId) << " hash " << *ith ); - std::vector<const Trk::TrackStateOnSurface*> states; - unsigned int nholes = 0; - std::set<Identifier> chambersInSearch; - std::set<IdentifierHash>::const_iterator ith = data.mdt.begin(); - std::set<IdentifierHash>::const_iterator ith_end = data.mdt.end(); - for( ; ith != ith_end; ith++ ) { + // calculate crossed tubes + const MuonStationIntersect& intersect = m_intersectSvc->tubesCrossedByTrack(chId , exPars->position(), exPars->momentum().unit() ); - // ignore hashes already on track - if( data.mdtTrack.count(*ith) ) { - ATH_MSG_VERBOSE("Chamber already on track " << *ith ); - continue; - } - Identifier chId; - IdContext otCont = m_idHelperTool->mdtIdHelper().module_context(); - m_idHelperTool->mdtIdHelper().get_id(*ith, chId, &otCont); - - // ignore chambers that already had a hole search - if( chambersInSearch.count(chId) ) { - ATH_MSG_VERBOSE("Chamber already on track " << *ith << " " << m_idHelperTool->toStringChamber(chId) ); - continue; - } - const MuonGM::MdtReadoutElement* detEl = m_detMgr->getMdtReadoutElement(chId); - if( !detEl ){ - ATH_MSG_WARNING("Found no detector element for " << *ith ); - continue; + // clear hole vector + for ( unsigned int ii = 0; ii < intersect.tubeIntersects().size(); ++ii ) { + const MuonTubeIntersect& tint = intersect.tubeIntersects()[ii]; + const Identifier& id = tint.tubeId; + const MuonGM::MdtReadoutElement* detElLoc = m_detMgr->getMdtReadoutElement(id); + + // addition skip for cases when the track crosses inbetween two chambers + if ( data.mdtTrack.count(detElLoc->collectionHash()) ) continue; + + Identifier ch = m_idHelperTool->chamberId(id); + chambersInSearch.insert( ch ); + + const Trk::Surface& surf = detElLoc->surface(id); + const Trk::TrackParameters* tubePars = m_extrapolator->extrapolateDirectly(*exPars, surf, Trk::anyDirection, false, Trk::muon); + if ( !tubePars ) { + ATH_MSG_WARNING( "Failed to extrapolate to tube " << m_idHelperTool->toString(id) ); + continue; } - const Trk::TrackParameters* exPars = reachableDetEl(track,*detEl,true ); - if( !exPars ) { - ATH_MSG_DEBUG("Did not reach " << m_idHelperTool->toStringChamber(chId) << " hash " << *ith ); - continue; + int lay = m_idHelperTool->mdtIdHelper().tubeLayer(id); + int tube = m_idHelperTool->mdtIdHelper().tube(id); + double tubeLen = detElLoc->getActiveTubeLength(lay, tube); + double distEdge = fabs(tubePars->parameters()[Trk::locZ]) - 0.5 * tubeLen; + double pullEdge = tubePars->covariance() ? distEdge / Amg::error(*tubePars->covariance(), Trk::locZ) : distEdge / 20.; + const Amg::Vector2D* locPos = surf.Trk::Surface::globalToLocal(tubePars->position()); + bool inBounds = false; + if ( locPos ) { + + // perform bound check do not count holes with 100. mm of bound edge + inBounds = surf.bounds().insideLoc2(*locPos, -100.); + if ( inBounds ) { + if ( fabs( (*locPos)[Trk::locR] ) > 14.4 ) inBounds = false; + } + delete locPos; } - //Identifier chId = m_idHelperTool->chamberId(detEl->identify()); - ATH_MSG_DEBUG("Reached " << m_idHelperTool->toStringChamber(chId) << " hash " << *ith ); - - // calculate crossed tubes - const MuonStationIntersect& intersect = m_intersectSvc->tubesCrossedByTrack(chId , exPars->position(), exPars->momentum().unit() ); - - // clear hole vector - for( unsigned int ii=0;ii<intersect.tubeIntersects().size();++ii ){ - const MuonTubeIntersect& tint = intersect.tubeIntersects()[ii]; - const Identifier& id = tint.tubeId; - const MuonGM::MdtReadoutElement* detElLoc = m_detMgr->getMdtReadoutElement(id); - - // addition skip for cases when the track crosses inbetween two chambers - if( data.mdtTrack.count(detElLoc->collectionHash()) ) continue; - - Identifier ch = m_idHelperTool->chamberId(id); - chambersInSearch.insert( ch ); - - const Trk::Surface& surf = detElLoc->surface(id); - const Trk::TrackParameters* tubePars = m_extrapolator->extrapolateDirectly(*exPars,surf,Trk::anyDirection,false,Trk::muon); - if( !tubePars ){ - ATH_MSG_WARNING( "Failed to extrapolate to tube " << m_idHelperTool->toString(id) ); - continue; - } - int lay = m_idHelperTool->mdtIdHelper().tubeLayer(id); - int tube = m_idHelperTool->mdtIdHelper().tube(id); - double tubeLen = detElLoc->getActiveTubeLength(lay,tube); - double distEdge = fabs(tubePars->parameters()[Trk::locZ]) - 0.5*tubeLen; - double pullEdge = tubePars->covariance() ? distEdge/Amg::error(*tubePars->covariance(),Trk::locZ) : distEdge/20.; - const Amg::Vector2D* locPos = surf.Trk::Surface::globalToLocal(tubePars->position()); - bool inBounds = false; - if( locPos ){ - - // perform bound check do not count holes with 100. mm of bound edge - inBounds = surf.bounds().insideLoc2(*locPos,-100.); - if( inBounds ) { - if( fabs( (*locPos)[Trk::locR] ) > 14.4 ) inBounds = false; - } - delete locPos; - } - if( !inBounds ){ - ATH_MSG_VERBOSE(" discarding hole " << m_idHelperTool->toString(id) << " dist wire " - << tubePars->parameters()[Trk::locR] << " outside bounds " ); - delete tubePars; - continue; - } - ATH_MSG_VERBOSE(" new hole " << m_idHelperTool->toString(id) << " dist wire " << tubePars->parameters()[Trk::locR] - << " dist tube edge " << distEdge << " pullEdge " << pullEdge); - ++nholes; - Trk::TrackStateOnSurface* tsos = MuonTSOSHelper::createHoleTSOS(tubePars); - //std::cout << " adding TSOS " << tsos << std::endl; - states.push_back( tsos ); + if ( !inBounds ) { + ATH_MSG_VERBOSE(" discarding hole " << m_idHelperTool->toString(id) << " dist wire " + << tubePars->parameters()[Trk::locR] << " outside bounds " ); + delete tubePars; + continue; } - if( !nholes ) ATH_MSG_DEBUG("found holes " << nholes ); - delete exPars; + ATH_MSG_VERBOSE(" new hole " << m_idHelperTool->toString(id) << " dist wire " << tubePars->parameters()[Trk::locR] + << " dist tube edge " << distEdge << " pullEdge " << pullEdge); + ++nholes; + Trk::TrackStateOnSurface* tsos = MuonTSOSHelper::createHoleTSOS(tubePars); + //std::cout << " adding TSOS " << tsos << std::endl; + states.push_back( tsos ); } + if ( !nholes ) ATH_MSG_DEBUG("found holes " << nholes ); + delete exPars; + } - ith = data.csc.begin(); - ith_end = data.csc.end(); - for( ; ith != ith_end; ith++ ) { + ith = data.csc.begin(); + ith_end = data.csc.end(); + for ( ; ith != ith_end; ith++ ) { - // ignore hashes already on track - if( data.cscTrack.count(*ith) ) { - ATH_MSG_VERBOSE("Chamber already on track " << *ith ); - continue; - } - Identifier chId; - IdContext otCont = m_idHelperTool->cscIdHelper().module_context(); - m_idHelperTool->cscIdHelper().get_id(*ith, chId, &otCont); - chId = m_idHelperTool->chamberId(chId); - - const MuonGM::CscReadoutElement* detEl = m_detMgr->getCscReadoutElement(chId); - if( !detEl ){ - ATH_MSG_WARNING("Found no detector element for " << *ith << " " << m_idHelperTool->toString(chId) ); - continue; - } + // ignore hashes already on track + if ( data.cscTrack.count(*ith) ) { + ATH_MSG_VERBOSE("Chamber already on track " << *ith ); + continue; + } + Identifier chId; + IdContext otCont = m_idHelperTool->cscIdHelper().module_context(); + m_idHelperTool->cscIdHelper().get_id(*ith, chId, &otCont); + chId = m_idHelperTool->chamberId(chId); + + const MuonGM::CscReadoutElement* detEl = m_detMgr->getCscReadoutElement(chId); + if ( !detEl ) { + ATH_MSG_WARNING("Found no detector element for " << *ith << " " << m_idHelperTool->toString(chId) ); + continue; + } - const Trk::TrackParameters* exPars = reachableDetEl(track,*detEl, true ); - if( !exPars ) { - ATH_MSG_DEBUG("Did not reach " << m_idHelperTool->toStringChamber(chId) << " hash " << *ith ); - continue; + const Trk::TrackParameters* exPars = reachableDetEl(track, *detEl, true ); + if ( !exPars ) { + ATH_MSG_DEBUG("Did not reach " << m_idHelperTool->toStringChamber(chId) << " hash " << *ith ); + continue; + } + //Identifier chId = m_idHelperTool->chamberId(detEl->identify()); + Identifier detElId = m_idHelperTool->detElId( chId ); + std::set<Identifier> layIds; + std::vector< std::pair<bool, const Trk::TrackStateOnSurface* > > cscstates; + m_chamberHoleRecoveryTool->createHoleTSOSsForClusterChamber( detElId, *exPars, layIds, cscstates ); + std::vector< std::pair<bool, const Trk::TrackStateOnSurface* > >::iterator cscit = cscstates.begin(); + std::vector< std::pair<bool, const Trk::TrackStateOnSurface* > >::iterator cscit_end = cscstates.end(); + ATH_MSG_DEBUG("Reached " << m_idHelperTool->toString(chId) << " hash " << *ith << " holes " << cscstates.size() ); + + for ( ; cscit != cscit_end; ++cscit ) { + if ( cscit->first ) { + ATH_MSG_VERBOSE("Adding " << cscit->second ); + states.push_back( cscit->second ); } - //Identifier chId = m_idHelperTool->chamberId(detEl->identify()); - Identifier detElId = m_idHelperTool->detElId( chId ); - std::set<Identifier> layIds; - std::vector< std::pair<bool,const Trk::TrackStateOnSurface* > > cscstates; - m_chamberHoleRecoveryTool->createHoleTSOSsForClusterChamber( detElId, *exPars,layIds, cscstates ); - std::vector< std::pair<bool,const Trk::TrackStateOnSurface* > >::iterator cscit = cscstates.begin(); - std::vector< std::pair<bool,const Trk::TrackStateOnSurface* > >::iterator cscit_end = cscstates.end(); - ATH_MSG_DEBUG("Reached " << m_idHelperTool->toString(chId) << " hash " << *ith << " holes " << cscstates.size() ); - - for( ;cscit !=cscit_end;++cscit ){ - if( cscit->first ) { - ATH_MSG_VERBOSE("Adding " << cscit->second ); - states.push_back( cscit->second ); - } + } + delete exPars; + } + ith = data.tgc.begin(); + ith_end = data.tgc.end(); + for ( ; ith != ith_end; ith++ ) { + + // ignore hashes already on track + if ( data.tgcTrack.count(*ith) ) { + ATH_MSG_VERBOSE("Chamber already on track " << *ith ); + continue; + } + Identifier chId; + IdContext otCont = m_idHelperTool->tgcIdHelper().module_context(); + m_idHelperTool->tgcIdHelper().get_id(*ith, chId, &otCont); + chId = m_idHelperTool->chamberId(chId); + + const MuonGM::TgcReadoutElement* detEl = m_detMgr->getTgcReadoutElement(chId); + if ( !detEl ) { + ATH_MSG_WARNING("Found no detector element for " << *ith << " " << m_idHelperTool->toString(chId) ); + continue; + } + + const Trk::TrackParameters* exPars = reachableDetEl(track, *detEl, true ); + if ( !exPars ) { + ATH_MSG_DEBUG("Did not reach " << m_idHelperTool->toStringChamber(chId) << " hash " << *ith ); + continue; + } + //Identifier chId = m_idHelperTool->chamberId(detEl->identify()); + Identifier detElId = m_idHelperTool->detElId( chId ); + std::set<Identifier> layIds; + std::vector< std::pair<bool, const Trk::TrackStateOnSurface* > > tgcstates; + m_chamberHoleRecoveryTool->createHoleTSOSsForClusterChamber( detElId, *exPars, layIds, tgcstates ); + std::vector< std::pair<bool, const Trk::TrackStateOnSurface* > >::iterator tgcit = tgcstates.begin(); + std::vector< std::pair<bool, const Trk::TrackStateOnSurface* > >::iterator tgcit_end = tgcstates.end(); + ATH_MSG_DEBUG("Reached " << m_idHelperTool->toString(chId) << " hash " << *ith << " holes " << tgcstates.size() ); + + for ( ; tgcit != tgcit_end; ++tgcit ) { + if ( tgcit->first ) { + ATH_MSG_VERBOSE("Adding " << tgcit->second ); + states.push_back( tgcit->second ); } - delete exPars; - } + } + delete exPars; + } - ith = data.tgc.begin(); - ith_end = data.tgc.end(); - for( ; ith != ith_end; ith++ ) { + ith = data.rpc.begin(); + ith_end = data.rpc.end(); + for ( ; ith != ith_end; ith++ ) { - // ignore hashes already on track - if( data.tgcTrack.count(*ith) ) { - ATH_MSG_VERBOSE("Chamber already on track " << *ith ); - continue; - } - Identifier chId; - IdContext otCont = m_idHelperTool->tgcIdHelper().module_context(); - m_idHelperTool->tgcIdHelper().get_id(*ith, chId, &otCont); - chId = m_idHelperTool->chamberId(chId); - - const MuonGM::TgcReadoutElement* detEl = m_detMgr->getTgcReadoutElement(chId); - if( !detEl ){ - ATH_MSG_WARNING("Found no detector element for " << *ith << " " << m_idHelperTool->toString(chId) ); - continue; - } + // ignore hashes already on track + if ( data.rpcTrack.count(*ith) ) { + ATH_MSG_VERBOSE("Chamber already on track " << *ith ); + continue; + } + Identifier chId; + IdContext otCont = m_idHelperTool->rpcIdHelper().module_context(); + m_idHelperTool->rpcIdHelper().get_id(*ith, chId, &otCont); + chId = m_idHelperTool->chamberId(chId); + + const MuonGM::RpcReadoutElement* detEl = m_detMgr->getRpcReadoutElement(chId); + if ( !detEl ) { + ATH_MSG_WARNING("Found no detector element for " << *ith << " " << m_idHelperTool->toString(chId) ); + continue; + } - const Trk::TrackParameters* exPars = reachableDetEl(track,*detEl, true ); - if( !exPars ) { - ATH_MSG_DEBUG("Did not reach " << m_idHelperTool->toStringChamber(chId) << " hash " << *ith ); - continue; - } - //Identifier chId = m_idHelperTool->chamberId(detEl->identify()); - Identifier detElId = m_idHelperTool->detElId( chId ); - std::set<Identifier> layIds; - std::vector< std::pair<bool,const Trk::TrackStateOnSurface* > > tgcstates; - m_chamberHoleRecoveryTool->createHoleTSOSsForClusterChamber( detElId, *exPars,layIds, tgcstates ); - std::vector< std::pair<bool,const Trk::TrackStateOnSurface* > >::iterator tgcit = tgcstates.begin(); - std::vector< std::pair<bool,const Trk::TrackStateOnSurface* > >::iterator tgcit_end = tgcstates.end(); - ATH_MSG_DEBUG("Reached " << m_idHelperTool->toString(chId) << " hash " << *ith << " holes " << tgcstates.size() ); - - for( ;tgcit !=tgcit_end;++tgcit ){ - if( tgcit->first ) { - ATH_MSG_VERBOSE("Adding " << tgcit->second ); - states.push_back( tgcit->second ); - } + const Trk::TrackParameters* exPars = reachableDetEl(track, *detEl, true ); + if ( !exPars ) { + ATH_MSG_DEBUG("Did not reach " << m_idHelperTool->toStringChamber(chId) << " hash " << *ith ); + continue; + } + //Identifier chId = m_idHelperTool->chamberId(detEl->identify()); + Identifier detElId = m_idHelperTool->detElId( chId ); + std::set<Identifier> layIds; + std::vector< std::pair<bool, const Trk::TrackStateOnSurface* > > rpcstates; + m_chamberHoleRecoveryTool->createHoleTSOSsForClusterChamber( detElId, *exPars, layIds, rpcstates ); + std::vector< std::pair<bool, const Trk::TrackStateOnSurface* > >::iterator rpcit = rpcstates.begin(); + std::vector< std::pair<bool, const Trk::TrackStateOnSurface* > >::iterator rpcit_end = rpcstates.end(); + ATH_MSG_DEBUG("Reached " << m_idHelperTool->toString(chId) << " hash " << *ith << " holes " << rpcstates.size() ); + + for ( ; rpcit != rpcit_end; ++rpcit ) { + if ( rpcit->first ) { + ATH_MSG_VERBOSE("Adding " << rpcit->second ); + states.push_back( rpcit->second ); } - delete exPars; + } + delete exPars; + } + + + // New Small Wheel + // sTGC + ith = data.stgc.begin(); + ith_end = data.stgc.end(); + for ( ; ith != ith_end; ith++ ) { + + // ignore hashes already on track + if ( data.stgcTrack.count(*ith) ) { + ATH_MSG_VERBOSE("Chamber already on track " << *ith ); + continue; + } + Identifier chId; + IdContext otCont = m_idHelperTool->stgcIdHelper().module_context(); + m_idHelperTool->stgcIdHelper().get_id(*ith, chId, &otCont); + + if(!chId.is_valid()) { + ATH_MSG_VERBOSE("invalid chId for stgc data " << *ith ); + continue; } - ith = data.rpc.begin(); - ith_end = data.rpc.end(); - for( ; ith != ith_end; ith++ ) { + chId = m_idHelperTool->chamberId(chId); - // ignore hashes already on track - if( data.rpcTrack.count(*ith) ) { - ATH_MSG_VERBOSE("Chamber already on track " << *ith ); - continue; - } - Identifier chId; - IdContext otCont = m_idHelperTool->rpcIdHelper().module_context(); - m_idHelperTool->rpcIdHelper().get_id(*ith, chId, &otCont); - chId = m_idHelperTool->chamberId(chId); - - const MuonGM::RpcReadoutElement* detEl = m_detMgr->getRpcReadoutElement(chId); - if( !detEl ){ - ATH_MSG_WARNING("Found no detector element for " << *ith << " " << m_idHelperTool->toString(chId) ); - continue; - } + const MuonGM::sTgcReadoutElement* detEl = m_detMgr->getsTgcReadoutElement(chId); + if ( !detEl ) { + ATH_MSG_WARNING("Found no detector element for " << *ith << " " << m_idHelperTool->toString(chId) ); + continue; + } - const Trk::TrackParameters* exPars = reachableDetEl(track,*detEl, true ); - if( !exPars ) { - ATH_MSG_DEBUG("Did not reach " << m_idHelperTool->toStringChamber(chId) << " hash " << *ith ); - continue; - } - //Identifier chId = m_idHelperTool->chamberId(detEl->identify()); - Identifier detElId = m_idHelperTool->detElId( chId ); - std::set<Identifier> layIds; - std::vector< std::pair<bool,const Trk::TrackStateOnSurface* > > rpcstates; - m_chamberHoleRecoveryTool->createHoleTSOSsForClusterChamber( detElId, *exPars,layIds, rpcstates ); - std::vector< std::pair<bool,const Trk::TrackStateOnSurface* > >::iterator rpcit = rpcstates.begin(); - std::vector< std::pair<bool,const Trk::TrackStateOnSurface* > >::iterator rpcit_end = rpcstates.end(); - ATH_MSG_DEBUG("Reached " << m_idHelperTool->toString(chId) << " hash " << *ith << " holes " << rpcstates.size() ); - - for( ;rpcit !=rpcit_end;++rpcit ){ - if( rpcit->first ) { - ATH_MSG_VERBOSE("Adding " << rpcit->second ); - states.push_back( rpcit->second ); - } + const Trk::TrackParameters* exPars = reachableDetEl(track, *detEl, true ); + if ( !exPars ) { + ATH_MSG_DEBUG("Did not reach " << m_idHelperTool->toStringChamber(chId) << " hash " << *ith ); + continue; + } + //Identifier chId = m_idHelperTool->chamberId(detEl->identify()); + Identifier detElId = m_idHelperTool->detElId( chId ); + std::set<Identifier> layIds; + std::vector< std::pair<bool, const Trk::TrackStateOnSurface* > > stgcstates; + m_chamberHoleRecoveryTool->createHoleTSOSsForClusterChamber( detElId, *exPars, layIds, stgcstates ); + std::vector< std::pair<bool, const Trk::TrackStateOnSurface* > >::iterator stgcit = stgcstates.begin(); + std::vector< std::pair<bool, const Trk::TrackStateOnSurface* > >::iterator stgcit_end = stgcstates.end(); + ATH_MSG_DEBUG("Reached " << m_idHelperTool->toString(chId) << " hash " << *ith << " holes " << stgcstates.size() ); + + for ( ; stgcit != stgcit_end; ++stgcit ) { + if ( stgcit->first ) { + ATH_MSG_VERBOSE("Adding " << stgcit->second ); + states.push_back( stgcit->second ); } - delete exPars; - } + } + delete exPars; + } - if( !states.empty() ){ - //std::cout << " adding new states " << states.size() << std::endl; + // MM + ith = data.mm.begin(); + ith_end = data.mm.end(); + for ( ; ith != ith_end; ith++ ) { - // states were added, create a new track - DataVector<const Trk::TrackStateOnSurface>* trackStateOnSurfaces = new DataVector<const Trk::TrackStateOnSurface>(); - trackStateOnSurfaces->reserve( oldStates->size() + states.size() ); + // ignore hashes already on track + if ( data.mmTrack.count(*ith) ) { + ATH_MSG_VERBOSE("Chamber already on track " << *ith ); + continue; + } + Identifier chId; + IdContext otCont = m_idHelperTool->mmIdHelper().module_context(); + m_idHelperTool->mmIdHelper().get_id(*ith, chId, &otCont); - std::vector<const Trk::TrackStateOnSurface*> toBeSorted; - toBeSorted.reserve( oldStates->size() + states.size() ); - - DataVector<const Trk::TrackStateOnSurface>::const_iterator sit = oldStates->begin(); - DataVector<const Trk::TrackStateOnSurface>::const_iterator sit_end = oldStates->end(); - for( ;sit!=sit_end;++sit ) toBeSorted.push_back( (*sit)->clone() ); + if(!chId.is_valid()) { + ATH_MSG_VERBOSE("invalid chId for mm data " << *ith ); + continue; + } - std::vector<const Trk::TrackStateOnSurface*>::iterator sit1 = states.begin(); - std::vector<const Trk::TrackStateOnSurface*>::iterator sit1_end = states.end(); - //for( ;sit1!=sit1_end;++sit1 ) trackStateOnSurfaces->push_back( *sit1 ); - for( ;sit1!=sit1_end;++sit1 ) toBeSorted.push_back( *sit1 ); + chId = m_idHelperTool->chamberId(chId); - std::stable_sort(toBeSorted.begin(),toBeSorted.end(),SortTSOSs(&*m_helperTool,&*m_idHelperTool)); + const MuonGM::MMReadoutElement* detEl = m_detMgr->getMMReadoutElement(chId); + if ( !detEl ) { + ATH_MSG_WARNING("Found no detector element for " << *ith << " " << m_idHelperTool->toString(chId) ); + continue; + } - trackStateOnSurfaces->insert(trackStateOnSurfaces->begin(),toBeSorted.begin(),toBeSorted.end()); - Trk::Track* trackWithHoles = new Trk::Track( track.info(), trackStateOnSurfaces, track.fitQuality() ? track.fitQuality()->clone():0 ); - ATH_MSG_DEBUG("Track with holes " << m_printer->print(*trackWithHoles) << std::endl << m_printer->printStations(*trackWithHoles) ); - return trackWithHoles; + const Trk::TrackParameters* exPars = reachableDetEl(track, *detEl, true ); + if ( !exPars ) { + ATH_MSG_DEBUG("Did not reach " << m_idHelperTool->toStringChamber(chId) << " hash " << *ith ); + continue; } - return 0; + //Identifier chId = m_idHelperTool->chamberId(detEl->identify()); + Identifier detElId = m_idHelperTool->detElId( chId ); + std::set<Identifier> layIds; + std::vector< std::pair<bool, const Trk::TrackStateOnSurface* > > mmstates; + m_chamberHoleRecoveryTool->createHoleTSOSsForClusterChamber( detElId, *exPars, layIds, mmstates ); + std::vector< std::pair<bool, const Trk::TrackStateOnSurface* > >::iterator mmit = mmstates.begin(); + std::vector< std::pair<bool, const Trk::TrackStateOnSurface* > >::iterator mmit_end = mmstates.end(); + ATH_MSG_DEBUG("Reached " << m_idHelperTool->toString(chId) << " hash " << *ith << " holes " << mmstates.size() ); + + for ( ; mmit != mmit_end; ++mmit ) { + if ( mmit->first ) { + ATH_MSG_VERBOSE("Adding " << mmit->second ); + states.push_back( mmit->second ); + } + } + delete exPars; } - - const Trk::Track* MuonSegmentRegionRecoveryTool::addMissingChambers( const Trk::Track& track, MuonData& data, bool addMdt ) const { + + + + if ( !states.empty() ) { + //std::cout << " adding new states " << states.size() << std::endl; // states were added, create a new track - std::vector< std::pair<bool,const Trk::TrackStateOnSurface* > > states; - std::set<IdentifierHash> newMdtHashes; - std::set<IdentifierHash> newRpcHashes; - std::set<IdentifierHash> newTgcHashes; - std::set<IdentifierHash> newCscHashes; - if( addMdt){ - ATH_MSG_DEBUG("Adding Missing MDT chambers: regions " << data.mdtPerStation.size() ); - std::map<MuonStationIndex::ChIndex, std::set<IdentifierHash> >::iterator chit = data.mdtPerStation.begin(); - std::map<MuonStationIndex::ChIndex, std::set<IdentifierHash> >::iterator chit_end = data.mdtPerStation.end(); - std::vector<const MdtPrepDataCollection*> newmcols; - for( ;chit!=chit_end;++chit ){ - ATH_MSG_VERBOSE("Region " << MuonStationIndex::chName(chit->first) << " size " << chit->second.size() ); - std::vector<const MdtPrepDataCollection*> cols; - m_seededSegmentFinder->extractMdtPrdCols( chit->second, cols ); - std::vector<const MdtPrepDataCollection*>::iterator mit = cols.begin(); - std::vector<const MdtPrepDataCollection*>::iterator mit_end = cols.end(); - std::map<int,std::vector<const MdtPrepData*> > mdtPrds; - const Trk::TrackParameters* exParsFirst = 0; - for( ;mit!=mit_end;++mit ){ - const Trk::TrackParameters* exPars = reachableDetEl( track, *(*mit)->front()->detectorElement() ); - if( exPars ){ - int sector = m_idHelperTool->sector((*mit)->identify()); - ATH_MSG_DEBUG("New chamber " << m_idHelperTool->toStringChamber((*mit)->identify()) << " hash " << (*mit)->identifyHash() << " sector " << sector ); - newmcols.push_back(*mit); - std::vector<const MdtPrepData*>& col = mdtPrds[sector]; - col.insert(col.end(),(*mit)->begin(),(*mit)->end()); - if( !exParsFirst ) exParsFirst = exPars; - else delete exPars; - }else{ - ATH_MSG_DEBUG("Did not reach chamber " << m_idHelperTool->toStringChamber((*mit)->identify()) << " hash " << (*mit)->identifyHash() ); - } - } - std::vector<const MdtPrepData*>* prds = 0; - std::map<int,std::vector<const MdtPrepData*> >::iterator sectorIt = mdtPrds.begin(); - if( mdtPrds.empty() ){ - ATH_MSG_VERBOSE("No hits selected"); - }else if( mdtPrds.size() == 1 ){ - prds = §orIt->second; - }else{ - IMuonHitSummaryTool::CompactSummary hitSummary = m_hitSummaryTool->summary(track); - ATH_MSG_VERBOSE("Multiple sectors selected, using main sector: " << hitSummary.mainSector); - std::map<int,std::vector<const MdtPrepData*> >::iterator pos = mdtPrds.find(hitSummary.mainSector); - if( pos != mdtPrds.end() ) prds = &pos->second; - else{ - ATH_MSG_DEBUG("Failed to find prds in main sector: " << hitSummary.mainSector); - } - } - if( prds && exParsFirst){ - std::vector<const MuonSegment*>* segments = m_seededSegmentFinder->find(*exParsFirst,*prds ); - if( segments ){ - if( !segments->empty() ) ATH_MSG_DEBUG("found segments " << segments->size() ); - std::vector<const MuonSegment*>::iterator sit = segments->begin(); - std::vector<const MuonSegment*>::iterator sit_end = segments->end(); - - const MuonSegment* bestSegment = 0; - const Trk::TrackParameters* bestSegmentPars = 0; - for( ;sit!=sit_end;++sit ) { - - if( m_trackSegmentMatchingTool.empty() ) ATH_MSG_VERBOSE("No track/segment matching"); - else if( !m_trackSegmentMatchingTool->match(track,**sit,true) ) { - ATH_MSG_DEBUG(" Segment does not match with track "); - continue; - }else{ - ATH_MSG_DEBUG(" Segment/track matched successfully using " << m_trackSegmentMatchingTool ); - } - const Trk::TrackParameters* segPars = m_extrapolator->extrapolateDirectly(*exParsFirst,(*sit)->associatedSurface(), - Trk::anyDirection,false,Trk::muon); - if( segPars ){ - double resy = (*sit)->localParameters()[Trk::locY] - segPars->parameters()[Trk::locY]; - Trk::LocalDirection locDir; - (*sit)->associatedSurface().globalToLocalDirection(segPars->momentum(),locDir); - double dangleYZ = (*sit)->localDirection().angleYZ() - locDir.angleYZ(); - ATH_MSG_DEBUG("resy " << resy << " dangleYZ " << dangleYZ << " " << m_printer->print(**sit) ); - if( fabs(dangleYZ) < 0.05 ){ - bestSegment = *sit; - if( bestSegmentPars ) delete bestSegmentPars; - bestSegmentPars = segPars->clone(); - } - }else{ - ATH_MSG_DEBUG("Did not reach " << m_printer->print(**sit) ); - } - delete segPars; - } - if( bestSegment ){ - std::vector< const Trk::MeasurementBase* >::const_iterator hit = bestSegment->containedMeasurements().begin(); - std::vector< const Trk::MeasurementBase* >::const_iterator hit_end = bestSegment->containedMeasurements().end(); - for( ;hit!=hit_end;++hit ){ - const Trk::TrackParameters* hitPars = m_extrapolator->extrapolateDirectly(*bestSegmentPars,(*hit)->associatedSurface(), - Trk::anyDirection,false,Trk::muon); - if( hitPars ){ - std::bitset<Trk::TrackStateOnSurface::NumberOfTrackStateOnSurfaceTypes> typePattern; - typePattern.set(Trk::TrackStateOnSurface::Measurement); - Trk::TrackStateOnSurface* tsos = new Trk::TrackStateOnSurface( (*hit)->clone(),hitPars,0,0,typePattern ); - states.push_back( std::make_pair(true,tsos) ); - const MdtDriftCircleOnTrack* mdt = dynamic_cast<const MdtDriftCircleOnTrack*>(*hit); - if( mdt ) newMdtHashes.insert( mdt->collectionHash() ); - }else{ - ATH_MSG_WARNING("Failed to extrapolate to MDT hit "); - } - } - } - if( bestSegmentPars ) delete bestSegmentPars; - for( sit=segments->begin();sit!=sit_end;++sit ) delete *sit; - delete segments; - } - } - delete exParsFirst; + DataVector<const Trk::TrackStateOnSurface>* trackStateOnSurfaces = new DataVector<const Trk::TrackStateOnSurface>(); + trackStateOnSurfaces->reserve( oldStates->size() + states.size() ); + + std::vector<const Trk::TrackStateOnSurface*> toBeSorted; + toBeSorted.reserve( oldStates->size() + states.size() ); + + DataVector<const Trk::TrackStateOnSurface>::const_iterator sit = oldStates->begin(); + DataVector<const Trk::TrackStateOnSurface>::const_iterator sit_end = oldStates->end(); + for ( ; sit != sit_end; ++sit ) toBeSorted.push_back( (*sit)->clone() ); + + std::vector<const Trk::TrackStateOnSurface*>::iterator sit1 = states.begin(); + std::vector<const Trk::TrackStateOnSurface*>::iterator sit1_end = states.end(); + //for( ;sit1!=sit1_end;++sit1 ) trackStateOnSurfaces->push_back( *sit1 ); + for ( ; sit1 != sit1_end; ++sit1 ) toBeSorted.push_back( *sit1 ); + + std::stable_sort(toBeSorted.begin(), toBeSorted.end(), SortTSOSs(&*m_helperTool, &*m_idHelperTool)); + + trackStateOnSurfaces->insert(trackStateOnSurfaces->begin(), toBeSorted.begin(), toBeSorted.end()); + Trk::Track* trackWithHoles = new Trk::Track( track.info(), trackStateOnSurfaces, track.fitQuality() ? track.fitQuality()->clone() : 0 ); + ATH_MSG_DEBUG("Track with holes " << m_printer->print(*trackWithHoles) << std::endl << m_printer->printStations(*trackWithHoles) ); + return trackWithHoles; + } + return 0; +} + +const Trk::Track* MuonSegmentRegionRecoveryTool::addMissingChambers( const Trk::Track& track, MuonData& data, bool addMdt ) const { + + // states were added, create a new track + std::vector< std::pair<bool, const Trk::TrackStateOnSurface* > > states; + std::set<IdentifierHash> newMdtHashes; + std::set<IdentifierHash> newRpcHashes; + std::set<IdentifierHash> newTgcHashes; + std::set<IdentifierHash> newCscHashes; + // New Small Wheel + std::set<IdentifierHash> newMMHashes; + std::set<IdentifierHash> newsTgcHashes; + if ( addMdt) { + ATH_MSG_DEBUG("Adding Missing MDT chambers: regions " << data.mdtPerStation.size() ); + std::map<MuonStationIndex::ChIndex, std::set<IdentifierHash> >::iterator chit = data.mdtPerStation.begin(); + std::map<MuonStationIndex::ChIndex, std::set<IdentifierHash> >::iterator chit_end = data.mdtPerStation.end(); + std::vector<const MdtPrepDataCollection*> newmcols; + for ( ; chit != chit_end; ++chit ) { + ATH_MSG_VERBOSE("Region " << MuonStationIndex::chName(chit->first) << " size " << chit->second.size() ); + std::vector<const MdtPrepDataCollection*> cols; + m_seededSegmentFinder->extractMdtPrdCols( chit->second, cols ); + std::vector<const MdtPrepDataCollection*>::iterator mit = cols.begin(); + std::vector<const MdtPrepDataCollection*>::iterator mit_end = cols.end(); + std::map<int, std::vector<const MdtPrepData*> > mdtPrds; + const Trk::TrackParameters* exParsFirst = 0; + for ( ; mit != mit_end; ++mit ) { + const Trk::TrackParameters* exPars = reachableDetEl( track, *(*mit)->front()->detectorElement() ); + if ( exPars ) { + int sector = m_idHelperTool->sector((*mit)->identify()); + ATH_MSG_DEBUG("New chamber " << m_idHelperTool->toStringChamber((*mit)->identify()) << " hash " << (*mit)->identifyHash() << " sector " << sector ); + newmcols.push_back(*mit); + std::vector<const MdtPrepData*>& col = mdtPrds[sector]; + col.insert(col.end(), (*mit)->begin(), (*mit)->end()); + if ( !exParsFirst ) exParsFirst = exPars; + else delete exPars; + } else { + ATH_MSG_DEBUG("Did not reach chamber " << m_idHelperTool->toStringChamber((*mit)->identify()) << " hash " << (*mit)->identifyHash() ); + } } - data.mdtCols = newmcols; - }else{ - unsigned int nstates = states.size(); - m_seededSegmentFinder->extractRpcPrdCols( data.rpc, data.rpcCols ); - std::vector<const RpcPrepDataCollection*>::iterator rit = data.rpcCols.begin(); - std::vector<const RpcPrepDataCollection*>::iterator rit_end = data.rpcCols.end(); - std::vector<const RpcPrepDataCollection*> newrcols; - for( ;rit!=rit_end;++rit ){ - const Trk::TrackParameters* exPars = reachableDetEl( track, *(*rit)->front()->detectorElement() ); - if( exPars ){ - Identifier detElId = m_idHelperTool->detElId( (*rit)->identify() ); - std::set<Identifier> layIds; - m_chamberHoleRecoveryTool->createHoleTSOSsForClusterChamber( detElId, *exPars,layIds, states ); - if( states.size() != nstates ){ - nstates = states.size(); - newRpcHashes.insert( (*rit)->identifyHash() ); - } - delete exPars; - } + std::vector<const MdtPrepData*>* prds = 0; + std::map<int, std::vector<const MdtPrepData*> >::iterator sectorIt = mdtPrds.begin(); + if ( mdtPrds.empty() ) { + ATH_MSG_VERBOSE("No hits selected"); + } else if ( mdtPrds.size() == 1 ) { + prds = §orIt->second; + } else { + IMuonHitSummaryTool::CompactSummary hitSummary = m_hitSummaryTool->summary(track); + ATH_MSG_VERBOSE("Multiple sectors selected, using main sector: " << hitSummary.mainSector); + std::map<int, std::vector<const MdtPrepData*> >::iterator pos = mdtPrds.find(hitSummary.mainSector); + if ( pos != mdtPrds.end() ) prds = &pos->second; + else { + ATH_MSG_DEBUG("Failed to find prds in main sector: " << hitSummary.mainSector); + } } - data.rpcCols = newrcols; - - m_seededSegmentFinder->extractTgcPrdCols( data.tgc, data.tgcCols ); - std::vector<const TgcPrepDataCollection*>::const_iterator tit = data.tgcCols.begin(); - std::vector<const TgcPrepDataCollection*>::const_iterator tit_end = data.tgcCols.end(); - std::vector<const TgcPrepDataCollection*> newtcols; - for( ;tit!=tit_end;++tit ){ - const Trk::TrackParameters* exPars = reachableDetEl( track, *(*tit)->front()->detectorElement() ); - if( exPars ){ - newtcols.push_back(*tit); - Identifier detElId = m_idHelperTool->detElId( (*tit)->identify() ); - std::set<Identifier> layIds; - m_chamberHoleRecoveryTool->createHoleTSOSsForClusterChamber( detElId, *exPars,layIds, states ); - if( states.size() != nstates ){ - nstates = states.size(); - newTgcHashes.insert( (*tit)->identifyHash() ); - } - - delete exPars; - } + if ( prds && exParsFirst) { + std::vector<const MuonSegment*>* segments = m_seededSegmentFinder->find(*exParsFirst, *prds ); + if ( segments ) { + if ( !segments->empty() ) ATH_MSG_DEBUG("found segments " << segments->size() ); + std::vector<const MuonSegment*>::iterator sit = segments->begin(); + std::vector<const MuonSegment*>::iterator sit_end = segments->end(); + + const MuonSegment* bestSegment = 0; + const Trk::TrackParameters* bestSegmentPars = 0; + for ( ; sit != sit_end; ++sit ) { + + if ( m_trackSegmentMatchingTool.empty() ) ATH_MSG_VERBOSE("No track/segment matching"); + else if ( !m_trackSegmentMatchingTool->match(track, **sit, true) ) { + ATH_MSG_DEBUG(" Segment does not match with track "); + continue; + } else { + ATH_MSG_DEBUG(" Segment/track matched successfully using " << m_trackSegmentMatchingTool ); + } + const Trk::TrackParameters* segPars = m_extrapolator->extrapolateDirectly(*exParsFirst, (*sit)->associatedSurface(), + Trk::anyDirection, false, Trk::muon); + if ( segPars ) { + double resy = (*sit)->localParameters()[Trk::locY] - segPars->parameters()[Trk::locY]; + Trk::LocalDirection locDir; + (*sit)->associatedSurface().globalToLocalDirection(segPars->momentum(), locDir); + double dangleYZ = (*sit)->localDirection().angleYZ() - locDir.angleYZ(); + ATH_MSG_DEBUG("resy " << resy << " dangleYZ " << dangleYZ << " " << m_printer->print(**sit) ); + if ( fabs(dangleYZ) < 0.05 ) { + bestSegment = *sit; + if ( bestSegmentPars ) delete bestSegmentPars; + bestSegmentPars = segPars->clone(); + } + } else { + ATH_MSG_DEBUG("Did not reach " << m_printer->print(**sit) ); + } + delete segPars; + } + if ( bestSegment ) { + std::vector< const Trk::MeasurementBase* >::const_iterator hit = bestSegment->containedMeasurements().begin(); + std::vector< const Trk::MeasurementBase* >::const_iterator hit_end = bestSegment->containedMeasurements().end(); + for ( ; hit != hit_end; ++hit ) { + const Trk::TrackParameters* hitPars = m_extrapolator->extrapolateDirectly(*bestSegmentPars, (*hit)->associatedSurface(), + Trk::anyDirection, false, Trk::muon); + if ( hitPars ) { + std::bitset<Trk::TrackStateOnSurface::NumberOfTrackStateOnSurfaceTypes> typePattern; + typePattern.set(Trk::TrackStateOnSurface::Measurement); + Trk::TrackStateOnSurface* tsos = new Trk::TrackStateOnSurface( (*hit)->clone(), hitPars, 0, 0, typePattern ); + states.push_back( std::make_pair(true, tsos) ); + const MdtDriftCircleOnTrack* mdt = dynamic_cast<const MdtDriftCircleOnTrack*>(*hit); + if ( mdt ) newMdtHashes.insert( mdt->collectionHash() ); + } else { + ATH_MSG_WARNING("Failed to extrapolate to MDT hit "); + } + } + } + if ( bestSegmentPars ) delete bestSegmentPars; + for ( sit = segments->begin(); sit != sit_end; ++sit ) delete *sit; + delete segments; + } } - data.tgcCols = newtcols; + delete exParsFirst; + } + data.mdtCols = newmcols; + } else { + unsigned int nstates = states.size(); + m_seededSegmentFinder->extractRpcPrdCols( data.rpc, data.rpcCols ); + std::vector<const RpcPrepDataCollection*>::iterator rit = data.rpcCols.begin(); + std::vector<const RpcPrepDataCollection*>::iterator rit_end = data.rpcCols.end(); + std::vector<const RpcPrepDataCollection*> newrcols; + for ( ; rit != rit_end; ++rit ) { + const Trk::TrackParameters* exPars = reachableDetEl( track, *(*rit)->front()->detectorElement() ); + if ( exPars ) { + Identifier detElId = m_idHelperTool->detElId( (*rit)->identify() ); + std::set<Identifier> layIds; + m_chamberHoleRecoveryTool->createHoleTSOSsForClusterChamber( detElId, *exPars, layIds, states ); + if ( states.size() != nstates ) { + nstates = states.size(); + newRpcHashes.insert( (*rit)->identifyHash() ); + } + delete exPars; + } + } + data.rpcCols = newrcols; + + m_seededSegmentFinder->extractTgcPrdCols( data.tgc, data.tgcCols ); + std::vector<const TgcPrepDataCollection*>::const_iterator tit = data.tgcCols.begin(); + std::vector<const TgcPrepDataCollection*>::const_iterator tit_end = data.tgcCols.end(); + std::vector<const TgcPrepDataCollection*> newtcols; + for ( ; tit != tit_end; ++tit ) { + const Trk::TrackParameters* exPars = reachableDetEl( track, *(*tit)->front()->detectorElement() ); + if ( exPars ) { + newtcols.push_back(*tit); + Identifier detElId = m_idHelperTool->detElId( (*tit)->identify() ); + std::set<Identifier> layIds; + m_chamberHoleRecoveryTool->createHoleTSOSsForClusterChamber( detElId, *exPars, layIds, states ); + if ( states.size() != nstates ) { + nstates = states.size(); + newTgcHashes.insert( (*tit)->identifyHash() ); + } + + delete exPars; + } + } + data.tgcCols = newtcols; + if (!m_doNSW) { 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(); std::vector<const CscPrepDataCollection*> newccols; - for( ;cit!=cit_end;++cit ){ - const Trk::TrackParameters* exPars = reachableDetEl( track, *(*cit)->front()->detectorElement() ); - if( exPars ){ - newccols.push_back(*cit); - Identifier detElId = m_idHelperTool->detElId( (*cit)->identify() ); - std::set<Identifier> layIds; - m_chamberHoleRecoveryTool->createHoleTSOSsForClusterChamber( detElId, *exPars,layIds, states ); - if( states.size() != nstates ){ - nstates = states.size(); - newCscHashes.insert( (*cit)->identifyHash() ); - } - - delete exPars; - } + for ( ; cit != cit_end; ++cit ) { + const Trk::TrackParameters* exPars = reachableDetEl( track, *(*cit)->front()->detectorElement() ); + if ( exPars ) { + newccols.push_back(*cit); + Identifier detElId = m_idHelperTool->detElId( (*cit)->identify() ); + std::set<Identifier> layIds; + m_chamberHoleRecoveryTool->createHoleTSOSsForClusterChamber( detElId, *exPars, layIds, states ); + if ( states.size() != nstates ) { + nstates = states.size(); + newCscHashes.insert( (*cit)->identifyHash() ); + } + + delete exPars; + } } data.cscCols = newccols; } - if( !states.empty() ) { - ATH_MSG_DEBUG("Collected new states: " << states.size()); - - const DataVector<const Trk::TrackStateOnSurface>* oldStates = track.trackStateOnSurfaces(); - if( !oldStates ){ - ATH_MSG_WARNING(" track without states, cannot perform cleaning "); - std::vector< std::pair<bool,const Trk::TrackStateOnSurface* > >::iterator nit = states.begin(); - std::vector< std::pair<bool,const Trk::TrackStateOnSurface* > >::iterator nit_end = states.end(); - for( ;nit!=nit_end;++nit ){ - if( nit->first ) delete nit->second; - } - return 0; - } - - - // states were added, create a new track - std::vector<const Trk::TrackStateOnSurface*> newStates; - newStates.reserve( oldStates->size() + states.size() ); - - ATH_MSG_DEBUG("Copying old TSOSs " << oldStates->size()); - DataVector<const Trk::TrackStateOnSurface>::const_iterator tsit = oldStates->begin(); - DataVector<const Trk::TrackStateOnSurface>::const_iterator tsit_end = oldStates->end(); - for( ;tsit!=tsit_end;++tsit ) newStates.push_back( (*tsit)->clone() ); - - - ATH_MSG_DEBUG("Adding new TSOSs " << states.size() << " current size " << newStates.size()); - std::vector< std::pair<bool,const Trk::TrackStateOnSurface*> >::iterator nit = states.begin(); - std::vector< std::pair<bool,const Trk::TrackStateOnSurface*> >::iterator nit_end = states.end(); - for( ;nit!=nit_end;++nit ){ - // add states. If nit->first is true we have a new state. If it is false the state is from the old track and has to be cloned - newStates.push_back( nit->first ? nit->second : nit->second->clone() ); + } + + if(m_doNSW) { + // New Small Wheel + // sTGC + unsigned int nstates = states.size(); + 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(); + std::vector<const sTgcPrepDataCollection*> newstcols; + ATH_MSG_DEBUG(" extractsTgcPrdCols data.stgcCols.size() " << data.stgcCols.size()); + for ( ; stit != stit_end; ++stit ) { + const Trk::TrackParameters* exPars = reachableDetEl( track, *(*stit)->front()->detectorElement() ); + if ( exPars ) { + newstcols.push_back(*stit); + Identifier detElId = m_idHelperTool->detElId( (*stit)->identify() ); + std::set<Identifier> layIds; + m_chamberHoleRecoveryTool->createHoleTSOSsForClusterChamber( detElId, *exPars, layIds, states ); + ATH_MSG_DEBUG("Collected new sTgc states: " << states.size()); + if ( states.size() != nstates ) { + nstates = states.size(); + newsTgcHashes.insert( (*stit)->identifyHash() ); + } + + delete exPars; } - std::stable_sort(newStates.begin(),newStates.end(),SortTSOSs(&*m_helperTool,&*m_idHelperTool)); - - ATH_MSG_DEBUG("Filling DataVector with TSOSs " << newStates.size()); - DataVector<const Trk::TrackStateOnSurface>* trackStateOnSurfaces = new DataVector<const Trk::TrackStateOnSurface>(); - trackStateOnSurfaces->reserve( newStates.size() ); - trackStateOnSurfaces->insert( trackStateOnSurfaces->begin(), newStates.begin(), newStates.end() ); - - ATH_MSG_DEBUG("Creating new Track " << newStates.size()); - Trk::Track* newTrack = new Trk::Track( track.info(), trackStateOnSurfaces, track.fitQuality() ? track.fitQuality()->clone():0 ); - const Trk::Track* refittedTrack = m_fitter->fit(*newTrack,m_useFitterOutlierLogic,Trk::muon); - delete newTrack; - if( refittedTrack ){ - ATH_MSG_DEBUG("New Track " << m_printer->print(*refittedTrack) << std::endl << m_printer->printStations(*refittedTrack) ); - - // fit ok, add new hashs to lists - data.mdtTrack.insert(newMdtHashes.begin(),newMdtHashes.end()); - data.rpcTrack.insert(newRpcHashes.begin(),newRpcHashes.end()); - data.tgcTrack.insert(newTgcHashes.begin(),newTgcHashes.end()); - data.cscTrack.insert(newCscHashes.begin(),newCscHashes.end()); + } + data.stgcCols = newstcols; + + // MM + 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(); + std::vector<const MMPrepDataCollection*>::const_iterator mit_end = data.mmCols.end(); + std::vector<const MMPrepDataCollection*> newmcols; + for ( ; mit != mit_end; ++mit ) { + const Trk::TrackParameters* exPars = reachableDetEl( track, *(*mit)->front()->detectorElement() ); + if ( exPars ) { + newmcols.push_back(*mit); + Identifier detElId = m_idHelperTool->detElId( (*mit)->identify() ); + std::set<Identifier> layIds; + m_chamberHoleRecoveryTool->createHoleTSOSsForClusterChamber( detElId, *exPars, layIds, states ); + ATH_MSG_DEBUG("Collected new Mm states: " << states.size()); + if ( states.size() != nstates ) { + nstates = states.size(); + newMMHashes.insert( (*mit)->identifyHash() ); + } + + delete exPars; } - return refittedTrack; } - return 0; - //delete newStates; + data.mmCols = newmcols; + } - - const Trk::TrackParameters* MuonSegmentRegionRecoveryTool::reachableDetEl( const Trk::Track& track, const Trk::TrkDetElementBase& detEl, bool smallerBounds ) const{ - - ATH_MSG_VERBOSE( "reachableDetEl() " << m_idHelperTool->toStringDetEl( detEl.identify() ) << " at " << detEl.center() ); - const Trk::TrackParameters* exPars = 0; - Trk::TrackParameters* closest = MuonGetClosestParameters::closestParameters(track,detEl.surface(),true); - if( closest ){ - if( msgLvl(MSG::VERBOSE) ){ - ATH_MSG_VERBOSE( "Extrapolating from closest point:\n" << m_printer->print( *closest ) ); - } - exPars = m_extrapolator->extrapolateDirectly(*closest,detEl.surface(),Trk::anyDirection,false,Trk::muon); - delete closest; - }else{ - ATH_MSG_VERBOSE( "Extrapolating from track (no closest point found):\n" << m_printer->print( track ) ); - exPars = m_extrapolator->extrapolate(track,detEl.surface(),Trk::anyDirection,false,Trk::muon); - } - if( !exPars ) return 0; - Amg::Vector2D locPos( exPars->parameters()[Trk::locX], exPars->parameters()[Trk::locY] ); - - double tolx = 100.; // positive -> large surface - double toly = 100.; // positive -> large surface - const AmgSymMatrix(5)* errMat = exPars->covariance(); - if( errMat ) { - ATH_MSG_VERBOSE( "Extrapolated local Position & Error matrix\n:" << locPos << "\n" << Amg::toString(*errMat) ); - // MJW check validity of errors before using them (fix for bug #82920) - double covx = (*errMat)(Trk::locX,Trk::locX); - double covy = (*errMat)(Trk::locY,Trk::locY); - if ( covx > 0.0 && covy > 0.0 ) { - tolx = 3 * covx ; - toly = 3 * covy; + + if ( !states.empty() ) { + ATH_MSG_DEBUG("Collected new states: " << states.size()); + + const DataVector<const Trk::TrackStateOnSurface>* oldStates = track.trackStateOnSurfaces(); + if ( !oldStates ) { + ATH_MSG_WARNING(" track without states, cannot perform cleaning "); + std::vector< std::pair<bool, const Trk::TrackStateOnSurface* > >::iterator nit = states.begin(); + std::vector< std::pair<bool, const Trk::TrackStateOnSurface* > >::iterator nit_end = states.end(); + for ( ; nit != nit_end; ++nit ) { + if ( nit->first ) delete nit->second; } + return 0; } - // in case we are looking for holes, only ignore stations if we are within 100 mm of the chamber edge - // all other holes are counted even if the extrapolation errors are large. - if( smallerBounds ) { - if( tolx > 10. ) tolx = 10.; - if( toly > 10. ) toly = 10.; - // refer sign to check 'inside' the bounds - tolx *= -1.; - toly *= -1.; - } - bool inbounds = detEl.surface().insideBounds(locPos,tolx,toly); - - if( msgLvl(MSG::DEBUG) ){ - - std::ostringstream parsType; - parsType << "pos=(" << locPos[Trk::locX] - << "," << locPos[Trk::locY] << ")"; - if( errMat ) { - parsType << " exError=(" << Amg::error(*errMat,Trk::locX) << "," << Amg::error(*errMat,Trk::locY) << ")"; - } - parsType << " tolerance=(" << tolx << "," << toly << ")"; - if( inbounds ) parsType << " => inbounds"; - else parsType << " => outbounds"; - ATH_MSG_DEBUG(" " << m_idHelperTool->toStringChamber( detEl.identify() ) << " pars " << parsType.str() ); + + // states were added, create a new track + std::vector<const Trk::TrackStateOnSurface*> newStates; + newStates.reserve( oldStates->size() + states.size() ); + + ATH_MSG_DEBUG("Copying old TSOSs " << oldStates->size()); + DataVector<const Trk::TrackStateOnSurface>::const_iterator tsit = oldStates->begin(); + DataVector<const Trk::TrackStateOnSurface>::const_iterator tsit_end = oldStates->end(); + for ( ; tsit != tsit_end; ++tsit ) newStates.push_back( (*tsit)->clone() ); + + + ATH_MSG_DEBUG("Adding new TSOSs " << states.size() << " current size " << newStates.size()); + std::vector< std::pair<bool, const Trk::TrackStateOnSurface*> >::iterator nit = states.begin(); + std::vector< std::pair<bool, const Trk::TrackStateOnSurface*> >::iterator nit_end = states.end(); + for ( ; nit != nit_end; ++nit ) { + // add states. If nit->first is true we have a new state. If it is false the state is from the old track and has to be cloned + newStates.push_back( nit->first ? nit->second : nit->second->clone() ); } - if( !inbounds ) { - delete exPars; - return 0; + std::stable_sort(newStates.begin(), newStates.end(), SortTSOSs(&*m_helperTool, &*m_idHelperTool)); + + ATH_MSG_DEBUG("Filling DataVector with TSOSs " << newStates.size()); + DataVector<const Trk::TrackStateOnSurface>* trackStateOnSurfaces = new DataVector<const Trk::TrackStateOnSurface>(); + trackStateOnSurfaces->reserve( newStates.size() ); + trackStateOnSurfaces->insert( trackStateOnSurfaces->begin(), newStates.begin(), newStates.end() ); + + ATH_MSG_DEBUG("Creating new Track " << newStates.size()); + Trk::Track* newTrack = new Trk::Track( track.info(), trackStateOnSurfaces, track.fitQuality() ? track.fitQuality()->clone() : 0 ); + const Trk::Track* refittedTrack = m_fitter->fit(*newTrack, m_useFitterOutlierLogic, Trk::muon); + delete newTrack; + if ( refittedTrack ) { + ATH_MSG_DEBUG("New Track " << m_printer->print(*refittedTrack) << std::endl << m_printer->printStations(*refittedTrack) ); + + // fit ok, add new hashs to lists + data.mdtTrack.insert(newMdtHashes.begin(), newMdtHashes.end()); + data.rpcTrack.insert(newRpcHashes.begin(), newRpcHashes.end()); + data.tgcTrack.insert(newTgcHashes.begin(), newTgcHashes.end()); + data.cscTrack.insert(newCscHashes.begin(), newCscHashes.end()); + // New Small Wheel + data.stgcTrack.insert(newsTgcHashes.begin(), newsTgcHashes.end()); + data.mmTrack.insert(newMMHashes.begin(), newMMHashes.end()); + } + return refittedTrack; + } + return 0; + //delete newStates; +} + +const Trk::TrackParameters* MuonSegmentRegionRecoveryTool::reachableDetEl( const Trk::Track& track, const Trk::TrkDetElementBase& detEl, bool smallerBounds ) const { + + ATH_MSG_VERBOSE( "reachableDetEl() " << m_idHelperTool->toStringDetEl( detEl.identify() ) << " at " << detEl.center() ); + const Trk::TrackParameters* exPars = 0; + Trk::TrackParameters* closest = MuonGetClosestParameters::closestParameters(track, detEl.surface(), true); + if ( closest ) { + if ( msgLvl(MSG::VERBOSE) ) { + ATH_MSG_VERBOSE( "Extrapolating from closest point:\n" << m_printer->print( *closest ) ); + } + exPars = m_extrapolator->extrapolateDirectly(*closest, detEl.surface(), Trk::anyDirection, false, Trk::muon); + delete closest; + } else { + ATH_MSG_VERBOSE( "Extrapolating from track (no closest point found):\n" << m_printer->print( track ) ); + exPars = m_extrapolator->extrapolate(track, detEl.surface(), Trk::anyDirection, false, Trk::muon); + } + if ( !exPars ) return 0; + Amg::Vector2D locPos( exPars->parameters()[Trk::locX], exPars->parameters()[Trk::locY] ); + + double tolx = 100.; // positive -> large surface + double toly = 100.; // positive -> large surface + const AmgSymMatrix(5)* errMat = exPars->covariance(); + if ( errMat ) { + ATH_MSG_VERBOSE( "Extrapolated local Position & Error matrix\n:" << locPos << "\n" << Amg::toString(*errMat) ); + // MJW check validity of errors before using them (fix for bug #82920) + double covx = (*errMat)(Trk::locX, Trk::locX); + double covy = (*errMat)(Trk::locY, Trk::locY); + if ( covx > 0.0 && covy > 0.0 ) { + tolx = 3 * covx ; + toly = 3 * covy; } + } + + // in case we are looking for holes, only ignore stations if we are within 100 mm of the chamber edge + // all other holes are counted even if the extrapolation errors are large. + if ( smallerBounds ) { + if ( tolx > 10. ) tolx = 10.; + if ( toly > 10. ) toly = 10.; + // refer sign to check 'inside' the bounds + tolx *= -1.; + toly *= -1.; + } + bool inbounds = detEl.surface().insideBounds(locPos, tolx, toly); + + if ( msgLvl(MSG::DEBUG) ) { - return exPars; + std::ostringstream parsType; + parsType << "pos=(" << locPos[Trk::locX] + << "," << locPos[Trk::locY] << ")"; + if ( errMat ) { + parsType << " exError=(" << Amg::error(*errMat, Trk::locX) << "," << Amg::error(*errMat, Trk::locY) << ")"; + } + parsType << " tolerance=(" << tolx << "," << toly << ")"; + if ( inbounds ) parsType << " => inbounds"; + else parsType << " => outbounds"; + ATH_MSG_DEBUG(" " << m_idHelperTool->toStringChamber( detEl.identify() ) << " pars " << parsType.str() ); } + if ( !inbounds ) { + delete exPars; + return 0; + } + + return exPars; +} + - } diff --git a/MuonSpectrometer/MuonReconstruction/MuonTrackMakers/MuonTrackMakerTools/MuonTrackFinderTools/src/MuonSegmentRegionRecoveryTool.h b/MuonSpectrometer/MuonReconstruction/MuonTrackMakers/MuonTrackMakerTools/MuonTrackFinderTools/src/MuonSegmentRegionRecoveryTool.h index fc8db5d0d9286f30d8568f2cfbe006d12f441399..ca517c0b3775f8947a914e63394c0fc88a59c3dc 100644 --- a/MuonSpectrometer/MuonReconstruction/MuonTrackMakers/MuonTrackMakerTools/MuonTrackFinderTools/src/MuonSegmentRegionRecoveryTool.h +++ b/MuonSpectrometer/MuonReconstruction/MuonTrackMakers/MuonTrackMakerTools/MuonTrackFinderTools/src/MuonSegmentRegionRecoveryTool.h @@ -32,6 +32,10 @@ #include "MuonPrepRawData/RpcPrepDataCollection.h" #include "MuonPrepRawData/TgcPrepDataCollection.h" #include "MuonPrepRawData/CscPrepDataCollection.h" +// New Small Wheel +#include "MuonPrepRawData/sTgcPrepDataCollection.h" +#include "MuonPrepRawData/MMPrepDataCollection.h" + #include "MuonIdHelpers/MuonStationIndex.h" #include "IRegionSelector/RegSelEnums.h" @@ -48,6 +52,9 @@ class MdtIdHelper; class RpcIdHelper; class TgcIdHelper; class CscIdHelper; +// New Small Wheel +class sTgcIdHelper; +class MMIdHelper; class IRegSelSvc; class IRoiDescriptor; @@ -108,6 +115,13 @@ namespace Muon { std::set<IdentifierHash> csc; std::set<IdentifierHash> cscTrack; std::vector<const CscPrepDataCollection*> cscCols; + // New Small Wheel + std::set<IdentifierHash> stgc; + std::set<IdentifierHash> stgcTrack; + std::vector<const sTgcPrepDataCollection*> stgcCols; + std::set<IdentifierHash> mm; + std::set<IdentifierHash> mmTrack; + std::vector<const MMPrepDataCollection*> mmCols; }; public: /** @brief constructor */ @@ -168,6 +182,8 @@ namespace Muon { bool m_excludeEES; bool m_onlyEO; bool m_useFitterOutlierLogic; + bool m_doNSW; + }; } diff --git a/MuonSpectrometer/MuonValidation/MuonDQA/MuonDQAMonitoring/scripts/muondqamonitoring.sh b/MuonSpectrometer/MuonValidation/MuonDQA/MuonDQAMonitoring/scripts/muondqamonitoring.sh index 38360e65e892b47dae1cdb7bf70d4befad035913..b3c9fd378754db825c24a9518332778d9858744d 100755 --- a/MuonSpectrometer/MuonValidation/MuonDQA/MuonDQAMonitoring/scripts/muondqamonitoring.sh +++ b/MuonSpectrometer/MuonValidation/MuonDQA/MuonDQAMonitoring/scripts/muondqamonitoring.sh @@ -488,21 +488,21 @@ ServiceMgr += CfgMgr.MessageSvc( Format = "% F%50W%S%7W%R%T %0W%M", # NEED A REAL FIX #--------------------------------------------------------------------------- if MuonDQAFlags.doMuonHitMon: - ToolSvc += CfgMgr.MDTRawDataValAlg(OutputLevel = INFO) - ToolSvc += CfgMgr.RPCRawDataValAlg(OutputLevel = INFO) - ToolSvc += CfgMgr.MDTvsRPCRawDataValAlg(OutputLevel = INFO) - ToolSvc += CfgMgr.RPCLV1RawDataValAlg(OutputLevel = INFO) - ToolSvc += CfgMgr.TGCRawDataValAlg(OutputLevel = INFO) + #ToolSvc += CfgMgr.MDTRawDataValAlg(OutputLevel = INFO) + #ToolSvc += CfgMgr.RPCRawDataValAlg(OutputLevel = INFO) + #ToolSvc += CfgMgr.MDTvsRPCRawDataValAlg(OutputLevel = INFO) + #ToolSvc += CfgMgr.RPCLV1RawDataValAlg(OutputLevel = INFO) + #ToolSvc += CfgMgr.TGCRawDataValAlg(OutputLevel = INFO) if MuonDQAFlags.doCSCMon: - ToolSvc += CfgMgr.CSCPRDMonTool(OutputLevel = INFO) - ToolSvc += CfgMgr.CSCRDOMonTool(OutputLevel = INFO) + #ToolSvc += CfgMgr.CSCPRDMonTool(OutputLevel = INFO) + #ToolSvc += CfgMgr.CSCRDOMonTool(OutputLevel = INFO) if MuonDQAFlags.doMuonSegmMon: - ToolSvc += CfgMgr.MuonSegmValidation(OutputLevel = INFO) + #ToolSvc += CfgMgr.MuonSegmValidation(OutputLevel = INFO) if MuonDQAFlags.doMuonTrackMon: - ToolSvc += CfgMgr.MuonTrackValidation(OutputLevel = INFO) - ToolSvc += CfgMgr.MuonAlignMonGenericTracks(OutputLevel = INFO) + #ToolSvc += CfgMgr.MuonTrackValidation(OutputLevel = INFO) + #ToolSvc += CfgMgr.MuonAlignMonGenericTracks(OutputLevel = INFO) Service( "THistSvc" ).OutputLevel = WARNING #--------------------------------------------------------------------------- diff --git a/MuonSpectrometer/MuonValidation/MuonDQA/MuonDQAMonitoring/share/MuonDQAMonitoring_CommRunsTier0.py b/MuonSpectrometer/MuonValidation/MuonDQA/MuonDQAMonitoring/share/MuonDQAMonitoring_CommRunsTier0.py index cb444c2bd0716aebacbcba3a464439b6d4c26b53..a91288b8a4bab8ab4d2bcb2ac493be576e4cbe8f 100644 --- a/MuonSpectrometer/MuonValidation/MuonDQA/MuonDQAMonitoring/share/MuonDQAMonitoring_CommRunsTier0.py +++ b/MuonSpectrometer/MuonValidation/MuonDQA/MuonDQAMonitoring/share/MuonDQAMonitoring_CommRunsTier0.py @@ -464,47 +464,47 @@ if MuonDQAFlags.doCallgrind: # ------------------------------------------------------------- # --------------For RawData Monitoring---------------------------- if MuonDQAFlags.doMuonHitMon: - ToolSvc += CfgMgr.MDTRawDataBSValAlg(OutputLevel = INFO) - ToolSvc += CfgMgr.MDTRawDataESDValAlg(OutputLevel = INFO) - ToolSvc += CfgMgr.RPCRawDataValAlg(OutputLevel = INFO) - ToolSvc += CfgMgr.MDTvsRPCRawDataValAlg(OutputLevel = INFO) - ToolSvc += CfgMgr.RPCLV1RawDataValAlg(OutputLevel = INFO) - ToolSvc += CfgMgr.TGCRawDataESDValAlg(OutputLevel = INFO) - ToolSvc += CfgMgr.TGCLV1RawDataESDValAlg(OutputLevel = INFO) - ToolSvc += CfgMgr.MDTvsTGCRawDataESDValAlg(OutputLevel = INFO) + #ToolSvc += CfgMgr.MDTRawDataBSValAlg(OutputLevel = INFO) + #ToolSvc += CfgMgr.MDTRawDataESDValAlg(OutputLevel = INFO) + #ToolSvc += CfgMgr.RPCRawDataValAlg(OutputLevel = INFO) + #ToolSvc += CfgMgr.MDTvsRPCRawDataValAlg(OutputLevel = INFO) + #ToolSvc += CfgMgr.RPCLV1RawDataValAlg(OutputLevel = INFO) + #ToolSvc += CfgMgr.TGCRawDataESDValAlg(OutputLevel = INFO) + #ToolSvc += CfgMgr.TGCLV1RawDataESDValAlg(OutputLevel = INFO) + #ToolSvc += CfgMgr.MDTvsTGCRawDataESDValAlg(OutputLevel = INFO) if MuonDQAFlags.doCSCMon: - ToolSvc += CfgMgr.CSCPrdValAlg(OutputLevel = INFO) - ToolSvc += CfgMgr.CSCRdoValAlg(OutputLevel = INFO) - ToolSvc += CfgMgr.CSCClusterTree(OutputLevel = INFO) - ToolSvc += CfgMgr.CSCClusterValAlg(OutputLevel = INFO) + #ToolSvc += CfgMgr.CSCPrdValAlg(OutputLevel = INFO) + #ToolSvc += CfgMgr.CSCRdoValAlg(OutputLevel = INFO) + #ToolSvc += CfgMgr.CSCClusterTree(OutputLevel = INFO) + #ToolSvc += CfgMgr.CSCClusterValAlg(OutputLevel = INFO) # --------------For MuonSegment Monitoring------------------------ if MuonDQAFlags.doMuonSegmMon: - ToolSvc += CfgMgr.MuonSegmValidation(OutputLevel = INFO) + #ToolSvc += CfgMgr.MuonSegmValidation(OutputLevel = INFO) # --------------For MuonTrk Alignment Monitoring------------------------ if MuonDQAFlags.doMuonTrkAlignMon: - ToolSvc += CfgMgr.MuonAlignValidation(OutputLevel = INFO) + #ToolSvc += CfgMgr.MuonAlignValidation(OutputLevel = INFO) # --------------For MuonTrk Monitoring---------------------------- # --------------For No Trigger MuonTrk Monitoring----------------- if MuonDQAFlags.doMuonTrackMon and not MuonDQAFlags.MuonTrkMonDoTrigger: - ToolSvc += CfgMgr.MuonSelectedTracksMon(OutputLevel = INFO) - ToolSvc += CfgMgr.MuonGenericTracksMon(OutputLevel = INFO) + #ToolSvc += CfgMgr.MuonSelectedTracksMon(OutputLevel = INFO) + #ToolSvc += CfgMgr.MuonGenericTracksMon(OutputLevel = INFO) # --------------For TriggerAware MuonTrk Monitoring--------------- if MuonDQAFlags.doMuonTrackMon and MuonDQAFlags.MuonTrkMonDoTrigger: ### UseTriggerVector =True - ToolSvc += CfgMgr.MuonSelectedTracksMon_Trig(OutputLevel = INFO) - ToolSvc += CfgMgr.MuonGenericTracksMon_Trig(OutputLevel = INFO) + #ToolSvc += CfgMgr.MuonSelectedTracksMon_Trig(OutputLevel = INFO) + #ToolSvc += CfgMgr.MuonGenericTracksMon_Trig(OutputLevel = INFO) ### UseTriggerVector = False - ToolSvc += CfgMgr.MuonSelectedTracksMon_trigmu10(OutputLevel = INFO) - ToolSvc += CfgMgr.MuonSelectedTracksMon_trigmu20(OutputLevel = INFO) - ToolSvc += CfgMgr.MuonSelectedTracksMon_trigmu40(OutputLevel = INFO) - ToolSvc += CfgMgr.MuonSelectedTracksMon_trig2mu10(OutputLevel = INFO) - ToolSvc += CfgMgr.MuonGenericTracksMon_trigmu10(OutputLevel = INFO) - ToolSvc += CfgMgr.MuonGenericTracksMon_trigmu20(OutputLevel = INFO) - ToolSvc += CfgMgr.MuonGenericTracksMon_trigmu40(OutputLevel = INFO) - ToolSvc += CfgMgr.MuonGenericTracksMon_trig2mu10(OutputLevel = INFO) + #ToolSvc += CfgMgr.MuonSelectedTracksMon_trigmu10(OutputLevel = INFO) + #ToolSvc += CfgMgr.MuonSelectedTracksMon_trigmu20(OutputLevel = INFO) + #ToolSvc += CfgMgr.MuonSelectedTracksMon_trigmu40(OutputLevel = INFO) + #ToolSvc += CfgMgr.MuonSelectedTracksMon_trig2mu10(OutputLevel = INFO) + #ToolSvc += CfgMgr.MuonGenericTracksMon_trigmu10(OutputLevel = INFO) + #ToolSvc += CfgMgr.MuonGenericTracksMon_trigmu20(OutputLevel = INFO) + #ToolSvc += CfgMgr.MuonGenericTracksMon_trigmu40(OutputLevel = INFO) + #ToolSvc += CfgMgr.MuonGenericTracksMon_trig2mu10(OutputLevel = INFO) # --------------For MuonEventInfo Monitoring---------------------------- if MuonDQAFlags.doMuonEvtMon: - ToolSvc += CfgMgr.MuonDQA__MuonEventInfoMonTool(OutputLevel = INFO) + #ToolSvc += CfgMgr.MuonDQA__MuonEventInfoMonTool(OutputLevel = INFO) #--------------------------------------------------------------------------- Service( "THistSvc" ).OutputLevel = WARNING #--------------------------------------------------------------------------- @@ -522,5 +522,5 @@ print theApp.TopAlg #--------------------------------------------------------------------------- print topSequence print ServiceMgr -print ToolSvc +print #ToolSvc #====================================================================== diff --git a/MuonSpectrometer/MuonValidation/MuonDQA/MuonDQAMonitoring/share/MuonEventInfoMonitoring_options.py b/MuonSpectrometer/MuonValidation/MuonDQA/MuonDQAMonitoring/share/MuonEventInfoMonitoring_options.py index 1087b4ed4673ae72b2f2783b5f6964baae2204cc..5d8841ae40e7e40ebcc72e304a4900f8b3861aaf 100644 --- a/MuonSpectrometer/MuonValidation/MuonDQA/MuonDQAMonitoring/share/MuonEventInfoMonitoring_options.py +++ b/MuonSpectrometer/MuonValidation/MuonDQA/MuonDQAMonitoring/share/MuonEventInfoMonitoring_options.py @@ -8,5 +8,5 @@ if MuonDQAFlags.doMuonEvtMon: ) MuonDQA__MuonEventInfoMonTool.LastEvent = MuonDQAFlags.EvtMax MuonDQA__MuonEventInfoMonTool.TriggerTagAdd = True - ToolSvc += MuonDQA__MuonEventInfoMonTool + #ToolSvc += MuonDQA__MuonEventInfoMonTool monMan.AthenaMonTools += [ MuonDQA__MuonEventInfoMonTool ] diff --git a/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/CscRawDataMonitoring/share/CscRawBS_MonitoringOptions.py b/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/CscRawDataMonitoring/share/CscRawBS_MonitoringOptions.py index 3f9fc53cc96607f7662f291a974ffcc7db516707..9414c111361199fde8e9ae7d2919d712ea119fb8 100755 --- a/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/CscRawDataMonitoring/share/CscRawBS_MonitoringOptions.py +++ b/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/CscRawDataMonitoring/share/CscRawBS_MonitoringOptions.py @@ -20,7 +20,7 @@ cscRdoBSValAlg = CscRdoValAlg (name = 'cscRdoBSValAlg', CSCRawDataKey = 'CSCRDO', NoiseCutADC = 100 ) -ToolSvc += cscRdoBSValAlg +#ToolSvc += cscRdoBSValAlg cscrdoBsRawMonMan.AthenaMonTools += [ cscRdoBSValAlg ] cscRdoBSValAlg.OutputLevel = INFO diff --git a/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/CscRawDataMonitoring/share/CscRawESD_MonitoringOptions.py b/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/CscRawDataMonitoring/share/CscRawESD_MonitoringOptions.py index a40337114e829017a6cb81177b345d3569b1a069..921197dbb2aeb501a56a761c76909b0a8f2286e8 100755 --- a/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/CscRawDataMonitoring/share/CscRawESD_MonitoringOptions.py +++ b/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/CscRawDataMonitoring/share/CscRawESD_MonitoringOptions.py @@ -42,7 +42,7 @@ cscPrdESDValAlg = CscPrdValAlg ( name = 'cscPrdESDValAlg', NoiseCutADC = 100, CSCStripFitter = ToolSvc.CalibCscStripFitter ) -ToolSvc += cscPrdESDValAlg +#ToolSvc += cscPrdESDValAlg cscprdRawMonMan.AthenaMonTools += [ cscPrdESDValAlg ] topSequence += cscprdRawMonMan @@ -75,7 +75,7 @@ cscClusterESDValAlg = CscClusterValAlg( name = 'cscClusterESDValAlg', CSCEventSelTriggers = csc_evtSelectionTriggers ) -ToolSvc += cscClusterESDValAlg +#ToolSvc += cscClusterESDValAlg cscesdRawMonMan.AthenaMonTools += [cscClusterESDValAlg] topSequence += cscesdRawMonMan @@ -113,7 +113,7 @@ CSCSegmESDValAlg = CSCSegmValAlg ( name = "CSCSegmValAlg", ClusterStatus = clusStatWords ) -ToolSvc += CSCSegmESDValAlg +#ToolSvc += CSCSegmESDValAlg cscesdSegmMonMan.AthenaMonTools += [ CSCSegmESDValAlg ] topSequence += cscesdSegmMonMan diff --git a/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/MdtRawDataMonitoring/share/MdtRaw_MonitoringOptions.py b/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/MdtRawDataMonitoring/share/MdtRaw_MonitoringOptions.py index 285bab2505ea834e838d7457182327de0761cd15..f68866a0dee13dc180251b34ec5271d5397dd08e 100755 --- a/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/MdtRawDataMonitoring/share/MdtRaw_MonitoringOptions.py +++ b/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/MdtRawDataMonitoring/share/MdtRaw_MonitoringOptions.py @@ -71,7 +71,7 @@ mdtRawDataValAlg_main = MdtRawDataValAlg(name='mdtRawDataValAlg_main', nHits_NoiseThreshold = 10000 ) -ToolSvc += mdtRawDataValAlg_main +#ToolSvc += mdtRawDataValAlg_main mdtRawMonMan.AthenaMonTools += [ mdtRawDataValAlg_main ] if( isTier0Flag ) : @@ -124,7 +124,7 @@ if( isTier0Flag ) : mdtRawDataValAlg_express.TriggerChain = "L1_MU0, L1_MU6, L1_MU10, L1_MU15, L1_MU20" #end if useTrigger - ToolSvc += mdtRawDataValAlg_express + #ToolSvc += mdtRawDataValAlg_express mdtRawMonMan.AthenaMonTools += [ mdtRawDataValAlg_express ] #end if( isTier0Flag ) diff --git a/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/MdtVsRpcRawDataMonitoring/share/MdtVsRpcRaw_MonitoringOptions.py b/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/MdtVsRpcRawDataMonitoring/share/MdtVsRpcRaw_MonitoringOptions.py index cfe5074a155c7ddabca845799a2bbb8dae48e6f9..59139077d440bfc9d6bc169357533996cf6bff0a 100755 --- a/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/MdtVsRpcRawDataMonitoring/share/MdtVsRpcRaw_MonitoringOptions.py +++ b/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/MdtVsRpcRawDataMonitoring/share/MdtVsRpcRaw_MonitoringOptions.py @@ -27,7 +27,7 @@ MdtVsRpcRawDataValAlg = MdtVsRpcRawDataValAlg(name='MdtVsRpcRawDataValAlg', RpcPrepDataContainer="RPC_Measurements", MdtPrepDataContainer="MDT_DriftCircles", LastEvent = MuonDQAFlags.EvtMax) -ToolSvc += MdtVsRpcRawDataValAlg +#ToolSvc += MdtVsRpcRawDataValAlg MdtRpcRawMonMan.AthenaMonTools += [ MdtVsRpcRawDataValAlg ] topSequence += MdtRpcRawMonMan print MdtRpcRawMonMan diff --git a/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/MdtVsTgcRawDataMonitoring/share/MdtVsTgcRaw_MonitoringOptions.py b/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/MdtVsTgcRawDataMonitoring/share/MdtVsTgcRaw_MonitoringOptions.py index cdcf7ddaf4422e713787947b3d272e6dcfb22d90..89eac2e5413344499b009639271d51290676f2b4 100755 --- a/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/MdtVsTgcRawDataMonitoring/share/MdtVsTgcRaw_MonitoringOptions.py +++ b/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/MdtVsTgcRawDataMonitoring/share/MdtVsTgcRaw_MonitoringOptions.py @@ -22,7 +22,7 @@ MdtVsTgcRawDataValAlg = MdtVsTgcRawDataValAlg (name = "MdtVsTgcRawDataValAlg", OutputCoinCollection="TrigT1CoinDataCollection", MdtPrepDataContainer="MDT_DriftCircles", TgcLv1File = False) -ToolSvc += MdtVsTgcRawDataValAlg +#ToolSvc += MdtVsTgcRawDataValAlg MdtTgcRawMonMan.AthenaMonTools += [ MdtVsTgcRawDataValAlg ] topSequence += MdtTgcRawMonMan print MdtTgcRawMonMan diff --git a/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/RpcRawDataMonitoring/share/RpcRawBS_MonitoringOptions.py b/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/RpcRawDataMonitoring/share/RpcRawBS_MonitoringOptions.py index 9529f43b5eae67b35ac9b30e06779e12fca15d14..8c33fa8d074f3ca6de54862f16a3a9b137535342 100755 --- a/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/RpcRawDataMonitoring/share/RpcRawBS_MonitoringOptions.py +++ b/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/RpcRawDataMonitoring/share/RpcRawBS_MonitoringOptions.py @@ -24,7 +24,7 @@ rpcLV1RawDataValAlg = RpcLv1RawDataValAlg(name='rpcLV1RawDataValAlg' OutputLevel = OutputMessageLevel , LastEvent = MuonDQAFlags.EvtMax, doCoolDB = False ) -ToolSvc += rpcLV1RawDataValAlg +#ToolSvc += rpcLV1RawDataValAlg rpcLv1RawMonMan.AthenaMonTools += [ rpcLV1RawDataValAlg ] topSequence += rpcLv1RawMonMan print rpcLv1RawMonMan @@ -39,7 +39,7 @@ from RpcRawDataMonitoring.RpcRawDataMonitoringConf import RpcLv1RawDataSectorLog rpcLV1RawDataSectorLogic = RpcLv1RawDataSectorLogic(name='rpcLV1RawDataSectorLogic',OutputLevel = OutputMessageLevel) if globalflags.DataSource() != 'data': rpcLV1RawDataSectorLogic.isMC = True -ToolSvc += rpcLV1RawDataSectorLogic +#ToolSvc += rpcLV1RawDataSectorLogic rpcLv1SLRawMonMan.AthenaMonTools += [ rpcLV1RawDataSectorLogic ] topSequence += rpcLv1SLRawMonMan print rpcLv1SLRawMonMan diff --git a/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/RpcRawDataMonitoring/share/RpcRawESD_MonitoringOptions.py b/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/RpcRawDataMonitoring/share/RpcRawESD_MonitoringOptions.py index e60664aab0a0fbec890e0ebf18bf1fc9ae5015a5..57966f6e629acf874eb7c65e2ad681cff7c1b0df 100755 --- a/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/RpcRawDataMonitoring/share/RpcRawESD_MonitoringOptions.py +++ b/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/RpcRawDataMonitoring/share/RpcRawESD_MonitoringOptions.py @@ -41,7 +41,7 @@ rpcRawDataValAlg = RpcRawDataValAlg(name='rpcRawDataValAlg', ClusterContainer ="rpcClusters", OutputLevel = OutputMessageLevel, LastEvent = MuonDQAFlags.EvtMax) -ToolSvc += rpcRawDataValAlg +#ToolSvc += rpcRawDataValAlg rpcRawMonMan.AthenaMonTools += [ rpcRawDataValAlg ] topSequence += rpcRawMonMan print rpcRawMonMan @@ -74,7 +74,7 @@ RPCStandaloneTracksMon = RPCStandaloneTracksMon(name='RPCStandaloneTracksMon', ClusterContainer = "rpcClusters") if globalflags.DataSource() != 'data': RPCStandaloneTracksMon.isMC = True -ToolSvc += RPCStandaloneTracksMon +#ToolSvc += RPCStandaloneTracksMon rpcTrackMonMan.AthenaMonTools += [ RPCStandaloneTracksMon ] topSequence += rpcTrackMonMan print rpcTrackMonMan @@ -95,7 +95,7 @@ if not hasattr(topSequence,"RpcClusterBuilderPRD"): rpcLv1RawDataEfficiency = RpcLv1RawDataEfficiency(name='rpcLv1RawDataEfficiency') if globalflags.DataSource() != 'data': rpcLv1RawDataEfficiency.isMC = True -ToolSvc += rpcLv1RawDataEfficiency +#ToolSvc += rpcLv1RawDataEfficiency rpcLv1RawEfficiencyMonMan.AthenaMonTools += [ rpcLv1RawDataEfficiency ] topSequence += rpcLv1RawEfficiencyMonMan print rpcLv1RawEfficiencyMonMan diff --git a/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/TgcRawDataMonitoring/share/TgcRaw_MonitoringOptions.py b/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/TgcRawDataMonitoring/share/TgcRaw_MonitoringOptions.py index 54b2cc59c1cd069199ff5e99d557c6c627db2e5d..adf4ef9d2380c6230b74ed90d2291b71431a6558 100755 --- a/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/TgcRawDataMonitoring/share/TgcRaw_MonitoringOptions.py +++ b/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/TgcRawDataMonitoring/share/TgcRaw_MonitoringOptions.py @@ -19,7 +19,7 @@ tgcLv1RawMonMan = AthenaMonManager(name="TgcLv1RawMonManager", from TgcRawDataMonitoring.TgcRawDataMonitoringConf import TgcRawDataValAlg tgcRawDataValAlg = TgcRawDataValAlg(name='tgcRawDataValAlg', TgcPrepDataContainer="TGC_Measurements") -ToolSvc += tgcRawDataValAlg +#ToolSvc += tgcRawDataValAlg tgcRawMonMan.AthenaMonTools += [ tgcRawDataValAlg ] topSequence += tgcRawMonMan print tgcRawMonMan @@ -28,7 +28,7 @@ from TgcRawDataMonitoring.TgcRawDataMonitoringConf import TgcLv1RawDataValAlg tgcLv1RawDataValAlg = TgcLv1RawDataValAlg(name='tgcLv1RawDataValAlg') if DQMonFlags.useTrigger(): - ToolSvc += tgcLv1RawDataValAlg + #ToolSvc += tgcLv1RawDataValAlg tgcLv1RawMonMan.AthenaMonTools += [ tgcLv1RawDataValAlg ] topSequence += tgcLv1RawMonMan print tgcLv1RawMonMan diff --git a/MuonSpectrometer/MuonValidation/MuonDQA/MuonTrackMonitoring/share/MuonTrackDQA_options.py b/MuonSpectrometer/MuonValidation/MuonDQA/MuonTrackMonitoring/share/MuonTrackDQA_options.py index 6d7517ee3597a73d652be51089a3691488f46149..510db8551373e1f1d47b6f3b0d787ae65c8a3885 100755 --- a/MuonSpectrometer/MuonValidation/MuonDQA/MuonTrackMonitoring/share/MuonTrackDQA_options.py +++ b/MuonSpectrometer/MuonValidation/MuonDQA/MuonTrackMonitoring/share/MuonTrackDQA_options.py @@ -21,8 +21,8 @@ MuonGenericTracksMon_NoTrig = MuonGenericTracksMon(name = "MuonGenericTra MuonTriggerChainName = "NoTrig/", OutputLevel = WARNING, ) -ToolSvc += MuonGenericTracksMon_NoTrig -muTrackMonMan.AthenaMonTools.append(MuonGenericTracksMon_NoTrig) +#ToolSvc += MuonGenericTracksMon_NoTrig +muTrackMonMan.AthenaMonTools += [MuonGenericTracksMon_NoTrig] # L1_Trig part is intended to only select events passing L1_MU triggers MuonGenericTracksMon_L1Trig = MuonGenericTracksMon(name = "MuonGenericTracksMon_L1Trig", @@ -36,8 +36,8 @@ else: MuonGenericTracksMon_L1Trig.TriggerChain = "L1_MU4, L1_MU6, L1_MU10, L1_MU11, L1_MU15, L1_MU20, L1_2MU4, L1_2MU6, L1_2MU10" MuonGenericTracksMon_L1Trig.MuonTriggerChainName = "" MuonGenericTracksMon_L1Trig.TrigDecisionTool = monTrigDecTool - ToolSvc += MuonGenericTracksMon_L1Trig - muTrackMonMan.AthenaMonTools.append(MuonGenericTracksMon_L1Trig) + #ToolSvc += MuonGenericTracksMon_L1Trig + muTrackMonMan.AthenaMonTools += [MuonGenericTracksMon_L1Trig] #for Muon Quality Selection if not hasattr(ToolSvc,"MuonSelectorTool"): diff --git a/MuonSpectrometer/MuonValidation/MuonDQA/MuonTrackMonitoring/share/MuonTrackMonitoring_options.py b/MuonSpectrometer/MuonValidation/MuonDQA/MuonTrackMonitoring/share/MuonTrackMonitoring_options.py index 3d8a369e50440ece3c62498dadc3882ee0d88618..87802adc996ba64a9ed386ea5eba1ee2160423df 100755 --- a/MuonSpectrometer/MuonValidation/MuonDQA/MuonTrackMonitoring/share/MuonTrackMonitoring_options.py +++ b/MuonSpectrometer/MuonValidation/MuonDQA/MuonTrackMonitoring/share/MuonTrackMonitoring_options.py @@ -45,9 +45,9 @@ if MuonDQAFlags.doMuonTrackMon: TGCStandaloneTracksMon_NoTrig = TGCStandaloneTracksMon(name = "TGCStandaloneTracksMon", TriggerAware = False, MuonTriggerChainName = "TriggersInChain") - ToolSvc += MuonSelectedTracksMon - ToolSvc += MuonGenericTracksMon - ToolSvc += TGCStandaloneTracksMon + #ToolSvc += MuonSelectedTracksMon + #ToolSvc += MuonGenericTracksMon + #ToolSvc += TGCStandaloneTracksMon monMan.AthenaMonTools += [ MuonSelectedTracksMon ] monMan.AthenaMonTools += [ MuonGenericTracksMon ] monMan.AthenaMonTools += [ TGCStandaloneTracksMon ] @@ -87,9 +87,9 @@ else: MuonTriggerDecisionTool = "TrigDec::TrigDecisionTool", Muon_Trigger_Items = ["MU0", "MU4", "MU6", "MU10", "MU11", "MU15", "MU20", "MU40", "MU0_TGC", "MU6_TGC", "MU0_TGC_HALO" ], MuonTriggerChainName = "TriggersInChain") - ToolSvc += MuonSelectedTracksMon_Trig - ToolSvc += MuonGenericTracksMon_Trig - ToolSvc += TGCStandaloneTracksMon_Trig + #ToolSvc += MuonSelectedTracksMon_Trig + #ToolSvc += MuonGenericTracksMon_Trig + #ToolSvc += TGCStandaloneTracksMon_Trig monMan.AthenaMonTools += [ MuonSelectedTracksMon_Trig ] monMan.AthenaMonTools += [ MuonGenericTracksMon_Trig] monMan.AthenaMonTools += [ TGCStandaloneTracksMon_Trig] @@ -187,18 +187,18 @@ else: MuonGenericTracksMon_trigmu40.MuonTriggerChainName = "EF_mu40" MuonGenericTracksMon_trig2mu10.MuonTriggerChainName = "EF_2mu10" ################################################### - ToolSvc += MuonSelectedTracksMon_trig2mu4 - ToolSvc += MuonSelectedTracksMon_trig2mu6 - ToolSvc += MuonSelectedTracksMon_trigmu10 - ToolSvc += MuonSelectedTracksMon_trigmu20 - ToolSvc += MuonSelectedTracksMon_trigmu40 - ToolSvc += MuonSelectedTracksMon_trig2mu10 - ToolSvc += MuonGenericTracksMon_trig2mu4 - ToolSvc += MuonGenericTracksMon_trig2mu6 - ToolSvc += MuonGenericTracksMon_trigmu10 - ToolSvc += MuonGenericTracksMon_trigmu20 - ToolSvc += MuonGenericTracksMon_trigmu40 - ToolSvc += MuonGenericTracksMon_trig2mu10 + #ToolSvc += MuonSelectedTracksMon_trig2mu4 + #ToolSvc += MuonSelectedTracksMon_trig2mu6 + #ToolSvc += MuonSelectedTracksMon_trigmu10 + #ToolSvc += MuonSelectedTracksMon_trigmu20 + #ToolSvc += MuonSelectedTracksMon_trigmu40 + #ToolSvc += MuonSelectedTracksMon_trig2mu10 + #ToolSvc += MuonGenericTracksMon_trig2mu4 + #ToolSvc += MuonGenericTracksMon_trig2mu6 + #ToolSvc += MuonGenericTracksMon_trigmu10 + #ToolSvc += MuonGenericTracksMon_trigmu20 + #ToolSvc += MuonGenericTracksMon_trigmu40 + #ToolSvc += MuonGenericTracksMon_trig2mu10 ################################################### monMan.AthenaMonTools += [ MuonSelectedTracksMon_trig2mu4 ] monMan.AthenaMonTools += [ MuonSelectedTracksMon_trig2mu6 ] diff --git a/MuonSpectrometer/MuonValidation/MuonPRDTest/src/MMPRDVariables.cxx b/MuonSpectrometer/MuonValidation/MuonPRDTest/src/MMPRDVariables.cxx index 7fbb6f2c0b8c29b0fb720a49a96c14a197d65306..19da31e17672aa2e075fca8a4e0fb5ec637bde55 100644 --- a/MuonSpectrometer/MuonValidation/MuonPRDTest/src/MMPRDVariables.cxx +++ b/MuonSpectrometer/MuonValidation/MuonPRDTest/src/MMPRDVariables.cxx @@ -46,12 +46,15 @@ StatusCode MMPRDVariables::fillVariables() << " GasGap [" << gas_gap << "]" << " ChNr [" << channel << "]" ); + ATH_MSG_DEBUG( " MM channel " << channel << " prd->time() " << prd->time() ); + m_NSWMM_prd_stationName->push_back(stName); m_NSWMM_prd_stationEta->push_back(stationEta); m_NSWMM_prd_stationPhi->push_back(stationPhi); m_NSWMM_prd_multiplet->push_back(multiplet); m_NSWMM_prd_gas_gap->push_back(gas_gap); m_NSWMM_prd_channel->push_back(channel); + m_NSWMM_prd_time->push_back(prd->time()); const MuonGM::MMReadoutElement* det = prd->detectorElement(); Amg::Vector3D pos = prd->globalPosition(); @@ -87,6 +90,7 @@ void MMPRDVariables::deleteVariables() delete m_NSWMM_prd_multiplet; delete m_NSWMM_prd_gas_gap; delete m_NSWMM_prd_channel; + delete m_NSWMM_prd_time; delete m_NSWMM_prd_globalPosX; delete m_NSWMM_prd_globalPosY; @@ -104,6 +108,7 @@ void MMPRDVariables::deleteVariables() m_NSWMM_prd_multiplet = nullptr; m_NSWMM_prd_gas_gap = nullptr; m_NSWMM_prd_channel = nullptr; + m_NSWMM_prd_time = nullptr; m_NSWMM_prd_globalPosX = nullptr; m_NSWMM_prd_globalPosY = nullptr; @@ -126,6 +131,7 @@ StatusCode MMPRDVariables::clearVariables() m_NSWMM_prd_multiplet->clear(); m_NSWMM_prd_gas_gap->clear(); m_NSWMM_prd_channel->clear(); + m_NSWMM_prd_time->clear(); m_NSWMM_prd_globalPosX->clear(); m_NSWMM_prd_globalPosY->clear(); @@ -148,6 +154,7 @@ StatusCode MMPRDVariables::initializeVariables() m_NSWMM_prd_multiplet = new std::vector<int>(); m_NSWMM_prd_gas_gap = new std::vector<int>(); m_NSWMM_prd_channel = new std::vector<int>(); + m_NSWMM_prd_time = new std::vector<int>(); m_NSWMM_prd_globalPosX = new std::vector<double>(); m_NSWMM_prd_globalPosY = new std::vector<double>(); @@ -165,6 +172,7 @@ StatusCode MMPRDVariables::initializeVariables() m_tree->Branch("PRD_MM_multiplet", &m_NSWMM_prd_multiplet); m_tree->Branch("PRD_MM_gas_gap", &m_NSWMM_prd_gas_gap); m_tree->Branch("PRD_MM_channel", &m_NSWMM_prd_channel); + m_tree->Branch("PRD_MM_time", &m_NSWMM_prd_time); m_tree->Branch("PRD_MM_globalPosX", &m_NSWMM_prd_globalPosX); m_tree->Branch("PRD_MM_globalPosY", &m_NSWMM_prd_globalPosY); diff --git a/MuonSpectrometer/MuonValidation/MuonPRDTest/src/MMPRDVariables.h b/MuonSpectrometer/MuonValidation/MuonPRDTest/src/MMPRDVariables.h index 4c4fbdc5bbdf524a5416117821b40024f6d28de9..8598573d71376f7961cf9a10b979f24dcdef8303 100644 --- a/MuonSpectrometer/MuonValidation/MuonPRDTest/src/MMPRDVariables.h +++ b/MuonSpectrometer/MuonValidation/MuonPRDTest/src/MMPRDVariables.h @@ -27,6 +27,7 @@ class MMPRDVariables : public ValAlgVariables m_NSWMM_prd_multiplet(0), m_NSWMM_prd_gas_gap(0), m_NSWMM_prd_channel(0), + m_NSWMM_prd_time(0), m_NSWMM_prd_globalPosX(0), m_NSWMM_prd_globalPosY(0), m_NSWMM_prd_globalPosZ(0), @@ -67,6 +68,7 @@ class MMPRDVariables : public ValAlgVariables std::vector<int> *m_NSWMM_prd_multiplet; std::vector<int> *m_NSWMM_prd_gas_gap; std::vector<int> *m_NSWMM_prd_channel; + std::vector<int> *m_NSWMM_prd_time; std::vector<double> *m_NSWMM_prd_globalPosX; std::vector<double> *m_NSWMM_prd_globalPosY; diff --git a/MuonSpectrometer/MuonValidation/MuonRecValidation/MuonRecRTT/test/test_muonrecrtt_jpsi_with_pileup.sh b/MuonSpectrometer/MuonValidation/MuonRecValidation/MuonRecRTT/test/test_muonrecrtt_jpsi_with_pileup.sh index d90e8865390e3cd90f0fefab0871c56c88fa91e3..332918bafc5bdc26b4aefdeef9e7b947bb2465c2 100755 --- a/MuonSpectrometer/MuonValidation/MuonRecValidation/MuonRecRTT/test/test_muonrecrtt_jpsi_with_pileup.sh +++ b/MuonSpectrometer/MuonValidation/MuonRecValidation/MuonRecRTT/test/test_muonrecrtt_jpsi_with_pileup.sh @@ -19,7 +19,7 @@ echo $AtlasVersion if [ ${AtlasVersion:0:4} == "22.0" ]; then ValOption="" else - ValOption="--outputNTUP_PHYSVALFile valid1.424100.Pythia8B_A14_CTEQ6L1_Jpsimu4mu4_no_pileup.PHYSVAL.root --validationFlags noExample doMuon" + ValOption="--outputNTUP_PHYSVALFile valid1.424100.Pythia8B_A14_CTEQ6L1_Jpsimu4mu4_with_pileup.PHYSVAL.root --validationFlags noExample doMuon" fi echo "ValOption=", $ValOption @@ -47,7 +47,7 @@ case $ArtProcess in unset ATHENA_PROC_NUMBER - Reco_tf.py --maxEvents=-1 --inputRDOFile=${infile} --outputAODFile=valid1.424100.Pythia8B_A14_CTEQ6L1_Jpsimu4mu4_no_pileup.AOD.pool.root $ValOption --preExec 'from RecExConfig.RecFlags import rec; rec.doTrigger=False; import MuonCombinedRecExample.MuonCombinedRecOnlySetup' + Reco_tf.py --maxEvents=-1 --inputRDOFile=${infile} --outputAODFile=valid1.424100.Pythia8B_A14_CTEQ6L1_Jpsimu4mu4_with_pileup.AOD.pool.root $ValOption --preExec 'from RecExConfig.RecFlags import rec; rec.doTrigger=False; import MuonCombinedRecExample.MuonCombinedRecOnlySetup' echo "art-result: $? reco_${ArtProcess}" ls -lR diff --git a/MuonSpectrometer/MuonValidation/MuonRecValidation/MuonRecRTT/test/test_muonrecrtt_toroid_off.sh b/MuonSpectrometer/MuonValidation/MuonRecValidation/MuonRecRTT/test/test_muonrecrtt_toroid_off.sh index 9d3b448a56c57112acb5534a9d8e82e686cb171e..8ed17ed300b3c64f6283bf8d310ab839973ed787 100755 --- a/MuonSpectrometer/MuonValidation/MuonRecValidation/MuonRecRTT/test/test_muonrecrtt_toroid_off.sh +++ b/MuonSpectrometer/MuonValidation/MuonRecValidation/MuonRecRTT/test/test_muonrecrtt_toroid_off.sh @@ -6,10 +6,38 @@ # art-include: master/Athena # art-include: 21.0/Athena # art-input: user.zhidong.data17_13TeV.00325028.physics_Main.daq.RAW_subset01 -# art-input-nfiles: 3 +# art-input-nfiles: 8 +# art-output: art_core_* +# art-cores: 4 set -x -echo "List of files = " ${ArtInFile} +case $ArtProcess in -Reco_tf.py --maxEvents=7500 --conditionsTag RAWtoESD:CONDBR2-BLKPA-2017-12 --geometryVersion ATLAS-R2-2016-01-00-01 --inputBSFile=${ArtInFile} --outputAODFile=MuonToroidOff_Reco.AOD.pool.root --preExec 'from RecExConfig.RecFlags import rec; rec.doTrigger=False; import MuonCombinedRecExample.MuonCombinedRecOnlySetup' + "start") + echo "Starting" + ;; + + "end") + echo "Ending" + ;; + + *) + echo "Test $ArtProcess" + mkdir "art_core_${ArtProcess}" + cd "art_core_${ArtProcess}" + IFS=',' read -r -a file <<< "${ArtInFile}" + infile="../${file[${ArtProcess}]}" + echo "Processing files: " ${infile} + unset ATHENA_NUM_PROC + unset ATHENA_PROC_NUMBER + + + Reco_tf.py --maxEvents=-1 --conditionsTag RAWtoESD:CONDBR2-BLKPA-2017-12 --geometryVersion ATLAS-R2-2016-01-00-01 --inputBSFile=${infile} --outputAODFile=MuonToroidOff_Reco.AOD.pool.root --preExec 'from RecExConfig.RecFlags import rec; rec.doTrigger=False; import MuonCombinedRecExample.MuonCombinedRecOnlySetup' + + echo "art-result: $? reco_${ArtProcess}" + ls -lR + rm -f tmp.ESD + rm -f core.* + ;; +esac \ No newline at end of file diff --git a/MuonSpectrometer/MuonValidation/MuonRecValidation/MuonRecRTT/test/test_nsw_singlemuon_digit.sh b/MuonSpectrometer/MuonValidation/MuonRecValidation/MuonRecRTT/test/test_nsw_singlemuon_digit.sh new file mode 100644 index 0000000000000000000000000000000000000000..c63da02987518bc62e8c5ddf36a0aa6b7a24e9e3 --- /dev/null +++ b/MuonSpectrometer/MuonValidation/MuonRecValidation/MuonRecRTT/test/test_nsw_singlemuon_digit.sh @@ -0,0 +1,16 @@ +#!/bin/sh +# +# art-description: Test the muon digitization for New Small Wheel. +# +# art-type: grid +# +# art-include: 21.3/Athena + +set -x + +Reco_tf.py --preExec 'from AthenaCommon.DetFlags import DetFlags;DetFlags.ID_setOn();DetFlags.Calo_setOn();DetFlags.Muon_setOn();DetFlags.MDT_setOn();DetFlags.CSC_setOff();DetFlags.TGC_setOn();DetFlags.RPC_setOn();DetFlags.sTGC_setOn();DetFlags.Micromegas_setOn();DetFlags.Truth_setOn()' \ + --inputHITSFile /cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/MuonRecRTT/NSW/digit/*.root \ + --maxEvents -1 \ + --outputRDOFile NSW_SingleMuon_Digitization_RDO_.pool.root + +echo "art-result: $?" diff --git a/MuonSpectrometer/MuonValidation/MuonRecValidation/MuonRecRTT/test/test_nsw_singlemuon_evntgen.sh b/MuonSpectrometer/MuonValidation/MuonRecValidation/MuonRecRTT/test/test_nsw_singlemuon_evntgen.sh new file mode 100644 index 0000000000000000000000000000000000000000..f15b1aa3d9e2aed61b68ed65d1296571f4107ada --- /dev/null +++ b/MuonSpectrometer/MuonValidation/MuonRecValidation/MuonRecRTT/test/test_nsw_singlemuon_evntgen.sh @@ -0,0 +1,18 @@ +#!/bin/sh +# +# art-description: Test the muon event generation for New Small Wheel. +# +# art-type: grid +# art-include: master/Athena +# art-include: 21.3/Athena + +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 \ + --outputHITSFile NSW_SingleMuon_EvntGen.hits.pool.root \ + --maxEvents -1 + +echo "art-result: $?" diff --git a/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonFourMomentumCorrection/Root/LArTemperatureCorrectionTool.cxx b/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonFourMomentumCorrection/Root/LArTemperatureCorrectionTool.cxx index 440015f41fecc2c036d6d10ee52459c053f7e451..288b81a111b9cb21ab471e60295d56c4c7e1ac26 100644 --- a/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonFourMomentumCorrection/Root/LArTemperatureCorrectionTool.cxx +++ b/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonFourMomentumCorrection/Root/LArTemperatureCorrectionTool.cxx @@ -20,7 +20,9 @@ LArTemperatureCorrectionTool::LArTemperatureCorrectionTool(std::string filename) if (!m_file or m_file->IsZombie()) { ATH_MSG_ERROR("cannot open file"); } m_tree = dynamic_cast<TTree*>(m_file->Get("temperature")); - if (!m_tree) { ATH_MSG_FATAL("cannot find tree"); } + if ( m_tree == nullptr ) { + throw std::runtime_error( "cannot find tree" ); + } Int_t t_run = 0; m_tree->SetBranchAddress("run", &t_run); diff --git a/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonFourMomentumCorrection/Root/egammaEnergyCorrectionTool.cxx b/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonFourMomentumCorrection/Root/egammaEnergyCorrectionTool.cxx index 498034f0dae29d3d6625c9a7915bfd5b2a0e6496..c53081939cbd66b3b7fc3a0cae2bbffe4436ffcc 100644 --- a/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonFourMomentumCorrection/Root/egammaEnergyCorrectionTool.cxx +++ b/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonFourMomentumCorrection/Root/egammaEnergyCorrectionTool.cxx @@ -92,6 +92,24 @@ namespace AtlasRoot { m_zeePhys = nullptr; m_uA2MeV_2015_first2weeks_correction = nullptr; + m_zeeNom_data2015 = nullptr; + m_wstot_slope_A_data = nullptr; + m_wstot_slope_B_MC = nullptr; + m_wstot_40GeV_data = nullptr; + m_wstot_40GeV_MC = nullptr; + m_wstot_pT_data_p0_electrons = nullptr; + m_wstot_pT_data_p1_electrons = nullptr; + m_wstot_pT_data_p0_unconverted_photons = nullptr; + m_wstot_pT_data_p1_unconverted_photons = nullptr; + m_wstot_pT_data_p0_converted_photons = nullptr; + m_wstot_pT_data_p1_converted_photons = nullptr; + m_wstot_pT_MC_p0_electrons = nullptr; + m_wstot_pT_MC_p1_electrons = nullptr; + m_wstot_pT_MC_p0_unconverted_photons = nullptr; + m_wstot_pT_MC_p1_unconverted_photons = nullptr; + m_wstot_pT_MC_p0_converted_photons = nullptr; + m_wstot_pT_MC_p1_converted_photons = nullptr; + m_resNom = nullptr; m_resSyst = nullptr; diff --git a/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonFourMomentumCorrection/Root/get_MaterialResolutionEffect.cxx b/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonFourMomentumCorrection/Root/get_MaterialResolutionEffect.cxx index da088ead3f761db418f3a22303ca6d44f5ff0ac4..671aa1237b077ea485415253da7799b7713c881c 100644 --- a/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonFourMomentumCorrection/Root/get_MaterialResolutionEffect.cxx +++ b/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonFourMomentumCorrection/Root/get_MaterialResolutionEffect.cxx @@ -100,7 +100,6 @@ double get_MaterialResolutionEffect::getDelta(int particle_type, double energy, double et2=et; if (et<5.) et2=5.1; if (et>2000) et2=1999.; - if (particle_type==3) particle_type=2; return 0.01*m_hsyst_IBL_PP0[particle_type]->GetBinContent(m_hsyst_IBL_PP0[particle_type]->GetXaxis()->FindBin(aeta),m_hsyst_IBL_PP0[particle_type]->GetYaxis()->FindBin(et2)); } diff --git a/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonFourMomentumCorrection/src/dumpAllSystematics.cxx b/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonFourMomentumCorrection/src/dumpAllSystematics.cxx index 192370760b3d29a208ad60ffc06d3b4a284fba88..d8aaad125fee4d3622fba931f8eb7eb6fc4d429d 100644 --- a/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonFourMomentumCorrection/src/dumpAllSystematics.cxx +++ b/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonFourMomentumCorrection/src/dumpAllSystematics.cxx @@ -34,7 +34,33 @@ #include "dumpAllSystematics.h" DumpAllSystematics::DumpAllSystematics(const std::string& name, ISvcLocator* svcLoc) - : AthAlgorithm(name, svcLoc) + : AthAlgorithm(name, svcLoc), + m_EventNumber(0), + m_RunNumber(0), + m_instance_index(0), + m_actualIntPerXing(0.), + m_averageIntPerXing(0.), + m_truth_pt(0.), + m_truth_phi(0.), + m_truth_eta(0.), + m_truth_E(0.), + m_truth_pdgId(0), + m_truth_parent_pdgId(0), + m_truth_matched(false), + m_truth_isConv(false), + m_truth_Rconv(0.), + m_npv(0), + m_cl_phi(0.), + m_cl_eta(0.), + m_cl_etaCalo(0.), + m_cl_rawcl_Es0(0.), + m_cl_rawcl_Es1(0.), + m_cl_rawcl_Es2(0.), + m_cl_rawcl_Es3(0.), + m_cl_E(0.), + m_ph_Rconv(0.), + m_ph_convFlag(0), + m_wstot(0.) { declareProperty("EgammaCalibrationAndSmearingTools", m_EgammaCalibrationAndSmearingTools); declareProperty("particle", m_particle_name="", "electron/photon"); diff --git a/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/ElectronPhotonSelectorTools/AsgElectronLikelihoodTool.h b/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/ElectronPhotonSelectorTools/AsgElectronLikelihoodTool.h index f895f28efddc6e5cfe8db4ee20f3866367afb5d8..ec3049d1b3f1f73398daab6d0faf82ea7fafe4ba 100644 --- a/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/ElectronPhotonSelectorTools/AsgElectronLikelihoodTool.h +++ b/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/ElectronPhotonSelectorTools/AsgElectronLikelihoodTool.h @@ -141,19 +141,12 @@ private: /// defualt nPV (when not using PVCont) unsigned int m_nPVdefault; - /// The primary vertex container name - std::string m_primVtxContName; - /// Whether or not to use the CaloSums container in HI events bool m_useCaloSumsCont; /// defualt FCal ET (when not using CaloSums container, in HI events) double m_fcalEtDefault; - /// The CaloSums container name, in HI events - std::string m_CaloSumsContName; - - /// The input ROOT file name that holds the PDFs std::string m_pdfFileName; diff --git a/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/ElectronPhotonSelectorTools/AsgForwardElectronIsEMSelector.h b/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/ElectronPhotonSelectorTools/AsgForwardElectronIsEMSelector.h index 2ea401ad4a0e98b82729bcccb0a90357114935b2..dc1bbdec2a2af63ace3d3de91431ccd158bbe7ca 100644 --- a/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/ElectronPhotonSelectorTools/AsgForwardElectronIsEMSelector.h +++ b/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/ElectronPhotonSelectorTools/AsgForwardElectronIsEMSelector.h @@ -105,9 +105,6 @@ private: // defualt nPV (when not using PVCont) unsigned int m_nPVdefault; - // The primary vertex container name - std::string m_primVtxContName; - /// read handle key to primary vertex container SG::ReadHandleKey<xAOD::VertexContainer> m_primVtxContKey; diff --git a/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/Root/AsgElectronLikelihoodTool.cxx b/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/Root/AsgElectronLikelihoodTool.cxx index 1efce37b56d16326ae6ca2db2bf1ba742e21872a..53dfea0f5e256270043dbc5199239a8bf51e84b6 100644 --- a/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/Root/AsgElectronLikelihoodTool.cxx +++ b/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/Root/AsgElectronLikelihoodTool.cxx @@ -50,10 +50,10 @@ AsgElectronLikelihoodTool::AsgElectronLikelihoodTool(std::string myname) : declareProperty("ConfigFile",m_configFile="","The config file to use"); declareProperty("usePVContainer", m_usePVCont=true, "Whether to use the PV container"); declareProperty("nPVdefault", m_nPVdefault = 0, "The default number of PVs if not counted"); - declareProperty("primaryVertexContainer", m_primVtxContName="PrimaryVertices", "The primary vertex container name" ); + declareProperty("primaryVertexContainer", m_primVtxContKey="PrimaryVertices", "The primary vertex container name" ); declareProperty("useCaloSumsContainer", m_useCaloSumsCont=true, "Whether to use the CaloSums container"); declareProperty("fcalEtDefault", m_fcalEtDefault = 0, "The default FCal sum ET"); - declareProperty("CaloSumsContainer", m_CaloSumsContName="CaloSums", "The CaloSums container name" ); + declareProperty("CaloSumsContainer", m_HIESContKey="CaloSums", "The CaloSums container name" ); @@ -159,8 +159,8 @@ StatusCode AsgElectronLikelihoodTool::initialize() if(!m_configFile.empty()){ std::string configFile = PathResolverFindCalibFile( m_configFile); if(configFile==""){ - ATH_MSG_ERROR("Could not locate " << m_configFile ); - return StatusCode::FAILURE; + ATH_MSG_ERROR("Could not locate " << m_configFile ); + return StatusCode::FAILURE; } ATH_MSG_DEBUG("Configfile to use " << m_configFile ); @@ -171,8 +171,8 @@ StatusCode AsgElectronLikelihoodTool::initialize() if(!m_pdfFileName.empty()) { //If the property was set by the user, take that. - ATH_MSG_INFO("Setting user specified PDF file " << m_pdfFileName); - PDFfilename = m_pdfFileName; + ATH_MSG_INFO("Setting user specified PDF file " << m_pdfFileName); + PDFfilename = m_pdfFileName; } else { if (m_configFile.find("dev/") != std::string::npos) { @@ -192,10 +192,6 @@ StatusCode AsgElectronLikelihoodTool::initialize() return StatusCode::FAILURE; } - // Setup primary vertex key handle - m_primVtxContKey = m_primVtxContName; - ATH_CHECK( m_primVtxContKey.initialize(m_usePVCont) ); - m_rootTool->m_variableNames = env.GetValue("VariableNames",""); m_rootTool->m_cutLikelihood = AsgConfigHelper::HelperDouble("CutLikelihood",env); m_rootTool->m_cutLikelihoodPileupCorrection = AsgConfigHelper::HelperDouble("CutLikelihoodPileupCorrection", env); @@ -242,33 +238,30 @@ StatusCode AsgElectronLikelihoodTool::initialize() m_rootTool->m_discLooseForPileupTransform4GeV = AsgConfigHelper::HelperDouble("DiscLooseForPileupTransform4GeV",env); m_rootTool->m_discMaxForPileupTransform = env.GetValue("DiscMaxForPileupTransform", 2.0); m_rootTool->m_pileupMaxForPileupTransform = env.GetValue("PileupMaxForPileupTransform", 50); - - - // Setup HI container key handle (must come after init from env) - m_HIESContKey = m_CaloSumsContName; - bool doCentralityTransform = m_rootTool->m_doCentralityTransform; - ATH_CHECK( m_HIESContKey.initialize(doCentralityTransform) ); - + } else{ //Error if it cant find the conf ATH_MSG_ERROR("Could not find configuration file"); return StatusCode::FAILURE; } - -///-----------End of text config---------------------------- + ///-----------End of text config---------------------------- + + // Setup primary vertex key handle + ATH_CHECK( m_primVtxContKey.initialize(m_usePVCont) ); + // Setup HI container key handle (must come after init from env) + bool doCentralityTransform = m_rootTool->m_doCentralityTransform; + ATH_CHECK(m_HIESContKey.initialize(doCentralityTransform&&m_useCaloSumsCont)); + // Get the name of the current operating point, and massage the other strings accordingly ATH_MSG_VERBOSE( "Going to massage the labels based on the provided operating point..." ); - // Get the message level and set the underlying ROOT tool message level accordingly m_rootTool->msg().setLevel(this->msg().level()); // We need to initialize the underlying ROOT TSelectorTool - if ( m_rootTool->initialize().isFailure() ) - { - ATH_MSG_ERROR ( "ERROR! Could not initialize the TElectronLikelihoodTool!" ); - return StatusCode::FAILURE; - } - + if ( m_rootTool->initialize().isFailure() ){ + ATH_MSG_ERROR ( "ERROR! Could not initialize the TElectronLikelihoodTool!" ); + return StatusCode::FAILURE; + } return StatusCode::SUCCESS ; } diff --git a/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/Root/AsgForwardElectronIsEMSelector.cxx b/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/Root/AsgForwardElectronIsEMSelector.cxx index 050b9d37d981310f99e0e4114ba0086888f25367..a9b38e43d40dd3cbf50a78c3dafb4bc110b62452 100644 --- a/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/Root/AsgForwardElectronIsEMSelector.cxx +++ b/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/Root/AsgForwardElectronIsEMSelector.cxx @@ -37,12 +37,10 @@ AsgForwardElectronIsEMSelector::AsgForwardElectronIsEMSelector(std::string mynam m_rootForwardTool = new Root::TForwardElectronIsEMSelector(myname.c_str()); declareProperty("WorkingPoint",m_WorkingPoint="","The Working Point"); - declareProperty("ConfigFile",m_configFile="", - "The config file to use (if not setting cuts one by one)"); - + declareProperty("ConfigFile",m_configFile="","The config file to use (if not setting cuts one by one)"); declareProperty("usePVContainer", m_usePVCont=true, "Whether to use the PV container"); declareProperty("nPVdefault", m_nPVdefault = 0, "The default number of PVs if not counted"); - declareProperty("primaryVertexContainer", m_primVtxContName="PrimaryVertices", "The primary vertex container name" ); + declareProperty("primaryVertexContainer", m_primVtxContKey="PrimaryVertices", "The primary vertex container name" ); // Name of the quality to use declareProperty("isEMMask", @@ -88,7 +86,7 @@ StatusCode AsgForwardElectronIsEMSelector::initialize() // The standard status code StatusCode sc = StatusCode::SUCCESS ; - if(!m_WorkingPoint.empty()){ + if(!m_WorkingPoint.empty()){ m_configFile=AsgConfigHelper::findConfigFile(m_WorkingPoint,EgammaSelectors::ForwardElectronCutPointToConfFile); } @@ -96,19 +94,15 @@ StatusCode AsgForwardElectronIsEMSelector::initialize() //find the file and read it in std::string filename = PathResolverFindCalibFile( m_configFile); if(filename=="") - { - ATH_MSG_ERROR("Could not locate " << m_configFile ); - sc = StatusCode::FAILURE; - return sc; - } + { + ATH_MSG_ERROR("Could not locate " << m_configFile ); + sc = StatusCode::FAILURE; + return sc; + } ATH_MSG_DEBUG("Configfile to use " << m_configFile ); TEnv env(filename.c_str()); - // Setup primary vertex key handle - m_primVtxContKey = m_primVtxContName; - ATH_CHECK( m_primVtxContKey.initialize(m_usePVCont) ); - - + ///------- Read in the TEnv config ------/// //Override the mask via the config only if it is not set @@ -131,6 +125,8 @@ StatusCode AsgForwardElectronIsEMSelector::initialize() ATH_MSG_INFO("Conf file empty. Just user Input"); } + ATH_CHECK( m_primVtxContKey.initialize(m_usePVCont) ); + ATH_MSG_INFO("operating point : " << this->getOperatingPointName() << " with mask: "<< m_rootForwardTool->m_isEMMask ); // Get the message level and set the underlying ROOT tool message level accordingly diff --git a/PhysicsAnalysis/ElectronPhotonID/IsolationCorrections/IsolationCorrections/IsolationCorrectionTool.h b/PhysicsAnalysis/ElectronPhotonID/IsolationCorrections/IsolationCorrections/IsolationCorrectionTool.h index 2738878391e23580f1ee8356ef2d40df6192397b..f23159fcd01e9e98bd74233a0abb39a6d429a99d 100644 --- a/PhysicsAnalysis/ElectronPhotonID/IsolationCorrections/IsolationCorrections/IsolationCorrectionTool.h +++ b/PhysicsAnalysis/ElectronPhotonID/IsolationCorrections/IsolationCorrections/IsolationCorrectionTool.h @@ -71,7 +71,8 @@ class IsolationCorrectionTool : virtual public IIsolationCorrectionTool, bool m_is_mc; bool m_AFII_corr; std::string m_ddVersion; - bool m_apply_dd, m_apply_ddDefault; + bool m_apply_dd; + bool m_apply_ddDefault; bool m_correct_etcone; bool m_trouble_categories; bool m_metadata_retrieved; diff --git a/PhysicsAnalysis/ElectronPhotonID/IsolationCorrections/Root/IsolationCorrectionTool.cxx b/PhysicsAnalysis/ElectronPhotonID/IsolationCorrections/Root/IsolationCorrectionTool.cxx index ba48d933f4eeebf6ea394873af38f39fd908b165..529767df8d6caad50b9830ae8b7fcd3df13b796f 100644 --- a/PhysicsAnalysis/ElectronPhotonID/IsolationCorrections/Root/IsolationCorrectionTool.cxx +++ b/PhysicsAnalysis/ElectronPhotonID/IsolationCorrections/Root/IsolationCorrectionTool.cxx @@ -20,7 +20,7 @@ namespace CP { IsolationCorrectionTool::IsolationCorrectionTool( const std::string &name ) - : asg::AsgMetadataTool(name), m_systDDonoff("PH_Iso_DDonoff"){ + : asg::AsgMetadataTool(name), m_apply_dd(false), m_metadata_retrieved(false), m_systDDonoff("PH_Iso_DDonoff") { declareProperty("CorrFile", m_corr_file = "IsolationCorrections/v1/isolation_ptcorrections_rel20_2.root"); declareProperty("CorrFile_ddshift_2015", m_corr_ddshift_2015_file = "IsolationCorrections/v1/isolation_ddcorrection_shift_2015_v3.root"); declareProperty("CorrFile_ddshift", m_corr_ddshift_file = "IsolationCorrections/v1/isolation_ddcorrection_shift.root"); @@ -162,13 +162,11 @@ namespace CP { ATH_MSG_DEBUG("no sim flavour from metadata: must be data"); return StatusCode::FAILURE; } - else { - boost::to_upper(simType); - result = (simType.find("ATLFASTII")==std::string::npos) ? PATCore::ParticleDataType::Full : PATCore::ParticleDataType::Fast; - return StatusCode::SUCCESS; - } - // + + boost::to_upper(simType); + result = (simType.find("ATLFASTII")==std::string::npos) ? PATCore::ParticleDataType::Full : PATCore::ParticleDataType::Fast; return StatusCode::SUCCESS; + } StatusCode IsolationCorrectionTool::beginInputFile() { diff --git a/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/python/BTaggingConfiguration_LoadTools.py b/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/python/BTaggingConfiguration_LoadTools.py index 7258f6fc9bb588e295eb288c0fc869e859e042df..f4ae66c1c07e5a4f137cf0b4f0e2d94ffed30a33 100644 --- a/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/python/BTaggingConfiguration_LoadTools.py +++ b/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/python/BTaggingConfiguration_LoadTools.py @@ -203,7 +203,7 @@ def SetupConditionAlgorithm(ConfInstance=None): readkeycalibpath = readkeycalibpath.replace("/GLOBAL/BTagCalib","/GLOBAL/Onl/BTagCalib") connSchema = "GLOBAL" Taggers = ['IP2D','IP3D','SV1','JetFitterNN','SoftMu', 'MV2c10', 'MV2c100', 'MV2c10mu', 'MV2c10rnn', 'MV2cl100','RNNIP', 'JetVertexCharge', 'MultiSVbb1', 'MultiSVbb2', 'DL1', 'DL1mu', 'DL1rnn'] - jettagcalibcondalg = "JetTagCalibHistosKey" + jettagcalibcondalg = "JetTagCalibCondAlg" histoskey = "JetTagCalibHistosKey" conddb.addFolder(connSchema, readkeycalibpath, className='CondAttrListCollection') JetTagCalib = JetTagCalibCondAlg(jettagcalibcondalg, ReadKeyCalibPath=readkeycalibpath, HistosKey = histoskey, taggers = Taggers, channelAliases = BTaggingFlags.CalibrationChannelAliases, IP2D_TrackGradePartitions = grades, RNNIP_NetworkConfig = BTaggingFlags.RNNIPConfig) diff --git a/PhysicsAnalysis/JetTagging/JetTagCalibration/CMakeLists.txt b/PhysicsAnalysis/JetTagging/JetTagCalibration/CMakeLists.txt index b82b5150682e4be7a16d448f516ef8cd05589210..bfe41a9fa8f62b4a2c569e344cd04bb5638e6979 100644 --- a/PhysicsAnalysis/JetTagging/JetTagCalibration/CMakeLists.txt +++ b/PhysicsAnalysis/JetTagging/JetTagCalibration/CMakeLists.txt @@ -19,13 +19,14 @@ atlas_depends_on_subdirs( PUBLIC # External dependencies: find_package( ROOT COMPONENTS Core Tree MathCore Hist RIO pthread ) +find_package( Eigen ) # Component(s) in the package: atlas_add_library( JetTagCalibrationLib src/*.cxx PUBLIC_HEADERS JetTagCalibration - INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} - LINK_LIBRARIES ${ROOT_LIBRARIES} AthenaBaseComps GaudiKernel StoreGateLib SGtests FileCatalog + INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} ${EIGEN_INCLUDE_DIRS} + LINK_LIBRARIES ${ROOT_LIBRARIES} ${EIGEN_LIBRARIES} AthenaBaseComps GaudiKernel StoreGateLib SGtests FileCatalog PRIVATE_LINK_LIBRARIES AthenaPoolUtilities ) atlas_add_component( JetTagCalibration diff --git a/PhysicsAnalysis/JetTagging/JetTagTools/JetTagTools/Exceptions.h b/PhysicsAnalysis/JetTagging/JetTagCalibration/JetTagCalibration/Exceptions.h similarity index 100% rename from PhysicsAnalysis/JetTagging/JetTagTools/JetTagTools/Exceptions.h rename to PhysicsAnalysis/JetTagging/JetTagCalibration/JetTagCalibration/Exceptions.h diff --git a/PhysicsAnalysis/JetTagging/JetTagCalibration/JetTagCalibration/JetTagCalibCondAlg.h b/PhysicsAnalysis/JetTagging/JetTagCalibration/JetTagCalibration/JetTagCalibCondAlg.h index 2c0bb6687f92fae373284e204a22256010b8fba6..60193e2aaf3893758b27668c575645d29f291403 100755 --- a/PhysicsAnalysis/JetTagging/JetTagCalibration/JetTagCalibration/JetTagCalibCondAlg.h +++ b/PhysicsAnalysis/JetTagging/JetTagCalibration/JetTagCalibration/JetTagCalibCondAlg.h @@ -68,7 +68,6 @@ class JetTagCalibCondAlg : public AthAlgorithm { std::vector<std::string> tokenize(std::string str, std::string delim); void smoothAndNormalizeHistogram(TObject*& h, const std::string& hname); void smoothASH2D(TH2* input2D, int m1, int m2); - void initializeIPTag(); void initializeIP2D(); void initializeIP3D(); @@ -124,6 +123,9 @@ class JetTagCalibCondAlg : public AthAlgorithm { bool m_JetFitterNN_useCombinedIPNN; int m_JetFitterNN_maximumRegisteredLayers; + //for DL1Tag + std::string m_DL1_file_name; // directory of DL1 NN calibration (starting from specific jet collection directory) in COOL db + //for RNNIP // Initalize with a config name and path to a network If the // network path is empty we read from the calib db Note that this diff --git a/PhysicsAnalysis/JetTagging/JetTagCalibration/JetTagCalibration/JetTagCalibCondData.h b/PhysicsAnalysis/JetTagging/JetTagCalibration/JetTagCalibration/JetTagCalibCondData.h index 83f851a3d4acd46e1eb036d0856aeba5b9f204eb..c9fc9f3b572690a18e7752f656c9229a6ef63d93 100644 --- a/PhysicsAnalysis/JetTagging/JetTagCalibration/JetTagCalibration/JetTagCalibCondData.h +++ b/PhysicsAnalysis/JetTagging/JetTagCalibration/JetTagCalibration/JetTagCalibCondData.h @@ -13,7 +13,10 @@ #include <vector> #include <map> #include "AthenaKernel/CLASS_DEF.h" - +#include "JetTagCalibration/parse_json.h" +#include "JetTagCalibration/NNLayerConfig.h" +#include "JetTagCalibration/LightweightNeuralNetwork.h" +#include "JetTagCalibration/Exceptions.h" class TObject; class TH1; @@ -23,6 +26,10 @@ class TH1; * Concrete class for JetTagging calibration condition data **/ +namespace lwt { + class LightweightNeuralNetwork; +} + namespace Analysis { class JetTagCalibCondData { @@ -39,8 +46,10 @@ public: void printHistosStatus() const; std::string getChannelAlias(const std::string& originalChannel) const; void addHisto(const unsigned int indexTagger, const std::string& name, TObject *); + void addDL1NN(const std::string& tagger, const std::string& channel, const lwt::JSONConfig& ); void addChannelAlias(const std::string& channel, const std::string& alias); TH1* retrieveHistogram(const std::string& folder, const std::string& channel, const std::string& hname) const; + lwt::JSONConfig retrieveDL1NN(std::string& tagger, const std::string& channel) const; template <class T> T* retrieveTObject(const std::string& folder, const std::string& channel, const std::string& hname) const; std::string channelName(const std::string& fullHistoName) const; @@ -53,6 +62,8 @@ private: std::map< std::string, std::string > m_channelAliasesMap; std::vector< std::string> m_taggers; + //DL1 NN Json config + std::map< std::string, std::map< std::string, lwt::JSONConfig >> m_DL1_NNConfig; }; } CLASS_DEF(Analysis::JetTagCalibCondData, 232300155, 1) diff --git a/PhysicsAnalysis/JetTagging/JetTagTools/JetTagTools/LightweightNeuralNetwork.h b/PhysicsAnalysis/JetTagging/JetTagCalibration/JetTagCalibration/LightweightNeuralNetwork.h similarity index 100% rename from PhysicsAnalysis/JetTagging/JetTagTools/JetTagTools/LightweightNeuralNetwork.h rename to PhysicsAnalysis/JetTagging/JetTagCalibration/JetTagCalibration/LightweightNeuralNetwork.h diff --git a/PhysicsAnalysis/JetTagging/JetTagTools/JetTagTools/NNLayerConfig.h b/PhysicsAnalysis/JetTagging/JetTagCalibration/JetTagCalibration/NNLayerConfig.h similarity index 100% rename from PhysicsAnalysis/JetTagging/JetTagTools/JetTagTools/NNLayerConfig.h rename to PhysicsAnalysis/JetTagging/JetTagCalibration/JetTagCalibration/NNLayerConfig.h diff --git a/PhysicsAnalysis/JetTagging/JetTagTools/JetTagTools/Stack.h b/PhysicsAnalysis/JetTagging/JetTagCalibration/JetTagCalibration/Stack.h similarity index 99% rename from PhysicsAnalysis/JetTagging/JetTagTools/JetTagTools/Stack.h rename to PhysicsAnalysis/JetTagging/JetTagCalibration/JetTagCalibration/Stack.h index 23a666e6634f63f10e903ab6332488bf09b2ad7e..19d4912f5c972a4bf56fb86212c933406167d734 100644 --- a/PhysicsAnalysis/JetTagging/JetTagTools/JetTagTools/Stack.h +++ b/PhysicsAnalysis/JetTagging/JetTagCalibration/JetTagCalibration/Stack.h @@ -6,7 +6,7 @@ // https://github.com/lwtnn/lwtnn.git (rev v2.0) // Please don't edit it! To get the latest version, run // > ./update-lwtnn.sh -// from JetTagTools/share +// from JetTagCalibration/share #ifndef STACK_HH #define STACK_HH diff --git a/PhysicsAnalysis/JetTagging/JetTagTools/JetTagTools/parse_json.h b/PhysicsAnalysis/JetTagging/JetTagCalibration/JetTagCalibration/parse_json.h similarity index 100% rename from PhysicsAnalysis/JetTagging/JetTagTools/JetTagTools/parse_json.h rename to PhysicsAnalysis/JetTagging/JetTagCalibration/JetTagCalibration/parse_json.h diff --git a/PhysicsAnalysis/JetTagging/JetTagCalibration/share/JetTagCalibrationCondAlg_jobOptions.py b/PhysicsAnalysis/JetTagging/JetTagCalibration/share/JetTagCalibrationCondAlg_jobOptions.py deleted file mode 100755 index 336d0492ed2b8d5cfa2a7135d261f050aefbe012..0000000000000000000000000000000000000000 --- a/PhysicsAnalysis/JetTagging/JetTagCalibration/share/JetTagCalibrationCondAlg_jobOptions.py +++ /dev/null @@ -1,67 +0,0 @@ -from AthenaCommon.AthenaCommonFlags import athenaCommonFlags -from AthenaCommon.GlobalFlags import globalflags -if globalflags.DataSource()=='data': - BTaggingFlags.CalibrationFolderRoot=BTaggingFlags.CalibrationFolderRoot.replace("/GLOBAL/BTagCalib","/GLOBAL/Onl/BTagCalib") - connSchema="GLOBAL" - message = "#BTAG# accessing online conditions DB" - if not athenaCommonFlags.isOnline(): - message = message + " (via offline replica)" - print message -else: - connSchema="GLOBAL_OFL" - print "#BTAG# accessing offline conditions DB" - -print "#BTAG# running in reco mode -> btag calibration root folder is CalibrationFolderRoot =", BTaggingFlags.CalibrationFolderRoot - -JetCollectionForCalib = [] -JetCollectionForCalib+= BTaggingFlags.Jets -if "AntiKt4EMTopo" not in JetCollectionForCalib: - JetCollectionForCalib+=["AntiKt4EMTopo"] - -print "BTAG channel" -print BTaggingFlags.CalibrationChannelAliases - -#IP2D -grades= [ "0HitIn0HitNInExp2","0HitIn0HitNInExpIn","0HitIn0HitNInExpNIn","0HitIn0HitNIn", - "0HitInExp", "0HitIn", - "0HitNInExp", "0HitNIn", - "InANDNInShared", "PixShared", "SctShared", - "InANDNInSplit", "PixSplit", - "Good"] - -from JetTagCalibration.JetTagCalibrationConf import Analysis__JetTagCalibCondAlg -JetTagCalibrationCondAlg = Analysis__JetTagCalibCondAlg( - name = "JetTagCalibrationCondAlg", - taggers = [], - channels = JetCollectionForCalib, - channelAliases = BTaggingFlags.CalibrationChannelAliases, - IP2D_TrackGradePartitions = grades, - RNNIP_NerworkConfig = BTaggingFlags.RNNIPConfig, - OutputLevel = BTaggingFlags.OutputLevel -) -ToolSvc += JetTagCalibrationCondAlg -theApp.Dlls+=['DetDescrCondExample','DetDescrCondTools'] - -from IOVDbSvc.CondDB import conddb - -# with new scheme, only one actual COOL folder: -folder = BTaggingFlags.CalibrationFolderRoot + 'RUN12' - -if BTaggingFlags.CalibrationFromLocalReplica: - dbname="OFLP200" - #For data, use COMP200 for Run 1, CONDBR2 for Run 2 - if globalflags.DataSource()=='data': - dbname=conddb.dbdata - conddb.addFolder("","<dbConnection>sqlite://X;schema=mycool.db;dbname="+dbname+"</dbConnection> "+folder+" <tag>"+BTaggingFlags.CalibrationTag+"</tag>") -else: - if BTaggingFlags.CalibrationFromCERN: - conddb.addFolder("","<dbConnection>oracle://ATLAS_COOLPROD;schema=ATLAS_COOLOFL_GLOBAL;dbname=OFLP200</dbConnection> "+folder+" <tag>"+BTaggingFlags.CalibrationTag+"</tag>") - else: - if BTaggingFlags.CalibrationTag == "": - conddb.addFolder(connSchema,folder) - else: - conddb.addFolder(connSchema,folder+" <tag>"+BTaggingFlags.CalibrationTag+"</tag>") - -if BTaggingFlags.OutputLevel < 3: - print JetTagCalibrationCondAlg - diff --git a/PhysicsAnalysis/JetTagging/JetTagTools/share/update-lwtnn.sh b/PhysicsAnalysis/JetTagging/JetTagCalibration/share/update-lwtnn.sh similarity index 93% rename from PhysicsAnalysis/JetTagging/JetTagTools/share/update-lwtnn.sh rename to PhysicsAnalysis/JetTagging/JetTagCalibration/share/update-lwtnn.sh index fb3464523bb5b0fd2819b1248e29f37edbb2f459..57b13bd5f2d57ee9c4e1f1a3881ebcb7fc5244ab 100755 --- a/PhysicsAnalysis/JetTagging/JetTagTools/share/update-lwtnn.sh +++ b/PhysicsAnalysis/JetTagging/JetTagCalibration/share/update-lwtnn.sh @@ -1,7 +1,7 @@ #!/usr/bin/env bash # destination package settings -INC_DIR=JetTagTools +INC_DIR=JetTagCalibration # do the stuff! cd ../ @@ -47,7 +47,7 @@ for HEADER in ${HEADERS[@]}; do done # copy over src files (change headers to match) -SEDSTR='s:^#include "lwtnn/(.*)\.hh":#include "JetTagTools/\1\.h":' +SEDSTR='s:^#include "lwtnn/(.*)\.hh":#include "JetTagCalibration/\1\.h":' for SRC_FILE in ${SRC_FILES[@]}; do NEWSRC=$SRC/$SRC_FILE echo -e $BANNER >| $NEWSRC diff --git a/PhysicsAnalysis/JetTagging/JetTagCalibration/src/JetTagCalibCondAlg.cxx b/PhysicsAnalysis/JetTagging/JetTagCalibration/src/JetTagCalibCondAlg.cxx index 53245d583cabaccf1fc721e27d78a4c6df6710cf..fffbaa1bbab91bdd9dcfce9a7a90ad52cee70f28 100644 --- a/PhysicsAnalysis/JetTagging/JetTagCalibration/src/JetTagCalibCondAlg.cxx +++ b/PhysicsAnalysis/JetTagging/JetTagCalibration/src/JetTagCalibCondAlg.cxx @@ -10,6 +10,7 @@ #include "FileCatalog/IFileCatalog.h" #include "TH1.h" #include "TH2.h" +#include <TObjString.h> #include "TObject.h" #include <TString.h> #include "TTree.h" @@ -427,11 +428,11 @@ namespace Analysis { void JetTagCalibCondAlg::initializeDL1(std::string taggerNameBase) { - std::string file_name = "net_configuration"; // directory of NN calibration (starting from specific jet collection directory) in COOL db - this->registerHistogram(taggerNameBase, file_name); //register the calibration file for later access + m_DL1_file_name = "net_configuration"; // directory of NN calibration (starting from specific jet collection directory) in COOL db + this->registerHistogram(taggerNameBase, m_DL1_file_name); //register the calibration file for later access ATH_MSG_DEBUG(" #BTAG# Registered NN histograms with directory: " << taggerNameBase); - } + } void JetTagCalibCondAlg::registerHistogram(const std::string& tagger, const std::string& hname) { std::string dir(tagger); @@ -536,18 +537,31 @@ namespace Analysis { TObject* hPointer = nullptr; if (getTObject(hFullName, pfile, hPointer)) { if(hPointer) { - ATH_MSG_DEBUG( "#BTAG# Cached pointer to histogram: " << hPointer); - if (tagger == "IP2D" || tagger == "IP3D" || tagger == "SV1") { - ATH_MSG_VERBOSE("#BTAG# Smoothing histogram " << hname << " ..."); - smoothAndNormalizeHistogram(hPointer, hname); + ATH_MSG_DEBUG( "#BTAG# Cached pointer to histogram or string: " << hPointer); + if (tagger.find("DL1")!=std::string::npos ) { + ATH_MSG_DEBUG("#BTAG# Build DL1 NN config for tagger " << tagger << " and jet collection " << channel << " and write it in condition data"); + TObjString* cal_string = dynamic_cast<TObjString*>(hPointer); + std::istringstream nn_config_sstream(cal_string->GetString().Data()); + lwt::JSONConfig nn_config = lwt::parse_json(nn_config_sstream); + ATH_MSG_DEBUG("#BTAG# Layers size << " << nn_config.layers.size()); + + writeCdo->addDL1NN(tagger, channel, nn_config); + } + else { + if (tagger == "IP2D" || tagger == "IP3D" || tagger == "SV1") { + ATH_MSG_VERBOSE("#BTAG# Smoothing histogram " << hname << " ..."); + smoothAndNormalizeHistogram(hPointer, hname); + } + + writeCdo->addHisto(i,fname,hPointer); } + const TString rootClassName=hPointer->ClassName(); if (rootClassName=="TTree") { ((TTree*)hPointer)->LoadBaskets(); ((TTree*)hPointer)->SetDirectory(0); } - writeCdo->addHisto(i,fname,hPointer); } else { ATH_MSG_ERROR( "#BTAG# Could not cache pointer to histogram " << fname ); } @@ -559,7 +573,7 @@ namespace Analysis { } //end loop mapped alias } //end loop histograms } //end loop tagger - + if(histoWriteHandle.record(rangeW,std::move(writeCdo)).isFailure()) { ATH_MSG_ERROR("#BTAG# Could not record vector of histograms maps " << histoWriteHandle.key() << " with EventRange " << rangeW diff --git a/PhysicsAnalysis/JetTagging/JetTagCalibration/src/JetTagCalibCondData.cxx b/PhysicsAnalysis/JetTagging/JetTagCalibration/src/JetTagCalibCondData.cxx index 13796054ce51be6d6021843356b425a91afca3b4..1b98f19cd84fd9604fcb1837e50d08f06c1e89b3 100644 --- a/PhysicsAnalysis/JetTagging/JetTagCalibration/src/JetTagCalibCondData.cxx +++ b/PhysicsAnalysis/JetTagging/JetTagCalibration/src/JetTagCalibCondData.cxx @@ -44,6 +44,15 @@ void JetTagCalibCondData::addHisto(const unsigned int indexTagger, const std::st m_histos[indexTagger].insert(std::make_pair(name, obj)); } +void JetTagCalibCondData::addDL1NN(const std::string&tagger, const std::string& channel, const lwt::JSONConfig& obj) { + MsgStream log(Athena::getMessageSvc(), "JetTagCalibCondData"); + log << MSG::WARNING << "#BTAG# JSONConfig in cond data with " << obj.layers.size() << " layers" << endmsg; + log << MSG::WARNING << "#BTAG# JSONConfig in cond data for tagger " << tagger << endmsg; + log << MSG::WARNING << "#BTAG# JSONConfig in cond data for channel " << channel << endmsg; + m_DL1_NNConfig[tagger].insert(std::make_pair(channel, obj)); + log << MSG::WARNING << "#BTAG# m_DL1_NNConfig size " << m_DL1_NNConfig.size(); +} + void JetTagCalibCondData::addChannelAlias(const std::string& channel, const std::string& alias) { MsgStream log(Athena::getMessageSvc(), "JetTagCalibCondData"); log << MSG::DEBUG << "#BTAG# addChannelAlias : map size" << m_channelAliasesMap.size() << endmsg; @@ -87,7 +96,28 @@ TH1* JetTagCalibCondData::retrieveHistogram(const std::string& folder, const std return this->retrieveTObject<TH1>(folder,channel,hname); } +lwt::JSONConfig JetTagCalibCondData::retrieveDL1NN(std::string& tagger, const std::string& channel) const { + MsgStream log(Athena::getMessageSvc(), "JetTagCalibCondData"); + lwt::JSONConfig config; + std::map< std::string , std::map<std::string, lwt::JSONConfig>>::const_iterator mI; + mI = m_DL1_NNConfig.find(tagger); + if (mI != m_DL1_NNConfig.end()) { + log << MSG::DEBUG << "#BTAG# " << tagger << " NN config found"<< endmsg; + std::map<std::string, lwt::JSONConfig>::const_iterator mJ = mI->second.find(channel); + if (mJ != mI->second.end()) { + log << MSG::DEBUG << "#BTAG# "<< tagger << " NN config found for jet collection " << channel << endmsg; + config = mJ->second; + } + else { + log << MSG::DEBUG << "#BTAG# "<< tagger << " NN config not found for jet collection " << channel << endmsg; + } + } + else { + log << MSG::DEBUG << "#BTAG# " << tagger << " NN config not found"<< endmsg; + } + return config; +} std::vector<std::string> JetTagCalibCondData::tokenize(std::string str, std::string delim){ std::vector<std::string> tokens; diff --git a/PhysicsAnalysis/JetTagging/JetTagTools/src/LightweightNeuralNetwork.cxx b/PhysicsAnalysis/JetTagging/JetTagCalibration/src/LightweightNeuralNetwork.cxx similarity index 96% rename from PhysicsAnalysis/JetTagging/JetTagTools/src/LightweightNeuralNetwork.cxx rename to PhysicsAnalysis/JetTagging/JetTagCalibration/src/LightweightNeuralNetwork.cxx index 9fe83d0e318e366b33a8ea73f47de147944964cc..26fe157a9f2d1ee4ed506d7f8f39c4cc2d1d15a4 100644 --- a/PhysicsAnalysis/JetTagging/JetTagTools/src/LightweightNeuralNetwork.cxx +++ b/PhysicsAnalysis/JetTagging/JetTagCalibration/src/LightweightNeuralNetwork.cxx @@ -6,10 +6,10 @@ // https://github.com/lwtnn/lwtnn.git (rev v2.0) // Please don't edit it! To get the latest version, run // > ./update-lwtnn.sh -// from JetTagTools/share +// from JetTagCalibration/share -#include "JetTagTools/LightweightNeuralNetwork.h" -#include "JetTagTools/Stack.h" +#include "JetTagCalibration/LightweightNeuralNetwork.h" +#include "JetTagCalibration/Stack.h" #include <Eigen/Dense> #include <set> diff --git a/PhysicsAnalysis/JetTagging/JetTagTools/src/Stack.cxx b/PhysicsAnalysis/JetTagging/JetTagCalibration/src/Stack.cxx similarity index 99% rename from PhysicsAnalysis/JetTagging/JetTagTools/src/Stack.cxx rename to PhysicsAnalysis/JetTagging/JetTagCalibration/src/Stack.cxx index a0b075f7775d403bea867698fcbc82675a2f0664..1c9df7895341ed0f7d12a65e28c44ea2c3ede8ad 100644 --- a/PhysicsAnalysis/JetTagging/JetTagTools/src/Stack.cxx +++ b/PhysicsAnalysis/JetTagging/JetTagCalibration/src/Stack.cxx @@ -6,9 +6,9 @@ // https://github.com/lwtnn/lwtnn.git (rev v2.0) // Please don't edit it! To get the latest version, run // > ./update-lwtnn.sh -// from JetTagTools/share +// from JetTagCalibration/share -#include "JetTagTools/Stack.h" +#include "JetTagCalibration/Stack.h" #include <Eigen/Dense> #include <set> diff --git a/PhysicsAnalysis/JetTagging/JetTagTools/src/parse_json.cxx b/PhysicsAnalysis/JetTagging/JetTagCalibration/src/parse_json.cxx similarity index 98% rename from PhysicsAnalysis/JetTagging/JetTagTools/src/parse_json.cxx rename to PhysicsAnalysis/JetTagging/JetTagCalibration/src/parse_json.cxx index 38ca7c2f1d4d1eb90bfb8f4d63a4c63e101815b1..b06024a88d86bd10f4a74b1b9bb9a9dd3d8c27d4 100644 --- a/PhysicsAnalysis/JetTagging/JetTagTools/src/parse_json.cxx +++ b/PhysicsAnalysis/JetTagging/JetTagCalibration/src/parse_json.cxx @@ -6,9 +6,9 @@ // https://github.com/lwtnn/lwtnn.git (rev v2.0) // Please don't edit it! To get the latest version, run // > ./update-lwtnn.sh -// from JetTagTools/share +// from JetTagCalibration/share -#include "JetTagTools/parse_json.h" +#include "JetTagCalibration/parse_json.h" #include <boost/property_tree/ptree.hpp> #include <boost/property_tree/json_parser.hpp> diff --git a/PhysicsAnalysis/JetTagging/JetTagMonitoring/share/JetTagMonitoring_jobOptions.py b/PhysicsAnalysis/JetTagging/JetTagMonitoring/share/JetTagMonitoring_jobOptions.py index d48827ad4c22094c7c06ede020b0ecde347d82e7..d347130fd81b5798a9a108e87d89d8425349308a 100644 --- a/PhysicsAnalysis/JetTagging/JetTagMonitoring/share/JetTagMonitoring_jobOptions.py +++ b/PhysicsAnalysis/JetTagging/JetTagMonitoring/share/JetTagMonitoring_jobOptions.py @@ -4,7 +4,6 @@ monManJetTag = AthenaMonManager(name="JetTagMonManager", Environment = DQMonFlags.monManEnvironment(), ManualDataTypeSetup = DQMonFlags.monManManualDataTypeSetup(), DataType = DQMonFlags.monManDataType()) -topSequence += monManJetTag from JetTagTools.JetTagToolsConf import Analysis__TrackSelector trackSelectorTool = Analysis__TrackSelector ( @@ -18,9 +17,6 @@ from JetTagMonitoring.JetTagMonitoringConf import JetTagMonitoring jetTagMonTool = JetTagMonitoring ( name = "jetTagMonTool", ) -ToolSvc += jetTagMonTool -monManJetTag.AthenaMonTools += [ jetTagMonTool ] - # remove events with non-collision BCIDs from your monitoring tools # see https://indico.cern.ch/getFile.py/access?contribId=1&resId=1&materialId=slides&confId=135968 jetTagMonTool.FilterTools += [ monFilledBunchFilterTool ] @@ -81,3 +77,6 @@ jetTagMonTool.ElectronTrigger_2017 = "HLT_e28_lhtight_nod0_ivarloose"; # added b jetTagMonTool.MuonTrigger_2017 = "HLT_mu26_ivarmedium"; # added by SARA jetTagMonTool.JetTrigger_2017 = "HLT_j15"; # added by SARA +#ToolSvc += jetTagMonTool +monManJetTag.AthenaMonTools += [ jetTagMonTool ] +topSequence += monManJetTag diff --git a/PhysicsAnalysis/JetTagging/JetTagTools/CMakeLists.txt b/PhysicsAnalysis/JetTagging/JetTagTools/CMakeLists.txt index f086b09fc83db7a58ca6d9ecdc1d4386821f8809..c3894aa56ca51e50349aef11ec39ceee938a7436 100644 --- a/PhysicsAnalysis/JetTagging/JetTagTools/CMakeLists.txt +++ b/PhysicsAnalysis/JetTagging/JetTagTools/CMakeLists.txt @@ -57,7 +57,7 @@ atlas_depends_on_subdirs( # External dependencies: find_package( Boost COMPONENTS filesystem thread system ) find_package( CLHEP ) -find_package( Eigen ) +#find_package( Eigen ) find_package( FastJet ) find_package( ROOT COMPONENTS TMVA Core Tree MathCore Hist RIO pthread MathMore Minuit Minuit2 Matrix Physics HistPainter Rint RooFitCore RooFit ) @@ -83,15 +83,14 @@ atlas_add_library( JetTagToolsLib src/JetFitterVariablesFactory.cxx src/MSVVariablesFactory.cxx src/MultiSVTag.cxx src/JetVertexCharge.cxx src/SoftMuonTag.cxx src/ExKtbbTag.cxx src/ExKtbbTagTool.cxx src/MultivariateTagManager.cxx - src/DL1Tag.cxx src/LightweightNeuralNetwork.cxx src/TagNtupleDumper.cxx - src/parse_json.cxx src/Stack.cxx src/RNNIPTag.cxx + src/DL1Tag.cxx src/TagNtupleDumper.cxx src/RNNIPTag.cxx PUBLIC_HEADERS JetTagTools - INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} ${CLHEP_INCLUDE_DIRS} ${EIGEN_INCLUDE_DIRS} + INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} ${CLHEP_INCLUDE_DIRS} PRIVATE_INCLUDE_DIRS ${Boost_INCLUDE_DIRS} ${FASTJET_INCLUDE_DIRS} DEFINITIONS ${CLHEP_DEFINITIONS} - LINK_LIBRARIES ${ROOT_LIBRARIES} ${CLHEP_LIBRARIES} ${EIGEN_LIBRARIES} + LINK_LIBRARIES ${ROOT_LIBRARIES} ${CLHEP_LIBRARIES} AsgTools AthenaBaseComps SGTools GeoPrimitives xAODBTagging xAODJet xAODTracking GaudiKernel JetTagInfo JetSubStructureUtils TrkParameters JetRecLib JetSubStructureMomentToolsLib egammaMVACalibLib MVAUtils diff --git a/PhysicsAnalysis/JetTagging/JetTagTools/JetTagTools/DL1Tag.h b/PhysicsAnalysis/JetTagging/JetTagTools/JetTagTools/DL1Tag.h index 91087e38acf1f09a3db521081a0c2140f37d2091..c26953c81bf04180104db5a9afcf8267900ce271 100644 --- a/PhysicsAnalysis/JetTagging/JetTagTools/JetTagTools/DL1Tag.h +++ b/PhysicsAnalysis/JetTagging/JetTagTools/JetTagTools/DL1Tag.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration */ #ifndef BTAGTOOLS_DL1TAG_C @@ -15,7 +15,6 @@ @authors Dan Guest, Luke de Oliveira, Marie Lanfermann ********************************************************/ #include "AthenaBaseComps/AthAlgTool.h" -#include "JetTagTools/NNLayerConfig.h" #include "JetTagTools/IMultivariateJetTagger.h" #include "JetTagCalibration/JetTagCalibCondData.h" @@ -56,8 +55,7 @@ namespace Analysis { /** Key of calibration data: */ SG::ReadCondHandleKey<JetTagCalibCondData> m_readKey{this, "HistosKey", "JetTagCalibHistosKey", "Key of input (derived) JetTag calibration data"}; - void cache_calibration(const std::string& jetauthor); - std::string get_calib_string(std::string jetauthor); + void load_calibration(const std::string& jetauthor); void build_nn(const std::string& jetauthor, std::istream& nn_config_istream); void fill_outputs(xAOD::BTagging* BTag, var_map outputs); diff --git a/PhysicsAnalysis/JetTagging/JetTagTools/src/DL1Tag.cxx b/PhysicsAnalysis/JetTagging/JetTagTools/src/DL1Tag.cxx index e2073d9b0db9fbcf8b14f3e44b9fbd0524fd5dfe..25624c1c8b6a00b5f29c1f74d02da20ee22bfc6f 100644 --- a/PhysicsAnalysis/JetTagging/JetTagTools/src/DL1Tag.cxx +++ b/PhysicsAnalysis/JetTagging/JetTagTools/src/DL1Tag.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration */ ////////////////////////////////////////////////////////////////////////////// @@ -21,9 +21,6 @@ #include "xAODTracking/TrackParticle.h" #include "JetTagTools/DL1Tag.h" -#include "JetTagTools/LightweightNeuralNetwork.h" -#include "JetTagTools/parse_json.h" -#include "JetTagTools/Exceptions.h" #include "xAODBTagging/BTagging.h" #include "xAODJet/Jet.h" @@ -106,7 +103,7 @@ namespace Analysis { } lwt::JSONConfig nn_config = lwt::parse_json(nn_config_istream); - ATH_MSG_DEBUG("making NN with " << nn_config.layers.size() << " layers"); + ATH_MSG_DEBUG("#BTAG# making NN with " << nn_config.layers.size() << " layers"); if (!(std::find((nn_config.outputs).begin(), (nn_config.outputs).end(), "bottom") != (nn_config.outputs).end())) { ATH_MSG_WARNING( "#BTAG# b-tagger without b-tagging option 'bottom' - please check the NN output naming convention."); @@ -117,43 +114,33 @@ namespace Analysis { m_map_defaults.insert(std::make_pair(jetauthor, nn_config.defaults)); } + void DL1Tag::load_calibration(const std::string& jetauthor) { + SG::ReadCondHandle<JetTagCalibCondData> readCdo(m_readKey); + lwt::JSONConfig nn_config = readCdo->retrieveDL1NN(m_calibrationDirectory , jetauthor); - void DL1Tag::cache_calibration(const std::string& jetauthor) { - - // check if this network is alread cached, so do nothing - //if (m_NeuralNetworks.count(jetauthor) == 1) { - // return; - //} - // get the NN configuration - std::string calib = get_calib_string(jetauthor); - ATH_MSG_DEBUG("Reading NN for " + jetauthor + ": " - << calib.size() << " characters"); - - // Read in the configuration of the neural net for DL1 and build net: - std::istringstream nn_config_sstream(calib); - build_nn(jetauthor, nn_config_sstream); - } - - std::string DL1Tag::get_calib_string(std::string jetauthor) { - std::string file_name = "net_configuration"; + if (nn_config.layers.size() == 0){ //catch if no NN config was found + std::string fuller_name = m_calibrationDirectory + "/" + + jetauthor + "/net_configuration"; + throw std::logic_error("Cannot retrieve NN config build from string: " + fuller_name); + } - SG::ReadCondHandle<JetTagCalibCondData> readCdo(m_readKey); - TObjString * cal_string = readCdo->retrieveTObject<TObjString>(m_calibrationDirectory, jetauthor, file_name); + ATH_MSG_DEBUG("#BTAG# making NN with " << nn_config.layers.size() << " layers"); - if (cal_string == 0){ //catch if no string was found - std::string fuller_name = m_calibrationDirectory + "/" + - jetauthor + "/net_configuration"; - throw std::logic_error("Cannot retrieve string: " + fuller_name); + if (!(std::find((nn_config.outputs).begin(), (nn_config.outputs).end(), "bottom") != (nn_config.outputs).end())) { + ATH_MSG_WARNING( "#BTAG# b-tagger without b-tagging option 'bottom' - please check the NN output naming convention."); } - std::string calibration(cal_string->GetString().Data()); - return calibration; - } + m_NeuralNetworks.insert(std::make_pair(jetauthor, new lwt::LightweightNeuralNetwork(nn_config.inputs, nn_config.layers, nn_config.outputs))); + m_map_variables.insert(std::make_pair(jetauthor, nn_config.inputs)); + m_map_defaults.insert(std::make_pair(jetauthor, nn_config.defaults)); + + } StatusCode DL1Tag::finalize() { // all taken care of in destructor if (m_n_compute_errors > 0) { ATH_MSG_WARNING("Neural network was unable to compute. Number of errors: "+ std::to_string(m_n_compute_errors)); } + ATH_MSG_INFO(" #BTAG# Finalization of DL1Tag successfull" ); return StatusCode::SUCCESS; } @@ -205,7 +192,7 @@ namespace Analysis { " No likelihood value given back. "); } try { - cache_calibration(jetauthor); + load_calibration(jetauthor); } catch (std::exception& e) { ATH_MSG_WARNING( "problem loading calibration for " + jetauthor + diff --git a/PhysicsAnalysis/JetTagging/JetTagTools/src/RNNIPTag.cxx b/PhysicsAnalysis/JetTagging/JetTagTools/src/RNNIPTag.cxx index fcd00ce6d2e420c297aa2e07f9ee5e3e22d8602c..8032c1d481bcdf70840636ab260decb35eb07a01 100644 --- a/PhysicsAnalysis/JetTagging/JetTagTools/src/RNNIPTag.cxx +++ b/PhysicsAnalysis/JetTagging/JetTagTools/src/RNNIPTag.cxx @@ -1,11 +1,11 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration */ #include "JetTagTools/RNNIPTag.h" -#include "JetTagTools/LightweightNeuralNetwork.h" -#include "JetTagTools/parse_json.h" -#include "JetTagTools/Exceptions.h" +#include "JetTagCalibration/LightweightNeuralNetwork.h" +#include "JetTagCalibration/parse_json.h" +#include "JetTagCalibration/Exceptions.h" #include "JetTagTools/TrackSelector.h" #include "JetTagTools/GradedTrack.h" diff --git a/Projects/AnalysisBase/build.sh b/Projects/AnalysisBase/build.sh index efcbd1a90f2e6e28b7a4f6d17eb2a0fe15455275..f84b66c19b136c9341d55fb1b8574d95e2439cbf 100755 --- a/Projects/AnalysisBase/build.sh +++ b/Projects/AnalysisBase/build.sh @@ -4,6 +4,8 @@ # script in this directory. # +_time_="/usr/bin/time -f time::\t%C::\treal:\t%E\tuser:\t%U\tsys:\t%S\n " + # Function printing the usage information for the script usage() { echo "Usage: build.sh [-t type] [-b dir] [-g generator] [-c] [-m] [-i] [-p] [-a]" @@ -118,7 +120,7 @@ if [ -n "$EXE_CMAKE" ]; then fi # Now run the actual CMake configuration: - time cmake -G "${GENERATOR}" \ + $_time_ cmake -G "${GENERATOR}" \ -DCMAKE_BUILD_TYPE:STRING=${BUILDTYPE} \ ${USE_LAUNCHERS} \ ${AnalysisBaseSrcDir} 2>&1 | tee cmake_config.log @@ -136,26 +138,26 @@ if [ -n "$EXE_MAKE" ]; then # In order to build the project in a nightly setup, allowing for some # build steps to fail while still continuing, we need to use "make" # directly. Only allowing the usage of the Makefile generator. - time make -k 2>&1 | tee cmake_build.log + $_time_ make -k 2>&1 | tee cmake_build.log else # However in a non-nightly setup we can just rely on CMake to start # the build for us. In this case we can use any generator we'd like # for the build. Notice however that the installation step can still # be only done correctly by using GNU Make directly. - time cmake --build . 2>&1 | tee cmake_build.log + $_time_ cmake --build . 2>&1 | tee cmake_build.log fi fi # Install the results: if [ -n "$EXE_INSTALL" ]; then - time make install/fast \ + $_time_ make install/fast \ DESTDIR=${BUILDDIR}/install/AnalysisBase/${NICOS_PROJECT_VERSION} \ 2>&1 | tee cmake_install.log fi # Build an RPM for the release: if [ -n "$EXE_CPACK" ]; then - time cpack 2>&1 | tee cmake_cpack.log + $_time_ cpack 2>&1 | tee cmake_cpack.log FILES=$(ls AnalysisBase*.rpm AnalysisBase*.dmg AnalysisBase*.tar.gz) cp ${FILES} ${BUILDDIR}/ fi diff --git a/Projects/AnalysisTop/build.sh b/Projects/AnalysisTop/build.sh index 30b07b4a7a2e73ec0a3dc24c5015e3f6bb1091e4..f4d82b2e8bf92b560733ccd6fb7915b0f6508226 100755 --- a/Projects/AnalysisTop/build.sh +++ b/Projects/AnalysisTop/build.sh @@ -4,6 +4,8 @@ # script in this directory. # +_time_="/usr/bin/time -f time::\t%C::\treal:\t%E\tuser:\t%U\tsys:\t%S\n " + # Function printing the usage information for the script usage() { echo "Usage: build.sh [-t type] [-b dir] [-g generator] [-c] [-m] [-i] [-p] [-a]" @@ -116,7 +118,7 @@ if [ -n "$EXE_CMAKE" ]; then fi # Now run the actual CMake configuration: - time cmake -G "${GENERATOR}" \ + $_time_ cmake -G "${GENERATOR}" \ -DCMAKE_BUILD_TYPE:STRING=${BUILDTYPE} \ ${USE_LAUNCHERS} \ ${AnalysisTopSrcDir} 2>&1 | tee cmake_config.log @@ -134,26 +136,26 @@ if [ -n "$EXE_MAKE" ]; then # In order to build the project in a nightly setup, allowing for some # build steps to fail while still continuing, we need to use "make" # directly. Only allowing the usage of the Makefile generator. - time make -k 2>&1 | tee cmake_build.log + $_time_ make -k 2>&1 | tee cmake_build.log else # However in a non-nightly setup we can just rely on CMake to start # the build for us. In this case we can use any generator we'd like # for the build. Notice however that the installation step can still # be only done correctly by using GNU Make directly. - time cmake --build . 2>&1 | tee cmake_build.log + $_time_ cmake --build . 2>&1 | tee cmake_build.log fi fi # Install the results: if [ -n "$EXE_INSTALL" ]; then - time make install/fast \ + $_time_ make install/fast \ DESTDIR=${BUILDDIR}/install/AnalysisTop/${NICOS_PROJECT_VERSION} \ 2>&1 | tee cmake_install.log fi # Build an RPM for the release: if [ -n "$EXE_CPACK" ]; then - time cpack 2>&1 | tee cmake_cpack.log + $_time_ cpack 2>&1 | tee cmake_cpack.log FILES=$(ls AnalysisTop*.rpm AnalysisTop*.dmg AnalysisTop*.tar.gz) cp ${FILES} ${BUILDDIR}/ fi diff --git a/Projects/AthDataQuality/build.sh b/Projects/AthDataQuality/build.sh index b237408e895926c93384dbe2560cef2f1354cf5b..59138dcad468c1eb1d0cdf26c518b60fc3562391 100755 --- a/Projects/AthDataQuality/build.sh +++ b/Projects/AthDataQuality/build.sh @@ -4,6 +4,8 @@ # scripts in this directory. # +_time_="/usr/bin/time -f time::\t%C::\treal:\t%E\tuser:\t%U\tsys:\t%S\n " + # Function printing the usage information for the script usage() { echo "Usage: build.sh [-t build type] [-b build dir] [-c] [-m] [-i] [-p] [-a] [-x] [-N]" @@ -110,7 +112,7 @@ if [ -n "$EXE_CMAKE" ]; then # from scratch in an incremental build. rm -f CMakeCache.txt # Now run the actual CMake configuration: - { time cmake ${BUILDTOOLTYPE} -DCMAKE_BUILD_TYPE:STRING=${BUILDTYPE} \ + { $_time_ cmake ${BUILDTOOLTYPE} -DCMAKE_BUILD_TYPE:STRING=${BUILDTYPE} \ ${EXTRACMAKE} \ -DCTEST_USE_LAUNCHERS:BOOL=TRUE \ ${AthDataQualitySrcDir}; } 2>&1 | tee cmake_config.log @@ -130,17 +132,17 @@ if [ -n "$EXE_MAKE" ]; then # the build_env.sh script. rm -f ${platform}/share/clid.db # Build the project. - { time ${BUILDTOOL}; } 2>&1 | tee cmake_build.log + { $_time_ ${BUILDTOOL}; } 2>&1 | tee cmake_build.log fi # Install the results: if [ -n "$EXE_INSTALL" ]; then - { time DESTDIR=${BUILDDIR}/install/AthDataQuality/${NICOS_PROJECT_VERSION} ${BUILDTOOL} ${INSTALLRULE}; } \ + { $_time_ DESTDIR=${BUILDDIR}/install/AthDataQuality/${NICOS_PROJECT_VERSION} ${BUILDTOOL} ${INSTALLRULE}; } \ 2>&1 | tee cmake_install.log fi # Build an RPM for the release: if [ -n "$EXE_CPACK" ]; then - time cpack 2>&1 | tee cmake_cpack.log + $_time_ cpack 2>&1 | tee cmake_cpack.log cp AthDataQuality*.rpm ${BUILDDIR}/ fi diff --git a/Projects/AthSimulation/build.sh b/Projects/AthSimulation/build.sh index 651433bbb7c0ff0a7fbea1a36521d84579c0b33f..06e572f31d1fdf4721552cdc4d8640e1fee8cf97 100755 --- a/Projects/AthSimulation/build.sh +++ b/Projects/AthSimulation/build.sh @@ -4,6 +4,8 @@ # scripts in this directory. # +_time_="/usr/bin/time -f time::\t%C::\treal:\t%E\tuser:\t%U\tsys:\t%S\n " + # Function printing the usage information for the script usage() { echo "Usage: build.sh [-t build type] [-b build dir] [-c] [-m] [-i] [-p] [-a] [-x] [-N]" @@ -112,7 +114,7 @@ if [ -n "$EXE_CMAKE" ]; then # from scratch in an incremental build. rm -f CMakeCache.txt # Now run the actual CMake configuration: - { time cmake ${BUILDTOOLTYPE} -DCMAKE_BUILD_TYPE:STRING=${BUILDTYPE} \ + { $_time_ cmake ${BUILDTOOLTYPE} -DCMAKE_BUILD_TYPE:STRING=${BUILDTYPE} \ ${EXTRACMAKE} \ -DCTEST_USE_LAUNCHERS:BOOL=TRUE \ ${AthSimulationSrcDir}; } 2>&1 | tee cmake_config.log @@ -132,17 +134,17 @@ if [ -n "$EXE_MAKE" ]; then # the build_env.sh script. rm -f ${platform}/share/clid.db # Build the project. - { time ${BUILDTOOL}; } 2>&1 | tee cmake_build.log + { $_time_ ${BUILDTOOL}; } 2>&1 | tee cmake_build.log fi # Install the results: if [ -n "$EXE_INSTALL" ]; then - { time DESTDIR=${BUILDDIR}/install/AthSimulation/${NICOS_PROJECT_VERSION} ${BUILDTOOL} ${INSTALLRULE}; } \ + { $_time_ DESTDIR=${BUILDDIR}/install/AthSimulation/${NICOS_PROJECT_VERSION} ${BUILDTOOL} ${INSTALLRULE}; } \ 2>&1 | tee cmake_install.log fi # Build an RPM for the release: if [ -n "$EXE_CPACK" ]; then - { time cpack; } 2>&1 | tee cmake_cpack.log + { $_time_ cpack; } 2>&1 | tee cmake_cpack.log cp AthSimulation*.rpm ${BUILDDIR}/ fi diff --git a/Projects/AthSimulation/externals.txt b/Projects/AthSimulation/externals.txt index 59f53ae1460e1df5dc22a990af1d603f1dc29f0e..29fc225a8ae2d7f2513ba4175934d08d2dba2e54 100644 --- a/Projects/AthSimulation/externals.txt +++ b/Projects/AthSimulation/externals.txt @@ -9,4 +9,4 @@ AthSimulationExternalsVersion = 2.0.13 # The version of atlas/Gaudi to use: -GaudiVersion = v30r3.004 +GaudiVersion = v30r3.007 diff --git a/Projects/AthSimulation/package_filters.txt b/Projects/AthSimulation/package_filters.txt index efb38d6a229cb9f38262153985b10e6189287f0c..b3b5eaae3184ce761caf1fca986186cd693fa52d 100644 --- a/Projects/AthSimulation/package_filters.txt +++ b/Projects/AthSimulation/package_filters.txt @@ -27,6 +27,7 @@ + Control/AthLinks + Control/AthToolSupport/AsgTools + Control/AthenaBaseComps ++ Control/AthenaConfiguration + Control/AthenaCommon + Control/AthenaExamples/AthExHelloWorld + Control/AthenaInterprocess diff --git a/Projects/Athena/build.sh b/Projects/Athena/build.sh index 761858914d0e9fd095be09e5c817655dee652b10..a81d8fab8d594a97a444013a0725ef8e7339ac9a 100755 --- a/Projects/Athena/build.sh +++ b/Projects/Athena/build.sh @@ -4,6 +4,8 @@ # scripts in this directory. # +_time_="/usr/bin/time -f time::\t%C::\treal:\t%E\tuser:\t%U\tsys:\t%S\n " + # Function printing the usage information for the script usage() { echo "Usage: build.sh [-t build type] [-b build dir] [-c] [-m] [-i] [-p] [-a] [-x] [-N]" @@ -127,7 +129,7 @@ if [ -n "$EXE_CMAKE" ]; then # from scratch in an incremental build. rm -f CMakeCache.txt # Now run the actual CMake configuration: - { time cmake ${BUILDTOOLTYPE} -DCMAKE_BUILD_TYPE:STRING=${BUILDTYPE} \ + { ${_time_} cmake ${BUILDTOOLTYPE} -DCMAKE_BUILD_TYPE:STRING=${BUILDTYPE} \ ${EXTRACMAKE} \ -DCTEST_USE_LAUNCHERS:BOOL=TRUE \ ${AthenaSrcDir}; } 2>&1 | tee cmake_config.log @@ -162,7 +164,7 @@ if [ -n "$EXE_MAKE" ]; then # the build_env.sh script. rm -f ${platform}/share/clid.db # Build the project. - { time ${BUILDTOOL}; } 2>&1 | tee cmake_build.log + { ${_time_} ${BUILDTOOL}; } 2>&1 | tee cmake_build.log fi { @@ -175,16 +177,16 @@ fi # Install the results: if [ -n "$EXE_INSTALL" ]; then - { time DESTDIR=${BUILDDIR}/install/Athena/${NICOS_PROJECT_VERSION} ${BUILDTOOL} ${INSTALLRULE}; } \ + { ${_time_} DESTDIR=${BUILDDIR}/install/Athena/${NICOS_PROJECT_VERSION} ${BUILDTOOL} ${INSTALLRULE}; } \ 2>&1 | tee cmake_install.log fi #^^^ do we need to analyze local install logs? # Build an RPM for the release: if [ -n "$EXE_CPACK" ]; then - { time cpack; } 2>&1 | tee cmake_cpack.log + { ${_time_} cpack; } 2>&1 | tee cmake_cpack.log if [ "$BUILDTYPE" = "RelWithDebInfo" ]; then - { time cpack --config CPackDbgRPMConfig.cmake; } 2>&1 | tee -a cmake_cpack.log + { ${_time_} cpack --config CPackDbgRPMConfig.cmake; } 2>&1 | tee -a cmake_cpack.log fi cp Athena*.rpm ${BUILDDIR}/ fi diff --git a/Projects/Athena/externals.txt b/Projects/Athena/externals.txt index b83ae955ccb9f40bb2227811284cd7daa2cad39d..1b01071d37cb430ce635d32578f24d95f7cd7fff 100644 --- a/Projects/Athena/externals.txt +++ b/Projects/Athena/externals.txt @@ -9,4 +9,4 @@ AthenaExternalsVersion = 2.0.13 # The version of atlas/Gaudi to use: -GaudiVersion = v30r3.004 +GaudiVersion = v30r3.007 diff --git a/Reconstruction/HeavyIonRec/HIMonitoring/HIMonitoring/HIMonitoringElectronsTool.h b/Reconstruction/HeavyIonRec/HIMonitoring/HIMonitoring/HIMonitoringElectronsTool.h index 10588b5bc7bf44acea4a6f7d30a62b1942784623..198db60264007750fb8593b3f0dc732ba36e4b14 100755 --- a/Reconstruction/HeavyIonRec/HIMonitoring/HIMonitoring/HIMonitoringElectronsTool.h +++ b/Reconstruction/HeavyIonRec/HIMonitoring/HIMonitoring/HIMonitoringElectronsTool.h @@ -5,24 +5,12 @@ #ifndef HIMONITORINGELECTRONSTOOL_H #define HIMONITORINGELECTRONSTOOL_H -#include <vector> -#include <string> #include "AthenaMonitoring/ManagedMonitorToolBase.h" -#include "TRandom3.h" - -#include <xAODHIEvent/HIEventShape.h> -#include <xAODHIEvent/HIEventShapeContainer.h> - -#include <xAODEgamma/Electron.h> -#include <xAODEgamma/ElectronContainer.h> - -#include "ElectronPhotonSelectorTools/AsgElectronLikelihoodTool.h" - class TH1D; class TH2D_LW; -class TProfile_LW; +class AsgElectronLikelihoodTool; class HIMonitoringElectronsTool : public ManagedMonitorToolBase { @@ -43,173 +31,173 @@ class HIMonitoringElectronsTool : public ManagedMonitorToolBase private: - - AsgElectronLikelihoodTool* m_electronLooseLHTool; - AsgElectronLikelihoodTool* m_electronMediumLHTool; - AsgElectronLikelihoodTool* m_electronTightLHTool; + + AsgElectronLikelihoodTool* m_electronLooseLHTool{}; + AsgElectronLikelihoodTool* m_electronMediumLHTool{}; + AsgElectronLikelihoodTool* m_electronTightLHTool{}; - double m_FCalEt; - double m_FCalEt_A; - double m_FCalEt_C; + double m_FCalEt{}; + double m_FCalEt_A{}; + double m_FCalEt_C{}; /// histograms - TH1D* m_h_FCalEt_looseLH; - TH1D* m_h_FCalEt_mediumLH; - TH1D* m_h_FCalEt_tightLH; - - TH1D* m_h_FCalEt_A_looseLH; - TH1D* m_h_FCalEt_A_mediumLH; - TH1D* m_h_FCalEt_A_tightLH; - - TH1D* m_h_FCalEt_C_looseLH; - TH1D* m_h_FCalEt_C_mediumLH; - TH1D* m_h_FCalEt_C_tightLH; - - TH2D_LW* m_h_electron_eta_phi; - TH1D* m_h_electron_z0sintheta; - - //etcone20 - TH2D_LW* m_h_electron_fcal_etcone20_looseLH; - TH2D_LW* m_h_electron_fcal_etcone20_mediumLH; - TH2D_LW* m_h_electron_fcal_etcone20_tightLH; - - TH2D_LW* m_h_electron_fcalA_etcone20_looseLH; - TH2D_LW* m_h_electron_fcalA_etcone20_mediumLH; - TH2D_LW* m_h_electron_fcalA_etcone20_tightLH; - - TH2D_LW* m_h_electron_fcalC_etcone20_looseLH; - TH2D_LW* m_h_electron_fcalC_etcone20_mediumLH; - TH2D_LW* m_h_electron_fcalC_etcone20_tightLH; - - //R_eta - TH2D_LW* m_h_electron_fcal_reta_looseLH; - TH2D_LW* m_h_electron_fcal_reta_mediumLH; - TH2D_LW* m_h_electron_fcal_reta_tightLH; - - TH2D_LW* m_h_electron_fcalA_reta_looseLH; - TH2D_LW* m_h_electron_fcalA_reta_mediumLH; - TH2D_LW* m_h_electron_fcalA_reta_tightLH; - - TH2D_LW* m_h_electron_fcalC_reta_looseLH; - TH2D_LW* m_h_electron_fcalC_reta_mediumLH; - TH2D_LW* m_h_electron_fcalC_reta_tightLH; - - //R_phi - TH2D_LW* m_h_electron_fcal_rphi_looseLH; - TH2D_LW* m_h_electron_fcal_rphi_mediumLH; - TH2D_LW* m_h_electron_fcal_rphi_tightLH; - - TH2D_LW* m_h_electron_fcalA_rphi_looseLH; - TH2D_LW* m_h_electron_fcalA_rphi_mediumLH; - TH2D_LW* m_h_electron_fcalA_rphi_tightLH; - - TH2D_LW* m_h_electron_fcalC_rphi_looseLH; - TH2D_LW* m_h_electron_fcalC_rphi_mediumLH; - TH2D_LW* m_h_electron_fcalC_rphi_tightLH; - - //W_eta2 - TH2D_LW* m_h_electron_fcal_weta2_looseLH; - TH2D_LW* m_h_electron_fcal_weta2_mediumLH; - TH2D_LW* m_h_electron_fcal_weta2_tightLH; - - TH2D_LW* m_h_electron_fcalA_weta2_looseLH; - TH2D_LW* m_h_electron_fcalA_weta2_mediumLH; - TH2D_LW* m_h_electron_fcalA_weta2_tightLH; - - TH2D_LW* m_h_electron_fcalC_weta2_looseLH; - TH2D_LW* m_h_electron_fcalC_weta2_mediumLH; - TH2D_LW* m_h_electron_fcalC_weta2_tightLH; - - //R_had - TH2D_LW* m_h_electron_fcal_rhad_looseLH; - TH2D_LW* m_h_electron_fcal_rhad_mediumLH; - TH2D_LW* m_h_electron_fcal_rhad_tightLH; - - TH2D_LW* m_h_electron_fcalA_rhad_looseLH; - TH2D_LW* m_h_electron_fcalA_rhad_mediumLH; - TH2D_LW* m_h_electron_fcalA_rhad_tightLH; - - TH2D_LW* m_h_electron_fcalC_rhad_looseLH; - TH2D_LW* m_h_electron_fcalC_rhad_mediumLH; - TH2D_LW* m_h_electron_fcalC_rhad_tightLH; - - //E_ratio - TH2D_LW* m_h_electron_fcal_eratio_looseLH; - TH2D_LW* m_h_electron_fcal_eratio_mediumLH; - TH2D_LW* m_h_electron_fcal_eratio_tightLH; - - TH2D_LW* m_h_electron_fcalA_eratio_looseLH; - TH2D_LW* m_h_electron_fcalA_eratio_mediumLH; - TH2D_LW* m_h_electron_fcalA_eratio_tightLH; - - TH2D_LW* m_h_electron_fcalC_eratio_looseLH; - TH2D_LW* m_h_electron_fcalC_eratio_mediumLH; - TH2D_LW* m_h_electron_fcalC_eratio_tightLH; - - //f_1 - TH2D_LW* m_h_electron_fcal_f1_looseLH; - TH2D_LW* m_h_electron_fcal_f1_mediumLH; - TH2D_LW* m_h_electron_fcal_f1_tightLH; - - TH2D_LW* m_h_electron_fcalA_f1_looseLH; - TH2D_LW* m_h_electron_fcalA_f1_mediumLH; - TH2D_LW* m_h_electron_fcalA_f1_tightLH; - - TH2D_LW* m_h_electron_fcalC_f1_looseLH; - TH2D_LW* m_h_electron_fcalC_f1_mediumLH; - TH2D_LW* m_h_electron_fcalC_f1_tightLH; - - //f_3 - TH2D_LW* m_h_electron_fcal_f3_looseLH; - TH2D_LW* m_h_electron_fcal_f3_mediumLH; - TH2D_LW* m_h_electron_fcal_f3_tightLH; - - TH2D_LW* m_h_electron_fcalA_f3_looseLH; - TH2D_LW* m_h_electron_fcalA_f3_mediumLH; - TH2D_LW* m_h_electron_fcalA_f3_tightLH; - - TH2D_LW* m_h_electron_fcalC_f3_looseLH; - TH2D_LW* m_h_electron_fcalC_f3_mediumLH; - TH2D_LW* m_h_electron_fcalC_f3_tightLH; - - //delta_eta1 - TH2D_LW* m_h_electron_fcal_deltaeta1_looseLH; - TH2D_LW* m_h_electron_fcal_deltaeta1_mediumLH; - TH2D_LW* m_h_electron_fcal_deltaeta1_tightLH; - - TH2D_LW* m_h_electron_fcalA_deltaeta1_looseLH; - TH2D_LW* m_h_electron_fcalA_deltaeta1_mediumLH; - TH2D_LW* m_h_electron_fcalA_deltaeta1_tightLH; - - TH2D_LW* m_h_electron_fcalC_deltaeta1_looseLH; - TH2D_LW* m_h_electron_fcalC_deltaeta1_mediumLH; - TH2D_LW* m_h_electron_fcalC_deltaeta1_tightLH; - - //delta_phi_rescaled - TH2D_LW* m_h_electron_fcal_deltaphires_looseLH; - TH2D_LW* m_h_electron_fcal_deltaphires_mediumLH; - TH2D_LW* m_h_electron_fcal_deltaphires_tightLH; - - TH2D_LW* m_h_electron_fcalA_deltaphires_looseLH; - TH2D_LW* m_h_electron_fcalA_deltaphires_mediumLH; - TH2D_LW* m_h_electron_fcalA_deltaphires_tightLH; - - TH2D_LW* m_h_electron_fcalC_deltaphires_looseLH; - TH2D_LW* m_h_electron_fcalC_deltaphires_mediumLH; - TH2D_LW* m_h_electron_fcalC_deltaphires_tightLH; - - //e_probability_HT - TH2D_LW* m_h_electron_fcal_eprobabilityht_looseLH; - TH2D_LW* m_h_electron_fcal_eprobabilityht_mediumLH; - TH2D_LW* m_h_electron_fcal_eprobabilityht_tightLH; - - TH2D_LW* m_h_electron_fcalA_eprobabilityht_looseLH; - TH2D_LW* m_h_electron_fcalA_eprobabilityht_mediumLH; - TH2D_LW* m_h_electron_fcalA_eprobabilityht_tightLH; - - TH2D_LW* m_h_electron_fcalC_eprobabilityht_looseLH; - TH2D_LW* m_h_electron_fcalC_eprobabilityht_mediumLH; - TH2D_LW* m_h_electron_fcalC_eprobabilityht_tightLH; + TH1D* m_h_FCalEt_looseLH{}; + TH1D* m_h_FCalEt_mediumLH{}; + TH1D* m_h_FCalEt_tightLH{}; + + TH1D* m_h_FCalEt_A_looseLH{}; + TH1D* m_h_FCalEt_A_mediumLH{}; + TH1D* m_h_FCalEt_A_tightLH{}; + + TH1D* m_h_FCalEt_C_looseLH{}; + TH1D* m_h_FCalEt_C_mediumLH{}; + TH1D* m_h_FCalEt_C_tightLH{}; + + TH2D_LW* m_h_electron_eta_phi{}; + TH1D* m_h_electron_z0sintheta{}; + + //etcone20 + TH2D_LW* m_h_electron_fcal_etcone20_looseLH{}; + TH2D_LW* m_h_electron_fcal_etcone20_mediumLH{}; + TH2D_LW* m_h_electron_fcal_etcone20_tightLH{}; + + TH2D_LW* m_h_electron_fcalA_etcone20_looseLH{}; + TH2D_LW* m_h_electron_fcalA_etcone20_mediumLH{}; + TH2D_LW* m_h_electron_fcalA_etcone20_tightLH{}; + + TH2D_LW* m_h_electron_fcalC_etcone20_looseLH{}; + TH2D_LW* m_h_electron_fcalC_etcone20_mediumLH{}; + TH2D_LW* m_h_electron_fcalC_etcone20_tightLH{}; + + //R_eta + TH2D_LW* m_h_electron_fcal_reta_looseLH{}; + TH2D_LW* m_h_electron_fcal_reta_mediumLH{}; + TH2D_LW* m_h_electron_fcal_reta_tightLH{}; + + TH2D_LW* m_h_electron_fcalA_reta_looseLH{}; + TH2D_LW* m_h_electron_fcalA_reta_mediumLH{}; + TH2D_LW* m_h_electron_fcalA_reta_tightLH{}; + + TH2D_LW* m_h_electron_fcalC_reta_looseLH{}; + TH2D_LW* m_h_electron_fcalC_reta_mediumLH{}; + TH2D_LW* m_h_electron_fcalC_reta_tightLH{}; + + //R_phi + TH2D_LW* m_h_electron_fcal_rphi_looseLH{}; + TH2D_LW* m_h_electron_fcal_rphi_mediumLH{}; + TH2D_LW* m_h_electron_fcal_rphi_tightLH{}; + + TH2D_LW* m_h_electron_fcalA_rphi_looseLH{}; + TH2D_LW* m_h_electron_fcalA_rphi_mediumLH{}; + TH2D_LW* m_h_electron_fcalA_rphi_tightLH{}; + + TH2D_LW* m_h_electron_fcalC_rphi_looseLH{}; + TH2D_LW* m_h_electron_fcalC_rphi_mediumLH{}; + TH2D_LW* m_h_electron_fcalC_rphi_tightLH{}; + + //W_eta2 + TH2D_LW* m_h_electron_fcal_weta2_looseLH{}; + TH2D_LW* m_h_electron_fcal_weta2_mediumLH{}; + TH2D_LW* m_h_electron_fcal_weta2_tightLH{}; + + TH2D_LW* m_h_electron_fcalA_weta2_looseLH{}; + TH2D_LW* m_h_electron_fcalA_weta2_mediumLH{}; + TH2D_LW* m_h_electron_fcalA_weta2_tightLH{}; + + TH2D_LW* m_h_electron_fcalC_weta2_looseLH{}; + TH2D_LW* m_h_electron_fcalC_weta2_mediumLH{}; + TH2D_LW* m_h_electron_fcalC_weta2_tightLH{}; + + //R_had + TH2D_LW* m_h_electron_fcal_rhad_looseLH{}; + TH2D_LW* m_h_electron_fcal_rhad_mediumLH{}; + TH2D_LW* m_h_electron_fcal_rhad_tightLH{}; + + TH2D_LW* m_h_electron_fcalA_rhad_looseLH{}; + TH2D_LW* m_h_electron_fcalA_rhad_mediumLH{}; + TH2D_LW* m_h_electron_fcalA_rhad_tightLH{}; + + TH2D_LW* m_h_electron_fcalC_rhad_looseLH{}; + TH2D_LW* m_h_electron_fcalC_rhad_mediumLH{}; + TH2D_LW* m_h_electron_fcalC_rhad_tightLH{}; + + //E_ratio + TH2D_LW* m_h_electron_fcal_eratio_looseLH{}; + TH2D_LW* m_h_electron_fcal_eratio_mediumLH{}; + TH2D_LW* m_h_electron_fcal_eratio_tightLH{}; + + TH2D_LW* m_h_electron_fcalA_eratio_looseLH{}; + TH2D_LW* m_h_electron_fcalA_eratio_mediumLH{}; + TH2D_LW* m_h_electron_fcalA_eratio_tightLH{}; + + TH2D_LW* m_h_electron_fcalC_eratio_looseLH{}; + TH2D_LW* m_h_electron_fcalC_eratio_mediumLH{}; + TH2D_LW* m_h_electron_fcalC_eratio_tightLH{}; + + //f_1 + TH2D_LW* m_h_electron_fcal_f1_looseLH{}; + TH2D_LW* m_h_electron_fcal_f1_mediumLH{}; + TH2D_LW* m_h_electron_fcal_f1_tightLH{}; + + TH2D_LW* m_h_electron_fcalA_f1_looseLH{}; + TH2D_LW* m_h_electron_fcalA_f1_mediumLH{}; + TH2D_LW* m_h_electron_fcalA_f1_tightLH{}; + + TH2D_LW* m_h_electron_fcalC_f1_looseLH{}; + TH2D_LW* m_h_electron_fcalC_f1_mediumLH{}; + TH2D_LW* m_h_electron_fcalC_f1_tightLH{}; + + //f_3 + TH2D_LW* m_h_electron_fcal_f3_looseLH{}; + TH2D_LW* m_h_electron_fcal_f3_mediumLH{}; + TH2D_LW* m_h_electron_fcal_f3_tightLH{}; + + TH2D_LW* m_h_electron_fcalA_f3_looseLH{}; + TH2D_LW* m_h_electron_fcalA_f3_mediumLH{}; + TH2D_LW* m_h_electron_fcalA_f3_tightLH{}; + + TH2D_LW* m_h_electron_fcalC_f3_looseLH{}; + TH2D_LW* m_h_electron_fcalC_f3_mediumLH{}; + TH2D_LW* m_h_electron_fcalC_f3_tightLH{}; + + //delta_eta1 + TH2D_LW* m_h_electron_fcal_deltaeta1_looseLH{}; + TH2D_LW* m_h_electron_fcal_deltaeta1_mediumLH{}; + TH2D_LW* m_h_electron_fcal_deltaeta1_tightLH{}; + + TH2D_LW* m_h_electron_fcalA_deltaeta1_looseLH{}; + TH2D_LW* m_h_electron_fcalA_deltaeta1_mediumLH{}; + TH2D_LW* m_h_electron_fcalA_deltaeta1_tightLH{}; + + TH2D_LW* m_h_electron_fcalC_deltaeta1_looseLH{}; + TH2D_LW* m_h_electron_fcalC_deltaeta1_mediumLH{}; + TH2D_LW* m_h_electron_fcalC_deltaeta1_tightLH{}; + + //delta_phi_rescaled + TH2D_LW* m_h_electron_fcal_deltaphires_looseLH{}; + TH2D_LW* m_h_electron_fcal_deltaphires_mediumLH{}; + TH2D_LW* m_h_electron_fcal_deltaphires_tightLH{}; + + TH2D_LW* m_h_electron_fcalA_deltaphires_looseLH{}; + TH2D_LW* m_h_electron_fcalA_deltaphires_mediumLH{}; + TH2D_LW* m_h_electron_fcalA_deltaphires_tightLH{}; + + TH2D_LW* m_h_electron_fcalC_deltaphires_looseLH{}; + TH2D_LW* m_h_electron_fcalC_deltaphires_mediumLH{}; + TH2D_LW* m_h_electron_fcalC_deltaphires_tightLH{}; + + //e_probability_HT + TH2D_LW* m_h_electron_fcal_eprobabilityht_looseLH{}; + TH2D_LW* m_h_electron_fcal_eprobabilityht_mediumLH{}; + TH2D_LW* m_h_electron_fcal_eprobabilityht_tightLH{}; + + TH2D_LW* m_h_electron_fcalA_eprobabilityht_looseLH{}; + TH2D_LW* m_h_electron_fcalA_eprobabilityht_mediumLH{}; + TH2D_LW* m_h_electron_fcalA_eprobabilityht_tightLH{}; + + TH2D_LW* m_h_electron_fcalC_eprobabilityht_looseLH{}; + TH2D_LW* m_h_electron_fcalC_eprobabilityht_mediumLH{}; + TH2D_LW* m_h_electron_fcalC_eprobabilityht_tightLH{}; /// histograms ranges and binning int m_FCalEt_nbins; diff --git a/Reconstruction/HeavyIonRec/HIMonitoring/HIMonitoring/HIMonitoringEventShapeTool.h b/Reconstruction/HeavyIonRec/HIMonitoring/HIMonitoring/HIMonitoringEventShapeTool.h index 2f3bab46abd8e76d9eba07564a9ca6e5dc14222f..12eaa0cfcd955462323b6e11effedbea33d8b735 100755 --- a/Reconstruction/HeavyIonRec/HIMonitoring/HIMonitoring/HIMonitoringEventShapeTool.h +++ b/Reconstruction/HeavyIonRec/HIMonitoring/HIMonitoring/HIMonitoringEventShapeTool.h @@ -5,22 +5,15 @@ #ifndef HIMONITORINGEVENTSHAPETOOL_H #define HIMONITORINGEVENTSHAPETOOL_H -#include <vector> -#include <string> + #include "AthenaMonitoring/ManagedMonitorToolBase.h" -#include "TRandom3.h" -#include <xAODHIEvent/HIEventShape.h> #include <xAODHIEvent/HIEventShapeContainer.h> -#include "xAODTrigMinBias/TrigT2ZdcSignals.h" -#include "xAODTrigMinBias/TrigT2ZdcSignalsAuxContainer.h" + #include "xAODTrigMinBias/TrigT2ZdcSignalsContainer.h" -class TH1; -class TGraph; -class TTree; class TH1D; class TH1D_LW; class TH2D_LW; @@ -69,7 +62,7 @@ class HIMonitoringEventShapeTool : public ManagedMonitorToolBase static const int s_num_of_eta_bins = 100; - const std::string m_side_id[2] = { "A", "C" }; + const std::string m_side_id[2] = { "A", "C" }; const std::string m_sqn_num[s_num_of_harm] = {"1","2","3","4","5","6","7"}; double m_FCalEt; @@ -98,30 +91,30 @@ class HIMonitoringEventShapeTool : public ManagedMonitorToolBase /// histograms - TH1D* m_h_FCalEt; - TH1D* m_h_FCalEt_sides[2]; - TProfile_LW* m_h_FCalEt_vs_eta; - TH2D_LW* m_h_FCalEt_A_vs_C; - - TProfile_LW* m_h_qnx_vs_FCalEt[s_num_of_harm]; - TProfile_LW* m_h_qny_vs_FCalEt[s_num_of_harm]; - TH2D_LW* m_h_qn_vs_FCalEt[s_num_of_harm]; - - TProfile_LW* m_h_qnx_A_vs_FCalEt[s_num_of_harm]; - TProfile_LW* m_h_qny_A_vs_FCalEt[s_num_of_harm]; - TProfile_LW* m_h_qnx_C_vs_FCalEt[s_num_of_harm]; - TProfile_LW* m_h_qny_C_vs_FCalEt[s_num_of_harm]; - - TProfile_LW* m_h_qnx_vs_eta[s_num_of_harm]; - TProfile_LW* m_h_qny_vs_eta[s_num_of_harm]; - - TH2D_LW* m_h_psin_A_vs_FCalEt[s_num_of_harm]; - TH2D_LW* m_h_psin_C_vs_FCalEt[s_num_of_harm]; - TH2D_LW* m_h_psin_ACdiff_vs_FCalEt[s_num_of_harm]; - TProfile_LW* m_h_psin_R_vs_FCalEt[s_num_of_harm]; - - TH2D_LW* m_h_FCalEt_vs_ZDC_HG; - TH2D_LW* m_h_FCalEt_vs_ZDC_LG; + TH1D* m_h_FCalEt{}; + TH1D* m_h_FCalEt_sides[2]{}; + TProfile_LW* m_h_FCalEt_vs_eta{}; + TH2D_LW* m_h_FCalEt_A_vs_C{}; + + TProfile_LW* m_h_qnx_vs_FCalEt[s_num_of_harm]{}; + TProfile_LW* m_h_qny_vs_FCalEt[s_num_of_harm]{}; + TH2D_LW* m_h_qn_vs_FCalEt[s_num_of_harm]{}; + + TProfile_LW* m_h_qnx_A_vs_FCalEt[s_num_of_harm]{}; + TProfile_LW* m_h_qny_A_vs_FCalEt[s_num_of_harm]{}; + TProfile_LW* m_h_qnx_C_vs_FCalEt[s_num_of_harm]{}; + TProfile_LW* m_h_qny_C_vs_FCalEt[s_num_of_harm]{}; + + TProfile_LW* m_h_qnx_vs_eta[s_num_of_harm]{}; + TProfile_LW* m_h_qny_vs_eta[s_num_of_harm]{}; + + TH2D_LW* m_h_psin_A_vs_FCalEt[s_num_of_harm]{}; + TH2D_LW* m_h_psin_C_vs_FCalEt[s_num_of_harm]{}; + TH2D_LW* m_h_psin_ACdiff_vs_FCalEt[s_num_of_harm]{}; + TProfile_LW* m_h_psin_R_vs_FCalEt[s_num_of_harm]{}; + + TH2D_LW* m_h_FCalEt_vs_ZDC_HG{}; + TH2D_LW* m_h_FCalEt_vs_ZDC_LG{}; /// histograms ranges and bining int m_FCalEt_nbins; diff --git a/Reconstruction/HeavyIonRec/HIMonitoring/HIMonitoring/HIMonitoringMuonsTool.h b/Reconstruction/HeavyIonRec/HIMonitoring/HIMonitoring/HIMonitoringMuonsTool.h index 0a9ecd1a7be768109cdbf7a3c96134252a8073ce..a5566dd1e22856492d0edfb0fe1e7ce533ab9295 100755 --- a/Reconstruction/HeavyIonRec/HIMonitoring/HIMonitoring/HIMonitoringMuonsTool.h +++ b/Reconstruction/HeavyIonRec/HIMonitoring/HIMonitoring/HIMonitoringMuonsTool.h @@ -5,28 +5,10 @@ #ifndef HIMONITORINGMUONSTOOL_H #define HIMONITORINGMUONSTOOL_H -#include <vector> -#include <string> #include "AthenaMonitoring/ManagedMonitorToolBase.h" -#include "TRandom3.h" -#include <xAODHIEvent/HIEventShape.h> -#include <xAODHIEvent/HIEventShapeContainer.h> - -//muons -#include <xAODMuon/MuonContainer.h> - -//tracks -#include <xAODTracking/TrackParticleContainer.h> - -class TH1; -class TGraph; -class TTree; class TH1D; -class TH1D_LW; -class TH2D_LW; -class TProfile_LW; class HIMonitoringMuonsTool : public ManagedMonitorToolBase { @@ -51,15 +33,15 @@ class HIMonitoringMuonsTool : public ManagedMonitorToolBase /// histograms - TH1D* m_h_FCalEt; + TH1D* m_h_FCalEt{}; - TH1D* m_h_Auth_fcal; - TH1D* m_h_Type_fcal; - TH1D* m_h_Chi2ndf_fcal; + TH1D* m_h_Auth_fcal{}; + TH1D* m_h_Type_fcal{}; + TH1D* m_h_Chi2ndf_fcal{}; - TH1D* m_h_Chi2ndfID_fcal; - TH1D* m_h_Chi2ndfME_fcal; - TH1D* m_h_Chi2ndfMS_fcal; + TH1D* m_h_Chi2ndfID_fcal{}; + TH1D* m_h_Chi2ndfME_fcal{}; + TH1D* m_h_Chi2ndfMS_fcal{}; }; #endif diff --git a/Reconstruction/HeavyIonRec/HIMonitoring/HIMonitoring/HIMonitoringPhotonsTool.h b/Reconstruction/HeavyIonRec/HIMonitoring/HIMonitoring/HIMonitoringPhotonsTool.h index ffba9567c1e0d1c56ab0def500ae4533474ef298..e5170563b31e3f90a32238bb70e19f1ceebf4d56 100755 --- a/Reconstruction/HeavyIonRec/HIMonitoring/HIMonitoring/HIMonitoringPhotonsTool.h +++ b/Reconstruction/HeavyIonRec/HIMonitoring/HIMonitoring/HIMonitoringPhotonsTool.h @@ -5,28 +5,12 @@ #ifndef HIMONITORINGPHOTONSTOOL_H #define HIMONITORINGPHOTONSTOOL_H -#include <vector> -#include <string> #include "AthenaMonitoring/ManagedMonitorToolBase.h" -#include "TRandom3.h" -#include <xAODHIEvent/HIEventShape.h> -#include <xAODHIEvent/HIEventShapeContainer.h> - -#include <xAODEgamma/Photon.h> -#include <xAODEgamma/PhotonContainer.h> - -#include "ElectronPhotonSelectorTools/AsgPhotonIsEMSelector.h" -#include "ElectronPhotonSelectorTools/egammaPIDdefs.h" - -class TH1; -class TGraph; -class TTree; class TH1D; -//class TH1D_LW; class TH2D_LW; -class TProfile_LW; +class AsgPhotonIsEMSelector; class HIMonitoringPhotonsTool : public ManagedMonitorToolBase { diff --git a/Reconstruction/HeavyIonRec/HIMonitoring/HIMonitoring/HIMonitoringZdcTool.h b/Reconstruction/HeavyIonRec/HIMonitoring/HIMonitoring/HIMonitoringZdcTool.h index 691c17514d825d6907b3fcbfd3454f7252881bef..062d688138e716a18800e33554c2a543d9de4e14 100755 --- a/Reconstruction/HeavyIonRec/HIMonitoring/HIMonitoring/HIMonitoringZdcTool.h +++ b/Reconstruction/HeavyIonRec/HIMonitoring/HIMonitoring/HIMonitoringZdcTool.h @@ -5,34 +5,13 @@ #ifndef HIMONITORINGZDCTOOL_H #define HIMONITORINGZDCTOOL_H -#include <vector> -#include <string> #include "AthenaMonitoring/ManagedMonitorToolBase.h" -#include "TRandom3.h" -#include <xAODHIEvent/HIEventShape.h> -#include <xAODHIEvent/HIEventShapeContainer.h> -#include <ZdcAnalysis/ZdcAnalysisTool.h> -#include <xAODForward/ZdcModule.h> -#include <xAODForward/ZdcModuleAuxContainer.h> -#include <xAODForward/ZdcModuleContainer.h> -#include <xAODForward/xAODForwardDict.h> -// #include <xAODTrigEgamma/TrigElectronContainer.h> - - - -class TH1; -class TGraph; -class TTree; class TH1D; -class TH1D_LW; class TH2D_LW; -class TProfile_LW; -const int Nsamp = 7; -const int Nmod = 4; -const int Nside = 2; + class HIMonitoringZdcTool : public ManagedMonitorToolBase { @@ -53,36 +32,40 @@ class HIMonitoringZdcTool : public ManagedMonitorToolBase private: - double m_NEW_AEM, m_NEW_AHAD1, m_NEW_AHAD2, m_NEW_AHAD3; - double m_NEW_CEM, m_NEW_CHAD1, m_NEW_CHAD2, m_NEW_CHAD3; - double m_AEM, m_AHAD1, m_AHAD2, m_AHAD3; - double m_CEM, m_CHAD1, m_CHAD2, m_CHAD3; - double m_G0AEM, m_G0AHAD1, m_G0AHAD2, m_G0AHAD3; - double m_G0CEM, m_G0CHAD1, m_G0CHAD2, m_G0CHAD3; - double m_G1AEM, m_G1AHAD1, m_G1AHAD2, m_G1AHAD3; - double m_G1CEM, m_G1CHAD1, m_G1CHAD2, m_G1CHAD3; - double m_SumSideA, m_SumSideC; - double m_NEW_SumSideA, m_NEW_SumSideC; + double m_NEW_AEM{}, m_NEW_AHAD1{}, m_NEW_AHAD2{}, m_NEW_AHAD3{}; + double m_NEW_CEM{}, m_NEW_CHAD1{}, m_NEW_CHAD2{}, m_NEW_CHAD3{}; + double m_AEM{}, m_AHAD1{}, m_AHAD2{}, m_AHAD3{}; + double m_CEM{}, m_CHAD1{}, m_CHAD2{}, m_CHAD3{}; + double m_G0AEM{}, m_G0AHAD1{}, m_G0AHAD2{}, m_G0AHAD3{}; + double m_G0CEM{}, m_G0CHAD1{}, m_G0CHAD2{}, m_G0CHAD3{}; + double m_G1AEM{}, m_G1AHAD1{}, m_G1AHAD2{}, m_G1AHAD3{}; + double m_G1CEM{}, m_G1CHAD1{}, m_G1CHAD2{}, m_G1CHAD3{}; + double m_SumSideA{}, m_SumSideC{}; + double m_NEW_SumSideA{}, m_NEW_SumSideC{}; + + static constexpr int s_Nsamp{7}; + static constexpr int s_Nmod{4}; + static constexpr int s_Nside{2}; /// histograms - TH1D* m_hamp[Nmod][Nside]; - TH1D* m_hamp_NEW[Nmod][Nside]; - TH1D* m_hampG0[Nmod][Nside]; - TH1D* m_hampG1[Nmod][Nside]; - TH1D* m_hSumSideAmp[Nside]; - TH1D* m_hSumSideAmp_NEW[Nside]; - TH1D* m_hSumSideAmpG0[Nside]; - TH1D* m_hSumSideAmpG1[Nside]; - TH2D_LW* m_hEM_HAD1[Nside]; - TH2D_LW* m_hHAD1_HAD2[Nside]; - TH2D_LW* m_hHAD2_HAD3[Nside]; - TH2D_LW* m_hSideAC; - - TH2D_LW* m_hEM_HAD1_NEW[Nside]; - TH2D_LW* m_hHAD1_HAD2_NEW[Nside]; - TH2D_LW* m_hHAD2_HAD3_NEW[Nside]; - TH2D_LW* m_hSideAC_NEW; + TH1D* m_hamp[s_Nmod][s_Nside]{}; + TH1D* m_hamp_NEW[s_Nmod][s_Nside]{}; + TH1D* m_hampG0[s_Nmod][s_Nside]{}; + TH1D* m_hampG1[s_Nmod][s_Nside]{}; + TH1D* m_hSumSideAmp[s_Nside]{}; + TH1D* m_hSumSideAmp_NEW[s_Nside]{}; + TH1D* m_hSumSideAmpG0[s_Nside]{}; + TH1D* m_hSumSideAmpG1[s_Nside]{}; + TH2D_LW* m_hEM_HAD1[s_Nside]{}; + TH2D_LW* m_hHAD1_HAD2[s_Nside]{}; + TH2D_LW* m_hHAD2_HAD3[s_Nside]{}; + TH2D_LW* m_hSideAC{}; + + TH2D_LW* m_hEM_HAD1_NEW[s_Nside]{}; + TH2D_LW* m_hHAD1_HAD2_NEW[s_Nside]{}; + TH2D_LW* m_hHAD2_HAD3_NEW[s_Nside]{}; + TH2D_LW* m_hSideAC_NEW{}; }; diff --git a/Reconstruction/HeavyIonRec/HIMonitoring/share/HIMonitoringSteering_jo.py b/Reconstruction/HeavyIonRec/HIMonitoring/share/HIMonitoringSteering_jo.py index 5fc56e93e304fd242ccae4bac9c8befc5a8d935f..fe4767485944c316c24e17e8e0a84c589ea0b122 100755 --- a/Reconstruction/HeavyIonRec/HIMonitoring/share/HIMonitoringSteering_jo.py +++ b/Reconstruction/HeavyIonRec/HIMonitoring/share/HIMonitoringSteering_jo.py @@ -55,7 +55,7 @@ name = "HIElectronsMonTool", if DQMonFlags.monManEnvironment == 'tier0ESD' or DQMonFlags.monManEnvironment == 'tier0': - ToolSvc += HIEventShapeMonTool + #ToolSvc += HIEventShapeMonTool HIEventShapeMonMan = AthenaMonManager( "HIEventShapeManager", FileKey = DQMonFlags.monManFileKey(), #"GLOBAL" #"stat" ManualDataTypeSetup = DQMonFlags.monManManualDataTypeSetup(), #True @@ -67,7 +67,7 @@ if DQMonFlags.monManEnvironment == 'tier0ESD' or DQMonFlags.monManEnvironment == AthenaMonTools = [ HIEventShapeMonTool ]) topSequence += HIEventShapeMonMan - ToolSvc += HIPhotonsMonTool + #ToolSvc += HIPhotonsMonTool HIPhotonsMonMan = AthenaMonManager( "HIPhotonsMonManager", FileKey = DQMonFlags.monManFileKey(), #"GLOBAL" #"stat" ManualDataTypeSetup = DQMonFlags.monManManualDataTypeSetup(), #True @@ -79,7 +79,7 @@ if DQMonFlags.monManEnvironment == 'tier0ESD' or DQMonFlags.monManEnvironment == AthenaMonTools = [ HIPhotonsMonTool ]) topSequence += HIPhotonsMonMan - ToolSvc += HIMuonsMonTool + #ToolSvc += HIMuonsMonTool HIMuonsMonMan = AthenaMonManager( "HIMuonsMonManager", FileKey = DQMonFlags.monManFileKey(), #"GLOBAL" #"stat" ManualDataTypeSetup = DQMonFlags.monManManualDataTypeSetup(), #True @@ -91,7 +91,7 @@ if DQMonFlags.monManEnvironment == 'tier0ESD' or DQMonFlags.monManEnvironment == AthenaMonTools = [ HIMuonsMonTool ]) topSequence += HIMuonsMonMan - ToolSvc += HIElectronsMonTool + #ToolSvc += HIElectronsMonTool HIElectronsMonMan = AthenaMonManager( "HIElectronsMonManager", FileKey = DQMonFlags.monManFileKey(), #"GLOBAL" #"stat" ManualDataTypeSetup = DQMonFlags.monManManualDataTypeSetup(), #True @@ -104,7 +104,7 @@ if DQMonFlags.monManEnvironment == 'tier0ESD' or DQMonFlags.monManEnvironment == topSequence += HIElectronsMonMan if DQMonFlags.monManEnvironment == 'tier0ESD' or DQMonFlags.monManEnvironment == 'tier0' or DQMonFlags.monManEnvironment == 'online': - ToolSvc += HIZdcMonTool + #ToolSvc += HIZdcMonTool HIZdcMonMan = AthenaMonManager( "HIZdcMonManager", FileKey = DQMonFlags.monManFileKey(), #"GLOBAL" #"stat" ManualDataTypeSetup = DQMonFlags.monManManualDataTypeSetup(), #True diff --git a/Reconstruction/HeavyIonRec/HIMonitoring/src/HIMonitoringElectronsTool.cxx b/Reconstruction/HeavyIonRec/HIMonitoring/src/HIMonitoringElectronsTool.cxx index aba5a0e71d4ec6bd8184c5c6a3af2b29819979e2..e3234c2d3a1c7bcd67734634194955cb79b4e028 100755 --- a/Reconstruction/HeavyIonRec/HIMonitoring/src/HIMonitoringElectronsTool.cxx +++ b/Reconstruction/HeavyIonRec/HIMonitoring/src/HIMonitoringElectronsTool.cxx @@ -2,18 +2,14 @@ Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration */ -#include <sstream> -#include "GaudiKernel/IJobOptionsSvc.h" -#include "GaudiKernel/MsgStream.h" -#include "GaudiKernel/StatusCode.h" +#include <xAODEgamma/ElectronContainer.h> #include "AthenaMonitoring/AthenaMonManager.h" #include "HIMonitoring/HIMonitoringElectronsTool.h" +#include "ElectronPhotonSelectorTools/AsgElectronLikelihoodTool.h" -#include "LWHists/TH1D_LW.h" #include "LWHists/TH2D_LW.h" -#include "LWHists/TProfile_LW.h" HIMonitoringElectronsTool:: HIMonitoringElectronsTool( const std::string & type, const std::string & name, diff --git a/Reconstruction/HeavyIonRec/HIMonitoring/src/HIMonitoringEventShapeTool.cxx b/Reconstruction/HeavyIonRec/HIMonitoring/src/HIMonitoringEventShapeTool.cxx index 285569b8c029ff3e94235c1ef972fd881677cfaa..d0a42ea1efbf08aab0311d4fd2c9da7b9d31365c 100755 --- a/Reconstruction/HeavyIonRec/HIMonitoring/src/HIMonitoringEventShapeTool.cxx +++ b/Reconstruction/HeavyIonRec/HIMonitoring/src/HIMonitoringEventShapeTool.cxx @@ -2,14 +2,11 @@ Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration */ -#include <sstream> -#include "GaudiKernel/IJobOptionsSvc.h" -#include "GaudiKernel/MsgStream.h" -#include "GaudiKernel/StatusCode.h" #include "AthenaMonitoring/AthenaMonManager.h" #include "HIMonitoring/HIMonitoringEventShapeTool.h" +#include "xAODTrigMinBias/TrigT2ZdcSignals.h" #include "LWHists/TH1D_LW.h" #include "LWHists/TH2D_LW.h" diff --git a/Reconstruction/HeavyIonRec/HIMonitoring/src/HIMonitoringMuonsTool.cxx b/Reconstruction/HeavyIonRec/HIMonitoring/src/HIMonitoringMuonsTool.cxx index 62c27f5cacf1bc7349db67eadce1dfb719b29f69..4671cfaa806cc00f16c8a5a140051669327a88fd 100755 --- a/Reconstruction/HeavyIonRec/HIMonitoring/src/HIMonitoringMuonsTool.cxx +++ b/Reconstruction/HeavyIonRec/HIMonitoring/src/HIMonitoringMuonsTool.cxx @@ -2,18 +2,12 @@ Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration */ -#include <sstream> -#include "GaudiKernel/IJobOptionsSvc.h" -#include "GaudiKernel/MsgStream.h" -#include "GaudiKernel/StatusCode.h" #include "AthenaMonitoring/AthenaMonManager.h" #include "HIMonitoring/HIMonitoringMuonsTool.h" - -#include "LWHists/TH1D_LW.h" -#include "LWHists/TH2D_LW.h" -#include "LWHists/TProfile_LW.h" +#include "xAODHIEvent/HIEventShapeContainer.h" +#include "xAODMuon/MuonContainer.h" HIMonitoringMuonsTool:: HIMonitoringMuonsTool( const std::string & type, const std::string & name, diff --git a/Reconstruction/HeavyIonRec/HIMonitoring/src/HIMonitoringPhotonsTool.cxx b/Reconstruction/HeavyIonRec/HIMonitoring/src/HIMonitoringPhotonsTool.cxx index d625cc899cceccd52fee2f79f25fc777a9b70ffa..203ef38dae17d3439dfc5c333fe65b650893d4d2 100755 --- a/Reconstruction/HeavyIonRec/HIMonitoring/src/HIMonitoringPhotonsTool.cxx +++ b/Reconstruction/HeavyIonRec/HIMonitoring/src/HIMonitoringPhotonsTool.cxx @@ -2,19 +2,16 @@ Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration */ -#include <sstream> -#include "GaudiKernel/IJobOptionsSvc.h" -#include "GaudiKernel/MsgStream.h" -#include "GaudiKernel/StatusCode.h" #include "PATCore/AcceptData.h" #include "AthenaMonitoring/AthenaMonManager.h" #include "HIMonitoring/HIMonitoringPhotonsTool.h" - -//#include "LWHists/TH1D_LW.h" +#include "ElectronPhotonSelectorTools/AsgPhotonIsEMSelector.h" +#include "ElectronPhotonSelectorTools/egammaPIDdefs.h" +#include "xAODHIEvent/HIEventShapeContainer.h" +#include "xAODEgamma/PhotonContainer.h" #include "LWHists/TH2D_LW.h" -#include "LWHists/TProfile_LW.h" HIMonitoringPhotonsTool:: HIMonitoringPhotonsTool( const std::string & type, const std::string & name, diff --git a/Reconstruction/HeavyIonRec/HIMonitoring/src/HIMonitoringZdcTool.cxx b/Reconstruction/HeavyIonRec/HIMonitoring/src/HIMonitoringZdcTool.cxx index fef8a7eb485a3e815479abea9268b877b8bfac8d..ddcb302a41a039593f78566cd7265b9316e7a163 100755 --- a/Reconstruction/HeavyIonRec/HIMonitoring/src/HIMonitoringZdcTool.cxx +++ b/Reconstruction/HeavyIonRec/HIMonitoring/src/HIMonitoringZdcTool.cxx @@ -2,26 +2,15 @@ Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration */ -#include <sstream> - -#include "GaudiKernel/IJobOptionsSvc.h" -#include "GaudiKernel/MsgStream.h" -#include "GaudiKernel/StatusCode.h" #include "AthenaMonitoring/AthenaMonManager.h" #include "HIMonitoring/HIMonitoringZdcTool.h" #include <xAODForward/ZdcModule.h> -#include <xAODForward/ZdcModuleAuxContainer.h> #include <xAODForward/ZdcModuleContainer.h> -#include <xAODForward/xAODForwardDict.h> -#include <ZdcAnalysis/ZdcAnalysisTool.h> -#include "TCanvas.h" -#include "TROOT.h" + #include "TStyle.h" -#include "TLatex.h" -#include "LWHists/TH1D_LW.h" + #include "LWHists/TH2D_LW.h" -#include "LWHists/TProfile_LW.h" HIMonitoringZdcTool:: HIMonitoringZdcTool( const std::string & type, const std::string & name, @@ -186,14 +175,14 @@ StatusCode HIMonitoringZdcTool::procHistograms( ) if( endOfRunFlag() ) { - for(int k = 0; k < Nside; k++) + for(int k = 0; k < s_Nside; k++) { if(m_hSumSideAmp[k]->GetEntries() > 0) m_hSumSideAmp[k]->Scale(1./m_hSumSideAmp[k]->GetEntries()); // if(hSumSideAmp_NEW[k]->GetEntries() > 0) hSumSideAmp_NEW[k]->Scale(1./hSumSideAmp_NEW[k]->GetEntries()); if(m_hSumSideAmpG0[k]->GetEntries() > 0) m_hSumSideAmpG0[k]->Scale(1./m_hSumSideAmpG0[k]->GetEntries()); if(m_hSumSideAmpG1[k]->GetEntries() > 0) m_hSumSideAmpG1[k]->Scale(1./m_hSumSideAmpG1[k]->GetEntries()); - for(int i = 0; i < Nmod; i++) + for(int i = 0; i < s_Nmod; i++) { if(m_hamp[i][k]->GetEntries() > 0) m_hamp[i][k]->Scale(1./m_hamp[i][k]->GetEntries()); // if(m_hamp_NEW[i][k]->GetEntries() > 0) m_hamp_NEW[i][k]->Scale(1./m_hamp_NEW[i][k]->GetEntries()); @@ -237,7 +226,7 @@ void HIMonitoringZdcTool::book_hist() m_hSideAC_NEW = TH2D_LW::create(nameSideAC.str().c_str(), nameSideAC.str().c_str(),10241,-0.5,10240.5,10241,-0.5,10240.5); regHist(m_hSideAC_NEW, path, run).ignore(); */ - for(int k = 0; k<Nside; k++){ + for(int k = 0; k<s_Nside; k++){ nameEM_HAD1.str(""); nameEM_HAD1<<"hEM_HAD1_side"<<k; @@ -289,7 +278,7 @@ void HIMonitoringZdcTool::book_hist() m_hSumSideAmpG1[k] = new TH1D(nameSumSideAmpG1.str().c_str(), nameSumSideAmpG1.str().c_str(),4097,-0.5,4096.5); regHist(m_hSumSideAmpG1[k], path, run).ignore(); - for(int i = 0; i<Nmod; i++){ + for(int i = 0; i<s_Nmod; i++){ histnameamp.str(""); histnameamp<<"h_amplitude_mod"<<i<<"_side"<<k; m_hamp[i][k] = new TH1D(histnameamp.str().c_str(), histnameamp.str().c_str(), 1025, -5, 10245); diff --git a/Reconstruction/Jet/JetEDM/JetEDM/IndexedTConstituentUserInfo.icc b/Reconstruction/Jet/JetEDM/JetEDM/IndexedTConstituentUserInfo.icc index 2a7a0a54854e3f42e694d93e58012c9deda8e66a..23afd4e419fcbf89a049b1f727ff7c9350edfd20 100644 --- a/Reconstruction/Jet/JetEDM/JetEDM/IndexedTConstituentUserInfo.icc +++ b/Reconstruction/Jet/JetEDM/JetEDM/IndexedTConstituentUserInfo.icc @@ -4,7 +4,6 @@ // IndexedTConstituentUserInfo.cxx -#include "JetEDM/IndexedTConstituentUserInfo.h" #include "JetEDM/LabelIndex.h" //********************************************************************** diff --git a/Reconstruction/Jet/JetEDM/Root/JetConstituentFiller.cxx b/Reconstruction/Jet/JetEDM/Root/JetConstituentFiller.cxx index 66668199dd2c73952b92a7dcbaac8130b2702f88..b960c45b369d836cdd6fc3bd8c87f174ec506607 100644 --- a/Reconstruction/Jet/JetEDM/Root/JetConstituentFiller.cxx +++ b/Reconstruction/Jet/JetEDM/Root/JetConstituentFiller.cxx @@ -91,7 +91,6 @@ extractConstituents(xAOD::Jet& jet, const NameList* pghostlabs, if ( partype != MUSEG ) return -6; } else { if ( partype != IPART ) return -7; - ptout[icui] += ppar->pt(); } Label lab = cui.label(); // Add to constituent list or associated object list. @@ -103,9 +102,7 @@ extractConstituents(xAOD::Jet& jet, const NameList* pghostlabs, outms[icui].push_back(pms); } else if ( partype == IPART ) { out[icui].push_back(ppar); - } else { - return -8; - } + } } } else { ++nbad; @@ -113,43 +110,44 @@ extractConstituents(xAOD::Jet& jet, const NameList* pghostlabs, } // Set ghost associated particles: - for ( size_t i=1; i<out.size(); ++i ) { - if ( pghostlabs != nullptr ) { - const NameList& ghostlabs = *pghostlabs; - if ( find(ghostlabs.begin(), ghostlabs.end(), pli->label(i)) == ghostlabs.end() ) { - nbad += out[i].size(); - continue; - } - } - ParType& partype = partypes[i]; - std::string cname = pli->label(i) + "Count"; - std::string ptname = pli->label(i) + "Pt"; - // Check if this is in the parent jet - int count_test; // dummy var to retrieve into -- we don't care about the value - const static SG::AuxElement::ConstAccessor<ElementLink<xAOD::JetContainer> > cacc_parent("Parent"); - if(!m_isTrigger) { - if(cacc_parent.isAvailable(jet) && cacc_parent(jet).isValid()) { - if(!(*cacc_parent(jet))->getAttribute(cname,count_test)) { - nbad += out[i].size(); // Skip if the parent does not have this + if (pli){ + for ( size_t i=1; i<out.size(); ++i ) { + if ( pghostlabs) { + const NameList& ghostlabs = *pghostlabs; + if ( find(ghostlabs.begin(), ghostlabs.end(), pli->label(i)) == ghostlabs.end() ) { + nbad += out[i].size(); continue; } } - } - if ( partype == MUSEG ) { - // Record associated muons. - jet.setAssociatedObjects(pli->label(i) , outms[i]); - jet.setAttribute<int>(cname, outms[i].size()); - } else if ( partype == IPART ) { - // Record associated particles. - jet.setAssociatedObjects(pli->label(i), out[i]); - jet.setAttribute<int>(cname, out[i].size()); - jet.setAttribute<float>(ptname, ptout[i]); - if ( ! outms[i].empty() ) return -9; - } else { - return -10; + ParType& partype = partypes[i]; + std::string cname = pli->label(i) + "Count"; + std::string ptname = pli->label(i) + "Pt"; + // Check if this is in the parent jet + int count_test; // dummy var to retrieve into -- we don't care about the value + const static SG::AuxElement::ConstAccessor<ElementLink<xAOD::JetContainer> > cacc_parent("Parent"); + if(!m_isTrigger) { + if(cacc_parent.isAvailable(jet) && cacc_parent(jet).isValid()) { + if(!(*cacc_parent(jet))->getAttribute(cname,count_test)) { + nbad += out[i].size(); // Skip if the parent does not have this + continue; + } + } + } + if ( partype == MUSEG ) { + // Record associated muons. + jet.setAssociatedObjects(pli->label(i) , outms[i]); + jet.setAttribute<int>(cname, outms[i].size()); + } else if ( partype == IPART ) { + // Record associated particles. + jet.setAssociatedObjects(pli->label(i), out[i]); + jet.setAttribute<int>(cname, out[i].size()); + jet.setAttribute<float>(ptname, ptout[i]); + if ( ! outms[i].empty() ) return -9; + } else { + return -10; + } } } - return nbad; } diff --git a/Reconstruction/Jet/JetEDM/Root/VertexIndexedConstituentUserInfo.cxx b/Reconstruction/Jet/JetEDM/Root/VertexIndexedConstituentUserInfo.cxx index 3133983bac505014690511e94ea85d1c6e2e0903..41c2351afbe425b63d501c077173ce9fca1ca286 100644 --- a/Reconstruction/Jet/JetEDM/Root/VertexIndexedConstituentUserInfo.cxx +++ b/Reconstruction/Jet/JetEDM/Root/VertexIndexedConstituentUserInfo.cxx @@ -6,11 +6,12 @@ namespace jet { - VertexIndexedConstituentUserInfo::VertexIndexedConstituentUserInfo() : IndexedConstituentUserInfo() {} + VertexIndexedConstituentUserInfo::VertexIndexedConstituentUserInfo() : IndexedConstituentUserInfo(), m_vertex{} { + //nop + } - VertexIndexedConstituentUserInfo::VertexIndexedConstituentUserInfo(const xAOD::IParticle& par, Index idx, const LabelIndex* pli, const xAOD::Vertex* vtx) : IndexedConstituentUserInfo(par, idx, pli) , m_vertex(vtx) {} - - - + VertexIndexedConstituentUserInfo::VertexIndexedConstituentUserInfo(const xAOD::IParticle& par, Index idx, const LabelIndex* pli, const xAOD::Vertex* vtx) : IndexedConstituentUserInfo(par, idx, pli) , m_vertex(vtx) { + //nop + } } diff --git a/Reconstruction/Jet/JetEventTPCnv/JetEventTPCnv/JetAssociationBase_p1.h b/Reconstruction/Jet/JetEventTPCnv/JetEventTPCnv/JetAssociationBase_p1.h index 30bc555146357009bdfb218aec8d9fa56c105b16..6e2fc696832045bae2fa4b461f4dfd576b237340 100644 --- a/Reconstruction/Jet/JetEventTPCnv/JetEventTPCnv/JetAssociationBase_p1.h +++ b/Reconstruction/Jet/JetEventTPCnv/JetEventTPCnv/JetAssociationBase_p1.h @@ -14,7 +14,7 @@ class JetAssociationBase_p1 ~JetAssociationBase_p1() {}; /// Stored in the base class - unsigned int m_keyIndex; + unsigned int m_keyIndex{}; }; #endif diff --git a/Reconstruction/Jet/JetEventTPCnv/JetEventTPCnv/JetCollection_p1.h b/Reconstruction/Jet/JetEventTPCnv/JetEventTPCnv/JetCollection_p1.h index 019f01cf34486bb94f5315403210bb435b359aa3..0e420357acda5e740c896c88cc352841131c474e 100755 --- a/Reconstruction/Jet/JetEventTPCnv/JetEventTPCnv/JetCollection_p1.h +++ b/Reconstruction/Jet/JetEventTPCnv/JetEventTPCnv/JetCollection_p1.h @@ -35,8 +35,8 @@ class JetCollection_p1 : public std::vector<Jet_p1> // Private data: /////////////////////////////////////////////////////////////////// private: - std::string m_roiAuthor; - short m_ordered; + std::string m_roiAuthor{}; + short m_ordered{}; }; #endif //> RECTPCNV_JETCOLLECTION_P1_H diff --git a/Reconstruction/Jet/JetEventTPCnv/JetEventTPCnv/JetCollection_p2.h b/Reconstruction/Jet/JetEventTPCnv/JetEventTPCnv/JetCollection_p2.h index 7443e4294d4754213369d047cb0e836b82bc5640..3689959828d45a5b43e08c2918a350ae0162de1d 100755 --- a/Reconstruction/Jet/JetEventTPCnv/JetEventTPCnv/JetCollection_p2.h +++ b/Reconstruction/Jet/JetEventTPCnv/JetEventTPCnv/JetCollection_p2.h @@ -38,8 +38,8 @@ class JetCollection_p2 : public std::vector<Jet_p2> // Private data: /////////////////////////////////////////////////////////////////// private: - std::string m_roiAuthor; - short m_ordered; + std::string m_roiAuthor{}; + short m_ordered{}; DataLink_p1 m_keyStore; }; diff --git a/Reconstruction/Jet/JetEventTPCnv/JetEventTPCnv/JetCollection_p3.h b/Reconstruction/Jet/JetEventTPCnv/JetEventTPCnv/JetCollection_p3.h index 8c5151c0b1433369c93398c08c6a8e21ff7ff654..2ed81a2ef028c0ffc39c83a06fab3413ffbf8a76 100644 --- a/Reconstruction/Jet/JetEventTPCnv/JetEventTPCnv/JetCollection_p3.h +++ b/Reconstruction/Jet/JetEventTPCnv/JetEventTPCnv/JetCollection_p3.h @@ -39,7 +39,7 @@ class JetCollection_p3 : public std::vector<Jet_p3> /////////////////////////////////////////////////////////////////// private: std::string m_roiAuthor; - short m_ordered; + short m_ordered{}; DataLink_p1 m_keyStore; }; diff --git a/Reconstruction/Jet/JetEventTPCnv/JetEventTPCnv/JetCollection_p4.h b/Reconstruction/Jet/JetEventTPCnv/JetEventTPCnv/JetCollection_p4.h index 3d7a8edf5fba1fcd700646b97b334d8d49ae2b17..df5c826c0a8789ae645b63a6ab02c3487304527f 100644 --- a/Reconstruction/Jet/JetEventTPCnv/JetEventTPCnv/JetCollection_p4.h +++ b/Reconstruction/Jet/JetEventTPCnv/JetEventTPCnv/JetCollection_p4.h @@ -39,7 +39,7 @@ class JetCollection_p4 : public std::vector<TPObjRef> /////////////////////////////////////////////////////////////////// private: std::string m_roiAuthor; - short m_ordered; + short m_ordered{}; DataLink_p1 m_keyStore; }; diff --git a/Reconstruction/Jet/JetEventTPCnv/JetEventTPCnv/JetCollection_p5.h b/Reconstruction/Jet/JetEventTPCnv/JetEventTPCnv/JetCollection_p5.h index cc2fb0ca807d89136ae4c9916197d4daac82d549..2b5f5da3d891f79c5d6d6fdc0a17be838b722f83 100644 --- a/Reconstruction/Jet/JetEventTPCnv/JetEventTPCnv/JetCollection_p5.h +++ b/Reconstruction/Jet/JetEventTPCnv/JetEventTPCnv/JetCollection_p5.h @@ -38,7 +38,7 @@ class JetCollection_p5 : public std::vector<TPObjRef> // Private data: /////////////////////////////////////////////////////////////////// private: - short m_ordered; + short m_ordered{}; DataLink_p1 m_keyStore; }; diff --git a/Reconstruction/Jet/JetEventTPCnv/JetEventTPCnv/JetCollection_p6.h b/Reconstruction/Jet/JetEventTPCnv/JetEventTPCnv/JetCollection_p6.h index 3fea53e0dbc22fbf6e7d048f35394eb2c903491a..701796635cac4b9d1d835254ab7e2c69511cdf75 100644 --- a/Reconstruction/Jet/JetEventTPCnv/JetEventTPCnv/JetCollection_p6.h +++ b/Reconstruction/Jet/JetEventTPCnv/JetEventTPCnv/JetCollection_p6.h @@ -39,10 +39,10 @@ public: // Private data: /////////////////////////////////////////////////////////////////// private: - short m_ordered; + short m_ordered{}; DataLink_p2 m_keyStore; //DataLink_p2 m_momentMapLink; - unsigned short m_jetAuthor; + unsigned short m_jetAuthor{}; // Only to fix reading of very early release 16 validation sample bool m_jetIdBugFixed; }; diff --git a/Reconstruction/Jet/JetEventTPCnv/JetEventTPCnv/Jet_p2.h b/Reconstruction/Jet/JetEventTPCnv/JetEventTPCnv/Jet_p2.h index 59a926a4311388404a2c23b42cbeaf0a9ba6ee7c..4a1812c0422a63d990bd52f1edcb5eb3d1b4cb49 100755 --- a/Reconstruction/Jet/JetEventTPCnv/JetEventTPCnv/Jet_p2.h +++ b/Reconstruction/Jet/JetEventTPCnv/JetEventTPCnv/Jet_p2.h @@ -54,6 +54,9 @@ public: /** Destructor: */ ~Jet_p2(); + + //assignment defaulted + Jet_p2 & operator=(const Jet_p2 &) = default; /////////////////////////////////////////////////////////////////// // Const methods: @@ -74,7 +77,7 @@ private: /// the 4-mom part P4PxPyPzE_p1 m_momentum; - unsigned int m_author; + unsigned int m_author{}; /// combined likelihoods std::vector<double> m_combinedLikelihood; diff --git a/Reconstruction/Jet/JetEventTPCnv/JetEventTPCnv/Jet_p3.h b/Reconstruction/Jet/JetEventTPCnv/JetEventTPCnv/Jet_p3.h index c60c37a301b2df2258640caf8de61db95f861cf3..0106af3723a7406ac346d49ab83b2515be56830f 100644 --- a/Reconstruction/Jet/JetEventTPCnv/JetEventTPCnv/Jet_p3.h +++ b/Reconstruction/Jet/JetEventTPCnv/JetEventTPCnv/Jet_p3.h @@ -54,6 +54,8 @@ public: /** Destructor: */ ~Jet_p3(); + + Jet_p3 & operator=(const Jet_p3 &) = default; /////////////////////////////////////////////////////////////////// // Const methods: diff --git a/Reconstruction/Jet/JetEventTPCnv/JetEventTPCnv/Jet_p4.h b/Reconstruction/Jet/JetEventTPCnv/JetEventTPCnv/Jet_p4.h index 25c6ad24a079b42e8112ce2a7370490d3d4bcc2c..fa3f7662a5a068dfdaa5efc165843f341114c3c3 100644 --- a/Reconstruction/Jet/JetEventTPCnv/JetEventTPCnv/Jet_p4.h +++ b/Reconstruction/Jet/JetEventTPCnv/JetEventTPCnv/Jet_p4.h @@ -58,6 +58,9 @@ public: /** Destructor: */ ~Jet_p4(); + + //default assignment + Jet_p4 & operator=(const Jet_p4 &) = default; /////////////////////////////////////////////////////////////////// // Const methods: @@ -97,10 +100,10 @@ private: std::vector<TPObjRef> m_associations; // Signal states - char m_ratioE; /**ratio for uncalibrated E */ - char m_ratioPx; /**ratio for uncalibrated p_x */ - char m_ratioPy; /**ratio for uncalibrated p_y */ - char m_ratioPz; /**ratio for uncalibrated p_z */ + char m_ratioE{}; /**ratio for uncalibrated E */ + char m_ratioPx{}; /**ratio for uncalibrated p_x */ + char m_ratioPy{}; /**ratio for uncalibrated p_y */ + char m_ratioPz{}; /**ratio for uncalibrated p_z */ }; /////////////////////////////////////////////////////////////////// diff --git a/Reconstruction/Jet/JetEventTPCnv/JetEventTPCnv/Jet_p5.h b/Reconstruction/Jet/JetEventTPCnv/JetEventTPCnv/Jet_p5.h index 1af0f894bd4ad4a840c56f80e0520a1f1fbf335b..84eedc464a07a7d873b2fa978fb33e4a9196859d 100644 --- a/Reconstruction/Jet/JetEventTPCnv/JetEventTPCnv/Jet_p5.h +++ b/Reconstruction/Jet/JetEventTPCnv/JetEventTPCnv/Jet_p5.h @@ -57,6 +57,9 @@ public: */ ~Jet_p5(); + //default assignment + Jet_p5 & operator=(const Jet_p5 &) = default; + /////////////////////////////////////////////////////////////////// // Const methods: /////////////////////////////////////////////////////////////////// diff --git a/Reconstruction/Jet/JetEventTPCnv/src/JetCnv_p6.cxx b/Reconstruction/Jet/JetEventTPCnv/src/JetCnv_p6.cxx index cce26a6e5f87d894033d401c54d79f0371153a93..395f10034f582333076ee444353351d27024a8a8 100644 --- a/Reconstruction/Jet/JetEventTPCnv/src/JetCnv_p6.cxx +++ b/Reconstruction/Jet/JetEventTPCnv/src/JetCnv_p6.cxx @@ -222,7 +222,7 @@ void JetCnv_p6::transToPers( const Jet* trans, //momentMapCnv.transToPers( &trans->m_momentMapLink, &pers->m_moments ,msg); - pers->m_dataType = pers->m_dataType; + pers->m_dataType = trans->dataType(); vxCnv.transToPers( &trans->m_part.m_origin, &pers->m_origin, msg ); pers->m_constituentSigState = trans->m_constituentSigState; diff --git a/Reconstruction/Jet/JetEventTPCnv/src/ParticleJetCnv_p1.cxx b/Reconstruction/Jet/JetEventTPCnv/src/ParticleJetCnv_p1.cxx index bf43b7c5c01cf0ec1ac779412fb7c444dccdd78e..303446fdd7df85aac1a10fa4a2f55e61df176b70 100644 --- a/Reconstruction/Jet/JetEventTPCnv/src/ParticleJetCnv_p1.cxx +++ b/Reconstruction/Jet/JetEventTPCnv/src/ParticleJetCnv_p1.cxx @@ -15,15 +15,12 @@ // JetTagEvent includes #include "JetEvent/Jet.h" -/* #include "JetTagEvent/JetConstituent.h" - #include "JetTagEvent/TrackConstituents.h" - #include "JetTagEvent/TrackAssociation.h" */ + #include "egammaEvent/ElectronConstituent.h" #include "egammaEvent/ElectronAssociation.h" #include "MuonIDEvent/MuonConstituent.h" #include "MuonIDEvent/MuonAssociation.h" -//#include "JetUtils/JetCaloHelper.h" // EventCommonTPCnv includes #include "EventCommonTPCnv/P4ImplPxPyPzECnv_p1.h" @@ -40,7 +37,6 @@ // converters static P4ImplPxPyPzECnv_p1 momCnv; -//static P4PxPyPzECnv_p1 momCnv; static ParticleBaseCnv_p1 partBaseCnv; /////////////////////////////////////////////////////////////////// @@ -80,7 +76,6 @@ ParticleJetCnv_p1::persToTrans( const ParticleJet_p1* pers, << endmsg; msg << MSG::DEBUG << " ParticleJetCnv_p1 pers e="<< pers->m_momentum.m_ene <<endmsg; - //msg << MSG::DEBUG << " pers e=" << pers-> // base classes partBaseCnv.persToTrans( &pers->m_particleBase, &trans->particleBase(), msg ); msg << MSG::DEBUG << "ParticleJet_p1 converted particlebase" << endmsg; @@ -99,7 +94,7 @@ ParticleJetCnv_p1::persToTrans( const ParticleJet_p1* pers, size_t ntag = pers->m_tagJetInfo.size(); for(size_t i=0;i<ntag;i++){ Jet::taginfo_t * tagi = dynamic_cast<Jet::taginfo_t *>(pers->m_tagJetInfo[i]); - trans->setTagInfo(tagi->infoType(), tagi); + if (tagi) trans->setTagInfo(tagi->infoType(), tagi); } // Constitutents are now Associations @@ -110,78 +105,16 @@ ParticleJetCnv_p1::persToTrans( const ParticleJet_p1* pers, std::string constit_name = iconstit->name(); msg << MSG::DEBUG << " constituent = " << constit_name << endmsg; - // try jet constituent ---------- - /* Analysis::JetConstituent * jconstit = dynamic_cast<Analysis::JetConstituent*>(iconstit); - if( jconstit ){ - // This is copied from JetUtils/JetCaloHelper... avoid to depend on JetUtils - std::string base = "energy_"; - size_t nsample = jconstit->m_energyInSample.size(); - for(size_t c=0;c<nsample;c++){ - float e = jconstit->m_energyInSample[c]; - if(e != 0) trans->setShape(base+ calosampling_name[c], e ); - } - //JetCaloHelper::setEnergyInSampling(trans, (CaloSampling::CaloSample)c, jconstit->m_energyInSample[c]); - - delete jconstit; - continue; - } - // try track constituent ---------- - Analysis::TrackConstituents * tkconst = dynamic_cast<Analysis::TrackConstituents*>(iconstit); - if(tkconst){ - msg << MSG::DEBUG << " has track constituent "<< constit_name << endmsg; - Analysis::TrackAssociation * tassoc = new Analysis::TrackAssociation( constit_name); - Analysis::TrackConstituents::object_iter it = tkconst->begin(); - Analysis::TrackConstituents::object_iter itE = tkconst->end(); - for(; it !=itE ; ++it){ - tassoc->set_track( tkconst->getContainer(it), *it); - } - trans->setAssociation(tassoc); - delete tkconst; - continue; - } - - // try electron constituent ---------- - Analysis::ElectronConstituent * elconst = dynamic_cast<Analysis::ElectronConstituent*>(iconstit); - if(elconst){ - msg << MSG::DEBUG << " has electron constituent "<< constit_name << endmsg; - Analysis::ElectronAssociation * tassoc = new Analysis::ElectronAssociation( constit_name); - Analysis::ElectronConstituent::object_iter it = elconst->begin(); - Analysis::ElectronConstituent::object_iter itE = elconst->end(); - for(; it !=itE ; ++it){ - tassoc->set_electron( elconst->getContainer(it), *it); - } - trans->setAssociation(tassoc); - delete elconst; - continue; - } - - // try muon constituent ---------- - Analysis::MuonConstituent * muconst = dynamic_cast<Analysis::MuonConstituent*>(iconstit); - if(muconst){ - msg << MSG::DEBUG << " has electron constituent "<< constit_name << endmsg; - Analysis::MuonAssociation * tassoc = new Analysis::MuonAssociation( constit_name); - Analysis::MuonConstituent::object_iter it = muconst->begin(); - Analysis::MuonConstituent::object_iter itE = muconst->end(); - for(; it !=itE ; ++it){ - tassoc->set_muon( muconst->getContainer(it), *it); - } - trans->setAssociation(tassoc); - delete muconst; - continue; - } - */ delete iconstit; } - //pers->m_constituents.clear(); const_cast<ParticleJet_p1*>(pers)->m_tagJetInfo.clear(); const_cast<ParticleJet_p1*>(pers)->m_constituents.clear(); - // msg << MSG::DEBUG << "Loaded ParticleJet from persistent state [OK]" - // << endmsg; + return; } @@ -193,9 +126,6 @@ ParticleJetCnv_p1::transToPers( const Jet* /*trans*/, msg << MSG::ERROR << "Creating persistent state of ParticleJet... This should not happen anymore" << endmsg; - // base classes - - // msg << MSG::DEBUG << "Created persistent state of ParticleJet [OK]" - // << endmsg; + return; } diff --git a/Reconstruction/Jet/JetMonitoring/python/HIJetMonitoringHistos.py b/Reconstruction/Jet/JetMonitoring/python/HIJetMonitoringHistos.py index 1d8b25b204ee03ae179c809c62e69d0677395f28..2f2ab08e1068b737f5496bd12070ca278dbc68bb 100644 --- a/Reconstruction/Jet/JetMonitoring/python/HIJetMonitoringHistos.py +++ b/Reconstruction/Jet/JetMonitoring/python/HIJetMonitoringHistos.py @@ -134,14 +134,14 @@ if monitorTracks : #cbg athenaMonTool.FilterTools += [ monbadlb ] -ToolSvc += athenaMonTool +#ToolSvc += athenaMonTool athenaMonTool_LB = JetMonitoringTool("JetMonitoring_LB", HistoTools = [ "ptN", "Timing", "EMFrac", "HECFrac", "LArQuality", JetKinematicHistos("kinematics",PlotOccupancy=True, PlotAveragePt=True, PlotAverageE=True, PlotNJet=True) ] ,IntervalType = 2) #cbg athenaMonTool_LB.FilterTools += [ monbadlb ] -ToolSvc += athenaMonTool_LB +#ToolSvc += athenaMonTool_LB from AthenaMonitoring.DQMonFlags import DQMonFlags if DQMonFlags.useTrigger() : @@ -151,7 +151,7 @@ if DQMonFlags.useTrigger() : ] , IntervalType = 6 ) #cbg athenaMonTool_trig.FilterTools += [ monbadlb ] - ToolSvc += athenaMonTool_trig + #ToolSvc += athenaMonTool_trig athenaMonTool_trig.TrigDecisionTool = getattr(ToolSvc, DQMonFlags.nameTrigDecTool()) athenaMonTool_trig.TriggerChain = "CATEGORY_monitoring_jet" #athenaMonTool_trig.TriggerChain = "HLT_j25,HLT_j60,HLT_j200_jes_PS" diff --git a/Reconstruction/Jet/JetMonitoring/python/JetMonitoringHistos.py b/Reconstruction/Jet/JetMonitoring/python/JetMonitoringHistos.py index 73323a8781f1f6fb0c8edb7b5a378338f0e589b3..c03ca58032e4ee8c8625535b0509d91f25ec6732 100644 --- a/Reconstruction/Jet/JetMonitoring/python/JetMonitoringHistos.py +++ b/Reconstruction/Jet/JetMonitoring/python/JetMonitoringHistos.py @@ -147,14 +147,14 @@ if monitorTracks : #cbg athenaMonTool.FilterTools += [ monbadlb ] -ToolSvc += athenaMonTool +#ToolSvc += athenaMonTool athenaMonTool_LB = JetMonitoringTool("JetMonitoring_LB", HistoTools = [commonMonitoringTool_LB("AntiKt4EMTopoJets") ], IntervalType = 2) #cbg athenaMonTool_LB.FilterTools += [ monbadlb ] -ToolSvc += athenaMonTool_LB +#ToolSvc += athenaMonTool_LB from AthenaMonitoring.DQMonFlags import DQMonFlags if DQMonFlags.useTrigger() : @@ -166,7 +166,7 @@ if DQMonFlags.useTrigger() : ] , IntervalType = 6 ) #cbg athenaMonTool_trig.FilterTools += [ monbadlb ] - ToolSvc += athenaMonTool_trig + #ToolSvc += athenaMonTool_trig athenaMonTool_trig.TrigDecisionTool = getattr(ToolSvc, DQMonFlags.nameTrigDecTool()) athenaMonTool_trig.TriggerChain = "CATEGORY_monitoring_jet" #athenaMonTool_trig.TriggerChain = "HLT_j25,HLT_j60,HLT_j200_jes_PS" diff --git a/Reconstruction/Jet/JetMonitoring/share/JetMonitoring_jobOptions_standalone.py b/Reconstruction/Jet/JetMonitoring/share/JetMonitoring_jobOptions_standalone.py index 60ad559f59524300d1f127496eb706927244af52..e6a9bcd6bdb26ec3ab681cc3588647fdcba2e2c1 100644 --- a/Reconstruction/Jet/JetMonitoring/share/JetMonitoring_jobOptions_standalone.py +++ b/Reconstruction/Jet/JetMonitoring/share/JetMonitoring_jobOptions_standalone.py @@ -87,7 +87,7 @@ akt4Filler.HistoTools += [ jetMonTool = JetMonitoringTool(HistoTools = [akt4Filler]) -ToolSvc += jetMonTool +#ToolSvc += jetMonTool monMan.AthenaMonTools += [ jetMonTool ] diff --git a/Reconstruction/Jet/JetValidation/python/PhysicsValidationHistos.py b/Reconstruction/Jet/JetValidation/python/PhysicsValidationHistos.py index 4ebd9944a6e136547a2334f4b51918853028586e..039d22628a03e904b1dac7b8d2d5140634944bd1 100644 --- a/Reconstruction/Jet/JetValidation/python/PhysicsValidationHistos.py +++ b/Reconstruction/Jet/JetValidation/python/PhysicsValidationHistos.py @@ -199,7 +199,7 @@ if (isMC==False): commonPhysValTool( "AntiKt4EMPFlowJets" ), ], IntervalType=8) # 8 == HistoGroupBase::all -ToolSvc += athenaMonTool +#ToolSvc += athenaMonTool def athenaPhysValTool(): return athenaMonTool diff --git a/Reconstruction/Jet/KtJet/KtJet/KtLorentzVector.h b/Reconstruction/Jet/KtJet/KtJet/KtLorentzVector.h index 6f488d335ae42fe9446d42857ba6a86d1c713947..04d77aa51c024e53e660149cffdcf569246d0eab 100755 --- a/Reconstruction/Jet/KtJet/KtJet/KtLorentzVector.h +++ b/Reconstruction/Jet/KtJet/KtJet/KtLorentzVector.h @@ -6,7 +6,6 @@ #define KTJET_KTLORENTZVECTOR_H #include <vector> -#include <cmath> #include "KtJet/KtUtil.h" @@ -59,7 +58,7 @@ namespace KtJet { /** rapidity, only valid if haven't called other methods since last call to add() */ inline KtFloat crapidity() const; /** rapidity, only valid if haven't called other methods since last call to add() */ - KtFloat m_crapidity; + KtFloat m_crapidity{}; /** calculate rapidity */ inline void calcRapidity(); /** private method to help add constituents to vector */ diff --git a/Reconstruction/MET/METUtilities/Root/METSystematicsTool.cxx b/Reconstruction/MET/METUtilities/Root/METSystematicsTool.cxx index fe76a7722fefde9552d7bf01de642bbf8f5b635d..5a7ffa166be74c7fed9bc04fa13a63e4bae9db70 100644 --- a/Reconstruction/MET/METUtilities/Root/METSystematicsTool.cxx +++ b/Reconstruction/MET/METUtilities/Root/METSystematicsTool.cxx @@ -359,30 +359,29 @@ namespace met { if( MissingETBase::Source::isSoftTerm(met.source())){ xAOD::MissingETContainer const * METcont = dynamic_cast<xAOD::MissingETContainer const*>(met.container()); if(METcont == nullptr){ - ATH_MSG_WARNING("MissingET object not owned by a container. Unable to apply correction, returning output MET object as null" ); - outputmet = nullptr; - return CP::CorrectionCode::Error; + ATH_MSG_WARNING("MissingET object not owned by a container. Unable to apply correction, returning output MET object as null" ); + outputmet = nullptr; + return CP::CorrectionCode::Error; } copy = new xAOD::MissingET(met); if(internalSoftTermApplyCorrection(*copy, METcont, *getDefaultEventInfo()) != CP::CorrectionCode::Ok ){ - outputmet = nullptr; delete copy; - return CP::CorrectionCode::Error; + outputmet = nullptr; delete copy; + return CP::CorrectionCode::Error; } }//soft term source if( //MissingETBase::Source::isTrackTerm(met.source()) && - MissingETBase::Source::isJetTerm (met.source()) - ){ + MissingETBase::Source::isJetTerm (met.source())){ if( helper->map() == nullptr) { - ATH_MSG_WARNING("MissingETAssociationHelper contained a null MissingETAssociationMap pointer"); - outputmet = nullptr; - return CP::CorrectionCode::Error; + ATH_MSG_WARNING("MissingETAssociationHelper contained a null MissingETAssociationMap pointer"); + outputmet = nullptr; delete copy; + return CP::CorrectionCode::Error; } - + delete copy; copy = new xAOD::MissingET(met); if(getCorrectedJetTrackMET(*copy, helper) != CP::CorrectionCode::Ok){ - outputmet = nullptr; delete copy; - return CP::CorrectionCode::Error; + outputmet = nullptr; delete copy; + return CP::CorrectionCode::Error; } }//jet track term source diff --git a/Reconstruction/MissingETMonitoring/share/MissingET_Monitoring.py b/Reconstruction/MissingETMonitoring/share/MissingET_Monitoring.py index a162c61e6a2f9115a138e2afef729c016eee74b0..5c23f40643ae79fb1486df3eaaa2c39330f9e7cb 100755 --- a/Reconstruction/MissingETMonitoring/share/MissingET_Monitoring.py +++ b/Reconstruction/MissingETMonitoring/share/MissingET_Monitoring.py @@ -49,8 +49,8 @@ for trigger in triggerList: metMonTool.TriggerChain = trigger #New AthenaMonitoring filter tool to be added to filter out events in non-filled BCIDs -# metMonTool.FilterTools.append(monFilledBunchFilterTool) - metMonTool.FilterTools.append(monbadlb) +# metMonTool.FilterTools += [monFilledBunchFilterTool] + metMonTool.FilterTools += [monbadlb] if trigger != "": metMonTool.TrigDecisionTool = monTrigDecTool @@ -61,7 +61,7 @@ for trigger in triggerList: #metMonTool.doJetcleaning = False - ToolSvc += metMonTool + #ToolSvc += metMonTool monManETmiss.AthenaMonTools += [ metMonTool ] # Standard Monitoring cut80 @@ -74,8 +74,8 @@ for trigger in triggerList: # metMonTool.doMetCut80 = True # metMonTool.metCut = 10 # #New AthenaMonitoring filter tool to be added to filter out events in non-filled BCIDs - # metMonTool.FilterTools.append(monFilledBunchFilterTool) -# metMonTool.FilterTools.append(monbadlb) + # metMonTool.FilterTools += [monFilledBunchFilterTool] +# metMonTool.FilterTools += [monbadlb] # if trigger != "": # metMonTool.TrigDecisionTool = monTrigDecTool @@ -100,8 +100,8 @@ for trigger in triggerList: metMonTool.muoColKey = "" metMonTool.jetColKey = "AntiKt4LCTopoJets" metMonTool.TriggerChain = trigger -# metMonTool.FilterTools.append(monFilledBunchFilterTool) - metMonTool.FilterTools.append(monbadlb) +# metMonTool.FilterTools += [monFilledBunchFilterTool] + metMonTool.FilterTools += [monbadlb] metMonTool.JetSelectorTool = cleaningTool metMonTool.badJets = True if trigger != "": @@ -110,7 +110,7 @@ for trigger in triggerList: #metMonTool.eleColKey = "ElectronAODCollection" #Uncomment to avoid the jet cleaning #metMonTool.doJetcleaning = False - ToolSvc += metMonTool + #ToolSvc += metMonTool monManETmiss.AthenaMonTools += [ metMonTool ] @@ -126,11 +126,11 @@ for trigger in triggerList: metMonTool.eleColKey = "" metMonTool.muoColKey = "" metMonTool.TriggerChain = trigger -# metMonTool.FilterTools.append(monFilledBunchFilterTool) - metMonTool.FilterTools.append(monbadlb) +# metMonTool.FilterTools += [monFilledBunchFilterTool] + metMonTool.FilterTools += [monbadlb] if trigger != "": metMonTool.TrigDecisionTool = monTrigDecTool - ToolSvc += metMonTool + #ToolSvc += metMonTool monManETmiss.AthenaMonTools += [ metMonTool ] # Tool for refined MET monitoring @@ -145,11 +145,11 @@ for trigger in triggerList: metMonTool.eleColKey = "" metMonTool.muoColKey = "" metMonTool.TriggerChain = trigger -# metMonTool.FilterTools.append(monFilledBunchFilterTool) - metMonTool.FilterTools.append(monbadlb) +# metMonTool.FilterTools += [monFilledBunchFilterTool] + metMonTool.FilterTools += [monbadlb] if trigger != "": metMonTool.TrigDecisionTool = monTrigDecTool - ToolSvc += metMonTool + #ToolSvc += metMonTool monManETmiss.AthenaMonTools += [ metMonTool ] # Tool for PFlow MET monitoring @@ -164,11 +164,11 @@ for trigger in triggerList: metMonTool.eleColKey = "" metMonTool.muoColKey = "" metMonTool.TriggerChain = trigger -# metMonTool.FilterTools.append(monFilledBunchFilterTool) - metMonTool.FilterTools.append(monbadlb) +# metMonTool.FilterTools += [monFilledBunchFilterTool] + metMonTool.FilterTools += [monbadlb] if trigger != "": metMonTool.TrigDecisionTool = monTrigDecTool - ToolSvc += metMonTool + #ToolSvc += metMonTool monManETmiss.AthenaMonTools += [ metMonTool ] @@ -188,11 +188,11 @@ for trigger in triggerList: metMonTool.doJetcleaning = True metMonTool.JetSelectorTool = cleaningTool metMonTool.TriggerChain = trigger -# metMonTool.FilterTools.append(monFilledBunchFilterTool) - metMonTool.FilterTools.append(monbadlb) +# metMonTool.FilterTools += [monFilledBunchFilterTool] + metMonTool.FilterTools += [monbadlb] if trigger != "": metMonTool.TrigDecisionTool = monTrigDecTool - ToolSvc += metMonTool + #ToolSvc += metMonTool monManETmiss.AthenaMonTools += [ metMonTool ] # Tool for calorimetric MET monitoring (TopoCluster) @@ -209,11 +209,11 @@ for trigger in triggerList: metMonTool.doJetcleaning = True metMonTool.JetSelectorTool = cleaningTool metMonTool.TriggerChain = trigger -# metMonTool.FilterTools.append(monFilledBunchFilterTool) - metMonTool.FilterTools.append(monbadlb) +# metMonTool.FilterTools += [monFilledBunchFilterTool] + metMonTool.FilterTools += [monbadlb] if trigger != "": metMonTool.TrigDecisionTool = monTrigDecTool - ToolSvc += metMonTool + #ToolSvc += metMonTool monManETmiss.AthenaMonTools += [ metMonTool ] @@ -231,11 +231,11 @@ for trigger in triggerList: metMonTool.doJetcleaning = True metMonTool.JetSelectorTool = cleaningTool metMonTool.TriggerChain = trigger -# metMonTool.FilterTools.append(monFilledBunchFilterTool) - metMonTool.FilterTools.append(monbadlb) +# metMonTool.FilterTools += [monFilledBunchFilterTool] + metMonTool.FilterTools += [monbadlb] if trigger != "": metMonTool.TrigDecisionTool = monTrigDecTool - ToolSvc += metMonTool + #ToolSvc += metMonTool monManETmiss.AthenaMonTools += [ metMonTool ] @@ -254,11 +254,11 @@ metMonTool.muoColKey = "" metMonTool.doMetCut80 = True metMonTool.metCut = 80.0 # metMonTool.TriggerChain = trigger -# metMonTool.FilterTools.append(monFilledBunchFilterTool) -metMonTool.FilterTools.append(monbadlb) +# metMonTool.FilterTools += [monFilledBunchFilterTool] +metMonTool.FilterTools += [monbadlb] if trigger != "": metMonTool.TrigDecisionTool = monTrigDecTool -ToolSvc += metMonTool +#ToolSvc += metMonTool monManETmiss.AthenaMonTools += [ metMonTool ] @@ -274,11 +274,11 @@ metMonTool.muoColKey = "" metMonTool.doMetCut80 = True metMonTool.metCut = 80.0 #metMonTool.TriggerChain = trigger -metMonTool.FilterTools.append(monFilledBunchFilterTool) -metMonTool.FilterTools.append(monbadlb) +metMonTool.FilterTools += [monFilledBunchFilterTool] +metMonTool.FilterTools += [monbadlb] if trigger != "": metMonTool.TrigDecisionTool = monTrigDecTool -ToolSvc += metMonTool +#ToolSvc += metMonTool monManETmiss.AthenaMonTools += [ metMonTool ] @@ -308,7 +308,7 @@ metMonTool.FillNegativeSumEt = True metMonTool.TriggerChain = trigger if trigger != "": metMonTool.TrigDecisionTool = monTrigDecTool -ToolSvc += metMonTool +#ToolSvc += metMonTool monManETmiss.AthenaMonTools += [ metMonTool ] @@ -332,7 +332,7 @@ metMonTool.FillNegativeSumEt = True #metMonTool.TriggerChain = trigger #if trigger != "": # metMonTool.TrigDecisionTool = monTrigDecTool -ToolSvc += metMonTool +#ToolSvc += metMonTool monManETmiss.AthenaMonTools += [ metMonTool ] diff --git a/Reconstruction/MuonIdentification/MuGirl/src/MuGirlRecoTool.cxx b/Reconstruction/MuonIdentification/MuGirl/src/MuGirlRecoTool.cxx index f6d27efcb4e209d2187b9ce691915482aac0d994..c245cf23910c732ced5a59c7e7702b2260f9f436 100644 --- a/Reconstruction/MuonIdentification/MuGirl/src/MuGirlRecoTool.cxx +++ b/Reconstruction/MuonIdentification/MuGirl/src/MuGirlRecoTool.cxx @@ -1,6 +1,6 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration -*/ + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + */ #include <iostream> #include <iomanip> @@ -37,971 +37,956 @@ using namespace MuGirlNS; using namespace std; MuGirlRecoTool::MuGirlRecoTool(const std::string& type, const std::string& name, const IInterface* parent) : -AthAlgTool(type, name, parent), -m_applyLHR("On"), -m_pSegmentManager(0), -m_pClusCollection(0), -m_pCandNTuple(0), -m_doLHR(true), -m_doANNSelection(true), -m_doGlobalFit(true), -m_doStau(true), -m_doRH(false), -m_doSAFit(true), -m_doHoughTransform(false), -m_doNTuple(false), -m_doTruth(false), -m_ptLowerLimit(3000.0), -m_stauPtCut(30000.0), -m_defaultLHR(0.85), -m_ntupleName("/NTUPLES/MUGIRL/MUGIRL"), -m_ntupleTitle("Muon Candidates"), -m_CaloCollection("CaloCalTopoCluster"), -m_pCandidate("MuGirlNS::CandidateTool"), -m_pTruthTool("MuGirlNS::PerformanceTruthTool", 0), // this is a public tool -m_pGlobalFitTool("MuGirlNS::GlobalFitTool", 0), // this is a public tool -m_pANNSelectionTool("MuGirlNS::ANNSelectionTool", 0), // this is a public tool -m_pParticleCreatorTool("MuGirlNS::MuGirlParticleCreatorTool", 0), // this is a public tool // use this ?? -m_pStauTool("MuGirlNS::StauTool", 0), // this is a public tool -m_pMuLHR("CaloMuonLikelihoodTool"), -m_pMuonLayerHoughTool("Muon::MuonLayerHoughTool/MuonLayerHoughTool"), -m_MuonIdHelperTool("Muon::MuonIdHelperTool/MuonIdHelperTool"), -m_caloExtensionTool("Trk::ParticleCaloExtensionTool/ParticleCaloExtensionTool"), -m_magFieldSvc("MagField::AtlasFieldSvc/AtlasFieldSvc", name) -{ - - declareInterface<MuGirlNS::IMuGirlRecoTool>(this); - - // Steering properties - declareProperty("doLHR", m_doLHR); - declareProperty("doANNSelection", m_doANNSelection); - declareProperty("doGlobalFit", m_doGlobalFit); - declareProperty("doNTuple", m_doNTuple); - declareProperty("doStau", m_doStau); - declareProperty("doRH", m_doRH); - declareProperty("doSAFit", m_doSAFit); - declareProperty("doTruth", m_doTruth); - declareProperty("doHoughTransform", m_doHoughTransform); - - // Variables and threshold cuts - declareProperty("PtLowerLimit", m_ptLowerLimit); - declareProperty("StauPtCut", m_stauPtCut); - declareProperty("DefaultLHR", m_defaultLHR); - - // Container and collection names - declareProperty("NtupleName", m_ntupleName); - declareProperty("NtupleTitle", m_ntupleTitle); - declareProperty("InCaloCollection", m_CaloCollection); - - // Tools - declareProperty("MuGirlCandidate", m_pCandidate); - declareProperty("PerformanceTruthTool", m_pTruthTool); - declareProperty("MuGirlGlobalFitTool", m_pGlobalFitTool); - declareProperty("ANNSelectionTool", m_pANNSelectionTool); - declareProperty("MuGirlParticleCreatorTool", m_pParticleCreatorTool); - declareProperty("MuGirlStauTool", m_pStauTool); - declareProperty("CaloMuonLikelihoodTool", m_pMuLHR); - declareProperty("MuonLayerHoughTool", m_pMuonLayerHoughTool); - declareProperty("ParticleCaloExtensionTool", m_caloExtensionTool); + AthAlgTool(type, name, parent), + m_applyLHR("On"), + m_pSegmentManager(0), + m_pClusCollection(0), + m_pCandNTuple(0), + m_doLHR(true), + m_doANNSelection(true), + m_doGlobalFit(true), + m_doStau(true), + m_doRH(false), + m_doSAFit(true), + m_doHoughTransform(false), + m_doNTuple(false), + m_doTruth(false), + m_ptLowerLimit(3000.0), + m_stauPtCut(30000.0), + m_defaultLHR(0.85), + m_ntupleName("/NTUPLES/MUGIRL/MUGIRL"), + m_ntupleTitle("Muon Candidates"), + m_CaloCollection("CaloCalTopoCluster"), + m_pCandidate("MuGirlNS::CandidateTool"), + m_pTruthTool("MuGirlNS::PerformanceTruthTool", 0), // this is a public tool + m_pGlobalFitTool("MuGirlNS::GlobalFitTool", 0), // this is a public tool + m_pANNSelectionTool("MuGirlNS::ANNSelectionTool", 0), // this is a public tool + m_pParticleCreatorTool("MuGirlNS::MuGirlParticleCreatorTool", 0), // this is a public tool // use this ?? + m_pStauTool("MuGirlNS::StauTool", 0), // this is a public tool + m_pMuLHR("CaloMuonLikelihoodTool"), + m_pMuonLayerHoughTool("Muon::MuonLayerHoughTool/MuonLayerHoughTool"), + m_MuonIdHelperTool("Muon::MuonIdHelperTool/MuonIdHelperTool"), + m_caloExtensionTool("Trk::ParticleCaloExtensionTool/ParticleCaloExtensionTool"), + m_magFieldSvc("MagField::AtlasFieldSvc/AtlasFieldSvc", name) { + declareInterface<MuGirlNS::IMuGirlRecoTool>(this); + + // Steering properties + declareProperty("doLHR", m_doLHR); + declareProperty("doANNSelection", m_doANNSelection); + declareProperty("doGlobalFit", m_doGlobalFit); + declareProperty("doNTuple", m_doNTuple); + declareProperty("doStau", m_doStau); + declareProperty("doRH", m_doRH); + declareProperty("doSAFit", m_doSAFit); + declareProperty("doTruth", m_doTruth); + declareProperty("doHoughTransform", m_doHoughTransform); + + // Variables and threshold cuts + declareProperty("PtLowerLimit", m_ptLowerLimit); + declareProperty("StauPtCut", m_stauPtCut); + declareProperty("DefaultLHR", m_defaultLHR); + + // Container and collection names + declareProperty("NtupleName", m_ntupleName); + declareProperty("NtupleTitle", m_ntupleTitle); + declareProperty("InCaloCollection", m_CaloCollection); + + // Tools + declareProperty("MuGirlCandidate", m_pCandidate); + declareProperty("PerformanceTruthTool", m_pTruthTool); + declareProperty("MuGirlGlobalFitTool", m_pGlobalFitTool); + declareProperty("ANNSelectionTool", m_pANNSelectionTool); + declareProperty("MuGirlParticleCreatorTool", m_pParticleCreatorTool); + declareProperty("MuGirlStauTool", m_pStauTool); + declareProperty("CaloMuonLikelihoodTool", m_pMuLHR); + declareProperty("MuonLayerHoughTool", m_pMuonLayerHoughTool); + declareProperty("ParticleCaloExtensionTool", m_caloExtensionTool); } -MuGirlRecoTool::~MuGirlRecoTool() -{ - delete m_pSegmentManager; +MuGirlRecoTool::~MuGirlRecoTool() { + delete m_pSegmentManager; } void -MuGirlRecoTool::print_configuration() const -{ - ATH_MSG_INFO("MuGirlReco Steering configuration:"); - ATH_MSG_INFO(setw(32) << setfill('.') << setiosflags(ios::left) << m_doLHR.name() << m_doLHR.value()); - ATH_MSG_INFO(setw(32) << setfill('.') << setiosflags(ios::left) << m_doANNSelection.name() << m_doANNSelection.value()); - ATH_MSG_INFO(setw(32) << setfill('.') << setiosflags(ios::left) << m_doGlobalFit.name() << m_doGlobalFit.value()); - ATH_MSG_INFO(setw(32) << setfill('.') << setiosflags(ios::left) << m_doNTuple.name() << m_doNTuple.value()); - ATH_MSG_INFO(setw(32) << setfill('.') << setiosflags(ios::left) << m_doStau.name() << m_doStau.value()); - ATH_MSG_INFO(setw(32) << setfill('.') << setiosflags(ios::left) << m_doRH.name() << m_doRH.value()); - ATH_MSG_INFO(setw(32) << setfill('.') << setiosflags(ios::left) << m_doSAFit.name() << m_doSAFit.value()); - ATH_MSG_INFO(setw(32) << setfill('.') << setiosflags(ios::left) << m_doTruth.name() << m_doTruth.value()); - ATH_MSG_INFO(setw(32) << setfill('.') << setiosflags(ios::left) << m_doHoughTransform.name() << m_doHoughTransform.value()); - ATH_MSG_INFO("Thresholds and cuts configuration:"); - ATH_MSG_INFO(setw(32) << setfill('.') << setiosflags(ios::left) << m_ptLowerLimit.name() << m_ptLowerLimit.value()); - ATH_MSG_INFO(setw(32) << setfill('.') << setiosflags(ios::left) << m_stauPtCut.name() << m_stauPtCut.value()); - ATH_MSG_INFO("Containers and Collections name:"); - ATH_MSG_INFO(setw(32) << setfill('.') << setiosflags(ios::left) << m_ntupleName.name() << m_ntupleName.value()); - ATH_MSG_INFO(setw(32) << setfill('.') << setiosflags(ios::left) << m_ntupleTitle.name() << m_ntupleTitle.value()); - ATH_MSG_INFO(setw(32) << setfill('.') << setiosflags(ios::left) << m_CaloCollection.name() << m_CaloCollection.value()); - ATH_MSG_INFO("Tools:"); - ATH_MSG_INFO(setw(32) << setfill('.') << setiosflags(ios::left) << m_pCandidate.name() << m_pCandidate); - ATH_MSG_INFO(setw(32) << setfill('.') << setiosflags(ios::left) << m_pTruthTool.name() << m_pTruthTool); - ATH_MSG_INFO(setw(32) << setfill('.') << setiosflags(ios::left) << m_pGlobalFitTool.name() << m_pGlobalFitTool); - ATH_MSG_INFO(setw(32) << setfill('.') << setiosflags(ios::left) << m_pANNSelectionTool.name() << m_pANNSelectionTool); - ATH_MSG_INFO(setw(32) << setfill('.') << setiosflags(ios::left) << m_pParticleCreatorTool.name() << m_pParticleCreatorTool); - ATH_MSG_INFO(setw(32) << setfill('.') << setiosflags(ios::left) << m_pStauTool.name() << m_pStauTool); - ATH_MSG_INFO(setw(32) << setfill('.') << setiosflags(ios::left) << m_pMuLHR.name() << m_pMuLHR); - ATH_MSG_INFO(setw(32) << setfill('.') << setiosflags(ios::left) << m_pMuonLayerHoughTool.name() << m_pMuonLayerHoughTool); +MuGirlRecoTool::print_configuration() const { + ATH_MSG_INFO("MuGirlReco Steering configuration:"); + ATH_MSG_INFO(setw(32) << setfill('.') << setiosflags(ios::left) << m_doLHR.name() << m_doLHR.value()); + ATH_MSG_INFO(setw(32) << setfill('.') << setiosflags(ios::left) << m_doANNSelection.name() << + m_doANNSelection.value()); + ATH_MSG_INFO(setw(32) << setfill('.') << setiosflags(ios::left) << m_doGlobalFit.name() << m_doGlobalFit.value()); + ATH_MSG_INFO(setw(32) << setfill('.') << setiosflags(ios::left) << m_doNTuple.name() << m_doNTuple.value()); + ATH_MSG_INFO(setw(32) << setfill('.') << setiosflags(ios::left) << m_doStau.name() << m_doStau.value()); + ATH_MSG_INFO(setw(32) << setfill('.') << setiosflags(ios::left) << m_doRH.name() << m_doRH.value()); + ATH_MSG_INFO(setw(32) << setfill('.') << setiosflags(ios::left) << m_doSAFit.name() << m_doSAFit.value()); + ATH_MSG_INFO(setw(32) << setfill('.') << setiosflags(ios::left) << m_doTruth.name() << m_doTruth.value()); + ATH_MSG_INFO(setw(32) << setfill('.') << setiosflags( + ios::left) << m_doHoughTransform.name() << m_doHoughTransform.value()); + ATH_MSG_INFO("Thresholds and cuts configuration:"); + ATH_MSG_INFO(setw(32) << setfill('.') << setiosflags(ios::left) << m_ptLowerLimit.name() << m_ptLowerLimit.value()); + ATH_MSG_INFO(setw(32) << setfill('.') << setiosflags(ios::left) << m_stauPtCut.name() << m_stauPtCut.value()); + ATH_MSG_INFO("Containers and Collections name:"); + ATH_MSG_INFO(setw(32) << setfill('.') << setiosflags(ios::left) << m_ntupleName.name() << m_ntupleName.value()); + ATH_MSG_INFO(setw(32) << setfill('.') << setiosflags(ios::left) << m_ntupleTitle.name() << m_ntupleTitle.value()); + ATH_MSG_INFO(setw(32) << setfill('.') << setiosflags(ios::left) << m_CaloCollection.name() << + m_CaloCollection.value()); + ATH_MSG_INFO("Tools:"); + ATH_MSG_INFO(setw(32) << setfill('.') << setiosflags(ios::left) << m_pCandidate.name() << m_pCandidate); + ATH_MSG_INFO(setw(32) << setfill('.') << setiosflags(ios::left) << m_pTruthTool.name() << m_pTruthTool); + ATH_MSG_INFO(setw(32) << setfill('.') << setiosflags(ios::left) << m_pGlobalFitTool.name() << m_pGlobalFitTool); + ATH_MSG_INFO(setw(32) << setfill('.') << setiosflags(ios::left) << m_pANNSelectionTool.name() << m_pANNSelectionTool); + ATH_MSG_INFO(setw(32) << setfill('.') << setiosflags( + ios::left) << m_pParticleCreatorTool.name() << m_pParticleCreatorTool); + ATH_MSG_INFO(setw(32) << setfill('.') << setiosflags(ios::left) << m_pStauTool.name() << m_pStauTool); + ATH_MSG_INFO(setw(32) << setfill('.') << setiosflags(ios::left) << m_pMuLHR.name() << m_pMuLHR); + ATH_MSG_INFO(setw(32) << setfill('.') << setiosflags( + ios::left) << m_pMuonLayerHoughTool.name() << m_pMuonLayerHoughTool); } -StatusCode MuGirlRecoTool::initialize() -{ +StatusCode MuGirlRecoTool::initialize() { + ATH_MSG_INFO("Initializing MuGirlRecoTool - package version " << PACKAGE_VERSION); + print_configuration(); - ATH_MSG_INFO("Initializing MuGirlRecoTool - package version " << PACKAGE_VERSION); - print_configuration(); + m_pSegmentManager = new MuGirlNS::SegmentManager; - m_pSegmentManager = new MuGirlNS::SegmentManager; + // Initialize tools + ATH_CHECK(m_pTruthTool.retrieve()); + if (m_doLHR) ATH_CHECK(m_pMuLHR.retrieve()); + ATH_CHECK(m_pGlobalFitTool.retrieve()); + ATH_CHECK(m_pANNSelectionTool.retrieve()); + ATH_CHECK(m_pParticleCreatorTool.retrieve()); - // Initialize tools - ATH_CHECK(m_pTruthTool.retrieve()); - if( m_doLHR ) ATH_CHECK(m_pMuLHR.retrieve()); - ATH_CHECK(m_pGlobalFitTool.retrieve()); - ATH_CHECK(m_pANNSelectionTool.retrieve()); - ATH_CHECK(m_pParticleCreatorTool.retrieve()); + if (m_doStau) { + ATH_CHECK(m_pStauTool.retrieve()); + m_pStauTool->setSegmentManager(m_pSegmentManager); + m_pStauTool->initTool(m_doGlobalFit); + if (m_doSAFit) m_pStauTool->initTool(m_doSAFit); + } - if (m_doStau) { - ATH_CHECK(m_pStauTool.retrieve()); - m_pStauTool->setSegmentManager(m_pSegmentManager); - m_pStauTool->initTool(m_doGlobalFit); - if (m_doSAFit) m_pStauTool->initTool(m_doSAFit); - } + if (m_pCandidate.retrieve().isFailure()) return StatusCode::RECOVERABLE; - if (m_pCandidate.retrieve().isFailure()) - return StatusCode::RECOVERABLE; - m_pCandidate->setSegmentManager(m_pSegmentManager); - - // Initialize NTuple - if (m_doNTuple) { - ServiceHandle<INTupleSvc> ntupleSvc("NTupleSvc/NTupleSvc", this->name()); - if (ntupleSvc.retrieve().isFailure()) { - ATH_MSG_WARNING("initialize: cannot retrieve the NTuple Svc. MUgirlNTuple will not be initialized!"); - } else { - m_pCandNTuple = ntupleSvc->book(m_ntupleName, CLID_ColumnWiseTuple, m_ntupleTitle); - if (m_pCandNTuple == NULL) { - ATH_MSG_ERROR("initialize: could not create NTuple " << m_ntupleName); - return StatusCode::RECOVERABLE; - } - if (m_pCandidate->bookNTuple(m_pCandNTuple).isFailure()) { - ATH_MSG_ERROR("initialize: could not book Candidate NTuple " << m_ntupleName); - return StatusCode::RECOVERABLE; - } - - if (m_doTruth && m_pTruthTool->bookNTuple(m_pCandNTuple).isFailure()) { - ATH_MSG_ERROR("initialize: could not book Truth NTuple " << m_ntupleName); - return StatusCode::RECOVERABLE; - } - if (m_doGlobalFit && m_pGlobalFitTool->bookNTuple(m_pCandNTuple, "").isFailure()) { - ATH_MSG_ERROR("initialize: could not book GlobalFit NTuple " << m_ntupleName); - return StatusCode::RECOVERABLE; - } - if (m_doStau) { - if (m_pStauTool->bookNTuple(m_pCandNTuple).isFailure()) { - ATH_MSG_ERROR("initialize: could not book Stau NTuple " << m_ntupleName); - return StatusCode::RECOVERABLE; - } - } - } // end of ntuple booking - } // end of NTuple initialization + m_pCandidate->setSegmentManager(m_pSegmentManager); - if (m_magFieldSvc.retrieve().isFailure()) { - ATH_MSG_ERROR("initialize: could not retrieve magFieldSvc"); + // Initialize NTuple + if (m_doNTuple) { + ServiceHandle<INTupleSvc> ntupleSvc("NTupleSvc/NTupleSvc", this->name()); + if (ntupleSvc.retrieve().isFailure()) { + ATH_MSG_WARNING("initialize: cannot retrieve the NTuple Svc. MUgirlNTuple will not be initialized!"); + } else { + m_pCandNTuple = ntupleSvc->book(m_ntupleName, CLID_ColumnWiseTuple, m_ntupleTitle); + if (m_pCandNTuple == NULL) { + ATH_MSG_ERROR("initialize: could not create NTuple " << m_ntupleName); return StatusCode::RECOVERABLE; - } - - if (m_doHoughTransform) { - if (m_pMuonLayerHoughTool.retrieve().isFailure()) { - ATH_MSG_WARNING("initialize: could not retrieve the MuonLayerHoughTool"); - ATH_MSG_WARNING("initialize: info from the Hough transform will not be in the MuGirl ntuple"); - return StatusCode::RECOVERABLE; - } else { - ATH_MSG_INFO("MuonLayerHoughTool successfully retrieved"); - } - } - - if (m_MuonIdHelperTool.retrieve().isFailure()) { - ATH_MSG_WARNING("initialize: failed to retrieve tool " << m_MuonIdHelperTool); + } + if (m_pCandidate->bookNTuple(m_pCandNTuple).isFailure()) { + ATH_MSG_ERROR("initialize: could not book Candidate NTuple " << m_ntupleName); return StatusCode::RECOVERABLE; - } - ATH_MSG_INFO("Retrieved tool " << m_MuonIdHelperTool); - - InterfaceID id = IMuGirlRecoTool::interfaceID(); + } - ATH_MSG_INFO("Interface id=" << id.id() << ", majorVersion=" << id.majorVersion() << ", minorVersion=" << id.minorVersion()); + if (m_doTruth && m_pTruthTool->bookNTuple(m_pCandNTuple).isFailure()) { + ATH_MSG_ERROR("initialize: could not book Truth NTuple " << m_ntupleName); + return StatusCode::RECOVERABLE; + } + if (m_doGlobalFit && m_pGlobalFitTool->bookNTuple(m_pCandNTuple, "").isFailure()) { + ATH_MSG_ERROR("initialize: could not book GlobalFit NTuple " << m_ntupleName); + return StatusCode::RECOVERABLE; + } + if (m_doStau) { + if (m_pStauTool->bookNTuple(m_pCandNTuple).isFailure()) { + ATH_MSG_ERROR("initialize: could not book Stau NTuple " << m_ntupleName); + return StatusCode::RECOVERABLE; + } + } + } // end of ntuple booking + } // end of NTuple initialization - this->clear_hough_data(); + if (m_magFieldSvc.retrieve().isFailure()) { + ATH_MSG_ERROR("initialize: could not retrieve magFieldSvc"); + return StatusCode::RECOVERABLE; + } - if (!m_caloExtensionTool.empty()) ATH_CHECK(m_caloExtensionTool.retrieve()); + if (m_doHoughTransform) { + if (m_pMuonLayerHoughTool.retrieve().isFailure()) { + ATH_MSG_WARNING("initialize: could not retrieve the MuonLayerHoughTool"); + ATH_MSG_WARNING("initialize: info from the Hough transform will not be in the MuGirl ntuple"); + return StatusCode::RECOVERABLE; + } else { + ATH_MSG_INFO("MuonLayerHoughTool successfully retrieved"); + } + } - ATH_MSG_INFO("MuGirlrecoTool initialized successfully"); + if (m_MuonIdHelperTool.retrieve().isFailure()) { + ATH_MSG_WARNING("initialize: failed to retrieve tool " << m_MuonIdHelperTool); + return StatusCode::RECOVERABLE; + } + ATH_MSG_INFO("Retrieved tool " << m_MuonIdHelperTool); - return StatusCode::SUCCESS; -} + InterfaceID id = IMuGirlRecoTool::interfaceID(); -StatusCode MuGirlRecoTool::MuGirlReco(const InDetCandidateCollection& InDetSeeds) -{ + ATH_MSG_INFO( + "Interface id=" << id.id() << ", majorVersion=" << id.majorVersion() << ", minorVersion=" << id.minorVersion()); - ATH_MSG_DEBUG("MuGirlReco( .. ) executing."); + this->clear_hough_data(); - /** Terminate the processing if the Solenoid is off */ - if (!m_magFieldSvc->solenoidOn()) { - ATH_MSG_DEBUG("Solenoid is off: Execute done"); - return StatusCode::SUCCESS; - } + if (!m_caloExtensionTool.empty()) ATH_CHECK(m_caloExtensionTool.retrieve()); - /** Hough Data processing */ - if (m_doHoughTransform && this->processHoughData().isFailure()) { - ATH_MSG_INFO("Hough data cannot be processed successfully, cleaning Hough data structure ...."); - this->clear_hough_data(); - } + ATH_MSG_INFO("MuGirlrecoTool initialized successfully"); - /** Retrieve the CaloCluster container */ - if (evtStore()->contains<xAOD::CaloClusterContainer>(m_CaloCollection)) { - if (evtStore()->retrieve(m_pClusCollection, m_CaloCollection).isFailure() || m_pClusCollection == NULL) { - ATH_MSG_WARNING("MuGirlReco: cannot retrieve ClusterContainer"); - } else - ATH_MSG_DEBUG("Calo Collection Size: " << m_pClusCollection->size()); - } + return StatusCode::SUCCESS; +} +StatusCode MuGirlRecoTool::MuGirlReco(const InDetCandidateCollection& InDetSeeds) { + ATH_MSG_DEBUG("MuGirlReco( .. ) executing."); - /** Create the CaloParticles */ - if (msgLvl(MSG::DEBUG)) listTrackParticles(InDetSeeds); + /** Terminate the processing if the Solenoid is off */ + if (!m_magFieldSvc->solenoidOn()) { + ATH_MSG_DEBUG("Solenoid is off: Execute done"); + return StatusCode::SUCCESS; + } - Amg::Vector3D pt_calo_local(0, 0, 0); - int iPart = 0; - for (InDetCandidateCollection::const_iterator ipIt = InDetSeeds.begin(); - ipIt != InDetSeeds.end(); - ++ipIt, iPart++) { - const xAOD::TrackParticle& tp_id = (*ipIt)->indetTrackParticle(); - const Trk::Perigee& pPerigee = tp_id.perigeeParameters(); + /** Hough Data processing */ + if (m_doHoughTransform && this->processHoughData().isFailure()) { + ATH_MSG_INFO("Hough data cannot be processed successfully, cleaning Hough data structure ...."); + this->clear_hough_data(); + } - /** - * Check also the track pt as the pt cut of the TrackSelectorTool may be different. - */ - double pt = pPerigee.pT(); - if (pt < m_ptLowerLimit) { - ATH_MSG_DEBUG("pT=" << pt << " is lower than limit = " << m_ptLowerLimit << ". Skipping track."); - continue; - } + /** Retrieve the CaloCluster container */ + if (evtStore()->contains<xAOD::CaloClusterContainer>(m_CaloCollection)) { + if (evtStore()->retrieve(m_pClusCollection, m_CaloCollection).isFailure() || m_pClusCollection == NULL) { + ATH_MSG_WARNING("MuGirlReco: cannot retrieve ClusterContainer"); + } else ATH_MSG_DEBUG("Calo Collection Size: " << m_pClusCollection->size()); + } - const Trk::TrackParameters* extrParameters = NULL; - /** - get the extrapolation to the MS entry - */ - - if (m_caloExtensionTool.empty()) {continue;} - - std::unique_ptr<Trk::CaloExtension> extension = m_caloExtensionTool->caloExtension(tp_id); - if (!extension) {continue;} - if (!extension->muonEntryLayerIntersection() && extension->caloLayerIntersections().empty()) continue; - - ATH_MSG_DEBUG("Seen by calo"); - - // if available use muon entry intersection - if (extension->muonEntryLayerIntersection()) { - extrParameters = extension->muonEntryLayerIntersection(); - pt_calo_local = extrParameters->position(); - } else { - // use last calo layer - pt_calo_local = extension->caloLayerIntersections().back()->position(); - } + /** Create the CaloParticles */ + if (msgLvl(MSG::DEBUG)) listTrackParticles(InDetSeeds); - ATH_MSG_DEBUG("CaloExtensionTool: pt_calo_local " << pt_calo_local.x() << ", z=" << pt_calo_local.z()); + Amg::Vector3D pt_calo_local(0, 0, 0); + int iPart = 0; + for (InDetCandidateCollection::const_iterator ipIt = InDetSeeds.begin(); + ipIt != InDetSeeds.end(); + ++ipIt, iPart++) { + const xAOD::TrackParticle& tp_id = (*ipIt)->indetTrackParticle(); + const Trk::Perigee& pPerigee = tp_id.perigeeParameters(); - // FIXME: const_cast - CaloParticle* pParticle = new CaloParticle(const_cast<MuonCombined::InDetCandidate*>(*ipIt), &tp_id, extrParameters, pt_calo_local.eta(), pt_calo_local.phi()); - m_caloParticles.push_back(pParticle); + /** + * Check also the track pt as the pt cut of the TrackSelectorTool may be different. + */ + double pt = pPerigee.pT(); + if (pt < m_ptLowerLimit) { + ATH_MSG_DEBUG("pT=" << pt << " is lower than limit = " << m_ptLowerLimit << ". Skipping track."); + continue; } - ATH_MSG_DEBUG("CaloExtensionTool: size of CaloParticles " << m_caloParticles.size()); - /** Run the MuGirl reconstruction */ - MuGirlNS::CandidateSummaryList summaryList; - this->RunFromID(summaryList); - ATH_MSG_DEBUG("MuGirlReco: number of summaries=" << summaryList.size()); - + const Trk::TrackParameters* extrParameters = NULL; + /** + get the extrapolation to the MS entry + */ - /** in order to fill the ntuple storing the MuGirl results */ - if( m_doNTuple && m_pParticleCreatorTool->fillContainer(&summaryList, true).isFailure()) { - ATH_MSG_DEBUG("MuGirlReco: m_pParticleCreatorTool->fillContainer failed."); + if (m_caloExtensionTool.empty()) { + continue; } - /** empty caloParticles */ - for (unsigned i = 0; i < m_caloParticles.size(); i++) { - delete m_caloParticles[i]; + std::unique_ptr<Trk::CaloExtension> extension = m_caloExtensionTool->caloExtension(tp_id); + if (!extension) { + continue; } - m_caloParticles.clear(); - - /** Clear the Summary List */ - summaryList.clear(); + if (!extension->muonEntryLayerIntersection() && extension->caloLayerIntersections().empty()) continue; - ATH_MSG_DEBUG("summaryList cleared"); + ATH_MSG_DEBUG("Seen by calo"); - /** Clear the temporary data after the reconstruction */ - m_pCandidate->candidateClear(); - m_pSegmentManager->clear(); + // if available use muon entry intersection + if (extension->muonEntryLayerIntersection()) { + extrParameters = extension->muonEntryLayerIntersection(); + pt_calo_local = extrParameters->position(); + } else { + // use last calo layer + pt_calo_local = extension->caloLayerIntersections().back()->position(); + } - /** clear Hough data */ - if (m_doHoughTransform) { - ATH_MSG_DEBUG("After MuGirlReco n. " << this->hough_data_size() << " Hough maxima are unassociated"); + ATH_MSG_DEBUG("CaloExtensionTool: pt_calo_local " << pt_calo_local.x() << ", z=" << pt_calo_local.z()); - if (this->hough_data_size() && m_doNTuple) { - /** put dummy candidate in the ntuple in order to deliver the Hough maxima which has been left unassociated */ - if (m_pCandidate->fillNTuple(m_hough_data).isFailure()) - ATH_MSG_WARNING("execute: cannot fill the unassociated maxima in the NTuple"); - } + // FIXME: const_cast + CaloParticle* pParticle = new CaloParticle(const_cast<MuonCombined::InDetCandidate*>(*ipIt), &tp_id, extrParameters, + pt_calo_local.eta(), pt_calo_local.phi()); + m_caloParticles.push_back(pParticle); + } + ATH_MSG_DEBUG("CaloExtensionTool: size of CaloParticles " << m_caloParticles.size()); - this->clear_hough_data(); - } + /** Run the MuGirl reconstruction */ + MuGirlNS::CandidateSummaryList summaryList; + this->RunFromID(summaryList); + ATH_MSG_DEBUG("MuGirlReco: number of summaries=" << summaryList.size()); - ATH_MSG_DEBUG("MuGirlReco( .. ) done."); - return StatusCode::SUCCESS; -} + /** in order to fill the ntuple storing the MuGirl results */ + if (m_doNTuple && m_pParticleCreatorTool->fillContainer(&summaryList, true).isFailure()) { + ATH_MSG_DEBUG("MuGirlReco: m_pParticleCreatorTool->fillContainer failed."); + } -bool MuGirlRecoTool::RunFromID(MuGirlNS::CandidateSummaryList& summaryList) -{ + /** empty caloParticles */ + for (unsigned i = 0; i < m_caloParticles.size(); i++) { + delete m_caloParticles[i]; + } + m_caloParticles.clear(); - int iTrack = 0; /** counts the number of track processed */ + /** Clear the Summary List */ + summaryList.clear(); - /** start looping on calo particles */ - for (unsigned int i = 0; i < m_caloParticles.size(); i++) { - std::unique_ptr<MuGirlNS::CandidateSummary> summary(new MuGirlNS::CandidateSummary); + ATH_MSG_DEBUG("summaryList cleared"); - CaloParticle* pParticle = m_caloParticles[i]; + /** Clear the temporary data after the reconstruction */ + m_pCandidate->candidateClear(); + m_pSegmentManager->clear(); - ATH_MSG_DEBUG("RunFromID: start processing CaloParticle seed at eta=" << pParticle->eta << " phi=" << pParticle->phi); + /** clear Hough data */ + if (m_doHoughTransform) { + ATH_MSG_DEBUG("After MuGirlReco n. " << this->hough_data_size() << " Hough maxima are unassociated"); - const xAOD::TrackParticle* pTrackParticle = pParticle->pTrackParticle; - const Trk::TrackParameters* extrMuonEntry = pParticle->pTrackParameters; + if (this->hough_data_size() && m_doNTuple) { + /** put dummy candidate in the ntuple in order to deliver the Hough maxima which has been left unassociated */ + if (m_pCandidate->fillNTuple(m_hough_data).isFailure()) ATH_MSG_WARNING( + "execute: cannot fill the unassociated maxima in the NTuple"); + } - bool doStau = m_doStau && pTrackParticle->perigeeParameters().pT() >= m_stauPtCut; - bool doRH = m_doRH && doStau; + this->clear_hough_data(); + } - if (!m_pCandidate->fill(iTrack, pTrackParticle, extrMuonEntry, doStau).isSuccess()) continue; - if (m_pClusCollection && m_doLHR && m_pMuLHR && pParticle->isolated && m_pClusCollection->size() > 0) - calculateLHR(pParticle); - else{ - // in case we are running without LHR, set dummy values - m_pCandidate->setLHR(m_defaultLHR); - } - bool ANNaccept = false; + ATH_MSG_DEBUG("MuGirlReco( .. ) done."); - if (m_pCandidate->fillSummary(summary.get()).isFailure()) // what is the point of this? - ATH_MSG_DEBUG("RunFromID: cannot fill summary"); - else - if (m_doANNSelection) ANNaccept = generateMuGirl(*summary); + return StatusCode::SUCCESS; +} - if(pParticle->pInDetCandidate->isSiliconAssociated()) summary->isSiliconAssociated=true; +bool MuGirlRecoTool::RunFromID(MuGirlNS::CandidateSummaryList& summaryList) { + int iTrack = 0; /** counts the number of track processed */ - const Trk::Track* RefittedTrack = NULL; + /** start looping on calo particles */ + for (unsigned int i = 0; i < m_caloParticles.size(); i++) { + std::unique_ptr<MuGirlNS::CandidateSummary> summary(new MuGirlNS::CandidateSummary); - if ((m_doANNSelection && ANNaccept) || !(m_doANNSelection)) { - summary->saveAnn = 1; + CaloParticle* pParticle = m_caloParticles[i]; - if (m_doGlobalFit && (pTrackParticle->trackLink().isValid())&& - (m_pCandidate->vectorMuonSegments()).size() > 0 && summary->numMdtHitsInSeg > 0 ) { - ATH_MSG_DEBUG("RunFromID: performing the global track fit. muonSegemnts.size=" << (m_pCandidate->vectorMuonSegments()).size() - << " nmdts " << summary->numMdtHits << " nmdtSegs " << summary->numMdtSegs << " nmdtHitsInSeg " << summary->numMdtHitsInSeg); - const Trk::Track* originalTrack = *pTrackParticle->trackLink(); + ATH_MSG_DEBUG("RunFromID: start processing CaloParticle seed at eta=" << pParticle->eta << " phi=" << + pParticle->phi); - //// does it call backextrap ?? - RefittedTrack = m_pGlobalFitTool->globalFit(originalTrack, m_pCandidate->vectorMuonSegments(), m_doNTuple); + const xAOD::TrackParticle* pTrackParticle = pParticle->pTrackParticle; + const Trk::TrackParameters* extrMuonEntry = pParticle->pTrackParameters; + bool doStau = m_doStau && pTrackParticle->perigeeParameters().pT() >= m_stauPtCut; + bool doRH = m_doRH && doStau; - if (RefittedTrack != NULL) { - ATH_MSG_DEBUG("Set a NULL Refitted xAOD::TrackParticle into the CandidateTool"); - m_pCandidate-> fillRefittedTrack(NULL, RefittedTrack, summary.get()); + if (!m_pCandidate->fill(iTrack, pTrackParticle, extrMuonEntry, doStau).isSuccess()) continue; + if (m_pClusCollection && m_doLHR && m_pMuLHR && pParticle->isolated && m_pClusCollection->size() > 0) calculateLHR( + pParticle); + else { + // in case we are running without LHR, set dummy values + m_pCandidate->setLHR(m_defaultLHR); + } + bool ANNaccept = false; - if (m_doSAFit) doSAFit(RefittedTrack, *summary); - } else ATH_MSG_DEBUG("RunFromID: Global Fit produced a NULL Refitted Track"); - } - } else { - ATH_MSG_DEBUG("RunFromID: Candidate is not a muon track, filling a NULL summary"); - m_pCandidate-> fillRefittedTrack(NULL, NULL, summary.get()); - } + if (m_pCandidate->fillSummary(summary.get()).isFailure()) // what is the point of this? + ATH_MSG_DEBUG("RunFromID: cannot fill summary"); + else if (m_doANNSelection) ANNaccept = generateMuGirl(*summary); - if (m_doNTuple) doHoughTransformForNtuple(pTrackParticle, *summary); + if (pParticle->pInDetCandidate->isSiliconAssociated()) summary->isSiliconAssociated = true; - /** - * Stau processing - */ - bool passedStau = false; - if (doStau && summary->numMdtHits > 4 && (summary->numTgcEtaHits > 2 || summary->numTgcPhiHits > 2 || - summary->numRpcEtaHits > 2 || summary->numRpcPhiHits > 2) ) { - ATH_MSG_DEBUG("RunFromID: looking for staus ..."); - m_pCandidate->setPassdoStau(true); - //process stau - const Trk::Track* pMuonRefittedTrack = RefittedTrack; //NULL; - - if (m_pStauTool->processStau(pTrackParticle, - m_pCandidate->vectorMuonSegments(), - m_pCandidate->getMdtSegmentMakerInfo(), - m_pCandidate->getRpcHitsInSegments(), - m_pCandidate->getTgcHitsInSegments(), - pMuonRefittedTrack, NULL).isFailure()) continue; - - double Beta = m_pStauTool->beta(); - double stauMass = m_pStauTool->mass(); - summary->beta = Beta; - - if (Beta > 0.2) { - - ATH_MSG_DEBUG("stau Beta: " << Beta << ", mass: " << stauMass); - // MuGirlNS::CandidateSummary* stauSummary = new MuGirlNS::CandidateSummary(); - - std::unique_ptr<MuGirlNS::CandidateSummary> stauSummary(new MuGirlNS::CandidateSummary); - std::unique_ptr<MuGirlNS::StauExtras> stauExtras(new MuGirlNS::StauExtras); - - if (m_pStauTool->fillStauSummary(summary.get(), stauSummary.get()).isFailure()) - ATH_MSG_DEBUG("RunFromID: Cannot fill stauSummary"); - bool ANNstau = generateMuGirl(*stauSummary); - ATH_MSG_DEBUG("RunFromID: stau passANN " << ANNstau); - if (stauSummary->nnBarrel > 0.2 || stauSummary->nnEndCap > 0.2) ANNstau = true; - if (m_pStauTool->fillStauExtras(stauSummary.get(), stauExtras.get()).isFailure()) - ATH_MSG_DEBUG("RunFromID: Cannot fill stauExtras"); - - //Store in the low beta container either if pass stau ann - if (ANNstau) { - const Trk::Track* stauRefittedTrack = m_pStauTool->refittedTrack(); - if (NULL != stauRefittedTrack) { - stauSummary->pTrkRefitted = stauRefittedTrack; - - //stau - ATH_MSG_DEBUG("MuGirlRecoTool: stauRefittedTrack " << (m_pCandidate->vectorMuonSegments()).size()); - - std::vector<const Muon::MuonSegment*> stauSegmentList = *m_pStauTool->newMdtSegments(); - m_pSegmentManager->setInStore(stauSegmentList, true); - - MuonCombined::MuGirlLowBetaTag* lowbetatag = new MuonCombined::MuGirlLowBetaTag(stauRefittedTrack,stauSegmentList); - - //dress tag - stauSummary->saveStau = 1; - lowbetatag->setMuBeta(Beta); - lowbetatag->setStauSummary(stauSummary.release()); - lowbetatag->setStauExtras(stauExtras.release()); - - //pParticle->pInDetCandidate->addTag(*lowbetatag); - - } else { - ATH_MSG_DEBUG("stauRefittedTrack is NULL"); - stauSummary->pRefittedTrack = NULL; - stauSummary->pTrkRefitted = NULL; - } - passedStau = true; - }// ANNstau - - }// beta>0.2 - - if (m_doNTuple) { - if (m_pStauTool->fillNTuple().isFailure()) - ATH_MSG_DEBUG("RunFromID: stauTool->fillNtuple failed "); - } + const Trk::Track* RefittedTrack = NULL; - if (!passedStau) { - ATH_MSG_DEBUG("RunFromID: passedStau == false"); - auto newMdtSegments = m_pStauTool->newMdtSegments(); - if (newMdtSegments != nullptr) { - for (auto pMuonSeg : *newMdtSegments) - m_pSegmentManager->addSegment(pMuonSeg, MuGirlNS::SegmentManager::MDT_STAU); - } - if (doRH) { - ATH_MSG_DEBUG("RunFromID: doRH == true"); - std::unique_ptr<MuGirlNS::RHExtras> rhExtras(new MuGirlNS::RHExtras); - if (m_pStauTool->fillRHExtras(rhExtras.get()).isFailure()) - ATH_MSG_DEBUG("RunFromID: Cannot fill rhExtras"); - if (rhExtras->numCaloCells > 0) { - MuonCombined::MuGirlLowBetaTag* lowbetatag - = new MuonCombined::MuGirlLowBetaTag(pTrackParticle->track(), std::vector<const Muon::MuonSegment*>()); - lowbetatag->setRHExtras(rhExtras.release()); - //pParticle->pInDetCandidate->addTag(*lowbetatag); - } - ATH_MSG_DEBUG("RunFromID: doRH == true - done"); - } - ATH_MSG_DEBUG("RunFromID: passedStau == false - done"); - } + if ((m_doANNSelection && ANNaccept) || !(m_doANNSelection)) { + summary->saveAnn = 1; - } //stau processing - - if (summary->saveAnn == 1) { - ATH_MSG_DEBUG("RunFromID: delivering the muon summary to the summaryList"); - - //Generate the MuGirlTag according to the new running schema: MuGirlTag will delete the segments - //Otherwise put the list of MuGirl Segments into Storegate: Storegate will delete the segments - - - ATH_MSG_DEBUG("RunFromID: delivering the muon pTrkRefitted track to the MuGirl tag"); - std::vector<const Muon::MuonSegment*> muonSegmentList = summary->muonSegmentList; - MuonCombined::MuGirlTag* tag = 0; - if (summary->pTrkRefitted == NULL){ - if(summary->isSiliconAssociated) continue; - tag = new MuonCombined::MuGirlTag(muonSegmentList); - } - else tag = new MuonCombined::MuGirlTag(summary->pTrkRefitted, muonSegmentList); - tag->setUpdatedExtrapolatedTrack(std::move(summary->pTrkMSRefitted)); - //pParticle->pInDetCandidate->addTag(*tag); - //set the segment into SegmentManager undeletable - m_pSegmentManager->setInStore(muonSegmentList, true); - summary->saveStau = 0; - //m_pCandidate->releaseMuonSegments(false); //the segments released from Candidate ownership - //summaryList.push_back(summary.release()); - } else { - if (!passedStau) continue; - - // m_pCandidate->releaseMuonSegments(true); - //Generate the MuGirlTag according to the new running schema: MuGirlTag will delete the segments - - ATH_MSG_DEBUG("RunFromID: delivering the pTrkLowBeta to the MuGirl tag"); - std::vector<const Muon::MuonSegment*> muonSegmentList = summary->muonSegmentList; - MuonCombined::MuGirlTag* tag = new MuonCombined::MuGirlTag(summary->pTrkLowBeta, muonSegmentList); - tag->setUpdatedExtrapolatedTrack(nullptr); - //pParticle->pInDetCandidate->addTag(*tag); - //set the segment into SegmentManager undeletable - m_pSegmentManager->setInStore(muonSegmentList, true); + if (m_doGlobalFit && (pTrackParticle->trackLink().isValid()) && + (m_pCandidate->vectorMuonSegments()).size() > 0 && summary->numMdtHitsInSeg > 0) { + ATH_MSG_DEBUG("RunFromID: performing the global track fit. muonSegemnts.size=" << + (m_pCandidate->vectorMuonSegments()).size() + << " nmdts " << summary->numMdtHits << " nmdtSegs " << summary->numMdtSegs << " nmdtHitsInSeg " << + summary->numMdtHitsInSeg); + const Trk::Track* originalTrack = *pTrackParticle->trackLink(); - } + //// does it call backextrap ?? + RefittedTrack = m_pGlobalFitTool->globalFit(originalTrack, m_pCandidate->vectorMuonSegments(), m_doNTuple); - if (m_doNTuple) { - //if (m_pCandNTuple->writeRecord().isFailure()) - // ATH_MSG_WARNING("RunFromID: Cannot write NTuple"); - } - ATH_MSG_DEBUG("Done processing track " << iTrack << " number of cand: " << summaryList.size()); - iTrack++; - } - return true; -} + if (RefittedTrack != NULL) { + ATH_MSG_DEBUG("Set a NULL Refitted xAOD::TrackParticle into the CandidateTool"); + m_pCandidate->fillRefittedTrack(NULL, RefittedTrack, summary.get()); -StatusCode MuGirlRecoTool::execute() -{ - ATH_MSG_DEBUG("execute() not called ."); - return StatusCode::SUCCESS; -} + if (m_doSAFit) doSAFit(RefittedTrack, *summary); + } else ATH_MSG_DEBUG("RunFromID: Global Fit produced a NULL Refitted Track"); + } + } else { + ATH_MSG_DEBUG("RunFromID: Candidate is not a muon track, filling a NULL summary"); + m_pCandidate->fillRefittedTrack(NULL, NULL, summary.get()); + } -bool MuGirlRecoTool::generateMuGirl(MuGirlNS::CandidateSummary& summary) -{ - ATH_MSG_DEBUG("generateMuGirl"); + if (m_doNTuple) doHoughTransformForNtuple(pTrackParticle, *summary); - double eta = 999.; - double pt = 0.; - if (summary.startFromEF && summary.pMuonEFTrack != NULL) { - //eta = (summary.pMuonEFTrack)->eta(); - //pt = (summary.pMuonEFTrack)->pt(); - ATH_MSG_WARNING("Starting from EF not supported"); + /** + * Stau processing + */ + bool passedStau = false; + if (doStau && summary->numMdtHits > 4 && (summary->numTgcEtaHits > 2 || summary->numTgcPhiHits > 2 || + summary->numRpcEtaHits > 2 || summary->numRpcPhiHits > 2)) { + ATH_MSG_DEBUG("RunFromID: looking for staus ..."); + m_pCandidate->setPassdoStau(true); + //process stau + const Trk::Track* pMuonRefittedTrack = RefittedTrack; //NULL; + + if (m_pStauTool->processStau(pTrackParticle, + m_pCandidate->vectorMuonSegments(), + m_pCandidate->getMdtSegmentMakerInfo(), + m_pCandidate->getRpcHitsInSegments(), + m_pCandidate->getTgcHitsInSegments(), + pMuonRefittedTrack, NULL).isFailure()) continue; + + double Beta = m_pStauTool->beta(); + double stauMass = m_pStauTool->mass(); + summary->beta = Beta; + + if (Beta > 0.2) { + ATH_MSG_DEBUG("stau Beta: " << Beta << ", mass: " << stauMass); + // MuGirlNS::CandidateSummary* stauSummary = new MuGirlNS::CandidateSummary(); + + std::unique_ptr<MuGirlNS::CandidateSummary> stauSummary(new MuGirlNS::CandidateSummary); + std::unique_ptr<MuGirlNS::StauExtras> stauExtras(new MuGirlNS::StauExtras); + + if (m_pStauTool->fillStauSummary(summary.get(), stauSummary.get()).isFailure()) ATH_MSG_DEBUG( + "RunFromID: Cannot fill stauSummary"); + bool ANNstau = generateMuGirl(*stauSummary); + ATH_MSG_DEBUG("RunFromID: stau passANN " << ANNstau); + if (stauSummary->nnBarrel > 0.2 || stauSummary->nnEndCap > 0.2) ANNstau = true; + if (m_pStauTool->fillStauExtras(stauSummary.get(), stauExtras.get()).isFailure()) ATH_MSG_DEBUG( + "RunFromID: Cannot fill stauExtras"); + + //Store in the low beta container either if pass stau ann + if (ANNstau) { + const Trk::Track* stauRefittedTrack = m_pStauTool->refittedTrack(); + if (NULL != stauRefittedTrack) { + stauSummary->pTrkRefitted = stauRefittedTrack; + + //stau + ATH_MSG_DEBUG("MuGirlRecoTool: stauRefittedTrack " << (m_pCandidate->vectorMuonSegments()).size()); + + std::vector<const Muon::MuonSegment*> stauSegmentList = *m_pStauTool->newMdtSegments(); + m_pSegmentManager->setInStore(stauSegmentList, true); + + MuonCombined::MuGirlLowBetaTag* lowbetatag = new MuonCombined::MuGirlLowBetaTag(stauRefittedTrack, + stauSegmentList); + + //dress tag + stauSummary->saveStau = 1; + lowbetatag->setMuBeta(Beta); + lowbetatag->setStauSummary(stauSummary.release()); + lowbetatag->setStauExtras(stauExtras.release()); + + //pParticle->pInDetCandidate->addTag(*lowbetatag); + } else { + ATH_MSG_DEBUG("stauRefittedTrack is NULL"); + stauSummary->pRefittedTrack = NULL; + stauSummary->pTrkRefitted = NULL; + } + passedStau = true; + }// ANNstau + }// beta>0.2 + + if (m_doNTuple) { + if (m_pStauTool->fillNTuple().isFailure()) ATH_MSG_DEBUG("RunFromID: stauTool->fillNtuple failed "); + } + + if (!passedStau) { + ATH_MSG_DEBUG("RunFromID: passedStau == false"); + auto newMdtSegments = m_pStauTool->newMdtSegments(); + if (newMdtSegments != nullptr) { + for (auto pMuonSeg : *newMdtSegments) + m_pSegmentManager->addSegment(pMuonSeg, MuGirlNS::SegmentManager::MDT_STAU); + } + if (doRH) { + ATH_MSG_DEBUG("RunFromID: doRH == true"); + std::unique_ptr<MuGirlNS::RHExtras> rhExtras(new MuGirlNS::RHExtras); + if (m_pStauTool->fillRHExtras(rhExtras.get()).isFailure()) ATH_MSG_DEBUG("RunFromID: Cannot fill rhExtras"); + if (rhExtras->numCaloCells > 0) { + MuonCombined::MuGirlLowBetaTag* lowbetatag + = new MuonCombined::MuGirlLowBetaTag(pTrackParticle->track(), std::vector<const Muon::MuonSegment*>()); + lowbetatag->setRHExtras(rhExtras.release()); + //pParticle->pInDetCandidate->addTag(*lowbetatag); + } + ATH_MSG_DEBUG("RunFromID: doRH == true - done"); + } + ATH_MSG_DEBUG("RunFromID: passedStau == false - done"); + } + } //stau processing + + if (summary->saveAnn == 1) { + ATH_MSG_DEBUG("RunFromID: delivering the muon summary to the summaryList"); + + //Generate the MuGirlTag according to the new running schema: MuGirlTag will delete the segments + //Otherwise put the list of MuGirl Segments into Storegate: Storegate will delete the segments + + + ATH_MSG_DEBUG("RunFromID: delivering the muon pTrkRefitted track to the MuGirl tag"); + std::vector<const Muon::MuonSegment*> muonSegmentList = summary->muonSegmentList; + MuonCombined::MuGirlTag* tag = 0; + if (summary->pTrkRefitted == NULL) { + if (summary->isSiliconAssociated) continue; + tag = new MuonCombined::MuGirlTag(muonSegmentList); + } else tag = new MuonCombined::MuGirlTag(summary->pTrkRefitted, muonSegmentList); + tag->setUpdatedExtrapolatedTrack(std::move(summary->pTrkMSRefitted)); + //pParticle->pInDetCandidate->addTag(*tag); + //set the segment into SegmentManager undeletable + m_pSegmentManager->setInStore(muonSegmentList, true); + summary->saveStau = 0; + //m_pCandidate->releaseMuonSegments(false); //the segments released from Candidate ownership + //summaryList.push_back(summary.release()); } else { - eta = (summary.pTrackParticle)->perigeeParameters().eta(); - pt = (summary.pTrackParticle)->perigeeParameters().pT(); + if (!passedStau) continue; + + // m_pCandidate->releaseMuonSegments(true); + //Generate the MuGirlTag according to the new running schema: MuGirlTag will delete the segments + + ATH_MSG_DEBUG("RunFromID: delivering the pTrkLowBeta to the MuGirl tag"); + std::vector<const Muon::MuonSegment*> muonSegmentList = summary->muonSegmentList; + MuonCombined::MuGirlTag* tag = new MuonCombined::MuGirlTag(summary->pTrkLowBeta, muonSegmentList); + tag->setUpdatedExtrapolatedTrack(nullptr); + //pParticle->pInDetCandidate->addTag(*tag); + //set the segment into SegmentManager undeletable + m_pSegmentManager->setInStore(muonSegmentList, true); } - ATH_MSG_DEBUG("generateMuGirl: seed eta=" << eta << " and seed pT=" << pt); + if (m_doNTuple) { + //if (m_pCandNTuple->writeRecord().isFailure()) + // ATH_MSG_WARNING("RunFromID: Cannot write NTuple"); + } + ATH_MSG_DEBUG("Done processing track " << iTrack << " number of cand: " << summaryList.size()); + iTrack++; + } - if (fabs(eta) > 2.0 && (summary.numMdtHits <= 2 && summary.numCscSegs == 0 && summary.numTgcEtaHits <= 2 && summary.numTgcPhiHits <= 2)) - return false; - if (fabs(eta) < 2.0 && summary.numMdtHits <= 2) - return false; + return true; +} - ATH_MSG_DEBUG("generateMuGirl: eta/hits topology satisfied"); +StatusCode MuGirlRecoTool::execute() { + ATH_MSG_DEBUG("execute() not called ."); - if ((summary.innAngle == 999.) && (summary.midAngle == 999.)) - return false; - // double nsegs = summary.numMdtSegs + summary.numCscSegs + summary.numRpcSegs + summary.numTgcSegs; - // if (nsegs == 0) - // return false; + return StatusCode::SUCCESS; +} - double value[8]; - double ANN[2]{0, 0}; - m_pANNSelectionTool->evaluateANN(&summary, value, ANN); - m_pCandidate->setAnn(ANN[0], ANN[1]); - summary.nnBarrel = ANN[0]; - summary.nnEndCap = ANN[1]; +bool MuGirlRecoTool::generateMuGirl(MuGirlNS::CandidateSummary& summary) { + ATH_MSG_DEBUG("generateMuGirl"); + + double eta = 999.; + double pt = 0.; + if (summary.startFromEF && summary.pMuonEFTrack != NULL) { + //eta = (summary.pMuonEFTrack)->eta(); + //pt = (summary.pMuonEFTrack)->pt(); + ATH_MSG_WARNING("Starting from EF not supported"); + } else { + eta = (summary.pTrackParticle)->perigeeParameters().eta(); + pt = (summary.pTrackParticle)->perigeeParameters().pT(); + } - ATH_MSG_DEBUG(" ANN [0] " << value[0] << " ANN [1] " << value[1] << " ANN [2] " << value[2] << " ANN [3] " << value[3] << " ANN [4] " << value[4] << " ANN [5] " << value[5]); + ATH_MSG_DEBUG("generateMuGirl: seed eta=" << eta << " and seed pT=" << pt); + + if (fabs(eta) > 2.0 && + (summary.numMdtHits <= 2 && summary.numCscSegs == 0 && summary.numTgcEtaHits <= 2 && + summary.numTgcPhiHits <= 2)) return false; + + if (fabs(eta) < 2.0 && summary.numMdtHits <= 2) return false; + + ATH_MSG_DEBUG("generateMuGirl: eta/hits topology satisfied"); + + if ((summary.innAngle == 999.) && (summary.midAngle == 999.)) return false; + + // double nsegs = summary.numMdtSegs + summary.numCscSegs + summary.numRpcSegs + summary.numTgcSegs; + // if (nsegs == 0) + // return false; + + double value[8]; + double ANN[2] { + 0, 0 + }; + m_pANNSelectionTool->evaluateANN(&summary, value, ANN); + m_pCandidate->setAnn(ANN[0], ANN[1]); + summary.nnBarrel = ANN[0]; + summary.nnEndCap = ANN[1]; + + ATH_MSG_DEBUG( + " ANN [0] " << value[0] << " ANN [1] " << value[1] << " ANN [2] " << value[2] << " ANN [3] " << value[3] << " ANN [4] " << + value[4] << " ANN [5] " << value[5]); + /* + if (value[0]>0.3 || // BARREL GOOD PT<10GeV + value[1]>0.2 || // BARREL BAD + value[2]>0.3 || // REGION OVERLAP + value[3]>0.25 || // MAGNET OVERLAP + value[4]>0.45 || // ENDCAP + value[5]>0.4 ) // FORWARD + // value[6] > m_barrelNNCut || //TEST BARREL PT>10GeV + // value[7] > m_endcapNNCut) // TEST ENDCAP PT>10GeV + */ + + if (pt > 5000) { /* - if (value[0]>0.3 || // BARREL GOOD PT<10GeV - value[1]>0.2 || // BARREL BAD - value[2]>0.3 || // REGION OVERLAP - value[3]>0.25 || // MAGNET OVERLAP - value[4]>0.45 || // ENDCAP - value[5]>0.4 ) // FORWARD - // value[6] > m_barrelNNCut || //TEST BARREL PT>10GeV - // value[7] > m_endcapNNCut) // TEST ENDCAP PT>10GeV + if (value[0]>0.18 || // BARREL GOOD PT>5GeV + value[1]>0.2 || // BARREL BAD + value[2]>0.2 || // REGION OVERLAP + value[3]>0.18 || // MAGNET OVERLAP */ - - if (pt > 5000) { - /* - if (value[0]>0.18 || // BARREL GOOD PT>5GeV - value[1]>0.2 || // BARREL BAD - value[2]>0.2 || // REGION OVERLAP - value[3]>0.18 || // MAGNET OVERLAP - */ - if (value[0] > 0.55 || // BARREL GOOD PT>5GeV - value[1] > 0.55 || // BARREL BAD - value[2] > 0.55 || // REGION OVERLAP - value[3] > 0.55 || // MAGNET OVERLAP - value[4] > 0.2 || // ENDCAP - value[5] > 0.3) // FORWARD - { - - summary.PassNNsel = true; - m_pCandidate->setPassANN(true); - return true; - } else { - summary.PassNNsel = false; - m_pCandidate->setPassANN(false); - return false; - } + if (value[0] > 0.55 || // BARREL GOOD PT>5GeV + value[1] > 0.55 || // BARREL BAD + value[2] > 0.55 || // REGION OVERLAP + value[3] > 0.55 || // MAGNET OVERLAP + value[4] > 0.2 || // ENDCAP + value[5] > 0.3) { // FORWARD + summary.PassNNsel = true; + m_pCandidate->setPassANN(true); + return true; } else { - if (value[0] > 0.55 || // BARREL GOOD PT<5GeV - value[1] > 0.55 || // BARREL BAD - value[2] > 0.55 || // REGION OVERLAP - value[3] > 0.55 || // MAGNET OVERLAP - value[4] > 0.2 || // ENDCAP - value[5] > 0.3) // FORWARD - { - - summary.PassNNsel = true; - m_pCandidate->setPassANN(true); - return true; - } else { - summary.PassNNsel = false; - m_pCandidate->setPassANN(false); - return false; - } + summary.PassNNsel = false; + m_pCandidate->setPassANN(false); + return false; } - + } else { + if (value[0] > 0.55 || // BARREL GOOD PT<5GeV + value[1] > 0.55 || // BARREL BAD + value[2] > 0.55 || // REGION OVERLAP + value[3] > 0.55 || // MAGNET OVERLAP + value[4] > 0.2 || // ENDCAP + value[5] > 0.3) { // FORWARD + summary.PassNNsel = true; + m_pCandidate->setPassANN(true); + return true; + } else { + summary.PassNNsel = false; + m_pCandidate->setPassANN(false); + return false; + } + } } - -void MuGirlRecoTool::calculateLHR(CaloParticle* pParticle) -{ - if( !m_pClusCollection || !m_doLHR || !m_pMuLHR || !pParticle->isolated || m_pClusCollection->empty() ){ - // in case we are running without LHR, set dummy values +void MuGirlRecoTool::calculateLHR(CaloParticle* pParticle) { + if (!m_pClusCollection || !m_doLHR || !m_pMuLHR || !pParticle->isolated || m_pClusCollection->empty()) { + // in case we are running without LHR, set dummy values m_pCandidate->setLHR(m_defaultLHR); return; } - const xAOD::TrackParticle* pTrackParticle = pParticle->pTrackParticle; - const Trk::Perigee pPerigee = pTrackParticle->perigeeParameters(); - double charge_id = pTrackParticle->charge(); - double qOverP_id = pPerigee.parameters()[Trk::qOverP]; - double p_id = fabs(1.0 / qOverP_id); - double phi_id = pPerigee.parameters()[Trk::phi]; - double eta_id = asinh(1. / tan(pPerigee.parameters()[Trk::theta])); - double pt_id = pPerigee.pT(); - - ATH_MSG_DEBUG("Parameters of isolated tracks seen by calo: " << - " pt = " << pt_id << - " eta = " << eta_id << - " phi = " << phi_id << - " charge = " << charge_id); + const xAOD::TrackParticle* pTrackParticle = pParticle->pTrackParticle; + const Trk::Perigee pPerigee = pTrackParticle->perigeeParameters(); + double charge_id = pTrackParticle->charge(); + double qOverP_id = pPerigee.parameters()[Trk::qOverP]; + double p_id = fabs(1.0 / qOverP_id); + double phi_id = pPerigee.parameters()[Trk::phi]; + double eta_id = asinh(1. / tan(pPerigee.parameters()[Trk::theta])); + double pt_id = pPerigee.pT(); + + ATH_MSG_DEBUG("Parameters of isolated tracks seen by calo: " << + " pt = " << pt_id << + " eta = " << eta_id << + " phi = " << phi_id << + " charge = " << charge_id); - double theLHR = m_pMuLHR->getLHR(m_pClusCollection, eta_id, p_id, pParticle->eta, pParticle->phi); - ATH_MSG_DEBUG("theLHR = " << theLHR); + double theLHR = m_pMuLHR->getLHR(m_pClusCollection, eta_id, p_id, pParticle->eta, pParticle->phi); + ATH_MSG_DEBUG("theLHR = " << theLHR); - m_pCandidate->setIsolation(1); - m_pCandidate->setLHR(theLHR); + m_pCandidate->setIsolation(1); + m_pCandidate->setLHR(theLHR); - ATH_MSG_DEBUG("calculate LHR done = " << theLHR); + ATH_MSG_DEBUG("calculate LHR done = " << theLHR); } -StatusCode MuGirlRecoTool::processHoughData() -{ - int NumMaxima = 0; - - if (m_pMuonLayerHoughTool) { - Muon::MuonLayerHoughTool::HoughDataPerSectorVec data = m_pMuonLayerHoughTool->houghData(); - ATH_MSG_DEBUG(data.size() << " sector are present in the HoughData"); - for (unsigned int sector = 0; sector < data.size(); sector++) { - int sector_id = -99; - bool hits_in_same_sector = true; - Muon::MuonLayerHoughTool::HoughDataPerSector sector_data = data.at(sector); - ATH_MSG_DEBUG("----------------------------- Sector " << sector - << " -----------------------------"); - for (unsigned int region = 0; region < sector_data.maxVec.size(); region++) { - std::pair<Muon::MuonStationIndex::DetectorRegionIndex, Muon::MuonStationIndex::LayerIndex> coordinate = - Muon::MuonStationIndex::decomposeSectorLayerHash(region); - Muon::MuonStationIndex::DetectorRegionIndex det_reg_id = coordinate.first; - Muon::MuonStationIndex::LayerIndex det_lay_id = coordinate.second; - std::string det_reg_str = Muon::MuonStationIndex::regionName(det_reg_id); - std::string det_lay_str = Muon::MuonStationIndex::layerName(det_lay_id); - - int region_id = -99; - bool hits_in_same_region = true; - /** Old code used when the region was not handled directly within the MuonIdHelper package. - std::string tag; - switch (region) { - case 0 : tag="BI station "; break; - case 1 : tag="BM station "; break; - case 2 : tag="BO station "; break; - case 3 : tag="BE station, side C"; break; - case 4 : tag="EI station, side C"; break; - case 5 : tag="EM station, side C"; break; - case 6 : tag="EO station, side C"; break; - case 7 : tag="EE station, side C"; break; - case 8 : tag="BE station, side A"; break; - case 9 : tag="EI station, side A"; break; - case 10: tag="EM station, side A"; break; - case 11: tag="EO station, side A"; break; - case 12: tag="EE station, side A"; break; - default: tag=""; break; +StatusCode MuGirlRecoTool::processHoughData() { + int NumMaxima = 0; + + if (m_pMuonLayerHoughTool) { + Muon::MuonLayerHoughTool::HoughDataPerSectorVec data = m_pMuonLayerHoughTool->houghData(); + ATH_MSG_DEBUG(data.size() << " sector are present in the HoughData"); + for (unsigned int sector = 0; sector < data.size(); sector++) { + int sector_id = -99; + bool hits_in_same_sector = true; + Muon::MuonLayerHoughTool::HoughDataPerSector sector_data = data.at(sector); + ATH_MSG_DEBUG("----------------------------- Sector " << sector + << " -----------------------------"); + for (unsigned int region = 0; region < sector_data.maxVec.size(); region++) { + std::pair<Muon::MuonStationIndex::DetectorRegionIndex, Muon::MuonStationIndex::LayerIndex> coordinate = + Muon::MuonStationIndex::decomposeSectorLayerHash(region); + Muon::MuonStationIndex::DetectorRegionIndex det_reg_id = coordinate.first; + Muon::MuonStationIndex::LayerIndex det_lay_id = coordinate.second; + std::string det_reg_str = Muon::MuonStationIndex::regionName(det_reg_id); + std::string det_lay_str = Muon::MuonStationIndex::layerName(det_lay_id); + + int region_id = -99; + bool hits_in_same_region = true; + /** Old code used when the region was not handled directly within the MuonIdHelper package. + std::string tag; + switch (region) { + case 0 : tag="BI station "; break; + case 1 : tag="BM station "; break; + case 2 : tag="BO station "; break; + case 3 : tag="BE station, side C"; break; + case 4 : tag="EI station, side C"; break; + case 5 : tag="EM station, side C"; break; + case 6 : tag="EO station, side C"; break; + case 7 : tag="EE station, side C"; break; + case 8 : tag="BE station, side A"; break; + case 9 : tag="EI station, side A"; break; + case 10: tag="EM station, side A"; break; + case 11: tag="EO station, side A"; break; + case 12: tag="EE station, side A"; break; + default: tag=""; break; + } + */ + ATH_MSG_DEBUG("------------------- RegLay " + << setw(14) << setfill(' ') << setiosflags(ios::left) << det_lay_str + << setw(7) << setfill(' ') << setiosflags(ios::left) << det_reg_str + << " ------------------"); + std::vector<MuonHough::MuonLayerHough::Maximum*> region_data = sector_data.maxVec.at(region); + for (unsigned int maximum = 0; maximum < region_data.size(); maximum++) { + MuonHough::MuonLayerHough::Maximum* max = region_data.at(maximum); + std::vector<MuonHough::Hit*>::iterator it = max->hits.begin(); + int layer_id = -99; + bool hits_in_same_layer = true; + + // compute MuGirl region index and check the consistency with the regLayer of the Hough transform + int hough_region = det_reg_id; + int MuGirl_region = (hough_region == 1) ? 0 : 1; + + // the computation of MuGirl distance requires the Hough hits + int MuGirl_distance = 0; + + ATH_MSG_DEBUG("----------------------------- Maxim. " << maximum + << " -----------------------------"); + float max_value = max->max; + float max_position = max->pos; + float max_tetha = max->theta; + float max_tConfirm = max->triggerConfirmed; + float max_refPos; + float max_posMin; + float max_posMax; + int dummy = 0; + max->hough->pars(max->binposmin, dummy, max_refPos, max_posMin); + max->hough->pars(max->binposmax, dummy, max_refPos, max_posMax); + + ATH_MSG_DEBUG("maximum value: " << max_value << ", # of trigger hits associated: " << max_tConfirm); + ATH_MSG_DEBUG("reference layer:" << ((region > 2) ? "Z=" : "R=") << max_refPos + << ", maximum position:" << + ((region > + 2) ? "R=" : "Z=") << max_position << ((region > 2) ? ", R range: [" : ", Z range: [") + << max_posMin << "," << max_posMax << "]"); + ATH_MSG_DEBUG("tetha position:" << max_tetha); + + while (it != max->hits.end()) { + const MuonHough::HitDebugInfo* info = (*it)->debugInfo(); + + if (sector_id == -99) sector_id = info->sector; + else hits_in_same_sector &= (sector_id == info->sector); + + if (region_id == -99) region_id = info->region; + else hits_in_same_region &= (region_id == info->region); + + if (layer_id == -99) layer_id = info->layer; + else hits_in_same_layer &= (layer_id == info->layer); + + std::string side = ""; + if ((*it)->prd) { + MuGirl_distance = det_lay_id; //m_pMuonLayerHoughTool->lay( (*it)->prd->identify() ); + std::string chamber_name = m_MuonIdHelperTool->chamberNameString((*it)->prd->identify()); + if (msgLvl(MSG::DEBUG)) { + const Amg::Vector2D locPos = (*it)->prd->localPosition(); + const Trk::TrkDetElementBase* detEl = (*it)->prd->detectorElement(); + const Amg::Vector3D* gPos = detEl->surface((*it)->prd->identify()).localToGlobal(locPos); + if (m_MuonIdHelperTool->isEndcap((*it)->prd->identify())) { + side = (gPos->z() < 0.) ? ", side C" : ", side A"; } - */ - ATH_MSG_DEBUG("------------------- RegLay " - << setw(14) << setfill(' ') << setiosflags(ios::left) << det_lay_str - << setw(7) << setfill(' ') << setiosflags(ios::left) << det_reg_str - << " ------------------"); - std::vector<MuonHough::MuonLayerHough::Maximum*> region_data = sector_data.maxVec.at(region); - for (unsigned int maximum = 0; maximum < region_data.size(); maximum++) { - MuonHough::MuonLayerHough::Maximum* max = region_data.at(maximum); - std::vector<MuonHough::Hit*>::iterator it = max->hits.begin(); - int layer_id = -99; - bool hits_in_same_layer = true; - - // compute MuGirl region index and check the consistency with the regLayer of the Hough transform - int hough_region = det_reg_id; - int MuGirl_region = (hough_region == 1) ? 0 : 1; - - // the computation of MuGirl distance requires the Hough hits - int MuGirl_distance = 0; - - ATH_MSG_DEBUG("----------------------------- Maxim. " << maximum - << " -----------------------------"); - float max_value = max->max; - float max_position = max->pos; - float max_tetha = max->theta; - float max_tConfirm = max->triggerConfirmed; - float max_refPos; - float max_posMin; - float max_posMax; - int dummy = 0; - max->hough->pars(max->binposmin, dummy, max_refPos, max_posMin); - max->hough->pars(max->binposmax, dummy, max_refPos, max_posMax); - - ATH_MSG_DEBUG("maximum value: " << max_value << ", # of trigger hits associated: " << max_tConfirm); - ATH_MSG_DEBUG("reference layer:" << ((region > 2) ? "Z=" : "R=") << max_refPos - << ", maximum position:" << ((region > 2) ? "R=" : "Z=") << max_position << ((region > 2) ? ", R range: [" : ", Z range: [") - << max_posMin << "," << max_posMax << "]"); - ATH_MSG_DEBUG("tetha position:" << max_tetha); - - while (it != max->hits.end()) { - const MuonHough::HitDebugInfo* info = (*it)->debugInfo(); - - if (sector_id == -99) sector_id = info->sector; - else hits_in_same_sector &= (sector_id == info->sector); - - if (region_id == -99) region_id = info->region; - else hits_in_same_region &= (region_id == info->region); - - if (layer_id == -99) layer_id = info->layer; - else hits_in_same_layer &= (layer_id == info->layer); - - std::string side = ""; - if ((*it)->prd) { - MuGirl_distance = det_lay_id; //m_pMuonLayerHoughTool->lay( (*it)->prd->identify() ); - std::string chamber_name = m_MuonIdHelperTool->chamberNameString((*it)->prd->identify()); - if (msgLvl(MSG::DEBUG)) { - const Amg::Vector2D locPos = (*it)->prd->localPosition(); - const Trk::TrkDetElementBase* detEl = (*it)->prd->detectorElement(); - const Amg::Vector3D* gPos = detEl->surface((*it)->prd->identify()).localToGlobal(locPos); - if (m_MuonIdHelperTool->isEndcap((*it)->prd->identify())) { - side = (gPos->z() < 0.) ? ", side C" : ", side A"; - } - ATH_MSG_DEBUG("Hough Hit has a PrePrawData belonging to chamber " << chamber_name.c_str() << side.c_str()); - } - } else { - if ((*it)->tgc) { - std::vector< const Muon::TgcPrepData* > tgc = (*it)->tgc->etaCluster.hitList; - MuGirl_distance = det_lay_id; //lay( tgc[0]->identify() ); - if (msgLvl(MSG::DEBUG)) { - std::string chamber_name = m_MuonIdHelperTool->chamberNameString(tgc[0]->identify()); - const Amg::Vector2D locPos = tgc[0]->localPosition(); - const Trk::TrkDetElementBase* detEl = tgc[0]->detectorElement(); - const Amg::Vector3D* gPos = detEl->surface(tgc[0]->identify()).localToGlobal(locPos); - if (m_MuonIdHelperTool->isEndcap(tgc[0]->identify())) { - side = (gPos->z() < 0.) ? ", side C" : ", side A"; - } - ATH_MSG_DEBUG("Hough Hit has not a PrepRawData but a TgcClusterObj3D belonging to " << chamber_name.c_str() << side.c_str()); - } - } else ATH_MSG_DEBUG("Hough Hit has not a PrepRawData"); - } - - // set MuGirl_distance - // MuGirl HoughTransformTool - // BI 0 0 - // BM 1 2 - // BO 2 3 - // BEE 3 1 - if (MuGirl_distance >= 1) MuGirl_distance++; - if (MuGirl_distance >= 4) MuGirl_distance = 1;//since det_lay_id 0-4. - /** Old check done when the region index was not handled within the MuonIdhelper package. - // check consistency with MuGirl indices for every hits - if ( (MuGirl_distance==0 && (region!=0&®ion!=4&®ion!=9)) || - (MuGirl_distance==2 && (region!=1&®ion!=5&®ion!=10)) || - (MuGirl_distance==3 && (region!=2&®ion!=6&®ion!=11)) || - (MuGirl_distance==1 && (region!=3&®ion!=7&®ion!=8&®ion!=12)) ) { - ATH_MSG_ERROR("Inconsistency between MuGirl distance and Hough transform regLayer: distance=" << MuGirl_distance - << ", regLayer=" << region); - return StatusCode::FAILURE; - } - */ - it++; - } - - ATH_MSG_DEBUG("MuGirl distance=" << MuGirl_distance << ", MuGirl region=" << MuGirl_region); - - // keep maximum for the ntuple processing (check that we have - m_hough_data[sector][MuGirl_distance][MuGirl_region].push_back(max); - - ++NumMaxima; - - if (!hits_in_same_layer) ATH_MSG_WARNING("processHoughData: hits in Hough are not from the same layer"); - else if (layer_id != -99) ATH_MSG_DEBUG("Hough maximum has hits from layer " << layer_id); + ATH_MSG_DEBUG( + "Hough Hit has a PrePrawData belonging to chamber " << chamber_name.c_str() << side.c_str()); + } + } else { + if ((*it)->tgc) { + std::vector< const Muon::TgcPrepData* > tgc = (*it)->tgc->etaCluster.hitList; + MuGirl_distance = det_lay_id; //lay( tgc[0]->identify() ); + if (msgLvl(MSG::DEBUG)) { + std::string chamber_name = m_MuonIdHelperTool->chamberNameString(tgc[0]->identify()); + const Amg::Vector2D locPos = tgc[0]->localPosition(); + const Trk::TrkDetElementBase* detEl = tgc[0]->detectorElement(); + const Amg::Vector3D* gPos = detEl->surface(tgc[0]->identify()).localToGlobal(locPos); + if (m_MuonIdHelperTool->isEndcap(tgc[0]->identify())) { + side = (gPos->z() < 0.) ? ", side C" : ", side A"; + } + ATH_MSG_DEBUG( + "Hough Hit has not a PrepRawData but a TgcClusterObj3D belonging to " << chamber_name.c_str() << + side.c_str()); } - if (!hits_in_same_region) ATH_MSG_WARNING("processHoughData: hits in Hough are not from the same region"); - else if (region_id != -99) ATH_MSG_DEBUG("Hough maxima belongs to region " << region_id); + } else ATH_MSG_DEBUG("Hough Hit has not a PrepRawData"); } - if (!hits_in_same_sector) ATH_MSG_WARNING("processHoughData: hits in Hough are not from the same sector"); - else if (sector_id != -99) ATH_MSG_DEBUG("Hough maxima belongs to sector " << sector_id); + + // set MuGirl_distance + // MuGirl HoughTransformTool + // BI 0 0 + // BM 1 2 + // BO 2 3 + // BEE 3 1 + if (MuGirl_distance >= 1) MuGirl_distance++; + if (MuGirl_distance >= 4) MuGirl_distance = 1; //since det_lay_id 0-4. + /** Old check done when the region index was not handled within the MuonIdhelper package. + // check consistency with MuGirl indices for every hits + if ( (MuGirl_distance==0 && (region!=0&®ion!=4&®ion!=9)) || + (MuGirl_distance==2 && (region!=1&®ion!=5&®ion!=10)) || + (MuGirl_distance==3 && (region!=2&®ion!=6&®ion!=11)) || + (MuGirl_distance==1 && (region!=3&®ion!=7&®ion!=8&®ion!=12)) ) { + ATH_MSG_ERROR("Inconsistency between MuGirl distance and Hough transform regLayer: distance=" << + MuGirl_distance + << ", regLayer=" << region); + return StatusCode::FAILURE; + } + */ + it++; + } + + ATH_MSG_DEBUG("MuGirl distance=" << MuGirl_distance << ", MuGirl region=" << MuGirl_region); + + // keep maximum for the ntuple processing (check that we have + m_hough_data[sector][MuGirl_distance][MuGirl_region].push_back(max); + + ++NumMaxima; + + if (!hits_in_same_layer) ATH_MSG_WARNING("processHoughData: hits in Hough are not from the same layer"); + else if (layer_id != -99) ATH_MSG_DEBUG("Hough maximum has hits from layer " << layer_id); } + if (!hits_in_same_region) ATH_MSG_WARNING("processHoughData: hits in Hough are not from the same region"); + else if (region_id != -99) ATH_MSG_DEBUG("Hough maxima belongs to region " << region_id); + } + if (!hits_in_same_sector) ATH_MSG_WARNING("processHoughData: hits in Hough are not from the same sector"); + else if (sector_id != -99) ATH_MSG_DEBUG("Hough maxima belongs to sector " << sector_id); } + } - ATH_MSG_INFO("Retrieved n. " << NumMaxima << " Hough maxima"); + ATH_MSG_INFO("Retrieved n. " << NumMaxima << " Hough maxima"); - return StatusCode::SUCCESS; + return StatusCode::SUCCESS; } -void MuGirlRecoTool::associateMaxima(HoughData associated[16][4][2]) -{ - std::vector<MuonHough::MuonLayerHough::Maximum*> maxvec; - for (unsigned int i = 0; i < 16; i++) { // i == sector - for (unsigned int j = 0; j < 4; j++) { // j == distance - for (unsigned int k = 0; k < 2; k++) { // k == region - std::vector<MuonHough::MuonLayerHough::Maximum*>& maxima = m_hough_data[i][j][k]; - std::vector<MuonHough::MuonLayerHough::Maximum*>::iterator m = maxima.begin(); - while (m != maxima.end()) { - if (m_pCandidate->isHoughMaxAssociated(*m, i, j, k)) { - associated[i][j][k].push_back(*m); - m = maxima.erase(m); - } else m++; - } - } +void MuGirlRecoTool::associateMaxima(HoughData associated[16][4][2]) { + std::vector<MuonHough::MuonLayerHough::Maximum*> maxvec; + for (unsigned int i = 0; i < 16; i++) { // i == sector + for (unsigned int j = 0; j < 4; j++) { // j == distance + for (unsigned int k = 0; k < 2; k++) { // k == region + std::vector<MuonHough::MuonLayerHough::Maximum*>& maxima = m_hough_data[i][j][k]; + std::vector<MuonHough::MuonLayerHough::Maximum*>::iterator m = maxima.begin(); + while (m != maxima.end()) { + if (m_pCandidate->isHoughMaxAssociated(*m, i, j, k)) { + associated[i][j][k].push_back(*m); + m = maxima.erase(m); + } else m++; } + } } + } } -int MuGirlRecoTool::hough_data_size() const -{ - int size = 0; - for (unsigned int i = 0; i < 16; i++) { - for (unsigned int j = 0; j < 4; j++) { - for (unsigned int k = 0; k < 2; k++) { - size += m_hough_data[i][j][k].size(); - } - } - } - return size; -} +int MuGirlRecoTool::hough_data_size() const { + int size = 0; -void MuGirlRecoTool::clear_hough_data() -{ - for (unsigned int i = 0; i < 16; i++) { - for (unsigned int j = 0; j < 4; j++) { - for (unsigned int k = 0; k < 2; k++) { - m_hough_data[i][j][k].clear(); - } - } + for (unsigned int i = 0; i < 16; i++) { + for (unsigned int j = 0; j < 4; j++) { + for (unsigned int k = 0; k < 2; k++) { + size += m_hough_data[i][j][k].size(); + } } + } + return size; } -void MuGirlRecoTool::listTrackParticles(const InDetCandidateCollection& InDetSeeds) -{ - - ATH_MSG_DEBUG("******************************************"); - ATH_MSG_DEBUG("******** list of TrackParticles ********"); - ATH_MSG_DEBUG("******************************************"); - - for (InDetCandidateCollection::const_iterator ipIt = InDetSeeds.begin(); - ipIt != InDetSeeds.end(); - ++ipIt) { - const xAOD::TrackParticle& tp_id = (*ipIt)->indetTrackParticle(); - const Trk::Perigee pPerigee = tp_id.perigeeParameters(); - double charge_id = tp_id.charge(); - double d0_id = pPerigee.parameters()[Trk::d0]; - double z0_id = pPerigee.parameters()[Trk::z0]; - double phi_id = pPerigee.parameters()[Trk::phi]; - double eta_id = asinh(1. / tan(pPerigee.parameters()[Trk::theta])); - double pt_id = pPerigee.pT(); - - if (pt_id < m_ptLowerLimit) continue; - - ATH_MSG_DEBUG("pt = " << pt_id << - " eta = " << eta_id << - " phi = " << phi_id << - " ch = " << charge_id << - " d0 = " << d0_id << - " z0 = " << z0_id); +void MuGirlRecoTool::clear_hough_data() { + for (unsigned int i = 0; i < 16; i++) { + for (unsigned int j = 0; j < 4; j++) { + for (unsigned int k = 0; k < 2; k++) { + m_hough_data[i][j][k].clear(); + } } - - ATH_MSG_DEBUG("******************************************"); - ATH_MSG_DEBUG("******** end *********"); - ATH_MSG_DEBUG("******************************************"); + } } -void MuGirlRecoTool::doHoughTransformForNtuple(const xAOD::TrackParticle* pTrackParticle, MuGirlNS::CandidateSummary& summary) -{ +void MuGirlRecoTool::listTrackParticles(const InDetCandidateCollection& InDetSeeds) { + ATH_MSG_DEBUG("******************************************"); + ATH_MSG_DEBUG("******** list of TrackParticles ********"); + ATH_MSG_DEBUG("******************************************"); + + for (InDetCandidateCollection::const_iterator ipIt = InDetSeeds.begin(); + ipIt != InDetSeeds.end(); + ++ipIt) { + const xAOD::TrackParticle& tp_id = (*ipIt)->indetTrackParticle(); + const Trk::Perigee pPerigee = tp_id.perigeeParameters(); + double charge_id = tp_id.charge(); + double d0_id = pPerigee.parameters()[Trk::d0]; + double z0_id = pPerigee.parameters()[Trk::z0]; + double phi_id = pPerigee.parameters()[Trk::phi]; + double eta_id = asinh(1. / tan(pPerigee.parameters()[Trk::theta])); + double pt_id = pPerigee.pT(); + if (pt_id < m_ptLowerLimit) continue; - ATH_MSG_DEBUG("Hough " << m_doHoughTransform); - // select the hough maxima associated to the candidate - HoughData associated_maxima[16][4][2]; - if (m_doHoughTransform) { - ATH_MSG_DEBUG("Associating the Hough Maxima to MuGirl candidate"); - associateMaxima(associated_maxima); - } + ATH_MSG_DEBUG("pt = " << pt_id << + " eta = " << eta_id << + " phi = " << phi_id << + " ch = " << charge_id << + " d0 = " << d0_id << + " z0 = " << z0_id); + } - // filling the candidate info in NTuple - //ATH_MSG_DEBUG("Calling m_pCandidate->fillNTuple"); - //if (m_pCandidate->fillNTuple().isFailure()) - // ATH_MSG_WARNING("RunFromID: error during fill NTuple"); + ATH_MSG_DEBUG("******************************************"); + ATH_MSG_DEBUG("******** end *********"); + ATH_MSG_DEBUG("******************************************"); +} +void MuGirlRecoTool::doHoughTransformForNtuple(const xAOD::TrackParticle* pTrackParticle, + MuGirlNS::CandidateSummary& summary) { + ATH_MSG_DEBUG("Hough " << m_doHoughTransform); + // select the hough maxima associated to the candidate + HoughData associated_maxima[16][4][2]; + if (m_doHoughTransform) { + ATH_MSG_DEBUG("Associating the Hough Maxima to MuGirl candidate"); + associateMaxima(associated_maxima); + } - // filling the Hough transfomr info in NTuple - if (m_doHoughTransform) { - ATH_MSG_DEBUG("Calling m_pCandidate->fillNTuple(with associated hough maxima)"); - if (m_pCandidate->fillNTuple(associated_maxima).isFailure()) - ATH_MSG_WARNING("RunFromID: Could not include the Hough data into the Candidate NTuple"); - } + // filling the candidate info in NTuple + //ATH_MSG_DEBUG("Calling m_pCandidate->fillNTuple"); + //if (m_pCandidate->fillNTuple().isFailure()) + // ATH_MSG_WARNING("RunFromID: error during fill NTuple"); - if (m_doNTuple && m_doTruth && pTrackParticle != NULL) { - ATH_MSG_DEBUG("Calling m_pTruthTool->fillNTuple"); - if (m_pTruthTool->fillNTuple(&summary).isFailure()) - ATH_MSG_WARNING("RunFromID: Cannot fill Truth in NTuple"); - } + // filling the Hough transfomr info in NTuple + if (m_doHoughTransform) { + ATH_MSG_DEBUG("Calling m_pCandidate->fillNTuple(with associated hough maxima)"); + if (m_pCandidate->fillNTuple(associated_maxima).isFailure()) ATH_MSG_WARNING( + "RunFromID: Could not include the Hough data into the Candidate NTuple"); + } - // clear temporay hough data structure - for (unsigned int i = 0; i < 16; i++) - for (unsigned int j = 0; j < 4; j++) - for (unsigned int k = 0; k < 2; k++) associated_maxima[i][j][k].clear(); + if (m_doNTuple && m_doTruth && pTrackParticle != NULL) { + ATH_MSG_DEBUG("Calling m_pTruthTool->fillNTuple"); + if (m_pTruthTool->fillNTuple(&summary).isFailure()) ATH_MSG_WARNING("RunFromID: Cannot fill Truth in NTuple"); + } + // clear temporay hough data structure + for (unsigned int i = 0; i < 16; i++) + for (unsigned int j = 0; j < 4; j++) + for (unsigned int k = 0; k < 2; k++) associated_maxima[i][j][k].clear(); } -void MuGirlRecoTool::doSAFit(const Trk::Track* RefittedTrack, MuGirlNS::CandidateSummary& summary) -{ +void MuGirlRecoTool::doSAFit(const Trk::Track* RefittedTrack, MuGirlNS::CandidateSummary& summary) { ATH_MSG_DEBUG("RunFromID: looking for an ms track ..."); std::unique_ptr<const Trk::Track> msTrack = - std::unique_ptr<const Trk::Track> - ( m_pGlobalFitTool->standAloneRefit(*RefittedTrack) ); + std::unique_ptr<const Trk::Track> + (m_pGlobalFitTool->standAloneRefit(*RefittedTrack)); if (msTrack) { - msTrack->info().setPatternRecognitionInfo(Trk::TrackInfo::MuGirl); - ATH_MSG_DEBUG("MS refit Trk::Track p " << fabs(1. / (msTrack->perigeeParameters()->parameters())[Trk::qOverP]) - << " pt " << msTrack->perigeeParameters()->pT() - << " eta " << msTrack->perigeeParameters()->eta()); - } else { - ATH_MSG_DEBUG("No refitted Track"); - } - m_pCandidate-> fillMSTrack(NULL, std::move(msTrack), &summary); + msTrack->info().setPatternRecognitionInfo(Trk::TrackInfo::MuGirl); + ATH_MSG_DEBUG("MS refit Trk::Track p " << fabs(1. / (msTrack->perigeeParameters()->parameters())[Trk::qOverP]) + << " pt " << msTrack->perigeeParameters()->pT() + << " eta " << msTrack->perigeeParameters()->eta()); + } else { + ATH_MSG_DEBUG("No refitted Track"); + } + m_pCandidate->fillMSTrack(NULL, std::move(msTrack), &summary); } - diff --git a/Reconstruction/PanTau/PanTauEvent/PanTauEvent/PanTauDetails.h b/Reconstruction/PanTau/PanTauEvent/PanTauEvent/PanTauDetails.h index 8fde52085f7eeafa34e53c0b1486076a2c1e7e22..971ff0080d9d016c249cc68a393d0849a10e5edc 100644 --- a/Reconstruction/PanTau/PanTauEvent/PanTauEvent/PanTauDetails.h +++ b/Reconstruction/PanTau/PanTauEvent/PanTauEvent/PanTauDetails.h @@ -11,8 +11,6 @@ -#include <iostream> -#include <bitset> #include "tauEvent/TauDetails.h" #include "PanTauEvent/PanTauSeed.h" @@ -247,13 +245,13 @@ public: protected: /** Only for transient object:*/ - PanTau::PanTauSeed* m_PanTauSeed; + PanTau::PanTauSeed* m_PanTauSeed{}; /** the features of the details */ - const TauFeature* m_features; + const TauFeature* m_features{}; /** the features of the seed */ - const TauSeed* m_seed; + const TauSeed* m_seed{}; static std::string s_className; @@ -266,63 +264,63 @@ protected: //! Basic PanTau Variables (validity, reco mode & momenta) //! ====================================================================== - int m_isPanTauCandidate; //!< tells you whether this tauRec seed is considered as candidate for PanTau - std::string m_Name_InputAlg; - int m_RecoMode_SubAlg; - int m_RecoMode_PanTau; - double m_BDTValue_1p0n_vs_1p1n; - double m_BDTValue_1p1n_vs_1pXn; - double m_BDTValue_3p0n_vs_3pXn; - double m_pantau_proto_pt; - double m_pantau_proto_eta; - double m_pantau_proto_phi; - double m_pantau_proto_m; - double m_pantau_final_pt; - double m_pantau_final_eta; - double m_pantau_final_phi; - double m_pantau_final_m; - - std::vector<double> m_ChargedEFOs_pt; - std::vector<double> m_ChargedEFOs_eta; - std::vector<double> m_ChargedEFOs_phi; - std::vector<double> m_ChargedEFOs_m; - - std::vector<double> m_NeutralEFOs_pt; - std::vector<double> m_NeutralEFOs_eta; - std::vector<double> m_NeutralEFOs_phi; - std::vector<double> m_NeutralEFOs_m; - - std::vector<double> m_Pi0NeutEFOs_pt; - std::vector<double> m_Pi0NeutEFOs_eta; - std::vector<double> m_Pi0NeutEFOs_phi; - std::vector<double> m_Pi0NeutEFOs_m; + int m_isPanTauCandidate{}; //!< tells you whether this tauRec seed is considered as candidate for PanTau + std::string m_Name_InputAlg{}; + int m_RecoMode_SubAlg{}; + int m_RecoMode_PanTau{}; + double m_BDTValue_1p0n_vs_1p1n{}; + double m_BDTValue_1p1n_vs_1pXn{}; + double m_BDTValue_3p0n_vs_3pXn{}; + double m_pantau_proto_pt{}; + double m_pantau_proto_eta{}; + double m_pantau_proto_phi{}; + double m_pantau_proto_m{}; + double m_pantau_final_pt{}; + double m_pantau_final_eta{}; + double m_pantau_final_phi{}; + double m_pantau_final_m{}; + + std::vector<double> m_ChargedEFOs_pt{}; + std::vector<double> m_ChargedEFOs_eta{}; + std::vector<double> m_ChargedEFOs_phi{}; + std::vector<double> m_ChargedEFOs_m{}; + + std::vector<double> m_NeutralEFOs_pt{}; + std::vector<double> m_NeutralEFOs_eta{}; + std::vector<double> m_NeutralEFOs_phi{}; + std::vector<double> m_NeutralEFOs_m{}; + + std::vector<double> m_Pi0NeutEFOs_pt{}; + std::vector<double> m_Pi0NeutEFOs_eta{}; + std::vector<double> m_Pi0NeutEFOs_phi{}; + std::vector<double> m_Pi0NeutEFOs_m{}; //! ====================================================================== //! ID Variables //! ====================================================================== - int m_eflowRec_Basic_NPi0NeutConsts; - int m_eflowRec_Basic_NNeutralConsts; - double m_eflowRec_Charged_HLV_SumPt; - double m_eflowRec_Charged_Ratio_EtOverEtAllConsts; - double m_eflowRec_Neutral_HLV_SumM; - double m_eflowRec_Neutral_PID_BDTValues_EtSort_1; - double m_eflowRec_Neutral_PID_BDTValues_BDTSort_2; - double m_eflowRec_Neutral_Ratio_EtOverEtAllConsts; - double m_eflowRec_Neutral_Mean_DRToLeading_WrtEtAllConsts; - double m_eflowRec_Combined_DeltaR1stNeutralTo1stCharged; - - int m_CellBased_Basic_NNeutralConsts; - double m_CellBased_Charged_JetMoment_EtDRxTotalEt; - double m_CellBased_Charged_StdDev_Et_WrtEtAllConsts; - double m_CellBased_Neutral_HLV_SumM; - double m_CellBased_Neutral_PID_BDTValues_BDTSort_1; - double m_CellBased_Neutral_PID_BDTValues_BDTSort_2; - double m_CellBased_Neutral_Ratio_1stBDTEtOverEtAllConsts; - double m_CellBased_Neutral_Ratio_EtOverEtAllConsts; - double m_CellBased_Neutral_Shots_NPhotonsInSeed; - double m_CellBased_Combined_DeltaR1stNeutralTo1stCharged; + int m_eflowRec_Basic_NPi0NeutConsts{}; + int m_eflowRec_Basic_NNeutralConsts{}; + double m_eflowRec_Charged_HLV_SumPt{}; + double m_eflowRec_Charged_Ratio_EtOverEtAllConsts{}; + double m_eflowRec_Neutral_HLV_SumM{}; + double m_eflowRec_Neutral_PID_BDTValues_EtSort_1{}; + double m_eflowRec_Neutral_PID_BDTValues_BDTSort_2{}; + double m_eflowRec_Neutral_Ratio_EtOverEtAllConsts{}; + double m_eflowRec_Neutral_Mean_DRToLeading_WrtEtAllConsts{}; + double m_eflowRec_Combined_DeltaR1stNeutralTo1stCharged{}; + + int m_CellBased_Basic_NNeutralConsts{}; + double m_CellBased_Charged_JetMoment_EtDRxTotalEt{}; + double m_CellBased_Charged_StdDev_Et_WrtEtAllConsts{}; + double m_CellBased_Neutral_HLV_SumM{}; + double m_CellBased_Neutral_PID_BDTValues_BDTSort_1{}; + double m_CellBased_Neutral_PID_BDTValues_BDTSort_2{}; + double m_CellBased_Neutral_Ratio_1stBDTEtOverEtAllConsts{}; + double m_CellBased_Neutral_Ratio_EtOverEtAllConsts{}; + double m_CellBased_Neutral_Shots_NPhotonsInSeed{}; + double m_CellBased_Combined_DeltaR1stNeutralTo1stCharged{}; diff --git a/Reconstruction/RecoAlgs/CaloRingerAlgs/python/CaloRingerFlags.py b/Reconstruction/RecoAlgs/CaloRingerAlgs/python/CaloRingerFlags.py index 404b65ab94bf82d5a46946aa6f9c9dc26e3fce8d..034d9ec52198e4fbc361751bec777b230f7c6a77 100644 --- a/Reconstruction/RecoAlgs/CaloRingerAlgs/python/CaloRingerFlags.py +++ b/Reconstruction/RecoAlgs/CaloRingerAlgs/python/CaloRingerFlags.py @@ -1,4 +1,4 @@ -# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +# Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration #======================================================================= # File: CaloRingerAlgs/python/CaloRingerFlags.py @@ -43,13 +43,13 @@ class CaloRingerFlagsJobProperty(JobProperty): return False jobproperties.CaloRingerFlags.add_JobProperty(CaloRingerFlagsJobProperty) -from AthenaCommon.Logging import logging +from AthenaCommon import Constants class OutputLevel(CaloRingerFlagsJobProperty): """ switch for all CaloRinger algorithms and tools """ statusOn = True allowedTypes = ['int'] - StoredValue = logging.INFO + StoredValue = Constants.INFO jobproperties.CaloRingerFlags.add_JobProperty(OutputLevel) #======================================================================= diff --git a/Reconstruction/eflowRec/eflowRec/PFRecoverSplitShowersTool.h b/Reconstruction/eflowRec/eflowRec/PFRecoverSplitShowersTool.h index b87e353f7c68b238a2f0a5380706c25b951f7212..e2464e788b01f88c67be787e26bcb7ae76d157cd 100644 --- a/Reconstruction/eflowRec/eflowRec/PFRecoverSplitShowersTool.h +++ b/Reconstruction/eflowRec/eflowRec/PFRecoverSplitShowersTool.h @@ -56,9 +56,6 @@ private: std::vector<eflowRecCluster*> m_clustersToConsider; std::vector<eflowRecTrack*> m_tracksToRecover; - double m_rCell; - double m_windowRms; - /* Tool for getting e/p values and hadronic shower cell ordering principle parameters */ ToolHandle<IEFlowCellEOverPTool> m_theEOverPTool{this,"eflowCellEOverPTool","eflowCellEOverPTool","Energy Flow E/P Values and Shower Parameters Tool"}; diff --git a/Reconstruction/eflowRec/eflowRec/eflowLookupExp.h b/Reconstruction/eflowRec/eflowRec/eflowLookupExp.h index af0e7c280aa205a58cba3d4d5401b3af984bcde9..9515dae2b9a63516b6ae37a5919138972ea64786 100644 --- a/Reconstruction/eflowRec/eflowRec/eflowLookupExp.h +++ b/Reconstruction/eflowRec/eflowRec/eflowLookupExp.h @@ -16,11 +16,19 @@ #include <stdexcept> #include <math.h> #include <memory> +#include <mutex> /** Lookup-table based exponential function to save CPU time, which is used by eflowCellIntegrator */ class eflowLookupExp{ public: static eflowLookupExp* getInstance(int nExpBins = 50, int nExpSubBins = 1000){ + + //Creation of the unique_ptr is not thread-safe - therefore we get a mutex and pass it to a lock-guard + //The lock is released automatically when getInstance returns + //The mutex is static so that all threads check the status of the *same* mutex + static std::mutex mutex_instance; + std::lock_guard<std::mutex> lock(mutex_instance); + if ( !m_instance) { m_instance = std::make_unique<eflowLookupExp>(nExpBins, nExpSubBins); } else { diff --git a/Reconstruction/eflowRec/eflowRec/eflowRingSubtractionManager.h b/Reconstruction/eflowRec/eflowRec/eflowRingSubtractionManager.h index a80da892c18087f73258ae34540c320bd77365c5..93a1f7ac8ffc06cf48c49ee5ea07aae81c8b6f46 100644 --- a/Reconstruction/eflowRec/eflowRec/eflowRingSubtractionManager.h +++ b/Reconstruction/eflowRec/eflowRec/eflowRingSubtractionManager.h @@ -35,10 +35,6 @@ class eflowRingSubtractionManager { eflowRingSubtractionManager(); ~eflowRingSubtractionManager() {} - static void setRMaxAndWeightRange(double rMax, double weightRange) { - m_rMax = rMax; - m_weightRange = weightRange; - } double fudgeMean() const {return m_fudgeMean;} double fudgeStdDev() const {return m_fudgeStdDev;} /* for eflowTauTool */ @@ -66,7 +62,7 @@ class eflowRingSubtractionManager { double m_fudgeMean; double m_fudgeStdDev; - static double m_rMax; - static double m_weightRange; + static constexpr double m_rMax = 0.75; + static constexpr double m_weightRange = 1.0e6; }; #endif diff --git a/Reconstruction/eflowRec/eflowRec/eflowTrackClusterLink.h b/Reconstruction/eflowRec/eflowRec/eflowTrackClusterLink.h index ac5dc5f279ad076a4b5a8410e2f9855d227d68e8..8c28ec9ec3149a301c36b0660b54b3984dd9c0e8 100644 --- a/Reconstruction/eflowRec/eflowRec/eflowTrackClusterLink.h +++ b/Reconstruction/eflowRec/eflowRec/eflowTrackClusterLink.h @@ -16,6 +16,7 @@ #include <map> #include <vector> #include <iostream> +#include <mutex> #include "GaudiKernel/ToolHandle.h" @@ -41,6 +42,11 @@ public: static eflowTrackClusterLink* getInstance(eflowRecTrack* track, eflowRecCluster* cluster){ std::pair<eflowRecTrack*, eflowRecCluster*> thisPair(std::make_pair(track, cluster)); + //Read and write from the map is not thread-safe - therefore we get a mutex and pass it to a lock-guard + //The lock is released automatically when getInstance returns + //The mutex is static so that all threads check the status of the *same* mutex + static std::mutex mutex_instance; + std::lock_guard<std::mutex> lock(mutex_instance); /* The find returns a valid iterator. If there is no existing entry it returns the end iterator */ InstanceMap::iterator mapIterator = m_instances.find(thisPair); @@ -67,6 +73,7 @@ private: std::vector<double> m_clusterIntegral; static InstanceMap m_instances; + }; #endif /* EFLOWTRACKCLUSTERLINK_H_ */ diff --git a/Reconstruction/eflowRec/src/PFRecoverSplitShowersTool.cxx b/Reconstruction/eflowRec/src/PFRecoverSplitShowersTool.cxx index 24271b832693e87c8a995dc504dc3883c67ec2a7..af67af5927a161fa5b7b58c27eef0a92af69623e 100644 --- a/Reconstruction/eflowRec/src/PFRecoverSplitShowersTool.cxx +++ b/Reconstruction/eflowRec/src/PFRecoverSplitShowersTool.cxx @@ -28,12 +28,9 @@ using namespace eflowSubtract; PFRecoverSplitShowersTool::PFRecoverSplitShowersTool(const std::string& type,const std::string& name,const IInterface* parent): base_class(type, name, parent), m_eflowCaloObjectContainer(0), - m_rCell(0.75), - m_windowRms(0.032), m_binnedParameters(std::make_unique<eflowEEtaBinnedParameters>()), m_nTrackClusterMatches(0) { - eflowRingSubtractionManager::setRMaxAndWeightRange(m_rCell, 1.0e6); } PFRecoverSplitShowersTool::~PFRecoverSplitShowersTool() {} diff --git a/Reconstruction/eflowRec/src/eflowRingSubtractionManager.cxx b/Reconstruction/eflowRec/src/eflowRingSubtractionManager.cxx index 5200b248d65eab296f70c2691dbaf7fff23a008a..5d80a31d5a1f48832f2d45fb5c6d6f4335be523c 100644 --- a/Reconstruction/eflowRec/src/eflowRingSubtractionManager.cxx +++ b/Reconstruction/eflowRec/src/eflowRingSubtractionManager.cxx @@ -23,10 +23,6 @@ CREATED: 18th Aug, 2005 using std::vector; -double eflowRingSubtractionManager::m_rMax = 0.75; -double eflowRingSubtractionManager::m_weightRange = 1.0e6; - - eflowRingSubtractionManager::eflowRingSubtractionManager() : m_ringThickness(eflowCalo::nRegions), m_fudgeMean(0), m_fudgeStdDev(-1) {} double eflowRingSubtractionManager::ringMeanRank(const vector<double>& p, double rMin, double rMax) const { diff --git a/Reconstruction/egamma/EgammaPhysValMonitoring/src/EgammaPhysValMonitoringTool.cxx b/Reconstruction/egamma/EgammaPhysValMonitoring/src/EgammaPhysValMonitoringTool.cxx index 4b5b70db396dececff108ae535117063a0050f6e..53875a449a1ded65815e09907b880e25b333866a 100644 --- a/Reconstruction/egamma/EgammaPhysValMonitoring/src/EgammaPhysValMonitoringTool.cxx +++ b/Reconstruction/egamma/EgammaPhysValMonitoring/src/EgammaPhysValMonitoringTool.cxx @@ -160,11 +160,12 @@ StatusCode EgammaPhysValMonitoringTool::fillHistograms() float y = tmp->decayVtx()->y(); trueR = sqrt( x*x + y*y ); } - if (tmp) + + if (tmp != nullptr ) { truthEta = tmp->eta(); + isTrueConv = xAOD::EgammaHelpers::isTrueConvertedPhoton(tmp);//rel20 + } -// if( trueR>=0 && trueR<800 ) isTrueConv = true;//rel19 - isTrueConv = xAOD::EgammaHelpers::isTrueConvertedPhoton(tmp);//rel20 m_oPhotonValidationPlots.convTruthR->Fill(trueR); m_oPhotonValidationPlots.convTruthRvsEta->Fill(trueR,truthEta); if(isTrueConv) m_oPhotonValidationPlots.m_oTruthIsoConvPlots.fill(*truthParticle); diff --git a/Reconstruction/egamma/egammaAlgs/src/egammaForwardBuilder.cxx b/Reconstruction/egamma/egammaAlgs/src/egammaForwardBuilder.cxx index 58d6e4f8d505aa2a5de6bbf021abdee51fea7156..8f02aa37c752bab4676e65a04012e0d40a95a3aa 100644 --- a/Reconstruction/egamma/egammaAlgs/src/egammaForwardBuilder.cxx +++ b/Reconstruction/egamma/egammaAlgs/src/egammaForwardBuilder.cxx @@ -28,7 +28,7 @@ // CONSTRUCTOR: egammaForwardBuilder::egammaForwardBuilder(const std::string& name, ISvcLocator* pSvcLocator): - AthAlgorithm(name, pSvcLocator), + AthReentrantAlgorithm(name, pSvcLocator), m_timingProfile("ChronoStatSvc", name) { } @@ -59,109 +59,60 @@ StatusCode egammaForwardBuilder::initialize() ATH_CHECK(m_outClusterContainerCellLinkKey.initialize()); // retrieve object quality tool - RetrieveObjectQualityTool(); - - if (m_doChrono) ATH_CHECK( m_timingProfile.retrieve() ); + if (m_objectQualityTool.name()!="") { + ATH_CHECK(m_objectQualityTool.retrieve()); + } else { + ATH_MSG_DEBUG("egammaOQFlagsBuilder is disabled"); + } // retrieve 4-mom builder: - CHECK(RetrieveEMFourMomBuilder()); - + if (!m_fourMomBuilder.empty()) { + ATH_CHECK(m_fourMomBuilder.retrieve()); + } - for (const auto& selector : m_forwardelectronIsEMselectors) { - CHECK(selector.retrieve()); + for (const auto& selector : m_forwardElectronIsEMSelectors) { + ATH_CHECK(selector.retrieve()); } - if (m_forwardelectronIsEMselectors.size() != m_forwardelectronIsEMselectorResultNames.size()) { + if (m_forwardElectronIsEMSelectors.size() != m_forwardElectronIsEMSelectorResultNames.size()) { ATH_MSG_ERROR("The number of selectors does not match the number of given fwd-electron selector names"); return StatusCode::FAILURE; } + if (m_doChrono) ATH_CHECK( m_timingProfile.retrieve() ); ATH_MSG_DEBUG("Initialization completed successfully"); - return StatusCode::SUCCESS; -} - -// ==================================================================== -void egammaForwardBuilder::RetrieveObjectQualityTool() -{ - // - // retrieve object quality tool - // - if (m_objectqualityTool.name()=="") { - ATH_MSG_INFO("egammaOQFlagsBuilder is disabled"); - return; - } - - if(m_objectqualityTool.retrieve().isFailure()) { - ATH_MSG_ERROR("Unable to retrieve " << m_objectqualityTool - << ", turning it off"); - } - else ATH_MSG_DEBUG("Retrieved Tool " << m_objectqualityTool); - - return; -} - -StatusCode egammaForwardBuilder::RetrieveEMFourMomBuilder() -{ - // - // retrieve EMFourMomBuilder tool - // - - if (m_fourMomBuilder.empty()) { - ATH_MSG_ERROR("EMFourMomBuilder is empty"); - return StatusCode::FAILURE; - } - - - if(m_fourMomBuilder.retrieve().isFailure()) { - ATH_MSG_ERROR("Unable to retrieve "<<m_fourMomBuilder); - return StatusCode::FAILURE; - } - else ATH_MSG_DEBUG("Retrieved Tool "<<m_fourMomBuilder); - return StatusCode::SUCCESS; } // ==================================================================== StatusCode egammaForwardBuilder::finalize() { - // - // finalize method - // - return StatusCode::SUCCESS; } // ====================================================================== -StatusCode egammaForwardBuilder::execute() +StatusCode egammaForwardBuilder::execute_r(const EventContext& ctx) const { - // - // athena execute method - // - - // This we can drop once the Alg becomes re-entrant - const EventContext ctx = Gaudi::Hive::currentContext(); - ATH_MSG_DEBUG("Executing egammaForwardBuilder "); // create an egamma container and register it - SG::WriteHandle<xAOD::ElectronContainer> xaodFrwd(m_electronOutputKey); + SG::WriteHandle<xAOD::ElectronContainer> xaodFrwd(m_electronOutputKey, ctx); ATH_CHECK(xaodFrwd.record(std::make_unique<xAOD::ElectronContainer>(), std::make_unique<xAOD::ElectronAuxContainer>())); ATH_MSG_DEBUG( "Recorded Electrons with key: " << m_electronOutputKey.key() ); - //cluster - SG::WriteHandle<xAOD::CaloClusterContainer> outClusterContainer(m_outClusterContainerKey); + SG::WriteHandle<xAOD::CaloClusterContainer> outClusterContainer(m_outClusterContainerKey, ctx); ATH_CHECK(outClusterContainer.record(std::make_unique<xAOD::CaloClusterContainer>(), std::make_unique<xAOD::CaloClusterAuxContainer>())); - SG::WriteHandle<CaloClusterCellLinkContainer> outClusterContainerCellLink(m_outClusterContainerCellLinkKey); + SG::WriteHandle<CaloClusterCellLinkContainer> outClusterContainerCellLink(m_outClusterContainerCellLinkKey, ctx); ATH_CHECK(outClusterContainerCellLink.record(std::make_unique<CaloClusterCellLinkContainer>())); //Topo cluster Container - SG::ReadHandle<xAOD::CaloClusterContainer> cluster(m_topoClusterKey); + SG::ReadHandle<xAOD::CaloClusterContainer> cluster(m_topoClusterKey, ctx); // check is only used for serial running; remove when MT scheduler used // --used to be a warning with SUCCESS, but that won't work in MT @@ -188,7 +139,6 @@ StatusCode egammaForwardBuilder::execute() el->setAuthor( xAOD::EgammaParameters::AuthorFwdElectron ); - xAOD::CaloCluster *newcluster = new xAOD::CaloCluster(**clus_begin); outClusterContainer->push_back(newcluster); @@ -202,21 +152,21 @@ StatusCode egammaForwardBuilder::execute() el->setCaloClusterLinks(linksToClusters); //do Four Momentum - CHECK(m_fourMomBuilder->execute(ctx, el)); + ATH_CHECK(m_fourMomBuilder->execute(ctx, el)); // do object quality - CHECK( ExecObjectQualityTool(ctx, el) ); + ATH_CHECK( ExecObjectQualityTool(ctx, el) ); // FwdSelectors: - size_t size = m_forwardelectronIsEMselectors.size(); + size_t size = m_forwardElectronIsEMSelectors.size(); for (size_t i = 0; i<size;++i) { - asg::AcceptData accept = m_forwardelectronIsEMselectors[i]->accept(ctx, el); + asg::AcceptData accept = m_forwardElectronIsEMSelectors[i]->accept(ctx, el); //save the bool result - el->setPassSelection(static_cast<bool>(accept), m_forwardelectronIsEMselectorResultNames[i]); + el->setPassSelection(static_cast<bool>(accept), m_forwardElectronIsEMSelectorResultNames[i]); //save the isem - el->setSelectionisEM(accept.getCutResultInverted(), "isEM"+m_forwardelectronIsEMselectorResultNames[i]); + el->setSelectionisEM(accept.getCutResultInverted(), "isEM"+m_forwardElectronIsEMSelectorResultNames[i]); } } @@ -236,7 +186,7 @@ StatusCode egammaForwardBuilder::execute() } // =========================================================== -StatusCode egammaForwardBuilder::ExecObjectQualityTool(const EventContext& ctx, xAOD::Egamma *eg) +StatusCode egammaForwardBuilder::ExecObjectQualityTool(const EventContext& ctx, xAOD::Egamma *eg) const { // // execution of the object quality tools @@ -245,18 +195,17 @@ StatusCode egammaForwardBuilder::ExecObjectQualityTool(const EventContext& ctx, // return success as algorithm may be able to run without it // in degraded mode - if (m_objectqualityTool.name()=="") return StatusCode::SUCCESS; + if (m_objectQualityTool.name()=="") return StatusCode::SUCCESS; // setup chrono for this tool - std::string chronoName=this->name()+"_"+m_objectqualityTool->name() ; + std::string chronoName=this->name()+"_"+m_objectQualityTool->name() ; if (m_doChrono) m_timingProfile->chronoStart(chronoName); // execute the tool - StatusCode sc = m_objectqualityTool->execute(ctx, eg); + StatusCode sc = m_objectQualityTool->execute(ctx, eg); if ( sc.isFailure() ) { ATH_MSG_DEBUG("failure returned by object quality tool"); } - if (m_doChrono) m_timingProfile->chronoStop(chronoName); return sc; diff --git a/Reconstruction/egamma/egammaAlgs/src/egammaForwardBuilder.h b/Reconstruction/egamma/egammaAlgs/src/egammaForwardBuilder.h index 07c62a1f72b91394fb94b8fe24c17d3bf6cdc0e1..a2b6788f52384cf78465478801f9c059a40b093d 100644 --- a/Reconstruction/egamma/egammaAlgs/src/egammaForwardBuilder.h +++ b/Reconstruction/egamma/egammaAlgs/src/egammaForwardBuilder.h @@ -22,7 +22,7 @@ */ // -#include "AthenaBaseComps/AthAlgorithm.h" +#include "AthenaBaseComps/AthReentrantAlgorithm.h" #include "GaudiKernel/ToolHandle.h" #include "GaudiKernel/IChronoStatSvc.h" #include "GaudiKernel/ServiceHandle.h" @@ -45,7 +45,7 @@ #include <string> -class egammaForwardBuilder : public AthAlgorithm +class egammaForwardBuilder : public AthReentrantAlgorithm { public: @@ -56,23 +56,21 @@ class egammaForwardBuilder : public AthAlgorithm ~egammaForwardBuilder(); /** @brief initialize method*/ - StatusCode initialize() override final; + virtual StatusCode initialize() override final; /** @brief finalize method*/ - StatusCode finalize() override final; + virtual StatusCode finalize() override final; /** @brief execute method*/ - StatusCode execute() override final; + virtual StatusCode execute_r(const EventContext& ctx) const override final; /** @brief retrieve object quality tool */ void RetrieveObjectQualityTool(); - /** @brief retrieve 4-mom builder */ - StatusCode RetrieveEMFourMomBuilder(); /** @brief execute object quality tool */ - StatusCode ExecObjectQualityTool(const EventContext &ctx, xAOD::Egamma *eg); + StatusCode ExecObjectQualityTool(const EventContext &ctx, xAOD::Egamma *eg) const; private: /** @brief Tool to perform object quality*/ - ToolHandle<IegammaBaseTool> m_objectqualityTool {this, + ToolHandle<IegammaBaseTool> m_objectQualityTool {this, "ObjectQualityToolName", "", "Name of the object quality tool (empty tool name ignored)"}; @@ -112,11 +110,11 @@ class egammaForwardBuilder : public AthAlgorithm ServiceHandle<IChronoStatSvc> m_timingProfile; protected: /** Handle to the selectors */ - ToolHandleArray<IAsgForwardElectronIsEMSelector> m_forwardelectronIsEMselectors {this, + ToolHandleArray<IAsgForwardElectronIsEMSelector> m_forwardElectronIsEMSelectors {this, "forwardelectronIsEMselectors", {}, "The selectors that we need to apply to the FwdElectron object"}; - Gaudi::Property<std::vector<std::string> > m_forwardelectronIsEMselectorResultNames {this, + Gaudi::Property<std::vector<std::string> > m_forwardElectronIsEMSelectorResultNames {this, "forwardelectronIsEMselectorResultNames", {}, "The selector result names"}; diff --git a/Reconstruction/egamma/egammaPerformance/egammaPerformance/forwardElectronMonTool.h b/Reconstruction/egamma/egammaPerformance/egammaPerformance/forwardElectronMonTool.h index b9df738f0d28c9fc945b65fa8bba8b0ec90abb7e..f1844ba855ebfc0758476ef9215f522dc6ef1a9d 100644 --- a/Reconstruction/egamma/egammaPerformance/egammaPerformance/forwardElectronMonTool.h +++ b/Reconstruction/egamma/egammaPerformance/egammaPerformance/forwardElectronMonTool.h @@ -82,11 +82,11 @@ class forwardElectronMonTool : public egammaMonToolBase std::vector<TH1*> m_hvTightSecondR; // second R std::vector<TH1*> m_hvTightCenterL; // center lambda + TH1 *m_hLB_N; // Histogram for number of forward electrons vs LB unsigned int m_lumiBlockNumber; unsigned int m_nForwardElectronsInCurrentLB; std::vector<int> m_nForwardElectronsPerLumiBlock; unsigned int m_nForwardElectrons; - TH1 *m_hLB_N; // Histogram for number of forward electrons vs LB }; diff --git a/Reconstruction/egamma/egammaPerformance/share/egammaMonitoring_jobOptions.py b/Reconstruction/egamma/egammaPerformance/share/egammaMonitoring_jobOptions.py index 91b745cad1bfc540f53056c0266e05c0c8446a0a..1ff2a9c6bcb71e43f5f16c2ba27b2218f460c889 100644 --- a/Reconstruction/egamma/egammaPerformance/share/egammaMonitoring_jobOptions.py +++ b/Reconstruction/egamma/egammaPerformance/share/egammaMonitoring_jobOptions.py @@ -115,9 +115,9 @@ if DQMonFlags.monManEnvironment() in ('tier0','tier0ESD','online', 'AOD'): phMonTool.FilterTools += [ monbadlb ] if jobproperties.Beam.beamType()=='collisions' and hasattr(ToolSvc, 'DQFilledBunchFilterTool'): - phMonTool.FilterTools.append(monFilledBunchFilterTool) - ToolSvc+=phMonTool - monManEgamma.AthenaMonTools += [ "photonMonTool/phMonTool" ] + phMonTool.FilterTools += [monFilledBunchFilterTool] + #ToolSvc+=phMonTool + monManEgamma.AthenaMonTools += [ phMonTool ] if DQMonFlags.useTrigger(): phMonToolWithTrigger = photonMonTool(name= "phMonToolWithTrigger", @@ -132,9 +132,9 @@ if DQMonFlags.monManEnvironment() in ('tier0','tier0ESD','online', 'AOD'): phMonToolWithTrigger.FilterTools += [ monbadlb ] if jobproperties.Beam.beamType()=='collisions' and hasattr(ToolSvc, 'DQFilledBunchFilterTool'): - phMonToolWithTrigger.FilterTools.append(monFilledBunchFilterTool) - ToolSvc+=phMonToolWithTrigger - monManEgamma.AthenaMonTools += [ "photonMonTool/phMonToolWithTrigger" ] + phMonToolWithTrigger.FilterTools += [monFilledBunchFilterTool] + #ToolSvc+=phMonToolWithTrigger + monManEgamma.AthenaMonTools += [ phMonToolWithTrigger ] if(egammaMonitorElectrons): @@ -149,9 +149,9 @@ if DQMonFlags.monManEnvironment() in ('tier0','tier0ESD','online', 'AOD'): ) elMonTool.FilterTools += [ monbadlb ] if jobproperties.Beam.beamType()=='collisions' and hasattr(ToolSvc, 'DQFilledBunchFilterTool'): - elMonTool.FilterTools.append(monFilledBunchFilterTool) - ToolSvc+=elMonTool - monManEgamma.AthenaMonTools += [ "electronMonTool/elMonTool" ] + elMonTool.FilterTools += [monFilledBunchFilterTool] + #ToolSvc+=elMonTool + monManEgamma.AthenaMonTools += [ elMonTool ] print elMonTool if DQMonFlags.useTrigger(): @@ -165,9 +165,9 @@ if DQMonFlags.monManEnvironment() in ('tier0','tier0ESD','online', 'AOD'): ) elMonToolWithTrigger.FilterTools += [ monbadlb ] if jobproperties.Beam.beamType()=='collisions' and hasattr(ToolSvc, 'DQFilledBunchFilterTool'): - elMonToolWithTrigger.FilterTools.append(monFilledBunchFilterTool) - ToolSvc+=elMonToolWithTrigger - monManEgamma.AthenaMonTools += [ "electronMonTool/elMonToolWithTrigger" ] + elMonToolWithTrigger.FilterTools += [monFilledBunchFilterTool] + #ToolSvc+=elMonToolWithTrigger + monManEgamma.AthenaMonTools += [ elMonToolWithTrigger ] print elMonToolWithTrigger @@ -184,9 +184,9 @@ if DQMonFlags.monManEnvironment() in ('tier0','tier0ESD','online', 'AOD'): fwdMonTool.FilterTools += [ monbadlb ] if jobproperties.Beam.beamType()=='collisions' and hasattr(ToolSvc, 'DQFilledBunchFilterTool'): - fwdMonTool.FilterTools.append(monFilledBunchFilterTool) - ToolSvc+=fwdMonTool - monManEgamma.AthenaMonTools += [ "forwardElectronMonTool/fwdMonTool" ] + fwdMonTool.FilterTools += [monFilledBunchFilterTool] + #ToolSvc+=fwdMonTool + monManEgamma.AthenaMonTools += [ fwdMonTool ] if(egammaMonitorZee): from egammaPerformance.egammaPerformanceConf import ZeeTaPMonTool @@ -205,9 +205,9 @@ if DQMonFlags.monManEnvironment() in ('tier0','tier0ESD','online', 'AOD'): ) if jobproperties.Beam.beamType()=='collisions' and hasattr(ToolSvc, 'DQFilledBunchFilterTool'): - ZeeMonTool.FilterTools.append(monFilledBunchFilterTool) - ToolSvc+=ZeeMonTool - monManEgamma.AthenaMonTools += [ "ZeeTaPMonTool/ZeeMonTool" ] + ZeeMonTool.FilterTools += [monFilledBunchFilterTool] + #ToolSvc+=ZeeMonTool + monManEgamma.AthenaMonTools += [ ZeeMonTool ] if(egammaMonitorJPsi): from egammaPerformance.egammaPerformanceConf import ZeeTaPMonTool @@ -225,9 +225,9 @@ if DQMonFlags.monManEnvironment() in ('tier0','tier0ESD','online', 'AOD'): OutputLevel = egammaMonOutputLevel, ) if jobproperties.Beam.beamType()=='collisions' and hasattr(ToolSvc, 'DQFilledBunchFilterTool'): - JPsiMonTool.FilterTools.append(monFilledBunchFilterTool) - ToolSvc+=JPsiMonTool - monManEgamma.AthenaMonTools += [ "ZeeTaPMonTool/JPsiMonTool" ] + JPsiMonTool.FilterTools += [monFilledBunchFilterTool] + #ToolSvc+=JPsiMonTool + monManEgamma.AthenaMonTools += [ JPsiMonTool ] if(egammaMonitorUpsilon1S): from egammaPerformance.egammaPerformanceConf import physicsMonTool @@ -245,8 +245,8 @@ if DQMonFlags.monManEnvironment() in ('tier0','tier0ESD','online', 'AOD'): TrigDecisionTool = MyTrigDecisionTool, UseTrigger = MyDoTrigger) - ToolSvc+=Upsilon1SMonTool - monManEgamma.AthenaMonTools += [ "physicsMonTool/Upsilon1SMonTool" ] + #ToolSvc+=Upsilon1SMonTool + monManEgamma.AthenaMonTools += [ Upsilon1SMonTool ] if(egammaMonitorUpsilon2S): @@ -265,8 +265,8 @@ if DQMonFlags.monManEnvironment() in ('tier0','tier0ESD','online', 'AOD'): TrigDecisionTool = MyTrigDecisionTool, UseTrigger = MyDoTrigger) - ToolSvc+=Upsilon2SMonTool - monManEgamma.AthenaMonTools += [ "physicsMonTool/Upsilon2SMonTool" ] + #ToolSvc+=Upsilon2SMonTool + monManEgamma.AthenaMonTools += [ Upsilon2SMonTool ] if(egammaMonitorWenu): from egammaPerformance.egammaPerformanceConf import ephysicsMonTool @@ -290,8 +290,8 @@ if DQMonFlags.monManEnvironment() in ('tier0','tier0ESD','online', 'AOD'): TrigDecisionTool = MyTrigDecisionTool, UseTrigger = MyDoTrigger) - ToolSvc+=WenuMonTool - monManEgamma.AthenaMonTools += [ "ephysicsMonTool/WenuMonTool" ] + #ToolSvc+=WenuMonTool + monManEgamma.AthenaMonTools += [ WenuMonTool ] if(egammaMonitorTop): from egammaPerformance.egammaPerformanceConf import TopphysicsMonTool @@ -315,8 +315,8 @@ if DQMonFlags.monManEnvironment() in ('tier0','tier0ESD','online', 'AOD'): TrigDecisionTool = MyTrigDecisionTool, UseTrigger = MyDoTrigger) - ToolSvc+=TopMonTool - monManEgamma.AthenaMonTools += [ "TopphysicsMonTool/TopMonTool" ] + #ToolSvc+=TopMonTool + monManEgamma.AthenaMonTools += [ TopMonTool ] diff --git a/Reconstruction/egamma/egammaPerformance/share/egammaMonitoring_jobOptions_aod.py b/Reconstruction/egamma/egammaPerformance/share/egammaMonitoring_jobOptions_aod.py index aa95f7893bf83a26eeef4d09c8207042cff2c571..d318840a25c1bfa71df64e4b14c3c2e15f6a6e9e 100644 --- a/Reconstruction/egamma/egammaPerformance/share/egammaMonitoring_jobOptions_aod.py +++ b/Reconstruction/egamma/egammaPerformance/share/egammaMonitoring_jobOptions_aod.py @@ -97,10 +97,10 @@ if DQMonFlags.monManEnvironment() == 'tier0ESD': phMonTool.FilterTools += [ monbadlb ] - if jobproperties.Beam.beamType()=='collisions' and hasattr(ToolSvc, 'DQFilledBunchFilterTool'): - phMonTool.FilterTools.append(monFilledBunchFilterTool) - ToolSvc+=phMonTool - monManEgamma.AthenaMonTools += [ "photonMonTool/phMonTool" ] + if jobproperties.Beam.beamType()=='collisions' and hasattr(#ToolSvc, 'DQFilledBunchFilterTool'): + phMonTool.FilterTools += [monFilledBunchFilterTool] + #ToolSvc+=phMonTool + monManEgamma.AthenaMonTools += [ phMonTool ] if(egammaMonitorElectrons): from egammaPerformance.egammaPerformanceConf import electronMonTool @@ -118,10 +118,10 @@ if DQMonFlags.monManEnvironment() == 'tier0ESD': elMonTool.FilterTools += [ monbadlb ] - if jobproperties.Beam.beamType()=='collisions' and hasattr(ToolSvc, 'DQFilledBunchFilterTool'): - elMonTool.FilterTools.append(monFilledBunchFilterTool) - ToolSvc+=elMonTool - monManEgamma.AthenaMonTools += [ "electronMonTool/elMonTool" ] + if jobproperties.Beam.beamType()=='collisions' and hasattr(#ToolSvc, 'DQFilledBunchFilterTool'): + elMonTool.FilterTools += [monFilledBunchFilterTool] + #ToolSvc+=elMonTool + monManEgamma.AthenaMonTools += [ elMonTool ] if(egammaMonitorFwdEg): @@ -135,10 +135,10 @@ if DQMonFlags.monManEnvironment() == 'tier0ESD': fwdMonTool.FilterTools += [ monbadlb ] - if jobproperties.Beam.beamType()=='collisions' and hasattr(ToolSvc, 'DQFilledBunchFilterTool'): - fwdMonTool.FilterTools.append(monFilledBunchFilterTool) - ToolSvc+=fwdMonTool - monManEgamma.AthenaMonTools += [ "forwardEgammaMonTool/fwdMonTool" ] + if jobproperties.Beam.beamType()=='collisions' and hasattr(#ToolSvc, 'DQFilledBunchFilterTool'): + fwdMonTool.FilterTools += [monFilledBunchFilterTool] + #ToolSvc+=fwdMonTool + monManEgamma.AthenaMonTools += [ fwdMonTool ] if(egammaMonitorSoftEg): from egammaPerformance.egammaPerformanceConf import softEMonTool @@ -155,10 +155,10 @@ if DQMonFlags.monManEnvironment() == 'tier0ESD': sfMonTool.FilterTools += [ monbadlb ] - if jobproperties.Beam.beamType()=='collisions' and hasattr(ToolSvc, 'DQFilledBunchFilterTool'): - sfMonTool.FilterTools.append(monFilledBunchFilterTool) - ToolSvc+=sfMonTool - monManEgamma.AthenaMonTools += [ "softEMonTool/sfMonTool" ] + if jobproperties.Beam.beamType()=='collisions' and hasattr(#ToolSvc, 'DQFilledBunchFilterTool'): + sfMonTool.FilterTools += [monFilledBunchFilterTool] + #ToolSvc+=sfMonTool + monManEgamma.AthenaMonTools += [ sfMonTool ] if(egammaMonitorZee): @@ -177,8 +177,8 @@ if DQMonFlags.monManEnvironment() == 'tier0ESD': TrigDecisionTool = MyTrigDecisionTool, UseTrigger = DQMonFlags.useTrigger()) - ToolSvc+=ZeeMonTool - monManEgamma.AthenaMonTools += [ "physicsMonTool/ZeeMonTool" ] + #ToolSvc+=ZeeMonTool + monManEgamma.AthenaMonTools += [ ZeeMonTool ] if(egammaMonitorJPsi): from egammaPerformance.egammaPerformanceConf import physicsMonTool @@ -196,8 +196,8 @@ if DQMonFlags.monManEnvironment() == 'tier0ESD': TrigDecisionTool = MyTrigDecisionTool, UseTrigger = DQMonFlags.useTrigger()) - ToolSvc+=JPsiMonTool - monManEgamma.AthenaMonTools += [ "physicsMonTool/JPsiMonTool" ] + #ToolSvc+=JPsiMonTool + monManEgamma.AthenaMonTools += [ JPsiMonTool ] if(egammaMonitorUpsilon1S): @@ -216,8 +216,8 @@ if DQMonFlags.monManEnvironment() == 'tier0ESD': TrigDecisionTool = MyTrigDecisionTool, UseTrigger = DQMonFlags.useTrigger()) - ToolSvc+=Upsilon1SMonTool - monManEgamma.AthenaMonTools += [ "physicsMonTool/Upsilon1SMonTool" ] + #ToolSvc+=Upsilon1SMonTool + monManEgamma.AthenaMonTools += [ Upsilon1SMonTool ] if(egammaMonitorUpsilon2S): @@ -236,8 +236,8 @@ if DQMonFlags.monManEnvironment() == 'tier0ESD': TrigDecisionTool = MyTrigDecisionTool, UseTrigger = DQMonFlags.useTrigger()) - ToolSvc+=Upsilon2SMonTool - monManEgamma.AthenaMonTools += [ "physicsMonTool/Upsilon2SMonTool" ] + #ToolSvc+=Upsilon2SMonTool + monManEgamma.AthenaMonTools += [ Upsilon2SMonTool ] if(egammaMonitorWenu): from egammaPerformance.egammaPerformanceConf import ephysicsMonTool @@ -261,8 +261,8 @@ if DQMonFlags.monManEnvironment() == 'tier0ESD': TrigDecisionTool = MyTrigDecisionTool, UseTrigger = DQMonFlags.useTrigger()) - ToolSvc+=WenuMonTool - monManEgamma.AthenaMonTools += [ "ephysicsMonTool/WenuMonTool" ] + #ToolSvc+=WenuMonTool + monManEgamma.AthenaMonTools += [ WenuMonTool ] if(egammaMonitorTop): @@ -287,8 +287,8 @@ if DQMonFlags.monManEnvironment() == 'tier0ESD': TrigDecisionTool = MyTrigDecisionTool, UseTrigger = DQMonFlags.useTrigger()) - ToolSvc+=TopMonTool - monManEgamma.AthenaMonTools += [ "TopphysicsMonTool/TopMonTool" ] + #ToolSvc+=TopMonTool + monManEgamma.AthenaMonTools += [ TopMonTool ] diff --git a/Reconstruction/egamma/egammaPerformance/share/egamma_MonitorTool.py b/Reconstruction/egamma/egammaPerformance/share/egamma_MonitorTool.py index 6ea8c9dd6f802d8318e4bc0d1278033390a0ed7e..8c4869e9a8d91d6f575992cb188c6b75dd11e72c 100755 --- a/Reconstruction/egamma/egammaPerformance/share/egamma_MonitorTool.py +++ b/Reconstruction/egamma/egammaPerformance/share/egamma_MonitorTool.py @@ -37,8 +37,8 @@ phMonTool = photonMonTool(name= "phMonTool", Photon_Selection_Items = ["all","tight"]) -ToolSvc+=phMonTool -monMan.AthenaMonTools += [ "photonMonTool/phMonTool" ] +#ToolSvc+=phMonTool +monMan.AthenaMonTools += [ phMonTool ] from egammaPerformance.egammaPerformanceConf import electronMonTool elMonTool = electronMonTool(name= "elMonTool", @@ -49,16 +49,16 @@ elMonTool = electronMonTool(name= "elMonTool", Electron_Trigger_Items = ["EF_e10_medium"], Electron_Selection_Items = ["all","loose","medium","tight"]) -ToolSvc+=elMonTool -monMan.AthenaMonTools += [ "electronMonTool/elMonTool" ] +#ToolSvc+=elMonTool +monMan.AthenaMonTools += [ elMonTool ] from egammaPerformance.egammaPerformanceConf import forwardEgammaMonTool fwdMonTool = forwardEgammaMonTool(name= "fwdMonTool", ElectronContainer ="ElectronAODCollection", Electron_Selection_Items = ["all","tight","loose"]) -ToolSvc+=fwdMonTool -monMan.AthenaMonTools += [ "forwardEgammaMonTool/fwdMonTool" ] +#ToolSvc+=fwdMonTool +monMan.AthenaMonTools += [ fwdMonTool ] from egammaPerformance.egammaPerformanceConf import physicsMonTool @@ -73,8 +73,8 @@ ZeeMonTool = physicsMonTool(name= "ZeeMonTool", massLowerCut = 70000, massUpperCut = 110000) -ToolSvc+=ZeeMonTool -monMan.AthenaMonTools += [ "physicsMonTool/ZeeMonTool" ] +#ToolSvc+=ZeeMonTool +monMan.AthenaMonTools += [ ZeeMonTool ] from egammaPerformance.egammaPerformanceConf import physicsMonTool JPsiMonTool = physicsMonTool(name= "JPsiMonTool", @@ -88,8 +88,8 @@ JPsiMonTool = physicsMonTool(name= "JPsiMonTool", massLowerCut = 1000, massUpperCut = 5000) -ToolSvc+=JPsiMonTool -monMan.AthenaMonTools += [ "physicsMonTool/JPsiMonTool" ] +#ToolSvc+=JPsiMonTool +monMan.AthenaMonTools += [ JPsiMonTool ] from egammaPerformance.egammaPerformanceConf import physicsMonTool Upsilon1SMonTool = physicsMonTool(name= "Upsilon1SMonTool", @@ -103,8 +103,8 @@ Upsilon1SMonTool = physicsMonTool(name= "Upsilon1SMonTool", massLowerCut = 5000, massUpperCut = 15000) -ToolSvc+=Upsilon1SMonTool -monMan.AthenaMonTools += [ "physicsMonTool/Upsilon1SMonTool" ] +#ToolSvc+=Upsilon1SMonTool +monMan.AthenaMonTools += [ Upsilon1SMonTool ] from egammaPerformance.egammaPerformanceConf import physicsMonTool @@ -119,8 +119,8 @@ Upsilon2SMonTool = physicsMonTool(name= "Upsilon2SMonTool", massLowerCut = 5000, massUpperCut = 15000) -ToolSvc+=Upsilon2SMonTool -monMan.AthenaMonTools += [ "physicsMonTool/Upsilon2SMonTool" ] +#ToolSvc+=Upsilon2SMonTool +monMan.AthenaMonTools += [ Upsilon2SMonTool ] @@ -143,8 +143,8 @@ WenuMonTool = ephysicsMonTool(name= "WenuMonTool", JetEnergyCut = 30000, DeltaRCut = 1) -ToolSvc+=WenuMonTool -monMan.AthenaMonTools += [ "ephysicsMonTool/WenuMonTool" ] +#ToolSvc+=WenuMonTool +monMan.AthenaMonTools += [ WenuMonTool ] diff --git a/Reconstruction/egamma/egammaPerformance/src/forwardElectronMonTool.cxx b/Reconstruction/egamma/egammaPerformance/src/forwardElectronMonTool.cxx index e7085dc75d63b512c4a00cc41d3af4c265c226a7..50801a32578152785cf5a33e30d5fb66323ea747 100644 --- a/Reconstruction/egamma/egammaPerformance/src/forwardElectronMonTool.cxx +++ b/Reconstruction/egamma/egammaPerformance/src/forwardElectronMonTool.cxx @@ -87,15 +87,15 @@ forwardElectronMonTool::forwardElectronMonTool(const std::string & type, const s m_hEta(nullptr), m_hPhi(nullptr), m_hEtaPhi(nullptr), - //m_hTopoEtCone40(nullptr), m_hTime(nullptr), m_hTightN(nullptr), m_hTightEt(nullptr), m_hTightEta(nullptr), m_hTightPhi(nullptr), m_hTightEtaPhi(nullptr), - //m_hTightTopoEtCone40(nullptr), - m_hTightTime(nullptr) + m_hTightTime(nullptr), + m_hLB_N(nullptr), + m_nForwardElectrons(0) { // Name of the electron collection declareProperty("ForwardElectronContainer", m_ForwardElectronContainer = "egammaForwardCollection", "Name of the forward electron collection" ); diff --git a/Reconstruction/egamma/egammaValidation/CMakeLists.txt b/Reconstruction/egamma/egammaValidation/CMakeLists.txt index feac5ec885dfdc9529babec983efecb5befd0fdf..2f3d7b4cc5436705b2a78fcc5f24f28cf08c8d1f 100644 --- a/Reconstruction/egamma/egammaValidation/CMakeLists.txt +++ b/Reconstruction/egamma/egammaValidation/CMakeLists.txt @@ -19,6 +19,7 @@ atlas_depends_on_subdirs( PRIVATE PhysicsAnalysis/Interfaces/EgammaAnalysisInterfaces PhysicsAnalysis/AnalysisCommon/PATCore PhysicsAnalysis/MCTruthClassifier + PhysicsAnalysis/IsolationSelection TestPolicy Tracking/TrkValidation/TrkValHistUtils ) diff --git a/Reconstruction/egamma/egammaValidation/src/EgammaMonitoring.cxx b/Reconstruction/egamma/egammaValidation/src/EgammaMonitoring.cxx index 2cde033b11af9a0fb58077620911667464807012..b9f3a2f0010b83856c464e30891086a46b5e14d8 100644 --- a/Reconstruction/egamma/egammaValidation/src/EgammaMonitoring.cxx +++ b/Reconstruction/egamma/egammaValidation/src/EgammaMonitoring.cxx @@ -12,6 +12,10 @@ EgammaMonitoring::EgammaMonitoring(const std::string &name, ISvcLocator *pSvcLoc m_LooseLH("AsgElectronLikelihoodTool/LooseLH"), m_MediumLH("AsgElectronLikelihoodTool/MediumLH"), m_TightLH("AsgElectronLikelihoodTool/TightLH"), + m_IsoFixedCutTight("CP::IsolationSelectionTool/IsoFixedCutTight"), + m_IsoFixedCutTightTrackOnly("CP::IsolationSelectionTool/IsoFixedCutTightTrackOnly"), + m_IsoFixedCutTightCaloOnly("CP::IsolationSelectionTool/IsoFixedCutTightCaloOnly"), + m_IsoFixedCutLoose("CP::IsolationSelectionTool/IsoFixedCutLoose"), m_mcTruthClassifier("MCTruthClassifier/MCTruthClassifier") { declareProperty("sampleType", m_sampleType = "Unknown", "Descriptive name for the processed type of particle"); } @@ -22,72 +26,59 @@ StatusCode EgammaMonitoring::initialize() { ATH_MSG_INFO("******************** Running over " << m_sampleType << " ******************"); ATH_CHECK(service("THistSvc", rootHistSvc)); - showerShapesAll = std::unique_ptr<egammaMonitoring::ShowerShapesHistograms>( - new egammaMonitoring::ShowerShapesHistograms( - "showerShapesAll","Shower Shapes ", "/MONITORING/showerShapesAll/", rootHistSvc - )); + showerShapesAll = std::unique_ptr<egammaMonitoring::ShowerShapesHistograms>(new egammaMonitoring::ShowerShapesHistograms( + "showerShapesAll","Shower Shapes ", "/MONITORING/showerShapesAll/", rootHistSvc)); - showerShapes10GeV = std::unique_ptr<egammaMonitoring::ShowerShapesHistograms>( - new egammaMonitoring::ShowerShapesHistograms( - "showerShapes10GeV","Shower Shapes - 10 GeV", "/MONITORING/showerShapes10GeV/", rootHistSvc - )); + showerShapes10GeV = std::unique_ptr<egammaMonitoring::ShowerShapesHistograms>(new egammaMonitoring::ShowerShapesHistograms( + "showerShapes10GeV","Shower Shapes - 10 GeV", "/MONITORING/showerShapes10GeV/", rootHistSvc)); + + isolationAll = std::unique_ptr<egammaMonitoring::IsolationHistograms>(new egammaMonitoring::IsolationHistograms( + "isolationAll","Isolation ", "/MONITORING/isolationAll/", rootHistSvc)); ATH_CHECK(showerShapesAll->initializePlots()); ATH_CHECK(showerShapes10GeV->initializePlots()); + ATH_CHECK(isolationAll->initializePlots()); if ("electron" == m_sampleType) { - truthElectronAll = std::unique_ptr<egammaMonitoring::IHistograms>( - new egammaMonitoring::TruthElectronHistograms( - "truthElectronAll","All Truth Electrons", "/MONITORING/truthElectronAll/", rootHistSvc - )); + truthElectronAll = std::unique_ptr<egammaMonitoring::IHistograms>(new egammaMonitoring::TruthElectronHistograms( + "truthElectronAll","All Truth Electrons", "/MONITORING/truthElectronAll/", rootHistSvc)); + + truthPromptElectronAll = std::unique_ptr<egammaMonitoring::IHistograms>(new egammaMonitoring::TruthElectronHistograms( + "truthPromptElectronAll","All Truth Prompt Electrons", "/MONITORING/truthPromptElectronAll/", rootHistSvc)); - truthPromptElectronAll = std::unique_ptr<egammaMonitoring::IHistograms>( - new egammaMonitoring::TruthElectronHistograms( - "truthPromptElectronAll","All Truth Prompt Electrons", "/MONITORING/truthPromptElectronAll/", rootHistSvc - )); + truthElectronRecoElectronAll = std::unique_ptr<egammaMonitoring::IHistograms>(new egammaMonitoring::TruthElectronHistograms( + "truthElectronRecoElectronAll","Truth Electrons Reco Electron", "/MONITORING/truthElectronRecoElectronAll/", rootHistSvc)); - truthElectronRecoElectronAll = std::unique_ptr<egammaMonitoring::IHistograms>( - new egammaMonitoring::TruthElectronHistograms( - "truthElectronRecoElectronAll","Truth Electrons Reco Electron", "/MONITORING/truthElectronRecoElectronAll/", rootHistSvc - )); + truthPromptElectronWithTrack = std::unique_ptr<egammaMonitoring::IHistograms>(new egammaMonitoring::TruthElectronHistograms( + "truthPromptElectronWithTrack","Truth Prompt Electrons With Track", "/MONITORING/truthPromptElectronWithTrack/", rootHistSvc)); - truthPromptElectronWithTrack = std::unique_ptr<egammaMonitoring::IHistograms>( - new egammaMonitoring::TruthElectronHistograms( - "truthPromptElectronWithTrack","Truth Prompt Electrons With Track", "/MONITORING/truthPromptElectronWithTrack/", rootHistSvc - )); + truthPromptElectronWithGSFTrack = std::unique_ptr<egammaMonitoring::IHistograms>(new egammaMonitoring::TruthElectronHistograms( + "truthPromptElectronWithGSFTrack","Truth Prompt Electrons With GSFTrack", "/MONITORING/truthPromptElectronWithGSFTrack/", rootHistSvc)); - truthPromptElectronWithGSFTrack = std::unique_ptr<egammaMonitoring::IHistograms>( - new egammaMonitoring::TruthElectronHistograms( - "truthPromptElectronWithGSFTrack","Truth Prompt Electrons With GSFTrack", "/MONITORING/truthPromptElectronWithGSFTrack/", rootHistSvc - )); + truthPromptElectronWithReco = std::unique_ptr<egammaMonitoring::IHistograms>(new egammaMonitoring::TruthElectronHistograms( + "truthPromptElectronWithReco","Truth Prompt Electrons With GSFTrack", "/MONITORING/truthPromptElectronWithReco/", rootHistSvc)); - truthPromptElectronWithReco = std::unique_ptr<egammaMonitoring::IHistograms>( - new egammaMonitoring::TruthElectronHistograms( - "truthPromptElectronWithReco","Truth Prompt Electrons With GSFTrack", "/MONITORING/truthPromptElectronWithReco/", rootHistSvc - )); + recoElectronAll = std::unique_ptr<egammaMonitoring::IHistograms>(new egammaMonitoring::RecoElectronHistograms( + "recoElectronAll","Electrons Reco Electron", "/MONITORING/recoElectronAll/", rootHistSvc)); - recoElectronAll = std::unique_ptr<egammaMonitoring::IHistograms>( - new egammaMonitoring::RecoElectronHistograms( - "recoElectronAll","Electrons Reco Electron", "/MONITORING/recoElectronAll/", rootHistSvc + truthRecoElectronLooseLH = std::unique_ptr<egammaMonitoring::IHistograms>(new egammaMonitoring::TruthElectronHistograms( + "truthRecoElectronLooseLH","LLH Electrons Reco Electron", "/MONITORING/truthRecoElectronLooseLH/", rootHistSvc)); - )); - truthRecoElectronLooseLH = std::unique_ptr<egammaMonitoring::IHistograms>( - new egammaMonitoring::TruthElectronHistograms( - "truthRecoElectronLooseLH","LLH Electrons Reco Electron", "/MONITORING/truthRecoElectronLooseLH/", rootHistSvc + truthRecoElectronMediumLH = std::unique_ptr<egammaMonitoring::IHistograms>(new egammaMonitoring::TruthElectronHistograms( + "truthRecoElectronMediumLH","MLH Electrons Reco Electron", "/MONITORING/truthRecoElectronMediumLH/", rootHistSvc)); - )); - truthRecoElectronMediumLH = std::unique_ptr<egammaMonitoring::IHistograms>( - new egammaMonitoring::TruthElectronHistograms( - "truthRecoElectronMediumLH","MLH Electrons Reco Electron", "/MONITORING/truthRecoElectronMediumLH/", rootHistSvc + truthRecoElectronTightLH = std::unique_ptr<egammaMonitoring::IHistograms>(new egammaMonitoring::TruthElectronHistograms( + "truthRecoElectronTightLH","TLH Electrons Reco Electron", "/MONITORING/truthRecoElectronTightLH/", rootHistSvc)); + recoElectronIsoFixedCutTight = std::unique_ptr<egammaMonitoring::IHistograms>(new egammaMonitoring::TruthElectronHistograms( + "recoElectronIsoFixedCutTight","Isolation Fixed Cut Tight Electrons Reco Electron", "/MONITORING/recoElectronIsoFixedCutTight/", rootHistSvc)); - )); - truthRecoElectronTightLH = std::unique_ptr<egammaMonitoring::IHistograms>( - new egammaMonitoring::TruthElectronHistograms( - "truthRecoElectronTightLH","TLH Electrons Reco Electron", "/MONITORING/truthRecoElectronTightLH/", rootHistSvc + recoElectronIsoFixedCutTightTrackOnly = std::unique_ptr<egammaMonitoring::IHistograms>(new egammaMonitoring::TruthElectronHistograms( + "recoElectronIsoFixedCutTightTrackOnly","Isolation Fixed Cut Tight Track Only Electrons Reco Electron", "/MONITORING/recoElectronIsoFixedCutTightTrackOnly/", rootHistSvc)); - )); + recoElectronIsoFixedCutLoose = std::unique_ptr<egammaMonitoring::IHistograms>(new egammaMonitoring::TruthElectronHistograms( + "recoElectronIsoFixedCutLoose","Isolation Fixed Cut Loose Electrons Reco Electron", "/MONITORING/recoElectronIsoFixedCutLoose/", rootHistSvc)); ATH_CHECK(recoElectronAll->initializePlots()); ATH_CHECK(truthRecoElectronLooseLH->initializePlots()); @@ -99,82 +90,71 @@ StatusCode EgammaMonitoring::initialize() { ATH_CHECK(truthPromptElectronWithTrack->initializePlots()); ATH_CHECK(truthPromptElectronWithGSFTrack->initializePlots()); ATH_CHECK(truthPromptElectronWithReco->initializePlots()); + ATH_CHECK(recoElectronIsoFixedCutTight->initializePlots()); + ATH_CHECK(recoElectronIsoFixedCutTightTrackOnly->initializePlots()); + ATH_CHECK(recoElectronIsoFixedCutLoose->initializePlots()); } // electron Hists if ("gamma" == m_sampleType) { - recoPhotonAll = std::unique_ptr<egammaMonitoring::IHistograms>( - new egammaMonitoring::RecoPhotonHistograms( - "recoPhotonAll","Reco Photon", "/MONITORING/recoPhotonAll/", rootHistSvc + recoPhotonAll = std::unique_ptr<egammaMonitoring::IHistograms>(new egammaMonitoring::RecoPhotonHistograms( + "recoPhotonAll","Reco Photon", "/MONITORING/recoPhotonAll/", rootHistSvc)); - )); + truthPhotonRecoPhoton = std::unique_ptr<egammaMonitoring::IHistograms>(new egammaMonitoring::TruthPhotonHistograms( + "truthPhotonRecoPhoton","truthPhotonRecoPhoton", "/MONITORING/truthPhotonRecoPhoton/", rootHistSvc)); - truthPhotonRecoPhoton = std::unique_ptr<egammaMonitoring::IHistograms>( - new egammaMonitoring::TruthPhotonHistograms( - "truthPhotonRecoPhoton","truthPhotonRecoPhoton", "/MONITORING/truthPhotonRecoPhoton/", rootHistSvc + truthPhotonConvPhoton = std::unique_ptr<egammaMonitoring::IHistograms>(new egammaMonitoring::TruthPhotonHistograms( + "truthConvPhoton","truthConvPhoton", "/MONITORING/truthConvPhoton/", rootHistSvc)); - )); + truthPhotonConvRecoConv = std::unique_ptr<egammaMonitoring::IHistograms>(new egammaMonitoring::TruthPhotonHistograms( + "truthConvRecoConv","truthConvRecoConv", "/MONITORING/truthConvRecoConv/", rootHistSvc)); - truthPhotonConvPhoton = std::unique_ptr<egammaMonitoring::IHistograms>( - new egammaMonitoring::TruthPhotonHistograms( - "truthConvPhoton","truthConvPhoton", "/MONITORING/truthConvPhoton/", rootHistSvc + truthPhotonConvRecoConv1Si = std::unique_ptr<egammaMonitoring::IHistograms>(new egammaMonitoring::TruthPhotonHistograms( + "truthConvRecoConv1Si","truthConvRecoConv1Si", "/MONITORING/truthConvRecoConv1Si/", rootHistSvc)); - )); - truthPhotonConvRecoConv = std::unique_ptr<egammaMonitoring::IHistograms>( - new egammaMonitoring::TruthPhotonHistograms( - "truthConvRecoConv","truthConvRecoConv", "/MONITORING/truthConvRecoConv/", rootHistSvc + truthPhotonConvRecoConv1TRT = std::unique_ptr<egammaMonitoring::IHistograms>(new egammaMonitoring::TruthPhotonHistograms( + "truthConvRecoConv1TRT","truthConvRecoConv1TRT", "/MONITORING/truthConvRecoConv1TRT/", rootHistSvc)); - )); - truthPhotonConvRecoConv1Si = std::unique_ptr<egammaMonitoring::IHistograms>( - new egammaMonitoring::TruthPhotonHistograms( - "truthConvRecoConv1Si","truthConvRecoConv1Si", "/MONITORING/truthConvRecoConv1Si/", rootHistSvc + truthPhotonConvRecoConv2Si = std::unique_ptr<egammaMonitoring::IHistograms>(new egammaMonitoring::TruthPhotonHistograms( + "truthConvRecoConv2Si","truthConvRecoConv2Si", "/MONITORING/truthConvRecoConv2Si/", rootHistSvc)); - )); - truthPhotonConvRecoConv1TRT = std::unique_ptr<egammaMonitoring::IHistograms>( - new egammaMonitoring::TruthPhotonHistograms( - "truthConvRecoConv1TRT","truthConvRecoConv1TRT", "/MONITORING/truthConvRecoConv1TRT/", rootHistSvc + truthPhotonConvRecoConv2TRT = std::unique_ptr<egammaMonitoring::IHistograms>(new egammaMonitoring::TruthPhotonHistograms( + "truthConvRecoConv2TRT","truthConvRecoConv2TRT", "/MONITORING/truthConvRecoConv2TRT/", rootHistSvc)); - )); - truthPhotonConvRecoConv2Si = std::unique_ptr<egammaMonitoring::IHistograms>( - new egammaMonitoring::TruthPhotonHistograms( - "truthConvRecoConv2Si","truthConvRecoConv2Si", "/MONITORING/truthConvRecoConv2Si/", rootHistSvc + truthPhotonConvRecoConv2SiTRT = std::unique_ptr<egammaMonitoring::IHistograms>(new egammaMonitoring::TruthPhotonHistograms( + "truthConvRecoConv2SiTRT","truthConvRecoConv2SiTRT", "/MONITORING/truthConvRecoConv2SiTRT/", rootHistSvc)); - )); - truthPhotonConvRecoConv2TRT = std::unique_ptr<egammaMonitoring::IHistograms>( - new egammaMonitoring::TruthPhotonHistograms( - "truthConvRecoConv2TRT","truthConvRecoConv2TRT", "/MONITORING/truthConvRecoConv2TRT/", rootHistSvc + truthPhotonConvRecoUnconv= std::unique_ptr<egammaMonitoring::IHistograms>(new egammaMonitoring::TruthPhotonHistograms( + "truthConvRecoUnconv","truthConvRecoUnconv", "/MONITORING/truthConvRecoUnconv/", rootHistSvc)); - )); + truthPhotonUnconvPhoton= std::unique_ptr<egammaMonitoring::IHistograms>(new egammaMonitoring::TruthPhotonHistograms( + "truthUnconvPhoton","truthUnconvPhoton", "/MONITORING/truthUnconvPhoton/", rootHistSvc)); - truthPhotonConvRecoConv2SiTRT = std::unique_ptr<egammaMonitoring::IHistograms>( - new egammaMonitoring::TruthPhotonHistograms( - "truthConvRecoConv2SiTRT","truthConvRecoConv2SiTRT", "/MONITORING/truthConvRecoConv2SiTRT/", rootHistSvc + truthPhotonUnconvRecoConv= std::unique_ptr<egammaMonitoring::IHistograms>(new egammaMonitoring::TruthPhotonHistograms( + "truthUnconvRecoConv","truthUnconvRecoConv", "/MONITORING/truthUnconvRecoConv/", rootHistSvc)); - )); - truthPhotonConvRecoUnconv= std::unique_ptr<egammaMonitoring::IHistograms>( - new egammaMonitoring::TruthPhotonHistograms( - "truthConvRecoUnconv","truthConvRecoUnconv", "/MONITORING/truthConvRecoUnconv/", rootHistSvc + truthPhotonUnconvRecoUnconv = std::unique_ptr<egammaMonitoring::IHistograms>(new egammaMonitoring::TruthPhotonHistograms( + "truthUnconvRecoUnconv","truthUnconvRecoUnconv", "/MONITORING/truthUnconvRecoUnconv/", rootHistSvc)); - )); + recoPhotonUnconvIsoFixedCutTight = std::unique_ptr<egammaMonitoring::IHistograms>(new egammaMonitoring::TruthPhotonHistograms( + "recoPhotonUnconvIsoFixedCutTight","Isolation Fixed Cut Tight Photons Reco Photon", "/MONITORING/recoPhotonUnconvIsoFixedCutTight/", rootHistSvc)); - truthPhotonUnconvPhoton= std::unique_ptr<egammaMonitoring::IHistograms>( - new egammaMonitoring::TruthPhotonHistograms( - "truthUnconvPhoton","truthUnconvPhoton", "/MONITORING/truthUnconvPhoton/", rootHistSvc + recoPhotonUnconvIsoFixedCutTightCaloOnly = std::unique_ptr<egammaMonitoring::IHistograms>(new egammaMonitoring::TruthPhotonHistograms( + "recoPhotonUnconvIsoFixedCutTightCaloOnly","Isolation Fixed Cut Tight Calo Only Photons Reco Photon", "/MONITORING/recoPhotonUnconvIsoFixedCutTightCaloOnly/", rootHistSvc)); - )); - truthPhotonUnconvRecoConv= std::unique_ptr<egammaMonitoring::IHistograms>( - new egammaMonitoring::TruthPhotonHistograms( - "truthUnconvRecoConv","truthUnconvRecoConv", "/MONITORING/truthUnconvRecoConv/", rootHistSvc + recoPhotonUnconvIsoFixedCutLoose = std::unique_ptr<egammaMonitoring::IHistograms>(new egammaMonitoring::TruthPhotonHistograms( + "recoPhotonUnconvIsoFixedCutLoose","Isolation Fixed Cut Loose Photons Reco Photon", "/MONITORING/recoPhotonUnconvIsoFixedCutLoose/", rootHistSvc)); - )); - truthPhotonUnconvRecoUnconv = std::unique_ptr<egammaMonitoring::IHistograms>( - new egammaMonitoring::TruthPhotonHistograms( - "truthUnconvRecoUnconv","truthUnconvRecoUnconv", "/MONITORING/truthUnconvRecoUnconv/", rootHistSvc + recoPhotonConvIsoFixedCutTight = std::unique_ptr<egammaMonitoring::IHistograms>(new egammaMonitoring::TruthPhotonHistograms( + "recoPhotonConvIsoFixedCutTight","Isolation Fixed Cut Tight Photons Reco Photon", "/MONITORING/recoPhotonConvIsoFixedCutTight/", rootHistSvc)); - )); + recoPhotonConvIsoFixedCutTightCaloOnly = std::unique_ptr<egammaMonitoring::IHistograms>(new egammaMonitoring::TruthPhotonHistograms( + "recoPhotonConvIsoFixedCutTightCaloOnly","Isolation Fixed Cut Tight Calo Only Photons Reco Photon", "/MONITORING/recoPhotonConvIsoFixedCutTightCaloOnly/", rootHistSvc)); + recoPhotonConvIsoFixedCutLoose = std::unique_ptr<egammaMonitoring::IHistograms>(new egammaMonitoring::TruthPhotonHistograms( + "recoPhotonConvIsoFixedCutLoose","Isolation Fixed Cut Loose Photons Reco Photon", "/MONITORING/recoPhotonConvIsoFixedCutLoose/", rootHistSvc)); ATH_CHECK(recoPhotonAll->initializePlots()); @@ -190,6 +170,12 @@ StatusCode EgammaMonitoring::initialize() { ATH_CHECK(truthPhotonUnconvPhoton->initializePlots()); ATH_CHECK(truthPhotonUnconvRecoConv->initializePlots()); ATH_CHECK(truthPhotonUnconvRecoUnconv->initializePlots()); + ATH_CHECK(recoPhotonUnconvIsoFixedCutTight->initializePlots()); + ATH_CHECK(recoPhotonUnconvIsoFixedCutTightCaloOnly->initializePlots()); + ATH_CHECK(recoPhotonUnconvIsoFixedCutLoose->initializePlots()); + ATH_CHECK(recoPhotonConvIsoFixedCutTight->initializePlots()); + ATH_CHECK(recoPhotonConvIsoFixedCutTightCaloOnly->initializePlots()); + ATH_CHECK(recoPhotonConvIsoFixedCutLoose->initializePlots()); } // gamma Hists @@ -203,6 +189,18 @@ StatusCode EgammaMonitoring::initialize() { //*****************TLH Requirement******************** ATH_CHECK(m_TightLH.setProperty("WorkingPoint", "TightLHElectron")); ATH_CHECK(m_TightLH.initialize()); + + //*****************Iso Requirements******************** + ATH_CHECK(m_IsoFixedCutTight.setProperty("ElectronWP", "FixedCutTight")); + ATH_CHECK(m_IsoFixedCutTight.setProperty("PhotonWP", "FixedCutTight")); + ATH_CHECK(m_IsoFixedCutTight.initialize()); + ATH_CHECK(m_IsoFixedCutTightTrackOnly.setProperty("ElectronWP", "FixedCutTightTrackOnly")); + ATH_CHECK(m_IsoFixedCutTightTrackOnly.initialize()); + ATH_CHECK(m_IsoFixedCutTightCaloOnly.setProperty("PhotonWP", "FixedCutTightCaloOnly")); + ATH_CHECK(m_IsoFixedCutTightCaloOnly.initialize()); + ATH_CHECK(m_IsoFixedCutLoose.setProperty("ElectronWP", "FixedCutLoose")); + ATH_CHECK(m_IsoFixedCutLoose.setProperty("PhotonWP", "FixedCutLoose")); + ATH_CHECK(m_IsoFixedCutLoose.initialize()); //*****************MC Truth Classifier Requirement******************** ATH_CHECK(m_mcTruthClassifier.retrieve()); @@ -246,7 +244,7 @@ StatusCode EgammaMonitoring::execute() { if ("electron" == m_sampleType) { - // Retrieve electrons + // Retrieve electrons const xAOD::ElectronContainer *RecoEl = nullptr; if (!evtStore()->retrieve(RecoEl, "Electrons").isSuccess()) { ATH_MSG_ERROR("Failed to retrieve electron container. Exiting."); @@ -272,7 +270,7 @@ StatusCode EgammaMonitoring::execute() { unsigned int promtpElectronTruthIndex = - 9; for (auto truth : *truthParticles) { - if (!truth) continue; + if (!truth) continue; if (fabs(truth->pdgId()) != 11) continue; auto res = m_mcTruthClassifier->particleTruthClassifier(truth); @@ -288,16 +286,16 @@ StatusCode EgammaMonitoring::execute() { << " TO " << TO << " TT " << TT << " eventNumber " << eventInfo->eventNumber() ); - - // Check if it is the prompt electron - if (TO == MCTruthPartClassifier::SingleElec && - TT == MCTruthPartClassifier::IsoElectron && truth->barcode() == 10001) { + + // Check if it is the prompt electron + if (TO == MCTruthPartClassifier::SingleElec && + TT == MCTruthPartClassifier::IsoElectron && truth->barcode() == 10001) { truthPromptElectronAll->fill(*truth); promtpElectronTruthIndex = truth->index(); } - + // Check that it is not from geant4 if ( TT != MCTruthPartClassifier::NonPrimary) truthElectronAll->fill(*truth); @@ -306,7 +304,7 @@ StatusCode EgammaMonitoring::execute() { ATH_MSG_DEBUG( "------------ InDetTracks ---------------" ); bool foundPromptElectron = false; - + for (auto tp : *InDetTracks) { if (!tp) continue; @@ -329,9 +327,9 @@ StatusCode EgammaMonitoring::execute() { auto res2 = m_mcTruthClassifier->particleTruthClassifier(truth); MCTruthPartClassifier::ParticleOrigin TO = res2.second; MCTruthPartClassifier::ParticleType TT = res2.first; - if (TO == MCTruthPartClassifier::SingleElec && - TT == MCTruthPartClassifier::IsoElectron && - truth->index() == promtpElectronTruthIndex && !foundPromptElectron ) { + if (TO == MCTruthPartClassifier::SingleElec && + TT == MCTruthPartClassifier::IsoElectron && + truth->index() == promtpElectronTruthIndex && !foundPromptElectron ) { // we found the track from the prompt electron // let's count it @@ -346,7 +344,7 @@ StatusCode EgammaMonitoring::execute() { // but we need to make sure that we double count if already found the track // foundPromptElectron will check that - if ((firstElTruth->index() == promtpElectronTruthIndex) && + if ((firstElTruth->index() == promtpElectronTruthIndex) && (!foundPromptElectron)) { truthPromptElectronWithTrack->fill(*firstElTruth); foundPromptElectron = true; @@ -359,7 +357,7 @@ StatusCode EgammaMonitoring::execute() { ATH_MSG_DEBUG( "------------ GSFTracks ---------------" ); foundPromptElectron = false; - + for (auto gsf : *GSFTracks) { if (!gsf) continue; @@ -396,9 +394,9 @@ StatusCode EgammaMonitoring::execute() { << " TT " << TT << " eventNumber " << eventInfo->eventNumber() ); - if (TO == MCTruthPartClassifier::SingleElec && - TT == MCTruthPartClassifier::IsoElectron && - truth->index() == promtpElectronTruthIndex && !foundPromptElectron ) { + if (TO == MCTruthPartClassifier::SingleElec && + TT == MCTruthPartClassifier::IsoElectron && + truth->index() == promtpElectronTruthIndex && !foundPromptElectron ) { // we found the track from the prompt electron // let's count it @@ -418,7 +416,7 @@ StatusCode EgammaMonitoring::execute() { // this is not a prompt electron, we need to check the parents // but we need to make sure that we double count if already found the track // foundPromptElectron will check that - if ((firstElTruth->index() == promtpElectronTruthIndex) && + if ((firstElTruth->index() == promtpElectronTruthIndex) && (!foundPromptElectron)) { truthPromptElectronWithGSFTrack->fill(*firstElTruth); foundPromptElectron = true; @@ -437,21 +435,21 @@ StatusCode EgammaMonitoring::execute() { if (!elrec) continue; recoElectronAll->fill(*elrec); - showerShapesAll->fill(*elrec); + isolationAll->fill(*elrec); if ((elrec->pt()) / 1000. > 10.) showerShapes10GeV->fill(*elrec); const xAOD::TruthParticle *truth = xAOD::TruthHelpers::getTruthParticle(*elrec); if (!truth ) continue; truthElectronRecoElectronAll->fill(*truth); - if (fabs(truth->pdgId()) != 11) continue; + if (fabs(truth->pdgId()) != 11) continue; auto res2 = m_mcTruthClassifier->particleTruthClassifier(truth); MCTruthPartClassifier::ParticleOrigin TO = res2.second; MCTruthPartClassifier::ParticleType TT = res2.first; - if (TO == MCTruthPartClassifier::SingleElec && - TT == MCTruthPartClassifier::IsoElectron && - truth->index() == promtpElectronTruthIndex && !foundPromptElectron ) { + if (TO == MCTruthPartClassifier::SingleElec && + TT == MCTruthPartClassifier::IsoElectron && + truth->index() == promtpElectronTruthIndex && !foundPromptElectron ) { // we found the track from the prompt electron // let's count it @@ -460,6 +458,9 @@ StatusCode EgammaMonitoring::execute() { if (m_LooseLH->accept(elrec)) truthRecoElectronLooseLH->fill(*truth); if (m_MediumLH->accept(elrec)) truthRecoElectronMediumLH->fill(*truth); if (m_TightLH->accept(elrec)) truthRecoElectronTightLH->fill(*truth); + if (m_IsoFixedCutTight->accept(*elrec)) recoElectronIsoFixedCutTight->fill(*truth); + if (m_IsoFixedCutTightTrackOnly->accept(*elrec)) recoElectronIsoFixedCutTightTrackOnly->fill(*truth); + if (m_IsoFixedCutLoose->accept(*elrec)) recoElectronIsoFixedCutLoose->fill(*truth); } else { const xAOD::TruthParticle *firstElTruth = xAOD::EgammaHelpers::getBkgElectronMother(truth); @@ -474,6 +475,9 @@ StatusCode EgammaMonitoring::execute() { if (m_LooseLH->accept(elrec)) truthRecoElectronLooseLH->fill(*firstElTruth); if (m_MediumLH->accept(elrec)) truthRecoElectronMediumLH->fill(*firstElTruth); if (m_TightLH->accept(elrec)) truthRecoElectronTightLH->fill(*firstElTruth); + if (m_IsoFixedCutTight->accept(*elrec)) recoElectronIsoFixedCutTight->fill(*firstElTruth); + if (m_IsoFixedCutTightTrackOnly->accept(*elrec)) recoElectronIsoFixedCutTightTrackOnly->fill(*firstElTruth); + if (m_IsoFixedCutLoose->accept(*elrec)) recoElectronIsoFixedCutLoose->fill(*firstElTruth); } } @@ -499,6 +503,7 @@ StatusCode EgammaMonitoring::execute() { if (!phrec) continue; recoPhotonAll->fill(*phrec); + isolationAll->fill(*phrec); showerShapesAll->fill(*phrec); if (phrec->pt()) showerShapes10GeV->fill(*phrec); @@ -534,6 +539,9 @@ StatusCode EgammaMonitoring::execute() { if (convType == xAOD::EgammaParameters::doubleTRT) truthPhotonConvRecoConv2TRT->fill(*egtruth); if (convType == xAOD::EgammaParameters::doubleSiTRT) truthPhotonConvRecoConv2SiTRT->fill(*egtruth); + if (m_IsoFixedCutTight->accept(*photon)) recoPhotonConvIsoFixedCutTight->fill(*egtruth); + if (m_IsoFixedCutTightCaloOnly->accept(*photon)) recoPhotonConvIsoFixedCutTightCaloOnly->fill(*egtruth); + if (m_IsoFixedCutLoose->accept(*photon)) recoPhotonConvIsoFixedCutLoose->fill(*egtruth); } // isRecoConv else truthPhotonConvRecoUnconv->fill(*egtruth); @@ -545,6 +553,9 @@ StatusCode EgammaMonitoring::execute() { if (isRecoConv) truthPhotonUnconvRecoConv->fill(*egtruth); else truthPhotonUnconvRecoUnconv->fill(*egtruth); + if (m_IsoFixedCutTight->accept(*photon)) recoPhotonUnconvIsoFixedCutTight->fill(*egtruth); + if (m_IsoFixedCutTightCaloOnly->accept(*photon)) recoPhotonUnconvIsoFixedCutTightCaloOnly->fill(*egtruth); + if (m_IsoFixedCutLoose->accept(*photon)) recoPhotonUnconvIsoFixedCutLoose->fill(*egtruth); } // !isTrueLateConv } //egtruth Loop } // if gamma @@ -565,17 +576,20 @@ StatusCode EgammaMonitoring::finalize() { egammaMonitoring::EfficiencyPlot matchingEfficiency("matchingEfficiency", "/MONITORING/matchingEfficiency/", rootHistSvc ); ATH_CHECK(matchingEfficiency.divide(truthPromptElectronWithReco, truthPromptElectronWithGSFTrack)); egammaMonitoring::EfficiencyPlot reconstructionEfficiency("reconstructionEfficiency", "/MONITORING/reconstructionEfficiency/", rootHistSvc ); - ATH_CHECK(reconstructionEfficiency.divide(truthPromptElectronWithReco, truthPromptElectronAll)); + ATH_CHECK(reconstructionEfficiency.divide(truthPromptElectronWithReco, truthPromptElectronAll)); egammaMonitoring::EfficiencyPlot recoElectronLooseLHEfficiency("recoElectronLooseLHEfficiency", "/MONITORING/recoElectronLooseLHEfficiency/", rootHistSvc ); ATH_CHECK(recoElectronLooseLHEfficiency.divide(truthRecoElectronLooseLH, truthPromptElectronAll)); egammaMonitoring::EfficiencyPlot recoElectronMediumLHEfficiency("recoElectronMediumLHEfficiency", "/MONITORING/recoElectronMediumLHEfficiency/", rootHistSvc ); ATH_CHECK(recoElectronMediumLHEfficiency.divide(truthRecoElectronMediumLH, truthPromptElectronAll)); egammaMonitoring::EfficiencyPlot recoElectronTightLHEfficiency("recoElectronTightLHEfficiency", "/MONITORING/recoElectronTightLHEfficiency/", rootHistSvc ); ATH_CHECK(recoElectronTightLHEfficiency.divide( truthRecoElectronTightLH, truthPromptElectronAll)); - - - - } + egammaMonitoring::EfficiencyPlot recoElectronIsoFixedCutTightEfficiency("recoElectronIsoFixedCutTightEfficiency", "/MONITORING/recoElectronIsoFixedCutTightEfficiency/", rootHistSvc ); + ATH_CHECK(recoElectronIsoFixedCutTightEfficiency.divide( recoElectronIsoFixedCutTight, truthPromptElectronWithReco)); + egammaMonitoring::EfficiencyPlot recoElectronIsoFixedCutTightTrackOnlyEfficiency("recoElectronIsoFixedCutTightTrackOnlyEfficiency", "/MONITORING/recoElectronIsoFixedCutTightTrackOnlyEfficiency/", rootHistSvc ); + ATH_CHECK(recoElectronIsoFixedCutTightTrackOnlyEfficiency.divide( recoElectronIsoFixedCutTightTrackOnly, truthPromptElectronWithReco)); + egammaMonitoring::EfficiencyPlot recoElectronIsoFixedCutLooseEfficiency("recoElectronIsoFixedCutLooseEfficiency", "/MONITORING/recoElectronIsoFixedCutLooseEfficiency/", rootHistSvc ); + ATH_CHECK(recoElectronIsoFixedCutLooseEfficiency.divide( recoElectronIsoFixedCutLoose, truthPromptElectronWithReco)); + } if ("gamma" == m_sampleType) { @@ -599,9 +613,19 @@ StatusCode EgammaMonitoring::finalize() { ATH_CHECK(truthPhotonRecoConvEfficiency.divide(truthPhotonConvRecoConv, truthPhotonRecoPhoton)); egammaMonitoring::EfficiencyPlot truthPhotonRecoUnconvEfficiency("truthPhotonRecoUnconvEfficiency", "/MONITORING/truthPhotonRecoUnconvEfficiency/", rootHistSvc ); ATH_CHECK(truthPhotonRecoUnconvEfficiency.divide(truthPhotonUnconvRecoUnconv, truthPhotonRecoPhoton)); - - } + egammaMonitoring::EfficiencyPlot recoPhotonUnconvIsoFixedCutTightEfficiency("recoPhotonUnconvIsoFixedCutTightEfficiency", "/MONITORING/recoPhotonUnconvIsoFixedCutTightEfficiency/", rootHistSvc ); + ATH_CHECK(recoPhotonUnconvIsoFixedCutTightEfficiency.divide( recoPhotonUnconvIsoFixedCutTight, truthPhotonUnconvRecoUnconv)); + egammaMonitoring::EfficiencyPlot recoPhotonUnconvIsoFixedCutTightCaloOnlyEfficiency("recoPhotonUnconvIsoFixedCutTightCaloOnlyEfficiency", "/MONITORING/recoPhotonUnconvIsoFixedCutTightCaloOnlyEfficiency/", rootHistSvc ); + ATH_CHECK(recoPhotonUnconvIsoFixedCutTightCaloOnlyEfficiency.divide( recoPhotonUnconvIsoFixedCutTightCaloOnly, truthPhotonUnconvRecoUnconv)); + egammaMonitoring::EfficiencyPlot recoPhotonUnconvIsoFixedCutLooseEfficiency("recoPhotonUnconvIsoFixedCutLooseEfficiency", "/MONITORING/recoPhotonUnconvIsoFixedCutLooseEfficiency/", rootHistSvc ); + ATH_CHECK(recoPhotonUnconvIsoFixedCutLooseEfficiency.divide( recoPhotonUnconvIsoFixedCutLoose, truthPhotonUnconvRecoUnconv)); + egammaMonitoring::EfficiencyPlot recoPhotonConvIsoFixedCutTightEfficiency("recoPhotonConvIsoFixedCutTightEfficiency", "/MONITORING/recoPhotonConvIsoFixedCutTightEfficiency/", rootHistSvc ); + ATH_CHECK(recoPhotonConvIsoFixedCutTightEfficiency.divide( recoPhotonConvIsoFixedCutTight, truthPhotonConvRecoConv)); + egammaMonitoring::EfficiencyPlot recoPhotonConvIsoFixedCutTightCaloOnlyEfficiency("recoPhotonConvIsoFixedCutTightCaloOnlyEfficiency", "/MONITORING/recoPhotonConvIsoFixedCutTightCaloOnlyEfficiency/", rootHistSvc ); + ATH_CHECK(recoPhotonConvIsoFixedCutTightCaloOnlyEfficiency.divide( recoPhotonConvIsoFixedCutTightCaloOnly, truthPhotonConvRecoConv)); + egammaMonitoring::EfficiencyPlot recoPhotonConvIsoFixedCutLooseEfficiency("recoPhotonConvIsoFixedCutLooseEfficiency", "/MONITORING/recoPhotonConvIsoFixedCutLooseEfficiency/", rootHistSvc ); + ATH_CHECK(recoPhotonConvIsoFixedCutLooseEfficiency.divide( recoPhotonConvIsoFixedCutLoose, truthPhotonConvRecoConv)); + } return StatusCode::SUCCESS; } - diff --git a/Reconstruction/egamma/egammaValidation/src/EgammaMonitoring.h b/Reconstruction/egamma/egammaValidation/src/EgammaMonitoring.h index b2bc8e9794bf0a16837f9af018521de90a85f258..f1aa95a246a1e33fd1e4f2699e6084d9dc021c57 100644 --- a/Reconstruction/egamma/egammaValidation/src/EgammaMonitoring.h +++ b/Reconstruction/egamma/egammaValidation/src/EgammaMonitoring.h @@ -42,6 +42,9 @@ #include "ShowerShapesHistograms.h" #include "EfficiencyPlot.h" +#include "IsolationHistograms.h" +#include "IsolationSelection/IIsolationSelectionTool.h" + #include "TFile.h" #include "TH1.h" @@ -54,15 +57,11 @@ class EgammaMonitoring : public AthAlgorithm public: /// Tools and services /// - ITHistSvc* rootHistSvc ; - -// egammaMonitoring::EffIDPlots Eff_ID ; -// egammaMonitoring::EffRecPlots Eff_Reco; - - + ITHistSvc* rootHistSvc = nullptr; std::unique_ptr<egammaMonitoring::ShowerShapesHistograms> showerShapesAll; std::unique_ptr<egammaMonitoring::ShowerShapesHistograms> showerShapes10GeV; + std::unique_ptr<egammaMonitoring::IsolationHistograms> isolationAll; std::unique_ptr<egammaMonitoring::IHistograms> truthElectronAll; std::unique_ptr<egammaMonitoring::IHistograms> truthPromptElectronAll; @@ -74,6 +73,9 @@ class EgammaMonitoring : public AthAlgorithm std::unique_ptr<egammaMonitoring::IHistograms> truthRecoElectronLooseLH; std::unique_ptr<egammaMonitoring::IHistograms> truthRecoElectronMediumLH; std::unique_ptr<egammaMonitoring::IHistograms> truthRecoElectronTightLH; + std::unique_ptr<egammaMonitoring::IHistograms> recoElectronIsoFixedCutTight; + std::unique_ptr<egammaMonitoring::IHistograms> recoElectronIsoFixedCutTightTrackOnly; + std::unique_ptr<egammaMonitoring::IHistograms> recoElectronIsoFixedCutLoose; std::unique_ptr<egammaMonitoring::IHistograms> recoPhotonAll; std::unique_ptr<egammaMonitoring::IHistograms> truthPhotonRecoPhoton ; @@ -88,21 +90,27 @@ class EgammaMonitoring : public AthAlgorithm std::unique_ptr<egammaMonitoring::IHistograms> truthPhotonUnconvPhoton ; std::unique_ptr<egammaMonitoring::IHistograms> truthPhotonUnconvRecoConv ; std::unique_ptr<egammaMonitoring::IHistograms> truthPhotonUnconvRecoUnconv ; + std::unique_ptr<egammaMonitoring::IHistograms> recoPhotonUnconvIsoFixedCutTight; + std::unique_ptr<egammaMonitoring::IHistograms> recoPhotonUnconvIsoFixedCutTightCaloOnly; + std::unique_ptr<egammaMonitoring::IHistograms> recoPhotonUnconvIsoFixedCutLoose; + std::unique_ptr<egammaMonitoring::IHistograms> recoPhotonConvIsoFixedCutTight; + std::unique_ptr<egammaMonitoring::IHistograms> recoPhotonConvIsoFixedCutTightCaloOnly; + std::unique_ptr<egammaMonitoring::IHistograms> recoPhotonConvIsoFixedCutLoose; // Histos // General Info TH1D *evtNmb = nullptr; //! - + EgammaMonitoring (const std::string& name, ISvcLocator* pSvcLocator); ~EgammaMonitoring(){}; - + virtual StatusCode initialize (); virtual StatusCode beginInputFile(); virtual StatusCode firstExecute(); virtual StatusCode execute (); virtual StatusCode finalize (); - + private: @@ -113,7 +121,10 @@ private: asg::AnaToolHandle<IAsgElectronLikelihoodTool> m_LooseLH ; //! asg::AnaToolHandle<IAsgElectronLikelihoodTool> m_MediumLH; //! asg::AnaToolHandle<IAsgElectronLikelihoodTool> m_TightLH ; //! - + asg::AnaToolHandle<CP::IIsolationSelectionTool> m_IsoFixedCutTight; //! + asg::AnaToolHandle<CP::IIsolationSelectionTool> m_IsoFixedCutTightTrackOnly; //! + asg::AnaToolHandle<CP::IIsolationSelectionTool> m_IsoFixedCutTightCaloOnly; //! + asg::AnaToolHandle<CP::IIsolationSelectionTool> m_IsoFixedCutLoose; //! ToolHandle<IMCTruthClassifier> m_mcTruthClassifier; diff --git a/Reconstruction/egamma/egammaValidation/src/IsolationHistograms.cxx b/Reconstruction/egamma/egammaValidation/src/IsolationHistograms.cxx new file mode 100644 index 0000000000000000000000000000000000000000..6d9b859f16e119117f3556f6d68481f50c02652d --- /dev/null +++ b/Reconstruction/egamma/egammaValidation/src/IsolationHistograms.cxx @@ -0,0 +1,59 @@ +/* + Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration +*/ + +#include "IsolationHistograms.h" +#include "GaudiKernel/ServiceHandle.h" +#include "AsgTools/AnaToolHandle.h" + + +using namespace egammaMonitoring; + +StatusCode IsolationHistograms::initializePlots() { + + histoMap["ptCone20"] = (new TH1D(Form("%s_%s",m_name.c_str(),"ptCone20" ), ";p_{T}^{cone20}; Events / 0.5 GeV", 60, 0., 30.)); + histoMap["ptCone30"] = (new TH1D(Form("%s_%s",m_name.c_str(),"ptCone30" ), ";p_{T}^{cone30}; Events / 0.5 GeV", 60, 0., 30.)); + histoMap["ptCone40"] = (new TH1D(Form("%s_%s",m_name.c_str(),"ptCone40" ), ";p_{T}^{cone40}; Events / 0.5 GeV", 60, 0., 30.)); + histoMap["ptVarCone20"] = (new TH1D(Form("%s_%s",m_name.c_str(),"ptVarCone20" ), ";p_{T}^{varCone20}; Events / 0.5 GeV", 60, 0., 30.)); + histoMap["ptVarCone30"] = (new TH1D(Form("%s_%s",m_name.c_str(),"ptVarCone30" ), ";p_{T}^{varCone30}; Events / 0.5 GeV", 60, 0., 30.)); + histoMap["ptVarCone40"] = (new TH1D(Form("%s_%s",m_name.c_str(),"ptVarCone40" ), ";p_{T}^{varCone40}; Events / 0.5 GeV", 60, 0., 30.)); + histoMap["etCone20"] = (new TH1D(Form("%s_%s",m_name.c_str(),"etCone20" ), ";E_{T}^{cone20}; Events / 0.5 GeV", 60, 0., 30.)); + histoMap["etCone30"] = (new TH1D(Form("%s_%s",m_name.c_str(),"etCone30" ), ";E_{T}^{cone30}; Events / 0.5 GeV", 60, 0., 30.)); + histoMap["etCone40"] = (new TH1D(Form("%s_%s",m_name.c_str(),"etCone40" ), ";E_{T}^{cone40}; Events / 0.5 GeV", 60, 0., 30.)); + histoMap["topoEtCone20"] = (new TH1D(Form("%s_%s",m_name.c_str(),"topoEtCone20" ), ";E_{T}^{topoCone20}; Events / 0.5 GeV", 60, 0., 30.)); + histoMap["topoEtCone30"] = (new TH1D(Form("%s_%s",m_name.c_str(),"topoEtCone30" ), ";E_{T}^{topoCone30}; Events / 0.5 GeV", 60, 0., 30.)); + histoMap["topoEtCone40"] = (new TH1D(Form("%s_%s",m_name.c_str(),"topoEtCone40" ), ";E_{T}^{topoCone40}; Events / 0.5 GeV", 60, 0., 30.)); + + ATH_CHECK(m_rootHistSvc->regHist(m_folder+"ptCone20", histoMap["ptCone20"])); + ATH_CHECK(m_rootHistSvc->regHist(m_folder+"ptCone30", histoMap["ptCone30"])); + ATH_CHECK(m_rootHistSvc->regHist(m_folder+"ptCone40", histoMap["ptCone40"])); + ATH_CHECK(m_rootHistSvc->regHist(m_folder+"ptVarCone20", histoMap["ptVarCone20"])); + ATH_CHECK(m_rootHistSvc->regHist(m_folder+"ptVarCone30", histoMap["ptVarCone30"])); + ATH_CHECK(m_rootHistSvc->regHist(m_folder+"ptVarCone40", histoMap["ptVarCone40"])); + ATH_CHECK(m_rootHistSvc->regHist(m_folder+"etCone20", histoMap["etCone20"])); + ATH_CHECK(m_rootHistSvc->regHist(m_folder+"etCone30", histoMap["etCone30"])); + ATH_CHECK(m_rootHistSvc->regHist(m_folder+"etCone40", histoMap["etCone40"])); + ATH_CHECK(m_rootHistSvc->regHist(m_folder+"topoEtCone20", histoMap["topoEtCone20"])); + ATH_CHECK(m_rootHistSvc->regHist(m_folder+"topoEtCone30", histoMap["topoEtCone30"])); + ATH_CHECK(m_rootHistSvc->regHist(m_folder+"topoEtCone40", histoMap["topoEtCone40"])); + + return StatusCode::SUCCESS; + +} // initializePlots + +void IsolationHistograms::fill(const xAOD::Egamma& egamma) { + + if(egamma.isolationValue(m_ptCone20, xAOD::Iso::ptcone20) and m_ptCone20>=1000.) histoMap["ptCone20"]->Fill(m_ptCone20/1000.); + if(egamma.isolationValue(m_ptCone30, xAOD::Iso::ptcone30) and m_ptCone30>=1000.) histoMap["ptCone30"]->Fill(m_ptCone30/1000.); + if(egamma.isolationValue(m_ptCone40, xAOD::Iso::ptcone40) and m_ptCone40>=1000.) histoMap["ptCone40"]->Fill(m_ptCone40/1000.); + if(egamma.isolationValue(m_ptVarCone20, xAOD::Iso::ptvarcone20) and m_ptVarCone20>=1000.) histoMap["ptVarCone20"]->Fill(m_ptVarCone20/1000.); + if(egamma.isolationValue(m_ptVarCone30, xAOD::Iso::ptvarcone30) and m_ptVarCone30>=1000.) histoMap["ptVarCone30"]->Fill(m_ptVarCone30/1000.); + if(egamma.isolationValue(m_ptVarCone40, xAOD::Iso::ptvarcone40) and m_ptVarCone40>=1000.) histoMap["ptVarCone40"]->Fill(m_ptVarCone40/1000.); + if(egamma.isolationValue(m_etCone20, xAOD::Iso::etcone20)) histoMap["etCone20"]->Fill(m_etCone20/1000.); + if(egamma.isolationValue(m_etCone30, xAOD::Iso::etcone30)) histoMap["etCone30"]->Fill(m_etCone30/1000.); + if(egamma.isolationValue(m_etCone40, xAOD::Iso::etcone40)) histoMap["etCone40"]->Fill(m_etCone40/1000.); + if(egamma.isolationValue(m_topoEtCone20, xAOD::Iso::topoetcone20)) histoMap["topoEtCone20"]->Fill(m_topoEtCone20/1000.); + if(egamma.isolationValue(m_topoEtCone30, xAOD::Iso::topoetcone30)) histoMap["topoEtCone30"]->Fill(m_topoEtCone30/1000.); + if(egamma.isolationValue(m_topoEtCone40, xAOD::Iso::topoetcone40)) histoMap["topoEtCone40"]->Fill(m_topoEtCone40/1000.); + +} diff --git a/Reconstruction/egamma/egammaValidation/src/IsolationHistograms.h b/Reconstruction/egamma/egammaValidation/src/IsolationHistograms.h new file mode 100644 index 0000000000000000000000000000000000000000..c1908300a9f2d27a8620829646b528a965f02edd --- /dev/null +++ b/Reconstruction/egamma/egammaValidation/src/IsolationHistograms.h @@ -0,0 +1,48 @@ +/* + Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration +*/ + +#ifndef EGAMMAVALIDATION_ISOLATIONHISTOGRAMS_H +#define EGAMMAVALIDATION_ISOLATIONHISTOGRAMS_H + +#include "GaudiKernel/ITHistSvc.h" +#include "xAODEgamma/Egamma.h" +#include "xAODEgamma/EgammaxAODHelpers.h" + +#include "EgammaAnalysisInterfaces/IAsgElectronLikelihoodTool.h" +#include "TH1.h" + +namespace egammaMonitoring{ + + class IsolationHistograms{ + public: + + // Histos + IsolationHistograms(std::string name, + std::string title, + std::string folder, + ITHistSvc * &rootHistSvc + ) : + m_name(name), + m_title(title), + m_folder(folder), + m_rootHistSvc(rootHistSvc) {} + + std::map<std::string, TH1D* > histoMap; + StatusCode initializePlots(); + void fill(const xAOD::Egamma& egamma); + + protected: + + std::string m_name; + std::string m_title; + std::string m_folder; + ITHistSvc* m_rootHistSvc = nullptr; + + float m_ptCone20, m_ptCone30, m_ptCone40, m_ptVarCone20, m_ptVarCone30, m_ptVarCone40, m_etCone20, m_etCone30, m_etCone40, m_topoEtCone20, m_topoEtCone30, m_topoEtCone40; + + }; + +} + +#endif diff --git a/Reconstruction/egamma/egammaValidation/src/ShowerShapesHistograms.cxx b/Reconstruction/egamma/egammaValidation/src/ShowerShapesHistograms.cxx index bc2aac40d56daf53d355db87692265af98b37e31..1bedb98af63c4feadeeb1ff2cad69dffecd2ca3f 100644 --- a/Reconstruction/egamma/egammaValidation/src/ShowerShapesHistograms.cxx +++ b/Reconstruction/egamma/egammaValidation/src/ShowerShapesHistograms.cxx @@ -59,8 +59,9 @@ void ShowerShapesHistograms::fill(const xAOD::Egamma& egamma) { const std::vector<const xAOD::CaloCluster*> topoclusters = xAOD::EgammaHelpers::getAssociatedTopoClusters(egamma.caloCluster()); - topoclusters.at(0)->retrieveMoment(xAOD::CaloCluster::LATERAL,lateral); - histoMap["lateral"]->Fill(lateral); + if (topoclusters.at(0)->retrieveMoment(xAOD::CaloCluster::LATERAL,lateral)) { + histoMap["lateral"]->Fill(lateral); + } if(egamma.showerShapeValue(rhad, xAOD::EgammaParameters::Rhad)) histoMap["rhad"]->Fill(rhad); if(egamma.showerShapeValue(Reta, xAOD::EgammaParameters::Reta)) histoMap["reta"]->Fill(Reta); diff --git a/Reconstruction/iPat/iPatTrackFollower/src/TrackBuilder.cxx b/Reconstruction/iPat/iPatTrackFollower/src/TrackBuilder.cxx index 0d53cb783edbac700edf6369201a36c8478c0381..a2408c2b06cac881053da147882155dcb14baf44 100755 --- a/Reconstruction/iPat/iPatTrackFollower/src/TrackBuilder.cxx +++ b/Reconstruction/iPat/iPatTrackFollower/src/TrackBuilder.cxx @@ -15,6 +15,14 @@ #include "iPatTrack/Track.h" #include "iPatTrackFollower/TrackBuilder.h" +namespace{ + template <class ContainerPtr> + void deleteContainedPointers(ContainerPtr * c){ + for (auto & p:*c) delete p; + return; + } +} + //<<<<<< CLASS STRUCTURE INITIALIZATION >>>>>> TrackBuilder::TrackBuilder(const std::string& type, @@ -85,8 +93,8 @@ TrackBuilder::trackFromHits (TrackStatus status, hits->begin(), hits->end())) { - for (std::list<HitOnTrack*>::const_iterator h = hits->begin(); h != hits->end(); ++h) - delete *h; + deleteContainedPointers(hits); + delete hits; delete hitQuality; ATH_MSG_DEBUG( "trackFromHits: FAIL with insufficient hits" ); @@ -172,19 +180,16 @@ TrackBuilder::trackFromHits (TrackStatus status, else { delete hitQuality; - for (std::list<HitOnTrack*>::const_iterator h = hits->begin(); h != hits->end(); ++h) - delete *h; + deleteContainedPointers(hits); + hits->clear(); delete hits; delete fitQuality; delete perigeeParameters; if (scattererParameters) { - for (parameter_iterator s = scattererParameters->begin(); - s != scattererParameters->end(); - ++s) - delete *s; - delete scattererParameters; + deleteContainedPointers(scattererParameters); + delete scattererParameters; } ATH_MSG_DEBUG( "trackFromHitsFAIL with bad fit quality" ); return 0; @@ -223,7 +228,7 @@ TrackBuilder::trackRefit (const Track& track) const hits->begin(), hits->end()); - if (m_trackQuality->goodTrack(track.status(),*fitQuality,*hitQuality)) + if (scattererParameters and m_trackQuality->goodTrack(track.status(),*fitQuality,*hitQuality)) { builtTrack = new Track(track.status(), hits, @@ -239,18 +244,14 @@ TrackBuilder::trackRefit (const Track& track) const { // TODO: the plan is to build last-layers SCT + trt secondary tracks here delete hitQuality; - for (std::list<HitOnTrack*>::const_iterator h = hits->begin(); h != hits->end(); ++h) - delete *h; + deleteContainedPointers(hits); hits->clear(); delete hits; delete fitQuality; delete perigeeParameters; if (scattererParameters) { - for (parameter_iterator s = scattererParameters->begin(); - s != scattererParameters->end(); - ++s) - delete *s; + deleteContainedPointers(scattererParameters); delete scattererParameters; } ATH_MSG_DEBUG( "trackRefit: FAIL with bad fit quality" ); diff --git a/Reconstruction/iPat/iPatTrackFollower/src/TrackFollower.cxx b/Reconstruction/iPat/iPatTrackFollower/src/TrackFollower.cxx index 9e9c28069070bcba4dbd43dfcc0e6f5c82a4bed0..4b6e8d29a0b91df27fe7c2ede0bf7331c8760cbf 100755 --- a/Reconstruction/iPat/iPatTrackFollower/src/TrackFollower.cxx +++ b/Reconstruction/iPat/iPatTrackFollower/src/TrackFollower.cxx @@ -30,6 +30,7 @@ #include "iPatTrackFollower/LayerPredictor.h" #include "iPatTrackFollower/SiliconClusterMap.h" #include "iPatTrackFollower/TrackFollower.h" +#include <memory> //<<<<<< CLASS STRUCTURE INITIALIZATION >>>>>> @@ -343,78 +344,65 @@ TrackFollower::extrapolate_inwards (const Track& track) // associate and build track for hits in one extrapolated layer at a time (expensive!) std::vector<SiliconLayer*>::iterator end = begin; - Track* extrapolatedTrack = 0; - Track* newTrack = 0; + std::unique_ptr<Track> extrapolatedTrack{}; + std::unique_ptr<Track> newTrack{}; TrackStatus status = track.status(); hit_citerator hitBegin = track.hit_list_begin(); hit_citerator hitEnd = track.hit_list_end(); - do - { - // move begin backwards to the preceding active layer. - // Include any leading material by going back again until - // an active layer is found and then go forwards one - while (begin != layers->begin() && (**(--begin)).isInactive()) ; - while (begin != layers->begin() && (**(--begin)).isInactive()) ; - if (begin != layers->begin()) ++begin; - - if (begin == layers->begin()) - { - switch (status) - { - case truncated: - status = truncated; - break; - case segment: - case long_segment: - case pendingTRT: - status = pendingTRT; - break; - case secondary: - case primary: - status = primary; - break; - default: - ATH_MSG_WARNING( " unexpected Track::extrapolate_inwards " ); - delete layers; - return 0; - }; - } - - hit_list* hits = associateSilicon(begin,end,false,track); - end = begin; - for (hit_citerator h = hitBegin; h != hitEnd; ++h) - hits->push_back(new HitOnTrack(**h)); - - newTrack = m_trackBuilder->trackFromHits(status,hits,track); - if (newTrack) - { - // keep newTrack provided it adds cluster(s) - bool haveCluster = false; - for (hit_citerator h = newTrack->hit_list_begin(); - h != newTrack->hit_list_end(); - ++h) - { - if ((**h).isCluster()) haveCluster = true; - if ((**h).status() != scatterer) continue; - if (haveCluster) - { - delete extrapolatedTrack; - extrapolatedTrack = newTrack; - hitBegin = newTrack->hit_list_begin(); - hitEnd = newTrack->hit_list_end(); - } - else - { - delete newTrack; - newTrack = 0; - } - break; - } - } + do{ + // move begin backwards to the preceding active layer. + // Include any leading material by going back again until + // an active layer is found and then go forwards one + while (begin != layers->begin() && (**(--begin)).isInactive()) ; + while (begin != layers->begin() && (**(--begin)).isInactive()) ; + if (begin != layers->begin()) ++begin; + + if (begin == layers->begin()){ + switch (status){ + case truncated: + status = truncated; + break; + case segment: + case long_segment: + case pendingTRT: + status = pendingTRT; + break; + case secondary: + case primary: + status = primary; + break; + default: + ATH_MSG_WARNING( " unexpected Track::extrapolate_inwards " ); + delete layers; + return 0; + }; + } + + hit_list* hits = associateSilicon(begin,end,false,track); + end = begin; + for (hit_citerator h = hitBegin; h != hitEnd; ++h) hits->push_back(new HitOnTrack(**h)); + // + newTrack.reset(m_trackBuilder->trackFromHits(status,hits,track)); + if (newTrack) { + // keep newTrack provided it adds cluster(s) + bool haveCluster = false; + for (hit_citerator h = newTrack->hit_list_begin();h != newTrack->hit_list_end();++h){ + if ((**h).isCluster()) haveCluster = true; + if ((**h).status() != scatterer) continue; + if (haveCluster){ + extrapolatedTrack = std::move(newTrack); + hitBegin = newTrack->hit_list_begin(); + hitEnd = newTrack->hit_list_end(); + }else{ + newTrack.reset(); + } + break; + } + } } while (newTrack && begin != layers->begin()); - + // delete layers; - return extrapolatedTrack; + return extrapolatedTrack.release(); } Track* diff --git a/Reconstruction/tauMonitoring/share/tauMonitoring_jobOptions.py b/Reconstruction/tauMonitoring/share/tauMonitoring_jobOptions.py index 70a10e25d1683db84e1b56d7d262a569527e2a67..1c9ad311afcc01c5271183812d01293e8a8b0e9f 100644 --- a/Reconstruction/tauMonitoring/share/tauMonitoring_jobOptions.py +++ b/Reconstruction/tauMonitoring/share/tauMonitoring_jobOptions.py @@ -41,7 +41,7 @@ if tauMonTool.doTrigger : tauMonTool.TauEleJetMbtsTriggerItems = [ [ "L1_TAU1.*" , "L1_TAU2.*" , "L1_TAU60" , "L1_EM15VHI_2TAU.*" , "L1_EM15VHI_TAU40.*" , "L1_MU10_TAU.*" , "L1_J25_3J12_EM15-TAU.*" ] , [ "HLT_e2.*" , "L1_EM2.*" , "L1_2EM15" ] , [ "HLT_j55" , "HLT_j60" , "HLT_j85" , "HLT_j110" , "HLT_j175" , "HLT_4j85" , "HLT_4j10.*" ] , [ "HLT_mb_sp2000_trk70_hmt" ] ] tauMonTool.FilterTools = [ monAtlasReadyFilterTool ] -tauMonTool.FilterTools.append(monbadlb) -ToolSvc += tauMonTool +tauMonTool.FilterTools += [monbadlb] +#ToolSvc += tauMonTool monManTau.AthenaMonTools += [ tauMonTool ] diff --git a/Simulation/G4Atlas/G4AtlasAlg/src/G4AtlasMTRunManager.cxx b/Simulation/G4Atlas/G4AtlasAlg/src/G4AtlasMTRunManager.cxx index abb018f478fecea1068eda11ed56c7ea051af0e0..1a679279a2a2428d4cd9c6211d401215e8faedde 100644 --- a/Simulation/G4Atlas/G4AtlasAlg/src/G4AtlasMTRunManager.cxx +++ b/Simulation/G4Atlas/G4AtlasAlg/src/G4AtlasMTRunManager.cxx @@ -74,18 +74,30 @@ void G4AtlasMTRunManager::InitializeGeometry() // Set smartlessness G4LogicalVolumeStore *logicalVolumeStore = G4LogicalVolumeStore::GetInstance(); + if (logicalVolumeStore->size() == 0) { + ATH_MSG_ERROR( "G4 logical volume store is empty." ); + } const G4String muonSys("Muon::MuonSys"); const G4String embSTAC("LArMgr::LAr::EMB::STAC"); + bool ilvMuonSys = false, ilvEmbSTAC = false; for (auto* ilv : *logicalVolumeStore ) { if ( ilv->GetName() == muonSys ) { ilv->SetSmartless( 0.1 ); ATH_MSG_INFO( "Set smartlessness for Muon::MuonSys to 0.1" ); + ilvMuonSys = true; } else if ( ilv->GetName() == embSTAC ) { ilv->SetSmartless( 0.5 ); ATH_MSG_INFO( "Set smartlessness for LArMgr::LAr::EMB::STAC to 0.5" ); + ilvEmbSTAC = true; } } + if (ilvMuonSys == false) { + ATH_MSG_INFO( "Muon::MuonSys not in G4 logical volume store. Smartlessness not set." ); + } + if (ilvEmbSTAC == false) { + ATH_MSG_INFO( "LArMgr::LAr::EMB::STAC not in G4 logical volume store. Smartlessness not set." ); + } // Create/assign detector construction SetUserInitialization( m_detGeoSvc->GetDetectorConstruction() ); diff --git a/Simulation/G4Atlas/G4AtlasAlg/src/G4AtlasRunManager.cxx b/Simulation/G4Atlas/G4AtlasAlg/src/G4AtlasRunManager.cxx index f711acb5aad22b698f173b8db29806b968c650b8..95e7b3fdf799f469eee7ae3c24b0aac80611d5b0 100644 --- a/Simulation/G4Atlas/G4AtlasAlg/src/G4AtlasRunManager.cxx +++ b/Simulation/G4Atlas/G4AtlasAlg/src/G4AtlasRunManager.cxx @@ -74,18 +74,30 @@ void G4AtlasRunManager::InitializeGeometry() // Set smartlessness G4LogicalVolumeStore *logicalVolumeStore = G4LogicalVolumeStore::GetInstance(); + if (logicalVolumeStore->size() == 0) { + ATH_MSG_ERROR( "G4 logical volume store is empty." ); + } const G4String muonSys("Muon::MuonSys"); const G4String embSTAC("LArMgr::LAr::EMB::STAC"); + bool ilvMuonSys = false, ilvEmbSTAC = false; for (auto* ilv : *logicalVolumeStore ) { if ( ilv->GetName() == muonSys ) { ilv->SetSmartless( 0.1 ); ATH_MSG_INFO( "Set smartlessness for Muon::MuonSys to 0.1" ); + ilvMuonSys = true; } else if ( ilv->GetName() == embSTAC ) { ilv->SetSmartless( 0.5 ); ATH_MSG_INFO( "Set smartlessness for LArMgr::LAr::EMB::STAC to 0.5" ); + ilvEmbSTAC = true; } } + if (ilvMuonSys == false) { + ATH_MSG_INFO( "Muon::MuonSys not in G4 logical volume store. Smartlessness not set." ); + } + if (ilvEmbSTAC == false) { + ATH_MSG_INFO( "LArMgr::LAr::EMB::STAC not in G4 logical volume store. Smartlessness not set." ); + } // Create/assign detector construction G4RunManager::SetUserInitialization(m_detGeoSvc->GetDetectorConstruction()); diff --git a/Simulation/G4Atlas/G4AtlasTests/share/test_AtlasG4_ParticleGun_electrons.py b/Simulation/G4Atlas/G4AtlasTests/share/test_AtlasG4_ParticleGun_electrons.py index cd891fd2687d865afb6a41a3f58f2e9d8f43ab55..fe34f104f3c0efdf75042921f0e8c7c41ccdbd2d 100644 --- a/Simulation/G4Atlas/G4AtlasTests/share/test_AtlasG4_ParticleGun_electrons.py +++ b/Simulation/G4Atlas/G4AtlasTests/share/test_AtlasG4_ParticleGun_electrons.py @@ -101,6 +101,7 @@ job.G4TestAlg.SimTestTools += [CfgGetter.getPrivateTool("HECHitsTestTool", check from G4AtlasAlg.G4AtlasAlgConf import G4AtlasAlg g4AtlasAlg = G4AtlasAlg() g4AtlasAlg.RandomGenerator = "athena" +g4AtlasAlg.InputTruthCollection='GEN_EVENT' from AthenaCommon.AppMgr import ServiceMgr from AthenaServices.AthenaServicesConf import AtRndmGenSvc atRndmGenSvc = AtRndmGenSvc() diff --git a/Simulation/G4Utilities/G4ProfilingTools/share/postInclude.G4ProfilingTools.py b/Simulation/G4Utilities/G4ProfilingTools/share/preInclude.G4ProfilingTools.py similarity index 100% rename from Simulation/G4Utilities/G4ProfilingTools/share/postInclude.G4ProfilingTools.py rename to Simulation/G4Utilities/G4ProfilingTools/share/preInclude.G4ProfilingTools.py diff --git a/Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimEvent/src/TFCSEnergyBinParametrization.cxx b/Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimEvent/src/TFCSEnergyBinParametrization.cxx index 9938530a397817cd1a7f98def9447640388ed9ce..a235190d6fbc1ced7146c607a778e8281d84ca89 100644 --- a/Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimEvent/src/TFCSEnergyBinParametrization.cxx +++ b/Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimEvent/src/TFCSEnergyBinParametrization.cxx @@ -107,11 +107,16 @@ FCSReturnCode TFCSEnergyBinParametrization::simulate(TFCSSimulationState& simuls return FCSFatal; } - int pdgid=truth->pdgid(); - if(!is_match_pdgid(pdgid)) { - ATH_MSG_ERROR("TFCSEnergyBinParametrization::simulate(): cannot simulate pdgid="<<pdgid); + int truth_pdgid = truth->pdgid(); + int pdgid = -99; + + if (is_match_pdgid(truth_pdgid)) pdgid = truth_pdgid; + else if (is_match_pdgid(0)) pdgid = 0; + else { + ATH_MSG_ERROR("TFCSEnergyBinParametrization::simulate(): cannot simulate pdgid=" << truth_pdgid); return FCSFatal; } + float searchRand = CLHEP::RandFlat::shoot(simulstate.randomEngine()); int chosenBin=TMath::BinarySearch(n_bins()+1, m_pdgid_Ebin_probability[pdgid].data(), searchRand)+1; if(chosenBin<1 || chosenBin>n_bins()) { diff --git a/Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimEvent/src/TFCSLateralShapeParametrizationHitNumberFromE.cxx b/Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimEvent/src/TFCSLateralShapeParametrizationHitNumberFromE.cxx index bc025bcf75a516cbe7708901e12145886db421c8..55a3ddf360baab2d91608d45c7623fa368373dd2 100644 --- a/Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimEvent/src/TFCSLateralShapeParametrizationHitNumberFromE.cxx +++ b/Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimEvent/src/TFCSLateralShapeParametrizationHitNumberFromE.cxx @@ -32,6 +32,11 @@ int TFCSLateralShapeParametrizationHitNumberFromE::get_number_of_hits(TFCSSimula return 1; } + if (TMath::IsNaN(energy)) { + ATH_MSG_DEBUG("Energy is NaN"); + return 1; + } + double sigma_stochastic=m_stochastic/sqrt(energy/1000.0); int hits = CLHEP::RandPoisson::shoot(simulstate.randomEngine(), 1.0 / (sigma_stochastic*sigma_stochastic + m_constant*m_constant)); diff --git a/Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimServices/python/ISF_FastCaloSimJobProperties.py b/Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimServices/python/ISF_FastCaloSimJobProperties.py index e59c34ee41949c4edfdd9a4ece9fd134a6462350..c96f0416f8de29222a1292a86c9b557e0b1494d7 100644 --- a/Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimServices/python/ISF_FastCaloSimJobProperties.py +++ b/Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimServices/python/ISF_FastCaloSimJobProperties.py @@ -60,7 +60,7 @@ class ParamsInputFilename(JobProperty): """ Filename of the input parametrizations file. """ statusOn = True allowedTypes = ['str'] - StoredValue = 'FastCaloSim/MC16/TFCSparam_v002.root' + StoredValue = 'FastCaloSim/MC16/TFCSparam_v008.root' ##----------------------------------------------------------------------------- ## 2nd step diff --git a/Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimServices/src/FastCaloSimSvcV2.cxx b/Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimServices/src/FastCaloSimSvcV2.cxx index 23a02e310d80db83b9223e556cf1e24e97c2fa63..238119faff1b9be7461e7c5cff1a79d385756ec2 100644 --- a/Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimServices/src/FastCaloSimSvcV2.cxx +++ b/Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimServices/src/FastCaloSimSvcV2.cxx @@ -139,7 +139,14 @@ StatusCode ISF::FastCaloSimSvcV2::setupEvent() ToolHandleArray<ICaloCellMakerTool>::iterator endTool = m_caloCellMakerToolsSetup.end(); for (; itrTool != endTool; ++itrTool) { + std::string chronoName=this->name()+"_"+ itrTool->name(); + if (m_chrono) m_chrono->chronoStart(chronoName); StatusCode sc = (*itrTool)->process(m_theContainer); + if (m_chrono) { + m_chrono->chronoStop(chronoName); + ATH_MSG_DEBUG( m_screenOutputPrefix << "Chrono stop : delta " << m_chrono->chronoDelta (chronoName,IChronoStatSvc::USER) * CLHEP::microsecond / CLHEP::second << " second " ); + } + if (sc.isFailure()) { ATH_MSG_ERROR( m_screenOutputPrefix << "Error executing tool " << itrTool->name() ); @@ -181,23 +188,21 @@ StatusCode ISF::FastCaloSimSvcV2::simulate(const ISF::ISFParticle& isfp) { ATH_MSG_VERBOSE("NEW PARTICLE! FastCaloSimSvcV2 called with ISFParticle: " << isfp); - - int pdgid = fabs(isfp.pdgCode()); - - //int barcode=isfp.barcode(); // isfp barcode, eta and phi: in case we need them - // float eta_isfp = particle_position.eta(); - // float phi_isfp = particle_position.phi(); - + Amg::Vector3D particle_position = isfp.position(); + + //int barcode=isfp.barcode(); // isfp barcode, eta and phi: in case we need them + // float eta_isfp = particle_position.eta(); + // float phi_isfp = particle_position.phi(); - if(!(pdgid==22 || pdgid==11)) - { - ATH_MSG_VERBOSE("ISF particle has pdgid "<<pdgid<<", that's not supported yet"); - return StatusCode::SUCCESS; - } + //Don't simulate particles with total energy below 10 MeV + if(isfp.ekin() < 10) { + ATH_MSG_VERBOSE("Skipping particle with Ekin: " << isfp.ekin() <<" MeV. Below the 10 MeV threshold."); + return StatusCode::SUCCESS; + } - TFCSTruthState truth(isfp.momentum().x(),isfp.momentum().y(),isfp.momentum().z(),sqrt(pow(isfp.ekin(),2)+pow(isfp.mass(),2)),isfp.pdgCode()); + TFCSTruthState truth(isfp.momentum().x(),isfp.momentum().y(),isfp.momentum().z(),sqrt(isfp.momentum().mag2()+pow(isfp.mass(),2)),isfp.pdgCode()); truth.set_vertex(particle_position[Amg::x], particle_position[Amg::y], particle_position[Amg::z]); TFCSExtrapolationState extrapol; @@ -210,9 +215,9 @@ StatusCode ISF::FastCaloSimSvcV2::simulate(const ISF::ISFParticle& isfp) } ATH_MSG_DEBUG("Energy returned: " << simulstate.E()); - ATH_MSG_DEBUG("Energy fraction for layer: "); + ATH_MSG_VERBOSE("Energy fraction for layer: "); for (int s = 0; s < CaloCell_ID_FCS::MaxSample; s++) - ATH_MSG_DEBUG(" Sampling " << s << " energy " << simulstate.E(s)); + ATH_MSG_VERBOSE(" Sampling " << s << " energy " << simulstate.E(s)); //Now deposit all cell energies into the CaloCellContainer for(const auto& iter : simulstate.cells()) { diff --git a/Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimServices/src/FastCaloSimSvcV2.h b/Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimServices/src/FastCaloSimSvcV2.h index ebd3c2737371146b044990cd0dd15f37776e2bac..d7d60dc0ac7f00bf39185a02341e16712fe7c62f 100644 --- a/Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimServices/src/FastCaloSimSvcV2.h +++ b/Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimServices/src/FastCaloSimSvcV2.h @@ -12,6 +12,9 @@ // ISF includes #include "ISF_Interfaces/BaseSimulationSvc.h" +// Framework includes +#include "GaudiKernel/IChronoStatSvc.h" + // FastCaloSim includes #include "ISF_FastCaloSimParametrization/IFastCaloSimCaloExtrapolation.h" #include "TrkExInterfaces/ITimedExtrapolator.h" diff --git a/TileCalorimeter/TileCalib/TileCalibBlobObjs/TileCalibBlobObjs/TileCalibUtils.h b/TileCalorimeter/TileCalib/TileCalibBlobObjs/TileCalibBlobObjs/TileCalibUtils.h index d1e2253dd9870341b49aefa2d5bd386233108076..85af6046020d124bba7f4db73dd161cd38c17db0 100644 --- a/TileCalorimeter/TileCalib/TileCalibBlobObjs/TileCalibBlobObjs/TileCalibUtils.h +++ b/TileCalorimeter/TileCalib/TileCalibBlobObjs/TileCalibBlobObjs/TileCalibUtils.h @@ -132,21 +132,21 @@ class TileCalibUtils{ static unsigned int badtiming_definition_chan() {return BADTIMING_DEFINITION_CHAN;} - static const unsigned int MAX_ROS ; /**< @brief Number of ROSs */ - static const unsigned int MAX_DRAWER ; /**< @brief Number of drawers in ROS 1-4 */ - static const unsigned int MAX_DRAWR0 ; /**< @brief Number of drawers in ROS 0 */ - static const unsigned int MAX_CHAN ; /**< @brief Number of channels in drawer */ - static const unsigned int MAX_GAIN ; /**< @brief Number of gains per channel */ - static const unsigned int MAX_DRAWERIDX; /**< @brief Maximal drawer index */ - static const unsigned int LAS_PART_CHAN; /**< @brief Empty channel number to store laser partition variation */ - static const unsigned int TRIPS_DRAWERIDX; /**< @brief DrawerIdx used for storing trips probabilities */ - static const unsigned int TRIPS_ROS; /**< @brief Ros used for storing trips probabilities */ - static const unsigned int TRIPS_DRAWER; /**< @brief Drawer used for storing trips probabilities */ - static const unsigned int DEFINITIONS_DRAWERIDX; /**< @brief Drawer used for storing of bad and noisy channel definitions */ - static const unsigned int BAD_DEFINITION_CHAN; /**< @brief Channel used for storing of bad channel definitions */ - static const unsigned int NOISY_DEFINITION_CHAN; /**< @brief Channel used for storing of noisy channel definitions */ - static const unsigned int NOGAINL1_DEFINITION_CHAN; /**< @brief Channel used for storing of NoGainLevel1 channel definitions */ - static const unsigned int BADTIMING_DEFINITION_CHAN; /**< @brief Channel used for storing of bad timing channel definitions */ + static const unsigned int MAX_ROS = 5; /**< @brief Number of ROSs */ + static const unsigned int MAX_DRAWER = 64; /**< @brief Number of drawers in ROS 1-4 */ + static const unsigned int MAX_DRAWR0 = 20; /**< @brief Number of drawers in ROS 0 */ + static const unsigned int MAX_CHAN = 48; /**< @brief Number of channels in drawer */ + static const unsigned int MAX_GAIN = 2; /**< @brief Number of gains per channel */ + static const unsigned int MAX_DRAWERIDX = 276; /**< @brief Maximal drawer index */ + static const unsigned int LAS_PART_CHAN= 43; /**< @brief Empty channel number to store laser partition variation */ + static const unsigned int TRIPS_DRAWERIDX= 2; /**< @brief DrawerIdx used for storing trips probabilities */ + static const unsigned int TRIPS_ROS = 0; /**< @brief Ros used for storing trips probabilities */ + static const unsigned int TRIPS_DRAWER = 2; /**< @brief Drawer used for storing trips probabilities */ + static const unsigned int DEFINITIONS_DRAWERIDX = 1; /**< @brief Drawer used for storing of bad and noisy channel definitions */ + static const unsigned int BAD_DEFINITION_CHAN = 0; /**< @brief Channel used for storing of bad channel definitions */ + static const unsigned int NOISY_DEFINITION_CHAN = 1; /**< @brief Channel used for storing of noisy channel definitions */ + static const unsigned int NOGAINL1_DEFINITION_CHAN = 2; /**< @brief Channel used for storing of NoGainLevel1 channel definitions */ + static const unsigned int BADTIMING_DEFINITION_CHAN = 3; /**< @brief Channel used for storing of bad timing channel definitions */ }; diff --git a/TileCalorimeter/TileCalib/TileCalibBlobObjs/src/TileBchPrbs.cxx b/TileCalorimeter/TileCalib/TileCalibBlobObjs/src/TileBchPrbs.cxx index b3ba0914ce3779b45ea3f9982cc71c7b1cde09a9..cffde54c4db447fa9984a06721ff36cfd53ff33a 100644 --- a/TileCalorimeter/TileCalib/TileCalibBlobObjs/src/TileBchPrbs.cxx +++ b/TileCalorimeter/TileCalib/TileCalibBlobObjs/src/TileBchPrbs.cxx @@ -70,6 +70,7 @@ TileBchPrbs::initPrbDesc() m_prbNames[TileBchPrbs::TrigNoGain ] = "LV1 channel no gain"; m_prbNames[TileBchPrbs::TrigHalfGain ] = "LV1 channel half gain"; m_prbNames[TileBchPrbs::TrigNoisy ] = "LV1 channel noisy"; + m_prbNames[TileBchPrbs::DisableForL1 ] = "Channel disabled for LV1"; //=== online channel m_prbNames[TileBchPrbs::OnlineBadTiming ] = "Online bad timing"; diff --git a/TileCalorimeter/TileCalib/TileCalibBlobObjs/src/TileCalibUtils.cxx b/TileCalorimeter/TileCalib/TileCalibBlobObjs/src/TileCalibUtils.cxx index 728abb40f20d2687c5cc19e5a6cd60741fa63c45..f0c2c3533f30fc3db3c38929c72ff775f555bf6e 100644 --- a/TileCalorimeter/TileCalib/TileCalibBlobObjs/src/TileCalibUtils.cxx +++ b/TileCalorimeter/TileCalib/TileCalibBlobObjs/src/TileCalibUtils.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration */ #include "TileCalibBlobObjs/TileCalibUtils.h" @@ -9,21 +9,21 @@ #include <iomanip> #include <cmath> -const unsigned int TileCalibUtils::MAX_ROS = 5; /**< @brief Number of ROSs */ -const unsigned int TileCalibUtils::MAX_DRAWER = 64; /**< @brief Number of drawers in ROS 1-4 */ -const unsigned int TileCalibUtils::MAX_DRAWR0 = 20; /**< @brief Number of drawers in ROS 0 */ -const unsigned int TileCalibUtils::MAX_CHAN = 48; /**< @brief Number of channels in drawer */ -const unsigned int TileCalibUtils::MAX_GAIN = 2; /**< @brief Number of gains per channel */ -const unsigned int TileCalibUtils::MAX_DRAWERIDX = 276; /**< @brief Maximal drawer index */ -const unsigned int TileCalibUtils::LAS_PART_CHAN = 43; /**< @brief Empty channel number to store laser partition variation */ -const unsigned int TileCalibUtils::TRIPS_DRAWERIDX = 2; /**< @brief DrawerIdx used for storing trips probabilities */ -const unsigned int TileCalibUtils::TRIPS_ROS = 0; /**< @brief Ros used for storing trips probabilities */ -const unsigned int TileCalibUtils::TRIPS_DRAWER = 2; /**< @brief Drawer used for storing trips probabilities */ -const unsigned int TileCalibUtils::DEFINITIONS_DRAWERIDX = 1; /**< @brief Drawer used for storing of bad and noisy channel definitions */ -const unsigned int TileCalibUtils::BAD_DEFINITION_CHAN = 0; /**< @brief Channel used for storing of bad channel definitions */ -const unsigned int TileCalibUtils::NOISY_DEFINITION_CHAN = 1; /**< @brief Channel used for storing of noisy channel definitions */ -const unsigned int TileCalibUtils::NOGAINL1_DEFINITION_CHAN = 2; /**< @brief Channel used for storing of NoGainLevel1 channel definitions */ -const unsigned int TileCalibUtils::BADTIMING_DEFINITION_CHAN = 3; /**< @brief Channel used for storing of bad timing channel definitions */ +const unsigned int TileCalibUtils::MAX_ROS; +const unsigned int TileCalibUtils::MAX_DRAWER; +const unsigned int TileCalibUtils::MAX_DRAWR0; +const unsigned int TileCalibUtils::MAX_CHAN; +const unsigned int TileCalibUtils::MAX_GAIN; +const unsigned int TileCalibUtils::MAX_DRAWERIDX; +const unsigned int TileCalibUtils::LAS_PART_CHAN; +const unsigned int TileCalibUtils::TRIPS_DRAWERIDX; +const unsigned int TileCalibUtils::TRIPS_ROS; +const unsigned int TileCalibUtils::TRIPS_DRAWER; +const unsigned int TileCalibUtils::DEFINITIONS_DRAWERIDX; +const unsigned int TileCalibUtils::BAD_DEFINITION_CHAN; +const unsigned int TileCalibUtils::NOISY_DEFINITION_CHAN; +const unsigned int TileCalibUtils::NOGAINL1_DEFINITION_CHAN; +const unsigned int TileCalibUtils::BADTIMING_DEFINITION_CHAN; // //_____________________________________________________________________________ diff --git a/TileCalorimeter/TileCalib/TileCalibBlobPython/python/TileBchTools.py b/TileCalorimeter/TileCalib/TileCalibBlobPython/python/TileBchTools.py index 41e4e94074f06137f925e0f1954073cdc7638a8a..e3c501fefb2c58bc20825fdfbe14781319af71bf 100644 --- a/TileCalorimeter/TileCalib/TileCalibBlobPython/python/TileBchTools.py +++ b/TileCalorimeter/TileCalib/TileCalibBlobPython/python/TileBchTools.py @@ -464,14 +464,14 @@ class TileBchMgr(TileCalibLogger): if nChange==-1: nUpdates += 1 self.log().info("Drawer %s reset to GOOD"%(modName)) - if modName not in comment: + if modName not in comment and not ("ONL" not in folderPath or "syncALL" not in comment): goodComment = False self.log().error("Comment string - '%s' - doesn't contain drawer %s" %(comment,modName)) writer.zeroBlob(ros,mod) else: nUpdates += 1 self.log().info("Applying %2i changes to drawer %s" %(nChange,modName)) - if modName not in comment: + if modName not in comment and ("ONL" not in folderPath or "syncALL" not in comment): goodComment = False self.log().error("Comment string - '%s' - doesn't contain drawer %s" %(comment,modName)) drawer = writer.getDrawer(ros,mod) diff --git a/TileCalorimeter/TileCalib/TileCalibBlobPython/python/TileCalibTools.py b/TileCalorimeter/TileCalib/TileCalibBlobPython/python/TileCalibTools.py index 2a1a4099680fc4eccd8d99e39c6c5b007bc3c676..963631ac18feb6d44b8de7623e9cdb79c93368c3 100644 --- a/TileCalorimeter/TileCalib/TileCalibBlobPython/python/TileCalibTools.py +++ b/TileCalorimeter/TileCalib/TileCalibBlobPython/python/TileCalibTools.py @@ -58,9 +58,9 @@ LASPARTCHAN = 43 # #______________________________________________________________________ -def getLastRunNumber(partition=""): +def getLastRunNumber(): """ - Return the run number of last run taken in the pit + Return the run number of next run to be taken in the pit """ try: response = urllib2.urlopen("http://atlas-service-db-runlist.web.cern.ch/atlas-service-db-runlist/cgi-bin/latestRun.py") @@ -69,6 +69,29 @@ def getLastRunNumber(partition=""): data=[] return int(data[0])+1 if len(data) else 222222 +# +#______________________________________________________________________ +def getPromptCalibRunNumber(): + """ + Return the minimal run number of runs in prompt calibration loop + """ + + promptCalibRuns = [] + + fin = open("/afs/cern.ch/user/a/atlcond/scratch0/nemo/prod/web/calibruns.txt","r").read().split() + + for line in fin: + try: + if line: promptCalibRuns.append( int(line) ) + except ValueError: + pass + + if len(promptCalibRuns) >= 1: + promptCalibRuns.sort() + return promptCalibRuns[0] + else: + return getLastRunNumber() + # #______________________________________________________________________ def getTilePrefix(ofl=True,splitOnlInOflSchema=True): diff --git a/TileCalorimeter/TileCalib/TileCalibBlobPython/share/TileSynchronizeBch.py b/TileCalorimeter/TileCalib/TileCalibBlobPython/share/TileSynchronizeBch.py index d7d411d2780e41f75470a8c2ff0776630700b0d3..eb42c7e6cc49fb06f696fdf88264d76afd150362 100755 --- a/TileCalorimeter/TileCalib/TileCalibBlobPython/share/TileSynchronizeBch.py +++ b/TileCalorimeter/TileCalib/TileCalibBlobPython/share/TileSynchronizeBch.py @@ -113,6 +113,25 @@ for ros in xrange(1,5): stathiBefore = mgr2.getAdcProblems(ros,mod,chn,1) if online: + + # remove all trigger problems first + for prb in [TileBchPrbs.TrigGeneralMask, + TileBchPrbs.TrigNoGain, + TileBchPrbs.TrigHalfGain, + TileBchPrbs.TrigNoisy]: + mgr2.delAdcProblem(ros, mod, chn, 0, prb) + mgr2.delAdcProblem(ros, mod, chn, 1, prb) + # and now set new trigger problems (if any) + if not statlo.isGood(): + prbs = statlo.getPrbs() + for prb in prbs: + if prb in [TileBchPrbs.TrigGeneralMask, + TileBchPrbs.TrigNoGain, + TileBchPrbs.TrigHalfGain, + TileBchPrbs.TrigNoisy]: + mgr2.addAdcProblem(ros, mod, chn, 0, prb) + mgr2.addAdcProblem(ros, mod, chn, 1, prb) + if copyall or statlo.isBad() or stathi.isBad(): #--- add IgnoreInHlt if either of the ADCs has isBad #--- add OnlineGeneralMaskAdc if the ADCs has isBad diff --git a/TileCalorimeter/TileCalib/TileCalibBlobPython/share/TileSynchronizeOnlBchWithOfl.py b/TileCalorimeter/TileCalib/TileCalibBlobPython/share/TileSynchronizeOnlBchWithOfl.py index c35bf7452c2d86c2f5d480da64912f96ad6f2b0b..d15d8e568770ef0e2441eceb1672feb11b91c395 100755 --- a/TileCalorimeter/TileCalib/TileCalibBlobPython/share/TileSynchronizeOnlBchWithOfl.py +++ b/TileCalorimeter/TileCalib/TileCalibBlobPython/share/TileSynchronizeOnlBchWithOfl.py @@ -86,6 +86,24 @@ for ros in xrange(1,5): statloBefore = mgrOnl.getAdcProblems(ros,mod,chn,0) stathiBefore = mgrOnl.getAdcProblems(ros,mod,chn,1) + # remove all trigger problems first + for prb in [TileBchPrbs.TrigGeneralMask, + TileBchPrbs.TrigNoGain, + TileBchPrbs.TrigHalfGain, + TileBchPrbs.TrigNoisy]: + mgrOnl.delAdcProblem(ros, mod, chn, 0, prb) + mgrOnl.delAdcProblem(ros, mod, chn, 1, prb) + # and now set new trigger problems (if any) + if not statlo.isGood(): + prbs = statlo.getPrbs() + for prb in prbs: + if prb in [TileBchPrbs.TrigGeneralMask, + TileBchPrbs.TrigNoGain, + TileBchPrbs.TrigHalfGain, + TileBchPrbs.TrigNoisy]: + mgrOnl.addAdcProblem(ros, mod, chn, 0, prb) + mgrOnl.addAdcProblem(ros, mod, chn, 1, prb) + #--- add IgnoreInHlt if either of the ADCs has isBad #--- add OnlineGeneralMaskAdc if the ADCs has isBad if statlo.isBad() and stathi.isBad(): diff --git a/TileCalorimeter/TileCalib/TileCalibBlobPython/share/WriteBchToCool.py b/TileCalorimeter/TileCalib/TileCalibBlobPython/share/WriteBchToCool.py index 4e8193a972c44a74a64bec86f2884e02a439c162..a959f4a287223d50aeabaa31119a0f5d8216a58d 100755 --- a/TileCalorimeter/TileCalib/TileCalibBlobPython/share/WriteBchToCool.py +++ b/TileCalorimeter/TileCalib/TileCalibBlobPython/share/WriteBchToCool.py @@ -20,6 +20,7 @@ def usage(): print "-l, --lumi= specify lumi block number, default is 0" print "-m, --mode= specify update mode: 1 or 2; if not set - choosen automatically, depending on schema" print "-c, --comment= specify comment which should be written to DB" + print "-U, --user= specify username for comment" print "-e, --execfile= specify python file which should be executed, default is bch.py" print "-i, --inschema= specify the input schema to use, default is 'oracle://ATLAS_COOLPROD;schema=ATLAS_COOLOFL_TILE;dbname=CONDBR2'" print "-o, --outschema= specify the output schema to use, default is 'sqlite://;schema=tileSqlite.db;dbname=CONDBR2'" @@ -29,8 +30,8 @@ def usage(): print "-s, --schema= specify input/output schema to use when both input and output schemas are the same" print "-u --update set this flag if output sqlite file should be updated, otherwise it'll be recreated" -letters = "hr:l:m:s:i:o:t:f:e:c:npvu" -keywords = ["help","run=","lumi=","mode=","schema=","inschema=","outschema=","tag=","folder=","execfile=","comment=","online","upd4","verbose","update"] +letters = "hr:l:m:s:i:o:t:f:e:c:U:npvu" +keywords = ["help","run=","lumi=","mode=","schema=","inschema=","outschema=","tag=","folder=","execfile=","comment=","user=","online","upd4","verbose","update"] try: opts, extraparams = getopt.getopt(sys.argv[1:], letters, keywords) @@ -55,6 +56,10 @@ execFile = "bch.py" comment = "" verbose = False update = False +try: + user=os.getlogin() +except: + user="UnknownUser" for o, a in opts: if o in ("-f","--folder"): @@ -85,6 +90,8 @@ for o, a in opts: execFile = a elif o in ("-c","--comment"): comment = a + elif o in ("-U","--user"): + user = a elif o in ("-v","--verbose"): verbose = True elif o in ("-h","--help"): @@ -157,8 +164,12 @@ if verbose: #=== Remove problems with mgr.delAdcProblem(ros, drawer, channel, adc, problem) if run<0: - run=TileCalibTools.getLastRunNumber() - log.warning( "Run number is not specified, using current run number %d" %run ) + if "UPD4" in folderTag: + run=TileCalibTools.getPromptCalibRunNumber() + log.warning( "Run number is not specified, using minimal run number in calibration loop %d" %run ) + else: + run=TileCalibTools.getLastRunNumber() + log.warning( "Run number is not specified, using current run number %d" %run ) if run<0: log.error( "Bad run number" ) sys.exit(2) @@ -187,7 +198,7 @@ if len(execFile): #=== commit changes dbw = TileCalibTools.openDbConn(outSchema,('UPDATE' if update else 'RECREATE')) - mgr.commitToDb(dbw, folderPath, folderTag, (TileBchDecoder.BitPat_onl01 if onl else TileBchDecoder.BitPat_ofl01), os.getlogin(), comment, since, until) + mgr.commitToDb(dbw, folderPath, folderTag, (TileBchDecoder.BitPat_onl01 if onl else TileBchDecoder.BitPat_ofl01), user, comment, since, until) else: dbw = None @@ -224,7 +235,7 @@ if len(curSuffix) and not onl and "sqlite" in outSchema: #=== commit changes dbW = TileCalibTools.openDbConn(curSchema,('UPDATE' if update else 'RECREATE')) - mgr.commitToDb(dbW, folderPath, folderTagUPD4, TileBchDecoder.BitPat_ofl01, os.getlogin(), comment, since, until) + mgr.commitToDb(dbW, folderPath, folderTagUPD4, TileBchDecoder.BitPat_ofl01, user, comment, since, until) dbW.closeDatabase() @@ -275,7 +286,25 @@ if len(onlSuffix) and not onl and "sqlite" in outSchema: for chn in xrange(0, 48): statlo = mgr.getAdcStatus(ros, mod, chn, 0) stathi = mgr.getAdcStatus(ros, mod, chn, 1) - + + # remove all trigger problems first + for prb in [TileBchPrbs.TrigGeneralMask, + TileBchPrbs.TrigNoGain, + TileBchPrbs.TrigHalfGain, + TileBchPrbs.TrigNoisy]: + mgrOnl.delAdcProblem(ros, mod, chn, 0, prb) + mgrOnl.delAdcProblem(ros, mod, chn, 1, prb) + # and now set new trigger problems (if any) + if not statlo.isGood(): + prbs = statlo.getPrbs() + for prb in prbs: + if prb in [TileBchPrbs.TrigGeneralMask, + TileBchPrbs.TrigNoGain, + TileBchPrbs.TrigHalfGain, + TileBchPrbs.TrigNoisy]: + mgrOnl.addAdcProblem(ros, mod, chn, 0, prb) + mgrOnl.addAdcProblem(ros, mod, chn, 1, prb) + #--- add IgnoreInHlt if either of the ADCs has isBad #--- add OnlineGeneralMaskAdc if the ADCs has isBad if statlo.isBad() and stathi.isBad(): @@ -318,7 +347,7 @@ if len(onlSuffix) and not onl and "sqlite" in outSchema: #=== commit changes onlSchema = outSchema.replace(".db", onlSuffix + ".db") dbW = TileCalibTools.openDbConn(onlSchema,('UPDATE' if update else 'RECREATE')) - mgrOnl.commitToDb(dbW, folderOnl, folderTagOnl, TileBchDecoder.BitPat_onl01, os.getlogin(), comment, since, until) + mgrOnl.commitToDb(dbW, folderOnl, folderTagOnl, TileBchDecoder.BitPat_onl01, user, comment, since, until) dbW.closeDatabase() #=== close DB diff --git a/TileCalorimeter/TileCalib/TileCalibBlobPython/share/WriteCalibToCool.py b/TileCalorimeter/TileCalib/TileCalibBlobPython/share/WriteCalibToCool.py index 0c378c142387bde3b1219787fe0238f8e3099ff7..94a70a22e09a55662894b8f7aaed0706bc1c652d 100755 --- a/TileCalorimeter/TileCalib/TileCalibBlobPython/share/WriteCalibToCool.py +++ b/TileCalorimeter/TileCalib/TileCalibBlobPython/share/WriteCalibToCool.py @@ -33,6 +33,7 @@ def usage(): print "-v, --version= specify blob version, by default version from input DB is used" print "-x, --txtfile= specify the text file with the new constants for reading" print "-m, --comment= specify comment to write" + print "-U, --user= specify username for comment" print "-p, --prefix= specify prefix which is expected on every line in input file, default - no prefix" print "-k, --keep= field numbers or channel numbers to ignore, e.g. '0,2,3,EBch0,EBch1,EBch12,EBch13,EBspD4ch18,EBspD4ch19,EBspC10ch4,EBspC10ch5' " print "-i, --inschema= specify the input schema to use, default is 'oracle://ATLAS_COOLPROD;schema=ATLAS_COOLOFL_TILE;dbname=CONDBR2'" @@ -40,8 +41,8 @@ def usage(): print "-s, --schema= specify input/output schema to use when both input and output schemas are the same" print "-u --update set this flag if output sqlite file should be updated, otherwise it'll be recreated" -letters = "hr:l:R:L:s:i:o:t:T:f:F:C:G:n:v:x:m:p:dcazZuk:" -keywords = ["help","run=","lumi=","run2=","lumi2=","schema=","inschema=","outschema=","tag=","outtag=","folder=","outfolder=","nchannel=","ngain=","nval=","version=","txtfile=","comment=","prefix=","default","channel","all","zero","allzero","update","keep="] +letters = "hr:l:R:L:s:i:o:t:T:f:F:C:G:n:v:x:m:U:p:dcazZuk:" +keywords = ["help","run=","lumi=","run2=","lumi2=","schema=","inschema=","outschema=","tag=","outtag=","folder=","outfolder=","nchannel=","ngain=","nval=","version=","txtfile=","comment=","user=","prefix=","default","channel","all","zero","allzero","update","keep="] try: opts, extraparams = getopt.getopt(sys.argv[1:],letters,keywords) @@ -76,6 +77,10 @@ comment = "" prefix = "" update = False keep=[] +try: + user=os.getlogin() +except: + user="UnknownUser" for o, a in opts: if o in ("-f","--folder"): @@ -126,6 +131,8 @@ for o, a in opts: txtFile = a elif o in ("-m","--comment"): comment = a + elif o in ("-U","--user"): + user = a elif o in ("-p","--prefix"): prefix = a elif o in ("-k","--keep"): @@ -159,17 +166,6 @@ log = getLogger("WriteCalibToCool") import logging log.setLevel(logging.DEBUG) -if run==0: begin=(0,0) -if run<=0: - run=TileCalibTools.getLastRunNumber() - log.warning( "Run number is not specified, using current run number %d" %run ) - if run<0: - log.error( "Bad run number" ) - sys.exit(2) -since = (run, lumi) -if not "begin" in dir(): begin=since -until=(TileCalibTools.MAXRUN, TileCalibTools.MAXLBK) - #=== set database dbr = TileCalibTools.openDbConn(inSchema,'READONLY') dbw = TileCalibTools.openDbConn(outSchema,('UPDATE' if update else 'RECREATE')) @@ -189,6 +185,22 @@ else: outfolderTag = TileCalibTools.getFolderTag(dbr, outfolderPath, outtag ) log.info("Initializing folder %s with tag %s" % (folderPath, folderTag)) +# set run number +if run==0: begin=(0,0) +if run<=0: + if "UPD4" in outtag: + run=TileCalibTools.getPromptCalibRunNumber() + log.warning( "Run number is not specified, using minimal run number in calibration loop %d" %run ) + else: + run=TileCalibTools.getLastRunNumber() + log.warning( "Run number is not specified, using current run number %d" %run ) + if run<0: + log.error( "Bad run number" ) + sys.exit(2) +since = (run, lumi) +if not "begin" in dir(): begin=since +until=(TileCalibTools.MAXRUN, TileCalibTools.MAXLBK) + #=== initialize blob reader to read previous comments blobReader = TileCalibTools.TileBlobReader(dbr,folderPath, folderTag) #=== get drawer with status at given run @@ -395,7 +407,7 @@ if mval!=0 and (len(comment)>0 or len(txtFile)>0): comment="Update for run %i from file %s" % (begin[0],txtFile) else: comment="Update for run,lumi %i,%i from file %s" % (begin[0],begin[1],txtFile) - blobWriter.setComment(os.getlogin(),comment) + blobWriter.setComment(user,comment) blobWriter.register(begin, until, outfolderTag) if undo: if (comment is None) or (comment == "None"): @@ -405,7 +417,7 @@ if mval!=0 and (len(comment)>0 or len(txtFile)>0): comment="Update for run %i - undoing changes done for run %i from file %s" % (run2,begin[0],txtFile) else: comment="Update for run,lumi %i,%i - undoing changes done for %i,%i from file %s" % (run2,lumi2,begin[0],begin[1],txtFile) - blobWriter2.setComment(os.getlogin(),comment) + blobWriter2.setComment(user,comment) blobWriter2.register((run2,lumi2), until, outfolderTag) elif run2>=0 and (run2<begin[0] or (run2==begin[0] and lumi2<begin[1]) and lumi2!=0): log.warning("(run2,lumi2)=(%i,%i) is smaller than (run,lumi)=(%i,%i) - will not create second IOV" % (run2,lumi2,begin[0],begin[1])) diff --git a/TileCalorimeter/TileCalib/TileCalibBlobPython/share/WriteCellNoiseToCool.py b/TileCalorimeter/TileCalib/TileCalibBlobPython/share/WriteCellNoiseToCool.py index 0838e1a49cb4e71aca6eb10ce2b18612f4832121..294a7ec7b6f2a3862dc73a6d116774a1253b6c83 100755 --- a/TileCalorimeter/TileCalib/TileCalibBlobPython/share/WriteCellNoiseToCool.py +++ b/TileCalorimeter/TileCalib/TileCalibBlobPython/share/WriteCellNoiseToCool.py @@ -147,6 +147,9 @@ if len(outTag)<1: raise Exception("Please, provide outtag (e.g. --outtag=Til if len(folderPath)<1: raise Exception("Please, provide folder (e.g. --folder=/TILE/OFL02/NOISE/CELL)") if len(dbName)<1: raise Exception("Please, provide dbname (e.g. --dbname=OFLP200 or --dbname=CONDBR2)") +if inTag=="HEAD": inTag="" +if outTag=="HEAD": outTag="" + if os.path.isfile(inFile): ischema = 'sqlite://;schema='+inFile+';dbname='+dbName else: @@ -216,7 +219,7 @@ dbr = CaloCondTools.openDbConn(ischema,'READONLY') #dbw = CaloCondTools.openDbConn(oschema,'RECREATE') dbw = CaloCondTools.openDbConn(oschema,'UPDATE') reader = CaloCondTools.CaloBlobReader(dbr,folderPath,inTag) -writer = CaloCondTools.CaloBlobWriter(dbw,folderPath,'Flt',True) +writer = CaloCondTools.CaloBlobWriter(dbw,folderPath,'Flt',(outTag!="" and outTag!="HEAD")) from TileCalibBlobPython.TileCalibTools import MAXRUN, MAXLBK from math import sqrt diff --git a/TileCalorimeter/TileEvent/TileEvent/TileBeamElemCollection.h b/TileCalorimeter/TileEvent/TileEvent/TileBeamElemCollection.h index c23c7abd527036d6fc1e5269414e0fc3ff394ae9..d612c5d4c3245e9b16ca6a041ba858f231ec674b 100755 --- a/TileCalorimeter/TileEvent/TileEvent/TileBeamElemCollection.h +++ b/TileCalorimeter/TileEvent/TileEvent/TileBeamElemCollection.h @@ -17,7 +17,7 @@ public: typedef MyBase::ID ID; typedef TileBeamElem _TElement; - TileBeamElemCollection ( ID& id, SG::OwnershipPolicy ownPolicy=SG::OWN_ELEMENTS ) + TileBeamElemCollection ( ID id, SG::OwnershipPolicy ownPolicy=SG::OWN_ELEMENTS ) : MyBase(id,ownPolicy) { } TileBeamElemCollection ( SG::OwnershipPolicy ownPolicy=SG::OWN_ELEMENTS ) : MyBase(ownPolicy) { } diff --git a/TileCalorimeter/TileEvent/TileEvent/TileCellCollection.h b/TileCalorimeter/TileEvent/TileEvent/TileCellCollection.h index 5e8460b69e4ee6346cb1df875a921f9d01da6c35..4f78ef63f6d151f20bd52b350e80ef5c91a7a968 100755 --- a/TileCalorimeter/TileEvent/TileEvent/TileCellCollection.h +++ b/TileCalorimeter/TileEvent/TileEvent/TileCellCollection.h @@ -18,7 +18,7 @@ public: // ATTENTION !!! // TileCollection is not owner of TileCells by default !!! - TileCellCollection ( ID& id, SG::OwnershipPolicy ownPolicy=SG::VIEW_ELEMENTS ) + TileCellCollection ( ID id, SG::OwnershipPolicy ownPolicy=SG::VIEW_ELEMENTS ) : MyBase(id,ownPolicy) { } TileCellCollection ( SG::OwnershipPolicy ownPolicy=SG::VIEW_ELEMENTS ) : MyBase(ownPolicy) { } diff --git a/TileCalorimeter/TileEvent/TileEvent/TileContainer.h b/TileCalorimeter/TileEvent/TileEvent/TileContainer.h index b700baa2ce0721508c23551db3631039abc62c92..b1e895812f17239289580ff50ced75f13c4ab0cc 100755 --- a/TileCalorimeter/TileEvent/TileEvent/TileContainer.h +++ b/TileCalorimeter/TileEvent/TileEvent/TileContainer.h @@ -44,7 +44,7 @@ public: // constructor TileContainer(SG::OwnershipPolicy ownPolicy=SG::OWN_ELEMENTS) : DataVector < _TElement > (ownPolicy) { } - // desctructor + // destructor virtual ~TileContainer() { } // insert a Tile element into a collection. diff --git a/TileCalorimeter/TileEvent/TileEvent/TileDigitsCollection.h b/TileCalorimeter/TileEvent/TileEvent/TileDigitsCollection.h index 960112d5ffd3216f398ede06bc070f6015628909..a87a65161d08770d65bac8e4ed9ac7781c2f8847 100755 --- a/TileCalorimeter/TileEvent/TileEvent/TileDigitsCollection.h +++ b/TileCalorimeter/TileEvent/TileEvent/TileDigitsCollection.h @@ -31,6 +31,13 @@ public: TileDigitsCollection ( SG::OwnershipPolicy ownPolicy=SG::OWN_ELEMENTS ) : MyBase(ownPolicy), m_FragSize(0), m_FragBCID(0) { m_FragExtraWords.resize(2); } + /** + * @brief Copy constructor. + * @param other Collection to copy. + * Does a deep copy of the contents. + */ + TileDigitsCollection (const TileDigitsCollection& other); + ~TileDigitsCollection() { } /** @@ -162,31 +169,11 @@ public: return m_FragChipCRCWordsHIGH; } - void printExtra() const { - std::cout<<std::hex<<"id=0x"<<this->identify() - <<std::dec<<", bcid="<<m_FragBCID - <<std::hex<<"(0x"<<m_FragBCID - <<std::dec<<"), size="<<m_FragSize - <<std::hex; - std::cout<<std::endl<<"FragExtraWords: "; - for (unsigned int i=0; i<m_FragExtraWords.size(); ++i) - std::cout<<" "<<m_FragExtraWords[i]; - std::cout<<std::endl<<"FragChipHeaderWords:"; - for (unsigned int i=0; i<m_FragChipHeaderWords.size(); ++i) - std::cout<<" "<<m_FragChipHeaderWords[i]; - std::cout<<std::endl<<"FragChipCRCWords: "; - for (unsigned int i=0; i<m_FragChipCRCWords.size(); ++i) - std::cout<<" "<<m_FragChipCRCWords[i]; - std::cout<<std::endl<<"FragChipHeaderWHigh:"; - for (unsigned int i=0; i<m_FragChipHeaderWordsHIGH.size(); ++i) - std::cout<<" "<<m_FragChipHeaderWordsHIGH[i]; - std::cout<<std::endl<<"FragChipCRCWHigh: "; - for (unsigned int i=0; i<m_FragChipCRCWordsHIGH.size(); ++i) - std::cout<<" "<<m_FragChipCRCWordsHIGH[i]; - std::cout<<std::endl<<std::dec; - } + void printExtra() const; + void printExtra(std::ostream& os) const; + - private: +private: /** * CRC words from Frag data, one word for each chip * LOW gain if calib mode diff --git a/TileCalorimeter/TileEvent/TileEvent/TileFastRawChannel.h b/TileCalorimeter/TileEvent/TileEvent/TileFastRawChannel.h index 8313b9e0dba236471aac53619bc155e0940e2c41..b8165c0deedcd876b8493c816dc86546bbfd1956 100755 --- a/TileCalorimeter/TileEvent/TileEvent/TileFastRawChannel.h +++ b/TileCalorimeter/TileEvent/TileEvent/TileFastRawChannel.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration */ #ifndef TILEEVENT_TILEFASTRAWCHANNEL_H @@ -26,6 +26,20 @@ class TileFastRawChannel { , m_quality(0.0) { } + TileFastRawChannel (unsigned int channel, + unsigned int adc, + float amplitude, + float time, + float quality) + : m_frag(-1) + , m_channel(channel) + , m_adc(adc) + , m_amplitude(amplitude) + , m_time(time) + , m_quality(quality) + { + } + ~TileFastRawChannel() { } diff --git a/TileCalorimeter/TileEvent/TileEvent/TileLasCalib.h b/TileCalorimeter/TileEvent/TileEvent/TileLasCalib.h index 81ce5b02b95d4676c1d72128f9b3d6e179e8a060..bc2df128b306838d998ea5541f2e8d3cb8a6eb1a 100644 --- a/TileCalorimeter/TileEvent/TileEvent/TileLasCalib.h +++ b/TileCalorimeter/TileEvent/TileEvent/TileLasCalib.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration */ /*author Marius Cornelis van Woerden*/ @@ -9,6 +9,8 @@ #ifndef TILELASCALIB_H #define TILELASCALIB_H + +#include <string> #include <math.h> @@ -100,7 +102,13 @@ class TileLasCalib { return false; } // isSet - private: + + /** Convertion operator to a std::string, + * can be used in a cast operation : (std::string) TileLaserDiode */ + operator std::string() const; + + +private: static const int HG = 1; static const int LG = 0; diff --git a/TileCalorimeter/TileEvent/TileEvent/TileLaser.h b/TileCalorimeter/TileEvent/TileEvent/TileLaser.h index 04e96a845bba018232256a842dd7e13f7b1f7bb4..c67f681611bce83a1a8fc17eab39ab8078d4653b 100644 --- a/TileCalorimeter/TileEvent/TileEvent/TileLaser.h +++ b/TileCalorimeter/TileEvent/TileEvent/TileLaser.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration */ /*author Renato Febbraro*/ @@ -11,6 +11,9 @@ #define TILELASER_H +#include <string> + + class TileLaser { public: @@ -42,7 +45,13 @@ class TileLaser { m_slamaDelay = SlamaDelay; } - private: + + /** Convertion operator to a std::string, + * can be used in a cast operation : (std::string) TileLaserPmt */ + operator std::string() const; + + +private: int m_counter; int m_diodeCurrOrd; diff --git a/TileCalorimeter/TileEvent/TileEvent/TileLaserControl.h b/TileCalorimeter/TileEvent/TileEvent/TileLaserControl.h index ff6aaad3b23608724900221e7f661271931b0fa3..09f48417c3aea0d93e306f00182a6e59b17690fc 100644 --- a/TileCalorimeter/TileEvent/TileEvent/TileLaserControl.h +++ b/TileCalorimeter/TileEvent/TileEvent/TileLaserControl.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration */ /*author Renato Febbraro*/ @@ -10,8 +10,11 @@ #ifndef TILELASERCONTROL_H #define TILELASERCONTROL_H + +#include <string> #include <time.h> + class TileLaserControl { public: @@ -63,7 +66,13 @@ class TileLaserControl { m_lastAlphaMeas = lastAlphaMeas; } - private: + + /** Convertion operator to a std::string, + * can be used in a cast operation : (std::string) TileLaserPmt */ + operator std::string() const; + + +private: double m_pumpDiodeTemp; int m_timeLastMeasP; diff --git a/TileCalorimeter/TileEvent/TileEvent/TileLaserDiode.h b/TileCalorimeter/TileEvent/TileEvent/TileLaserDiode.h index 9a182391d997b9d0eb4959ca939512a32c545ba0..a0133c2c9b47d1ce30976eb3cb6faf358e9476f3 100644 --- a/TileCalorimeter/TileEvent/TileEvent/TileLaserDiode.h +++ b/TileCalorimeter/TileEvent/TileEvent/TileLaserDiode.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration */ /*author Renato Febbraro*/ @@ -9,6 +9,10 @@ #ifndef TILELASERDIODE_H #define TILELASERDIODE_H + +#include <string> + + class TileLaserDiode { public: @@ -48,8 +52,14 @@ class TileLaserDiode { m_pedestalAlpha = pedestalAlpha; m_sigmaPedAlpha = sigmaPedAlpha; } - - private: + + + /** Convertion operator to a std::string, + * can be used in a cast operation : (std::string) TileLaserDiode */ + operator std::string() const; + + +private: int m_diodeADC; double m_diodePedestal; diff --git a/TileCalorimeter/TileEvent/TileEvent/TileLaserObject.h b/TileCalorimeter/TileEvent/TileEvent/TileLaserObject.h index 8cfba9b9cf679bc4c6389638dc0765c19223b96d..7ffb999669f709806fc852afb37e05ba694ebff2 100644 --- a/TileCalorimeter/TileEvent/TileEvent/TileLaserObject.h +++ b/TileCalorimeter/TileEvent/TileEvent/TileLaserObject.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration */ /*author Renato Febbraro*/ @@ -13,6 +13,7 @@ #ifndef TILELASEROBJECT_H #define TILELASEROBJECT_H +#include <string> #include <vector> #include <time.h> @@ -144,6 +145,12 @@ public: void setDaqType(const unsigned int daqtype); enum daqType {daqPedestal=0x10, daqAlpha, daqLed, daqLinearity, daqLaser}; + + /** Convertion operator to a std::string, + * can be used in a cast operation : (std::string) TileLaserPmt */ + operator std::string() const; + + private: TileLaserControl m_slowCtrl; diff --git a/TileCalorimeter/TileEvent/TileEvent/TileLaserPLC.h b/TileCalorimeter/TileEvent/TileEvent/TileLaserPLC.h index ed79b57aecc3f57986d0ea702bc687d172955946..7db24e1d62eb444c2cfc30e8166e328f5b946a1b 100644 --- a/TileCalorimeter/TileEvent/TileEvent/TileLaserPLC.h +++ b/TileCalorimeter/TileEvent/TileEvent/TileLaserPLC.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration */ /*author Renato Febbraro*/ @@ -10,6 +10,9 @@ #define TILELASERPLC +#include <string> + + class TileLaserPLC{ public: @@ -46,7 +49,13 @@ class TileLaserPLC{ m_alarm = alarm; } - private: + + /** Convertion operator to a std::string, + * can be used in a cast operation : (std::string) TileLaserPmt */ + operator std::string() const; + + +private: int m_alphaPos; double m_LVdiodes; diff --git a/TileCalorimeter/TileEvent/TileEvent/TileLaserPmt.h b/TileCalorimeter/TileEvent/TileEvent/TileLaserPmt.h index 0914b49ef6a4b50457ac4e786eb832f18d82f5ca..1c0a06a04e2b079f404137b1ab87d03202f2866a 100644 --- a/TileCalorimeter/TileEvent/TileEvent/TileLaserPmt.h +++ b/TileCalorimeter/TileEvent/TileEvent/TileLaserPmt.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration */ /*author Renato Febbraro*/ @@ -9,6 +9,10 @@ #ifndef TILELASERPMT_H #define TILELASERPMT_H + +#include <string> + + class TileLaserPmt { public: @@ -36,7 +40,13 @@ class TileLaserPmt { m_pmSigmaPedestal = pmSigmaPedestal; } - private: + + /** Convertion operator to a std::string, + * can be used in a cast operation : (std::string) TileLaserPmt */ + operator std::string() const; + + +private: int m_PMADC; int m_TDC; diff --git a/TileCalorimeter/TileEvent/src/TileBeamElem.cxx b/TileCalorimeter/TileEvent/src/TileBeamElem.cxx index 65ecb3ec57bd4f6921ccc558823715e50b9deac0..878ff9eb6423281ab9830b9eb29ec580d7e240c5 100755 --- a/TileCalorimeter/TileEvent/src/TileBeamElem.cxx +++ b/TileCalorimeter/TileEvent/src/TileBeamElem.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration */ //***************************************************************************** @@ -67,7 +67,7 @@ TileBeamElem::operator std::string() const { std::ostringstream text(std::ostringstream::out); - text << (std::string) (*(TileRawData *)this); + text << TileRawData::operator std::string(); TileRawData::print_to_stream(m_digits," Val:",text); diff --git a/TileCalorimeter/TileEvent/src/TileContainer.cxx b/TileCalorimeter/TileEvent/src/TileContainer.cxx index 6fe5ddc74e732dd7a5faca460041f00e76739ea8..89c0be60bb6c784431224eecdd17bfa2e52b46a6 100755 --- a/TileCalorimeter/TileEvent/src/TileContainer.cxx +++ b/TileCalorimeter/TileEvent/src/TileContainer.cxx @@ -27,22 +27,6 @@ #include "TileEvent/TileBeamElemContainer.h" #include "SGTools/BaseInfo.h" -void TileDigitsCollection::clear() -{ - m_FragChipCRCWords.clear(); - m_FragChipCRCWordsHIGH.clear(); - m_FragChipHeaderWords.clear(); - m_FragChipHeaderWordsHIGH.clear(); - - m_FragExtraWords.resize(2); - m_FragExtraWords[0] = m_FragExtraWords[1] = 0; - - m_FragSize = 0; - m_FragBCID = 0; - - TileDigitsCollection::MyBase::clear(); -} - void TileRawChannelCollection::clear() { m_FragGlobalCRC = 0; diff --git a/TileCalorimeter/TileEvent/src/TileDigitsCollection.cxx b/TileCalorimeter/TileEvent/src/TileDigitsCollection.cxx new file mode 100644 index 0000000000000000000000000000000000000000..63498ed138cd765a55793fc35719418f4c2b6ed7 --- /dev/null +++ b/TileCalorimeter/TileEvent/src/TileDigitsCollection.cxx @@ -0,0 +1,92 @@ +/* + * Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration. + */ +/** + * @file TileEvent/src/TileDigitsCollection.cxx + * @author scott snyder <snyder@bnl.gov> + * @date Oct, 2018 + * @brief Out-of-line implementations for TileDigitsCollection. + */ + + +#include "TileEvent/TileDigitsCollection.h" + + +/** + * @brief Copy constructor. + * @param other Collection to copy. + * Does a deep copy of the contents. + */ +TileDigitsCollection::TileDigitsCollection + (const TileDigitsCollection& other) + : TileRawDataCollection<TileDigits> (other.identify()), + m_FragChipCRCWords (other.m_FragChipCRCWords), + m_FragChipCRCWordsHIGH (other.m_FragChipCRCWordsHIGH), + m_FragChipHeaderWords (other.m_FragChipHeaderWords), + m_FragChipHeaderWordsHIGH (other.m_FragChipHeaderWordsHIGH), + m_FragExtraWords (other.m_FragExtraWords), + m_FragSize (other.m_FragSize), + m_FragBCID (other.m_FragBCID) +{ + // Copy flags from the base class. + setLvl1Id (other.getLvl1Id()); + setLvl1Type (other.getLvl1Type()); + setDetEvType (other.getDetEvType()); + setRODBCID (other.getRODBCID()); + + // Copy the collection contents. + reserve (other.size()); + for (const TileDigits* chan : other) { + push_back (std::make_unique<TileDigits> (*chan)); + } +} + + +void TileDigitsCollection::printExtra() const +{ + printExtra (std::cout); +} + + +void TileDigitsCollection::printExtra (std::ostream& os) const +{ + os<<std::hex<<"id=0x"<<this->identify() + <<std::dec<<", bcid="<<m_FragBCID + <<std::hex<<"(0x"<<m_FragBCID + <<std::dec<<"), size="<<m_FragSize + <<std::hex; + os<<std::endl<<"FragExtraWords: "; + for (unsigned int i=0; i<m_FragExtraWords.size(); ++i) + os<<" "<<m_FragExtraWords[i]; + os<<std::endl<<"FragChipHeaderWords:"; + for (unsigned int i=0; i<m_FragChipHeaderWords.size(); ++i) + os<<" "<<m_FragChipHeaderWords[i]; + os<<std::endl<<"FragChipCRCWords: "; + for (unsigned int i=0; i<m_FragChipCRCWords.size(); ++i) + os<<" "<<m_FragChipCRCWords[i]; + os<<std::endl<<"FragChipHeaderWHigh:"; + for (unsigned int i=0; i<m_FragChipHeaderWordsHIGH.size(); ++i) + os<<" "<<m_FragChipHeaderWordsHIGH[i]; + os<<std::endl<<"FragChipCRCWHigh: "; + for (unsigned int i=0; i<m_FragChipCRCWordsHIGH.size(); ++i) + os<<" "<<m_FragChipCRCWordsHIGH[i]; + os<<std::endl<<std::dec; +} + + +void TileDigitsCollection::clear() +{ + m_FragChipCRCWords.clear(); + m_FragChipCRCWordsHIGH.clear(); + m_FragChipHeaderWords.clear(); + m_FragChipHeaderWordsHIGH.clear(); + + m_FragExtraWords.resize(2); + m_FragExtraWords[0] = m_FragExtraWords[1] = 0; + + m_FragSize = 0; + m_FragBCID = 0; + + TileDigitsCollection::MyBase::clear(); +} + diff --git a/TileCalorimeter/TileEvent/src/TileLasCalib.cxx b/TileCalorimeter/TileEvent/src/TileLasCalib.cxx new file mode 100644 index 0000000000000000000000000000000000000000..27caad9180661befbd0a79ac4ff3ab8f11d59a3d --- /dev/null +++ b/TileCalorimeter/TileEvent/src/TileLasCalib.cxx @@ -0,0 +1,25 @@ +/* + * Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration. + */ +/** + * @file TileEvent/src/TileLasCalib.cxx + * @author scott snyder <snyder@bnl.gov> + * @date Oct, 2018 + * @brief TileLasCalib out-of-line implementation. + */ + + +#include "TileEvent/TileLasCalib.h" +#include <sstream> + + +TileLasCalib::operator std::string() const +{ + std::ostringstream text; + text << "TileLasCalib: "; + text << "type: " << m_type << " "; + text << "nevts: " << m_nevts << " "; + text << "LG mean/sig: " << m_mean_LG << " " << m_sigma_LG << " (" << m_isSet_LG << ") "; + text << "HG mean/sig: " << m_mean_HG << " " << m_sigma_HG << " (" << m_isSet_HG << ") "; + return text.str(); +} diff --git a/TileCalorimeter/TileEvent/src/TileLaser.cxx b/TileCalorimeter/TileEvent/src/TileLaser.cxx new file mode 100644 index 0000000000000000000000000000000000000000..374e2208bca91321cc0d0c0286941f0eafc8575c --- /dev/null +++ b/TileCalorimeter/TileEvent/src/TileLaser.cxx @@ -0,0 +1,26 @@ +/* + * Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration. + */ +/** + * @file TileEvent/src/TileLaser.cxx + * @author scott snyder <snyder@bnl.gov> + * @date Oct, 2018 + * @brief TileLaser out-of-line implementation. + */ + + +#include "TileEvent/TileLaser.h" +#include <sstream> + + +TileLaser::operator std::string() const +{ + std::ostringstream text; + text << "TileLaser: "; + text << "counter: " << m_counter << " "; + text << "diodeCurrOrd: " << m_diodeCurrOrd << " "; + text << "diodeCurrMeas: " << m_diodeCurrMeas << " "; + text << "filtNumber: " << m_filtNumber << " "; + text << "slamaDelay: " << m_slamaDelay << " "; + return text.str(); +} diff --git a/TileCalorimeter/TileEvent/src/TileLaserControl.cxx b/TileCalorimeter/TileEvent/src/TileLaserControl.cxx new file mode 100644 index 0000000000000000000000000000000000000000..d9a01445a06dea3e9049a6fec3cb511b95397c3c --- /dev/null +++ b/TileCalorimeter/TileEvent/src/TileLaserControl.cxx @@ -0,0 +1,30 @@ +/* + * Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration. + */ +/** + * @file TileEvent/src/TileLaserControl.cxx + * @author scott snyder <snyder@bnl.gov> + * @date Oct, 2018 + * @brief TileLaserControl out-of-line implementation. + */ + + +#include "TileEvent/TileLaserControl.h" +#include <sstream> + + +TileLaserControl::operator std::string() const +{ + std::ostringstream text; + text << "TileLaserControl: "; + text << "pumpDiodeTemp: " << m_pumpDiodeTemp << " "; + text << "diodeBoxTemp: " << m_diodeBoxTemp << " "; + text << "timeLastMeasP: " << m_timeLastMeasP << " "; + text << "gasFlux: " << m_gasFlux << " "; + text << "timeLastMeasF: " << m_timeLastMeasF << " "; + text << "humidity: " << m_humidity << " "; + text << "timeLastMeasH: " << m_timeLastMeasH << " "; + text << "lastPedMeas: " << m_lastPedMeas << " "; + text << "lastAlphaMeas: " << m_lastAlphaMeas; + return text.str(); +} diff --git a/TileCalorimeter/TileEvent/src/TileLaserDiode.cxx b/TileCalorimeter/TileEvent/src/TileLaserDiode.cxx new file mode 100644 index 0000000000000000000000000000000000000000..e4acf291e341d5f313cde0b7d7f3907490b4b7b8 --- /dev/null +++ b/TileCalorimeter/TileEvent/src/TileLaserDiode.cxx @@ -0,0 +1,28 @@ +/* + * Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration. + */ +/** + * @file TileEvent/src/TileLaserDiode.cxx + * @author scott snyder <snyder@bnl.gov> + * @date Oct, 2018 + * @brief TileLaserDiode out-of-line implementation. + */ + + +#include "TileEvent/TileLaserDiode.h" +#include <sstream> + + +TileLaserDiode::operator std::string() const +{ + std::ostringstream text; + text << "TileLaserDiode: "; + text << "ADC: " << m_diodeADC << " "; + text << "ped: " << m_diodePedestal << " "; + text << "sigPed: " << m_diodeSigmaPedestal << " "; + text << "alpha: " << m_alpha << " "; + text << "sigAlpha: " << m_sigmaAlpha << " "; + text << "pedAlpha: " << m_pedestalAlpha << " "; + text << "sigPedAlpha: " << m_sigmaPedAlpha; + return text.str(); +} diff --git a/TileCalorimeter/TileEvent/src/TileLaserObject.cxx b/TileCalorimeter/TileEvent/src/TileLaserObject.cxx index 56d49a1db3e570fff7758d498eb515ef3634e73a..39b90319b6b2127c8c7f5e869b21b15c25d13580 100644 --- a/TileCalorimeter/TileEvent/src/TileLaserObject.cxx +++ b/TileCalorimeter/TileEvent/src/TileLaserObject.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration */ /*author Renato Febbraro*/ @@ -11,6 +11,7 @@ /*Marco van Woerden <mvanwoer@cern.ch>*/ #include "TileEvent/TileLaserObject.h" +#include <sstream> TileLaserObject::TileLaserObject() @@ -334,3 +335,41 @@ void TileLaserObject::setDaqType(const unsigned int daqtype){ m_daqtype = daqtype; } + +TileLaserObject::operator std::string() const +{ + std::ostringstream text; + text << "TileLaserObject:\n"; + text << " "; + text << "version: " << m_version << " "; + text << "BCID: " << m_BCID << " "; + text << "daqtype: " << m_daqtype << " "; + text << "calibtype: " << m_calibtype << "\n"; + text << " " << static_cast<std::string> (m_slowCtrl) << "\n"; + text << " " << static_cast<std::string> (m_laserParameter) << "\n"; + text << " " << static_cast<std::string> (m_plc) << "\n"; + text << " LG diodes\n"; + for (const TileLaserDiode& d : m_diodesLG) { + text << " " << static_cast<std::string> (d) << "\n"; + } + text << " HG diodes\n"; + for (const TileLaserDiode& d : m_diodesHG) { + text << " " << static_cast<std::string> (d) << "\n"; + } + text << " LG PMTs\n"; + for (const TileLaserPmt& p : m_pmtsLG) { + text << " " << static_cast<std::string> (p) << "\n"; + } + text << " HG PMTs\n"; + for (const TileLaserPmt& p : m_pmtsHG) { + text << " " << static_cast<std::string> (p) << "\n"; + } + text << " Calib\n"; + for (const std::vector<TileLasCalib>& v : m_lascalib) { + text << " " << v.size() << "calibs\n"; + for (const TileLasCalib& c : v) { + text << " " << static_cast<std::string> (c) << "\n"; + } + } + return text.str(); +} diff --git a/TileCalorimeter/TileEvent/src/TileLaserPLC.cxx b/TileCalorimeter/TileEvent/src/TileLaserPLC.cxx new file mode 100644 index 0000000000000000000000000000000000000000..7d402e65a2d9c054bdc04265d8c4f61f763118c8 --- /dev/null +++ b/TileCalorimeter/TileEvent/src/TileLaserPLC.cxx @@ -0,0 +1,27 @@ +/* + * Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration. + */ +/** + * @file TileEvent/src/TileLaserPLC.cxx + * @author scott snyder <snyder@bnl.gov> + * @date Oct, 2018 + * @brief TileLaserPLC out-of-line implementation. + */ + + +#include "TileEvent/TileLaserPLC.h" +#include <sstream> + + +TileLaserPLC::operator std::string() const +{ + std::ostringstream text; + text << "TileLaserPLC: "; + text << "alphaPos: " << m_alphaPos << " "; + text << "LVdiodes: " << m_LVdiodes << " "; + text << "HVpmts: " << m_HVpmts << " "; + text << "shutter: " << m_shutter << " "; + text << "interlock: " << m_interlock << " "; + text << "alarm: " << m_alarm; + return text.str(); +} diff --git a/TileCalorimeter/TileEvent/src/TileLaserPmt.cxx b/TileCalorimeter/TileEvent/src/TileLaserPmt.cxx new file mode 100644 index 0000000000000000000000000000000000000000..10818ad44f35fa3e1d66f163d8c86ff1ecadf09e --- /dev/null +++ b/TileCalorimeter/TileEvent/src/TileLaserPmt.cxx @@ -0,0 +1,25 @@ +/* + * Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration. + */ +/** + * @file TileEvent/src/TileLaserPmt.cxx + * @author scott snyder <snyder@bnl.gov> + * @date Oct, 2018 + * @brief TileLaserPmt out-of-line implementation. + */ + + +#include "TileEvent/TileLaserPmt.h" +#include <sstream> + + +TileLaserPmt::operator std::string() const +{ + std::ostringstream text; + text << "TileLaserPmt: "; + text << "PMADC: " << m_PMADC << " "; + text << "TDC: " << m_TDC << " "; + text << "ped: " << m_pmPedestal << " "; + text << "sigPed: " << m_pmSigmaPedestal; + return text.str(); +} diff --git a/TileCalorimeter/TileEvent/src/TileRawChannel.cxx b/TileCalorimeter/TileEvent/src/TileRawChannel.cxx index c677c8e0c39439ccd20503ed2ac249e4d23922d7..cc44d76b1100b2ad60ff7c6e0930688e439d5711 100755 --- a/TileCalorimeter/TileEvent/src/TileRawChannel.cxx +++ b/TileCalorimeter/TileEvent/src/TileRawChannel.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration */ //***************************************************************************** @@ -90,7 +90,7 @@ void TileRawChannel::print() const { TileRawChannel::operator std::string() const { std::ostringstream text(std::ostringstream::out); - text << (std::string) (*(TileRawData *) this); + text << TileRawData::operator std::string(); print_to_stream(m_amplitude, " ampl =", text); print_to_stream(m_time, " time =", text); print_to_stream(m_quality, " qual =", text); diff --git a/TileCalorimeter/TileExample/TileRecEx/share/jobOptions_TileCalibRec.py b/TileCalorimeter/TileExample/TileRecEx/share/jobOptions_TileCalibRec.py index 3163ff78c3bbc720131a7c49f5dc4e482621bcbb..2144c173c715174135208b4dd03d2917e26bf473 100644 --- a/TileCalorimeter/TileExample/TileRecEx/share/jobOptions_TileCalibRec.py +++ b/TileCalorimeter/TileExample/TileRecEx/share/jobOptions_TileCalibRec.py @@ -1222,7 +1222,7 @@ if doTileMon: TileMon.Run = RunNumber TileMon.LumiBlock = 1 - from AthenaCommon.AppMgr import ToolSvc + #from AthenaCommon.AppMgr import ToolSvc from TileMonitoring.TileMonitoringConf import * doTileMonDigi = ReadDigits @@ -1242,7 +1242,7 @@ if doTileMon: book2D = b2d, runType = runType, FillPedestalDifference = True) - ToolSvc += theTileDigitsMon + #ToolSvc += theTileDigitsMon TileMon.AthenaMonTools += [ theTileDigitsMon ] print theTileDigitsMon @@ -1253,7 +1253,7 @@ if doTileMon: book2D = b2d, PlotDSP = useRODReco, runType = runType ) - ToolSvc += theTileRawChannelMon + #ToolSvc += theTileRawChannelMon TileMon.AthenaMonTools += [ theTileRawChannelMon ] theTileRawChannelMon.TileRawChannelContainer = "TileRawChannelCnt"; # default for simulation @@ -1321,7 +1321,7 @@ if doTileMon: if useRODReco: theTileDQFragMon.TileRawChannelContainerDSP = "TileRawChannelCnt" - ToolSvc += theTileDQFragMon; + #ToolSvc += theTileDQFragMon; TileMon.AthenaMonTools += [ theTileDQFragMon ]; print theTileDQFragMon @@ -1334,7 +1334,7 @@ if doTileMon: negEnergyThreshold = -2000, energyThreshold = 300, histoPathBase = "/Tile/Cell"); - ToolSvc += theTileCellMonHG; + #ToolSvc += theTileCellMonHG; TileMon.AthenaMonTools += [ theTileCellMonHG ]; print theTileCellMonHG; @@ -1350,7 +1350,7 @@ if doTileMon: #theTileCellMon.energyThreshold = 300. #theTileCellMon.energyThresholdForTime = 150. #theTileCellMon.FillTimeHistograms = True - ToolSvc += theTileCellMon; + #ToolSvc += theTileCellMon; TileMon.AthenaMonTools += [ theTileCellMon ]; print theTileCellMon; @@ -1361,7 +1361,7 @@ if doTileMon: histoPathBase = "/Tile/DigiNoise" ); if not TileBiGainRun: TileDigiNoiseMon.TriggerTypes = [ 0x82 ] - ToolSvc += TileDigiNoiseMon; + #ToolSvc += TileDigiNoiseMon; TileMon.AthenaMonTools += [ TileDigiNoiseMon ]; print TileDigiNoiseMon; @@ -1373,7 +1373,7 @@ if doTileMon: histoPathBase = "/Tile/CellNoise/LG"); TileCellNoiseMonLG.Xmin = -2000.; TileCellNoiseMonLG.Xmax = 2000.; - ToolSvc += TileCellNoiseMonLG; + #ToolSvc += TileCellNoiseMonLG; TileMon.AthenaMonTools += [ TileCellNoiseMonLG ]; print TileCellNoiseMonLG; @@ -1385,7 +1385,7 @@ if doTileMon: histoPathBase = "/Tile/CellNoise/HG"); TileCellNoiseMonHG.Xmin = -300.; TileCellNoiseMonHG.Xmax = 300.; - ToolSvc += TileCellNoiseMonHG; + #ToolSvc += TileCellNoiseMonHG; TileMon.AthenaMonTools += [ TileCellNoiseMonHG ]; print TileCellNoiseMonHG; @@ -1397,7 +1397,7 @@ if doTileMon: histoPathBase = "/Tile/CellNoise"); TileCellNoiseMon.Xmin = -2000.; TileCellNoiseMon.Xmax = 2000.; - ToolSvc += TileCellNoiseMon; + #ToolSvc += TileCellNoiseMon; TileMon.AthenaMonTools += [ TileCellNoiseMon ]; print TileCellNoiseMon; @@ -1411,7 +1411,7 @@ if doTileMon: doOnline = athenaCommonFlags.isOnline(), TileRawChannelContainer = "TileRawChannelFit") - ToolSvc += TileRawChannelTimeMon + #ToolSvc += TileRawChannelTimeMon TileMon.AthenaMonTools += [ TileRawChannelTimeMon ]; print TileRawChannelTimeMon @@ -1431,7 +1431,7 @@ if doTileMon: # doFit = True, SummaryUpdateFrequency = 0 ); - ToolSvc += TileRawChannelNoiseMonLG; + #ToolSvc += TileRawChannelNoiseMonLG; TileMon.AthenaMonTools += [ TileRawChannelNoiseMonLG ]; print TileRawChannelNoiseMonLG; @@ -1448,7 +1448,7 @@ if doTileMon: SummaryUpdateFrequency = 0 ); - ToolSvc += TileRawChannelNoiseMonHG; + #ToolSvc += TileRawChannelNoiseMonHG; TileMon.AthenaMonTools += [ TileRawChannelNoiseMonHG ]; print TileRawChannelNoiseMonHG; @@ -1468,7 +1468,7 @@ if doTileMon: # if not defined here, then by default all triggers will be considered TileRawChannelNoiseMon.TriggerTypes = [ 0x82 ]; - ToolSvc += TileRawChannelNoiseMon; + #ToolSvc += TileRawChannelNoiseMon; TileMon.AthenaMonTools += [ TileRawChannelNoiseMon ]; print TileRawChannelNoiseMon; @@ -1476,27 +1476,27 @@ if doTileMon: ########### end doTileCellNoiseMon ########## if doTileTMDBDigitsMon: - ToolSvc += CfgMgr.TileTMDBDigitsMonTool(name = 'TileTMDBDigitsMon' + TileTMDBDigitsMon = CfgMgr.TileTMDBDigitsMonTool(name = 'TileTMDBDigitsMon' , OutputLevel = INFO , TileDigitsContainer = "MuRcvDigitsCnt" , histoPathBase = "/Tile/TMDBDigits") - TileMon.AthenaMonTools += [ ToolSvc.TileTMDBDigitsMon ] - print ToolSvc.TileTMDBDigitsMon + TileMon.AthenaMonTools += [ TileTMDBDigitsMon ] + print TileTMDBDigitsMon if doTileTMDBRawChannelMon: - ToolSvc += CfgMgr.TileTMDBRawChannelMonTool(name = 'TileTMDBRawChannelDspMon' + TileTMDBRawChannelDspMon = CfgMgr.TileTMDBRawChannelMonTool(name = 'TileTMDBRawChannelDspMon' , OutputLevel = INFO , NotDSP = False , TileRawChannelContainer = "MuRcvRawChCnt" , histoPathBase = "/Tile/TMDBRawChannel/Dsp") - TileMon.AthenaMonTools += [ToolSvc.TileTMDBRawChannelDspMon ] - print ToolSvc.TileTMDBRawChannelDspMon + TileMon.AthenaMonTools += [TileTMDBRawChannelDspMon ] + print TileTMDBRawChannelDspMon - ToolSvc += CfgMgr.TileTMDBRawChannelMonTool(name = 'TileTMDBRawChannelMon' + TileTMDBRawChannelMon = CfgMgr.TileTMDBRawChannelMonTool(name = 'TileTMDBRawChannelMon' , OutputLevel = INFO , TileRawChannelContainer = "TileMuRcvRawChannelOpt2" , NotDSP = True @@ -1504,8 +1504,8 @@ if doTileMon: , histoPathBase = "/Tile/TMDBRawChannel") - TileMon.AthenaMonTools += [ToolSvc.TileTMDBRawChannelMon ] - print ToolSvc.TileTMDBRawChannelMon + TileMon.AthenaMonTools += [TileTMDBRawChannelMon ] + print TileTMDBRawChannelMon if doTileMonDigi or doTileMonRch or doTileMonCell or doTileMonDQ \ @@ -1567,7 +1567,7 @@ if doTileCalib: TileCisTool.StuckBitsProbsTool = ToolSvc.TileDigitsMon TileCisTool.removePed = True - from AthenaCommon.AppMgr import ToolSvc + #from AthenaCommon.AppMgr import ToolSvc ToolSvc += TileCisTool TileCalibAlg.TileCalibTools += [ TileCisTool ] @@ -1587,7 +1587,7 @@ if doTileCalib: # declare Trigger tool(s) and set jobOptions if necessary TileTriggerTool = TileTriggerDefaultCalibTool() - from AthenaCommon.AppMgr import ToolSvc + #from AthenaCommon.AppMgr import ToolSvc ToolSvc += TileTriggerTool TileCalibAlg.TileCalibTools += [ TileTriggerTool ] @@ -1608,7 +1608,7 @@ if doTileCalib: if hasattr(ToolSvc, 'TileDigitsMon'): TileLaserTool.StuckBitsProbsTool = ToolSvc.TileDigitsMon - from AthenaCommon.AppMgr import ToolSvc + #from AthenaCommon.AppMgr import ToolSvc ToolSvc += TileLaserTool TileCalibAlg.Tools = [ TileLaserTool ] @@ -1648,7 +1648,7 @@ if doEventDisplay: if doAtlantis: include("JiveXML/JiveXML_jobOptionBase.py") - from AthenaCommon.AppMgr import ToolSvc + #from AthenaCommon.AppMgr import ToolSvc if 'doAtlantisStreamToServer' in dir() and doAtlantisStreamToServer: from JiveXML.JiveXMLConf import JiveXML__ONCRPCServerSvc diff --git a/TileCalorimeter/TileIdentifier/TileIdentifier/TileFragHash.h b/TileCalorimeter/TileIdentifier/TileIdentifier/TileFragHash.h index 5d9178e3453d40af4b30239fe6bc82737765483e..ea10c7de9ab169e3c82b4e6a57cc2cbef9606e82 100755 --- a/TileCalorimeter/TileIdentifier/TileIdentifier/TileFragHash.h +++ b/TileCalorimeter/TileIdentifier/TileIdentifier/TileFragHash.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration */ @@ -8,7 +8,8 @@ class TileHWID; -#include <vector> +#include <vector> +#include <string> /** * @class TileFragHash @@ -52,8 +53,13 @@ class TileFragHash { /**return hash type */ TYPE type() const {return m_type;} - - private: + + + /** Printable representation of a type. */ + static std::string typeToString (TYPE type); + + +private: /** total number of IDs */ int m_size; // total number of IDs int m_offset; // different offset for different types of collections diff --git a/TileCalorimeter/TileIdentifier/TileIdentifier/TileRawChannelUnit.h b/TileCalorimeter/TileIdentifier/TileIdentifier/TileRawChannelUnit.h index 520847273a6d89e58f2473ec5a721b493f447ca6..5aae15fa879a079e4e983fcdf642516a36501f89 100644 --- a/TileCalorimeter/TileIdentifier/TileIdentifier/TileRawChannelUnit.h +++ b/TileCalorimeter/TileIdentifier/TileIdentifier/TileRawChannelUnit.h @@ -1,9 +1,13 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration */ -#ifndef TILECONDITIONS_TILERAWCHANNELUNIT__H -#define TILECONDITIONS_TILERAWCHANNELUNIT__H +#ifndef TILECONDITIONS_TILERAWCHANNELUNIT_H +#define TILECONDITIONS_TILERAWCHANNELUNIT_H + + +#include <string> + class TileRawChannelUnit { @@ -21,6 +25,10 @@ class TileRawChannelUnit OnlineOffset = 4, Invalid = 99 }; + + + /** Printable representation of a unit. */ + static std::string unitToString (UNIT type); }; #endif diff --git a/TileCalorimeter/TileIdentifier/src/TileFragHash.cxx b/TileCalorimeter/TileIdentifier/src/TileFragHash.cxx index 693b74e8ee0172fcb0260584bcc6420b671c9564..69e58ffdbddcf578931a76349adbe04fa8ee86db 100755 --- a/TileCalorimeter/TileIdentifier/src/TileFragHash.cxx +++ b/TileCalorimeter/TileIdentifier/src/TileFragHash.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration */ @@ -78,3 +78,26 @@ int TileFragHash::hash (const ID& id) const return m_lookup[id]; } + +/** + * @brief Printable representation of a type. + */ +std::string TileFragHash::typeToString (TYPE type) +{ + switch (type) { +#define CASE(X) case TileFragHash::X: return #X + CASE(Digitizer); + CASE(OptFilterDsp); + CASE(OptFilterOffline); + CASE(OptFilterDspCompressed); + CASE(ManyAmps); + CASE(MF); + CASE(FitFilter); + CASE(FitFilterCool); + CASE(FlatFilter); + CASE(Beam); +#undef CASE + default: break; + }; + return "UNKNOWN"; +} diff --git a/TileCalorimeter/TileIdentifier/src/TileRawChannelUnit.cxx b/TileCalorimeter/TileIdentifier/src/TileRawChannelUnit.cxx new file mode 100644 index 0000000000000000000000000000000000000000..02fe205e4e753acf42c2a2aa91089931502bf347 --- /dev/null +++ b/TileCalorimeter/TileIdentifier/src/TileRawChannelUnit.cxx @@ -0,0 +1,28 @@ +/* + * Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration. + */ + + +#include "TileIdentifier/TileRawChannelUnit.h" + + +/** + * @brief Printable representation of a unit. + */ +std::string TileRawChannelUnit::unitToString (UNIT unit) +{ + switch (unit) { +#define CASE(X) case TileRawChannelUnit::X: return #X + CASE(ADCcounts); + CASE(PicoCoulombs); + CASE(CesiumPicoCoulombs); + CASE(MegaElectronVolts); + CASE(OnlineADCcounts); + CASE(OnlinePicoCoulombs); + CASE(OnlineCesiumPicoCoulombs); + CASE(OnlineMegaElectronVolts); +#undef CASE + default: break; + }; + return "UNKNOWN"; +} diff --git a/TileCalorimeter/TileL2Algs/TileL2Algs/TileL2Builder.h b/TileCalorimeter/TileL2Algs/TileL2Algs/TileL2Builder.h index a3e33baba7cdac551c5ae79bab4ca4b31b9a4a90..0c49d136e4e76a26353b91e00d165c000486bfa7 100644 --- a/TileCalorimeter/TileL2Algs/TileL2Algs/TileL2Builder.h +++ b/TileCalorimeter/TileL2Algs/TileL2Algs/TileL2Builder.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration */ //**************************************************************************** @@ -49,20 +49,20 @@ class TileL2Builder: public AthAlgTool { , const std::string& name , const IInterface* parent); - virtual ~TileL2Builder(); + virtual ~TileL2Builder() override; - virtual StatusCode initialize(); + virtual StatusCode initialize() override; - virtual StatusCode finalize(); + virtual StatusCode finalize() override; - virtual StatusCode process(int fragmin, int fragmax, TileL2Container *l2Container); + virtual StatusCode process(int fragmin, int fragmax, TileL2Container *l2Container) const; - /** Return colllection ID for a given index */ - inline int indexToId(int i) { + /** Return collection ID for a given index */ + inline int indexToId(int i) const { return m_hashFunc.identifier(i); } - inline int idToIndex(int id) { + inline int idToIndex(int id) const { return m_hashFunc(id); } @@ -78,7 +78,7 @@ class TileL2Builder: public AthAlgTool { * @param gain gain for all channels - on return it will contain corrected values * @param bad bad flag for all channels */ - void MaskBad(int partition, float* E, int* gain, bool* bad); + void MaskBad(int partition, float* E, int* gain, bool* bad) const; /** * Muon tagging function for LB superdrawers as processed at the ROD DSPs. @@ -98,7 +98,7 @@ class TileL2Builder: public AthAlgTool { , std::vector<float> &EMuons1 , std::vector<float> &EMuons2 , std::vector<unsigned int> &qf - , std::vector<unsigned int> &extraWord); + , std::vector<unsigned int> &extraWord) const; inline void MTagLB(int partition , int drawer @@ -110,7 +110,7 @@ class TileL2Builder: public AthAlgTool { , std::vector<float> &EMuons1 , std::vector<float> &EMuons2 , std::vector<unsigned int> &qf - , std::vector<unsigned int> &extraWord) { + , std::vector<unsigned int> &extraWord) const { MaskBad(partition, EMeV, gain, bad); MTagLB(partition, drawer, EMeV, EtaMuons, EMuons0, EMuons1, EMuons2, qf, extraWord); } @@ -133,7 +133,7 @@ class TileL2Builder: public AthAlgTool { , std::vector<float> &EMuons1 , std::vector<float> &EMuons2 , std::vector<unsigned int> &qf - , std::vector<unsigned int> &extraWord); + , std::vector<unsigned int> &extraWord) const; inline void MTagEB(int partition , int drawer @@ -145,7 +145,7 @@ class TileL2Builder: public AthAlgTool { , std::vector<float> &EMuons1 , std::vector<float> &EMuons2 , std::vector<unsigned int> &qf - , std::vector<unsigned int> &extraWord) { + , std::vector<unsigned int> &extraWord) const { MaskBad(partition, EMeV, gain, bad); MTagEB(partition, drawer, EMeV, EtaMuons, EMuons0, EMuons1, EMuons2, qf, extraWord); } @@ -160,15 +160,15 @@ class TileL2Builder: public AthAlgTool { * @param bad bad flag for all channels * @param sumE sumEt, sumEz and sumE for the drawer in one vector */ - void SumE(int partition, int drawer, float * E, std::vector<float> &sumE); - void SumE(int partition, int drawer, int unit, float* E, int* gain, std::vector<float> &sumE); + void SumE(int partition, int drawer, float * E, std::vector<float> &sumE) const; + void SumE(int partition, int drawer, int unit, float* E, int* gain, std::vector<float> &sumE) const; inline void SumE(int partition , int drawer , int unit , float* E , int* gain , bool* bad - , std::vector<float> &sumE) { + , std::vector<float> &sumE) const { MaskBad(partition, E, gain, bad); SumE(partition, drawer, unit, E, gain, sumE); } diff --git a/TileCalorimeter/TileL2Algs/src/TileL2Builder.cxx b/TileCalorimeter/TileL2Algs/src/TileL2Builder.cxx index 577d51506201f08987be455e0473f621ddab63a6..6dc1097c3ec0c2dc97b1c83515956c5953c213bf 100644 --- a/TileCalorimeter/TileL2Algs/src/TileL2Builder.cxx +++ b/TileCalorimeter/TileL2Algs/src/TileL2Builder.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration */ //***************************************************************************** @@ -173,7 +173,7 @@ StatusCode TileL2Builder::initialize() { return StatusCode::SUCCESS; } -StatusCode TileL2Builder::process(int fragmin, int fragmax, TileL2Container *l2Container) { +StatusCode TileL2Builder::process(int fragmin, int fragmax, TileL2Container *l2Container) const { // Get TileRawChannels SG::ReadHandle<TileRawChannelContainer> rawChannelContainer(m_rawChannelContainerKey); @@ -295,7 +295,7 @@ void TileL2Builder::MTagLB(int partition , std::vector<float> &EMuons1 , std::vector<float> &EMuons2 , std::vector<unsigned int> &qf - , std::vector<unsigned int> &extraWord) { + , std::vector<unsigned int> &extraWord) const { // Maximum number of muons tagged per superdrawer int cut = 4; @@ -478,7 +478,7 @@ void TileL2Builder::MTagEB(int partition , std::vector<float> &EMuons1 , std::vector<float> &EMuons2 , std::vector<unsigned int> &qf - , std::vector<unsigned int> &extraWord) { + , std::vector<unsigned int> &extraWord) const { // Maximum number of muons tagged per superdrawer int cut = 4; @@ -668,7 +668,7 @@ void TileL2Builder::MTagEB(int partition } void TileL2Builder::SumE(int ros, int /* drawer */, int unit, float *E, int *gain, - std::vector<float> &sumE) { + std::vector<float> &sumE) const { // precision in DSP - 1/16 ADC counts or 1/2048 pC and CspC or 1/2 MeV static const float AMPLITUDE_FACTOR_HG[4] = { 16.0, 32.0 * 64, 32.0 * 64., 2.0 }; static const float AMPLITUDE_FACTOR_LG[4] = { 16.0, 32.0, 32.0, 2.0 / 64.0 }; @@ -682,9 +682,9 @@ void TileL2Builder::SumE(int ros, int /* drawer */, int unit, float *E, int *gai const float scaleHG = AMPLITUDE_FACTOR_HG[unit]; const float scaleLG = AMPLITUDE_FACTOR_LG[unit]; int ros1 = ros - 1; - float* wt = m_sinThRound[ros1]; - float* wz = m_cosThRound[ros1]; - bool* connected = m_connected[ros1]; + const float* wt = m_sinThRound[ros1]; + const float* wz = m_cosThRound[ros1]; + const bool* connected = m_connected[ros1]; float Et = 0.0; float Ez = 0.0; @@ -715,16 +715,16 @@ void TileL2Builder::SumE(int ros, int /* drawer */, int unit, float *E, int *gai sumE[2] = Es * inv_scaleHG; } -void TileL2Builder::SumE(int ros, int /* drawer */, float *E, std::vector<float> &sumE) { +void TileL2Builder::SumE(int ros, int /* drawer */, float *E, std::vector<float> &sumE) const { if (ros < 1 || ros > 4) { sumE[0] = sumE[1] = sumE[2] = 0.0; return; } int ros1 = ros - 1; - float* wt = m_sinTh[ros1]; - float* wz = m_cosTh[ros1]; - bool* connected = m_connected[ros1]; + const float* wt = m_sinTh[ros1]; + const float* wz = m_cosTh[ros1]; + const bool* connected = m_connected[ros1]; float Et = 0.0; float Ez = 0.0; float Es = 0.0; @@ -748,7 +748,7 @@ void TileL2Builder::SumE(int ros, int /* drawer */, float *E, std::vector<float> sumE[2] = Es; } -void TileL2Builder::MaskBad(int ros, float *E, int * gain, bool *bad) { +void TileL2Builder::MaskBad(int ros, float *E, int * gain, bool *bad) const { for (int i = 0; i < 48; ++i) { if (bad[i]) { int j = m_channelPairs[ros - 1][i]; diff --git a/TileCalorimeter/TileMonitoring/share/TileMon_jobOptions.py b/TileCalorimeter/TileMonitoring/share/TileMon_jobOptions.py index 0b9cc9e39df3856f6f0eea8c36ac33c40d7f894b..db71745dbd64f425427fd623b351bc563b053b1b 100644 --- a/TileCalorimeter/TileMonitoring/share/TileMon_jobOptions.py +++ b/TileCalorimeter/TileMonitoring/share/TileMon_jobOptions.py @@ -55,60 +55,60 @@ if tileESDMon: TileCellMon.FillTimeHistograms = True TileCellMon.energyThresholdForTime = 150.0 - ToolSvc += TileCellMon; + #ToolSvc += TileCellMon; ManagedAthenaTileMon.AthenaMonTools += [ TileCellMon ]; include ("TileMonitoring/TileMonTower_jobOptions.py") - ToolSvc += CfgMgr.TileTowerMonTool(name = 'TileTowerMon' + TileTowerMon = CfgMgr.TileTowerMonTool(name = 'TileTowerMon' , OutputLevel = INFO , towersContainerName = "TileTower" , FillHistogramsForL1Triggers = [] , histoPathBase = "/Tile/Tower"); - ManagedAthenaTileMon.AthenaMonTools += [ ToolSvc.TileTowerMon ]; + ManagedAthenaTileMon.AthenaMonTools += [ TileTowerMon ]; include ("TileMonitoring/TileMonTopoCluster_jobOptions.py") - ToolSvc += CfgMgr.TileClusterMonTool(name = 'TileClusterMon' + TileClusterMon = CfgMgr.TileClusterMonTool(name = 'TileClusterMon' , OutputLevel = INFO , clustersContainerName = "TileTopoCluster" , FillHistogramsForL1Triggers = [] , histoPathBase = "/Tile/Cluster"); - ManagedAthenaTileMon.AthenaMonTools += [ ToolSvc.TileClusterMon ]; + ManagedAthenaTileMon.AthenaMonTools += [ TileClusterMon ]; if (jobproperties.Beam.beamType() == 'cosmics' or jobproperties.Beam.beamType() == 'singlebeam'): - ToolSvc += CfgMgr.TileMuonFitMonTool(name = 'TileMuonFitMon' + TileMuonFitMon = CfgMgr.TileMuonFitMonTool(name = 'TileMuonFitMon' , OutputLevel = INFO , UseLVL1 = DQMonFlags.useTrigger() , FillHistogramsForL1Triggers = [] , histoPathBase = "/Tile/MuonFit") - ManagedAthenaTileMon.AthenaMonTools += [ ToolSvc.TileMuonFitMon ] + ManagedAthenaTileMon.AthenaMonTools += [ TileMuonFitMon ] - ToolSvc += CfgMgr.TileMuIdMonTool(name = 'TileMuIdMon' + TileMuIdMon = CfgMgr.TileMuIdMonTool(name = 'TileMuIdMon' , OutputLevel = INFO , FillHistogramsForL1Triggers = [] , histoPathBase = "/Tile/Muid") - ManagedAthenaTileMon.AthenaMonTools += [ ToolSvc.TileMuIdMon ]; + ManagedAthenaTileMon.AthenaMonTools += [ TileMuIdMon ]; - ToolSvc += CfgMgr.TileL2MonTool(name = 'TileL2MuMon' + TileL2MuMon = CfgMgr.TileL2MonTool(name = 'TileL2MuMon' , OutputLevel = INFO , FillHistogramsForL1Triggers = [] , histoPathBase = "/Tile/L2Muon") - ManagedAthenaTileMon.AthenaMonTools += [ ToolSvc.TileL2MuMon ]; + ManagedAthenaTileMon.AthenaMonTools += [ TileL2MuMon ]; if (jobproperties.Beam.beamType() == 'collisions'): - ToolSvc += CfgMgr.TileJetMonTool(name = 'TileJetMonTool' + TileJetMonTool = CfgMgr.TileJetMonTool(name = 'TileJetMonTool' , OutputLevel = INFO , jetPtMin = 20000.0 , jetEtaMax = 1.6 @@ -135,31 +135,31 @@ if tileESDMon: cleaning.CutLevel = "LooseBad" cleaning.DoUgly = False ToolSvc += cleaning - ToolSvc.TileJetMonTool.do_jet_cleaning = True - ToolSvc.TileJetMonTool.useJVTTool = jvt - ToolSvc.TileJetMonTool.useJetCleaning = cleaning + TileJetMonTool.do_jet_cleaning = True + TileJetMonTool.useJVTTool = jvt + TileJetMonTool.useJetCleaning = cleaning if DQMonFlags.monManDataType == 'heavyioncollisions': if not rec.doHIP(): - ToolSvc.TileJetMonTool.jetCollectionName = 'AntiKt4HIJets' - ToolSvc.TileJetMonTool.do_event_cleaning = False - ToolSvc.TileJetMonTool.do_jet_cleaning = False + TileJetMonTool.jetCollectionName = 'AntiKt4HIJets' + TileJetMonTool.do_event_cleaning = False + TileJetMonTool.do_jet_cleaning = False - ManagedAthenaTileMon.AthenaMonTools += [ ToolSvc.TileJetMonTool ] + ManagedAthenaTileMon.AthenaMonTools += [ TileJetMonTool ] if (not 'doTileTMDBRawChannelMon' in dir() or doTileTMDBRawChannelMon) and (DQMonFlags.useTrigger() and rec.doTrigger()): from TileConditions.TileCondToolConf import getTileCondToolTMDB tileCondToolTMDB = getTileCondToolTMDB('COOL') if tileCondToolTMDB: ToolSvc += tileCondToolTMDB - ToolSvc += CfgMgr.TileTMDBRawChannelMonTool(name = 'TileTMDBRawChannelDspMon' + TileTMDBRawChannelDspMon = CfgMgr.TileTMDBRawChannelMonTool(name = 'TileTMDBRawChannelDspMon' , OutputLevel = INFO , NotDSP = False , Efficiency = True , TileRawChannelContainer = "MuRcvRawChCnt" , TileCondToolTMDB = tileCondToolTMDB , histoPathBase = "/Tile/TMDBRawChannel/Dsp") - ManagedAthenaTileMon.AthenaMonTools += [ ToolSvc.TileTMDBRawChannelDspMon ]; + ManagedAthenaTileMon.AthenaMonTools += [ TileTMDBRawChannelDspMon ]; @@ -180,21 +180,21 @@ if tileRawMon: if globalflags.InputFormat() == 'pool': TileMBTSMon.TileDigitsContainerName = 'TileDigitsFlt' - ToolSvc += TileMBTSMon; + #ToolSvc += TileMBTSMon; ManagedAthenaTileMon.AthenaMonTools += [ TileMBTSMon ] from TileRecUtils.TileRecFlags import jobproperties if jobproperties.TileRecFlags.readDigits(): if 'doTileRODMon' in dir() and doTileRODMon: - ToolSvc += CfgMgr.TileRODMonTool( name = 'TileRODMon' + TileRODMon = CfgMgr.TileRODMonTool( name = 'TileRODMon' , OutputLevel = INFO , histoPathBase = "/Tile/ROD" , FillHistogramsForL1Triggers = [] , doOnline = athenaCommonFlags.isOnline()) - ManagedAthenaTileMon.AthenaMonTools += [ ToolSvc.TileRODMon ] + ManagedAthenaTileMon.AthenaMonTools += [ TileRODMon ] - ToolSvc += CfgMgr.TileDigiNoiseMonTool(name = 'TileDigiNoiseMon' + TileDigiNoiseMon = CfgMgr.TileDigiNoiseMonTool(name = 'TileDigiNoiseMon' , OutputLevel = INFO , TileDigitsContainer = "TileDigitsCnt" , histoPathBase = "/Tile/DigiNoise" @@ -203,12 +203,12 @@ if tileRawMon: , TriggerTypes = [ 0x82 ]); if globalflags.InputFormat() == 'pool': - ToolSvc.TileDigiNoiseMon.TileDigitsContainer = 'TileDigitsFlt' + TileDigiNoiseMon.TileDigitsContainer = 'TileDigitsFlt' - ManagedAthenaTileMon.AthenaMonTools += [ ToolSvc.TileDigiNoiseMon ] + ManagedAthenaTileMon.AthenaMonTools += [ TileDigiNoiseMon ] - ToolSvc += CfgMgr.TileDQFragLWMonTool(name = 'TileDQFragMon' + TileDQFragMon = CfgMgr.TileDQFragLWMonTool(name = 'TileDQFragMon' , OutputLevel = INFO , TileRawChannelContainer = jobproperties.TileRecFlags.TileRawChannelContainer() , TileDigitsContainer = "TileDigitsCnt" @@ -222,9 +222,9 @@ if tileRawMon: if globalflags.InputFormat() == 'pool': - ToolSvc.TileDQFragMon.TileDigitsContainer = 'TileDigitsFlt' + TileDQFragMon.TileDigitsContainer = 'TileDigitsFlt' - ManagedAthenaTileMon.AthenaMonTools += [ ToolSvc.TileDQFragMon ] + ManagedAthenaTileMon.AthenaMonTools += [ TileDQFragMon ] topSequence += ManagedAthenaTileMon; print ManagedAthenaTileMon; diff --git a/TileCalorimeter/TileMonitoring/share/Tile_JetMonTool_time.py b/TileCalorimeter/TileMonitoring/share/Tile_JetMonTool_time.py index 4e491371f61541819e9dd626aff96708074001cc..af7dfe8f4c32afa18540b4c8d009195687139b38 100644 --- a/TileCalorimeter/TileMonitoring/share/Tile_JetMonTool_time.py +++ b/TileCalorimeter/TileMonitoring/share/Tile_JetMonTool_time.py @@ -254,7 +254,7 @@ TileJetMonTool = TileJetMonTool(name = 'TileJetMonTool', useJetCleaning = cleaning, jet_JVT_threshold = 0.64, OutputLevel = INFO); -ToolSvc += TileJetMonTool; +#ToolSvc += TileJetMonTool; ManagedAthenaTileMon.AthenaMonTools += [ TileJetMonTool ]; diff --git a/TileCalorimeter/TileRecUtils/share/TileCellBuilder_test.py b/TileCalorimeter/TileRecUtils/share/TileCellBuilder_test.py index ff87f189f380e573d03f9766a7fbbc5787d6d018..d2161f672f4da8c53a77b68e11c52a66712bebc2 100644 --- a/TileCalorimeter/TileRecUtils/share/TileCellBuilder_test.py +++ b/TileCalorimeter/TileRecUtils/share/TileCellBuilder_test.py @@ -708,3 +708,8 @@ def selindex (fname): idx = (ros - 3) * 64 + drawer print (iid, idx, addr(iid), lcoll, l) return + + +# Suppress useless GeoModelSvc messages. +from AthenaCommon import Constants +GeoModelSvc().OutputLevel=Constants.WARNING diff --git a/TileCalorimeter/TileRecUtils/share/TileCellBuilder_test.ref b/TileCalorimeter/TileRecUtils/share/TileCellBuilder_test.ref index b25ce1fcd01c496d5b7b44272ab5564caa42f951..0082b7046d5932427e6fd0fb17d677a7b675fce6 100644 --- a/TileCalorimeter/TileRecUtils/share/TileCellBuilder_test.ref +++ b/TileCalorimeter/TileRecUtils/share/TileCellBuilder_test.ref @@ -1,14 +1,14 @@ -Mon Oct 15 02:18:19 CEST 2018 +Wed Oct 24 20:22:11 CEST 2018 Preloading tcmalloc_minimal.so Py:Athena INFO including file "AthenaCommon/Preparation.py" -Py:Athena INFO using release [AthenaWorkDir-22.0.1] [x86_64-slc6-gcc62-dbg] [atlas-work3/db21ff19c57] -- built on [2018-10-14T1519] +Py:Athena INFO using release [AthenaWorkDir-22.0.1] [x86_64-slc6-gcc8-opt] [atlas-work3/39f42eb17c0] -- built on [2018-10-24T1603] Py:Athena INFO including file "AthenaCommon/Atlas.UnixStandardJob.py" Py:Athena INFO executing ROOT6Setup Py:Athena INFO including file "AthenaCommon/Execution.py" Py:Athena INFO including file "TileRecUtils/TileCellBuilder_test.py" [?1034hSetGeometryVersion.py obtained major release version 22 Py:Athena INFO including file "IdDictDetDescrCnv/IdDictDetDescrCnv_joboptions.py" -Py:ConfigurableDb INFO Read module info for 5368 configurables from 43 genConfDb files +Py:ConfigurableDb INFO Read module info for 5519 configurables from 51 genConfDb files Py:ConfigurableDb INFO No duplicates have been found: that's good ! EventInfoMgtInit: Got release version Athena-22.0.1 Py:IOVDbSvc.CondDB INFO Setting up conditions DB access to instance OFLP200 @@ -29,7 +29,7 @@ ApplicationMgr INFO Updating Gaudi::PluginService::SetDebug(level) to leve ApplicationMgr SUCCESS ==================================================================================================================================== Welcome to ApplicationMgr (GaudiCoreSvc v30r3) - running on lxplus040.cern.ch on Mon Oct 15 02:18:43 2018 + running on lxplus042.cern.ch on Wed Oct 24 20:24:07 2018 ==================================================================================================================================== ApplicationMgr INFO Successfully loaded modules : AthenaServices ApplicationMgr INFO Application Manager Configured successfully @@ -46,8 +46,8 @@ PoolSvc INFO io_register[PoolSvc](xmlcatalog_file:PoolFileCatalog.x PoolSvc INFO Set connectionsvc retry/timeout/IDLE timeout to 'ConnectionRetrialPeriod':300/ 'ConnectionRetrialTimeOut':3600/ 'ConnectionTimeOut':5 seconds with connection cleanup disabled PoolSvc INFO Frontier compression level set to 5 DBReplicaSvc INFO Frontier server at (serverurl=http://atlasfrontier-local.cern.ch:8000/atlr)(serverurl=http://atlasfrontier-ai.cern.ch:8000/atlr)(serverurl=http://lcgft-atlas.gridpp.rl.ac.uk:3128/frontierATLAS)(serverurl=http://ccfrontier.in2p3.fr:23128/ccin2p3-AtlasFrontier)(proxyurl=http://ca-proxy.cern.ch:3128)(proxyurl=http://ca-proxy-meyrin.cern.ch:3128)(proxyurl=http://ca-proxy-wigner.cern.ch:3128)(proxyurl=http://atlasbpfrontier.cern.ch:3127)(proxyurl=http://atlasbpfrontier.fnal.gov:3127) will be considered for COOL data -DBReplicaSvc INFO Read replica configuration from /cvmfs/atlas-nightlies.cern.ch/repo/sw/master/2018-10-11T2312/Athena/22.0.1/InstallArea/x86_64-slc6-gcc62-dbg/share/dbreplica.config -DBReplicaSvc INFO Total of 10 servers found for host lxplus040.cern.ch [ATLF ATLAS_COOLPROD atlas_dd ATLAS_CONFIG INT8R INTR ATONR_COOL ATONR_CONF DEVDB11 ATLF ] +DBReplicaSvc INFO Read replica configuration from /cvmfs/atlas-nightlies.cern.ch/repo/sw/master/2018-10-23T2341/Athena/22.0.1/InstallArea/x86_64-slc6-gcc8-opt/share/dbreplica.config +DBReplicaSvc INFO Total of 10 servers found for host lxplus042.cern.ch [ATLF ATLAS_COOLPROD atlas_dd ATLAS_CONFIG INT8R INTR ATONR_COOL ATONR_CONF DEVDB11 ATLF ] PoolSvc INFO Successfully setup replica sorting algorithm PoolSvc INFO Setting up APR FileCatalog and Streams PoolSvc WARNING Unable to locate catalog for prfile:poolcond/PoolCat_oflcond.xml check your ATLAS_POOLCOND_PATH and DATAPATH variables @@ -130,12 +130,6 @@ GeoModelSvc::RD...WARNING Getting PixTBMatComponents with default tag GeoModelSvc::RD...WARNING Getting PixTBMaterials with default tag GeoModelSvc::RD...WARNING Getting InDetMatComponents with default tag GeoModelSvc::RD...WARNING Getting InDetMaterials with default tag -GeoModelSvc.LAr... INFO Keys for LAr are ATLAS-R2-2016-01-00-01 ATLAS -GeoModelSvc.LAr... INFO Building LAr version LAr-Revised-17-01 while ATLAS version is ATLAS-R2-2016-01-00-01 -GeoModelSvc.LAr... INFO LAr Geometry Options: -GeoModelSvc.LAr... INFO Sagging = false -GeoModelSvc.LAr... INFO Barrel = ON -GeoModelSvc.LAr... INFO Endcap = ON BarrelConstruction INFO Getting primary numbers for ATLAS, ATLAS-R2-2016-01-00-01 BarrelConstruction INFO Makes detailed absorber sandwich ? 1 1 BarrelConstruction INFO Use sagging in geometry ? 0 @@ -172,8 +166,6 @@ EndcapDMConstru... INFO Start building EC electronics geometry multi-layered version of absorbers activated, mlabs == 1 ================================================ EndcapDMConstru... INFO Start building EC electronics geometry -GeoModelSvc INFO GeoModelSvc.LArDetectorToolNV SZ= 29156Kb Time = 1.36S -GeoModelSvc.Til... INFO Entering TileDetectorTool::create() TileDddbManager INFO m_tag = ATLAS-R2-2016-01-00-01 TileDddbManager INFO n_tiglob = 5 TileDddbManager INFO n_timod = 320 @@ -184,7 +176,7 @@ TileDddbManager INFO n_tileSwitches = 1 ClassIDSvc INFO getRegistryEntries: read 213 CLIDRegistry entries for module ALL CaloIDHelper_ID... INFO in createObj: creating a TileID helper object in the detector store AtlasDetectorID INFO initialize_from_dictionary - OK -TileNeighbour INFO Reading file /cvmfs/atlas-nightlies.cern.ch/repo/sw/master/2018-10-11T2312/Athena/22.0.1/InstallArea/x86_64-slc6-gcc62-dbg/share/TileNeighbour_reduced.txt +TileNeighbour INFO Reading file /cvmfs/atlas-nightlies.cern.ch/repo/sw/master/2018-10-23T2341/Athena/22.0.1/InstallArea/x86_64-slc6-gcc8-opt/share/TileNeighbour_reduced.txt TileHWIDDetDesc... INFO in createObj: creating a TileHWID helper object in the detector store TileHWID INFO initialize_from_dictionary AtlasDetectorID INFO initialize_from_dictionary - OK @@ -196,43 +188,14 @@ CaloIDHelper_ID... INFO in createObj: creating a LArHEC_ID helper object in th AtlasDetectorID INFO initialize_from_dictionary - OK CaloIDHelper_ID... INFO in createObj: creating a LArFCAL_ID helper object in the detector store AtlasDetectorID INFO initialize_from_dictionary - OK -LArFCAL_Base_ID INFO Reading file /cvmfs/atlas-nightlies.cern.ch/repo/sw/master/2018-10-11T2312/Athena/22.0.1/InstallArea/x86_64-slc6-gcc62-dbg/share/FCal2DNeighbors-April2011.txt -LArFCAL_Base_ID INFO Reading file /cvmfs/atlas-nightlies.cern.ch/repo/sw/master/2018-10-11T2312/Athena/22.0.1/InstallArea/x86_64-slc6-gcc62-dbg/share/FCal3DNeighborsNext-April2011.txt -LArFCAL_Base_ID INFO Reading file /cvmfs/atlas-nightlies.cern.ch/repo/sw/master/2018-10-11T2312/Athena/22.0.1/InstallArea/x86_64-slc6-gcc62-dbg/share/FCal3DNeighborsPrev-April2011.txt +LArFCAL_Base_ID INFO Reading file /cvmfs/atlas-nightlies.cern.ch/repo/sw/master/2018-10-23T2341/Athena/22.0.1/InstallArea/x86_64-slc6-gcc8-opt/share/FCal2DNeighbors-April2011.txt +LArFCAL_Base_ID INFO Reading file /cvmfs/atlas-nightlies.cern.ch/repo/sw/master/2018-10-23T2341/Athena/22.0.1/InstallArea/x86_64-slc6-gcc8-opt/share/FCal3DNeighborsNext-April2011.txt +LArFCAL_Base_ID INFO Reading file /cvmfs/atlas-nightlies.cern.ch/repo/sw/master/2018-10-23T2341/Athena/22.0.1/InstallArea/x86_64-slc6-gcc8-opt/share/FCal3DNeighborsPrev-April2011.txt CaloIDHelper_ID... INFO in createObj: creating a LArMiniFCAL_ID helper object in the detector store AtlasDetectorID INFO initialize_from_dictionary - OK LArMiniFCAL_ID INFO initialize_from_dict - LArCalorimeter dictionary does NOT contain miniFCAL description. Unable to initialize LArMiniFCAL_ID. AtlasDetectorID INFO initialize_from_dictionary - OK -GeoModelSvc.Til... INFO U-shape parameter from database is: 1 -GeoModelSvc.Til... INFO Glue parameter from database is: 1 -GeoModelSvc.Til... INFO Entering TileAtlasFactory::create() -GeoModelSvc.Til... INFO Tile Geometry with Saddle supports, starting from TileCal-CSC-02 xxx -GeoModelSvc.Til... INFO => New BFingerLengthPos 430.5 -GeoModelSvc.Til... INFO => New BFingerLengthNeg 420.5 -GeoModelSvc.Til... INFO Positioning barrel with translation 0 -GeoModelSvc.Til... INFO Positioning positive barrel finger with translation 3035.25 -GeoModelSvc.Til... INFO Positioning negative barrel finger with translation -3030.25 -GeoModelSvc.Til... INFO Positioning positive ext.barrel with translation 4854.75 -GeoModelSvc.Til... INFO Positioning positive ext.barrel finger with translation ztrans= 6338.5 -GeoModelSvc.Til... INFO Positioning positive ext.barrel saddle with translation ztrans= 6192.5 -GeoModelSvc.Til... INFO Positive ITC envelope parameters: PLUG1 Rmin= 3438.85 Rmax= 4250 dzITC1= 154.5 -GeoModelSvc.Til... INFO PLUG2 Rmin= 2981 Rmax= 3440 dzITC2= 47.425 -GeoModelSvc.Til... INFO Positioning positive ITC with translation 3405 -GeoModelSvc.Til... INFO Positioning positive Gap with translation 3552 -GeoModelSvc.Til... INFO Positioning positive Crack with translation 3536 -GeoModelSvc.Til... INFO Positioning negative ext.barrel with translation ztrans -4854.75 -GeoModelSvc.Til... INFO Positioning negative ext.barrel finger with translation ztrans= -6338.5 -GeoModelSvc.Til... INFO Positioning negative ext.barrel saddle with translation ztrans= -6192.5 -GeoModelSvc.Til... INFO Negative ITC envelope parameters: PLUG1 Rmin= 3438.85 Rmax= 4250 dzITC1= 154.5 -GeoModelSvc.Til... INFO PLUG2 Rmin= 2981 Rmax= 3440 dzITC2= 47.425 -GeoModelSvc.Til... INFO Positioning negative ITC with translation -3405 -GeoModelSvc.Til... INFO Positioning negative Gap with translation -3552 -GeoModelSvc.Til... INFO Positioning negative Crack with translation -3536 -GeoModelSvc.Til... INFO Global positioning of barrel with rotation (0,0,0)) and translation (0,0,0) CLHEP::cm -GeoModelSvc.Til... INFO Global positioning of positive ext.barrel with rotation (0,0,0)) and translation (0,0,0) CLHEP::cm -GeoModelSvc.Til... INFO Global positioning of negative ext.barrel with rotation (0,0,0)) and translation (0,0,1) CLHEP::cm TileDetDescrMan... INFO Entering create_elements() -GeoModelSvc INFO GeoModelSvc.TileDetectorTool SZ= 5200Kb Time = 1.54S ClassIDSvc INFO getRegistryEntries: read 65 CLIDRegistry entries for module ALL TileInfoLoader INFO Initializing....TileInfoLoader TileInfoLoader INFO New ATLAS geometry detected: ATLAS-R2-2016-01-00-01 (010001) version 10001 @@ -254,11 +217,11 @@ TileInfoLoader INFO Sampling fraction for E2 cells 1/107 TileInfoLoader INFO Sampling fraction for E3 cells 1/97 TileInfoLoader INFO Sampling fraction for E4 cells 1/75 TileInfoLoader INFO Sampling fraction for E4' cells 1/75 -TileInfoLoader INFO Reading file /afs/cern.ch/user/s/ssnyder/atlas-work3/build-x86_64-slc6-gcc62-dbg/x86_64-slc6-gcc62-dbg/share/pulsehi_physics.dat -TileInfoLoader INFO Reading file /afs/cern.ch/user/s/ssnyder/atlas-work3/build-x86_64-slc6-gcc62-dbg/x86_64-slc6-gcc62-dbg/share/pulselo_physics.dat -TileInfoLoader INFO Reading file /afs/cern.ch/user/s/ssnyder/atlas-work3/build-x86_64-slc6-gcc62-dbg/x86_64-slc6-gcc62-dbg/share/pulse_adder_tower_physics.dat -TileInfoLoader INFO Reading file /afs/cern.ch/user/s/ssnyder/atlas-work3/build-x86_64-slc6-gcc62-dbg/x86_64-slc6-gcc62-dbg/share/pulse_adder_muonRcv_physics.dat -TileInfoLoader INFO Reading file /afs/cern.ch/user/s/ssnyder/atlas-work3/build-x86_64-slc6-gcc62-dbg/x86_64-slc6-gcc62-dbg/share/pulse_adder_muon_physics.dat +TileInfoLoader INFO Reading file /cvmfs/atlas-nightlies.cern.ch/repo/sw/master/2018-10-23T2341/Athena/22.0.1/InstallArea/x86_64-slc6-gcc8-opt/share/pulsehi_physics.dat +TileInfoLoader INFO Reading file /cvmfs/atlas-nightlies.cern.ch/repo/sw/master/2018-10-23T2341/Athena/22.0.1/InstallArea/x86_64-slc6-gcc8-opt/share/pulselo_physics.dat +TileInfoLoader INFO Reading file /cvmfs/atlas-nightlies.cern.ch/repo/sw/master/2018-10-23T2341/Athena/22.0.1/InstallArea/x86_64-slc6-gcc8-opt/share/pulse_adder_tower_physics.dat +TileInfoLoader INFO Reading file /cvmfs/atlas-nightlies.cern.ch/repo/sw/master/2018-10-23T2341/Athena/22.0.1/InstallArea/x86_64-slc6-gcc8-opt/share/pulse_adder_muonRcv_physics.dat +TileInfoLoader INFO Reading file /cvmfs/atlas-nightlies.cern.ch/repo/sw/master/2018-10-23T2341/Athena/22.0.1/InstallArea/x86_64-slc6-gcc8-opt/share/pulse_adder_muon_physics.dat CaloIDHelper_ID... INFO in createObj: creating a CaloLVL1_ID helper object in the detector store CaloLVL1_ID INFO initialize_from_dictionary AtlasDetectorID INFO initialize_from_dictionary - OK @@ -267,12 +230,12 @@ TileCablingSvc INFO Cabling for RUN2 (2014-2017) ATLAS geometry is set via TileCablingSvc INFO Setting Cabling type to 4 TileInfoLoader INFO Placed TileInfo object in the detector store. ToolSvc.TileBad... INFO Creating TileCondProxyCool(ToolSvc.TileBadChanLegacyTool.TileCondProxyCool_OnlBch) for folder: "/TILE/ONL01/STATUS/ADC" -IOVSvcTool INFO Still in initialize phase, not tiggering callback for TileCondProxyCool<TileCalibDrawerBch>[0x1cf09700]+7f612f2928cc bound to CondAttrListCollection[/TILE/ONL01/STATUS/ADC] +IOVSvcTool INFO Still in initialize phase, not tiggering callback for TileCondProxyCool<TileCalibDrawerBch>[0x328c6200]+7f874013df20 bound to CondAttrListCollection[/TILE/ONL01/STATUS/ADC] ToolSvc.TileBad... INFO Creating TileCondProxyCool(ToolSvc.TileBadChanLegacyTool.TileCondProxyCool_OflBch) for folder: "/TILE/OFL02/STATUS/ADC" -IOVSvcTool INFO Still in initialize phase, not tiggering callback for TileCondProxyCool<TileCalibDrawerBch>[0x1cf08c00]+7f612f2928cc bound to CondAttrListCollection[/TILE/OFL02/STATUS/ADC] +IOVSvcTool INFO Still in initialize phase, not tiggering callback for TileCondProxyCool<TileCalibDrawerBch>[0x328c5700]+7f874013df20 bound to CondAttrListCollection[/TILE/OFL02/STATUS/ADC] ToolSvc.TileBad... INFO ProxyOnlBch and ProxyOflBch will be used for bad channel status -IOVSvcTool INFO Still in initialize phase, not tiggering callback for TileBadChanLegacyTool[0x17487000]+7f612f044042 bound to /TILE/ONL01/STATUS/ADC -IOVSvcTool INFO Still in initialize phase, not tiggering callback for TileBadChanLegacyTool[0x17487000]+7f612f044042 bound to /TILE/OFL02/STATUS/ADC +IOVSvcTool INFO Still in initialize phase, not tiggering callback for TileBadChanLegacyTool[0x2cc87000]+7f87400cc4d0 bound to /TILE/ONL01/STATUS/ADC +IOVSvcTool INFO Still in initialize phase, not tiggering callback for TileBadChanLegacyTool[0x2cc87000]+7f87400cc4d0 bound to /TILE/OFL02/STATUS/ADC AthenaEventLoopMgr INFO Initializing AthenaEventLoopMgr - package version AthenaServices-00-00-00 ClassIDSvc INFO getRegistryEntries: read 265 CLIDRegistry entries for module ALL CondInputLoader INFO Initializing CondInputLoader... @@ -318,11 +281,11 @@ TileEMScaleCond... INFO Creating TileCondProxyCool(TileEMScaleCondAlg.TileCond TileEMScaleCond... INFO Creating TileCondProxyCool(TileEMScaleCondAlg.TileCondProxyCool_OnlEms) for folder: "/TILE/OFL02/CALIB/EMS" TileSampleNoise... INFO Creating TileCondProxyCool(TileSampleNoiseCondAlg.TileCondProxyCool_NoiseSample) for folder: "/TILE/OFL02/NOISE/SAMPLE" TileTimingCondA... INFO Creating TileCondProxyCool(TileTimingCondAlg.TileCondProxyCool_AdcOffset) for folder: "/TILE/OFL02/TIME/CHANNELOFFSET/PHY" -tilecellbuilder... INFO Creating TileCondProxyFile(tilecellbuilder_bct1Cond.tilecellbuilder_bct1_onl) for ASCII file name: "/afs/cern.ch/user/s/ssnyder/atlas-work3/build-x86_64-slc6-gcc62-dbg/x86_64-slc6-gcc62-dbg/share/TileNoBad.oflBch" -tilecellbuilder... INFO Creating TileCondProxyFile(tilecellbuilder_bct1Cond.tilecellbuilder_bct1_ofl) for ASCII file name: "/afs/cern.ch/user/s/ssnyder/atlas-work3/build-x86_64-slc6-gcc62-dbg/x86_64-slc6-gcc62-dbg/share/TileNoBad.oflBch" +tilecellbuilder... INFO Creating TileCondProxyFile(tilecellbuilder_bct1Cond.tilecellbuilder_bct1_onl) for ASCII file name: "/cvmfs/atlas-nightlies.cern.ch/repo/sw/master/2018-10-23T2341/Athena/22.0.1/InstallArea/x86_64-slc6-gcc8-opt/share/TileNoBad.oflBch" +tilecellbuilder... INFO Creating TileCondProxyFile(tilecellbuilder_bct1Cond.tilecellbuilder_bct1_ofl) for ASCII file name: "/cvmfs/atlas-nightlies.cern.ch/repo/sw/master/2018-10-23T2341/Athena/22.0.1/InstallArea/x86_64-slc6-gcc8-opt/share/TileNoBad.oflBch" tilecellbuilder... INFO ProxyOnlBch and ProxyOflBch will be used for bad channel status -tilecellbuilder... INFO Creating TileCondProxyFile(tilecellbuilder_bct2Cond.tilecellbuilder_bct2_onl) for ASCII file name: "/afs/cern.ch/user/s/ssnyder/atlas-work3/build-x86_64-slc6-gcc62-dbg/x86_64-slc6-gcc62-dbg/share/TileNoBad.oflBch" -tilecellbuilder... INFO Creating TileCondProxyFile(tilecellbuilder_bct2Cond.tilecellbuilder_bct2_ofl) for ASCII file name: "/afs/cern.ch/work/s/ssnyder/builds/atlas-work3/build-x86_64-slc6-gcc62-dbg/TileCalorimeter/TileRecUtils/unitTestRun/tilecellbuilder_bct2.bch" +tilecellbuilder... INFO Creating TileCondProxyFile(tilecellbuilder_bct2Cond.tilecellbuilder_bct2_onl) for ASCII file name: "/cvmfs/atlas-nightlies.cern.ch/repo/sw/master/2018-10-23T2341/Athena/22.0.1/InstallArea/x86_64-slc6-gcc8-opt/share/TileNoBad.oflBch" +tilecellbuilder... INFO Creating TileCondProxyFile(tilecellbuilder_bct2Cond.tilecellbuilder_bct2_ofl) for ASCII file name: "/afs/cern.ch/work/s/ssnyder/builds/atlas-work3/build-x86_64-slc6-gcc8-opt/TileCalorimeter/TileRecUtils/unitTestRun/tilecellbuilder_bct2.bch" tilecellbuilder... INFO ProxyOnlBch and ProxyOflBch will be used for bad channel status ClassIDSvc INFO getRegistryEntries: read 504 CLIDRegistry entries for module ALL xAODMaker::Even... INFO Initializing - Package version: xAODEventInfoCnv-00-00-00 @@ -334,7 +297,7 @@ xAODMaker::Even... INFO Will take information from the EventInfo object ClassIDSvc INFO getRegistryEntries: read 319 CLIDRegistry entries for module ALL PyComponentMgr INFO Initializing PyComponentMgr... testalg1 INFO Initializing testalg1... -ClassIDSvc INFO getRegistryEntries: read 4399 CLIDRegistry entries for module ALL +ClassIDSvc INFO getRegistryEntries: read 4355 CLIDRegistry entries for module ALL ToolSvc.tool1 INFO Storing MBTS cells in MBTSContainer ToolSvc.TileBea... INFO in initialize() ToolSvc.tool1 INFO none of thresholds set, all RawChannels will be converted to Cells @@ -405,7 +368,7 @@ ToolSvc.tool11 INFO Storing E4' cells in E4prContainer ToolSvc.tool11 INFO TileCellBuilder initialization completed HistogramPersis...WARNING Histograms saving not required. ApplicationMgr INFO Application Manager Initialized successfully -ClassIDSvc INFO getRegistryEntries: read 281 CLIDRegistry entries for module ALL +ClassIDSvc INFO getRegistryEntries: read 276 CLIDRegistry entries for module ALL CondInputLoader INFO created CondCont<CondAttrListCollection> with key 'ConditionStore+/TILE/OFL02/CALIB/CES' CondInputLoader INFO created CondCont<CondAttrListCollection> with key 'ConditionStore+/TILE/OFL02/CALIB/CIS/FIT/LIN' CondInputLoader INFO created CondCont<CondAttrListCollection> with key 'ConditionStore+/TILE/OFL02/CALIB/CIS/FIT/NLN' @@ -461,12 +424,12 @@ CaloIDHelper_ID... INFO in createObj: creating a LArHEC_SuperCell_ID helper ob AtlasDetectorID INFO initialize_from_dictionary - OK CaloIDHelper_ID... INFO in createObj: creating a LArFCAL_SuperCell_ID helper object in the detector store AtlasDetectorID INFO initialize_from_dictionary - OK -LArFCAL_Base_ID INFO Reading file /cvmfs/atlas-nightlies.cern.ch/repo/sw/master/2018-10-11T2312/Athena/22.0.1/InstallArea/x86_64-slc6-gcc62-dbg/share/FCalSuperCells2DNeighborsNew-April2014.txt -LArFCAL_Base_ID INFO Reading file /cvmfs/atlas-nightlies.cern.ch/repo/sw/master/2018-10-11T2312/Athena/22.0.1/InstallArea/x86_64-slc6-gcc62-dbg/share/FCalSuperCells3DNeighborsNextNew-April2014.txt -LArFCAL_Base_ID INFO Reading file /cvmfs/atlas-nightlies.cern.ch/repo/sw/master/2018-10-11T2312/Athena/22.0.1/InstallArea/x86_64-slc6-gcc62-dbg/share/FCalSuperCells3DNeighborsPrevNew-April2014.txt +LArFCAL_Base_ID INFO Reading file /cvmfs/atlas-nightlies.cern.ch/repo/sw/master/2018-10-23T2341/Athena/22.0.1/InstallArea/x86_64-slc6-gcc8-opt/share/FCalSuperCells2DNeighborsNew-April2014.txt +LArFCAL_Base_ID INFO Reading file /cvmfs/atlas-nightlies.cern.ch/repo/sw/master/2018-10-23T2341/Athena/22.0.1/InstallArea/x86_64-slc6-gcc8-opt/share/FCalSuperCells3DNeighborsNextNew-April2014.txt +LArFCAL_Base_ID INFO Reading file /cvmfs/atlas-nightlies.cern.ch/repo/sw/master/2018-10-23T2341/Athena/22.0.1/InstallArea/x86_64-slc6-gcc8-opt/share/FCalSuperCells3DNeighborsPrevNew-April2014.txt CaloIDHelper_ID... INFO in createObj: creating a Tile_SuperCell_ID helper object in the detector store AtlasDetectorID INFO initialize_from_dictionary - OK -TileNeighbour INFO Reading file /cvmfs/atlas-nightlies.cern.ch/repo/sw/master/2018-10-11T2312/Athena/22.0.1/InstallArea/x86_64-slc6-gcc62-dbg/share/TileSuperCellNeighbour.txt +TileNeighbour INFO Reading file /cvmfs/atlas-nightlies.cern.ch/repo/sw/master/2018-10-23T2341/Athena/22.0.1/InstallArea/x86_64-slc6-gcc8-opt/share/TileSuperCellNeighbour.txt AtlasDetectorID INFO initialize_from_dictionary - OK CaloIdMgrDetDes... INFO Finished CaloIdMgrDetDes... INFO Initializing CaloIdMgr from values in CaloIdMgrDetDescrCnv @@ -480,7 +443,7 @@ ToolSvc.TileBad... INFO No TileBchStatus::isNoGainL1() definition found in DB, ToolSvc.TileBad... INFO No TileBchStatus::isBadTiming() definition found in DB, using defaults ToolSvc.TileBad... INFO TileBchStatus::isBad() is defined by: ADC masked (unspecified); ADC dead; Very large HF noise; No data; Wrong DSP configuration; Severe stuck bit; Severe data corruption; Channel masked (unspecified); No PMT connected; No HV; Wrong HV; ToolSvc.TileBad... INFO TileBchStatus::isNoisy() is defined by: Large HF noise; Correlated noise; Large LF noise; -ToolSvc.TileBad... INFO TileBchStatus::isNoGainL1() is defined by: ADC dead; No PMT connected; No HV; Channel masked for LV1 (unspecified); LV1 channel no gain; LV1 channel noisy; <no description available>; +ToolSvc.TileBad... INFO TileBchStatus::isNoGainL1() is defined by: ADC dead; No PMT connected; No HV; Channel masked for LV1 (unspecified); LV1 channel no gain; LV1 channel noisy; Channel disabled for LV1; ToolSvc.TileBad... INFO TileBchStatus::isBadTiming() is defined by: Bad timing; Online bad timing; ToolSvc.TileBad... INFO No drawer trips probabilities found in DB xAODMaker::Even...WARNING Algorithm::BeginRun is deprecated. Use Start instead @@ -491,29 +454,29 @@ TileBadChannels... INFO No TileBchStatus::isNoGainL1() definition found in DB, TileBadChannels... INFO No TileBchStatus::isBadTiming() definition found in DB, using defaults TileBadChannels... INFO TileBchStatus::isBad() is defined by: ADC masked (unspecified); ADC dead; Very large HF noise; No data; Wrong DSP configuration; Severe stuck bit; Severe data corruption; Channel masked (unspecified); No PMT connected; No HV; Wrong HV; TileBadChannels... INFO TileBchStatus::isNoisy() is defined by: Large HF noise; Correlated noise; Large LF noise; -TileBadChannels... INFO TileBchStatus::isNoGainL1() is defined by: ADC dead; No PMT connected; No HV; Channel masked for LV1 (unspecified); LV1 channel no gain; LV1 channel noisy; <no description available>; +TileBadChannels... INFO TileBchStatus::isNoGainL1() is defined by: ADC dead; No PMT connected; No HV; Channel masked for LV1 (unspecified); LV1 channel no gain; LV1 channel noisy; Channel disabled for LV1; TileBadChannels... INFO TileBchStatus::isBadTiming() is defined by: Bad timing; Online bad timing; TileBadChannels... INFO No drawer trips probabilities found in DB -tilecellbuilder... INFO Creating TileCondProxyFile(tilecellbuilder_bct1Cond.tilecellbuilder_bct1_onl) for ASCII file name: "/afs/cern.ch/user/s/ssnyder/atlas-work3/build-x86_64-slc6-gcc62-dbg/x86_64-slc6-gcc62-dbg/share/TileNoBad.oflBch" -tilecellbuilder... INFO Creating TileCondProxyFile(tilecellbuilder_bct1Cond.tilecellbuilder_bct1_ofl) for ASCII file name: "/afs/cern.ch/user/s/ssnyder/atlas-work3/build-x86_64-slc6-gcc62-dbg/x86_64-slc6-gcc62-dbg/share/TileNoBad.oflBch" +tilecellbuilder... INFO Creating TileCondProxyFile(tilecellbuilder_bct1Cond.tilecellbuilder_bct1_onl) for ASCII file name: "/cvmfs/atlas-nightlies.cern.ch/repo/sw/master/2018-10-23T2341/Athena/22.0.1/InstallArea/x86_64-slc6-gcc8-opt/share/TileNoBad.oflBch" +tilecellbuilder... INFO Creating TileCondProxyFile(tilecellbuilder_bct1Cond.tilecellbuilder_bct1_ofl) for ASCII file name: "/cvmfs/atlas-nightlies.cern.ch/repo/sw/master/2018-10-23T2341/Athena/22.0.1/InstallArea/x86_64-slc6-gcc8-opt/share/TileNoBad.oflBch" tilecellbuilder... INFO No TileBchStatus::isBad() definition found in DB, using defaults tilecellbuilder... INFO No TileBchStatus::isNoisy() definition found in DB, using defaults tilecellbuilder... INFO No TileBchStatus::isNoGainL1() definition found in DB, using defaults tilecellbuilder... INFO No TileBchStatus::isBadTiming() definition found in DB, using defaults tilecellbuilder... INFO TileBchStatus::isBad() is defined by: ADC masked (unspecified); ADC dead; Very large HF noise; No data; Wrong DSP configuration; Severe stuck bit; Severe data corruption; Channel masked (unspecified); No PMT connected; No HV; Wrong HV; Online ADC masked (unspecified); tilecellbuilder... INFO TileBchStatus::isNoisy() is defined by: Large HF noise; Correlated noise; Large LF noise; -tilecellbuilder... INFO TileBchStatus::isNoGainL1() is defined by: ADC dead; No PMT connected; No HV; Channel masked for LV1 (unspecified); LV1 channel no gain; LV1 channel noisy; <no description available>; +tilecellbuilder... INFO TileBchStatus::isNoGainL1() is defined by: ADC dead; No PMT connected; No HV; Channel masked for LV1 (unspecified); LV1 channel no gain; LV1 channel noisy; Channel disabled for LV1; tilecellbuilder... INFO TileBchStatus::isBadTiming() is defined by: Bad timing; Online bad timing; tilecellbuilder... INFO No drawer trips probabilities found in DB -tilecellbuilder... INFO Creating TileCondProxyFile(tilecellbuilder_bct2Cond.tilecellbuilder_bct2_onl) for ASCII file name: "/afs/cern.ch/user/s/ssnyder/atlas-work3/build-x86_64-slc6-gcc62-dbg/x86_64-slc6-gcc62-dbg/share/TileNoBad.oflBch" -tilecellbuilder... INFO Creating TileCondProxyFile(tilecellbuilder_bct2Cond.tilecellbuilder_bct2_ofl) for ASCII file name: "/afs/cern.ch/work/s/ssnyder/builds/atlas-work3/build-x86_64-slc6-gcc62-dbg/TileCalorimeter/TileRecUtils/unitTestRun/tilecellbuilder_bct2.bch" +tilecellbuilder... INFO Creating TileCondProxyFile(tilecellbuilder_bct2Cond.tilecellbuilder_bct2_onl) for ASCII file name: "/cvmfs/atlas-nightlies.cern.ch/repo/sw/master/2018-10-23T2341/Athena/22.0.1/InstallArea/x86_64-slc6-gcc8-opt/share/TileNoBad.oflBch" +tilecellbuilder... INFO Creating TileCondProxyFile(tilecellbuilder_bct2Cond.tilecellbuilder_bct2_ofl) for ASCII file name: "/afs/cern.ch/work/s/ssnyder/builds/atlas-work3/build-x86_64-slc6-gcc8-opt/TileCalorimeter/TileRecUtils/unitTestRun/tilecellbuilder_bct2.bch" tilecellbuilder... INFO No TileBchStatus::isBad() definition found in DB, using defaults tilecellbuilder... INFO No TileBchStatus::isNoisy() definition found in DB, using defaults tilecellbuilder... INFO No TileBchStatus::isNoGainL1() definition found in DB, using defaults tilecellbuilder... INFO No TileBchStatus::isBadTiming() definition found in DB, using defaults tilecellbuilder... INFO TileBchStatus::isBad() is defined by: ADC masked (unspecified); ADC dead; Very large HF noise; No data; Wrong DSP configuration; Severe stuck bit; Severe data corruption; Channel masked (unspecified); No PMT connected; No HV; Wrong HV; Online ADC masked (unspecified); tilecellbuilder... INFO TileBchStatus::isNoisy() is defined by: Large HF noise; Correlated noise; Large LF noise; -tilecellbuilder... INFO TileBchStatus::isNoGainL1() is defined by: ADC dead; No PMT connected; No HV; Channel masked for LV1 (unspecified); LV1 channel no gain; LV1 channel noisy; <no description available>; +tilecellbuilder... INFO TileBchStatus::isNoGainL1() is defined by: ADC dead; No PMT connected; No HV; Channel masked for LV1 (unspecified); LV1 channel no gain; LV1 channel noisy; Channel disabled for LV1; tilecellbuilder... INFO TileBchStatus::isBadTiming() is defined by: Bad timing; Online bad timing; tilecellbuilder... INFO No drawer trips probabilities found in DB ClassIDSvc INFO getRegistryEntries: read 650 CLIDRegistry entries for module ALL @@ -570,23 +533,23 @@ testalg1 INFO Finalizing testalg1... IncidentProcAlg2 INFO Finalize PyComponentMgr INFO Finalizing PyComponentMgr... IdDictDetDescrCnv INFO in finalize -IOVDbSvc INFO Folder /LAR/Align (PoolRef) db-read 1/1 objs/chan/bytes 1/1/170 (( 1.05 ))s -IOVDbSvc INFO Folder /TILE/OFL02/CALIB/CES (AttrListColl) db-read 1/1 objs/chan/bytes 277/277/103344 (( 0.89 ))s -IOVDbSvc INFO Folder /TILE/OFL02/CALIB/CIS/FIT/LIN (AttrListColl) db-read 1/1 objs/chan/bytes 277/277/80 (( 0.94 ))s -IOVDbSvc INFO Folder /TILE/OFL02/CALIB/CIS/FIT/NLN (AttrListColl) db-read 1/1 objs/chan/bytes 277/277/80 (( 0.76 ))s -IOVDbSvc INFO Folder /TILE/OFL02/CALIB/EMS (AttrListColl) db-read 1/1 objs/chan/bytes 277/277/92 (( 0.68 ))s -IOVDbSvc INFO Folder /TILE/OFL02/CALIB/LAS/FIBER (AttrListColl) db-read 1/1 objs/chan/bytes 277/277/940 (( 1.93 ))s -IOVDbSvc INFO Folder /TILE/OFL02/CALIB/LAS/LIN (AttrListColl) db-read 1/1 objs/chan/bytes 277/277/72 (( 0.69 ))s -IOVDbSvc INFO Folder /TILE/OFL02/CALIB/LAS/NLN (AttrListColl) db-read 1/1 objs/chan/bytes 277/277/76 (( 0.68 ))s -IOVDbSvc INFO Folder /TILE/OFL02/NOISE/SAMPLE (AttrListColl) db-read 1/1 objs/chan/bytes 277/277/641476 (( 0.99 ))s -IOVDbSvc INFO Folder /TILE/OFL02/STATUS/ADC (AttrListColl) db-read 1/2 objs/chan/bytes 277/277/97884 (( 0.88 ))s -IOVDbSvc INFO Folder /TILE/OFL02/TIME/CHANNELOFFSET/PHY (AttrListColl) db-read 1/1 objs/chan/bytes 277/277/96 (( 0.96 ))s -IOVDbSvc INFO Folder /TILE/ONL01/STATUS/ADC (AttrListColl) db-read 1/2 objs/chan/bytes 277/277/76 (( 0.06 ))s -IOVDbSvc INFO Folder /LAR/LArCellPositionShift (PoolRef) db-read 1/1 objs/chan/bytes 1/1/195 (( 0.60 ))s -IOVDbSvc INFO Total payload read from COOL: 844581 bytes in (( 11.12 ))s +IOVDbSvc INFO Folder /LAR/Align (PoolRef) db-read 1/1 objs/chan/bytes 1/1/170 (( 1.00 ))s +IOVDbSvc INFO Folder /TILE/OFL02/CALIB/CES (AttrListColl) db-read 1/1 objs/chan/bytes 277/277/103344 (( 2.60 ))s +IOVDbSvc INFO Folder /TILE/OFL02/CALIB/CIS/FIT/LIN (AttrListColl) db-read 1/1 objs/chan/bytes 277/277/80 (( 1.91 ))s +IOVDbSvc INFO Folder /TILE/OFL02/CALIB/CIS/FIT/NLN (AttrListColl) db-read 1/1 objs/chan/bytes 277/277/80 (( 1.02 ))s +IOVDbSvc INFO Folder /TILE/OFL02/CALIB/EMS (AttrListColl) db-read 1/1 objs/chan/bytes 277/277/92 (( 0.59 ))s +IOVDbSvc INFO Folder /TILE/OFL02/CALIB/LAS/FIBER (AttrListColl) db-read 1/1 objs/chan/bytes 277/277/940 (( 0.69 ))s +IOVDbSvc INFO Folder /TILE/OFL02/CALIB/LAS/LIN (AttrListColl) db-read 1/1 objs/chan/bytes 277/277/72 (( 0.61 ))s +IOVDbSvc INFO Folder /TILE/OFL02/CALIB/LAS/NLN (AttrListColl) db-read 1/1 objs/chan/bytes 277/277/76 (( 4.11 ))s +IOVDbSvc INFO Folder /TILE/OFL02/NOISE/SAMPLE (AttrListColl) db-read 1/1 objs/chan/bytes 277/277/641476 (( 1.84 ))s +IOVDbSvc INFO Folder /TILE/OFL02/STATUS/ADC (AttrListColl) db-read 1/2 objs/chan/bytes 277/277/97884 (( 0.08 ))s +IOVDbSvc INFO Folder /TILE/OFL02/TIME/CHANNELOFFSET/PHY (AttrListColl) db-read 1/1 objs/chan/bytes 277/277/96 (( 0.06 ))s +IOVDbSvc INFO Folder /TILE/ONL01/STATUS/ADC (AttrListColl) db-read 1/2 objs/chan/bytes 277/277/76 (( 0.01 ))s +IOVDbSvc INFO Folder /LAR/LArCellPositionShift (PoolRef) db-read 1/1 objs/chan/bytes 1/1/195 (( 7.62 ))s +IOVDbSvc INFO Total payload read from COOL: 844581 bytes in (( 22.14 ))s IOVDbSvc INFO Connection sqlite://;schema=mycool.db;dbname=OFLP200 : nConnect: 0 nFolders: 0 ReadTime: (( 0.00 ))s -IOVDbSvc INFO Connection COOLOFL_LAR/OFLP200 : nConnect: 2 nFolders: 2 ReadTime: (( 1.65 ))s -IOVDbSvc INFO Connection COOLOFL_TILE/OFLP200 : nConnect: 2 nFolders: 11 ReadTime: (( 9.47 ))s +IOVDbSvc INFO Connection COOLOFL_LAR/OFLP200 : nConnect: 2 nFolders: 2 ReadTime: (( 8.62 ))s +IOVDbSvc INFO Connection COOLOFL_TILE/OFLP200 : nConnect: 2 nFolders: 11 ReadTime: (( 13.52 ))s TileInfoLoader INFO TileInfoLoader::finalize() AthDictLoaderSvc INFO in finalize... ToolSvc INFO Removing all tools created by ToolSvc @@ -605,9 +568,9 @@ ToolSvc.TileBea... INFO Finalizing *****Chrono***** INFO **************************************************************************************************** *****Chrono***** INFO The Final CPU consumption ( Chrono ) Table (ordered) *****Chrono***** INFO **************************************************************************************************** -cObjR_ALL INFO Time User : Tot= 1.11 [s] Ave/Min/Max=0.555(+-0.535)/ 0.02/ 1.09 [s] #= 2 -cObj_ALL INFO Time User : Tot= 1.29 [s] Ave/Min/Max=0.086(+-0.289)/ 0/ 1.16 [s] #= 15 -ChronoStatSvc INFO Time User : Tot= 116 [s] #= 1 +cObjR_ALL INFO Time User : Tot= 450 [ms] Ave/Min/Max= 225(+- 225)/ 0/ 450 [ms] #= 2 +cObj_ALL INFO Time User : Tot= 0.56 [s] Ave/Min/Max=0.0373(+-0.122)/ 0/ 0.49 [s] #= 15 +ChronoStatSvc INFO Time User : Tot= 38 [s] #= 1 *****Chrono***** INFO **************************************************************************************************** ChronoStatSvc.f... INFO Service finalized successfully ApplicationMgr INFO Application Manager Finalized successfully diff --git a/TileCalorimeter/TileRecUtils/src/TileRawChannelBuilderOpt2Filter.cxx b/TileCalorimeter/TileRecUtils/src/TileRawChannelBuilderOpt2Filter.cxx index 4145879102f6a90b7a4cd359fc0a5b59ffea0d71..a744b4e89528643d3e5f384c6c21b6ad52309fd0 100644 --- a/TileCalorimeter/TileRecUtils/src/TileRawChannelBuilderOpt2Filter.cxx +++ b/TileCalorimeter/TileRecUtils/src/TileRawChannelBuilderOpt2Filter.cxx @@ -65,8 +65,6 @@ TileRawChannelBuilderOpt2Filter::TileRawChannelBuilderOpt2Filter(const std::stri , m_nConst(0) , m_nSamples(0) , m_t0SamplePosition(0) - , m_maxTime(0.0) - , m_minTime(0.0) { //declare interfaces declareInterface< TileRawChannelBuilder >( this ); @@ -90,6 +88,8 @@ TileRawChannelBuilderOpt2Filter::TileRawChannelBuilderOpt2Filter(const std::stri declareProperty("EmulateDSP",m_emulateDsp = false); declareProperty("NoiseThresholdHG",m_noiseThresholdHG = 5); declareProperty("NoiseThresholdLG",m_noiseThresholdLG = 3); + declareProperty("MinTime",m_minTime = 0.0); + declareProperty("MaxTime",m_maxTime = -1.0); } @@ -124,10 +124,15 @@ StatusCode TileRawChannelBuilderOpt2Filter::initialize() { << " TimeCorrection=" << m_correctTimeNI << " Best Phase " << m_bestPhase ); + ATH_MSG_DEBUG( " NoiseThresholdHG=" << m_noiseThresholdHG + << " NoiseThresholdLG=" << m_noiseThresholdLG); + m_nSamples = m_tileInfo->NdigitSamples(); m_t0SamplePosition = m_tileInfo->ItrigSample(); - m_maxTime = 25 * (m_nSamples - m_t0SamplePosition - 1); - m_minTime = -25 * m_t0SamplePosition; + if (m_maxTime < m_minTime) { // set time window if it was not set from jobOptions + m_maxTime = 25 * (m_nSamples - m_t0SamplePosition - 1); + m_minTime = -25 * m_t0SamplePosition; + } ATH_MSG_DEBUG(" NSamples=" << m_nSamples << " T0Sample=" << m_t0SamplePosition << " minTime=" << m_minTime @@ -455,11 +460,37 @@ double TileRawChannelBuilderOpt2Filter::filter(int ros, int drawer, int channel << m_digits[0] - minDigit << endmsg; } - // OptFilterTime=-100.; + if (m_bestPhase) { + unsigned int drawerIdx = TileCalibUtils::getDrawerIdx(ros, drawer); + // AS 19.11.09 - note minus sign here - time in DB is opposite to best phase + phase = -m_tileToolTiming->getSignalPhase(drawerIdx, channel, gain); + ATH_MSG_VERBOSE( "Best phase: " << phase + << " drawerIdx " << drawerIdx + << " channel " << channel ); + } + chi2 = compute(ros, drawer, channel, gain, pedestal, amplitude, time, phase); - time = 0.; + // If weights for tau=0 are used, deviations are seen in the amplitude => + // function to correct the amplitude + if (m_correctAmplitude + && amplitude > m_ampMinThresh + && time > m_timeMinThresh + && time < m_timeMaxThresh) { + + amplitude *= correctAmp(time, m_of2); + ATH_MSG_VERBOSE( "Amplitude corrected by " << correctAmp(time, m_of2) + << " new amplitude is " << amplitude ); + } + + if (m_bestPhase) { + time = -phase; + chi2 = -chi2; + } else { + time = 0.; + } + m_nCenter++; } diff --git a/TileCalorimeter/TileSimAlgs/src/TileDigitsMaker.cxx b/TileCalorimeter/TileSimAlgs/src/TileDigitsMaker.cxx index 7cc220c786ade12b44173c00b93801b136106767..f303d9a89e0796f6e9cd2d2e7542410ff63eb770 100644 --- a/TileCalorimeter/TileSimAlgs/src/TileDigitsMaker.cxx +++ b/TileCalorimeter/TileSimAlgs/src/TileDigitsMaker.cxx @@ -314,18 +314,6 @@ StatusCode TileDigitsMaker::initialize() { for (int ch = 0; ch < nchMax; ++ch) { adc_ids[ch] = m_tileHWID->adc_id(drawer_id, ch, TileID::HIGHGAIN); - if (msgLvl(MSG::VERBOSE) && m_cabling->getTestBeam() - && m_cabling->connected(ros, drawer) && !m_rndmEvtOverlay) { - double pedSimHi = m_tileInfo->DigitsPedLevel(TileID::HIGHGAIN, ch, idhash); - double pedSimLo = m_tileInfo->DigitsPedLevel(TileID::LOWGAIN, ch, idhash); - double sigmaNoiseHi = m_tileInfo->DigitsPedSigma(TileID::HIGHGAIN, ch, idhash); - double sigmaNoiseLo = m_tileInfo->DigitsPedSigma(TileID::LOWGAIN, ch, idhash); - msg(MSG::VERBOSE) << "Ch " << m_tileHWID->to_string(drawer_id, -2) << "/" << ch - << " pedHi=" << pedSimHi - << " pedLo=" << pedSimLo - << " rmsHi=" << sigmaNoiseHi - << " rmsLo=" << sigmaNoiseLo << endmsg; - } } } m_all_ids.push_back(adc_ids); @@ -370,7 +358,7 @@ StatusCode TileDigitsMaker::initialize() { StatusCode TileDigitsMaker::execute() { ATH_MSG_DEBUG( "Executing TileDigitsMaker"); - static bool first = (msgLvl(MSG::VERBOSE) && !m_rndmEvtOverlay && !m_cabling->getTestBeam()); + static bool first = (msgLvl(MSG::VERBOSE) && !m_rndmEvtOverlay ); if (first) { ATH_MSG_VERBOSE( "Dumping 2G noise parameters"); first = false; diff --git a/TileCalorimeter/TileSvc/TileByteStream/TileByteStream/TileMuRcvContByteStreamCnv.h b/TileCalorimeter/TileSvc/TileByteStream/TileByteStream/TileMuRcvContByteStreamCnv.h index 090c2eae596901c79437b8bee82ab1a1fd5682bb..63f2274d85f42915939353b491e2aecc561ad1f0 100644 --- a/TileCalorimeter/TileSvc/TileByteStream/TileByteStream/TileMuRcvContByteStreamCnv.h +++ b/TileCalorimeter/TileSvc/TileByteStream/TileByteStream/TileMuRcvContByteStreamCnv.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration */ #ifndef TILEBYTESTREAM_TILEMURCVCONTBYTESTREAMCNV_H @@ -7,7 +7,6 @@ // Gaudi includes #include "GaudiKernel/Converter.h" -#include "GaudiKernel/IIncidentListener.h" #include "GaudiKernel/ToolHandle.h" #include "GaudiKernel/ServiceHandle.h" @@ -42,7 +41,6 @@ extern long ByteStream_StorageType; class TileMuRcvContByteStreamCnv : public Converter - , public IIncidentListener , public ::AthMessaging { public: @@ -55,9 +53,6 @@ class TileMuRcvContByteStreamCnv virtual StatusCode createRep(DataObject* pObj, IOpaqueAddress*& pAddr); virtual StatusCode finalize(); - /// Incident listener - virtual void handle( const Incident& incident ); - /// Storage type and class ID virtual long repSvcType() const { return ByteStream_StorageType; } static long storageType() { return ByteStream_StorageType; } @@ -81,10 +76,6 @@ class TileMuRcvContByteStreamCnv /** Pointer to TileROD_Decoder */ ToolHandle<TileROD_Decoder> m_decoder; - - /** Pointer to TileMuRcvContainer */ - TileMuonReceiverContainer* m_container; - }; #endif diff --git a/TileCalorimeter/TileSvc/TileByteStream/src/TileMuRcvContByteStreamCnv.cxx b/TileCalorimeter/TileSvc/TileByteStream/src/TileMuRcvContByteStreamCnv.cxx index b3a8c5ad0e31187c40dede3c2a7522545cd357be..200ac920b741c07a4c9fda7140ca2ff1ffc78371 100644 --- a/TileCalorimeter/TileSvc/TileByteStream/src/TileMuRcvContByteStreamCnv.cxx +++ b/TileCalorimeter/TileSvc/TileByteStream/src/TileMuRcvContByteStreamCnv.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration */ // Gaudi includes @@ -7,7 +7,6 @@ #include "GaudiKernel/StatusCode.h" #include "GaudiKernel/DataObject.h" #include "GaudiKernel/IRegistry.h" -#include "GaudiKernel/IIncidentSvc.h" #include "GaudiKernel/IToolSvc.h" // Athena includes @@ -42,7 +41,6 @@ TileMuRcvContByteStreamCnv::TileMuRcvContByteStreamCnv(ISvcLocator* svcloc) , m_storeGate("StoreGateSvc", m_name) , m_robSvc("ROBDataProviderSvc", m_name) , m_decoder("TileROD_Decoder") - , m_container(0) { } @@ -67,26 +65,6 @@ StatusCode TileMuRcvContByteStreamCnv::initialize() CHECK( m_robSvc.retrieve() ); - // per event there is only one object per EB module 128 - // - int cntsize = 128; - m_container = new TileMuonReceiverContainer(); - m_container->reserve(cntsize); - - for( int i=0; i<cntsize; i++) { - int objId = m_decoder->hashFunc()->identifier(i); - TileMuonReceiverObj *muRcv = new TileMuonReceiverObj(objId); - m_container->push_back(muRcv); - } - - // Register incident handler - ServiceHandle<IIncidentSvc> incSvc("IncidentSvc", m_name); - if ( !incSvc.retrieve().isSuccess() ) { - ATH_MSG_WARNING( "Unable to retrieve the IncidentSvc" ); - } else { - incSvc->addListener(this, "StoreCleared"); - } - CHECK( m_storeGate.retrieve() ); return StatusCode::SUCCESS ; @@ -111,15 +89,13 @@ StatusCode TileMuRcvContByteStreamCnv::createObj(IOpaqueAddress* pAddr, DataObje return StatusCode::FAILURE; } - StatusCode sc=m_decoder->convertTMDBDecision(re,m_container); + auto cont = std::make_unique<TileMuonReceiverContainer>(); + StatusCode sc=m_decoder->convertTMDBDecision(re,cont.get()); if (sc!=StatusCode::SUCCESS) { ATH_MSG_WARNING( "Conversion tool returned an error. TileMuonReceiverContainer might be empty." ); } - // new container will not own elements, i.e. TileMuonReceiverContainer will not be deleted - TileMuonReceiverContainer * new_container = new TileMuonReceiverContainer(*m_container); - - pObj = SG::asStorable( new_container ); + pObj = SG::asStorable( std::move(cont) ); return StatusCode::SUCCESS; } @@ -156,25 +132,6 @@ StatusCode TileMuRcvContByteStreamCnv::createRep(DataObject* pObj, IOpaqueAddres StatusCode TileMuRcvContByteStreamCnv::finalize() { - ATH_MSG_DEBUG( " Clearing TileMuonReceiverContainer Container " ); - - m_container->clear(); - - delete m_container; - return Converter::finalize(); } -void TileMuRcvContByteStreamCnv::handle(const Incident& incident) -{ - if (incident.type() == "StoreCleared") { - if (const StoreClearedIncident* inc = dynamic_cast<const StoreClearedIncident*> (&incident)) { - if (inc->store() == &*m_storeGate) { - for (const TileMuonReceiverObj* tileMuObj : *m_container) { - const_cast<TileMuonReceiverObj*>(tileMuObj)->clear(); - } - } - } - } - return; -} diff --git a/TileCalorimeter/TileSvc/TileByteStream/src/TileROD_Decoder.cxx b/TileCalorimeter/TileSvc/TileByteStream/src/TileROD_Decoder.cxx index 3be3b4693d2f7e16ffe85a998713099c8867e718..c2d27ed6cb9ca7c244aa8b0c6de6f6022cdb0d29 100644 --- a/TileCalorimeter/TileSvc/TileByteStream/src/TileROD_Decoder.cxx +++ b/TileCalorimeter/TileSvc/TileByteStream/src/TileROD_Decoder.cxx @@ -2906,7 +2906,12 @@ void TileROD_Decoder::fillCollectionL2(const ROBData * rob, TileL2Container & v) if ((m_WarningCounter++) < m_maxWarningPrint) ATH_MSG_WARNING("fillCollectionL2( corrupted frag separator 0x" << MSG::hex << (*p) << " instead of 0xff1234ff in ROB 0x" << rob->rod_source_id() << MSG::dec ); } - if (V3format) ++p; // skip frag marker + if (V3format) { + ++p; // skip frag marker + m_sizeOverhead = 3; + } else { + m_sizeOverhead = 2; + } } while (wc < size) { // iterator over all words in a ROD diff --git a/Tools/ART/ARTEnvironmentConfig.cmake b/Tools/ART/ARTEnvironmentConfig.cmake index f448229bf52346b68723efa0c324e5cf4280a0f0..457867b441612777b0055049c93619baddecabaa 100644 --- a/Tools/ART/ARTEnvironmentConfig.cmake +++ b/Tools/ART/ARTEnvironmentConfig.cmake @@ -6,7 +6,7 @@ # Set the environment variable(s): set( ARTENVIRONMENT_ENVIRONMENT - APPEND DATAPATH "/eos/atlas/atlascerngroupdisk/data-art/grid-input" ) + APPEND DATAPATH "/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art" ) # Silently declare the module found: set( ARTENVIRONMENT_FOUND TRUE ) diff --git a/Tools/ART/scripts/art.py b/Tools/ART/scripts/art.py index b364ee9af2123586875d2626059bca0f6d838d25..f717c812ef75df01fffcc3c83b34e77e0d5b84f7 100755 --- a/Tools/ART/scripts/art.py +++ b/Tools/ART/scripts/art.py @@ -78,7 +78,7 @@ Tests are called with: """ __author__ = "Tulay Cuhadar Donszelmann <tcuhadar@cern.ch>" -__version__ = '0.10.21' +__version__ = '0.10.22' import logging import os diff --git a/Tools/PyUtils/python/RootUtils.py b/Tools/PyUtils/python/RootUtils.py index 5fd94480d283249bb9342af48a9a93f7ad790ce4..322488b2736913e6b992d18097c20e13bdc67451 100644 --- a/Tools/PyUtils/python/RootUtils.py +++ b/Tools/PyUtils/python/RootUtils.py @@ -194,7 +194,10 @@ def _getLeaf (l): if tname in ['Float_t', 'Double_t']: return [l.GetValue(i) for i in range(ndat)] if tname in ['Char_t']: - return l.GetValueString() + try: + return l.GetValueString() # TLeafC for variable size string + except: + return [l.GetValue(i) for i in range(ndat)] # TLeafB for 8-bit integers return None class RootFileDumper(object): diff --git a/Tracking/Acts/ActsGeometry/ActsGeometry/ATLASMagneticFieldWrapper.h b/Tracking/Acts/ActsGeometry/ActsGeometry/ATLASMagneticFieldWrapper.h new file mode 100644 index 0000000000000000000000000000000000000000..1725a3b8508c8d4cfbcda1136b3660ac683d953c --- /dev/null +++ b/Tracking/Acts/ActsGeometry/ActsGeometry/ATLASMagneticFieldWrapper.h @@ -0,0 +1,122 @@ +/* + Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration +*/ + +#ifndef ACTSGEOMETRY_ATLASMAGNETICFIELDWRAPPER_H +#define ACTSGEOMETRY_ATLASMAGNETICFIELDWRAPPER_H + +#include "MagFieldInterfaces/IMagFieldSvc.h" +#include "Acts/Utilities/Definitions.hpp" +#include "Acts/MagneticField/concept/AnyFieldLookup.hpp" + +class ATLASMagneticFieldWrapper +{ + + +public: + + struct Cache { + // empty, no cache for now + }; + + // FieldCell is not needed anymore, keep it for backwards compatibility right now. + struct FieldCell { + public: + FieldCell(MagField::IMagFieldSvc* fieldService) + : m_fieldService(fieldService) + { + } + + Acts::Vector3D + getField(const Acts::Vector3D& pos) const + { + Acts::Vector3D bfield; + m_fieldService->getField(&pos, &bfield); + + bfield *= m_bFieldUnit; // kT -> T; + + return bfield; + } + + Acts::Vector3D + getFieldGradient(const Acts::Vector3D& position, Acts::ActsMatrixD<3, 3>& gradient) const + { + Acts::Vector3D bfield; + m_fieldService->getField(&position, &bfield, &gradient); + + bfield *= m_bFieldUnit; // kT -> T; + gradient *= m_bFieldUnit; + + return bfield; + } + + inline + bool isInside(const Acts::Vector3D&) const { + return true; + } + + private: + MagField::IMagFieldSvc *m_fieldService; + const double m_bFieldUnit = 1000.*Acts::units::_T; + }; + + ATLASMagneticFieldWrapper(MagField::IMagFieldSvc *fieldService) + : m_fieldCell(fieldService), + m_fieldService(fieldService) + { + } + + Acts::Vector3D + getField(const Acts::Vector3D& pos) const + { + Acts::Vector3D bfield; + m_fieldService->getField(&pos, &bfield); + + bfield *= m_bFieldUnit; // kT -> T; + + return bfield; + } + + Acts::Vector3D + getField(const Acts::Vector3D& pos, Cache& /*cache*/) const + { + return getField(pos); + } + + Acts::Vector3D + getFieldGradient(const Acts::Vector3D& position, Acts::ActsMatrixD<3, 3>& gradient) const + { + Acts::Vector3D bfield; + m_fieldService->getField(&position, &bfield, &gradient); + + bfield *= m_bFieldUnit; // kT -> T; + gradient *= m_bFieldUnit; + + return bfield; + } + + Acts::Vector3D + getFieldGradient(const Acts::Vector3D& position, + Acts::ActsMatrixD<3, 3>& gradient, + Cache& /*cache*/) const + { + return getFieldGradient(position, gradient); + } + + // only kept for backwards compatibility + Acts::concept::AnyFieldCell<> + getFieldCell(const Acts::Vector3D& /*position*/) const + { + return m_fieldCell; + } + +private: + // only kept for backwards compatibility + FieldCell m_fieldCell; + + MagField::IMagFieldSvc *m_fieldService; + const double m_bFieldUnit = 1000.*Acts::units::_T; +}; + + +#endif diff --git a/Tracking/Acts/ActsGeometry/ActsGeometry/ActsAlignmentStore.h b/Tracking/Acts/ActsGeometry/ActsGeometry/ActsAlignmentStore.h new file mode 100644 index 0000000000000000000000000000000000000000..9ef6b0f5e5f00d1535a5f6177d9a082ce92b56fb --- /dev/null +++ b/Tracking/Acts/ActsGeometry/ActsGeometry/ActsAlignmentStore.h @@ -0,0 +1,37 @@ +/* + Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration +*/ + +#ifndef ACTSGEOMETRY_ACTSALIGNMENTSTORE_H +#define ACTSGEOMETRY_ACTSALIGNMENTSTORE_H + +#include "GeoModelUtilities/GeoAlignmentStore.h" +#include "GeoModelUtilities/TransformMap.h" +#include "CLIDSvc/CLASS_DEF.h" +#include "AthenaKernel/CondCont.h" + +#include "Acts/Utilities/Definitions.hpp" + +#include <stdexcept> + +class ActsDetectorElement; + +class ActsAlignmentStore : public GeoAlignmentStore +{ + public: + ActsAlignmentStore() {} + + void setTransform(const ActsDetectorElement* key, const Acts::Transform3D&); + const Acts::Transform3D* getTransform(const ActsDetectorElement* key) const; + + private: + TransformMap<ActsDetectorElement, Acts::Transform3D> m_transforms; +}; + +CLASS_DEF(ActsAlignmentStore, 58496671, 1) +CONDCONT_DEF( ActsAlignmentStore , 44989665 ); + +#endif + + + diff --git a/Tracking/Acts/ActsGeometry/ActsGeometry/ActsDetectorElement.h b/Tracking/Acts/ActsGeometry/ActsGeometry/ActsDetectorElement.h new file mode 100644 index 0000000000000000000000000000000000000000..bc40d819be36a2fadf1e7110c3890a3b07f4ee99 --- /dev/null +++ b/Tracking/Acts/ActsGeometry/ActsGeometry/ActsDetectorElement.h @@ -0,0 +1,130 @@ +/* + Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration +*/ + +#ifndef ACTSGEOMETRY_ACTSDETECTORELEMENT_H +#define ACTSGEOMETRY_ACTSDETECTORELEMENT_H + +// ATHENA INCLUDES +#include "InDetIdentifier/PixelID.h" +#include "InDetIdentifier/SCT_ID.h" +#include "InDetReadoutGeometry/SiDetectorElement.h" +#include "InDetReadoutGeometry/TRT_BaseElement.h" + +// ACTS +#include "Acts/Detector/DetectorElementBase.hpp" + + +// STL +#include <mutex> +#include <iostream> + +// BOOST +#include <boost/variant.hpp> + +namespace Acts { + class SurfaceBounds; +} + +class ActsTrackingGeometrySvc; +class ActsAlignmentStore; + +class IdentityHelper; + +/// @class ActsDetectorElement +/// +class ActsDetectorElement : public Acts::DetectorElementBase +{ + using DetElemVariant = boost::variant<const InDetDD::SiDetectorElement*, const InDetDD::TRT_BaseElement*>; +public: + enum class Subdetector { Pixel, SCT, TRT }; + + ActsDetectorElement(const InDetDD::SiDetectorElement* detElem, + const ActsTrackingGeometrySvc* trkSvc); + + /// Constructor for a straw surface. + /// @param transform Transform to the straw system + ActsDetectorElement(std::shared_ptr<const Acts::Transform3D> trf, + const InDetDD::TRT_BaseElement* detElem, + const Identifier& id, // we need explicit ID here b/c of straws + const ActsTrackingGeometrySvc* trkSvc); + + /// Destructor + virtual ~ActsDetectorElement() {} + + /// Identifier + Identifier + identify() const; + + /// Return local to global transform associated with this identifier + virtual const Acts::Transform3D& + transform() const final override; + + void + storeTransform(ActsAlignmentStore* gas) const; + + + /// Return surface associated with this identifier, which should come from the + virtual const Acts::Surface& + surface() const final override; + + /// Returns the thickness of the module + virtual double + thickness() const final override; + + IdentityHelper identityHelper() const; + + +private: + + /// Returns default transform. For TRT this is static and set in constructor. + /// For silicon detectors it is calulated from GM, and stored. Thus the method + /// is not const. The store is mutexed. + const Acts::Transform3D& + getDefaultTransformMutexed() const; + + struct IdVisitor : public boost::static_visitor<Identifier> + { + explicit IdVisitor(const Identifier& id) : m_explicitIdentifier(id) {} + + Identifier operator()(const InDetDD::SiDetectorElement* detElem) const + { + return detElem->identify(); // easy, det element has identifier + } + + Identifier operator()(const InDetDD::TRT_BaseElement*) const + { + // we got the identifier in constructrion, because it identifies + // the STRAW + return m_explicitIdentifier; + } + + Identifier m_explicitIdentifier; + }; + + /// Detector element as variant + DetElemVariant m_detElement; + /// Boundaries of the detector element + std::shared_ptr<const Acts::SurfaceBounds> m_bounds; + /// Thickness of this detector element + double m_thickness; + /// Corresponding Surface + std::shared_ptr<const Acts::Surface> m_surface; + std::vector<std::shared_ptr<const Acts::Surface>> m_surfaces; + + // this is pretty much only used single threaded, so + // the mutex does not hurt + mutable std::mutex m_cacheMutex; + mutable std::shared_ptr<const Acts::Transform3D> m_defTransform; + + const ActsTrackingGeometrySvc* m_trackingGeometrySvc; + + Identifier m_explicitIdentifier; + + // this is threadsafe! + //mutable Gaudi::Hive::ContextSpecificData<Acts::Transform3D> m_ctxSpecificTransform; + + +}; + +#endif diff --git a/Tracking/Acts/ActsGeometry/ActsGeometry/ActsExCellWriterSvc.h b/Tracking/Acts/ActsGeometry/ActsGeometry/ActsExCellWriterSvc.h new file mode 100644 index 0000000000000000000000000000000000000000..ec9bc4cd60dad47e2dc10eac751020e127c09d45 --- /dev/null +++ b/Tracking/Acts/ActsGeometry/ActsGeometry/ActsExCellWriterSvc.h @@ -0,0 +1,70 @@ +/* + Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration +*/ + +#ifndef ACTSGEOMETRY_ACTSEXCELLWRITERSVC_H +#define ACTSGEOMETRY_ACTSEXCELLWRITERSVC_H + +#include "AthenaBaseComps/AthService.h" +#include "GaudiKernel/IInterface.h" +#include "GaudiKernel/Property.h" /*no forward decl: typedef*/ + +#include "ActsGeometry/IActsExCellWriterSvc.h" + +#include "Acts/EventData/TrackParameters.hpp" + +#include <vector> +#include <deque> +#include <mutex> +#include <thread> +#include <atomic> + +template <typename T> +class RootExCellWriter; + + +namespace Acts { + +template <class> +class ExtrapolationCell; + +} + + +class ActsExCellWriterSvc : public extends<AthService, IActsExCellWriterSvc> { +public: + + virtual StatusCode initialize() override; + virtual StatusCode finalize() override; + + ActsExCellWriterSvc( const std::string& name, ISvcLocator* svc ); + + void + store(std::vector<Acts::ExtrapolationCell<Acts::TrackParameters>>& ecells) override; + +private: + using ExCellCharged = Acts::ExtrapolationCell<Acts::TrackParameters>; + + using queue_item_t = std::pair<size_t, ExCellCharged>; + + std::shared_ptr<RootExCellWriter<Acts::TrackParameters>> m_rootEccWriter; + std::deque<queue_item_t> m_queue; + std::mutex m_chargedMutex; + std::thread m_writeThread; + std::atomic<bool> m_doEnd; + + void doWrite(); + + // jobOptions properties + Gaudi::Property<std::string> m_filePath{this, "FilePath", "excells_charged.root", "Output root file for charged particle"}; + Gaudi::Property<std::string> m_treeName{this, "TreeName", "extrapolation_charged", ""}; + Gaudi::Property<bool> m_writeBoundary{this, "WriteBoundary", true, ""}; + Gaudi::Property<bool> m_writeMaterial{this, "WriteMaterial", true, ""}; + Gaudi::Property<bool> m_writeSensitive{this, "WriteSensitive", true, ""}; + Gaudi::Property<bool> m_writePassive{this, "WritePassive", true, ""}; + + +}; + + +#endif diff --git a/Tracking/Acts/ActsGeometry/ActsGeometry/ActsExtrapolationAlg.h b/Tracking/Acts/ActsGeometry/ActsGeometry/ActsExtrapolationAlg.h new file mode 100755 index 0000000000000000000000000000000000000000..804781a38aa82fca8aca5ae6259e5038a1925493 --- /dev/null +++ b/Tracking/Acts/ActsGeometry/ActsGeometry/ActsExtrapolationAlg.h @@ -0,0 +1,116 @@ +/* + Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration +*/ + +#ifndef ACTSGEOMETRY_ACTSEXTRAPOLATIONALG_H +#define ACTSGEOMETRY_ACTSEXTRAPOLATIONALG_H + +// ATHENA +#include "AthenaBaseComps/AthReentrantAlgorithm.h" +#include "GaudiKernel/ServiceHandle.h" +#include "GaudiKernel/Property.h" /*no forward decl: typedef*/ +#include "GaudiKernel/ISvcLocator.h" + +// ACTS +#include "Acts/EventData/TrackParameters.hpp" +#include "Acts/Extrapolation/ExtrapolationCell.hpp" +#include "Acts/Utilities/GeometryID.hpp" +#include "Acts/Plugins/MaterialMapping/MaterialStep.hpp" +#include "Acts/Plugins/MaterialMapping/MaterialTrack.hpp" +#include "Acts/Material/MaterialProperties.hpp" +#include "Acts/Plugins/MaterialMapping/MaterialTrack.hpp" +#include "Acts/Utilities/Helpers.hpp" + +// PACKAGE + +// STL +#include <memory> +#include <vector> +#include <fstream> +#include <mutex> + + +namespace Acts { + class TrackingGeometry; + + namespace detail { + class Step; + } +} + +class IActsMaterialTrackWriterSvc; + +template<typename> +class RootExCellWriter; +class EventContext; +class IAthRNGSvc; +class ActsExtrapolationTool; +class IActsPropStepRootWriterSvc; + +class ActsExtrapolationAlg : public AthReentrantAlgorithm { +public: + ActsExtrapolationAlg (const std::string& name, ISvcLocator* pSvcLocator); + StatusCode initialize() override; + StatusCode execute_r(const EventContext& ctx) const override; + StatusCode finalize() override; + +private: + ServiceHandle<IActsPropStepRootWriterSvc> m_propStepWriterSvc; + ServiceHandle<IAthRNGSvc> m_rndmGenSvc; + + ToolHandle<ActsExtrapolationTool> m_extrapolationTool{this, "ExtrapolationTool", "ActsExtrapolationTool"}; + + std::vector<Acts::ExtrapolationCell<Acts::TrackParameters>> m_exCells; + std::shared_ptr<RootExCellWriter<Acts::TrackParameters>> m_rootEccWriter; + + // poor-mans Particle Gun is included here right now + Gaudi::Property<std::vector<double>> m_etaRange{this, "EtaRange", {-3, 3}, ""}; + Gaudi::Property<std::vector<double>> m_ptRange{this, "PtRange", {0.1, 1000}, ""}; + + // this does not work right now + Gaudi::Property<bool> m_writeMaterialTracks{this, "WriteMaterialTracks", false, ""}; + ServiceHandle<IActsMaterialTrackWriterSvc> m_materialTrackWriterSvc; + + mutable std::mutex m_writeMutex{}; + mutable std::unique_ptr<std::ofstream> m_objOut; + mutable size_t m_objVtxCount{0}; + + void writeStepsObj(std::vector<Acts::detail::Step> steps) const; + + template <class T> + Acts::MaterialTrack + makeMaterialTrack(const T& ecell) const + { + double totDInX0 = 0; + double totDInL0 = 0; + + std::vector<Acts::MaterialStep> mSteps; + for (const auto &es : ecell.extrapolationSteps) { + if (es.configuration.checkMode(Acts::ExtrapolationMode::CollectMaterial)) { + // this is a material step + const Acts::GeometryID& geoID = es.surface->geoID(); + const Acts::MaterialProperties& matProp = *es.material; + totDInX0 += matProp.thicknessInX0(); + totDInL0 += matProp.thicknessInL0(); + Acts::MaterialStep::Position pos(es.position); + mSteps.emplace_back(matProp, pos, geoID.value()); + } + } + + const Acts::Vector3D& mom = ecell.startParameters->momentum(); + double theta = Acts::VectorHelpers::theta(mom); + double phi = Acts::VectorHelpers::phi(mom); + Acts::MaterialTrack mTrack(ecell.startParameters->position(), + theta, + phi, + mSteps, + totDInX0, + totDInL0); + + return mTrack; + + } + +}; + +#endif // ActsGeometry_ActsExtrapolation_h diff --git a/Tracking/Acts/ActsGeometry/ActsGeometry/ActsExtrapolationTool.h b/Tracking/Acts/ActsGeometry/ActsGeometry/ActsExtrapolationTool.h new file mode 100644 index 0000000000000000000000000000000000000000..2b9ce4364e99d343dd5d005c2e381297153c5af9 --- /dev/null +++ b/Tracking/Acts/ActsGeometry/ActsGeometry/ActsExtrapolationTool.h @@ -0,0 +1,151 @@ +/* + Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration +*/ + +#ifndef ACTSGEOMETRY_ACTSEXTRAPOLATIONTOOL_H +#define ACTSGEOMETRY_ACTSEXTRAPOLATIONTOOL_H + +// ATHENA +#include "AthenaBaseComps/AthAlgTool.h" +#include "GaudiKernel/IInterface.h" +#include "GaudiKernel/ServiceHandle.h" +#include "GaudiKernel/Property.h" + +// PACKAGE +#include "ActsGeometry/ActsTrackingGeometryTool.h" + +// ACTS +#include "Acts/Propagator/EigenStepper.hpp" +#include "Acts/Propagator/Propagator.hpp" +#include "Acts/Propagator/detail/SteppingLogger.hpp" +#include "Acts/Propagator/AbortList.hpp" +#include "Acts/Propagator/ActionList.hpp" +#include "Acts/Extrapolator/Navigator.hpp" +#include "Acts/Propagator/detail/DebugOutputActor.hpp" +#include "Acts/Propagator/detail/StandardAbortConditions.hpp" +#include "ActsGeometry/ATLASMagneticFieldWrapper.h" +#include "Acts/MagneticField/ConstantBField.hpp" + +// BOOST +#include <boost/variant/variant.hpp> +#include <boost/variant/apply_visitor.hpp> +#include <boost/variant/static_visitor.hpp> + +namespace MagField { + class IMagFieldSvc; +} + +namespace Acts { +class Surface; +class BoundaryCheck; +} + +static const InterfaceID IID_ActsExtrapolationTool("ActsExtrapolationTool", 1, 0); + +class ActsExtrapolationTool : public AthAlgTool +{ + +public: + virtual StatusCode initialize() override; + + ActsExtrapolationTool(const std::string& type, const std::string& name, + const IInterface* parent); + + template <typename parameters_t> + std::vector<Acts::detail::Step> + propagate(const parameters_t& startParameters, + double pathLimit = std::numeric_limits<double>::max()) const + { + ATH_MSG_VERBOSE(name() << "::" << __FUNCTION__ << " begin"); + + Options options; + options.pathLimit = pathLimit; + bool debug = msg().level() == MSG::VERBOSE; + options.debug = debug; + + options.loopProtection + = (Acts::VectorHelpers::perp(startParameters.momentum()) + < m_ptLoopers * Acts::units::_MeV); + + options.maxStepSize = m_maxStepSize * Acts::units::_m; + + PropagatorVisitor<parameters_t, Options> visitor(startParameters, std::move(options)); + + std::vector<Acts::detail::Step> steps; + DebugOutput::result_type debugOutput; + std::tie(steps, debugOutput) = boost::apply_visitor(visitor, *m_varProp); + + if(debug) { + ATH_MSG_VERBOSE(debugOutput.debugString); + } + + ATH_MSG_VERBOSE("Collected " << steps.size() << " steps"); + ATH_MSG_VERBOSE(name() << "::" << __FUNCTION__ << " end"); + + return steps; + } + + void + prepareAlignment() const; + +private: + // set up options for propagation + using SteppingLogger = Acts::detail::SteppingLogger; + using DebugOutput = Acts::detail::DebugOutputActor; + using EndOfWorld = Acts::detail::EndOfWorldReached; + + // Action list and abort list + using ActionList = Acts::ActionList<SteppingLogger, DebugOutput>; + using AbortConditions = Acts::AbortList<EndOfWorld>; + + using Options = Acts::PropagatorOptions<ActionList, AbortConditions>; + + using VariantPropagator = boost::variant< + Acts::Propagator<Acts::EigenStepper<ATLASMagneticFieldWrapper>, Acts::Navigator>, + Acts::Propagator<Acts::EigenStepper<Acts::ConstantBField>, Acts::Navigator> + >; + + std::unique_ptr<VariantPropagator> m_varProp; + + template <typename parameters_t, typename options_t> + struct PropagatorVisitor + : boost::static_visitor<std::pair<std::vector<Acts::detail::Step>, + DebugOutput::result_type>> { + + PropagatorVisitor(const parameters_t& parameters, options_t options) + : m_parameters(parameters), m_options(std::move(options)) + {} + + template <typename propagator_t> + std::pair<std::vector<Acts::detail::Step>, DebugOutput::result_type> + operator()(const propagator_t& propagator) const + { + const auto& result = propagator.propagate(m_parameters, m_options); + auto steppingResults = result.template get<SteppingLogger::result_type>(); + auto debugOutput = result.template get<DebugOutput::result_type>(); + // try to force return value optimization, not sure this is necessary + return {std::move(steppingResults.steps), std::move(debugOutput)}; + } + + const parameters_t& m_parameters; + options_t m_options; + + }; + + + ServiceHandle<MagField::IMagFieldSvc> m_fieldServiceHandle; + ToolHandle<ActsTrackingGeometryTool> m_trackingGeometryTool{this, "TrackingGeometryTool", "ActsTrackingGeometryTool"}; + + Options m_propagationOptions; + + Gaudi::Property<std::string> m_fieldMode{this, "FieldMode", "ATLAS"}; + Gaudi::Property<std::vector<double>> m_constantFieldVector{this, "ConstantFieldVector", {0, 0, 0}}; + + Gaudi::Property<double> m_ptLoopers{this, "PtLoopers", 300, "PT loop protection threshold. Will be converted to Acts MeV unit"}; + + Gaudi::Property<double> m_maxStepSize{this, "MaxStepSize", 1, "Max step size in Acts mm unit"}; +}; + + + +#endif diff --git a/Tracking/Acts/ActsGeometry/ActsGeometry/ActsLayerBuilder.h b/Tracking/Acts/ActsGeometry/ActsGeometry/ActsLayerBuilder.h new file mode 100644 index 0000000000000000000000000000000000000000..696ecfc2cac0b77784a6f1a1a6bff6b2fb3109c2 --- /dev/null +++ b/Tracking/Acts/ActsGeometry/ActsGeometry/ActsLayerBuilder.h @@ -0,0 +1,145 @@ +/* + Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration +*/ + +#ifndef ACTSGEOMETRY_ACTSLAYERBUILDER_H +#define ACTSGEOMETRY_ACTSLAYERBUILDER_H + +// PACKAGE +#include "ActsGeometry/ActsDetectorElement.h" + +// ATHENA + +// ACTS +#include "Acts/Tools/ILayerBuilder.hpp" +#include "Acts/Utilities/Logger.hpp" +#include "Acts/Utilities/BinningType.hpp" + +class ActsTrackingGeomtrySvc; + +namespace InDetDD { + class SiDetectorManager; +} + +namespace Acts { +class Surface; +class LayerCreator; +} + +/// @class ActsLayerBuilder +class ActsLayerBuilder : public Acts::ILayerBuilder +{ +public: + using ElementVector + = std::vector<std::shared_ptr<const ActsDetectorElement>>; + + /// @struct Config + /// nested configuration struct for steering of the layer builder + + struct Config + { + /// string based identification + std::string configurationName = "undefined"; + ActsDetectorElement::Subdetector subdetector + = ActsDetectorElement::Subdetector::Pixel; + const InDetDD::SiDetectorManager* mng; + std::shared_ptr<const Acts::LayerCreator> layerCreator = nullptr; + /// the binning type of the contained surfaces in phi + /// (equidistant/arbitrary) + Acts::BinningType bTypePhi = Acts::equidistant; + /// the binning type of the contained surfaces in r + /// (equidistant/arbitrary) + Acts::BinningType bTypeR = Acts::equidistant; + /// the binning type of the contained surfaces in z + /// (equidistant/arbitrary) + Acts::BinningType bTypeZ = Acts::equidistant; + std::shared_ptr<ElementVector> elementStore; + + std::pair<size_t, size_t> endcapMaterialBins = {20, 5}; + std::pair<size_t, size_t> barrelMaterialBins = {10, 10}; + + const ActsTrackingGeometrySvc* trackingGeometrySvc = nullptr; + }; + + /// Constructor + /// @param cfg is the configuration struct + /// @param logger the local logging instance + ActsLayerBuilder(const Config& cfg, + std::unique_ptr<const Acts::Logger> logger + = Acts::getDefaultLogger("GMLayBldr", Acts::Logging::INFO)) + : m_logger(std::move(logger)) + { + // std::cout << "GMLB construct" << std::endl; + m_cfg = cfg; + } + + /// Destructor + ~ActsLayerBuilder() {} + + const Acts::LayerVector + negativeLayers() const override; + + const Acts::LayerVector + centralLayers() const override; + + const Acts::LayerVector + positiveLayers() const override; + + /// Name identification + // const std::string& + // identification() const final; + + /// set the configuration object + /// @param cfg is the configuration struct + void + setConfiguration(const Config& cfg); + + /// get the configuration object + // Config + // getConfiguration() const; + + ActsLayerBuilder::Config + getConfiguration() const + { + return m_cfg; + } + + const std::string& + identification() const + { + return m_cfg.configurationName; + } + + /// set logging instance + void + setLogger(std::unique_ptr<const Acts::Logger> logger); + +private: + /// configruation object + Config m_cfg; + + /// Private access to the logger + const Acts::Logger& + logger() const + { + return *m_logger; + } + + std::vector<std::shared_ptr<const ActsDetectorElement>> + getDetectorElements() const; + + /// logging instance + std::unique_ptr<const Acts::Logger> m_logger; + + ///// @todo make clear where the ActsDetectorElement lives + //std::vector<std::shared_ptr<const ActsDetectorElement>> m_elementStore; + + + // Private helper method : build layers + // @param layers is goint to be filled + // @param type is the indication which ones to build -1 | 0 | 1 + void + buildLayers(Acts::LayerVector& layersOutput, int type = 0); +}; + +#endif diff --git a/Tracking/Acts/ActsGeometry/ActsGeometry/ActsMaterialTrackWriterSvc.h b/Tracking/Acts/ActsGeometry/ActsGeometry/ActsMaterialTrackWriterSvc.h new file mode 100644 index 0000000000000000000000000000000000000000..d36b5c8bdd603b30f9957ae125ae14c5b1dabe19 --- /dev/null +++ b/Tracking/Acts/ActsGeometry/ActsGeometry/ActsMaterialTrackWriterSvc.h @@ -0,0 +1,86 @@ +/* + Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration +*/ + +#ifndef ACTSGEOMETRY_ACTSMATERIALTRACKWRITERSVC_H +#define ACTSGEOMETRY_ACTSMATERIALTRACKWRITERSVC_H + +#include "ActsGeometry/IActsMaterialTrackWriterSvc.h" + +#include "AthenaBaseComps/AthService.h" +#include "GaudiKernel/IInterface.h" +#include "GaudiKernel/Property.h" /*no forward decl: typedef*/ + +#include <vector> +#include <deque> +#include <mutex> +#include <thread> +#include <atomic> + +#include "TTree.h" +#include "TFile.h" + +namespace Acts { + class MaterialTrack; +} + +class ActsMaterialTrackWriterSvc : public extends<AthService, IActsMaterialTrackWriterSvc> { +public: + + virtual StatusCode initialize() override; + virtual StatusCode finalize() override; + + ActsMaterialTrackWriterSvc( const std::string& name, ISvcLocator* svc ); + + void + write(const Acts::MaterialTrack& mTrack) override; + +private: + + std::deque<Acts::MaterialTrack> m_mTracks; + std::mutex m_writeMutex; + std::thread m_writeThread; + std::atomic<bool> m_doEnd; + TFile* p_tFile; + TTree* p_tree; + + // tree branches + double m_treeX0; + double m_treeL0; + double m_treeTheta; + double m_treePhi; + double m_treeT; + double m_treedInX0; + double m_treedInL0; + + //std::vector<std::array<double, 3>> m_treeStepPos; + std::vector<double> m_treeStepX0; + std::vector<double> m_treeStepL0; + std::vector<double> m_treeStepA; + std::vector<double> m_treeStepZ; + std::vector<double> m_treeStepRho; + std::vector<double> m_treeStepT; + std::vector<double> m_treeStepdInX0; + std::vector<double> m_treeStepdInL0; + + std::vector<double> m_treeStepPosX; + std::vector<double> m_treeStepPosY; + std::vector<double> m_treeStepPosZ; + std::vector<double> m_treeStepPosR; + std::vector<double> m_treeStepPosPhi; + + std::vector<ULong64_t> m_treeStepGeoID; + + + void writerThread(); + void doWrite(const Acts::MaterialTrack &mTrack); + + // jobOptions properties + Gaudi::Property<std::string> m_filePath{this, "FilePath", "MaterialTracks.root", "Output root file for charged particle"}; + Gaudi::Property<std::string> m_treeName{this, "TreeName", "MaterialTracks", ""}; + Gaudi::Property<size_t> m_maxQueueSize{this, "MaxQueueSize", 5000, "Limit the write queue to this size"}; + +}; + + +#endif diff --git a/Tracking/Acts/ActsGeometry/ActsGeometry/ActsObjWriterTool.h b/Tracking/Acts/ActsGeometry/ActsGeometry/ActsObjWriterTool.h new file mode 100644 index 0000000000000000000000000000000000000000..615a04f6aaf1f9a0ef2afa97c8f45736ea5c02b2 --- /dev/null +++ b/Tracking/Acts/ActsGeometry/ActsGeometry/ActsObjWriterTool.h @@ -0,0 +1,50 @@ +/* + Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration +*/ + +#ifndef ACTSGEOMETRY_ACTSOBJWRITERTOOL_H +#define ACTSGEOMETRY_ACTSOBJWRITERTOOL_H + +#include <vector> + +#include "GaudiKernel/IAlgTool.h" +#include "AthenaBaseComps/AthAlgTool.h" +#include "GaudiKernel/IInterface.h" +#include "GaudiKernel/Property.h" /*no forward decl: typedef*/ + + +namespace Acts { + +class TrackingGeometry; +class ObjTrackingGeometryWriter; + +} + +static const InterfaceID IID_ActsObjWriterTool("ActsObjWriterTool", 1, 0); + +class ActsObjWriterTool : public AthAlgTool +{ + +public: + + static const InterfaceID& interfaceID(){return IID_ActsObjWriterTool;} + + StatusCode initialize() override; + + ActsObjWriterTool(const std::string& type, const std::string& name, + const IInterface* parent); + + void + write(const Acts::TrackingGeometry&); + +private: + + Gaudi::Property<std::string> m_outputDirectory{this, "OutputDirectory", ".", ""}; + Gaudi::Property<std::vector<std::string>> m_subDetectors{this, "SubDetectors", {}, ""}; + + std::shared_ptr<Acts::ObjTrackingGeometryWriter> m_tgObjWriter; + + +}; + +#endif diff --git a/Tracking/Acts/ActsGeometry/ActsGeometry/ActsPropStepRootWriterSvc.h b/Tracking/Acts/ActsGeometry/ActsGeometry/ActsPropStepRootWriterSvc.h new file mode 100644 index 0000000000000000000000000000000000000000..7c63e67f3a7f297c3a4a07e0e5964556dce2fc28 --- /dev/null +++ b/Tracking/Acts/ActsGeometry/ActsGeometry/ActsPropStepRootWriterSvc.h @@ -0,0 +1,88 @@ +/* + Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration +*/ + +#ifndef ACTSGEOMETRY_ACTSPROPSTEPROOTWRITERSVC_H +#define ACTSGEOMETRY_ACTSPROPSTEPROOTWRITERSVC_H + +#include "AthenaBaseComps/AthService.h" +#include "GaudiKernel/IInterface.h" +#include "GaudiKernel/Property.h" /*no forward decl: typedef*/ + +#include "ActsGeometry/IActsPropStepRootWriterSvc.h" + +#include "Acts/EventData/TrackParameters.hpp" + +#include <vector> +#include <deque> +#include <mutex> +#include <thread> +#include <atomic> + +template <typename T> +class RootPropStepWriter; + + +namespace Acts { + +template <class> +class ExtrapolationCell; + +} + +class TFile; +class TTree; + + +class ActsPropStepRootWriterSvc : public extends<AthService, IActsPropStepRootWriterSvc> { +public: + + virtual StatusCode initialize() override; + virtual StatusCode finalize() override; + + ActsPropStepRootWriterSvc( const std::string& name, ISvcLocator* svc ); + + using StepVector = std::vector<Acts::detail::Step>; + + void + write(const StepVector& steps) override; + +private: + using queue_item_t = std::pair<size_t, StepVector>; + + //std::shared_ptr<RootPropStepWriter<Acts::TrackParameters>> m_rootEccWriter; + std::deque<queue_item_t> m_queue; + std::mutex m_writeMutex; + std::thread m_writeThread; + std::atomic<bool> m_doEnd; + + void writeThread(); + void doWrite(const StepVector& steps, size_t evtNum); + void end(); + + // jobOptions properties + Gaudi::Property<std::string> m_filePath{this, "FilePath", "propsteps.root", "Output root file for charged particle"}; + Gaudi::Property<std::string> m_treeName{this, "TreeName", "propsteps", ""}; + //Gaudi::Property<bool> m_writeBoundary{this, "WriteBoundary", true, ""}; + //Gaudi::Property<bool> m_writeMaterial{this, "WriteMaterial", true, ""}; + //Gaudi::Property<bool> m_writeSensitive{this, "WriteSensitive", true, ""}; + //Gaudi::Property<bool> m_writePassive{this, "WritePassive", true, ""}; + + // root branch storage + TFile* m_outputFile; ///< the output file + TTree* m_outputTree; ///< the output tree + int m_eventNum; + std::vector<float> m_s_pX; ///< global position x of the step + std::vector<float> m_s_pY; ///< global position y of the step + std::vector<float> m_s_pZ; ///< global position z of the step + std::vector<float> m_s_pR; ///< global position z of the step + std::vector<int> m_s_volumeID; ///< volume identification + std::vector<int> m_s_boundaryID; ///< boundary identification + std::vector<int> m_s_layerID; ///< layer identification + std::vector<int> m_s_approachID; ///< approach identification + std::vector<int> m_s_sensitiveID; ///< sensitive identification + +}; + + +#endif diff --git a/Tracking/Acts/ActsGeometry/ActsGeometry/ActsStrawLayerBuilder.h b/Tracking/Acts/ActsGeometry/ActsGeometry/ActsStrawLayerBuilder.h new file mode 100644 index 0000000000000000000000000000000000000000..5391de6bbd5580d9252d8fbcc72ddec3424fc01b --- /dev/null +++ b/Tracking/Acts/ActsGeometry/ActsGeometry/ActsStrawLayerBuilder.h @@ -0,0 +1,96 @@ +/* + Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration +*/ + +#ifndef ACTSGEOMETRY_ACTSSTRAWLAYERBUILDER_H +#define ACTSGEOMETRY_ACTSSTRAWLAYERBUILDER_H + + +// ATHENA + +// PACKAGE + +// ACTS +#include "Acts/Tools/ILayerBuilder.hpp" +#include "Acts/Utilities/Logger.hpp" + +class TRT_ID; +class ActsTrackingGeometrySvc; +class TRT_DetectorManager; +class ActsDetectorElement; + +namespace Acts { +class Surface; +class LayerCreator; +} + +/// @class ActsStrawLayerBuilder +class ActsStrawLayerBuilder : public Acts::ILayerBuilder +{ +public: + using ElementVector + = std::vector<std::shared_ptr<const ActsDetectorElement>>; + + struct Config + { + /// string based identification + std::string configurationName = "undefined"; + const InDetDD::TRT_DetectorManager* mng; + std::shared_ptr<const Acts::LayerCreator> layerCreator = nullptr; + std::shared_ptr<ElementVector> elementStore; + const ActsTrackingGeometrySvc* trackingGeometrySvc = nullptr; + const TRT_ID* idHelper = nullptr; + }; + + /// Constructor + /// @param cfg is the configuration struct + /// @param logger the local logging instance + ActsStrawLayerBuilder(const Config& cfg, + std::unique_ptr<const Acts::Logger> logger + = Acts::getDefaultLogger("GMSLayBldr", Acts::Logging::INFO)) + : m_logger(std::move(logger)) + { + m_cfg = cfg; + } + + ~ActsStrawLayerBuilder() {} + + const Acts::LayerVector + negativeLayers() const override; + + const Acts::LayerVector + centralLayers() const override; + + const Acts::LayerVector + centralLayers(); + + const Acts::LayerVector + positiveLayers() const override; + + const std::string& + identification() const override + { + return m_cfg.configurationName; + } + + const Acts::LayerVector + endcapLayers(int side); + +private: + /// configruation object + Config m_cfg; + + /// Private access to the logger + const Acts::Logger& + logger() const + { + return *m_logger; + } + + /// logging instance + std::unique_ptr<const Acts::Logger> m_logger; + + +}; + +#endif diff --git a/Tracking/Acts/ActsGeometry/ActsGeometry/ActsTrackingGeometrySvc.h b/Tracking/Acts/ActsGeometry/ActsGeometry/ActsTrackingGeometrySvc.h new file mode 100644 index 0000000000000000000000000000000000000000..1acae91e6e584858e967db2fc964a4d0eb5b7ef3 --- /dev/null +++ b/Tracking/Acts/ActsGeometry/ActsGeometry/ActsTrackingGeometrySvc.h @@ -0,0 +1,87 @@ +/* + Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration +*/ + +#ifndef ACTSGEOMETRY_ACTSTRACKINGGEOMETRYSVC_H +#define ACTSGEOMETRY_ACTSTRACKINGGEOMETRYSVC_H + +// ATHENA +#include "AthenaBaseComps/AthService.h" +#include "StoreGate/StoreGateSvc.h" +#include "GaudiKernel/EventContext.h" + +// PACKAGE +#include "ActsGeometry/IActsTrackingGeometrySvc.h" + +// STL +#include <map> + +namespace InDetDD { + class InDetDetectorManager; + class SiDetectorManager; + class TRT_DetectorManager; +} + +class TRT_ID; +class ActsAlignmentStore; + +class ActsDetectorElement; + +namespace Acts { + +class TrackingGeometry; +class CylinderVolumeHelper; +class ITrackingVolumeBuilder; + +class GeometryID; +class BinnedSurfaceMaterial; + +} + + +class ActsTrackingGeometrySvc : public extends<AthService, IActsTrackingGeometrySvc> { +public: + + StatusCode initialize() override; + //virtual StatusCode finalize() override; + + ActsTrackingGeometrySvc( const std::string& name, ISvcLocator* pSvcLocator ); + + std::shared_ptr<const Acts::TrackingGeometry> + trackingGeometry() override; + + void + setAlignmentStore(const ActsAlignmentStore* gas, const EventContext& ctx) override; + + const ActsAlignmentStore* + getAlignmentStore(const EventContext& ctx) const override; + + +private: + std::shared_ptr<const Acts::ITrackingVolumeBuilder> + makeVolumeBuilder(const InDetDD::InDetDetectorManager* manager, std::shared_ptr<const Acts::CylinderVolumeHelper> cvh, bool toBeamline = false); + + ServiceHandle<StoreGateSvc> m_detStore; + const InDetDD::SiDetectorManager* p_pixelManager; + const InDetDD::SiDetectorManager* p_SCTManager; + const InDetDD::TRT_DetectorManager* p_TRTManager; + + std::shared_ptr<std::vector<std::shared_ptr<const ActsDetectorElement>>> m_elementStore; + std::shared_ptr<const Acts::TrackingGeometry> m_trackingGeometry; + + const TRT_ID *m_TRT_idHelper; + + Gaudi::Property<bool> m_useMaterialMap{this, "UseMaterialMap", false, ""}; + Gaudi::Property<std::string> m_materialMapInputFile{this, "MaterialMapInputFile", "", ""}; + Gaudi::Property<std::vector<size_t>> m_barrelMaterialBins{this, "BarrelMaterialBins", {10, 10}}; + Gaudi::Property<std::vector<size_t>> m_endcapMaterialBins{this, "EndcapMaterialBins", {5, 20}}; + + mutable std::unordered_map<EventContext::ContextID_t, const ActsAlignmentStore*> m_gasMap; + mutable std::mutex m_gasMapMutex; + + +}; + + + +#endif diff --git a/Tracking/Acts/ActsGeometry/ActsGeometry/ActsTrackingGeometryTool.h b/Tracking/Acts/ActsGeometry/ActsGeometry/ActsTrackingGeometryTool.h new file mode 100644 index 0000000000000000000000000000000000000000..56efe7caaf938fd6f23a7fd08541947b3298f158 --- /dev/null +++ b/Tracking/Acts/ActsGeometry/ActsGeometry/ActsTrackingGeometryTool.h @@ -0,0 +1,50 @@ +/* + Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration +*/ + +#ifndef ACTSGEOMETRY_ACTSTRACKINGGEOMETRYTOOL_H +#define ACTSGEOMETRY_ACTSTRACKINGGEOMETRYTOOL_H + +// ATHENA +#include "AthenaBaseComps/AthAlgTool.h" +#include "GaudiKernel/IInterface.h" +#include "GaudiKernel/ServiceHandle.h" +#include "StoreGate/ReadCondHandleKey.h" + +// PACKAGE +#include "ActsGeometry/ActsAlignmentStore.h" // ReadCondHandleKey wants complete type + +// ACTS + +namespace Acts { +class TrackingGeometry; +} + +class IActsTrackingGeometrySvc; + +static const InterfaceID IID_ActsTrackingGeometryTool("ActsTrackingGeometryTool", 1, 0); + +class ActsTrackingGeometryTool : public AthAlgTool +{ + +public: + StatusCode initialize() override; + + ActsTrackingGeometryTool(const std::string& type, const std::string& name, + const IInterface* parent); + + std::shared_ptr<const Acts::TrackingGeometry> + trackingGeometry() const; + + StatusCode prepareAlignment() const; + +private: + + ServiceHandle<IActsTrackingGeometrySvc> m_trackingGeometrySvc; + + SG::ReadCondHandleKey<ActsAlignmentStore> m_rchk {this, "PixelAlignmentKey", "PixelAlignment", "cond read key"}; + + +}; + +#endif diff --git a/Tracking/Acts/ActsGeometry/ActsGeometry/ActsWriteTrackingGeometry.h b/Tracking/Acts/ActsGeometry/ActsGeometry/ActsWriteTrackingGeometry.h new file mode 100755 index 0000000000000000000000000000000000000000..7a154832f64e21e4dad3a6616c8f75b8d91141c8 --- /dev/null +++ b/Tracking/Acts/ActsGeometry/ActsGeometry/ActsWriteTrackingGeometry.h @@ -0,0 +1,46 @@ +/* + Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration +*/ + +#ifndef ACTSGEOMETRY_ACTSWRITETRACKINGGEOMETRY_H +#define ACTSGEOMETRY_ACTSWRITETRACKINGGEOMETRY_H + +// ATHENA +#include "AthenaBaseComps/AthAlgorithm.h" +#include "GaudiKernel/ServiceHandle.h" +#include "MagFieldInterfaces/IMagFieldSvc.h" +#include "AthenaKernel/IAthRNGSvc.h" +#include "GaudiKernel/Property.h" /*no forward decl: typedef*/ +#include "GaudiKernel/ISvcLocator.h" + +// PACKAGE +#include "ActsGeometry/ActsObjWriterTool.h" +#include "ActsGeometry/ActsTrackingGeometryTool.h" + +// STL +#include <fstream> +#include <memory> +#include <vector> + +namespace Acts { + class TrackingGeometry; +} + +class IActsTrackingGeometrySvc; + +class ActsWriteTrackingGeometry : public AthAlgorithm { +public: + ActsWriteTrackingGeometry (const std::string& name, ISvcLocator* pSvcLocator); + StatusCode initialize() override; + StatusCode execute() override; + StatusCode finalize() override; + +private: + + ToolHandle<ActsTrackingGeometryTool> m_trackingGeometryTool{this, "TrackingGeometryTool", "ActsTrackingGeometryTool"}; + + ToolHandle<ActsObjWriterTool> m_objWriterTool{this, "ObjWriterTool", "ActsObjWriterTool"}; + +}; + +#endif diff --git a/Tracking/Acts/ActsGeometry/ActsGeometry/GeomShiftCondAlg.h b/Tracking/Acts/ActsGeometry/ActsGeometry/GeomShiftCondAlg.h new file mode 100644 index 0000000000000000000000000000000000000000..bbfaae5807d2683f748fa317aa8a1d43b2ee59ec --- /dev/null +++ b/Tracking/Acts/ActsGeometry/ActsGeometry/GeomShiftCondAlg.h @@ -0,0 +1,64 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +#pragma once + +// ATHENA +#include "AthenaBaseComps/AthAlgorithm.h" +#include "StoreGate/WriteCondHandleKey.h" +#include "GaudiKernel/ServiceHandle.h" +#include "EventInfo/EventInfo.h" // ReadHandleKey wants complete type + +// PACKAGE + +// STL +#include <string> + +namespace InDetDD { + class InDetDetectorManager; + class SiDetectorManager; + class TRT_DetectorManager; +} + +class EventInfo; +class ICondSvc; +class StoreGateSvc; +class IActsTrackingGeometrySvc; +class ActsAlignmentStore; +class GeoAlignableTransform; + + +class GeomShiftCondAlg : public AthAlgorithm { + +public: + + GeomShiftCondAlg (const std::string& name, ISvcLocator* pSvcLocator); + virtual ~GeomShiftCondAlg(); + + virtual bool isClonable() const override { return true; } + + virtual StatusCode initialize() override; + virtual StatusCode execute() override; + virtual StatusCode finalize() override; + +private: + + SG::ReadHandleKey<EventInfo> m_evt {this,"EvtInfo", "McEventInfo", "EventInfo name"}; + + SG::WriteCondHandleKey<ActsAlignmentStore> m_wchk {this, "PixelAlignmentKey", "PixelAlignment", "cond handle key"}; + + Gaudi::Property<double> m_zShiftPerLB {this, "ZShiftPerLB", 10.5, ""}; + + ServiceHandle<ICondSvc> m_cs; + ServiceHandle<IActsTrackingGeometrySvc> m_trackingGeometrySvc; + + ServiceHandle<StoreGateSvc> m_detStore; + const InDetDD::SiDetectorManager* p_pixelManager; + const InDetDD::SiDetectorManager* p_SCTManager; + const InDetDD::TRT_DetectorManager* p_TRTManager; + + std::vector<const GeoAlignableTransform*> m_topAligns; + +}; + diff --git a/Tracking/Acts/ActsGeometry/ActsGeometry/IActsExCellWriterSvc.h b/Tracking/Acts/ActsGeometry/ActsGeometry/IActsExCellWriterSvc.h new file mode 100644 index 0000000000000000000000000000000000000000..2a8016e66db2c5de7134ed1b3eead00de01e4383 --- /dev/null +++ b/Tracking/Acts/ActsGeometry/ActsGeometry/IActsExCellWriterSvc.h @@ -0,0 +1,33 @@ +/* + Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration +*/ + +#ifndef ACTSGEOMETRY_IACTSEXCELLWRITERSVC_H +#define ACTSGEOMETRY_IACTSEXCELLWRITERSVC_H + +#include "GaudiKernel/IInterface.h" +#include "Acts/EventData/TrackParameters.hpp" + +namespace Acts { + +template <class> +class ExtrapolationCell; + +} + + +class IActsExCellWriterSvc : virtual public IInterface { +public: + + DeclareInterfaceID(IActsExCellWriterSvc, 1, 0); + + IActsExCellWriterSvc() {;} + + void + virtual + store(std::vector<Acts::ExtrapolationCell<Acts::TrackParameters>>& ecells) = 0; + +}; + + +#endif diff --git a/Tracking/Acts/ActsGeometry/ActsGeometry/IActsMaterialTrackWriterSvc.h b/Tracking/Acts/ActsGeometry/ActsGeometry/IActsMaterialTrackWriterSvc.h new file mode 100644 index 0000000000000000000000000000000000000000..8f3804142e7656afd9b17835078149bc659a1f8f --- /dev/null +++ b/Tracking/Acts/ActsGeometry/ActsGeometry/IActsMaterialTrackWriterSvc.h @@ -0,0 +1,28 @@ +/* + Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration +*/ + +#ifndef ACTSGEOMETRY_IACTSMATERIALTRACKWRITERSVC_H +#define ACTSGEOMETRY_IACTSMATERIALTRACKWRITERSVC_H + +#include "GaudiKernel/IInterface.h" +#include "Acts/EventData/TrackParameters.hpp" + +namespace Acts { +class MaterialTrack; +} + +class IActsMaterialTrackWriterSvc : virtual public IInterface { +public: + + DeclareInterfaceID(IActsMaterialTrackWriterSvc, 1, 0); + + IActsMaterialTrackWriterSvc() {;} + + void + virtual + write(const Acts::MaterialTrack& mTrack) = 0; + +}; + +#endif diff --git a/Tracking/Acts/ActsGeometry/ActsGeometry/IActsPropStepRootWriterSvc.h b/Tracking/Acts/ActsGeometry/ActsGeometry/IActsPropStepRootWriterSvc.h new file mode 100644 index 0000000000000000000000000000000000000000..abcde5cd7fa2e8cce3768000d2ecf431f497f3e2 --- /dev/null +++ b/Tracking/Acts/ActsGeometry/ActsGeometry/IActsPropStepRootWriterSvc.h @@ -0,0 +1,32 @@ +/* + Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration +*/ + +#ifndef ACTSGEOMETRY_IACTSPROPSTEPROOTWRITERSVC_H +#define ACTSGEOMETRY_IACTSPROPSTEPROOTWRITERSVC_H + +#include "GaudiKernel/IInterface.h" +#include "Acts/EventData/TrackParameters.hpp" + +namespace Acts { + namespace detail { + class Step; + } +} + + +class IActsPropStepRootWriterSvc : virtual public IInterface { +public: + + DeclareInterfaceID(IActsPropStepRootWriterSvc, 1, 0); + + IActsPropStepRootWriterSvc() {;} + + void + virtual + write(const std::vector<Acts::detail::Step>& steps) = 0; + +}; + + +#endif diff --git a/Tracking/Acts/ActsGeometry/ActsGeometry/IActsTrackingGeometrySvc.h b/Tracking/Acts/ActsGeometry/ActsGeometry/IActsTrackingGeometrySvc.h new file mode 100644 index 0000000000000000000000000000000000000000..a175dfccf5c9ad71b8a1b49cd6be8c90e6740b7d --- /dev/null +++ b/Tracking/Acts/ActsGeometry/ActsGeometry/IActsTrackingGeometrySvc.h @@ -0,0 +1,39 @@ +/* + Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration +*/ + +#ifndef ACTSGEOMETRY_IACTSTRACKINGGEOMETRYSVC_H +#define ACTSGEOMETRY_IACTSTRACKINGGEOMETRYSVC_H + +#include "GaudiKernel/IInterface.h" + +class EventContext; +class ActsAlignmentStore; + +namespace Acts { + class TrackingGeometry; +} + + +class IActsTrackingGeometrySvc : virtual public IInterface { + public: + + DeclareInterfaceID(IActsTrackingGeometrySvc, 1, 0); + + IActsTrackingGeometrySvc() {;} + + virtual + std::shared_ptr<const Acts::TrackingGeometry> + trackingGeometry() = 0; + + virtual + void + setAlignmentStore(const ActsAlignmentStore* gas, const EventContext& ctx) = 0; + + virtual + const ActsAlignmentStore* + getAlignmentStore(const EventContext& ctx) const = 0; + +}; + +#endif diff --git a/Tracking/Acts/ActsGeometry/ActsGeometry/NominalAlignmentCondAlg.h b/Tracking/Acts/ActsGeometry/ActsGeometry/NominalAlignmentCondAlg.h new file mode 100644 index 0000000000000000000000000000000000000000..539ea274621b99de89245af03c0cf4176096e396 --- /dev/null +++ b/Tracking/Acts/ActsGeometry/ActsGeometry/NominalAlignmentCondAlg.h @@ -0,0 +1,48 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +#pragma once + +// ATHENA +#include "AthenaBaseComps/AthAlgorithm.h" +#include "StoreGate/WriteCondHandleKey.h" +#include "GaudiKernel/ICondSvc.h" +#include "StoreGate/StoreGateSvc.h" + +// PACKAGE + +// STL +#include <string> + +class IActsTrackingGeometrySvc; +class ActsAlignmentStore; + + +/// @class NominalAlignmentCondAlg +/// Conditions algorithm which produces an (effectively) +/// infinitely valid ActsAlignmentStore which has +/// nominal alignments (= identity deltas) +/// +class NominalAlignmentCondAlg : public AthAlgorithm { + +public: + + NominalAlignmentCondAlg (const std::string& name, ISvcLocator* pSvcLocator); + virtual ~NominalAlignmentCondAlg(); + + virtual bool isClonable() const override { return true; } + + virtual StatusCode initialize() override; + virtual StatusCode execute() override; + virtual StatusCode finalize() override; + +private: + + SG::WriteCondHandleKey<ActsAlignmentStore> m_wchk {this, "PixelAlignmentKey", "PixelAlignment", "cond handle key"}; + + ServiceHandle<ICondSvc> m_cs; + ServiceHandle<IActsTrackingGeometrySvc> m_trackingGeometrySvc; + +}; + diff --git a/Tracking/Acts/ActsGeometry/CMakeLists.txt b/Tracking/Acts/ActsGeometry/CMakeLists.txt new file mode 100755 index 0000000000000000000000000000000000000000..26e908c8297ae1f8a40ae8467d975c9925542235 --- /dev/null +++ b/Tracking/Acts/ActsGeometry/CMakeLists.txt @@ -0,0 +1,73 @@ + +# Declare the package name: +atlas_subdir( ActsGeometry ) + +# Declare the package's dependencies: +atlas_depends_on_subdirs( PUBLIC + PRIVATE + Control/StoreGate + DetectorDescription/Identifier + InnerDetector/InDetDetDescr/InDetIdentifier + InnerDetector/InDetDetDescr/InDetReadoutGeometry + Control/AthenaBaseComps + AthenaKernel + DetectorDescription/GeoModel/GeoModelUtilities + DetectorDescription/GeoPrimitives + Event/EventInfo + GaudiKernel + MagneticField/MagFieldInterfaces + ActsInterop ) + +# External dependencies: +find_package( CLHEP ) +find_package( Eigen ) +find_package( Boost ) + +if(NOT ATH_ACTS_BUILD_SUBDIR) + find_package( Acts REQUIRED COMPONENTS Core Legacy MaterialMappingPlugin ) +endif() + +# Component(s) in the package: + +atlas_add_library( ActsGeometryLib + src/ActsAlignmentStore.cxx + src/ActsDetectorElement.cxx + src/ActsLayerBuilder.cxx + src/ActsStrawLayerBuilder.cxx + src/util/*.cxx + PUBLIC_HEADERS ActsGeometry + INCLUDE_DIRS ${CLHEP_INCLUDE_DIRS} ${EIGEN_INCLUDE_DIRS} ${BOOST_INCLUDE_DIRS} + LINK_LIBRARIES ${CLHEP_LIBRARIES} ${EIGEN_LIBRARIES} + ActsInteropLib + ActsCore + ActsLegacy + ActsMaterialMappingPlugin) + +atlas_add_component( ActsGeometry + src/ActsExtrapolationAlg.cxx + src/ActsWriteTrackingGeometry.cxx + src/ActsTrackingGeometrySvc.cxx + src/ActsExtrapolationTool.cxx + src/ActsObjWriterTool.cxx + #src/ActsExCellWriterSvc.cxx + src/ActsMaterialTrackWriterSvc.cxx + #src/GeomShiftCondAlg.cxx + src/NominalAlignmentCondAlg.cxx + src/ActsTrackingGeometryTool.cxx + src/ActsPropStepRootWriterSvc.cxx + src/components/*.cxx + PUBLIC_HEADERS ActsGeometry + INCLUDE_DIRS ${CLHEP_INCLUDE_DIRS} ${EIGEN_INCLUDE_DIRS} ${BOOST_INCLUDE_DIRS} + LINK_LIBRARIES ${CLHEP_LIBRARIES} ${EIGEN_LIBRARIES} + EventInfo + ActsInteropLib + ActsGeometryLib + ActsCore + ActsLegacy + ActsMaterialMappingPlugin) + +# Install files from the package: +atlas_install_headers( ActsGeometry ) +atlas_install_joboptions( share/*.py ) +atlas_install_python_modules( python/*.py ) + diff --git a/Tracking/Acts/ActsGeometry/doc/packagedoc.h b/Tracking/Acts/ActsGeometry/doc/packagedoc.h new file mode 100755 index 0000000000000000000000000000000000000000..2d7eeff647339cef0dc27ad9e80cb27e2034498d --- /dev/null +++ b/Tracking/Acts/ActsGeometry/doc/packagedoc.h @@ -0,0 +1,11 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +/** + +@page ActsGeometry_page ActsGeometry Package + +@author Paul Gessinger + +*/ diff --git a/Tracking/Acts/ActsGeometry/python/ActsGeometryConfig.py b/Tracking/Acts/ActsGeometry/python/ActsGeometryConfig.py new file mode 100644 index 0000000000000000000000000000000000000000..d838f1599ed485bed7a878e335ac6a3631bddabc --- /dev/null +++ b/Tracking/Acts/ActsGeometry/python/ActsGeometryConfig.py @@ -0,0 +1,9 @@ +from AthenaCommon.Logging import logging +logging.getLogger().info("Importing %s", __name__) + +from AthenaCommon.AthenaCommonFlags import athenaCommonFlags +from AthenaCommon.GlobalFlags import GlobalFlags +from AthenaCommon import CfgMgr + +def ActsTrackingGeometrySvc(name="ActsTrackingGeometrySvc", **kwargs): + return CfgMgr.ActsTrackingGeometrySvc(name, **kwargs) diff --git a/Tracking/Acts/ActsGeometry/python/ActsGeometryConfigDb.py b/Tracking/Acts/ActsGeometry/python/ActsGeometryConfigDb.py new file mode 100644 index 0000000000000000000000000000000000000000..0214f13ccca6c3dacd46ad0df969e5e1ab0e4561 --- /dev/null +++ b/Tracking/Acts/ActsGeometry/python/ActsGeometryConfigDb.py @@ -0,0 +1,4 @@ +from AthenaCommon.CfgGetter import addService + +addService('ActsGeometry.ActsGeometryConfig.TrackingGeometrySvc', 'TrackingGeometrySvc') + diff --git a/Tracking/Acts/ActsGeometry/python/__init__.py b/Tracking/Acts/ActsGeometry/python/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/Tracking/Acts/ActsGeometry/scripts/geo_id.C b/Tracking/Acts/ActsGeometry/scripts/geo_id.C new file mode 100644 index 0000000000000000000000000000000000000000..05d9a62a2a517afcdf1029ba29b99879c29e9a81 --- /dev/null +++ b/Tracking/Acts/ActsGeometry/scripts/geo_id.C @@ -0,0 +1,39 @@ +#include <iostream> +#include <string> + +#include "TFile.h" +#include "TTreeReader.h" + +typedef uint64_t geo_id_value; + +const static geo_id_value volume_mask = 0xff00000000000000; +const static geo_id_value boundary_mask = 0x00ff000000000000; +const static geo_id_value layer_mask = 0x0000ff0000000000; +const static geo_id_value approach_mask = 0x000000f000000000; +const static geo_id_value sensitive_mask = 0x0000000ffff00000; +const static geo_id_value channel_mask = 0x00000000000fffff; + +#define ACTS_BIT_SHIFT(mask) (__builtin_ffsl(mask) - 1) +#define ACTS_BIT_ENCODE(value, mask) (value << ACTS_BIT_SHIFT(mask)) +#define ACTS_BIT_DECODE(code, mask) ((code & mask) >> ACTS_BIT_SHIFT(mask)) + +void geo_id(std::string filename) { + + auto infile = TFile::Open(filename.c_str()); + + TTreeReader rd("MaterialTracks", infile); + + TTreeReaderValue<std::vector<ULong64_t>> step_geo_id(rd, "step_geo_id"); + + while(rd.Next()) { + for(ULong64_t geo_id : *step_geo_id) { + std::cout << "geo_id = " << geo_id << std::endl; + uint64_t vol_id = ACTS_BIT_DECODE(geo_id, volume_mask); + std::cout << "vol_id = " << vol_id << std::endl; + + } + + std::cout << "----" << std::endl; + } + +} diff --git a/Tracking/Acts/ActsGeometry/scripts/geo_id.py b/Tracking/Acts/ActsGeometry/scripts/geo_id.py new file mode 100755 index 0000000000000000000000000000000000000000..10c7f456158f15e766a83e590257a5ac4a68a3fc --- /dev/null +++ b/Tracking/Acts/ActsGeometry/scripts/geo_id.py @@ -0,0 +1,75 @@ +from __future__ import print_function + +# import ROOT + +import sys + +# file = sys.argv[1] + +class GeometryID: + volume_mask = 0xff00000000000000 + boundary_mask = 0x00ff000000000000 + layer_mask = 0x0000ff0000000000 + approach_mask = 0x000000f000000000 + sensitive_mask = 0x0000000ffff00000 + channel_mask = 0x00000000000fffff + + def __init__(self, value): + assert type(value) == long + self._value = value + + def _ffs(self, x): + """Returns the index, counting from 0, of the + least significant set bit in `x`. + """ + return (x&-x).bit_length()-1 + + @property + def vol_id(self): + return self.value(self.volume_mask) + + @property + def bnd_id(self): + return self.value(self.boundary_mask) + + @property + def lay_id(self): + return self.value(self.layer_mask) + + @property + def app_id(self): + return self.value(self.approach_mask) + + @property + def sen_id(self): + return self.value(self.sensitive_mask) + + @property + def chn_id(self): + return self.value(self.channel_mask) + + def value(self, mask = None): + if mask == None: return self._value + return (self._value & mask) >> self._ffs(mask) + + def __repr__(self): + fmt = "GeometryID(vol={}, bnd={}, lay={}, app={}, sen={}, chn={})" + return fmt.format(self.vol_id, + self.bnd_id, + self.lay_id, + self.app_id, + self.sen_id, + self.chn_id) + +# infile = ROOT.TFile.Open(file) + +# tree = infile.Get("MaterialTracks") + +# for idx, event in enumerate(tree): + # for geo_id_ in event.step_geo_id: + # geo_id = GeometryID(geo_id_) + # print(geo_id) + + # print("----") + + diff --git a/Tracking/Acts/ActsGeometry/scripts/plot_geometry.C b/Tracking/Acts/ActsGeometry/scripts/plot_geometry.C new file mode 100644 index 0000000000000000000000000000000000000000..643f897d9f2409c349d1364cf2c19a5d0af61524 --- /dev/null +++ b/Tracking/Acts/ActsGeometry/scripts/plot_geometry.C @@ -0,0 +1,32 @@ +#include <iostream> +#include "TFile.h" +#include "TCanvas.h" +#include "TTree.h" +#include "TROOT.h" + + +void plot_geometry(std::string file) { + gROOT->SetBatch(); + std::cout << "Plotting " << file << std::endl; + + TFile tf(file.c_str()); + tf.cd(); + tf.ls(); + TTree *tree = dynamic_cast<TTree*>(tf.Get("extrapolation_charged")); + //std::cout << file << std::endl; + TCanvas c1("c1", "c1", 1600, 1200); + tree->Draw("step_r:step_z", "sensitive||boundary"); + c1.SaveAs("geometry_rz.png"); + + tree->Draw("step_x:step_y", "sensitive||boundary"); + c1.SaveAs("geometry_xy.png"); + + tree->Draw("step_x:step_y", "abs(step_z)<800&&(sensitive||boundary)"); + c1.SaveAs("geometry_xy_brl.png"); + + tree->Draw("step_x:step_y", "abs(step_z)>800&&(sensitive||boundary)"); + c1.SaveAs("geometry_xy_ec.png"); + + tree->Draw("step_x:step_y:step_z", "sensitive||boundary"); + c1.SaveAs("geometry_xyz.png"); +} diff --git a/Tracking/Acts/ActsGeometry/scripts/plot_helper.C b/Tracking/Acts/ActsGeometry/scripts/plot_helper.C new file mode 100644 index 0000000000000000000000000000000000000000..8b46416e02023d6b312912f9b58d8a8b03013fb6 --- /dev/null +++ b/Tracking/Acts/ActsGeometry/scripts/plot_helper.C @@ -0,0 +1,70 @@ +#include <iostream> +#include <string> +#include <tuple> +#include <limits> + +#include "TFile.h" +#include "TTree.h" +#include "TTreeReader.h" + +#include "TH1D.h" +#include "TGraph.h" + +TGraph +fill_geometry_hist_rz(std::string filename, + //std::tuple<size_t, double, double> rbnd, + //std::tuple<size_t, double, double> zbnd, + long long maxEvents = std::numeric_limits<long long>::max()) { + std::cout << "Producing geometry histogram" << std::endl; + TGraph g; + + //g.GetYaxis()->SetLimits(0, 3000); + + auto infile = TFile::Open(filename.c_str()); + //auto tree = dynamic_cast<TTree*>(infile->Get("extrapolation_charged")) + + //size_t nbinsr, double rmin, double rmax; + //std::tie(nbinsr, rmin, rmax) = rbnd; + //size_t nbinsz, double zmin, double zmax; + //std::tie(nbinsz, zmin, zmax) = zbnd; + //TH2D hist("geometry", "geometry", nbinsr, rmin, rmax, nbinsz, zmin, zmax); + TTreeReader reader("extrapolation_charged", infile); + + size_t nEvents = std::min(reader.GetEntries(true), maxEvents); + size_t n = 0; + + //for(size_t i=0;i<nEvents;i++) { + //if(i%1000 == 0) std::cout << i << "/" << nEvents << std::endl; + + + //} + + + std::cout << "nEvents=" << nEvents << std::endl; + + + TTreeReaderValue<std::vector<float>> vec_step_r(reader, "step_r"); + TTreeReaderValue<std::vector<float>> vec_step_z(reader, "step_z"); + + while(reader.Next()) { + if(n >= nEvents) break; // done + if(n%1000 == 0) std::cout << n << "/" << nEvents << std::endl; + + size_t nSteps = (*vec_step_r).size(); + for(size_t i=0;i<nSteps;i++) { + double step_r = (*vec_step_r).at(i); + double step_z = (*vec_step_z).at(i); + //std::cout << "step_r=" << step_r << " step_z=" << step_z << std::endl; + g.SetPoint(g.GetN(), step_z, step_r); + } + + n++; + } + + g.GetHistogram()->SetMinimum(0); + g.GetHistogram()->SetMaximum(1200); + g.SetMarkerStyle(kDot); + g.SetMarkerSize(0.4); + + return g; +} diff --git a/Tracking/Acts/ActsGeometry/scripts/plot_material.py b/Tracking/Acts/ActsGeometry/scripts/plot_material.py new file mode 100755 index 0000000000000000000000000000000000000000..b2022e8bbcac616f6dd2b980eabad9b5ec30c823 --- /dev/null +++ b/Tracking/Acts/ActsGeometry/scripts/plot_material.py @@ -0,0 +1,496 @@ +#!/usr/bin/env python +from __future__ import print_function +import ROOT +import argparse +import math +import os +import sys + +# sys.path.append(os.path.dirname(__file__)) +from geo_id import GeometryID + + +def style(h): + h.SetFillColor(ROOT.kBlue) + +def mkdir(path, recursive=True): + cmd = ["mkdir"] + if recursive: cmd += ["-p"] + cmd += [path] + os.system(" ".join(cmd)) + +def draw_eta_lines(hist, etas = [0, 1, 1.5, 2, 2.5, 2, 3, 4], sym=True): + + etas = etas + [-eta for eta in etas if eta != 0.] + + xmin = hist.GetXaxis().GetBinLowEdge(0) + xmax = hist.GetXaxis().GetBinUpEdge(hist.GetXaxis().GetNbins()) + + xext = min(map(abs, (xmin, xmax))) + xmin = -xext + xmax = xext + + ymax = hist.GetYaxis().GetBinUpEdge(hist.GetYaxis().GetNbins()) + + l = ROOT.TLine() + l.SetLineWidth(1) + l.SetLineColor(ROOT.kRed) + tl = ROOT.TLatex() + tl.SetTextSize(0.025) + tl.SetTextColor(ROOT.kRed) + + for eta in etas: + theta = 2 * math.atan(math.exp(-eta)) + y = ymax + x = y / math.tan(theta) + + m = y/x + if x > xmax: + y = m*xmax + x = y/m + if x < xmin: + y = m*xmin + x = y/m + + lab_offset = ymax * tl.GetTextSize()*0.5 + l.DrawLine(0, 0, x, y) + if eta != 0: + if x < 0: + tl.SetTextAlign(11) + else: + tl.SetTextAlign(31) + else: + tl.SetTextAlign(21) + tl.DrawLatex(x, y + lab_offset, "#eta = {:.1f}".format(eta)) + + +class HistManager: + def __init__(self): + self._hist2D = {} + self._hist2D_count = {} + + def _key(self, k): + if type(k) == tuple: + return "_".join(str(v) for v in k) + else: + return k + + def addHist2D(self, name, binx, xmin, xmax, biny, ymin, ymax, xlab="", ylab="", zlab="", average=False): + key = self._key(name) + root_name = os.path.basename(name) + + assert key not in self._hist2D, "hist2D with key {} exists".format(key) + self._hist2D[key] = ROOT.TH2D(root_name, root_name, binx, xmin, xmax, biny, ymin, ymax) + self._hist2D[key].GetXaxis().SetTitle(xlab) + self._hist2D[key].GetYaxis().SetTitle(ylab) + self._hist2D[key].GetZaxis().SetTitle(zlab) + + + + if average: + self._hist2D_count[key] = ROOT.TH2D(root_name+"_count", root_name+"_count", binx, xmin, xmax, biny, ymin, ymax) + + def hist2DExists(self, name): + key = self._key(name) + return key in self._hist2D + + def fillHist2D(self, name, x, y, *args): + key = self._key(name) + assert key in self._hist2D, "{} not in histograms".format(key) + self._hist2D[key].Fill(x, y, *args) + if key in self._hist2D_count: + self._hist2D_count[key].Fill(x, y) + + def hist2D(self, name): + key = self._key(name) + return self._hist2D[key] + + def hist2Diter(self): + for name, hist in self._hist2D.items(): + if name not in self._hist2D_count: + yield name, hist + else: + hist_divided = hist.Clone() + hist_divided.Divide(self._hist2D_count[name]) + yield name, hist_divided + +def axislabels(h, x, y): + h.GetXaxis().SetTitle(x) + h.GetYaxis().SetTitle(y) + + +def main(): + + p = argparse.ArgumentParser() + p.add_argument("geant") + p.add_argument("mapped") + p.add_argument("--events", "-n", type=int) + p.add_argument("outdir") + + args = p.parse_args() + + + ROOT.gROOT.SetBatch() + # ROOT.gROOT.SetStyle("ATLAS") + ROOT.gROOT.LoadMacro("../AtlasStyle.C") + ROOT.SetAtlasStyle() + + + ROOT.gROOT.LoadMacro(os.path.join(os.path.dirname(__file__), "plot_helper.C")) + geom_graph = ROOT.fill_geometry_hist_rz("excells_charged.root", 5000) + + c = ROOT.TCanvas("c", "c", 800, 600) + + geom_graph.Draw("ap") + c.SaveAs(os.path.join(args.outdir, "geom_graph.png")) + + geant_file = ROOT.TFile.Open(args.geant) + geant_tree = geant_file.Get("MaterialTracks") + + mapped_file = ROOT.TFile.Open(args.mapped) + mapped_tree = mapped_file.Get("MaterialTracks") + + + colors = [ + ROOT.kOrange, + ROOT.kAzure, + ROOT.kRed, + ROOT.kViolet, + ROOT.kGreen, + ROOT.kPink, + ROOT.kBlue, + ROOT.kMagenta, + ROOT.kCyan, + ROOT.kTeal, + ROOT.kSpring, + ] + # colors = [ + # "#e6194b", + # "#3cb44b", + # "#ffe119", + # "#0082c8", + # "#f58231", + # "#911eb4", + # "#46f0f0", + # "#f032e6", + # "#d2f53c", + # "#fabebe", + # "#008080", + # "#e6beff", + # "#aa6e28", + # "#fffac8", + # "#800000", + # "#aaffc3", + # "#808000", + # "#ffd8b1", + # "#000080" + # ] + + vol_lay_col_map = {} + vol_6_lay_idxs = range(2, 12+2, 2) + vol_7_lay_idxs = range(2, 8+2, 2) + vol_11_lay_idxs = range(2, 18+2, 2) + vol_12_lay_idxs = range(2, 8+2, 2) + + for i, l in enumerate(vol_6_lay_idxs): + vol_lay_col_map[(6, l)] = colors[i%len(colors)] + + for l1, l2 in zip(vol_6_lay_idxs, reversed(vol_6_lay_idxs)): + vol_lay_col_map[(8, l1)] = vol_lay_col_map[(6, l2)] + + for i, l in enumerate(vol_11_lay_idxs): + vol_lay_col_map[(11, l)] = colors[i%len(colors)] + + for l1, l2 in zip(vol_11_lay_idxs, reversed(vol_11_lay_idxs)): + vol_lay_col_map[(13, l1)] = vol_lay_col_map[(11, l2)] + + for i, l in enumerate(vol_7_lay_idxs): + vol_lay_col_map[(7, l)] = colors[i%len(colors)] + for i, l in enumerate(vol_12_lay_idxs): + vol_lay_col_map[(12, l)] = colors[i%len(colors)] + + + # vol_lay_col_map[(6, 2)] = colors[0] + # vol_lay_col_map[(6, 4)] = colors[1] + # vol_lay_col_map[(6, 6)] = colors[2] + # vol_lay_col_map[(6, 8)] = colors[3] + # vol_lay_col_map[(6, 10)] = colors[4] + # vol_lay_col_map[(6, 12)] = colors[5] + + # vol_lay_col_map[(8, 2)] = col_lay_col_map[(6, 12)] + # vol_lay_col_map[(8, 4)] = col_lay_col_map[(6, 10)] + # vol_lay_col_map[(8, 6)] = col_lay_col_map[(6, 8)] + # vol_lay_col_map[(8, 8)] = col_lay_col_map[(6, 6)] + # vol_lay_col_map[(8, 10)] = col_lay_col_map[(6, 4)] + # vol_lay_col_map[(8, 12)] = col_lay_col_map[(6, 2)] + + def hex2rgb(h): + h = h[1:] + return tuple(int(h[i:i+2], 16) for i in (0, 2 ,4)) + + + layers_geant = do_step(c, geant_tree, os.path.join(args.outdir, "geant"), args.events, geom_graph) + layers_mapped = do_step(c, mapped_tree, os.path.join(args.outdir, "mapped"), args.events, geom_graph) + + # c.SetWindowSize(1000, 600) + c_all = ROOT.TCanvas("c_all", "c_all", 1000, 600) + + keys_geant = set(layers_geant.keys()) + keys_mapped = set(layers_mapped.keys()) + keys = keys_geant & keys_mapped + + for idx, key in enumerate(keys): + geo_id = GeometryID(key) + print(geo_id) + + h2_geant = layers_geant[key] + h2_mapped = layers_mapped[key] + + def clip(h, val): + for bx in range(h.GetNbinsX()): + for by in range(h.GetNbinsY()): + bc = h.GetBinContent(bx, by) + if bc > 0: + h.SetBinContent(bx, by, val) + + clip(h2_geant, 1) + clip(h2_mapped, 2) + + # for g in (g_geant, g_mapped): + # g.SetMarkerSize(0.5) + + # color_idx = geo_id.lay_id / 2 + # print("col_idx:", color_idx) + + # color_a = colors[color_idx%len(colors)] + + color_a = vol_lay_col_map[(geo_id.vol_id, geo_id.lay_id)] + + # r, g, b = hex2rgb(colors[idx%len(colors)]) + # color_a = ROOT.TColor(r, g, b, 1.0) + # color_b = ROOT.TColor(r, g, b, 0.6) + + # basecolnum, _ = colors[idx%len(colors)] + # basecol = ROOT.gROOT.GetColor(basecolnum) + # r, g, b = hex2rgb(basecol.AsHexString()) + + + + # color_a = ROOT.TColor.GetColor(r, g, b) + color_b = ROOT.TColor.GetColorTransparent(color_a, 0.6) + + # color_a = ROOT.TColor(r, g, b, 1.0) + # color_b = ROOT.TColor(r, g, b, 0.6) + + + + # h2_geant.SetLineColor(color_b) + h2_geant.SetLineColor(color_a) + h2_mapped.SetLineColor(color_a) + h2_mapped.SetLineStyle(2) + h2_mapped.SetFillColor(color_a) + + for h in (h2_geant, h2_mapped): + h.SetLineWidth(1) + + opt = "BOX" + + c.cd() + h2_geant.Draw(opt) + h2_mapped.Draw(opt+" sames") + + c_all.cd() + + if idx == 0: + h2_geant.Draw(opt) + h2_mapped.Draw(opt+" sames") + else: + opt = "BOX sames" + h2_geant.Draw(opt) + h2_mapped.Draw(opt) + + + lay_str = "vol_{:03d}_lay_{:03d}_app_{:03d}.pdf".format(geo_id.vol_id, geo_id.lay_id, geo_id.app_id) + path = os.path.join(args.outdir, "assoc", "{}.pdf".format(lay_str)) + mkdir(os.path.dirname(path)) + c.SaveAs(path) + + path = os.path.join(args.outdir, "assoc.pdf") + mkdir(os.path.dirname(path)) + c_all.SaveAs(path) + + + + + +def do_step(c, tree, outdir, events, geom_graph): + hm = HistManager() + + hists = {} + + def mkprofile(name, xlab, ylab, *args): + hists[name] = ROOT.TProfile(name, name, *args) + axislabels(hists[name], xlab, ylab) + + mkprofile("theta_x0", '\\theta', "X_{0}", 40, 0, math.pi) + mkprofile("theta_dInX0", '\\theta', "t/X_{0}", 40, 0, math.pi) + mkprofile("theta_t", '\\theta', "t", 40, 0, math.pi) + mkprofile("theta_tTot", '\\theta', "t_{tot}", 40, 0, math.pi) + + mkprofile("phi_x0", "\\phi", "X_{0}", 40, -math.pi, math.pi) + mkprofile("phi_dInX0", '\\phi', "t/X_{0}", 40, -math.pi, math.pi) + mkprofile("phi_t", '\\phi', 't', 40, -math.pi, math.pi) + mkprofile("phi_tTot", '\\phi', 't_{tot}', 40, -math.pi, math.pi) + + mkprofile("eta_x0", '\\eta', 'X_{0}', 40, -4, 4) + mkprofile("eta_dInX0", '\\eta', 't/X_{0}', 40, -4, 4) + mkprofile("eta_t", '\\eta', 't', 40, -4, 4) + mkprofile("eta_tTot", '\\eta', 't_{tot}', 40, -4, 4) + + nBinsEta = 80 + nBinsPhi = 80 + nBinsR = 200 + nBinsZ = 500 + + + hm.addHist2D("eta_phi/eta_phi_x0", nBinsEta, -4, 4, nBinsPhi, -math.pi, math.pi, "\\eta", "\\phi", average=True) + hm.addHist2D("eta_phi/eta_phi_dInX0", nBinsEta, -4, 4, nBinsPhi, -math.pi, math.pi, "\\eta", "\\phi", average=True) + hm.addHist2D("eta_phi/eta_phi_tTot", nBinsEta, -4, 4, nBinsPhi, -math.pi, math.pi, "\\eta", "\\phi", average=True) + + hm.addHist2D("z_r/z_r_x0", nBinsZ, -3000, 3000, nBinsR, 0, 1200, "z [mm]", "r [mm]", "X_{0}", average=True) + + for k, v in hists.iteritems(): + style(v) + + layers = {} + + + for idx, event in enumerate(tree): + + if events: + if idx > events: break + if idx % 1000 == 0: + print("{} / {}".format(idx, tree.GetEntries())) + + # X0 = event.X0 + theta = event.theta + phi = event.phi + + eta = - math.log(math.tan(theta/2)) + + + tTot = 0 + + dInX0_tot = event.dInX0 + + totalX0 = 0 + + zipped = zip(event.step_t, + event.step_X0, + event.step_dInX0, + event.step_z, + event.step_r, + event.step_geo_id) + for t, x0, dInX0, z, r, _geo_id in zipped: + geo_id = GeometryID(_geo_id) + # tX0 = t/x0 + tTot += t + totalX0 += x0 + + # if geo_id.value() not in layers: + # layers.append(geo_id.value()) + + lay_str = "vol_{}_lay_{}_app_{}".format(geo_id.vol_id, geo_id.lay_id, geo_id.app_id) + if _geo_id not in layers: + hname = lay_str+"_"+outdir+"_z_r" + layers[_geo_id] = ROOT.TH2D(hname, hname, nBinsZ/2, -3000, 3000, nBinsR/2, 0, 1200) + + h2 = layers[_geo_id] + # g.SetPoint(g.GetN(), z, r) + h2.Fill(z, r) + + hm.fillHist2D("z_r/z_r_x0", z, r, x0) + + # hname = "z_r/lay/z_r_"+lay_str+"_x0" + # if not hm.hist2DExist(hname): + # hm.hist2D + + + hists["theta_x0"].Fill(theta, totalX0) + hists["phi_x0"].Fill(phi, totalX0) + hists["eta_x0"].Fill(eta, totalX0) + + hm.fillHist2D("eta_phi/eta_phi_x0", eta, phi, totalX0) + hm.fillHist2D("eta_phi/eta_phi_tTot", eta, phi, tTot) + hm.fillHist2D("eta_phi/eta_phi_dInX0", eta, phi, dInX0_tot) + + hists["theta_dInX0"].Fill(theta, dInX0_tot) + hists["phi_dInX0"].Fill(phi, dInX0_tot) + hists["eta_dInX0"].Fill(eta, dInX0_tot) + + hists["theta_tTot"].Fill(theta, tTot) + hists["phi_tTot"].Fill(phi, tTot) + hists["eta_tTot"].Fill(eta, tTot) + + + hists["phi_dInX0"].GetYaxis().SetRangeUser(0, hists["phi_dInX0"].GetMaximum()*1.2) + hists["phi_x0"].GetYaxis().SetRangeUser(0, hists["phi_x0"].GetMaximum()*1.2) + hists["phi_t"].GetYaxis().SetRangeUser(0, hists["phi_t"].GetMaximum()*1.2) + hists["phi_tTot"].GetYaxis().SetRangeUser(0, hists["phi_tTot"].GetMaximum()*1.2) + + os.system("mkdir -p {}".format(outdir)) + + for k, v in hists.iteritems(): + v.Draw("hist") + c.SaveAs("{}/{}.pdf".format(outdir, k)) + + c.SetRightMargin(0.2) + c.SetTopMargin(0.1) + + for name, h2 in hm.hist2Diter(): + + parts = name.split("/") + print(parts) + if "z_r" in parts: + h2.Draw("colz") + draw_eta_lines(h2) + filename = "{}.pdf".format(os.path.join(outdir, name)) + mkdir(os.path.dirname(filename)) + c.SaveAs(filename) + + h2.Draw("colz") + geom_graph.Draw("p+same") + draw_eta_lines(h2) + filename = "{}_geom.pdf".format(os.path.join(outdir, name)) + mkdir(os.path.dirname(filename)) + c.SaveAs(filename) + + else: + h2.Draw("colz") + filename = "{}.pdf".format(os.path.join(outdir, name)) + mkdir(os.path.dirname(filename)) + c.SaveAs(filename) + + # for h2 in hist2D_zr: + # h2.Divide(hist2D_zr_count) + # h2.Draw("colz") + + # h2.GetXaxis().SetTitle("z [mm]") + # h2.GetYaxis().SetTitle("r [mm]") + + # draw_eta_lines(h2) + # c.SaveAs("{}/{}.pdf".format(args.outdir, h2.GetName())) + + # geom_graph.Draw("p+same") + # c.SaveAs("{}/{}_w_geom.pdf".format(args.outdir, h2.GetName())) + + # for h2 in hist2D_eta_phi: + # h2.Divide(hist2D_eta_phi_count) + # h2.Draw("colz") + # c.SaveAs("{}/{}.pdf".format(args.outdir, h2.GetName())) + + return layers + + +if "__main__" == __name__: + main() diff --git a/Tracking/Acts/ActsGeometry/scripts/plot_zshift.C b/Tracking/Acts/ActsGeometry/scripts/plot_zshift.C new file mode 100644 index 0000000000000000000000000000000000000000..6b1c192c7451dbfe083b89e32f47dbff37c05690 --- /dev/null +++ b/Tracking/Acts/ActsGeometry/scripts/plot_zshift.C @@ -0,0 +1,142 @@ +#include "TFile.h" +#include "TTree.h" +#include "TCanvas.h" +#include "TH2D.h" +#include "TH2F.h" +#include "TTreeReader.h" + +#include <iostream> +#include <string> + +#include "AtlasStyle.C" + +void plot_zshift(std::string fname) { + + SetAtlasStyle(); + + TCanvas c; + + auto infile = TFile::Open(fname.c_str()); + //TTree* tree = dynamic_cast<TTree*>(infile->Get("extrapolation_charged")); + + //std::cout << "tree = " << tree << std::endl; + + size_t slice_size = 3000; + + //tree->Draw("step_r:step_z>>slice1(1000, -1000, 1000, 200, 0, 200)", "sensitive", "", slice_size, 0); + //TH2F* slice1 = dynamic_cast<TH2F*>(gDirectory->Get("slice1")); + //std::cout << "slice1 = " << slice1 << std::endl; + //slice1->SetMarkerColor(kRed); + ////slice1->GetYaxis()->SetRange(0, 200); + ////slice1->Draw(); + + double zmin = 600, zmax = 800; + double zbinw = 5; + double rmin = 0, rmax = 200; + + TH1D zpos("zpos", "zpos", int(std::abs(zmax-zmin)/zbinw), zmin, zmax); + + TTreeReader rd("extrapolation_charged", infile); + TTreeReaderValue<std::vector<float>> step_r_vec(rd, "step_r"); + TTreeReaderValue<std::vector<float>> step_z_vec(rd, "step_z"); + TTreeReaderValue<std::vector<int>> sensitive_vec(rd, "sensitive"); + TTreeReaderValue<int> evtNum(rd, "evtNum"); + + size_t nEvents = rd.GetEntries(true); + + std::vector<TH2F> slices; + size_t nSlices = nEvents / slice_size; + std::cout << "nSlices = " << nSlices << std::endl; + for(size_t i=0;i<nSlices;i++) { + std::string hname = "slice_"+std::to_string(i+1); + slices.emplace_back(hname.c_str(), hname.c_str(), 1000, 400, 800, 600, 0, 200); + slices.back().SetMarkerSize(0.2); + slices.back().GetXaxis()->SetTitle("z [mm]"); + slices.back().GetYaxis()->SetTitle("r [mm]"); + } + + std::vector<EColor> colors = {kRed, kBlue, kGreen, kMagenta, kOrange}; + + std::vector<std::pair<int, double>> z_by_proc; + std::vector<std::pair<int, double>> z_by_evt; + + size_t n = 0; + while(rd.Next()) { + + + + size_t slice = (*evtNum) / slice_size; + //size_t slice = n / slice_size; + + //std::cout << "slice = " << slice << std::endl; + //if (slices.size() < slice+1) { + //} + + size_t nSteps = (*step_z_vec).size(); + //std::cout << "nSteps:: " << nSteps << std::endl; + + for (size_t j=0;j<nSteps;j++) { + bool sensitive = (*sensitive_vec).at(j) == 1; + double step_z = (*step_z_vec).at(j); + double step_r = (*step_r_vec).at(j); + + if (!sensitive) continue; + //slices.at(slice).Fill((*step_z).at(j), (*step_r).at(j)); + slices.at(slice).Fill(step_z, step_r); + + if (zmin < step_z && step_z < zmax && rmin < step_r && step_r < rmax) { + zpos.Fill(step_z); + + //g_z_n.SetPoint(g_z_n.GetN(), n, step_z); + //g_z_eN.SetPoint(g_z_eN.GetN(), *evtNum, step_z); + z_by_proc.emplace_back(n, step_z); + z_by_evt.emplace_back(*evtNum, step_z); + + } + } + + n++; + } + + for(size_t i=0;i<slices.size();i++) { + slices.at(i).SetMarkerColor(colors.at(i)); + if (i==0) slices.at(i).Draw(); + else slices.at(i).Draw("same"); + } + c.SaveAs("zshift_rz.pdf"); + + zpos.Draw(); + c.SaveAs("zshift.pdf"); + + auto cmp = [](const auto& i1, const auto& i2) { + return i1.first < i2.first; + }; + std::sort(z_by_proc.begin(), z_by_proc.end(), cmp); + std::sort(z_by_evt.begin(), z_by_evt.end(), cmp); + + TGraph g_z_proc; + TGraph g_z_evt; + + g_z_proc.GetXaxis()->SetTitle("n"); + g_z_proc.GetYaxis()->SetTitle("z [mm]"); + + g_z_proc.SetLineColor(kRed); + g_z_evt.SetLineColor(kGreen); + g_z_proc.SetMarkerColor(kRed); + g_z_evt.SetMarkerColor(kGreen); + + + g_z_proc.SetMarkerSize(0.2); + g_z_evt.SetMarkerSize(0.2); + + for(size_t i=0;i<z_by_proc.size();i++) { + g_z_proc.SetPoint(g_z_proc.GetN(), z_by_proc.at(i).first, z_by_proc.at(i).second); + g_z_evt.SetPoint(g_z_evt.GetN(), z_by_evt.at(i).first, z_by_evt.at(i).second); + } + + + g_z_proc.Draw("ap"); + g_z_evt.Draw("p+same"); + c.SaveAs("z_over_n.pdf"); + +} diff --git a/Tracking/Acts/ActsGeometry/share/ActsExtrapolationAlg.py b/Tracking/Acts/ActsGeometry/share/ActsExtrapolationAlg.py new file mode 100644 index 0000000000000000000000000000000000000000..ebd2e213cbe6e67f3529632e14bfcd2984449401 --- /dev/null +++ b/Tracking/Acts/ActsGeometry/share/ActsExtrapolationAlg.py @@ -0,0 +1,135 @@ +""" +This job options file will run an example extrapolation using the +Acts tracking geometry and the Acts extrapolation toolchain. +""" + +import os +import logging + +# Use Global flags and DetFlags. +from AthenaCommon.DetFlags import DetFlags +from AthenaCommon.GlobalFlags import globalflags + +from AthenaCommon.ConcurrencyFlags import jobproperties as jp +from AthenaCommon.Logging import log as msg +nThreads = jp.ConcurrencyFlags.NumThreads() +# for some reason, the synchronization fails if we run in ST... +if (nThreads < 1) : + msg.fatal('numThreads must be >0. Did you set the --threads=N option?') + sys.exit(AthenaCommon.ExitCodes.CONFIGURATION_ERROR) + +# Just the pixel and SCT +DetFlags.ID_setOn() +DetFlags.detdescr.pixel_setOn() +DetFlags.detdescr.SCT_setOn() + +# MC or data - affects which conditions database instance is used +globalflags.DataSource='geant4' + +# Select the geometry version. +globalflags.DetDescrVersion = 'ATLAS-R2-2016-00-00-00' + +# Initialize geometry +# THIS ACTUALLY DOES STUFF!! +from AtlasGeoModel import GeoModelInit +from AtlasGeoModel import SetGeometryVersion + +# For misalignments +from IOVDbSvc.CondDB import conddb +conddb.setGlobalTag('OFLCOND-SIM-00-00-00') +conddb.addOverride("/Indet/Align", "InDetAlign_R2_Nominal") + +## SET UP ALIGNMENT CONDITIONS ALGORITHM +from IOVSvc.IOVSvcConf import CondSvc +svcMgr += CondSvc( OutputLevel=INFO ) +from ActsGeometry import ActsGeometryConf +from AthenaCommon.AlgSequence import AthSequencer +condSeq = AthSequencer("AthCondSeq") + +# nominal alignment: all deltas are identity +condSeq += ActsGeometryConf.NominalAlignmentCondAlg("NominalAlignmentCondAlg", + OutputLevel=VERBOSE) + +# periodic shift alignment. Configurable z-shift per lumiblock. +# (currently pixel only) +# condSeq+=ActsGeometryConf.GeomShiftCondAlg("GeomShiftCondAlg_1", + # ZShiftPerLB=0.5, + # OutputLevel=VERBOSE) +## END OF CONDITIONS SETUP + + +from AthenaCommon.AppMgr import ServiceMgr + +# set up and configure the acts geometry construction +from ActsGeometry.ActsGeometryConfig import ActsTrackingGeometrySvc +trkGeomSvc = ActsTrackingGeometrySvc() +# used for the proxies during material mapping +trkGeomSvc.BarrelMaterialBins = [40, 60] # phi z +trkGeomSvc.EndcapMaterialBins = [50, 20] # phi r +trkGeomSvc.OutputLevel = INFO +ServiceMgr += trkGeomSvc + + +# We need the Magnetic fiels +import MagFieldServices.SetupField + +# setup the McEventSelector +# This enables pseudo LBs. Required for the conditions algorithms, +# and thus the whole extrapolation alg to work +import AthenaCommon.AtlasUnixGeneratorJob +svcMgr.EventSelector.FirstEvent=0 +svcMgr.EventSelector.RunNumber=1 +svcMgr.EventSelector.InitialTimeStamp=0 +svcMgr.EventSelector.TimeStampInterval=1 +svcMgr.EventSelector.FirstLB=1 +svcMgr.EventSelector.EventsPerLB = 100 + +from AthenaCommon.AthenaCommonFlags import athenaCommonFlags +athenaCommonFlags.PoolEvgenInput.set_Off() +athenaCommonFlags.EvtMax = 1 + +from AthenaCommon.AlgSequence import AlgSequence +job = AlgSequence() + + +# This is the main extrapolation demo algorithm +from ActsGeometry.ActsGeometryConf import ActsExtrapolationAlg +alg = ActsExtrapolationAlg() +alg.OutputLevel = INFO + +# not really needed right now (also not working) +# this can be used to test an input material map file +# alg.WriteMaterialTracks = False +# # we only need this if the extrap alg is set up to write mat tracks +# if alg.WriteMaterialTracks == True: + # mTrackWriterSvc = CfgMgr.ActsMaterialTrackWriterSvc("ActsMaterialTrackWriterSvc") + # mTrackWriterSvc.OutputLevel = DEBUG + # mTrackWriterSvc.FilePath = "MaterialTracks_mapped.root" + # ServiceMgr += mTrackWriterSvc + +# sets up the extrapolation tool +# this sets up the tracking geometry svc through the tracking geometry tool +exTool = CfgMgr.ActsExtrapolationTool("ActsExtrapolationTool") +exTool.OutputLevel = INFO +exTool.FieldMode = "ATLAS" + +# The extrapolation tool accesses the trackinggeometry service +# through this tool. This tool has the conditions dependencies +# on the alignment GeoAlignmentStores (pseudo-alignment only right now). +# For each event, the GAS for the IOV needs to be set from the algorithm. +trkGeomTool = CfgMgr.ActsTrackingGeometryTool("ActsTrackingGeometryTool") +trkGeomTool.OutputLevel = INFO; +exTool.TrackingGeometryTool = trkGeomTool + +alg.ExtrapolationTool = exTool + +# Make the event heardbeat output a bit nicer +eventPrintFrequency = 100 +if hasattr(ServiceMgr,"AthenaEventLoopMgr"): + ServiceMgr.AthenaEventLoopMgr.EventPrintoutInterval = eventPrintFrequency +if hasattr(ServiceMgr,"AthenaHiveEventLoopMgr"): + ServiceMgr.AthenaHiveEventLoopMgr.EventPrintoutInterval = eventPrintFrequency + +job += alg + +theApp.EvtMax = 1234 diff --git a/Tracking/Acts/ActsGeometry/share/ActsMaterialMapping_jobOptions.py b/Tracking/Acts/ActsGeometry/share/ActsMaterialMapping_jobOptions.py new file mode 100644 index 0000000000000000000000000000000000000000..6283e09a0e480e0e1f1bb99cbfdb3af71915cf3c --- /dev/null +++ b/Tracking/Acts/ActsGeometry/share/ActsMaterialMapping_jobOptions.py @@ -0,0 +1,127 @@ +############################################################### +# +# Loads Detector Description for Pixel and SCT +# and prints out various quanities for each detector element. +# +############################################################### + + +# Use Global flags and DetFlags. +from AthenaCommon.DetFlags import DetFlags +from AthenaCommon.GlobalFlags import globalflags + +from AthenaCommon.ConcurrencyFlags import jobproperties as jp +nThreads = jp.ConcurrencyFlags.NumThreads() +ServiceMgr.MessageSvc.defaultLimit = 20000 + +# Just the pixel and SCT +DetFlags.ID_setOn() +DetFlags.detdescr.pixel_setOn() +DetFlags.detdescr.SCT_setOn() + + +# MC or data - affects which conditions database instance is used +globalflags.DataSource='geant4' +#globalflags.DataSource='data' + +# Select the geometry version. +globalflags.DetDescrVersion = 'ATLAS-R2-2016-00-00-00' + +# print "HERE" +# print globalflags.DetDescrVersion + +# LorentzAngle Svc needs field now +import MagFieldServices.SetupField + +# Initialize geometry +# THIS ACTUALLY DOES STUFF!! +from AtlasGeoModel import GeoModelInit +from AtlasGeoModel import SetGeometryVersion + +# For misalignments +from IOVDbSvc.CondDB import conddb +conddb.setGlobalTag('OFLCOND-SIM-00-00-00') +# conddb.addOverride("/Indet/Align", "InDetAlign_R2_Nominal") + +import glob +fileList = glob.glob("*root*") #/tmp/salzburg/*/*.root*") + +from AthenaCommon.AppMgr import ServiceMgr + +# Read material step file +import AthenaPoolCnvSvc.ReadAthenaPool +ServiceMgr.EventSelector.InputCollections = ["MaterialStepFile_1e6.root"] + + + +from AthenaCommon.AlgScheduler import AlgScheduler +AlgScheduler.OutputLevel( INFO ) +AlgScheduler.ShowControlFlow( True ) +AlgScheduler.ShowDataDependencies( True ) +AlgScheduler.EnableConditions( True ) +# AlgScheduler.setDataLoaderAlg( "SGInputLoader" ) + + +from IOVSvc.IOVSvcConf import CondSvc +svcMgr += CondSvc( OutputLevel=INFO ) + +# ServiceMgr += CfgMgr.THistSvc() +# ServiceMgr.THistSvc.Output += ["MATTRACKVAL DATAFILE='MaterialTracks.root' OPT='RECREATE'"] +# ServiceMgr.ToolSvc.OutputLevel = VERBOSE + +# Set up ACTS tracking geometry service +from ActsGeometry.ActsGeometryConfig import TrackingGeometrySvc +trkGeomSvc = TrackingGeometrySvc() +trkGeomSvc.OutputLevel = INFO +trkGeomSvc.BarrelMaterialBins = [40, 60] # phi z +trkGeomSvc.EndcapMaterialBins = [50, 20] # phi r +ServiceMgr += trkGeomSvc + +# Set up ACTS extrapolation cell writer service +exCellWriterSvc = CfgMgr.Acts__ExCellWriterSvc("ExCellWriterSvc") +exCellWriterSvc.FilePath = "excells_charged_mapping.root" +ServiceMgr += exCellWriterSvc + +mTrackWriterSvc = CfgMgr.Acts__MaterialTrackWriterSvc("MaterialTrackWriterSvc") +mTrackWriterSvc.OutputLevel = DEBUG +mTrackWriterSvc.FilePath = "MaterialTracks_mapping.root" +# mTrackWriterSvc.MaxQueueSize = 10 +ServiceMgr += mTrackWriterSvc + +from ActsGeometry import ActsGeometryConf + +## SET UP ALIGNMENT CONDITIONS ALGORITHM +from AthenaCommon.AlgSequence import AthSequencer +condSeq = AthSequencer("AthCondSeq") +condSeq += ActsGeometryConf.NominalAlignmentCondAlg("NominalAlignmentCondAlg", + OutputLevel=VERBOSE) +## END OF CONDITIONS SETUP + +# Set up algorithm sequence +from AthenaCommon.AlgSequence import AlgSequence +job = AlgSequence() + +eventPrintFrequency = 1000 + +if hasattr(ServiceMgr,"AthenaEventLoopMgr"): + ServiceMgr.AthenaEventLoopMgr.EventPrintoutInterval = eventPrintFrequency +if hasattr(ServiceMgr,"AthenaHiveEventLoopMgr"): + ServiceMgr.AthenaHiveEventLoopMgr.EventPrintoutInterval = eventPrintFrequency + +# from GaudiAlg.GaudiAlgConf import EventCounter +# job += EventCounter(Frequency=1000) + +# Set up material mapping algorithm +from ActsGeometry.ActsGeometryConf import ActsMaterialMapping + +alg = ActsMaterialMapping() +alg.Cardinality = 0#nThreads +alg.OutputLevel = VERBOSE +alg.ExtrapolationTool.FieldMode = "Constant" +alg.ExtrapolationTool.ConstantFieldVector = [0, 0, 0] +alg.ExtrapolationTool.OutputLevel = INFO + + +alg.OutputLevel = INFO +job += alg + diff --git a/Tracking/Acts/ActsGeometry/share/ActsWriteTrackingGeometry.py b/Tracking/Acts/ActsGeometry/share/ActsWriteTrackingGeometry.py new file mode 100644 index 0000000000000000000000000000000000000000..face86722879c663b39c3d6aa64530e1f408cc35 --- /dev/null +++ b/Tracking/Acts/ActsGeometry/share/ActsWriteTrackingGeometry.py @@ -0,0 +1,62 @@ +# Use Global flags and DetFlags. +from AthenaCommon.DetFlags import DetFlags +from AthenaCommon.GlobalFlags import globalflags + +# Just the pixel and SCT +DetFlags.ID_setOn() +DetFlags.detdescr.pixel_setOn() +DetFlags.detdescr.SCT_setOn() + +# MC or data - affects which conditions database instance is used +globalflags.DataSource='geant4' +#globalflags.DataSource='data' + +# Select the geometry version. +globalflags.DetDescrVersion = 'ATLAS-R2-2016-00-00-00' + +# LorentzAngle Svc needs field now +import MagFieldServices.SetupField + +# THIS ACTUALLY DOES STUFF!! +from AtlasGeoModel import GeoModelInit +from AtlasGeoModel import SetGeometryVersion + +# For misalignments +from IOVDbSvc.CondDB import conddb +conddb.setGlobalTag('OFLCOND-SIM-00-00-00') +conddb.addOverride("/Indet/Align", "InDetAlign_R2_Nominal") + +from IOVSvc.IOVSvcConf import CondSvc +svcMgr += CondSvc( OutputLevel=INFO ) +from ActsGeometry import ActsGeometryConf +from AthenaCommon.AlgSequence import AthSequencer +condSeq = AthSequencer("AthCondSeq") +condSeq += ActsGeometryConf.NominalAlignmentCondAlg("NominalAlignmentCondAlg", + OutputLevel=VERBOSE) + +from AthenaCommon.AppMgr import ServiceMgr +from ActsGeometry.ActsGeometryConfig import ActsTrackingGeometrySvc +ServiceMgr = ActsTrackingGeometrySvc() + +from AthenaCommon.AlgSequence import AlgSequence +job = AlgSequence() + +from ActsGeometry.ActsGeometryConf import ActsWriteTrackingGeometry +alg = ActsWriteTrackingGeometry(OutputLevel = VERBOSE) + +trkGeomTool = CfgMgr.ActsTrackingGeometryTool("ActsTrackingGeometryTool") +trkGeomTool.OutputLevel = INFO; +alg.TrackingGeometryTool = trkGeomTool + +alg.ObjWriterTool.OutputDirectory = "obj" +alg.ObjWriterTool.SubDetectors = [ + "Pixel", + "SCT", + "TRT", +] + + +job += alg + +theApp.EvtMax = 1 + diff --git a/Tracking/Acts/ActsGeometry/share/GeantinoMapping_jobOptions.py b/Tracking/Acts/ActsGeometry/share/GeantinoMapping_jobOptions.py new file mode 100644 index 0000000000000000000000000000000000000000..992f16b3a0995b019e6ba04f83e7f5944a8fc41e --- /dev/null +++ b/Tracking/Acts/ActsGeometry/share/GeantinoMapping_jobOptions.py @@ -0,0 +1,147 @@ +# +# This is based on Tracking/TrkG4Components/TrkG4UserActions/share/GeantinoMapping_jobOptions.py +# Copied 11/04/2018 +# + + +#============================================================== +# +# +# This job option runs the G4 simulation +# of the ATLAS detector and the GeantinoMapping. +# It can be run using athena.py +# + +#--- Algorithm sequence --------------------------------------- +from AthenaCommon.AlgSequence import AlgSequence +topSeq = AlgSequence() + +#--- Output threshold (DEBUG, INFO, WARNING, ERROR, FATAL) ---- +#from AthenaCommon.AppMgr import ServiceMgr +ServiceMgr.MessageSvc.OutputLevel = INFO +ServiceMgr.MessageSvc.defaultLimit = 20000 + +#--- Detector flags ------------------------------------------- +from AthenaCommon.DetFlags import DetFlags +from AthenaCommon.GlobalFlags import globalflags + +import random +import time + +### pass arguments with athena -c "..." ...jobOptions.py: +if 'myMomentum' not in dir() : + myMomentum = 10000 + +if 'myRandomOffset' not in dir() : + myRandomOffset = int(random.uniform(0,time.time())*0.001 ) + +if 'myRandomSeed1' not in dir() : + myRandomSeed1 = int(random.uniform(0,time.time())) + +if 'myRandomSeed2' not in dir() : + myRandomSeed2 = int(random.uniform(0,time.time())) + +if 'myMaxEvent' not in dir() : + myMaxEvent = 10 + +if 'myPt' not in dir() : + myPt = 'pt' # values are 'p' or 'pt' + +if 'myGeo' not in dir() : + myGeo = 'ATLAS-R2-2016-00-00-00' + +print 'Random seeds and offset as calcluated by jobOptions ', myRandomSeed1, ' ', myRandomSeed2, ' offset - ', myRandomOffset + + +# Set everything to ATLAS +DetFlags.ID_setOn() +DetFlags.Calo_setOff() +DetFlags.Muon_setOff() +# the global flags +globalflags.ConditionsTag = 'OFLCOND-SIM-00-00-00' +print globalflags.ConditionsTag + + +#--- AthenaCommon flags --------------------------------------- +from AthenaCommon.AthenaCommonFlags import athenaCommonFlags +athenaCommonFlags.PoolEvgenInput.set_Off() ### is this necessary? +athenaCommonFlags.PoolHitsOutput = 'Hits.pool.root' +athenaCommonFlags.EvtMax = 1000 + +#--- Simulation flags ----------------------------------------- +from G4AtlasApps.SimFlags import simFlags +simFlags.load_atlas_flags() # Going to use an ATLAS layout +simFlags.SimLayout = myGeo +simFlags.EventFilter.set_Off() + +myMinEta = -6.0 +myMaxEta = 6.0 + +myPDG = 999 # 999 = Geantinos, 13 = Muons + +include("GeneratorUtils/StdEvgenSetup.py") +theApp.EvtMax = 1000 + +import ParticleGun as PG +pg = PG.ParticleGun() +pg.sampler.pid = 999 +pg.randomSeed = 123456 +pg.sampler.mom = PG.EEtaMPhiSampler(energy=10000, eta=[-6.,6.]) +topSeq += pg + +simFlags.RandomSeedOffset = myRandomOffset +simFlags.RandomSeedList.addSeed( "SINGLE", myRandomSeed1, myRandomSeed2 ) + +from RngComps.RngCompsConf import AtRndmGenSvc +myAtRndmGenSvc = AtRndmGenSvc() +myAtRndmGenSvc.Seeds = ["SINGLE "+str(myRandomSeed1)+" "+str(myRandomSeed2) ] +myAtRndmGenSvc.OutputLevel = VERBOSE +myAtRndmGenSvc.EventReseeding = False +ServiceMgr += myAtRndmGenSvc + +# from TrkG4UserActions.TrkG4UserActionsConfig import getMaterialStepRecorderTool +# from AthenaCommon.CfgGetter import addTool +# addTool("TrkG4UserActions.TrkG4UserActionsConfig.getMaterialStepRecorderTool", "G4UA::MaterialStepRecorderTool") + + +# matStepRecTool = CfgMgr.G4UA__MaterialStepRecorderTool('G4UA::MaterialStepRecorderTool') +# matStepRecTool = getMaterialStepRecorderTool() +# toolSvc = CfgMgr.ToolSvc() +# toolSvc += matStepRecTool + +# from G4AtlasServices.G4AtlasUserActionConfig import getUserActionSvc +# ServiceMgr += getUserActionSvc() + +# add the material step recording action +simFlags.OptionalUserActionList.addAction('G4UA::MaterialStepRecorderTool') + + + +# simFlags.UseV2UserActions = True +# simFlags.OptionalUserActionList.addAction('G4UA::MaterialStepRecorderTool',['BeginOfRun','BeginOfEvent','EndOfEvent','Step']) + +############### The Material hit collection ################## + +from AthenaPoolCnvSvc.WriteAthenaPool import AthenaPoolOutputStream +# --- check dictionary +ServiceMgr.AthenaSealSvc.CheckDictionary = True +# --- commit interval (test) +ServiceMgr.AthenaPoolCnvSvc.OutputLevel = DEBUG +ServiceMgr.AthenaPoolCnvSvc.CommitInterval = 10 +MaterialStream = AthenaPoolOutputStream ( 'MaterialStream' ) +MaterialStream.OutputFile = "MaterialStepFile.root" +MaterialStream.ItemList += [ 'Trk::MaterialStepCollection#*'] + +############################################################## + +include("G4AtlasApps/G4Atlas.flat.configuration.py") + +# Add the beam effects algorithm +from AthenaCommon.CfgGetter import getAlgorithm +topSeq += getAlgorithm("BeamEffectsAlg", tryDefaultConfigurable=True) + +## Populate alg sequence +topSeq += getAlgorithm("G4AtlasAlg",tryDefaultConfigurable=True) + +#--- End jobOptions.GeantinoMapping.py file ------------------------------ + diff --git a/Tracking/Acts/ActsGeometry/src/ActsAlignmentStore.cxx b/Tracking/Acts/ActsGeometry/src/ActsAlignmentStore.cxx new file mode 100644 index 0000000000000000000000000000000000000000..5c988ce83c08028d1196a7ca7f1f8516845e9b41 --- /dev/null +++ b/Tracking/Acts/ActsGeometry/src/ActsAlignmentStore.cxx @@ -0,0 +1,24 @@ +/* + Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration +*/ + +#include "ActsGeometry/ActsAlignmentStore.h" + +#include "ActsGeometry/ActsDetectorElement.h" + +#include "Acts/Utilities/Definitions.hpp" + + +void +ActsAlignmentStore::setTransform(const ActsDetectorElement* ade, const Acts::Transform3D& xf) +{ + if(!m_transforms.setTransform(ade, xf)) { + throw ExcAlignmentStore("Attempted to overwrite Delta in the Alignment Store"); + } +} + +const Acts::Transform3D* +ActsAlignmentStore::getTransform(const ActsDetectorElement* ade) const +{ + return m_transforms.getTransform(ade); +} diff --git a/Tracking/Acts/ActsGeometry/src/ActsDetectorElement.cxx b/Tracking/Acts/ActsGeometry/src/ActsDetectorElement.cxx new file mode 100644 index 0000000000000000000000000000000000000000..2a594b6a4ae52734b1d0fb7b74beb8d941b16db7 --- /dev/null +++ b/Tracking/Acts/ActsGeometry/src/ActsDetectorElement.cxx @@ -0,0 +1,247 @@ +/* + Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration +*/ + +#include "ActsGeometry/ActsDetectorElement.h" + +// ATHENA +#include "InDetReadoutGeometry/TRT_EndcapElement.h" +#include "InDetReadoutGeometry/TRT_BarrelElement.h" +#include "ActsInterop/IdentityHelper.h" +#include "TrkSurfaces/RectangleBounds.h" +#include "TrkSurfaces/SurfaceBounds.h" +#include "TrkSurfaces/TrapezoidBounds.h" +#include "GeoPrimitives/CLHEPtoEigenConverter.h" + +// PACKAGE +#include "ActsGeometry/ActsTrackingGeometrySvc.h" +#include "ActsGeometry/ActsAlignmentStore.h" + +// ACTS +#include "Acts/Surfaces/StrawSurface.hpp" +#include "Acts/Surfaces/LineBounds.hpp" +#include "Acts/Surfaces/PlaneSurface.hpp" +#include "Acts/Surfaces/RectangleBounds.hpp" +#include "Acts/Surfaces/TrapezoidBounds.hpp" + +// STL +#include <mutex> + +// BOOST +#include <boost/variant.hpp> +#include <boost/variant/get.hpp> + + +using Acts::Transform3D; +using Acts::Surface; + +ActsDetectorElement::ActsDetectorElement( + const InDetDD::SiDetectorElement* detElem, + const ActsTrackingGeometrySvc* trkSvc) + : m_trackingGeometrySvc(trkSvc) +{ + m_detElement = detElem; + + //auto center = detElem->center(); + auto boundsType = detElem->bounds().type(); + + // thickness + m_thickness = detElem->thickness(); + + if (boundsType == Trk::SurfaceBounds::Rectangle) { + + const InDetDD::SiDetectorDesign &design = detElem->design(); + double hlX = design.width()/2.; + double hlY = design.length()/2.; + + auto rectangleBounds = std::make_shared<const Acts::RectangleBounds>( + hlX, hlY); + + m_bounds = rectangleBounds; + + m_surface + = std::make_shared<const Acts::PlaneSurface>(rectangleBounds, *this); + + } else if (boundsType == Trk::SurfaceBounds::Trapezoid) { + + std::string shapeString = detElem->getMaterialGeom()->getLogVol()->getShape()->type(); + //std::cout << __FUNCTION__ << "tapezoid, GeoLogVol -> shape says: " << shapeString << std::endl; + + const InDetDD::SiDetectorDesign &design = detElem->design(); + + double minHlX = design.minWidth()/2.; + double maxHlX = design.maxWidth()/2.; + double hlY = design.length()/2.; + + auto trapezoidBounds = std::make_shared<const Acts::TrapezoidBounds>( + minHlX, maxHlX, hlY); + + m_bounds = trapezoidBounds; + + m_surface + = std::make_shared<const Acts::PlaneSurface>(trapezoidBounds, *this); + + } else { + throw std::domain_error("ActsDetectorElement does not support this surface type"); + } +} + +ActsDetectorElement::ActsDetectorElement( + std::shared_ptr<const Transform3D> trf, + const InDetDD::TRT_BaseElement* detElem, + const Identifier& id, + const ActsTrackingGeometrySvc* trkSvc) + : m_trackingGeometrySvc(trkSvc) +{ + m_detElement = detElem; + m_defTransform = trf; + m_explicitIdentifier = id; + + // we know this is a straw + double length = detElem->strawLength()/2.; + + // we need to find the radius + auto ecElem = dynamic_cast<const InDetDD::TRT_EndcapElement*>(detElem); + auto brlElem = dynamic_cast<const InDetDD::TRT_BarrelElement*>(detElem); + double innerTubeRadius; + if (ecElem) { + innerTubeRadius = ecElem->getDescriptor()->innerTubeRadius(); + } + else { + innerTubeRadius = brlElem->getDescriptor()->innerTubeRadius(); + } + + auto lineBounds = std::make_shared<const Acts::LineBounds>(innerTubeRadius, length); + m_bounds = lineBounds; + + auto straw = std::make_shared<const Acts::StrawSurface>(lineBounds, *this); + m_surface = straw; +} + +IdentityHelper +ActsDetectorElement::identityHelper() const +{ + size_t which = m_detElement.which(); + if (which == 0) { + return IdentityHelper(boost::get<const InDetDD::SiDetectorElement*>(m_detElement)); + } else { + throw std::domain_error("Cannot get IdentityHelper for TRT element"); + } +} + +const Acts::Transform3D& +ActsDetectorElement::transform() const +{ + + + auto ctx = Gaudi::Hive::currentContext(); + + if (!ctx.valid()) { + // this is really only the case single threaded, but let's be safe and lock it down + // also, we're not super afraid about performance here + return getDefaultTransformMutexed(); + } + + // retrieve GAS from tracking geometry svc + const ActsAlignmentStore* alignmentStore = m_trackingGeometrySvc->getAlignmentStore(ctx); + + // no GAS, is this initialization? + if (alignmentStore == nullptr) { + throw std::runtime_error("ActsAlignmentStore could not be found for valid context."); + } + + const Transform3D* cachedTrf = alignmentStore->getTransform(this); + if (cachedTrf == nullptr) { + throw std::runtime_error("Detector transform not found in ActsAlignmentStore."); + } + + return *cachedTrf; +} + +void +ActsDetectorElement::storeTransform(ActsAlignmentStore* gas) const +{ + struct get_transform : public boost::static_visitor<Transform3D> + { + get_transform(ActsAlignmentStore* gas, const Transform3D* trtTrf) + : m_store(gas), m_trtTrf(trtTrf) {} + + Transform3D operator()(const InDetDD::SiDetectorElement* detElem) const + { + HepGeom::Transform3D g2l + = detElem->getMaterialGeom()->getAbsoluteTransform(m_store); + + return Amg::CLHEPTransformToEigen(g2l * detElem->recoToHitTransform()); + } + + Transform3D operator()(const InDetDD::TRT_BaseElement*) const + { + return *m_trtTrf; + } + + ActsAlignmentStore* m_store; + const Transform3D* m_trtTrf; + }; + + Transform3D trf + = boost::apply_visitor(get_transform(gas, m_defTransform.get()), m_detElement); + + gas->setTransform(this, trf); + if (gas->getTransform(this) == nullptr) { + throw std::runtime_error("Detector element was unable to store transform in GAS"); + } + +} + +const Acts::Transform3D& +ActsDetectorElement::getDefaultTransformMutexed() const +{ + struct get_default_transform : public boost::static_visitor<Transform3D> + { + get_default_transform(const Transform3D* trtTrf) : m_trtTrf(trtTrf) {} + + Transform3D operator()(const InDetDD::SiDetectorElement* detElem) const + { + HepGeom::Transform3D g2l + = detElem->getMaterialGeom()->getDefAbsoluteTransform(); + + return Amg::CLHEPTransformToEigen(g2l * detElem->recoToHitTransform()); + } + + Transform3D operator()(const InDetDD::TRT_BaseElement*) const + { + return *m_trtTrf; + } + + const Transform3D* m_trtTrf; + }; + + std::lock_guard<std::mutex> guard(m_cacheMutex); + if (m_defTransform) { + return *m_defTransform; + } + // transform not yet set + m_defTransform + = std::make_shared<const Transform3D>( + boost::apply_visitor(get_default_transform(m_defTransform.get()), m_detElement)); + + return *m_defTransform; +} + +const Acts::Surface& +ActsDetectorElement::surface() const +{ + return (*m_surface); +} + +double +ActsDetectorElement::thickness() const +{ + return m_thickness; +} + +Identifier +ActsDetectorElement::identify() const +{ + return boost::apply_visitor(IdVisitor(m_explicitIdentifier), m_detElement); +} diff --git a/Tracking/Acts/ActsGeometry/src/ActsExCellWriterSvc.cxx b/Tracking/Acts/ActsGeometry/src/ActsExCellWriterSvc.cxx new file mode 100644 index 0000000000000000000000000000000000000000..6fb03c0a3e3b71c67e9a2aea91d68241df061c62 --- /dev/null +++ b/Tracking/Acts/ActsGeometry/src/ActsExCellWriterSvc.cxx @@ -0,0 +1,138 @@ +/* + Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration +*/ + +#include "ActsGeometry/ActsExCellWriterSvc.h" +#include "GaudiKernel/IInterface.h" + +#include <vector> +#include <deque> +#include <mutex> +#include <thread> + +#include "util/RootExCellWriter.h" + +ActsExCellWriterSvc::ActsExCellWriterSvc( const std::string& name, ISvcLocator* svc ) +: base_class(name, svc) { +} + +StatusCode +ActsExCellWriterSvc::initialize() +{ + RootExCellWriter<Acts::TrackParameters>::Config reccWriterConfig; + reccWriterConfig.filePath = m_filePath; + reccWriterConfig.treeName = m_treeName; + reccWriterConfig.writeBoundary = m_writeBoundary; + reccWriterConfig.writeMaterial = m_writeMaterial; + reccWriterConfig.writeSensitive = m_writeSensitive; + reccWriterConfig.writePassive = m_writePassive; + m_rootEccWriter + = std::make_shared<RootExCellWriter<Acts::TrackParameters>>( + reccWriterConfig); + + ATH_MSG_INFO("Starting writer thread"); + m_doEnd = false; + m_writeThread = std::thread(&ActsExCellWriterSvc::doWrite, this); + + return StatusCode::SUCCESS; +} + +StatusCode +ActsExCellWriterSvc::finalize() +{ + ATH_MSG_INFO("Waiting for writer thread to finish."); + m_doEnd = true; + m_writeThread.join(); + ATH_MSG_INFO("Writer thread has terminated."); + + return StatusCode::SUCCESS; +} + +void +ActsExCellWriterSvc::store(std::vector<Acts::ExtrapolationCell<Acts::TrackParameters>>& ecells) +{ + + auto ctx = Gaudi::Hive::currentContext(); + + std::lock_guard<std::mutex> lock(m_chargedMutex); + + for(size_t i=0;i<ecells.size();++i) { + m_queue.emplace_back(ctx.eventID().event_number(), std::move(ecells[i])); + } +} + +void +ActsExCellWriterSvc::doWrite() +{ + using namespace std::chrono_literals; + // wait until we have events + while(m_queue.size() == 0) { + std::this_thread::sleep_for(2s); + if (m_doEnd) return; + } + + while(true) { + std::unique_lock<std::mutex> lock(m_chargedMutex); + + if (m_queue.empty()) { + lock.unlock(); + if (!m_doEnd) { + std::this_thread::sleep_for(0.5s); + continue; + } else { + ATH_MSG_INFO("Writer thread caught termination signal. Shutting down."); + m_rootEccWriter->endRun(); + return; + } + } + + queue_item_t queue_item = std::move(m_queue.front()); + m_queue.pop_front(); + + lock.unlock(); + + size_t eventNum = queue_item.first; + ExCellCharged ecell = std::move(queue_item.second); + + m_rootEccWriter->write(ecell, eventNum); + } + + //std::vector<ExCellCharged> writeBuffer; + + //while(true) { + //std::unique_lock<std::mutex> lock(m_chargedMutex); + //if (m_exCells.size() < 1000 && !m_doEnd) { + //lock.unlock(); + //std::this_thread::sleep_for(0.2s); + //continue; + //} + + //// have more some events + //writeBuffer.reserve(m_exCells.size()); + //while(!m_exCells.empty()) { + //writeBuffer.push_back(std::move(m_exCells.front())); + //m_exCells.pop_front(); + //} + + //// emptied, can unlock + //lock.unlock(); + + //// now do the write + //for(auto &ecell : writeBuffer) { + //m_rootEccWriter->write(std::move(ecell)); + //} + //writeBuffer.clear(); + + //if (m_doEnd) { + //lock.lock(); + //while(!m_exCells.empty()) { + //m_rootEccWriter->write(std::move(m_exCells.front())); + //m_exCells.pop_front(); + //} + //lock.unlock(); + //break; + //} + + //} + +} diff --git a/Tracking/Acts/ActsGeometry/src/ActsExtrapolationAlg.cxx b/Tracking/Acts/ActsGeometry/src/ActsExtrapolationAlg.cxx new file mode 100755 index 0000000000000000000000000000000000000000..f3b6efd85c0d10ea1ad21ede143aa2d5852a1f0e --- /dev/null +++ b/Tracking/Acts/ActsGeometry/src/ActsExtrapolationAlg.cxx @@ -0,0 +1,146 @@ +/* + Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration +*/ + +#include "ActsGeometry/ActsExtrapolationAlg.h" + +// ATHENA +#include "MagFieldInterfaces/IMagFieldSvc.h" +#include "AthenaKernel/RNGWrapper.h" +#include "Acts/Utilities/Logger.hpp" +#include "Acts/Surfaces/PerigeeSurface.hpp" +#include "GaudiKernel/EventContext.h" +#include "GaudiKernel/ISvcLocator.h" +#include "AthenaKernel/IAthRNGSvc.h" + +// ACTS +#include "Acts/Plugins/MaterialMapping/MaterialTrack.hpp" +#include "Acts/Utilities/Helpers.hpp" +#include "Acts/Propagator/detail/SteppingLogger.hpp" +#include "ActsGeometry/IActsPropStepRootWriterSvc.h" + +// PACKAGE +#include "ActsGeometry/ActsExtrapolationTool.h" +#include "ActsInterop/Logger.h" +#include "ActsGeometry/IActsMaterialTrackWriterSvc.h" + +// OTHER +#include "CLHEP/Random/RandomEngine.h" + +// STL +#include <string> +#include <fstream> + + +ActsExtrapolationAlg::ActsExtrapolationAlg(const std::string& name, + ISvcLocator* pSvcLocator) + : AthReentrantAlgorithm(name, pSvcLocator), + m_propStepWriterSvc("ActsPropStepRootWriterSvc", name), + m_rndmGenSvc("AthRNGSvc", name), + m_materialTrackWriterSvc("ActsMaterialTrackWriterSvc", name) +{ +} + +StatusCode ActsExtrapolationAlg::initialize() { + + ATH_MSG_DEBUG(name() << "::" << __FUNCTION__); + + ATH_CHECK( m_rndmGenSvc.retrieve() ); + ATH_CHECK( m_extrapolationTool.retrieve() ); + ATH_CHECK( m_propStepWriterSvc.retrieve() ); + + if (m_writeMaterialTracks) { + ATH_CHECK( m_materialTrackWriterSvc.retrieve() ); + } + + m_objOut = std::make_unique<std::ofstream>("steps.obj"); + + return StatusCode::SUCCESS; +} + +StatusCode ActsExtrapolationAlg::execute_r(const EventContext& ctx) const +{ + + ATH_MSG_VERBOSE(name() << "::" << __FUNCTION__); + + m_extrapolationTool->prepareAlignment(); + ATHRNG::RNGWrapper* rngWrapper = m_rndmGenSvc->getEngine(this); + rngWrapper->setSeed( name(), ctx ); + CLHEP::HepRandomEngine* rngEngine = rngWrapper->getEngine(ctx); + + // one particle per event for now + // since the ATLAS ParticleGun seems not to work on MT, we roll + // our own for now. + double d0 = 0; + double z0 = 0; + double phi = rngEngine->flat() * 2*M_PI - M_PI; + std::vector<double> etaRange = m_etaRange; + double etaMin = etaRange.at(0); + double etaMax = etaRange.at(1); + double eta = rngEngine->flat() * std::abs(etaMax - etaMin) + etaMin; + + std::vector<double> ptRange = m_ptRange; + double ptMin = ptRange.at(0) * Acts::units::_GeV; + double ptMax = ptRange.at(1) * Acts::units::_GeV; + + double pt = rngEngine->flat() * std::abs(ptMax - ptMin) + ptMin; + + Acts::Vector3D momentum( + pt * std::cos(phi), pt * std::sin(phi), pt * std::sinh(eta)); + + double theta = Acts::VectorHelpers::theta(momentum); + + double charge = rngEngine->flat() > 0.5 ? -1 : 1; + + double qop = charge / momentum.norm(); + + Acts::PerigeeSurface surface(Acts::Vector3D(0, 0, 0)); + + + Acts::ActsVectorD<5> pars; + pars << d0, z0, phi, theta, qop; + std::unique_ptr<Acts::ActsSymMatrixD<5>> cov = nullptr; + + std::vector<Acts::detail::Step> steps; + + if(charge != 0.) { + // charged extrapolation - with hit recording + Acts::BoundParameters startParameters( + std::move(cov), std::move(pars), surface); + steps = m_extrapolationTool->propagate(startParameters); + writeStepsObj(steps); + m_propStepWriterSvc->write(steps); + } + + + + + + ATH_MSG_VERBOSE(name() << " execute done"); + + return StatusCode::SUCCESS; +} + +StatusCode ActsExtrapolationAlg::finalize() { + return StatusCode::SUCCESS; +} + +void ActsExtrapolationAlg::writeStepsObj(std::vector<Acts::detail::Step> steps) const +{ + std::lock_guard<std::mutex> lock(m_writeMutex); + + std::ofstream& out = *m_objOut; + std::stringstream lstr; + lstr << "l"; + for(const auto& step : steps) { + const auto& pos = step.position; + out << "v " << pos.x() << " " << pos.y() << " " << pos.z() << std::endl; + lstr << " " << m_objVtxCount; + m_objVtxCount++; + } + + lstr << std::endl; + + out << lstr.str() << std::endl; +} + diff --git a/Tracking/Acts/ActsGeometry/src/ActsExtrapolationTool.cxx b/Tracking/Acts/ActsGeometry/src/ActsExtrapolationTool.cxx new file mode 100644 index 0000000000000000000000000000000000000000..2a2fd77ac63886ac99b1822c09d3d577d0388023 --- /dev/null +++ b/Tracking/Acts/ActsGeometry/src/ActsExtrapolationTool.cxx @@ -0,0 +1,84 @@ +/* + Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration +*/ + +#include "ActsGeometry/ActsExtrapolationTool.h" + +// ATHENA +#include "GaudiKernel/IInterface.h" +#include "MagFieldInterfaces/IMagFieldSvc.h" + +// PACKAGE +#include "ActsGeometry/ActsTrackingGeometrySvc.h" +#include "ActsInterop/Logger.h" +#include "ActsGeometry/ActsTrackingGeometryTool.h" + +// ACTS +#include "Acts/Surfaces/Surface.hpp" +#include "Acts/Surfaces/BoundaryCheck.hpp" +#include "Acts/Extrapolator/Navigator.hpp" +#include "Acts/Propagator/EigenStepper.hpp" +#include "Acts/Propagator/Propagator.hpp" + + +// STL +#include <iostream> +#include <memory> + +ActsExtrapolationTool::ActsExtrapolationTool(const std::string& type, const std::string& name, + const IInterface* parent) + : AthAlgTool(type, name, parent), + m_fieldServiceHandle("AtlasFieldSvc", name) +{ + +} + +StatusCode +ActsExtrapolationTool::initialize() +{ + using namespace std::literals::string_literals; + + + ATH_MSG_INFO("Initializing ACTS extrapolation"); + + ATH_CHECK( m_trackingGeometryTool.retrieve() ); + std::shared_ptr<const Acts::TrackingGeometry> trackingGeometry + = m_trackingGeometryTool->trackingGeometry(); + + Acts::Navigator navigator(trackingGeometry); + + if (m_fieldMode == "ATLAS"s) { + // we need the field service + ATH_CHECK( m_fieldServiceHandle.retrieve() ); + ATH_MSG_INFO("Using ATLAS magnetic field service"); + using BField_t = ATLASMagneticFieldWrapper; + BField_t bField(m_fieldServiceHandle.get()); + auto stepper = Acts::EigenStepper<BField_t>(std::move(bField)); + auto propagator = Acts::Propagator<decltype(stepper), Acts::Navigator>(std::move(stepper), + std::move(navigator)); + m_varProp = std::make_unique<VariantPropagator>(propagator); + } + else if (m_fieldMode == "Constant") { + std::vector<double> constantFieldVector = m_constantFieldVector; + double Bx = constantFieldVector.at(0); + double By = constantFieldVector.at(1); + double Bz = constantFieldVector.at(2); + ATH_MSG_INFO("Using constant magnetic field: (Bx, By, Bz) = (" << Bx << ", " << By << ", " << Bz << ")"); + using BField_t = Acts::ConstantBField; + BField_t bField(Bx, By, Bz); + auto stepper = Acts::EigenStepper<BField_t>(std::move(bField)); + auto propagator = Acts::Propagator<decltype(stepper), Acts::Navigator>(std::move(stepper), + std::move(navigator)); + m_varProp = std::make_unique<VariantPropagator>(propagator); + } + + ATH_MSG_INFO("ACTS extrapolation successfully initialized"); + return StatusCode::SUCCESS; +} + + +void +ActsExtrapolationTool::prepareAlignment() const +{ + m_trackingGeometryTool->prepareAlignment(); +} diff --git a/Tracking/Acts/ActsGeometry/src/ActsLayerBuilder.cxx b/Tracking/Acts/ActsGeometry/src/ActsLayerBuilder.cxx new file mode 100644 index 0000000000000000000000000000000000000000..788a51e0a43fb5f76c505342126421abf125cc10 --- /dev/null +++ b/Tracking/Acts/ActsGeometry/src/ActsLayerBuilder.cxx @@ -0,0 +1,326 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ +// ATHENA +#include "InDetReadoutGeometry/SiDetectorElement.h" +#include "InDetReadoutGeometry/SiDetectorElementCollection.h" +#include "InDetReadoutGeometry/SiDetectorManager.h" + +// PACKAGE +#include "ActsGeometry/ActsLayerBuilder.h" +#include "ActsInterop/IdentityHelper.h" + +// ACTS +#include "Acts/Material/SurfaceMaterialProxy.hpp" +#include "Acts/Surfaces/CylinderSurface.hpp" +#include "Acts/Surfaces/DiscSurface.hpp" +#include "Acts/Layers/GenericApproachDescriptor.hpp" +#include "Acts/Utilities/ApproachDescriptor.hpp" +#include "Acts/Layers/ProtoLayer.hpp" +#include "Acts/Tools/LayerCreator.hpp" +#include "Acts/Utilities/Definitions.hpp" + +using Acts::Surface; +using Acts::Transform3D; +using Acts::Translation3D; + +const Acts::LayerVector +ActsLayerBuilder::negativeLayers() const +{ + ACTS_VERBOSE("Building negative layers"); + // @todo Remove this hack once the m_elementStore mess is sorted out + auto mutableThis = const_cast<ActsLayerBuilder*>(this); + Acts::LayerVector nVector; + mutableThis->buildLayers(nVector, -1); + return nVector; +} + +const Acts::LayerVector +ActsLayerBuilder::centralLayers() const +{ + ACTS_VERBOSE("Building central layers"); + // @todo Remove this hack once the m_elementStore mess is sorted out + auto mutableThis = const_cast<ActsLayerBuilder*>(this); + Acts::LayerVector cVector; + mutableThis->buildLayers(cVector, 0); + return cVector; +} + +const Acts::LayerVector +ActsLayerBuilder::positiveLayers() const +{ + ACTS_VERBOSE("Building positive layers"); + // @todo Remove this hack once the m_elementStore mess is sorted out + auto mutableThis = const_cast<ActsLayerBuilder*>(this); + Acts::LayerVector pVector; + mutableThis->buildLayers(pVector, 1); + return pVector; + +} + +std::vector<std::shared_ptr<const ActsDetectorElement>> +ActsLayerBuilder::getDetectorElements() const +{ + auto siDetMng = static_cast<const InDetDD::SiDetectorManager*>(m_cfg.mng); + + std::vector<std::shared_ptr<const ActsDetectorElement>> elements; + + InDetDD::SiDetectorElementCollection::const_iterator iter; + for (iter = siDetMng->getDetectorElementBegin(); + iter != siDetMng->getDetectorElementEnd(); + ++iter) { + const InDetDD::SiDetectorElement* siDetElement = *iter; + //elements.emplace_back(siDetElement, m_cfg.trackingGeometrySvc); + elements.push_back( + std::make_shared<const ActsDetectorElement>( + siDetElement, m_cfg.trackingGeometrySvc)); + } + + return elements; +} + +void +ActsLayerBuilder::buildLayers(Acts::LayerVector& layersOutput, int type) +{ + + std::vector<std::shared_ptr<const ActsDetectorElement>> elements = getDetectorElements(); + + + std::map<std::pair<int, int>, std::vector<const Surface*>> layers; + + for (const auto &element : elements) { + + IdentityHelper id = element->identityHelper(); + + // wrong subdetector + // want barrel but not barrel + if (type == 0 && id.bec() != 0) continue; + // want endcap but is barrel + if (type != 0 && id.bec() == 0) continue; + // want endcap, but wrong side + if (type != 0 && type * id.bec() < 0) continue; + + m_cfg.elementStore->push_back(element); + + // const PixelID* idhlp = dynamic_cast<const + // PixelID*>(siDetElement->getIdHelper()); + // int layer_disk = idhlp->layer_disk(siDetElement->identify()); + // int eta_module = idhlp->eta_module(siDetElement->identify()); + + // std::cout << "SELECTED: "; + // std::cout << element->bec() << " "; + // std::cout << "(" << element->layer_disk() << " " << layer_disk << ") "; + // std::cout << "(" << element->eta_module() << " " << eta_module << ") "; + // std::cout << element->phi_module() << " "; + // std::cout << "Z = " << element->surface().center().z() << std::endl; + + int elementLayer; + elementLayer = id.layer_disk(); + + std::pair<int, int> layerKey(elementLayer, id.bec()); + + if (layers.count(layerKey) == 0) { + // layer not set yet + layers.insert(std::make_pair(layerKey, std::vector<const Surface*>())); + } + + // push into correct layer + layers.at(layerKey).push_back(&element->surface()); + + } + + // @TODO: Maybe exclude BLM (BCM?) + + ACTS_VERBOSE("Found " << layers.size() << " layers"); + // pre loop for more concise output. only do if we actually print it + if(logger().doPrint(Acts::Logging::VERBOSE)) { + size_t n = 1; + for (const auto& layerPair : layers) { + std::vector<const Surface*> layerSurfaces = layerPair.second; + auto key = layerPair.first; + Acts::ProtoLayer pl(layerSurfaces); + ACTS_VERBOSE("Layer #" << n << " with layerKey: (" + << key.first << ", " << key.second << ")"); + if (type == 0) { // BARREL + ACTS_VERBOSE(" -> at rMin / rMax: " << pl.minR << " / " << pl.maxR); + } + else { + ACTS_VERBOSE(" -> at zMin / zMax: " << pl.minZ << " / " << pl.maxZ); + } + + n++; + } + } + + for (const auto& layerPair : layers) { + + std::unique_ptr<Acts::ApproachDescriptor> approachDescriptor = nullptr; + std::shared_ptr<const Acts::SurfaceMaterialProxy> materialProxy = nullptr; + + std::vector<const Surface*> layerSurfaces = layerPair.second; + + if (type == 0) { // BARREL + // layers and extent are determined, build actual layer + Acts::ProtoLayer pl(layerSurfaces); + pl.envR = {0, 0}; + pl.envZ = {20, 20}; + + double binPosZ = 0.5 * (pl.minZ + pl.maxZ); + double envZShift = 0.5 * (-pl.envZ.first + pl.envZ.second); + double layerZ = binPosZ + envZShift; + double layerHalfZ + = std::abs(pl.maxZ + pl.envZ.second - layerZ); + + auto transform + = std::make_shared<const Transform3D>(Translation3D(0., 0., -layerZ)); + // set up approach descriptor + + Acts::CylinderSurface* innerBoundary + = new Acts::CylinderSurface(transform, pl.minR, layerHalfZ); + + Acts::CylinderSurface* outerBoundary + = new Acts::CylinderSurface(transform, pl.maxR, layerHalfZ); + + Acts::CylinderSurface* centralSurface + = new Acts::CylinderSurface(transform, (pl.minR + pl.maxR)/2., layerHalfZ); + + size_t binsPhi = m_cfg.barrelMaterialBins.first; + size_t binsZ = m_cfg.barrelMaterialBins.second; + + Acts::BinUtility materialBinUtil( + binsPhi, -M_PI, M_PI, Acts::closed, Acts::binPhi); + materialBinUtil += Acts::BinUtility( + binsZ, -layerHalfZ, layerHalfZ, Acts::open, Acts::binZ, transform); + + materialProxy + = std::make_shared<const Acts::SurfaceMaterialProxy>(materialBinUtil); + + ACTS_VERBOSE("[L] Layer is marked to carry support material on Surface ( " + "inner=0 / center=1 / outer=2 ) : " << "inner"); + ACTS_VERBOSE("with binning: [" << binsPhi << ", " << binsZ << "]"); + + ACTS_VERBOSE("Created ApproachSurfaces for cylinder layer at:"); + ACTS_VERBOSE(" - inner: R=" << pl.minR); + ACTS_VERBOSE(" - central: R=" << (pl.minR + pl.maxR)/2.); + ACTS_VERBOSE(" - outer: R=" << pl.maxR); + + // set material on inner + // @TODO: make this configurable somehow + innerBoundary->setAssociatedMaterial(materialProxy); + + approachDescriptor + = std::make_unique<Acts::GenericApproachDescriptor<Acts::Surface>>( + std::vector<const Acts::Surface*>({innerBoundary, + centralSurface, + outerBoundary})); + + auto layer = m_cfg.layerCreator->cylinderLayer(layerSurfaces, + Acts::equidistant, + Acts::equidistant, + pl, + transform, + std::move(approachDescriptor)); + + layersOutput.push_back(layer); + } else { // ENDCAP + Acts::ProtoLayer pl(layerSurfaces); + pl.envR = {0, 0}; + pl.envZ = {10, 10}; + + // copied from layercreator + double layerZ + = 0.5 * (pl.minZ - pl.envZ.first + pl.maxZ + + pl.envZ.second); + double layerThickness = (pl.maxZ - pl.minZ) + + pl.envZ.first + pl.envZ.second; + + double layerZInner = layerZ - layerThickness/2.; + double layerZOuter = layerZ + layerThickness/2.; + + if (std::abs(layerZInner) > std::abs(layerZOuter)) std::swap(layerZInner, layerZOuter); + + auto transformNominal + = std::make_shared<const Transform3D>(Translation3D(0., 0., layerZ)); + + auto transformInner + = std::make_shared<const Transform3D>(Translation3D(0., 0., layerZInner)); + + auto transformOuter + = std::make_shared<const Transform3D>(Translation3D(0., 0., layerZOuter)); + + Acts::DiscSurface* innerBoundary + = new Acts::DiscSurface(transformInner, pl.minR, pl.maxR); + + Acts::DiscSurface* nominalSurface + = new Acts::DiscSurface(transformNominal, pl.minR, pl.maxR); + + Acts::DiscSurface* outerBoundary + = new Acts::DiscSurface(transformOuter, pl.minR, pl.maxR); + + size_t matBinsPhi = m_cfg.endcapMaterialBins.first; + size_t matBinsR = m_cfg.endcapMaterialBins.second; + + Acts::BinUtility materialBinUtil( + matBinsPhi, -M_PI, M_PI, Acts::closed, Acts::binPhi); + materialBinUtil += Acts::BinUtility( + matBinsR, pl.minR, pl.maxR, Acts::open, Acts::binR, transformNominal); + + materialProxy + = std::make_shared<const Acts::SurfaceMaterialProxy>(materialBinUtil); + + ACTS_VERBOSE("[L] Layer is marked to carry support material on Surface ( " + "inner=0 / center=1 / outer=2 ) : " << "inner"); + ACTS_VERBOSE("with binning: [" << matBinsPhi << ", " << matBinsR << "]"); + + ACTS_VERBOSE("Created ApproachSurfaces for disc layer at:"); + ACTS_VERBOSE(" - inner: Z=" << layerZInner); + ACTS_VERBOSE(" - central: Z=" << layerZ); + ACTS_VERBOSE(" - outer: Z=" << layerZOuter); + + + // set material on inner + // @TODO: make this configurable somehow + innerBoundary->setAssociatedMaterial(materialProxy); + + int nModPhi = std::numeric_limits<int>::max(); + int nModR = 0; + + // want to figure out bins in phi + for (const auto& srf : layerSurfaces) { + auto elm = dynamic_cast<const ActsDetectorElement*>(srf->associatedDetectorElement()); + auto id = elm->identityHelper(); + int phi_mod_max = id.phi_module_max(); + int eta_mod_max = id.eta_module_max(); + nModPhi = std::min(nModPhi, phi_mod_max+1); + nModR = eta_mod_max+1; + } + + ACTS_VERBOSE("Identifier reports: " << nModPhi << " is lowest for " << nModR << " r-rings"); + + // the modules in the innermost r-rings are exactly shifted by one half module width + // since it's the same number of modules, this gives binning trouble. Reduce bins + // by half: about 2 module pairs should be in each bin. This should be fine. + // @TODO: evaluate + size_t nBinsPhi = nModPhi/2.; + size_t nBinsR = nModR; + + ACTS_VERBOSE("Creating r x phi binned layer with " << nBinsR << " x " << nBinsPhi << " bins"); + + + approachDescriptor + = std::make_unique<Acts::GenericApproachDescriptor<Acts::Surface>>( + std::vector<const Acts::Surface*>({innerBoundary, + nominalSurface, + outerBoundary})); + + auto layer = m_cfg.layerCreator->discLayer(layerSurfaces, + nBinsR, + nBinsPhi, + pl, + transformNominal, + std::move(approachDescriptor)); + + layersOutput.push_back(layer); + } + } +} diff --git a/Tracking/Acts/ActsGeometry/src/ActsMaterialTrackWriterSvc.cxx b/Tracking/Acts/ActsGeometry/src/ActsMaterialTrackWriterSvc.cxx new file mode 100644 index 0000000000000000000000000000000000000000..c307ada289638de80a38e8b38a0602cf64c7a4d9 --- /dev/null +++ b/Tracking/Acts/ActsGeometry/src/ActsMaterialTrackWriterSvc.cxx @@ -0,0 +1,234 @@ +/* + Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration +*/ + +#include "ActsGeometry/ActsMaterialTrackWriterSvc.h" +#include "GaudiKernel/IInterface.h" + +#include "TTree.h" +#include "TFile.h" + +#include "Acts/Plugins/MaterialMapping/MaterialTrack.hpp" +#include "Acts/Material/MaterialProperties.hpp" +#include "Acts/Utilities/Helpers.hpp" + +using namespace Acts::VectorHelpers; + +#include <vector> +#include <deque> +#include <mutex> +#include <thread> + +ActsMaterialTrackWriterSvc::ActsMaterialTrackWriterSvc( const std::string& name, ISvcLocator* svc ) +: base_class(name, svc) { +} + +StatusCode +ActsMaterialTrackWriterSvc::initialize() +{ + + std::string filePath = m_filePath; + std::string treeName = m_treeName; + p_tFile = TFile::Open(filePath.c_str(), "RECREATE"); + p_tFile->cd(); + p_tree = new TTree(treeName.c_str(), treeName.c_str()); + + p_tree->Branch("X0", &m_treeX0); + p_tree->Branch("L0", &m_treeL0); + p_tree->Branch("phi", &m_treePhi); + p_tree->Branch("theta", &m_treeTheta); + p_tree->Branch("T", &m_treeT); + p_tree->Branch("dInX0", &m_treedInX0); + p_tree->Branch("dInL0", &m_treedInL0); + + p_tree->Branch("step_X0", &m_treeStepX0); + p_tree->Branch("step_L0", &m_treeStepL0); + p_tree->Branch("step_A", &m_treeStepA); + p_tree->Branch("step_Z", &m_treeStepZ); + p_tree->Branch("step_rho", &m_treeStepRho); + p_tree->Branch("step_t", &m_treeStepT); + p_tree->Branch("step_dInX0", &m_treeStepdInX0); + p_tree->Branch("step_dInL0", &m_treeStepdInL0); + + p_tree->Branch("step_x", &m_treeStepPosX); + p_tree->Branch("step_y", &m_treeStepPosY); + p_tree->Branch("step_z", &m_treeStepPosZ); + p_tree->Branch("step_r", &m_treeStepPosR); + p_tree->Branch("step_phi", &m_treeStepPosPhi); + + p_tree->Branch("step_geo_id", &m_treeStepGeoID); + + ATH_MSG_INFO("Starting writer thread"); + ATH_MSG_DEBUG("Maximum queue size is set to:" << m_maxQueueSize); + m_doEnd = false; + m_writeThread = std::thread(&ActsMaterialTrackWriterSvc::writerThread, this); + + return StatusCode::SUCCESS; +} + +StatusCode +ActsMaterialTrackWriterSvc::finalize() +{ + + ATH_MSG_INFO("Waiting for writer thread to finish."); + m_doEnd = true; + m_writeThread.join(); + ATH_MSG_INFO("Writer thread has terminated."); + + ATH_MSG_INFO("Closing TFile"); + p_tFile->cd(); + p_tree->FlushBaskets(); + p_tree->AutoSave(); + p_tree->Write(); + //p_tFile->Write() + p_tFile->Close(); + + return StatusCode::SUCCESS; +} + +void +ActsMaterialTrackWriterSvc::write(const Acts::MaterialTrack& mTrack) +{ + std::lock_guard<std::mutex> lock(m_writeMutex); + + ATH_MSG_VERBOSE("Appending material track to write queue"); + m_mTracks.push_back(mTrack); +} + +void +ActsMaterialTrackWriterSvc::writerThread() +{ + using namespace std::chrono_literals; + // wait until we have events + while(m_mTracks.size() == 0) { + std::this_thread::sleep_for(2s); + if (m_doEnd) return; + } + + ATH_MSG_DEBUG("Begin regular write loop"); + while(true) { + ATH_MSG_VERBOSE("Obtaining write lock"); + std::unique_lock<std::mutex> lock(m_writeMutex); + + if (m_mTracks.empty()) { + lock.unlock(); + if (!m_doEnd) { + ATH_MSG_VERBOSE("Queue was empty, delay next execution"); + std::this_thread::sleep_for(0.1s); + continue; + } else { + ATH_MSG_INFO("Writer thread caught termination signal. Shutting down."); + + return; + } + } + + + //if(m_mTracks.size() < m_maxQueueSize) { + // just pop one + ATH_MSG_VERBOSE("Queue at " << m_mTracks.size() << "/" << m_maxQueueSize + << ": Pop entry and write"); + Acts::MaterialTrack mTrack = std::move(m_mTracks.front()); + m_mTracks.pop_front(); + // writing can now happen without lock + lock.unlock(); + doWrite(std::move(mTrack)); + //} + //else { + //ATH_MSG_DEBUG("Queue at " << m_mTracks.size() << "/" << m_maxQueueSize + //<< ": Lock and write until empty"); + //while(!m_mTracks.empty()) { + //ATH_MSG_VERBOSE("Pop entry and write"); + //// keep the lock! + //MaterialTrack mTrack = std::move(m_mTracks.front()); + //m_mTracks.pop_front(); + //doWrite(std::move(mTrack)); + //} + //ATH_MSG_DEBUG("Queue is empty, continue"); + + //} + + + } +} + +void +ActsMaterialTrackWriterSvc::doWrite(const Acts::MaterialTrack& mTrack) +{ + ATH_MSG_VERBOSE("Write to tree"); + size_t nSteps = mTrack.materialSteps().size(); + //m_treeStepPos.clear(); + //m_treeStepPos.reserve(nSteps); + m_treeStepX0.clear(); + m_treeStepX0.reserve(nSteps); + m_treeStepL0.clear(); + m_treeStepL0.reserve(nSteps); + m_treeStepA.clear(); + m_treeStepA.reserve(nSteps); + m_treeStepZ.clear(); + m_treeStepZ.reserve(nSteps); + m_treeStepRho.clear(); + m_treeStepRho.reserve(nSteps); + m_treeStepT.clear(); + m_treeStepT.reserve(nSteps); + m_treeStepdInX0.clear(); + m_treeStepdInX0.reserve(nSteps); + m_treeStepdInL0.clear(); + m_treeStepdInL0.reserve(nSteps); + + m_treeStepPosX.clear(); + m_treeStepPosX.reserve(nSteps); + m_treeStepPosY.clear(); + m_treeStepPosY.reserve(nSteps); + m_treeStepPosZ.clear(); + m_treeStepPosZ.reserve(nSteps); + m_treeStepPosR.clear(); + m_treeStepPosR.reserve(nSteps); + m_treeStepPosPhi.clear(); + m_treeStepPosPhi.reserve(nSteps); + + m_treeStepGeoID.clear(); + m_treeStepGeoID.reserve(nSteps); + + + m_treeX0 = mTrack.thicknessInX0(); // name? + m_treeL0 = mTrack.thicknessInL0(); // name? + m_treeTheta = mTrack.theta(); + m_treePhi = mTrack.phi(); + m_treeT = 0; + m_treedInX0 = 0; + m_treedInL0 = 0; + + for(const auto& step : mTrack.materialSteps()) { + const Acts::MaterialProperties& matProp = step.materialProperties(); + const Acts::Material& mat = matProp.material(); + const Acts::Vector3D pos = step.position(); + + m_treeStepPosX.push_back(pos.x()); + m_treeStepPosY.push_back(pos.y()); + m_treeStepPosZ.push_back(pos.z()); + m_treeStepPosR.push_back(perp(pos)); + m_treeStepPosPhi.push_back(phi(pos)); + + m_treeStepX0.push_back(mat.X0()); + m_treeStepL0.push_back(mat.L0()); + m_treeStepA.push_back(mat.A()); + m_treeStepZ.push_back(mat.Z()); + m_treeStepRho.push_back(mat.rho()); + m_treeStepT.push_back(matProp.thickness()); + m_treeStepdInX0.push_back(matProp.thicknessInX0()); + m_treeStepdInX0.push_back(matProp.thicknessInL0()); + + m_treeT += matProp.thickness(); + m_treedInX0 += matProp.thicknessInX0(); + m_treedInL0 += matProp.thicknessInL0(); + + m_treeStepGeoID.push_back(step.geoID()); + + } + + p_tree->Fill(); + //m_treeTTot = 0; + + ATH_MSG_VERBOSE("Write complete"); +} diff --git a/Tracking/Acts/ActsGeometry/src/ActsObjWriterTool.cxx b/Tracking/Acts/ActsGeometry/src/ActsObjWriterTool.cxx new file mode 100644 index 0000000000000000000000000000000000000000..bc4c6eff8c6e4123c166b116a24ca7d0bb049a30 --- /dev/null +++ b/Tracking/Acts/ActsGeometry/src/ActsObjWriterTool.cxx @@ -0,0 +1,81 @@ +/* + Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration +*/ + +#include "ActsGeometry/ActsObjWriterTool.h" + +// std +#include <iostream> +#include <vector> + +// Gaudi / Athena +#include "GaudiKernel/IInterface.h" + +// ACTS +#include "Acts/Detector/TrackingGeometry.hpp" + +// PRIVATE +#include "util/ObjSurfaceWriter.h" +#include "util/ObjTrackingGeometryWriter.h" + + +ActsObjWriterTool::ActsObjWriterTool(const std::string& type, const std::string& name, + const IInterface* parent) + : AthAlgTool(type, name, parent) +{ + //declareProperty("OutputDirectory", m_outputDirectory = ""); + //declareProperty("SubDetectors", m_subDetectors = {}); +} + +StatusCode +ActsObjWriterTool::initialize() +{ + + using namespace std::string_literals; + + std::vector<std::shared_ptr<Acts::ObjSurfaceWriter>> subWriters; + std::vector<std::shared_ptr<std::ofstream>> subStreams; + + for (const auto& sdet : m_subDetectors) { + auto sdStream = std::shared_ptr<std::ofstream>(new std::ofstream); + std::string sdOutputName = m_outputDirectory + "/"s + sdet + ".obj"s; + sdStream->open(sdOutputName); + // object surface writers + Acts::ObjSurfaceWriter::Config sdObjWriterConfig(sdet, + Acts::Logging::INFO); + sdObjWriterConfig.filePrefix = ""; + sdObjWriterConfig.outputPhiSegments = 10; + sdObjWriterConfig.outputPrecision = 6; + sdObjWriterConfig.outputScalor = 1.; + sdObjWriterConfig.outputThickness = 1.; + sdObjWriterConfig.outputSensitive = true; + sdObjWriterConfig.outputLayerSurface = false; + sdObjWriterConfig.outputStream = sdStream; + auto sdObjWriter + = std::make_shared<Acts::ObjSurfaceWriter>(sdObjWriterConfig); + // push back + subWriters.push_back(sdObjWriter); + subStreams.push_back(sdStream); + } + + // configure the tracking geometry writer + Acts::ObjTrackingGeometryWriter::Config tgObjWriterConfig( + "ObjTrackingGeometryWriter", Acts::Logging::INFO); + tgObjWriterConfig.surfaceWriters = subWriters; + tgObjWriterConfig.filePrefix = ""; + tgObjWriterConfig.sensitiveGroupPrefix = ""; + tgObjWriterConfig.layerPrefix = ""; + // the tracking geometry writers + m_tgObjWriter + = std::make_shared<Acts::ObjTrackingGeometryWriter>(tgObjWriterConfig); + + + return StatusCode::SUCCESS; +} + +void +ActsObjWriterTool::write(const Acts::TrackingGeometry& tg) +{ + m_tgObjWriter->write(tg); +} + diff --git a/Tracking/Acts/ActsGeometry/src/ActsPropStepRootWriterSvc.cxx b/Tracking/Acts/ActsGeometry/src/ActsPropStepRootWriterSvc.cxx new file mode 100644 index 0000000000000000000000000000000000000000..de9b707c4a04867fc1c6a6f42f403a8074bd375a --- /dev/null +++ b/Tracking/Acts/ActsGeometry/src/ActsPropStepRootWriterSvc.cxx @@ -0,0 +1,183 @@ +/* + Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration +*/ + +#include "ActsGeometry/ActsPropStepRootWriterSvc.h" +#include "GaudiKernel/IInterface.h" + +#include "Acts/Propagator/detail/SteppingLogger.hpp" +#include "Acts/Detector/TrackingVolume.hpp" + + +#include <vector> +#include <deque> +#include <mutex> +#include <thread> + +#include "TTree.h" +#include "TFile.h" + + +ActsPropStepRootWriterSvc::ActsPropStepRootWriterSvc( const std::string& name, ISvcLocator* svc ) +: base_class(name, svc) { +} + +StatusCode +ActsPropStepRootWriterSvc::initialize() +{ + + ATH_MSG_INFO("Starting writer thread"); + m_doEnd = false; + m_writeThread = std::thread(&ActsPropStepRootWriterSvc::writeThread, this); + + std::string filePath = m_filePath; + m_outputFile = TFile::Open(filePath.c_str(), "RECREATE"); + if(m_outputFile == nullptr) { + ATH_MSG_ERROR("Unable to open output file at " << m_filePath); + return StatusCode::FAILURE; + } + m_outputFile->cd(); + + std::string treeName = m_treeName; + m_outputTree = new TTree(treeName.c_str(), "Acts Propagation Steps"); + if(m_outputTree == nullptr) { + ATH_MSG_ERROR("Unable to create TTree"); + return StatusCode::FAILURE; + } + + m_outputTree->Branch("event_nr", &m_eventNum); + m_outputTree->Branch("step_x", &m_s_pX); + m_outputTree->Branch("step_y", &m_s_pY); + m_outputTree->Branch("step_z", &m_s_pZ); + m_outputTree->Branch("step_r", &m_s_pR); + m_outputTree->Branch("volume_id", &m_s_volumeID); + m_outputTree->Branch("boundary_id", &m_s_boundaryID); + m_outputTree->Branch("layer_id", &m_s_layerID); + m_outputTree->Branch("approach_id", &m_s_approachID); + m_outputTree->Branch("sensitive_id", &m_s_sensitiveID); + + + return StatusCode::SUCCESS; +} + +StatusCode +ActsPropStepRootWriterSvc::finalize() +{ + ATH_MSG_INFO("Waiting for writer thread to finish."); + m_doEnd = true; + m_writeThread.join(); + ATH_MSG_INFO("Writer thread has terminated."); + + return StatusCode::SUCCESS; +} + +void +ActsPropStepRootWriterSvc::write(const StepVector& steps) +{ + + auto ctx = Gaudi::Hive::currentContext(); + + std::lock_guard<std::mutex> lock(m_writeMutex); + + //for(size_t i=0;i<ecells.size();++i) { + //m_queue.emplace_back(ctx.eventID().event_number(), std::move(ecells[i])); + //} + m_queue.emplace_back(ctx.eventID().event_number(), steps); +} + +void +ActsPropStepRootWriterSvc::writeThread() +{ + using namespace std::chrono_literals; + // wait until we have events + while(m_queue.size() == 0) { + std::this_thread::sleep_for(2s); + if (m_doEnd) return; + } + + while(true) { + std::unique_lock<std::mutex> lock(m_writeMutex); + + if (m_queue.empty()) { + lock.unlock(); + if (!m_doEnd) { + std::this_thread::sleep_for(0.5s); + continue; + } else { + ATH_MSG_INFO("Writer thread caught termination signal. Shutting down."); + end(); + return; + } + } + + queue_item_t queue_item = std::move(m_queue.front()); + m_queue.pop_front(); + + lock.unlock(); + + size_t eventNum = queue_item.first; + StepVector steps = std::move(queue_item.second); + + doWrite(steps, eventNum); + } + +} + +void +ActsPropStepRootWriterSvc::doWrite(const StepVector& steps, size_t evtNum) +{ + using ag = Acts::GeometryID; + + m_eventNum = evtNum; + m_s_pX.clear(); + m_s_pY.clear(); + m_s_pZ.clear(); + m_s_pR.clear(); + m_s_volumeID.clear(); + m_s_boundaryID.clear(); + m_s_layerID.clear(); + m_s_approachID.clear(); + m_s_sensitiveID.clear(); + + for(const auto& step : steps) { + geo_id_value volumeID = 0; + geo_id_value boundaryID = 0; + geo_id_value layerID = 0; + geo_id_value approachID = 0; + geo_id_value sensitiveID = 0; + // get the identification from the surface first + if (step.surface) { + auto geoID = step.surface->geoID(); + sensitiveID = geoID.value(ag::sensitive_mask); + approachID = geoID.value(ag::approach_mask); + layerID = geoID.value(ag::layer_mask); + boundaryID = geoID.value(ag::boundary_mask); + volumeID = geoID.value(ag::volume_mask); + } + // a current volume overwrites the surface tagged one + if (step.volume) { + volumeID = step.volume->geoID().value(ag::volume_mask); + } + // now fill + m_s_sensitiveID.push_back(sensitiveID); + m_s_approachID.push_back(approachID); + m_s_layerID.push_back(layerID); + m_s_boundaryID.push_back(boundaryID); + m_s_volumeID.push_back(volumeID); + + m_s_pX.push_back(step.position.x()); + m_s_pY.push_back(step.position.y()); + m_s_pZ.push_back(step.position.z()); + m_s_pR.push_back(Acts::VectorHelpers::perp(step.position)); + } + + m_outputTree->Fill(); +} + +void +ActsPropStepRootWriterSvc::end() +{ + m_outputFile->cd(); + m_outputTree->Write(); + //m_outputFile->Close(); +} diff --git a/Tracking/Acts/ActsGeometry/src/ActsStrawLayerBuilder.cxx b/Tracking/Acts/ActsGeometry/src/ActsStrawLayerBuilder.cxx new file mode 100644 index 0000000000000000000000000000000000000000..a6d7255f0b89744844a9fde83e295c3e60ae2a2c --- /dev/null +++ b/Tracking/Acts/ActsGeometry/src/ActsStrawLayerBuilder.cxx @@ -0,0 +1,239 @@ +/* + Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration +*/ + +// ATHENA +#include "InDetReadoutGeometry/TRT_DetectorManager.h" +#include "InDetReadoutGeometry/TRT_Numerology.h" +#include "InDetIdentifier/TRT_ID.h" +#include "Identifier/Identifier.h" + +// PACKAGE +#include "ActsGeometry/ActsStrawLayerBuilder.h" +#include "ActsGeometry/ActsDetectorElement.h" + +// ACTS +#include "Acts/Tools/ILayerBuilder.hpp" +#include "Acts/Surfaces/CylinderSurface.hpp" +#include "Acts/Surfaces/StrawSurface.hpp" +#include "Acts/Surfaces/DiscSurface.hpp" +#include "Acts/Tools/LayerCreator.hpp" +#include "Acts/Utilities/Definitions.hpp" +#include "Acts/Layers/ProtoLayer.hpp" + +// STL +#include <iostream> +#include <fstream> + +using Acts::Transform3D; +using Acts::Vector3D; + +const Acts::LayerVector +ActsStrawLayerBuilder::negativeLayers() const +{ + // @todo Remove this hack once the m_elementStore mess is sorted out + auto mutableThis = const_cast<ActsStrawLayerBuilder*>(this); + return mutableThis->endcapLayers(-1); +} + +const Acts::LayerVector +ActsStrawLayerBuilder::centralLayers() const +{ + // @todo Remove this hack once the m_elementStore mess is sorted out + auto mutableThis = const_cast<ActsStrawLayerBuilder*>(this); + return mutableThis->centralLayers(); +} + +const Acts::LayerVector +ActsStrawLayerBuilder::positiveLayers() const +{ + // @todo Remove this hack once the m_elementStore mess is sorted out + auto mutableThis = const_cast<ActsStrawLayerBuilder*>(this); + return mutableThis->endcapLayers(1); + +} + + +const Acts::LayerVector +ActsStrawLayerBuilder::centralLayers() +{ + ACTS_VERBOSE("Building central Straw layers") + + const InDetDD::TRT_Numerology* trtNums = m_cfg.mng->getNumerology(); + size_t nBarrelRings = trtNums->getNBarrelRings(); + size_t nBarrelPhiSectors = trtNums->getNBarrelPhi(); + + + ACTS_VERBOSE("- Numerology reports: - " << nBarrelRings << " barrel rings"); + ACTS_VERBOSE(" - " << nBarrelPhiSectors << " barrel phi sectors"); + + Acts::LayerVector layers; + + std::vector<Acts::ProtoLayer> protoLayers; + + for(size_t iring=0; iring < nBarrelRings;iring++) { + ACTS_VERBOSE("- Collecting elements for ring " << iring); + + // were calculating min/max radius while were at it. + Acts::ProtoLayer pl; + pl.minR = std::numeric_limits<double>::max(); + pl.maxR = std::numeric_limits<double>::lowest(); + pl.minZ = std::numeric_limits<double>::max(); + pl.maxZ = std::numeric_limits<double>::lowest(); + pl.minPhi = -M_PI; + pl.maxPhi = M_PI; + + pl.envZ = {1, 1}; + pl.envR = {0, 0}; + + double fudge = 0; + // RING in TRT speak is translated to Layer in ACTS speak + std::vector<const Acts::Surface*> layerSurfaces; + + size_t nBarrelLayers = trtNums->getNBarrelLayers(iring); + ACTS_VERBOSE(" - Numerology reports: " << nBarrelLayers << " layers in ring " << iring); + for (size_t ilayer=0;ilayer < nBarrelLayers;ilayer++) { + for (size_t iphisec=0;iphisec < nBarrelPhiSectors;iphisec++) { + // what is this? + for (size_t iposneg=0;iposneg<2;iposneg++) { + + const InDetDD::TRT_BarrelElement* brlElem + = m_cfg.mng->getBarrelElement(iposneg, iring, iphisec, ilayer); + + unsigned int nStraws = brlElem->nStraws(); + + for(unsigned int istraw=0;istraw<nStraws;istraw++) { + + auto trf = std::make_shared<const Transform3D>(brlElem->strawTransform(istraw)); + auto code = brlElem->getCode(); + Identifier straw_id = m_cfg.idHelper->straw_id(code.isPosZ() == 1 ? 1 : -1, + code.getPhiIndex(), + code.getModuleIndex(), + code.getStrawLayerIndex(), + istraw); + + auto elem = std::make_shared<const ActsDetectorElement>( + trf, brlElem, straw_id, m_cfg.trackingGeometrySvc); + + m_cfg.elementStore->push_back(elem); + + auto straw = dynamic_cast<const Acts::StrawSurface*>(&elem->surface()); + auto strawBounds = dynamic_cast<const Acts::LineBounds*>(&straw->bounds()); + double radius = strawBounds->r(); + double length = strawBounds->halflengthZ(); + fudge = radius / 4.; + + // calculate min/max R and Z + Vector3D ctr = straw->center(); + pl.maxR = std::max(pl.maxR, ctr.perp() + radius); + pl.minR = std::min(pl.minR, ctr.perp() - radius); + pl.maxZ = std::max(pl.maxZ, ctr.z() + length); + pl.minZ = std::min(pl.minZ, ctr.z() - length); + + layerSurfaces.push_back(straw); + } + } + } + } + + ACTS_VERBOSE(" - Collected " << layerSurfaces.size() << " straws"); + + if(iring > 0) { + // match outer radius of previous ring + const Acts::ProtoLayer &prev = protoLayers.at(iring-1); + pl.minR = prev.maxR + prev.envR.second + pl.envR.first + fudge; + } + + std::shared_ptr<Acts::Layer> layer = m_cfg.layerCreator->cylinderLayer(layerSurfaces, 100, 1, pl); + layers.push_back(layer); + + protoLayers.push_back(pl); + + } + + return layers; +} + +const Acts::LayerVector +ActsStrawLayerBuilder::endcapLayers(int side) +{ + ACTS_VERBOSE("Building endcap Straw layers") + + const InDetDD::TRT_Numerology* trtNums = m_cfg.mng->getNumerology(); + size_t nEndcapWheels = trtNums->getNEndcapWheels(); + size_t nEndcapPhiSectors = trtNums->getNEndcapPhi(); + + ACTS_VERBOSE("- Numerology reports: - " << nEndcapWheels<< " endcap wheels"); + ACTS_VERBOSE(" - " << nEndcapPhiSectors << " endcap phi sectors"); + + Acts::LayerVector layers; + + for(size_t iwheel=0;iwheel<nEndcapWheels;++iwheel) { + ACTS_VERBOSE("- Collecting elements for wheel " << iwheel); + + + size_t nEndcapLayers = trtNums->getNEndcapLayers(iwheel); + ACTS_VERBOSE(" - Numerology reports: " << nEndcapLayers << " layers in wheel " << iwheel); + for(size_t ilayer=0;ilayer<nEndcapLayers;++ilayer) { + std::vector<const Acts::Surface*> wheelSurfaces; + + + Acts::ProtoLayer pl; + pl.minR = std::numeric_limits<double>::max(); + pl.maxR = std::numeric_limits<double>::lowest(); + pl.minZ = std::numeric_limits<double>::max(); + pl.maxZ = std::numeric_limits<double>::lowest(); + pl.minPhi = -M_PI; + pl.maxPhi = M_PI; + pl.envR = {0, 0}; + + for (unsigned int iphisec=0; iphisec<nEndcapPhiSectors; ++iphisec) { + + size_t iposneg = side < 0 ? 0 : 1; + const InDetDD::TRT_EndcapElement* ecElem = m_cfg.mng->getEndcapElement(iposneg, iwheel, ilayer, iphisec); + unsigned int nStraws = ecElem->nStraws(); + + for(unsigned int istraw=0;istraw<nStraws;istraw++) { + + auto trf = std::make_shared<const Transform3D>(ecElem->strawTransform(istraw)); + + auto code = ecElem->getCode(); + Identifier straw_id = m_cfg.idHelper->straw_id(code.isPosZ() == 1 ? 2 : -2, + code.getPhiIndex(), + code.getWheelIndex(), + code.getStrawLayerIndex(), + istraw); + + + auto elem = std::make_shared<const ActsDetectorElement>( + trf, ecElem, straw_id, m_cfg.trackingGeometrySvc); + + m_cfg.elementStore->push_back(elem); + + auto straw = dynamic_cast<const Acts::StrawSurface*>(&elem->surface()); + auto strawBounds = dynamic_cast<const Acts::LineBounds*>(&straw->bounds()); + double radius = strawBounds->r(); + double length = strawBounds->halflengthZ(); + + Vector3D ctr = straw->center(); + pl.maxZ = std::max(pl.maxZ, ctr.z() + radius); + pl.minZ = std::min(pl.minZ, ctr.z() - radius); + pl.maxR = std::max(pl.maxR, ctr.perp() + length); + pl.minR = std::min(pl.minR, ctr.perp() - length); + pl.envZ = {radius/2., radius/2.}; + + wheelSurfaces.push_back(straw); + } + } + + std::shared_ptr<Acts::Layer> layer = m_cfg.layerCreator->discLayer(wheelSurfaces, 1, 100, pl); + layers.push_back(layer); + ACTS_VERBOSE(" - Collected " << wheelSurfaces.size() << " straws"); + } + + } + + ACTS_VERBOSE(" - Built " << layers.size() << " straw endcap layers"); + return layers; +} + diff --git a/Tracking/Acts/ActsGeometry/src/ActsTrackingGeometrySvc.cxx b/Tracking/Acts/ActsGeometry/src/ActsTrackingGeometrySvc.cxx new file mode 100644 index 0000000000000000000000000000000000000000..22ee232bc841647763298c5f76afc3e9caa080b6 --- /dev/null +++ b/Tracking/Acts/ActsGeometry/src/ActsTrackingGeometrySvc.cxx @@ -0,0 +1,272 @@ +/* + Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration +*/ + +#include "ActsGeometry/ActsTrackingGeometrySvc.h" + +// ATHENA +#include "InDetReadoutGeometry/SiDetectorManager.h" +#include "InDetReadoutGeometry/TRT_DetectorManager.h" +#include "StoreGate/StoreGateSvc.h" +#include "GaudiKernel/EventContext.h" +#include "InDetIdentifier/TRT_ID.h" + +// ACTS +#include "Acts/Detector/TrackingGeometry.hpp" +#include "Acts/Tools/ITrackingVolumeBuilder.hpp" +#include "Acts/Tools/LayerArrayCreator.hpp" +#include "Acts/Tools/SurfaceArrayCreator.hpp" +#include "Acts/Tools/LayerCreator.hpp" +#include "Acts/Tools/TrackingVolumeArrayCreator.hpp" +#include "Acts/Tools/CylinderVolumeHelper.hpp" +#include "Acts/Tools/TrackingGeometryBuilder.hpp" +#include "Acts/Tools/CylinderVolumeBuilder.hpp" + +// PACKAGE +#include "ActsGeometry/ActsLayerBuilder.h" +#include "ActsGeometry/ActsStrawLayerBuilder.h" +#include "ActsGeometry/ActsDetectorElement.h" +#include "ActsInterop/IdentityHelper.h" +#include "ActsInterop/Logger.h" +#include "ActsGeometry/ActsAlignmentStore.h" + + +ActsTrackingGeometrySvc::ActsTrackingGeometrySvc(const std::string& name, ISvcLocator* svc) + : base_class(name,svc), + m_detStore("StoreGateSvc/DetectorStore", name) +{ + m_elementStore = std::make_shared<std::vector<std::shared_ptr<const ActsDetectorElement>>>(); +} + +StatusCode +ActsTrackingGeometrySvc::initialize() +{ + ATH_MSG_INFO(name() << " is initializing"); + + ATH_CHECK ( m_detStore->retrieve(p_pixelManager, "Pixel") ); + ATH_CHECK ( m_detStore->retrieve(p_SCTManager, "SCT") ); + ATH_CHECK ( m_detStore->retrieve(p_TRTManager, "TRT") ); + + if (m_detStore->retrieve(m_TRT_idHelper, "TRT_ID").isFailure()) { + msg(MSG::ERROR) << "Could not retrieve TRT ID Helper" << endmsg; + } + + std::list<std::shared_ptr<const Acts::ITrackingVolumeBuilder>> volumeBuilders; + + auto layerArrayCreator = std::make_shared<const Acts::LayerArrayCreator>( + makeActsAthenaLogger(this, "LayArrCrtr", "ActsTGSvc")); + + auto trackingVolumeArrayCreator + = std::make_shared<const Acts::TrackingVolumeArrayCreator>( + makeActsAthenaLogger(this, "TrkVolArrCrtr", "ActsTGSvc")); + + Acts::CylinderVolumeHelper::Config cvhConfig; + cvhConfig.layerArrayCreator = layerArrayCreator; + cvhConfig.trackingVolumeArrayCreator = trackingVolumeArrayCreator; + + auto cylinderVolumeHelper + = std::make_shared<const Acts::CylinderVolumeHelper>( + cvhConfig, makeActsAthenaLogger(this, "CylVolHlpr", "ActsTGSvc")); + + try { + // PIXEL + volumeBuilders.push_back( + makeVolumeBuilder(p_pixelManager, cylinderVolumeHelper, true)); + + // SCT + volumeBuilders.push_back( + makeVolumeBuilder(p_SCTManager, cylinderVolumeHelper)); + + // TRT + volumeBuilders.push_back(makeVolumeBuilder(p_TRTManager, cylinderVolumeHelper)); + } + catch (const std::invalid_argument& e) { + ATH_MSG_ERROR(e.what()); + return StatusCode::FAILURE; + } + + + Acts::TrackingGeometryBuilder::Config tgbConfig; + tgbConfig.trackingVolumeHelper = cylinderVolumeHelper; + tgbConfig.trackingVolumeBuilders = volumeBuilders; + + auto trackingGeometryBuilder + = std::make_shared<const Acts::TrackingGeometryBuilder>(tgbConfig, + makeActsAthenaLogger(this, "TrkGeomBldr", "ActsTGSvc")); + + m_trackingGeometry = trackingGeometryBuilder->trackingGeometry(); + + //const Acts::TrackingVolume* = m_trackingGeometry->highestTrackingVolume(); + + + ATH_MSG_INFO("Acts TrackingGeometry construction completed"); + + return StatusCode::SUCCESS; +} + +std::shared_ptr<const Acts::TrackingGeometry> +ActsTrackingGeometrySvc::trackingGeometry() { + + ATH_MSG_VERBOSE("Retrieving tracking geometry"); + return m_trackingGeometry; +} + +std::shared_ptr<const Acts::ITrackingVolumeBuilder> +ActsTrackingGeometrySvc::makeVolumeBuilder(const InDetDD::InDetDetectorManager* manager, std::shared_ptr<const Acts::CylinderVolumeHelper> cvh, bool toBeamline) +{ + std::string managerName = manager->getName(); + + Eigen::Vector3d ctrAvg(0, 0, 0); + + std::shared_ptr<const Acts::ILayerBuilder> gmLayerBuilder; + if (manager->getName() == "TRT") { + auto matcher = [](Acts::BinningValue /*bValue*/, const Acts::Surface* /*aS*/, + const Acts::Surface* /*bS*/) -> bool { + return false; + }; + + Acts::SurfaceArrayCreator::Config sacCfg; + sacCfg.surfaceMatcher = matcher; + sacCfg.doPhiBinningOptimization = false; + + auto surfaceArrayCreator = std::make_shared<Acts::SurfaceArrayCreator>( + sacCfg, + makeActsAthenaLogger(this, "SrfArrCrtr", "ActsTGSvc")); + Acts::LayerCreator::Config lcCfg; + lcCfg.surfaceArrayCreator = surfaceArrayCreator; + auto layerCreator = std::make_shared<Acts::LayerCreator>( + lcCfg, makeActsAthenaLogger(this, "LayCrtr", "ActsTGSvc")); + + ActsStrawLayerBuilder::Config cfg; + cfg.mng = static_cast<const InDetDD::TRT_DetectorManager*>(manager); + cfg.elementStore = m_elementStore; + cfg.layerCreator = layerCreator; + cfg.trackingGeometrySvc = this; + cfg.idHelper = m_TRT_idHelper; + gmLayerBuilder = std::make_shared<const ActsStrawLayerBuilder>(cfg, + makeActsAthenaLogger(this, "GMSLayBldr", "ActsTGSvc")); + + //gmLayerBuilder->centralLayers(); + //gmLayerBuilder->negativeLayers(); + //gmLayerBuilder->positiveLayers(); + } + else { + auto matcher = [](Acts::BinningValue bValue, const Acts::Surface* aS, + const Acts::Surface* bS) -> bool { + + auto a = dynamic_cast<const ActsDetectorElement*>( + aS->associatedDetectorElement()); + auto b = dynamic_cast<const ActsDetectorElement*>( + bS->associatedDetectorElement()); + + + //auto id_a = a->identify(); + //auto id_b = b->identify(); + + IdentityHelper idA = a->identityHelper(); + IdentityHelper idB = b->identityHelper(); + + // check if same bec + // can't be same if not + if(idA.bec() != idB.bec()) return false; + + if (bValue == Acts::binPhi) { + //std::cout << idA.phi_module() << " <-> " << idB.phi_module() << std::endl; + return idA.phi_module() == idB.phi_module(); + } + + if (bValue == Acts::binZ) { + return (idA.eta_module() == idB.eta_module()) + && (idA.layer_disk() == idB.layer_disk()) + && (idA.bec() == idB.bec()); + } + + if (bValue == Acts::binR) { + return (idA.eta_module() == idB.eta_module()) + && (idA.layer_disk() == idB.layer_disk()) + && (idB.bec() == idA.bec()); + } + + return false; + }; + + Acts::SurfaceArrayCreator::Config sacCfg; + sacCfg.surfaceMatcher = matcher; + + auto surfaceArrayCreator = std::make_shared<Acts::SurfaceArrayCreator>( + sacCfg, + makeActsAthenaLogger(this, "SrfArrCrtr", "ActsTGSvc")); + Acts::LayerCreator::Config lcCfg; + lcCfg.surfaceArrayCreator = surfaceArrayCreator; + auto layerCreator = std::make_shared<Acts::LayerCreator>( + lcCfg, makeActsAthenaLogger(this, "LayCrtr", "ActsTGSvc")); + + + + ActsLayerBuilder::Config cfg; + + if(managerName == "Pixel") { + cfg.subdetector = ActsDetectorElement::Subdetector::Pixel; + } + else { + cfg.subdetector = ActsDetectorElement::Subdetector::SCT; + } + + // set bins from configuration + if (m_barrelMaterialBins.size() != 2) { + throw std::invalid_argument("Number of barrel material bin counts != 2"); + } + std::vector<size_t> brlBins(m_barrelMaterialBins); + cfg.barrelMaterialBins = {brlBins.at(0), + brlBins.at(1)}; + + if (m_endcapMaterialBins.size() != 2) { + throw std::invalid_argument("Number of endcap material bin counts != 2"); + } + std::vector<size_t> ecBins(m_endcapMaterialBins); + cfg.endcapMaterialBins = {ecBins.at(0), + ecBins.at(1)}; + + cfg.mng = static_cast<const InDetDD::SiDetectorManager*>(manager); + // use class member element store + cfg.elementStore = m_elementStore; + cfg.layerCreator = layerCreator; + cfg.trackingGeometrySvc = this; + + gmLayerBuilder = std::make_shared<const ActsLayerBuilder>(cfg, + makeActsAthenaLogger(this, "GMLayBldr", "ActsTGSvc")); + } + + + + Acts::CylinderVolumeBuilder::Config cvbConfig; + cvbConfig.layerEnvelopeR = {0, 0}; + cvbConfig.layerEnvelopeZ = 2; + cvbConfig.trackingVolumeHelper = cvh; + cvbConfig.volumeSignature = 0; + cvbConfig.volumeName = managerName; + cvbConfig.layerBuilder = gmLayerBuilder; + cvbConfig.buildToRadiusZero = toBeamline; + + auto cylinderVolumeBuilder + = std::make_shared<const Acts::CylinderVolumeBuilder>( + cvbConfig, + makeActsAthenaLogger(this, "CylVolBldr", "ActsTGSvc")); + + return cylinderVolumeBuilder; +} + +void +ActsTrackingGeometrySvc::setAlignmentStore(const ActsAlignmentStore* gas, const EventContext& ctx) +{ + std::lock_guard<std::mutex> lock(m_gasMapMutex); + m_gasMap[ctx.slot()] = gas; +} + +const ActsAlignmentStore* +ActsTrackingGeometrySvc::getAlignmentStore(const EventContext& ctx) const +{ + std::lock_guard<std::mutex> lock(m_gasMapMutex); + if (m_gasMap.find(ctx.slot()) == m_gasMap.end()) return nullptr; + return m_gasMap[ctx.slot()]; +} diff --git a/Tracking/Acts/ActsGeometry/src/ActsTrackingGeometryTool.cxx b/Tracking/Acts/ActsGeometry/src/ActsTrackingGeometryTool.cxx new file mode 100644 index 0000000000000000000000000000000000000000..2ca8c6261cdeb2fc75087a7f876c0e80e3c4e35b --- /dev/null +++ b/Tracking/Acts/ActsGeometry/src/ActsTrackingGeometryTool.cxx @@ -0,0 +1,59 @@ +/* + Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration +*/ + +#include "ActsGeometry/ActsTrackingGeometryTool.h" + +// ATHENA + +// PACKAGE +#include "ActsGeometry/ActsAlignmentStore.h" +#include "ActsGeometry/IActsTrackingGeometrySvc.h" + +// STL +#include <iostream> +#include <memory> + +ActsTrackingGeometryTool::ActsTrackingGeometryTool(const std::string& type, const std::string& name, + const IInterface* parent) + : AthAlgTool(type, name, parent), + m_trackingGeometrySvc("ActsTrackingGeometrySvc", name) +{ +} + +StatusCode +ActsTrackingGeometryTool::initialize() +{ + ATH_MSG_INFO(name() << " initializing"); + + ATH_CHECK( m_trackingGeometrySvc.retrieve() ); + + ATH_CHECK( m_rchk.initialize() ); + + return StatusCode::SUCCESS; +} + +std::shared_ptr<const Acts::TrackingGeometry> +ActsTrackingGeometryTool::trackingGeometry() const +{ + return m_trackingGeometrySvc->trackingGeometry(); +} + +StatusCode +ActsTrackingGeometryTool::prepareAlignment() const +{ + ATH_MSG_DEBUG("Setting up alignment for this event"); + SG::ReadCondHandle<ActsAlignmentStore> rch(m_rchk); + + if (!rch.isValid()) { + ATH_MSG_ERROR("Preparing alignment not possible, ReadCondHandle invalid"); + return StatusCode::FAILURE; + } + + const ActsAlignmentStore* gas = *rch; + + m_trackingGeometrySvc->setAlignmentStore(gas, Gaudi::Hive::currentContext()); + ATH_MSG_DEBUG("ActsAlignmentStore registered successfully"); + + return StatusCode::SUCCESS; +} diff --git a/Tracking/Acts/ActsGeometry/src/ActsWriteTrackingGeometry.cxx b/Tracking/Acts/ActsGeometry/src/ActsWriteTrackingGeometry.cxx new file mode 100755 index 0000000000000000000000000000000000000000..e97a4e057b4786a770ff123ee2e5347d8a02dcc1 --- /dev/null +++ b/Tracking/Acts/ActsGeometry/src/ActsWriteTrackingGeometry.cxx @@ -0,0 +1,46 @@ +/* + Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration +*/ +#include "ActsGeometry/ActsWriteTrackingGeometry.h" + +// ATHENA +#include "AthenaKernel/RNGWrapper.h" +#include "Acts/Utilities/Logger.hpp" +#include "AthenaBaseComps/AthAlgorithm.h" +#include "GaudiKernel/ISvcLocator.h" +#include "ActsInterop/Logger.h" + +// PACKAGE +#include "ActsGeometry/IActsTrackingGeometrySvc.h" + +// STL +#include <string> + +ActsWriteTrackingGeometry::ActsWriteTrackingGeometry(const std::string& name, + ISvcLocator* pSvcLocator) + : AthAlgorithm(name, pSvcLocator) +{ +} + +StatusCode ActsWriteTrackingGeometry::initialize() { + ATH_MSG_INFO("initializing"); + + ATH_CHECK(m_objWriterTool.retrieve()); + ATH_CHECK(m_trackingGeometryTool.retrieve()); + + + + return StatusCode::SUCCESS; +} + +StatusCode ActsWriteTrackingGeometry::execute() { + ATH_CHECK( m_trackingGeometryTool->prepareAlignment() ); + auto trackingGeometry = m_trackingGeometryTool->trackingGeometry(); + m_objWriterTool->write(*trackingGeometry); + return StatusCode::SUCCESS; +} + +StatusCode ActsWriteTrackingGeometry::finalize() { + return StatusCode::SUCCESS; +} + diff --git a/Tracking/Acts/ActsGeometry/src/GeomShiftCondAlg.cxx b/Tracking/Acts/ActsGeometry/src/GeomShiftCondAlg.cxx new file mode 100644 index 0000000000000000000000000000000000000000..977386546e6bec343f714c7f50a13c91e32844af --- /dev/null +++ b/Tracking/Acts/ActsGeometry/src/GeomShiftCondAlg.cxx @@ -0,0 +1,198 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +#include "ActsGeometry/GeomShiftCondAlg.h" + +// ATHENA +#include "StoreGate/WriteCondHandle.h" +#include "GaudiKernel/EventIDBase.h" +#include "GaudiKernel/EventIDRange.h" +#include "EventInfo/EventInfo.h" +#include "EventInfo/EventID.h" +#include "GeoModelKernel/GeoAlignableTransform.h" +#include "InDetReadoutGeometry/SiDetectorManager.h" +#include "InDetReadoutGeometry/PixelDetectorManager.h" +#include "InDetReadoutGeometry/TRT_DetectorManager.h" +#include "GeoPrimitives/CLHEPtoEigenConverter.h" +#include "InDetReadoutGeometry/ExtendedAlignableTransform.h" +#include "GaudiKernel/ICondSvc.h" +#include "StoreGate/StoreGateSvc.h" + +// PACKAGE +#include "ActsGeometry/ActsAlignmentStore.h" +#include "ActsGeometry/ActsDetectorElement.h" +#include "ActsGeometry/IActsTrackingGeometrySvc.h" + +// ACTS +#include "Acts/Utilities/Definitions.hpp" +#include "Acts/Detector/TrackingGeometry.hpp" +#include "Acts/Detector/DetectorElementBase.hpp" +#include "Acts/Surfaces/Surface.hpp" + +// STL +#include <memory> + +GeomShiftCondAlg::GeomShiftCondAlg( const std::string& name, + ISvcLocator* pSvcLocator ) : + ::AthAlgorithm( name, pSvcLocator ), + m_cs("CondSvc",name), + m_trackingGeometrySvc("ActsTrackingGeometrySvc", name), + m_detStore("StoreGateSvc/DetectorStore", name) +{ +} + +GeomShiftCondAlg::~GeomShiftCondAlg() {} + +StatusCode GeomShiftCondAlg::initialize() { + ATH_MSG_DEBUG("initialize " << name()); + + ATH_CHECK( m_evt.initialize() ); + + if (m_cs.retrieve().isFailure()) { + ATH_MSG_ERROR("unable to retrieve CondSvc"); + } + + ATH_CHECK ( m_detStore->retrieve(p_pixelManager, "Pixel") ); + ATH_CHECK ( m_detStore->retrieve(p_SCTManager, "SCT") ); + ATH_CHECK ( m_detStore->retrieve(p_TRTManager, "TRT") ); + + + if (m_wchk.initialize().isFailure()) { + ATH_MSG_ERROR("unable to initialize WriteCondHandle with key" << m_wchk.key() ); + return StatusCode::FAILURE; + } + + if (m_cs->regHandle(this, m_wchk).isFailure()) { + ATH_MSG_ERROR("unable to register WriteCondHandle " << m_wchk.fullKey() + << " with CondSvc"); + return StatusCode::FAILURE; + } + + return StatusCode::SUCCESS; +} + +StatusCode GeomShiftCondAlg::finalize() { + ATH_MSG_DEBUG("finalize " << name()); + return StatusCode::SUCCESS; +} + +StatusCode GeomShiftCondAlg::execute() { + ATH_MSG_DEBUG("execute " << name()); + + SG::ReadHandle<EventInfo> evt( m_evt ); + if (!evt.isValid()) { + ATH_MSG_ERROR ("Could not retrieve EventInfo"); + return StatusCode::FAILURE; + } + + ATH_MSG_DEBUG(" EventInfo: r: " << evt->event_ID()->run_number() + << " e: " << evt->event_ID()->event_number() ); + + + SG::WriteCondHandle<ActsAlignmentStore> wch(m_wchk); + + EventIDBase now(getContext().eventID()); + + if (evt->event_ID()->event_number() == 10) { + std::this_thread::sleep_for(std::chrono::milliseconds( 500 )); + } + + // do we have a valid m_wch for current time? + if ( wch.isValid(now) ) { + ATH_MSG_DEBUG("CondHandle is already valid for " << now + << ". In theory this should not be called, but may happen" + << " if multiple concurrent events are being processed out of order."); + + } else { + + ATH_MSG_DEBUG(" CondHandle " << wch.key() + << " not valid now (" << now << "). Getting new info for dbKey \"" + << wch.dbKey() << "\" from CondDb"); + + ATH_MSG_ALWAYS("SG evt: " << *(evt->event_ID())); + + ATH_MSG_DEBUG("LB EventInfo = " << evt->event_ID()->lumi_block()); + ATH_MSG_DEBUG("LB context = " << getContext().eventID().lumi_block()); + + unsigned int intvl_num = evt->event_ID()->lumi_block(); + + double val = intvl_num * double(m_zShiftPerLB); + + EventIDBase start(1, EventIDBase::UNDEFEVT); + EventIDBase end(1, EventIDBase::UNDEFEVT); + + start.set_lumi_block(intvl_num); + end.set_lumi_block(intvl_num+1); + + EventIDRange r(start, end); + + ActsAlignmentStore* alignStore = new ActsAlignmentStore(); + + const InDetDD::PixelDetectorManager* pixMgr + = dynamic_cast<const InDetDD::PixelDetectorManager*>(p_pixelManager); + + InDetDD::PixelDetectorManager::AlignableTransformMap& atMatL1 + = const_cast<InDetDD::PixelDetectorManager::AlignableTransformMap&>( + pixMgr->m_higherAlignableTransforms.at(1)); + + + PixelID idHelper; + + for(const auto& eat_item : atMatL1) { + const Identifier &id = eat_item.first; + + //std::cout << "Identifier: (bec, d, phim, etam, phiidx, etaidx): "; + //std::cout << idHelper.barrel_ec(id) << " "; + //std::cout << idHelper.layer_disk(id) << " "; + //std::cout << idHelper.phi_module(id) << " "; + //std::cout << idHelper.eta_module(id) << " "; + //std::cout << idHelper.phi_index(id) << " "; + //std::cout << idHelper.eta_index(id) << " "; + //std::cout << std::endl; + + + InDetDD::ExtendedAlignableTransform* eat = eat_item.second; + GeoAlignableTransform* alTrf = eat->alignableTransform(); + Acts::Transform3D delta; + delta = Acts::Translation3D(Acts::Vector3D::UnitZ()*val); + ATH_MSG_DEBUG("add delta: " << alTrf << " -> (z=" << val << ")"); + alignStore->setDelta(alTrf, Amg::EigenTransformToCLHEP(delta)); + } + + auto trkGeom = m_trackingGeometrySvc->trackingGeometry(); + + // deltas are set, now populate sensitive element transforms + ATH_MSG_DEBUG("Populating ActsAlignmentStore for IOV"); + size_t nElems = 0; + trkGeom->visitSurfaces( + [alignStore, &nElems](const Acts::Surface* srf) { + const Acts::DetectorElementBase* detElem = srf->associatedDetectorElement(); + const auto* gmde = dynamic_cast<const ActsDetectorElement*>(detElem); + gmde->storeTransform(alignStore); + nElems++; + }); + ATH_MSG_DEBUG("ActsAlignmentStore populated for " << nElems << " detector elements"); + + + if (wch.record(r, alignStore).isFailure()) { + ATH_MSG_ERROR("could not record shift " << wch.key() + << " = " << alignStore + << " with EventRange " << r); + return StatusCode::FAILURE; + } + + // is it valid now? + ATH_MSG_ALWAYS("isValid now? " << wch.isValid(now)); + + + ATH_MSG_INFO("recorded new shift " << wch.key() << " " + << " with range " << r); + } + + + + return StatusCode::SUCCESS; + +} + diff --git a/Tracking/Acts/ActsGeometry/src/NominalAlignmentCondAlg.cxx b/Tracking/Acts/ActsGeometry/src/NominalAlignmentCondAlg.cxx new file mode 100644 index 0000000000000000000000000000000000000000..5c5db62a68596e916f7daef37dc225d3d348245f --- /dev/null +++ b/Tracking/Acts/ActsGeometry/src/NominalAlignmentCondAlg.cxx @@ -0,0 +1,120 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +// ATHENA +#include "ActsGeometry/NominalAlignmentCondAlg.h" + +#include "StoreGate/WriteCondHandle.h" +#include "GaudiKernel/ServiceHandle.h" +#include "GaudiKernel/EventIDBase.h" +#include "GaudiKernel/EventIDRange.h" +#include "InDetReadoutGeometry/SiDetectorManager.h" +#include "InDetReadoutGeometry/PixelDetectorManager.h" +#include "InDetReadoutGeometry/TRT_DetectorManager.h" + +// PACKAGE +#include "ActsGeometry/IActsTrackingGeometrySvc.h" +#include "ActsGeometry/ActsDetectorElement.h" +#include "ActsGeometry/ActsAlignmentStore.h" + +// ACTS +#include "Acts/Utilities/Definitions.hpp" +#include "Acts/Detector/TrackingGeometry.hpp" +#include "Acts/Surfaces/Surface.hpp" + + +NominalAlignmentCondAlg::NominalAlignmentCondAlg( const std::string& name, + ISvcLocator* pSvcLocator ) : + ::AthAlgorithm( name, pSvcLocator ), + m_cs("CondSvc",name), + m_trackingGeometrySvc("ActsTrackingGeometrySvc", name) +{ +} + +NominalAlignmentCondAlg::~NominalAlignmentCondAlg() {} + +StatusCode NominalAlignmentCondAlg::initialize() { + ATH_MSG_DEBUG(name() << "::" << __FUNCTION__); + + if (m_cs.retrieve().isFailure()) { + ATH_MSG_ERROR("unable to retrieve CondSvc"); + } + + if (m_wchk.initialize().isFailure()) { + ATH_MSG_ERROR("unable to initialize WriteCondHandle with key" << m_wchk.key() ); + return StatusCode::FAILURE; + } + + if (m_cs->regHandle(this, m_wchk).isFailure()) { + ATH_MSG_ERROR("unable to register WriteCondHandle " << m_wchk.fullKey() + << " with CondSvc"); + return StatusCode::FAILURE; + } + + return StatusCode::SUCCESS; +} + +StatusCode NominalAlignmentCondAlg::finalize() { + ATH_MSG_DEBUG(name() << "::" << __FUNCTION__); + return StatusCode::SUCCESS; +} + +StatusCode NominalAlignmentCondAlg::execute() { + ATH_MSG_DEBUG(name() << "::" << __FUNCTION__); + + SG::WriteCondHandle<ActsAlignmentStore> wch(m_wchk); + + EventIDBase now(getContext().eventID()); + + // do we have a valid m_wch for current time? + if ( wch.isValid(now) ) { + ATH_MSG_DEBUG("CondHandle is already valid for " << now + << ". In theory this should not be called, but may happen" + << " if multiple concurrent events are being processed out of order."); + + } else { + + ATH_MSG_DEBUG(" CondHandle " << wch.key() + << " not valid now (" << now << "). Setting nominal alignment cond"); + + + EventIDBase start(1, EventIDBase::UNDEFEVT); + EventIDBase end(1, EventIDBase::UNDEFEVT); + start.set_lumi_block(0); + end.set_lumi_block(9999); // this is not actually forever + + EventIDRange r(start, end); + + ATH_MSG_DEBUG("Will register nominal alignment for range: " << r); + + // create empty alignment store, no deltas + ActsAlignmentStore* alignmentStore = new ActsAlignmentStore(); + + // populate the alignment store with all detector elements + auto trkGeom = m_trackingGeometrySvc->trackingGeometry(); + + + ATH_MSG_DEBUG("Populating ActsAlignmentStore for IOV"); + size_t nElems = 0; + trkGeom->visitSurfaces( + [alignmentStore, &nElems](const Acts::Surface* srf) { + const Acts::DetectorElementBase* detElem = srf->associatedDetectorElement(); + const auto* gmde = dynamic_cast<const ActsDetectorElement*>(detElem); + gmde->storeTransform(alignmentStore); + nElems++; + }); + ATH_MSG_DEBUG("ActsAlignmentStore populated for " << nElems << " detector elements"); + + + if (wch.record(r, alignmentStore).isFailure()) { + ATH_MSG_ERROR("could not record nominal ActsAlignmentStore " << wch.key() + << " = " << alignmentStore + << " with EventRange " << r); + return StatusCode::FAILURE; + } + + ATH_MSG_DEBUG("WCH is valid now? " << wch.isValid(now)); + } + return StatusCode::SUCCESS; +} diff --git a/Tracking/Acts/ActsGeometry/src/components/ActsGeometry_entries.cxx b/Tracking/Acts/ActsGeometry/src/components/ActsGeometry_entries.cxx new file mode 100755 index 0000000000000000000000000000000000000000..c0d740905517c9e96fe631cb38db51873cc690e5 --- /dev/null +++ b/Tracking/Acts/ActsGeometry/src/components/ActsGeometry_entries.cxx @@ -0,0 +1,31 @@ +/* + Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration +*/ + +#include "ActsGeometry/ActsExtrapolationAlg.h" +#include "ActsGeometry/ActsWriteTrackingGeometry.h" +#include "ActsGeometry/ActsTrackingGeometrySvc.h" +#include "ActsGeometry/ActsExtrapolationTool.h" +#include "ActsGeometry/ActsObjWriterTool.h" +//#include "ActsGeometry/ActsExCellWriterSvc.h" +#include "ActsGeometry/ActsMaterialTrackWriterSvc.h" + +//#include "ActsGeometry/GeomShiftCondAlg.h" +#include "ActsGeometry/NominalAlignmentCondAlg.h" +#include "ActsGeometry/ActsTrackingGeometryTool.h" + +#include "ActsGeometry/ActsPropStepRootWriterSvc.h" + +DECLARE_COMPONENT( ActsExtrapolationAlg ) +DECLARE_COMPONENT( ActsWriteTrackingGeometry ) +DECLARE_COMPONENT( ActsTrackingGeometrySvc ) +DECLARE_COMPONENT( ActsExtrapolationTool ) +DECLARE_COMPONENT( ActsObjWriterTool ) +//DECLARE_COMPONENT( ActsExCellWriterSvc ) +DECLARE_COMPONENT( ActsMaterialTrackWriterSvc ) + +//DECLARE_COMPONENT( GeomShiftCondAlg ) +DECLARE_COMPONENT( NominalAlignmentCondAlg ) +DECLARE_COMPONENT( ActsTrackingGeometryTool ) + +DECLARE_COMPONENT( ActsPropStepRootWriterSvc ) diff --git a/Tracking/Acts/ActsGeometry/src/util/ObjExCellWriter.h b/Tracking/Acts/ActsGeometry/src/util/ObjExCellWriter.h new file mode 100644 index 0000000000000000000000000000000000000000..5a89f9715d06877af1d40e986b3a3caa5af7a314 --- /dev/null +++ b/Tracking/Acts/ActsGeometry/src/util/ObjExCellWriter.h @@ -0,0 +1,108 @@ +/* + Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration +*/ + +// This file was largely imported from the Acts testing framework + +#pragma once + +#include <TTree.h> +#include <mutex> +#include "Acts/Extrapolation/ExtrapolationCell.hpp" +#include "Acts/Utilities/Logger.hpp" + + + + /// @class ExtrapolationCellWriter + /// + /// A obj based implementation to write out extrapolation steps + /// it is used to write obj representations of tracks for displaying + /// + /// Safe to use from multiple writer threads. + /// + template <class T> + class ObjExCellWriter + { + public: + // The nested configuration struct + struct Config + { + public: + /// output scalor + double outputScalor = 1.; + /// precision for out + size_t outputPrecision = 4; + /// the output stream + std::shared_ptr<std::ofstream> outputStream = nullptr; + }; + + /// Constructor + /// + /// @param cfg is the configuration object + /// @parm level is the output logging level + ObjExCellWriter(const Config& cfg + //Acts::Logging::Level lvl = Acts::Logging::INFO + ) + : m_cfg(cfg), m_vCounter(1) + { + if (!m_cfg.outputStream) { + throw std::invalid_argument("Missing output stream"); + } + } + + /// The protected writeT method, called by the WriterT base + /// @param ctx is the algorithm context for event consistency + void + write(const std::vector<Acts::ExtrapolationCell<T>>& ecells) { + + // loop over the cells + for (auto& eCell : ecells) { + // remember the first counter + size_t fCounter = m_vCounter; + + // increase the vertex counter + ++m_vCounter; + // the event paramters + auto sPosition = eCell.startParameters->position(); + // write the space point + (*(m_cfg.outputStream)) + << "v " << m_cfg.outputScalor * sPosition.x() << ", " + << m_cfg.outputScalor * sPosition.y() << ", " + << m_cfg.outputScalor * sPosition.z() << '\n'; + + // loop over extrapolation steps + for (auto& es : eCell.extrapolationSteps) { + if (es.parameters) { + /// step parameters + const T& pars = (*es.parameters); + auto tPosition = pars.position(); + // increase the counter + ++m_vCounter; + // write the space point + (*(m_cfg.outputStream)) + << "v " << m_cfg.outputScalor * tPosition.x() << ", " + << m_cfg.outputScalor * tPosition.y() << ", " + << m_cfg.outputScalor * tPosition.z() << '\n'; + } + } + // write out the line + for (size_t i=fCounter+1;i<m_vCounter;i++) { + (*(m_cfg.outputStream)) << "l "; + (*(m_cfg.outputStream)) << (i-1) << " " << i; + (*(m_cfg.outputStream)) << '\n'; + } + //(*(m_cfg.outputStream)) << "l "; + //for (size_t iv = fCounter; iv < m_vCounter; ++iv) + //(*(m_cfg.outputStream)) << iv << " "; + + //(*(m_cfg.outputStream)) << '\n'; + // new line + (*(m_cfg.outputStream)) << '\n'; + } + } + + private: + Config m_cfg; + size_t m_vCounter; +}; + diff --git a/Tracking/Acts/ActsGeometry/src/util/ObjHelper.cxx b/Tracking/Acts/ActsGeometry/src/util/ObjHelper.cxx new file mode 100644 index 0000000000000000000000000000000000000000..66181d9810cb614df41406f8df5ebe45d5dc134e --- /dev/null +++ b/Tracking/Acts/ActsGeometry/src/util/ObjHelper.cxx @@ -0,0 +1,195 @@ +/* + Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration +*/ + +// This file was largely imported from the Acts testing framework + +#include "ObjHelper.h" + +#include <vector> + +void +ObjHelper::writeVTN(std::ofstream& stream, + VtnCounter& vtnCounter, + double scalor, + const Acts::Vector3D& vertex, + const std::string& vtntype, + bool point) +{ + // in case you make a point + unsigned int cp = 0; + // the counter + if (vtntype == "v") { + ++vtnCounter.vcounter; + cp = vtnCounter.vcounter; + } else if (vtntype == "t") { + ++vtnCounter.vtcounter; + cp = vtnCounter.vtcounter; + } else if (vtntype == "n") { + ++vtnCounter.ncounter; + cp = vtnCounter.ncounter; + } else + return; + + // write out the vertex, texture vertex, normal + stream << vtntype << " " << scalor * vertex.x() << " " << scalor * vertex.y() + << " " << scalor * vertex.z() << '\n'; + // we create a point if needed + if (point) stream << "p " << cp; +} + +void +ObjHelper::constructVerticalFaces( + std::ofstream& stream, + unsigned int start, + const std::vector<unsigned int>& vsides) +{ + // construct the vertical faces + size_t nsides = vsides.size(); + unsigned int sstart = start; + for (auto vside : vsides) { + if (vside) { + // start streaming the side + // all but the last + if (start - sstart < nsides - 1) { + stream << "f " << start << " " << start + 1 << " "; + stream << start + nsides + 1 << " " << start + nsides; + } else { + stream << "f " << start << " " << sstart << " "; + stream << sstart + nsides << " " << start + nsides; + } + } + stream << '\n'; + // increase + ++start; + } +} + +void +ObjHelper::writePlanarFace(std::ofstream& stream, + VtnCounter& vtnCounter, + double scalor, + const std::vector<Acts::Vector3D>& vertices, + double thickness, + const std::vector<unsigned int>& vsides) +{ + // minimum 3 vertices needed + if (vertices.size() < 3) return; + // the first vertex + unsigned int fvertex = vtnCounter.vcounter + 1; + // lets create the normal vector first + Acts::Vector3D sideOne = vertices[1] - vertices[0]; + Acts::Vector3D sideTwo = vertices[2] - vertices[1]; + Acts::Vector3D nvector(sideTwo.cross(sideOne).normalized()); + // write the normal vector + writeVTN(stream, vtnCounter, scalor, nvector, "n"); + // thickness or not thickness + std::vector<int> sides = {1}; + if (thickness != 0.) sides = {-1, 1}; + // now write all the vertices - this works w/wo thickness + for (auto side : sides) { + // save the current vertex counter + unsigned int cvc = vtnCounter.vcounter; + // loop over the sides + for (auto v : vertices) + writeVTN(stream, + vtnCounter, + scalor, + v + (0.5 * side * thickness) * nvector, + "v"); + // decide if you want to add texture + std::string vtphr + = "/"; // vtnCounter.vtcounter ? "/"+std::to_string(vtcounter) : "/"; + std::string ntphr = "/" + std::to_string(vtnCounter.ncounter); + // now write the face + stream << "f "; + for (size_t i=0;i<vertices.size();++i) stream << ++cvc << vtphr << ntphr << " "; + stream << '\n'; + } + // now process the vertical sides + constructVerticalFaces(stream, fvertex, vsides); +} + +void +ObjHelper::writeTube(std::ofstream& stream, + VtnCounter& vtnCounter, + double scalor, + unsigned int nSegments, + const Acts::Transform3D& transform, + double r, + double hZ, + double thickness) +{ + // flip along plus/minus and declare the faces + std::vector<int> flip = {-1, 1}; + std::vector<int> vfaces = {1, 2, 4, 3}; + // the number of phisteps + double phistep = 2 * M_PI / nSegments; + // make it twice if necessary + std::vector<double> roffsets = {0.}; + if (thickness != 0.) roffsets = {-0.5 * thickness, 0.5 * thickness}; + // now loop over the thickness and make an outer and inner + unsigned int cvc = vtnCounter.vcounter; + size_t iside = 0; + for (auto t : roffsets) { + size_t iphi = 0; + // loop over phi steps + for (; iphi < nSegments; ++iphi) { + // currentPhi + double phi = -M_PI + iphi * phistep; + for (auto iflip : flip) { + // create the vertex + Acts::Vector3D point(transform * Acts::Vector3D((r + t) * cos(phi), + (r + t) * sin(phi), + iflip * hZ)); + // write the normal vector + writeVTN(stream, vtnCounter, scalor, point, "v"); + } + } + // now create the faces + iphi = 0; + // side offset for faces + unsigned int soff = 2 * iside * nSegments; + for (; iphi < nSegments - 1; ++iphi) { + // output to file + stream << "f "; + for (auto face : vfaces) stream << soff + cvc + (2 * iphi) + face << " "; + stream << '\n'; + } + // close the loop + stream << "f " << soff + cvc + (2 * iphi) + 1 << " " + << soff + cvc + (2 * iphi) + 2 << " " << soff + cvc + 2 << " " + << soff + cvc + 1 << '\n'; + // new line at the end of the line + stream << '\n'; + ++iside; + } + + // construct the sides at the end when all vertices are done + Acts::Vector3D nvectorSide = transform.rotation().col(2); + // write the normal vector @todo flip sides + writeVTN(stream, vtnCounter, scalor, nvectorSide, "n"); + std::string ntphr = "//" + std::to_string(vtnCounter.ncounter); + + if (thickness != 0.) { + // loop over the two sides + for (iside = 0; iside < 2; ++iside) { + // rest iphi + size_t iphi = 0; + for (; iphi < nSegments - 1; ++iphi) { + stream << "f "; + unsigned int base = cvc + (2 * iphi) + 1; + stream << iside + base << ntphr << " "; + stream << iside + base + 2 << ntphr << " "; + stream << iside + base + (2 * nSegments) + 2 << ntphr << " "; + stream << iside + base + (2 * nSegments) << ntphr << '\n'; + } + // close the loop + stream << "f "; + stream << iside + cvc + (2 * iphi) + 1 << ntphr << " "; + stream << iside + cvc + 1 << ntphr << " "; + stream << iside + cvc + 1 + (2 * nSegments) << ntphr << " "; + stream << iside + cvc + (2 * iphi) + 1 + (2 * nSegments) << ntphr << '\n'; + } + } +} diff --git a/Tracking/Acts/ActsGeometry/src/util/ObjHelper.h b/Tracking/Acts/ActsGeometry/src/util/ObjHelper.h new file mode 100644 index 0000000000000000000000000000000000000000..2c55113fc96b4a257267c1074f7a5e409e64bd87 --- /dev/null +++ b/Tracking/Acts/ActsGeometry/src/util/ObjHelper.h @@ -0,0 +1,72 @@ +/* + Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration +*/ + +// This file was largely imported from the Acts testing framework + +#pragma once + +#include <fstream> +#include <vector> +#include "Acts/Utilities/Definitions.hpp" + + +namespace ObjHelper { + + /// This is the counter struct for keeping track of the vertices + struct VtnCounter + { + unsigned int vcounter = 0; + unsigned int vtcounter = 0; + unsigned int ncounter = 0; + }; + + /// This will write a vertex to the fstream + /// @param stream is the stream where to write to + /// @param vertex is the vertex to be written out + /// @param cvertex is the current vertex number + void + writeVTN(std::ofstream& stream, + VtnCounter& vtnCounter, + double scalor, + const Acts::Vector3D& vertex, + const std::string& vtntype = "v", + bool point = false); + + /// construct vertical faces + /// this takes a range and constructs faces + void + constructVerticalFaces(std::ofstream& stream, + unsigned int start, + const std::vector<unsigned int>& vsides); + + /// This will write a planar face + /// - normal is given by cross product + /// + /// @param stream is the stream where to write to + /// @param face is the face to be written out + /// @param cvertex is the current vertex number + /// @param thickness is the (optional) thickness + void + writePlanarFace(std::ofstream& stream, + VtnCounter& vtnCounter, + double scalor, + const std::vector<Acts::Vector3D>& vertices, + double thickness = 0., + const std::vector<unsigned int>& vsides = {}); + + /// This will write a cylindrical object + /// + /// @param stream is the stream where to write to + void + writeTube(std::ofstream& stream, + VtnCounter& vtnCounter, + double scalor, + unsigned int nSegments, + const Acts::Transform3D& transform, + double r, + double hZ, + double thickness = 0.); + +} // enf of namespace + diff --git a/Tracking/Acts/ActsGeometry/src/util/ObjSurfaceWriter.cxx b/Tracking/Acts/ActsGeometry/src/util/ObjSurfaceWriter.cxx new file mode 100644 index 0000000000000000000000000000000000000000..ce21ef70cd74569d9fb8a75f2d73311bff974935 --- /dev/null +++ b/Tracking/Acts/ActsGeometry/src/util/ObjSurfaceWriter.cxx @@ -0,0 +1,178 @@ +/* + Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration +*/ + +// This file was largely imported from the Acts testing framework + +#include "ObjSurfaceWriter.h" + +#include <ios> +#include <iostream> +#include <stdexcept> + +#include "Acts/Layers/Layer.hpp" +#include "Acts/Surfaces/CylinderBounds.hpp" +#include "Acts/Surfaces/PlanarBounds.hpp" +#include "Acts/Surfaces/RadialBounds.hpp" +#include "Acts/Surfaces/SurfaceBounds.hpp" +#include "Acts/Utilities/GeometryID.hpp" + +#include "Acts/Surfaces/PolyhedronRepresentation.hpp" +#include "Acts/Surfaces/CylinderSurface.hpp" +#include "Acts/Surfaces/StrawSurface.hpp" +Acts::ObjSurfaceWriter::ObjSurfaceWriter( + const ObjSurfaceWriter::Config& cfg) + : m_cfg(cfg) +{ + // Validate the configuration + if (!m_cfg.logger) { + throw std::invalid_argument("Missing logger"); + } else if (m_cfg.name.empty()) { + throw std::invalid_argument("Missing algorithm name"); + } else if (!m_cfg.outputStream) { + throw std::invalid_argument("Missing output stream"); + } + + // Write down the file prefix + (*(m_cfg.outputStream)) << m_cfg.filePrefix << '\n'; +} + +std::string +Acts::ObjSurfaceWriter::name() const +{ + return m_cfg.name; +} +void +Acts::ObjSurfaceWriter::write(const std::string& sinfo) +{ + // lock the mutex for writing + std::lock_guard<std::mutex> lock(m_write_mutex); + // and write + (*m_cfg.outputStream) << sinfo; +} + +void +Acts::ObjSurfaceWriter::write(const Acts::Surface& surface) +{ + std::lock_guard<std::mutex> lock(m_write_mutex); + + // check + ACTS_DEBUG(">>Obj: Writer for Surface object called."); + + auto scalor = m_cfg.outputScalor; + // let's get the bounds & the transform + const Acts::SurfaceBounds& surfaceBounds = surface.bounds(); + auto sTransform = surface.transform(); + + // dynamic_cast to PlanarBounds + const Acts::PlanarBounds* planarBounds + = dynamic_cast<const Acts::PlanarBounds*>(&surfaceBounds); + + const Acts::CylinderBounds* cylinderBounds + = dynamic_cast<const Acts::CylinderBounds*>(&surfaceBounds); + + const Acts::StrawSurface* strawSurface + = dynamic_cast<const Acts::StrawSurface*>(&surface); + + // only continue if the cast worked + if (m_cfg.outputSensitive) { + if (planarBounds) { + ACTS_VERBOSE(">>Obj: Writing out a PlaneSurface"); + // set the precision - just to be sure + (*(m_cfg.outputStream)) << '\n'; + (*(m_cfg.outputStream)) << std::setprecision(m_cfg.outputPrecision); + // get the vertices + auto planarVertices = planarBounds->vertices(); + // loop over the vertices + std::vector<Acts::Vector3D> vertices; + vertices.reserve(planarVertices.size()); + for (auto pv : planarVertices) { + // get the point in 3D + Acts::Vector3D v3D(sTransform * Acts::Vector3D(pv.x(), pv.y(), 0.)); + vertices.push_back(v3D); + } + // get the thickness and vertical faces + double thickness = 0.; + std::vector<unsigned int> vfaces; + if (surface.associatedDetectorElement()) { + // get the thickness form the detector element + thickness = surface.associatedDetectorElement()->thickness(); + vfaces = {1, 1, 1, 1}; + } + // output to file + ObjHelper::writePlanarFace(*(m_cfg.outputStream), + m_vtnCounter, + scalor, + vertices, + thickness, + vfaces); + (*(m_cfg.outputStream)) << '\n'; + } + else if(cylinderBounds) { + + auto cylinderSurface = dynamic_cast<const Acts::CylinderSurface*>(&surface); + + Acts::PolyhedronRepresentation ph = cylinderSurface->polyhedronRepresentation(); + (*(m_cfg.outputStream)) << ph.objString(m_vtnCounter.vcounter); + m_vtnCounter.vcounter += ph.vertices.size(); + + } + else if(strawSurface) { + + Acts::PolyhedronRepresentation ph = strawSurface->polyhedronRepresentation(); + (*(m_cfg.outputStream)) << ph.objString(m_vtnCounter.vcounter); + m_vtnCounter.vcounter += ph.vertices.size(); + + } + else { + ACTS_ERROR("Unable to print this bounds type: " << surfaceBounds.type()); + } + } + + // check if you have layer and check what your have + // dynamic cast to CylinderBounds work the same + if (cylinderBounds && m_cfg.outputLayerSurface) { + ACTS_VERBOSE(">>Obj: Writing out a CylinderSurface with r = " + << cylinderBounds->r()); + // name the object + auto layerID = surface.geoID().value(Acts::GeometryID::layer_mask); + (*(m_cfg.outputStream)) + << " o Cylinder_" << std::to_string(layerID) << '\n'; + // output to the file + ObjHelper::writeTube(*(m_cfg.outputStream), + m_vtnCounter, + scalor, + m_cfg.outputPhiSegments, + sTransform, + cylinderBounds->r(), + cylinderBounds->halflengthZ(), + m_cfg.outputThickness); + (*(m_cfg.outputStream)) << '\n'; + } + + ////dynamic cast to RadialBounds or disc bounds work the same + const Acts::RadialBounds* radialBounds + = dynamic_cast<const Acts::RadialBounds*>(&surfaceBounds); + if (radialBounds && m_cfg.outputLayerSurface) { + ACTS_VERBOSE(">>Obj: Writing out a DiskSurface at z = " + << sTransform.translation().z()); + // name the object + auto layerID = surface.geoID().value(Acts::GeometryID::layer_mask); + (*(m_cfg.outputStream)) << "o Disk_" << std::to_string(layerID) << '\n'; + // we use the tube writer in the other direction + double rMin = radialBounds->rMin(); + double rMax = radialBounds->rMax(); + double thickness = rMax - rMin; + // output to the file + ObjHelper::writeTube(*(m_cfg.outputStream), + m_vtnCounter, + scalor, + m_cfg.outputPhiSegments, + sTransform, + 0.5 * (rMin + rMax), + m_cfg.outputThickness, + thickness); + (*(m_cfg.outputStream)) << '\n'; + } + +} diff --git a/Tracking/Acts/ActsGeometry/src/util/ObjSurfaceWriter.h b/Tracking/Acts/ActsGeometry/src/util/ObjSurfaceWriter.h new file mode 100644 index 0000000000000000000000000000000000000000..e734f1ffe883396efb9072df1ac9a3dee459d394 --- /dev/null +++ b/Tracking/Acts/ActsGeometry/src/util/ObjSurfaceWriter.h @@ -0,0 +1,96 @@ +/* + Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration +*/ + +// This file was largely imported from the Acts testing framework + +#pragma once + +#include <fstream> +#include <iostream> +#include <mutex> +#include "ObjHelper.h" +#include "Acts/Surfaces/Surface.hpp" +#include "Acts/Utilities/Logger.hpp" + +namespace Acts { + +/// @class ObjSurfaceWriter +/// +/// An Obj writer for the geometry +/// +class ObjSurfaceWriter +{ +public: + // @class Config + // + // The nested config class + class Config + { + public: + /// the default logger + std::shared_ptr<const Acts::Logger> logger; + /// the name of the algorithm + std::string name; + /// approximate cyinders by that + unsigned int outputPhiSegments = 72; + /// write thickness if available + double outputThickness = 2.; + /// write sensitive surfaces + bool outputSensitive = true; + /// write the layer surface out + bool outputLayerSurface = true; + /// output scalor + double outputScalor = 1.; + /// precision for out + unsigned int outputPrecision = 6; + /// file prefix to be written out + std::string filePrefix = ""; + /// prefixes + /// @todo These aren't used anywhere, should they be dropped? + std::string planarPrefix = ""; + std::string cylinderPrefix = ""; + std::string diskPrefix = ""; + /// the output stream + std::shared_ptr<std::ofstream> outputStream = nullptr; + + Config(const std::string& lname = "ObjSurfaceWriter", + Acts::Logging::Level lvl = Acts::Logging::INFO) + : logger(Acts::getDefaultLogger(lname, lvl)), name(lname) + { + } + }; + + /// Constructor + /// + /// @param cfg is the configuration class + ObjSurfaceWriter(const Config& cfg); + + /// Framework name() method + std::string + name() const; + + /// The write interface + /// @param surface to be written out + void + write(const Acts::Surface& surface); + + /// write a bit of string + /// @param is the string to be written + void + write(const std::string& sinfo); + +private: + Config m_cfg; ///< the config class + ObjHelper::VtnCounter m_vtnCounter; ///< vertex, texture, normal + std::mutex m_write_mutex; ///< mutex to protect multi-threaded writes + + /// Private access to the logging instance + const Acts::Logger& + logger() const + { + return *m_cfg.logger; + } +}; + +} diff --git a/Tracking/Acts/ActsGeometry/src/util/ObjTrackingGeometryWriter.cxx b/Tracking/Acts/ActsGeometry/src/util/ObjTrackingGeometryWriter.cxx new file mode 100644 index 0000000000000000000000000000000000000000..1eae3bedb271de7d236d822583b569c03b93af0c --- /dev/null +++ b/Tracking/Acts/ActsGeometry/src/util/ObjTrackingGeometryWriter.cxx @@ -0,0 +1,83 @@ +/* + Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration +*/ + +// This file was largely imported from the Acts testing framework + +#include "ObjTrackingGeometryWriter.h" + +#include <iostream> +#include "Acts/Detector/TrackingVolume.hpp" +#include "Acts/Surfaces/Surface.hpp" + +Acts::ObjTrackingGeometryWriter::ObjTrackingGeometryWriter( + const ObjTrackingGeometryWriter::Config& cfg) + : m_cfg(cfg) +{ +} + +std::string +Acts::ObjTrackingGeometryWriter::name() const +{ + return m_cfg.name; +} + +void +Acts::ObjTrackingGeometryWriter::write(const Acts::TrackingGeometry& tGeometry) +{ + ACTS_DEBUG(">>Obj: Writer for TrackingGeometry object called."); + // get the world volume + auto world = tGeometry.highestTrackingVolume(); + if (world) write(*world); + // return the success code +} + +/// process this volume +void +Acts::ObjTrackingGeometryWriter::write(const Acts::TrackingVolume& tVolume) +{ + ACTS_DEBUG(">>Obj: Writer for TrackingVolume object called."); + // get the confined layers and process them + if (tVolume.confinedLayers()) { + ACTS_VERBOSE(">>Obj: Layers are present, process them."); + // loop over the layers + for (auto layer : tVolume.confinedLayers()->arrayObjects()) { + // we jump navigation layers + if (layer->layerType() == Acts::navigation) continue; + // get the volume name + const std::string& volumeName = tVolume.volumeName(); + // find the right surfacewriter + std::shared_ptr<ObjSurfaceWriter> surfaceWriter = nullptr; + for (auto writer : m_cfg.surfaceWriters) { + // get name and writer + auto writerName = writer->name(); + if (volumeName.find(writerName) != std::string::npos) { + // asign the writer + surfaceWriter = writer; + // and break + break; + } + } + // bail out if you have no surface writer + if (!surfaceWriter) return; + // layer prefix + surfaceWriter->write(m_cfg.layerPrefix); + // check for sensitive surfaces + if (layer->surfaceArray() && surfaceWriter) { + // surfaces + surfaceWriter->write(m_cfg.sensitiveGroupPrefix); + // loop over the surface + for (auto surface : layer->surfaceArray()->surfaces()) { + if (surface) surfaceWriter->write(*surface); + } + } + } + } + // get the confined volumes and step down the hierarchy + if (tVolume.confinedVolumes()) { + // loop over the volumes and write what they have + for (auto volume : tVolume.confinedVolumes()->arrayObjects()) { + write(*volume.get()); + } + } +} diff --git a/Tracking/Acts/ActsGeometry/src/util/ObjTrackingGeometryWriter.h b/Tracking/Acts/ActsGeometry/src/util/ObjTrackingGeometryWriter.h new file mode 100644 index 0000000000000000000000000000000000000000..e83d338d0c2128fffc546fc68f6b12e413450b85 --- /dev/null +++ b/Tracking/Acts/ActsGeometry/src/util/ObjTrackingGeometryWriter.h @@ -0,0 +1,83 @@ +/* + Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration +*/ + +// This file was largely imported from the Acts testing framework + +#pragma once + +#include <mutex> + +#include <fstream> +#include <iostream> +#include "ObjSurfaceWriter.h" +#include "Acts/Detector/TrackingGeometry.hpp" +#include "Acts/Surfaces/Surface.hpp" +#include "Acts/Utilities/Logger.hpp" + +namespace Acts { +class TrackingVolume; + +/// @class ObjTrackingGeometryWriter +/// +/// An Obj writer for the geometry +/// It delegates the writing of surfaces to the surface writers +class ObjTrackingGeometryWriter { +public: + // @class Config + // + // The nested config class + class Config + { + public: + /// the default logger + std::shared_ptr<const Acts::Logger> logger; + /// the name of the writer + std::string name = ""; + /// surfaceWriters + std::vector<std::shared_ptr<ObjSurfaceWriter>> surfaceWriters; + std::string filePrefix = ""; + std::string sensitiveGroupPrefix = ""; + std::string layerPrefix = ""; + + Config(const std::string& lname = "ObjTrackingGeometryWriter", + Acts::Logging::Level lvl = Acts::Logging::INFO) + : logger(Acts::getDefaultLogger(lname, lvl)) + , name(lname) + , surfaceWriters() + { + } + }; + + /// Constructor + /// @param cfg is the configuration class + ObjTrackingGeometryWriter(const Config& cfg); + + /// Framework name() method + /// @return the name of the tool + std::string + name() const; + + /// The write interface + /// @param tGeometry is the geometry to be written out + /// @return ProcessCode to indicate success/failure + void + write(const Acts::TrackingGeometry& tGeometry); + +private: + Config m_cfg; ///< the config class + + /// process this volume + /// @param tVolume the volume to be processed + void + write(const Acts::TrackingVolume& tVolume); + + /// Private access to the logging instance + const Acts::Logger& + logger() const + { + return *m_cfg.logger; + } +}; + +} diff --git a/Tracking/Acts/ActsGeometry/src/util/RootExCellWriter.h b/Tracking/Acts/ActsGeometry/src/util/RootExCellWriter.h new file mode 100644 index 0000000000000000000000000000000000000000..fe84dd92f7e678140f605995e7391e7c10e2bd5f --- /dev/null +++ b/Tracking/Acts/ActsGeometry/src/util/RootExCellWriter.h @@ -0,0 +1,108 @@ +/* + Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration +*/ + +// This file was largely imported from the Acts testing framework + +#pragma once + +#include <TFile.h> +#include <TTree.h> +#include <mutex> +#include "Acts/Extrapolation/ExtrapolationCell.hpp" +#include "Acts/Utilities/Logger.hpp" + +class TFile; + +#ifndef MAXSTEPS +#define MAXSTEPS 100 +#endif + + /// @class ExtrapolationCellWriter + /// + /// A root based implementation to write out extrapolation steps. + /// + /// Safe to use from multiple writer threads. + /// + template <class T> + class RootExCellWriter + { + public: + + /// @struct ExtrapolationStep + /// this holds the information to be written out + struct ExtrapolationStep + { + float x, y, z; ///< position (global) + float px, py, pz; ///< momentum + float type; ///< type of the step + }; + + // @struct Config + // + // The nested config class + struct Config + { + public: + std::string filePath; ///< path of the output file + std::string fileMode = "RECREATE"; ///< file access mode + std::string treeName + = "extrapolation_cells"; ///< name of the output tree + bool writeSensitive; + bool writeMaterial; + bool writePassive; + bool writeBoundary; + }; + + /// Constructor + /// @param cfg is the configuration class + RootExCellWriter(const Config& cfg + //Acts::Logging::Level level = Acts::Logging::INFO + ); + + /// Virtual destructor + ~RootExCellWriter(); + + /// End-of-run hook + void + endRun(); + + /// The protected writeT method, called by the WriterT base + /// @param [in] ecells are the celss to be written out + void + write( + const Acts::ExtrapolationCell<T>& ecell, int eventNum); + + protected: + + Config m_cfg; ///< the config class + std::mutex m_writeMutex; ///< protect multi-threaded writes + TFile* m_outputFile; ///< the output file + TTree* m_outputTree; ///< the output tree + float m_eta; ///< global eta start + float m_phi; ///< global phi start + float m_materialX0; ///< material in X0 + float m_materialL0; ///< material in L0 + int m_eventNum; + std::vector<float> m_s_positionX; ///< global position x of the step + std::vector<float> m_s_positionY; ///< global position y of the step + std::vector<float> m_s_positionZ; ///< global position z of the step + std::vector<float> m_s_positionR; ///< global position z of the step + std::vector<float> m_s_materialX0; ///< step material X0 + std::vector<float> m_s_materialL0; ///< step material L0 + std::vector<int> m_s_material; ///< type of the step: material + std::vector<int> m_s_boundary; ///< type of the step: boundary + std::vector<int> m_s_sensitive; ///< type of the step: sensitive + std::vector<int> m_s_volumeID; ///< volume identification + std::vector<int> m_s_layerID; ///< layer identification + std::vector<int> m_s_surfaceID; ///< surface identification + std::vector<float> + m_s_localposition0; ///< local position - first coordinate + std::vector<float> + m_s_localposition1; ///< local position - second coordinate + int m_hits; ///< number of hits in sensitive material + }; + + +#include "RootExCellWriter.icc" + diff --git a/Tracking/Acts/ActsGeometry/src/util/RootExCellWriter.icc b/Tracking/Acts/ActsGeometry/src/util/RootExCellWriter.icc new file mode 100644 index 0000000000000000000000000000000000000000..bebcf848194104f192418d06efcc71af650a4b96 --- /dev/null +++ b/Tracking/Acts/ActsGeometry/src/util/RootExCellWriter.icc @@ -0,0 +1,228 @@ +/* + Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration +*/ + +// This file was largely imported from the Acts testing framework + +#include <ios> +#include <stdexcept> +#include <forward_list> +#include "Acts/Utilities/Helpers.hpp" + +template <class T> +void +RootExCellWriter<T>::write( + const Acts::ExtrapolationCell<T>& eCell, int eventNum) +{ + using Acts::VectorHelpers::eta; + using Acts::VectorHelpers::phi; + using Acts::VectorHelpers::perp; + + // exclusive access to the tree + std::lock_guard<std::mutex> lock(m_writeMutex); + + // loop over all the extrapolation cells + // the event paramters + auto sMomentum = eCell.startParameters->momentum(); + m_eta = eta(sMomentum); + m_phi = phi(sMomentum); + m_materialX0 = eCell.materialX0; + m_materialL0 = eCell.materialL0; + + m_eventNum = eventNum; + + + // clear the vectors & reserve + // - for main step information + m_s_positionX.clear(); + m_s_positionY.clear(); + m_s_positionZ.clear(); + m_s_positionR.clear(); + m_s_volumeID.clear(); + m_s_layerID.clear(); + m_s_surfaceID.clear(); + m_s_positionX.reserve(MAXSTEPS); + m_s_positionY.reserve(MAXSTEPS); + m_s_positionZ.reserve(MAXSTEPS); + m_s_positionR.reserve(MAXSTEPS); + m_s_volumeID.reserve(MAXSTEPS); + m_s_layerID.reserve(MAXSTEPS); + m_s_surfaceID.reserve(MAXSTEPS); + + // - for the sensitive + if (m_cfg.writeSensitive) { + m_s_sensitive.clear(); + m_s_localposition0.clear(); + m_s_localposition1.clear(); + m_s_sensitive.reserve(MAXSTEPS); + m_s_localposition0.reserve(MAXSTEPS); + m_s_localposition1.reserve(MAXSTEPS); + } + // - for the material + if (m_cfg.writeMaterial) { + m_s_material.clear(); + m_s_materialX0.clear(); + m_s_materialL0.clear(); + m_s_material.reserve(MAXSTEPS); + m_s_materialX0.reserve(MAXSTEPS); + m_s_materialL0.reserve(MAXSTEPS); + } + // - for the boundary + if (m_cfg.writeBoundary) { + m_s_boundary.clear(); + m_s_boundary.reserve(MAXSTEPS); + } + // the number of sensitive hits per event + m_hits = 0; + // loop over extrapolation steps + for (auto& es : eCell.extrapolationSteps) { + if (es.parameters) { + /// step parameters + const T& pars = (*es.parameters); + /// type information + int material = es.configuration.checkMode( + Acts::ExtrapolationMode::CollectMaterial); + int boundary = es.configuration.checkMode( + Acts::ExtrapolationMode::CollectBoundary); + int sensitive = es.configuration.checkMode( + Acts::ExtrapolationMode::CollectSensitive); + int passive = es.configuration.checkMode( + Acts::ExtrapolationMode::CollectPassive); + + /// check the layer, surface, volume ID + geo_id_value volumeID = pars.referenceSurface().geoID().value( + Acts::GeometryID::volume_mask); + geo_id_value layerID = pars.referenceSurface().geoID().value( + Acts::GeometryID::layer_mask); + geo_id_value surfaceID = pars.referenceSurface().geoID().value( + Acts::GeometryID::sensitive_mask); + /// + if ((m_cfg.writeSensitive && sensitive) + || (m_cfg.writeBoundary && boundary) + || (m_cfg.writeMaterial && material) + || (m_cfg.writePassive && passive)) { + + // the material steps + if (m_cfg.writeMaterial) { + // the material is being written out + double materialStepX0 = 0.; + double materialStepL0 = 0.; + if (es.material) { + // assign the material + materialStepX0 + = es.materialScaling * es.material->thicknessInX0(); + materialStepX0 + = es.materialScaling * es.material->thicknessInL0(); + } + m_s_materialX0.push_back(materialStepX0); + m_s_materialX0.push_back(materialStepL0); + } + + /// goblal position information + m_s_positionX.push_back(pars.position().x()); + m_s_positionY.push_back(pars.position().y()); + m_s_positionZ.push_back(pars.position().z()); + m_s_positionR.push_back(perp(pars.position())); + + /// local position information - only makes sense for sensitive really + if (m_cfg.writeSensitive) { + m_s_localposition0.push_back(pars.parameters()[Acts::eLOC_X]); + m_s_localposition1.push_back(pars.parameters()[Acts::eLOC_Y]); + } + /// volume, layer and surface ID + m_s_volumeID.push_back(volumeID); + m_s_layerID.push_back(layerID); + m_s_surfaceID.push_back(surfaceID); + /// indicate what hit you have + m_s_material.push_back(material); + m_s_boundary.push_back(boundary); + m_s_sensitive.push_back(sensitive); + } + if (sensitive) m_hits++; + } + } + m_outputTree->Fill(); +} + +template <class T> +RootExCellWriter<T>::RootExCellWriter( + const RootExCellWriter<T>::Config& cfg + //Acts::Logging::Level level + ) + : m_cfg(cfg) + , m_outputFile(nullptr) + , m_outputTree(nullptr) +{ + // Validate the configuration + /*if (m_cfg.collection.empty()) { + throw std::invalid_argument("Missing input collection"); + } else*/ if (m_cfg.treeName.empty()) { + throw std::invalid_argument("Missing tree name"); + } + + // Setup ROOT I/O + m_outputFile = TFile::Open(m_cfg.filePath.c_str(), m_cfg.fileMode.c_str()); + if (!m_outputFile) { + throw std::ios_base::failure("Could not open '" + m_cfg.filePath); + } + m_outputFile->cd(); + m_outputTree + = new TTree(m_cfg.treeName.c_str(), "TTree from RootPlanarClusterWriter"); + if (!m_outputTree) throw std::bad_alloc(); + + // Initial parameters + m_outputTree->Branch("eta", &m_eta); + m_outputTree->Branch("phi", &m_phi); + + m_outputTree->Branch("evtNum", &m_eventNum); + + // Output the step information + m_outputTree->Branch("step_x", &m_s_positionX); + m_outputTree->Branch("step_y", &m_s_positionY); + m_outputTree->Branch("step_z", &m_s_positionZ); + m_outputTree->Branch("step_r", &m_s_positionR); + + // Identification + m_outputTree->Branch("volumeID", &m_s_volumeID); + m_outputTree->Branch("layerID", &m_s_layerID); + m_outputTree->Branch("surfaceID", &m_s_surfaceID); + + // Material section + if (m_cfg.writeMaterial) { + m_outputTree->Branch("material_X0", &m_materialX0); + m_outputTree->Branch("material_L0", &m_materialL0); + m_outputTree->Branch("step_material_X0", &m_s_materialX0); + m_outputTree->Branch("step_material_L0", &m_s_materialL0); + m_outputTree->Branch("material", &m_s_material); + } + + + // Sensitive section + if (m_cfg.writeSensitive) { + m_outputTree->Branch("sensitive", &m_s_sensitive); + m_outputTree->Branch("step_l0", &m_s_localposition0); + m_outputTree->Branch("step_l1", &m_s_localposition1); + } + + // Boundary section + if (m_cfg.writeBoundary) m_outputTree->Branch("boundary", &m_s_boundary); + + // Number of sensitive hits + m_outputTree->Branch("hits", &m_hits); +} + +template <class T> +RootExCellWriter<T>::~RootExCellWriter() +{ + m_outputFile->Close(); +} + +template <class T> +void +RootExCellWriter<T>::endRun() +{ + m_outputFile->cd(); + m_outputTree->Write(); + // ACTS_INFO("Wrote particles to tree '" << m_cfg.treeName << "' in '" + // << m_cfg.filePath << "'"); +} diff --git a/Tracking/Acts/ActsGeometry/src/util/RootIndexedMaterialWriter.cxx b/Tracking/Acts/ActsGeometry/src/util/RootIndexedMaterialWriter.cxx new file mode 100644 index 0000000000000000000000000000000000000000..07cdd756f3981ea6930ea50f31056c9e772f0ebe --- /dev/null +++ b/Tracking/Acts/ActsGeometry/src/util/RootIndexedMaterialWriter.cxx @@ -0,0 +1,149 @@ +/* + Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration +*/ + +// This file was largely imported from the Acts testing framework + +#include "RootIndexedMaterialWriter.h" +#include <ios> +#include <iostream> +#include <stdexcept> +#include "Acts/Material/BinnedSurfaceMaterial.hpp" +#include "Acts/Utilities/GeometryID.hpp" +#include "TFile.h" +#include "TH2F.h" + +Acts::RootIndexedMaterialWriter::RootIndexedMaterialWriter( + Acts::RootIndexedMaterialWriter::Config& cfg) + : m_cfg(std::move(cfg)) + , m_outputFile(nullptr) +{ + // Validate the configuration + if (m_cfg.folderNameBase.empty()) { + throw std::invalid_argument("Missing folder name base"); + } else if (m_cfg.fileName.empty()) { + throw std::invalid_argument("Missing file name"); + } else if (!m_cfg.logger) { + throw std::invalid_argument("Missing logger"); + } else if (m_cfg.name.empty()) { + throw std::invalid_argument("Missing service name"); + } + + // Setup ROOT I/O + m_outputFile = TFile::Open(m_cfg.fileName.c_str(), "recreate"); + if (!m_outputFile) { + throw std::ios_base::failure("Could not open '" + m_cfg.fileName); + } +} + +Acts::RootIndexedMaterialWriter::~RootIndexedMaterialWriter() +{ + m_outputFile->Close(); +} + +void +Acts::RootIndexedMaterialWriter::write( + const Acts::IndexedSurfaceMaterial& ism) +{ + // lock the mutex + std::lock_guard<std::mutex> lock(m_write_mutex); + + // get the geometry ID + Acts::GeometryID geoID = ism.first; + // decode the geometryID + geo_id_value gvolID = geoID.value(Acts::GeometryID::volume_mask); + geo_id_value glayID = geoID.value(Acts::GeometryID::layer_mask); + geo_id_value gappID = geoID.value(Acts::GeometryID::approach_mask); + geo_id_value gsenID = geoID.value(Acts::GeometryID::sensitive_mask); + // create the directory + std::string tdName = m_cfg.folderNameBase.c_str(); + tdName += "_vol" + std::to_string(gvolID); + tdName += "_lay" + std::to_string(glayID); + tdName += "_app" + std::to_string(gappID); + tdName += "_sen" + std::to_string(gsenID); + // create a new directory + m_outputFile->mkdir(tdName.c_str()); + m_outputFile->cd(tdName.c_str()); + + ACTS_INFO("Writing out map at " << tdName); + + size_t bins0 = 0, bins1 = 0; + // understand what sort of material you have in mind + Acts::BinnedSurfaceMaterial* bsm + = dynamic_cast<Acts::BinnedSurfaceMaterial*>(ism.second); + if (bsm) { + // overwrite the bin numbers + bins0 = bsm->binUtility().bins(0); + bins1 = bsm->binUtility().bins(1); + } + TH2F* t = new TH2F("t", + "thickness [mm] ;b0 ;b1", + bins0, + -0.5, + bins0 - 0.5, + bins1, + -0.5, + bins1 - 0.5); + TH2F* x0 = new TH2F("X0", + "X_{0} [mm] ;b0 ;b1", + bins0, + -0.5, + bins0 - 0.5, + bins1, + -0.5, + bins1 - 0.5); + TH2F* l0 = new TH2F("L0", + "#Lambda_{0} [mm] ;b0 ;b1", + bins0, + -0.5, + bins0 - 0.5, + bins1, + -0.5, + bins1 - 0.5); + TH2F* A = new TH2F("A", + "X_{0} [mm] ;b0 ;b1", + bins0, + -0.5, + bins0 - 0.5, + bins1, + -0.5, + bins1 - 0.5); + TH2F* Z = new TH2F("Z", + "#Lambda_{0} [mm] ;b0 ;b1", + bins0, + -0.5, + bins0 - 0.5, + bins1, + -0.5, + bins1 - 0.5); + TH2F* rho = new TH2F("rho", + "#rho [g/mm^3] ;b0 ;b1", + bins0, + -0.5, + bins0 - 0.5, + bins1, + -0.5, + bins1 - 0.5); + + // loop over the material and fill + for (size_t b0 = 0; b0 < bins0; ++b0) + for (size_t b1 = 0; b1 < bins1; ++b1) { + // get the material for the bin + auto mat = bsm->material(b0, b1); + if (mat) { + t->SetBinContent(b0 + 1, b1 + 1, mat->thickness()); + x0->SetBinContent(b0 + 1, b1 + 1, mat->material().X0()); + l0->SetBinContent(b0 + 1, b1 + 1, mat->material().L0()); + A->SetBinContent(b0 + 1, b1 + 1, mat->material().A()); + Z->SetBinContent(b0 + 1, b1 + 1, mat->material().Z()); + rho->SetBinContent(b0 + 1, b1 + 1, mat->material().rho()); + } + } + t->Write(); + x0->Write(); + l0->Write(); + A->Write(); + Z->Write(); + rho->Write(); + +} diff --git a/Tracking/Acts/ActsGeometry/src/util/RootIndexedMaterialWriter.h b/Tracking/Acts/ActsGeometry/src/util/RootIndexedMaterialWriter.h new file mode 100644 index 0000000000000000000000000000000000000000..ba4e4ad6df013a7ec059a140039a9c5895d2406e --- /dev/null +++ b/Tracking/Acts/ActsGeometry/src/util/RootIndexedMaterialWriter.h @@ -0,0 +1,96 @@ +/* + Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration +*/ + +// This file was largely imported from the Acts testing framework + +#pragma once + +#include <mutex> +#include "Acts/Material/SurfaceMaterial.hpp" +#include "Acts/Utilities/Definitions.hpp" +#include "Acts/Utilities/Logger.hpp" +#include "TFile.h" + +namespace Acts { + + /// @class RootMaterialTrackWriter + /// + /// @brief Writes out MaterialTrack entities from a root file + /// + /// This service is the root implementation of the IWriterT. + /// It writes out a MaterialTrack which is usually generated from + /// Geant4 material mapping + + class RootIndexedMaterialWriter + { + + public: + /// @class Config + /// Configuration of the Writer + class Config + { + public: + /// The name of the output tree + std::string folderNameBase = "Material"; + /// The name of the output file + std::string fileName; + /// The default logger + std::unique_ptr<const Acts::Logger> logger; + /// The name of the service + std::string name; + + //Config(Config& cfg) + //: folderNameBase(cfg.folderNameBase) + //, fileName(cfg.fileName) + //, logger(std::move(cfg.logger)) + //, name(cfg.name) + //{ + + //} + //Config(const std::string& lname = "MaterialWriter", + //std::unique_ptr<const Acts::Logger> _logger) + //: logger(std::move(_logger)), name(lname) + //{ + //} + }; + + /// Constructor + RootIndexedMaterialWriter(Config& cfg); + + /// Virtual destructor + ~RootIndexedMaterialWriter(); + + /// Framework name() method + std::string + name() const; + + /// Interface method which writes out the MaterialTrack entities + /// @param ism is the indexed surface material + void + write(const Acts::IndexedSurfaceMaterial& ism); + + private: + /// The config class + Config m_cfg; + /// mutex used to protect multi-threaded writes + std::mutex m_write_mutex; + /// The output file name + TFile* m_outputFile; + + /// Private access to the logging instance + const Acts::Logger& + logger() const + { + return *m_cfg.logger; + } + }; + + inline std::string + RootIndexedMaterialWriter::name() const + { + return m_cfg.name; + } + +} // namespace Acts + diff --git a/Tracking/Acts/ActsInterop/ActsInterop/IdentityHelper.h b/Tracking/Acts/ActsInterop/ActsInterop/IdentityHelper.h new file mode 100644 index 0000000000000000000000000000000000000000..343c63e02952c79dadf74b700927f9102a2def69 --- /dev/null +++ b/Tracking/Acts/ActsInterop/ActsInterop/IdentityHelper.h @@ -0,0 +1,35 @@ +/* + Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration +*/ + +#pragma once + +namespace InDetDD { + class SiDetectorElement; +} + +class PixelID; +class SCT_ID; + +class IdentityHelper { + +public: + IdentityHelper(const InDetDD::SiDetectorElement* detElem); + + int bec() const; + int layer_disk() const; + int phi_module() const; + int eta_module() const; + int side() const; + + int phi_module_max() const; + int eta_module_max() const; + +private: + const InDetDD::SiDetectorElement* m_elem; + + const PixelID* getPixelIDHelper() const; + const SCT_ID* getSCTIDHelper() const; + + +}; diff --git a/Tracking/Acts/ActsInterop/ActsInterop/Logger.h b/Tracking/Acts/ActsInterop/ActsInterop/Logger.h new file mode 100644 index 0000000000000000000000000000000000000000..5dad752183ab23323496e54966d013c5396d0487 --- /dev/null +++ b/Tracking/Acts/ActsInterop/ActsInterop/Logger.h @@ -0,0 +1,55 @@ +/* + Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration +*/ + +#pragma once + +#include "Acts/Utilities/Logger.hpp" +#include "GaudiKernel/MsgStream.h" +#include "GaudiKernel/CommonMessaging.h" +#include "GaudiKernel/INamedInterface.h" + +#include <memory> + +#include <boost/optional.hpp> + +class ActsAthenaPrintPolicy final : public Acts::Logging::OutputPrintPolicy +{ +public: + + ActsAthenaPrintPolicy(std::shared_ptr<MsgStream> msg) : m_msg(msg) {} + + void + flush(const Acts::Logging::Level& lvl, const std::ostringstream& input); + +private: + std::shared_ptr<MsgStream> m_msg; +}; + +class ActsAthenaFilterPolicy final : public Acts::Logging::OutputFilterPolicy { +public: + ActsAthenaFilterPolicy(std::shared_ptr<MsgStream> msg) : m_msg(msg) {} + + //~AthenaFilterPolicy() = default; + + bool doPrint(const Acts::Logging::Level& lvl) const; + +private: + std::shared_ptr<MsgStream> m_msg; + MSG::Level m_currentLevel; +}; + + +std::unique_ptr<const Acts::Logger> +makeActsAthenaLogger(IMessageSvc *svc, const std::string& name, int level, boost::optional<std::string> parent_name); + +std::unique_ptr<const Acts::Logger> +makeActsAthenaLogger(CommonMessagingBase* parent, const std::string& name); + +std::unique_ptr<const Acts::Logger> +makeActsAthenaLogger(CommonMessagingBase* parent, const std::string& name, boost::optional<std::string> parent_name); + +// problem: string literal does not play well with boost::optional +std::unique_ptr<const Acts::Logger> +makeActsAthenaLogger(CommonMessagingBase* parent, const std::string& name, const std::string& parent_name); + diff --git a/Tracking/Acts/ActsInterop/CMakeLists.txt b/Tracking/Acts/ActsInterop/CMakeLists.txt new file mode 100755 index 0000000000000000000000000000000000000000..c48e19896c6f9647c8850d04253f476f8c8de4ac --- /dev/null +++ b/Tracking/Acts/ActsInterop/CMakeLists.txt @@ -0,0 +1,34 @@ + +# Declare the package name: +atlas_subdir( ActsInterop ) + +# Declare the package's dependencies: +atlas_depends_on_subdirs( PUBLIC + GaudiKernel + Control/AtenaBaseComps + DetectorDescription/Identifier + InnerDetector/InDetDetDescr/InDetIdentifier + InnerDetector/InDetDetDescr/InDetReadoutGeometry ) + +# External dependencies: + +if(NOT ATH_ACTS_BUILD_SUBDIR) + find_package(Acts REQUIRED COMPONENTS Core) +endif() + +# Component(s) in the package: +atlas_add_library( ActsInteropLib + src/*.cxx + PUBLIC_HEADERS ActsInterop + LINK_LIBRARIES + AthenaBaseComps + Identifier + InDetIdentifier + InDetReadoutGeometry + ActsCore) + +# Install files from the package: +atlas_install_headers( ActsInterop ) +atlas_install_joboptions( share/*.py ) +atlas_install_python_modules( python/*.py ) + diff --git a/Tracking/Acts/ActsInterop/doc/packagedoc.h b/Tracking/Acts/ActsInterop/doc/packagedoc.h new file mode 100755 index 0000000000000000000000000000000000000000..fec68a00e1e4bf4e2206b432bdb48346df781539 --- /dev/null +++ b/Tracking/Acts/ActsInterop/doc/packagedoc.h @@ -0,0 +1,11 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +/** + +@page ActsInterop_page ActsInterop Package + +@author Paul Gessinger + +*/ diff --git a/Tracking/Acts/ActsInterop/share/package_filters.txt b/Tracking/Acts/ActsInterop/share/package_filters.txt new file mode 100644 index 0000000000000000000000000000000000000000..45c597f6802312bbfa41873cdd4cdf7130cae8d2 --- /dev/null +++ b/Tracking/Acts/ActsInterop/share/package_filters.txt @@ -0,0 +1,5 @@ ++ .*ActsGeometry ++ .*ActsInterop ++ .*InnerDetector/InDetDetDescr/InDetReadoutGeometry.* ++ .*DetectorDescription/GeoModel/GeoModelUtilities.* +- .* diff --git a/Tracking/Acts/ActsInterop/src/IdentityHelper.cxx b/Tracking/Acts/ActsInterop/src/IdentityHelper.cxx new file mode 100644 index 0000000000000000000000000000000000000000..7a1253c70a94c7044bb5a07bcdb07f8ca2af69df --- /dev/null +++ b/Tracking/Acts/ActsInterop/src/IdentityHelper.cxx @@ -0,0 +1,110 @@ +/* + Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration +*/ + +#include "ActsInterop/IdentityHelper.h" + +#include "InDetReadoutGeometry/SiDetectorElement.h" +#include "InDetIdentifier/PixelID.h" +#include "InDetIdentifier/SCT_ID.h" + + +IdentityHelper::IdentityHelper(const InDetDD::SiDetectorElement *elem) + : m_elem(elem) +{} + + +const PixelID* +IdentityHelper::getPixelIDHelper() const +{ + return dynamic_cast<const PixelID*>(m_elem->getIdHelper()); +} +const SCT_ID* +IdentityHelper::getSCTIDHelper() const +{ + return dynamic_cast<const SCT_ID*>(m_elem->getIdHelper()); +} + +int +IdentityHelper::bec() const +{ + auto id = m_elem->identify(); + if (m_elem->isPixel()) { + return getPixelIDHelper()->barrel_ec(id); + } + else { + return getSCTIDHelper()->barrel_ec(id); + } +} + +int +IdentityHelper::layer_disk() const +{ + auto id = m_elem->identify(); + if (m_elem->isPixel()) { + return getPixelIDHelper()->layer_disk(id); + } + else { + return getSCTIDHelper()->layer_disk(id); + } +} + +int +IdentityHelper::phi_module() const +{ + auto id = m_elem->identify(); + if (m_elem->isPixel()) { + return getPixelIDHelper()->phi_module(id); + } + else { + return getSCTIDHelper()->phi_module(id); + } +} + +int +IdentityHelper::eta_module() const +{ + auto id = m_elem->identify(); + if (m_elem->isPixel()) { + return getPixelIDHelper()->eta_module(id); + } + else { + return getSCTIDHelper()->eta_module(id); + } +} + +int +IdentityHelper::side() const +{ + auto id = m_elem->identify(); + if (m_elem->isPixel()) { + return 0; + } + else { + return getSCTIDHelper()->side(id); + } +} + +int +IdentityHelper::phi_module_max() const +{ + auto id = m_elem->identify(); + if (m_elem->isPixel()) { + return getPixelIDHelper()->phi_module_max(id); + } + else { + return getSCTIDHelper()->phi_module_max(id); + } +} + +int +IdentityHelper::eta_module_max() const +{ + auto id = m_elem->identify(); + if (m_elem->isPixel()) { + return getPixelIDHelper()->eta_module_max(id); + } + else { + return getSCTIDHelper()->eta_module_max(id); + } +} diff --git a/Tracking/Acts/ActsInterop/src/Logger.cxx b/Tracking/Acts/ActsInterop/src/Logger.cxx new file mode 100644 index 0000000000000000000000000000000000000000..4674bec9489d35acb4e84a378b2bab7636a58617 --- /dev/null +++ b/Tracking/Acts/ActsInterop/src/Logger.cxx @@ -0,0 +1,101 @@ +/* + Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration +*/ + +#include "ActsInterop/Logger.h" + +#include "GaudiKernel/INamedInterface.h" +#include "GaudiKernel/CommonMessaging.h" +#include "GaudiKernel/IMessageSvc.h" +#include "GaudiKernel/MsgStream.h" +#include "GaudiKernel/CommonMessaging.h" + +#include "Acts/Utilities/Logger.hpp" + +#include <boost/optional.hpp> + +#include <iostream> +#include <string> + +void +ActsAthenaPrintPolicy::flush(const Acts::Logging::Level& lvl, const std::ostringstream& input) +{ + const std::vector<MSG::Level> athLevelVector{ + MSG::VERBOSE, + MSG::DEBUG, + MSG::INFO, + MSG::WARNING, + MSG::ERROR, + MSG::FATAL + }; + + MSG::Level athLevel = athLevelVector[lvl]; + (*m_msg) << athLevel << input.str() << endmsg; +} + + +bool +ActsAthenaFilterPolicy::doPrint(const Acts::Logging::Level& lvl) const +{ + const std::array<MSG::Level, 6> athLevelVector{ + MSG::VERBOSE, + MSG::DEBUG, + MSG::INFO, + MSG::WARNING, + MSG::ERROR, + MSG::FATAL + }; + + MSG::Level athLevel = athLevelVector[lvl]; + return m_msg->level() <= athLevel; +} + + +std::unique_ptr<const Acts::Logger> +makeActsAthenaLogger(IMessageSvc *svc, const std::string& name, int level, boost::optional<std::string> parent_name) +{ + using namespace Acts::Logging; + + std::string full_name = name; + if (parent_name) { + full_name = *parent_name + "." + full_name; + } + + auto msg = std::make_shared<MsgStream>(svc, full_name); + msg->setLevel(level); + auto filter = std::make_unique<ActsAthenaFilterPolicy>(msg); + auto print = std::make_unique<ActsAthenaPrintPolicy>(msg); + return std::make_unique<const Acts::Logger>(std::move(print), std::move(filter)); +} + +std::unique_ptr<const Acts::Logger> +makeActsAthenaLogger(CommonMessagingBase* parent, const std::string& name) +{ + // no explicit name, get from component + INamedInterface *inamed = dynamic_cast<INamedInterface*>(parent); + boost::optional<std::string> parent_name = boost::none; + // this will not prefix if parent is not named (which it should be) + if (inamed == nullptr) { + throw std::invalid_argument("parent needs to be INamedInterface"); + } + parent_name = inamed->name(); + return makeActsAthenaLogger(parent, name, parent_name); +} + +std::unique_ptr<const Acts::Logger> +makeActsAthenaLogger(CommonMessagingBase* parent, const std::string& name, boost::optional<std::string> parent_name) +{ + int level = 0; + INamedInterface *inamed = dynamic_cast<INamedInterface*>(parent); + if (inamed != nullptr) { + level = parent->msgSvc()->outputLevel(inamed->name()); + } + return makeActsAthenaLogger(parent->msgSvc().get(), name, level, parent_name); +} + +std::unique_ptr<const Acts::Logger> +makeActsAthenaLogger(CommonMessagingBase* parent, const std::string& name, const std::string& parent_name) +{ + + return makeActsAthenaLogger(parent, name, boost::optional<std::string>(parent_name)); +} diff --git a/Tracking/TrkAlignment/TrkAlignGenTools/src/AlignTrackPreProcessor.cxx b/Tracking/TrkAlignment/TrkAlignGenTools/src/AlignTrackPreProcessor.cxx index fb179198124e96078698a1c3615150cd1ce8c605..f35ace8ab745f72056f28fd591618f50ab9a4839 100644 --- a/Tracking/TrkAlignment/TrkAlignGenTools/src/AlignTrackPreProcessor.cxx +++ b/Tracking/TrkAlignment/TrkAlignGenTools/src/AlignTrackPreProcessor.cxx @@ -114,7 +114,7 @@ namespace Trk { } ATH_MSG_INFO("Retrieved " << m_hitQualityTool); } - + return StatusCode::SUCCESS; } @@ -125,93 +125,96 @@ namespace Trk { } //________________________________________________________________________ - DataVector<Track>* AlignTrackPreProcessor::processTrackCollection(const DataVector<Track>* tracks) + DataVector<Track>* AlignTrackPreProcessor::processTrackCollection(const DataVector<Track>* tracks) { ATH_MSG_DEBUG("AlignTrackPreProcessor::processTrackCollection()"); - + if (!tracks || tracks->empty()) return 0; - + // the output collection of AlignTracks // we define it as collection of Tracks but fill AlignTracks inside DataVector<Track> * newTracks = new DataVector<Track>; - + int itrk(0); // loop over tracks and create AlignTracks TrackCollection::const_iterator it = tracks->begin(); TrackCollection::const_iterator it_end = tracks->end(); - + for ( ; it != it_end ; ++it, ++itrk) { - + ATH_MSG_DEBUG(" ** processTrackCollection ** Processing track "<<itrk); const Track * origTrack = *it; const Track * newTrack = *it; AlignTrack* at; - + // check whether the original track passes selection if (m_selectTracks) { if(!m_trackSelectorTool->accept(*origTrack)) { ATH_MSG_VERBOSE(" ** processTrackCollection ** Original track did not pass the selection."<<itrk); continue; } - - ToolHandle<Trk::IGlobalTrackFitter> fitter=m_trackFitterTool; - if (!m_useSingleFitter && AlignTrack::isSLTrack(origTrack) ) - fitter = m_SLTrackFitterTool; - - if (m_selectHits) { - /** select silicon hits by quality. keep all the rest **/ - ATH_MSG_DEBUG(" ** processTrackCollection ** entering the silicon hit selection "); - newTrack = performSiliconHitSelection(origTrack, fitter); - - if (!newTrack) { - ATH_MSG_DEBUG(" ** processTrackCollection ** Track refit yielded no track. Skipping the track."); - continue; - } - - // check whether the track passes selection - if(!m_trackSelectorTool->accept(*newTrack)) { - ATH_MSG_DEBUG(" ** processTrackCollection ** Track did not pass the selection."); - continue; - } - } - - // refit track - if (m_refitTracks &!m_selectHits) { - - newTrack=fitter->fit(*origTrack,m_runOutlierRemoval,ParticleHypothesis(m_particleHypothesis)); - if (!newTrack) { - ATH_MSG_DEBUG("Track refit yielded no track. Skipping the track."); - continue; - } - // check that the refitted track satisfies the aligntrack selection - if(!m_trackSelectorTool->accept(*origTrack)) { - ATH_MSG_DEBUG("Track did not pass the selection."); - continue; - } - } - - at = new AlignTrack(*newTrack); - - if (msgLvl(MSG::DEBUG) && !msgLvl(MSG::VERBOSE)) { - msg(MSG::DEBUG)<<"before refit: "<<endmsg; - AlignTrack::dumpLessTrackInfo(*origTrack,msg(MSG::DEBUG)); - msg(MSG::DEBUG)<<"after refit: "<<endmsg; - AlignTrack::dumpLessTrackInfo(*newTrack,msg(MSG::DEBUG)); - msg(MSG::DEBUG)<<endmsg; - } - - // store fit matrices - if (m_storeFitMatricesAfterRefit) { - at->setFullCovarianceMatrix(fitter->FullCovarianceMatrix()); - at->setDerivativeMatrix(fitter->DerivMatrix()); - } - if (m_fixMomentum) - { - at->AlignTrack::setRefitQovP(false); - } - // delete newTrack since it's copied in AlignTrack - delete newTrack; + + ToolHandle<Trk::IGlobalTrackFitter> fitter=m_trackFitterTool; + if (!m_useSingleFitter && AlignTrack::isSLTrack(origTrack) ) + fitter = m_SLTrackFitterTool; + + if (m_selectHits) { + /** select silicon hits by quality. keep all the rest **/ + ATH_MSG_DEBUG(" ** processTrackCollection ** entering the silicon hit selection "); + newTrack = performSiliconHitSelection(origTrack, fitter); + + if (!newTrack) { + ATH_MSG_DEBUG(" ** processTrackCollection ** Track refit yielded no track. Skipping the track."); + continue; + } + + // check whether the track passes selection + if(!m_trackSelectorTool->accept(*newTrack)) { + ATH_MSG_DEBUG(" ** processTrackCollection ** Track did not pass the selection."); + delete newTrack; + continue; + } + } + + IGlobalTrackFitter::AlignmentCache alignCache; + // refit track + if (m_refitTracks &!m_selectHits) { + + newTrack=fitter->alignmentFit(alignCache,*origTrack,m_runOutlierRemoval,ParticleHypothesis(m_particleHypothesis)); + if (!newTrack) { + ATH_MSG_DEBUG("Track refit yielded no track. Skipping the track."); + continue; + } + // check that the refitted track satisfies the aligntrack selection + if(!m_trackSelectorTool->accept(*newTrack)) { + ATH_MSG_DEBUG("New track did not pass the selection."); + delete newTrack; + continue; + } + } + + at = new AlignTrack(*newTrack); + + if (msgLvl(MSG::DEBUG) && !msgLvl(MSG::VERBOSE)) { + msg(MSG::DEBUG)<<"before refit: "<<endmsg; + AlignTrack::dumpLessTrackInfo(*origTrack,msg(MSG::DEBUG)); + msg(MSG::DEBUG)<<"after refit: "<<endmsg; + AlignTrack::dumpLessTrackInfo(*newTrack,msg(MSG::DEBUG)); + msg(MSG::DEBUG)<<endmsg; + } + + // store fit matrices + if (m_storeFitMatricesAfterRefit) { + at->setFullCovarianceMatrix(alignCache.m_fullCovarianceMatrix); + at->setDerivativeMatrix(alignCache.m_derivMatrix); + } + if (m_fixMomentum) + { + at->AlignTrack::setRefitQovP(false); + } + // delete newTrack since it's copied in AlignTrack + delete newTrack; } else { // in case no selection is performed, keep all tracks at=new AlignTrack(*newTrack); @@ -220,16 +223,16 @@ namespace Trk { { at->AlignTrack::setRefitQovP(false); } - + newTracks->push_back(at); - } - - + } + + if (newTracks->empty()) { delete newTracks; return 0; } - + return newTracks; } @@ -257,7 +260,7 @@ namespace Trk { ATH_MSG_DEBUG(" -- performSiliconHitSelection -- after removing bad Silicon hits, the selected measurement collection has "<< selectedMeasurementSet.size()<< " elements"); newTrack = fitter->fit(selectedMeasurementSet,*inputTrack->perigeeParameters(),m_runOutlierRemoval,ParticleHypothesis(m_particleHypothesis)); - + return newTrack; } } diff --git a/Tracking/TrkAlignment/TrkAlignGenTools/src/BeamspotVertexPreProcessor.cxx b/Tracking/TrkAlignment/TrkAlignGenTools/src/BeamspotVertexPreProcessor.cxx index aa15d93d8a7fc8d9039f6e402e4a4688cfa6a778..fbf1ed753d208b854f03b1bacb2d54f38102b93f 100644 --- a/Tracking/TrkAlignment/TrkAlignGenTools/src/BeamspotVertexPreProcessor.cxx +++ b/Tracking/TrkAlignment/TrkAlignGenTools/src/BeamspotVertexPreProcessor.cxx @@ -61,9 +61,9 @@ BeamspotVertexPreProcessor::BeamspotVertexPreProcessor(const std::string & type, , m_doBSTrackSelection(false) , m_doAssociatedToPVSelection(true) , m_constraintMode(0) - , m_compareMethod("compareAddress") + , m_compareMethod("compareAddress") , m_doBeamspotConstraint(true) - , m_doPrimaryVertexConstraint(false) + , m_doPrimaryVertexConstraint(false) , m_doFullVertexConstraint(false) , m_doNormalRefit(true) , m_maxPt(0.) @@ -103,7 +103,7 @@ BeamspotVertexPreProcessor::BeamspotVertexPreProcessor(const std::string & type, declareProperty("MinTrksInVtx", m_minTrksInVtx ); declareProperty("doNormalRefit" ,m_doNormalRefit ); declareProperty("maxPt" ,m_maxPt ); - + std::vector<std::string> defaultInterestedVertexContainers; defaultInterestedVertexContainers.push_back("PrimaryVertices"); // MD: Maybe only the first container? @@ -130,7 +130,7 @@ StatusCode BeamspotVertexPreProcessor::initialize() else ATH_MSG_INFO("Retrieved " << m_trkSelector); } - + if (m_refitTracks) { // configure main track fitter if(m_trackFitter.retrieve().isFailure()) { @@ -138,7 +138,7 @@ StatusCode BeamspotVertexPreProcessor::initialize() return StatusCode::FAILURE; } ATH_MSG_INFO("Retrieved " << m_trackFitter); - + // configure straight-line track fitter if requested if (!m_useSingleFitter) { if (m_SLTrackFitter.retrieve().isFailure()) { @@ -152,24 +152,24 @@ StatusCode BeamspotVertexPreProcessor::initialize() if (m_ITrackToVertexIPEstimator.retrieve().isFailure()) { if(msgLvl(MSG::FATAL)) msg(MSG::FATAL) << "Can not retrieve TrackToVertexIPEstimator of type " << m_ITrackToVertexIPEstimator.typeAndName() << endmsg; return StatusCode::FAILURE; - } else { + } else { ATH_MSG_INFO ( "Retrieved TrackToVertexIPEstimator Tool " << m_ITrackToVertexIPEstimator.typeAndName() ); } - + // configure Atlas extrapolator if (m_extrapolator.retrieve().isFailure()) { msg(MSG::FATAL) << "Failed to retrieve tool "<<m_extrapolator<<endmsg; return StatusCode::FAILURE; } ATH_MSG_INFO("Retrieved " << m_extrapolator); - + // configure beam-spot conditions service if (m_beamCondSvc.retrieve().isFailure()) { msg(MSG::FATAL)<<"Failed to retrieve beamspot service "<<m_beamCondSvc<<endmsg; return StatusCode::FAILURE; } ATH_MSG_INFO("Retrieved " << m_beamCondSvc); - + // configure beam-spot track selector if requested if(m_doBSTrackSelection) { if(m_BSTrackSelector.empty()) { @@ -194,7 +194,7 @@ StatusCode BeamspotVertexPreProcessor::initialize() if ( m_alignModuleTool.retrieve().isFailure() ) { ATH_MSG_FATAL("Failed to retrieve tool " << m_alignModuleTool); return StatusCode::FAILURE; - } + } else { ATH_MSG_INFO("Retrieved tool " << m_alignModuleTool); @@ -214,18 +214,18 @@ StatusCode BeamspotVertexPreProcessor::initialize() return StatusCode::SUCCESS; } - + bool CompareTwoTracks::operator()(VxTrackAtVertex vtxTrk){ // MD: took away deref* ITrackLink* trkLink = vtxTrk.trackOrParticleLink(); LinkToTrackParticleBase* linkToTrackParticle = dynamic_cast<Trk::LinkToTrackParticleBase*>(trkLink); if(!linkToTrackParticle) return false; const TrackParticleBase* tpb = *(linkToTrackParticle->cptr()); - + const Track* originalTrk = tpb->originalTrack(); bool equal = false; - // compare the addresses of these two tracks directly + // compare the addresses of these two tracks directly if(m_method.find("compareAddress") != std::string::npos){ if (m_track == originalTrk) equal = true; //std::cout << " comparing two Tracks' addresses directly, the address of the comparing track : "<< m_track <<" the address of the compared track : "<< originalTrk << " compare result : " << equal << std::endl; @@ -253,7 +253,7 @@ bool CompareTwoTracks::operator()(VxTrackAtVertex vtxTrk){ // MD: took away dere bool BeamspotVertexPreProcessor::selectVertices(const xAOD::Vertex * vtx) const { - + if(0 == vtx->vertexType()) { ATH_MSG_DEBUG("this primary vertex has been rejected as type dummy"); return false; @@ -268,20 +268,20 @@ bool BeamspotVertexPreProcessor::selectVertices(const xAOD::Vertex * vtx) const } return true; } - + bool BeamspotVertexPreProcessor::selectUpdatedVertices(const xAOD::Vertex * vtx) const { - + if (vtx->numberDoF() <= 0){ ATH_MSG_WARNING(" VERY STRANGE!!! , the updated vertex has been rejected as non-positive DoF: "<< vtx->numberDoF() <<" the type of this vertex:"<< vtx->vertexType() ); return false; } - + if (int(vtx->vxTrackAtVertex().size()) < m_minTrksInVtx){ ATH_MSG_DEBUG(" the updated vertex has been rejected as vxTrackAtVertex size: "<< vtx->vxTrackAtVertex().size() ); return false; } - + if ((vtx->covariancePosition())(0,0)<=0 || (vtx->covariancePosition())(1,1)<=0 || (vtx->covariancePosition())(2,2)<=0){ @@ -290,7 +290,7 @@ bool BeamspotVertexPreProcessor::selectUpdatedVertices(const xAOD::Vertex * vtx) } return true; } - + bool BeamspotVertexPreProcessor::isAssociatedToPV(const Trk::Track * track, const xAOD::VertexContainer* vertices) { @@ -299,10 +299,10 @@ bool BeamspotVertexPreProcessor::isAssociatedToPV(const Trk::Track * track, cons xAOD::VertexContainer::const_iterator vtxEnd = vertices->end(); xAOD::VertexContainer::const_iterator vtxIter = vertices->begin(); - + for ( ; vtxIter != vtxEnd && (*vtxIter)->vertexType() == 1; ++vtxIter ){ - if (isAssociatedToVertex(track, *vtxIter)) return true; - } + if (isAssociatedToVertex(track, *vtxIter)) return true; + } return false; } @@ -346,10 +346,10 @@ void BeamspotVertexPreProcessor::prepareAllTracksVector(){ continue; } else { - + xAOD::VertexContainer::const_iterator vtxEnd = thisContainer->end(); xAOD::VertexContainer::const_iterator vtxIter = thisContainer->begin(); - + for(; vtxIter != vtxEnd; ++vtxIter){ if(m_selectVertices && !selectVertices(*vtxIter)) { ATH_MSG_DEBUG("this vertex did not pass the primary vertex selection..."); @@ -380,17 +380,17 @@ const xAOD::Vertex* BeamspotVertexPreProcessor::findVertexCandidate(const Track* std::vector< std::pair< const xAOD::Vertex*, std::vector<VxTrackAtVertex> > >::const_iterator iter = m_allTracksVector.begin(); std::vector< std::pair< const xAOD::Vertex*, std::vector<VxTrackAtVertex> > >::const_iterator iterEnd = m_allTracksVector.end(); - + for(; iter != iterEnd; ++iter){ std::pair< const xAOD::Vertex*, std::vector<VxTrackAtVertex> > thisPair = *iter; //ATH_MSG_DEBUG(" this VxCandidate* and vector<VxTrackAtVertex*>* Pair: "<< *(thisPair.first)); - + std::vector<VxTrackAtVertex>::iterator iVxTrackBegin = (thisPair.second).begin(); std::vector<VxTrackAtVertex>::iterator iVxTrackEnd = (thisPair.second).end(); Trk::CompareTwoTracks thisCompare(track, m_compareMethod); - + std::vector<VxTrackAtVertex>::iterator findResult = std::find_if(iVxTrackBegin, iVxTrackEnd, thisCompare); - + if(findResult != iVxTrackEnd){ ATH_MSG_DEBUG("the found VxTrackAtVertex: "<<*findResult); findVxCandidate = thisPair.first; @@ -413,12 +413,12 @@ const VertexOnTrack* BeamspotVertexPreProcessor::provideVotFromVertex(const Trac const xAOD::Vertex* updatedVtx = nullptr; const xAOD::Vertex* findVtx = findVertexCandidate(track); - + ATH_MSG_DEBUG("findVtx in provideVotFromVertex: "<<findVtx); - + if (!( 0==findVtx) ) { vtx = findVtx; - + if( m_doFullVertexConstraint ) { updatedVtx = new xAOD::Vertex(*vtx); //updatedVtx = vtx->clone(); // no clone option for xAODvertex @@ -427,22 +427,22 @@ const VertexOnTrack* BeamspotVertexPreProcessor::provideVotFromVertex(const Trac //tmpVtx = vtx->clone(); // no clone option for xAODvertex updatedVtx = m_ITrackToVertexIPEstimator->getUnbiasedVertex(track->perigeeParameters(), vtx ); // MD: new function call } - - + + if(updatedVtx){ - + if(!selectUpdatedVertices(updatedVtx)) return vot; - - if( !m_doFullVertexConstraint ) + + if( !m_doFullVertexConstraint ) ATH_MSG_DEBUG(" updated Vertex by KalmanVertexUpdator: "<<updatedVtx); - - + + ///vertex as perigeeSurface Amg::Vector3D globPos(updatedVtx->position()); //look const PerigeeSurface* surface = new PerigeeSurface(globPos); - - + + const Perigee * perigee = dynamic_cast<const Perigee*>(m_extrapolator->extrapolate(*track, *surface)); if (!perigee) { const Perigee * trackPerigee = track->perigeeParameters(); @@ -460,7 +460,7 @@ const VertexOnTrack* BeamspotVertexPreProcessor::provideVotFromVertex(const Trac //exit return vot; } - + // create the Jacobian matrix from Cartisian to Perigee AmgMatrix(2,3) Jacobian; Jacobian.setZero(); @@ -469,30 +469,30 @@ const VertexOnTrack* BeamspotVertexPreProcessor::provideVotFromVertex(const Trac Jacobian(0,0) = -ptInv*perigee->momentum().y(); Jacobian(0,1) = ptInv*perigee->momentum().x(); Jacobian(1,2) = 1.0; - + ATH_MSG_DEBUG(" Jacobian matrix from Cartesian to Perigee: "<< Jacobian); - + AmgSymMatrix(3) vtxCov = updatedVtx->covariancePosition(); // MD: that was NULL before? //std::cout << " before PV scaling : "<< vtxCov << std::endl; - - vtxCov *= m_PVScalingFactor * m_PVScalingFactor; + + vtxCov *= m_PVScalingFactor * m_PVScalingFactor; //std::cout << " after PV scaling : "<< vtxCov << std::endl; Amg::MatrixX errorMatrix; if( m_doFullVertexConstraint ) { AmgSymMatrix(3) tmpCov; tmpCov.setZero(); - tmpCov(0,0) = 1.e-10 ; - tmpCov(1,1) = 1.e-10; - tmpCov(2,2) = 1.e-10; + tmpCov(0,0) = 1.e-10 ; + tmpCov(1,1) = 1.e-10; + tmpCov(2,2) = 1.e-10; errorMatrix = Amg::MatrixX( tmpCov.similarity(Jacobian) ); } else { errorMatrix = Amg::MatrixX( vtxCov.similarity(Jacobian) ); - } + } delete perigee; - + // in fact, in most of the normal situation, pointer tmpVtx and updatedVtx are the same. You can check the source code - // But for safety, I would like to delete them seperately + // But for safety, I would like to delete them seperately // sroe(2016.09.23): This would result in an illegal double delete, if they really point to the same thing! // http://stackoverflow.com/questions/9169774/what-happens-in-a-double-delete if (tmpVtx != updatedVtx){ @@ -503,7 +503,7 @@ const VertexOnTrack* BeamspotVertexPreProcessor::provideVotFromVertex(const Trac updatedVtx=nullptr; LocalParameters localParams = Trk::LocalParameters(Amg::Vector2D(0,0)); - + // VertexOnTrack Object vot = new VertexOnTrack(localParams, errorMatrix, *surface); ATH_MSG_DEBUG("the VertexOnTrack created from vertex: "<<*vot); @@ -534,7 +534,7 @@ const VertexOnTrack* BeamspotVertexPreProcessor::provideVotFromBeamspot(const Tr ATH_MSG_DEBUG("running refit with beam-spot"); - + float z0 = track->perigeeParameters()->parameters()[Trk::z0]; float beamX = beamSpotX + tan(beamTiltX) * (z0-beamSpotZ); float beamY = beamSpotY + tan(beamTiltY) * (z0-beamSpotZ); @@ -544,7 +544,7 @@ const VertexOnTrack* BeamspotVertexPreProcessor::provideVotFromBeamspot(const Tr const PerigeeSurface * surface = nullptr; Amg::MatrixX errorMatrix; LocalParameters beamSpotParameters; - + // covariance matrix of the beam-spot AmgSymMatrix(2) beamSpotCov; beamSpotCov.setZero(); @@ -559,7 +559,7 @@ const VertexOnTrack* BeamspotVertexPreProcessor::provideVotFromBeamspot(const Tr // create a measurement for the beamspot DefinedParameter Par0(0.,Trk::d0); beamSpotParameters = LocalParameters(Par0); - + // calculate perigee parameters wrt. beam-spot const Perigee * perigee = dynamic_cast<const Perigee*>(m_extrapolator->extrapolate(*track, *surface)); if (!perigee) { @@ -575,14 +575,14 @@ const VertexOnTrack* BeamspotVertexPreProcessor::provideVotFromBeamspot(const Tr //exit return vot; } - + Eigen::Matrix<double,1,2> jacobian; jacobian.setZero(); //perigee is dereferenced here, must not be nullptr double ptInv = 1./perigee->momentum().perp(); jacobian(0,0) = -ptInv * perigee->momentum().y(); jacobian(0,1) = ptInv * perigee->momentum().x(); - + // MD: changed -> reversed order of matrix multiplication errorMatrix = Amg::MatrixX( jacobian*(beamSpotCov*jacobian.transpose())); if( errorMatrix.cols() != 1 ) @@ -618,7 +618,7 @@ void BeamspotVertexPreProcessor::provideVtxBeamspot(const AlignVertex* b, AmgSym float beamSigmaY = m_BSScalingFactor * m_beamCondSvc->beamSigma(1); float beamSigmaZ = m_BSScalingFactor * m_beamCondSvc->beamSigma(2); - + float z0 = b->originalPosition()->z(); (*v)(0) = beamSpotX + tan(beamTiltX) * (z0-beamSpotZ); (*v)(1) = beamSpotY + tan(beamTiltY) * (z0-beamSpotZ); @@ -638,7 +638,7 @@ const Track* BeamspotVertexPreProcessor::doConstraintRefit(ToolHandle<Trk::IGlob const Track* newTrack = 0; - if(vot){ + if(vot){ std::vector<const MeasurementBase *> measurementCollection; measurementCollection.push_back(vot); @@ -646,17 +646,17 @@ const Track* BeamspotVertexPreProcessor::doConstraintRefit(ToolHandle<Trk::IGlob DataVector<const MeasurementBase>::const_iterator imeas = track->measurementsOnTrack()->begin(); DataVector<const MeasurementBase>::const_iterator imeas_end = track->measurementsOnTrack()->end(); for ( ; imeas != imeas_end ; ++imeas) measurementCollection.push_back(*imeas); - + if( m_doFullVertexConstraint ) { // get track parameters at the vertex: PerigeeSurface surface=vot->associatedSurface(); ATH_MSG_DEBUG(" Track reference surface will be: " << surface); const TrackParameters* parsATvertex=m_extrapolator->extrapolate(*track, surface); - + ATH_MSG_DEBUG(" Track will be refitted at this surface "); newTrack = fitter->fit(measurementCollection, *parsATvertex, m_runOutlierRemoval, particleHypothesis); delete parsATvertex; - } else { + } else { newTrack = fitter->fit(measurementCollection, *(track->trackParameters()->front()), m_runOutlierRemoval, particleHypothesis); } // delete vot; @@ -667,11 +667,11 @@ const Track* BeamspotVertexPreProcessor::doConstraintRefit(ToolHandle<Trk::IGlob bool BeamspotVertexPreProcessor::doBeamspotConstraintTrackSelection(const Track* track) { - + const xAOD::VertexContainer* vertices = 0; const xAOD::Vertex* vertex = 0; bool haveVertex = false; - + // retrieve the primary vertex if needed if(m_doAssociatedToPVSelection) { @@ -697,7 +697,7 @@ bool BeamspotVertexPreProcessor::doBeamspotConstraintTrackSelection(const Track* if( ( m_doAssociatedToPVSelection && haveVertex && vertex && isAssociatedToPV(track,vertices) ) || ( m_doBSTrackSelection && m_BSTrackSelector->accept(*track) ) ){ - + if (m_maxPt > 0 ) { const Trk::Perigee* perigee = track->perigeeParameters(); @@ -714,8 +714,8 @@ bool BeamspotVertexPreProcessor::doBeamspotConstraintTrackSelection(const Track* return false; } //maxPt selection ATH_MSG_DEBUG("this track passes the beamspot track selection, will do beamspot constraint on it "); - return true; - } + return true; + } else return false; } @@ -735,13 +735,15 @@ AlignTrack* BeamspotVertexPreProcessor::doTrackRefit(const Track* track) { ToolHandle<Trk::IGlobalTrackFitter> fitter = m_trackFitter; if (!m_useSingleFitter && AlignTrack::isSLTrack(track) ) fitter = m_SLTrackFitter; - + + IGlobalTrackFitter::AlignmentCache alignCache; + if(m_doPrimaryVertexConstraint){ vot = provideVotFromVertex(track, vtx); if( !vot ) ATH_MSG_INFO( "VoT not found for this track! "); if( !vtx ) ATH_MSG_INFO( "VTX pointer not found for this track! "); if(vot){ - newTrack = doConstraintRefit(fitter, track, vot, particleHypothesis); + newTrack = doConstraintRefit(fitter, track, vot, particleHypothesis); type = AlignTrack::VertexConstrained; // this track failed the PV constraint reift if (!newTrack) { @@ -764,9 +766,29 @@ AlignTrack* BeamspotVertexPreProcessor::doTrackRefit(const Track* track) { } } - + + //Refit to get full fitter covariance matrix + // @TODO This is a little inefficienct and should + // be addressed when the alignment code is made MT safe + if(newTrack){ + Trk::Track* tmpTrk = fitter->alignmentFit(alignCache,*newTrack,m_runOutlierRemoval,particleHypothesis); + delete newTrack; + newTrack = tmpTrk; + if(!tmpTrk){ + if(type == AlignTrack::VertexConstrained) + { + ++m_nFailedPVRefits; + ATH_MSG_ERROR("VertexConstraint track refit2 failed! "); + }else if(type == AlignTrack::BeamspotConstrained) + { + ++m_nFailedPVRefits; + ATH_MSG_ERROR("BSConstraint track refit2 failed! "); + } + } + } + if(!newTrack && m_doNormalRefit){ - newTrack = fitter->fit(*track,m_runOutlierRemoval,particleHypothesis); + newTrack = fitter->alignmentFit(alignCache,*track,m_runOutlierRemoval,particleHypothesis); type = AlignTrack::NormalRefitted; // this track failed the normal reift if (!newTrack) { @@ -775,7 +797,10 @@ AlignTrack* BeamspotVertexPreProcessor::doTrackRefit(const Track* track) { } } - + + + + if(newTrack) { alignTrack = new AlignTrack(*newTrack); // set original track pointer @@ -783,22 +808,22 @@ AlignTrack* BeamspotVertexPreProcessor::doTrackRefit(const Track* track) { // set the refit type alignTrack->setType(type); - + if (msgLvl(MSG::DEBUG) || msgLvl(MSG::VERBOSE)) { msg(MSG::DEBUG)<<"before refit: "<<endmsg; msg(MSG::DEBUG)<< *track <<endmsg; if (msgLvl(MSG::VERBOSE)) AlignTrack::dumpLessTrackInfo(*track,msg(MSG::DEBUG)); - + msg(MSG::DEBUG)<<"after refit: "<<endmsg; msg(MSG::DEBUG)<< *newTrack <<endmsg; if (msgLvl(MSG::VERBOSE)) AlignTrack::dumpLessTrackInfo(*newTrack,msg(MSG::DEBUG)); } - + if(AlignTrack::VertexConstrained == type || AlignTrack::BeamspotConstrained == type) alignTrack->doFindPerigee(); - + if (m_storeFitMatrices) { - alignTrack->setFullCovarianceMatrix(fitter->FullCovarianceMatrix()); - alignTrack->setDerivativeMatrix(fitter->DerivMatrix()); + alignTrack->setFullCovarianceMatrix(alignCache.m_fullCovarianceMatrix); + alignTrack->setDerivativeMatrix(alignCache.m_derivMatrix); } delete newTrack; @@ -814,17 +839,17 @@ AlignTrack* BeamspotVertexPreProcessor::doTrackRefit(const Track* track) { if( !ifound ) { AlignVertex* avtx=new AlignVertex(vtx); ATH_MSG_DEBUG(" New AlignVertex has ben created."); - + // Beam Spot constraint on the vertex: if( m_doBeamspotConstraint && (xAOD::VxType::PriVtx == vtx->vertexType() || xAOD::VxType::PileUp == vtx->vertexType()) && vtx->vxTrackAtVertex().size()>4 ) { // a beam line verex - ATH_MSG_DEBUG(" The Beam Spot constraint will be added to the vertex.." ); + ATH_MSG_DEBUG(" The Beam Spot constraint will be added to the vertex.." ); AmgSymMatrix(3) qtemp; AmgVector(3) vtemp; provideVtxBeamspot(avtx, &qtemp, &vtemp); (qtemp)(2,2) = 1000000.0; // disable Z constraint avtx->setConstraint( &qtemp, &vtemp); } - + avtx->addAlignTrack(alignTrack); m_AlignVertices.push_back(avtx); } @@ -837,14 +862,14 @@ AlignTrack* BeamspotVertexPreProcessor::doTrackRefit(const Track* track) { // garbage collection: if(vot) delete vot; - return alignTrack; -} + return alignTrack; +} //____________________________________________________________________________ -DataVector<Track> * BeamspotVertexPreProcessor::processTrackCollection(const DataVector<Track> * tracks) +DataVector<Track> * BeamspotVertexPreProcessor::processTrackCollection(const DataVector<Track> * tracks) { ATH_MSG_DEBUG("BeamspotVertexPreProcessor::processTrackCollection()"); @@ -855,7 +880,7 @@ DataVector<Track> * BeamspotVertexPreProcessor::processTrackCollection(const Dat m_AlignVertices.clear(); - if(m_doPrimaryVertexConstraint) + if(m_doPrimaryVertexConstraint) prepareAllTracksVector(); // the output collection of AlignTracks @@ -871,14 +896,14 @@ DataVector<Track> * BeamspotVertexPreProcessor::processTrackCollection(const Dat const Track* track = *itr; AlignTrack * alignTrack = 0; if (not track) continue; - + // check whether the track passes the basic selection if ((not m_trkSelector.empty()) and (not m_trkSelector->accept(*track))) continue; - - + + if(m_refitTracks){ - alignTrack = doTrackRefit(track); - + alignTrack = doTrackRefit(track); + // 2nd track check after refit if(alignTrack && !m_trkSelector.empty()) { // do not check for FullVertex tracks: @@ -886,7 +911,7 @@ DataVector<Track> * BeamspotVertexPreProcessor::processTrackCollection(const Dat if(!m_trkSelector->accept(*alignTrack)) continue; } - } + } } else{ alignTrack = new AlignTrack(*track); alignTrack->setOriginalTrack(track); @@ -989,7 +1014,7 @@ void BeamspotVertexPreProcessor::accumulateVTX(const AlignTrack* alignTrack) { } else { ATH_MSG_ERROR("accumulateVTX: Derivatives do not have a valid pointer to the module."); - delete derivX; + delete derivX; delete WF; return; } @@ -1089,8 +1114,8 @@ void BeamspotVertexPreProcessor::accumulateVTX(const AlignTrack* alignTrack) { delete derivX; // delete [] VTXDerivatives; - return; -} + return; +} //____________________________________________________________________________ @@ -1136,7 +1161,7 @@ void BeamspotVertexPreProcessor::printSummary() } //____________________________________________________________________________ -StatusCode BeamspotVertexPreProcessor::finalize() +StatusCode BeamspotVertexPreProcessor::finalize() { ATH_MSG_INFO("BeamspotVertexPreProcessor::finalize()"); diff --git a/Tracking/TrkAlignment/TrkAlignGenTools/src/ShiftingDerivCalcTool.cxx b/Tracking/TrkAlignment/TrkAlignGenTools/src/ShiftingDerivCalcTool.cxx index b29ade517607699876d59627a117e4af724f653a..61af904c9688433571d32f427f275a3e6d8fdf17 100644 --- a/Tracking/TrkAlignment/TrkAlignGenTools/src/ShiftingDerivCalcTool.cxx +++ b/Tracking/TrkAlignment/TrkAlignGenTools/src/ShiftingDerivCalcTool.cxx @@ -37,12 +37,12 @@ using namespace std; namespace Trk { - + //________________________________________________________________________ - ShiftingDerivCalcTool::ShiftingDerivCalcTool(const std::string& type, + ShiftingDerivCalcTool::ShiftingDerivCalcTool(const std::string& type, const std::string& name, const IInterface* parent) - + : AthAlgTool(type,name,parent) , m_trackFitterTool("Trk::GlobalChi2Fitter/MCTBFitter") , m_SLTrackFitterTool("Trk::GlobalChi2Fitter/MCTBSLFitter") @@ -110,32 +110,32 @@ namespace Trk { } //________________________________________________________________________ - ShiftingDerivCalcTool::~ShiftingDerivCalcTool() + ShiftingDerivCalcTool::~ShiftingDerivCalcTool() { deleteChi2VAlignParam(); delete [] m_unshiftedTrackChi2MeasType; } - + //________________________________________________________________________ StatusCode ShiftingDerivCalcTool::initialize() { - + msg(MSG::DEBUG) << "in ShiftingDerivCalcTool initialize()"<<endmsg; ATH_CHECK(m_trackFitterTool.retrieve()); ATH_CHECK(m_SLTrackFitterTool.retrieve()); ATH_CHECK(m_residualCalculator.retrieve()); ATH_CHECK(m_alignModuleTool.retrieve()); - + ParticleSwitcher particleSwitch; m_particleHypothesis = particleSwitch.particle[m_particleNumber]; msg(MSG::INFO) << "ParticleNumber: " << m_particleNumber << endmsg; msg(MSG::INFO) << "ParticleHypothesis: " << m_particleHypothesis << endmsg; - - + + if(!m_doFits){ m_nFits = 2; } - + m_nChamberShifts = m_nFits; m_traSize = 5.*m_traSize/(double)m_nFits; m_rotSize = 5.*m_rotSize/(double)m_nFits; @@ -159,44 +159,46 @@ namespace Trk { ATH_MSG_INFO("number tracks fail max iterations: "<<m_ntracksFailMaxIter<< "\nnumber tracks fail track refit: "<<m_ntracksFailTrackRefit<< "\nnumber tracks fail align param cut: "<<m_ntracksFailAlignParamCut<< - "\nnumber tracks fail final attempt: "<<m_ntracksFailFinalAttempt); + "\nnumber tracks fail final attempt: "<<m_ntracksFailFinalAttempt); return StatusCode::SUCCESS; } //________________________________________________________________________ - bool ShiftingDerivCalcTool::scanShifts(const AlignTrack* alignTrack, + bool ShiftingDerivCalcTool::scanShifts(const AlignTrack* alignTrack, const std::vector<const AlignModule*>& alignModules) { ATH_MSG_DEBUG("in scanShifts"); - const Trk::Track* trackForRefit = + const Trk::Track* trackForRefit = (m_removeScatteringBeforeRefit) ? alignTrack->trackWithoutScattering(): dynamic_cast<const Trk::Track*>(alignTrack); - + // see whether straight track or not - m_fitter = alignTrack->isSLTrack() ? + m_fitter = alignTrack->isSLTrack() ? m_SLTrackFitterTool : m_trackFitterTool; ATH_MSG_DEBUG("refitting unshifted track with "<<m_fitter<<" (isSLTrack=" - <<alignTrack->isSLTrack()<<")"); - + <<alignTrack->isSLTrack()<<")"); + ATH_MSG_DEBUG("setting minNIterations to "<<m_nIterations); - m_fitter->setMinIterations(m_nIterations); // refit track - const Track* refittedTrack = m_fitter->fit( *trackForRefit, + + IGlobalTrackFitter::AlignmentCache alignCache; + alignCache.m_minIterations = m_nIterations; + const Track* refittedTrack = m_fitter->alignmentFit(alignCache, *trackForRefit, m_runOutlierRemoval, - m_particleHypothesis); - if (!refittedTrack) { - msg(MSG::WARNING) << "initial track refit failed" << endmsg; + m_particleHypothesis); + if (!refittedTrack) { + msg(MSG::WARNING) << "initial track refit failed" << endmsg; return false; - } - else + } + else ATH_MSG_DEBUG("initial track refit successful"); - m_nIterations = m_fitter->iterationsOfLastFit(); + m_nIterations = alignCache.m_iterationsOfLastFit; if (m_nIterations>m_maxIter) { - ATH_MSG_DEBUG("exceeded maximum number of iterations"); + ATH_MSG_DEBUG("exceeded maximum number of iterations"); return false; } ATH_MSG_DEBUG("initial nIterations: "<<m_nIterations); @@ -205,7 +207,7 @@ namespace Trk { int imod(0); for (std::vector<const AlignModule*>::const_iterator moduleIt=alignModules.begin(); moduleIt!=alignModules.end(); ++moduleIt,imod++) { - + // loop over AlignPar int ipar(0); DataVector<AlignPar>* alignPars=m_alignModuleTool->getAlignPars(*moduleIt); @@ -225,10 +227,10 @@ namespace Trk { return false; } - int nIter=m_fitter->iterationsOfLastFit(); + int nIter=alignCache.m_iterationsOfLastFit; ATH_MSG_DEBUG("nIter: "<<nIter); if (nIter>m_maxIter) { - ATH_MSG_DEBUG("exceeded maximum number of iterations"); + ATH_MSG_DEBUG("exceeded maximum number of iterations"); m_nIterations=0; return false; } @@ -241,40 +243,42 @@ namespace Trk { ATH_MSG_DEBUG("done with scanShifts, m_nIterations="<<m_nIterations); return true; } - + //________________________________________________________________________ bool ShiftingDerivCalcTool::setUnshiftedResiduals(AlignTrack* alignTrack) { - + // see whether straight track or not - m_fitter = alignTrack->isSLTrack() ? + m_fitter = alignTrack->isSLTrack() ? m_SLTrackFitterTool : m_trackFitterTool; ATH_MSG_DEBUG("refitting unshifted track with "<<m_fitter<<" (isSLTrack=" - <<alignTrack->isSLTrack()<<")"); - + <<alignTrack->isSLTrack()<<")"); + // refit track ATH_MSG_DEBUG("\nsetting min number iterations to "<<m_nIterations); - m_fitter->setMinIterations(m_nIterations); + IGlobalTrackFitter::AlignmentCache alignCache; + alignCache.m_minIterations = m_nIterations; - const Trk::Track* trackForRefit = + const Trk::Track* trackForRefit = (m_removeScatteringBeforeRefit) ? alignTrack->trackWithoutScattering(): dynamic_cast<const Trk::Track*>(alignTrack); if (!trackForRefit) ATH_MSG_ERROR("no track for refit!"); - const Track* refittedTrack = m_fitter->fit( *trackForRefit, + const Track* refittedTrack = m_fitter->alignmentFit( alignCache, + *trackForRefit, m_runOutlierRemoval, m_particleHypothesis); - - if (!refittedTrack) { - msg(MSG::WARNING) << "initial track refit failed" << endmsg; + + if (!refittedTrack) { + msg(MSG::WARNING) << "initial track refit failed" << endmsg; return false; - } - else + } + else ATH_MSG_DEBUG("initial track refit successful"); // dump local track chi2 for debugging double localChi2=m_residualCalculator->setResiduals(alignTrack,refittedTrack); - msg()<<MSG::DEBUG<<"local Chi2(unshifted) in setChi2VAlignParam="<<localChi2<<endmsg; + msg()<<MSG::DEBUG<<"local Chi2(unshifted) in setChi2VAlignParam="<<localChi2<<endmsg; m_unshiftedTrackChi2 = localChi2; for (int i=0;i<TrackState::NumberOfMeasurementTypes;i++) { ATH_MSG_DEBUG("getting chi2 for measType "<<i); @@ -286,11 +290,11 @@ namespace Trk { const int NMEAS=alignTrack->nAlignTSOSMeas(); // unshiftedResiduals owned by AlignTrack - m_unshiftedResiduals=new Amg::VectorX(NMEAS); + m_unshiftedResiduals=new Amg::VectorX(NMEAS); // unshiftedResErrors owned by ShiftingDerivCalcTool if (m_unshiftedResErrors) delete m_unshiftedResErrors; - m_unshiftedResErrors=new Amg::VectorX(NMEAS); + m_unshiftedResErrors=new Amg::VectorX(NMEAS); // loop over atsos and determine residuals and errors int imeas=0; @@ -305,57 +309,57 @@ namespace Trk { (*m_unshiftedResErrors)[imeas]=std::sqrt(errSq); //ATH_MSG_DEBUG("weight: "<<1./errSq<<", unshiftedRes["<<imeas<<"]=" // <<(*m_unshiftedResiduals)[imeas] - // <<", resNorm="<<itRes->residualNorm()); + // <<", resNorm="<<itRes->residualNorm()); } } if (imeas!=NMEAS) { msg(MSG::ERROR)<<"problem with nmeas, imeas="<<imeas<<", NMEAS="<<NMEAS<<endmsg; exit(3); } - alignTrack->setResidualVector(m_unshiftedResiduals); + alignTrack->setResidualVector(m_unshiftedResiduals); delete refittedTrack; refittedTrack=0; return true; } - + //________________________________________________________________________ bool ShiftingDerivCalcTool::setDerivatives(AlignTrack* alignTrack) -{ +{ ATH_MSG_DEBUG("in ShiftingDerivCalcTool setDerivatives"); m_ntracksProcessed++; - // loop over AlignTSOSCollection, + // loop over AlignTSOSCollection, // find modules that are in the AlignModuleList, - std::vector<const AlignModule*> alignModules; - for (AlignTSOSCollection::const_iterator atsosItr=alignTrack->firstAtsos(); - atsosItr != alignTrack->lastAtsos(); ++atsosItr) { + std::vector<const AlignModule*> alignModules; + for (AlignTSOSCollection::const_iterator atsosItr=alignTrack->firstAtsos(); + atsosItr != alignTrack->lastAtsos(); ++atsosItr) { ATH_MSG_VERBOSE("getting module"); const AlignModule* module=(*atsosItr)->module(); if (module) ATH_MSG_VERBOSE("have ATSOS for module "<<module->identify()); - else + else ATH_MSG_VERBOSE("no module!"); - if (!(*atsosItr)->isValid() || !module) continue; - if (find(alignModules.begin(),alignModules.end(),module) == alignModules.end()) - alignModules.push_back(module); + if (!(*atsosItr)->isValid() || !module) continue; + if (find(alignModules.begin(),alignModules.end(),module) == alignModules.end()) + alignModules.push_back(module); } - + // find perigee of best track fit and use as starting perigee for all fits m_nIterations=m_minIter; if (m_setMinIterations && !scanShifts(alignTrack, alignModules)) { return false; - }; - + }; + m_ntracksPassInitScan++; - // set unshifted residuals (this is done in AlignTrackDresser but redone here with track refit) + // set unshifted residuals (this is done in AlignTrackDresser but redone here with track refit) if (!setUnshiftedResiduals(alignTrack)) { ATH_MSG_WARNING("problem with refitting track!"); return false; - }; + }; m_ntracksPassSetUnshiftedRes++; @@ -367,9 +371,9 @@ bool ShiftingDerivCalcTool::setDerivatives(AlignTrack* alignTrack) deleteChi2VAlignParam(); for (std::vector<const AlignModule*>::const_iterator moduleIt=alignModules.begin(); moduleIt!=alignModules.end(); ++moduleIt) { - - ATH_MSG_DEBUG("finding derivatives for module "<<(**moduleIt).identify()); - + + ATH_MSG_DEBUG("finding derivatives for module "<<(**moduleIt).identify()); + std::vector<Amg::VectorX> deriv_vec; std::vector<Amg::VectorX> derivErr_vec; std::vector<double> actualsecderiv_vec; @@ -384,8 +388,8 @@ bool ShiftingDerivCalcTool::setDerivatives(AlignTrack* alignTrack) for (int i=0;i<TrackState::NumberOfMeasurementTypes;i++) m_tmpChi2VAlignParamMeasType[i] = new double*[nAlignPar]; } - - + + // get derivatives and arrays of chi2 vs. align params bool resetIPar=false; std::vector<Amg::VectorX> tmpderiv_vec; @@ -394,7 +398,8 @@ bool ShiftingDerivCalcTool::setDerivatives(AlignTrack* alignTrack) m_secPass=false; // first attempt with normal number of fitter iterations - bool success=getAllDerivatives(alignTrack, *moduleIt, + bool success=getAllDerivatives( + alignTrack, *moduleIt, tmpderiv_vec,tmpderivErr_vec,tmpactualsecderiv_vec, resetIPar); if (!success){ @@ -406,15 +411,15 @@ bool ShiftingDerivCalcTool::setDerivatives(AlignTrack* alignTrack) m_ntracksPassGetDeriv++; - if (resetIPar) { + if (resetIPar) { // second attempt with increased number of fitter iterations m_secPass=true; success=getAllDerivatives(alignTrack,*moduleIt, tmpderiv_vec,tmpderivErr_vec,tmpactualsecderiv_vec, - resetIPar); + resetIPar); } - if (!success){ + if (!success){ delete derivatives; delete derivativeErr; delete actualSecondDerivatives; @@ -423,15 +428,15 @@ bool ShiftingDerivCalcTool::setDerivatives(AlignTrack* alignTrack) m_ntracksPassGetDerivSecPass++; - if (resetIPar) { + if (resetIPar) { // third and last attempt with number of fitter iterations set to maximum m_nIterations=m_maxIter; success=getAllDerivatives(alignTrack,*moduleIt, tmpderiv_vec,tmpderivErr_vec,tmpactualsecderiv_vec, - resetIPar); + resetIPar); } - if (!success){ + if (!success){ delete derivatives; delete derivativeErr; delete actualSecondDerivatives; @@ -457,24 +462,24 @@ bool ShiftingDerivCalcTool::setDerivatives(AlignTrack* alignTrack) // set the chi2 vs. align param arrays ATH_MSG_DEBUG("setting chi2 vs. align param arrays"); m_chi2VAlignParamVec.push_back(m_tmpChi2VAlignParam); - m_chi2VAlignParamXVec.push_back(m_tmpChi2VAlignParamX); + m_chi2VAlignParamXVec.push_back(m_tmpChi2VAlignParamX); (**moduleIt).setChi2VAlignParamArray (m_tmpChi2VAlignParam); (**moduleIt).setChi2VAlignParamXArray(m_tmpChi2VAlignParamX); - + // arrays for measurement types if (m_doChi2VAlignParamMeasType) { ATH_MSG_DEBUG("pushing back for measType"); m_chi2VAlignParamVecMeasType.push_back(m_tmpChi2VAlignParamMeasType); - for (int i=0;i<TrackState::NumberOfMeasurementTypes;i++) + for (int i=0;i<TrackState::NumberOfMeasurementTypes;i++) (**moduleIt).setChi2VAlignParamArrayMeasType(i,m_tmpChi2VAlignParamMeasType[i]); } ATH_MSG_DEBUG("done setting arrays"); - derivatives->push_back(make_pair(*moduleIt,deriv_vec)); + derivatives->push_back(make_pair(*moduleIt,deriv_vec)); derivativeErr->push_back(make_pair(*moduleIt,derivErr_vec)); actualSecondDerivatives->push_back(make_pair(*moduleIt,actualsecderiv_vec)); } - + m_ntracksPassDerivatives++; alignTrack->setDerivatives(derivatives); @@ -483,41 +488,40 @@ bool ShiftingDerivCalcTool::setDerivatives(AlignTrack* alignTrack) // restore unshifted residuals in AlignTSOS setUnshiftedResiduals(alignTrack); - ATH_MSG_DEBUG("setting min iterations to 0"); - m_fitter->setMinIterations(0); - return true; + return true; } - + //________________________________________________________________________ -Amg::VectorX ShiftingDerivCalcTool::getDerivatives(AlignTrack* alignTrack, - int ipar, const AlignPar* alignPar, +Amg::VectorX ShiftingDerivCalcTool::getDerivatives( + AlignTrack* alignTrack, + int ipar, const AlignPar* alignPar, Amg::VectorX& derivativeErr, bool& resetIPar, double& actualSecondDeriv) { - const Trk::Track* trackForRefit = + const Trk::Track* trackForRefit = (m_removeScatteringBeforeRefit) ? alignTrack->trackWithoutScattering(): - dynamic_cast<const Trk::Track*>(alignTrack); + dynamic_cast<const Trk::Track*>(alignTrack); ATH_MSG_DEBUG("m_nIterations: "<<m_nIterations); - + // gets derivatives of residuals w.r.t. a specific alignment parameter given by alignPar - if (!m_fitter) + if (!m_fitter) ATH_MSG_ERROR("set m_fitter before calling getDerivatives (by calling setUnshiftedResiduals)"); - - const AlignModule* module=alignPar->alignModule(); - + + const AlignModule* module=alignPar->alignModule(); + // set derivatives for 2 shifts up and 2 shifts down const int NFITS = m_nFits; const int NMEAS = alignTrack->nAlignTSOSMeas(); module->setNChamberShifts(m_nFits); - + ATH_MSG_DEBUG("NMEAS="<<NMEAS); double** residuals=new double*[NFITS]; double** resErrors=new double*[NFITS]; double* chi2Array =new double[NFITS]; - double* chi2ArrayX=new double[NFITS]; + double* chi2ArrayX=new double[NFITS]; if (m_doChi2VAlignParamMeasType) { for (int i=0;i<TrackState::NumberOfMeasurementTypes;i++) @@ -528,9 +532,9 @@ Amg::VectorX ShiftingDerivCalcTool::getDerivatives(AlignTrack* alignTrack, residuals[ifit]=new double[NMEAS]; resErrors[ifit]=new double[NMEAS]; } - + // set the values for the unshifted track - const int unshiftedTrackIndex = m_doFits ? (m_nFits-1)/2 : 1; + const int unshiftedTrackIndex = m_doFits ? (m_nFits-1)/2 : 1; chi2Array [unshiftedTrackIndex] = m_unshiftedTrackChi2; ATH_MSG_DEBUG("chi2Array["<<unshiftedTrackIndex<<"]="<<chi2Array[unshiftedTrackIndex]); chi2ArrayX[unshiftedTrackIndex] = 0.; @@ -541,16 +545,19 @@ Amg::VectorX ShiftingDerivCalcTool::getDerivatives(AlignTrack* alignTrack, ATH_MSG_DEBUG("chi2ArrayMeasType["<<i<<"]["<<unshiftedTrackIndex<<"]="<<m_unshiftedTrackChi2MeasType[i]); } } - - + + // get shift size double shiftsize=shiftSize(alignPar); - + + IGlobalTrackFitter::AlignmentCache alignCache; + + ATH_MSG_VERBOSE("doing refits"); for (int ifit=0;ifit<NFITS;ifit++) { - + ATH_MSG_VERBOSE("ifit="<<ifit); - int jfit=ifit; + int jfit=ifit; if (ifit>unshiftedTrackIndex) { jfit=NFITS-ifit+unshiftedTrackIndex; } @@ -560,27 +567,29 @@ Amg::VectorX ShiftingDerivCalcTool::getDerivatives(AlignTrack* alignTrack, resErrors[ifit][i]=(*m_unshiftedResErrors)[i]; } // change back in case it got changed on the other side of zero - shiftsize=shiftSize(alignPar); - continue; + shiftsize=shiftSize(alignPar); + continue; } - + // shift module and fit track double currentshift = 0.; if(m_doFits) - currentshift = shiftsize * (double)(jfit-unshiftedTrackIndex); + currentshift = shiftsize * (double)(jfit-unshiftedTrackIndex); else currentshift = (ifit==0) ? -1.*shiftsize : shiftsize; - + ATH_MSG_DEBUG("current shift="<<currentshift<<" in getDerivatives"); - + m_alignModuleTool->shiftModule(module,alignTrack, alignPar->paramType(),currentshift); + ATH_MSG_VERBOSE("fitting after shift"); - const Track* refittedTrack=m_fitter->fit(*trackForRefit, + const Track* refittedTrack=m_fitter->alignmentFit(alignCache, + *trackForRefit, m_runOutlierRemoval,m_particleHypothesis); - if (m_setMinIterations && m_fitter->iterationsOfLastFit()>m_nIterations) { - m_nIterations=m_fitter->iterationsOfLastFit(); + if (m_setMinIterations && alignCache.m_iterationsOfLastFit>m_nIterations) { + m_nIterations=alignCache.m_iterationsOfLastFit; if (m_nIterations>m_maxIter) { ATH_MSG_DEBUG("exceeded max number of iterations"); m_alignModuleTool->restoreModule(module); @@ -603,7 +612,7 @@ Amg::VectorX ShiftingDerivCalcTool::getDerivatives(AlignTrack* alignTrack, m_alignModuleTool->restoreModule(module); continue; } - + if (!refittedTrack) { msg(MSG::WARNING) << "track refit failed for jfit "<<jfit <<endmsg; delete [] residuals; delete [] resErrors; @@ -620,7 +629,7 @@ Amg::VectorX ShiftingDerivCalcTool::getDerivatives(AlignTrack* alignTrack, ATH_MSG_VERBOSE("track refit successful"); double chi2=refittedTrack->fitQuality()->chiSquared(); - + ATH_MSG_VERBOSE("jfit = "<<jfit); double localChi2=m_residualCalculator->setResiduals(alignTrack,refittedTrack); ATH_MSG_DEBUG("localChi2/fittedChi2="<<localChi2<<"/"<<chi2); @@ -635,20 +644,20 @@ Amg::VectorX ShiftingDerivCalcTool::getDerivatives(AlignTrack* alignTrack, <<m_tmpChi2VAlignParamMeasType[i][ipar][jfit]); } } - + ATH_MSG_DEBUG("positions["<<jfit<<"]="<<chi2ArrayX[jfit]); int imeas(0); AlignTSOSCollection::const_iterator atsosItr=alignTrack->firstAtsos(); - for (; atsosItr != alignTrack->lastAtsos(); ++atsosItr) { + for (; atsosItr != alignTrack->lastAtsos(); ++atsosItr) { if (!(*atsosItr)->isValid()) continue; for (vector<Residual>::const_iterator itRes=(**atsosItr).firstResidual(); itRes!=(**atsosItr).lastResidual();itRes++,imeas++) { - + if (refittedTrack) { residuals[jfit][imeas]=itRes->residual(); resErrors[jfit][imeas]=std::sqrt(itRes->errSq()); - } + } else { residuals[jfit][imeas]=resErrors[jfit][imeas]=0.; } @@ -656,7 +665,7 @@ Amg::VectorX ShiftingDerivCalcTool::getDerivatives(AlignTrack* alignTrack, ATH_MSG_DEBUG("resErrors["<<jfit<<"]["<<imeas<<"]="<<resErrors[jfit][imeas]); } } - + delete refittedTrack; refittedTrack=0; ATH_MSG_VERBOSE("calling restoreModule"); m_alignModuleTool->restoreModule(module); @@ -664,11 +673,11 @@ Amg::VectorX ShiftingDerivCalcTool::getDerivatives(AlignTrack* alignTrack, int iimeas(0); AlignTSOSCollection::const_iterator aatsosItr=alignTrack->firstAtsos(); - for (; aatsosItr != alignTrack->lastAtsos(); ++aatsosItr) { + for (; aatsosItr != alignTrack->lastAtsos(); ++aatsosItr) { if (!(*aatsosItr)->isValid()) continue; for (vector<Residual>::const_iterator itRes=(**aatsosItr).firstResidual(); itRes!=(**aatsosItr).lastResidual();itRes++,iimeas++) { - for (int ifit=0;ifit<NFITS;ifit++) { + for (int ifit=0;ifit<NFITS;ifit++) { ATH_MSG_DEBUG("["<<ifit<<"]["<<iimeas<<"] res="<<residuals[ifit][iimeas]<< ", resErr="<<resErrors[ifit][iimeas]); } @@ -678,7 +687,7 @@ Amg::VectorX ShiftingDerivCalcTool::getDerivatives(AlignTrack* alignTrack, if (resetIPar) { //resetIPar=false; delete [] residuals; delete [] resErrors; - delete [] chi2Array; delete [] chi2ArrayX; + delete [] chi2Array; delete [] chi2ArrayX; if (m_secPass) ATH_MSG_WARNING("failed second pass!"); ATH_MSG_DEBUG("returning to reset IPar"); Amg::VectorX derivatives; @@ -693,23 +702,23 @@ Amg::VectorX ShiftingDerivCalcTool::getDerivatives(AlignTrack* alignTrack, double slope=fit->GetParameter(1); actualSecondDeriv=fit->GetParameter(2); delete gr; - + ATH_MSG_DEBUG("discontinuity check: chi2="<<chi2); - alignTrack->setTrackAlignParamQuality(alignPar->paramType(),chi2); + alignTrack->setTrackAlignParamQuality(alignPar->paramType(),chi2); // EventInfo if (chi2>1.e-6 || std::fabs(slope)<1.e-10) { const xAOD::EventInfo* eventInfo; StatusCode sc=evtStore()->retrieve(eventInfo); if (sc.isFailure()) - ATH_MSG_ERROR("Couldn't retrieve event info"); + ATH_MSG_ERROR("Couldn't retrieve event info"); int run=eventInfo->runNumber(); int evt=eventInfo->eventNumber(); ATH_MSG_DEBUG("discontinuity check: chi2="<<chi2<<", run/evt "<<run<<"/"<<evt); } //reset in case it got changed somewhere - shiftsize = shiftSize(alignPar); + shiftsize = shiftSize(alignPar); //-----------------------------------------// //-- get derivatives from residuals --// @@ -724,13 +733,13 @@ Amg::VectorX ShiftingDerivCalcTool::getDerivatives(AlignTrack* alignTrack, delete [] residuals; delete [] resErrors; delete [] chi2Array; delete [] chi2ArrayX; - m_nIterations=m_fitter->iterationsOfLastFit()+5; + m_nIterations=alignCache.m_iterationsOfLastFit+5; if (m_nIterations>m_maxIter) { ATH_MSG_DEBUG("exceeded max number of iterations"); resetIPar=false; } ATH_MSG_DEBUG("increasing m_nIterations to "<<m_nIterations<<" (not changing in fit yet)"); - resetIPar=true; + resetIPar=true; ATH_MSG_INFO("fail align param cut, secPass "<<m_secPass); if (m_secPass) { m_ntracksFailAlignParamCut++; @@ -743,10 +752,10 @@ Amg::VectorX ShiftingDerivCalcTool::getDerivatives(AlignTrack* alignTrack, TCanvas* canv(0); std::vector<TGraph*> vecGraphs; AlignTSOSCollection::const_iterator atsosItr=alignTrack->firstAtsos(); - for (; atsosItr != alignTrack->lastAtsos(); ++atsosItr) { + for (; atsosItr != alignTrack->lastAtsos(); ++atsosItr) { if (!(*atsosItr)->isValid()) continue; for (int idim=0;idim<(*atsosItr)->nResDim();idim++) { - + double* gr_x = new double[NFITS]; double* gr_y = new double[NFITS]; // residuals only have float precision if determined from ESD int ngoodfits=0; @@ -766,7 +775,7 @@ Amg::VectorX ShiftingDerivCalcTool::getDerivatives(AlignTrack* alignTrack, } else if (m_doFits && ngoodfits>3) { TGraph* gr=new TGraph(ngoodfits,gr_x,gr_y); - + if (m_doResidualPlots) gr->Fit("pol2","VF"); else @@ -778,7 +787,7 @@ Amg::VectorX ShiftingDerivCalcTool::getDerivatives(AlignTrack* alignTrack, <<", chi2="<<fit->GetChisquare()); derivatives[imeas]=fit->GetParameter(1)*resErrors[unshiftedTrackIndex][imeas]; // first derivative at x=0 derivativeErr[imeas]=fit->GetParError(1)*resErrors[unshiftedTrackIndex][imeas]; - + // plot residuals vs. chamber position if (m_doResidualPlots) { @@ -789,7 +798,7 @@ Amg::VectorX ShiftingDerivCalcTool::getDerivatives(AlignTrack* alignTrack, gr->GetXaxis()->SetTitle("shift in chamber pos. from nominal (CLHEP::mm)"); gr->GetYaxis()->SetTitle("residual (CLHEP::mm)"); - + TPaveText* pave=new TPaveText(.4,.65,.97,.92,"NDC"); pave->SetFillColor(0); pave->SetBorderSize(1); @@ -807,19 +816,19 @@ Amg::VectorX ShiftingDerivCalcTool::getDerivatives(AlignTrack* alignTrack, aptxt <<"alignPar "<<alignPar->paramType()<<", RIO in "<<(*atsosItr)->identify(); chi2txt<<"chi2="<<fit->GetChisquare(); - pave->AddText(firstderivtxt.str().c_str()); + pave->AddText(firstderivtxt.str().c_str()); pave->AddText(secndderivtxt.str().c_str()); pave->AddText(aptxt.str().c_str()); pave->AddText(chi2txt.str().c_str()); pave->Draw(); - std::stringstream canvName; + std::stringstream canvName; canvName<<"resPlots_ap"<<alignPar->paramType()<<"_measType" <<(*atsosItr)->measType()<<"_"<<imeas<<".eps"; canv->Print(canvName.str().c_str()); canv->Clear(); - delete pave; + delete pave; } vecGraphs.push_back(gr); } @@ -832,17 +841,17 @@ Amg::VectorX ShiftingDerivCalcTool::getDerivatives(AlignTrack* alignTrack, delete [] gr_x; ++imeas; - } + } } - // delete TGraphs and TCanvas - for (int i=0;i<(int)vecGraphs.size();i++) + // delete TGraphs and TCanvas + for (int i=0;i<(int)vecGraphs.size();i++) delete vecGraphs[i]; delete canv; - + delete [] residuals; delete [] resErrors; - + // set chi2 v alignparam for (int ifit=0;ifit<NFITS;ifit++) { m_tmpChi2VAlignParamX[ipar]=chi2ArrayX; @@ -852,16 +861,16 @@ Amg::VectorX ShiftingDerivCalcTool::getDerivatives(AlignTrack* alignTrack, ATH_MSG_DEBUG("derivativeErr: "<<derivativeErr); return derivatives; } - + //________________________________________________________________________ double ShiftingDerivCalcTool::shiftSize(const AlignPar* alignPar) const { - bool rotation = - alignPar->paramType() == AlignModule::RotX || - alignPar->paramType() == AlignModule::RotY || - alignPar->paramType() == AlignModule::RotZ; - + bool rotation = + alignPar->paramType() == AlignModule::RotX || + alignPar->paramType() == AlignModule::RotY || + alignPar->paramType() == AlignModule::RotZ; + double shift = rotation ? m_rotSize : m_traSize; - + //ok... this is kind of ugly. double sigma=alignPar->sigma(); return shift * sigma; @@ -873,12 +882,12 @@ bool ShiftingDerivCalcTool::setResidualCovMatrix(AlignTrack* alignTrack) const Amg::MatrixX* pW = new Amg::MatrixX(alignTrack->nAlignTSOSMeas(),alignTrack->nAlignTSOSMeas()); //AmgSymMatrix* pW = new AmgSymMatrix(alignTrack->nAlignTSOSMeas()); Amg::MatrixX& W = *pW; - + if (alignTrack->localErrorMatrixInv()) { ATH_MSG_ERROR("Need to assign this matrix correctly: ShiftingDerivCalcTool.cxx:888"); W = *(alignTrack->localErrorMatrixInv()); //W.assign(*(alignTrack->localErrorMatrixInv())); - } else{ + } else{ delete pW; return false; } @@ -888,9 +897,9 @@ bool ShiftingDerivCalcTool::setResidualCovMatrix(AlignTrack* alignTrack) const const double epsilon=1e-10; for( int irow=0; irow<W.rows(); ++irow) { Wisvalid = Wisvalid && W(irow,irow)>0; - if( !(W(irow,irow)>0) ) + if( !(W(irow,irow)>0) ) msg(MSG::WARNING) << "matrix invalid: " << W(irow,irow) << endmsg; - + for(int icol=0; icol<=irow; ++icol) { // this one must be true if everything else succeeded @@ -902,19 +911,19 @@ bool ShiftingDerivCalcTool::setResidualCovMatrix(AlignTrack* alignTrack) const } } - if (Wisvalid) + if (Wisvalid) alignTrack->setWeightMatrix(pW); Amg::MatrixX* pWfirst=new Amg::MatrixX(*pW); - alignTrack->setWeightMatrixFirstDeriv(pWfirst); + alignTrack->setWeightMatrixFirstDeriv(pWfirst); delete pW; return true; } - + //________________________________________________________________________ -void ShiftingDerivCalcTool::deleteChi2VAlignParam() -{ +void ShiftingDerivCalcTool::deleteChi2VAlignParam() +{ for (int i=0;i<(int)m_chi2VAlignParamVec.size();i++) { delete [] m_chi2VAlignParamVec[i]; m_chi2VAlignParamVec[i]=0; delete [] m_chi2VAlignParamXVec[i]; m_chi2VAlignParamXVec[i]=0; @@ -931,7 +940,8 @@ void ShiftingDerivCalcTool::deleteChi2VAlignParam() } //________________________________________________________________________ -bool ShiftingDerivCalcTool::getAllDerivatives(AlignTrack* alignTrack, +bool ShiftingDerivCalcTool::getAllDerivatives( + AlignTrack* alignTrack, const AlignModule* alignModule, std::vector<Amg::VectorX>& deriv_vec, std::vector<Amg::VectorX>& derivErr_vec, @@ -963,7 +973,7 @@ bool ShiftingDerivCalcTool::getAllDerivatives(AlignTrack* alignTrack, deriv_vec.push_back(vec); derivErr_vec.push_back(derivErr); actualsecderiv_vec.push_back(actualSecondDeriv); - + for (int i=0;i<m_nFits;i++) { ATH_MSG_DEBUG("m_tmpChi2VAlignParam["<<ipar<<"][" <<i<<"]="<<m_tmpChi2VAlignParam[ipar][i]); diff --git a/Tracking/TrkDetDescr/TrkSurfaces/TrkSurfaces/Surface.h b/Tracking/TrkDetDescr/TrkSurfaces/TrkSurfaces/Surface.h index c10e397ac852f7a34bbf150a51a35da492def178..f426082c2fcddb5ae047e6d7f7ac34444cd25fc3 100644 --- a/Tracking/TrkDetDescr/TrkSurfaces/TrkSurfaces/Surface.h +++ b/Tracking/TrkDetDescr/TrkSurfaces/TrkSurfaces/Surface.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration */ /////////////////////////////////////////////////////////////////// @@ -298,9 +298,9 @@ namespace Trk { virtual std::string name() const = 0; /**return number of surfaces currently created - needed for EDM monitor */ - unsigned int numberOfInstantiations(); + static unsigned int numberOfInstantiations(); /**return number of free surfaces currently created (i.e. those not belonging to a DE) - needed for EDM monitor */ - unsigned int numberOfFreeInstantiations(); + static unsigned int numberOfFreeInstantiations(); /** method to associate the associated Trk::Layer which is alreay owned - only allowed by LayerBuilder diff --git a/Tracking/TrkEvent/TrkEventPrimitives/TrkEventPrimitives/ParticleHypothesis.h b/Tracking/TrkEvent/TrkEventPrimitives/TrkEventPrimitives/ParticleHypothesis.h index 74b94bd245c390239e48c07f7d2c1eb9dd02078b..0f546885b9d53322b87cabb0128c44e7bfa5deaf 100755 --- a/Tracking/TrkEvent/TrkEventPrimitives/TrkEventPrimitives/ParticleHypothesis.h +++ b/Tracking/TrkEvent/TrkEventPrimitives/TrkEventPrimitives/ParticleHypothesis.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration */ /////////////////////////////////////////////////////////////////// @@ -9,8 +9,6 @@ #ifndef TRKEXUTILS_PARTICLEHYPOTHESIS_H #define TRKEXUTILS_PARTICLEHYPOTHESIS_H -// STL -#include <array> // Gaudi #include "GaudiKernel/SystemOfUnits.h" // define the particle hypotheses @@ -51,8 +49,8 @@ namespace Trk { */ struct ParticleMasses { - /** the vector of masses */ - const std::array<double,PARTICLEHYPOTHESES> mass= + /** the array of masses */ + const double mass[PARTICLEHYPOTHESES] = { (0.*Gaudi::Units::MeV),// non interacting mass (0.51099891*Gaudi::Units::MeV), // electron mass (105.658367*Gaudi::Units::MeV), // muon mass @@ -65,9 +63,6 @@ namespace Trk { (497.614*Gaudi::Units::MeV), // K0 rest mass (105.658367*Gaudi::Units::MeV) // muon mass }; - /**Default constructor*/ - ParticleMasses()=default; - }; /** @struct ParticleSwitcher @@ -77,8 +72,8 @@ namespace Trk { */ struct ParticleSwitcher { - /** the vector of masses */ - const std::array<ParticleHypothesis,PARTICLEHYPOTHESES> particle= + /** the array of masses */ + const ParticleHypothesis particle[PARTICLEHYPOTHESES] = { (Trk::nonInteracting), (Trk::electron), (Trk::muon), @@ -91,8 +86,6 @@ namespace Trk { (Trk::k0), (Trk::nonInteractingMuon) }; - /**Default constructor*/ - ParticleSwitcher()=default; }; diff --git a/Tracking/TrkEvent/TrkParametersBase/TrkParametersBase/CurvilinearParametersT.h b/Tracking/TrkEvent/TrkParametersBase/TrkParametersBase/CurvilinearParametersT.h index da11dcbec2b2e0494f1f09aa16b086e33a30fcb9..adf5f1be2984ed8f44c3869321a85d9a0279311f 100644 --- a/Tracking/TrkEvent/TrkParametersBase/TrkParametersBase/CurvilinearParametersT.h +++ b/Tracking/TrkEvent/TrkParametersBase/TrkParametersBase/CurvilinearParametersT.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration */ /////////////////////////////////////////////////////////////////// @@ -119,11 +119,8 @@ namespace Trk private: /** return the curvilinear frame */ - const CurvilinearUVT& curvilinearFrame() const; + const CurvilinearUVT curvilinearFrame() const; - /** the curvilinear frame */ - mutable std::unique_ptr<CurvilinearUVT> m_curvilinearFrame; - /** the curvilinear parameters identifier */ unsigned int m_cIdentifier=0; }; diff --git a/Tracking/TrkEvent/TrkParametersBase/TrkParametersBase/CurvilinearParametersT.icc b/Tracking/TrkEvent/TrkParametersBase/TrkParametersBase/CurvilinearParametersT.icc index af34d1c9c9ba7cf85edac46cee7c10ab51a534b9..fa633e7b46a2f2ca4fb39dcc6462a31067cfc0a2 100644 --- a/Tracking/TrkEvent/TrkParametersBase/TrkParametersBase/CurvilinearParametersT.icc +++ b/Tracking/TrkEvent/TrkParametersBase/TrkParametersBase/CurvilinearParametersT.icc @@ -21,7 +21,6 @@ namespace Trk ParametersT<DIM,T,S>(Amg::Vector3D(parameters[x],parameters[y],parameters[z]), Amg::Vector3D(parameters[3],parameters[4],parameters[5]), covariance), - m_curvilinearFrame(), m_cIdentifier(cIdentifier) { // flip the charge according to qOverP @@ -44,7 +43,6 @@ namespace Trk AmgSymMatrix(DIM)* cov, unsigned int cIdentifier): ParametersT<DIM,T,S>(), - m_curvilinearFrame(), m_cIdentifier(cIdentifier) { this->m_position = pos; @@ -77,7 +75,6 @@ namespace Trk AmgSymMatrix(DIM)* cov, unsigned int cIdentifier) : ParametersT<DIM,T,S>(), - m_curvilinearFrame(), m_cIdentifier(cIdentifier) { this->m_chargeDef.setCharge(charge); @@ -101,7 +98,6 @@ namespace Trk template<int DIM,class T,class S> CurvilinearParametersT<DIM,T,S>::CurvilinearParametersT(const CurvilinearParametersT<DIM,T,S>& copy): ParametersT<DIM,T,S>(copy), - m_curvilinearFrame(), m_cIdentifier(copy.m_cIdentifier) {} @@ -109,11 +105,8 @@ namespace Trk template<int DIM,class T,class S> CurvilinearParametersT<DIM,T,S>::CurvilinearParametersT(CurvilinearParametersT<DIM,T,S>&& copy): ParametersT<DIM,T,S>(std::move(copy)), - m_curvilinearFrame(), m_cIdentifier(copy.m_cIdentifier) { - if(copy.m_curvilinearFrame) - copy.m_curvilinearFrame.reset(); } // Assignment operator @@ -123,7 +116,6 @@ namespace Trk if(this != &rhs) { ParametersT<DIM,T,S>::operator=(rhs); - m_curvilinearFrame.reset(); // and the curvilinear identifier m_cIdentifier = rhs.m_cIdentifier; } @@ -138,8 +130,6 @@ namespace Trk if(this != &rhs) { ParametersT<DIM,T,S>::operator=(std::move(rhs)); - // assign the UVT framce - m_curvilinearFrame = std::move(rhs.m_curvilinearFrame); // and the curvilinear identifier m_cIdentifier = std::move(rhs.m_cIdentifier); } @@ -168,15 +158,14 @@ namespace Trk return false; // compare UVT frame - if(m_curvilinearFrame && pCasted->m_curvilinearFrame) - { - if(!m_curvilinearFrame->curvU().isApprox(pCasted->m_curvilinearFrame->curvU(),tolerance)) - return false; - if(!m_curvilinearFrame->curvV().isApprox(pCasted->m_curvilinearFrame->curvV(),tolerance)) - return false; - if(!m_curvilinearFrame->curvT().isApprox(pCasted->m_curvilinearFrame->curvT(),tolerance)) - return false; - } + CurvilinearUVT local_curvilinearFrame=curvilinearFrame(); + CurvilinearUVT casted_curvilinearFrame=pCasted->curvilinearFrame(); + if(!local_curvilinearFrame.curvU().isApprox(casted_curvilinearFrame.curvU(),tolerance)) + return false; + if(!local_curvilinearFrame.curvV().isApprox(casted_curvilinearFrame.curvV(),tolerance)) + return false; + if(!local_curvilinearFrame.curvT().isApprox(casted_curvilinearFrame.curvT(),tolerance)) + return false; // compare equality of base class parts return ParametersT<DIM,T,S>::operator==(rhs); @@ -221,21 +210,20 @@ namespace Trk { static Amg::RotationMatrix3D mFrame; // the columnes - mFrame.col(0) = curvilinearFrame().curvU(); - mFrame.col(1) = curvilinearFrame().curvV(); - mFrame.col(2) = curvilinearFrame().curvT(); + CurvilinearUVT local_curvilinearFrame=curvilinearFrame(); + mFrame.col(0) = local_curvilinearFrame.curvU(); + mFrame.col(1) = local_curvilinearFrame.curvV(); + mFrame.col(2) = local_curvilinearFrame.curvT(); // return the rotation matrix that defines the curvilinear parameters return mFrame; } template<int DIM,class T,class S> - const CurvilinearUVT& CurvilinearParametersT<DIM,T,S>::curvilinearFrame() const + const CurvilinearUVT CurvilinearParametersT<DIM,T,S>::curvilinearFrame() const { - if(!m_curvilinearFrame) - m_curvilinearFrame.reset(new CurvilinearUVT(this->momentum().unit())); - - return *m_curvilinearFrame; + CurvilinearUVT curvilinFrame(this->momentum().unit()); + return curvilinFrame; } // Dedicated update method for non-curvilinear parameters - private and controlled by friendship @@ -269,15 +257,13 @@ namespace Trk this->m_momentum = Amg::Vector3D(p*cos(phi)*sin(theta), p*sin(phi)*sin(theta), p*cos(theta)); - // new momentum needs a new curvilinear UVT frame - m_curvilinearFrame.reset(new Trk::CurvilinearUVT(this->m_momentum.unit())); } // position update if needed - loc1 if (updatedParameters[Trk::loc1] != 0.) - this->m_position += updatedParameters[Trk::loc1] * m_curvilinearFrame->curvU(); + this->m_position += updatedParameters[Trk::loc1] * curvilinearFrame().curvU(); // position update if needed - loc2 if (updatedParameters[Trk::loc2] != 0.) - this->m_position += updatedParameters[Trk::loc2] * m_curvilinearFrame->curvV(); + this->m_position += updatedParameters[Trk::loc2] * curvilinearFrame().curvV(); // in any case, the (eventually existing) surface is invalidated delete this->m_surface; this->m_surface = 0; diff --git a/Tracking/TrkEvent/TrkTrack/TrkTrack/Track.h b/Tracking/TrkEvent/TrkTrack/TrkTrack/Track.h index ca4ba02d3c1ba4890a29b4d40010d78f1ae04d3e..bc8746a378ef2dd5e40799954d73a6ea5dae9236 100755 --- a/Tracking/TrkEvent/TrkTrack/TrkTrack/Track.h +++ b/Tracking/TrkEvent/TrkTrack/TrkTrack/Track.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration */ #ifndef TRKTRACK_H @@ -13,7 +13,8 @@ #include "TrkTrack/TrackStateOnSurface.h" #include "TrkTrack/TrackInfo.h" #include "TrkParameters/TrackParameters.h" - +#include "CxxUtils/CachedValue.h" +#include <atomic> class MsgStream; class TrackCnv_p1; class TrackCnv_p2; @@ -104,7 +105,9 @@ namespace Trk /** * return Perigee. this pointer is NULL (==0) if no perigee parameters - * were assigned to the Track + * were assigned to the Track. + * + * This method performs lazy initialization and caches the result. * * Although the Perigee is just a type of TrackParameter, it has a * dedicated method because of the specific physics interest @@ -112,36 +115,36 @@ namespace Trk const Perigee* perigeeParameters () const; /** - * Return a pointer to a vector of TrackParameters. - * + * Return a pointer to a vector of TrackParameters. + * It is created Lazily by this method and then cached. + * * The pointer will be NULL (==0) if the track was created * without parameters. * * In general, it will be defined and will have at least one entry * - * @return Pointer to a DV of TrackParameters, or 0. The TrackParameters \ - * are not owned by the DV (they still belong to the track) + * @return Pointer to a DV of TrackParameters, or 0. The TrackParameters + * are not owned by the DV (they still belong to the track) */ const DataVector<const TrackParameters>* trackParameters() const; /** * return a pointer to a vector of MeasurementBase (*NOT* including - * any that come from outliers). - * - * This DataVector is created once and then cached. + * any that come from outliers). This DataVector is lazily created + * by this method and cached. * - * @return Pointer to a DV of MeasurementBase. The MeasurementBases \ - * are not owned by the DV (they still belong to the track) + * @return Pointer to a DV of MeasurementBase. The MeasurementBases + * are not owned by the DV (they still belong to the track) */ const DataVector<const MeasurementBase>* measurementsOnTrack() const; /** * return a pointer to a vector of MeasurementBase, which represent * outliers (i.e. measurements not used in the track fit). This - * DataVector is created once and then cached. + * DataVector is created lazily by this method and then cached. * - * @return Pointer to a DV of MeasurementBase, representing outliers. \ - * The MeasurementBases are not owned by the DV (they still \ + * @return Pointer to a DV of MeasurementBase, representing outliers. + * The MeasurementBases are not owned by the DV (they still * belong to the track) */ const DataVector<const MeasurementBase>* outliersOnTrack() const; @@ -160,10 +163,16 @@ namespace Trk const TrackInfo& info() const; /** - * Rreturns A pointer to the Trk::TrackSummary owned by this track (could be 0) + * Returns A pointer to the Trk::TrackSummary owned by this track (could be 0) */ const Trk::TrackSummary* trackSummary() const; - + + /** + * reset all caches + */ + + void reset(); + /** * return number of Tracks currently created */ @@ -180,7 +189,8 @@ namespace Trk typedef DataVector<const TrackParameters>::const_iterator TP_iterator; /** - * Find perigee in the vector of track parameters + * Find perigee in the vector of track parameters. + * It can be used to lazy-init the m_perigeeParameters */ void findPerigee() const; @@ -190,26 +200,28 @@ namespace Trk * AtaCylinder etc. * * It is created in the return method by looping over all - * Trk::TrackStateOnSurface adding their pointers to m_cachedParameterVector - * It will not own the TrackParameters. + * Trk::TrackStateOnSurface adding their pointers to the payload + * of m_cachedParameterVector */ - mutable DataVector<const TrackParameters>* m_cachedParameterVector; + CxxUtils::CachedValue<DataVector<const TrackParameters>> m_cachedParameterVector; /** * A vector of MeasurementBase: these objects represent the "hits" on * the track (but not outliers - see m_cachedOutlierVector) * * It is created in the return method by looping over all - * Trk::TrackStateOnSurface adding their pointers to m_cachedRioVector + * Trk::TrackStateOnSurface adding their pointers to the payload of + * m_cachedMeasurementVector */ - mutable DataVector<const MeasurementBase>* m_cachedMeasurementVector; + CxxUtils::CachedValue<DataVector<const MeasurementBase>> m_cachedMeasurementVector; /** * These objects represent the "outliers" on the track. * It is created in the return method by looping over all - * Trk::TrackStateOnSurface adding their pointers to m_cachedRioVector + * Trk::TrackStateOnSurface adding their pointers to the payload of + * m_cachedRioVector */ - mutable DataVector<const MeasurementBase>* m_cachedOutlierVector; + CxxUtils::CachedValue<DataVector<const MeasurementBase>> m_cachedOutlierVector; /** * TrackStateOnSurface @@ -225,32 +237,29 @@ namespace Trk * This will be null if the track does not contain a Perigee * or MeasuredPerigee parameter */ - mutable const Perigee *m_perigeeParameters; + CxxUtils::CachedValue<const Perigee*> m_perigeeParameters; - /** + + /** * A pointer to the Track's FitQuality. This is guaranteed to * exist and will never be null. */ const FitQuality* m_fitQuality; - + + /** + * Datamember to cache the TrackSummary + */ + const Trk::TrackSummary* m_trackSummary; + /** * This is aclass which stores the identity of where the track * was created, fitted, which properties the reconstruction had */ Trk::TrackInfo m_trackInfo; - - /** - * True if search perige parameters was performed - */ - mutable bool m_perigeeSearch; - - /** - * Datamember to cache the TrackSummary - */ - const Trk::TrackSummary* m_trackSummary; - - static unsigned int s_numberOfInstantiations; - + +#ifndef NDEBUG + static std::atomic<unsigned int> s_numberOfInstantiations; +#endif };//end of class definitions @@ -278,10 +287,14 @@ inline const Trk::TrackSummary* Trk::Track::trackSummary() const inline const Trk::Perigee* Trk::Track::perigeeParameters() const { - if( !(m_perigeeParameters || m_perigeeSearch) ) - findPerigee(); - return m_perigeeParameters; + if(!m_perigeeParameters.isValid()){ + //findPerigee performs the setting of the parameters + //i.e does the CachedValue set + findPerigee(); + } + //Here the cached value type is a pointer + return *(m_perigeeParameters.ptr()); } inline const DataVector<const Trk::TrackStateOnSurface>* Trk::Track::trackStateOnSurfaces() const diff --git a/Tracking/TrkEvent/TrkTrack/src/Track.cxx b/Tracking/TrkEvent/TrkTrack/src/Track.cxx index 376a0e08f313bdb285ac3ec5a4b49b5c7b0cec1c..b18bd9411b24ea539d98d092549a36a3bd05f4b0 100755 --- a/Tracking/TrkEvent/TrkTrack/src/Track.cxx +++ b/Tracking/TrkEvent/TrkTrack/src/Track.cxx @@ -1,6 +1,6 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration -*/ + Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration + */ #include "TrkTrack/Track.h" #include "TrkTrack/AlignmentEffectsOnTrack.h" @@ -16,306 +16,321 @@ #include <iostream> #include <string> -unsigned int Trk::Track::s_numberOfInstantiations=0; -static bool debug=false; + +#ifndef NDEBUG +std::atomic<unsigned int> Trk::Track::s_numberOfInstantiations{}; +#endif + +namespace{ +const bool debug=false; +} Trk::Track::Track (): - m_cachedParameterVector ( 0 ), - m_cachedMeasurementVector ( 0 ), - m_cachedOutlierVector( 0 ), - m_trackStateVector( 0 ), - m_perigeeParameters( 0 ), - m_fitQuality(0), -// m_trackInfo(0), - m_perigeeSearch( false ), - m_trackSummary(0) + m_cachedParameterVector{}, + m_cachedMeasurementVector{}, + m_cachedOutlierVector{}, + m_trackStateVector( 0 ), + m_perigeeParameters{}, + m_fitQuality(0), + m_trackSummary(0) { - if (debug) std::cout<<"Trk::Track Ctor 1 :"<<this<<std::endl; + if (debug) std::cout<<"Trk::Track Ctor 1 :"<<this<<std::endl; + //perigee parameters are nullptr and invalid + m_perigeeParameters.store(nullptr); + m_perigeeParameters.reset(); + #ifndef NDEBUG - s_numberOfInstantiations++; // new Track, so increment total count + s_numberOfInstantiations++; // new Track, so increment total count #endif } Trk::Track::Track( const TrackInfo& info, DataVector<const Trk::TrackStateOnSurface>* trackStateOnSurfaces, const FitQuality* fitQuality): - m_cachedParameterVector ( 0 ), - m_cachedMeasurementVector ( 0 ), - m_cachedOutlierVector( 0 ), - m_trackStateVector(trackStateOnSurfaces), - m_perigeeParameters( 0 ), - m_fitQuality(fitQuality), - m_trackInfo( info ), - m_perigeeSearch( true ), - m_trackSummary(0) + m_cachedParameterVector {}, + m_cachedMeasurementVector {}, + m_cachedOutlierVector{}, + m_trackStateVector(trackStateOnSurfaces), + m_perigeeParameters{},//default c-tor value to invalid + m_fitQuality(fitQuality), + m_trackSummary(0), + m_trackInfo( info ) { - if (debug) std::cout<<"Trk::Track Ctor 2 :"<<this<<std::endl; - using namespace std; - - findPerigee(); - + if (debug) std::cout<<"Trk::Track Ctor 2 :"<<this<<std::endl; + //find the Perigee params they will become valid given the outcome + findPerigee(); #ifndef NDEBUG - s_numberOfInstantiations++; // new Track, so increment total count + s_numberOfInstantiations++; // new Track, so increment total count #endif } Trk::Track::Track (const Track& rhs): - m_cachedParameterVector (0), - m_cachedMeasurementVector (0), - m_cachedOutlierVector(0), - m_trackStateVector( 0 ), - m_perigeeParameters( 0 ), - m_fitQuality(0), -// m_trackInfo(0), - m_perigeeSearch( true ), - m_trackSummary(0) + m_cachedParameterVector {}, + m_cachedMeasurementVector {}, + m_cachedOutlierVector{}, + m_trackStateVector( 0 ), + m_perigeeParameters{}, //default c-tor value to invalid + m_fitQuality(0), + m_trackSummary(0) { - if (debug) std::cout<<"Trk::Track Ctor 3 :"<<this<<std::endl; - using namespace Trk; - - // check that not copying itself - if (this!=&rhs) - { - // might as well use assignment operator - // rather than duplicate it all - (*this)=rhs; - } - + if (debug) std::cout<<"Trk::Track Ctor 3 :"<<this<<std::endl; + using namespace Trk; + + // check that not copying itself + if (this!=&rhs) + { + // might as well use assignment operator + // rather than duplicate it all + (*this)=rhs; + } + #ifndef NDEBUG - s_numberOfInstantiations++; // new Track, so increment total count + s_numberOfInstantiations++; // new Track, so increment total count #endif } Trk::Track& Trk::Track::operator= (const Track& rhs) { - using namespace std; - using namespace Trk; - if (this!=&rhs) + using namespace std; + using namespace Trk; + if (this!=&rhs) + { + // ++++ clear this object + delete m_fitQuality; + m_fitQuality=nullptr; + delete m_trackSummary; + m_trackSummary=nullptr; + //Invalidate the caches + m_cachedParameterVector.reset(); + m_cachedMeasurementVector.reset(); + m_cachedOutlierVector.reset(); + //The following is a DataVectors and so delete + //the contained objects automatically. + delete m_trackStateVector; + m_trackStateVector=nullptr; + + //set the author to be that of the Track being copied. + m_trackInfo = rhs.m_trackInfo; + + // create & copy other variables + if (rhs.fitQuality()!=nullptr){ + m_fitQuality = new FitQuality( *(rhs.m_fitQuality) ); + } + // create & copy other variables + if (rhs.trackSummary()!=nullptr){ + m_trackSummary = new TrackSummary( *(rhs.m_trackSummary) ); + } + //perigee parameters are nullptr and invalid + m_perigeeParameters.store(nullptr); + m_perigeeParameters.reset(); + if( rhs.m_trackStateVector!=0 ) { - // ++++ clear this object - delete m_fitQuality; - m_fitQuality=0; - delete m_trackSummary; - m_trackSummary=0; - //the following are all DataVectors and so delete the contained objects automatically. - delete m_cachedParameterVector; - m_cachedParameterVector=0; - delete m_cachedMeasurementVector; - m_cachedMeasurementVector=0; - delete m_cachedOutlierVector; - m_cachedOutlierVector=0; - delete m_trackStateVector; - m_trackStateVector=0; - - //reset perigee parameters - m_perigeeParameters=0; - - //set the author to be that of the Track being copied. - // if( m_trackInfo!=0) delete m_trackInfo; - // m_trackInfo = 0; - // if (rhs.info()!=0)m_trackInfo = new TrackInfo(*(rhs.m_trackInfo)); - m_trackInfo = rhs.m_trackInfo; - - // create & copy other variables - if (rhs.fitQuality()!=0) - m_fitQuality = new FitQuality( *(rhs.m_fitQuality) ); - // create & copy other variables - if (rhs.trackSummary()!=0) - m_trackSummary = new TrackSummary( *(rhs.m_trackSummary) ); - - if( rhs.m_trackStateVector!=0 ) - { - m_trackStateVector = new DataVector<const TrackStateOnSurface>; - m_trackStateVector->reserve(rhs.m_trackStateVector->size()); - TSoS_iterator itTSoSEnd = rhs.m_trackStateVector->end(); - for( TSoS_iterator itTSoS = rhs.m_trackStateVector->begin(); - itTSoS!=itTSoSEnd; ++itTSoS ) + m_trackStateVector = new DataVector<const TrackStateOnSurface>; + m_trackStateVector->reserve(rhs.m_trackStateVector->size()); + TSoS_iterator itTSoSEnd = rhs.m_trackStateVector->end(); + for( TSoS_iterator itTSoS = rhs.m_trackStateVector->begin(); + itTSoS!=itTSoSEnd; ++itTSoS){ + assert(*itTSoS!=0); // check that is defined. + TrackStateOnSurface* tsos = (**itTSoS).clone(); + m_trackStateVector->push_back( tsos ); + if(tsos!=nullptr){ + if(!m_perigeeParameters.isValid()){//should be invalid from above + //Now will contain a ptr and be valid + if (const Trk::Perigee* perigee = + dynamic_cast<const Trk::Perigee*>( tsos->trackParameters())) { - assert(*itTSoS!=0); // check that is defined. - TrackStateOnSurface* tsos = (**itTSoS).clone(); - m_trackStateVector->push_back( tsos ); - if (m_perigeeParameters==0) - m_perigeeParameters = dynamic_cast<const Trk::Perigee*>( tsos->trackParameters() ) ; + m_perigeeParameters.store(perigee); } + } } + } } - - return *this; + } + return *this; } Trk::Track::~Track() { - if (debug) std::cout<<"Trk::Track dtor :"<<this<<std::endl; + if (debug) std::cout<<"Trk::Track dtor :"<<this<<std::endl; + delete m_fitQuality; + delete m_trackSummary; + //the following is DataVectors and so delete the contained objects automatically. + delete m_trackStateVector; - delete m_fitQuality; - delete m_trackSummary; - //the following are all DataVectors and so delete the contained objects automatically. - delete m_trackStateVector; - // and m_perigeeParameters should not be deleted. - // (the actual object is deleted when m_trackStateVector is deleted) - - // these two are "cached" DataVectors, and shouldn't delete their contained objects. -// if(m_trackInfo) delete m_trackInfo; - delete m_cachedParameterVector; - delete m_cachedMeasurementVector; - delete m_cachedOutlierVector; #ifndef NDEBUG - s_numberOfInstantiations--; // delete Track, so decrement total count + s_numberOfInstantiations--; // delete Track, so decrement total count #endif } const DataVector<const Trk::TrackParameters>* Trk::Track::trackParameters() const { - // check if the cached vector has been created. - if ( m_cachedParameterVector!=0) return m_cachedParameterVector; - + // Do work only if it is not valid. + if ( !m_cachedParameterVector.isValid()){ // create cached parameter vector (which DOES NOT OWN ELEMENTS ... - // to prevent double deletion later on) - m_cachedParameterVector = new DataVector<const Trk::TrackParameters>(SG::VIEW_ELEMENTS); - + DataVector<const Trk::TrackParameters> tmp_ParameterVector (SG::VIEW_ELEMENTS); TSoS_iterator itTSoSEnd = m_trackStateVector->end(); for (TSoS_iterator itTSoS = m_trackStateVector->begin(); itTSoS!=itTSoSEnd; ++itTSoS) { - const TrackParameters* trackParameters = (*itTSoS)->trackParameters(); - // check to make sure that the TrackParameters exists first - if (trackParameters!=0) m_cachedParameterVector->push_back( trackParameters ); + const TrackParameters* trackParameters = (*itTSoS)->trackParameters(); + // check to make sure that the TrackParameters exists first + if (trackParameters!=0) tmp_ParameterVector.push_back( trackParameters ); } - - return m_cachedParameterVector; + m_cachedParameterVector.set(std::move(tmp_ParameterVector)); + } + return m_cachedParameterVector.ptr(); } void Trk :: Track :: findPerigee() const { - // loop through all passed parameters and, if there is a Perigee in there, - // assign it to Perigee parameters. Obviously there should never be more - // than one perigee type. I could check for it, but it will make the - // code slower which (in my opinion) makes it not worth doing. EJWM - // there can be other objects, like VertexOnTrack measurements, with - // params at a Perigee surface, thus an additional TSoS type check. AS/WL - if (not m_trackStateVector) return; //coverity 106171 Explicit null dereferenced + // loop through all passed parameters and, if there is a Perigee in there, + // assign it to Perigee parameters. Obviously there should never be more + // than one perigee type. I could check for it, but it will make the + // code slower which (in my opinion) makes it not worth doing. EJWM + // there can be other objects, like VertexOnTrack measurements, with + // params at a Perigee surface, thus an additional TSoS type check. AS/WL + + /* Here I assume, that this is externally wrapped like + * if (!m_perigeeParameters.valid){ + * findPerigee(); + * } + */ + const Trk::Perigee* tmpPerigeeParameters=nullptr; + if (m_trackStateVector!=nullptr){ DataVector<const TrackStateOnSurface>::const_iterator it = - m_trackStateVector->begin(); + m_trackStateVector->begin(); DataVector<const TrackStateOnSurface>::const_iterator itEnd = - m_trackStateVector->end(); - + m_trackStateVector->end(); for( ; it!=itEnd; ++it ) { - m_perigeeParameters = - dynamic_cast<const Trk::Perigee*>( (*it)->trackParameters() ) ; - if (m_perigeeParameters!=0 && (*it)->type(TrackStateOnSurface::Perigee)) - break; // found perigee so stop loop. + tmpPerigeeParameters = dynamic_cast<const Trk::Perigee*>( (*it)->trackParameters() ) ; + if (tmpPerigeeParameters!=0 && (*it)->type(TrackStateOnSurface::Perigee)){ + break; // found perigee so stop loop. + } } - - m_perigeeSearch = true; + } + //set to value and valid + if (tmpPerigeeParameters) { + m_perigeeParameters.set(tmpPerigeeParameters); + } + return; } const DataVector<const Trk::MeasurementBase>* Trk::Track::measurementsOnTrack() const { - // So now we check if the cached vector has been created. - if ( m_cachedMeasurementVector!=0) return m_cachedMeasurementVector; - + // We only need to do work if not valid. + if ( !m_cachedMeasurementVector.isValid()){ // create new DataVector which DOES NOT OWN ELEMENTS . - // .. to prevent double deletion later on) - m_cachedMeasurementVector - = new DataVector< const Trk::MeasurementBase>(SG::VIEW_ELEMENTS); + DataVector< const Trk::MeasurementBase> tmpMeasurementVector(SG::VIEW_ELEMENTS); // for measurements on track it is very likely that #(meas) ~ #(TSOS)-> reserve(#(TSOS)) - m_cachedMeasurementVector->reserve(m_trackStateVector->size()); + tmpMeasurementVector.reserve(m_trackStateVector->size()); TSoS_iterator itTSoSEnd = m_trackStateVector->end(); for ( TSoS_iterator itTSoS = m_trackStateVector->begin(); itTSoS!=itTSoSEnd; ++itTSoS) { - // if ((*itTSoS)->type(TrackStateOnSurface::Measurement) ) - if ( ! (*itTSoS)->type(TrackStateOnSurface::Outlier) ) - { - const Trk::MeasurementBase* rot = (*itTSoS)->measurementOnTrack(); - // does it have a measurement ? - if (rot!=0) m_cachedMeasurementVector->push_back( rot ); - } + // if ((*itTSoS)->type(TrackStateOnSurface::Measurement) ) + if ( ! (*itTSoS)->type(TrackStateOnSurface::Outlier) ) + { + const Trk::MeasurementBase* rot = (*itTSoS)->measurementOnTrack(); + // does it have a measurement ? + if (rot!=0) tmpMeasurementVector.push_back( rot ); + } } - return m_cachedMeasurementVector; + m_cachedMeasurementVector.set(std::move(tmpMeasurementVector)); + } + return m_cachedMeasurementVector.ptr(); } const DataVector<const Trk::MeasurementBase>* Trk::Track::outliersOnTrack() const { - - // So now we check if the cached vector has been created. - if ( m_cachedOutlierVector!=0) return m_cachedOutlierVector; - + //We only need to do work if not valid + if ( !m_cachedOutlierVector.isValid()){ // create new DataVector which DOES NOT OWN ELEMENTS . - // .. to prevent double deletion later on) - m_cachedOutlierVector - = new DataVector< const Trk::MeasurementBase>(SG::VIEW_ELEMENTS); + DataVector< const Trk::MeasurementBase> tmpOutlierVector(SG::VIEW_ELEMENTS); TSoS_iterator itTSoSEnd = m_trackStateVector->end(); for ( TSoS_iterator itTSoS = m_trackStateVector->begin(); itTSoS!=itTSoSEnd; ++itTSoS) { - if ((*itTSoS)->type(TrackStateOnSurface::Outlier) ) - { - const Trk::MeasurementBase* rot = (*itTSoS)->measurementOnTrack(); - assert(rot!=0); - m_cachedOutlierVector->push_back( rot ); - } + if ((*itTSoS)->type(TrackStateOnSurface::Outlier) ) + { + const Trk::MeasurementBase* rot = (*itTSoS)->measurementOnTrack(); + assert(rot!=0); + tmpOutlierVector.push_back( rot ); + } } - return m_cachedOutlierVector; + m_cachedOutlierVector.set(std::move(tmpOutlierVector)); + } + return m_cachedOutlierVector.ptr(); +} + +void Trk::Track::reset(){ + m_cachedParameterVector.reset(); + m_cachedMeasurementVector.reset(); + m_cachedOutlierVector.reset(); + m_perigeeParameters.reset(); } unsigned int Trk::Track::numberOfInstantiations() { - return s_numberOfInstantiations; + +#ifndef NDEBUG + return s_numberOfInstantiations; +#else + return 0; +#endif } /**Overload of << operator for both, MsgStream and std::ostream for debug output*/ MsgStream& Trk::operator << ( MsgStream& sl, const Trk::Track& track) { - std::string name("Track "); - sl <<name<<"Author = "<<track.info().dumpInfo()<<endmsg; - if (track.fitQuality()!=0) sl << *(track.fitQuality() )<<endmsg; - if (track.trackSummary()!=0) sl << *(track.trackSummary())<<endmsg; - else sl << "No TrackSummary available in this track."<<endmsg; - if (track.trackStateOnSurfaces() !=0) - { - sl << name <<"has " << (track.trackStateOnSurfaces()->size()) << " trackStateOnSurface(s)" << endmsg; - - //level()sh shows the output level, currentLevel() - //shows what the stream is set to - if (sl.level()<MSG::INFO) - { - // loop over TrackStateOnSurfaces if verbose turned on - DataVector<const TrackStateOnSurface>::const_iterator it=track.trackStateOnSurfaces()->begin(); - int num=0; - for (;it!=track.trackStateOnSurfaces()->end();++it) - { - sl<< " --------- Start of TrackStateOnSurface \t"<<num<<"\t-------"<<endmsg; - sl<<(**it); - sl<< " --------- End of TrackStateOnSurface \t"<<num++<<"\t-------"<<endmsg; - } - } - } - return sl; -} + std::string name("Track "); + sl <<name<<"Author = "<<track.info().dumpInfo()<<endmsg; + if (track.fitQuality()!=0) sl << *(track.fitQuality() )<<endmsg; + if (track.trackSummary()!=0) sl << *(track.trackSummary())<<endmsg; + else sl << "No TrackSummary available in this track."<<endmsg; + if (track.trackStateOnSurfaces() !=0) + { + sl << name <<"has " << (track.trackStateOnSurfaces()->size()) << " trackStateOnSurface(s)" << endmsg; -std::ostream& Trk::operator << ( std::ostream& sl, const Trk::Track& track) -{ - std::string name("Track "); - sl <<name<<"Author = "<<track.info().dumpInfo()<<std::endl; - if (track.fitQuality()!=0) sl << *(track.fitQuality() )<<std::endl; - if (track.trackSummary()!=0) sl << *(track.trackSummary())<<std::endl; - else sl << "No TrackSummary available in this track."<<std::endl; - - if (track.trackStateOnSurfaces() !=0) - { - sl << name <<"has " << (track.trackStateOnSurfaces()->size()) << " trackStateOnSurface(s)" << std::endl; + //level()sh shows the output level, currentLevel() + //shows what the stream is set to + if (sl.level()<MSG::INFO) + { + // loop over TrackStateOnSurfaces if verbose turned on DataVector<const TrackStateOnSurface>::const_iterator it=track.trackStateOnSurfaces()->begin(); int num=0; for (;it!=track.trackStateOnSurfaces()->end();++it) { - sl<< " --------- Start of TrackStateOnSurface \t"<<num<<"\t-------"<<std::endl; + sl<< " --------- Start of TrackStateOnSurface \t"<<num<<"\t-------"<<endmsg; sl<<(**it); - sl<< " --------- End of TrackStateOnSurface \t"<<num++<<"\t-------"<<std::endl; + sl<< " --------- End of TrackStateOnSurface \t"<<num++<<"\t-------"<<endmsg; } } - return sl; + } + return sl; +} + +std::ostream& Trk::operator << ( std::ostream& sl, const Trk::Track& track) +{ + std::string name("Track "); + sl <<name<<"Author = "<<track.info().dumpInfo()<<std::endl; + if (track.fitQuality()!=0) sl << *(track.fitQuality() )<<std::endl; + if (track.trackSummary()!=0) sl << *(track.trackSummary())<<std::endl; + else sl << "No TrackSummary available in this track."<<std::endl; + + if (track.trackStateOnSurfaces() !=0) + { + sl << name <<"has " << (track.trackStateOnSurfaces()->size()) << " trackStateOnSurface(s)" << std::endl; + DataVector<const TrackStateOnSurface>::const_iterator it=track.trackStateOnSurfaces()->begin(); + int num=0; + for (;it!=track.trackStateOnSurfaces()->end();++it) + { + sl<< " --------- Start of TrackStateOnSurface \t"<<num<<"\t-------"<<std::endl; + sl<<(**it); + sl<< " --------- End of TrackStateOnSurface \t"<<num++<<"\t-------"<<std::endl; + } + } + return sl; } diff --git a/Tracking/TrkExtrapolation/TrkExSTEP_Propagator/TrkExSTEP_Propagator/STEP_Propagator.h b/Tracking/TrkExtrapolation/TrkExSTEP_Propagator/TrkExSTEP_Propagator/STEP_Propagator.h index 44c9d96bfa52f160e737aeb123c22e642e181df1..4fb864b62beac5c8ebb039e0d973e9f2795369d9 100755 --- a/Tracking/TrkExtrapolation/TrkExSTEP_Propagator/TrkExSTEP_Propagator/STEP_Propagator.h +++ b/Tracking/TrkExtrapolation/TrkExSTEP_Propagator/TrkExSTEP_Propagator/STEP_Propagator.h @@ -312,10 +312,10 @@ namespace Trk { double m_matupd_lastpath{}; double m_matdump_lastpath{}; double m_delRad{0}; // deRad/dl; - double m_delIoni{0}; // deIoni/dl; + double m_delIoni{0}; // deIoni/dl; double m_sigmaIoni{0}; // dsigma(ioni)/dl; double m_kazL{0}; // kazL constant; - double m_sigmaRad; // dsigma(rad)/dl; + double m_sigmaRad{0}; // dsigma(rad)/dl; // cache for input variance double m_inputThetaVariance{}; double m_stragglingVariance{}; @@ -336,7 +336,7 @@ namespace Trk { const Trk::BinnedMaterial* m_binMat{nullptr}; std::vector<const Trk::TrackStateOnSurface*>* m_matstates{nullptr}; //!< cache of TrackStateOnSurfaces std::vector<std::pair<const Trk::TrackParameters*,int> >* m_identifiedParameters{nullptr}; //!< cache of intersections - std::vector<Trk::HitInfo>* m_hitVector; //!< cache of intersections/hit info + std::vector<Trk::HitInfo>* m_hitVector{nullptr}; //!< cache of intersections/hit info ParticleHypothesis m_particle{}; const TrackingVolume* m_trackingVolume{nullptr}; diff --git a/Tracking/TrkExtrapolation/TrkExTools/src/EnergyLossUpdator.cxx b/Tracking/TrkExtrapolation/TrkExTools/src/EnergyLossUpdator.cxx index 5c7d893915e3a88189c3a892af86c4e75718b974..057685b7b87e373947387d914b84ddd807ad1c4c 100755 --- a/Tracking/TrkExtrapolation/TrkExTools/src/EnergyLossUpdator.cxx +++ b/Tracking/TrkExtrapolation/TrkExTools/src/EnergyLossUpdator.cxx @@ -157,11 +157,12 @@ Trk::EnergyLossUpdator::energyLoss(const MaterialProperties &mat, " Energy loss updator deltaE " << deltaE << " meanIoni " << meanIoni << " meanRad " << meanRad << " sigIoni " << sigIoni << " sigRad " << sigRad << " sign " << sign << " pathLength " << pathLength); - Trk::EnergyLoss *eloss = !m_detailedEloss ? new Trk::EnergyLoss(deltaE, sigmaDeltaE) : - new Trk::EnergyLoss(deltaE, sigmaDeltaE, sigmaDeltaE, sigmaDeltaE, meanIoni, sigIoni, - meanRad, sigRad, pathLength); + std::unique_ptr<Trk::EnergyLoss> eloss = !m_detailedEloss ? + std::make_unique<Trk::EnergyLoss>(deltaE, sigmaDeltaE) : + std::make_unique<Trk::EnergyLoss>(deltaE, sigmaDeltaE, sigmaDeltaE, sigmaDeltaE, meanIoni, sigIoni,meanRad, sigRad, pathLength); + if (m_useTrkUtils) { - return eloss; + return eloss.release(); } // Code below will not be used if the parameterization of TrkUtils is used diff --git a/Tracking/TrkFitter/TrkFitterInterfaces/TrkFitterInterfaces/IGlobalTrackFitter.h b/Tracking/TrkFitter/TrkFitterInterfaces/TrkFitterInterfaces/IGlobalTrackFitter.h index d4f6d00cdcb0aee37f28fe20a1b7b7f18ab9ef20..fbc125aed9ae5e7e78c276ae6ff631a2f3ca8cd3 100755 --- a/Tracking/TrkFitter/TrkFitterInterfaces/TrkFitterInterfaces/IGlobalTrackFitter.h +++ b/Tracking/TrkFitter/TrkFitterInterfaces/TrkFitterInterfaces/IGlobalTrackFitter.h @@ -23,34 +23,48 @@ namespace Trk { /** @class IGlobalTrackFitter - provides additional abstract interfaces for information + provides additional abstract interfaces for information provided from global-least-squares track fit algorithms working in the ATLAS EDM. */ - class IGlobalTrackFitter : virtual public ITrackFitter { + class IGlobalTrackFitter : virtual public ITrackFitter { + friend class ShiftingDerivCalcTool; friend class Chi2DerivCalcTool; public: + struct AlignmentCache{ + /** access to the matrix of derivatives used during the latest global-chi2 track fit. */ - virtual Amg::MatrixX* DerivMatrix() const = 0; + Amg::MatrixX* m_derivMatrix = nullptr; /** access to the global fitter's full covariance matrix. */ - virtual Amg::MatrixX* FullCovarianceMatrix() const = 0; + Amg::MatrixX* m_fullCovarianceMatrix = nullptr; /** returns the number of iterations used by the last fit (count starts at 1 for a single-iteration fit) */ - virtual int iterationsOfLastFit() const = 0; + int m_iterationsOfLastFit = 1; + /** sets the minimum number of iterations to be used in the + track fit. */ + int m_minIterations = 0; - private: + ~AlignmentCache(){ + delete m_derivMatrix; + delete m_fullCovarianceMatrix; + } - /** sets the minimum number of iterations to be used in the - track fit. */ - virtual void setMinIterations(int iterations) = 0; + }; + /** RE-FIT A TRACK FOR ALIGNMENT. + Since it is not our but the fitter model's decision if to + re-fit on PRD or ROT level, it is made pure virtual. */ + virtual Track* alignmentFit( AlignmentCache&, + const Track&, + const RunOutlierRemoval runOutlier=false, + const ParticleHypothesis matEffects=Trk::nonInteracting) const = 0; }; } diff --git a/Tracking/TrkFitter/TrkGlobalChi2Fitter/TrkGlobalChi2Fitter/GXFTrackState.h b/Tracking/TrkFitter/TrkGlobalChi2Fitter/TrkGlobalChi2Fitter/GXFTrackState.h index 1f575b77f7a3dbc50d3d8fd39f6f98b1a8767c8e..5d041223c7e712912f63fae18e440709d8ab5820 100755 --- a/Tracking/TrkFitter/TrkGlobalChi2Fitter/TrkGlobalChi2Fitter/GXFTrackState.h +++ b/Tracking/TrkFitter/TrkGlobalChi2Fitter/TrkGlobalChi2Fitter/GXFTrackState.h @@ -25,7 +25,7 @@ namespace Trk { class TrackStateOnSurface; class GXFMaterialEffects; class TransportJacobian; - + class GXFTrackState { public: @@ -39,7 +39,7 @@ namespace Trk { //! Constructor for measurement GXFTrackState(const MeasurementBase*,const TrackParameters *trackpar=0,bool ownmb=false); - + //! constructor for hole on track GXFTrackState(const TrackParameters*); @@ -50,23 +50,23 @@ namespace Trk { //! assignment operator GXFTrackState& operator=(GXFTrackState& rhs); - - + + //! replace measurement by new, eg recalibrated one void setMeasurement(const MeasurementBase*); - + //! read access for data member: Measurement const MeasurementBase* measurement(bool takeownership=false); - + TrackState::TrackStateType trackStateType(); - void setTrackStateType(TrackState::TrackStateType); - + void setTrackStateType(TrackState::TrackStateType); + //! set method for data member: TPs void setTrackParameters(const TrackParameters*); //! read access method for data member: TPs const TrackParameters* trackParameters(bool takeownership=false); - - + + void setMaterialEffects(GXFMaterialEffects*); //! read access method for data member: MaterialEffects GXFMaterialEffects* materialEffects(); @@ -79,11 +79,11 @@ namespace Trk { //! read access method for data member: TransportJacobian double (*(jacobian)())[5]; - CLHEP::HepMatrix& derivatives(); - void setDerivatives(CLHEP::HepMatrix&); + Amg::MatrixX& derivatives(); + void setDerivatives(Amg::MatrixX&); AmgSymMatrix(5)* trackCovariance(bool takeownership=false); - void setTrackCovariance(AmgSymMatrix(5)*); + void setTrackCovariance(AmgSymMatrix(5)*); const FitQualityOnSurface *fitQuality(bool takeownership=false); void setFitQuality(const FitQualityOnSurface *); @@ -117,10 +117,10 @@ namespace Trk { const TrackParameters* m_trackpar; //!< track parameters GXFMaterialEffects* m_materialEffects; //!< Material effects on track (ie scatterer, brem) double m_jacobian[5][5]; //!< Transport jacobian wrt previous state - CLHEP::HepMatrix *m_derivs; //!< Derivatives of local parameters wrt fit parameters + Amg::MatrixX* m_derivs; //!< Derivatives of local parameters wrt fit parameters AmgSymMatrix(5)* m_covariancematrix; //!< Covariance matrix of track parameters at this surface const FitQualityOnSurface* m_fitqual; - double m_measerror[5]; //!< Measurement errors (corrected for stereo angle) + double m_measerror[5]; //!< Measurement errors (corrected for stereo angle) double m_sinstereo; //!< stereo angle TrackState::MeasurementType m_mType; //!< Measurement type, eg pixel, SCT, ... bool m_recalib; //!< Has this measurement already been recalibrated? @@ -128,6 +128,7 @@ namespace Trk { bool m_ownmb; bool m_ownfq; bool m_owncov; + bool m_ownder; bool m_measphi; Amg::Vector3D m_globpos; }; @@ -135,37 +136,37 @@ namespace Trk { inline double (*(GXFTrackState::jacobian)())[5] { return m_jacobian; } -inline CLHEP::HepMatrix& GXFTrackState::derivatives() { return *m_derivs; } +inline Amg::MatrixX& GXFTrackState::derivatives() { return *m_derivs; } -inline AmgSymMatrix(5)* GXFTrackState::trackCovariance(bool takeownership) { +inline AmgSymMatrix(5)* GXFTrackState::trackCovariance(bool takeownership) { AmgSymMatrix(5)* tmpcov=m_covariancematrix; if (takeownership) { - m_owncov=false; + m_owncov=false; //m_covariancematrix=0; } - return tmpcov; + return tmpcov; } inline const TrackParameters* GXFTrackState::trackParameters(bool takeownership) {if (takeownership) m_owntp=false; return m_trackpar; } inline GXFMaterialEffects* GXFTrackState::materialEffects() { - return m_materialEffects; + return m_materialEffects; } inline TrackState::MeasurementType GXFTrackState::measurementType() { - return m_mType; + return m_mType; } inline TrackState::TrackStateType GXFTrackState::trackStateType() { - return m_tsType; + return m_tsType; } inline void GXFTrackState::setMeasurementType(TrackState::MeasurementType mt){ - m_mType = mt; + m_mType = mt; } inline bool GXFTrackState::isRecalibrated(){ - return m_recalib; + return m_recalib; } } diff --git a/Tracking/TrkFitter/TrkGlobalChi2Fitter/TrkGlobalChi2Fitter/GXFTrajectory.h b/Tracking/TrkFitter/TrkGlobalChi2Fitter/TrkGlobalChi2Fitter/GXFTrajectory.h index bf1d615148e2395fde51759b09656b885b64d5ca..4d1767bdc393ec87b2eb9ee976e953075fa027ab 100644 --- a/Tracking/TrkFitter/TrkGlobalChi2Fitter/TrkGlobalChi2Fitter/GXFTrajectory.h +++ b/Tracking/TrkFitter/TrkGlobalChi2Fitter/TrkGlobalChi2Fitter/GXFTrajectory.h @@ -13,9 +13,10 @@ class MaterialEffectsBase; class Layer; class CylinderLayer; class DiscLayer; +class MagneticFieldProperties; /** - * @brief Internal representation of the track, used in the track fit. + * @brief Internal representation of the track, used in the track fit. @author thijs.cornelissen@cern.ch */ @@ -85,6 +86,9 @@ public: std::vector<std::pair<const Layer*,const Layer*> > &upstreamMaterialLayers(); + bool m_straightline; + MagneticFieldProperties *m_fieldprop; + private: std::vector<GXFTrackState*> m_states; //!< The vector of track states, i.e. measurements, scatterers, brem points, and holes int m_ndof; @@ -118,7 +122,7 @@ private: double m_mass; bool m_ownrefpar; int m_prefit; - GXFTrackState *m_caloelossstate; + GXFTrackState *m_caloelossstate; std::vector<std::pair<const Layer*,const Layer*> > m_upstreammat; }; } diff --git a/Tracking/TrkFitter/TrkGlobalChi2Fitter/TrkGlobalChi2Fitter/GlobalChi2Fitter.h b/Tracking/TrkFitter/TrkGlobalChi2Fitter/TrkGlobalChi2Fitter/GlobalChi2Fitter.h index 5248b04db462c63abfbbb99804c13a95204120e6..8ea722f2c83ace7e30208b3e01855894606d81a6 100755 --- a/Tracking/TrkFitter/TrkGlobalChi2Fitter/TrkGlobalChi2Fitter/GlobalChi2Fitter.h +++ b/Tracking/TrkFitter/TrkGlobalChi2Fitter/TrkGlobalChi2Fitter/GlobalChi2Fitter.h @@ -56,12 +56,61 @@ namespace Trk{ class CylinderLayer; class DiscLayer; class MagneticFieldProperties; - class TrackingGeometry; - class TrackingVolume; - class Volume; + class TrackingGeometry; + class TrackingVolume; + class Volume; class ITrkMaterialProviderTool; - + class GlobalChi2Fitter:virtual public IGlobalTrackFitter,public AthAlgTool { + + struct Cache + { + //Currnetly the information about what type of fit is being passed by the + // presence of a TrackingVolume + const TrackingGeometry* m_trackingGeometry = nullptr; + const TrackingVolume* m_caloEntrance = nullptr; + const TrackingVolume* m_msEntrance = nullptr; + + bool m_calomat,m_extmat; + bool m_idmat = true; + bool m_sirecal; + Amg::MatrixX *m_derivmat = nullptr; + Amg::MatrixX *m_fullcovmat = nullptr; + bool m_getmaterialfromtrack; + bool m_reintoutl; + bool m_matfilled = false; + int m_hitcount = 0; + FitterStatusCode m_fittercode; + bool m_acceleration; + int m_lastiter; + int m_miniter; + bool m_fiteloss; + bool m_asymeloss; + TMatrixDSym m_a,m_ainv; // Only used in MyFit (does this called more than once?) + bool m_updatescat; // Need to look at how this should be intialised + + std::vector<double> m_phiweight; + std::vector<int> m_firstmeasurement; + std::vector<int> m_lastmeasurement; + + std::vector<MaterialEffectsOnTrack> m_calomeots; + const std::vector<const TrackStateOnSurface*> *m_matvecidupstream = nullptr; + const std::vector<const TrackStateOnSurface*> *m_matveciddownstream = nullptr; + const std::vector<const TrackStateOnSurface*> *m_matvecmuonupstream = nullptr; + const std::vector<const TrackStateOnSurface*> *m_matvecmuondownstream = nullptr; + std::vector<const TrackStateOnSurface*> m_matvec; + std::vector<const Trk::Layer*> m_negdiscs; + std::vector<const Trk::Layer*> m_posdiscs; + std::vector<const Trk::Layer*> m_barrelcylinders; + bool m_fastmat = true; + int m_MMCorrectionStatus = 0; + + void cleanup(); + ~Cache(){ cleanup(); }; + + + }; + public: GlobalChi2Fitter(const std::string&,const std::string&,const IInterface*); virtual ~GlobalChi2Fitter(); @@ -99,67 +148,77 @@ public: const RunOutlierRemoval runOutlier=false, const ParticleHypothesis matEffects=nonInteracting) const; - virtual Amg::MatrixX *DerivMatrix() const; - - virtual Amg::MatrixX *FullCovarianceMatrix() const; + virtual Track* alignmentFit ( AlignmentCache&, + const Track&, + const RunOutlierRemoval runOutlier=false, + const ParticleHypothesis matEffects=Trk::nonInteracting) const; - FitterStatusCode statusCodeOfLastFit() const; private: - Track* myfit(GXFTrajectory&, - const TrackParameters&, - const RunOutlierRemoval runOutlier=false, - const ParticleHypothesis matEffects=nonInteracting) const; + Track * fitIm(Cache& cache, + const Track &inputTrack, + const RunOutlierRemoval runOutlier, + const ParticleHypothesis matEffects) const; - Track* mainCombinationStrategy(const Track&, + + Track* myfit( Cache&, + GXFTrajectory&, + const TrackParameters&, + const RunOutlierRemoval runOutlier=false, + const ParticleHypothesis matEffects=nonInteracting) const; + + Track* mainCombinationStrategy(Cache&, + const Track&, const Track&, GXFTrajectory&, std::vector<MaterialEffectsOnTrack>&) const; - Track* backupCombinationStrategy(const Track&, + Track* backupCombinationStrategy(Cache&, + const Track&, const Track&, GXFTrajectory&, std::vector<MaterialEffectsOnTrack>&) const; - void makeProtoState(GXFTrajectory &,const TrackStateOnSurface*,int index=-1,bool copytp=false) const; + void makeProtoState(Cache&, GXFTrajectory &,const TrackStateOnSurface*,int index=-1,bool copytp=false) const; - void makeProtoStateFromMeasurement(GXFTrajectory &,const MeasurementBase*, const TrackParameters *trackpar=0, bool isoutlier=false, int index=-1) const; + void makeProtoStateFromMeasurement(Cache&, GXFTrajectory &,const MeasurementBase*, const TrackParameters *trackpar=0, bool isoutlier=false, int index=-1) const; - bool processTrkVolume(const Trk::TrackingVolume* tvol) const; + bool processTrkVolume(Cache&, const Trk::TrackingVolume* tvol) const; - void addIDMaterialFast(GXFTrajectory &,const TrackParameters *,ParticleHypothesis) const; + void addIDMaterialFast(Cache&, GXFTrajectory &,const TrackParameters *,ParticleHypothesis) const; - void addMaterial(GXFTrajectory &,const TrackParameters *,ParticleHypothesis) const; + void addMaterial(Cache&, GXFTrajectory &,const TrackParameters *,ParticleHypothesis) const; - const TrackParameters *makePerigee(const TrackParameters &, const ParticleHypothesis) const; + const TrackParameters *makePerigee(Cache&, const TrackParameters &, const ParticleHypothesis) const; - Track *makeTrack(GXFTrajectory&, const ParticleHypothesis matEffects) const; + Track *makeTrack(Cache&, GXFTrajectory&, const ParticleHypothesis matEffects) const; TrackStateOnSurface *makeTSOS(GXFTrackState*, const ParticleHypothesis matEffects) const; - void fillResiduals(GXFTrajectory &,int,TMatrixDSym &,TVectorD&,TDecompChol &,bool &) const; + void fillResiduals(Cache&, GXFTrajectory &,int,TMatrixDSym &,TVectorD&,TDecompChol &,bool &) const; void fillDerivatives(GXFTrajectory &traj, bool onlybrem=false) const; - FitterStatusCode runIteration(GXFTrajectory &,int,TMatrixDSym &,TVectorD &,TDecompChol &,bool &) const; - - FitterStatusCode updateFitParameters(GXFTrajectory &,TVectorD &,TDecompChol &) const; + FitterStatusCode runIteration(Cache&, GXFTrajectory &,int,TMatrixDSym &,TVectorD &,TDecompChol &,bool &) const; - GXFTrajectory *runTrackCleanerSilicon(GXFTrajectory&, TMatrixDSym&, TMatrixDSym&, TVectorD&, bool) const; + FitterStatusCode updateFitParameters(GXFTrajectory &,TVectorD &,TDecompChol &) const; - void runTrackCleanerMDT(GXFTrajectory&, TMatrixDSym&, TMatrixDSym&, TVectorD&, TDecompChol &) const; + GXFTrajectory *runTrackCleanerSilicon(Cache&, GXFTrajectory&, TMatrixDSym&, TMatrixDSym&, TVectorD&, bool) const; + //Not called + void runTrackCleanerMDT(Cache&, GXFTrajectory&, TMatrixDSym&, TMatrixDSym&, TVectorD&, TDecompChol &) const; - void runTrackCleanerTRT(GXFTrajectory&, TMatrixDSym&, TVectorD&, TDecompChol &, bool, bool, int) const; + void runTrackCleanerTRT(Cache&, GXFTrajectory&, TMatrixDSym&, TVectorD&, TDecompChol &, bool, bool, int) const; FitterStatusCode calculateTrackParameters(GXFTrajectory &,bool) const; - + void calculateDerivatives(GXFTrajectory&) const; void calculateTrackErrors(GXFTrajectory&,TMatrixDSym &,bool) const; - TransportJacobian *numericalDerivatives(const TrackParameters *,const Surface *, PropDirection) const; + //only m_fieldprop + TransportJacobian *numericalDerivatives(const TrackParameters *,const Surface *, PropDirection, const MagneticFieldProperties*) const; void print(GXFTrajectory&) const; @@ -171,9 +230,7 @@ private: void errors1(double (*jac)[5],AmgSymMatrix(5) &prevcov,AmgSymMatrix(5) &trackerrmat,bool onlylocal) const; - void errors2(CLHEP::HepMatrix &derivatives,AmgSymMatrix(5) &trackerrmat, double *myarray,std::vector<int> *rowindices,int &maxl,int *minm,bool onlylocal,int nfitpars) const; - - void cleanup() const; + void errors2(Amg::MatrixX &derivatives,AmgSymMatrix(5) &trackerrmat, double *myarray,std::vector<int> *rowindices,int &maxl,int *minm,bool onlylocal,int nfitpars) const; #ifdef GXFDEBUGCODE void printTruth(Identifier) const; @@ -195,70 +252,60 @@ private: ToolHandle< IMaterialEffectsOnTrackProvider > m_calotoolparam; ServiceHandle< MagField::IMagFieldSvc > m_fieldService; - - mutable ServiceHandle<ITrackingGeometrySvc> m_trackingGeometrySvc; - //mutable ServiceHandle<ITrackingVolumesSvc> m_trackingVolumesSvc; - mutable const TrackingGeometry* m_trackingGeometry; - mutable const TrackingVolume* m_caloEntrance; - // mutable const Volume* m_caloEntrance2; - mutable const TrackingVolume* m_msEntrance; + ServiceHandle<ITrackingGeometrySvc> m_trackingGeometrySvc; + + + //Leave original memory pool for derivates here just in case it + // needs to replaced. + //static std::vector<Amg::MatrixX> m_derivpool; + + bool m_signedradius; - mutable bool m_calomat,m_extmat,m_idmat; - bool m_fillderivmatrix; - double m_outlcut; + bool m_calomat,m_extmat; + bool m_fillderivmatrix; + double m_outlcut; double m_maxoutliers; - bool m_printderivs; + bool m_printderivs; double m_p; // momentum (for estimating multiple scattering) //std::vector<double> radlengths; bool m_straightlineprop; - mutable bool m_straightline; bool m_extensioncuts; - mutable bool m_sirecal; - mutable bool m_trtrecal; + bool m_sirecal; + bool m_trtrecal; bool m_kinkfinding; - mutable Amg::MatrixX *m_derivmat; - mutable Amg::MatrixX *m_fullcovmat; const AtlasDetectorID *m_DetID; bool m_decomposesegments; - mutable bool m_getmaterialfromtrack; - mutable bool m_domeastrackpar; + bool m_getmaterialfromtrack; + bool m_domeastrackpar; bool m_storemat; double m_chi2cut; - mutable double m_scalefactor; - mutable bool m_redoderivs; - mutable bool m_reintoutl; - mutable bool m_matfilled; + double m_scalefactor; + bool m_redoderivs; + bool m_reintoutl; TrackFitInputPreparator* m_inputPreparator; int m_maxit; - mutable int m_nfits,m_nsuccessfits,m_matrixinvfailed,m_notenoughmeas,m_propfailed,m_invalidangles,m_notconverge,m_highchi2,m_lowmomentum; - mutable FitterStatusCode m_fittercode; - mutable bool m_acceleration; - mutable bool m_numderiv; - mutable int m_lastiter; - mutable int m_miniter; - mutable bool m_fiteloss; - mutable bool m_asymeloss; + bool m_acceleration; + bool m_numderiv; + int m_miniter; + bool m_fiteloss; + bool m_asymeloss; + MagneticFieldProperties *m_fieldpropnofield; MagneticFieldProperties *m_fieldpropfullfield; - mutable MagneticFieldProperties *m_fieldprop; - static std::vector<CLHEP::HepMatrix> m_derivpool; - mutable TMatrixDSym m_a,m_ainv; ParticleMasses m_particleMasses; - mutable std::vector<double> m_residuals; - mutable bool m_updatescat; bool m_useCaloTG; ToolHandle<Trk::ITrkMaterialProviderTool> m_caloMaterialProvider; bool m_rejectLargeNScat; #ifdef GXFDEBUGCODE - + bool m_truth; - mutable const PRD_MultiTruthCollection *m_truthCollectionPixel; - mutable const PRD_MultiTruthCollection *m_truthCollectionSCT; - mutable const PRD_MultiTruthCollection *m_truthCollectionTRT; + mutable const PRD_MultiTruthCollection *m_truthCollectionPixel; + mutable const PRD_MultiTruthCollection *m_truthCollectionSCT; + mutable const PRD_MultiTruthCollection *m_truthCollectionTRT; mutable const PRD_MultiTruthCollection *m_truthCollectionMDT; mutable const PRD_MultiTruthCollection *m_truthCollectionRPC; mutable const PRD_MultiTruthCollection *m_truthCollectionTGC; @@ -274,38 +321,15 @@ private: mutable int m_barcode; #endif - mutable int m_hitcount; - mutable int m_energybalance; - - mutable std::vector<double> m_phiweight; - mutable std::vector<int> m_firstmeasurement; - mutable std::vector<int> m_lastmeasurement; - - mutable std::vector<MaterialEffectsOnTrack> m_calomeots; - mutable const std::vector<const TrackStateOnSurface*> *m_matvecidupstream; - mutable const std::vector<const TrackStateOnSurface*> *m_matveciddownstream; - mutable const std::vector<const TrackStateOnSurface*> *m_matvecmuonupstream; - mutable const std::vector<const TrackStateOnSurface*> *m_matvecmuondownstream; - mutable std::vector<const TrackStateOnSurface*> m_matvec; - int m_fixbrem; - mutable std::vector<const Trk::Layer*> m_negdiscs; - mutable std::vector<const Trk::Layer*> m_posdiscs; - mutable std::vector<const Trk::Layer*> m_barrelcylinders; - mutable std::vector<const Trk::Layer*> m_othercylinders; - mutable bool m_fastmat; - mutable int m_MMCorrectionStatus; -}; -//std::vector<CLHEP::HepMatrix> Trk::GlobalChi2Fitter::m_derivpool; + mutable std::atomic<int> m_nfits,m_nsuccessfits,m_matrixinvfailed,m_notenoughmeas,m_propfailed,m_invalidangles,m_notconverge,m_highchi2,m_lowmomentum; + + mutable std::atomic<int> m_energybalance; + int m_fixbrem; -inline Trk::FitterStatusCode Trk::GlobalChi2Fitter::statusCodeOfLastFit() const - { return m_fittercode; } -inline Amg::MatrixX *Trk::GlobalChi2Fitter::DerivMatrix() const - { return m_derivmat; } -inline Amg::MatrixX *Trk::GlobalChi2Fitter::FullCovarianceMatrix() const - { return m_fullcovmat; } +}; } diff --git a/Tracking/TrkFitter/TrkGlobalChi2Fitter/src/GXFTrackState.cxx b/Tracking/TrkFitter/TrkGlobalChi2Fitter/src/GXFTrackState.cxx index 7b377dd26d46c7848c5c735b7eb15afb6786181d..017d79edce932b4a7e68b2f59582731a274a70f1 100755 --- a/Tracking/TrkFitter/TrkGlobalChi2Fitter/src/GXFTrackState.cxx +++ b/Tracking/TrkFitter/TrkGlobalChi2Fitter/src/GXFTrackState.cxx @@ -20,10 +20,6 @@ // #include <string> -using CLHEP::HepVector; -using CLHEP::HepMatrix; - - namespace Trk { GXFTrackState::GXFTrackState() : @@ -51,7 +47,7 @@ namespace Trk { m_tsType(rhs.m_tsType), m_trackpar(rhs.m_trackpar), // ? (rhs.m_owntp ? rhs.m_trackpar->clone() : rhs.m_trackpar) : 0), m_materialEffects(rhs.m_materialEffects ? new GXFMaterialEffects(*rhs.m_materialEffects) : 0), - m_derivs(rhs.m_derivs), + m_derivs(rhs.m_derivs ? new Amg::MatrixX( *rhs.m_derivs ): nullptr ), m_covariancematrix(rhs.m_covariancematrix ? (rhs.m_owncov ? new AmgSymMatrix(5)(*rhs.m_covariancematrix) : rhs. m_covariancematrix) : 0), m_fitqual(rhs.m_fitqual ? (rhs.m_ownfq ? new FitQualityOnSurface(*rhs.m_fitqual) : rhs.m_fitqual) : 0), @@ -149,6 +145,7 @@ namespace Trk { if (m_ownfq) { delete m_fitqual; } + delete m_derivs; } GXFTrackState & @@ -164,7 +161,7 @@ namespace Trk { m_tsType = rhs.m_tsType; m_trackpar = rhs.m_trackpar;// ? (rhs.m_owntp ? rhs.m_trackpar->clone() : rhs.m_trackpar ) : 0; m_materialEffects = rhs.m_materialEffects ? new GXFMaterialEffects(*rhs.m_materialEffects) : 0; - m_derivs = rhs.m_derivs; + m_derivs = rhs.m_derivs ? new Amg::MatrixX( *rhs.m_derivs ): nullptr ; delete m_covariancematrix; m_covariancematrix = rhs.m_covariancematrix ? (rhs.m_owncov ? new AmgSymMatrix(5)(*rhs.m_covariancematrix) : rhs.m_covariancematrix) @@ -246,8 +243,11 @@ namespace Trk { } void - GXFTrackState::setDerivatives(HepMatrix &deriv) { - m_derivs = &deriv; + GXFTrackState::setDerivatives(Amg::MatrixX& deriv) { + if(m_derivs) + delete m_derivs; + + m_derivs = new Amg::MatrixX(deriv); } void diff --git a/Tracking/TrkFitter/TrkGlobalChi2Fitter/src/GXFTrajectory.cxx b/Tracking/TrkFitter/TrkGlobalChi2Fitter/src/GXFTrajectory.cxx index 242693cd8f7ac8abd5e4ab07812ca2be583279a3..ab64217a5a18ea32a6ec0abed20931cd967496f3 100644 --- a/Tracking/TrkFitter/TrkGlobalChi2Fitter/src/GXFTrajectory.cxx +++ b/Tracking/TrkFitter/TrkGlobalChi2Fitter/src/GXFTrajectory.cxx @@ -8,6 +8,8 @@ #include "TrkSurfaces/Surface.h" #include "TrkRIO_OnTrack/RIO_OnTrack.h" #include "TrkCompetingRIOsOnTrack/CompetingRIOsOnTrack.h" +#include "TrkGeometry/MagneticFieldProperties.h" + using CLHEP::HepVector; @@ -15,6 +17,8 @@ using CLHEP::HepVector; namespace Trk { GXFTrajectory::GXFTrajectory() { + m_straightline = true; + m_fieldprop = nullptr; m_ndof = 0; m_nperpars = -1; m_nscatterers = 0; @@ -43,6 +47,8 @@ namespace Trk { } GXFTrajectory::GXFTrajectory(GXFTrajectory &rhs) { + m_straightline = rhs.m_straightline; + m_fieldprop = rhs.m_fieldprop; m_ndof = rhs.m_ndof; m_nperpars = rhs.m_nperpars; m_nscatterers = rhs.m_nscatterers; @@ -104,6 +110,8 @@ namespace Trk { GXFTrajectory & GXFTrajectory::operator = (GXFTrajectory &rhs) { if (this != &rhs) { + m_straightline = rhs.m_straightline; + m_fieldprop = rhs.m_fieldprop; m_ndof = rhs.m_ndof; m_nperpars = rhs.m_nperpars; m_nscatterers = rhs.m_nscatterers; diff --git a/Tracking/TrkFitter/TrkGlobalChi2Fitter/src/GlobalChi2Fitter.cxx b/Tracking/TrkFitter/TrkGlobalChi2Fitter/src/GlobalChi2Fitter.cxx index b2176b75520247622b08980464323ed824fdbee3..cdeec41f022511f202dcaeccfefcf445369815cc 100644 --- a/Tracking/TrkFitter/TrkGlobalChi2Fitter/src/GlobalChi2Fitter.cxx +++ b/Tracking/TrkFitter/TrkGlobalChi2Fitter/src/GlobalChi2Fitter.cxx @@ -76,17 +76,12 @@ #include "TrkAlgebraUtils/AlSymMat.h" #include "EventPrimitives/EventPrimitivesToStringConverter.h" -using CLHEP::Hep3Vector; -using CLHEP::HepVector; -using CLHEP::HepMatrix; -using CLHEP::HepRotation; -using CLHEP::HepSymMatrix; using CLHEP::MeV; using CLHEP::mm; namespace Trk { - std::vector<HepMatrix> GlobalChi2Fitter::m_derivpool; + //std::vector<Amg::MatrixX> GlobalChi2Fitter::m_derivpool; GlobalChi2Fitter::GlobalChi2Fitter(const std::string &t, const std::string &n, const IInterface *p) : @@ -106,13 +101,8 @@ namespace Trk { m_fieldService("AtlasFieldSvc", n), m_trackingGeometrySvc("", n), // m_trackingVolumesSvc ("TrackingVolumesSvc/TrackingVolumesSvc",n), - m_trackingGeometry(nullptr), - m_caloEntrance(nullptr), - m_msEntrance(nullptr), m_signedradius{}, - m_calomat{}, m_extmat{}, m_idmat{}, - m_derivmat(nullptr), - m_fullcovmat(nullptr), + m_calomat{}, m_extmat{}, m_DetID(nullptr), m_decomposesegments{}, m_getmaterialfromtrack{}, @@ -122,29 +112,21 @@ namespace Trk { m_scalefactor{}, m_redoderivs{}, m_reintoutl{}, - m_matfilled{}, m_inputPreparator{}, m_maxit{}, - m_nfits{}, m_nsuccessfits{}, m_matrixinvfailed{}, m_notenoughmeas{}, m_propfailed{}, m_invalidangles{}, - m_notconverge{}, m_highchi2{}, m_lowmomentum{}, m_acceleration{}, m_numderiv{}, - m_lastiter{}, m_miniter{}, m_fiteloss{}, m_asymeloss{}, m_fieldpropnofield(nullptr), m_fieldpropfullfield(nullptr), - m_fieldprop(nullptr), - // m_derivpool{}, static member - m_a{}, m_ainv{}, m_particleMasses{}, - m_residuals{}, - m_updatescat{}, m_useCaloTG(false), m_caloMaterialProvider("Trk::TrkMaterialProviderTool/TrkMaterialProviderTool"), m_rejectLargeNScat(false), - m_MMCorrectionStatus(0){ + m_nfits{}, m_nsuccessfits{}, m_matrixinvfailed{}, m_notenoughmeas{}, m_propfailed{}, + m_invalidangles{},m_notconverge{}, m_highchi2{}, m_lowmomentum{}{ // tools and services declareProperty("ExtrapolationTool", m_extrapolator); declareProperty("MeasurementUpdateTool", m_updator); @@ -202,7 +184,6 @@ namespace Trk { declareProperty("PRDTruthCollectionCSC", m_multiTruthCollectionCSCName = "CSC_TruthMap"); m_barcode = 0; #endif - m_hitcount = 0; m_energybalance=0; declareProperty("FixBrem", m_fixbrem = -1); declareProperty("RejectLargeNScat", m_rejectLargeNScat=false); @@ -211,21 +192,15 @@ namespace Trk { // m_miniter=1; m_fieldpropnofield = new MagneticFieldProperties(Trk::NoField); m_fieldpropfullfield = new MagneticFieldProperties(Trk::FullField); - m_straightline = m_straightlineprop; - m_fieldprop = m_straightline ? m_fieldpropnofield : m_fieldpropfullfield; +/* if (GlobalChi2Fitter::m_derivpool.empty()) { GlobalChi2Fitter::m_derivpool.resize(100); } for (int i = 0; i < 100; i++) { - m_derivpool[i] = HepMatrix(5, 50, 0); - } - - m_fastmat = true; - m_matvecmuonupstream = 0; - m_matvecmuondownstream = 0; - m_matvecidupstream = 0; - m_matveciddownstream = 0; + m_derivpool[i] = Amg::MatrixX(5, 50); + m_derivpool[i].setZero(); + }*/ } StatusCode @@ -355,9 +330,6 @@ namespace Trk { m_notconverge = 0; m_highchi2 = 0; m_lowmomentum = 0; - m_matfilled = false; - m_idmat = true; - m_hitcount = 0; m_energybalance = 0; return StatusCode::SUCCESS; } @@ -389,15 +361,32 @@ namespace Trk { const ParticleHypothesis) const { ATH_MSG_DEBUG("--> entering GlobalChi2Fitter::fit(Track,Track,)"); + + Cache cache; + cache.m_calomat = m_calomat; + cache.m_extmat = m_extmat; + cache.m_sirecal = m_sirecal; + cache.m_getmaterialfromtrack = m_getmaterialfromtrack; + cache.m_reintoutl = m_reintoutl; + cache.m_acceleration = m_acceleration; + cache.m_miniter = m_miniter; + cache.m_fiteloss = m_fiteloss; + cache.m_asymeloss = m_asymeloss; + + GXFTrajectory trajectory; if (!m_straightlineprop) { - m_straightline = (!m_fieldService->solenoidOn() && !m_fieldService->toroidOn()); + trajectory.m_straightline = (!m_fieldService->solenoidOn() && !m_fieldService->toroidOn()); } - m_fieldprop = m_straightline ? m_fieldpropnofield : m_fieldpropfullfield; + trajectory.m_fieldprop = trajectory.m_straightline ? m_fieldpropnofield : m_fieldpropfullfield; #ifdef GXFDEBUGCODE if (m_truth) { retrieveTruth(); } #endif + + + + bool firstismuon = false; const Track *indettrack = &intrk1; const Track *muontrack = &intrk2; @@ -503,10 +492,11 @@ namespace Trk { } Track *track = 0; + bool tmp = m_calomat; - m_calomat = false; - bool tmp2 = m_extmat; - bool tmp4 = m_idmat; + cache.m_calomat = false; + bool tmp2 = cache.m_extmat; + bool tmp4 = cache.m_idmat; const TrackParameters *measperid = indettrack->perigeeParameters(); const TrackParameters *measpermuon = muontrack->perigeeParameters(); @@ -527,9 +517,8 @@ namespace Trk { // eloss: " << std::abs(calomeots[1].energyLoss()->deltaE()) << std::endl; if ((std::abs(calomeots[1].energyLoss()->deltaE()) - std::abs(1 / qoverpid) + std::abs(1 / qoverpmuon)) / energyerror > 5) { - if (msgLvl(MSG::DEBUG)) { - msg(MSG::DEBUG) << "Changing from measured to parametrized energy loss" << endmsg; - } + + ATH_MSG_DEBUG("Changing from measured to parametrized energy loss"); calomeots = m_calotoolparam->extrapolationSurfacesAndEffects( *m_navigator->highestVolume(), *prop, *parforcalo, parforcalo->associatedSurface(), Trk::anyDirection, Trk::muon); @@ -550,62 +539,39 @@ namespace Trk { int nfits = m_nfits; bool firstfitwasattempted = false; - GXFTrajectory trajectory; - if (!m_caloEntrance) { - m_trackingGeometry = m_trackingGeometrySvc->trackingGeometry(); - if (m_trackingGeometry) { - m_caloEntrance = m_trackingGeometry->trackingVolume("InDet::Containers::InnerDetector"); + if (!cache.m_caloEntrance) { + cache.m_trackingGeometry = m_trackingGeometrySvc->trackingGeometry(); + if (cache.m_trackingGeometry) { + cache.m_caloEntrance = cache.m_trackingGeometry->trackingVolume("InDet::Containers::InnerDetector"); } - if (!m_caloEntrance) { - msg(MSG::ERROR) << "calo entrance not available" << endmsg; + if (!cache.m_caloEntrance) { + ATH_MSG_ERROR( "calo entrance not available" ); return 0; } } if ((!m_fieldService->toroidOn() && !m_fieldService->solenoidOn()) || - (m_getmaterialfromtrack && !muonisstraight && measphi && + (cache.m_getmaterialfromtrack && !muonisstraight && measphi && muontrack->info().trackFitter() != Trk::TrackInfo::Unknown && qoverpid * qoverpmuon > 0)) { - track = mainCombinationStrategy(intrk1, intrk2, trajectory, calomeots); + track = mainCombinationStrategy(cache,intrk1, intrk2, trajectory, calomeots); if (m_nfits == nfits + 1) { firstfitwasattempted = true; } if (!track) { - m_hitcount = 0; + cache.m_hitcount = 0; } } - m_extmat = tmp2; - m_idmat = tmp4; + if (!track && !firstfitwasattempted && (m_fieldService->toroidOn() || m_fieldService->solenoidOn())) { + // Reset the trajectory GXFTrajectory trajectory2; + trajectory2.m_straightline = trajectory.m_straightline; + trajectory2.m_fieldprop = trajectory.m_fieldprop; trajectory = trajectory2; - track = backupCombinationStrategy(intrk1, intrk2, trajectory, calomeots); - /* if (!track && !isparametrized && m_fittercode!=FitterStatusCode::Success) { - if (msgLvl(MSG::DEBUG)) msg(MSG::DEBUG) << "Changing from measured to parametrized energy loss" << endmsg; - calomeots=m_calotoolparam->extrapolationSurfacesAndEffects(*m_navigator->highestVolume(),*prop, - *parforcalo,*parforcalo->associatedSurface(),Trk::anyDirection,Trk::muon); - isparametrized=true; - if (calomeots.size()==3){ - trajectory=trajectory2; - track=backupCombinationStrategy(intrk1,intrk2,trajectory,calomeots); - } - } */ + track = backupCombinationStrategy(cache,intrk1, intrk2, trajectory, calomeots); } - /* int index=(int)trajectory.residuals().size()-trajectory.numberOfBrems(); - double calopull=std::abs(trajectory.residuals()[index]/trajectory.errors()[index]); - double thept= track ? track->perigeeParameters()->pT() : 999999999; - bool elossok=true; - if (m_fieldService->solenoidOn() && m_fieldService->toroidOn() && track && - track->trackParameters()->front()->charge()!=track->trackParameters()->back()->charge()) elossok=false; - if (!firstismuon && m_fieldService->toroidOn() && thept<20000 && (calopull>5 || (calopull>3 && thept<10000))) - elossok=false; - if (!elossok) { - delete track; - track=0; - m_energybalance++; - if (msgLvl(MSG::DEBUG)) msg(MSG::DEBUG) << "Track failed energy balance cut" << endmsg; - } */ bool pseudoupdated = false; if (track) { for (int i = 0; i < (int) trajectory.trackStates().size(); i++) { @@ -643,11 +609,11 @@ namespace Trk { if (pseudoupdated) { Track *oldtrack = track; trajectory.setConverged(false); - m_matfilled = true; + cache.m_matfilled = true; track = - myfit(trajectory, *oldtrack->perigeeParameters(), false, + myfit( cache, trajectory, *oldtrack->perigeeParameters(), false, (m_fieldService->toroidOn() || m_fieldService->solenoidOn()) ? muon : nonInteracting); - m_matfilled = false; + cache.m_matfilled = false; delete oldtrack; } } @@ -658,22 +624,21 @@ namespace Trk { track->info().addPatternReco(intrk2.info()); m_nsuccessfits++; } - m_calomat = tmp; - m_extmat = tmp2; - m_idmat = tmp4; + cache.m_calomat = tmp; + cache.m_extmat = tmp2; + cache.m_idmat = tmp4; // if (track) std::cout << "track: " << *track << std::endl; - cleanup(); + cache.cleanup(); return track; } Track * - GlobalChi2Fitter::mainCombinationStrategy(const Track &intrk1, + GlobalChi2Fitter::mainCombinationStrategy(Cache& cache, + const Track &intrk1, const Track &intrk2, GXFTrajectory &trajectory, std::vector<MaterialEffectsOnTrack> &calomeots) const { - if (msgLvl(MSG::DEBUG)) { - msg(MSG::DEBUG) << "--> entering GlobalChi2Fitter::mainCombinationStrategy" << endmsg; - } + ATH_MSG_DEBUG( "--> entering GlobalChi2Fitter::mainCombinationStrategy"); bool firstismuon = false; double mass = m_particleMasses.mass[muon]; @@ -754,17 +719,20 @@ namespace Trk { PropDirection propdir = firstismuon ? Trk::alongMomentum : oppositeMomentum; const TrackParameters *tmppar = 0; - if (!m_msEntrance) { - m_trackingGeometry = m_trackingGeometrySvc->trackingGeometry(); - if (m_trackingGeometry) { - m_msEntrance = m_trackingGeometry->trackingVolume("MuonSpectrometerEntrance"); + + if (!cache.m_msEntrance) { + cache.m_trackingGeometry = m_trackingGeometrySvc->trackingGeometry(); + if (cache.m_trackingGeometry) { + cache.m_msEntrance = cache.m_trackingGeometry->trackingVolume("MuonSpectrometerEntrance"); } - if (!m_msEntrance) { - msg(MSG::ERROR) << "MS entrance not available" << endmsg; + if (!cache.m_msEntrance) { + ATH_MSG_ERROR( "MS entrance not available" ); } } - if (tp_closestmuon && m_msEntrance) { - tmppar = m_extrapolator->extrapolateToVolume(*tp_closestmuon, *m_msEntrance, propdir, nonInteracting); + + + if (tp_closestmuon && cache.m_msEntrance) { + tmppar = m_extrapolator->extrapolateToVolume(*tp_closestmuon, *cache.m_msEntrance, propdir, nonInteracting); } const std::vector<const TrackStateOnSurface *> *matvec = 0; if (tmppar) { @@ -799,26 +767,26 @@ namespace Trk { } if (matvec && !matvec->empty()) { - for (int i = 0; i < (int) m_matvec.size(); i++) { - delete m_matvec[i]; + for (int i = 0; i < (int) cache.m_matvec.size(); i++) { + delete cache.m_matvec[i]; } - m_matvec = *matvec; + cache.m_matvec = *matvec; delete matvec; - delete m_matvec.back(); - m_matvec.pop_back(); - for (int i = 0; i < (int) m_matvec.size(); i++) { + delete cache.m_matvec.back(); + cache.m_matvec.pop_back(); + for (int i = 0; i < (int) cache.m_matvec.size(); i++) { propdir = firstismuon ? Trk::alongMomentum : oppositeMomentum; const MaterialEffectsOnTrack *meff = - dynamic_cast<const MaterialEffectsOnTrack *>(m_matvec[i]->materialEffectsOnTrack()); + dynamic_cast<const MaterialEffectsOnTrack *>(cache.m_matvec[i]->materialEffectsOnTrack()); if (!meff) { continue; // avoid coverity defect } const Surface *matsurf = &meff->associatedSurface(); - tmppar = m_propagator->propagateParameters(*tp_closestmuon, *matsurf, propdir, false, *m_fieldprop, + tmppar = m_propagator->propagateParameters(*tp_closestmuon, *matsurf, propdir, false, *trajectory.m_fieldprop, Trk::nonInteracting); if (!tmppar) { propdir = !firstismuon ? Trk::alongMomentum : oppositeMomentum; - tmppar = m_propagator->propagateParameters(*tp_closestmuon, *matsurf, propdir, false, *m_fieldprop, + tmppar = m_propagator->propagateParameters(*tp_closestmuon, *matsurf, propdir, false, *trajectory.m_fieldprop, Trk::nonInteracting); } delete tp_closestmuon; @@ -840,7 +808,7 @@ namespace Trk { delete tmppar; } if (!firstismuon) { - std::reverse(m_matvec.begin(), m_matvec.end()); + std::reverse(cache.m_matvec.begin(), cache.m_matvec.end()); } }else { delete matvec; @@ -860,21 +828,21 @@ namespace Trk { if (firstismuon && dynamic_cast<const PseudoMeasurementOnTrack *>((*itStates)->measurementOnTrack())) { continue; } - bool tmpgetmat = m_getmaterialfromtrack; + bool tmpgetmat = cache.m_getmaterialfromtrack; if ((*itStates)->materialEffectsOnTrack()) { if (firstismuon) { - m_extmat = false; + cache.m_extmat = false; } else { - m_idmat = false; + cache.m_idmat = false; } const MaterialEffectsOnTrack *meot = dynamic_cast<const MaterialEffectsOnTrack *>((*itStates)->materialEffectsOnTrack()); if (meot && (!meot->scatteringAngles() || !meot->energyLoss())) { - m_getmaterialfromtrack = true; // always take calorimeter layers + cache.m_getmaterialfromtrack = true; // always take calorimeter layers } } - makeProtoState(trajectory, *itStates); - m_getmaterialfromtrack = tmpgetmat; + makeProtoState(cache, trajectory, *itStates); + cache.m_getmaterialfromtrack = tmpgetmat; } if (!firstismuon && intrk1.info().trackProperties(TrackInfo::SlimmedTrack)) { trajectory.trackStates().back()->setTrackParameters(0); @@ -909,14 +877,14 @@ namespace Trk { newqoverpid, 0); } // else newqoverpid=idscatpar->parameters()[Trk::qOverP]; - lastidpar = m_extrapolator->extrapolateToVolume(*firstidpar, *m_caloEntrance, alongMomentum, Trk::muon); + lastidpar = m_extrapolator->extrapolateToVolume(*firstidpar, *cache.m_caloEntrance, alongMomentum, Trk::muon); } if (!lastidpar) { lastidpar = origlastidpar; } firstscatpar = m_propagator->propagateParameters(*(firstismuon ? tp_closestmuon : lastidpar), - calomeots[0].associatedSurface(), Trk::alongMomentum, false, *m_fieldprop, + calomeots[0].associatedSurface(), Trk::alongMomentum, false, *trajectory.m_fieldprop, Trk::nonInteracting); if (lastidpar != origlastidpar) { delete lastidpar; @@ -930,7 +898,7 @@ namespace Trk { return 0; } lastscatpar = m_propagator->propagateParameters(*(firstismuon ? firstidpar : tp_closestmuon), - calomeots[2].associatedSurface(), Trk::oppositeMomentum, false, *m_fieldprop, + calomeots[2].associatedSurface(), Trk::oppositeMomentum, false, *trajectory.m_fieldprop, Trk::nonInteracting); if (!lastscatpar) { @@ -954,7 +922,7 @@ namespace Trk { muonscattheta = calosegment.theta() - muonscatpar->parameters()[Trk::theta]; // std::cout << "idscatpar: " << *idscatpar << " radius: " << idscatpar->position().perp() << " muonscatpar: " << // *muonscatpar << " radius: " << muonscatpar->position().perp() << std::endl; - const TrackParameters *startPar = m_idmat ? lastidpar : indettrack->perigeeParameters(); + const TrackParameters *startPar = cache.m_idmat ? lastidpar : indettrack->perigeeParameters(); if (m_fieldService->toroidOn()) { // double oldp=std::abs(1/lastscatpar->parameters()[Trk::qOverP]); @@ -979,11 +947,11 @@ namespace Trk { params1[4], 0); PropDirection propdir = !firstismuon ? oppositeMomentum : alongMomentum; tmpelosspar = m_propagator->propagateParameters(*tmppar1, - calomeots[1].associatedSurface(), propdir, false, *m_fieldprop, jac1, + calomeots[1].associatedSurface(), propdir, false, *trajectory.m_fieldprop, jac1, Trk::nonInteracting); if (m_numderiv) { delete jac1; - jac1 = numericalDerivatives(firstscatpar, &calomeots[1].associatedSurface(), propdir); + jac1 = numericalDerivatives(firstscatpar, &calomeots[1].associatedSurface(), propdir, trajectory.m_fieldprop); } delete tmppar1; @@ -1015,13 +983,14 @@ namespace Trk { } const TrackParameters *scat2 = m_propagator->propagateParameters(*elosspar2, !firstismuon ? calomeots[0].associatedSurface() : calomeots[ - 2].associatedSurface(), propdir, false, *m_fieldprop, jac2, + 2].associatedSurface(), propdir, false, *trajectory.m_fieldprop, jac2, Trk::nonInteracting); if (m_numderiv) { delete jac2; jac2 = numericalDerivatives(elosspar2, !firstismuon ? &calomeots[0].associatedSurface() : &calomeots[2].associatedSurface(), - !firstismuon ? Trk::oppositeMomentum : Trk::alongMomentum); + !firstismuon ? Trk::oppositeMomentum : Trk::alongMomentum, + trajectory.m_fieldprop); } delete elosspar2; if (!scat2 || !jac2) { @@ -1045,13 +1014,12 @@ namespace Trk { delete jac1; delete jac2; jac1 = jac2 = 0; - HepMatrix jac4(2, 2, 0); - jac4[0][0] = jac3[0][2]; - jac4[1][1] = jac3[1][3]; - jac4[0][1] = jac3[0][3]; - jac4[1][0] = jac3[1][2]; - int ierr = 0; - jac4.invert(ierr); + Amg::MatrixX jac4(2, 2); + jac4(0,0) = jac3[0][2]; + jac4(1,1) = jac3[1][3]; + jac4(0,1) = jac3[0][3]; + jac4(1,0) = jac3[1][2]; + jac4 = jac4.inverse(); double dloc1 = idscatpar->parameters()[Trk::loc1] - scat2->parameters()[Trk::loc1]; double dloc2 = idscatpar->parameters()[Trk::loc2] - scat2->parameters()[Trk::loc2]; const Trk::CylinderSurface *cylsurf = dynamic_cast<const Trk::CylinderSurface *>(&scat2->associatedSurface()); @@ -1076,8 +1044,8 @@ namespace Trk { } } } - double dphi = jac4[0][0] * dloc1 + jac4[0][1] * dloc2; - double dtheta = jac4[1][0] * dloc1 + jac4[1][1] * dloc2; + double dphi = jac4(0,0) * dloc1 + jac4(0,1) * dloc2; + double dtheta = jac4(1,0) * dloc1 + jac4(1,1) * dloc2; // std::cout << "i: " << i << " dphi: " << dphi << " dtheta: " << dtheta << " distance: " << // (idscatpar->position()-scat2->position()).mag() << " loc1: " << idscatpar->parameters()[Trk::loc1] << " " << // scat2->parameters()[Trk::loc1] << " " << dloc1 << " loc2: " << idscatpar->parameters()[Trk::loc2] << " " << @@ -1125,7 +1093,7 @@ namespace Trk { delete idscatpar; idscatpar = firstscatpar = tmpidpar; - startPar = m_extrapolator->extrapolateToVolume(*idscatpar, *m_caloEntrance, oppositeMomentum, + startPar = m_extrapolator->extrapolateToVolume(*idscatpar, *cache.m_caloEntrance, oppositeMomentum, Trk::nonInteracting); if (startPar) { Amg::Vector3D trackdir = startPar->momentum().unit(); @@ -1166,8 +1134,8 @@ namespace Trk { double pull2 = fabs(secondscatphi / secondscatmeff->sigmaDeltaPhi()); if (firstismuon) { - for (int i = 0; i < (int) m_matvec.size(); i++) { - makeProtoState(trajectory, m_matvec[i], -1, true); + for (int i = 0; i < (int) cache.m_matvec.size(); i++) { + makeProtoState(cache, trajectory, cache.m_matvec[i], -1, true); } } @@ -1193,8 +1161,8 @@ namespace Trk { trajectory.addMaterialState(new GXFTrackState(secondscatmeff, lastscatpar), -1, true); if (!firstismuon) { - for (int i = 0; i < (int) m_matvec.size(); i++) { - makeProtoState(trajectory, m_matvec[i], -1, true); + for (int i = 0; i < (int) cache.m_matvec.size(); i++) { + makeProtoState(cache, trajectory, cache.m_matvec[i], -1, true); } } @@ -1230,9 +1198,9 @@ namespace Trk { } return 0; } - m_extmat = false; + cache.m_extmat = false; }else { - m_idmat = false; + cache.m_idmat = false; } } @@ -1241,7 +1209,7 @@ namespace Trk { if (ispseudo && !(itStates2 == beginStates2 || itStates2 == beginStates2 + 1) && !largegap) { continue; } - makeProtoState(trajectory, *itStates2); + makeProtoState(cache, trajectory, *itStates2); if (itStates2 == endState2 - 1 && dynamic_cast<const AtaStraightLine *>(tpar) && tpar->position().perp() > 9000 && std::abs(tpar->position().z()) < 13000) { @@ -1275,7 +1243,7 @@ namespace Trk { else secondpseudostate=trajectory.trackStates().back(); }*/ } - Track *track = myfit(trajectory, *startPar, false, + Track *track = myfit( cache, trajectory, *startPar, false, (m_fieldService->toroidOn() || m_fieldService->solenoidOn()) ? muon : nonInteracting); if (startPar != lastidpar && startPar != indettrack->perigeeParameters()) { delete startPar; @@ -1284,13 +1252,13 @@ namespace Trk { } Track * - GlobalChi2Fitter::backupCombinationStrategy(const Track &intrk1, + GlobalChi2Fitter::backupCombinationStrategy(Cache& cache, + const Track &intrk1, const Track &intrk2, GXFTrajectory &trajectory, std::vector<MaterialEffectsOnTrack> &calomeots) const { - if (msgLvl(MSG::DEBUG)) { - msg(MSG::DEBUG) << "--> entering GlobalChi2Fitter::backupCombinationStrategy" << endmsg; - } + ATH_MSG_DEBUG( "--> entering GlobalChi2Fitter::backupCombinationStrategy" ); + // std::cout << "intrk1: " << intrk1 << " intrk2: " << intrk2 << std::endl; bool firstismuon = false; const Track *indettrack = &intrk1; @@ -1330,8 +1298,9 @@ namespace Trk { const TrackParameters *firstidpar = (*indettrack->trackParameters())[1]; - // const TrackParameters *lastidpar=indettrack->trackParameters()->back(); - const TrackParameters *lastidpar = m_extrapolator->extrapolateToVolume(*firstidpar, *m_caloEntrance, alongMomentum, + const TrackParameters *lastidpar = 0; + if(cache.m_caloEntrance) + lastidpar = m_extrapolator->extrapolateToVolume(*firstidpar, *cache.m_caloEntrance, alongMomentum, Trk::muon); if (!lastidpar) { lastidpar = indettrack->trackParameters()->back()->clone(); @@ -1346,14 +1315,14 @@ namespace Trk { if (!firstismuon) { firstscatpar.reset(m_propagator->propagateParameters(*lastidpar, calomeots[0].associatedSurface(), - Trk::alongMomentum, false, *m_fieldprop, + Trk::alongMomentum, false, *trajectory.m_fieldprop, Trk::nonInteracting)); delete lastidpar; if (!firstscatpar) { return 0; } std::unique_ptr<const TrackParameters> tmppar(m_propagator->propagateParameters(*firstscatpar, - calomeots[1].associatedSurface(), Trk::alongMomentum, false, *m_fieldprop, + calomeots[1].associatedSurface(), Trk::alongMomentum, false, *trajectory.m_fieldprop, Trk::nonInteracting)); if (!tmppar) { return 0; @@ -1375,20 +1344,20 @@ namespace Trk { elosspar.reset(tmppar->associatedSurface().createTrackParameters(pars[0], pars[1], pars[2], pars[3], newqoverp, 0)); lastscatpar.reset(m_propagator->propagateParameters(*elosspar, calomeots[2].associatedSurface(), - Trk::alongMomentum, false, *m_fieldprop, + Trk::alongMomentum, false, *trajectory.m_fieldprop, Trk::nonInteracting)); if (!lastscatpar) { return 0; } }else { lastscatpar.reset(m_propagator->propagateParameters(*firstidpar, calomeots[2].associatedSurface(), - Trk::oppositeMomentum, false, *m_fieldprop, + Trk::oppositeMomentum, false, *trajectory.m_fieldprop, Trk::nonInteracting)); if (!lastscatpar) { return 0; } elosspar.reset(m_propagator->propagateParameters(*lastscatpar, calomeots[1].associatedSurface(), - Trk::oppositeMomentum, false, *m_fieldprop, + Trk::oppositeMomentum, false, *trajectory.m_fieldprop, Trk::nonInteracting)); if (!elosspar) { return 0; @@ -1407,7 +1376,7 @@ namespace Trk { pars[3], newqoverp, 0)); firstscatpar.reset(m_propagator->propagateParameters(*tmppar, calomeots[0].associatedSurface(), - Trk::oppositeMomentum, false, *m_fieldprop, + Trk::oppositeMomentum, false, *trajectory.m_fieldprop, Trk::nonInteracting)); if (!firstscatpar) { return 0; @@ -1421,13 +1390,13 @@ namespace Trk { if ((*itStates)->materialEffectsOnTrack()) { if (!firstismuon) { - m_idmat = false; + cache.m_idmat = false; } else { continue; } } if (firstismuon) { - makeProtoState(trajectory, *itStates); + makeProtoState(cache, trajectory, *itStates); } } @@ -1577,7 +1546,7 @@ namespace Trk { const TrackParameters *par2 = ((*itStates2)->trackParameters() && nphi > 99) ? (*itStates2)->trackParameters()->clone() : m_propagator->propagateParameters( - *secondscatstate->trackParameters(), *slsurf, alongMomentum, false, *m_fieldprop, Trk::nonInteracting); + *secondscatstate->trackParameters(), *slsurf, alongMomentum, false, *trajectory.m_fieldprop, Trk::nonInteracting); if (!par2) { continue; } @@ -1602,7 +1571,7 @@ namespace Trk { } if ((**itStates2).materialEffectsOnTrack()) { if (firstismuon) { - m_idmat = false; + cache.m_idmat = false; } else { continue; } @@ -1649,7 +1618,7 @@ namespace Trk { trajectory.addMeasurementState(pseudostate2); outlierstates2.push_back(pseudostate2); } - makeProtoState(trajectory, *itStates2); + makeProtoState(cache, trajectory, *itStates2); if ((trajectory.trackStates().back()->measurementType() == TrackState::TGC || (trajectory.trackStates().back()->measurementType() == TrackState::RPC && @@ -1667,13 +1636,13 @@ namespace Trk { trajectory.setPrefit(2); const TrackParameters *startpar2 = &startper;// trajectory.referenceParameters(); - m_matfilled = true; - bool tmpacc = m_acceleration; - m_acceleration = false; - myfit(trajectory, *startpar2, false, muon); - m_acceleration = tmpacc; + cache.m_matfilled = true; + bool tmpacc = cache.m_acceleration; + cache.m_acceleration = false; + myfit(cache,trajectory, *startpar2, false, muon); + cache.m_acceleration = tmpacc; - m_matfilled = false; + cache.m_matfilled = false; if (!firstismuon && /*m_fieldService->toroidOn() && */ trajectory.converged() && std::abs(trajectory.residuals().back() / trajectory.errors().back()) > 10) { return 0; @@ -1710,24 +1679,100 @@ namespace Trk { if (dynamic_cast<const PseudoMeasurementOnTrack *>((*itStates)->measurementOnTrack())) { continue; } - makeProtoState(trajectory, *itStates, (firstismuon ? -1 : 0)); + makeProtoState(cache, trajectory, *itStates, (firstismuon ? -1 : 0)); } trajectory.reset(); trajectory.setPrefit(0); trajectory.setNumberOfPerigeeParameters(5); - track = myfit(trajectory, *firstidpar, false, muon); - m_matfilled = false; + track = myfit(cache, trajectory, *firstidpar, false, muon); + cache.m_matfilled = false; } return track; } + Track * GlobalChi2Fitter::fit(const Track &inputTrack, const RunOutlierRemoval runOutlier, const ParticleHypothesis matEffects) const { - if (msgLvl(MSG::DEBUG)) { - msg(MSG::DEBUG) << "--> entering GlobalChi2Fitter::fit(Track,,)" << endmsg; + + + Cache cache; + cache.m_calomat = m_calomat; + cache.m_extmat = m_extmat; + cache.m_sirecal = m_sirecal; + cache.m_getmaterialfromtrack = m_getmaterialfromtrack; + cache.m_reintoutl = m_reintoutl; + cache.m_acceleration = m_acceleration; + cache.m_miniter = m_miniter; + cache.m_fiteloss = m_fiteloss; + cache.m_asymeloss = m_asymeloss; + + GXFTrajectory trajectory; + if (!m_straightlineprop) { + trajectory.m_straightline = (!m_fieldService->solenoidOn() && !m_fieldService->toroidOn()); } + trajectory.m_fieldprop = trajectory.m_straightline ? m_fieldpropnofield : m_fieldpropfullfield; + + + return fitIm( cache, inputTrack, runOutlier, matEffects ); + + } + + Track * + GlobalChi2Fitter::alignmentFit(AlignmentCache& alignCache, + const Track &inputTrack, + const RunOutlierRemoval runOutlier, + const ParticleHypothesis matEffects) const { + + + Cache cache; + cache.m_calomat = m_calomat; + cache.m_extmat = m_extmat; + cache.m_sirecal = m_sirecal; + cache.m_getmaterialfromtrack = m_getmaterialfromtrack; + cache.m_reintoutl = m_reintoutl; + cache.m_acceleration = m_acceleration; + cache.m_miniter = alignCache.m_minIterations; + cache.m_fiteloss = m_fiteloss; + cache.m_asymeloss = m_asymeloss; + + if(alignCache.m_derivMatrix != nullptr) + delete alignCache.m_derivMatrix; + alignCache.m_derivMatrix = nullptr; + + if(alignCache.m_fullCovarianceMatrix != nullptr) + delete alignCache.m_fullCovarianceMatrix; + alignCache.m_fullCovarianceMatrix = nullptr; + alignCache.m_iterationsOfLastFit = 0; + + Trk::Track* newTrack = fitIm( cache, inputTrack, runOutlier, matEffects ); + if(newTrack){ + if(cache.m_derivmat) + alignCache.m_derivMatrix = new Amg::MatrixX(*cache.m_derivmat); + if(cache.m_fullcovmat) + alignCache.m_fullCovarianceMatrix = new Amg::MatrixX(*cache.m_fullcovmat); + alignCache.m_iterationsOfLastFit = cache.m_lastiter; + } + + return newTrack; + } + + Track * + GlobalChi2Fitter::fitIm(Cache& cache, + const Track &inputTrack, + const RunOutlierRemoval runOutlier, + const ParticleHypothesis matEffects) const { + + ATH_MSG_DEBUG("--> entering GlobalChi2Fitter::fit(Track,,)"); + + GXFTrajectory trajectory; + if (!m_straightlineprop) { + trajectory.m_straightline = (!m_fieldService->solenoidOn() && !m_fieldService->toroidOn()); + } + trajectory.m_fieldprop = trajectory.m_straightline ? m_fieldpropnofield : m_fieldpropfullfield; + + #ifdef GXFDEBUGCODE if (m_truth) { retrieveTruth(); @@ -1746,13 +1791,13 @@ namespace Trk { minpar = *(inputTrack.trackParameters()->begin()); } bool deleteminpar = false; - bool tmpgetmat = m_getmaterialfromtrack; + bool tmpgetmat = cache.m_getmaterialfromtrack; if (matEffects == Trk::nonInteracting || inputTrack.info().trackFitter() == TrackInfo::Unknown) { - m_getmaterialfromtrack = false; + cache.m_getmaterialfromtrack = false; } DataVector<const TrackStateOnSurface>::const_iterator itStates = inputTrack.trackStateOnSurfaces()->begin(); DataVector<const TrackStateOnSurface>::const_iterator endState = inputTrack.trackStateOnSurfaces()->end(); - GXFTrajectory trajectory; + trajectory.trackStates().reserve(inputTrack.trackStateOnSurfaces()->size()); // const RIO_OnTrack *firstrot=0,*lastrot=0; const Surface *firsthitsurf = 0, *lasthitsurf = 0; @@ -1828,17 +1873,17 @@ namespace Trk { } } } - makeProtoState(trajectory, *itStates); + makeProtoState(cache, trajectory, *itStates); } - if (m_getmaterialfromtrack && trajectory.numberOfScatterers() != 0 && (hasmuon || m_acceleration)) { - m_matfilled = true; + if (cache.m_getmaterialfromtrack && trajectory.numberOfScatterers() != 0 && (hasmuon || cache.m_acceleration)) { + cache.m_matfilled = true; } if (firstidpar == lastidpar) { firstidpar = lastidpar = 0; } - if (iscombined && !m_matfilled && + if (iscombined && !cache.m_matfilled && m_DetID->is_indet(firsthitsurf->associatedDetectorElementIdentifier()) != m_DetID->is_indet(lasthitsurf->associatedDetectorElementIdentifier()) && firstidpar) { if (m_DetID->is_indet(firsthitsurf->associatedDetectorElementIdentifier())) { @@ -1847,25 +1892,25 @@ namespace Trk { minpar = firstidpar; } } - bool tmpacc = m_acceleration; + bool tmpacc = cache.m_acceleration; bool tmpfiteloss = m_fiteloss; - bool tmpsirecal = m_sirecal; + bool tmpsirecal = cache.m_sirecal; Track *tmptrack = 0; if (matEffects == Trk::proton || matEffects == Trk::kaon || matEffects == Trk::electron) { ATH_MSG_DEBUG("call myfit(GXFTrajectory,TP,,)"); - m_fiteloss = true; - m_sirecal = false; + cache.m_fiteloss = true; + cache.m_sirecal = false; if (matEffects == Trk::electron) { - m_asymeloss = true; + cache.m_asymeloss = true; } - tmptrack = myfit(trajectory, *minpar, false, matEffects); - m_sirecal = tmpsirecal; + tmptrack = myfit(cache, trajectory, *minpar, false, matEffects); + cache.m_sirecal = tmpsirecal; if (!tmptrack) { - m_matfilled = false; - m_getmaterialfromtrack = tmpgetmat; - m_acceleration = tmpacc; - m_fiteloss = tmpfiteloss; - cleanup(); + cache.m_matfilled = false; + cache.m_getmaterialfromtrack = tmpgetmat; + cache.m_acceleration = tmpacc; + cache.m_fiteloss = tmpfiteloss; + cache.cleanup(); return 0; } int nscats = 0; @@ -1933,7 +1978,7 @@ namespace Trk { refpars[4], 0); deleteminpar = true; trajectory.reset(); - m_matfilled = true; + cache.m_matfilled = true; if (matEffects == Trk::electron) { if (!isbrem) { trajectory.brems().clear(); @@ -1941,14 +1986,14 @@ namespace Trk { trajectory.brems().resize(1); trajectory.brems()[0] = bremdp; } - m_asymeloss = false; + cache.m_asymeloss = false; trajectory.setNumberOfScatterers(nscats); trajectory.setNumberOfBrems((isbrem ? 1 : 0)); } } ATH_MSG_DEBUG("call myfit(GXFTrajectory,TP,,)"); - Track *track = myfit(trajectory, *minpar, runOutlier, matEffects); + Track *track = myfit(cache, trajectory, *minpar, runOutlier, matEffects); if (deleteminpar) { delete minpar; } @@ -1983,18 +2028,18 @@ namespace Trk { if (pseudoupdated) { Track *oldtrack = track; trajectory.setConverged(false); - m_matfilled = true; - track = myfit(trajectory, *oldtrack->perigeeParameters(), false, muon); - m_matfilled = false; + cache.m_matfilled = true; + track = myfit(cache, trajectory, *oldtrack->perigeeParameters(), false, muon); + cache.m_matfilled = false; delete oldtrack; } } - m_matfilled = false; - m_getmaterialfromtrack = tmpgetmat; - m_acceleration = tmpacc; - m_fiteloss = tmpfiteloss; + cache.m_matfilled = false; + cache.m_getmaterialfromtrack = tmpgetmat; + cache.m_acceleration = tmpacc; + cache.m_fiteloss = tmpfiteloss; // if (track) std::cout << "track: " << *track << std::endl; if (track) { @@ -2005,7 +2050,6 @@ namespace Trk { if (tmptrack) { delete tmptrack; } - cleanup(); return track; } @@ -2014,6 +2058,7 @@ namespace Trk { const TrackParameters ¶m, const RunOutlierRemoval runOutlier, const ParticleHypothesis matEffects) const { + MeasurementSet rots; // const TrackParameters *prevparam=param.cloneWithoutError(); @@ -2082,9 +2127,26 @@ namespace Trk { const MeasurementSet &addMeasColl, const RunOutlierRemoval runOutlier, const ParticleHypothesis matEffects) const { - if (msgLvl(MSG::DEBUG)) { - msg(MSG::DEBUG) << "--> entering GlobalChi2Fitter::fit(Track,Meas'BaseSet,,)" << endmsg; + ATH_MSG_DEBUG( "--> entering GlobalChi2Fitter::fit(Track,Meas'BaseSet,,)" ); + + Cache cache; + cache.m_calomat = m_calomat; + cache.m_extmat = m_extmat; + cache.m_sirecal = m_sirecal; + cache.m_getmaterialfromtrack = m_getmaterialfromtrack; + cache.m_reintoutl = m_reintoutl; + cache.m_acceleration = m_acceleration; + cache.m_miniter = m_miniter; + cache.m_fiteloss = m_fiteloss; + cache.m_asymeloss = m_asymeloss; + + GXFTrajectory trajectory; + if (!m_straightlineprop) { + trajectory.m_straightline = (!m_fieldService->solenoidOn() && !m_fieldService->toroidOn()); } + trajectory.m_fieldprop = trajectory.m_straightline ? m_fieldpropnofield : m_fieldpropfullfield; + + #ifdef GXFDEBUGCODE if (m_truth) { retrieveTruth(); @@ -2102,19 +2164,18 @@ namespace Trk { ATH_MSG_VERBOSE("add MeasurementBase objects from Track to new set"); DataVector<const TrackStateOnSurface>::const_iterator itStates = inputTrack.trackStateOnSurfaces()->begin(); DataVector<const TrackStateOnSurface>::const_iterator endState = inputTrack.trackStateOnSurfaces()->end(); - GXFTrajectory trajectory; - bool old_reintoutl = m_reintoutl; - m_reintoutl = false; - bool tmpasymeloss = m_asymeloss; + bool old_reintoutl = cache.m_reintoutl; + cache.m_reintoutl = false; + bool tmpasymeloss = cache.m_asymeloss; if (matEffects == electron) { - m_asymeloss = true; + cache.m_asymeloss = true; } // bool seenfirsthit=false; for (; itStates != endState; ++itStates) { // if ((**itStates).measurementOnTrack()) seenfirsthit=true; // if (!m_acceleration || seenfirsthit) - makeProtoState(trajectory, *itStates); + makeProtoState(cache, trajectory, *itStates); // else if ((**itStates).type(TrackStateOnSurface::Scatterer)) { // std::cout << "lay: " << (**itStates).surface().associatedLayer() << std::endl; // trajectory.upstreamMaterialLayers().push_back(std::make_pair((**itStates).surface().associatedLayer(),0)); @@ -2125,7 +2186,7 @@ namespace Trk { trajectory.trackStates().back()->materialEffects()->setKink(true); } } - m_reintoutl = old_reintoutl; + cache.m_reintoutl = old_reintoutl; // add MBs from input list MeasurementSet::const_iterator itSet = addMeasColl.begin(); MeasurementSet::const_iterator itSetEnd = addMeasColl.end(); @@ -2134,14 +2195,14 @@ namespace Trk { if (!(*itSet)) { msg(MSG::WARNING) << "There is an empty MeasurementBase object in the track! Skip this object.." << endmsg; }else { - makeProtoStateFromMeasurement(trajectory, *itSet); + makeProtoStateFromMeasurement(cache, trajectory, *itSet); } } // fit set of MeasurementBase using main method, start with first TrkParameter in inputTrack ATH_MSG_VERBOSE("call myfit(GXFTrajectory,TP,,)"); - Track *track = myfit(trajectory, *minpar, runOutlier, matEffects); - m_asymeloss = tmpasymeloss; + Track *track = myfit(cache, trajectory, *minpar, runOutlier, matEffects); + cache.m_asymeloss = tmpasymeloss; if (track) { double oldqual = (inputTrack.fitQuality()->numberDoF() != @@ -2162,7 +2223,6 @@ namespace Trk { if (track) { m_nsuccessfits++; } - cleanup(); return track; } @@ -2173,6 +2233,7 @@ namespace Trk { const PrepRawDataSet &prds, const RunOutlierRemoval runOutlier, const ParticleHypothesis matEffects) const { + MeasurementSet rots; // const TrackParameters *prevparam=intrk.trackParameters()->back()->cloneWithoutError(); const TrackParameters *hitparam = intrk.trackParameters()->back(); @@ -2226,9 +2287,26 @@ namespace Trk { const TrackParameters ¶m, const RunOutlierRemoval runOutlier, const ParticleHypothesis matEffects) const { - if (msgLvl(MSG::DEBUG)) { - msg(MSG::DEBUG) << "--> entering GlobalChi2Fitter::fit(Meas'BaseSet,,)" << endmsg; + + ATH_MSG_DEBUG( "--> entering GlobalChi2Fitter::fit(Meas'BaseSet,,)" ); + + Cache cache; + cache.m_calomat = m_calomat; + cache.m_extmat = m_extmat; + cache.m_sirecal = m_sirecal; + cache.m_getmaterialfromtrack = m_getmaterialfromtrack; + cache.m_reintoutl = m_reintoutl; + cache.m_acceleration = m_acceleration; + cache.m_miniter = m_miniter; + cache.m_fiteloss = m_fiteloss; + cache.m_asymeloss = m_asymeloss; + + GXFTrajectory trajectory; + if (!m_straightlineprop) { + trajectory.m_straightline = (!m_fieldService->solenoidOn() && !m_fieldService->toroidOn()); } + trajectory.m_fieldprop = trajectory.m_straightline ? m_fieldpropnofield : m_fieldpropfullfield; + #ifdef GXFDEBUGCODE if (m_truth) { @@ -2238,22 +2316,21 @@ namespace Trk { MeasurementSet::const_iterator itSet = rots.begin(); MeasurementSet::const_iterator itSetEnd = rots.end(); - GXFTrajectory trajectory; - if (m_MMCorrectionStatus==0) { + if (cache.m_MMCorrectionStatus==0) { for (itSet = rots.begin(); itSet != itSetEnd; ++itSet) { if ((*itSet)) { - if((*itSet)->associatedSurface().associatedDetectorElementIdentifier().is_valid()) { - if (m_DetID->is_mm((*itSet)->associatedSurface().associatedDetectorElementIdentifier())) { - m_MMCorrectionStatus = 1; - break; + if((*itSet)->associatedSurface().associatedDetectorElementIdentifier().is_valid()) { + if (m_DetID->is_mm((*itSet)->associatedSurface().associatedDetectorElementIdentifier())) { + cache.m_MMCorrectionStatus = 1; + break; } - } + } } } } - if (m_MMCorrectionStatus==1) { + if (cache.m_MMCorrectionStatus==1) { itSet = rots.begin(); MeasurementSet rots_new; MeasurementSet rots_tbd; @@ -2273,9 +2350,9 @@ namespace Trk { } } } - m_MMCorrectionStatus = -1; + cache.m_MMCorrectionStatus = -1; Track *track = fit(rots_new, param, runOutlier, matEffects); - m_MMCorrectionStatus = 0; + cache.m_MMCorrectionStatus = 0; for (MeasurementSet::const_iterator it = rots_tbd.begin(); it != rots_tbd.end(); it++) { delete *it; } @@ -2286,16 +2363,16 @@ namespace Trk { if (!(*itSet)) { msg(MSG::WARNING) << "There is an empty MeasurementBase object in the track! Skip this object.." << endmsg; }else { - makeProtoStateFromMeasurement(trajectory, *itSet); + makeProtoStateFromMeasurement(cache, trajectory, *itSet); } } const TrackParameters *startpar = ¶m; bool deletestartpar = false; if (matEffects == muon && trajectory.numberOfSiliconHits() + trajectory.numberOfTRTHits() == 0) { - m_matfilled = true; // don't collect material for prefit + cache.m_matfilled = true; // don't collect material for prefit trajectory.setPrefit(2); - myfit(trajectory, *startpar, runOutlier, matEffects); - m_matfilled = false; + myfit(cache, trajectory, *startpar, runOutlier, matEffects); + cache.m_matfilled = false; if (!trajectory.converged()) { return 0; } @@ -2322,7 +2399,7 @@ namespace Trk { covMatrix, lastpar->associatedSurface()); trajectory.trackStates().back()->setMeasurement(newpseudo); } - if (!m_straightline) { + if (!trajectory.m_straightline) { trajectory.setPrefit(3); const AmgVector(5) &refpars = trajectory.referenceParameters()->parameters(); startpar = trajectory.referenceParameters()->associatedSurface().createTrackParameters(refpars[0], refpars[1], @@ -2330,11 +2407,10 @@ namespace Trk { refpars[4], 0); trajectory.reset(); - myfit(trajectory, *startpar, runOutlier, matEffects); - m_matfilled = true; + myfit(cache, trajectory, *startpar, runOutlier, matEffects); + cache.m_matfilled = true; delete startpar; if (!trajectory.converged()) { - cleanup(); return 0; } } @@ -2380,7 +2456,7 @@ namespace Trk { } Track *track = 0; if (startpar) { - track = myfit(trajectory, *startpar, runOutlier, matEffects); + track = myfit(cache, trajectory, *startpar, runOutlier, matEffects); } if (deletestartpar) { delete startpar; @@ -2388,18 +2464,18 @@ namespace Trk { if (track) { m_nsuccessfits++; } - m_matfilled = false; - cleanup(); + cache.m_matfilled = false; return track; } void - GlobalChi2Fitter::makeProtoState(GXFTrajectory &trajectory, const TrackStateOnSurface *tsos, int index, + GlobalChi2Fitter::makeProtoState(Cache& cache, + GXFTrajectory &trajectory, const TrackStateOnSurface *tsos, int index, bool copytp) const { if ((tsos->type(TrackStateOnSurface::Scatterer) || tsos->type(TrackStateOnSurface::BremPoint) || tsos->type(TrackStateOnSurface::CaloDeposit) || - tsos->type(TrackStateOnSurface::InertMaterial)) && m_getmaterialfromtrack) { - if (m_acceleration && trajectory.numberOfHits() == 0) { + tsos->type(TrackStateOnSurface::InertMaterial)) && cache.m_getmaterialfromtrack) { + if (cache.m_acceleration && trajectory.numberOfHits() == 0) { return; } const MaterialEffectsOnTrack *meff = dynamic_cast<const MaterialEffectsOnTrack *>(tsos->materialEffectsOnTrack()); @@ -2444,17 +2520,17 @@ namespace Trk { } if (tsos->type(TrackStateOnSurface::Measurement) || tsos->type(TrackStateOnSurface::Outlier)) { bool isoutlier = false; - if (tsos->type(TrackStateOnSurface::Outlier) && !m_reintoutl) { + if (tsos->type(TrackStateOnSurface::Outlier) && !cache.m_reintoutl) { isoutlier = true; } - makeProtoStateFromMeasurement(trajectory, tsos->measurementOnTrack(), tsos->trackParameters(), isoutlier, index); + makeProtoStateFromMeasurement(cache, trajectory, tsos->measurementOnTrack(), tsos->trackParameters(), isoutlier, index); // if (trajectory.prefit() && (ptsos[0]->measurementType()==TrackState::RPC || // ptsos[0]->measurementType()==TrackState::TGC)) isoutlier=true; } } void - GlobalChi2Fitter::makeProtoStateFromMeasurement(GXFTrajectory &trajectory, const MeasurementBase *measbase, + GlobalChi2Fitter::makeProtoStateFromMeasurement(Cache& cache, GXFTrajectory &trajectory, const MeasurementBase *measbase, const TrackParameters *trackpar, bool isoutlier, int index) const { const Segment *seg = 0; @@ -2605,7 +2681,7 @@ namespace Trk { } } if (msgLvl(MSG::DEBUG)) { - msg(MSG::DEBUG) << "#" << m_hitcount << " " << string1 << string2 << " pos=(" << + msg(MSG::DEBUG) << "#" << cache.m_hitcount << " " << string1 << string2 << " pos=(" << measbase2->globalPosition().x() << "," << measbase2->globalPosition().y() << "," << measbase2->globalPosition().z() << ") "; // print out the hit type if (measphi) { @@ -2680,7 +2756,7 @@ namespace Trk { ptsos->setSinStereo(sinstereo); ptsos->setMeasurementType(hittype); ptsos->setMeasuresPhi(measphi); - if (isoutlier && !m_reintoutl) { + if (isoutlier && !cache.m_reintoutl) { ptsos->setTrackStateType(TrackState::GeneralOutlier); } // @TODO here index really is supposed to refer to the method argument index ? @@ -2692,12 +2768,12 @@ namespace Trk { delete ptsos; msg(MSG::WARNING) << "Measurement error is zero or negative, drop hit" << endmsg; } - m_hitcount++; + cache.m_hitcount++; } } bool - GlobalChi2Fitter::processTrkVolume(const Trk::TrackingVolume *tvol) const { + GlobalChi2Fitter::processTrkVolume(Cache& cache, const Trk::TrackingVolume *tvol) const { if (!tvol) { return false; } @@ -2723,12 +2799,12 @@ namespace Trk { const DiscLayer *disclay = dynamic_cast<const DiscLayer *>((*layerIter)); if (disclay) { if (disclay->center().z() < 0) { - m_negdiscs.push_back(disclay); + cache.m_negdiscs.push_back(disclay); } else { - m_posdiscs.push_back(disclay); + cache.m_posdiscs.push_back(disclay); } }else if (cyllay) { - m_barrelcylinders.push_back(cyllay); + cache.m_barrelcylinders.push_back(cyllay); }else { return false; } @@ -2760,15 +2836,15 @@ namespace Trk { if (discsurf) { if (discsurf->center().z() < 0 && - std::find(m_negdiscs.begin(), m_negdiscs.end(), layer) == m_negdiscs.end()) { - m_negdiscs.push_back(layer); + std::find(cache.m_negdiscs.begin(), cache.m_negdiscs.end(), layer) == cache.m_negdiscs.end()) { + cache.m_negdiscs.push_back(layer); } else if (discsurf->center().z() > 0 && - std::find(m_posdiscs.begin(), m_posdiscs.end(), layer) == m_posdiscs.end()) { - m_posdiscs.push_back(layer); + std::find(cache.m_posdiscs.begin(), cache.m_posdiscs.end(), layer) == cache.m_posdiscs.end()) { + cache.m_posdiscs.push_back(layer); } }else if (cylsurf && - std::find(m_barrelcylinders.begin(), m_barrelcylinders.end(), layer) == m_barrelcylinders.end()) { - m_barrelcylinders.push_back(layer); + std::find(cache.m_barrelcylinders.begin(), cache.m_barrelcylinders.end(), layer) == cache.m_barrelcylinders.end()) { + cache.m_barrelcylinders.push_back(layer); } if (!cylsurf && !discsurf) { return false; @@ -2784,7 +2860,7 @@ namespace Trk { std::vector<const Trk::TrackingVolume *>::const_iterator volIterEnd = volumes.end(); for (; volIter != volIterEnd; ++volIter) { if (*volIter) { - bool ok = processTrkVolume(*volIter); + bool ok = processTrkVolume(cache, *volIter); if (!ok) { return false; } @@ -2891,33 +2967,37 @@ public: }; void - GlobalChi2Fitter::addIDMaterialFast(GXFTrajectory &trajectory, const TrackParameters *refpar2, + GlobalChi2Fitter::addIDMaterialFast(Cache& cache, + GXFTrajectory &trajectory, const TrackParameters *refpar2, ParticleHypothesis matEffects) const { - if (!m_caloEntrance) { - m_trackingGeometry = m_trackingGeometrySvc->trackingGeometry(); - // if (m_trackingGeometry) m_caloEntrance = m_trackingGeometry->trackingVolume("InDet::Containers::EntryVolume"); - if (m_trackingGeometry) { - m_caloEntrance = m_trackingGeometry->trackingVolume("InDet::Containers::InnerDetector"); - } - if (!m_caloEntrance) { - msg(MSG::ERROR) << "calo entrance not available" << endmsg; + + if(!cache.m_caloEntrance){ + cache.m_trackingGeometry = m_trackingGeometrySvc->trackingGeometry(); + if (cache.m_trackingGeometry) { + cache.m_caloEntrance = cache.m_trackingGeometry->trackingVolume("InDet::Containers::InnerDetector"); + } else { + ATH_MSG_ERROR( "Tracking Geometry not available" ); + } + if (!cache.m_caloEntrance) { + ATH_MSG_ERROR( "calo entrance not available" ); return; } } - if (m_negdiscs.empty() && m_posdiscs.empty() && m_barrelcylinders.empty()) { - bool ok = processTrkVolume(m_caloEntrance); + + + + + if (cache.m_negdiscs.empty() && cache.m_posdiscs.empty() && cache.m_barrelcylinders.empty()) { + bool ok = processTrkVolume(cache, cache.m_caloEntrance); if (!ok) { ATH_MSG_DEBUG("Falling back to slow material collection"); - m_fastmat = false; - addMaterial(trajectory, refpar2, matEffects); + cache.m_fastmat = false; + addMaterial(cache, trajectory, refpar2, matEffects); return; } - std::stable_sort(m_negdiscs.begin(), m_negdiscs.end(), GXFlayersort2()); - std::stable_sort(m_posdiscs.begin(), m_posdiscs.end(), GXFlayersort2()); - // std::reverse(m_negdiscs.begin(),m_negdiscs.end()); - std::stable_sort(m_barrelcylinders.begin(), m_barrelcylinders.end(), GXFlayersort2()); - // std::cout << "nbarrelcyl: " << m_barrelcylinders.size() << " nposdisc: " << m_posdiscs.size() << " nnegdisc: " - // << m_negdiscs.size() << std::endl; + std::stable_sort(cache.m_negdiscs.begin(), cache.m_negdiscs.end(), GXFlayersort2()); + std::stable_sort(cache.m_posdiscs.begin(), cache.m_posdiscs.end(), GXFlayersort2()); + std::stable_sort(cache.m_barrelcylinders.begin(), cache.m_barrelcylinders.end(), GXFlayersort2()); } const TrackParameters *refpar = refpar2, *firstsipar = 0, *lastsipar = 0; bool hasmat = false; @@ -2935,7 +3015,7 @@ public: if (!firstsipar) { if (!oldstates[i]->trackParameters()) { const TrackParameters *tmppar = m_propagator->propagateParameters(*refpar, - *oldstates[i]->surface(), alongMomentum, false, *m_fieldprop, + *oldstates[i]->surface(), alongMomentum, false, *trajectory.m_fieldprop, Trk::nonInteracting); if (!tmppar) { return; @@ -2953,7 +3033,7 @@ public: } if (!lastsistate->trackParameters()) { const TrackParameters *tmppar = m_propagator->propagateParameters(*refpar, - *lastsistate->surface(), alongMomentum, false, *m_fieldprop, + *lastsistate->surface(), alongMomentum, false, *trajectory.m_fieldprop, Trk::nonInteracting); if (!tmppar) { return; @@ -2992,11 +3072,11 @@ public: if (slope != 0) { std::vector<const Layer *>::const_iterator it, itend; if (lastz > 0) { - it = m_posdiscs.begin(); - itend = m_posdiscs.end(); + it = cache.m_posdiscs.begin(); + itend = cache.m_posdiscs.end(); }else { - it = m_negdiscs.begin(); - itend = m_negdiscs.end(); + it = cache.m_negdiscs.begin(); + itend = cache.m_negdiscs.end(); } for (; it != itend; it++) { if (fabs((*it)->surfaceRepresentation().center().z()) > fabs(lastz)) { @@ -3024,7 +3104,7 @@ public: // std::cout << "r: " << rintersect << " z: " << (*it)->center().z() << " surf: " << (**it) << std::endl; } } - for (std::vector<const Layer *>::const_iterator it = m_barrelcylinders.begin(); it != m_barrelcylinders.end(); + for (std::vector<const Layer *>::const_iterator it = cache.m_barrelcylinders.begin(); it != cache.m_barrelcylinders.end(); it++) { if ((*it)->surfaceRepresentation().bounds().r() > lastr) { break; @@ -3246,7 +3326,7 @@ public: meff->setSurface(&layer->surfaceRepresentation()); meff->setMaterialProperties(matprop); EnergyLoss *eloss = 0; - if (m_fiteloss || (matEffects == electron && m_asymeloss)) { + if (cache.m_fiteloss || (matEffects == electron && cache.m_asymeloss)) { eloss = m_elosstool->energyLoss(*matprop, (m_p ? fabs(m_p) : fabs( 1. / currentqoverp)), 1. / costracksurf, alongMomentum, matEffects); @@ -3254,7 +3334,7 @@ public: meff->setSigmaDeltaE(eloss->sigmaDeltaE()); } } - if (matEffects == electron && m_asymeloss) { + if (matEffects == electron && cache.m_asymeloss) { meff->setDeltaE(-5); if (!trajectory.numberOfTRTHits()) { meff->setScatteringSigmas(0, 0); @@ -3291,7 +3371,8 @@ public: } void - GlobalChi2Fitter::addMaterial(GXFTrajectory &trajectory, const TrackParameters *refpar2, + GlobalChi2Fitter::addMaterial(Cache &cache, + GXFTrajectory &trajectory, const TrackParameters *refpar2, ParticleHypothesis matEffects) const { if (!refpar2) { return; @@ -3335,7 +3416,7 @@ public: if (tstype == TrackState::Fittable || tstype == TrackState::GeneralOutlier) { if (!firsthit) { firsthit = states[i]->measurement(); - if (m_acceleration) { + if (cache.m_acceleration) { if (!tp) { tp = m_extrapolator->extrapolate(*refpar2, *states[i]->surface(), alongMomentum, false, matEffects); if (!tp) { @@ -3398,7 +3479,7 @@ public: } const TrackParameters *refpar = 0; AmgVector(5) newpars = refpar2->parameters(); - if (m_straightline && m_p != 0) { + if (trajectory.m_straightline && m_p != 0) { newpars[Trk::qOverP] = 1 / m_p; } refpar = @@ -3411,7 +3492,7 @@ public: } if (!startmatpar1 || (firstidhit && firstmuonhit)) { startmatpar1 = startmatpar2 = refpar; - } else if (m_straightline && m_p != 0) { + } else if (trajectory.m_straightline && m_p != 0) { AmgVector(5) newpars = startmatpar1->parameters(); newpars[Trk::qOverP] = 1 / m_p; startmatpar1 = startmatpar1->associatedSurface().createTrackParameters(newpars[0], newpars[1], newpars[2], @@ -3437,7 +3518,7 @@ public: dodelete = true; } - if (firstidhit && trajectory.numberOfSiliconHits() > 0 && m_idmat) { + if (firstidhit && trajectory.numberOfSiliconHits() > 0 && cache.m_idmat) { DistanceSolution distsol = firstidhit->associatedSurface().straightLineDistanceEstimate( refpar->position(), refpar->momentum().unit()); double distance = 0; @@ -3447,33 +3528,34 @@ public: distance = (std::abs(distsol.first()) < std::abs(distsol.second())) ? distsol.first() : distsol.second(); } - if (distance < 0 && distsol.numberOfSolutions() > 0 && !m_acceleration) { - if (msgLvl(MSG::DEBUG)) { - msg(MSG::DEBUG) << "Obtaining upstream layers from Extrapolator" << endmsg; - } + if (distance < 0 && distsol.numberOfSolutions() > 0 && !cache.m_acceleration) { + + ATH_MSG_DEBUG( "Obtaining upstream layers from Extrapolator" ); + const Surface *destsurf = &firstidhit->associatedSurface(); const TrackParameters *tmppar = 0; if (firstmuonhit) { - if (!m_caloEntrance) { - m_trackingGeometry = m_trackingGeometrySvc->trackingGeometry(); - if (m_trackingGeometry) { - m_caloEntrance = m_trackingGeometry->trackingVolume("InDet::Containers::InnerDetector"); - } - if (!m_caloEntrance) { - msg(MSG::ERROR) << "calo entrance not available" << endmsg; + if(!cache.m_caloEntrance){ + cache.m_trackingGeometry = m_trackingGeometrySvc->trackingGeometry(); + if (cache.m_trackingGeometry) { + cache.m_caloEntrance = cache.m_trackingGeometry->trackingVolume("InDet::Containers::InnerDetector"); + } else { + ATH_MSG_ERROR( "Tracking Geometry not available" ); } } - if (m_caloEntrance) { - tmppar = m_extrapolator->extrapolateToVolume(*startmatpar1, *m_caloEntrance, oppositeMomentum, + if (!cache.m_caloEntrance) { + ATH_MSG_ERROR( "calo entrance not available" ); + } else { + tmppar = m_extrapolator->extrapolateToVolume(*startmatpar1, *cache.m_caloEntrance, oppositeMomentum, Trk::nonInteracting); if (tmppar) { destsurf = &tmppar->associatedSurface(); } } } - m_matvecidupstream = + cache.m_matvecidupstream = m_extrapolator->extrapolateM(*startmatpar1, *destsurf, oppositeMomentum, false, matEffects); - matvec = m_matvecidupstream; + matvec = cache.m_matvecidupstream; if (tmppar) { delete tmppar; } @@ -3493,7 +3575,7 @@ public: } } - if (lastidhit && trajectory.numberOfSiliconHits() > 0 && m_idmat) { + if (lastidhit && trajectory.numberOfSiliconHits() > 0 && cache.m_idmat) { DistanceSolution distsol = lastidhit->associatedSurface().straightLineDistanceEstimate( refpar->position(), refpar->momentum().unit()); double distance = 0; @@ -3509,21 +3591,18 @@ public: const TrackParameters *tmppar = 0; Surface *calosurf = 0; if (firstmuonhit) { - if (!m_caloEntrance) { - m_trackingGeometry = m_trackingGeometrySvc->trackingGeometry(); - if (m_trackingGeometry) { - m_caloEntrance = m_trackingGeometry->trackingVolume("InDet::Containers::InnerDetector"); - } - if (!m_caloEntrance) { - msg(MSG::ERROR) << "calo entrance not available" << endmsg; + if(!cache.m_caloEntrance){ + cache.m_trackingGeometry = m_trackingGeometrySvc->trackingGeometry(); + if (cache.m_trackingGeometry) { + cache.m_caloEntrance = cache.m_trackingGeometry->trackingVolume("InDet::Containers::InnerDetector"); + } else { + ATH_MSG_ERROR( "Tracking Geometry not available" ); } } - /* if (!m_caloEntrance2){ - m_caloEntrance2=new Trk::Volume(m_trackingVolumesSvc->volume(ITrackingVolumesSvc::CalorimeterEntryLayer)); - if (!m_caloEntrance2) msg(MSG::ERROR) << "calo entrance not available" << endmsg; - } */ - if (m_caloEntrance) { - tmppar = m_extrapolator->extrapolateToVolume(*startmatpar2, *m_caloEntrance, Trk::alongMomentum, + if (!cache.m_caloEntrance) { + ATH_MSG_ERROR( "calo entrance not available" ); + } else { + tmppar = m_extrapolator->extrapolateToVolume(*startmatpar2, *cache.m_caloEntrance, Trk::alongMomentum, Trk::nonInteracting); } if (tmppar) { @@ -3549,8 +3628,8 @@ public: destsurf = calosurf; } } - m_matveciddownstream = m_extrapolator->extrapolateM(*startmatpar2, *destsurf, alongMomentum, false, matEffects); - matvec = m_matveciddownstream; + cache.m_matveciddownstream = m_extrapolator->extrapolateM(*startmatpar2, *destsurf, alongMomentum, false, matEffects); + matvec = cache.m_matveciddownstream; if (tmppar) { delete tmppar; } @@ -3564,10 +3643,10 @@ public: const MaterialEffectsOnTrack *meot = dynamic_cast<const MaterialEffectsOnTrack *>(meb); if (meot) { GXFMaterialEffects *meff = new GXFMaterialEffects(meot); - if (m_fiteloss && meot->energyLoss() /*&& (matEffects==muon || matEffects==pion)*/) { + if (cache.m_fiteloss && meot->energyLoss() /*&& (matEffects==muon || matEffects==pion)*/) { meff->setSigmaDeltaE(meot->energyLoss()->sigmaDeltaE()); } - if (matEffects == electron && m_asymeloss) { + if (matEffects == electron && cache.m_asymeloss) { meff->setDeltaE(-5); if (!trajectory.numberOfTRTHits()) { meff->setScatteringSigmas(0, 0); @@ -3576,19 +3655,12 @@ public: } matstates.push_back(new GXFTrackState(meff, (*matvec)[i]->trackParameters())); - // if (m_caloEntrance) std::cout << "tp inside calo: " << - // m_caloEntrance->inside((*matvec)[i]->trackParameters()->position()) << " ref point inside calo: " << - // m_caloEntrance->inside((*matvec)[i]->trackParameters()->associatedSurface()->globalReferencePoint()) - // << std::endl; - // if (m_caloEntrance2) std::cout << "tp inside calo: " << - // m_caloEntrance2->inside((*matvec)[i]->trackParameters()->position()) << " ref point inside calo: " << - // m_caloEntrance2->inside((*matvec)[i]->trackParameters()->associatedSurface()->globalReferencePoint()) - // << std::endl; + } } } }else { - msg(MSG::WARNING) << "No material layers collected from Extrapolator" << endmsg; + ATH_MSG_WARNING( "No material layers collected from Extrapolator" ); } } } @@ -3600,26 +3672,26 @@ public: } - if (m_calomat && firstmuonhit && firstidhit) { + if (cache.m_calomat && firstmuonhit && firstidhit) { const IPropagator *prop = &*m_propagator; - m_calomeots = m_calotool->extrapolationSurfacesAndEffects( + cache.m_calomeots = m_calotool->extrapolationSurfacesAndEffects( *m_navigator->highestVolume(), *prop, *lastidpar, firstmuonhit->associatedSurface(), alongMomentum, muon); - if (!m_calomeots.empty()) { + if (!cache.m_calomeots.empty()) { const TrackParameters *prevtrackpars = lastidpar; if (lasthit == lastmuonhit) { - for (int i = 0; i < (int) m_calomeots.size(); i++) { + for (int i = 0; i < (int) cache.m_calomeots.size(); i++) { // if (i==1 && !m_fieldService->toroidOn()) continue; PropDirection propdir = alongMomentum; const TrackParameters *layerpar = m_propagator->propagateParameters(*prevtrackpars, - m_calomeots[i].associatedSurface(), propdir, false, *m_fieldprop, + cache.m_calomeots[i].associatedSurface(), propdir, false, *trajectory.m_fieldprop, nonInteracting); if (!layerpar) { m_propfailed++; return; } - GXFMaterialEffects *meff = new GXFMaterialEffects(&m_calomeots[i]); + GXFMaterialEffects *meff = new GXFMaterialEffects(&cache.m_calomeots[i]); if (i == 2) { lastcalopar = layerpar; } @@ -3631,7 +3703,7 @@ public: qoverpbrem = firstmuonpar->parameters()[Trk::qOverP]; } else { double sign = (qoverp > 0) ? 1 : -1; - qoverpbrem = sign / (1 / std::abs(qoverp) - std::abs(m_calomeots[i].energyLoss()->deltaE())); + qoverpbrem = sign / (1 / std::abs(qoverp) - std::abs(cache.m_calomeots[i].energyLoss()->deltaE())); } const AmgVector(5) &newpar = layerpar->parameters(); @@ -3649,13 +3721,13 @@ public: prevtrackpars = layerpar; } } - if (firsthit == firstmuonhit && (!m_getmaterialfromtrack || lasthit == lastidhit)) { + if (firsthit == firstmuonhit && (!cache.m_getmaterialfromtrack || lasthit == lastidhit)) { prevtrackpars = firstidpar; - for (int i = 0; i < (int) m_calomeots.size(); i++) { + for (int i = 0; i < (int) cache.m_calomeots.size(); i++) { // if (i==1 && !m_fieldService->toroidOn()) continue; PropDirection propdir = oppositeMomentum; const TrackParameters *layerpar = m_propagator->propagateParameters(*prevtrackpars, - m_calomeots[i].associatedSurface(), propdir, false, *m_fieldprop, + cache.m_calomeots[i].associatedSurface(), propdir, false, *trajectory.m_fieldprop, nonInteracting); if (i == 2 /*&& m_fieldService->toroidOn()*/) { delete prevtrackpars; @@ -3664,7 +3736,7 @@ public: m_propfailed++; return; } - GXFMaterialEffects *meff = new GXFMaterialEffects(&m_calomeots[i]); + GXFMaterialEffects *meff = new GXFMaterialEffects(&cache.m_calomeots[i]); if (i == 2) { firstcalopar = layerpar; } @@ -3677,7 +3749,7 @@ public: qoverp = lastmuonpar->parameters()[Trk::qOverP]; } else { double sign = (qoverpbrem > 0) ? 1 : -1; - qoverp = sign / (1 / std::abs(qoverpbrem) + std::abs(m_calomeots[i].energyLoss()->deltaE())); + qoverp = sign / (1 / std::abs(qoverpbrem) + std::abs(cache.m_calomeots[i].energyLoss()->deltaE())); } meff->setdelta_p(1000 * (qoverpbrem - qoverp)); const AmgVector(5) &newpar = layerpar->parameters(); @@ -3688,7 +3760,7 @@ public: matstates.insert(matstates.begin(), new GXFTrackState(meff, layerpar)); } } - }else { + } else { msg(MSG::WARNING) << "No material layers collected in calorimeter" << endmsg; for (int i = 0; i < (int) matstates.size(); i++) { delete matstates[i]; @@ -3698,20 +3770,22 @@ public: } } - if (lasthit == lastmuonhit && m_extmat) { + if (lasthit == lastmuonhit && cache.m_extmat) { const Trk::TrackParameters *muonpar1 = 0; if (lastcalopar) { - if (!m_msEntrance) { - m_trackingGeometry = m_trackingGeometrySvc->trackingGeometry(); - if (m_trackingGeometry) { - m_msEntrance = m_trackingGeometry->trackingVolume("MuonSpectrometerEntrance"); - } - if (!m_msEntrance) { - msg(MSG::ERROR) << "MS entrance not available" << endmsg; + + if (!cache.m_msEntrance) { + cache.m_trackingGeometry = m_trackingGeometrySvc->trackingGeometry(); + if (cache.m_trackingGeometry) { + cache.m_msEntrance = cache.m_trackingGeometry->trackingVolume("MuonSpectrometerEntrance"); + } else { + ATH_MSG_ERROR( "Tracking Geometry not available" ); } } - if (m_msEntrance && m_msEntrance->inside(lastcalopar->position())) { - muonpar1 = m_extrapolator->extrapolateToVolume(*lastcalopar, *m_msEntrance, Trk::alongMomentum, + if (!cache.m_msEntrance) { + ATH_MSG_ERROR( "MS entrance not available" ); + } else if ( cache.m_msEntrance->inside(lastcalopar->position())) { + muonpar1 = m_extrapolator->extrapolateToVolume(*lastcalopar, *cache.m_msEntrance, Trk::alongMomentum, Trk::nonInteracting); if (muonpar1) { Amg::Vector3D trackdir = muonpar1->momentum().unit(); @@ -3738,7 +3812,7 @@ public: }else { muonpar1 = lastcalopar; } - }else { + } else { muonpar1 = refpar; } @@ -3766,14 +3840,14 @@ public: if (distance < 0 && distsol.numberOfSolutions() > 0 && !firstidhit) { if (firstmuonpar) { AmgVector(5) newpars = firstmuonpar->parameters(); - if (m_straightline && m_p != 0) { + if (trajectory.m_straightline && m_p != 0) { newpars[Trk::qOverP] = 1 / m_p; } muonpar1 = firstmuonpar->associatedSurface().createTrackParameters(newpars[0], newpars[1], newpars[2], newpars[3], newpars[4], 0); }else { const TrackParameters *tmppar = m_propagator->propagateParameters(*muonpar1, - firstmuonhit->associatedSurface(), oppositeMomentum, false, *m_fieldprop, + firstmuonhit->associatedSurface(), oppositeMomentum, false, *trajectory.m_fieldprop, nonInteracting); if (tmppar) { muonpar1 = tmppar; @@ -3785,10 +3859,10 @@ public: msg(MSG::DEBUG) << "Obtaining downstream layers from Extrapolator" << endmsg; } // std::cout << "prevtp: " << *prevtp << std::endl; - m_matvecmuondownstream = m_extrapolator->extrapolateM(*prevtp, + cache.m_matvecmuondownstream = m_extrapolator->extrapolateM(*prevtp, *states.back()->surface(), alongMomentum, false, Trk::nonInteractingMuon); - matvec = m_matvecmuondownstream; + matvec = cache.m_matvecmuondownstream; if(matvec->size()>1000 && m_rejectLargeNScat){ ATH_MSG_DEBUG("too many scatterers: "<<matvec->size()); return; @@ -3800,7 +3874,7 @@ public: const MaterialEffectsOnTrack *meot = dynamic_cast<const MaterialEffectsOnTrack *>(meb); if (meot && j < (int) matvec->size() - 1) { GXFMaterialEffects *meff = new GXFMaterialEffects(meot); - if (!m_straightline && meot->energyLoss() && std::abs(meff->deltaE()) > 25 && + if (!trajectory.m_straightline && meot->energyLoss() && std::abs(meff->deltaE()) > 25 && std::abs((*matvec)[j]->trackParameters()->position().z()) < 13000) { meff->setSigmaDeltaE(meot->energyLoss()->sigmaDeltaE()); } @@ -3815,20 +3889,21 @@ public: } } - if (firsthit == firstmuonhit && m_extmat && firstcalopar) { + if (firsthit == firstmuonhit && cache.m_extmat && firstcalopar) { const Trk::TrackParameters *muonpar1 = 0; if (firstcalopar) { - if (!m_msEntrance) { - m_trackingGeometry = m_trackingGeometrySvc->trackingGeometry(); - if (m_trackingGeometry) { - m_msEntrance = m_trackingGeometry->trackingVolume("MuonSpectrometerEntrance"); - } - if (!m_msEntrance) { - msg(MSG::ERROR) << "MS entrance not available" << endmsg; + if (!cache.m_msEntrance) { + cache.m_trackingGeometry = m_trackingGeometrySvc->trackingGeometry(); + if (cache.m_trackingGeometry) { + cache.m_msEntrance = cache.m_trackingGeometry->trackingVolume("MuonSpectrometerEntrance"); + } else { + ATH_MSG_ERROR( "Tracking Geometry not available" ); } } - if (m_msEntrance && m_msEntrance->inside(firstcalopar->position())) { - muonpar1 = m_extrapolator->extrapolateToVolume(*firstcalopar, *m_msEntrance, Trk::oppositeMomentum, + if (!cache.m_msEntrance) { + ATH_MSG_ERROR( "MS entrance not available" ); + } else if ( cache.m_msEntrance->inside(firstcalopar->position())) { + muonpar1 = m_extrapolator->extrapolateToVolume(*firstcalopar, *cache.m_msEntrance, Trk::oppositeMomentum, Trk::nonInteracting); if (muonpar1) { Amg::Vector3D trackdir = muonpar1->momentum().unit(); @@ -3873,21 +3948,21 @@ public: // distance << std::endl; if (distance < 0 && distsol.numberOfSolutions() > 0) { const TrackParameters *prevtp = muonpar1; - msg(MSG::DEBUG) << "Collecting upstream muon material from extrapolator" << endmsg; + ATH_MSG_DEBUG( "Collecting upstream muon material from extrapolator" ); - m_matvecmuonupstream = m_extrapolator->extrapolateM(*prevtp, + cache.m_matvecmuonupstream = m_extrapolator->extrapolateM(*prevtp, *states[0]->surface(), oppositeMomentum, false, Trk::nonInteractingMuon); - matvec = m_matvecmuonupstream; + matvec = cache.m_matvecmuonupstream; if (matvec && !matvec->empty()) { - msg(MSG::DEBUG) << "Retrieved " << matvec->size() << " material states" << endmsg; + ATH_MSG_DEBUG( "Retrieved " << matvec->size() << " material states" ); for (int j = 0; j < (int) matvec->size(); j++) { const MaterialEffectsBase *meb = (*matvec)[j]->materialEffectsOnTrack(); if (meb) { const MaterialEffectsOnTrack *meot = dynamic_cast<const MaterialEffectsOnTrack *>(meb); if (meot && j < (int) matvec->size() - 1) { GXFMaterialEffects *meff = new GXFMaterialEffects(meot); - if (!m_straightline && meot->energyLoss() && std::abs(meff->deltaE()) > 25 && + if (!trajectory.m_straightline && meot->energyLoss() && std::abs(meff->deltaE()) > 25 && std::abs((*matvec)[j]->trackParameters()->position().z()) < 13000) { meff->setSigmaDeltaE(meot->energyLoss()->sigmaDeltaE()); } @@ -3910,12 +3985,12 @@ public: trajectory.setTrackStates(newstates); states.reserve(oldstates.size() + matstates.size()); int layerno = 0, firstlayerno = -1; - if (m_acceleration) { + if (cache.m_acceleration) { states.push_back(oldstates[0]); } double cosphi = cos(refpar->parameters()[Trk::phi0]); double sinphi = sin(refpar->parameters()[Trk::phi0]); - for (int i = m_acceleration ? 1 : 0; i < (int) oldstates.size(); i++) { + for (int i = cache.m_acceleration ? 1 : 0; i < (int) oldstates.size(); i++) { bool addlayer = true; while (addlayer && layerno < (int) matstates.size()) { addlayer = false; @@ -4012,17 +4087,18 @@ public: } const TrackParameters * - GlobalChi2Fitter::makePerigee(const TrackParameters ¶m, ParticleHypothesis matEffects) const { + GlobalChi2Fitter::makePerigee( Cache& cache, + const TrackParameters ¶m, ParticleHypothesis matEffects) const { const PerigeeSurface *persurf = dynamic_cast<const PerigeeSurface *>(¶m.associatedSurface()); const TrackParameters *per = 0; - if (persurf && (!m_acceleration || persurf->center().perp() > 5)) { + if (persurf && (!cache.m_acceleration || persurf->center().perp() > 5)) { const AmgVector(5) &pars = param.parameters(); const TrackParameters *newper = param.associatedSurface().createTrackParameters(pars[0], pars[1], pars[2], pars[3], pars[4], 0); return newper; } - if (m_acceleration) { + if (cache.m_acceleration) { return 0; } PerigeeSurface tmppersf; @@ -4142,91 +4218,85 @@ public: #endif Track * - GlobalChi2Fitter::myfit(GXFTrajectory &trajectory, + GlobalChi2Fitter::myfit(Cache& cache, + GXFTrajectory &trajectory, const TrackParameters ¶m, const RunOutlierRemoval runOutlier, const ParticleHypothesis matEffects) const { - m_fittercode = FitterStatusCode::Success; - m_straightline = m_straightlineprop; - if (!m_straightline) { + cache.m_fittercode = FitterStatusCode::Success; + trajectory.m_straightline = m_straightlineprop; + if (!trajectory.m_straightline) { if (trajectory.numberOfSiliconHits() + trajectory.numberOfTRTHits() == trajectory.numberOfHits()) { - m_straightline = !m_fieldService->solenoidOn(); + trajectory.m_straightline = !m_fieldService->solenoidOn(); } else if (!trajectory.prefit() && trajectory.numberOfSiliconHits() + trajectory.numberOfTRTHits() == 0) { - m_straightline = !m_fieldService->toroidOn(); + trajectory.m_straightline = !m_fieldService->toroidOn(); } else { - m_straightline = (!m_fieldService->solenoidOn() && !m_fieldService->toroidOn()); + trajectory.m_straightline = (!m_fieldService->solenoidOn() && !m_fieldService->toroidOn()); } } - m_fieldprop = m_straightline ? m_fieldpropnofield : m_fieldpropfullfield; - m_lastiter = 0; + trajectory.m_fieldprop = trajectory.m_straightline ? m_fieldpropnofield : m_fieldpropfullfield; + cache.m_lastiter = 0; if (trajectory.numberOfPerigeeParameters() == -1) { m_nfits++; - if (m_straightline) { + if (trajectory.m_straightline) { trajectory.setNumberOfPerigeeParameters(4); } else { trajectory.setNumberOfPerigeeParameters(5); } } if (trajectory.nDOF() < 0) { - msg(MSG::WARNING) << "Not enough measurements, reject track" << endmsg; - // cleanup(); + ATH_MSG_WARNING( "Not enough measurements, reject track" ); return 0; } - m_hitcount = 0; - m_updatescat = false; - m_phiweight.clear(); - m_firstmeasurement.clear(); - m_lastmeasurement.clear(); + cache.m_hitcount = 0; + cache.m_updatescat = false; + cache.m_phiweight.clear(); + cache.m_firstmeasurement.clear(); + cache.m_lastmeasurement.clear(); if (matEffects != nonInteracting && param.parameters()[Trk::qOverP] == 0 && m_p == 0) { - msg(MSG::WARNING) << "Attempt to apply material corrections with q/p=0, reject track" << endmsg; - // cleanup(); + ATH_MSG_WARNING( "Attempt to apply material corrections with q/p=0, reject track" ); return 0; } - if (matEffects == Trk::electron && m_straightline) { - msg(MSG::WARNING) << "Electron fit requires helix track model" << endmsg; - // cleanup(); + if (matEffects == Trk::electron && trajectory.m_straightline) { + ATH_MSG_WARNING("Electron fit requires helix track model"); return 0; } double mass = m_particleMasses.mass[matEffects]; trajectory.setMass(mass); - if (msgLvl(MSG::DEBUG)) { - msg(MSG::DEBUG) << "start param: " << param << " pos: " << param.position() << " pt: " << param.pT() << endmsg; - } - const TrackParameters *per = makePerigee(param, matEffects); // When acceleration is enabled, perigee is constructed + ATH_MSG_DEBUG( "start param: " << param << " pos: " << param.position() << " pt: " << param.pT() ); + + const TrackParameters *per = makePerigee(cache, param, matEffects); // When acceleration is enabled, perigee is constructed // below instead of in makePerigee() - if (!m_acceleration && !per) { - m_fittercode = FitterStatusCode::ExtrapolationFailure; + if (!cache.m_acceleration && !per) { + cache.m_fittercode = FitterStatusCode::ExtrapolationFailure; m_propfailed++; - if (msgLvl(MSG::DEBUG)) { - msg(MSG::DEBUG) << "Propagation to perigee failed 1" << endmsg; - } - // cleanup(); + ATH_MSG_DEBUG("Propagation to perigee failed 1" ); return 0; } - if (matEffects != Trk::nonInteracting && !m_matfilled) { - if (m_fastmat && m_acceleration && + if (matEffects != Trk::nonInteracting && !cache.m_matfilled) { + if (cache.m_fastmat && cache.m_acceleration && trajectory.numberOfSiliconHits() + trajectory.numberOfTRTHits() == trajectory.numberOfHits() && (m_matupdator.empty() || m_trackingGeometrySvc.empty())) { ATH_MSG_WARNING("Tracking Geometry Service and/or Material Updator Tool not configured"); ATH_MSG_WARNING("Falling back to slow material collection"); - m_fastmat = false; + cache.m_fastmat = false; } - if (!m_fastmat || !m_acceleration || + if (!cache.m_fastmat || !cache.m_acceleration || trajectory.numberOfSiliconHits() + trajectory.numberOfTRTHits() != trajectory.numberOfHits()) { - addMaterial(trajectory, per ? per : ¶m, matEffects); + addMaterial(cache, trajectory, per ? per : ¶m, matEffects); } else { - addIDMaterialFast(trajectory, per ? per : ¶m, matEffects); + addIDMaterialFast(cache, trajectory, per ? per : ¶m, matEffects); } } // std::cout << "accel: " << m_acceleration << " refpar: " << trajectory.referenceParameters() << " per: " << per << // std::endl; - if (m_acceleration && !trajectory.referenceParameters() && !per) { + if (cache.m_acceleration && !trajectory.referenceParameters() && !per) { Amg::Vector3D vertex; if (trajectory.numberOfScatterers() >= 2) { GXFTrackState *scatstate = 0, *scatstate2 = 0; @@ -4261,6 +4331,7 @@ public: const TrackParameters *nearestpar = 0; double mindist = 99999; std::vector<GXFTrackState *> mymatvec; + for (std::vector<GXFTrackState *>::iterator it = trajectory.trackStates().begin(); it != trajectory.trackStates().end(); it++) { if (!(**it).trackParameters()) { @@ -4268,7 +4339,7 @@ public: } double distance = persurf.straightLineDistanceEstimate( (**it).trackParameters()->position(), (**it).trackParameters()->momentum().unit()).first(); - bool insideid = (!m_caloEntrance || m_caloEntrance->inside((**it).trackParameters()->position())); + bool insideid = (!cache.m_caloEntrance || cache.m_caloEntrance->inside((**it).trackParameters()->position())); // if ((**it).materialEffects()) std::cout << "mat: " << (**it).materialEffects() << " distance: " << distance // << " dE: " << (**it).materialEffects()->deltaE() << " sigdphi: " << (**it).materialEffects()->sigmaDeltaPhi() // << " dphi: " << (**it).materialEffects()->deltaPhi() << std::endl; @@ -4310,21 +4381,20 @@ public: propdir = oppositeMomentum; } const TrackParameters *tmppar = m_propagator->propagateParameters(*nearestpar, *matsurf, propdir, false, - *m_fieldprop, Trk::nonInteracting); + *trajectory.m_fieldprop, Trk::nonInteracting); if (!tmppar) { propdir = (propdir == oppositeMomentum) ? alongMomentum : oppositeMomentum; - tmppar = m_propagator->propagateParameters(*nearestpar, *matsurf, propdir, false, *m_fieldprop, + tmppar = m_propagator->propagateParameters(*nearestpar, *matsurf, propdir, false, *trajectory.m_fieldprop, Trk::nonInteracting); if (!tmppar) { if (i != 0) { delete nearestpar; } - m_fittercode = FitterStatusCode::ExtrapolationFailure; + cache.m_fittercode = FitterStatusCode::ExtrapolationFailure; m_propfailed++; - if (msgLvl(MSG::DEBUG)) { - msg(MSG::DEBUG) << "Propagation to perigee failed 2" << endmsg; - } - // cleanup(); + + ATH_MSG_DEBUG( "Propagation to perigee failed 2" ); + return 0; } } @@ -4351,7 +4421,7 @@ public: // std::cout << "persurf: " << persurf << " nearest par: " << *nearestpar << std::endl; per = dynamic_cast<const Perigee *>(m_propagator->propagateParameters(*nearestpar, persurf, Trk::anyDirection, false, - *m_fieldprop, Trk::nonInteracting)); + *trajectory.m_fieldprop, Trk::nonInteracting)); if (!mymatvec.empty()) { delete nearestpar; } @@ -4368,12 +4438,10 @@ public: per = newper; } if (!per) { - m_fittercode = FitterStatusCode::ExtrapolationFailure; + cache.m_fittercode = FitterStatusCode::ExtrapolationFailure; m_propfailed++; - if (msgLvl(MSG::DEBUG)) { - msg(MSG::DEBUG) << "Propagation to perigee failed 3" << endmsg; - } - // cleanup(); + ATH_MSG_DEBUG( "Propagation to perigee failed 3" ); + return 0; } PerigeeSurface persurf2(per->position()); @@ -4382,18 +4450,16 @@ public: per->parameters()[Trk::theta], per->parameters()[Trk::qOverP], 0); delete oldper; }else if (!per) { - per = makePerigee(param, matEffects); + per = makePerigee(cache, param, matEffects); } if (!per && !trajectory.referenceParameters()) { - m_fittercode = FitterStatusCode::ExtrapolationFailure; + cache.m_fittercode = FitterStatusCode::ExtrapolationFailure; m_propfailed++; - if (msgLvl(MSG::DEBUG)) { - msg(MSG::DEBUG) << "Propagation to perigee failed 4" << endmsg; - } - // cleanup(); + ATH_MSG_DEBUG( "Propagation to perigee failed 4" ); + return 0; } - if (m_straightline && per) { + if (trajectory.m_straightline && per) { if (trajectory.numberOfPerigeeParameters() == -1) { trajectory.setNumberOfPerigeeParameters(4); } @@ -4420,10 +4486,11 @@ public: int originalErrorLevel = gErrorIgnoreLevel; gErrorIgnoreLevel = 10000; - m_a.ResizeTo(nfitpar, nfitpar); + cache.m_a.ResizeTo(nfitpar, nfitpar); TDecompChol lu; TVectorD b(nfitpar); +/* if (trajectory.trackStates().size() > m_derivpool.size()) { int diff = (int) trajectory.trackStates().size() - (int) m_derivpool.size(); m_derivpool.reserve(trajectory.trackStates().size() + 50); @@ -4431,51 +4498,56 @@ public: m_derivpool.push_back(*m_derivpool.begin()); } } - if (nfitpar > m_derivpool.begin()->num_col()) { + if (nfitpar > m_derivpool.begin()->cols()) { for (int i = 0; i < (int) m_derivpool.size(); i++) { - m_derivpool[i] = HepMatrix(5, nfitpar + 50, 0); + m_derivpool[i] = Amg::MatrixX(5, nfitpar + 50); + m_derivpool[i].setZero(); } } +*/ + + Amg::MatrixX derivPool(5, nfitpar); + derivPool.setZero(); + for (int i = 0; i < (int) trajectory.trackStates().size(); i++) { if (trajectory.trackStates()[i]->materialEffects()) { continue; } + trajectory.trackStates()[i]->setDerivatives( derivPool ); + /* for (int j = 0; j < 5; j++) { for (int k = 0; k < nfitpar; k++) { - m_derivpool[i][j][k] = 0; + m_derivpool[i](j,k) = 0; } } trajectory.trackStates()[i]->setDerivatives(m_derivpool[i]); + */ } bool doderiv = true; int it = 0; - int tmpminiter = m_miniter; + int tmpminiter = cache.m_miniter; for (; it < m_maxit; it++) { - m_lastiter = it; + cache.m_lastiter = it; if (it >= m_maxit - 1) { - if (msgLvl(MSG::DEBUG)) { - msg(MSG::DEBUG) << "Fit did not converge" << endmsg; - } - m_fittercode = FitterStatusCode::NoConvergence; + ATH_MSG_DEBUG( "Fit did not converge" ); + cache.m_fittercode = FitterStatusCode::NoConvergence; m_notconverge++; gErrorIgnoreLevel = originalErrorLevel; - // cleanup(); - m_miniter = tmpminiter; + cache.m_miniter = tmpminiter; return 0; } if (!trajectory.converged()) { - m_fittercode = runIteration(trajectory, it, m_a, b, lu, doderiv); - if (m_fittercode != FitterStatusCode::Success) { - if (m_fittercode == FitterStatusCode::ExtrapolationFailure) { + cache.m_fittercode = runIteration(cache, trajectory, it, cache.m_a, b, lu, doderiv); + if (cache.m_fittercode != FitterStatusCode::Success) { + if (cache.m_fittercode == FitterStatusCode::ExtrapolationFailure) { m_propfailed++; - }else if (m_fittercode == FitterStatusCode::InvalidAngles) { + }else if (cache.m_fittercode == FitterStatusCode::InvalidAngles) { m_invalidangles++; - } else if (m_fittercode == FitterStatusCode::ExtrapolationFailureDueToSmallMomentum) { + } else if (cache.m_fittercode == FitterStatusCode::ExtrapolationFailureDueToSmallMomentum) { m_lowmomentum++; } gErrorIgnoreLevel = originalErrorLevel; - // cleanup(); - m_miniter = tmpminiter; + cache.m_miniter = tmpminiter; return 0; } int nhits = trajectory.numberOfHits(), ntrthits = trajectory.numberOfTRTHits(), @@ -4487,30 +4559,24 @@ public: ((redchi2 < prevredchi2 && (redchi2 > prevredchi2 - 1 || redchi2 < 2)) || nsihits + ntrthits == nhits) && (runOutlier || m_trtrecal) && ntrthits > 0) { if (!(it == 1 && nsihits == 0 && trajectory.nDOF() > 0 && trajectory.chi2() / trajectory.nDOF() > 3)) { - if (msgLvl(MSG::DEBUG)) { - msg(MSG::DEBUG) << "Running TRT cleaner" << endmsg; - } - runTrackCleanerTRT(trajectory, m_a, b, lu, runOutlier, m_trtrecal, it); - if (m_fittercode != FitterStatusCode::Success) { - if (msgLvl(MSG::DEBUG)) { - msg(MSG::DEBUG) << "TRT cleaner failed, returning null..." << endmsg; - } + ATH_MSG_DEBUG( "Running TRT cleaner" ); + runTrackCleanerTRT(cache, trajectory, cache.m_a, b, lu, runOutlier, m_trtrecal, it); + if (cache.m_fittercode != FitterStatusCode::Success) { + + ATH_MSG_DEBUG("TRT cleaner failed, returning null..."); gErrorIgnoreLevel = originalErrorLevel; - // cleanup(); - m_miniter = tmpminiter; + cache.m_miniter = tmpminiter; return 0; } } - // if (!m_trtrecal) it=-1; } if (!trajectory.converged()) { - m_fittercode = updateFitParameters(trajectory, b, lu); - if (m_fittercode != FitterStatusCode::Success) { - if (m_fittercode == FitterStatusCode::InvalidAngles) { + cache.m_fittercode = updateFitParameters(trajectory, b, lu); + if (cache.m_fittercode != FitterStatusCode::Success) { + if (cache.m_fittercode == FitterStatusCode::InvalidAngles) { m_invalidangles++; } - // cleanup(); - m_miniter = tmpminiter; + cache.m_miniter = tmpminiter; return 0; } } @@ -4519,40 +4585,37 @@ public: } } - m_miniter = tmpminiter; + cache.m_miniter = tmpminiter; if (!trajectory.prefit()) { - m_ainv.ResizeTo(m_a.GetNcols(), m_a.GetNcols()); - double *myarray = m_a.GetMatrixArray(); - double *myarrayinv = m_ainv.GetMatrixArray(); - AlSymMat weight(m_a.GetNcols()); - for (int i = 0; i < m_a.GetNcols(); ++i) { + cache.m_ainv.ResizeTo(cache.m_a.GetNcols(), cache.m_a.GetNcols()); + double *myarray = cache.m_a.GetMatrixArray(); + double *myarrayinv = cache.m_ainv.GetMatrixArray(); + AlSymMat weight(cache.m_a.GetNcols()); + for (int i = 0; i < cache.m_a.GetNcols(); ++i) { for (int j = 0; j <= i; ++j) { - weight[i][j] = myarray[i * m_a.GetNcols() + j]; + weight[i][j] = myarray[i * cache.m_a.GetNcols() + j]; } } int ok = weight.invert(); - for (int i = 0; i < m_a.GetNcols(); ++i) { + for (int i = 0; i < cache.m_a.GetNcols(); ++i) { for (int j = 0; j <= i; ++j) { - myarrayinv[i * m_a.GetNcols() + j] = myarrayinv[j * m_a.GetNcols() + i] = weight[i][j]; + myarrayinv[i * cache.m_a.GetNcols() + j] = myarrayinv[j * cache.m_a.GetNcols() + i] = weight[i][j]; } } // bool ok=lu.Invert(ainv); if (ok) { - if (msgLvl(MSG::DEBUG)) { - msg(MSG::DEBUG) << "matrix inversion failed!" << endmsg; - } + ATH_MSG_DEBUG ("matrix inversion failed!"); m_matrixinvfailed++; - m_fittercode = FitterStatusCode::MatrixInversionFailure; + cache.m_fittercode = FitterStatusCode::MatrixInversionFailure; gErrorIgnoreLevel = originalErrorLevel; - // cleanup(); return 0; } } GXFTrajectory *finaltrajectory = &trajectory; - if ((runOutlier || m_sirecal) && trajectory.numberOfSiliconHits() == trajectory.numberOfHits()) { - calculateTrackErrors(trajectory, m_ainv, true); - finaltrajectory = runTrackCleanerSilicon(trajectory, m_a, m_ainv, b, runOutlier); + if ((runOutlier || cache.m_sirecal) && trajectory.numberOfSiliconHits() == trajectory.numberOfHits()) { + calculateTrackErrors(trajectory, cache.m_ainv, true); + finaltrajectory = runTrackCleanerSilicon(cache, trajectory, cache.m_a, cache.m_ainv, b, runOutlier); } // if (trajectory.numberOfSiliconHits()+trajectory.numberOfTRTHits()!=trajectory.numberOfHits() && !m_straightline // && !trajectory.prefit()) runTrackCleanerMDT(trajectory,a,ainv,b,lu); @@ -4560,31 +4623,28 @@ public: // We're done with the ROOT stuff, so we can reset the error level gErrorIgnoreLevel = originalErrorLevel; - if (m_fittercode != FitterStatusCode::Success) { - if (msgLvl(MSG::DEBUG)) { - msg(MSG::DEBUG) << "Silicon cleaner failed, returning null..." << endmsg; - } + if (cache.m_fittercode != FitterStatusCode::Success) { + ATH_MSG_DEBUG( "Silicon cleaner failed, returning null..." ); if (finaltrajectory != &trajectory) { delete finaltrajectory; } - // cleanup(); return 0; } if (m_domeastrackpar && !finaltrajectory->prefit()) { - calculateTrackErrors(*finaltrajectory, m_ainv, false); + calculateTrackErrors(*finaltrajectory, cache.m_ainv, false); } - if (!m_acceleration && !finaltrajectory->prefit()) { + if (!cache.m_acceleration && !finaltrajectory->prefit()) { if (nperpars == 5) { - for (int i = 0; i < m_a.GetNcols(); i++) { - m_ainv[4][i] *= .001; - m_ainv[i][4] *= .001; + for (int i = 0; i < cache.m_a.GetNcols(); i++) { + cache.m_ainv[4][i] *= .001; + cache.m_ainv[i][4] *= .001; } // ainv[4][4]*=.001; } for (int bremno = 0; bremno < nbrem; bremno++) { - for (int i = 0; i < m_a.GetNcols(); i++) { - m_ainv[nperpars + 2 * nscat + bremno][i] *= .001; - m_ainv[i][nperpars + 2 * nscat + bremno] *= .001; + for (int i = 0; i < cache.m_a.GetNcols(); i++) { + cache.m_ainv[nperpars + 2 * nscat + bremno][i] *= .001; + cache.m_ainv[i][nperpars + 2 * nscat + bremno] *= .001; } // ainv[nperpars+2*nscat+bremno][nperpars+2*nscat+bremno]*=.001; } @@ -4594,10 +4654,10 @@ public: int nperparams = finaltrajectory->numberOfPerigeeParameters(); for (int i = 0; i < nperparams; i++) { for (int j = 0; j < nperparams; j++) { - (*errmat)(j, i) = m_ainv[j][i]; + (*errmat)(j, i) = cache.m_ainv[j][i]; } } - if (m_straightline) { + if (trajectory.m_straightline) { (*errmat)(4, 4) = 1e-20; } @@ -4609,15 +4669,15 @@ public: perpars[4], errmat); finaltrajectory->setReferenceParameters(measper); if (m_fillderivmatrix) { - delete m_fullcovmat; - m_fullcovmat = new Amg::MatrixX(m_ainv.GetNcols(), m_ainv.GetNcols()); - m_fullcovmat->setZero(); - for (int col_i = 0; col_i < m_ainv.GetNcols(); col_i++) { - for (int row_j = col_i; row_j < m_ainv.GetNcols(); row_j++) { + delete cache.m_fullcovmat; + cache.m_fullcovmat = new Amg::MatrixX(cache.m_ainv.GetNcols(), cache.m_ainv.GetNcols()); + cache.m_fullcovmat->setZero(); + for (int col_i = 0; col_i < cache.m_ainv.GetNcols(); col_i++) { + for (int row_j = col_i; row_j < cache.m_ainv.GetNcols(); row_j++) { // Coverity does not like the parameters to be called j and i // because in the method declaration the parameters are called i and j. // Coverity assumes the arguments to be swapped ... - m_fullcovmat->fillSymmetric(row_j, col_i, m_ainv[row_j][col_i]); + cache.m_fullcovmat->fillSymmetric(row_j, col_i, cache.m_ainv[row_j][col_i]); } } } @@ -4627,14 +4687,13 @@ public: if (finaltrajectory != &trajectory) { delete finaltrajectory; } - // cleanup(); return 0; } if (finaltrajectory->numberOfOutliers() <= m_maxoutliers || !runOutlier) { - track = makeTrack(*finaltrajectory, matEffects); + track = makeTrack(cache, *finaltrajectory, matEffects); } else { m_notenoughmeas++; - m_fittercode = FitterStatusCode::OutlierLogicFailure; + cache.m_fittercode = FitterStatusCode::OutlierLogicFailure; } double cut = (finaltrajectory->numberOfSiliconHits() == finaltrajectory->numberOfHits()) ? 999 : m_chi2cut; if (runOutlier && track && @@ -4650,17 +4709,17 @@ public: if (finaltrajectory != &trajectory) { delete finaltrajectory; } - // cleanup(); return track; } void - GlobalChi2Fitter::fillResiduals(GXFTrajectory &trajectory, int it, TMatrixDSym &a, TVectorD &b, TDecompChol &lu, + GlobalChi2Fitter::fillResiduals(Cache& cache, + GXFTrajectory &trajectory, int it, TMatrixDSym &a, TVectorD &b, TDecompChol &lu, bool &doderiv) const { ATH_MSG_DEBUG("fillResiduals"); + std::vector<GXFTrackState *> &states = trajectory.trackStates(); double chi2 = 0; - int scatno = 0, bremno = 0, measno = 0; int nbrem = trajectory.numberOfBrems(); @@ -4692,6 +4751,8 @@ public: myarray=ainv.GetMatrixArray(); } */ + std::vector<double> residuals; + for (int hitno = 0; hitno < (int) states.size(); hitno++) { GXFTrackState *state = states[hitno]; const TrackParameters *currenttrackpar = state->trackParameters(); @@ -4717,7 +4778,7 @@ public: measbase = newpseudo; } double *errors = state->measurementErrors(); - m_residualPullCalculator->residuals(m_residuals, measbase, currenttrackpar, ResidualPull::Biased, hittype); + m_residualPullCalculator->residuals(residuals, measbase, currenttrackpar, ResidualPull::Biased, hittype); for (int i = 0; i < 5; i++) { if (!measbase->localParameters().contains(paraccessor.pardef[i]) || (i > 0 && (hittype == TrackState::SCT || hittype == TrackState::TGC))) { @@ -4727,7 +4788,7 @@ public: (trajectory.prefit() > 0 && (hittype == TrackState::MDT || (hittype == TrackState::CSC && !state->measuresPhi()))) ? 2 : errors[i]; - res[measno] = m_residuals[i]; + res[measno] = residuals[i]; if (i == 2 && std::abs(std::abs(res[measno]) - 2 * M_PI) < std::abs(res[measno])) { if (res[measno] < 0) { res[measno] += 2 * M_PI; @@ -4753,8 +4814,8 @@ public: double deltatheta = state->materialEffects()->deltaTheta(); double sigmadeltatheta = state->materialEffects()->sigmaDeltaTheta(); // if (trajectory.prefit()==1) sigmadeltatheta*=5; - if (m_updatescat && (sigmadeltaphi >= 0.001 || (sigmadeltaphi >= 0.0001 && !trajectory.prefit())) && - (state->materialEffects()->deltaE() == 0 || !m_msEntrance->inside(state->trackParameters()->position())) && + if (cache.m_updatescat && (sigmadeltaphi >= 0.001 || (sigmadeltaphi >= 0.0001 && !trajectory.prefit())) && + (state->materialEffects()->deltaE() == 0 || (cache.m_msEntrance && !cache.m_msEntrance->inside(state->trackParameters()->position()))) && it >= 2) { state->materialEffects()->setMeasuredDeltaPhi(deltaphi); measdeltaphi = state->materialEffects()->measuredDeltaPhi(); @@ -4813,7 +4874,7 @@ public: maxbrempull = -999999999; state_maxbrempull = 0; } - if (m_asymeloss && it > 0 && !trajectory.prefit() && sigde > 0 && sigde != sigdepos && sigde != sigdeneg) { + if (cache.m_asymeloss && it > 0 && !trajectory.prefit() && sigde > 0 && sigde != sigdepos && sigde != sigdeneg) { double elosspull = res[nmeas - nbrem + bremno] / (.001 * sigde); if (trajectory.mass() > 100) { @@ -4856,9 +4917,7 @@ public: double newres = .001 * averagenergyloss - sqrt(p * p + mass * mass) + sqrt(pbrem * pbrem + mass * mass); double newerr = .001 * calomeots[1].energyLoss()->sigmaDeltaE(); if (std::abs(newres / newerr) < std::abs(res[nmeas - nbrem + bremno] / error[nmeas - nbrem + bremno])) { - if (msgLvl(MSG::DEBUG)) { - msg(MSG::DEBUG) << "Changing from measured to parametrized energy loss" << endmsg; - } + ATH_MSG_DEBUG( "Changing from measured to parametrized energy loss" ); state->materialEffects()->setEloss(calomeots[1].energyLoss()->clone()); state->materialEffects()->setSigmaDeltaE(calomeots[1].energyLoss()->sigmaDeltaE()); res[nmeas - nbrem + bremno] = newres; @@ -4877,10 +4936,8 @@ public: } chi2 += res[measno] * (1. / (error[measno] * error[measno])) * res[measno]; - if (msgLvl(MSG::VERBOSE)) { - msg(MSG::VERBOSE) << "res[" << measno << "]: " << res[measno] << " error[" << measno << "]: " << - error[measno] << " res/err: " << res[measno] / error[measno] << endmsg; - } + ATH_MSG_VERBOSE( "res[" << measno << "]: " << res[measno] << " error[" << measno << "]: " << + error[measno] << " res/err: " << res[measno] / error[measno] ); } if (!doderiv && (scatwasupdated /* || nbrem>0*/)) { lu.SetMatrix(a); @@ -4905,8 +4962,8 @@ public: double maxdiff = (nsihits != 0 && nsihits + ntrthits == nhits && chi2 < oldchi2) ? 200 : 1.; maxdiff = 1; int miniter = (nsihits != 0 && nsihits + ntrthits == nhits) ? 1 : 2; - if (miniter < m_miniter) { - miniter = m_miniter; + if (miniter < cache.m_miniter) { + miniter = cache.m_miniter; } if (it >= miniter && fabs(oldchi2 - chi2) < maxdiff) { trajectory.setConverged(true); @@ -4982,7 +5039,7 @@ public: int bremmax = (bremno < nbremupstream) ? nbremupstream : bremno; if (statetype == TrackState::Fittable) { - HepMatrix &derivatives = state->derivatives(); + Amg::MatrixX &derivatives = state->derivatives(); double sinstereo = 0; if (hittype == TrackState::SCT || hittype == TrackState::TGC) { sinstereo = state->sinStereo(); @@ -4995,21 +5052,21 @@ public: } if (trajectory.numberOfPerigeeParameters() > 0) { if (i == 0 && sinstereo != 0) { - weightderiv[measno][0] = (derivatives[0][0] * cosstereo + sinstereo * derivatives[1][0]) / error[measno]; - weightderiv[measno][1] = (derivatives[0][1] * cosstereo + sinstereo * derivatives[1][1]) / error[measno]; - weightderiv[measno][2] = (derivatives[0][2] * cosstereo + sinstereo * derivatives[1][2]) / error[measno]; - weightderiv[measno][3] = (derivatives[0][3] * cosstereo + sinstereo * derivatives[1][3]) / error[measno]; - if (!m_straightline) { - weightderiv[measno][4] = (derivatives[0][4] * cosstereo + sinstereo * derivatives[1][4]) / + weightderiv[measno][0] = (derivatives(0,0) * cosstereo + sinstereo * derivatives(1,0)) / error[measno]; + weightderiv[measno][1] = (derivatives(0,1) * cosstereo + sinstereo * derivatives(1,1)) / error[measno]; + weightderiv[measno][2] = (derivatives(0,2) * cosstereo + sinstereo * derivatives(1,2)) / error[measno]; + weightderiv[measno][3] = (derivatives(0,3) * cosstereo + sinstereo * derivatives(1,3)) / error[measno]; + if (!trajectory.m_straightline) { + weightderiv[measno][4] = (derivatives(0,4) * cosstereo + sinstereo * derivatives(1,4)) / error[measno]; } }else { - weightderiv[measno][0] = derivatives[i][0] / error[measno]; - weightderiv[measno][1] = derivatives[i][1] / error[measno]; - weightderiv[measno][2] = derivatives[i][2] / error[measno]; - weightderiv[measno][3] = derivatives[i][3] / error[measno]; - if (!m_straightline) { - weightderiv[measno][4] = derivatives[i][4] / error[measno]; + weightderiv[measno][0] = derivatives(i,0) / error[measno]; + weightderiv[measno][1] = derivatives(i,1) / error[measno]; + weightderiv[measno][2] = derivatives(i,2) / error[measno]; + weightderiv[measno][3] = derivatives(i,3) / error[measno]; + if (!trajectory.m_straightline) { + weightderiv[measno][4] = derivatives(i,4) / error[measno]; } } } @@ -5019,17 +5076,17 @@ public: double sign = (j < nscatupstream) ? -1 : 1; sign = 1; if (i == 0 && sinstereo != 0) { - thisderiv = sign * (derivatives[0][index] * cosstereo + sinstereo * derivatives[1][index]); + thisderiv = sign * (derivatives(0,index) * cosstereo + sinstereo * derivatives(1,index)); } else { - thisderiv = sign * derivatives[i][index]; + thisderiv = sign * derivatives(i,index); } weightderiv[measno][index] = thisderiv / error[measno]; if (trajectory.prefit() != 1) { index++; if (i == 0 && sinstereo != 0) { - thisderiv = sign * (derivatives[0][index] * cosstereo + sinstereo * derivatives[1][index]); + thisderiv = sign * (derivatives(0,index) * cosstereo + sinstereo * derivatives(1,index)); } else { - thisderiv = sign * derivatives[i][index]; + thisderiv = sign * derivatives(i,index); } weightderiv[measno][index] = thisderiv / error[measno]; } @@ -5038,9 +5095,9 @@ public: double thisderiv = 0; int index = j + nperparams + 2 * nscat; if (i == 0 && sinstereo != 0) { - thisderiv = derivatives[0][index] * cosstereo + sinstereo * derivatives[1][index]; + thisderiv = derivatives(0,index) * cosstereo + sinstereo * derivatives(1,index); } else { - thisderiv = derivatives[i][index]; + thisderiv = derivatives(i,index); } weightderiv[measno][index] = thisderiv / error[measno]; } @@ -5126,7 +5183,8 @@ public: } FitterStatusCode - GlobalChi2Fitter::runIteration(GXFTrajectory &trajectory, int it, TMatrixDSym &a, TVectorD &b, TDecompChol &lu, + GlobalChi2Fitter::runIteration(Cache& cache, + GXFTrajectory &trajectory, int it, TMatrixDSym &a, TVectorD &b, TDecompChol &lu, bool &doderiv) const { int measno = 0; int nfitpars = trajectory.numberOfFitParameters(); @@ -5142,9 +5200,9 @@ public: int nsihits = trajectory.numberOfSiliconHits(), ntrthits = trajectory.numberOfTRTHits(), nhits = trajectory.numberOfHits(); - if (m_phiweight.empty()) { + if (cache.m_phiweight.empty()) { // m_phiweight.resize(trajectory.numberOfScatterers()); - m_phiweight.assign(trajectory.trackStates().size(),1); + cache.m_phiweight.assign(trajectory.trackStates().size(),1); } // bool iscombined= (nsihits+ntrthits>0 && nsihits+ntrthits!=nhits); FitterStatusCode fsc = calculateTrackParameters(trajectory, doderiv); @@ -5152,7 +5210,7 @@ public: return fsc; } b.Zero(); - fillResiduals(trajectory, it, a, b, lu, doderiv); + fillResiduals(cache, trajectory, it, a, b, lu, doderiv); double newredchi2 = (trajectory.nDOF() > 0) ? trajectory.chi2() / trajectory.nDOF() : 0; @@ -5182,12 +5240,12 @@ public: fillDerivatives(trajectory, !doderiv); } - if (m_firstmeasurement.empty()) { - m_firstmeasurement.resize(nfitpars); - m_lastmeasurement.resize(nfitpars); + if (cache.m_firstmeasurement.empty()) { + cache.m_firstmeasurement.resize(nfitpars); + cache.m_lastmeasurement.resize(nfitpars); for (int i = 0; i < nperpars; i++) { - m_firstmeasurement[i] = 0; - m_lastmeasurement[i] = nmeas - nbrem; + cache.m_firstmeasurement[i] = 0; + cache.m_lastmeasurement[i] = nmeas - nbrem; } measno = 0; int scatno = 0, bremno = 0; @@ -5200,21 +5258,21 @@ public: if (meff) { if (meff->sigmaDeltaTheta() != 0 && (!trajectory.prefit() || meff->deltaE() == 0)) { if (i < nupstreamstates) { - m_lastmeasurement[nperpars + 2 * scatno] = m_lastmeasurement[nperpars + 2 * scatno + 1] = measno; - m_firstmeasurement[nperpars + 2 * scatno] = m_firstmeasurement[nperpars + 2 * scatno + 1] = 0; + cache.m_lastmeasurement[nperpars + 2 * scatno] = cache.m_lastmeasurement[nperpars + 2 * scatno + 1] = measno; + cache.m_firstmeasurement[nperpars + 2 * scatno] = cache.m_firstmeasurement[nperpars + 2 * scatno + 1] = 0; }else { - m_lastmeasurement[nperpars + 2 * scatno] = m_lastmeasurement[nperpars + 2 * scatno + 1] = nmeas - nbrem; - m_firstmeasurement[nperpars + 2 * scatno] = m_firstmeasurement[nperpars + 2 * scatno + 1] = measno; + cache.m_lastmeasurement[nperpars + 2 * scatno] = cache.m_lastmeasurement[nperpars + 2 * scatno + 1] = nmeas - nbrem; + cache.m_firstmeasurement[nperpars + 2 * scatno] = cache.m_firstmeasurement[nperpars + 2 * scatno + 1] = measno; } scatno++; } if (meff->sigmaDeltaE() > 0) { if (i < nupstreamstates) { - m_firstmeasurement[nperpars + scatpars + bremno] = 0; - m_lastmeasurement[nperpars + scatpars + bremno] = measno; + cache.m_firstmeasurement[nperpars + scatpars + bremno] = 0; + cache.m_lastmeasurement[nperpars + scatpars + bremno] = measno; }else { - m_firstmeasurement[nperpars + scatpars + bremno] = measno; - m_lastmeasurement[nperpars + scatpars + bremno] = nmeas - nbrem; + cache.m_firstmeasurement[nperpars + scatpars + bremno] = measno; + cache.m_lastmeasurement[nperpars + scatpars + bremno] = nmeas - nbrem; } bremno++; @@ -5227,8 +5285,8 @@ public: for (int k = 0; k < nfitpars; k++) { int minmeas = 0, maxmeas = nmeas - nbrem; - maxmeas = m_lastmeasurement[k]; - minmeas = m_firstmeasurement[k]; + maxmeas = cache.m_lastmeasurement[k]; + minmeas = cache.m_firstmeasurement[k]; for (measno = minmeas; measno < maxmeas; measno++) { double tmp = res[measno] * (1. / error[measno]) * weightderiv[measno][k]; @@ -5242,8 +5300,8 @@ public: } if (doderiv) { for (int l = k; l < nfitpars; l++) { - maxmeas = std::min(m_lastmeasurement[k], m_lastmeasurement[l]); - minmeas = std::max(m_firstmeasurement[k], m_firstmeasurement[l]); + maxmeas = std::min(cache.m_lastmeasurement[k], cache.m_lastmeasurement[l]); + minmeas = std::max(cache.m_firstmeasurement[k], cache.m_firstmeasurement[l]); double tmp = 0; for (measno = minmeas; measno < maxmeas; measno++) { tmp += weightderiv[measno][k] * weightderiv[measno][l]; @@ -5304,27 +5362,27 @@ public: if (!trajectory.prefit()) { // double phipull=std::abs(meff->deltaPhi()/meff->sigmaDeltaPhi()); if (thisstate->materialEffects()->sigmaDeltaPhi()!=0) { - if (scatno>=m_phiweight.size()) { + if (scatno>=cache.m_phiweight.size()) { std::stringstream message; - message << "scatno is out of range " << scatno << " !< " << m_phiweight.size(); + message << "scatno is out of range " << scatno << " !< " << cache.m_phiweight.size(); throw std::range_error(message.str()); } if (!doderiv) { - myarray[(2 * scatno + nperpars) * nfitpars + 2 * scatno + nperpars] /= m_phiweight[scatno]; + myarray[(2 * scatno + nperpars) * nfitpars + 2 * scatno + nperpars] /= cache.m_phiweight[scatno]; } if (it == 0) { - m_phiweight[scatno] = 1.00000001; + cache.m_phiweight[scatno] = 1.00000001; } else if (it == 1) { - m_phiweight[scatno] = 1.0000001; + cache.m_phiweight[scatno] = 1.0000001; } else if (it <= 3) { - m_phiweight[scatno] = 1.0001; + cache.m_phiweight[scatno] = 1.0001; } else if (it <= 6) { - m_phiweight[scatno] = 1.01; + cache.m_phiweight[scatno] = 1.01; } else { - m_phiweight[scatno] = 1.1; + cache.m_phiweight[scatno] = 1.1; } - myarray[(2 * scatno + nperpars) * nfitpars + 2 * scatno + nperpars] *= m_phiweight[scatno]; + myarray[(2 * scatno + nperpars) * nfitpars + 2 * scatno + nperpars] *= cache.m_phiweight[scatno]; } } // else if (trajectory.prefit()==1) myarray[(2*scatno+nperpars)*nfitpars+2*scatno+nperpars]*=99; @@ -5364,10 +5422,8 @@ public: if (m_printderivs) { for (measno = 0; measno < nmeas; measno++) { for (int k = 0; k < nfitpars; k++) { - if (msgLvl(MSG::VERBOSE)) { - msg(MSG::VERBOSE) << "deriv[" << measno << "][" << k << "]=" << weightderiv[measno][k] * error[measno] << - " error: " << error[measno] << endmsg; - } + ATH_MSG_VERBOSE( "deriv[" << measno << "][" << k << "]=" << weightderiv[measno][k] * error[measno] << + " error: " << error[measno] ); } } } @@ -5381,15 +5437,15 @@ public: GXFTrackState *thisstate = trajectory.trackStates()[i]; //if (thisstate->materialEffects()) { if (thisstate->materialEffects() && thisstate->materialEffects()->sigmaDeltaPhi()!=0){ - if (scatno>=m_phiweight.size()) { + if (scatno>=cache.m_phiweight.size()) { std::stringstream message; - message << "scatno is out of range " << scatno << " !< " << m_phiweight.size(); + message << "scatno is out of range " << scatno << " !< " << cache.m_phiweight.size(); throw std::range_error(message.str()); } const PlaneSurface *plsurf = dynamic_cast<const PlaneSurface *>(thisstate->surface()); if (thisstate->materialEffects()->deltaE() == 0 || plsurf) { - myarray[(2 * scatno + nperpars) * nfitpars + 2 * scatno + nperpars] /= m_phiweight[scatno]; - m_phiweight[scatno] = 1; + myarray[(2 * scatno + nperpars) * nfitpars + 2 * scatno + nperpars] /= cache.m_phiweight[scatno]; + cache.m_phiweight[scatno] = 1; } if (thisstate->materialEffects()->sigmaDeltaPhi() != 0) { scatno++; @@ -5412,9 +5468,7 @@ public: FitterStatusCode GlobalChi2Fitter::updateFitParameters(GXFTrajectory &trajectory, TVectorD &b, TDecompChol &lu) const { - if (msgLvl(MSG::DEBUG)) { - msg(MSG::DEBUG) << "UpdateFitParameters" << endmsg; - } + ATH_MSG_DEBUG( "UpdateFitParameters" ); const TrackParameters *refpar = trajectory.referenceParameters(); double d0 = refpar->parameters()[Trk::d0]; @@ -5440,17 +5494,13 @@ public: z0 += result[1]; phi += result[2]; theta += result[3]; - qoverp = (m_straightline) ? 0 : .001 * result[4] + qoverp; + qoverp = (trajectory.m_straightline) ? 0 : .001 * result[4] + qoverp; } if (!correctAngles(phi, theta)) { - if (msgLvl(MSG::DEBUG)) { - msg(MSG::DEBUG) << "angles out of range: " << theta << " " << phi << endmsg; - } + ATH_MSG_DEBUG( "angles out of range: " << theta << " " << phi ); - if (msgLvl(MSG::DEBUG)) { - msg(MSG::DEBUG) << "Fit failed" << endmsg; - } + ATH_MSG_DEBUG( "Fit failed" ); return FitterStatusCode::InvalidAngles; } @@ -5473,11 +5523,13 @@ public: delta_ps[i] += result[nperparams + 2 * nscat + i]; } - const TrackParameters *newper = trajectory.referenceParameters()->associatedSurface().createTrackParameters(d0, z0, - phi, - theta, - qoverp, - 0); + const TrackParameters *newper + = trajectory.referenceParameters()->associatedSurface().createTrackParameters(d0, + z0, + phi, + theta, + qoverp, + 0); trajectory.setReferenceParameters(newper); trajectory.setScatteringAngles(scatangles); trajectory.setBrems(delta_ps); @@ -5519,7 +5571,8 @@ public: } void - GlobalChi2Fitter::runTrackCleanerTRT(GXFTrajectory &trajectory, TMatrixDSym &a, TVectorD &b, TDecompChol &lu, + GlobalChi2Fitter::runTrackCleanerTRT(Cache& cache, + GXFTrajectory &trajectory, TMatrixDSym &a, TVectorD &b, TDecompChol &lu, bool runOutlier, bool trtrecal, int it) const { double scalefactor = m_scalefactor; @@ -5611,9 +5664,9 @@ public: b[i] -= weightderiv[measno][i] * (oldres / olderror - (newres * olderror) / (newerror * newerror)); for (int j = i; j < nfitpars; j++) { double weight = 1; - if (!m_phiweight.empty() && i == j && i >= nperpars && i < nperpars + 2 * nscats && + if (!cache.m_phiweight.empty() && i == j && i >= nperpars && i < nperpars + 2 * nscats && (i - nperpars) % 2 == 0) { - weight = m_phiweight[(i - nperpars) / 2]; + weight = cache.m_phiweight[(i - nperpars) / 2]; } // std::cout << "weight: " << weight << std::endl; myarray[j * nfitpars + i] += weightderiv[measno][i] * weightderiv[measno][j] * @@ -5638,7 +5691,7 @@ public: } } if (trajectory.nDOF() < 0) { - m_fittercode = FitterStatusCode::OutlierLogicFailure; + cache.m_fittercode = FitterStatusCode::OutlierLogicFailure; m_notenoughmeas++; } if (outlierremoved || hitrecalibrated) { @@ -5648,7 +5701,7 @@ public: // runIteration(trajectory,it,a,b,lu,doderiv); - m_miniter = it + 2; + cache.m_miniter = it + 2; /* if (trajectory.converged()) { FitterStatusCode fsc=updateFitParameters(trajectory,b,lu); if (fsc!=FitterStatusCode::Success) { @@ -5660,7 +5713,8 @@ public: } void - GlobalChi2Fitter::runTrackCleanerMDT(GXFTrajectory &trajectory, TMatrixDSym &a, TMatrixDSym &fullcov, TVectorD &b, + GlobalChi2Fitter::runTrackCleanerMDT(Cache& cache, + GXFTrajectory &trajectory, TMatrixDSym &a, TMatrixDSym &fullcov, TVectorD &b, TDecompChol &lu) const { std::vector<GXFTrackState *> &states = trajectory.trackStates(); double *myarray = a.GetMatrixArray(); @@ -5804,30 +5858,28 @@ public: trajectory.setConverged(false); bool doderiv = m_redoderivs; lu.SetMatrix(a); - m_fittercode = updateFitParameters(trajectory, b, lu); - if (m_fittercode != FitterStatusCode::Success) { + cache.m_fittercode = updateFitParameters(trajectory, b, lu); + if (cache.m_fittercode != FitterStatusCode::Success) { m_notenoughmeas++; return; } for (int it = 1; it < m_maxit; it++) { if (it == m_maxit - 1) { - if (msgLvl(MSG::DEBUG)) { - msg(MSG::DEBUG) << "Fit did not converge" << endmsg; - } - m_fittercode = FitterStatusCode::NoConvergence; + ATH_MSG_DEBUG("Fit did not converge"); + cache.m_fittercode = FitterStatusCode::NoConvergence; m_notconverge++; return; } if (!trajectory.converged()) { - m_fittercode = runIteration(trajectory, it, a, b, lu, doderiv); - if (m_fittercode != FitterStatusCode::Success) { + cache.m_fittercode = runIteration(cache, trajectory, it, a, b, lu, doderiv); + if (cache.m_fittercode != FitterStatusCode::Success) { m_notenoughmeas++; return; } if (!trajectory.converged()) { - m_fittercode = updateFitParameters(trajectory, b, lu); - if (m_fittercode != FitterStatusCode::Success) { + cache.m_fittercode = updateFitParameters(trajectory, b, lu); + if (cache.m_fittercode != FitterStatusCode::Success) { m_notenoughmeas++; return; } @@ -5835,11 +5887,9 @@ public: }else { bool invok = lu.Invert(fullcov); if (!invok) { - if (msgLvl(MSG::DEBUG)) { - msg(MSG::DEBUG) << "matrix inversion failed!" << endmsg; - } + ATH_MSG_DEBUG("matrix inversion failed!"); m_matrixinvfailed++; - m_fittercode = FitterStatusCode::MatrixInversionFailure; + cache.m_fittercode = FitterStatusCode::MatrixInversionFailure; return; } calculateTrackErrors(trajectory, fullcov, true); @@ -5853,7 +5903,11 @@ public: } GXFTrajectory * - GlobalChi2Fitter::runTrackCleanerSilicon(GXFTrajectory &trajectory, TMatrixDSym &a, TMatrixDSym &fullcov, TVectorD &b, + GlobalChi2Fitter::runTrackCleanerSilicon(Cache& cache, + GXFTrajectory &trajectory, + TMatrixDSym &a, + TMatrixDSym &fullcov, + TVectorD &b, bool runoutlier) const { bool trackok = false; GXFTrajectory *oldtrajectory = &trajectory; @@ -5988,7 +6042,7 @@ public: double newsinstereo = 0; if (prd && !state_maxsipull->isRecalibrated() && maxpull > 2.5 && - oldtrajectory->chi2() / trajectory.nDOF() > .3 * m_chi2cut && m_sirecal) { + oldtrajectory->chi2() / trajectory.nDOF() > .3 * m_chi2cut && cache.m_sirecal) { broadrot.reset(m_broadROTcreator->correct(*prd, *trackparForCorrect)); } if (broadrot) { @@ -6159,30 +6213,28 @@ public: newtrajectory->setConverged(false); bool doderiv = m_redoderivs; newlu.SetMatrix(*newap); - m_fittercode = updateFitParameters(*newtrajectory, *newbp, newlu); - if (m_fittercode != FitterStatusCode::Success) { + cache.m_fittercode = updateFitParameters(*newtrajectory, *newbp, newlu); + if (cache.m_fittercode != FitterStatusCode::Success) { m_notenoughmeas++; return 0; } for (int it = 0; it < m_maxit; it++) { if (it == m_maxit - 1) { - if (msgLvl(MSG::DEBUG)) { - msg(MSG::DEBUG) << "Fit did not converge" << endmsg; - } - m_fittercode = FitterStatusCode::NoConvergence; + ATH_MSG_DEBUG("Fit did not converge"); + cache.m_fittercode = FitterStatusCode::NoConvergence; m_notconverge++; return 0; } if (!newtrajectory->converged()) { - m_fittercode = runIteration(*newtrajectory, it, *newap, *newbp, newlu, doderiv); - if (m_fittercode != FitterStatusCode::Success) { + cache.m_fittercode = runIteration(cache, *newtrajectory, it, *newap, *newbp, newlu, doderiv); + if (cache.m_fittercode != FitterStatusCode::Success) { m_notenoughmeas++; return 0; } if (!newtrajectory->converged()) { - m_fittercode = updateFitParameters(*newtrajectory, *newbp, newlu); - if (m_fittercode != FitterStatusCode::Success) { + cache.m_fittercode = updateFitParameters(*newtrajectory, *newbp, newlu); + if (cache.m_fittercode != FitterStatusCode::Success) { m_notenoughmeas++; return 0; @@ -6199,11 +6251,9 @@ public: } } if (newchi2 > oldchi2 || (newchi2 > oldchi2 - mindiff && newchi2 > .33 * oldchi2)) { - if (msgLvl(MSG::DEBUG)) { - msg(MSG::DEBUG) << "Outlier not confirmed, keeping old trajectory" << endmsg; - } + ATH_MSG_DEBUG("Outlier not confirmed, keeping old trajectory"); if (oldchi2 > m_chi2cut) { - m_fittercode = FitterStatusCode::OutlierLogicFailure; + cache.m_fittercode = FitterStatusCode::OutlierLogicFailure; m_notenoughmeas++; return 0; } @@ -6233,11 +6283,9 @@ public: // bool ok=newlu.Invert(fullcov); if (ok) { - if (msgLvl(MSG::DEBUG)) { - msg(MSG::DEBUG) << "matrix inversion failed!" << endmsg; - } + ATH_MSG_DEBUG( "matrix inversion failed!" ); m_matrixinvfailed++; - m_fittercode = FitterStatusCode::MatrixInversionFailure; + cache.m_fittercode = FitterStatusCode::MatrixInversionFailure; return 0; } break; @@ -6249,7 +6297,7 @@ public: } } if (oldtrajectory->nDOF() > 0 && oldtrajectory->chi2() / oldtrajectory->nDOF() > m_chi2cut && runoutlier) { - m_fittercode = FitterStatusCode::OutlierLogicFailure; + cache.m_fittercode = FitterStatusCode::OutlierLogicFailure; m_notenoughmeas++; return 0; } @@ -6327,7 +6375,7 @@ public: } Track * - GlobalChi2Fitter::makeTrack(GXFTrajectory &oldtrajectory, ParticleHypothesis matEffects) const { + GlobalChi2Fitter::makeTrack(Cache& cache, GXFTrajectory &oldtrajectory, ParticleHypothesis matEffects) const { // // Convert internal trajectory into track // @@ -6347,9 +6395,9 @@ public: nrealmeas += states[hitno]->numberOfMeasuredParameters(); } } - delete m_derivmat; - m_derivmat = new Amg::MatrixX(nrealmeas, oldtrajectory.numberOfFitParameters()); - m_derivmat->setZero(); + delete cache.m_derivmat; + cache.m_derivmat = new Amg::MatrixX(nrealmeas, oldtrajectory.numberOfFitParameters()); + cache.m_derivmat->setZero(); int measindex = 0, measindex2 = 0; int nperpars = oldtrajectory.numberOfPerigeeParameters(); int nscat = oldtrajectory.numberOfScatterers(); @@ -6359,9 +6407,9 @@ public: dynamic_cast<const CompetingRIOsOnTrack *>(states[hitno]->measurement()))) { for (int i = measindex; i < measindex + states[hitno]->numberOfMeasuredParameters(); i++) { for (int j = 0; j < oldtrajectory.numberOfFitParameters(); j++) { - (*m_derivmat)(i, j) = derivs[measindex2][j] * errors[measindex2]; - if ((j == 4 && !m_straightline) || j >= nperpars + 2 * nscat) { - (*m_derivmat)(i, j) *= 1000; + (*cache.m_derivmat)(i, j) = derivs[measindex2][j] * errors[measindex2]; + if ((j == 4 && !oldtrajectory.m_straightline) || j >= nperpars + 2 * nscat) { + (*cache.m_derivmat)(i, j) *= 1000; } } measindex2++; @@ -6408,7 +6456,7 @@ public: info.setTrackProperties(TrackInfo::BremFitSuccessful); } } - if (m_straightline) { + if (oldtrajectory.m_straightline) { info.setTrackProperties(TrackInfo::StraightTrack); } @@ -6416,7 +6464,7 @@ public: throw std::logic_error("no first measurement."); } const TrackParameters *per = 0; - if (m_acceleration && !m_matupdator.empty()) { + if (cache.m_acceleration && !m_matupdator.empty()) { const TrackParameters *prevpar = firstmeasstate->trackParameters(); const TrackParameters *tmppar = firstmeasstate->trackParameters(); std::vector<std::pair<const Layer *, const Layer *> > &upstreamlayers = oldtrajectory.upstreamMaterialLayers(); @@ -6448,7 +6496,7 @@ public: } const TrackParameters *layerpar = m_propagator->propagate(*prevpar, - layer->surfaceRepresentation(), propdir, true, *m_fieldprop, + layer->surfaceRepresentation(), propdir, true, *oldtrajectory.m_fieldprop, nonInteracting); if (!layerpar) { continue; @@ -6507,7 +6555,7 @@ public: } if (prevpar) { per = m_propagator->propagate(*prevpar, PerigeeSurface(Amg::Vector3D(0, 0, - 0)), oppositeMomentum, false, *m_fieldprop, + 0)), oppositeMomentum, false, *oldtrajectory.m_fieldprop, nonInteracting); } // std::cout << "prevpar: " << prevpar << " per: " << per << std::endl; @@ -6520,7 +6568,7 @@ public: if (msgLvl(MSG::DEBUG)) { msg(MSG::DEBUG) << "Failed to extrapolate to perigee, returning 0" << endmsg; } - m_fittercode = FitterStatusCode::ExtrapolationFailure; + cache.m_fittercode = FitterStatusCode::ExtrapolationFailure; m_propfailed++; return 0; @@ -6529,7 +6577,7 @@ public: // @TODO Coverity complains about a possible NULL pointer dereferencing in firstmeasstate->... // now an exception is thrown if firstmeasstate is null. But does the code allow for firstmeasstate to // be null ? - else if (m_acceleration && firstmeasstate->trackParameters()) { + else if (cache.m_acceleration && firstmeasstate->trackParameters()) { per = m_extrapolator->extrapolate(*firstmeasstate->trackParameters(), PerigeeSurface(Amg::Vector3D(0, 0, 0)), oppositeMomentum, false, matEffects); @@ -6543,7 +6591,7 @@ public: if (msgLvl(MSG::DEBUG)) { msg(MSG::DEBUG) << "Final perigee: " << *per << " pos: " << per->position() << " pT: " << per->pT() << endmsg; } - if (!m_acceleration) { + if (!cache.m_acceleration) { trajectory->insert(trajectory->begin() + oldtrajectory.numberOfUpstreamStates(), pertsos); } else { trajectory->insert(trajectory->begin(), pertsos); @@ -6553,20 +6601,22 @@ public: return track; } - +/*****************************************************/ +/*****************************************************/ GlobalChi2Fitter::~GlobalChi2Fitter() { delete m_fieldpropnofield; delete m_fieldpropfullfield; } +/*****************************************************/ +/*****************************************************/ FitterStatusCode GlobalChi2Fitter::calculateTrackParameters(GXFTrajectory &trajectory, bool calcderiv) const { // // Loop over states, calculate track parameters and (optionally) jacobian at each state // - if (msgLvl(MSG::DEBUG)) { - msg(MSG::DEBUG) << "CalculateTrackParameters" << endmsg; - } + + ATH_MSG_DEBUG("CalculateTrackParameters"); std::vector<GXFTrackState *> &states = trajectory.trackStates(); int nstatesupstream = trajectory.numberOfUpstreamStates(); @@ -6598,10 +6648,10 @@ public: // if (states[hitno]->trackStateType()==TrackState::Scatterer || // states[hitno]->trackStateType()==TrackState::Brem) curvpar=true; if (calcderiv && !m_numderiv) { - currenttrackpar = m_propagator->propagateParameters(*prevtrackpar, *surf, propdir, false, *m_fieldprop, jac, + currenttrackpar = m_propagator->propagateParameters(*prevtrackpar, *surf, propdir, false, *trajectory.m_fieldprop, jac, Trk::nonInteracting, curvpar); } else { - currenttrackpar = m_propagator->propagateParameters(*prevtrackpar, *surf, propdir, false, *m_fieldprop, + currenttrackpar = m_propagator->propagateParameters(*prevtrackpar, *surf, propdir, false, *trajectory.m_fieldprop, Trk::nonInteracting, curvpar); } @@ -6612,17 +6662,17 @@ public: } propdir = ((propdir == Trk::oppositeMomentum) ? Trk::alongMomentum : Trk::oppositeMomentum); if (calcderiv && !m_numderiv) { - currenttrackpar = m_propagator->propagateParameters(*prevtrackpar, *surf, propdir, false, *m_fieldprop, jac, + currenttrackpar = m_propagator->propagateParameters(*prevtrackpar, *surf, propdir, false, *trajectory.m_fieldprop, jac, Trk::nonInteracting, curvpar); } else { - currenttrackpar = m_propagator->propagateParameters(*prevtrackpar, *surf, propdir, false, *m_fieldprop, + currenttrackpar = m_propagator->propagateParameters(*prevtrackpar, *surf, propdir, false, *trajectory.m_fieldprop, Trk::nonInteracting, curvpar); } } if (currenttrackpar && m_numderiv && calcderiv) { delete jac; - jac = numericalDerivatives(prevtrackpar, surf, propdir); + jac = numericalDerivatives(prevtrackpar, surf, propdir, trajectory.m_fieldprop); } if (propdir == Trk::alongMomentum && currenttrackpar && msgLvl(MSG::DEBUG) && @@ -6659,7 +6709,7 @@ public: if (jac) { if (states[hitno]->materialEffects() && states[hitno]->materialEffects()->deltaE() != 0) { - if (states[hitno]->materialEffects()->sigmaDeltaE() <= 0 && !m_straightline) { + if (states[hitno]->materialEffects()->sigmaDeltaE() <= 0 && !trajectory.m_straightline) { double p = 1 / std::abs(currenttrackpar->parameters()[Trk::qOverP]); double de = std::abs(states[hitno]->materialEffects()->deltaE()); double mass = trajectory.mass(); @@ -6733,10 +6783,10 @@ public: // if (states[hitno]->trackStateType()==TrackState::Scatterer || // states[hitno]->trackStateType()==TrackState::Brem) curvpar=true; if (calcderiv && !m_numderiv) { - currenttrackpar = m_propagator->propagateParameters(*prevtrackpar, *surf, propdir, false, *m_fieldprop, jac, + currenttrackpar = m_propagator->propagateParameters(*prevtrackpar, *surf, propdir, false, *trajectory.m_fieldprop, jac, Trk::nonInteracting, curvpar); } else { - currenttrackpar = m_propagator->propagateParameters(*prevtrackpar, *surf, propdir, false, *m_fieldprop, + currenttrackpar = m_propagator->propagateParameters(*prevtrackpar, *surf, propdir, false, *trajectory.m_fieldprop, Trk::nonInteracting, curvpar); } @@ -6747,16 +6797,16 @@ public: jac = 0; } if (calcderiv && !m_numderiv) { - currenttrackpar = m_propagator->propagateParameters(*prevtrackpar, *surf, propdir, false, *m_fieldprop, jac, + currenttrackpar = m_propagator->propagateParameters(*prevtrackpar, *surf, propdir, false, *trajectory.m_fieldprop, jac, Trk::nonInteracting, curvpar); } else { - currenttrackpar = m_propagator->propagateParameters(*prevtrackpar, *surf, propdir, false, *m_fieldprop, + currenttrackpar = m_propagator->propagateParameters(*prevtrackpar, *surf, propdir, false, *trajectory.m_fieldprop, Trk::nonInteracting, curvpar); } } if (currenttrackpar && m_numderiv && calcderiv) { delete jac; - jac = numericalDerivatives(prevtrackpar, surf, propdir); + jac = numericalDerivatives(prevtrackpar, surf, propdir, trajectory.m_fieldprop); } if (currenttrackpar && propdir == Trk::oppositeMomentum && msgLvl(MSG::DEBUG) && @@ -6782,7 +6832,7 @@ public: if (jac) { if (states[hitno]->materialEffects() && states[hitno]->materialEffects()->deltaE() != 0) { - if (states[hitno]->materialEffects()->sigmaDeltaE() <= 0 && !m_straightline) { + if (states[hitno]->materialEffects()->sigmaDeltaE() <= 0 && !trajectory.m_straightline) { double p = 1 / std::abs(currenttrackpar->parameters()[Trk::qOverP]); double de = std::abs(states[hitno]->materialEffects()->deltaE()); // double de=states[hitno]->materialEffects()->deltaE(); @@ -6869,14 +6919,14 @@ public: return FitterStatusCode::Success; } +/*****************************************************/ +/*****************************************************/ void GlobalChi2Fitter::calculateDerivatives(GXFTrajectory &trajectory) const { // // Loop over states, calculate derivatives of local track parameters w.r.t. fit parameters // - if (msgLvl(MSG::DEBUG)) { - msg(MSG::DEBUG) << "CalculateDerivatives" << endmsg; - } + ATH_MSG_DEBUG("CalculateDerivatives"); std::vector<GXFTrackState *> &states = trajectory.trackStates(); int scatno = trajectory.numberOfUpstreamScatterers() - 1; @@ -6968,10 +7018,10 @@ public: jacscat[scatindex](4, 4) = jac[4][4] * jacscat[scatindex](4, 4); } if (fillderivmat) { - HepMatrix &derivmat = state->derivatives(); + Amg::MatrixX &derivmat = state->derivatives(); for (int i = 0; i < 4; i++) { - derivmat[i][nperpars + 2 * scatindex] = -jacscat[scatindex](i, 2); - derivmat[i][nperpars + 2 * scatindex + 1] = -jacscat[scatindex](i, 3); + derivmat(i,nperpars + 2 * scatindex) = -jacscat[scatindex](i, 2); + derivmat(i,nperpars + 2 * scatindex + 1) = -jacscat[scatindex](i, 3); } } } @@ -7003,12 +7053,12 @@ public: state->materialEffects()->momentumJacobians()[bremindex+1]=jacbrem[bremindex](4,4)*ploc*ploc/(jac[4][4]*pbrem[bremindex]*pbrem[bremindex]); } */ if (fillderivmat) { - HepMatrix &derivmat = state->derivatives(); + Amg::MatrixX &derivmat = state->derivatives(); // double p=pbrem[bremindex]; // for (int i=0;i<5;i++) // derivmat[i][nperpars+2*nscats+bremindex]=0.001*jacbrem[bremindex](i,4)*(sign/(p*p)); for (int i = 0; i < 5; i++) { - derivmat[i][nperpars + 2 * nscats + bremindex] = -0.001 * jacbrem[bremindex](i, 4); + derivmat(i,nperpars + 2 * nscats + bremindex) = -0.001 * jacbrem[bremindex](i, 4); } } } @@ -7033,17 +7083,17 @@ public: state->materialEffects()->momentumJacobians()[0]=jacvertex(4,4)/jac[4][4]; } */ if (fillderivmat) { - HepMatrix &derivmat = state->derivatives(); + Amg::MatrixX &derivmat = state->derivatives(); for (int i = 0; i < 4; i++) { for (int j = 0; j < nperpars; j++) { - derivmat[i][j] = jacvertex(i, j); + derivmat(i,j) = jacvertex(i, j); } if (nperpars == 5) { - derivmat[i][4] *= .001; + derivmat(i,4) *= .001; } } if (nperpars == 5) { - derivmat[4][4] = .001 * jacvertex(4, 4); + derivmat(4,4) = .001 * jacvertex(4, 4); } } @@ -7127,10 +7177,10 @@ public: jacscat[scatindex](4, 4) = jacscat[scatindex](4, 4) * jac[4][4]; } if (fillderivmat) { - HepMatrix &derivmat = state->derivatives(); + Amg::MatrixX &derivmat = state->derivatives(); for (int i = 0; i <= imax; i++) { - derivmat[i][nperpars + 2 * scatindex] = jacscat[scatindex](i, 2); - derivmat[i][nperpars + 2 * scatindex + 1] = jacscat[scatindex](i, 3); + derivmat(i,nperpars + 2 * scatindex) = jacscat[scatindex](i, 2); + derivmat(i,nperpars + 2 * scatindex + 1) = jacscat[scatindex](i, 3); } } } @@ -7164,11 +7214,11 @@ public: } */ if (fillderivmat) { - HepMatrix &derivmat = state->derivatives(); + Amg::MatrixX &derivmat = state->derivatives(); // double p=pbrem[bremindex]; for (int i = 0; i <= 4; i++) { // derivmat[i][nperpars+2*nscats+bremindex]=.001*jacbrem[bremindex](i,4)*(-sign/(p*p)); - derivmat[i][nperpars + 2 * nscats + bremindex] = .001 * jacbrem[bremindex](i, 4); + derivmat(i,nperpars + 2 * nscats + bremindex) = .001 * jacbrem[bremindex](i, 4); } } } @@ -7193,17 +7243,17 @@ public: } */ if (fillderivmat) { - HepMatrix &derivmat = state->derivatives(); + Amg::MatrixX &derivmat = state->derivatives(); for (int i = 0; i <= imax; i++) { for (int j = 0; j < nperpars; j++) { - derivmat[i][j] = jacvertex(i, j); + derivmat(i,j) = jacvertex(i, j); } if (nperpars == 5) { - derivmat[i][4] *= .001; + derivmat(i,4) *= .001; } } if (nperpars == 5) { - derivmat[4][4] = 0.001 * jacvertex(4, 4); + derivmat(4,4) = 0.001 * jacvertex(4, 4); } } @@ -7218,7 +7268,8 @@ public: prevstate = states[hitno]; } } - +/*****************************************************/ +/*****************************************************/ void GlobalChi2Fitter::calculateTrackErrors(GXFTrajectory &trajectory, TMatrixDSym &fullcovmat, bool onlylocal) const { // @@ -7299,7 +7350,7 @@ public: AmgSymMatrix(5) &prevcov = *states[indices[stateno - 1]]->trackCovariance(); errors1(jac, prevcov, trackerrmat, onlylocal); }else { - int maxl = m_straightline ? 3 : 4; + int maxl = trajectory.m_straightline ? 3 : 4; int minm[5] = { 0, 0, 0, 0, 0 }; @@ -7314,7 +7365,7 @@ public: minm[1] = 1; } } - HepMatrix &derivatives = state->derivatives(); + Amg::MatrixX &derivatives = state->derivatives(); // Only consider scatterers and brems which give non-zero derivatives int scatmin = (scatno < nscatupstream) ? scatno : nscatupstream; int scatmax = (scatno < nscatupstream) ? nscatupstream : scatno; @@ -7332,7 +7383,7 @@ public: rowindices[i].push_back(j); } } - if (!m_straightline) { + if (!trajectory.m_straightline) { rowindices[4].clear(); rowindices[4].push_back(4); for (int j = nperpars + 2 * nscats + bremmin; j < nperpars + 2 * nscats + bremmax; j++) { @@ -7378,7 +7429,7 @@ public: trackerrmat(i, j) = meascov(indices[i], indices[j]); } } - if (m_straightline) { + if (trajectory.m_straightline) { trackerrmat(4, 4) = 1e-20; } @@ -7405,10 +7456,12 @@ public: hitno++; } } +/*****************************************************/ +/*****************************************************/ TransportJacobian * GlobalChi2Fitter::numericalDerivatives(const TrackParameters *prevpar, const Surface *surf, - PropDirection propdir) const { + PropDirection propdir, const MagneticFieldProperties* fieldprop) const { ParamDefsAccessor paraccessor; double J[25] = { 1, 0, 0, 0, 0, @@ -7472,16 +7525,16 @@ public: vecminuseps[3], vecminuseps[4], 0); const TrackParameters *newparpluseps = m_propagator->propagateParameters(*parpluseps, *surf, propdir, false, - *m_fieldprop, Trk::nonInteracting); + *fieldprop, Trk::nonInteracting); const TrackParameters *newparminuseps = m_propagator->propagateParameters(*parminuseps, *surf, propdir, false, - *m_fieldprop, Trk::nonInteracting); + *fieldprop, Trk::nonInteracting); PropDirection propdir2 = (propdir == Trk::alongMomentum) ? Trk::oppositeMomentum : Trk::alongMomentum; if (!newparpluseps) { - newparpluseps = m_propagator->propagateParameters(*parpluseps, *surf, propdir2, false, *m_fieldprop, + newparpluseps = m_propagator->propagateParameters(*parpluseps, *surf, propdir2, false, *fieldprop, Trk::nonInteracting); } if (!newparminuseps) { - newparminuseps = m_propagator->propagateParameters(*parminuseps, *surf, propdir2, false, *m_fieldprop, + newparminuseps = m_propagator->propagateParameters(*parminuseps, *surf, propdir2, false, *fieldprop, Trk::nonInteracting); } delete parpluseps; @@ -7533,12 +7586,12 @@ public: int GlobalChi2Fitter::iterationsOfLastFit() const { - return m_lastiter; + return 0; } void - GlobalChi2Fitter::setMinIterations(int iter) { - m_miniter = iter; + GlobalChi2Fitter::setMinIterations(int) { + ATH_MSG_WARNING("Configure the minimum number of Iterations via jobOptions"); } bool @@ -7605,7 +7658,7 @@ public: } void - GlobalChi2Fitter::errors2(HepMatrix &derivatives, AmgSymMatrix(5) &trackerrmat, double *myarray, + GlobalChi2Fitter::errors2(Amg::MatrixX &derivatives, AmgSymMatrix(5) &trackerrmat, double *myarray, std::vector<int> *rowindices, int &maxl, int *minm, bool onlylocal, int nfitpars) const { // Project global error matrix onto current state @@ -7623,7 +7676,7 @@ public: rowindex = j * nfitpars; for (int k2 = 0; k2 < (int) rowindices[m].size(); k2++) { k = rowindices[m][k2]; - tmp3 += derivatives[l][j] * myarray[rowindex + k] * derivatives[m][k]; + tmp3 += derivatives(l,j) * myarray[rowindex + k] * derivatives(m,k); } } trackerrmat(l, m) = trackerrmat(m, l) = tmp3; @@ -7638,17 +7691,24 @@ public: rowindex = j * nfitpars; for (int k2 = 0; k2 < j2; k2++) { k = rowindices[l][k2]; - tmp3 += 2 * derivatives[l][j] * myarray[rowindex + k] * derivatives[l][k]; + tmp3 += 2 * derivatives(l,j) * myarray[rowindex + k] * derivatives(l,k); } - tmp3 += derivatives[l][j] * myarray[rowindex + j] * derivatives[l][j]; + tmp3 += derivatives(l,j) * myarray[rowindex + j] * derivatives(l,j); } trackerrmat(l, l) = tmp3; } // std::cout << " error2 " << Amg::toString(trackerrmat,10) << std::endl; } - void - GlobalChi2Fitter::cleanup() const { + + void GlobalChi2Fitter::Cache::cleanup() + { + if(m_derivmat) + delete m_derivmat; + + if(m_fullcovmat) + delete m_fullcovmat; + if (!m_calomeots.empty()) { m_calomeots.clear(); } @@ -7687,4 +7747,5 @@ public: m_matvec.clear(); } } + } diff --git a/Tracking/TrkFitter/TrkiPatFitter/TrkiPatFitter/iPatGlobalFitter.h b/Tracking/TrkFitter/TrkiPatFitter/TrkiPatFitter/iPatGlobalFitter.h index 633e36f61261e75bd2769af1afb1e4d39f93a0e5..62b7cb7c944e90a493afec0c7a4b62366ec4542c 100755 --- a/Tracking/TrkFitter/TrkiPatFitter/TrkiPatFitter/iPatGlobalFitter.h +++ b/Tracking/TrkFitter/TrkiPatFitter/TrkiPatFitter/iPatGlobalFitter.h @@ -20,30 +20,37 @@ //<<<<<< CLASS DECLARATIONS >>>>>> namespace Trk -{ - +{ + /** GlobalTrackFitter tool providing methods used during alignment */ - + class iPatGlobalFitter: public iPatFitter, virtual public IGlobalTrackFitter { public: - iPatGlobalFitter (const std::string& type, + iPatGlobalFitter (const std::string& type, const std::string& name, const IInterface* parent); ~iPatGlobalFitter (void); // destructor + Track* alignmentFit ( AlignmentCache&, + const Track&, + const RunOutlierRemoval runOutlier=false, + const ParticleHypothesis matEffects=Trk::nonInteracting) const; + + +private: /** GlobalTrackFitter methods: - access to the matrix of derivatives used during the latest track fit */ + access to the matrix of derivatives used during the latest track fit */ Amg::MatrixX* DerivMatrix() const; - + /** access to the global fitter's full covariance matrix */ Amg::MatrixX* FullCovarianceMatrix() const; - + /** access to the number of iterations taken by the latest track fit */ int iterationsOfLastFit() const; -private: + /** set method for the minimum number of iterations for (alignment) friend */ void setMinIterations (int minIterations); @@ -52,7 +59,7 @@ private: // cached data mutable Amg::MatrixX* m_derivativeMatrix; - + }; } // end of namespace diff --git a/Tracking/TrkFitter/TrkiPatFitter/src/MaterialAllocator.cxx b/Tracking/TrkFitter/TrkiPatFitter/src/MaterialAllocator.cxx old mode 100644 new mode 100755 index 81bd2e175ef7d8cfaf21d08705961734dd046d3e..b0b889e3907d1d607d7d07941d4a4481ab4b6150 --- a/Tracking/TrkFitter/TrkiPatFitter/src/MaterialAllocator.cxx +++ b/Tracking/TrkFitter/TrkiPatFitter/src/MaterialAllocator.cxx @@ -1,11 +1,11 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration -*/ + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + */ /*************************************************************************** - least squared fit to track hit data => PerigeeParameters with covariance - and fit quality. - ***************************************************************************/ + least squared fit to track hit data => PerigeeParameters with covariance + and fit quality. +***************************************************************************/ #include <cmath> #include <iomanip> @@ -34,1020 +34,899 @@ #include "TrkiPatFitterUtils/MessageHelper.h" namespace Trk -{ - -MaterialAllocator::MaterialAllocator (const std::string& type, - const std::string& name, - const IInterface* parent) - : AthAlgTool (type, name, parent), - m_extrapolator ("Trk::Extrapolator/AtlasExtrapolator"), - m_intersector ("Trk::RungeKuttaIntersector/RungeKuttaIntersector"), - m_spectrometerExtrapolator ("Trk::Extrapolator/AtlasExtrapolator"), - m_trackingGeometrySvc ("TrackingGeometrySvc/AtlasTrackingGeometrySvc",name), - m_trackingVolumesSvc ("Trk::TrackingVolumesSvc/TrackingVolumesSvc",name), - m_aggregateMaterial (true), - m_allowReordering (false), - m_useStepPropagator (1), - m_maxWarnings (10), - m_materialMaxGap (2.0 *Gaudi::Units::meter), - m_orderingTolerance (1. *Gaudi::Units::mm), - m_scattererMinGap (100.*Gaudi::Units::mm), - m_scatteringConstant (13.6*Gaudi::Units::MeV), // Coulomb scattering constant - m_scatteringLogCoeff (0.038), // Coulomb scattering constant - m_sectorMaxPhi (0.28), - m_stationMaxGap (0.6 *Gaudi::Units::meter), - m_calorimeterVolume (0), - m_indetVolume (0), - m_spectrometerEntrance (0), - m_temporaryTSOS (0), - m_messageHelper (0) { - m_messageHelper = new MessageHelper(*this); + MaterialAllocator::MaterialAllocator (const std::string& type, + const std::string& name, + const IInterface* parent) + : AthAlgTool(type, name, parent), + m_extrapolator("Trk::Extrapolator/AtlasExtrapolator"), + m_intersector("Trk::RungeKuttaIntersector/RungeKuttaIntersector"), + m_spectrometerExtrapolator("Trk::Extrapolator/AtlasExtrapolator"), + m_trackingGeometrySvc("TrackingGeometrySvc/AtlasTrackingGeometrySvc", name), + m_trackingVolumesSvc("Trk::TrackingVolumesSvc/TrackingVolumesSvc", name), + m_aggregateMaterial(true), + m_allowReordering(false), + m_useStepPropagator(1), + m_maxWarnings(10), + m_materialMaxGap(2.0 * Gaudi::Units::meter), + m_orderingTolerance(1. * Gaudi::Units::mm), + m_scattererMinGap(100. * Gaudi::Units::mm), + m_scatteringConstant(13.6 * Gaudi::Units::MeV), // Coulomb scattering constant + m_scatteringLogCoeff(0.038), // Coulomb scattering constant + m_sectorMaxPhi(0.28), + m_stationMaxGap(0.6 * Gaudi::Units::meter), + m_calorimeterVolume(0), + m_indetVolume(0), + m_spectrometerEntrance(0), + m_temporaryTSOS(0), + m_messageHelper(0) { + m_messageHelper = new MessageHelper(*this); declareInterface<IMaterialAllocator>(this); - declareProperty("Extrapolator", m_extrapolator); - declareProperty("Intersector", m_intersector); - declareProperty("SpectrometerExtrapolator", m_spectrometerExtrapolator); - declareProperty("TrackingGeometrySvc", m_trackingGeometrySvc); - declareProperty("TrackingVolumesSvc", m_trackingVolumesSvc); - declareProperty("AggregateMaterial", m_aggregateMaterial); - declareProperty("AllowReordering", m_allowReordering); + declareProperty("Extrapolator", m_extrapolator); + declareProperty("Intersector", m_intersector); + declareProperty("SpectrometerExtrapolator", m_spectrometerExtrapolator); + declareProperty("TrackingGeometrySvc", m_trackingGeometrySvc); + declareProperty("TrackingVolumesSvc", m_trackingVolumesSvc); + declareProperty("AggregateMaterial", m_aggregateMaterial); + declareProperty("AllowReordering", m_allowReordering); // m_useStepPropagator 0 means not used (so Intersector used) // 1 Intersector not used and StepPropagator used with FullField // 2 StepPropagator with FastField propagation // 99 debug mode where both are ran with FullField - declareProperty("UseStepPropagator", m_useStepPropagator); - declareProperty("OrderingTolerance", m_orderingTolerance); - declareProperty("MaxNumberOfWarnings", m_maxWarnings, - "Maximum number of permitted WARNING messages per message type."); - -} + declareProperty("UseStepPropagator", m_useStepPropagator); + declareProperty("OrderingTolerance", m_orderingTolerance); + declareProperty("MaxNumberOfWarnings", m_maxWarnings, + "Maximum number of permitted WARNING messages per message type."); + } -MaterialAllocator::~MaterialAllocator (void) -{} + MaterialAllocator::~MaterialAllocator (void) + {} -StatusCode -MaterialAllocator::initialize() -{ + StatusCode + MaterialAllocator::initialize() { // print name and package version - ATH_MSG_INFO( "MaterialAllocator::initialize() - package version " << PACKAGE_VERSION ); - + ATH_MSG_INFO("MaterialAllocator::initialize() - package version " << PACKAGE_VERSION); + // fill WARNING messages m_messageHelper->setMaxNumberOfMessagesPrinted(m_maxWarnings); m_messageHelper->setNumberOfMessages(6); - m_messageHelper->setMessage(0, "leadingSpectrometerTSOS: missing TrackingGeometrySvc - no leading material will be added"); + m_messageHelper->setMessage(0, + "leadingSpectrometerTSOS: missing TrackingGeometrySvc - no leading material will be added"); m_messageHelper->setMessage(1, "indetMaterial: extrapolateM finds no material on track"); - m_messageHelper->setMessage(2, "spectrometerMaterial: missing TrackingGeometrySvc - no spectrometer material added"); - m_messageHelper->setMessage(3, "spectrometerMaterial: did not find MS entrance surface - no MS material taken into account"); + m_messageHelper->setMessage(2, + "spectrometerMaterial: missing TrackingGeometrySvc - no spectrometer material added"); + m_messageHelper->setMessage(3, + "spectrometerMaterial: did not find MS entrance surface - no MS material taken into account"); m_messageHelper->setMessage(4, "spectrometerMaterial: failed extrapolation"); m_messageHelper->setMessage(5, "spectrometerMaterial: extrapolateM finds no material on track"); - + // retrieve the necessary Extrapolators (muon tracking geometry is very picky!) - if (m_extrapolator.retrieve().isFailure()) - { - ATH_MSG_FATAL( "Failed to retrieve tool " << m_extrapolator ); - return StatusCode::FAILURE; + if (m_extrapolator.retrieve().isFailure()) { + ATH_MSG_FATAL("Failed to retrieve tool " << m_extrapolator); + return StatusCode::FAILURE; + } else { + ATH_MSG_INFO("Retrieved tool " << m_extrapolator); } - else - { - ATH_MSG_INFO( "Retrieved tool " << m_extrapolator ); + if (m_intersector.retrieve().isFailure()) { + ATH_MSG_FATAL("Failed to retrieve tool " << m_intersector); + return StatusCode::FAILURE; + } else { + ATH_MSG_INFO("Retrieved tool " << m_intersector); } - if (m_intersector.retrieve().isFailure()) - { - ATH_MSG_FATAL( "Failed to retrieve tool " << m_intersector ); + if (!m_spectrometerExtrapolator.empty()) { + if (m_spectrometerExtrapolator.retrieve().isFailure()) { + ATH_MSG_FATAL("Failed to retrieve tool " << m_spectrometerExtrapolator); return StatusCode::FAILURE; + } else { + ATH_MSG_INFO("Retrieved tool " << m_spectrometerExtrapolator); + } } - else - { - ATH_MSG_INFO( "Retrieved tool " << m_intersector ); - } - if (! m_spectrometerExtrapolator.empty()) - { - if (m_spectrometerExtrapolator.retrieve().isFailure()) - { - ATH_MSG_FATAL( "Failed to retrieve tool " << m_spectrometerExtrapolator ); - return StatusCode::FAILURE; - } - else - { - ATH_MSG_INFO( "Retrieved tool " << m_spectrometerExtrapolator ); - } - } - + // retrieve services - if (m_trackingGeometrySvc.retrieve().isFailure()) - { - ATH_MSG_FATAL( "Failed to retrieve Svc " << m_trackingGeometrySvc ); - return StatusCode::FAILURE; - } - else - { - ATH_MSG_INFO( "Retrieved Svc " << m_trackingGeometrySvc ); - } - + if (m_trackingGeometrySvc.retrieve().isFailure()) { + ATH_MSG_FATAL("Failed to retrieve Svc " << m_trackingGeometrySvc); + return StatusCode::FAILURE; + } else { + ATH_MSG_INFO("Retrieved Svc " << m_trackingGeometrySvc); + } + // need to create the IndetExit and MuonEntrance TrackingVolumes - if (m_trackingVolumesSvc.retrieve().isFailure()) - { - ATH_MSG_FATAL( "Failed to retrieve Svc " << m_trackingVolumesSvc ); - return StatusCode::FAILURE; - } - else - { - ATH_MSG_INFO( "Retrieved Svc " << m_trackingVolumesSvc ); - m_calorimeterVolume = new Volume( - m_trackingVolumesSvc->volume(ITrackingVolumesSvc::MuonSpectrometerEntryLayer)); - m_indetVolume = new Volume( - m_trackingVolumesSvc->volume(ITrackingVolumesSvc::CalorimeterEntryLayer)); - } - - if (m_useStepPropagator > 0 && m_stepPropagator.retrieve().isFailure()) - { - ATH_MSG_FATAL( "Failed to retrieve Svc " << m_stepPropagator ); - return StatusCode::FAILURE; + if (m_trackingVolumesSvc.retrieve().isFailure()) { + ATH_MSG_FATAL("Failed to retrieve Svc " << m_trackingVolumesSvc); + return StatusCode::FAILURE; + } else { + ATH_MSG_INFO("Retrieved Svc " << m_trackingVolumesSvc); + m_calorimeterVolume = new Volume( + m_trackingVolumesSvc->volume(ITrackingVolumesSvc::MuonSpectrometerEntryLayer)); + m_indetVolume = new Volume( + m_trackingVolumesSvc->volume(ITrackingVolumesSvc::CalorimeterEntryLayer)); + } + + if (m_useStepPropagator > 0 && m_stepPropagator.retrieve().isFailure()) { + ATH_MSG_FATAL("Failed to retrieve Svc " << m_stepPropagator); + return StatusCode::FAILURE; } // Field for StepPropagator m_stepField = Trk::MagneticFieldProperties(Trk::FullField); - if(m_useStepPropagator==2) m_stepField = Trk::MagneticFieldProperties(Trk::FastField); - + if (m_useStepPropagator == 2) m_stepField = Trk::MagneticFieldProperties(Trk::FastField); + return StatusCode::SUCCESS; -} + } -StatusCode -MaterialAllocator::finalize() -{ - ATH_MSG_INFO( "finalize() "); + StatusCode + MaterialAllocator::finalize() { + ATH_MSG_INFO("finalize() "); // summarize WARNINGs m_messageHelper->printSummary(); - + delete m_calorimeterVolume; delete m_indetVolume; delete m_messageHelper; delete m_temporaryTSOS; return StatusCode::SUCCESS; -} - -void -MaterialAllocator::addLeadingMaterial (std::vector<FitMeasurement*>& measurements, - ParticleHypothesis particleHypothesis, - FitParameters& fitParameters) const -{ + } + + void + MaterialAllocator::addLeadingMaterial(std::vector<FitMeasurement*>& measurements, + ParticleHypothesis particleHypothesis, + FitParameters& fitParameters) const { // nothing to do if starting with vertex measurement - if (measurements.front()->isVertex()) - { - return; + if (measurements.front()->isVertex()) { + return; } - if (msgLvl(MSG::DEBUG)) - { - ATH_MSG_DEBUG(" start of addLeadingMaterial: " ); + if (msgLvl(MSG::DEBUG)) { + ATH_MSG_DEBUG(" start of addLeadingMaterial: "); printMeasurements(measurements); } // fitted momentum at perigee - ignoring leading material effects - double charge = 1.; - double qOverP = fitParameters.qOverP(); - double p = 1./qOverP; - if (p < 0.) - { - charge = -1.; - p = -p; - } - + double charge = 1.; + double qOverP = fitParameters.qOverP(); + double p = 1. / qOverP; + if (p < 0.) { + charge = -1.; + p = -p; + } + // check if leading scatterer(s) already present or need to be added (up to delimiter) - bool energyGain = false; - bool haveDelimiter = false; - const TrackSurfaceIntersection* intersection = 0; - int leadingScatterers = 0; - Trk::FitMeasurement* leadingScatterer = 0; + bool energyGain = false; + bool haveDelimiter = false; + const TrackSurfaceIntersection* intersection = 0; + int leadingScatterers = 0; + Trk::FitMeasurement* leadingScatterer = 0; for (std::vector<Trk::FitMeasurement*>::const_iterator m = measurements.begin(); - m != measurements.end(); - ++m) - { - if ((**m).isMaterialDelimiter()) - { - haveDelimiter = true; - } - else if ((**m).isScatterer()) - { - // count unfitted scatterers - if (! (**m).numberDoF()) - { - ++leadingScatterers; - leadingScatterer = *m; - } - else - { - if (std::abs(1./(**m).qOverP()) > p) energyGain = true; - break; - } - } + m != measurements.end(); + ++m) { + if ((**m).isMaterialDelimiter()) { + haveDelimiter = true; + } else if ((**m).isScatterer()) { + // count unfitted scatterers + if (!(**m).numberDoF()) { + ++leadingScatterers; + leadingScatterer = *m; + } else { + if (std::abs(1. / (**m).qOverP()) > p) energyGain = true; + break; + } + } } // need to allocate leading scatterers - if (haveDelimiter && ! leadingScatterers) - { - // find first measurement after delimiter - haveDelimiter = false; - Amg::Vector3D endPosition = fitParameters.vertex(); - const Surface* firstMeasurementSurface = 0; - Trk::FitMeasurement* leadingOutlier = 0; - std::vector<Trk::FitMeasurement*> leadingOutliers; - const Surface* surface = 0; - for (std::vector<Trk::FitMeasurement*>::const_iterator m = measurements.begin(); - m != measurements.end(); - ++m) - { - if ((**m).isMaterialDelimiter()) - { - haveDelimiter = true; - endPosition = (**m).position(); - surface = (**m).surface(); - } - else if ((**m).isPositionMeasurement()) - { - if ((**m).isOutlier()) - { - if (! firstMeasurementSurface) leadingOutliers.push_back(*m); - } - else - { - if (! firstMeasurementSurface && ! intersection) - { - firstMeasurementSurface = (**m).surface(); - intersection = - new TrackSurfaceIntersection((**m).intersection(FittedTrajectory)); - } - if (! haveDelimiter) continue; - // surface = (**m).surface(); - } - } - else if ((**m).isScatterer()) - { - if (! surface) continue; - // FIXME: update p for Perigee in case of gain?? - if (std::abs(1./(**m).qOverP()) > p) energyGain = true; - break; - } - } - - // leading material identified by outwards extrapolateM from perigee to delimiter - // FIXME: currently only for indet - // first create the fitted perigee (ignoring the leading material) - Perigee* perigee = new Perigee(fitParameters.position(), - p*fitParameters.direction(), - charge, - fitParameters.vertex()); - bool haveMaterial = false; - const std::vector<const TrackStateOnSurface*>* indetMaterial = 0; - if (haveDelimiter && intersection && surface && m_indetVolume->inside(endPosition)) - { - // debug - if (msgLvl(MSG::VERBOSE)) - { - Amg::Vector3D direction = intersection->direction(); - Amg::Vector3D startPosition = intersection->position(); - ATH_MSG_VERBOSE( " addLeadingMaterial: using extrapolateM from distance " - << direction.dot(fitParameters.position() - startPosition) ); - } - - // extrapolateM from perigee to get leading material - indetMaterial = extrapolatedMaterial(m_extrapolator, - *perigee, - *surface, - alongMomentum, - false, - particleHypothesis); - - // check material found (expected at least for leading measurement) - if (indetMaterial && ! indetMaterial->empty()) - { - std::vector<const TrackStateOnSurface*>::const_reverse_iterator r = indetMaterial->rbegin(); - for ( ; r != indetMaterial->rend(); ++r) - { - // ignore trailing material - if (! (**r).trackParameters() - || ! (**r).materialEffectsOnTrack() - || intersection->direction().dot( - (**r).trackParameters()->position() - endPosition) > 0.) continue; - - haveMaterial = true; - } - } - } - else - { - haveDelimiter = false; - } - - // try again with back extrapolation if no leading material found - if (haveDelimiter && ! haveMaterial) - { - // debug - ATH_MSG_VERBOSE(" no leading material found with forward extrapolation" - << ", try again with back extrapolation "); - - // clean up after previous attempt - deleteMaterial(indetMaterial); - indetMaterial = 0; - - std::vector<const TrackStateOnSurface*>* indetMaterialF = 0; - const std::vector<const TrackStateOnSurface*>* indetMaterialR = 0; - CurvilinearUVT uvt(intersection->direction()); - Amg::Vector2D localPos; - PlaneSurface* plane = new PlaneSurface(intersection->position(),uvt); - if (plane->globalToLocal(intersection->position(), - intersection->direction(), - localPos)) - { - AtaPlane parameters(localPos[locR], - localPos[locZ], - intersection->direction().phi(), - intersection->direction().theta(), - qOverP, - *plane); - - indetMaterialR = extrapolatedMaterial(m_extrapolator, - parameters, - perigee->associatedSurface(), - oppositeMomentum, - false, - particleHypothesis); - - if (indetMaterialR && ! indetMaterialR->empty()) - { - indetMaterialF = new std::vector<const TrackStateOnSurface*>; - indetMaterialF->reserve(indetMaterialR->size()); - - std::vector<const TrackStateOnSurface*>::const_reverse_iterator r = indetMaterialR->rbegin(); - for ( ; r != indetMaterialR->rend(); ++r) - { - indetMaterialF->push_back(*r); - } - - for (r = indetMaterialF->rbegin(); r != indetMaterialF->rend(); ++r) - { - // ignore trailing material - if (! (**r).trackParameters() - || ! (**r).materialEffectsOnTrack() - || intersection->direction().dot( - (**r).trackParameters()->position() - endPosition) > 0.) continue; - - haveMaterial = true; - } - indetMaterial = indetMaterialF; - indetMaterialF = 0; - } - } - delete indetMaterialR; - delete plane; - } - - // debug - /** Commented out because indetMaterial is NULL at this point (coverity 25126) - if (haveDelimiter && msgLvl(MSG::VERBOSE)) - { - Amg::Vector3D direction = intersection->direction(); - Amg::Vector3D startPosition = intersection->position(); - double p1 = perigee->momentum().mag(); - - for (std::vector<const TrackStateOnSurface*>::const_iterator s = indetMaterial->begin(); - s != indetMaterial->end(); - ++s) - { - if (! (**s).trackParameters()) continue; - double distance = direction.dot((**s).trackParameters()->position() - startPosition); - double deltaE = 0.; - double thickness= 0.; - const MaterialEffectsOnTrack* materialEffects = - dynamic_cast<const MaterialEffectsOnTrack*>((**s).materialEffectsOnTrack()); - if ((**s).materialEffectsOnTrack()) - { - if (materialEffects) deltaE = materialEffects->energyLoss()->deltaE(); - thickness = (**s).materialEffectsOnTrack()->thicknessInX0(); - } - else - { - ATH_MSG_VERBOSE( std::setiosflags(std::ios::fixed) << " delimiter: RZ" - << std::setw(9) << std::setprecision(3) - << (**s).trackParameters()->position().perp() - << std::setw(10) << std::setprecision(3) - << (**s).trackParameters()->position().z() - << " distance " << std::setw(10) << std::setprecision(3) - << distance - << " pt " << std::setw(8) << std::setprecision(3) - << (**s).trackParameters()->momentum().perp()/Gaudi::Units::GeV); - continue; - } - - double p2 = (**s).trackParameters()->momentum().mag(); - ATH_MSG_VERBOSE( std::setiosflags(std::ios::fixed) << " material: RZ" - << std::setw(9) << std::setprecision(3) - << (**s).trackParameters()->position().perp() - << std::setw(10) << std::setprecision(3) - << (**s).trackParameters()->position().z() - << " distance " << std::setw(10) << std::setprecision(3) - << distance - << " pt " << std::setw(8) << std::setprecision(3) - << (**s).trackParameters()->momentum().perp()/Gaudi::Units::GeV - << " X0thickness " << std::setw(8) << std::setprecision(4) - << thickness - << " deltaE " << std::setw(8) << std::setprecision(4) - << deltaE - << " diffP " << std::setw(8) << std::setprecision(4) << p2 - p1 ); - p1 = p2; - } - } - **/ - - // create scatterer FitMeasurement's corresponding to leading material - // (intersector running inwards to give parameters with qOverP update) - FitMeasurement* leadingMeas = 0; - if (indetMaterial && ! indetMaterial->empty()) - { - std::vector<const TrackStateOnSurface*>::const_reverse_iterator r = indetMaterial->rbegin(); - for ( ; r != indetMaterial->rend(); ++r) - { - // ignore trailing material - if (! (**r).trackParameters() - || ! (**r).materialEffectsOnTrack() - || intersection->direction().dot( - (**r).trackParameters()->position() - endPosition) > 0.) continue; - - // intersect material surface - double eLoss = 0.; - const MaterialEffectsOnTrack* materialEffects = - dynamic_cast<const MaterialEffectsOnTrack*>((**r).materialEffectsOnTrack()); - if (materialEffects) - { - eLoss = std::abs(materialEffects->energyLoss()->deltaE()); - if (energyGain) eLoss = -eLoss; - } - - if (leadingScatterers++ || ! firstMeasurementSurface) - { - - if( m_useStepPropagator==99) { - const TrackSurfaceIntersection* newIntersectionSTEP = - m_stepPropagator->intersectSurface((**r).trackParameters()->associatedSurface(), - intersection, - qOverP, - Trk::MagneticFieldProperties(Trk::FullField), - Trk::muon); - intersection = - m_intersector->intersectSurface((**r).trackParameters()->associatedSurface(), - intersection, - qOverP); - if(newIntersectionSTEP&&intersection) { + if (haveDelimiter && !leadingScatterers) { + // find first measurement after delimiter + haveDelimiter = false; + Amg::Vector3D endPosition = fitParameters.vertex(); + const Surface* firstMeasurementSurface = 0; + Trk::FitMeasurement* leadingOutlier = 0; + std::vector<Trk::FitMeasurement*> leadingOutliers; + const Surface* surface = 0; + for (std::vector<Trk::FitMeasurement*>::const_iterator m = measurements.begin(); + m != measurements.end(); + ++m) { + if ((**m).isMaterialDelimiter()) { + haveDelimiter = true; + endPosition = (**m).position(); + surface = (**m).surface(); + } else if ((**m).isPositionMeasurement()) { + if ((**m).isOutlier()) { + if (!firstMeasurementSurface) leadingOutliers.push_back(*m); + } else { + if (!firstMeasurementSurface && !intersection) { + firstMeasurementSurface = (**m).surface(); + intersection = + new TrackSurfaceIntersection((**m).intersection(FittedTrajectory)); + } + if (!haveDelimiter) continue; + // surface = (**m).surface(); + } + } else if ((**m).isScatterer()) { + if (!surface) continue; + // FIXME: update p for Perigee in case of gain?? + if (std::abs(1. / (**m).qOverP()) > p) energyGain = true; + break; + } + } + + // leading material identified by outwards extrapolateM from perigee to delimiter + // FIXME: currently only for indet + // first create the fitted perigee (ignoring the leading material) + Perigee* perigee = new Perigee(fitParameters.position(), + p * fitParameters.direction(), + charge, + fitParameters.vertex()); + bool haveMaterial = false; + const std::vector<const TrackStateOnSurface*>* indetMaterial = 0; + if (haveDelimiter && intersection && surface && m_indetVolume->inside(endPosition)) { + // debug + if (msgLvl(MSG::VERBOSE)) { + Amg::Vector3D direction = intersection->direction(); + Amg::Vector3D startPosition = intersection->position(); + ATH_MSG_VERBOSE(" addLeadingMaterial: using extrapolateM from distance " + << direction.dot(fitParameters.position() - startPosition)); + } + + // extrapolateM from perigee to get leading material + indetMaterial = extrapolatedMaterial(m_extrapolator, + *perigee, + *surface, + alongMomentum, + false, + particleHypothesis); + + // check material found (expected at least for leading measurement) + if (indetMaterial && !indetMaterial->empty()) { + std::vector<const TrackStateOnSurface*>::const_reverse_iterator r = indetMaterial->rbegin(); + for (; r != indetMaterial->rend(); ++r) { + // ignore trailing material + if (!(**r).trackParameters() + || !(**r).materialEffectsOnTrack() + || intersection->direction().dot( + (**r).trackParameters()->position() - endPosition) > 0.) continue; + + haveMaterial = true; + } + } + } else { + haveDelimiter = false; + } + + // try again with back extrapolation if no leading material found + if (haveDelimiter && !haveMaterial) { + // debug + ATH_MSG_VERBOSE(" no leading material found with forward extrapolation" + << ", try again with back extrapolation "); + + // clean up after previous attempt + deleteMaterial(indetMaterial); + indetMaterial = 0; + + std::vector<const TrackStateOnSurface*>* indetMaterialF = 0; + const std::vector<const TrackStateOnSurface*>* indetMaterialR = 0; + CurvilinearUVT uvt(intersection->direction()); + Amg::Vector2D localPos; + PlaneSurface* plane = new PlaneSurface(intersection->position(), uvt); + if (plane->globalToLocal(intersection->position(), + intersection->direction(), + localPos)) { + AtaPlane parameters(localPos[locR], + localPos[locZ], + intersection->direction().phi(), + intersection->direction().theta(), + qOverP, + *plane); + + indetMaterialR = extrapolatedMaterial(m_extrapolator, + parameters, + perigee->associatedSurface(), + oppositeMomentum, + false, + particleHypothesis); + + if (indetMaterialR && !indetMaterialR->empty()) { + indetMaterialF = new std::vector<const TrackStateOnSurface*>; + indetMaterialF->reserve(indetMaterialR->size()); + + std::vector<const TrackStateOnSurface*>::const_reverse_iterator r = indetMaterialR->rbegin(); + for (; r != indetMaterialR->rend(); ++r) { + indetMaterialF->push_back(*r); + } + + for (r = indetMaterialF->rbegin(); r != indetMaterialF->rend(); ++r) { + // ignore trailing material + if (!(**r).trackParameters() + || !(**r).materialEffectsOnTrack() + || intersection->direction().dot( + (**r).trackParameters()->position() - endPosition) > 0.) continue; + + haveMaterial = true; + } + indetMaterial = indetMaterialF; + indetMaterialF = 0; + } + } + delete indetMaterialR; + delete plane; + } + + // debug + /** Commented out because indetMaterial is NULL at this point (coverity 25126) + if (haveDelimiter && msgLvl(MSG::VERBOSE)) + { + Amg::Vector3D direction = intersection->direction(); + Amg::Vector3D startPosition = intersection->position(); + double p1 = perigee->momentum().mag(); + + for (std::vector<const TrackStateOnSurface*>::const_iterator s = indetMaterial->begin(); + s != indetMaterial->end(); + ++s) + { + if (! (**s).trackParameters()) continue; + double distance = direction.dot((**s).trackParameters()->position() - startPosition); + double deltaE = 0.; + double thickness= 0.; + const MaterialEffectsOnTrack* materialEffects = + dynamic_cast<const MaterialEffectsOnTrack*>((**s).materialEffectsOnTrack()); + if ((**s).materialEffectsOnTrack()) + { + if (materialEffects) deltaE = materialEffects->energyLoss()->deltaE(); + thickness = (**s).materialEffectsOnTrack()->thicknessInX0(); + } + else + { + ATH_MSG_VERBOSE( std::setiosflags(std::ios::fixed) << " delimiter: RZ" + << std::setw(9) << std::setprecision(3) + << (**s).trackParameters()->position().perp() + << std::setw(10) << std::setprecision(3) + << (**s).trackParameters()->position().z() + << " distance " << std::setw(10) << std::setprecision(3) + << distance + << " pt " << std::setw(8) << std::setprecision(3) + << (**s).trackParameters()->momentum().perp()/Gaudi::Units::GeV); + continue; + } + + double p2 = (**s).trackParameters()->momentum().mag(); + ATH_MSG_VERBOSE( std::setiosflags(std::ios::fixed) << " material: RZ" + << std::setw(9) << std::setprecision(3) + << (**s).trackParameters()->position().perp() + << std::setw(10) << std::setprecision(3) + << (**s).trackParameters()->position().z() + << " distance " << std::setw(10) << std::setprecision(3) + << distance + << " pt " << std::setw(8) << std::setprecision(3) + << (**s).trackParameters()->momentum().perp()/Gaudi::Units::GeV + << " X0thickness " << std::setw(8) << std::setprecision(4) + << thickness + << " deltaE " << std::setw(8) << std::setprecision(4) + << deltaE + << " diffP " << std::setw(8) << std::setprecision(4) << p2 - p1 ); + p1 = p2; + } + } + **/ + + // create scatterer FitMeasurement's corresponding to leading material + // (intersector running inwards to give parameters with qOverP update) + FitMeasurement* leadingMeas = 0; + if (indetMaterial && !indetMaterial->empty()) { + std::vector<const TrackStateOnSurface*>::const_reverse_iterator r = indetMaterial->rbegin(); + for (; r != indetMaterial->rend(); ++r) { + // ignore trailing material + if (!(**r).trackParameters() + || !(**r).materialEffectsOnTrack() + || intersection->direction().dot( + (**r).trackParameters()->position() - endPosition) > 0.) continue; + + // intersect material surface + double eLoss = 0.; + const MaterialEffectsOnTrack* materialEffects = + dynamic_cast<const MaterialEffectsOnTrack*>((**r).materialEffectsOnTrack()); + if (materialEffects) { + eLoss = std::abs(materialEffects->energyLoss()->deltaE()); + if (energyGain) eLoss = -eLoss; + } + + if (leadingScatterers++ || !firstMeasurementSurface) { + if (m_useStepPropagator == 99) { + const TrackSurfaceIntersection* newIntersectionSTEP = + m_stepPropagator->intersectSurface((**r).trackParameters()->associatedSurface(), + intersection, + qOverP, + Trk::MagneticFieldProperties(Trk::FullField), + Trk::muon); + intersection = + m_intersector->intersectSurface((**r).trackParameters()->associatedSurface(), + intersection, + qOverP); + if (newIntersectionSTEP && intersection) { // double dist = 1000.*(newIntersectionSTEP->position()-intersection->position()).mag(); // std::cout << " iMat 1 distance STEP and Intersector " << dist << std::endl; // if(dist>10.) std::cout << " iMat 1 ALARM distance STEP and Intersector " << dist << std::endl; - delete newIntersectionSTEP; - } else { + delete newIntersectionSTEP; + } else { // if(intersection) std::cout << " iMat 1 ALARM STEP did not intersect! " << std::endl; - } - } else { - intersection = m_useStepPropagator>=1? - m_stepPropagator->intersectSurface((**r).trackParameters()->associatedSurface(), - intersection, - qOverP, - m_stepField, - Trk::muon): - m_intersector->intersectSurface((**r).trackParameters()->associatedSurface(), - intersection, - qOverP); - } - - // quit if tracking problem - if (! intersection) - { - intersection = &measurements.front()->intersection(FittedTrajectory); - break; - } - leadingMeas = new FitMeasurement((**r).materialEffectsOnTrack(), - ParticleMasses().mass[particleHypothesis], - intersection->position()); - } - else - { - // remove leadingOutliers - they will be reinserted wrt the leadingScatterers - for (std::vector<Trk::FitMeasurement*>::const_iterator l = leadingOutliers.begin(); - l != leadingOutliers.end(); - ++l) - { - leadingOutlier = leadingOutliers.back(); - measurements.erase(std::remove(measurements.begin(), measurements.end(), *l), measurements.end()); - } - leadingMeas = new FitMeasurement((**r).materialEffectsOnTrack()->thicknessInX0(), - -eLoss, - ParticleMasses().mass[particleHypothesis], - intersection->position(), - intersection->direction(), - qOverP, - firstMeasurementSurface); - leadingScatterer = leadingMeas; - } - leadingMeas->intersection(FittedTrajectory,intersection); - leadingMeas->qOverP(qOverP); - - // put corresponding scatterer FitMeasurement at front of list, - // after re-inserting any intermediate leadingOutliers - if (leadingOutlier) - { - double radius = leadingMeas->intersection(FittedTrajectory).position().perp(); - while (leadingOutlier - && leadingOutlier->intersection(FittedTrajectory).position().perp() > radius) - { - leadingOutliers.pop_back(); - measurements.insert(measurements.begin(), leadingOutlier); - if (leadingOutliers.size()) - { - - leadingOutlier = leadingOutliers.back(); - } - else - { - leadingOutlier = 0; - } - } - } - - ATH_MSG_DEBUG(" push_front(leadingMeas) "); - - measurements.insert(measurements.begin(), leadingMeas); - - // update momentum for energy loss - if (materialEffects) - { - if (charge > 0.) - { - qOverP = 1./(1./qOverP + eLoss); - } - else - { - qOverP = 1./(1./qOverP - eLoss); - } - } - } - } - - // final step to give intersection at perigee surface plus memory management - if (leadingMeas) - { - if( m_useStepPropagator==99) { - const TrackSurfaceIntersection* newIntersectionSTEP = - m_stepPropagator->intersectSurface(perigee->associatedSurface(), - intersection, - qOverP, - Trk::MagneticFieldProperties(Trk::FullField), - Trk::muon); - intersection = m_intersector->intersectSurface(perigee->associatedSurface(), - intersection, - qOverP); - if(newIntersectionSTEP&&intersection) { + } + } else { + intersection = m_useStepPropagator >= 1 ? + m_stepPropagator->intersectSurface((**r).trackParameters()->associatedSurface(), + intersection, + qOverP, + m_stepField, + Trk::muon) : + m_intersector->intersectSurface((**r).trackParameters()->associatedSurface(), + intersection, + qOverP); + } + + // quit if tracking problem + if (!intersection) { + intersection = &measurements.front()->intersection(FittedTrajectory); + break; + } + leadingMeas = new FitMeasurement((**r).materialEffectsOnTrack(), + ParticleMasses().mass[particleHypothesis], + intersection->position()); + } else { + // remove leadingOutliers - they will be reinserted wrt the leadingScatterers + for (std::vector<Trk::FitMeasurement*>::const_iterator l = leadingOutliers.begin(); + l != leadingOutliers.end(); + ++l) { + leadingOutlier = leadingOutliers.back(); + measurements.erase(std::remove(measurements.begin(), measurements.end(), *l), measurements.end()); + } + leadingMeas = new FitMeasurement((**r).materialEffectsOnTrack()->thicknessInX0(), + -eLoss, + ParticleMasses().mass[particleHypothesis], + intersection->position(), + intersection->direction(), + qOverP, + firstMeasurementSurface); + leadingScatterer = leadingMeas; + } + leadingMeas->intersection(FittedTrajectory, intersection); + leadingMeas->qOverP(qOverP); + + // put corresponding scatterer FitMeasurement at front of list, + // after re-inserting any intermediate leadingOutliers + if (leadingOutlier) { + double radius = leadingMeas->intersection(FittedTrajectory).position().perp(); + while (leadingOutlier + && leadingOutlier->intersection(FittedTrajectory).position().perp() > radius) { + leadingOutliers.pop_back(); + measurements.insert(measurements.begin(), leadingOutlier); + if (leadingOutliers.size()) { + leadingOutlier = leadingOutliers.back(); + } else { + leadingOutlier = 0; + } + } + } + + ATH_MSG_DEBUG(" push_front(leadingMeas) "); + + measurements.insert(measurements.begin(), leadingMeas); + + // update momentum for energy loss + if (materialEffects) { + if (charge > 0.) { + qOverP = 1. / (1. / qOverP + eLoss); + } else { + qOverP = 1. / (1. / qOverP - eLoss); + } + } + } + } + + // final step to give intersection at perigee surface plus memory management + if (leadingMeas) { + if (m_useStepPropagator == 99) { + const TrackSurfaceIntersection* newIntersectionSTEP = + m_stepPropagator->intersectSurface(perigee->associatedSurface(), + intersection, + qOverP, + Trk::MagneticFieldProperties(Trk::FullField), + Trk::muon); + intersection = m_intersector->intersectSurface(perigee->associatedSurface(), + intersection, + qOverP); + if (newIntersectionSTEP && intersection) { // double dist = 1000.*(newIntersectionSTEP->position()-intersection->position()).mag(); // std::cout << " iMat 2 distance STEP and Intersector " << dist << std::endl; // if(dist>10.) std::cout << " iMat 2 ALARM distance STEP and Intersector " << dist << std::endl; - delete newIntersectionSTEP; - } else { + delete newIntersectionSTEP; + } else { // if(intersection) std::cout << " iMat 2 ALARM STEP did not intersect! " << std::endl; - } - } else { - intersection = m_useStepPropagator>=1? - m_stepPropagator->intersectSurface(perigee->associatedSurface(), - intersection, - qOverP, - m_stepField, - Trk::muon): - m_intersector->intersectSurface(perigee->associatedSurface(), - intersection, - qOverP); - } - } - else - { - delete intersection; - intersection = 0; - } - delete perigee; - deleteMaterial(indetMaterial); - indetMaterial = 0; + } + } else { + intersection = m_useStepPropagator >= 1 ? + m_stepPropagator->intersectSurface(perigee->associatedSurface(), + intersection, + qOverP, + m_stepField, + Trk::muon) : + m_intersector->intersectSurface(perigee->associatedSurface(), + intersection, + qOverP); + } + } else { + delete intersection; + intersection = 0; + } + delete perigee; + deleteMaterial(indetMaterial); + indetMaterial = 0; } // integrate X0, energy loss and contribution to covariance (from leading scatterer towards perigee) AmgSymMatrix(5) leadingCovariance; leadingCovariance.setZero(); - if (leadingScatterers) - { - double leadingScattering = 0.; - double previousScattering = 0.; - double leadingX0Integral = 0.; - std::vector<Trk::FitMeasurement*>::reverse_iterator m = measurements.rbegin(); - while (*m != leadingScatterer) ++m; - for ( ; m != measurements.rend(); ++m) - { - if (! (**m).isScatterer()) continue; - const MaterialEffectsOnTrack* materialEffects = - dynamic_cast<const MaterialEffectsOnTrack*>((**m).materialEffects()); - if (! materialEffects) continue; - - // set the scattering angle and X0Integral - leadingX0Integral += (**m).materialEffects()->thicknessInX0(); - double logTerm = 1.0 + m_scatteringLogCoeff*std::log(leadingX0Integral); - leadingScattering = leadingX0Integral*logTerm*logTerm; - double scatteringAngle = m_scatteringConstant * - std::sqrt(leadingScattering - previousScattering); - previousScattering = leadingScattering; - (**m).scatteringAngle(scatteringAngle,leadingX0Integral); - - // the scattering contribution to the covariance at perigee - double angleSquared = 1./(**m).weight(); - double deltaR = ((**m).intersection(FittedTrajectory).position() - - fitParameters.vertex()).perp(); - double sinThetaSquared = (**m).intersection(FittedTrajectory).direction().perp2(); - angleSquared *= angleSquared/sinThetaSquared; - - // transverse projection - leadingCovariance(0,0) += deltaR*deltaR * angleSquared; - leadingCovariance(0,2) -= deltaR * angleSquared; - leadingCovariance(2,0) = leadingCovariance(0,2); - leadingCovariance(2,2) += angleSquared; - - // longitudinal projection (to get z: remember dcotTh/dTh = -1/sin*sin) - leadingCovariance(1,1) += deltaR*deltaR * angleSquared / sinThetaSquared; - leadingCovariance(1,3) += deltaR * angleSquared; - leadingCovariance(3,1) = leadingCovariance(1,3); - leadingCovariance(3,3) += angleSquared * sinThetaSquared; - } + if (leadingScatterers) { + double leadingScattering = 0.; + double previousScattering = 0.; + double leadingX0Integral = 0.; + std::vector<Trk::FitMeasurement*>::reverse_iterator m = measurements.rbegin(); + while (*m != leadingScatterer) ++m; + for (; m != measurements.rend(); ++m) { + if (!(**m).isScatterer()) continue; + const MaterialEffectsOnTrack* materialEffects = + dynamic_cast<const MaterialEffectsOnTrack*>((**m).materialEffects()); + if (!materialEffects) continue; + + // set the scattering angle and X0Integral + leadingX0Integral += (**m).materialEffects()->thicknessInX0(); + double logTerm = 1.0 + m_scatteringLogCoeff * std::log(leadingX0Integral); + leadingScattering = leadingX0Integral * logTerm * logTerm; + double scatteringAngle = m_scatteringConstant * + std::sqrt(leadingScattering - previousScattering); + previousScattering = leadingScattering; + (**m).scatteringAngle(scatteringAngle, leadingX0Integral); + + // the scattering contribution to the covariance at perigee + double angleSquared = 1. / (**m).weight(); + double deltaR = ((**m).intersection(FittedTrajectory).position() - + fitParameters.vertex()).perp(); + double sinThetaSquared = (**m).intersection(FittedTrajectory).direction().perp2(); + angleSquared *= angleSquared / sinThetaSquared; + + // transverse projection + leadingCovariance(0, 0) += deltaR * deltaR * angleSquared; + leadingCovariance(0, 2) -= deltaR * angleSquared; + leadingCovariance(2, 0) = leadingCovariance(0, 2); + leadingCovariance(2, 2) += angleSquared; + + // longitudinal projection (to get z: remember dcotTh/dTh = -1/sin*sin) + leadingCovariance(1, 1) += deltaR * deltaR * angleSquared / sinThetaSquared; + leadingCovariance(1, 3) += deltaR * angleSquared; + leadingCovariance(3, 1) = leadingCovariance(1, 3); + leadingCovariance(3, 3) += angleSquared * sinThetaSquared; + } } // if leading material has just been added - if (intersection) - { - fitParameters.update(intersection->position(), - intersection->direction(), - qOverP, - leadingCovariance); - delete intersection; + if (intersection) { + fitParameters.update(intersection->position(), + intersection->direction(), + qOverP, + leadingCovariance); + delete intersection; } // or pre-existing leading material - else - { - fitParameters.update(fitParameters.position(), - fitParameters.direction(), - qOverP, - leadingCovariance); + else { + fitParameters.update(fitParameters.position(), + fitParameters.direction(), + qOverP, + leadingCovariance); } // debug - if (msgLvl(MSG::DEBUG)) - { - if (! haveDelimiter) ATH_MSG_VERBOSE(" addLeadingMaterial: " ); - printMeasurements(measurements); - } -} - -void -MaterialAllocator::allocateMaterial (std::vector<FitMeasurement*>& measurements, - ParticleHypothesis particleHypothesis, - const FitParameters& fitParameters, - const TrackParameters& startParameters) const -{ + if (msgLvl(MSG::DEBUG)) { + if (!haveDelimiter) ATH_MSG_VERBOSE(" addLeadingMaterial: "); + printMeasurements(measurements); + } + } + + void + MaterialAllocator::allocateMaterial(std::vector<FitMeasurement*>& measurements, + ParticleHypothesis particleHypothesis, + const FitParameters& fitParameters, + const TrackParameters& startParameters) const { // different strategies used for indet and muon spectrometer - indetMaterial(measurements,particleHypothesis,startParameters); - if (! m_spectrometerExtrapolator.empty()) spectrometerMaterial(measurements, - particleHypothesis, - fitParameters, - startParameters); + indetMaterial(measurements, particleHypothesis, startParameters); + if (!m_spectrometerExtrapolator.empty()) spectrometerMaterial(measurements, + particleHypothesis, + fitParameters, + startParameters); // debug - if (msgLvl(MSG::VERBOSE)) - { - ATH_MSG_VERBOSE(" allocateMaterial: " ); - printMeasurements(measurements); + if (msgLvl(MSG::VERBOSE)) { + ATH_MSG_VERBOSE(" allocateMaterial: "); + printMeasurements(measurements); } - -} + } -void -MaterialAllocator::clear(void) -{ - if (m_temporaryTSOS) - { - for (std::vector<const TrackStateOnSurface*>::const_iterator s = m_temporaryTSOS->begin(); - s != m_temporaryTSOS->end(); - ++s) - delete *s; + void + MaterialAllocator::clear(void) { + if (m_temporaryTSOS) { + for (std::vector<const TrackStateOnSurface*>::const_iterator s = m_temporaryTSOS->begin(); + s != m_temporaryTSOS->end(); + ++s) + delete *s; - delete m_temporaryTSOS; - m_temporaryTSOS = 0; + delete m_temporaryTSOS; + m_temporaryTSOS = 0; } -} + } -void -MaterialAllocator::initializeScattering (std::vector<FitMeasurement*>& measurements) const -{ + void + MaterialAllocator::initializeScattering(std::vector<FitMeasurement*>& measurements) const { // loop over scatterers to include log term corresponding to integral thickness - bool integrate = false; - double previousScattering = 0.; - double X0Integral = 0.; + bool integrate = false; + double previousScattering = 0.; + double X0Integral = 0.; + std::vector<Trk::FitMeasurement*>::iterator m = measurements.begin(); // start integration after any leading material - while (! (**m).isPositionMeasurement() || (**m).isOutlier()) ++m; - - for ( ; m != measurements.end(); ++m) - { - if (integrate && (**m).isPositionMeasurement() && ! (**m).isOutlier()) - { - // restart integration for log term - integrate = false; - previousScattering = 0.; - X0Integral = 0.; - } - if ((**m).isScatterer()) - { - if (integrate) - { - // reset if measurement closely following - std::vector<Trk::FitMeasurement*>::iterator next = m; - if (++next != measurements.end() - && ! (**next).hitOnTrack() - && (**next).isPositionMeasurement() - && ! (**next).isOutlier()) - { - Amg::Vector3D position = (**next).intersection(FittedTrajectory).position(); - if (((**m).intersection(FittedTrajectory).position() - position).mag() < 1.*Gaudi::Units::mm) - integrate = false; - } - - if (! integrate) - { - // restart integration for log term - previousScattering = 0.; - X0Integral = 0.; - } - } - - integrate = true; - double thicknessInX0 = (**m).materialEffects()->thicknessInX0(); - if ((**m).materialEffects()->thicknessInX0() < 0. ) - { - ATH_MSG_WARNING( "thicknessInX0 smaller or equal to zero " - << (**m).materialEffects()->thicknessInX0() - << " " << *(**m).materialEffects() ); - thicknessInX0 = 1e-6; - } - X0Integral += thicknessInX0; - double logTerm = 1.; - if (X0Integral > 0.) - { - logTerm = 1.0 + m_scatteringLogCoeff*std::log(X0Integral); - } - else - { - ATH_MSG_WARNING( "X0Integral smaller or equal to zero " << X0Integral - << " thicknessInX0 " << (**m).materialEffects()->thicknessInX0() - << " " << *(**m).materialEffects() ); - X0Integral = 1e-6; - } - double scattering = X0Integral*logTerm*logTerm; - double angle = m_scatteringConstant * std::sqrt(scattering-previousScattering); - previousScattering = scattering; - (**m).numberDoF(2); - (**m).scatteringAngle(angle,X0Integral); - } + while (!(**m).isPositionMeasurement() || (**m).isOutlier()) ++m; + + for (; m != measurements.end(); ++m) { + if (integrate && (**m).isPositionMeasurement() && !(**m).isOutlier()) { + // restart integration for log term + integrate = false; + previousScattering = 0.; + X0Integral = 0.; + } + if ((**m).isScatterer()) { + if (integrate) { + // reset if measurement closely following + std::vector<Trk::FitMeasurement*>::iterator next = m; + if (++next != measurements.end() + && !(**next).hitOnTrack() + && (**next).isPositionMeasurement() + && !(**next).isOutlier()) { + Amg::Vector3D position = (**next).intersection(FittedTrajectory).position(); + if (((**m).intersection(FittedTrajectory).position() - position).mag() < + 1. * Gaudi::Units::mm) integrate = false; + } + + if (!integrate) { + // restart integration for log term + previousScattering = 0.; + X0Integral = 0.; + } + } + + integrate = true; + double thicknessInX0 = (**m).materialEffects()->thicknessInX0(); + if ((**m).materialEffects()->thicknessInX0() < 0.) { + ATH_MSG_WARNING("thicknessInX0 smaller or equal to zero " + << (**m).materialEffects()->thicknessInX0() + << " " << *(**m).materialEffects()); + thicknessInX0 = 1e-6; + } + X0Integral += thicknessInX0; + double logTerm = 1.; + if (X0Integral > 0.) { + logTerm = 1.0 + m_scatteringLogCoeff * std::log(X0Integral); + } else { + ATH_MSG_WARNING("X0Integral smaller or equal to zero " << X0Integral + << " thicknessInX0 " << (**m).materialEffects()->thicknessInX0() + << " " << *(**m).materialEffects()); + X0Integral = 1e-6; + } + double scattering = X0Integral * logTerm * logTerm; + double angle = m_scatteringConstant * std::sqrt(scattering - previousScattering); + previousScattering = scattering; + (**m).numberDoF(2); + (**m).scatteringAngle(angle, X0Integral); + } } -} + } -std::vector<const TrackStateOnSurface*>* -MaterialAllocator::leadingSpectrometerTSOS (const TrackParameters& spectrometerParameters) const -{ + std::vector<const TrackStateOnSurface*>* + MaterialAllocator::leadingSpectrometerTSOS(const TrackParameters& spectrometerParameters) const { // make sure the spectrometer entrance volume is available - if (! m_spectrometerEntrance) - { - if (! m_trackingGeometrySvc) - { - // missing TrackingGeometrySvc - no leading material will be added - m_messageHelper->printWarning(0); - return 0; - } - else - { - m_spectrometerEntrance = m_trackingGeometrySvc->trackingGeometry()-> - trackingVolume("MuonSpectrometerEntrance"); - } - } - + if (!m_spectrometerEntrance) { + if (!m_trackingGeometrySvc) { + // missing TrackingGeometrySvc - no leading material will be added + m_messageHelper->printWarning(0); + return 0; + } else { + m_spectrometerEntrance = m_trackingGeometrySvc->trackingGeometry()-> + trackingVolume("MuonSpectrometerEntrance"); + } + } + // check input parameters are really in the spectrometer - if (m_calorimeterVolume->inside(spectrometerParameters.position())) return 0; + if (m_calorimeterVolume->inside(spectrometerParameters.position())) return 0; const TrackParameters* entranceParameters = - m_spectrometerExtrapolator->extrapolateToVolume(spectrometerParameters, - *m_spectrometerEntrance, - anyDirection, - Trk::nonInteracting); - if (! entranceParameters) - { - ATH_MSG_VERBOSE( std::setiosflags(std::ios::fixed) - << "leadingSpectrometerTSOS: no material found from RZ" - << std::setw(9) << std::setprecision(3) - << spectrometerParameters.position().perp() - << std::setw(10) << std::setprecision(3) - << spectrometerParameters.position().z() - << " with p " << std::setw(8) << std::setprecision(3) - << spectrometerParameters.momentum().mag()/Gaudi::Units::GeV ); - return 0; - } - - const Surface& entranceSurface = entranceParameters->associatedSurface(); - const std::vector<const TrackStateOnSurface*>* extrapolatedTSOS = - extrapolatedMaterial(m_spectrometerExtrapolator, - spectrometerParameters, - entranceSurface, - anyDirection, - false, - Trk::muon); + m_spectrometerExtrapolator->extrapolateToVolume(spectrometerParameters, + *m_spectrometerEntrance, + anyDirection, + Trk::nonInteracting); + if (!entranceParameters) { + ATH_MSG_VERBOSE(std::setiosflags(std::ios::fixed) + << "leadingSpectrometerTSOS: no material found from RZ" + << std::setw(9) << std::setprecision(3) + << spectrometerParameters.position().perp() + << std::setw(10) << std::setprecision(3) + << spectrometerParameters.position().z() + << " with p " << std::setw(8) << std::setprecision(3) + << spectrometerParameters.momentum().mag() / Gaudi::Units::GeV); + return 0; + } + + const Surface& entranceSurface = entranceParameters->associatedSurface(); + const std::vector<const TrackStateOnSurface*>* extrapolatedTSOS = + extrapolatedMaterial(m_spectrometerExtrapolator, + spectrometerParameters, + entranceSurface, + anyDirection, + false, + Trk::muon); delete entranceParameters; - if (! extrapolatedTSOS - || ! extrapolatedTSOS->size() - || ! extrapolatedTSOS->front()->trackParameters()) - { - ATH_MSG_VERBOSE( std::setiosflags(std::ios::fixed) - << "leadingSpectrometerTSOS: no material found from RZ" - << std::setw(9) << std::setprecision(3) - << spectrometerParameters.position().perp() - << std::setw(10) << std::setprecision(3) - << spectrometerParameters.position().z() - << " with p " << std::setw(8) << std::setprecision(3) - << spectrometerParameters.momentum().mag()/Gaudi::Units::GeV ); - delete extrapolatedTSOS; - return 0; - } - - std::vector<FitMeasurement*> leadingMeasurements; + if (!extrapolatedTSOS + || !extrapolatedTSOS->size() + || !extrapolatedTSOS->front()->trackParameters()) { + ATH_MSG_VERBOSE(std::setiosflags(std::ios::fixed) + << "leadingSpectrometerTSOS: no material found from RZ" + << std::setw(9) << std::setprecision(3) + << spectrometerParameters.position().perp() + << std::setw(10) << std::setprecision(3) + << spectrometerParameters.position().z() + << " with p " << std::setw(8) << std::setprecision(3) + << spectrometerParameters.momentum().mag() / Gaudi::Units::GeV); + delete extrapolatedTSOS; + return 0; + } + + std::vector<FitMeasurement*> leadingMeasurements; std::vector<const TrackStateOnSurface*>* leadingTSOS = new std::vector<const TrackStateOnSurface*>; leadingTSOS->reserve(extrapolatedTSOS->size()); - double outgoingEnergy = spectrometerParameters.momentum().mag(); - double particleMass = ParticleMasses().mass[Trk::muon]; + double outgoingEnergy = spectrometerParameters.momentum().mag(); + double particleMass = ParticleMasses().mass[Trk::muon]; for (std::vector<const TrackStateOnSurface*>::const_iterator s = extrapolatedTSOS->begin(); - s != extrapolatedTSOS->end(); - ++s) - { - if (! (**s).trackParameters()) continue; - FitMeasurement* measurement = measurementFromTSOS(**s,outgoingEnergy,particleMass); - outgoingEnergy = (**s).trackParameters()->momentum().mag(); - - if (measurement) - { - leadingMeasurements.insert(leadingMeasurements.begin(),measurement); - } - else - { - leadingTSOS->push_back((**s).clone()); - } + s != extrapolatedTSOS->end(); + ++s) { + if (!(**s).trackParameters()) continue; + FitMeasurement* measurement = measurementFromTSOS(**s, outgoingEnergy, particleMass); + outgoingEnergy = (**s).trackParameters()->momentum().mag(); + + if (measurement) { + leadingMeasurements.insert(leadingMeasurements.begin(), measurement); + } else { + leadingTSOS->push_back((**s).clone()); + } } // convert back to TSOS std::vector<FitMeasurement*>::iterator m = leadingMeasurements.begin(); - for ( ; m != leadingMeasurements.end(); ++m) - leadingTSOS->push_back(new TrackStateOnSurface(0, - 0, - 0, - (**m).materialEffects()->clone())); - + for (; m != leadingMeasurements.end(); ++m) + leadingTSOS->push_back(new TrackStateOnSurface(0, + 0, + 0, + (**m).materialEffects()->clone())); + deleteMaterial(extrapolatedTSOS); - + // debug - if (msgLvl(MSG::VERBOSE) && ! leadingTSOS->empty()) - { - ATH_MSG_VERBOSE( std::setiosflags(std::ios::fixed) - << "leadingSpectrometerTSOS: from RZ" - << std::setw(9) << std::setprecision(3) - << spectrometerParameters.position().perp() - << std::setw(10) << std::setprecision(3) - << spectrometerParameters.position().z() - << " with p " << std::setw(8) << std::setprecision(3) - << spectrometerParameters.momentum().mag()/Gaudi::Units::GeV ); - printMeasurements(leadingMeasurements); + if (msgLvl(MSG::VERBOSE) && !leadingTSOS->empty()) { + ATH_MSG_VERBOSE(std::setiosflags(std::ios::fixed) + << "leadingSpectrometerTSOS: from RZ" + << std::setw(9) << std::setprecision(3) + << spectrometerParameters.position().perp() + << std::setw(10) << std::setprecision(3) + << spectrometerParameters.position().z() + << " with p " << std::setw(8) << std::setprecision(3) + << spectrometerParameters.momentum().mag() / Gaudi::Units::GeV); + printMeasurements(leadingMeasurements); } // clean up for (m = leadingMeasurements.begin(); m != leadingMeasurements.end(); ++m) - delete *m; + delete *m; leadingMeasurements.clear(); return leadingTSOS; -} - -void -MaterialAllocator::orderMeasurements(std::vector<FitMeasurement*>& measurements, - Amg::Vector3D startDirection, - Amg::Vector3D startPosition) const -{ + } + + void + MaterialAllocator::orderMeasurements(std::vector<FitMeasurement*>& measurements, + Amg::Vector3D startDirection, + Amg::Vector3D startPosition) const { // order measurements - ATH_MSG_VERBOSE( " measurement ordering with startDirection phi " - << startDirection.phi() << " theta " << startDirection.theta()); - - // note: preserve original order for close double measurements (such as crossed eta/phi) + ATH_MSG_VERBOSE(" measurement ordering with startDirection phi " + << startDirection.phi() << " theta " << startDirection.theta()); + + // note: preserve original order for close double measurements (such as crossed eta/phi) double previousDistance = -m_orderingTolerance; std::vector< std::pair<double, FitMeasurement*> > measurementOrder; std::vector< std::pair<double, FitMeasurement*> > originalOrder; for (std::vector<FitMeasurement*>::const_iterator m = measurements.begin(); - m != measurements.end(); - ++m) - { - double distance = - startDirection.dot((**m).intersection(FittedTrajectory).position() - startPosition); - if (distance < previousDistance) distance += m_orderingTolerance; - previousDistance = distance - m_orderingTolerance; - measurementOrder.push_back(std::make_pair(distance,*m)); - originalOrder.push_back(std::make_pair(distance,*m)); + m != measurements.end(); + ++m) { + double distance = + startDirection.dot((**m).intersection(FittedTrajectory).position() - startPosition); + if (distance < previousDistance) distance += m_orderingTolerance; + previousDistance = distance - m_orderingTolerance; + measurementOrder.push_back(std::make_pair(distance, *m)); + originalOrder.push_back(std::make_pair(distance, *m)); } std::sort(measurementOrder.begin(), measurementOrder.end(), compareByDistance()); std::vector< std::pair<double, FitMeasurement*> >::const_iterator orig = originalOrder.begin(); - bool shouldReorder = false; - if (m_allowReordering) - measurements.erase(measurements.begin(),measurements.end()); - + bool shouldReorder = false; + if (m_allowReordering) measurements.erase(measurements.begin(), measurements.end()); + for (std::vector< std::pair<double, FitMeasurement*> >::const_iterator - order = measurementOrder.begin(); - order != measurementOrder.end(); - ++order, ++orig) - { - if (m_allowReordering) - { - measurements.push_back((*order).second); - } - - // signal if reordering would help - // FIXME add tolerance - if ((*order).second == (*orig).second - || std::abs((*order).first - (*orig).first) < m_orderingTolerance) continue; - shouldReorder = true; - // ATH_MSG_INFO( " reorder distance " << (*order).first - (*orig).first ); - } - - if (shouldReorder) - { - if (m_allowReordering) - { - ATH_MSG_DEBUG( " measurements have been reordered " ); - } - else - { - ATH_MSG_DEBUG( " measurement reordering would improve the track fit " ); - } - } -} - -bool -MaterialAllocator::reallocateMaterial (std::vector<FitMeasurement*>& measurements, - const FitParameters& parameters) const -{ - ATH_MSG_DEBUG( " reallocateSpectrometerMaterial " ); + order = measurementOrder.begin(); + order != measurementOrder.end(); + ++order, ++orig) { + if (m_allowReordering) { + measurements.push_back((*order).second); + } + + // signal if reordering would help + // FIXME add tolerance + if ((*order).second == (*orig).second + || std::abs((*order).first - (*orig).first) < m_orderingTolerance) continue; + shouldReorder = true; + // ATH_MSG_INFO( " reorder distance " << (*order).first - (*orig).first ); + } + + if (shouldReorder) { + if (m_allowReordering) { + ATH_MSG_DEBUG(" measurements have been reordered "); + } else { + ATH_MSG_DEBUG(" measurement reordering would improve the track fit "); + } + } + } + + bool + MaterialAllocator::reallocateMaterial(std::vector<FitMeasurement*>& measurements, + const FitParameters& parameters) const { + ATH_MSG_DEBUG(" reallocateSpectrometerMaterial "); int n = 0; for (std::vector<Trk::FitMeasurement*>::iterator m = measurements.begin(); - m != measurements.end(); - ++m) - { - if (! (**m).isMaterialDelimiter()) continue; - - double distance = ((**m).intersection(FittedTrajectory).position() - (**m).position()).mag(); - ATH_MSG_INFO( std::setiosflags(std::ios::fixed) << std::setw(5) << ++n - << std::setw(10) << std::setprecision(3) << distance - << " " << (**m).type() - << std::setw(10) << std::setprecision(1) - << (**m).intersection(FittedTrajectory).position().perp() - << std::setw(9) << std::setprecision(4) - << (**m).intersection(FittedTrajectory).position().phi() - << std::setw(10) << std::setprecision(1) - << (**m).intersection(FittedTrajectory).position().z() ); + m != measurements.end(); + ++m) { + if (!(**m).isMaterialDelimiter()) continue; + + double distance = ((**m).intersection(FittedTrajectory).position() - (**m).position()).mag(); + ATH_MSG_INFO(std::setiosflags(std::ios::fixed) << std::setw(5) << ++n + << std::setw(10) << std::setprecision(3) << distance + << " " << (**m).type() + << std::setw(10) << std::setprecision(1) + << (**m).intersection(FittedTrajectory).position().perp() + << std::setw(9) << std::setprecision(4) + << (**m).intersection(FittedTrajectory).position().phi() + << std::setw(10) << std::setprecision(1) + << (**m).intersection(FittedTrajectory).position().z()); } // put iterator at MS entrance double qOverP = 0; - ATH_MSG_INFO( "qOverP " << qOverP ); - + ATH_MSG_INFO("qOverP " << qOverP); + std::vector<Trk::FitMeasurement*>::iterator m = measurements.begin(); - for ( ; m != measurements.end(); ++m) - { - if (m_calorimeterVolume->inside((**m).position())) - { - // save qOverP for following use with spectrometer - if ((**m).materialEffects()) qOverP = (**m).qOverP(); - if ((**m).isMaterialDelimiter()) ATH_MSG_INFO( " at material delimiter" ); - ATH_MSG_INFO( "qOverP " << qOverP ); - } - else - { - if ((**m).isMaterialDelimiter()) ATH_MSG_INFO( " at material delimiter" ); - break; - } + for (; m != measurements.end(); ++m) { + if (m_calorimeterVolume->inside((**m).position())) { + // save qOverP for following use with spectrometer + if ((**m).materialEffects()) qOverP = (**m).qOverP(); + if ((**m).isMaterialDelimiter()) ATH_MSG_INFO(" at material delimiter"); + ATH_MSG_INFO("qOverP " << qOverP); + } else { + if ((**m).isMaterialDelimiter()) ATH_MSG_INFO(" at material delimiter"); + break; + } } // allocate material from outside inwards @@ -1058,881 +937,839 @@ MaterialAllocator::reallocateMaterial (std::vector<FitMeasurement*>& measurement // protect the momentum to avoid excessive Eloss Amg::VectorX parameterVector = trackParameters->parameters(); double Emax = 50000.; - if(parameterVector[Trk::qOverP]==0.) { - parameterVector[Trk::qOverP] = 1./Emax; + if (parameterVector[Trk::qOverP] == 0.) { + parameterVector[Trk::qOverP] = 1. / Emax; } else { - if(std::abs(parameterVector[Trk::qOverP])*Emax < 1) parameterVector[Trk::qOverP] = trackParameters->charge()/Emax; - } + if (std::abs(parameterVector[Trk::qOverP]) * Emax < + 1) parameterVector[Trk::qOverP] = trackParameters->charge() / Emax; + } // correct track parameters for high momentum track (otherwise Eloss is too large) trackParameters = (trackParameters->associatedSurface()).createTrackParameters(parameterVector[Trk::loc1], - parameterVector[Trk::loc2],parameterVector[Trk::phi], - parameterVector[Trk::theta],parameterVector[Trk::qOverP],0); + parameterVector[Trk::loc2], + parameterVector[Trk::phi], + parameterVector[Trk::theta], + parameterVector[Trk::qOverP], 0); for (std::vector<Trk::FitMeasurement*>::reverse_iterator r = measurements.rbegin(); - r != measurements.rend(); - ++r) - { - if (! (**r).isMaterialDelimiter()) continue; - const std::vector<const TrackStateOnSurface*>* spectrometerMaterial = - extrapolatedMaterial(m_spectrometerExtrapolator, - *trackParameters, - *(**r).surface(), - oppositeMomentum, - false, - Trk::muon); - - if (spectrometerMaterial && ! spectrometerMaterial->empty()) - { -// for (std::vector<const TrackStateOnSurface*>::const_reverse_iterator s = -// spectrometerMaterial->rbegin(); -// s != spectrometerMaterial->rend(); -// ++s) -// { -// if (! (**s).trackParameters() || ! (**s).materialEffectsOnTrack()) continue; -// ATH_MSG_INFO( " material " << (**s).trackParameters()->position() ); -// } - - std::pair<FitMeasurement*,FitMeasurement*> fms = materialAggregation(*spectrometerMaterial, - measurements, - mass); - delete fms.first; - delete fms.second; - //ATH_MSG_INFO( " delete TSOS " ); - - for (std::vector<const TrackStateOnSurface*>::const_iterator s = - spectrometerMaterial->begin(); - s != spectrometerMaterial->end(); - ++s) - delete *s; - } - // ATH_MSG_INFO( " delete material " ); - delete spectrometerMaterial; - delete trackParameters; - - MsgStream log(msgSvc(), name()); - trackParameters = parameters.trackParameters(log, **r); - } - + r != measurements.rend(); + ++r) { + if (!(**r).isMaterialDelimiter()) continue; + const std::vector<const TrackStateOnSurface*>* spectrometerMaterial = + extrapolatedMaterial(m_spectrometerExtrapolator, + *trackParameters, + *(**r).surface(), + oppositeMomentum, + false, + Trk::muon); + + if (spectrometerMaterial && !spectrometerMaterial->empty()) { +// for (std::vector<const TrackStateOnSurface*>::const_reverse_iterator s = +// spectrometerMaterial->rbegin(); +// s != spectrometerMaterial->rend(); +// ++s) +// { +// if (! (**s).trackParameters() || ! (**s).materialEffectsOnTrack()) continue; +// ATH_MSG_INFO( " material " << (**s).trackParameters()->position() ); +// } + + std::pair<FitMeasurement*, FitMeasurement*> fms = materialAggregation(*spectrometerMaterial, + measurements, + mass); + delete fms.first; + delete fms.second; + //ATH_MSG_INFO( " delete TSOS " ); + + for (std::vector<const TrackStateOnSurface*>::const_iterator s = + spectrometerMaterial->begin(); + s != spectrometerMaterial->end(); + ++s) + delete *s; + } + // ATH_MSG_INFO( " delete material " ); + delete spectrometerMaterial; + delete trackParameters; + + MsgStream log(msgSvc(), name()); + trackParameters = parameters.trackParameters(log, **r); + } + delete trackParameters; - + // erase materialDelimiters - for (m = measurements.begin(); m != measurements.end(); ++m) - { - if (! (**m).isMaterialDelimiter()) continue; - delete *m; - std::vector<Trk::FitMeasurement*>::iterator n = m; - --m; - measurements.erase(n); - } - + for (m = measurements.begin(); m != measurements.end(); ++m) { + if (!(**m).isMaterialDelimiter()) continue; + delete *m; + std::vector<Trk::FitMeasurement*>::iterator n = m; + --m; + measurements.erase(n); + } + return true; -} + } -void -MaterialAllocator::addSpectrometerDelimiters (std::vector<FitMeasurement*>& measurements) const -{ + void + MaterialAllocator::addSpectrometerDelimiters(std::vector<FitMeasurement*>& measurements) const { // insert delimiters representing station limits for later material aggregation // preBreak: put delimiter upstream of measurement // postBreak: put delimiter downstream of previous measurement // FIXME: modify aggregation function: no aggregation in EC toroid region (~11m) // FIXME: single scatterer in outer delimited pair //printMeasurements(measurements); - FitMeasurement* previous = 0; - double previousDistance = 0.; + FitMeasurement* previous = 0; + double previousDistance = 0.; + Amg::Vector3D startDirection; Amg::Vector3D startPosition; Amg::Vector3D referenceDirection; Amg::Vector3D referencePosition; - double referencePhi = 0.; - int index = 1; + double referencePhi = 0.; + int index = 1; for (std::vector<FitMeasurement*>::iterator m = measurements.begin(); - m != measurements.end(); - ++m, ++index) - { - // skip 'non'-measurements - if (! (**m).isPositionMeasurement() || (**m).isPseudo()) continue; - - // material delimiters in MS follow the entrance break which should be already present - Amg::Vector3D position = (**m).position(); - if (m_calorimeterVolume->inside(position)) continue; - - // break can be before measurement or after previous measurement - bool preBreak = false; - bool postBreak = false; - double distance = 0.; - if (! previous) - { - // preBreak at first measurement in MS - preBreak = true; - referenceDirection = (**m).intersection(FittedTrajectory).direction(); - referencePosition = (**m).intersection(FittedTrajectory).position(); - referencePhi = position.phi(); - startDirection = referenceDirection; - startPosition = referencePosition; - } - else - { - // post and pre breaks for cluster/drift transition, - // large gap between measurements, - // sector overlap - distance = referenceDirection.dot((**m).intersection(FittedTrajectory).position() - referencePosition); - if (((**m).isDrift() && ! previous->isDrift()) - || (! (**m).isDrift() && previous->isDrift()) - || distance > m_stationMaxGap - || ((**m).isDrift() && std::abs(position.phi() - referencePhi) > m_sectorMaxPhi)) - { - preBreak = true; - if (distance > previousDistance + m_scattererMinGap) postBreak = true; - } - } - - if (! (preBreak || postBreak)) - { - previous = *m; - previousDistance = distance; - continue; - } - -// /////// -// msg(MSG::INFO) << std::setiosflags(std::ios::fixed) -// << " index" << std::setw(3) << index+1 -// << " at " << std::setw(10) << std::setprecision(1) -// << startDirection.dot( -// (**m).intersection(FittedTrajectory).position() - startPosition) -// << std::setw(10) << std::setprecision(1) << distance -// << std::setw(9) << std::setprecision(4) -// << std::abs(position.phi() - referencePhi); -// if (preBreak) msg() << " preBreak "; -// if (postBreak) msg() << " postBreak "; -// if ((**m).isDrift()) msg() << " isDrift "; -// msg() << endmsg; -// /////// - - if (postBreak && previous) - { - // if (distance < offset) offset = 0.5*distance; - FitMeasurement* current = *m; - while (*m != previous) --m; - FitMeasurement* delimiter = - new FitMeasurement((**m).intersection(FittedTrajectory), 0.5*m_scattererMinGap); - m = measurements.insert(++m,delimiter); - while (*m != current) ++m; - } - if (preBreak) - { - double offset = -0.5*m_scattererMinGap; - if (distance - previousDistance < m_scattererMinGap) - offset = 0.5*(previousDistance-distance); - - FitMeasurement* delimiter = - new FitMeasurement((**m).intersection(FittedTrajectory), offset); - m = measurements.insert(m,delimiter); - ++m; - } - previous = *m; - previousDistance = 0.; - referenceDirection = (**m).intersection(FittedTrajectory).direction(); - referencePosition = (**m).intersection(FittedTrajectory).position(); - referencePhi = position.phi(); + m != measurements.end(); + ++m, ++index) { + // skip 'non'-measurements + if (!(**m).isPositionMeasurement() || (**m).isPseudo()) continue; + + // material delimiters in MS follow the entrance break which should be already present + Amg::Vector3D position = (**m).position(); + if (m_calorimeterVolume->inside(position)) continue; + + // break can be before measurement or after previous measurement + bool preBreak = false; + bool postBreak = false; + double distance = 0.; + if (!previous) { + // preBreak at first measurement in MS + preBreak = true; + referenceDirection = (**m).intersection(FittedTrajectory).direction(); + referencePosition = (**m).intersection(FittedTrajectory).position(); + referencePhi = position.phi(); + startDirection = referenceDirection; + startPosition = referencePosition; + } else { + // post and pre breaks for cluster/drift transition, + // large gap between measurements, + // sector overlap + distance = referenceDirection.dot((**m).intersection(FittedTrajectory).position() - referencePosition); + if (((**m).isDrift() && !previous->isDrift()) + || (!(**m).isDrift() && previous->isDrift()) + || distance > m_stationMaxGap + || ((**m).isDrift() && std::abs(position.phi() - referencePhi) > m_sectorMaxPhi)) { + preBreak = true; + if (distance > previousDistance + m_scattererMinGap) postBreak = true; + } + } + + if (!(preBreak || postBreak)) { + previous = *m; + previousDistance = distance; + continue; + } + +// /////// +// msg(MSG::INFO) << std::setiosflags(std::ios::fixed) +// << " index" << std::setw(3) << index+1 +// << " at " << std::setw(10) << std::setprecision(1) +// << startDirection.dot( +// (**m).intersection(FittedTrajectory).position() - startPosition) +// << std::setw(10) << std::setprecision(1) << distance +// << std::setw(9) << std::setprecision(4) +// << std::abs(position.phi() - referencePhi); +// if (preBreak) msg() << " preBreak "; +// if (postBreak) msg() << " postBreak "; +// if ((**m).isDrift()) msg() << " isDrift "; +// msg() << endmsg; +// /////// + + if (postBreak && previous) { + // if (distance < offset) offset = 0.5*distance; + FitMeasurement* current = *m; + while (*m != previous) --m; + FitMeasurement* delimiter = + new FitMeasurement((**m).intersection(FittedTrajectory), 0.5 * m_scattererMinGap); + m = measurements.insert(++m, delimiter); + while (*m != current) ++m; + } + if (preBreak) { + double offset = -0.5 * m_scattererMinGap; + if (distance - previousDistance < m_scattererMinGap) offset = 0.5 * (previousDistance - distance); + + FitMeasurement* delimiter = + new FitMeasurement((**m).intersection(FittedTrajectory), offset); + m = measurements.insert(m, delimiter); + ++m; + } + previous = *m; + previousDistance = 0.; + referenceDirection = (**m).intersection(FittedTrajectory).direction(); + referencePosition = (**m).intersection(FittedTrajectory).position(); + referencePhi = position.phi(); } // orderMeasurements(measurements,startDirection,startPosition); // printMeasurements(measurements); -} - -void -MaterialAllocator::deleteMaterial (const std::vector<const TrackStateOnSurface*>* material) const -{ - if (! m_temporaryTSOS) m_temporaryTSOS = new std::vector<const TrackStateOnSurface*>; + } + + void + MaterialAllocator::deleteMaterial(const std::vector<const TrackStateOnSurface*>* material) const { + if (!m_temporaryTSOS) m_temporaryTSOS = new std::vector<const TrackStateOnSurface*>; unsigned size = m_temporaryTSOS->size(); - if (material) - { - size += material->size(); - m_temporaryTSOS->reserve(size); - for (std::vector<const TrackStateOnSurface*>::const_iterator s = material->begin(); - s != material->end(); - ++s) - { - m_temporaryTSOS->push_back(*s); - } - delete material; - } -} - -const std::vector<const TrackStateOnSurface*>* -MaterialAllocator::extrapolatedMaterial (const ToolHandle<IExtrapolator>& extrapolator, - const TrackParameters& parameters, - const Surface& surface, - PropDirection dir, - BoundaryCheck boundsCheck, - ParticleHypothesis particleHypothesis) const -{ + if (material) { + size += material->size(); + m_temporaryTSOS->reserve(size); + for (std::vector<const TrackStateOnSurface*>::const_iterator s = material->begin(); + s != material->end(); + ++s) { + m_temporaryTSOS->push_back(*s); + } + delete material; + } + } + + const std::vector<const TrackStateOnSurface*>* + MaterialAllocator::extrapolatedMaterial(const ToolHandle<IExtrapolator>& extrapolator, + const TrackParameters& parameters, + const Surface& surface, + PropDirection dir, + BoundaryCheck boundsCheck, + ParticleHypothesis particleHypothesis) const { // fix up material duplication appearing after recent TrackingGeometry speed-up const std::vector<const TrackStateOnSurface*>* TGMaterial = - extrapolator->extrapolateM(parameters,surface,dir,boundsCheck,particleHypothesis); - if (! TGMaterial || TGMaterial->empty()) return TGMaterial; + extrapolator->extrapolateM(parameters, surface, dir, boundsCheck, particleHypothesis); + + if (!TGMaterial || TGMaterial->empty()) return TGMaterial; - std::vector<const TrackStateOnSurface*>* duplicates = 0; - std::vector<const TrackStateOnSurface*>* material = new std::vector<const TrackStateOnSurface*>; + std::vector<const TrackStateOnSurface*>* duplicates = 0; + std::vector<const TrackStateOnSurface*>* material = new std::vector<const TrackStateOnSurface*>; material->reserve(TGMaterial->size()); std::vector<const TrackStateOnSurface*>::const_iterator tg = TGMaterial->begin(); material->push_back(*tg); ++tg; - for ( ; - tg != TGMaterial->end(); - ++tg) - { - const TrackStateOnSurface* TSOS = material->back(); - double separation = 0.; - if (TSOS->trackParameters()) - separation = (TSOS->trackParameters()->position() - (**tg).trackParameters()->position()).mag(); - - if (separation > 0.001*Gaudi::Units::mm) - { - material->push_back(*tg); - } - else - { - ATH_MSG_VERBOSE( std::setiosflags(std::ios::fixed) << " duplicate: RZ" - << std::setw(9) << std::setprecision(3) - << (**tg).trackParameters()->position().perp() - << std::setw(10) << std::setprecision(3) - << (**tg).trackParameters()->position().z()); - if (! duplicates) duplicates = new std::vector<const TrackStateOnSurface*>; - duplicates->push_back(*tg); - } + for (; + tg != TGMaterial->end(); + ++tg) { + const TrackStateOnSurface* TSOS = material->back(); + double separation = 0.; + if (TSOS->trackParameters()) separation = + (TSOS->trackParameters()->position() - (**tg).trackParameters()->position()).mag(); + + if (separation > 0.001 * Gaudi::Units::mm) { + material->push_back(*tg); + } else { + ATH_MSG_VERBOSE(std::setiosflags(std::ios::fixed) << " duplicate: RZ" + << std::setw(9) << std::setprecision(3) + << (**tg).trackParameters()->position().perp() + << std::setw(10) << std::setprecision(3) + << (**tg).trackParameters()->position().z()); + if (!duplicates) duplicates = new std::vector<const TrackStateOnSurface*>; + duplicates->push_back(*tg); + } } delete TGMaterial; if (duplicates) deleteMaterial(duplicates); return material; -} + } -void -MaterialAllocator::indetMaterial (std::vector<FitMeasurement*>& measurements, - ParticleHypothesis particleHypothesis, - const TrackParameters& startParameters) const -{ + void + MaterialAllocator::indetMaterial(std::vector<FitMeasurement*>& measurements, + ParticleHypothesis particleHypothesis, + const TrackParameters& startParameters) const { // gather material between first and last measurements inside indet volume // allow a few mm radial tolerance around first&last measurements for their associated material - double tolerance = 10.*Gaudi::Units::mm/startParameters.momentum().unit().perp(); - + double tolerance = 10. * Gaudi::Units::mm / startParameters.momentum().unit().perp(); + // loop over measurements to define portions of track needing indet material - double endIndetDistance = 0.; - FitMeasurement* endIndetMeasurement = 0; - double qOverP = startParameters.charge()/startParameters.momentum().mag(); - Amg::Vector3D startDirection = startParameters.momentum().unit(); - Amg::Vector3D startPosition = startParameters.position(); - const TrackParameters* parameters = &startParameters; + double endIndetDistance = 0.; + FitMeasurement* endIndetMeasurement = 0; + double qOverP = startParameters.charge() / startParameters.momentum().mag(); + + Amg::Vector3D startDirection = startParameters.momentum().unit(); + Amg::Vector3D startPosition = startParameters.position(); + const TrackParameters* parameters = &startParameters; std::vector<Trk::FitMeasurement*>::iterator m = measurements.begin(); if ((**m).isVertex()) ++m; - for ( ; m != measurements.end(); ++m) - { - if ((**m).isOutlier()) continue; - if (m_indetVolume->inside((**m).position())) - { - // quit if pre-existing indet material - if ((**m).isScatterer()) - { - if (parameters != &startParameters) delete parameters; //parameters was 'newed' - return; - } - - // use first measurement at a plane surface to create starting parameters - if (! (**m).isPositionMeasurement()) continue; - if (! endIndetMeasurement - && (**m).hasIntersection(FittedTrajectory) - && ((**m).surface()->type() == Surface::SurfaceType::Plane - || (**m).surface()->type() == Surface::SurfaceType::Disc )) - { - const TrackSurfaceIntersection* intersection = &(**m).intersection(FittedTrajectory); - Amg::Vector3D offset = intersection->direction()*tolerance; - CurvilinearUVT uvt(intersection->direction()); - PlaneSurface plane(intersection->position() - offset,uvt); - - if( m_useStepPropagator==99) { - const TrackSurfaceIntersection* newIntersectionSTEP = - m_stepPropagator->intersectSurface(plane, - intersection, - qOverP, - Trk::MagneticFieldProperties(Trk::FullField), - Trk::muon); - intersection = m_intersector->intersectSurface(plane, - intersection, - qOverP); - if(newIntersectionSTEP&&intersection) { + for (; m != measurements.end(); ++m) { + if ((**m).isOutlier()) continue; + if (m_indetVolume->inside((**m).position())) { + // quit if pre-existing indet material + if ((**m).isScatterer()) { + if (parameters != &startParameters) delete parameters; //parameters was 'newed' + return; + } + + // use first measurement at a plane surface to create starting parameters + if (!(**m).isPositionMeasurement()) continue; + if (!endIndetMeasurement + && (**m).hasIntersection(FittedTrajectory) + && ((**m).surface()->type() == Surface::SurfaceType::Plane + || (**m).surface()->type() == Surface::SurfaceType::Disc)) { + const TrackSurfaceIntersection* intersection = &(**m).intersection(FittedTrajectory); + Amg::Vector3D offset = intersection->direction() * tolerance; + CurvilinearUVT uvt(intersection->direction()); + PlaneSurface plane(intersection->position() - offset, uvt); + + if (m_useStepPropagator == 99) { + const TrackSurfaceIntersection* newIntersectionSTEP = + m_stepPropagator->intersectSurface(plane, + intersection, + qOverP, + Trk::MagneticFieldProperties(Trk::FullField), + Trk::muon); + intersection = m_intersector->intersectSurface(plane, + intersection, + qOverP); + if (newIntersectionSTEP && intersection) { // double dist = 1000.*(newIntersectionSTEP->position()-intersection->position()).mag(); // std::cout << " iMat 3 distance STEP and Intersector " << dist << std::endl; // if(dist>10.) std::cout << " iMat 3 ALARM distance STEP and Intersector " << dist << std::endl; - delete newIntersectionSTEP; - } else { + delete newIntersectionSTEP; + } else { // if(intersection) std::cout << " iMat 3 ALARM STEP did not intersect! " << std::endl; - } - } else { - intersection = m_useStepPropagator>=1? - m_stepPropagator->intersectSurface(plane, - intersection, - qOverP, - m_stepField, - Trk::muon): - m_intersector->intersectSurface(plane, - intersection, - qOverP); - } - Amg::Vector2D localPos; - if (intersection - && plane.globalToLocal(intersection->position(), - intersection->direction(), - localPos)) - { - if (parameters != &startParameters) delete parameters; //parameters was 'newed' already - parameters = new AtaPlane(localPos[locR], - localPos[locZ], - intersection->direction().phi(), - intersection->direction().theta(), - qOverP, - plane); - startDirection = intersection->direction(); - startPosition = intersection->position(); - } - delete intersection; - } - - // save the last indet measurement, signal any out-of-order meas - double distance = - startDirection.dot((**m).intersection(FittedTrajectory).position() - startPosition); - if (! endIndetMeasurement || distance > endIndetDistance) - { - endIndetDistance = distance; - endIndetMeasurement = *m; - } - } - else // outside indet - { - break; - } - } - if (! endIndetMeasurement) - { - if (parameters != &startParameters) delete parameters; - return; - } - - ATH_MSG_DEBUG( " indetMaterial: ALARM no material found on track"); - + } + } else { + intersection = m_useStepPropagator >= 1 ? + m_stepPropagator->intersectSurface(plane, + intersection, + qOverP, + m_stepField, + Trk::muon) : + m_intersector->intersectSurface(plane, + intersection, + qOverP); + } + Amg::Vector2D localPos; + if (intersection + && plane.globalToLocal(intersection->position(), + intersection->direction(), + localPos)) { + if (parameters != &startParameters) delete parameters; //parameters was 'newed' already + parameters = new AtaPlane(localPos[locR], + localPos[locZ], + intersection->direction().phi(), + intersection->direction().theta(), + qOverP, + plane); + startDirection = intersection->direction(); + startPosition = intersection->position(); + } + delete intersection; + } + + // save the last indet measurement, signal any out-of-order meas + double distance = + startDirection.dot((**m).intersection(FittedTrajectory).position() - startPosition); + if (!endIndetMeasurement || distance > endIndetDistance) { + endIndetDistance = distance; + endIndetMeasurement = *m; + } + } else { // outside indet + break; + } + } + if (!endIndetMeasurement) { + if (parameters != &startParameters) delete parameters; + return; + } + + ATH_MSG_DEBUG(" indetMaterial: ALARM no material found on track"); + // allocate indet material from TrackingGeometry - Amg::Vector3D endPosition = endIndetMeasurement->intersection(FittedTrajectory).position(); - startDirection = (endPosition - startPosition).unit(); - endIndetDistance = startDirection.dot(endPosition - startPosition) + tolerance; - ATH_MSG_VERBOSE( " indetMaterial: using extrapolateM out to distance " << endIndetDistance ); + Amg::Vector3D endPosition = endIndetMeasurement->intersection(FittedTrajectory).position(); + startDirection = (endPosition - startPosition).unit(); + endIndetDistance = startDirection.dot(endPosition - startPosition) + tolerance; + ATH_MSG_VERBOSE(" indetMaterial: using extrapolateM out to distance " << endIndetDistance); const std::vector<const TrackStateOnSurface*>* indetMaterial = - extrapolatedMaterial(m_extrapolator, - *parameters, - *endIndetMeasurement->surface(), - alongMomentum, - false, - particleHypothesis); - - if (parameters != &startParameters) delete parameters; - if (! indetMaterial || indetMaterial->empty()) - { - deleteMaterial(indetMaterial); - return; - } - + extrapolatedMaterial(m_extrapolator, + *parameters, + *endIndetMeasurement->surface(), + alongMomentum, + false, + particleHypothesis); + + if (parameters != &startParameters) delete parameters; + if (!indetMaterial || indetMaterial->empty()) { + deleteMaterial(indetMaterial); + return; + } + // insert the material into the measurement list // ignore trailing material - with a few mm radial tolerance std::vector<const Surface*> surfaces; surfaces.reserve(indetMaterial->size()); std::vector<const TrackStateOnSurface*>::const_iterator indetMaterialEnd = - indetMaterial->begin(); + indetMaterial->begin(); int trailing = indetMaterial->size(); for (std::vector<const TrackStateOnSurface*>::const_iterator s = indetMaterial->begin(); - s != indetMaterial->end(); - ++s, --trailing) - { - if ((**s).trackParameters()) - { - if (startDirection.dot((**s).trackParameters()->position()-startPosition) < endIndetDistance) - { - indetMaterialEnd = s; - ++indetMaterialEnd; - } - else - { - ATH_MSG_VERBOSE( " indetMaterial: " << trailing - << " trailing TSOS (after last measurement)" ); - break; - } - } - } + s != indetMaterial->end(); + ++s, --trailing) { + if ((**s).trackParameters()) { + if (startDirection.dot((**s).trackParameters()->position() - startPosition) < endIndetDistance) { + indetMaterialEnd = s; + ++indetMaterialEnd; + } else { + ATH_MSG_VERBOSE(" indetMaterial: " << trailing + << " trailing TSOS (after last measurement)"); + break; + } + } + } // return in case of extrapolateM problem - if (indetMaterialEnd == indetMaterial->begin()) - { - // extrapolateM finds no material on track !! - m_messageHelper->printWarning(1); - deleteMaterial(indetMaterial); - return; + if (indetMaterialEnd == indetMaterial->begin()) { + // extrapolateM finds no material on track !! + m_messageHelper->printWarning(1); + deleteMaterial(indetMaterial); + return; } // debug - if (msgLvl(MSG::VERBOSE)) - { - double p1 = indetMaterial->front()->trackParameters()->momentum().mag(); - - for (std::vector<const TrackStateOnSurface*>::const_iterator s = indetMaterial->begin(); - s != indetMaterialEnd; - ++s) - { - if (! (**s).trackParameters()) continue; - double distance = startDirection.dot((**s).trackParameters()->position() - startPosition); - double deltaE = 0.; - double thickness = 0.; - const MaterialEffectsOnTrack* materialEffects = - dynamic_cast<const MaterialEffectsOnTrack*>((**s).materialEffectsOnTrack()); - if ((**s).materialEffectsOnTrack()) - { - if (materialEffects) deltaE = materialEffects->energyLoss()->deltaE(); - thickness = (**s).materialEffectsOnTrack()->thicknessInX0(); - } - double p2 = (**s).trackParameters()->momentum().mag(); - ATH_MSG_VERBOSE( std::setiosflags(std::ios::fixed) << " material: RZ" - << std::setw(9) << std::setprecision(3) - << (**s).trackParameters()->position().perp() - << std::setw(10) << std::setprecision(3) - << (**s).trackParameters()->position().z() - << " distance " << std::setw(10) << std::setprecision(3) - << distance - << " pt " << std::setw(8) << std::setprecision(3) - << (**s).trackParameters()->momentum().perp()/Gaudi::Units::GeV - << " X0thickness " << std::setw(8) << std::setprecision(4) - << thickness - << " deltaE " << std::setw(8) << std::setprecision(4) - << deltaE - << " diffP " << std::setw(8) << std::setprecision(4) << p2 - p1 ); - p1 = p2; - } - } - + if (msgLvl(MSG::VERBOSE)) { + double p1 = indetMaterial->front()->trackParameters()->momentum().mag(); + + for (std::vector<const TrackStateOnSurface*>::const_iterator s = indetMaterial->begin(); + s != indetMaterialEnd; + ++s) { + if (!(**s).trackParameters()) continue; + double distance = startDirection.dot((**s).trackParameters()->position() - startPosition); + double deltaE = 0.; + double thickness = 0.; + const MaterialEffectsOnTrack* materialEffects = + dynamic_cast<const MaterialEffectsOnTrack*>((**s).materialEffectsOnTrack()); + if ((**s).materialEffectsOnTrack()) { + if (materialEffects) deltaE = materialEffects->energyLoss()->deltaE(); + thickness = (**s).materialEffectsOnTrack()->thicknessInX0(); + } + double p2 = (**s).trackParameters()->momentum().mag(); + ATH_MSG_VERBOSE(std::setiosflags(std::ios::fixed) << " material: RZ" + << std::setw(9) << std::setprecision(3) + << (**s).trackParameters()->position().perp() + << std::setw(10) << std::setprecision(3) + << (**s).trackParameters()->position().z() + << " distance " << std::setw(10) << std::setprecision(3) + << distance + << " pt " << std::setw(8) << std::setprecision(3) + << (**s).trackParameters()->momentum().perp() / Gaudi::Units::GeV + << " X0thickness " << std::setw(8) << std::setprecision(4) + << thickness + << " deltaE " << std::setw(8) << std::setprecision(4) + << deltaE + << " diffP " << std::setw(8) << std::setprecision( + 4) << p2 - p1); + p1 = p2; + } + } + // firstly: add the material belonging to each measurement layer (and skip leading material) - FitMeasurement* leadingDelimiter = 0; - Amg::Vector3D nextMomentum(0.,0.,0.); - Amg::Vector3D nextPosition(0.,0.,0.); + FitMeasurement* leadingDelimiter = 0; + Amg::Vector3D nextMomentum(0., 0., 0.); + Amg::Vector3D nextPosition(0., 0., 0.); m = measurements.begin(); std::vector<const TrackStateOnSurface*>::const_iterator s = indetMaterial->begin(); - for (; m != measurements.end(); ++m) - { - if (*m == endIndetMeasurement || s == indetMaterialEnd) break; - if (! leadingDelimiter && (**m).isOutlier()) continue; - - Amg::Vector3D direction = (**m).intersection(FittedTrajectory).direction(); - Amg::Vector3D position = (**m).intersection(FittedTrajectory).position(); - double closestDistance = direction.dot(position - startPosition); - const MaterialEffectsOnTrack* materialEffects = 0; - const TrackParameters* materialParameters = 0; - const Surface* materialSurface = 0; - - // find the closest material TSOS (inside radial tolerance) - for (; s != indetMaterialEnd; ++s) - { - if (! dynamic_cast<const MaterialEffectsOnTrack*>((**s).materialEffectsOnTrack()) - || ! (**s).trackParameters()) continue; - nextMomentum = (**s).trackParameters()->momentum(); - nextPosition = (**s).trackParameters()->position(); - double distance = direction.dot(nextPosition - position); - - // increasing distance - break when past minimum - if (distance > closestDistance) break; - - // downstream material - check not significantly closer to following measurement - // (material too early is better than too late) - if (distance > 0.) - { - ++m; - double nextDistance = direction.dot((**s).trackParameters()->position() - (**m).position()); - --m; - if (std::abs(nextDistance) < distance && distance > tolerance) - { - if (s != indetMaterial->begin()) --s; - materialSurface = 0; - break; - } - closestDistance = distance; - } - else - { - closestDistance = -distance; - } - - // when upstream of leading break any previous surface is going to be ignored - if (! leadingDelimiter && materialSurface) surfaces.push_back(materialSurface); - - materialEffects = dynamic_cast<const MaterialEffectsOnTrack*> - ((**s).materialEffectsOnTrack()); - materialParameters = (**s).trackParameters(); - materialSurface = &materialParameters->associatedSurface(); - } - - // skip if the material has not been allocated to a measurement surface - if (! materialSurface) continue; - - // or if it's already been allocated upstream - if (surfaces.size() && materialSurface == surfaces.back()) continue; - - // skip leading material during the fit (up to and including first measurement) - // insert an materialDelimiter so the leading material can be allocated after the fit converges - if (! leadingDelimiter) - { - position = 0.5*(materialParameters->position() + nextPosition); - direction = (materialParameters->momentum() + nextMomentum).unit(); - TrackSurfaceIntersection breakIntersection(position, direction, 0.); - leadingDelimiter = new FitMeasurement(breakIntersection, 0.); - while (*m != endIndetMeasurement - && direction.dot((**m).intersection(FittedTrajectory).position() - position) < 0.) - ++m; - m = measurements.insert(m,leadingDelimiter); - surfaces.push_back(materialSurface); - continue; - } - - // check inside tolerance - if (closestDistance > tolerance) continue; - - // insert material at measurement surface - const std::bitset<MaterialEffectsBase::NumberOfMaterialEffectsTypes> typePattern; - const Trk::EnergyLoss* energyLoss = 0; - if (materialEffects->energyLoss()) energyLoss = materialEffects->energyLoss()->clone(); - MaterialEffectsOnTrack* meot = new MaterialEffectsOnTrack(materialEffects->thicknessInX0(), - energyLoss, - *(**m).surface(), - typePattern); - const TrackSurfaceIntersection* intersection = - new TrackSurfaceIntersection((**m).intersection(FittedTrajectory)); - if (++m == measurements.end()) --m; - m = measurements.insert(m,new FitMeasurement(meot, - ParticleMasses().mass[particleHypothesis], - intersection->position())); - (**m).intersection(FittedTrajectory,intersection); - (**m).qOverP(materialParameters->parameters()[Trk::qOverP]); - (**m).setMaterialEffectsOwner(); - surfaces.push_back(materialSurface); + for (; m != measurements.end(); ++m) { + if (*m == endIndetMeasurement || s == indetMaterialEnd) break; + if (!leadingDelimiter && (**m).isOutlier()) continue; + + Amg::Vector3D direction = (**m).intersection(FittedTrajectory).direction(); + Amg::Vector3D position = (**m).intersection(FittedTrajectory).position(); + double closestDistance = direction.dot(position - startPosition); + const MaterialEffectsOnTrack* materialEffects = 0; + const TrackParameters* materialParameters = 0; + const Surface* materialSurface = 0; + + // find the closest material TSOS (inside radial tolerance) + for (; s != indetMaterialEnd; ++s) { + if (!dynamic_cast<const MaterialEffectsOnTrack*>((**s).materialEffectsOnTrack()) + || !(**s).trackParameters()) continue; + nextMomentum = (**s).trackParameters()->momentum(); + nextPosition = (**s).trackParameters()->position(); + double distance = direction.dot(nextPosition - position); + + // increasing distance - break when past minimum + if (distance > closestDistance) break; + + // downstream material - check not significantly closer to following measurement + // (material too early is better than too late) + if (distance > 0.) { + ++m; + double nextDistance = direction.dot((**s).trackParameters()->position() - (**m).position()); + --m; + if (std::abs(nextDistance) < distance && distance > tolerance) { + if (s != indetMaterial->begin()) --s; + materialSurface = 0; + break; + } + closestDistance = distance; + } else { + closestDistance = -distance; + } + + // when upstream of leading break any previous surface is going to be ignored + if (!leadingDelimiter && materialSurface) surfaces.push_back(materialSurface); + + materialEffects = dynamic_cast<const MaterialEffectsOnTrack*> + ((**s).materialEffectsOnTrack()); + materialParameters = (**s).trackParameters(); + materialSurface = &materialParameters->associatedSurface(); + } + + // skip if the material has not been allocated to a measurement surface + if (!materialSurface) continue; + + // or if it's already been allocated upstream + if (surfaces.size() && materialSurface == surfaces.back()) continue; + + // skip leading material during the fit (up to and including first measurement) + // insert an materialDelimiter so the leading material can be allocated after the fit converges + if (!leadingDelimiter) { + position = 0.5 * (materialParameters->position() + nextPosition); + direction = (materialParameters->momentum() + nextMomentum).unit(); + TrackSurfaceIntersection breakIntersection(position, direction, 0.); + leadingDelimiter = new FitMeasurement(breakIntersection, 0.); + while (*m != endIndetMeasurement + && direction.dot((**m).intersection(FittedTrajectory).position() - position) < 0.) + ++m; + m = measurements.insert(m, leadingDelimiter); + surfaces.push_back(materialSurface); + continue; + } + + // check inside tolerance + if (closestDistance > tolerance) continue; + + // insert material at measurement surface + const std::bitset<MaterialEffectsBase::NumberOfMaterialEffectsTypes> typePattern; + const Trk::EnergyLoss* energyLoss = 0; + if (materialEffects->energyLoss()) energyLoss = materialEffects->energyLoss()->clone(); + MaterialEffectsOnTrack* meot = new MaterialEffectsOnTrack(materialEffects->thicknessInX0(), + energyLoss, + *(**m).surface(), + typePattern); + const TrackSurfaceIntersection* intersection = + new TrackSurfaceIntersection((**m).intersection(FittedTrajectory)); + if (++m == measurements.end()) --m; + m = measurements.insert(m, new FitMeasurement(meot, + ParticleMasses().mass[particleHypothesis], + intersection->position())); + (**m).intersection(FittedTrajectory, intersection); + (**m).qOverP(materialParameters->parameters()[Trk::qOverP]); + (**m).setMaterialEffectsOwner(); + surfaces.push_back(materialSurface); } // secondly: insert remaining material between measurement layers m = measurements.begin(); int im = 0; - ATH_MSG_VERBOSE(" measurements.size() " << measurements.size() << " surfaces.size() " << surfaces.size() << " indetMaterial->size() " << indetMaterial->size()); + ATH_MSG_VERBOSE( + " measurements.size() " << measurements.size() << " surfaces.size() " << surfaces.size() << " indetMaterial->size() " << + indetMaterial->size()); std::vector<const Surface*>::const_iterator r = surfaces.begin(); - for (s = indetMaterial->begin(); s != indetMaterialEnd; ++s) - { - if (! (**s).trackParameters() - || ! (**s).materialEffectsOnTrack()) continue; - - if (r != surfaces.end() - && **r == (**s).trackParameters()->associatedSurface()) - { - ++r; - continue; - } - - double distance = startDirection.dot((**s).trackParameters()->position() - startPosition); - - ATH_MSG_VERBOSE(" startPosition " << startPosition.perp() << " z " << startPosition.z()); - ATH_MSG_VERBOSE(" (**m).intersection(FittedTrajectory).position() measurement position r " << (**m).intersection(FittedTrajectory).position().perp() << " z " << (**m).intersection(FittedTrajectory).position().z() ); - ATH_MSG_VERBOSE(" (**s).trackParameters()->position() material surface position r " << (**s).trackParameters()->position().perp() << " z " << (**s).trackParameters()->position().z()); - ATH_MSG_VERBOSE(" distance material surface " << distance); - - bool endIndet = false; - while (distance > startDirection.dot((**m).intersection(FittedTrajectory).position() - startPosition)) - { - if (*m == endIndetMeasurement) - { - if (*m != measurements.back()) { - ++m; - ++im; - ATH_MSG_VERBOSE(" measurements.back() im " << im); - } - ATH_MSG_VERBOSE(" break im " << im); - endIndet = true; - break; - } - if (*m != measurements.back()) { - ++m; - ++im; - ATH_MSG_VERBOSE(" loop im " << im << " (**m).intersection(FittedTrajectory).position() measurement position r " << (**m).intersection(FittedTrajectory).position().perp() << " z " << (**m).intersection(FittedTrajectory).position().z() ); - } else { - break; - } - } - ATH_MSG_VERBOSE(" im " << im << " distance measurement " << startDirection.dot((**m).intersection(FittedTrajectory).position() - startPosition) ); - ATH_MSG_VERBOSE(" (**m).intersection(FittedTrajectory).position() measurement position r " << (**m).intersection(FittedTrajectory).position().perp() << " z " << (**m).intersection(FittedTrajectory).position().z() ); - - m = measurements.insert(m,new FitMeasurement((**s).materialEffectsOnTrack(), - ParticleMasses().mass[particleHypothesis], - (**s).trackParameters()->position())); - const TrackSurfaceIntersection* intersection = new TrackSurfaceIntersection( - (**s).trackParameters()->position(), - (**s).trackParameters()->momentum().unit(), - 0.); - (**m).intersection(FittedTrajectory,intersection); - (**m).qOverP((**s).trackParameters()->parameters()[Trk::qOverP]); - ATH_MSG_VERBOSE(" successfull insertion "); - if(endIndet) --m; + for (s = indetMaterial->begin(); s != indetMaterialEnd; ++s) { + if (!(**s).trackParameters() + || !(**s).materialEffectsOnTrack()) continue; + + if (r != surfaces.end() + && **r == (**s).trackParameters()->associatedSurface()) { + ++r; + continue; + } + + double distance = startDirection.dot((**s).trackParameters()->position() - startPosition); + + ATH_MSG_VERBOSE(" startPosition " << startPosition.perp() << " z " << startPosition.z()); + ATH_MSG_VERBOSE(" (**m).intersection(FittedTrajectory).position() measurement position r " << + (**m).intersection(FittedTrajectory).position().perp() << " z " << (**m).intersection( + FittedTrajectory).position().z()); + ATH_MSG_VERBOSE( + " (**s).trackParameters()->position() material surface position r "<< (**s).trackParameters()->position().perp() << " z " << + (**s).trackParameters()->position().z()); + ATH_MSG_VERBOSE(" distance material surface " << distance); + + bool endIndet = false; + while (distance > startDirection.dot((**m).intersection(FittedTrajectory).position() - startPosition)) { + if (*m == endIndetMeasurement) { + if (*m != measurements.back()) { + ++m; + ++im; + ATH_MSG_VERBOSE(" measurements.back() im " << im); + } + ATH_MSG_VERBOSE(" break im " << im); + endIndet = true; + break; + } + if (*m != measurements.back()) { + ++m; + ++im; + ATH_MSG_VERBOSE(" loop im " << im << " (**m).intersection(FittedTrajectory).position() measurement position r "<< + (**m).intersection( + FittedTrajectory).position().perp() << " z " << (**m).intersection( + FittedTrajectory).position().z()); + } else { + break; + } + } + ATH_MSG_VERBOSE(" im " << im << " distance measurement " << + startDirection.dot((**m).intersection(FittedTrajectory).position() - startPosition)); + ATH_MSG_VERBOSE(" (**m).intersection(FittedTrajectory).position() measurement position r " << + (**m).intersection(FittedTrajectory).position().perp() << " z " << (**m).intersection( + FittedTrajectory).position().z()); + + m = measurements.insert(m, new FitMeasurement((**s).materialEffectsOnTrack(), + ParticleMasses().mass[particleHypothesis], + (**s).trackParameters()->position())); + const TrackSurfaceIntersection* intersection = new TrackSurfaceIntersection( + (**s).trackParameters()->position(), + (**s).trackParameters()->momentum().unit(), + 0.); + (**m).intersection(FittedTrajectory, intersection); + (**m).qOverP((**s).trackParameters()->parameters()[Trk::qOverP]); + ATH_MSG_VERBOSE(" successfull insertion "); + if (endIndet) --m; } m = measurements.begin(); im = 0; - for (; m != measurements.end(); ++m) - { - if (! leadingDelimiter && (**m).isOutlier()) continue; - - Amg::Vector3D position = (**m).intersection(FittedTrajectory).position(); - ++im; - ATH_MSG_VERBOSE(" im " << im << " position R " << position.perp() << " z " << position.z()); - } + for (; m != measurements.end(); ++m) { + if (!leadingDelimiter && (**m).isOutlier()) continue; + + Amg::Vector3D position = (**m).intersection(FittedTrajectory).position(); + ++im; + ATH_MSG_VERBOSE(" im " << im << " position R " << position.perp() << " z " << position.z()); + } // memory management deleteMaterial(indetMaterial); - ATH_MSG_VERBOSE( " finished indetMaterial " ); -} + ATH_MSG_VERBOSE(" finished indetMaterial "); + } -std::pair<FitMeasurement*,FitMeasurement*> -MaterialAllocator::materialAggregation (const std::vector<const TrackStateOnSurface*>& material, - std::vector<FitMeasurement*>& /*measurements*/, - double /*particleMass*/) const -{ + std::pair<FitMeasurement*, FitMeasurement*> + MaterialAllocator::materialAggregation(const std::vector<const TrackStateOnSurface*>& material, + std::vector<FitMeasurement*>& /*measurements*/, + double /*particleMass*/) const { // aggregation possible in indet and MS. Frequent occurrence in MS - ATH_MSG_INFO( "segment material aggregation " << material.size()); - FitMeasurement* measurement1 = 0; - FitMeasurement* measurement2 = 0; - if (! material.size()) return std::pair<FitMeasurement*,FitMeasurement*>(measurement1,measurement2); - - Amg::Vector3D* referencePosition = 0; - - - int adjacentScatterers = 0; + ATH_MSG_INFO("segment material aggregation " << material.size()); + FitMeasurement* measurement1 = 0; + FitMeasurement* measurement2 = 0; + if (!material.size()) return std::pair<FitMeasurement*, FitMeasurement*>(measurement1, measurement2); + + Amg::Vector3D* referencePosition = 0; + + + int adjacentScatterers = 0; std::vector<FitMeasurement*> aggregateScatterers; - bool haveAggregation = false; + bool haveAggregation = false; // bool makeAggregation = false; // double maxDistance = 0.; - double totalDistance = 0.; - double totalDistanceSq = 0.; - double totalEnergyDeposit = 0.; - double totalThickness = 0.; + double totalDistance = 0.; + double totalDistanceSq = 0.; + double totalEnergyDeposit = 0.; + double totalThickness = 0.; for (std::vector<const TrackStateOnSurface*>::const_reverse_iterator tsos = material.rbegin(); - tsos != material.rend(); - ++tsos) - { - if (! (**tsos).trackParameters() || ! (**tsos).materialEffectsOnTrack()) continue; - ++adjacentScatterers; - if (! referencePosition) - referencePosition = new Amg::Vector3D((**tsos).trackParameters()->position()); - double distance = ((**tsos).trackParameters()->position() - *referencePosition).mag(); - double energyDeposit= 0.; - const MaterialEffectsOnTrack* meot = - dynamic_cast<const MaterialEffectsOnTrack*>((**tsos).materialEffectsOnTrack()); - if (meot) energyDeposit = -meot->energyLoss()->deltaE(); - - double weight = (**tsos).materialEffectsOnTrack()->thicknessInX0(); - totalDistance += weight*distance; - totalDistanceSq += weight*distance*distance; - totalEnergyDeposit += energyDeposit; - totalThickness += weight; - - ATH_MSG_INFO( " material position " << (**tsos).trackParameters()->position() - << " distance " << distance << " thickness " << 100.*weight ); + tsos != material.rend(); + ++tsos) { + if (!(**tsos).trackParameters() || !(**tsos).materialEffectsOnTrack()) continue; + ++adjacentScatterers; + if (!referencePosition) referencePosition = new Amg::Vector3D((**tsos).trackParameters()->position()); + double distance = ((**tsos).trackParameters()->position() - *referencePosition).mag(); + double energyDeposit = 0.; + const MaterialEffectsOnTrack* meot = + dynamic_cast<const MaterialEffectsOnTrack*>((**tsos).materialEffectsOnTrack()); + if (meot) energyDeposit = -meot->energyLoss()->deltaE(); + + double weight = (**tsos).materialEffectsOnTrack()->thicknessInX0(); + totalDistance += weight * distance; + totalDistanceSq += weight * distance * distance; + totalEnergyDeposit += energyDeposit; + totalThickness += weight; + + ATH_MSG_INFO(" material position " << (**tsos).trackParameters()->position() + << " distance " << distance << " thickness " << 100. * weight); } // if 2 or less selected TSOS: just set scatterers on TSOS - if (adjacentScatterers < 3) - { -// for (std::vector<const TrackStateOnSurface*>::const_reverse_iterator tsos = material.rbegin(); -// tsos != material.rend(); -// ++tsos) -// { -// if (! (**tsos).trackParameters() || ! (**tsos).materialEffectsOnTrack()) continue; -// double energyDeposit= 0.; -// const MaterialEffectsOnTrack* meot = -// dynamic_cast<const MaterialEffectsOnTrack*>((**tsos).materialEffectsOnTrack()); -// if (meot) energyDeposit = -meot->energyLoss()->deltaE(); -// if (measurement2) -// { -// measurement1 = -// new FitMeasurement((**tsos).materialEffectsOnTrack()->thicknessInX0(), -// energyDeposit, -// particleMass, -// (**tsos).trackParameters()->position(), -// (**tsos).trackParameters()->momentum().unit(), -// (**tsos).trackParameters()->parameters()[Trk::qOverP]); -// ATH_MSG_INFO( " created measurement1 " ); -// } -// else -// { -// measurement2 = -// new FitMeasurement((**tsos).materialEffectsOnTrack()->thicknessInX0(), -// energyDeposit, -// particleMass, -// (**tsos).trackParameters()->position(), -// (**tsos).trackParameters()->momentum().unit(), -// (**tsos).trackParameters()->parameters()[Trk::qOverP]); -// ATH_MSG_INFO( " created measurement2 " ); -// } -// } + if (adjacentScatterers < 3) { +// for (std::vector<const TrackStateOnSurface*>::const_reverse_iterator tsos = material.rbegin(); +// tsos != material.rend(); +// ++tsos) +// { +// if (! (**tsos).trackParameters() || ! (**tsos).materialEffectsOnTrack()) continue; +// double energyDeposit= 0.; +// const MaterialEffectsOnTrack* meot = +// dynamic_cast<const MaterialEffectsOnTrack*>((**tsos).materialEffectsOnTrack()); +// if (meot) energyDeposit = -meot->energyLoss()->deltaE(); +// if (measurement2) +// { +// measurement1 = +// new FitMeasurement((**tsos).materialEffectsOnTrack()->thicknessInX0(), +// energyDeposit, +// particleMass, +// (**tsos).trackParameters()->position(), +// (**tsos).trackParameters()->momentum().unit(), +// (**tsos).trackParameters()->parameters()[Trk::qOverP]); +// ATH_MSG_INFO( " created measurement1 " ); +// } +// else +// { +// measurement2 = +// new FitMeasurement((**tsos).materialEffectsOnTrack()->thicknessInX0(), +// energyDeposit, +// particleMass, +// (**tsos).trackParameters()->position(), +// (**tsos).trackParameters()->momentum().unit(), +// (**tsos).trackParameters()->parameters()[Trk::qOverP]); +// ATH_MSG_INFO( " created measurement2 " ); +// } +// } // } // // otherwise aggregate to 1 or 2 average scatterers // else // { -// double meanDistance = totalDistance/totalThickness; -// double rmsDistance = 0.; -// double meanSquare = totalDistanceSq/totalThickness - meanDistance*meanDistance; -// if (meanSquare > 0.) rmsDistance = std::sqrt(meanSquare); -// double gap = 2.*rmsDistance; -// if (adjacentScatterers > 2 || gap < m_scattererMinGap) -// { -// double distance1 = meanDistance - rmsDistance; -// double distance2 = meanDistance + rmsDistance; -// if (gap < m_scattererMinGap) distance2 = meanDistance; - -// ATH_MSG_INFO( "distance1 " << distance1 << " distance2 " << distance2 -// << " thickness " << 100.*totalThickness ); -// } - - // double distance = ((**m).intersection(FittedTrajectory).position() - -// referencePosition).mag(); -// if (distance2 > distance || distance1 < 0.) -// { -// // msg() << " distance out of bounds: range " << distance -// // << " to " << 0. << endmsg; -// } -// else -// { -// FitMeasurement* after = 0; -// FitMeasurement* before = *start; -// double previousDistance = 0.; -// haveAggregation = true; - -// for (std::vector<Trk::FitMeasurement*>::reverse_iterator s = start; -// s != measurements.rend(); -// ++s) -// { -// Amg::Vector3D position = (**s).intersection(FittedTrajectory).position(); -// double distance = ((**s).intersection(FittedTrajectory).position() - -// referencePosition).mag(); -// if (! measurement1 && distance > distance1 && gap > m_scattererMinGap) -// { -// after = *s; -// double separation = distance - previousDistance; -// double fractionAfter = (distance1 - previousDistance)/separation; -// double fractionBefore = (distance - distance1)/separation; -// Amg::Vector3D position = -// fractionBefore*before->intersection(FittedTrajectory).position() + -// fractionAfter*after->intersection(FittedTrajectory).position(); -// Amg::Vector3D direction = -// fractionBefore*before->intersection(FittedTrajectory).direction() + -// fractionAfter*after->intersection(FittedTrajectory).direction(); -// double qOverP = fractionBefore*before->qOverP() + -// fractionAfter*after->qOverP(); -// measurement1 = new FitMeasurement(0.5*totalThickness, -// 0.5*totalEnergyDeposit, -// particleMass, -// position, -// direction, -// qOverP); -// } - -// if (distance > distance2) -// { -// after = *s; -// double separation = distance - previousDistance; -// double fractionAfter = (distance2 - previousDistance)/separation; -// double fractionBefore = (distance - distance2)/separation; -// Amg::Vector3D position = -// fractionBefore*before->intersection(FittedTrajectory).position() + -// fractionAfter*after->intersection(FittedTrajectory).position(); -// Amg::Vector3D direction = -// fractionBefore*before->intersection(FittedTrajectory).direction() + -// fractionAfter*after->intersection(FittedTrajectory).direction(); -// double qOverP = fractionBefore*before->qOverP() + -// fractionAfter*after->qOverP(); -// if (measurement1) -// { -// measurement2 = new FitMeasurement(0.5*totalThickness, -// 0.5*totalEnergyDeposit, -// particleMass, -// position, -// direction, -// qOverP); -// } -// else -// { -// measurement2 = new FitMeasurement(totalThickness, -// totalEnergyDeposit, -// particleMass, -// position, -// direction, -// qOverP); -// } -// if ((**m).isScatterer()) aggregateScatterers.pop_back(); -// while (adjacentScatterers--) -// { -// aggregateScatterers.back()->setOutlier(); -// aggregateScatterers.pop_back(); -// } -// if (measurement1) aggregateScatterers.push_back(measurement1); -// aggregateScatterers.push_back(measurement2); -// if ((**m).isScatterer()) aggregateScatterers.push_back(*m); -// measurement1 = 0; -// measurement2 = 0; -// break; -// } -// before = *s; -// previousDistance = distance; -// } +// double meanDistance = totalDistance/totalThickness; +// double rmsDistance = 0.; +// double meanSquare = totalDistanceSq/totalThickness - meanDistance*meanDistance; +// if (meanSquare > 0.) rmsDistance = std::sqrt(meanSquare); +// double gap = 2.*rmsDistance; +// if (adjacentScatterers > 2 || gap < m_scattererMinGap) +// { +// double distance1 = meanDistance - rmsDistance; +// double distance2 = meanDistance + rmsDistance; +// if (gap < m_scattererMinGap) distance2 = meanDistance; + +// ATH_MSG_INFO( "distance1 " << distance1 << " distance2 " << distance2 +// << " thickness " << 100.*totalThickness ); +// } + + // double distance = ((**m).intersection(FittedTrajectory).position() - +// referencePosition).mag(); +// if (distance2 > distance || distance1 < 0.) +// { +// // msg() << " distance out of bounds: range " << distance +// // << " to " << 0. << endmsg; +// } +// else +// { +// FitMeasurement* after = 0; +// FitMeasurement* before = *start; +// double previousDistance = 0.; +// haveAggregation = true; + +// for (std::vector<Trk::FitMeasurement*>::reverse_iterator s = start; +// s != measurements.rend(); +// ++s) +// { +// Amg::Vector3D position = (**s).intersection(FittedTrajectory).position(); +// double distance = ((**s).intersection(FittedTrajectory).position() - +// referencePosition).mag(); +// if (! measurement1 && distance > distance1 && gap > m_scattererMinGap) +// { +// after = *s; +// double separation = distance - previousDistance; +// double fractionAfter = (distance1 - previousDistance)/separation; +// double fractionBefore = (distance - distance1)/separation; +// Amg::Vector3D position = +// fractionBefore*before->intersection(FittedTrajectory).position() + +// fractionAfter*after->intersection(FittedTrajectory).position(); +// Amg::Vector3D direction = +// fractionBefore*before->intersection(FittedTrajectory).direction() + +// fractionAfter*after->intersection(FittedTrajectory).direction(); +// double qOverP = fractionBefore*before->qOverP() + +// fractionAfter*after->qOverP(); +// measurement1 = new FitMeasurement(0.5*totalThickness, +// 0.5*totalEnergyDeposit, +// particleMass, +// position, +// direction, +// qOverP); +// } + +// if (distance > distance2) +// { +// after = *s; +// double separation = distance - previousDistance; +// double fractionAfter = (distance2 - previousDistance)/separation; +// double fractionBefore = (distance - distance2)/separation; +// Amg::Vector3D position = +// fractionBefore*before->intersection(FittedTrajectory).position() + +// fractionAfter*after->intersection(FittedTrajectory).position(); +// Amg::Vector3D direction = +// fractionBefore*before->intersection(FittedTrajectory).direction() + +// fractionAfter*after->intersection(FittedTrajectory).direction(); +// double qOverP = fractionBefore*before->qOverP() + +// fractionAfter*after->qOverP(); +// if (measurement1) +// { +// measurement2 = new FitMeasurement(0.5*totalThickness, +// 0.5*totalEnergyDeposit, +// particleMass, +// position, +// direction, +// qOverP); +// } +// else +// { +// measurement2 = new FitMeasurement(totalThickness, +// totalEnergyDeposit, +// particleMass, +// position, +// direction, +// qOverP); +// } +// if ((**m).isScatterer()) aggregateScatterers.pop_back(); +// while (adjacentScatterers--) +// { +// aggregateScatterers.back()->setOutlier(); +// aggregateScatterers.pop_back(); +// } +// if (measurement1) aggregateScatterers.push_back(measurement1); +// aggregateScatterers.push_back(measurement2); +// if ((**m).isScatterer()) aggregateScatterers.push_back(*m); +// measurement1 = 0; +// measurement2 = 0; +// break; +// } +// before = *s; +// previousDistance = distance; +// } // } // } -// adjacentScatterers = 0; -// makeAggregation = false; -// } - -// // new candidate for merging -// if ((**m).isScatterer() -// && ! adjacentScatterers -// && ! m_calorimeterVolume->inside((**m).position())) -// { -// adjacentScatterers = 1; -// double weight = (**m).radiationThickness(); -// referencePosition = (**previous).intersection(FittedTrajectory).position(); -// double distance = ((**m).intersection(FittedTrajectory).position() - -// referencePosition).mag(); -// maxDistance = distance + 2.*Gaudi::Units::meter; -// start = m; -// totalDistance = weight*distance; -// totalDistanceSq = weight*distance*distance; -// totalEnergyDeposit = (**m).energyLoss(); -// totalThickness = weight; -// } -// previous = m; - - } - +// adjacentScatterers = 0; +// makeAggregation = false; +// } + +// // new candidate for merging +// if ((**m).isScatterer() +// && ! adjacentScatterers +// && ! m_calorimeterVolume->inside((**m).position())) +// { +// adjacentScatterers = 1; +// double weight = (**m).radiationThickness(); +// referencePosition = (**previous).intersection(FittedTrajectory).position(); +// double distance = ((**m).intersection(FittedTrajectory).position() - +// referencePosition).mag(); +// maxDistance = distance + 2.*Gaudi::Units::meter; +// start = m; +// totalDistance = weight*distance; +// totalDistanceSq = weight*distance*distance; +// totalEnergyDeposit = (**m).energyLoss(); +// totalThickness = weight; +// } +// previous = m; + } + // in case of aggregation: insert aggregateScatterers onto track - if (haveAggregation) - { - + if (haveAggregation) { } delete referencePosition; - return std::pair<FitMeasurement*,FitMeasurement*>(measurement1,measurement2); -} + return std::pair<FitMeasurement*, FitMeasurement*>(measurement1, measurement2); + } -void -MaterialAllocator::materialAggregation (std::vector<FitMeasurement*>& measurements, - double particleMass) const -{ + void + MaterialAllocator::materialAggregation(std::vector<FitMeasurement*>& measurements, + double particleMass) const { // Aggregate when at least 2 scatterers exist between delimiter pair. // // First loop over measurements to create aggregateScatterer vector. @@ -1942,857 +1779,769 @@ MaterialAllocator::materialAggregation (std::vector<FitMeasurement*>& measuremen // (via the outlier flag). // currently aggregation only performed for MS: - Amg::Vector3D referencePosition = measurements.back()->intersection(FittedTrajectory).position(); + Amg::Vector3D referencePosition = measurements.back()->intersection(FittedTrajectory).position(); if (m_calorimeterVolume->inside(referencePosition)) return; - - Amg::Vector3D referenceDirection = measurements.back()->intersection(FittedTrajectory).direction(); - int adjacentScatterers = 0; + + Amg::Vector3D referenceDirection = measurements.back()->intersection(FittedTrajectory).direction(); + int adjacentScatterers = 0; std::vector<FitMeasurement*> aggregateScatterers; - bool haveAggregation = false; - bool makeAggregation = false; - double maxDistance = 0.; - FitMeasurement* measurement1 = 0; - FitMeasurement* measurement2 = 0; - double totalDistance = 0.; - double totalDistanceSq = 0.; - double totalEnergyDeposit = 0.; - double totalThickness = 0.; + bool haveAggregation = false; + bool makeAggregation = false; + double maxDistance = 0.; + FitMeasurement* measurement1 = 0; + FitMeasurement* measurement2 = 0; + double totalDistance = 0.; + double totalDistanceSq = 0.; + double totalEnergyDeposit = 0.; + double totalThickness = 0.; std::vector<FitMeasurement*>::reverse_iterator start; std::vector<FitMeasurement*>::reverse_iterator previous = measurements.rbegin(); for (std::vector<FitMeasurement*>::reverse_iterator m = measurements.rbegin(); - m != measurements.rend(); - ++m) - { - if ((**m).isScatterer()) aggregateScatterers.push_back(*m); - if (m_calorimeterVolume->inside((**m).position())) - { - if (! adjacentScatterers) continue; - makeAggregation = true; - } - - // if (m_calorimeterVolume->inside((**m).position()) - // && ! m_indetVolume->inside((**m).position())) continue; - - // look for adjacent scatterers - else if (adjacentScatterers) - { - if ((**m).isScatterer()) - { - Amg::Vector3D position = (**m).intersection(FittedTrajectory).position(); - double distance = std::abs(referenceDirection.dot(position - referencePosition)); - if (distance < maxDistance) - { - ++adjacentScatterers; - double weight = (**m).radiationThickness(); - totalDistance += weight*distance; - totalDistanceSq += weight*distance*distance; - totalEnergyDeposit += (**m).energyLoss(); - totalThickness += weight; - if (*m == measurements.front()) makeAggregation = true; -// ATH_MSG_INFO(std::setiosflags(std::ios::fixed) -// << " distance " -// << std::setw(8) << std::setprecision(0) -// << distance -// << " adjacentScatterers " << adjacentScatterers ); - } - else if (adjacentScatterers > 1) - { - makeAggregation = true; - } - else - { - adjacentScatterers = 0; - } - } - else if (! (**m).isMaterialDelimiter()) - { - previous = m; - continue; - } - else if (adjacentScatterers > 1) - { - makeAggregation = true; - } - else - { - adjacentScatterers = 0; - } - } - - if (makeAggregation) - { -// double dist = -// ((**m).intersection(FittedTrajectory).position() - referencePosition).mag(); -// ATH_MSG_INFO(std::setiosflags(std::ios::fixed) -// << " makeAggregation: reference R,Z " -// << std::setw(8) << std::setprecision(0) -// << referencePosition.perp() -// << std::setw(8) << std::setprecision(0) -// << referencePosition.z() -// << " current R,Z " -// << std::setw(8) << std::setprecision(0) -// << (**m).intersection(FittedTrajectory).position().perp() -// << std::setw(8) << std::setprecision(0) -// << (**m).intersection(FittedTrajectory).position().z() -// << " adjacentScatterers " << std::setw(2) -// << adjacentScatterers -// << " distance " -// << std::setw(8) << std::setprecision(0) -// << dist ); - double meanDistance = totalDistance/totalThickness; - double rmsDistance = 0.; - double meanSquare = totalDistanceSq/totalThickness - meanDistance*meanDistance; - if (meanSquare > 0.) rmsDistance = std::sqrt(meanSquare); - double gap = 2.*rmsDistance; - if (adjacentScatterers > 2 || gap < m_scattererMinGap) - { - double distance1 = meanDistance - rmsDistance; - double distance2 = meanDistance + rmsDistance; - if (gap < m_scattererMinGap) distance2 = meanDistance; - Amg::Vector3D position = (**m).intersection(FittedTrajectory).position(); - double distance = std::abs(referenceDirection.dot(position - referencePosition)); -// ATH_MSG_INFO(std::setiosflags(std::ios::fixed) -// << " distance1 " -// << std::setw(8) << std::setprecision(0) -// << distance1 -// << " distance2 " -// << std::setw(8) << std::setprecision(0) -// << distance2 -// << " distance " -// << std::setw(8) << std::setprecision(0) -// << distance ); - if (distance2 > distance || distance1 < 0.) - { -// msg() << " distance out of bounds: range " << distance -// << " to " << 0. << endmsg; - } - else - { - FitMeasurement* after = 0; - FitMeasurement* before = *start; - double previousDistance = 0.; - haveAggregation = true; - - for (std::vector<Trk::FitMeasurement*>::reverse_iterator s = start; - s != measurements.rend(); - ++s) - { - if (! (**s).isScatterer()) continue; - Amg::Vector3D position = (**s).intersection(FittedTrajectory).position(); - double distance = std::abs(referenceDirection.dot(position - referencePosition)); - if (! measurement1 && distance > distance1 && gap > m_scattererMinGap) - { - after = *s; - double separation = distance - previousDistance; - double fractionAfter = (distance1 - previousDistance)/separation; - double fractionBefore = (distance - distance1)/separation; -// ATH_MSG_INFO( std::setiosflags(std::ios::fixed) -// << " distance " -// << std::setw(8) << std::setprecision(0) -// << distance<< " fraction before " -// << std::setw(6) << std::setprecision(2) -// << fractionBefore -// << " fraction after " -// << std::setw(6) << std::setprecision(2) -// << fractionAfter ); - position = - fractionBefore*before->intersection(FittedTrajectory).position() + - fractionAfter*after->intersection(FittedTrajectory).position(); - Amg::Vector3D direction = - fractionBefore*before->intersection(FittedTrajectory).direction() + - fractionAfter*after->intersection(FittedTrajectory).direction(); - double qOverP = fractionBefore*before->qOverP() + - fractionAfter*after->qOverP(); - measurement1 = new FitMeasurement(0.5*totalThickness, - -0.5*totalEnergyDeposit, - particleMass, - position, - direction, - qOverP); - } - - if (distance > distance2) - { - after = *s; - double separation = distance - previousDistance; - double fractionAfter = (distance2 - previousDistance)/separation; - double fractionBefore = (distance - distance2)/separation; -// ATH_MSG_INFO( std::setiosflags(std::ios::fixed) -// << " distance " -// << std::setw(8) << std::setprecision(0) -// << distance<< " fraction before " -// << std::setw(6) << std::setprecision(2) -// << fractionBefore -// << " fraction after " -// << std::setw(6) << std::setprecision(2) -// << fractionAfter << endmsg ); - position = - fractionBefore*before->intersection(FittedTrajectory).position() + - fractionAfter*after->intersection(FittedTrajectory).position(); - Amg::Vector3D direction = - fractionBefore*before->intersection(FittedTrajectory).direction() + - fractionAfter*after->intersection(FittedTrajectory).direction(); - double qOverP = fractionBefore*before->qOverP() + - fractionAfter*after->qOverP(); - if (measurement1) - { - measurement2 = new FitMeasurement(0.5*totalThickness, - -0.5*totalEnergyDeposit, - particleMass, - position, - direction, - qOverP); - } - else - { - measurement2 = new FitMeasurement(totalThickness, - -totalEnergyDeposit, - particleMass, - position, - direction, - qOverP); - } - bool keepCurrentMeas = false; - if ((**m).isScatterer() && *m != measurements.front()) - { - keepCurrentMeas = true; - aggregateScatterers.pop_back(); - } - while (adjacentScatterers--) - { - aggregateScatterers.back()->setOutlier(); - aggregateScatterers.pop_back(); - } - if (measurement1) aggregateScatterers.push_back(measurement1); - if (measurement2) aggregateScatterers.push_back(measurement2); - if (keepCurrentMeas) aggregateScatterers.push_back(*m); - measurement1 = 0; - measurement2 = 0; - break; - } - before = *s; - previousDistance = distance; - } - } - } - adjacentScatterers = 0; - makeAggregation = false; - } - - // new candidate for merging - if ((**m).isScatterer() - && ! adjacentScatterers - && ! m_calorimeterVolume->inside((**m).position())) - { - adjacentScatterers = 1; - double weight = (**m).radiationThickness(); - referencePosition = (**previous).intersection(FittedTrajectory).position(); - referenceDirection = (**previous).intersection(FittedTrajectory).direction(); - Amg::Vector3D position = (**m).intersection(FittedTrajectory).position(); - double distance = std::abs(referenceDirection.dot(position - referencePosition)); - maxDistance = distance + 2.*Gaudi::Units::meter; - start = m; - totalDistance = weight*distance; - totalDistanceSq = weight*distance*distance; - totalEnergyDeposit = (**m).energyLoss(); - totalThickness = weight; -// ATH_MSG_INFO(std::setiosflags(std::ios::fixed) -// << " distance " -// << std::setw(8) << std::setprecision(0) -// << distance -// << " adjacentScatterers " << adjacentScatterers ); - } - previous = m; + m != measurements.rend(); + ++m) { + if ((**m).isScatterer()) aggregateScatterers.push_back(*m); + if (m_calorimeterVolume->inside((**m).position())) { + if (!adjacentScatterers) continue; + makeAggregation = true; + } + // if (m_calorimeterVolume->inside((**m).position()) + // && ! m_indetVolume->inside((**m).position())) continue; + // look for adjacent scatterers + else if (adjacentScatterers) { + if ((**m).isScatterer()) { + Amg::Vector3D position = (**m).intersection(FittedTrajectory).position(); + double distance = std::abs(referenceDirection.dot(position - referencePosition)); + if (distance < maxDistance) { + ++adjacentScatterers; + double weight = (**m).radiationThickness(); + totalDistance += weight * distance; + totalDistanceSq += weight * distance * distance; + totalEnergyDeposit += (**m).energyLoss(); + totalThickness += weight; + if (*m == measurements.front()) makeAggregation = true; +// ATH_MSG_INFO(std::setiosflags(std::ios::fixed) +// << " distance " +// << std::setw(8) << std::setprecision(0) +// << distance +// << " adjacentScatterers " << adjacentScatterers ); + } else if (adjacentScatterers > 1) { + makeAggregation = true; + } else { + adjacentScatterers = 0; + } + } else if (!(**m).isMaterialDelimiter()) { + previous = m; + continue; + } else if (adjacentScatterers > 1) { + makeAggregation = true; + } else { + adjacentScatterers = 0; + } + } + + if (makeAggregation) { +// double dist = +// ((**m).intersection(FittedTrajectory).position() - referencePosition).mag(); +// ATH_MSG_INFO(std::setiosflags(std::ios::fixed) +// << " makeAggregation: reference R,Z " +// << std::setw(8) << std::setprecision(0) +// << referencePosition.perp() +// << std::setw(8) << std::setprecision(0) +// << referencePosition.z() +// << " current R,Z " +// << std::setw(8) << std::setprecision(0) +// << (**m).intersection(FittedTrajectory).position().perp() +// << std::setw(8) << std::setprecision(0) +// << (**m).intersection(FittedTrajectory).position().z() +// << " adjacentScatterers " << std::setw(2) +// << adjacentScatterers +// << " distance " +// << std::setw(8) << std::setprecision(0) +// << dist ); + double meanDistance = totalDistance / totalThickness; + double rmsDistance = 0.; + double meanSquare = totalDistanceSq / totalThickness - meanDistance * meanDistance; + if (meanSquare > 0.) rmsDistance = std::sqrt(meanSquare); + double gap = 2. * rmsDistance; + if (adjacentScatterers > 2 || gap < m_scattererMinGap) { + double distance1 = meanDistance - rmsDistance; + double distance2 = meanDistance + rmsDistance; + if (gap < m_scattererMinGap) distance2 = meanDistance; + Amg::Vector3D position = (**m).intersection(FittedTrajectory).position(); + double distance = std::abs(referenceDirection.dot(position - referencePosition)); +// ATH_MSG_INFO(std::setiosflags(std::ios::fixed) +// << " distance1 " +// << std::setw(8) << std::setprecision(0) +// << distance1 +// << " distance2 " +// << std::setw(8) << std::setprecision(0) +// << distance2 +// << " distance " +// << std::setw(8) << std::setprecision(0) +// << distance ); + if (distance2 > distance || distance1 < 0.) { +// msg() << " distance out of bounds: range " << distance +// << " to " << 0. << endmsg; + } else { + FitMeasurement* after = 0; + FitMeasurement* before = *start; + double previousDistance = 0.; + haveAggregation = true; + + for (std::vector<Trk::FitMeasurement*>::reverse_iterator s = start; + s != measurements.rend(); + ++s) { + if (!(**s).isScatterer()) continue; + Amg::Vector3D position = (**s).intersection(FittedTrajectory).position(); + double distance = std::abs(referenceDirection.dot(position - referencePosition)); + if (!measurement1 && distance > distance1 && gap > m_scattererMinGap) { + after = *s; + double separation = distance - previousDistance; + double fractionAfter = (distance1 - previousDistance) / separation; + double fractionBefore = (distance - distance1) / separation; +// ATH_MSG_INFO( std::setiosflags(std::ios::fixed) +// << " distance " +// << std::setw(8) << std::setprecision(0) +// << distance<< " fraction before " +// << std::setw(6) << std::setprecision(2) +// << fractionBefore +// << " fraction after " +// << std::setw(6) << std::setprecision(2) +// << fractionAfter ); + position = + fractionBefore * before->intersection(FittedTrajectory).position() + + fractionAfter * after->intersection(FittedTrajectory).position(); + Amg::Vector3D direction = + fractionBefore * before->intersection(FittedTrajectory).direction() + + fractionAfter * after->intersection(FittedTrajectory).direction(); + double qOverP = fractionBefore * before->qOverP() + + fractionAfter * after->qOverP(); + measurement1 = new FitMeasurement(0.5 * totalThickness, + -0.5 * totalEnergyDeposit, + particleMass, + position, + direction, + qOverP); + } + + if (distance > distance2) { + after = *s; + double separation = distance - previousDistance; + double fractionAfter = (distance2 - previousDistance) / separation; + double fractionBefore = (distance - distance2) / separation; +// ATH_MSG_INFO( std::setiosflags(std::ios::fixed) +// << " distance " +// << std::setw(8) << std::setprecision(0) +// << distance<< " fraction before " +// << std::setw(6) << std::setprecision(2) +// << fractionBefore +// << " fraction after " +// << std::setw(6) << std::setprecision(2) +// << fractionAfter << endmsg ); + position = + fractionBefore * before->intersection(FittedTrajectory).position() + + fractionAfter * after->intersection(FittedTrajectory).position(); + Amg::Vector3D direction = + fractionBefore * before->intersection(FittedTrajectory).direction() + + fractionAfter * after->intersection(FittedTrajectory).direction(); + double qOverP = fractionBefore * before->qOverP() + + fractionAfter * after->qOverP(); + if (measurement1) { + measurement2 = new FitMeasurement(0.5 * totalThickness, + -0.5 * totalEnergyDeposit, + particleMass, + position, + direction, + qOverP); + } else { + measurement2 = new FitMeasurement(totalThickness, + -totalEnergyDeposit, + particleMass, + position, + direction, + qOverP); + } + bool keepCurrentMeas = false; + if ((**m).isScatterer() && *m != measurements.front()) { + keepCurrentMeas = true; + aggregateScatterers.pop_back(); + } + while (adjacentScatterers--) { + aggregateScatterers.back()->setOutlier(); + aggregateScatterers.pop_back(); + } + if (measurement1) aggregateScatterers.push_back(measurement1); + if (measurement2) aggregateScatterers.push_back(measurement2); + if (keepCurrentMeas) aggregateScatterers.push_back(*m); + measurement1 = 0; + measurement2 = 0; + break; + } + before = *s; + previousDistance = distance; + } + } + } + adjacentScatterers = 0; + makeAggregation = false; + } + + // new candidate for merging + if ((**m).isScatterer() + && !adjacentScatterers + && !m_calorimeterVolume->inside((**m).position())) { + adjacentScatterers = 1; + double weight = (**m).radiationThickness(); + referencePosition = (**previous).intersection(FittedTrajectory).position(); + referenceDirection = (**previous).intersection(FittedTrajectory).direction(); + Amg::Vector3D position = (**m).intersection(FittedTrajectory).position(); + double distance = std::abs(referenceDirection.dot(position - referencePosition)); + maxDistance = distance + 2. * Gaudi::Units::meter; + start = m; + totalDistance = weight * distance; + totalDistanceSq = weight * distance * distance; + totalEnergyDeposit = (**m).energyLoss(); + totalThickness = weight; +// ATH_MSG_INFO(std::setiosflags(std::ios::fixed) +// << " distance " +// << std::setw(8) << std::setprecision(0) +// << distance +// << " adjacentScatterers " << adjacentScatterers ); + } + previous = m; } // avoid possible leak delete measurement1; // delete measurement2; // redundant! - + // in case of aggregation: insert the aggregateScatterers into the measurement list // (second loop over measurements) - if (haveAggregation) - { - referencePosition = measurements.back()->intersection(FittedTrajectory).position(); - referenceDirection = (referencePosition - measurements.front()->intersection(FittedTrajectory).position()).unit(); - std::vector<Trk::FitMeasurement*>::reverse_iterator s = aggregateScatterers.rbegin(); - Amg::Vector3D scattererPosition = (**s).intersection(FittedTrajectory).position(); - double scattererDistance = - std::abs(referenceDirection.dot(scattererPosition - referencePosition)); - for (std::vector<Trk::FitMeasurement*>::iterator m = measurements.begin(); - m != measurements.end(); - ++m) - { - // insert scatterers from aggregrate vector - Amg::Vector3D position = (**m).intersection(FittedTrajectory).position(); - double distance = std::abs(referenceDirection.dot(position - referencePosition)); - while (distance <= scattererDistance && s != aggregateScatterers.rend()) - { - m = measurements.insert(m,*s); - ++m; - if (++s != aggregateScatterers.rend()) - { - scattererPosition = (**s).intersection(FittedTrajectory).position(); - scattererDistance = std::abs(referenceDirection.dot(scattererPosition - referencePosition)); - } - } - if ((**m).isScatterer()) - { - // delete the scatterer if it has been aggregated - if ((**m).isOutlier()) delete *m; - // in any case it must be removed from the list to avoid double counting - std::vector<Trk::FitMeasurement*>::iterator n = m; - --m; - measurements.erase(n); - } - } + if (haveAggregation) { + referencePosition = measurements.back()->intersection(FittedTrajectory).position(); + referenceDirection = (referencePosition - measurements.front()->intersection(FittedTrajectory).position()).unit(); + std::vector<Trk::FitMeasurement*>::reverse_iterator s = aggregateScatterers.rbegin(); + Amg::Vector3D scattererPosition = (**s).intersection(FittedTrajectory).position(); + double scattererDistance = + std::abs(referenceDirection.dot(scattererPosition - referencePosition)); + for (std::vector<Trk::FitMeasurement*>::iterator m = measurements.begin(); + m != measurements.end(); + ++m) { + // insert scatterers from aggregrate vector + Amg::Vector3D position = (**m).intersection(FittedTrajectory).position(); + double distance = std::abs(referenceDirection.dot(position - referencePosition)); + while (distance <= scattererDistance && s != aggregateScatterers.rend()) { + m = measurements.insert(m, *s); + ++m; + if (++s != aggregateScatterers.rend()) { + scattererPosition = (**s).intersection(FittedTrajectory).position(); + scattererDistance = std::abs(referenceDirection.dot(scattererPosition - referencePosition)); + } + } + if ((**m).isScatterer()) { + // delete the scatterer if it has been aggregated + if ((**m).isOutlier()) delete *m; + // in any case it must be removed from the list to avoid double counting + std::vector<Trk::FitMeasurement*>::iterator n = m; + --m; + measurements.erase(n); + } + } } // verbose table of fit measurements including material - if (msgLvl(MSG::VERBOSE)) - { - ATH_MSG_VERBOSE( " finished material aggregation: " ); - int n = 0; - Amg::Vector3D startPosition = measurements.front()->intersection(FittedTrajectory).position(); - Amg::Vector3D startDirection = measurements.front()->intersection(FittedTrajectory).direction(); - for (std::vector<Trk::FitMeasurement*>::const_iterator m = measurements.begin(); - m != measurements.end(); - ++m) - { - Amg::Vector3D position = (**m).intersection(FittedTrajectory).position(); - double distance = std::abs(startDirection.dot(position - startPosition)); - msg(MSG::VERBOSE) << std::setiosflags(std::ios::fixed) - << std::setw(5) << ++n - << std::setw(10) << std::setprecision(3) << distance - << " " << (**m).type(); - if ((**m).isOutlier()) - { - msg() << " outlier "; - } - else if ((**m).materialEffects()) - { - msg() << std::setw(8) << std::setprecision(3) - << (**m).materialEffects()->thicknessInX0() << " "; - } - else - { - msg() << " "; - } - if (! (**m).isMaterialDelimiter()) - { - msg() << std::setw(10) << std::setprecision(1) << (**m).position().perp() - << std::setw(9) << std::setprecision(4) << (**m).position().phi() - << std::setw(10) << std::setprecision(1) << (**m).position().z(); - } - msg() << endmsg; - } + if (msgLvl(MSG::VERBOSE)) { + ATH_MSG_VERBOSE(" finished material aggregation: "); + int n = 0; + Amg::Vector3D startPosition = measurements.front()->intersection(FittedTrajectory).position(); + Amg::Vector3D startDirection = measurements.front()->intersection(FittedTrajectory).direction(); + for (std::vector<Trk::FitMeasurement*>::const_iterator m = measurements.begin(); + m != measurements.end(); + ++m) { + Amg::Vector3D position = (**m).intersection(FittedTrajectory).position(); + double distance = std::abs(startDirection.dot(position - startPosition)); + msg(MSG::VERBOSE) << std::setiosflags(std::ios::fixed) + << std::setw(5) << ++n + << std::setw(10) << std::setprecision(3) << distance + << " " << (**m).type(); + if ((**m).isOutlier()) { + msg() << " outlier "; + } else if ((**m).materialEffects()) { + msg() << std::setw(8) << std::setprecision(3) + << (**m).materialEffects()->thicknessInX0() << " "; + } else { + msg() << " "; + } + if (!(**m).isMaterialDelimiter()) { + msg() << std::setw(10) << std::setprecision(1) << (**m).position().perp() + << std::setw(9) << std::setprecision(4) << (**m).position().phi() + << std::setw(10) << std::setprecision(1) << (**m).position().z(); + } + msg() << endmsg; + } } // loops to erase material delimiters and set energy gain when appropriate bool energyGain = false; for (std::vector<Trk::FitMeasurement*>::iterator m = measurements.begin(); - m != measurements.end(); - ++m) - { - if ((**m).materialEffects() - && (**m).numberDoF() - && (**m).energyLoss() < 0.) energyGain = true; - } - - if (energyGain) - { - for (std::vector<Trk::FitMeasurement*>::iterator m = measurements.begin(); - m != measurements.end(); - ++m) - { - if ((**m).materialEffects()) (**m).setEnergyGain(); - } - } -} - -FitMeasurement* -MaterialAllocator::measurementFromTSOS (const TrackStateOnSurface& tsos, - double outgoingEnergy, - double particleMass) const -{ - if (! tsos.trackParameters() || ! tsos.materialEffectsOnTrack()) return 0; + m != measurements.end(); + ++m) { + if ((**m).materialEffects() + && (**m).numberDoF() + && (**m).energyLoss() < 0.) energyGain = true; + } + + if (energyGain) { + for (std::vector<Trk::FitMeasurement*>::iterator m = measurements.begin(); + m != measurements.end(); + ++m) { + if ((**m).materialEffects()) (**m).setEnergyGain(); + } + } + } - double deltaE = outgoingEnergy - tsos.trackParameters()->momentum().mag(); - double thicknessInX0 = tsos.materialEffectsOnTrack()->thicknessInX0(); - Amg::Vector3D position = tsos.trackParameters()->position(); - Amg::Vector3D direction = tsos.trackParameters()->momentum().unit(); - double qOverP = 1./outgoingEnergy; - if (tsos.trackParameters()->charge() < 0) qOverP = -qOverP; + FitMeasurement* + MaterialAllocator::measurementFromTSOS(const TrackStateOnSurface& tsos, + double outgoingEnergy, + double particleMass) const { + if (!tsos.trackParameters() || !tsos.materialEffectsOnTrack()) return 0; + + double deltaE = outgoingEnergy - tsos.trackParameters()->momentum().mag(); + double thicknessInX0 = tsos.materialEffectsOnTrack()->thicknessInX0(); + Amg::Vector3D position = tsos.trackParameters()->position(); + Amg::Vector3D direction = tsos.trackParameters()->momentum().unit(); + double qOverP = 1. / outgoingEnergy; + if (tsos.trackParameters()->charge() < 0) qOverP = -qOverP; return new FitMeasurement(thicknessInX0, - deltaE, - particleMass, - position, - direction, - qOverP); -} - -void -MaterialAllocator::printMeasurements(std::vector<FitMeasurement*>& measurements) const -{ - ATH_MSG_VERBOSE( "measurements and material: distance X0 deltaE E pT" - << " R phi Z DoF phi theta" ); + deltaE, + particleMass, + position, + direction, + qOverP); + } + + void + MaterialAllocator::printMeasurements(std::vector<FitMeasurement*>& measurements) const { + ATH_MSG_VERBOSE("measurements and material: distance X0 deltaE E pT" + << " R phi Z DoF phi theta"); + + if (!measurements.size()) return; - if (! measurements.size()) return; std::vector<Trk::FitMeasurement*>::iterator m = measurements.begin(); while (m != measurements.end() - && ! (**m).isPositionMeasurement()) ++m; - if (m == measurements.end()) m = measurements.begin(); - - Amg::Vector3D direction = (**m).intersection(FittedTrajectory).direction(); - Amg::Vector3D startPosition = (**m).intersection(FittedTrajectory).position(); - int scatterers = 0; - int leadingMaterial = 0; - double leadingX0 = 0.; - double sumX0 = 0.; - double leadingELoss = 0.; - double sumELoss = 0.; - int n = 0; + && !(**m).isPositionMeasurement()) ++m; + if (m == measurements.end()) m = measurements.begin(); + + Amg::Vector3D direction = (**m).intersection(FittedTrajectory).direction(); + Amg::Vector3D startPosition = (**m).intersection(FittedTrajectory).position(); + int scatterers = 0; + int leadingMaterial = 0; + double leadingX0 = 0.; + double sumX0 = 0.; + double leadingELoss = 0.; + double sumELoss = 0.; + int n = 0; for (std::vector<Trk::FitMeasurement*>::iterator m = measurements.begin(); - m != measurements.end(); - ++m) - { - double distance = direction.dot((**m).intersection(FittedTrajectory).position() - startPosition); - msg(MSG::VERBOSE) << std::setiosflags(std::ios::fixed) - << std::setw(5) << ++n - << " " << (**m).type() - << std::setw(11) << std::setprecision(3) << distance; - if ((**m).isOutlier()) - { - msg() << " outlier " << std::setw(44); - } - else if ((**m).materialEffects()) - { - double deltaE = 0.; - const MaterialEffectsOnTrack* materialEffects = - dynamic_cast<const MaterialEffectsOnTrack*>((**m).materialEffects()); - if (materialEffects && materialEffects->energyLoss()) - deltaE = materialEffects->energyLoss()->deltaE(); - if ((**m).isEnergyDeposit()) deltaE = -deltaE; - msg() << std::setw(10) << std::setprecision(3) - << (**m).materialEffects()->thicknessInX0() - << std::setw(9) << std::setprecision(1) << deltaE << " "; - if (distance > 0.) - { - ++scatterers; - sumX0 += (**m).materialEffects()->thicknessInX0(); - sumELoss -= deltaE; - } - else - { - ++leadingMaterial; - leadingX0 += (**m).materialEffects()->thicknessInX0(); - leadingELoss -= deltaE; - } - - if ((**m).qOverP()) - { - msg() << std::setw(11) << std::setprecision(4) - << 1./std::abs((**m).qOverP()*Gaudi::Units::GeV) - << std::setw(10) << std::setprecision(3) - << (**m).intersection(FittedTrajectory).direction().perp()/((**m).qOverP()*Gaudi::Units::GeV) - << std::setw(12); - } - } - else - { - msg() << std::setw(54); - } - if ((**m).isMaterialDelimiter()) - { - msg() << std::setprecision(1) << (**m).intersection(FittedTrajectory).position().perp() - << std::setw(9) << std::setprecision(4) - << (**m).intersection(FittedTrajectory).position().phi() - << std::setw(10) << std::setprecision(1) - << (**m).intersection(FittedTrajectory).position().z() - << std::setw(14) << std::setprecision(4) - << (**m).intersection(FittedTrajectory).direction().phi() - << std::setw(9) << std::setprecision(4) - << (**m).intersection(FittedTrajectory).direction().theta() - << endmsg; - } - else - { - msg() << std::setprecision(1) << (**m).position().perp() - << std::setw(9) << std::setprecision(4) << (**m).position().phi() - << std::setw(10) << std::setprecision(1) << (**m).position().z() - << std::setw(5) << (**m).numberDoF() << endmsg; - } + m != measurements.end(); + ++m) { + double distance = direction.dot((**m).intersection(FittedTrajectory).position() - startPosition); + msg(MSG::VERBOSE) << std::setiosflags(std::ios::fixed) + << std::setw(5) << ++n + << " " << (**m).type() + << std::setw(11) << std::setprecision(3) << distance; + if ((**m).isOutlier()) { + msg() << " outlier " << std::setw(44); + } else if ((**m).materialEffects()) { + double deltaE = 0.; + const MaterialEffectsOnTrack* materialEffects = + dynamic_cast<const MaterialEffectsOnTrack*>((**m).materialEffects()); + if (materialEffects && materialEffects->energyLoss()) deltaE = materialEffects->energyLoss()->deltaE(); + if ((**m).isEnergyDeposit()) deltaE = -deltaE; + msg() << std::setw(10) << std::setprecision(3) + << (**m).materialEffects()->thicknessInX0() + << std::setw(9) << std::setprecision(1) << deltaE << " "; + if (distance > 0.) { + ++scatterers; + sumX0 += (**m).materialEffects()->thicknessInX0(); + sumELoss -= deltaE; + } else { + ++leadingMaterial; + leadingX0 += (**m).materialEffects()->thicknessInX0(); + leadingELoss -= deltaE; + } + + if ((**m).qOverP()) { + msg() << std::setw(11) << std::setprecision(4) + << 1. / std::abs((**m).qOverP() * Gaudi::Units::GeV) + << std::setw(10) << std::setprecision(3) + << (**m).intersection(FittedTrajectory).direction().perp() / ((**m).qOverP() * Gaudi::Units::GeV) + << std::setw(12); + } + } else { + msg() << std::setw(54); + } + if ((**m).isMaterialDelimiter()) { + msg() << std::setprecision(1) << (**m).intersection(FittedTrajectory).position().perp() + << std::setw(9) << std::setprecision(4) + << (**m).intersection(FittedTrajectory).position().phi() + << std::setw(10) << std::setprecision(1) + << (**m).intersection(FittedTrajectory).position().z() + << std::setw(14) << std::setprecision(4) + << (**m).intersection(FittedTrajectory).direction().phi() + << std::setw(9) << std::setprecision(4) + << (**m).intersection(FittedTrajectory).direction().theta() + << endmsg; + } else { + msg() << std::setprecision(1) << (**m).position().perp() + << std::setw(9) << std::setprecision(4) << (**m).position().phi() + << std::setw(10) << std::setprecision(1) << (**m).position().z() + << std::setw(5) << (**m).numberDoF() << endmsg; + } } // fix counting at allocation stage - if (! scatterers) - { - scatterers = leadingMaterial; - leadingMaterial = 0; - } - - ATH_MSG_DEBUG( " material: " << scatterers << " (" << leadingMaterial - << ") fitted scattering centres (leading material centres) giving " - << std::setiosflags(std::ios::fixed) - << std::setw(8) << std::setprecision(3) << sumX0 << " (" - << std::setw(8) << std::setprecision(3) << leadingX0 << ")" - << " X0 and " - << std::setw(8) << std::setprecision(3) << sumELoss/Gaudi::Units::GeV << " (" - << std::setw(8) << std::setprecision(3) << leadingELoss/Gaudi::Units::GeV << ")" - << " GeV Eloss" ); -} - -void -MaterialAllocator::spectrometerMaterial (std::vector<FitMeasurement*>& measurements, - ParticleHypothesis particleHypothesis, - const FitParameters& fitParameters, - const TrackParameters& startParameters) const -{ + if (!scatterers) { + scatterers = leadingMaterial; + leadingMaterial = 0; + } + + ATH_MSG_DEBUG(" material: " << scatterers << " (" << leadingMaterial + << ") fitted scattering centres (leading material centres) giving " + << std::setiosflags(std::ios::fixed) + << std::setw(8) << std::setprecision(3) << sumX0 << " (" + << std::setw(8) << std::setprecision(3) << leadingX0 << ")" + << " X0 and " + << std::setw(8) << std::setprecision(3) << sumELoss / Gaudi::Units::GeV << " (" + << std::setw(8) << std::setprecision(3) << leadingELoss / Gaudi::Units::GeV << ")" + << " GeV Eloss"); + } + + void + MaterialAllocator::spectrometerMaterial(std::vector<FitMeasurement*>& measurements, + ParticleHypothesis particleHypothesis, + const FitParameters& fitParameters, + const TrackParameters& startParameters) const { // return if no MS measurement if (m_calorimeterVolume->inside(measurements.back()->position())) return; // check that the spectrometer measurements are ordered and that material allocation is required - Amg::Vector3D startDirection = startParameters.momentum().unit(); - Amg::Vector3D startPosition = startParameters.position(); - bool haveMaterial = false; - bool haveLeadingMaterial = false; - bool reorderMS = false; - bool reorderID = false; - bool firstMSHit = false; - double previousDistance = 0.; - double previousDistanceR = 0.; - double previousDistanceZ = 0.; - double minDistanceID = 0.; - double minDistanceMS = 0.; - double minRDistanceMS = 0.; - double minZDistanceMS = 0.; + Amg::Vector3D startDirection = startParameters.momentum().unit(); + Amg::Vector3D startPosition = startParameters.position(); + bool haveMaterial = false; + bool haveLeadingMaterial = false; + bool reorderMS = false; + bool reorderID = false; + bool firstMSHit = false; + double previousDistance = 0.; + double previousDistanceR = 0.; + double previousDistanceZ = 0.; + double minDistanceID = 0.; + double minDistanceMS = 0.; + double minRDistanceMS = 0.; + double minZDistanceMS = 0.; std::vector<Trk::FitMeasurement*>::iterator m = measurements.begin(); - for ( ; m != measurements.end(); ++m) - { - Amg::Vector3D position = (**m).intersection(FittedTrajectory).position(); - Amg::Vector3D positionSurf = (**m).surface()->center(); - Amg::Vector3D positionMst = startPosition; - if((**m).measurementBase()) positionMst = (**m).measurementBase()->globalPosition(); - double distance = startDirection.dot(position - startPosition); - double distanceR = sqrt((positionMst.x() - startPosition.x())*(positionMst.x() - startPosition.x()) + (positionMst.y() - startPosition.y())*(positionMst.y() - startPosition.y())); - double distanceZ = (positionMst.z() - startPosition.z()); - if(startDirection.z()<0) distanceZ = -distanceZ; - if (!m_calorimeterVolume->inside(position) || !m_calorimeterVolume->inside(positionSurf)) { - if (distance - previousDistance < -m_orderingTolerance) { - reorderMS = true; - if(distance - previousDistance<minDistanceMS) { - minDistanceMS = distance-previousDistance ; - minRDistanceMS = distanceR-previousDistanceR; - minZDistanceMS = distanceZ-previousDistanceZ; - } - } - if ((**m).isScatterer()) haveMaterial = true; - if ((**m).measurementBase()&&!firstMSHit) { - firstMSHit = true; - } - if ((**m).isScatterer()&&!firstMSHit) haveLeadingMaterial = true; - } else { - if (distance - previousDistance < -m_orderingTolerance) { - reorderID = true; - if(distance - previousDistance<minDistanceID) minDistanceID = distance-previousDistance ; + for (; m != measurements.end(); ++m) { + Amg::Vector3D position = (**m).intersection(FittedTrajectory).position(); + Amg::Vector3D positionSurf = (**m).surface()->center(); + Amg::Vector3D positionMst = startPosition; + if ((**m).measurementBase()) positionMst = (**m).measurementBase()->globalPosition(); + double distance = startDirection.dot(position - startPosition); + double distanceR = + sqrt((positionMst.x() - startPosition.x()) * (positionMst.x() - startPosition.x()) + + (positionMst.y() - startPosition.y()) * (positionMst.y() - startPosition.y())); + double distanceZ = (positionMst.z() - startPosition.z()); + if (startDirection.z() < 0) distanceZ = -distanceZ; + if (!m_calorimeterVolume->inside(position) || !m_calorimeterVolume->inside(positionSurf)) { + if (distance - previousDistance < -m_orderingTolerance) { + reorderMS = true; + if (distance - previousDistance < minDistanceMS) { + minDistanceMS = distance - previousDistance; + minRDistanceMS = distanceR - previousDistanceR; + minZDistanceMS = distanceZ - previousDistanceZ; } } - previousDistance = distance; - previousDistanceZ = distanceZ; - previousDistanceR = distanceR; + if ((**m).isScatterer()) haveMaterial = true; + if ((**m).measurementBase() && !firstMSHit) { + firstMSHit = true; + } + if ((**m).isScatterer() && !firstMSHit) haveLeadingMaterial = true; + } else { + if (distance - previousDistance < -m_orderingTolerance) { + reorderID = true; + if (distance - previousDistance < minDistanceID) minDistanceID = distance - previousDistance; + } + } + previousDistance = distance; + previousDistanceZ = distanceZ; + previousDistanceR = distanceR; } - if(reorderMS&&(minRDistanceMS>-m_orderingTolerance||minZDistanceMS>-m_orderingTolerance)) { - -// 3D distance of the intersection is problematic but the R or Z distance of the measurementBase is fine -// we should not reorder + if (reorderMS && (minRDistanceMS > -m_orderingTolerance || minZDistanceMS > -m_orderingTolerance)) { +// 3D distance of the intersection is problematic but the R or Z distance of the measurementBase is fine +// we should not reorder reorderMS = false; } // if(!m_allowReordering) { - if (reorderMS&&fabs(minDistanceMS)>-2.) ATH_MSG_DEBUG( " reorder MS part of track with minimum distance " << minDistanceMS << " minRDistanceMS " << minRDistanceMS << " minZDistanceMS " << minZDistanceMS); - if (reorderID&&fabs(minDistanceID)>-2.) ATH_MSG_DEBUG( " reorder ID part of track with minimum distance " << minDistanceID); + if (reorderMS && fabs(minDistanceMS) > -2.) ATH_MSG_DEBUG( + " reorder MS part of track with minimum distance " << minDistanceMS << " minRDistanceMS " << minRDistanceMS << " minZDistanceMS " << + minZDistanceMS); + if (reorderID && fabs(minDistanceID) > -2.) ATH_MSG_DEBUG( + " reorder ID part of track with minimum distance " << minDistanceID); // } - if(reorderMS||reorderID) { - if (msgLvl(MSG::DEBUG)) printMeasurements(measurements); + if (reorderMS || reorderID) { + if (msgLvl(MSG::DEBUG)) printMeasurements(measurements); } - if (!haveLeadingMaterial&&haveMaterial) { - ATH_MSG_WARNING( " MS part of track has no leading material in front of first MS hit "); - } + if (!haveLeadingMaterial && haveMaterial) { + ATH_MSG_WARNING(" MS part of track has no leading material in front of first MS hit "); + } - if (reorderMS) orderMeasurements(measurements,startDirection,startPosition); + if (reorderMS) orderMeasurements(measurements, startDirection, startPosition); // nothing to do if spectrometer material already exists - if (haveMaterial) return; - ATH_MSG_DEBUG( " spectrometerMaterial: ALARM no material found on track can happen for MuGirl"); + if (haveMaterial) return; + + ATH_MSG_DEBUG(" spectrometerMaterial: ALARM no material found on track can happen for MuGirl"); // material has to be added: need inner and outer TrackParameters - FitMeasurement* innerMeasurement = 0; - FitMeasurement* outerMeasurement = 0; - for (m = measurements.begin(); m != measurements.end(); ++m) - { - if (! (**m).isPositionMeasurement() || (**m).isOutlier()) continue; - Amg::Vector3D position = (**m).intersection(FittedTrajectory).position(); - if (m_calorimeterVolume->inside(position)) continue; - if (innerMeasurement) - { - outerMeasurement = *m; - } - else - { - innerMeasurement = *m; - } - } - if (! outerMeasurement) return; - + FitMeasurement* innerMeasurement = 0; + FitMeasurement* outerMeasurement = 0; + for (m = measurements.begin(); m != measurements.end(); ++m) { + if (!(**m).isPositionMeasurement() || (**m).isOutlier()) continue; + Amg::Vector3D position = (**m).intersection(FittedTrajectory).position(); + if (m_calorimeterVolume->inside(position)) continue; + if (innerMeasurement) { + outerMeasurement = *m; + } else { + innerMeasurement = *m; + } + } + if (!outerMeasurement) return; + // insert delimiters addSpectrometerDelimiters(measurements); - + // make sure the spectrometer entrance volume is available - ATH_MSG_DEBUG( " add spectrometerMaterial " ); - if (! m_spectrometerEntrance) - { - if (! m_trackingGeometrySvc) - { - // missing TrackingGeometrySvc - no spectrometer material added - m_messageHelper->printWarning(2); - return; - } - else - { - m_spectrometerEntrance = m_trackingGeometrySvc->trackingGeometry()-> - trackingVolume("MuonSpectrometerEntrance"); - } + ATH_MSG_DEBUG(" add spectrometerMaterial "); + if (!m_spectrometerEntrance) { + if (!m_trackingGeometrySvc) { + // missing TrackingGeometrySvc - no spectrometer material added + m_messageHelper->printWarning(2); + return; + } else { + m_spectrometerEntrance = m_trackingGeometrySvc->trackingGeometry()-> + trackingVolume("MuonSpectrometerEntrance"); + } } // entranceParameters are at the MS entrance surface (0 if perigee downstream) - TrackSurfaceIntersection* entranceIntersection = 0; - const TrackParameters* entranceParameters = 0; + TrackSurfaceIntersection* entranceIntersection = 0; + const TrackParameters* entranceParameters = 0; MsgStream log(msgSvc(), name()); - if (m_calorimeterVolume->inside(startParameters.position())) - { - const TrackParameters* innerParameters = fitParameters.trackParameters(log, - *innerMeasurement, - false); - if (! innerParameters) innerParameters = startParameters.clone(); - entranceParameters = m_spectrometerExtrapolator->extrapolateToVolume(*innerParameters, - *m_spectrometerEntrance, - anyDirection, - Trk::nonInteracting); - delete innerParameters; - if (entranceParameters) - { - startDirection = entranceParameters->momentum().unit(); - startPosition = entranceParameters->position(); - entranceIntersection = new TrackSurfaceIntersection(entranceParameters->position(), - entranceParameters->momentum().unit(), - 0.); - std::vector<Trk::FitMeasurement*>::iterator e = measurements.begin(); - FitMeasurement* entranceDelimiter = new FitMeasurement(*entranceIntersection, 0.); - for (m = measurements.begin(); m != measurements.end(); ++m) - { - if (! m_calorimeterVolume->inside((**m).position())) break; - e = m; - } - - // insert a material delimiter at the start of the spectrometer (or at perigee if in MS) - e = measurements.insert(++e,entranceDelimiter); - delete entranceIntersection; - } - else - { - // did not find MS entrance surface - no MS material taken into account - m_messageHelper->printWarning(3); - return; - } - } - + if (m_calorimeterVolume->inside(startParameters.position())) { + const TrackParameters* innerParameters = fitParameters.trackParameters(log, + *innerMeasurement, + false); + if (!innerParameters) innerParameters = startParameters.clone(); + entranceParameters = m_spectrometerExtrapolator->extrapolateToVolume(*innerParameters, + *m_spectrometerEntrance, + anyDirection, + Trk::nonInteracting); + delete innerParameters; + if (entranceParameters) { + startDirection = entranceParameters->momentum().unit(); + startPosition = entranceParameters->position(); + entranceIntersection = new TrackSurfaceIntersection(entranceParameters->position(), + entranceParameters->momentum().unit(), + 0.); + std::vector<Trk::FitMeasurement*>::iterator e = measurements.begin(); + FitMeasurement* entranceDelimiter = new FitMeasurement(*entranceIntersection, 0.); + for (m = measurements.begin(); m != measurements.end(); ++m) { + if (!m_calorimeterVolume->inside((**m).position())) break; + e = m; + } + + // insert a material delimiter at the start of the spectrometer (or at perigee if in MS) + e = measurements.insert(++e, entranceDelimiter); + delete entranceIntersection; + } else { + // did not find MS entrance surface - no MS material taken into account + m_messageHelper->printWarning(3); + return; + } + } + // insert a material delimiter after the last measurement (endParameters) - const TrackParameters* outerParameters = fitParameters.trackParameters(log, - *outerMeasurement, - false); - if (! outerParameters) outerParameters = startParameters.clone(); - const Surface& endSurface = *measurements.back()->surface(); - const TrackParameters* endParameters = - m_spectrometerExtrapolator->extrapolate(*outerParameters, - endSurface, - anyDirection, - false, - particleHypothesis); - if (! endParameters) - { - endParameters = m_spectrometerExtrapolator->extrapolate(*outerParameters, - endSurface, - anyDirection, - false, - Trk::nonInteracting); - if (! endParameters) - { - // failed extrapolation - m_messageHelper->printWarning(4); - endParameters = outerParameters; - } + const TrackParameters* outerParameters = fitParameters.trackParameters(log, + *outerMeasurement, + false); + if (!outerParameters) outerParameters = startParameters.clone(); + const Surface& endSurface = *measurements.back()->surface(); + const TrackParameters* endParameters = + m_spectrometerExtrapolator->extrapolate(*outerParameters, + endSurface, + anyDirection, + false, + particleHypothesis); + if (!endParameters) { + endParameters = m_spectrometerExtrapolator->extrapolate(*outerParameters, + endSurface, + anyDirection, + false, + Trk::nonInteracting); + if (!endParameters) { + // failed extrapolation + m_messageHelper->printWarning(4); + endParameters = outerParameters; + } } if (endParameters != outerParameters) delete outerParameters; // insert delimiter const TrackSurfaceIntersection endIntersection(endParameters->position(), - endParameters->momentum().unit(), - 0.); - FitMeasurement* endBreak = new FitMeasurement(endIntersection, 20.*Gaudi::Units::mm); + endParameters->momentum().unit(), + 0.); + FitMeasurement* endBreak = new FitMeasurement(endIntersection, 20. * Gaudi::Units::mm); measurements.push_back(endBreak); - - double endSpectrometerDistance = startDirection.dot( - measurements.back()->intersection(FittedTrajectory).position() - startPosition); + + double endSpectrometerDistance = startDirection.dot( + measurements.back()->intersection(FittedTrajectory).position() - startPosition); const std::vector<const TrackStateOnSurface*>* spectrometerMaterial = 0; // protect the momentum to avoid excessive Eloss Amg::VectorX parameterVector = endParameters->parameters(); double Emax = 50000.; - if(parameterVector[Trk::qOverP]==0.) { - parameterVector[Trk::qOverP] = 1./Emax; + if (parameterVector[Trk::qOverP] == 0.) { + parameterVector[Trk::qOverP] = 1. / Emax; } else { - if(std::abs(parameterVector[Trk::qOverP])*Emax < 1) parameterVector[Trk::qOverP] = endParameters->charge()/Emax; - } + if (std::abs(parameterVector[Trk::qOverP]) * Emax < + 1) parameterVector[Trk::qOverP] = endParameters->charge() / Emax; + } // correct track parameters for high momentum track (otherwise Eloss is too large) endParameters = (endParameters->associatedSurface()).createTrackParameters(parameterVector[Trk::loc1], - parameterVector[Trk::loc2],parameterVector[Trk::phi], - parameterVector[Trk::theta],parameterVector[Trk::qOverP],0); - - if (entranceParameters) - { - const Surface& entranceSurface = entranceParameters->associatedSurface(); - spectrometerMaterial = extrapolatedMaterial(m_spectrometerExtrapolator, - *endParameters, - entranceSurface, - anyDirection, - false, - Trk::muon); - } - else - { - const Surface& entranceSurface = startParameters.associatedSurface(); - spectrometerMaterial = extrapolatedMaterial(m_spectrometerExtrapolator, - *endParameters, - entranceSurface, - anyDirection, - false, - Trk::muon); - } - + parameterVector[Trk::loc2], + parameterVector[Trk::phi], + parameterVector[Trk::theta], + parameterVector[Trk::qOverP], 0); + + if (entranceParameters) { + const Surface& entranceSurface = entranceParameters->associatedSurface(); + spectrometerMaterial = extrapolatedMaterial(m_spectrometerExtrapolator, + *endParameters, + entranceSurface, + anyDirection, + false, + Trk::muon); + } else { + const Surface& entranceSurface = startParameters.associatedSurface(); + spectrometerMaterial = extrapolatedMaterial(m_spectrometerExtrapolator, + *endParameters, + entranceSurface, + anyDirection, + false, + Trk::muon); + } + // debug - if (msgLvl(MSG::VERBOSE) && spectrometerMaterial && ! spectrometerMaterial->empty()) - { - ATH_MSG_VERBOSE( " spectrometerMaterial: " - << "using extrapolateM inwards from outermost measurement" ); - double p1 = 0.; - if ( spectrometerMaterial->front()->trackParameters()) - p1 = spectrometerMaterial->front()->trackParameters()->momentum().mag(); - for (std::vector<const TrackStateOnSurface*>::const_iterator - ss = spectrometerMaterial->begin(); - ss != spectrometerMaterial->end(); - ++ss) - { - if (! (**ss).trackParameters() || ! (**ss).materialEffectsOnTrack()) continue; - double distance = startDirection.dot((**ss).trackParameters()->position() - startPosition); - double deltaE = 0.; - double thickness = (**ss).materialEffectsOnTrack()->thicknessInX0(); - const MaterialEffectsOnTrack* materialEffects = - dynamic_cast<const MaterialEffectsOnTrack*>((**ss).materialEffectsOnTrack()); - if (materialEffects && materialEffects->energyLoss()) - deltaE = materialEffects->energyLoss()->deltaE(); - double p2 = (**ss).trackParameters()->momentum().mag(); - ATH_MSG_VERBOSE( std::setiosflags(std::ios::fixed) << " material: RZ" - << std::setw(9) << std::setprecision(3) - << (**ss).trackParameters()->position().perp() - << std::setw(10) << std::setprecision(3) - << (**ss).trackParameters()->position().z() - << " distance " << std::setw(10) << std::setprecision(3) - << distance - << " pt " << std::setw(8) << std::setprecision(3) - << (**ss).trackParameters()->momentum().perp()/Gaudi::Units::GeV - << " X0thickness " << std::setw(8) << std::setprecision(4) - << thickness - << " deltaE " << std::setw(8) << std::setprecision(4) - << deltaE - << " diffP " << std::setw(8) << std::setprecision(4) << p2 - p1 ); - p1 = p2; - } - } - + if (msgLvl(MSG::VERBOSE) && spectrometerMaterial && !spectrometerMaterial->empty()) { + ATH_MSG_VERBOSE(" spectrometerMaterial: " + << "using extrapolateM inwards from outermost measurement"); + double p1 = 0.; + if (spectrometerMaterial->front()->trackParameters()) p1 = + spectrometerMaterial->front()->trackParameters()->momentum().mag(); + for (std::vector<const TrackStateOnSurface*>::const_iterator + ss = spectrometerMaterial->begin(); + ss != spectrometerMaterial->end(); + ++ss) { + if (!(**ss).trackParameters() || !(**ss).materialEffectsOnTrack()) continue; + double distance = startDirection.dot((**ss).trackParameters()->position() - startPosition); + double deltaE = 0.; + double thickness = (**ss).materialEffectsOnTrack()->thicknessInX0(); + const MaterialEffectsOnTrack* materialEffects = + dynamic_cast<const MaterialEffectsOnTrack*>((**ss).materialEffectsOnTrack()); + if (materialEffects && materialEffects->energyLoss()) deltaE = materialEffects->energyLoss()->deltaE(); + double p2 = (**ss).trackParameters()->momentum().mag(); + ATH_MSG_VERBOSE(std::setiosflags(std::ios::fixed) << " material: RZ" + << std::setw(9) << std::setprecision(3) + << (**ss).trackParameters()->position().perp() + << std::setw(10) << std::setprecision(3) + << (**ss).trackParameters()->position().z() + << " distance " << std::setw(10) << std::setprecision(3) + << distance + << " pt " << std::setw(8) << std::setprecision(3) + << (**ss).trackParameters()->momentum().perp() / Gaudi::Units::GeV + << " X0thickness " << std::setw(8) << std::setprecision(4) + << thickness + << " deltaE " << std::setw(8) << std::setprecision(4) + << deltaE + << " diffP " << std::setw(8) << std::setprecision( + 4) << p2 - p1); + p1 = p2; + } + } + // insert the material into the measurement list - if (! spectrometerMaterial || spectrometerMaterial->empty()) - { - m_messageHelper->printWarning(5); - delete spectrometerMaterial; - spectrometerMaterial = 0; - } - else - { - std::vector<const TrackStateOnSurface*>::const_reverse_iterator s = - spectrometerMaterial->rbegin(); - std::vector<FitMeasurement*> material; - double particleMass = ParticleMasses().mass[particleHypothesis]; - material.reserve(spectrometerMaterial->size()); - std::vector<FitMeasurement*>::iterator m = measurements.begin(); - for ( ; s != spectrometerMaterial->rend(); ) - { - const TrackStateOnSurface& tsos = **s; - while (++s != spectrometerMaterial->rend() && ! (**s).trackParameters()) ; - - double outgoingEnergy = 0.; - if (s != spectrometerMaterial->rend()) - { - outgoingEnergy = (**s).trackParameters()->momentum().mag(); - } - else - { - outgoingEnergy = endParameters->momentum().mag(); - } - - FitMeasurement* measurement = measurementFromTSOS(tsos,outgoingEnergy,particleMass); - if (! measurement) continue; - - // insert next to adjacent measurement - material.push_back(measurement); - double distance = startDirection.dot(tsos.trackParameters()->position() - startPosition); - if (distance > endSpectrometerDistance) - { - delete measurement; - break; - } - while (m != measurements.end() - && distance > startDirection.dot((**m).intersection(FittedTrajectory).position() - startPosition)) - { - ++m; - } - if (m == measurements.end()) - { - delete measurement; - break; - } - - m = measurements.insert(m,material.back()); - } + if (!spectrometerMaterial || spectrometerMaterial->empty()) { + m_messageHelper->printWarning(5); + delete spectrometerMaterial; + spectrometerMaterial = 0; + } else { + std::vector<const TrackStateOnSurface*>::const_reverse_iterator s = + spectrometerMaterial->rbegin(); + std::vector<FitMeasurement*> material; + double particleMass = ParticleMasses().mass[particleHypothesis]; + material.reserve(spectrometerMaterial->size()); + std::vector<FitMeasurement*>::iterator m = measurements.begin(); + for (; s != spectrometerMaterial->rend(); ) { + const TrackStateOnSurface& tsos = **s; + while (++s != spectrometerMaterial->rend() && !(**s).trackParameters()) ; + + double outgoingEnergy = 0.; + if (s != spectrometerMaterial->rend()) { + outgoingEnergy = (**s).trackParameters()->momentum().mag(); + } else { + outgoingEnergy = endParameters->momentum().mag(); + } + + FitMeasurement* measurement = measurementFromTSOS(tsos, outgoingEnergy, particleMass); + if (!measurement) continue; + + // insert next to adjacent measurement + material.push_back(measurement); + double distance = startDirection.dot(tsos.trackParameters()->position() - startPosition); + if (distance > endSpectrometerDistance) { + delete measurement; + break; + } + while (m != measurements.end() + && distance > startDirection.dot((**m).intersection(FittedTrajectory).position() - startPosition)) { + ++m; + } + if (m == measurements.end()) { + delete measurement; + break; + } + + m = measurements.insert(m, material.back()); + } } // // check sign and order here // printMeasurements(measurements); - + // memory management - ATH_MSG_VERBOSE( " spectrometer: mem management" ); + ATH_MSG_VERBOSE(" spectrometer: mem management"); delete endParameters; delete entranceParameters; deleteMaterial(spectrometerMaterial); materialAggregation(measurements, ParticleMasses().mass[particleHypothesis]); -} - + } } // end of namespace diff --git a/Tracking/TrkFitter/TrkiPatFitter/src/iPatFitter.cxx b/Tracking/TrkFitter/TrkiPatFitter/src/iPatFitter.cxx index bea7a21ba60ed6e6f25748598a65079818de2d45..ac136da5064a38ce5b87fcfaba4d7683a9297f58 100755 --- a/Tracking/TrkFitter/TrkiPatFitter/src/iPatFitter.cxx +++ b/Tracking/TrkFitter/TrkiPatFitter/src/iPatFitter.cxx @@ -1,11 +1,11 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration -*/ + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + */ /*************************************************************************** - least squared fit to track hit data => PerigeeParameters with covariance - and fit quality. - ***************************************************************************/ + least squared fit to track hit data => PerigeeParameters with covariance + and fit quality. +***************************************************************************/ #include <cmath> #include <iomanip> @@ -44,99 +44,96 @@ #include "TrkiPatFitter/iPatFitter.h" namespace Trk -{ - -iPatFitter::iPatFitter (const std::string& type, - const std::string& name, - const IInterface* parent) - : AthAlgTool (type, name, parent), - m_fitProcedure (0), - m_globalFit (false), - m_iterations (0), - m_measurements (0), - m_parameters (0), - m_aggregateMaterial (true), - m_asymmetricCaloEnergy (true), - m_fullCombinedFit (true), - m_lineFit (false), - m_lineMomentum (100.*Gaudi::Units::GeV), - m_materialAllocator ("Trk::MaterialAllocator/MaterialAllocator"), - m_rungeKuttaIntersector ("Trk::RungeKuttaIntersector/RungeKuttaIntersector"), - m_solenoidalIntersector ("Trk::SolenoidalIntersector/SolenoidalIntersector"), - m_stepPropagator ("Trk::STEP_Propagator/AtlasSTEP_Propagator"), - m_straightLineIntersector ("Trk::StraightLineIntersector/StraightLineIntersector"), - m_trackingVolumesSvc ("TrackingVolumesSvc/TrackingVolumesSvc",name), - m_orderingTolerance (1.*Gaudi::Units::mm), - m_maxWarnings (10), - m_constrainedAlignmentEffects (false), - m_extendedDebug (false), - m_forcedRefitsForValidation (0), - m_maxIterations (25), - m_useStepPropagator (1), - m_calorimeterVolume (0), - m_indetVolume (0), - m_stepField (Trk::MagneticFieldProperties(Trk::FullField)), - m_countFitAttempts (0), - m_countGoodFits (0), - m_countIterations (0), - m_countRefitAttempts (0), - m_countGoodRefits (0), - m_countRefitIterations (0), - m_messageHelper (0) { - m_messageHelper = new MessageHelper(*this); + iPatFitter::iPatFitter (const std::string& type, + const std::string& name, + const IInterface* parent) + : AthAlgTool(type, name, parent), + m_fitProcedure(0), + m_globalFit(false), + m_iterations(0), + m_measurements(0), + m_parameters(0), + m_aggregateMaterial(true), + m_asymmetricCaloEnergy(true), + m_fullCombinedFit(true), + m_lineFit(false), + m_lineMomentum(100. * Gaudi::Units::GeV), + m_materialAllocator("Trk::MaterialAllocator/MaterialAllocator"), + m_rungeKuttaIntersector("Trk::RungeKuttaIntersector/RungeKuttaIntersector"), + m_solenoidalIntersector("Trk::SolenoidalIntersector/SolenoidalIntersector"), + m_stepPropagator("Trk::STEP_Propagator/AtlasSTEP_Propagator"), + m_straightLineIntersector("Trk::StraightLineIntersector/StraightLineIntersector"), + m_trackingVolumesSvc("TrackingVolumesSvc/TrackingVolumesSvc", name), + m_orderingTolerance(1. * Gaudi::Units::mm), + m_maxWarnings(10), + m_constrainedAlignmentEffects(false), + m_extendedDebug(false), + m_forcedRefitsForValidation(0), + m_maxIterations(25), + m_useStepPropagator(1), + m_calorimeterVolume(0), + m_indetVolume(0), + m_stepField(Trk::MagneticFieldProperties(Trk::FullField)), + m_countFitAttempts(0), + m_countGoodFits(0), + m_countIterations(0), + m_countRefitAttempts(0), + m_countGoodRefits(0), + m_countRefitIterations(0), + m_messageHelper(0) { + m_messageHelper = new MessageHelper(*this); declareInterface<ITrackFitter>(this); - declareProperty("AggregateMaterial", m_aggregateMaterial); - declareProperty("AsymmetricCaloEnergy", m_asymmetricCaloEnergy); - declareProperty("FullCombinedFit", m_fullCombinedFit); - declareProperty("LineFit", m_lineFit); - declareProperty("LineMomentum", m_lineMomentum); - declareProperty("MaterialAllocator", m_materialAllocator); - declareProperty("RungeKuttaIntersector", m_rungeKuttaIntersector); - declareProperty("SolenoidalIntersector", m_solenoidalIntersector); - declareProperty("StraightLineIntersector", m_straightLineIntersector); - declareProperty("TrackingVolumesSvc", m_trackingVolumesSvc); - declareProperty("OrderingTolerance", m_orderingTolerance); - declareProperty("MaxNumberOfWarnings", m_maxWarnings, - "Maximum number of permitted WARNING messages per message type."); + declareProperty("AggregateMaterial", m_aggregateMaterial); + declareProperty("AsymmetricCaloEnergy", m_asymmetricCaloEnergy); + declareProperty("FullCombinedFit", m_fullCombinedFit); + declareProperty("LineFit", m_lineFit); + declareProperty("LineMomentum", m_lineMomentum); + declareProperty("MaterialAllocator", m_materialAllocator); + declareProperty("RungeKuttaIntersector", m_rungeKuttaIntersector); + declareProperty("SolenoidalIntersector", m_solenoidalIntersector); + declareProperty("StraightLineIntersector", m_straightLineIntersector); + declareProperty("TrackingVolumesSvc", m_trackingVolumesSvc); + declareProperty("OrderingTolerance", m_orderingTolerance); + declareProperty("MaxNumberOfWarnings", m_maxWarnings, + "Maximum number of permitted WARNING messages per message type."); // validation options - declareProperty("ConstrainedAlignmentEffects", m_constrainedAlignmentEffects); - declareProperty("ExtendedDebug", m_extendedDebug); - declareProperty("ForcedRefitsForValidation", m_forcedRefitsForValidation); - declareProperty("MaxIterations", m_maxIterations); + declareProperty("ConstrainedAlignmentEffects", m_constrainedAlignmentEffects); + declareProperty("ExtendedDebug", m_extendedDebug); + declareProperty("ForcedRefitsForValidation", m_forcedRefitsForValidation); + declareProperty("MaxIterations", m_maxIterations); // m_useStepPropagator 0 means not used (so Intersector used) // 1 Intersector not used and StepPropagator used with FullField - // 2 StepPropagator with FastField propagation + // 2 StepPropagator with FastField propagation // 99 debug mode where both are ran with FullField - declareProperty("UseStepPropagator", m_useStepPropagator); -} + declareProperty("UseStepPropagator", m_useStepPropagator); + } -iPatFitter::~iPatFitter (void) -{} + iPatFitter::~iPatFitter (void) + {} -StatusCode -iPatFitter::initialize() -{ + StatusCode + iPatFitter::initialize() { // print name and package version - if (! msgLvl(MSG::DEBUG)) m_extendedDebug = false; - ATH_MSG_INFO( "iPatFitter::initialize() - package version " << PACKAGE_VERSION ); + if (!msgLvl(MSG::DEBUG)) m_extendedDebug = false; + ATH_MSG_INFO("iPatFitter::initialize() - package version " << PACKAGE_VERSION); msg(MSG::INFO) << " with options: "; - if (m_aggregateMaterial) msg() << " AggregateMaterial"; - if (m_asymmetricCaloEnergy) msg() << " AsymmetricCaloEnergy"; - if (m_fullCombinedFit) msg() << " FullCombinedFit"; - if (m_globalFit) msg() << " GlobalFitter"; - if (m_lineFit) msg() << " LineFit with p = " - << m_lineMomentum/Gaudi::Units::GeV << " GeV"; - if (m_constrainedAlignmentEffects) msg() << " ConstrainedAlignmentEffects"; - if (m_extendedDebug) msg() << " ExtendedDebug"; - if (m_forcedRefitsForValidation) msg() << " ForcedRefitsForValidation = " - << m_forcedRefitsForValidation; - if (m_useStepPropagator) msg() << " UseStepPropagator = " - << m_useStepPropagator; + if (m_aggregateMaterial) msg() << " AggregateMaterial"; + if (m_asymmetricCaloEnergy) msg() << " AsymmetricCaloEnergy"; + if (m_fullCombinedFit) msg() << " FullCombinedFit"; + if (m_globalFit) msg() << " GlobalFitter"; + if (m_lineFit) msg() << " LineFit with p = " + << m_lineMomentum / Gaudi::Units::GeV << " GeV"; + if (m_constrainedAlignmentEffects) msg() << " ConstrainedAlignmentEffects"; + if (m_extendedDebug) msg() << " ExtendedDebug"; + if (m_forcedRefitsForValidation) msg() << " ForcedRefitsForValidation = " + << m_forcedRefitsForValidation; + if (m_useStepPropagator) msg() << " UseStepPropagator = " + << m_useStepPropagator; msg() << endmsg; - + // fill WARNING messages m_messageHelper->setMaxNumberOfMessagesPrinted(m_maxWarnings); m_messageHelper->setNumberOfMessages(26); @@ -150,148 +147,127 @@ iPatFitter::initialize() m_messageHelper->setMessage(7, "fit (Track + MeasurementSet): track without measuredPerigee"); m_messageHelper->setMessage(8, "fit (Track + MeasurementSet): FIX material may get double counted"); m_messageHelper->setMessage(9, "fit (Perigee + MeasurementSet): outlier removal not implemented"); - m_messageHelper->setMessage(10,"fit (Perigee + MeasurementSet): null perigee"); - m_messageHelper->setMessage(11,"fit (combined muon): outlier removal not implemented"); - m_messageHelper->setMessage(12,"fit (combined muon): no perigee start value"); - m_messageHelper->setMessage(13,"fit (combined muon): indet track without trackStateOnSurfaces"); - m_messageHelper->setMessage(14,"fit (combined muon): indet track without measuredPerigee"); - m_messageHelper->setMessage(15,"addMeasurements: no intersection to MeasurementSet"); - m_messageHelper->setMessage(16,"addMeasurements: skip TSOS as not understood. Type: "); - m_messageHelper->setMessage(17,"addMeasurements: skip TSOS with missing trackParameters. Type: "); - m_messageHelper->setMessage(18,"addMeasurements: skip measurement as fail to intersect associated surface from given starting parameters"); - m_messageHelper->setMessage(19,"addMeasurements: TSOS skipped. Type: "); - m_messageHelper->setMessage(20,"fail fit as CaloDeposit outside calo volume"); - m_messageHelper->setMessage(21,"conflicting energy deposit sign for inDet material"); - m_messageHelper->setMessage(22,"conflicting energy deposit sign for spectrometer material"); - m_messageHelper->setMessage(23,"excessive calorimeter energy loss : "); - m_messageHelper->setMessage(24,"excessive spectrometer energy loss : "); - m_messageHelper->setMessage(25,"flipped track measurement order"); + m_messageHelper->setMessage(10, "fit (Perigee + MeasurementSet): null perigee"); + m_messageHelper->setMessage(11, "fit (combined muon): outlier removal not implemented"); + m_messageHelper->setMessage(12, "fit (combined muon): no perigee start value"); + m_messageHelper->setMessage(13, "fit (combined muon): indet track without trackStateOnSurfaces"); + m_messageHelper->setMessage(14, "fit (combined muon): indet track without measuredPerigee"); + m_messageHelper->setMessage(15, "addMeasurements: no intersection to MeasurementSet"); + m_messageHelper->setMessage(16, "addMeasurements: skip TSOS as not understood. Type: "); + m_messageHelper->setMessage(17, "addMeasurements: skip TSOS with missing trackParameters. Type: "); + m_messageHelper->setMessage(18, + "addMeasurements: skip measurement as fail to intersect associated surface from given starting parameters"); + m_messageHelper->setMessage(19, "addMeasurements: TSOS skipped. Type: "); + m_messageHelper->setMessage(20, "fail fit as CaloDeposit outside calo volume"); + m_messageHelper->setMessage(21, "conflicting energy deposit sign for inDet material"); + m_messageHelper->setMessage(22, "conflicting energy deposit sign for spectrometer material"); + m_messageHelper->setMessage(23, "excessive calorimeter energy loss : "); + m_messageHelper->setMessage(24, "excessive spectrometer energy loss : "); + m_messageHelper->setMessage(25, "flipped track measurement order"); // retrieve the MaterialProvider and various Intersectors - if (m_materialAllocator.retrieve().isFailure()) - { - ATH_MSG_FATAL( "Failed to retrieve tool " << m_materialAllocator ); - return StatusCode::FAILURE; - } - else - { - ATH_MSG_INFO( "Retrieved tool " << m_materialAllocator ); - } - if (m_rungeKuttaIntersector.retrieve().isFailure()) - { - ATH_MSG_FATAL( "Failed to retrieve tool " << m_rungeKuttaIntersector ); - return StatusCode::FAILURE; - } - else - { - ATH_MSG_INFO( "Retrieved tool " << m_rungeKuttaIntersector ); - } - if (m_solenoidalIntersector.retrieve().isFailure()) - { - ATH_MSG_FATAL( "Failed to retrieve tool " << m_solenoidalIntersector ); - return StatusCode::FAILURE; + if (m_materialAllocator.retrieve().isFailure()) { + ATH_MSG_FATAL("Failed to retrieve tool " << m_materialAllocator); + return StatusCode::FAILURE; + } else { + ATH_MSG_INFO("Retrieved tool " << m_materialAllocator); } - else - { - ATH_MSG_INFO( "Retrieved tool " << m_solenoidalIntersector ); + if (m_rungeKuttaIntersector.retrieve().isFailure()) { + ATH_MSG_FATAL("Failed to retrieve tool " << m_rungeKuttaIntersector); + return StatusCode::FAILURE; + } else { + ATH_MSG_INFO("Retrieved tool " << m_rungeKuttaIntersector); } - if (m_useStepPropagator) - { - if (m_useStepPropagator == 2) m_stepField = Trk::MagneticFieldProperties(Trk::FastField); - if (m_stepPropagator.retrieve().isFailure()) - { - ATH_MSG_FATAL( "Failed to retrieve tool " << m_stepPropagator ); - return StatusCode::FAILURE; - } - else - { - ATH_MSG_INFO( "Retrieved tool " << m_stepPropagator ); - } + if (m_solenoidalIntersector.retrieve().isFailure()) { + ATH_MSG_FATAL("Failed to retrieve tool " << m_solenoidalIntersector); + return StatusCode::FAILURE; + } else { + ATH_MSG_INFO("Retrieved tool " << m_solenoidalIntersector); } - if (m_straightLineIntersector.retrieve().isFailure()) - { - ATH_MSG_FATAL( "Failed to retrieve tool " << m_straightLineIntersector ); - return StatusCode::FAILURE; + if (m_useStepPropagator) { + if (m_useStepPropagator == 2) m_stepField = Trk::MagneticFieldProperties(Trk::FastField); + if (m_stepPropagator.retrieve().isFailure()) { + ATH_MSG_FATAL("Failed to retrieve tool " << m_stepPropagator); + return StatusCode::FAILURE; + } else { + ATH_MSG_INFO("Retrieved tool " << m_stepPropagator); + } } - else - { - ATH_MSG_INFO( "Retrieved tool " << m_straightLineIntersector ); + if (m_straightLineIntersector.retrieve().isFailure()) { + ATH_MSG_FATAL("Failed to retrieve tool " << m_straightLineIntersector); + return StatusCode::FAILURE; + } else { + ATH_MSG_INFO("Retrieved tool " << m_straightLineIntersector); } - + // need to create the IndetExit and MuonEntrance TrackingVolumes - if (m_trackingVolumesSvc.retrieve().isFailure()) - { - ATH_MSG_FATAL( "Failed to retrieve Svc " << m_trackingVolumesSvc ); - return StatusCode::FAILURE; - } - else - { - ATH_MSG_INFO( "Retrieved Svc " << m_trackingVolumesSvc ); - m_calorimeterVolume = new Volume( - m_trackingVolumesSvc->volume(ITrackingVolumesSvc::MuonSpectrometerEntryLayer)); - m_indetVolume = new Volume( - m_trackingVolumesSvc->volume(ITrackingVolumesSvc::CalorimeterEntryLayer)); + if (m_trackingVolumesSvc.retrieve().isFailure()) { + ATH_MSG_FATAL("Failed to retrieve Svc " << m_trackingVolumesSvc); + return StatusCode::FAILURE; + } else { + ATH_MSG_INFO("Retrieved Svc " << m_trackingVolumesSvc); + m_calorimeterVolume = new Volume( + m_trackingVolumesSvc->volume(ITrackingVolumesSvc::MuonSpectrometerEntryLayer)); + m_indetVolume = new Volume( + m_trackingVolumesSvc->volume(ITrackingVolumesSvc::CalorimeterEntryLayer)); } // can now create FitProcedure class m_fitProcedure = new FitProcedure(m_constrainedAlignmentEffects, - m_extendedDebug, - m_lineFit, - m_rungeKuttaIntersector, - m_solenoidalIntersector, - m_straightLineIntersector, - m_stepPropagator, - m_indetVolume, - m_maxIterations, - m_useStepPropagator); - + m_extendedDebug, + m_lineFit, + m_rungeKuttaIntersector, + m_solenoidalIntersector, + m_straightLineIntersector, + m_stepPropagator, + m_indetVolume, + m_maxIterations, + m_useStepPropagator); + return StatusCode::SUCCESS; -} + } -StatusCode -iPatFitter::finalize() -{ + StatusCode + iPatFitter::finalize() { // print summary statistics - double fits = static_cast<double>(m_countFitAttempts); - double goodFit = 0.; - double iterations = 0.; - if (m_countFitAttempts) goodFit = static_cast<double>(100*m_countGoodFits) / fits; - if (m_countGoodFits) iterations = static_cast<double>(m_countIterations) / - static_cast<double>(m_countGoodFits); - ATH_MSG_INFO( std::setiosflags(std::ios::fixed) - << "finalized after " << m_countFitAttempts - << " track-fits attempted, out of which " - << std::setw(5) << std::setprecision(1) << goodFit - << "% converged, taking an average " - << std::setw(5) << std::setprecision(2) << iterations - << " iterations" ); - if (m_forcedRefitsForValidation) - { - double refits = static_cast<double>(m_countRefitAttempts); - double goodRefit = 0.; - double refitIterations = 0.; - if (m_countRefitAttempts) goodRefit = static_cast<double>(100*m_countGoodRefits) / refits; - if (m_countGoodRefits) refitIterations = static_cast<double>(m_countRefitIterations) / - static_cast<double>(m_countGoodRefits); - ATH_MSG_INFO( std::setiosflags(std::ios::fixed) - << "finalized after " << m_countRefitAttempts - << " refits attempted, out of which " - << std::setw(5) << std::setprecision(1) << goodRefit - << "% converged, taking an average " - << std::setw(5) << std::setprecision(2) << refitIterations - << " iterations" ); + double fits = static_cast<double>(m_countFitAttempts); + double goodFit = 0.; + double iterations = 0.; + + if (m_countFitAttempts) goodFit = static_cast<double>(100 * m_countGoodFits) / fits; + if (m_countGoodFits) iterations = static_cast<double>(m_countIterations) / + static_cast<double>(m_countGoodFits); + ATH_MSG_INFO(std::setiosflags(std::ios::fixed) + << "finalized after " << m_countFitAttempts + << " track-fits attempted, out of which " + << std::setw(5) << std::setprecision(1) << goodFit + << "% converged, taking an average " + << std::setw(5) << std::setprecision(2) << iterations + << " iterations"); + if (m_forcedRefitsForValidation) { + double refits = static_cast<double>(m_countRefitAttempts); + double goodRefit = 0.; + double refitIterations = 0.; + if (m_countRefitAttempts) goodRefit = static_cast<double>(100 * m_countGoodRefits) / refits; + if (m_countGoodRefits) refitIterations = static_cast<double>(m_countRefitIterations) / + static_cast<double>(m_countGoodRefits); + ATH_MSG_INFO(std::setiosflags(std::ios::fixed) + << "finalized after " << m_countRefitAttempts + << " refits attempted, out of which " + << std::setw(5) << std::setprecision(1) << goodRefit + << "% converged, taking an average " + << std::setw(5) << std::setprecision(2) << refitIterations + << " iterations"); } - + m_messageHelper->printSummary(); // delete all objects owned by class - if (m_globalFit && m_measurements) - { - for (auto m : *m_measurements) - { - delete m; - } - m_measurements->clear(); + if (m_globalFit && m_measurements) { + for (auto m : *m_measurements) { + delete m; + } + m_measurements->clear(); } delete m_calorimeterVolume; delete m_fitProcedure; @@ -299,556 +275,499 @@ iPatFitter::finalize() delete m_measurements; delete m_messageHelper; delete m_parameters; - + return StatusCode::SUCCESS; -} + } -Track* -iPatFitter::fit (const Track& track, - const RunOutlierRemoval runOutlier, - const ParticleHypothesis particleHypothesis) const -{ - ATH_MSG_VERBOSE( " track fit " ); + Track* + iPatFitter::fit(const Track& track, + const RunOutlierRemoval runOutlier, + const ParticleHypothesis particleHypothesis) const { + ATH_MSG_VERBOSE(" track fit "); ++m_countFitAttempts; // outlier removal not implemented - if (runOutlier) m_messageHelper->printWarning(0); + if (runOutlier) m_messageHelper->printWarning(0); // create Perigee if starting parameters are for a different surface type - const Perigee* perigee = track.perigeeParameters(); - PerigeeSurface* perigeeSurface = 0; - if (! perigee) - { - DataVector<const TrackStateOnSurface>::const_iterator s = track.trackStateOnSurfaces()->begin(); - while (s != track.trackStateOnSurfaces()->end() && ! (**s).trackParameters()) ++s; - if (! (**s).trackParameters()) - { - // input track without parameters - m_messageHelper->printWarning(1); - return 0; - } - - Amg::Vector3D origin((**s).trackParameters()->position()); - perigeeSurface = new PerigeeSurface(origin); - perigee = new Perigee((**s).trackParameters()->position(), - (**s).trackParameters()->momentum(), - (**s).trackParameters()->charge(), - *perigeeSurface); + const Perigee* perigee = track.perigeeParameters(); + PerigeeSurface* perigeeSurface = 0; + if (!perigee) { + DataVector<const TrackStateOnSurface>::const_iterator s = track.trackStateOnSurfaces()->begin(); + while (s != track.trackStateOnSurfaces()->end() && !(**s).trackParameters()) ++s; + if (!(**s).trackParameters()) { + // input track without parameters + m_messageHelper->printWarning(1); + return 0; + } + + Amg::Vector3D origin((**s).trackParameters()->position()); + perigeeSurface = new PerigeeSurface(origin); + perigee = new Perigee((**s).trackParameters()->position(), + (**s).trackParameters()->momentum(), + (**s).trackParameters()->charge(), + *perigeeSurface); } delete m_parameters; - m_parameters = new FitParameters(*perigee); - + m_parameters = new FitParameters(*perigee); + // set up the measurements - if (! track.trackStateOnSurfaces()) - { - // input track without trackStateOnSurfaces - m_messageHelper->printWarning(2); - return 0; + if (!track.trackStateOnSurfaces()) { + // input track without trackStateOnSurfaces + m_messageHelper->printWarning(2); + return 0; } - + std::vector<FitMeasurement*>* measurements = measurementList(); bool haveMaterial = addMeasurements(*measurements, - *m_parameters, - particleHypothesis, - *track.trackStateOnSurfaces()); + *m_parameters, + particleHypothesis, + *track.trackStateOnSurfaces()); // allocate material - if (! haveMaterial && particleHypothesis != Trk::nonInteracting) - { - m_materialAllocator->allocateMaterial(*measurements, - particleHypothesis, - *m_parameters, - *perigee); + if (!haveMaterial && particleHypothesis != Trk::nonInteracting) { + m_materialAllocator->allocateMaterial(*measurements, + particleHypothesis, + *m_parameters, + *perigee); } // perform fit and return fitted track - TrackInfo trackInfo(TrackInfo::iPatTrackFitter,particleHypothesis); + TrackInfo trackInfo(TrackInfo::iPatTrackFitter, particleHypothesis); trackInfo.addPatternReco(track.info()); Trk::Track* fittedTrack = performFit(measurements, m_parameters, particleHypothesis, trackInfo); - if (perigeeSurface) - { - delete perigeeSurface; - delete perigee; + if (perigeeSurface) { + delete perigeeSurface; + delete perigee; } // validation for (int i = 0; i < m_forcedRefitsForValidation; ++i) - if (fittedTrack) refit(*fittedTrack,runOutlier,particleHypothesis); - - return fittedTrack; -} - -Track* -iPatFitter::fit (const Track& /*track*/, - const PrepRawDataSet& /*prepRawDataSet*/, - const RunOutlierRemoval /*trackrunOutlier*/, - const ParticleHypothesis /*trackparticleHypothesis*/) const -{ + if (fittedTrack) refit(*fittedTrack, runOutlier, particleHypothesis); + + return fittedTrack; + } + + Track* + iPatFitter::fit(const Track& /*track*/, + const PrepRawDataSet& /*prepRawDataSet*/, + const RunOutlierRemoval /*trackrunOutlier*/, + const ParticleHypothesis /*trackparticleHypothesis*/) const { ++m_countFitAttempts; // track + PrepRawDataSet interface not implemented m_messageHelper->printWarning(3); return 0; -} + } -Track* -iPatFitter::fit (const PrepRawDataSet& /*prepRawDataSet*/, - const TrackParameters& /*estimatedParametersNearOrigin*/, - const RunOutlierRemoval /*trackrunOutlier*/, - const ParticleHypothesis /*trackparticleHypothesis*/) const -{ + Track* + iPatFitter::fit(const PrepRawDataSet& /*prepRawDataSet*/, + const TrackParameters& /*estimatedParametersNearOrigin*/, + const RunOutlierRemoval /*trackrunOutlier*/, + const ParticleHypothesis /*trackparticleHypothesis*/) const { ++m_countFitAttempts; // PrepRawDataSet interface not implemented m_messageHelper->printWarning(4); return 0; -} + } -Track* -iPatFitter::fit (const Track& track, - const MeasurementSet& measurementSet, - const RunOutlierRemoval runOutlier, - const ParticleHypothesis particleHypothesis) const -{ - ATH_MSG_VERBOSE( " track + measurementSet fit " ); + Track* + iPatFitter::fit(const Track& track, + const MeasurementSet& measurementSet, + const RunOutlierRemoval runOutlier, + const ParticleHypothesis particleHypothesis) const { + ATH_MSG_VERBOSE(" track + measurementSet fit "); ++m_countFitAttempts; // outlier removal not implemented - if (runOutlier) m_messageHelper->printWarning(5); + if (runOutlier) m_messageHelper->printWarning(5); // create starting parameters - if (! track.trackStateOnSurfaces()) - { - // track without trackStateOnSurfaces - m_messageHelper->printWarning(6); - return 0; + if (!track.trackStateOnSurfaces()) { + // track without trackStateOnSurfaces + m_messageHelper->printWarning(6); + return 0; } const Perigee* perigee = dynamic_cast<const Perigee*> - ((**track.trackStateOnSurfaces()->begin()).trackParameters()); - if (! perigee) - { - // track without measuredPerigee - m_messageHelper->printWarning(7); - return 0; + ((**track.trackStateOnSurfaces()->begin()).trackParameters()); + if (!perigee) { + // track without measuredPerigee + m_messageHelper->printWarning(7); + return 0; } - + delete m_parameters; - m_parameters = new FitParameters(*perigee); - + m_parameters = new FitParameters(*perigee); + // set up the measurements (and material) std::vector<FitMeasurement*>* measurements = measurementList(); - if (addMeasurements(*measurements,*m_parameters,particleHypothesis,*track.trackStateOnSurfaces())) - m_messageHelper->printWarning(8); // FIX needed: material may get double counted + if (addMeasurements(*measurements, *m_parameters, particleHypothesis, + *track.trackStateOnSurfaces())) m_messageHelper->printWarning(8); // FIX needed: material may + // get double counted addMeasurements(*measurements, - measurementSet, - *m_parameters); - if (particleHypothesis != Trk::nonInteracting) - { - const TrackParameters& endParams = *(track.trackStateOnSurfaces()->back()->trackParameters()); - m_materialAllocator->allocateMaterial(*measurements, - particleHypothesis, - *m_parameters, - endParams); + measurementSet, + *m_parameters); + if (particleHypothesis != Trk::nonInteracting) { + const TrackParameters& endParams = *(track.trackStateOnSurfaces()->back()->trackParameters()); + m_materialAllocator->allocateMaterial(*measurements, + particleHypothesis, + *m_parameters, + endParams); } - + // perform fit and return fitted track - TrackInfo trackInfo(TrackInfo::iPatTrackFitter,particleHypothesis); + TrackInfo trackInfo(TrackInfo::iPatTrackFitter, particleHypothesis); trackInfo.addPatternReco(track.info()); return performFit(measurements, - m_parameters, - particleHypothesis, - trackInfo, - track.trackStateOnSurfaces(), - track.fitQuality()); -} - -Track* -iPatFitter::fit (const MeasurementSet& measurementSet, - const TrackParameters& perigeeStartValue, - const RunOutlierRemoval runOutlier, - const ParticleHypothesis particleHypothesis) const -{ - ATH_MSG_VERBOSE( " fit from measurement set + perigeeStartValue " ); + m_parameters, + particleHypothesis, + trackInfo, + track.trackStateOnSurfaces(), + track.fitQuality()); + } + + Track* + iPatFitter::fit(const MeasurementSet& measurementSet, + const TrackParameters& perigeeStartValue, + const RunOutlierRemoval runOutlier, + const ParticleHypothesis particleHypothesis) const { + ATH_MSG_VERBOSE(" fit from measurement set + perigeeStartValue "); ++m_countFitAttempts; // outlier removal not implemented if (runOutlier) m_messageHelper->printWarning(9); const Perigee* perigee = dynamic_cast<const Perigee*>(&perigeeStartValue); - if (! perigee) - { - // track without Perigee start value - m_messageHelper->printWarning(10); - return 0; + if (!perigee) { + // track without Perigee start value + m_messageHelper->printWarning(10); + return 0; } delete m_parameters; - m_parameters = new FitParameters(*perigee); - + m_parameters = new FitParameters(*perigee); + // set up the measurements (and material) std::vector<FitMeasurement*>* measurements = measurementList(); - addMeasurements(*measurements,measurementSet,*m_parameters); - if (particleHypothesis != Trk::nonInteracting) - { - m_materialAllocator->allocateMaterial(*measurements, - particleHypothesis, - *m_parameters, - perigeeStartValue); + addMeasurements(*measurements, measurementSet, *m_parameters); + if (particleHypothesis != Trk::nonInteracting) { + m_materialAllocator->allocateMaterial(*measurements, + particleHypothesis, + *m_parameters, + perigeeStartValue); } - + // perform fit and return fitted track - TrackInfo trackInfo(TrackInfo::iPatTrackFitter,particleHypothesis); + TrackInfo trackInfo(TrackInfo::iPatTrackFitter, particleHypothesis); return performFit(measurements, m_parameters, particleHypothesis, trackInfo); -} + } -Track* -iPatFitter::fit (const Track& indetTrack, - const Track& spectrometerTrack, - const RunOutlierRemoval runOutlier, - const ParticleHypothesis particleHypothesis) const -{ - ATH_MSG_VERBOSE( " combined muon fit " ); + Track* + iPatFitter::fit(const Track& indetTrack, + const Track& spectrometerTrack, + const RunOutlierRemoval runOutlier, + const ParticleHypothesis particleHypothesis) const { + ATH_MSG_VERBOSE(" combined muon fit "); ++m_countFitAttempts; // outlier removal not implemented if (runOutlier) m_messageHelper->printWarning(11); // indet (full refit to measurements or use measured perigee) - bool haveMaterial = true; + bool haveMaterial = true; std::vector<FitMeasurement*>* measurements = measurementList(); delete m_parameters; - if (indetTrack.perigeeParameters()) - { - m_parameters = new FitParameters(*indetTrack.perigeeParameters()); + if (indetTrack.perigeeParameters()) { + m_parameters = new FitParameters(*indetTrack.perigeeParameters()); + } else if (spectrometerTrack.perigeeParameters() + && m_indetVolume->inside(spectrometerTrack.perigeeParameters()->associatedSurface().center())) { + m_parameters = new FitParameters(*spectrometerTrack.perigeeParameters()); + } else { + // combined muon fit without Perigee start value" + m_messageHelper->printWarning(12); + return 0; } - else if (spectrometerTrack.perigeeParameters() - && m_indetVolume->inside(spectrometerTrack.perigeeParameters()->associatedSurface().center())) - { - m_parameters = new FitParameters(*spectrometerTrack.perigeeParameters()); - } - else - { - // combined muon fit without Perigee start value" - m_messageHelper->printWarning(12); - return 0; - } - + // get both perigee parameters, use most precise for momentum starting value - const Perigee* indetPerigee = dynamic_cast<const Perigee*>(indetTrack.perigeeParameters()); - const Perigee* spectrometerPerigee = dynamic_cast<const Perigee*>(spectrometerTrack.perigeeParameters()); + const Perigee* indetPerigee = dynamic_cast<const Perigee*>(indetTrack.perigeeParameters()); + const Perigee* spectrometerPerigee = dynamic_cast<const Perigee*>(spectrometerTrack.perigeeParameters()); if (spectrometerPerigee - && ! m_indetVolume->inside(spectrometerPerigee->associatedSurface().center())) - spectrometerPerigee = 0; - if (! spectrometerTrack.info().trackProperties(Trk::TrackInfo::StraightTrack) - && spectrometerPerigee) - { - if (indetTrack.info().trackProperties(Trk::TrackInfo::StraightTrack) - || ! indetPerigee - || ! indetPerigee->covariance()) - { - m_parameters->qOverP(spectrometerPerigee->parameters()[Trk::qOverP]); - ATH_MSG_VERBOSE(" set starting momentum from spectrometer " - << 1./(m_parameters->qOverP()*Gaudi::Units::GeV) << " GeV" ); - } - else if (indetPerigee) - { - if (spectrometerPerigee->covariance() - && (*spectrometerPerigee->covariance())(Trk::qOverP,Trk::qOverP) < - (*indetPerigee->covariance())(Trk::qOverP,Trk::qOverP)) - { - m_parameters->qOverP(spectrometerPerigee->parameters()[Trk::qOverP]); - ATH_MSG_VERBOSE(" set starting momentum from spectrometer " - << 1./(m_parameters->qOverP()*Gaudi::Units::GeV) << " GeV" ); - } - } + && !m_indetVolume->inside(spectrometerPerigee->associatedSurface().center())) spectrometerPerigee = 0; + if (!spectrometerTrack.info().trackProperties(Trk::TrackInfo::StraightTrack) + && spectrometerPerigee) { + if (indetTrack.info().trackProperties(Trk::TrackInfo::StraightTrack) + || !indetPerigee + || !indetPerigee->covariance()) { + m_parameters->qOverP(spectrometerPerigee->parameters()[Trk::qOverP]); + ATH_MSG_VERBOSE(" set starting momentum from spectrometer " + << 1. / (m_parameters->qOverP() * Gaudi::Units::GeV) << " GeV"); + } else if (indetPerigee) { + if (spectrometerPerigee->covariance() + && (*spectrometerPerigee->covariance())(Trk::qOverP, Trk::qOverP) < + (*indetPerigee->covariance())(Trk::qOverP, Trk::qOverP)) { + m_parameters->qOverP(spectrometerPerigee->parameters()[Trk::qOverP]); + ATH_MSG_VERBOSE(" set starting momentum from spectrometer " + << 1. / (m_parameters->qOverP() * Gaudi::Units::GeV) << " GeV"); + } + } } - if (m_fullCombinedFit) - { - // set up the measurements - if (! indetTrack.trackStateOnSurfaces()) - { - // fail as indet track without trackStateOnSurfaces - m_messageHelper->printWarning(13); - return 0; - } - if (! addMeasurements(*measurements, - *m_parameters, - particleHypothesis, - *indetTrack.trackStateOnSurfaces())) haveMaterial = false; + if (m_fullCombinedFit) { + // set up the measurements + if (!indetTrack.trackStateOnSurfaces()) { + // fail as indet track without trackStateOnSurfaces + m_messageHelper->printWarning(13); + return 0; + } + if (!addMeasurements(*measurements, + *m_parameters, + particleHypothesis, + *indetTrack.trackStateOnSurfaces())) haveMaterial = false; } // add the spectrometer measurements - if (! addMeasurements(*measurements, - *m_parameters, - particleHypothesis, - *spectrometerTrack.trackStateOnSurfaces())) haveMaterial = false; - if (! haveMaterial && particleHypothesis != Trk::nonInteracting) - { - Perigee* startingPerigee = m_parameters->startingPerigee(); - if (startingPerigee) - { - m_materialAllocator->allocateMaterial(*measurements, - particleHypothesis, - *m_parameters, - *startingPerigee); - delete startingPerigee; - } + if (!addMeasurements(*measurements, + *m_parameters, + particleHypothesis, + *spectrometerTrack.trackStateOnSurfaces())) haveMaterial = false; + if (!haveMaterial && particleHypothesis != Trk::nonInteracting) { + Perigee* startingPerigee = m_parameters->startingPerigee(); + if (startingPerigee) { + m_materialAllocator->allocateMaterial(*measurements, + particleHypothesis, + *m_parameters, + *startingPerigee); + delete startingPerigee; + } } - + // create starting parameters, perform fit and return fitted track - TrackInfo trackInfo(TrackInfo::iPatTrackFitter,particleHypothesis); + TrackInfo trackInfo(TrackInfo::iPatTrackFitter, particleHypothesis); trackInfo.addPatternReco(indetTrack.info()); trackInfo.addPatternReco(spectrometerTrack.info()); - if (m_fullCombinedFit) - { - Trk::Track* fittedTrack = performFit(measurements, m_parameters, particleHypothesis, trackInfo); - - // validation - for (int i = 0; i < m_forcedRefitsForValidation; ++i) - if (fittedTrack) refit(*fittedTrack,runOutlier,particleHypothesis); - - return fittedTrack; - } - else // hybrid fit - { - if (! indetPerigee) - { - // fail combined muon fit as indet track without measuredPerigee - m_messageHelper->printWarning(14); - return 0; - } - measurements->insert(measurements->begin(), new FitMeasurement(*indetPerigee)); - FitParameters measuredParameters(*indetPerigee); - Trk::Track* fittedTrack = performFit(measurements, - &measuredParameters, - particleHypothesis, - trackInfo, - indetTrack.trackStateOnSurfaces(), - indetTrack.fitQuality()); - - // validation - for (int i = 0; i < m_forcedRefitsForValidation; ++i) - if (fittedTrack) refit(*fittedTrack,runOutlier,particleHypothesis); - - return fittedTrack; + if (m_fullCombinedFit) { + Trk::Track* fittedTrack = performFit(measurements, m_parameters, particleHypothesis, trackInfo); + + // validation + for (int i = 0; i < m_forcedRefitsForValidation; ++i) + if (fittedTrack) refit(*fittedTrack, runOutlier, particleHypothesis); + + return fittedTrack; + } else { // hybrid fit + if (!indetPerigee) { + // fail combined muon fit as indet track without measuredPerigee + m_messageHelper->printWarning(14); + return 0; + } + measurements->insert(measurements->begin(), new FitMeasurement(*indetPerigee)); + FitParameters measuredParameters(*indetPerigee); + Trk::Track* fittedTrack = performFit(measurements, + &measuredParameters, + particleHypothesis, + trackInfo, + indetTrack.trackStateOnSurfaces(), + indetTrack.fitQuality()); + + // validation + for (int i = 0; i < m_forcedRefitsForValidation; ++i) + if (fittedTrack) refit(*fittedTrack, runOutlier, particleHypothesis); + + return fittedTrack; } -} + } -void -iPatFitter::addMeasurements (std::vector<FitMeasurement*>& measurements, - const MeasurementSet& measurementSet, - const FitParameters& parameters) const -{ + void + iPatFitter::addMeasurements(std::vector<FitMeasurement*>& measurements, + const MeasurementSet& measurementSet, + const FitParameters& parameters) const { // extrapolation to set FittedTrajectory - double qOverP = parameters.qOverP(); - double previousDistance = -m_orderingTolerance; - double previousDistanceR = -m_orderingTolerance; - double previousDistanceZ = -m_orderingTolerance; - bool reorder = false; - Amg::Vector3D startDirection = parameters.direction(); - Amg::Vector3D startPosition = parameters.position(); - ExtrapolationType type = FittedTrajectory; - const TrackSurfaceIntersection* vertex = parameters.intersection(); - const TrackSurfaceIntersection* intersection = vertex; + double qOverP = parameters.qOverP(); + double previousDistance = -m_orderingTolerance; + double previousDistanceR = -m_orderingTolerance; + double previousDistanceZ = -m_orderingTolerance; + bool reorder = false; + + Amg::Vector3D startDirection = parameters.direction(); + Amg::Vector3D startPosition = parameters.position(); + ExtrapolationType type = FittedTrajectory; + const TrackSurfaceIntersection* vertex = parameters.intersection(); + const TrackSurfaceIntersection* intersection = vertex; int hit = measurements.size(); for (MeasurementSet::const_iterator m = measurementSet.begin(); - m != measurementSet.end(); - ++m, ++hit) - { - const TrackSurfaceIntersection* newIntersection = m_useStepPropagator>=1? - m_stepPropagator->intersectSurface((**m).associatedSurface(), - intersection, - qOverP, - m_stepField, - Trk::muon): - m_rungeKuttaIntersector->intersectSurface((**m).associatedSurface(), - intersection, - qOverP); - if (m_useStepPropagator==99 && newIntersection) - { - const TrackSurfaceIntersection* newIntersectionSTEP = - m_stepPropagator->intersectSurface((**m).associatedSurface(), - intersection, - qOverP, - m_stepField, - Trk::muon); - if (newIntersectionSTEP) - { + m != measurementSet.end(); + ++m, ++hit) { + const TrackSurfaceIntersection* newIntersection = m_useStepPropagator >= 1 ? + m_stepPropagator->intersectSurface((**m).associatedSurface(), + intersection, + qOverP, + m_stepField, + Trk::muon) : + m_rungeKuttaIntersector->intersectSurface( + (**m).associatedSurface(), + intersection, + qOverP); + if (m_useStepPropagator == 99 && newIntersection) { + const TrackSurfaceIntersection* newIntersectionSTEP = + m_stepPropagator->intersectSurface((**m).associatedSurface(), + intersection, + qOverP, + m_stepField, + Trk::muon); + if (newIntersectionSTEP) { // double dist = 1000.*(newIntersectionSTEP->position()-newIntersection->position()).mag(); -// std::cout << " iPat 1 distance STEP and Intersector " << dist << std::endl; -// if(dist>10.) std::cout << " iPat 1 ALARM distance STEP and Intersector " << dist << std::endl; - delete newIntersectionSTEP; +// std::cout << " iPat 1 distance STEP and Intersector " << dist << std::endl; +// if(dist>10.) std::cout << " iPat 1 ALARM distance STEP and Intersector " << dist << std::endl; + delete newIntersectionSTEP; // } else { // std::cout << " iPat 1 ALARM STEP did not intersect! " << std::endl; - } } - if (newIntersection) - { - intersection = newIntersection; - - // check if ordering OK - if (! reorder) - { - double distance = startDirection.dot( - intersection->position() - startPosition ); - Amg::Vector3D positionMst = (**m).globalPosition(); - double distanceR = sqrt( - (positionMst.x() - startPosition.x())*(positionMst.x() - startPosition.x()) + - (positionMst.y() - startPosition.y())*(positionMst.y() - startPosition.y()) ); - double distanceZ = (positionMst.z() - startPosition.z()); - if (startDirection.z() < 0) distanceZ = -distanceZ; - if (distance < previousDistance - && distanceR < previousDistanceR - && distanceZ < previousDistanceZ) - { - reorder = true; - ATH_MSG_DEBUG( " reorder 3D distance " << distance - previousDistance - << " R distance " << distanceR - previousDistanceR - << " Z distance " << distanceZ - previousDistanceZ ); - } - previousDistance = distance - m_orderingTolerance; - previousDistanceR = distanceR - m_orderingTolerance; - previousDistanceZ = distanceZ - m_orderingTolerance; - } - } - else - { - // FIXME - // no intersection to MeasurementSet - m_messageHelper->printWarning(15); - intersection = new TrackSurfaceIntersection(*intersection); - } - FitMeasurement* measurement = new FitMeasurement(hit,0,*m); - measurement->intersection(type,intersection); - measurement->qOverP(qOverP); - measurements.push_back(measurement); + } + if (newIntersection) { + intersection = newIntersection; + + // check if ordering OK + if (!reorder) { + double distance = startDirection.dot( + intersection->position() - startPosition); + Amg::Vector3D positionMst = (**m).globalPosition(); + double distanceR = sqrt( + (positionMst.x() - startPosition.x()) * (positionMst.x() - startPosition.x()) + + (positionMst.y() - startPosition.y()) * (positionMst.y() - startPosition.y())); + double distanceZ = (positionMst.z() - startPosition.z()); + if (startDirection.z() < 0) distanceZ = -distanceZ; + if (distance < previousDistance + && distanceR < previousDistanceR + && distanceZ < previousDistanceZ) { + reorder = true; + ATH_MSG_DEBUG(" reorder 3D distance " << distance - previousDistance + << " R distance " << distanceR - previousDistanceR + << " Z distance " << distanceZ - previousDistanceZ); + } + previousDistance = distance - m_orderingTolerance; + previousDistanceR = distanceR - m_orderingTolerance; + previousDistanceZ = distanceZ - m_orderingTolerance; + } + } else { + // FIXME + // no intersection to MeasurementSet + m_messageHelper->printWarning(15); + intersection = new TrackSurfaceIntersection(*intersection); + } + FitMeasurement* measurement = new FitMeasurement(hit, 0, *m); + measurement->intersection(type, intersection); + measurement->qOverP(qOverP); + measurements.push_back(measurement); } - + // reorder if necessary - if (reorder) m_materialAllocator->orderMeasurements(measurements,startDirection,startPosition); + if (reorder) m_materialAllocator->orderMeasurements(measurements, startDirection, startPosition); delete vertex; -} + } -bool -iPatFitter::addMeasurements (std::vector<FitMeasurement*>& measurements, - const FitParameters& parameters, - ParticleHypothesis particleHypothesis, - const DataVector<const TrackStateOnSurface>& trackStateOnSurfaces) const -{ + bool + iPatFitter::addMeasurements(std::vector<FitMeasurement*>& measurements, + const FitParameters& parameters, + ParticleHypothesis particleHypothesis, + const DataVector<const TrackStateOnSurface>& trackStateOnSurfaces) const { // create vector of any TSOS'es which require fitted alignment corrections std::vector<Identifier> misAlignedTSOS; std::vector<int> misAlignmentNumbers; - int misAlignmentNumber = 0; - int tsos = 0; + int misAlignmentNumber = 0; + int tsos = 0; // BUG that shifts ... misAlignmentNumbers.push_back(misAlignmentNumber); for (DataVector<const TrackStateOnSurface>::const_iterator - r = trackStateOnSurfaces.begin(); - r != trackStateOnSurfaces.end(); - ++r, ++tsos) - { - if (! (**r).alignmentEffectsOnTrack() || ! (**r).trackParameters()) continue; - const AlignmentEffectsOnTrack& AEOT = *(**r).alignmentEffectsOnTrack(); - ++misAlignmentNumber; - for (std::vector<Identifier>::const_iterator - a = AEOT.vectorOfAffectedTSOS().begin(); - a != AEOT.vectorOfAffectedTSOS().end(); - ++a) - { - misAlignedTSOS.push_back(*a); - misAlignmentNumbers.push_back(misAlignmentNumber); - } - if (m_extendedDebug) ATH_MSG_DEBUG( " tsos " << tsos - << " misAlignedTSOS.size() " << misAlignedTSOS.size() - << " misAlignmentNumber " << misAlignmentNumber - << " offset " << AEOT.deltaTranslation() - << " +- " << AEOT.sigmaDeltaTranslation() - << " rotation " << AEOT.deltaAngle() - << " +- " << AEOT.sigmaDeltaAngle() ); + r = trackStateOnSurfaces.begin(); + r != trackStateOnSurfaces.end(); + ++r, ++tsos) { + if (!(**r).alignmentEffectsOnTrack() || !(**r).trackParameters()) continue; + const AlignmentEffectsOnTrack& AEOT = *(**r).alignmentEffectsOnTrack(); + ++misAlignmentNumber; + for (std::vector<Identifier>::const_iterator + a = AEOT.vectorOfAffectedTSOS().begin(); + a != AEOT.vectorOfAffectedTSOS().end(); + ++a) { + misAlignedTSOS.push_back(*a); + misAlignmentNumbers.push_back(misAlignmentNumber); + } + if (m_extendedDebug) ATH_MSG_DEBUG(" tsos " << tsos + << " misAlignedTSOS.size() " << misAlignedTSOS.size() + << " misAlignmentNumber " << misAlignmentNumber + << " offset " << AEOT.deltaTranslation() + << " +- " << AEOT.sigmaDeltaTranslation() + << " rotation " << AEOT.deltaAngle() + << " +- " << AEOT.sigmaDeltaAngle()); } - - // create ordered list of FitMeasurements - bool haveMaterial = false; - bool haveMeasurement = false; - int hit = measurements.size(); - double previousDistance = -m_orderingTolerance; - double previousDistanceR = -m_orderingTolerance; - double previousDistanceZ = -m_orderingTolerance; - bool reorder = false; - bool skipVertexMeasurement = measurements.size(); - Amg::Vector3D startDirection = parameters.direction(); - Amg::Vector3D startPosition = parameters.position(); - const TrackSurfaceIntersection* vertex = parameters.intersection(); - const TrackSurfaceIntersection* intersection = vertex; - bool measurementsFlipped = false; - double qOverP = parameters.qOverP(); - ExtrapolationType type = FittedTrajectory; - tsos = 0; + + // create ordered list of FitMeasurements + bool haveMaterial = false; + bool haveMeasurement = false; + int hit = measurements.size(); + double previousDistance = -m_orderingTolerance; + double previousDistanceR = -m_orderingTolerance; + double previousDistanceZ = -m_orderingTolerance; + bool reorder = false; + bool skipVertexMeasurement = measurements.size(); + Amg::Vector3D startDirection = parameters.direction(); + Amg::Vector3D startPosition = parameters.position(); + const TrackSurfaceIntersection* vertex = parameters.intersection(); + const TrackSurfaceIntersection* intersection = vertex; + bool measurementsFlipped = false; + double qOverP = parameters.qOverP(); + ExtrapolationType type = FittedTrajectory; + tsos = 0; for (DataVector<const TrackStateOnSurface>::const_iterator - s = trackStateOnSurfaces.begin(); - s != trackStateOnSurfaces.end(); - ++s, ++hit, ++tsos) - { - FitMeasurement* measurement1 = 0; - FitMeasurement* measurement2 = 0; - const Surface* surface = 0; - if ((**s).materialEffectsOnTrack() && (**s).trackParameters()) - { - Amg::Vector3D position = (**s).trackParameters()->position(); - bool calo = (! m_indetVolume->inside(position) - && m_calorimeterVolume->inside(position)); - qOverP = (**s).trackParameters()->parameters()[Trk::qOverP]; - surface = &(**s).trackParameters()->associatedSurface(); - - // skip negligibly thin scatterers (exception for CaloEnergy) - bool keepScatterer = true; - if ((**s).materialEffectsOnTrack()->thicknessInX0() < 0.0001) - { - keepScatterer = false; - if (calo) - { - const MaterialEffectsOnTrack* meot = - dynamic_cast<const MaterialEffectsOnTrack*>((**s).materialEffectsOnTrack()); - if (meot) - { - const EnergyLoss* energyLoss = meot->energyLoss(); - if (energyLoss && std::abs(energyLoss->deltaE()) > 0.1*Gaudi::Units::MeV) - keepScatterer = true; - } - } - } - if (keepScatterer) - { - measurement1 = new FitMeasurement((**s).materialEffectsOnTrack(), - ParticleMasses().mass[particleHypothesis], - position, - qOverP, - calo); - if (! calo - && ! haveMaterial - && (haveMeasurement || (**s).measurementOnTrack())) - haveMaterial = true; - } - } - else if ((**s).alignmentEffectsOnTrack() && (**s).trackParameters()) - { - Amg::Vector3D direction = (**s).trackParameters()->momentum().unit(); - Amg::Vector3D position = (**s).trackParameters()->position(); - measurement1 = new FitMeasurement((**s).alignmentEffectsOnTrack(), - direction, - position); - - } - if ((**s).measurementOnTrack()) - { - // option to skip vertex measurement (i.e. when not at front of list) - if (skipVertexMeasurement && dynamic_cast<const PerigeeSurface*>(&(**s).surface())) - { - delete measurement1; - continue; - } - haveMeasurement = true; - surface = &(**s).measurementOnTrack()->associatedSurface(); - measurement2 = new FitMeasurement(hit,0,(**s).measurementOnTrack()); - if ((**s).type(TrackStateOnSurface::Outlier)) measurement2->setOutlier(); - // redundant surely?? - // if (measurement2->isCluster() || measurement2->isDrift()) haveMeasurement = true; + s = trackStateOnSurfaces.begin(); + s != trackStateOnSurfaces.end(); + ++s, ++hit, ++tsos) { + FitMeasurement* measurement1 = 0; + FitMeasurement* measurement2 = 0; + const Surface* surface = 0; + if ((**s).materialEffectsOnTrack() && (**s).trackParameters()) { + Amg::Vector3D position = (**s).trackParameters()->position(); + bool calo = (!m_indetVolume->inside(position) + && m_calorimeterVolume->inside(position)); + qOverP = (**s).trackParameters()->parameters()[Trk::qOverP]; + surface = &(**s).trackParameters()->associatedSurface(); + + // skip negligibly thin scatterers (exception for CaloEnergy) + bool keepScatterer = true; + if ((**s).materialEffectsOnTrack()->thicknessInX0() < 0.0001) { + keepScatterer = false; + if (calo) { + const MaterialEffectsOnTrack* meot = + dynamic_cast<const MaterialEffectsOnTrack*>((**s).materialEffectsOnTrack()); + if (meot) { + const EnergyLoss* energyLoss = meot->energyLoss(); + if (energyLoss && std::abs(energyLoss->deltaE()) > 0.1 * Gaudi::Units::MeV) keepScatterer = true; + } + } + } + if (keepScatterer) { + measurement1 = new FitMeasurement((**s).materialEffectsOnTrack(), + ParticleMasses().mass[particleHypothesis], + position, + qOverP, + calo); + if (!calo + && !haveMaterial + && (haveMeasurement || (**s).measurementOnTrack())) haveMaterial = true; + } + } else if ((**s).alignmentEffectsOnTrack() && (**s).trackParameters()) { + Amg::Vector3D direction = (**s).trackParameters()->momentum().unit(); + Amg::Vector3D position = (**s).trackParameters()->position(); + measurement1 = new FitMeasurement((**s).alignmentEffectsOnTrack(), + direction, + position); + } + if ((**s).measurementOnTrack()) { + // option to skip vertex measurement (i.e. when not at front of list) + if (skipVertexMeasurement && dynamic_cast<const PerigeeSurface*>(&(**s).surface())) { + delete measurement1; + continue; + } + haveMeasurement = true; + surface = &(**s).measurementOnTrack()->associatedSurface(); + measurement2 = new FitMeasurement(hit, 0, (**s).measurementOnTrack()); + if ((**s).type(TrackStateOnSurface::Outlier)) measurement2->setOutlier(); + // redundant surely?? + // if (measurement2->isCluster() || measurement2->isDrift()) haveMeasurement = true; // if (misAlignmentNumber && misAlignedTSOS.back() == *s) // { // measurement2->alignmentParameter(misAlignmentNumber); @@ -857,608 +776,517 @@ iPatFitter::addMeasurements (std::vector<FitMeasurement*>& measurements, // misAlignmentNumber = misAlignmentNumbers.back(); // } // -// Peter +// Peter // measurement2->alignmentParameter(0); - if (misAlignmentNumber) - { - const Trk::MeasurementBase* meas = (**s).measurementOnTrack(); - Identifier id = Identifier(); - if(meas) { - const Trk::RIO_OnTrack* rot = dynamic_cast<const Trk::RIO_OnTrack*>(meas); - if(rot) { - id = rot->identify(); - } else { - const Muon::CompetingMuonClustersOnTrack* crot = dynamic_cast<const Muon::CompetingMuonClustersOnTrack*>(meas); - if(crot&&!crot->containedROTs().empty()&&crot->containedROTs().front()) { - id = crot->containedROTs().front()->identify(); - } - } - } - for (unsigned int im = 0; im < misAlignedTSOS.size(); ++im) - { - if (misAlignedTSOS[im] != id) continue; - measurement2->alignmentParameter(misAlignmentNumbers[im]); - } - if (m_extendedDebug) - { - for (unsigned int im = 0; im < misAlignedTSOS.size(); ++im) - { - if (misAlignedTSOS[im] != id) continue; - if (measurement2->isDrift()) - { - ATH_MSG_DEBUG( " tsos " << tsos - << " Drift Measurement im " << im - << " with misAlignmentNumber " << misAlignmentNumbers[im] ); - } - else - { - ATH_MSG_DEBUG( " tsos " << tsos - << " Cluster Measurement im " << im - << " with misAlignmentNumber " << misAlignmentNumbers[im] ); - } - } - } - } - } - else if (! measurement1 && (**s).trackParameters()) - { - if ((**s).type(TrackStateOnSurface::Hole)) - { - // ATH_MSG_VERBOSE( " addMeasurements: adding hole" ); - measurement2 = new FitMeasurement(**s); - } - else if ((**s).type(TrackStateOnSurface::Perigee)) - { - if (s == trackStateOnSurfaces.begin()) continue; - const Perigee* perigee = dynamic_cast<const Perigee*>((**s).trackParameters()); - if (! perigee) continue; - measurement2 = new FitMeasurement(*perigee); - } - else if ((**s).type(TrackStateOnSurface::Parameter)) - { - continue; - } - else - { - // TSOS type not understood. - m_messageHelper->printWarning(16, (**s).dumpType()); - continue; - } - } - else if ((**s).materialEffectsOnTrack()) - { - surface = &(**s).materialEffectsOnTrack()->associatedSurface(); - } - else if ((**s).alignmentEffectsOnTrack()) - { - surface = &(**s).alignmentEffectsOnTrack()->associatedSurface(); - } - else - { - // skip TSOS with missing trackParameters - // this should never happen (i.e. where's the surface?) - m_messageHelper->printWarning(17, (**s).dumpType()); - continue; - } - - // current intersection - if ((**s).trackParameters() && (measurement1 || measurement2)) - { - Amg::Vector3D direction = (**s).trackParameters()->momentum().unit(); - if (startDirection.dot(direction) < 0.) - { - measurementsFlipped = true; - direction = -direction; - if (measurement1) measurement1->flipDriftDirection(); - if (measurement2) measurement2->flipDriftDirection(); - } - qOverP = (**s).trackParameters()->parameters()[Trk::qOverP]; - intersection= new TrackSurfaceIntersection((**s).trackParameters()->position(), - direction, - 0.); - } - else if (surface) - { - const TrackSurfaceIntersection* newIntersection = m_useStepPropagator>=1? - m_stepPropagator->intersectSurface(*surface, - intersection, - qOverP, - m_stepField, - Trk::muon): - m_rungeKuttaIntersector->intersectSurface(*surface, - intersection, - qOverP); - if (m_useStepPropagator == 99 && newIntersection) - { - const TrackSurfaceIntersection* newIntersectionSTEP = - m_stepPropagator->intersectSurface(*surface, - intersection, - qOverP, - m_stepField, - Trk::muon); - if (newIntersectionSTEP) - { - // double dist = 1000.*(newIntersectionSTEP->position()-newIntersection->position()).mag(); - // std::cout << " iPat 2 distance STEP and Intersector " << dist << std::endl; - // if(dist>10.) std::cout << " iPat 2 ALARM distance STEP and Intersector " << dist << std::endl; - delete newIntersectionSTEP; - // } else { - // std::cout << " iPat 2 ALARM STEP did not intersect! " << std::endl; - } + if (misAlignmentNumber) { + const Trk::MeasurementBase* meas = (**s).measurementOnTrack(); + Identifier id = Identifier(); + if (meas) { + const Trk::RIO_OnTrack* rot = dynamic_cast<const Trk::RIO_OnTrack*>(meas); + if (rot) { + id = rot->identify(); + } else { + const Muon::CompetingMuonClustersOnTrack* crot = + dynamic_cast<const Muon::CompetingMuonClustersOnTrack*>(meas); + if (crot && !crot->containedROTs().empty() && crot->containedROTs().front()) { + id = crot->containedROTs().front()->identify(); + } } - - if (! newIntersection) - { - // addMeasurements: skip measurement as fail to intersect - // associated surface from given starting parameters - m_messageHelper->printWarning(18); - delete measurement2; - continue; - } - - if (newIntersection == intersection) - { - intersection = new TrackSurfaceIntersection(*intersection); - } - else - { - intersection = newIntersection; - } - if ((**s).materialEffectsOnTrack()) - { - Amg::Vector3D position = intersection->position(); - bool calo = (! m_indetVolume->inside(position) - && m_calorimeterVolume->inside(position)); - measurement1 = new FitMeasurement((**s).materialEffectsOnTrack(), - ParticleMasses().mass[particleHypothesis], - intersection->position(), - qOverP, - calo); - if (! calo - && ! haveMaterial - && haveMeasurement) - haveMaterial = true; - } - else if (! measurement2) - { - // TSOS skipped - m_messageHelper->printWarning(19, (**s).dumpType()); - // delete intersection; - continue; - } - } - - // check if ordering OK - if (! reorder) - { - double distance = startDirection.dot(intersection->position() - startPosition); - Amg::Vector3D positionMst = startPosition; - if ((**s).measurementOnTrack()) positionMst = (**s).measurementOnTrack()->globalPosition(); - if ((**s).materialEffectsOnTrack()) - positionMst = (**s).materialEffectsOnTrack()->associatedSurface().center(); - double distanceR = sqrt( - (positionMst.x() - startPosition.x())*(positionMst.x() - startPosition.x()) + - (positionMst.y() - startPosition.y())*(positionMst.y() - startPosition.y()) ); - double distanceZ = (positionMst.z() - startPosition.z()); - if (startDirection.z() < 0) distanceZ = -distanceZ; - if (distance < previousDistance - && distanceR < previousDistanceR - && distanceZ < previousDistanceZ) - { - reorder = true; - ATH_MSG_DEBUG( " reorder 3D distance " << distance - previousDistance - << " R distance " << distanceR - previousDistanceR - << " Z distance " << distanceZ - previousDistanceZ ); + } + for (unsigned int im = 0; im < misAlignedTSOS.size(); ++im) { + if (misAlignedTSOS[im] != id) continue; + measurement2->alignmentParameter(misAlignmentNumbers[im]); + } + if (m_extendedDebug) { + for (unsigned int im = 0; im < misAlignedTSOS.size(); ++im) { + if (misAlignedTSOS[im] != id) continue; + if (measurement2->isDrift()) { + ATH_MSG_DEBUG(" tsos " << tsos + << " Drift Measurement im " << im + << " with misAlignmentNumber " << misAlignmentNumbers[im]); + } else { + ATH_MSG_DEBUG(" tsos " << tsos + << " Cluster Measurement im " << im + << " with misAlignmentNumber " << misAlignmentNumbers[im]); + } } - previousDistance = distance - m_orderingTolerance; - previousDistanceR = distanceR - m_orderingTolerance; - previousDistanceZ = distanceZ - m_orderingTolerance; - } - - // insert measurement(s) in list - if (measurement1) - { - if (measurement2) - { - const TrackSurfaceIntersection* intersectionCopy = - new TrackSurfaceIntersection(*intersection); - - measurement1->intersection(type,intersectionCopy); - measurements.push_back(measurement1); - } - else - { - measurement1->intersection(type,intersection); - measurement1->qOverP(qOverP); - measurements.push_back(measurement1); - } - } - if (measurement2) - { - measurement2->intersection(type,intersection); - measurement2->qOverP(qOverP); - measurements.push_back(measurement2); - } + } + } + } else if (!measurement1 && (**s).trackParameters()) { + if ((**s).type(TrackStateOnSurface::Hole)) { + // ATH_MSG_VERBOSE( " addMeasurements: adding hole" ); + measurement2 = new FitMeasurement(**s); + } else if ((**s).type(TrackStateOnSurface::Perigee)) { + if (s == trackStateOnSurfaces.begin()) continue; + const Perigee* perigee = dynamic_cast<const Perigee*>((**s).trackParameters()); + if (!perigee) continue; + measurement2 = new FitMeasurement(*perigee); + } else if ((**s).type(TrackStateOnSurface::Parameter)) { + continue; + } else { + // TSOS type not understood. + m_messageHelper->printWarning(16, (**s).dumpType()); + continue; + } + } else if ((**s).materialEffectsOnTrack()) { + surface = &(**s).materialEffectsOnTrack()->associatedSurface(); + } else if ((**s).alignmentEffectsOnTrack()) { + surface = &(**s).alignmentEffectsOnTrack()->associatedSurface(); + } else { + // skip TSOS with missing trackParameters + // this should never happen (i.e. where's the surface?) + m_messageHelper->printWarning(17, (**s).dumpType()); + continue; + } + + // current intersection + if ((**s).trackParameters() && (measurement1 || measurement2)) { + Amg::Vector3D direction = (**s).trackParameters()->momentum().unit(); + if (startDirection.dot(direction) < 0.) { + measurementsFlipped = true; + direction = -direction; + if (measurement1) measurement1->flipDriftDirection(); + if (measurement2) measurement2->flipDriftDirection(); + } + qOverP = (**s).trackParameters()->parameters()[Trk::qOverP]; + intersection = new TrackSurfaceIntersection((**s).trackParameters()->position(), + direction, + 0.); + } else if (surface) { + const TrackSurfaceIntersection* newIntersection = m_useStepPropagator >= 1 ? + m_stepPropagator->intersectSurface(*surface, + intersection, + qOverP, + m_stepField, + Trk::muon) : + m_rungeKuttaIntersector->intersectSurface(*surface, + intersection, + qOverP); + if (m_useStepPropagator == 99 && newIntersection) { + const TrackSurfaceIntersection* newIntersectionSTEP = + m_stepPropagator->intersectSurface(*surface, + intersection, + qOverP, + m_stepField, + Trk::muon); + if (newIntersectionSTEP) { + // double dist = 1000.*(newIntersectionSTEP->position()-newIntersection->position()).mag(); + // std::cout << " iPat 2 distance STEP and Intersector " << dist << std::endl; + // if(dist>10.) std::cout << " iPat 2 ALARM distance STEP and Intersector " << dist << + // std::endl; + delete newIntersectionSTEP; + // } else { + // std::cout << " iPat 2 ALARM STEP did not intersect! " << std::endl; + } + } + + if (!newIntersection) { + // addMeasurements: skip measurement as fail to intersect + // associated surface from given starting parameters + m_messageHelper->printWarning(18); + delete measurement2; + continue; + } + + if (newIntersection == intersection) { + intersection = new TrackSurfaceIntersection(*intersection); + } else { + intersection = newIntersection; + } + if ((**s).materialEffectsOnTrack()) { + Amg::Vector3D position = intersection->position(); + bool calo = (!m_indetVolume->inside(position) + && m_calorimeterVolume->inside(position)); + measurement1 = new FitMeasurement((**s).materialEffectsOnTrack(), + ParticleMasses().mass[particleHypothesis], + intersection->position(), + qOverP, + calo); + if (!calo + && !haveMaterial + && haveMeasurement) haveMaterial = true; + } else if (!measurement2) { + // TSOS skipped + m_messageHelper->printWarning(19, (**s).dumpType()); + // delete intersection; + continue; + } + } + + // check if ordering OK + if (!reorder) { + double distance = startDirection.dot(intersection->position() - startPosition); + Amg::Vector3D positionMst = startPosition; + if ((**s).measurementOnTrack()) positionMst = (**s).measurementOnTrack()->globalPosition(); + if ((**s).materialEffectsOnTrack()) positionMst = (**s).materialEffectsOnTrack()->associatedSurface().center(); + double distanceR = sqrt( + (positionMst.x() - startPosition.x()) * (positionMst.x() - startPosition.x()) + + (positionMst.y() - startPosition.y()) * (positionMst.y() - startPosition.y())); + double distanceZ = (positionMst.z() - startPosition.z()); + if (startDirection.z() < 0) distanceZ = -distanceZ; + if (distance < previousDistance + && distanceR < previousDistanceR + && distanceZ < previousDistanceZ) { + reorder = true; + ATH_MSG_DEBUG(" reorder 3D distance " << distance - previousDistance + << " R distance " << distanceR - previousDistanceR + << " Z distance " << distanceZ - previousDistanceZ); + } + previousDistance = distance - m_orderingTolerance; + previousDistanceR = distanceR - m_orderingTolerance; + previousDistanceZ = distanceZ - m_orderingTolerance; + } + + // insert measurement(s) in list + if (measurement1) { + if (measurement2) { + const TrackSurfaceIntersection* intersectionCopy = + new TrackSurfaceIntersection(*intersection); + + measurement1->intersection(type, intersectionCopy); + measurements.push_back(measurement1); + } else { + measurement1->intersection(type, intersection); + measurement1->qOverP(qOverP); + measurements.push_back(measurement1); + } + } + if (measurement2) { + measurement2->intersection(type, intersection); + measurement2->qOverP(qOverP); + measurements.push_back(measurement2); + } } // reorder if necessary - if (reorder) m_materialAllocator->orderMeasurements(measurements,startDirection,startPosition); - if (measurementsFlipped) - { - m_messageHelper->printWarning(25); + if (reorder) m_materialAllocator->orderMeasurements(measurements, startDirection, startPosition); + if (measurementsFlipped) { + m_messageHelper->printWarning(25); } - + // flag whether material has already been allocated delete vertex; return haveMaterial; -} + } -std::vector<FitMeasurement*>*& -iPatFitter::measurementList (void) const -{ - if (m_globalFit && m_measurements) - { - for (auto m : *m_measurements) - { - delete m; - } - m_measurements->clear(); - } - else - { - m_measurements = new std::vector<FitMeasurement*>; + std::vector<FitMeasurement*>*& + iPatFitter::measurementList(void) const { + if (m_globalFit && m_measurements) { + for (auto m : *m_measurements) { + delete m; + } + m_measurements->clear(); + } else { + m_measurements = new std::vector<FitMeasurement*>; } return m_measurements; -} - -Track* -iPatFitter::performFit(std::vector<FitMeasurement*>* measurements, - FitParameters* parameters, - const ParticleHypothesis particleHypothesis, - const TrackInfo& trackInfo, - const DataVector<const TrackStateOnSurface>* leadingTSOS, - const FitQuality* perigeeQuality) const -{ + } + + Track* + iPatFitter::performFit(std::vector<FitMeasurement*>* measurements, + FitParameters* parameters, + const ParticleHypothesis particleHypothesis, + const TrackInfo& trackInfo, + const DataVector<const TrackStateOnSurface>* leadingTSOS, + const FitQuality* perigeeQuality) const { // initialize the scattering centres m_materialAllocator->initializeScattering(*measurements); - + // set fixed momentum in lineFit case according to configuration - if (m_lineFit) - { - parameters->fitMomentum(false); - if (m_lineMomentum > 0.) parameters->qOverP(1./m_lineMomentum); + if (m_lineFit) { + parameters->fitMomentum(false); + if (m_lineMomentum > 0.) parameters->qOverP(1. / m_lineMomentum); } - + // perform fit MsgStream log(msgSvc(), name()); - const FitProcedureQuality& quality = m_fitProcedure->execute(m_asymmetricCaloEnergy, - log, - *measurements, - parameters, - perigeeQuality); - Track* fittedTrack = 0; - if (! quality.fitCode()) - { -// // iterate if material reallocation needed -// if (m_materialAllocator->reallocateMaterial(*measurements,parameters)) -// { -// // do something -// quality = m_fitProcedure->execute(log, -// *measurements, -// parameters, -// perigeeQuality); -// } - - // include leading material - m_materialAllocator->addLeadingMaterial(*measurements,particleHypothesis,*parameters); - - - // construct the fitted track - fittedTrack = m_fitProcedure->constructTrack(*measurements, - *parameters, - trackInfo, - leadingTSOS); - if (fittedTrack) - { - // set StraightLine when momentum unfitted - if (! parameters->fitMomentum()) - fittedTrack->info().setTrackProperties(TrackInfo::StraightTrack); - - // special check for CaloDeposit - parameters must be inside calorimeter - for (DataVector<const TrackStateOnSurface>::const_iterator - s = fittedTrack->trackStateOnSurfaces()->begin(); - s != fittedTrack->trackStateOnSurfaces()->end(); - ++s) - { - if (! (**s).type(TrackStateOnSurface::CaloDeposit)) continue; - if ((**s).trackParameters()) - { - Amg::Vector3D position = (**s).trackParameters()->position(); - if (! m_indetVolume->inside(position) - && m_calorimeterVolume->inside(position)) break; - } - - // something badly wrong: WARN and kill track - // fail fit as CaloDeposit outside calo volume - m_messageHelper->printWarning(20); - delete fittedTrack; - fittedTrack = 0; - break; - } - } - - // statistics for successful fit - if (fittedTrack) - { - ++m_countGoodFits; - m_countIterations += quality.iterations(); - m_iterations = quality.iterations(); - - // report material - if (msgLvl(MSG::DEBUG)) - { - int calo = 0; - double caloX0 = 0.; - double caloEloss = 0.; - int indet = 0; - double indetX0 = 0.; - double indetEloss = 0.; - int spect = 0; - double spectX0 = 0.; - double spectEloss = 0.; - for (auto m : *measurements) - { - if (m->isEnergyDeposit()) - { - ++calo; - caloEloss += m->energyLoss(); - } - else if (! m->isScatterer()) - { - continue; - } - - if (m_indetVolume->inside(m->position())) - { - ++indet; - indetX0 += m->materialEffects()->thicknessInX0(); - indetEloss += m->energyLoss(); - // conflicting energy deposit sign for inDet material - if (m->energyLoss()*indetEloss < 0.) m_messageHelper->printWarning(21); - continue; - } - else if (m_calorimeterVolume->inside( - m->intersection(FittedTrajectory).position())) - { - ++calo; - caloX0 += m->materialEffects()->thicknessInX0(); - continue; - } - - ++spect; - spectX0 += m->materialEffects()->thicknessInX0(); - spectEloss += m->energyLoss(); - // conflicting energy deposit sign for spectrometer material - if (m->energyLoss()*spectEloss < 0.) m_messageHelper->printWarning(22); - } - - // WARN in case of bug #56297 - if (calo) - { - // excessive calorimeter energy loss - if (std::abs(caloEloss) > 200.*Gaudi::Units::GeV - && m_messageHelper->wouldPrintWarning(23)) - { - std::stringstream ss; - ss << caloEloss/Gaudi::Units::GeV << " for track with P " - << fittedTrack->perigeeParameters()->momentum().mag()/Gaudi::Units::GeV - << " GeV" ; - m_messageHelper->printWarning(23, ss.str()); - } - - // excessive spectrometer energy loss - if (std::abs(spectEloss) > 0.5*Gaudi::Units::GeV - && std::abs(spectEloss*caloX0) > std::abs(4.*caloEloss*spectX0) - && m_messageHelper->wouldPrintWarning(24)) - { - std::stringstream ss; - ss << spectEloss/Gaudi::Units::GeV - << " ( " << caloEloss/Gaudi::Units::GeV - << " calorimeter energy loss). Track has P " - << fittedTrack->perigeeParameters()->momentum().mag()/Gaudi::Units::GeV - << " GeV" ; - m_messageHelper->printWarning(24, ss.str()); - } - } - - msg(MSG::VERBOSE) << std::setiosflags(std::ios::fixed); - if (indet) - { - msg() << std::setw(5) << indet << " indet scatterers with" - << " material: X0" << std::setw(6) << std::setprecision(3) << indetX0; - if (calo && caloEloss < 0.) - { - msg() << " energyGain"; - } - else - { - msg() << " energyLoss"; - } - msg() << std::setw(6) << std::setprecision(3) << indetEloss/Gaudi::Units::GeV << ","; - } - - if (spect) - { - msg() << std::setw(5) << spect << " spectrometer scatterers with" - << " material: X0" << std::setw(8) << std::setprecision(3) << spectX0; - if (calo && caloEloss < 0.) - { - msg() << " energyGain"; - } - else - { - msg() << " energyLoss"; - } - msg() << std::setw(7) << std::setprecision(3) << spectEloss/Gaudi::Units::GeV; - } - - if (! indet && ! spect) msg() << " 0 scatterers - no tracking material"; - msg() << endmsg; - } - } + const FitProcedureQuality& quality = m_fitProcedure->execute(m_asymmetricCaloEnergy, + log, + *measurements, + parameters, + perigeeQuality); + Track* fittedTrack = 0; + if (!quality.fitCode()) { +// // iterate if material reallocation needed +// if (m_materialAllocator->reallocateMaterial(*measurements,parameters)) +// { +// // do something +// quality = m_fitProcedure->execute(log, +// *measurements, +// parameters, +// perigeeQuality); +// } + + // include leading material + m_materialAllocator->addLeadingMaterial(*measurements, particleHypothesis, *parameters); + + + // construct the fitted track + fittedTrack = m_fitProcedure->constructTrack(*measurements, + *parameters, + trackInfo, + leadingTSOS); + if (fittedTrack) { + // set StraightLine when momentum unfitted + if (!parameters->fitMomentum()) fittedTrack->info().setTrackProperties(TrackInfo::StraightTrack); + + // special check for CaloDeposit - parameters must be inside calorimeter + for (DataVector<const TrackStateOnSurface>::const_iterator + s = fittedTrack->trackStateOnSurfaces()->begin(); + s != fittedTrack->trackStateOnSurfaces()->end(); + ++s) { + if (!(**s).type(TrackStateOnSurface::CaloDeposit)) continue; + if ((**s).trackParameters()) { + Amg::Vector3D position = (**s).trackParameters()->position(); + if (!m_indetVolume->inside(position) + && m_calorimeterVolume->inside(position)) break; + } + + // something badly wrong: WARN and kill track + // fail fit as CaloDeposit outside calo volume + m_messageHelper->printWarning(20); + delete fittedTrack; + fittedTrack = 0; + break; + } + } + + // statistics for successful fit + if (fittedTrack) { + ++m_countGoodFits; + m_countIterations += quality.iterations(); + m_iterations = quality.iterations(); + + // report material + if (msgLvl(MSG::DEBUG)) { + int calo = 0; + double caloX0 = 0.; + double caloEloss = 0.; + int indet = 0; + double indetX0 = 0.; + double indetEloss = 0.; + int spect = 0; + double spectX0 = 0.; + double spectEloss = 0.; + for (auto m : *measurements) { + if (m->isEnergyDeposit()) { + ++calo; + caloEloss += m->energyLoss(); + } else if (!m->isScatterer()) { + continue; + } + + if (m_indetVolume->inside(m->position())) { + ++indet; + indetX0 += m->materialEffects()->thicknessInX0(); + indetEloss += m->energyLoss(); + // conflicting energy deposit sign for inDet material + if (m->energyLoss() * indetEloss < 0.) m_messageHelper->printWarning(21); + continue; + } else if (m_calorimeterVolume->inside( + m->intersection(FittedTrajectory).position())) { + ++calo; + caloX0 += m->materialEffects()->thicknessInX0(); + continue; + } + + ++spect; + spectX0 += m->materialEffects()->thicknessInX0(); + spectEloss += m->energyLoss(); + // conflicting energy deposit sign for spectrometer material + if (m->energyLoss() * spectEloss < 0.) m_messageHelper->printWarning(22); + } + + // WARN in case of bug #56297 + if (calo) { + // excessive calorimeter energy loss + if (std::abs(caloEloss) > 200. * Gaudi::Units::GeV + && m_messageHelper->wouldPrintWarning(23)) { + std::stringstream ss; + ss << caloEloss / Gaudi::Units::GeV << " for track with P " + << fittedTrack->perigeeParameters()->momentum().mag() / Gaudi::Units::GeV + << " GeV"; + m_messageHelper->printWarning(23, ss.str()); + } + + // excessive spectrometer energy loss + if (std::abs(spectEloss) > 0.5 * Gaudi::Units::GeV + && std::abs(spectEloss * caloX0) > std::abs(4. * caloEloss * spectX0) + && m_messageHelper->wouldPrintWarning(24)) { + std::stringstream ss; + ss << spectEloss / Gaudi::Units::GeV + << " ( " << caloEloss / Gaudi::Units::GeV + << " calorimeter energy loss). Track has P " + << fittedTrack->perigeeParameters()->momentum().mag() / Gaudi::Units::GeV + << " GeV"; + m_messageHelper->printWarning(24, ss.str()); + } + } + + msg(MSG::VERBOSE) << std::setiosflags(std::ios::fixed); + if (indet) { + msg() << std::setw(5) << indet << " indet scatterers with" + << " material: X0" << std::setw(6) << std::setprecision(3) << indetX0; + if (calo && caloEloss < 0.) { + msg() << " energyGain"; + } else { + msg() << " energyLoss"; + } + msg() << std::setw(6) << std::setprecision(3) << indetEloss / Gaudi::Units::GeV << ","; + } + + if (spect) { + msg() << std::setw(5) << spect << " spectrometer scatterers with" + << " material: X0" << std::setw(8) << std::setprecision(3) << spectX0; + if (calo && caloEloss < 0.) { + msg() << " energyGain"; + } else { + msg() << " energyLoss"; + } + msg() << std::setw(7) << std::setprecision(3) << spectEloss / Gaudi::Units::GeV; + } + + if (!indet && !spect) msg() << " 0 scatterers - no tracking material"; + msg() << endmsg; + } + } } - + // clean up and return - if (! m_globalFit || ! fittedTrack) - { - for (auto m: *m_measurements) - { - delete m; - } - measurements->clear(); - delete measurements; - delete parameters; - m_measurements = 0; - m_parameters = 0; + if (!m_globalFit || !fittedTrack) { + for (auto m: *m_measurements) { + delete m; + } + measurements->clear(); + delete measurements; + delete parameters; + m_measurements = 0; + m_parameters = 0; } m_materialAllocator->clear(); return fittedTrack; -} + } -void -iPatFitter::printTSOS (const Track& track) const -{ + void + iPatFitter::printTSOS(const Track& track) const { // debugging aid MsgStream log(msgSvc(), name()); + msg(MSG::INFO) << " track with " << track.trackStateOnSurfaces()->size() << " TSOS " << endmsg; int tsos = 0; for (DataVector<const TrackStateOnSurface>::const_iterator t = track.trackStateOnSurfaces()->begin(); - t != track.trackStateOnSurfaces()->end(); - ++t, ++tsos) - { - msg() << std::setiosflags(std::ios::fixed|std::ios::right) - << " TSOS# " << std::setw(3) << tsos - << " parameters: " - << std::setw(7) << std::setprecision(1) - << (**t).trackParameters()->position().perp() - << std::setw(8) << std::setprecision(4) - << (**t).trackParameters()->position().phi() - << std::setw(9) << std::setprecision(1) - << (**t).trackParameters()->position().z() - << " position " - << std::setw(8) << std::setprecision(4) - << (**t).trackParameters()->momentum().phi() - << " phi " - << std::setw(7) << std::setprecision(4) - << (**t).trackParameters()->momentum().theta() - << " theta " - << std::setw(9) << std::setprecision(4) - << (**t).trackParameters()->momentum().mag()/Gaudi::Units::GeV << " GeV"; - - if ((**t).measurementOnTrack()) - { - msg() << " meas "; - } - else - { - msg() << " "; - } - if ((**t).materialEffectsOnTrack()) - { - msg() << " scat "; - } - else - { - msg() << " "; - } - msg() << (**t).dumpType() << endmsg; + t != track.trackStateOnSurfaces()->end(); + ++t, ++tsos) { + msg() << std::setiosflags(std::ios::fixed | std::ios::right) + << " TSOS# " << std::setw(3) << tsos + << " parameters: " + << std::setw(7) << std::setprecision(1) + << (**t).trackParameters()->position().perp() + << std::setw(8) << std::setprecision(4) + << (**t).trackParameters()->position().phi() + << std::setw(9) << std::setprecision(1) + << (**t).trackParameters()->position().z() + << " position " + << std::setw(8) << std::setprecision(4) + << (**t).trackParameters()->momentum().phi() + << " phi " + << std::setw(7) << std::setprecision(4) + << (**t).trackParameters()->momentum().theta() + << " theta " + << std::setw(9) << std::setprecision(4) + << (**t).trackParameters()->momentum().mag() / Gaudi::Units::GeV << " GeV"; + + if ((**t).measurementOnTrack()) { + msg() << " meas "; + } else { + msg() << " "; + } + if ((**t).materialEffectsOnTrack()) { + msg() << " scat "; + } else { + msg() << " "; + } + msg() << (**t).dumpType() << endmsg; } -} - -void -iPatFitter::refit(const Track& track, - const RunOutlierRemoval runOutlier, - const ParticleHypothesis particleHypothesis) const -{ - ATH_MSG_VERBOSE( " refit " ); - unsigned countGoodFits = m_countGoodFits; - unsigned countIterations = m_countIterations; + } + + void + iPatFitter::refit(const Track& track, + const RunOutlierRemoval runOutlier, + const ParticleHypothesis particleHypothesis) const { + ATH_MSG_VERBOSE(" refit "); + unsigned countGoodFits = m_countGoodFits; + unsigned countIterations = m_countIterations; ++m_countRefitAttempts; // outlier removal not implemented - if (runOutlier) m_messageHelper->printWarning(0); + if (runOutlier) m_messageHelper->printWarning(0); // create Perigee if starting parameters are for a different surface type - const Perigee* perigee = track.perigeeParameters(); - PerigeeSurface* perigeeSurface = 0; - if (! perigee) - { - DataVector<const TrackStateOnSurface>::const_iterator s = track.trackStateOnSurfaces()->begin(); - while (s != track.trackStateOnSurfaces()->end() && ! (**s).trackParameters()) ++s; - if (! (**s).trackParameters()) - { - // input track without parameters - m_messageHelper->printWarning(1); - m_countGoodRefits += m_countGoodFits - countGoodFits; - m_countGoodFits = countGoodFits; - m_countRefitIterations += m_countIterations - countIterations; - m_countIterations = countIterations; - return; - } - - Amg::Vector3D origin((**s).trackParameters()->position()); - perigeeSurface = new PerigeeSurface(origin); - perigee = new Perigee((**s).trackParameters()->position(), - (**s).trackParameters()->momentum(), - (**s).trackParameters()->charge(), - *perigeeSurface); + const Perigee* perigee = track.perigeeParameters(); + PerigeeSurface* perigeeSurface = 0; + if (!perigee) { + DataVector<const TrackStateOnSurface>::const_iterator s = track.trackStateOnSurfaces()->begin(); + while (s != track.trackStateOnSurfaces()->end() && !(**s).trackParameters()) ++s; + if (!(**s).trackParameters()) { + // input track without parameters + m_messageHelper->printWarning(1); + m_countGoodRefits += m_countGoodFits - countGoodFits; + m_countGoodFits = countGoodFits; + m_countRefitIterations += m_countIterations - countIterations; + m_countIterations = countIterations; + return; + } + + Amg::Vector3D origin((**s).trackParameters()->position()); + perigeeSurface = new PerigeeSurface(origin); + perigee = new Perigee((**s).trackParameters()->position(), + (**s).trackParameters()->momentum(), + (**s).trackParameters()->charge(), + *perigeeSurface); } delete m_parameters; - m_parameters = new FitParameters(*perigee); - + m_parameters = new FitParameters(*perigee); + // set up the measurements - if (! track.trackStateOnSurfaces()) - { - // input track without trackStateOnSurfaces - m_messageHelper->printWarning(2); - m_countGoodRefits += m_countGoodFits - countGoodFits; - m_countGoodFits = countGoodFits; - m_countRefitIterations += m_countIterations - countIterations; - m_countIterations = countIterations; - return; + if (!track.trackStateOnSurfaces()) { + // input track without trackStateOnSurfaces + m_messageHelper->printWarning(2); + m_countGoodRefits += m_countGoodFits - countGoodFits; + m_countGoodFits = countGoodFits; + m_countRefitIterations += m_countIterations - countIterations; + m_countIterations = countIterations; + return; } - + std::vector<FitMeasurement*>* measurements = measurementList(); bool haveMaterial = addMeasurements(*measurements, - *m_parameters, - particleHypothesis, - *track.trackStateOnSurfaces()); + *m_parameters, + particleHypothesis, + *track.trackStateOnSurfaces()); // allocate material - if (! haveMaterial && particleHypothesis != Trk::nonInteracting) - { - m_materialAllocator->allocateMaterial(*measurements, - particleHypothesis, - *m_parameters, - *perigee); + if (!haveMaterial && particleHypothesis != Trk::nonInteracting) { + m_materialAllocator->allocateMaterial(*measurements, + particleHypothesis, + *m_parameters, + *perigee); } // perform fit and return fitted track - TrackInfo trackInfo(TrackInfo::iPatTrackFitter,particleHypothesis); + TrackInfo trackInfo(TrackInfo::iPatTrackFitter, particleHypothesis); trackInfo.addPatternReco(track.info()); Trk::Track* fittedTrack = performFit(measurements, m_parameters, particleHypothesis, trackInfo); - if (perigeeSurface) - { - delete perigeeSurface; - delete perigee; + if (perigeeSurface) { + delete perigeeSurface; + delete perigee; } - m_countGoodRefits += m_countGoodFits - countGoodFits; - m_countGoodFits = countGoodFits; - m_countRefitIterations += m_countIterations - countIterations; - m_countIterations = countIterations; - delete fittedTrack; -} - + m_countGoodRefits += m_countGoodFits - countGoodFits; + m_countGoodFits = countGoodFits; + m_countRefitIterations += m_countIterations - countIterations; + m_countIterations = countIterations; + delete fittedTrack; + } } // end of namespace diff --git a/Tracking/TrkFitter/TrkiPatFitter/src/iPatGlobalFitter.cxx b/Tracking/TrkFitter/TrkiPatFitter/src/iPatGlobalFitter.cxx index ece214fac7f5330f467991ebf0f3c3a19a9d1838..5c238a3ebdc81315f9024e6dffea8d5ca8f7055e 100755 --- a/Tracking/TrkFitter/TrkiPatFitter/src/iPatGlobalFitter.cxx +++ b/Tracking/TrkFitter/TrkiPatFitter/src/iPatGlobalFitter.cxx @@ -1,10 +1,10 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration -*/ + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + */ ////////////////////////////////////////////////////////////////// // iPatGlobalFitter.cxx -// access full derivative and covariance matrices +// access full derivative and covariance matrices // // (c) ATLAS Detector software /////////////////////////////////////////////////////////////////// @@ -18,106 +18,123 @@ #include "TrkiPatFitter/iPatGlobalFitter.h" namespace Trk -{ - -iPatGlobalFitter::iPatGlobalFitter (const std::string& type, - const std::string& name, - const IInterface* parent) - : iPatFitter (type, name, parent), - m_allParameters (false), - m_derivativeMatrix (0) { + iPatGlobalFitter::iPatGlobalFitter (const std::string& type, + const std::string& name, + const IInterface* parent) + : iPatFitter(type, name, parent), + m_allParameters(false), + m_derivativeMatrix(0) { declareInterface<IGlobalTrackFitter>(this); - declareProperty("AllParameters", m_allParameters); - m_globalFit = true; -} + declareProperty("AllParameters", m_allParameters); + m_globalFit = true; + } -iPatGlobalFitter::~iPatGlobalFitter (void) -{ + iPatGlobalFitter::~iPatGlobalFitter (void) { delete m_derivativeMatrix; -} + } -Amg::MatrixX* -iPatGlobalFitter::DerivMatrix() const -{ + Track* iPatGlobalFitter::alignmentFit ( AlignmentCache& alignCache, + const Track& trk, + const RunOutlierRemoval runOutlier, + const ParticleHypothesis matEffects) const + { + // @TODO ensure the number of iterations is passed through to the fitter + //setMinIterations (alignCache.m_minIterations); + if(alignCache.m_derivMatrix != nullptr) + delete alignCache.m_derivMatrix; + alignCache.m_derivMatrix = nullptr; + + if(alignCache.m_fullCovarianceMatrix != nullptr) + delete alignCache.m_fullCovarianceMatrix; + alignCache.m_fullCovarianceMatrix = nullptr; + alignCache.m_iterationsOfLastFit = 0; + + Trk::Track* refittedTrack = fit( trk, runOutlier, matEffects ); + + if(refittedTrack){ + alignCache.m_derivMatrix = DerivMatrix(); + alignCache.m_fullCovarianceMatrix = FullCovarianceMatrix(); + alignCache.m_iterationsOfLastFit = iterationsOfLastFit(); + } + return refittedTrack; + } + + + Amg::MatrixX* + iPatGlobalFitter::DerivMatrix() const { // copy derivatives to a new HepMatrix delete m_derivativeMatrix; - m_derivativeMatrix = 0; - if (! m_measurements || ! m_parameters) return 0; - - int numberParameters = 5; + m_derivativeMatrix = 0; + if (!m_measurements || !m_parameters) return 0; + + int numberParameters = 5; if (m_allParameters) numberParameters = m_parameters->numberParameters(); - int rows = 0; + int rows = 0; for (std::vector<FitMeasurement*>::iterator m = m_measurements->begin(); m != m_measurements->end(); - ++m) - { - if (! (**m).isPositionMeasurement()) continue; - rows += (**m).numberDoF(); + ++m) { + if (!(**m).isPositionMeasurement()) continue; + rows += (**m).numberDoF(); } - - if (! numberParameters || ! rows) return 0; - - ATH_MSG_VERBOSE ( " DerivMatrix : " << m_measurements->size() << " measurement objects giving " - << rows << " rows and " << numberParameters << " columns (parameters)" ); - - m_derivativeMatrix = new Amg::MatrixX(rows,numberParameters); - int row = 0; + + if (!numberParameters || !rows) return 0; + + ATH_MSG_VERBOSE(" DerivMatrix : " << m_measurements->size() << " measurement objects giving " + << rows << " rows and " << numberParameters << " columns (parameters)"); + + m_derivativeMatrix = new Amg::MatrixX(rows, numberParameters); + int row = 0; for (std::vector<FitMeasurement*>::iterator m = m_measurements->begin(); m != m_measurements->end(); - ++m) - { - if (! (**m).numberDoF() || ! (**m).isPositionMeasurement()) continue; - double norm = 0.; - if ((**m).weight() > 0.) norm = 1./(**m).weight(); - - for (int col = 0; col < numberParameters; ++col) - { - (*m_derivativeMatrix)(row,col) = norm*(**m).derivative(col); - } - - // take care of units for momentum derivs - (*m_derivativeMatrix)(row,4) *= Gaudi::Units::TeV; - if (m_parameters->fitEnergyDeposit()) (*m_derivativeMatrix)(row,5) *= Gaudi::Units::TeV; - ++row; - if ((**m).numberDoF() < 2) continue; - - // pixel measurements - norm = 0.; - if ((**m).weight2() > 0.) norm = 1./(**m).weight2(); - for (int col = 0; col < numberParameters; ++col) - { - (*m_derivativeMatrix)(row,col) = norm*(**m).derivative2(col); - } - (*m_derivativeMatrix)(row,4) *= Gaudi::Units::TeV; - if (m_parameters->fitEnergyDeposit()) (*m_derivativeMatrix)(row,5) *= Gaudi::Units::TeV; - ++row; + ++m) { + if (!(**m).numberDoF() || !(**m).isPositionMeasurement()) continue; + double norm = 0.; + if ((**m).weight() > 0.) norm = 1. / (**m).weight(); + + for (int col = 0; col < numberParameters; ++col) { + (*m_derivativeMatrix)(row, col) = norm * (**m).derivative(col); + } + + // take care of units for momentum derivs + (*m_derivativeMatrix)(row, 4) *= Gaudi::Units::TeV; + if (m_parameters->fitEnergyDeposit()) (*m_derivativeMatrix)(row, 5) *= Gaudi::Units::TeV; + ++row; + if ((**m).numberDoF() < 2) continue; + + // pixel measurements + norm = 0.; + if ((**m).weight2() > 0.) norm = 1. / (**m).weight2(); + for (int col = 0; col < numberParameters; ++col) { + (*m_derivativeMatrix)(row, col) = norm * (**m).derivative2(col); + } + (*m_derivativeMatrix)(row, 4) *= Gaudi::Units::TeV; + if (m_parameters->fitEnergyDeposit()) (*m_derivativeMatrix)(row, 5) *= Gaudi::Units::TeV; + ++row; } - if (row != rows) ATH_MSG_WARNING( "iPatGlobalFitter: inconsistent #rows in deriv matrix " ); + if (row != rows) ATH_MSG_WARNING("iPatGlobalFitter: inconsistent #rows in deriv matrix "); return m_derivativeMatrix; -} - -Amg::MatrixX* -iPatGlobalFitter::FullCovarianceMatrix() const -{ - int numberParameters = 5; + } + + Amg::MatrixX* + iPatGlobalFitter::FullCovarianceMatrix() const { + int numberParameters = 5; + if (m_allParameters) numberParameters = m_parameters->numberParameters(); - ATH_MSG_VERBOSE ( " FullCovarianceMatrix for " << numberParameters << " parameters" ); + ATH_MSG_VERBOSE(" FullCovarianceMatrix for " << numberParameters << " parameters"); - return new Amg::MatrixX(m_fitProcedure->fullCovariance()->block(0,0,numberParameters,numberParameters)); -} + return new Amg::MatrixX(m_fitProcedure->fullCovariance()->block(0, 0, numberParameters, numberParameters)); + } -int -iPatGlobalFitter::iterationsOfLastFit() const -{ return m_iterations; } + int + iPatGlobalFitter::iterationsOfLastFit() const + {return m_iterations;} - -void -iPatGlobalFitter::setMinIterations(int minIterations) -{ + + void + iPatGlobalFitter::setMinIterations(int minIterations) { m_fitProcedure->setMinIterations(minIterations); -} - + } } // end of namespace diff --git a/Tracking/TrkTools/TrkMaterialProvider/src/TrkMaterialProviderTool.cxx b/Tracking/TrkTools/TrkMaterialProvider/src/TrkMaterialProviderTool.cxx index 1ee01f7f3fada8cf8d0a5b8f4500df7d2b6b9c73..8b4616f2af1b5567e6b2f55202d5808f1fc13439 100644 --- a/Tracking/TrkTools/TrkMaterialProvider/src/TrkMaterialProviderTool.cxx +++ b/Tracking/TrkTools/TrkMaterialProvider/src/TrkMaterialProviderTool.cxx @@ -34,21 +34,25 @@ // for line-by-line debugging #define MYDEBUG() std::cout<<__FILE__<<" "<<__func__<<" "<<__LINE__<<std::endl -void myLocal_resetTrack( const Trk::Track& ctrack ){ - - Trk::Track& track = const_cast<Trk::Track&>(ctrack); - if( track.m_cachedParameterVector ){ - delete track.m_cachedParameterVector; - track.m_cachedParameterVector = 0; +void myLocal_resetTrack(Trk::Track& track ){ + + /* C.A this is kind of weird piece of code + * Actually the issue starts from the + * define private public in the header + * then somehow this helpers can access the + * guts of a Trk::Track + * Needs understanding of client and usage + */ + if( track.m_cachedParameterVector.isValid() ){ + track.m_cachedParameterVector.reset(); } - if( track.m_cachedMeasurementVector ){ - delete track.m_cachedMeasurementVector; - track.m_cachedMeasurementVector = 0; + if( track.m_cachedMeasurementVector.isValid() ){ + track.m_cachedMeasurementVector.reset(); + } - if( track.m_cachedOutlierVector ){ - delete track.m_cachedOutlierVector; - track.m_cachedOutlierVector = 0; + if( track.m_cachedOutlierVector.isValid() ){ + track.m_cachedOutlierVector.reset(); } } diff --git a/Trigger/TrigAlgorithms/TrigCaloRec/python/TrigCaloRecConfig.py b/Trigger/TrigAlgorithms/TrigCaloRec/python/TrigCaloRecConfig.py index 113679077f46be393e6231753ec55f1d66cba55a..ee83837ab0749cbd4c9a37037bdc4fa000085dc7 100755 --- a/Trigger/TrigAlgorithms/TrigCaloRec/python/TrigCaloRecConfig.py +++ b/Trigger/TrigAlgorithms/TrigCaloRec/python/TrigCaloRecConfig.py @@ -32,6 +32,9 @@ from TrigCaloRec.TrigCaloClusterMakerMonitoring import TrigL1BSTowerHypoOnlineMo from CaloClusterCorrection.common import * from CaloUtils.CaloUtilsConf import * +# MT stuff +from TrigCaloRec.TrigCaloRecConf import HLTCaloCellMaker as _HLTCaloCellMaker + from AthenaCommon.Constants import INFO,ERROR,FALSE,TRUE,DEBUG,VERBOSE from AthenaCommon.SystemOfUnits import GeV,MeV,deg @@ -1984,3 +1987,9 @@ class TrigCaloClusterMakerMT_EMtopo (TrigCaloClusterMakerMTBase): self += emtopomoments +class HLTCaloCellMaker (_HLTCaloCellMaker): + __slots__ = [] + def __init__(self, name): + super( HLTCaloCellMaker, self ).__init__(name) + self.ExtraInputs=[('TileEMScale','ConditionStore+TileEMScale')] + diff --git a/Trigger/TrigAlgorithms/TrigCaloRec/src/HLTCaloCellMaker.cxx b/Trigger/TrigAlgorithms/TrigCaloRec/src/HLTCaloCellMaker.cxx index 3eb2077b062642db7dc9aa6485f656dad9f41cdb..bc55a4319ecd07c42a42566513f20474b43cc5ea 100644 --- a/Trigger/TrigAlgorithms/TrigCaloRec/src/HLTCaloCellMaker.cxx +++ b/Trigger/TrigAlgorithms/TrigCaloRec/src/HLTCaloCellMaker.cxx @@ -1,5 +1,5 @@ /* - * Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + * Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration * */ /* @@ -17,6 +17,7 @@ HLTCaloCellMaker::HLTCaloCellMaker(const std::string & name, ISvcLocator* pSvcLocator) : AthReentrantAlgorithm(name, pSvcLocator), + m_tileEMScaleKey ("TileEMScale"), m_dataAccessSvc( "TrigCaloDataAccessSvc/TrigCaloDataAccessSvc", name ), m_roiMode(true) { @@ -25,6 +26,7 @@ HLTCaloCellMaker::HLTCaloCellMaker(const std::string & name, ISvcLocator* pSvcLo declareProperty("CellsName", m_cellContainerKey = std::string("CellsClusters"), "Calo cells container"); declareProperty("TrigDataAccessMT",m_dataAccessSvc,"Data Access for LVL2 Calo Algorithms in MT"); declareProperty("roiMode",m_roiMode,"RoiMode roi->CaloCellCollection"); + declareProperty("TileEMSCaleKey", m_tileEMScaleKey); } HLTCaloCellMaker::~HLTCaloCellMaker() @@ -37,6 +39,7 @@ StatusCode HLTCaloCellMaker::initialize() { ATH_CHECK( m_cellContainerKey.initialize() ); else ATH_CHECK( m_cellContainerVKey.initialize() ); + ATH_CHECK( m_tileEMScaleKey.initialize() ); CHECK( m_dataAccessSvc.retrieve() ); return StatusCode::SUCCESS; } diff --git a/Trigger/TrigAlgorithms/TrigCaloRec/src/HLTCaloCellMaker.h b/Trigger/TrigAlgorithms/TrigCaloRec/src/HLTCaloCellMaker.h index 7d29c42607e1fb53db2bb53fccf6143c9040ef1f..066be31f2ef336c0311490bd4de83f51787004bb 100644 --- a/Trigger/TrigAlgorithms/TrigCaloRec/src/HLTCaloCellMaker.h +++ b/Trigger/TrigAlgorithms/TrigCaloRec/src/HLTCaloCellMaker.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + * Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration * */ /** @@ -22,9 +22,11 @@ #include "StoreGate/ReadHandleKey.h" #include "StoreGate/WriteHandleKey.h" +#include "StoreGate/ReadCondHandleKey.h" #include "CaloEvent/CaloCellContainerVector.h" #include "AthContainers/ConstDataVector.h" #include "TrigSteeringEvent/TrigRoiDescriptorCollection.h" +#include "TileConditions/TileEMScale.h" class ITrigCaloDataAccessSvc; @@ -43,6 +45,9 @@ class HLTCaloCellMaker: public AthReentrantAlgorithm { SG::ReadHandleKey<TrigRoiDescriptorCollection> m_roiCollectionKey; SG::WriteHandleKey<ConstDataVector<CaloCellContainerVector> > m_cellContainerVKey; SG::WriteHandleKey<ConstDataVector<CaloCellContainer> > m_cellContainerKey; + /// FIXME: Temporary (i hope) to get dependency needed by BS converter. + SG::ReadCondHandleKey<TileEMScale> m_tileEMScaleKey; + ServiceHandle<ITrigCaloDataAccessSvc> m_dataAccessSvc; bool m_roiMode; }; diff --git a/Trigger/TrigAlgorithms/TrigEFMissingET/share/testMET.py b/Trigger/TrigAlgorithms/TrigEFMissingET/share/testMET.py index 9a395cf96f632c4571b9e811d1dd65e333666e47..a29d3411c711cfb8b7b73827717ac1ba20c229ef 100644 --- a/Trigger/TrigAlgorithms/TrigEFMissingET/share/testMET.py +++ b/Trigger/TrigAlgorithms/TrigEFMissingET/share/testMET.py @@ -24,8 +24,9 @@ svcMgr.TrigCaloDataAccessSvc.OutputLevel=INFO from L1Decoder.L1DecoderConf import CreateFullScanRoI topSequence += CreateFullScanRoI() -from TrigCaloRec.TrigCaloRecConf import HLTCaloCellMaker -cellMakerAlgo = HLTCaloCellMaker("CellMakerMT", roiMode=True) +from TrigCaloRec.TrigCaloRecConfig import HLTCaloCellMaker +cellMakerAlgo = HLTCaloCellMaker("CellMakerMT") +cellMakerAlgo.roiMode=True cellMakerAlgo.RoIs="FullScanRoIs" cellMakerAlgo.OutputLevel=VERBOSE diff --git a/Trigger/TrigAlgorithms/TrigL2MuonSA/src/MdtDataPreparator.cxx b/Trigger/TrigAlgorithms/TrigL2MuonSA/src/MdtDataPreparator.cxx index 5f07a7e59fdd27c45f64c82e4d9722aa21ef5f92..36cae716dbf700138c29abd97dbad5a7f68599cf 100644 --- a/Trigger/TrigAlgorithms/TrigL2MuonSA/src/MdtDataPreparator.cxx +++ b/Trigger/TrigAlgorithms/TrigL2MuonSA/src/MdtDataPreparator.cxx @@ -12,6 +12,7 @@ #include "Identifier/IdentifierHash.h" #include "MuonContainerManager/MuonRdoContainerAccess.h" +#include "MuonCnvToolInterfaces/IMuonRawDataProviderTool.h" #include "MuonPrepRawData/MuonPrepDataContainer.h" #include "MuonPrepRawData/MdtPrepDataContainer.h" #include "MuonReadoutGeometry/MuonDetectorManager.h" @@ -904,6 +905,11 @@ StatusCode TrigL2MuonSA::MdtDataPreparator::collectMdtHitsFromPrepData(const std TrigL2MuonSA::MdtHits& mdtHits, const TrigL2MuonSA::MuonRoad& muonRoad) { + if(m_decodeBS) { + if ( m_mdtRawDataProvider->convert(v_robIds).isFailure()) { + ATH_MSG_WARNING("Conversion of BS for decoding of MDTs failed"); + } + } if (m_mdtPrepDataProvider->decode(v_robIds).isSuccess()) { ATH_MSG_DEBUG("Calling ROB based decoding with "<< v_robIds.size() << " ROB's"); } diff --git a/Trigger/TrigAlgorithms/TrigL2MuonSA/src/RpcPatFinder.cxx b/Trigger/TrigAlgorithms/TrigL2MuonSA/src/RpcPatFinder.cxx index bcc607df643a0e774ff36160de2f987440ac439f..0277aeb3dbf28a5533b227336b9b947c0c57b7b1 100644 --- a/Trigger/TrigAlgorithms/TrigL2MuonSA/src/RpcPatFinder.cxx +++ b/Trigger/TrigAlgorithms/TrigL2MuonSA/src/RpcPatFinder.cxx @@ -447,6 +447,8 @@ double TrigL2MuonSA::RpcPatFinder::calibR(std::string stationName, double R, dou // -------------------------------------------------------------------------------- void TrigL2MuonSA::RpcPatFinder::abcal(unsigned int result_pat, size_t index[], double aw[], double bw[]){ + const float ZERO_LIMIT = 1.e-5; + std::vector<std::vector<double> > * rpc_R; std::vector<std::vector<double> > * rpc_Z; rpc_R = &m_hits_in_layer_R; @@ -527,15 +529,13 @@ void TrigL2MuonSA::RpcPatFinder::abcal(unsigned int result_pat, size_t index[], inn_bit=0xF;//00001111 double theta_m,theta_t, theta_f; if((result_pat & inn_bit)==inn_bit){ - if(Z[hot_max[0]] != Z[hot_min[0]]){ - theta_m = atan(R[hot_min[0]]/Z[hot_min[0]]); - theta_t = atan((R[hot_max[0]]- R[hot_min[0]])/(Z[hot_max[0]]-Z[hot_min[0]])); - theta_f = (theta_m+theta_t)/2.0; + theta_m = atan2(R[hot_min[0]],Z[hot_min[0]]); + theta_t = atan2(R[hot_max[0]]-R[hot_min[0]],Z[hot_max[0]]-Z[hot_min[0]]); + theta_f = (theta_m+theta_t)/2.0; - aw[0] = tan(theta_f); - bw[0] = R[hot_min[0]] - Z[hot_min[0]]*aw[0]; - aw[0] = 1.0/aw[0]; - } + aw[0] = tan(theta_f); + bw[0] = R[hot_min[0]] - Z[hot_min[0]]*aw[0]; + aw[0] = 1.0/aw[0]; }else{ if(hot_min[0]!=999){ aw[0] = Z[hot_min[0]] / R[hot_min[0]]; @@ -548,7 +548,7 @@ void TrigL2MuonSA::RpcPatFinder::abcal(unsigned int result_pat, size_t index[], for(int i=1;i<3;i++){ if(hot_max[i]!=-999 && hot_min[i]!=999){ - if(Z[hot_max[i]]!=Z[hot_min[i]]){ + if(fabs(Z[hot_max[i]] - Z[hot_min[i]]) > ZERO_LIMIT) { aw[i] = (R[hot_max[i]]- R[hot_min[i]]) / (Z[hot_max[i]]-Z[hot_min[i]]); bw[i] = R[hot_max[i]] - Z[hot_max[i]]*aw[i]; aw[i] = 1.0/aw[i]; diff --git a/Trigger/TrigAlgorithms/TrigMuonEF/python/TrigMuonEFConfig.py b/Trigger/TrigAlgorithms/TrigMuonEF/python/TrigMuonEFConfig.py index 2f08118c66c06d22bf8a842f5317bbfd6741b712..87f2e8c05b0bcf78aabed1df53d1d06fcb07ceb6 100755 --- a/Trigger/TrigAlgorithms/TrigMuonEF/python/TrigMuonEFConfig.py +++ b/Trigger/TrigAlgorithms/TrigMuonEF/python/TrigMuonEFConfig.py @@ -423,8 +423,10 @@ class TrigMuonEFStandaloneTrackToolConfig (TrigMuonEFStandaloneTrackTool): CfgGetter.getPublicTool("MuonLayerHoughTool").DoTruth=False CfgGetter.getPublicTool("MooTrackFitter").SLFit=False - self.RawDataProviderTool = "RpcRawDataProviderTool" - self.DecodeBS = DetFlags.readRDOBS.RPC_on() + self.MdtRawDataProvider = "MdtRawDataProviderTool" + self.RpcRawDataProvider = "RpcRawDataProviderTool" + self.DecodeMdtBS = DetFlags.readRDOBS.MDT_on() + self.DecodeRpcBS = DetFlags.readRDOBS.RPC_on() # use seeded decoding if (TriggerFlags.MuonSlice.doEFRoIDrivenAccess()): @@ -434,7 +436,6 @@ class TrigMuonEFStandaloneTrackToolConfig (TrigMuonEFStandaloneTrackTool): self.useCscSeededDecoding = True # use ROB based seeded decoding instead of PRD based - self.useMdtRobDecoding = True self.useTgcRobDecoding = False # neither available nor needed self.useCscRobDecoding = False # neither available nor needed diff --git a/Trigger/TrigAlgorithms/TrigMuonEF/python/TrigMuonEFCosmicConfig.py b/Trigger/TrigAlgorithms/TrigMuonEF/python/TrigMuonEFCosmicConfig.py index 0ba58690142c958f268cfee0d32ab30623deeb58..9c65c810255d59357822022946e9eacd9fd0c27e 100755 --- a/Trigger/TrigAlgorithms/TrigMuonEF/python/TrigMuonEFCosmicConfig.py +++ b/Trigger/TrigAlgorithms/TrigMuonEF/python/TrigMuonEFCosmicConfig.py @@ -369,7 +369,6 @@ class TrigMuonEFSegmentFinderCosmicConfig (TrigMuonEFSegmentFinder): self.useCscSeededDecoding = True # use ROB based seeded decoding instead of PRD based - self.useMdtRobDecoding = True self.useTgcRobDecoding = False # neither available nor needed self.useCscRobDecoding = False # neither available nor needed diff --git a/Trigger/TrigAlgorithms/TrigMuonEF/src/TrigMuonEFStandaloneTrackTool.cxx b/Trigger/TrigAlgorithms/TrigMuonEF/src/TrigMuonEFStandaloneTrackTool.cxx index 60ab528b5b12bbc71209aa56fa3ba2a9464e58a9..d4972ac474cbf3d430628ed3537aadff662115ef 100644 --- a/Trigger/TrigAlgorithms/TrigMuonEF/src/TrigMuonEFStandaloneTrackTool.cxx +++ b/Trigger/TrigAlgorithms/TrigMuonEF/src/TrigMuonEFStandaloneTrackTool.cxx @@ -88,7 +88,8 @@ TrigMuonEFStandaloneTrackTool::TrigMuonEFStandaloneTrackTool(const std::string& m_assocTool("Muon::MuonPatternSegmentAssociationTool/MuonPatternSegmentAssociationTool"), m_trackBuilderTool("Muon::MuonTrackSteering/TMEF_TracksBuilderTool",this), m_trackSummaryTool("Trk::TrackSummaryTool/MuidTrackSummaryTool"), - m_rawDataProviderTool("Muon::RPC_RawDataProviderTool/RPC_RawDataProviderTool"), + m_mdtRawDataProvider("Muon::MDT_RawDataProviderTool/MDT_RawDataProviderTool"), + m_rpcRawDataProvider("Muon::RPC_RawDataProviderTool/RPC_RawDataProviderTool"), m_cscPrepDataProvider("Muon::CscRdoToCscPrepDataTool/CscPrepDataProviderTool"), m_mdtPrepDataProvider("Muon::MdtRdoToPrepDataTool/MdtPrepDataProviderTool"), m_rpcPrepDataProvider("Muon::RpcRdoToPrepDataTool/RpcPrepDataProviderTool"), @@ -109,7 +110,6 @@ TrigMuonEFStandaloneTrackTool::TrigMuonEFStandaloneTrackTool(const std::string& m_useRpcSeededDecoding(false), m_useTgcSeededDecoding(false), m_useCscSeededDecoding(false), - m_useMdtRobDecoding(false), m_useTgcRobDecoding(false), m_useCscRobDecoding(false), m_doTimeOutChecks(false), @@ -159,7 +159,8 @@ TrigMuonEFStandaloneTrackTool::TrigMuonEFStandaloneTrackTool(const std::string& declareProperty("MuonCandidateTool", m_muonCandidateTool); declareProperty("TrackToTrackParticleConvTool", m_TrackToTrackParticleConvTool); - declareProperty ("RawDataProviderTool",m_rawDataProviderTool); + declareProperty ("MdtRawDataProvider",m_mdtRawDataProvider); + declareProperty ("RpcRawDataProvider",m_rpcRawDataProvider); declareProperty("CscPrepDataProvider", m_cscPrepDataProvider); declareProperty("MdtPrepDataProvider", m_mdtPrepDataProvider); @@ -180,7 +181,6 @@ TrigMuonEFStandaloneTrackTool::TrigMuonEFStandaloneTrackTool(const std::string& declareProperty("useRpcSeededDecoding", m_useRpcSeededDecoding ); declareProperty("useTgcSeededDecoding", m_useTgcSeededDecoding ); declareProperty("useCscSeededDecoding", m_useCscSeededDecoding ); - declareProperty("useMdtRobDecoding", m_useMdtRobDecoding ); declareProperty("useTgcRobDecoding", m_useTgcRobDecoding ); declareProperty("useCscRobDecoding", m_useCscRobDecoding ); @@ -233,7 +233,9 @@ StatusCode TrigMuonEFStandaloneTrackTool::initialize() msg() << MSG::DEBUG << "TrackBuilderTool " << m_trackBuilderTool << endmsg; msg() << MSG::DEBUG - << "RawDataProviderTool " << m_rawDataProviderTool << endmsg; + << "MdtRawDataProvider " << m_mdtRawDataProvider << endmsg; + msg() << MSG::DEBUG + << "RpcRawDataProvider " << m_rpcRawDataProvider << endmsg; msg() << MSG::DEBUG << "CscPrepDataProvider " << m_cscPrepDataProvider << endmsg; msg() << MSG::DEBUG @@ -264,15 +266,15 @@ StatusCode TrigMuonEFStandaloneTrackTool::initialize() << "useTgcSeededDecoding " << m_useTgcSeededDecoding << endmsg; msg() << MSG::DEBUG << "useCscSeededDecoding " << m_useCscSeededDecoding << endmsg; - msg() << MSG::DEBUG - << "useMdtRobDecoding " << m_useMdtRobDecoding << endmsg; msg() << MSG::DEBUG << "useTgcRobDecoding " << m_useTgcRobDecoding << endmsg; msg() << MSG::DEBUG << "useCscRobDecoding " << m_useCscRobDecoding << endmsg; msg() << MSG::DEBUG - << m_decodeBS.name() << " " << m_decodeBS << endmsg; + << m_decodeMdtBS.name() << " " << m_decodeMdtBS << endmsg; + msg() << MSG::DEBUG + << m_decodeRpcBS.name() << " " << m_decodeRpcBS << endmsg; msg() << MSG::DEBUG << "doTimeOutChecks " << m_doTimeOutChecks << endmsg; msg() << MSG::DEBUG @@ -305,12 +307,21 @@ StatusCode TrigMuonEFStandaloneTrackTool::initialize() return StatusCode::FAILURE; } - // Retrieve raw data provider tool (for RPCs) if needed - if (m_rawDataProviderTool.retrieve(DisableTool{ !m_decodeBS }).isSuccess()) { - msg (MSG::INFO) << "Retrieved " << m_rawDataProviderTool << endmsg; + // Retrieve MDT raw data provider tool if needed + if (m_mdtRawDataProvider.retrieve(DisableTool{ !m_decodeMdtBS }).isSuccess()) { + msg (MSG::INFO) << "Retrieved " << m_mdtRawDataProvider << endmsg; } else { - msg (MSG::FATAL) << "Could not get " << m_rawDataProviderTool << endmsg; + msg (MSG::FATAL) << "Could not get " << m_mdtRawDataProvider << endmsg; + return StatusCode::FAILURE; + } + + // Retrieve RPC raw data provider tool if needed + if (m_rpcRawDataProvider.retrieve(DisableTool{ !m_decodeRpcBS }).isSuccess()) { + msg (MSG::INFO) << "Retrieved " << m_rpcRawDataProvider << endmsg; + } + else { + msg (MSG::FATAL) << "Could not get " << m_rpcRawDataProvider << endmsg; return StatusCode::FAILURE; } @@ -879,9 +890,8 @@ if (m_useMdtData>0) { if (m_useRpcData && !rpc_hash_ids.empty()) {// RPC decoding if (m_useRpcSeededDecoding) {// seeded decoding of RPC - - if(m_decodeBS) { - if (m_rawDataProviderTool->convert( getRpcRobList(muonRoI) ).isSuccess()) { + if(m_decodeRpcBS) {// bytestream conversion + if (m_rpcRawDataProvider->convert( getRpcRobList(muonRoI) ).isSuccess()) { ATH_MSG_DEBUG("RPC BS conversion for ROB-based seeded PRD decoding done successfully"); } else { ATH_MSG_WARNING("RPC BS conversion for ROB-based seeded PRD decoding failed"); @@ -896,7 +906,7 @@ if (m_useMdtData>0) { } else {// full decoding of RPC - if (m_rawDataProviderTool->convert().isSuccess()) { + if (m_rpcRawDataProvider->convert().isSuccess()) { ATH_MSG_DEBUG("RPC BS conversion for full decoding done successfully"); } else { ATH_MSG_WARNING("RPC BS conversion for full decoding failed"); @@ -919,34 +929,25 @@ if (m_useMdtData>0) { if (m_useMdtData && !mdt_hash_ids.empty()) {// MDT decoding if (m_useMdtSeededDecoding) {// seeded decoding of MDT - if (m_useMdtRobDecoding) {// ROB-based seeded decoding of MDT - - if (m_mdtPrepDataProvider->decode( getMdtRobList(muonRoI) ).isSuccess()) { - ATH_MSG_DEBUG("ROB-based seeded decoding of MDT done successfully"); - } else { - ATH_MSG_WARNING("ROB-based seeded decoding of MDT failed"); - } - + if(m_decodeMdtBS) {// bytestream conversion + if (m_mdtRawDataProvider->convert( getMdtRobList(muonRoI) ).isSuccess()) { + ATH_MSG_DEBUG("MDT BS conversion for ROB-based seeded PRD decoding done successfully"); + } else { + ATH_MSG_WARNING("MDT BS conversion for ROB-based seeded PRD decoding failed"); + } } - else {// PRD-based seeded decoding of MDT - - if(m_mdtPrepDataProvider->decode(mdt_hash_ids, hash_ids_withData).isSuccess()) { - ATH_MSG_DEBUG("PRD-based seeded decoding of MDT done successfully"); -#if DEBUG_ROI_VS_FULL - sanity_check(mdt_hash_ids, hash_ids_withData, m_fileWithHashIds_mdt); -#endif - mdt_hash_ids.clear(); - mdt_hash_ids_cache.clear(); - mdt_hash_ids = hash_ids_withData; - ATH_MSG_DEBUG("MdtHashId vector resized to " << mdt_hash_ids.size()); - } else { - ATH_MSG_WARNING("PRD-based seeded decoding of RPC failed"); - } - + if (m_mdtPrepDataProvider->decode( getMdtRobList(muonRoI) ).isSuccess()) { + ATH_MSG_DEBUG("ROB-based seeded decoding of MDT done successfully"); + } else { + ATH_MSG_WARNING("ROB-based seeded decoding of MDT failed"); } - } - else {// full decoding of MDT - + } else {// full decoding of MDT + if (m_mdtRawDataProvider->convert().isSuccess()) { + ATH_MSG_DEBUG("MDT BS conversion for full decoding done successfully"); + } else { + ATH_MSG_WARNING("MDT BS conversion for full decoding failed"); + } + std::vector<IdentifierHash> input_hash_ids; input_hash_ids.reserve(0); if(m_mdtPrepDataProvider->decode(input_hash_ids, hash_ids_withData).isSuccess()) { diff --git a/Trigger/TrigAlgorithms/TrigMuonEF/src/TrigMuonEFStandaloneTrackTool.h b/Trigger/TrigAlgorithms/TrigMuonEF/src/TrigMuonEFStandaloneTrackTool.h index d318cf24874b9571bbdefb2e7e3946aaf3d5bf89..6407a3b7eadec4038e08e799e2a70f4a9560690d 100644 --- a/Trigger/TrigAlgorithms/TrigMuonEF/src/TrigMuonEFStandaloneTrackTool.h +++ b/Trigger/TrigAlgorithms/TrigMuonEF/src/TrigMuonEFStandaloneTrackTool.h @@ -266,7 +266,8 @@ class TrigMuonEFStandaloneTrackTool : public AthAlgTool, ToolHandle<Trk::ITrackSummaryTool > m_trackSummaryTool; // handles to the RoI driven data access - ToolHandle<Muon::IMuonRawDataProviderTool> m_rawDataProviderTool; + ToolHandle<Muon::IMuonRawDataProviderTool> m_mdtRawDataProvider; + ToolHandle<Muon::IMuonRawDataProviderTool> m_rpcRawDataProvider; ToolHandle<Muon::IMuonRdoToPrepDataTool> m_cscPrepDataProvider; ToolHandle<Muon::IMuonRdoToPrepDataTool> m_mdtPrepDataProvider; ToolHandle<Muon::IMuonRdoToPrepDataTool> m_rpcPrepDataProvider; @@ -302,7 +303,8 @@ class TrigMuonEFStandaloneTrackTool : public AthAlgTool, bool m_doCache; // Flag to decide whether or not to run BS decoding - Gaudi::Property< bool > m_decodeBS { this, "DecodeBS", true, "Flag to decide whether or not to run BS->RDO decoding" }; + Gaudi::Property< bool > m_decodeMdtBS { this, "DecodeMdtBS", true, "Flag to decide whether or not to run BS->RDO decoding for MTDs" }; + Gaudi::Property< bool > m_decodeRpcBS { this, "DecodeRpcBS", true, "Flag to decide whether or not to run BS->RDO decoding for RPCs" }; bool m_useCscData; bool m_useRpcData; @@ -316,7 +318,6 @@ class TrigMuonEFStandaloneTrackTool : public AthAlgTool, bool m_useRpcSeededDecoding; bool m_useTgcSeededDecoding; bool m_useCscSeededDecoding; - bool m_useMdtRobDecoding; bool m_useTgcRobDecoding; bool m_useCscRobDecoding; diff --git a/Trigger/TrigAnalysis/TrigEgammaAnalysisTools/python/TrigEgammaMonToolConfig.py b/Trigger/TrigAnalysis/TrigEgammaAnalysisTools/python/TrigEgammaMonToolConfig.py index 64a8c5d8ceb2a810218bc3a458ef84b1919de8de..96f9961fb6f56b6b84ac8bcfbd7c4374e8223c38 100644 --- a/Trigger/TrigAnalysis/TrigEgammaAnalysisTools/python/TrigEgammaMonToolConfig.py +++ b/Trigger/TrigAnalysis/TrigEgammaAnalysisTools/python/TrigEgammaMonToolConfig.py @@ -1,7 +1,7 @@ # Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration def TrigEgammaMonTool(): - from AthenaCommon.AppMgr import ToolSvc + #from AthenaCommon.AppMgr import ToolSvc from TrigEgammaAnalysisTools.TrigEgammaAnalysisToolsConfig import TrigEgammaNavAnalysisTool,TrigEgammaNavTPAnalysisTool,TrigEgammaNavTPJpsieeAnalysisTool from TrigEgammaAnalysisTools.TrigEgammaAnalysisToolsConfig import TrigEgammaPlotTool from TrigEgammaAnalysisTools.TrigEgammaProbelist import monitoring_mam, monitoring_electron, monitoring_photon @@ -92,4 +92,4 @@ def TrigEgammaMonTool(): "TrigEgammaNavAnalysisTool/NavElectronAnalysis", "TrigEgammaNavTPAnalysisTool/NavTPAnalysis", "TrigEgammaNavTPAnalysisTool/NavTPJpsieeAnalysis"]) - ToolSvc += TrigEgammaMonTool + #ToolSvc += TrigEgammaMonTool diff --git a/Trigger/TrigAnalysis/TrigEgammaAnalysisTools/python/TrigEgammaMonToolConfig50ns.py b/Trigger/TrigAnalysis/TrigEgammaAnalysisTools/python/TrigEgammaMonToolConfig50ns.py index 00225795587a892b90f203258bc82517a701f713..7af1f7b52df49d14e7f0dfbf8a7e3b67b9ed0e47 100644 --- a/Trigger/TrigAnalysis/TrigEgammaAnalysisTools/python/TrigEgammaMonToolConfig50ns.py +++ b/Trigger/TrigAnalysis/TrigEgammaAnalysisTools/python/TrigEgammaMonToolConfig50ns.py @@ -1,7 +1,7 @@ # Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration def TrigEgammaMonTool(): - from AthenaCommon.AppMgr import ToolSvc + #from AthenaCommon.AppMgr import ToolSvc from AthenaCommon import CfgMgr from ElectronPhotonSelectorTools.ElectronPhotonSelectorToolsConf import AsgElectronIsEMSelector from ElectronPhotonSelectorTools.ElectronIsEMSelectorMapping import ElectronIsEMMap,electronPIDmenu @@ -109,4 +109,4 @@ def TrigEgammaMonTool(): Tools=["TrigEgammaNavAnalysisTool/NavAnalysis", "TrigEgammaNavTPAnalysisTool/NavTPAnalysis", "TrigEgammaNavTPAnalysisTool/NavTPJpsieeAnalysis"]) - ToolSvc += TrigEgammaMonTool + #ToolSvc += TrigEgammaMonTool diff --git a/Trigger/TrigAnalysis/TrigEgammaAnalysisTools/python/TrigEgammaPhysValMonToolConfig.py b/Trigger/TrigAnalysis/TrigEgammaAnalysisTools/python/TrigEgammaPhysValMonToolConfig.py index 8e54d18baac1666161d8900ffdaff462a5747452..9ef1c9d4453136a3f8f9b270a1e4232cdd119011 100644 --- a/Trigger/TrigAnalysis/TrigEgammaAnalysisTools/python/TrigEgammaPhysValMonToolConfig.py +++ b/Trigger/TrigAnalysis/TrigEgammaAnalysisTools/python/TrigEgammaPhysValMonToolConfig.py @@ -1,7 +1,7 @@ # Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration def TrigEgammaPhysValMonTool(): - from AthenaCommon.AppMgr import ToolSvc + #from AthenaCommon.AppMgr import ToolSvc from TrigEgammaAnalysisTools.TrigEgammaAnalysisToolsConfig import TrigEgammaEmulationTool from TrigEgammaAnalysisTools.TrigEgammaAnalysisToolsConfig import TrigEgammaNavAnalysisTool,TrigEgammaNavTPAnalysisTool, TrigEgammaNavNtuple, TrigEgammaNavTPNtuple from TrigEgammaAnalysisTools.TrigEgammaProbelist import default, probeListLowMidPtPhysicsTriggers # to import probelist @@ -88,7 +88,7 @@ def TrigEgammaPhysValMonTool(): "TrigEgammaNavTPNtuple/NavTPNtuple" ]) - ToolSvc += TrigEgammaPhysValMonTool + #ToolSvc += TrigEgammaPhysValMonTool diff --git a/Trigger/TrigAnalysis/TrigEgammaAnalysisTools/share/testTrigEgammaAnalysisTools.py b/Trigger/TrigAnalysis/TrigEgammaAnalysisTools/share/testTrigEgammaAnalysisTools.py index 696145e7d69d0f1b94ebc2f35cd2da9c2bac611a..c9204906db76d749e33f8ecd3cfc3d0f546c41cf 100755 --- a/Trigger/TrigAnalysis/TrigEgammaAnalysisTools/share/testTrigEgammaAnalysisTools.py +++ b/Trigger/TrigAnalysis/TrigEgammaAnalysisTools/share/testTrigEgammaAnalysisTools.py @@ -105,12 +105,12 @@ from TrigHLTMonitoring.TrigHLTMonitoringConf import HLTMonTool HLTMon = HLTMonTool(name = 'HLTMon', histoPathBase = "HLT"); -ToolSvc += HLTMon; -HLTMonManager.AthenaMonTools += [ "HLTMonTool/HLTMon" ]; +#ToolSvc += HLTMon; +HLTMonManager.AthenaMonTools += [ HLTMon ]; from TrigEgammaAnalysisTools import TrigEgammaMonToolConfig -TrigEgammaMonToolConfig.TrigEgammaMonTool() -HLTMonManager.AthenaMonTools += [ "TrigEgammaMonTool/HLTEgammaMon" ] +HLTEgammaMon = TrigEgammaMonToolConfig.TrigEgammaMonTool() +HLTMonManager.AthenaMonTools += [ HLTEgammaMon ] HLTMonManager.FileKey = "GLOBAL" diff --git a/Trigger/TrigAnalysis/TrigEgammaAnalysisTools/share/testTrigEgammaAnalysisToolsGRL.py b/Trigger/TrigAnalysis/TrigEgammaAnalysisTools/share/testTrigEgammaAnalysisToolsGRL.py index 57af3980214657701f2e560d88e7363c6632b201..bc68fb6dccbee77aa77fbf14c2715b12bbbc863f 100755 --- a/Trigger/TrigAnalysis/TrigEgammaAnalysisTools/share/testTrigEgammaAnalysisToolsGRL.py +++ b/Trigger/TrigAnalysis/TrigEgammaAnalysisTools/share/testTrigEgammaAnalysisToolsGRL.py @@ -143,12 +143,12 @@ if 'DOTIER0' in dir(): histoPathBase = "HLT"); - ToolSvc += HLTMon; - HLTMonManager.AthenaMonTools += [ "HLTMonTool/HLTMon" ]; + #ToolSvc += HLTMon; + HLTMonManager.AthenaMonTools += [ HLTMon ]; from TrigEgammaAnalysisTools import TrigEgammaMonToolConfig - TrigEgammaMonToolConfig.TrigEgammaMonTool() - HLTMonManager.AthenaMonTools += [ "TrigEgammaMonTool" ] + TrigEgammaMonTool = TrigEgammaMonToolConfig.TrigEgammaMonTool() + HLTMonManager.AthenaMonTools += [ TrigEgammaMonTool ] HLTMonManager.FileKey = "GLOBAL" elif 'DO50ns' in dir(): @@ -172,12 +172,12 @@ elif 'DO50ns' in dir(): histoPathBase = "HLT"); - ToolSvc += HLTMon; - HLTMonManager.AthenaMonTools += [ "HLTMonTool/HLTMon" ]; + #ToolSvc += HLTMon; + HLTMonManager.AthenaMonTools += [ HLTMon ]; from TrigEgammaAnalysisTools import TrigEgammaMonToolConfig50ns - TrigEgammaMonToolConfig50ns.TrigEgammaMonTool() - HLTMonManager.AthenaMonTools += [ "TrigEgammaMonTool" ] + TrigEgammaMonTool = TrigEgammaMonToolConfig50ns.TrigEgammaMonTool() + HLTMonManager.AthenaMonTools += [ TrigEgammaMonTool ] HLTMonManager.FileKey = "GLOBAL" elif 'DOPHYSVAL' in dir(): from AthenaCommon.AlgSequence import AlgSequence diff --git a/Trigger/TrigAnalysis/TrigEgammaEmulationTool/python/TrigEgammaEmulationToolConfig.py b/Trigger/TrigAnalysis/TrigEgammaEmulationTool/python/TrigEgammaEmulationToolConfig.py index 60f6d071af9b76d14789464d67e577d56702611d..160c6c2c4453bae04234b5379553d0689034e422 100644 --- a/Trigger/TrigAnalysis/TrigEgammaEmulationTool/python/TrigEgammaEmulationToolConfig.py +++ b/Trigger/TrigAnalysis/TrigEgammaEmulationTool/python/TrigEgammaEmulationToolConfig.py @@ -28,8 +28,8 @@ from ElectronPhotonSelectorTools.ElectronIsEMSelectorMapping import Electro #ToolSvc += EgammaMatchTool #***************************************************************************** -from egammaMVACalib.egammaMVACalibConf import egammaMVATool -mvatool = egammaMVATool("mvatool",folder="egammaMVACalib/v1") +from egammaMVACalib.egammaMVACalibConf import egammaMVACalibTool +mvatool = egammaMVACalibTool("mvatool",folder="egammaMVACalib/v1") ToolSvc += mvatool #***************************************************************************** diff --git a/Trigger/TrigAnalysis/TrigEgammaEmulationTool/share/test_TrigEgammaAnalysisToolsWithEmulation.py b/Trigger/TrigAnalysis/TrigEgammaEmulationTool/share/test_TrigEgammaAnalysisToolsWithEmulation.py index 48cf8a9ea30fc299c448422e43d000563be528e5..ad8c1a954ef9682821fda8ae786007dd72c27864 100755 --- a/Trigger/TrigAnalysis/TrigEgammaEmulationTool/share/test_TrigEgammaAnalysisToolsWithEmulation.py +++ b/Trigger/TrigAnalysis/TrigEgammaEmulationTool/share/test_TrigEgammaAnalysisToolsWithEmulation.py @@ -140,7 +140,7 @@ HLTMonManager = topSequence.HLTMonManager from TrigHLTMonitoring.TrigHLTMonitoringConf import HLTMonTool HLTMon = HLTMonTool(name = 'HLTMon', histoPathBase = "HLT"); ToolSvc += HLTMon; -HLTMonManager.AthenaMonTools += [ "HLTMonTool/HLTMon" ]; +HLTMonManager.AthenaMonTools += [ HLTMon ]; #################################################################################################### #Define the base path for all histograms @@ -221,8 +221,8 @@ AnalysisTool = TrigEgammaNavTPAnalysisTool( name = "TrigEgammaNavTPAnalysisTool" Tools=['TrigEgammaNavTPAnalysisTool/TrigEgammaNavTPAnalysisTool'] from TrigEgammaAnalysisTools.TrigEgammaAnalysisToolsConf import TrigEgammaMonTool TrigEgammaMonTool = TrigEgammaMonTool( name = "HLTEgammaMon", histoPathBase=basePath, Tools=Tools) -ToolSvc += TrigEgammaMonTool -HLTMonManager.AthenaMonTools += [ "TrigEgammaMonTool/HLTEgammaMon" ] +#ToolSvc += TrigEgammaMonTool +HLTMonManager.AthenaMonTools += [ TrigEgammaMonTool ] HLTMonManager.FileKey = "GLOBAL" -ToolSvc.TrigDecisionTool.Navigation.OutputLevel = WARNING +#ToolSvc.TrigDecisionTool.Navigation.OutputLevel = WARNING #################################################################################################### diff --git a/Trigger/TrigAnalysis/TrigInDetAnalysisExample/TrigInDetAnalysisExample/Analysis_Tier0.h b/Trigger/TrigAnalysis/TrigInDetAnalysisExample/TrigInDetAnalysisExample/Analysis_Tier0.h index 37097169b4efcd7a62aafb70f41dcdadfb266ef8..f86ce6b52365f59cea867f909235cee489b68ab5 100644 --- a/Trigger/TrigAnalysis/TrigInDetAnalysisExample/TrigInDetAnalysisExample/Analysis_Tier0.h +++ b/Trigger/TrigAnalysis/TrigInDetAnalysisExample/TrigInDetAnalysisExample/Analysis_Tier0.h @@ -152,6 +152,8 @@ class Analysis_Tier0 : public TrackAnalysis { TH1F* h_ntrk_rec; + TH1F* m_h_layer; + TH1F* h_trkpT_rec; TH1F* h_trketa_rec; @@ -170,6 +172,9 @@ class Analysis_Tier0 : public TrackAnalysis { TH1F* h_ntrt_rec; + TH1F* m_h_layer_rec; + + TH1F* h_trkpT_residual; TH1F* h_trkipT_residual; TH1F* h_trketa_residual; diff --git a/Trigger/TrigAnalysis/TrigInDetAnalysisExample/run/tida_athanarun2.py b/Trigger/TrigAnalysis/TrigInDetAnalysisExample/run/tida_athanarun2.py index 17f9bda89d61e55efd359edaa31102ffec6c5b2d..30985f846e5295ac1811413cd897a6fe7054dd39 100644 --- a/Trigger/TrigAnalysis/TrigInDetAnalysisExample/run/tida_athanarun2.py +++ b/Trigger/TrigAnalysis/TrigInDetAnalysisExample/run/tida_athanarun2.py @@ -157,8 +157,8 @@ if ( False ) : d = release_metadata() TestMonTool.releaseMetaData = d['nightly name'] + " " + d['nightly release'] + " " + d['date'] + " " + d['platform'] + " " + d['release'] TestMonTool.outputFileName="TrkNtuple.root" - ToolSvc += TestMonTool - HLTMonManager.AthenaMonTools += [ "TrigTestMonToolAC/TestMonToolAC" ] + #ToolSvc += TestMonTool + HLTMonManager.AthenaMonTools += [ TestMonTool ] print TestMonTool diff --git a/Trigger/TrigAnalysis/TrigInDetAnalysisExample/run/tida_autoconf.py b/Trigger/TrigAnalysis/TrigInDetAnalysisExample/run/tida_autoconf.py index 68c461a3fcc023407d6e0626f3769e9fc2a9f958..ecc48515e4af9dfec3f52c4c3591d7b5a9fc37b2 100644 --- a/Trigger/TrigAnalysis/TrigInDetAnalysisExample/run/tida_autoconf.py +++ b/Trigger/TrigAnalysis/TrigInDetAnalysisExample/run/tida_autoconf.py @@ -126,8 +126,8 @@ TestMonTool.ntupleChainNames += [ "HLT_.*id.*cosmic.*:InDetTrigTrackingxAODCnv_CosmicsN_EFID" ] TestMonTool.outputFileName="TrkNtuple.root" -ToolSvc += TestMonTool -HLTMonManager.AthenaMonTools += [ "TrigTestMonToolAC/TestMonToolAC" ] +#ToolSvc += TestMonTool +HLTMonManager.AthenaMonTools += [ TestMonTool ] print TestMonTool diff --git a/Trigger/TrigAnalysis/TrigInDetAnalysisExample/run/tida_dc14.py b/Trigger/TrigAnalysis/TrigInDetAnalysisExample/run/tida_dc14.py index a2c8d4983a32dc2e7e4e2f995c092e22d39179a6..6fe0961867923d61139b4d8cb80417eb0c74d4d0 100644 --- a/Trigger/TrigAnalysis/TrigInDetAnalysisExample/run/tida_dc14.py +++ b/Trigger/TrigAnalysis/TrigInDetAnalysisExample/run/tida_dc14.py @@ -159,8 +159,8 @@ TestMonTool.ntupleChainNames += [ ] TestMonTool.outputFileName="TrkNtuple.root" -ToolSvc += TestMonTool -HLTMonManager.AthenaMonTools += [ "TrigTestMonToolAC/TestMonToolAC" ] +#ToolSvc += TestMonTool +HLTMonManager.AthenaMonTools += [ TestMonTool ] print TestMonTool diff --git a/Trigger/TrigAnalysis/TrigInDetAnalysisExample/run/tida_run2.py b/Trigger/TrigAnalysis/TrigInDetAnalysisExample/run/tida_run2.py index 6d471146dcffbdc2e5def884f074df1450c3fd1e..1239669d21b4c006efea0e7227298cd9ce647cfe 100644 --- a/Trigger/TrigAnalysis/TrigInDetAnalysisExample/run/tida_run2.py +++ b/Trigger/TrigAnalysis/TrigInDetAnalysisExample/run/tida_run2.py @@ -261,8 +261,8 @@ TestMonTool.ntupleChainNames += [ ] TestMonTool.outputFileName="TrkNtuple.root" -ToolSvc += TestMonTool -HLTMonManager.AthenaMonTools += [ "TrigTestMonToolAC/TestMonToolAC" ] +#ToolSvc += TestMonTool +HLTMonManager.AthenaMonTools += [ TestMonTool ] print TestMonTool diff --git a/Trigger/TrigAnalysis/TrigInDetAnalysisExample/src/AnalysisConfig_Ntuple.cxx b/Trigger/TrigAnalysis/TrigInDetAnalysisExample/src/AnalysisConfig_Ntuple.cxx index 1da86b87228c1f955dfd82268881003749b96dd3..d7bbf8e67e867582d4e748134feb994fe05af44b 100644 --- a/Trigger/TrigAnalysis/TrigInDetAnalysisExample/src/AnalysisConfig_Ntuple.cxx +++ b/Trigger/TrigAnalysis/TrigInDetAnalysisExample/src/AnalysisConfig_Ntuple.cxx @@ -1199,6 +1199,8 @@ void AnalysisConfig_Ntuple::loop() { // std::cout << "decidion type " << decisiontype << std::endl; #endif + /// if the chain did not pass, skip this chain completely + if ( !(*m_tdt)->isPassed( chainName, _decisiontype ) ) continue; // Get chain combinations and loop on them // - loop made on chain selected as the one steering RoI creation diff --git a/Trigger/TrigAnalysis/TrigInDetAnalysisExample/src/Analysis_Tier0.cxx b/Trigger/TrigAnalysis/TrigInDetAnalysisExample/src/Analysis_Tier0.cxx index a4232e5edd1a40c314a84928ed18ace052bd3a9f..aa3b07b014491b5b28d859d9423b218d8a3c2542 100644 --- a/Trigger/TrigAnalysis/TrigInDetAnalysisExample/src/Analysis_Tier0.cxx +++ b/Trigger/TrigAnalysis/TrigInDetAnalysisExample/src/Analysis_Tier0.cxx @@ -227,7 +227,11 @@ void Analysis_Tier0::initialise() { addHistogram( h_nsihits_lb ); addHistogram( h_nsihits_lb_rec ); + m_h_layer_rec = new TH1F("layer_rec" , "hit layers", 32, -0.5, 31.5 ); + m_h_layer = new TH1F("layer", "hit layers", 32, -0.5, 31.5 ); + addHistogram(m_h_layer); + addHistogram(m_h_layer_rec); @@ -477,7 +481,10 @@ void Analysis_Tier0::execute(const std::vector<TIDA::Track*>& referenceTracks, h_chain->Fill(2.5); - + for ( size_t ilayer=0 ; ilayer<32 ; ilayer++ ) { + if ( (*reference)->hitPattern()&(1<<ilayer) ) m_h_layer_rec->Fill( ilayer ); + } + if (test) { h_chain->Fill(3.5); @@ -505,6 +512,10 @@ void Analysis_Tier0::execute(const std::vector<TIDA::Track*>& referenceTracks, h_trkvtx_y_lb->Fill( event()->lumi_block(), beamTesty() ); h_trkvtx_z_lb->Fill( event()->lumi_block(), beamTestz() ); + for ( size_t ilayer=0 ; ilayer<32 ; ilayer++ ) { + if ( test->hitPattern()&(1<<ilayer) ) m_h_layer_rec->Fill( ilayer ); + } + // std::cout << "SUTT beam x " << beamTestx() << " " << "\tx " << beamTesty() << " " << "\ty " << beamTestz() << std::endl; #if 0 diff --git a/Trigger/TrigCost/TrigCostRootAnalysis/Root/TrigXMLService.cxx b/Trigger/TrigCost/TrigCostRootAnalysis/Root/TrigXMLService.cxx index fbb5136b9550f224d2b105a29755bf6ac70be832..2e216b9db050daa0656933a1b2b6bdcbb677184f 100644 --- a/Trigger/TrigCost/TrigCostRootAnalysis/Root/TrigXMLService.cxx +++ b/Trigger/TrigCost/TrigCostRootAnalysis/Root/TrigXMLService.cxx @@ -757,7 +757,7 @@ namespace TrigCostRootAnalysis { } else { // CAUTION - "ATHENA ONLY" CODE #ifndef ROOTCORE - path = PathResolverFindDataFile(file); // Get from CALIB area + path = PathResolverFindCalibFile("TrigCostRootAnalysis/" + file); // Get from CALIB area if (path == Config::config().getStr(kBlankString)) { // One more place we can look path = std::string(Config::config().getStr(kAFSDataDir) + "/" + file); } @@ -1171,7 +1171,7 @@ namespace TrigCostRootAnalysis { } else { // CAUTION - "ATHENA ONLY" CODE #ifndef ROOTCORE - std::string locAthena = PathResolverFindDataFile(Config::config().getStr(kEBXMLName)); + std::string locAthena = PathResolverFindCalibFile("TrigCostRootAnalysis" + Config::config().getStr(kEBXMLName)); if (locAthena == Config::config().getStr(kBlankString)) { Error("TrigXMLService::parseEnhancedBiasXML", "Athena cannot find Enhanced Bias weighting file %s. Critical error.", Config::config().getStr(kEBXMLName).c_str()); abort(); diff --git a/Trigger/TrigEvent/TrigSteeringEvent/TrigSteeringEvent/HLTResultMT.h b/Trigger/TrigEvent/TrigSteeringEvent/TrigSteeringEvent/HLTResultMT.h index 6cd6de32ca5acada8212497d2d04edf757d1ffbc..a38fa409487c3bbc0e1e68500d4db8db674327ca 100644 --- a/Trigger/TrigEvent/TrigSteeringEvent/TrigSteeringEvent/HLTResultMT.h +++ b/Trigger/TrigEvent/TrigSteeringEvent/TrigSteeringEvent/HLTResultMT.h @@ -23,7 +23,10 @@ namespace HLT { /// Standard constructor HLTResultMT(std::vector<eformat::helper::StreamTag> streamTags = {}, std::vector<uint32_t> hltBits = {}, - std::unordered_map<uint16_t, std::vector<uint32_t> > data = {}); + std::unordered_map<uint16_t, std::vector<uint32_t> > data = {}, + std::vector<uint32_t> status = {}); + /// Copy constructor + HLTResultMT(const HLTResultMT& other); /// Standard destructor virtual ~HLTResultMT(); @@ -50,6 +53,13 @@ namespace HLT { /// Append serialised data for a given module ID void addSerialisedData(const uint16_t moduleId, const std::vector<uint32_t>& data); + /// Status words getter + const std::vector<uint32_t>& getStatus() const; + /// Status words setter + void setStatus(const std::vector<uint32_t>& status); + /// Append a status word + void addStatusWord(const uint32_t& word); + private: /// Stream tags of the event std::vector<eformat::helper::StreamTag> m_streamTags; @@ -57,6 +67,8 @@ namespace HLT { std::vector<uint32_t> m_hltBits; /// Serialised result (ROBFragment payload) for each module ID (0 for full result, >0 for data scouting) std::unordered_map<uint16_t, std::vector<uint32_t> > m_data; + /// Event status words (used to indicate processing errors) + std::vector<uint32_t> m_status; }; } // namespace HLT diff --git a/Trigger/TrigEvent/TrigSteeringEvent/src/HltResultMT.cxx b/Trigger/TrigEvent/TrigSteeringEvent/src/HltResultMT.cxx index 2759bfc81b35c47ecb0e21aca9b9d2b79a43901a..cb2d5ea418f0d79ce99d43d89a16a7c0b33f4986 100644 --- a/Trigger/TrigEvent/TrigSteeringEvent/src/HltResultMT.cxx +++ b/Trigger/TrigEvent/TrigSteeringEvent/src/HltResultMT.cxx @@ -9,10 +9,21 @@ // ============================================================================= HLT::HLTResultMT::HLTResultMT(std::vector<eformat::helper::StreamTag> streamTags, std::vector<uint32_t> hltBits, - std::unordered_map<uint16_t, std::vector<uint32_t> > data) + std::unordered_map<uint16_t, std::vector<uint32_t> > data, + std::vector<uint32_t> status) : m_streamTags(streamTags), m_hltBits(hltBits), - m_data(data) {} + m_data(data), + m_status(status) {} + +// ============================================================================= +// Copy constructor +// ============================================================================= +HLT::HLTResultMT::HLTResultMT(const HLT::HLTResultMT& other) +: m_streamTags(other.m_streamTags), + m_hltBits(other.m_hltBits), + m_data(other.m_data), + m_status(other.m_status) {} // ============================================================================= // Standard destructor @@ -84,3 +95,21 @@ void HLT::HLTResultMT::addSerialisedData(const uint16_t moduleId, const std::vec m_data[moduleId] = data; } } + +// ============================================================================= +// Getter/setter methods for status words +// ============================================================================= +const std::vector<uint32_t>& HLT::HLTResultMT::getStatus() const { + return m_status; +} + +// ----------------------------------------------------------------------------- +void HLT::HLTResultMT::setStatus(const std::vector<uint32_t>& status) { + // copy assignment + m_status = status; +} + +// ----------------------------------------------------------------------------- +void HLT::HLTResultMT::addStatusWord(const uint32_t& word) { + m_status.push_back(word); +} diff --git a/Trigger/TrigHypothesis/TrigBjetHypo/src/TrigBjetEtHypoAlg.cxx b/Trigger/TrigHypothesis/TrigBjetHypo/src/TrigBjetEtHypoAlg.cxx deleted file mode 100644 index 6a46f7b27ef2b0a8287fdba5a296db6539982b49..0000000000000000000000000000000000000000 --- a/Trigger/TrigHypothesis/TrigBjetHypo/src/TrigBjetEtHypoAlg.cxx +++ /dev/null @@ -1,104 +0,0 @@ -/* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration -*/ - -#include "GaudiKernel/Property.h" -#include "TrigBjetEtHypoAlg.h" - - -TrigBjetEtHypoAlg::TrigBjetEtHypoAlg( const std::string& name, - ISvcLocator* pSvcLocator ) : - ::HypoBase( name, pSvcLocator ) {} - -TrigBjetEtHypoAlg::~TrigBjetEtHypoAlg() -{} - -StatusCode TrigBjetEtHypoAlg::initialize() -{ - ATH_MSG_INFO ( "Initializing " << name() << "..." ); - - ATH_MSG_DEBUG( "declareProperty review:" ); - ATH_MSG_DEBUG( " " << m_jetsKey ); - // ATH_MSG_DEBUG( " " << m_decisionsKey ); - - ATH_MSG_DEBUG( "Initializing Tools" ); - ATH_CHECK( m_hypoTools.retrieve() ); - - ATH_MSG_DEBUG( "Initializing HandleKeys" ); - CHECK( m_jetsKey.initialize() ); - // CHECK( m_decisionsKey.initialize() ); - - return StatusCode::SUCCESS; -} - -StatusCode TrigBjetEtHypoAlg::finalize() { - return StatusCode::SUCCESS; -} - -StatusCode TrigBjetEtHypoAlg::execute_r( const EventContext& context ) const { - ATH_MSG_INFO ( "Executing " << name() << "..." ); - - // In case I need it (not sure). Taken from Jet code - // Read in previous Decisions made before running this Hypo Alg. - // The container should have only one such Decision in case we are cutting on 'j' threshold (for L1) - SG::ReadHandle< TrigCompositeUtils::DecisionContainer > prevDecisionHandle = SG::makeHandle( decisionInput(),context ); - CHECK( prevDecisionHandle.isValid() ); - const TrigCompositeUtils::DecisionContainer *prevDecisionContainer = prevDecisionHandle.get(); - ATH_MSG_DEBUG( "Running with "<< prevDecisionContainer->size() <<" previous decisions"); - - // Retrieve Jet Container - SG::ReadHandle< xAOD::JetContainer > jetContainerHandle = SG::makeHandle( m_jetsKey,context ); - ATH_MSG_DEBUG( "Retrieved jets from : " << m_jetsKey.key() ); - CHECK( jetContainerHandle.isValid() ); - - const xAOD::JetContainer *jetCollection = jetContainerHandle.get(); - ATH_MSG_DEBUG( "Found " << jetCollection->size()<< " jets." ); - for ( const xAOD::Jet *jet : * jetCollection ) - ATH_MSG_INFO(" -- Jet pt=" << jet->p4().Et() <<" eta="<< jet->eta() << " phi="<< jet->phi() ); - - // Prepare Output - std::unique_ptr< TrigCompositeUtils::DecisionContainer > decisions = std::make_unique< TrigCompositeUtils::DecisionContainer >(); - std::unique_ptr< TrigCompositeUtils::DecisionAuxContainer > aux = std::make_unique< TrigCompositeUtils::DecisionAuxContainer >(); - decisions->setStore( aux.get() ); - - - // Taken from Jet Code here - const TrigCompositeUtils::Decision *prevDecision = prevDecisionContainer->at(0); - TrigCompositeUtils::Decision *newDecision = TrigCompositeUtils::newDecisionIn( decisions.get() ); - - const TrigCompositeUtils::DecisionIDContainer previousDecisionIDs { - TrigCompositeUtils::decisionIDs( prevDecision ).begin(), - TrigCompositeUtils::decisionIDs( prevDecision ).end() - }; - - // Run decide method of hypo tools - /* - for ( const ToolHandle< TrigBjetEtHypoTool >& tool : m_hypoTools ) { - bool pass = false; - CHECK( tool->decide(jetCollection,pass) ); - ATH_MSG_INFO( "Event Passes ? " << (pass?"Y":"N") ); - } - */ - - // Decide (Hypo Tool) - for ( const ToolHandle< TrigBjetEtHypoTool >& tool : m_hypoTools ) { - const HLT::Identifier decisionId = tool->getId(); - if ( TrigCompositeUtils::passed( decisionId.numeric() , previousDecisionIDs ) ) { - bool pass = false; - CHECK( tool->decide( jetCollection,pass ) ); - if ( pass ) TrigCompositeUtils::addDecisionID( decisionId,newDecision ); - } - } - - - // Save Output - SG::WriteHandle< TrigCompositeUtils::DecisionContainer > handle = SG::makeHandle( decisionOutput(), context ); - CHECK( handle.record( std::move( decisions ), std::move( aux ) ) ); - ATH_MSG_DEBUG( "Exiting with " << handle->size() << " decisions" ); - - return StatusCode::SUCCESS; -} - - - - diff --git a/Trigger/TrigHypothesis/TrigBjetHypo/src/TrigBjetEtHypoAlg.h b/Trigger/TrigHypothesis/TrigBjetHypo/src/TrigBjetEtHypoAlg.h deleted file mode 100644 index c6055b92e045dfc0fe34d4fb5ce6d77287f08386..0000000000000000000000000000000000000000 --- a/Trigger/TrigHypothesis/TrigBjetHypo/src/TrigBjetEtHypoAlg.h +++ /dev/null @@ -1,48 +0,0 @@ -/* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration -*/ -#ifndef TRIGBJETHYPO_TRIGBJETETHYPOALG_H -#define TRIGBJETHYPO_TRIGBJETETHYPOALG_H 1 - -#include <string> - -#include "AthenaBaseComps/AthReentrantAlgorithm.h" -#include "TrigSteeringEvent/TrigRoiDescriptorCollection.h" -#include "DecisionHandling/TrigCompositeUtils.h" - -#include "xAODBTagging/BTaggingAuxContainer.h" -#include "xAODBTagging/BTaggingContainer.h" -#include "xAODBTagging/BTagging.h" - - -#include "TrigBjetEtHypoTool.h" -#include "DecisionHandling/HypoBase.h" - -/** - * @class Implements b-jet selection for the new HLT framework - * @brief - **/ - -class TrigBjetEtHypoAlg - : public ::HypoBase -{ - public: - - TrigBjetEtHypoAlg( const std::string& name, ISvcLocator* pSvcLocator ); - - virtual ~TrigBjetEtHypoAlg(); - - virtual StatusCode initialize() override; - virtual StatusCode execute_r( const EventContext& context ) const override; - virtual StatusCode finalize() override; - - private: - TrigBjetEtHypoAlg(); - ToolHandleArray< TrigBjetEtHypoTool > m_hypoTools {this,"HypoTools",{},"Hypo Tools"}; - - private: - SG::ReadHandleKey< xAOD::JetContainer > m_jetsKey {this,"Jets","Jets","Input Jet Container Key"}; - // SG::WriteHandleKey< TrigCompositeUtils::DecisionContainer > m_decisionsKey {this,"OutputDecisionsKey","BjetHypoDecisions","Output key for Btag Kypo Decisions"}; -}; - -#endif //> !TRIGBJETHYPO_TRIGBJETETHYPOALG_H diff --git a/Trigger/TrigHypothesis/TrigBjetHypo/src/TrigBjetEtHypoAlgMT.cxx b/Trigger/TrigHypothesis/TrigBjetHypo/src/TrigBjetEtHypoAlgMT.cxx new file mode 100644 index 0000000000000000000000000000000000000000..d3e7eb85e7f19ae9d30e3426a80e626272eb5f09 --- /dev/null +++ b/Trigger/TrigHypothesis/TrigBjetHypo/src/TrigBjetEtHypoAlgMT.cxx @@ -0,0 +1,236 @@ +/* + Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration +*/ + +#include "GaudiKernel/Property.h" +#include "TrigBjetEtHypoAlgMT.h" +#include "TrigSteeringEvent/PhiHelper.h" + +TrigBjetEtHypoAlgMT::TrigBjetEtHypoAlgMT( const std::string& name, + ISvcLocator* pSvcLocator ) : + ::HypoBase( name, pSvcLocator ) {} + +TrigBjetEtHypoAlgMT::~TrigBjetEtHypoAlgMT() +{} + +StatusCode TrigBjetEtHypoAlgMT::initialize() +{ + ATH_MSG_INFO ( "Initializing " << name() << "..." ); + + ATH_MSG_DEBUG( "declareProperty review:" ); + ATH_MSG_DEBUG( " " << m_jetsKey ); + ATH_MSG_DEBUG( " " << m_outputJetsKey ); + ATH_MSG_DEBUG( " " << m_imposeZconstraint); + ATH_MSG_DEBUG( " " << m_etaHalfWidth ); + ATH_MSG_DEBUG( " " << m_phiHalfWidth ); + ATH_MSG_DEBUG( " " << m_zHalfWidth ); + ATH_MSG_DEBUG( " " << m_minJetEt ); + ATH_MSG_DEBUG( " " << m_maxJetEta ); + + ATH_MSG_DEBUG( "Initializing Tools" ); + ATH_CHECK( m_hypoTools.retrieve() ); + + ATH_MSG_DEBUG( "Initializing HandleKeys" ); + CHECK( m_jetsKey.initialize() ); + CHECK( m_outputJetsKey.initialize() ); + CHECK( m_outputRoiKey.initialize() ); + // FOLLOWING WILL CHANGE -- JUST FOR TEMPORARY DEBUGGING + CHECK( m_trackParticleContainerKey.initialize() ); // TMP + CHECK( m_roiKey.initialize() ); // TMP + + return StatusCode::SUCCESS; +} + +StatusCode TrigBjetEtHypoAlgMT::finalize() { + return StatusCode::SUCCESS; +} + +StatusCode TrigBjetEtHypoAlgMT::execute_r( const EventContext& context ) const { + ATH_MSG_INFO ( "Executing " << name() << "..." ); + + // ========================================================================================================================== + // ** Retrieve Ingredients + // ========================================================================================================================== + + // Taken from Jet code + // Read in previous Decisions made before running this Hypo Alg. + // The container should have only one such Decision in case we are cutting on 'j' threshold (for L1) + SG::ReadHandle< TrigCompositeUtils::DecisionContainer > prevDecisionHandle = SG::makeHandle( decisionInput(),context ); + CHECK( prevDecisionHandle.isValid() ); + const TrigCompositeUtils::DecisionContainer *prevDecisionContainer = prevDecisionHandle.get(); + ATH_MSG_DEBUG( "Running with "<< prevDecisionContainer->size() <<" previous decisions"); + + // ============================================================= + // Just for debugging -- WILL BE REMOVED + + // Retrieve ROIs from RoIBuilder // TMP + SG::ReadHandle< TrigRoiDescriptorCollection > superRoiHandle = SG::makeHandle( m_roiKey,context ); // TMP + CHECK( superRoiHandle.isValid() ); // TMP + const TrigRoiDescriptorCollection *superRoi = superRoiHandle.get(); // TMP + ATH_MSG_DEBUG( "Retrieved Super RoI Container with size " << superRoi->size() ); // TMP + for ( auto *roi : *superRoi ) // TMP + ATH_MSG_DEBUG( " ** roi : eta=" << roi->eta() <<" phi="<< roi->phi() ); // TMP + + // Retrieve Track Particles // TMP + SG::ReadHandle< xAOD::TrackParticleContainer > recoTracksContainerHandle = SG::makeHandle( m_trackParticleContainerKey,context ); // TMP + CHECK( recoTracksContainerHandle.isValid() ); // TMP + const xAOD::TrackParticleContainer *recoTracksContainer = recoTracksContainerHandle.get(); // TMP + ATH_MSG_DEBUG( "Retrieved " << recoTracksContainer->size() << " Track Particles from FTF step" ); // TMP + for ( auto *particle : *recoTracksContainer ) // TMP + ATH_MSG_DEBUG( " ** pt=" << particle->p4().Et()<<" eta="<< particle->eta() <<" phi="<< particle->phi() ); // TMP + + // ============================================================= + + // Retrieve Jet Container ( Calo Jets ) + SG::ReadHandle< xAOD::JetContainer > jetContainerHandle = SG::makeHandle( m_jetsKey,context ); + ATH_MSG_DEBUG( "Retrieved jets from : " << m_jetsKey.key() ); + CHECK( jetContainerHandle.isValid() ); + + const xAOD::JetContainer *jetCollection = jetContainerHandle.get(); + ATH_MSG_DEBUG( "Found " << jetCollection->size()<< " jets." ); + for ( const xAOD::Jet *jet : * jetCollection ) + ATH_MSG_INFO(" -- Jet pt=" << jet->p4().Et() <<" eta="<< jet->eta() << " phi="<< jet->phi() ); + + // Retrieve Primary Vertex + // Right now vertexing is not available. Using dummy vertex at (0,0,0) // TMP + const Amg::Vector3D *primaryVertex = nullptr; // TMP + + if ( m_imposeZconstraint ) { + ATH_MSG_DEBUG( "Retrieving primary vertex." ); + // Here we should retrieve the primary vertex // TO-DO + primaryVertex = new Amg::Vector3D( 0,0,0 ); // TMP + // Add protection against failure during primary vertex retrieval. // TO-DO + ATH_MSG_DEBUG( " ** PV = (" << primaryVertex->x() << + "," << primaryVertex->y() << + "," << primaryVertex->z() << ")" ); + } + + + // ========================================================================================================================== + // ** Prepare Outputs + // ========================================================================================================================== + + // Prepare Output + // Output RoIs -- WILL CHANGE -- TMP + std::unique_ptr< TrigRoiDescriptorCollection > roiContainer( new TrigRoiDescriptorCollection() ); // TMP + + // Output Jet Collection + std::unique_ptr< xAOD::JetContainer > outputJets( new xAOD::JetContainer() ); + std::unique_ptr< xAOD::JetAuxContainer > outputJetsAux( new xAOD::JetAuxContainer() ); + outputJets->setStore( outputJetsAux.get() ); + + // Decisions + std::unique_ptr< TrigCompositeUtils::DecisionContainer > decisions = std::make_unique< TrigCompositeUtils::DecisionContainer >(); + std::unique_ptr< TrigCompositeUtils::DecisionAuxContainer > aux = std::make_unique< TrigCompositeUtils::DecisionAuxContainer >(); + decisions->setStore( aux.get() ); + + // ========================================================================================================================== + // ** Creating ShortList of Jet Container + // ========================================================================================================================== + + // Make a copy of the jet containers + for ( const xAOD::Jet *jet : *jetCollection ) { + // We select Jets above a specific eta and pt range + if ( jet->p4().Et() < m_minJetEt ) { + ATH_MSG_DEBUG( "** Jet below the " << m_minJetEt.value() << " GeV threshold; Et " << jet->p4().Et() <<"; Skipping this Jet." ); + continue; + } + if ( fabs( jet->eta() ) > m_maxJetEta ) { + ATH_MSG_DEBUG( "** Jet outside the |eta| < " << m_maxJetEta.value() << " requirement; Eta = " << jet->eta() << "; Skipping this Jet." ); + continue; + } + ATH_MSG_DEBUG( "** Jet :: Et " << jet->p4().Et() <<"; Eta " << jet->eta() << "; Phi " << jet->phi() ); + + // Protection in case there is not a Primary vertex but the Z contraint option is set to True + if ( m_imposeZconstraint && primaryVertex == nullptr ) { + // Not sure here what the best solution is. We can't change the m_imposeZconstraint value being const (and not thread safe) + ATH_MSG_ERROR( "Option for imposing Z constraint is set to True, but no primary vertex has been found." ); + return StatusCode::FAILURE; + } + + // Copy Jet + xAOD::Jet *toBeAdded = new xAOD::Jet(); + outputJets->push_back( toBeAdded ); + *toBeAdded = *jet; + + // Create RoI (we may require here PVz constraint) + double phiMinus = HLT::wrapPhi(jet->phi() - m_phiHalfWidth); + double phiPlus = HLT::wrapPhi(jet->phi() + m_phiHalfWidth); + + double etaMinus = jet->eta() - m_etaHalfWidth; + double etaPlus = jet->phi() + m_etaHalfWidth; + + // Impose Z matching (if enabled) + ATH_MSG_DEBUG( "Building RoI" ); + TrigRoiDescriptor *newRoI = nullptr; + if ( not m_imposeZconstraint ) { + newRoI = new TrigRoiDescriptor( jet->eta(),etaMinus, etaPlus, + jet->phi(), phiMinus, phiPlus ); + } else { + ATH_MSG_DEBUG( " ** Imposing Z constraint while building RoI" ); + double zMinus = primaryVertex->z() - m_zHalfWidth; + double zPlus = primaryVertex->z() + m_zHalfWidth; + + newRoI = new TrigRoiDescriptor( jet->eta(),etaMinus, etaPlus, + jet->phi(), phiMinus, phiPlus, + primaryVertex->z(),zMinus,zPlus ); + } + ATH_MSG_DEBUG( " -- RoI : eta=" << newRoI->eta() << " phi=" << newRoI->phi() ); + + // Put protection against nullpointer // TO-DO + roiContainer->push_back( newRoI ); + } + + // ========================================================================================================================== + // ** Compute Decisions + // ========================================================================================================================== + + // Taken from Jet Code here + const TrigCompositeUtils::Decision *prevDecision = prevDecisionContainer->at(0); + TrigCompositeUtils::Decision *newDecision = TrigCompositeUtils::newDecisionIn( decisions.get() ); + // Link Jet Collection to decision so that I can use it in the following b-jet trigger steps (?) + newDecision->setObjectLink( "SplitJets", ElementLink< xAOD::JetContainer >( m_jetsKey.key(),0 ) ); + ATH_MSG_DEBUG( "Linking 'SplitJets' to output decisions" ); + + const TrigCompositeUtils::DecisionIDContainer previousDecisionIDs { + TrigCompositeUtils::decisionIDs( prevDecision ).begin(), + TrigCompositeUtils::decisionIDs( prevDecision ).end() + }; + + // Decide (Hypo Tool) + for ( const ToolHandle< TrigBjetEtHypoTool >& tool : m_hypoTools ) { + const HLT::Identifier decisionId = tool->getId(); + // Check previous decision is 'passed' + if ( not TrigCompositeUtils::passed( decisionId.numeric() , previousDecisionIDs ) ) + continue; + bool pass = false; + CHECK( tool->decide( outputJets.get(),pass ) ); + // CHECK( tool->decide( jetCollection,pass ) ); + if ( pass ) TrigCompositeUtils::addDecisionID( decisionId,newDecision ); + } + + // ========================================================================================================================== + // ** Store Output + // ========================================================================================================================== + + // Save Output Decisions + SG::WriteHandle< TrigCompositeUtils::DecisionContainer > handle = SG::makeHandle( decisionOutput(), context ); + CHECK( handle.record( std::move( decisions ), std::move( aux ) ) ); + ATH_MSG_DEBUG( "Exiting with " << handle->size() << " decisions" ); + + // Save Output Jet Contaienr + SG::WriteHandle< xAOD::JetContainer > outputJetHandle = SG::makeHandle( m_outputJetsKey,context ); + ATH_MSG_DEBUG( "Saving jet collection " << m_outputJetsKey.key() << " with " << outputJets->size() << " elements " ); + CHECK( outputJetHandle.record( std::move( outputJets ), std::move( outputJetsAux ) ) ); + + // Output RoI Container -- WILL CHANGE -- TMP + SG::WriteHandle< TrigRoiDescriptorCollection > roiContainerHandle = SG::makeHandle( m_outputRoiKey,context ); // TMP + ATH_MSG_DEBUG( "Sabing roi collection " << m_outputRoiKey.key() << " with " << roiContainer->size() <<" elements " ); // TMP + CHECK( roiContainerHandle.record( std::move( roiContainer ) ) ); // TMP + + return StatusCode::SUCCESS; +} + + + + diff --git a/Trigger/TrigHypothesis/TrigBjetHypo/src/TrigBjetEtHypoAlgMT.h b/Trigger/TrigHypothesis/TrigBjetHypo/src/TrigBjetEtHypoAlgMT.h new file mode 100644 index 0000000000000000000000000000000000000000..95703e32afcb4824f1e9522536ca57f338d9fddb --- /dev/null +++ b/Trigger/TrigHypothesis/TrigBjetHypo/src/TrigBjetEtHypoAlgMT.h @@ -0,0 +1,62 @@ +/* + Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration +*/ +#ifndef TRIGBJETHYPO_TRIGBJETETHYPOALGMT_H +#define TRIGBJETHYPO_TRIGBJETETHYPOALGMT_H 1 + +#include <string> + +#include "AthenaBaseComps/AthReentrantAlgorithm.h" +#include "TrigSteeringEvent/TrigRoiDescriptorCollection.h" +#include "DecisionHandling/TrigCompositeUtils.h" + +#include "xAODJet/JetContainer.h" +#include "xAODJet/JetAuxContainer.h" + +#include "xAODTracking/VertexContainer.h" +#include "xAODTracking/VertexAuxContainer.h" + +#include "TrigBjetEtHypoTool.h" +#include "DecisionHandling/HypoBase.h" + +#include "TrigInDetEvent/TrigInDetTrackCollection.h" + +/** + * @class Implements b-jet selection for the new HLT framework + * @brief + **/ + +class TrigBjetEtHypoAlgMT : public ::HypoBase { + public: + + TrigBjetEtHypoAlgMT( const std::string& name, ISvcLocator* pSvcLocator ); + + virtual ~TrigBjetEtHypoAlgMT(); + + virtual StatusCode initialize() override; + virtual StatusCode execute_r( const EventContext& context ) const override; + virtual StatusCode finalize() override; + + private: + TrigBjetEtHypoAlgMT(); + ToolHandleArray< TrigBjetEtHypoTool > m_hypoTools {this,"HypoTools",{},"Hypo Tools"}; + + private: + // This part is taken from Jet Splitter + Gaudi::Property< bool > m_imposeZconstraint {this,"ImposeZconstraint",false,"Impose Constraint on PV z, thus selecting Jets pointing to PV"}; + Gaudi::Property< float > m_etaHalfWidth {this,"EtaHalfWidth",0.4,"Eta Half Width"}; + Gaudi::Property< float > m_phiHalfWidth {this,"PhiHalfWidth",0.4,"Phi Half Width"}; + Gaudi::Property< float > m_zHalfWidth {this,"ZHalfWidth",10.0,"Z Half Width in mm"}; + Gaudi::Property< float > m_minJetEt {this,"JetMinEt",15000,"Minimum of Output Jet Et in GeV"}; + Gaudi::Property< float > m_maxJetEta {this,"JetMaxEta",3.2,"Maximum eta acceptance of output Jet"}; + //=========== Handles + SG::ReadHandleKey< xAOD::JetContainer > m_jetsKey {this,"Jets","Jets","Input Jet Container Key"}; + SG::WriteHandleKey< xAOD::JetContainer > m_outputJetsKey {this,"OutputJets","SplitJets","Output Jet Container Key"}; + SG::WriteHandleKey< TrigRoiDescriptorCollection > m_outputRoiKey {this,"OutputRoi","SplitJet","Output RoI Container Key -- Same as OutputJets"}; + + // Just for checking I have reconstructed tracks and the roi for the super roi -- WILL CHANGE + SG::ReadHandleKey< xAOD::TrackParticleContainer > m_trackParticleContainerKey {this,"TrackParticleContainerKey","xAODTracks",""}; + SG::ReadHandleKey< TrigRoiDescriptorCollection > m_roiKey {this,"RoiKey","Undefined",""}; +}; + +#endif //> !TRIGBJETHYPO_TRIGBJETETHYPOALG_H diff --git a/Trigger/TrigHypothesis/TrigBjetHypo/src/TrigBjetEtHypoTool.cxx b/Trigger/TrigHypothesis/TrigBjetHypo/src/TrigBjetEtHypoTool.cxx index 802509964e7702a7e6486812d12db7ad22968ddf..6106eba6871404209a2a5ce590376ceea04e4034 100755 --- a/Trigger/TrigHypothesis/TrigBjetHypo/src/TrigBjetEtHypoTool.cxx +++ b/Trigger/TrigHypothesis/TrigBjetHypo/src/TrigBjetEtHypoTool.cxx @@ -42,7 +42,7 @@ StatusCode TrigBjetEtHypoTool::initialize() { // ----------------------------------------------------------------------------------------------------------------- -bool TrigBjetEtHypoTool::decide( const xAOD::JetContainer* jetCollection,bool &pass ) const { +StatusCode TrigBjetEtHypoTool::decide( const xAOD::JetContainer* jetCollection,bool &pass ) const { // Right now only considering single b-jet chains. // Will be revised with higher multeplicity @@ -84,7 +84,7 @@ bool TrigBjetEtHypoTool::decide( const xAOD::JetContainer* jetCollection,bool &p ATH_MSG_DEBUG( "REGTEST: Trigger decision is " << pass ); } - return true; + return StatusCode::SUCCESS; } diff --git a/Trigger/TrigHypothesis/TrigBjetHypo/src/TrigBjetEtHypoTool.h b/Trigger/TrigHypothesis/TrigBjetHypo/src/TrigBjetEtHypoTool.h index 937ffe9cc286c725632f5002735f8ab16fbff1da..61f9e4962796cec66c40ffe0c25c1361fb4b1909 100755 --- a/Trigger/TrigHypothesis/TrigBjetHypo/src/TrigBjetEtHypoTool.h +++ b/Trigger/TrigHypothesis/TrigBjetHypo/src/TrigBjetEtHypoTool.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration */ // ************************************************ @@ -50,7 +50,7 @@ class TrigBjetEtHypoTool : virtual public ::AthAlgTool { return m_id; } - bool decide( const xAOD::JetContainer*,bool& ) const; + StatusCode decide( const xAOD::JetContainer*,bool& ) const; private: HLT::Identifier m_id; @@ -63,7 +63,6 @@ class TrigBjetEtHypoTool : virtual public ::AthAlgTool { Gaudi::Property< float > m_etThreshold {this,"EtThreshold",0.0,"Et threshold cut"}; /** @brief DeclareProperty: Gsc threshold cut. */ Gaudi::Property< float > m_gscThreshold {this,"GscThreshold",0.0,"Gsc threshold cut"}; - }; inline const InterfaceID& TrigBjetEtHypoTool::interfaceID() diff --git a/Trigger/TrigHypothesis/TrigBjetHypo/src/TrigBjetHypoAlg.cxx b/Trigger/TrigHypothesis/TrigBjetHypo/src/TrigBjetHypoAlgMT.cxx similarity index 75% rename from Trigger/TrigHypothesis/TrigBjetHypo/src/TrigBjetHypoAlg.cxx rename to Trigger/TrigHypothesis/TrigBjetHypo/src/TrigBjetHypoAlgMT.cxx index cac4d7a2cc2fa2577a92956a8e4401f4ae06333f..3d67872b6d0274dcec3d49b8a3379fe7b56aa2b9 100644 --- a/Trigger/TrigHypothesis/TrigBjetHypo/src/TrigBjetHypoAlg.cxx +++ b/Trigger/TrigHypothesis/TrigBjetHypo/src/TrigBjetHypoAlgMT.cxx @@ -1,48 +1,57 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration */ #include "GaudiKernel/Property.h" -#include "TrigBjetHypoAlg.h" +#include "TrigBjetHypoAlgMT.h" using namespace TrigCompositeUtils; -TrigBjetHypoAlg::TrigBjetHypoAlg( const std::string& name, +TrigBjetHypoAlgMT::TrigBjetHypoAlgMT( const std::string& name, ISvcLocator* pSvcLocator ) : ::HypoBase( name, pSvcLocator ) {} -TrigBjetHypoAlg::~TrigBjetHypoAlg() +TrigBjetHypoAlgMT::~TrigBjetHypoAlgMT() {} -StatusCode TrigBjetHypoAlg::initialize() +StatusCode TrigBjetHypoAlgMT::initialize() { ATH_MSG_INFO ( "Initializing " << name() << "..." ); ATH_MSG_DEBUG( "Initializing Tools" ); ATH_CHECK( m_hypoTools.retrieve() ); - // ATH_CHECK( m_etHypoTools.retrieve() ); ATH_MSG_DEBUG( "Initializing HandleKeys" ); CHECK( m_bTagKey.initialize() ); CHECK( m_roisKey.initialize() ); + CHECK( m_jetKey.initialize() ); CHECK( m_decisionsKey.initialize() ); - ATH_MSG_INFO("Initializing TrigBjetHypoAlg"); + ATH_MSG_INFO("Initializing TrigBjetHypoAlgMT"); ATH_MSG_DEBUG( "declareProperty review:" ); ATH_MSG_DEBUG( " " << m_roisKey ); ATH_MSG_DEBUG( " " << m_bTagKey ); + ATH_MSG_DEBUG( " " << m_jetKey ); return StatusCode::SUCCESS; } -StatusCode TrigBjetHypoAlg::finalize() { +StatusCode TrigBjetHypoAlgMT::finalize() { return StatusCode::SUCCESS; } -StatusCode TrigBjetHypoAlg::execute_r( const EventContext& context ) const { +StatusCode TrigBjetHypoAlgMT::execute_r( const EventContext& context ) const { ATH_MSG_DEBUG ( "Executing " << name() << "..." ); + + SG::ReadHandle< TrigCompositeUtils::DecisionContainer > prevDecisionHandle = SG::makeHandle( decisionInput(),context ); + CHECK( prevDecisionHandle.isValid() ); + const TrigCompositeUtils::DecisionContainer *prevDecisionContainer = prevDecisionHandle.get(); + ATH_MSG_DEBUG( "Running with "<< prevDecisionContainer->size() <<" previous decisions"); + + return StatusCode::SUCCESS; + SG::ReadHandle< xAOD::BTaggingContainer > bTagHandle = SG::makeHandle( m_bTagKey, context ); SG::ReadHandle< TrigRoiDescriptorCollection > roisHandle = SG::makeHandle( m_roisKey, context ); diff --git a/Trigger/TrigHypothesis/TrigBjetHypo/src/TrigBjetHypoAlg.h b/Trigger/TrigHypothesis/TrigBjetHypo/src/TrigBjetHypoAlgMT.h similarity index 67% rename from Trigger/TrigHypothesis/TrigBjetHypo/src/TrigBjetHypoAlg.h rename to Trigger/TrigHypothesis/TrigBjetHypo/src/TrigBjetHypoAlgMT.h index 4d69560293455f98583c9eb44c51ba7fdb55ec69..a4d71f886a8ed5dced9a8bf6dce19a1b71b9aafc 100644 --- a/Trigger/TrigHypothesis/TrigBjetHypo/src/TrigBjetHypoAlg.h +++ b/Trigger/TrigHypothesis/TrigBjetHypo/src/TrigBjetHypoAlgMT.h @@ -1,8 +1,8 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration */ -#ifndef TRIGBJETHYPO_TRIGBJETHYPOALG_H -#define TRIGBJETHYPO_TRIGBJETHYPOALG_H 1 +#ifndef TRIGBJETHYPO_TRIGBJETHYPOALGMT_H +#define TRIGBJETHYPO_TRIGBJETHYPOALGMT_H 1 #include <string> @@ -10,6 +10,9 @@ #include "TrigSteeringEvent/TrigRoiDescriptorCollection.h" #include "DecisionHandling/TrigCompositeUtils.h" +#include "xAODJet/JetContainer.h" +#include "xAODJet/JetAuxContainer.h" + #include "xAODBTagging/BTaggingAuxContainer.h" #include "xAODBTagging/BTaggingContainer.h" #include "xAODBTagging/BTagging.h" @@ -23,28 +26,28 @@ * @brief **/ -class TrigBjetHypoAlg - : public ::HypoBase -{ +class TrigBjetHypoAlgMT : public ::HypoBase { public: - TrigBjetHypoAlg( const std::string& name, ISvcLocator* pSvcLocator ); + TrigBjetHypoAlgMT( const std::string& name, ISvcLocator* pSvcLocator ); - virtual ~TrigBjetHypoAlg(); + virtual ~TrigBjetHypoAlgMT(); virtual StatusCode initialize() override; virtual StatusCode execute_r( const EventContext& context ) const override; virtual StatusCode finalize() override; private: - TrigBjetHypoAlg(); + TrigBjetHypoAlgMT(); ToolHandleArray< TrigBjetHypoTool > m_hypoTools {this,"HypoTools",{},"Hypo Tools"}; private: + SG::ReadHandleKey< xAOD::JetContainer > m_jetKey {this,"Jets","SplitJet","Input Jet Collection"}; + SG::ReadHandleKey< TrigRoiDescriptorCollection > m_roisKey {this,"RoIsKey","RoIs","Key for RoIs"}; SG::ReadHandleKey< xAOD::BTaggingContainer> m_bTagKey {this,"BTaggingKey","BTagging","Key for BTagging"}; SG::WriteHandleKey< TrigCompositeUtils::DecisionContainer > m_decisionsKey {this,"DecisionsKey","BjetHypoDecisions","Output key for Btag Kypo Decisions"}; }; -#endif //> !TRIGBJETHYPO_TRIGBJETHYPOALG_H +#endif //> !TRIGBJETHYPO_TRIGBJETHYPOALGMT_H diff --git a/Trigger/TrigHypothesis/TrigBjetHypo/src/TrigBjetHypoTool.cxx b/Trigger/TrigHypothesis/TrigBjetHypo/src/TrigBjetHypoTool.cxx index 7d662f4998372776b4d3d34f52ac8c64095c872d..912209de98e63cd067e7122ea78a0986b3d7a0ca 100755 --- a/Trigger/TrigHypothesis/TrigBjetHypo/src/TrigBjetHypoTool.cxx +++ b/Trigger/TrigHypothesis/TrigBjetHypo/src/TrigBjetHypoTool.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration */ // ************************************************ @@ -7,8 +7,8 @@ // NAME: TrigBjetHypoTool.cxx // PACKAGE: Trigger/TrigHypothesis/TrigBjetHypoTool // -// AUTHOR: Lidija Zivkovic -// EMAIL: Lidija.Zivkovic@cern.ch +// AUTHOR: Carlo Varni +// EMAIL: carlo.varni@cern.ch // // ************************************************ diff --git a/Trigger/TrigHypothesis/TrigBjetHypo/src/TrigBjetHypoTool.h b/Trigger/TrigHypothesis/TrigBjetHypo/src/TrigBjetHypoTool.h index fdae3d1101f96f51fe4ba6b09641c906e5880390..550a64e002a1db69243882adc29e735612f6d48d 100755 --- a/Trigger/TrigHypothesis/TrigBjetHypo/src/TrigBjetHypoTool.h +++ b/Trigger/TrigHypothesis/TrigBjetHypo/src/TrigBjetHypoTool.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration */ // ************************************************ @@ -7,8 +7,8 @@ // NAME: TrigBjetHypoTool.h // PACKAGE: Trigger/TrigHypothesis/TrigBjetHypo // -// AUTHOR: Lidija Zivkovic -// EMAIL: Lidija.Zivkovic@ge.infn.it +// AUTHOR: Carlo Varni +// EMAIL: carlo.varni@cern.ch // // ************************************************ diff --git a/Trigger/TrigHypothesis/TrigBjetHypo/src/TrigBtagFexMT.cxx b/Trigger/TrigHypothesis/TrigBjetHypo/src/TrigBtagFexMT.cxx index 996892ce8d9d505014f718066cbb880c49ec8de7..b3224a833b8849aa2a84bef860a19dcc4a131085 100755 --- a/Trigger/TrigHypothesis/TrigBjetHypo/src/TrigBtagFexMT.cxx +++ b/Trigger/TrigHypothesis/TrigBjetHypo/src/TrigBtagFexMT.cxx @@ -99,6 +99,11 @@ StatusCode TrigBtagFexMT::initialize() { StatusCode TrigBtagFexMT::execute() { ATH_MSG_DEBUG( "Executing TrigBtagFexMT" ); + return StatusCode::SUCCESS; + + // Commenting everything here while waiting for b-taggging to be ready. + // This needs to be rewritten. + /* // RETRIEVE INPUT CONTAINERS const EventContext& ctx = getContext(); SG::ReadHandle< xAOD::JetContainer > jetContainerHandle = SG::makeHandle( m_JetContainerKey,ctx ); @@ -111,7 +116,7 @@ StatusCode TrigBtagFexMT::execute() { // const xAOD::Vertex* primaryVertex = nullptr; bool usePVBackup = true; - + */ /* if (getFeature(outputTE, vertexes, m_priVtxKey) == HLT::OK && vertexes != nullptr) { ATH_MSG_DEBUG( "INPUT - xAOD::VertexContainer: " << m_priVtxKey << " has nVertexes = " << vertexes->size() ); @@ -135,7 +140,7 @@ StatusCode TrigBtagFexMT::execute() { } } */ - + /* if ( usePVBackup ) { ATH_MSG_INFO( "INPUT - xAOD::VertexContainer: NO valid vertex found in " << m_BackUpVertexContainerKey << " - aborting..." ); return StatusCode::FAILURE; @@ -161,10 +166,10 @@ StatusCode TrigBtagFexMT::execute() { std::unique_ptr< xAOD::BTaggingContainer > trigBTaggingContainer( new xAOD::BTaggingContainer() ); std::unique_ptr< xAOD::BTaggingAuxContainer > trigBTaggingAuxContainer( new xAOD::BTaggingAuxContainer() ); trigBTaggingContainer->setStore( trigBTaggingAuxContainer.get() ); - + xAOD::BTagging *trigBTagging = new xAOD::BTagging(); trigBTaggingContainer->push_back(trigBTagging); - + */ // EXECUTE OFFLINE TOOLS if ( m_setupOfflineTools == true ) { /* @@ -205,14 +210,14 @@ StatusCode TrigBtagFexMT::execute() { } */ } - + /* // Dump results ATH_MSG_DEBUG( "IP2D u/b: " << trigBTagging->IP2D_pu() << "/" << trigBTagging->IP2D_pb() << " IP3D u/b: " << trigBTagging->IP3D_pu() << "/" << trigBTagging->IP3D_pb() << " SV1 u/b: " << trigBTagging->SV1_pu() << "/" << trigBTagging->SV1_pb() << " MV2c20 var: " << trigBTagging->auxdata<double>("MV2c20_discriminant") << " MV2c10 var: " << trigBTagging->auxdata<double>("MV2c10_discriminant") ); - + */ // ATTACH FEATURES AND CLEAR TEMPORARY OBJECTS // Temporary comment these lines @@ -226,7 +231,7 @@ StatusCode TrigBtagFexMT::execute() { } } */ - + /* SG::WriteHandle< xAOD::BTaggingContainer > outputBTaggingContainerHandle = SG::makeHandle( m_outputBTaggingContainerKey,ctx ); ATH_CHECK( outputBTaggingContainerHandle.record( std::move(trigBTaggingContainer),std::move(trigBTaggingAuxContainer) ) ); @@ -235,7 +240,7 @@ StatusCode TrigBtagFexMT::execute() { SG::WriteHandle< xAOD::BTagVertexContainer > outputBtagVtxContainerHandle = SG::makeHandle( m_outputBtagVertexContainerKey,ctx ); ATH_CHECK( outputBtagVtxContainerHandle.record( std::move(trigBTagVertexContainer),std::move(trigBTagSecVertexAuxContainer) ) ); - + */ return StatusCode::SUCCESS; } diff --git a/Trigger/TrigHypothesis/TrigBjetHypo/src/TrigGSCFexMT.h b/Trigger/TrigHypothesis/TrigBjetHypo/src/TrigGSCFexMT.h index 01fc0f4823b827ed70f3d7a8f22365f2d2bc79b9..1d5da487f06bfd3afee9a319136fde9ad3fcb876 100644 --- a/Trigger/TrigHypothesis/TrigBjetHypo/src/TrigGSCFexMT.h +++ b/Trigger/TrigHypothesis/TrigBjetHypo/src/TrigGSCFexMT.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration */ // ************************************************ diff --git a/Trigger/TrigHypothesis/TrigBjetHypo/src/TrigRoiBuilderMT.cxx b/Trigger/TrigHypothesis/TrigBjetHypo/src/TrigRoiBuilderMT.cxx new file mode 100755 index 0000000000000000000000000000000000000000..4395e16519bb7ddadaef42fe3a136d45b7d5afff --- /dev/null +++ b/Trigger/TrigHypothesis/TrigBjetHypo/src/TrigRoiBuilderMT.cxx @@ -0,0 +1,146 @@ +// emacs: this is -*- c++ -*- + +/* + Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration +*/ + +// +// @file TrigRoiBuilderMT.cxx +// +// Creates a ROI from a jet collection +// + + +#include "src/TrigRoiBuilderMT.h" +#include "TrigSteeringEvent/PhiHelper.h" + +//** ----------------------------------------------------------------------------------------------------------------- **// + +TrigRoiBuilderMT::TrigRoiBuilderMT(const std::string & name, ISvcLocator* pSvcLocator) : + AthAlgorithm(name, pSvcLocator) {} + +//** ----------------------------------------------------------------------------------------------------------------- **// + + +StatusCode TrigRoiBuilderMT::initialize() { + ATH_MSG_INFO( "Initializing " << name() << " ... " ); + + ATH_MSG_DEBUG( "declareProperty review:" ); + ATH_MSG_DEBUG( " " << m_etaHalfWidth ); + ATH_MSG_DEBUG( " " << m_phiHalfWidth ); + ATH_MSG_DEBUG( " " << m_minJetEt ); + ATH_MSG_DEBUG( " " << m_maxJetEta ); + ATH_MSG_DEBUG( " " << m_nJetsMax ); + ATH_MSG_DEBUG( " " << m_dynamicMinJetEt ); + ATH_MSG_DEBUG( " " << m_dynamicNJetsMax ); + ATH_MSG_DEBUG( " " << m_dynamicEtFactor ); + + ATH_MSG_DEBUG( "Initialising HandleKeys" ); + CHECK( m_jetInputKey.initialize() ); + CHECK( m_roIOutputKey.initialize() ); + + return StatusCode::SUCCESS; +} + + +//** ----------------------------------------------------------------------------------------------------------------- **// + + +TrigRoiBuilderMT::~TrigRoiBuilderMT(){} + + +//** ----------------------------------------------------------------------------------------------------------------- **// + + +StatusCode TrigRoiBuilderMT::execute() { + + ATH_MSG_DEBUG( "Running "<< name() <<" ... " ); + const EventContext& ctx = getContext(); + + // Sanity check that we're not running two optimisations at the same time + // can be removed once a default method is decided upon + if (m_nJetsMax > 0 && m_dynamicMinJetEt) { + ATH_MSG_WARNING( "Two incompatible CPU optimisation methods chosen (DynamicMinJetEt and NJetsMax). Switching off DynamicMinJetEt." ); + m_dynamicMinJetEt = false; + } + + // Prepare Outputs + std::unique_ptr< TrigRoiDescriptorCollection > roICollection( new TrigRoiDescriptorCollection() ); + + // Retrieve Input Jets + SG::ReadHandle< xAOD::JetContainer > jetContainerHandle = SG::makeHandle( m_jetInputKey,ctx ); + CHECK( jetContainerHandle.isValid() ); + const xAOD::JetContainer *jetContainer = jetContainerHandle.get(); + ATH_MSG_DEBUG( "Found " << jetContainer->size() << " jets, creating corresponding RoIs ... " ); + + // Run on Input Jets + int i = 0; + for ( const xAOD::Jet *jet : *jetContainer ) { + i++; + + float jetEt = jet->p4().Et(); + float jetEta = jet->eta(); + float jetPhi = jet->phi(); + + if (jetEt < m_minJetEt) { + ATH_MSG_DEBUG( "Jet " << i << " below the " << m_minJetEt << " GeV threshold; Et " << jetEt << "; skipping this jet." ); + continue; + } + + if (fabs(jetEta) > m_maxJetEta) { + ATH_MSG_DEBUG( "Jet " << i << " outside the |eta| < " << m_maxJetEta << " requirement; Eta = " << jetEta << "; skipping this jet." ); + continue; + } + + // For high pile-up situations, raise the pT threshold of the jets considered after checking the first N (=m_dynamicNJetsMax) jets + if (m_dynamicMinJetEt && i > m_dynamicNJetsMax ) { + float dynamicMinJetEt = m_minJetEt + ((i - m_dynamicNJetsMax) * m_dynamicEtFactor); + if (jetEt < dynamicMinJetEt) { + ATH_MSG_DEBUG( "Jet "<< i << " below the dynamic " << dynamicMinJetEt << " GeV ( = " + << m_minJetEt << " + (" << i << " - " << m_dynamicNJetsMax << ") * " << m_dynamicEtFactor << ")" + << " threshold; Et " << jetEt << "; skipping this jet." ); + continue; + } + } + + if (m_nJetsMax > 0 && i > m_nJetsMax) { + ATH_MSG_DEBUG( "Maximum allowed jet multiplicity = "<< m_nJetsMax << "; skipping jet " << i << "." ); + continue; + } + + ATH_MSG_DEBUG( "Jet "<< i << "; Et " << jetEt << "; eta "<< jetEta << "; phi " << jetPhi ); + + ATH_MSG_DEBUG( "Creating RoI corresponding to Jet" ); + // create RoI correspondinding to the jet + double phiMinus = HLT::wrapPhi(jetPhi-m_phiHalfWidth); + double phiPlus = HLT::wrapPhi(jetPhi+m_phiHalfWidth); + double etaMinus = jetEta-m_etaHalfWidth; + double etaPlus = jetEta+m_etaHalfWidth; + + TrigRoiDescriptor* roi = new TrigRoiDescriptor(jetEta, etaMinus, etaPlus, + jetPhi, phiMinus, phiPlus ); + + ATH_MSG_DEBUG( "Adding ROI descriptor ROI collection !" ); + ATH_MSG_DEBUG( " ** roi : eta=" << roi->eta() <<" phi=" << roi->phi() ); + roICollection->push_back( roi ); + } + + // Save Outputs + ATH_MSG_DEBUG( "Saving RoIs to be used as input to Fast Tracking -- TO BE CHANGED -- ::: " << m_roIOutputKey.key() ); + SG::WriteHandle< TrigRoiDescriptorCollection > outputRoiHandle = SG::makeHandle( m_roIOutputKey,ctx ); + CHECK( outputRoiHandle.record( std::move( roICollection ) ) ); + + return StatusCode::SUCCESS; +} + + +//** ----------------------------------------------------------------------------------------------------------------- **// + + +StatusCode TrigRoiBuilderMT::finalize() { + ATH_MSG_INFO( "Finalizing " << name() << " ... " ); + return StatusCode::SUCCESS; +} + + + diff --git a/Trigger/TrigHypothesis/TrigBjetHypo/src/TrigRoiBuilderMT.h b/Trigger/TrigHypothesis/TrigBjetHypo/src/TrigRoiBuilderMT.h new file mode 100755 index 0000000000000000000000000000000000000000..a43a9f0b01d8c7b344c2436499c99caaf5c1a185 --- /dev/null +++ b/Trigger/TrigHypothesis/TrigBjetHypo/src/TrigRoiBuilderMT.h @@ -0,0 +1,51 @@ +// emacs: this is -*- c++ -*- +/* + Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration +*/ +// +// @file TrigRoiBuilderMT.h +// + + +#ifndef TRIGROIBUILDER_MT_H +#define TRIGROIBUILDER_MT_H + +#include <iostream> + +#include "AthenaBaseComps/AthAlgorithm.h" +#include "GaudiKernel/ToolHandle.h" + +#include "xAODJet/JetContainer.h" +#include "xAODJet/JetAuxContainer.h" + +#include "TrigSteeringEvent/TrigRoiDescriptor.h" + +class TrigRoiBuilderMT : public AthAlgorithm { + + public: + TrigRoiBuilderMT(const std::string&, ISvcLocator*); + ~TrigRoiBuilderMT(); + + StatusCode initialize(); + StatusCode finalize(); + StatusCode execute(); + + private: + Gaudi::Property< float > m_etaHalfWidth {this,"EtaHalfWidth",0.1,"Eta Half Width"}; + Gaudi::Property< float > m_phiHalfWidth {this,"PhiHalfWidth",0.1,"Phi Half Width"}; + Gaudi::Property< float > m_minJetEt {this,"JetMinEt",30.0,"Jet Min Et"}; + Gaudi::Property< float > m_maxJetEta {this,"JetMaxEta",2.6,"Jet Max Eta : 2.5 + Eta Half Width"}; + Gaudi::Property< int > m_nJetsMax {this,"NJetsMax",-1,"Option to limit the number of jets that form the super RoI "}; + Gaudi::Property< bool > m_dynamicMinJetEt {this,"DynamicMinJetEt",false,"if (X > -1 && nJets > X) minJetEt = m_minJetEt + (nJets-X)*Y "}; + Gaudi::Property< int > m_dynamicNJetsMax {this,"DynamicNJetsMax",9999,"variable X above"}; + Gaudi::Property< float > m_dynamicEtFactor {this,"DynamicEtFactor",0,"variable Y above "}; + + SG::ReadHandleKey< xAOD::JetContainer > m_jetInputKey {this,"JetInputKey","TrigJetRec","Input Jet Collection Key, retrieved from reconstructed jets"}; + SG::WriteHandleKey< TrigRoiDescriptorCollection > m_roIOutputKey {this,"RoIOutputKey","EMViewRoIs","Output RoI Collection Key"}; +}; + + +#endif + +//** --------------------------------------------------------------------------------------- + diff --git a/Trigger/TrigHypothesis/TrigBjetHypo/src/components/TrigBjetHypo_entries.cxx b/Trigger/TrigHypothesis/TrigBjetHypo/src/components/TrigBjetHypo_entries.cxx index adbdde59cbfa747b8d178fd8ba4445a2059e5a98..a3e201a4f72e6a8cc75c31df4070e479dfce8fcf 100644 --- a/Trigger/TrigHypothesis/TrigBjetHypo/src/components/TrigBjetHypo_entries.cxx +++ b/Trigger/TrigHypothesis/TrigBjetHypo/src/components/TrigBjetHypo_entries.cxx @@ -10,12 +10,13 @@ #include "TrigBjetHypo/TrigBjetEtHypo.h" #include "TrigBjetHypo/TrigFarawayJetFinderAllTE.h" -#include "../TrigBjetHypoAlg.h" +#include "../TrigBjetHypoAlgMT.h" #include "../TrigBjetHypoTool.h" -#include "../TrigBjetEtHypoAlg.h" +#include "../TrigBjetEtHypoAlgMT.h" #include "../TrigBjetEtHypoTool.h" -#include "..//TrigGSCFexMT.h" +#include "../TrigGSCFexMT.h" #include "../TrigBtagFexMT.h" +#include "../TrigRoiBuilderMT.h" DECLARE_COMPONENT( TrigBjetHypo ) DECLARE_COMPONENT( TrigBjetFex ) @@ -29,9 +30,10 @@ DECLARE_COMPONENT( TrigSuperRoiBuilderAllTE ) DECLARE_COMPONENT( TrigBjetEtHypo ) DECLARE_COMPONENT( TrigFarawayJetFinderAllTE ) -DECLARE_COMPONENT( TrigBjetHypoAlg ) +DECLARE_COMPONENT( TrigBjetHypoAlgMT ) DECLARE_COMPONENT( TrigBjetHypoTool ) -DECLARE_COMPONENT( TrigBjetEtHypoAlg ) +DECLARE_COMPONENT( TrigBjetEtHypoAlgMT ) DECLARE_COMPONENT( TrigBjetEtHypoTool ) DECLARE_COMPONENT( TrigGSCFexMT ) DECLARE_COMPONENT( TrigBtagFexMT ) +DECLARE_COMPONENT( TrigRoiBuilderMT ) diff --git a/Trigger/TrigHypothesis/TrigHLTJetHypo/python/JetCleanMonitoring.py b/Trigger/TrigHypothesis/TrigHLTJetHypo/python/JetCleanMonitoring.py index ef09ca95a91f4045cf4fe5f01f582abd61185f63..8c3975a10cf884f0607143a745c5391eaf7458e4 100644 --- a/Trigger/TrigHypothesis/TrigHLTJetHypo/python/JetCleanMonitoring.py +++ b/Trigger/TrigHypothesis/TrigHLTJetHypo/python/JetCleanMonitoring.py @@ -80,59 +80,48 @@ JetChainsToKeepMonitoring={ #'j30_L1J5_VZDC_A', #'j30_L1J5_VZDC_C', #'j30_0eta490_L1TE20_VZDC_A', -#'j30_0eta490_L1TE20_VZDC_C', -#'j30_ion_L1TE10', -#'j30_ion_0eta490_L1TE10', -#'j30_ion_L1TE20', -#'j30_ion_0eta490_L1TE20', -#'j30_L1TE10', -#'j30_0eta490_L1TE10', -#'j30_L1TE20', -#'j30_0eta490_L1TE20', -#'j45_320eta490_ion', -#'j45_320eta490', -#'j45_ion_320eta490_2j20_ion_0eta490', -#'j45_ion_320eta490_3j20_ion_0eta490', -#'j45_ion_320eta490_4j20_ion_0eta490', -#'j45_320eta490_2j20_0eta490', -#'j45_320eta490_3j20_0eta490', -#'j45_320eta490_4j20_0eta490', -#'j50_ion_L1J10', -#'j50_ion_L1J15', -#'j50_L1J10', -#'j50_L1J15', -#'j50_ion_2j20_ion_0eta490_L1J10', -#'j50_ion_2j30_ion_0eta490_L1J10', -#'j50_ion_3j20_ion_0eta490_L1J10', -#'j50_ion_3j30_ion_0eta490_L1J10', -#'j50_ion_4j20_ion_0eta490_L1J10', -#'j50_ion_4j30_ion_0eta490_L1J10', -#'j50_2j20_0eta490_L1J10', -#'j50_2j30_0eta490_L1J10', -#'j50_3j20_0eta490_L1J10', -#'j50_3j30_0eta490_L1J10', -#'j50_4j20_0eta490_L1J10', -#'j50_4j30_0eta490_L1J10', -#'j75_ion_L1J20', -#'j75_L1J20', -#'j75_ion_2j20_ion_0eta490_L1J20', -#'j75_ion_2j30_ion_0eta490_L1J20', -#'j75_ion_3j20_ion_0eta490_L1J20', -#'j75_ion_3j30_ion_0eta490_L1J20', -#'j75_ion_4j20_ion_0eta490_L1J20', -#'j75_ion_4j30_ion_0eta490_L1J20', -#'j75_2j20_0eta490_L1J20', -#'j75_2j30_0eta490_L1J20', -#'j75_3j20_0eta490_L1J20', -#'j75_3j30_0eta490_L1J20', -#'j75_4j20_0eta490_L1J20', -#'j75_4j30_0eta490_L1J20', -#'j85', -#'j85_ion_L1J20', -#'j100_L1J20', -#'j100_L1J30', -#'j100_ion_L1J20', -#'j100_ion_L1J30', -#'j150_ion_L1J30', -#'j150_L1J30', +#'j30_0eta490_L1TE20_VZDCC', +#HI Section +"j50_ion_L1J12", +"j50_ion_L1TE20", +"j50_ion_L1TE50", +"j50_ion_L1ZDC_A_C", +"j100_ion_2j50_ion_L1TE50", +"j100_ion_2j50_ion_L1J12", +"mu4_j50_ion_dr05", +"mu6_j50_ion_dr05", +"mu4_j50_ion", +"mu6_j50_ion", +"j60_ion_L1J15", +"j60_ion_L1J20", +"j60_ion_L1TE50", +"j60_ion_L1ZDC_A_C", +"j60_ion_2j30_ion_L1TE50", +"j60_ion_2j30_ion_L1J12", +"mu4_j60_ion_dr05", +"mu4_j60_ion", +"j75_ion_L1J20", +"j75_ion_L1J30", +"j75_ion_L1TE50", +"j75_ion_L1ZDC_A_C", +"j75_ion_2j30_ion_L1TE50", +"j75_ion_2j40_ion_L1TE50", +"j75_ion_2j30_ion_L1J12", +"j75_ion_2j40_ion_L1J12", +"conej75_320eta490_larpebj",#Not sure this is needed? Just to be safe. +"j85_ion_L1J20", +"j85_ion_L1J30", +"j85_ion_L1TE50", +"j110_ion_L1J30", +"j110_ion_L1J50", +"j120_ion_L1J30", +"j120_ion_L1J50", +"j150_ion_L1J30", +"j150_ion_L1J50", +"j150_ion_L1TE50", +"j50_320eta490_ion", +"j50_320eta490_ion_L1TE50", +"j50_320eta490_ion", +"j60_320eta490_ion", +"j70_320eta490_ion" } diff --git a/Trigger/TrigHypothesis/TrigMuonHypo/python/TrigMuonHypoConfig.py b/Trigger/TrigHypothesis/TrigMuonHypo/python/TrigMuonHypoConfig.py index ceb0af2e884decc333a48e9c053f59aaa162c180..6326d5e1fb4d56986cc0b81c8426b610428c793f 100755 --- a/Trigger/TrigHypothesis/TrigMuonHypo/python/TrigMuonHypoConfig.py +++ b/Trigger/TrigHypothesis/TrigMuonHypo/python/TrigMuonHypoConfig.py @@ -276,6 +276,7 @@ muFastThresholds = { '40GeV_uptoEC2_v11b' : [ [0,1.05,1.5,2.0,9.9], [ 26.88, 26.54, 29.22, 1000.] ], '40GeV_barrelOnly_v11b' : [ [0,1.05,1.5,2.0,9.9], [ 26.88, 1000., 1000., 1000.] ], # 2011a tuning + 2015 tuning + '3GeV_v15a' : [ [0,1.05,1.5,2.0,9.9], [ 2.38, 0.25, 2.17, 2.41] ], #extrapolated from 4GeV '4GeV_v15a' : [ [0,1.05,1.5,2.0,9.9], [ 3.38, 1.25, 3.17, 3.41] ], '4GeV_barrelOnly_v15a' : [ [0,1.05,1.5,2.0,9.9], [ 3.38, 1000., 1000., 1000.] ], '6GeV_v15a' : [ [0,1.05,1.5,2.0,9.9], [ 5.17, 3.25, 4.69, 5.14] ], @@ -362,6 +363,7 @@ muFastThresholdsForECWeakBRegion = { '50GeV_barrelOnly_v11b' : [ 1000., 1000. ], '60GeV_barrelOnly_v11b' : [ 1000., 1000. ], # 2011a tuning + 2015 tuning + '3GeV_v15a' : [ 1.72, 0.58], #extrapolated from 4GeV '4GeV_v15a' : [ 2.72, 1.58], '4GeV_barrelOnly_v15a' : [ 1000., 1000. ], '6GeV_v15a' : [ 3.91, 2.22], diff --git a/Trigger/TrigHypothesis/TrigMuonHypo/python/TrigMuonHypoMonitoringMT.py b/Trigger/TrigHypothesis/TrigMuonHypo/python/TrigMuonHypoMonitoringMT.py index 46deabea2cadbd7afa8b84aae858a062522ab958..16301782450ae8206a51dbf6bad74e33ef6333cb 100755 --- a/Trigger/TrigHypothesis/TrigMuonHypo/python/TrigMuonHypoMonitoringMT.py +++ b/Trigger/TrigHypothesis/TrigMuonHypo/python/TrigMuonHypoMonitoringMT.py @@ -73,7 +73,7 @@ class TrigMuonEFMSonlyHypoMonitoring(GenericMonitoringTool): class TrigMuonEFCombinerHypoMonitoring(GenericMonitoringTool): def __init__ (self, name="TrigMuonEFCombinerHypoMonitoring"): - super(TrigMuonEFMSonlyHypoMonitoring, self).__init__(name) + super(TrigMuonEFCombinerHypoMonitoring, self).__init__(name) self.HistPath = name self.Histograms = [ defineHistogram('Pt', type='TH1F', title="P_{T} reconstruction from #TrigMuonEFCombinerHypo; P_{T} (MeV)", diff --git a/Trigger/TrigMonitoring/TrigBjetMonitoring/python/TrigBjetMonitoringConfig.py b/Trigger/TrigMonitoring/TrigBjetMonitoring/python/TrigBjetMonitoringConfig.py index f9117d0892e9e4d108fd31cbad71daffe25f36b3..4d7817e832b809d6ce7968d23882a15408b0e856 100644 --- a/Trigger/TrigMonitoring/TrigBjetMonitoring/python/TrigBjetMonitoringConfig.py +++ b/Trigger/TrigMonitoring/TrigBjetMonitoring/python/TrigBjetMonitoringConfig.py @@ -14,9 +14,9 @@ def TrigBjetMonitoringConfig(): HLTBjetMon.monitoring_bjet = hltmonList.monitoring_bjet - from AthenaCommon.AppMgr import ToolSvc - ToolSvc += HLTBjetMon; - list = [ "HLTBjetMonTool/HLTBjetMon" ]; + #from AthenaCommon.AppMgr import ToolSvc + #ToolSvc += HLTBjetMon; + list = [ HLTBjetMon ]; return list diff --git a/Trigger/TrigMonitoring/TrigBjetMonitoring/src/HLTBjetMonTool.cxx b/Trigger/TrigMonitoring/TrigBjetMonitoring/src/HLTBjetMonTool.cxx index 2ad1b4b57f109bceff769f25bfc288cb8af980f9..e1be1ca2ce3e8ef9800771f4d165e4dacc9fafb6 100755 --- a/Trigger/TrigMonitoring/TrigBjetMonitoring/src/HLTBjetMonTool.cxx +++ b/Trigger/TrigMonitoring/TrigBjetMonitoring/src/HLTBjetMonTool.cxx @@ -236,6 +236,7 @@ StatusCode HLTBjetMonTool::book(){ ATH_MSG_INFO(" Chain Name sizes - Bjet: " << size_TriggerChainBjet << " MuJet: " << size_TriggerChainMujet ); if ( (size_TriggerChainBjet+size_TriggerChainMujet) <= 0) { ATH_MSG_INFO( " No trigger chain is configured for this run ==> Stop monitoring " ); + // Not really a failure return StatusCode::FAILURE; } for (int i =0; i<size_TriggerChainBjet; i++){ diff --git a/Trigger/TrigMonitoring/TrigBphysMonitoring/python/TrigBphysMonitoringConfig.py b/Trigger/TrigMonitoring/TrigBphysMonitoring/python/TrigBphysMonitoringConfig.py index 71f0f16c529ce61167a343f470958fbb6602cb4f..ee84ec4087ee00fdc4ee46105d7a4de16beba9ba 100644 --- a/Trigger/TrigMonitoring/TrigBphysMonitoring/python/TrigBphysMonitoringConfig.py +++ b/Trigger/TrigMonitoring/TrigBphysMonitoring/python/TrigBphysMonitoringConfig.py @@ -157,7 +157,7 @@ def TrigBphysMonitoringTool(): ) from AthenaCommon.AppMgr import ToolSvc - ToolSvc += HLTBphysMon - items = [ "HLTXAODBphysMonTool/HLTBphysMon" ] + #ToolSvc += HLTBphysMon + items = [ HLTBphysMon ] return items diff --git a/Trigger/TrigMonitoring/TrigBphysMonitoring/share/testBphysMonitoring.py b/Trigger/TrigMonitoring/TrigBphysMonitoring/share/testBphysMonitoring.py index c468865bdb0a2866fee466a44446c9fddf101992..e647ac26e0696ef985c9f4e314c4435572628f21 100644 --- a/Trigger/TrigMonitoring/TrigBphysMonitoring/share/testBphysMonitoring.py +++ b/Trigger/TrigMonitoring/TrigBphysMonitoring/share/testBphysMonitoring.py @@ -64,9 +64,9 @@ HLTMon = HLTMonTool(name = 'HLTMon', #HLTMon.TrigDecisionTool = monTrigDecTool -ToolSvc += HLTMon; +#ToolSvc += HLTMon; -HLTMonManager.AthenaMonTools += [ "HLTMonTool/HLTMon" ]; +HLTMonManager.AthenaMonTools += [ HLTMon ]; from TrigBphysMonitoring.TrigBphysMonitoringConfig import TrigBphysMonitoringTool HLTMonManager.AthenaMonTools += TrigBphysMonitoringTool() diff --git a/Trigger/TrigMonitoring/TrigCaloMonitoring/python/TrigCaloMonitoringConfig.py b/Trigger/TrigMonitoring/TrigCaloMonitoring/python/TrigCaloMonitoringConfig.py index 306cdf2f8d070f3948a06296ed90f876dcc78a66..eeb80428536aa782d97e82e0f9a332095eb62cba 100644 --- a/Trigger/TrigMonitoring/TrigCaloMonitoring/python/TrigCaloMonitoringConfig.py +++ b/Trigger/TrigMonitoring/TrigCaloMonitoring/python/TrigCaloMonitoringConfig.py @@ -64,10 +64,10 @@ def HLTCaloMonitoringTool(): #HLTFullCalo = HLTCaloTool(name = 'HLTFullCalo', # histoPathBase = "/Trigger/HLT") #HLTFullCalo.TCRTools = [fullcalocellcontmaker] - ToolSvc += HLTCalo; - list = [ "HLTCaloTool/HLTCalo" ]; - ToolSvc += HLTCaloFEB; - list += [ "HLTCaloFEBTool/HLTCaloFEB" ]; + #ToolSvc += HLTCalo; + list = [ HLTCalo ]; + #ToolSvc += HLTCaloFEB; + list += [ HLTCaloFEB ]; #ToolSvc += HLTFullCalo; #list += [ "HLTCaloTool/HLTFullCalo" ]; return list @@ -92,15 +92,15 @@ def HLTCaloMonitoringTool(): histoPathBase = "/Trigger/HLT") from AthenaCommon.AppMgr import ToolSvc #ToolSvc += HLTCaloL2; - ToolSvc += xAODTrigEMClusters + #ToolSvc += xAODTrigEMClusters #list = [ "HLTCaloToolL2/HLTCaloL2" ]; - list = [ "HLTCaloESD_xAODTrigEMClusters/xAODTrigEMClusters" ] + list = [ xAODTrigEMClusters ] #ToolSvc += HLTCaloCluster; - ToolSvc += xAODCaloClusters + #ToolSvc += xAODCaloClusters #list += [ "HLTCaloClusterTool/HLTCaloCluster" ]; - list += [ "HLTCaloESD_xAODCaloClusters/xAODCaloClusters" ] - ToolSvc += CaloCells - list += [ "HLTCaloESD_CaloCells/CaloCells" ] + list += [ xAODCaloClusters ] + #ToolSvc += CaloCells + list += [ CaloCells ] return list else: diff --git a/Trigger/TrigMonitoring/TrigEgammaMonitoring/python/TrigEgammaMonitoringConfig.py b/Trigger/TrigMonitoring/TrigEgammaMonitoring/python/TrigEgammaMonitoringConfig.py index 677f2f1dd5e41fd4b01025bd8a9949ad2b43188f..fe387089139e6f32ed83617aaa5e88bb69e369ff 100644 --- a/Trigger/TrigMonitoring/TrigEgammaMonitoring/python/TrigEgammaMonitoringConfig.py +++ b/Trigger/TrigMonitoring/TrigEgammaMonitoring/python/TrigEgammaMonitoringConfig.py @@ -266,31 +266,33 @@ class TrigEgammaMonToolBuilder: return tool def configureMonTool(self): - from AthenaCommon.AppMgr import ToolSvc - toolList=['TrigEgammaMonTool/HLTEgammaMon']; + #from AthenaCommon.AppMgr import ToolSvc + #toolList=['TrigEgammaMonTool/HLTEgammaMon']; if self.mc_mode == True or self.pp_mode == True: if(self.derivation == True): tool = TrigEgammaMonTool( name = "HLTEgammaMon", histoPathBase=self.basePath, IgnoreTruncationCheck=True, Tools=["TrigEgammaNavTPAnalysisTool/HLTEgammaTPAnalysis"]) - ToolSvc += tool + #ToolSvc += tool else: - ToolSvc += self.configureDefaultMonTool() + tool = self.configureDefaultMonTool() + #ToolSvc += self.configureDefaultMonTool() elif self.HI_mode == True or self.pPb_mode == True: tool = TrigEgammaMonTool( name = "HLTEgammaMon", histoPathBase=self.basePath, IgnoreTruncationCheck=True, Tools=["TrigEgammaNavAnalysisTool/HLTEgammaPhotonAnalysis", "TrigEgammaNavAnalysisTool/HLTEgammaElectronAnalysis"]) - ToolSvc += tool + #ToolSvc += tool elif self.cosmic_mode == True: tool = TrigEgammaMonTool( name = "HLTEgammaMon", histoPathBase=self.basePath, IgnoreTruncationCheck=True, Tools=["TrigEgammaNavAnalysisTool/HLTEgammaPhotonAnalysis", "TrigEgammaNavAnalysisTool/HLTEgammaElectronAnalysis"]) - ToolSvc += tool + #ToolSvc += tool else: - ToolSvc += self.configureDefaultMonTool() - return toolList + tool = self.configureDefaultMonTool() + #ToolSvc += self.configureDefaultMonTool() + return [ tool ] diff --git a/Trigger/TrigMonitoring/TrigHLTMonitoring/python/TrigHLTMonitoringConfig.py b/Trigger/TrigMonitoring/TrigHLTMonitoring/python/TrigHLTMonitoringConfig.py index 73e344b2b085ccac311b5dcc3438eba417409dea..b06aea39f0311574c5c19f3d1a9e8e56c2d47b22 100644 --- a/Trigger/TrigMonitoring/TrigHLTMonitoring/python/TrigHLTMonitoringConfig.py +++ b/Trigger/TrigMonitoring/TrigHLTMonitoring/python/TrigHLTMonitoringConfig.py @@ -1,7 +1,7 @@ # Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration def HLTGeneralTool(): - from AthenaCommon.AppMgr import ToolSvc + #from AthenaCommon.AppMgr import ToolSvc from TrigHLTMonitoring.TrigHLTMonitoringConf import HLTMonTool HLTMon = HLTMonTool( name = 'HLTMon', histoPathBase = "/Trigger/HLT/ResultMon", @@ -30,6 +30,6 @@ def HLTGeneralTool(): }, LumiKey = 'LumiBlocks' ) - ToolSvc += HLTMon - list = [ "HLTMonTool/HLTMon" ] + #ToolSvc += HLTMon + list = [ HLTMon ] return list diff --git a/Trigger/TrigMonitoring/TrigHLTMonitoring/share/HLTIDtrkMon_DumpTDT.py b/Trigger/TrigMonitoring/TrigHLTMonitoring/share/HLTIDtrkMon_DumpTDT.py index 74d5d40c4c89858c7931a3deeca2a5ac72443a28..eb090dc0ae18cc5bb3fe5b673a537dece3f0acb1 100755 --- a/Trigger/TrigMonitoring/TrigHLTMonitoring/share/HLTIDtrkMon_DumpTDT.py +++ b/Trigger/TrigMonitoring/TrigHLTMonitoring/share/HLTIDtrkMon_DumpTDT.py @@ -134,8 +134,8 @@ if (IDtrkMon): HLTIDtrkMon.PtMin = 0. HLTIDtrkMon.EtaMax = 5.0 HLTIDtrkMon.SiHitMin = 3 - ToolSvc += HLTIDtrkMon; - HLTMonManager.AthenaMonTools += [ "HLTIDtrkMonTool/HLTIDtrkMon" ]; + #ToolSvc += HLTIDtrkMon; + HLTMonManager.AthenaMonTools += [ HLTIDtrkMon ]; ##### HLTIDtrkMon Part #################### @@ -217,8 +217,8 @@ if (IDtrkDump): - ToolSvc += HLTIDtrkDump; - HLTMonManager.AthenaMonTools += [ "HLTIDtrkDumpTool/HLTIDtrkDump" ]; + #ToolSvc += HLTIDtrkDump; + HLTMonManager.AthenaMonTools += [ HLTIDtrkDump ]; ##### Histogram File Part ################# diff --git a/Trigger/TrigMonitoring/TrigIDJpsiMonitoring/python/TrigIDJpsiMonitoringConfig.py b/Trigger/TrigMonitoring/TrigIDJpsiMonitoring/python/TrigIDJpsiMonitoringConfig.py index af1e2e909d148862a966a02177a365116d985ba9..18c2bd5d3adf92aad2a8d0a29e12109856dedd16 100644 --- a/Trigger/TrigMonitoring/TrigIDJpsiMonitoring/python/TrigIDJpsiMonitoringConfig.py +++ b/Trigger/TrigMonitoring/TrigIDJpsiMonitoring/python/TrigIDJpsiMonitoringConfig.py @@ -11,6 +11,6 @@ def TrigIDJpsiMonitoringTool(): TrigJpsiMon = TrigJpsiMonTool(name = 'TrigJpsiMon', histoPathBase = "/Trigger/HLT/IDJpsiMon") - ToolSvc += TrigJpsiMon - list = [ "TrigJpsiMonTool/TrigJpsiMon" ] + #ToolSvc += TrigJpsiMon + list = [ TrigJpsiMon ] return list diff --git a/Trigger/TrigMonitoring/TrigIDJpsiMonitoring/run/RunJpsimumu.py b/Trigger/TrigMonitoring/TrigIDJpsiMonitoring/run/RunJpsimumu.py index 49e71291b4daf85edc613d35c1d9c2eaa36ec919..8c802d8f0a8fdd2d12e8570f895b89b7f86c0a35 100644 --- a/Trigger/TrigMonitoring/TrigIDJpsiMonitoring/run/RunJpsimumu.py +++ b/Trigger/TrigMonitoring/TrigIDJpsiMonitoring/run/RunJpsimumu.py @@ -7,8 +7,8 @@ HLTMonManager = topSequence.HLTMonManager from TrigIDJpsiMonitoring.TrigIDJpsiMonitoringConf import TrigJpsiMonTool TestMonTool = TrigJpsiMonTool( name="TestMonTool") -ToolSvc += TestMonTool -HLTMonManager.AthenaMonTools += [ "TrigJpsiMonTool/TestMonTool" ] +#ToolSvc += TestMonTool +HLTMonManager.AthenaMonTools += [ TestMonTool ] ##### Trigger Decision Part ##################### diff --git a/Trigger/TrigMonitoring/TrigIDJpsiMonitoring/run/TrigIDJpsiMonitoring_topOptions.py b/Trigger/TrigMonitoring/TrigIDJpsiMonitoring/run/TrigIDJpsiMonitoring_topOptions.py index 5a1819f6133319a8e9198cb37a216b00961c352f..bc7ac504d776eae2608efb950f9dd9f9131d6569 100644 --- a/Trigger/TrigMonitoring/TrigIDJpsiMonitoring/run/TrigIDJpsiMonitoring_topOptions.py +++ b/Trigger/TrigMonitoring/TrigIDJpsiMonitoring/run/TrigIDJpsiMonitoring_topOptions.py @@ -123,8 +123,8 @@ HLTMonManager = topSequence.HLTMonManager from TrigIDJpsiMonitoring.TrigIDJpsiMonitoringConf import TrigJpsiMonTool TestMonTool = TrigJpsiMonTool( name="TestMonTool") -ToolSvc += TestMonTool -HLTMonManager.AthenaMonTools += [ "TrigJpsiMonTool/TestMonTool" ] +#ToolSvc += TestMonTool +HLTMonManager.AthenaMonTools += [ TestMonTool ] ##### Trigger Decision Part ##################### diff --git a/Trigger/TrigMonitoring/TrigIDJpsiMonitoring/run/TrigInDetValidation_RTT_topOptions_Bphysics.py b/Trigger/TrigMonitoring/TrigIDJpsiMonitoring/run/TrigInDetValidation_RTT_topOptions_Bphysics.py index ed992017e9a289201d0b41cd12cf01b460e0cb67..2dc99e8726535e40a35c7ccfcd0e2746b882b582 100644 --- a/Trigger/TrigMonitoring/TrigIDJpsiMonitoring/run/TrigInDetValidation_RTT_topOptions_Bphysics.py +++ b/Trigger/TrigMonitoring/TrigIDJpsiMonitoring/run/TrigInDetValidation_RTT_topOptions_Bphysics.py @@ -73,8 +73,8 @@ HLTMonManager = topSequence.HLTMonManager from TrigIDJpsiMonitoring.TrigIDJpsiMonitoringConf import TrigJpsiMonTool TPMonTool = TrigJpsiMonTool( name="TPMonTool") -ToolSvc += TPMonTool -HLTMonManager.AthenaMonTools += [ "TrigJpsiMonTool/TPMonTool" ] +#ToolSvc += TPMonTool +HLTMonManager.AthenaMonTools += [ TPMonTool ] TPMonTool.matchR = 0.1 diff --git a/Trigger/TrigMonitoring/TrigIDJpsiMonitoring/run/grid_TrigIDJpsiMonitoring_topOptions.py b/Trigger/TrigMonitoring/TrigIDJpsiMonitoring/run/grid_TrigIDJpsiMonitoring_topOptions.py index 8bffb7b67445945ffddd7ce2c3e9e8548909759a..fd26065e841a51847fc9d02132f89e6478bec7f1 100644 --- a/Trigger/TrigMonitoring/TrigIDJpsiMonitoring/run/grid_TrigIDJpsiMonitoring_topOptions.py +++ b/Trigger/TrigMonitoring/TrigIDJpsiMonitoring/run/grid_TrigIDJpsiMonitoring_topOptions.py @@ -113,8 +113,8 @@ HLTMonManager = topSequence.HLTMonManager from TrigIDJpsiMonitoring.TrigIDJpsiMonitoringConf import TrigJpsiMonTool TestMonTool = TrigJpsiMonTool( name="TestMonTool") -ToolSvc += TestMonTool -HLTMonManager.AthenaMonTools += [ "TrigJpsiMonTool/TestMonTool" ] +#ToolSvc += TestMonTool +HLTMonManager.AthenaMonTools += [ TestMonTool ] ##### Trigger Decision Part ##################### diff --git a/Trigger/TrigMonitoring/TrigIDtrkMonitoring/python/TrigIDPhysValMonitoringConfig.py b/Trigger/TrigMonitoring/TrigIDtrkMonitoring/python/TrigIDPhysValMonitoringConfig.py index 1f1c5f99fd82e7fb83133a375be7040b2f65d200..f504a62c29efe39f5bba49a4c82f0ee90a0888cc 100644 --- a/Trigger/TrigMonitoring/TrigIDtrkMonitoring/python/TrigIDPhysValMonitoringConfig.py +++ b/Trigger/TrigMonitoring/TrigIDtrkMonitoring/python/TrigIDPhysValMonitoringConfig.py @@ -56,10 +56,10 @@ def TrigIDPhysValMonitoringTool(): TestIDPhysValMon.ntupleChainNames += chainnames TestIDPhysValMon.releaseMetaData = d['nightly name'] + " " + d['nightly release'] + " " + d['date'] + " " + d['platform'] + " " + d['release'] - from AthenaCommon.AppMgr import ToolSvc - ToolSvc += TestIDPhysValMon - Monname = "TrigTestPhysValMon/" + Monname - return Monname + #from AthenaCommon.AppMgr import ToolSvc + #ToolSvc += TestIDPhysValMon + #Monname = "TrigTestPhysValMon/" + Monname + return TestIDPhysValMon ############### Electrons ############### name = "Electron" diff --git a/Trigger/TrigMonitoring/TrigIDtrkMonitoring/python/TrigIDtrkMonitoringConfig.py b/Trigger/TrigMonitoring/TrigIDtrkMonitoring/python/TrigIDtrkMonitoringConfig.py index 8a3c4964dc540e8f575d61784b125cc2c00b416f..8c70e88edd12ded25d4cb601ad2da9066ee87e62 100644 --- a/Trigger/TrigMonitoring/TrigIDtrkMonitoring/python/TrigIDtrkMonitoringConfig.py +++ b/Trigger/TrigMonitoring/TrigIDtrkMonitoring/python/TrigIDtrkMonitoringConfig.py @@ -32,8 +32,8 @@ def TrigIDtrkMonitoringTool(): "HLT_id_cosmic.*:InDetTrigTrackingxAODCnv_CosmicsN_EFID", "HLT_id_cosmic.*:InDetTrigTrackingxAODCnvIOTRT_CosmicsN_EFID" ] - ToolSvc += tidacos; - list += [ "TrigTestBase/IDCosmicTool" ] + #ToolSvc += tidacos; + list += [ tidacos ] # Cosmic Shifter instance @@ -51,8 +51,8 @@ def TrigIDtrkMonitoringTool(): "HLT_id_cosmic.*:InDetTrigTrackingxAODCnv_CosmicsN_EFID", "HLT_id_cosmic.*:InDetTrigTrackingxAODCnvIOTRT_CosmicsN_EFID" ] - ToolSvc += tidacosshift; - list += [ "TrigTestBase/IDCosmicShifterTool" ] + #ToolSvc += tidacosshift; + list += [ tidacosshift ] @@ -72,8 +72,8 @@ def TrigIDtrkMonitoringTool(): "HLT_e.*idperf.*:InDetTrigTrackingxAODCnv_Electron_IDTrig", "HLT_e.*idperf.*:InDetTrigTrackingxAODCnv_Electron_FTF" ] - ToolSvc += tidaegamma; - list += [ "TrigTestBase/IDEgammaTool" ] + #ToolSvc += tidaegamma; + list += [ tidaegamma ] @@ -97,8 +97,8 @@ def TrigIDtrkMonitoringTool(): "HLT_e.*_idperf:InDetTrigTrackingxAODCnv_Electron_FTF", "HLT_e.*_idperf:InDetTrigTrackingxAODCnv_Electron_IDTrig" ] - ToolSvc += tidaegammashift; - list += [ "TrigTestBase/IDEgammaShifterTool" ] + #ToolSvc += tidaegammashift; + list += [ tidaegammashift ] # Shifter purity instances @@ -120,8 +120,8 @@ def TrigIDtrkMonitoringTool(): "HLT_e.*_idperf:InDetTrigTrackingxAODCnv_Electron_FTF", "HLT_e.*_idperf:InDetTrigTrackingxAODCnv_Electron_IDTrig" ] - ToolSvc += tidaegammapurity; - list += [ "TrigTestBase/IDEgammaPurityTool" ] + #ToolSvc += tidaegammapurity; + list += [ tidaegammapurity ] @@ -144,8 +144,8 @@ def TrigIDtrkMonitoringTool(): "HLT_mu.*idperf.*:InDetTrigTrackingxAODCnv_Muon_FTF", "HLT_mu.*idperf.*:InDetTrigTrackingxAODCnv_Muon_IDTrig" ] - ToolSvc += tidamuon; - list += [ "TrigTestBase/IDMuonTool" ] + #ToolSvc += tidamuon; + list += [ tidamuon ] # Shifter instances @@ -166,8 +166,8 @@ def TrigIDtrkMonitoringTool(): "HLT_mu.*_idperf:InDetTrigTrackingxAODCnv_Muon_FTF", "HLT_mu.*_idperf:InDetTrigTrackingxAODCnv_Muon_IDTrig" ] - ToolSvc += tidamuonshift; - list += [ "TrigTestBase/IDMuonShifterTool" ] + #ToolSvc += tidamuonshift; + list += [ tidamuonshift ] # Shifter purity instances @@ -190,8 +190,8 @@ def TrigIDtrkMonitoringTool(): "HLT_mu.*_idperf:InDetTrigTrackingxAODCnv_Muon_FTF", "HLT_mu.*_idperf:InDetTrigTrackingxAODCnv_Muon_IDTrig" ] - ToolSvc += tidamuonpurity; - list += [ "TrigTestBase/IDMuonPurityTool" ] + #ToolSvc += tidamuonpurity; + list += [ tidamuonpurity ] @@ -215,8 +215,8 @@ def TrigIDtrkMonitoringTool(): "HLT_tau.*idperf.*tracktwo.*:key=InDetTrigTrackingxAODCnv_TauIso_FTF:roi=forID3", "HLT_tau.*idperf.*tracktwo.*:key=InDetTrigTrackingxAODCnv_Tau_IDTrig:roi=forID3" ] - ToolSvc += tidatau; - list += [ "TrigTestBase/IDTauTool" ] + #ToolSvc += tidatau; + list += [ tidatau ] # Shifter instances @@ -233,8 +233,8 @@ def TrigIDtrkMonitoringTool(): "HLT_tau.*_idperf_tracktwo:key=InDetTrigTrackingxAODCnv_Tau_IDTrig:roi=forID3", "HLT_tau.*_idperf_tracktwo:key=InDetTrigTrackingxAODCnv_TauIso_FTF:roi=forID3" ] - ToolSvc += tidataushift; - list += [ "TrigTestBase/IDTauShifterTool" ] + #ToolSvc += tidataushift; + list += [ tidataushift ] @@ -254,8 +254,8 @@ def TrigIDtrkMonitoringTool(): "HLT_tau.*_idperf_tracktwo:key=InDetTrigTrackingxAODCnv_Tau_IDTrig:roi=forID3", "HLT_tau.*_idperf_tracktwo:key=InDetTrigTrackingxAODCnv_TauIso_FTF:roi=forID3" ] - ToolSvc += tidataupurity; - list += [ "TrigTestBase/IDTauPurityTool" ] + #ToolSvc += tidataupurity; + list += [ tidataupurity ] @@ -282,8 +282,8 @@ def TrigIDtrkMonitoringTool(): "HLT_j.*boffperf_split:key=InDetTrigTrackingxAODCnv_Bjet_IDTrig", "HLT_j.*boffperf_split:key=InDetTrigTrackingxAODCnv_Bjet_FTF" ] - ToolSvc += tidabjet; - list += [ "TrigTestBase/IDBjetTool" ] + #ToolSvc += tidabjet; + list += [ tidabjet ] # Shifter instances @@ -300,8 +300,8 @@ def TrigIDtrkMonitoringTool(): "HLT_j.*_boffperf_split:InDetTrigTrackingxAODCnv_Bjet_FTF", "HLT_j.*_boffperf_split:InDetTrigTrackingxAODCnv_Bjet_IDTrig" ] - ToolSvc += tidabjetshift; - list += [ "TrigTestBase/IDBjetShifterTool" ] + #ToolSvc += tidabjetshift; + list += [ tidabjetshift ] # Shifter Purity instances tidabjetpurity = TrigTestBase(name = "IDBjetPurityerTool", @@ -314,8 +314,8 @@ def TrigIDtrkMonitoringTool(): "HLT_j85_boffperf_split:InDetTrigTrackingxAODCnv_Bjet_FTF", "HLT_j85_boffperf_split:InDetTrigTrackingxAODCnv_Bjet_IDTrig" ] - ToolSvc += tidabjetpurity; - list += [ "TrigTestBase/IDBjetPurityTool" ] + #ToolSvc += tidabjetpurity; + list += [ tidabjetpurity ] # Shifter instances @@ -333,8 +333,8 @@ def TrigIDtrkMonitoringTool(): "HLT_j.*_boffperf_split:InDetTrigTrackingxAODCnv_BjetPrmVtx_FTF_SuperRoi:roi=SuperRoi:vtx=xPrimVx", "HLT_j.*_boffperf_split:InDetTrigTrackingxAODCnv_BjetPrmVtx_FTF_SuperRoi:roi=SuperRoi:vtx=EFHistoPrmVtx" ] - ToolSvc += tidabjetvtxshift; - list += [ "TrigTestBase/IDBjetVtxShifterTool" ] + #ToolSvc += tidabjetvtxshift; + list += [ tidabjetvtxshift ] @@ -358,8 +358,8 @@ def TrigIDtrkMonitoringTool(): # "HLT_.*Bmumux.*:InDetTrigTrackingxAODCnv_Bphysics_IDTrig", # "HLT_.*Bmumux.*:InDetTrigTrackingxAODCnv_Bphysics_FTF" ] - ToolSvc += tidabphys; - list += [ "TrigTestBase/IDBphysTool" ] + #ToolSvc += tidabphys; + list += [ tidabphys ] # Shifter instances @@ -374,8 +374,8 @@ def TrigIDtrkMonitoringTool(): "HLT_mu.*_mu.*idperf.*noid:InDetTrigTrackingxAODCnv_Bphysics_FTF", "HLT_mu.*_mu.*idperf.*noid:InDetTrigTrackingxAODCnv_Bphysics_IDTrig" ] - ToolSvc += tidabphysshift; - list += [ "TrigTestBase/IDBphysShifterTool" ] + #ToolSvc += tidabphysshift; + list += [ tidabphysshift ] @@ -394,8 +394,8 @@ def TrigIDtrkMonitoringTool(): "Offline", "HLT_mb_.*idperf.*:InDetTrigTrackingxAODCnv_minBias_EFID" ] - ToolSvc += tidaminbias; - list += [ "TrigTestBase/IDminBiasTool" ] + #ToolSvc += tidaminbias; + list += [ tidaminbias ] # Shifter instances @@ -407,8 +407,8 @@ def TrigIDtrkMonitoringTool(): "Offline", "HLT_mb_.*idperf.*:InDetTrigTrackingxAODCnv_minBias_EFID" ] - ToolSvc += tidaminbiasshift; - list += [ "TrigTestBase/IDminBiasShifterTool" ] + #ToolSvc += tidaminbiasshift; + list += [ tidaminbiasshift ] ################################################ @@ -442,8 +442,8 @@ def TrigIDtrkMonitoringTool(): "HLT_mu.*idperf_FTKRefit:key=InDetTrigTrackingxAODCnv_Muon_FTKRefit", "HLT_mu.*idperf_FTKRefit:key=InDetTrigTrackingxAODCnv_Muon_FTKRefit_IDTrig" ] - ToolSvc += tidaftk; - list += [ "TrigTestBase/IDFTKTool" ] + #ToolSvc += tidaftk; + list += [ tidaftk ] return list diff --git a/Trigger/TrigMonitoring/TrigJetMonitoring/python/TrigJetMonitoringConfig.py b/Trigger/TrigMonitoring/TrigJetMonitoring/python/TrigJetMonitoringConfig.py index eb4615e19c93969d490f7e86aece5f195611f0e1..f8fa667a22982cf3dbb0f84da7a8e4a45f090d30 100644 --- a/Trigger/TrigMonitoring/TrigJetMonitoring/python/TrigJetMonitoringConfig.py +++ b/Trigger/TrigMonitoring/TrigJetMonitoring/python/TrigJetMonitoringConfig.py @@ -824,7 +824,7 @@ def TrigJetMonitoringTool(): # HLTMonFlags.doEgamma.set_Value_and_Lock(False) - ToolSvc += HLTJetMon; + #ToolSvc += HLTJetMon; # Set up the trigger configuration tool: #ToolSvc += CfgMgr.TrigConf__xAODConfigTool( "xAODConfigTool", @@ -836,7 +836,7 @@ def TrigJetMonitoringTool(): #ConfigTool = ToolSvc.xAODConfigTool, #TrigDecisionKey = "xTrigDecision" ) - list = [ "HLTJetMonTool/HLTJetMon" ]; + list = [ HLTJetMon ]; return list diff --git a/Trigger/TrigMonitoring/TrigJetMonitoring/python/TrigJetMonitoringConfig_cosmics.py b/Trigger/TrigMonitoring/TrigJetMonitoring/python/TrigJetMonitoringConfig_cosmics.py index 448896bda218fed179082c84f8542fc405652a68..427013420a4c4f67dd2ffcf89883f67419da7c12 100644 --- a/Trigger/TrigMonitoring/TrigJetMonitoring/python/TrigJetMonitoringConfig_cosmics.py +++ b/Trigger/TrigMonitoring/TrigJetMonitoring/python/TrigJetMonitoringConfig_cosmics.py @@ -245,7 +245,7 @@ def TrigJetMonitoringTool(): #DoOFMaxJetTimeCut = True, #OFMaxTimens = 50. ); - from AthenaCommon.AppMgr import ToolSvc - ToolSvc += HLTJetMon; - list = [ "HLTJetMonTool/HLTJetMon" ]; + #from AthenaCommon.AppMgr import ToolSvc + #ToolSvc += HLTJetMon; + list = [ HLTJetMon ]; return list diff --git a/Trigger/TrigMonitoring/TrigJetMonitoring/python/TrigJetMonitoringConfig_physics.py b/Trigger/TrigMonitoring/TrigJetMonitoring/python/TrigJetMonitoringConfig_physics.py index 4f72fad20374f3af2dfdb068483c964ee0168146..879cf76f2fb51a29eee1d66e893c3eda78dac182 100644 --- a/Trigger/TrigMonitoring/TrigJetMonitoring/python/TrigJetMonitoringConfig_physics.py +++ b/Trigger/TrigMonitoring/TrigJetMonitoring/python/TrigJetMonitoringConfig_physics.py @@ -240,7 +240,7 @@ def TrigJetMonitoringTool(): #DoOFMaxJetTimeCut = True, #OFMaxTimens = 50. ); - from AthenaCommon.AppMgr import ToolSvc - ToolSvc += HLTJetMon; - list = [ "HLTJetMonTool/HLTJetMon" ]; + #from AthenaCommon.AppMgr import ToolSvc + #ToolSvc += HLTJetMon; + list = [ HLTJetMon ]; return list diff --git a/Trigger/TrigMonitoring/TrigMETMonitoring/python/TrigMETMonitoringConfig.py b/Trigger/TrigMonitoring/TrigMETMonitoring/python/TrigMETMonitoringConfig.py index 3c018f277fa544ddcab6166de6b4d736f57f91d4..19fe1eccf75ac6664bccef73c2ff280c748b2372 100644 --- a/Trigger/TrigMonitoring/TrigMETMonitoring/python/TrigMETMonitoringConfig.py +++ b/Trigger/TrigMonitoring/TrigMETMonitoring/python/TrigMETMonitoringConfig.py @@ -89,6 +89,6 @@ def HLTMETMonitoringTool(): prescaled_met = [], ); from AthenaCommon.AppMgr import ToolSvc - ToolSvc += HLTMETMon; - list = [ "HLTMETMonTool/HLTMETMon" ]; + #ToolSvc += HLTMETMon; + list = [ HLTMETMon ]; return list diff --git a/Trigger/TrigMonitoring/TrigMinBiasMonitoring/python/TrigMinBiasMonitoringConfig.py b/Trigger/TrigMonitoring/TrigMinBiasMonitoring/python/TrigMinBiasMonitoringConfig.py index ee65e58c6a429bcd6173f4829b2a22db9c8b7e8a..6c30fd39cd932db087a3ba1fe2b50f0c99f9087e 100644 --- a/Trigger/TrigMonitoring/TrigMinBiasMonitoring/python/TrigMinBiasMonitoringConfig.py +++ b/Trigger/TrigMonitoring/TrigMinBiasMonitoring/python/TrigMinBiasMonitoringConfig.py @@ -78,8 +78,8 @@ def TrigMinBiasMonitoringTool(): # ---------------------- !Collective Histograms Management - ToolSvc += HLTMinBiasMon; - list = [ "HLTMinBiasMonTool/HLTMinBiasMon" ]; + #ToolSvc += HLTMinBiasMon; + list = [ HLTMinBiasMon ]; return list diff --git a/Trigger/TrigMonitoring/TrigMuonMonitoring/python/TrigMuonMonitoringConfig.py b/Trigger/TrigMonitoring/TrigMuonMonitoring/python/TrigMuonMonitoringConfig.py index 19fdfd1324c7a4723a7861809ed3e5803b07081a..70bb0374615e83a38d124dab6e2c384ce8b2a990 100644 --- a/Trigger/TrigMonitoring/TrigMuonMonitoring/python/TrigMuonMonitoringConfig.py +++ b/Trigger/TrigMonitoring/TrigMuonMonitoring/python/TrigMuonMonitoringConfig.py @@ -22,8 +22,8 @@ def TrigMuonMonitoringTool(): from TrigBunchCrossingTool.BunchCrossingTool import BunchCrossingTool HLTMuonMon.BCTool = BunchCrossingTool() from AthenaCommon.AppMgr import ToolSvc - ToolSvc += HLTMuonMon; - list = [ "HLTMuonMonTool/HLTMuonMon" ]; + #ToolSvc += HLTMuonMon; + list = [ HLTMuonMon ]; return list diff --git a/Trigger/TrigMonitoring/TrigSteerMonitor/src/TrigSignatureMoniMT.cxx b/Trigger/TrigMonitoring/TrigSteerMonitor/src/TrigSignatureMoniMT.cxx index fd4ba426ec856ec4d8fbf66130893b0534fd4d97..7d4281860eae5e4e8389c571ddd4e2950be27655 100644 --- a/Trigger/TrigMonitoring/TrigSteerMonitor/src/TrigSignatureMoniMT.cxx +++ b/Trigger/TrigMonitoring/TrigSteerMonitor/src/TrigSignatureMoniMT.cxx @@ -1,7 +1,7 @@ /* Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration */ - +#include <algorithm> #include "GaudiKernel/Property.h" #include "DecisionHandling/HLTIdentifier.h" #include "TrigSignatureMoniMT.h" @@ -16,8 +16,7 @@ TrigSignatureMoniMT::TrigSignatureMoniMT( const std::string& name, StatusCode TrigSignatureMoniMT::initialize() { ATH_CHECK( m_l1DecisionsKey.initialize() ); - ATH_CHECK( m_finalDecisionsKey.initialize() ); - renounceArray( m_finalDecisionsKey ); + ATH_CHECK( m_finalDecisionKey.initialize() ); ATH_CHECK( m_collectorTools.retrieve() ); CHECK( m_histSvc.retrieve() ); @@ -49,10 +48,6 @@ StatusCode TrigSignatureMoniMT::initialize() { } CHECK( initHist() ); - for ( auto chainAndKey: m_finalChainStep ) { - m_lastStepsMap[ chainAndKey.second ].insert( HLT::Identifier( chainAndKey.first ).numeric() ); - } - return StatusCode::SUCCESS; } @@ -80,6 +75,7 @@ StatusCode TrigSignatureMoniMT::finalize() { StatusCode TrigSignatureMoniMT::fillChains(const TrigCompositeUtils::DecisionIDContainer& dc, int row) { for ( auto id : dc ) { + ATH_MSG_DEBUG( "row " << row << " " << HLT::Identifier(id) ); auto id2bin = m_chainIDToBinMap.find( id ); if ( id2bin == m_chainIDToBinMap.end() ) { ATH_MSG_WARNING( "HLT chain " << HLT::Identifier(id) << " not configured to be monitored" ); @@ -117,39 +113,18 @@ StatusCode TrigSignatureMoniMT::execute() { ATH_CHECK( fillChains( stepSum, 3+step ) ); ++step; } - - + const int row = m_outputHistogram->GetYaxis()->GetNbins(); - bool anyPassed = false; - for ( auto d: m_finalDecisionsKey ) { - auto decisions = SG::makeHandle( d ); - if ( decisions.isValid() ) { // may be invalid and that is perfectly correct (early rejection - ATH_MSG_DEBUG( "Decision for " << decisions->size() << " objects available in " << d.key() ); - // we need one entry per chain only and the "sum" is used for that - TrigCompositeUtils::DecisionIDContainer sum; - - for ( auto decisionObj : *decisions.get() ) { - TrigCompositeUtils::DecisionIDContainer ids; - TrigCompositeUtils::decisionIDs( decisionObj, ids ); - sum.insert( ids.begin(), ids.end() ); // merge with so far passing chains - } - TrigCompositeUtils::DecisionIDContainer final; - std::set_intersection( sum.begin(), sum.end(), - m_lastStepsMap[decisions.key()].begin(), m_lastStepsMap[decisions.key()].end(), - std::inserter( final, final.begin() ) ); - - ATH_CHECK( fillChains( final, row ) ); - anyPassed = anyPassed or ( not sum.empty() ); - } else { - ATH_MSG_DEBUG( "Final decision " << d.key() << " absent, possibly early rejected" ); - } - } - if ( anyPassed ) { - ATH_MSG_DEBUG( "Event passsed, filling " << row ); + auto finalDecisionsHandle = SG::makeHandle( m_finalDecisionKey ); + ATH_CHECK( finalDecisionsHandle.isValid() ); + ATH_CHECK( finalDecisionsHandle->size() == 1 ); + TrigCompositeUtils::DecisionIDContainer finalIDs; + TrigCompositeUtils::decisionIDs( finalDecisionsHandle->at(0), finalIDs ); + ATH_CHECK( fillChains( finalIDs, row ) ); + + if ( not finalIDs.empty() ) { m_outputHistogram->Fill( 1, double( row ) ); } - // missing intermediate steps monitoring - return StatusCode::SUCCESS; } @@ -165,8 +140,12 @@ StatusCode TrigSignatureMoniMT::initHist() { TAxis* x = m_outputHistogram->GetXaxis(); x->SetBinLabel(1, "All"); - int bin = 2; - for ( auto chainName: m_allChains ) { + int bin = 2; // 1 is for total count, (remember bins numbering in ROOT start from 1) + + std::vector<std::string> sortedChainsList( m_allChains ); + std::sort( sortedChainsList.begin(), sortedChainsList.end() ); + + for ( auto chainName: sortedChainsList ) { x->SetBinLabel( bin, chainName.c_str() ); m_chainIDToBinMap[ HLT::Identifier( chainName ).numeric() ] = bin; bin++; diff --git a/Trigger/TrigMonitoring/TrigSteerMonitor/src/TrigSignatureMoniMT.h b/Trigger/TrigMonitoring/TrigSteerMonitor/src/TrigSignatureMoniMT.h index 6b72e2dade3cd36c051fee26f22fd6ec23725236..d73407e2ad7584a1393ae7da07e0717611ec5488 100644 --- a/Trigger/TrigMonitoring/TrigSteerMonitor/src/TrigSignatureMoniMT.h +++ b/Trigger/TrigMonitoring/TrigSteerMonitor/src/TrigSignatureMoniMT.h @@ -36,12 +36,9 @@ class TrigSignatureMoniMT : public ::AthAlgorithm SG::ReadHandleKey<TrigCompositeUtils::DecisionContainer> m_l1DecisionsKey{ this, "L1Decisions", "HLTChainsResult", "Chains activated after the L1" }; - SG::ReadHandleKeyArray<TrigCompositeUtils::DecisionContainer> m_finalDecisionsKey{ this, "FinalDecisions", {}, "Final stage of all decisions" }; + SG::ReadHandleKey<TrigCompositeUtils::DecisionContainer> m_finalDecisionKey{ this, "FinalDecisionKey", "HLTFinalDecisions", "Final stage of all decisions" }; - Gaudi::Property< std::map<std::string, std::string> > m_finalChainStep{ this, "FinalChainStep", {}, "Mapping from chain name to the decision container having the last step decision for that chain" }; - std::map<std::string, std::set<unsigned int>> m_lastStepsMap; //!< a map from the decision container key to the set of chains which have there the last step - Gaudi::Property<std::vector<std::string> > m_allChains{ this, "ChainsList", {}, "List of all configured chains" }; std::map<unsigned int, int> m_chainIDToBinMap; diff --git a/Trigger/TrigMonitoring/TrigTauMonitoring/python/TrigTauMonitoringConfig.py b/Trigger/TrigMonitoring/TrigTauMonitoring/python/TrigTauMonitoringConfig.py index 8c0eb15630ce8cb473ce6d84843d0030539c5803..ff407649685c3487f4b766f638bfebd2799caa42 100644 --- a/Trigger/TrigMonitoring/TrigTauMonitoring/python/TrigTauMonitoringConfig.py +++ b/Trigger/TrigMonitoring/TrigTauMonitoring/python/TrigTauMonitoringConfig.py @@ -132,8 +132,8 @@ def TrigTauMonitoringTool(): isData = (globalflags.DataSource == 'data')); #from AthenaCommon.AppMgr import ToolSvc - ToolSvc += HLTTauMon; + #ToolSvc += HLTTauMon; print ToolSvc - list = [ "HLTTauMonTool/HLTTauMon" ]; + list = [ HLTTauMon ]; return list from TriggerJobOpts.TriggerConfigGetter import TriggerConfigGetter diff --git a/Trigger/TrigSteer/L1Decoder/python/L1DecoderConfig.py b/Trigger/TrigSteer/L1Decoder/python/L1DecoderConfig.py index 09036040e8885dbf73f617dabae07c1f7ab75052..0f8363e66a2d123bfa3f9725d9bc9084ecd4ce27 100644 --- a/Trigger/TrigSteer/L1Decoder/python/L1DecoderConfig.py +++ b/Trigger/TrigSteer/L1Decoder/python/L1DecoderConfig.py @@ -24,9 +24,9 @@ def L1DecoderCfg(flags): decoderAlg.roiUnpackers += [METRoIsUnpackingTool( Decisions = "L1MET", OutputTrigRoI = "METRoI") ] - from L1Decoder.L1MuonConfig import RPCCablingConfig, TGCCablingConfig - acc.merge(TGCCablingConfig(flags )) - acc.merge(RPCCablingConfig(flags )) + from MuonConfig.MuonCablingConfig import RPCCablingConfigCfg, TGCCablingConfigCfg + acc.mergeAll( TGCCablingConfigCfg( flags ) ) + acc.mergeAll( RPCCablingConfigCfg( flags ) ) decoderAlg.roiUnpackers += [ MURoIsUnpackingTool( Decisions = "L1MU", OutputTrigRoIs = "MURoIs", MonTool = RoIsUnpackingMonitoring( prefix="MU", maxCount=20 ) ) ] diff --git a/Trigger/TrigSteer/L1Decoder/python/L1MuonConfig.py b/Trigger/TrigSteer/L1Decoder/python/L1MuonConfig.py deleted file mode 100644 index aafb4271c61138c21f796a420bdf266d65cdcac8..0000000000000000000000000000000000000000 --- a/Trigger/TrigSteer/L1Decoder/python/L1MuonConfig.py +++ /dev/null @@ -1,112 +0,0 @@ -# -# Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration -# - -# This file (modified) will be moved in future to Muon realm. -# Since it uses an experimental way of configuring the job -# it is better if it resided here for now. -# Experts, when moving look for ??? for hardwired settings - -def RPCCablingConfig(flags): - from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator - acc = ComponentAccumulator() - - from TrigT1RPCRecRoiSvc.TrigT1RPCRecRoiSvcConf import LVL1RPC__RPCRecRoiSvc - acc.addService( LVL1RPC__RPCRecRoiSvc() ) - - - - from MuonCablingServers.MuonCablingServersConf import RPCcablingServerSvc - RPCCablingSvc = RPCcablingServerSvc() - RPCCablingSvc.Atlas = True - RPCCablingSvc.forcedUse = True - RPCCablingSvc.useMuonRPC_CablingSvc = True #Needed to switch to new cabling - acc.addService( RPCCablingSvc ) - - # get the GeoModelSvc and add MuonDetectorTool - from AtlasGeoModel.GeoModelConfig import GeoModelCfg - gmsAcc,gms=GeoModelCfg(flags ) - acc.merge(gmsAcc) - - - from MuonGeoModel.MuonGeoModelConf import MuonDetectorTool - detTool = MuonDetectorTool() - detTool.UseConditionDb = 1 - detTool.UseIlinesFromGM = 1 - gms.DetectorTools += [ detTool ] - - acc.addService(gms) - - from MuonRPC_Cabling.MuonRPC_CablingConf import MuonRPC_CablingSvc - rpcCablingSvc = MuonRPC_CablingSvc() - rpcCablingSvc.ConfFileName = 'LVL1confAtlas.data' # this should come from config flag maybe ??? - rpcCablingSvc.CorrFileName = 'LVL1confAtlas.corr' - rpcCablingSvc.ConfFilePath = 'MuonRPC_Cabling/' - rpcCablingSvc.RPCTriggerRoadsfromCool = True - #rpcCablingSvc.CosmicConfiguration = True # was set like this in egamma test, looks incorrect ??? - - from IOVDbSvc.IOVDbSvcConfig import addFolders - #conddb.addFolderSplitMC('RPC','/RPC/TRIGGER/CM_THR_ETA', '/RPC/TRIGGER/CM_THR_ETA') - #conddb.addFolderSplitMC('RPC','/RPC/TRIGGER/CM_THR_PHI', '/RPC/TRIGGER/CM_THR_PHI') - - - acc.merge(addFolders(flags, - [ '/RPC/TRIGGER/CM_THR_ETA', '/RPC/TRIGGER/CM_THR_ETA', '/RPC/TRIGGER/CM_THR_PHI', - '/RPC/TRIGGER/CM_THR_PHI', '/RPC/CABLING/MAP_SCHEMA', '/RPC/CABLING/MAP_SCHEMA_CORR' ], - 'RPC' )) - - # that should not be here??? - acc.getService('IOVDbSvc').FoldersToMetaData += ['/GLOBAL/BField/Maps'] - - - from RPC_CondCabling.RPC_CondCablingConf import RPCCablingDbTool - RPCCablingDbTool = RPCCablingDbTool() - RPCCablingDbTool.MapConfigurationFolder = '/RPC/CABLING/MAP_SCHEMA' - RPCCablingDbTool.MapCorrectionFolder = '/RPC/CABLING/MAP_SCHEMA_CORR' - - acc.addPublicTool( RPCCablingDbTool ) - rpcCablingSvc.TheRpcCablingDbTool = RPCCablingDbTool - - acc.addService( rpcCablingSvc ) - - return acc - -def TGCCablingConfig(flags): - from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator - acc = ComponentAccumulator() - - from TrigT1TGCRecRoiSvc.TrigT1TGCRecRoiSvcConf import LVL1TGC__TGCRecRoiSvc - acc.addService( LVL1TGC__TGCRecRoiSvc() ) - - from MuonCablingServers.MuonCablingServersConf import TGCcablingServerSvc - TGCCablingSvc = TGCcablingServerSvc() - TGCCablingSvc.Atlas=True - TGCCablingSvc.useMuonTGC_CablingSvc=True - TGCCablingSvc.forcedUse=True - acc.addService( TGCCablingSvc ) - - from IOVDbSvc.IOVDbSvcConfig import addFolders - acc.merge(addFolders(flags, ['/TGC/CABLING/MAP_SCHEMA','/TGC/CABLING/MAP_SCHEMA'], 'TGC')) - return acc - -# for reco running we need MDT and CSC, yet to come - -if __name__ == '__main__': - from AthenaCommon.Configurable import Configurable - Configurable.configurableRun3Behavior=1 - from AthenaConfiguration.AllConfigFlags import ConfigFlags - - ConfigFlags.Input.Files = ["/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/TrigP1Test/data17_13TeV.00327265.physics_EnhancedBias.merge.RAW._lb0100._SFO-1._0001.1",] - ConfigFlags.lock() - - from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator - acc = ComponentAccumulator() - - - acc.merge(RPCCablingConfig(ConfigFlags )) - acc.merge(TGCCablingConfig(ConfigFlags )) - - f=open('MuonConfig.pkl','w') - acc.store(f) - f.close() - diff --git a/Trigger/TrigSteer/L1Decoder/src/JRoIsUnpackingTool.cxx b/Trigger/TrigSteer/L1Decoder/src/JRoIsUnpackingTool.cxx index 883f6640fe00be40672f939997d9b66563495f20..89e17f8c4d893c466bb85460d9d4fbc5428696eb 100644 --- a/Trigger/TrigSteer/L1Decoder/src/JRoIsUnpackingTool.cxx +++ b/Trigger/TrigSteer/L1Decoder/src/JRoIsUnpackingTool.cxx @@ -34,18 +34,7 @@ StatusCode JRoIsUnpackingTool::updateConfiguration( const IRoIsUnpackingTool::Se m_configSvc->ctpConfig()->menu().itemVector(), seeding ) ); - m_jetThresholds.clear(); - const ThresholdConfig* thresholdConfig = m_configSvc->thresholdConfig(); - for ( TriggerThreshold * th : thresholdConfig->getThresholdVector( L1DataDef::JET ) ) { - if ( th != nullptr ) { - ATH_MSG_DEBUG( "Found threshold in the configuration: " << th->name() << " of ID: " << HLT::Identifier( th->name() ).numeric() ); - m_jetThresholds.push_back( th ); - } - } - // - - - // m_jetThresholds.clear(); + m_jetThresholds.clear(); ATH_CHECK( copyThresholds(m_configSvc->thresholdConfig()->getThresholdVector( L1DataDef::JET ), m_jetThresholds ) ); ATH_CHECK( copyThresholds(m_configSvc->thresholdConfig()->getThresholdVector( L1DataDef::JF ), m_jetThresholds ) ); ATH_CHECK( copyThresholds(m_configSvc->thresholdConfig()->getThresholdVector( L1DataDef::JB ), m_jetThresholds ) ); diff --git a/Trigger/TrigSteer/TrigHLTResultByteStream/src/HLTResultMTByteStreamCnv.cxx b/Trigger/TrigSteer/TrigHLTResultByteStream/src/HLTResultMTByteStreamCnv.cxx index b20471d1baa5555384ea5004cbfa7eb7cd41f4dc..146dd3a91464a68d164a58930cd4e0c7da77d756 100644 --- a/Trigger/TrigSteer/TrigHLTResultByteStream/src/HLTResultMTByteStreamCnv.cxx +++ b/Trigger/TrigSteer/TrigHLTResultByteStream/src/HLTResultMTByteStreamCnv.cxx @@ -89,6 +89,9 @@ StatusCode HLT::HLTResultMTByteStreamCnv::createRep(DataObject* pObj, IOpaqueAdd } ATH_MSG_VERBOSE("Obtained RawEventWrite pointer = " << re); + // Fill the status words (error code) + re->status(hltResult->getStatus().size(), hltResult->getStatus().data()); + // Clear the stream tag buffer - we need to keep the serialised StreamTag data cached because // its lifetime has to be at least as long as the lifetime of RawEventWrite which points to the StreamTag data delete m_streamTagData.release(); diff --git a/Trigger/TrigSteer/TrigOutputHandling/src/DecisionSummaryMakerAlg.cxx b/Trigger/TrigSteer/TrigOutputHandling/src/DecisionSummaryMakerAlg.cxx index 30a7fe4703a211d6141ef3d416f3c88f4a468bb6..73ff141f1f3d2ec86b49d371c7d5e125728830eb 100644 --- a/Trigger/TrigSteer/TrigOutputHandling/src/DecisionSummaryMakerAlg.cxx +++ b/Trigger/TrigSteer/TrigOutputHandling/src/DecisionSummaryMakerAlg.cxx @@ -18,18 +18,17 @@ StatusCode DecisionSummaryMakerAlg::initialize() { for ( auto& pair: m_lastStepForChain ) { struct { std::string chain, collection; } conf { pair.first, pair.second }; m_collectionFilter[ conf.collection ].insert( HLT::Identifier( conf.chain).numeric() ); + ATH_MSG_DEBUG( "Final decision of the chain " << conf.chain << " will be read from " << conf.collection ); } return StatusCode::SUCCESS; } -StatusCode DecisionSummaryMakerAlg::finalize() -{ +StatusCode DecisionSummaryMakerAlg::finalize() { return StatusCode::SUCCESS; } -StatusCode DecisionSummaryMakerAlg::execute_r(const EventContext& context) const -{ +StatusCode DecisionSummaryMakerAlg::execute_r(const EventContext& context) const { auto outputHandle{ SG::makeHandle( m_summaryKey, context) }; auto container = std::make_unique<TrigCompositeUtils::DecisionContainer>(); auto aux = std::make_unique<TrigCompositeUtils::DecisionAuxContainer>(); @@ -44,7 +43,7 @@ StatusCode DecisionSummaryMakerAlg::execute_r(const EventContext& context) const ATH_MSG_DEBUG("missing input " << key.key() << " likely rejected"); continue; } - auto thisCollFilter = m_collectionFilter.find(key.key() ); + const auto thisCollFilter = m_collectionFilter.find( key.key() ); if ( thisCollFilter == m_collectionFilter.end() ) { ATH_MSG_WARNING( "The colleciton " << key.key() << " is not configured to contain any final decision, remove it from the configuration of " << name() << " to save time" ); continue; @@ -55,13 +54,13 @@ StatusCode DecisionSummaryMakerAlg::execute_r(const EventContext& context) const sum.insert( TrigCompositeUtils::decisionIDs(decisionObject).begin(), TrigCompositeUtils::decisionIDs(decisionObject).end() ); // copy from vector } - TrigCompositeUtils::DecisionIDContainer final; + TrigCompositeUtils::DecisionIDContainer finalIDs; std::set_intersection( sum.begin(), sum.end(), thisCollFilter->second.begin(), thisCollFilter->second.end(), - std::inserter(final, final.begin() ) ); // should be faster than remove_if + std::inserter(finalIDs, finalIDs.begin() ) ); // should be faster than remove_if TrigCompositeUtils::decisionIDs( output ).insert( TrigCompositeUtils::decisionIDs( output ).end(), - sum.begin(), sum.end() ); + finalIDs.begin(), finalIDs.end() ); } if ( msgLvl( MSG::DEBUG ) ) { diff --git a/Trigger/TrigSteer/TrigOutputHandling/src/HLTResultCreatorByteStream.cxx b/Trigger/TrigSteer/TrigOutputHandling/src/TriggerEDMSerialiserTool.cxx similarity index 78% rename from Trigger/TrigSteer/TrigOutputHandling/src/HLTResultCreatorByteStream.cxx rename to Trigger/TrigSteer/TrigOutputHandling/src/TriggerEDMSerialiserTool.cxx index d06187be36fc9720900d9e9e1b49482bd4b150e0..b4d7ed18fb69ad90a8a15e1533c52dda14a9dd31 100644 --- a/Trigger/TrigSteer/TrigOutputHandling/src/HLTResultCreatorByteStream.cxx +++ b/Trigger/TrigSteer/TrigOutputHandling/src/TriggerEDMSerialiserTool.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration */ @@ -11,22 +11,20 @@ #include "AthenaKernel/StorableConversions.h" #include "TrigSerializeResult/StringSerializer.h" -#include "HLTResultCreatorByteStream.h" +#include "TriggerEDMSerialiserTool.h" -HLTResultCreatorByteStream::HLTResultCreatorByteStream( const std::string& type, +TriggerEDMSerialiserTool::TriggerEDMSerialiserTool( const std::string& type, const std::string& name, const IInterface* parent ) : base_class( type, name, parent ) { } -HLTResultCreatorByteStream::~HLTResultCreatorByteStream() {} +TriggerEDMSerialiserTool::~TriggerEDMSerialiserTool() {} -StatusCode HLTResultCreatorByteStream::initialize() { +StatusCode TriggerEDMSerialiserTool::initialize() { - ATH_CHECK( m_hltResultKey.initialize() ); ATH_CHECK( m_serializerSvc.retrieve() ); - for ( std::string typeAndKey: m_collectionsToSerialize ) { const std::string type = typeAndKey.substr( 0, typeAndKey.find('#') ); if ( type.find('_') == std::string::npos ) { @@ -55,7 +53,7 @@ StatusCode HLTResultCreatorByteStream::initialize() { } -StatusCode HLTResultCreatorByteStream::makeHeader(const Address& address, std::vector<uint32_t>& buffer ) const { +StatusCode TriggerEDMSerialiserTool::makeHeader(const Address& address, std::vector<uint32_t>& buffer ) const { buffer.push_back(0); // fragment size placeholder buffer.push_back( address.clid ); // type info via CLID @@ -67,7 +65,7 @@ StatusCode HLTResultCreatorByteStream::makeHeader(const Address& address, std::v return StatusCode::SUCCESS; } -StatusCode HLTResultCreatorByteStream::fillPayload( void* data, size_t sz, std::vector<uint32_t>& buffer ) const { +StatusCode TriggerEDMSerialiserTool::fillPayload( void* data, size_t sz, std::vector<uint32_t>& buffer ) const { ATH_CHECK( sz != 0 ); ATH_CHECK( data != nullptr ); @@ -84,11 +82,8 @@ StatusCode HLTResultCreatorByteStream::fillPayload( void* data, size_t sz, std:: } +StatusCode TriggerEDMSerialiserTool::fill( HLT::HLTResultMT& resultToFill ) const { - -StatusCode HLTResultCreatorByteStream::createOutput(const EventContext& context ) const { - - auto result = std::make_unique<HLT::HLTResult>(); for ( const Address& address: m_toSerialize ) { ATH_MSG_DEBUG( "Streaming " << address.type << "#" << address.key ); @@ -124,16 +119,12 @@ StatusCode HLTResultCreatorByteStream::createOutput(const EventContext& context ATH_CHECK( makeHeader( address, fragment ) ); ATH_CHECK( fillPayload( mem, sz, fragment ) ); fragment[0] = fragment.size(); - - std::vector<uint32_t>& place = result->getNavigationResult(); - place.insert( place.end(), fragment.begin(), fragment.end() ); + + resultToFill.addSerialisedData( m_moduleID, fragment ); if ( mem ) delete [] static_cast<const char*>( mem ); - ATH_MSG_DEBUG( "Navigation size after inserting " << address.type << "#" << address.key << " " << place.size()*sizeof(uint32_t) << " bytes" ); + ATH_MSG_DEBUG( "Navigation size after inserting " << address.type << "#" << address.key << " " << resultToFill.getSerialisedData( m_moduleID ).size()*sizeof(uint32_t) << " bytes" ); } - - auto resultHandle = SG::makeHandle( m_hltResultKey, context ); - ATH_CHECK( resultHandle.record( std::move( result ) ) ); return StatusCode::SUCCESS; } diff --git a/Trigger/TrigSteer/TrigOutputHandling/src/HLTResultCreatorByteStream.h b/Trigger/TrigSteer/TrigOutputHandling/src/TriggerEDMSerialiserTool.h similarity index 65% rename from Trigger/TrigSteer/TrigOutputHandling/src/HLTResultCreatorByteStream.h rename to Trigger/TrigSteer/TrigOutputHandling/src/TriggerEDMSerialiserTool.h index 2c7a09e42c71ad711c7a08a6de9fdeaccb97d06b..f1ce285a638fceca3237e3c9503b398a118623d8 100644 --- a/Trigger/TrigSteer/TrigOutputHandling/src/HLTResultCreatorByteStream.h +++ b/Trigger/TrigSteer/TrigOutputHandling/src/TriggerEDMSerialiserTool.h @@ -1,8 +1,8 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration */ -#ifndef TRIGOUTPUTHANDLING_HLTResultCreatorCreatorByteStream_H -#define TRIGOUTPUTHANDLING_HLTResultCreatorCreatorByteStream_H +#ifndef TRIGOUTPUTHANDLING_TriggerEDMSerialiserTool_H +#define TRIGOUTPUTHANDLING_TriggerEDMSerialiserTool_H // STL includes #include <string> @@ -12,34 +12,35 @@ #include "GaudiKernel/ServiceHandle.h" // OutputHandling includes -#include "TrigOutputHandling/IHLTOutputTool.h" +#include "TrigOutputHandling/HLTResultMTMakerTool.h" #include "TrigSteeringEvent/HLTResult.h" #include "AthenaKernel/IClassIDSvc.h" #include "AthenaKernel/IAthenaSerializeSvc.h" #include "AthenaKernel/IDictLoaderSvc.h" /** - * @class HLTResultCreatorByteStream is tool responsible for creation of HLT Result filled with streamed EDM collections + * @class TriggerEDMSerialiserTool is tool responsible for creation of HLT Result filled with streamed EDM collections **/ -class HLTResultCreatorByteStream: public extends<AthAlgTool, IHLTOutputTool> +class TriggerEDMSerialiserTool: public extends<AthAlgTool, HLTResultMTMakerTool> { public: - HLTResultCreatorByteStream( const std::string& type, + TriggerEDMSerialiserTool( const std::string& type, const std::string& name, const IInterface* parent ); - virtual ~HLTResultCreatorByteStream(); - virtual StatusCode createOutput(const EventContext& context) const override; + virtual ~TriggerEDMSerialiserTool(); + virtual StatusCode fill( HLT::HLTResultMT& resultToFill ) const override; virtual StatusCode initialize() override; private: Gaudi::Property<std::vector<std::string>> m_collectionsToSerialize { this, "CollectionsToSerialize", {}, "TYPE#SG key of collections to be streamed (like in StreamAOD), the type has to be an exact type i.e. with _vN not the alias type" }; - SG::WriteHandleKey<HLT::HLTResult> m_hltResultKey{this, "HLTResult", "HLTResult", "Name of the HLTResult"}; + + Gaudi::Property<int> m_moduleID { this, "ModuleID", 0, "The HLT result fragment to which the output should be added"}; // internal structure to keep configuration organised conveniently struct Address { @@ -58,7 +59,7 @@ class HLTResultCreatorByteStream: public extends<AthAlgTool, IHLTOutputTool> /** * Given the ID if the collection (in address arg) insert basic streaming info into the buffer. */ - StatusCode makeHeader( const HLTResultCreatorByteStream::Address& address, std::vector<uint32_t>& buffer ) const; + StatusCode makeHeader( const TriggerEDMSerialiserTool::Address& address, std::vector<uint32_t>& buffer ) const; /** * For copy bytest from the memory into the buffer converting from char[] to uint32_t[] @@ -71,4 +72,4 @@ class HLTResultCreatorByteStream: public extends<AthAlgTool, IHLTOutputTool> }; -#endif //> !TRIGOUTPUTHANDLING_HLTResultCreatorCreatorByteStream_H +#endif //> !TRIGOUTPUTHANDLING_TriggerEDMSerialiserTool_H diff --git a/Trigger/TrigSteer/TrigOutputHandling/src/components/TrigOutputHandling_entries.cxx b/Trigger/TrigSteer/TrigOutputHandling/src/components/TrigOutputHandling_entries.cxx index c546e10ab5b7c5362f915ebba16d5126263b8b58..fb8e7791fefd0591f7c56582ddcaa21ced58ceb1 100644 --- a/Trigger/TrigSteer/TrigOutputHandling/src/components/TrigOutputHandling_entries.cxx +++ b/Trigger/TrigSteer/TrigOutputHandling/src/components/TrigOutputHandling_entries.cxx @@ -1,14 +1,14 @@ -#include "../HLTResultCreatorByteStream.h" #include "../HLTEDMCreator.h" #include "../StreamTagMakerTool.h" #include "../HLTResultMTMakerAlg.h" #include "../DecisionSummaryMakerAlg.h" #include "../TriggerBitsMakerTool.h" +#include "../TriggerEDMSerialiserTool.h" + -DECLARE_COMPONENT( HLTResultCreatorByteStream ) DECLARE_COMPONENT( HLTEDMCreator ) DECLARE_COMPONENT( HLTResultMTMakerAlg ) DECLARE_COMPONENT( StreamTagMakerTool ) DECLARE_COMPONENT( DecisionSummaryMakerAlg ) DECLARE_COMPONENT( TriggerBitsMakerTool ) - +DECLARE_COMPONENT( TriggerEDMSerialiserTool ) diff --git a/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/Root/MuonSort.cxx b/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/Root/MuonSort.cxx index b17a3553a38a26b8a38b0690a74aab052a0f412f..3316d1a62892975858051182222fcf53274ddcda 100644 --- a/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/Root/MuonSort.cxx +++ b/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/Root/MuonSort.cxx @@ -14,7 +14,16 @@ REGISTER_ALG_TCS(MuonSort) bool SortByEtLargestM(TCS::GenericTOB* tob1, TCS::GenericTOB* tob2) { - return tob1->Et() > tob2->Et(); + //Order the TOBs according to Et (high to low) or side (first A, then C) or octant index (low to high), geometry here /cvmfs/atlas.cern.ch/repo/sw/database/GroupData/TrigConfMuctpi/TestMioctGeometry2016.dat. + //Handling cases where two muon TOBs have pT>10 + if( (tob1->Et() != tob2->Et()) && ((tob1->Et()<10) || (tob2->Et()<10)) ) return tob1->Et() > tob2->Et(); + else if( tob1->etaDouble() != tob2->etaDouble() ) return tob1->etaDouble() > tob2->etaDouble(); + else + { + if( tob1->phiDouble() * tob2->phiDouble() >=0. ) return tob1->phiDouble() < tob2->phiDouble(); + else if( tob1->phiDouble() >=0. && tob2->phiDouble() <=0. ) return true; + else return false; + } } diff --git a/Trigger/TrigT1/TrigT1CTMonitoring/share/TrigT1CTMonitoringJobOptions.py b/Trigger/TrigT1/TrigT1CTMonitoring/share/TrigT1CTMonitoringJobOptions.py index 53304bdee1382252059a9607563d4882e584a905..d155ccdc728d19f23443cca845ae36055c420de0 100644 --- a/Trigger/TrigT1/TrigT1CTMonitoring/share/TrigT1CTMonitoringJobOptions.py +++ b/Trigger/TrigT1/TrigT1CTMonitoring/share/TrigT1CTMonitoringJobOptions.py @@ -242,7 +242,7 @@ if not hasattr(topSequence,"PrimaryManager"): CTmonMan = topSequence.PrimaryManager from TrigT1CTMonitoring.TrigT1CTMonitoringConf import TrigT1CTMonitoring__BSMonitoring as BSMon -svcMgr.ToolSvc += BSMon() +#svcMgr.ToolSvc += BSMon() BSMonJob=BSMon(ProcessMuctpiData=True, ProcessMuctpiDataRIO=True, ProcessCTPData=True, diff --git a/Trigger/TrigT1/TrigT1CTMonitoring/share/TrigT1CTMonitoringJobOptions_forRecExCommission.py b/Trigger/TrigT1/TrigT1CTMonitoring/share/TrigT1CTMonitoringJobOptions_forRecExCommission.py index e4fda62dd855b7145665bfe6b1391c04eb8ae473..264274099b956627542058663a3984ed91c7a46c 100644 --- a/Trigger/TrigT1/TrigT1CTMonitoring/share/TrigT1CTMonitoringJobOptions_forRecExCommission.py +++ b/Trigger/TrigT1/TrigT1CTMonitoring/share/TrigT1CTMonitoringJobOptions_forRecExCommission.py @@ -274,5 +274,5 @@ if not isOnline: conddb.addFolder('TRIGGER', '/TRIGGER/LVL1/CTPCoreInputMapping') # monMan.AthenaMonTools += [ "TrigT1CTMonitoring__BSMonitoring/BSMon" ] - ToolSvc += CTBSMonTool + #ToolSvc += CTBSMonTool monMan.AthenaMonTools += [ CTBSMonTool ] diff --git a/Trigger/TrigT1/TrigT1CaloMonitoring/share/TrigT1CaloMonitoring_forRecExCommission_Run1.py b/Trigger/TrigT1/TrigT1CaloMonitoring/share/TrigT1CaloMonitoring_forRecExCommission_Run1.py index d9056189ad1b8527ec4f9223acabf25156582799..749265418431e7f2292a6f2a828cc231c5e8328d 100644 --- a/Trigger/TrigT1/TrigT1CaloMonitoring/share/TrigT1CaloMonitoring_forRecExCommission_Run1.py +++ b/Trigger/TrigT1/TrigT1CaloMonitoring/share/TrigT1CaloMonitoring_forRecExCommission_Run1.py @@ -35,7 +35,7 @@ if l1caloRawMon: L1CaloMan = AthenaMonManager( "L1CaloMonManager" ) ## get a handle on the ToolSvc - from AthenaCommon.AppMgr import ToolSvc + #from AthenaCommon.AppMgr import ToolSvc if globalflags.InputFormat() == "bytestream": include ("TrigT1CaloByteStream/ReadLVL1CaloBS_jobOptions.py") @@ -83,7 +83,7 @@ if l1caloRawMon: PathInRootFile = "L1Calo/PPrStabilityMon", #OutputLevel = DEBUG ) - ToolSvc += L1PPrStabilityMonTool + #ToolSvc += L1PPrStabilityMonTool L1CaloMan.AthenaMonTools += [ L1PPrStabilityMonTool ] else: @@ -104,7 +104,7 @@ if l1caloRawMon: PathInRootFile = "L1Calo/PPM/Stability", #OutputLevel = DEBUG ) - ToolSvc += L1PPrStabilityMonTool + #ToolSvc += L1PPrStabilityMonTool L1CaloMan.AthenaMonTools += [ L1PPrStabilityMonTool ] #================================================================================= @@ -127,14 +127,14 @@ if l1caloRawMon: #OnlineTest = True, #OutputLevel = DEBUG ) - ToolSvc += L1PPrMonTool + #ToolSvc += L1PPrMonTool L1CaloMan.AthenaMonTools += [ L1PPrMonTool ] if isData: from TrigT1CaloMonitoring.TrigT1CaloMonitoringConf import LVL1__PPMSimBSMon PPMSimBSMonTool = LVL1__PPMSimBSMon("PPMSimBSMonTool") - ToolSvc += PPMSimBSMonTool + #ToolSvc += PPMSimBSMonTool L1CaloMan.AthenaMonTools += [ PPMSimBSMonTool ] #ToolSvc.PPMSimBSMonTool.OutputLevel = DEBUG from TrigT1CaloTools.TrigT1CaloToolsConf import LVL1__L1TriggerTowerTool @@ -152,7 +152,7 @@ if l1caloRawMon: ErrorPathInRootFile = "L1Calo/PPM/SpareChannels/Errors", #OutputLevel = DEBUG ) - ToolSvc += L1PPrSpareMonTool + #ToolSvc += L1PPrSpareMonTool L1CaloMan.AthenaMonTools += [ L1PPrSpareMonTool ] #================================================================================= @@ -172,7 +172,7 @@ if l1caloRawMon: ErrorPathInRootFile = "L1Calo/JEM/Errors/Hardware", #OutputLevel = DEBUG ) - ToolSvc += L1JEMMonTool + #ToolSvc += L1JEMMonTool L1CaloMan.AthenaMonTools += [ L1JEMMonTool ] #----------------------------------- CMM ------------------------------------------ @@ -186,7 +186,7 @@ if l1caloRawMon: ErrorPathInRootFile = "L1Calo/JEM_CMM/Errors/Hardware", #OutputLevel = DEBUG ) - ToolSvc += L1CMMMonTool + #ToolSvc += L1CMMMonTool L1CaloMan.AthenaMonTools += [ L1CMMMonTool ] @@ -201,7 +201,7 @@ if l1caloRawMon: # JetTool = "LVL1::L1JetTools/L1JetTools_Mon", # JEPEtSumsTool = "LVL1::L1JEPEtSumsTools/L1JEPEtSumsTools_Mon", # ) - # ToolSvc += JEPSimBSMonTool + # #ToolSvc += JEPSimBSMonTool # L1CaloMan.AthenaMonTools += [ JEPSimBSMonTool ] # #ToolSvc.JEPSimBSMonTool.OutputLevel = DEBUG @@ -238,7 +238,7 @@ if l1caloRawMon: MaxEnergyRange = 256, #OutputLevel = DEBUG, ) - ToolSvc += L1BSCPMMonTool + #ToolSvc += L1BSCPMMonTool L1CaloMan.AthenaMonTools += [ L1BSCPMMonTool ] if isData: @@ -247,9 +247,9 @@ if l1caloRawMon: CPMSimBSMonTool = LVL1__CPMSimBSMon("CPMSimBSMonTool", EmTauTool = "LVL1::L1EmTauTools/L1EmTauTools_Mon", ) - ToolSvc += CPMSimBSMonTool + #ToolSvc += CPMSimBSMonTool L1CaloMan.AthenaMonTools += [ CPMSimBSMonTool ] - #ToolSvc.CPMSimBSMonTool.OutputLevel = DEBUG + ##ToolSvc.CPMSimBSMonTool.OutputLevel = DEBUG from TrigT1CaloTools.TrigT1CaloToolsConf import LVL1__L1EmTauTools L1EmTauTools = LVL1__L1EmTauTools("L1EmTauTools_Mon") @@ -265,7 +265,7 @@ if l1caloRawMon: #OnlineTest = True, #OutputLevel = DEBUG, ) - ToolSvc += L1BSRODMonTool + #ToolSvc += L1BSRODMonTool L1CaloMan.AthenaMonTools += [ L1BSRODMonTool ] #================================================================================= @@ -281,7 +281,7 @@ if l1caloRawMon: #OnlineTest = True, #OutputLevel = DEBUG ) - ToolSvc += L1GlobalMonTool + #ToolSvc += L1GlobalMonTool L1CaloMan.AthenaMonTools += [ L1GlobalMonTool ] # if isData and isCalo and Offline and (rec.triggerStream() == "JetTauEtmiss" @@ -296,7 +296,7 @@ if l1caloRawMon: # L1EmEfficienciesMonTool = LVL1__EmEfficienciesMonTool ( name = "EmEfficienciesMonTool", # TriggerStrings = trigstring # ) - # ToolSvc += L1EmEfficienciesMonTool + # #ToolSvc += L1EmEfficienciesMonTool # L1CaloMan.AthenaMonTools += [ L1EmEfficienciesMonTool ] # if not hasattr( ToolSvc, "TrigDecisionTool" ): # from TrigDecisionTool.TrigDecisionToolConf import Trig__TrigDecisionTool @@ -319,17 +319,17 @@ if l1caloRawMon: # L1JetEfficienciesMonTool = LVL1__JetEfficienciesMonTool ( name = "JetEfficienciesMonTool", # TriggerStrings = trigstring # ) - # from AthenaCommon.AppMgr import ToolSvc + # #from AthenaCommon.AppMgr import ToolSvc # ToolSvc += JetCleaningTool('JetCleaningLooseTool') - # # ToolSvc += JetCleaningTool('JetCleaningMediumTool') + # #ToolSvc += JetCleaningTool('JetCleaningMediumTool') # ToolSvc += JetCleaningTool('JetCleaningTightTool') # L1JetEfficienciesMonTool.JetCleaningLooseTool = ConfiguredJetCleaningTool_Loose("JetCleaningLooseTool") # # L1JetEfficienciesMonTool.JetCleaningMediumTool = ConfiguredJetCleaningTool_Medium("JetCleaningMediumTool") # L1JetEfficienciesMonTool.JetCleaningTightTool = ConfiguredJetCleaningTool_Tight("JetCleaningTightTool") - # ToolSvc += L1JetEfficienciesMonTool + # #ToolSvc += L1JetEfficienciesMonTool # L1CaloMan.AthenaMonTools += [ L1JetEfficienciesMonTool ] - # if not hasattr( ToolSvc, "TrigDecisionTool" ): + # if not hasattr( #ToolSvc, "TrigDecisionTool" ): # from TrigDecisionTool.TrigDecisionToolConf import Trig__TrigDecisionTool # tdt = Trig__TrigDecisionTool('TrigDecisionTool') # ToolSvc += tdt diff --git a/Trigger/TrigT1/TrigT1CaloMonitoring/share/TrigT1CaloMonitoring_forRecExCommission_Run2.py b/Trigger/TrigT1/TrigT1CaloMonitoring/share/TrigT1CaloMonitoring_forRecExCommission_Run2.py index ac0decd129cc18735be895f268fca36ee9139e16..e15e73e900be5b2fc5d9f41cc184d522b85e84bd 100644 --- a/Trigger/TrigT1/TrigT1CaloMonitoring/share/TrigT1CaloMonitoring_forRecExCommission_Run2.py +++ b/Trigger/TrigT1/TrigT1CaloMonitoring/share/TrigT1CaloMonitoring_forRecExCommission_Run2.py @@ -99,7 +99,7 @@ if l1caloRawMon: PathInRootFile="L1Calo/PPrStabilityMon", # OutputLevel = DEBUG ) - ToolSvc += L1PPrStabilityMonTool + #ToolSvc += L1PPrStabilityMonTool L1CaloMan.AthenaMonTools += [L1PPrStabilityMonTool] # --- BunchCrossing Tool configuration --- @@ -127,7 +127,7 @@ if l1caloRawMon: PathInRootFile="L1Calo/PPM/Stability", #OutputLevel = DEBUG ) - ToolSvc += L1PPrStabilityMonTool + #ToolSvc += L1PPrStabilityMonTool L1CaloMan.AthenaMonTools += [L1PPrStabilityMonTool] #====================================================================== @@ -150,14 +150,14 @@ if l1caloRawMon: #OnlineTest = True, #OutputLevel = DEBUG ) - ToolSvc += L1PPrMonTool + #ToolSvc += L1PPrMonTool L1CaloMan.AthenaMonTools += [L1PPrMonTool] if isData: from TrigT1CaloMonitoring.TrigT1CaloMonitoringConf import LVL1__PPMSimBSMon PPMSimBSMonTool = LVL1__PPMSimBSMon("PPMSimBSMonTool") - ToolSvc += PPMSimBSMonTool + #ToolSvc += PPMSimBSMonTool L1CaloMan.AthenaMonTools += [PPMSimBSMonTool] #ToolSvc.PPMSimBSMonTool.OutputLevel = DEBUG from TrigT1CaloTools.TrigT1CaloToolsConf import LVL1__L1TriggerTowerTool @@ -174,7 +174,7 @@ if l1caloRawMon: ErrorPathInRootFile="L1Calo/PPM/SpareChannels/Errors", #OutputLevel = DEBUG ) - ToolSvc += L1PPrSpareMonTool + #ToolSvc += L1PPrSpareMonTool L1CaloMan.AthenaMonTools += [L1PPrSpareMonTool] #====================================================================== @@ -184,20 +184,20 @@ if l1caloRawMon: #------------------------------------ JEM ----------------------------- from TrigT1CaloMonitoring.TrigT1CaloMonitoringConf import LVL1__JEPJEMMon L1JEPJEMMonTool = LVL1__JEPJEMMon("L1JEPJEMMonTool") - ToolSvc += L1JEPJEMMonTool + #ToolSvc += L1JEPJEMMonTool L1CaloMan.AthenaMonTools += [L1JEPJEMMonTool] #----------------------------------- CMX ------------------------------ from TrigT1CaloMonitoring.TrigT1CaloMonitoringConf import LVL1__JEPCMXMon L1JEPCMXMonTool = LVL1__JEPCMXMon("L1JEPCMXMonTool") - ToolSvc += L1JEPCMXMonTool + #ToolSvc += L1JEPCMXMonTool L1CaloMan.AthenaMonTools += [L1JEPCMXMonTool] if isData: #--------------------- Transmission and Performance --------------- from TrigT1CaloMonitoring.TrigT1CaloMonitoringConf import LVL1__JEPSimMon JEPSimMonTool = LVL1__JEPSimMon("JEPSimMonTool") - ToolSvc += JEPSimMonTool + #ToolSvc += JEPSimMonTool L1CaloMan.AthenaMonTools += [JEPSimMonTool] # ToolSvc.JEPSimBSMonTool.OutputLevel = DEBUG @@ -228,14 +228,14 @@ if l1caloRawMon: # CPMTowers, CMXCPTobs and CMXCPHits from TrigT1CaloMonitoring.TrigT1CaloMonitoringConf import LVL1__CPMon L1CPMMonTool = LVL1__CPMon("L1CPMMonTool") - ToolSvc += L1CPMMonTool + #ToolSvc += L1CPMMonTool L1CaloMan.AthenaMonTools += [L1CPMMonTool] if isData: from TrigT1CaloMonitoring.TrigT1CaloMonitoringConf import LVL1__CPSimMon CPSimMonTool = LVL1__CPSimMon("CPSimMonTool") - ToolSvc += CPSimMonTool + #ToolSvc += CPSimMonTool L1CaloMan.AthenaMonTools += [CPSimMonTool] # ToolSvc.CPMSimBSMonTool.OutputLevel = DEBUG @@ -253,7 +253,7 @@ if l1caloRawMon: #OnlineTest = True, #OutputLevel = DEBUG, ) - ToolSvc += L1BSRODMonTool + #ToolSvc += L1BSRODMonTool L1CaloMan.AthenaMonTools += [L1BSRODMonTool] #================================================================== @@ -261,7 +261,7 @@ if l1caloRawMon: #================================================================== from TrigT1CaloMonitoring.TrigT1CaloMonitoringConf import LVL1__OverviewMon L1OverviewMonTool = LVL1__OverviewMon("L1OverviewMonTool") - ToolSvc += L1OverviewMonTool + #ToolSvc += L1OverviewMonTool L1CaloMan.AthenaMonTools += [L1OverviewMonTool] from TrigT1CaloMonitoringTools.TrigT1CaloMonitoringToolsConf import LVL1__TrigT1CaloMonErrorTool @@ -269,7 +269,7 @@ if l1caloRawMon: name="TrigT1CaloMonErrorTool", FlagCorruptEvents="None" ) - ToolSvc += L1MonErrorTool + #ToolSvc += L1MonErrorTool # pass # if isData and isCalo and Offline and (rec.triggerStream() == "JetTauEtmiss" @@ -282,7 +282,7 @@ if l1caloRawMon: from TrigT1CaloMonitoring.TrigT1CaloMonitoringConf import LVL1__TagProbeEfficiencyMon TagProbeEfficiencyMonTool = LVL1__TagProbeEfficiencyMon("TagProbeEfficiencyMonTool") - ToolSvc += TagProbeEfficiencyMonTool + #ToolSvc += TagProbeEfficiencyMonTool L1CaloMan.AthenaMonTools += [TagProbeEfficiencyMonTool] diff --git a/Trigger/TrigT1/TrigT1CaloMonitoring/share/TrigT1CaloMonitoring_forRecExCommission_cpu.py b/Trigger/TrigT1/TrigT1CaloMonitoring/share/TrigT1CaloMonitoring_forRecExCommission_cpu.py index 0988d00b0b8223baceec70421fdf8c9ac34d6360..61c7dc8413d4ac5a579cca92668e0720f6381363 100644 --- a/Trigger/TrigT1/TrigT1CaloMonitoring/share/TrigT1CaloMonitoring_forRecExCommission_cpu.py +++ b/Trigger/TrigT1/TrigT1CaloMonitoring/share/TrigT1CaloMonitoring_forRecExCommission_cpu.py @@ -55,7 +55,7 @@ if l1caloRawMon: L1CaloManD = AthenaMonManager( "L1CaloMonManagerD" ) ## get a handle on the ToolSvc - from AthenaCommon.AppMgr import ToolSvc + #from AthenaCommon.AppMgr import ToolSvc if globalflags.InputFormat() == "bytestream": include ("TrigT1CaloByteStream/ReadLVL1CaloBS_jobOptions.py") @@ -68,28 +68,28 @@ if l1caloRawMon: name = "L1TrigT1CaloBSMonToolA1", LoadL1CaloPPM = True ) - ToolSvc += L1TrigT1CaloBSMonToolA1 + #ToolSvc += L1TrigT1CaloBSMonToolA1 L1CaloMan0A1.AthenaMonTools += [ L1TrigT1CaloBSMonToolA1 ] # CPM L1TrigT1CaloBSMonToolA2 = TrigT1CaloBSMon( name = "L1TrigT1CaloBSMonToolA2", LoadL1CaloCPM = True ) - ToolSvc += L1TrigT1CaloBSMonToolA2 + #ToolSvc += L1TrigT1CaloBSMonToolA2 L1CaloMan0A2.AthenaMonTools += [ L1TrigT1CaloBSMonToolA2 ] # JEM L1TrigT1CaloBSMonToolA3 = TrigT1CaloBSMon( name = "L1TrigT1CaloBSMonToolA3", LoadL1CaloJEM = True ) - ToolSvc += L1TrigT1CaloBSMonToolA3 + #ToolSvc += L1TrigT1CaloBSMonToolA3 L1CaloMan0A3.AthenaMonTools += [ L1TrigT1CaloBSMonToolA3 ] # ROD headers L1TrigT1CaloBSMonToolA4 = TrigT1CaloBSMon( name = "L1TrigT1CaloBSMonToolA4", LoadL1CaloROD = True ) - ToolSvc += L1TrigT1CaloBSMonToolA4 + #ToolSvc += L1TrigT1CaloBSMonToolA4 L1CaloMan0A4.AthenaMonTools += [ L1TrigT1CaloBSMonToolA4 ] include("CaloConditions/CaloConditions_jobOptions.py") @@ -106,7 +106,7 @@ if l1caloRawMon: name = "L1TrigT1CaloBSMonToolB", LoadCaloCells = True ) - ToolSvc += L1TrigT1CaloBSMonToolB + #ToolSvc += L1TrigT1CaloBSMonToolB L1CaloMan0B.AthenaMonTools += [ L1TrigT1CaloBSMonToolB ] from TrigT1CaloMonitoringTools.LVL1CaloMonFlags import LVL1CaloMonFlags @@ -144,7 +144,7 @@ if l1caloRawMon: PathInRootFile = "L1Calo/PPrStabilityMon", #OutputLevel = DEBUG ) - ToolSvc += L1PPrStabilityMonTool + #ToolSvc += L1PPrStabilityMonTool L1CaloMan1A.AthenaMonTools += [ L1PPrStabilityMonTool ] else: @@ -167,7 +167,7 @@ if l1caloRawMon: PathInRootFile = "L1Calo/PPM/Stability", #OutputLevel = DEBUG ) - ToolSvc += L1PPrStabilityMonToolA + #ToolSvc += L1PPrStabilityMonToolA L1CaloMan1A.AthenaMonTools += [ L1PPrStabilityMonToolA ] L1PPrStabilityMonToolB = PPrStabilityMon( @@ -182,7 +182,7 @@ if l1caloRawMon: PathInRootFile = "L1Calo/PPM/Stability", #OutputLevel = DEBUG ) - ToolSvc += L1PPrStabilityMonToolB + #ToolSvc += L1PPrStabilityMonToolB L1CaloMan1B.AthenaMonTools += [ L1PPrStabilityMonToolB ] L1PPrStabilityMonToolC = PPrStabilityMon( @@ -197,7 +197,7 @@ if l1caloRawMon: PathInRootFile = "L1Calo/PPM/Stability", #OutputLevel = DEBUG ) - ToolSvc += L1PPrStabilityMonToolC + #ToolSvc += L1PPrStabilityMonToolC L1CaloMan1C.AthenaMonTools += [ L1PPrStabilityMonToolC ] #================================================================================= @@ -218,14 +218,14 @@ if l1caloRawMon: ErrorPathInRootFile = "L1Calo/PPM/Errors", #OutputLevel = DEBUG ) - ToolSvc += L1PPrMonTool + #ToolSvc += L1PPrMonTool L1CaloMan2.AthenaMonTools += [ L1PPrMonTool ] if isData: from TrigT1CaloMonitoring.TrigT1CaloMonitoringConf import PPMSimBSMon PPMSimBSMonTool = PPMSimBSMon("PPMSimBSMonTool") - ToolSvc += PPMSimBSMonTool + #ToolSvc += PPMSimBSMonTool L1CaloMan3.AthenaMonTools += [ PPMSimBSMonTool ] #ToolSvc.PPMSimBSMonTool.OutputLevel = DEBUG from TrigT1CaloTools.TrigT1CaloToolsConf import LVL1__L1TriggerTowerTool @@ -243,7 +243,7 @@ if l1caloRawMon: ErrorPathInRootFile = "L1Calo/PPM/SpareChannels/Errors", #OutputLevel = DEBUG ) - ToolSvc += L1PPrSpareMonTool + #ToolSvc += L1PPrSpareMonTool L1CaloMan4.AthenaMonTools += [ L1PPrSpareMonTool ] #================================================================================= @@ -263,7 +263,7 @@ if l1caloRawMon: ErrorPathInRootFile = "L1Calo/JEM/Errors/Hardware", #OutputLevel = DEBUG ) - ToolSvc += L1JEMMonTool + #ToolSvc += L1JEMMonTool L1CaloMan5.AthenaMonTools += [ L1JEMMonTool ] #----------------------------------- CMM ------------------------------------------ @@ -277,7 +277,7 @@ if l1caloRawMon: ErrorPathInRootFile = "L1Calo/JEM_CMM/Errors/Hardware", #OutputLevel = DEBUG ) - ToolSvc += L1CMMMonTool + #ToolSvc += L1CMMMonTool L1CaloMan6.AthenaMonTools += [ L1CMMMonTool ] if isData: @@ -289,7 +289,7 @@ if l1caloRawMon: JetTool = "LVL1::L1JetTools/L1JetTools_Mon", JEPEtSumsTool = "LVL1::L1JEPEtSumsTools/L1JEPEtSumsTools_Mon", ) - ToolSvc += JEPSimBSMonTool + #ToolSvc += JEPSimBSMonTool L1CaloMan7.AthenaMonTools += [ JEPSimBSMonTool ] #ToolSvc.JEPSimBSMonTool.OutputLevel = DEBUG @@ -326,7 +326,7 @@ if l1caloRawMon: MaxEnergyRange = 256, #OutputLevel = DEBUG, ) - ToolSvc += L1BSCPMMonTool + #ToolSvc += L1BSCPMMonTool L1CaloMan8.AthenaMonTools += [ L1BSCPMMonTool ] if isData: @@ -335,7 +335,7 @@ if l1caloRawMon: CPMSimBSMonTool = CPMSimBSMon("CPMSimBSMonTool", EmTauTool = "LVL1::L1EmTauTools/L1EmTauTools_Mon", ) - ToolSvc += CPMSimBSMonTool + #ToolSvc += CPMSimBSMonTool L1CaloMan9.AthenaMonTools += [ CPMSimBSMonTool ] #ToolSvc.CPMSimBSMonTool.OutputLevel = DEBUG @@ -353,7 +353,7 @@ if l1caloRawMon: #OnlineTest = True, #OutputLevel = DEBUG, ) - ToolSvc += L1BSRODMonTool + #ToolSvc += L1BSRODMonTool L1CaloManA.AthenaMonTools += [ L1BSRODMonTool ] #================================================================================= @@ -369,7 +369,7 @@ if l1caloRawMon: #OnlineTest = True, #OutputLevel = DEBUG ) - ToolSvc += L1GlobalMonTool + #ToolSvc += L1GlobalMonTool L1CaloManB.AthenaMonTools += [ L1GlobalMonTool ] if isData and isCalo and Offline and (rec.triggerStream() == "JetTauEtmiss" @@ -384,7 +384,7 @@ if l1caloRawMon: L1EmEfficienciesMonTool = EmEfficienciesMonTool ( name = "EmEfficienciesMonTool", TriggerStrings = trigstring ) - ToolSvc += L1EmEfficienciesMonTool + #ToolSvc += L1EmEfficienciesMonTool L1CaloManC.AthenaMonTools += [ L1EmEfficienciesMonTool ] if not hasattr( ToolSvc, "TrigDecisionTool" ): from TrigDecisionTool.TrigDecisionToolConf import Trig__TrigDecisionTool @@ -405,7 +405,7 @@ if l1caloRawMon: ) ToolSvc += L1JetEfficienciesMonTool L1CaloManD.AthenaMonTools += [ L1JetEfficienciesMonTool ] - if not hasattr( ToolSvc, "TrigDecisionTool" ): + if not hasattr( #ToolSvc, "TrigDecisionTool" ): from TrigDecisionTool.TrigDecisionToolConf import Trig__TrigDecisionTool tdt = Trig__TrigDecisionTool('TrigDecisionTool') ToolSvc += tdt diff --git a/Trigger/TrigT1/TrigT1CaloMonitoring/share/TrigT1CaloMonitoring_runStandalone.py b/Trigger/TrigT1/TrigT1CaloMonitoring/share/TrigT1CaloMonitoring_runStandalone.py index 3dd3a5ad198c0a240d51ade6a737b82512c11df8..fbe2c5141ec88e07c74c7f126418f1661029fe93 100644 --- a/Trigger/TrigT1/TrigT1CaloMonitoring/share/TrigT1CaloMonitoring_runStandalone.py +++ b/Trigger/TrigT1/TrigT1CaloMonitoring/share/TrigT1CaloMonitoring_runStandalone.py @@ -64,32 +64,32 @@ L1CaloMan.ManualRunLBSetup = False if doJEPJEMMon: from TrigT1CaloMonitoring.TrigT1CaloMonitoringConf import LVL1__JEPJEMMon L1JEPJEMMonTool = LVL1__JEPJEMMon("L1JEPJEMMonTool") - ToolSvc += L1JEPJEMMonTool + #ToolSvc += L1JEPJEMMonTool L1CaloMan.AthenaMonTools += [L1JEPJEMMonTool] if doJEPCMXMon: from TrigT1CaloMonitoring.TrigT1CaloMonitoringConf import LVL1__JEPCMXMon L1JEPCMXMonTool = LVL1__JEPCMXMon("L1JEPCMXMonTool") - ToolSvc += L1JEPCMXMonTool + #ToolSvc += L1JEPCMXMonTool L1CaloMan.AthenaMonTools += [L1JEPCMXMonTool] if doCPMon: from TrigT1CaloMonitoring.TrigT1CaloMonitoringConf import LVL1__CPMon L1CPMMonTool = LVL1__CPMon("L1CPMMonTool") - ToolSvc += L1CPMMonTool + #ToolSvc += L1CPMMonTool L1CaloMan.AthenaMonTools += [L1CPMMonTool] if doCPSimMon: from TrigT1CaloMonitoring.TrigT1CaloMonitoringConf import LVL1__CPSimMon CPSimMonTool = LVL1__CPSimMon("CPSimMonTool") - ToolSvc += CPSimMonTool + #ToolSvc += CPSimMonTool L1CaloMan.AthenaMonTools += [CPSimMonTool] if doJEPSimMon: from TrigT1CaloMonitoring.TrigT1CaloMonitoringConf import LVL1__JEPSimMon JEPSimMonTool = LVL1__JEPSimMon("JEPSimMonTool") - ToolSvc += JEPSimMonTool + #ToolSvc += JEPSimMonTool L1CaloMan.AthenaMonTools += [JEPSimMonTool] if doRODMon: @@ -97,14 +97,14 @@ if doRODMon: L1BSRODMonTool = LVL1__RODMon( name="L1BSRODMonTool", ) - ToolSvc += L1BSRODMonTool + #ToolSvc += L1BSRODMonTool L1CaloMan.AthenaMonTools += [L1BSRODMonTool] if doOverviewMon: from TrigT1CaloMonitoring.TrigT1CaloMonitoringConf import LVL1__OverviewMon L1OverviewMonTool = LVL1__OverviewMon("L1OverviewMonTool") - ToolSvc += L1OverviewMonTool + #ToolSvc += L1OverviewMonTool L1CaloMan.AthenaMonTools += [L1OverviewMonTool] from TrigT1CaloMonitoringTools.TrigT1CaloMonitoringToolsConf import LVL1__TrigT1CaloMonErrorTool diff --git a/Trigger/TrigT1/TrigT1Monitoring/share/TrigT1Monitoring_forRecExCommission_Run2.py b/Trigger/TrigT1/TrigT1Monitoring/share/TrigT1Monitoring_forRecExCommission_Run2.py index 9a4003ea341a44fa8762b536eefdb6948bb37712..c8bd2f89a04fdcf0002d2cb7f424ab2aa02ed30b 100644 --- a/Trigger/TrigT1/TrigT1Monitoring/share/TrigT1Monitoring_forRecExCommission_Run2.py +++ b/Trigger/TrigT1/TrigT1Monitoring/share/TrigT1Monitoring_forRecExCommission_Run2.py @@ -71,7 +71,7 @@ if l1caloRawMon: MaxEnergyRange = 256, #OutputLevel = VERBOSE, ) - ToolSvc += CalorimeterL1CaloMonTool + #ToolSvc += CalorimeterL1CaloMonTool L1Man.AthenaMonTools += [ CalorimeterL1CaloMonTool ] # HV corrections from LArRecUtils.LArHVCorrToolDefault import LArHVCorrToolDefault @@ -95,7 +95,7 @@ if l1caloRawMon: DoHVDifference = doHV, PathInRootFile = "LVL1_Interfaces/Calorimeter", ) - ToolSvc += L1CaloHVScalesMonTool + #ToolSvc += L1CaloHVScalesMonTool L1Man.AthenaMonTools += [ L1CaloHVScalesMonTool ] # PMT scores from TrigT1Monitoring.TrigT1MonitoringConf import LVL1__L1CaloPMTScoresMon @@ -103,7 +103,7 @@ if l1caloRawMon: name = "L1CaloPMTScoresMonTool", PathInRootFile = "LVL1_Interfaces/Calorimeter", ) - ToolSvc += L1CaloPMTScoresMonTool + #ToolSvc += L1CaloPMTScoresMonTool L1Man.AthenaMonTools += [ L1CaloPMTScoresMonTool ] if isData: #and DQMonFlags.doCTPMon(): # KW this is not set in online environment! Investigate! # GP doCTPMon() commented out for now @@ -117,7 +117,7 @@ if l1caloRawMon: name = "L1CaloCTPMonTool", #OutputLevel = DEBUG, ) - ToolSvc += L1CaloCTPMonTool + #ToolSvc += L1CaloCTPMonTool L1Man.AthenaMonTools += [ L1CaloCTPMonTool ] ####################### L1Calo->Level-2 ################################ @@ -136,7 +136,7 @@ if l1caloRawMon: #OutputLevel = DEBUG, #OutputLevel = VERBOSE, ) - ToolSvc += L1CaloL1TopoMonTool + #ToolSvc += L1CaloL1TopoMonTool L1Man.AthenaMonTools += [ L1CaloL1TopoMonTool ] ########################################################################## diff --git a/Trigger/TrigT1/TrigT1Monitoring/share/TrigT1Monitoring_forRecExCommission_cpu.py b/Trigger/TrigT1/TrigT1Monitoring/share/TrigT1Monitoring_forRecExCommission_cpu.py index ec39e07a879990b59cc65e2512a42e86b69b1444..2188933a624153bc6cba1dde8822cb72709fc5eb 100644 --- a/Trigger/TrigT1/TrigT1Monitoring/share/TrigT1Monitoring_forRecExCommission_cpu.py +++ b/Trigger/TrigT1/TrigT1Monitoring/share/TrigT1Monitoring_forRecExCommission_cpu.py @@ -50,7 +50,7 @@ if l1caloRawMon: L1Man2 = topSequence.L1MonManager2 ## get a handle on the ToolSvc - from AthenaCommon.AppMgr import ToolSvc + #from AthenaCommon.AppMgr import ToolSvc if globalflags.InputFormat() == "bytestream": include ("TrigT1CaloByteStream/ReadLVL1CaloBS_jobOptions.py") @@ -78,7 +78,7 @@ if l1caloRawMon: MaxEnergyRange = 256, #OutputLevel = VERBOSE, ) - ToolSvc += CalorimeterL1CaloMonTool + #ToolSvc += CalorimeterL1CaloMonTool L1Man0A.AthenaMonTools += [ CalorimeterL1CaloMonTool ] # HV corrections from LArRecUtils.LArHVCorrToolDefault import LArHVCorrToolDefault @@ -102,7 +102,7 @@ if l1caloRawMon: DoHVDifference = doHV, PathInRootFile = "LVL1_Interfaces/Calorimeter", ) - ToolSvc += L1CaloHVScalesMonTool + #ToolSvc += L1CaloHVScalesMonTool L1Man0B.AthenaMonTools += [ L1CaloHVScalesMonTool ] # PMT scores from TrigT1Monitoring.TrigT1MonitoringConf import LVL1__L1CaloPMTScoresMon @@ -110,7 +110,7 @@ if l1caloRawMon: name = "L1CaloPMTScoresMonTool", PathInRootFile = "LVL1_Interfaces/Calorimeter", ) - ToolSvc += L1CaloPMTScoresMonTool + #ToolSvc += L1CaloPMTScoresMonTool L1Man0C.AthenaMonTools += [ L1CaloPMTScoresMonTool ] if isData and DQMonFlags.doCTPMon(): @@ -125,7 +125,7 @@ if l1caloRawMon: #OutputLevel = DEBUG, #OutputLevel = VERBOSE, ) - ToolSvc += L1CaloCTPMonTool + #ToolSvc += L1CaloCTPMonTool L1Man1.AthenaMonTools += [ L1CaloCTPMonTool ] ####################### L1Calo->Level-2 ################################ @@ -134,7 +134,7 @@ if l1caloRawMon: name = "L1CaloLevel2MonTool", #OutputLevel = DEBUG, ) - ToolSvc += L1CaloLevel2MonTool + #ToolSvc += L1CaloLevel2MonTool L1Man2.AthenaMonTools += [ L1CaloLevel2MonTool ] ########################################################################## diff --git a/Trigger/TrigT1/TrigT1NSW/CMakeLists.txt b/Trigger/TrigT1/TrigT1NSW/CMakeLists.txt index ed0571b725cfb28abaf74fca61ea8b74555732b6..c17bb468f64c867169bc45b92f68103feda8dd77 100644 --- a/Trigger/TrigT1/TrigT1NSW/CMakeLists.txt +++ b/Trigger/TrigT1/TrigT1NSW/CMakeLists.txt @@ -27,7 +27,7 @@ atlas_add_component( TrigT1NSW src/components/*.cxx INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} ${BOOST_INCLUDE_DIRS} ${TBB_INCLUDE_DIRS} LINK_LIBRARIES ${ROOT_LIBRARIES} ${BOOST_LIBRARIES} ${TBB_LIBRARIES} - AthenaBaseComps GaudiKernel TrigInterfacesLib TrigT1NSWSimTools AthenaMonitoringLib + AthenaBaseComps GaudiKernel TrigInterfacesLib TrigT1NSWSimToolsLib AthenaMonitoringLib StoreGateLib SGtests EventInfo ) # Install files from the package: diff --git a/Trigger/TrigT1/TrigT1NSWSimTools/CMakeLists.txt b/Trigger/TrigT1/TrigT1NSWSimTools/CMakeLists.txt index bb28024cce2772a06cf388b4ee3ea67d0221d1d8..f42fd2cc8d74a72f00ff79453d6cce1ac7d3f5c2 100644 --- a/Trigger/TrigT1/TrigT1NSWSimTools/CMakeLists.txt +++ b/Trigger/TrigT1/TrigT1NSWSimTools/CMakeLists.txt @@ -31,10 +31,9 @@ find_package( CLHEP ) find_package( Eigen ) find_package( ROOT COMPONENTS Core Tree MathCore Hist RIO pthread MathMore Minuit Minuit2 Matrix Physics HistPainter Rint ) -# Component(s) in the package: -atlas_add_library( TrigT1NSWSimTools +# Library in the package +atlas_add_library( TrigT1NSWSimToolsLib src/*.cxx - src/components/*.cxx PUBLIC_HEADERS TrigT1NSWSimTools INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} ${CLHEP_INCLUDE_DIRS} ${EIGEN_INCLUDE_DIRS} ${BOOST_INCLUDE_DIRS} ${TBB_INCLUDE_DIRS} ${HEPMC_INCLUDE_DIRS} LINK_LIBRARIES ${ROOT_LIBRARIES} ${CLHEP_LIBRARIES} ${EIGEN_LIBRARIES} ${BOOST_LIBRARIES} ${TBB_LIBRARIES} ${HEPMC_LIBRARIES} @@ -42,6 +41,16 @@ atlas_add_library( TrigT1NSWSimTools MuonDigitContainer MuonIdHelpersLib MuonSimEvent MuonSimData ) +# Component(s) in the package: +atlas_add_component( TrigT1NSWSimTools + src/*.cxx + src/components/*.cxx + INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} ${CLHEP_INCLUDE_DIRS} ${EIGEN_INCLUDE_DIRS} ${BOOST_INCLUDE_DIRS} ${TBB_INCLUDE_DIRS} ${HEPMC_INCLUDE_DIRS} + LINK_LIBRARIES ${ROOT_LIBRARIES} ${CLHEP_LIBRARIES} ${EIGEN_LIBRARIES} ${BOOST_LIBRARIES} ${TBB_LIBRARIES} ${HEPMC_LIBRARIES} + SGTools GaudiKernel AthenaBaseComps AthenaKernel AGDDKernel GeoPrimitives Identifier EventInfo MuonAGDDDescription MuonReadoutGeometry + MuonDigitContainer MuonIdHelpersLib MuonSimEvent MuonSimData TrigT1NSWSimToolsLib) + + #loop over each cxx file in the util directory of this package file (GLOB util_sources RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}/util" "${CMAKE_CURRENT_SOURCE_DIR}/util/[a-zA-Z0-9]*.cxx") foreach (SOURCE ${util_sources}) @@ -49,7 +58,7 @@ atlas_add_library( TrigT1NSWSimTools string (REGEX REPLACE ".cxx$" "" FILE ${SOURCE}) atlas_add_executable (${FILE} SOURCES util/${FILE}.cxx LINK_LIBRARIES ${ROOT_LIBRARIES} ${CLHEP_LIBRARIES} ${EIGEN_LIBRARIES} ${BOOST_LIBRARIES} ${TBB_LIBRARIES} ${HEPMC_LIBRARIES} SGTools GaudiKernel AthenaBaseComps AthenaKernel AGDDKernel GeoPrimitives Identifier EventInfo MuonAGDDDescription MuonReadoutGeometry - MuonDigitContainer MuonIdHelpersLib MuonSimEvent MuonSimData TrigT1NSWSimTools) + MuonDigitContainer MuonIdHelpersLib MuonSimEvent MuonSimData TrigT1NSWSimToolsLib) endforeach (SOURCE ${util_sources}) diff --git a/Trigger/TrigTools/TrigVKalFitter/src/TVKalFitter.cxx b/Trigger/TrigTools/TrigVKalFitter/src/TVKalFitter.cxx index 30c268e126a047580604c84d359ce66fbc225be3..e450b80511063522c5359645912680e1fea0c11a 100755 --- a/Trigger/TrigTools/TrigVKalFitter/src/TVKalFitter.cxx +++ b/Trigger/TrigTools/TrigVKalFitter/src/TVKalFitter.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration */ // Header include @@ -409,7 +409,7 @@ StatusCode TrigVKalFitter::VKalGetTrkCov(const long int iTrk,const long int NTrk if(!m_FitStatus) return StatusCode::FAILURE; int i,j,ik,jk; - double ErrMtx[ (3*NTRMAXTRIG+3)*(3*NTRMAXTRIG+4)/2 ]; + double ErrMtx[ (3*NTRMAXTRIG+3)*(3*NTRMAXTRIG+4)/2 ] = {0}; double CovMtxOld[6][6]; double CovMtx [6][6]; diff --git a/Trigger/TrigValidation/TrigAnalysisTest/share/testAthenaTrigAOD_xTrigDecision_HLTMonitoring.py b/Trigger/TrigValidation/TrigAnalysisTest/share/testAthenaTrigAOD_xTrigDecision_HLTMonitoring.py index 7a1ea9601e2f28b04783d8751cb1a5de9956b3c0..f63ff87902c69747d941bbc2196af4b858534423 100644 --- a/Trigger/TrigValidation/TrigAnalysisTest/share/testAthenaTrigAOD_xTrigDecision_HLTMonitoring.py +++ b/Trigger/TrigValidation/TrigAnalysisTest/share/testAthenaTrigAOD_xTrigDecision_HLTMonitoring.py @@ -42,9 +42,9 @@ HLTMon = HLTMonTool(name = 'HLTMon', histoPathBase = "/Trigger/HLT", TrigConfigTool=cfgtool); -ToolSvc += HLTMon; +#ToolSvc += HLTMon; -HLTMonManager.AthenaMonTools += [ "HLTMonTool/HLTMon" ]; +HLTMonManager.AthenaMonTools += [ HLTMon ]; HLTMonManager.FileKey = "GLOBAL" diff --git a/Trigger/TrigValidation/TrigAnalysisTest/share/testAthenaTrigESD_HLTMonitoring.py b/Trigger/TrigValidation/TrigAnalysisTest/share/testAthenaTrigESD_HLTMonitoring.py index bd7c23ba881b763c55433dec53295a514dc338be..f8c5ab05ba60d5d6bc57acba6224cf9cb022c94f 100644 --- a/Trigger/TrigValidation/TrigAnalysisTest/share/testAthenaTrigESD_HLTMonitoring.py +++ b/Trigger/TrigValidation/TrigAnalysisTest/share/testAthenaTrigESD_HLTMonitoring.py @@ -61,9 +61,9 @@ HLTMon = HLTMonTool(name = 'HLTMon', #HLTMon.TrigDecisionTool = monTrigDecTool -ToolSvc += HLTMon; +#ToolSvc += HLTMon; -HLTMonManager.AthenaMonTools += [ "HLTMonTool/HLTMon" ]; +HLTMonManager.AthenaMonTools += [ HLTMon ]; from TrigEgammaMonitoring.TrigEgammaMonitoringConfig import TrigEgammaMonitoringTool diff --git a/Trigger/TrigValidation/TrigEgammaValidation/share/TrigEgammaAnalysisTools_RTT.py b/Trigger/TrigValidation/TrigEgammaValidation/share/TrigEgammaAnalysisTools_RTT.py index 5b95aac25d04fa9f3438b1598d1d092b82bf2cb2..eab843fdd31079c2ec4c3ea09c57372a29fd1064 100755 --- a/Trigger/TrigValidation/TrigEgammaValidation/share/TrigEgammaAnalysisTools_RTT.py +++ b/Trigger/TrigValidation/TrigEgammaValidation/share/TrigEgammaAnalysisTools_RTT.py @@ -114,6 +114,6 @@ TrigEgammaPhysValMonTool = TrigEgammaPhysValMonTool( name = "TrigEgammaPhysValMo "TrigEgammaNavTPAnalysisTool/NavTPAnalysis", ]) -ToolSvc += TrigEgammaPhysValMonTool -monMan.AthenaMonTools += [ "TrigEgammaPhysValMonTool" ] +#ToolSvc += TrigEgammaPhysValMonTool +monMan.AthenaMonTools += [ TrigEgammaPhysValMonTool ] diff --git a/Trigger/TrigValidation/TrigInDetValidation/share/TrigInDetValidation_RTT_Common.py b/Trigger/TrigValidation/TrigInDetValidation/share/TrigInDetValidation_RTT_Common.py index 495a2c1f28a10d4fabfd1cf5508370909749c079..ef6fa03c28f9d67f5abf292e63b71127bbabe4f6 100644 --- a/Trigger/TrigValidation/TrigInDetValidation/share/TrigInDetValidation_RTT_Common.py +++ b/Trigger/TrigValidation/TrigInDetValidation/share/TrigInDetValidation_RTT_Common.py @@ -302,10 +302,10 @@ d = release_metadata() TestMonTool.releaseMetaData = d['nightly name'] + " " + d['nightly release'] + " " + d['date'] + " " + d['platform'] + " " + d['release'] TestMonTool.outputFileName="TrkNtuple.root" -ToolSvc += TestMonTool +#ToolSvc += TestMonTool #TestMonTool.OutputLevel=DEBUG -HLTMonManager.AthenaMonTools += [ "TrigTestMonToolAC/TestMonToolAC" ] +HLTMonManager.AthenaMonTools += [ TestMonTool ] # post set up trigger monitoring if 'enableCostMonitoring' in dir() and bool(enableCostMonitoring) == True: diff --git a/Trigger/TrigValidation/TrigInDetValidation/share/TrigInDetValidation_RTT_topOptions_Bphysics.py b/Trigger/TrigValidation/TrigInDetValidation/share/TrigInDetValidation_RTT_topOptions_Bphysics.py index c418447a93c30f98b4fa4bd42c49a7d234021228..05ebf64334eb8898cac99b5858e44276bc6a287e 100644 --- a/Trigger/TrigValidation/TrigInDetValidation/share/TrigInDetValidation_RTT_topOptions_Bphysics.py +++ b/Trigger/TrigValidation/TrigInDetValidation/share/TrigInDetValidation_RTT_topOptions_Bphysics.py @@ -57,8 +57,8 @@ HLTMonManager = topSequence.HLTMonManager from TrigIDJpsiMonitoring.TrigIDJpsiMonitoringConf import TrigJpsiMonTool TPMonTool = TrigJpsiMonTool( name="TPMonTool") -ToolSvc += TPMonTool -HLTMonManager.AthenaMonTools += [ "TrigJpsiMonTool/TPMonTool" ] +#ToolSvc += TPMonTool +HLTMonManager.AthenaMonTools += [ TPMonTool ] TPMonTool.matchR = 0.1 diff --git a/Trigger/TrigValidation/TrigUpgradeTest/CMakeLists.txt b/Trigger/TrigValidation/TrigUpgradeTest/CMakeLists.txt index d67d686dad5176d884eadac7a2a1c38fcba2666a..dcf67b01e6f562b780ddab3544ef8ff40486874b 100644 --- a/Trigger/TrigValidation/TrigUpgradeTest/CMakeLists.txt +++ b/Trigger/TrigValidation/TrigUpgradeTest/CMakeLists.txt @@ -12,8 +12,9 @@ atlas_depends_on_subdirs( PUBLIC GaudiKernel PRIVATE Control/AthenaBaseComps + Trigger/TrigSteer/DecisionHandling Trigger/TrigEvent/TrigSteeringEvent - Control/AthViews + Control/AthViews ) find_package( Boost COMPONENTS filesystem thread system ) diff --git a/Trigger/TrigValidation/TrigUpgradeTest/python/MuonSetup.py b/Trigger/TrigValidation/TrigUpgradeTest/python/MuonSetup.py index 800bd5d5f364fe7538ec714f19dcd417d90b346d..ad52acc5c905111af875dbe2ec9f7d7cab6340a5 100644 --- a/Trigger/TrigValidation/TrigUpgradeTest/python/MuonSetup.py +++ b/Trigger/TrigValidation/TrigUpgradeTest/python/MuonSetup.py @@ -86,10 +86,8 @@ def makeMuonPrepDataAlgs( doL2SA, doEFSA ): ToolSvc += MuonMdtRawDataProviderTool from MuonMDT_CnvTools.MuonMDT_CnvToolsConf import Muon__MdtRdoToPrepDataTool - MdtRdoToMdtPrepDataTool = Muon__MdtRdoToPrepDataTool(name = "MdtRdoToPrepDataTool", - #OutputLevel = INFO, - RawDataProviderTool = MuonMdtRawDataProviderTool, - useBStoRdoTool = True) + MdtRdoToMdtPrepDataTool = Muon__MdtRdoToPrepDataTool(name = "MdtRdoToPrepDataTool") + #OutputLevel = INFO ) ToolSvc += MdtRdoToMdtPrepDataTool from MuonRdoToPrepData.MuonRdoToPrepDataConf import MdtRdoToMdtPrepData @@ -107,6 +105,7 @@ def makeMuonPrepDataAlgs( doL2SA, doEFSA ): ProviderTool = MuonMdtRawDataProviderTool ) #OutputLevel = INFO) if doEFSA == True: + viewAlgs_MuEFSA.append( MdtRawDataProvider ) viewAlgs_MuEFSA.append( MdtRdoToMdtPrepData ) if doL2SA == True: viewAlgs_MuL2SA.append( MdtRdoToMdtPrepDataTool ) diff --git a/Trigger/TrigValidation/TrigUpgradeTest/python/bjetMenuDefs.py b/Trigger/TrigValidation/TrigUpgradeTest/python/bjetMenuDefs.py index da14d97c917133ad0eb1ef994b670af76c22aa44..e07d14fa8fbe17f8aa48192ab9c263c1c24171de 100644 --- a/Trigger/TrigValidation/TrigUpgradeTest/python/bjetMenuDefs.py +++ b/Trigger/TrigValidation/TrigUpgradeTest/python/bjetMenuDefs.py @@ -3,18 +3,33 @@ from AthenaCommon.Constants import VERBOSE,DEBUG,INFO -# My idea would be to create three steps, thus three different hypoTools -# 1 TFT + Jet Reco + j cut -# 2 Precision Tracking + GSC + gsc cut -# 3 BTagging +# Set InDet Flags +from InDetRecExample.InDetJobProperties import InDetFlags +InDetFlags.doCaloSeededBrem = False +InDetFlags.InDet25nsec = True +InDetFlags.doPrimaryVertex3DFinding = False +InDetFlags.doPrintConfigurables = False +InDetFlags.doResolveBackTracks = True +InDetFlags.doSiSPSeededTrackFinder = True +InDetFlags.doTRTPhaseCalculation = True +InDetFlags.doTRTSeededTrackFinder = True +InDetFlags.doTruth = False +InDetFlags.init() + +from AthenaCommon.Include import include +include("InDetRecExample/InDetRecConditionsAccess.py") + +# ==================================================================================================== +# Get MenuSequences +# ==================================================================================================== def getBJetSequence( step ): if step == "j": return bJetStep1Sequence() if step == "gsc": - return bJetSequence() + return bJetStep1Sequence() if step == "bTag": - return bJetSequence() + return bJetStep1Sequence() return None # ==================================================================================================== @@ -28,24 +43,57 @@ def bJetStep1Sequence(): # input maker from TrigUpgradeTest.TrigUpgradeTestConf import HLTTest__TestInputMaker - InputMakerAlg = HLTTest__TestInputMaker("BJetInputMaker") + InputMakerAlg = HLTTest__TestInputMaker("BJetInputMaker_step1") InputMakerAlg.OutputLevel = DEBUG InputMakerAlg.LinkName = "initialRoI" InputMakerAlg.Output = "FSJETRoIs" - # Construct jets ( how do I impose split or non-split configuration ? ) + # Construct jets from TrigUpgradeTest.jetDefs import jetRecoSequence (recoSequence, sequenceOut) = jetRecoSequence( InputMakerAlg.Output ) + # Start with b-jet-specific algo sequence + # Construct RoI. Needed input for Fast Tracking + # WILL BE REMOVED IN THE FUTURE + from TrigBjetHypo.TrigBjetHypoConf import TrigRoiBuilderMT + RoIBuilder = TrigRoiBuilderMT("RoIBuilder") + RoIBuilder.OutputLevel = DEBUG + RoIBuilder.JetInputKey = sequenceOut + RoIBuilder.RoIOutputKey = "EMViewRoIs" # Default for Fast Tracking Algs + + # Fast Tracking + from TrigUpgradeTest.InDetSetup import makeInDetAlgs + (viewAlgs, eventAlgs) = makeInDetAlgs() + + from TrigFastTrackFinder.TrigFastTrackFinder_Config import TrigFastTrackFinder_Jet + theFTF_Jet = TrigFastTrackFinder_Jet() + theFTF_Jet.OutputLevel = DEBUG + theFTF_Jet.isRoI_Seeded = True + theFTF_Jet.RoIs = RoIBuilder.RoIOutputKey + viewAlgs.append( theFTF_Jet ) + + # Getting output track particle container name + TrackParticlesName = "" + for viewAlg in viewAlgs: + if viewAlg.name() == "InDetTrigTrackParticleCreatorAlg": + TrackParticlesName = viewAlg.TrackParticlesName + + fastTrackingSequence = parOR("fastTrackingSequence",viewAlgs) + bJetEtSequence = seqAND("bJetEtSequence",[ RoIBuilder,fastTrackingSequence] ) + # hypo - from TrigBjetHypo.TrigBjetHypoConf import TrigBjetEtHypoAlg + from TrigBjetHypo.TrigBjetHypoConf import TrigBjetEtHypoAlgMT from TrigBjetHypo.TrigBjetEtHypoTool import TrigBjetEtHypoToolFromName - hypo = TrigBjetEtHypoAlg("TrigBjetEtHypoAlg") + hypo = TrigBjetEtHypoAlgMT("TrigBjetEtHypoAlgMT") hypo.OutputLevel = DEBUG hypo.Jets = sequenceOut + hypo.OutputJets = "SplitJets" + # These two are only for temporary debug. Will be removed + hypo.TrackParticleContainerKey = TrackParticlesName + hypo.RoiKey = RoIBuilder.RoIOutputKey # Sequence - BjetAthSequence = seqAND("BjetAthSequence",[InputMakerAlg,recoSequence]) + BjetAthSequence = seqAND("BjetAthSequence",eventAlgs + [InputMakerAlg,recoSequence,bJetEtSequence]) return MenuSequence( Sequence = BjetAthSequence, Maker = InputMakerAlg, @@ -61,34 +109,3 @@ def bJetStep1Sequence(): # step 3: secondary vertex and b-tagging # ==================================================================================================== -def bJetSequence(): - # menu components - from AthenaCommon.CFElements import parOR, seqAND, seqOR, stepSeq - from TriggerMenuMT.HLTMenuConfig.Menu.MenuComponents import MenuSequence - - # input maker - from TrigUpgradeTest.TrigUpgradeTestConf import HLTTest__TestInputMaker - InputMakerAlg = HLTTest__TestInputMaker("BJetInputMaker") - InputMakerAlg.OutputLevel = DEBUG - InputMakerAlg.LinkName = "initialRoI" - InputMakerAlg.Output = 'FSJETRoIs' - - # Construct jets ( how do I impose split or non-split configuration ? ) - from TrigUpgradeTest.jetDefs import jetRecoSequence - (recoSequence, sequenceOut) = jetRecoSequence( InputMakerAlg.Output ) - - # Hypo - from TrigBjetHypo.TrigBjetHypoConf import TrigBjetHypoAlg - from TrigBjetHypo.TrigBjetHypoTool import TrigBjetHypoToolFromName - hypo = TrigBjetHypoAlg("TrigBjetHypoAlg") - hypo.OutputLevel = DEBUG - hypo.RoIsKey = sequenceOut - - # Sequence - BjetAthSequence = seqAND("BjetAthSequence",[InputMakerAlg,recoSequence]) - - return MenuSequence( Sequence = BjetAthSequence, - Maker = InputMakerAlg, - Hypo = hypo, - HypoToolGen = TrigBjetHypoToolFromName ) - diff --git a/Trigger/TrigValidation/TrigUpgradeTest/python/jetDefs.py b/Trigger/TrigValidation/TrigUpgradeTest/python/jetDefs.py index 155e17fdea42539fa7e5d80d58a18a1d9809321d..8b2388c11b34a567957de73f7bef9b49098854b1 100644 --- a/Trigger/TrigValidation/TrigUpgradeTest/python/jetDefs.py +++ b/Trigger/TrigValidation/TrigUpgradeTest/python/jetDefs.py @@ -41,15 +41,13 @@ def jetRecoSequence(inputMakerOut): svcMgr.TrigCaloDataAccessSvc.MonTool = mon - from TrigCaloRec.TrigCaloRecConf import HLTCaloCellMaker, HLTCaloCellSumMaker + from TrigCaloRec.TrigCaloRecConfig import HLTCaloCellMaker + from TrigCaloRec.TrigCaloRecConf import HLTCaloCellSumMaker algo1=HLTCaloCellMaker("testFastAlgo1") algo1.RoIs=inputMakerOut # algo1.RoIs="StoreGateSvc+FSJETRoIs" - # temporary fix for Tile - algo1.ExtraInputs=[('TileEMScale','ConditionStore+TileEMScale')] algo1.TrigDataAccessMT=svcMgr.TrigCaloDataAccessSvc algo1.roiMode=False - # algo1.roiMode=True algo1.OutputLevel=DEBUG jetRecoSequence += algo1 diff --git a/Trigger/TrigValidation/TrigUpgradeTest/share/Calo.py b/Trigger/TrigValidation/TrigUpgradeTest/share/Calo.py index 67534b6af66a995e00de1f07d7e377b32f5d2ed4..4f3a9309b1d7f83be4893295bf0ef57553d70aa0 100644 --- a/Trigger/TrigValidation/TrigUpgradeTest/share/Calo.py +++ b/Trigger/TrigValidation/TrigUpgradeTest/share/Calo.py @@ -40,18 +40,16 @@ if TriggerFlags.doCalo: #l1DecoderTest=L1DecoderTest() #topSequence+=l1DecoderTest - from TrigCaloRec.TrigCaloRecConf import HLTCaloCellMaker, HLTCaloCellSumMaker + from TrigCaloRec.TrigCaloRecConfig import HLTCaloCellMaker + from TrigCaloRec.TrigCaloRecConf import HLTCaloCellSumMaker + algo1=HLTCaloCellMaker("testFastAlgo1") algo1.RoIs="StoreGateSvc+EMRoIs" - # temporary fix for Tile - algo1.ExtraInputs=[('TileEMScale','ConditionStore+TileEMScale')] algo1.TrigDataAccessMT=svcMgr.TrigCaloDataAccessSvc - #algo1.roiMode=False algo1.OutputLevel=VERBOSE topSequence += algo1 algo2=HLTCaloCellSumMaker("testSumFastAlgo") algo2.OutputLevel=VERBOSE - #algo2.roiMode=False topSequence += algo2 diff --git a/Trigger/TrigValidation/TrigUpgradeTest/share/EmuStepProcessing.ref b/Trigger/TrigValidation/TrigUpgradeTest/share/EmuStepProcessing.ref index ac2c8506d17a90193d978af84d829cf1752b2be6..2896b5ec9dff6793b77851d565f58e507d7153d5 100644 --- a/Trigger/TrigValidation/TrigUpgradeTest/share/EmuStepProcessing.ref +++ b/Trigger/TrigValidation/TrigUpgradeTest/share/EmuStepProcessing.ref @@ -1,6 +1,6 @@ -TrigSignatureMoniMT INFO HLT_mu8 2 2 2 2 2 -TrigSignatureMoniMT INFO HLT_mu8_e8 1 1 1 1 1 -TrigSignatureMoniMT INFO HLT_mu81step 2 2 2 0 2 TrigSignatureMoniMT INFO HLT_e20 2 2 2 2 2 TrigSignatureMoniMT INFO HLT_e8 2 2 2 2 2 TrigSignatureMoniMT INFO HLT_mu20 1 1 0 0 0 +TrigSignatureMoniMT INFO HLT_mu8 2 2 2 2 2 +TrigSignatureMoniMT INFO HLT_mu81step 2 2 2 0 2 +TrigSignatureMoniMT INFO HLT_mu8_e8 1 1 1 1 1 diff --git a/Trigger/TrigValidation/TrigUpgradeTest/share/NewJO.ref b/Trigger/TrigValidation/TrigUpgradeTest/share/NewJO.ref index a5de1bf036a9e1560e7ab70efa7c1950995c1bc0..4141b9c5e110c05a2b82af77f5bb910f0c56e0a7 100644 --- a/Trigger/TrigValidation/TrigUpgradeTest/share/NewJO.ref +++ b/Trigger/TrigValidation/TrigUpgradeTest/share/NewJO.ref @@ -2,8 +2,8 @@ Storing config in the config newJOtest.pkl Py:Athena INFO now loading newJOtest.pkl ... TrigSignatureMoniMT INFO Chain name L1, AfterPS, [... steps ...], Output TrigSignatureMoniMT INFO All 20 20 0 0 15 -TrigSignatureMoniMT INFO HLT_g10_etcut 20 20 8 8 8 -TrigSignatureMoniMT INFO HLT_g15_etcut 20 20 5 8 8 TrigSignatureMoniMT INFO HLT_e3_etcut 20 20 15 0 15 -TrigSignatureMoniMT INFO HLT_e7_etcut 20 20 8 0 8 TrigSignatureMoniMT INFO HLT_e5_etcut 20 20 14 0 14 +TrigSignatureMoniMT INFO HLT_e7_etcut 20 20 8 0 8 +TrigSignatureMoniMT INFO HLT_g10_etcut 20 20 8 8 8 +TrigSignatureMoniMT INFO HLT_g15_etcut 20 20 5 8 8 diff --git a/Trigger/TrigValidation/TrigUpgradeTest/share/bjet.menu.py b/Trigger/TrigValidation/TrigUpgradeTest/share/bjet.menu.py index b93297a8da66ef0e077acabcbc85ba9492bf3ce1..8f9588352ae9cedfdc542c3786982385fa3b22b5 100644 --- a/Trigger/TrigValidation/TrigUpgradeTest/share/bjet.menu.py +++ b/Trigger/TrigValidation/TrigUpgradeTest/share/bjet.menu.py @@ -13,7 +13,6 @@ from TriggerMenuMT.HLTMenuConfig.Menu.MenuComponents import Chain, ChainStep # We should retrieve all the steps here from TrigUpgradeTest.bjetMenuDefs import getBJetSequence step1 = ChainStep("Step1_bjet", [getBJetSequence('j')]) -#step3 = ChainStep("Step3_bjet", [getBJetSequence('bTag')]) testChains = [ Chain(name='HLT_j35_gsc45_boffperf_split' , Seed="L1_J20", ChainSteps=[step1] ), diff --git a/Trigger/TrigValidation/TrigUpgradeTest/share/egamma.withViews.py b/Trigger/TrigValidation/TrigUpgradeTest/share/egamma.withViews.py index 098d9c98bacb700a29065dd7e57afc9b78b9b47a..f081b55be0ee72f00fa9de82adce1557c5b6f534 100644 --- a/Trigger/TrigValidation/TrigUpgradeTest/share/egamma.withViews.py +++ b/Trigger/TrigValidation/TrigUpgradeTest/share/egamma.withViews.py @@ -246,7 +246,7 @@ summary = TriggerSummaryAlg( "TriggerSummaryAlg" ) summary.InputDecision = "HLTChains" summary.FinalDecisions = [ "ElectronL2Decisions", "MuonL2Decisions" ] -from TrigOutputHandling.TrigOutputHandlingConf import HLTEDMCreator, HLTResultCreatorByteStream +from TrigOutputHandling.TrigOutputHandlingConf import HLTEDMCreator egammaViewsMerger = HLTEDMCreator("egammaViewsMerger") egammaViewsMerger.TrigCompositeContainer = [ "L2ElectronLinks", "filterCaloRoIsAlg", "EgammaCaloDecisions","ElectronL2Decisions", "MuonL2Decisions", "EMRoIDecisions", "METRoIDecisions", "MURoIDecisions", "HLTChainsResult", "JRoIDecisions", "MonitoringSummaryStep1", "RerunEMRoIDecisions", "RerunMURoIDecisions", "TAURoIDecisions", "L2CaloLinks", "FilteredEMRoIDecisions", "FilteredEgammaCaloDecisions" ] @@ -267,16 +267,8 @@ egammaViewsMerger.OutputLevel = VERBOSE svcMgr.StoreGateSvc.OutputLevel = INFO -streamingTool = HLTResultCreatorByteStream(OutputLevel=VERBOSE) - - -streamingTool.CollectionsToSerialize = [ "xAOD::TrigCompositeContainer_v1#EgammaCaloDecisions", - "xAOD::TrigCompositeAuxContainer_v1#EgammaCaloDecisionsAux.", - "xAOD::TrigElectronContainer_v1#HLT_xAOD__TrigElectronContainer_L2ElectronFex", - "xAOD::TrigElectronAuxContainer_v1#HLT_xAOD__TrigElectronContainer_L2ElectronFexAux." ] - -summary.OutputTools = [ egammaViewsMerger, streamingTool ] +summary.OutputTools = [ egammaViewsMerger ] summary.OutputLevel = DEBUG @@ -294,7 +286,6 @@ steps = seqAND("HLTSteps", [ step0filter, step0, step1filter, step1, step2filter from TrigSteerMonitor.TrigSteerMonitorConf import TrigSignatureMoniMT, DecisionCollectorTool mon = TrigSignatureMoniMT() -mon.FinalDecisions = [ "ElectronL2Decisions", "MuonL2Decisions", "WhateverElse" ] from TrigUpgradeTest.TestUtils import MenuTest mon.ChainsList = list( set( topSequence.L1DecoderTest.ChainToCTPMapping.keys() ) ) #mon.ChainsList = list( set( MenuTest.CTPToChainMapping.keys() ) ) @@ -343,7 +334,7 @@ StreamESD.ItemList += [ "ROIB::RoIBResult#*" ] print "ESD file content " print StreamESD.ItemList -from TrigOutputHandling.TrigOutputHandlingConf import DecisionSummaryMakerAlg, HLTResultMTMakerAlg, StreamTagMakerTool, TriggerBitsMakerTool +from TrigOutputHandling.TrigOutputHandlingConf import DecisionSummaryMakerAlg, HLTResultMTMakerAlg, StreamTagMakerTool, TriggerBitsMakerTool, TriggerEDMSerialiserTool summMaker = DecisionSummaryMakerAlg() summMaker.FinalDecisionKeys = [ theElectronHypo.HypoOutputDecisions ] summMaker.FinalStepDecisions = dict( [ ( tool.getName(), theElectronHypo.HypoOutputDecisions ) for tool in theElectronHypo.HypoTools ] ) @@ -353,6 +344,13 @@ print summMaker ################################################################################ # test online HLT Result maker +serialiser = TriggerEDMSerialiserTool(OutputLevel=VERBOSE) + +serialiser.CollectionsToSerialize = [ "xAOD::TrigCompositeContainer_v1#EgammaCaloDecisions", + "xAOD::TrigCompositeAuxContainer_v1#EgammaCaloDecisionsAux.", + "xAOD::TrigElectronContainer_v1#HLT_xAOD__TrigElectronContainer_L2ElectronFex", + "xAOD::TrigElectronAuxContainer_v1#HLT_xAOD__TrigElectronContainer_L2ElectronFexAux." ] + stmaker = StreamTagMakerTool() stmaker.OutputLevel = DEBUG stmaker.ChainDecisions = "HLTFinalDecisions" @@ -364,7 +362,7 @@ bitsmaker.ChainToBit = dict( [ (chain, 10*num) for num,chain in enumerate(testCh bitsmaker.OutputLevel = DEBUG hltResultMaker = HLTResultMTMakerAlg() -hltResultMaker.MakerTools = [ stmaker, bitsmaker ] +hltResultMaker.MakerTools = [ stmaker, bitsmaker, serialiser ] hltResultMaker.OutputLevel = DEBUG from AthenaMonitoring.GenericMonitoringTool import GenericMonitoringTool, defineHistogram @@ -386,7 +384,7 @@ hltResultMaker.MonTool.Histograms = [ defineHistogram( 'TIME_build', path='EXPER ################################################################################ # assemble top list of algorithms -hltTop = seqOR( "hltTop", [ steps, mon, summary, StreamESD, summMaker, hltResultMaker ] ) +hltTop = seqOR( "hltTop", [ steps, summMaker, mon, hltResultMaker, summary, StreamESD ] ) topSequence += hltTop ###### Begin Cost Monitoring block diff --git a/Trigger/TrigValidation/TrigUpgradeTest/share/egammaMenu.ref b/Trigger/TrigValidation/TrigUpgradeTest/share/egammaMenu.ref deleted file mode 100644 index 63f0b25a9184ef76b9460a75372197cc72872b59..0000000000000000000000000000000000000000 --- a/Trigger/TrigValidation/TrigUpgradeTest/share/egammaMenu.ref +++ /dev/null @@ -1,99 +0,0 @@ -TriggerSummaryStep1 0 0 DEBUG +++ HLT_e5_etcut ID#607406625 -TriggerSummaryStep1 0 0 DEBUG +++ HLT_e3_etcut1step ID#1509456583 -TriggerSummaryStep1 0 0 DEBUG +++ HLT_e7_etcut ID#2430733989 -TriggerSummaryStep2 0 0 DEBUG +++ HLT_e5_etcut ID#607406625 -TriggerSummaryStep2 0 0 DEBUG +++ HLT_e7_etcut ID#2430733989 -TriggerSummaryStep1 1 0 DEBUG +++ HLT_e5_etcut ID#607406625 -TriggerSummaryStep1 1 0 DEBUG +++ HLT_e3_etcut1step ID#1509456583 -TriggerSummaryStep1 1 0 DEBUG +++ HLT_e7_etcut ID#2430733989 -TriggerSummaryStep2 1 0 DEBUG +++ HLT_e5_etcut ID#607406625 -TriggerSummaryStep2 1 0 DEBUG +++ HLT_e7_etcut ID#2430733989 -TriggerSummaryStep1 2 0 DEBUG +++ HLT_e5_etcut ID#607406625 -TriggerSummaryStep1 2 0 DEBUG +++ HLT_e3_etcut1step ID#1509456583 -TriggerSummaryStep1 2 0 DEBUG +++ HLT_e7_etcut ID#2430733989 -TriggerSummaryStep2 2 0 DEBUG +++ HLT_e5_etcut ID#607406625 -TriggerSummaryStep2 2 0 DEBUG +++ HLT_e7_etcut ID#2430733989 -TriggerSummaryStep1 3 0 DEBUG +++ HLT_e5_etcut ID#607406625 -TriggerSummaryStep1 3 0 DEBUG +++ HLT_e3_etcut1step ID#1509456583 -TriggerSummaryStep1 3 0 DEBUG +++ HLT_e7_etcut ID#2430733989 -TriggerSummaryStep2 3 0 DEBUG +++ HLT_e5_etcut ID#607406625 -TriggerSummaryStep2 3 0 DEBUG +++ HLT_e7_etcut ID#2430733989 -TriggerSummaryStep1 4 0 DEBUG +++ HLT_e5_etcut ID#607406625 -TriggerSummaryStep1 4 0 DEBUG +++ HLT_e3_etcut1step ID#1509456583 -TriggerSummaryStep1 4 0 DEBUG +++ HLT_e7_etcut ID#2430733989 -TriggerSummaryStep1 4 0 DEBUG +++ HLT_e3_etcut ID#2711808158 -TriggerSummaryStep2 4 0 DEBUG +++ HLT_e5_etcut ID#607406625 -TriggerSummaryStep2 4 0 DEBUG +++ HLT_e7_etcut ID#2430733989 -TriggerSummaryStep2 4 0 DEBUG +++ HLT_e3_etcut ID#2711808158 -TriggerSummaryStep1 5 0 DEBUG +++ HLT_e5_etcut ID#607406625 -TriggerSummaryStep1 5 0 DEBUG +++ HLT_e3_etcut1step ID#1509456583 -TriggerSummaryStep1 5 0 DEBUG +++ HLT_e7_etcut ID#2430733989 -TriggerSummaryStep2 5 0 DEBUG +++ HLT_e5_etcut ID#607406625 -TriggerSummaryStep2 5 0 DEBUG +++ HLT_e7_etcut ID#2430733989 -TriggerSummaryStep1 6 0 DEBUG +++ HLT_e5_etcut ID#607406625 -TriggerSummaryStep1 6 0 DEBUG +++ HLT_e3_etcut1step ID#1509456583 -TriggerSummaryStep1 6 0 DEBUG +++ HLT_e7_etcut ID#2430733989 -TriggerSummaryStep1 6 0 DEBUG +++ HLT_e3_etcut ID#2711808158 -TriggerSummaryStep2 6 0 DEBUG +++ HLT_e5_etcut ID#607406625 -TriggerSummaryStep2 6 0 DEBUG +++ HLT_e7_etcut ID#2430733989 -TriggerSummaryStep2 6 0 DEBUG +++ HLT_e3_etcut ID#2711808158 -TriggerSummaryStep1 7 0 DEBUG +++ HLT_e5_etcut ID#607406625 -TriggerSummaryStep1 7 0 DEBUG +++ HLT_e3_etcut1step ID#1509456583 -TriggerSummaryStep1 7 0 DEBUG +++ HLT_e7_etcut ID#2430733989 -TriggerSummaryStep2 7 0 DEBUG +++ HLT_e5_etcut ID#607406625 -TriggerSummaryStep2 7 0 DEBUG +++ HLT_e7_etcut ID#2430733989 -TriggerSummaryStep1 8 0 DEBUG +++ HLT_e5_etcut ID#607406625 -TriggerSummaryStep1 8 0 DEBUG +++ HLT_e3_etcut1step ID#1509456583 -TriggerSummaryStep1 8 0 DEBUG +++ HLT_e7_etcut ID#2430733989 -TriggerSummaryStep2 8 0 DEBUG +++ HLT_e5_etcut ID#607406625 -TriggerSummaryStep2 8 0 DEBUG +++ HLT_e7_etcut ID#2430733989 -TriggerSummaryStep1 10 0 DEBUG +++ HLT_e5_etcut ID#607406625 -TriggerSummaryStep1 10 0 DEBUG +++ HLT_e3_etcut1step ID#1509456583 -TriggerSummaryStep1 10 0 DEBUG +++ HLT_e7_etcut ID#2430733989 -TriggerSummaryStep1 10 0 DEBUG +++ HLT_e3_etcut ID#2711808158 -TriggerSummaryStep2 10 0 DEBUG +++ HLT_e5_etcut ID#607406625 -TriggerSummaryStep2 10 0 DEBUG +++ HLT_e7_etcut ID#2430733989 -TriggerSummaryStep2 10 0 DEBUG +++ HLT_e3_etcut ID#2711808158 -TriggerSummaryStep1 11 0 DEBUG +++ HLT_e5_etcut ID#607406625 -TriggerSummaryStep1 11 0 DEBUG +++ HLT_e3_etcut1step ID#1509456583 -TriggerSummaryStep2 11 0 DEBUG +++ HLT_e5_etcut ID#607406625 -TriggerSummaryStep1 12 0 DEBUG +++ HLT_e5_etcut ID#607406625 -TriggerSummaryStep1 12 0 DEBUG +++ HLT_e3_etcut1step ID#1509456583 -TriggerSummaryStep1 12 0 DEBUG +++ HLT_e7_etcut ID#2430733989 -TriggerSummaryStep1 12 0 DEBUG +++ HLT_e3_etcut ID#2711808158 -TriggerSummaryStep2 12 0 DEBUG +++ HLT_e5_etcut ID#607406625 -TriggerSummaryStep2 12 0 DEBUG +++ HLT_e7_etcut ID#2430733989 -TriggerSummaryStep2 12 0 DEBUG +++ HLT_e3_etcut ID#2711808158 -TriggerSummaryStep1 13 0 DEBUG +++ HLT_e5_etcut ID#607406625 -TriggerSummaryStep1 13 0 DEBUG +++ HLT_e3_etcut1step ID#1509456583 -TriggerSummaryStep1 13 0 DEBUG +++ HLT_e7_etcut ID#2430733989 -TriggerSummaryStep1 13 0 DEBUG +++ HLT_e3_etcut ID#2711808158 -TriggerSummaryStep2 13 0 DEBUG +++ HLT_e5_etcut ID#607406625 -TriggerSummaryStep2 13 0 DEBUG +++ HLT_e7_etcut ID#2430733989 -TriggerSummaryStep2 13 0 DEBUG +++ HLT_e3_etcut ID#2711808158 -TriggerSummaryStep1 14 0 DEBUG +++ HLT_e5_etcut ID#607406625 -TriggerSummaryStep1 14 0 DEBUG +++ HLT_e3_etcut1step ID#1509456583 -TriggerSummaryStep1 14 0 DEBUG +++ HLT_e3_etcut ID#2711808158 -TriggerSummaryStep2 14 0 DEBUG +++ HLT_e5_etcut ID#607406625 -TriggerSummaryStep2 14 0 DEBUG +++ HLT_e3_etcut ID#2711808158 -TriggerSummaryStep1 16 0 DEBUG +++ HLT_e3_etcut1step ID#1509456583 -TriggerSummaryStep1 17 0 DEBUG +++ HLT_e5_etcut ID#607406625 -TriggerSummaryStep1 17 0 DEBUG +++ HLT_e3_etcut1step ID#1509456583 -TriggerSummaryStep1 17 0 DEBUG +++ HLT_e7_etcut ID#2430733989 -TriggerSummaryStep1 17 0 DEBUG +++ HLT_e3_etcut ID#2711808158 -TriggerSummaryStep2 17 0 DEBUG +++ HLT_e5_etcut ID#607406625 -TriggerSummaryStep2 17 0 DEBUG +++ HLT_e7_etcut ID#2430733989 -TriggerSummaryStep2 17 0 DEBUG +++ HLT_e3_etcut ID#2711808158 -TriggerSummaryStep1 18 0 DEBUG +++ HLT_e5_etcut ID#607406625 -TriggerSummaryStep1 18 0 DEBUG +++ HLT_e3_etcut1step ID#1509456583 -TriggerSummaryStep1 18 0 DEBUG +++ HLT_e7_etcut ID#2430733989 -TriggerSummaryStep1 18 0 DEBUG +++ HLT_e3_etcut ID#2711808158 -TriggerSummaryStep1 19 0 DEBUG +++ HLT_e5_etcut ID#607406625 -TriggerSummaryStep1 19 0 DEBUG +++ HLT_e3_etcut1step ID#1509456583 -TriggerSummaryStep1 19 0 DEBUG +++ HLT_e7_etcut ID#2430733989 -TriggerSummaryStep2 19 0 DEBUG +++ HLT_e5_etcut ID#607406625 -TriggerSummaryStep2 19 0 DEBUG +++ HLT_e7_etcut ID#2430733989 -TrigSignatureMoniMT INFO HLT_e5_etcut 20 20 17 16 16 -TrigSignatureMoniMT INFO HLT_e7_etcut 20 20 15 14 14 -TrigSignatureMoniMT INFO HLT_e3_etcut1step 20 20 18 0 18 -TrigSignatureMoniMT INFO HLT_e3_etcut 20 9 8 7 7 diff --git a/Trigger/TrigValidation/TrigUpgradeTest/share/electronMenu.ref b/Trigger/TrigValidation/TrigUpgradeTest/share/electronMenu.ref index 63f0b25a9184ef76b9460a75372197cc72872b59..6091ab75721b3353551c3d1ae3ea82d8d38ffce8 100644 --- a/Trigger/TrigValidation/TrigUpgradeTest/share/electronMenu.ref +++ b/Trigger/TrigValidation/TrigUpgradeTest/share/electronMenu.ref @@ -93,7 +93,7 @@ TriggerSummaryStep1 19 0 DEBUG +++ HLT_e3_etcut1step I TriggerSummaryStep1 19 0 DEBUG +++ HLT_e7_etcut ID#2430733989 TriggerSummaryStep2 19 0 DEBUG +++ HLT_e5_etcut ID#607406625 TriggerSummaryStep2 19 0 DEBUG +++ HLT_e7_etcut ID#2430733989 +TrigSignatureMoniMT INFO HLT_e3_etcut 20 9 8 7 7 +TrigSignatureMoniMT INFO HLT_e3_etcut1step 20 20 18 0 18 TrigSignatureMoniMT INFO HLT_e5_etcut 20 20 17 16 16 TrigSignatureMoniMT INFO HLT_e7_etcut 20 20 15 14 14 -TrigSignatureMoniMT INFO HLT_e3_etcut1step 20 20 18 0 18 -TrigSignatureMoniMT INFO HLT_e3_etcut 20 9 8 7 7 diff --git a/Trigger/TrigValidation/TrigUpgradeTest/share/fullMenu.ref b/Trigger/TrigValidation/TrigUpgradeTest/share/fullMenu.ref index acbda43ff57e04fd575fe5f5649533e792837d5d..44536af41bdd905be8095a648bbcff12f1621aab 100644 --- a/Trigger/TrigValidation/TrigUpgradeTest/share/fullMenu.ref +++ b/Trigger/TrigValidation/TrigUpgradeTest/share/fullMenu.ref @@ -121,12 +121,12 @@ TriggerSummaryStep1 19 0 DEBUG +++ HLT_e3_etcut ID#271 TriggerSummaryStep2 19 0 DEBUG +++ HLT_e5_etcut ID#607406625 TriggerSummaryStep2 19 0 DEBUG +++ HLT_e7_etcut ID#2430733989 TriggerSummaryStep2 19 0 DEBUG +++ HLT_e3_etcut ID#2711808158 -TrigSignatureMoniMT INFO HLT_e5_etcut 20 20 17 16 16 -TrigSignatureMoniMT INFO HLT_mu6 20 20 3 0 3 -TrigSignatureMoniMT INFO HLT_e3_etcut 20 20 18 17 17 TrigSignatureMoniMT INFO HLT_2mu6 20 20 0 0 0 -TrigSignatureMoniMT INFO HLT_e7_etcut 20 20 15 14 14 TrigSignatureMoniMT INFO HLT_2mu6Comb 20 20 0 0 0 -TrigSignatureMoniMT INFO HLT_e3_etcut_mu6 20 20 3 0 0 +TrigSignatureMoniMT INFO HLT_e3_etcut 20 20 18 17 17 TrigSignatureMoniMT INFO HLT_e3_etcut1step 20 20 18 0 18 +TrigSignatureMoniMT INFO HLT_e3_etcut_mu6 20 20 3 0 0 +TrigSignatureMoniMT INFO HLT_e5_etcut 20 20 17 16 16 +TrigSignatureMoniMT INFO HLT_e7_etcut 20 20 15 14 14 +TrigSignatureMoniMT INFO HLT_mu6 20 20 3 0 3 TrigSignatureMoniMT INFO HLT_mu6Comb 20 20 3 2 2 diff --git a/Trigger/TrigValidation/TrigUpgradeTest/share/jet.recoToy.py b/Trigger/TrigValidation/TrigUpgradeTest/share/jet.recoToy.py index 54f027c36f712038aef85d3de05d54c69c0dd296..52e63837969ec1cd300ba6a5df5f138aba23db70 100644 --- a/Trigger/TrigValidation/TrigUpgradeTest/share/jet.recoToy.py +++ b/Trigger/TrigValidation/TrigUpgradeTest/share/jet.recoToy.py @@ -45,7 +45,8 @@ if TriggerFlags.doCalo: svcMgr.TrigCaloDataAccessSvc.OutputLevel=INFO svcMgr.TrigCaloDataAccessSvc.MonTool = mon - from TrigCaloRec.TrigCaloRecConf import HLTCaloCellMaker, HLTCaloCellSumMaker + from TrigCaloRec.TrigCaloRecConfig import HLTCaloCellMaker + from TrigCaloRec.TrigCaloRecConf import HLTCaloCellSumMaker algo1=HLTCaloCellMaker("testFastAlgo1") algo1.RoIs="StoreGateSvc+FSJETRoIs" algo1.TrigDataAccessMT=svcMgr.TrigCaloDataAccessSvc diff --git a/Trigger/TrigValidation/TrigUpgradeTest/share/mu.withViews.py b/Trigger/TrigValidation/TrigUpgradeTest/share/mu.withViews.py index 91af5a5238dcc1aec9a530a6a6506c059f48c2a1..08e1bc122097a1104615fe63719c5605e021e449 100644 --- a/Trigger/TrigValidation/TrigUpgradeTest/share/mu.withViews.py +++ b/Trigger/TrigValidation/TrigUpgradeTest/share/mu.withViews.py @@ -87,7 +87,29 @@ CTPToChainMapping = {"HLT_mu6": "L1_MU6", testChains =[x for x, y in CTPToChainMapping.items()] topSequence.L1DecoderTest.ChainToCTPMapping = CTPToChainMapping +def __mon(finalCollName, stepColls=[]): + from TrigOutputHandling.TrigOutputHandlingConf import DecisionSummaryMakerAlg + summMaker = DecisionSummaryMakerAlg() + summMaker.FinalDecisionKeys = [ finalCollName ] + summMaker.FinalStepDecisions = dict.fromkeys( testChains, finalCollName ) + + ### final monitor algorithm + from TrigSteerMonitor.TrigSteerMonitorConf import TrigSignatureMoniMT, DecisionCollectorTool + mon = TrigSignatureMoniMT() + from TrigUpgradeTest.TestUtils import MenuTest + mon.ChainsList = list( set( MenuTest.CTPToChainMapping.keys() ) ) + mon.OutputLevel = DEBUG + if len(stepColls) == 0: + stepColls=[ finalCollName ] + + for n, coll in enumerate(stepColls): + stepCollector = DecisionCollectorTool("Step%dCollector" % n ) + stepCollector.Decisions = [ coll ] + mon.CollectorTools += [ stepCollector ] + + + return [ summMaker, mon ] # =============================================================================================== @@ -199,7 +221,8 @@ if TriggerFlags.doMuon: from TrigL2MuonSA.TrigL2MuonSAConf import TrigL2MuonSA__MdtDataPreparator L2MdtDataPreparator = TrigL2MuonSA__MdtDataPreparator(OutputLevel = DEBUG, MdtPrepDataProvider = viewAlgs_MuL2SA[1], - MDT_RawDataProvider = viewAlgs_MuL2SA[2]) + MDT_RawDataProvider = viewAlgs_MuL2SA[2], + DecodeBS = DetFlags.readRDOBS.MDT_on()) ToolSvc += L2MdtDataPreparator muFastAlg.DataPreparator.MDTDataPreparator = L2MdtDataPreparator @@ -615,21 +638,9 @@ if TriggerFlags.doMuon==True and TriggerFlags.doID==False: summary = summarySteps("FinalAlg", ["L2MuonFastDecisions"] ) summary.OutputTools = [ muonViewsMerger ] - ### final monitor algorithm - from TrigSteerMonitor.TrigSteerMonitorConf import TrigSignatureMoniMT, DecisionCollectorTool - mon = TrigSignatureMoniMT() - mon.FinalDecisions = [ "L2MuonFastDecisions", "WhateverElse" ] - from TrigUpgradeTest.TestUtils import MenuTest - mon.ChainsList = list( set( MenuTest.CTPToChainMapping.keys() ) ) - mon.OutputLevel = DEBUG - - step1Collector = DecisionCollectorTool("Step1Collector") - step1Collector.Decisions = [ "L2MuonFastDecisions" ] - mon.CollectorTools = [ step1Collector ] - StreamESD = muonStreamESD(muonViewsMerger) - hltTop = seqOR( "hltTop", [ HLTsteps, mon, summary, StreamESD ] ) + hltTop = seqOR( "hltTop", [ HLTsteps]+ __mon("L2MuonFastDecisions")+ [ summary, StreamESD ] ) topSequence += hltTop @@ -645,21 +656,10 @@ if TriggerFlags.doMuon==True and TriggerFlags.doID==False: summary = summarySteps("FinalAlg", ["EFMuonSADecisions"] ) summary.OutputTools = [ muonViewsMerger ] - ### final monitor algorithm - from TrigSteerMonitor.TrigSteerMonitorConf import TrigSignatureMoniMT, DecisionCollectorTool - mon = TrigSignatureMoniMT() - mon.FinalDecisions = [ "EFMuonSADecisions", "WhateverElse" ] - from TrigUpgradeTest.TestUtils import MenuTest - mon.ChainsList = list( set( MenuTest.CTPToChainMapping.keys() ) ) - mon.OutputLevel = DEBUG - - step1Collector = DecisionCollectorTool("Step1Collector") - step1Collector.Decisions = [ "EFMuonSADecisions"] - mon.CollectorTools = [ step1Collector ] - + StreamESD = muonStreamESD(muonViewsMerger) - hltTop = seqOR( "hltTop", [ HLTsteps, mon, summary, StreamESD ] ) + hltTop = seqOR( "hltTop", [ HLTsteps] + __mon("EFMuonSADecisions") + [ summary, StreamESD ] ) topSequence += hltTop @@ -678,23 +678,9 @@ if TriggerFlags.doMuon==True and TriggerFlags.doID==False: summary = summarySteps("FinalAlg", ["EFMuonSADecisions"] ) summary.OutputTools = [ muonViewsMerger ] - ### final monitor algorithm - from TrigSteerMonitor.TrigSteerMonitorConf import TrigSignatureMoniMT, DecisionCollectorTool - mon = TrigSignatureMoniMT() - mon.FinalDecisions = [ "EFMuonSADecisions", "WhateverElse" ] - from TrigUpgradeTest.TestUtils import MenuTest - mon.ChainsList = list( set( MenuTest.CTPToChainMapping.keys() ) ) - mon.OutputLevel = DEBUG - - step1Collector = DecisionCollectorTool("Step1Collector") - step1Collector.Decisions = [ "L2MuonFastDecisions" ] - step2Collector = DecisionCollectorTool("Step2Collector") - step2Collector.Decisions = [ "EFMuonSADecisions"] - mon.CollectorTools = [ step1Collector, step2Collector ] - StreamESD = muonStreamESD(muonViewsMerger) - hltTop = seqOR( "hltTop", [ HLTsteps, mon, summary, StreamESD ] ) + hltTop = seqOR( "hltTop", [ HLTsteps] + __mon("EFMuonSADecisions", ["L2MuonFastDecisions", "EFMuonSADecisions"]) + [summary, StreamESD ] ) topSequence += hltTop @@ -715,23 +701,9 @@ if TriggerFlags.doMuon==True and TriggerFlags.doID==True: summary = summarySteps("FinalAlg", ["MuonL2CBDecisions"] ) summary.OutputTools = [ muonViewsMerger ] - ### final monitor algorithm - from TrigSteerMonitor.TrigSteerMonitorConf import TrigSignatureMoniMT, DecisionCollectorTool - mon = TrigSignatureMoniMT() - mon.FinalDecisions = [ "MuonL2CBDecisions", "WhateverElse" ] - from TrigUpgradeTest.TestUtils import MenuTest - mon.ChainsList = list( set( MenuTest.CTPToChainMapping.keys() ) ) - mon.OutputLevel = DEBUG - - step1Collector = DecisionCollectorTool("Step1Collector") - step1Collector.Decisions = [ "L2MuonFastDecisions" ] - step2Collector = DecisionCollectorTool("Step2Collector") - step2Collector.Decisions = [ "MuonL2CBDecisions" ] - mon.CollectorTools = [ step1Collector, step2Collector ] - StreamESD = muonStreamESD(muonViewsMerger) - hltTop = seqOR( "hltTop", [ HLTsteps, mon, summary, StreamESD ] ) + hltTop = seqOR( "hltTop", [ HLTsteps]+ __mon("MuonL2CBDecisions",["L2MuonFastDecisions", "MuonL2CBDecisions"] ) +[summary, StreamESD ] ) topSequence += hltTop @@ -753,25 +725,10 @@ if TriggerFlags.doMuon==True and TriggerFlags.doID==True: summary = summarySteps("FinalAlg", ["EFMuonSADecisions"] ) summary.OutputTools = [ muonViewsMerger ] - ### final monitor algorithm - from TrigSteerMonitor.TrigSteerMonitorConf import TrigSignatureMoniMT, DecisionCollectorTool - mon = TrigSignatureMoniMT() - mon.FinalDecisions = [ "EFMuonSADecisions", "WhateverElse" ] - from TrigUpgradeTest.TestUtils import MenuTest - mon.ChainsList = list( set( MenuTest.CTPToChainMapping.keys() ) ) - mon.OutputLevel = DEBUG - - step1Collector = DecisionCollectorTool("Step1Collector") - step1Collector.Decisions = [ "L2MuonFastDecisions" ] - step2Collector = DecisionCollectorTool("Step2Collector") - step2Collector.Decisions = [ "MuonL2CBDecisions" ] - step3Collector = DecisionCollectorTool("Step3Collector") - step3Collector.Decisions = [ "EFMuonSADecisions"] - mon.CollectorTools = [ step1Collector, step2Collector, step3Collector ] StreamESD = muonStreamESD(muonViewsMerger) - hltTop = seqOR( "hltTop", [ HLTsteps, mon, summary, StreamESD ] ) + hltTop = seqOR( "hltTop", [ HLTsteps ] + __mon( "EFMuonSADecisions", [ "L2MuonFastDecisions", "MuonL2CBDecisions", "EFMuonSADecisions"]) + [summary, StreamESD ] ) topSequence += hltTop @@ -793,25 +750,9 @@ if TriggerFlags.doMuon==True and TriggerFlags.doID==True: summary = summarySteps("FinalAlg", ["MuonL2IsoDecisions"] ) summary.OutputTools = [ muonViewsMerger ] - ### final monitor algorithm - from TrigSteerMonitor.TrigSteerMonitorConf import TrigSignatureMoniMT, DecisionCollectorTool - mon = TrigSignatureMoniMT() - mon.FinalDecisions = [ "MuonL2IsoDecisions", "WhateverElse" ] - from TrigUpgradeTest.TestUtils import MenuTest - mon.ChainsList = list( set( MenuTest.CTPToChainMapping.keys() ) ) - mon.OutputLevel = DEBUG - - step1Collector = DecisionCollectorTool("Step1Collector") - step1Collector.Decisions = [ "L2MuonFastDecisions" ] - step2Collector = DecisionCollectorTool("Step2Collector") - step2Collector.Decisions = [ "MuonL2CBDecisions" ] - step3Collector = DecisionCollectorTool("Step3Collector") - step3Collector.Decisions = [ "MuonL2IsoDecisions"] - mon.CollectorTools = [ step1Collector, step2Collector, step3Collector ] - StreamESD = muonStreamESD(muonViewsMerger) - hltTop = seqOR( "hltTop", [ HLTsteps, mon, summary, StreamESD ] ) + hltTop = seqOR( "hltTop", [ HLTsteps ]+ __mon( "MuonL2IsoDecisions", [ "L2MuonFastDecisions", "MuonL2CBDecisions", "MuonL2IsoDecisions"]) +[ summary, StreamESD ] ) topSequence += hltTop @@ -833,25 +774,9 @@ if TriggerFlags.doMuon==True and TriggerFlags.doID==True: summary = summarySteps("FinalAlg", ["EFMuonSADecisions", "MuonL2IsoDecisions"] ) summary.OutputTools = [ muonViewsMerger ] - ### final monitor algorithm - from TrigSteerMonitor.TrigSteerMonitorConf import TrigSignatureMoniMT, DecisionCollectorTool - mon = TrigSignatureMoniMT() - mon.FinalDecisions = [ "EFMuonSADecisions", "WhateverElse" ] - from TrigUpgradeTest.TestUtils import MenuTest - mon.ChainsList = list( set( MenuTest.CTPToChainMapping.keys() ) ) - mon.OutputLevel = DEBUG - - step1Collector = DecisionCollectorTool("Step1Collector") - step1Collector.Decisions = [ "L2MuonFastDecisions" ] - step2Collector = DecisionCollectorTool("Step2Collector") - step2Collector.Decisions = [ "MuonL2CBDecisions" ] - step3Collector = DecisionCollectorTool("Step3Collector") - step3Collector.Decisions = [ "EFMuonSADecisions", "MuonL2IsoDecisions"] - mon.CollectorTools = [ step1Collector, step2Collector, step3Collector ] - StreamESD = muonStreamESD(muonViewsMerger) - hltTop = seqOR( "hltTop", [ HLTsteps, mon, summary, StreamESD ] ) + hltTop = seqOR( "hltTop", [ HLTsteps ] + __mon("EFMuonSADecisions", ["L2MuonFastDecisions", "MuonL2CBDecisions", "EFMuonSADecisions"]) +[ summary, StreamESD ] ) topSequence += hltTop @@ -859,3 +784,5 @@ def TMEF_TrkMaterialProviderTool(name='TMEF_TrkMaterialProviderTool',**kwargs): from TrkMaterialProvider.TrkMaterialProviderConf import Trk__TrkMaterialProviderTool kwargs.setdefault("UseCaloEnergyMeasurement", False) return Trk__TrkMaterialProviderTool(name,**kwargs) + + diff --git a/Trigger/TrigValidation/TrigUpgradeTest/share/muMenu.ref b/Trigger/TrigValidation/TrigUpgradeTest/share/muMenu.ref index 2152ed17d0c07a3ac1b0582be9151abbc32d22c7..0d887c57af70f8501eed3f01b8baeccb24ef2c0e 100644 --- a/Trigger/TrigValidation/TrigUpgradeTest/share/muMenu.ref +++ b/Trigger/TrigValidation/TrigUpgradeTest/share/muMenu.ref @@ -6,5 +6,5 @@ TriggerSummaryStep1 2 0 DEBUG +++ HLT_mu6fast ID#2393 TriggerSummaryStep1 5 0 DEBUG +++ HLT_mu6 ID#1672162766 TriggerSummaryStep1 5 0 DEBUG +++ HLT_mu6fast ID#2393852230 TrigSignatureMoniMT INFO HLT_2mu6 10 10 1 0 0 0 -TrigSignatureMoniMT INFO HLT_mu6fast 10 10 3 0 0 3 TrigSignatureMoniMT INFO HLT_mu6 10 10 3 0 0 0 +TrigSignatureMoniMT INFO HLT_mu6fast 10 10 3 0 0 3 diff --git a/Trigger/TrigValidation/TrigUpgradeTest/share/simpleJetJob.py b/Trigger/TrigValidation/TrigUpgradeTest/share/simpleJetJob.py index 0fc007edc977300c7d55559b7d05261e1079b941..803e33cf4576e1397cb3bc595b1931e7b96ffd08 100644 --- a/Trigger/TrigValidation/TrigUpgradeTest/share/simpleJetJob.py +++ b/Trigger/TrigValidation/TrigUpgradeTest/share/simpleJetJob.py @@ -87,12 +87,15 @@ if TriggerFlags.doCalo: ### final monitor algorithm from TrigSteerMonitor.TrigSteerMonitorConf import TrigSignatureMoniMT, DecisionCollectorTool + from TrigOutputHandling.TrigOutputHandlingConf import DecisionSummaryMakerAlg + summMaker = DecisionSummaryMakerAlg() + summMaker.FinalDecisionKeys = [ hypo.HypoOutputDecisions ] + summMaker.FinalStepDecisions = dict.fromkeys( testChains, hypo.HypoOutputDecisions ) + mon = TrigSignatureMoniMT() - mon.FinalDecisions = [ hypo.HypoOutputDecisions ] from TrigUpgradeTest.TestUtils import MenuTest mon.ChainsList = list( set( MenuTest.CTPToChainMapping.keys() ) ) mon.OutputLevel = DEBUG - - hltTop = seqOR( "hltTop", [ HLTsteps, mon ] ) + hltTop = seqOR( "hltTop", [ HLTsteps, summMaker, mon ] ) topSequence += hltTop diff --git a/Trigger/TrigValidation/TriggerTest/test/test_physics_pp_v7_primaries_build.sh b/Trigger/TrigValidation/TriggerTest/test/test_physics_pp_v7_primaries_build.sh new file mode 100755 index 0000000000000000000000000000000000000000..1a94c97b5eb25dc6b26312634215e6ac8a18aa4e --- /dev/null +++ b/Trigger/TrigValidation/TriggerTest/test/test_physics_pp_v7_primaries_build.sh @@ -0,0 +1,30 @@ +#!/bin/bash + +# art-description: Physics v7 TriggerTest on MC +# art-type: build +# art-include: 21.1/AthenaP1 +# art-include: 21.1-dev/AthenaP1 +# art-include: 21.0/Athena +# art-include: 21.0-TrigMC/Athena +# art-include: master/Athena +# art-include: master/AthenaP1 +# art-output: HLTChain.txt +# art-output: HLTTE.txt +# art-output: L1AV.txt +# art-output: HLTconfig_*.xml +# art-output: L1Topoconfig*.xml +# art-output: LVL1config*.xml +# art-output: *.log +# art-output: costMonitoring_* +# art-output: *.root +# art-output: ntuple.pmon.gz +# art-output: *perfmon* +# art-output: TotalEventsProcessed.txt + +export NAME="physics_pp_v7_build" +export MENU="Physics_pp_v7" +export EVENTS="5" +export COST_MONITORING="False" + +source exec_athena_art_trigger_validation.sh +source exec_art_triggertest_post.sh diff --git a/Trigger/TrigValidation/TriggerTest/test/test_physics_pp_v7_primaries_grid.sh b/Trigger/TrigValidation/TriggerTest/test/test_physics_pp_v7_primaries_grid.sh new file mode 100755 index 0000000000000000000000000000000000000000..edce3c6cc2b41e7c0542a35f039e2a4adebccdb2 --- /dev/null +++ b/Trigger/TrigValidation/TriggerTest/test/test_physics_pp_v7_primaries_grid.sh @@ -0,0 +1,30 @@ +#!/bin/bash + +# art-description: Physics v7 TriggerTest on MC +# art-type: grid +# art-include: 21.1/AthenaP1 +# art-include: 21.1-dev/AthenaP1 +# art-include: 21.0/Athena +# art-include: 21.3/Athena +# art-include: 21.0-TrigMC/Athena +# art-include: master/Athena +# art-include: master/AthenaP1 +# art-output: HLTChain.txt +# art-output: HLTTE.txt +# art-output: L1AV.txt +# art-output: HLTconfig*.xml +# art-output: L1Topoconfig*.xml +# art-output: LVL1config*.xml +# art-output: *.log +# art-output: costMonitoring_* +# art-output: *.root +# art-output: ntuple.pmon.gz +# art-output: *perfmon* +# art-output: TotalEventsProcessed.txt + +export NAME="physics_pp_v7_grid" +export MENU="Physics_pp_v7" +export EVENTS="500" + +source exec_athena_art_trigger_validation.sh +source exec_art_triggertest_post.sh diff --git a/Trigger/TriggerCommon/TriggerJobOpts/python/TriggerConfig.py b/Trigger/TriggerCommon/TriggerJobOpts/python/TriggerConfig.py index f99b178b3f807d329f3d0e02d63080edb4f32bc3..b253a7972bc2fc8ea95b8375473c0f7720b841e9 100644 --- a/Trigger/TriggerCommon/TriggerJobOpts/python/TriggerConfig.py +++ b/Trigger/TriggerCommon/TriggerJobOpts/python/TriggerConfig.py @@ -33,6 +33,14 @@ def collectHypos( steps ): hypos[stepSeq.name()].append( alg ) return hypos +def __decisionsFromHypo( hypo ): + """ return all chains served by this hypo and the key of produced decision object """ + if hypo.getType() == 'ComboHypo': + return hypo.MultiplicitiesMap.keys(), hypo.HypoOutputDecisions[0] + else: # regular hypos + return [ t.name() for t in hypo.HypoTools ], hypo.HypoOutputDecisions + + def collectFilters( steps ): """ @@ -78,18 +86,29 @@ def collectDecisionObjects( steps, l1decoder ): decisionObjects.update( filt.Output ) return decisionObjects + def triggerSummaryCfg(flags, hypos): """ Configures an algorithm(s) that should be run after the slection process Returns: ca, algorithm """ - acc = ComponentAccumulator() - from DecisionHandling.DecisionHandlingConf import TriggerSummaryAlg - summaryAlg = TriggerSummaryAlg() - summaryAlg.InputDecision = "HLTChains" - - return acc, summaryAlg + acc = ComponentAccumulator() + from TrigOutputHandling.TrigOutputHandlingConf import DecisionSummaryMakerAlg + decisionSummaryAlg = DecisionSummaryMakerAlg() + allChains = {} + for stepName, stepHypos in sorted( hypos.items() ): + for hypo in stepHypos: + hypoChains,hypoOutputKey = __decisionsFromHypo( hypo ) + allChains.update( dict.fromkeys( hypoChains, hypoOutputKey ) ) + + for c, cont in allChains.iteritems(): + __log.info("Final decision of chain " + c + " will be red from " + cont ) + decisionSummaryAlg.FinalDecisionKeys = list(set(allChains.values())) + decisionSummaryAlg.FinalStepDecisions = allChains + return acc, decisionSummaryAlg + + def triggerMonitoringCfg(flags, hypos, l1Decoder): """ @@ -102,35 +121,24 @@ def triggerMonitoringCfg(flags, hypos, l1Decoder): if len(hypos) == 0: __log.warning("Menu is not configured") return acc, mon - allChains = {} # collects the last decision obj for each chain + allChains = set() # collects the last decision obj for each chain for stepName, stepHypos in sorted( hypos.items() ): - decisions = [] + stepDecisionKeys = [] for hypo in stepHypos: - - - if hypo.getType() == 'ComboHypo': - decisions.append( hypo.HypoOutputDecisions[0] ) - for chain, m in hypo.MultiplicitiesMap.iteritems(): - allChains[chain] = hypo.HypoOutputDecisions[0] - - else: # regular hypos - decisions.append( hypo.HypoOutputDecisions ) - for t in hypo.HypoTools: - allChains[t.name()] = hypo.HypoOutputDecisions - - dcTool = DecisionCollectorTool( "DecisionCollector" + stepName, Decisions=decisions ) + hypoChains, hypoOutputKey = __decisionsFromHypo( hypo ) + stepDecisionKeys.append( hypoOutputKey ) + allChains.update( hypoChains ) + + dcTool = DecisionCollectorTool( "DecisionCollector" + stepName, Decisions=stepDecisionKeys ) __log.info( "The step monitoring decisions in " + dcTool.name() + " " +str( dcTool.Decisions ) ) mon.CollectorTools += [ dcTool ] - mon.FinalChainStep = allChains - mon.FinalDecisions = list( set( allChains.values() ) ) + #mon.FinalChainStep = allChains mon.L1Decisions = l1Decoder.getProperties()['Chains'] if l1Decoder.getProperties()['Chains'] != '<no value>' else l1Decoder.getDefaultProperty('Chains') - __log.info( "Final decisions to be monitored are "+ str( mon.FinalDecisions ) ) - mon.ChainsList = list( set( allChains.keys() + l1Decoder.ChainToCTPMapping.keys()) ) - - + allChains.update( l1Decoder.ChainToCTPMapping.keys() ) + mon.ChainsList = list( allChains ) return acc, mon def setupL1DecoderFromMenu( flags, l1Decoder ): diff --git a/Trigger/TriggerCommon/TriggerJobOpts/python/TriggerFlags.py b/Trigger/TriggerCommon/TriggerJobOpts/python/TriggerFlags.py index 2eb9914f588b0243b5c3c50834ef261f7088972a..7759072d5cc8b21a536c9e44aa71b1d705ec480b 100644 --- a/Trigger/TriggerCommon/TriggerJobOpts/python/TriggerFlags.py +++ b/Trigger/TriggerCommon/TriggerJobOpts/python/TriggerFlags.py @@ -1001,7 +1001,7 @@ class triggerMenuSetup(JobProperty): 'Physics_HI_v2', 'Physics_HI_v2_no_prescale', 'MC_HI_v2', 'MC_HI_v2_no_prescale', 'MC_HI_v2_pPb_mc_prescale', # - 'Physics_default', 'MC_loose_default', 'MC_tight_default', + 'Physics_default', 'MC_loose_default', 'MC_tight_default', 'default_loose', 'default_tight', # ----------------------------------------------------------------- # Run 2 'MC_pp_v5', 'MC_pp_v5_no_prescale', 'MC_pp_v5_tight_mc_prescale', 'MC_pp_v5_loose_mc_prescale','MC_pp_v5_special_mc_prescale', # for development and simulation diff --git a/Trigger/TriggerCommon/TriggerMenu/python/menu/Lumi.py b/Trigger/TriggerCommon/TriggerMenu/python/menu/Lumi.py index de92d33a1631993073d61265ed3933a76376bda9..03a77cec3055ed4a1018f267605abe2dfcaec862 100755 --- a/Trigger/TriggerCommon/TriggerMenu/python/menu/Lumi.py +++ b/Trigger/TriggerCommon/TriggerMenu/python/menu/Lumi.py @@ -13,11 +13,11 @@ def lumi(triggerPythonConfig): menu_name = TriggerFlags.triggerMenuSetup() ## Do some aliasing here - if menu_name == 'Physics_default': menu_name = 'Physics_pp_v6' - elif menu_name == 'MC_loose_default': menu_name = 'MC_pp_v6_loose_mc_prescale' - elif menu_name == 'MC_tight_default': menu_name = 'MC_pp_v6_tight_mc_prescale' - elif menu_name == 'default_loose': menu_name = 'MC_pp_v6_loose_mc_prescale' - elif menu_name == 'default_tight': menu_name = 'MC_pp_v6_tight_mc_prescale' + if menu_name == 'Physics_default': menu_name = 'Physics_pp_v7' + elif menu_name == 'MC_loose_default': menu_name = 'MC_pp_v7_loose_mc_prescale' + elif menu_name == 'MC_tight_default': menu_name = 'MC_pp_v7_tight_mc_prescale' + elif menu_name == 'default_loose': menu_name = 'MC_pp_v7_loose_mc_prescale' + elif menu_name == 'default_tight': menu_name = 'MC_pp_v7_tight_mc_prescale' log.info( 'Menu name: '+ menu_name) diff --git a/Trigger/TriggerCommon/TriggerMenu/python/menu/Physics_pp_v7.py b/Trigger/TriggerCommon/TriggerMenu/python/menu/Physics_pp_v7.py index cba72e5e0b4e4cb0e44b8af3291db1257b4bb90c..3c173c02538e127ab4d1c6df35de233a1f651562 100644 --- a/Trigger/TriggerCommon/TriggerMenu/python/menu/Physics_pp_v7.py +++ b/Trigger/TriggerCommon/TriggerMenu/python/menu/Physics_pp_v7.py @@ -4273,6 +4273,8 @@ def setupMenu(): # Enhanced bias HLT items ['eb_low_L1RD2_FILLED', 'L1_RD2_FILLED', [], ['EnhancedBias'], ["RATE:EnhancedBias", "BW:Detector"], -1], ['eb_high_L1RD2_FILLED', 'L1_RD2_FILLED', [], ['EnhancedBias'], ["RATE:EnhancedBias", "BW:Detector"], -1], + ['eb_low_L1RD0_FILLED', 'L1_RD0_FILLED', [], ['EnhancedBias'], ["RATE:EnhancedBias", "BW:Detector"], -1], + ['eb_high_L1RD0_FILLED', 'L1_RD0_FILLED', [], ['EnhancedBias'], ["RATE:EnhancedBias", "BW:Detector"], -1], ] ## #TriggerFlags.GenericSlice.signatures = [] diff --git a/Trigger/TriggerCommon/TriggerMenu/python/muon/MuonDef.py b/Trigger/TriggerCommon/TriggerMenu/python/muon/MuonDef.py index 11811cb3ecf1392ab8d43fd029206533f6ab98c4..afc6da8f7bc24115e0e62a4998f4262b05b9f3c5 100755 --- a/Trigger/TriggerCommon/TriggerMenu/python/muon/MuonDef.py +++ b/Trigger/TriggerCommon/TriggerMenu/python/muon/MuonDef.py @@ -177,6 +177,8 @@ class L2EFChain_mu(L2EFChainDef): muFastThresh = str(self.chainPart['threshold'])+ "GeV" + "_barrelOnly" + "_v15a" elif int(self.chainPart['threshold']) == 4: muFastThresh = '4GeV_v15a' + elif int(self.chainPart['threshold']) == 3: + muFastThresh = '3GeV_v15a' elif int(self.chainPart['threshold']) == 2: muFastThresh = '2GeV_v15a' elif "3layersEC" in self.chainPart['extra']: diff --git a/Trigger/TriggerCommon/TriggerMenu/scripts/generateL1TopoMenu.py b/Trigger/TriggerCommon/TriggerMenu/scripts/generateL1TopoMenu.py index 0816e89251fa2813c7669869117a1b45b7ed70a7..8dd2b26027836d6d4df16d254cf0cd1ffce401f6 100755 --- a/Trigger/TriggerCommon/TriggerMenu/scripts/generateL1TopoMenu.py +++ b/Trigger/TriggerCommon/TriggerMenu/scripts/generateL1TopoMenu.py @@ -43,13 +43,21 @@ def main(): if sys.argv[1] in ["Physics_HI_v4", "MC_HI_v4", "Physics_HI_v3", "MC_HI_v3", "LS1_v1", "DC14","Physics_pp_v7", "MC_pp_v7","Physics_pp_v6", "MC_pp_v6"]: # explicit names for TMXML nightly generateL1TopoMenu(menu=sys.argv[1]) return 0 + + tmp_menu = sys.argv[1].lower() - if sys.argv[1].lower().startswith("ph"): # for interactive production - generateL1TopoMenu(menu="Physics_pp_v6") + if tmp_menu.startswith("ph"): # for interactive production + if 'v6' in tmp_menu: + generateL1TopoMenu(menu="Physics_pp_v6") + else: + generateL1TopoMenu(menu="Physics_pp_v7") return 0 - if sys.argv[1].lower().startswith("mc"): - generateL1TopoMenu(menu="MC_pp_v6") + if tmp_menu.startswith("mc"): + if 'v6' in tmp_menu: + generateL1TopoMenu(menu="MC_pp_v6") + else: + generateL1TopoMenu(menu="MC_pp_v7") return 0 if sys.argv[1].lower().startswith("hiph"): diff --git a/Trigger/TriggerCommon/TriggerMenuMT/CMakeLists.txt b/Trigger/TriggerCommon/TriggerMenuMT/CMakeLists.txt index eb786fad010c7fcf8ae7fd7a9ff7eb3a1aa296e5..27626eef25880be2a6758665b068a413e94096ef 100644 --- a/Trigger/TriggerCommon/TriggerMenuMT/CMakeLists.txt +++ b/Trigger/TriggerCommon/TriggerMenuMT/CMakeLists.txt @@ -116,6 +116,11 @@ atlas_add_test( generateMenuMT SCRIPT scripts/testMenuMT.sh ) +atlas_add_test( generateMenuMT_newJO SCRIPT python -m TriggerMenuMT.HLTMenuConfig.Menu.LS2_v1_newJO + PROPERTIES TIMEOUT 500 + ) + + #---------------------------------- # List of menus to be created: diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Egamma/generateEgamma.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Egamma/generateEgamma.py new file mode 100644 index 0000000000000000000000000000000000000000..cf1e84e66a47fb0d60cff06e66cc7168019726f9 --- /dev/null +++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Egamma/generateEgamma.py @@ -0,0 +1,9 @@ +# Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration + +def generateChains( flags, chainDict ): + print "Generating electron chain" + import pprint + pprint.pprint( chainDict ) + + + return [] diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/GenerateMenuMT_newJO.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/GenerateMenuMT_newJO.py new file mode 100644 index 0000000000000000000000000000000000000000..913e9d4f2c575018ec3b34d49d6b76d14def9370 --- /dev/null +++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/GenerateMenuMT_newJO.py @@ -0,0 +1,111 @@ +# Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration +from AthenaCommon.Logging import logging +from AthenaCommon.Constants import VERBOSE,INFO,DEBUG +_log = logging.getLogger('GenerateMenuMT_newJO') +_log.setLevel( VERBOSE ) + +def fillGeneratorsMap( sigMap, signature ): + """ Fill the mapping from the flag container name to the function responsible for generating the Chain objects + + Here the files naming convention is employed: the chains mentioned in Trigger.menu.XYZ are served by the function in HLTMenuConfig.XYZ.generateChains""" + + capitalizedSignature = signature.capitalize() + importString = 'TriggerMenuMT.HLTMenuConfig.{}.generate{}'.format(capitalizedSignature, capitalizedSignature) + + try: + gen = __import__(importString, globals(), locals(), ['generateChains']) + sigMap[signature] = gen.generateChains + _log.info( 'Imported generator for %s' % signature ) + except Exception as ex: + _log.warning( 'Cant import {} {}'.format(signature, ex) ) + + + +def generateMenu( flags ): + """ + Using flags generate appropriate Control Flow Graph wiht all HLT algorithms + """ + + # convert to chainDefs + from TriggerMenuMT.HLTMenuConfig.Menu.DictFromChainName import DictFromChainName + toChainDictTranslator = DictFromChainName() + + flatChainDicts = [] + counter = 0 + signatureToGenerator = {} + menuChains = [] + + for name, cfgFlag in flags._flagdict.iteritems(): + if not 'Trigger.menu.' in name: + continue + + # fill the map[signature, generating function] + variableName = name.split('.')[-1] + fillGeneratorsMap( signatureToGenerator, variableName ) + + print(cfgFlag.get()) + + for chain in cfgFlag.get(): + + chainDict = toChainDictTranslator.getChainDict( chain ) + + counter += 1 + chainDict['chainCounter'] = counter + # todo topo threshold + + flatChainDicts.append( chainDict ) + + # call generating function and pass to CF builder + if variableName in signatureToGenerator: + menuChains.append( signatureToGenerator[variableName](flags, chainDict) ) + else: + _log.warning('Missing generator for the chain {}'.format(chainDict['chainName'])) + + _log.info('Obtained Menu Chain objects') + + # pass all menuChain to CF builder + + _log.info('CF is built') + +########################################################################################################### + # # join flags + # menuFlags = [f.get() for name, f in flags._flagdict.iteritems() if "Trigger.menu." in name ] + # flatMenu = reduce( lambda x,y: x+y, menuFlags, [] ) + # + # # convert to chainDefs + # from TriggerMenuMT.HLTMenuConfig.Menu.DictFromChainName import DictFromChainName + # toChainDictTranslator = DictFromChainName() + # flatChainDicts = [ toChainDictTranslator.getChainDict( chain ) for chain in flatMenu ] + # + # for counter, d in enumerate( flatChainDicts, 1 ) : + # d["chainCounter"] = counter + # # todo topo threshold + + # _log.info("Translated menu flags to chainDicts") +########################################################################################################### + + + + # # import signature fragments and fill the map[signature, generating function] + # signatureToGenerator = {} + # signatures = [ name.split('.')[-1] for name in flags._flagdict.iterkeys() if 'Trigger.menu.' in name ] + # for s in signatures: + # fillGeneratorsMap( signatureToGenerator, s ) + # _log.info('Retrieved generators') + + # # for each chain call generating function and pass to CF builder + # menuChains = [] + # for chain in flatChainDicts: + # if chain['sourceVariableName'] in signatureToGenerator: + # menuChains.append( signatureToGenerator[ chain['sourceVariableName'] ]( flags, chain ) ) + # else: + # _log.warning( 'Missing generator for the chain ' + chain['chainName'] ) + + # _log.info( 'Obtained Menu Chain objects' ) + # # pass all menuChain to CF builder + # + # _log.info( 'CF is built' ) + + return None # will return once the CF build is realy invoked + + diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/HLTCFConfig.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/HLTCFConfig.py index dcd98a86aeb6e081ed8c2ae9b74aaa516ddfa6c7..5f7ceaa7721e3a3066239f868e9e2ba198974837 100644 --- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/HLTCFConfig.py +++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/HLTCFConfig.py @@ -23,26 +23,6 @@ def makeSummary(name, flatDecisions): summary.HLTSummary = "MonitoringSummary"+name return summary -def makeMonitor(name, decisions, EnabledChainNames): - from TrigSteerMonitor.TrigSteerMonitorConf import TrigSignatureMoniMT, DecisionCollectorTool - mon = TrigSignatureMoniMT(name, OutputLevel = 2) - flatDecisions=[] - for step in decisions: flatDecisions.extend (step) - mon.FinalDecisions = flatDecisions - mon.L1Decisions = "HLTChainsResult" # connection with L1Decoder - from TrigUpgradeTest.TestUtils import MenuTest - mon.ChainsList = EnabledChainNames - tools=[] - for step in range (0, len(decisions)): - print "adding collector ",step - print decisions[step] - collect = DecisionCollectorTool("StepCollector%d"%step) - collect.Decisions = decisions[step] - print collect - tools.append(collect) - mon.CollectorTools=tools - print mon - return mon def makeStreamESD(name, flatDecisions): import AthenaPoolCnvSvc.WriteAthenaPool @@ -179,20 +159,24 @@ def makeHLTTree(HLTChains): from AthenaCommon.AlgSequence import AlgSequence topSequence = AlgSequence() - #hltTop += makeMonitor("TriggerMonitorFinal", finalDecisions, EnabledChainNames) - from TriggerJobOpts.TriggerConfig import collectHypos, triggerMonitoringCfg + from TriggerJobOpts.TriggerConfig import collectHypos, triggerMonitoringCfg, triggerSummaryCfg from AthenaConfiguration.AllConfigFlags import ConfigFlags - - ConfigFlags.lock() + l1decoder = [ d for d in topSequence.getChildren() if d.getType() == "L1Decoder" ] if len(l1decoder) != 1 : raise RuntimeError(" Can't find 1 instance of L1Decoder in topSequence, instead found this in topSequence "+str(topSequence.getChildren()) ) - monAcc, monAlg = triggerMonitoringCfg( ConfigFlags, collectHypos(steps), l1decoder[0] ) - monAcc.appendToGlobals() + hypos = collectHypos(steps) + summaryAcc, summaryAlg = triggerSummaryCfg( ConfigFlags, hypos ) + hltTop += summaryAlg + summaryAcc.appendToGlobals() + + monAcc, monAlg = triggerMonitoringCfg( ConfigFlags, hypos, l1decoder[0] ) + monAcc.appendToGlobals() hltTop += monAlg - #hltTop += makeStreamESD("StreamESD", flatDecisions) + #hltTop += makeStreamESD("StreamESD", flatDecisions) + topSequence += hltTop diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/LS2_v1_newJO.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/LS2_v1_newJO.py index 4a92d9d43a19cfc0d2f7098efbec851e969262bf..59cb2d37984875ab85bed01f1f0334f79012c84e 100644 --- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/LS2_v1_newJO.py +++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/LS2_v1_newJO.py @@ -4,9 +4,11 @@ def get_flag_item(chainName, L1itemforchain, groups): PhysicsStream = 'Main' return [chainName, L1itemforchain, [], [PhysicsStream], groups, -1] -def setupMenu(): +def setupMenu(flags): + """ + Assign chains for LS2_v1 to menu flags + """ - from TriggerJobOpts.MenuConfigFlags import createMenuFlags from AthenaCommon.Logging import logging log = logging.getLogger( 'TriggerMenuMT.HLTMenuConfig.Menu.LS2_v1_newJO.py' ) @@ -22,7 +24,6 @@ def setupMenu(): # otherwise athenaHLT will seg-fault #--------------------------------------------------------------------- - flags = createMenuFlags() flags.Trigger.menu.muons = [ get_flag_item('mu20', 'L1_MU10', ['RATE:SingleMuon', 'BW:Muon']), @@ -37,6 +38,15 @@ def setupMenu(): get_flag_item('e8_mu8', 'L1_EM6_MU6', ['RATE:SingleMuon', 'BW:Muon']) ] - return flags +if __name__ == "__main__": + + from AthenaConfiguration.AllConfigFlags import ConfigFlags + setupMenu(ConfigFlags) + ConfigFlags.lock() + ConfigFlags.dump() + + from TriggerMenuMT.HLTMenuConfig.Menu.GenerateMenuMT_newJO import generateMenu + menu = generateMenu( ConfigFlags ) + diff --git a/graphics/VP1/VP1Systems/VP1TrackSystems/src/TrackPropagationHelper.cxx b/graphics/VP1/VP1Systems/VP1TrackSystems/src/TrackPropagationHelper.cxx index 7442bf505ae6f088f8437f1cdc19e100ab12568e..e6a4fbd91db45a8911ab82b47d51b2333d814d06 100644 --- a/graphics/VP1/VP1Systems/VP1TrackSystems/src/TrackPropagationHelper.cxx +++ b/graphics/VP1/VP1Systems/VP1TrackSystems/src/TrackPropagationHelper.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration */ @@ -386,7 +386,7 @@ const Trk::TrackParameters * TrackPropagationHelper::Imp::extrapolateToNewPar( T try { // newpars = extrapolator->extrapolate(*trk,surf,Trk::anyDirection,false,hypo); // change this to extrapolate current param to surface. newpars = extrapolator->extrapolate(*prevpars,surf,Trk::alongMomentum,false,hypo); // change this to extrapolate current param to surface. - } catch (std::runtime_error e) { + } catch (const std::runtime_error& e) { theclass->message("Failure trying to use extrapolator for track (Exception thrown: " + QString(e.what())+")"); return 0; }