diff --git a/AtlasTest/DatabaseTest/AthenaPoolMultiTest/share/AthenaPoolMultiTestEventNoSplit.ref b/AtlasTest/DatabaseTest/AthenaPoolMultiTest/share/AthenaPoolMultiTestEventNoSplit.ref index 731751c56a693b9b44a95349a84aea1363f4e47e..dd7afcab0b7161b026feb15dd904852864e1223e 100644 --- a/AtlasTest/DatabaseTest/AthenaPoolMultiTest/share/AthenaPoolMultiTestEventNoSplit.ref +++ b/AtlasTest/DatabaseTest/AthenaPoolMultiTest/share/AthenaPoolMultiTestEventNoSplit.ref @@ -1,5 +1,6 @@ Py:Athena INFO including file "AthenaPoolMultiTest/ExampleStreamConfig.py" PoolSvc INFO Setting up APR FileCatalog and Streams +OutputStreamSeq... INFO Initializing OutputStreamSequencerSvc - package version AthenaServices-00-00-00 Splitter1 DEBUG Property update for OutputLevel : new value = 2 Splitter1 INFO in initialize() Splitter1 DEBUG input handles: 3 @@ -13,28 +14,27 @@ Splitter3 DEBUG output handles: 0 Splitter3 DEBUG Data Deps for Splitter3 Triggered INFO in initialize() DecisionSvc INFO Inserting stream: Stream2 with no Algs -OutputStreamSeq... INFO Initializing OutputStreamSequencerSvc - package version AthenaServices-00-00-00 Stream2.Stream2... INFO Initializing Stream2.Stream2Tool - package version AthenaServices-00-00-00 Stream2.Stream2... INFO Initializing Stream2.Stream2_MakeEventStreamInfo - package version OutputStreamAthenaPool-00-00-00 -Stream2 INFO Found HelperTools = PrivateToolHandleArray(['MakeEventStreamInfo/Stream2_MakeEventStreamInfo']) +Stream2 INFO Found HelperTools = PrivateToolHandleArray(['MakeEventStreamInfo/Stream2_MakeEventStreamInfo','xAODMaker::EventFormatStreamHelperTool/Stream2_MakeEventFormat','Athena::ThinningCacheTool/ThinningCacheTool_Stream2']) Stream2 INFO Data output: AthenaPoolMultiTest_NoSplit2.root Stream2 INFO I/O reinitialization... DecisionSvc INFO Inserting stream: Stream1 with no Algs Stream1.Stream1... INFO Initializing Stream1.Stream1Tool - package version AthenaServices-00-00-00 Stream1.Stream1... INFO Initializing Stream1.Stream1_MakeEventStreamInfo - package version OutputStreamAthenaPool-00-00-00 -Stream1 INFO Found HelperTools = PrivateToolHandleArray(['MakeEventStreamInfo/Stream1_MakeEventStreamInfo']) +Stream1 INFO Found HelperTools = PrivateToolHandleArray(['MakeEventStreamInfo/Stream1_MakeEventStreamInfo','xAODMaker::EventFormatStreamHelperTool/Stream1_MakeEventFormat','Athena::ThinningCacheTool/ThinningCacheTool_Stream1']) Stream1 INFO Data output: AthenaPoolMultiTest_NoSplit1.root Stream1 INFO I/O reinitialization... DecisionSvc INFO Inserting stream: Stream3 with no Algs Stream3.Stream3... INFO Initializing Stream3.Stream3Tool - package version AthenaServices-00-00-00 Stream3.Stream3... INFO Initializing Stream3.Stream3_MakeEventStreamInfo - package version OutputStreamAthenaPool-00-00-00 -Stream3 INFO Found HelperTools = PrivateToolHandleArray(['MakeEventStreamInfo/Stream3_MakeEventStreamInfo']) +Stream3 INFO Found HelperTools = PrivateToolHandleArray(['MakeEventStreamInfo/Stream3_MakeEventStreamInfo','xAODMaker::EventFormatStreamHelperTool/Stream3_MakeEventFormat','Athena::ThinningCacheTool/ThinningCacheTool_Stream3']) Stream3 INFO Data output: AthenaPoolMultiTest_NoSplit3.root Stream3 INFO I/O reinitialization... DecisionSvc INFO Inserting stream: StreamAll with no Algs StreamAll.Strea... INFO Initializing StreamAll.StreamAllTool - package version AthenaServices-00-00-00 StreamAll.Strea... INFO Initializing StreamAll.StreamAll_MakeEventStreamInfo - package version OutputStreamAthenaPool-00-00-00 -StreamAll INFO Found HelperTools = PrivateToolHandleArray(['MakeEventStreamInfo/StreamAll_MakeEventStreamInfo']) +StreamAll INFO Found HelperTools = PrivateToolHandleArray(['MakeEventStreamInfo/StreamAll_MakeEventStreamInfo','xAODMaker::EventFormatStreamHelperTool/StreamAll_MakeEventFormat','Athena::ThinningCacheTool/ThinningCacheTool_StreamAll']) StreamAll INFO Data output: AthenaPoolMultiTest_StreamAll.root StreamAll INFO I/O reinitialization... Splitter1 DEBUG in execute() @@ -50,7 +50,7 @@ Splitter3 INFO L1 failed Triggered INFO EventInfo event: 0 run: 0 Triggered INFO L1 passed Domain[ROOT_All] INFO AthenaPoolMultiTest_StreamAll.root -RootDatabase.open INFO AthenaPoolMultiTest_StreamAll.root File version:61800 +RootDatabase.open INFO AthenaPoolMultiTest_StreamAll.root File version:62200 Splitter1 DEBUG in execute() Splitter1 INFO EventInfo event: 1 run: 0 Splitter1 DEBUG Trigmask = 2 @@ -285,5 +285,6 @@ Splitter1 INFO in finalize() Splitter2 INFO in finalize() Splitter3 INFO in finalize() Triggered INFO in finalize() -ItemListSvc DEBUG STREAM StreamAll has (7) items +ItemListSvc DEBUG STREAM StreamAll has (8) items ItemListSvc DEBUG - EventStreamInfo_StreamAll +ItemListSvc DEBUG - xAOD::EventFormat_EventFormatStreamAll diff --git a/AtlasTest/DatabaseTest/AthenaPoolMultiTest/share/AthenaPoolMultiTestEventSplit.ref b/AtlasTest/DatabaseTest/AthenaPoolMultiTest/share/AthenaPoolMultiTestEventSplit.ref index 8444568729a3c331e9ec1046babec069e87e0037..086dfc875ed39e776ede6f73ed0715568e069fdd 100644 --- a/AtlasTest/DatabaseTest/AthenaPoolMultiTest/share/AthenaPoolMultiTestEventSplit.ref +++ b/AtlasTest/DatabaseTest/AthenaPoolMultiTest/share/AthenaPoolMultiTestEventSplit.ref @@ -1,5 +1,6 @@ Py:Athena INFO including file "AthenaPoolMultiTest/ExampleStreamConfig.py" PoolSvc INFO Setting up APR FileCatalog and Streams +OutputStreamSeq... INFO Initializing OutputStreamSequencerSvc - package version AthenaServices-00-00-00 Splitter1 DEBUG Property update for OutputLevel : new value = 2 Splitter1 INFO in initialize() Splitter1 DEBUG input handles: 3 @@ -13,34 +14,33 @@ Splitter3 DEBUG output handles: 0 Splitter3 DEBUG Data Deps for Splitter3 Triggered INFO in initialize() DecisionSvc INFO Inserting stream: Stream2 with no Algs -OutputStreamSeq... INFO Initializing OutputStreamSequencerSvc - package version AthenaServices-00-00-00 Stream2.Stream2... INFO Initializing Stream2.Stream2Tool - package version AthenaServices-00-00-00 Stream2.Stream2... INFO Initializing Stream2.Stream2_MakeEventStreamInfo - package version OutputStreamAthenaPool-00-00-00 -Stream2 INFO Found HelperTools = PrivateToolHandleArray(['MakeEventStreamInfo/Stream2_MakeEventStreamInfo']) +Stream2 INFO Found HelperTools = PrivateToolHandleArray(['MakeEventStreamInfo/Stream2_MakeEventStreamInfo','xAODMaker::EventFormatStreamHelperTool/Stream2_MakeEventFormat','Athena::ThinningCacheTool/ThinningCacheTool_Stream2']) Stream2 INFO Data output: AthenaPoolMultiTest_Split2.root Stream2 INFO I/O reinitialization... DecisionSvc INFO Inserting stream: Stream1 with no Algs Stream1.Stream1... INFO Initializing Stream1.Stream1Tool - package version AthenaServices-00-00-00 Stream1.Stream1... INFO Initializing Stream1.Stream1_MakeEventStreamInfo - package version OutputStreamAthenaPool-00-00-00 -Stream1 INFO Found HelperTools = PrivateToolHandleArray(['MakeEventStreamInfo/Stream1_MakeEventStreamInfo']) +Stream1 INFO Found HelperTools = PrivateToolHandleArray(['MakeEventStreamInfo/Stream1_MakeEventStreamInfo','xAODMaker::EventFormatStreamHelperTool/Stream1_MakeEventFormat','Athena::ThinningCacheTool/ThinningCacheTool_Stream1']) Stream1 INFO Data output: AthenaPoolMultiTest_Split1.root Stream1 INFO I/O reinitialization... DecisionSvc INFO Inserting stream: Stream3 with no Algs Stream3.Stream3... INFO Initializing Stream3.Stream3Tool - package version AthenaServices-00-00-00 Stream3.Stream3... INFO Initializing Stream3.Stream3_MakeEventStreamInfo - package version OutputStreamAthenaPool-00-00-00 -Stream3 INFO Found HelperTools = PrivateToolHandleArray(['MakeEventStreamInfo/Stream3_MakeEventStreamInfo']) +Stream3 INFO Found HelperTools = PrivateToolHandleArray(['MakeEventStreamInfo/Stream3_MakeEventStreamInfo','xAODMaker::EventFormatStreamHelperTool/Stream3_MakeEventFormat','Athena::ThinningCacheTool/ThinningCacheTool_Stream3']) Stream3 INFO Data output: AthenaPoolMultiTest_Split3.root Stream3 INFO I/O reinitialization... DecisionSvc INFO Inserting stream: Others with no Algs Others.OthersTool INFO Initializing Others.OthersTool - package version AthenaServices-00-00-00 Others.Others_M... INFO Initializing Others.Others_MakeEventStreamInfo - package version OutputStreamAthenaPool-00-00-00 -Others INFO Found HelperTools = PrivateToolHandleArray(['MakeEventStreamInfo/Others_MakeEventStreamInfo']) +Others INFO Found HelperTools = PrivateToolHandleArray(['MakeEventStreamInfo/Others_MakeEventStreamInfo','xAODMaker::EventFormatStreamHelperTool/Others_MakeEventFormat','Athena::ThinningCacheTool/ThinningCacheTool_Others']) Others INFO Data output: AthenaPoolMultiTest_Missed.root Others INFO I/O reinitialization... DecisionSvc INFO Inserting stream: Bad with no Algs Bad.BadTool INFO Initializing Bad.BadTool - package version AthenaServices-00-00-00 Bad.Bad_MakeEve... INFO Initializing Bad.Bad_MakeEventStreamInfo - package version OutputStreamAthenaPool-00-00-00 -Bad INFO Found HelperTools = PrivateToolHandleArray(['MakeEventStreamInfo/Bad_MakeEventStreamInfo']) +Bad INFO Found HelperTools = PrivateToolHandleArray(['MakeEventStreamInfo/Bad_MakeEventStreamInfo','xAODMaker::EventFormatStreamHelperTool/Bad_MakeEventFormat','Athena::ThinningCacheTool/ThinningCacheTool_Bad']) Bad INFO Data output: AthenaPoolMultiTest_Missed.root Bad INFO I/O reinitialization... Splitter1 DEBUG in execute() @@ -293,25 +293,30 @@ Splitter1 INFO in finalize() Splitter2 INFO in finalize() Splitter3 INFO in finalize() Triggered INFO in finalize() -ItemListSvc DEBUG STREAM Bad has (1) items +ItemListSvc DEBUG STREAM Bad has (2) items ItemListSvc DEBUG - EventStreamInfo_Bad -ItemListSvc DEBUG STREAM Others has (6) items +ItemListSvc DEBUG - xAOD::EventFormat_EventFormatBad +ItemListSvc DEBUG STREAM Others has (7) items ItemListSvc DEBUG - EventStreamInfo_Others +ItemListSvc DEBUG - xAOD::EventFormat_EventFormatOthers ItemListSvc DEBUG --> Overlap with Stream1 (5) items ItemListSvc DEBUG --> Overlap with Stream2 (5) items ItemListSvc DEBUG --> Overlap with Stream3 (5) items -ItemListSvc DEBUG STREAM Stream1 has (7) items +ItemListSvc DEBUG STREAM Stream1 has (8) items ItemListSvc DEBUG - EventStreamInfo_Stream1 +ItemListSvc DEBUG - xAOD::EventFormat_EventFormatStream1 ItemListSvc DEBUG --> Overlap with Others (5) items ItemListSvc DEBUG --> Overlap with Stream2 (6) items ItemListSvc DEBUG --> Overlap with Stream3 (6) items -ItemListSvc DEBUG STREAM Stream2 has (7) items +ItemListSvc DEBUG STREAM Stream2 has (8) items ItemListSvc DEBUG - EventStreamInfo_Stream2 +ItemListSvc DEBUG - xAOD::EventFormat_EventFormatStream2 ItemListSvc DEBUG --> Overlap with Others (5) items ItemListSvc DEBUG --> Overlap with Stream1 (6) items ItemListSvc DEBUG --> Overlap with Stream3 (6) items -ItemListSvc DEBUG STREAM Stream3 has (7) items +ItemListSvc DEBUG STREAM Stream3 has (8) items ItemListSvc DEBUG - EventStreamInfo_Stream3 +ItemListSvc DEBUG - xAOD::EventFormat_EventFormatStream3 ItemListSvc DEBUG --> Overlap with Others (5) items ItemListSvc DEBUG --> Overlap with Stream1 (6) items ItemListSvc DEBUG --> Overlap with Stream2 (6) items diff --git a/AtlasTest/DatabaseTest/AthenaPoolMultiTest/share/AthenaPoolMultiTestEventSplitDecision.ref b/AtlasTest/DatabaseTest/AthenaPoolMultiTest/share/AthenaPoolMultiTestEventSplitDecision.ref index 74c966d9e96f5cc80e5b0ad6b0bb31b932874751..85271ed7e576a61d2c08d5d32f6cf73b408e2fe7 100644 --- a/AtlasTest/DatabaseTest/AthenaPoolMultiTest/share/AthenaPoolMultiTestEventSplitDecision.ref +++ b/AtlasTest/DatabaseTest/AthenaPoolMultiTest/share/AthenaPoolMultiTestEventSplitDecision.ref @@ -1,5 +1,6 @@ Py:Athena INFO including file "AthenaPoolMultiTest/ExampleStreamConfig.py" PoolSvc INFO Setting up APR FileCatalog and Streams +OutputStreamSeq... INFO Initializing OutputStreamSequencerSvc - package version AthenaServices-00-00-00 Splitter1 DEBUG Property update for OutputLevel : new value = 2 Splitter1 INFO in initialize() Splitter1 DEBUG input handles: 3 @@ -15,10 +16,9 @@ DecisionSvc INFO Inserting stream: Stream1 with no Algs DecisionSvc INFO Inserting stream: Stream2 with no Algs DecisionSvc INFO Inserting stream: Stream3 with no Algs DecisionSvc INFO Inserting stream: StreamAll2 with no Algs -OutputStreamSeq... INFO Initializing OutputStreamSequencerSvc - package version AthenaServices-00-00-00 StreamAll2.Stre... INFO Initializing StreamAll2.StreamAll2Tool - package version AthenaServices-00-00-00 StreamAll2.Stre... INFO Initializing StreamAll2.StreamAll2_MakeEventStreamInfo - package version OutputStreamAthenaPool-00-00-00 -StreamAll2 INFO Found HelperTools = PrivateToolHandleArray(['MakeEventStreamInfo/StreamAll2_MakeEventStreamInfo']) +StreamAll2 INFO Found HelperTools = PrivateToolHandleArray(['MakeEventStreamInfo/StreamAll2_MakeEventStreamInfo','xAODMaker::EventFormatStreamHelperTool/StreamAll2_MakeEventFormat','Athena::ThinningCacheTool/ThinningCacheTool_StreamAll2']) StreamAll2 INFO Data output: AthenaPoolMultiTest_StreamAll2.root StreamAll2 INFO I/O reinitialization... Splitter1 DEBUG in execute() @@ -32,7 +32,7 @@ Splitter3 INFO EventInfo event: 0 run: 0 Splitter3 DEBUG Trigmask = 1 Splitter3 INFO L1 failed Domain[ROOT_All] INFO AthenaPoolMultiTest_StreamAll2.root -RootDatabase.open INFO AthenaPoolMultiTest_StreamAll2.root File version:61800 +RootDatabase.open INFO AthenaPoolMultiTest_StreamAll2.root File version:62200 Splitter1 DEBUG in execute() Splitter1 INFO EventInfo event: 1 run: 0 Splitter1 DEBUG Trigmask = 2 @@ -228,5 +228,6 @@ StreamAll2 INFO Metadata records written: 21 Splitter1 INFO in finalize() Splitter2 INFO in finalize() Splitter3 INFO in finalize() -ItemListSvc DEBUG STREAM StreamAll2 has (7) items +ItemListSvc DEBUG STREAM StreamAll2 has (8) items ItemListSvc DEBUG - EventStreamInfo_StreamAll2 +ItemListSvc DEBUG - xAOD::EventFormat_EventFormatStreamAll2 diff --git a/AtlasTest/DatabaseTest/AthenaPoolMultiTest/share/AthenaPoolMultiTestPropagate.ref b/AtlasTest/DatabaseTest/AthenaPoolMultiTest/share/AthenaPoolMultiTestPropagate.ref index 1fe945cedc3fe6c5016fdb04257bc2b2f44d6b45..e27bdef3bd017ddc52c67fd6e825e101b9a14639 100644 --- a/AtlasTest/DatabaseTest/AthenaPoolMultiTest/share/AthenaPoolMultiTestPropagate.ref +++ b/AtlasTest/DatabaseTest/AthenaPoolMultiTest/share/AthenaPoolMultiTestPropagate.ref @@ -1,13 +1,14 @@ Py:Athena INFO including file "AthenaPoolMultiTest/ExampleStreamConfig.py" PoolSvc INFO Setting up APR FileCatalog and Streams -DecisionSvc INFO Inserting stream: StreamAllP with no Algs OutputStreamSeq... INFO Initializing OutputStreamSequencerSvc - package version AthenaServices-00-00-00 +DecisionSvc INFO Inserting stream: StreamAllP with no Algs StreamAllP.Stre... INFO Initializing StreamAllP.StreamAllPTool - package version AthenaServices-00-00-00 StreamAllP.Stre... INFO Initializing StreamAllP.StreamAllP_MakeEventStreamInfo - package version OutputStreamAthenaPool-00-00-00 -StreamAllP INFO Found HelperTools = PrivateToolHandleArray(['MakeEventStreamInfo/StreamAllP_MakeEventStreamInfo']) +StreamAllP INFO Found HelperTools = PrivateToolHandleArray(['MakeEventStreamInfo/StreamAllP_MakeEventStreamInfo','xAODMaker::EventFormatStreamHelperTool/StreamAllP_MakeEventFormat','Athena::ThinningCacheTool/ThinningCacheTool_StreamAllP']) StreamAllP INFO Data output: AthenaPoolMultiTest_Propagate.root StreamAllP INFO I/O reinitialization... StorageSvc INFO EventStreamInfo_p3 [11DF1B8C-0DEE-4687-80D7-E74B520ACBB4] StreamAllP INFO Metadata records written: 21 -ItemListSvc DEBUG STREAM StreamAllP has (7) items +ItemListSvc DEBUG STREAM StreamAllP has (8) items ItemListSvc DEBUG - EventStreamInfo_StreamAllP +ItemListSvc DEBUG - xAOD::EventFormat_EventFormatStreamAllP diff --git a/AtlasTest/DatabaseTest/AthenaPoolMultiTest/share/SplittableData_jo.py b/AtlasTest/DatabaseTest/AthenaPoolMultiTest/share/SplittableData_jo.py index bc1881cdfd38eb405552e70f64b2563ddedd4983..f2c5c32905b998aa54579914f1565c678d4c2610 100755 --- a/AtlasTest/DatabaseTest/AthenaPoolMultiTest/share/SplittableData_jo.py +++ b/AtlasTest/DatabaseTest/AthenaPoolMultiTest/share/SplittableData_jo.py @@ -72,8 +72,6 @@ topSequence += AddTrigMap #topSequence += TagEventTagWriter topSequence += DummyLumirangeTool -theApp.CreateSvc += ['xAODMaker::EventFormatSvc'] - from AthenaPoolExampleAlgorithms.AthenaPoolExampleAlgorithmsConf import AthPoolEx__WriteData topSequence += AthPoolEx__WriteData("WriteData") diff --git a/Build/AtlasBuildScripts/gitlab_merge.sh b/Build/AtlasBuildScripts/gitlab_merge.sh new file mode 100755 index 0000000000000000000000000000000000000000..8b4e9df26e1e5a3029caf0422b66369703bded69 --- /dev/null +++ b/Build/AtlasBuildScripts/gitlab_merge.sh @@ -0,0 +1,68 @@ +#!/usr/bin/env bash +# +# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration +# +# Script to merge a set of MRs with given labels into the local branch. +# + +# Defaults +branch='master' +remote='origin' + +usage() { + cat <<EOF +Usage: gitlab_merge.sh -l labels [-b branch] [-r remote] [-p project] +Fetch and merge MRs with the given labels into current local git branch. + + -l labels comma separate list of labels + -b branch GitLab target branch of MRs [${branch}] + -r remote name of remote in local repository [${remote}] + -p project GitLab project [derived from remote] +EOF +} + +set -e + +while getopts "l:b:r:p:h" opt; do + case $opt in + l ) labels=$OPTARG;; + b ) branch=$OPTARG;; + r ) remote=$OPTARG;; + p ) project=$OPTARG;; + h ) usage; exit;; + ? ) exit 1;; # unknown option + : ) exit 1;; # missing argument + esac +done + +if [ -z "${labels}" ]; then + usage + exit 1 +fi + +# Extract GitLab project name from URL if not given +if [ -z "${project}" ]; then + project=`git remote get-url ${remote} | rev | cut -d '/' -f 1,2 | rev | sed 's#\.git##'` +fi + +# URL encode project name (mostly because of "/") +project_url=`jq -nr --arg v ${project} '$v|@uri'` + +# Get MRs matching label via GitLab API (one page with 100 MRs is enough) +json=`curl --silent "https://gitlab.cern.ch/api/v4/projects/${project_url}/merge_requests?state=opened&per_page=100&target_branch=${branch}&labels=${labels}"` +merge_requests=`echo "$json" | jq '.[]|.iid'` || { echo $json; exit 1; } + +if [ -z "${merge_requests}" ]; then + echo "No MRs matching label '${labels}' for branch '${branch}' in '${project}' found." + exit 0 +fi + +# Fetch all MRs and merge into current branch +# Based on https://stackoverflow.com/questions/44992512 +for id in ${merge_requests}; do + br="mr-${remote}-${id}" + echo "Merging ${project}!${id}" + git fetch ${remote} merge-requests/${id}/head:${br} + git merge --commit --no-edit ${br} + git branch -D ${br} # delete local branch again +done diff --git a/Calorimeter/CaloCondBlobObjs/CaloCondBlobObjs/ATLAS_CHECK_THREAD_SAFETY b/Calorimeter/CaloCondBlobObjs/CaloCondBlobObjs/ATLAS_CHECK_THREAD_SAFETY new file mode 100644 index 0000000000000000000000000000000000000000..47be11715106ad624bd513222d3a11d8c67ab27e --- /dev/null +++ b/Calorimeter/CaloCondBlobObjs/CaloCondBlobObjs/ATLAS_CHECK_THREAD_SAFETY @@ -0,0 +1 @@ +Calorimeter/CaloCondBlobObjs diff --git a/Calorimeter/CaloCondBlobObjs/CaloCondBlobObjs/CaloCondBlobBase.h b/Calorimeter/CaloCondBlobObjs/CaloCondBlobObjs/CaloCondBlobBase.h index 88b400a1c47df39b6a7830d41566ef4816e40e1f..34b8cd85b60e46d5545dba276a702c43aa407784 100644 --- a/Calorimeter/CaloCondBlobObjs/CaloCondBlobObjs/CaloCondBlobBase.h +++ b/Calorimeter/CaloCondBlobObjs/CaloCondBlobObjs/CaloCondBlobBase.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ #ifndef CALOCONDBLOBOBJS_CALOCONDBLOBBASE_H @@ -104,13 +104,17 @@ class CaloCondBlobBase{ //================================================================== /** @brief Returns start address of iEle-th basic unit. @param iEle sequential basic unit number */ - void* getAddress(unsigned int iEle) const; + const void* getAddress(unsigned int iEle) const; + void* getAddress(unsigned int iEle); protected: /** @brief Ctor for const blob. */ CaloCondBlobBase(const coral::Blob& blob); + /** @brief Ctor for non-const blob. */ + CaloCondBlobBase(coral::Blob& blob); + /** @brief (re-)creation of the referenced BLOB object. @param objType Object type @param objVersion Object version @@ -136,16 +140,24 @@ class CaloCondBlobBase{ void dumpHeader(std::ostream& stm) const; private: + /** @brief Internal ctor. */ + CaloCondBlobBase(coral::Blob* blob_nc, const coral::Blob* blob); uint32_t packGainAndNchans(const uint32_t gain, const uint32_t nChans); uint32_t unpacknGains(const uint32_t gainAndnChans); uint32_t unpacknChans(const uint32_t gainAndnChans); /** @brief Returns the BLOB start address as uint32_t pointer. */ - uint32_t* getBlobStart() const; + const uint32_t* getBlobStart() const; + /** @brief Returns the BLOB start address as uint32_t pointer. */ + uint32_t* getBlobStart(); + + /** @brief Non-const reference to the BLOB + (Only present if we were created with a non-const blob. */ + coral::Blob* m_blob_nc; - /** @brief Reference to the BLOB*/ - coral::Blob* m_blob; + /** @brief Const reference to the BLOB (always there) */ + const coral::Blob* m_blob; /** Do I own the BLOB? */ bool m_isBlobOwner; @@ -159,10 +171,18 @@ class CaloCondBlobBase{ // //_________________________________________________________ -inline uint32_t* +inline const uint32_t* CaloCondBlobBase::getBlobStart() const { - return static_cast<uint32_t*>(m_blob->startingAddress()); + return static_cast<const uint32_t*>(m_blob->startingAddress()); +} + +// +//_________________________________________________________ +inline uint32_t* +CaloCondBlobBase::getBlobStart() +{ + return static_cast<uint32_t*>(m_blob_nc->startingAddress()); } // @@ -172,7 +192,7 @@ CaloCondBlobBase::getObjType() const { if(uint64_t(m_blob->size())<getHdrSize()*sizeof(uint32_t)) throw CaloCond::InvalidBlob("CaloCondBlobBase::getObjType"); - return static_cast<uint16_t*>(m_blob->startingAddress())[0]; + return static_cast<const uint16_t*>(m_blob->startingAddress())[0]; } // @@ -182,7 +202,7 @@ CaloCondBlobBase::getObjVersion() const { if(uint64_t(m_blob->size())<getHdrSize()*sizeof(uint32_t)) throw CaloCond::InvalidBlob("CaloCondBlobBase::getObjVersion"); - return static_cast<uint16_t*>(m_blob->startingAddress())[1]; + return static_cast<const uint16_t*>(m_blob->startingAddress())[1]; } // @@ -200,7 +220,7 @@ CaloCondBlobBase::getNObjs() const { if(uint64_t(m_blob->size())<getHdrSize()*sizeof(uint32_t)) throw CaloCond::InvalidBlob("CaloCondBlobBase::getNObjs"); - return static_cast<uint32_t*>(m_blob->startingAddress())[2]; + return static_cast<const uint32_t*>(m_blob->startingAddress())[2]; } // @@ -228,13 +248,25 @@ CaloCondBlobBase::getCommentSizeUint32() const { if(uint64_t(m_blob->size())<getHdrSize()*sizeof(uint32_t)) throw CaloCond::InvalidBlob("CaloCondBlobBase::getCommentSizeUint32"); - return static_cast<uint32_t*>(m_blob->startingAddress())[4]; + return static_cast<const uint32_t*>(m_blob->startingAddress())[4]; } // //_________________________________________________________ -inline void* +inline const void* CaloCondBlobBase::getAddress(unsigned int iEle) const +{ + if(iEle>=getNObjs()){ + throw CaloCond::IndexOutOfRange("CaloCondBlobBase::getAddress", iEle, getNObjs()); + } + return static_cast<const void*> + ( getBlobStart() + getHdrSize() + getObjSizeUint32()*iEle ); +} + +// +//_________________________________________________________ +inline void* +CaloCondBlobBase::getAddress(unsigned int iEle) { if(iEle>=getNObjs()){ throw CaloCond::IndexOutOfRange("CaloCondBlobBase::getAddress", iEle, getNObjs()); @@ -249,8 +281,8 @@ inline uint64_t CaloCondBlobBase::getTimeStamp() const { if(!getCommentSizeUint32()) return 0; - return *(reinterpret_cast<uint64_t*>(getBlobStart()+getHdrSize() + - getNObjs()*getObjSizeUint32())); + return *(reinterpret_cast<const uint64_t*>(getBlobStart()+getHdrSize() + + getNObjs()*getObjSizeUint32())); } #endif diff --git a/Calorimeter/CaloCondBlobObjs/CaloCondBlobObjs/CaloCondBlobDat.h b/Calorimeter/CaloCondBlobObjs/CaloCondBlobObjs/CaloCondBlobDat.h index a8bba1ad941ff0e95275404a42961e42394622c9..d379c4a64c9e9f020aa16ff646a456c44fcd8248 100644 --- a/Calorimeter/CaloCondBlobObjs/CaloCondBlobObjs/CaloCondBlobDat.h +++ b/Calorimeter/CaloCondBlobObjs/CaloCondBlobObjs/CaloCondBlobDat.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ #ifndef CALOCONDBLOBOBJS_CALOCONDBLOBDAT_H @@ -86,12 +86,15 @@ class CaloCondBlobDat : public CaloCondBlobBase protected: /** @brief Ctor. */ CaloCondBlobDat(const coral::Blob& blob) : CaloCondBlobBase(blob){} + /** @brief Ctor. */ + CaloCondBlobDat(coral::Blob& blob) : CaloCondBlobBase(blob){} /** @brief Returns a pointer to the first value for the specified channel/gain. @param channel The channel number; if >= getNChans() it is reset to 0 without warning (default policy) @param adc The gain index; if >= getNGains() it is reset to 0 without warning (default policy) */ - T* getAddress(const unsigned int channel, const unsigned int adc) const; + const T* getAddress(const unsigned int channel, const unsigned int adc) const; + T* getAddress(const unsigned int channel, const unsigned int adc); }; // @@ -147,7 +150,7 @@ CaloCondBlobDat<T>::setData(unsigned int channel, unsigned int adc, const std::v // //______________________________________________________________ -template<class T> T* +template<class T> const T* CaloCondBlobDat<T>::getAddress(const unsigned int channel, const unsigned int adc) const { //=== check for out of bounds @@ -158,6 +161,23 @@ CaloCondBlobDat<T>::getAddress(const unsigned int channel, const unsigned int ad throw CaloCond::IndexOutOfRange("CaloCondBlobDat::getAddress(gain)",adc,getNGains()); } + const unsigned int idx = channel*getNGains() + adc; + return static_cast<const T*>(CaloCondBlobBase::getAddress(idx)); +} + +// +//______________________________________________________________ +template<class T> T* +CaloCondBlobDat<T>::getAddress(const unsigned int channel, const unsigned int adc) +{ + //=== check for out of bounds + if(channel >= getNChans()){ + throw CaloCond::IndexOutOfRange("CaloCondBlobDat::getAddress(channel)",channel,getNChans()); + } + if(adc>=getNGains()){ + throw CaloCond::IndexOutOfRange("CaloCondBlobDat::getAddress(gain)",adc,getNGains()); + } + const unsigned int idx = channel*getNGains() + adc; return static_cast<T*>(CaloCondBlobBase::getAddress(idx)); } diff --git a/Calorimeter/CaloCondBlobObjs/CaloCondBlobObjs/CaloCondBlobFlt.h b/Calorimeter/CaloCondBlobObjs/CaloCondBlobObjs/CaloCondBlobFlt.h index 1e545e71775ba06e2b6e6babf19e80a4ef72537f..3f17b26d9829ef444008dc504a49322920e05c44 100644 --- a/Calorimeter/CaloCondBlobObjs/CaloCondBlobObjs/CaloCondBlobFlt.h +++ b/Calorimeter/CaloCondBlobObjs/CaloCondBlobObjs/CaloCondBlobFlt.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ #ifndef CALOCONDBLOBOBJS_CALOCONDBLOBFLT_H @@ -51,6 +51,8 @@ class CaloCondBlobFlt : public CaloCondBlobDat<float> protected: /** @brief Ctor. */ CaloCondBlobFlt(const coral::Blob& blob); + /** @brief Ctor. */ + CaloCondBlobFlt(coral::Blob& blob); }; #endif diff --git a/Calorimeter/CaloCondBlobObjs/src/CaloCondBlobBase.cxx b/Calorimeter/CaloCondBlobObjs/src/CaloCondBlobBase.cxx index 489fe4e8a7371937a09fe68e4f56099c0aad681f..e4d2e41e22c976ad5054f8695016770eca7c9406 100644 --- a/Calorimeter/CaloCondBlobObjs/src/CaloCondBlobBase.cxx +++ b/Calorimeter/CaloCondBlobObjs/src/CaloCondBlobBase.cxx @@ -9,21 +9,34 @@ // //_____________________________________________________________ -CaloCondBlobBase::CaloCondBlobBase(const coral::Blob& blob) - : m_blob(const_cast<coral::Blob*>(&blob)) +CaloCondBlobBase::CaloCondBlobBase(coral::Blob* blob_nc, + const coral::Blob* blob) + : m_blob_nc(blob_nc), + m_blob(blob) , m_isBlobOwner(false),m_sizeOfObj(0),m_nChans(0),m_nGains(0) { if(uint64_t(m_blob->size())>=getHdrSize()*sizeof(uint32_t)) { - m_sizeOfObj=static_cast<uint32_t*>(m_blob->startingAddress())[1]; + m_sizeOfObj=static_cast<const uint32_t*>(m_blob->startingAddress())[1]; //m_nChans=static_cast<uint16_t*>(m_blob->startingAddress())[6]; //m_nGains=static_cast<uint16_t*>(m_blob->startingAddress())[7]; - m_nChans=unpacknChans(getBlobStart()[3]); - m_nGains=unpacknGains(getBlobStart()[3]); + const CaloCondBlobBase& this_c = *this; + m_nChans=unpacknChans(this_c.getBlobStart()[3]); + m_nGains=unpacknGains(this_c.getBlobStart()[3]); //std::cout << "CaloCondBlobObj: nChans=" << m_nChans << " nGains=" << m_nGains << std::endl; } return; } +CaloCondBlobBase::CaloCondBlobBase(const coral::Blob& blob) + : CaloCondBlobBase (nullptr, &blob) +{ +} + +CaloCondBlobBase::CaloCondBlobBase(coral::Blob& blob) + : CaloCondBlobBase (&blob, &blob) +{ +} + // //_____________________________________________________________ CaloCondBlobBase::~CaloCondBlobBase() @@ -35,7 +48,8 @@ CaloCondBlobBase::~CaloCondBlobBase() // //_____________________________________________________________ CaloCondBlobBase::CaloCondBlobBase(const CaloCondBlobBase& other) - : m_blob(new coral::Blob(*other.m_blob)) + : m_blob_nc(new coral::Blob(*other.m_blob)) + , m_blob (m_blob_nc) , m_isBlobOwner(true), m_sizeOfObj(other.getObjSizeUint32()), m_nChans(other.getNChans()), @@ -50,7 +64,13 @@ CaloCondBlobBase::operator=(const CaloCondBlobBase& other) { //=== catch self-assignment if(&other == this) {return *this;} + if (m_isBlobOwner) delete m_blob; m_blob = other.m_blob; + m_blob_nc = other.m_blob_nc; + m_isBlobOwner = false; + m_sizeOfObj=static_cast<const uint32_t*>(m_blob->startingAddress())[1]; + m_nChans=unpacknChans(getBlobStart()[3]); + m_nGains=unpacknGains(getBlobStart()[3]); return *this; } @@ -83,7 +103,7 @@ CaloCondBlobBase::createBlob(uint16_t objType, //=== create blob const uint32_t blobSizeInBytes = dataSizeByte+commentSizeChar; - m_blob->resize(blobSizeInBytes); + m_blob_nc->resize(blobSizeInBytes); //=== fill header reinterpret_cast<uint16_t*>(getBlobStart())[0] = objType; @@ -153,9 +173,10 @@ std::string CaloCondBlobBase::getAuthor() const { if(!getCommentSizeUint32()) return std::string(""); - char* iBeg = reinterpret_cast<char*>(getBlobStart()+getHdrSize() + - getNObjs()*getObjSizeUint32() + - sizeof(uint64_t)/sizeof(uint32_t)); + const char* iBeg = + reinterpret_cast<const char*>(getBlobStart()+getHdrSize() + + getNObjs()*getObjSizeUint32() + + sizeof(uint64_t)/sizeof(uint32_t)); return std::string(iBeg); } @@ -166,10 +187,11 @@ std::string CaloCondBlobBase::getComment() const { if(!getCommentSizeUint32()) return std::string(""); - char* iBeg = reinterpret_cast<char*>(getBlobStart()+getHdrSize() + - getNObjs()*getObjSizeUint32() + - sizeof(uint64_t)/sizeof(uint32_t)); - char* iEnd = iBeg + getCommentSizeChar(); + const char* iBeg = + reinterpret_cast<const char*>(getBlobStart()+getHdrSize() + + getNObjs()*getObjSizeUint32() + + sizeof(uint64_t)/sizeof(uint32_t)); + const char* iEnd = iBeg + getCommentSizeChar(); iBeg = std::find(iBeg,iEnd,0); return std::string(++iBeg); } @@ -181,7 +203,8 @@ CaloCondBlobBase::getDate() const { if(!getCommentSizeUint32()) return std::string(""); ::time_t timeStamp = getTimeStamp(); - char* iBeg = ::ctime(&timeStamp); + char buf[23]; + char* iBeg = ::ctime_r(&timeStamp, buf); char* iEnd = iBeg; while(*iEnd!='\n'){++iEnd;} return std::string(iBeg,iEnd-iBeg); diff --git a/Calorimeter/CaloCondBlobObjs/src/CaloCondBlobFlt.cxx b/Calorimeter/CaloCondBlobObjs/src/CaloCondBlobFlt.cxx index d669f6ef23fb7f253c79bcb34d6906ce4e9c75c9..817ddb32353d3306e335ae2dcfa16fe5f601ebaf 100644 --- a/Calorimeter/CaloCondBlobObjs/src/CaloCondBlobFlt.cxx +++ b/Calorimeter/CaloCondBlobObjs/src/CaloCondBlobFlt.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ #include "CaloCondBlobObjs/CaloCondBlobFlt.h" @@ -34,6 +34,19 @@ CaloCondBlobFlt::CaloCondBlobFlt(const coral::Blob& blob) } } +// +//_______________________________________________________________ +CaloCondBlobFlt::CaloCondBlobFlt(coral::Blob& blob) + : CaloCondBlobDat<float>(blob) +{ + //=== check for correct blob type + if(getBlobSize()){ + if(getObjType() != getType()){ + throw CaloCond::TypeConflict("CaloCondBlobFlt::Ctor",getObjType(),getType()); + } + } +} + // //______________________________________________________________ float diff --git a/Calorimeter/CaloCondBlobObjs/test/CaloCondBlobBase_test.cxx b/Calorimeter/CaloCondBlobObjs/test/CaloCondBlobBase_test.cxx index 6c8316ea8822491a70ff988b4c3b249b71c05fe7..6ff78b1d2324de3439fa81b68a00075f91e82195 100644 --- a/Calorimeter/CaloCondBlobObjs/test/CaloCondBlobBase_test.cxx +++ b/Calorimeter/CaloCondBlobObjs/test/CaloCondBlobBase_test.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ #define BOOST_TEST_DYN_LINK @@ -23,6 +23,9 @@ public: CaloCondBlobStub(const coral::Blob & aBlob):CaloCondBlobBase(aBlob){ //nop } + CaloCondBlobStub(coral::Blob & aBlob):CaloCondBlobBase(aBlob){ + //nop + } uint32_t createBlobExposed(uint16_t objType, uint16_t objVersion, diff --git a/Calorimeter/CaloConditions/CaloConditions/CaloLocalHadCoeff.h b/Calorimeter/CaloConditions/CaloConditions/CaloLocalHadCoeff.h index 4ee43eaa910ceae92b00f4a2752f01d73acf613b..ca91e017fbf63924d550f67a76e58da0a2d360ad 100644 --- a/Calorimeter/CaloConditions/CaloConditions/CaloLocalHadCoeff.h +++ b/Calorimeter/CaloConditions/CaloConditions/CaloLocalHadCoeff.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ #ifndef CALOCONDITIONS_CALOLOCALHADCOEFF_H @@ -72,12 +72,13 @@ class CaloLocalHadCoeff { * @param xbins Bins borders, vector of size m_nbins+1 */ LocalHadDimension(const char *title, unsigned int typ, std::vector<float > &xbins) : - m_title(title), m_type(typ), m_dx(0.0) + m_title(title), m_type(typ), + m_nbins (xbins.size() - 1), + m_xmin (xbins.front()), + m_xmax (xbins.back()), + m_dx(0.0), + m_xbins (xbins) { - m_xbins = xbins; - m_xmin = xbins.front(); - m_xmax = xbins.back(); - m_nbins = xbins.size() -1; } /** * @brief Copy constructor diff --git a/Calorimeter/CaloConditions/CaloConditions/ToolConstants.h b/Calorimeter/CaloConditions/CaloConditions/ToolConstants.h index f0bcd25b581e12a0b9ce30a06f308151c1ba662f..21c1ff355dc7f84493e13a000404daa30da8d943 100755 --- a/Calorimeter/CaloConditions/CaloConditions/ToolConstants.h +++ b/Calorimeter/CaloConditions/CaloConditions/ToolConstants.h @@ -1,10 +1,7 @@ // This file's extension implies that it's C, but it's really -*- C++ -*-. - /* Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ - -// $Id: ToolConstants.h,v 1.5 2009-04-09 14:41:17 ssnyder Exp $ /** * @file ToolConstants.h * @author scott snyder <snyder@bnl.gov> diff --git a/Calorimeter/CaloConditions/src/ToolConstants.cxx b/Calorimeter/CaloConditions/src/ToolConstants.cxx index e3527bdb80b84e587535cff3151682835019975a..007fdd6081ddebf879348019b7ab0ec1ac9a6eb6 100755 --- a/Calorimeter/CaloConditions/src/ToolConstants.cxx +++ b/Calorimeter/CaloConditions/src/ToolConstants.cxx @@ -125,11 +125,9 @@ void ToolConstants::error (const std::string& context, void ToolConstants::writeConstants(std::ostream& stream, const std::string& name) const { - Maptype::const_iterator it=m_map.begin(); - Maptype::const_iterator it_e=m_map.end(); - for (;it!=it_e;it++) { - stream << name << "." << it->first << " = "; - it->second.write_array(stream); + for (const std::pair<const std::string, CxxUtils::Arrayrep>& p : m_map) { + stream << name << "." << p.first << " = "; + p.second.write_array(stream); } stream << std::endl; } diff --git a/Calorimeter/CaloInterface/CaloInterface/IToolWithConstants.h b/Calorimeter/CaloInterface/CaloInterface/IToolWithConstants.h index d58d79b057cb86e2492aa9ea8c39b6ad5840018b..ba5023b3c087c6ed4da59a00349f37bf132c123d 100644 --- a/Calorimeter/CaloInterface/CaloInterface/IToolWithConstants.h +++ b/Calorimeter/CaloInterface/CaloInterface/IToolWithConstants.h @@ -15,7 +15,7 @@ #include "CaloConditions/ToolConstants.h" -#include "GaudiKernel/IAlgTool.h" +#include "GaudiKernel/IInterface.h" #include "GaudiKernel/StatusCode.h" #include "GaudiKernel/EventContext.h" #include <string> @@ -27,7 +27,7 @@ * Defines operations needed by CaloClusterCorrDBWriter. */ class IToolWithConstants - : virtual public IAlgTool + : virtual public IInterface { public: DeclareInterfaceID (IToolWithConstants, 1, 0); diff --git a/Calorimeter/CaloTrackingGeometry/src/CaloSurfaceHelper.cxx b/Calorimeter/CaloTrackingGeometry/src/CaloSurfaceHelper.cxx index 129bfe85157ee70c167dbbc9c80042dfd81d1c28..e7d4f08faf482754367472240ff74e43051a9edf 100755 --- a/Calorimeter/CaloTrackingGeometry/src/CaloSurfaceHelper.cxx +++ b/Calorimeter/CaloTrackingGeometry/src/CaloSurfaceHelper.cxx @@ -81,7 +81,10 @@ const Trk::Surface& CaloSurfaceHelper::GetFlatEntrySurface (const CaloCell_ID:: const Trk::Surface* surf = side>0 ? m_flatEntrySurfs[sample].first : m_flatEntrySurfs[sample].second; - if (!surf) ATH_MSG_FATAL(" failed to retrieve flat entry layer for sample:"<<sample<<" on side:"<<side<<" crashing...."); + if (!surf) { + ATH_MSG_FATAL(" failed to retrieve flat entry layer for sample:"<<sample<<" on side:"<<side<<" crashing...."); + std::abort(); + } return *surf; } @@ -89,7 +92,10 @@ const Trk::Surface& CaloSurfaceHelper::GetEntrySurface(const CaloCell_ID::CaloSa const Trk::Surface* surf = side>0 ? m_entrySurfs[sample].first : m_entrySurfs[sample].second; - if (!surf) ATH_MSG_FATAL(" failed to retrieve entry layer for sample:"<<sample<<" on side:"<<side<<" crashing...."); + if (!surf) { + ATH_MSG_FATAL(" failed to retrieve entry layer for sample:"<<sample<<" on side:"<<side<<" crashing...."); + std::abort(); + } return *surf; } @@ -97,7 +103,10 @@ const Trk::Surface& CaloSurfaceHelper::GetExitSurface (const CaloCell_ID::CaloSa const Trk::Surface* surf = side>0 ? m_exitSurfs[sample].first : m_exitSurfs[sample].second; - if (!surf) ATH_MSG_FATAL(" failed to retrieve exit layer for sample:"<<sample<<" on side:"<<side<<" crashing...."); + if (!surf) { + ATH_MSG_FATAL(" failed to retrieve exit layer for sample:"<<sample<<" on side:"<<side<<" crashing...."); + std::abort(); + } return *surf; } diff --git a/Calorimeter/CaloTrackingGeometry/src/CaloTrackingGeometryBuilder.cxx b/Calorimeter/CaloTrackingGeometry/src/CaloTrackingGeometryBuilder.cxx index 876a01a83c1da11427105e069f650b70f02fd87a..a1c927350e470431133a438899e123da59e900fb 100755 --- a/Calorimeter/CaloTrackingGeometry/src/CaloTrackingGeometryBuilder.cxx +++ b/Calorimeter/CaloTrackingGeometry/src/CaloTrackingGeometryBuilder.cxx @@ -284,8 +284,8 @@ const Trk::TrackingGeometry* Calo::CaloTrackingGeometryBuilder::trackingGeometry if ( msCutouts.empty() ) msCutouts.push_back( envelopeDefs[i] ); else { RZPairVector::iterator envIter = msCutouts.begin(); - while (envIter!= msCutouts.end() && (*envIter).second < envelopeDefs[i].second ) envIter++; - while (envIter!= msCutouts.end() && (*envIter).second == envelopeDefs[i].second && (*envIter).first > envelopeDefs[i].first ) envIter++; + while (envIter!= msCutouts.end() && (*envIter).second < envelopeDefs[i].second ) ++envIter; + while (envIter!= msCutouts.end() && (*envIter).second == envelopeDefs[i].second && (*envIter).first > envelopeDefs[i].first ) ++envIter; msCutouts.insert(envIter, envelopeDefs[i]); } } diff --git a/Calorimeter/CaloTrackingGeometry/src/CaloTrackingGeometryBuilderCond.cxx b/Calorimeter/CaloTrackingGeometry/src/CaloTrackingGeometryBuilderCond.cxx index 1992999c271be8fc4091b294a3cfefb1592722b3..f2a4f973f7f2ed37e952e29681258fd0d7898819 100755 --- a/Calorimeter/CaloTrackingGeometry/src/CaloTrackingGeometryBuilderCond.cxx +++ b/Calorimeter/CaloTrackingGeometry/src/CaloTrackingGeometryBuilderCond.cxx @@ -291,8 +291,8 @@ std::pair<EventIDRange, const Trk::TrackingGeometry*> Calo::CaloTrackingGeometry if ( msCutouts.empty() ) msCutouts.push_back( envelopeDefs[i] ); else { RZPairVector::iterator envIter = msCutouts.begin(); - while (envIter!= msCutouts.end() && (*envIter).second < envelopeDefs[i].second ) envIter++; - while (envIter!= msCutouts.end() && (*envIter).second == envelopeDefs[i].second && (*envIter).first > envelopeDefs[i].first ) envIter++; + while (envIter!= msCutouts.end() && (*envIter).second < envelopeDefs[i].second ) ++envIter; + while (envIter!= msCutouts.end() && (*envIter).second == envelopeDefs[i].second && (*envIter).first > envelopeDefs[i].first ) ++envIter; msCutouts.insert(envIter, envelopeDefs[i]); } } diff --git a/Calorimeter/CaloUtils/CaloUtils/ToolWithConstants.h b/Calorimeter/CaloUtils/CaloUtils/ToolWithConstants.h index e636571c33bd1d53829f9d98849f6b9f6fc030ba..5209170e64b66ecbddde3ec05dd87c2cc2c96b23 100644 --- a/Calorimeter/CaloUtils/CaloUtils/ToolWithConstants.h +++ b/Calorimeter/CaloUtils/CaloUtils/ToolWithConstants.h @@ -20,6 +20,7 @@ #include "CaloUtils/exceptions.h" +#include "CaloInterface/IToolWithConstants.h" #include "CaloConditions/ToolConstants.h" #include "AthenaBaseComps/AthCheckMacros.h" #include "StoreGate/ReadCondHandleKey.h" @@ -434,7 +435,7 @@ private: template <class BASE> ATH_REQUIRES( requires (BASE& b, Gaudi::Property<int>& p) { { b.declareProperty(p) }; } ) class ToolWithConstants - : public BASE + : public extends<BASE, IToolWithConstants> { public: /// Shorthand for derived classes. @@ -442,7 +443,7 @@ public: /// Inherit constructor. - using BASE::BASE; + using extends<BASE, IToolWithConstants>::extends; /// Convenient alias for the Context type. @@ -485,7 +486,7 @@ public: * @param ctx Event context. */ virtual StatusCode mergeConstants (CaloRec::ToolConstants& out, - const EventContext& ctx) const; + const EventContext& ctx) const override; /** diff --git a/Control/AthViews/CMakeLists.txt b/Control/AthViews/CMakeLists.txt index 8cfbffaab5b77b1237b32d2e7c621fab940f3d3b..594026fe12ec14d50f6e3dd822cb95b638dfa042 100644 --- a/Control/AthViews/CMakeLists.txt +++ b/Control/AthViews/CMakeLists.txt @@ -12,7 +12,7 @@ atlas_add_library( AthViews src/*.cxx PUBLIC_HEADERS AthViews INCLUDE_DIRS ${TBB_INCLUDE_DIRS} - LINK_LIBRARIES ${TBB_LIBRARIES} AthContainers AthLinks AthenaBaseComps AthenaKernel GaudiKernel StoreGateLib TrigSteeringEvent ) + LINK_LIBRARIES ${TBB_LIBRARIES} AthContainers AthLinks AthenaBaseComps AthenaKernel GaudiKernel StoreGateLib TrigSteeringEvent SGTools ) atlas_add_component( AthViewsAlgs src/components/*.cxx diff --git a/Control/AthViews/src/SimpleView.cxx b/Control/AthViews/src/SimpleView.cxx index 5b2821f7055510d444da388c3eacc3433deeb4ef..9c232b98026abfc7b5c723a32bae6d5c010740f0 100644 --- a/Control/AthViews/src/SimpleView.cxx +++ b/Control/AthViews/src/SimpleView.cxx @@ -5,6 +5,7 @@ #include <stdexcept> #include "AthViews/SimpleView.h" #include "AthViews/View.h" +#include "SGTools/transientKey.h" SimpleView::SimpleView( std::string Name, bool AllowFallThrough, std::string const& storeName ) : m_store( storeName, Name ), @@ -25,7 +26,7 @@ SimpleView::~SimpleView() */ std::string SimpleView::viewKey (const std::string& key) const { - return m_name + "_" + key; + return SG::transientKey (m_name + "_" + key); } diff --git a/Control/AthViews/test/ViewCollectionMerge_test.cxx b/Control/AthViews/test/ViewCollectionMerge_test.cxx index 87b69137572312ff7e06cac63fa42eef9ff54d94..cb23953eff99669ec293348e9e52a9dbeb4908d3 100644 --- a/Control/AthViews/test/ViewCollectionMerge_test.cxx +++ b/Control/AthViews/test/ViewCollectionMerge_test.cxx @@ -477,7 +477,7 @@ TEST_F( ViewCollectionMerge_test, elementLinkViewRemapTest ) { ASSERT_TRUE( outputDataHandle2.isValid() ); // Declare remapping - pretty hacky, have to specify view object names explicitly - evtStore()->remap( ClassID_traits< DataVector< int > >::ID(), "testView_" + DATA_NAME, "testView_" + DATA_NAME + "2", 0 ); + evtStore()->remap( ClassID_traits< DataVector< int > >::ID(), "_testView_" + DATA_NAME, "_testView_" + DATA_NAME + "2", 0 ); // Test the link again - should not have changed ASSERT_TRUE( dataLink.isValid() ); @@ -566,8 +566,8 @@ TEST_F( ViewCollectionMerge_test, elementLinkMergeRemapTest ) { ASSERT_TRUE( outputDataHandle.isValid() ); // Declare remapping - pretty hacky, have to specify view object names explicitly - evtStore()->remap( ClassID_traits< DataVector< int > >::ID(), "testView_1_" + DATA_NAME, DATA_NAME, 0 ); - evtStore()->remap( ClassID_traits< DataVector< int > >::ID(), "testView_2_" + DATA_NAME, DATA_NAME, 1 ); + evtStore()->remap( ClassID_traits< DataVector< int > >::ID(), "_testView_1_" + DATA_NAME, DATA_NAME, 0 ); + evtStore()->remap( ClassID_traits< DataVector< int > >::ID(), "_testView_2_" + DATA_NAME, DATA_NAME, 1 ); // Element link should still be pointing to view container ASSERT_TRUE( dataLink.isValid() ); @@ -665,8 +665,8 @@ TEST_F( ViewCollectionMerge_test, elementLinkMergeRemapBookkeepTest ) { ASSERT_TRUE( auxHandle.isValid() ); // Declare remapping - pretty hacky, have to specify view object names explicitly - evtStore()->remap( ClassID_traits< DataVector< DummyData > >::ID(), "testView_1_" + DATA_NAME, DATA_NAME, 0 ); - evtStore()->remap( ClassID_traits< DataVector< DummyData > >::ID(), "testView_2_" + DATA_NAME, DATA_NAME, 1 ); + evtStore()->remap( ClassID_traits< DataVector< DummyData > >::ID(), "_testView_1_" + DATA_NAME, DATA_NAME, 0 ); + evtStore()->remap( ClassID_traits< DataVector< DummyData > >::ID(), "_testView_2_" + DATA_NAME, DATA_NAME, 1 ); // Element link should still be pointing to view container ASSERT_TRUE( dataLink.isValid() ); diff --git a/Control/AthenaCommon/CMakeLists.txt b/Control/AthenaCommon/CMakeLists.txt index a8197ba6b870b417f1078aeecae63cf517a52e8f..15f9cdc6b878b2c4c34ba83182450994405ae513 100644 --- a/Control/AthenaCommon/CMakeLists.txt +++ b/Control/AthenaCommon/CMakeLists.txt @@ -13,7 +13,7 @@ atlas_install_python_modules( python/*.py python/Utils POST_BUILD_CMD ${ATLAS_FLAKE8} ) atlas_install_joboptions( share/Preparation.py share/Execution.py share/Atlas.UnixStandardJob.py test/*.py share/zeroJO.py share/Atlas_Gen.UnixStandardJob.py share/MemTraceInclude.py share/runbatch.py) -atlas_install_scripts( share/athena.py share/athena3.py share/athena_preload.sh share/chappy.py share/find_cfg_dups.py share/test_cfg_pickling.py share/ThinCAWrapper.sh) +atlas_install_scripts( share/athena.py share/athena3.py share/athena_preload.sh share/chappy.py share/test_cfg_pickling.py share/ThinCAWrapper.sh) atlas_install_runtime(share/*.pkl) # Aliases: diff --git a/Control/AthenaCommon/python/AthArgumentParser.py b/Control/AthenaCommon/python/AthArgumentParser.py new file mode 100644 index 0000000000000000000000000000000000000000..74f40f32a29f27fe4e1caf2dac943e6acb55052f --- /dev/null +++ b/Control/AthenaCommon/python/AthArgumentParser.py @@ -0,0 +1,128 @@ +# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration + +""" Helper wrapper to argparse.ArgumentParser for use in athena + + The user's options are separated from athena's command line arguments by a + single '-' character when athena is called. + + Public classes: + AthArgumentParser + + Usage: + from AthenaCommon.AthArgumentParser import AthArgumentParser + parser = AthArgumentParser() + parser.add_argument("-a", "--arg", action="store", help="Argument") + + args = parser.parse_args() + print(args.arg) # etc +""" + +import argparse +import sys +import inspect +import os +from subprocess import Popen, PIPE + +# import the command line options back from the main process. +# This means that this code only runs in something like an athena call. +from __main__ import opts + + +class AthArgumentParser(argparse.ArgumentParser): + """ Parse user commandline arguments in a job option. """ + + def __init__(self, jo_name=None, prog=None, print_caller_help=True, **kwargs): + """ Create the parser + --------- + Arguments + --------- + jo_name: + The name of the calling job option, used to format the help + text. Will attempt to deduce it if possible + prog: + The start of the usage message, usually can be deduced + print_caller_help: + Whether or not to print the help text from the calling program + (usually athena) + + All other keyword arguments are forwarded to the base class + constructor + """ + + caller = sys.argv[0] + if prog is None: + if jo_name is None: + # Use inspect to find which job option we're in. This isn't + # completely foolproof but it's just a cosmetic detail so + # doesn't need to be + for frame in inspect.stack(): + # For each frame in the stack, check the file name and keep + # it if it matches one of the scripts supplied + fname = inspect.getfile(frame[0]) + try: + jo_name = next( + script for script in opts.scripts if fname.endswith(script) + ) + break + except StopIteration: + pass + else: + # fallback name + jo_name = "User job option" + prog = "{0} {1} [{0} options] -".format(os.path.basename(caller), jo_name) + if print_caller_help: + # Get the help options for the caller + caller_help, _ = Popen( + [caller, "--help"], stdout=PIPE, stderr=PIPE + ).communicate() + # decode from bytes + caller_help = caller_help.decode("utf-8") + if caller.endswith("athena.py"): + # If this is being called from athena, we know that there are + # some lines to strip off + caller_help = caller_help.split("\n", 3)[3] + self.caller_help = "{} options:\n{}".format( + os.path.basename(caller), caller_help + ) + else: + self.caller_help = "" + super().__init__(prog=prog, **kwargs) + super().add_argument( + "remaining scripts", + nargs="*", + help="Any remaining scripts to be run by athena after this job option. Mainly used to run the 'post' script on the grid.", + ) + + def add_argument(self, *args, **kwargs): + """ Add a new argument + + The difference between this and the base class is that it disallows + adding positional arguments which are reserved by athena for job + options. In particular, even if user code uses only one job option + (which is common) pathena will add more when running on the grid + """ + if not args or len(args) and args[0][0] not in self.prefix_chars: + raise ValueError( + "Positional arguments are not allowed! Defining them could mess up grid running!" + ) + return super().add_argument(*args, **kwargs) + + def parse_args(self, args=None, namespace=None): + """ Override the base class to use the leftover athena argumnets by + default + """ + if args is None: + args = opts.user_opts + return super().parse_args(args, namespace) + + def parse_known_args(self, args=None, namespace=None): + """ Override the base class to use the leftover athena argumnets by + default + """ + if args is None: + args = opts.user_opts + return super().parse_known_args(args, namespace) + + def format_help(self): + text = super().format_help() + return "\n".join([text, self.caller_help]) diff --git a/Control/AthenaCommon/python/AthOptionsParser.py b/Control/AthenaCommon/python/AthOptionsParser.py index db5feb0ca7d122b5dc8dd0ea2bb0983fc15bd7b5..fc01a7ee194637c6e87a36434aca1f4618909e7f 100644 --- a/Control/AthenaCommon/python/AthOptionsParser.py +++ b/Control/AthenaCommon/python/AthOptionsParser.py @@ -214,7 +214,7 @@ def parse(chk_tcmalloc=True): try: optlist, args = getopt.getopt(_opts, _useropts, _userlongopts) except getopt.error: - print (sys.exc_value) + print (sys.exc_info()[1]) _help_and_exit() if warn_tcmalloc and chk_tcmalloc: @@ -256,8 +256,14 @@ def parse(chk_tcmalloc=True): opts.command = arg.strip() elif opt in ("-h", "--help"): - print (_error_msg) - sys.exit() + if len(scripts) > 0: + # If we have user scripts, we should also check if they have + # helptext to print + opts.msg_lvl = "WARNING" + opts.user_opts += ["-h"] + else: + print (_error_msg) + sys.exit() elif opt in ("-l", "--loglevel"): opts.msg_lvl = arg.upper() diff --git a/Control/AthenaCommon/python/CFElements.py b/Control/AthenaCommon/python/CFElements.py index baa105312be9803c8105e05f5a0d016b50d489d9..f8c593ff7955c68d385794ea392f371bf511cd83 100755 --- a/Control/AthenaCommon/python/CFElements.py +++ b/Control/AthenaCommon/python/CFElements.py @@ -201,10 +201,10 @@ def flatAlgorithmSequences( start ): if isSequence( c ): __inner( c, collector ) - from collections import defaultdict + from collections import defaultdict,OrderedDict c = defaultdict(list) __inner(start, c) - return c + return OrderedDict(c) def flatSequencers( start, algsCollection=None ): """ Returns dict of sequences keyed by name and containing list of it's members """ diff --git a/Control/AthenaCommon/share/Execution.py b/Control/AthenaCommon/share/Execution.py index 03751374fd8fe08ffe58c14d088cf85bd80edfbc..032a68539d2392496361244105842c9fcdb6683e 100644 --- a/Control/AthenaCommon/share/Execution.py +++ b/Control/AthenaCommon/share/Execution.py @@ -46,6 +46,13 @@ for script in opts.scripts: else: ## only get here if all scripts successfully included + if "-h" in opts.user_opts or "--help" in opts.user_opts: + # The user script was displaying help messages stop here + # In most cases, the user script should kill the process already (argparse + # does this for you) but just in case print our help message and stop + from AthenaCommon.AthOptionsParser import _error_msg + print(_error_msg) + theApp.exit() ## load from .pkl file if given if opts.fromdb: diff --git a/Control/AthenaConfiguration/python/AllConfigFlags.py b/Control/AthenaConfiguration/python/AllConfigFlags.py index 2d09407b2e9d01c28e484f149a88f1fedfca05ad..e44e8143355e72cc2c62ac0e5c5d0531ea0517da 100644 --- a/Control/AthenaConfiguration/python/AllConfigFlags.py +++ b/Control/AthenaConfiguration/python/AllConfigFlags.py @@ -30,6 +30,7 @@ def _createCfgFlags(): acf.addFlag('Input.SecondaryFiles', []) # secondary input files for DoubleEventSelector acf.addFlag('Input.isMC', lambda prevFlags : "IS_SIMULATION" in GetFileMD(prevFlags.Input.Files).get("eventTypes",[]) ) # former global.isMC acf.addFlag('Input.RunNumber', lambda prevFlags : list(GetFileMD(prevFlags.Input.Files).get("runNumbers",[]))) # former global.RunNumber + acf.addFlag('Input.LumiBlockNumber', lambda prevFlags : list(GetFileMD(prevFlags.Input.Files).get("lumiBlockNumbers",[]))) # former global.RunNumber acf.addFlag('Input.ProjectName', lambda prevFlags : GetFileMD(prevFlags.Input.Files).get("project_name","data17_13TeV") ) # former global.ProjectName acf.addFlag('Input.Format', lambda prevFlags : GetFileMD(prevFlags.Input.Files).get("file_type","") ) # former global.InputFormat diff --git a/Control/AthenaConfiguration/python/MainServicesConfig.py b/Control/AthenaConfiguration/python/MainServicesConfig.py index 0b8a8eba503825d897449e9d945a2ea6b6fce4ad..8de56aa28e10ae385ca713cb713778cff1e4ca22 100644 --- a/Control/AthenaConfiguration/python/MainServicesConfig.py +++ b/Control/AthenaConfiguration/python/MainServicesConfig.py @@ -79,7 +79,7 @@ def MainServicesCfg(cfgFlags): cfg.addService(StoreGateSvc("ConditionStore")) from AtlasGeoModel.GeoModelConfig import GeoModelCfg - cfg.merge( GeoModelCfg(cfgFlags) ) + cfg.merge(GeoModelCfg(cfgFlags)) cfg.addService(CompFactory.DetDescrCnvSvc(), create=True) cfg.addService(CompFactory.CoreDumpSvc(), create=True) diff --git a/Control/AthenaConfiguration/python/TestDefaults.py b/Control/AthenaConfiguration/python/TestDefaults.py index b1a35018220897d10b13123bb6c595c598f7d4f3..efc9307840e715e73f1b4f9a55ac6dfca47754ac 100644 --- a/Control/AthenaConfiguration/python/TestDefaults.py +++ b/Control/AthenaConfiguration/python/TestDefaults.py @@ -11,6 +11,16 @@ class defaultTestFiles(object): HITS= [d + "/Tier0ChainTests/valid1.410000.PowhegPythiaEvtGen_P2012_ttbar_hdamp172p5_nonallhad.simul.HITS.e4993_s3091/HITS.10504490._000425.pool.root.1"] HITS_SPECIAL = [d + "/DigitizationTests/mc16_13TeV.HITS.16965029._000024.pool.root.1"] HITS_DATA_OVERLAY = [d + "/OverlayMonitoringRTT/mc16_13TeV.361107.PowhegPythia8EvtGen_AZNLOCTEQ6L1_Zmumu.OverlaySim/HITS.pool.root"] + HITS_MINBIAS_HIGH = [ + d + "/Tier0ChainTests/mc16_13TeV.361239.Pythia8EvtGen_A3NNPDF23LO_minbias_inelastic_high.merge.HITS.e4981_s3087_s3089/HITS.10501933._000005.pool.root.1", + d + "/Tier0ChainTests/mc16_13TeV.361239.Pythia8EvtGen_A3NNPDF23LO_minbias_inelastic_high.merge.HITS.e4981_s3087_s3089/HITS.10501933._000013.pool.root.1", + d + "/Tier0ChainTests/mc16_13TeV.361239.Pythia8EvtGen_A3NNPDF23LO_minbias_inelastic_high.merge.HITS.e4981_s3087_s3089/HITS.10501933._000018.pool.root.1", + ] + HITS_MINBIAS_LOW = [ + d + "/Tier0ChainTests/mc16_13TeV.361238.Pythia8EvtGen_A3NNPDF23LO_minbias_inelastic_low.merge.HITS.e4981_s3087_s3089/HITS.10501925._000003.pool.root.1", + d + "/Tier0ChainTests/mc16_13TeV.361238.Pythia8EvtGen_A3NNPDF23LO_minbias_inelastic_low.merge.HITS.e4981_s3087_s3089/HITS.10501925._000024.pool.root.1", + d + "/Tier0ChainTests/mc16_13TeV.361238.Pythia8EvtGen_A3NNPDF23LO_minbias_inelastic_low.merge.HITS.e4981_s3087_s3089/HITS.10501925._000044.pool.root.1", + ] RAW = [d + "/TrigP1Test/data17_13TeV.00327265.physics_EnhancedBias.merge.RAW._lb0100._SFO-1._0001.1"] RAW_BKG = [d + "/OverlayMonitoringRTT/mc15_valid.00200010.overlay_streamsAll_2016_pp_1.skim.DRAW.r8381/DRAW.09331084._000146.pool.root.1"] RDO = [d + "/Tier0ChainTests/q221/21.0/v1/myRDO.pool.root"] diff --git a/Control/AthenaKernel/AthenaKernel/IMetaDataSvc.h b/Control/AthenaKernel/AthenaKernel/IMetaDataSvc.h index bf81f6019be4a58f1906b467b20a6050295ec1c4..1c84d4cd5cb9afdbf503cac22e0fcde2eb2a6471 100644 --- a/Control/AthenaKernel/AthenaKernel/IMetaDataSvc.h +++ b/Control/AthenaKernel/AthenaKernel/IMetaDataSvc.h @@ -12,9 +12,11 @@ #include "GaudiKernel/INamedInterface.h" #include "AthenaKernel/MetaCont.h" +#include "StoreGate/StoreGateSvc.h" #include <string> #include <mutex> +#include <typeinfo> /** @class IMetaDataSvc * @brief This class provides the interface for MetaDataSvc @@ -56,6 +58,12 @@ public: // Non-static members /// Gaudi boilerplate static const InterfaceID& interfaceID(); + /// Hook for implementation to react to recording an object + virtual void recordHook(const std::type_info&) {} + + /// Hook for implementation to react to removing an object + virtual void removeHook(const std::type_info&) {} + private: // Data std::mutex m_mutex; }; @@ -99,7 +107,9 @@ StatusCode IMetaDataSvc::record(T* pObject, const TKEY& key) if( !container ) { auto cont_uptr = std::make_unique< MetaCont<T> >(); if( cont_uptr->insert( currentRangeID() , pObject) ) { - return outputDataStore()->record( std::move(cont_uptr), key ); + StatusCode sc = outputDataStore()->record( std::move(cont_uptr), key ); + if (sc.isSuccess()) recordHook(typeid(T)); + return sc; } return StatusCode::FAILURE; } @@ -112,6 +122,7 @@ template <typename T, typename TKEY> StatusCode IMetaDataSvc::record(std::unique_ptr<T> pUnique, const TKEY& key) { if( this->record( pUnique.get(), key ).isSuccess() ) { + recordHook(typeid(T)); pUnique.release(); return StatusCode::SUCCESS; } @@ -126,6 +137,7 @@ StatusCode IMetaDataSvc::remove(const TKEY& key, bool ignoreIfAbsent) std::lock_guard lock(m_mutex); // change erase to setting nullptr? MetaCont<T>* container = outputDataStore()->tryRetrieve< MetaCont<T> >(key); + removeHook(typeid(T)); if( container and container->erase( currentRangeID() ) ) return StatusCode::SUCCESS; return ignoreIfAbsent? StatusCode::SUCCESS : StatusCode::FAILURE; } diff --git a/Control/AthenaMonitoring/python/AthMonitorCfgHelper.py b/Control/AthenaMonitoring/python/AthMonitorCfgHelper.py index d9ec2bd41db2038b453cfe05fc3b9c2a34e2660a..1239250b00388778e7e101ba261a47953842b749 100644 --- a/Control/AthenaMonitoring/python/AthMonitorCfgHelper.py +++ b/Control/AthenaMonitoring/python/AthMonitorCfgHelper.py @@ -102,6 +102,8 @@ class AthMonitorCfgHelper(object): tool -- a GenericMonitoringTool Configurable object. This can be used to define histograms associated with that group (using defineHistogram). ''' + if name == alg.getName(): + raise ValueError(f"Cannot have a monitoring group with the same name as the parent algorithm ({name})") array = self.addArray([1],alg,name,topPath=topPath,defaultDuration=defaultDuration) return array[0] diff --git a/Control/AthenaMonitoring/python/AthenaMonitoringCfg.py b/Control/AthenaMonitoring/python/AthenaMonitoringCfg.py index df758b81ca21c07a17fcfece931949079348c4e2..24d0eb08a4e7eeedc4b428f186d169d6222fc304 100644 --- a/Control/AthenaMonitoring/python/AthenaMonitoringCfg.py +++ b/Control/AthenaMonitoring/python/AthenaMonitoringCfg.py @@ -22,6 +22,11 @@ def AthenaMonitoringCfg(flags): info('Set up TRT monitoring') from TRTMonitoringRun3.TRTMonitoringRun3Config import TRTMonitoringRun3Cfg result.merge(TRTMonitoringRun3Cfg(flags)) + + if flags.DQ.Steering.doInDetMon: + info('Set up InDet Global monitoring') + from InDetGlobalMonitoringRun3Test.InDetGlobalMonitoringRun3TestConfig import InDetGlobalMonitoringRun3TestConfig + result.merge(InDetGlobalMonitoringRun3TestConfig(flags)) if flags.DQ.Steering.doLArMon: info('Set up LAr monitoring') diff --git a/Control/AthenaMonitoring/python/DQConfigFlags.py b/Control/AthenaMonitoring/python/DQConfigFlags.py index 08ce9be8d9a482e6a02983b8fe6450370481ebbb..603243c208641ce6213ef6106297242714f4b6a5 100644 --- a/Control/AthenaMonitoring/python/DQConfigFlags.py +++ b/Control/AthenaMonitoring/python/DQConfigFlags.py @@ -27,9 +27,11 @@ def createDQConfigFlags(): acf.addFlag('DQ.disableAtlasReadyFilter', False) acf.addFlag('DQ.enableLumiAccess', True) acf.addFlag('DQ.FileKey', 'CombinedMonitoring') - from PyUtils.moduleExists import moduleExists - hlt_exists = moduleExists ('TrigHLTMonitoring') - acf.addFlag('DQ.useTrigger', hlt_exists) + # two flags here, with different meaning. + # triggerDataAvailable determines whether we expect trigger objects in the event store + acf.addFlag('DQ.triggerDataAvailable', True) + # useTrigger determines whether we should use TrigDecisionTool + acf.addFlag('DQ.useTrigger', getUseTrigger) # temp thing for steering from inside old-style ... acf.addFlag('DQ.isReallyOldStyle', False) @@ -52,6 +54,11 @@ def createDQConfigFlags(): acf.join(createHLTDQConfigFlags()) return acf +def getUseTrigger(flags): + from PyUtils.moduleExists import moduleExists + hlt_exists = moduleExists ('TrigHLTMonitoring') + return hlt_exists and flags.DQ.triggerDataAvailable + def getDataType(flags): if flags.Input.isMC: return 'monteCarlo' diff --git a/Control/AthenaMonitoring/python/TriggerInterface.py b/Control/AthenaMonitoring/python/TriggerInterface.py index fd3f07f7602a446944dbe3860840054998e8a7bf..66bd119289194eedd59f8aadef92a60352fae371 100644 --- a/Control/AthenaMonitoring/python/TriggerInterface.py +++ b/Control/AthenaMonitoring/python/TriggerInterface.py @@ -28,10 +28,10 @@ def getTrigDecisionTool(flags): tdt = CompFactory.Trig.TrigDecisionTool('TrigDecisionTool') tdt.TrigConfigSvc = cfgsvc - if not flags.Input.isMC and flags.Input.Format == 'BS' and min(flags.Input.RunNumber) <= 380000: + if not flags.Input.isMC: # need to work through exact details here # tdt.UseOldEventInfoDecisionFormat = True - tdt.NavigationFormat = "TrigComposite" + tdt.NavigationFormat = "TrigComposite" if flags.Trigger.EDMDecodingVersion == 3 else "TriggerElement" else: tdt.NavigationFormat = "TrigComposite" if 'HLTNav_Summary' in flags.Input.Collections else "TriggerElement" rv.addPublicTool(tdt) diff --git a/Control/AthenaMonitoring/share/DQMonFlagsConfig_jobOptions.py b/Control/AthenaMonitoring/share/DQMonFlagsConfig_jobOptions.py index dfb1421e91687d48958a416b526e9f08206f5661..622d300eeb240f2ebf16be4a56acb00f4cbcdac1 100644 --- a/Control/AthenaMonitoring/share/DQMonFlagsConfig_jobOptions.py +++ b/Control/AthenaMonitoring/share/DQMonFlagsConfig_jobOptions.py @@ -66,7 +66,8 @@ else: local_logger.warning("invalid DQMonFlags.monType: %s, using default monManEnvironment", DQMonFlags.monType()) # the meaning of this flag has changed in MT -if rec.doTrigger() == False and not (TriggerFlags.doMT() and DQMonFlags.monManEnvironment=='tier0ESD'): +if (rec.doTrigger() == False and + not (TriggerFlags.doMT() and DQMonFlags.monManEnvironment=='tier0ESD' and DQMonFlags.useTrigger())): DQMonFlags.useTrigger=False # steers trigger-awareness DQMonFlags.doLVL1CaloMon=False DQMonFlags.doCTPMon=False diff --git a/Control/AthenaMonitoring/share/DataQualitySteering_jobOptions.py b/Control/AthenaMonitoring/share/DataQualitySteering_jobOptions.py index fababdb80e0ae6fe17a8818461bce12acbb8cc90..38542637d0cb0a6589cb0e78607e6e89106c79a9 100644 --- a/Control/AthenaMonitoring/share/DataQualitySteering_jobOptions.py +++ b/Control/AthenaMonitoring/share/DataQualitySteering_jobOptions.py @@ -341,6 +341,7 @@ if DQMonFlags.doMonitoring(): ConfigFlags.DQ.FileKey=DQMonFlags.monManFileKey() ConfigFlags.DQ.Environment=DQMonFlags.monManEnvironment() ConfigFlags.DQ.useTrigger=DQMonFlags.useTrigger() + ConfigFlags.DQ.triggerDataAvailable=DQMonFlags.useTrigger() ConfigFlags.IOVDb.GlobalTag=globalflags.ConditionsTag() ConfigFlags.DQ.isReallyOldStyle=False @@ -357,6 +358,7 @@ if DQMonFlags.doMonitoring(): Steering.doPixelMon=DQMonFlags.doPixelMon() Steering.doSCTMon=DQMonFlags.doSCTMon() Steering.doTRTMon=DQMonFlags.doTRTMon() + Steering.doInDetGlobalMon=DQMonFlags.doInDetGlobalMon() Steering.doLArMon=DQMonFlags.doLArMon() Steering.doTileMon=DQMonFlags.doTileMon() Steering.doCaloGlobalMon=DQMonFlags.doCaloMon() diff --git a/Control/AthenaMonitoring/share/Run3DQTestingDriver.py b/Control/AthenaMonitoring/share/Run3DQTestingDriver.py index fc30f1f78ab8d0694d5923bdac761ce78c64f63b..ecd470662be033a5dbd75ac8eaa8d92fde0afa96 100755 --- a/Control/AthenaMonitoring/share/Run3DQTestingDriver.py +++ b/Control/AthenaMonitoring/share/Run3DQTestingDriver.py @@ -27,6 +27,8 @@ if __name__=='__main__': help='Maximum number of events to process (alias for --evtMax)') parser.add_argument('--printDetailedConfig', action='store_true', help='Print detailed Athena configuration') + parser.add_argument('--threads', type=int, default=0, + help='Number of threads/concurrent events') args, _ = parser.parse_known_args() # Setup the Run III behavior @@ -38,6 +40,10 @@ if __name__=='__main__': from AthenaCommon.Constants import * log.setLevel(INFO) + # set threads + ConfigFlags.Concurrency.NumThreads=args.threads + ConfigFlags.Concurrency.NumConcurrentEvents=args.threads + # Set the Athena configuration flags from AthenaConfiguration.AutoConfigFlags import GetFileMD @@ -97,6 +103,10 @@ if __name__=='__main__': from AthenaPoolCnvSvc.PoolReadConfig import PoolReadCfg cfg = MainServicesCfg(ConfigFlags) + # add FPE auditor + from AthenaConfiguration.ComponentFactory import CompFactory + cfg.addService(CompFactory.AuditorSvc(Auditors=[CompFactory.FPEAuditor().getFullJobOptName()])) + if isReadingRaw: # attempt to start setting up reco ... from CaloRec.CaloRecoConfig import CaloRecoCfg @@ -111,7 +121,6 @@ if __name__=='__main__': # Force loading of conditions in MT mode if ConfigFlags.Concurrency.NumThreads > 0: - from AthenaConfiguration.ComponentFactory import CompFactory if len([_ for _ in cfg._conditionsAlgs if _.name=="PixelDetectorElementCondAlg"]) > 0: beginseq = cfg.getSequence("AthBeginSeq") beginseq.Members.append(CompFactory.ForceIDConditionsAlg("ForceIDConditionsAlg")) diff --git a/Control/AthenaServices/share/AthenaOutputStream_test.ref b/Control/AthenaServices/share/AthenaOutputStream_test.ref index 77fc1b609ceb35cb2b75de202581443fed081b27..e244ec7ae167102dda8b4bb8ddb751ba466400b5 100644 --- a/Control/AthenaServices/share/AthenaOutputStream_test.ref +++ b/Control/AthenaServices/share/AthenaOutputStream_test.ref @@ -1,8 +1,8 @@ *** AthenaOutputStream_test starts *** -Initializing Gaudi ApplicationMgr using job opts /atlas/scratch0/amete/athena-workspace/build/x86_64-centos7-gcc8-opt/jobOptions/AthenaServices/AthenaOutputStream_test.txt -JobOptionsSvc INFO # =======> /atlas/scratch0/amete/athena-workspace/build/x86_64-centos7-gcc8-opt/jobOptions/AthenaServices/AthenaOutputStream_test.txt +Initializing Gaudi ApplicationMgr using job opts /home/atlas/athena/build/x86_64-centos7-gcc8-opt/jobOptions/AthenaServices/AthenaOutputStream_test.txt +JobOptionsSvc INFO # =======> /home/atlas/athena/build/x86_64-centos7-gcc8-opt/jobOptions/AthenaServices/AthenaOutputStream_test.txt JobOptionsSvc INFO # (5,1): MessageSvc.OutputLevel = 2 JobOptionsSvc INFO # (6,1): StoreGateSvc.OutputLevel = 2 JobOptionsSvc INFO # (8,1): AthenaOutputStream.OutputLevel = 1 @@ -12,13 +12,13 @@ JobOptionsSvc INFO # (21,1): AthenaOutputStream.CompressionListHigh = ["B JobOptionsSvc INFO # (22,1): AthenaOutputStream.CompressionBitsLow = 16 JobOptionsSvc INFO # (23,1): AthenaOutputStream.CompressionListLow = ["BazAuxContainer#compAux.zzz"] JobOptionsSvc INFO # (25,1): AthenaOutputStream.AcceptAlgs = ["AthenaOutputStream", "aSFQS"] -JobOptionsSvc INFO Job options successfully read in from /atlas/scratch0/amete/athena-workspace/build/x86_64-centos7-gcc8-opt/jobOptions/AthenaServices/AthenaOutputStream_test.txt +JobOptionsSvc INFO Job options successfully read in from /home/atlas/athena/build/x86_64-centos7-gcc8-opt/jobOptions/AthenaServices/AthenaOutputStream_test.txt MessageSvc DEBUG Service base class initialized successfully ApplicationMgr DEBUG Getting my own properties ApplicationMgr SUCCESS ==================================================================================================================================== - Welcome to ApplicationMgr (GaudiCoreSvc v33r2) - running on atpc002 on Fri Aug 7 15:13:36 2020 + Welcome to ApplicationMgr (GaudiCoreSvc v34r0) + running on 93d7764165d7 on Fri Sep 11 10:18:05 2020 ==================================================================================================================================== ApplicationMgr INFO Application Manager Configured successfully ServiceManager DEBUG Initializing service AppMgrRunable @@ -39,20 +39,20 @@ ApplicationMgr INFO Application Manager Initialized successfully ApplicationMgr Ready ClassIDSvc DEBUG Service base class initialized successfully IncidentSvc DEBUG Adding [ModuleLoaded] listener 'ClassIDSvc' with priority 100 -ClassIDSvc INFO getRegistryEntries: read 1581 CLIDRegistry entries for module ALL +ClassIDSvc INFO getRegistryEntries: read 1596 CLIDRegistry entries for module ALL ClassIDSvc FATAL uncheckedSetTypePackageForID: StoreGate-00-00-00 can not set type name <B1> for CLID 8111: Known name for this ID <Baz> It was set by AthenaServices-00-00-00 ClassIDSvc FATAL uncheckedSetTypePackageForID: StoreGate-00-00-00 can not set type name <D1> for CLID 8112: Known name for this ID <BazAuxContainer> It was set by AthenaServices-00-00-00 -ClassIDSvc DEBUG processCLIDDB: read 1747 entries from CLIDDB file: /atlas/scratch0/amete/athena-workspace/build/x86_64-centos7-gcc8-opt/share/clid.db +ClassIDSvc DEBUG processCLIDDB: read 1757 entries from CLIDDB file: /home/atlas/athena/build/x86_64-centos7-gcc8-opt/share/clid.db ClassIDSvc FATAL uncheckedSetTypePackageForID: StoreGate-00-00-00 can not set type name <B1> for CLID 8111: Known name for this ID <Baz> It was set by AthenaServices-00-00-00 ClassIDSvc FATAL uncheckedSetTypePackageForID: StoreGate-00-00-00 can not set type name <D1> for CLID 8112: Known name for this ID <BazAuxContainer> It was set by AthenaServices-00-00-00 -ClassIDSvc DEBUG processCLIDDB: read 1746 entries from CLIDDB file: /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2020-08-06T2137/Athena/22.0.17/InstallArea/x86_64-centos7-gcc8-opt/share/clid.db +ClassIDSvc DEBUG processCLIDDB: read 1757 entries from CLIDDB file: /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2020-09-10T2101/Athena/22.0.18/InstallArea/x86_64-centos7-gcc8-opt/share/clid.db StoreGateSvc DEBUG Service base class initialized successfully StoreGateSvc DEBUG trying to create store SGImplSvc/StoreGateSvc_Impl StoreGateSvc_Impl DEBUG Service base class initialized successfully ProxyProviderSvc DEBUG Service base class initialized successfully IncidentSvc DEBUG Adding [EndEvent] listener 'StoreGateSvc' with priority 100 IncidentSvc DEBUG Adding [BeginEvent] listener 'StoreGateSvc' with priority 100 -ClassIDSvc INFO getRegistryEntries: read 2389 CLIDRegistry entries for module ALL +ClassIDSvc INFO getRegistryEntries: read 2375 CLIDRegistry entries for module ALL AthenaOutputStream DEBUG Property update for OutputLevel : new value = 1 ToolSvc DEBUG Service base class initialized successfully AthenaOutputStr... DEBUG Property update for OutputLevel : new value = 1 @@ -92,21 +92,14 @@ 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 DEBUG Service base class initialized successfully -DBReplicaSvc DEBUG HOSTNAME atpc002 has no domain - try hostname --fqdn -DBReplicaSvc DEBUG HOSTNAME from fqdn: atpc002.dyndns.cern.ch -DBReplicaSvc INFO Frontier server at (serverurl=http://atlasfrontier-local.cern.ch:8000/atlr)(serverurl=http://atlasfrontier-ai.cern.ch:8000/atlr)(serverurl=http://ccfrontier.in2p3.fr:23128/ccin2p3-AtlasFrontier)(proxyurl=http://ca-proxy-atlas.cern.ch:3128)(proxyurl=http://ca-proxy-meyrin.cern.ch:3128)(proxyurl=http://ca-proxy.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_Athena_x86_64-centos7-gcc8-opt/2020-08-06T2137/Athena/22.0.17/InstallArea/x86_64-centos7-gcc8-opt/share/dbreplica.config -DBReplicaSvc DEBUG Candidate server ATLF (priority -2700) -DBReplicaSvc DEBUG Candidate server ATLAS_COOLPROD (priority -695) -DBReplicaSvc DEBUG Candidate server atlas_dd (priority -690) -DBReplicaSvc DEBUG Candidate server ATLAS_CONFIG (priority -685) -DBReplicaSvc DEBUG Candidate server INT8R (priority -680) -DBReplicaSvc DEBUG Candidate server INTR (priority -675) -DBReplicaSvc DEBUG Candidate server ATONR_COOL (priority -670) -DBReplicaSvc DEBUG Candidate server ATONR_CONF (priority -665) -DBReplicaSvc DEBUG Candidate server DEVDB11 (priority -660) -DBReplicaSvc DEBUG Candidate server ATLF (priority -2200) -DBReplicaSvc INFO Total of 10 servers found for host atpc002.dyndns.cern.ch [ATLF ATLAS_COOLPROD atlas_dd ATLAS_CONFIG INT8R INTR ATONR_COOL ATONR_CONF DEVDB11 ATLF ] +DBReplicaSvc DEBUG HOSTNAME 93d7764165d7 has no domain - try hostname --fqdn +DBReplicaSvc DEBUG HOSTNAME from fqdn: 93d7764165d7 +DBReplicaSvc INFO Frontier server at (serverurl=http://atlasfrontier-ai.cern.ch:8000/atlr)(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 /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2020-09-10T2101/Athena/22.0.18/InstallArea/x86_64-centos7-gcc8-opt/share/dbreplica.config +DBReplicaSvc INFO No specific match for domain found - use default fallback +DBReplicaSvc DEBUG Candidate server ATLF (priority -2000) +DBReplicaSvc DEBUG Candidate server atlas_dd (priority 5) +DBReplicaSvc INFO Total of 2 servers found for host 93d7764165d7 [ATLF atlas_dd ] PoolSvc INFO Successfully setup replica sorting algorithm PoolSvc DEBUG OutputLevel is 2 PoolSvc INFO Setting up APR FileCatalog and Streams @@ -139,43 +132,43 @@ AthenaOutputStream DEBUG Data Deps for AthenaOutputStream + INPUT IGNORED ( 'AthenaAttributeList' , '' ) + OUTPUT ( 'SG::CompressionInfo' , 'StoreGateSvc+CompressionInfo_AthenaOutputStream' ) + OUTPUT ( 'SG::SelectionVetoes' , 'StoreGateSvc+SelectionVetoes_AthenaOutputStream' ) -StoreGateSvc DEBUG Recorded object @0x667f4c0 with key uno of type Foo(CLID 8101) - in DataObject @0x667f6b0 +StoreGateSvc DEBUG Recorded object @0x5647790 with key uno of type Foo(CLID 8101) + in DataObject @0x5647980 object modifiable when retrieved -StoreGateSvc DEBUG Recorded object @0x667fc50 with key due of type Foo(CLID 8101) - in DataObject @0x667fe00 +StoreGateSvc DEBUG Recorded object @0x5647f50 with key due of type Foo(CLID 8101) + in DataObject @0x5648190 object modifiable when retrieved -StoreGateSvc DEBUG Recorded object @0x667fbd0 with key uno of type Bar(CLID 8107) - in DataObject @0x66800d0 +StoreGateSvc DEBUG Recorded object @0x5647f30 with key uno of type Bar(CLID 8107) + in DataObject @0x5648460 object modifiable when retrieved -StoreGateSvc DEBUG Recorded object @0x667fbb0 with key due of type Bar(CLID 8107) - in DataObject @0x6680400 +StoreGateSvc DEBUG Recorded object @0x5647f10 with key due of type Bar(CLID 8107) + in DataObject @0x5648760 object modifiable when retrieved -StoreGateSvc DEBUG Recorded object @0x6680790 with key quattro of type Bar(CLID 8107) - in DataObject @0x6680700 +StoreGateSvc DEBUG Recorded object @0x5648ac0 with key quattro of type Bar(CLID 8107) + in DataObject @0x5648a30 object modifiable when retrieved -StoreGateSvc DEBUG Recorded object @0x6680b80 with key cinque of type Bar(CLID 8107) - in DataObject @0x6680ad0 +StoreGateSvc DEBUG Recorded object @0x5648eb0 with key cinque of type Bar(CLID 8107) + in DataObject @0x5648e00 object modifiable when retrieved -StoreGateSvc DEBUG Recorded object @0x6681120 with key sei of type Baz(CLID 8111) - in DataObject @0x6687a40 +StoreGateSvc DEBUG Recorded object @0x56493f0 with key sei of type Baz(CLID 8111) + in DataObject @0x5647ce0 object modifiable when retrieved -StoreGateSvc DEBUG Recorded object @0x6681150 with key seiAux. of type BazAuxContainer(CLID 8112) - in DataObject @0x667f960 +StoreGateSvc DEBUG Recorded object @0x5649420 with key seiAux. of type BazAuxContainer(CLID 8112) + in DataObject @0x564ff30 object modifiable when retrieved -StoreGateSvc DEBUG Recorded object @0x66881a0 with key comp of type Baz(CLID 8111) - in DataObject @0x2767290 +StoreGateSvc DEBUG Recorded object @0x5650810 with key comp of type Baz(CLID 8111) + in DataObject @0x5657240 object modifiable when retrieved -StoreGateSvc DEBUG Recorded object @0x6688710 with key compAux. of type BazAuxContainer(CLID 8112) - in DataObject @0x6689530 +StoreGateSvc DEBUG Recorded object @0x5650840 with key compAux. of type BazAuxContainer(CLID 8112) + in DataObject @0x56576d0 object modifiable when retrieved -ClassIDSvc INFO getRegistryEntries: read 714 CLIDRegistry entries for module ALL +ClassIDSvc INFO getRegistryEntries: read 727 CLIDRegistry entries for module ALL AthenaOutputStr...WARNING add: can not find clid 13 in clid db AthenaOutputStream DEBUG addItemObjects(13,"*") called AthenaOutputStream DEBUG Key:* AthenaOutputStr... DEBUG Property update for OutputLevel : new value = 1 -AthenaOutputStream DEBUG Comp Attr High: 0 with 10 mantissa bits. -AthenaOutputStream DEBUG Comp Attr Low: 0 with 16 mantissa bits. +AthenaOutputStream DEBUG Comp Attr 0 with 10 mantissa bits. +AthenaOutputStream DEBUG Comp Attr 0 with 16 mantissa bits. MetaDataSvc INFO Initializing MetaDataSvc - package version AthenaServices-00-00-00 MetaDataSvc DEBUG Service base class initialized successfully InputMetaDataStore DEBUG Service base class initialized successfully @@ -197,19 +190,22 @@ IncidentSvc DEBUG Adding [BeginInputFile] listener 'MetaDataSvc' with pr IncidentSvc DEBUG Adding [EndInputFile] listener 'MetaDataSvc' with priority 10 IoComponentMgr DEBUG --> io_register(MetaDataSvc) IoComponentMgr DEBUG registering IoComponent "MetaDataSvc" +MetaDataSvc DEBUG Not translating metadata item ID #13 AthenaOutputStream DEBUG Failed to receive proxy iterators from StoreGate for 13,"*". Skipping AthenaOutputStream DEBUG addItemObjects(8101,"*") called AthenaOutputStream DEBUG Key:* -AthenaOutputStream DEBUG Comp Attr High: 0 with 10 mantissa bits. -AthenaOutputStream DEBUG Comp Attr Low: 0 with 16 mantissa bits. +AthenaOutputStream DEBUG Comp Attr 0 with 10 mantissa bits. +AthenaOutputStream DEBUG Comp Attr 0 with 16 mantissa bits. +MetaDataSvc DEBUG Not translating metadata item ID #8101 AthenaOutputStreamVERBOSE Calling tokenizeAtStep( [], *, *) AthenaOutputStreamVERBOSE Done calling tokenizeAtStep( [, ], *, *) AthenaOutputStream DEBUG Added object 8101,"due" AthenaOutputStream DEBUG Added object 8101,"uno" AthenaOutputStream DEBUG addItemObjects(8107,"due") called AthenaOutputStream DEBUG Key:due -AthenaOutputStream DEBUG Comp Attr High: 0 with 10 mantissa bits. -AthenaOutputStream DEBUG Comp Attr Low: 0 with 16 mantissa bits. +AthenaOutputStream DEBUG Comp Attr 0 with 10 mantissa bits. +AthenaOutputStream DEBUG Comp Attr 0 with 16 mantissa bits. +MetaDataSvc DEBUG Not translating metadata item ID #8107 AthenaOutputStreamVERBOSE Calling tokenizeAtStep( [], due, *) AthenaOutputStreamVERBOSE Done calling tokenizeAtStep( [due], due, *) AthenaOutputStreamVERBOSE Calling matchKey( [due], cinque) @@ -224,8 +220,9 @@ AthenaOutputStreamVERBOSE Couldn't match every sub-string... return: 0 AthenaOutputStreamVERBOSE Done calling matchKey( [due], uno) with result: 0 AthenaOutputStream DEBUG addItemObjects(8107,"tre") called AthenaOutputStream DEBUG Key:tre -AthenaOutputStream DEBUG Comp Attr High: 0 with 10 mantissa bits. -AthenaOutputStream DEBUG Comp Attr Low: 0 with 16 mantissa bits. +AthenaOutputStream DEBUG Comp Attr 0 with 10 mantissa bits. +AthenaOutputStream DEBUG Comp Attr 0 with 16 mantissa bits. +MetaDataSvc DEBUG Not translating metadata item ID #8107 AthenaOutputStreamVERBOSE Calling tokenizeAtStep( [], tre, *) AthenaOutputStreamVERBOSE Done calling tokenizeAtStep( [tre], tre, *) AthenaOutputStreamVERBOSE Calling matchKey( [tre], cinque) @@ -243,8 +240,9 @@ AthenaOutputStreamVERBOSE Done calling matchKey( [tre], uno) with result: 0 AthenaOutputStream DEBUG No object matching 8107,"tre" found AthenaOutputStream DEBUG addItemObjects(8107,"uno") called AthenaOutputStream DEBUG Key:uno -AthenaOutputStream DEBUG Comp Attr High: 0 with 10 mantissa bits. -AthenaOutputStream DEBUG Comp Attr Low: 0 with 16 mantissa bits. +AthenaOutputStream DEBUG Comp Attr 0 with 10 mantissa bits. +AthenaOutputStream DEBUG Comp Attr 0 with 16 mantissa bits. +MetaDataSvc DEBUG Not translating metadata item ID #8107 AthenaOutputStreamVERBOSE Calling tokenizeAtStep( [], uno, *) AthenaOutputStreamVERBOSE Done calling tokenizeAtStep( [uno], uno, *) AthenaOutputStreamVERBOSE Calling matchKey( [uno], cinque) @@ -259,8 +257,9 @@ AthenaOutputStreamVERBOSE Done calling matchKey( [uno], quattro) with result: 0 AthenaOutputStream DEBUG Added object 8107,"uno" AthenaOutputStream DEBUG addItemObjects(8108,"cinque") called AthenaOutputStream DEBUG Key:cinque -AthenaOutputStream DEBUG Comp Attr High: 0 with 10 mantissa bits. -AthenaOutputStream DEBUG Comp Attr Low: 0 with 16 mantissa bits. +AthenaOutputStream DEBUG Comp Attr 0 with 10 mantissa bits. +AthenaOutputStream DEBUG Comp Attr 0 with 16 mantissa bits. +MetaDataSvc DEBUG Not translating metadata item ID #8108 AthenaOutputStreamVERBOSE Calling tokenizeAtStep( [], cinque, *) AthenaOutputStreamVERBOSE Done calling tokenizeAtStep( [cinque], cinque, *) AthenaOutputStream DEBUG Added object 8108,"cinque" @@ -269,8 +268,9 @@ AthenaOutputStreamVERBOSE Couldn't match every sub-string... return: 0 AthenaOutputStreamVERBOSE Done calling matchKey( [cinque], quattro) with result: 0 AthenaOutputStream DEBUG addItemObjects(8108,"quattro") called AthenaOutputStream DEBUG Key:quattro -AthenaOutputStream DEBUG Comp Attr High: 0 with 10 mantissa bits. -AthenaOutputStream DEBUG Comp Attr Low: 0 with 16 mantissa bits. +AthenaOutputStream DEBUG Comp Attr 0 with 10 mantissa bits. +AthenaOutputStream DEBUG Comp Attr 0 with 16 mantissa bits. +MetaDataSvc DEBUG Not translating metadata item ID #8108 AthenaOutputStreamVERBOSE Calling tokenizeAtStep( [], quattro, *) AthenaOutputStreamVERBOSE Done calling tokenizeAtStep( [quattro], quattro, *) AthenaOutputStreamVERBOSE Calling matchKey( [quattro], cinque) @@ -279,8 +279,9 @@ AthenaOutputStreamVERBOSE Done calling matchKey( [quattro], cinque) with result: AthenaOutputStream DEBUG Added object 8108,"quattro" AthenaOutputStream DEBUG addItemObjects(8111,"comp") called AthenaOutputStream DEBUG Key:comp -AthenaOutputStream DEBUG Comp Attr High: 0 with 10 mantissa bits. -AthenaOutputStream DEBUG Comp Attr Low: 0 with 16 mantissa bits. +AthenaOutputStream DEBUG Comp Attr 0 with 10 mantissa bits. +AthenaOutputStream DEBUG Comp Attr 0 with 16 mantissa bits. +MetaDataSvc DEBUG Not translating metadata item ID #8111 AthenaOutputStreamVERBOSE Calling tokenizeAtStep( [], comp, *) AthenaOutputStreamVERBOSE Done calling tokenizeAtStep( [comp], comp, *) AthenaOutputStream DEBUG Added object 8111,"comp" @@ -289,8 +290,9 @@ AthenaOutputStreamVERBOSE Couldn't match every sub-string... return: 0 AthenaOutputStreamVERBOSE Done calling matchKey( [comp], sei) with result: 0 AthenaOutputStream DEBUG addItemObjects(8111,"sei") called AthenaOutputStream DEBUG Key:sei -AthenaOutputStream DEBUG Comp Attr High: 0 with 10 mantissa bits. -AthenaOutputStream DEBUG Comp Attr Low: 0 with 16 mantissa bits. +AthenaOutputStream DEBUG Comp Attr 0 with 10 mantissa bits. +AthenaOutputStream DEBUG Comp Attr 0 with 16 mantissa bits. +MetaDataSvc DEBUG Not translating metadata item ID #8111 AthenaOutputStreamVERBOSE Calling tokenizeAtStep( [], sei, *) AthenaOutputStreamVERBOSE Done calling tokenizeAtStep( [sei], sei, *) AthenaOutputStreamVERBOSE Calling matchKey( [sei], comp) @@ -300,32 +302,32 @@ AthenaOutputStream DEBUG Added object 8111,"sei" AthenaOutputStream DEBUG addItemObjects(8112,"compAux.") called AthenaOutputStream DEBUG Key:compAux. AthenaOutputStream DEBUG Aux Attr:foo.bar.zzz -AthenaOutputStream DEBUG Comp Attr High: 2 with 10 mantissa bits. +AthenaOutputStream DEBUG Comp Attr 2 with 10 mantissa bits. AthenaOutputStream DEBUG >> bar AthenaOutputStream DEBUG >> foo -AthenaOutputStream DEBUG Comp Attr Low: 1 with 16 mantissa bits. +AthenaOutputStream DEBUG Comp Attr 1 with 16 mantissa bits. AthenaOutputStream DEBUG >> zzz +MetaDataSvc DEBUG Not translating metadata item ID #8112 AthenaOutputStreamVERBOSE Calling tokenizeAtStep( [], compAux., *) AthenaOutputStreamVERBOSE Done calling tokenizeAtStep( [compAux.], compAux., *) AthenaOutputStream DEBUG Added object 8112,"compAux." -AthenaOutputStream DEBUG Lossy float compression level 10 contains 1 elements for container comp -AthenaOutputStream DEBUG Lossy float compression level 16 contains 1 elements for container comp +AthenaOutputStream DEBUG Container comp has 1 variables that'll be lossy float compressed with 10 mantissa bits +AthenaOutputStream DEBUG Container comp has 1 variables that'll be lossy float compressed with 16 mantissa bits AthenaOutputStreamVERBOSE Calling matchKey( [compAux.], seiAux.) AthenaOutputStreamVERBOSE Couldn't match every sub-string... return: 0 AthenaOutputStreamVERBOSE Done calling matchKey( [compAux.], seiAux.) with result: 0 AthenaOutputStream DEBUG addItemObjects(8112,"seiAux.") called AthenaOutputStream DEBUG Key:seiAux. AthenaOutputStream DEBUG Aux Attr:aaa.ccc -AthenaOutputStream DEBUG Comp Attr High: 0 with 10 mantissa bits. -AthenaOutputStream DEBUG Comp Attr Low: 0 with 16 mantissa bits. +AthenaOutputStream DEBUG Comp Attr 0 with 10 mantissa bits. +AthenaOutputStream DEBUG Comp Attr 0 with 16 mantissa bits. +MetaDataSvc DEBUG Not translating metadata item ID #8112 AthenaOutputStreamVERBOSE Calling tokenizeAtStep( [], seiAux., *) AthenaOutputStreamVERBOSE Done calling tokenizeAtStep( [seiAux.], seiAux., *) AthenaOutputStreamVERBOSE Calling matchKey( [seiAux.], compAux.) AthenaOutputStreamVERBOSE Couldn't match every sub-string... return: 0 AthenaOutputStreamVERBOSE Done calling matchKey( [seiAux.], compAux.) with result: 0 AthenaOutputStream DEBUG Added object 8112,"seiAux." -AthenaOutputStream DEBUG Lossy float compression level 10 contains 0 elements for container sei -AthenaOutputStream DEBUG Lossy float compression level 16 contains 0 elements for container sei 8112 compAux. 8112 seiAux. 8101 due diff --git a/Control/AthenaServices/src/MetaDataSvc.cxx b/Control/AthenaServices/src/MetaDataSvc.cxx index 2a81f9dd6bb051ea394654d5b4e179548cfe765b..965fdaf4670f882e656c5b4213b9f8eb61aba4a7 100644 --- a/Control/AthenaServices/src/MetaDataSvc.cxx +++ b/Control/AthenaServices/src/MetaDataSvc.cxx @@ -17,6 +17,7 @@ #include "GaudiKernel/IIoComponentMgr.h" #include "GaudiKernel/IOpaqueAddress.h" #include "GaudiKernel/FileIncident.h" +#include "GaudiKernel/System.h" #include "AthenaBaseComps/AthCnvSvc.h" #include "StoreGate/StoreGateSvc.h" @@ -613,13 +614,67 @@ const std::string MetaDataSvc::currentRangeID() const } -CLID MetaDataSvc::remapMetaContCLID( const CLID& item_id ) const +CLID MetaDataSvc::remapMetaContCLID( const CLID& itemID ) const { - // for now just a simple dumb if - if( item_id == 167728019 ) { - return 167729019; // MetaCont<EventStreamInfo> CLID + auto it = m_handledClasses.find(itemID); + if (it == m_handledClasses.end()) { + ATH_MSG_DEBUG("Not translating metadata item ID #" << itemID); + return itemID; } - return item_id; + + std::string itemName; + CLID contID = 0; + if (m_classIDSvc->getTypeNameOfID(itemID, itemName).isSuccess()) { + const std::string contName = "MetaCont<" + itemName + ">"; + ATH_MSG_DEBUG("Transforming " << contName << " to " << itemName + << " for output"); + if (m_classIDSvc->getIDOfTypeName(contName, contID).isSuccess()) + return contID; + } + + return itemID; +} + +void MetaDataSvc::recordHook(const std::type_info& typeInfo) { + const std::string& typeName = System::typeinfoName(typeInfo); + ATH_MSG_VERBOSE("Handling recod event of type " << typeName); + + CLID itemID = 0; + if (m_classIDSvc->getIDOfTypeInfoName(typeName, itemID).isSuccess()) { + + ATH_MSG_DEBUG("MetaDataSvc will handle ClassID " << itemID); + auto it = m_handledClasses.find(itemID); + + if (it == m_handledClasses.end()) + m_handledClasses[itemID] = 1; + else + (it->second)++; + + } + +} + +void MetaDataSvc::removeHook(const std::type_info& typeInfo) { + const std::string& typeName = System::typeinfoName(typeInfo); + ATH_MSG_VERBOSE("Handling removal of event of type " << typeName); + + CLID itemID = 0; + // use Gaudi::System to get type name + if (m_classIDSvc->getIDOfTypeInfoName(typeName, itemID).isSuccess()) { + + ATH_MSG_DEBUG("MetaDataSvc will handle ClassID " << itemID); + auto it = m_handledClasses.find(itemID); + + if (it == m_handledClasses.end()) + return; + + (it->second)--; + + if (it->second == 0) + m_handledClasses.erase(it); + + } + } diff --git a/Control/AthenaServices/src/MetaDataSvc.h b/Control/AthenaServices/src/MetaDataSvc.h index 4a6c181c12f66605f4870c7e749890979f5231ce..7904cb0b37f5bc0edfdd1652fc26b9fa989a793c 100644 --- a/Control/AthenaServices/src/MetaDataSvc.h +++ b/Control/AthenaServices/src/MetaDataSvc.h @@ -16,12 +16,14 @@ #include "GaudiKernel/IIncidentListener.h" #include "GaudiKernel/IIoComponent.h" #include "GaudiKernel/IFileMgr.h" // for FILEMGR_CALLBACK_ARGS +#include "GaudiKernel/IClassIDSvc.h" #include "AthenaKernel/IAddressProvider.h" #include "AthenaBaseComps/AthService.h" #include "AthenaKernel/IMetaDataTool.h" #include "AthenaKernel/IMetaDataSvc.h" #include <map> +#include <typeinfo> // Forward declarations class IAddressCreator; @@ -125,6 +127,9 @@ public: // Non-static members void lockTools() const; void unlockTools() const; + + void recordHook(const std::type_info&) override; + void removeHook(const std::type_info&) override; private: /// Add proxy to input metadata store - can be called directly or via BeginInputFile incident @@ -139,6 +144,7 @@ private: // data ServiceHandle<IFileMgr> m_fileMgr; ServiceHandle<IIncidentSvc> m_incSvc; ServiceHandle<OutputStreamSequencerSvc> m_outSeqSvc; + ServiceHandle< IClassIDSvc > m_classIDSvc{"ClassIDSvc", name()}; long m_storageType; bool m_clearedInputDataStore; @@ -149,6 +155,8 @@ private: // data std::map<CLID, std::string> m_toolForClid; std::map<std::string, std::string> m_streamForKey; + std::map<CLID, unsigned int> m_handledClasses; + private: // properties /// MetaDataContainer, POOL container name for MetaData. StringProperty m_metaDataCont; diff --git a/Control/DataModelTest/DataModelRunTests/share/xAODTestRead.ref b/Control/DataModelTest/DataModelRunTests/share/xAODTestRead.ref index 2be80a31b53315dda307c1df69af43b1b09c95d9..c15c711e5fe79d5dd5c361982dc715f20b93c8ee 100644 --- a/Control/DataModelTest/DataModelRunTests/share/xAODTestRead.ref +++ b/Control/DataModelTest/DataModelRunTests/share/xAODTestRead.ref @@ -1,39 +1,41 @@ -Wed May 22 16:18:31 CEST 2019 +Wed Sep 9 14:46:24 CEST 2020 Preloading tcmalloc_minimal.so Py:Athena INFO including file "AthenaCommon/Preparation.py" -Py:Athena INFO using release [WorkDir-22.0.2] [x86_64-centos7-gcc8-dbg] [atlas-work3/a2d84b85b4c] -- built on [2019-05-22T0547] +Py:Athena INFO using release [WorkDir-22.0.18] [x86_64-centos7-gcc8-opt] [EventFormatMetaData/ed94d57] -- built on [2020-09-08T1647] 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 "DataModelRunTests/xAODTestRead_jo.py" -Py:ConfigurableDb INFO Read module info for 5470 configurables from 64 genConfDb files +Py:ConfigurableDb INFO Read module info for 5573 configurables from 15 genConfDb files Py:ConfigurableDb INFO No duplicates have been found: that's good ! Py:Athena INFO including file "DataModelRunTests/loadReadDicts.py" Py:Athena INFO including file "EventAthenaPool/EventAthenaPoolItemList_joboptions.py" +Py:Athena INFO including file "DataModelRunTests/commonTrailer.py" Py:Athena INFO including file "DataModelRunTests/setCatalog.py" Py:Athena INFO including file "AthenaCommon/runbatch.py" -ApplicationMgr 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 v31r0) - running on lxplus729.cern.ch on Wed May 22 16:18:53 2019 + Welcome to ApplicationMgr (GaudiCoreSvc v34r0) + running on ed38202b3ca6 on Wed Sep 9 14:46:30 2020 ==================================================================================================================================== ApplicationMgr INFO Application Manager Configured successfully -ApplicationMgr INFO Updating Gaudi::PluginService::SetDebug(level) to level= 'PluginDebugLevel':0 -StatusCodeSvc INFO initialize AthDictLoaderSvc INFO in initialize... AthDictLoaderSvc INFO acquired Dso-registry -ClassIDSvc INFO getRegistryEntries: read 7341 CLIDRegistry entries for module ALL +ClassIDSvc INFO getRegistryEntries: read 3362 CLIDRegistry entries for module ALL CoreDumpSvc INFO Handling signals: 11(Segmentation fault) 7(Bus error) 4(Illegal instruction) 8(Floating point exception) -xAODMaker::Even... INFO Initialising - Package version: xAODEventFormatCnv-00-00-00 +AthenaEventLoopMgr INFO Initializing AthenaEventLoopMgr - package version AthenaServices-00-00-00 +ClassIDSvc INFO getRegistryEntries: read 2023 CLIDRegistry entries for module ALL +ClassIDSvc INFO getRegistryEntries: read 6539 CLIDRegistry entries for module ALL +PyComponentMgr INFO Initializing PyComponentMgr... +LoadReadDicts INFO Initializing LoadReadDicts... MetaDataSvc INFO Initializing MetaDataSvc - package version AthenaServices-00-00-00 AthenaPoolCnvSvc INFO Initializing AthenaPoolCnvSvc - package version AthenaPoolCnvSvc-00-00-00 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/2019-05-20T2152/Athena/22.0.2/InstallArea/x86_64-centos7-gcc8-dbg/share/dbreplica.config -DBReplicaSvc INFO Total of 10 servers found for host lxplus729.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-ai.cern.ch:8000/atlr)(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 /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2020-09-08T2101/Athena/22.0.18/InstallArea/x86_64-centos7-gcc8-opt/share/dbreplica.config +DBReplicaSvc INFO No specific match for domain found - use default fallback +DBReplicaSvc INFO Total of 2 servers found for host ed38202b3ca6 [ATLF atlas_dd ] PoolSvc INFO Successfully setup replica sorting algorithm PoolSvc INFO Setting up APR FileCatalog and Streams PoolSvc INFO POOL WriteCatalog is file:xAODTestRead_catalog.xml @@ -42,26 +44,10 @@ Domain[ROOT_All] INFO > Access DbDomain READ [ROOT_All] MetaDataSvc INFO Found MetaDataTools = PublicToolHandleArray(['IOVDbMetaDataTool']) EventSelector INFO EventSelection with query PoolSvc INFO File is not in Catalog! Attempt to open it anyway. -Warning in <TClass::Init>: no dictionary for class DMTest::C_v1 is available -Warning in <TClass::Init>: no dictionary for class DMTest::CAuxContainer_v1 is available -Warning in <TClass::Init>: no dictionary for class DMTest::CInfoAuxContainer_v1 is available -Warning in <TClass::Init>: no dictionary for class DMTest::CTrigAuxContainer_v1 is available -Warning in <TClass::Init>: no dictionary for class DMTest::G_v1 is available -Warning in <TClass::Init>: no dictionary for class DMTest::GAuxContainer_v1 is available -Warning in <TClass::Init>: no dictionary for class DMTest::CVecWithData_v1 is available -Warning in <TClass::Init>: no dictionary for class ViewVector<DataVector<DMTest::C_v1> > is available -Warning in <TClass::Init>: no dictionary for class DMTest::H_v1 is available -Warning in <TClass::Init>: no dictionary for class DMTest::HAuxContainer_v1 is available -Warning in <TClass::Init>: no dictionary for class ViewVector<DataVector<DMTest::H_v1> > is available -Warning in <TClass::Init>: no dictionary for class DMTest::S2 is available -Warning in <TClass::Init>: no dictionary for class DMTest::S1 is available -Warning in <TClass::Init>: no dictionary for class ElementLink<DataVector<DMTest::C_v1> > is available -Warning in <TClass::Init>: no dictionary for class DataVector<DMTest::C_v1> is available -Warning in <TClass::Init>: no dictionary for class DataVector<DMTest::H_v1> is available DbSession INFO Open DbSession Domain[ROOT_All] INFO -> Access DbDatabase READ [ROOT_All] 1AA9ED5E-1E4B-3A55-A718-BF5CAC995112 Domain[ROOT_All] INFO xaoddata.root -RootDatabase.open INFO xaoddata.root File version:61600 +RootDatabase.open INFO xaoddata.root File version:62006 xaoddata.root INFO Database being retired... Domain[ROOT_All] INFO -> Deaccess DbDatabase READ [ROOT_All] 1AA9ED5E-1E4B-3A55-A718-BF5CAC995112 Domain[ROOT_All] INFO > Deaccess DbDomain READ [ROOT_All] @@ -70,51 +56,44 @@ DbSession INFO Open DbSession Domain[ROOT_All] INFO > Access DbDomain READ [ROOT_All] Domain[ROOT_All] INFO -> Access DbDatabase READ [ROOT_All] 1AA9ED5E-1E4B-3A55-A718-BF5CAC995112 Domain[ROOT_All] INFO xaoddata.root -RootDatabase.open INFO xaoddata.root File version:61600 +RootDatabase.open INFO xaoddata.root File version:62006 xaoddata.root INFO Database being retired... Domain[ROOT_All] INFO -> Deaccess DbDatabase READ [ROOT_All] 1AA9ED5E-1E4B-3A55-A718-BF5CAC995112 Domain[ROOT_All] INFO > Deaccess DbDomain READ [ROOT_All] DbSession INFO Open DbSession Domain[ROOT_All] INFO > Access DbDomain READ [ROOT_All] -Domain[ROOT_All] INFO -> Access DbDatabase READ [ROOT_All] 08312C01-E986-CD48-BFB5-512B5E9FED1A +Domain[ROOT_All] INFO -> Access DbDatabase READ [ROOT_All] A234C939-27F1-9149-B62A-7F0E38DD8890 Domain[ROOT_All] INFO xaoddata.root -RootDatabase.open INFO xaoddata.root File version:61600 -ClassIDSvc INFO getRegistryEntries: read 1876 CLIDRegistry entries for module ALL +RootDatabase.open INFO xaoddata.root File version:62006 +ClassIDSvc INFO getRegistryEntries: read 4440 CLIDRegistry entries for module ALL EventPersistenc... INFO Added successfully Conversion service:AthenaPoolCnvSvc -AthenaEventLoopMgr INFO Initializing AthenaEventLoopMgr - package version AthenaServices-00-00-00 -ClassIDSvc INFO getRegistryEntries: read 1458 CLIDRegistry entries for module ALL -ClassIDSvc INFO getRegistryEntries: read 4601 CLIDRegistry entries for module ALL -PyComponentMgr INFO Initializing PyComponentMgr... -LoadReadDicts INFO Initializing LoadReadDicts... -ClassIDSvc INFO getRegistryEntries: read 536 CLIDRegistry entries for module ALL -DecisionSvc INFO Inserting stream: Stream1 with no Algs +ClassIDSvc INFO getRegistryEntries: read 2 CLIDRegistry entries for module ALL OutputStreamSeq... INFO Initializing OutputStreamSequencerSvc - package version AthenaServices-00-00-00 +DecisionSvc INFO Inserting stream: Stream1 with no Algs Stream1.Stream1... INFO Initializing Stream1.Stream1Tool - package version AthenaServices-00-00-00 Stream1.Stream1... INFO Initializing Stream1.Stream1_MakeEventStreamInfo - package version OutputStreamAthenaPool-00-00-00 -Stream1 INFO Found HelperTools = PrivateToolHandleArray(['MakeEventStreamInfo/Stream1_MakeEventStreamInfo']) +Stream1 INFO Found HelperTools = PrivateToolHandleArray(['MakeEventStreamInfo/Stream1_MakeEventStreamInfo','xAODMaker::EventFormatStreamHelperTool/Stream1_MakeEventFormat','Athena::ThinningCacheTool/ThinningCacheTool_Stream1']) Stream1 INFO Data output: xaoddata2.root Stream1 INFO I/O reinitialization... -HistogramPersis...WARNING Histograms saving not required. AthenaEventLoopMgr INFO Setup EventSelector service EventSelector ApplicationMgr INFO Application Manager Initialized successfully xaoddata.root INFO Database being retired... -Domain[ROOT_All] INFO -> Deaccess DbDatabase READ [ROOT_All] 08312C01-E986-CD48-BFB5-512B5E9FED1A +Domain[ROOT_All] INFO -> Deaccess DbDatabase READ [ROOT_All] A234C939-27F1-9149-B62A-7F0E38DD8890 Domain[ROOT_All] INFO > Deaccess DbDomain READ [ROOT_All] DbSession INFO Open DbSession Domain[ROOT_All] INFO > Access DbDomain READ [ROOT_All] -Domain[ROOT_All] INFO -> Access DbDatabase READ [ROOT_All] 08312C01-E986-CD48-BFB5-512B5E9FED1A +Domain[ROOT_All] INFO -> Access DbDatabase READ [ROOT_All] A234C939-27F1-9149-B62A-7F0E38DD8890 Domain[ROOT_All] INFO xaoddata.root -RootDatabase.open INFO xaoddata.root File version:61600 +RootDatabase.open INFO xaoddata.root File version:62006 ApplicationMgr INFO Application Manager Started successfully -ClassIDSvc INFO getRegistryEntries: read 345 CLIDRegistry entries for module ALL +ClassIDSvc INFO getRegistryEntries: read 521 CLIDRegistry entries for module ALL AlgResourcePool INFO TopAlg list empty. Recovering the one of Application Manager AthenaPoolConve... INFO massageEventInfo: unable to get OverrideRunNumberFromInput property from EventSelector AthenaEventLoopMgr INFO ===>>> start of run 0 <<<=== AthenaEventLoopMgr INFO ===>>> start processing event #0, run #0 0 events processed so far <<<=== -ClassIDSvc INFO getRegistryEntries: read 65 CLIDRegistry entries for module ALL xAODTestReadCVec INFO cvec aux items: aFloat anInt anInt2 cEL dInt1 dVar1 dpInt1 dpvFloat pFloat pInt pvFloat pvInt xAODTestReadCVec INFO Type of aux store: DMTest::CAuxContainer_v1 -RootAuxDynReader INFO FILE:LINE (const RootAuxDynReader::BranchInfo& RootAuxDynReader::getBranchInfo(const unsigned long&, const SG::AuxStoreInternal&)): attribute dVar1 (id=225 typename=f) has different type than the branch vector<int> +RootAuxDynReader INFO FILE:LINE (const RootAuxDynReader::BranchInfo& RootAuxDynReader::getBranchInfo(const unsigned long&, const SG::AuxStoreInternal&)): attribute dVar1 (id=258 typename=f) has different type than the branch vector<int> xAODTestReadCVec INFO anInt1 101 aFloat: 200 pInt: 501 pFloat: 0.01 anInt2: 301 dInt1: 401 dVar1: 451 dpInt1: 51 cEL: cvec[9] pvInt: [] pvFloat: [] @@ -193,26 +172,26 @@ xAODTestRead INFO cvecWD 1001: 201 202 203 204 205 206 207 208 209 210 xAODTestReadCView INFO cview: 110 109 108 107 106 105 104 103 102 101 xAODTestReadHVec INFO hvec: 401.5 402.5 403.5 404.5 405.5 406.5 407.5 408.5 409.5 410.5 411.5 412.5 413.5 414.5 415.5 416.5 417.5 418.5 419.5 420.5 xAODTestReadHVec INFO hview: 420.5 419.5 418.5 417.5 416.5 415.5 414.5 413.5 412.5 411.5 410.5 409.5 408.5 407.5 406.5 405.5 404.5 403.5 402.5 401.5 -ClassIDSvc INFO getRegistryEntries: read 32 CLIDRegistry entries for module ALL +ClassIDSvc INFO getRegistryEntries: read 69 CLIDRegistry entries for module ALL DbSession INFO Open DbSession Domain[ROOT_All] INFO > Access DbDomain UPDATE [ROOT_All] -Domain[ROOT_All] INFO -> Access DbDatabase CREATE [ROOT_All] C63120BB-9387-D943-ACAF-377DCAB24B30 +Domain[ROOT_All] INFO -> Access DbDatabase CREATE [ROOT_All] AFB33048-6EB5-2E46-A9EF-B3C0B57DB473 Domain[ROOT_All] INFO xaoddata2.root -RootDatabase.open INFO xaoddata2.root File version:61600 -StorageSvc INFO Building shape according to reflection information using shape ID for: -StorageSvc INFO DataVector<DMTest::H_v2> [CD6C3074-425B-4C08-AF1C-43D7E8C84288] +RootDatabase.open INFO xaoddata2.root File version:62006 StorageSvc INFO Building shape according to reflection information using shape ID for: StorageSvc INFO DMTest::HAuxContainer_v2 [2BDBFB04-C1C2-4B14-A977-3A61B8054700] StorageSvc INFO Building shape according to reflection information using shape ID for: -StorageSvc INFO ViewVector<DataVector<DMTest::H_v2> > [17849966-6667-4732-A1C7-096FBC778CF3] -StorageSvc INFO Building shape according to reflection information using shape ID for: StorageSvc INFO xAOD::ShallowAuxInfo [BE505E75-8760-4F39-9331-689CB5443DB1] StorageSvc INFO Building shape according to reflection information using shape ID for: StorageSvc INFO xAOD::ShallowAuxContainer [C63C39D7-9501-49DC-B1B0-6AD98B1AEEFA] StorageSvc INFO Building shape according to reflection information using shape ID for: StorageSvc INFO xAOD::AuxContainerBase [C87C71B3-B03F-42FC-AF99-DF497F148397] +StorageSvc INFO Building shape according to reflection information using shape ID for: +StorageSvc INFO DataVector<DMTest::H_v2> [CD6C3074-425B-4C08-AF1C-43D7E8C84288] +StorageSvc INFO Building shape according to reflection information using shape ID for: +StorageSvc INFO ViewVector<DataVector<DMTest::H_v2> > [17849966-6667-4732-A1C7-096FBC778CF3] +ClassIDSvc INFO getRegistryEntries: read 89 CLIDRegistry entries for module ALL AthenaEventLoopMgr INFO ===>>> done processing event #0, run #0 1 events processed so far <<<=== -ClassIDSvc INFO getRegistryEntries: read 18 CLIDRegistry entries for module ALL AthenaEventLoopMgr INFO ===>>> start processing event #1, run #0 1 events processed so far <<<=== xAODTestReadCVec INFO cvec aux items: aFloat anInt anInt2 cEL dInt1 dVar1 dpInt1 dpvFloat pFloat pInt pvFloat pvInt xAODTestReadCVec INFO Type of aux store: DMTest::CAuxContainer_v1 @@ -1721,21 +1700,21 @@ xAODTestReadCView INFO cview: 2010 2009 2008 2007 2006 2005 2004 2003 2002 20 xAODTestReadHVec INFO hvec: 8001.5 8002.5 8003.5 8004.5 8005.5 8006.5 8007.5 8008.5 8009.5 8010.5 8011.5 8012.5 8013.5 8014.5 8015.5 8016.5 8017.5 8018.5 8019.5 8020.5 xAODTestReadHVec INFO hview: 8020.5 8019.5 8018.5 8017.5 8016.5 8015.5 8014.5 8013.5 8012.5 8011.5 8010.5 8009.5 8008.5 8007.5 8006.5 8005.5 8004.5 8003.5 8002.5 8001.5 AthenaEventLoopMgr INFO ===>>> done processing event #19, run #0 20 events processed so far <<<=== -ClassIDSvc INFO getRegistryEntries: read 6 CLIDRegistry entries for module ALL +ClassIDSvc INFO getRegistryEntries: read 7 CLIDRegistry entries for module ALL Stream1 INFO Metadata records written: 21 xaoddata.root INFO Database being retired... -Domain[ROOT_All] INFO -> Deaccess DbDatabase READ [ROOT_All] 08312C01-E986-CD48-BFB5-512B5E9FED1A +Domain[ROOT_All] INFO -> Deaccess DbDatabase READ [ROOT_All] A234C939-27F1-9149-B62A-7F0E38DD8890 xaoddata2.root INFO Database being retired... -Domain[ROOT_All] INFO -> Deaccess DbDatabase CREATE [ROOT_All] C63120BB-9387-D943-ACAF-377DCAB24B30 +Domain[ROOT_All] INFO -> Deaccess DbDatabase CREATE [ROOT_All] AFB33048-6EB5-2E46-A9EF-B3C0B57DB473 Domain[ROOT_All] INFO > Deaccess DbDomain UPDATE [ROOT_All] ApplicationMgr INFO Application Manager Stopped successfully IncidentProcAlg1 INFO Finalize LoadReadDicts INFO Finalizing LoadReadDicts... IncidentProcAlg2 INFO Finalize DecisionSvc INFO Finalized successfully. -PyComponentMgr INFO Finalizing PyComponentMgr... Domain[ROOT_All] INFO > Deaccess DbDomain READ [ROOT_All] XMLCatalog INFO File 'xAODTestRead_catalog.xml' does not exist. New file created. +PyComponentMgr INFO Finalizing PyComponentMgr... AthDictLoaderSvc INFO in finalize... ToolSvc INFO Removing all tools created by ToolSvc ChronoStatSvc.f... INFO Service finalized successfully diff --git a/Control/DataModelTest/DataModelRunTests/share/xAODTestRead2_jo.py b/Control/DataModelTest/DataModelRunTests/share/xAODTestRead2_jo.py index 5636b77cb7902204ed8cc67338c8d2d1b952e313..fa57e02c166ff8d90a619c85f1685211666a0320 100644 --- a/Control/DataModelTest/DataModelRunTests/share/xAODTestRead2_jo.py +++ b/Control/DataModelTest/DataModelRunTests/share/xAODTestRead2_jo.py @@ -42,14 +42,6 @@ include( "EventAthenaPool/EventAthenaPoolItemList_joboptions.py" ) fullItemList+=["DMTest::CVec#cvec"] fullItemList+=["xAOD::AuxContainerBase#cvecAux."] -from xAODEventFormatCnv.xAODEventFormatCnvConf import xAODMaker__EventFormatSvc -fmtsvc = xAODMaker__EventFormatSvc (FormatNames = - ['DataVector<DMTest::C_v1>', - 'DMTest::CAuxContainer_v1', - 'DMTest::C_v1', - ]) -ServiceMgr += fmtsvc - ServiceMgr.AthenaPoolCnvSvc.PoolAttributes += ["DEFAULT_SPLITLEVEL='1'"] from OutputStreamAthenaPool.MultipleStreamManager import MSMgr @@ -102,11 +94,19 @@ topSequence += DMTest__xAODTestReadHVec ("xAODTestReadHVec_scopy", # Stream's output file Stream1_Augmented = MSMgr.NewPoolStream ('Stream1', 'xaoddata2x.root',asAlg=True, noTag=True) -Stream1_Augmented.AddMetaDataItem ('xAOD::EventFormat#EventFormat') Stream1 = Stream1_Augmented.GetEventStream() Stream1.WritingTool.SubLevelBranchName = '<key>' Stream1.ItemList += fullItemList # List of DO's to write out +from xAODEventFormatCnv.xAODEventFormatCnvConf import xAODMaker__EventFormatStreamHelperTool +for tool in Stream1.HelperTools: + if isinstance(tool, xAODMaker__EventFormatStreamHelperTool): + tool.TypeNames += [ + 'DataVector<DMTest::C_v1>', + 'DMTest::CAuxContainer_v1', + 'DMTest::C_v1', + ] + break # Avoid races when running tests in parallel. FILECATALOG = 'xAODTestRead2_catalog.xml' diff --git a/Control/DataModelTest/DataModelRunTests/share/xAODTestReadFilter_jo.py b/Control/DataModelTest/DataModelRunTests/share/xAODTestReadFilter_jo.py index ecc06de1166cacaab317f2e2f08dbaa3891a1c0f..952308abb3d571b6f82ceb34008353fa736e8365 100644 --- a/Control/DataModelTest/DataModelRunTests/share/xAODTestReadFilter_jo.py +++ b/Control/DataModelTest/DataModelRunTests/share/xAODTestReadFilter_jo.py @@ -47,14 +47,6 @@ fullItemList+=["xAOD::AuxContainerBase!#cvecAux."] fullItemList+=["DMTest::C#cinfo"] fullItemList+=["DMTest::CInfoAuxContainer#cinfoAux."] -from xAODEventFormatCnv.xAODEventFormatCnvConf import xAODMaker__EventFormatSvc -fmtsvc = xAODMaker__EventFormatSvc (FormatNames = - ['DataVector<DMTest::C_v1>', - 'DMTest::CAuxContainer_v1', - 'DMTest::C_v1', - ]) -ServiceMgr += fmtsvc - ServiceMgr.AthenaPoolCnvSvc.PoolAttributes += ["DEFAULT_SPLITLEVEL='1'"] from OutputStreamAthenaPool.MultipleStreamManager import MSMgr @@ -86,7 +78,19 @@ topSequence += DMTest__xAODTestDecor ('xAODTestDecor', # Stream's output file Stream1_Augmented = MSMgr.NewPoolStream ('Stream1', 'xaoddata_filt.root',asAlg=True,noTag=True) -Stream1_Augmented.AddMetaDataItem ('xAOD::EventFormat#EventFormat') + +from xAODEventFormatCnv.xAODEventFormatCnvConf import xAODMaker__EventFormatStreamHelperTool +for tool in Stream1_Augmented.GetEventStream().HelperTools: + if isinstance(tool, xAODMaker__EventFormatStreamHelperTool): + tool.TypeNames += [ + 'DataVector<DMTest::C_v1>', + 'DMTest::CAuxContainer_v1', + 'DMTest::C_v1', + ] + break + + + Stream1 = Stream1_Augmented.GetEventStream() Stream1.WritingTool.SubLevelBranchName = '<key>' Stream1.ItemList += fullItemList # List of DO's to write out diff --git a/Control/DataModelTest/DataModelRunTests/share/xAODTestReadThinned.ref b/Control/DataModelTest/DataModelRunTests/share/xAODTestReadThinned.ref index a94946954a00d5a914f6e6502e17247925017838..e7d30a1b356be37aa5ca632aa18d144e0bb1d4e7 100644 --- a/Control/DataModelTest/DataModelRunTests/share/xAODTestReadThinned.ref +++ b/Control/DataModelTest/DataModelRunTests/share/xAODTestReadThinned.ref @@ -1,41 +1,39 @@ -Thu Oct 31 10:31:58 EDT 2019 +Wed Sep 9 15:05:53 CEST 2020 +Preloading tcmalloc_minimal.so Py:Athena INFO including file "AthenaCommon/Preparation.py" -Py:Athena INFO using release [?-21.0.0] [?] [?/?] -- built on [?] +Py:Athena INFO using release [WorkDir-22.0.18] [x86_64-centos7-gcc8-opt] [EventFormatMetaData/ed94d57] -- built on [2020-09-08T1647] 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 "DataModelRunTests/xAODTestReadThinned_jo.py" -Py:ConfigurableDb INFO Read module info for 820 configurables from 2 genConfDb files +Py:ConfigurableDb INFO Read module info for 5573 configurables from 15 genConfDb files Py:ConfigurableDb INFO No duplicates have been found: that's good ! Py:Athena INFO including file "DataModelRunTests/loadWriteDicts.py" +Py:Athena INFO including file "DataModelRunTests/commonTrailer.py" Py:Athena INFO including file "DataModelRunTests/setCatalog.py" Py:Athena INFO including file "AthenaCommon/runbatch.py" -# setting LC_ALL to "C" -ApplicationMgr 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 v27r1p99) - running on karma on Thu Oct 31 10:32:03 2019 + Welcome to ApplicationMgr (GaudiCoreSvc v34r0) + running on ed38202b3ca6 on Wed Sep 9 15:05:58 2020 ==================================================================================================================================== ApplicationMgr INFO Application Manager Configured successfully -ApplicationMgr INFO Updating Gaudi::PluginService::SetDebug(level) to level= 'PluginDebugLevel':0 -StatusCodeSvc INFO initialize AthDictLoaderSvc INFO in initialize... AthDictLoaderSvc INFO acquired Dso-registry -ClassIDSvc INFO getRegistryEntries: read 3753 CLIDRegistry entries for module ALL +ClassIDSvc INFO getRegistryEntries: read 3362 CLIDRegistry entries for module ALL CoreDumpSvc INFO Handling signals: 11(Segmentation fault) 7(Bus error) 4(Illegal instruction) 8(Floating point exception) AthenaEventLoopMgr INFO Initializing AthenaEventLoopMgr - package version AthenaServices-00-00-00 -ClassIDSvc INFO getRegistryEntries: read 10214 CLIDRegistry entries for module ALL +ClassIDSvc INFO getRegistryEntries: read 2023 CLIDRegistry entries for module ALL PyComponentMgr INFO Initializing PyComponentMgr... LoadWriteDicts INFO Initializing LoadWriteDicts... MetaDataSvc INFO Initializing MetaDataSvc - package version AthenaServices-00-00-00 AthenaPoolCnvSvc INFO Initializing AthenaPoolCnvSvc - package version AthenaPoolCnvSvc-00-00-00 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 Read replica configuration from /home/sss/atlas/dvtest/build/share/dbreplica.config +DBReplicaSvc INFO Frontier server at (serverurl=http://atlasfrontier-ai.cern.ch:8000/atlr)(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 /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2020-09-08T2101/Athena/22.0.18/InstallArea/x86_64-centos7-gcc8-opt/share/dbreplica.config DBReplicaSvc INFO No specific match for domain found - use default fallback -DBReplicaSvc INFO Total of 1 servers found for host karma [atlas_dd ] +DBReplicaSvc INFO Total of 2 servers found for host ed38202b3ca6 [ATLF atlas_dd ] PoolSvc INFO Successfully setup replica sorting algorithm PoolSvc INFO Setting up APR FileCatalog and Streams PoolSvc INFO POOL WriteCatalog is file:xAODTestReadThinned_catalog.xml @@ -47,7 +45,7 @@ PoolSvc INFO File is not in Catalog! Attempt to open it anyway. DbSession INFO Open DbSession Domain[ROOT_All] INFO -> Access DbDatabase READ [ROOT_All] BF012F5D-24ED-4D8F-2F0B-73143B82F680 Domain[ROOT_All] INFO xaodthinned1.root -RootDatabase.open INFO xaodthinned1.root File version:61800 +RootDatabase.open INFO xaodthinned1.root File version:62006 xaodthinned1.root INFO Database being retired... Domain[ROOT_All] INFO -> Deaccess DbDatabase READ [ROOT_All] BF012F5D-24ED-4D8F-2F0B-73143B82F680 Domain[ROOT_All] INFO > Deaccess DbDomain READ [ROOT_All] @@ -56,30 +54,30 @@ DbSession INFO Open DbSession Domain[ROOT_All] INFO > Access DbDomain READ [ROOT_All] Domain[ROOT_All] INFO -> Access DbDatabase READ [ROOT_All] BF012F5D-24ED-4D8F-2F0B-73143B82F680 Domain[ROOT_All] INFO xaodthinned1.root -RootDatabase.open INFO xaodthinned1.root File version:61800 +RootDatabase.open INFO xaodthinned1.root File version:62006 xaodthinned1.root INFO Database being retired... Domain[ROOT_All] INFO -> Deaccess DbDatabase READ [ROOT_All] BF012F5D-24ED-4D8F-2F0B-73143B82F680 Domain[ROOT_All] INFO > Deaccess DbDomain READ [ROOT_All] DbSession INFO Open DbSession Domain[ROOT_All] INFO > Access DbDomain READ [ROOT_All] -Domain[ROOT_All] INFO -> Access DbDatabase READ [ROOT_All] 2CDDCA0D-462F-5D42-B5DB-6E2BF9556CA1 +Domain[ROOT_All] INFO -> Access DbDatabase READ [ROOT_All] EAB90F90-4500-D944-987B-2E9A405C4EE2 Domain[ROOT_All] INFO xaodthinned1.root -RootDatabase.open INFO xaodthinned1.root File version:61800 -ClassIDSvc INFO getRegistryEntries: read 2127 CLIDRegistry entries for module ALL +RootDatabase.open INFO xaodthinned1.root File version:62006 +ClassIDSvc INFO getRegistryEntries: read 10589 CLIDRegistry entries for module ALL EventPersistenc... INFO Added successfully Conversion service:AthenaPoolCnvSvc -HistogramPersis...WARNING Histograms saving not required. +ClassIDSvc INFO getRegistryEntries: read 2 CLIDRegistry entries for module ALL +OutputStreamSeq... INFO Initializing OutputStreamSequencerSvc - package version AthenaServices-00-00-00 AthenaEventLoopMgr INFO Setup EventSelector service EventSelector ApplicationMgr INFO Application Manager Initialized successfully xaodthinned1.root INFO Database being retired... -Domain[ROOT_All] INFO -> Deaccess DbDatabase READ [ROOT_All] 2CDDCA0D-462F-5D42-B5DB-6E2BF9556CA1 +Domain[ROOT_All] INFO -> Deaccess DbDatabase READ [ROOT_All] EAB90F90-4500-D944-987B-2E9A405C4EE2 Domain[ROOT_All] INFO > Deaccess DbDomain READ [ROOT_All] DbSession INFO Open DbSession Domain[ROOT_All] INFO > Access DbDomain READ [ROOT_All] -Domain[ROOT_All] INFO -> Access DbDatabase READ [ROOT_All] 2CDDCA0D-462F-5D42-B5DB-6E2BF9556CA1 +Domain[ROOT_All] INFO -> Access DbDatabase READ [ROOT_All] EAB90F90-4500-D944-987B-2E9A405C4EE2 Domain[ROOT_All] INFO xaodthinned1.root -RootDatabase.open INFO xaodthinned1.root File version:61800 +RootDatabase.open INFO xaodthinned1.root File version:62006 ApplicationMgr INFO Application Manager Started successfully -ClassIDSvc INFO getRegistryEntries: read 10 CLIDRegistry entries for module ALL AlgResourcePool INFO TopAlg list empty. Recovering the one of Application Manager AthenaPoolConve... INFO massageEventInfo: unable to get OverrideRunNumberFromInput property from EventSelector AthenaEventLoopMgr INFO ===>>> start of run 0 <<<=== @@ -99,11 +97,11 @@ xAODTestReadCLinks INFO (:inv) (:inv) (:inv) (:inv) (:inv) (:inv) (:inv) (:i xAODTestReadCLinks INFO (:inv) (:inv) (:inv) (:inv) (:inv) (:inv) (:inv) (:inv) (:inv) (:inv) xAODTestReadCVec2 INFO cvec2 101 102 103 105 106 107 109 110 AthenaEventLoopMgr INFO ===>>> done processing event #0, run #0 1 events processed so far <<<=== -ClassIDSvc INFO getRegistryEntries: read 65 CLIDRegistry entries for module ALL +ClassIDSvc INFO getRegistryEntries: read 57 CLIDRegistry entries for module ALL AthenaEventLoopMgr INFO ===>>> start processing event #1, run #0 1 events processed so far <<<=== xAODTestReadCVec INFO cvec aux items: aFloat anInt anInt2 cEL dVar1 dpInt1 dpvFloat pFloat pInt pvFloat pvInt xAODTestReadCVec INFO Type of aux store: DMTest::CAuxContainer_v1 -RootAuxDynReader INFO FILE:LINE (const RootAuxDynReader::BranchInfo& RootAuxDynReader::getBranchInfo(const unsigned long&, const SG::AuxStoreInternal&)): attribute dVar1 (id=225 typename=f) has different type than the branch vector<int> +RootAuxDynReader INFO FILE:LINE (const RootAuxDynReader::BranchInfo& RootAuxDynReader::getBranchInfo(const unsigned long&, const SG::AuxStoreInternal&)): attribute dVar1 (id=258 typename=f) has different type than the branch vector<int> xAODTestReadCVec INFO anInt1 201 aFloat: 400 pInt: 1001 pFloat: 0.02 anInt2: 601 dVar1: 901 dpInt1: 101 cEL: [0] pvInt: [] pvFloat: [] @@ -856,7 +854,7 @@ xAODTestReadCLinks INFO (cvec:5) (cvec:4) (:inv) (:inv) (cvec:3) (cvec:2) (: xAODTestReadCVec2 INFO cvec2 2001 2002 2003 2005 2006 2007 2009 2010 AthenaEventLoopMgr INFO ===>>> done processing event #19, run #0 20 events processed so far <<<=== xaodthinned1.root INFO Database being retired... -Domain[ROOT_All] INFO -> Deaccess DbDatabase READ [ROOT_All] 2CDDCA0D-462F-5D42-B5DB-6E2BF9556CA1 +Domain[ROOT_All] INFO -> Deaccess DbDatabase READ [ROOT_All] EAB90F90-4500-D944-987B-2E9A405C4EE2 ApplicationMgr INFO Application Manager Stopped successfully IncidentProcAlg1 INFO Finalize LoadWriteDicts INFO Finalizing LoadWriteDicts... diff --git a/Control/DataModelTest/DataModelRunTests/share/xAODTestRead_jo.py b/Control/DataModelTest/DataModelRunTests/share/xAODTestRead_jo.py index 11f7b161da81f53ed472694803fa91ce5fd741cc..32f75aa484cfc21f0115d58a90b1f8475775adf7 100755 --- a/Control/DataModelTest/DataModelRunTests/share/xAODTestRead_jo.py +++ b/Control/DataModelTest/DataModelRunTests/share/xAODTestRead_jo.py @@ -79,16 +79,6 @@ fullItemList+=["xAOD::ShallowAuxInfo#scopy_cinfoAux."] fullItemList+=["DMTest::HVec#scopy_hvec"] fullItemList+=["xAOD::ShallowAuxContainer#scopy_hvecAux."] -from xAODEventFormatCnv.xAODEventFormatCnvConf import xAODMaker__EventFormatSvc -fmtsvc = xAODMaker__EventFormatSvc (FormatNames = - ['DataVector<DMTest::C_v1>', - 'DMTest::CAuxContainer_v1', - 'DMTest::CVecWithData_v1', - 'DMTest::CTrigAuxContainer_v1', - 'DMTest::C_v1', - 'DMTest::CInfoAuxContainer_v1']) -ServiceMgr += fmtsvc - ServiceMgr.AthenaPoolCnvSvc.PoolAttributes += ["DEFAULT_SPLITLEVEL='1'"] from OutputStreamAthenaPool.MultipleStreamManager import MSMgr @@ -143,13 +133,22 @@ topSequence += DMTest__xAODTestDecor ('AuxDataTestDecor1_scopy', # Stream's output file Stream1_Augmented = MSMgr.NewPoolStream ('Stream1', 'xaoddata2.root',asAlg=True, noTag=True) -Stream1_Augmented.AddMetaDataItem ('xAOD::EventFormat#EventFormat') Stream1 = Stream1_Augmented.GetEventStream() Stream1.WritingTool.SubLevelBranchName = '<key>' Stream1.ItemList += fullItemList # List of DO's to write out -theApp.CreateSvc += ['xAODMaker::EventFormatSvc'] - +from xAODEventFormatCnv.xAODEventFormatCnvConf import xAODMaker__EventFormatStreamHelperTool +for tool in Stream1.HelperTools: + if isinstance(tool, xAODMaker__EventFormatStreamHelperTool): + tool.TypeNames += [ + 'DataVector<DMTest::C_v1>', + 'DMTest::CAuxContainer_v1', + 'DMTest::CVecWithData_v1', + 'DMTest::CTrigAuxContainer_v1', + 'DMTest::C_v1', + 'DMTest::CInfoAuxContainer_v1', + ] + break # Avoid races when running tests in parallel. FILECATALOG = 'xAODTestRead_catalog.xml' diff --git a/Control/DataModelTest/DataModelRunTests/share/xAODTestTypelessRead_jo.py b/Control/DataModelTest/DataModelRunTests/share/xAODTestTypelessRead_jo.py index 58e431e76aedb2a1f5e0aed17ea0a6fc5857fa4a..ac94beb28e9a7f1b2c544babb6b2b294350ea91b 100644 --- a/Control/DataModelTest/DataModelRunTests/share/xAODTestTypelessRead_jo.py +++ b/Control/DataModelTest/DataModelRunTests/share/xAODTestTypelessRead_jo.py @@ -65,16 +65,6 @@ fullItemList+=["DMTest::HVec#copy_hvec"] fullItemList+=["DMTest::HAuxContainer#copy_hvecAux."] fullItemList+=["DMTest::HView#copy_hview"] -from xAODEventFormatCnv.xAODEventFormatCnvConf import xAODMaker__EventFormatSvc -fmtsvc = xAODMaker__EventFormatSvc (FormatNames = - ['DataVector<DMTest::C_v1>', - 'DMTest::CVecWithData_v1', - 'DMTest::CAuxContainer_v1', - 'DMTest::CTrigAuxContainer_v1', - 'DMTest::C_v1', - 'DMTest::CInfoAuxContainer_v1']) -ServiceMgr += fmtsvc - ServiceMgr.AthenaPoolCnvSvc.PoolAttributes += ["DEFAULT_SPLITLEVEL='1'"] #-------------------------------------------------------------- @@ -94,12 +84,24 @@ topSequence += DMTest__xAODTestTypelessRead ("xAODTestTypelessRead", # Stream's output file from OutputStreamAthenaPool.MultipleStreamManager import MSMgr Stream1_Augmented = MSMgr.NewPoolStream ('Stream1', 'xaoddata3.root',asAlg=True,noTag=True) -Stream1_Augmented.AddMetaDataItem ('xAOD::EventFormat#EventFormat') Stream1 = Stream1_Augmented.GetEventStream() Stream1.WritingTool.SubLevelBranchName = '<key>' # List of DO's to write out Stream1.ItemList += fullItemList +from xAODEventFormatCnv.xAODEventFormatCnvConf import xAODMaker__EventFormatStreamHelperTool +for tool in Stream1.HelperTools: + if isinstance(tool, xAODMaker__EventFormatStreamHelperTool): + tool.TypeNames += [ + 'DataVector<DMTest::C_v1>', + 'DMTest::CVecWithData_v1', + 'DMTest::CAuxContainer_v1', + 'DMTest::CTrigAuxContainer_v1', + 'DMTest::C_v1', + 'DMTest::CInfoAuxContainer_v1', + ] + break + # Avoid races when running tests in parallel. FILECATALOG = 'xAODTestTypelessRead_catalog.xml' diff --git a/Control/DataModelTest/DataModelRunTests/share/xAODTestWriteThinned_jo.py b/Control/DataModelTest/DataModelRunTests/share/xAODTestWriteThinned_jo.py index 5a75d8bcb6b778a43e2ff765cf07a2619778f688..092568973ec180d57acac36befab14c37fbaefca 100644 --- a/Control/DataModelTest/DataModelRunTests/share/xAODTestWriteThinned_jo.py +++ b/Control/DataModelTest/DataModelRunTests/share/xAODTestWriteThinned_jo.py @@ -58,8 +58,6 @@ topSequence += DMTest__xAODTestThinCVec ("xAODTestThinCVec2b", Stream = 'Thinned #-------------------------------------------------------------- # Output options #-------------------------------------------------------------- -theApp.CreateSvc += ['xAODMaker::EventFormatSvc'] - # ItemList: include( "EventAthenaPool/EventAthenaPoolItemList_joboptions.py" ) fullItemList+=["DMTest::CVec#cvec"] @@ -74,27 +72,28 @@ fullItemList+=["DMTest::CLinksContainer#clinksContainer2"] fullItemList+=["DMTest::CLinksAuxContainer#clinksContainer2Aux."] fullItemList+=["DMTest::CLinksAOD#clinksAOD"] -from xAODEventFormatCnv.xAODEventFormatCnvConf import xAODMaker__EventFormatSvc -fmtsvc = xAODMaker__EventFormatSvc (FormatNames = - ['DataVector<DMTest::C_v1>', - 'DMTest::CAuxContainer_v1', - 'DMTest::C_v1', - 'DMTest::CLinks_v1', - 'DataVector<DMTest::CLinks_v1>', - 'DMTest::CLinksAuxInfo_v1', - 'DMTest::CLinksAuxContainer_v1', - ]) -ServiceMgr += fmtsvc - # Stream's output file from OutputStreamAthenaPool.MultipleStreamManager import MSMgr Thinned1_Augmented = MSMgr.NewPoolStream ('Thinned1', 'xaodthinned1.root', asAlg=True, noTag=True) -Thinned1_Augmented.AddMetaDataItem ('xAOD::EventFormat#EventFormat') Thinned1 = Thinned1_Augmented.GetEventStream() Thinned1.WritingTool.SubLevelBranchName = '<key>' # List of DO's to write out Thinned1.ItemList += fullItemList +from xAODEventFormatCnv.xAODEventFormatCnvConf import xAODMaker__EventFormatStreamHelperTool +for tool in Thinned1.HelperTools: + if isinstance(tool, xAODMaker__EventFormatStreamHelperTool): + tool.TypeNames += [ + 'DataVector<DMTest::C_v1>', + 'DMTest::CAuxContainer_v1', + 'DMTest::C_v1', + 'DMTest::CLinks_v1', + 'DataVector<DMTest::CLinks_v1>', + 'DMTest::CLinksAuxInfo_v1', + 'DMTest::CLinksAuxContainer_v1', + ] + break + ServiceMgr.AthenaPoolCnvSvc.PoolAttributes += ["DEFAULT_SPLITLEVEL='1'"] diff --git a/Control/DataModelTest/DataModelRunTests/share/xAODTestWrite_jo.py b/Control/DataModelTest/DataModelRunTests/share/xAODTestWrite_jo.py index ee72dfc4c5b8c04d6f214553f97f21919205cecc..14dde8f7587a223ecb076edf5c921ec8c5e9e719 100755 --- a/Control/DataModelTest/DataModelRunTests/share/xAODTestWrite_jo.py +++ b/Control/DataModelTest/DataModelRunTests/share/xAODTestWrite_jo.py @@ -63,7 +63,6 @@ topSequence += DMTest__MetaWriterAlg ("MetaWriterAlg") #-------------------------------------------------------------- # Output options #-------------------------------------------------------------- -theApp.CreateSvc += ['xAODMaker::EventFormatSvc'] # ItemList: include( "EventAthenaPool/EventAthenaPoolItemList_joboptions.py" ) @@ -83,29 +82,9 @@ fullItemList+=["DMTest::HAuxContainer#hvecAux."] fullItemList+=["DMTest::HView#hview"] fullItemList+=["DMTest::S2#S2"] -from xAODEventFormatCnv.xAODEventFormatCnvConf import xAODMaker__EventFormatSvc -fmtsvc = xAODMaker__EventFormatSvc (FormatNames = - ['DataVector<DMTest::C_v1>', - 'DMTest::CVecWithData_v1', - 'DMTest::CAuxContainer_v1', - 'DMTest::CTrigAuxContainer_v1', - 'ViewVector<DataVector<DMTest::C_v1,DataModel_detail::NoBase> >', - 'DMTest::C_v1', - 'DMTest::CInfoAuxContainer_v1', - 'DataVector<DMTest::G_v1>', - 'DMTest::GAuxContainer_v1', - 'DMTest::G_v1', - 'DMTest::H_v1', - 'DataVector<DMTest::H_v1>', - 'ViewVector<DataVector<DMTest::H_v1,DataModel_detail::NoBase> >', - 'DMTest::HAuxContainer_v1', - ]) -ServiceMgr += fmtsvc - # Stream's output file from OutputStreamAthenaPool.MultipleStreamManager import MSMgr Stream1_Augmented = MSMgr.NewPoolStream ('Stream1', 'xaoddata.root', asAlg=True, noTag=True) -Stream1_Augmented.AddMetaDataItem ('xAOD::EventFormat#EventFormat') Stream1 = Stream1_Augmented.GetEventStream() Stream1.WritingTool.SubLevelBranchName = '<key>' # List of DO's to write out @@ -115,6 +94,27 @@ Stream1.MetadataItemList += [ 'DMTest::S1#MetaS1', 'DMTest::CInfoAuxContainer#MetaCAux.' ] ServiceMgr.AthenaPoolCnvSvc.PoolAttributes += ["DEFAULT_SPLITLEVEL='1'"] +from xAODEventFormatCnv.xAODEventFormatCnvConf import xAODMaker__EventFormatStreamHelperTool +for tool in Stream1.HelperTools: + if isinstance(tool, xAODMaker__EventFormatStreamHelperTool): + tool.TypeNames += [ + 'DataVector<DMTest::C_v1>', + 'DMTest::CVecWithData_v1', + 'DMTest::CAuxContainer_v1', + 'DMTest::CTrigAuxContainer_v1', + 'ViewVector<DataVector<DMTest::C_v1,DataModel_detail::NoBase> >', + 'DMTest::C_v1', + 'DMTest::CInfoAuxContainer_v1', + 'DataVector<DMTest::G_v1>', + 'DMTest::GAuxContainer_v1', + 'DMTest::G_v1', + 'DMTest::H_v1', + 'DataVector<DMTest::H_v1>', + 'ViewVector<DataVector<DMTest::H_v1,DataModel_detail::NoBase> >', + 'DMTest::HAuxContainer_v1', + ] + break + # Increment LBN every two events. from McEventSelector import McEventSelectorConf diff --git a/Control/RngComps/python/RandomServices.py b/Control/RngComps/python/RandomServices.py index aa4f9555958eda455b5cebd10eefba1726a6a271..16f7018c8ac0bc18f3ca327f41665e2f5892d829 100755 --- a/Control/RngComps/python/RandomServices.py +++ b/Control/RngComps/python/RandomServices.py @@ -18,8 +18,8 @@ AthEngines = { def dSFMT(seed, name="AtDSFMTGenSvc"): """Return a ComponentAccumulator containing an AtDSFMTGenSvc with seed""" - acc = ComponentAccumulator(name) - service = AtDSFMTGenSvc() + acc = ComponentAccumulator() + service = AtDSFMTGenSvc(name) service.Seeds.append(seed) acc.addService(service) return acc diff --git a/Control/RootUtils/CMakeLists.txt b/Control/RootUtils/CMakeLists.txt index 1ef859b0e00d54ec43cd77cb559b0dfe714dbc72..0bb8ca72952e1051be1f163085057c29b4a5f4ab 100644 --- a/Control/RootUtils/CMakeLists.txt +++ b/Control/RootUtils/CMakeLists.txt @@ -4,61 +4,53 @@ atlas_subdir( RootUtils ) # External dependencies: -find_package( Boost COMPONENTS filesystem thread system ) +find_package( Boost COMPONENTS thread ) find_package( Python COMPONENTS Development ) -find_package( ROOT COMPONENTS RIO Hist Tree PyROOT Core MathCore ROOTTPython ) -string( REPLACE PyROOT Core ROOT_LIBRARIES_NOPYROOT "${ROOT_LIBRARIES}" ) +find_package( ROOT COMPONENTS RIO Hist Tree Core MathCore ROOTTPython + cppyy${Python_VERSION_MAJOR}_${Python_VERSION_MINOR} ) # Component(s) in the package: -atlas_generate_reflex_dictionary( dict_cpp RootUtils - HEADER ${CMAKE_CURRENT_SOURCE_DIR}/RootUtils/RootUtilsDict.h - SELECTION ${CMAKE_CURRENT_SOURCE_DIR}/RootUtils/selection.xml - INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} ${Python_INCLUDE_DIRS} ${Boost_INCLUDE_DIRS} - ) +atlas_generate_reflex_dictionary( dict_cpp RootUtils + HEADER ${CMAKE_CURRENT_SOURCE_DIR}/RootUtils/RootUtilsDict.h + SELECTION ${CMAKE_CURRENT_SOURCE_DIR}/RootUtils/selection.xml + INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} ${Boost_INCLUDE_DIRS} + LINK_LIBRARIES CxxUtils ) atlas_add_library( RootUtils - src/*.cxx ${dict_cpp} - PUBLIC_HEADERS RootUtils - INCLUDE_DIRS ${Python_INCLUDE_DIRS} ${Boost_INCLUDE_DIRS} - PRIVATE_INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} - LINK_LIBRARIES CxxUtils ${Boost_LIBRARIES} - PRIVATE_LINK_LIBRARIES ${ROOT_LIBRARIES_NOPYROOT} TestTools ) - + src/*.cxx ${dict_cpp} + PUBLIC_HEADERS RootUtils + INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} ${Boost_INCLUDE_DIRS} + LINK_LIBRARIES ${ROOT_LIBRARIES} ${Boost_LIBRARIES} CxxUtils ) add_dependencies( RootUtils RootUtilsDictGen ) atlas_add_library( RootUtilsPyROOT - src/pyroot/*.cxx - PUBLIC_HEADERS RootUtils - INCLUDE_DIRS ${Python_INCLUDE_DIRS} ${Boost_INCLUDE_DIRS} - PRIVATE_INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} - LINK_LIBRARIES ${Python_LIBRARIES} ${Boost_LIBRARIES} RootUtils - PRIVATE_LINK_LIBRARIES ${ROOT_LIBRARIES} TestTools ) + src/pyroot/*.cxx + PUBLIC_HEADERS RootUtils + INCLUDE_DIRS ${Python_INCLUDE_DIRS} ${Boost_INCLUDE_DIRS} + ${ROOT_INCLUDE_DIRS} + LINK_LIBRARIES ${Python_LIBRARIES} ${Boost_LIBRARIES} ${ROOT_LIBRARIES} + CxxUtils ) atlas_add_dictionary( RootUtilsPyROOTDict - RootUtils/RootUtilsPyROOTDict.h - RootUtils/selection_PyROOT.xml - INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} ${Python_INCLUDE_DIRS} ${Boost_INCLUDE_DIRS} - LINK_LIBRARIES ${ROOT_LIBRARIES_NOPYROOT} ${Boost_LIBRARIES} TestTools RootUtils RootUtilsPyROOT ) + RootUtils/RootUtilsPyROOTDict.h + RootUtils/selection_PyROOT.xml + LINK_LIBRARIES RootUtilsPyROOT ) +# Test(s) in the package: atlas_add_test( Type_test - SOURCES - test/Type_test.cxx - INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} ${Python_INCLUDE_DIRS} ${Boost_INCLUDE_DIRS} - LINK_LIBRARIES ${ROOT_LIBRARIES} ${Python_LIBRARIES} ${Boost_LIBRARIES} TestTools RootUtils RootUtilsPyROOT - PROPERTIES TIMEOUT 300 ) + SOURCES test/Type_test.cxx + INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} + LINK_LIBRARIES ${ROOT_LIBRARIES} RootUtils + PROPERTIES TIMEOUT 300 ) atlas_add_test( TSMethodCall_test - SOURCES - test/TSMethodCall_test.cxx - INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} ${Python_INCLUDE_DIRS} ${Boost_INCLUDE_DIRS} - LINK_LIBRARIES ${ROOT_LIBRARIES} ${Python_LIBRARIES} ${Boost_LIBRARIES} TestTools RootUtils RootUtilsPyROOT ) + SOURCES test/TSMethodCall_test.cxx + INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} ${Boost_INCLUDE_DIRS} + LINK_LIBRARIES ${ROOT_LIBRARIES} ${Boost_LIBRARIES} RootUtils ) -if( NOT XAOD_ANALYSIS ) -# Doesn't work in AnalysisBase because ROOT_INCLUDE_PATH is not set correctly. atlas_add_test( TTreePatch_test - SCRIPT python ${CMAKE_CURRENT_SOURCE_DIR}/test/TTreePatch_t.py ) -endif() - + SCRIPT ${Python_EXECUTABLE} + ${CMAKE_CURRENT_SOURCE_DIR}/test/TTreePatch_t.py ) # Install files from the package: atlas_install_python_modules( python/*.py POST_BUILD_CMD ${ATLAS_FLAKE8} ) diff --git a/Control/RootUtils/python/PyROOTFixes.py b/Control/RootUtils/python/PyROOTFixes.py index 6a1de3856c364947d1850fa1e831bb07e0928a0a..42ab7731250681dceb699dc3fd0c99d9cb1ab00d 100644 --- a/Control/RootUtils/python/PyROOTFixes.py +++ b/Control/RootUtils/python/PyROOTFixes.py @@ -45,6 +45,12 @@ def _getClassIfDictionaryExists (cname): if cl.HasDictionary(): return cl return None +# Force-load the main Gaudi library if it's available. If this package's library +# is loaded before Gaudi, the application gets into a weird state. Hopefully we +# will be able to remove this with future compiler versions. (GCC 10?...) +if cppyy.gbl.gSystem.FindDynamicLibrary( 'libGaudiKernel', True ): + cppyy.load_library( 'libGaudiKernel' ) + pass ROOT.RootUtils.PyLogger ROOT.RootUtils.PyROOTTypePatch.initialize() diff --git a/Control/SGComps/src/SGInputLoader.cxx b/Control/SGComps/src/SGInputLoader.cxx index 6bc175d0ef462f7fadf8de830c9824c7a9057b98..fd70dbf70b2c26dd35731c5e87feb0beb9570e64 100644 --- a/Control/SGComps/src/SGInputLoader.cxx +++ b/Control/SGComps/src/SGInputLoader.cxx @@ -1,7 +1,7 @@ ///////////////////////// -*- C++ -*- ///////////////////////////// /* - Copyright (C) 2002-2017, 2019 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2017, 2019, 2020 CERN for the benefit of the ATLAS collaboration */ // SGInputLoader.cxx @@ -114,8 +114,14 @@ SGInputLoader::execute() SG::VarHandleKey vhk(obj->clid(),obj->key(),Gaudi::DataHandle::Writer); if (StoreID::findStoreID(vhk.storeHandle().name()) == StoreID::EVENT_STORE) { toLoad.emplace(*obj); - } else { - ATH_MSG_WARNING("Will not auto-load proxy for non-EventStore object: " + } + else if (StoreID::findStoreID(vhk.storeHandle().name()) == StoreID::CONDITION_STORE) { + ATH_MSG_ERROR("Unresolved conditions dependency: " + << *obj); + return StatusCode::FAILURE; + } + else { + ATH_MSG_DEBUG("Will not auto-load proxy for non-EventStore object: " << *obj); } } diff --git a/Control/xAODRootAccess/Root/TEvent.cxx b/Control/xAODRootAccess/Root/TEvent.cxx index 056528db31f0c969d133bdf78e03355cb943a848..0f3c8fdc91e13a36ce1c285aa0772541cf76670b 100644 --- a/Control/xAODRootAccess/Root/TEvent.cxx +++ b/Control/xAODRootAccess/Root/TEvent.cxx @@ -424,8 +424,9 @@ namespace xAOD { } // Check if the EventFormat branch is available: - static const char* EVENTFORMAT_BRANCH_NAME = "EventFormat"; - if( ! m_inMetaTree->GetBranch( EVENTFORMAT_BRANCH_NAME ) ) { + static const std::string eventFormatBranchName = + Utils::getFirstBranchMatch( m_inMetaTree, "EventFormat"); + if( ! m_inMetaTree->GetBranch( eventFormatBranchName.c_str() ) ) { // This can happen when the file was produced by an Athena job that // didn't have any input events itself. This means that the file // doesn't actually have any useful metadata. @@ -439,7 +440,7 @@ namespace xAOD { // Read in the event format object: EventFormat* format = 0; ::TBranch* br = 0; const Int_t status = - m_inMetaTree->SetBranchAddress( EVENTFORMAT_BRANCH_NAME, + m_inMetaTree->SetBranchAddress( eventFormatBranchName.c_str(), &format, &br ); if( status < 0 ) { ::Error( "xAOD::TEvent::readFrom", @@ -3399,4 +3400,5 @@ namespace xAOD { return getOutputObject( key, ti, metadata ); } + } // namespace xAOD diff --git a/Control/xAODRootAccess/Root/Utils.cxx b/Control/xAODRootAccess/Root/Utils.cxx index 56ee1090c47a97d5e91f25fc67da44cdf331a119..1d7d08b92fcd018c32ac15f30b2b1519c848185d 100644 --- a/Control/xAODRootAccess/Root/Utils.cxx +++ b/Control/xAODRootAccess/Root/Utils.cxx @@ -6,6 +6,7 @@ // STL include(s): #include <functional> +#include <regex> // ROOT include(s): #include <TError.h> @@ -313,6 +314,22 @@ namespace xAOD { return result; } + std::string getFirstBranchMatch( TTree * tree, + const std::string& pre ) { + const TObjArray * pBranches = tree->GetListOfBranches(); + const std::regex pattern( ".*" + pre + ".*" ); + + for( int i = 0; i < pBranches->GetLast() ; ++i ) { + const std::string name = pBranches->At(i)->GetName(); + + if( std::regex_match( name, pattern ) ) + return name; + + } + + return pre; + } + } // namespace Utils } // namespace xAOD diff --git a/Control/xAODRootAccess/xAODRootAccess/tools/Utils.h b/Control/xAODRootAccess/xAODRootAccess/tools/Utils.h index 2dec08cd0d7360e125903ec77a712ebf67b308f5..28db3560c6f3834fbeed663d66b94fe3d8aadeae 100644 --- a/Control/xAODRootAccess/xAODRootAccess/tools/Utils.h +++ b/Control/xAODRootAccess/xAODRootAccess/tools/Utils.h @@ -17,6 +17,7 @@ extern "C" { // ROOT include(s): #include <TDataType.h> +#include <TTree.h> namespace xAOD { @@ -37,6 +38,9 @@ namespace xAOD { /// Get the type name as it is known to ROOT, based on std::type_info std::string getTypeName( const std::type_info& ti ); + /// Search for branches, returns search term on no result + std::string getFirstBranchMatch( TTree* tree, const std::string& pre ); + } // namespace Utils } // namespace xAOD diff --git a/DataQuality/DataQualityConfigurations/config/AFP/collisions_run.config b/DataQuality/DataQualityConfigurations/config/AFP/collisions_run.config index 902fe0284263ff85a0dad4fc4500007dc5ce9429..c54e9aa21f17acccbade97b4b5a174140547f55c 100644 --- a/DataQuality/DataQualityConfigurations/config/AFP/collisions_run.config +++ b/DataQuality/DataQualityConfigurations/config/AFP/collisions_run.config @@ -10,7 +10,7 @@ # Reference reference AFPBinContentReference { location = /eos/atlas/atlascerngroupdisk/data-dqm/references/Other/,root://eosatlas.cern.ch//eos/atlas/atlascerngroupdisk/data-dqm/references/Other/ - file = data18_13TeV.00337176.physics_Main.merge.HIST.f940_h308.root + file = AFPOutput62-337176-500k.root path = run_337176 name = same_name } @@ -24,31 +24,111 @@ output top_level { output AFP { output SiT { output pixelColRow2D { + output nearAside { + } + output farAside { + } + output nearCside { + } + output farCside { + } } output PixelColIDChip { + output nearAside { + } + output farAside { + } + output nearCside { + } + output farCside { + } } output PixelRowIDChip { + output nearAside { + } + output farAside { + } + output nearCside { + } + output farCside { + } } output SiTimeOverThreshold { + output nearAside { + } + output farAside { + } + output nearCside { + } + output farCside { + } + } + output HitsPerPlanes { } output Cluster { + output nearAside { + } + output farAside { + } + output nearCside { + } + output farCside { + } } output Track { } output clustersPerPlane { + output nearAside { + } + output farAside { + } + output nearCside { + } + output farCside { + } } output clustersPerStation { } output clustersPerPlaneFront { + output nearAside { + } + output farAside { + } + output nearCside { + } + output farCside { + } } output clustersPerPlaneEnd { + output nearAside { + } + output farAside { + } + output nearCside { + } + output farCside { + } } output clustersPerPlaneMiddle { + output nearAside { + } + output farAside { + } + output nearCside { + } + output farCside { + } } } output ToF { output HitBarvsTrain { } + output HitsPerBarsInTrain { + output farAside { + } + output farCside { + } + } } } } @@ -60,413 +140,480 @@ output top_level { dir AFP { dir SiT { dir pixelColRow2D { - hist pixelColIDChip_vs_pixelRowIDChip_nearAside_P0 { - algorithm = HNE - output = AFP/SiT/pixelColRow2D - display = LogZ,Draw=COLZ - } - hist pixelColIDChip_vs_pixelRowIDChip_nearAside_P1 { - algorithm = HNE - output = AFP/SiT/pixelColRow2D - display = LogZ,Draw=COLZ - } - hist pixelColIDChip_vs_pixelRowIDChip_nearAside_P2 { - algorithm = HNE - output = AFP/SiT/pixelColRow2D - display = LogZ,Draw=COLZ - } - hist pixelColIDChip_vs_pixelRowIDChip_nearAside_P3 { - algorithm = HNE - output = AFP/SiT/pixelColRow2D - display = LogZ,Draw=COLZ - } - hist pixelColIDChip_vs_pixelRowIDChip_nearCside_P0 { - algorithm = HNE - output = AFP/SiT/pixelColRow2D - display = LogZ,Draw=COLZ - } - hist pixelColIDChip_vs_pixelRowIDChip_nearCside_P1 { - algorithm = HNE - output = AFP/SiT/pixelColRow2D - display = LogZ,Draw=COLZ - } - hist pixelColIDChip_vs_pixelRowIDChip_nearCside_P2 { - algorithm = HNE - output = AFP/SiT/pixelColRow2D - display = LogZ,Draw=COLZ - } - hist pixelColIDChip_vs_pixelRowIDChip_nearCside_P3 { - algorithm = HNE - output = AFP/SiT/pixelColRow2D - display = LogZ,Draw=COLZ - } - hist pixelColIDChip_vs_pixelRowIDChip_farAside_P0 { - algorithm = HNE - output = AFP/SiT/pixelColRow2D - display = LogZ,Draw=COLZ - } - hist pixelColIDChip_vs_pixelRowIDChip_farAside_P1 { - algorithm = HNE - output = AFP/SiT/pixelColRow2D - display = LogZ,Draw=COLZ - } - hist pixelColIDChip_vs_pixelRowIDChip_farAside_P2 { - algorithm = HNE - output = AFP/SiT/pixelColRow2D - display = LogZ,Draw=COLZ - } - hist pixelColIDChip_vs_pixelRowIDChip_farAside_P3 { - algorithm = HNE - output = AFP/SiT/pixelColRow2D - display = LogZ,Draw=COLZ - } - hist pixelColIDChip_vs_pixelRowIDChip_farCside_P0 { - algorithm = HNE - output = AFP/SiT/pixelColRow2D - display = LogZ,Draw=COLZ - } - hist pixelColIDChip_vs_pixelRowIDChip_farCside_P1 { - algorithm = HNE - output = AFP/SiT/pixelColRow2D - display = LogZ,Draw=COLZ - } - hist pixelColIDChip_vs_pixelRowIDChip_farCside_P2 { - algorithm = HNE - output = AFP/SiT/pixelColRow2D - display = LogZ,Draw=COLZ - } - hist pixelColIDChip_vs_pixelRowIDChip_farCside_P3 { - algorithm = HNE - output = AFP/SiT/pixelColRow2D - display = LogZ,Draw=COLZ + dir nearAside { + hist pixelColIDChip_vs_pixelRowIDChip_nearAside_P0 { + algorithm = HNE + output = AFP/SiT/pixelColRow2D/nearAside + display = LogZ,Draw=COLZ + } + hist pixelColIDChip_vs_pixelRowIDChip_nearAside_P1 { + algorithm = HNE + output = AFP/SiT/pixelColRow2D/nearAside + display = LogZ,Draw=COLZ + } + hist pixelColIDChip_vs_pixelRowIDChip_nearAside_P2 { + algorithm = HNE + output = AFP/SiT/pixelColRow2D/nearAside + display = LogZ,Draw=COLZ + } + hist pixelColIDChip_vs_pixelRowIDChip_nearAside_P3 { + algorithm = HNE + output = AFP/SiT/pixelColRow2D/nearAside + display = LogZ,Draw=COLZ + } + } + dir nearCside { + hist pixelColIDChip_vs_pixelRowIDChip_nearCside_P0 { + algorithm = HNE + output = AFP/SiT/pixelColRow2D/nearCside + display = LogZ,Draw=COLZ + } + hist pixelColIDChip_vs_pixelRowIDChip_nearCside_P1 { + algorithm = HNE + output = AFP/SiT/pixelColRow2D/nearCside + display = LogZ,Draw=COLZ + } + hist pixelColIDChip_vs_pixelRowIDChip_nearCside_P2 { + algorithm = HNE + output = AFP/SiT/pixelColRow2D/nearCside + display = LogZ,Draw=COLZ + } + hist pixelColIDChip_vs_pixelRowIDChip_nearCside_P3 { + algorithm = HNE + output = AFP/SiT/pixelColRow2D/nearCside + display = LogZ,Draw=COLZ + } + } + dir farAside { + hist pixelColIDChip_vs_pixelRowIDChip_farAside_P0 { + algorithm = HNE + output = AFP/SiT/pixelColRow2D/farAside + display = LogZ,Draw=COLZ + } + hist pixelColIDChip_vs_pixelRowIDChip_farAside_P1 { + algorithm = HNE + output = AFP/SiT/pixelColRow2D/farAside + display = LogZ,Draw=COLZ + } + hist pixelColIDChip_vs_pixelRowIDChip_farAside_P2 { + algorithm = HNE + output = AFP/SiT/pixelColRow2D/farAside + display = LogZ,Draw=COLZ + } + hist pixelColIDChip_vs_pixelRowIDChip_farAside_P3 { + algorithm = HNE + output = AFP/SiT/pixelColRow2D/farAside + display = LogZ,Draw=COLZ + } + } + dir farCside { + hist pixelColIDChip_vs_pixelRowIDChip_farCside_P0 { + algorithm = HNE + output = AFP/SiT/pixelColRow2D/farCside + display = LogZ,Draw=COLZ + } + hist pixelColIDChip_vs_pixelRowIDChip_farCside_P1 { + algorithm = HNE + output = AFP/SiT/pixelColRow2D/farCside + display = LogZ,Draw=COLZ + } + hist pixelColIDChip_vs_pixelRowIDChip_farCside_P2 { + algorithm = HNE + output = AFP/SiT/pixelColRow2D/farCside + display = LogZ,Draw=COLZ + } + hist pixelColIDChip_vs_pixelRowIDChip_farCside_P3 { + algorithm = HNE + output = AFP/SiT/pixelColRow2D/farCside + display = LogZ,Draw=COLZ + } } } dir PixelColIDChip { - hist pixelColIDChip_nearAside_P0 { - algorithm = AFPBinContentComp - output = AFP/SiT/PixelColIDChip - display = Draw=HIST - } - hist pixelColIDChip_nearAside_P1 { - algorithm = AFPBinContentComp - output = AFP/SiT/PixelColIDChip - display = Draw=HIST - } - hist pixelColIDChip_nearAside_P2 { - algorithm = AFPBinContentComp - output = AFP/SiT/PixelColIDChip - display = Draw=HIST - } - hist pixelColIDChip_nearAside_P3 { - algorithm = AFPBinContentComp - output = AFP/SiT/PixelColIDChip - display = Draw=HIST - } - hist pixelColIDChip_farAside_P0 { - algorithm = AFPBinContentComp - output = AFP/SiT/PixelColIDChip - display = Draw=HIST - } - hist pixelColIDChip_farAside_P1 { - algorithm = AFPBinContentComp - output = AFP/SiT/PixelColIDChip - display = Draw=HIST - } - hist pixelColIDChip_farAside_P2 { - algorithm = AFPBinContentComp - output = AFP/SiT/PixelColIDChip - display = Draw=HIST - } - hist pixelColIDChip_farAside_P3 { - algorithm = AFPBinContentComp - output = AFP/SiT/PixelColIDChip - display = Draw=HIST - } - hist pixelColIDChip_nearCside_P0 { - algorithm = AFPBinContentComp - output = AFP/SiT/PixelColIDChip - display = Draw=HIST - } - hist pixelColIDChip_nearCside_P1 { - algorithm = AFPBinContentComp - output = AFP/SiT/PixelColIDChip - display = Draw=HIST - } - hist pixelColIDChip_nearCside_P2 { - algorithm = AFPBinContentComp - output = AFP/SiT/PixelColIDChip - display = Draw=HIST - } - hist pixelColIDChip_nearCside_P3 { - algorithm = AFPBinContentComp - output = AFP/SiT/PixelColIDChip - display = Draw=HIST - } - hist pixelColIDChip_farCside_P0 { - algorithm = AFPBinContentComp - output = AFP/SiT/PixelColIDChip - display = Draw=HIST - } - hist pixelColIDChip_farCside_P1 { - algorithm = AFPBinContentComp - output = AFP/SiT/PixelColIDChip - display = Draw=HIST - } - hist pixelColIDChip_farCside_P2 { - algorithm = AFPBinContentComp - output = AFP/SiT/PixelColIDChip - display = Draw=HIST - } - hist pixelColIDChip_farCside_P3 { - algorithm = AFPBinContentComp - output = AFP/SiT/PixelColIDChip - display = Draw=HIST + dir nearAside { + hist pixelColIDChip_nearAside_P0 { + algorithm = AFPBinContentComp + output = AFP/SiT/PixelColIDChip/nearAside + display = Draw=HIST + } + hist pixelColIDChip_nearAside_P1 { + algorithm = AFPBinContentComp + output = AFP/SiT/PixelColIDChip/nearAside + display = Draw=HIST + } + hist pixelColIDChip_nearAside_P2 { + algorithm = AFPBinContentComp + output = AFP/SiT/PixelColIDChip/nearAside + display = Draw=HIST + } + hist pixelColIDChip_nearAside_P3 { + algorithm = AFPBinContentComp + output = AFP/SiT/PixelColIDChip/nearAside + display = Draw=HIST + } + } + dir farAside { + hist pixelColIDChip_farAside_P0 { + algorithm = AFPBinContentComp + output = AFP/SiT/PixelColIDChip/farAside + display = Draw=HIST + } + hist pixelColIDChip_farAside_P1 { + algorithm = AFPBinContentComp + output = AFP/SiT/PixelColIDChip/farAside + display = Draw=HIST + } + hist pixelColIDChip_farAside_P2 { + algorithm = AFPBinContentComp + output = AFP/SiT/PixelColIDChip/farAside + display = Draw=HIST + } + hist pixelColIDChip_farAside_P3 { + algorithm = AFPBinContentComp + output = AFP/SiT/PixelColIDChip/farAside + display = Draw=HIST + } + } + dir nearCside { + hist pixelColIDChip_nearCside_P0 { + algorithm = AFPBinContentComp + output = AFP/SiT/PixelColIDChip/nearCside + display = Draw=HIST + } + hist pixelColIDChip_nearCside_P1 { + algorithm = AFPBinContentComp + output = AFP/SiT/PixelColIDChip/nearCside + display = Draw=HIST + } + hist pixelColIDChip_nearCside_P2 { + algorithm = AFPBinContentComp + output = AFP/SiT/PixelColIDChip/nearCside + display = Draw=HIST + } + hist pixelColIDChip_nearCside_P3 { + algorithm = AFPBinContentComp + output = AFP/SiT/PixelColIDChip/nearCside + display = Draw=HIST + } + } + dir farCside { + hist pixelColIDChip_farCside_P0 { + algorithm = AFPBinContentComp + output = AFP/SiT/PixelColIDChip/farCside + display = Draw=HIST + } + hist pixelColIDChip_farCside_P1 { + algorithm = AFPBinContentComp + output = AFP/SiT/PixelColIDChip/farCside + display = Draw=HIST + } + hist pixelColIDChip_farCside_P2 { + algorithm = AFPBinContentComp + output = AFP/SiT/PixelColIDChip/farCside + display = Draw=HIST + } + hist pixelColIDChip_farCside_P3 { + algorithm = AFPBinContentComp + output = AFP/SiT/PixelColIDChip/farCside + display = Draw=HIST + } } } dir PixelRowIDChip { - hist pixelRowIDChip_nearAside_P0 { - algorithm = AFPBinContentComp - output = AFP/SiT/PixelRowIDChip - display = Draw=HIST - } - hist pixelRowIDChip_nearAside_P1 { - algorithm = AFPBinContentComp - output = AFP/SiT/PixelRowIDChip - display = Draw=HIST - } - hist pixelRowIDChip_nearAside_P2 { - algorithm = AFPBinContentComp - output = AFP/SiT/PixelRowIDChip - display = Draw=HIST - } - hist pixelRowIDChip_nearAside_P3 { - algorithm = AFPBinContentComp - output = AFP/SiT/PixelRowIDChip - display = Draw=HIST - } - hist pixelRowIDChip_farAside_P0 { - algorithm = AFPBinContentComp - output = AFP/SiT/PixelRowIDChip - display = Draw=HIST - } - hist pixelRowIDChip_farAside_P1 { - algorithm = AFPBinContentComp - output = AFP/SiT/PixelRowIDChip - display = Draw=HIST - } - hist pixelRowIDChip_farAside_P2 { - algorithm = AFPBinContentComp - output = AFP/SiT/PixelRowIDChip - display = Draw=HIST - } - hist pixelRowIDChip_farAside_P3 { - algorithm = AFPBinContentComp - output = AFP/SiT/PixelRowIDChip - display = Draw=HIST - } - hist pixelRowIDChip_nearCside_P0 { - algorithm = AFPBinContentComp - output = AFP/SiT/PixelRowIDChip - display = Draw=HIST - } - hist pixelRowIDChip_nearCside_P1 { - algorithm = AFPBinContentComp - output = AFP/SiT/PixelRowIDChip - display = Draw=HIST - } - hist pixelRowIDChip_nearCside_P2 { - algorithm = AFPBinContentComp - output = AFP/SiT/PixelRowIDChip - display = Draw=HIST - } - hist pixelRowIDChip_nearCside_P3 { - algorithm = AFPBinContentComp - output = AFP/SiT/PixelRowIDChip - display = Draw=HIST - } - hist pixelRowIDChip_farCside_P0 { - algorithm = AFPBinContentComp - output = AFP/SiT/PixelRowIDChip - display = Draw=HIST - } - hist pixelRowIDChip_farCside_P1 { - algorithm = AFPBinContentComp - output = AFP/SiT/PixelRowIDChip - display = Draw=HIST - } - hist pixelRowIDChip_farCside_P2 { - algorithm = AFPBinContentComp - output = AFP/SiT/PixelRowIDChip - display = Draw=HIST - } - hist pixelRowIDChip_farCside_P3 { - algorithm = AFPBinContentComp - output = AFP/SiT/PixelRowIDChip - display = Draw=HIST + dir nearAside { + hist pixelRowIDChip_nearAside_P0 { + algorithm = AFPBinContentComp + output = AFP/SiT/PixelRowIDChip/nearAside + display = Draw=HIST + } + hist pixelRowIDChip_nearAside_P1 { + algorithm = AFPBinContentComp + output = AFP/SiT/PixelRowIDChip/nearAside + display = Draw=HIST + } + hist pixelRowIDChip_nearAside_P2 { + algorithm = AFPBinContentComp + output = AFP/SiT/PixelRowIDChip/nearAside + display = Draw=HIST + } + hist pixelRowIDChip_nearAside_P3 { + algorithm = AFPBinContentComp + output = AFP/SiT/PixelRowIDChip/nearAside + display = Draw=HIST + } + } + dir farAside { + hist pixelRowIDChip_farAside_P0 { + algorithm = AFPBinContentComp + output = AFP/SiT/PixelRowIDChip/farAside + display = Draw=HIST + } + hist pixelRowIDChip_farAside_P1 { + algorithm = AFPBinContentComp + output = AFP/SiT/PixelRowIDChip/farAside + display = Draw=HIST + } + hist pixelRowIDChip_farAside_P2 { + algorithm = AFPBinContentComp + output = AFP/SiT/PixelRowIDChip/farAside + display = Draw=HIST + } + hist pixelRowIDChip_farAside_P3 { + algorithm = AFPBinContentComp + output = AFP/SiT/PixelRowIDChip/farAside + display = Draw=HIST + } + } + dir nearCside { + hist pixelRowIDChip_nearCside_P0 { + algorithm = AFPBinContentComp + output = AFP/SiT/PixelRowIDChip/nearCside + display = Draw=HIST + } + hist pixelRowIDChip_nearCside_P1 { + algorithm = AFPBinContentComp + output = AFP/SiT/PixelRowIDChip/nearCside + display = Draw=HIST + } + hist pixelRowIDChip_nearCside_P2 { + algorithm = AFPBinContentComp + output = AFP/SiT/PixelRowIDChip/nearCside + display = Draw=HIST + } + hist pixelRowIDChip_nearCside_P3 { + algorithm = AFPBinContentComp + output = AFP/SiT/PixelRowIDChip/nearCside + display = Draw=HIST + } + } + dir farCside { + hist pixelRowIDChip_farCside_P0 { + algorithm = AFPBinContentComp + output = AFP/SiT/PixelRowIDChip/farCside + display = Draw=HIST + } + hist pixelRowIDChip_farCside_P1 { + algorithm = AFPBinContentComp + output = AFP/SiT/PixelRowIDChip/farCside + display = Draw=HIST + } + hist pixelRowIDChip_farCside_P2 { + algorithm = AFPBinContentComp + output = AFP/SiT/PixelRowIDChip/farCside + display = Draw=HIST + } + hist pixelRowIDChip_farCside_P3 { + algorithm = AFPBinContentComp + output = AFP/SiT/PixelRowIDChip/farCside + display = Draw=HIST + } } } dir SiTimeOverThreshold { - hist timeOverThreshold_nearAside_P0 { - algorithm = AFPBinContentComp - output = AFP/SiT/SiTimeOverThreshold - display = Draw=HIST - } - hist timeOverThreshold_nearAside_P1 { - algorithm = AFPBinContentComp - output = AFP/SiT/SiTimeOverThreshold - display = Draw=HIST - } - hist timeOverThreshold_nearAside_P2 { - algorithm = AFPBinContentComp - output = AFP/SiT/SiTimeOverThreshold - display = Draw=HIST - } - hist timeOverThreshold_nearAside_P3 { - algorithm = AFPBinContentComp - output = AFP/SiT/SiTimeOverThreshold - display = Draw=HIST - } - hist timeOverThreshold_farAside_P0 { - algorithm = AFPBinContentComp - output = AFP/SiT/SiTimeOverThreshold - display = Draw=HIST - } - hist timeOverThreshold_farAside_P1 { - algorithm = AFPBinContentComp - output = AFP/SiT/SiTimeOverThreshold - display = Draw=HIST - } - hist timeOverThreshold_farAside_P2 { - algorithm = AFPBinContentComp - output = AFP/SiT/SiTimeOverThreshold - display = Draw=HIST - } - hist timeOverThreshold_farAside_P3 { - algorithm = AFPBinContentComp - output = AFP/SiT/SiTimeOverThreshold - display = Draw=HIST - } - hist timeOverThreshold_nearCside_P0 { - algorithm = AFPBinContentComp - output = AFP/SiT/SiTimeOverThreshold - display = Draw=HIST + dir nearAside { + hist timeOverThreshold_nearAside_P0 { + algorithm = AFPBinContentComp + output = AFP/SiT/SiTimeOverThreshold/nearAside + display = Draw=HIST + } + hist timeOverThreshold_nearAside_P1 { + algorithm = AFPBinContentComp + output = AFP/SiT/SiTimeOverThreshold/nearAside + display = Draw=HIST + } + hist timeOverThreshold_nearAside_P2 { + algorithm = AFPBinContentComp + output = AFP/SiT/SiTimeOverThreshold/nearAside + display = Draw=HIST + } + hist timeOverThreshold_nearAside_P3 { + algorithm = AFPBinContentComp + output = AFP/SiT/SiTimeOverThreshold/nearAside + display = Draw=HIST + } + } + dir farAside { + hist timeOverThreshold_farAside_P0 { + algorithm = AFPBinContentComp + output = AFP/SiT/SiTimeOverThreshold/farAside + display = Draw=HIST + } + hist timeOverThreshold_farAside_P1 { + algorithm = AFPBinContentComp + output = AFP/SiT/SiTimeOverThreshold/farAside + display = Draw=HIST + } + hist timeOverThreshold_farAside_P2 { + algorithm = AFPBinContentComp + output = AFP/SiT/SiTimeOverThreshold/farAside + display = Draw=HIST + } + hist timeOverThreshold_farAside_P3 { + algorithm = AFPBinContentComp + output = AFP/SiT/SiTimeOverThreshold/farAside + display = Draw=HIST + } + } + dir nearCside { + hist timeOverThreshold_nearCside_P0 { + algorithm = AFPBinContentComp + output = AFP/SiT/SiTimeOverThreshold/nearCside + display = Draw=HIST + } + hist timeOverThreshold_nearCside_P1 { + algorithm = AFPBinContentComp + output = AFP/SiT/SiTimeOverThreshold/nearCside + display = Draw=HIST + } + hist timeOverThreshold_nearCside_P2 { + algorithm = AFPBinContentComp + output = AFP/SiT/SiTimeOverThreshold/nearCside + display = Draw=HIST + } + hist timeOverThreshold_nearCside_P3 { + algorithm = AFPBinContentComp + output = AFP/SiT/SiTimeOverThreshold/nearCside + display = Draw=HIST + } + } + dir farCside { + hist timeOverThreshold_farCside_P0 { + algorithm = AFPBinContentComp + output = AFP/SiT/SiTimeOverThreshold/farCside + display = Draw=HIST + } + hist timeOverThreshold_farCside_P1 { + algorithm = AFPBinContentComp + output = AFP/SiT/SiTimeOverThreshold/farCside + display = Draw=HIST + } + hist timeOverThreshold_farCside_P2 { + algorithm = AFPBinContentComp + output = AFP/SiT/SiTimeOverThreshold/farCside + display = Draw=HIST + } + hist timeOverThreshold_farCside_P3 { + algorithm = AFPBinContentComp + output = AFP/SiT/SiTimeOverThreshold/farCside + display = Draw=HIST + } } - hist timeOverThreshold_nearCside_P1 { - algorithm = AFPBinContentComp - output = AFP/SiT/SiTimeOverThreshold - display = Draw=HIST - } - hist timeOverThreshold_nearCside_P2 { - algorithm = AFPBinContentComp - output = AFP/SiT/SiTimeOverThreshold - display = Draw=HIST - } - hist timeOverThreshold_nearCside_P3 { - algorithm = AFPBinContentComp - output = AFP/SiT/SiTimeOverThreshold + } + dir HitsPerPlanes { + hist planeHitsAll { + algorithm = HNE + output = AFP/SiT/HitsPerPlanes display = Draw=HIST } - hist timeOverThreshold_farCside_P0 { + hist planeHits_nearAside { algorithm = AFPBinContentComp - output = AFP/SiT/SiTimeOverThreshold + output = AFP/SiT/HitsPerPlanes display = Draw=HIST } - hist timeOverThreshold_farCside_P1 { + hist planeHits_nearCside { algorithm = AFPBinContentComp - output = AFP/SiT/SiTimeOverThreshold + output = AFP/SiT/HitsPerPlanes display = Draw=HIST } - hist timeOverThreshold_farCside_P2 { + hist planeHits_farAside { algorithm = AFPBinContentComp - output = AFP/SiT/SiTimeOverThreshold + output = AFP/SiT/HitsPerPlanes display = Draw=HIST } - hist timeOverThreshold_farCside_P3 { + hist planeHits_farCside { algorithm = AFPBinContentComp - output = AFP/SiT/SiTimeOverThreshold + output = AFP/SiT/HitsPerPlanes display = Draw=HIST } } dir Cluster { - hist clusterX_vs_clusterY_nearAside_P0 { - algorithm = HNE - output = AFP/SiT/Cluster - display = LogZ,Draw=COLZ - } - hist clusterX_vs_clusterY_nearAside_P1 { - algorithm = HNE - output = AFP/SiT/Cluster - display = LogZ,Draw=COLZ - } - hist clusterX_vs_clusterY_nearAside_P2 { - algorithm = HNE - output = AFP/SiT/Cluster - display = LogZ,Draw=COLZ - } - hist clusterX_vs_clusterY_nearAside_P3 { - algorithm = HNE - output = AFP/SiT/Cluster - display = LogZ,Draw=COLZ - } - hist clusterX_vs_clusterY_farAside_P0 { - algorithm = HNE - output = AFP/SiT/Cluster - display = LogZ,Draw=COLZ - } - hist clusterX_vs_clusterY_farAside_P1 { - algorithm = HNE - output = AFP/SiT/Cluster - display = LogZ,Draw=COLZ - } - hist clusterX_vs_clusterY_farAside_P2 { - algorithm = HNE - output = AFP/SiT/Cluster - display = LogZ,Draw=COLZ - } - hist clusterX_vs_clusterY_farAside_P3 { - algorithm = HNE - output = AFP/SiT/Cluster - display = LogZ,Draw=COLZ - } - hist clusterX_vs_clusterY_nearCside_P0 { - algorithm = HNE - output = AFP/SiT/Cluster - display = LogZ,Draw=COLZ - } - hist clusterX_vs_clusterY_nearCside_P1 { - algorithm = HNE - output = AFP/SiT/Cluster - display = LogZ,Draw=COLZ - } - hist clusterX_vs_clusterY_nearCside_P2 { - algorithm = HNE - output = AFP/SiT/Cluster - display = LogZ,Draw=COLZ - } - hist clusterX_vs_clusterY_nearCside_P3 { - algorithm = HNE - output = AFP/SiT/Cluster - display = LogZ,Draw=COLZ - } - hist clusterX_vs_clusterY_farCside_P0 { - algorithm = HNE - output = AFP/SiT/Cluster - display = LogZ,Draw=COLZ - } - hist clusterX_vs_clusterY_farCside_P1 { - algorithm = HNE - output = AFP/SiT/Cluster - display = LogZ,Draw=COLZ - } - hist clusterX_vs_clusterY_farCside_P2 { - algorithm = HNE - output = AFP/SiT/Cluster - display = LogZ,Draw=COLZ - } - hist clusterX_vs_clusterY_farCside_P3 { - algorithm = HNE - output = AFP/SiT/Cluster - display = LogZ,Draw=COLZ + dir nearAside { + hist clusterX_vs_clusterY_nearAside_P0 { + algorithm = HNE + output = AFP/SiT/Cluster/nearAside + display = LogZ,Draw=COLZ + } + hist clusterX_vs_clusterY_nearAside_P1 { + algorithm = HNE + output = AFP/SiT/Cluster/nearAside + display = LogZ,Draw=COLZ + } + hist clusterX_vs_clusterY_nearAside_P2 { + algorithm = HNE + output = AFP/SiT/Cluster/nearAside + display = LogZ,Draw=COLZ + } + hist clusterX_vs_clusterY_nearAside_P3 { + algorithm = HNE + output = AFP/SiT/Cluster/nearAside + display = LogZ,Draw=COLZ + } + } + dir farAside { + hist clusterX_vs_clusterY_farAside_P0 { + algorithm = HNE + output = AFP/SiT/Cluster/farAside + display = LogZ,Draw=COLZ + } + hist clusterX_vs_clusterY_farAside_P1 { + algorithm = HNE + output = AFP/SiT/Cluster/farAside + display = LogZ,Draw=COLZ + } + hist clusterX_vs_clusterY_farAside_P2 { + algorithm = HNE + output = AFP/SiT/Cluster/farAside + display = LogZ,Draw=COLZ + } + hist clusterX_vs_clusterY_farAside_P3 { + algorithm = HNE + output = AFP/SiT/Cluster/farAside + display = LogZ,Draw=COLZ + } + } + dir nearCside { + hist clusterX_vs_clusterY_nearCside_P0 { + algorithm = HNE + output = AFP/SiT/Cluster/nearCside + display = LogZ,Draw=COLZ + } + hist clusterX_vs_clusterY_nearCside_P1 { + algorithm = HNE + output = AFP/SiT/Cluster/nearCside + display = LogZ,Draw=COLZ + } + hist clusterX_vs_clusterY_nearCside_P2 { + algorithm = HNE + output = AFP/SiT/Cluster/nearCside + display = LogZ,Draw=COLZ + } + hist clusterX_vs_clusterY_nearCside_P3 { + algorithm = HNE + output = AFP/SiT/Cluster/nearCside + display = LogZ,Draw=COLZ + } + } + dir farCside { + hist clusterX_vs_clusterY_farCside_P0 { + algorithm = HNE + output = AFP/SiT/Cluster/farCside + display = LogZ,Draw=COLZ + } + hist clusterX_vs_clusterY_farCside_P1 { + algorithm = HNE + output = AFP/SiT/Cluster/farCside + display = LogZ,Draw=COLZ + } + hist clusterX_vs_clusterY_farCside_P2 { + algorithm = HNE + output = AFP/SiT/Cluster/farCside + display = LogZ,Draw=COLZ + } + hist clusterX_vs_clusterY_farCside_P3 { + algorithm = HNE + output = AFP/SiT/Cluster/farCside + display = LogZ,Draw=COLZ + } } } dir Track { @@ -492,331 +639,363 @@ dir AFP { } } dir clustersPerPlane { - hist clustersPerPlane_vs_lb_farAside_P0 { - algorithm = HNE - output = AFP/SiT/clustersPerPlane - display = Draw=COLZ - } - hist clustersPerPlane_vs_lb_farAside_P1 { - algorithm = HNE - output = AFP/SiT/clustersPerPlane - display = Draw=COLZ - } - hist clustersPerPlane_vs_lb_farAside_P2 { - algorithm = HNE - output = AFP/SiT/clustersPerPlane - display = Draw=COLZ - } - hist clustersPerPlane_vs_lb_farAside_P3 { - algorithm = HNE - output = AFP/SiT/clustersPerPlane - display = Draw=COLZ - } - hist clustersPerPlane_vs_lb_nearAside_P0 { - algorithm = HNE - output = AFP/SiT/clustersPerPlane - display = Draw=COLZ - } - hist clustersPerPlane_vs_lb_nearAside_P1 { - algorithm = HNE - output = AFP/SiT/clustersPerPlane - display = Draw=COLZ - } - hist clustersPerPlane_vs_lb_nearAside_P2 { - algorithm = HNE - output = AFP/SiT/clustersPerPlane - display = Draw=COLZ - } - hist clustersPerPlane_vs_lb_nearAside_P3 { - algorithm = HNE - output = AFP/SiT/clustersPerPlane - display = Draw=COLZ - } - hist clustersPerPlane_vs_lb_farCside_P0 { - algorithm = HNE - output = AFP/SiT/clustersPerPlane - display = Draw=COLZ - } - hist clustersPerPlane_vs_lb_farCside_P1 { - algorithm = HNE - output = AFP/SiT/clustersPerPlane - display = Draw=COLZ - } - hist clustersPerPlane_vs_lb_farCside_P2 { - algorithm = HNE - output = AFP/SiT/clustersPerPlane - display = Draw=COLZ - } - hist clustersPerPlane_vs_lb_farCside_P3 { - algorithm = HNE - output = AFP/SiT/clustersPerPlane - display = Draw=COLZ - } - hist clustersPerPlane_vs_lb_nearCside_P0 { - algorithm = HNE - output = AFP/SiT/clustersPerPlane - display = Draw=COLZ - } - hist clustersPerPlane_vs_lb_nearCside_P1 { - algorithm = HNE - output = AFP/SiT/clustersPerPlane - display = Draw=COLZ - } - hist clustersPerPlane_vs_lb_nearCside_P2 { - algorithm = HNE - output = AFP/SiT/clustersPerPlane - display = Draw=COLZ - } - hist clustersPerPlane_vs_lb_nearCside_P3 { - algorithm = HNE - output = AFP/SiT/clustersPerPlane - display = Draw=COLZ + dir farAside { + hist clustersPerPlane_vs_lb_farAside_P0 { + algorithm = HNE + output = AFP/SiT/clustersPerPlane/farAside + display = Draw=COLZ + } + hist clustersPerPlane_vs_lb_farAside_P1 { + algorithm = HNE + output = AFP/SiT/clustersPerPlane/farAside + display = Draw=COLZ + } + hist clustersPerPlane_vs_lb_farAside_P2 { + algorithm = HNE + output = AFP/SiT/clustersPerPlane/farAside + display = Draw=COLZ + } + hist clustersPerPlane_vs_lb_farAside_P3 { + algorithm = HNE + output = AFP/SiT/clustersPerPlane/farAside + display = Draw=COLZ + } + } + dir nearAside { + hist clustersPerPlane_vs_lb_nearAside_P0 { + algorithm = HNE + output = AFP/SiT/clustersPerPlane/nearAside + display = Draw=COLZ + } + hist clustersPerPlane_vs_lb_nearAside_P1 { + algorithm = HNE + output = AFP/SiT/clustersPerPlane/nearAside + display = Draw=COLZ + } + hist clustersPerPlane_vs_lb_nearAside_P2 { + algorithm = HNE + output = AFP/SiT/clustersPerPlane/nearAside + display = Draw=COLZ + } + hist clustersPerPlane_vs_lb_nearAside_P3 { + algorithm = HNE + output = AFP/SiT/clustersPerPlane/nearAside + display = Draw=COLZ + } + } + dir farCside { + hist clustersPerPlane_vs_lb_farCside_P0 { + algorithm = HNE + output = AFP/SiT/clustersPerPlane/farCside + display = Draw=COLZ + } + hist clustersPerPlane_vs_lb_farCside_P1 { + algorithm = HNE + output = AFP/SiT/clustersPerPlane/farCside + display = Draw=COLZ + } + hist clustersPerPlane_vs_lb_farCside_P2 { + algorithm = HNE + output = AFP/SiT/clustersPerPlane/farCside + display = Draw=COLZ + } + hist clustersPerPlane_vs_lb_farCside_P3 { + algorithm = HNE + output = AFP/SiT/clustersPerPlane/farCside + display = Draw=COLZ + } + } + dir nearCside { + hist clustersPerPlane_vs_lb_nearCside_P0 { + algorithm = HNE + output = AFP/SiT/clustersPerPlane/nearCside + display = Draw=COLZ + } + hist clustersPerPlane_vs_lb_nearCside_P1 { + algorithm = HNE + output = AFP/SiT/clustersPerPlane/nearCside + display = Draw=COLZ + } + hist clustersPerPlane_vs_lb_nearCside_P2 { + algorithm = HNE + output = AFP/SiT/clustersPerPlane/nearCside + display = Draw=COLZ + } + hist clustersPerPlane_vs_lb_nearCside_P3 { + algorithm = HNE + output = AFP/SiT/clustersPerPlane/nearCside + display = Draw=COLZ + } } } dir clustersPerPlaneFront { - hist clustersPerPlaneFront_vs_lb_farAside_P0 { - algorithm = HNE - output = AFP/SiT/clustersPerPlaneFront - display = Draw=COLZ - } - hist clustersPerPlaneFront_vs_lb_farAside_P1 { - algorithm = HNE - output = AFP/SiT/clustersPerPlaneFront - display = Draw=COLZ - } - hist clustersPerPlaneFront_vs_lb_farAside_P2 { - algorithm = HNE - output = AFP/SiT/clustersPerPlaneFront - display = Draw=COLZ - } - hist clustersPerPlaneFront_vs_lb_farAside_P3 { - algorithm = HNE - output = AFP/SiT/clustersPerPlaneFront - display = Draw=COLZ - } - hist clustersPerPlaneFront_vs_lb_nearAside_P0 { - algorithm = HNE - output = AFP/SiT/clustersPerPlaneFront - display = Draw=COLZ - } - hist clustersPerPlaneFront_vs_lb_nearAside_P1 { - algorithm = HNE - output = AFP/SiT/clustersPerPlaneFront - display = Draw=COLZ - } - hist clustersPerPlaneFront_vs_lb_nearAside_P2 { - algorithm = HNE - output = AFP/SiT/clustersPerPlaneFront - display = Draw=COLZ - } - hist clustersPerPlaneFront_vs_lb_nearAside_P3 { - algorithm = HNE - output = AFP/SiT/clustersPerPlaneFront - display = Draw=COLZ - } - hist clustersPerPlaneFront_vs_lb_farCside_P0 { - algorithm = HNE - output = AFP/SiT/clustersPerPlaneFront - display = Draw=COLZ - } - hist clustersPerPlaneFront_vs_lb_farCside_P1 { - algorithm = HNE - output = AFP/SiT/clustersPerPlaneFront - display = Draw=COLZ - } - hist clustersPerPlaneFront_vs_lb_farCside_P2 { - algorithm = HNE - output = AFP/SiT/clustersPerPlaneFront - display = Draw=COLZ - } - hist clustersPerPlaneFront_vs_lb_farCside_P3 { - algorithm = HNE - output = AFP/SiT/clustersPerPlaneFront - display = Draw=COLZ - } - hist clustersPerPlaneFront_vs_lb_nearCside_P0 { - algorithm = HNE - output = AFP/SiT/clustersPerPlaneFront - display = Draw=COLZ - } - hist clustersPerPlaneFront_vs_lb_nearCside_P1 { - algorithm = HNE - output = AFP/SiT/clustersPerPlaneFront - display = Draw=COLZ - } - hist clustersPerPlaneFront_vs_lb_nearCside_P2 { - algorithm = HNE - output = AFP/SiT/clustersPerPlaneFront - display = Draw=COLZ - } - hist clustersPerPlaneFront_vs_lb_nearCside_P3 { - algorithm = HNE - output = AFP/SiT/clustersPerPlaneFront - display = Draw=COLZ + dir farAside { + hist clustersPerPlaneFront_vs_lb_farAside_P0 { + algorithm = HNE + output = AFP/SiT/clustersPerPlaneFront/farAside + display = Draw=COLZ + } + hist clustersPerPlaneFront_vs_lb_farAside_P1 { + algorithm = HNE + output = AFP/SiT/clustersPerPlaneFront/farAside + display = Draw=COLZ + } + hist clustersPerPlaneFront_vs_lb_farAside_P2 { + algorithm = HNE + output = AFP/SiT/clustersPerPlaneFront/farAside + display = Draw=COLZ + } + hist clustersPerPlaneFront_vs_lb_farAside_P3 { + algorithm = HNE + output = AFP/SiT/clustersPerPlaneFront/farAside + display = Draw=COLZ + } + } + dir nearAside { + hist clustersPerPlaneFront_vs_lb_nearAside_P0 { + algorithm = HNE + output = AFP/SiT/clustersPerPlaneFront/nearAside + display = Draw=COLZ + } + hist clustersPerPlaneFront_vs_lb_nearAside_P1 { + algorithm = HNE + output = AFP/SiT/clustersPerPlaneFront/nearAside + display = Draw=COLZ + } + hist clustersPerPlaneFront_vs_lb_nearAside_P2 { + algorithm = HNE + output = AFP/SiT/clustersPerPlaneFront/nearAside + display = Draw=COLZ + } + hist clustersPerPlaneFront_vs_lb_nearAside_P3 { + algorithm = HNE + output = AFP/SiT/clustersPerPlaneFront/nearAside + display = Draw=COLZ + } + } + dir farCside { + hist clustersPerPlaneFront_vs_lb_farCside_P0 { + algorithm = HNE + output = AFP/SiT/clustersPerPlaneFront/farCside + display = Draw=COLZ + } + hist clustersPerPlaneFront_vs_lb_farCside_P1 { + algorithm = HNE + output = AFP/SiT/clustersPerPlaneFront/farCside + display = Draw=COLZ + } + hist clustersPerPlaneFront_vs_lb_farCside_P2 { + algorithm = HNE + output = AFP/SiT/clustersPerPlaneFront/farCside + display = Draw=COLZ + } + hist clustersPerPlaneFront_vs_lb_farCside_P3 { + algorithm = HNE + output = AFP/SiT/clustersPerPlaneFront/farCside + display = Draw=COLZ + } + } + dir nearCside { + hist clustersPerPlaneFront_vs_lb_nearCside_P0 { + algorithm = HNE + output = AFP/SiT/clustersPerPlaneFront/nearCside + display = Draw=COLZ + } + hist clustersPerPlaneFront_vs_lb_nearCside_P1 { + algorithm = HNE + output = AFP/SiT/clustersPerPlaneFront/nearCside + display = Draw=COLZ + } + hist clustersPerPlaneFront_vs_lb_nearCside_P2 { + algorithm = HNE + output = AFP/SiT/clustersPerPlaneFront/nearCside + display = Draw=COLZ + } + hist clustersPerPlaneFront_vs_lb_nearCside_P3 { + algorithm = HNE + output = AFP/SiT/clustersPerPlaneFront/nearCside + display = Draw=COLZ + } } } dir clustersPerPlaneEnd { - hist clustersPerPlaneEnd_vs_lb_farAside_P0 { - algorithm = HNE - output = AFP/SiT/clustersPerPlaneEnd - display = Draw=COLZ - } - hist clustersPerPlaneEnd_vs_lb_farAside_P1 { - algorithm = HNE - output = AFP/SiT/clustersPerPlaneEnd - display = Draw=COLZ - } - hist clustersPerPlaneEnd_vs_lb_farAside_P2 { - algorithm = HNE - output = AFP/SiT/clustersPerPlaneEnd - display = Draw=COLZ - } - hist clustersPerPlaneEnd_vs_lb_farAside_P3 { - algorithm = HNE - output = AFP/SiT/clustersPerPlaneEnd - display = Draw=COLZ - } - hist clustersPerPlaneEnd_vs_lb_nearAside_P0 { - algorithm = HNE - output = AFP/SiT/clustersPerPlaneEnd - display = Draw=COLZ - } - hist clustersPerPlaneEnd_vs_lb_nearAside_P1 { - algorithm = HNE - output = AFP/SiT/clustersPerPlaneEnd - display = Draw=COLZ - } - hist clustersPerPlaneEnd_vs_lb_nearAside_P2 { - algorithm = HNE - output = AFP/SiT/clustersPerPlaneEnd - display = Draw=COLZ - } - hist clustersPerPlaneEnd_vs_lb_nearAside_P3 { - algorithm = HNE - output = AFP/SiT/clustersPerPlaneEnd - display = Draw=COLZ - } - hist clustersPerPlaneEnd_vs_lb_farCside_P0 { - algorithm = HNE - output = AFP/SiT/clustersPerPlaneEnd - display = Draw=COLZ - } - hist clustersPerPlaneEnd_vs_lb_farCside_P1 { - algorithm = HNE - output = AFP/SiT/clustersPerPlaneEnd - display = Draw=COLZ - } - hist clustersPerPlaneEnd_vs_lb_farCside_P2 { - algorithm = HNE - output = AFP/SiT/clustersPerPlaneEnd - display = Draw=COLZ - } - hist clustersPerPlaneEnd_vs_lb_farCside_P3 { - algorithm = HNE - output = AFP/SiT/clustersPerPlaneEnd - display = Draw=COLZ - } - hist clustersPerPlaneEnd_vs_lb_nearCside_P0 { - algorithm = HNE - output = AFP/SiT/clustersPerPlaneEnd - display = Draw=COLZ - } - hist clustersPerPlaneEnd_vs_lb_nearCside_P1 { - algorithm = HNE - output = AFP/SiT/clustersPerPlaneEnd - display = Draw=COLZ - } - hist clustersPerPlaneEnd_vs_lb_nearCside_P2 { - algorithm = HNE - output = AFP/SiT/clustersPerPlaneEnd - display = Draw=COLZ - } - hist clustersPerPlaneEnd_vs_lb_nearCside_P3 { - algorithm = HNE - output = AFP/SiT/clustersPerPlaneEnd - display = Draw=COLZ + dir farAside { + hist clustersPerPlaneEnd_vs_lb_farAside_P0 { + algorithm = HNE + output = AFP/SiT/clustersPerPlaneEnd/farAside + display = Draw=COLZ + } + hist clustersPerPlaneEnd_vs_lb_farAside_P1 { + algorithm = HNE + output = AFP/SiT/clustersPerPlaneEnd/farAside + display = Draw=COLZ + } + hist clustersPerPlaneEnd_vs_lb_farAside_P2 { + algorithm = HNE + output = AFP/SiT/clustersPerPlaneEnd/farAside + display = Draw=COLZ + } + hist clustersPerPlaneEnd_vs_lb_farAside_P3 { + algorithm = HNE + output = AFP/SiT/clustersPerPlaneEnd/farAside + display = Draw=COLZ + } + } + dir nearAside { + hist clustersPerPlaneEnd_vs_lb_nearAside_P0 { + algorithm = HNE + output = AFP/SiT/clustersPerPlaneEnd/nearAside + display = Draw=COLZ + } + hist clustersPerPlaneEnd_vs_lb_nearAside_P1 { + algorithm = HNE + output = AFP/SiT/clustersPerPlaneEnd/nearAside + display = Draw=COLZ + } + hist clustersPerPlaneEnd_vs_lb_nearAside_P2 { + algorithm = HNE + output = AFP/SiT/clustersPerPlaneEnd/nearAside + display = Draw=COLZ + } + hist clustersPerPlaneEnd_vs_lb_nearAside_P3 { + algorithm = HNE + output = AFP/SiT/clustersPerPlaneEnd/nearAside + display = Draw=COLZ + } + } + dir farCside { + hist clustersPerPlaneEnd_vs_lb_farCside_P0 { + algorithm = HNE + output = AFP/SiT/clustersPerPlaneEnd/farCside + display = Draw=COLZ + } + hist clustersPerPlaneEnd_vs_lb_farCside_P1 { + algorithm = HNE + output = AFP/SiT/clustersPerPlaneEnd/farCside + display = Draw=COLZ + } + hist clustersPerPlaneEnd_vs_lb_farCside_P2 { + algorithm = HNE + output = AFP/SiT/clustersPerPlaneEnd/farCside + display = Draw=COLZ + } + hist clustersPerPlaneEnd_vs_lb_farCside_P3 { + algorithm = HNE + output = AFP/SiT/clustersPerPlaneEnd/farCside + display = Draw=COLZ + } + } + dir nearCside { + hist clustersPerPlaneEnd_vs_lb_nearCside_P0 { + algorithm = HNE + output = AFP/SiT/clustersPerPlaneEnd/nearCside + display = Draw=COLZ + } + hist clustersPerPlaneEnd_vs_lb_nearCside_P1 { + algorithm = HNE + output = AFP/SiT/clustersPerPlaneEnd/nearCside + display = Draw=COLZ + } + hist clustersPerPlaneEnd_vs_lb_nearCside_P2 { + algorithm = HNE + output = AFP/SiT/clustersPerPlaneEnd/nearCside + display = Draw=COLZ + } + hist clustersPerPlaneEnd_vs_lb_nearCside_P3 { + algorithm = HNE + output = AFP/SiT/clustersPerPlaneEnd/nearCside + display = Draw=COLZ + } } } dir clustersPerPlaneMiddle { - hist clustersPerPlaneMiddle_vs_lb_farAside_P0 { - algorithm = HNE - output = AFP/SiT/clustersPerPlaneMiddle - display = Draw=COLZ - } - hist clustersPerPlaneMiddle_vs_lb_farAside_P1 { - algorithm = HNE - output = AFP/SiT/clustersPerPlaneMiddle - display = Draw=COLZ - } - hist clustersPerPlaneMiddle_vs_lb_farAside_P2 { - algorithm = HNE - output = AFP/SiT/clustersPerPlaneMiddle - display = Draw=COLZ - } - hist clustersPerPlaneMiddle_vs_lb_farAside_P3 { - algorithm = HNE - output = AFP/SiT/clustersPerPlaneMiddle - display = Draw=COLZ - } - hist clustersPerPlaneMiddle_vs_lb_nearAside_P0 { - algorithm = HNE - output = AFP/SiT/clustersPerPlaneMiddle - display = Draw=COLZ - } - hist clustersPerPlaneMiddle_vs_lb_nearAside_P1 { - algorithm = HNE - output = AFP/SiT/clustersPerPlaneMiddle - display = Draw=COLZ - } - hist clustersPerPlaneMiddle_vs_lb_nearAside_P2 { - algorithm = HNE - output = AFP/SiT/clustersPerPlaneMiddle - display = Draw=COLZ - } - hist clustersPerPlaneMiddle_vs_lb_nearAside_P3 { - algorithm = HNE - output = AFP/SiT/clustersPerPlaneMiddle - display = Draw=COLZ - } - hist clustersPerPlaneMiddle_vs_lb_farCside_P0 { - algorithm = HNE - output = AFP/SiT/clustersPerPlaneMiddle - display = Draw=COLZ - } - hist clustersPerPlaneMiddle_vs_lb_farCside_P1 { - algorithm = HNE - output = AFP/SiT/clustersPerPlaneMiddle - display = Draw=COLZ - } - hist clustersPerPlaneMiddle_vs_lb_farCside_P2 { - algorithm = HNE - output = AFP/SiT/clustersPerPlaneMiddle - display = Draw=COLZ - } - hist clustersPerPlaneMiddle_vs_lb_farCside_P3 { - algorithm = HNE - output = AFP/SiT/clustersPerPlaneMiddle - display = Draw=COLZ - } - hist clustersPerPlaneMiddle_vs_lb_nearCside_P0 { - algorithm = HNE - output = AFP/SiT/clustersPerPlaneMiddle - display = Draw=COLZ - } - hist clustersPerPlaneMiddle_vs_lb_nearCside_P1 { - algorithm = HNE - output = AFP/SiT/clustersPerPlaneMiddle - display = Draw=COLZ - } - hist clustersPerPlaneMiddle_vs_lb_nearCside_P2 { - algorithm = HNE - output = AFP/SiT/clustersPerPlaneMiddle - display = Draw=COLZ - } - hist clustersPerPlaneMiddle_vs_lb_nearCside_P3 { - algorithm = HNE - output = AFP/SiT/clustersPerPlaneMiddle - display = Draw=COLZ + dir farAside { + hist clustersPerPlaneMiddle_vs_lb_farAside_P0 { + algorithm = HNE + output = AFP/SiT/clustersPerPlaneMiddle/farAside + display = Draw=COLZ + } + hist clustersPerPlaneMiddle_vs_lb_farAside_P1 { + algorithm = HNE + output = AFP/SiT/clustersPerPlaneMiddle/farAside + display = Draw=COLZ + } + hist clustersPerPlaneMiddle_vs_lb_farAside_P2 { + algorithm = HNE + output = AFP/SiT/clustersPerPlaneMiddle/farAside + display = Draw=COLZ + } + hist clustersPerPlaneMiddle_vs_lb_farAside_P3 { + algorithm = HNE + output = AFP/SiT/clustersPerPlaneMiddle/farAside + display = Draw=COLZ + } + } + dir nearAside { + hist clustersPerPlaneMiddle_vs_lb_nearAside_P0 { + algorithm = HNE + output = AFP/SiT/clustersPerPlaneMiddle/nearAside + display = Draw=COLZ + } + hist clustersPerPlaneMiddle_vs_lb_nearAside_P1 { + algorithm = HNE + output = AFP/SiT/clustersPerPlaneMiddle/nearAside + display = Draw=COLZ + } + hist clustersPerPlaneMiddle_vs_lb_nearAside_P2 { + algorithm = HNE + output = AFP/SiT/clustersPerPlaneMiddle/nearAside + display = Draw=COLZ + } + hist clustersPerPlaneMiddle_vs_lb_nearAside_P3 { + algorithm = HNE + output = AFP/SiT/clustersPerPlaneMiddle/nearAside + display = Draw=COLZ + } + } + dir farCside { + hist clustersPerPlaneMiddle_vs_lb_farCside_P0 { + algorithm = HNE + output = AFP/SiT/clustersPerPlaneMiddle/farCside + display = Draw=COLZ + } + hist clustersPerPlaneMiddle_vs_lb_farCside_P1 { + algorithm = HNE + output = AFP/SiT/clustersPerPlaneMiddle/farCside + display = Draw=COLZ + } + hist clustersPerPlaneMiddle_vs_lb_farCside_P2 { + algorithm = HNE + output = AFP/SiT/clustersPerPlaneMiddle/farCside + display = Draw=COLZ + } + hist clustersPerPlaneMiddle_vs_lb_farCside_P3 { + algorithm = HNE + output = AFP/SiT/clustersPerPlaneMiddle/farCside + display = Draw=COLZ + } + } + dir nearCside { + hist clustersPerPlaneMiddle_vs_lb_nearCside_P0 { + algorithm = HNE + output = AFP/SiT/clustersPerPlaneMiddle/nearCside + display = Draw=COLZ + } + hist clustersPerPlaneMiddle_vs_lb_nearCside_P1 { + algorithm = HNE + output = AFP/SiT/clustersPerPlaneMiddle/nearCside + display = Draw=COLZ + } + hist clustersPerPlaneMiddle_vs_lb_nearCside_P2 { + algorithm = HNE + output = AFP/SiT/clustersPerPlaneMiddle/nearCside + display = Draw=COLZ + } + hist clustersPerPlaneMiddle_vs_lb_nearCside_P3 { + algorithm = HNE + output = AFP/SiT/clustersPerPlaneMiddle/nearCside + display = Draw=COLZ + } } } dir clustersPerStation { @@ -935,6 +1114,62 @@ dir AFP { display = Draw=COLZ } } + dir HitsPerBarsInTrain { + hist barInTrainAllA { + algorithm = HNE + output = AFP/ToF/HitsPerBarsInTrain + display = Draw=COLZ + } + hist barInTrainAllC { + algorithm = HNE + output = AFP/ToF/HitsPerBarsInTrain + display = Draw=COLZ + } + dir farAside { + hist barInTrainIDA_train0 { + algorithm = AFPBinContentComp + output = AFP/ToF/HitsPerBarsInTrain/farAside + display = Draw=COLZ + } + hist barInTrainIDA_train1 { + algorithm = AFPBinContentComp + output = AFP/ToF/HitsPerBarsInTrain/farAside + display = Draw=COLZ + } + hist barInTrainIDA_train2 { + algorithm = AFPBinContentComp + output = AFP/ToF/HitsPerBarsInTrain/farAside + display = Draw=COLZ + } + hist barInTrainIDA_train3 { + algorithm = AFPBinContentComp + output = AFP/ToF/HitsPerBarsInTrain/farAside + display = Draw=COLZ + } + } + dir farCside { + hist barInTrainIDC_train0 { + algorithm = AFPBinContentComp + output = AFP/ToF/HitsPerBarsInTrain/farCside + display = Draw=COLZ + } + hist barInTrainIDC_train1 { + algorithm = AFPBinContentComp + output = AFP/ToF/HitsPerBarsInTrain/farCside + display = Draw=COLZ + } + hist barInTrainIDC_train2 { + algorithm = AFPBinContentComp + output = AFP/ToF/HitsPerBarsInTrain/farCside + display = Draw=COLZ + } + hist barInTrainIDC_train3 { + algorithm = AFPBinContentComp + output = AFP/ToF/HitsPerBarsInTrain/farCside + display = Draw=COLZ + } + } + } } } @@ -952,7 +1187,7 @@ algorithm AFPBinContentComp { thresholds = AFPTestThreshold NSigma = 3 reference = AFPBinContentReference - publish = 1 + publish = 4 NormRef = 1 } ############################################################ @@ -962,8 +1197,8 @@ algorithm AFPBinContentComp { # Thresholds thresholds AFPTestThreshold { limits NBins { - warning = 3 - error = 5 + warning = 0 + error = 1 } } ########################################################### diff --git a/DataQuality/DataQualityInterfaces/CMakeLists.txt b/DataQuality/DataQualityInterfaces/CMakeLists.txt index 5082eaa1373918493ed92843cf5c8d6331d2a79b..80334eebfd7e7f3096fba6f8d30d1bb85f6c68e6 100644 --- a/DataQuality/DataQualityInterfaces/CMakeLists.txt +++ b/DataQuality/DataQualityInterfaces/CMakeLists.txt @@ -47,7 +47,7 @@ atlas_add_executable( han atlas_add_executable( han-config-gen src/han_config_gen.cxx - LINK_LIBRARIES DataQualityInterfaces ) + LINK_LIBRARIES DataQualityInterfaces CxxUtils ) atlas_add_executable( han-config-print src/han_config_print.cxx diff --git a/DataQuality/DataQualityInterfaces/src/han_config_gen.cxx b/DataQuality/DataQualityInterfaces/src/han_config_gen.cxx index 5a569247e132b212797850a1ef128ea129622184..d792f0050545820802f7dd266129807a78b7dbf1 100644 --- a/DataQuality/DataQualityInterfaces/src/han_config_gen.cxx +++ b/DataQuality/DataQualityInterfaces/src/han_config_gen.cxx @@ -13,6 +13,9 @@ #include "DataQualityInterfaces/HanConfig.h" #include "DataQualityInterfaces/ConditionsSingleton.h" +#include "CxxUtils/ubsan_suppress.h" +#include "TInterpreter.h" + namespace { void usage( const std::string& command_name, int exit_code ); @@ -36,6 +39,8 @@ public: int main( int argc, char *argv[] ) { + CxxUtils::ubsan_suppress ([]() { TInterpreter::Instance(); }); + CmdLineArgs arg( argc, argv ); std::string infileName( arg.mconfig ); diff --git a/DataQuality/DataQualityTools/DataQualityTools/DQTBackgroundMon.h b/DataQuality/DataQualityTools/DataQualityTools/DQTBackgroundMon.h index 6e12617d9fb3ff84a7ed5d26af03732fd06d6f0c..4f1118dfa66441118348878f1712b424b8ca306b 100644 --- a/DataQuality/DataQualityTools/DataQualityTools/DQTBackgroundMon.h +++ b/DataQuality/DataQualityTools/DataQualityTools/DQTBackgroundMon.h @@ -33,7 +33,6 @@ private: template <class T> using GP = Gaudi::Property<T>; // Activates trigger and muon parts of the algorithm - GP<bool> m_doTrigger {this, "Trigger", true}; GP<bool> m_doMuons {this, "Muons", true}; // StoreGate keys diff --git a/DataQuality/DataQualityTools/python/DQTLumiMonAlg.py b/DataQuality/DataQualityTools/python/DQTLumiMonAlg.py index 38e58dd84a9664c59d73ee1f4d3a55958c0c386a..2d1b17a757f864f4e8e52af99e659e64f9fca45d 100644 --- a/DataQuality/DataQualityTools/python/DQTLumiMonAlg.py +++ b/DataQuality/DataQualityTools/python/DQTLumiMonAlg.py @@ -15,11 +15,12 @@ def DQTLumiMonAlgConfig(flags, isOld=False): helper = AthMonitorCfgHelper(flags, 'DQTLumiMonAlgCfg') # Three instances of the algorithm. One using any trigger, another using only muon # triggers, and the final using only electron triggers. - DQTLumiMonAlgConfigByTriggerChain(helper, DQTLumiMonAlg) - DQTLumiMonAlgConfigByTriggerChain(helper, DQTLumiMonAlg, - 'CATEGORY_monitoring_muonIso','EF_muX') - DQTLumiMonAlgConfigByTriggerChain(helper, DQTLumiMonAlg, - 'CATEGORY_primary_single_ele','EF_eX') + DQTLumiMonAlgConfigByTriggerChain(helper, DQTLumiMonAlg, flags, isOld) + if (flags.useTrigger if isOld else flags.DQ.useTrigger): + DQTLumiMonAlgConfigByTriggerChain(helper, DQTLumiMonAlg, flags, isOld, + 'CATEGORY_monitoring_muonIso','EF_muX') + DQTLumiMonAlgConfigByTriggerChain(helper, DQTLumiMonAlg, flags, isOld, + 'CATEGORY_primary_single_ele','EF_eX') if isOld: return helper.result() else: @@ -28,7 +29,7 @@ def DQTLumiMonAlgConfig(flags, isOld=False): result.merge(AtlasGeometryCfg(flags)) return result -def DQTLumiMonAlgConfigByTriggerChain(helper, algConfObj, triggerChain='', triggerPath=''): +def DQTLumiMonAlgConfigByTriggerChain(helper, algConfObj, flags, isOld, triggerChain='', triggerPath=''): monAlg = helper.addAlgorithm(algConfObj, 'DQTLumiMonAlg'+triggerPath) if triggerChain: @@ -49,6 +50,16 @@ def DQTLumiMonAlgConfigByTriggerChain(helper, algConfObj, triggerChain='', trigg monAlg.TightTrackWeight = 0.01 monAlg.TightNTracks = 4 + if isOld: + from RecExConfig.AutoConfiguration import GetLBNumber + lbnum = GetLBNumber() + lbdict = { 'xmin': lbnum-0.5 if lbnum>0 else 0.5, + 'xmax': lbnum+0.5 if lbnum>0 else 1.5 } + else: + lbdict = { 'xmin': min(flags.Input.LumiBlockNumber)-0.5 if flags.Input.LumiBlockNumber else 0.5, + 'xmax': max(flags.Input.LumiBlockNumber)+0.5 if flags.Input.LumiBlockNumber else 1.5 } + lbdict['xbins'] = int(lbdict['xmax']-lbdict['xmin']) + # Raw plots of lumi variables group.defineHistogram('avgIntPerXing', type='TH1F', xbins=100, xmin=0, xmax=100, title='Average number of interactions per bunch Xing') @@ -56,40 +67,46 @@ def DQTLumiMonAlgConfigByTriggerChain(helper, algConfObj, triggerChain='', trigg title='Actual number of interactions per bunch Xing') # Plots of luminosity variables as a function of lb number - group.defineHistogram('LB,avgLumi', type='TProfile', xbins=1000, xmin=0.5, xmax=1000.5, - title='Average Lumi vs LB', opt='kAddBinsDynamically', merge='merge') - group.defineHistogram('LB,avgIntPerXing', type='TProfile', xbins=1000, xmin=0.5, xmax=1000.5, + group.defineHistogram('LB,avgLumi', type='TProfile', + title='Average Lumi vs LB', opt='kAddBinsDynamically', + merge='merge', **lbdict) + group.defineHistogram('LB,avgIntPerXing', type='TProfile', title='Number of interactions per event;LB;<#mu>_{LB}', - opt='kAddBinsDynamically', merge='merge') - group.defineHistogram('LB,lumiPerBCID', type='TProfile', xbins=1000, xmin=0.5, xmax=1000.5, - title='Instantaneous Luminosity vs LB', opt='kAddBinsDynamically', merge='merge') - group.defineHistogram('LB,intPerXing', type='TProfile', xbins=1000, xmin=0.5, xmax=1000.5, - title='Instaneous interactions vs LB', opt='kAddBinsDynamically', merge='merge') - group.defineHistogram('LB,duration', type='TProfile', xbins=1000, xmin=0.5, xmax=1000.5, - title='Lumi Block time in sec vs LB', opt='kAddBinsDynamically', merge='merge') - group.defineHistogram('LB,avgLiveFrac', type='TProfile', xbins=1000, xmin=0.5, xmax=1000.5, + opt='kAddBinsDynamically', merge='merge', **lbdict) + group.defineHistogram('LB,lumiPerBCID', type='TProfile', + title='Instantaneous Luminosity vs LB', opt='kAddBinsDynamically', + merge='merge', **lbdict) + group.defineHistogram('LB,intPerXing', type='TProfile', + title='Instaneous interactions vs LB', opt='kAddBinsDynamically', + merge='merge', **lbdict) + group.defineHistogram('LB,duration', type='TProfile', + title='Lumi Block time in sec vs LB', opt='kAddBinsDynamically', + merge='merge', **lbdict) + group.defineHistogram('LB,avgLiveFrac', type='TProfile', title='Average live fraction lumi over all BCIDs vs LB', - opt='kAddBinsDynamically', merge='merge') - group.defineHistogram('LB,liveFracPerBCID', type='TProfile', xbins=1000, xmin=0.5, xmax=1000.5, - title='Current BCID lumi vs LB', opt='kAddBinsDynamically', merge='merge') - group.defineHistogram('LB,lumiWeight', type='TProfile', xbins=1000, xmin=0.5, xmax=1000.5, - title='Current BCID lumi vs LB', opt='kAddBinsDynamically', merge='merge') + opt='kAddBinsDynamically', merge='merge', **lbdict) + group.defineHistogram('LB,liveFracPerBCID', type='TProfile', + title='Current BCID lumi vs LB', opt='kAddBinsDynamically', + merge='merge', **lbdict) + group.defineHistogram('LB,lumiWeight', type='TProfile', + title='Current BCID lumi vs LB', opt='kAddBinsDynamically', + merge='merge', **lbdict) # Vertex counts vs. lb number (loose and tight) - group.defineHistogram('LB,nLooseVtx', type='TProfile', xbins=200, xmin=0.5, xmax=200.5, + group.defineHistogram('LB,nLooseVtx', type='TProfile', title=nLooseT+' per event;LB;<NlooseVtx/event>_{LB}', - opt='kAddBinsDynamically', merge='merge') - group.defineHistogram('LB,nTightVtx', type='TProfile', xbins=200, xmin=0.5, xmax=200.5, + opt='kAddBinsDynamically', merge='merge', **lbdict) + group.defineHistogram('LB,nTightVtx', type='TProfile', title=nTightT+' per event;LB;<NtightVtx/event>_{LB}', - opt='kAddBinsDynamically', merge='merge') + opt='kAddBinsDynamically', merge='merge', **lbdict) # Vertex counts per avg mu vs. lb number. (Same as above, just weighted.) group.defineHistogram('LB,nLooseVtxPerAvgMu', type='TProfile', opt='kAddBinsDynamically', - xbins=200, xmin=0.5, xmax=200.5, - title=nLooseT+' per event per Mu;LB;<NlooseVtx/event/#mu>_{LB}', merge='merge') + title=nLooseT+' per event per Mu;LB;<NlooseVtx/event/#mu>_{LB}', + merge='merge', **lbdict) group.defineHistogram('LB,nTightVtxPerAvgMu', type='TProfile', opt='kAddBinsDynamically', - xbins=200, xmin=0.5, xmax=200.5, - title=nTightT+' per event per Mu;LB;<NtightVtx/event/#mu>_{LB}', merge='merge') + title=nTightT+' per event per Mu;LB;<NtightVtx/event/#mu>_{LB}', + merge='merge', **lbdict) # Vertex counts vs. avg mu. group.defineHistogram('avgIntPerXing,nLooseVtx', type='TProfile', xbins=250, xmin=0, xmax=100, @@ -99,43 +116,43 @@ def DQTLumiMonAlgConfigByTriggerChain(helper, algConfObj, triggerChain='', trigg # Pixel clusters vs lb number. All, and then eparately for each endcap and barrel layer. pixelgroup.defineHistogram('LB,nClustersAll', type='TProfile', opt='kAddBinsDynamically', - xbins=200, xmin=0.5, xmax=200.5, - title=nPixClusterT+', all;LB;<NclustersAll/event>_{LB}', merge='merge') + title=nPixClusterT+', all;LB;<NclustersAll/event>_{LB}', + merge='merge', **lbdict) pixelgroup.defineHistogram('LB,nClustersECA', type='TProfile', opt='kAddBinsDynamically', - xbins=200, xmin=0.5, xmax=200.5, - title=nPixClusterT+', endcap A;LB;<NlustersECA/event>_{LB}', merge='merge') + title=nPixClusterT+', endcap A;LB;<NlustersECA/event>_{LB}', + merge='merge', **lbdict) pixelgroup.defineHistogram('LB,nClustersECC', type='TProfile', opt='kAddBinsDynamically', - xbins=200, xmin=0.5, xmax=200.5, - title=nPixClusterT+', endcap C;LB;<NclustersECC/event>_{LB}', merge='merge') + title=nPixClusterT+', endcap C;LB;<NclustersECC/event>_{LB}', + merge='merge', **lbdict) pixelgroup.defineHistogram('LB,nClustersB0', type='TProfile', opt='kAddBinsDynamically', - xbins=200, xmin=0.5, xmax=200.5, - title=nPixClusterT+', barrel layer 0;LB;<NclustersB0/event>_{LB}', merge='merge') + title=nPixClusterT+', barrel layer 0;LB;<NclustersB0/event>_{LB}', + merge='merge', **lbdict) pixelgroup.defineHistogram('LB,nClustersB1', type='TProfile', opt='kAddBinsDynamically', - xbins=200, xmin=0.5, xmax=200.5, - title=nPixClusterT+', barrel layer 1;LB;<NclustersB1/event>_{LB}', merge='merge') + title=nPixClusterT+', barrel layer 1;LB;<NclustersB1/event>_{LB}', + merge='merge', **lbdict) pixelgroup.defineHistogram('LB,nClustersB2', type='TProfile', opt='kAddBinsDynamically', - xbins=200, xmin=0.5, xmax=200.5, - title=nPixClusterT+', barrel layer 2;LB;<NclustersB2/event>_{LB}', merge='merge') + title=nPixClusterT+', barrel layer 2;LB;<NclustersB2/event>_{LB}', + merge='merge', **lbdict) # Pixel clusters per avg mu vs. lb number. (Same as above, just weighted.) pixelgroup.defineHistogram('LB,nClustersAllPerAvgMu', type='TProfile', opt='kAddBinsDynamically', - xbins=200, xmin=0.5, xmax=200.5, - title=nPixClusterT+' per Mu, all;LB;<NclustersAll/event/#mu>_{LB}', merge='merge') + title=nPixClusterT+' per Mu, all;LB;<NclustersAll/event/#mu>_{LB}', + merge='merge', **lbdict) pixelgroup.defineHistogram('LB,nClustersECAPerAvgMu', type='TProfile', opt='kAddBinsDynamically', - xbins=200, xmin=0.5, xmax=200.5, - title=nPixClusterT+' per Mu, endcap A;LB;<NlustersECA/event/#mu>_{LB}', merge='merge') + title=nPixClusterT+' per Mu, endcap A;LB;<NlustersECA/event/#mu>_{LB}', + merge='merge', **lbdict) pixelgroup.defineHistogram('LB,nClustersECCPerAvgMu', type='TProfile', opt='kAddBinsDynamically', - xbins=200, xmin=0.5, xmax=200.5, - title=nPixClusterT+' per Mu, endcap C;LB;<NclustersECC/event/#mu>_{LB}', merge='merge') + title=nPixClusterT+' per Mu, endcap C;LB;<NclustersECC/event/#mu>_{LB}', + merge='merge', **lbdict) pixelgroup.defineHistogram('LB,nClustersB0PerAvgMu', type='TProfile', opt='kAddBinsDynamically', - xbins=200, xmin=0.5, xmax=200.5, - title=nPixClusterT+' per Mu, barrel layer 0;LB;<NclustersB0/event/#mu>_{LB}', merge='merge') + title=nPixClusterT+' per Mu, barrel layer 0;LB;<NclustersB0/event/#mu>_{LB}', + merge='merge', **lbdict) pixelgroup.defineHistogram('LB,nClustersB1PerAvgMu', type='TProfile', opt='kAddBinsDynamically', - xbins=200, xmin=0.5, xmax=200.5, - title=nPixClusterT+' per Mu, barrel layer 1;LB;<NclustersB1/event/#mu>_{LB}', merge='merge') + title=nPixClusterT+' per Mu, barrel layer 1;LB;<NclustersB1/event/#mu>_{LB}', + merge='merge', **lbdict) pixelgroup.defineHistogram('LB,nClustersB2PerAvgMu', type='TProfile', opt='kAddBinsDynamically', - xbins=200, xmin=0.5, xmax=200.5, - title=nPixClusterT+' per Mu, barrel layer 2;LB;<NclustersB2/event/#mu>_{LB}', merge='merge') + title=nPixClusterT+' per Mu, barrel layer 2;LB;<NclustersB2/event/#mu>_{LB}', + merge='merge', **lbdict) # Pixel clusters vs. avg mu. All, then separately for each endcap and barrel layer. pixelgroup.defineHistogram('avgIntPerXing,nClustersAll', type='TProfile', diff --git a/DataQuality/DataQualityTools/src/DQTBackgroundMon.cxx b/DataQuality/DataQualityTools/src/DQTBackgroundMon.cxx index 35aa97ae4d398e11bef753249357a3581d4f0237..3d0489a1dad4d97cdbeffdd3ff7fb01a961e404c 100644 --- a/DataQuality/DataQualityTools/src/DQTBackgroundMon.cxx +++ b/DataQuality/DataQualityTools/src/DQTBackgroundMon.cxx @@ -43,7 +43,7 @@ StatusCode DQTBackgroundMon::fillHistograms( const EventContext& ctx ) const { RH<xAOD::VertexContainer> vertexContainer(m_VertexContainerKey,ctx); if ( eventInfo.isValid() ) { - if (m_doTrigger) { + if (!getTrigDecisionTool().empty()) { unsigned int bgCode = getTrigDecisionTool()->getBGCode(); filled = bgCode & (1<<m_filledBG); empty = bgCode & (1<<m_emptyBG); diff --git a/DataQuality/GoodRunsLists/CMakeLists.txt b/DataQuality/GoodRunsLists/CMakeLists.txt index 9683d2affca791902675e7fd3b35590c3629174e..4a5248f232287dd02007804dd096c746e5496781 100644 --- a/DataQuality/GoodRunsLists/CMakeLists.txt +++ b/DataQuality/GoodRunsLists/CMakeLists.txt @@ -15,15 +15,29 @@ atlas_add_root_dictionary( GoodRunsListsLib GoodRunsLists/DQHelperFunctions.h Root/LinkDef.h EXTERNAL_PACKAGES LibXml2 ROOT ) +if( NOT XAOD_STANDALONE ) + if( XAOD_ANALYSIS ) + set( extra_libs ) + else() + set( extra_libs DerivationFrameworkInterfaces ) + endif() +endif() + atlas_add_library( GoodRunsListsLib GoodRunsLists/*.h Root/*.cxx ${GoodRunsListsLibDictSource} PUBLIC_HEADERS GoodRunsLists INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} PRIVATE_INCLUDE_DIRS ${LIBXML2_INCLUDE_DIR} - LINK_LIBRARIES ${ROOT_LIBRARIES} AsgTools AsgAnalysisInterfaces + LINK_LIBRARIES ${ROOT_LIBRARIES} AsgTools xAODEventInfo AsgAnalysisInterfaces + AnaAlgorithmLib ${extra_libs} PRIVATE_LINK_LIBRARIES ${LIBXML2_LIBRARIES} PathResolver ) if( NOT XAOD_STANDALONE ) + if( XAOD_ANALYSIS ) + set( extra_libs ) + else() + set( extra_libs DetectorStatusLib ) + endif() atlas_add_component( GoodRunsLists src/*.cxx src/components/*.cxx LINK_LIBRARIES AthenaBaseComps AthenaKernel EventInfo GaudiKernel GoodRunsListsLib PathResolver StoreGateLib xAODEventInfo ) diff --git a/DataQuality/GoodRunsLists/src/GRLSelectorAlg.h b/DataQuality/GoodRunsLists/GoodRunsLists/GRLSelectorAlg.h similarity index 71% rename from DataQuality/GoodRunsLists/src/GRLSelectorAlg.h rename to DataQuality/GoodRunsLists/GoodRunsLists/GRLSelectorAlg.h index 6b3c7156a9dbf3922f3fa99c2b048fb435133780..e4a905a6fa285b504eea24ad6eb3fcae0c800008 100644 --- a/DataQuality/GoodRunsLists/src/GRLSelectorAlg.h +++ b/DataQuality/GoodRunsLists/GoodRunsLists/GRLSelectorAlg.h @@ -5,8 +5,9 @@ #ifndef GOODRUNSLISTS_GRLSELECTORALG_H #define GOODRUNSLISTS_GRLSELECTORALG_H 1 -#include "AthenaBaseComps/AthAlgorithm.h" -#include "GaudiKernel/ToolHandle.h" //included under assumption you'll want to use some tools! Remove if you don't! +#include <AnaAlgorithm/AnaAlgorithm.h> +#include <AnaAlgorithm/FilterReporterParams.h> +#include <AsgTools/ToolHandle.h> //included under assumption you'll want to use some tools! Remove if you don't! #include "AsgAnalysisInterfaces/IGoodRunsListSelectionTool.h" @@ -17,7 +18,7 @@ ///masterseq += CfgMgr.GRLSelectorAlg(Tool=ToolSvc.myGRLTool) -class GRLSelectorAlg: public ::AthAlgorithm { +class GRLSelectorAlg: public EL::AnaAlgorithm { public: GRLSelectorAlg( const std::string& name, ISvcLocator* pSvcLocator ); virtual ~GRLSelectorAlg(); @@ -28,9 +29,7 @@ class GRLSelectorAlg: public ::AthAlgorithm { private: ToolHandle<IGoodRunsListSelectionTool> m_grlTool; - int m_passed = 0; - int m_total = 0; - + EL::FilterReporterParams m_filterParams {this, "Good Runs Lists selection"}; }; #endif //> !GOODRUNSLISTS_GRLSELECTORALG_H diff --git a/DataQuality/GoodRunsLists/GoodRunsLists/GoodRunsListSelectionTool.h b/DataQuality/GoodRunsLists/GoodRunsLists/GoodRunsListSelectionTool.h index a732e8bec0a677c03b4715b8223d6690e889ad7e..adab65a5985d878057278f7f364379a834066867 100644 --- a/DataQuality/GoodRunsLists/GoodRunsLists/GoodRunsListSelectionTool.h +++ b/DataQuality/GoodRunsLists/GoodRunsLists/GoodRunsListSelectionTool.h @@ -18,6 +18,10 @@ #include "AsgAnalysisInterfaces/IGoodRunsListSelectionTool.h" #include "GoodRunsLists/TGRLCollection.h" +#ifndef XAOD_STANDALONE +#include "DerivationFrameworkInterfaces/ISkimmingTool.h" +#endif + /// Tool implementing the GRL selection /// /// This tool needs to be used to select good lumiblocks for a physics @@ -27,10 +31,13 @@ /// $Date$ /// class GoodRunsListSelectionTool : virtual public IGoodRunsListSelectionTool, +#ifndef XAOD_STANDALONE + virtual public DerivationFramework::ISkimmingTool, +#endif public asg::AsgTool { // Declare the proper constructor(s) for Athena: - ASG_TOOL_CLASS( GoodRunsListSelectionTool, IGoodRunsListSelectionTool ) + ASG_TOOL_CLASS2( GoodRunsListSelectionTool, IGoodRunsListSelectionTool, DerivationFramework::ISkimmingTool ) public: GoodRunsListSelectionTool( const std::string& name = @@ -72,6 +79,12 @@ public: return m_brlcollection; } +#ifndef XAOD_STANDALONE + /// ISkimmingTool method: + /// will retrieve eventInfo from storegate and use that with above methods + virtual bool eventPassesFilter() const; +#endif + /// @} protected: diff --git a/DataQuality/GoodRunsLists/GoodRunsLists/GoodRunsListsDict.h b/DataQuality/GoodRunsLists/GoodRunsLists/GoodRunsListsDict.h index cd881202c9dc6957f74ec7895568a864c71d1418..e1d09c4387c6c9fc550ca3bb44478795f56a390b 100644 --- a/DataQuality/GoodRunsLists/GoodRunsLists/GoodRunsListsDict.h +++ b/DataQuality/GoodRunsLists/GoodRunsLists/GoodRunsListsDict.h @@ -7,6 +7,7 @@ #include "GoodRunsLists/GoodRunsListSelectionTool.h" +#include "GoodRunsLists/GRLSelectorAlg.h" /* removed for now ... maybe move to AsgAnalysisInterfaces if need a dictionary for specific ToolHandle #include "AsgTools/ToolHandle.h" diff --git a/DataQuality/GoodRunsLists/GoodRunsLists/selection.xml b/DataQuality/GoodRunsLists/GoodRunsLists/selection.xml index 5ed3d8b5608eb77117a301d2cf5538b3e0ff6063..565d736f2a7c7ba09896c902e6696157a83658b9 100644 --- a/DataQuality/GoodRunsLists/GoodRunsLists/selection.xml +++ b/DataQuality/GoodRunsLists/GoodRunsLists/selection.xml @@ -2,6 +2,7 @@ <!-- GoodRunsListSelectionTool --> <class name="GoodRunsListSelectionTool" /> + <class name="GRLSelectorAlg" /> <exclusion> diff --git a/DataQuality/GoodRunsLists/src/GRLSelectorAlg.cxx b/DataQuality/GoodRunsLists/Root/GRLSelectorAlg.cxx similarity index 60% rename from DataQuality/GoodRunsLists/src/GRLSelectorAlg.cxx rename to DataQuality/GoodRunsLists/Root/GRLSelectorAlg.cxx index d42bae93bc202ecdce1dc0cd7b851e686ff89640..635ba1dda33a143357fa658399b69b4718fa2291 100644 --- a/DataQuality/GoodRunsLists/src/GRLSelectorAlg.cxx +++ b/DataQuality/GoodRunsLists/Root/GRLSelectorAlg.cxx @@ -3,12 +3,13 @@ */ // GoodRunsLists includes -#include "GRLSelectorAlg.h" - +#include <GoodRunsLists/GRLSelectorAlg.h> +#include <AnaAlgorithm/FilterReporter.h> +#include <AsgTools/MessageCheck.h> #include "xAODEventInfo/EventInfo.h" -GRLSelectorAlg::GRLSelectorAlg( const std::string& name, ISvcLocator* pSvcLocator ) : AthAlgorithm( name, pSvcLocator ) - , m_grlTool("GoodRunsListSelectionTool") +GRLSelectorAlg::GRLSelectorAlg( const std::string& name, ISvcLocator* pSvcLocator ) : AnaAlgorithm( name, pSvcLocator ) + , m_grlTool("GoodRunsListSelectionTool", this) { declareProperty( "Tool", m_grlTool , "The GoodRunsListSelectionTool" ); @@ -21,32 +22,27 @@ GRLSelectorAlg::~GRLSelectorAlg() {} StatusCode GRLSelectorAlg::initialize() { //ATH_MSG_INFO ("Initializing " << name() << "..."); - m_total=0; - m_passed=0; - CHECK( m_grlTool.retrieve() ); + ANA_CHECK( m_grlTool.retrieve() ); + ANA_CHECK( m_filterParams.initialize() ); return StatusCode::SUCCESS; } StatusCode GRLSelectorAlg::finalize() { // ATH_MSG_INFO ("Finalizing " << name() << "..."); - ATH_MSG_INFO("Events passing GRL " << m_grlTool.name() << " : " << m_passed << " / " << m_total); + ANA_CHECK (m_filterParams.finalize()); return StatusCode::SUCCESS; } StatusCode GRLSelectorAlg::execute() { - setFilterPassed(false); + EL::FilterReporter filter (m_filterParams, false); - m_total++; const xAOD::EventInfo* evtInfo = 0; - CHECK( evtStore()->retrieve( evtInfo ) ); + ANA_CHECK( evtStore()->retrieve( evtInfo, "EventInfo" ) ); if(!m_grlTool->passRunLB(*evtInfo)) return StatusCode::SUCCESS; - m_passed++; - setFilterPassed(true); + filter.setPassed (true); return StatusCode::SUCCESS; } - - diff --git a/DataQuality/GoodRunsLists/Root/GoodRunsListSelectionTool.cxx b/DataQuality/GoodRunsLists/Root/GoodRunsListSelectionTool.cxx index 614abebf631d17b6ce1738952a3afdb3026f85a7..3057c5858f9994ef6a4e8ab7cdd3b11945a770ef 100644 --- a/DataQuality/GoodRunsLists/Root/GoodRunsListSelectionTool.cxx +++ b/DataQuality/GoodRunsLists/Root/GoodRunsListSelectionTool.cxx @@ -184,3 +184,14 @@ GoodRunsListSelectionTool::readXMLs( Root::TGRLCollection& grl, // Return gracefully: return StatusCode::SUCCESS; } + +#ifndef XAOD_STANDALONE +bool GoodRunsListSelectionTool::eventPassesFilter() const { + const xAOD::EventInfo* ei = 0; + if( evtStore()->retrieve( ei , "EventInfo" ).isFailure() ) { + ATH_MSG_ERROR("Unable to retrieve EventInfo, returning false"); + return false; + } + return passRunLB( *ei ); +} +#endif diff --git a/DataQuality/GoodRunsLists/src/GoodRunsListSelectorTool.cxx b/DataQuality/GoodRunsLists/src/GoodRunsListSelectorTool.cxx index a2ffa589077a57fa9445603a934c5a99dd8d2f18..0cdad5ee15df77bc7999ab2fab099b5466519f55 100644 --- a/DataQuality/GoodRunsLists/src/GoodRunsListSelectorTool.cxx +++ b/DataQuality/GoodRunsLists/src/GoodRunsListSelectorTool.cxx @@ -1,3 +1,5 @@ +#ifndef XAOD_ANALYSIS + /* Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration */ @@ -358,3 +360,4 @@ GoodRunsListSelectorTool::registerGRLSelector(const std::string& name, const std return true; } +#endif // XAOD_ANALYSIS diff --git a/DataQuality/GoodRunsLists/src/components/GoodRunsLists_entries.cxx b/DataQuality/GoodRunsLists/src/components/GoodRunsLists_entries.cxx index 388feacfcbcdef7fd19ffcf3d3cfd7c9ebae7f41..40dbca4064c8a1d73707feb41119dfeea34c1343 100644 --- a/DataQuality/GoodRunsLists/src/components/GoodRunsLists_entries.cxx +++ b/DataQuality/GoodRunsLists/src/components/GoodRunsLists_entries.cxx @@ -1,12 +1,9 @@ #include "GoodRunsLists/GoodRunsListSelectorTool.h" #include "GoodRunsLists/TriggerRegistryTool.h" #include "GoodRunsLists/GoodRunsListSelectionTool.h" +#include "GoodRunsLists/GRLSelectorAlg.h" DECLARE_COMPONENT( GoodRunsListSelectorTool ) DECLARE_COMPONENT( GoodRunsListSelectionTool ) DECLARE_COMPONENT( TriggerRegistryTool ) - - -#include "../GRLSelectorAlg.h" DECLARE_COMPONENT( GRLSelectorAlg ) - diff --git a/Database/APR/RootCollection/CMakeLists.txt b/Database/APR/RootCollection/CMakeLists.txt index 86c23f101f15090976de2b82923931a5769f87de..ac58b3fca44ff34c5eccf0ebe5b639055acbd263 100644 --- a/Database/APR/RootCollection/CMakeLists.txt +++ b/Database/APR/RootCollection/CMakeLists.txt @@ -24,8 +24,8 @@ atlas_add_library( RootCollection FileCatalog GaudiKernel POOLCore PersistencySvc PersistentDataModel RootUtils ) atlas_add_library( RootCollectionComponents - NO_PUBLIC_HEADERS src/components/*.cpp + NO_PUBLIC_HEADERS LINK_LIBRARIES CollectionBase RootCollection ) atlas_add_test( read_test diff --git a/Database/AthenaPOOL/AthenaPoolCnvSvc/python/ReadAthenaPool.py b/Database/AthenaPOOL/AthenaPoolCnvSvc/python/ReadAthenaPool.py index 3e5503f4349d357695052262cda628c0ea575b87..26dbaebe095d6413e6c28dc9e32c3059b4ae990e 100644 --- a/Database/AthenaPOOL/AthenaPoolCnvSvc/python/ReadAthenaPool.py +++ b/Database/AthenaPOOL/AthenaPoolCnvSvc/python/ReadAthenaPool.py @@ -1,4 +1,4 @@ -# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration ## @file ReadAthena.py ## @brief AthenaPool python module for reading event objects. @@ -59,26 +59,26 @@ def _configureReadAthenaPool(): # Add in EventSelector svcMgr += CfgMgr.EventSelectorAthenaPool ("EventSelector") #default InputCollections to FilesInput value of AthenaCommonFlags - from AthenaCommon.JobProperties import jobproperties as jps + from AthenaCommon.AthenaCommonFlags import jobproperties as jps svcMgr.EventSelector.InputCollections = jps.AthenaCommonFlags.FilesInput() - + _n = svcMgr.EventSelector.getFullJobOptName() theApp.EvtSel = _n del _n # For Analysis release use lower heartbeat - import os - if "AthAnalysisBase" in os.environ.get('CMTEXTRATAGS',""): - # From Will Buttinger to suppress the event loop heartbeat as it is somewhat I/O hungry for - # no real gain in analysis scenarii - if not hasattr(svcMgr, theApp.EventLoop): - svcMgr += getattr(CfgMgr, theApp.EventLoop)() - evtloop = getattr(svcMgr, theApp.EventLoop) - try: - evtloop.EventPrintoutInterval = 10000 + import os + if "AthAnalysisBase" in os.environ.get('CMTEXTRATAGS',""): + # From Will Buttinger to suppress the event loop heartbeat as it is somewhat I/O hungry for + # no real gain in analysis scenarii + if not hasattr(svcMgr, theApp.EventLoop): + svcMgr += getattr(CfgMgr, theApp.EventLoop)() + evtloop = getattr(svcMgr, theApp.EventLoop) + try: + evtloop.EventPrintoutInterval = 10000 except Exception: - msg.info('failed suppressing event loop heartbeat. performances might be sub-par... sorry.') - pass + msg.info('failed suppressing event loop heartbeat. performances might be sub-par... sorry.') + pass # Add in AthenaPoolAddressProviderSvc if not hasattr (svcMgr, 'AthenaPoolAddressProviderSvc'): diff --git a/Database/AthenaPOOL/OutputStreamAthenaPool/CMakeLists.txt b/Database/AthenaPOOL/OutputStreamAthenaPool/CMakeLists.txt index 3f4529a4a7c98344c04e3c467b570c50cf48601e..e9a6c33a4379d9b3f005e608bb48802aea7e27a8 100644 --- a/Database/AthenaPOOL/OutputStreamAthenaPool/CMakeLists.txt +++ b/Database/AthenaPOOL/OutputStreamAthenaPool/CMakeLists.txt @@ -11,7 +11,7 @@ atlas_add_component( OutputStreamAthenaPool src/EventInfoAttListTool.cxx src/EventInfoTagBuilder.cxx src/components/*.cxx - LINK_LIBRARIES ${CORAL_LIBRARIES} AthenaBaseComps AthenaKernel EventInfo EventInfoUtils GaudiKernel PersistentDataModel StoreGateLib xAODEventInfo ) + LINK_LIBRARIES AthenaBaseComps AthenaKernel EventInfo EventInfoUtils GaudiKernel PersistentDataModel StoreGateLib xAODEventInfo ) # Install files from the package: atlas_install_python_modules( python/*.py POST_BUILD_CMD ${ATLAS_FLAKE8} ) diff --git a/Database/AthenaPOOL/OutputStreamAthenaPool/python/CreateOutputStreams.py b/Database/AthenaPOOL/OutputStreamAthenaPool/python/CreateOutputStreams.py index ffa782fb93c76fa42a3b1cfd5f6508308736415f..cb3d49ae862f6ac4548e4457bc520172fc6ffc66 100644 --- a/Database/AthenaPOOL/OutputStreamAthenaPool/python/CreateOutputStreams.py +++ b/Database/AthenaPOOL/OutputStreamAthenaPool/python/CreateOutputStreams.py @@ -7,6 +7,7 @@ from __future__ import print_function +from AthenaCommon import CfgMgr from AthenaCommon.AppMgr import ServiceMgr as svcMgr from AthenaServices.AthenaServicesConf import AthenaOutputStream from AthenaServices.AthenaServicesConf import AthenaOutputStreamTool @@ -22,6 +23,7 @@ def createOutputStream( streamName, fileName = "", asAlg = False, noTag = False, if trigNavThinningSvc is None: trigNavThinningSvc = _trigNavThinningSvcs.get (streamName, None) + # define athena output stream writingTool = AthenaOutputStreamTool( streamName + "Tool" ) outputStream = AthenaOutputStream( @@ -32,7 +34,10 @@ def createOutputStream( streamName, fileName = "", asAlg = False, noTag = False, outputStream.ExtraOutputs += [("DataHeader", "StoreGateSvc+" + streamName)] #outputStream.ItemList += [ "xAOD::EventInfo#*" ] outputStream.MetadataStore = svcMgr.MetaDataStore - outputStream.MetadataItemList = [ "EventStreamInfo#" + streamName, "IOVMetaDataContainer#*" ] + outputStream.MetadataItemList = [ + "EventStreamInfo#" + streamName, + "IOVMetaDataContainer#*", + ] ## get a handle on the default top-level algorithm sequence from AthenaCommon.AlgSequence import AlgSequence @@ -68,7 +73,15 @@ def createOutputStream( streamName, fileName = "", asAlg = False, noTag = False, streamInfoTool = MakeEventStreamInfo( streamName + "_MakeEventStreamInfo" ) streamInfoTool.Key = streamName streamInfoTool.EventInfoKey = eventInfoKey - outputStream.HelperTools = [ streamInfoTool ] + # for xAOD access, add EventFormat to all POOL output streams + # Key to use for event format on this stream + event_format_key = 'EventFormat{}'.format(streamName) + event_format_tool = CfgMgr.xAODMaker__EventFormatStreamHelperTool( + "{}_MakeEventFormat".format(streamName), + Key=event_format_key, + ) + outputStream.MetadataItemList += ["xAOD::EventFormat#{}".format(event_format_key)] + outputStream.HelperTools = [ streamInfoTool, event_format_tool] # Support for MT thinning. diff --git a/Database/AthenaPOOL/OutputStreamAthenaPool/python/MultipleStreamManager.py b/Database/AthenaPOOL/OutputStreamAthenaPool/python/MultipleStreamManager.py index 6dc8f05cb06f320eb2ffb24a8dee1e697a21007a..ea94a0686e6467c3966e8d496aa9719876aa18b4 100644 --- a/Database/AthenaPOOL/OutputStreamAthenaPool/python/MultipleStreamManager.py +++ b/Database/AthenaPOOL/OutputStreamAthenaPool/python/MultipleStreamManager.py @@ -558,8 +558,6 @@ class MultipleStreamManager: theStream = self.NewStream(StreamName,FileName,type='pool',asAlg=asAlg) from AthenaCommon.AppMgr import theApp svcMgr = theApp.serviceMgr() - theApp.CreateSvc += [ "xAODMaker::EventFormatSvc" ] - theStream.AddMetaDataItem("xAOD::EventFormat#EventFormat") from AthenaCommon import CfgMgr streamMarkUpTool = CfgMgr.xAODMaker__FileMetaDataMarkUpTool( StreamName + "_FileMetaDataMarkUpTool" ) diff --git a/Database/AthenaPOOL/OutputStreamAthenaPool/python/OutputStreamConfig.py b/Database/AthenaPOOL/OutputStreamAthenaPool/python/OutputStreamConfig.py index 336db1fff8c346d250ba6993b0b31e942f0ed446..4cf7ba9f51a0a9446ef8f816192d3db93b48ebdc 100644 --- a/Database/AthenaPOOL/OutputStreamAthenaPool/python/OutputStreamConfig.py +++ b/Database/AthenaPOOL/OutputStreamAthenaPool/python/OutputStreamConfig.py @@ -48,7 +48,10 @@ def OutputStreamCfg(configFlags, streamName, ItemList=[], disableEventTag=False outputStream.ExtraOutputs += [("DataHeader", "StoreGateSvc+" + streamName)] result.addService(StoreGateSvc("MetaDataStore")) outputStream.MetadataStore = result.getService("MetaDataStore") - outputStream.MetadataItemList = [ "EventStreamInfo#Stream" + streamName, "IOVMetaDataContainer#*" ] + outputStream.MetadataItemList = [ + "EventStreamInfo#Stream" + streamName, + "IOVMetaDataContainer#*", + ] # Event Tag if not disableEventTag: @@ -60,13 +63,20 @@ def OutputStreamCfg(configFlags, streamName, ItemList=[], disableEventTag=False Tool=EventInfoAttListTool()) result.addEventAlgo(tagBuilder) - # For xAOD output - if streamName=="xAOD": - xAODMaker__EventFormatSvc=CompFactory.xAODMaker.EventFormatSvc - # Simplifies naming - result.addService(xAODMaker__EventFormatSvc()) - outputStream.MetadataItemList.append( "xAOD::EventFormat#EventFormat" ) + # Make EventFormat object + event_format_key = 'EventFormat{}'.format(streamName) + event_format_tool = CompFactory.xAODMaker.EventFormatStreamHelperTool( + '{}_MakeEventFormat'.format(event_format_key), + Key=event_format_key, + ) + outputStream.HelperTools.append(event_format_tool) + # Simplifies naming + outputStream.MetadataItemList.append( + "xAOD::EventFormat#{}".format(event_format_key) + ) + # For xAOD output + if "xAOD" in streamName: xAODMaker__FileMetaDataMarkUpTool=CompFactory.xAODMaker.FileMetaDataMarkUpTool streamMarkUpTool = xAODMaker__FileMetaDataMarkUpTool( streamName + "_FileMetaDataMarkUpTool" ) streamMarkUpTool.Key = streamName diff --git a/Database/IOVDbMetaDataTools/src/IOVDbMetaDataTool.cxx b/Database/IOVDbMetaDataTools/src/IOVDbMetaDataTool.cxx index fd43710ca9f66c6df177b89951e1677d7e3a935a..c08d767dc144ecdb9977d0381e61d63cbd36b520 100755 --- a/Database/IOVDbMetaDataTools/src/IOVDbMetaDataTool.cxx +++ b/Database/IOVDbMetaDataTools/src/IOVDbMetaDataTool.cxx @@ -21,7 +21,6 @@ #include "StoreGate/StoreGate.h" #include "IOVDbDataModel/IOVMetaDataContainer.h" -#include "AthenaKernel/MetaCont.h" #include "CxxUtils/checker_macros.h" IOVDbMetaDataTool::IOVDbMetaDataTool(const std::string& type, @@ -127,8 +126,7 @@ StatusCode IOVDbMetaDataTool::endInputFile(const SG::SourceID&) StatusCode IOVDbMetaDataTool::metaDataStop() { - StatusCode sc = dumpMetaConts(); - return sc; + return StatusCode::SUCCESS; } //-------------------------------------------------------------------------- @@ -459,11 +457,6 @@ StatusCode IOVDbMetaDataTool::processInputFileMetaData(const std::string& fileNa IOVMetaDataContainer* contMaster = getMetaDataContainer(cont->folderName() , cont->folderDescription()); - // At the same time we want to create a new instance of IOVMetaDataContainer for new SID - // and store it into MetaCont<IOVMetaDataContainer> - IOVMetaDataContainer* newCont4Sid = new IOVMetaDataContainer(cont->folderName() - , cont->folderDescription()); - // We assume that the folder is the same for all versions, and // now we loop over versions for the payloads std::list<SG::ObjectWithVersion<IOVMetaDataContainer> > allVersions; @@ -537,20 +530,6 @@ StatusCode IOVDbMetaDataTool::processInputFileMetaData(const std::string& fileNa } } - // Do the same with newCont4Sid - { - // Should be ok. - StatusCode sc ATLAS_THREAD_SAFE = - modifyPayload (newCont4Sid->folderName(), coll); - if (!sc.isSuccess()) { - ATH_MSG_ERROR("processInputFileMetaData: Could not modify the payload for folder " << newCont4Sid->folderName()); - return StatusCode::FAILURE; - } - } - - // Before starting merging, make a copy for newCont4Sid - CondAttrListCollection* collCopy = new CondAttrListCollection(*coll); - ATH_MSG_VERBOSE("processInputFileMetaData: merge minRange: " << coll->minRange()); if (!contMaster->merge(coll)) { // Did not merge it in - was a duplicate, so we need to delete it @@ -563,16 +542,6 @@ StatusCode IOVDbMetaDataTool::processInputFileMetaData(const std::string& fileNa ATH_MSG_VERBOSE(" => merged "); } - ATH_MSG_VERBOSE("processInputFileMetaData: merge for MetaCont minRange: " << collCopy->minRange()); - if (!newCont4Sid->merge(collCopy)) { - // Did not merge it in - was a duplicate, so we need to delete it - delete collCopy; - ATH_MSG_VERBOSE(" => not merged "); - } - else { - ATH_MSG_VERBOSE(" => merged "); - } - } ATH_MSG_DEBUG("processInputFileMetaData: Merged together containers for folder " << cont->folderName() << " ncoll/ndup " << ncolls << " " << ndupColls); @@ -604,12 +573,6 @@ StatusCode IOVDbMetaDataTool::processInputFileMetaData(const std::string& fileNa } } - // Insert the merged container into MetaCont - if(fillMetaCont(fileName,newCont4Sid).isFailure()) { - ATH_MSG_ERROR("processInputFileMetaData: Failed to insert the merged IOVMetaDataContainer into MetaCont"); - return StatusCode::FAILURE; - } - // detailed printout after merge if (msgLvl(MSG::VERBOSE)) { const IOVPayloadContainer* payloadMaster = contMaster->payloadContainer(); diff --git a/Database/IOVDbSvc/python/CondDB.py b/Database/IOVDbSvc/python/CondDB.py index fc854f8f1c8b0b385d1f59127965445611024eb7..9dd4aebc60b7449e7135d2a67be33db2de67a881 100644 --- a/Database/IOVDbSvc/python/CondDB.py +++ b/Database/IOVDbSvc/python/CondDB.py @@ -267,7 +267,11 @@ This allows the possibility of later adding a new IOV using IOVSvc::setRange.""" if (self.iovdbsvc.Folders[i].find(folder)>=0): del self.iovdbsvc.Folders[i] break - + for i in range(0, len(condInputLoader.Load)): + if (condInputLoader.Load[i][-1] == self.extractFolder(folder)): + del condInputLoader.Load[i] + break + def folderRequested(self,folder): "Return true if the given folder has already been requested" for i in self.iovdbsvc.Folders: diff --git a/Database/RegistrationServices/CMakeLists.txt b/Database/RegistrationServices/CMakeLists.txt index a25ede806f78736b895a1b1e4eafb80e50301d3e..c20b14352e453d25de825697bbc8b1821589d14d 100644 --- a/Database/RegistrationServices/CMakeLists.txt +++ b/Database/RegistrationServices/CMakeLists.txt @@ -20,7 +20,7 @@ atlas_add_component( RegistrationServices src/IOVRegistrationSvc.cxx src/OutputConditionsAlg.cxx src/components/*.cxx - INCLUDE_DIRS ${COOL_INCLUDE_DIRS} ${ROOT_INCLUDE_DIRS} ${CORAL_INCLUDE_DIRS} + INCLUDE_DIRS ${COOL_INCLUDE_DIRS} ${CORAL_INCLUDE_DIRS} LINK_LIBRARIES ${COOL_LIBRARIES} ${CORAL_LIBRARIES} AthenaBaseComps AthenaKernel AthenaPoolUtilities CollectionBase DBDataModel FileCatalog IOVDbSvcLib PersistentDataModel PoolSvcLib RegistrationServicesLib SGTools StoreGateLib ) # Install files from the package: diff --git a/DetectorDescription/GeoModel/GeoAdaptors/GeoAdaptors/GeoCaloCalibHit.h b/DetectorDescription/GeoModel/GeoAdaptors/GeoAdaptors/GeoCaloCalibHit.h index 8582ff4b3b4df7395e39a85fc82827189be3fd62..daf243f23c9920d9d96c13b6858c06f6019783a3 100755 --- a/DetectorDescription/GeoModel/GeoAdaptors/GeoAdaptors/GeoCaloCalibHit.h +++ b/DetectorDescription/GeoModel/GeoAdaptors/GeoAdaptors/GeoCaloCalibHit.h @@ -1,9 +1,9 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ -#ifndef _GeoCaloCalibHit_h_ -#define _GeoCaloCalibHit_h_ +#ifndef GEOADAPTORS_GEOCALOCALIBHIT_H +#define GEOADAPTORS_GEOCALOCALIBHIT_H //----------------------------------------------------------// // // // Adaptor for CaloCalibHits. // @@ -68,13 +68,13 @@ class GeoCaloCalibHit const CaloDetDescrElement* getDetDescrElement() const; private: + static const CaloDetDescrManager* initDDMgr(); + const CaloDetDescrManager* ddmgr() const; void init(const std::string & collectionName); const CaloCalibrationHit *m_hit; - static const CaloIdManager *s_man; - static const CaloDM_ID *s_dmid; - static const CaloDetDescrManager *s_caloMan; + int m_subdet; int m_type; // i.e. in the barrel or in the endcap. int m_sampling; diff --git a/DetectorDescription/GeoModel/GeoAdaptors/GeoAdaptors/GeoCaloCalibHit.icc b/DetectorDescription/GeoModel/GeoAdaptors/GeoAdaptors/GeoCaloCalibHit.icc index a5bc0f8f70d97bc09934b4ea84a2748fe02bc361..39940a655b21c49e941f16a431151bc518d5ed4e 100755 --- a/DetectorDescription/GeoModel/GeoAdaptors/GeoAdaptors/GeoCaloCalibHit.icc +++ b/DetectorDescription/GeoModel/GeoAdaptors/GeoAdaptors/GeoCaloCalibHit.icc @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ //----------------------------------------------------------// @@ -11,8 +11,6 @@ // // // // //----------------------------------------------------------// -#include "StoreGate/StoreGateSvc.h" -#include "StoreGate/StoreGate.h" #include "CaloIdentifier/CaloIdManager.h" #include "CaloDetDescr/CaloDetDescrElement.h" @@ -21,9 +19,6 @@ #include "CaloDetDescr/CaloDetDescrManager.h" #include "CLHEP/Units/SystemOfUnits.h" -const CaloIdManager* GeoCaloCalibHit::s_man = 0; -const CaloDM_ID* GeoCaloCalibHit::s_dmid = 0; -const CaloDetDescrManager * GeoCaloCalibHit::s_caloMan = 0; #undef DEBUG_GEOHIT @@ -71,7 +66,8 @@ inline double GeoCaloCalibHit::phiMin() const { double dphi = m_ddElement->dphi(); return phi-dphi/2.0; } - int phiIndex=s_dmid->phi(m_hit->cellID()); // Dead material hits + const CaloDM_ID* dmid = ddmgr()->getCalo_Mgr()->getDM_ID(); + int phiIndex=dmid->phi(m_hit->cellID()); // Dead material hits int n_phi=32; if(abs(m_subdet) == 4 && m_type==2 && (m_region == 2 || m_region == 3) ) { n_phi=16; @@ -86,7 +82,8 @@ inline double GeoCaloCalibHit::phiMax() const { double dphi = m_ddElement->dphi(); return phi+dphi/2.0; } - int phiIndex=s_dmid->phi(m_hit->cellID()); // Dead material hits + const CaloDM_ID* dmid = ddmgr()->getCalo_Mgr()->getDM_ID(); + int phiIndex=dmid->phi(m_hit->cellID()); // Dead material hits int n_phi=32; if(abs(m_subdet) == 4 && m_type==2 && (m_region == 2 || m_region == 3) ) { n_phi=16; @@ -100,7 +97,8 @@ inline double GeoCaloCalibHit::phi() const { double phi = m_ddElement->phi(); return phi; } - int phiIndex=s_dmid->phi(m_hit->cellID()); // Dead material hits + const CaloDM_ID* dmid = ddmgr()->getCalo_Mgr()->getDM_ID(); + int phiIndex=dmid->phi(m_hit->cellID()); // Dead material hits int n_phi=32; if(abs(m_subdet) == 4 && m_type==2 && (m_region == 2 || m_region == 3) ) { n_phi=16; @@ -143,7 +141,8 @@ inline double GeoCaloCalibHit::eta() const { double eta = m_ddElement->eta(); return eta; } - int etaIndex=s_dmid->eta(m_hit->cellID()); // Dead material hits + const CaloDM_ID* dmid = ddmgr()->getCalo_Mgr()->getDM_ID(); + int etaIndex=dmid->eta(m_hit->cellID()); // Dead material hits double dEta = 0.1; if ((m_type==1 && m_sampling==3 && m_region==1) || (m_type==2 && m_region==3)) { @@ -151,7 +150,7 @@ inline double GeoCaloCalibHit::eta() const { } double etaCenter = m_etaOffset + (etaIndex+0.5)*dEta; - bool isNegative =s_dmid->pos_neg_z(m_hit->cellID())<0; + bool isNegative = dmid->pos_neg_z(m_hit->cellID())<0; if (isNegative) { etaCenter = -etaCenter; } @@ -204,24 +203,6 @@ inline void GeoCaloCalibHit::init(const std::string & collectionName) { return; } - StoreGateSvc *detStore = StoreGate::pointer("DetectorStore"); - - // Dead hits - if(detStore->retrieve(s_man).isFailure()) { - m_failed=true; - return; - } - if (s_man) s_dmid = s_man->getDM_ID(); - if (!s_dmid) { - m_failed=true; - return; - } - - // Active and Inactive hits - if(detStore->retrieve(s_caloMan).isFailure()) { - m_failed=true; - return; - } m_ddElement = getDetDescrElement(); //bool inactive = collectionName=="LArCalibrationHitInactive"; @@ -235,21 +216,23 @@ inline void GeoCaloCalibHit::init(const std::string & collectionName) { if (m_hitType==DEAD || m_hitType==TILEDM || m_hitType==TILEDEAD) { // Dead hits: LAr: m_subdet= +-4, Tile: m_subdet= +-5) // from Calorimeter/ CaloIdentifier/ CaloIdentifier/ CaloDM_ID.h - m_subdet = s_dmid->pos_neg_z(m_hit->cellID()); - m_type = s_dmid->dmat(m_hit->cellID()); - m_sampling = s_dmid->sampling(m_hit->cellID()); - m_region = s_dmid->region(m_hit->cellID()); - m_etaBin = s_dmid->eta(m_hit->cellID()); - m_phiBin = s_dmid->phi(m_hit->cellID()); + const CaloDM_ID* dmid = ddmgr()->getCalo_Mgr()->getDM_ID(); + m_subdet = dmid->pos_neg_z(m_hit->cellID()); + m_type = dmid->dmat(m_hit->cellID()); + m_sampling = dmid->sampling(m_hit->cellID()); + m_region = dmid->region(m_hit->cellID()); + m_etaBin = dmid->eta(m_hit->cellID()); + m_phiBin = dmid->phi(m_hit->cellID()); } else { // Active and Inactive hit ID from Calorimeter/ CaloIdentifier/ CaloIdentifier/ CaloCell_ID.h - m_subdet = 1 + s_caloMan->getCaloCell_ID()->sub_calo(m_hit->cellID()); - m_type = s_caloMan->getCaloCell_ID()->pos_neg(m_hit->cellID()); - m_sampling = s_caloMan->getCaloCell_ID()->calo_sample(m_hit->cellID()); - m_region = s_caloMan->getCaloCell_ID()->region(m_hit->cellID()); - m_etaBin = s_caloMan->getCaloCell_ID()->eta(m_hit->cellID()); - m_phiBin = s_caloMan->getCaloCell_ID()->phi(m_hit->cellID()); + const CaloDetDescrManager* caloMan = ddmgr(); + m_subdet = 1 + caloMan->getCaloCell_ID()->sub_calo(m_hit->cellID()); + m_type = caloMan->getCaloCell_ID()->pos_neg(m_hit->cellID()); + m_sampling = caloMan->getCaloCell_ID()->calo_sample(m_hit->cellID()); + m_region = caloMan->getCaloCell_ID()->region(m_hit->cellID()); + m_etaBin = caloMan->getCaloCell_ID()->eta(m_hit->cellID()); + m_phiBin = caloMan->getCaloCell_ID()->phi(m_hit->cellID()); } /* @@ -768,6 +751,6 @@ inline int GeoCaloCalibHit::region() const { inline const CaloDetDescrElement* GeoCaloCalibHit::getDetDescrElement() const { - if (m_hitType!=DEAD && m_hitType!=TILEDM && m_hitType!=TILEDEAD) return s_caloMan->get_element(m_hit->cellID()); + if (m_hitType!=DEAD && m_hitType!=TILEDM && m_hitType!=TILEDEAD) return ddmgr()->get_element(m_hit->cellID()); return NULL; } diff --git a/DetectorDescription/GeoModel/GeoAdaptors/GeoAdaptors/GeoLArHit.h b/DetectorDescription/GeoModel/GeoAdaptors/GeoAdaptors/GeoLArHit.h index 5d2d996b5a9f22888f842f37684e6bf098e52430..a49946965a5629aedc62785c6215567924c6bb3c 100755 --- a/DetectorDescription/GeoModel/GeoAdaptors/GeoAdaptors/GeoLArHit.h +++ b/DetectorDescription/GeoModel/GeoAdaptors/GeoAdaptors/GeoLArHit.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ #ifndef GEOADAPTORS_GEOLARHIT_H @@ -33,17 +33,16 @@ class GeoLArHit int SamplingLayer() const; // Underlying hit. - const LArHit &data() const { return *m_hit;} + const LArHit &data() const { return m_hit;} // Is this hit OK? - operator bool () const { return s_man; } + operator bool () const { return true; } private: - - static void init(); + static const CaloDetDescrManager* init(); + const CaloDetDescrManager* mgr() const; - const LArHit* m_hit; - static const CaloDetDescrManager *s_man; + const LArHit& m_hit; }; #include "GeoAdaptors/GeoLArHit.icc" diff --git a/DetectorDescription/GeoModel/GeoAdaptors/GeoAdaptors/GeoLArHit.icc b/DetectorDescription/GeoModel/GeoAdaptors/GeoAdaptors/GeoLArHit.icc index 130a83513e955580d43a09c27f23bbd1ab1ea8fb..512c135c80fc857123c0ff333c35dba1bd6cfd99 100755 --- a/DetectorDescription/GeoModel/GeoAdaptors/GeoAdaptors/GeoLArHit.icc +++ b/DetectorDescription/GeoModel/GeoAdaptors/GeoAdaptors/GeoLArHit.icc @@ -1,45 +1,34 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ -#include "StoreGate/StoreGateSvc.h" -#include "StoreGate/StoreGate.h" - #include "CaloDetDescr/CaloDetDescrManager.h" #include "CaloDetDescr/CaloDetDescrElement.h" #include "LArSimEvent/LArHitContainer.h" #include "CaloIdentifier/CaloCell_ID.h" -inline void GeoLArHit::init() -{ - StoreGateSvc *detStore = StoreGate::pointer("DetectorStore"); - if(detStore->retrieve(s_man).isFailure()) - std::cout << "GeoLArHit::init() WARNING Unable to retrieve CaloDetDescrManager!" << std::endl; -} - inline GeoLArHit::GeoLArHit(const LArHit & h) + : m_hit (h) { - m_hit = &h; - if(!s_man) init(); } inline const CaloDetDescrElement* GeoLArHit::getDetDescrElement() const { - return s_man->get_element(m_hit->cellID()); + return mgr()->get_element(m_hit.cellID()); } inline double GeoLArHit::Energy() const { - return m_hit->energy(); + return m_hit.energy(); } inline double GeoLArHit::Time() const { - return m_hit->time(); + return m_hit.time(); } inline int GeoLArHit::SamplingLayer() const { - const CaloCell_ID *caloID = s_man->getCaloCell_ID(); - int layer = caloID->sampling(m_hit->cellID()); + const CaloCell_ID *caloID = mgr()->getCaloCell_ID(); + int layer = caloID->sampling(m_hit.cellID()); return layer; } diff --git a/DetectorDescription/GeoModel/GeoAdaptors/GeoAdaptors/GeoMuonHits.h b/DetectorDescription/GeoModel/GeoAdaptors/GeoAdaptors/GeoMuonHits.h index a6a683b7707db46cf42cb247d828c6e759d24a25..6706bf36cb6cc5a4f218e4421611e7ebb57c502e 100755 --- a/DetectorDescription/GeoModel/GeoAdaptors/GeoAdaptors/GeoMuonHits.h +++ b/DetectorDescription/GeoModel/GeoAdaptors/GeoAdaptors/GeoMuonHits.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ #ifndef GEOADAPTORS_GEOMUONHITS_H @@ -49,8 +49,19 @@ namespace MuonGM{ } class Identifier; -class GeoMDTHit { +class GeoMuonHitBase +{ +protected: + const MuonGM::MuonDetectorManager* mgr() const; + +private: + static const MuonGM::MuonDetectorManager* init(); +}; + + +class GeoMDTHit : public GeoMuonHitBase +{ public: // Constructor: @@ -63,19 +74,15 @@ class GeoMDTHit { const MDTSimHit &data() const { return *m_hit;} // Is this hit OK? - operator bool () const { return s_man; } + operator bool () const { return true; } private: - - static void init(); - const MDTSimHit* m_hit; - static const MuonGM::MuonDetectorManager* s_man; - static const MdtIdHelper* s_mdtID; }; -class GeoRPCHit { +class GeoRPCHit : public GeoMuonHitBase +{ public: // Constructor: @@ -88,19 +95,15 @@ class GeoRPCHit { const RPCSimHit &data() const { return *m_hit;} // Is this hit OK? - operator bool () const { return s_man; } + operator bool () const { return true; } private: - static void init(); - const RPCSimHit* m_hit; - static const MuonGM::MuonDetectorManager* s_man; - static const RpcIdHelper* s_rpcID; - }; -class GeoTGCHit { +class GeoTGCHit : public GeoMuonHitBase +{ public: // Constructor: @@ -113,22 +116,17 @@ class GeoTGCHit { const TGCSimHit &data() const { return *m_hit;} // Is this hit OK? - operator bool () const { return s_man; } + operator bool () const { return true; } private: - static void init(); - const TGCSimHit *m_hit; - static const MuonGM::MuonDetectorManager* s_man; - static const TgcIdHelper* s_tgcID; - }; -class GeoCSCHit { - +class GeoCSCHit : public GeoMuonHitBase +{ public: // Constructor: @@ -141,19 +139,15 @@ class GeoCSCHit { const CSCSimHit &data() const { return *m_hit;} // Is this hit OK? - operator bool () const { return s_man; } + operator bool () const { return true; } private: - static void init(); - const CSCSimHit *m_hit; - static const MuonGM::MuonDetectorManager* s_man; - static const CscIdHelper* s_cscID; - }; -class GeoMMHit { +class GeoMMHit : public GeoMuonHitBase +{ public: // Constructor: @@ -172,21 +166,17 @@ class GeoMMHit { const MMSimHit &data() const { return *m_hit;} // Is this hit OK? - operator bool () const { return s_man; } + operator bool () const { return true; } private: - static void init(); - const MMSimHit *m_hit; - static const MuonGM::MuonDetectorManager* s_man; - static const MmIdHelper* s_mmID; - }; -class GeosTGCHit { +class GeosTGCHit : public GeoMuonHitBase +{ public: // Constructor: @@ -199,17 +189,11 @@ class GeosTGCHit { const sTGCSimHit &data() const { return *m_hit;} // Is this hit OK? - operator bool () const { return s_man; } + operator bool () const { return true; } - private: - static void init(); - const sTGCSimHit *m_hit; - static const MuonGM::MuonDetectorManager* s_man; - static const sTgcIdHelper* s_stgcID; - }; #include "GeoAdaptors/GeoMuonHits.icc" diff --git a/DetectorDescription/GeoModel/GeoAdaptors/GeoAdaptors/GeoMuonHits.icc b/DetectorDescription/GeoModel/GeoAdaptors/GeoAdaptors/GeoMuonHits.icc index d263f8752012d1a6ddaf6b5d6694c270d64dc9fc..ec0c4e1300d1a8224b5c108d91496783c31ecca8 100755 --- a/DetectorDescription/GeoModel/GeoAdaptors/GeoAdaptors/GeoMuonHits.icc +++ b/DetectorDescription/GeoModel/GeoAdaptors/GeoAdaptors/GeoMuonHits.icc @@ -2,9 +2,6 @@ Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ -#include "StoreGate/StoreGateSvc.h" -#include "StoreGate/StoreGate.h" - #include "MuonReadoutGeometry/MuonDetectorManager.h" #include "MuonIdHelpers/MdtIdHelper.h" #include "MuonIdHelpers/RpcIdHelper.h" @@ -50,17 +47,8 @@ #include "MuonReadoutGeometry/MMReadoutElement.h" -inline void GeoMDTHit::init() -{ - StoreGateSvc *detStore = StoreGate::pointer("DetectorStore"); - if(detStore->retrieve(s_man,"Muon").isSuccess()) - s_mdtID = s_man->mdtIdHelper(); -} - - inline GeoMDTHit::GeoMDTHit (const MDTSimHit & h) { m_hit = &h; - if(!s_mdtID) init(); } @@ -69,7 +57,8 @@ inline Amg::Vector3D GeoMDTHit::getGlobalPosition() const { HitID hitid = m_hit->MDTid(); - MdtHitIdHelper* mdthhelper = MdtHitIdHelper::GetHelper(); + const MdtIdHelper* mdtID = mgr()->mdtIdHelper(); + MdtHitIdHelper* mdthhelper = MdtHitIdHelper::GetHelper(mdtID->tubeMax()); std::string stname = mdthhelper->GetStationName(hitid); int steta = mdthhelper->GetZSector(hitid); @@ -78,19 +67,20 @@ inline Amg::Vector3D GeoMDTHit::getGlobalPosition() const { int tl = mdthhelper->GetLayer(hitid); int tube = mdthhelper->GetTube(hitid); - Identifier offid = s_mdtID->channelID(stname, - steta, - stphi,ml,tl,tube); + Identifier offid = mdtID->channelID(stname, + steta, + stphi,ml,tl,tube); if (offid == 0) std::cerr<<" Cannot build a valid Identifier; skip "<<std::endl; - const MuonGM::MdtReadoutElement* mdtdet = s_man->getMdtReadoutElement(offid); + const MuonGM::MdtReadoutElement* mdtdet = mgr()->getMdtReadoutElement(offid); if (mdtdet == NULL) { + const MdtIdHelper* mdtID = mgr()->mdtIdHelper(); std::cerr<<"MDT readout element not found for Id = " - <<s_mdtID->show_to_string(offid)<<std::endl; + <<mdtID->show_to_string(offid)<<std::endl; return Amg::Vector3D(0,0,0); } @@ -103,22 +93,15 @@ inline Amg::Vector3D GeoMDTHit::getGlobalPosition() const { return simHitPos; } -inline void GeoRPCHit::init() -{ - StoreGateSvc *detStore = StoreGate::pointer("DetectorStore"); - if(detStore->retrieve(s_man,"Muon").isSuccess()) - s_rpcID = s_man->rpcIdHelper(); -} - inline GeoRPCHit::GeoRPCHit (const RPCSimHit & h) { m_hit = &h; - if(!s_rpcID) init(); } inline Amg::Vector3D GeoRPCHit::getGlobalPosition() const { HitID hitid = m_hit->RPCid(); - RpcHitIdHelper* rpchhelper = RpcHitIdHelper::GetHelper(s_rpcID->gasGapMax()); + const RpcIdHelper* rpcID = mgr()->rpcIdHelper(); + RpcHitIdHelper* rpchhelper = RpcHitIdHelper::GetHelper(rpcID->gasGapMax()); std::string stname = rpchhelper->GetStationName(hitid); int steta = rpchhelper->GetZSector(hitid); int stphi = rpchhelper->GetPhiSector(hitid); @@ -128,14 +111,14 @@ inline Amg::Vector3D GeoRPCHit::getGlobalPosition() const { int gg = rpchhelper->GetGasGapLayer(hitid); int mfi = rpchhelper->GetMeasuresPhi(hitid); int strip = 1; - Identifier offid = s_rpcID->channelID(stname, - steta, - stphi, - dbr, dbz, dbp, gg, mfi, strip); + Identifier offid = rpcID->channelID(stname, + steta, + stphi, + dbr, dbz, dbp, gg, mfi, strip); if ( offid == 0) std::cerr<<" Cannot build a valid Identifier; skip "<<std::endl; - const MuonGM::RpcReadoutElement* rpcdet = s_man->getRpcReadoutElement(offid); + const MuonGM::RpcReadoutElement* rpcdet = mgr()->getRpcReadoutElement(offid); if (rpcdet != NULL) { Amg::Vector3D xU; @@ -146,23 +129,16 @@ inline Amg::Vector3D GeoRPCHit::getGlobalPosition() const { } else { + const RpcIdHelper* rpcID = mgr()->rpcIdHelper(); std::cerr<<"RPC readout element not found for Id = " - <<s_rpcID->show_to_string(offid)<<std::endl; + <<rpcID->show_to_string(offid)<<std::endl; return Amg::Vector3D(0,0,0); } } -inline void GeoTGCHit::init() -{ - StoreGateSvc *detStore = StoreGate::pointer("DetectorStore"); - if(detStore->retrieve(s_man,"Muon").isSuccess()) - s_tgcID = s_man->tgcIdHelper(); -} - inline GeoTGCHit::GeoTGCHit (const TGCSimHit & h) { m_hit = &h; - if(!s_tgcID) init(); } inline Amg::Vector3D GeoTGCHit::getGlobalPosition() const { @@ -175,14 +151,15 @@ inline Amg::Vector3D GeoTGCHit::getGlobalPosition() const { int gg = tgchhelper->GetGasGap(hitid); int isstrip= 0; int channel= 1; - Identifier offid = s_tgcID->channelID(stname, - steta, - stphi, - gg, isstrip, channel); + const TgcIdHelper* tgcID = mgr()->tgcIdHelper(); + Identifier offid = tgcID->channelID(stname, + steta, + stphi, + gg, isstrip, channel); if ( offid == 0) std::cerr<<" Cannot build a valid Identifier; skip "<<std::endl; - const MuonGM::TgcReadoutElement* tgcdet = s_man->getTgcReadoutElement(offid); + const MuonGM::TgcReadoutElement* tgcdet = mgr()->getTgcReadoutElement(offid); if (tgcdet != NULL) { Amg::Vector3D xU; @@ -193,21 +170,15 @@ inline Amg::Vector3D GeoTGCHit::getGlobalPosition() const { } else { + const TgcIdHelper* tgcID = mgr()->tgcIdHelper(); std::cerr<<"TGC readout element not found for Id = " - <<s_tgcID->show_to_string(offid)<<std::endl; + <<tgcID->show_to_string(offid)<<std::endl; return Amg::Vector3D(0,0,0); } } -inline void GeoCSCHit::init() -{ - StoreGateSvc *detStore = StoreGate::pointer("DetectorStore"); - if(detStore->retrieve(s_man,"Muon").isSuccess()) - s_cscID = s_man->cscIdHelper(); -} inline GeoCSCHit::GeoCSCHit (const CSCSimHit & h) { m_hit = &h; - if (!s_cscID) init(); } inline Amg::Vector3D GeoCSCHit::getGlobalPosition() const { @@ -223,19 +194,21 @@ inline Amg::Vector3D GeoCSCHit::getGlobalPosition() const { int measphi = 0; int channel = 1; - Identifier offid = s_cscID->channelID(stname, - steta, - stphi,ml,wl,measphi,channel); + const CscIdHelper* cscID = mgr()->cscIdHelper(); + Identifier offid = cscID->channelID(stname, + steta, + stphi,ml,wl,measphi,channel); if (offid == 0) std::cerr<<" Cannot build a valid Identifier; skip "<<std::endl; - const MuonGM::CscReadoutElement* cscdet = s_man->getCscReadoutElement(offid); + const MuonGM::CscReadoutElement* cscdet = mgr()->getCscReadoutElement(offid); if (cscdet == NULL) { + const CscIdHelper* cscID = mgr()->cscIdHelper(); std::cerr<<"CSC readout element not found for Id = " - <<s_cscID->show_to_string(offid)<<std::endl; + <<cscID->show_to_string(offid)<<std::endl; return Amg::Vector3D(0,0,0); } @@ -247,33 +220,27 @@ inline Amg::Vector3D GeoCSCHit::getGlobalPosition() const { } -inline void GeoMMHit::init() -{ - StoreGateSvc *detStore = StoreGate::pointer("DetectorStore"); - if(detStore->retrieve(s_man,"Muon").isSuccess()) - s_mmID = s_man->mmIdHelper(); -} - inline GeoMMHit::GeoMMHit (const MMSimHit & h) { m_hit = &h; - if (!s_mmID) init(); } inline Amg::Vector3D GeoMMHit::getGlobalPosition() const { HitID hitid = m_hit->MMId(); - MM_SimIdToOfflineId simToOffline(s_mmID); + const MmIdHelper* mmID = mgr()->mmIdHelper(); + MM_SimIdToOfflineId simToOffline(mmID); Identifier offid = simToOffline.convert(hitid); if (offid == 0) std::cerr<<" Cannot build a valid Identifier; skip "<<std::endl; - const MuonGM::MMReadoutElement* mmdet = s_man->getMMReadoutElement(offid); + const MuonGM::MMReadoutElement* mmdet = mgr()->getMMReadoutElement(offid); if (mmdet == NULL) { + const MmIdHelper* mmID = mgr()->mmIdHelper(); std::cerr<<"MM readout element not found for Id = " - <<s_mmID->show_to_string(offid)<<std::endl; + <<mmID->show_to_string(offid)<<std::endl; return Amg::Vector3D(0,0,0); } @@ -285,18 +252,20 @@ inline Amg::Vector3D GeoMMHit::getGlobalPosition() const { inline Amg::Vector3D GeoMMHit::getTrkGlobalPosition() const { HitID hitid = m_hit->MMId(); - MM_SimIdToOfflineId simToOffline(s_mmID); + const MmIdHelper* mmID = mgr()->mmIdHelper(); + MM_SimIdToOfflineId simToOffline(mmID); Identifier offid = simToOffline.convert(hitid); if (offid == 0) std::cerr<<" Cannot build a valid Identifier; skip "<<std::endl; - const MuonGM::MMReadoutElement* mmdet = s_man->getMMReadoutElement(offid); + const MuonGM::MMReadoutElement* mmdet = mgr()->getMMReadoutElement(offid); if (mmdet == NULL) { + const MmIdHelper* mmID = mgr()->mmIdHelper(); std::cerr<<"MM readout element not found for Id = " - <<s_mmID->show_to_string(offid)<<std::endl; + <<mmID->show_to_string(offid)<<std::endl; return Amg::Vector3D(0,0,0); } Amg::Vector3D trkLocP = getTrkLocalPosition(); @@ -309,18 +278,20 @@ inline Amg::Vector3D GeoMMHit::getTrkLocalPosition() const { HitID hitid = m_hit->MMId(); - MM_SimIdToOfflineId simToOffline(s_mmID); + const MmIdHelper* mmID = mgr()->mmIdHelper(); + MM_SimIdToOfflineId simToOffline(mmID); Identifier offid = simToOffline.convert(hitid); if (offid == 0) std::cerr<<" Cannot build a valid Identifier; skip "<<std::endl; - const MuonGM::MMReadoutElement* mmdet = s_man->getMMReadoutElement(offid); + const MuonGM::MMReadoutElement* mmdet = mgr()->getMMReadoutElement(offid); if (mmdet == NULL) { + const MmIdHelper* mmID = mgr()->mmIdHelper(); std::cerr<<"MM readout element not found for Id = " - <<s_mmID->show_to_string(offid)<<std::endl; + <<mmID->show_to_string(offid)<<std::endl; } Amg::Transform3D gToL = mmdet->absTransform().inverse(); @@ -332,32 +303,27 @@ inline Amg::Vector3D GeoMMHit::getTrkLocalPosition() const { return trkLocHit; } -inline void GeosTGCHit::init() -{ - StoreGateSvc *detStore = StoreGate::pointer("DetectorStore"); - if(detStore->retrieve(s_man,"Muon").isSuccess()) - s_stgcID = s_man->stgcIdHelper(); -} inline GeosTGCHit::GeosTGCHit (const sTGCSimHit & h) { m_hit = &h; - if (!s_stgcID) init(); } inline Amg::Vector3D GeosTGCHit::getGlobalPosition() const { HitID hitid = m_hit->sTGCId(); - sTgcSimIdToOfflineId simToOffline(s_stgcID); + const sTgcIdHelper* stgcID = mgr()->stgcIdHelper(); + sTgcSimIdToOfflineId simToOffline(stgcID); Identifier offid = simToOffline.convert(hitid); if (offid == 0) std::cerr<<" Cannot build a valid Identifier; skip "<<std::endl; - const MuonGM::sTgcReadoutElement* stgcdet = s_man->getsTgcReadoutElement(offid); + const MuonGM::sTgcReadoutElement* stgcdet = mgr()->getsTgcReadoutElement(offid); if (stgcdet == NULL) { + const sTgcIdHelper* stgcID = mgr()->stgcIdHelper(); std::cerr<<"sTGC readout element not found for Id = " - <<s_stgcID->show_to_string(offid)<<std::endl; + <<stgcID->show_to_string(offid)<<std::endl; return Amg::Vector3D(0,0,0); } diff --git a/DetectorDescription/GeoModel/GeoAdaptors/GeoAdaptors/GeoSiHit.h b/DetectorDescription/GeoModel/GeoAdaptors/GeoAdaptors/GeoSiHit.h index 443647d18e9f12ab11b7c843ee8a6a7ec7f45b95..78e7ef68f8fe38e2c37836352cbd4f91fc1d01d2 100755 --- a/DetectorDescription/GeoModel/GeoAdaptors/GeoAdaptors/GeoSiHit.h +++ b/DetectorDescription/GeoModel/GeoAdaptors/GeoAdaptors/GeoSiHit.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ #ifndef GEOADAPTORS_GEOSIHIT_h @@ -39,17 +39,20 @@ class GeoSiHit { // Is this hit ok? - operator bool () const { return s_sct || s_pix; } + operator bool () const { return true; } private: - - static void init(); + static const InDetDD::PixelDetectorManager* initPixMgr(); + static const InDetDD::SCT_DetectorManager* initSctMgr(); + static const PixelID* initPixID(); + static const SCT_ID* initSctID(); + + const InDetDD::PixelDetectorManager* pixMgr() const; + const InDetDD::SCT_DetectorManager* sctMgr() const; + const PixelID* pixID() const; + const SCT_ID* sctID() const; const SiHit *m_hit; - static const InDetDD::SCT_DetectorManager *s_sct; - static const InDetDD::PixelDetectorManager *s_pix; - static const PixelID *s_pID; - static const SCT_ID *s_sID; }; #include "GeoAdaptors/GeoSiHit.icc" diff --git a/DetectorDescription/GeoModel/GeoAdaptors/GeoAdaptors/GeoSiHit.icc b/DetectorDescription/GeoModel/GeoAdaptors/GeoAdaptors/GeoSiHit.icc index 7a8b878e87b4ed740974e46cf10fb87ab00efc9b..b0c16f7502d61253811978ef1a0d2fecdc6281b0 100755 --- a/DetectorDescription/GeoModel/GeoAdaptors/GeoAdaptors/GeoSiHit.icc +++ b/DetectorDescription/GeoModel/GeoAdaptors/GeoAdaptors/GeoSiHit.icc @@ -6,34 +6,13 @@ #include "InDetReadoutGeometry/SiDetectorElement.h" #include "SCT_ReadoutGeometry/SCT_DetectorManager.h" #include "PixelReadoutGeometry/PixelDetectorManager.h" -#include "StoreGate/StoreGateSvc.h" -#include "StoreGate/StoreGate.h" #include "InDetIdentifier/PixelID.h" #include "InDetIdentifier/SCT_ID.h" #include "GeoPrimitives/CLHEPtoEigenConverter.h" -inline void GeoSiHit::init() { - - StoreGateSvc *detStore = StoreGate::pointer("DetectorStore"); - if(detStore->retrieve(s_sct,"SCT").isFailure()){ - //if SCT retrieval fails, try ITkStrip - if(detStore->retrieve(s_sct,"ITkStrip").isFailure()) s_sct=0; - } - if(detStore->retrieve(s_pix,"Pixel").isFailure()){ - //if Pixel retrieval fails, try ITkPixel - if(detStore->retrieve(s_pix,"ITkPixel").isFailure()) s_pix = 0; - } - if(detStore->retrieve(s_sID,"SCT_ID").isFailure()) - s_sID = 0; - if(detStore->retrieve(s_pID,"PixelID").isFailure()) - s_pID = 0; -} - inline GeoSiHit::GeoSiHit (const SiHit & h) { m_hit = &h; - //If neither manager exists, may need to re-initialize... - if (!s_sct && !s_pix) init(); } inline HepGeom::Point3D<double> GeoSiHit::getGlobalPosition() const { @@ -44,19 +23,19 @@ inline HepGeom::Point3D<double> GeoSiHit::getGlobalPosition() const { const InDetDD::SiDetectorElement *geoelement=NULL; if (m_hit->isPixel()) { - id = s_pID->wafer_id(Barrel, + id = pixID()->wafer_id(Barrel, m_hit->getLayerDisk(), m_hit->getPhiModule(), m_hit->getEtaModule()); - geoelement = s_pix->getDetectorElement(id); + geoelement = pixMgr()->getDetectorElement(id); } else { - id = s_sID->wafer_id(Barrel, + id = sctID()->wafer_id(Barrel, m_hit->getLayerDisk(), m_hit->getPhiModule(), m_hit->getEtaModule(), m_hit->getSide() ); - geoelement = s_sct->getDetectorElement(id); + geoelement = sctMgr()->getDetectorElement(id); } diff --git a/DetectorDescription/GeoModel/GeoAdaptors/GeoAdaptors/GeoTRTUncompressedHit.h b/DetectorDescription/GeoModel/GeoAdaptors/GeoAdaptors/GeoTRTUncompressedHit.h index 44ccf1b4c69e9548820ebeeaafec1ae018469a88..324933c2d6a7660500a9f41e972443ff71ad64ae 100755 --- a/DetectorDescription/GeoModel/GeoAdaptors/GeoAdaptors/GeoTRTUncompressedHit.h +++ b/DetectorDescription/GeoModel/GeoAdaptors/GeoAdaptors/GeoTRTUncompressedHit.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ #ifndef GEOADAPTORS_GEOTRTUNCOMPRESSEDHIT_H @@ -33,15 +33,13 @@ class GeoTRTUncompressedHit { HepGeom::Point3D<double> getGlobalPosition() const; // Is this hit OK? - operator bool () const { return s_mgr; } + operator bool () const { return true; } private: - - static void init(); + static const InDetDD::TRT_DetectorManager* init(); + const InDetDD::TRT_DetectorManager* mgr() const; const TRTUncompressedHit *m_hit; - static const InDetDD::TRT_DetectorManager *s_mgr; - }; #include "GeoAdaptors/GeoTRTUncompressedHit.icc" diff --git a/DetectorDescription/GeoModel/GeoAdaptors/GeoAdaptors/GeoTRTUncompressedHit.icc b/DetectorDescription/GeoModel/GeoAdaptors/GeoAdaptors/GeoTRTUncompressedHit.icc index 32df35e9d439be1bd7965cf1cddf676dc10a2b9e..04bafd0b8f017e67f865f0992b8281b3fdefcc0a 100755 --- a/DetectorDescription/GeoModel/GeoAdaptors/GeoAdaptors/GeoTRTUncompressedHit.icc +++ b/DetectorDescription/GeoModel/GeoAdaptors/GeoAdaptors/GeoTRTUncompressedHit.icc @@ -1,26 +1,17 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ #include "InDetSimEvent/TRTUncompressedHit.h" #include "TRT_ReadoutGeometry/TRT_DetectorManager.h" #include "TRT_ReadoutGeometry/TRT_BarrelElement.h" #include "TRT_ReadoutGeometry/TRT_EndcapElement.h" -#include "StoreGate/StoreGateSvc.h" -#include "StoreGate/StoreGate.h" #include <bitset> -inline void GeoTRTUncompressedHit::init() { - - StoreGateSvc *detStore = StoreGate::pointer("DetectorStore"); - if(detStore->retrieve(s_mgr,"TRT").isFailure()) - std::cout << "GeoTRTUncompressedHit::init() WARNING Unable to retrieve InDetDD::TRT_DetectorManager" << std::endl; -} inline GeoTRTUncompressedHit::GeoTRTUncompressedHit (const TRTUncompressedHit & h) { m_hit = &h; - if (!s_mgr) init(); } inline HepGeom::Point3D<double> GeoTRTUncompressedHit::getGlobalPosition() const { @@ -38,7 +29,7 @@ inline HepGeom::Point3D<double> GeoTRTUncompressedHit::getGlobalPosition() const hitID >>= shift; ringID = hitID & mask; trtID = hitID >> shift; - const InDetDD::TRT_BarrelElement *element = s_mgr->getBarrelElement(trtID,ringID,moduleID,layerID); + const InDetDD::TRT_BarrelElement *element = mgr()->getBarrelElement(trtID,ringID,moduleID,layerID); if (element) { HepGeom::Point3D<double> v(m_hit->GetPreStepX(), m_hit->GetPreStepY(), m_hit->GetPreStepZ()); return element->getAbsoluteTransform(strawID)*v; @@ -54,7 +45,7 @@ inline HepGeom::Point3D<double> GeoTRTUncompressedHit::getGlobalPosition() const wheelID = hitID & mask; trtID = hitID >> shift; bool isPositive = trtID==2 ? 1:0; - const InDetDD::TRT_EndcapElement *element = s_mgr->getEndcapElement(isPositive,wheelID,planeID,sectorID); + const InDetDD::TRT_EndcapElement *element = mgr()->getEndcapElement(isPositive,wheelID,planeID,sectorID); if (element) { HepGeom::Point3D<double> v(m_hit->GetPreStepX(), m_hit->GetPreStepY(), m_hit->GetPreStepZ()); return element->getAbsoluteTransform(strawID)*v; diff --git a/DetectorDescription/GeoModel/GeoAdaptors/src/GeoCaloCalibHit.cxx b/DetectorDescription/GeoModel/GeoAdaptors/src/GeoCaloCalibHit.cxx new file mode 100644 index 0000000000000000000000000000000000000000..9e5c30fcab4777a0078569efb379e2786e63b9c7 --- /dev/null +++ b/DetectorDescription/GeoModel/GeoAdaptors/src/GeoCaloCalibHit.cxx @@ -0,0 +1,27 @@ +/* + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration +*/ + + +#include "GeoAdaptors/GeoCaloCalibHit.h" +#include "StoreGate/StoreGateSvc.h" +#include "GaudiKernel/ServiceHandle.h" + + +const CaloDetDescrManager* GeoCaloCalibHit::initDDMgr() +{ + ServiceHandle<StoreGateSvc> detStore ("DetectorStore", "GeoLArHit"); + const CaloDetDescrManager* mgr = nullptr; + if (detStore->retrieve(mgr).isFailure()) { + std::abort(); + } + return mgr; +} + + +const CaloDetDescrManager* GeoCaloCalibHit::ddmgr() const +{ + const CaloDetDescrManager* const ddmgr = initDDMgr(); + return ddmgr; +} + diff --git a/DetectorDescription/GeoModel/GeoAdaptors/src/GeoLArHit.cxx b/DetectorDescription/GeoModel/GeoAdaptors/src/GeoLArHit.cxx new file mode 100644 index 0000000000000000000000000000000000000000..57eedb92a9520503e0a1042bb21603dc75faec6b --- /dev/null +++ b/DetectorDescription/GeoModel/GeoAdaptors/src/GeoLArHit.cxx @@ -0,0 +1,26 @@ +/* + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration +*/ + +#include "GeoAdaptors/GeoLArHit.h" +#include "StoreGate/StoreGateSvc.h" +#include "GaudiKernel/ServiceHandle.h" + + +const CaloDetDescrManager* GeoLArHit::init() +{ + ServiceHandle<StoreGateSvc> detStore ("DetectorStore", "GeoLArHit"); + const CaloDetDescrManager* mgr = nullptr; + if (detStore->retrieve(mgr).isFailure()) { + std::abort(); + } + return mgr; +} + + +const CaloDetDescrManager* GeoLArHit::mgr() const +{ + static const CaloDetDescrManager* const mgr = init(); + return mgr; +} + diff --git a/DetectorDescription/GeoModel/GeoAdaptors/src/GeoMuonHits.cxx b/DetectorDescription/GeoModel/GeoAdaptors/src/GeoMuonHits.cxx new file mode 100644 index 0000000000000000000000000000000000000000..5d8614424d961351bfbfd996b7be6c50c3d1fdcc --- /dev/null +++ b/DetectorDescription/GeoModel/GeoAdaptors/src/GeoMuonHits.cxx @@ -0,0 +1,26 @@ +/* + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration +*/ + + +#include "GeoAdaptors/GeoMuonHits.h" +#include "StoreGate/StoreGateSvc.h" +#include "GaudiKernel/ServiceHandle.h" + + +const MuonGM::MuonDetectorManager* GeoMuonHitBase::init() +{ + ServiceHandle<StoreGateSvc> detStore ("DetectorStore", "GeoSiHit"); + const MuonGM::MuonDetectorManager* mgr = nullptr; + if(detStore->retrieve(mgr,"Muon").isFailure()) { + std::abort(); + } + return mgr; +} + + +const MuonGM::MuonDetectorManager* GeoMuonHitBase::mgr() const +{ + const MuonGM::MuonDetectorManager* const mgr = init(); + return mgr; +} diff --git a/DetectorDescription/GeoModel/GeoAdaptors/src/GeoSiHit.cxx b/DetectorDescription/GeoModel/GeoAdaptors/src/GeoSiHit.cxx new file mode 100644 index 0000000000000000000000000000000000000000..60b4fc5009c6c9d817f36e249d60522e92d90146 --- /dev/null +++ b/DetectorDescription/GeoModel/GeoAdaptors/src/GeoSiHit.cxx @@ -0,0 +1,87 @@ +/* + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration +*/ + + +#include "GeoAdaptors/GeoSiHit.h" +#include "StoreGate/StoreGateSvc.h" +#include "GaudiKernel/ServiceHandle.h" + + +const InDetDD::PixelDetectorManager* GeoSiHit::initPixMgr() +{ + ServiceHandle<StoreGateSvc> detStore ("DetectorStore", "GeoSiHit"); + const InDetDD::PixelDetectorManager* pix = nullptr; + if(detStore->retrieve(pix,"Pixel").isFailure()){ + //if Pixel retrieval fails, try ITkPixel + if(detStore->retrieve(pix,"ITkPixel").isFailure()) + { + std::abort(); + } + } + return pix; +} + + +const InDetDD::SCT_DetectorManager* GeoSiHit::initSctMgr() +{ + ServiceHandle<StoreGateSvc> detStore ("DetectorStore", "GeoSiHit"); + const InDetDD::SCT_DetectorManager* sct = nullptr; + if(detStore->retrieve(sct,"SCT").isFailure()){ + if(detStore->retrieve(sct,"ITkStrip").isFailure()) { + std::abort(); + } + } + return sct; +} + + +const PixelID* GeoSiHit::initPixID() +{ + ServiceHandle<StoreGateSvc> detStore ("DetectorStore", "GeoSiHit"); + const PixelID* pix = nullptr; + if(detStore->retrieve(pix,"PixelID").isFailure()) { + std::abort(); + } + return pix; +} + + +const SCT_ID* GeoSiHit::initSctID() +{ + ServiceHandle<StoreGateSvc> detStore ("DetectorStore", "GeoSiHit"); + const SCT_ID* sct = nullptr; + if(detStore->retrieve(sct,"SCT_ID").isFailure()) { + std::abort(); + } + return sct; +} + + +const InDetDD::PixelDetectorManager* GeoSiHit::pixMgr() const +{ + const InDetDD::PixelDetectorManager* const mgr = initPixMgr(); + return mgr; +} + + +const InDetDD::SCT_DetectorManager* GeoSiHit::sctMgr() const +{ + const InDetDD::SCT_DetectorManager* const mgr = initSctMgr(); + return mgr; +} + + +const PixelID* GeoSiHit::pixID() const +{ + const PixelID* const id = initPixID(); + return id; +} + + +const SCT_ID* GeoSiHit::sctID() const +{ + const SCT_ID* const id = initSctID(); + return id; +} + diff --git a/DetectorDescription/GeoModel/GeoAdaptors/src/GeoTRTUncompressedHit.cxx b/DetectorDescription/GeoModel/GeoAdaptors/src/GeoTRTUncompressedHit.cxx new file mode 100644 index 0000000000000000000000000000000000000000..7ef4c781b6f18cc932330ff10cd7e3f44b8f2875 --- /dev/null +++ b/DetectorDescription/GeoModel/GeoAdaptors/src/GeoTRTUncompressedHit.cxx @@ -0,0 +1,26 @@ +/* + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration +*/ + + +#include "GeoAdaptors/GeoTRTUncompressedHit.h" +#include "StoreGate/StoreGateSvc.h" +#include "GaudiKernel/ServiceHandle.h" + + +const InDetDD::TRT_DetectorManager* GeoTRTUncompressedHit::init() +{ + ServiceHandle<StoreGateSvc> detStore ("DetectorStore", "GeoSiHit"); + const InDetDD::TRT_DetectorManager* mgr = nullptr; + if(detStore->retrieve(mgr,"TRT").isFailure()) { + std::abort(); + } + return mgr; +} + + +const InDetDD::TRT_DetectorManager* GeoTRTUncompressedHit::mgr() const +{ + const InDetDD::TRT_DetectorManager* const mgr = init(); + return mgr; +} diff --git a/DetectorDescription/GeoModel/GeoAdaptors/src/statics.cxx b/DetectorDescription/GeoModel/GeoAdaptors/src/statics.cxx deleted file mode 100644 index e656f5d19e99e9b26771e745520330a9dddb856f..0000000000000000000000000000000000000000 --- a/DetectorDescription/GeoModel/GeoAdaptors/src/statics.cxx +++ /dev/null @@ -1,37 +0,0 @@ -/* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration -*/ - -#include "GeoAdaptors/GeoLArHit.h" -#include "GeoAdaptors/GeoSiHit.h" -#include "GeoAdaptors/GeoMuonHits.h" -#include "GeoAdaptors/GeoTRTUncompressedHit.h" - -const InDetDD::SCT_DetectorManager *GeoSiHit::s_sct = 0; -const InDetDD::PixelDetectorManager *GeoSiHit::s_pix = 0; -const PixelID *GeoSiHit::s_pID = 0; -const SCT_ID *GeoSiHit::s_sID = 0; - - -const MuonGM::MuonDetectorManager* GeoMDTHit::s_man = 0; -const MdtIdHelper* GeoMDTHit::s_mdtID = 0; - -const MuonGM::MuonDetectorManager* GeoTGCHit::s_man = 0; -const TgcIdHelper* GeoTGCHit::s_tgcID = 0; - -const MuonGM::MuonDetectorManager* GeoRPCHit::s_man = 0; -const RpcIdHelper* GeoRPCHit::s_rpcID = 0; - -const MuonGM::MuonDetectorManager* GeoCSCHit::s_man = 0; -const CscIdHelper* GeoCSCHit::s_cscID = 0; - -const MuonGM::MuonDetectorManager* GeosTGCHit::s_man = 0; -const sTgcIdHelper* GeosTGCHit::s_stgcID = 0; - -const MuonGM::MuonDetectorManager* GeoMMHit::s_man = 0; -const MmIdHelper* GeoMMHit::s_mmID = 0; - -const CaloDetDescrManager* GeoLArHit::s_man = 0; - -const InDetDD::TRT_DetectorManager *GeoTRTUncompressedHit::s_mgr = 0; - diff --git a/Event/EventOverlay/EventOverlayJobTransforms/share/Rt_override.py b/Event/EventOverlay/EventOverlayJobTransforms/share/Rt_override.py index 93b4df2d61bad269b57508eb81e05b2e5f5067f7..f7559a0b402d0f1c0b8b66e6c45fc4c6bdc956ed 100644 --- a/Event/EventOverlay/EventOverlayJobTransforms/share/Rt_override.py +++ b/Event/EventOverlay/EventOverlayJobTransforms/share/Rt_override.py @@ -9,8 +9,8 @@ conddb.addFolderWithTag("TRT_OFL","/TRT/Calib/T0","TrtCalibT0-Physics-BLK-UPD4-F conddb.blockFolder("/MDT/RT") conddb.addFolderWithTag("MDT_OFL","/MDT/RT","MDTRT_Sim-00",force=True,forceMC=True) conddb.blockFolder("/MDT/RTBLOB") -#conddb.addFolderWithTag("MDT_OFL","/MDT/RTBLOB","MDTRT-UPD4-09-BLOB",force=True,forceData=True) -conddb.addFolderWithTag("MDT_OFL","/MDT/RTBLOB","MDTRT_Sim-00-BLOB",force=True,forceMC=True) +#conddb.addFolderWithTag("MDT_OFL","/MDT/RTBLOB","MDTRT-UPD4-09-BLOB",force=True,forceData=True,className="CondAttrListCollection") +conddb.addFolderWithTag("MDT_OFL","/MDT/RTBLOB","MDTRT_Sim-00-BLOB",force=True,forceMC=True,className="CondAttrListCollection") #can try using MC T0 constants, or force a data tag to use conddb.blockFolder("/MDT/T0") @@ -25,7 +25,7 @@ conddb.addFolderWithTag("PIXEL_ONL","/PIXEL/HLT/DCS/HV","PixDCSHV-UPD1-00",force conddb.blockFolder("/PIXEL/HLT/DCS/TEMPERATURE") conddb.addFolderWithTag("PIXEL_ONL","/PIXEL/HLT/DCS/TEMPERATURE","PixDCSTemp-UPD1-00",force=True,forceData=True) conddb.blockFolder("/PIXEL/ReadoutSpeed") -conddb.addFolderSplitMC("PIXEL","/PIXEL/ReadoutSpeed","/PIXEL/ReadoutSpeed",force=True) +conddb.addFolderSplitMC("PIXEL","/PIXEL/ReadoutSpeed","/PIXEL/ReadoutSpeed",force=True,className="AthenaAttributeList") #conddb.addFolder("PIXEL_OFL","/PIXEL/ReadoutSpeed",force=True,forceData=True) #conddb.blockFolder("/GLOBAL/BField/Map") diff --git a/Event/EventOverlay/EventOverlayJobTransforms/share/Rt_override_BLKPA-006-05.py b/Event/EventOverlay/EventOverlayJobTransforms/share/Rt_override_BLKPA-006-05.py index 8a0cc248cf7e95301c2a8f1c6fc921e88653f873..6211fc2ff880833cc291e428ab7b4e3849d42701 100644 --- a/Event/EventOverlay/EventOverlayJobTransforms/share/Rt_override_BLKPA-006-05.py +++ b/Event/EventOverlay/EventOverlayJobTransforms/share/Rt_override_BLKPA-006-05.py @@ -9,14 +9,14 @@ conddb.addFolderWithTag("TRT_OFL","/TRT/Calib/RT","TrtCalibRt-MCnewDigi_ToTon_7T conddb.blockFolder("/MDT/RT") conddb.addFolderWithTag("MDT_OFL","/MDT/RT","MDTRT_Sim-00",force=True,forceMC=True) conddb.blockFolder("/MDT/RTBLOB") -conddb.addFolderWithTag("MDT_OFL","/MDT/RTBLOB","MDTRT_Sim-00-BLOB",force=True,forceMC=True) +conddb.addFolderWithTag("MDT_OFL","/MDT/RTBLOB","MDTRT_Sim-00-BLOB",force=True,forceMC=True,className="CondAttrListCollection") conddb.blockFolder("/PIXEL/HLT/DCS/HV") conddb.addFolderWithTag("PIXEL_ONL","/PIXEL/HLT/DCS/HV","PixDCSHV-UPD1-00",force=True,forceData=True) conddb.blockFolder("/PIXEL/HLT/DCS/TEMPERATURE") conddb.addFolderWithTag("PIXEL_ONL","/PIXEL/HLT/DCS/TEMPERATURE","PixDCSTemp-UPD1-00",force=True,forceData=True) conddb.blockFolder("/PIXEL/ReadoutSpeed") -conddb.addFolderSplitMC("PIXEL","/PIXEL/ReadoutSpeed","/PIXEL/ReadoutSpeed",force=True) +conddb.addFolderSplitMC("PIXEL","/PIXEL/ReadoutSpeed","/PIXEL/ReadoutSpeed",force=True,className="AthenaAttributeList") conddb.blockFolder("/TRT/Cond/DigVers") conddb.addFolderWithTag("TRT_OFL","/TRT/Cond/DigVers","TRTCondDigVers-Collisions-01",force=True,forceMC=True, diff --git a/Event/EventOverlay/EventOverlayJobTransforms/share/Rt_override_BLKPA-006-11.py b/Event/EventOverlay/EventOverlayJobTransforms/share/Rt_override_BLKPA-006-11.py index cb78a7e3d084fca5bc3ab52962a8e6d4bf5063ce..a1945ef1d8abbb150cefd1008d8545357d044ef7 100755 --- a/Event/EventOverlay/EventOverlayJobTransforms/share/Rt_override_BLKPA-006-11.py +++ b/Event/EventOverlay/EventOverlayJobTransforms/share/Rt_override_BLKPA-006-11.py @@ -12,14 +12,14 @@ conddb.addFolderWithTag("TRT_OFL","/TRT/Calib/RT","TrtCalibRt-MCnewDigi_ToTon_7T #conddb.blockFolder("/MDT/RT") #conddb.addFolderWithTag("MDT_OFL","/MDT/RT","MDTRT_Sim-00",force=True,forceMC=True) #conddb.blockFolder("/MDT/RTBLOB") -#conddb.addFolderWithTag("MDT_OFL","/MDT/RTBLOB","MDTRT_Sim-00-BLOB",force=True,forceMC=True) +#conddb.addFolderWithTag("MDT_OFL","/MDT/RTBLOB","MDTRT_Sim-00-BLOB",force=True,forceMC=True,className="CondAttrListCollection") conddb.blockFolder("/PIXEL/HLT/DCS/HV") conddb.addFolderWithTag("PIXEL_ONL","/PIXEL/HLT/DCS/HV","PixDCSHV-UPD1-00",force=True,forceData=True) conddb.blockFolder("/PIXEL/HLT/DCS/TEMPERATURE") conddb.addFolderWithTag("PIXEL_ONL","/PIXEL/HLT/DCS/TEMPERATURE","PixDCSTemp-UPD1-00",force=True,forceData=True) conddb.blockFolder("/PIXEL/ReadoutSpeed") -conddb.addFolderSplitMC("PIXEL","/PIXEL/ReadoutSpeed","/PIXEL/ReadoutSpeed",force=True) +conddb.addFolderSplitMC("PIXEL","/PIXEL/ReadoutSpeed","/PIXEL/ReadoutSpeed",force=True,className="AthenaAttributeList") conddb.blockFolder("/PIXEL/PixReco") conddb.addFolderWithTag("PIXEL_OFL","/PIXEL/PixReco","PixReco-SIM-RUN12-000-01",force=True,forceMC=True) diff --git a/Event/EventOverlay/EventOverlayJobTransforms/share/Rt_override_COMCOND-BLKPA-RUN1-08.py b/Event/EventOverlay/EventOverlayJobTransforms/share/Rt_override_COMCOND-BLKPA-RUN1-08.py index 1f253cb14cb395d6c613cb7baa02d0720a35fdaa..aa6723b9d7c4e74c4b2099884691487981f01d65 100644 --- a/Event/EventOverlay/EventOverlayJobTransforms/share/Rt_override_COMCOND-BLKPA-RUN1-08.py +++ b/Event/EventOverlay/EventOverlayJobTransforms/share/Rt_override_COMCOND-BLKPA-RUN1-08.py @@ -13,7 +13,7 @@ from RecExConfig.RecAlgsFlags import recAlgs conddb.addOverride("/LAR/ElecCalibOfl/Shape/RTM/5samples1phase","LARElecCalibOflShapeRTM5samples1phase-UPD1-04") conddb.blockFolder("/PIXEL/ReadoutSpeed") -conddb.addFolderSplitMC("PIXEL","/PIXEL/ReadoutSpeed","/PIXEL/ReadoutSpeed",force=True) +conddb.addFolderSplitMC("PIXEL","/PIXEL/ReadoutSpeed","/PIXEL/ReadoutSpeed",force=True,className="AthenaAttributeList") conddb.blockFolder("/TRT/Cond/DigVers") conddb.addFolderWithTag("TRT_OFL","/TRT/Cond/DigVers","TRTCondDigVers-Collisions-01",force=True,forceMC=True, @@ -74,7 +74,7 @@ conddb.addFolderWithTag("PIXEL_OFL","/PIXEL/LorentzAngleScale","PixLorentzAngleS conddb.blockFolder("/PIXEL/DCS/TEMPERATURE") conddb.addFolderWithTag("DCS_OFL","/PIXEL/DCS/TEMPERATURE","PixDCSTemp-SIM-RUN1-000-00",force=True,forceMC=True) conddb.blockFolder("/PIXEL/PixdEdx") -conddb.addFolderWithTag("PIXEL_OFL","/PIXEL/PixdEdx","PixdEdx-SIM-RUN1-000-02",force=True,forceMC=True) +conddb.addFolderWithTag("PIXEL_OFL","/PIXEL/PixdEdx","PixdEdx-SIM-RUN1-000-02",force=True,forceMC=True,className="AthenaAttributeList") conddb.blockFolder("/SCT/DCS/HV") conddb.addFolderWithTag("DCS_OFL","/SCT/DCS/HV","SctDcsHv-01",force=True,forceMC=True) conddb.blockFolder("/SCT/DCS/MODTEMP") diff --git a/Event/EventOverlay/EventOverlayJobTransforms/share/Rt_override_CONDBR2-BLKPA-2015-12.py b/Event/EventOverlay/EventOverlayJobTransforms/share/Rt_override_CONDBR2-BLKPA-2015-12.py index 8aff6fb2e8364b5f3235ceb3dfdfc161c15ebf00..07c9cfb66d52e1017a575ab17cc85758b1216730 100644 --- a/Event/EventOverlay/EventOverlayJobTransforms/share/Rt_override_CONDBR2-BLKPA-2015-12.py +++ b/Event/EventOverlay/EventOverlayJobTransforms/share/Rt_override_CONDBR2-BLKPA-2015-12.py @@ -7,7 +7,7 @@ from RecExConfig.RecAlgsFlags import recAlgs #conddb.blockFolder("/MDT/RT") #conddb.addFolderWithTag("MDT_OFL","/MDT/RT","MDTRT_Sim-04",force=True,forceMC=True) conddb.blockFolder("/MDT/RTBLOB") -conddb.addFolderWithTag("MDT_OFL","/MDT/RTBLOB","MDTRT_Sim-04-BLOB",force=True,forceMC=True) +conddb.addFolderWithTag("MDT_OFL","/MDT/RTBLOB","MDTRT_Sim-04-BLOB",force=True,forceMC=True,className="CondAttrListCollection") #from Guillaume conddb.blockFolder("/LAR/LArCellPositionShift"); @@ -17,7 +17,7 @@ conddb.addOverride("/LAR/ElecCalibOfl/OFC/PhysWave/RTM/4samples1phase","LARElecC svcMgr.PoolSvc.ReadCatalog+=["xmlcatalog_file:"+"/cvmfs/atlas-condb.cern.ch/repo/conditions/poolcond/PoolFileCatalog.xml"] conddb.blockFolder("/PIXEL/ReadoutSpeed") -conddb.addFolderSplitMC("PIXEL","/PIXEL/ReadoutSpeed","/PIXEL/ReadoutSpeed",force=True) +conddb.addFolderSplitMC("PIXEL","/PIXEL/ReadoutSpeed","/PIXEL/ReadoutSpeed",force=True,className="AthenaAttributeList") conddb.blockFolder("/TRT/Cond/DigVers") conddb.addFolderWithTag("TRT_OFL","/TRT/Cond/DigVers","TRTCondDigVers-Collisions-01",force=True,forceMC=True, @@ -77,7 +77,7 @@ if DetFlags.writeRDOPool.pixel_on(): conddb.addFolder("PIXEL_OFL","/PIXEL/PixReco") conddb.blockFolder("/PIXEL/PixdEdx") -conddb.addFolderWithTag("PIXEL_OFL","/PIXEL/PixdEdx","PixdEdx-SIM-RUN1-000-02",force=True,forceMC=True) +conddb.addFolderWithTag("PIXEL_OFL","/PIXEL/PixdEdx","PixdEdx-SIM-RUN1-000-02",force=True,forceMC=True,className="AthenaAttributeList") mcIDoverlay=False if mcIDoverlay: printfunc ("ACH777: Using MC overlay Lorentz DB settings") @@ -123,16 +123,16 @@ conddb.addFolderWithTag("MUONALIGN_OFL","/MUONALIGN/TGC/SIDEA","MuonAlignTGCEndC conddb.addFolderWithTag("MUONALIGN_OFL","/MUONALIGN/TGC/SIDEC","MuonAlignTGCEndCapCAlign-0001-DEFAULT",force=True,forceMC=True,className='CondAttrListCollection') conddb.blockFolder("/SCT/DAQ/Config/Chip") -conddb.addFolderSplitMC("SCT","/SCT/DAQ/Config/Chip","/SCT/DAQ/Config/Chip",force=True) +conddb.addFolderSplitMC("SCT","/SCT/DAQ/Config/Chip","/SCT/DAQ/Config/Chip",force=True,className="CondAttrListVec") conddb.blockFolder("/SCT/DAQ/Config/Module") -conddb.addFolderSplitMC("SCT","/SCT/DAQ/Config/Module","/SCT/DAQ/Config/Module",force=True) +conddb.addFolderSplitMC("SCT","/SCT/DAQ/Config/Module","/SCT/DAQ/Config/Module",force=True,className="CondAttrListVec") conddb.blockFolder("/LAR/BadChannels/BadChannels") conddb.blockFolder("/LAR/BadChannelsOfl/BadChannels") -conddb.addFolderWithTag("LAR_OFL","/LAR/BadChannels/BadChannels","LARBadChannelsBadChannels-HECAQ3Missing",force=True,forceMC=True) +conddb.addFolderWithTag("LAR_OFL","/LAR/BadChannels/BadChannels","LARBadChannelsBadChannels-HECAQ3Missing",force=True,forceMC=True,className="CondAttrListCollection") conddb.blockFolder("/LAR/BadChannels/MissingFEBs") conddb.blockFolder("/LAR/BadChannelsOfl/MissingFEBs") -conddb.addFolderWithTag("LAR_OFL","/LAR/BadChannels/MissingFEBs","LArBadChannelsMissingFEBs-IOVDEP-04",force=True,forceMC=True) +conddb.addFolderWithTag("LAR_OFL","/LAR/BadChannels/MissingFEBs","LArBadChannelsMissingFEBs-IOVDEP-04",force=True,forceMC=True,className="AthenaAttributeList") dofolderoverrides = True if dofolderoverrides: diff --git a/Event/EventOverlay/EventOverlayJobTransforms/share/Rt_override_OFLCOND-MC15c-SDR-11.py b/Event/EventOverlay/EventOverlayJobTransforms/share/Rt_override_OFLCOND-MC15c-SDR-11.py index 5b819a37b2c704664951a227fcf9eaf83a790b89..f0ebc6b652a01142121312a5e7e0d7a01164bcef 100644 --- a/Event/EventOverlay/EventOverlayJobTransforms/share/Rt_override_OFLCOND-MC15c-SDR-11.py +++ b/Event/EventOverlay/EventOverlayJobTransforms/share/Rt_override_OFLCOND-MC15c-SDR-11.py @@ -7,7 +7,7 @@ from RecExConfig.RecAlgsFlags import recAlgs #conddb.blockFolder("/MDT/RT") #conddb.addFolderWithTag("MDT_OFL","/MDT/RT","MDTRT_Sim-04",force=True,forceMC=True) conddb.blockFolder("/MDT/RTBLOB") -conddb.addFolderWithTag("MDT_OFL","/MDT/RTBLOB","MDTRT_Sim-04-BLOB",force=True,forceMC=True) +conddb.addFolderWithTag("MDT_OFL","/MDT/RTBLOB","MDTRT_Sim-04-BLOB",force=True,forceMC=True,className="CondAttrListCollection") #from Guillaume conddb.blockFolder("/LAR/LArCellPositionShift"); @@ -17,7 +17,7 @@ conddb.addOverride("/LAR/ElecCalibOfl/OFC/PhysWave/RTM/4samples1phase","LARElecC svcMgr.PoolSvc.ReadCatalog+=["xmlcatalog_file:"+"/cvmfs/atlas-condb.cern.ch/repo/conditions/poolcond/PoolFileCatalog.xml"] conddb.blockFolder("/PIXEL/ReadoutSpeed") -conddb.addFolderSplitMC("PIXEL","/PIXEL/ReadoutSpeed","/PIXEL/ReadoutSpeed",force=True) +conddb.addFolderSplitMC("PIXEL","/PIXEL/ReadoutSpeed","/PIXEL/ReadoutSpeed",force=True,className="AthenaAttributeList") conddb.blockFolder("/TRT/Cond/DigVers") conddb.addFolderWithTag("TRT_OFL","/TRT/Cond/DigVers","TRTCondDigVers-Collisions-01",force=True,forceMC=True, @@ -80,7 +80,7 @@ if DetFlags.writeRDOPool.pixel_on(): conddb.addFolder("PIXEL_OFL","/PIXEL/PixReco") conddb.blockFolder("/PIXEL/PixdEdx") -conddb.addFolderWithTag("PIXEL_OFL","/PIXEL/PixdEdx","PixdEdx-SIM-RUN124-000-00",force=True,forceMC=True) +conddb.addFolderWithTag("PIXEL_OFL","/PIXEL/PixdEdx","PixdEdx-SIM-RUN124-000-00",force=True,forceMC=True,className="AthenaAttributeList") mcIDoverlay=False if mcIDoverlay: printfunc ("ACH777: Using MC overlay Lorentz DB settings") @@ -126,7 +126,7 @@ conddb.addFolderWithTag("MUONALIGN_OFL","/MUONALIGN/TGC/SIDEA","MuonAlignTGCEndC conddb.addFolderWithTag("MUONALIGN_OFL","/MUONALIGN/TGC/SIDEC","MuonAlignTGCEndCapCAlign-0001-DEFAULT",force=True,forceMC=True,className='CondAttrListCollection') conddb.blockFolder("/SCT/DAQ/Config/Chip") -conddb.addFolderSplitMC("SCT","/SCT/DAQ/Config/Chip","/SCT/DAQ/Config/Chip",force=True) +conddb.addFolderSplitMC("SCT","/SCT/DAQ/Config/Chip","/SCT/DAQ/Config/Chip",force=True,className="CondAttrListVec") conddb.blockFolder("/SCT/DAQ/Config/Module") -conddb.addFolderSplitMC("SCT","/SCT/DAQ/Config/Module","/SCT/DAQ/Config/Module",force=True) +conddb.addFolderSplitMC("SCT","/SCT/DAQ/Config/Module","/SCT/DAQ/Config/Module",force=True,className="CondAttrListVec") diff --git a/Event/EventOverlay/EventOverlayJobTransforms/share/Rt_override_OFLCOND-MC16-SDR-23.py b/Event/EventOverlay/EventOverlayJobTransforms/share/Rt_override_OFLCOND-MC16-SDR-23.py index 33cd496fa9c30b9a8e4aa2efcae0f923db90f46a..acf529239d1a7028455153bbf02dd5a6397b771f 100644 --- a/Event/EventOverlay/EventOverlayJobTransforms/share/Rt_override_OFLCOND-MC16-SDR-23.py +++ b/Event/EventOverlay/EventOverlayJobTransforms/share/Rt_override_OFLCOND-MC16-SDR-23.py @@ -7,7 +7,7 @@ from RecExConfig.RecAlgsFlags import recAlgs #conddb.blockFolder("/MDT/RT") #conddb.addFolderWithTag("MDT_OFL","/MDT/RT","MDTRT_Sim-04",force=True,forceMC=True) conddb.blockFolder("/MDT/RTBLOB") -conddb.addFolderWithTag("MDT_OFL","/MDT/RTBLOB","MDTRT_Sim-04-BLOB",force=True,forceMC=True) +conddb.addFolderWithTag("MDT_OFL","/MDT/RTBLOB","MDTRT_Sim-04-BLOB",force=True,forceMC=True,className="CondAttrListCollection") #from Guillaume conddb.blockFolder("/LAR/LArCellPositionShift"); @@ -17,7 +17,7 @@ conddb.addOverride("/LAR/ElecCalibOfl/OFC/PhysWave/RTM/4samples1phase","LARElecC svcMgr.PoolSvc.ReadCatalog+=["xmlcatalog_file:"+"/cvmfs/atlas-condb.cern.ch/repo/conditions/poolcond/PoolFileCatalog.xml"] conddb.blockFolder("/PIXEL/ReadoutSpeed") -conddb.addFolderSplitMC("PIXEL","/PIXEL/ReadoutSpeed","/PIXEL/ReadoutSpeed",force=True) +conddb.addFolderSplitMC("PIXEL","/PIXEL/ReadoutSpeed","/PIXEL/ReadoutSpeed",force=True,className="AthenaAttributeList") conddb.blockFolder("/TRT/Cond/DigVers") conddb.addFolderWithTag("TRT_OFL","/TRT/Cond/DigVers","TRTCondDigVers-Collisions-01",force=True,forceMC=True, @@ -31,10 +31,10 @@ printfunc ("RT OVERRIDE, for OFLCOND-MC16-SDR-23 ") conddb.blockFolder("/LAR/BadChannels/BadChannels"); conddb.blockFolder("/LAR/BadChannelsOfl/BadChannels"); -conddb.addFolderWithTag("LAR_OFL","/LAR/BadChannels/BadChannels","LArBadChannelsBadChannels-IOVDEP-08",force=True,forceMC=True); +conddb.addFolderWithTag("LAR_OFL","/LAR/BadChannels/BadChannels","LArBadChannelsBadChannels-IOVDEP-08",force=True,forceMC=True,className="CondAttrListCollection"); conddb.blockFolder("/LAR/BadChannels/MissingFEBs"); conddb.blockFolder("/LAR/BadChannelsOfl/MissingFEBs"); -conddb.addFolderWithTag("LAR_OFL","/LAR/BadChannels/MissingFEBs","LArBadChannelsMissingFEBs-IOVDEP-04",force=True,forceMC=True) +conddb.addFolderWithTag("LAR_OFL","/LAR/BadChannels/MissingFEBs","LArBadChannelsMissingFEBs-IOVDEP-04",force=True,forceMC=True,className="AthenaAttributeList") if not "EOJT_alignMC" in globals(): printfunc ("EOJT_alignMC not found in globals(), so aligning ID to data conditions") @@ -68,7 +68,7 @@ if DetFlags.writeRDOPool.pixel_on(): conddb.addFolder("PIXEL_OFL","/PIXEL/PixReco") conddb.blockFolder("/PIXEL/PixdEdx") -conddb.addFolderWithTag("PIXEL_OFL","/PIXEL/PixdEdx","PixdEdx-SIM-RUN124-000-00",force=True,forceMC=True) +conddb.addFolderWithTag("PIXEL_OFL","/PIXEL/PixdEdx","PixdEdx-SIM-RUN124-000-00",force=True,forceMC=True,className="AthenaAttributeList") mcIDoverlay=False if mcIDoverlay: printfunc ("ACH777: Using MC overlay Lorentz DB settings") @@ -114,9 +114,9 @@ conddb.addFolderWithTag("MUONALIGN_OFL","/MUONALIGN/TGC/SIDEA","MuonAlignTGCEndC conddb.addFolderWithTag("MUONALIGN_OFL","/MUONALIGN/TGC/SIDEC","MuonAlignTGCEndCapCAlign-0001-DEFAULT",force=True,forceMC=True,className='CondAttrListCollection') conddb.blockFolder("/SCT/DAQ/Config/Chip") -conddb.addFolderSplitMC("SCT","/SCT/DAQ/Config/Chip","/SCT/DAQ/Config/Chip",force=True) +conddb.addFolderSplitMC("SCT","/SCT/DAQ/Config/Chip","/SCT/DAQ/Config/Chip",force=True,className="CondAttrListVec") conddb.blockFolder("/SCT/DAQ/Config/Module") -conddb.addFolderSplitMC("SCT","/SCT/DAQ/Config/Module","/SCT/DAQ/Config/Module",force=True) +conddb.addFolderSplitMC("SCT","/SCT/DAQ/Config/Module","/SCT/DAQ/Config/Module",force=True,className="CondAttrListVec") dofolderoverrides = True if dofolderoverrides: diff --git a/Event/EventOverlay/EventOverlayJobTransforms/share/Rt_override_OFLCOND-MC16-SDR-26.py b/Event/EventOverlay/EventOverlayJobTransforms/share/Rt_override_OFLCOND-MC16-SDR-26.py index 52de09ebb415d8e9353d0f35715814bfdc341cbb..54c3b25854d8dd0a293bec34304be82b7a29e0e9 100644 --- a/Event/EventOverlay/EventOverlayJobTransforms/share/Rt_override_OFLCOND-MC16-SDR-26.py +++ b/Event/EventOverlay/EventOverlayJobTransforms/share/Rt_override_OFLCOND-MC16-SDR-26.py @@ -7,7 +7,7 @@ from RecExConfig.RecAlgsFlags import recAlgs #conddb.blockFolder("/MDT/RT") #conddb.addFolderWithTag("MDT_OFL","/MDT/RT","MDTRT_Sim-04",force=True,forceMC=True) conddb.blockFolder("/MDT/RTBLOB") -conddb.addFolderWithTag("MDT_OFL","/MDT/RTBLOB","MDTRT_Sim-04-BLOB",force=True,forceMC=True) +conddb.addFolderWithTag("MDT_OFL","/MDT/RTBLOB","MDTRT_Sim-04-BLOB",force=True,forceMC=True,className="CondAttrListCollection") #from Guillaume conddb.blockFolder("/LAR/LArCellPositionShift"); @@ -17,7 +17,7 @@ conddb.addOverride("/LAR/ElecCalibOfl/OFC/PhysWave/RTM/4samples1phase","LARElecC svcMgr.PoolSvc.ReadCatalog+=["xmlcatalog_file:"+"/cvmfs/atlas-condb.cern.ch/repo/conditions/poolcond/PoolFileCatalog.xml"] conddb.blockFolder("/PIXEL/ReadoutSpeed") -conddb.addFolderSplitMC("PIXEL","/PIXEL/ReadoutSpeed","/PIXEL/ReadoutSpeed",force=True) +conddb.addFolderSplitMC("PIXEL","/PIXEL/ReadoutSpeed","/PIXEL/ReadoutSpeed",force=True,className="AthenaAttributeList") conddb.blockFolder("/TRT/Cond/DigVers") conddb.addFolderWithTag("TRT_OFL","/TRT/Cond/DigVers","TRTCondDigVers-Collisions-01",force=True,forceMC=True, @@ -31,10 +31,10 @@ printfunc ("RT OVERRIDE, for OFLCOND-MC16-SDR-26 MC condition tag ") conddb.blockFolder("/LAR/BadChannels/BadChannels"); conddb.blockFolder("/LAR/BadChannelsOfl/BadChannels"); -conddb.addFolderWithTag("LAR_OFL","/LAR/BadChannels/BadChannels","LArBadChannelsBadChannels-IOVDEP-08",force=True,forceMC=True); +conddb.addFolderWithTag("LAR_OFL","/LAR/BadChannels/BadChannels","LArBadChannelsBadChannels-IOVDEP-08",force=True,forceMC=True,className="CondAttrListCollection"); conddb.blockFolder("/LAR/BadChannels/MissingFEBs"); conddb.blockFolder("/LAR/BadChannelsOfl/MissingFEBs"); -conddb.addFolderWithTag("LAR_OFL","/LAR/BadChannels/MissingFEBs","LArBadChannelsMissingFEBs-IOVDEP-04",force=True,forceMC=True) +conddb.addFolderWithTag("LAR_OFL","/LAR/BadChannels/MissingFEBs","LArBadChannelsMissingFEBs-IOVDEP-04",force=True,forceMC=True,className="AthenaAttributeList") if not "EOJT_alignMC" in globals(): printfunc ("EOJT_alignMC not found in globals(), so aligning ID to data conditions") @@ -68,7 +68,7 @@ if DetFlags.writeRDOPool.pixel_on(): conddb.addFolder("PIXEL_OFL","/PIXEL/PixReco") conddb.blockFolder("/PIXEL/PixdEdx") -conddb.addFolderWithTag("PIXEL_OFL","/PIXEL/PixdEdx","PixdEdx-SIM-RUN124-000-00",force=True,forceMC=True) +conddb.addFolderWithTag("PIXEL_OFL","/PIXEL/PixdEdx","PixdEdx-SIM-RUN124-000-00",force=True,forceMC=True,className="AthenaAttributeList") mcIDoverlay=False if mcIDoverlay: printfunc ("ACH777: Using MC overlay Lorentz DB settings") @@ -106,9 +106,9 @@ conddb.addFolderWithTag("MUONALIGN_OFL","/MUONALIGN/TGC/SIDEA","MuonAlignTGCEndC conddb.addFolderWithTag("MUONALIGN_OFL","/MUONALIGN/TGC/SIDEC","MuonAlignTGCEndCapCAlign-0001-DEFAULT",force=True,forceMC=True,className='CondAttrListCollection') conddb.blockFolder("/SCT/DAQ/Config/Chip") -conddb.addFolderSplitMC("SCT","/SCT/DAQ/Config/Chip","/SCT/DAQ/Config/Chip",force=True) +conddb.addFolderSplitMC("SCT","/SCT/DAQ/Config/Chip","/SCT/DAQ/Config/Chip",force=True,className="CondAttrListVec") conddb.blockFolder("/SCT/DAQ/Config/Module") -conddb.addFolderSplitMC("SCT","/SCT/DAQ/Config/Module","/SCT/DAQ/Config/Module",force=True) +conddb.addFolderSplitMC("SCT","/SCT/DAQ/Config/Module","/SCT/DAQ/Config/Module",force=True,className="CondAttrListVec") dofolderoverrides = True runN=365681 diff --git a/Event/EventOverlay/EventOverlayJobTransforms/share/Rt_override_OFLCOND-MC16-SDR-26_folders100M.py b/Event/EventOverlay/EventOverlayJobTransforms/share/Rt_override_OFLCOND-MC16-SDR-26_folders100M.py index d3ac9ef535aa00f719dca662f20677df25fd8bd3..40622f6a7e96f1d9932e6dc5fbd7ae8168de6e4c 100644 --- a/Event/EventOverlay/EventOverlayJobTransforms/share/Rt_override_OFLCOND-MC16-SDR-26_folders100M.py +++ b/Event/EventOverlay/EventOverlayJobTransforms/share/Rt_override_OFLCOND-MC16-SDR-26_folders100M.py @@ -7,7 +7,7 @@ from RecExConfig.RecAlgsFlags import recAlgs #conddb.blockFolder("/MDT/RT") #conddb.addFolderWithTag("MDT_OFL","/MDT/RT","MDTRT_Sim-04",force=True,forceMC=True) conddb.blockFolder("/MDT/RTBLOB") -conddb.addFolderWithTag("MDT_OFL","/MDT/RTBLOB","MDTRT_Sim-04-BLOB",force=True,forceMC=True) +conddb.addFolderWithTag("MDT_OFL","/MDT/RTBLOB","MDTRT_Sim-04-BLOB",force=True,forceMC=True,className="CondAttrListCollection") #from Guillaume conddb.blockFolder("/LAR/LArCellPositionShift"); @@ -17,7 +17,7 @@ conddb.addOverride("/LAR/ElecCalibOfl/OFC/PhysWave/RTM/4samples1phase","LARElecC svcMgr.PoolSvc.ReadCatalog+=["xmlcatalog_file:"+"/cvmfs/atlas-condb.cern.ch/repo/conditions/poolcond/PoolFileCatalog.xml"] conddb.blockFolder("/PIXEL/ReadoutSpeed") -conddb.addFolderSplitMC("PIXEL","/PIXEL/ReadoutSpeed","/PIXEL/ReadoutSpeed",force=True) +conddb.addFolderSplitMC("PIXEL","/PIXEL/ReadoutSpeed","/PIXEL/ReadoutSpeed",force=True,className="AthenaAttributeList") conddb.blockFolder("/TRT/Cond/DigVers") conddb.addFolderWithTag("TRT_OFL","/TRT/Cond/DigVers","TRTCondDigVers-Collisions-01",force=True,forceMC=True, @@ -31,10 +31,10 @@ printfunc ("RT OVERRIDE, for OFLCOND-MC16-SDR-26 ") conddb.blockFolder("/LAR/BadChannels/BadChannels"); conddb.blockFolder("/LAR/BadChannelsOfl/BadChannels"); -conddb.addFolderWithTag("LAR_OFL","/LAR/BadChannels/BadChannels","LArBadChannelsBadChannels-IOVDEP-08",force=True,forceMC=True); +conddb.addFolderWithTag("LAR_OFL","/LAR/BadChannels/BadChannels","LArBadChannelsBadChannels-IOVDEP-08",force=True,forceMC=True,className="CondAttrListCollection"); conddb.blockFolder("/LAR/BadChannels/MissingFEBs"); conddb.blockFolder("/LAR/BadChannelsOfl/MissingFEBs"); -conddb.addFolderWithTag("LAR_OFL","/LAR/BadChannels/MissingFEBs","LArBadChannelsMissingFEBs-IOVDEP-04",force=True,forceMC=True) +conddb.addFolderWithTag("LAR_OFL","/LAR/BadChannels/MissingFEBs","LArBadChannelsMissingFEBs-IOVDEP-04",force=True,forceMC=True,className="AthenaAttributeList") if not "EOJT_alignMC" in globals(): printfunc ("EOJT_alignMC not found in globals(), so aligning ID to data conditions") @@ -68,7 +68,7 @@ if DetFlags.writeRDOPool.pixel_on(): conddb.addFolder("PIXEL_OFL","/PIXEL/PixReco") conddb.blockFolder("/PIXEL/PixdEdx") -conddb.addFolderWithTag("PIXEL_OFL","/PIXEL/PixdEdx","PixdEdx-SIM-RUN124-000-00",force=True,forceMC=True) +conddb.addFolderWithTag("PIXEL_OFL","/PIXEL/PixdEdx","PixdEdx-SIM-RUN124-000-00",force=True,forceMC=True,className="AthenaAttributeList") mcIDoverlay=False if mcIDoverlay: printfunc ("ACH777: Using MC overlay Lorentz DB settings") @@ -104,9 +104,9 @@ conddb.addFolderWithTag("MUONALIGN_OFL","/MUONALIGN/TGC/SIDEA","MuonAlignTGCEndC conddb.addFolderWithTag("MUONALIGN_OFL","/MUONALIGN/TGC/SIDEC","MuonAlignTGCEndCapCAlign-0001-DEFAULT",force=True,forceMC=True,className='CondAttrListCollection') conddb.blockFolder("/SCT/DAQ/Config/Chip") -conddb.addFolderSplitMC("SCT","/SCT/DAQ/Config/Chip","/SCT/DAQ/Config/Chip",force=True) +conddb.addFolderSplitMC("SCT","/SCT/DAQ/Config/Chip","/SCT/DAQ/Config/Chip",force=True,className="CondAttrListVec") conddb.blockFolder("/SCT/DAQ/Config/Module") -conddb.addFolderSplitMC("SCT","/SCT/DAQ/Config/Module","/SCT/DAQ/Config/Module",force=True) +conddb.addFolderSplitMC("SCT","/SCT/DAQ/Config/Module","/SCT/DAQ/Config/Module",force=True,className="CondAttrListVec") dofolderoverrides = True if dofolderoverrides: diff --git a/Event/EventOverlay/EventOverlayJobTransforms/share/Rt_override_OFLCOND-MC16-SDR-27.py b/Event/EventOverlay/EventOverlayJobTransforms/share/Rt_override_OFLCOND-MC16-SDR-27.py index 5b997f90004ede866f1384da0a31f68aadee12bf..c9d33be0789a5c1c90abbf371a1dcf8bd3706715 100644 --- a/Event/EventOverlay/EventOverlayJobTransforms/share/Rt_override_OFLCOND-MC16-SDR-27.py +++ b/Event/EventOverlay/EventOverlayJobTransforms/share/Rt_override_OFLCOND-MC16-SDR-27.py @@ -7,7 +7,7 @@ from RecExConfig.RecAlgsFlags import recAlgs #conddb.blockFolder("/MDT/RT") #conddb.addFolderWithTag("MDT_OFL","/MDT/RT","MDTRT_Sim-04",force=True,forceMC=True) conddb.blockFolder("/MDT/RTBLOB") -conddb.addFolderWithTag("MDT_OFL","/MDT/RTBLOB","MDTRT_Sim-04-BLOB",force=True,forceMC=True) +conddb.addFolderWithTag("MDT_OFL","/MDT/RTBLOB","MDTRT_Sim-04-BLOB",force=True,forceMC=True,className="CondAttrListCollection") #from Guillaume conddb.blockFolder("/LAR/LArCellPositionShift"); @@ -17,7 +17,7 @@ conddb.addOverride("/LAR/ElecCalibOfl/OFC/PhysWave/RTM/4samples1phase","LARElecC svcMgr.PoolSvc.ReadCatalog+=["xmlcatalog_file:"+"/cvmfs/atlas-condb.cern.ch/repo/conditions/poolcond/PoolFileCatalog.xml"] conddb.blockFolder("/PIXEL/ReadoutSpeed") -conddb.addFolderSplitMC("PIXEL","/PIXEL/ReadoutSpeed","/PIXEL/ReadoutSpeed",force=True) +conddb.addFolderSplitMC("PIXEL","/PIXEL/ReadoutSpeed","/PIXEL/ReadoutSpeed",force=True,className="AthenaAttributeList") conddb.blockFolder("/TRT/Cond/DigVers") conddb.addFolderWithTag("TRT_OFL","/TRT/Cond/DigVers","TRTCondDigVers-Collisions-01",force=True,forceMC=True, @@ -31,10 +31,10 @@ printfunc ("RT OVERRIDE, for OFLCOND-MC16-SDR-27 MC condition tag ") conddb.blockFolder("/LAR/BadChannels/BadChannels"); conddb.blockFolder("/LAR/BadChannelsOfl/BadChannels"); -conddb.addFolderWithTag("LAR_OFL","/LAR/BadChannels/BadChannels","LArBadChannelsBadChannels-IOVDEP-08",force=True,forceMC=True); +conddb.addFolderWithTag("LAR_OFL","/LAR/BadChannels/BadChannels","LArBadChannelsBadChannels-IOVDEP-08",force=True,forceMC=True,className="CondAttrListCollection"); conddb.blockFolder("/LAR/BadChannels/MissingFEBs"); conddb.blockFolder("/LAR/BadChannelsOfl/MissingFEBs"); -conddb.addFolderWithTag("LAR_OFL","/LAR/BadChannels/MissingFEBs","LArBadChannelsMissingFEBs-IOVDEP-04",force=True,forceMC=True) +conddb.addFolderWithTag("LAR_OFL","/LAR/BadChannels/MissingFEBs","LArBadChannelsMissingFEBs-IOVDEP-04",force=True,forceMC=True,className="AthenaAttributeList") if not "EOJT_alignMC" in globals(): printfunc ("EOJT_alignMC not found in globals(), so aligning ID to data conditions") @@ -62,7 +62,7 @@ if DetFlags.writeRDOPool.pixel_on(): conddb.addFolder("PIXEL_OFL","/PIXEL/PixReco") conddb.blockFolder("/PIXEL/PixdEdx") -conddb.addFolderWithTag("PIXEL_OFL","/PIXEL/PixdEdx","PixdEdx-SIM-RUN124-000-00",force=True,forceMC=True) +conddb.addFolderWithTag("PIXEL_OFL","/PIXEL/PixdEdx","PixdEdx-SIM-RUN124-000-00",force=True,forceMC=True,className="AthenaAttributeList") mcIDoverlay=True if mcIDoverlay: printfunc ("ACH777: Using MC overlay Lorentz DB settings") @@ -102,9 +102,9 @@ conddb.addFolderWithTag("MUONALIGN_OFL","/MUONALIGN/TGC/SIDEA","MuonAlignTGCEndC conddb.addFolderWithTag("MUONALIGN_OFL","/MUONALIGN/TGC/SIDEC","MuonAlignTGCEndCapCAlign-0001-DEFAULT",force=True,forceMC=True,className='CondAttrListCollection') conddb.blockFolder("/SCT/DAQ/Config/Chip") -conddb.addFolderSplitMC("SCT","/SCT/DAQ/Config/Chip","/SCT/DAQ/Config/Chip",force=True) +conddb.addFolderSplitMC("SCT","/SCT/DAQ/Config/Chip","/SCT/DAQ/Config/Chip",force=True,className="CondAttrListVec") conddb.blockFolder("/SCT/DAQ/Config/Module") -conddb.addFolderSplitMC("SCT","/SCT/DAQ/Config/Module","/SCT/DAQ/Config/Module",force=True) +conddb.addFolderSplitMC("SCT","/SCT/DAQ/Config/Module","/SCT/DAQ/Config/Module",force=True,className="CondAttrListVec") dofolderoverrides = True runN=365681 diff --git a/Event/EventOverlay/EventOverlayJobTransforms/share/Rt_override_old.py b/Event/EventOverlay/EventOverlayJobTransforms/share/Rt_override_old.py index 08be4e5deb40848a3ce9e0dc4bd5d7b8724a04a2..21112501e6e14f992e4a898bfce1dad540714f0f 100755 --- a/Event/EventOverlay/EventOverlayJobTransforms/share/Rt_override_old.py +++ b/Event/EventOverlay/EventOverlayJobTransforms/share/Rt_override_old.py @@ -12,14 +12,14 @@ conddb.addFolderWithTag("TRT_OFL","/TRT/Calib/RT","TrtCalibRt-MC09_900GeV-REP-Fi conddb.blockFolder("/MDT/RT") conddb.addFolderWithTag("MDT_OFL","/MDT/RT","MDTRT_Sim-00",force=True,forceMC=True) conddb.blockFolder("/MDT/RTBLOB") -conddb.addFolderWithTag("MDT_OFL","/MDT/RTBLOB","MDTRT_Sim-00-BLOB",force=True,forceMC=True) +conddb.addFolderWithTag("MDT_OFL","/MDT/RTBLOB","MDTRT_Sim-00-BLOB",force=True,forceMC=True,className="CondAttrListCollection") conddb.blockFolder("/PIXEL/HLT/DCS/HV") conddb.addFolderWithTag("PIXEL_ONL","/PIXEL/HLT/DCS/HV","PixDCSHV-UPD1-00",force=True,forceData=True) conddb.blockFolder("/PIXEL/HLT/DCS/TEMPERATURE") conddb.addFolderWithTag("PIXEL_ONL","/PIXEL/HLT/DCS/TEMPERATURE","PixDCSTemp-UPD1-00",force=True,forceData=True) conddb.blockFolder("/PIXEL/ReadoutSpeed") -conddb.addFolderSplitMC("PIXEL","/PIXEL/ReadoutSpeed","/PIXEL/ReadoutSpeed",force=True) +conddb.addFolderSplitMC("PIXEL","/PIXEL/ReadoutSpeed","/PIXEL/ReadoutSpeed",force=True,className="AthenaAttributeList") conddb.blockFolder("/TRT/Cond/DigVers") conddb.addFolderWithTag("TRT_OFL","/TRT/Cond/DigVers","TRTCondDigVers-Collisions-01",force=True,forceMC=True, diff --git a/Event/xAOD/xAODEventFormat/CMakeLists.txt b/Event/xAOD/xAODEventFormat/CMakeLists.txt index c5ebb7ade25739f7700feaf0f101265a4423c58f..fe247a485ef2f775040cf8728553119fdf08e5b9 100644 --- a/Event/xAOD/xAODEventFormat/CMakeLists.txt +++ b/Event/xAOD/xAODEventFormat/CMakeLists.txt @@ -1,28 +1,20 @@ -################################################################################ -# Package: xAODEventFormat -################################################################################ +# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration -# Declare the package name: +# Declare the package name. atlas_subdir( xAODEventFormat ) -# Declare the package's dependencies: -atlas_depends_on_subdirs( PUBLIC - Event/xAOD/xAODCore ) - -# External dependencies: -find_package( ROOT COMPONENTS Core Tree MathCore Hist RIO pthread ) - -# Component(s) in the package: +# Component(s) in the package. atlas_add_library( xAODEventFormat - Root/*.cxx - PUBLIC_HEADERS xAODEventFormat - PRIVATE_INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} - LINK_LIBRARIES xAODCore - PRIVATE_LINK_LIBRARIES ${ROOT_LIBRARIES} ) + xAODEventFormat/*.h xAODEventFormat/versions/*.h Root/*.cxx + PUBLIC_HEADERS xAODEventFormat + LINK_LIBRARIES xAODCore ) atlas_add_dictionary( xAODEventFormatDict - xAODEventFormat/xAODEventFormatDict.h - xAODEventFormat/selection.xml - INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} - LINK_LIBRARIES ${ROOT_LIBRARIES} xAODCore xAODEventFormat ) + xAODEventFormat/xAODEventFormatDict.h + xAODEventFormat/selection.xml + LINK_LIBRARIES xAODCore xAODEventFormat ) +# Test(s) in the package. +atlas_add_test( eventformat_test + SOURCES test/ut_xaodeventformat_eventformat_test.cxx + LINK_LIBRARIES xAODEventFormat ) diff --git a/Event/xAOD/xAODEventFormat/share/eventformat_test.ref b/Event/xAOD/xAODEventFormat/share/eventformat_test.ref new file mode 100644 index 0000000000000000000000000000000000000000..e0f9b2861ad036669f801458cbd139bf76568484 --- /dev/null +++ b/Event/xAOD/xAODEventFormat/share/eventformat_test.ref @@ -0,0 +1,3 @@ +xAOD::EventFormat: +1. element: Branch name: SGKey1, Class name: xAOD::Type1, Hash: 0x00000101 +2. element: Branch name: SGKey2, Class name: xAOD::Type2, Hash: 0x00000102 diff --git a/Event/xAOD/xAODEventFormat/test/ut_xaodeventformat_eventformat_test.cxx b/Event/xAOD/xAODEventFormat/test/ut_xaodeventformat_eventformat_test.cxx index 559b64a4d98a73967d0d797372448cd8424fd038..855fac6ede18c9eeec3faed216ca19f57a0f7fe3 100644 --- a/Event/xAOD/xAODEventFormat/test/ut_xaodeventformat_eventformat_test.cxx +++ b/Event/xAOD/xAODEventFormat/test/ut_xaodeventformat_eventformat_test.cxx @@ -1,31 +1,29 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ -// $Id: ut_xaodeventformat_eventformat_test.cxx 629218 2014-11-18 17:38:06Z krasznaa $ +// Local include(s). +#include "xAODEventFormat/EventFormat.h" -// System include(s): +// System include(s). +#undef NDEBUG +#include <cassert> #include <iostream> -// Local include(s): -#include "xAODEventFormat/EventFormat.h" +void test1( const xAOD::EventFormat& ef ) { -/// The name of the application -static const char* APP_NAME = "ut_xaodeventformat_eventformat_test"; - -/// Simple macro for checking boolean expressions -#define SIMPLE_ASSERT( EXP ) \ - do { \ - const bool ret = EXP; \ - if( ! ret ) { \ - std::cerr << APP_NAME << " " __FILE__ << ":" \ - << __LINE__ << " (" \ - << __PRETTY_FUNCTION__ << ") Failed to " \ - << "evaluate: \"" << #EXP << "\"" \ - << std::endl; \ - return 1; \ - } \ - } while( 0 ) + // Some simple checks: + assert( ef.exists( "SGKey1" ) == true ); + assert( ef.exists( 0x102 ) == true ); + assert( ef.exists( "SGKey3" ) == false ); + assert( ef.exists( 0x123 ) == false ); + assert( ef.get( 0x101 ) ); + assert( ef.get( "SGKey2" ) ); + assert( ef.get( 0x101 )->branchName() == "SGKey1" ); + assert( ef.get( "SGKey1" )->className() == "xAOD::Type1" ); + assert( ef.get( "SGKey2" )->hash() == 0x102 ); + assert( ef.get( 0x102 )->parentName() == "Bla" ); +} int main() { @@ -36,19 +34,20 @@ int main() { ef.add( xAOD::EventFormatElement( "SGKey1", "xAOD::Type1", "Bla", 0x101 ) ); ef.add( xAOD::EventFormatElement( "SGKey2", "xAOD::Type2", "Bla", 0x102 ) ); - // Some simple checks: - SIMPLE_ASSERT( ef.exists( "SGKey1" ) == true ); - SIMPLE_ASSERT( ef.exists( 0x102 ) == true ); - SIMPLE_ASSERT( ef.exists( "SGKey3" ) == false ); - SIMPLE_ASSERT( ef.exists( 0x123 ) == false ); - SIMPLE_ASSERT( ef.get( 0x101 ) ); - SIMPLE_ASSERT( ef.get( "SGKey2" ) ); - SIMPLE_ASSERT( ef.get( 0x101 )->branchName() == "SGKey1" ); - SIMPLE_ASSERT( ef.get( "SGKey1" )->className() == "xAOD::Type1" ); - SIMPLE_ASSERT( ef.get( "SGKey2" )->hash() == 0x102 ); - SIMPLE_ASSERT( ef.get( 0x102 )->parentName() == "Bla" ); - - // And finally print it: + // Execute simple tests on it. + test1( ef ); + + // Test that the object can be copied correctly using the automatically + // generated constructors/copy operators. + xAOD::EventFormat copy1( ef ); + xAOD::EventFormat copy2; + copy2 = ef; + + // Test the two copies. + test1( copy1 ); + test1( copy2 ); + + // And finally print the object. std::cout << ef << std::endl; // Return gracefully: diff --git a/Event/xAOD/xAODEventFormatCnv/ATLAS_CHECK_THREAD_SAFETY b/Event/xAOD/xAODEventFormatCnv/ATLAS_CHECK_THREAD_SAFETY new file mode 100644 index 0000000000000000000000000000000000000000..17d5abf4053f183bffd46a0d92a314d5af92c39c --- /dev/null +++ b/Event/xAOD/xAODEventFormatCnv/ATLAS_CHECK_THREAD_SAFETY @@ -0,0 +1 @@ +Event/xAOD/xAODEventFormatCnv diff --git a/Event/xAOD/xAODEventFormatCnv/CMakeLists.txt b/Event/xAOD/xAODEventFormatCnv/CMakeLists.txt index e7587ed6183d467a09f8ecbd20eaf853ee04945d..b488fbda41a57d2a3b031d51d638142078b91e9f 100644 --- a/Event/xAOD/xAODEventFormatCnv/CMakeLists.txt +++ b/Event/xAOD/xAODEventFormatCnv/CMakeLists.txt @@ -1,26 +1,90 @@ -################################################################################ -# Package: xAODEventFormatCnv -################################################################################ +# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration -# Declare the package name: +# Declare the package name. atlas_subdir( xAODEventFormatCnv ) -# Declare the package's dependencies: -atlas_depends_on_subdirs( PUBLIC - Event/xAOD/xAODEventFormat - GaudiKernel - PRIVATE - Control/AthContainers - Control/AthenaBaseComps - Control/AthenaKernel - Control/StoreGate ) - -# Component(s) in the package: +find_package( xAODUtilities ) + atlas_add_component( xAODEventFormatCnv - src/*.cxx - src/components/*.cxx - LINK_LIBRARIES xAODEventFormat GaudiKernel AthContainers AthenaBaseComps AthenaKernel StoreGateLib SGtests ) + src/*.h src/*.cxx src/components/*.cxx + LINK_LIBRARIES + GaudiKernel AthenaKernel AthenaBaseComps StoreGateLib xAODEventFormat ) + +atlas_add_component( xAODEventFormatCnvTest + src/test/*.h src/test/*.cxx + LINK_LIBRARIES + GaudiKernel + AthenaBaseComps + AthContainers + AthContainersInterfaces + StoreGateLib + xAODCore + xAODEventFormat ) + +atlas_add_library( xAODEventFormatCnvTestLib + src/test/*.h src/test/*.cxx + PUBLIC_HEADERS xAODEventFormatCnv + PRIVATE_INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} + LINK_LIBRARIES + GaudiKernel + AthenaKernel + AthContainers + AthContainersInterfaces + xAODCore + xAODEventFormat + PRIVATE_LINK_LIBRARIES AthenaBaseComps StoreGateLib ) + + +atlas_add_poolcnv_library( xAODEventFormatCnvTestAthenaPoolCnv + src/test/cnv/*.h src/test/cnv/*.cxx + FILES + xAODEventFormatCnv/test/A.h + xAODEventFormatCnv/test/AVec.h + xAODEventFormatCnv/test/AAuxContainer.h + TYPES_WITH_NAMESPACE + xAODMakerTest::A + xAODMakerTest::AVec + xAODMakerTest::AAuxContainer + CNV_PFX xAODMakerTest + LINK_LIBRARIES + AthenaPoolCnvSvcLib + AthenaPoolUtilities + AthContainers + xAODEventFormatCnvTestLib ) + +atlas_add_dictionary( xAODEventFormatCnvTestDict + xAODEventFormatCnv/test/xAODEventFormatCnvTestDict.h + xAODEventFormatCnv/test/selection.xml + ${_selectionFile} + INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} + LINK_LIBRARIES xAODCore xAODEventFormatCnvTestLib + EXTRA_FILES src/test/dict/*.cxx ) + +atlas_add_xaod_smart_pointer_dicts( + INPUT xAODEventFormatCnv/test/selection.xml + OUTPUT _selectionFile + CONTAINERS "xAODMakerTest::AVec_v1" ) + + +# Install files from the package. +atlas_install_joboptions( share/*.py ) + +atlas_depends_on_subdirs( + PUBLIC + PRIVATE AtlasTest/TestTools ) + +# Test(s) in the package. +atlas_add_test( Write + SCRIPT athena.py --threads=8 xAODEventFormatCnv/EventFormatWriteTestJobOptions.py ) + +atlas_add_test( Read + SCRIPT athena.py --threads=8 xAODEventFormatCnv/EventFormatReadTestJobOptions.py + PROPERTIES DEPENDS "xAODEventFormatCnv_Write_ctest" ) -# Install files from the package: -atlas_install_headers( xAODEventFormatCnv ) +atlas_add_test( ReadWrite + SCRIPT athena.py --threads=8 xAODEventFormatCnv/EventFormatReadWriteJobOptions.py + PROPERTIES DEPENDS "xAODEventFormatCnv_Write_ctest" ) +atlas_add_test( Content + SCRIPT test/TestEventFormatContent.py readWriteTestStream0.pool.root EventFormat + PROPERTIES DEPENDS "xAODEventFormatCnv_ReadWrite_ctest" ) diff --git a/Event/xAOD/xAODEventFormatCnv/share/EventFormatReadTestJobOptions.py b/Event/xAOD/xAODEventFormatCnv/share/EventFormatReadTestJobOptions.py new file mode 100644 index 0000000000000000000000000000000000000000..00c39c8f1483d1fe1e84cd37a600fbc20b487b44 --- /dev/null +++ b/Event/xAOD/xAODEventFormatCnv/share/EventFormatReadTestJobOptions.py @@ -0,0 +1,43 @@ +# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration +"""Test reading xAOD::EventFormat + +Read in POOL files created by the write test job options. Uses the metadata +tool to transcribe the EventFormat metadata to the MetaDataStore. Then an +algorithm reads the EventFormat from the MetaDataStore and prints the content. + + Typical usage example + 1. run: athena xAODEventFormatCnv/EventFormatWriteTestJobOptions.py + 2. run: athena xAODEventFormatCnv/EventFormatReadTestJobOptions.py +""" +from AthenaCommon import CfgMgr +from AthenaCommon.AlgSequence import AlgSequence +from AthenaCommon.AppMgr import ServiceMgr as svcMgr +from AthenaCommon.AppMgr import theApp +from AthenaCommon.AppMgr import ToolSvc +import AthenaPoolCnvSvc.ReadAthenaPool + + +# grab input files +svcMgr.EventSelector.InputCollections = [ + "testStream0.pool.root", + "testStream1.pool.root", + "testStream2.pool.root", + "testStream3.pool.root", + "testStream4.pool.root", +] + +# propogate xAOD::EventFormat from InputMetaDataStore to MetaDataStore +ToolSvc += CfgMgr.xAODMaker__EventFormatMetaDataTool( + "EventFormatMetaDataTool", + OutputLevel=1, +) +svcMgr.MetaDataSvc.MetaDataTools += [ToolSvc.EventFormatMetaDataTool] + + +# Add the xAOD::EventFormat printer algorithm to main algorithm sequence +algSeq = AlgSequence() +algSeq += CfgMgr.xAODMakerTest__EventFormatPrinterAlg() + +# read the last event of the first file and the first event of the second file +# to test metadata access across file boundary +theApp.EvtMax = -1 diff --git a/Event/xAOD/xAODEventFormatCnv/share/EventFormatReadWriteJobOptions.py b/Event/xAOD/xAODEventFormatCnv/share/EventFormatReadWriteJobOptions.py new file mode 100644 index 0000000000000000000000000000000000000000..3764709cce5db7d51058df87979bd7fc928e9d0c --- /dev/null +++ b/Event/xAOD/xAODEventFormatCnv/share/EventFormatReadWriteJobOptions.py @@ -0,0 +1,77 @@ +# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration +"""Test writing xAOD::EventFormat in job reading from input + +Read in POOL files created by the write test job options. Uses the metadata +tool to transcribe the EventFormat metadata to the MetaDataStore. Then an +algorithm reads the EventFormat from the MetaDataStore and prints the content. + + Typical usage example + 1. run: athena xAODEventFormatCnv/EventFormatWriteTestJobOptions.py + 2. run: athena xAODEventFormatCnv/EventFormatReadWriteTestJobOptions.py +""" +from AthenaCommon import CfgMgr +from AthenaCommon.AlgSequence import AlgSequence +from AthenaCommon.AppMgr import ServiceMgr as svcMgr +from AthenaCommon.AppMgr import theApp +from AthenaCommon.AppMgr import ToolSvc +import AthenaPoolCnvSvc.ReadAthenaPool +from xAODEventInfoCnv.xAODEventInfoCreator import xAODMaker__EventInfoCnvAlg +from OutputStreamAthenaPool.MultipleStreamManager import MSMgr + +VERBOSE = 1 +DEBUG = 2 +INFO = 3 +NUMBER_OF_STREAMS = 1 + + +def makeStream(name='TestStream'): + """create and return an output stream""" + test_stream = MSMgr.NewStream( + StreamName=name, + FileName="{}.pool.root".format(name), + noTag=True, + ) + # Add dummy items for testing + test_stream.AddItem("xAOD::ElectronContainer#TestElectrons") + test_stream.AddItem("xAOD::ElectronAuxContainer#TestElectronsAux.") + return test_stream + + +# grab input files +svcMgr.EventSelector.InputCollections = [ + "testStream0.pool.root", + "testStream1.pool.root", +] + +# propogate xAOD::EventFormat from InputMetaDataStore to MetaDataStore +ToolSvc += CfgMgr.xAODMaker__EventFormatMetaDataTool( + "EventFormatMetaDataTool", + OutputLevel=VERBOSE, +) +svcMgr.MetaDataSvc.MetaDataTools += [ToolSvc.EventFormatMetaDataTool] + + +# Add the xAOD::EventFormat printer algorithm to main algorithm sequence +algSeq = AlgSequence() +algSeq += CfgMgr.xAODMakerTest__EventFormatPrinterAlg() + + +# Add (an) xAOD creator algorithm(s) to the job. +algSeq += CfgMgr.xAODMakerTest__ACreatorAlg( + "ACreator", OutputKey="TestObjects2" +) + +# Write some output streams to file with this container. +streams = [ + makeStream('readWriteTestStream{}'.format(i)) for i in range(NUMBER_OF_STREAMS) +] + +# Make sure event info is available +algSeq += xAODMaker__EventInfoCnvAlg() + +svcMgr.MessageSvc.OutputLevel = INFO +svcMgr.MetaDataSvc.OutputLevel = DEBUG + +# read the last event of the first file and the first event of the second file +# to test metadata access across file boundary +theApp.EvtMax = -1 diff --git a/Event/xAOD/xAODEventFormatCnv/share/EventFormatWriteTestJobOptions.py b/Event/xAOD/xAODEventFormatCnv/share/EventFormatWriteTestJobOptions.py new file mode 100644 index 0000000000000000000000000000000000000000..20cd4fba85ff4c8f070c8ec834a4d9e327ed82a3 --- /dev/null +++ b/Event/xAOD/xAODEventFormatCnv/share/EventFormatWriteTestJobOptions.py @@ -0,0 +1,63 @@ +# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration +"""Test writing event format information + +Open an arbitrary number of streams to write to. An algorithm creates dummy +electrons. The EventFormatStreamHelperTool creates the corresponding +EventFormat metadata in the output stream. + + Typical usage example: + + athena xAODEventFormatCnv/EventFormatWriteTestJobOptions.py +""" +from AthenaCommon import CfgMgr +from AthenaCommon.AlgSequence import AlgSequence +from AthenaCommon.AppMgr import theApp +from AthenaCommon.AppMgr import ServiceMgr as svcMgr +from xAODEventInfoCnv.xAODEventInfoCreator import xAODMaker__EventInfoCnvAlg +from OutputStreamAthenaPool.MultipleStreamManager import MSMgr +from xAODEventFormatCnv.xAODEventFormatCnvConf import xAODMaker__EventFormatStreamHelperTool + + +DEBUG = 2 +INFO = 3 +EVENTS_PER_FILE = 5 +NUMBER_OF_STREAMS = 5 + + +def makeStream(name='TestStream'): + """create and return an output stream""" + test_stream = MSMgr.NewStream( + StreamName=name, + FileName="{}.pool.root".format(name), + noTag=True, + ) + # Add dummy items for testing + test_stream.AddItem("xAODMakerTest::AVec#TestAVec") + test_stream.AddItem("xAODMakerTest::AAuxContainer#TestAAuxContainer.") + for tool in test_stream.GetEventStream().HelperTools: + if isinstance(tool, xAODMaker__EventFormatStreamHelperTool): + tool.TypeNames += ['.*xAODMakerTest::.*'] + break + return test_stream + + +algSeq = AlgSequence() + +# Add (an) xAOD creator algorithm(s) to the job. +algSeq += CfgMgr.xAODMakerTest__ACreatorAlg( + "ACreator", OutputKey="TestObject" +) + +# Write some output streams to file with this container. +streams = [ + makeStream('testStream{}'.format(i)) for i in range(NUMBER_OF_STREAMS) +] + +# Make sure event info is available +algSeq += xAODMaker__EventInfoCnvAlg() + +# Some extra job parameters. +theApp.EvtMax = EVENTS_PER_FILE + +svcMgr.MessageSvc.OutputLevel = INFO +svcMgr.MetaDataSvc.OutputLevel = DEBUG diff --git a/Event/xAOD/xAODEventFormatCnv/src/EventFormatMetaDataTool.cxx b/Event/xAOD/xAODEventFormatCnv/src/EventFormatMetaDataTool.cxx index c3092d2ac630bf8a92f71ecd12f168904f86922e..00de2a04b643d966a30fd1fb431f24d78fb1fee9 100644 --- a/Event/xAOD/xAODEventFormatCnv/src/EventFormatMetaDataTool.cxx +++ b/Event/xAOD/xAODEventFormatCnv/src/EventFormatMetaDataTool.cxx @@ -1,13 +1,13 @@ // Dear emacs, this is -*- c++ -*- - -/* - Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration -*/ +/* Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ // $Id: EventFormatMetaDataTool.cxx 651874 2015-03-05 14:16:19Z krasznaa $ // System include(s): +#include <algorithm> #include <stdexcept> +#include <utility> +#include <vector> // Gaudi/Athena include(s): #include "AthenaKernel/errorcheck.h" @@ -17,126 +17,132 @@ namespace xAODMaker { - /// Name of the incident sent around for metadata writing - //static const char* METADATASTOP = "MetaDataStop"; - - EventFormatMetaDataTool::EventFormatMetaDataTool( const std::string& type, - const std::string& name, - const IInterface* parent ) - : AthAlgTool( type, name, parent ), - m_inputMetaStore( "StoreGateSvc/InputMetaDataStore", name ), - m_outputMetaStore( "StoreGateSvc/MetaDataStore", name ), - m_format() { - - declareProperty( "InputMetaStore", m_inputMetaStore ); - declareProperty( "OutputMetaStore", m_outputMetaStore ); - declareProperty( "InputKey", m_inputKey = "EventFormat" ); - declareProperty( "OutputKey", m_outputKey = "EventFormat" ); - - declareInterface< ::IMetaDataTool >( this ); - } - - StatusCode EventFormatMetaDataTool::initialize() { +EventFormatMetaDataTool::EventFormatMetaDataTool(const std::string& type, + const std::string& name, + const IInterface* parent): + AthAlgTool(type, name, parent) { + declareInterface< ::IMetaDataTool >(this); + } +StatusCode + EventFormatMetaDataTool::initialize() { // Greet the user: - ATH_MSG_DEBUG( "Initialising - Package version: " << PACKAGE_VERSION ); - ATH_MSG_DEBUG( " InputMetaStore = " << m_inputMetaStore ); - ATH_MSG_DEBUG( " OutputMetaStore = " << m_outputMetaStore ); - ATH_MSG_DEBUG( " InputKey = " << m_inputKey ); - ATH_MSG_DEBUG( " OutputKey = " << m_outputKey ); + ATH_MSG_DEBUG("Initialising - Package version: " << PACKAGE_VERSION); + ATH_MSG_DEBUG(" " << m_inputMetaStore); + ATH_MSG_DEBUG(" " << m_outputMetaStore); + ATH_MSG_DEBUG(" " << m_outputKey); + if (!m_inputKey.empty()) ATH_MSG_DEBUG(" " << m_inputKey); // Connect to the metadata stores: - ATH_CHECK( m_inputMetaStore.retrieve() ); - ATH_CHECK( m_outputMetaStore.retrieve() ); - - // Reset the internal object if it exists: - m_format.reset(); + ATH_CHECK(m_inputMetaStore.retrieve()); + ATH_CHECK(m_outputMetaStore.retrieve()); // Return gracefully: return StatusCode::SUCCESS; - } - - - StatusCode EventFormatMetaDataTool::beginInputFile() - { - StatusCode sc = collectMetaData(); - if( sc.isFailure() ) { - REPORT_ERROR( sc ) - << "Failed to collect metadata from the input file"; - throw std::runtime_error( "Failed to collect trigger configuration " - "metadata from the input" ); - } - return StatusCode::SUCCESS; - } - + } - StatusCode EventFormatMetaDataTool::endInputFile() - { - return StatusCode::SUCCESS; - } +StatusCode + EventFormatMetaDataTool::beginInputFile() { + // lock the tool, so metaDataStop will wait for write to finish + std::lock_guard< std::mutex > guard(m_outputMutex); + // Create object to hold information from the new file + auto format = std::make_unique< xAOD::EventFormat >(); - StatusCode EventFormatMetaDataTool::metaDataStop() - { - StatusCode sc = writeMetaData(); - if( sc.isFailure() ) { - REPORT_ERROR( sc ) - << "Failed to write metadata to the output store"; - throw std::runtime_error( "Failed write xAOD::EventFormat " - "to the output" ); + StatusCode sc = collectMetaData(format); + if (sc.isFailure()) { + REPORT_ERROR(sc) << "Failed to collect metadata from the input file"; + throw std::runtime_error("Failed to collect event format " + "metadata from the input"); } + + ATH_CHECK(writeMetaData(format)); + return StatusCode::SUCCESS; - } + } + +StatusCode + EventFormatMetaDataTool::metaDataStop() { + // wait for threads currenly writing to finish + std::lock_guard< std::mutex > guard(m_outputMutex); - StatusCode EventFormatMetaDataTool::collectMetaData() { + return StatusCode::SUCCESS; + } + +StatusCode + EventFormatMetaDataTool::collectMetaData( + std::unique_ptr< xAOD::EventFormat >& format) { + + std::vector< std::string > keys; + m_inputMetaStore->keys< xAOD::EventFormat >(keys); + if (!m_inputKey.empty()) keys.push_back(m_inputKey); + + // remove duplicates + std::sort(keys.begin(), keys.end()); + keys.erase(std::unique(keys.begin(), keys.end()), keys.end()); + + bool found = false; + for (auto itr = keys.begin(); itr != keys.end();) { + if (m_inputMetaStore->contains< xAOD::EventFormat >(*itr)) { + found = true; + ATH_MSG_DEBUG("Found xAOD::EventFormat with key " << *itr); + ++itr; + } else { + itr = keys.erase(itr); + } + } // If the input file doesn't have any event format metadata, // then finish right away: - if( ! m_inputMetaStore->contains< xAOD::EventFormat >( m_inputKey ) ) { - return StatusCode::SUCCESS; - } + if (!found) return StatusCode::SUCCESS; // Retrieve the input container: - const xAOD::EventFormat* input = 0; - ATH_CHECK( m_inputMetaStore->retrieve( input, m_inputKey ) ); - - // Create an output container if it doesn't exist yet: - if( ! m_format.get() ) { - ATH_MSG_DEBUG( "Creating output container" ); - m_format.reset( new xAOD::EventFormat() ); - } - - // Merge the new object into the output one: - for( auto itr = input->begin(); itr != input->end(); ++itr ) { - if( ! m_format->exists( itr->second.hash() ) ) { - m_format->add( itr->second ); - } + const xAOD::EventFormat* input = nullptr; + for (const std::string& key : keys) { + ATH_CHECK(m_inputMetaStore->retrieve(input, key)); + + // Merge the new object into the output one: + for (auto itr = input->begin(); itr != input->end(); ++itr) { + if (!format->exists(itr->second.hash())) { + format->add(itr->second); + } + } } // Return gracefully: return StatusCode::SUCCESS; - } + } - StatusCode EventFormatMetaDataTool::writeMetaData() { +StatusCode + EventFormatMetaDataTool::writeMetaData( + std::unique_ptr< xAOD::EventFormat >& format) { // The output may already have such an object, coming from some // other source. Like the event format service. - if( m_outputMetaStore->contains< xAOD::EventFormat >( m_outputKey ) ) { - ATH_MSG_DEBUG( "xAOD::EventFormat object already in the output" ); - return StatusCode::SUCCESS; - } - // Record the event format metadata, if any was found in the - // processed input files. - if( m_format.get() ) { - ATH_MSG_DEBUG( "Recording event format metadata" ); - ATH_CHECK( m_outputMetaStore->record( std::move( m_format ), - m_outputKey ) ); + xAOD::EventFormat * output = + m_outputMetaStore->tryRetrieve< xAOD::EventFormat >(m_outputKey); + + if (output == nullptr) { + + // Record the event format metadata, if any was found in the + // processed input files. + ATH_MSG_DEBUG("Recording event format metadata"); + ATH_CHECK(m_outputMetaStore->record(std::move(format), m_outputKey)); + + } else { + + ATH_MSG_DEBUG("updating existing xAOD::EventFormat object"); + // Update the object in the MetaDataStore with new content + for (auto itr = format->begin(); itr != format->end(); ++itr) + if (!output->exists(itr->second.hash())) + output->add(itr->second); + } // Return gracefully: return StatusCode::SUCCESS; - } + } -} // namespace xAODMaker +} // namespace xAODMaker diff --git a/Event/xAOD/xAODEventFormatCnv/src/EventFormatMetaDataTool.h b/Event/xAOD/xAODEventFormatCnv/src/EventFormatMetaDataTool.h index b9337d63e0cb11b4d1c350fa3a36c7a4cd0117e5..4010ffa675317ce69bf6ff0a430ff08a7a6e00d0 100644 --- a/Event/xAOD/xAODEventFormatCnv/src/EventFormatMetaDataTool.h +++ b/Event/xAOD/xAODEventFormatCnv/src/EventFormatMetaDataTool.h @@ -1,19 +1,19 @@ // Dear emacs, this is -*- c++ -*- - -/* - Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration -*/ +/* Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration */ // $Id: EventFormatMetaDataTool.h 651874 2015-03-05 14:16:19Z krasznaa $ -#ifndef XAODTRIGGERCNV_TRIGGERMENUMETADATATOOL_H -#define XAODTRIGGERCNV_TRIGGERMENUMETADATATOOL_H +#ifndef XAODEVENTFORMATCNV_EVENTFORMATMETADATATOOL +#define XAODEVENTFORMATCNV_EVENTFORMATMETADATATOOL // System include(s): #include <string> #include <memory> +#include <mutex> // Gaudi/Athena include(s): +#include "Gaudi/Property.h" #include "GaudiKernel/ServiceHandle.h" +#include "AthenaKernel/IMetaDataSvc.h" #include "AthenaKernel/IMetaDataTool.h" #include "AthenaBaseComps/AthAlgTool.h" #include "StoreGate/StoreGateSvc.h" @@ -23,69 +23,75 @@ namespace xAODMaker { - /// Tool taking care of copying the event format object from file to file - /// - /// This tool does the heavy lifting when fast-merging DxAOD files to - /// make sure that the xAOD::EventFormat metadata object is propagated - /// correctly from the input files to the output. - /// - /// @author Jack Cranshaw <cranshaw@anl.gov> - /// @author Attila Krasznahorkay <Attila.Krasznahorkay@cern.ch> - /// - /// $Revision: 651874 $ - /// $Date: 2015-03-05 15:16:19 +0100 (Thu, 05 Mar 2015) $ - /// - class EventFormatMetaDataTool : public virtual ::IMetaDataTool, - public ::AthAlgTool { - - public: - /// Regular AlgTool constructor - EventFormatMetaDataTool( const std::string& type, const std::string& name, - const IInterface* parent ); - - /// Function initialising the tool - virtual StatusCode initialize(); - - /// Function collecting the metadata from a new input file - virtual StatusCode beginInputFile(const SG::SourceID&) {return beginInputFile();} - - /// Function collecting the metadata from a new input file - virtual StatusCode endInputFile(const SG::SourceID&) {return endInputFile();} - - /// Function writing the collected metadata to the output - virtual StatusCode metaDataStop(const SG::SourceID&) {return metaDataStop();} - - /// Function called when a new input file is opened - virtual StatusCode beginInputFile(); - - /// Function called when the currently open input file got completely - /// processed - virtual StatusCode endInputFile(); - - /// Function called when the tool should write out its metadata - virtual StatusCode metaDataStop(); - - private: - /// Function collecting the event format metadata from the input file - StatusCode collectMetaData(); - /// Function writing out the collected metadata - StatusCode writeMetaData(); - - /// Connection to the input metadata store - ServiceHandle< ::StoreGateSvc > m_inputMetaStore; - /// Connection to the output metadata store - ServiceHandle< ::StoreGateSvc > m_outputMetaStore; - - /// The key of the trigger menu in the input file - std::string m_inputKey; - /// The key of the trigger menu for the output file - std::string m_outputKey; - - /// The merged event format object - std::unique_ptr< xAOD::EventFormat > m_format; - - }; // class EventFormatMetaDataTool - -} // namespace xAODMaker - -#endif // XAODTRIGGERCNV_TRIGGERMENUMETADATATOOL_H +/// Tool taking care of copying the event format object from file to file +/// +/// This tool does the heavy lifting when fast-merging DxAOD files to +/// make sure that the xAOD::EventFormat metadata object is propagated +/// correctly from the input files to the output. +/// +/// @author Jack Cranshaw <cranshaw@anl.gov> +/// @author Attila Krasznahorkay <Attila.Krasznahorkay@cern.ch> +/// @author Frank Berghaus <fberghaus@anl.gov> +/// +/// $Revision: 651874 $ +/// $Date: 2015-03-05 15:16:19 +0100 (Thu, 05 Mar 2015) $ +/// +class EventFormatMetaDataTool : public virtual ::IMetaDataTool, public ::AthAlgTool { + public: + /// Regular AlgTool constructor + EventFormatMetaDataTool(const std::string& type, + const std::string& name, + const IInterface* parent); + + /// Function initialising the tool + virtual StatusCode initialize(); + + /// Function collecting the metadata from a new input file + virtual StatusCode beginInputFile(const SG::SourceID&) {return beginInputFile();} + + /// Function collecting the metadata from a new input file + virtual StatusCode endInputFile(const SG::SourceID&) {return endInputFile();} + + /// Wait for metadata write operations to finish, then returns SUCCESS + virtual StatusCode metaDataStop(const SG::SourceID&) {return metaDataStop();} + + /// Function called when a new input file is opened + virtual StatusCode beginInputFile(); + + /// Function called when the currently open input file got completely + /// processed + virtual StatusCode endInputFile() {return StatusCode::SUCCESS;} + + /// Wait for metadata write operations to finish, then return SUCCESS + virtual StatusCode metaDataStop(); + + private: + /// Function collecting the event format metadata from the input file + StatusCode collectMetaData(std::unique_ptr< xAOD::EventFormat >&); + + /// Function writing out the collected metadata + StatusCode writeMetaData(std::unique_ptr< xAOD::EventFormat >&); + + /// Connection to the input metadata store + ServiceHandle< ::StoreGateSvc > m_inputMetaStore{this, "InputMetaStore", + "StoreGateSvc/InputMetaDataStore", name()}; + + /// Connection to the output metadata store + ServiceHandle< IMetaDataSvc > m_outputMetaStore{this, "MetaDataSvc", + "MetaDataSvc", name()}; + + /// The key of the trigger menu in the input file + Gaudi::Property< std::string > m_inputKey{this, "InputKey", "", + "optionally specify the key of the xAOD::EventFormat in the input."}; + + /// The key of the trigger menu for the output file + Gaudi::Property< std::string > m_outputKey{this, "OutputKey", + "EventFormat", "Specifies the key of the xAOD::EventFormat object in " + "the MetaDataStore, default: EventFormat"}; + + /// MetaDataStop need to wait for ongoing writes + std::mutex m_outputMutex; +}; // class EventFormatMetaDataTool +} // namespace xAODMaker + +#endif // XAODEVENTFORMATCNV_EVENTFORMATMETADATATOOL diff --git a/Event/xAOD/xAODEventFormatCnv/src/EventFormatStreamHelperTool.cxx b/Event/xAOD/xAODEventFormatCnv/src/EventFormatStreamHelperTool.cxx new file mode 100644 index 0000000000000000000000000000000000000000..d74ee3ec5e7f22839027f3e97475f1f562e95cd9 --- /dev/null +++ b/Event/xAOD/xAODEventFormatCnv/src/EventFormatStreamHelperTool.cxx @@ -0,0 +1,124 @@ +/* Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ + +// Local include(s). +#include "EventFormatStreamHelperTool.h" + +// system includes +#include <memory> +#include <regex> +#include <utility> + +// EDM include(s). +#include "xAODEventFormat/EventFormat.h" + +namespace xAODMaker { + +StatusCode + EventFormatStreamHelperTool::initialize() { + // Retrieve all needed components. + ATH_CHECK(m_metadataStore.retrieve()); + + // Return gracefully + return StatusCode::SUCCESS; + } + +StatusCode + EventFormatStreamHelperTool::postExecute() { + // Notify the event format service that it should collect the metadata + // that it needs. + ATH_CHECK(collectFormatMetadata()); + ATH_MSG_VERBOSE("Triggered metadata collection on: " << m_key.value()); + + // Return gracefully. + return StatusCode::SUCCESS; + } + +StatusCode + EventFormatStreamHelperTool::collectFormatMetadata() { + // Get the EventFormat object + xAOD::EventFormat * event_format = + m_metadataStore->tryRetrieve< xAOD::EventFormat >(m_key.value()); + + if (!event_format) { + auto p_event_format = std::make_unique< xAOD::EventFormat >(); + event_format = p_event_format.get(); + ATH_CHECK(m_metadataStore->record(std::move(p_event_format), m_key)); + ATH_MSG_VERBOSE("Created new xAOD::EventFormat: " << m_key.value()); + } else { + ATH_MSG_VERBOSE("Use existing xAOD::EventFormat: " << m_key.value()); + } + + // Ask StoreGate for all the objects that it's holding on to. + const std::vector< const SG::DataProxy* > proxies = evtStore()->proxies(); + + // Loop over the proxies. + for (const SG::DataProxy* proxy : proxies) { + // Construct the branch name that Athena I/O is going to give to + // this object. + const std::string branchName = proxy->name(); + + // Skip objects that were set up to be ignored. + { + bool ignoreObject = false; + for (const std::string& ignorePattern : m_ignoreKeys.value()) { + if (std::regex_match(branchName, std::regex(ignorePattern))) { + ignoreObject = true; + break; + } + } + if (ignoreObject == true) continue; + } + + // Get the type name of this object. + std::string typeName; + if (m_clidSvc->getTypeInfoNameOfID(proxy->clID(), typeName).isFailure()) { + // Make sure that nobody else is using @c m_warnedCLIDs right now. + std::lock_guard< std::mutex > lock(m_warnedCLIDsMutex); + + // Print a warning if this CLID didn't produce a warning yet: + if (m_warnedCLIDs.insert(proxy->clID()).second) + ATH_MSG_WARNING("Couldn't get type name for CLID = " << proxy->clID() ); + + continue; + } + + // Now that we have the type name, check whether metadata for this type + // should be stored. + { + bool ignoreObject = true; + for (const std::string& typePattern : m_typeNames.value()) { + if (std::regex_match(typeName, std::regex(typePattern))) { + ignoreObject = false; + break; + } + } + if (ignoreObject) continue; + } + + // Update the metadata object. + uint32_t hash = 0; + { + // Make sure that nobody else is modifying @c m_ef or @c m_spool + // right now. + std::lock_guard< std::mutex > lock(m_efMutex); + // If we already know about this object, then don't bother. + if (event_format->exists(branchName)) continue; + + // Get the hash for this name. + hash = evtStore()->stringToKey(branchName, proxy->clID()); + // Add the info. + event_format->add(xAOD::EventFormatElement(branchName, typeName, "", hash)); + } + + // Tell the user what happened. + ATH_MSG_VERBOSE("Adding info: branchName = \"" << branchName + << ", typeName = \"" << typeName << "\"" + << ", hash = 0x" << std::hex << std::setw(8) + << std::setfill('0') << hash); + } + + // Return gracefully. + return StatusCode::SUCCESS; + } + +} // namespace xAODMaker diff --git a/Event/xAOD/xAODEventFormatCnv/src/EventFormatStreamHelperTool.h b/Event/xAOD/xAODEventFormatCnv/src/EventFormatStreamHelperTool.h new file mode 100644 index 0000000000000000000000000000000000000000..e8599cea961a52ca5cafc9925c16dc0a09876285 --- /dev/null +++ b/Event/xAOD/xAODEventFormatCnv/src/EventFormatStreamHelperTool.h @@ -0,0 +1,95 @@ +// Dear emacs, this is -*- c++ -*- +/* Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ +#ifndef XAODEVENTFORMATCNV_EVENTFORMATSTREAMHELPERTOOL +#define XAODEVENTFORMATCNV_EVENTFORMATSTREAMHELPERTOOL + +#include <mutex> +#include <set> +#include <string> +#include <vector> + +// Gaudi/Athena include(s). +#include "Gaudi/Property.h" +#include "GaudiKernel/ServiceHandle.h" +#include "AthenaBaseComps/AthAlgTool.h" +#include "AthenaKernel/IAthenaOutputTool.h" +#include "AthenaKernel/IMetaDataSvc.h" + +namespace xAODMaker { +/// Tool creating and maintaining @c xAOD::EventFormat at the end-of-events +/// +/// This tool is meant to be added to every xAOD output stream, so that it +/// would maintain @c xAOD::EventFormat object every time a new event is +/// written out. +/// +/// @author Attila Krasznahorkay <Attila.Krasznahorkay@cern.ch> +/// @author Frank Berghaus <fberghaus@anl.gov> +/// +class EventFormatStreamHelperTool : public extends< AthAlgTool, IAthenaOutputTool > { + public: + // Inherit the base class's constructor(s). + using extends::extends; + + /// @name Interface inherited from @c AthAlgTool + /// @{ + + /// Initialise the tool + StatusCode initialize() override; + + /// @} + + /// @name Interface inherited from @c IAthenaOutputTool + /// @{ + + /// Called at the end of initialize + StatusCode postInitialize() override {return StatusCode::SUCCESS;} + + /// Called at the beginning of execute + StatusCode preExecute() override {return StatusCode::SUCCESS;} + + /// Called at the end of execute + StatusCode postExecute() override; + + /// Called at the beginning of finalize + StatusCode preFinalize() override {return StatusCode::SUCCESS;} + + /// Called at the + StatusCode preStream() override {return StatusCode::SUCCESS;} + + /// @} + + private: + /// Use the metadata tool interface to store the EventFormat object + ServiceHandle< IMetaDataSvc > m_metadataStore{ this, "MetaDataSvc", + "MetaDataSvc", "The metadata service use to record the xAOD::EventFormat" }; + + /// Connection to the CLID service + ServiceHandle< IClassIDSvc > m_clidSvc{ this, "ClassIDSvc", "ClassIDSvc", + "The ClassID service instance to use" }; + + Gaudi::Property< std::string > m_key{ this, "Key", "EventInfo", + "Key for EventFormat object in metadata store" }; + + /// Type names for which a metadata entry should be added + Gaudi::Property< std::vector< std::string > > m_typeNames{ this, + "TypeNames", { ".*xAOD::.*" }, + "Type names for which metadata entries are added" }; + + /// StoreGate keys that should be ignored during the metadata collection + Gaudi::Property< std::vector< std::string > > m_ignoreKeys{ this, + "IgnoreKeys", { "HLTAutoKey_.*" }, + "SG keys that should be ignored during the metadata collection" }; + + StatusCode collectFormatMetadata(); + + /// CLIDs about which warnings have already been printed + std::set< CLID > m_warnedCLIDs; + /// Mutex for the @c m_warnedCLIDs variable + std::mutex m_warnedCLIDsMutex; + + /// Mutex for the @c m_ef variable + mutable std::mutex m_efMutex; +}; // class EventFormatStreamHelperTool +} // namespace xAODMaker + +#endif // XAODEVENTFORMATCNV_EVENTFORMATSTREAMHELPERTOOL diff --git a/Event/xAOD/xAODEventFormatCnv/src/EventFormatSvc.cxx b/Event/xAOD/xAODEventFormatCnv/src/EventFormatSvc.cxx deleted file mode 100644 index 940f1ada25425a57a88d60a181cbebdf34005c36..0000000000000000000000000000000000000000 --- a/Event/xAOD/xAODEventFormatCnv/src/EventFormatSvc.cxx +++ /dev/null @@ -1,242 +0,0 @@ -/* - Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration -*/ - -// $Id: EventFormatSvc.cxx 777715 2016-10-11 16:35:49Z ssnyder $ - -// System include(s): -#include <fstream> -#include <ctime> -#include <locale> - -// Athena/Gaudi include(s): -#include "GaudiKernel/Incident.h" -#include "GaudiKernel/System.h" -#include "AthenaKernel/errorcheck.h" - -// EDM include(s): -#include "AthContainers/AuxTypeRegistry.h" - -// Local include(s): -#include "EventFormatSvc.h" - -namespace xAODMaker { - - EventFormatSvc::EventFormatSvc( const std::string& name, - ISvcLocator* svcLoc ) - : AthService( name, svcLoc ), - m_clidSvc( "ClassIDSvc", name ), - m_eventStore( "StoreGateSvc", name ), - m_metaStore( "MetaDataStore", name ), - m_incidentSvc( "IncidentSvc", name ), - m_warnedCLIDs(), - m_ef( 0 ), m_firstEvent( true ) { - - declareProperty( "ObjectName", m_objectName = "EventFormat" ); - - declareProperty( "ClassIDSvc", m_clidSvc ); - declareProperty( "EventStore", m_eventStore ); - declareProperty( "MetaDataStore", m_metaStore ); - declareProperty( "IncidentSvc", m_incidentSvc ); - declareProperty( "FormatNames", m_formatNames ); - } - - StatusCode EventFormatSvc::initialize() { - - // Greet the user: - ATH_MSG_INFO( "Initialising - Package version: " << PACKAGE_VERSION ); - ATH_MSG_DEBUG( " Output object key: " << m_objectName ); - - // Retrieve the needed service(s): - CHECK( m_clidSvc.retrieve() ); - CHECK( m_eventStore.retrieve() ); - CHECK( m_metaStore.retrieve() ); - CHECK( m_incidentSvc.retrieve() ); - - // Set up the service to listen to end-of-event incidents: - m_incidentSvc->addListener( this, IncidentType::EndEvent ); - - // Clean up: - m_warnedCLIDs.clear(); - - // Return gracefully: - return StatusCode::SUCCESS; - } - - /** - * This function can be used by some client code to access the EventFormat - * object describing the contents of the event store. - * - * It's debatable how much use case there is for accessing this info in - * Athena, we'll have to see. The code could also be extended later on - * to allow access to the EventFormat object read from an input xAOD - * file. To be seen... - * - * @returns The EventFormat object describing the current contents of the - * event store - */ - const xAOD::EventFormat* EventFormatSvc::eventFormat() { - - // Check if we already have an object: - if( ! m_ef ) { - // Request one then: - const Incident inc( "xAODMaker::EventFormatSvc", - IncidentType::EndEvent ); - handle( inc ); - // Reset the first event flag, as we obviously didn't get to the - // end of the first event yet. - m_firstEvent = true; - } - - // Return the object: - return m_ef; - } - - void EventFormatSvc::handle( const Incident& inc ) { - - // Tell the user what we're doing: - ATH_MSG_DEBUG( "Callback received with incident: " - << inc.type() ); - - // Check that we received the correct incident: - if( inc.type() != IncidentType::EndEvent ) { - ATH_MSG_WARNING( "Unknown incident type received: " - << inc.type() ); - return; - } - - // Create the object if it doesn't exist yet: - if( ! m_ef ) { - m_ef = new xAOD::EventFormat(); - if (!m_metaStore->contains(ClassID_traits<xAOD::EventFormat>::ID(),m_objectName ) ) { - if( m_metaStore->record( m_ef, m_objectName ).isFailure() ) { - REPORT_MESSAGE( MSG::ERROR ) - << "Couldn't record xAOD::EventFormat object into the " - << "metadata store with key: " << m_objectName; - delete m_ef; m_ef = 0; - return; - } - } else { - StatusCode sc = m_metaStore->retrieve(m_ef,m_objectName); - if (sc.isFailure()) { - REPORT_MESSAGE( MSG::ERROR ) - << "Couldn't retrieve xAOD::EventFormat object wit key: " << m_objectName; - } - } - } - - // Collect information into the object: - const int newObjects = collectMetadata( *m_ef ); - if( ( ! m_firstEvent ) && newObjects ) { - ATH_MSG_DEBUG( newObjects << " new objects encountered during " - << "event processing (not the first event!)" ); - } - - // Now we're past the first event: - m_firstEvent = false; - - return; - } - - StatusCode EventFormatSvc::queryInterface( const InterfaceID& riid, - void** ppvIf ) { - - // Check if the user asked for the IEventFormatSvc interface: - if( riid == IEventFormatSvc::interfaceID() ) { - *ppvIf = static_cast< IEventFormatSvc* >( this ); - addRef(); - return StatusCode::SUCCESS; - } - // Check if the user asked for the IIncidentListener interface: - else if( riid == IIncidentListener::interfaceID() ) { - *ppvIf = static_cast< IIncidentListener* >( this ); - addRef(); - return StatusCode::SUCCESS; - } - - // If not, let the base class handle the request: - return AthService::queryInterface( riid, ppvIf ); - } - - /** - * This function is used internally to collect the necessary metadata - * from the event store (StoreGate) and fill the EventFormat object - * of the service. - * - * The function returns the number of "new" objects encountered, which - * should only be !=0 on the first event in principle. But by now we have - * a few use cases where this is not true... - * - * @param ef The EventFormat object to fill with the metadata - * @returns The number of "new" objects found in the event - */ - int EventFormatSvc::collectMetadata( xAOD::EventFormat& ef ) { - - // Ask StoreGate for all the object that it's holding on to: - const std::vector< const SG::DataProxy* > proxies = - m_eventStore->proxies(); - - // Number of new objects encountered: - int newObjects = 0; - - // Loop over them: - std::vector< const SG::DataProxy* >::const_iterator itr = proxies.begin(); - std::vector< const SG::DataProxy* >::const_iterator end = proxies.end(); - for( ; itr != end; ++itr ) { - - // Construct the branch name that Athena I/O is going to give to - // this object: - const std::string branchName = ( *itr )->name(); - - // Ignore the temporary containers created by the HLT, as those change - // event by event: - if( branchName.find( "HLTAutoKey_" ) == 0 ) continue; - - // Get the type name of this object: - std::string typeName; - if( m_clidSvc->getTypeInfoNameOfID( ( *itr )->clID(), - typeName ).isFailure() ) { - // Print a warning if this CLID didn't produce a warning yet: - if( m_warnedCLIDs.insert( ( *itr )->clID() ).second ) { - ATH_MSG_WARNING( "Couldn't get type name for CLID = " - << ( *itr )->clID() ); - } - continue; - } - - // Only consider xAOD objects. Note that the type name will not - // necessarily start with xAOD, but it should have it somewhere. - // Alternatively, the type name could be listed in FormatNames. - if( typeName.find( "xAOD" ) == std::string::npos && - std::find (m_formatNames.begin(), m_formatNames.end(), typeName) == - m_formatNames.end()) - { - continue; - } - - // Check if we already know about this object: - if( ef.exists( branchName ) ) continue; - - // This will be a new object: - ++newObjects; - - // Retrieve the hash of this name: - const uint32_t hash = m_eventStore->stringToKey( branchName, - ( *itr )->clID() ); - - // Add the info: - ef.add( xAOD::EventFormatElement( branchName, typeName, "", - hash ) ); - - // Tell the user what happened: - ATH_MSG_VERBOSE( "Adding info: branchName = \"" << branchName - << ", typeName = \"" << typeName << "\"" - << ", hash = 0x" << std::hex << std::setw( 8 ) - << std::setfill( '0' ) << hash ); - } - - // Return how many new objects were encountered: - return newObjects; - } - -} // namespace xAODMaker diff --git a/Event/xAOD/xAODEventFormatCnv/src/EventFormatSvc.h b/Event/xAOD/xAODEventFormatCnv/src/EventFormatSvc.h deleted file mode 100644 index b953d173076ca1c4f8545af9d3184a7ee859925f..0000000000000000000000000000000000000000 --- a/Event/xAOD/xAODEventFormatCnv/src/EventFormatSvc.h +++ /dev/null @@ -1,101 +0,0 @@ -// Dear emacs, this is -*- c++ -*- - -/* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration -*/ - -// $Id: EventFormatSvc.h 721421 2016-02-02 15:17:05Z krasznaa $ -#ifndef XAODEVENTFORMATCNV_EVENTFORMATSVC_H -#define XAODEVENTFORMATCNV_EVENTFORMATSVC_H - -// System include(s): -#include <string> -#include <set> - -// Gaudi/Athena include(s): -#include "AthenaBaseComps/AthService.h" -#include "GaudiKernel/ServiceHandle.h" -#include "GaudiKernel/IIncidentListener.h" -#include "GaudiKernel/IIncidentSvc.h" -#include "AthenaKernel/IClassIDSvc.h" -#include "StoreGate/StoreGateSvc.h" - -// xAOD include(s): -#include "xAODEventFormat/EventFormat.h" - -// Local include(s): -#include "xAODEventFormatCnv/IEventFormatSvc.h" - -namespace xAODMaker { - - /** - * @short Implementation of the IEventFormatSvc service interface - * - * This class takes care of managing the xAOD::EventFormat - * objects of the xAOD files. - * - * @author Attila Krasznahorkay <Attila.Krasznahorkay@cern.ch> - * - * $Revision: 721421 $ - * $Date: 2016-02-02 16:17:05 +0100 (Tue, 02 Feb 2016) $ - */ - class EventFormatSvc : public AthService, - public virtual IEventFormatSvc, - public virtual IIncidentListener { - - public: - /// Regular Service constructor - EventFormatSvc( const std::string& name, ISvcLocator* svcLoc ); - - /// Function initialising the service - virtual StatusCode initialize(); - - /// @name Implementation of the IEventFormatSvc interface - /// @{ - - /// Get the object describing the current input/output file's format - const xAOD::EventFormat* eventFormat(); - - /// @} - - /// Function handling the incoming incidents - virtual void handle( const Incident& inc ); - - /// Function communicating the implemented interfaces to Gaudi - virtual StatusCode queryInterface( const InterfaceID& riid, - void** ppvIf ); - - private: - /// Fill the internal object with metadata from the event - int collectMetadata( xAOD::EventFormat& ef ); - - /// StoreGate key of the EventFormat object - std::string m_objectName; - - /// Connection to the CLID service - ServiceHandle< IClassIDSvc > m_clidSvc; - /// Connection to the event store - ServiceHandle< StoreGateSvc > m_eventStore; - /// Connection to the metadata store - ServiceHandle< StoreGateSvc > m_metaStore; - /// Connection to the incident service - ServiceHandle< IIncidentSvc > m_incidentSvc; - /// We automatically generate event format information for type names - /// that contain the string `xAOD'. This property gives a list of - /// additional type names that should have format information. - std::vector< std::string > m_formatNames; - - /// CLIDs about which warnings have already been printed - std::set< CLID > m_warnedCLIDs; - - /// The object that we write out in the end - xAOD::EventFormat* m_ef; - - /// Helper variable detecting the first event in the processing - bool m_firstEvent; - - }; // class EventFormatSvc - -} // namespace xAODMaker - -#endif // XAODEVENTFORMATCNV_EVENTFORMATSVC_H diff --git a/Event/xAOD/xAODEventFormatCnv/src/components/xAODEventFormatCnv_entries.cxx b/Event/xAOD/xAODEventFormatCnv/src/components/xAODEventFormatCnv_entries.cxx index 448d539f503996de17cb6572781076036b62129f..e27074b0650ba739898464ff010ec70ccb8f3848 100644 --- a/Event/xAOD/xAODEventFormatCnv/src/components/xAODEventFormatCnv_entries.cxx +++ b/Event/xAOD/xAODEventFormatCnv/src/components/xAODEventFormatCnv_entries.cxx @@ -1,6 +1,11 @@ -#include "../EventFormatSvc.h" +// +// Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration +// + +// Local include(s). #include "../EventFormatMetaDataTool.h" +#include "../EventFormatStreamHelperTool.h" -DECLARE_COMPONENT( xAODMaker::EventFormatSvc ) +// Declare the components to Gaudi. DECLARE_COMPONENT( xAODMaker::EventFormatMetaDataTool ) - +DECLARE_COMPONENT( xAODMaker::EventFormatStreamHelperTool ) diff --git a/Event/xAOD/xAODEventFormatCnv/src/test/AAuxContainer_v1.cxx b/Event/xAOD/xAODEventFormatCnv/src/test/AAuxContainer_v1.cxx new file mode 100644 index 0000000000000000000000000000000000000000..7345d3f1835ad6148f027edea85c50fc54a4c0ff --- /dev/null +++ b/Event/xAOD/xAODEventFormatCnv/src/test/AAuxContainer_v1.cxx @@ -0,0 +1,44 @@ +/* Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration */ +/** + * @file xAODEventFormatCnv/src/test/AAuxContainer_v1.xcx + * @author frank berghaus <fberghaus@anl.gov> + * @date Sep, 2020 + * @brief Class used for testing xAOD::EventFormat reading/writing. + */ + + +#include "xAODEventFormatCnv/test/versions/AAuxContainer_v1.h" +#include "AthContainersInterfaces/AuxDataOption.h" +#include <stdexcept> + + +#define CHECK_OPTION(ret) \ + do { \ + if (!ret) { \ + ATH_MSG_ERROR("setOption failed"); \ + return StatusCode::FAILURE; \ + } \ + } while(0) + + +namespace xAODMakerTest { + + +AAuxContainer_v1::AAuxContainer_v1() + : xAOD::AuxContainerBase() +{ + AUX_VARIABLE (anInt); + AUX_VARIABLE (aFloat); + AUX_VARIABLE (pVInt); + AUX_VARIABLE (pVFloat); + + if (!pVInt.setOption(SG::AuxDataOption("nbits", 13)) || + !pVFloat.setOption(SG::AuxDataOption("nbits", 13)) || + !pVFloat.setOption(SG::AuxDataOption("nmantissa", 12)) ) + { + throw std::runtime_error("Can't set packing options in AAuxContainer_v1"); + } +} + + +} // namespace DMTest diff --git a/Event/xAOD/xAODEventFormatCnv/src/test/ACreatorAlg.cxx b/Event/xAOD/xAODEventFormatCnv/src/test/ACreatorAlg.cxx new file mode 100644 index 0000000000000000000000000000000000000000..4a206cf430f0dfcb978dd856b804bec5d459aed4 --- /dev/null +++ b/Event/xAOD/xAODEventFormatCnv/src/test/ACreatorAlg.cxx @@ -0,0 +1,59 @@ +// +// Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration +// + +// Local include(s). +#include "ACreatorAlg.h" + +// EDM include(s). +#include "xAODEventFormatCnv/test/A.h" +#include "xAODEventFormatCnv/test/AVec.h" +#include "xAODEventFormatCnv/test/AAuxContainer.h" + +// Framework include(s). +#include "StoreGate/WriteHandle.h" + +// System include(s). +#include <cmath> +#include <memory> + +// Declare the type to Gaudi. +DECLARE_COMPONENT( xAODMakerTest::ACreatorAlg ) + +namespace xAODMakerTest { + + StatusCode ACreatorAlg::initialize() { + + // Initialise the data handle(s). + ATH_CHECK( m_outputKey.initialize() ); + + // Return gracefully. + return StatusCode::SUCCESS; + } + + StatusCode ACreatorAlg::execute( const EventContext& ctx ) const { + + // Create a dummy electron container. + auto vec = std::make_unique< AVec >(); + auto aux = std::make_unique< AAuxContainer >(); + vec->setStore(aux.get()); + + // Fill it with some nonsensical content. + for( int i = 0; i < 10; ++i ) { + vec->push_back( std::make_unique< A >() ); + auto a = vec->back(); + a->aFloat( 1.0f ); + a->anInt( 1 ); + a->pVInt( std::vector< int >(10, 1) ); + a->pVFloat( std::vector< float >(10, 1.0f) ); + } + + // Record it into the event store. + SG::WriteHandle< AVec > wh( m_outputKey, ctx ); + ATH_CHECK( wh.record( std::move( vec ), std::move( aux ) ) ); + + // Return gracefully. + return StatusCode::SUCCESS; + } + +} // namespace xAODMakerTest diff --git a/Event/xAOD/xAODEventFormatCnv/src/test/ACreatorAlg.h b/Event/xAOD/xAODEventFormatCnv/src/test/ACreatorAlg.h new file mode 100644 index 0000000000000000000000000000000000000000..827ca6013be2267e0a635323ca72a8298e0c7e67 --- /dev/null +++ b/Event/xAOD/xAODEventFormatCnv/src/test/ACreatorAlg.h @@ -0,0 +1,54 @@ +// Dear emacs, this is -*- c++ -*- +// +// Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration +// +#ifndef XAODEVENTFORMATCNV_TEST_ELECTRONCREATORALG_H +#define XAODEVENTFORMATCNV_TEST_ELECTRONCREATORALG_H + +// Framework include(s). +#include "AthenaBaseComps/AthReentrantAlgorithm.h" +#include "StoreGate/WriteHandleKey.h" + +// EDM include(s). +#include "xAODEventFormatCnv/test/AVec.h" + +/// Namespace holding test code for the xAOD maker components +namespace xAODMakerTest { + + /// Algorithm creating a dummy @c xAODMakerTest::AVec + /// + /// This algorithm can be used to test the functionality of the + /// xAODEventFormatCnv code. It just creates a dummy + /// @c xAODMkerTest::AVec container that can then be used to create + /// a test file. + /// + /// @author Attila Krasznahorkay <Attila.Krasznahorkay@cern.ch> + /// @author Frank Berghaus <fberghaus@anl.gov> + /// + class ACreatorAlg : public AthReentrantAlgorithm { + + public: + // Use the base class's constructor + using AthReentrantAlgorithm::AthReentrantAlgorithm; + + /// @name Interface inherited from @c AthReentrantAlgorithm + /// @{ + + /// Initialise the algorithm + virtual StatusCode initialize() override; + /// Execute the algorithm for one event + virtual StatusCode execute( const EventContext& ctx ) const override; + + /// @} + + private: + /// Key for the electron container created by the algorithm + SG::WriteHandleKey< AVec > m_outputKey { this, + "OutputKey", "TestObject", + "Key for the object container created by the algorithm" }; + + }; // class ElectronCreatorAlg + +} // namespace xAODMakerTest + +#endif // XAODEVENTFORMATCNV_TEST_ELECTRONCREATORALG_H diff --git a/Event/xAOD/xAODEventFormatCnv/src/test/A_v1.cxx b/Event/xAOD/xAODEventFormatCnv/src/test/A_v1.cxx new file mode 100644 index 0000000000000000000000000000000000000000..9bb6d69d43a6b6f5766d85fb43c0935c1d4d3054 --- /dev/null +++ b/Event/xAOD/xAODEventFormatCnv/src/test/A_v1.cxx @@ -0,0 +1,25 @@ +/* Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration */ +/** + * @file xAODEventFormatCnv/src/test/A_v1.cxx + * @author frank berghaus <fberghaus@anl.gov> + * @date May, 2020 + * @brief Class used for testing xAOD::EventFormat reading/writing. + */ +#include "xAODEventFormatCnv/test/versions/A_v1.h" +#include "xAODCore/AuxStoreAccessorMacros.h" + + +namespace xAODMakerTest { + + +AUXSTORE_PRIMITIVE_SETTER_AND_GETTER (A_v1, float, aFloat, aFloat) +AUXSTORE_PRIMITIVE_SETTER_AND_GETTER (A_v1, int, anInt, anInt) + +AUXSTORE_OBJECT_SETTER_AND_GETTER (A_v1, std::vector<int>, pVInt, pVInt) +AUXSTORE_OBJECT_MOVE (A_v1, std::vector<int>, pVInt, pVInt) + +AUXSTORE_OBJECT_SETTER_AND_GETTER (A_v1, std::vector<float>, pVFloat, pVFloat) +AUXSTORE_OBJECT_MOVE (A_v1, std::vector<float>, pVFloat, pVFloat) + + +} // namespace xAODMakerTest diff --git a/Event/xAOD/xAODEventFormatCnv/src/test/EventFormatPrinterAlg.cxx b/Event/xAOD/xAODEventFormatCnv/src/test/EventFormatPrinterAlg.cxx new file mode 100644 index 0000000000000000000000000000000000000000..90de45bcfcd55200f3f6702f5c5c5f66dd93ad5f --- /dev/null +++ b/Event/xAOD/xAODEventFormatCnv/src/test/EventFormatPrinterAlg.cxx @@ -0,0 +1,38 @@ +// +// Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration +// + +// Local include(s). +#include "EventFormatPrinterAlg.h" + +// EDM include(s). +#include "xAODEventFormat/EventFormat.h" + +#include "StoreGate/ReadHandle.h" + +// Declare the type to Gaudi. +DECLARE_COMPONENT( xAODMakerTest::EventFormatPrinterAlg ) + +namespace xAODMakerTest { + + StatusCode EventFormatPrinterAlg::initialize() { + + // Initialise the data handle(s). + ATH_CHECK( m_metaDataStore.retrieve() ); + + // Return gracefully. + return StatusCode::SUCCESS; + } + + StatusCode EventFormatPrinterAlg::execute() { + // Read and print the event format object. + const xAOD::EventFormat * ef = + m_metaDataStore->tryConstRetrieve< xAOD::EventFormat >(m_eventFormatKey); + if (ef) ATH_MSG_INFO( "Event format:\n" << *ef ); + else return StatusCode::FAILURE; + + // Return gracefully. + return StatusCode::SUCCESS; + } + +} // namespace xAODMakerTest diff --git a/Event/xAOD/xAODEventFormatCnv/src/test/EventFormatPrinterAlg.h b/Event/xAOD/xAODEventFormatCnv/src/test/EventFormatPrinterAlg.h new file mode 100644 index 0000000000000000000000000000000000000000..1c2ccb0f46914fa6769eb483bddcfcb19bb7da69 --- /dev/null +++ b/Event/xAOD/xAODEventFormatCnv/src/test/EventFormatPrinterAlg.h @@ -0,0 +1,56 @@ +// Dear emacs, this is -*- c++ -*- +// +// Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration +// +#ifndef XAODEVENTFORMATCNV_TEST_EVENTFORMATPRINTERALG_H +#define XAODEVENTFORMATCNV_TEST_EVENTFORMATPRINTERALG_H + +// Framework include(s). +#include "Gaudi/Property.h" +#include "GaudiKernel/ServiceHandle.h" +#include "AthenaBaseComps/AthAlgorithm.h" +#include "AthenaKernel/IMetaDataSvc.h" +#include "xAODEventFormat/EventFormat.h" + +// System include(s). +#include <string> + +namespace xAODMakerTest { + + /// Algorithm printing an @c xAOD::EventFormat object's payload + /// + /// This is used to debug/test the functionality of the @c xAOD::EventFormat + /// creator components of the package. + /// + /// @author Attila Krasznahorkay <Attila.Krasznahorkay@cern.ch> + /// + class EventFormatPrinterAlg : public AthAlgorithm { + + public: + /// Inherit the base class's constructor + using AthAlgorithm::AthAlgorithm; + + /// @name Interface inherited from @c AthAlgorithm + /// @{ + + /// Initialise the algorithm + virtual StatusCode initialize() override; + /// Execute the algorithm for one event + virtual StatusCode execute() override; + + /// @} + + private: + /// Key for the @c xAOD::EventFormat object to read + Gaudi::Property< std::string > m_eventFormatKey{this, "EventFormatKey", + "EventFormat", "Key to retrieve xAOD::EventFormat, default: EventFormat" + }; + + ServiceHandle< IMetaDataSvc > m_metaDataStore{this, "MetaDataSvc", + "MetaDataSvc", name() + }; + }; // class EventFormatPrinterAlg + +} // namespace xAODMakerTest + +#endif // XAODEVENTFORMATCNV_TEST_EVENTFORMATPRINTERALG_H diff --git a/Event/xAOD/xAODEventFormatCnv/src/test/cnv/xAODAAuxContainerCnv.cxx b/Event/xAOD/xAODEventFormatCnv/src/test/cnv/xAODAAuxContainerCnv.cxx new file mode 100644 index 0000000000000000000000000000000000000000..10e67cf89bd4efbac35e2775470bb91f5cea9802 --- /dev/null +++ b/Event/xAOD/xAODEventFormatCnv/src/test/cnv/xAODAAuxContainerCnv.cxx @@ -0,0 +1,6 @@ +/* + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration +*/ + +// Event/xAOD/xAODEgammaAthenaPool/src/xAODElectronAuxContainerCnv.cxx +// Dummy file so that the build system knows that this is a custom converter. diff --git a/Event/xAOD/xAODEventFormatCnv/src/test/cnv/xAODAAuxContainerCnv.h b/Event/xAOD/xAODEventFormatCnv/src/test/cnv/xAODAAuxContainerCnv.h new file mode 100644 index 0000000000000000000000000000000000000000..ae46e41e44c17d7db71451d7fbd5fe24d8e3be7d --- /dev/null +++ b/Event/xAOD/xAODEventFormatCnv/src/test/cnv/xAODAAuxContainerCnv.h @@ -0,0 +1,19 @@ +// Dear emacs, this is -*- c++ -*- +/* Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration */ +#ifndef XAODEVENTFORMATCNV_TEST_XAODAAUXCONTAINERCNV_H +#define XAODEVENTFORMATCNV_TEST_XAODAAUXCONTAINERCNV_H + +// Gaudi/Athena include(s): +#include "AthenaPoolCnvSvc/T_AthenaPoolAuxContainerCnv.h" + +// EDM include(s): +#include "xAODEventFormatCnv/test/AAuxContainer.h" +#include "xAODAAuxContainerCnv_v1.h" + +/// Base class for the converter +typedef T_AthenaPoolAuxContainerCnv< xAODMakerTest::AAuxContainer, + xAODAAuxContainerCnv_v1 > + xAODAAuxContainerCnv; + + +#endif // XAODEVENTFORMATCNV_TEST_XAODAAUXCONTAINERCNV_H diff --git a/Event/xAOD/xAODEventFormatCnv/src/test/cnv/xAODAAuxContainerCnv_v1.cxx b/Event/xAOD/xAODEventFormatCnv/src/test/cnv/xAODAAuxContainerCnv_v1.cxx new file mode 100644 index 0000000000000000000000000000000000000000..25fb9f729d6c56dd32711b0cfc61875d4be52503 --- /dev/null +++ b/Event/xAOD/xAODEventFormatCnv/src/test/cnv/xAODAAuxContainerCnv_v1.cxx @@ -0,0 +1,86 @@ +/* Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration */ +#include "xAODAAuxContainerCnv_v1.h" + +// System include(s): +#include <memory> +#include <stdexcept> + +// Gaudi/Athena include(s): +#include "GaudiKernel/MsgStream.h" + +// Core EDM include(s): +#include "AthContainers/tools/copyAuxStoreThinned.h" + +// Local include(s): +#include "xAODEventFormatCnv/test/A.h" +#include "xAODEventFormatCnv/test/versions/A_v1.h" +#include "xAODEventFormatCnv/test/AVec.h" +#include "xAODEventFormatCnv/test/versions/AVec_v1.h" + +/// Convenience macro for setting the level of output messages +#define MSGLVL MSG::DEBUG + +/// Another convenience macro for printing messages in the converter +#define ATH_MSG( MSG ) \ + do { \ + if( log.level() <= MSGLVL ) { \ + log << MSGLVL << MSG << endmsg; \ + } \ + } while( 0 ) + +xAODAAuxContainerCnv_v1::xAODAAuxContainerCnv_v1() +{ +} + +void xAODAAuxContainerCnv_v1:: +persToTrans( const xAODMakerTest::AAuxContainer_v1* oldObj, + xAODMakerTest::AAuxContainer* newObj, + MsgStream& log ) const { + + // Greet the user: + ATH_MSG( "Converting xAODMaker::AAuxContainer_v1 to current version..." ); + + // Clear the transient object: + newObj->resize( 0 ); + + // Copy the payload of the v1 object into the latest one by misusing + // the thinning code a bit... + SG::copyAuxStoreThinned( *oldObj, *newObj, 0 ); + + // Set up interface containers on top of them: + + //The old uses v_1 + xAODMakerTest::AVec_v1 oldInt; + for( size_t i = 0; i < oldObj->size(); ++i ) { + oldInt.push_back( std::make_unique< xAODMakerTest::A_v1 >() ); + } + oldInt.setStore( oldObj ); + + xAODMakerTest::AVec newInt; + for( size_t i = 0; i < newObj->size(); ++i ) { + newInt.push_back( std::make_unique< xAODMakerTest::A >() ); + } + newInt.setStore( newObj ); + + // Print what happened: + ATH_MSG( "Converting xAODMakerTest::AAuxContainer_v1 to current version " + "[OK]" ); + + return; +} + +/// This function should never be called, as we are not supposed to convert +/// object before writing. +void xAODAAuxContainerCnv_v1:: +transToPers( const xAODMakerTest::AAuxContainer*, + xAODMakerTest::AAuxContainer_v1*, + MsgStream& log ) const { + + log << MSG::ERROR + << "Somebody called xAODAAuxContainerCnv_v1::transToPers" + << endmsg; + throw std::runtime_error( "Somebody called xAODAAuxContainerCnv_v1::" + "transToPers" ); + + return; +} diff --git a/Event/xAOD/xAODEventFormatCnv/src/test/cnv/xAODAAuxContainerCnv_v1.h b/Event/xAOD/xAODEventFormatCnv/src/test/cnv/xAODAAuxContainerCnv_v1.h new file mode 100644 index 0000000000000000000000000000000000000000..8b9c4b71633fd75a236dc944cdcad628ce711557 --- /dev/null +++ b/Event/xAOD/xAODEventFormatCnv/src/test/cnv/xAODAAuxContainerCnv_v1.h @@ -0,0 +1,36 @@ +// Dear emacs, this is -*- c++ -*- +/* Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration */ +#ifndef XAODEVENTFORMATCNV_TEST_XAODAAUXCONTAINERCNV_V1_H +#define XAODEVENTFORMATCNV_TEST_XAODAAUXCONTAINERCNV_V1_H + +// Gaudi/Athena include(s): +#include "AthenaPoolCnvSvc/T_AthenaPoolTPConverter.h" + +// EDM include(s): +#include "xAODEventFormatCnv/test/versions/AAuxContainer_v1.h" +#include "xAODEventFormatCnv/test/AAuxContainer.h" + +class xAODAAuxContainerCnv_v1 : + public T_AthenaPoolTPCnvConstBase< xAODMakerTest::AAuxContainer, + xAODMakerTest::AAuxContainer_v1 > { + +public: + using base_class::transToPers; + using base_class::persToTrans; + + + /// Default constructor + xAODAAuxContainerCnv_v1(); + + /// Function converting from the old type to the current one + virtual void persToTrans( const xAODMakerTest::AAuxContainer_v1* oldObj, + xAODMakerTest::AAuxContainer* newObj, + MsgStream& log ) const override; + /// Dummy function inherited from the base class + virtual void transToPers( const xAODMakerTest::AAuxContainer*, + xAODMakerTest::AAuxContainer_v1*, + MsgStream& log ) const override; + +}; + +#endif // XAODEVENTFORMATCNV_TEST_XAODAAUXCONTAINERCNV_V1_H diff --git a/Event/xAOD/xAODEventFormatCnv/src/test/cnv/xAODEventFormatCnvTestCnv.cxx b/Event/xAOD/xAODEventFormatCnv/src/test/cnv/xAODEventFormatCnvTestCnv.cxx new file mode 100644 index 0000000000000000000000000000000000000000..4c686489e9d3fe08eda0fee2f4eebe1358c04d15 --- /dev/null +++ b/Event/xAOD/xAODEventFormatCnv/src/test/cnv/xAODEventFormatCnvTestCnv.cxx @@ -0,0 +1,21 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +// $Id: xAODEventFormatCnv/testAthenaPoolTPCnv.cxx 619884 2014-10-03 15:00:40Z christos $ + +// Gaudi/Athena include(s): +#include "AthenaKernel/TPCnvFactory.h" + +// EDM include(s): +#include "xAODEventFormatCnv/test/AAuxContainer.h" +#include "xAODEventFormatCnv/test/versions/AAuxContainer_v1.h" + +// Local include(s): +#include "xAODAAuxContainerCnv_v1.h" + +// Declare the T/P converter(s): +DECLARE_TPCNV_FACTORY( xAODAAuxContainerCnv_v1, + xAODMakerTest::AAuxContainer, + xAODMakerTest::AAuxContainer_v1, + Athena::TPCnvVers::Old ) diff --git a/Event/xAOD/xAODEventFormatCnv/src/test/dict/ContainerProxies.cxx b/Event/xAOD/xAODEventFormatCnv/src/test/dict/ContainerProxies.cxx new file mode 100644 index 0000000000000000000000000000000000000000..1d1a19ec12404f1773f87343c2e29b3d2abed4d0 --- /dev/null +++ b/Event/xAOD/xAODEventFormatCnv/src/test/dict/ContainerProxies.cxx @@ -0,0 +1,6 @@ +/* Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration */ + +#include "xAODCore/AddDVProxy.h" +#include "xAODEventFormatCnv/test/AVec.h" + +ADD_NS_DV_PROXY (xAODMakerTest, AVec); diff --git a/Event/xAOD/xAODEventFormatCnv/test/TestEventFormatContent.py b/Event/xAOD/xAODEventFormatCnv/test/TestEventFormatContent.py new file mode 100755 index 0000000000000000000000000000000000000000..a7c1810c013e6c1d7b4505d46443982a82517f1d --- /dev/null +++ b/Event/xAOD/xAODEventFormatCnv/test/TestEventFormatContent.py @@ -0,0 +1,71 @@ +#!/usr/bin/env python +# Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration +"""Read in a given file and return how often given metadata item appears + +Use MetaReader to look up metadata items in a given file. Search for the given +key in each key found in the list of metadata items. If the number of matches +is 1 return success else return failure. + + Common usgage example: + + In a shell: + if TestEventFormatContent.py file.pool.root metadata_key; then + echo "found one" + else + echo "found none or many" + fi +""" +import argparse +from functools import reduce +import logging +import sys +import PyUtils.MetaReader + + +def main(): + """parse aruments and return number of matches""" + parser = argparse.ArgumentParser( + description="""" + Read in a given file and return the number of times metadata items with + a name matching the given term appear. + """ + ) + + parser.add_argument( + "file", metavar="FILE", help="the file to read" + ) + + parser.add_argument( + "key", metavar="KEY", help="the key to search for" + ) + + args = parser.parse_args() + + # silence meta reader + reader_msg = logging.getLogger("MetaReader") + reader_msg.setLevel(logging.WARNING) + + # get the list of metadata items of the file + try: + metadata = next( + iter( + PyUtils.MetaReader.read_metadata([args.file]).items() + ) + )[1]['metadata_items'] + except (OSError,): + print("cannot read metadata from ", args.file) + sys.exit(1) + + matches = reduce( + lambda n, key: n + 1 if args.key in key else n, + [0] + list(metadata) + ) + + if matches == 1: + return 0 + + return 1 + + +if __name__ == "__main__": + main() diff --git a/Event/xAOD/xAODEventFormatCnv/xAODEventFormatCnv/IEventFormatSvc.h b/Event/xAOD/xAODEventFormatCnv/xAODEventFormatCnv/IEventFormatSvc.h deleted file mode 100644 index cb665d2b5ec2c5d4959f383d8d201603daf49ecc..0000000000000000000000000000000000000000 --- a/Event/xAOD/xAODEventFormatCnv/xAODEventFormatCnv/IEventFormatSvc.h +++ /dev/null @@ -1,53 +0,0 @@ -// Dear emacs, this is -*- c++ -*- - -/* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration -*/ - -// $Id: IEventFormatSvc.h 603941 2014-06-27 11:51:35Z krasznaa $ -#ifndef XAODEVENTFORMATCNV_IEVENTFORMATSVC_H -#define XAODEVENTFORMATCNV_IEVENTFORMATSVC_H - -// System include(s): -#include <iosfwd> - -// Gaudi/Athena include(s): -#include "GaudiKernel/IService.h" - -// xAOD include(s): -#include "xAODEventFormat/EventFormat.h" - -/// Namespace for all the xAOD making code -namespace xAODMaker { - - /// The interface provided by IEventFormatSvc - static const InterfaceID - IID_IEventFormatSvc( "xAODMaker::IEventFormatSvc", 1, 0 ); - - /** - * @short Interface for the service creating the xAOD event format object - * - * Client code can use this interface within Athena to interact with - * the event format description of the xAOD files. - * - * @author Attila Krasznahorkay <Attila.Krasznahorkay@cern.ch> - * - * $Revision: 603941 $ - * $Date: 2014-06-27 13:51:35 +0200 (Fri, 27 Jun 2014) $ - */ - class IEventFormatSvc : public virtual IService { - - public: - /// Get the object describing the current input/output file's format - virtual const xAOD::EventFormat* eventFormat() = 0; - - /// Gaudi interface definition - static const InterfaceID& interfaceID() { - return IID_IEventFormatSvc; - } - - }; // class IEventFormatSvc - -} // namespace xAODMaker - -#endif // XAODEVENTFORMATCNV_IEVENTFORMATSVC_H diff --git a/Event/xAOD/xAODEventFormatCnv/xAODEventFormatCnv/test/A.h b/Event/xAOD/xAODEventFormatCnv/xAODEventFormatCnv/test/A.h new file mode 100644 index 0000000000000000000000000000000000000000..5fee7ce3eeb9cebb6ea8bc9db95bb334bd34494d --- /dev/null +++ b/Event/xAOD/xAODEventFormatCnv/xAODEventFormatCnv/test/A.h @@ -0,0 +1,23 @@ +// This file's extension implies that it's C, but it's really -*- C++ -*-. +/* Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ +/** + * @file xAODEventFormatCnv/test/A.h + * @author frank berghaus <fberghaus@anl.gov> + * @date Sep, 2020 + * @brief Class used for testing xAOD::EventFormat reading/writing. + */ + +#ifndef XAODEVENTFORMATCNV_TEST_A_H +#define XAODEVENTFORMATCNV_TEST_A_H + +#include "xAODEventFormatCnv/test/versions/A_v1.h" + + +namespace xAODMakerTest { typedef A_v1 A; } + + +#include "xAODCore/CLASS_DEF.h" +CLASS_DEF (xAODMakerTest::A, 169367265, 1) + + +#endif // XAODEVENTFORMATCNV_TEST_A_H diff --git a/Event/xAOD/xAODEventFormatCnv/xAODEventFormatCnv/test/AAuxContainer.h b/Event/xAOD/xAODEventFormatCnv/xAODEventFormatCnv/test/AAuxContainer.h new file mode 100644 index 0000000000000000000000000000000000000000..5d0becd41842de1aa79c8d36f3133f58b4062049 --- /dev/null +++ b/Event/xAOD/xAODEventFormatCnv/xAODEventFormatCnv/test/AAuxContainer.h @@ -0,0 +1,23 @@ +// This file's extension implies that it's C, but it's really -*- C++ -*-. +/* Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ +/** + * @file xAODEventFormatCnv/test/AAuxContainer.h + * @author frank berghaus <fberghaus@anl.gov> + * @date Sep, 2020 + * @brief Class used for testing xAOD::EventFormat reading/writing. + */ +#ifndef XAODEVENTFORMATCNV_TEST_AAUXCONTAINER_H +#define XAODEVENTFORMATCNV_TEST_AAUXCONTAINER_H + + +#include "xAODEventFormatCnv/test/versions/AAuxContainer_v1.h" + + +namespace xAODMakerTest { typedef AAuxContainer_v1 AAuxContainer; } + + +#include "xAODCore/CLASS_DEF.h" +CLASS_DEF (xAODMakerTest::AAuxContainer, 1189570278, 1) + + +#endif // XAODEVENTFORMATCNV_TEST_AAUXCONTAINER_H diff --git a/Event/xAOD/xAODEventFormatCnv/xAODEventFormatCnv/test/AVec.h b/Event/xAOD/xAODEventFormatCnv/xAODEventFormatCnv/test/AVec.h new file mode 100644 index 0000000000000000000000000000000000000000..38c7d3c3f099daae7b3cba25b25b9ee1fe3ff8d7 --- /dev/null +++ b/Event/xAOD/xAODEventFormatCnv/xAODEventFormatCnv/test/AVec.h @@ -0,0 +1,21 @@ +// This file's extension implies that it's C, but it's really -*- C++ -*-. +/* Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration */ +/** + * @file xAODEventFormatCnv/test/AVec.h + * @author frank berghaus <fberghaus@anl.gov> + * @date Sep, 2020 + * @brief Class used for testing xAOD::EventFormat reading/writing. + */ +#ifndef XAODEVENTFORMATCNV_TEST_AVEC_H +#define XAODEVENTFORMATCNV_TEST_AVEC_H + +#include "xAODEventFormatCnv/test/versions/AVec_v1.h" + + +namespace xAODMakerTest{ typedef AVec_v1 AVec;} + + +#include "xAODCore/CLASS_DEF.h" +CLASS_DEF( xAODMakerTest::AVec , 48660174 , 1 ) + +#endif // XAODEVENTFORMATCNV_TEST_AVEC_H diff --git a/Event/xAOD/xAODEventFormatCnv/xAODEventFormatCnv/test/selection.xml b/Event/xAOD/xAODEventFormatCnv/xAODEventFormatCnv/test/selection.xml new file mode 100755 index 0000000000000000000000000000000000000000..eeabbbc22faaf0dc2292d5404db70a2ec3327a4c --- /dev/null +++ b/Event/xAOD/xAODEventFormatCnv/xAODEventFormatCnv/test/selection.xml @@ -0,0 +1,8 @@ +<lcgdict> + + <class name="xAODMakerTest::A_v1" /> + <class name="xAODMakerTest::AVec_v1" /> + <class name="xAODMakerTest::AAuxContainer_v1" /> + <class name="SG::AuxElement::ConstAccessor<ElementLink<xAODMakerTest::AVec_v1> >" /> + +</lcgdict> diff --git a/Event/xAOD/xAODEventFormatCnv/xAODEventFormatCnv/test/versions/AAuxContainer_v1.h b/Event/xAOD/xAODEventFormatCnv/xAODEventFormatCnv/test/versions/AAuxContainer_v1.h new file mode 100644 index 0000000000000000000000000000000000000000..b1833d1da732a00780ec73e69f3c370a7307076e --- /dev/null +++ b/Event/xAOD/xAODEventFormatCnv/xAODEventFormatCnv/test/versions/AAuxContainer_v1.h @@ -0,0 +1,41 @@ +// This file's extension implies that it's C, but it's really -*- C++ -*-. +/* Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration */ +/** + * @file xAODEventFormatCnv/test/versions/AAuxContainer_v1.h + * @author frank berghaus <fberghaus@anl.gov> + * @date May, 2020 + * @brief Class used for testing xAOD::EventFormat reading/writing. + */ +#ifndef XAODEVENTFORMATCNV_TEST_AAUXCONTAINER_V1_H +#define XAODEVENTFORMATCNV_TEST_AAUXCONTAINER_V1_H + + +#include "xAODCore/AuxContainerBase.h" +#include "AthContainers/PackedContainer.h" +#include "AthenaKernel/BaseInfo.h" +#include <vector> + + +namespace xAODMakerTest { + +class AAuxContainer_v1 + : public xAOD::AuxContainerBase +{ +public: + AAuxContainer_v1(); + +private: + std::vector<int> anInt; + std::vector<float> aFloat; + SG::PackedContainer<std::vector<int> > pVInt; + SG::PackedContainer<std::vector<float> > pVFloat; +}; + + +} // namespace xAODMakerTest + + +SG_BASE (xAODMakerTest::AAuxContainer_v1, xAOD::AuxContainerBase); + + +#endif // XAODEVENTFORMATCNV_TEST_AAUXCONTAINER_V1_H diff --git a/Event/xAOD/xAODEventFormatCnv/xAODEventFormatCnv/test/versions/AVec_v1.h b/Event/xAOD/xAODEventFormatCnv/xAODEventFormatCnv/test/versions/AVec_v1.h new file mode 100644 index 0000000000000000000000000000000000000000..06efb6c4d1061a630a54722d98dab307461b3c32 --- /dev/null +++ b/Event/xAOD/xAODEventFormatCnv/xAODEventFormatCnv/test/versions/AVec_v1.h @@ -0,0 +1,18 @@ +// This file's extension implies that it's C, but it's really -*- C++ -*-. +/* Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration */ + +/** + * @file xAODEventFormat/test/versions/AVec_v1.h + * @author frank berghaus <fberghaus@anl.gov> + * @date May, 2020 + * @brief Class used for testing xAOD::EventFormat data reading/writing. + */ +#ifndef XAODEVENTFORMATCNV_TEST_AVEC_V1_H +#define XAODEVENTFORMATCNV_TEST_AVEC_V1_H + +#include "xAODEventFormatCnv/test/versions/A_v1.h" +#include "AthContainers/DataVector.h" + +namespace xAODMakerTest { typedef DataVector<A_v1> AVec_v1; } + +#endif // XAODEVENTFORMATCNV_TEST_AVEC_V1_H diff --git a/Event/xAOD/xAODEventFormatCnv/xAODEventFormatCnv/test/versions/A_v1.h b/Event/xAOD/xAODEventFormatCnv/xAODEventFormatCnv/test/versions/A_v1.h new file mode 100644 index 0000000000000000000000000000000000000000..5d39f522f7b3ee5a4511b78befb3956a0e8bac85 --- /dev/null +++ b/Event/xAOD/xAODEventFormatCnv/xAODEventFormatCnv/test/versions/A_v1.h @@ -0,0 +1,43 @@ +// This file's extension implies that it's C, but it's really -*- C++ -*-. +/* Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration */ + +/** + * @file xAODEventFormatCnv/test/versions/A_v1.h + * @author Frank Berghaus <fberghaus@anl.gov> + * @date Sep, 2020 + * @brief Class used for testing xAOD::EventFormat reading/writing. + */ +#ifndef XAODEVENTFORMATCNV_TEST_A_V1_H +#define XAODEVENTFORMATCNV_TEST_A_V1_H + +#include "AthContainers/AuxElement.h" +#include "AthenaKernel/BaseInfo.h" + + +namespace xAODMakerTest { + +class A_v1 + : public SG::AuxElement +{ +public: + float aFloat() const; + void aFloat(float f); + + int anInt() const; + void anInt(int i); + + const std::vector<int>& pVInt() const; + void pVInt (const std::vector<int>&); + void pVInt (std::vector<int>&&); + + const std::vector<float>& pVFloat() const; + void pVFloat (const std::vector<float>&); + void pVFloat (std::vector<float>&&); +}; + +} // namespace xAODMakerTest + + +SG_BASE(xAODMakerTest::A_v1, SG::AuxElement); + +#endif // XAODEVENTFORMATCNV_TEST_A_V1_H diff --git a/Event/xAOD/xAODEventFormatCnv/xAODEventFormatCnv/test/xAODEventFormatCnvTestDict.h b/Event/xAOD/xAODEventFormatCnv/xAODEventFormatCnv/test/xAODEventFormatCnvTestDict.h new file mode 100755 index 0000000000000000000000000000000000000000..bd7c6f9b42b35923c5d944653112a815e6dea889 --- /dev/null +++ b/Event/xAOD/xAODEventFormatCnv/xAODEventFormatCnv/test/xAODEventFormatCnvTestDict.h @@ -0,0 +1,23 @@ +// This file's extension implies that it's C, but it's really -*- C++ -*-. +/* Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ +/** + * @file xAODEventFormatCnv/test/xAODEventFormatCnvTestDict.h + * @author frank berghaus <fberghaus@anl.gov> + * @date Nov 2020 + * @brief Dictionary generation header + */ + +#ifndef XAODEVENTFORMATCNVTESTDICT_H +#define XAODEVENTFORMATCNVTESTDICT_H + + +#include "xAODEventFormatCnv/test/A.h" +#include "xAODEventFormatCnv/test/AVec.h" +#include "xAODEventFormatCnv/test/AAuxContainer.h" +#include "AthContainers/AuxElement.h" +#include "AthLinks/ElementLink.h" + + +template class SG::AuxElement::ConstAccessor<ElementLink<xAODMakerTest::AVec> >; + +#endif // XAODEVENTFORMATCNVTESTDICT_H diff --git a/Event/xAOD/xAODForwardCnv/share/xAODForwardCnv_jobOptions.py b/Event/xAOD/xAODForwardCnv/share/xAODForwardCnv_jobOptions.py index 2423eff07bb2fa1d8292671e207b42de69dbb4b7..07a22ffb93410b4ea57da36623bd15faa8c8f478 100644 --- a/Event/xAOD/xAODForwardCnv/share/xAODForwardCnv_jobOptions.py +++ b/Event/xAOD/xAODForwardCnv/share/xAODForwardCnv_jobOptions.py @@ -25,10 +25,6 @@ xAODMBTSModuleCreator() from xAODForwardCnv.xAODForwardEventInfoCreator import xAODForwardEventInfoCreator xAODForwardEventInfoCreator() -# Make sure that the event format object is added to the output: -theApp.CreateSvc += [ "xAODMaker::EventFormatSvc" ] -xaodStream.AddMetaDataItem( "xAOD::EventFormat_v1#EventFormat" ) - # Check what happened to the stream: xaodStream.Print() diff --git a/Event/xAOD/xAODTrigCaloCnv/share/xAODTrigCaloCnv_jobOptions.py b/Event/xAOD/xAODTrigCaloCnv/share/xAODTrigCaloCnv_jobOptions.py index d37037004bb2a89e2c534728c3bcb55a1d4a7155..d4fc97fe4579e66e3ef0be8e54d435073563b41c 100644 --- a/Event/xAOD/xAODTrigCaloCnv/share/xAODTrigCaloCnv_jobOptions.py +++ b/Event/xAOD/xAODTrigCaloCnv/share/xAODTrigCaloCnv_jobOptions.py @@ -38,10 +38,6 @@ xaodStream.AddItem( "xAOD::TrigCaloClusterAuxContainer_v1#*" ) xaodStream.AddItem( "xAOD::TrigEMClusterContainer_v1#*" ) xaodStream.AddItem( "xAOD::TrigEMClusterAuxContainer_v1#*" ) -# Make sure that the event format object is added to the output: -theApp.CreateSvc += [ "xAODMaker::EventFormatSvc" ] -xaodStream.AddMetaDataItem( "xAOD::EventFormat_v1#EventFormat" ) - # Check what happened to the stream: xaodStream.Print() diff --git a/Event/xAOD/xAODTrigMinBiasCnv/share/xAODTrigMinBiasCnv_jobOptions.py b/Event/xAOD/xAODTrigMinBiasCnv/share/xAODTrigMinBiasCnv_jobOptions.py index 9d3bee49d40978977309679da88faa0162036e66..3dd9a4911257dcd8910167f1852e924b42fd29fc 100755 --- a/Event/xAOD/xAODTrigMinBiasCnv/share/xAODTrigMinBiasCnv_jobOptions.py +++ b/Event/xAOD/xAODTrigMinBiasCnv/share/xAODTrigMinBiasCnv_jobOptions.py @@ -33,10 +33,6 @@ xAODTrigT2MbtsBitsCreator() from xAODTrigMinBiasCnv.xAODTrigSpacePointCountsCreator import xAODTrigSpacePointCountsCreator xAODTrigSpacePointCountsCreator() -# Make sure that the event format object is added to the output: -theApp.CreateSvc += [ "xAODMaker::EventFormatSvc" ] -xaodStream.AddMetaDataItem( "xAOD::EventFormat_v1#EventFormat" ) - # Check what happened to the stream: xaodStream.Print() diff --git a/Event/xAOD/xAODTrigMissingETCnv/share/xAODTrigMissingETCnv_jobOptions.py b/Event/xAOD/xAODTrigMissingETCnv/share/xAODTrigMissingETCnv_jobOptions.py index 3c8fd8f36c003b632a0016da9e1923318bbbada9..e4f342a4251327209d511605efc222afc7a06588 100644 --- a/Event/xAOD/xAODTrigMissingETCnv/share/xAODTrigMissingETCnv_jobOptions.py +++ b/Event/xAOD/xAODTrigMissingETCnv/share/xAODTrigMissingETCnv_jobOptions.py @@ -25,10 +25,6 @@ from xAODTrigMissingETCnv.xAODTrigMissingETCreator import \ xAODTrigMissingETCreator xAODTrigMissingETCreator() -# Make sure that the event format object is added to the output: -theApp.CreateSvc += [ "xAODMaker::EventFormatSvc" ] -xaodStream.AddMetaDataItem( "xAOD::EventFormat_v1#EventFormat" ) - # Check what happened to the stream: xaodStream.Print() diff --git a/Event/xAOD/xAODTriggerCnv/share/xAODTriggerCnv_jobOptions.py b/Event/xAOD/xAODTriggerCnv/share/xAODTriggerCnv_jobOptions.py index 04a14fc35424f988fff4600c3e597e69721cb98a..fa025d4c6460b3dd96515f5bb59bc15f2a955329 100644 --- a/Event/xAOD/xAODTriggerCnv/share/xAODTriggerCnv_jobOptions.py +++ b/Event/xAOD/xAODTriggerCnv/share/xAODTriggerCnv_jobOptions.py @@ -46,10 +46,6 @@ xaodStream.AddItem( "xAOD::VertexAuxContainer_v1#*" ) xaodStream.AddItem( "xAOD::TauJetContainer_v1#*" ) xaodStream.AddItem( "xAOD::TauJetAuxContainer_v1#*" ) -# Make sure that the event format object is added to the output: -theApp.CreateSvc += [ "xAODMaker::EventFormatSvc" ] -xaodStream.AddMetaDataItem( "xAOD::EventFormat_v1#EventFormat" ) - # Check what happened to the stream: xaodStream.Print() diff --git a/Event/xAOD/xAODTruthCnv/CMakeLists.txt b/Event/xAOD/xAODTruthCnv/CMakeLists.txt index e226116ad1ce170f66413988f9b59c33c7ebf3b4..023f8a01d15bcc50af6ecb584a5c3804cdd0265d 100644 --- a/Event/xAOD/xAODTruthCnv/CMakeLists.txt +++ b/Event/xAOD/xAODTruthCnv/CMakeLists.txt @@ -5,29 +5,6 @@ # Declare the package name: atlas_subdir( xAODTruthCnv ) -# Extra package dependencies, based on the build environment: -set( extra_dep ) -if( NOT XAOD_STANDALONE ) - set( extra_dep Control/AthenaKernel - PRIVATE - Control/AthLinks - Control/AthenaBaseComps - Control/StoreGate - Event/EventInfo - Event/xAOD/xAODEventInfo - Event/xAOD/xAODTruth - GaudiKernel - Generators/GeneratorObjects ) -endif() - -# Declare the package's dependencies: -atlas_depends_on_subdirs( - PUBLIC - Control/CxxUtils - Control/AthToolSupport/AsgTools - Event/xAOD/xAODTruth - ${extra_dep} ) - # Component(s) in the package: atlas_add_library( xAODTruthCnvLib xAODTruthCnv/*.h Root/*.cxx @@ -38,7 +15,7 @@ if( NOT XAOD_STANDALONE ) atlas_add_component( xAODTruthCnv src/*.h src/*.cxx src/components/*.cxx LINK_LIBRARIES AthLinks AthenaBaseComps StoreGateLib EventInfo - xAODEventInfo xAODTruth GaudiKernel GeneratorObjects + xAODEventInfo xAODTruth GaudiKernel GeneratorObjects AthenaPoolUtilities IOVDbDataModel xAODTruthCnvLib ) endif() diff --git a/Event/xAOD/xAODTruthCnv/src/xAODTruthCnvAlg.cxx b/Event/xAOD/xAODTruthCnv/src/xAODTruthCnvAlg.cxx index 8cf4b77177b417d7f6118a0e28f76ff6d588b13d..5a8b51e03aec14d94ba0e0286795084f16554914 100644 --- a/Event/xAOD/xAODTruthCnv/src/xAODTruthCnvAlg.cxx +++ b/Event/xAOD/xAODTruthCnv/src/xAODTruthCnvAlg.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ #include "AthenaKernel/errorcheck.h" @@ -11,8 +11,6 @@ #include "StoreGate/ReadHandle.h" #include "StoreGate/WriteHandle.h" -#include "EventInfo/EventStreamInfo.h" - #include "xAODTruth/TruthEvent.h" #include "xAODTruth/TruthEventContainer.h" #include "xAODTruth/TruthEventAuxContainer.h" @@ -32,6 +30,9 @@ #include "xAODTruth/TruthMetaDataAuxContainer.h" #include "xAODTruth/TruthMetaData.h" +#include "AthenaPoolUtilities/CondAttrListCollection.h" +#include "IOVDbDataModel/IOVMetaDataContainer.h" + #include "xAODTruthCnvAlg.h" @@ -41,7 +42,9 @@ namespace xAODMaker { xAODTruthCnvAlg::xAODTruthCnvAlg( const string& name, ISvcLocator* svcLoc ) - : AthReentrantAlgorithm( name, svcLoc ), m_metaStore( "MetaDataStore", name ), m_inputMetaStore( "StoreGateSvc/InputMetaDataStore",name) + : AthReentrantAlgorithm( name, svcLoc ) + , m_metaStore( "MetaDataStore", name ) + , m_firstBeginRun(true) { // leaving metadata alone for now--to be updated declareProperty( "MetaObjectName", m_metaName = "TruthMetaData" ); @@ -69,6 +72,11 @@ namespace xAODMaker { ATH_CHECK(m_xaodTruthParticleContainerKey.initialize()); ATH_CHECK(m_xaodTruthVertexContainerKey.initialize()); + ATH_CHECK(m_evtInfo.initialize()); + + ServiceHandle<IIncidentSvc> incSvc("IncidentSvc", name()); + ATH_CHECK(incSvc.retrieve()); + incSvc->addListener( this, "BeginRun", 10); ATH_MSG_DEBUG("Initializing; package version: " << PACKAGE_VERSION ); ATH_MSG_DEBUG("AODContainerName = " << m_aodContainerKey.key() ); @@ -196,17 +204,18 @@ namespace xAODMaker { if (m_writeMetaData) { //The mcChannelNumber is used as a unique identifier for which truth meta data belongs to - const EventStreamInfo* esi = nullptr; - std::vector<std::string> keys; - m_inputMetaStore->keys<EventStreamInfo>(keys); - if (keys.size() > 1) { // Multiple EventStreamInfo (default retrieve won't work), just take the first - CHECK( m_inputMetaStore->retrieve(esi, keys[0])); - } else { - CHECK( m_inputMetaStore->retrieve(esi)); + uint32_t mcChannelNumber = 0; + SG::ReadHandle<xAOD::EventInfo> evtInfo (m_evtInfo,ctx); + if (evtInfo.isValid()) { + mcChannelNumber = evtInfo->mcChannelNumber(); + if (mcChannelNumber==0) mcChannelNumber = evtInfo->runNumber(); } - uint32_t mcChannelNumber = esi->getEventTypes().begin()->mc_channel_number(); - - ATH_CHECK( m_meta.maybeWrite (mcChannelNumber, *genEvt) ); + else { + ATH_MSG_FATAL("Faied to retrieve EventInfo"); + return StatusCode::FAILURE; + } + + ATH_CHECK( m_meta.maybeWrite (mcChannelNumber, *genEvt, m_metaFields) ); } // Event weights vector<float> weights; @@ -400,7 +409,55 @@ namespace xAODMaker { return StatusCode::SUCCESS; } - + void xAODTruthCnvAlg::handle(const Incident& incident) { + if (m_firstBeginRun && incident.type()==IncidentType::BeginRun) { + m_firstBeginRun = false; + ServiceHandle<StoreGateSvc> inputStore("StoreGateSvc/InputMetaDataStore", name()); + if(inputStore.retrieve().isFailure()) { + ATH_MSG_ERROR("Failed to retrieve Input Metadata Store"); + return; + } + const IOVMetaDataContainer* tagInfo{nullptr}; + if(inputStore->retrieve(tagInfo,"/TagInfo").isFailure()) { + ATH_MSG_WARNING("Failed to retrieve /TagInfo metadata from the input store"); + return; + } + if(tagInfo->payloadContainer()->size()>0) { + CondAttrListCollection* tagInfoPayload = tagInfo->payloadContainer()->at(0); + if(tagInfoPayload->size()>0) { + const CondAttrListCollection::AttributeList& al = tagInfoPayload->attributeList(0); + if (al.exists("lhefGenerator")){ + m_metaFields.lhefGenerator = al["lhefGenerator"].data<std::string>(); + } + + if (al.exists("generators")){ + m_metaFields.generators = al["generators"].data<std::string>(); + } + + if (al.exists("evgenProcess")){ + m_metaFields.evgenProcess = al["evgenProcess"].data<std::string>(); + } + + if (al.exists("evgenTune")){ + m_metaFields.evgenTune = al["evgenTune"].data<std::string>(); + } + + if (al.exists("hardPDF")){ + m_metaFields.hardPDF = al["hardPDF"].data<std::string>(); + } + + if (al.exists("softPDF")){ + m_metaFields.softPDF = al["softPDF"].data<std::string>(); + } + } + } + else { + ATH_MSG_WARNING("Empty Tag Info metadata!"); + } + } + } + + // A helper to set up a TruthVertex (without filling the ELs) void xAODTruthCnvAlg::fillVertex(xAOD::TruthVertex* tv, HepMC::ConstGenVertexPtr gv) { tv->setId(gv->id()); @@ -459,7 +516,8 @@ namespace xAODMaker { StatusCode xAODTruthCnvAlg::MetaDataWriter::maybeWrite (uint32_t mcChannelNumber, - const HepMC::GenEvent& genEvt) + const HepMC::GenEvent& genEvt, + const MetadataFields& metaFields) { // This bit needs to be serialized. lock_t lock (m_mutex); @@ -494,6 +552,25 @@ namespace xAODMaker { md->setMcChannelNumber(mcChannelNumber); md->setWeightNames( std::move(orderedWeightNameVec) ); #endif + + if(!metaFields.lhefGenerator.empty()) { + md->setLhefGenerator(metaFields.lhefGenerator); + } + if(!metaFields.generators.empty()) { + md->setGenerators(metaFields.generators); + } + if(!metaFields.evgenProcess.empty()) { + md->setEvgenProcess(metaFields.evgenProcess); + } + if(!metaFields.evgenTune.empty()) { + md->setEvgenTune(metaFields.evgenTune); + } + if(!metaFields.hardPDF.empty()) { + md->setHardPDF(metaFields.hardPDF); + } + if(!metaFields.softPDF.empty()) { + md->setSoftPDF(metaFields.softPDF); + } } return StatusCode::SUCCESS; diff --git a/Event/xAOD/xAODTruthCnv/src/xAODTruthCnvAlg.h b/Event/xAOD/xAODTruthCnv/src/xAODTruthCnvAlg.h index eff80d6621f0cc775fb49bc65ca90ce3e382d59b..8c1808e14e0f0fbcc1ca2f487606ab0149eef731 100644 --- a/Event/xAOD/xAODTruthCnv/src/xAODTruthCnvAlg.h +++ b/Event/xAOD/xAODTruthCnv/src/xAODTruthCnvAlg.h @@ -39,6 +39,7 @@ #include "StoreGate/ReadHandleKey.h" #include "StoreGate/WriteHandleKey.h" #include "CxxUtils/checker_macros.h" +#include "GaudiKernel/IIncidentListener.h" #include <unordered_set> @@ -48,6 +49,7 @@ #include "AtlasHepMC/GenVertex_fwd.h" #include "AtlasHepMC/GenParticle_fwd.h" +#include "xAODEventInfo/EventInfo.h" namespace xAODMaker { @@ -59,7 +61,10 @@ namespace xAODMaker { /// @author James Catmore <James.Catmore@cern.ch> /// @author Jovan Mitreski <Jovan.Mitreski@cern.ch> /// @author Andy Buckley <Andy.Buckley@cern.ch> - class xAODTruthCnvAlg : public AthReentrantAlgorithm { + class xAODTruthCnvAlg + : public AthReentrantAlgorithm + , virtual public IIncidentListener +{ public: /// Regular algorithm constructor @@ -70,8 +75,20 @@ namespace xAODMaker { /// Function executing the algorithm virtual StatusCode execute (const EventContext& ctx) const override; + /// Incident handler + virtual void handle(const Incident& incident) override; private: + // Truth metadata fields retrieved from TagInfo + struct MetadataFields { + std::string lhefGenerator; + std::string generators; + std::string evgenProcess; + std::string evgenTune; + std::string hardPDF; + std::string softPDF; + }; + /// Factor out the pieces dealing with writing to meta data. /// This will be non-const, so need to protect with a mutex. class MetaDataWriter @@ -80,8 +97,8 @@ namespace xAODMaker { StatusCode initialize (ServiceHandle<StoreGateSvc>& metaStore, const std::string& metaName); StatusCode maybeWrite (uint32_t mcChannelNumber, - const HepMC::GenEvent& genEvt); - + const HepMC::GenEvent& genEvt, + const MetadataFields& metaFields); private: /// Mutex to control access to meta data writing. @@ -136,13 +153,18 @@ namespace xAODMaker { /// Connection to the metadata store ServiceHandle< StoreGateSvc > m_metaStore; - ServiceHandle<StoreGateSvc> m_inputMetaStore; /// SG key and name for meta data std::string m_metaName; /// option to disable writing of metadata (e.g. if running a filter on xAOD in generators) Gaudi::Property<bool> m_writeMetaData{this, "WriteTruthMetaData", true}; + /// Event Info + SG::ReadHandleKey<xAOD::EventInfo> m_evtInfo {this, "EventInfo", "EventInfo", "" }; + + /// Tag Info + bool m_firstBeginRun; + MetadataFields m_metaFields; }; // class xAODTruthCnvAlg diff --git a/ForwardDetectors/ZDC/ZdcCnv/ZdcByteStream/ZdcByteStream/ATLAS_CHECK_THREAD_SAFETY b/ForwardDetectors/ZDC/ZdcCnv/ZdcByteStream/ZdcByteStream/ATLAS_CHECK_THREAD_SAFETY new file mode 100644 index 0000000000000000000000000000000000000000..ef1e1aa906c6d8f23bab59c32a5fc3003309fb07 --- /dev/null +++ b/ForwardDetectors/ZDC/ZdcCnv/ZdcByteStream/ZdcByteStream/ATLAS_CHECK_THREAD_SAFETY @@ -0,0 +1 @@ +ForwardDetectors/ZDC/ZdcCnv/ZdcByteStream diff --git a/ForwardDetectors/ZDC/ZdcCnv/ZdcByteStream/ZdcByteStream/ZdcByteStreamCnv.h b/ForwardDetectors/ZDC/ZdcCnv/ZdcByteStream/ZdcByteStream/ZdcByteStreamCnv.h index 4fd81ade53c8a6e419472b7210947d19f7229515..62206f3dd644f4b5ae3971891f4a4d877cb9b060 100644 --- a/ForwardDetectors/ZDC/ZdcCnv/ZdcByteStream/ZdcByteStream/ZdcByteStreamCnv.h +++ b/ForwardDetectors/ZDC/ZdcCnv/ZdcByteStream/ZdcByteStream/ZdcByteStreamCnv.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ #ifndef ZDCBYTESTREAMCNV_H @@ -38,6 +38,7 @@ class ISvcLocator; class StatusCode; class ZdcByteStreamTool; class ZdcByteStreamReadV1V2Tool; +class StoreGateSvc; // Abstract factory to create the converter template <typename > class CnvFactory; @@ -77,8 +78,9 @@ private: /// Service for WRITING bytestream ServiceHandle<IByteStreamEventAccess> m_ByteStreamEventAccess; - /// Message log - mutable MsgStream m_log; + ServiceHandle<StoreGateSvc> m_evtStore; + + /// Message log bool m_debug; }; diff --git a/ForwardDetectors/ZDC/ZdcCnv/ZdcByteStream/ZdcByteStream/ZdcPpmSubBlock.h b/ForwardDetectors/ZDC/ZdcCnv/ZdcByteStream/ZdcByteStream/ZdcPpmSubBlock.h index 447b80d3304075b66b6bfbbe44303b719d2b5fe8..7fd51026e2bdee8f2f7ae595c192fefd389e7be5 100644 --- a/ForwardDetectors/ZDC/ZdcCnv/ZdcByteStream/ZdcByteStream/ZdcPpmSubBlock.h +++ b/ForwardDetectors/ZDC/ZdcCnv/ZdcByteStream/ZdcByteStream/ZdcPpmSubBlock.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ /* @@ -189,8 +189,7 @@ class ZdcPpmSubBlock : public ZdcSubBlock { bool unpackUncompressedErrors(); // Global error flags - mutable uint32_t m_globalError; - mutable bool m_globalDone; + uint32_t m_globalError; // Triggered slice offsets, pedestal value int m_lutOffset; diff --git a/ForwardDetectors/ZDC/ZdcCnv/ZdcByteStream/src/ZdcByteStreamCnv.cxx b/ForwardDetectors/ZDC/ZdcCnv/ZdcByteStream/src/ZdcByteStreamCnv.cxx index a8c48afd51221f6238cc22583e385046d4c5b7a6..286597288cf747a7f67e6eb9ea8be36a8e6ee4a8 100644 --- a/ForwardDetectors/ZDC/ZdcCnv/ZdcByteStream/src/ZdcByteStreamCnv.cxx +++ b/ForwardDetectors/ZDC/ZdcCnv/ZdcByteStream/src/ZdcByteStreamCnv.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ /** @@ -26,6 +26,7 @@ #include "ByteStreamCnvSvcBase/IROBDataProviderSvc.h" #include "ByteStreamData/RawEvent.h" #include "ByteStreamData/ROBData.h" +#include "StoreGate/StoreGateSvc.h" #include "AthenaKernel/ClassID_traits.h" #include "AthContainers/DataVector.h" #include "GaudiKernel/DataObject.h" @@ -35,6 +36,7 @@ #include "GaudiKernel/StatusCode.h" #include "GaudiKernel/MsgStream.h" #include "AthenaKernel/StorableConversions.h" +#include "AthenaKernel/errorcheck.h" ///Zdc specific includes. #include "ZdcEvent/ZdcDigits.h" @@ -55,7 +57,8 @@ ZdcByteStreamCnv::ZdcByteStreamCnv(ISvcLocator* svcloc) : //m_tool("ZdcByteStreamTool/ZdcByteStreamTool"), // old style m_tool("ZdcByteStreamReadV1V2Tool/ZdcByteStreamReadV1V2Tool"), // new style m_robDataProvider("ROBDataProviderSvc",m_name), - m_ByteStreamEventAccess("ByteStreamCnvSvc", m_name), m_log(msgSvc(), m_name), + m_ByteStreamEventAccess("ByteStreamCnvSvc", m_name), + m_evtStore("StoreGateSvc", m_name), m_debug(false) { } @@ -99,52 +102,16 @@ StatusCode ZdcByteStreamCnv::initialize() */ m_debug = msgSvc()->outputLevel(m_name) <= MSG::DEBUG; - m_log << MSG::DEBUG << "Initializing " << m_name << " - package version " << PACKAGE_VERSION - << endmsg; - //Gaudi Converter Factory - StatusCode sc = Converter::initialize(); - if (sc.isFailure()) - { - m_log << MSG::ERROR << "ZDC: Failed to initialize Converter " << endmsg; - return sc; - } - else - { - m_log << MSG::DEBUG << "ZDC: Converter initialized " << endmsg; - } - - - //Get ByteStreamCnvSvc - sc = m_ByteStreamEventAccess.retrieve(); - if (sc.isFailure()) - { - m_log << MSG::ERROR << "ZDC: Failed to retrieve service " << m_ByteStreamEventAccess << endmsg; - return sc; - } - else - { - m_log << MSG::DEBUG << "ZDC: Retrieved service " << m_ByteStreamEventAccess << endmsg; - } + ATH_CHECK( Converter::initialize() ); + ATH_CHECK( m_ByteStreamEventAccess.retrieve() ); + ATH_CHECK( m_tool.retrieve() ); + ATH_CHECK( m_evtStore.retrieve() ); - // Retrieve Tool - sc = m_tool.retrieve(); + StatusCode sc = m_robDataProvider.retrieve(); if (sc.isFailure()) { - m_log << MSG::ERROR << "ZDC: Failed to retrieve tool " << m_tool << endmsg; - return sc; - } - else m_log << MSG::DEBUG << "ZDC: Retrieved tool " << m_tool << endmsg; - - // Get ROBDataProvider - sc = m_robDataProvider.retrieve(); - if (sc.isFailure()) - { - m_log << MSG::WARNING << "ZDC: Failed to retrieve service " << m_robDataProvider << endmsg; - } - else - { - m_log << MSG::DEBUG << "ZDC: Retrieved service " << m_robDataProvider << endmsg; + REPORT_MESSAGE (MSG::WARNING) << "ZDC: Failed to retrieve service " << m_robDataProvider; } return StatusCode::SUCCESS; @@ -156,18 +123,19 @@ StatusCode ZdcByteStreamCnv::initialize() StatusCode ZdcByteStreamCnv::createObj(IOpaqueAddress* pAddr, DataObject*& pObj) { /// Create the RDO from bytestream. - m_log << MSG::DEBUG << "ZDC: createObj() called" << endmsg; ByteStreamAddress *pBS_Addr; pBS_Addr = dynamic_cast<ByteStreamAddress *> (pAddr); if (!pBS_Addr) { - m_log << MSG::ERROR << "ZDC: Can not cast to ByteStreamAddress " << endmsg; + REPORT_ERROR (StatusCode::FAILURE) << "ZDC: Can not cast to ByteStreamAddress "; return StatusCode::FAILURE; } const std::string nm = *(pBS_Addr->par()); - if (m_debug) m_log << MSG::DEBUG << "ZDC: Creating Objects " << nm << endmsg; + if (m_debug) { + REPORT_MESSAGE (MSG::DEBUG) << "ZDC: Creating Objects " << nm; + } // Get SourceIDs; This is NOT related to the ZDC Identifiers //const std::vector<uint32_t>& vID(m_tool->sourceIDs()); // old style @@ -180,37 +148,28 @@ StatusCode ZdcByteStreamCnv::createObj(IOpaqueAddress* pAddr, DataObject*& pObj) // size check if (m_debug) { - m_log << MSG::DEBUG << "ZDC: Number of ROB fragments is " << robFrags.size() << endmsg; + REPORT_MESSAGE (MSG::DEBUG) << "ZDC: Number of ROB fragments is " << robFrags.size(); } //ZdcDigitsCollection* const ttCollection = new ZdcDigitsCollection; - xAOD::TriggerTowerContainer* const TTCollection = new xAOD::TriggerTowerContainer; // new style - xAOD::TriggerTowerAuxContainer* aux = new xAOD::TriggerTowerAuxContainer(); - TTCollection->setStore(aux); + auto TTCollection = std::make_unique<xAOD::TriggerTowerContainer>(); // new style + auto aux = std::make_unique<xAOD::TriggerTowerAuxContainer>(); + TTCollection->setStore(aux.get()); if (robFrags.size() == 0) { - //pObj = SG::asStorable(ttCollection); - pObj = SG::asStorable(TTCollection); + pObj = SG::asStorable(std::move(TTCollection)); + ATH_CHECK( m_evtStore->record (std::move(aux), nm + "Aux.") ); return StatusCode::SUCCESS; } - //StatusCode sc = m_tool->convert(robFrags, ttCollection); // old style - StatusCode sc = m_tool->convert(robFrags, TTCollection); // new style + ATH_CHECK( m_tool->convert(robFrags, TTCollection.get()) ); // new style - if (sc.isFailure()) - { - m_log << MSG::ERROR << "ZDC: Failed to create Objects " << nm << endmsg; - //delete ttCollection; - delete TTCollection; // new style - return sc; - } + pObj = SG::asStorable(std::move(TTCollection)); // new style + ATH_CHECK( m_evtStore->record (std::move(aux), nm + "Aux.") ); - //pObj = SG::asStorable(ttCollection); // old style - pObj = SG::asStorable(TTCollection); // new style - - return sc; + return StatusCode::SUCCESS; } //================================================================================================== @@ -221,14 +180,12 @@ StatusCode ZdcByteStreamCnv::createObj(IOpaqueAddress* pAddr, DataObject*& pObj) /* StatusCode ZdcByteStreamCnv::createRep(DataObject* pObj, IOpaqueAddress*& pAddr) { - m_log << MSG::DEBUG << "ZDC: createRep() called" << endmsg; - RawEventWrite* re = m_ByteStreamEventAccess->getRawEvent(); ZdcDigitsCollection* ttCollection = 0; if (!SG::fromStorable(pObj, ttCollection)) { - m_log << MSG::ERROR << "ZDC: Cannot cast to ZdcDigitsCollection" << endmsg; + REPORT_ERROR (StatusCode::FAILURE) << "ZDC: Cannot cast to ZdcDigitsCollection"; return StatusCode::FAILURE; } diff --git a/ForwardDetectors/ZDC/ZdcCnv/ZdcByteStream/src/ZdcByteStreamRawData.cxx b/ForwardDetectors/ZDC/ZdcCnv/ZdcByteStream/src/ZdcByteStreamRawData.cxx index a026007fa9258a22b5b5c1db206fc1d88309f61a..4587e7e4094e26ca79bc0d38f50d611da180de0a 100644 --- a/ForwardDetectors/ZDC/ZdcCnv/ZdcByteStream/src/ZdcByteStreamRawData.cxx +++ b/ForwardDetectors/ZDC/ZdcCnv/ZdcByteStream/src/ZdcByteStreamRawData.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ /* @@ -73,8 +73,7 @@ StatusCode ZdcByteStreamRawData::execute() /// otherwise just skip this /// TODO keep record somewhere of this type of error? - //ZdcDigitsCollection* ttCollection = 0; - const DataHandle<ZdcDigitsCollection> ttCollection; + const ZdcDigitsCollection* ttCollection = nullptr; msg(MSG::DEBUG) << "Looking for ZDC Digits Collection at " << m_ZdcDigitsCollectionLocation << endmsg; //std::cout << "Looking for ZDC Digits Collection at " << m_ZdcDigitsCollectionLocation << std::endl; diff --git a/ForwardDetectors/ZDC/ZdcCnv/ZdcByteStream/src/ZdcByteStreamReadV1V2Tool.cxx b/ForwardDetectors/ZDC/ZdcCnv/ZdcByteStream/src/ZdcByteStreamReadV1V2Tool.cxx index 436131d8d62388b7d91a829053db84bff6695383..77cd2678c4d4bade76cd601aa427eb777c2d4c9f 100644 --- a/ForwardDetectors/ZDC/ZdcCnv/ZdcByteStream/src/ZdcByteStreamReadV1V2Tool.cxx +++ b/ForwardDetectors/ZDC/ZdcCnv/ZdcByteStream/src/ZdcByteStreamReadV1V2Tool.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ // =========================================================================== @@ -113,7 +113,6 @@ StatusCode ZdcByteStreamReadV1V2Tool::initialize() { msg(MSG::DEBUG) << "execute: retrieved ZdcID" << endmsg; } m_zdcID = zdcID; - ZdcCablingService::getInstance()->setZdcID(m_zdcID); ServiceHandle<IIncidentSvc> incidentSvc("IncidentSvc", name()); diff --git a/ForwardDetectors/ZDC/ZdcCnv/ZdcByteStream/src/ZdcByteStreamTester.cxx b/ForwardDetectors/ZDC/ZdcCnv/ZdcByteStream/src/ZdcByteStreamTester.cxx index 1d1603cf55a98d369fc3775d860170612e13e7ca..35efe938b5ad0daec7285684314865cf20ff81cd 100644 --- a/ForwardDetectors/ZDC/ZdcCnv/ZdcByteStream/src/ZdcByteStreamTester.cxx +++ b/ForwardDetectors/ZDC/ZdcCnv/ZdcByteStream/src/ZdcByteStreamTester.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ /* @@ -73,8 +73,7 @@ StatusCode ZdcByteStreamTester::execute() /// otherwise just skip this /// TODO keep record somewhere of this type of error? - //ZdcDigitsCollection* ttCollection = 0; - const DataHandle<ZdcDigitsCollection> ttCollection; + const ZdcDigitsCollection* ttCollection = nullptr; StatusCode sc = evtStore()->retrieve(ttCollection, m_ZdcDigitsCollectionLocation); if (sc.isFailure() || !ttCollection || ttCollection->empty()) { diff --git a/ForwardDetectors/ZDC/ZdcCnv/ZdcByteStream/src/ZdcByteStreamTool.cxx b/ForwardDetectors/ZDC/ZdcCnv/ZdcByteStream/src/ZdcByteStreamTool.cxx index a92f978637b7134a35e52330b2284d523f317012..756ac9f9f94938308f037848310ed0139ec7a613 100644 --- a/ForwardDetectors/ZDC/ZdcCnv/ZdcByteStream/src/ZdcByteStreamTool.cxx +++ b/ForwardDetectors/ZDC/ZdcCnv/ZdcByteStream/src/ZdcByteStreamTool.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ /* @@ -125,7 +125,6 @@ StatusCode ZdcByteStreamTool::initialize() msg(MSG::DEBUG) << "execute: retrieved ZdcID" << endmsg; } m_zdcID = zdcID; - ZdcCablingService::getInstance()->setZdcID(m_zdcID); return StatusCode::SUCCESS; } diff --git a/ForwardDetectors/ZDC/ZdcCnv/ZdcByteStream/src/ZdcCaloUserHeader.cxx b/ForwardDetectors/ZDC/ZdcCnv/ZdcByteStream/src/ZdcCaloUserHeader.cxx index b4ae404f77d8ddc6d8ba45240259c16263d6183a..c92f6e36ae6fd4ac35a2549c6675a0cf33f06fe6 100644 --- a/ForwardDetectors/ZDC/ZdcCnv/ZdcByteStream/src/ZdcCaloUserHeader.cxx +++ b/ForwardDetectors/ZDC/ZdcCnv/ZdcByteStream/src/ZdcCaloUserHeader.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ #include "ZdcByteStream/ZdcCaloUserHeader.h" @@ -8,7 +8,7 @@ //using namespace LVL1BS; namespace { - ZdcWordDecoder caloUserWordDecoder({ + const ZdcWordDecoder caloUserWordDecoder({ BitField("Length", 0, 4), BitField("L1A Slice: PP FADC", 4, 5), BitField("LUT", 9, 3), diff --git a/ForwardDetectors/ZDC/ZdcCnv/ZdcByteStream/src/ZdcPpmSubBlock.cxx b/ForwardDetectors/ZDC/ZdcCnv/ZdcByteStream/src/ZdcPpmSubBlock.cxx index b2ea4ebde789d2032bb24dcfb7cdec1124280f83..e4a2c3c7ea0f52c7e8abe8f4f098283c06b7e339 100644 --- a/ForwardDetectors/ZDC/ZdcCnv/ZdcByteStream/src/ZdcPpmSubBlock.cxx +++ b/ForwardDetectors/ZDC/ZdcCnv/ZdcByteStream/src/ZdcPpmSubBlock.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ /** Sub-Block class for PPM data. @@ -57,7 +57,6 @@ const int ZdcPpmSubBlock::s_ppmChannel[64] = {0, 4, 8, 12, 16, 20, 24 ZdcPpmSubBlock::ZdcPpmSubBlock() : m_globalError(0), - m_globalDone(false), m_lutOffset(-1), m_fadcOffset(-1), m_pedestal(10), @@ -77,7 +76,6 @@ void ZdcPpmSubBlock::clear() { ZdcSubBlock::clear(); m_globalError = 0; - m_globalDone = false; m_lutOffset = -1; m_fadcOffset = -1; m_datamap.clear(); @@ -211,8 +209,10 @@ void ZdcPpmSubBlock::fillPpmError(const int chan, const int errorWord) if (m_errormap.empty()) m_errormap.resize(s_glinkPins); // Expand one ASIC channel disabled bit to four const uint32_t chanDisabled = (errorWord & 0x1) << asic(chan); - m_errormap[pin(chan)] |= (((errorWord >> 1) << s_asicChannels) - | chanDisabled) & s_errorMask; + uint32_t word = (((errorWord >> 1) << s_asicChannels) + | chanDisabled) & s_errorMask; + m_errormap[pin(chan)] |= word; + m_globalError |= word; } // Store an error word corresponding to a G-Link pin @@ -221,6 +221,10 @@ void ZdcPpmSubBlock::fillPpmPinError(const int pin, const int errorWord) { if (m_errormap.empty()) m_errormap.resize(s_glinkPins); m_errormap[pin] = errorWord & s_errorMask; + m_globalError = 0; + for (uint32_t word : m_errormap) { + m_globalError |= word; + } } // Return the error word for a data channel @@ -250,13 +254,6 @@ int ZdcPpmSubBlock::ppmPinError(const int pin) const bool ZdcPpmSubBlock::errorBit(const int bit) const { - if ( ! m_globalDone) { - std::vector<uint32_t>::const_iterator pos; - for (pos = m_errormap.begin(); pos != m_errormap.end(); ++pos) { - m_globalError |= *pos; - } - m_globalDone = true; - } return m_globalError & (0x1 << bit); } @@ -417,10 +414,12 @@ bool ZdcPpmSubBlock::unpackNeutral() if (!rc) setUnpackErrorCode(ZdcSubBlock::UNPACK_DATA_TRUNCATED); // Errors m_errormap.clear(); + m_globalError = 0; for (int pin = 0; pin < s_glinkPins; ++pin) { uint32_t error = unpackerNeutral(pin, s_errorBits); error |= unpackerNeutralParityError(pin) << s_errorBits; m_errormap.push_back(error); + m_globalError |= error; } return rc; } @@ -449,8 +448,11 @@ bool ZdcPpmSubBlock::unpackUncompressedErrors() { unpackerInit(); m_errormap.clear(); + m_globalError = 0; for (int pin = 0; pin < s_glinkPins; ++pin) { - m_errormap.push_back(unpacker(s_wordLen)); + uint32_t word = unpacker(s_wordLen); + m_errormap.push_back(word); + m_globalError |= word; } const bool rc = unpackerSuccess(); if (!rc) setUnpackErrorCode(ZdcSubBlock::UNPACK_DATA_TRUNCATED); diff --git a/ForwardDetectors/ZDC/ZdcCnv/ZdcByteStream/src/ZdcSubBlockHeader.cxx b/ForwardDetectors/ZDC/ZdcCnv/ZdcByteStream/src/ZdcSubBlockHeader.cxx index 64b7f03a39cf943c66c4437992f14a52cbbaf912..280854e2b63d7179f6157a3d0766ab3a24531685 100644 --- a/ForwardDetectors/ZDC/ZdcCnv/ZdcByteStream/src/ZdcSubBlockHeader.cxx +++ b/ForwardDetectors/ZDC/ZdcCnv/ZdcByteStream/src/ZdcSubBlockHeader.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ #include "ZdcByteStream/ZdcSubBlockHeader.h" @@ -9,7 +9,7 @@ //using namespace LVL1BS; namespace { - ZdcWordDecoder subBlockHeaderDecoder( + const ZdcWordDecoder subBlockHeaderDecoder( { BitField("Type", 28, 4), BitField("Version", 25, 3), diff --git a/ForwardDetectors/ZDC/ZdcCnv/ZdcByteStream/src/ZdcSubBlockStatus.cxx b/ForwardDetectors/ZDC/ZdcCnv/ZdcByteStream/src/ZdcSubBlockStatus.cxx index caec1bf47ab6258be469c53a6e1ab00db1431b14..43c38143fa33a03387d4776597b3940a52a23e2e 100644 --- a/ForwardDetectors/ZDC/ZdcCnv/ZdcByteStream/src/ZdcSubBlockStatus.cxx +++ b/ForwardDetectors/ZDC/ZdcCnv/ZdcByteStream/src/ZdcSubBlockStatus.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ #include "ZdcByteStream/ZdcSubBlockStatus.h" @@ -9,7 +9,7 @@ //using namespace LVL1BS; namespace { - ZdcWordDecoder subBlockStatusDecoder( + const ZdcWordDecoder subBlockStatusDecoder( { BitField("Timeout", 7, 1), BitField("Link", 6, 1), diff --git a/ForwardDetectors/ZDC/ZdcConditions/ZdcConditions/ATLAS_CHECK_THREAD_SAFETY b/ForwardDetectors/ZDC/ZdcConditions/ZdcConditions/ATLAS_CHECK_THREAD_SAFETY new file mode 100644 index 0000000000000000000000000000000000000000..c23f3fa5d40430277921484989ccccd49878d962 --- /dev/null +++ b/ForwardDetectors/ZDC/ZdcConditions/ZdcConditions/ATLAS_CHECK_THREAD_SAFETY @@ -0,0 +1 @@ +ForwardDetectors/ZDC/ZdcConditions diff --git a/ForwardDetectors/ZDC/ZdcConditions/ZdcConditions/ZdcCablingService.h b/ForwardDetectors/ZDC/ZdcConditions/ZdcConditions/ZdcCablingService.h index d3a778b6d24902a9922ab3d75b9addd6e0229890..3cfead95fcbab866bc76e549322252aa08737cd1 100755 --- a/ForwardDetectors/ZDC/ZdcConditions/ZdcConditions/ZdcCablingService.h +++ b/ForwardDetectors/ZDC/ZdcConditions/ZdcConditions/ZdcCablingService.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ #ifndef ZDCCABLINGSERVICE_H @@ -26,7 +26,7 @@ class ZdcCablingService public: /** get pointer to service instance*/ - static ZdcCablingService * getInstance() ; + static const ZdcCablingService * getInstance() ; /** delete service instance */ static void deleteInstance() ; @@ -62,7 +62,8 @@ public: protected: /** Default constructor protected */ - ZdcCablingService() ; + ZdcCablingService(const ZdcID* zdcID, + const ZdcHardwareID* zdcHWID) ; /** Destructor protected */ virtual ~ZdcCablingService() ; @@ -91,29 +92,11 @@ public: const ZdcHardwareID* m_zdcHWID; - enum ZdcCablingType { TestBeam = -1, - Sim = 0, - FirstData = 1}; - - ZdcCablingType m_cablingType; - - public: - - static ZdcCablingService * s_zdcCablingService ; - - void setCablingType (ZdcCablingType type); - int m_connected[16][16]; void setConnected(int ppm, int channel); void fillConnectionTables(); void fillDB(); - void setZdcID (const ZdcID* zdcID) {m_zdcID = zdcID;} - void setZdcHWID (const ZdcHardwareID* zdcHWID) {m_zdcHWID = zdcHWID;} - - inline const ZdcID* getZdcID() const { return m_zdcID; } - inline const ZdcHardwareID* getZdcHWID() const { return m_zdcHWID; } - inline int getCablingType() const { return m_cablingType; } inline int crate_index_lookup(int& crate) const { int ic=0; diff --git a/ForwardDetectors/ZDC/ZdcConditions/ZdcConditions/ZdcCablingSvc.h b/ForwardDetectors/ZDC/ZdcConditions/ZdcConditions/ZdcCablingSvc.h index 3f05ca1a1a274144a9014405123201297dbdf440..4b715e65f8801f7c0cac5949b268d1ab3a31bec6 100755 --- a/ForwardDetectors/ZDC/ZdcConditions/ZdcConditions/ZdcCablingSvc.h +++ b/ForwardDetectors/ZDC/ZdcConditions/ZdcConditions/ZdcCablingSvc.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ #ifndef ZDCCONDITIONS_ZDCCABLINGSVC_H @@ -35,7 +35,7 @@ class ZdcCablingSvc : public AthService private: - ZdcCablingService* m_cablingService; + const ZdcCablingService* m_cablingService; ServiceHandle<StoreGateSvc> m_detStore; diff --git a/ForwardDetectors/ZDC/ZdcConditions/src/ZdcCablingService.cxx b/ForwardDetectors/ZDC/ZdcConditions/src/ZdcCablingService.cxx index 92e17339b62df73fbabca3d28a93ff7167de5670..6b807f6d9daf92a23819a4d64f9b9e77e2c67b8b 100755 --- a/ForwardDetectors/ZDC/ZdcConditions/src/ZdcCablingService.cxx +++ b/ForwardDetectors/ZDC/ZdcConditions/src/ZdcCablingService.cxx @@ -1,48 +1,47 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ #include "ZdcConditions/ZdcCablingService.h" +#include "StoreGate/StoreGateSvc.h" #include <string> #include <iostream> #include <algorithm> -// initialization of singleton instance pointer - -ZdcCablingService * ZdcCablingService::s_zdcCablingService = 0 ; - // Singleton methods //------------------------------------------------------------ -ZdcCablingService * ZdcCablingService::getInstance() +const ZdcCablingService * ZdcCablingService::getInstance() { - - if(s_zdcCablingService == 0){ - std::cout << "==> New ZdcCablingService created" << std::endl; - s_zdcCablingService = new ZdcCablingService() ; - } - return s_zdcCablingService ; + static const ZdcCablingService svc (nullptr, nullptr); + return &svc; } //------------------------------------------------------------- void ZdcCablingService::deleteInstance() { - if(s_zdcCablingService != 0){ - delete s_zdcCablingService ; - s_zdcCablingService = 0 ; - } } // default constructor //------------------------------------------------------------- -ZdcCablingService::ZdcCablingService() - : m_dbFilled(0), m_zdcID(0), m_zdcHWID(0) - , m_cablingType(ZdcCablingService::Sim) +ZdcCablingService::ZdcCablingService (const ZdcID* zdcID, + const ZdcHardwareID* zdcHWID) + : m_dbFilled(0), m_zdcID(zdcID), m_zdcHWID(zdcHWID) { + ServiceHandle<StoreGateSvc> detStore ("DetectorStore", "ZdcCablingSevice"); + if (!m_zdcID) { + if (detStore->retrieve (m_zdcID).isFailure()) { + std::abort(); + } + } + if (!m_zdcHWID) { + if (detStore->retrieve (m_zdcHWID).isFailure()) { + std::abort(); + } + } fillConnectionTables(); - fillDB(); } @@ -263,16 +262,6 @@ ZdcCablingService::~ZdcCablingService() { } -void -ZdcCablingService::setCablingType(ZdcCablingService::ZdcCablingType type) -{ -// cabling type can be: -// -1 for testbeam -// 0 for standard simulation -// 1 new configuration - m_cablingType = type; -} - void ZdcCablingService::setConnected(int ppm, int channel) { diff --git a/ForwardDetectors/ZDC/ZdcConditions/src/ZdcCablingSvc.cxx b/ForwardDetectors/ZDC/ZdcConditions/src/ZdcCablingSvc.cxx index 6866c0c1088214b0769be04f669335f7c554a48a..5a732eea9bcf1238b871e369f44b52eeb3395b1a 100755 --- a/ForwardDetectors/ZDC/ZdcConditions/src/ZdcCablingSvc.cxx +++ b/ForwardDetectors/ZDC/ZdcConditions/src/ZdcCablingSvc.cxx @@ -1,12 +1,10 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ #include "ZdcConditions/ZdcCablingSvc.h" #include "GaudiKernel/MsgStream.h" #include "StoreGate/StoreGateSvc.h" -#include "ZdcIdentifier/ZdcID.h" -#include "ZdcIdentifier/ZdcHardwareID.h" #include <cstdlib> #include "GeoModelInterfaces/IGeoModelSvc.h" @@ -76,18 +74,6 @@ ZdcCablingSvc::initialize() } */ - const ZdcID* zdcID(0); - if(m_detStore->retrieve(zdcID).isFailure()){ - log << MSG::ERROR << "Unable to retrieve ZdcID helper from DetectorStore" << endmsg; - return StatusCode::FAILURE; - } - - const ZdcHardwareID* zdcHWID(0); - if(m_detStore->retrieve(zdcHWID).isFailure()){ - log << MSG::ERROR << "Unable to retrieve ZdcHWID helper from DetectorStore" << endmsg; - return StatusCode::FAILURE; - } - //=== Initialize ZdcCablingService singleton m_cablingService = ZdcCablingService::getInstance(); if(!m_cablingService){ @@ -95,11 +81,6 @@ ZdcCablingSvc::initialize() return StatusCode::FAILURE ; } - //m_cablingService->setCaloLVL1(caloID); - m_cablingService->setZdcID(zdcID); - m_cablingService->setZdcHWID(zdcHWID); - - IGeoModelSvc *geoModel=0; StatusCode sc = service("GeoModelSvc", geoModel); if(sc.isFailure()) @@ -129,9 +110,6 @@ ZdcCablingSvc::initialize() } } - log << MSG::INFO << "Setting Cabling type to " << m_cablingType << endmsg; - m_cablingService->setCablingType((ZdcCablingService::ZdcCablingType)m_cablingType); - MSG::Level logLevel = log.level(); if (logLevel <= MSG::VERBOSE) { diff --git a/ForwardDetectors/ZDC/ZdcEvent/ZdcEvent/ATLAS_CHECK_THREAD_SAFETY b/ForwardDetectors/ZDC/ZdcEvent/ZdcEvent/ATLAS_CHECK_THREAD_SAFETY new file mode 100644 index 0000000000000000000000000000000000000000..1914c2b210071464e7b8dd30c7bc0204ad61d22d --- /dev/null +++ b/ForwardDetectors/ZDC/ZdcEvent/ZdcEvent/ATLAS_CHECK_THREAD_SAFETY @@ -0,0 +1 @@ +ForwardDetectors/ZDC/ZdcEvent diff --git a/ForwardDetectors/ZDC/ZdcEvent/src/ZdcDigits.cxx b/ForwardDetectors/ZDC/ZdcEvent/src/ZdcDigits.cxx index f9c81bf972fb9124f5cf862b901bac1981b23c5c..62920a21fda69efd473188c9277a761cb9b6009d 100755 --- a/ForwardDetectors/ZDC/ZdcEvent/src/ZdcDigits.cxx +++ b/ForwardDetectors/ZDC/ZdcEvent/src/ZdcDigits.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ //***************************************************************************** @@ -69,31 +69,28 @@ void ZdcDigits::print() const //std::cout << std::setiosflags( std::ios::showpoint ); //std::cout << std::setprecision(2); - std::vector<int>::const_iterator it; - std::vector<int>::const_iterator it_end; - std::cout << "gain0/delay0 (" << m_digits_gain0_delay0.size() << " elements): "; - it = m_digits_gain0_delay0.begin(); - it_end = m_digits_gain0_delay0.end(); - while (it!=it_end) { std::cout << " " << (*it); it++;} + for (int val : m_digits_gain0_delay0) { + std::cout << " " << val; + } std::cout << std::endl; std::cout << "gain0/delay1 (" << m_digits_gain0_delay1.size() << " elements): "; - it = m_digits_gain0_delay1.begin(); - it_end = m_digits_gain0_delay1.end(); - while (it!=it_end) { std::cout << " " << (*it); it++;} + for (int val : m_digits_gain0_delay1) { + std::cout << " " << val; + } std::cout << std::endl; std::cout << "gain1/delay0 (" << m_digits_gain1_delay0.size() << " elements): "; - it = m_digits_gain1_delay0.begin(); - it_end = m_digits_gain1_delay0.end(); - while (it!=it_end) { std::cout << " " << (*it); it++;} + for (int val : m_digits_gain1_delay0) { + std::cout << " " << val; + } std::cout << std::endl; std::cout << "gain1/delay1 (" << m_digits_gain1_delay1.size() << " elements): "; - it = m_digits_gain1_delay1.begin(); - it_end = m_digits_gain1_delay1.end(); - while (it!=it_end) { std::cout << " " << (*it); it++;} + for (int val : m_digits_gain1_delay1) { + std::cout << " " << val; + } std::cout << std::endl; diff --git a/ForwardDetectors/ZDC/ZdcEvent/src/ZdcDigitsCollection.cxx b/ForwardDetectors/ZDC/ZdcEvent/src/ZdcDigitsCollection.cxx index 3c805ee7cd098bec909ecd89c846d8726b724423..5f5a5de0c377fc6295f3b18f67f318102ff4042b 100644 --- a/ForwardDetectors/ZDC/ZdcEvent/src/ZdcDigitsCollection.cxx +++ b/ForwardDetectors/ZDC/ZdcEvent/src/ZdcDigitsCollection.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ @@ -8,17 +8,12 @@ void ZdcDigitsCollection::print() { - iterator it = this->begin(); - iterator it_end = this->end(); - std::cout << "Dumping ZdcDigitsCollection" << std::endl; int i = 0; - while (it != it_end) + for (const ZdcDigits* dig : *this) { std::cout << "Printing Digit #" << i << std::endl; - (*it)->print(); - //std::cout << (*it) << std::endl; - it++; + dig->print(); i++; } return; diff --git a/ForwardDetectors/ZDC/ZdcEvent/src/ZdcRawData.cxx b/ForwardDetectors/ZDC/ZdcEvent/src/ZdcRawData.cxx index 35de5bf85b6351c361b34dd21ae82ec9a16fcc25..12fcc5c8d355f9ab33f8492582783ce458cab7ea 100755 --- a/ForwardDetectors/ZDC/ZdcEvent/src/ZdcRawData.cxx +++ b/ForwardDetectors/ZDC/ZdcEvent/src/ZdcRawData.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ //***************************************************************************** @@ -28,8 +28,8 @@ #include <iomanip> ZdcRawData::ZdcRawData( const Identifier& id ) + : m_id (id) { - m_id = id; } void ZdcRawData::print() const @@ -77,12 +77,9 @@ void ZdcRawData::print_to_stream ( const std::vector<double>& val, std::ostringstream & text) { text << label; - - std::vector<double>::const_iterator it1=val.begin(); - std::vector<double>::const_iterator it2=val.end(); - - for ( ; it1!=it2; ++it1) text << " " << (*it1); - + for (double v : val) { + text << " " << v; + } } void ZdcRawData::print_to_stream ( const std::vector<int>& val, @@ -90,11 +87,8 @@ void ZdcRawData::print_to_stream ( const std::vector<int>& val, std::ostringstream & text) { text << label; - - std::vector<int>::const_iterator it1=val.begin(); - std::vector<int>::const_iterator it2=val.end(); - - for ( ; it1!=it2; ++it1) text << " " << (*it1); - + for (double v : val) { + text << " " << v; + } } diff --git a/ForwardDetectors/ZDC/ZdcIdentifier/ZdcIdentifier/ZdcID.h b/ForwardDetectors/ZDC/ZdcIdentifier/ZdcIdentifier/ZdcID.h index 5c2af90945df05b7010d1c4ddf521c6ca553d299..2ea7953f01bf1cffdf6b74f1263a890da300b8d0 100644 --- a/ForwardDetectors/ZDC/ZdcIdentifier/ZdcIdentifier/ZdcID.h +++ b/ForwardDetectors/ZDC/ZdcIdentifier/ZdcIdentifier/ZdcID.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ #ifndef ZdcID_H @@ -131,7 +131,7 @@ IdentifierHash ZdcID::module_hash (Identifier module_id) const { // module hash is composed of side and module - static unsigned int nmodule = m_module_impl.field().get_maximum() + 1; + static const unsigned int nmodule = m_module_impl.field().get_maximum() + 1; return (nmodule*m_side_impl.unpackToIndex(module_id) + module(module_id)); } @@ -140,9 +140,9 @@ IdentifierHash ZdcID::channel_hash (Identifier channel_id) const { // module hash is composed of side, module, type and channel - static unsigned int nmodule = m_module_impl.field().get_maximum() + 1; - static unsigned int ntype = m_type_impl.field().get_maximum() + 1; - static unsigned int nchannel = m_channel_impl.field().get_maximum() + 1; + static const unsigned int nmodule = m_module_impl.field().get_maximum() + 1; + static const unsigned int ntype = m_type_impl.field().get_maximum() + 1; + static const unsigned int nchannel = m_channel_impl.field().get_maximum() + 1; return ((nmodule*ntype*nchannel)*m_side_impl.unpackToIndex(channel_id) + (ntype*nchannel)*module(channel_id) + nchannel*type(channel_id) diff --git a/ForwardDetectors/ZDC/ZdcIdentifier/ZdcIdentifier/ZdcID_Exception.h b/ForwardDetectors/ZDC/ZdcIdentifier/ZdcIdentifier/ZdcID_Exception.h index 3707bfe114de4cdc71e2de08817fd5ff62dfa7ea..9b18162397b5caa3623143445669fd2f620c5731 100755 --- a/ForwardDetectors/ZDC/ZdcIdentifier/ZdcIdentifier/ZdcID_Exception.h +++ b/ForwardDetectors/ZDC/ZdcIdentifier/ZdcIdentifier/ZdcID_Exception.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ #ifndef ZDCID_EXCEPTION_H @@ -24,12 +24,12 @@ public: /** * constructor to be used */ - ZdcID_Exception(std::string l_message , int l_code) : m_message ( l_message ) , m_code ( l_code ) { } + ZdcID_Exception(const std::string& l_message , int l_code) : m_message ( l_message ) , m_code ( l_code ) { } /** * set error message */ - void message(std::string l_message) { m_message = l_message ;} + void message(const std::string& l_message) { m_message = l_message ;} /** * return error message diff --git a/ForwardDetectors/ZDC/ZdcRec/ZdcRec/ZdcSignalSinc.h b/ForwardDetectors/ZDC/ZdcRec/ZdcRec/ZdcSignalSinc.h index 1c6fbd2f84d141e295a1af49c705bb667a4d95cd..09f5ab1c10aa50844ae225953c19d69fa501d17b 100644 --- a/ForwardDetectors/ZDC/ZdcRec/ZdcRec/ZdcSignalSinc.h +++ b/ForwardDetectors/ZDC/ZdcRec/ZdcRec/ZdcSignalSinc.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ /* @@ -18,6 +18,10 @@ class ZdcSignalSinc { ZdcSignalSinc(int); ~ZdcSignalSinc(); + + ZdcSignalSinc(const ZdcSignalSinc&) = delete; + ZdcSignalSinc& operator= (const ZdcSignalSinc&) = delete; + int process(double *,double gain=1., double ped=0., double frac=1., bool corr=true); int getError(); diff --git a/ForwardDetectors/ZDC/ZdcRec/src/ZdcRec.cxx b/ForwardDetectors/ZDC/ZdcRec/src/ZdcRec.cxx index d8f780dc8d0bd501037a24674f295396c9a2ce75..2e9ebbe8b05073bf72d6f08d682b9a7a971159c1 100644 --- a/ForwardDetectors/ZDC/ZdcRec/src/ZdcRec.cxx +++ b/ForwardDetectors/ZDC/ZdcRec/src/ZdcRec.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ /* @@ -153,7 +153,7 @@ StatusCode ZdcRec::execute() // SG has the ownership of m_rawCollection, and it should be copyed intead of just // being passed around. - for (iter=tmpCollection->begin();iter!=tmpCollection->end();iter++) { + for (iter=tmpCollection->begin();iter!=tmpCollection->end();++iter) { m_rawCollection->push_back(*iter); } diff --git a/ForwardDetectors/ZDC/ZdcRec/src/ZdcRecChannelTool.cxx b/ForwardDetectors/ZDC/ZdcRec/src/ZdcRecChannelTool.cxx index 6562974f444b61a848cc25c3e5f8b32ba7ad772d..0b2fbe8312e492cf0d6874db899bf3d944401ac5 100644 --- a/ForwardDetectors/ZDC/ZdcRec/src/ZdcRecChannelTool.cxx +++ b/ForwardDetectors/ZDC/ZdcRec/src/ZdcRecChannelTool.cxx @@ -134,8 +134,6 @@ StatusCode ZdcRecChannelTool::initialize() } m_zdcId = zdcId; - ZdcCablingService::getInstance()->setZdcID(m_zdcId); - msg(MSG::DEBUG) << "--> ZDC : END OF MODIFICATION 0" << endmsg ; return StatusCode::SUCCESS; } @@ -291,10 +289,10 @@ int ZdcRecChannelTool::makeRawFromDigits( //We need to be carefull. Sometimes the vector size here is zero (PPM flaw) and //the code crashs if we do not treat this. i = 0; - for (vit = wfm.begin(); vit<wfm.end(); vit++) { + for (vit = wfm.begin(); vit<wfm.end(); ++vit) { if (vit->size() == 0) vit->resize(7); ped = *vit->begin(); - for (it=vit->begin(); it<vit->end();it++) { + for (it=vit->begin(); it<vit->end();++it) { (*it) -= ped; //if ((i==1) || (i==3) ) (*it) = (*it) * s_GAIN_RATIO; } @@ -358,7 +356,7 @@ int ZdcRecChannelTool::makeRawFromDigits( /// Traditional code bellow (Energy by peak or sum, /// time by ratio of samples ////////////////////////////////////////////////// - for (vit = wfm.begin(); vit<wfm.end(); vit++) { + for (vit = wfm.begin(); vit<wfm.end(); ++vit) { v = *vit; soma = std::accumulate(v.begin(), v.end(), 0) ; pico = *(std::max_element(v.begin(),v.end()) ); @@ -402,7 +400,7 @@ int ZdcRecChannelTool::makeRawFromDigits( " m=" << m << " Time by CFD=" << tzc << " Peak at imax = " << imax << - " v[imax-1] = " << v[imax-1] << + " v[imax-1] = " << (imax > 0 ? v[imax-1] : 0) << " V[imax] = " << v[imax] << " Sample Ratio A1/A2=" << tsr << endmsg; k++; @@ -530,10 +528,10 @@ int ZdcRecChannelTool::getTimingCFD(const Identifier& id, const std::vector<std vf[i] = 0.; } - for (vit = wfm.begin(); vit<wfm.end(); vit++) { + for (vit = wfm.begin(); vit<wfm.end(); ++vit) { y = *vit; i = 4; - for (it=y.begin();it != y.end();it++) { + for (it=y.begin();it != y.end();++it) { v[i] = *it; i++; } @@ -681,7 +679,7 @@ int ZdcRecChannelTool::getTimingSinc(const Identifier& id, const std::vector<st << mType << ";" << mChannel << endmsg; - for (vvi_it = wfm.begin(); vvi_it<wfm.end(); vvi_it++) { + for (vvi_it = wfm.begin(); vvi_it<wfm.end(); ++vvi_it) { //FIXME: Change to the method of ID identification //if ((zId == 0xec000000) || (zId == 0xed000000) || // (zId == 0xec200000) || (zId == 0xed200000) || @@ -694,7 +692,7 @@ int ZdcRecChannelTool::getTimingSinc(const Identifier& id, const std::vector<st t = 0; //Fill the interpolated vector - for (vf_it = m_wfm_bwl.begin(); vf_it != m_wfm_bwl.end(); vf_it++ ) { + for (vf_it = m_wfm_bwl.begin(); vf_it != m_wfm_bwl.end(); ++vf_it ) { z = 0.; for (i=0;i<m_nsamples;i++) { x = (TMath::Pi() *(t*0.1 - i*25.))/25. ; @@ -819,7 +817,7 @@ int ZdcRecChannelTool::getTimingSinc2(const Identifier& id, const std::vector<st //from only a subset wfmIndex = 2; i = 0; - for (vit = wfm.begin(); vit<wfm.end(); vit++) { + for (vit = wfm.begin(); vit<wfm.end(); ++vit) { if ( (i < wfmIndex) && (mType == 0) ) { y = *vit; diff --git a/ForwardDetectors/ZDC/ZdcRec/src/ZdcRecChannelToolV2.cxx b/ForwardDetectors/ZDC/ZdcRec/src/ZdcRecChannelToolV2.cxx index 4753bff93338018bad8e0c5f516954046cf01f8f..4ce9f9be54448d9b170731283cad7e0f2f1db93c 100644 --- a/ForwardDetectors/ZDC/ZdcRec/src/ZdcRecChannelToolV2.cxx +++ b/ForwardDetectors/ZDC/ZdcRec/src/ZdcRecChannelToolV2.cxx @@ -93,8 +93,6 @@ StatusCode ZdcRecChannelToolV2::initialize() } m_zdcId = zdcId; - ZdcCablingService::getInstance()->setZdcID(m_zdcId); - msg(MSG::DEBUG) << "--> ZDC : END OF MODIFICATION 0" << endmsg ; return StatusCode::SUCCESS; @@ -121,17 +119,14 @@ int ZdcRecChannelToolV2::convertTT2ZM(const xAOD::TriggerTowerContainer* ttColle hashmapType digits_map; Identifier chan_id; - xAOD::TriggerTowerContainer::const_iterator tt_itr = ttCollection->begin(); - xAOD::TriggerTowerContainer::const_iterator tt_end = ttCollection->end(); - //std::cout << "Zdc TT's have " << ttCollection->size() << " towers" << std::endl; - for (;tt_itr != tt_end;tt_itr++) + for (const xAOD::TriggerTower* tt : *ttCollection) { - //std::cout << "ZdcTT coolId = " << (*tt_itr)->coolId() << std::endl; - //std::cout << ZdcToString(*(*tt_itr)) << std::endl; + //std::cout << "ZdcTT coolId = " << tt->coolId() << std::endl; + //std::cout << ZdcToString(*tt) << std::endl; - uint32_t coolId = (*tt_itr)->coolId(); + uint32_t coolId = tt->coolId(); uint32_t pin = (coolId>>8) & 0xf; uint32_t asic = coolId & 0xf; uint32_t slinkChannel = asic*16 + pin; @@ -175,10 +170,10 @@ int ZdcRecChannelToolV2::convertTT2ZM(const xAOD::TriggerTowerContainer* ttColle (*iter).second->setType(m_zdcId->type(chan_id)); (*iter).second->setChannel(m_zdcId->channel(chan_id)); //std::cout << "Trying to set element links of " << chan_id << std::dec << std::endl; - if (gain==0&&delay==0) (*iter).second->setTTg0d0Link( ElementLink<xAOD::TriggerTowerContainer_v2> ((*tt_itr),*ttCollection ) ); - if (gain==0&&delay==1) (*iter).second->setTTg0d1Link( ElementLink<xAOD::TriggerTowerContainer_v2> ((*tt_itr),*ttCollection ) ); - if (gain==1&&delay==0) (*iter).second->setTTg1d0Link( ElementLink<xAOD::TriggerTowerContainer_v2> ((*tt_itr),*ttCollection ) ); - if (gain==1&&delay==1) (*iter).second->setTTg1d1Link( ElementLink<xAOD::TriggerTowerContainer_v2> ((*tt_itr),*ttCollection ) ); + if (gain==0&&delay==0) (*iter).second->setTTg0d0Link( ElementLink<xAOD::TriggerTowerContainer_v2> (tt,*ttCollection ) ); + if (gain==0&&delay==1) (*iter).second->setTTg0d1Link( ElementLink<xAOD::TriggerTowerContainer_v2> (tt,*ttCollection ) ); + if (gain==1&&delay==0) (*iter).second->setTTg1d0Link( ElementLink<xAOD::TriggerTowerContainer_v2> (tt,*ttCollection ) ); + if (gain==1&&delay==1) (*iter).second->setTTg1d1Link( ElementLink<xAOD::TriggerTowerContainer_v2> (tt,*ttCollection ) ); } } @@ -190,7 +185,7 @@ int ZdcRecChannelToolV2::convertTT2ZM(const xAOD::TriggerTowerContainer* ttColle hashmapType::iterator iter = digits_map.begin(); hashmapType::iterator iter_end = digits_map.end(); - for (;iter != iter_end;iter++) + for (;iter != iter_end;++iter) { makeWaveformFromDigits( *((*iter).second) ); } @@ -347,7 +342,7 @@ int ZdcRecChannelToolV2::splitWaveform(std::map<int,float>& waveform, std::vecto adcs.clear(); std::map<int,float>::const_iterator wf_it = waveform.begin(); std::map<int,float>::const_iterator wf_end = waveform.end(); - for (;wf_it != wf_end;wf_it++) + for (;wf_it != wf_end;++wf_it) { //std::cout << iwf++ << "t=" << (*wf_it).first << " a=" << (*wf_it).second << std::endl; times.push_back((*wf_it).first / 10. ); // convert back to ns diff --git a/Generators/AtlasHepMC/AtlasHepMC/IO_GenEvent.h b/Generators/AtlasHepMC/AtlasHepMC/IO_GenEvent.h index c835adb2b578c432113887e3db28cb054f460cfa..04dd2c9f6b91111edaaa491f080268a419c50173 100644 --- a/Generators/AtlasHepMC/AtlasHepMC/IO_GenEvent.h +++ b/Generators/AtlasHepMC/AtlasHepMC/IO_GenEvent.h @@ -15,6 +15,27 @@ namespace HepMC { typedef HepMC3::WriterAsciiHepMC2 WriterAsciiHepMC2; typedef HepMC3::ReaderAsciiHepMC2 ReaderAsciiHepMC2; +class IO_GenEvent { +public: + IO_GenEvent( const std::string& filename="IO_GenEvent.dat", + std::ios::openmode mode=std::ios::out ) { + m_writer=new HepMC3::WriterAsciiHepMC2(filename); + } + IO_GenEvent( std::ostream & os ) { + m_writer=new HepMC3::WriterAsciiHepMC2(os); + } + ~IO_GenEvent() { + if(m_writer) { + m_writer->close(); + delete m_writer; + } + } + void write_event( const HepMC3::GenEvent* evt ) { + m_writer->write_event(*evt); + } +private: + HepMC3::WriterAsciiHepMC2 *m_writer; +}; } #else #include "HepMC/IO_GenEvent.h" diff --git a/Generators/AtlasHepMC/AtlasHepMC/IteratorRange.h b/Generators/AtlasHepMC/AtlasHepMC/IteratorRange.h index 4f8674320ca5ca3d45e9ffd9552d7586a6db30b9..98422d0a128ba000a75c8db78437f19e70d21374 100644 --- a/Generators/AtlasHepMC/AtlasHepMC/IteratorRange.h +++ b/Generators/AtlasHepMC/AtlasHepMC/IteratorRange.h @@ -5,5 +5,13 @@ #ifndef ATLASHEPMC_ITERATORRANGE_H #define ATLASHEPMC_ITERATORRANGE_H +#ifdef HEPMC3 +namespace HepMC { +enum IteratorRange { parents, children, family, + ancestors, descendants, relatives + }; +} +#else #include "HepMC/IteratorRange.h" #endif +#endif diff --git a/Generators/GeneratorObjects/GeneratorObjects/McEventCollection.h b/Generators/GeneratorObjects/GeneratorObjects/McEventCollection.h index bc193502de52e244820032c07b0588c7552e12f9..a96d9b1384827d8051d45bb112e2f895c5fd5bc3 100644 --- a/Generators/GeneratorObjects/GeneratorObjects/McEventCollection.h +++ b/Generators/GeneratorObjects/GeneratorObjects/McEventCollection.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ #ifndef GENERATOROBJECTSMCEVENTCOLLECTION_H @@ -62,10 +62,9 @@ inline McEventCollection& McEventCollection::operator=(const McEventCollection& { // Force a deep copy on the DataVector // - for (EventConstIterator iter = in.begin(); - iter != in.end(); iter++) + for (const HepMC::GenEvent* ev : in) { - DataVector<HepMC::GenEvent>::push_back(new HepMC::GenEvent(**iter)); + DataVector<HepMC::GenEvent>::push_back(new HepMC::GenEvent(*ev)); } return *this; diff --git a/Generators/GeneratorObjects/test/HepMcParticleLink_test.cxx b/Generators/GeneratorObjects/test/HepMcParticleLink_test.cxx index 65d4d97ca3814afc68c50550a8c963f6439b40e8..f865234c99c75749fc9424639c93b3bfe8e4dd53 100644 --- a/Generators/GeneratorObjects/test/HepMcParticleLink_test.cxx +++ b/Generators/GeneratorObjects/test/HepMcParticleLink_test.cxx @@ -23,6 +23,7 @@ ATLAS_NO_CHECK_FILE_THREAD_SAFETY; // HepMC includes #include "AtlasHepMC/GenEvent.h" +#include "AtlasHepMC/Operators.h" // CLHEP includes #include "CLHEP/Units/SystemOfUnits.h" @@ -33,17 +34,6 @@ ATLAS_NO_CHECK_FILE_THREAD_SAFETY; #include "GeneratorObjects/McEventCollection.h" #include "GeneratorObjects/HepMcParticleLink.h" -#ifdef HEPMC3 -// This suboptimal piece of code is here because the googletest is the worst testing suite ever. -namespace HepMC3 { -bool operator ==(const std::shared_ptr<HepMC3::GenParticle> a, const HepMC3::GenParticle* const b){return a.get()==b;} -bool operator ==(const std::shared_ptr<const HepMC3::GenParticle> a, const HepMC3::GenParticle* const b){return a.get()==b;} -bool operator ==(const HepMC3::GenParticle a, const HepMC3::GenParticle b) {return a.id()==b.id();} -bool operator !=(const std::shared_ptr<HepMC3::GenParticle> a, const HepMC3::GenParticle* const b){return a.get()!=b;} -bool operator !=(const std::shared_ptr<const HepMC3::GenParticle> a, const HepMC3::GenParticle* const b){return a.get()!=b;} -bool operator !=(const HepMC3::GenParticle a, const HepMC3::GenParticle b){return a.id()!=b.id();} -} -#endif namespace MCTesting { diff --git a/HLT/Trigger/TrigControl/TrigExamples/TrigExPartialEB/python/MTCalibPebConfig.py b/HLT/Trigger/TrigControl/TrigExamples/TrigExPartialEB/python/MTCalibPebConfig.py index 9a328f352eb55bde3d2767460c2dc15dc4f2d1cf..b2ba3f8023f3774f9e716fdde85a1ddc4fdb5c63 100644 --- a/HLT/Trigger/TrigControl/TrigExamples/TrigExPartialEB/python/MTCalibPebConfig.py +++ b/HLT/Trigger/TrigControl/TrigExamples/TrigExPartialEB/python/MTCalibPebConfig.py @@ -271,10 +271,10 @@ def configure_hlt_result(hypo_algs): # Give the menu json name to HLTConfigSvc from AthenaCommon.AppMgr import ServiceMgr as svcMgr - if not hasattr(svcMgr, 'HLTConfigSvc'): - from TrigConfigSvc.TrigConfigSvcConfig import HLTConfigSvc - svcMgr += HLTConfigSvc() - svcMgr.HLTConfigSvc.JsonFileName = menu_json + from TrigConfigSvc.TrigConfigSvcCfg import getHLTConfigSvc + hltConfigSvc = getHLTConfigSvc(ConfigFlags) + hltConfigSvc.JsonFileName = menu_json + svcMgr += hltConfigSvc # Tool adding stream tags to HLT result stmaker = StreamTagMakerToolCfg() diff --git a/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/CMakeLists.txt b/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/CMakeLists.txt index 3826852f22e49e9aacd3d343d97534930ee6e1cf..b4e35e65d4e96a4bd77f39796a63f7898303f223 100644 --- a/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/CMakeLists.txt +++ b/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/CMakeLists.txt @@ -14,7 +14,6 @@ atlas_depends_on_subdirs( InnerDetector/InDetRecEvent/InDetPrepRawData PRIVATE Database/AthenaPOOL/AthenaPoolUtilities - Database/CoralDB DetectorDescription/DetDescrCond/DetDescrConditions DetectorDescription/Identifier Event/EventInfo @@ -32,7 +31,6 @@ atlas_depends_on_subdirs( # External dependencies: find_package( CLHEP ) -find_package( CORAL COMPONENTS CoralBase ) find_package( ROOT COMPONENTS Graf Core Tree MathCore Hist RIO MathMore Physics Matrix Gpad ) @@ -41,57 +39,14 @@ atlas_add_library( PixelCalibAlgsLib PixelCalibAlgs/*.h src/*.cxx PUBLIC_HEADERS PixelCalibAlgs INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} ${CLHEP_INCLUDE_DIRS} - PRIVATE_INCLUDE_DIRS ${CORAL_INCLUDE_DIRS} DEFINITIONS ${CLHEP_DEFINITIONS} LINK_LIBRARIES ${ROOT_LIBRARIES} ${CLHEP_LIBRARIES} AthenaBaseComps CxxUtils GaudiKernel InDetPrepRawData InDetConditionsSummaryService PixelCablingLib - PRIVATE_LINK_LIBRARIES ${CORAL_LIBRARIES} AthenaPoolUtilities CoralDB + PRIVATE_LINK_LIBRARIES AthenaPoolUtilities DetDescrConditions Identifier EventInfo PixelConditionsData InDetIdentifier - InDetReadoutGeometry PixelReadoutGeometry InDetRawData PathResolver PixelGeoModelLib PixelConditionsToolsLib CoralDB ) + InDetReadoutGeometry PixelReadoutGeometry InDetRawData PathResolver PixelGeoModelLib PixelConditionsToolsLib ) atlas_add_component( PixelCalibAlgs src/components/*.cxx LINK_LIBRARIES GaudiKernel InDetByteStreamErrors PixelConditionsData PixelCalibAlgsLib ) -# Executables in the package: -atlas_add_executable( doPixelOfflineCalib - Application/doPixelOfflineCalib.cxx - LINK_LIBRARIES PixelCalibAlgsLib ) - -atlas_add_executable( doPixelOfflineCalibG4 - Application/doPixelOfflineCalibG4.cxx - LINK_LIBRARIES PixelCalibAlgsLib ) - -atlas_add_executable( PlotChargeSharingConstants - Application/PlotChargeSharingConstants.cxx - INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} - LINK_LIBRARIES ${ROOT_LIBRARIES} PixelConditionsData PixelCalibAlgsLib ) - -atlas_add_executable( PlotPixelClusterOnTrackErrors - Application/PlotPixelClusterOnTrackErrors.cxx - INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} - LINK_LIBRARIES ${ROOT_LIBRARIES} PixelConditionsData PixelCalibAlgsLib ) - -atlas_add_executable( updateNoiseMaps - Application/updateNoiseMaps.C - INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} - LINK_LIBRARIES ${ROOT_LIBRARIES} PixelConditionsData PixelCalibAlgsLib ) - -atlas_add_executable( updateDeadMaps - Application/updateDeadMaps.C - INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} - LINK_LIBRARIES ${ROOT_LIBRARIES} PixelConditionsData PixelCalibAlgsLib ) - -atlas_add_executable( createDeadModuleList - Application/createDeadModuleList.C - INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} - LINK_LIBRARIES ${ROOT_LIBRARIES} PixelConditionsData PixelCalibAlgsLib ) - -atlas_add_executable( hackNoiseMapsForStudyCP - Application/hackNoiseMapsForStudyCP.C - INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} - LINK_LIBRARIES ${ROOT_LIBRARIES} PixelConditionsData PixelCalibAlgsLib ) - -# Install files from the package: -atlas_install_joboptions( share/*.py ) -atlas_install_runtime( share/*.txt share/*.sh share/*.dat ) diff --git a/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/PixelCalibAlgs/ATLAS_CHECK_THREAD_SAFETY b/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/run2/PixelCalibAlgs/ATLAS_CHECK_THREAD_SAFETY similarity index 100% rename from InnerDetector/InDetCalibAlgs/PixelCalibAlgs/PixelCalibAlgs/ATLAS_CHECK_THREAD_SAFETY rename to InnerDetector/InDetCalibAlgs/PixelCalibAlgs/run2/PixelCalibAlgs/ATLAS_CHECK_THREAD_SAFETY diff --git a/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/PixelCalibAlgs/DepletionDepthCalibration.h b/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/run2/PixelCalibAlgs/DepletionDepthCalibration.h similarity index 100% rename from InnerDetector/InDetCalibAlgs/PixelCalibAlgs/PixelCalibAlgs/DepletionDepthCalibration.h rename to InnerDetector/InDetCalibAlgs/PixelCalibAlgs/run2/PixelCalibAlgs/DepletionDepthCalibration.h diff --git a/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/PixelCalibAlgs/LorentzAngleCalibration.h b/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/run2/PixelCalibAlgs/LorentzAngleCalibration.h similarity index 100% rename from InnerDetector/InDetCalibAlgs/PixelCalibAlgs/PixelCalibAlgs/LorentzAngleCalibration.h rename to InnerDetector/InDetCalibAlgs/PixelCalibAlgs/run2/PixelCalibAlgs/LorentzAngleCalibration.h diff --git a/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/PixelCalibAlgs/NoiseMapBuilder.h b/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/run2/PixelCalibAlgs/NoiseMapBuilder.h similarity index 100% rename from InnerDetector/InDetCalibAlgs/PixelCalibAlgs/PixelCalibAlgs/NoiseMapBuilder.h rename to InnerDetector/InDetCalibAlgs/PixelCalibAlgs/run2/PixelCalibAlgs/NoiseMapBuilder.h diff --git a/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/PixelCalibAlgs/OfflineCalibrationLoop.h b/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/run2/PixelCalibAlgs/OfflineCalibrationLoop.h similarity index 100% rename from InnerDetector/InDetCalibAlgs/PixelCalibAlgs/PixelCalibAlgs/OfflineCalibrationLoop.h rename to InnerDetector/InDetCalibAlgs/PixelCalibAlgs/run2/PixelCalibAlgs/OfflineCalibrationLoop.h diff --git a/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/PixelCalibAlgs/PixMapDBWriter.h b/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/run2/PixelCalibAlgs/PixMapDBWriter.h similarity index 100% rename from InnerDetector/InDetCalibAlgs/PixelCalibAlgs/PixelCalibAlgs/PixMapDBWriter.h rename to InnerDetector/InDetCalibAlgs/PixelCalibAlgs/run2/PixelCalibAlgs/PixMapDBWriter.h diff --git a/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/PixelCalibAlgs/PixMapOverlayWriter.h b/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/run2/PixelCalibAlgs/PixMapOverlayWriter.h similarity index 100% rename from InnerDetector/InDetCalibAlgs/PixelCalibAlgs/PixelCalibAlgs/PixMapOverlayWriter.h rename to InnerDetector/InDetCalibAlgs/PixelCalibAlgs/run2/PixelCalibAlgs/PixMapOverlayWriter.h diff --git a/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/PixelCalibAlgs/PixelBarrelSurvey.h b/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/run2/PixelCalibAlgs/PixelBarrelSurvey.h similarity index 100% rename from InnerDetector/InDetCalibAlgs/PixelCalibAlgs/PixelCalibAlgs/PixelBarrelSurvey.h rename to InnerDetector/InDetCalibAlgs/PixelCalibAlgs/run2/PixelCalibAlgs/PixelBarrelSurvey.h diff --git a/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/PixelCalibAlgs/PixelBarrelSurveyUtils.h b/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/run2/PixelCalibAlgs/PixelBarrelSurveyUtils.h similarity index 100% rename from InnerDetector/InDetCalibAlgs/PixelCalibAlgs/PixelCalibAlgs/PixelBarrelSurveyUtils.h rename to InnerDetector/InDetCalibAlgs/PixelCalibAlgs/run2/PixelCalibAlgs/PixelBarrelSurveyUtils.h diff --git a/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/PixelCalibAlgs/PixelClusterOnTrackErrorPlot.h b/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/run2/PixelCalibAlgs/PixelClusterOnTrackErrorPlot.h similarity index 100% rename from InnerDetector/InDetCalibAlgs/PixelCalibAlgs/PixelCalibAlgs/PixelClusterOnTrackErrorPlot.h rename to InnerDetector/InDetCalibAlgs/PixelCalibAlgs/run2/PixelCalibAlgs/PixelClusterOnTrackErrorPlot.h diff --git a/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/PixelCalibAlgs/PixelConvert.h b/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/run2/PixelCalibAlgs/PixelConvert.h similarity index 100% rename from InnerDetector/InDetCalibAlgs/PixelCalibAlgs/PixelCalibAlgs/PixelConvert.h rename to InnerDetector/InDetCalibAlgs/PixelCalibAlgs/run2/PixelCalibAlgs/PixelConvert.h diff --git a/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/PixelCalibAlgs/PixelRIOs.h b/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/run2/PixelCalibAlgs/PixelRIOs.h similarity index 100% rename from InnerDetector/InDetCalibAlgs/PixelCalibAlgs/PixelCalibAlgs/PixelRIOs.h rename to InnerDetector/InDetCalibAlgs/PixelCalibAlgs/run2/PixelCalibAlgs/PixelRIOs.h diff --git a/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/src/DepletionDepthCalibration.cxx b/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/run2/src/DepletionDepthCalibration.cxx similarity index 100% rename from InnerDetector/InDetCalibAlgs/PixelCalibAlgs/src/DepletionDepthCalibration.cxx rename to InnerDetector/InDetCalibAlgs/PixelCalibAlgs/run2/src/DepletionDepthCalibration.cxx diff --git a/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/src/LorentzAngleCalibration.cxx b/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/run2/src/LorentzAngleCalibration.cxx similarity index 100% rename from InnerDetector/InDetCalibAlgs/PixelCalibAlgs/src/LorentzAngleCalibration.cxx rename to InnerDetector/InDetCalibAlgs/PixelCalibAlgs/run2/src/LorentzAngleCalibration.cxx diff --git a/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/src/NoiseMapBuilder.cxx b/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/run2/src/NoiseMapBuilder.cxx similarity index 100% rename from InnerDetector/InDetCalibAlgs/PixelCalibAlgs/src/NoiseMapBuilder.cxx rename to InnerDetector/InDetCalibAlgs/PixelCalibAlgs/run2/src/NoiseMapBuilder.cxx diff --git a/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/src/OfflineCalibrationLoop.cxx b/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/run2/src/OfflineCalibrationLoop.cxx similarity index 100% rename from InnerDetector/InDetCalibAlgs/PixelCalibAlgs/src/OfflineCalibrationLoop.cxx rename to InnerDetector/InDetCalibAlgs/PixelCalibAlgs/run2/src/OfflineCalibrationLoop.cxx diff --git a/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/src/PixMapDBWriter.cxx b/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/run2/src/PixMapDBWriter.cxx similarity index 100% rename from InnerDetector/InDetCalibAlgs/PixelCalibAlgs/src/PixMapDBWriter.cxx rename to InnerDetector/InDetCalibAlgs/PixelCalibAlgs/run2/src/PixMapDBWriter.cxx diff --git a/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/src/PixMapOverlayWriter.cxx b/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/run2/src/PixMapOverlayWriter.cxx similarity index 100% rename from InnerDetector/InDetCalibAlgs/PixelCalibAlgs/src/PixMapOverlayWriter.cxx rename to InnerDetector/InDetCalibAlgs/PixelCalibAlgs/run2/src/PixMapOverlayWriter.cxx diff --git a/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/src/PixelBarrelSurvey.cxx b/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/run2/src/PixelBarrelSurvey.cxx similarity index 100% rename from InnerDetector/InDetCalibAlgs/PixelCalibAlgs/src/PixelBarrelSurvey.cxx rename to InnerDetector/InDetCalibAlgs/PixelCalibAlgs/run2/src/PixelBarrelSurvey.cxx diff --git a/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/src/PixelBarrelSurveyUtils.cxx b/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/run2/src/PixelBarrelSurveyUtils.cxx similarity index 100% rename from InnerDetector/InDetCalibAlgs/PixelCalibAlgs/src/PixelBarrelSurveyUtils.cxx rename to InnerDetector/InDetCalibAlgs/PixelCalibAlgs/run2/src/PixelBarrelSurveyUtils.cxx diff --git a/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/src/PixelClusterOnTrackErrorPlot.cxx b/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/run2/src/PixelClusterOnTrackErrorPlot.cxx similarity index 100% rename from InnerDetector/InDetCalibAlgs/PixelCalibAlgs/src/PixelClusterOnTrackErrorPlot.cxx rename to InnerDetector/InDetCalibAlgs/PixelCalibAlgs/run2/src/PixelClusterOnTrackErrorPlot.cxx diff --git a/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/src/PixelConvert.cxx b/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/run2/src/PixelConvert.cxx similarity index 100% rename from InnerDetector/InDetCalibAlgs/PixelCalibAlgs/src/PixelConvert.cxx rename to InnerDetector/InDetCalibAlgs/PixelCalibAlgs/run2/src/PixelConvert.cxx diff --git a/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/src/PixelRIOs.cxx b/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/run2/src/PixelRIOs.cxx similarity index 100% rename from InnerDetector/InDetCalibAlgs/PixelCalibAlgs/src/PixelRIOs.cxx rename to InnerDetector/InDetCalibAlgs/PixelCalibAlgs/run2/src/PixelRIOs.cxx diff --git a/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/share/NoiseMapBuilder.py b/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/share/NoiseMapBuilder.py index 67a11a30b79b11bdfad63f0e66fa9ce03a63e3fd..3575f64eed6186dc279bbc780602ef8a210ace9a 100755 --- a/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/share/NoiseMapBuilder.py +++ b/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/share/NoiseMapBuilder.py @@ -137,7 +137,6 @@ else : from PixelConditionsServices.PixelConditionsServicesConf import PixelConditionsSummarySvc ServiceMgr += PixelConditionsSummarySvc() -ServiceMgr.PixelConditionsSummarySvc.UseSpecialPixelMap = False ServiceMgr.PixelConditionsSummarySvc.UseDCS = False ServiceMgr.PixelConditionsSummarySvc.UseByteStream = True diff --git a/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/src/components/PixelCalibAlgs_entries.cxx b/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/src/components/PixelCalibAlgs_entries.cxx index bee47e765f6e7ff6b3561b38a46709cff651d47b..0c751525b68a4349ebfa0a5ed8e06b18e74d17fa 100644 --- a/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/src/components/PixelCalibAlgs_entries.cxx +++ b/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/src/components/PixelCalibAlgs_entries.cxx @@ -1,12 +1,4 @@ -#include "PixelCalibAlgs/PixelBarrelSurvey.h" -#include "PixelCalibAlgs/NoiseMapBuilder.h" -#include "PixelCalibAlgs/PixMapDBWriter.h" -#include "PixelCalibAlgs/PixMapOverlayWriter.h" #include "PixelCalibAlgs/PixelChargeToTConversion.h" -DECLARE_COMPONENT( PixelBarrelSurvey ) -DECLARE_COMPONENT( NoiseMapBuilder ) -DECLARE_COMPONENT( PixMapDBWriter ) -DECLARE_COMPONENT( PixMapOverlayWriter ) DECLARE_COMPONENT( PixelChargeToTConversion ) diff --git a/InnerDetector/InDetConditions/PixelConditionsAlgorithms/CMakeLists.txt b/InnerDetector/InDetConditions/PixelConditionsAlgorithms/CMakeLists.txt index 3b8fbef05ef5728cbe397e9b17ce05b02a59c098..ee236f632a43cbd78faaa6ddb2005d4fe184f9f3 100644 --- a/InnerDetector/InDetConditions/PixelConditionsAlgorithms/CMakeLists.txt +++ b/InnerDetector/InDetConditions/PixelConditionsAlgorithms/CMakeLists.txt @@ -8,8 +8,6 @@ atlas_subdir( PixelConditionsAlgorithms ) # External dependencies: find_package( CLHEP ) find_package( COOL COMPONENTS CoolKernel ) -find_package( CORAL COMPONENTS CoralBase ) -find_package( ROOT COMPONENTS Core Hist RIO ) # Component(s) in the package: atlas_add_library( PixelConditionsAlgorithmsLib @@ -21,11 +19,9 @@ atlas_add_library( PixelConditionsAlgorithmsLib atlas_add_component( PixelConditionsAlgorithms src/*.h src/*.cxx src/components/*.cxx - INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} ${CORAL_INCLUDE_DIRS} ${COOL_INCLUDE_DIRS} ${CLHEP_INCLUDE_DIRS} - LINK_LIBRARIES ${ROOT_LIBRARIES} ${CORAL_LIBRARIES} ${COOL_LIBRARIES} - ${CLHEP_LIBRARIES} CommissionEvent AthenaBaseComps AthenaKernel AthenaPoolUtilities - GaudiKernel PixelConditionsData SGTools StoreGateLib CoralDB + LINK_LIBRARIES ${COOL_LIBRARIES} ${CLHEP_LIBRARIES} CommissionEvent AthenaBaseComps AthenaKernel AthenaPoolUtilities + GaudiKernel PixelConditionsData SGTools StoreGateLib GeoModelUtilities Identifier InDetIdentifier InDetReadoutGeometry PixelReadoutGeometry PixelCablingLib PixelConditionsAlgorithmsLib PathResolver ) diff --git a/InnerDetector/InDetConditions/PixelConditionsAlgorithms/python/PixelConditionsConfig.py b/InnerDetector/InDetConditions/PixelConditionsAlgorithms/python/PixelConditionsConfig.py index 109daec3555fd57261b4ced2fa3e05b14ec2e0d3..a335d30072ac3ddd8b22690ba88e4469d36bd031 100644 --- a/InnerDetector/InDetConditions/PixelConditionsAlgorithms/python/PixelConditionsConfig.py +++ b/InnerDetector/InDetConditions/PixelConditionsAlgorithms/python/PixelConditionsConfig.py @@ -16,16 +16,6 @@ def PixelConfigCondAlgCfg(flags, name="PixelConfigCondAlg", **kwargs): # FIXME commented properties are not currently accepted by PixelConfigCondAlg CondArgs = {} - # Switch parameters - CondArgs.update( - UseCalibConditions=True, - UseDeadmapConditions=True, - UseDCSStateConditions=(not flags.Input.isMC and flags.InDet.usePixelDCS), - UseDCSStatusConditions=(not flags.Input.isMC and flags.InDet.usePixelDCS), - UseDCSHVConditions=True, - UseDCSTemperatureConditions=True, - UseTDAQConditions=False, - ) if flags.Beam.Type == "cosmics": CondArgs.update( UseComTime=True, @@ -375,8 +365,6 @@ def PixelDCSCondHVAlgCfg(flags, name="PixelDCSCondHVAlg", **kwargs): acc.merge(addFolders(flags, "/PIXEL/HLT/DCS/HV", "PIXEL_ONL", className="CondAttrListCollection")) else: acc.merge(addFolders(flags, "/PIXEL/DCS/HV", "DCS_OFL", className="CondAttrListCollection")) - kwargs.setdefault("PixelModuleData", "PixelModuleData") - kwargs.setdefault("ReadKey", "/PIXEL/DCS/HV") kwargs.setdefault("WriteKey", "PixelDCSHVCondData") acc.addCondAlgo(CompFactory.PixelDCSCondHVAlg(name, **kwargs)) return acc @@ -389,7 +377,6 @@ def PixelDCSCondStateAlgCfg(flags, name="PixelDCSCondStateAlg", **kwargs): kwargs.setdefault("ReadKeyState", "/PIXEL/DCS/FSMSTATE") else: kwargs.setdefault("ReadKeyState", "") - kwargs.setdefault("PixelModuleData", "PixelModuleData") kwargs.setdefault("WriteKeyState", "PixelDCSStateCondData") acc.addCondAlgo(CompFactory.PixelDCSCondStateAlg(name, **kwargs)) return acc @@ -402,7 +389,6 @@ def PixelDCSCondStatusAlgCfg(flags, name="PixelDCSCondStatusAlg", **kwargs): kwargs.setdefault("ReadKeyStatus", "/PIXEL/DCS/FSMSTATUS") else: kwargs.setdefault("ReadKeyStatus", "") - kwargs.setdefault("PixelModuleData", "PixelModuleData") kwargs.setdefault("WriteKeyStatus", "PixelDCSStatusCondData") acc.addCondAlgo(CompFactory.PixelDCSCondStatusAlg(name, **kwargs)) return acc diff --git a/InnerDetector/InDetConditions/PixelConditionsAlgorithms/src/PixelChargeCalibCondAlg.cxx b/InnerDetector/InDetConditions/PixelConditionsAlgorithms/src/PixelChargeCalibCondAlg.cxx index 5c98e6946f4cbdc68dbe8000e27a86c4a7e68afa..40513629ff8ad1705c7f4a9f96b0d72cae30414c 100644 --- a/InnerDetector/InDetConditions/PixelConditionsAlgorithms/src/PixelChargeCalibCondAlg.cxx +++ b/InnerDetector/InDetConditions/PixelConditionsAlgorithms/src/PixelChargeCalibCondAlg.cxx @@ -22,7 +22,7 @@ StatusCode PixelChargeCalibCondAlg::initialize() { ATH_CHECK(m_pixelDetEleCollKey.initialize()); ATH_CHECK(m_condSvc.retrieve()); ATH_CHECK(m_configKey.initialize()); - ATH_CHECK(m_readKey.initialize()); + ATH_CHECK(m_readKey.initialize(SG::AllowEmpty)); ATH_CHECK(m_writeKey.initialize()); if (m_condSvc->regHandle(this,m_writeKey).isFailure()) { ATH_MSG_FATAL("unable to register WriteCondHandle " << m_writeKey.fullKey() << " with CondSvc"); @@ -56,7 +56,7 @@ StatusCode PixelChargeCalibCondAlg::execute(const EventContext& ctx) const { const EventIDBase stop {EventIDBase::UNDEFNUM, EventIDBase::UNDEFEVT, EventIDBase::UNDEFNUM-1, EventIDBase::UNDEFNUM-1, EventIDBase::UNDEFNUM, EventIDBase::UNDEFNUM}; EventIDRange rangeW{start, stop}; - if (configData->getUseCalibConditions()) { + if (!m_readKey.empty()) { SG::ReadCondHandle<CondAttrListCollection> readHandle(m_readKey, ctx); const CondAttrListCollection* readCdo = *readHandle; if (readCdo==nullptr) { diff --git a/InnerDetector/InDetConditions/PixelConditionsAlgorithms/src/PixelChargeLUTCalibCondAlg.cxx b/InnerDetector/InDetConditions/PixelConditionsAlgorithms/src/PixelChargeLUTCalibCondAlg.cxx index 62ae68d35b07692ba15058850ff6ba606fb55145..5d03579142f4a40f504b861b0d7df4718dfefb37 100644 --- a/InnerDetector/InDetConditions/PixelConditionsAlgorithms/src/PixelChargeLUTCalibCondAlg.cxx +++ b/InnerDetector/InDetConditions/PixelConditionsAlgorithms/src/PixelChargeLUTCalibCondAlg.cxx @@ -22,7 +22,7 @@ StatusCode PixelChargeLUTCalibCondAlg::initialize() { ATH_CHECK(m_pixelDetEleCollKey.initialize()); ATH_CHECK(m_condSvc.retrieve()); ATH_CHECK(m_configKey.initialize()); - ATH_CHECK(m_readKey.initialize()); + ATH_CHECK(m_readKey.initialize(SG::AllowEmpty)); ATH_CHECK(m_writeKey.initialize()); if (m_condSvc->regHandle(this,m_writeKey).isFailure()) { ATH_MSG_FATAL("unable to register WriteCondHandle " << m_writeKey.fullKey() << " with CondSvc"); @@ -56,7 +56,7 @@ StatusCode PixelChargeLUTCalibCondAlg::execute(const EventContext& ctx) const { const EventIDBase stop {EventIDBase::UNDEFNUM, EventIDBase::UNDEFEVT, EventIDBase::UNDEFNUM-1, EventIDBase::UNDEFNUM-1, EventIDBase::UNDEFNUM, EventIDBase::UNDEFNUM}; EventIDRange rangeW{start, stop}; - if (configData->getUseCalibConditions()) { + if (!m_readKey.empty()) { SG::ReadCondHandle<CondAttrListCollection> readHandle(m_readKey, ctx); const CondAttrListCollection* readCdo = *readHandle; if (readCdo==nullptr) { diff --git a/InnerDetector/InDetConditions/PixelConditionsAlgorithms/src/PixelConfigCondAlg.cxx b/InnerDetector/InDetConditions/PixelConditionsAlgorithms/src/PixelConfigCondAlg.cxx index b6fbbaa61fb03650bcc54e9909535dc685484dcf..8a098f76b9964b05c0258f2ab7b91a61d630967a 100644 --- a/InnerDetector/InDetConditions/PixelConditionsAlgorithms/src/PixelConfigCondAlg.cxx +++ b/InnerDetector/InDetConditions/PixelConditionsAlgorithms/src/PixelConfigCondAlg.cxx @@ -29,9 +29,7 @@ StatusCode PixelConfigCondAlg::initialize() { } ATH_CHECK(m_condSvc.retrieve()); - - if (m_useDeadmapConditions) { ATH_CHECK(m_readDeadMapKey.initialize()); } - + ATH_CHECK(m_readDeadMapKey.initialize(SG::AllowEmpty)); ATH_CHECK(m_writeKey.initialize()); if (m_condSvc->regHandle(this,m_writeKey).isFailure()) { ATH_MSG_FATAL("unable to register WriteCondHandle " << m_writeKey.fullKey() << " with CondSvc"); @@ -62,7 +60,7 @@ StatusCode PixelConfigCondAlg::execute(const EventContext& ctx) const { // Set dead map //============== EventIDRange rangeDeadMap{start, stop}; - if (m_useDeadmapConditions) { + if (!m_readDeadMapKey.empty()) { SG::ReadCondHandle<CondAttrListCollection> readHandle(m_readDeadMapKey, ctx); const CondAttrListCollection* readCdo = *readHandle; if (readCdo==nullptr) { @@ -111,13 +109,6 @@ StatusCode PixelConfigCondAlg::execute(const EventContext& ctx) const { } // Switch parameters - writeCdo -> setUseCalibConditions(m_useCalibConditions); - writeCdo -> setUseDeadmapConditions(m_useDeadmapConditions); - writeCdo -> setUseDCSStateConditions(m_useDCSStateConditions); - writeCdo -> setUseDCSStatusConditions(m_useDCSStatusConditions); - writeCdo -> setUseDCSHVConditions(m_useDCSHVConditions); - writeCdo -> setUseDCSTemperatureConditions(m_useDCSTemperatureConditions); - writeCdo -> setUseTDAQConditions(m_useTDAQConditions); writeCdo -> setUseCablingConditions(m_useCablingConditions); // Digitization parameters diff --git a/InnerDetector/InDetConditions/PixelConditionsAlgorithms/src/PixelConfigCondAlg.h b/InnerDetector/InDetConditions/PixelConditionsAlgorithms/src/PixelConfigCondAlg.h index 597e8a2bf12a15e993371f7dd238d520e04e0f69..5852fd614ed7d53074e83f970a90e938309337f9 100644 --- a/InnerDetector/InDetConditions/PixelConditionsAlgorithms/src/PixelConfigCondAlg.h +++ b/InnerDetector/InDetConditions/PixelConditionsAlgorithms/src/PixelConfigCondAlg.h @@ -37,27 +37,6 @@ class PixelConfigCondAlg : public AthReentrantAlgorithm { {this, "WriteKey", "PixelModuleData", "Output key of pixel module data"}; // Switch parameters - Gaudi::Property<bool> m_useCalibConditions - {this, "UseCalibConditions", true, "Use conditions DB for charge calibration"}; - - Gaudi::Property<bool> m_useDeadmapConditions - {this, "UseDeadmapConditions", true, "Use conditions DB for pixel deadmap module/FE"}; - - Gaudi::Property<bool> m_useDCSStateConditions - {this, "UseDCSStateConditions", false, "Use DCSState conditions DB"}; - - Gaudi::Property<bool> m_useDCSStatusConditions - {this, "UseDCSStatusConditions", false, "Use DCSStatus conditions DB"}; - - Gaudi::Property<bool> m_useDCSHVConditions - {this, "UseDCSHVConditions", true, "Use DCS HV conditions DB"}; - - Gaudi::Property<bool> m_useDCSTemperatureConditions - {this, "UseDCSTemperatureConditions", true, "Use DCS temperature conditions DB"}; - - Gaudi::Property<bool> m_useTDAQConditions - {this, "UseTDAQConditions", false, "Use TDAQ conditions DB (NOTE only valid in RUN-1)"}; - Gaudi::Property<bool> m_useCablingConditions {this, "UseCablingConditions", true, "Use cabling map conditions DB"}; diff --git a/InnerDetector/InDetConditions/PixelConditionsAlgorithms/src/PixelDCSCondHVAlg.cxx b/InnerDetector/InDetConditions/PixelConditionsAlgorithms/src/PixelDCSCondHVAlg.cxx index 1dc57b344ff99455f2e23287a2a1c358df40cf58..a331b71c5ad8602a286aa925923937ac450fd633 100644 --- a/InnerDetector/InDetConditions/PixelConditionsAlgorithms/src/PixelDCSCondHVAlg.cxx +++ b/InnerDetector/InDetConditions/PixelConditionsAlgorithms/src/PixelDCSCondHVAlg.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ #include "PixelDCSCondHVAlg.h" @@ -18,7 +18,7 @@ StatusCode PixelDCSCondHVAlg::initialize() { ATH_CHECK(m_condSvc.retrieve()); ATH_CHECK(m_moduleDataKey.initialize()); - ATH_CHECK(m_readKey.initialize()); + ATH_CHECK(m_readKey.initialize(SG::AllowEmpty)); ATH_CHECK(m_writeKey.initialize()); if (m_condSvc->regHandle(this,m_writeKey).isFailure()) { ATH_MSG_FATAL("unable to register WriteCondHandle " << m_writeKey.fullKey() << " with CondSvc"); @@ -35,28 +35,33 @@ StatusCode PixelDCSCondHVAlg::execute(const EventContext& ctx) const { ATH_MSG_DEBUG("CondHandle " << writeHandle.fullKey() << " is already valid.. In theory this should not be called, but may happen if multiple concurrent events are being processed out of order."); return StatusCode::SUCCESS; } - - SG::ReadCondHandle<PixelModuleData> modDataHdl(m_moduleDataKey,ctx); const PixelModuleData* modData=(*modDataHdl); - writeHandle.addDependency(modDataHdl); ATH_MSG_INFO("Range of input PixelModule data is " << modDataHdl.getRange()); // Construct the output Cond Object and fill it in std::unique_ptr<PixelDCSHVData> writeCdo(std::make_unique<PixelDCSHVData>()); - //if (SG::ReadCondHandle<PixelModuleData>(m_moduleDataKey,ctx)->getUseDCSHVConditions()) { - if (modData->getUseDCSHVConditions()) { + const EventIDBase start{EventIDBase::UNDEFNUM, EventIDBase::UNDEFEVT, 0, 0, EventIDBase::UNDEFNUM, EventIDBase::UNDEFNUM}; + const EventIDBase stop {EventIDBase::UNDEFNUM, EventIDBase::UNDEFEVT, EventIDBase::UNDEFNUM-1, EventIDBase::UNDEFNUM-1, EventIDBase::UNDEFNUM, EventIDBase::UNDEFNUM}; + + EventIDRange rangeW{start, stop}; + + if (!m_readKey.empty()) { SG::ReadCondHandle<CondAttrListCollection> readHandle(m_readKey, ctx); - writeHandle.addDependency(readHandle); const CondAttrListCollection* readCdo = *readHandle; if (readCdo==nullptr) { ATH_MSG_FATAL("Null pointer to the read conditions object"); return StatusCode::FAILURE; } + // Get the validitiy range + if (not readHandle.range(rangeW)) { + ATH_MSG_FATAL("Failed to retrieve validity range for " << readHandle.key()); + return StatusCode::FAILURE; + } ATH_MSG_INFO("Size of CondAttrListCollection " << readHandle.fullKey() << " readCdo->size()= " << readCdo->size()); - ATH_MSG_INFO("Range of DCS input is " << readHandle.getRange()); + ATH_MSG_INFO("Range of DCS input is " << rangeW); // Read HV info std::string param("HV"); @@ -84,7 +89,7 @@ StatusCode PixelDCSCondHVAlg::execute(const EventContext& ctx) const { } } - if (writeHandle.record(std::move(writeCdo)).isFailure()) { + if (writeHandle.record(rangeW, std::move(writeCdo)).isFailure()) { ATH_MSG_FATAL("Could not record PixelDCSHVData " << writeHandle.key() << " with EventRange " << writeHandle.getRange() << " into Conditions Store"); return StatusCode::FAILURE; diff --git a/InnerDetector/InDetConditions/PixelConditionsAlgorithms/src/PixelDCSCondStateAlg.cxx b/InnerDetector/InDetConditions/PixelConditionsAlgorithms/src/PixelDCSCondStateAlg.cxx index 4d904b38231e919645a42f5ec3bd67a60782c63f..bd17f3802aaea299d34c62d5d15f9030e76813e6 100644 --- a/InnerDetector/InDetConditions/PixelConditionsAlgorithms/src/PixelDCSCondStateAlg.cxx +++ b/InnerDetector/InDetConditions/PixelConditionsAlgorithms/src/PixelDCSCondStateAlg.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ #include "PixelDCSCondStateAlg.h" @@ -17,9 +17,7 @@ StatusCode PixelDCSCondStateAlg::initialize() { ATH_CHECK(detStore()->retrieve(m_pixelID,"PixelID")); ATH_CHECK(m_condSvc.retrieve()); - - ATH_CHECK(m_moduleDataKey.initialize()); - ATH_CHECK(m_readKeyState.initialize(!m_readKeyState.empty())); + ATH_CHECK(m_readKeyState.initialize(SG::AllowEmpty)); ATH_CHECK(m_writeKeyState.initialize()); if (m_condSvc->regHandle(this, m_writeKeyState).isFailure()) { ATH_MSG_FATAL("unable to register WriteCondHandle " << m_writeKeyState.fullKey() << " with CondSvc"); @@ -40,24 +38,26 @@ StatusCode PixelDCSCondStateAlg::execute(const EventContext& ctx) const { // Construct the output Cond Object and fill it in std::unique_ptr<PixelDCSStateData> writeCdoState(std::make_unique<PixelDCSStateData>()); - - - SG::ReadCondHandle<PixelModuleData> modDataHdl(m_moduleDataKey,ctx); - const PixelModuleData* modData=(*modDataHdl); - writeHandleState.addDependency(modDataHdl); - ATH_MSG_INFO("Range of input PixelModule data is " << modDataHdl.getRange()); + const EventIDBase start{EventIDBase::UNDEFNUM, EventIDBase::UNDEFEVT, 0, 0, EventIDBase::UNDEFNUM, EventIDBase::UNDEFNUM}; + const EventIDBase stop {EventIDBase::UNDEFNUM, EventIDBase::UNDEFEVT, EventIDBase::UNDEFNUM-1, EventIDBase::UNDEFNUM-1, EventIDBase::UNDEFNUM, EventIDBase::UNDEFNUM}; - if (modData->getUseDCSStateConditions()) { - SG::ReadCondHandle<CondAttrListCollection> readHandleState(m_readKeyState, ctx); - writeHandleState.addDependency(readHandleState); - const CondAttrListCollection* readCdoState(*readHandleState); + EventIDRange rangeW{start, stop}; + + if (!m_readKeyState.empty()) { + SG::ReadCondHandle<CondAttrListCollection> readHandle(m_readKeyState, ctx); + const CondAttrListCollection* readCdoState(*readHandle); if (readCdoState==nullptr) { ATH_MSG_FATAL("Null pointer to the read conditions object (state)"); return StatusCode::FAILURE; } - ATH_MSG_INFO("Size of CondAttrListCollection " << readHandleState.fullKey() << " readCdo->size()= " << readCdoState->size()); - ATH_MSG_INFO("Range of state input is " << readHandleState.getRange()); + // Get the validitiy range + if (not readHandle.range(rangeW)) { + ATH_MSG_FATAL("Failed to retrieve validity range for " << readHandle.key()); + return StatusCode::FAILURE; + } + ATH_MSG_INFO("Size of CondAttrListCollection " << readHandle.fullKey() << " readCdo->size()= " << readCdoState->size()); + ATH_MSG_INFO("Range of state input is " << rangeW); // Read state info std::string paramState = "FSM_state"; @@ -82,7 +82,7 @@ StatusCode PixelDCSCondStateAlg::execute(const EventContext& ctx) const { for (int i=0; i<(int)m_pixelID->wafer_hash_max(); i++) { writeCdoState->setModuleStatus(i,PixelDCSStateData::DCSModuleState::READY); } } - if (writeHandleState.record(std::move(writeCdoState)).isFailure()) { + if (writeHandleState.record(rangeW, std::move(writeCdoState)).isFailure()) { ATH_MSG_FATAL("Could not record PixelDCSStateData " << writeHandleState.key() << " with EventRange " << writeHandleState.getRange() << " into Conditions Store"); return StatusCode::FAILURE; } diff --git a/InnerDetector/InDetConditions/PixelConditionsAlgorithms/src/PixelDCSCondStateAlg.h b/InnerDetector/InDetConditions/PixelConditionsAlgorithms/src/PixelDCSCondStateAlg.h index 6555a6287cab7385a6ef9ff49273eca41e5bc8fd..56b2658eef3a103cb8053b8dba7c1d8887d7a91b 100644 --- a/InnerDetector/InDetConditions/PixelConditionsAlgorithms/src/PixelDCSCondStateAlg.h +++ b/InnerDetector/InDetConditions/PixelConditionsAlgorithms/src/PixelDCSCondStateAlg.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ /** * @file PixelConditionsAlgorithms/PixelDCSCondStatusAlg.h @@ -17,7 +17,6 @@ #include "AthenaPoolUtilities/CondAttrListCollection.h" #include "StoreGate/WriteCondHandleKey.h" -#include "PixelConditionsData/PixelModuleData.h" #include "PixelConditionsData/PixelDCSStateData.h" #include "InDetIdentifier/PixelID.h" @@ -38,11 +37,8 @@ class PixelDCSCondStateAlg : public AthReentrantAlgorithm { ServiceHandle<ICondSvc> m_condSvc{this, "CondSvc", "CondSvc"}; - SG::ReadCondHandleKey<PixelModuleData> m_moduleDataKey - {this, "PixelModuleData", "PixelModuleData", "Pixel module data"}; - SG::ReadCondHandleKey<CondAttrListCollection> m_readKeyState - {this, "ReadKeyState", "/PIXEL/DCS/FSMSTATE", "Key of input DCS state conditions folder"}; + {this, "ReadKeyState", "", "Key of input DCS state conditions folder"}; SG::WriteCondHandleKey<PixelDCSStateData> m_writeKeyState {this, "WriteKeyState", "PixelDCSStateCondData", "Key of output DCS state data"}; diff --git a/InnerDetector/InDetConditions/PixelConditionsAlgorithms/src/PixelDCSCondStatusAlg.cxx b/InnerDetector/InDetConditions/PixelConditionsAlgorithms/src/PixelDCSCondStatusAlg.cxx index a6b31994a949c8ff750fab2a497a277003ca5ed2..7ea2c9581678e184ce625ad757becb3f3a839156 100644 --- a/InnerDetector/InDetConditions/PixelConditionsAlgorithms/src/PixelDCSCondStatusAlg.cxx +++ b/InnerDetector/InDetConditions/PixelConditionsAlgorithms/src/PixelDCSCondStatusAlg.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ #include "PixelDCSCondStatusAlg.h" @@ -17,15 +17,12 @@ StatusCode PixelDCSCondStatusAlg::initialize() { ATH_CHECK(detStore()->retrieve(m_pixelID,"PixelID")); ATH_CHECK(m_condSvc.retrieve()); - - ATH_CHECK(m_moduleDataKey.initialize()); - ATH_CHECK(m_readKeyStatus.initialize(!m_readKeyStatus.empty())); + ATH_CHECK(m_readKeyStatus.initialize(SG::AllowEmpty)); ATH_CHECK(m_writeKeyStatus.initialize()); if (m_condSvc->regHandle(this, m_writeKeyStatus).isFailure()) { ATH_MSG_FATAL("unable to register WriteCondHandle " << m_writeKeyStatus.fullKey() << " with CondSvc"); return StatusCode::FAILURE; } - return StatusCode::SUCCESS; } @@ -41,23 +38,25 @@ StatusCode PixelDCSCondStatusAlg::execute(const EventContext& ctx) const { // Construct the output Cond Object and fill it in std::unique_ptr<PixelDCSStatusData> writeCdoStatus(std::make_unique<PixelDCSStatusData>()); - - SG::ReadCondHandle<PixelModuleData> modDataHdl(m_moduleDataKey,ctx); - const PixelModuleData* modData=(*modDataHdl); - writeHandleStatus.addDependency(modDataHdl); - ATH_MSG_INFO("Range of input PixelModule data is " << modDataHdl.getRange()); - + const EventIDBase start{EventIDBase::UNDEFNUM, EventIDBase::UNDEFEVT, 0, 0, EventIDBase::UNDEFNUM, EventIDBase::UNDEFNUM}; + const EventIDBase stop {EventIDBase::UNDEFNUM, EventIDBase::UNDEFEVT, EventIDBase::UNDEFNUM-1, EventIDBase::UNDEFNUM-1, EventIDBase::UNDEFNUM, EventIDBase::UNDEFNUM}; + + EventIDRange rangeW{start, stop}; - if (modData->getUseDCSStatusConditions()) { - SG::ReadCondHandle<CondAttrListCollection> readHandleStatus(m_readKeyStatus, ctx); - const CondAttrListCollection* readCdoStatus(*readHandleStatus); + if (!m_readKeyStatus.empty()) { + SG::ReadCondHandle<CondAttrListCollection> readHandle(m_readKeyStatus, ctx); + const CondAttrListCollection* readCdoStatus(*readHandle); if (readCdoStatus==nullptr) { ATH_MSG_FATAL("Null pointer to the read conditions object (state)"); return StatusCode::FAILURE; } - writeHandleStatus.addDependency(readHandleStatus); - ATH_MSG_INFO("Size of CondAttrListCollection " << readHandleStatus.fullKey() << " readCdo->size()= " << readCdoStatus->size()); - ATH_MSG_INFO("Range of state input is " << readHandleStatus.getRange()); + // Get the validitiy range + if (not readHandle.range(rangeW)) { + ATH_MSG_FATAL("Failed to retrieve validity range for " << readHandle.key()); + return StatusCode::FAILURE; + } + ATH_MSG_INFO("Size of CondAttrListCollection " << readHandle.fullKey() << " readCdo->size()= " << readCdoStatus->size()); + ATH_MSG_INFO("Range of state input is " << rangeW); // Read state info const std::string paramStatus = "FSM_status"; @@ -83,7 +82,7 @@ StatusCode PixelDCSCondStatusAlg::execute(const EventContext& ctx) const { } } - if (writeHandleStatus.record(std::move(writeCdoStatus)).isFailure()) { + if (writeHandleStatus.record(rangeW, std::move(writeCdoStatus)).isFailure()) { ATH_MSG_FATAL("Could not record PixelDCSStatusData " << writeHandleStatus.key() << " with EventRange " << writeHandleStatus.getRange() << " into Conditions Store"); return StatusCode::FAILURE; diff --git a/InnerDetector/InDetConditions/PixelConditionsAlgorithms/src/PixelDCSCondStatusAlg.h b/InnerDetector/InDetConditions/PixelConditionsAlgorithms/src/PixelDCSCondStatusAlg.h index c50e26c24fc62292e613856621f833ff297eaf21..e28c76bf19badcc4263d501a5757e58aa32a8aa1 100644 --- a/InnerDetector/InDetConditions/PixelConditionsAlgorithms/src/PixelDCSCondStatusAlg.h +++ b/InnerDetector/InDetConditions/PixelConditionsAlgorithms/src/PixelDCSCondStatusAlg.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ /** * @file PixelConditionsAlgorithms/PixelDCSCondStatusAlg.h @@ -17,7 +17,6 @@ #include "AthenaPoolUtilities/CondAttrListCollection.h" #include "StoreGate/WriteCondHandleKey.h" -#include "PixelConditionsData/PixelModuleData.h" #include "PixelConditionsData/PixelDCSStatusData.h" #include "InDetIdentifier/PixelID.h" @@ -38,11 +37,8 @@ class PixelDCSCondStatusAlg : public AthReentrantAlgorithm { ServiceHandle<ICondSvc> m_condSvc{this, "CondSvc", "CondSvc"}; - SG::ReadCondHandleKey<PixelModuleData> m_moduleDataKey - {this, "PixelModuleData", "PixelModuleData", "Pixel module data"}; - SG::ReadCondHandleKey<CondAttrListCollection> m_readKeyStatus - {this, "ReadKeyStatus", "/PIXEL/DCS/FSMSTATUS", "Key of input DCS status conditions folder"}; + {this, "ReadKeyStatus", "", "Key of input DCS status conditions folder"}; SG::WriteCondHandleKey<PixelDCSStatusData> m_writeKeyStatus {this, "WriteKeyStatus", "PixelDCSStatusCondData", "Key of output DCS status data"}; diff --git a/InnerDetector/InDetConditions/PixelConditionsAlgorithms/src/PixelDCSCondTempAlg.cxx b/InnerDetector/InDetConditions/PixelConditionsAlgorithms/src/PixelDCSCondTempAlg.cxx index f8a6f8447e5f6006a420037de9184870df3511f9..ffc6988e44bc029a7ea5402510b46375564d544e 100644 --- a/InnerDetector/InDetConditions/PixelConditionsAlgorithms/src/PixelDCSCondTempAlg.cxx +++ b/InnerDetector/InDetConditions/PixelConditionsAlgorithms/src/PixelDCSCondTempAlg.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ #include "PixelDCSCondTempAlg.h" @@ -20,7 +20,7 @@ StatusCode PixelDCSCondTempAlg::initialize() { ATH_CHECK(m_condSvc.retrieve()); ATH_CHECK(m_moduleDataKey.initialize()); - ATH_CHECK(m_readKey.initialize()); + ATH_CHECK(m_readKey.initialize(SG::AllowEmpty)); ATH_CHECK(m_writeKey.initialize()); if (m_condSvc->regHandle(this, m_writeKey).isFailure()) { ATH_MSG_FATAL("unable to register WriteCondHandle " << m_writeKey.fullKey() << " with CondSvc"); @@ -44,19 +44,27 @@ StatusCode PixelDCSCondTempAlg::execute(const EventContext& ctx) const { SG::ReadCondHandle<PixelModuleData> modDataHdl(m_moduleDataKey,ctx); const PixelModuleData* modData=(*modDataHdl); - writeHandle.addDependency(modDataHdl); ATH_MSG_INFO("Range of input PixelModule data is " << modDataHdl.getRange()); - if (modData->getUseDCSTemperatureConditions()) { + const EventIDBase start{EventIDBase::UNDEFNUM, EventIDBase::UNDEFEVT, 0, 0, EventIDBase::UNDEFNUM, EventIDBase::UNDEFNUM}; + const EventIDBase stop {EventIDBase::UNDEFNUM, EventIDBase::UNDEFEVT, EventIDBase::UNDEFNUM-1, EventIDBase::UNDEFNUM-1, EventIDBase::UNDEFNUM, EventIDBase::UNDEFNUM}; + + EventIDRange rangeW{start, stop}; + + if (!m_readKey.empty()) { SG::ReadCondHandle<CondAttrListCollection> readHandle(m_readKey, ctx); const CondAttrListCollection* readCdo(*readHandle); if (readCdo==nullptr) { ATH_MSG_FATAL("Null pointer to the read conditions object"); return StatusCode::FAILURE; } - writeHandle.addDependency(readHandle); + // Get the validitiy range + if (not readHandle.range(rangeW)) { + ATH_MSG_FATAL("Failed to retrieve validity range for " << readHandle.key()); + return StatusCode::FAILURE; + } ATH_MSG_INFO("Size of CondAttrListCollection " << readHandle.fullKey() << " readCdo->size()= " << readCdo->size()); - ATH_MSG_INFO("Range of input is " << readHandle.getRange()); + ATH_MSG_INFO("Range of input is " << rangeW); // Read temperature info const std::string param{"temperature"}; @@ -84,7 +92,7 @@ StatusCode PixelDCSCondTempAlg::execute(const EventContext& ctx) const { } } - if (writeHandle.record(std::move(writeCdo)).isFailure()) { + if (writeHandle.record(rangeW, std::move(writeCdo)).isFailure()) { ATH_MSG_FATAL("Could not record PixelDCSTempData " << writeHandle.key() << " with EventRange " << writeHandle.getRange() << " into Conditions Store"); return StatusCode::FAILURE; diff --git a/InnerDetector/InDetConditions/PixelConditionsAlgorithms/src/PixelDeadMapCondAlg.cxx b/InnerDetector/InDetConditions/PixelConditionsAlgorithms/src/PixelDeadMapCondAlg.cxx index 4421fc4c34beb7b1ca56ff138ad48d2c058fab3a..54b4ac5330969471be3120b62693935dd3479541 100644 --- a/InnerDetector/InDetConditions/PixelConditionsAlgorithms/src/PixelDeadMapCondAlg.cxx +++ b/InnerDetector/InDetConditions/PixelConditionsAlgorithms/src/PixelDeadMapCondAlg.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ #include "PixelDeadMapCondAlg.h" @@ -16,8 +16,7 @@ StatusCode PixelDeadMapCondAlg::initialize() { ATH_MSG_DEBUG("PixelDeadMapCondAlg::initialize()"); ATH_CHECK(m_condSvc.retrieve()); - ATH_CHECK(m_moduleDataKey.initialize()); - ATH_CHECK(m_readKey.initialize()); + ATH_CHECK(m_readKey.initialize(SG::AllowEmpty)); ATH_CHECK(m_writeKey.initialize()); if (m_condSvc->regHandle(this,m_writeKey).isFailure()) { ATH_MSG_FATAL("unable to register WriteCondHandle " << m_writeKey.fullKey() << " with CondSvc"); @@ -44,8 +43,7 @@ StatusCode PixelDeadMapCondAlg::execute(const EventContext& ctx) const { EventIDBase::UNDEFNUM-1, EventIDBase::UNDEFNUM, EventIDBase::UNDEFNUM}; EventIDRange rangeW{start, stop}; - - if (SG::ReadCondHandle<PixelModuleData>(m_moduleDataKey,ctx)->getUseDeadmapConditions()) { + if (!m_readKey.empty()) { SG::ReadCondHandle<CondAttrListCollection> readHandle(m_readKey, ctx); const CondAttrListCollection* readCdo = *readHandle; if (readCdo==nullptr) { diff --git a/InnerDetector/InDetConditions/PixelConditionsAlgorithms/src/PixelDeadMapCondAlg.h b/InnerDetector/InDetConditions/PixelConditionsAlgorithms/src/PixelDeadMapCondAlg.h index c4e2ff1b5a6c864542ef4a816d1db59a2d5f7a81..470e57f4e650466d052afc2a9df2e753c3a9c050 100644 --- a/InnerDetector/InDetConditions/PixelConditionsAlgorithms/src/PixelDeadMapCondAlg.h +++ b/InnerDetector/InDetConditions/PixelConditionsAlgorithms/src/PixelDeadMapCondAlg.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ /** * @file PixelConditionsAlgorithms/PixelDeadMapCondAlg.h @@ -17,7 +17,6 @@ #include "AthenaPoolUtilities/CondAttrListCollection.h" #include "StoreGate/WriteCondHandleKey.h" -#include "PixelConditionsData/PixelModuleData.h" #include "PixelConditionsData/PixelDeadMapCondData.h" #include "GaudiKernel/ICondSvc.h" @@ -33,9 +32,6 @@ class PixelDeadMapCondAlg : public AthReentrantAlgorithm { private: ServiceHandle<ICondSvc> m_condSvc{this, "CondSvc", "CondSvc"}; - SG::ReadCondHandleKey<PixelModuleData> m_moduleDataKey - {this, "PixelModuleData", "PixelModuleData", "Pixel module data"}; - SG::ReadCondHandleKey<CondAttrListCollection> m_readKey {this, "ReadKey", "/PIXEL/PixelModuleFeMask", "Input deadmap folder"}; diff --git a/InnerDetector/InDetConditions/PixelConditionsAlgorithms/src/PixelTDAQCondAlg.cxx b/InnerDetector/InDetConditions/PixelConditionsAlgorithms/src/PixelTDAQCondAlg.cxx index 2f76d4d8628efd82e5f348d65033eaece1f47313..2ea72a0ad170382960768810d122d165ef8a32f9 100644 --- a/InnerDetector/InDetConditions/PixelConditionsAlgorithms/src/PixelTDAQCondAlg.cxx +++ b/InnerDetector/InDetConditions/PixelConditionsAlgorithms/src/PixelTDAQCondAlg.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ #include "PixelTDAQCondAlg.h" @@ -16,10 +16,7 @@ StatusCode PixelTDAQCondAlg::initialize() { ATH_MSG_INFO("PixelTDAQCondAlg::initialize()"); ATH_CHECK(detStore()->retrieve(m_pixelID,"PixelID")); - ATH_CHECK(m_condSvc.retrieve()); - - ATH_CHECK(m_moduleDataKey.initialize()); ATH_CHECK(m_readKey.initialize(!m_readKey.empty())); ATH_CHECK(m_writeKey.initialize()); if (m_condSvc->regHandle(this,m_writeKey).isFailure()) { @@ -46,8 +43,7 @@ StatusCode PixelTDAQCondAlg::execute(const EventContext& ctx) const { EventIDBase::UNDEFNUM-1, EventIDBase::UNDEFNUM, EventIDBase::UNDEFNUM}; EventIDRange rangeW{start, stop}; - - if (SG::ReadCondHandle<PixelModuleData>(m_moduleDataKey,ctx)->getUseTDAQConditions()) { + if (!m_readKey.empty()) { SG::ReadCondHandle<CondAttrListCollection> readHandle(m_readKey, ctx); const CondAttrListCollection* readCdo = *readHandle; if (readCdo==nullptr) { diff --git a/InnerDetector/InDetConditions/PixelConditionsAlgorithms/src/PixelTDAQCondAlg.h b/InnerDetector/InDetConditions/PixelConditionsAlgorithms/src/PixelTDAQCondAlg.h index 77e01c616b872f20302efc3acc74ea3ce38da126..1b682def006350624151a8b465b2c118fef688c1 100644 --- a/InnerDetector/InDetConditions/PixelConditionsAlgorithms/src/PixelTDAQCondAlg.h +++ b/InnerDetector/InDetConditions/PixelConditionsAlgorithms/src/PixelTDAQCondAlg.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ /** * @file PixelConditionsAlgorithms/PixelTDAQCondAlg.h @@ -17,7 +17,6 @@ #include "AthenaPoolUtilities/CondAttrListCollection.h" #include "StoreGate/WriteCondHandleKey.h" -#include "PixelConditionsData/PixelModuleData.h" #include "PixelConditionsData/PixelTDAQData.h" #include "InDetIdentifier/PixelID.h" @@ -37,11 +36,8 @@ class PixelTDAQCondAlg : public AthReentrantAlgorithm { const PixelID* m_pixelID{nullptr}; ServiceHandle<ICondSvc> m_condSvc{this, "CondSvc", "CondSvc"}; - SG::ReadCondHandleKey<PixelModuleData> m_moduleDataKey - {this, "PixelModuleData", "PixelModuleData", "Pixel module data"}; - SG::ReadCondHandleKey<CondAttrListCollection> m_readKey - {this, "ReadKey", "/TDAQ/Resources/ATLAS/PIXEL/Modules", "Input key of TDAQ deadmap conditions folder"}; + {this, "ReadKey", "", "Input key of TDAQ deadmap conditions folder"}; SG::WriteCondHandleKey<PixelTDAQData> m_writeKey {this, "WriteKey", "PixelTDAQCondData", "Output key of pixel module data"}; diff --git a/InnerDetector/InDetConditions/PixelConditionsData/CMakeLists.txt b/InnerDetector/InDetConditions/PixelConditionsData/CMakeLists.txt index f2a96745d492124ff188454ea8694041d9da66fa..7f6ce0a55b29f57489e46960ce45530089ae5277 100644 --- a/InnerDetector/InDetConditions/PixelConditionsData/CMakeLists.txt +++ b/InnerDetector/InDetConditions/PixelConditionsData/CMakeLists.txt @@ -13,21 +13,20 @@ atlas_depends_on_subdirs( DetectorDescription/GeoPrimitives Database/AthenaPOOL/AthenaPoolUtilities InnerDetector/InDetConditions/InDetByteStreamErrors - InnerDetector/InDetConditions/PixelCoralClientUtils PRIVATE Control/AthenaKernel GaudiKernel ) # External dependencies: find_package( CLHEP ) -find_package( CORAL COMPONENTS CoralBase CoralKernel RelationalAccess ) +find_package( ROOT COMPONENTS Core Tree MathCore Hist RIO pthread ) # Component(s) in the package: atlas_add_library( PixelConditionsData src/*.cxx PUBLIC_HEADERS PixelConditionsData - PRIVATE_INCLUDE_DIRS ${CORAL_INCLUDE_DIRS} ${CLHEP_INCLUDE_DIRS} + PRIVATE_INCLUDE_DIRS ${CLHEP_INCLUDE_DIRS} ${ROOT_INCLUDE_DIRS} PRIVATE_DEFINITIONS ${CLHEP_DEFINITIONS} - LINK_LIBRARIES CxxUtils Identifier GeoPrimitives PixelCoralClientUtils - PRIVATE_LINK_LIBRARIES ${CORAL_LIBRARIES} ${CLHEP_LIBRARIES} AthenaKernel AthenaPoolUtilities GaudiKernel ) + LINK_LIBRARIES CxxUtils Identifier GeoPrimitives + PRIVATE_LINK_LIBRARIES ${CLHEP_LIBRARIES} ${ROOT_LIBRARIES} AthenaKernel AthenaPoolUtilities GaudiKernel ) diff --git a/InnerDetector/InDetConditions/PixelConditionsData/PixelConditionsData/PixelModuleData.h b/InnerDetector/InDetConditions/PixelConditionsData/PixelConditionsData/PixelModuleData.h index f9a0e096c3905cd5f1123b1ed5a1d7be84f80e05..677b4c1d46a1ba607837eeef868b6e670f1e3c45 100644 --- a/InnerDetector/InDetConditions/PixelConditionsData/PixelConditionsData/PixelModuleData.h +++ b/InnerDetector/InDetConditions/PixelConditionsData/PixelConditionsData/PixelModuleData.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ /** * @file PixelConditionsData/PixelModuleData.h @@ -28,27 +28,6 @@ class PixelModuleData { int getChipStatus(const int chanNum) const; // Switch parameters - void setUseCalibConditions(bool UseCalibConditions); - bool getUseCalibConditions() const; - - void setUseDeadmapConditions(bool UseDeadmapConditions); - bool getUseDeadmapConditions() const; - - void setUseDCSStateConditions(bool UseDCSStateConditions); - bool getUseDCSStateConditions() const; - - void setUseDCSStatusConditions(bool UseDCSStatusConditions); - bool getUseDCSStatusConditions() const; - - void setUseDCSHVConditions(bool UseDCSHVConditions); - bool getUseDCSHVConditions() const; - - void setUseDCSTemperatureConditions(bool UseDCSTemperatureConditions); - bool getUseDCSTemperatureConditions() const; - - void setUseTDAQConditions(bool UseTDAQConditions); - bool getUseTDAQConditions() const; - void setUseCablingConditions(bool UseCablingConditions); bool getUseCablingConditions() const; @@ -213,13 +192,6 @@ class PixelModuleData { typedef std::map<int, std::vector<float>> chipCharge; - bool m_useCalibConditions; - bool m_useDeadmapConditions; - bool m_useDCSStateConditions; - bool m_useDCSStatusConditions; - bool m_useDCSHVConditions; - bool m_useDCSTemperatureConditions; - bool m_useTDAQConditions; bool m_useCablingConditions; double m_bunchSpace; diff --git a/InnerDetector/InDetConditions/PixelConditionsData/PixelConditionsData/SpecialPixelMap.h b/InnerDetector/InDetConditions/PixelConditionsData/PixelConditionsData/SpecialPixelMap.h deleted file mode 100755 index 7afe6762b2bdb233b907388a7d301ff75cd4a0d3..0000000000000000000000000000000000000000 --- a/InnerDetector/InDetConditions/PixelConditionsData/PixelConditionsData/SpecialPixelMap.h +++ /dev/null @@ -1,104 +0,0 @@ -/* - Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration -*/ - -#ifndef PIXELCONDITIONSDATA_SPECIALPIXELMAP_H -#define PIXELCONDITIONSDATA_SPECIALPIXELMAP_H - -#include "PixelCoralClientUtils/SpecialPixelMap.hh" - -#include "AthenaKernel/CLASS_DEF.h" -#include "AthenaKernel/CondCont.h" -#include "CxxUtils/checker_macros.h" -#include<map> -#include<string> - - -/** - * Classes to hold data about special pixels in the detector store and make it - * accessible to athena components. - * - * ruwiedel@physik.uni-bonn.de - * - */ - - -namespace coral{ - class Blob; -} -class IdentifierHash; -class ModuleSpecialPixelMap; - -/** A class for a map of special pixels for the whole pixel detector - or any subgroup of modules. A DetectorSpecialPixelMap is an std::vector - of pointers to ModuleSpecialPixelMaps which hold the actual pixel - status codes. A ModuleSpecialPixelMap is accessed by its IdentifierHash. - */ - -class DetectorSpecialPixelMap : public PixelCoralClientUtils::DetectorSpecialPixelMap{ - - public: - DetectorSpecialPixelMap(); - DetectorSpecialPixelMap(const DetectorSpecialPixelMap& dspm); //!< construct a copy - DetectorSpecialPixelMap(const std::vector<ModuleSpecialPixelMap*>& modules); //!< construct from contents - ~DetectorSpecialPixelMap(); - - DetectorSpecialPixelMap& operator=(const DetectorSpecialPixelMap& spm); - DetectorSpecialPixelMap& operator+=(const DetectorSpecialPixelMap& spm); //!< merge two pixel maps into one - - const ModuleSpecialPixelMap* module(IdentifierHash moduleHash) const; //!< const access to a ModuleSpecialPixelMap* - -}; - -/** A class for a map of special pixels for a single module of the pixel - detector. A ModuleSpecialPixelMap is an std::map of the status codes - (unsigned integers) for all pixels with special properties on a module. - The possible status codes are explained on the wiki page - https://twiki.cern.ch/twiki/bin/view/Atlas/PixelCOOLoffline#Dead_and_special_pixels_map - - The status for a pixel can be retrieved with pixelStatus(pixelID). - The pixel ID can be calculated with encodePixelID. In addition to - pixelStatus, several accessors for individual status bits are provided. - */ - - -class ModuleSpecialPixelMap : public PixelCoralClientUtils::ModuleSpecialPixelMap{ - - public: - ModuleSpecialPixelMap(); - ModuleSpecialPixelMap(const ModuleSpecialPixelMap& mspm); - //!< construct a copy - ModuleSpecialPixelMap(const char* filename, unsigned int mchips); - //!< construct from text file (for details on the format see the README file in PixelConditionsServices/doc) - ModuleSpecialPixelMap(const std::string& clob, unsigned int mchips); - //!< construct from string - ModuleSpecialPixelMap(const coral::Blob& blob, unsigned int mchips); - //!< construct from blob - ModuleSpecialPixelMap(const std::map<unsigned int, unsigned int>& pixels, - unsigned int module_status, - std::vector<unsigned int> chip_status, - std::vector<std::vector<unsigned int> > column_pair_status, unsigned int mchips); - //!< construct from contents - ~ModuleSpecialPixelMap(); - - ModuleSpecialPixelMap& operator=(const ModuleSpecialPixelMap& mspm); - ModuleSpecialPixelMap& operator+=(ModuleSpecialPixelMap mspm); - //!< merge two pixel maps into one - - void print(int component, unsigned int layer, unsigned int phi, int eta, - bool verbosePixelID = true, bool binaryPixelStatus = true) const; - //!< print map to screen - - StatusCode fill_from_string(const std::string& clob); - //!< fills the map from a string, used for conversion of data from the database - StatusCode fill_from_blob(const coral::Blob& blob); - //!< fills the map from a blob, used for conversion of data from the database -}; - -CLASS_DEF(DetectorSpecialPixelMap, 203854058, 1) -CLASS_DEF(ModuleSpecialPixelMap, 84153642, 1) - -CONDCONT_DEF( DetectorSpecialPixelMap, 70046420); -CONDCONT_DEF( ModuleSpecialPixelMap, 153445648); - -#endif diff --git a/InnerDetector/InDetConditions/PixelConditionsData/src/PixelModuleData.cxx b/InnerDetector/InDetConditions/PixelConditionsData/src/PixelModuleData.cxx index 8418d74e105514ab31b19ffd2c2d6f7f19fe9bab..0c605f097e8f3bd4712aad5598a06d836dbba593 100644 --- a/InnerDetector/InDetConditions/PixelConditionsData/src/PixelModuleData.cxx +++ b/InnerDetector/InDetConditions/PixelConditionsData/src/PixelModuleData.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ #include "PixelConditionsData/PixelModuleData.h" @@ -35,27 +35,6 @@ int PixelModuleData::getChipStatus(const int chanNum) const { } // Switch parameters -void PixelModuleData::setUseCalibConditions(bool UseCalibConditions) { m_useCalibConditions = UseCalibConditions; } -bool PixelModuleData::getUseCalibConditions() const { return m_useCalibConditions; } - -void PixelModuleData::setUseDeadmapConditions(bool UseDeadmapConditions) { m_useDeadmapConditions = UseDeadmapConditions; } -bool PixelModuleData::getUseDeadmapConditions() const { return m_useDeadmapConditions; } - -void PixelModuleData::setUseDCSStateConditions(bool UseDCSStateConditions) { m_useDCSStateConditions = UseDCSStateConditions; } -bool PixelModuleData::getUseDCSStateConditions() const { return m_useDCSStateConditions; } - -void PixelModuleData::setUseDCSStatusConditions(bool UseDCSStatusConditions) { m_useDCSStatusConditions = UseDCSStatusConditions; } -bool PixelModuleData::getUseDCSStatusConditions() const { return m_useDCSStatusConditions; } - -void PixelModuleData::setUseDCSHVConditions(bool UseDCSHVConditions) { m_useDCSHVConditions = UseDCSHVConditions; } -bool PixelModuleData::getUseDCSHVConditions() const { return m_useDCSHVConditions; } - -void PixelModuleData::setUseDCSTemperatureConditions(bool UseDCSTemperatureConditions) { m_useDCSTemperatureConditions = UseDCSTemperatureConditions; } -bool PixelModuleData::getUseDCSTemperatureConditions() const { return m_useDCSTemperatureConditions; } - -void PixelModuleData::setUseTDAQConditions(bool UseTDAQConditions) { m_useTDAQConditions = UseTDAQConditions; } -bool PixelModuleData::getUseTDAQConditions() const { return m_useTDAQConditions; } - void PixelModuleData::setUseCablingConditions(bool UseCablingConditions) { m_useCablingConditions = UseCablingConditions; } bool PixelModuleData::getUseCablingConditions() const { return m_useCablingConditions; } diff --git a/InnerDetector/InDetConditions/PixelConditionsData/src/SpecialPixelMap.cxx b/InnerDetector/InDetConditions/PixelConditionsData/src/SpecialPixelMap.cxx deleted file mode 100755 index c8296aaf9b983076b485f3921ca1142173730a2e..0000000000000000000000000000000000000000 --- a/InnerDetector/InDetConditions/PixelConditionsData/src/SpecialPixelMap.cxx +++ /dev/null @@ -1,412 +0,0 @@ -/* - Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration -*/ - -#include "PixelConditionsData/SpecialPixelMap.h" - -// Athena/Gaudi -#include "GaudiKernel/MsgStream.h" -#include "AthenaKernel/getMessageSvc.h" - -#include "CoralBase/Blob.h" -#include "Identifier/IdentifierHash.h" - -// standard library -#include<fstream> -#include<sstream> -#include<string> -#include<iomanip> - - -//***** DetectorSpecialPixelMap *****// -const int nmtype(5); -static const unsigned int columnsPerFEIX[5]={18,80,132,80,132}; // number of columns per FEI3, 4, 50, 51, 52 -//static unsigned int rowsPerFEIX[5]={164, 336, 672, 339, 678}; // number of rows per FEI3, 4, 50, 51, 52 -//static unsigned int rowsRdoPerFEIX[5]={160, 336, 672, 336, 672}; // number of rows readout per FEI3, 4, 50, 51, 52 - - -DetectorSpecialPixelMap::DetectorSpecialPixelMap(){} - -DetectorSpecialPixelMap::DetectorSpecialPixelMap(const DetectorSpecialPixelMap& spm) : - PixelCoralClientUtils::DetectorSpecialPixelMap(){ - - for(DetectorSpecialPixelMap::const_iterator module = spm.begin(); module != spm.end(); ++module){ - - push_back(new ModuleSpecialPixelMap( dynamic_cast<ModuleSpecialPixelMap&>(**module))); - - } -} - -DetectorSpecialPixelMap::DetectorSpecialPixelMap(const std::vector<ModuleSpecialPixelMap*>& modules){ - - for(std::vector<ModuleSpecialPixelMap*>::const_iterator module = modules.begin(); module != modules.end(); ++module){ - - push_back(new ModuleSpecialPixelMap(**module)); - - } -} - -DetectorSpecialPixelMap::~DetectorSpecialPixelMap(){} - - -const ModuleSpecialPixelMap* DetectorSpecialPixelMap::module(IdentifierHash moduleHash) const{ - return dynamic_cast<const ModuleSpecialPixelMap*>(PixelCoralClientUtils::DetectorSpecialPixelMap::module(moduleHash)); -} - - -DetectorSpecialPixelMap& DetectorSpecialPixelMap::operator=(const DetectorSpecialPixelMap& spm){ - if(this !=&spm){ - *this = dynamic_cast<DetectorSpecialPixelMap&>(PixelCoralClientUtils::DetectorSpecialPixelMap::operator=(spm)); - } - return (*this); -} - -DetectorSpecialPixelMap& DetectorSpecialPixelMap::operator+=(const DetectorSpecialPixelMap& spm){ - return dynamic_cast<DetectorSpecialPixelMap&>(PixelCoralClientUtils::DetectorSpecialPixelMap::operator+=(spm)); -} - - - -//***** ModuleSpecialPixelMap *****// - -ModuleSpecialPixelMap::ModuleSpecialPixelMap(){} - -ModuleSpecialPixelMap::ModuleSpecialPixelMap(const ModuleSpecialPixelMap& mspm) : - PixelCoralClientUtils::ModuleSpecialPixelMap(mspm){} - -ModuleSpecialPixelMap::ModuleSpecialPixelMap(const char* filename, unsigned int mchips) : - PixelCoralClientUtils::ModuleSpecialPixelMap(filename, mchips){} - -ModuleSpecialPixelMap::ModuleSpecialPixelMap(const std::string& clob, unsigned int mchips) : - PixelCoralClientUtils::ModuleSpecialPixelMap(clob, mchips){} - -ModuleSpecialPixelMap::ModuleSpecialPixelMap(const coral::Blob& blob, unsigned int mchips) : - PixelCoralClientUtils::ModuleSpecialPixelMap(blob, mchips){} - -ModuleSpecialPixelMap::ModuleSpecialPixelMap(const std::map<unsigned int, unsigned int>& pixels, - unsigned int module_status, - std::vector<unsigned int> chip_status, - std::vector<std::vector<unsigned int> > column_pair_status, - unsigned int mchips) : - PixelCoralClientUtils::ModuleSpecialPixelMap(pixels, module_status, chip_status, column_pair_status, mchips){} - -ModuleSpecialPixelMap::~ModuleSpecialPixelMap(){} - - -ModuleSpecialPixelMap& ModuleSpecialPixelMap::operator=(const ModuleSpecialPixelMap& mspm){ - if(this !=&mspm){ - *this =dynamic_cast<ModuleSpecialPixelMap&>(PixelCoralClientUtils::ModuleSpecialPixelMap::operator=(mspm)); - } - return (*this); -} - -ModuleSpecialPixelMap& ModuleSpecialPixelMap::operator+=(ModuleSpecialPixelMap mspm){ - return dynamic_cast<ModuleSpecialPixelMap&>(PixelCoralClientUtils::ModuleSpecialPixelMap::operator+=(mspm)); -} - -void ModuleSpecialPixelMap::print(int component, - unsigned int layer, - unsigned int phi, - int eta, - bool verbosePixelID, - bool binaryPixelStatus) const{ - - MsgStream log(Athena::getMessageSvc(), "ModuleSpecialPixelMap"); - - unsigned int system, subSystem; - system = 2; - subSystem = 1; - - int itype = (int)m_chipsPerModule%10; - if(itype>(nmtype-1))itype=nmtype-1; - int mch = (int)m_chipsPerModule/10; - int mcolumns = columnsPerFEIX[itype]; // set protection here - - int moduleID = itype==0 ? ( ((component + 2) / 2) << 25 ) + ( layer << 23 ) + ( phi << 17 ) + ( (eta + 6) << 13 ) : -1; - - //print header - - log << MSG::INFO << " " << endmsg; - if(moduleID>-1)log << MSG::INFO << "ModuleSpecialPixelMap for module " << moduleID << ":" << endmsg; - log << MSG::INFO << "Offline ID [system,subsystem,endcap/barrel,layer/disk,phi,eta] : [" - << system << ',' << subSystem << ',' << component << ',' << layer << ',' << phi << ',' << eta << ']' << endmsg; - log << MSG::INFO << "Module status: "; - log.width(10); - log << m_module_status << endmsg; - log << MSG::INFO << " " << endmsg; - - bool print_chip_status = false; - bool print_column_pair_status = false; - - for(int i = 0; i < mch; i++){ - if(m_chip_status.size() != 0 && m_chip_status[i] != 0){ - print_chip_status = true; - } - for(int j = 0; j < mcolumns/2; j++){ - if(m_column_pair_status.size() != 0 && m_column_pair_status[i].size() != 0 - && m_column_pair_status[i][j] != 0){ - print_chip_status = true; - print_column_pair_status = true; - } - } - } - if(mch>2){ - if(print_chip_status){ - log <<MSG::INFO << "Chip number: "; - for(int i = mch-1; i>mch/2-1; i--)log<<i<<" "; - log<< endmsg; - - log << MSG::INFO << "Chip status: "; - for(int i = mch-1; i > mch/2-1; i--){ - log.width(10); - if(m_chip_status.size() != 0){ - log << m_chip_status[i] << " "; - } - else{ - log << 0 << " "; - } - } - log << endmsg; - log << MSG::INFO << " " << endmsg; - - if(print_column_pair_status){ - log << MSG::INFO << "Column pairs: "; - for(int i = mch-1; i > mch/2-1; i--){ - log.width(10); - if(m_column_pair_status.size() != 0 && m_column_pair_status[i].size() != 0){ - log << m_column_pair_status[i][0] << " "; - } - else{ - log << 0 << " "; - } - } - log << endmsg; - log << MSG::INFO << "pairs 0 to "<<mch/2<<" "; - for(int i = mch-1; i > mch/2-1; i--){ - log.width(10); - if(m_column_pair_status.size() != 0 && m_column_pair_status[i].size() != 0){ - log << m_column_pair_status[i][1] << " "; - } - else{ - log << 0 << " "; - } - } - log << endmsg; - for(int j = 2; j < mcolumns/2; j++){ - log << MSG::INFO << " "; - for(int i = mch-1; i > mch/2-1; i--){ - log.width(10); - if(m_column_pair_status.size() != 0 && m_column_pair_status[i].size() != 0){ - log << m_column_pair_status[i][j] << " "; - } - else{ - log << 0 << " "; - } - } - log << endmsg; - } - log << MSG::INFO << " " << endmsg; - - - log << MSG::INFO << "Column pairs: "; - for(int i = 0; i < mch/2; i++){ - log.width(10); - if(m_column_pair_status.size() != 0 && m_column_pair_status[i].size() != 0){ - log << m_column_pair_status[i][0] << " "; - } - else{ - log << 0 << " "; - } - } - log << endmsg; - log << MSG::INFO << "pairs 0 to "<<mch/2<<" "; - for(int i = 0; i < mch/2; i++){ - log.width(10); - if(m_column_pair_status.size() != 0 && m_column_pair_status[i].size() != 0){ - log << m_column_pair_status[i][1] << " "; - } - else{ - log << 0 << " "; - } - } - log << endmsg; - for(int j = 2; j < mcolumns/2; j++){ - log << MSG::INFO << " "; - for(int i = 0; i < mch/2; i++){ - log.width(10); - if(m_column_pair_status.size() != 0 && m_column_pair_status[i].size() != 0){ - log << m_column_pair_status[i][j] << " "; - } - else{ - log << 0 << " "; - } - } - log << endmsg; - } - log << MSG::INFO << " " << endmsg; - } - else{ - log << MSG::INFO << "No special column pairs on this module" << endmsg; - log << MSG::INFO << " " << endmsg; - } - - log << MSG::INFO << "Chip status: "; - for(int i = 0; i < mch/2; i++){ - log.width(10); - if(m_chip_status.size() != 0){ - log << m_chip_status[i] << " "; - } - else{ - log << 0 << " "; - } - } - log << endmsg; - log << MSG::INFO << "Chip number: "; - for(int i = 0; i<mch/2; ++i)log<<i<<" "; - log<< endmsg; - log << MSG::INFO << " " << endmsg; - log << MSG::INFO << " " << endmsg; - } - else{ - log << MSG::INFO << "No special chips and/or column pairs on this module" << endmsg; - log << MSG::INFO << " " << endmsg; - } - - //print map - - for(const_iterator pixel = begin(); pixel != end(); ++pixel){ - if(verbosePixelID){ - unsigned int pixelID = pixel->first; - unsigned int chip = pixelID % 16; - unsigned int column = (itype==0) ? ((pixelID / 16) % 32) : ((pixelID / 16) % 256); - unsigned int row = (itype==0) ? (pixelID / 512) : (pixelID / 4096); - log << "Pixel (chip/column/row) "; - log << ' '; - log << chip << "/"; - log << ' '; - - log << column << "/"; - - log << ' '; - log << row; - } - else{ - log << MSG::INFO << "Pixel " << pixel->first; - } - if(binaryPixelStatus){ - unsigned int pixelStatus = pixel->second; - log << " status: "; - for(int i = 31; i >= 0; i--){ - bool statusBit = pixelStatus & (1 << i); - log << statusBit; - if(!(i%4)) log << ' '; - } - log << endmsg; - } - else{ - log << " status: " << pixel->second << endmsg; - } - } - } - else{// IBL FEI4 module - // - if(print_chip_status){ - log<<MSG::INFO << "Chip number: "; - for(int i =0; i<mch; ++i)log<<i<<" "; - log<<endmsg; - log <<MSG::INFO << "Chip status: "; - for(int i = 0; i < (int)mch; i++){ - log.width(10); - if(m_chip_status.size() != 0){ - log << m_chip_status[i] << " "; - } - else{ - log << 0 << " "; - } - } - log << endmsg; - log <<MSG::INFO << " " << endmsg; - - if(print_column_pair_status){ - log <<MSG::INFO <<"Column pairs 0 to "<<mcolumns/2<<" "; - log << endmsg; - for(int j = 0; j<mcolumns/2; ++j){ - for(int i = 0; i < (int)mch; i++){ - log.width(10); - if(m_column_pair_status.size() != 0 && m_column_pair_status[i].size() != 0){ - log << m_column_pair_status[i][j] << " "; - } - else{ - log << 0 << " "; - } - } - log << endmsg; - } - - log << " " << endmsg; - - } - else{ - log << "No special column pairs on this module" << endmsg; - log << " " << endmsg; - } - } - else{ - log << "No special chips and/or column pairs on this module" << endmsg; - log << " " << endmsg; - } - //print map - - for(const_iterator pixel = begin(); pixel != end(); ++pixel){ - if(verbosePixelID){ - unsigned int pixelID = pixel->first; - unsigned int chip = pixelID % 16; - unsigned int column = (itype==0) ? ((pixelID / 16) % 32) : ((pixelID / 16) % 256); - unsigned int row = (itype==0) ? (pixelID / 512) : (pixelID / 4096); - - log << "Pixel (chip/column/row) "; - log << ' '; - log << chip << "/"; - log <<' '; - log << column << "/"; - log << ' '; - log << row; - } - else{ - log << MSG::INFO <<"Pixel " << pixel->first; - } - if(binaryPixelStatus){ - unsigned int pixelStatus = pixel->second; - log << " status: "; - for(int i = 31; i >= 0; i--){ - bool statusBit = pixelStatus & (1 << i); - log << statusBit; - if(!(i%4)) log << ' '; - } - log << endmsg; - } - else{ - log << " status: " << pixel->second << endmsg; - } - } - // - } - - return; -} - -StatusCode ModuleSpecialPixelMap::fill_from_string(const std::string& clob){ - if( PixelCoralClientUtils::ModuleSpecialPixelMap::fill_from_string(clob) ){ - return StatusCode::FAILURE; - } - - return StatusCode::SUCCESS; -} - -StatusCode ModuleSpecialPixelMap::fill_from_blob(const coral::Blob& blob){ - if( PixelCoralClientUtils::ModuleSpecialPixelMap::fill_from_blob(blob) ){ - return StatusCode::FAILURE; - } - - return StatusCode::SUCCESS; -} diff --git a/InnerDetector/InDetConditions/PixelConditionsTools/PixelConditionsTools/ISpecialPixelMapSvc.h b/InnerDetector/InDetConditions/PixelConditionsTools/PixelConditionsTools/ISpecialPixelMapSvc.h deleted file mode 100755 index 6aa5773afa1328dec25ae2a479576a2984a7cc4b..0000000000000000000000000000000000000000 --- a/InnerDetector/InDetConditions/PixelConditionsTools/PixelConditionsTools/ISpecialPixelMapSvc.h +++ /dev/null @@ -1,77 +0,0 @@ -/* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration -*/ - -#ifndef PIXELCONDITIONSTOOLS_ISPECIALPIXELMAPSERVICE_H -#define PIXELCONDITIONSTOOLS_ISPECIALPIXELMAPSERVICE_H - - -#include "GaudiKernel/IInterface.h" -#include "AthenaKernel/IOVSvcDefs.h" - -#include "AthenaPoolUtilities/CondAttrListCollection.h" -#include "PixelConditionsData/SpecialPixelMap.h" - - - -/** - * Abstract interface for SpecialPixelMapSvc - * - * Creates and manages a set of special pixel map objects in the detector store. If not explicitly switched - * off in the job options, a callback funtion is registered that creates the special pixel map objects in the - * detector store and automatically keeps them up to date for the current run/lumi block. By default all - * special pixel maps are merged into one map which is stored in place of the first map in the list of - * StoreGate keys. - * - * In addition to the callback function the following functions are provided: A special pixel map object can - * be created explicitly with the create method. This method can be configured to either use the data from - * the offline COOL database or from text files. The contents of maps for selected modules can be printed to - * the screen with print(). The number of maps managed can be retrieved with getNPixelMaps(), and the maps - * can be retrieved with getPixelMap(unsigned int index). - * - * ruwiedel@physik.uni-bonn.de - * - */ - - -class ISpecialPixelMapSvc: virtual public IInterface{ - -public: - virtual ~ISpecialPixelMapSvc(){} - - static const InterfaceID& interfaceID(); - - /** automatically creates and updates pixel map objects in the detector store for the current run/lumi block */ - virtual StatusCode IOVCallBack(IOVSVC_CALLBACK_ARGS) = 0; //!< callback function registered in initialize() - - virtual StatusCode createFromTextfiles(bool fillMissing = true) const = 0; - //!< create special pixel map objects using data read from text files (for details see the README file in the doc directory) - virtual StatusCode createFromDetectorStore(const std::string condAttrListCollectionKey, const std::string pixelMapKey, - bool fillMissing = true ) const = 0; - //!< create special pixel map from CondAttrListCollection at key - virtual StatusCode createFromDetectorStore(bool fillMissing = true) const = 0; - //!< create special pixel map objects using data from the offline COOL database - virtual StatusCode create() const = 0; - //!< create special pixel map objects using the data source specified in the job options - virtual StatusCode print() const = 0; - //!< print pixel maps for the modules specified in the job options to the screen - - virtual unsigned int getNPixelMaps() const = 0; - //!< returns the number of special pixel map objects managed by the SpecialPixelMapSvc - virtual const DetectorSpecialPixelMap *getPixelMap(unsigned int index) const = 0; - //!< returns a const pointer to the index'th special pixel map - - virtual unsigned int getChips(const unsigned int & index) const = 0; - //!< returns the number of chips and type of module as 10*mchips+i - - virtual StatusCode registerCondAttrListCollection(const DetectorSpecialPixelMap* spm) const = 0; - //!< convert spm to CondAttrListCollection and register in the detector store - //!< used when preparing database write -}; - -inline const InterfaceID& ISpecialPixelMapSvc::interfaceID(){ - static const InterfaceID IID_ISpecialPixelMapSvc("ISpecialPixelMapSvc", 1, 0); - return IID_ISpecialPixelMapSvc; -} - -#endif diff --git a/InnerDetector/InDetConditions/PixelCoralClientUtils/CMakeLists.txt b/InnerDetector/InDetConditions/PixelCoralClientUtils/CMakeLists.txt deleted file mode 100644 index e683f06057c379051ba74ef12b9fff89661f3bd9..0000000000000000000000000000000000000000 --- a/InnerDetector/InDetConditions/PixelCoralClientUtils/CMakeLists.txt +++ /dev/null @@ -1,76 +0,0 @@ -################################################################################ -# Package: PixelCoralClientUtils -################################################################################ - -# Declare the package name: -atlas_subdir( PixelCoralClientUtils ) - -# Declare the package's dependencies: -atlas_depends_on_subdirs( PUBLIC - Control/CxxUtils - Database/CoraCool ) - -# External dependencies: -find_package( COOL COMPONENTS CoolKernel ) -find_package( CORAL COMPONENTS CoralBase CoralKernel RelationalAccess ) -find_package( ROOT COMPONENTS Core Tree MathCore Hist RIO pthread ) - -# Component(s) in the package: -atlas_add_library( PixelCoralClientUtils - src/CoralClient.cc - src/PCDio.cc - src/SpecialPixelMap.cc - src/PCDDb.cxx - src/PixCalibCoralCoolDb.cc - src/PixCalibKnowledgeDb.cc - PUBLIC_HEADERS PixelCoralClientUtils - INCLUDE_DIRS ${CORAL_INCLUDE_DIRS} - PRIVATE_INCLUDE_DIRS ${COOL_INCLUDE_DIRS} ${ROOT_INCLUDE_DIRS} - LINK_LIBRARIES ${CORAL_LIBRARIES} CxxUtils CoraCool - PRIVATE_LINK_LIBRARIES ${COOL_LIBRARIES} ${ROOT_LIBRARIES} ) - -atlas_add_executable( CORAL-read - src/CORAL-read.cc - INCLUDE_DIRS ${COOL_INCLUDE_DIRS} ${ROOT_INCLUDE_DIRS} ${CORAL_INCLUDE_DIRS} - LINK_LIBRARIES ${COOL_LIBRARIES} ${ROOT_LIBRARIES} ${CORAL_LIBRARIES} CxxUtils CoraCool PixelCoralClientUtils ) - -atlas_add_executable( CORAL-create - src/CORAL-create.cc - INCLUDE_DIRS ${COOL_INCLUDE_DIRS} ${ROOT_INCLUDE_DIRS} ${CORAL_INCLUDE_DIRS} - LINK_LIBRARIES ${COOL_LIBRARIES} ${ROOT_LIBRARIES} ${CORAL_LIBRARIES} CxxUtils CoraCool PixelCoralClientUtils ) - -atlas_add_executable( CORAL-fill - src/CORAL-fill.cc - INCLUDE_DIRS ${COOL_INCLUDE_DIRS} ${ROOT_INCLUDE_DIRS} ${CORAL_INCLUDE_DIRS} - LINK_LIBRARIES ${COOL_LIBRARIES} ${ROOT_LIBRARIES} ${CORAL_LIBRARIES} CxxUtils CoraCool PixelCoralClientUtils ) - -atlas_add_executable( CORAL-listVariables - src/CORAL-listVariables.cc - INCLUDE_DIRS ${COOL_INCLUDE_DIRS} ${ROOT_INCLUDE_DIRS} ${CORAL_INCLUDE_DIRS} - LINK_LIBRARIES ${COOL_LIBRARIES} ${ROOT_LIBRARIES} ${CORAL_LIBRARIES} CxxUtils CoraCool PixelCoralClientUtils ) - -atlas_add_executable( extractAnalysis - src/extractAnalysis.cc - INCLUDE_DIRS ${COOL_INCLUDE_DIRS} ${ROOT_INCLUDE_DIRS} ${CORAL_INCLUDE_DIRS} - LINK_LIBRARIES ${COOL_LIBRARIES} ${ROOT_LIBRARIES} ${CORAL_LIBRARIES} CxxUtils CoraCool PixelCoralClientUtils ) - -atlas_add_executable( fixTimewalk - src/fixTimewalk.cc - INCLUDE_DIRS ${COOL_INCLUDE_DIRS} ${ROOT_INCLUDE_DIRS} ${CORAL_INCLUDE_DIRS} - LINK_LIBRARIES ${COOL_LIBRARIES} ${ROOT_LIBRARIES} ${CORAL_LIBRARIES} CxxUtils CoraCool PixelCoralClientUtils ) - -atlas_add_executable( extractSPM - src/extractSPM.cc - INCLUDE_DIRS ${COOL_INCLUDE_DIRS} ${ROOT_INCLUDE_DIRS} ${CORAL_INCLUDE_DIRS} - LINK_LIBRARIES ${COOL_LIBRARIES} ${ROOT_LIBRARIES} ${CORAL_LIBRARIES} CxxUtils CoraCool PixelCoralClientUtils ) - -atlas_add_executable( talkToPCDDb - src/talkToPCDDb.cc - INCLUDE_DIRS ${COOL_INCLUDE_DIRS} ${ROOT_INCLUDE_DIRS} ${CORAL_INCLUDE_DIRS} - LINK_LIBRARIES ${COOL_LIBRARIES} ${ROOT_LIBRARIES} ${CORAL_LIBRARIES} CxxUtils CoraCool PixelCoralClientUtils ) - -atlas_add_executable( calibDbInterface - src/calibDbInterface.cc - INCLUDE_DIRS ${COOL_INCLUDE_DIRS} ${ROOT_INCLUDE_DIRS} ${CORAL_INCLUDE_DIRS} - LINK_LIBRARIES ${COOL_LIBRARIES} ${ROOT_LIBRARIES} ${CORAL_LIBRARIES} CxxUtils CoraCool PixelCoralClientUtils ) - diff --git a/InnerDetector/InDetConditions/PixelCoralClientUtils/PixelCoralClientUtils/ATLAS_CHECK_THREAD_SAFETY b/InnerDetector/InDetConditions/PixelCoralClientUtils/PixelCoralClientUtils/ATLAS_CHECK_THREAD_SAFETY deleted file mode 100644 index 67cfcbd2e284e0854366bd99c355881822926e1b..0000000000000000000000000000000000000000 --- a/InnerDetector/InDetConditions/PixelCoralClientUtils/PixelCoralClientUtils/ATLAS_CHECK_THREAD_SAFETY +++ /dev/null @@ -1 +0,0 @@ -InnerDetector/InDetConditions/PixelCoralClientUtils diff --git a/InnerDetector/InDetConditions/PixelCoralClientUtils/PixelCoralClientUtils/AnalysisResultList_t.hh b/InnerDetector/InDetConditions/PixelCoralClientUtils/PixelCoralClientUtils/AnalysisResultList_t.hh deleted file mode 100644 index 6e6b7fde0cdceab2534dd421a83371e9910bc1ed..0000000000000000000000000000000000000000 --- a/InnerDetector/InDetConditions/PixelCoralClientUtils/PixelCoralClientUtils/AnalysisResultList_t.hh +++ /dev/null @@ -1,213 +0,0 @@ -/* - Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration -*/ - -#ifndef PIXELCORALCLIENTUTILS_ANALYSISRESULTLIST_T_HH -#define PIXELCORALCLIENTUTILS_ANALYSISRESULTLIST_T_HH - -#include "CxxUtils/checker_macros.h" -#include "PixelCoralClientUtils/PixResultsException.hh" -#include <map> -#include <vector> -#include <sstream> -#include "PixelMap.h" - -namespace CAN { - - class AnalysisResultList_t; - - class AnalysisResultValueNotFound : public CAN::PixResultsException - { - friend class AnalysisResultList_t; - protected: - AnalysisResultValueNotFound(const std::string &function_name, - const std::string &message) - : CAN::PixResultsException("ANAVAL_NOTEXISTING "+function_name+": "+message) - {} - - }; - - class AverageResult_t - { - public: - AverageResult_t(const unsigned int n, const float mean, const float rms, const float lower99, const float upper99) - : m_n(n) - { - m_values[kMean]=mean; - m_values[kRMS]=rms; - m_values[kLower99]=lower99; - m_values[kUpper99]=upper99; - } - - AverageResult_t() - : m_n(0) - { - for(unsigned int i=0; i<kNValues; ++i) { - m_values[i]=0; - } - } - - enum EValues {kMean, kRMS, kLower99, kUpper99, kNValues}; - float value(int i) const {return m_values[i];}; - unsigned int n() const {return m_n;}; - - private: - unsigned int m_n; - float m_values[kNValues]; - }; - - - /** Container for analysis results. - * Can store : - * <ul> - * <li>unsigned ints<li/> - * <li>bools<li/> - * <li>average value given by : n, meam, rms, lower 99% and upper 99% bounds.<li/> - * </ul> - * Each value is assigned to a variable name and a connectivity name. - * The values are stored by <tt>analysis_results.addValue<unsigned int>("a_value","ROD_C1_S11",1)<tt>, - * they are retrieved by <tt>unsignd int a_value = analysis_results.value<unsigned int>("a_value","ROD_C1_S11")<tt>, - * or one can iteratre over all stored values. The iterators can be obtained by <tt>analysis_results.begin<unsigned int>()</tt> - * and <tt>analysis_results.end<unsigned int>()</tt>. - */ - class AnalysisResultList_t { - public: - -// void addValue(const std::string &name, const float value) { -// m_floatValues.insert(std::make_pair(name, value)); -// } - - protected: - template <class T> - std::map<std::string, std::map<std::string, T> > &getMap(); - - template <class T> - const std::map<std::string, std::map<std::string, T> > &getMap() const; - - void throwValueDoesNotExist(const std::string &var_name, const std::string& conn_name) const { - std::stringstream message; - message << "No value of name " << var_name << " for connectivity object " << conn_name << "."; - throw AnalysisResultValueNotFound("AnalysisResultList_t::value<T>",message.str()); - } - - public: - template <class T> - void insertValue(const std::string &var_name, const std::string &conn_name, const T &value) { - getMap<T>()[var_name].insert(std::make_pair(conn_name,value)); - } - - template <class T> - void addValue(const std::string &var_name, const std::string &conn_name, const T &value) { - getMap<T>()[var_name][conn_name]=value; - } - - template <class T> - const T &value(const std::string &var_name, const std::string &conn_name) const { - typename std::map< std::string, std::map<std::string, T> >::const_iterator iter=getMap<T>().find(var_name); - if (iter == getMap<T>().end()) { - throwValueDoesNotExist(var_name,conn_name); - } - typename std::map<std::string, T>::const_iterator val_iter=iter->second.find(conn_name); - if (val_iter == iter->second.end()) { - throwValueDoesNotExist(var_name,conn_name); - } - return val_iter->second; - } - - template <class T> - bool has(const std::string &var_name, const std::string &conn_name) const { - typename std::map< std::string, std::map<std::string, T> >::const_iterator iter=getMap<T>().find(var_name); - if (iter != getMap<T>().end()) { - typename std::map<std::string, T>::const_iterator val_iter=iter->second.find(conn_name); - if (val_iter != iter->second.end()) { - return true; - } - } - return false; - } - - int nPixelMaps() { return m_pixelMap.size(); }; - - template <class T> - typename std::map< std::string, std::map<std::string, T> >::iterator begin() - { return getMap<T>().begin(); } - - template <class T> - typename std::map< std::string, std::map<std::string, T> >::const_iterator begin () const - { return getMap<T>().begin(); } - - template <class T> - typename std::map< std::string, std::map<std::string, T> >::const_iterator end () const - { return getMap<T>().end(); } - - protected: - std::map<std::string, std::map<std::string, bool> > m_boolValues; - std::map<std::string, std::map<std::string, unsigned int> > m_uintValues; - std::map<std::string, std::map<std::string, float> > m_floatValues; //CLA - std::map<std::string, std::map<std::string, AverageResult_t> > m_avValues; - std::map<std::string, std::map<std::string, PixelMap_t> > m_pixelMap; //CLA - }; - - - template <> inline - std::map<std::string, std::map<std::string, bool> > & - AnalysisResultList_t::getMap<bool>() { return AnalysisResultList_t::m_boolValues; } - - template <> inline - const std::map<std::string, std::map<std::string, bool> > & - AnalysisResultList_t::getMap<bool>() const { return AnalysisResultList_t::m_boolValues; } - - template <> inline - std::map<std::string, std::map<std::string, unsigned int> > & - AnalysisResultList_t::getMap<unsigned int>() { return AnalysisResultList_t::m_uintValues; } - - template <> inline - const std::map<std::string, std::map<std::string, unsigned int> > & - AnalysisResultList_t::getMap<unsigned int>() const { return AnalysisResultList_t::m_uintValues; } - - template <> inline - std::map<std::string, std::map<std::string, float> > & - AnalysisResultList_t::getMap<float>() { return AnalysisResultList_t::m_floatValues; } //CLA - - template <> inline - const std::map<std::string, std::map<std::string, float> > & - AnalysisResultList_t::getMap<float>() const { return AnalysisResultList_t::m_floatValues; } //CLA - - template <> inline - std::map<std::string, std::map<std::string, AverageResult_t> > & - AnalysisResultList_t::getMap<AverageResult_t>() { return AnalysisResultList_t::m_avValues; } - - template <> inline - const std::map<std::string, std::map<std::string, AverageResult_t> > & - AnalysisResultList_t::getMap<AverageResult_t>() const { return AnalysisResultList_t::m_avValues; } - - template <> inline - std::map<std::string, std::map<std::string, PixelMap_t> > & - AnalysisResultList_t::getMap<PixelMap_t>() { return AnalysisResultList_t::m_pixelMap; } - - template <> inline - const std::map<std::string, std::map<std::string, PixelMap_t> > & - AnalysisResultList_t::getMap<PixelMap_t>() const { return AnalysisResultList_t::m_pixelMap; } - - // example: - // - // inline void test() { - // AnalysisResultList_t a; - // a.addValue<unsigned int>("test","ROD_C1_S11",1); - // unsigned int a_value = a.value<unsigned int>("test","ROD_C1_S11"); - // - // for (std::map<std::string, std::map<std::string, unsigned int > >::const_iterator iter=a.begin<unsigned int>(); - // iter != a.end<unsigned int>(); - // iter ++) { - // - // for (std::map<std::string, unsigned int >::const_iterator val_iter=iter->second.begin(); - // val_iter != iter->second.end(); - // val_iter ++) { - // unsigned int b=val_iter->second; - // } - // } - // } - -} - -#endif diff --git a/InnerDetector/InDetConditions/PixelCoralClientUtils/PixelCoralClientUtils/CoralClient.hh b/InnerDetector/InDetConditions/PixelCoralClientUtils/PixelCoralClientUtils/CoralClient.hh deleted file mode 100644 index dc5285d607b21f1ec25f3dafc9d1e058cf47cb16..0000000000000000000000000000000000000000 --- a/InnerDetector/InDetConditions/PixelCoralClientUtils/PixelCoralClientUtils/CoralClient.hh +++ /dev/null @@ -1,188 +0,0 @@ -/* - Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration -*/ - -#ifndef CORALCLIENT -#define CORALCLIENT - -// GENERIC C++/C headers -#include <time.h> -#include <sys/time.h> -#include <iostream> -#include <fstream> -#include <string> -#include <set> -#include <cstdio> - -#include "PixelCoralClientUtils/IPixResultsDbListener.hh" -#include "PixelCoralClientUtils/AnalysisResultList_t.hh" - -// same definitions are done by seal and omni - -#ifdef HAVE_NAMESPACES -# undef HAVE_NAMESPACES -#endif -#ifdef HAVE_BOOL -# undef HAVE_BOOL -#endif -#ifdef HAVE_DYNAMIC_CAST -# undef HAVE_DYNAMIC_CAST -#endif - -// CORAL API -#include "CoralKernel/Context.h" -#include "CoralBase/Attribute.h" -#include "CoralBase/AttributeList.h" -#include "CoralBase/AttributeListException.h" -#include "RelationalAccess/IConnectionService.h" -#include "RelationalAccess/IConnectionServiceConfiguration.h" -#include "RelationalAccess/AccessMode.h" -#include "RelationalAccess/ISessionProxy.h" -#include "RelationalAccess/ISchema.h" -#include "RelationalAccess/ITransaction.h" - -#include "RelationalAccess/ITable.h" -#include "RelationalAccess/ITableDescription.h" -#include "RelationalAccess/IColumn.h" -#include "RelationalAccess/ICursor.h" -#include "RelationalAccess/IQuery.h" -#include "RelationalAccess/TableDescription.h" -#include "RelationalAccess/ITableDataEditor.h" -#include "RelationalAccess/ITableSchemaEditor.h" -#include "RelationalAccess/IBulkOperation.h" -#include "RelationalAccess/SchemaException.h" - -// COOL API: database service bootstrap -//#include "CoolApplication/Application.h" -//#include "CoolApplication/DatabaseSvcFactory.h" -#include <CoralBase/TimeStamp.h> - - -//using namespace cool; - -namespace CAN { - // Added typedef to remove dependency on idl (PixCalibDbCoral/Common.idl) -#ifdef __x86_64__ - typedef unsigned int SerialNumber_t; -#else - typedef unsigned long SerialNumber_t; -#endif - class AverageResult_t; -} - -// added -- A.X. -namespace PixelCalib { - class PixelCalibData; -} - -class PixCoralClient { - -private: - std::string m_connString; - coral::AccessMode m_accessMode; - - coral::IHandle<coral::IConnectionService> m_connectionService; - coral::ISessionProxy *m_session; - - std::string m_pixeltable; - bool m_verbose; - - void connect(); - static coral::IHandle<coral::IConnectionService> connectionService(bool verbose=false); - -protected: - - void transactionStartReadOnly(); - void transactionStartUpdate(); - void transactionCommit(); - -public: - // added table name -- A.X. - PixCoralClient(const std::string& id1, - bool verbose = false, coral::AccessMode access_mode = coral::Update, const char* tableName = "CALIB_ANAL"); - PixCoralClient(bool verbose = false, coral::AccessMode access_mode = coral::Update, const char* tableName = "CALIB_ANAL"); - ~PixCoralClient(); - - void disconnect(); - - void printTables(const char* option = 0); // added option -- A.X. - void printTableDesc(const std::string& tableName); - void printTableContent(const std::string& tableName); - void createTables(const char* option = 0); // added option -- A.X. - template <typename T> void createTable(); - template <typename T> int fillTable(long long fk, CAN::AnalysisResultList_t *results); - // added -- A.X. - int fillTablePixelCalibData(long long fk, const char* option); - void dropTables(); - void fillTables(CAN::SerialNumber_t id, CAN::AnalysisResultList_t *results); - // fill pcd table -- A.X. - void fillTables(const char* option); - - //PVSS methods - double get_value_from_PVSSarch(const std::string&,const coral::TimeStamp &,const coral::TimeStamp &); - double get_values_from_PVSSarch(const std::string&,const coral::TimeStamp &,const coral::TimeStamp &); - void get_alias_from_PVSSarch(); - - void queryTable(CAN::SerialNumber_t anal_id, const std::string& varname="", const std::string& connName=""); - CAN::AnalysisResultList_t getAnalysisResultsFromDB(CAN::SerialNumber_t anal_id, const std::string& varname="", const std::string& connName=""); - CAN::AnalysisResultList_t getAnalysisResultsFromDB(CAN::SerialNumber_t anal_id, const std::vector<std::string> &connName, const std::string& varname=""); - - /** Get analysis results for a list of connectivity objects. - * @param analysis_id list of analysis serial numbers, - * @param connName list of connectivity names for which the values should be retrieved - * @param listener object which will be notified about new variables. - */ - void getAnalysisResultsFromDB(std::vector<CAN::SerialNumber_t> analysis_id, - const std::vector<std::string> &connName, - IPixResultsDbListener &listener); - - /** Get analysis results for a list of connectivity objects. - * @param analysis_id the analysis serial number, - * @param connName list of connectivity names for which the values should be retrieved - * @param listener object which will be notified about new variables. - */ - void getAnalysisResultsFromDB(CAN::SerialNumber_t analysis_id, const std::vector<std::string> &connName, IPixResultsDbListener &listener) { - std::vector<CAN::SerialNumber_t> temp; - temp.push_back(analysis_id); - getAnalysisResultsFromDB(temp,connName,listener); - } - - // get PCD -- A.X. - void getCalibrationDataFromDB(const char* option); - - void createAuxTables(); - long long updateKey(); - void verboseOutput(bool verbose) {m_verbose = verbose;}; - - /** Get the chip number from the column and row - */ - static int chip(int col, int row) { - int FE = -1; - if ((int)row/160 == 0) FE = (int)col/18; - if ((int)row/160 == 1) FE = 8 + (int)(143-col)/18; - return FE; - } - - static std::string PixelMapToCLOB(const PixelMap_t & pixmap); - static PixelMap_t CLOBtoPixelMap(const std::string & clob); - - - // Convert local time t to GMT (UTC) - std::time_t LocalToGMTTime (std::time_t t) { - std::time_t rawtime = t ? t : time(0); - struct tm result; - tm * ptm; - ptm = gmtime_r(&rawtime, &result); - return mktime(ptm); - } - // Get current time in GMT (UTC) - std::time_t GMTCurrentTime() { return LocalToGMTTime(0); } // Thread unsafe LocalToGMTTime method is used. - // Convert GMT (UTC) time to local time - std::time_t GMTtoLocalTime (std::time_t gmttime) { // Thread unsafe gmtime is used. - struct tm result; - return 2*gmttime - mktime (gmtime_r(&gmttime, &result)); - } -}; - - -#endif diff --git a/InnerDetector/InDetConditions/PixelCoralClientUtils/PixelCoralClientUtils/IPixResultsDbListener.hh b/InnerDetector/InDetConditions/PixelCoralClientUtils/PixelCoralClientUtils/IPixResultsDbListener.hh deleted file mode 100644 index 8c58c62589bce91f90035ac6e94209ddef19824c..0000000000000000000000000000000000000000 --- a/InnerDetector/InDetConditions/PixelCoralClientUtils/PixelCoralClientUtils/IPixResultsDbListener.hh +++ /dev/null @@ -1,25 +0,0 @@ -/* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration -*/ - -#ifndef _IPIXRESULTSDBLISTENER_ -#define _IPIXRESULTSDBLISTENER_ - -#include <string> -#include "PixelCoralClientUtils/PixelMap.h" - -namespace CAN { - class AverageResult_t; -} - -class IPixResultsDbListener { - public: - virtual ~IPixResultsDbListener() {} - virtual void newValue(const std::string &var_name, const std::string &conn_name, bool value) = 0; - virtual void newValue(const std::string &var_name, const std::string &conn_name, unsigned int value) = 0; - virtual void newValue(const std::string &var_name, const std::string &conn_name, float value) = 0 ; - virtual void newValue(const std::string &var_name, const std::string &conn_name, const CAN::AverageResult_t &value) = 0 ; - virtual void newValue(const std::string &var_name, const std::string &conn_name, const PixelMap_t &value) = 0 ; -}; - -#endif // _IPIXRESULTSDBLISTENER_ diff --git a/InnerDetector/InDetConditions/PixelCoralClientUtils/PixelCoralClientUtils/PCDDb.h b/InnerDetector/InDetConditions/PixelCoralClientUtils/PixelCoralClientUtils/PCDDb.h deleted file mode 100644 index 88282cd0e4eb17f9f15d4a8551a9a91713df237e..0000000000000000000000000000000000000000 --- a/InnerDetector/InDetConditions/PixelCoralClientUtils/PixelCoralClientUtils/PCDDb.h +++ /dev/null @@ -1,47 +0,0 @@ -/* - Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration -*/ - -#ifndef PIXELCORALCLIENTUTILS_PCDDB_H -#define PIXELCORALCLIENTUTILS_PCDDB_H - -#include <string> - -namespace PixelCoralClientUtils { - class PixelCalibData; -} - -namespace coral { - class ISessionProxy; - class IQuery; - class ICursor; -} - -class PCDDb -{ - public: - PCDDb(const std::string& connString, - const std::string& tableName, - bool verbose, bool load_text); - ~PCDDb(); - - bool init(const std::string& tag, int revision); - int next(); - bool set(int idmod_cur, PixelCoralClientUtils::PixelCalibData& pcd); - - private: - bool m_verbose; - coral::ISessionProxy *m_session; - std::string m_connString; - std::string m_pixeltable; - - coral::IQuery* m_query; - coral::IQuery* m_query_2; - coral::ICursor* m_cursor; - - void transactionStartReadOnly(); - void transactionStartUpdate(); - void transactionCommit(); -}; - -#endif diff --git a/InnerDetector/InDetConditions/PixelCoralClientUtils/PixelCoralClientUtils/PCDio.h b/InnerDetector/InDetConditions/PixelCoralClientUtils/PixelCoralClientUtils/PCDio.h deleted file mode 100644 index ca3bfa03d2776fc479260a615439e616f1a15250..0000000000000000000000000000000000000000 --- a/InnerDetector/InDetConditions/PixelCoralClientUtils/PixelCoralClientUtils/PCDio.h +++ /dev/null @@ -1,46 +0,0 @@ -/* - Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration -*/ - -#ifndef PIXELCORALCLIENTUTILS_PCDIO_H -#define PIXELCORALCLIENTUTILS_PCDIO_H - -#include "CxxUtils/checker_macros.h" -#include "RelationalAccess/AccessMode.h" - -#include <string> - -namespace coral { - class ISessionProxy; -} - -class PCDio -{ - public: - PCDio(const std::string& connString, - const std::string& tableName, - int verbose); - ~PCDio(); - - void init(coral::AccessMode access_mode); - void load(const std::string& tag, int revision); - void save(const std::string& tag, int revision, const std::string& sources); - - private: - std::string m_connString; - std::string m_pixeltable; - int m_verbose; - coral::ISessionProxy *m_session; - - void createTable(); - void createAuxTables(); - void createHeaderTable(); - void createDataTable(); - long long updateKey(); - - void transactionStartReadOnly(); - void transactionStartUpdate(); - void transactionCommit(); -}; - -#endif diff --git a/InnerDetector/InDetConditions/PixelCoralClientUtils/PixelCoralClientUtils/PCDkr.h b/InnerDetector/InDetConditions/PixelCoralClientUtils/PixelCoralClientUtils/PCDkr.h deleted file mode 100644 index 7b72f5cee190b09e4c6a5be464bb0c4dadd26f76..0000000000000000000000000000000000000000 --- a/InnerDetector/InDetConditions/PixelCoralClientUtils/PixelCoralClientUtils/PCDkr.h +++ /dev/null @@ -1,42 +0,0 @@ -/* - Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration -*/ - -#ifndef PIXELCORALCLIENTUTILS_PCDKR_H -#define PIXELCORALCLIENTUTILS_PCDKR_H - -#include "RelationalAccess/AccessMode.h" - -#include <string> - -namespace coral { - class ISessionProxy; -} - -class PCDkr -{ - public: - PCDkr(const std::string& connString, - const std::string& tableName, - int verbose); - ~PCDkr(); - - void init(coral::AccessMode access_mode); - void load(); - void save(cosnt std::string& tag, const std::string& cid); - void validate(const std::string& tag); - - private: - std::string m_connString; - std::string m_pixeltable; - int m_verbose; - coral::ISessionProxy *m_session; - - void createTable(); - - void transactionStartReadOnly(); - void transactionStartUpdate(); - void transactionCommit(); -}; - -#endif diff --git a/InnerDetector/InDetConditions/PixelCoralClientUtils/PixelCoralClientUtils/PixCalibCoralCoolDb.h b/InnerDetector/InDetConditions/PixelCoralClientUtils/PixelCoralClientUtils/PixCalibCoralCoolDb.h deleted file mode 100644 index a94d8339ec62281ce6cd9107c91dbbf639f5ce21..0000000000000000000000000000000000000000 --- a/InnerDetector/InDetConditions/PixelCoralClientUtils/PixelCoralClientUtils/PixCalibCoralCoolDb.h +++ /dev/null @@ -1,34 +0,0 @@ -/* - Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration -*/ - -#ifndef PIXELCORALCLIENTUTILS_PIXCALIBCORALCOOLDB_H -#define PIXELCORALCLIENTUTILS_PIXCALIBCORALCOOLDB_H - -#include "CoraCool/CoraCoolDatabase.h" -#include "CxxUtils/checker_macros.h" - -#include <string> - -class ATLAS_NOT_THREAD_SAFE PixCalibCoralCoolDb // Use of singleton databaseService -{ - public: - PixCalibCoralCoolDb(const std::string& dbString, int verbose); - ~PixCalibCoralCoolDb(); - - bool init(); - bool load(cool::ValidityKey vk); - -/* bool save(cool::ValidityKey vk1, */ -/* cool::ValidityKey vk2); */ - - bool saveCalibData(std::string textfile, long long FK); - bool referenceToRunInterval(long long FK, cool::ValidityKey vk1, cool::ValidityKey vk2, const std::string& tagname ); - - private: - std::string m_dbstring; - - CoraCoolDatabasePtr m_coradb; -}; - -#endif diff --git a/InnerDetector/InDetConditions/PixelCoralClientUtils/PixelCoralClientUtils/PixCalibKnowledgeDb.h b/InnerDetector/InDetConditions/PixelCoralClientUtils/PixelCoralClientUtils/PixCalibKnowledgeDb.h deleted file mode 100644 index 2d94ce1e40533d33436bc432165913ae41b72a3a..0000000000000000000000000000000000000000 --- a/InnerDetector/InDetConditions/PixelCoralClientUtils/PixelCoralClientUtils/PixCalibKnowledgeDb.h +++ /dev/null @@ -1,50 +0,0 @@ -/* - Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration -*/ - -#ifndef PIXELCORALCLIENTUTILS_PIXCALIBKNOWLEDGEDB_H -#define PIXELCORALCLIENTUTILS_PIXCALIBKNOWLEDGEDB_H - -#include "RelationalAccess/AccessMode.h" - -#include <string> - -namespace coral { - class ISessionProxy; -} - -class PixCalibKnowledgeDb -{ - public: - PixCalibKnowledgeDb(const std::string& connString, - const std::string& tableName, - int verbose); - ~PixCalibKnowledgeDb(); - - void init(coral::AccessMode access_mode); - //long long findFK(std::string tag); - - void saveCorrespondingConfig(long int UnixTimeInSeconds, long int RunNumber, const std::string& calibtags_in_string, const std::string& idTag, const std::string& connTag, const std::string& cfgTag, const std::string& cfgModTag ); - - void readCorrespondingCalibTag(long int Utime); - - private: - std::string m_connString; - std::string m_pixeltable; - int m_verbose; - coral::ISessionProxy *m_session; - //std::string findTag(long long fk); - - void createTable(); - void createAuxTables(); - // void createHeaderTable(); - void createConfigurationTable(); - // void createDataTable(); - long long updateKey(); - - void transactionStartReadOnly(); - void transactionStartUpdate(); - void transactionCommit(); -}; - -#endif diff --git a/InnerDetector/InDetConditions/PixelCoralClientUtils/PixelCoralClientUtils/PixResultsException.hh b/InnerDetector/InDetConditions/PixelCoralClientUtils/PixelCoralClientUtils/PixResultsException.hh deleted file mode 100644 index 506523b82bf86eb9ac249e2c863e0288793d8127..0000000000000000000000000000000000000000 --- a/InnerDetector/InDetConditions/PixelCoralClientUtils/PixelCoralClientUtils/PixResultsException.hh +++ /dev/null @@ -1,24 +0,0 @@ -/* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration -*/ - -#ifndef _CAN_PixResultsException_hh_ -#define _CAN_PixResultsException_hh_ - -#include <exception> -#include <string> - -namespace CAN { - -class PixResultsException : public std::exception { -public: - PixResultsException(const std::string& msg) : m_msg(msg) {} - ~PixResultsException() throw() {} - const char* what() const throw() { return m_msg.c_str(); } - -private: - std::string m_msg; -}; -} // namespace CAN - -#endif diff --git a/InnerDetector/InDetConditions/PixelCoralClientUtils/PixelCoralClientUtils/PixelCalibData.hh b/InnerDetector/InDetConditions/PixelCoralClientUtils/PixelCoralClientUtils/PixelCalibData.hh deleted file mode 100644 index 7a5fad1ad345f2e464db2bc90587dbf76857e3dc..0000000000000000000000000000000000000000 --- a/InnerDetector/InDetConditions/PixelCoralClientUtils/PixelCoralClientUtils/PixelCalibData.hh +++ /dev/null @@ -1,400 +0,0 @@ -/* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration -*/ - -/////////////////////////////////////////////////////////////////// -// PixelCalibData.hh, (c) ATLAS Detector software -/////////////////////////////////////////////////////////////////// - -#ifndef PIXELCALIBDATA_HH -#define PIXELCALIBDATA_HH - -#include <string> -#include <vector> -#include <iostream> -#include <algorithm> -#include <cmath> - -/** @class PixelCalibData - - The PixelCalibData is a class that designed to hold the calibration data for each module that contains - 16 FE PixelChipSummaryData. The calibration data consist of threshold, timewalk information and Time over - threshold calibration that averages per FE chip. The details can be found at - https://twiki.cern.ch/twiki/bin/view/Atlas/PixelCOOLoffline#Calibrations - . - - @author Weiming Yao <WMYAO@LBL.GOV> -*/ - -namespace PixelCoralClientUtils { - - -class PixelCalibData{ - - public: - /** Constructor:*/ - PixelCalibData(); - PixelCalibData(unsigned int ident,int nmax); - - /** default destructor */ - ~PixelCalibData () = default; - - const static int nPixelChipSummaryDataMax = 16; /** maximum number of chips per module */ - /** embedded class PixelChipSummaryData holds all the calibration data for a chip */ - - class PixelChipSummaryData { - - public: - PixelChipSummaryData(); - ~PixelChipSummaryData() = default; - - /** Methods to access the calibration data */ - int getChipID() const { return (int)m_chip; } //<! get the chip id inside a module from 0 to 15 - int getThreshold(int type) const; //<! get threshold for type=0/1/2 for standard,long and ganged pixels - int getThresholdSigma(int type) const; //<! get threshold sigma - int getNoise(int type) const; //<! get noise - int getTimeWalk(int type) const; //<! get time walk - float getQ2TotA(int type) const; //<! get charge to tot conversion constants A with Tot=A(Q+E)/(Q+C) - float getQ2TotE(int type) const; //<! get constants E - float getQ2TotC(int type) const; //<! get constants C - float getQ2Tot(int type, float Q) const; //<! conver Q to tot - float getTotP1() const; //<! get P1 parameter that parametrized the tot resolution sigma=P1 +p2*tot - float getTotP2() const; //<! get P2 parameter for tot resolution - float getTotRes(float Q) const; //<! get tot resolution for charge Q - - /** Methods to set the calibration data */ - void setChipID(int ichip); //<! set chip id - void setThreshold(int type, int thres, int sigma, int noise, int timewalk); //<! set threshold with inputs as int. - void setThreshold(int type, float thres, float sigma, float noise, float timewalk);//<! set threshold with inputs as float. - void setQ2Tot(int type, float A, float E, float C); //<! set charge to tot conversion constants - void setTotRes(float p1, float p2); //<! set tot resolution dependent constants - - // for packed format db, this has to be public -- A.X. - private: - char m_chip; //<! 0-15 which chip number - char m_threshold[4]; //<! one Word(thres, sigma, Noise,TW): - char m_thresholdlong[4]; //<! one Word(thres, sigma, Noise,TW) for long pixel - char m_thresholdganged[4]; //<! one Word(thres, sigma, Noise,TW) for ganged pixel - float m_q2tot[3]; //<! a,c,e for standard pixel and long - float m_q2totganged[3]; //<! a,b,c for ganged - char m_totres[2]; //<! for (p1, p2) each chip - - // alternative to public chip data -- A.X. - //friend int PixCoralClient::fillTablePixelCalibData(long long fk, const char* option); - //friend void PixCoralClient::getCalibrationDataFromDB(const char* option); - }; - - /** define const iterator defination */ - typedef std::vector<PixelChipSummaryData>::const_iterator PixelChipSummaryData_citer; - int size() const; - PixelChipSummaryData_citer cbegin() const; - PixelChipSummaryData_citer cend() const; - - /** define non-const iterator defination */ - typedef std::vector<PixelChipSummaryData>::iterator PixelChipSummaryData_iter; - PixelChipSummaryData_iter begin(); - PixelChipSummaryData_iter end(); - - /** return pointer to particular module */ - PixelChipSummaryData_citer findChipID(int ichip) const; - PixelChipSummaryData_iter findChipID(int ichip); - - /** return pointer to the identifier */ - unsigned int getModuleID() const; - int getNFEIX() const ; - - /** add a new member to the PixelCalibData */ - void add(const PixelChipSummaryData& idat); - bool update(const PixelChipSummaryData& idat); - void sortv(); - void print() const; - const PixelChipSummaryData* getPixelChipSummaryData(int circ) const; //<! get the pointer to iith PixelChipSummaryData - - protected: - unsigned int m_ident; //<! module identifier - int m_nfeix; // number of FEIX chips per module - std::vector<PixelChipSummaryData> m_vec; //<! data vector contains 0-15 PixelChipSummarydata per module -}; - -//CLASS_DEF(PixelCalibData, 27089939, 1) - -inline int PixelCalibData::PixelChipSummaryData::getThreshold(int type) const{ - // type=0/1/2 for standard, long and ganged pixels - if(type==1){ return m_thresholdlong[0]*30+3500;} - else if(type==2){ return m_thresholdganged[0]*30+3500;} - else{ return m_threshold[0]*30+3500;} -} - -inline int PixelCalibData::PixelChipSummaryData::getThresholdSigma(int type) const{ - // type=0/1/2 for standard, long and ganged pixels - if(type==1){ return m_thresholdlong[1]*3+300;} - else if(type==2){ return m_thresholdganged[1]*3+300;} - else{ return m_threshold[1]*3+300;} - } - - inline int PixelCalibData::PixelChipSummaryData::getNoise(int type) const{ - // type=0/1/2 for standard, long and ganged pixels - if(type==1){ return m_thresholdlong[2]*3+300;} - else if(type==2){ return m_thresholdganged[2]*3+300;} - else{ return m_threshold[2]*3+300;} - } - - inline int PixelCalibData::PixelChipSummaryData::getTimeWalk(int type) const{ - // type=0/1/2 for standard, long and ganged pixels - if(type==1){ return m_thresholdlong[3]*30+5000;} - else if(type==2){ return m_thresholdganged[3]*30+5000;} - else{ return m_threshold[3]*30+5000;} - } - - inline float PixelCalibData::PixelChipSummaryData::getQ2TotA(int type) const{ - // type=0/1/2 for standard, long and ganged pixels - if(type==2){ return m_q2totganged[0];} - else{ return m_q2tot[0];} - } - - inline float PixelCalibData::PixelChipSummaryData::getQ2TotE(int type) const{ - // type=0/1/2 for standard, long and ganged pixels - if(type==2){ return m_q2totganged[1];} - else{ return m_q2tot[1];} - } - - inline float PixelCalibData::PixelChipSummaryData::getQ2TotC(int type) const{ - // type=0/1/2 for standard, long and ganged pixels - if(type==2){ return m_q2totganged[2];} - else{ return m_q2tot[2];} - } - - inline float PixelCalibData::PixelChipSummaryData::getQ2Tot(int type, float Q) const{ - // type=0/1/2 for standard, long and ganged pixels - if(type==2){ return m_q2totganged[0]*(Q+m_q2totganged[1])/(Q+m_q2totganged[2]);} - else{ return m_q2tot[0]*(Q+m_q2tot[1])/(Q+m_q2tot[2]);} - } - - inline float PixelCalibData::PixelChipSummaryData::getTotP1() const{ return m_totres[0]* (1/100.); } - - inline float PixelCalibData::PixelChipSummaryData::getTotP2() const{ return m_totres[1]*(1./1000.); } - - inline float PixelCalibData::PixelChipSummaryData::getTotRes(float Q) const{ - float p1 = m_totres[0]*(1/100.0); - float p2 = m_totres[1]*(1/1000.0); - return p1+p2*Q; - } - - //Set Methods - inline void PixelCalibData::PixelChipSummaryData::setChipID(int ichip){ - m_chip = (char)ichip; } - - inline void PixelCalibData::PixelChipSummaryData::setThreshold(int type, float thres, float sigma, float noise, float timewalk){ - using std::abs; - int ax0 = ((int)thres-3500)/30; - if(abs(ax0)>127) ax0 = 127*ax0/abs(ax0); - int ax1 = ((int)sigma-300)/3; - if(abs(ax1)>127) ax1 = 127*ax1/abs(ax1); - int ax2 = ((int)noise-300)/3; - if(abs(ax2)>127) ax2 = 127*ax2/abs(ax2); - int ax3 = ((int)timewalk-5000)/30; - if(abs(ax3)>127) ax3 = 127*ax3/abs(ax3); - - if(type==0) { - m_threshold[0] = (char)ax0; - m_threshold[1] = (char)ax1; - m_threshold[2] = (char)ax2; - m_threshold[3] = (char)ax3; - } - if(type==1){ - m_thresholdlong[0] = (char)ax0; - m_thresholdlong[1] = (char)ax1; - m_thresholdlong[2] = (char)ax2; - m_thresholdlong[3] = (char)ax3; - } - if(type==2){ - m_thresholdganged[0] = (char)ax0; - m_thresholdganged[1] = (char)ax1; - m_thresholdganged[2] = (char)ax2; - m_thresholdganged[3] = (char)ax3; - } - } - - inline void PixelCalibData::PixelChipSummaryData::setThreshold(int type, int thres, int sigma, int noise, int timewalk){ - using std::abs; - int ax0 = (thres-3500)/30; - if(abs(ax0)>127) ax0 = 127*ax0/abs(ax0); - int ax1 = (sigma-300)/3; - if(abs(ax1)>127) ax1 = 127*ax1/abs(ax1); - int ax2 = (noise-300)/3; - if(abs(ax2)>127) ax2 = 127*ax2/abs(ax2); - int ax3 = (timewalk-5000)/30; - if(abs(ax3)>127) ax3 = 127*ax3/abs(ax3); - - if(type==0) { - m_threshold[0] = (char)ax0; - m_threshold[1] = (char)ax1; - m_threshold[2] = (char)ax2; - m_threshold[3] = (char)ax3; - } - if(type==1){ - m_thresholdlong[0] = (char)ax0; - m_thresholdlong[1] = (char)ax1; - m_thresholdlong[2] = (char)ax2; - m_thresholdlong[3] = (char)ax3; - } - if(type==2){ - m_thresholdganged[0] = (char)ax0; - m_thresholdganged[1] = (char)ax1; - m_thresholdganged[2] = (char)ax2; - m_thresholdganged[3] = (char)ax3; - } - } - - - - -inline void PixelCalibData::PixelChipSummaryData::setQ2Tot(int type, float A, float E, float C){ - if(type==0||type==1){ - m_q2tot[0] = A; - m_q2tot[1] = E; - m_q2tot[2] = C; - } - if(type==2){ - m_q2totganged[0] = A; - m_q2totganged[1] = E; - m_q2totganged[2] = C; - } -} - -inline void PixelCalibData::PixelChipSummaryData::setTotRes(float p1, float p2){ - - // careful with rounding -- A.X. - using std::abs; - int p1x = (int)roundf(p1*100); - if (p1x > 127) p1x = 127; - else if (p1x < -127) p1x = -127; - int p2x = (int)roundf(p2*1000); - if (p2x > 127) p2x = 127; - else if (p2x < -127) p2x = -127; - - m_totres[0] = (char)p1x; - m_totres[1] = (char)p2x; -} - - inline bool operator< (const PixelCalibData::PixelChipSummaryData& lhs, - const PixelCalibData::PixelChipSummaryData& rhs){ - - return lhs.getChipID()<rhs.getChipID(); -} - - inline PixelCalibData::PixelCalibData() - : m_ident(-1), m_nfeix(0), m_vec() -{ - m_vec.reserve(PixelCalibData::nPixelChipSummaryDataMax); -} - - inline PixelCalibData::PixelCalibData(unsigned int ident,int nmax ) - : - m_ident(ident), m_nfeix(nmax),m_vec() - { - m_vec.reserve(PixelCalibData::nPixelChipSummaryDataMax); - } - -inline void PixelCalibData::add(const PixelChipSummaryData& idat){ - m_vec.push_back(idat); - } - -inline bool PixelCalibData::update(const PixelChipSummaryData& idat){ - PixelChipSummaryData_iter it = findChipID(idat.getChipID()); - if(it==m_vec.end()) return false; - it->setThreshold(0,idat.getThreshold(0),idat.getThresholdSigma(0),idat.getNoise(0),idat.getTimeWalk(0)); - it->setThreshold(1,idat.getThreshold(1),idat.getThresholdSigma(1),idat.getNoise(1),idat.getTimeWalk(1)); - it->setThreshold(2,idat.getThreshold(2),idat.getThresholdSigma(2),idat.getNoise(2),idat.getTimeWalk(2)); - it->setQ2Tot(0, idat.getQ2TotA(0),idat.getQ2TotE(0),idat.getQ2TotC(0)); - it->setQ2Tot(2, idat.getQ2TotA(2),idat.getQ2TotE(2),idat.getQ2TotC(2)); - it->setTotRes(idat.getTotP1(), idat.getTotP2()); - return true; - } - -inline void PixelCalibData::print() const { - std::cout<< "PixelCalibData::print tagname:"<< m_ident<<" vector size "<<m_vec.size()<<std::endl; - // print out the calibration data for each chip - int i = 0; - for(PixelChipSummaryData_citer cit=cbegin(); cit !=cend(); ++cit){ - std::cout<<" Item: "<< i++<<" ChipId: "<<cit->getChipID() - <<" TotP1: "<<cit->getTotP1()<<" TotP2: "<<cit->getTotP2()<<std::endl - <<" Standard Pixel Threshold: "<<cit->getThreshold(0)<<" sigma: " - <<cit->getThresholdSigma(0)<<" noise:"<<cit->getNoise(0)<<" TimeWalk: " - <<cit->getTimeWalk(0)<<" Q2TotA: "<<cit->getQ2TotA(0)<<" Q2TotE: " - <<cit->getQ2TotE(0)<<" Q2TotC: "<<cit->getQ2TotC(0)<<std::endl - <<" Long Pixel Threshold: "<<cit->getThreshold(1)<<" sigma: " - <<cit->getThresholdSigma(1)<<" noise:"<<cit->getNoise(1)<<" TimeWalk: " - <<cit->getTimeWalk(1)<<" Q2TotA: "<<cit->getQ2TotA(1)<<" Q2TotE: " - <<cit->getQ2TotE(1)<<" Q2TotC: "<<cit->getQ2TotC(1)<<std::endl - <<" Ganged Pixel Threshold: "<<cit->getThreshold(2)<<" sigma: " - <<cit->getThresholdSigma(2)<<" noise:"<<cit->getNoise(2)<<" TimeWalk: " - <<cit->getTimeWalk(2)<<" Q2TotA: "<<cit->getQ2TotA(2)<<" Q2TotE: " - <<cit->getQ2TotE(2)<<" Q2TotC: "<<cit->getQ2TotC(2)<<std::endl; - } - } - -inline PixelCalibData::PixelChipSummaryData::PixelChipSummaryData(){ - // initialised to zero for all members - m_chip=0; - for(int i = 0; i<4; ++i){ - m_threshold[i] = 0; - m_thresholdlong[i] = 0; - m_thresholdganged[i] = 0; - if(i<3){ - m_q2tot[i] = 0.; - m_q2totganged[i] = 0.; - } - if(i<2)m_totres[i] = 0.; - } -} - - -inline int PixelCalibData::size() const - { return (int)m_vec.size();} - -inline PixelCalibData::PixelChipSummaryData_citer PixelCalibData::cbegin() const -{ return m_vec.begin();} - -inline PixelCalibData::PixelChipSummaryData_citer PixelCalibData::cend() const -{ return m_vec.end();} - -inline PixelCalibData::PixelChipSummaryData_iter PixelCalibData::begin() -{ return m_vec.begin();} - -inline PixelCalibData::PixelChipSummaryData_iter PixelCalibData::end() -{ return m_vec.end();} - -inline PixelCalibData::PixelChipSummaryData_citer -PixelCalibData::findChipID(int ichip) const{ - PixelCalibData::PixelChipSummaryData obj; - obj.setChipID(ichip); - PixelCalibData::PixelChipSummaryData_citer rc =std::lower_bound(m_vec.begin(),m_vec.end(),obj); - if(rc !=m_vec.end()&&rc->getChipID()!=ichip) rc = m_vec.end(); - return rc; -} - -inline PixelCalibData::PixelChipSummaryData_iter -PixelCalibData::findChipID(int ichip) { - PixelCalibData::PixelChipSummaryData obj; - obj.setChipID(ichip); - PixelCalibData::PixelChipSummaryData_iter rc =std::lower_bound(m_vec.begin(),m_vec.end(),obj); - if(rc !=m_vec.end()&&rc->getChipID()!=ichip) rc = m_vec.end(); - return rc; -} - -inline unsigned int PixelCalibData::getModuleID() const { return m_ident;} - -inline int PixelCalibData::getNFEIX() const { return m_nfeix;} - -inline void PixelCalibData::sortv(){ - sort(m_vec.begin(), m_vec.end()); } - -inline const PixelCalibData::PixelChipSummaryData* PixelCalibData::getPixelChipSummaryData(int circ) const{ // ith chip - if(circ>=(int)m_vec.size())return 0; - return &m_vec[circ]; -} - - -} -#endif // PIXELCALIBDATA_HH diff --git a/InnerDetector/InDetConditions/PixelCoralClientUtils/PixelCoralClientUtils/PixelMap.h b/InnerDetector/InDetConditions/PixelCoralClientUtils/PixelCoralClientUtils/PixelMap.h deleted file mode 100644 index 4ee5f1ff0b47f1d5deb2e17ae9ff0b138a56fc6a..0000000000000000000000000000000000000000 --- a/InnerDetector/InDetConditions/PixelCoralClientUtils/PixelCoralClientUtils/PixelMap.h +++ /dev/null @@ -1,31 +0,0 @@ -/* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration -*/ - -#ifndef _PIXELMAP_hh_ -#define _PIXELMAP_hh_ - -#include <vector> -#include <map> - -/* class Pixel_t */ -/* { */ -/* public: */ -/* Pixel_t(const unsigned int row, const unsigned int column, */ -/* const unsigned int status) */ -/* : m_row(row), m_column(column), m_status(status) */ -/* {} */ -/* const unsigned int row() const { return m_row; } */ -/* const unsigned int column() const { return m_column; } */ -/* const unsigned int status() const { return m_status; } */ -/* private: */ -/* unsigned int m_row; */ -/* unsigned int m_column; */ -/* unsigned int m_status; */ -/* }; */ - -//typedef std::vector< Pixel_t > PixelMap_t; - -typedef std::map< std::pair<int, int>, unsigned int > PixelMap_t; // mapping 2D index (col,row) to status - -#endif diff --git a/InnerDetector/InDetConditions/PixelCoralClientUtils/PixelCoralClientUtils/SpecialPixelMap.hh b/InnerDetector/InDetConditions/PixelCoralClientUtils/PixelCoralClientUtils/SpecialPixelMap.hh deleted file mode 100644 index b857b789885528f700f9c60542492626983667fb..0000000000000000000000000000000000000000 --- a/InnerDetector/InDetConditions/PixelCoralClientUtils/PixelCoralClientUtils/SpecialPixelMap.hh +++ /dev/null @@ -1,363 +0,0 @@ -/* - Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration -*/ - -//**************************************************************************** -// SpecialPixelMap.hh -// -// Classes to hold data about special pixels in the detector store and make it -// accessible to athena components. -// -// author Christoph Ruwiedel <ruwiedel@physik.uni-bonn.de> -// - -#ifndef SPECIALPIXELMAP_HH -#define SPECIALPIXELMAP_HH - -#include "CoralBase/Blob.h" -#include "CxxUtils/checker_macros.h" - -#include<map> -#include<vector> -#include<string> -#include<iostream> - -class ModuleSpecialPixelMap; -class SpecialPixelMapSvc; - -namespace PixelCoralClientUtils { - - //static unsigned int columnsPerFEI3 = 18; // number of columns per FEI3 - //static unsigned int rowsPerFEI3 = 164; // number of rows per FEI3 - //static unsigned int FEI3sPerModule = 16; // number of FEI3s in a row - //static unsigned int columnsPerFEI4 = 80; // number of columns per FEI4 - //static unsigned int rowsPerFEI4 = 336; // number of rows per FEI4 - const unsigned int nmtype(5); - static const unsigned int columnsPerFEIX[5]={18,80,132,80,132}; // number of columns per FEI3, 4, 50, 51, 52 - static const unsigned int rowsPerFEIX[5]={164, 336, 672, 339, 678}; // number of rows per FEI3, 4, 50, 51, 52 - static const unsigned int rowsRdoPerFEIX[5]={160, 336, 672, 336, 672}; // number of rows readout per FEI3, 4, 50, 51, 52 - -class ModuleSpecialPixelMap; - -/** A class for a map of special pixels for the whole pixel detector, - or any subgroup of modules. A DetectorSpecialPixelMap is - std::vector of pointers to ModuleSpecialPixelMaps which hold the - actual pixel status codes. A ModuleSpecialPixelMap is accessed by - its IdentifierHash. -*/ - -class DetectorSpecialPixelMap : public std::vector<ModuleSpecialPixelMap*>{ - - public: - DetectorSpecialPixelMap(); - DetectorSpecialPixelMap(const DetectorSpecialPixelMap& dspm); //!< construct a copy - DetectorSpecialPixelMap(const std::vector<ModuleSpecialPixelMap*>& modules); //!< construct from contents - virtual ~DetectorSpecialPixelMap(); - - DetectorSpecialPixelMap& operator=(const DetectorSpecialPixelMap& spm); - DetectorSpecialPixelMap& operator+=(const DetectorSpecialPixelMap& spm); //!< merge two pixel maps into one - void merge(const DetectorSpecialPixelMap* spm); //!< operation equivalent to operator+=, but more convenient for pointers - - const ModuleSpecialPixelMap* module(unsigned int moduleHash) const; //!< const access to a ModuleSpecialPixelMap* - - void markSpecialRegions(); - //!< automatically identify regions of pixels with the same status and mark them - void setNeighbourFlags(); - //!< fill the information about special neighbouring pixels, bits 25 - 28 - - void clear(); - - private: - void erase(iterator); - void erase(iterator, iterator); - -}; - -/** A class for a map of special pixels for a single module of the - pixel detector. A ModuleSpecialPixelMap is a std::map of the - status codes (unsigned integers) for all pixels with special - properties on a module. The possible status codes are explained on - a wiki page: - https://twiki.cern.ch/twiki/bin/view/Atlas/PixelCOOLoffline#Dead_and_special_pixels_map - - The status for a pixel can be retrieved with - pixelStatus(pixelID). The pixel ID can be calculated with - encodePixelID. In addition to pixelStatus, several accessors for - individual status bits are provided. - - NOTE: pixelid = row*128*2 + column*2 + chip for FEI4 - unsigned int hashID = ( ((m_pixelID->barrel_ec(moduleID) + 4) / 2) << 26 ) + - ( m_pixelID->layer_disk(moduleID) << 24) + - ( m_pixelID->phi_module(moduleID) << 18) + - ( (m_pixelID->eta_module(moduleID) + 10) << 13); - - pixelid = row*32*16 + column*16 + chip for FEI3 - - unsigned int hashID = ( ((m_pixelID->barrel_ec(moduleID) + 2) / 2) << 25 ) + - ( m_pixelID->layer_disk(moduleID) << 23) + - ( m_pixelID->phi_module(moduleID) << 17) + - ( (m_pixelID->eta_module(moduleID) + 6) << 13); - -**/ - -class ModuleSpecialPixelMap : private std::map<unsigned int, unsigned int>{ - - public: - friend class ::ModuleSpecialPixelMap; - friend class ::SpecialPixelMapSvc; - - ModuleSpecialPixelMap(); - ModuleSpecialPixelMap(const ModuleSpecialPixelMap& mspm); - //!< construct a copy - ModuleSpecialPixelMap(const char* filename, unsigned int mchips); - //!< construct from text file (for details on the format see the README file in PixelConditionsServices/doc) - ModuleSpecialPixelMap(const std::string& clob, unsigned int mchips); - //!< construct from string - ModuleSpecialPixelMap(const coral::Blob& blob, unsigned int mchips); - //!< construct from blob - ModuleSpecialPixelMap(const std::map<unsigned int, unsigned int>& pixels, - unsigned int module_status, - const std::vector<unsigned int>& chip_status, - const std::vector<std::vector<unsigned int> >& column_pair_status,unsigned int mchips = 16); - //!< construct from contents - virtual ~ModuleSpecialPixelMap(); - - ModuleSpecialPixelMap& operator=(const ModuleSpecialPixelMap& mspm); - ModuleSpecialPixelMap& operator+=(ModuleSpecialPixelMap mspm); - //!< merge two pixel maps into one - - void merge(const ModuleSpecialPixelMap* mspm); //!< operation equivalent to operator+=, but more convenient for pointers - - unsigned int pixelStatus(unsigned int pixelID) const; //!< retrieve pixel status as unsigned int - bool pixelStatusBit(unsigned int pixelID, unsigned int bit) const; //!< retrieve a single status bit - bool pixelUseful(unsigned int pixelID) const; //!< retrieve negation of bit 0 (pixel useful or not) - bool pixelNoisy(unsigned int pixelID) const; //!< retrieve content of bit 15 (pixel noisy or not) - - /** only different from 0 if all pixels on the module have the same status and special regions have been marked */ - unsigned int moduleStatus() const; //!< retrieve module status as unsigned int - /** only different from 0 if all pixels on the chip have the same status and special regions have been marked */ - unsigned int chipStatus(unsigned int chip) const; //!< retrieve chip status as unsigned int - /** only different from 0 if all pixels in the column pair have the same status and special regions have been marked */ - unsigned int columnPairStatus(unsigned int chip, unsigned int column_pair) const; //!< retrieve column pair status as unsigned int - - std::string to_string() const; - //!< convert pixel map to string, used when preparing database write - coral::Blob* to_blob() const; - //!< convert pixel map to blob, used when preparing database write - virtual void print(int component, unsigned int layer, unsigned int phi, int eta, - bool verbosePixelID = true, bool binaryPixelStatus = true) const; - //!< print map to screen - - static unsigned int pixelType(unsigned int column, unsigned int row, unsigned int mchips = 16); - //static unsigned int pixelType(unsigned int column, unsigned int row); - - //!< returns pixel type (normal, long etc.) -- global - static std::vector<unsigned int> decodePixelID(unsigned int pixelID, unsigned int type); - static unsigned int encodePixelID(unsigned int chip, unsigned int column, unsigned int row, unsigned int mchips); - static unsigned int encodePixelID(unsigned int chip, unsigned int column, unsigned int row); - - //!< returns pixel ID to be used in accessors - static unsigned int encodePixelID(int component, unsigned int module_phi_index, - unsigned int pixel_eta_index, unsigned int pixel_phi_index, unsigned int mchips); - // static unsigned int encodePixelID(int component, unsigned int module_phi_index, - // unsigned int pixel_eta_index, unsigned int pixel_phi_index); - - //!< returns pixel ID to be used in accessors - - void setPixelStatus(unsigned int pixelID, unsigned int status); - void setPixelStatusBit(unsigned int pixelID, unsigned int bit); - void clearPixelStatusBit(unsigned int pixelID, unsigned int bit); - void setPixelNotUseful(unsigned int pixelID); //!< set pixel status bit 0 - void setPixelUseful(unsigned int pixelID); //!< clear pixel status bit 0 - void setPixelNoisy(unsigned int pixelID); //!< set pixel status bit 15 - void setPixelNotNoisy(unsigned int pixelID); //!< clear pixel status bit 15 - - void setModuleStatus(unsigned int status); - //!< set module status, clears single pixel information if argument != 0 - void setChipStatus(unsigned int chip, unsigned int status); - //!< set chip status, clears single pixel information if argument != 0 - void setColumnPairStatus(unsigned int chip, unsigned int column_pair, unsigned int status); - //!< set column pair status, clears single pixel information if argument != 0 - - bool fill_from_string(const std::string& clob); - //!< fills the map from a string, used for conversion of data from the database - bool fill_from_blob(const coral::Blob& blob); - //!< fills the map from a blob, used for conversion of data from the database - - bool validPixelID(unsigned int chip, unsigned int column, unsigned int row) const; - //!< checks whether the pixel ID is in the allowed range - bool validPixelID(unsigned int pixel_eta_index, unsigned int pixel_phi_index) const; - //!< checks whether the pixel ID is in the allowed range - bool validPixelID(unsigned int pixelID) const; - //!< checks whether the pixel ID is in the allowed range - - void markSpecialRegions(); - //!< automatically identify regions of pixels with the same status and mark them - void setNeighbourFlags(); - //!< fill the information about special neighbouring pixels, bits 25 - 28 - - typedef std::map<unsigned int, unsigned int>::iterator iterator; - //!< std::map iterators are forwarded for access to all special pixels on a module - //!< These iterate *only* over the special pixels that are *not* in a special region, one has to check special regions independently - typedef std::map<unsigned int, unsigned int>::const_iterator const_iterator; - //!< std::map iterators are forwarded for access to all special pixels on a module - //!< These iterate *only* over the special pixels that are *not* in a special region, one has to check special regions independently - - typedef std::map<unsigned int, unsigned int>::size_type size_type; - - size_type size() const; - //!< only for special pixels that are not in a special region - bool empty() const; - //!< only for special pixels that are not in a special region - - iterator begin(); - //!< only for special pixels that are not in a special region, need to check special regions separately - const_iterator begin() const; - //!< only for special pixels that are not in a special region, need to check special regions separately - - iterator end(); - //!< only for special pixels that are not in a special region, need to check special regions separately - const_iterator end() const; - //!< only for special pixels that are not in a special region, need to check special regions separately - - unsigned int chipsPerModule() const; - unsigned int chipType() const; - - void setchipsPerModule(unsigned int chipsPerModule); - unsigned int columnsPerChip() const; - unsigned int rowsPerChip() const; - unsigned int rowsrdoPerChip() const; - - - bool hasSpecialChips() const; - //!< true if there are any special frontends on the module - bool hasSpecialColumnPairs() const; - //!< true if there are any special column pairs on the module - bool hasSpecialColumnPairs(unsigned int chip) const; - //!< true if there are any special column pairs on frontend 'chip' - - private: - unsigned int m_chipsPerModule; // decoded the number of chips*10 + chip type(0=FEI3, 1=FEI4, 2=FEI50, 3=FEI51, 4=FEI52) - unsigned int m_module_status; - std::vector<unsigned int> m_chip_status; - std::vector<std::vector<unsigned int> > m_column_pair_status; - - void resetSpecialRegions(); - void condResetSpecialRegions(unsigned int pixelID, unsigned status); - -}; - - - -// inline functions - -inline bool ModuleSpecialPixelMap::pixelUseful(unsigned int pixelID) const{ - return !pixelStatusBit(pixelID, 0); -} - -inline bool ModuleSpecialPixelMap::pixelNoisy(unsigned int pixelID) const{ - return pixelStatusBit(pixelID, 15); -} - -inline unsigned int ModuleSpecialPixelMap::moduleStatus() const{ - return m_module_status; -} - -inline unsigned int ModuleSpecialPixelMap::chipStatus(unsigned int chip) const{ - if(chip < m_chipsPerModule/10){ - if(m_chip_status.size() != 0){ - return m_chip_status[chip]; - } - else{ - return 0; - } - } - else{ - std::cout << "In ModuleSpecialPixelMap::chipStatus(unsigned int): Chip number "<<chip<< " > "<<m_chipsPerModule<< " requested " << std::endl; - return 0; - } -} - -inline unsigned int ModuleSpecialPixelMap::columnPairStatus(unsigned int chip, unsigned int column_pair) const{ - unsigned int itype = std::min(m_chipsPerModule%10,nmtype-1); - if(chip < (m_chipsPerModule/10) && column_pair < (columnsPerFEIX[itype]/2)){ - if(m_column_pair_status.size() != 0 && m_column_pair_status[chip].size() != 0){ - return m_column_pair_status[chip][column_pair]; - } - else{ - return 0; - } - } - else{ - std::cout << "Invalid chip/column pair combination requested" << std::endl; - return 0; - } -} - -inline void ModuleSpecialPixelMap::setPixelNotUseful(unsigned int pixelID){ - setPixelStatusBit(pixelID, 0); - return; -} - -inline void ModuleSpecialPixelMap::setPixelUseful(unsigned int pixelID){ - clearPixelStatusBit(pixelID, 0); - return; -} - -inline void ModuleSpecialPixelMap::setPixelNoisy(unsigned int pixelID){ - setPixelStatusBit(pixelID, 15); - return; -} - -inline void ModuleSpecialPixelMap::setPixelNotNoisy(unsigned int pixelID){ - clearPixelStatusBit(pixelID, 15); - return; -} - -inline bool ModuleSpecialPixelMap::validPixelID(unsigned int pixelID) const{ - int i = m_chipsPerModule%10; - return i==0 ? validPixelID(pixelID % 16, (pixelID & (31 << 4))/16, pixelID/512): validPixelID(pixelID % 16, (pixelID & (255 << 4))/16, pixelID/4096); -} - -inline bool ModuleSpecialPixelMap::validPixelID(unsigned int chip, unsigned int column, unsigned int row) const{ - unsigned int itype = std::min(m_chipsPerModule%10,nmtype-1); - return (chip<(m_chipsPerModule/10)&&column<columnsPerFEIX[itype]&&row<rowsPerFEIX[itype]) ? true : false; -} - -inline bool ModuleSpecialPixelMap::validPixelID(unsigned int pixel_eta_index, unsigned int pixel_phi_index) const{ - unsigned int i = std::min(m_chipsPerModule%10,nmtype-1); - int m = m_chipsPerModule/10; - unsigned int rowsMax = m>2 ? 2*rowsPerFEIX[i] : rowsPerFEIX[i]; - unsigned int columnsMax = m>2 ? m/2*columnsPerFEIX[i] : m*columnsPerFEIX[i]; - return (pixel_eta_index<columnsMax&&pixel_phi_index<rowsMax)?true:false; -} - -inline unsigned int ModuleSpecialPixelMap::chipsPerModule() const{ - return m_chipsPerModule/10; -} - -inline unsigned int ModuleSpecialPixelMap::chipType() const{ - return m_chipsPerModule%10; -} - -inline void ModuleSpecialPixelMap::setchipsPerModule(unsigned int chipsPerModule){ - m_chipsPerModule = chipsPerModule; -} - -inline unsigned int ModuleSpecialPixelMap::columnsPerChip() const{ - unsigned int itype = std::min(m_chipsPerModule%10,nmtype-1); - return columnsPerFEIX[itype]; -} - -inline unsigned int ModuleSpecialPixelMap::rowsPerChip() const{ - unsigned int itype = std::min(m_chipsPerModule%10,nmtype-1); - return rowsPerFEIX[itype]; -} - -inline unsigned int ModuleSpecialPixelMap::rowsrdoPerChip() const{ - unsigned int itype = std::min(m_chipsPerModule%10,nmtype-1); - return rowsRdoPerFEIX[itype]; -} - -} // namespace PixelCoralClientUtils -#endif // SPECIALPIXELMAP_HH diff --git a/InnerDetector/InDetConditions/PixelCoralClientUtils/cmt/pcd.sh b/InnerDetector/InDetConditions/PixelCoralClientUtils/cmt/pcd.sh deleted file mode 100755 index cae295a9a6be9e4bc56e959fb475cc84eb7563d6..0000000000000000000000000000000000000000 --- a/InnerDetector/InDetConditions/PixelCoralClientUtils/cmt/pcd.sh +++ /dev/null @@ -1,156 +0,0 @@ -#!/bin/bash -# -# PCDio wrapper -# - -err () { - echo '*' commands: - echo - echo $0 init tag[:rev] [filename] - echo '*' create a new calibration tag=tag, revision=rev, origin=file:filename from the text file filename. By default rev=1, filename=pcd.dat . - echo - echo $0 copy tag[:rev] oldtag[:oldrev] - echo '*' create a new calibration tag=tag, revision=rev, origin=\"oldtag:oldrev\" from existing calibration tag=oldtag, revision=oldrev. By default rev=1, oldrev=largest available revision for tag oldtag. - echo - echo $0 update tag[:rev] analid [opt] - echo '*' take the calibration tag=tag, revision=rev, apply analisys analid, and create a new calibration tag=tag, revision=largest available revision + 1, origin=\"tag:rev:analid\". By default rev=largest available revision. opt=option accepted by extractAnalysis. - echo - #echo $0 list [tag] - #echo '*' list calibrations which exist for tag tag. By default, list all existing calibrations. - #echo - echo $0 dump tag[:rev] [filename] - echo '*' dump calibration tag=tag, revision=rev to the text file filename. By default rev=largest available revision, filename=pcd.dat . - exit 1 -} - -# -# tag:rev parser -# - -parse_tagrev () { - have_rev=yes - tag=${tagrev%:*} - rev=${tagrev#*:} - if [[ $tag == $tagrev ]]; then - have_rev=no - rev=1 - fi -} - -# -# main switch -# - -if [[ $# -lt 1 ]]; then - err -fi - -case $1 in -init) - if [[ $# -lt 2 ]]; then - err - fi - - filename= - if [[ $# -ge 3 ]]; then - filename=$3 - if [[ -e $filename ]]; then - cp $filename pcd.dat - else - echo file $filename does not exist - exit 1 - fi - fi - - tagrev=$2 - parse_tagrev - - echo talkToPCDDb -s $tag $rev file:$filename - talkToPCDDb -s $tag $rev file:$filename - ;; - -copy) - if [[ $# -lt 3 ]]; then - err - fi - - tagrev=$2 - parse_tagrev - newtag=$tag - newrev=$rev - - tagrev=$3 - parse_tagrev - - if [[ $have_rev == yes ]]; then - talkToPCDDb -r $tag $rev - else - talkToPCDDb -r $tag - rev=`cat pcd.rev` - fi - mv pcd.sav pcd.dat - echo talkToPCDDb -s $newtag $newrev $tag:$rev - talkToPCDDb -s $newtag $newrev $tag:$rev - ;; - -update) - if [[ $# -lt 3 ]]; then - err - fi - - tagrev=$2 - parse_tagrev - talkToPCDDb -r $tag - newrev=`cat pcd.rev` - if [[ $have_rev == yes ]]; then - talkToPCDDb -r $tag $rev - fi - newrev=$[$newrev + 1] - mv pcd.sav pcd.dat - - analid=$3 - opt= - if [[ $# -ge 4 ]]; then - opt=$4 - fi - - temp=$CAN_CALIB_DB - export CAN_CALIB_DB=oracle://ATLAS_COOLPROD/ATLAS_COOLONL_PIXEL - echo extractAnalysis $opt $analid - extractAnalysis $opt $analid - export CAN_CALIB_DB=$temp - mv pcd.sav pcd.dat - echo talkToPCDDb -s $tag $newrev $tag:$rev:$analid - talkToPCDDb -s $tag $newrev $tag:$rev:$analid - ;; - -list) - ;; - -dump) - if [[ $# -lt 2 ]]; then - err - fi - - tagrev=$2 - parse_tagrev - if [[ $have_rev == yes ]]; then - talkToPCDDb -r $tag $rev - else - talkToPCDDb -r $tag - fi - mv pcd.sav pcd.dat - - if [[ $# -ge 3 ]]; then - filename=$3 - cp pcd.dat $filename - fi - ;; - -*) - echo pcd: unrecognized command $1 - err - -esac - -exit 0 diff --git a/InnerDetector/InDetConditions/PixelCoralClientUtils/cmt/probe_fill.src b/InnerDetector/InDetConditions/PixelCoralClientUtils/cmt/probe_fill.src deleted file mode 100644 index 8719dab0c79b6b21e12eaed6c2957a629ad9beb8..0000000000000000000000000000000000000000 --- a/InnerDetector/InDetConditions/PixelCoralClientUtils/cmt/probe_fill.src +++ /dev/null @@ -1,8 +0,0 @@ -rm -rf testdb.sql -export CAN_CALIB_DB="sqlite_file:testdb.sql" -CORAL-fill 1 "tag:mytag revision:1234 sources:Offline:0 file:pixelcalibsvc_dump.txt" -CORAL-fill 1 "tag:mytag1 revision:5678 sources:Offline:0 file:pixelcalibsvc_dump_assembly_02.txt" -echo "========= reading first calibration =========" -CORAL-read 1 "tag:mytag revision:1234" -echo "========= reading second calibration =========" -CORAL-read 1 "tag:mytag1 revision:5678" diff --git a/InnerDetector/InDetConditions/PixelCoralClientUtils/cmt/talkToPCDDb_example.sh b/InnerDetector/InDetConditions/PixelCoralClientUtils/cmt/talkToPCDDb_example.sh deleted file mode 100755 index 56a637c51b63e9648f25630e560f06c4ee110d43..0000000000000000000000000000000000000000 --- a/InnerDetector/InDetConditions/PixelCoralClientUtils/cmt/talkToPCDDb_example.sh +++ /dev/null @@ -1,12 +0,0 @@ -############################################################################### -#!/bin/sh -############################################################################### - -rm -f testdb.sql - -export CAN_CALIB_DB="sqlite_file:testdb.sql" -#export CAN_CALIB_DB=oracle://devdb10/atlas_pixel_khanov - -./pcd.sh init mytag pixelcalibsvc_dump_assembly_02.txt -./pcd.sh update mytag 5620 -t -./pcd.sh copy mytag1 mytag diff --git a/InnerDetector/InDetConditions/PixelCoralClientUtils/cmt/talkToPCDkr_example.sh b/InnerDetector/InDetConditions/PixelCoralClientUtils/cmt/talkToPCDkr_example.sh deleted file mode 100755 index 0c53d5d732e68ae880e0909f41aeb9cb7c91e2b3..0000000000000000000000000000000000000000 --- a/InnerDetector/InDetConditions/PixelCoralClientUtils/cmt/talkToPCDkr_example.sh +++ /dev/null @@ -1,15 +0,0 @@ -############################################################################### -#!/bin/sh -############################################################################### - -rm -f testdb.sql - -export CAN_CALIB_DB="sqlite_file:testdb.sql" -#export CAN_CALIB_DB=oracle://devdb10/atlas_pixel_khanov - -talkToPCDkr -s hello/world mytag -talkToPCDkr -s hello/again mytag1 -talkToPCDkr -s hello/oncemore mytag2 -talkToPCDkr -r -talkToPCDkr -v hello/again -talkToPCDkr -r diff --git a/InnerDetector/InDetConditions/PixelCoralClientUtils/example/calibDbInterface_example.sh b/InnerDetector/InDetConditions/PixelCoralClientUtils/example/calibDbInterface_example.sh deleted file mode 100755 index ba29a85ee30380747c6ea113fa68e2a9560fde01..0000000000000000000000000000000000000000 --- a/InnerDetector/InDetConditions/PixelCoralClientUtils/example/calibDbInterface_example.sh +++ /dev/null @@ -1,12 +0,0 @@ -############################################################################### -#!/bin/sh -############################################################################### - -export PATH=$PATH:$PWD/../i686-slc5-gcc43-opt/calibDbInterface.exe - -export PIXEL_CAL_KNOWLEDGE="oracle://INTR/ATLAS_MLIMPER" -#export PIXEL_CAL_KNOWLEDGE="oracle://DEVDB10/ATLAS_COOL_MLIMPER" -#export PIXEL_CAL_KNOWLEDGE="sqlite_file:/detpriv/pix/data/PixCalibDataOffline/pcd_knowledge.db" - -#store the latest updated calibration strings -calibDbInterface.exe -s PixCalib-BLKP-UPD4-000-01 string2 string3 diff --git a/InnerDetector/InDetConditions/PixelCoralClientUtils/src/CORAL-create.cc b/InnerDetector/InDetConditions/PixelCoralClientUtils/src/CORAL-create.cc deleted file mode 100644 index 8648d4f79c9cb9c77a0038c1ec54e1bde3e2ab44..0000000000000000000000000000000000000000 --- a/InnerDetector/InDetConditions/PixelCoralClientUtils/src/CORAL-create.cc +++ /dev/null @@ -1,53 +0,0 @@ -/* - Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration -*/ - -#include "CxxUtils/checker_macros.h" -#include "PixelCoralClientUtils/CoralClient.hh" - -int main (int argc, char **argv){ -//printf("COOL-create starting \n"); - - - // -------------------------------------------------- - // Main part - // -------------------------------------------------- - - try { - - // Start CORAL client - printf("CORAL-create starting \n"); -// PixCoralClient coralClient(coralConnStr,app.context()); - const char* tableName = argc>1 ? "CALIB_DATA" : "CALIB_ANAL"; - PixCoralClient coralClient(true, coral::Update, tableName); - - //coralClient.dropTables(); - if (argc>1) { - coralClient.createTables(argv[1]); - } else { - coralClient.createTables(); - } - // coralClient.fillCoralTables(); - std::cout << "DONE" << std::endl; - } - - // COOL, CORAL POOL exceptions inherit from std exceptions: catching - // std::exception will catch all errors from COOL, CORAL and POOL - - catch ( std::exception& e ) { - std::cout << "std::exception caught: " << e.what() << std::endl; - return -1; - } - - catch (...) { - std::cout << "Unknown exception caught!" << std::endl; - return -1; - } - - return 0; - -} - - - - diff --git a/InnerDetector/InDetConditions/PixelCoralClientUtils/src/CORAL-fill.cc b/InnerDetector/InDetConditions/PixelCoralClientUtils/src/CORAL-fill.cc deleted file mode 100644 index 9d232774da87636bc1f91d02341c4f6ba2999853..0000000000000000000000000000000000000000 --- a/InnerDetector/InDetConditions/PixelCoralClientUtils/src/CORAL-fill.cc +++ /dev/null @@ -1,86 +0,0 @@ -/* - Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration -*/ - -#include "CxxUtils/checker_macros.h" -#include "PixelCoralClientUtils/CoralClient.hh" - -int main (int argc, char **argv){ - //printf("CORAL-fill starting \n"); - - CAN::SerialNumber_t anal_id = 123456789; - if (argc > 1) anal_id = atoi(argv[1]); - - - // -------------------------------------------------- - // Main part - // -------------------------------------------------- - - try { - - // Start CORAL client - printf("CORAL-fill starting \n"); -// PixCoralClient coralClient(coralConnStr,app.context()); - const char* tableName = argc>2 ? "CALIB_DATA" : "CALIB_ANAL"; - PixCoralClient coralClient(true, coral::Update, tableName); - - if (argc>2) { - coralClient.fillTables(argv[2]); - } else { - CAN::AnalysisResultList_t results; - results.addValue("a_value","ROD_test",false); - results.addValue("Status","Some module",true); - results.addValue("Status","Other module",false); - results.addValue<float>("aFloat","Other module",111); - results.addValue<unsigned int>("Myint","New module",43); - CAN::AverageResult_t avRes(3,13.4,2.3,2,50.2); - results.addValue("FirstAv","AV module",avRes); - - PixelMap_t pixelmap; - pixelmap[std::make_pair(2,3)]=4; //CLA - pixelmap[std::make_pair(3,3)]=4; - pixelmap[std::make_pair(3,23)]=4; -// special column pairs -// for (int i=0; i<160; ++i) { -// pixelmap.push_back(CAN::Pixel_t(i,0,3)); -// pixelmap.push_back(CAN::Pixel_t(i,1,3)); -// pixelmap.push_back(CAN::Pixel_t(i,24,5)); -// pixelmap.push_back(CAN::Pixel_t(i,25,5)); -// } -// special chip -// for (int i=160; i<320; ++i) { -// for (int j=36; j<54; ++j) { -// pixelmap.push_back(CAN::Pixel_t(i,j,6)); -// } -// } -// special module -// for (int i=0; i<320; ++i) { -// for (int j=0; j<144; ++j) { -// pixelmap.push_back(CAN::Pixel_t(i,j,7)); -// } -// } - results.addValue("Map","this module",pixelmap); - coralClient.fillTables(anal_id, &results); - } - - } - - // COOL, CORAL POOL exceptions inherit from std exceptions: catching - // std::exception will catch all errors from COOL, CORAL and POOL - catch ( std::exception& e ) { - std::cout << "std::exception caught: " << e.what() << std::endl; - return -1; - } - - catch (...) { - std::cout << "Unknown exception caught!" << std::endl; - return -1; - } - - return 0; - -} - - - - diff --git a/InnerDetector/InDetConditions/PixelCoralClientUtils/src/CORAL-listVariables.cc b/InnerDetector/InDetConditions/PixelCoralClientUtils/src/CORAL-listVariables.cc deleted file mode 100644 index c6299af218261a0acfa060175d565dc48afbce6f..0000000000000000000000000000000000000000 --- a/InnerDetector/InDetConditions/PixelCoralClientUtils/src/CORAL-listVariables.cc +++ /dev/null @@ -1,102 +0,0 @@ -/* - Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration -*/ - -#include "CxxUtils/checker_macros.h" -#include "PixelCoralClientUtils/CoralClient.hh" -#include <string> -#include <vector> -#include <cstring> - - - class DummyCoralClientListener : public IPixResultsDbListener { - public: - - protected: - void newValue(const std::string &var_name, const std::string &conn_name, bool value) { - std::cout << "INFO [DummyCoralClientListener::newValue<bool>] var_name = " << var_name << ", conn_name = " << conn_name - << " value = " << (value ? "true" : "false") << std::endl; - } - void newValue(const std::string &var_name, const std::string &conn_name, unsigned int value) { - std::cout << "INFO [DummyCoralClientListener::newValue<unsigned int>] var_name = " << var_name << ", conn_name = " << conn_name - << " value = " << value << std::endl; - } - void newValue(const std::string &var_name, const std::string &conn_name, float value) { - std::cout << "INFO [DummyCoralClientListener::newValue<float>] var_name = " << var_name << ", conn_name = " << conn_name - << " value = " << value << std::endl; - } - void newValue(const std::string &var_name, const std::string &conn_name, const CAN::AverageResult_t &value) { - std::cout << "INFO [DummyCoralClientListener::newValue<AverageResult_t>] var_name = " << var_name << ", conn_name = " << conn_name - << " value = " << value.value(CAN::AverageResult_t::kLower99) - << " < " << value.value(CAN::AverageResult_t::kMean) << " +- " << value.value(CAN::AverageResult_t::kRMS) - << " < " << value.value(CAN::AverageResult_t::kUpper99) - << std::endl; - } - void newValue(const std::string &var_name, const std::string &conn_name, const PixelMap_t & value) { - std::cout << "INFO [DummyCoralClientListener::newValue<PixelMap_t>] var_name = " << var_name << ", conn_name = " << conn_name<< std::endl; - std::cout<< " row/column status"<< std::endl; - for (PixelMap_t::const_iterator it=value.begin(); it != value.end(); ++it) - std::cout<<" "<<(*it).first.second<<"/"<<(*it).first.first<<" "<<(*it).second<< std::endl;//CLA - } - }; - - -int main (int argc, char **argv){ - - CAN::SerialNumber_t analysis_id = 0; - std::vector<std::string> connectivity_name; - bool error=false; - - for (int arg_i=1; arg_i<argc; arg_i++) { - if (strcmp(argv[arg_i],"-s")==0 && arg_i+1<argc && argv[arg_i+1][0]!='-') { - analysis_id = atoi(argv[++arg_i]); - } - else if (strcmp(argv[arg_i],"-c")==0 && arg_i+1<argc && argv[arg_i+1][0]!='-') { - arg_i++; - do { - - connectivity_name.push_back( argv[arg_i] ); - - } while ( ++arg_i<argc && argv[arg_i][0]!='-' ); - - } - else { - std::cout << "ERROR [" << argv[0] << ":main] unsupported argument : " << argv[arg_i] << "." << std::endl; - error=true; - break; - } - } - if (analysis_id<=0 || error) { - std::cout << "USAGE " << argv[0] << " -s analysis-serial-number [-c connectivity-name ... ]" << std::endl; - return -1; - } - - - // -------------------------------------------------- - // Main part - // -------------------------------------------------- - - try { - - PixCoralClient coralClient(true); - DummyCoralClientListener listener; - - coralClient.getAnalysisResultsFromDB(analysis_id,connectivity_name, listener); - - } catch ( std::exception& e ) { - std::cout << "std::exception caught: " << e.what() << std::endl; - return -1; - } - - catch (...) { - std::cout << "Unknown exception caught!" << std::endl; - return -1; - } - - return 0; - -} - - - - diff --git a/InnerDetector/InDetConditions/PixelCoralClientUtils/src/CORAL-read.cc b/InnerDetector/InDetConditions/PixelCoralClientUtils/src/CORAL-read.cc deleted file mode 100644 index 20e95f217f91b5aaee0d9e28cc3d02d812ffbc50..0000000000000000000000000000000000000000 --- a/InnerDetector/InDetConditions/PixelCoralClientUtils/src/CORAL-read.cc +++ /dev/null @@ -1,125 +0,0 @@ -/* - Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration -*/ - -#include "CxxUtils/checker_macros.h" -#include "PixelCoralClientUtils/CoralClient.hh" - -int main (int argc, char **argv){ - //printf("CORAL-create starting \n"); - - CAN::SerialNumber_t anal_id = 123456789; - if (argc > 1) anal_id = atoi(argv[1]); - - - // -------------------------------------------------- - // Main part - // -------------------------------------------------- - - try { - - // Start CORAL client - printf("CORAL-read starting \n"); -// PixCoralClient coralClient(coralConnStr,app.context()); - const char* tableName = argc>2 ? "CALIB_DATA" : "CALIB_ANAL"; - PixCoralClient coralClient(true, coral::ReadOnly, tableName); - - if (argc>2) { - - // ------------------------------------------------ - // read PCD table -- A.X. - // ------------------------------------------------ - - // Show the structure of the master table - try { - coralClient.printTableDesc("CALIB_DATA"); - coralClient.printTableContent("CALIB_DATA"); - } catch (coral::TableNotExistingException& err) { - std::cout<<"TableNotExistingException: "<<err.what()<<std::endl; - } - - // Get all results for given tag/revision - try { - coralClient.getCalibrationDataFromDB(argv[2]); - } catch (coral::TableNotExistingException& err) { - std::cout<<"TableNotExistingException: "<<err.what()<<std::endl; - } - - } else { - - // ------------------------------------------------ - // old functionality -- A.X. - // ------------------------------------------------ - - // Show the structure of the master table - try { - coralClient.printTableDesc("CALIB_ANAL"); - coralClient.printTableContent("CALIB_ANAL"); - } catch (coral::TableNotExistingException& err) { - std::cout<<"TableNotExistingException: "<<err.what()<<std::endl; - } - - // Get all results for analysis anal_id - try { - // Print content on the screen -// coralClient.queryTable(anal_id); - // Return a CAN::AnalysisResultList_t object - coralClient.getAnalysisResultsFromDB(anal_id); - } catch (coral::TableNotExistingException& err) { - std::cout<<"TableNotExistingException: "<<err.what()<<std::endl; - } - - // Get results for variable FirstAv and analysis anal_id - try { - // Print content on the screen -// coralClient.queryTable(anal_id,"FirstAv"); - // Return a CAN::AnalysisResultList_t object - coralClient.getAnalysisResultsFromDB(anal_id,"FirstAv"); - } catch (coral::TableNotExistingException& err) { - std::cout<<"TableNotExistingException: "<<err.what()<<std::endl; - } - - // Get results for module L0_B08_S1_A6_M6A, variable Status - // and analysis anal_id - try { - // Print content on the screen -// coralClient.queryTable(anal_id,"Status","L0_B08_S1_A6_M6A"); - // Return a CAN::AnalysisResultList_t object - coralClient.getAnalysisResultsFromDB(anal_id,"Status","L0_B08_S1_A6_M6A"); - } catch (coral::TableNotExistingException& err) { - std::cout<<"TableNotExistingException: "<<err.what()<<std::endl; - } - - // Get results for vector of modules, variable ASpecialPixelMap - // and analysis anal_id - try { - // Return a CAN::AnalysisResultList_t object - std::vector<std::string> mods; - mods.push_back("L2_B25_S2_C6_M4C"); - mods.push_back("L2_B25_S1_C7_M2C"); - coralClient.getAnalysisResultsFromDB(anal_id,mods,"ASpecialPixelMap"); - } catch (coral::TableNotExistingException& err) { - std::cout<<"TableNotExistingException: "<<err.what()<<std::endl; - } - - } // endif -- A.X. - - // COOL, CORAL POOL exceptions inherit from std exceptions: catching - // std::exception will catch all errors from COOL, CORAL and POOL - } catch ( std::exception& e ) { - std::cout << "std::exception caught: " << e.what() << std::endl; - return -1; - } - - catch (...) { - std::cout << "Unknown exception caught!" << std::endl; - return -1; - } - - return 0; - -} - - - - diff --git a/InnerDetector/InDetConditions/PixelCoralClientUtils/src/CoralClient.cc b/InnerDetector/InDetConditions/PixelCoralClientUtils/src/CoralClient.cc deleted file mode 100644 index 3d8d54d390e7ca7680900b95faec8b61fd3b039f..0000000000000000000000000000000000000000 --- a/InnerDetector/InDetConditions/PixelCoralClientUtils/src/CoralClient.cc +++ /dev/null @@ -1,2224 +0,0 @@ -/* - Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration -*/ - -////////////////////////////////////////////////// -/// -/** @file Coralclient.cpp - -C++ class for creating the calibration DB schema, -fill the DB, read it back - -*/ -/////////////////////////////////////////////////// - -#include "PixelCoralClientUtils/CoralClient.hh" -#include "PixelCoralClientUtils/SpecialPixelMap.hh" -#include "PixelCoralClientUtils/PixelCalibData.hh" - -#include <assert.h> -#include <cstring> -#include <string> - -// definition of table types -enum ETableTypeId {kBoolType, kUIntType, kFloatType, kAvresType, kPixelMapType, kCalibData, kNTableTypes}; -const std::string s_tableTypeName[kNTableTypes]={"BOOL","UINT","FLOAT","AVRES","SPECIALPIXELS","CALIBDATA"}; - -/** Returns the string used to identify a particular type - */ -template <typename T> -ETableTypeId variableType(); - - -template <> ETableTypeId variableType<float>() { - return kFloatType; -} - -template <> ETableTypeId variableType<bool>() { - return kBoolType; -} - -template <> ETableTypeId variableType<unsigned int>() { - return kUIntType; -} - -template <> ETableTypeId variableType<CAN::AverageResult_t>() { - return kAvresType; -} - -template <> ETableTypeId variableType<PixelMap_t>() { - return kPixelMapType; -} - -template <> ETableTypeId variableType<PixelCoralClientUtils::PixelCalibData>() { - return kCalibData; -} - -template <class T> inline std::string tableTypeName() { - return s_tableTypeName[ variableType<T>() ]; -} - -/** Create the RCDConnectionService - */ -coral::IHandle<coral::IConnectionService> PixCoralClient::connectionService(bool verbose) -{ - if(verbose) std::cout << "Creating Connection Service"<<std::endl; - - // Instantiate connection service - coral::Context* context = &coral::Context::instance(); - - // Load CORAL connection service - coral::IHandle<coral::IConnectionService> lookSvcH = context->query<coral::IConnectionService>(); - if (!lookSvcH.isValid()) { - context->loadComponent( "CORAL/Services/ConnectionService" ); - lookSvcH = context->query<coral::IConnectionService>(); - } - if (!lookSvcH.isValid()) { - throw std::runtime_error( "Could not locate the connection service" ); - } - return lookSvcH; -} - - -std::string connectionString(const std::string &connection_string_in) { - if (connection_string_in.empty()) { - char * ctmp = getenv("CAN_CALIB_DB"); - if (ctmp != NULL) { - return ctmp; - } - } - return connection_string_in; -} - - -//--------------------------------------------------------------------------- -/** Constructor. - Open a database identified by the connection string. -*/ -PixCoralClient::PixCoralClient(const std::string& id1, - bool verbose, coral::AccessMode access_mode, const char* tableName) - : m_connString(connectionString(id1)), - m_accessMode(access_mode), - m_connectionService(connectionService(verbose)), - m_session(0), - m_pixeltable(tableName), - m_verbose(verbose) -{ -} - - -//--------------------------------------------------------------------------- -/** Constructor. - Open the default database and seal context. -*/ -PixCoralClient::PixCoralClient(bool verbose, coral::AccessMode access_mode, const char* tableName) - : m_connString(connectionString("")), - m_accessMode(access_mode), - m_connectionService(connectionService(verbose)), - m_session(0), - m_pixeltable(tableName), - m_verbose(verbose) -{ -} - - -void PixCoralClient::disconnect() { - if (m_verbose) { - std::cout << "INFO [PixCoralClient::disconnect] disconnect from " << m_connString << "." << std::endl; - } - delete m_session; - m_session=NULL; -} - -void PixCoralClient::connect() { - if (!m_session) { - if (m_verbose) { - std::cout << "INFO [PixCoralClient::connect] Try to connect to " << m_connString << "." << std::endl; - } - m_session = m_connectionService->connect( m_connString, m_accessMode ); - } -} - - -//--------------------------------------------------------------------------- -/** Destructor. - Close the connection -*/ -PixCoralClient::~PixCoralClient() { - disconnect(); - try { - m_connectionService->purgeConnectionPool(); - } - catch (coral::Exception & ex) { - std::cout << "INFO [PixCoralClient::~PixCoralClien] Exception caught in purging connection pool. " <<std::endl; - std::cout << ex.what() <<std::endl; - } -} - - - - -//--------------------------------------------------------------------------- -/** Get the list of tables on the database and print it on stdout. - */ -void PixCoralClient::printTables(const char* /* option */) -{ - if (m_verbose) std::cout << "\nCOOLCORAL Client: list of tables" << std::endl; - - transactionStartReadOnly(); - - std::set<std::string> tables = m_session->nominalSchema().listTables(); - transactionCommit(); - for ( std::set<std::string>::iterator tName = tables.begin(); - tName != tables.end(); ++tName ){ - std::cout << "\t" << *tName << std::endl; - } -} - - - - -//-------------------------------------------------------------------------- -/** Get the description of a table identified by an input string on the database and print it on stdout. - */ -void PixCoralClient::printTableDesc(const std::string& tableName) -{ - if (m_verbose) std::cout << "\nCOOLCORAL Client: " << tableName <<" Table description" << std::endl; - - transactionStartReadOnly(); - - const coral::ITableDescription& tableDesc = - m_session->nominalSchema().tableHandle(tableName).description(); - std::string Name = tableDesc.name(); - int NumCol = tableDesc.numberOfColumns(); - std::vector<std::string> colName; colName.resize(NumCol); - std::vector<std::string> colType; colType.resize(NumCol); - for(int i=0; i<NumCol; ++i){ - const coral::IColumn& colDesc = tableDesc.columnDescription(i); - colName[i] = colDesc.name(); - colType[i] = colDesc.type(); - } - - transactionCommit(); - - std::cout << "\nName : "<< Name << std::endl; - //std::cout << "\nType :"<< Type << std::endl; - printf(" Num of cols : %d",NumCol); - std::cout << "\n Columns :"<< std::endl; - for(int i=0; i<NumCol; ++i) - std::cout <<" "<< colName[i] <<" ("<< colType[i]<<")"<< std::endl; -} - - - - -//--------------------------------------------------------------------------- -/** Get the content of a table identified by an input string on the - database and print its number of lines. - */ -void PixCoralClient::printTableContent(const std::string& tableName){ - if (m_verbose) std::cout << "\nCOOLCORAL Client: " << tableName - <<" Table content"<< std::endl; - - transactionStartReadOnly(); - - coral::IQuery* query = m_session->nominalSchema().tableHandle(tableName).newQuery(); - coral::ICursor& cursor = query->execute(); - int nRows = 0; - while ( cursor.next() ) { - ++nRows; - } - delete query; - - transactionCommit(); - - printf("Total %d records\n", nRows); -} - - - - - -//--------------------------------------------------------------------------- -/** Create CORAL tables - */ -void PixCoralClient::createTables(const char* option) -{ - if (m_verbose) { - std::cout << "\nCOOLCORAL Client: Create tables"; - if (option) std::cout << " with option " << option; - std::cout << std::endl; - } - - struct timeval start_time, end_time; - int total_usecs; - gettimeofday(&start_time, NULL); - - createAuxTables(); - - transactionStartUpdate(); - - // std::cout << " Deleting the old table: " << m_pixeltable << std::endl; - // m_session->nominalSchema().dropIfExistsTable(m_pixeltable); - - if (!m_session->nominalSchema().existsTable(m_pixeltable)) { - if (m_verbose) std::cout << " Creating table: " << m_pixeltable << std::endl; - coral::TableDescription pixel_columns( "SchemaDefinition_PIXEL" ); - pixel_columns.setName( m_pixeltable ); - // modified -- A.X. - if (option==0) { - pixel_columns.insertColumn( "ANAL_ID", - coral::AttributeSpecification::typeNameForType<CAN::SerialNumber_t>()); - } else { - pixel_columns.insertColumn("TAG", coral::AttributeSpecification::typeNameForType<std::string>(), /*size in BYTES = */ 1000, /*fixed_size=*/ false); - pixel_columns.insertColumn("REVISION", coral::AttributeSpecification::typeNameForType<int>()); - pixel_columns.insertColumn("SOURCES", coral::AttributeSpecification::typeNameForType<std::string>(), /*size in BYTES = */ 1000, /*fixed_size=*/ false); - } - pixel_columns.insertColumn( "DATE", - coral::AttributeSpecification::typeNameForType<time_t>()); - pixel_columns.insertColumn( "FK", - coral::AttributeSpecification::typeNameForType<long long>()); - - // modified -- A.X. - if (option==0) { - pixel_columns.createIndex("ANAL_ID_IDX", "ANAL_ID"); - pixel_columns.setNotNullConstraint ("ANAL_ID"); - } - pixel_columns.setUniqueConstraint("FK","FK_UNIQ"); - - // Create the actual table - try { - m_session->nominalSchema().createTable( pixel_columns ); - } catch (coral::TableAlreadyExistingException & ex) { - //Must have been created in parallel - } - } - - transactionCommit(); - - // modified -- A.X. - if (option==0) { - createTable<bool>(); - createTable<unsigned int>(); - createTable<float>(); - createTable<CAN::AverageResult_t>(); - createTable<PixelMap_t>(); - } else { - createTable<PixelCoralClientUtils::PixelCalibData>(); - } - - // measuring elapsed time - gettimeofday(&end_time, NULL); - total_usecs = (end_time.tv_sec-start_time.tv_sec) * 1000000 + - (end_time.tv_usec-start_time.tv_usec); - if (m_verbose) std::cout << " Total time was " << total_usecs << " usec" << std::endl; -} - - - - - -//--------------------------------------------------------------------------- -/** Drop CORAL tables - */ -void PixCoralClient::dropTables(){ - if (m_verbose) std::cout << "\nCOOLCORAL Client: Drop tables" << std::endl; - - struct timeval start_time, end_time; - int total_usecs; - gettimeofday(&start_time, NULL); - - - transactionStartUpdate(); - - std::set<std::string> tables = m_session->nominalSchema().listTables(); - - if (tables.size() > 0) - if (m_verbose) std::cout << "Deleting the old tables: " << std::endl; - for ( std::set<std::string>::reverse_iterator tName = tables.rbegin(); - tName != tables.rend(); ++tName ){ - if ((*tName).find(m_pixeltable) != std::string::npos) { - if (m_verbose) std::cout << "\t" << *tName << std::endl; - m_session->nominalSchema().dropTable(*tName); - } - } - - transactionCommit(); - - // measuring elapsed time - gettimeofday(&end_time, NULL); - total_usecs = (end_time.tv_sec-start_time.tv_sec) * 1000000 + - (end_time.tv_usec-start_time.tv_usec); - if (m_verbose) std::cout << "Total time was " << total_usecs << " usec" << std::endl; -} - - - - -//--------------------------------------------------------------------------- -/** Fill analysis result tables - */ -void PixCoralClient::fillTables(CAN::SerialNumber_t serialNumber, - CAN::AnalysisResultList_t *results){ - if (m_verbose) std::cout << "\nCOOLCORAL Client: Fill tables" << std::endl; - - // get a new foreign key - long long fk = updateKey(); - - transactionStartUpdate(); - - // Create if not yet there - if (!m_session->nominalSchema().existsTable(m_pixeltable)) { - createTables(); - transactionStartUpdate(); - } - - // Find bool variables - if (results->begin<bool>() != results->end<bool>()) { - if (!m_session->nominalSchema().existsTable(m_pixeltable+"_BOOL")) { - createTable<bool>(); - transactionStartUpdate(); - } - } - - // Find unsigned int variables - if (results->begin<unsigned int>() != results->end<unsigned int>()) { - if (!m_session->nominalSchema().existsTable(m_pixeltable+"_UINT")) { - createTable<unsigned int>(); - transactionStartUpdate(); - } - } - - // Find float variables - if (results->begin<float>() != results->end<float>()) { - if (!m_session->nominalSchema().existsTable(m_pixeltable+"_FLOAT")) { - createTable<float>(); - transactionStartUpdate(); - } - } - - // Find AverageResult_t variables - if (results->begin<CAN::AverageResult_t>() != results->end<CAN::AverageResult_t>()) { - if (!m_session->nominalSchema().existsTable(m_pixeltable+"_AVRES")) { - createTable<CAN::AverageResult_t>(); - transactionStartUpdate(); - } - } - - // Find special pixel map variables - if (results->begin<PixelMap_t>() != results->end<PixelMap_t>()) { - if (!m_session->nominalSchema().existsTable(m_pixeltable+"_SPECIALPIXELS")) { - createTable<PixelMap_t>(); - transactionStartUpdate(); - } - } - - struct timeval start_time, end_time; - int total_usecs; - gettimeofday(&start_time, NULL); - - if (m_verbose) std::cout << " Filling table " << m_pixeltable << " for analysis "<< serialNumber << std::endl; - coral::ITableDataEditor& pixel_editor = m_session->nominalSchema().tableHandle(m_pixeltable ).dataEditor(); - coral::AttributeList pixel_row ATLAS_THREAD_SAFE; // Not shared, ok - - //unsigned int id = serialNumber; - time_t date = time(0); - - struct timeval nunc_time; - gettimeofday(&nunc_time, NULL); - - int run = 0; - - pixel_row.extend<CAN::SerialNumber_t>("ANAL_ID"); - pixel_row.extend<time_t>("DATE"); - pixel_row.extend<long long>("FK"); - pixel_row["ANAL_ID"].data<CAN::SerialNumber_t>() = serialNumber; - pixel_row["DATE"].data<time_t>() = LocalToGMTTime(date); - pixel_row["FK"].data<long long>() = fk; - pixel_editor.insertRow(pixel_row); - - transactionCommit(); - - run += fillTable<bool>(fk,results); - run += fillTable<unsigned int>(fk,results); - run += fillTable<float>(fk,results); - run += fillTable<CAN::AverageResult_t>(fk,results); - run += fillTable<PixelMap_t>(fk,results); - - if (m_verbose) printf("\n Total: %d rows\n",run); - - // measuring elapsed time - gettimeofday(&end_time, NULL); - total_usecs = (end_time.tv_sec-start_time.tv_sec) * 1000000 + - (end_time.tv_usec-start_time.tv_usec); - if (m_verbose) std::cout << " Total time was " << total_usecs << " usec" << std::endl; - -} - -/** fill PCD table -- A.X. - */ -void PixCoralClient::fillTables(const char* option){ - - if (option==NULL || !strlen(option)) { return; } - - if (m_verbose) { - std::cout << "\nCOOLCORAL Client: Fill tables"; - if (option) std::cout << " with option " << option; - std::cout << std::endl; - } - - // get a new foreign key - long long fk = updateKey(); - - transactionStartUpdate(); - - - // Create if not yet there - if (!m_session->nominalSchema().existsTable(m_pixeltable)) { - createTables(option); - transactionStartUpdate(); - } - - - struct timeval start_time, end_time; - int total_usecs; - gettimeofday(&start_time, NULL); - - if (m_verbose) std::cout << " Filling table " << m_pixeltable << std::endl; - coral::ITableDataEditor& pixel_editor = m_session->nominalSchema().tableHandle(m_pixeltable ).dataEditor(); - coral::AttributeList pixel_row ATLAS_THREAD_SAFE; // Not shared, ok - - //unsigned int id = serialNumber; - time_t date = time(0); - - struct timeval nunc_time; - gettimeofday(&nunc_time, NULL); - - int run = 0; - - pixel_row.extend<std::string>("TAG"); - pixel_row.extend<int>("REVISION"); - pixel_row.extend<std::string>("SOURCES"); - pixel_row.extend<time_t>("DATE"); - pixel_row.extend<long long>("FK"); - - // parse option -- A.X. - std::string tag(""); - std::string revision(""); - std::string sources(""); - std::string delimiters(", "); - std::string str(option); - std::string::size_type lastPos = str.find_first_not_of(delimiters, 0); - std::string::size_type pos = str.find_first_of(delimiters, lastPos); - while (std::string::npos != pos || std::string::npos != lastPos) { - if (str.substr(lastPos,4)=="tag:") - tag = str.substr(lastPos+4, pos-lastPos-4); - if (str.substr(lastPos,9)=="revision:") - revision = str.substr(lastPos+9, pos-lastPos-9); - if (str.substr(lastPos,8)=="sources:") - sources = str.substr(lastPos+8, pos-lastPos-8); - lastPos = str.find_first_not_of(delimiters, pos); - pos = str.find_first_of(delimiters, lastPos); - } - if (m_verbose) { - std::cout << "TAG: " << tag << std::endl; - std::cout << "REVISION: " << atoi(revision.c_str()) << std::endl; - std::cout << "SOURCES: " << sources << std::endl; - } - - pixel_row["TAG"].data<std::string>() = tag; - pixel_row["REVISION"].data<int>() = atoi(revision.c_str()); - pixel_row["SOURCES"].data<std::string>() = sources; - pixel_row["DATE"].data<time_t>() = LocalToGMTTime(date); - pixel_row["FK"].data<long long>() = fk; - - pixel_editor.insertRow(pixel_row); - - transactionCommit(); - - run += fillTablePixelCalibData(fk, option); - - if (m_verbose) printf("\n Total: %d rows\n",run); - - // measuring elapsed time - gettimeofday(&end_time, NULL); - total_usecs = (end_time.tv_sec-start_time.tv_sec) * 1000000 + - (end_time.tv_usec-start_time.tv_usec); - if (m_verbose) std::cout << " Total time was " << total_usecs << " usec" << std::endl; - -} - - - -//--------------------------------------------------------------------------- -/** Get results for a particular analysis ID - Optionally get only variable "varname" and/or connectivity object connName - */ -void PixCoralClient::queryTable(CAN::SerialNumber_t anal_id, const std::string& varname, const std::string& connName){ - - std::cout << "\n COOLCORAL Client: " << m_pixeltable <<" Putting table content in AnalysisResultList for analysis " << anal_id; - if (varname != "") std::cout<<", variable " << varname; - if (connName != "") std::cout<<", object " << connName; - std::cout<< std::endl; - - struct timeval start_time, end_time; - int total_usecs; - gettimeofday(&start_time, NULL); - - transactionStartReadOnly(); - - // Get all entries for anal_id - coral::IQuery* query = m_session->nominalSchema().tableHandle(m_pixeltable).newQuery(); - query->addToOutputList("ANAL_ID"); - query->defineOutputType("ANAL_ID",coral::AttributeSpecification::typeNameForType<CAN::SerialNumber_t>()); - query->addToOutputList("DATE"); - query->defineOutputType("DATE",coral::AttributeSpecification::typeNameForType<time_t>()); - query->addToOutputList("FK"); - std::string pixel_cond = m_pixeltable+".ANAL_ID = :analid"; - coral::AttributeList pixel_condData ATLAS_THREAD_SAFE; // Not shared, ok - pixel_condData.extend<CAN::SerialNumber_t>( "analid" ); - query->setCondition( pixel_cond, pixel_condData); - pixel_condData[0].data<CAN::SerialNumber_t>() = anal_id; - coral::ICursor& cursor = query->execute(); - - int nRows = 0; - while ( cursor.next() ) { - const coral::AttributeList &row0 = cursor.currentRow(); - std::time_t timet = GMTtoLocalTime(row0[1].data<time_t>()); - char buf[32]; - std::string time = ctime_r(&timet, buf); - std::cout << " ANAL_ID = " << row0[0].data<CAN::SerialNumber_t>() - << " DATE = " << time.substr(0,time.size()-1) - << " FK = " << row0[2].data<long long>() << std::endl; - //row0.toOutputStream(std::cout)<<endl; - ++nRows; - // Show the variables - std::set<std::string> tables = m_session->nominalSchema().listTables(); - for ( std::set<std::string>::const_iterator tName = tables.begin(); - tName != tables.end(); ++tName ){ - if ((*tName).find(m_pixeltable+"_") != std::string::npos) { - coral::IQuery* query_2 = m_session->nominalSchema().tableHandle(*tName).newQuery(); - - // Get the list of columns - const coral::ITableDescription& tableDesc = - m_session->nominalSchema().tableHandle(*tName).description(); - int NumCol = tableDesc.numberOfColumns(); - std::vector<std::string> colName; colName.resize(NumCol); - std::vector<std::string> colType; colType.resize(NumCol); - for(int i=0; i<NumCol; ++i){ - const coral::IColumn& colDesc = tableDesc.columnDescription(i); - colName[i] = colDesc.name(); - colType[i] = colDesc.type(); - query_2->addToOutputList(colDesc.name()); - //if (m_verbose) std::cout <<" "<<i<<": "<< colName[i] <<" ("<< colType[i]<<")"<< std::endl; - } - - // Second query to get entries in each table - std::string pixel_cond_2 = (*tName)+".FK = :analfk"; - coral::AttributeList pixel_condData_2 ATLAS_THREAD_SAFE; // Not shared, ok - pixel_condData_2.extend<long long>( "analfk" ); - pixel_condData_2[0].data<long long>() = row0[2].data<long long>(); - if (varname != "") { - pixel_cond_2 += " AND "+(*tName)+".VARIABLE = :var"; - pixel_condData_2.extend<std::string>("var"); - pixel_condData_2["var"].data<std::string>() = varname; - } - if (connName != "") { - pixel_cond_2 += " AND "+(*tName)+".CONNECTIVITY = :conn"; - pixel_condData_2.extend<std::string>("conn"); - pixel_condData_2["conn"].data<std::string>() = connName; - } - query_2->setCondition( pixel_cond_2, pixel_condData_2); - coral::ICursor& cursor_2 = query_2->execute(); - while ( cursor_2.next() ) { - const coral::AttributeList &row0_2 = cursor_2.currentRow(); - std::cout << " conn = " << row0_2[1].data<std::string>(); - std::cout<< " ("<<colType[3]<<")"<<row0_2[2].data<std::string>()<<"="; - // If only I could use colType[i] and pass it to the template somehow - for(int i=3; i<NumCol; ++i){ - if (colType[i] == "float") - std::cout<< " ("<<colType[i]<<")"<<colName[i]<<"=" << row0_2[i].data<float>(); - else if (colType[i] == "int") - std::cout<< " ("<<colType[i]<<")"<<colName[i]<<"=" << row0_2[i].data<int>(); - else if (colType[i] == "long long") - std::cout<< " ("<<colType[i]<<")"<<colName[i]<<"=" << row0_2[i].data<long long>(); - else if (colType[i] == "bool") - std::cout<< " ("<<colType[i]<<")"<<colName[i]<<"=" << row0_2[i].data<bool>(); - } - std::cout<< std::endl; - } - delete query_2; - } - } - } - delete query; - - transactionCommit(); - - if (m_verbose) printf(" Total %d analyses\n", nRows); - - gettimeofday(&end_time, NULL); - total_usecs = (end_time.tv_sec-start_time.tv_sec) * 1000000 + - (end_time.tv_usec-start_time.tv_usec); - if (m_verbose) std::cout << " Total time was " << total_usecs << " usec" << std::endl; -} - - - - -//-------------------------------------------------------------------------- -/** Create and fill the CALIB_KEYGEN key generation table - */ -void PixCoralClient::createAuxTables(){ - std::string FK_TABLE = "CALIB_KEYGEN"; - transactionStartUpdate(); - - // std::cout << "Deleting the old table: " << FK_TABLE << std::endl; - // m_session->nominalSchema().dropIfExistsTable(FK_TABLE); - - if (!m_session->nominalSchema().existsTable(FK_TABLE)) { - if (m_verbose) std::cout << "Creating table: " <<FK_TABLE << std::endl; - coral::TableDescription key_columns( "SchemaDefinition_KEY" ); - key_columns.setName( FK_TABLE ); - key_columns.insertColumn( "KEY", - coral::AttributeSpecification::typeNameForType<long long>()); - key_columns.createIndex ("KEY_INDEX", "KEY"); - // Create the actual table - try { - m_session->nominalSchema().createTable( key_columns ); - // Fill the first key - coral::ITableDataEditor& keyeditor = m_session->nominalSchema().tableHandle( FK_TABLE ).dataEditor(); - coral::AttributeList rowBuffer ATLAS_THREAD_SAFE; // Not shared, ok - rowBuffer.extend<long long>( "KEY" ); - long long& key = rowBuffer[ "KEY" ].data<long long>(); - key = 1000; - keyeditor.insertRow( rowBuffer ); - } catch (coral::TableAlreadyExistingException & ex) { - //Must have been created in parallel - } - } - transactionCommit(); -} - - - - -//--------------------------------------------------------------------------- -/** Method to update the key in the KEYGEN table - */ -long long PixCoralClient::updateKey(){ - if (m_verbose) std::cout << "\nCOOLCORAL Client: Update Key" << std::endl; - std::string FK_TABLE = "CALIB_KEYGEN"; - transactionStartUpdate(); - if (!m_session->nominalSchema().existsTable(FK_TABLE)) { - createAuxTables(); - transactionStartUpdate(); - } - - coral::ITableDataEditor& keyeditor = m_session->nominalSchema().tableHandle( FK_TABLE ).dataEditor(); - std::string updateAction = "KEY = KEY + :offset"; - coral::AttributeList updateData ATLAS_THREAD_SAFE; // Not shared, ok - updateData.extend<long long>("offset"); - updateData[0].data<long long>() = 1; - //long rowsUpdated = - keyeditor.updateRows( updateAction, "", updateData ); - //std::cout << " Updated " << rowsUpdated << " rows" << std::endl; - - coral::IQuery* query = m_session->nominalSchema().tableHandle(FK_TABLE).newQuery(); - query->addToOutputList("KEY"); - coral::ICursor& cursor = query->execute(); - long long key = -1; - while ( cursor.next() ) { - const coral::AttributeList &row0 = cursor.currentRow(); - key = row0[0].data<long long>(); - if (m_verbose) std::cout << " KEY = " << key << std::endl; - } - transactionCommit(); - return key; -} - - - - - -/** Template to create a table for variable columnName. - Works only for simple types (one value to save) -*/ -template <typename T> -void PixCoralClient::createTable(){ - - transactionStartUpdate(); - - std::string PIXEL_TABLE_DATA=m_pixeltable+"_"+tableTypeName<T>(); - - if (!m_session->nominalSchema().existsTable(PIXEL_TABLE_DATA)) { - if (m_verbose) { - std::cout << "\nCOOLCORAL Client: Creating table: " << PIXEL_TABLE_DATA <<" for "; - try { - std::cout <<tableTypeName<T>() << std::endl; - } catch (const coral::AttributeListException&) { - std::cout <<typeid(T).name() << std::endl; - } - } - - // Create the table - coral::TableDescription pixel_columns( "SchemaDefinition_PIXEL" ); - pixel_columns.setName( PIXEL_TABLE_DATA ); - pixel_columns.insertColumn("FK", coral::AttributeSpecification::typeNameForType<long long>()); - pixel_columns.insertColumn("CONNECTIVITY", coral::AttributeSpecification::typeNameForType<std::string>(), /*size in BYTES = */ 100, /*fixed_size=*/ false); - pixel_columns.insertColumn("VARIABLE", coral::AttributeSpecification::typeNameForType<std::string>(), /*size in BYTES = */ 100, /*fixed_size=*/ false); - - if (typeid(T)==typeid(CAN::AverageResult_t)) { - pixel_columns.insertColumn("N", coral::AttributeSpecification::typeNameForType<int>()); - pixel_columns.insertColumn("MEAN", coral::AttributeSpecification::typeNameForType<float>()); - pixel_columns.insertColumn("RMS", coral::AttributeSpecification::typeNameForType<float>()); - pixel_columns.insertColumn("LOW99", coral::AttributeSpecification::typeNameForType<float>()); - pixel_columns.insertColumn("UP99", coral::AttributeSpecification::typeNameForType<float>()); - } else if (typeid(T)==typeid(PixelMap_t)) { - // A size > 4000 triggers the use of a CLOB object - pixel_columns.insertColumn("VALUE", coral::AttributeSpecification::typeNameForType<std::string>(), /*size = */ 4001, /*fixed_size=*/ false); - // added -- A.X. - } else if (typeid(T)==typeid(PixelCoralClientUtils::PixelCalibData)) { - pixel_columns.insertColumn("IDMOD",coral::AttributeSpecification::typeNameForType<int>()); - pixel_columns.insertColumn("CHIP",coral::AttributeSpecification::typeNameForType<int>()); - pixel_columns.insertColumn("THRESHOLD1",coral::AttributeSpecification::typeNameForType<int>()); - pixel_columns.insertColumn("THRESHOLD2",coral::AttributeSpecification::typeNameForType<int>()); - pixel_columns.insertColumn("THRESHOLD3",coral::AttributeSpecification::typeNameForType<int>()); - pixel_columns.insertColumn("THRESHOLD4",coral::AttributeSpecification::typeNameForType<int>()); - pixel_columns.insertColumn("THRESHOLDLONG1",coral::AttributeSpecification::typeNameForType<int>()); - pixel_columns.insertColumn("THRESHOLDLONG2",coral::AttributeSpecification::typeNameForType<int>()); - pixel_columns.insertColumn("THRESHOLDLONG3",coral::AttributeSpecification::typeNameForType<int>()); - pixel_columns.insertColumn("THRESHOLDLONG4",coral::AttributeSpecification::typeNameForType<int>()); - pixel_columns.insertColumn("THRESHOLDGANGED1",coral::AttributeSpecification::typeNameForType<int>()); - pixel_columns.insertColumn("THRESHOLDGANGED2",coral::AttributeSpecification::typeNameForType<int>()); - pixel_columns.insertColumn("THRESHOLDGANGED3",coral::AttributeSpecification::typeNameForType<int>()); - pixel_columns.insertColumn("THRESHOLDGANGED4",coral::AttributeSpecification::typeNameForType<int>()); - pixel_columns.insertColumn("Q2TOT1",coral::AttributeSpecification::typeNameForType<float>()); - pixel_columns.insertColumn("Q2TOT2",coral::AttributeSpecification::typeNameForType<float>()); - pixel_columns.insertColumn("Q2TOT3",coral::AttributeSpecification::typeNameForType<float>()); - pixel_columns.insertColumn("Q2TOTGANGED1",coral::AttributeSpecification::typeNameForType<float>()); - pixel_columns.insertColumn("Q2TOTGANGED2",coral::AttributeSpecification::typeNameForType<float>()); - pixel_columns.insertColumn("Q2TOTGANGED3",coral::AttributeSpecification::typeNameForType<float>()); - pixel_columns.insertColumn("TOTRES1",coral::AttributeSpecification::typeNameForType<float>()); - pixel_columns.insertColumn("TOTRES2",coral::AttributeSpecification::typeNameForType<float>()); - } else { - pixel_columns.insertColumn("VALUE", coral::AttributeSpecification::typeNameForType<T>()); - } - - //set the foreign key - pixel_columns.createForeignKey(tableTypeName<T>()+"_FK","FK",m_pixeltable,"FK"); - // create indices - pixel_columns.createIndex(tableTypeName<T>()+"_CONNECTIVITY_IDX", "CONNECTIVITY"); - pixel_columns.createIndex(tableTypeName<T>()+"_VARIABLE_IDX", "VARIABLE"); - pixel_columns.setNotNullConstraint ( "CONNECTIVITY" ); - pixel_columns.setNotNullConstraint ( "VARIABLE" ); - - // Create the actual table - try { - //coral::ITable& table = - m_session->nominalSchema().createTable( pixel_columns ); - } catch (coral::TableAlreadyExistingException & ex) { - //Must have been created in parallel - } - } - - transactionCommit(); -} - -template <class T> -std::string valueQuote() { - return std::string(); -} - -template <> -std::string valueQuote<std::string>() { - return std::string("'"); -} - -template <class T> -void createCondition(const std::vector<T> &search_list, - const std::string &table_name, - const std::string &var_name, - const std::string &bind_name, - coral::AttributeList &attribut_list, - std::string &condition, - bool use_attr_list=false) -{ - if (!search_list.empty()) { - condition += table_name; - condition += "."; - condition += var_name; - - if (search_list.size()==1) { - attribut_list.extend< T >( bind_name ); - assert(attribut_list.size()>0); - attribut_list[attribut_list.size()-1].setValue( search_list.back() ); - condition += " = :"; - condition += bind_name; - } - else { - if (use_attr_list) { - - condition += " in ("; - - std::string sep=":"; - std::string sep2=",:"; - - std::stringstream a_var_name; - unsigned int counter=attribut_list.size(); - for(typename std::vector<T>::const_iterator iter=search_list.begin(); - iter != search_list.end(); - ++iter, ++counter) { - - a_var_name.clear(); - a_var_name << bind_name << counter; - attribut_list.extend< T >( a_var_name.str() ); - attribut_list[counter].setValue< T >( *iter ); - - condition += sep; - condition += a_var_name.str(); - sep = sep2; - } - condition += ")"; - } - else { - condition += " in ("; - typename std::vector<T>::const_iterator iter=search_list.begin(); - - std::string quote(valueQuote<T>()); - condition += quote; - condition += *iter; - condition += quote; - for(; - iter != search_list.end(); - ++iter) { - condition += ','; - condition += quote; - condition += *iter; - condition += quote; - } - condition += ")"; - } - } - } -} - - -enum EValueType {kValFloat,kValInt, kValUInt, kValBool, kValString, kValExtendedAverageValue, kValAverageValue, kNValueTypes}; -//--------------------------------------------------------------------------- -void PixCoralClient::getAnalysisResultsFromDB(std::vector<CAN::SerialNumber_t> analysis_id, - const std::vector<std::string> &connName, - IPixResultsDbListener &listener) { - - if (analysis_id.empty()) return; - struct timeval start_time, end_time; - int total_usecs; - unsigned int n_rows=0; - - if (m_verbose) { - std::cout << "\n COOLCORAL Client: " << m_pixeltable <<" Putting table content in AnalysisResultList for:"; - std::cout<<"\n analysis :" ; - for (std::vector<CAN::SerialNumber_t>::const_iterator iter = analysis_id.begin(); - iter != analysis_id.end(); - ++iter) { - std::cout << *iter; - } - std::cout << std::endl; - gettimeofday(&start_time, NULL); - } - - char *test=getenv("CANRESULTS_USE_ATTRL"); - bool use_attr_list=false; - if (test && strcmp(test,"y")==0) { - use_attr_list=true; - } - - transactionStartReadOnly(); - - // want to produce query : - // select t1.ANAL_ID, t2.CONNECTIVITY, t2.VARIABLE, t2.VALUE from - // (select ANAL_ID,FK from CALIB_ANAL where ANAL_ID = 1394 ) t1, - // CALIB_ANAL_FLOAT t2 where (t2.FK=t1.FK); - - std::set<std::string> tables = m_session->nominalSchema().listTables(); - for ( std::set<std::string>::const_iterator tName = tables.begin(); - tName != tables.end(); ++tName ){ - - if ((*tName).find(m_pixeltable+"_") != std::string::npos) { - // only consider tables CALIB_ANAL_FLOAT etc. not CALIB_ANAL. - - // define output columns depending on the table type : - // first identify table type - std::string col_type; - EValueType value_type=kNValueTypes; - const coral::ITableDescription& tableDesc = - m_session->nominalSchema().tableHandle(*tName).description(); - - try { - const coral::IColumn& colDesc = tableDesc.columnDescription("VALUE"); - - col_type= colDesc.type(); - value_type=kNValueTypes; - if (col_type == "float") { - value_type = kValFloat; - } - else if (col_type == "int") { - value_type=kValInt; - } - else if (col_type == "unsigned int") { - value_type=kValUInt; - } - else if (col_type == "bool") { - value_type=kValBool; - } - else if (col_type == "string") { - value_type=kValString; - } - } - catch(coral::InvalidColumnNameException &) { - - try { - // check whether the columns exist - tableDesc.columnDescription("N"); - tableDesc.columnDescription("MEAN"); - tableDesc.columnDescription("RMS"); - value_type = kValAverageValue; - } - catch(coral::InvalidColumnNameException &) { - } - - try { - // check whether the columns exist - tableDesc.columnDescription("LOW99"); - tableDesc.columnDescription("UP99"); - value_type = kValExtendedAverageValue; - } - catch(coral::InvalidColumnNameException &) { - } - - } - if (value_type>=kNValueTypes) { - std::cerr << "ERROR [CoralClient::getAnalysisResultsFromDB] Failed to identify value type for " << *tName << "."<< std::endl; - continue; - } - - // now define output columns - std::unique_ptr<coral::IQuery> query( m_session->nominalSchema().newQuery() ); - if (!query.get()) { - std::cerr << "ERROR [CoralClient::getAnalysisResultsFromDB] Failed to create queries for table " << *tName << "."<< std::endl; - continue; - } - query->addToTableList(*tName, "V"); - - query->addToOutputList("V.CONNECTIVITY"); - query->addToOutputList("V.VARIABLE"); - - switch (value_type) { - case kValAverageValue: { - std::cerr << "ERROR [CoralClient::getAnalysisResultsFromDB] unsupported table " << *tName << std::endl; - return; - } - case kValExtendedAverageValue: { - query->addToOutputList("V.N"); - query->addToOutputList("V.MEAN"); - query->addToOutputList("V.RMS"); - query->addToOutputList("V.LOW99"); - query->addToOutputList("V.UP99"); - break; - } - default: { - query->addToOutputList("V.VALUE"); - } - } - - query->setRowCacheSize(2000); - - // select all entries which match the serial number and return the rod list key - coral::IQueryDefinition& rod_list_query = query->defineSubQuery( "R" ); - rod_list_query.addToOutputList( "I.FK" ,"FK"); - rod_list_query.addToTableList("CALIB_ANAL","I"); - - coral::AttributeList analysis_id_condition_inputs ATLAS_THREAD_SAFE; // Not shared, ok - std::string analysis_id_condition; - createCondition<CAN::SerialNumber_t>(analysis_id, "I","ANAL_ID","id",analysis_id_condition_inputs,analysis_id_condition,use_attr_list); - rod_list_query.setCondition(analysis_id_condition, analysis_id_condition_inputs); - query->addToTableList( "R" ); - - // Get the list of columns - - // prepare the query condition - coral::AttributeList condition_inputs ATLAS_THREAD_SAFE; // Not shared, ok - std::string condition; - condition = "R.FK = V.FK"; - if (!connName.empty() ) { - condition+= " AND "; - createCondition<std::string>(connName, "V","CONNECTIVITY","conn",condition_inputs, condition,use_attr_list); - } - query->setCondition(condition, condition_inputs); - coral::ICursor& cursor = query->execute(); - - while ( cursor.next() ) { - - const coral::AttributeList &row = cursor.currentRow(); - const std::string &conn = row[0].data<std::string>(); - const std::string &the_var_name (row[1].data<std::string>()); - n_rows++; - if (m_verbose) std::cout<< " ("<<col_type << " -> " << value_type <<") ="; - - switch (value_type) { - case kValFloat: { - if (m_verbose) std::cout << row[2].data<float>(); - listener.newValue( the_var_name, conn, row[2].data<float>() ); - break; - } - case kValInt: { - if (m_verbose) std::cout << row[2].data<int>(); - listener.newValue( the_var_name, conn, static_cast<unsigned int>(row[2].data<int>()) ); - break; - } - case kValUInt: { - if (m_verbose) std::cout << row[2].data<unsigned int>(); - listener.newValue( the_var_name, conn, static_cast<unsigned int>(row[2].data<unsigned int>()) ); - break; - } - case kValBool: { - if (m_verbose) std::cout << row[2].data<bool>(); - listener.newValue( the_var_name, conn, row[2].data<bool>() ); - break; - } - case kValString: { - if (m_verbose) std::cout << row[2].data<std::string>(); - listener.newValue( the_var_name, conn,CLOBtoPixelMap(row[2].data<std::string>())); - break; - } - case kValExtendedAverageValue: { - if (m_verbose) { - std::cout<<" (avres)" - << the_var_name - <<"="<<row[2].data<int>() - <<"/"<<row[3].data<float>() - <<"/"<<row[4].data<float>() - <<"/"<<row[5].data<float>() - <<"/"<<row[6].data<float>(); - } - - CAN::AverageResult_t avres(row[2].data<int>(),row[3].data<float>(),row[4].data<float>(),row[5].data<float>(),row[6].data<float>()); - listener.newValue( the_var_name, conn, avres ); - break; - } - default: - std::cerr << "ERROR [CoralClient::getAnalysisResultsFromDB] Unsupported column type " << col_type << std::endl; - } - if (m_verbose) std::cout<< std::endl; - } - } - } - - transactionCommit(); - - if (m_verbose) { - std::cout << " Total " << n_rows << " analyses" << std::endl; - - gettimeofday(&end_time, NULL); - total_usecs = (end_time.tv_sec-start_time.tv_sec) * 1000000 + - (end_time.tv_usec-start_time.tv_usec); - std::cout << " Total time was " << total_usecs << " usec" << std::endl; - } -} - -// helper function to store values into table rows. - -// all types -template <typename T> inline void addValueToRow(coral::AttributeList &attribute_list, const T &value) { - attribute_list["VALUE"].data<T>() = value; -} - -template <typename T> inline void extendAttributeList(coral::AttributeList &attribute_list) { - attribute_list.extend<T>("VALUE"); -} - - -// special handling for AverageResult -template <> inline void addValueToRow<CAN::AverageResult_t>(coral::AttributeList &attribute_list, const CAN::AverageResult_t &value) { - attribute_list["N"].setValue((int)value.n()); - attribute_list["MEAN"].setValue(value.value(CAN::AverageResult_t::kMean)); - attribute_list["RMS"].setValue(value.value(CAN::AverageResult_t::kRMS)); - attribute_list["LOW99"].setValue(value.value(CAN::AverageResult_t::kLower99)); - attribute_list["UP99"].setValue(value.value(CAN::AverageResult_t::kUpper99)); -} - -template <> inline void extendAttributeList<CAN::AverageResult_t>(coral::AttributeList &attribute_list) { - attribute_list.extend<int>("N"); - attribute_list.extend<float>("MEAN"); - attribute_list.extend<float>("RMS"); - attribute_list.extend<float>("LOW99"); - attribute_list.extend<float>("UP99"); -} - - -// special handling for PixelMap_t -template <> inline void addValueToRow<PixelMap_t> (coral::AttributeList &attribute_list, const PixelMap_t &value) { - attribute_list["VALUE"].setValue(PixCoralClient::PixelMapToCLOB(value)); -} - -template <> inline void extendAttributeList<PixelMap_t>(coral::AttributeList &attribute_list) { - attribute_list.extend<std::string>("VALUE"); -} - - -// type name helper functions -template <typename T> inline std::string typeName() { - return coral::AttributeSpecification::typeNameForType<T>(); -} - -template <> inline std::string typeName<CAN::AverageResult_t>() { - return std::string("CAN::AverageResult_t"); -} - -template <> inline std::string typeName<PixelMap_t>() { - return std::string("PixelMap_t"); -} - -void emptyNamesErrorMessage(unsigned int empty_var_names, unsigned int empty_conn_names, const std::string &table_name) -{ - if (empty_conn_names>0 || empty_var_names>0) { - std::cerr << "ERROR [PixCoralClient::fillTable] Tried to fill "; - if (empty_var_names>0) { - std::cerr << empty_var_names << " result(s) without variable name "; - if (empty_conn_names>0) { - std::cerr << "and "; - } - } - if (empty_conn_names>0) { - std::cerr << empty_conn_names << " result(s) without connectivity name "; - } - std::cerr << " into " << table_name << std::endl; - } -} - -/** Template to fill a table with analysis results. - Works only for simple types (one value to save) -*/ -template <typename T> -int PixCoralClient::fillTable(long long fk, CAN::AnalysisResultList_t *results){ - - if (m_verbose) std::cout << "\nCOOLCORAL Client: fill table for type "<< tableTypeName<T>() << std::endl; - - transactionStartUpdate(); - - int nrows = 0; - - std::string table_name = m_pixeltable+"_"+tableTypeName<T>(); - unsigned int empty_var_names=0; - unsigned int empty_conn_names=0; - for (typename std::map<std::string, std::map<std::string, T> >::const_iterator iter=results->begin<T>(); - iter != results->end<T>(); - ++iter) { - - if (iter->first.empty()) { - empty_var_names++; - continue; - } - - std::string tname = iter->first; - if (m_verbose) std::cout << " Filling table " << table_name << " for variable " << tname << std::endl; - coral::ITableDataEditor& pixel_editor_2 = m_session->nominalSchema().tableHandle(table_name).dataEditor(); - coral::AttributeList pixel_row_2 ATLAS_THREAD_SAFE; // Not shared, ok - pixel_row_2.extend<long long>("FK"); - pixel_row_2.extend<std::string>("CONNECTIVITY"); - pixel_row_2.extend<std::string>("VARIABLE"); - // pixel_row_2.extend<T>("VALUE"); - extendAttributeList<T>(pixel_row_2); - { - std::unique_ptr<coral::IBulkOperation> pixel_bulk_2(pixel_editor_2.bulkInsert(pixel_row_2,iter->second.size())); - for (typename std::map<std::string, T >::const_iterator val_iter=iter->second.begin(); - val_iter != iter->second.end(); - ++val_iter) { - - if (val_iter->first.empty()) { - empty_conn_names++; - continue; - } - - pixel_row_2["FK"].data<long long>() = fk; - pixel_row_2["CONNECTIVITY"].data<std::string>() = val_iter->first; - pixel_row_2["VARIABLE"].data<std::string>() = tname; - // pixel_row_2["VALUE"].data<T>() = val_iter->second; - addValueToRow(pixel_row_2, val_iter->second); - ++nrows; - pixel_bulk_2->processNextIteration(); - } - pixel_bulk_2->flush(); - } - } - - if (empty_conn_names>0 || empty_var_names>0) { - emptyNamesErrorMessage(empty_var_names, empty_conn_names, table_name); - } - - transactionCommit(); - return nrows; -} - - - -// /** Fill a table with analysis results of type AverageResult_t. -// Couldn't use the templated fillTable<T> above because the object -// structure is different... -// */ -// int PixCoralClient::fillTableAverageResult(long long fk, CAN::AnalysisResultList_t *results){ -// if (m_verbose) std::cout << "\nCOOLCORAL Client: fill table for CAN::AverageResult_t" << std::endl; -// int nrows = 0; -// transactionStartUpdate(); -// for (std::map<std::string, std::map<std::string, CAN::AverageResult_t> >::const_iterator iter=results->begin<CAN::AverageResult_t>(); -// iter != results->end<CAN::AverageResult_t>(); -// iter ++) { -// if (m_verbose) std::cout << " Filling table " << m_pixeltable+"_AVRES" << std::endl; -// coral::ITableDataEditor& pixel_editor_2 = m_session->nominalSchema().tableHandle(m_pixeltable+"_AVRES").dataEditor(); -// coral::AttributeList pixel_row_2; -// pixel_editor_2.rowBuffer(pixel_row_2); -// coral::IBulkOperation* pixel_bulk_2= pixel_editor_2.bulkInsert(pixel_row_2,iter->second.size()); -// for (std::map<std::string, CAN::AverageResult_t >::const_iterator val_iter=iter->second.begin(); -// val_iter != iter->second.end(); -// val_iter ++) { -// pixel_row_2["FK"].setValue <long long> (fk); -// pixel_row_2["CONNECTIVITY"].setValue <std::string> (val_iter->first); -// pixel_row_2["VARIABLE"].setValue <std::string> (iter->first); -// pixel_row_2["N"].setValue((int)val_iter->second.n()); -// pixel_row_2["MEAN"].setValue(val_iter->second.value(CAN::AverageResult_t::kMean)); -// pixel_row_2["RMS"].setValue(val_iter->second.value(CAN::AverageResult_t::kRMS)); -// pixel_row_2["LOW99"].setValue(val_iter->second.value(CAN::AverageResult_t::kLower99)); -// pixel_row_2["UP99"].setValue(val_iter->second.value(CAN::AverageResult_t::kUpper99)); -// ++nrows; -// pixel_bulk_2->processNextIteration(); -// } -// pixel_bulk_2->flush(); -// delete pixel_bulk_2; -// } -// transactionCommit(); -// return nrows; -// } - - - -// /** Fill a table with analysis results of type PixelMap_t. -// Couldn't use the templated fillTable<T> above because the CLOB -// has to be constructed first. -// */ -// int PixCoralClient::fillTableSpecialPixelMap(long long fk, CAN::AnalysisResultList_t *results){ -// if (m_verbose) std::cout << "\nCOOLCORAL Client: fill table for PixelMap_t" << std::endl; -// int nrows = 0; -// transactionStartUpdate(); -// for (std::map<std::string, std::map<std::string, PixelMap_t> >::const_iterator iter=results->begin<PixelMap_t>(); -// iter != results->end<PixelMap_t>(); -// iter ++) { -// if (m_verbose) std::cout << " Filling table " << m_pixeltable+"_SPECIALPIXELS" << std::endl; -// coral::ITableDataEditor& pixel_editor_2 = m_session->nominalSchema().tableHandle(m_pixeltable+"_SPECIALPIXELS").dataEditor(); -// coral::AttributeList pixel_row_2; -// pixel_editor_2.rowBuffer(pixel_row_2); -// coral::IBulkOperation* pixel_bulk_2= pixel_editor_2.bulkInsert(pixel_row_2,iter->second.size()); -// for (std::map<std::string, PixelMap_t >::const_iterator val_iter=iter->second.begin(); -// val_iter != iter->second.end(); -// val_iter ++) { -// pixel_row_2["FK"].setValue <long long> (fk); -// pixel_row_2["CONNECTIVITY"].setValue <std::string> (val_iter->first); -// pixel_row_2["VARIABLE"].setValue <std::string> (iter->first); -// pixel_row_2["VALUE"].setValue(PixelMapToCLOB(val_iter->second)); -// ++nrows; -// pixel_bulk_2->processNextIteration(); -// } -// pixel_bulk_2->flush(); -// delete pixel_bulk_2; -// } -// transactionCommit(); -// return nrows; -// } - - - -/** Fill a table with PixelCalibData -- A.X. - Couldn't use the templated fillTable<T> above because the object - structure is different... -*/ -int PixCoralClient::fillTablePixelCalibData(long long fk, const char* option){ - if (m_verbose) std::cout << "\nCOOLCORAL Client: fill table for PixelCoralClientUtils::PixelCalibData" << std::endl; - - const char* filename = strstr(option,"file:"); - if (filename==0) { - std::cout << "incorrect option (no file:)" << std::endl; - return 0; - } - - std::ifstream in(filename+5); - if (!in.is_open()) { - std::cout << "could not open calibration file" << std::endl; - return 0; - } - - int nrows = 0; - transactionStartUpdate(); - - { - coral::ITableDataEditor& pixel_editor_2 = m_session->nominalSchema().tableHandle(m_pixeltable+"_PCD").dataEditor(); - coral::AttributeList pixel_row_2 ATLAS_THREAD_SAFE; // Not shared, ok - pixel_editor_2.rowBuffer(pixel_row_2); - int mysize = 1; - coral::IBulkOperation* pixel_bulk_2= pixel_editor_2.bulkInsert(pixel_row_2,mysize); - - while (in) { - int idmod; in >> idmod; - if (in.eof()) break; - - bool ok = true; - for (int i = 0; i<16; ++i) { - char dummy; in >> dummy; - if (dummy!='I') { ok = false; break; } - int idchip; in >> idchip; - if (idchip!=i) { ok = false; break; } - - pixel_row_2["FK"].setValue <long long> (fk); - pixel_row_2["IDMOD"].setValue <int> (idmod); - pixel_row_2["CHIP"].setValue <int> (idchip); - int thres, sigma, noise, timewalk; - in >> thres >> sigma >> noise >> timewalk; - pixel_row_2["THRESHOLD1"].setValue <int> (thres); - pixel_row_2["THRESHOLD2"].setValue <int> (sigma); - pixel_row_2["THRESHOLD3"].setValue <int> (noise); - pixel_row_2["THRESHOLD4"].setValue <int> (timewalk); - in >> thres >> sigma >> noise >> timewalk; - pixel_row_2["THRESHOLDLONG1"].setValue <int> (thres); - pixel_row_2["THRESHOLDLONG2"].setValue <int> (sigma); - pixel_row_2["THRESHOLDLONG3"].setValue <int> (noise); - pixel_row_2["THRESHOLDLONG4"].setValue <int> (timewalk); - in >> thres >> sigma >> noise >> timewalk; - pixel_row_2["THRESHOLDGANGED1"].setValue <int> (thres); - pixel_row_2["THRESHOLDGANGED2"].setValue <int> (sigma); - pixel_row_2["THRESHOLDGANGED3"].setValue <int> (noise); - pixel_row_2["THRESHOLDGANGED4"].setValue <int> (timewalk); - float A, E, C; - in >> A >> E >> C; - pixel_row_2["Q2TOT1"].setValue <float> (A); - pixel_row_2["Q2TOT2"].setValue <float> (E); - pixel_row_2["Q2TOT3"].setValue <float> (C); - in >> A >> E >> C; - pixel_row_2["Q2TOTGANGED1"].setValue <float> (A); - pixel_row_2["Q2TOTGANGED2"].setValue <float> (E); - pixel_row_2["Q2TOTGANGED3"].setValue <float> (C); - float p1, p2; - in >> p1 >> p2; - pixel_row_2["TOTRES1"].setValue <float> (p1); - pixel_row_2["TOTRES2"].setValue <float> (p2); - - ++nrows; - pixel_bulk_2->processNextIteration(); - } - if (!ok) break; - } - if (m_verbose) std::cout << "PixelCalibData: loaded " << nrows << " chips" << std::endl; - - pixel_bulk_2->flush(); - delete pixel_bulk_2; - } - transactionCommit(); - return nrows; -} - - - -//--------------------------------------------------------------------------- -/** Get results for a particular analysis ID - and fill an AnalysisResultList_t container - Optionally get only variable "varname" and/or connectivity object connName - */ -CAN::AnalysisResultList_t PixCoralClient::getAnalysisResultsFromDB(CAN::SerialNumber_t anal_id, const std::string& varname, const std::string& connName){ - - if (m_verbose) { - std::cout << "\n COOLCORAL Client: " << m_pixeltable <<" Putting table content in AnalysisResultList for analysis " << anal_id; - if (varname != "") std::cout<<", variable " << varname; - if (connName != "") std::cout<<", object " << connName; - std::cout<< std::endl; - } - - struct timeval start_time, end_time; - int total_usecs; - gettimeofday(&start_time, NULL); - - transactionStartReadOnly(); - - CAN::AnalysisResultList_t anal_results; - - // Get all entries for anal_id - coral::IQuery* query = m_session->nominalSchema().tableHandle(m_pixeltable).newQuery(); - query->addToOutputList("ANAL_ID"); - query->defineOutputType("ANAL_ID",coral::AttributeSpecification::typeNameForType<CAN::SerialNumber_t>()); - query->addToOutputList("DATE"); - query->defineOutputType("DATE",coral::AttributeSpecification::typeNameForType<time_t>()); - query->addToOutputList("FK"); - std::string pixel_cond = m_pixeltable+".ANAL_ID = :analid"; - coral::AttributeList pixel_condData ATLAS_THREAD_SAFE; // Not shared, ok - pixel_condData.extend<CAN::SerialNumber_t>( "analid" ); - query->setCondition( pixel_cond, pixel_condData); - pixel_condData[0].data<CAN::SerialNumber_t>() = anal_id; - coral::ICursor& cursor = query->execute(); - - int nRows = 0; - while ( cursor.next() ) { - const coral::AttributeList &row0 = cursor.currentRow(); - if (m_verbose) { - std::time_t timet = GMTtoLocalTime(row0[1].data<time_t>()); - char buf[32]; - std::string time = ctime_r(&timet, buf); - std::cout << " ANAL_ID = " << row0[0].data<CAN::SerialNumber_t>() - << " DATE = " << time.substr(0,time.size()-1) - << " FK = " << row0[2].data<long long>() << std::endl; - } - //row0.toOutputStream(std::cout)<<endl; - ++nRows; - // Show the variables - std::set<std::string> tables = m_session->nominalSchema().listTables(); - for ( std::set<std::string>::const_iterator tName = tables.begin(); - tName != tables.end(); ++tName ){ - if ((*tName).find(m_pixeltable+"_") != std::string::npos) { - coral::IQuery* query_2 = m_session->nominalSchema().tableHandle(*tName).newQuery(); - - // Get the list of columns - const coral::ITableDescription& tableDesc = - m_session->nominalSchema().tableHandle(*tName).description(); - int NumCol = tableDesc.numberOfColumns(); - std::vector<std::string> colName; colName.resize(NumCol); - std::vector<std::string> colType; colType.resize(NumCol); - //if (m_verbose) std::cout << "\n Name: "<< *tName << std::endl; - for(int i=0; i<NumCol; ++i){ - const coral::IColumn& colDesc = tableDesc.columnDescription(i); - colName[i] = colDesc.name(); - colType[i] = colDesc.type(); - query_2->addToOutputList(colDesc.name()); - //if (m_verbose) std::cout <<" "<<i<<": "<< colName[i] <<" ("<< colType[i]<<")"<< std::endl; - } - - // Second query to get entries in each table - std::string pixel_cond_2 = (*tName)+".FK = :analfk"; - coral::AttributeList pixel_condData_2 ATLAS_THREAD_SAFE; // Not shared, ok - pixel_condData_2.extend<long long>( "analfk" ); - pixel_condData_2[0].data<long long>() = row0[2].data<long long>(); - if (varname != "") { - pixel_cond_2 += " AND "+(*tName)+".VARIABLE = :var"; - pixel_condData_2.extend<std::string>("var"); - pixel_condData_2["var"].data<std::string>() = varname; - } - if (connName != "") { - pixel_cond_2 += " AND "+(*tName)+".CONNECTIVITY = :conn"; - pixel_condData_2.extend<std::string>("conn"); - pixel_condData_2["conn"].data<std::string>() = connName; - } - query_2->setCondition( pixel_cond_2, pixel_condData_2); - coral::ICursor& cursor_2 = query_2->execute(); - while ( cursor_2.next() ) { - const coral::AttributeList &row0_2 = cursor_2.currentRow(); - const std::string conn = row0_2[1].data<std::string>(); - if (m_verbose) std::cout << " conn = " << conn; - if (NumCol == 4) { // single value - if (m_verbose) std::cout<< " ("<<colType[3]<<")"<<row0_2[2].data<std::string>()<<"="; - if (colType[3] == "float") { - if (m_verbose) std::cout << row0_2[3].data<float>(); - anal_results.addValue<float>(row0_2[2].data<std::string>(),conn,row0_2[3].data<float>()); - } else if (colType[3] == "int") { - if (m_verbose) std::cout << row0_2[3].data<int>(); - anal_results.addValue<unsigned int>(row0_2[2].data<std::string>(),conn,row0_2[3].data<int>()); - } else if (colType[3] == "bool") { - if (m_verbose) std::cout << row0_2[3].data<bool>(); - anal_results.addValue<bool>(row0_2[2].data<std::string>(),conn,row0_2[3].data<bool>()); - } else if (colType[3] == "string") { - if (m_verbose) std::cout << row0_2[3].data<std::string>(); - anal_results.addValue<PixelMap_t>(row0_2[2].data<std::string>(),conn,CLOBtoPixelMap(row0_2[3].data<std::string>())); - } - - } else { //AverageResult_t - if (m_verbose) std::cout<<" (avres)"<<row0_2[2].data<std::string>()<<"="<<row0_2[3].data<int>()<<"/"<<row0_2[4].data<float>()<<"/"<<row0_2[5].data<float>()<<"/"<<row0_2[6].data<float>()<<"/"<<row0_2[7].data<float>(); - CAN::AverageResult_t avres(row0_2[3].data<int>(),row0_2[4].data<float>(),row0_2[5].data<float>(),row0_2[6].data<float>(),row0_2[7].data<float>()); - anal_results.addValue<CAN::AverageResult_t>(row0_2[2].data<std::string>(),conn,avres); - } - if (m_verbose) std::cout<< std::endl; - } - delete query_2; - } - } - } - delete query; - - transactionCommit(); - - if (m_verbose) printf(" Total %d analyses\n", nRows); - - gettimeofday(&end_time, NULL); - total_usecs = (end_time.tv_sec-start_time.tv_sec) * 1000000 + - (end_time.tv_usec-start_time.tv_usec); - if (m_verbose) std::cout << " Total time was " << total_usecs << " usec" << std::endl; - return anal_results; -} - - - - - - -//--------------------------------------------------------------------------- -/** Get results for a particular analysis ID and a vector of connectivity - objects connName and fill an AnalysisResultList_t container - Optionally get only variable "varname" - */ -CAN::AnalysisResultList_t PixCoralClient::getAnalysisResultsFromDB(CAN::SerialNumber_t anal_id, const std::vector<std::string> &connName, const std::string& varname){ - - if (m_verbose) { - std::cout << "\n COOLCORAL Client: " << m_pixeltable <<" Putting table content in AnalysisResultList for analysis " << anal_id; - if (varname != "") std::cout<<", variable " << varname; - if (!connName.empty()) { - std::cout<<", objects "; - for (std::vector<std::string>::const_iterator it=connName.begin(); - it != connName.end(); ++it) - std::cout << *it <<", "; - } - std::cout<< std::endl; - } - - struct timeval start_time, end_time; - int total_usecs; - gettimeofday(&start_time, NULL); - - transactionStartReadOnly(); - - CAN::AnalysisResultList_t anal_results; - - // Get all entries for anal_id - coral::IQuery* query = m_session->nominalSchema().tableHandle(m_pixeltable).newQuery(); - query->addToOutputList("ANAL_ID"); - query->defineOutputType("ANAL_ID",coral::AttributeSpecification::typeNameForType<CAN::SerialNumber_t>()); - query->addToOutputList("DATE"); - query->defineOutputType("DATE",coral::AttributeSpecification::typeNameForType<time_t>()); - query->addToOutputList("FK"); - std::string pixel_cond = m_pixeltable+".ANAL_ID = :analid"; - coral::AttributeList pixel_condData ATLAS_THREAD_SAFE; // Not shared, ok - pixel_condData.extend<CAN::SerialNumber_t>( "analid" ); - query->setCondition( pixel_cond, pixel_condData); - pixel_condData[0].data<CAN::SerialNumber_t>() = anal_id; - coral::ICursor& cursor = query->execute(); - - int nRows = 0; - while ( cursor.next() ) { - const coral::AttributeList &row0 = cursor.currentRow(); - if (m_verbose) { - std::time_t timet = GMTtoLocalTime(row0[1].data<time_t>()); - char buf[32]; - std::string time = ctime_r(&timet, buf); - std::cout << " ANAL_ID = " << row0[0].data<CAN::SerialNumber_t>() - << " DATE = " << time.substr(0,time.size()-1) - << " FK = " << row0[2].data<long long>() << std::endl; - } - //row0.toOutputStream(std::cout)<<endl; - ++nRows; - // Show the variables - std::set<std::string> tables = m_session->nominalSchema().listTables(); - for ( std::set<std::string>::const_iterator tName = tables.begin(); - tName != tables.end(); ++tName ){ - if ((*tName).find(m_pixeltable+"_") != std::string::npos) { - coral::IQuery* query_2 = m_session->nominalSchema().tableHandle(*tName).newQuery(); - - // Get the list of columns - const coral::ITableDescription& tableDesc = - m_session->nominalSchema().tableHandle(*tName).description(); - int NumCol = tableDesc.numberOfColumns(); - std::vector<std::string> colName; colName.resize(NumCol); - std::vector<std::string> colType; colType.resize(NumCol); - for(int i=0; i<NumCol; ++i){ - const coral::IColumn& colDesc = tableDesc.columnDescription(i); - colName[i] = colDesc.name(); - colType[i] = colDesc.type(); - query_2->addToOutputList(colDesc.name()); - //if (m_verbose) std::cout <<" "<<i<<": "<< colName[i] <<" ("<< colType[i]<<")"<< std::endl; - } - - // Second query to get entries in each table - std::string pixel_cond_2 = (*tName)+".FK = :analfk"; - coral::AttributeList pixel_condData_2 ATLAS_THREAD_SAFE; // Not shared, ok - pixel_condData_2.extend<long long>( "analfk" ); - pixel_condData_2[0].data<long long>() = row0[2].data<long long>(); - if (varname != "") { - pixel_cond_2 += " AND "+(*tName)+".VARIABLE = :var"; - pixel_condData_2.extend<std::string>("var"); - pixel_condData_2["var"].data<std::string>() = varname; - } - if (!connName.empty()) { - // now restrict to certain connectivity names. - pixel_cond_2 += " AND ("; - for (std::vector<std::string>::const_iterator conn_iter=connName.begin(); - conn_iter != connName.end(); - ++conn_iter) { - unsigned int counter=pixel_condData_2.size(); - std::stringstream var_name; - var_name << "conn" << counter; - pixel_condData_2.extend<std::string>( var_name.str() ); - assert( pixel_condData_2.size() > counter ); // sanity check - pixel_condData_2[counter].data<std::string>() = *conn_iter; - - pixel_cond_2 += *tName; - pixel_cond_2 += ".CONNECTIVITY = :"; - pixel_cond_2 += var_name.str(); - if (connName.end()-conn_iter > 1 ) { - pixel_cond_2 += " OR "; - } - } - pixel_cond_2 += ")"; - } - query_2->setCondition( pixel_cond_2, pixel_condData_2); - coral::ICursor& cursor_2 = query_2->execute(); - while ( cursor_2.next() ) { - const coral::AttributeList &row0_2 = cursor_2.currentRow(); - const std::string conn = row0_2[1].data<std::string>(); - if (m_verbose) std::cout << " conn = " << conn; - if (NumCol == 4) { // single value - if (m_verbose) std::cout<< " ("<<colType[3]<<")"<<row0_2[2].data<std::string>()<<"="; - if (colType[3] == "float") { - if (m_verbose) std::cout << row0_2[3].data<float>(); - anal_results.addValue<float>(row0_2[2].data<std::string>(),conn,row0_2[3].data<float>()); - } else if (colType[3] == "int") { - if (m_verbose) std::cout << row0_2[3].data<int>(); - anal_results.addValue<unsigned int>(row0_2[2].data<std::string>(),conn,row0_2[3].data<int>()); - } else if (colType[3] == "bool") { - if (m_verbose) std::cout << row0_2[3].data<bool>(); - anal_results.addValue<bool>(row0_2[2].data<std::string>(),conn,row0_2[3].data<bool>()); - } else if (colType[3] == "string") { - if (m_verbose) std::cout << row0_2[3].data<std::string>(); - anal_results.addValue<PixelMap_t>(row0_2[2].data<std::string>(),conn,CLOBtoPixelMap(row0_2[3].data<std::string>())); - } - - } else { //AverageResult_t - if (m_verbose) std::cout<<" (avres)"<<row0_2[2].data<std::string>()<<"="<<row0_2[3].data<int>()<<"/"<<row0_2[4].data<float>()<<"/"<<row0_2[5].data<float>()<<"/"<<row0_2[6].data<float>()<<"/"<<row0_2[7].data<float>(); - CAN::AverageResult_t avres(row0_2[3].data<int>(),row0_2[4].data<float>(),row0_2[5].data<float>(),row0_2[6].data<float>(),row0_2[7].data<float>()); - anal_results.addValue<CAN::AverageResult_t>(row0_2[2].data<std::string>(),conn,avres); - } - if (m_verbose) std::cout<< std::endl; - } - delete query_2; - } - } - } - delete query; - - transactionCommit(); - - if (m_verbose) printf(" Total %d analyses\n", nRows); - - gettimeofday(&end_time, NULL); - total_usecs = (end_time.tv_sec-start_time.tv_sec) * 1000000 + - (end_time.tv_usec-start_time.tv_usec); - if (m_verbose) std::cout << " Total time was " << total_usecs << " usec" << std::endl; - return anal_results; -} - - -/** access calibration data using tag / revision -- A.X. - */ -void PixCoralClient::getCalibrationDataFromDB(const char* option){ - if (m_verbose) { - std::cout << "\n COOLCORAL Client: " << m_pixeltable << " loading calibration data using option " << option << std::endl; - } - - struct timeval start_time, end_time; - int total_usecs; - gettimeofday(&start_time, NULL); - - transactionStartReadOnly(); - - // Get all entries for anal_id - coral::IQuery* query = m_session->nominalSchema().tableHandle(m_pixeltable).newQuery(); - - query->addToOutputList("TAG"); - query->defineOutputType("TAG",coral::AttributeSpecification::typeNameForType<std::string>()); - query->addToOutputList("REVISION"); - query->defineOutputType("REVISION",coral::AttributeSpecification::typeNameForType<int>()); - query->addToOutputList("SOURCES"); - query->defineOutputType("SOURCES",coral::AttributeSpecification::typeNameForType<std::string>()); - query->addToOutputList("DATE"); - query->defineOutputType("DATE",coral::AttributeSpecification::typeNameForType<time_t>()); - query->addToOutputList("FK"); - - // parse option - std::string tag(""); - std::string revision(""); - std::string sources(""); - std::string delimiters(", "); - std::string str(option); - std::string::size_type lastPos = str.find_first_not_of(delimiters, 0); - std::string::size_type pos = str.find_first_of(delimiters, lastPos); - while (std::string::npos != pos || std::string::npos != lastPos) { - if (str.substr(lastPos,4)=="tag:") - tag = str.substr(lastPos+4, pos-lastPos-4); - if (str.substr(lastPos,9)=="revision:") - revision = str.substr(lastPos+9, pos-lastPos-9); - if (str.substr(lastPos,8)=="sources:") - sources = str.substr(lastPos+8, pos-lastPos-8); - lastPos = str.find_first_not_of(delimiters, pos); - pos = str.find_first_of(delimiters, lastPos); - } - - coral::AttributeList pixel_condData ATLAS_THREAD_SAFE; // Not shared, ok - std::string pixel_cond = m_pixeltable+".TAG = :tag"; - pixel_condData.extend<std::string>( "tag" ); - pixel_condData[0].data<std::string>() = tag; - // can make it conditional (e.g. if revision!="") - pixel_cond += " AND "+m_pixeltable+".REVISION = :revision"; - pixel_condData.extend<int>( "revision" ); - pixel_condData["revision"].data<int>() = atoi(revision.c_str()); - query->setCondition( pixel_cond, pixel_condData); - coral::ICursor& cursor = query->execute(); - - int nRows = 0; - while ( cursor.next() ) { - const coral::AttributeList &row0 = cursor.currentRow(); - if (m_verbose) { - std::time_t timet = GMTtoLocalTime(row0[3].data<time_t>()); - char buf[32]; - std::string time = ctime_r(&timet, buf); - std::cout << " TAG = " << row0[0].data<std::string>() - << " REVISION = " << row0[1].data<int>() - << " SOURCES = " << row0[2].data<std::string>() - << " DATE = " << time.substr(0,time.size()-1) - << " FK = " << row0[4].data<long long>() << std::endl; - } - //row0.toOutputStream(std::cout)<<endl; - ++nRows; - // Show the variables - std::set<std::string> tables = m_session->nominalSchema().listTables(); - for ( std::set<std::string>::const_iterator tName = tables.begin(); - tName != tables.end(); ++tName ){ - if ((*tName).find(m_pixeltable+"_") != std::string::npos) { - if (m_verbose) { - std::cout << "found table " << (*tName) << std::endl; - } - - coral::IQuery* query_2 = m_session->nominalSchema().tableHandle(*tName).newQuery(); - - // Get the list of columns - const coral::ITableDescription& tableDesc = - m_session->nominalSchema().tableHandle(*tName).description(); - int NumCol = tableDesc.numberOfColumns(); - std::vector<std::string> colName; colName.resize(NumCol); - std::vector<std::string> colType; colType.resize(NumCol); - for(int i=0; i<NumCol; ++i){ - const coral::IColumn& colDesc = tableDesc.columnDescription(i); - colName[i] = colDesc.name(); - colType[i] = colDesc.type(); - query_2->addToOutputList(colDesc.name()); - if (m_verbose) std::cout <<" "<<i<<": "<< colName[i] <<" ("<< colType[i]<<")"<< std::endl; - } - - // Second query to get entries in each table - std::string pixel_cond_2 = (*tName)+".FK = :fk"; - coral::AttributeList pixel_condData_2 ATLAS_THREAD_SAFE; // Not shared, ok - pixel_condData_2.extend<long long>( "fk" ); - pixel_condData_2[0].data<long long>() = row0[4].data<long long>(); - query_2->setCondition( pixel_cond_2, pixel_condData_2); - coral::ICursor& cursor_2 = query_2->execute(); - // TO BE FIXED: the whole thing should not go to a single pcd :) - PixelCoralClientUtils::PixelCalibData pcd; - while ( cursor_2.next() ) { - const coral::AttributeList &row0_2 = cursor_2.currentRow(); - //int ix = 3; - //int idmod = row0_2[ix++].data<int>(); - int ix = 4; - PixelCoralClientUtils::PixelCalibData::PixelChipSummaryData pcsd; - int idchip = row0_2[ix++].data<int>(); - pcsd.setChipID(idchip); - int iv[4]; - for (int m=0; m<4; ++m) iv[m] = row0_2[ix++].data<int>(); - pcsd.setThreshold(0,iv[0],iv[1],iv[2],iv[3]); - for (int m=0; m<4; ++m) iv[m] = row0_2[ix++].data<int>(); - pcsd.setThreshold(1,iv[0],iv[1],iv[2],iv[3]); - for (int m=0; m<4; ++m) iv[m] = row0_2[ix++].data<int>(); - pcsd.setThreshold(2,iv[0],iv[1],iv[2],iv[3]); - float fv[3]; - for (int m=0; m<3; ++m) fv[m] = row0_2[ix++].data<float>(); - pcsd.setQ2Tot(0,fv[0],fv[1],fv[2]); - for (int m=0; m<3; ++m) fv[m] = row0_2[ix++].data<float>(); - pcsd.setQ2Tot(2,fv[0],fv[1],fv[2]); - for (int m=0; m<2; ++m) fv[m] = row0_2[ix++].data<float>(); - pcsd.setTotRes(fv[0],fv[1]); - pcd.add(pcsd); - } - if (m_verbose) { - pcd.print(); - } - delete query_2; - } - } - } - delete query; - - transactionCommit(); - - if (m_verbose) printf(" Total %d analyses\n", nRows); - - gettimeofday(&end_time, NULL); - total_usecs = (end_time.tv_sec-start_time.tv_sec) * 1000000 + - (end_time.tv_usec-start_time.tv_usec); - if (m_verbose) std::cout << " Total time was " << total_usecs << " usec" << std::endl; -} - - - -/** CORAL helper to start a transaction in readonly mode - */ -void PixCoralClient::transactionStartReadOnly(){ - connect(); - if (m_session->transaction().isActive()) m_session->transaction().rollback(); - m_session->transaction().start(true /*ReadOnly*/); -} - - - -/** CORAL helper to start a transaction in update mode - */ -void PixCoralClient::transactionStartUpdate(){ - connect(); - if (m_session->transaction().isActive()) m_session->transaction().rollback(); - m_session->transaction().start(false /*update*/); -} - - - -/** CORAL helper to commit changes at the end of a transaction - */ -void PixCoralClient::transactionCommit(){ - if (m_session->transaction().isActive()) m_session->transaction().commit(); -} - -namespace PixA { - /** Translate between chip and module coordinates. - * copied from PixelDataContainer - * - * @authors Joern Grosse-Knetter <joern.grosse-knetter@uni-bonn.de> - */ - class PixelCoord_t - { - public: - static const int s_nChip = 16; - static const int s_nPix = 2880; - static const int s_nSpecialPix = 448; - static const int s_nCol = 18; - static const int s_nRow = 160; - - PixelCoord_t(int xval, int yval) { - if(yval<s_nRow){ // chips 0-7 - m_row = yval; - m_col = xval%s_nCol; - m_chip = xval/s_nCol; - } else{ - m_row = 2*s_nRow-1- yval; - m_col = s_nCol-1 - xval%s_nCol; - m_chip = s_nChip-1 - xval/s_nCol; - } - } - - PixelCoord_t(int chip, int col, int row) : m_chip(chip), m_col(col), m_row(row) {} - - int chip() const {return m_chip;} - int col() const {return m_col;} - int row() const {return m_row;} - - int pixel() const { return chip()*s_nPix+row()+s_nRow*col(); } - - int x() const { - - if(m_chip<s_nChip/2) { - return m_chip*s_nCol+m_col; - } - else { - return (s_nCol-1-m_col + s_nCol*(s_nChip-1-m_chip)); - } - - } - - int y() const { - if (m_chip<s_nChip/2) { - return m_row; - } - else { - return 2*s_nRow-1-m_row; - } - } - - private: - int m_chip; - int m_col; - int m_row; - }; - - - - unsigned int encodePixelID (unsigned int mod_column, unsigned int mod_row) { - unsigned int chip = 0, column = 0, row = 0; - - PixelCoord_t pix(mod_column, mod_row); - chip = pix.chip(); - column = pix.col(); - row = pix.row(); - - return PixelCoralClientUtils::ModuleSpecialPixelMap::encodePixelID(chip,column,row); - - } - -} - -/** - Converts a CAN::PixelMap_t object to a CLOB compatible with - ModuleSpecialPixelMap -*/ -std::string PixCoralClient::PixelMapToCLOB(const PixelMap_t & pixmap) { - std::map<unsigned int, unsigned int> pixels; - for (PixelMap_t::const_iterator it=pixmap.begin(); it != pixmap.end(); ++it) { - pixels[PixA::encodePixelID((*it).first.first,(*it).first.second)] = (*it).second; - } - unsigned int module_status = 0; - std::vector<unsigned int> chip_status; - std::vector<std::vector<unsigned int> > column_pair_status; - PixelCoralClientUtils::ModuleSpecialPixelMap special = PixelCoralClientUtils::ModuleSpecialPixelMap(pixels,module_status,chip_status,column_pair_status); - special.markSpecialRegions(); - //std::cout<<"CLOB: "<<special.to_string()<<std::endl;; - return special.to_string(); -} - -/** - Converts a CLOB compatible with ModuleSpecialPixelMap to a - CAN::PixelMap_t object -*/ -PixelMap_t PixCoralClient::CLOBtoPixelMap(const std::string & clob) { - PixelCoralClientUtils::ModuleSpecialPixelMap special; - special.fill_from_string(clob); - PixelMap_t pixels; - //std::cout<<"CLOB content: "<<std::endl; - unsigned int fe, col, row; - for (PixelCoralClientUtils::ModuleSpecialPixelMap::const_iterator it=special.begin(); it != special.end(); ++it) { - //std::cout<<" "<<it->first<<" "<<it->second<<" "; - fe = it->first%16; - col = (it->first >> 4)%32; - row = (it->first>>9); - //std::cout<<fe<<" "<<col<<"/"<<row<<std::endl; - PixA::PixelCoord_t pixel_coord(fe, col, row); - pixels[std::make_pair(pixel_coord.x(), pixel_coord.y())] = it->second;//CLA - } - if (special.moduleStatus() != 0) { - unsigned int status = special.moduleStatus(); - // if (m_verbose) std::cout<<"Special module with status "<<status<<std::endl; - for (unsigned int chip=0; chip<16; ++chip) { - for (unsigned int c=0; c<18; ++c) { - for (unsigned int r=0; r<160; ++r) { - PixA::PixelCoord_t pixel_coord(chip, c, r); - pixels[std::make_pair(pixel_coord.x(), pixel_coord.y())] = status; - - } - } - } - } else if (special.hasSpecialChips()) { - for (unsigned int chip=0; chip<16; ++chip) { - unsigned int status = special.chipStatus(chip); - if (status != 0) { - //if (m_verbose) std::cout<<"Special chip "<<chip<<" with status "<<status<<std::endl; - for (unsigned int c=0; c<18; ++c) { - for (unsigned int r=0; r<160; ++r) { - PixA::PixelCoord_t pixel_coord(chip, c, r); - pixels[std::make_pair(pixel_coord.x(), pixel_coord.y())] = status; - } - } - } - } - } - if (special.hasSpecialColumnPairs()) { - for (unsigned int chip=0; chip<16; ++chip) { - if (special.hasSpecialColumnPairs(chip)) { - for (unsigned int pair=0; pair<9; ++pair) { - unsigned int status = special.columnPairStatus(chip,pair); - if (status != 0) { - // if (m_verbose) std::cout<<"Special pair "<<pair<<" on chip "<<chip<<" with status "<<status<<std::endl; - for (int i=0; i<160; ++i) { - PixA::PixelCoord_t pixel_coord(chip, pair*2, i); - pixels[std::make_pair(pixel_coord.x(),pixel_coord.y())] = status; - PixA::PixelCoord_t pixel_coord2(chip, pair*2+1, i); - pixels[std::make_pair(pixel_coord2.x(),pixel_coord2.y())] = status; - } - } - } - } - } - } - - return pixels; -} - - - -//------------------------------------------------ -/// Get value from PVSS archive -//------------------------------------------------ -double PixCoralClient::get_value_from_PVSSarch(const std::string& element_name, const coral::TimeStamp &since, const coral::TimeStamp &until) -{ - double result=0; - - transactionStartReadOnly(); - - // Perform a query involving a subquery. - - coral::IQuery* query = m_session->nominalSchema().newQuery(); - query->addToOutputList( "A.ELEMENT_NAME", "NAME" ); - query->addToOutputList( "A.ALIAS", "ALIAS" ); - query->addToOutputList( "B.TS", "TS" ); - query->addToOutputList( "B.VALUE_NUMBER", "VALUE" ); - - coral::IQueryDefinition& subQuery1 = query->defineSubQuery( "A" ); - subQuery1.addToOutputList( "ELEMENT_ID" ); - subQuery1.addToOutputList( "ELEMENT_NAME" ); - subQuery1.addToOutputList( "ALIAS" ); - subQuery1.addToTableList( "ELEMENTS" ); - coral::AttributeList cond1 ATLAS_THREAD_SAFE; // Not shared, ok - cond1.extend<std::string>( "el_name" ); - subQuery1.setCondition( "ELEMENT_NAME = :el_name", cond1 ); - query->addToTableList( "A" ); - - coral::IQueryDefinition& subQuery2 = query->defineSubQuery( "B" ); - subQuery2.addToOutputList( "ELEMENT_ID" ); - subQuery2.addToOutputList( "TS" ); - subQuery2.addToOutputList( "VALUE_NUMBER"); - subQuery2.addToTableList( "EVENTHISTORY" ); - query->addToTableList( "B" ); - - coral::AttributeList time ATLAS_THREAD_SAFE; // Not shared, ok - time.extend<coral::TimeStamp>( "since" ); - time.extend<coral::TimeStamp>( "until" ); - - query->setCondition( "A.ELEMENT_ID = B.ELEMENT_ID AND B.TS > :since AND B.TS < :until" , time); - query ->addToOrderList("B.TS DESC"); - - - cond1[0].data<std::string>() = element_name; - time[0].data<coral::TimeStamp>() = since; - time[1].data<coral::TimeStamp>() = until; - - coral::ICursor& cursor = query->execute(); - coral::AttributeList sel ATLAS_THREAD_SAFE; // Not shared, ok - if ( cursor.next() ){ sel = cursor.currentRow(); - - result = sel[3].data<double>(); - std::cout << "Element name = " << sel[0].data<std::string>() << std::endl; - std::cout << "Alias = " << sel[1].data<std::string>() << std::endl; - std::cout << "Value = " << result << std::endl; - -} - // cursor.currentRow().toOutputStream( std::cout ) << std::endl; - - std::cout << "Result = " << result << std::endl; - - delete query; - transactionCommit(); - - return result; - -} - -//------------------------------------------------ -/// Get value from PVSS archive -//------------------------------------------------ -double PixCoralClient::get_values_from_PVSSarch(const std::string& element_name, const coral::TimeStamp &since, const coral::TimeStamp &until){ - - double result=0; - - transactionStartReadOnly(); - - // Perform a query involving a subquery. - - coral::IQuery* query = m_session->nominalSchema().newQuery(); - query->addToOutputList( "A.ELEMENT_NAME", "NAME" ); - query->addToOutputList( "B.TS", "TS" ); - query->addToOutputList( "B.VALUE_NUMBER", "VALUE" ); - - coral::IQueryDefinition& subQuery1 = query->defineSubQuery( "A" ); - subQuery1.addToOutputList( "ELEMENT_ID" ); - subQuery1.addToOutputList( "ELEMENT_NAME" ); - subQuery1.addToTableList( "ELEMENTS" ); - coral::AttributeList cond1 ATLAS_THREAD_SAFE; // Not shared, ok - cond1.extend<std::string>( "el_name" ); - subQuery1.setCondition( "ELEMENT_NAME = :el_name", cond1 ); - query->addToTableList( "A" ); - - coral::IQueryDefinition& subQuery2 = query->defineSubQuery( "B" ); - subQuery2.addToOutputList( "ELEMENT_ID" ); - subQuery2.addToOutputList( "TS" ); - subQuery2.addToOutputList( "VALUE_NUMBER"); - subQuery2.addToTableList( "EVENTHISTORY" ); - query->addToTableList( "B" ); - - coral::AttributeList time ATLAS_THREAD_SAFE; // Not shared, ok - time.extend<coral::TimeStamp>( "since" ); - time.extend<coral::TimeStamp>( "until" ); - - query->setCondition( "A.ELEMENT_ID = B.ELEMENT_ID AND B.TS > :since AND B.TS < :until" , time); - query ->addToOrderList("B.TS DESC"); - - - cond1[0].data<std::string>() = element_name; - time[0].data<coral::TimeStamp>() = since; - time[1].data<coral::TimeStamp>() = until; - - coral::ICursor& cursor = query->execute(); - coral::AttributeList sel ATLAS_THREAD_SAFE; // Not shared, ok - // if ( cursor.next() ){ - while ( cursor.next() ){ - sel = cursor.currentRow(); - result = sel[2].data<double>(); - // cursor.currentRow().toOutputStream( std::cout ) << std::endl; - std::cout << "Result = " << result << std::endl; - } - - delete query; - transactionCommit(); - - return result; - } - -//------------------------------------------------ -/// Get value from PVSS archive -//------------------------------------------------ -void PixCoralClient::get_alias_from_PVSSarch(){ - - transactionStartReadOnly(); - - // Perform a query involving a subquery. - - coral::IQuery* query = m_session->nominalSchema().tableHandle("ELEMENTS").newQuery(); - query->addToOutputList( "ELEMENT_NAME"); - query->addToOutputList( "ALIAS"); - - // query->setCondition( "A.ELEMENT_ID = B.ELEMENT_ID AND B.TS > :since AND B.TS < :until" , time); - // query ->addToOrderList("B.TS DESC"); - - -// cond1[0].data<std::string>() = element_name; -// time[0].data<coral::TimeStamp>() = since; -// time[1].data<coral::TimeStamp>() = until; - - coral::ICursor& cursor = query->execute(); - coral::AttributeList sel ATLAS_THREAD_SAFE; // Not shared, ok - // if ( cursor.next() ){ - std::cout << "NAME\t\t\t ALIAS" << std::endl; - while ( cursor.next() ){ - sel = cursor.currentRow(); - std::string elname = sel[0].data<std::string>(); - std::string elalias = sel[1].data<std::string>(); - - - std::cout << elname << "\t\t\t " << elalias << std::endl; - } - - delete query; - transactionCommit(); - - // return result; -} diff --git a/InnerDetector/InDetConditions/PixelCoralClientUtils/src/PCDDb.cxx b/InnerDetector/InDetConditions/PixelCoralClientUtils/src/PCDDb.cxx deleted file mode 100644 index eece038f893566a6d7354efb81bdf731d7909eda..0000000000000000000000000000000000000000 --- a/InnerDetector/InDetConditions/PixelCoralClientUtils/src/PCDDb.cxx +++ /dev/null @@ -1,227 +0,0 @@ -/* - Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration -*/ - -#include "PixelCoralClientUtils/PCDDb.h" -#include "PixelCoralClientUtils/PixelCalibData.hh" - -// CORAL API -#include "CoralKernel/Context.h" -#include "CoralBase/Attribute.h" -#include "CoralBase/AttributeList.h" -#include "CoralBase/AttributeListException.h" -#include "RelationalAccess/IConnectionService.h" -#include "RelationalAccess/IConnectionServiceConfiguration.h" -#include "RelationalAccess/AccessMode.h" -#include "RelationalAccess/ISessionProxy.h" -#include "RelationalAccess/ISchema.h" -#include "RelationalAccess/ITransaction.h" - -#include "RelationalAccess/ITable.h" -#include "RelationalAccess/ITableDescription.h" -#include "RelationalAccess/IColumn.h" -#include "RelationalAccess/ICursor.h" -#include "RelationalAccess/IQuery.h" -#include "RelationalAccess/TableDescription.h" -#include "RelationalAccess/ITableDataEditor.h" -#include "RelationalAccess/ITableSchemaEditor.h" -#include "RelationalAccess/IBulkOperation.h" -#include "RelationalAccess/SchemaException.h" - -#include "CxxUtils/checker_macros.h" - -// std lib -#include <fstream> -#include <iostream> -#include <vector> -#include <set> -using namespace std; - -//--------------------------------------------------------------------------- -/** Constructor. - Open the default database and seal context. -*/ -PCDDb::PCDDb(const std::string& connString, - const std::string& tableName, - bool verbose, bool /*load_text*/) : - m_verbose(verbose), - m_session(0), m_connString(connString), m_pixeltable(tableName), - m_query(0), m_query_2(0), m_cursor(0) -{ - //char* ctmp = getenv("CAN_CALIB_DB"); - //if (ctmp) m_connString = ctmp; - // Create the RCDConnectionService - if (m_verbose) cout << "Creating Connection Service to \"" << m_connString << "\"" << endl; - - // Instantiate connection service - coral::Context* context = &coral::Context::instance(); - - // Load CORAL connection service - coral::IHandle<coral::IConnectionService> lookSvcH = context->query<coral::IConnectionService>(); - if (!lookSvcH.isValid()) { - context->loadComponent( "CORAL/Services/ConnectionService" ); - lookSvcH = context->query<coral::IConnectionService>(); - } - if (!lookSvcH.isValid()) { - throw std::runtime_error( "Could not locate the connection service" ); - } - /// connection to CORAL - m_session = lookSvcH->connect( m_connString, coral::Update ); -} - -PCDDb::~PCDDb() -{ - if (m_session) { - bool was_there = m_query!=0; - - // cleanup - delete m_query_2; // ok if m_query_2==0 - delete m_query; // ditto - if (was_there) transactionCommit(); - - if (m_verbose) cout << "Disconnecting \"" << m_connString << "\"" << endl; - delete m_session; - } -} - -bool PCDDb::init (const std::string& tag, int revision) -{ - if (m_verbose) cout << "PCDDb::init(" << tag << ", " << revision << ")" << endl; - - transactionStartReadOnly(); - m_query = m_session->nominalSchema().tableHandle(m_pixeltable).newQuery(); - - m_query->addToOutputList("TAG"); - m_query->defineOutputType("TAG",coral::AttributeSpecification::typeNameForType<std::string>()); - m_query->addToOutputList("REVISION"); - m_query->defineOutputType("REVISION",coral::AttributeSpecification::typeNameForType<int>()); - m_query->addToOutputList("SOURCES"); - m_query->defineOutputType("SOURCES",coral::AttributeSpecification::typeNameForType<std::string>()); - m_query->addToOutputList("DATE"); - m_query->defineOutputType("DATE",coral::AttributeSpecification::typeNameForType<time_t>()); - m_query->addToOutputList("FK"); - - coral::AttributeList pixel_condData ATLAS_THREAD_SAFE; // Not shared, ok - std::string pixel_cond = m_pixeltable+".TAG = :tag"; - pixel_condData.extend<string>( "tag" ); - pixel_condData[0].data<string>() = tag; - pixel_cond += " AND "+m_pixeltable+".REVISION = :revision"; - pixel_condData.extend<int>( "revision" ); - pixel_condData["revision"].data<int>() = revision; - m_query->setCondition( pixel_cond, pixel_condData); - coral::ICursor& cursor = m_query->execute(); - - while (cursor.next()) { - const coral::AttributeList &row0 = cursor.currentRow(); - if (m_verbose) { - time_t timet = row0[3].data<time_t>(); - char buf[32]; - string time = ctime_r(&timet, buf); - cout << " TAG = " << row0[0].data<string>() - << " REVISION = " << row0[1].data<int>() - << " SOURCES = " << row0[2].data<string>() - << " TIME = " << time.substr(0,time.size()-1) - << " FK = " << row0[4].data<long long>() << endl; - } - std::set<string> tables = m_session->nominalSchema().listTables(); - for (std::set<string>::const_iterator tName = tables.begin(); - tName != tables.end(); ++tName) { - if ((*tName).find(m_pixeltable+"_") != string::npos) { - if (m_verbose) cout << "found table " << *tName << endl; - m_query_2 = m_session->nominalSchema().tableHandle(*tName).newQuery(); - - // Get the list of columns - const coral::ITableDescription& tableDesc = m_session->nominalSchema().tableHandle(*tName).description(); - int NumCol = tableDesc.numberOfColumns(); - std::vector<string> colName; colName.resize(NumCol); - std::vector<string> colType; colType.resize(NumCol); - for(int i = 0; i<NumCol; ++i){ - const coral::IColumn& colDesc = tableDesc.columnDescription(i); - colName[i] = colDesc.name(); - colType[i] = colDesc.type(); - m_query_2->addToOutputList(colDesc.name()); - if (m_verbose) cout << " " << i << ": " << colName[i] <<" ("<< colType[i] << ")" << endl; - } - - // Second query to get entries - string pixel_cond_2 = (*tName)+".FK = :fk"; - coral::AttributeList pixel_condData_2 ATLAS_THREAD_SAFE; // Not shared, ok - pixel_condData_2.extend<long long>( "fk" ); - pixel_condData_2[0].data<long long>() = row0[4].data<long long>(); - m_query_2->setCondition( pixel_cond_2, pixel_condData_2); - coral::ICursor& cursor_2 = m_query_2->execute(); - - // .. and keep the cursor for data extraction - m_cursor = &cursor_2; - - // success - return true; - } - } - } - - // table not found - return false; -} - -int PCDDb::next() -{ - if (!m_cursor->next()) return 0; - const coral::AttributeList& row0_2 = m_cursor->currentRow(); - int idmod = row0_2[1].data<int>(); - return idmod; -} - -bool PCDDb::set(int idmod_cur, PixelCoralClientUtils::PixelCalibData& pcd) -{ - const coral::AttributeList& row0_2 = m_cursor->currentRow(); - int ix = 1; - int idmod = row0_2[ix++].data<int>(); - if (idmod != idmod_cur) return false; - - for (int i = 0; i<16; ++i) { - PixelCoralClientUtils::PixelCalibData::PixelChipSummaryData pcsd; - pcsd.setChipID(i); - int iv[4]; - for (int m=0; m<4; ++m) iv[m] = row0_2[ix++].data<int>(); - pcsd.setThreshold(0,iv[0],iv[1],iv[2],iv[3]); - for (int m=0; m<4; ++m) iv[m] = row0_2[ix++].data<int>(); - pcsd.setThreshold(1,iv[0],iv[1],iv[2],iv[3]); - for (int m=0; m<4; ++m) iv[m] = row0_2[ix++].data<int>(); - pcsd.setThreshold(2,iv[0],iv[1],iv[2],iv[3]); - float fv[3]; - for (int m=0; m<3; ++m) fv[m] = row0_2[ix++].data<float>(); - pcsd.setQ2Tot(0,fv[0],fv[1],fv[2]); - for (int m=0; m<3; ++m) fv[m] = row0_2[ix++].data<float>(); - pcsd.setQ2Tot(2,fv[0],fv[1],fv[2]); - for (int m=0; m<2; ++m) fv[m] = row0_2[ix++].data<float>(); - pcsd.setTotRes(fv[0],fv[1]); - pcd.add(pcsd); - } - - return true; -} - -/** CORAL helper to start a transaction in readonly mode - */ -void PCDDb::transactionStartReadOnly(){ - if (m_session->transaction().isActive()) m_session->transaction().rollback(); - m_session->transaction().start(true /*ReadOnly*/); -} - - - -/** CORAL helper to start a transaction in update mode - */ -void PCDDb::transactionStartUpdate(){ - if (m_session->transaction().isActive()) m_session->transaction().rollback(); - m_session->transaction().start(false /*update*/); -} - - - -/** CORAL helper to commit changes at the end of a transaction - */ -void PCDDb::transactionCommit(){ - if (m_session->transaction().isActive()) m_session->transaction().commit(); -} diff --git a/InnerDetector/InDetConditions/PixelCoralClientUtils/src/PCDio.cc b/InnerDetector/InDetConditions/PixelCoralClientUtils/src/PCDio.cc deleted file mode 100644 index 3f30e34ab259b39956405bc39f9e67cc0472af1f..0000000000000000000000000000000000000000 --- a/InnerDetector/InDetConditions/PixelCoralClientUtils/src/PCDio.cc +++ /dev/null @@ -1,566 +0,0 @@ -/* - Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration -*/ - -#include "PixelCoralClientUtils/PCDio.h" -#include "PixelCoralClientUtils/PixelCalibData.hh" - -// CORAL API -#include "CoralKernel/Context.h" -#include "CoralBase/Attribute.h" -#include "CoralBase/AttributeList.h" -#include "CoralBase/AttributeListException.h" -#include "RelationalAccess/IConnectionService.h" -#include "RelationalAccess/IConnectionServiceConfiguration.h" -#include "RelationalAccess/AccessMode.h" -#include "RelationalAccess/ISessionProxy.h" -#include "RelationalAccess/ISchema.h" -#include "RelationalAccess/ITransaction.h" - -#include "RelationalAccess/ITable.h" -#include "RelationalAccess/ITableDescription.h" -#include "RelationalAccess/IColumn.h" -#include "RelationalAccess/ICursor.h" -#include "RelationalAccess/IQuery.h" -#include "RelationalAccess/TableDescription.h" -#include "RelationalAccess/ITableDataEditor.h" -#include "RelationalAccess/ITableSchemaEditor.h" -#include "RelationalAccess/IBulkOperation.h" -#include "RelationalAccess/SchemaException.h" - -// std lib -#include <fstream> -#include <iostream> -#include <vector> -#include <set> -#include <sys/time.h> -using namespace std; - -//--------------------------------------------------------------------------- -/** Constructor. - Open the default database and seal context. - */ -PCDio::PCDio(const std::string& connString, - const std::string& tableName, - int verbose) : - m_connString(connString), m_pixeltable(tableName), - m_verbose(verbose), m_session(0) {} - -PCDio::~PCDio() -{ - if (m_verbose) cout << "Disconnecting \"" << m_connString << "\"" << endl; - delete m_session; -} - -/** initialize connection - */ -void PCDio::init(coral::AccessMode access_mode) -{ - if (m_verbose) cout << "Creating Connection Service to \"" << m_connString << "\"" << endl; - - coral::Context* context = &coral::Context::instance(); - coral::IHandle<coral::IConnectionService> lookSvcH = context->query<coral::IConnectionService>(); - if (!lookSvcH.isValid()) { - context->loadComponent("CORAL/Services/ConnectionService"); - lookSvcH = context->query<coral::IConnectionService>(); - } - if (!lookSvcH.isValid()) { - throw runtime_error("Could not locate the connection service"); - } - - m_session = lookSvcH->connect(m_connString, access_mode); - if (m_verbose) cout << "Connection established" << endl; -} - -/** DB -> pcd.sav - */ -void PCDio::load(const std::string& tag, int revision) -{ - // start timer - struct timeval start_time, end_time; - int total_usecs; - gettimeofday(&start_time, NULL); - -//// TEMP - - transactionStartReadOnly(); - set<string> tables = m_session->nominalSchema().listTables(); - transactionCommit(); - - for (set<string>::const_iterator tName = tables.begin(); - tName != tables.end(); ++tName ){ - cout << "Table: <" << *tName << ">"; - - transactionStartReadOnly(); - coral::IQuery* query = m_session->nominalSchema().tableHandle(*tName).newQuery(); - coral::ICursor& cursor = query->execute(); - int nRows = 0; - while ( cursor.next() ) { - ++nRows; - } - delete query; - transactionCommit(); - - cout << ", Rows = " << nRows << endl; - - } - - transactionStartReadOnly(); -//// - - // build a query - coral::IQuery* query = m_session->nominalSchema().tableHandle(m_pixeltable).newQuery(); - - query->addToOutputList("TAG"); - query->defineOutputType("TAG",coral::AttributeSpecification::typeNameForType<string>()); - query->addToOutputList("REVISION"); - query->defineOutputType("REVISION",coral::AttributeSpecification::typeNameForType<int>()); - query->addToOutputList("SOURCES"); - query->defineOutputType("SOURCES",coral::AttributeSpecification::typeNameForType<string>()); - query->addToOutputList("DATE"); - query->defineOutputType("DATE",coral::AttributeSpecification::typeNameForType<time_t>()); - query->addToOutputList("FK"); - - // construct query condition - coral::AttributeList pixel_condData ATLAS_THREAD_SAFE; // Not shared, ok. - string pixel_cond = m_pixeltable+".TAG = :tag"; - pixel_condData.extend<string>("tag"); - pixel_condData[0].data<string>() = tag; - if (revision>0) { - pixel_cond += " AND "+m_pixeltable+".REVISION = :revision"; - pixel_condData.extend<int>("revision"); - pixel_condData["revision"].data<int>() = revision; - } - query->setCondition( pixel_cond, pixel_condData); - coral::ICursor& cursor = query->execute(); - - int loaded_revision = 0; - - // go through the list of found tables - int nRows = 0; - while ( cursor.next() ) { - const coral::AttributeList &row0 = cursor.currentRow(); - if (m_verbose) { - //time_t timet = GMTtoLocalTime(row0[3].data<time_t>()); - time_t timet = row0[3].data<time_t>(); - char buf[32]; - string time = ctime_r(&timet, buf); - cout << " TAG = " << row0[0].data<string>() - << " REVISION = " << row0[1].data<int>() - << " SOURCES = " << row0[2].data<string>() - << " DATE = " << time.substr(0,time.size()-1) - << " FK = " << row0[4].data<long long>() << endl; - } - int current_revision = row0[1].data<int>(); - //row0.toOutputStream(cout)<<endl; - ++nRows; - // Show the variables - set<string> tables = m_session->nominalSchema().listTables(); - for (set<string>::const_iterator tName = tables.begin(); - tName != tables.end(); ++tName ){ - if ((*tName).find(m_pixeltable+"_") != string::npos) { - if (m_verbose) { - cout << "found table " << (*tName) << endl; - } - - // open the output text file - ofstream* outPtr = 0; - if (loaded_revision<current_revision) { - loaded_revision = current_revision; - outPtr = new ofstream("pcd.sav"); - } - - coral::IQuery* query_2 = m_session->nominalSchema().tableHandle(*tName).newQuery(); - - // Get the list of columns - const coral::ITableDescription& tableDesc = - m_session->nominalSchema().tableHandle(*tName).description(); - int NumCol = tableDesc.numberOfColumns(); - vector<string> colName; colName.resize(NumCol); - vector<string> colType; colType.resize(NumCol); - for(int i=0; i<NumCol; ++i){ - const coral::IColumn& colDesc = tableDesc.columnDescription(i); - colName[i] = colDesc.name(); - colType[i] = colDesc.type(); - query_2->addToOutputList(colDesc.name()); - } - - // Second query to get entries in each table - string pixel_cond_2 = (*tName)+".FK = :fk"; - coral::AttributeList pixel_condData_2 ATLAS_THREAD_SAFE; // Not shared, ok - pixel_condData_2.extend<long long>("fk"); - pixel_condData_2[0].data<long long>() = row0[4].data<long long>(); - query_2->setCondition( pixel_cond_2, pixel_condData_2); - coral::ICursor& cursor_2 = query_2->execute(); - while ( cursor_2.next() ) { - // populate PixelChipSummaryData - const coral::AttributeList &row0_2 = cursor_2.currentRow(); - PixelCoralClientUtils::PixelCalibData pcd; - int ix = 1; - int idmod = row0_2[ix++].data<int>(); - for (int i = 0; i<16; ++i) { - PixelCoralClientUtils::PixelCalibData::PixelChipSummaryData pcsd; - pcsd.setChipID(i); - int iv[4]; - for (int m=0; m<4; ++m) iv[m] = row0_2[ix++].data<int>(); - pcsd.setThreshold(0,iv[0],iv[1],iv[2],iv[3]); - for (int m=0; m<4; ++m) iv[m] = row0_2[ix++].data<int>(); - pcsd.setThreshold(1,iv[0],iv[1],iv[2],iv[3]); - for (int m=0; m<4; ++m) iv[m] = row0_2[ix++].data<int>(); - pcsd.setThreshold(2,iv[0],iv[1],iv[2],iv[3]); - float fv[3]; - for (int m=0; m<3; ++m) fv[m] = row0_2[ix++].data<float>(); - pcsd.setQ2Tot(0,fv[0],fv[1],fv[2]); - for (int m=0; m<3; ++m) fv[m] = row0_2[ix++].data<float>(); - pcsd.setQ2Tot(2,fv[0],fv[1],fv[2]); - for (int m=0; m<2; ++m) fv[m] = row0_2[ix++].data<float>(); - pcsd.setTotRes(fv[0],fv[1]); - pcd.add(pcsd); - } - - if (outPtr) { - // print out PixelChipSummaryData - for (int i = 0; i<16; ++i) { - const PixelCoralClientUtils::PixelCalibData::PixelChipSummaryData& pcsd = *pcd.getPixelChipSummaryData(i); - ofstream& out = *outPtr; - if (pcsd.getChipID()==0) out << idmod << endl; - out << "I" << pcsd.getChipID() - << " " << pcsd.getThreshold(0) - << " " << pcsd.getThresholdSigma(0) - << " " << pcsd.getNoise(0) - << " " << pcsd.getTimeWalk(0) - << " " << pcsd.getThreshold(1) - << " " << pcsd.getThresholdSigma(1) - << " " << pcsd.getNoise(1) - << " " << pcsd.getTimeWalk(1) - << " " << pcsd.getThreshold(2) - << " " << pcsd.getThresholdSigma(2) - << " " << pcsd.getNoise(2) - << " " << pcsd.getTimeWalk(2) - << " " << pcsd.getQ2TotA(0) - << " " << pcsd.getQ2TotE(0) - << " " << pcsd.getQ2TotC(0) - << " " << pcsd.getQ2TotA(2) - << " " << pcsd.getQ2TotE(2) - << " " << pcsd.getQ2TotC(2) - << " " << pcsd.getTotP1() - << " " << pcsd.getTotP2() << endl; - } - } - } - delete query_2; - if (outPtr) { - outPtr->close(); - outPtr = 0; - } - } - } - } - delete query; - - transactionCommit(); - - if (m_verbose) cout << "Total analyses: " << nRows << endl; - - if (revision==0) { - if (m_verbose) cout << "Loaded revision: " << loaded_revision << endl; - // save loaded revision number to a file - ofstream outr("pcd.rev"); - outr << loaded_revision << endl; - outr.close(); - } - - // stop timer - gettimeofday(&end_time, NULL); - total_usecs = (end_time.tv_sec-start_time.tv_sec) * 1000000 + - (end_time.tv_usec-start_time.tv_usec); - if (m_verbose) cout << " Total time was " << total_usecs << " usec" << endl; -} - -/** pcd.dat -> DB - */ -void PCDio::save(const std::string& tag, int revision, const std::string& sources) -{ - // start timer - struct timeval start_time, end_time; - int total_usecs; - gettimeofday(&start_time, NULL); - - // create tables if needed - createTable(); - - // get a new foreign key - long long fk = updateKey(); - - transactionStartUpdate(); - - // fill header - coral::ITableDataEditor& pixel_editor = m_session->nominalSchema().tableHandle(m_pixeltable ).dataEditor(); - - coral::AttributeList pixel_row ATLAS_THREAD_SAFE; // Not shared, ok. - pixel_row.extend<std::string>("TAG"); - pixel_row.extend<int>("REVISION"); - pixel_row.extend<std::string>("SOURCES"); - pixel_row.extend<time_t>("DATE"); - pixel_row.extend<long long>("FK"); - - pixel_row["TAG"].data<std::string>() = tag; - pixel_row["REVISION"].data<int>() = revision; - pixel_row["SOURCES"].data<std::string>() = sources; - pixel_row["DATE"].data<time_t>() = time(0); - pixel_row["FK"].data<long long>() = fk; - - pixel_editor.insertRow(pixel_row); - transactionCommit(); - - // fill pcd - transactionStartUpdate(); - { - coral::ITableDataEditor& pixel_editor_2 = m_session->nominalSchema().tableHandle(m_pixeltable+"_PCD").dataEditor(); - coral::AttributeList pixel_row_2 ATLAS_THREAD_SAFE; // Not shared, ok - pixel_editor_2.rowBuffer(pixel_row_2); - int mysize = 1; - coral::IBulkOperation* pixel_bulk_2= pixel_editor_2.bulkInsert(pixel_row_2,mysize); - - int nRows = 0; - - ifstream in("pcd.dat"); - while (in) { - int idmod; in >> idmod; - if (in.eof()) break; - - pixel_row_2["FK"].setValue <long long> (fk); - pixel_row_2["IDMOD"].setValue <int> (idmod); - - bool ok = true; - for (int i = 0; i<16; ++i) { - char dummy; in >> dummy; - if (dummy!='I') { ok = false; break; } - int idchip; in >> idchip; - if (idchip!=i) { ok = false; break; } - - char buf[256]; - int thres, sigma, noise, timewalk; - in >> thres >> sigma >> noise >> timewalk; - sprintf(buf,"THRESHOLD1I%d",i); - pixel_row_2[buf].setValue <int> (thres); - sprintf(buf,"THRESHOLD2I%d",i); - pixel_row_2[buf].setValue <int> (sigma); - sprintf(buf,"THRESHOLD3I%d",i); - pixel_row_2[buf].setValue <int> (noise); - sprintf(buf,"THRESHOLD4I%d",i); - pixel_row_2[buf].setValue <int> (timewalk); - - in >> thres >> sigma >> noise >> timewalk; - sprintf(buf,"THRESHOLDLONG1I%d",i); - pixel_row_2[buf].setValue <int> (thres); - sprintf(buf,"THRESHOLDLONG2I%d",i); - pixel_row_2[buf].setValue <int> (sigma); - sprintf(buf,"THRESHOLDLONG3I%d",i); - pixel_row_2[buf].setValue <int> (noise); - sprintf(buf,"THRESHOLDLONG4I%d",i); - pixel_row_2[buf].setValue <int> (timewalk); - - in >> thres >> sigma >> noise >> timewalk; - sprintf(buf,"THRESHOLDGANGED1I%d",i); - pixel_row_2[buf].setValue <int> (thres); - sprintf(buf,"THRESHOLDGANGED2I%d",i); - pixel_row_2[buf].setValue <int> (sigma); - sprintf(buf,"THRESHOLDGANGED3I%d",i); - pixel_row_2[buf].setValue <int> (noise); - sprintf(buf,"THRESHOLDGANGED4I%d",i); - pixel_row_2[buf].setValue <int> (timewalk); - - float A, E, C; - in >> A >> E >> C; - sprintf(buf,"Q2TOT1I%d",i); - pixel_row_2[buf].setValue <float> (A); - sprintf(buf,"Q2TOT2I%d",i); - pixel_row_2[buf].setValue <float> (E); - sprintf(buf,"Q2TOT3I%d",i); - pixel_row_2[buf].setValue <float> (C); - - in >> A >> E >> C; - sprintf(buf,"Q2TOTGANGED1I%d",i); - pixel_row_2[buf].setValue <float> (A); - sprintf(buf,"Q2TOTGANGED2I%d",i); - pixel_row_2[buf].setValue <float> (E); - sprintf(buf,"Q2TOTGANGED3I%d",i); - pixel_row_2[buf].setValue <float> (C); - - float p1, p2; - in >> p1 >> p2; - sprintf(buf,"TOTRES1I%d",i); - pixel_row_2[buf].setValue <float> (p1); - sprintf(buf,"TOTRES2I%d",i); - pixel_row_2[buf].setValue <float> (p2); - } - - ++nRows; - pixel_bulk_2->processNextIteration(); - if (!ok) break; - } - if (m_verbose) cout << "PixelCalibData: loaded " << nRows << " chips" << endl; - - pixel_bulk_2->flush(); - delete pixel_bulk_2; - } - transactionCommit(); - - // stop timer - gettimeofday(&end_time, NULL); - total_usecs = (end_time.tv_sec-start_time.tv_sec) * 1000000 + - (end_time.tv_usec-start_time.tv_usec); - if (m_verbose) cout << " Total time was " << total_usecs << " usec" << endl; -} - -/** part of save(): create new tables - */ -void PCDio::createTable() -{ - createAuxTables(); - createHeaderTable(); - createDataTable(); -} - -/** part of save(): create header table - */ -void PCDio::createHeaderTable() -{ - // create header - transactionStartUpdate(); - if (!m_session->nominalSchema().existsTable(m_pixeltable)) { - if (m_verbose) cout << "creating " << m_pixeltable << endl; - coral::TableDescription pixel_columns( "SchemaDefinition_PIXEL" ); - pixel_columns.setName( m_pixeltable ); - pixel_columns.insertColumn("TAG", coral::AttributeSpecification::typeNameForType<std::string>(), /*size in BYTES = */ 1000, /*fixed_size=*/ false); - pixel_columns.insertColumn("REVISION", coral::AttributeSpecification::typeNameForType<int>()); - pixel_columns.insertColumn("SOURCES", coral::AttributeSpecification::typeNameForType<std::string>(), /*size in BYTES = */ 1000, /*fixed_size=*/ false); - pixel_columns.insertColumn( "DATE", coral::AttributeSpecification::typeNameForType<time_t>()); - pixel_columns.insertColumn( "FK", coral::AttributeSpecification::typeNameForType<long long>()); - pixel_columns.setUniqueConstraint("FK","FK_UNIQ"); - m_session->nominalSchema().createTable( pixel_columns ); - } - transactionCommit(); -} - -/** part of save(): create data table - */ -void PCDio::createDataTable() -{ - transactionStartUpdate(); - string PIXEL_TABLE_DATA = m_pixeltable + "_PCD"; - if (!m_session->nominalSchema().existsTable(PIXEL_TABLE_DATA)) { - if (m_verbose) cout << "creating " << PIXEL_TABLE_DATA << endl; - coral::TableDescription pixel_columns( "SchemaDefinition_PIXEL" ); - pixel_columns.setName(PIXEL_TABLE_DATA); - pixel_columns.insertColumn("FK", coral::AttributeSpecification::typeNameForType<long long>()); - pixel_columns.insertColumn("IDMOD",coral::AttributeSpecification::typeNameForType<int>()); - char buf[256]; - for (int i = 0; i<16; ++i) { - for (int j = 1; j<=4; ++j) { - sprintf(buf,"THRESHOLD%dI%d",j,i); - pixel_columns.insertColumn(buf,coral::AttributeSpecification::typeNameForType<int>()); - } - for (int j = 1; j<=4; ++j) { - sprintf(buf,"THRESHOLDLONG%dI%d",j,i); - pixel_columns.insertColumn(buf,coral::AttributeSpecification::typeNameForType<int>()); - } - for (int j = 1; j<=4; ++j) { - sprintf(buf,"THRESHOLDGANGED%dI%d",j,i); - pixel_columns.insertColumn(buf,coral::AttributeSpecification::typeNameForType<int>()); - } - for (int j = 1; j<=3; ++j) { - sprintf(buf,"Q2TOT%dI%d",j,i); - pixel_columns.insertColumn(buf,coral::AttributeSpecification::typeNameForType<float>()); - } - for (int j = 1; j<=3; ++j) { - sprintf(buf,"Q2TOTGANGED%dI%d",j,i); - pixel_columns.insertColumn(buf,coral::AttributeSpecification::typeNameForType<float>()); - } - for (int j = 1; j<=2; ++j) { - sprintf(buf,"TOTRES%dI%d",j,i); - pixel_columns.insertColumn(buf,coral::AttributeSpecification::typeNameForType<float>()); - } - } - - pixel_columns.createForeignKey("PCD_FK","FK",m_pixeltable,"FK"); - //pixel_columns.createIndex("PCD_CONNECTIVITY_IDX", "CONNECTIVITY"); - //pixel_columns.createIndex("PCD_VARIABLE_IDX", "VARIABLE"); - //pixel_columns.setNotNullConstraint ( "CONNECTIVITY" ); - //pixel_columns.setNotNullConstraint ( "VARIABLE" ); - - m_session->nominalSchema().createTable( pixel_columns ); - } - transactionCommit(); -} - -/** part of save(): create key table - */ -void PCDio::createAuxTables() -{ - transactionStartUpdate(); - string FK_TABLE = "CALIB_KEYGEN"; - if (!m_session->nominalSchema().existsTable(FK_TABLE)) { - coral::TableDescription key_columns( "SchemaDefinition_KEY" ); - key_columns.setName( FK_TABLE ); - key_columns.insertColumn( "KEY", coral::AttributeSpecification::typeNameForType<long long>()); - key_columns.createIndex ("KEY_INDEX", "KEY"); - m_session->nominalSchema().createTable( key_columns ); - // fill the first key - coral::ITableDataEditor& keyeditor = m_session->nominalSchema().tableHandle( FK_TABLE ).dataEditor(); - coral::AttributeList rowBuffer ATLAS_THREAD_SAFE; // Not shared, ok - rowBuffer.extend<long long>( "KEY" ); - long long& key = rowBuffer[ "KEY" ].data<long long>(); - key = 1000; - keyeditor.insertRow( rowBuffer ); - } - transactionCommit(); -} - -/** part of save(): update the key - */ -long long PCDio::updateKey() -{ - std::string FK_TABLE = "CALIB_KEYGEN"; - transactionStartUpdate(); - - coral::ITableDataEditor& keyeditor = m_session->nominalSchema().tableHandle( FK_TABLE ).dataEditor(); - std::string updateAction = "KEY = KEY + :offset"; - coral::AttributeList updateData ATLAS_THREAD_SAFE; // Not shared, ok - updateData.extend<long long>("offset"); - updateData[0].data<long long>() = 1; - keyeditor.updateRows( updateAction, "", updateData ); - - coral::IQuery* query = m_session->nominalSchema().tableHandle(FK_TABLE).newQuery(); - query->addToOutputList("KEY"); - coral::ICursor& cursor = query->execute(); - long long key = -1; - while ( cursor.next() ) { - const coral::AttributeList &row0 = cursor.currentRow(); - key = row0[0].data<long long>(); - if (m_verbose) std::cout << " KEY = " << key << std::endl; - } - transactionCommit(); - return key; -} - -/** CORAL helper to start a transaction in readonly mode - */ -void PCDio::transactionStartReadOnly(){ - if (m_session->transaction().isActive()) m_session->transaction().rollback(); - m_session->transaction().start(true /*ReadOnly*/); -} - -/** CORAL helper to start a transaction in update mode - */ -void PCDio::transactionStartUpdate(){ - if (m_session->transaction().isActive()) m_session->transaction().rollback(); - m_session->transaction().start(false /*update*/); -} - -/** CORAL helper to commit changes at the end of a transaction - */ -void PCDio::transactionCommit(){ - if (m_session->transaction().isActive()) m_session->transaction().commit(); -} diff --git a/InnerDetector/InDetConditions/PixelCoralClientUtils/src/PCDkr.cc b/InnerDetector/InDetConditions/PixelCoralClientUtils/src/PCDkr.cc deleted file mode 100644 index 8acd6984d1cdb97dfab8617719e0e106339ca261..0000000000000000000000000000000000000000 --- a/InnerDetector/InDetConditions/PixelCoralClientUtils/src/PCDkr.cc +++ /dev/null @@ -1,211 +0,0 @@ -/* - Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration -*/ - -#include "PixelCoralClientUtils/PCDkr.h" -#include "PixelCoralClientUtils/PixelCalibData.hh" - -// CORAL API -#include "CoralKernel/Context.h" -#include "CoralBase/Attribute.h" -#include "CoralBase/AttributeList.h" -#include "CoralBase/AttributeListException.h" -#include "RelationalAccess/IConnectionService.h" -#include "RelationalAccess/IConnectionServiceConfiguration.h" -#include "RelationalAccess/AccessMode.h" -#include "RelationalAccess/ISessionProxy.h" -#include "RelationalAccess/ISchema.h" -#include "RelationalAccess/ITransaction.h" - -#include "RelationalAccess/ITable.h" -#include "RelationalAccess/ITableDescription.h" -#include "RelationalAccess/IColumn.h" -#include "RelationalAccess/ICursor.h" -#include "RelationalAccess/IQuery.h" -#include "RelationalAccess/TableDescription.h" -#include "RelationalAccess/ITableDataEditor.h" -#include "RelationalAccess/ITableSchemaEditor.h" -#include "RelationalAccess/IBulkOperation.h" -#include "RelationalAccess/SchemaException.h" - -// std lib -#include <iostream> -using namespace std; - -//--------------------------------------------------------------------------- -/** Constructor. - Open the default database and seal context. - */ -PCDkr::PCDkr(const std::string& connString, - const std::string& tableName, - int verbose) : - m_connString(connString), m_pixeltable(tableName), - m_verbose(verbose), m_session(0) {} - -PCDkr::~PCDkr() -{ - if (m_verbose) cout << "Disconnecting \"" << m_connString << "\"" << endl; - delete m_session; -} - -/** initialize connection - */ -void PCDkr::init(coral::AccessMode access_mode) -{ - if (m_verbose) cout << "Creating Connection Service to \"" << m_connString << "\"" << endl; - - coral::Context* context = &coral::Context::instance(); - coral::IHandle<coral::IConnectionService> lookSvcH = context->query<coral::IConnectionService>(); - if (!lookSvcH.isValid()) { - context->loadComponent("CORAL/Services/ConnectionService"); - lookSvcH = context->query<coral::IConnectionService>(); - } - if (!lookSvcH.isValid()) { - throw runtime_error("Could not locate the connection service"); - } - - m_session = lookSvcH->connect(m_connString, access_mode); - if (m_verbose) cout << "Connection established" << endl; -} - -/** dump DB - */ -void PCDkr::load() -{ - // start timer - struct timeval start_time, end_time; - int total_usecs; - gettimeofday(&start_time, NULL); - - transactionStartReadOnly(); - - // build a query - coral::IQuery* query = m_session->nominalSchema().tableHandle(m_pixeltable).newQuery(); - - query->addToOutputList("TAG"); - query->defineOutputType("TAG",coral::AttributeSpecification::typeNameForType<string>()); - query->addToOutputList("CID"); - query->defineOutputType("CID",coral::AttributeSpecification::typeNameForType<string>()); - query->addToOutputList("VALID"); - query->defineOutputType("VALID",coral::AttributeSpecification::typeNameForType<int>()); - - coral::ICursor& cursor = query->execute(); - - // go through the list of found tables - int nRows = 0; - while ( cursor.next() ) { - const coral::AttributeList &row0 = cursor.currentRow(); - if (m_verbose) { - cout << " TAG = " << row0[0].data<string>() - << " CID = " << row0[1].data<string>() - << " VALID = " << row0[2].data<int>() << endl; - } - ++nRows; - } - delete query; - - transactionCommit(); - - if (m_verbose) cout << "Total configurations: " << nRows << endl; - - // stop timer - gettimeofday(&end_time, NULL); - total_usecs = (end_time.tv_sec-start_time.tv_sec) * 1000000 + - (end_time.tv_usec-start_time.tv_usec); - if (m_verbose) cout << " Total time was " << total_usecs << " usec" << endl; -} - -/** add a new record to DB - */ -void PCDkr::save(const std::string& tag, const std::string& cid) -{ - // start timer - struct timeval start_time, end_time; - int total_usecs; - gettimeofday(&start_time, NULL); - - // create tables if needed - createTable(); - - transactionStartUpdate(); - - // fill header - coral::ITableDataEditor& pixel_editor = m_session->nominalSchema().tableHandle(m_pixeltable ).dataEditor(); - - coral::AttributeList pixel_row; - pixel_row.extend<std::string>("TAG"); - pixel_row.extend<std::string>("CID"); - pixel_row.extend<int>("VALID"); - - pixel_row["TAG"].data<std::string>() = tag; - pixel_row["CID"].data<std::string>() = cid; - pixel_row["VALID"].data<int>() = 0; - - pixel_editor.insertRow(pixel_row); - transactionCommit(); - - // stop timer - gettimeofday(&end_time, NULL); - total_usecs = (end_time.tv_sec-start_time.tv_sec) * 1000000 + - (end_time.tv_usec-start_time.tv_usec); - if (m_verbose) cout << " Total time was " << total_usecs << " usec" << endl; -} - -/** part of save(): create the table - */ -void PCDkr::createTable() -{ - // create header - transactionStartUpdate(); - if (!m_session->nominalSchema().existsTable(m_pixeltable)) { - if (m_verbose) cout << "creating " << m_pixeltable << endl; - coral::TableDescription pixel_columns( "SchemaDefinition_KR" ); - pixel_columns.setName( m_pixeltable ); - pixel_columns.insertColumn("TAG", coral::AttributeSpecification::typeNameForType<std::string>(), /*size in BYTES = */ 1000, /*fixed_size=*/ false); - pixel_columns.insertColumn("CID", coral::AttributeSpecification::typeNameForType<std::string>(), /*size in BYTES = */ 1000, /*fixed_size=*/ false); - pixel_columns.insertColumn( "VALID", coral::AttributeSpecification::typeNameForType<int>()); - pixel_columns.setPrimaryKey("TAG"); - m_session->nominalSchema().createTable( pixel_columns ); - } - transactionCommit(); -} - -/** validate a record - example: Integration_Basic/src/DmlOperations.cpp - */ -void PCDkr::validate(const std::string& tag) -{ - transactionStartUpdate(); - - coral::ITableDataEditor& pixel_editor = m_session->nominalSchema().tableHandle(m_pixeltable ).dataEditor(); - - string updateAction = "VALID = 1"; - string updateCondition = "TAG = :tvalue"; - coral::AttributeList updateData; - updateData.extend<std::string>("tvalue"); - updateData[0].data<std::string>() = tag; - - int nRows = pixel_editor.updateRows(updateAction,updateCondition,updateData); - cout << "Updated rows: " << nRows << endl; - transactionCommit(); -} - -/** CORAL helper to start a transaction in readonly mode - */ -void PCDkr::transactionStartReadOnly(){ - if (m_session->transaction().isActive()) m_session->transaction().rollback(); - m_session->transaction().start(true /*ReadOnly*/); -} - -/** CORAL helper to start a transaction in update mode - */ -void PCDkr::transactionStartUpdate(){ - if (m_session->transaction().isActive()) m_session->transaction().rollback(); - m_session->transaction().start(false /*update*/); -} - -/** CORAL helper to commit changes at the end of a transaction - */ -void PCDkr::transactionCommit(){ - if (m_session->transaction().isActive()) m_session->transaction().commit(); -} diff --git a/InnerDetector/InDetConditions/PixelCoralClientUtils/src/PixCalibCoralCoolDb.cc b/InnerDetector/InDetConditions/PixelCoralClientUtils/src/PixCalibCoralCoolDb.cc deleted file mode 100644 index 0fcfe824b3e239c790f80ca40e927bed50798a0b..0000000000000000000000000000000000000000 --- a/InnerDetector/InDetConditions/PixelCoralClientUtils/src/PixCalibCoralCoolDb.cc +++ /dev/null @@ -1,270 +0,0 @@ -/* - Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration -*/ - -#include "PixelCoralClientUtils/PixCalibCoralCoolDb.h" - -// CoraCool stuff -- A.X. -#include "CoraCool/CoraCoolDatabaseSvcFactory.h" -#include "CoraCool/CoraCoolDatabaseSvc.h" -#include "CoolKernel/IDatabaseSvc.h" -#include "CoolKernel/ChannelSelection.h" -#include "CoraCool/CoraCoolFolder.h" -#include "CoraCool/CoraCoolObjectIter.h" -#include "CoraCool/CoraCoolObject.h" - -#include "CxxUtils/checker_macros.h" - -// std lib -#include <fstream> -#include <iostream> -#include <sstream> -#include <vector> -using namespace std; - -// -// this code is based on CoraCoolExample by R. Hawkings -// -PixCalibCoralCoolDb::PixCalibCoralCoolDb(const std::string& dbString, - int /*verbose*/) : - m_dbstring(dbString) -{ - - CoraCoolDatabaseSvc& corasvc=CoraCoolDatabaseSvcFactory::databaseService(); - - //std::cout << "Done the CoraCool initialisation" << std::endl; - - // open the CORAL database connection which implicitly opens - // the corresponding COOL connection - // you can also pass in the COOL connection explicitly - // std::cout << "Opening CORAL database" << std::endl; - try { - m_coradb=corasvc.openDatabase(m_dbstring,false); - //std::cout << "Database connections open OK" << std::endl; - } - catch (std::exception&e) { - std::cout << "Problem opening CORAL database: " << e.what() << std::endl; - } - //std::cout << "Done the database opening" << std::endl; - -} - -PixCalibCoralCoolDb::~PixCalibCoralCoolDb() -{ -} - -bool PixCalibCoralCoolDb::init() -{ - // open the database connection, move to constructor - // if (m_verbose) cout << "HEY HEY Connecting to " << m_dbstring << endl; - // CoraCoolDatabaseSvc& corasvc=CoraCoolDatabaseSvcFactory::databaseService(); - // try { - // m_coradb = corasvc.openDatabase(m_dbstring, readonly); - // } - // catch (std::exception& e) { - // cout << "problem opening database: " << e.what() << endl; - // return false; - // } - // if (m_verbose) cout << "Connection established" << endl; - - return true; -} - -bool PixCalibCoralCoolDb::load(cool::ValidityKey vkx) -{ - CoraCoolFolderPtr folder; - string folderName("/PIXEL/PixCalibData"); - - try { - folder = m_coradb->getFolder(folderName); - } - catch (cool::Exception& e) { - cout << "problem getting folder: " << e.what() << endl; - return false; - } - - // open text file for output - ofstream out("pcd.sav"); - int nload = 0; - - CoraCoolObjectIterPtr itr = folder->browseObjects(vkx, cool::ChannelSelection::all()); - while (itr->hasNext()) { - CoraCoolObjectPtr obj = itr->next(); - for (CoraCoolObject::const_iterator payitr = obj->begin(); - payitr != obj->end(); ++payitr) { - const coral::Blob& blob = (*payitr)["data"].data<coral::Blob>(); - const char* p = static_cast<const char*>(blob.startingAddress()); - unsigned int len = blob.size(); - for (unsigned int i = 0; i!=len; ++i) out << *p++; - } - ++nload; - } - out.close(); - cout << "loaded " << nload << " channels" << endl; - - return true; -} - -bool PixCalibCoralCoolDb::saveCalibData ( string textfile , long long FK ) -{ - cool::RecordSpecification payloadspec; - // primary / foreign keys - payloadspec.extend("PrimKey",cool::StorageType::Int32); - payloadspec.extend("ForeignKey",cool::StorageType::Int64); - // other data members - payloadspec.extend("data",cool::StorageType::Blob64k); - - cool::RecordSpecification fkspec; - fkspec.extend("CoolKey",cool::StorageType::Int64); - - string desc="<timeStamp>run-lumi</timeStamp><addrHeader><address_header service_type=\"71\" clid=\"55403898\" /></addrHeader><typeName>AthenaAttributeList</typeName>"; - - string folderName("/PIXEL/PixCalibData"); - string cfolderName("PixCalibData"); - - CoraCoolFolderPtr folder; - - // delete existing folder, if any - bool do_delete = false; - if (do_delete && m_coradb->existsFolder(folderName)) { - try { - m_coradb->deleteFolder(folderName); - } - catch (cool::Exception& e) { - cout << "problem deleting folder: " << e.what() << endl; - return false; - } - } - - // create new folder or get the old one, if any - if (!m_coradb->existsFolder(folderName)) { - try { - folder = m_coradb->createFolder(folderName, cfolderName, - fkspec, payloadspec, "ForeignKey", "PrimKey", desc, - cool::FolderVersioning::MULTI_VERSION, true); - } - catch (cool::Exception& e) { - cout << "problem creating folder: " << e.what() << endl; - return false; - } - } else { - folder = m_coradb->getFolder(folderName); - } - - std::cout << "Succesfully opened/created folders!" << std::endl; - - // open text file for input - ifstream in(textfile.c_str() ); - if( !(in.is_open() ) ){ - cout << "calib-data file: " << textfile << " not found!" << endl; - return false; - } - //return error if textfile not found! - - string s; - int nsave = 0; - - string dataString; - while (in) { - getline(in,s); - if (in.eof()) break; - dataString += s + '\n'; - - for (int i = 0; i<16; ++i) { - getline(in,s); - dataString += s + '\n'; - } - ++nsave; - } - cout << "read " << nsave << " channels" << endl; - - // prepare data to save in the payload - // No sharing, ok. - coral::AttributeList data ATLAS_THREAD_SAFE = folder->emptyAttrList(); - data["PrimKey"].data<int>() = 0; - data["ForeignKey"].data<long long>() = FK; - coral::Blob& blob = data["data"].data<coral::Blob>(); - unsigned int len = dataString.size(); - blob.resize(len); - char* p = static_cast<char*>(blob.startingAddress()); - for (unsigned int i = 0; i!=len; ++i) *p++ = dataString[i]; - - vector<coral::AttributeList> datavec; - datavec.reserve(1); - datavec.push_back(data); - - try { - //store object and range of run-number - //folder->storeObject(vk1, vk2, datavec.begin(), datavec.end(), chan); - - //just add payload - folder->addPayload(datavec.begin(), datavec.end()); - } - catch (cool::Exception& e) { - cout << "problem writing data: " << e.what() << endl; - return false; - } - - return true; -} - -bool PixCalibCoralCoolDb::referenceToRunInterval(long long FK, cool::ValidityKey vk1,cool::ValidityKey vk2, const std::string& tagname) -{ - cool::RecordSpecification payloadspec; - // primary / foreign keys - payloadspec.extend("CoolKey",cool::StorageType::Int64); - payloadspec.extend("PrimKey",cool::StorageType::Int32); - // payloadspec.extend("ModuleID",cool::StorageType::Int64); - payloadspec.extend("data",cool::StorageType::String16M); - - cool::RecordSpecification fkspec; - fkspec.extend("CoolKey",cool::StorageType::Int64); - - string desc="<timeStamp>run-lumi</timeStamp><addrHeader><address_header service_type=\"71\" clid=\"55403898\" /></addrHeader><typeName>AthenaAttributeList</typeName>"; - - string folderName("/PIXEL/PixCalibData"); - string cfolderName("PixCalibData"); - - CoraCoolFolderPtr folder; - - // delete existing folder, if any - bool do_delete = false; - if (do_delete && m_coradb->existsFolder(folderName)) { - try { - m_coradb->deleteFolder(folderName); - } - catch (cool::Exception& e) { - cout << "problem deleting folder: " << e.what() << endl; - return false; - } - } - - // create new folder or get the old one, if any - if (!m_coradb->existsFolder(folderName)) { - try { - folder = m_coradb->createFolder(folderName, cfolderName, - fkspec, payloadspec, "ForeignKey", "PrimKey", desc, - cool::FolderVersioning::MULTI_VERSION, true); - } - catch (cool::Exception& e) { - cout << "problem creating folder: " << e.what() << endl; - return false; - } - } else { - folder = m_coradb->getFolder(folderName); - } - - //set the run-interval for the given foreign-key... - cool::ChannelId chan(0); - try { - folder->referenceObject(vk1, vk2, FK, chan, tagname); - } - catch (cool::Exception& e) { - cout << "problem when associating run-interval : " << e.what() << endl; - return false; - } - - cout << "saved runInterval (FK=" << FK << ") " << endl; - - return true; -} diff --git a/InnerDetector/InDetConditions/PixelCoralClientUtils/src/PixCalibKnowledgeDb.cc b/InnerDetector/InDetConditions/PixelCoralClientUtils/src/PixCalibKnowledgeDb.cc deleted file mode 100644 index e30b2e2f11415e9da883d5cd8693aa4c69540431..0000000000000000000000000000000000000000 --- a/InnerDetector/InDetConditions/PixelCoralClientUtils/src/PixCalibKnowledgeDb.cc +++ /dev/null @@ -1,275 +0,0 @@ -/* - Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration -*/ - -#include "PixelCoralClientUtils/PixCalibKnowledgeDb.h" - -#include "CxxUtils/checker_macros.h" - -// CORAL API -#include "CoralKernel/Context.h" -#include "CoralBase/Attribute.h" -#include "CoralBase/AttributeList.h" -#include "CoralBase/AttributeListException.h" -#include "RelationalAccess/IConnectionService.h" -#include "RelationalAccess/IConnectionServiceConfiguration.h" -#include "RelationalAccess/AccessMode.h" -#include "RelationalAccess/ISessionProxy.h" -#include "RelationalAccess/ISchema.h" -#include "RelationalAccess/ITransaction.h" - -#include "RelationalAccess/ITable.h" -#include "RelationalAccess/ITableDescription.h" -#include "RelationalAccess/IColumn.h" -#include "RelationalAccess/ICursor.h" -#include "RelationalAccess/IQuery.h" -#include "RelationalAccess/TableDescription.h" -#include "RelationalAccess/ITableDataEditor.h" -#include "RelationalAccess/ITableSchemaEditor.h" -#include "RelationalAccess/IBulkOperation.h" -#include "RelationalAccess/SchemaException.h" - -// std lib -#include <fstream> -#include <iostream> -#include <vector> -#include <set> -using namespace std; - -//--------------------------------------------------------------------------- -/** Constructor. - Open the default database and seal context. - */ -PixCalibKnowledgeDb::PixCalibKnowledgeDb(const std::string& connString, - const std::string& tableName, - int verbose) : - m_connString(connString), m_pixeltable(tableName), - m_verbose(verbose), m_session(0) {} - -PixCalibKnowledgeDb::~PixCalibKnowledgeDb() -{ - if (m_verbose) cout << "Disconnecting \"" << m_connString << "\"" << endl; - delete m_session; -} - -/** initialize connection - */ -void PixCalibKnowledgeDb::init(coral::AccessMode access_mode) -{ - if (m_verbose) cout << "Creating Connection Service to \"" << m_connString << "\"" << endl; - coral::Context* context = &coral::Context::instance(); - coral::IHandle<coral::IConnectionService> lookSvcH = context->query<coral::IConnectionService>(); - if (!lookSvcH.isValid()) { - context->loadComponent("CORAL/Services/ConnectionService"); - lookSvcH = context->query<coral::IConnectionService>(); - } - if (!lookSvcH.isValid()) { - throw runtime_error("Could not locate the connection service"); - } - - m_session = lookSvcH->connect(m_connString, access_mode); - if (m_verbose) cout << "Connection established" << endl; -} - -void PixCalibKnowledgeDb::saveCorrespondingConfig -(long int UNIXTimeInSeconds, long int RunNumber, const std::string& calibtags_in_string, const std::string& idTag, const std::string& connTag, const std::string& cfgTag, const std::string& cfgModTag ) -{ - - // create tables if needed - createTable(); - - // get a new unique foreign key - long long fk = updateKey(); - if( fk == -1 ) std::cout << "failed to get unique key?!" << std::endl; - - transactionStartUpdate(); - - //fill config - transactionStartUpdate(); - - coral::ITableDataEditor& pixel_editor = m_session->nominalSchema().tableHandle("CALIB_TAGS").dataEditor(); - - coral::AttributeList pixel_row ATLAS_THREAD_SAFE; // Not shared, ok. - pixel_row.extend<long int>("UNIXTimeInSeconds"); - pixel_row.extend<long int>("RunNumber"); - pixel_row.extend<std::string>("calibrationTags"); - pixel_row.extend<std::string>("idTag"); - pixel_row.extend<std::string>("connTag"); - pixel_row.extend<std::string>("cfgTag"); - pixel_row.extend<std::string>("cfgModTag"); - pixel_row.extend<long long>("FK"); - - // string idtag = "PIXEL"; - // string conntag = "PIT-ALL-V36"; - // string cfgTag = "PIT-20C-OLD"; - // int cfgRev = 0; - // string cfgModTag = "PIT_MOD_MIXED_3000e"; - // int cfgModRev = 0; - - pixel_row["UNIXTimeInSeconds"].data<long int>() = UNIXTimeInSeconds; - pixel_row["RunNumber"].data<long int>() = RunNumber; - pixel_row["calibrationTags"].data<std::string>() = calibtags_in_string; - pixel_row["idTag"].data<std::string>() = idTag; - pixel_row["connTag"].data<std::string>() = connTag; - pixel_row["cfgTag"].data<std::string>() = cfgTag; - pixel_row["cfgModTag"].data<std::string>() = cfgModTag; - pixel_row["FK"].data<long long>() = fk; - - pixel_editor.insertRow(pixel_row); - transactionCommit(); - std::cout << "done saving corresponding config" << std::endl; -} - -//for reading back calibrationTags corresponding to a given time, not sure if this is needed -void PixCalibKnowledgeDb::readCorrespondingCalibTag (long int Utime){ - - transactionStartReadOnly(); - //build a query - coral::IQuery* query = m_session->nominalSchema().tableHandle("CALIB_TAGS").newQuery(); - - query->addToOutputList("UNIXTimeInSeconds"); - query->defineOutputType("UNIXTimeInSeconds",coral::AttributeSpecification::typeNameForType<long int>()); - query->addToOutputList("calibrationTags"); - query->defineOutputType("calibrationTags",coral::AttributeSpecification::typeNameForType<string>()); - - coral::AttributeList pixel_knowledgeData ATLAS_THREAD_SAFE; // Not shared, ok - string pixel_knowledge = "CALIB_TAGS.UNIXTimeInSeconds <= :Utime"; - pixel_knowledgeData.extend<long int>("Utime"); - pixel_knowledgeData[0].data<long int>() = Utime; - - query->setCondition( pixel_knowledge, pixel_knowledgeData); - - coral::ICursor& cursor = query->execute(); - - // long long foreignkey = -1; - string calibtags = "" ; - long int Utime_h = -99999999; - - // go through list of found tables, highest Utime has the correct calibTag-set - - while ( cursor.next() ) { - const coral::AttributeList &row0 = cursor.currentRow(); - long int UNIXTimeInSeconds = row0[0].data<long int>(); - string calibrationTags = row0[1].data<string>(); - if( Utime_h <= UNIXTimeInSeconds ){ -// cout << " UNIXTimeInSeconds = " << UNIXTimeInSeconds -// << " calibrationTags = " << calibrationTags << endl; - Utime_h = UNIXTimeInSeconds; - calibtags = calibrationTags; - } - } - delete query; - - // if( foreignkey != -1 ) calibtag = findTag(foreignkey); - - if( calibtags == "" ){ - cout << " corresponding calibration-tags not found!" << endl; - } - else { - std::cout << "UNIXTimeInSeconds " << Utime << " corresponds to the following calibration-tags:\n" << calibtags << std::endl; - } - transactionCommit(); - -} - -/** part of save(): create new tables - */ -void PixCalibKnowledgeDb::createTable () -{ - createConfigurationTable(); - createAuxTables(); -} - -/** part of save(): create config-tags table - */ -void PixCalibKnowledgeDb::createConfigurationTable() -{ - // create header - transactionStartUpdate(); - string PIXEL_TABLE_CFG = "CALIB_TAGS"; - if (!m_session->nominalSchema().existsTable(PIXEL_TABLE_CFG)) { - if (m_verbose) cout << "creating " << PIXEL_TABLE_CFG << endl; - coral::TableDescription cfg_columns( "SchemaDefinition_PIXEL_CFG" ); - cfg_columns.setName( PIXEL_TABLE_CFG ); - cfg_columns.insertColumn("UNIXTimeInSeconds", coral::AttributeSpecification::typeNameForType<long int>(), /*size in BYTES = */ 1000, /*fixed_size=*/ false); - cfg_columns.insertColumn( "RunNumber", coral::AttributeSpecification::typeNameForType<long long>()); - cfg_columns.insertColumn("calibrationTags", coral::AttributeSpecification::typeNameForType<std::string>(), /*size in BYTES = */ 1000, /*fixed_size=*/ false); - cfg_columns.insertColumn("idTag", coral::AttributeSpecification::typeNameForType<std::string>(), /*size in BYTES = */ 1000, /*fixed_size=*/ false); - cfg_columns.insertColumn("connTag", coral::AttributeSpecification::typeNameForType<std::string>(), /*size in BYTES = */ 1000, /*fixed_size=*/ false); - cfg_columns.insertColumn("cfgTag", coral::AttributeSpecification::typeNameForType<std::string>(), /*size in BYTES = */ 1000, /*fixed_size=*/ false); - cfg_columns.insertColumn("cfgModTag", coral::AttributeSpecification::typeNameForType<std::string>(), /*size in BYTES = */ 1000, /*fixed_size=*/ false); - cfg_columns.insertColumn( "FK", coral::AttributeSpecification::typeNameForType<long long>()); - m_session->nominalSchema().createTable( cfg_columns ); - } - transactionCommit(); -} - -/** part of save(): create key table - */ -void PixCalibKnowledgeDb::createAuxTables() -{ - transactionStartUpdate(); - string FK_TABLE = "CALIB_KEYGEN"; - if (!m_session->nominalSchema().existsTable(FK_TABLE)) { - coral::TableDescription key_columns( "SchemaDefinition_KEY" ); - key_columns.setName( FK_TABLE ); - key_columns.insertColumn( "KEY", coral::AttributeSpecification::typeNameForType<long long>()); - key_columns.createIndex ("KEY_INDEX", "KEY"); - m_session->nominalSchema().createTable( key_columns ); - // fill the first key - coral::ITableDataEditor& keyeditor = m_session->nominalSchema().tableHandle( FK_TABLE ).dataEditor(); - coral::AttributeList rowBuffer ATLAS_THREAD_SAFE; // Not shared, ok. - rowBuffer.extend<long long>( "KEY" ); - long long& key = rowBuffer[ "KEY" ].data<long long>(); - key = 1000; - keyeditor.insertRow( rowBuffer ); - } - transactionCommit(); -} - -/** part of save(): update the key - */ -long long PixCalibKnowledgeDb::updateKey() -{ - std::string FK_TABLE = "CALIB_KEYGEN"; - transactionStartUpdate(); - - coral::ITableDataEditor& keyeditor = m_session->nominalSchema().tableHandle( FK_TABLE ).dataEditor(); - std::string updateAction = "KEY = KEY + :offset"; - coral::AttributeList updateData ATLAS_THREAD_SAFE; // Not shared, ok. - updateData.extend<long long>("offset"); - updateData[0].data<long long>() = 1; - keyeditor.updateRows( updateAction, "", updateData ); - - coral::IQuery* query = m_session->nominalSchema().tableHandle(FK_TABLE).newQuery(); - query->addToOutputList("KEY"); - coral::ICursor& cursor = query->execute(); - long long key = -1; - while ( cursor.next() ) { - const coral::AttributeList &row0 = cursor.currentRow(); - key = row0[0].data<long long>(); - if (m_verbose) std::cout << " KEY = " << key << std::endl; - } - transactionCommit(); - return key; -} - -/** CORAL helper to start a transaction in readonly mode - */ -void PixCalibKnowledgeDb::transactionStartReadOnly(){ - if (m_session->transaction().isActive()) m_session->transaction().rollback(); - m_session->transaction().start(true /*ReadOnly*/); -} - -/** CORAL helper to start a transaction in update mode - */ -void PixCalibKnowledgeDb::transactionStartUpdate(){ - if (m_session->transaction().isActive()) m_session->transaction().rollback(); - m_session->transaction().start(false /*update*/); -} - -/** CORAL helper to commit changes at the end of a transaction - */ -void PixCalibKnowledgeDb::transactionCommit(){ - if (m_session->transaction().isActive()) m_session->transaction().commit(); -} diff --git a/InnerDetector/InDetConditions/PixelCoralClientUtils/src/SpecialPixelMap.cc b/InnerDetector/InDetConditions/PixelCoralClientUtils/src/SpecialPixelMap.cc deleted file mode 100644 index 4107349e998a23158ad320349938a5d0dec396ae..0000000000000000000000000000000000000000 --- a/InnerDetector/InDetConditions/PixelCoralClientUtils/src/SpecialPixelMap.cc +++ /dev/null @@ -1,1751 +0,0 @@ -/* - Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration -*/ - -//**************************************************************************** -// SpecialPixelMap.cxx -// -// Classes to hold data about special pixels in the detector store and make it -// accessible to athena components. -// -// author Christoph Ruwiedel <ruwiedel@physik.uni-bonn.de> -// updated to be comptible with IBL and phase II: -- Wei-Ming Yao <wmyao@lbl.gov> - - -#include "PixelCoralClientUtils/SpecialPixelMap.hh" - -#include<fstream> -#include<sstream> -#include<string> -#include<iomanip> -#include<stdint.h> -#include<cmath> - - -namespace PixelCoralClientUtils { - -//***** DetectorSpecialPixelMap *****// - -//===== Constructors, Destructor =====// - -DetectorSpecialPixelMap::DetectorSpecialPixelMap(){} - -DetectorSpecialPixelMap::DetectorSpecialPixelMap(const DetectorSpecialPixelMap& spm) : - std::vector<ModuleSpecialPixelMap*>(){ - - for(DetectorSpecialPixelMap::const_iterator module = spm.begin(); module != spm.end(); ++module){ - - push_back(new ModuleSpecialPixelMap(**module)); - - } -} - -DetectorSpecialPixelMap::DetectorSpecialPixelMap(const std::vector<ModuleSpecialPixelMap*>& modules){ - - for(std::vector<ModuleSpecialPixelMap*>::const_iterator module = modules.begin(); module != modules.end(); ++module){ - - push_back(new ModuleSpecialPixelMap(**module)); - - } -} - -void DetectorSpecialPixelMap::clear(){ - - for(const_iterator module = begin(); module != end(); ++module){ - delete *module; - } - std::vector<ModuleSpecialPixelMap*>::clear(); -} - -DetectorSpecialPixelMap::~DetectorSpecialPixelMap(){ - for(const_iterator module = begin(); module != end(); ++module){ - delete *module; - } -} - - -//===== member functions =====// - -const ModuleSpecialPixelMap* DetectorSpecialPixelMap::module(unsigned int moduleHash) const{ - return (*this)[moduleHash]; -} - - -DetectorSpecialPixelMap& DetectorSpecialPixelMap::operator=(const DetectorSpecialPixelMap& spm){ - if(&spm != this){ - for(const_iterator module = begin(); module != end(); ++module){ - delete *module; - } - - resize(spm.size()); - - for(DetectorSpecialPixelMap::const_iterator module = spm.begin(); module != spm.end(); ++module){ - (*this)[module - spm.begin()] = new ModuleSpecialPixelMap(**module); - } - } - return *this; -} - -DetectorSpecialPixelMap& DetectorSpecialPixelMap::operator+=(const DetectorSpecialPixelMap& spm){ - if(&spm != this){ - - if(size() != spm.size()){ - std::cout << "Unable to merge special pixel maps: sizes do not match" << std::endl; - - return *this; - } - - for(DetectorSpecialPixelMap::const_iterator module = spm.begin(); module != spm.end(); ++module){ - if( (*this)[module - spm.begin()] == 0 && (*module) != 0 ){ - (*this)[module - spm.begin()] = new ModuleSpecialPixelMap( **module ); - } - else if( (*module) != 0 ){ - (*this)[module - spm.begin()]->merge(*module); - } - } - } - return *this; -} - -void DetectorSpecialPixelMap::merge(const DetectorSpecialPixelMap* spm){ - (*this) += (*spm); - return; -} - -void DetectorSpecialPixelMap::markSpecialRegions(){ - for(DetectorSpecialPixelMap::iterator module = begin(); module != end(); ++module){ - (*module)->markSpecialRegions(); - } - return; -} - -void DetectorSpecialPixelMap::setNeighbourFlags(){ - for(DetectorSpecialPixelMap::iterator module = begin(); module != end(); ++module){ - (*module)->setNeighbourFlags(); - } - return; -} - - - -//***** ModuleSpecialPixelMap *****// - -//===== Constructors, Destructor =====// - -ModuleSpecialPixelMap::ModuleSpecialPixelMap() : - m_chipsPerModule(0), - m_module_status(0) -{} - -ModuleSpecialPixelMap::ModuleSpecialPixelMap(const ModuleSpecialPixelMap& mspm) : - std::map<unsigned int, unsigned int>(mspm), - m_chipsPerModule(mspm.m_chipsPerModule), - m_module_status(mspm.m_module_status), - m_chip_status(mspm.m_chip_status), - m_column_pair_status(mspm.m_column_pair_status) -{} - -ModuleSpecialPixelMap::ModuleSpecialPixelMap(const char* filename, unsigned int mchips) : - m_chipsPerModule(mchips), - m_module_status(0) -{ - std::ifstream in(filename, std::ios_base::in); - //std::string ssink; - //std::getline(in, ssink); - - while(in.good()){ - unsigned int chip, column, row, status; - in >> chip >> column >> row >> status; - - if(in.good()){ - if(validPixelID(chip, column, row)){ - //do not record pixels that are listed as "unknown dead" and nothing else - if((status & ~((15 << 25) + (1 << 16))) != 0){ - //mark pixels as "unknown dead" if they are dead but we don't know why - if((status % 2 == 1) && ((status & (255 << 8)) == 0)){ - setPixelStatus(encodePixelID(chip, column, row, m_chipsPerModule), status |= (1 << 16)); - } - else{ - setPixelStatus(encodePixelID(chip, column, row, m_chipsPerModule), status); - } - } - } - else{ - std::cout << "In ModuleSpecialPixelMap::ModuleSpecialPixelMap(const char*) :" - << " Invalid pixel ID read from text file" << std::endl; - } - } - } - - setNeighbourFlags(); -} - -ModuleSpecialPixelMap::ModuleSpecialPixelMap(const std::string& clob, unsigned int mchips) : - m_chipsPerModule(mchips), - m_module_status(0) -{ - bool statuscode = fill_from_string(clob); - if( statuscode ){ - std::cout << "In ModuleSpecialPixelMap::ModuleSpecialPixelMap(const std::string&) :" - << " Construction from clob failed" << std::endl; - } -} - - -ModuleSpecialPixelMap::ModuleSpecialPixelMap(const coral::Blob& blob, unsigned int mchips) : - m_chipsPerModule(mchips), - m_module_status(0) -{ - bool statuscode = fill_from_blob(blob); - if(statuscode){ - std::cout << "In ModuleSpecialPixelMap::ModuleSpecialPixelMap(const coral::Blob&) :" - << " Construction from blob failed" << std::endl; - } -} - -ModuleSpecialPixelMap::ModuleSpecialPixelMap(const std::map<unsigned int, unsigned int>& pixels, - unsigned int module_status, - const std::vector<unsigned int>& chip_status, - const std::vector<std::vector<unsigned int> >& column_pair_status, - unsigned int mchips) : - std::map<unsigned int, unsigned int>(pixels), - m_chipsPerModule(mchips), - m_module_status(module_status), - m_chip_status(chip_status), - m_column_pair_status(column_pair_status) -{ -} - -ModuleSpecialPixelMap::~ModuleSpecialPixelMap(){} - - -//===== public member functions =====// - - -ModuleSpecialPixelMap& ModuleSpecialPixelMap::operator=(const ModuleSpecialPixelMap& mspm){ - if(&mspm != this){ - std::map<unsigned int, unsigned int>::operator=(mspm); - m_module_status = mspm.m_module_status; - m_chip_status = mspm.m_chip_status; - m_column_pair_status = mspm.m_column_pair_status; - m_chipsPerModule = mspm.m_chipsPerModule; - } - return *this; -} - -ModuleSpecialPixelMap& ModuleSpecialPixelMap::operator+=(ModuleSpecialPixelMap mspm){ - - if(mspm.moduleStatus() != 0 || mspm.hasSpecialChips() || mspm.hasSpecialColumnPairs() || !mspm.empty()){ - - mspm.resetSpecialRegions(); - resetSpecialRegions(); - - for(ModuleSpecialPixelMap::const_iterator pixel = mspm.begin(); pixel != mspm.end(); ++pixel){ - (*this)[(*pixel).first] |= (*pixel).second; - } - - markSpecialRegions(); - setNeighbourFlags(); - } - - return *this; -} - -void ModuleSpecialPixelMap::merge(const ModuleSpecialPixelMap* mspm){ - (*this) += (*mspm); - return; -} - -unsigned int ModuleSpecialPixelMap::pixelStatus(unsigned int pixelID) const{ - int i = (int)chipType(); - int mch = (int)chipsPerModule(); - int mcolumns =(int)columnsPerChip(); - int mrowsrdo = (int)rowsrdoPerChip(); - - int chip = pixelID % 16; - int column = (i==0) ? ((pixelID / 16) % 32) : ((pixelID / 16) % 256); - int row = (i==0) ? (pixelID / 512) : (pixelID / 4096); - - if(mch>2){ - - if(m_module_status != 0){ - unsigned int status = m_module_status; - if(column != 0 || (chip != 0 && chip != mch/2)){ // left - status |= (1 << 27); - } - if(column != (mcolumns -1) || (chip != (mch/2 - 1) && chip != (mch - 1))){ // right - status |= (1 << 28); - } - status |= (1 << 26); // top - if(row != 0){ // bottom - status |= (1 << 25); - } - return status; - } - else if(m_chip_status.size() != 0 && m_chip_status[chip] != 0){ - - unsigned int status = m_chip_status[chip]; - ModuleSpecialPixelMap::const_iterator pixel; - - if(column != 0){ // left - status |= (1 << 27); - } - else if(column == 0 && chip != 0 && chip != mch/2){ - pixel = find(encodePixelID(chip - 1, (mcolumns-1), row, m_chipsPerModule)); - if(m_chip_status[chip-1] != 0){ - status |= (1 << 27); - } - else if(m_column_pair_status.size() != 0 && m_column_pair_status[chip - 1].size() != 0 - && m_column_pair_status[chip - 1][mcolumns/2 - 1] != 0){ - status |= (1 << 27); - } - else if(pixel != end()){ - if(((*pixel).second & ~(15 << 25)) != 0){ - status |= (1 << 27); - } - } - } - - if(column != (mcolumns -1)){ // right - status |= (1 << 28); - } - else if(column == (mcolumns-1) && chip != (mch/2 - 1) && chip != (mch - 1)){ - pixel = find(encodePixelID(chip + 1, 0, row, m_chipsPerModule)); - if(m_chip_status[chip + 1] != 0){ - status |= (1 << 28); - } - else if(m_column_pair_status.size() != 0 && m_column_pair_status[chip + 1].size() != 0 - && m_column_pair_status[chip + 1][0] != 0){ - status |= (1 << 28); - } - else if(pixel != end()){ - if(((*pixel).second & ~(15 << 25)) != 0){ - status |= (1 << 28); - } - } - } - - if(row != (mrowsrdo - 1)){ // top - status |= (1 << 26); - } - else if(row == (mrowsrdo - 1)){ - pixel = find(encodePixelID(mch-1- chip, mcolumns-1- column, row, m_chipsPerModule)); - if(m_chip_status[mch-1 - chip] != 0){ - status |= (1 << 26); - } - else if(m_column_pair_status.size() != 0 && m_column_pair_status[mch - 1 - chip].size() != 0 - && m_column_pair_status[mch - 1 - chip][(mcolumns - 1 - column) / 2] != 0){ - status |= (1 << 26); - } - else if(pixel != end()){ - if(((*pixel).second & ~(15 << 25)) != 0){ - status |= (1 << 26); - } - } - } - - if(row != 0){ // bottom - status |= (1 << 25); - } - return status; - } - else if(m_column_pair_status.size() != 0 && m_column_pair_status[chip].size() != 0 - && m_column_pair_status[chip][column / 2] != 0){ - unsigned int status = m_column_pair_status[chip][column / 2]; - ModuleSpecialPixelMap::const_iterator pixel; - - if(column % 2 != 0){ // left - status |= (1 << 27); - } - else if(column % 2 == 0 && column != 0){ - pixel = find(encodePixelID(chip, column - 1, row, m_chipsPerModule)); - if(m_column_pair_status[chip][column / 2 - 1] != 0){ - status |= (1 << 27); - } - else if(pixel != end()){ - if(((*pixel).second & ~(15 << 25)) != 0){ - status |= (1 << 27); - } - } - } - else if(column == 0 && chip != 0 && chip != mch/2){ - pixel = find(encodePixelID(chip - 1, mcolumns - 1, row, m_chipsPerModule)); - if(m_chip_status.size() != 0 && m_chip_status[chip - 1] != 0){ - status |= (1 << 27); - } - else if(m_column_pair_status[chip - 1].size() != 0 - && m_column_pair_status[chip - 1][mcolumns/2 - 1] != 0){ - status |= (1 << 27); - } - else if(pixel != end()){ - if(((*pixel).second & ~(15 << 25)) != 0){ - status |= (1 << 27); - } - } - } - - if(column % 2 == 0){ // right - status |= (1 << 28); - } - else if(column % 2 != 0 && column != (mcolumns -1)){ - pixel = find(encodePixelID(chip, column + 1, row, m_chipsPerModule)); - if(m_column_pair_status[chip][(column / 2) + 1] != 0){ - status |= (1 << 28); - } - else if(pixel != end()){ - if(((*pixel).second & ~(15 << 25)) != 0){ - status |= (1 << 28); - } - } - } - else if(column == (mcolumns-1) && chip != (mch/2-1) && chip != (mch-1)){ - pixel = find(encodePixelID(chip + 1, 0, row, m_chipsPerModule)); - if(m_chip_status.size() != 0 && m_chip_status[chip + 1] != 0){ - status |= (1 << 28); - } - else if(m_column_pair_status[chip + 1].size() != 0 - &&m_column_pair_status[chip + 1][0] != 0){ - status |= (1 << 28); - } - else if(pixel != end()){ - if(((*pixel).second & ~(15 << 25)) != 0){ - status |= (1 << 28); - } - } - } - - if(row != (mrowsrdo - 1)){ // top - status |= (1 << 26); - } - else if(row == (mrowsrdo-1)){ - pixel = find(encodePixelID(mch-1 - chip, mcolumns-1 - column, mrowsrdo-1, m_chipsPerModule)); - if(m_chip_status.size() != 0 && m_chip_status[mch-1 - chip] != 0){ - status |= (1 << 26); - } - else if(m_column_pair_status[mch-1 - chip].size() != 0 - && m_column_pair_status[mch-1 - chip][(mcolumns-1 - column) / 2] != 0){ - status |= (1 << 26); - } - else if(pixel != end()){ - if(((*pixel).second & ~(15 << 25)) != 0){ - status |= (1 << 26); - } - } - } - - if(row != 0){ // bottom - status |= (1 << 25); - } - return status; - } - else if(empty()){ - return 0; - } - else{ - const_iterator pixel = find(pixelID); - if(pixel == end()){ - return 0; - } - else{ - return (*pixel).second; - } - } - } - else { // IBL modules - - if(m_module_status != 0){ - unsigned int status = m_module_status; - if(column != 0 || (chip != 0)){ // left - status |= (1 << 27); - } - if(column != (mcolumns-1) || (chip != 1&&mch==2)){ // right - status |= (1 << 28); - } - if(row != (mrowsrdo-1))status |= (1 << 26); // top - if(row != 0){ // bottom - status |= (1 << 25); - } - return status; - } - else if(m_chip_status.size() != 0 && m_chip_status[chip] != 0){ - - unsigned int status = m_chip_status[chip]; - ModuleSpecialPixelMap::const_iterator pixel; - - if(column != 0){ // left - status |= (1 << 27); - } - else if(column == 0 && chip != 0&&mch==2){ - pixel = find(encodePixelID(chip - 1, mcolumns-1, row, m_chipsPerModule)); - if(m_chip_status[chip-1] != 0){ - status |= (1 << 27); - } - else if(m_column_pair_status.size() != 0 && m_column_pair_status[chip - 1].size() != 0 - && m_column_pair_status[chip - 1][mcolumns/2 - 1] != 0){ - status |= (1 << 27); - } - else if(pixel != end()){ - if(((*pixel).second & ~(15 << 25)) != 0){ - status |= (1 << 27); - } - } - } - - if(column != (mcolumns - 1) ){ // right - status |= (1 << 28); - } - else if(column == (mcolumns - 1) && chip != 1 &&mch==2){ - pixel = find(encodePixelID(chip + 1, 0, row,m_chipsPerModule)); - if(m_chip_status[chip + 1] != 0){ - status |= (1 << 28); - } - else if(m_column_pair_status.size() != 0 && m_column_pair_status[chip + 1].size() != 0 - && m_column_pair_status[chip + 1][0] != 0){ - status |= (1 << 28); - } - else if(pixel != end()){ - if(((*pixel).second & ~(15 << 25)) != 0){ - status |= (1 << 28); - } - } - } - - if(row != (mrowsrdo-1)){ // top - status |= (1 << 26); - } - - if(row != 0){ // bottom - status |= (1 << 25); - } - return status; - } - else if(m_column_pair_status.size() != 0 && m_column_pair_status[chip].size() != 0 - && m_column_pair_status[chip][column / 2] != 0){ - unsigned int status = m_column_pair_status[chip][column / 2]; - ModuleSpecialPixelMap::const_iterator pixel; - - if(column % 2 != 0){ // left - status |= (1 << 27); - } - else if(column % 2 == 0 && column != 0){ - pixel = find(encodePixelID(chip, column - 1, row, m_chipsPerModule)); - if(m_column_pair_status[chip][(column / 2) - 1] != 0){ - status |= (1 << 27); - } - else if(pixel != end()){ - if(((*pixel).second & ~(15 << 25)) != 0){ - status |= (1 << 27); - } - } - } - else if(column == 0 && chip != 0 && mch==2){ - pixel = find(encodePixelID(chip - 1, (mcolumns-1), row, m_chipsPerModule)); - if(m_chip_status.size() != 0 && m_chip_status[chip - 1] != 0){ - status |= (1 << 27); - } - else if(m_column_pair_status[chip - 1].size() != 0 - && m_column_pair_status[chip - 1][mcolumns/2-1] != 0){ - status |= (1 << 27); - } - else if(pixel != end()){ - if(((*pixel).second & ~(15 << 25)) != 0){ - status |= (1 << 27); - } - } - } - - if(column % 2 == 0){ // right - status |= (1 << 28); - } - else if(column % 2 != 0 && column != (mcolumns-1)){ - pixel = find(encodePixelID(chip, column + 1, row, m_chipsPerModule)); - if(m_column_pair_status[chip][(column / 2) + 1] != 0){ - status |= (1 << 28); - } - else if(pixel != end()){ - if(((*pixel).second & ~(15 << 25)) != 0){ - status |= (1 << 28); - } - } - } - else if(column == (mcolumns-1) && chip != 1 && mch==2){ - pixel = find(encodePixelID(chip + 1, 0, row, m_chipsPerModule)); - if(m_chip_status.size() != 0 && m_chip_status[chip + 1] != 0){ - status |= (1 << 28); - } - else if(m_column_pair_status[chip + 1].size() != 0 - &&m_column_pair_status[chip + 1][0] != 0){ - status |= (1 << 28); - } - else if(pixel != end()){ - if(((*pixel).second & ~(15 << 25)) != 0){ - status |= (1 << 28); - } - } - } - - if(row != (mrowsrdo-1)){ // top - status |= (1 << 26); - } - if(row != 0){ // bottom - status |= (1 << 25); - } - return status; - } - else if(empty()){ - return 0; - } - else{ - const_iterator pixel = find(pixelID); - if(pixel == end()){ - return 0; - } - else{ - return (*pixel).second; - } - } - } -} - -bool ModuleSpecialPixelMap::pixelStatusBit(unsigned int pixelID, unsigned int bit) const{ - if(bit < 32){ - unsigned int status = pixelStatus(pixelID); - return static_cast<bool>(status & (1u << bit)); - } - else { - std::cout << "Requested bit " << bit << " out of range ([0,31] allowed)" << std::endl; - } - return false; -} - -std::string ModuleSpecialPixelMap::to_string() const{ - - std::ostringstream clob(std::ios::binary); - - clob << m_module_status << ' '; - - unsigned int specialRegionsStatus = 0; - int mch =(int)chipsPerModule(); - int mcolumns = (int)columnsPerChip()/2; - - for(int i = 0; i < mch; i++){ - if(m_chip_status.size() != 0 && m_chip_status[i] != 0){ - specialRegionsStatus |= (1 << i); - } - for(int j = 0; j < mcolumns; j++){ - if(m_column_pair_status.size() != 0 && m_column_pair_status[i].size() != 0 - && m_column_pair_status[i][j] != 0){ - specialRegionsStatus |= (1 << (i+mch)); - } - } - } - - clob << specialRegionsStatus << ' '; - - for(int i = 0; i < mch; i++){ - if((specialRegionsStatus & (1 << i)) != 0){ - clob << m_chip_status[i] << ' '; - } - if((specialRegionsStatus & (1 << (i+mch))) != 0){ - for(int j = 0; j < mcolumns; j++){ - clob << m_column_pair_status[i][j] << ' '; - } - } - } - - for(const_iterator mi = begin(); mi != end(); ++mi){ - clob << mi->first << ' ' << mi->second << ' '; - } - return clob.str(); -} - - -coral::Blob* ModuleSpecialPixelMap::to_blob() const{ - - unsigned int specialRegionsStatus = 0; - unsigned int specialRegionsSize = 0; - int mch =(int)chipsPerModule(); - int mcolumns = (int)columnsPerChip()/2; - - for(int i = 0; i < mch; i++){ - if(m_chip_status.size() != 0 && m_chip_status[i] != 0){ - specialRegionsStatus |= (1 << i); - ++specialRegionsSize; - } - for(int j = 0; j < mcolumns; j++){ - if(m_column_pair_status.size() != 0 && m_column_pair_status[i].size() != 0 - && m_column_pair_status[i][j] != 0){ - - if( (specialRegionsStatus & (1 << (i+mch)) ) == 0){ - specialRegionsSize += mcolumns; - } - - specialRegionsStatus |= (1 << (i+mch)); - } - } - } - - coral::Blob* blob = new coral::Blob( (2 + specialRegionsSize + 2 * size()) * sizeof(uint32_t) ); - - uint32_t* p = static_cast<uint32_t*>(blob->startingAddress()); - - *p = m_module_status; - ++p; - *p = specialRegionsStatus; - - for(int i = 0; i < mch; i++){ - if((specialRegionsStatus & (1 << i)) != 0){ - ++p; - *p = m_chip_status[i]; - } - if((specialRegionsStatus & (1 << (i+mch))) != 0){ - for(int j = 0; j < mcolumns; j++){ - ++p; - *p = m_column_pair_status[i][j]; - } - } - } - - for(const_iterator mi = begin(); mi != end(); ++mi){ - ++p; - *p = mi->first; - ++p; - *p = mi->second; - } - - return blob; -} - -void ModuleSpecialPixelMap::print(int component, - unsigned int layer, - unsigned int phi, - int eta, - bool verbosePixelID, - bool binaryPixelStatus) const{ - - unsigned int system, subSystem; - system = 2; - subSystem = 1; - - int itype = (int)chipType(); - int mch = (int)chipsPerModule(); - int mcolumns =(int)columnsPerChip(); - - // check what to do with moduleID ? - int moduleID = itype==0 ? ( ( ((component + 2) / 2) << 25 ) + - ( layer << 23 ) + ( phi << 17 ) + ( (eta + 6) << 13 )): -1; - - //print header - - std::cout << " " << std::endl; - if(moduleID>-1)std::cout << "ModuleSpecialPixelMap for module " << moduleID << ":" << std::endl; - std::cout << "Offline ID [system,subsystem,endcap/barrel,layer/disk,phi,eta] : [" - << system << ',' << subSystem << ',' << component << ',' << layer << ',' << phi << ',' << eta << ']' << std::endl; - std::cout << "Module status: "; - std::cout.width(10); - std::cout << m_module_status << std::endl; - std::cout << " " << std::endl; - - bool print_chip_status = false; - bool print_column_pair_status = false; - - for(int i = 0; i < mch; i++){ - if(m_chip_status.size() != 0 && m_chip_status[i] != 0){ - print_chip_status = true; - } - for(int j = 0; j < mcolumns/2; j++){ - if(m_column_pair_status.size() != 0 && m_column_pair_status[i].size() != 0 - && m_column_pair_status[i][j] != 0){ - print_chip_status = true; - print_column_pair_status = true; - } - } - } - - if(mch>2){ - if(print_chip_status){ - std::cout << "Chip number: "; - for(int i = mch-1; i>mch/2-1; i--)std::cout<<i<<" "; - std::cout<< std::endl; - std::cout << "Chip status: "; - for(int i = mch-1; i > mch/2-1; i--){ - std::cout.width(10); - if(m_chip_status.size() != 0){ - std::cout << m_chip_status[i] << " "; - } - else{ - std::cout << 0 << " "; - } - } - std::cout << std::endl; - std::cout << " " << std::endl; - - if(print_column_pair_status){ - std::cout << "Column pairs: "; - for(int i = mch-1; i > mch/2-1; i--){ - std::cout.width(10); - if(m_column_pair_status.size() != 0 && m_column_pair_status[i].size() != 0){ - std::cout << m_column_pair_status[i][0] << " "; - } - else{ - std::cout << 0 << " "; - } - } - std::cout << std::endl; - std::cout << "pairs 0 to "<<mch/2<<" "; - for(int i = mch-1; i > mch/2-1; i--){ - std::cout.width(10); - if(m_column_pair_status.size() != 0 && m_column_pair_status[i].size() != 0){ - std::cout << m_column_pair_status[i][1] << " "; - } - else{ - std::cout << 0 << " "; - } - } - std::cout << std::endl; - for(int j = 2; j < mcolumns/2; j++){ - std::cout << " "; - for(int i = mch-1; i > mch/2-1; i--){ - std::cout.width(10); - if(m_column_pair_status.size() != 0 && m_column_pair_status[i].size() != 0){ - std::cout << m_column_pair_status[i][j] << " "; - } - else{ - std::cout << 0 << " "; - } - } - std::cout << std::endl; - } - std::cout << " " << std::endl; - - - std::cout << "Column pairs: "; - for(int i = 0; i < mch/2; i++){ - std::cout.width(10); - if(m_column_pair_status.size() != 0 && m_column_pair_status[i].size() != 0){ - std::cout << m_column_pair_status[i][0] << " "; - } - else{ - std::cout << 0 << " "; - } - } - std::cout << std::endl; - std::cout << "pairs 0 to "<<mch/2<<" "; - for(int i = 0; i < mch/2; i++){ - std::cout.width(10); - if(m_column_pair_status.size() != 0 && m_column_pair_status[i].size() != 0){ - std::cout << m_column_pair_status[i][1] << " "; - } - else{ - std::cout << 0 << " "; - } - } - std::cout << std::endl; - for(int j = 2; j < mcolumns/2; j++){ - std::cout << " "; - for(int i = 0; i < mch/2; i++){ - std::cout.width(10); - if(m_column_pair_status.size() != 0 && m_column_pair_status[i].size() != 0){ - std::cout << m_column_pair_status[i][j] << " "; - } - else{ - std::cout << 0 << " "; - } - } - std::cout << std::endl; - } - std::cout << " " << std::endl; - } - else{ - std::cout << "No special column pairs on this module" << std::endl; - std::cout << " " << std::endl; - } - - std::cout << "Chip status: "; - for(int i = 0; i < mch/2; i++){ - std::cout.width(10); - if(m_chip_status.size() != 0){ - std::cout << m_chip_status[i] << " "; - } - else{ - std::cout << 0 << " "; - } - } - std::cout << std::endl; - std::cout << "Chip number: "; - for(int i = 0; i<mch/2; ++i)std::cout<<i<<" "; - std::cout<< std::endl; - std::cout << " " << std::endl; - std::cout << " " << std::endl; - } - else{ - std::cout << "No special chips and/or column pairs on this module" << std::endl; - std::cout << " " << std::endl; - } - - //print map - - for(const_iterator pixel = begin(); pixel != end(); ++pixel){ - if(verbosePixelID){ - unsigned int pixelID = pixel->first; - unsigned int chip = pixelID % 16; - unsigned int column = (itype==0) ? ((pixelID / 16) % 32) : ((pixelID / 16) % 256); - unsigned int row = (itype==0) ? (pixelID / 512) : (pixelID / 4096); - std::cout << "Pixel (chip/column/row) "; - std::cout << ' '; - std::cout << chip << "/"; - std::cout << ' '; - std::cout << column << "/"; - std::cout << ' '; - std::cout << row; - } - else{ - std::cout << "Pixel " << pixel->first; - } - if(binaryPixelStatus){ - unsigned int pixelStatus = pixel->second; - std::cout << " status: "; - for(int i = 31; i >= 0; i--){ - bool statusBit = pixelStatus & (1u << i); - std::cout << statusBit; - if(!(i%4)) std::cout << ' '; - } - std::cout << std::endl; - } - else{ - std::cout << " status: " << pixel->second << std::endl; - } - } - } - else{ // IBL FEI4 module - // - if(print_chip_status){ - std::cout << "Chip number: "; - for(int i =0; i<mch; ++i)std::cout<<i<<" "; - std::cout<< std::endl; - - std::cout << "Chip status: "; - for(int i = 0; i < (int)mch; i++){ - std::cout.width(10); - if(m_chip_status.size() != 0){ - std::cout << m_chip_status[i] << " "; - } - else{ - std::cout << 0 << " "; - } - } - std::cout << std::endl; - std::cout << " " << std::endl; - - if(print_column_pair_status){ - std::cout << "Column pairs 0 to "<<mcolumns/2<<" "; - std::cout << std::endl; - for(int j = 0; j<mcolumns/2; ++j){ - for(int i = 0; i < mch; i++){ - std::cout.width(10); - if(m_column_pair_status.size() != 0 && m_column_pair_status[i].size() != 0){ - std::cout << m_column_pair_status[i][j] << " "; - } - else{ - std::cout << 0 << " "; - } - } - std::cout << std::endl; - } - - std::cout << " " << std::endl; - - } - else{ - std::cout << "No special column pairs on this module" << std::endl; - std::cout << " " << std::endl; - } - } - else{ - std::cout << "No special chips and/or column pairs on this module" << std::endl; - std::cout << " " << std::endl; - } - - //print map - - for(const_iterator pixel = begin(); pixel != end(); ++pixel){ - if(verbosePixelID){ - unsigned int pixelID = pixel->first; - unsigned int chip = pixelID % 16; - unsigned int column = (itype==0) ? ((pixelID / 16) % 32) : ((pixelID / 16) % 256); - unsigned int row = (itype==0) ? (pixelID / 512) : (pixelID / 4096); - - std::cout << "Pixel (chip/column/row) "; - std::cout <<' '; - std::cout << chip << "/"; - std::cout <<' '; - std::cout << column << "/"; - std::cout <<' '; - std::cout << row; - } - else{ - std::cout << "Pixel " << pixel->first; - } - if(binaryPixelStatus){ - unsigned int pixelStatus = pixel->second; - std::cout << " status: "; - for(int i = 31; i >= 0; i--){ - bool statusBit = pixelStatus & (1u << i); - std::cout << statusBit; - if(!(i%4)) std::cout << ' '; - } - std::cout << std::endl; - } - else{ - std::cout << " status: " << pixel->second << std::endl; - } - } - // - } - return; -} - -void ModuleSpecialPixelMap::setPixelStatus(unsigned int pixelID, unsigned int status){ - if(validPixelID(pixelID)){ - condResetSpecialRegions(pixelID, status); - - unsigned int chip = pixelID % 16; - unsigned int column = chipType()==0 ? ((pixelID / 16) % 32): ((pixelID / 16) % 256); - - if(status == 0){ - erase(pixelID); - } - else{ - if(m_module_status == 0 && (m_chip_status.size() == 0 || m_chip_status[chip] == 0) - && (m_column_pair_status.size() == 0 || m_column_pair_status[chip].size() == 0 - || m_column_pair_status[chip][column/ 2] == 0)){ - (*this)[pixelID] = status; - } - } - } - else{ - std::cout << "Invalid pixel ID requested"; - } - return; -} - -void ModuleSpecialPixelMap::setPixelStatusBit(unsigned int pixelID, unsigned int bit){ - unsigned int chip = pixelID % 16; - unsigned int column = (chipType())==0 ? ((pixelID / 16) % 32): ((pixelID / 16) % 256); - - if(validPixelID(pixelID)){ - if((pixelStatus(pixelID) & (1 << bit)) == 0){ - condResetSpecialRegions(pixelID, pixelStatus(pixelID) | (1 << bit)); - } - if(bit < 32){ - if(m_module_status == 0 && (m_chip_status.size() == 0 || m_chip_status[chip] == 0) - && (m_column_pair_status.size() == 0 || m_column_pair_status[chip].size() == 0 - || m_column_pair_status[chip][column / 2] == 0)){ - (*this)[pixelID] |= (1 << bit); - } - } - else { - std::cout << "Requested bit " << bit << " out of range ([0,31] allowed)" << std::endl; - } - } - else{ - std::cout << "Invalid pixel ID requested" << std::endl; - } - return; -} - -void ModuleSpecialPixelMap::clearPixelStatusBit(unsigned int pixelID, unsigned int bit){ - unsigned int chip = pixelID % 16; - unsigned int column = chipType()==0 ? ((pixelID / 16) % 32): ((pixelID /16) % 256); - - if(validPixelID(pixelID)){ - if((pixelStatus(pixelID) & (1 << bit)) != 0){ - condResetSpecialRegions(pixelID, pixelStatus(pixelID) & ~(1 << bit)); - } - if(bit < 32){ - if(!empty()){ - if(find(pixelID) != end()){ - if(m_module_status == 0 && (m_chip_status.size() == 0 || m_chip_status[chip] == 0) - && (m_column_pair_status.size() == 0 || m_column_pair_status[chip].size() == 0 - || m_column_pair_status[chip][column / 2] == 0)){ - (*this)[pixelID] &= ~(1 << bit); - if(((*this)[pixelID] & ~(15 << 25)) == 0){ - erase(pixelID); - } - } - } - } - } - else{ - std::cout << "Requested bit " << bit << " out of range ([0,31] allowed)" << std::endl; - } - } - else { - std::cout << "Invalid pixel ID requested" << std::endl; - } - return; -} - -void ModuleSpecialPixelMap::condResetSpecialRegions(unsigned int pixelID, unsigned status){ - - // reset module/chip/column pair status if necessary - unsigned int ix = chipType(); - unsigned int mcolumns = columnsPerChip()/2; - unsigned int mrows = rowsrdoPerChip(); - int mch = (int)chipsPerModule(); - unsigned int chip = pixelID % 16; - unsigned int column = (ix==0) ? ((pixelID / 16) % 32): ((pixelID /16) % 256); - - if(m_module_status != 0 && m_module_status != (status & ~(15 << 25))){ - m_chip_status.resize(mch); - for(int i = 0; i < mch; i++){ - m_chip_status[i] = m_module_status; - } - m_module_status = 0; - } - - if(m_chip_status.size() != 0 && m_chip_status[chip] != 0 - && m_chip_status[chip] != (status & ~(15 << 25))){ - m_column_pair_status.resize(mch); - m_column_pair_status[chip].resize(mcolumns); - for(int j = 0; j < (int)mcolumns; j++){ - m_column_pair_status[chip][j] = m_chip_status[chip]; - } - m_chip_status[chip] = 0; - } - - if(m_column_pair_status.size() != 0 && m_column_pair_status[chip].size() != 0 - && m_column_pair_status[chip][column / 2] != 0 - && m_column_pair_status[chip][column / 2] != (status & ~(15 << 25))){ - for(int i = 0; i < 2; i++){ - for(int row = 0; row < (int)mrows; row++){ - (*this)[encodePixelID(chip, (column / 2) * 2 + i, row, m_chipsPerModule)] - = m_column_pair_status[chip][column / 2]; - } - } - m_column_pair_status[chip][column / 2] = 0; - setNeighbourFlags(); - } - - return; -} - -void ModuleSpecialPixelMap::resetSpecialRegions(){ - unsigned int mcolumns = columnsPerChip()/2; - unsigned int mrows = rowsrdoPerChip(); - int mch = (int)chipsPerModule(); - - // reset module/chip/column pair status - - if(m_module_status != 0){ - m_chip_status.resize(mch); - for(int chip = 0; chip < mch; chip++){ - m_chip_status[chip] = m_module_status; - } - m_module_status = 0; - } - - if(m_chip_status.size() != 0){ - for(int chip = 0; chip < mch; chip++){ - if(m_chip_status[chip] != 0){ - m_column_pair_status.resize(mch); - m_column_pair_status[chip].resize(mcolumns); - for(int column_pair = 0; column_pair < (int)mcolumns; column_pair++){ - m_column_pair_status[chip][column_pair] = m_chip_status[chip]; - } - } - } - m_chip_status.resize(0); - } - - if(m_column_pair_status.size() != 0){ - for(int chip = 0; chip < mch; chip++){ - if(m_column_pair_status[chip].size() != 0){ - for(int column_pair = 0; column_pair < (int)mcolumns; column_pair++){ - if(m_column_pair_status[chip][column_pair] != 0){ - for(int i = 0; i < 2; i++){ - for(int row = 0; row < (int)mrows; row++){ - (*this)[encodePixelID(chip, 2*column_pair + i, row, m_chipsPerModule)] - = m_column_pair_status[chip][column_pair]; - } - } - } - } - } - } - m_column_pair_status.resize(0); - setNeighbourFlags(); - } - return; -} - -bool ModuleSpecialPixelMap::fill_from_string(const std::string& clob){ - unsigned int mcolumns = columnsPerChip()/2; - int mch = (int)chipsPerModule(); - int mkey = (int)pow(2, mch) -1; - - unsigned int pixelID, status; - std::istringstream input_string(clob, std::ios::binary); - input_string >> m_module_status; - - unsigned int specialRegionsStatus = 0; - - input_string >> specialRegionsStatus; - - if((specialRegionsStatus & mkey) != 0){ - m_chip_status.resize(mch); - } - if((specialRegionsStatus & (mkey << mch)) != 0){ - m_column_pair_status.resize(mch); - } - - for(int i = 0; i < mch; i++){ - if((specialRegionsStatus & (1 << i)) != 0){ - input_string >> m_chip_status[i]; - } - if((specialRegionsStatus & (1 << (i+mch))) != 0){ - m_column_pair_status[i].resize(mcolumns); - for(int j = 0; j < (int)mcolumns; j++){ - input_string >> m_column_pair_status[i][j]; - } - } - } - - input_string >> pixelID >> status; - while(input_string.good()){ - setPixelStatus(pixelID, status); - input_string >> pixelID >> status; - } - return false; -} - - -bool ModuleSpecialPixelMap::fill_from_blob(const coral::Blob& blob){ - unsigned int mcolumns = columnsPerChip()/2; - int mch = (int)chipsPerModule(); - int mkey = (int)pow(2, mch) -1; - - unsigned int pixelID, status; - - const uint32_t* p = static_cast<const uint32_t*>(blob.startingAddress()); - - m_module_status = *p; - - ++p; - unsigned int specialRegionsStatus = *p; - unsigned int integersRead = 2; - - if((specialRegionsStatus & mkey) != 0){ - m_chip_status.resize(mch); - } - if((specialRegionsStatus & (mkey << mch)) != 0){ - m_column_pair_status.resize(mch); - } - - for(int i = 0; i < mch; i++){ - if((specialRegionsStatus & (1 << i)) != 0){ - ++p; - ++integersRead; - m_chip_status[i] = *p; - } - if((specialRegionsStatus & (1 << (i+mch))) != 0){ - m_column_pair_status[i].resize(mcolumns); - for(int j = 0; j < (int)mcolumns; j++){ - ++p; - ++integersRead; - m_column_pair_status[i][j] = *p; - } - } - } - - while( static_cast<int>(integersRead * sizeof(unsigned int)) < blob.size() ){ - ++p; - ++integersRead; - pixelID = *p; - ++p; - ++integersRead; - status = *p; - setPixelStatus(pixelID, status); - } - - return false; -} - -unsigned int ModuleSpecialPixelMap::pixelType(unsigned int column, unsigned int row, unsigned int mchips){ - unsigned int i = std::min(mchips%10, nmtype-1); - int mch = (int)mchips/10; - unsigned int mcolumns = columnsPerFEIX[i]; - unsigned int mrowsrdo = rowsRdoPerFEIX[i]; - unsigned int mrows = rowsPerFEIX[i]; - int ng = (int)(mrows - mrowsrdo); - - if(mch>2){ - if(column > 0 && column < mcolumns-1 && row < mrowsrdo){ - if(ng>0){ - for(int k = 0; k<ng; ++k){ - if(row==(mrowsrdo-2-2*k))return 5; // inter-ganged - if(row==(mrowsrdo-1-2*k)) return 2; // ganged - } - } - return 0; // normal - } - else if((column == 0 || column == mcolumns-1) && row < mrowsrdo){ - if(ng>0){ - for(int k = 0; k<ng; ++k){ - if(row==(mrowsrdo-2-2*k))return 6; // long inter-ganged - if(row==(mrowsrdo-1-2*k)) return 3; // long ganged - } - } - return 1; //long - } - else return 8; //invalid row/column pair - } - else { // IBL FEI4 - if( row<mrows&&column<mcolumns ){ - if( mch==2 && (column ==0 || column==(mcolumns-1)) ){ - return 1; //long - } - else{ - return 0; // normal - } - } - else return 8; //invalid row/column pair - } -} - -/* -unsigned int ModuleSpecialPixelMap::pixelType(unsigned int column, unsigned int row){ - unsigned int mchips = 16; - return pixelType(column, row, mchips); -} -*/ - - -std::vector<unsigned int> ModuleSpecialPixelMap::decodePixelID(unsigned int pixelID, unsigned int typeFE){ - - unsigned int chip = (pixelID & 0xF); - pixelID >>=4; - unsigned int column = (pixelID & 0x1F); - (typeFE == 0) ? pixelID >>=5 : pixelID >>=8; //typeFE = 0 for FEI3 and 1 for FEI4 - unsigned int row = pixelID; - - std::vector<unsigned int> ChipColRow; - ChipColRow.push_back(chip); - ChipColRow.push_back(column); - ChipColRow.push_back(row); - - return ChipColRow; - -} - - -unsigned int ModuleSpecialPixelMap::encodePixelID(unsigned int chip, unsigned int column, unsigned int row, unsigned int mchips){ - int i = mchips%10; // type of module - unsigned int pixelID = row; - pixelID = (i==0) ? pixelID << 5 : pixelID << 8; - pixelID += column; - pixelID = pixelID << 4; - pixelID += chip; - return pixelID; -} - - -unsigned int ModuleSpecialPixelMap::encodePixelID(unsigned int chip, unsigned int column, unsigned int row ){ - - unsigned int mchips = 16*10; - return encodePixelID(chip, column, row, mchips); -} - - -unsigned int ModuleSpecialPixelMap::encodePixelID(int component, unsigned int module_phi_index, - unsigned int pixel_eta_index, unsigned int pixel_phi_index, unsigned int mchips){ - unsigned int i = std::min(mchips%10, nmtype-1); - int mch = (int)mchips/10; - unsigned int mcolumns = columnsPerFEIX[i]; - unsigned int mrowsrdo = rowsRdoPerFEIX[i]; - unsigned int mrows = rowsPerFEIX[i]; - int ng = (int)(mrows - mrowsrdo); - - unsigned int chip = 0, column = 0, row = 0; - // - if(std::abs(component)!=2) { //not endcap - if(mch>2){ - if(pixel_phi_index < mrows){ - chip = pixel_eta_index / mcolumns + mch/2; - column = pixel_eta_index % mcolumns; - if(pixel_phi_index < mrowsrdo)row = pixel_phi_index; - else if(ng>0){ - for(int k=0; k<ng; ++k){ - if(pixel_phi_index ==(mrowsrdo+k))row = mrowsrdo+1 -2*(ng-k); - } - } - } - else if(pixel_phi_index >= mrows && pixel_phi_index < 2*mrows){ - chip = mch/2 - (1 + pixel_eta_index / mcolumns); - column = mcolumns - (1+pixel_eta_index % mcolumns); - if(pixel_phi_index > (mrows+ng-1))row = 2*mrows-1 - pixel_phi_index; - else if(ng>0){ - for(int k = 0; k<ng; ++k){ - if(pixel_phi_index ==(mrows+k))row =mrowsrdo-1-2*k; - } - } - } - } - else{ - row = (mrows-1) - pixel_phi_index; - column = mcolumns-(1 + pixel_eta_index%mcolumns); - chip = mch==1 ? 0: 1-pixel_eta_index/mcolumns; - } - } - else{ //disks - if(module_phi_index % 2 == 0){ //even modules - if(pixel_phi_index < mrows){ - chip = mch/2 - (1+pixel_eta_index / mcolumns); - column = mcolumns - (1+pixel_eta_index % mcolumns); - if(pixel_phi_index < mrowsrdo)row = pixel_phi_index; - else if(ng>0){ - for(int k=0; k<ng; ++k){ - if(pixel_phi_index ==(mrowsrdo+k)) row = mrowsrdo+1 -2*(ng-k); - } - } - } - else if(pixel_phi_index > (mrows-1) && pixel_phi_index < 2*mrows){ - chip = pixel_eta_index / mcolumns + mch/2; - column = pixel_eta_index % mcolumns; - if(pixel_phi_index > (mrows+ng-1))row = 2*mrows - 1 - pixel_phi_index; - else if(ng>0){ - for(int k = 0; k<ng; ++k){ - if(pixel_phi_index ==(mrows+k))row =mrowsrdo-1-2*k; - } - } - } - } - else if(module_phi_index % 2 == 1){ //odd modules - if(pixel_phi_index > (mrows+ng-1) && pixel_phi_index < 2*mrows){ - chip = mch/2 -(1 + pixel_eta_index / mcolumns); - column = mcolumns - (1 + pixel_eta_index % mcolumns); - row = 2*mrows - 1 - pixel_phi_index; - } - else if(pixel_phi_index < mrows){ - chip = pixel_eta_index / mcolumns + mch/2; - column = pixel_eta_index % mcolumns; - if(pixel_phi_index < mrowsrdo)row = pixel_phi_index; - else if(ng>0){ - for(int k=0; k<ng; ++k){ - if(pixel_phi_index ==(mrowsrdo+k)) row = mrowsrdo+1 -2*(ng-k); - } - } - } - } - } - unsigned int pixelID = row; - pixelID = (i==0) ? pixelID << 5 : pixelID << 8; - pixelID += column; - pixelID = pixelID << 4; - pixelID += chip; - - return pixelID; -} - -/* -unsigned int ModuleSpecialPixelMap::encodePixelID(int component, unsigned int module_phi_index, - unsigned int pixel_eta_index, unsigned int pixel_phi_index){ - unsigned int mchips = 16; - return encodePixelID(component, module_phi_index, - pixel_eta_index, pixel_phi_index,mchips); -} - -*/ - -void ModuleSpecialPixelMap::markSpecialRegions(){ - - // start with column pairs - unsigned int mcolumns = columnsPerChip()/2; - unsigned int mrows = rowsrdoPerChip(); - - for(int chip = 0; chip < (int)chipsPerModule(); chip++){ - for(int column_pair = 0; column_pair < (int)mcolumns; column_pair++){ - int i = 0, row = 0; - unsigned int column_pair_status = (pixelStatus(encodePixelID(chip, 2*column_pair, row,m_chipsPerModule)) & ~(15 << 25)); - - if(column_pair_status != 0){ - while(i < 2 && (pixelStatus(encodePixelID(chip, 2*column_pair + i, row, m_chipsPerModule)) & ~(15 << 25)) == column_pair_status){ - row++; - if(row == (int)mrows){ - i++; - row = 0; - } - } - if(i == 2){ - setColumnPairStatus(chip, column_pair, column_pair_status); - } - } - } - } - - // then mark special chips - - if(m_column_pair_status.size() != 0){ - for(int chip = 0; chip < (int)chipsPerModule(); chip++){ - if(m_column_pair_status[chip].size() != 0){ - unsigned int chip_status = (m_column_pair_status[chip][0] & ~(15 << 25)); - int i = 1; - while(i < (int)mcolumns && ((m_column_pair_status[chip][i] & ~(15 << 25)) == chip_status)){ - i++; - } - if(i == (int)mcolumns){ - setChipStatus(chip, chip_status); - m_column_pair_status[chip].resize(0); - } - else{ - setChipStatus(chip, 0); - } - } - } - int j = 0; - while(j < (int)chipsPerModule() && m_column_pair_status[j].size() == 0){ - j++; - } - if(j == (int)chipsPerModule()){ - m_column_pair_status.resize(0); - } - } - - // finally see whether the whole module is special - - if(m_chip_status.size() != 0){ - unsigned int module_status = (m_chip_status[0] & ~(15 << 25)); - int i = 1; - while(i < (int)chipsPerModule() && (m_chip_status[i] & ~(15 << 25)) == module_status){ - i++; - } - if(i == (int)chipsPerModule()){ - setModuleStatus(module_status); - m_chip_status.resize(0); - m_column_pair_status.resize(0); - } - else{ - setModuleStatus(0); - } - } - return; -} - -void ModuleSpecialPixelMap::setModuleStatus(unsigned int module_status){ - if(module_status != 0){ - clear(); - } - m_module_status = (module_status & ~(15 << 25)); - return; -} - -void ModuleSpecialPixelMap::setChipStatus(unsigned int chip, unsigned int chip_status){ - unsigned int mcolumns = columnsPerChip(); - unsigned int mrows = rowsrdoPerChip(); - - if(chip_status != 0){ - for(int column = 0; column < (int)mcolumns; column++){ - for(int row = 0; row < (int)mrows; row ++){ - erase(encodePixelID(chip, column, row, m_chipsPerModule)); - } - } - m_chip_status.resize(chipsPerModule()); - m_chip_status[chip] = chip_status; - } - else if(m_chip_status.size() != 0){ - m_chip_status[chip] = (chip_status & ~(15 << 25)); - } - - return; -} - -void ModuleSpecialPixelMap::setColumnPairStatus(unsigned int chip, unsigned int column_pair, unsigned int column_pair_status){ - unsigned int mcolumns = columnsPerChip()/2; - unsigned int mrows = rowsrdoPerChip(); - - if(column_pair_status != 0){ - for(int i = 0; i < 2; i++){ - for(int row = 0; row < (int)mrows; row++){ - erase(encodePixelID(chip, 2*column_pair + i, row, m_chipsPerModule)); - } - } - m_column_pair_status.resize(chipsPerModule()); - m_column_pair_status[chip].resize(mcolumns); - m_column_pair_status[chip][column_pair] = (column_pair_status & ~(15 << 25)); - } - else if(m_column_pair_status.size() != 0 && m_column_pair_status[chip].size() != 0){ - m_column_pair_status[chip][column_pair] = column_pair_status; - } - - return; -} - -void ModuleSpecialPixelMap::setNeighbourFlags(){ - if(empty()){ - return; - } - else{ - //loop - int mch = (int)chipsPerModule(); - int mco =mch>2? mch/2:mch; - for(int chip = 0; chip < mch; chip++){ - for(int column = 0; column < (int)columnsPerChip(); column++){ - for(int row = 0; row < (int)rowsrdoPerChip(); row++){ - - //if this pixel is special... - const_iterator pixel = find(encodePixelID(chip, column, row, m_chipsPerModule)); - if(pixel != end()){ - if(((*pixel).second & ~(15 << 25)) != 0){ - - //see if left neighbour is also special - if(column != 0 && - (pixelStatus(encodePixelID(chip, column-1, row, m_chipsPerModule)) & ~(15 << 25)) != 0){ - setPixelStatusBit(encodePixelID(chip, column, row, m_chipsPerModule), 27); - } - else if(mch>2&&column == 0 && chip != 0 && chip != mco && - (pixelStatus(encodePixelID(chip-1, columnsPerChip()-1, row, m_chipsPerModule)) & ~(15 << 25)) != 0){ - setPixelStatusBit(encodePixelID(chip, column, row, m_chipsPerModule), 27); - } - else if(mch==2&&column == 0 && chip != 0 && - (pixelStatus(encodePixelID(chip-1, columnsPerChip()-1, row, m_chipsPerModule)) & ~(15 << 25)) != 0){ - setPixelStatusBit(encodePixelID(chip, column, row, m_chipsPerModule), 27); - } - else{ - clearPixelStatusBit(encodePixelID(chip, column, row, m_chipsPerModule), 27); - } - - //see if right neighbour is special - if(column != (int)(columnsPerChip()-1) && - (pixelStatus(encodePixelID(chip, column+1, row, m_chipsPerModule)) & ~(15 << 25)) != 0){ - setPixelStatusBit(encodePixelID(chip, column, row, m_chipsPerModule), 28); - } - else if(mch>2&&column == (int)(columnsPerChip()-1) && chip != (mco-1) && chip != (mch-1) && - (pixelStatus(encodePixelID(chip+1, 0, row, m_chipsPerModule)) & ~(15 << 25)) != 0){ - setPixelStatusBit(encodePixelID(chip, column, row, m_chipsPerModule), 28); - } - else if(mch==2&&column == (int)(columnsPerChip()-1) && chip != 1 && - (pixelStatus(encodePixelID(chip+1, 0, row, m_chipsPerModule)) & ~(15 << 25)) != 0){ - setPixelStatusBit(encodePixelID(chip, column, row, m_chipsPerModule), 28); - } - else{ - clearPixelStatusBit(encodePixelID(chip, column, row, m_chipsPerModule), 28); - } - - //see if top neighbour is special - if(row != (int)(rowsrdoPerChip()-1) && - (pixelStatus(encodePixelID(chip, column, row+1, m_chipsPerModule)) & ~(15 << 25)) != 0){ - setPixelStatusBit(encodePixelID(chip, column, row, m_chipsPerModule), 26); - } - else if(mch>2&&row == (int)(rowsrdoPerChip()-1) && - (pixelStatus(encodePixelID((mch-1-chip), (columnsPerChip()-1-column),(rowsrdoPerChip()-1), m_chipsPerModule)) & ~(15 << 25)) != 0){ - setPixelStatusBit(encodePixelID(chip, column, row, m_chipsPerModule), 26); - } - else{ - clearPixelStatusBit(encodePixelID(chip, column, row, m_chipsPerModule), 26); - } - - //see if bottom neighbour is special - if(row != 0 && - (pixelStatus(encodePixelID(chip, column, row-1, m_chipsPerModule)) & ~(15 << 25)) != 0){ - setPixelStatusBit(encodePixelID(chip, column, row, m_chipsPerModule), 25); - } - else{ - clearPixelStatusBit(encodePixelID(chip, column, row, m_chipsPerModule), 25); - } - } - } - } - } - } - return; - } -} - - -ModuleSpecialPixelMap::size_type ModuleSpecialPixelMap::size() const{ - return std::map<unsigned int, unsigned int>::size(); -} - -bool ModuleSpecialPixelMap::empty() const{ - return std::map<unsigned int, unsigned int>::empty(); -} - -ModuleSpecialPixelMap::iterator ModuleSpecialPixelMap::begin(){ - return std::map<unsigned int, unsigned int>::begin(); -} - -ModuleSpecialPixelMap::const_iterator ModuleSpecialPixelMap::begin() const{ - return std::map<unsigned int, unsigned int>::begin(); -} - -ModuleSpecialPixelMap::iterator ModuleSpecialPixelMap::end(){ - return std::map<unsigned int, unsigned int>::end(); -} - -ModuleSpecialPixelMap::const_iterator ModuleSpecialPixelMap::end() const{ - return std::map<unsigned int, unsigned int>::end(); -} - -bool ModuleSpecialPixelMap::hasSpecialChips() const{ - if(m_chip_status.size() == 0){ - return false; - } - else{ - for(std::vector<unsigned int>::const_iterator chip = m_chip_status.begin(); chip != m_chip_status.end(); ++chip){ - if(*chip != 0){ - return true; - } - } - } - - return false; -} - -bool ModuleSpecialPixelMap::hasSpecialColumnPairs() const{ - if(m_column_pair_status.size() == 0){ - return false; - } - else{ - - for(std::vector<std::vector<unsigned int> >::const_iterator chip = m_column_pair_status.begin(); - chip != m_column_pair_status.end(); ++chip){ - - for(std::vector<unsigned int>::const_iterator column_pair = - m_column_pair_status[chip - m_column_pair_status.begin()].begin(); - column_pair != m_column_pair_status[chip - m_column_pair_status.begin()].end(); - ++column_pair){ - - if((*column_pair) != 0){ - return true; - } - } - } - } - - return false; - -} - -bool ModuleSpecialPixelMap::hasSpecialColumnPairs(unsigned int chip) const{ - - if(m_column_pair_status.size() == 0){ - return false; - } - else if(chip >= chipsPerModule()){ - std::cout << "Chip index " << chip << " out of range" << std::endl; - return false; - } - else{ - for(std::vector<unsigned int>::const_iterator column_pair = m_column_pair_status[chip].begin(); - column_pair != m_column_pair_status[chip].end(); ++column_pair){ - - if((*column_pair) != 0){ - return true; - } - } - } - - return false; -} - -} // namespace PixelCoralClientUtils diff --git a/InnerDetector/InDetConditions/PixelCoralClientUtils/src/calibDbInterface.cc b/InnerDetector/InDetConditions/PixelCoralClientUtils/src/calibDbInterface.cc deleted file mode 100644 index f060d999fdbd9ca5f0e54026b9353d23371c872e..0000000000000000000000000000000000000000 --- a/InnerDetector/InDetConditions/PixelCoralClientUtils/src/calibDbInterface.cc +++ /dev/null @@ -1,94 +0,0 @@ -/* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration -*/ - -#include "PixelCoralClientUtils/PixCalibKnowledgeDb.h" -#include "PixelCoralClientUtils/PixCalibCoralCoolDb.h" - -#include "CoolKernel/ValidityKey.h" - -#include<iostream> -#include<string> -#include<cstdlib> -#include <sys/time.h> - -using namespace std; - -int main(int argc, char **argv) -{ - if (argc<2 || argv[1][0]!='-') { - cout << argv[0] << ": tool to talk to pixel coral database." << endl; - cout << "options:" << endl; - cout << "\t-s idTag connTag cfgTag cfgModTag calibtag calibTag1 calibTag2 calibTag3 etc" << endl; - cout << "\t store a list of calibration tags corresponding to a certain idTag connTag cfgTag cfgModTag in knowledge db"<< endl; - cout << "\t-r UNIXTimeInSeconds" << endl; - cout << "\t Find the list of calibration-tags valid for a certain UNIX-time in seconds" << endl; - return 1; - } - - string tableName("CALIB_DATA"); - - string connString("sqlite_file:pcd_knowledge.db"); - char* ctmp = getenv("PIXEL_CAL_KNOWLEDGE"); - if (ctmp) connString = ctmp; - - int c = argv[1][1]; - - switch (c) { - case 's': - { - if(argc > 2 && c==115) { - - //first 5 arguments relate to run-conditions - long int runNumber = atol(argv[2]); - string idTag = argv[3]; - string connTag = argv[4]; - string cfgTag = argv[5]; - string cfgModTag = argv[6]; - - string calibtags_in_string = ""; - for(int i=7;i<argc;i++){ - if(i!=7) calibtags_in_string = calibtags_in_string+","+argv[i]; - else calibtags_in_string = argv[i]; - } - - std::cout << "Store a reference that currently the latest calibration-tags are defined by: " << std::endl; - std::cout << calibtags_in_string << std::endl; - - std::cout << "Associated to the following run-conditions: " << std::endl; - std::cout << "runNumber " << runNumber << std::endl; - std::cout << "idTag: " << idTag << std::endl; - std::cout << "connTag: " << connTag << std::endl; - std::cout << "cfgTag: " << cfgTag << std::endl; - std::cout << "cfgModTag: " << cfgModTag << std::endl; - - struct timeval UNIXTime; - gettimeofday(&UNIXTime,NULL); - std::cout << "UNIXTime at moment of storing tags: " << UNIXTime.tv_sec << std::endl; - - PixCalibKnowledgeDb knowledgeDB(connString, tableName, 1); - knowledgeDB.init(coral::Update); - knowledgeDB.saveCorrespondingConfig(UNIXTime.tv_sec,runNumber,calibtags_in_string,idTag,connTag,cfgTag,cfgModTag); - } - } - break; - case 'r': - { - if(argc > 2 && argc < 4 && c==114) { - - long int Utime = atol(argv[2]); - - std::cout << "Read calibration-Tags valid for UNIXTimeInSeconds " << Utime << std::endl; - - PixCalibKnowledgeDb knowledgeDB(connString, tableName, 1); - knowledgeDB.init(coral::Update); - knowledgeDB.readCorrespondingCalibTag(Utime); - } - } - break; - default: - cout << "unknown option " << argv[1] << endl; - } - - return 0; -} diff --git a/InnerDetector/InDetConditions/PixelCoralClientUtils/src/extractAnalysis.cc b/InnerDetector/InDetConditions/PixelCoralClientUtils/src/extractAnalysis.cc deleted file mode 100644 index 031445abcd6ae2b619d5159ea6899e3a8ee39058..0000000000000000000000000000000000000000 --- a/InnerDetector/InDetConditions/PixelCoralClientUtils/src/extractAnalysis.cc +++ /dev/null @@ -1,462 +0,0 @@ -/* - Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration -*/ - -#include "CxxUtils/checker_macros.h" -#include "PixelCoralClientUtils/CoralClient.hh" -#include "PixelCoralClientUtils/PixelCalibData.hh" - -#include<string> -#include<cstring> -#include<map> -#include<set> -#include<fstream> -using namespace std; - -int main (int argc, char **argv){ - - int iarg = 1; - bool verbose = false; - if (argc>iarg && strcmp(argv[iarg],"-v")==0) { - verbose = true; - ++iarg; - } - - enum OPTION { THRESHOLDS, TIMEWALK, TOT }; - - OPTION option = TOT; - if (argc>iarg && strcmp(argv[iarg],"-t")==0) { - option = THRESHOLDS; - ++iarg; - } - if (argc>iarg && strcmp(argv[iarg],"-w")==0) { - option = TIMEWALK; - ++iarg; - } - - if (iarg>=argc) { - cout << "Usage: extractAnalysis [-v] [-t|-w] anal_id" << endl; - return 1; - } - - CAN::SerialNumber_t anal_id = atoi(argv[iarg]); - - cout << "--> Summary for anal_id " << anal_id << endl; - - // - // load pcd from text file - // - - map<unsigned int, PixelCoralClientUtils::PixelCalibData> pcdmap; - ifstream in("pcd.dat"); - if (!in.is_open()) return 1; - - while (in) { - unsigned int idmod; in >> idmod; - if (in.eof()) break; - - PixelCoralClientUtils::PixelCalibData pcd; - - for (int i = 0; i<16; ++i) { - char dummy; in >> dummy; - if (dummy!='I') break; - int idchip; in >> idchip; - if (idchip!=i) break; - PixelCoralClientUtils::PixelCalibData::PixelChipSummaryData pcsd; - pcsd.setChipID(idchip); - int thres, sigma, noise, timewalk; - in >> thres >> sigma >> noise >> timewalk; - pcsd.setThreshold(0, thres, sigma, noise, timewalk); - in >> thres >> sigma >> noise >> timewalk; - pcsd.setThreshold(1, thres, sigma, noise, timewalk); - in >> thres >> sigma >> noise >> timewalk; - pcsd.setThreshold(2, thres, sigma, noise, timewalk); - float A, E, C; - in >> A >> E >> C; - pcsd.setQ2Tot(0, A, E, C); - in >> A >> E >> C; - pcsd.setQ2Tot(2, A, E, C); - float p1, p2; - in >> p1 >> p2; - pcsd.setTotRes(p1, p2); - pcd.add(pcsd); - } - - pcdmap.insert(make_pair(idmod,pcd)); - } - cout << "pix cal data size: " << pcdmap.size() << endl; - - // - // load module->hashid lookup table - // - - map<string, unsigned int> lookup; - ifstream in_lookup("aliases.dat"); - if (!in_lookup.is_open()) return 1; - - string s; - while (getline(in_lookup, s)) { - if (s.find("HASHID") != string::npos) { - istringstream ss(s); - unsigned int idmod; - string s1, s2; - ss >> idmod >> s1 >> s2; - lookup.insert(make_pair(s2,idmod)); - } - } - cout << "lookup table size: " << lookup.size() << endl; - - map<string, unsigned int> lookup_errors; - - // - // connect to analysis data base - // - - try { - - // Start CORAL client - const char* tableName = "CALIB_ANAL"; - PixCoralClient coralClient(verbose, coral::ReadOnly, tableName); - - // Show the structure of the master table - if (verbose) { - coralClient.printTableDesc(tableName); - coralClient.printTableContent(tableName); - } - - // Return a CAN::AnalysisResultList_t object - CAN::AnalysisResultList_t a = coralClient.getAnalysisResultsFromDB(anal_id); - - if (option!=TOT) { - // - // threshold/timewalk calibration - // - - // load bool parameters - set<unsigned int> passed_idmod; - set<unsigned int> failed_idmod; - if (verbose) cout << "looking at bools" << endl; - for (map<string, map<string, bool> >::const_iterator iter = a.begin<bool>(); - iter != a.end<bool>(); ++iter) { - const string& s = iter->first; - if (verbose) cout << s << endl; - // figure out if we need it - if (s != "Status") continue; - for (map<string, bool>::const_iterator val_iter = iter->second.begin(); - val_iter != iter->second.end(); ++val_iter) { - const string& ss = val_iter->first; - bool value = val_iter->second; - // convert connectivity to module id - unsigned int idmod = lookup[ss]; - if (value) passed_idmod.insert(idmod); - else failed_idmod.insert(idmod); - } - } - cout << "good " << passed_idmod.size() << ", bad " << failed_idmod.size() << endl; - - // load float parameters - // verify if the scan is good - for (map<string, map<string, float> >::const_iterator iter = a.begin<float>(); - iter != a.end<float>(); ++iter) { - const string& s = iter->first; - if (s != "number of bad pixels") continue; - for (map<string, float>::const_iterator val_iter = iter->second.begin(); - val_iter != iter->second.end(); ++val_iter) { - const string& ss = val_iter->first; - // convert connectivity to module id - unsigned int idmod = lookup[ss]; - float value = val_iter->second; - const float maxBadPixels = 20000; - if (value>=maxBadPixels) { - if (verbose) cout << s << "-> " << ss << " (" << idmod << "): too many bad pixels = " << value << endl; - failed_idmod.insert(idmod); - } - } - } - // proceed with loading - set<unsigned int> used_idmod; - set<unsigned int> rejected_idmod; - if (verbose) cout << "looking at floats" << endl; - for (map<string, map<string, float> >::const_iterator iter = a.begin<float>(); - iter != a.end<float>(); ++iter) { - const string& s = iter->first; - if (verbose) cout << s << endl; - // figure out if we need it - const int nvar = 5; - string svar[nvar] = { - "average threshold", - "threshold RMS", - "average noise for normal pixel", - "average noise for long pixel", - "average noise for ganged pixel" - }; - if (option==TIMEWALK) svar[0] = "Average_threshold"; - int jvar = -1; - for (int ivar = 0; ivar<nvar; ++ivar) { - if (s == svar[ivar]) { - jvar = ivar; - break; - } - } - if (jvar<0) continue; - if (option==TIMEWALK && jvar>0) continue; - for (map<string, float>::const_iterator val_iter = iter->second.begin(); - val_iter != iter->second.end(); ++val_iter) { - const string& ss = val_iter->first; - // convert connectivity to module id - unsigned int idmod = lookup[ss]; - if (verbose) cout << s << "-> " << ss << " (" << idmod << ")"; - // check whether the scans are good - if (failed_idmod.find(idmod)!=failed_idmod.end()) { - rejected_idmod.insert(idmod); - if (verbose) cout << ": bad scan" << endl; - continue; - } - used_idmod.insert(idmod); - // find corresponding PixelCalibData - map<unsigned int, PixelCoralClientUtils::PixelCalibData>::iterator ipcd = pcdmap.find(idmod); - //if (ipcd == pcdmap.end()) throw std::runtime_error("Invalid module ID"); - if (ipcd == pcdmap.end()) { - lookup_errors.insert(make_pair(ss, idmod)); - if (verbose) cout << ": lookup error" << endl; - continue; - } - PixelCoralClientUtils::PixelCalibData& pcd = ipcd->second; - float value = val_iter->second; - // use the same value for all FE - for (int idchip = 0; idchip<16; ++idchip) { - PixelCoralClientUtils::PixelCalibData::PixelChipSummaryData& pcsd = *pcd.findChipID(idchip); - // replace the parameter in the table - int v[12]; - for (int type = 0; type<3; ++type) { - v[type*4 ] = pcsd.getThreshold(type); - v[type*4+1] = pcsd.getThresholdSigma(type); - v[type*4+2] = pcsd.getNoise(type); - v[type*4+3] = pcsd.getTimeWalk(type); - } - bool verbose1 = verbose && idchip==0; - if (verbose1) cout << svar[jvar] << "="; - if (option==THRESHOLDS) { - if (jvar==0) { // average threshold - if (verbose1) cout << v[0] << "," << v[4] << "," << v[8]; - v[0] = v[4] = v[8] = (int)value; - } else if (jvar==1) { // threshold RMS - if (verbose1) cout << v[1] << "," << v[5] << "," << v[9]; - v[1] = v[5] = v[9] = (int)value; - } else { // average noise - int type = jvar-2; - if (verbose1) cout << v[type*4+2]; - v[type*4+2] = (int)value; - } - } else { // timewalk, jvar is always 0 - if (verbose1) cout << v[3] << "," << v[7] << "," << v[11]; - v[3] = v[7] = v[11] = (int)value; - } - if (verbose1) cout << " replaced by " << value << endl; - for (int type = 0; type<3; ++type) { - pcsd.setThreshold(type, v[type*4], v[type*4+1], v[type*4+2], v[type*4+3]); - } - } - } - } - cout << "modified modules: " << used_idmod.size() << endl; - cout << "rejected modules: " << rejected_idmod.size() << endl; - - } else { - - // - // ToT calibration - // - - // load bool parameters - set<unsigned int> passed_n_id; - set<unsigned int> passed_g_id; - set<unsigned int> failed_n_id; - set<unsigned int> failed_g_id; - if (verbose) cout << "looking at bools" << endl; - for (map<string, map<string, bool> >::const_iterator iter = a.begin<bool>(); - iter != a.end<bool>(); ++iter) { - const string& s = iter->first; - if (verbose) cout << s << endl; - // figure out if we need it - if (s.compare(0, 6, "passed")) continue; - // determine chip id - int ix = s.find("FE") + 2; - int idchip = atoi(s.substr(ix).c_str()); - // determine pixel type - int itype = -1; - if (s.find("non_ganged_pix") != string::npos) itype = 0; - else if (s.find("ganged_pix") != string::npos) itype = 2; - if (itype<0) continue; - for (map<string, bool>::const_iterator val_iter = iter->second.begin(); - val_iter != iter->second.end(); ++val_iter) { - const string& ss = val_iter->first; - bool value = val_iter->second; - // convert connectivity to module id - unsigned int idmod = lookup[ss]; - unsigned int id = (idmod<<4) | idchip; - if (itype==0) { - if (value) passed_n_id.insert(id); - else failed_n_id.insert(id); - } - else if (itype==2) { - if (value) passed_g_id.insert(id); - else failed_g_id.insert(id); - } - } - } - cout << "non_ganged_pixels: good " << passed_n_id.size() << ", bad " << failed_n_id.size() << endl; - cout << "ganged_pixels: good " << passed_g_id.size() << ", bad " << failed_g_id.size() << endl; - - // load float parameters - set<unsigned int> used_id; - set<unsigned int> rejected_id; - if (verbose) cout << "looking at floats" << endl; - for (map<string, map<string, float> >::const_iterator iter = a.begin<float>(); - iter != a.end<float>(); ++iter) { - const string& s = iter->first; - if (verbose) cout << s << endl; - // figure out if we need it - const int nvar = 5; - const string svar[nvar] = { - "tot_p0_FE", "tot_p1_FE", "tot_p2_FE", - "disp_p0_FE", "disp_p1_FE" - }; - int jvar = -1; - for (int ivar = 0; ivar<nvar; ++ivar) { - if (s.compare(0, svar[ivar].length(), svar[ivar])==0) { - jvar = ivar; - break; - } - } - if (jvar<0) continue; - // determine chip id - int ix = s.find("FE") + 2; - int idchip = atoi(s.substr(ix).c_str()); - // determine pixel type - int itype = -1; - if (s.find("non_ganged_pix") != string::npos) itype = 0; - else if (s.find("ganged_pix") != string::npos) itype = 2; - // obsolete names, used for A5082 - //if (s.find("normal_pix") != string::npos) itype = 0; - //else if (s.find("special-non-ganged_pix") != string::npos) itype = 1; - //else if (s.find("ganged_pix") != string::npos) itype = 2; - if (itype<0) continue; - for (map<string, float>::const_iterator val_iter = iter->second.begin(); - val_iter != iter->second.end(); ++val_iter) { - const string& ss = val_iter->first; - // convert connectivity to module id - unsigned int idmod = lookup[ss]; - if (verbose) cout << s << "-> " << ss << ":" << idchip << " (" << idmod << ")"; - // check whether the scans are good - unsigned int id = (idmod<<4) | idchip; - if (failed_n_id.find(id)!=failed_n_id.end() || - failed_g_id.find(id)!=failed_g_id.end()) { - rejected_id.insert(id); - if (verbose) cout << ": bad scan" << endl; - continue; - } - used_id.insert(id); - // find corresponding PixelCalibData - map<unsigned int, PixelCoralClientUtils::PixelCalibData>::iterator ipcd = pcdmap.find(idmod); - //if (ipcd == pcdmap.end()) throw std::runtime_error("Invalid module ID"); - if (ipcd == pcdmap.end()) { - lookup_errors.insert(make_pair(ss, idmod)); - if (verbose) cout << ": lookup error" << endl; - continue; - } - PixelCoralClientUtils::PixelCalibData& pcd = ipcd->second; - PixelCoralClientUtils::PixelCalibData::PixelChipSummaryData& pcsd = *pcd.findChipID(idchip); - float value = val_iter->second; - // replace the parameter in the table - if (s.compare(0,5,"tot_p")==0) { - float v[3]; - v[0] = pcsd.getQ2TotA(itype); - v[1] = pcsd.getQ2TotE(itype); - v[2] = pcsd.getQ2TotC(itype); - int j = s[5]-'0'; if (j<0 || j>2) continue; - if (verbose) { - cout << ", "; - if (j==0) cout << "A"; else if (j==1) cout << "E"; else cout << "C"; - cout << "=" << v[j] << " replaced by " << value << endl; - } - v[j] = value; - pcsd.setQ2Tot(itype, v[0], v[1], v[2]); - } else if (s.compare(0,6,"disp_p")==0) { - float v[2]; - v[0] = pcsd.getTotP1(); - v[1] = pcsd.getTotP2(); - int j = s[6]-'0'; if (j<0 || j>1) continue; - if (verbose) { - cout << ", "; - cout << "p" << j+1 << "=" << v[j] << " replaced by " << value << endl; - } - v[j] = value; - pcsd.setTotRes(v[0], v[1]); - } else { - if (verbose) cout << endl; - } - } - } - cout << "modified chips: " << used_id.size() << endl; - cout << "rejected chips: " << rejected_id.size() << endl; - cout << "total modules: " << (used_id.size()+rejected_id.size())/16 << endl; - } - - if (!lookup_errors.empty()) { - cout << "module ids not found in the lookup table:" << endl; - for (map<string, unsigned int>::const_iterator il = lookup_errors.begin(); - il != lookup_errors.end(); ++il) { - cout << il->first << " " << il->second << endl; - } - } - - } catch ( exception& e ) { - cout << "exception caught: " << e.what() << endl; - return -1; - } - - catch (...) { - cout << "Unknown exception caught!" << endl; - return -1; - } - - // - // save pcd back to text file - // - - ofstream out("pcd.sav"); - for (map<unsigned int, PixelCoralClientUtils::PixelCalibData>::const_iterator ipcd = pcdmap.begin(); - ipcd != pcdmap.end(); ++ipcd) { - out << ipcd->first << endl; - const PixelCoralClientUtils::PixelCalibData& pcd = ipcd->second; - for (int i = 0; i<16; ++i) { - const PixelCoralClientUtils::PixelCalibData::PixelChipSummaryData& pcsd = *pcd.getPixelChipSummaryData(i); - out << "I" << pcsd.getChipID() - << " " << pcsd.getThreshold(0) - << " " << pcsd.getThresholdSigma(0) - << " " << pcsd.getNoise(0) - << " " << pcsd.getTimeWalk(0) - << " " << pcsd.getThreshold(1) - << " " << pcsd.getThresholdSigma(1) - << " " << pcsd.getNoise(1) - << " " << pcsd.getTimeWalk(1) - << " " << pcsd.getThreshold(2) - << " " << pcsd.getThresholdSigma(2) - << " " << pcsd.getNoise(2) - << " " << pcsd.getTimeWalk(2) - << " " << pcsd.getQ2TotA(0) - << " " << pcsd.getQ2TotE(0) - << " " << pcsd.getQ2TotC(0) - << " " << pcsd.getQ2TotA(2) - << " " << pcsd.getQ2TotE(2) - << " " << pcsd.getQ2TotC(2) - << " " << pcsd.getTotP1() - << " " << pcsd.getTotP2() << endl; - } - } - out.close(); - - return 0; - -} diff --git a/InnerDetector/InDetConditions/PixelCoralClientUtils/src/extractSPM.cc b/InnerDetector/InDetConditions/PixelCoralClientUtils/src/extractSPM.cc deleted file mode 100644 index 7cae1b18478446a5c568486de0e73ee464f462a6..0000000000000000000000000000000000000000 --- a/InnerDetector/InDetConditions/PixelCoralClientUtils/src/extractSPM.cc +++ /dev/null @@ -1,87 +0,0 @@ -/* - Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration -*/ - -#include "CxxUtils/checker_macros.h" -#include "PixelCoralClientUtils/CoralClient.hh" -#include "PixelCoralClientUtils/SpecialPixelMap.hh" - -#include<string> -#include<cstring> -#include<map> -#include<set> -#include<fstream> -using namespace std; - -int main (int argc, char **argv){ - - int iarg = 1; - bool verbose = false; - if (argc>iarg && strcmp(argv[iarg],"-v")==0) { - verbose = true; - ++iarg; - } - - if (iarg>=argc) { - cout << "Usage: extractSPM [-v] anal_id" << endl; - return 1; - } - - CAN::SerialNumber_t anal_id = atoi(argv[iarg]); - - cout << "--> Summary for anal_id " << anal_id << endl; - - // - // connect to analysis data base - // - - try { - - // Start CORAL client - const char* tableName = "CALIB_ANAL"; - PixCoralClient coralClient(verbose, coral::ReadOnly, tableName); - - // Show the structure of the master table - if (verbose) { - coralClient.printTableDesc(tableName); - coralClient.printTableContent(tableName); - } - - // Return a CAN::AnalysisResultList_t object - CAN::AnalysisResultList_t a = coralClient.getAnalysisResultsFromDB(anal_id); - - // load pixel maps - int npm = 0; - for (map<string, map<string, PixelMap_t> >::const_iterator iter = a.begin<PixelMap_t>(); - iter != a.end<PixelMap_t>(); ++iter) { - ++npm; - const string& s = iter->first; - if (verbose) cout << s << endl; - for (map<string, PixelMap_t>::const_iterator val_iter = iter->second.begin(); - val_iter != iter->second.end(); ++val_iter) { - const string& ss = val_iter->first; - PixelMap_t value = val_iter->second; - if (verbose) { - cout << ss << endl; - for (PixelMap_t::const_iterator pm = value.begin(); - pm != value.end(); ++pm) { - cout << "col=" << pm->first.first << ", row=" << pm->first.second << ", status=" << pm->second << endl; - } - } - } - } - cout << "found pixel maps: " << npm << endl; - - } catch ( exception& e ) { - cout << "exception caught: " << e.what() << endl; - return -1; - } - - catch (...) { - cout << "Unknown exception caught!" << endl; - return -1; - } - - return 0; - -} diff --git a/InnerDetector/InDetConditions/PixelCoralClientUtils/src/fixTimewalk.cc b/InnerDetector/InDetConditions/PixelCoralClientUtils/src/fixTimewalk.cc deleted file mode 100644 index e7cc99d363d39b3ee9a4baf7e34b0e52e57d748d..0000000000000000000000000000000000000000 --- a/InnerDetector/InDetConditions/PixelCoralClientUtils/src/fixTimewalk.cc +++ /dev/null @@ -1,132 +0,0 @@ -/* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration -*/ - -#include "PixelCoralClientUtils/PixelCalibData.hh" - -#include<string> -#include<map> -#include<fstream> -using namespace std; - -int load_pcd(map<unsigned int, PixelCoralClientUtils::PixelCalibData>& pcdmap, - const char* filename) -{ - ifstream in(filename); - if (!in.is_open()) return 1; - - while (in) { - unsigned int idmod; in >> idmod; - if (in.eof()) break; - - PixelCoralClientUtils::PixelCalibData pcd; - - for (int i = 0; i<16; ++i) { - char dummy; in >> dummy; - if (dummy!='I') break; - int idchip; in >> idchip; - if (idchip!=i) break; - PixelCoralClientUtils::PixelCalibData::PixelChipSummaryData pcsd; - pcsd.setChipID(idchip); - int thres, sigma, noise, timewalk; - in >> thres >> sigma >> noise >> timewalk; - pcsd.setThreshold(0, thres, sigma, noise, timewalk); - in >> thres >> sigma >> noise >> timewalk; - pcsd.setThreshold(1, thres, sigma, noise, timewalk); - in >> thres >> sigma >> noise >> timewalk; - pcsd.setThreshold(2, thres, sigma, noise, timewalk); - float A, E, C; - in >> A >> E >> C; - pcsd.setQ2Tot(0, A, E, C); - in >> A >> E >> C; - pcsd.setQ2Tot(2, A, E, C); - float p1, p2; - in >> p1 >> p2; - pcsd.setTotRes(p1, p2); - pcd.add(pcsd); - } - - pcdmap.insert(make_pair(idmod,pcd)); - } - - return 0; -} - -//int main(int argc, char **argv){ -int main(int, char **){ - - // - // load pcd from text file - // - - map<unsigned int, PixelCoralClientUtils::PixelCalibData> pcdmap_old; - if (load_pcd(pcdmap_old, "pcd_old.dat")) return 1; - map<unsigned int, PixelCoralClientUtils::PixelCalibData> pcdmap; - if (load_pcd(pcdmap, "pcd.dat")) return 1; - - cout << "pix cal data size: " << pcdmap_old.size() << "/" << pcdmap.size() << endl; - - // - // recalculate timewalk according to the formula - // new_timewalk = old_timewalk - old_threshold + new_threshold - // - - for (map<unsigned int, PixelCoralClientUtils::PixelCalibData>::iterator ipcd = pcdmap.begin(); - ipcd != pcdmap.end(); ++ipcd) { - PixelCoralClientUtils::PixelCalibData& pcd = ipcd->second; - PixelCoralClientUtils::PixelCalibData& pcd_old = pcdmap_old[ipcd->first]; - for (int i = 0; i<16; ++i) { - PixelCoralClientUtils::PixelCalibData::PixelChipSummaryData& pcsd = *pcd.findChipID(i); - PixelCoralClientUtils::PixelCalibData::PixelChipSummaryData& pcsd_old = *pcd_old.findChipID(i); - // replace the parameter in the table - for (int type = 0; type<3; ++type) { - int old_threshold = pcsd_old.getThreshold(type); - int new_threshold = pcsd.getThreshold(type); - int sigma = pcsd.getThresholdSigma(type); - int noise = pcsd.getNoise(type); - int old_timewalk = pcsd_old.getTimeWalk(type); - int new_timewalk = old_timewalk - old_threshold + new_threshold; - pcsd.setThreshold(type, new_threshold, sigma, noise, new_timewalk); - } - } - } - - // - // save pcd back to text file - // - - ofstream out("pcd.sav"); - for (map<unsigned int, PixelCoralClientUtils::PixelCalibData>::const_iterator ipcd = pcdmap.begin(); - ipcd != pcdmap.end(); ++ipcd) { - out << ipcd->first << endl; - const PixelCoralClientUtils::PixelCalibData& pcd = ipcd->second; - for (int i = 0; i<16; ++i) { - const PixelCoralClientUtils::PixelCalibData::PixelChipSummaryData& pcsd = *pcd.getPixelChipSummaryData(i); - out << "I" << pcsd.getChipID() - << " " << pcsd.getThreshold(0) - << " " << pcsd.getThresholdSigma(0) - << " " << pcsd.getNoise(0) - << " " << pcsd.getTimeWalk(0) - << " " << pcsd.getThreshold(1) - << " " << pcsd.getThresholdSigma(1) - << " " << pcsd.getNoise(1) - << " " << pcsd.getTimeWalk(1) - << " " << pcsd.getThreshold(2) - << " " << pcsd.getThresholdSigma(2) - << " " << pcsd.getNoise(2) - << " " << pcsd.getTimeWalk(2) - << " " << pcsd.getQ2TotA(0) - << " " << pcsd.getQ2TotE(0) - << " " << pcsd.getQ2TotC(0) - << " " << pcsd.getQ2TotA(2) - << " " << pcsd.getQ2TotE(2) - << " " << pcsd.getQ2TotC(2) - << " " << pcsd.getTotP1() - << " " << pcsd.getTotP2() << endl; - } - } - out.close(); - - return 0; - -} diff --git a/InnerDetector/InDetConditions/PixelCoralClientUtils/src/talkToPCDDb.cc b/InnerDetector/InDetConditions/PixelCoralClientUtils/src/talkToPCDDb.cc deleted file mode 100644 index b2b75fe350fa1bec86e3bdea01943067a3923cf7..0000000000000000000000000000000000000000 --- a/InnerDetector/InDetConditions/PixelCoralClientUtils/src/talkToPCDDb.cc +++ /dev/null @@ -1,68 +0,0 @@ -/* - Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration -*/ - -#include "CxxUtils/checker_macros.h" -#include "PixelCoralClientUtils/PCDio.h" -////#include "PixelCoralClientUtils/PixelCalibData.hh" - -#include<iostream> -#include<string> -#include<cstdlib> - -using namespace std; - -int main (int argc, char **argv) -{ - if (argc<3 || argv[1][0]!='-') { - cout << argv[0] << ": tool to talk to pixel coral database." << endl; - cout << "options:" << endl; - cout << "\t-r tag [revision]" << endl; - cout << "\t\tread existing table from the database to pcd.sav" << endl; - cout << "\t-s tag revision sources" << endl; - cout << "\t\tsave pcd.dat to the database" << endl; - return 1; - } - - string tableName("CALIB_DATA"); - - string connString(""); - char* ctmp = getenv("CAN_CALIB_DB"); - if (ctmp) connString = ctmp; - - int c = argv[1][1]; - switch (c) { - case 'r': - { - string tag(argv[2]); - int revision = 0; - if (argc>=4) revision = atoi(argv[3]); - cout << "loading pcd from " << tableName << " at " << connString << endl; - cout << "tag \"" << tag << "\", revision " << revision << endl; - - PCDio io(connString, tableName, 1); - io.init(coral::ReadOnly); - io.load(tag, revision); - } - break; - - case 's': - { - string tag(argv[2]); - int revision(atoi(argv[3])); - string sources(argv[4]); - cout << "saving pcd to " << tableName << " at " << connString << endl; - cout << "tag \"" << tag << "\", revision " << revision << endl; - - PCDio io(connString, tableName, 1); - io.init(coral::Update); - io.save(tag, revision, sources); - } - break; - - default: - cout << "unknown option " << argv[1] << endl; - } - - return 0; -} diff --git a/InnerDetector/InDetConditions/PixelCoralClientUtils/src/talkToPCDkr.cc b/InnerDetector/InDetConditions/PixelCoralClientUtils/src/talkToPCDkr.cc deleted file mode 100644 index 8e890d09b7faf62186cb526582653d7d715f5198..0000000000000000000000000000000000000000 --- a/InnerDetector/InDetConditions/PixelCoralClientUtils/src/talkToPCDkr.cc +++ /dev/null @@ -1,84 +0,0 @@ -/* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration -*/ - -#include "PixelCoralClientUtils/PCDkr.h" -////#include "PixelCoralClientUtils/PixelCalibData.hh" - -#include<iostream> -#include<string> -#include<cstdlib> - -using namespace std; - -int main(int argc, char **argv) -{ - if (argc<2 || argv[1][0]!='-') { - cout << argv[0] << ": tool to talk to knowledge repository." << endl; - cout << "options:" << endl; - cout << "\t-s tr cid" << endl; - cout << "\t\tcreate a new record with configuration tag/revision tr\n\t\tand calibration identifier cid" << endl; - cout << "\t-v tr" << endl; - cout << "\t\tvalidate configuration tag/revision tr" << endl; - cout << "\t-r" << endl; - cout << "\t\tdump the table" << endl; - return 1; - } - - string tableName("CALIB_KR"); - - string connString(""); - char* ctmp = getenv("CAN_CALIB_DB"); - if (ctmp) connString = ctmp; - - int c = argv[1][1]; - switch (c) { - case 'r': - { - cout << "dumping table " << tableName << " at " << connString << endl; - - PCDkr io(connString, tableName, 1); - io.init(coral::ReadOnly); - io.load(); - } - break; - - case 's': - { - if (argc<3) { - cout << "usage: " << argv[0] << " -s tag cid" << endl; - return 1; - } - string tag(argv[2]); - string cid(argv[3]); - cout << "saving configuration to " << tableName << " at " << connString << endl; - cout << "configuration \"" << tag << "\", cid \"" << cid << "\"" << endl; - - PCDkr io(connString, tableName, 1); - io.init(coral::Update); - io.save(tag, cid); - } - break; - - case 'v': - { - if (argc<2) { - cout << "usage: " << argv[0] << " -v tag" << endl; - return 1; - } - string tag(argv[2]); - cout << "validating configuration in " << tableName << " at " << connString << endl; - cout << "configuration \"" << tag << "\"" << endl; - - PCDkr io(connString, tableName, 1); - io.init(coral::Update); - io.validate(tag); - } - break; - - default: - cout << "unknown option " << argv[1] << endl; - } - - return 0; -} diff --git a/InnerDetector/InDetConditions/PixelCoralClientUtils/test/calibDbInterface_example.sh b/InnerDetector/InDetConditions/PixelCoralClientUtils/test/calibDbInterface_example.sh deleted file mode 100755 index 72ab135f25b273b8eddba30182096671fdcd020d..0000000000000000000000000000000000000000 --- a/InnerDetector/InDetConditions/PixelCoralClientUtils/test/calibDbInterface_example.sh +++ /dev/null @@ -1,17 +0,0 @@ -############################################################################### -#!/bin/sh -############################################################################### - -export PATH=$PATH:$PWD/../i686-slc5-gcc43-opt/calibDbInterface.exe - -export PIXEL_CAL_KNOWLEDGE="oracle://INTR/ATLAS_MLIMPER" -#export PIXEL_CAL_KNOWLEDGE="oracle://DEVDB10/ATLAS_COOL_MLIMPER" -#export PIXEL_CAL_KNOWLEDGE="sqlite_file:pcd_knowledge.db" - -#store the latest updated calibration strings (final argument) along with RunNumber (arg1) idTag (arg2) connTag (arg3) cfgTag (arg4) cfgModTag (arg5) -calibDbInterface.exe -s 183905 IDTAG1 CONNTAG1 CFGTAG1 CFGMODTAG1 PixCalib-BLKP-UPD4-000-01 CalibString2 CalibString3 - -#associate calibtag with specific run interval and tag=bla (cool is multi-tag) -#this step should be done by PixRCDCoolAgent, just here for demonstration... -# does not work anymore! -#calibDbInterface -c dummycalib_0 2 3 bla diff --git a/InnerDetector/InDetConditions/SCT_ConditionsTools/src/SCT_ByteStreamErrorsTool.cxx b/InnerDetector/InDetConditions/SCT_ConditionsTools/src/SCT_ByteStreamErrorsTool.cxx index c38560ea296e3dd181b4b524658f18c88272d218..8bdca590b7b8a9c8612b7aef1e87c5955217d284 100644 --- a/InnerDetector/InDetConditions/SCT_ConditionsTools/src/SCT_ByteStreamErrorsTool.cxx +++ b/InnerDetector/InDetConditions/SCT_ConditionsTools/src/SCT_ByteStreamErrorsTool.cxx @@ -388,7 +388,7 @@ unsigned int SCT_ByteStreamErrorsTool::abcdErrorChips(const Identifier& moduleId } std::pair<StatusCode, unsigned int> SCT_ByteStreamErrorsTool::getErrorCodeWithCacheUpdate(const Identifier& moduleId, const EventContext& ctx, - std::map<Identifier, unsigned int>& whereExected) const { + std::unordered_map<Identifier, unsigned int>& whereExected) const { ATH_MSG_VERBOSE("SCT_ByteStreamErrorsTool getErrorCodeWithCacheUpdate " << moduleId); auto it{whereExected.find(moduleId)}; if (it != whereExected.end()) return std::make_pair(StatusCode::SUCCESS, it->second); diff --git a/InnerDetector/InDetConditions/SCT_ConditionsTools/src/SCT_ByteStreamErrorsTool.h b/InnerDetector/InDetConditions/SCT_ConditionsTools/src/SCT_ByteStreamErrorsTool.h index 599e245289e6c98e277839ac89ac080061fa345e..e5c3d21e235bec1bc9eb8f521ba76ae2b50133e2 100644 --- a/InnerDetector/InDetConditions/SCT_ConditionsTools/src/SCT_ByteStreamErrorsTool.h +++ b/InnerDetector/InDetConditions/SCT_ConditionsTools/src/SCT_ByteStreamErrorsTool.h @@ -36,7 +36,7 @@ #include <array> #include <atomic> #include <functional> -#include <map> +#include <unordered_map> #include <mutex> #include <vector> @@ -110,8 +110,8 @@ private: // 0 as the value denotes no error // error encoding is as follows: pattern for a module has length of 6 bits, side 0 is encoded in bits 0-5, side 1 in bits 6-11 // so bit 0 is for chip 0 on side 0, bit 1 is for chip 1 on side 0, ..., and bit 11 is for chip 5 on side 1 - std::map<Identifier, unsigned int> tempMaskedChips; - std::map<Identifier, unsigned int> abcdErrorChips; + std::unordered_map<Identifier, unsigned int> tempMaskedChips; + std::unordered_map<Identifier, unsigned int> abcdErrorChips; void reset(EventContext::ContextEvt_t evtId, const IDCInDetBSErrContainer_Cache* cache) { eventId = evtId; @@ -155,7 +155,7 @@ private: * Method that returns BS Error code from the map passed @rag where-Expected * If the information is initially missing, the cache update is triggered **/ - std::pair<StatusCode, unsigned int> getErrorCodeWithCacheUpdate(const Identifier& id, const EventContext& ctx, std::map<Identifier, unsigned int>& whereExected) const; + std::pair<StatusCode, unsigned int> getErrorCodeWithCacheUpdate(const Identifier& id, const EventContext& ctx, std::unordered_map<Identifier, unsigned int>& whereExected) const; }; diff --git a/InnerDetector/InDetConditions/SiPropertiesTool/doc/packagedoc.h b/InnerDetector/InDetConditions/SiPropertiesTool/doc/packagedoc.h index f7d7578fe658e71c3bb5d6ffec6601c5feda1e49..4b67e96a3505c95c9592f0b6247dcf7f6b5028aa 100644 --- a/InnerDetector/InDetConditions/SiPropertiesTool/doc/packagedoc.h +++ b/InnerDetector/InDetConditions/SiPropertiesTool/doc/packagedoc.h @@ -1,22 +1,38 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ /** @page SiPropertiesTool_page SiPropertiesTool Package -@authors Grant Gorfine +@authors Grant Gorfine, Susumu.Oda@cern.ch @section SiPropertiesTool_SiPropertiesToolIntro Introduction -Service for providing silicon properties for each detector element. +Tool for providing silicon properties for each detector element. The properties are available via the SiliconProperties class from which one can obtain hall and drift mobility, diffusion constant and number of electron hole pairs per deposited energy. Some of these are dependent on temperature and voltages which are obtained via the -appropriate service and updated via a call back. +appropriate tool and updated via a condition algorithm. +@section SiPropertiesTool_SiPropertiesToolOverview Class Overview +- ISiPropertiesTool: Interface for SiPropertiesTool +- SiPropertiesTool: The main tool for both Pixel and SCT +- InDet::SiliconProperties: Data object to hold various silicon properties +- InDet::SiliconPropertiesVector: Vector of SiliconProperties for condition algorithms and SiPropertiesTool +- PixelSiPropertiesCondAlg: Condition algorithm for Pixel +- SCTSiPropertiesCondAlg: Condition algorithm for SCT +- SCTSiPropertiesTestAlg: Test algorithm for SiPropertiesTool for SCT + +@section SiPropertiesTool_SiPropertiesToolConfigurationTest Configuration and test scripts + +- PixelSiPropertiesConfig.py: Configuration script for Pixel for the new job configuration +- PixelSiPropertiesToolSetup.py: Configuration script for Pixel for the old job configuration +- SCT_SiPropertiesConfig.py: Configuration script for SCT for the new job configuration +- SCT_SiPropertiesToolSetup.py: Configuration script for SCT for the old job configuration +- testSCTProperties.py: Test script to run SCTSiPropertiesTestAlg */ diff --git a/InnerDetector/InDetConditions/TRT_ConditionsServices/src/TRT_StrawStatusSummaryTool.cxx b/InnerDetector/InDetConditions/TRT_ConditionsServices/src/TRT_StrawStatusSummaryTool.cxx index 2827547aac9c5ba4a85f8c497dfd0d9c0b6afd5f..db1c38e4a379a21a2a69f68d519dd3c7d8141081 100644 --- a/InnerDetector/InDetConditions/TRT_ConditionsServices/src/TRT_StrawStatusSummaryTool.cxx +++ b/InnerDetector/InDetConditions/TRT_ConditionsServices/src/TRT_StrawStatusSummaryTool.cxx @@ -19,7 +19,7 @@ TRT_StrawStatusSummaryTool::TRT_StrawStatusSummaryTool( const std::string& type, StatusCode TRT_StrawStatusSummaryTool::initialize() { - ATH_MSG_INFO("TRT_StrawStatusSummaryTool initialize method called"); + ATH_MSG_DEBUG("TRT_StrawStatusSummaryTool initialize method called"); // Get the TRT ID helper if (StatusCode::SUCCESS!=detStore()->retrieve(m_trtId,"TRT_ID")) { @@ -42,7 +42,7 @@ StatusCode TRT_StrawStatusSummaryTool::initialize() } } - ATH_MSG_INFO("TRT_StrawStatusSummaryTool initialized successfully "); + ATH_MSG_DEBUG("TRT_StrawStatusSummaryTool initialized successfully "); return StatusCode::SUCCESS; } @@ -51,7 +51,6 @@ StatusCode TRT_StrawStatusSummaryTool::initialize() StatusCode TRT_StrawStatusSummaryTool::finalize() { - ATH_MSG_INFO(" in finalize() "); return StatusCode::SUCCESS; } diff --git a/InnerDetector/InDetConfig/python/TRTPhaseConfig.py b/InnerDetector/InDetConfig/python/TRTPhaseConfig.py new file mode 100644 index 0000000000000000000000000000000000000000..5ad1858931d1417d666c30667647e95a37716e57 --- /dev/null +++ b/InnerDetector/InDetConfig/python/TRTPhaseConfig.py @@ -0,0 +1,176 @@ +# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration +from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator +from AthenaConfiguration.ComponentFactory import CompFactory + +def InDetTrackSummaryToolCfg(flags, name='InDetTrackSummaryTool',**kwargs) : + acc = ComponentAccumulator() + + ISF_TrackSummaryHelperTool = CompFactory.iFatras.ISF_TrackSummaryHelperTool(name = "ISF_TrackSummaryHelperTool", + AssoTool = "", + DoSharedHits = True) + + kwargs.setdefault("doSharedHits", True) + kwargs.setdefault("InDetSummaryHelperTool", ISF_TrackSummaryHelperTool) + kwargs.setdefault("AddDetailedInDetSummary", False) + kwargs.setdefault("doHolesInDet", False) + kwargs.setdefault("doHolesMuon", False) + kwargs.setdefault("MuonSummaryHelperTool", "") + kwargs.setdefault("AddDetailedMuonSummary", False) + kwargs.setdefault("TRT_ElectronPidTool", "") + kwargs.setdefault("PixelToTPIDTool", "") + kwargs.setdefault("PixelExists", True) + + acc.setPrivateTools(CompFactory.Trk.TrackSummaryTool(name = name, **kwargs)) + return acc + +def InDetCosmicsEventPhaseToolCfg(flags, name='InDetCosmicsEventPhaseTool', **kwargs) : + # + # --- load tool + # + acc = ComponentAccumulator() + if( not flags.Input.isMC ): + if flags.Beam.Type =='cosmics': + kwargs.setdefault("GlobalOffset", 8) + else: + kwargs.setdefault("GlobalOffset", 0) + else: + kwargs.setdefault("GlobalOffset", -3.125) + # CalDb tool + InDetTRTCalDbTool = CompFactory.TRT_CalDbTool(name = "TRT_CalDbTool") + kwargs.setdefault("UseNewEP", True) + kwargs.setdefault("TRTCalDbTool", InDetTRTCalDbTool) + + acc.setPrivateTools(CompFactory.InDet.InDetCosmicsEventPhaseTool(name = name, **kwargs)) + return acc + +def InDetFixedWindowTrackTimeToolCfg(flags, name='InDetFixedWindowTrackTimeTool', **kwargs) : + # + # --- load tool + # + acc = ComponentAccumulator() + if( not flags.Input.isMC ): + if flags.Beam.Type =='cosmics': + kwargs.setdefault("GlobalOffset", 8) + else: + kwargs.setdefault("GlobalOffset", 0) + else: + kwargs.setdefault("GlobalOffset", -3.125) + # CalDb tool + InDetTRTCalDbTool = CompFactory.TRT_CalDbTool(name = "TRT_CalDbTool") + cutWindowCenter = -8.5 + cutWindowSize = 7 + kwargs.setdefault("UseNewEP" , True) + kwargs.setdefault("WindowCenter" , cutWindowCenter) + kwargs.setdefault("WindowSize" , cutWindowSize) + kwargs.setdefault("TRTCalDbTool" , InDetTRTCalDbTool) + + + acc.setPrivateTools(CompFactory.InDet.InDetFixedWindowTrackTimeTool(name = name, **kwargs)) + return acc + +def InDetSlidingWindowTrackTimeToolCfg(flags, name='InDetSlidingWindowTrackTimeTool', **kwargs) : + # + # --- load tool + # + acc = ComponentAccumulator() + if( not flags.Input.isMC ): + if flags.Beam.Type =='cosmics': + kwargs.setdefault("GlobalOffset", 8) + else: + kwargs.setdefault("GlobalOffset", 0) + else: + kwargs.setdefault("GlobalOffset", -3.125) + # CalDb tool + InDetTRTCalDbTool = CompFactory.TRT_CalDbTool(name = "TRT_CalDbTool") + numberIterations = 5 + cutWindowSize = 7 + kwargs.setdefault("UseNewEP" , True) + kwargs.setdefault("NumberIterations" , numberIterations) + kwargs.setdefault("WindowSize" , cutWindowSize) + kwargs.setdefault("TRTCalDbTool" , InDetTRTCalDbTool) + + acc.setPrivateTools(CompFactory.InDet.InDetSlidingWindowTrackTimeTool(name = name, **kwargs)) + return acc + +def InDetCosmicsEventPhaseCfg(flags, InputTrackCollections, name = 'InDetCosmicsEventPhase', **kwargs): + # + # --- load algorithm + # + acc = ComponentAccumulator() + + InDetCosmicsEventPhaseTool = acc.popToolsAndMerge(InDetCosmicsEventPhaseToolCfg(flags)) + acc.addPublicTool(InDetCosmicsEventPhaseTool) + + InDetSlidingWindowTrackTimeTool = acc.popToolsAndMerge(InDetSlidingWindowTrackTimeToolCfg(flags)) + acc.addPublicTool(InDetSlidingWindowTrackTimeTool) + + InDetFixedWindowTrackTimeTool = acc.popToolsAndMerge(InDetFixedWindowTrackTimeToolCfg(flags)) + acc.addPublicTool(InDetFixedWindowTrackTimeTool ) + + InDetTrackSummaryTool = acc.popToolsAndMerge(InDetTrackSummaryToolCfg(flags)) + acc.addPublicTool(InDetTrackSummaryTool) + + # CalDb tool + InDetTRTCalDbTool = CompFactory.TRT_CalDbTool(name = "TRT_CalDbTool") + kwargs.setdefault("InputTracksNames" , InputTrackCollections) + kwargs.setdefault("TrackSummaryTool" , InDetTrackSummaryTool) + kwargs.setdefault("TRTCalDbTool" , InDetTRTCalDbTool) + kwargs.setdefault("EventPhaseTool" , InDetSlidingWindowTrackTimeTool) + #kwargs.setdefault("EventPhaseTool" , InDetFixedWindowTrackTimeTool) + + if flags.Beam.Type =='cosmics': + kwargs.setdefault("EventPhaseTool" , InDetCosmicsEventPhaseTool) + + acc.addEventAlgo(CompFactory.InDet.InDetCosmicsEventPhase(name = name, **kwargs)) + return acc + +# -------------------------------------------------------------------------------- +# +# --- TRT phase calculation +# +# -------------------------------------------------------------------------------- +def TRTPhaseCfg(flags, self, InputTrackCollections = [], **kwargs): + acc = ComponentAccumulator() + if flags.InDet.doPRDFormation and flags.Detector.RecoTRT: + # + # --- calculation of the event phase from all 3 input collections + # + acc.merge(InDetCosmicsEventPhaseCfg(flags, InputTrackCollections, **kwargs)) + return acc + +if __name__ == "__main__": + from AthenaCommon.Configurable import Configurable + Configurable.configurableRun3Behavior=1 + + from AthenaConfiguration.AllConfigFlags import ConfigFlags + + numThreads=1 + ConfigFlags.Concurrency.NumThreads=numThreads + ConfigFlags.Concurrency.NumConcurrentEvents=numThreads # Might change this later, but good enough for the moment. + + ConfigFlags.Detector.RecoTRT = True + + from AthenaConfiguration.TestDefaults import defaultTestFiles + ConfigFlags.Input.Files = defaultTestFiles.RDO + ConfigFlags.lock() + ConfigFlags.dump() + + from AthenaConfiguration.MainServicesConfig import MainServicesCfg + top_acc = MainServicesCfg(ConfigFlags) + + msgService = top_acc.getService('MessageSvc') + msgService.Format = "S:%s E:%e % F%138W%S%7W%R%T %0W%M" + + from AthenaPoolCnvSvc.PoolReadConfig import PoolReadCfg + top_acc.merge(PoolReadCfg(ConfigFlags)) + + from TRT_GeoModel.TRT_GeoModelConfig import TRT_GeometryCfg + top_acc.merge(TRT_GeometryCfg( ConfigFlags )) + + top_acc.merge(TRTPhaseCfg(ConfigFlags, ['TRTTracks_Phase', 'ExtendedTracksPhase'])) ## read from InDetKeys.TRT_Tracks_Phase, InDetKeys.ExtendedTracksPhase + + iovsvc = top_acc.getService('IOVDbSvc') + iovsvc.OutputLevel=5 + top_acc.printConfig() + top_acc.run(25) + top_acc.store(open("test_TRTPhaseConfig.pkl", "wb")) ##comment out to store top_acc into pkl file \ No newline at end of file diff --git a/InnerDetector/InDetConfig/python/TRTPreProcessing.py b/InnerDetector/InDetConfig/python/TRTPreProcessing.py new file mode 100644 index 0000000000000000000000000000000000000000..d5546a36f0849d3a5ad81de48a274586e96af51e --- /dev/null +++ b/InnerDetector/InDetConfig/python/TRTPreProcessing.py @@ -0,0 +1,315 @@ +# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration +# ------------------------------------------------------------ +# +# ----------- TRT Data-Preparation stage +# +# ------------------------------------------------------------ +from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator +from AthenaConfiguration.ComponentFactory import CompFactory + +def InDetPRD_MultiTruthMakerTRTCfg(flags, name = "InDetTRT_PRD_MultiTruthMaker", **kwargs): + acc = ComponentAccumulator() + + kwargs.setdefault("PixelClusterContainerName", "") + kwargs.setdefault("SCTClusterContainerName", "") + kwargs.setdefault("TRTDriftCircleContainerName", 'TRT_DriftCircles') ##read from InDetKeys.TRT_DriftCircles + kwargs.setdefault("SimDataMapNamePixel", "") + kwargs.setdefault("SimDataMapNameSCT", "") + kwargs.setdefault("SimDataMapNameTRT", 'TRT_SDO_Map') ##read from InDetKeys.TRT_SDOs + kwargs.setdefault("TruthNamePixel", "") + kwargs.setdefault("TruthNameSCT", "") + kwargs.setdefault("TruthNameTRT", 'PRD_MultiTruthTRT') ##read from InDetKeys.TRT_DriftCirclesTruth + + acc.addEventAlgo(CompFactory.InDet.PRD_MultiTruthMaker(name, **kwargs)) + return acc + +def InDetPRD_MultiTruthMakerTRTPUCfg(flags, name = "InDetTRT_PRD_MultiTruthMakerPU", **kwargs): + acc = ComponentAccumulator() + + kwargs.setdefault("PixelClusterContainerName", "") + kwargs.setdefault("SCTClusterContainerName", "") + kwargs.setdefault("TRTDriftCircleContainerName", 'TRT_PU_DriftCircles') ##read from InDetKeys.TRT_PU_DriftCircles + kwargs.setdefault("SimDataMapNamePixel", "") + kwargs.setdefault("SimDataMapNameSCT", "") + kwargs.setdefault("SimDataMapNameTRT", 'TRT_PU_SDO_Map') ##read from InDetKeys.TRT_PU_SDOs + kwargs.setdefault("TruthNamePixel", "") + kwargs.setdefault("TruthNameSCT", "") + kwargs.setdefault("TruthNameTRT", 'PRD_PU_MultiTruthTRT') ##read from InDetKeys.TRT_PU_DriftCirclesTruth + + acc.addEventAlgo(CompFactory.InDet.PRD_MultiTruthMaker(name, **kwargs)) + return acc + +def InDetTRT_DriftFunctionToolCfg(flags, useTimeInfo, usePhase, name = "InDetTRT_DriftFunctionTool", **kwargs): + acc = ComponentAccumulator() + # + # --- TRT_DriftFunctionTool + # + # Calibration DB Service + from InDetOverlay.TRT_ConditionsConfig import TRT_CalDbToolCfg + InDetTRTCalDbTool = acc.popToolsAndMerge(TRT_CalDbToolCfg(flags)) + acc.addPublicTool(InDetTRTCalDbTool) + + # --- overwrite for uncalibrated DC production + if (not useTimeInfo) or flags.InDet.noTRTTiming: + kwargs.setdefault("DummyMode", True) + kwargs.setdefault("UniversalError", 1.15) + + # --- set Data/MC flag + if( flags.Input.isMC ) : + kwargs.setdefault("IsMC", True) + else : + kwargs.setdefault("IsMC", False) + + # --- overwrite for calibration of MC + if usePhase and flags.Beam.Type =='cosmics' and flags.Input.isMC: + kwargs.setdefault("AllowDigiVersionOverride", True) + kwargs.setdefault("ForcedDigiVersion", 9) + + kwargs.setdefault("TRTCalDbTool", InDetTRTCalDbTool) + # --- set HT corrections + kwargs.setdefault("HTCorrectionBarrelXe", 1.5205) + kwargs.setdefault("HTCorrectionEndcapXe", 1.2712) + kwargs.setdefault("HTCorrectionBarrelAr", 1.5205) + kwargs.setdefault("HTCorrectionEndcapAr", 1.2712) + # --- set ToT corrections + kwargs.setdefault("ToTCorrectionsBarrelXe" , [0., 4.358121, 3.032195, 1.631892, 0.7408397, -0.004113, -0.613288, -0.73758, -0.623346, -0.561229, + -0.29828, -0.21344, -0.322892, -0.386718, -0.534751, -0.874178, -1.231799, -1.503689, -1.896464, -2.385958]) + kwargs.setdefault("ToTCorrectionsEndcapXe" , [0., 5.514777, 3.342712, 2.056626, 1.08293693, 0.3907979, -0.082819, -0.457485, -0.599706, -0.427493, + -0.328962, -0.403399, -0.663656, -1.029428, -1.46008, -1.919092, -2.151582, -2.285481, -2.036822, -2.15805]) + kwargs.setdefault("ToTCorrectionsBarrelAr" , [0., 4.358121, 3.032195, 1.631892, 0.7408397, -0.004113, -0.613288, -0.73758, -0.623346, -0.561229, + -0.29828, -0.21344, -0.322892, -0.386718, -0.534751, -0.874178, -1.231799, -1.503689, -1.896464, -2.385958]) + kwargs.setdefault("ToTCorrectionsEndcapAr" , [0., 5.514777, 3.342712, 2.056626, 1.08293693, 0.3907979, -0.082819, -0.457485, -0.599706, -0.427493, + -0.328962, -0.403399, -0.663656, -1.029428, -1.46008, -1.919092, -2.151582, -2.285481, -2.036822, -2.15805]) + + # Second calibration DB Service in case pile-up and physics hits have different calibrations + if ConfigFlags.Detector.RecoTRT: + TRT_CalDbTool = CompFactory.TRT_CalDbTool + InDetTRTCalDbTool2 = TRT_CalDbTool( name="TRT_CalDbTool2", + RtFolderName="/TRT/Calib/MC/RT", + T0FolderName="/TRT/Calib/MC/T0") + acc.addPublicTool(InDetTRTCalDbTool2) + kwargs.setdefault("TRTCalDbTool2", InDetTRTCalDbTool2) + kwargs.setdefault("IsOverlay", True) + kwargs.setdefault("IsMC", False) + acc.setPrivateTools(CompFactory.TRT_DriftFunctionTool(name, **kwargs)) + return acc + +def TRT_DriftCircleToolCfg(flags, useTimeInfo, usePhase, prefix, name = "InDetTRT_DriftCircleTool", **kwargs): + acc = ComponentAccumulator() + # + # --- TRT_DriftCircleTool + # + if usePhase: + TRT_DriftCircleTool = CompFactory.InDet.TRT_DriftCircleToolCosmics + else: + TRT_DriftCircleTool = CompFactory.InDet.TRT_DriftCircleTool + + # set gating values for MC/DATA + from AthenaCommon.SystemOfUnits import ns + + MinTrailingEdge = 11.0*ns + MaxDriftTime = 60.0*ns + LowGate = 14.0625*ns # 4.5*3.125 ns + HighGate = 42.1875*ns # LowGate + 9*3.125 ns + if flags.Beam.Type == 'cosmics': + LowGate = 19.0*ns + HighGate = 44.0*ns + if not flags.Input.isMC: + MinTrailingEdge = 11.0*ns + MaxDriftTime = 60.0*ns + LowGate = 14.0625*ns ## 4.5*3.125 ns + HighGate = 42.1875*ns ## LowGate + 9*3.125 ns + if flags.Beam.Type == 'cosmics': + LowGate = 19.0*ns + HighGate = 44.0*ns + # + # --- TRT_DriftFunctionTool + # + InDetTRT_DriftFunctionTool = acc.popToolsAndMerge(InDetTRT_DriftFunctionToolCfg(flags, useTimeInfo, usePhase, name = prefix + "DriftFunctionTool", **kwargs)) + acc.addPublicTool(InDetTRT_DriftFunctionTool) + + from InDetOverlay.TRT_ConditionsConfig import TRT_StrawStatusSummaryToolCfg + InDetTRTStrawStatusSummaryTool = acc.popToolsAndMerge(TRT_StrawStatusSummaryToolCfg(flags)) + acc.addPublicTool(InDetTRTStrawStatusSummaryTool) + + kwargs.setdefault("TRTDriftFunctionTool", InDetTRT_DriftFunctionTool) + kwargs.setdefault("ConditionsSummaryTool", InDetTRTStrawStatusSummaryTool) + kwargs.setdefault("UseConditionsStatus", True) + kwargs.setdefault("UseConditionsHTStatus", True) + kwargs.setdefault("SimpleOutOfTimePileupSupression", flags.Beam.Type == 'cosmics') #flags.InDet.doCosmics + kwargs.setdefault("RejectIfFirstBit", False) + kwargs.setdefault("MinTrailingEdge", MinTrailingEdge) + kwargs.setdefault("MaxDriftTime", MaxDriftTime) + kwargs.setdefault("ValidityGateSuppression", flags.Beam.Type != 'cosmics') #not flags.InDet.doCosmics + kwargs.setdefault("LowGate", LowGate) + kwargs.setdefault("HighGate", HighGate) + kwargs.setdefault("SimpleOutOfTimePileupSupressionArgon" , flags.Beam.Type == 'cosmics') #flags.InDet.doCosmics + kwargs.setdefault("RejectIfFirstBitArgon", False) + kwargs.setdefault("MinTrailingEdgeArgon", MinTrailingEdge) + kwargs.setdefault("MaxDriftTimeArgon", MaxDriftTime) + kwargs.setdefault("ValidityGateSuppressionArgon" , flags.Beam.Type != 'cosmics') #not flags.InDet.doCosmics + kwargs.setdefault("LowGateArgon", LowGate) + kwargs.setdefault("HighGateArgon", HighGate) + kwargs.setdefault("useDriftTimeHTCorrection", True) + kwargs.setdefault("useDriftTimeToTCorrection", True) + + + if flags.InDet.InDet25nsec and flags.Beam.Type == "collisions": + kwargs.setdefault("ValidityGateSuppression", True) + kwargs.setdefault("SimpleOutOfTimePileupSupression", False) + + if flags.Beam.Type == "cosmics": + kwargs.setdefault("SimpleOutOfTimePileupSupression", False) + + acc.setPrivateTools(TRT_DriftCircleTool(name, **kwargs)) + return acc + +def TRT_LocalOccupancyCfg(flags, name = "InDet_TRT_LocalOccupancy", **kwargs): + acc = ComponentAccumulator() + # Calibration DB Service + from InDetOverlay.TRT_ConditionsConfig import TRT_CalDbToolCfg + InDetTRTCalDbTool = acc.popToolsAndMerge(TRT_CalDbToolCfg(flags)) + acc.addPublicTool(InDetTRTCalDbTool) + # Straw status DB Tool + from InDetOverlay.TRT_ConditionsConfig import TRT_StrawStatusSummaryToolCfg + InDetTRTStrawStatusSummaryTool = acc.popToolsAndMerge(TRT_StrawStatusSummaryToolCfg(flags)) + acc.addPublicTool(InDetTRTStrawStatusSummaryTool) + kwargs.setdefault("isTrigger", False) + kwargs.setdefault("TRTCalDbTool", InDetTRTCalDbTool) + kwargs.setdefault("TRTStrawStatusSummaryTool", InDetTRTStrawStatusSummaryTool) + + InDetTRT_LocalOccupancy = CompFactory.TRT_LocalOccupancy(name, **kwargs) + acc.setPrivateTools(InDetTRT_LocalOccupancy) + return acc + +def TRTOccupancyIncludeCfg(flags, name = "InDetTRT_TRTOccupancyInclude", **kwargs): + acc = ComponentAccumulator() + # Calibration DB Service + from InDetOverlay.TRT_ConditionsConfig import TRT_CalDbToolCfg + InDetTRTCalDbTool = acc.popToolsAndMerge( TRT_CalDbToolCfg(flags) ) + acc.addPublicTool(InDetTRTCalDbTool) + # Straw status DB Tool + from InDetOverlay.TRT_ConditionsConfig import TRT_StrawStatusSummaryToolCfg + InDetTRTStrawStatusSummaryTool = acc.popToolsAndMerge(TRT_StrawStatusSummaryToolCfg(flags)) + acc.addPublicTool(InDetTRTStrawStatusSummaryTool) + InDetTRT_LocalOccupancy = acc.popToolsAndMerge(TRT_LocalOccupancyCfg(flags)) + acc.addPublicTool(InDetTRT_LocalOccupancy) + kwargs.setdefault("isTrigger", False) + kwargs.setdefault("TRTCalDbTool", InDetTRTCalDbTool) + kwargs.setdefault("TRTStrawStatusSummaryTool", InDetTRTStrawStatusSummaryTool) + kwargs.setdefault("TRT_LocalOccupancyTool", InDetTRT_LocalOccupancy) + + acc.addEventAlgo(CompFactory.TRTOccupancyInclude(name, **kwargs)) + return acc + +def InDetTRT_RIO_MakerCfg(flags, useTimeInfo, usePhase, prefix, collection, name = "InDetTRT_RIO_Maker", **kwargs): + acc = ComponentAccumulator() + # + # --- TRT_DriftCircleTool + # + InDetTRT_DriftCircleTool = acc.popToolsAndMerge(TRT_DriftCircleToolCfg(flags, useTimeInfo, usePhase, prefix, name = "InDetTRT_DriftCircleTool")) + acc.addPublicTool(InDetTRT_DriftCircleTool) + # + # --- TRT_RIO_Maker Algorithm + # + kwargs.setdefault("TRT_DriftCircleTool", InDetTRT_DriftCircleTool) + kwargs.setdefault("TrtDescrManageLocation", 'TRT') + kwargs.setdefault("TRTRDOLocation", 'TRT_RDOs') + kwargs.setdefault("TRTRIOLocation", collection) + + acc.addEventAlgo(CompFactory.InDet.TRT_RIO_Maker(name, **kwargs)) + return acc + +def InDetTRT_RIO_MakerPUCfg(flags, useTimeInfo, usePhase, prefix, collectionPU, name = "InDetTRT_RIO_MakerPU", **kwargs): + acc = ComponentAccumulator() + # + # --- TRT_DriftCircleTool + # + InDetTRT_DriftCircleTool = acc.popToolsAndMerge(TRT_DriftCircleToolCfg(flags, useTimeInfo, usePhase, prefix, name = "InDetTRT_DriftCircleTool")) + acc.addPublicTool(InDetTRT_DriftCircleTool) + # + # --- TRT_RIO_Maker Algorithm + # + kwargs.setdefault("TRT_DriftCircleTool", InDetTRT_DriftCircleTool) + kwargs.setdefault("TrtDescrManageLocation", 'TRT') + kwargs.setdefault("TRTRDOLocation", 'TRT_PU_RDOs') + kwargs.setdefault("TRTRIOLocation", collectionPU) + + acc.addEventAlgo(CompFactory.InDet.TRT_RIO_Maker(name, **kwargs)) + return acc +######################################################################################################## +######################################################################################################## +def TRTPreProcessingCfg(flags, useTimeInfo = True, usePhase = False, **kwargs): + acc = ComponentAccumulator() + + if flags.InDet.doPRDFormation and flags.InDet.doTRT_PRDFormation: + # + # --- setup naming of tools and algs + # + if useTimeInfo: + prefix = "InDetTRT_" + collection = 'TRT_DriftCircles' ##InDetKeys.TRT_DriftCircles + if flags.InDet.doSplitReco: + collectionPU = 'TRT_PU_DriftCircles' ##read from InDetKeys.TRT_PU_DriftCircles + else: + prefix = "InDetTRT_noTime_" + collection = 'TRT_DriftCirclesUncalibrated' ##read from InDetKeys.TRT_DriftCirclesUncalibrated + if flags.InDet.doSplitReco: + collectionPU = 'TRT_PU_DriftCirclesUncalibrated' ##read from InDetKeys.TRT_PU_DriftCirclesUncalibrated + # + # --- TRT_RIO_Maker Algorithm + # + acc.merge(InDetTRT_RIO_MakerCfg(flags, useTimeInfo, usePhase, prefix, collection, name = prefix+"RIO_Maker")) + if flags.InDet.doSplitReco : + acc.merge(InDetTRT_RIO_MakerPUCfg(flags, useTimeInfo, usePhase, prefix, collectionPU, name = prefix+"RIO_MakerPU", **kwargs)) + # + # Include alg to save the local occupancy inside xAOD::EventInfo + # + if flags.InDet.doTRTGlobalOccupancy: + acc.merge(TRTOccupancyIncludeCfg(flags, name = prefix +"TRTOccupancyInclude")) + # + # --- we need to do truth association if requested (not for uncalibrated hits in cosmics) + # + if flags.InDet.doTruth and useTimeInfo: + acc.merge(InDetPRD_MultiTruthMakerTRTCfg(flags, name = prefix + "PRD_MultiTruthMaker")) + if flags.InDet.doSplitReco : + acc.merge(InDetPRD_MultiTruthMakerTRTPUCfg(flags, name = prefix+"PRD_MultiTruthMakerPU")) + return acc + + +if __name__ == "__main__": + from AthenaCommon.Configurable import Configurable + Configurable.configurableRun3Behavior=1 + + from AthenaConfiguration.AllConfigFlags import ConfigFlags + from AthenaConfiguration.TestDefaults import defaultTestFiles + ConfigFlags.Input.Files=defaultTestFiles.RDO + + ConfigFlags.Detector.RecoTRT = True + + numThreads=1 + ConfigFlags.Concurrency.NumThreads=numThreads + ConfigFlags.Concurrency.NumConcurrentEvents=numThreads # Might change this later, but good enough for the moment. + + ConfigFlags.lock() + ConfigFlags.dump() + + from AthenaConfiguration.MainServicesConfig import MainServicesCfg + top_acc = MainServicesCfg(ConfigFlags) + + from AthenaPoolCnvSvc.PoolReadConfig import PoolReadCfg + top_acc.merge(PoolReadCfg(ConfigFlags)) + + from TRT_GeoModel.TRT_GeoModelConfig import TRT_GeometryCfg + top_acc.merge(TRT_GeometryCfg( ConfigFlags )) + + msgService = top_acc.getService('MessageSvc') + msgService.Format = "S:%s E:%e % F%138W%S%7W%R%T %0W%M" + + if not ConfigFlags.InDet.doDBMstandalone: + top_acc.merge(TRTPreProcessingCfg(ConfigFlags,(not ConfigFlags.InDet.doTRTPhaseCalculation or ConfigFlags.Beam.Type =="collisions"),False)) + + iovsvc = top_acc.getService('IOVDbSvc') + iovsvc.OutputLevel=5 + top_acc.run(25) + top_acc.store(open("test_TRTPrepocessing.pkl", "wb")) \ No newline at end of file diff --git a/InnerDetector/InDetDetDescr/InDetServMatGeoModel/InDetServMatGeoModel/InDetServMatGeometryManager.h b/InnerDetector/InDetDetDescr/InDetServMatGeoModel/InDetServMatGeoModel/InDetServMatGeometryManager.h index 8a8be6ec4382fba4fabcd7163023816fdd4010cd..81260af058f9985274ed0b2f65171a02f9425db9 100644 --- a/InnerDetector/InDetDetDescr/InDetServMatGeoModel/InDetServMatGeoModel/InDetServMatGeometryManager.h +++ b/InnerDetector/InDetDetDescr/InDetServMatGeoModel/InDetServMatGeoModel/InDetServMatGeometryManager.h @@ -143,11 +143,11 @@ public: double sctInnerSupport() const; // Pixel support tubes dimensions: specify name from simple services table - double SupportTubeRMin(std::string name) const; - double SupportTubeRMax(std::string name) const; - double SupportTubeZMin(std::string name) const; - double SupportTubeZMax(std::string name) const; - int SupportTubeExists(std::string name) const; + double SupportTubeRMin(const std::string& name) const; + double SupportTubeRMax(const std::string& name) const; + double SupportTubeZMin(const std::string& name) const; + double SupportTubeZMax(const std::string& name) const; + int SupportTubeExists(const std::string& name) const; private: // Record sets @@ -188,7 +188,7 @@ private: InDetMaterialManager * m_matMgr; // index of named support tube in m_InDetSimpleServices table, -1 if not found. Could be cached for speed. - int SupportTubeIndex(std::string name) const; + int SupportTubeIndex(const std::string& name) const; }; diff --git a/InnerDetector/InDetDetDescr/InDetServMatGeoModel/InDetServMatGeoModel/ServiceMaterial.h b/InnerDetector/InDetDetDescr/InDetServMatGeoModel/InDetServMatGeoModel/ServiceMaterial.h index 3ce60a9862b0c09fc8238f02f568d75b85dfca7c..13558191a933914c1079adecdb24d6e8a93dcfe1 100644 --- a/InnerDetector/InDetDetDescr/InDetServMatGeoModel/InDetServMatGeoModel/ServiceMaterial.h +++ b/InnerDetector/InDetDetDescr/InDetServMatGeoModel/InDetServMatGeoModel/ServiceMaterial.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ #ifndef ServiceMaterial_H @@ -19,8 +19,8 @@ public: If the weight is zero it will be taken from the material DB */ struct Entry { - Entry( std::string nam, int num, bool lin) : name(nam), number(num), linear(lin), weight(1) {} - Entry( std::string nam, int num, bool lin, double w) : name(nam), number(num), linear(lin), weight(w) {} + Entry( const std::string& nam, int num, bool lin) : name(nam), number(num), linear(lin), weight(1) {} + Entry( const std::string& nam, int num, bool lin, double w) : name(nam), number(num), linear(lin), weight(w) {} std::string name; int number; @@ -55,7 +55,7 @@ public: //ServiceMaterial operator*( double len) const {return ServiceMaterial( name(), len*linearWeight(), m_components);} void multiply( int factor) { - for ( std::vector< Entry>::iterator i=m_components.begin(); i!=m_components.end(); i++) { + for ( std::vector< Entry>::iterator i=m_components.begin(); i!=m_components.end(); ++i) { i->number *= factor; } } diff --git a/InnerDetector/InDetDetDescr/InDetServMatGeoModel/InDetServMatGeoModel/ServicesTracker.h b/InnerDetector/InDetDetDescr/InDetServMatGeoModel/InDetServMatGeoModel/ServicesTracker.h index 5921cf4e04db6c7fa2729d0cd98e21e525ca79ab..df278561272ff8cd5cc6c597b68af9c1ae114eae 100644 --- a/InnerDetector/InDetDetDescr/InDetServMatGeoModel/InDetServMatGeoModel/ServicesTracker.h +++ b/InnerDetector/InDetDetDescr/InDetServMatGeoModel/InDetServMatGeoModel/ServicesTracker.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ #ifndef ServicesTracker_H @@ -46,7 +46,7 @@ public: const std::vector<ServiceVolume*>& serviceVolumes() const {return m_volumes;} // Called by Routing - void setServiceVolumes( const std::vector<ServiceVolume*> vc) {m_volumes=vc;} + void setServiceVolumes( const std::vector<ServiceVolume*>& vc) {m_volumes=vc;} // methods called by Builder void constructBarrelLayer( double radius, double zHalfLength, diff --git a/InnerDetector/InDetDetDescr/InDetServMatGeoModel/InDetServMatGeoModel/StaveServices.h b/InnerDetector/InDetDetDescr/InDetServMatGeoModel/InDetServMatGeoModel/StaveServices.h index f02284511a0acd933321f6d55a6dad046f4c1b6e..9ff9794853ab95fc21dab5fef673310a01fef94d 100644 --- a/InnerDetector/InDetDetDescr/InDetServMatGeoModel/InDetServMatGeoModel/StaveServices.h +++ b/InnerDetector/InDetDetDescr/InDetServMatGeoModel/InDetServMatGeoModel/StaveServices.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ #ifndef StaveServices_H @@ -17,7 +17,7 @@ class StaveServices { public: StaveServices( DetType::Type type, DetType::Part part, int layer, - int nhv, int ndcs, int ndata, std::vector<int> lvGauge) : + int nhv, int ndcs, int ndata, const std::vector<int>& lvGauge) : m_type( type), m_part(part), m_layer(layer), m_numHV(nhv), m_numDCS( ndcs), m_numData( ndata), m_lvGauge( lvGauge) {} diff --git a/InnerDetector/InDetDetDescr/InDetServMatGeoModel/src/InDetServMatBuilderToolSLHC.cxx b/InnerDetector/InDetDetDescr/InDetServMatGeoModel/src/InDetServMatBuilderToolSLHC.cxx index 311a0fbeb142e3bb7e46f0806bb799bbea854543..2d3a9a1208ba8f2ca3acb56068f7148b6d162a49 100644 --- a/InnerDetector/InDetDetDescr/InDetServMatGeoModel/src/InDetServMatBuilderToolSLHC.cxx +++ b/InnerDetector/InDetDetDescr/InDetServMatGeoModel/src/InDetServMatBuilderToolSLHC.cxx @@ -161,7 +161,7 @@ void InDetServMatBuilderToolSLHC::build() fixMissingMaterials(); typedef std::vector<ServiceVolume*>::const_iterator iter; - for (iter i=tracker->serviceVolumes().begin(); i!=tracker->serviceVolumes().end(); i++) { + for (iter i=tracker->serviceVolumes().begin(); i!=tracker->serviceVolumes().end(); ++i) { /* msg(MSG::INFO) << "Calling ServiceVolume->dump() for the " << n++ << "th time" << endmsg; (**i).dump(); // for DEBUG only @@ -219,7 +219,7 @@ void InDetServMatBuilderToolSLHC::addServiceVolume( const ServiceVolume& vol) param->setZmax(vol.zMax()); param->setZsymm(true); for (std::vector<ServiceMaterial>::const_iterator ism=vol.materials().begin(); ism!=vol.materials().end(); ++ism) { - for ( ServiceMaterial::EntryIter ient= ism->components().begin(); ient!=ism->components().end(); ient++) { + for ( ServiceMaterial::EntryIter ient= ism->components().begin(); ient!=ism->components().end(); ++ient) { /* msg(MSG::INFO) << "Inside components loop, comp = " << ient->name << " number " << ient->number diff --git a/InnerDetector/InDetDetDescr/InDetServMatGeoModel/src/InDetServMatGeometryManager.cxx b/InnerDetector/InDetDetDescr/InDetServMatGeoModel/src/InDetServMatGeometryManager.cxx index 33ba286ac6fe13c1ca4e0364c8d4d002ca790a59..a76cac7e98ba6c2ba5f612c57145d6a50c2152cf 100644 --- a/InnerDetector/InDetDetDescr/InDetServMatGeoModel/src/InDetServMatGeometryManager.cxx +++ b/InnerDetector/InDetDetDescr/InDetServMatGeoModel/src/InDetServMatGeometryManager.cxx @@ -105,7 +105,7 @@ bool InDetServMatGeometryManager::buildServices() const return false; } -int InDetServMatGeometryManager::SupportTubeIndex(std::string name) const +int InDetServMatGeometryManager::SupportTubeIndex(const std::string& name) const { for (unsigned int i = 0; i < db()->getTableSize(m_InDetSimpleServices); i++) { @@ -114,35 +114,35 @@ int InDetServMatGeometryManager::SupportTubeIndex(std::string name) const return -1; } -double InDetServMatGeometryManager::SupportTubeRMin(std::string name) const +double InDetServMatGeometryManager::SupportTubeRMin(const std::string& name) const { int ind = SupportTubeIndex(name); if (ind >= 0) return db()->getDouble(m_InDetSimpleServices, "RMIN", ind); return 0; } -double InDetServMatGeometryManager::SupportTubeRMax(std::string name) const +double InDetServMatGeometryManager::SupportTubeRMax(const std::string& name) const { int ind = SupportTubeIndex(name); if (ind >= 0) return db()->getDouble(m_InDetSimpleServices, "RMAX", ind); return 0; } -double InDetServMatGeometryManager::SupportTubeZMin(std::string name) const +double InDetServMatGeometryManager::SupportTubeZMin(const std::string& name) const { int ind = SupportTubeIndex(name); if (ind >= 0) return db()->getDouble(m_InDetSimpleServices, "ZMIN", ind); return 0; } -double InDetServMatGeometryManager::SupportTubeZMax(std::string name) const +double InDetServMatGeometryManager::SupportTubeZMax(const std::string& name) const { int ind = SupportTubeIndex(name); if (ind >= 0) return db()->getDouble(m_InDetSimpleServices, "ZMAX", ind); return 0; } -int InDetServMatGeometryManager::SupportTubeExists(std::string name) const +int InDetServMatGeometryManager::SupportTubeExists(const std::string& name) const { if (SupportTubeIndex(name) != -1) return 1; return 0; diff --git a/InnerDetector/InDetDetDescr/InDetServMatGeoModel/src/Route.cxx b/InnerDetector/InDetDetDescr/InDetServMatGeoModel/src/Route.cxx index c1845c111405b07f9f6be0c3bdde0a5758a3080c..29a3e38864260657d5432e15ce268471803f4116 100644 --- a/InnerDetector/InDetDetDescr/InDetServMatGeoModel/src/Route.cxx +++ b/InnerDetector/InDetDetDescr/InDetServMatGeoModel/src/Route.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ #include "InDetServMatGeoModel/Route.h" @@ -21,7 +21,7 @@ ServiceVolume* Route::entryVolume( double pos, bool ascending, Athena::MsgStream // else { //should iterate to find exit volume if ( ascending) { - for (VolumeContainer::const_iterator i=volumes().begin(); i!=volumes().end(); i++) { + for (VolumeContainer::const_iterator i=volumes().begin(); i!=volumes().end(); ++i) { msg << MSG::DEBUG << "Comparing " << pos << " and " << (**i).position() << endmsg; @@ -57,7 +57,7 @@ ServiceVolume* Route::exitVolume( bool ascending, Athena::MsgStreamMember& msg) // returns the volume closest to the exit point, coming from the given direction if (volumes().empty()) return 0; if ( ascending) { - for (VolumeContainer::const_iterator i=volumes().begin(); i!=volumes().end(); i++) { + for (VolumeContainer::const_iterator i=volumes().begin(); i!=volumes().end(); ++i) { if ((**i).contains(exit())) return *i; else { msg << MSG::DEBUG << "volume at pos " << (**i).radius() diff --git a/InnerDetector/InDetDetDescr/InDetServMatGeoModel/src/ServiceVolume.cxx b/InnerDetector/InDetDetDescr/InDetServMatGeoModel/src/ServiceVolume.cxx index 9b96b7a7738f87e87c89b9994ef1cec715c63220..217c35c64b072309451e9ea062072fe9da4d704a 100644 --- a/InnerDetector/InDetDetDescr/InDetServMatGeoModel/src/ServiceVolume.cxx +++ b/InnerDetector/InDetDetDescr/InDetServMatGeoModel/src/ServiceVolume.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ #include "InDetServMatGeoModel/ServiceVolume.h" @@ -23,7 +23,7 @@ void ServiceVolume::dump( bool dumpMaterial) const if ( dumpMaterial && !materials().empty()) { for (std::vector<ServiceMaterial>::const_iterator i=materials().begin(); i!=materials().end(); ++i) { cout << " service material " << i->name() << " has the following components" << endl; - for ( ServiceMaterial::EntryIter ient= i->components().begin(); ient!=i->components().end(); ient++) { + for ( ServiceMaterial::EntryIter ient= i->components().begin(); ient!=i->components().end(); ++ient) { cout << ient->name << " linear? " << ient->linear << " number " << ient->number << " l/w " << ient->weight diff --git a/InnerDetector/InDetDetDescr/InDetServMatGeoModel/src/ServicesTracker.cxx b/InnerDetector/InDetDetDescr/InDetServMatGeoModel/src/ServicesTracker.cxx index f3427457dead732568ded049e74054d8c6b7b581..f43b215dd2563de7350ab2824e10d20e9c34bfea 100644 --- a/InnerDetector/InDetDetDescr/InDetServMatGeoModel/src/ServicesTracker.cxx +++ b/InnerDetector/InDetDetDescr/InDetServMatGeoModel/src/ServicesTracker.cxx @@ -85,7 +85,7 @@ void ServicesTracker::finaliseServices() std::map<const ServicesLayer*, ServiceMaterial> layerMaterial; // cache the layer services typedef std::vector<ServiceVolume*>::iterator VolumeIter; - for (VolumeIter iv=m_volumes.begin(); iv!=m_volumes.end(); iv++) { + for (VolumeIter iv=m_volumes.begin(); iv!=m_volumes.end(); ++iv) { std::vector<ServiceMaterial> result; // = (**iv).materials(); // preserve already present mat. (EOS) if ((**iv).isEOS()) addEosMaterial(**iv, result); diff --git a/InnerDetector/InDetDetDescr/SCT_Cabling/python/TestSCT_CablingCfg.py b/InnerDetector/InDetDetDescr/SCT_Cabling/python/TestSCT_CablingCfg.py index 79c28131ebd0fa7fe60da5cb0bb7f95cd4eaf6ff..d49da22cf55dfc17ccbf9dfb7bc60f767eec86c6 100644 --- a/InnerDetector/InDetDetDescr/SCT_Cabling/python/TestSCT_CablingCfg.py +++ b/InnerDetector/InDetDetDescr/SCT_Cabling/python/TestSCT_CablingCfg.py @@ -39,7 +39,7 @@ if __name__=="__main__": from AthenaConfiguration.AllConfigFlags import ConfigFlags ConfigFlags.Input.isMC = True - ConfigFlags.Input.RunNumber = 300000 + ConfigFlags.Input.RunNumber = [300000] ConfigFlags.addFlag("Input.InitialTimeStamp", 1500000000) # https://twiki.cern.ch/twiki/bin/viewauth/AtlasComputing/ConditionsRun1RunNumbers ConfigFlags.IOVDb.GlobalTag = "OFLCOND-RUN12-SDR-25" diff --git a/InnerDetector/InDetDigitization/FastSiDigitization/python/FastSiDigitizationConfig.py b/InnerDetector/InDetDigitization/FastSiDigitization/python/FastSiDigitizationConfig.py index 4d4e8759b29248822f57a2bd06cb826012ce1683..8aa5670788033feacd0401edf2cebb4c838aa6c5 100644 --- a/InnerDetector/InDetDigitization/FastSiDigitization/python/FastSiDigitizationConfig.py +++ b/InnerDetector/InDetDigitization/FastSiDigitization/python/FastSiDigitizationConfig.py @@ -41,6 +41,7 @@ def FastClusterMakerTool(name="FastClusterMakerTool", **kwargs): # Module status # ################# useNewChargeFormat = False + useNewDeadmapFormat = False if not hasattr(condSeq, "PixelConfigCondAlg"): from PixelConditionsAlgorithms.PixelConditionsAlgorithmsConf import PixelConfigCondAlg @@ -72,17 +73,27 @@ def FastClusterMakerTool(name="FastClusterMakerTool", **kwargs): IdMappingDat="PixelCabling/Pixels_Atlas_IdMapping_Run2.dat" condSeq += PixelConfigCondAlg(name="PixelConfigCondAlg", - UseDeadmapConditions=False, - UseDCSStateConditions=False, - UseDCSStatusConditions=False, - UseTDAQConditions=False, - UseCalibConditions=True, + ReadDeadMapKey = "", UseCablingConditions=False, CablingMapFileName=IdMappingDat) + if useNewDeadmapFormat: + if not hasattr(condSeq, "PixelDeadMapCondAlg"): + from PixelConditionsAlgorithms.PixelConditionsAlgorithmsConf import PixelDeadMapCondAlg + condSeq += PixelDeadMapCondAlg(name="PixelDeadMapCondAlg",ReadKey="") + #FIXME: at some point we should move away from being dependent on the experimentalDigi flags. if 'doFastSCT_Digi' in digitizationFlags.experimentalDigi() and not 'doFastPixelDigi' in digitizationFlags.experimentalDigi(): - PixelConfigCondAlg.UseCalibConditions=False + # Set empty Folder + if not useNewChargeFormat: + if not hasattr(condSeq, 'PixelChargeCalibCondAlg'): + from PixelConditionsAlgorithms.PixelConditionsAlgorithmsConf import PixelChargeCalibCondAlg + condSeq += PixelChargeCalibCondAlg(name="PixelChargeCalibCondAlg", ReadKey="") + else: + if not hasattr(condSeq, 'PixelChargeLUTCalibCondAlg'): + from PixelConditionsAlgorithms.PixelConditionsAlgorithmsConf import PixelChargeLUTCalibCondAlg + condSeq += PixelChargeLUTCalibCondAlg(name="PixelChargeLUTCalibCondAlg", ReadKey="") + else: ##################### # Calibration Setup # diff --git a/InnerDetector/InDetDigitization/FastSiDigitization/share/PixelDigitization_jobOptions.py b/InnerDetector/InDetDigitization/FastSiDigitization/share/PixelDigitization_jobOptions.py index 779edc32d41ccda0b5007323115547897e0c8144..5273dfdd56ed5d0fb533462672cb62865a5ae34e 100644 --- a/InnerDetector/InDetDigitization/FastSiDigitization/share/PixelDigitization_jobOptions.py +++ b/InnerDetector/InDetDigitization/FastSiDigitization/share/PixelDigitization_jobOptions.py @@ -27,21 +27,33 @@ from AthenaCommon.AlgSequence import AthSequencer condSeq = AthSequencer("AthCondSeq") if not hasattr(condSeq, 'PixelConfigCondAlg'): from PixelConditionsAlgorithms.PixelConditionsAlgorithmsConf import PixelConfigCondAlg - condSeq += PixelConfigCondAlg(name="PixelConfigCondAlg", - UseDeadmapConditions=False, - ReadDeadMapKey="/PIXEL/PixMapOverlay", - UseCalibConditions=True) + condSeq += PixelConfigCondAlg(name="PixelConfigCondAlg",ReadDeadMapKey="") + + +useNewChargeFormat = False +useNewDeadmapFormat = False + +if useNewDeadmapFormat: + if not hasattr(condSeq, "PixelDeadMapCondAlg"): + from PixelConditionsAlgorithms.PixelConditionsAlgorithmsConf import PixelDeadMapCondAlg + condSeq += PixelDeadMapCondAlg(name="PixelDeadMapCondAlg",ReadKey="") ##################### # Calibration setup # ##################### from IOVDbSvc.CondDB import conddb -if not conddb.folderRequested("/PIXEL/PixCalib"): - conddb.addFolder("PIXEL_OFL", "/PIXEL/PixCalib", className="CondAttrListCollection") - -if not hasattr(condSeq, 'PixelChargeCalibCondAlg'): - from PixelConditionsAlgorithms.PixelConditionsAlgorithmsConf import PixelChargeCalibCondAlg - condSeq += PixelChargeCalibCondAlg(name="PixelChargeCalibCondAlg", ReadKey="/PIXEL/PixCalib") +if not useNewChargeFormat: + if not conddb.folderRequested("/PIXEL/PixCalib"): + conddb.addFolder("PIXEL_OFL", "/PIXEL/PixCalib", className="CondAttrListCollection") + if not hasattr(condSeq, 'PixelChargeCalibCondAlg'): + from PixelConditionsAlgorithms.PixelConditionsAlgorithmsConf import PixelChargeCalibCondAlg + condSeq += PixelChargeCalibCondAlg(name="PixelChargeCalibCondAlg", ReadKey="/PIXEL/PixCalib") +else: + if not conddb.folderRequested("/PIXEL/ChargeCalibration"): + conddb.addFolder("PIXEL_OFL", "/PIXEL/ChargeCalibration", className="CondAttrListCollection") + if not hasattr(condSeq, 'PixelChargeLUTCalibCondAlg'): + from PixelConditionsAlgorithms.PixelConditionsAlgorithmsConf import PixelChargeLUTCalibCondAlg + condSeq += PixelChargeLUTCalibCondAlg(name="PixelChargeLUTCalibCondAlg", ReadKey="/PIXEL/ChargeCalibration") from PixelConditionsTools.PixelConditionsToolsConf import PixelRecoDbTool ToolSvc += PixelRecoDbTool() diff --git a/InnerDetector/InDetDigitization/PixelDigitization/python/PixelDigitizationConfig.py b/InnerDetector/InDetDigitization/PixelDigitization/python/PixelDigitizationConfig.py index 9fda804bfb2b953a9a69d259cec5f8a134f0c7ed..e21bc177cd544a53b095e502129fca6151128d12 100644 --- a/InnerDetector/InDetDigitization/PixelDigitization/python/PixelDigitizationConfig.py +++ b/InnerDetector/InDetDigitization/PixelDigitization/python/PixelDigitizationConfig.py @@ -126,14 +126,6 @@ def BasicPixelDigitizationTool(name="PixelDigitizationTool", **kwargs): if not hasattr(condSeq, 'PixelConfigCondAlg'): from PixelConditionsAlgorithms.PixelConditionsAlgorithmsConf import PixelConfigCondAlg - - PixelConfigCondAlg.UseCalibConditions=True - PixelConfigCondAlg.UseDeadmapConditions=True - PixelConfigCondAlg.UseDCSStateConditions=False - PixelConfigCondAlg.UseDCSStatusConditions=False - PixelConfigCondAlg.UseDCSHVConditions=True - PixelConfigCondAlg.UseDCSTemperatureConditions=True - PixelConfigCondAlg.UseTDAQConditions=False PixelConfigCondAlg.UseCablingConditions=False from AthenaCommon.BeamFlags import jobproperties diff --git a/InnerDetector/InDetDigitization/PixelDigitization/python/PixelDigitizationConfigNew.py b/InnerDetector/InDetDigitization/PixelDigitization/python/PixelDigitizationConfigNew.py index b133d30a5f7da084f47f6119bac95b42904f8b56..d01cd5f28bc865ef19459935f6185e5e71f95132 100644 --- a/InnerDetector/InDetDigitization/PixelDigitization/python/PixelDigitizationConfigNew.py +++ b/InnerDetector/InDetDigitization/PixelDigitization/python/PixelDigitizationConfigNew.py @@ -149,14 +149,7 @@ def PixelDigitizationBasicToolCfg(flags, name="PixelDigitizationBasicTool", **kw acc = PixelGeometryCfg(flags) # module parameters - acc.merge(PixelConfigCondAlgCfg(flags, - UseCalibConditions=True, - UseDeadmapConditions=True, - UseDCSStateConditions=False, - UseDCSStatusConditions=False, - UseDCSHVConditions=True, - UseDCSTemperatureConditions=True, - UseTDAQConditions=False)) + acc.merge(PixelConfigCondAlgCfg(flags)) # charge calibration acc.merge(PixelChargeCalibCondAlgCfg(flags)) # NEW FOR RUN3 acc.merge(PixelChargeLUTCalibCondAlgCfg(flags)) diff --git a/InnerDetector/InDetEventCnv/InDetPrepRawDataToxAOD/share/InDetDxAOD.py b/InnerDetector/InDetEventCnv/InDetPrepRawDataToxAOD/share/InDetDxAOD.py index 55f2ba0bb8c1d3cb362fae5d2ac4cc2bb5f8c78d..baa9bbdfbcfc520083abdd123b41ca1e7ed1ad2a 100644 --- a/InnerDetector/InDetEventCnv/InDetPrepRawDataToxAOD/share/InDetDxAOD.py +++ b/InnerDetector/InDetEventCnv/InDetPrepRawDataToxAOD/share/InDetDxAOD.py @@ -424,10 +424,7 @@ if dumpPixInfo: condSeq = AthSequencer("AthCondSeq") if not hasattr(condSeq, "PixelConfigCondAlg"): from PixelConditionsAlgorithms.PixelConditionsAlgorithmsConf import PixelConfigCondAlg - condSeq += PixelConfigCondAlg(name="PixelConfigCondAlg", - UseDCSStateConditions=True, - UseDCSStatusConditions=True) - + condSeq += PixelConfigCondAlg(name="PixelConfigCondAlg") if not hasattr(condSeq, "PixelDCSCondStateAlg"): from PixelConditionsAlgorithms.PixelConditionsAlgorithmsConf import PixelDCSCondStateAlg condSeq += PixelDCSCondStateAlg(name="PixelDCSCondStateAlg") diff --git a/InnerDetector/InDetExample/InDetRecExample/python/ConfiguredNewTrackingCuts.py b/InnerDetector/InDetExample/InDetRecExample/python/ConfiguredNewTrackingCuts.py index 0a6d159e0a47e5e5b40b49d0ecf10531c4b59cef..c6cbe58ebdfcba888e403f6506dc59b17e683303 100755 --- a/InnerDetector/InDetExample/InDetRecExample/python/ConfiguredNewTrackingCuts.py +++ b/InnerDetector/InDetExample/InDetRecExample/python/ConfiguredNewTrackingCuts.py @@ -1,4 +1,4 @@ -# Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration +# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration from __future__ import print_function @@ -247,10 +247,7 @@ class ConfiguredNewTrackingCuts : self.__minRoIClusterEt = 6000. * Units.MeV self.__minSecondaryPt = 3.0 * Units.GeV # Increase pT cut used for back-tracking to match calo-RoI - if self.__indetflags.cutLevel() >= 20: - print('--------> FATAL ERROR, cut level undefined, abort !') - import sys - sys.exit() + assert self.__indetflags.cutLevel() < 20 , "default cut level is wrong {}.format(self.__indetflags.cutLevel())" # -------------------------------------- # --- now the overwrites for special setups @@ -279,23 +276,6 @@ class ConfiguredNewTrackingCuts : self.__rejectShortExtensions = False -# if rec.Commissioning(): -# self.__minClusters = 7 # Igor 6, was 7 -# self.__maxHoles = 5 # was 5 -# self.__maxPixelHoles = 2 # was 5 -# self.__maxSctHoles = 5 # was 5 -# self.__maxDoubleHoles = 4 # was 2 -# self.__maxPrimaryImpact = 50.0 * Units.mm # low lumi -# self.__maxZImpact = 500.0 * Units.mm - -# if rec.Commissioning(): -# self.__maxSecondaryHoles = 5 -# self.__maxSecondaryPixelHoles = 5 -# self.__maxSecondarySCTHoles = 5 -# self.__maxSecondaryDoubleHoles = 2 -# self.__SecondaryXi2max = 50.0 -# self.__SecondaryXi2maxNoAdd = 100.0 - # --- SLHC setup if mode == "SLHC": self.__extension = "SLHC" @@ -307,19 +287,9 @@ class ConfiguredNewTrackingCuts : # --- cluster cuts self.__minClusters = 9 self.__minSiNotShared = 8 - #self.__maxShared = 3 # cut is now on number of shared modules - #self.__maxHoles = 3 - #self.__maxPixelHoles = D2 - #self.__maxSctHoles = 2 - #self.__maxDoubleHoles = 2 + # --- also tighten pattern cuts self.__radMax = 1000. * Units.mm - #self.__seedFilterLevel = 1 - #self.__nHolesMax = self.__maxHoles - #self.__nHolesGapMax = self.__maxHoles - #self.__Xi2max = 15.0 - #self.__Xi2maxNoAdd = 35.0 - #self.__nWeightedClustersMin = self.__minClusters-1 # --- IBL setup if mode == "IBL" : @@ -340,9 +310,9 @@ class ConfiguredNewTrackingCuts : # --- mode for min bias, commissioning or doRobustReco if mode == 'MinBias' or self.__indetflags.doRobustReco(): if self.__indetflags.doHIP300(): - self.__minPT = 0.300 * Units.GeV + self.__minPT = 0.300 * Units.GeV else: - self.__minPT = 0.100 * Units.GeV + self.__minPT = 0.100 * Units.GeV self.__minClusters = 5 self.__minSecondaryPt = 0.4 * Units.GeV # Pt cut for back tracking + segment finding for these self.__minTRTonlyPt = 0.4 * Units.GeV # Pt cut for TRT only @@ -461,20 +431,12 @@ class ConfiguredNewTrackingCuts : self.__maxZImpact = 150.0 * Units.mm self.__minClusters = 6 self.__minSiNotShared = 4 - #self.__maxShared = 3 self.__maxHoles = 0 - #self.__maxPixelHoles = D2 - #self.__maxSctHoles = 2 - #self.__maxDoubleHoles = 2 + # --- also tighten pattern cuts self.__radMax = 1000. * Units.mm self.__radMin = 0. * Units.mm # not turn on this cut for now - #self.__seedFilterLevel = 1 - #self.__nHolesMax = self.__maxHoles - #self.__nHolesGapMax = self.__maxHoles - #self.__Xi2max = 15.0 - #self.__Xi2maxNoAdd = 35.0 - #self.__nWeightedClustersMin = self.__minClusters-1 + # --- turn on Z Boundary seeding self.__doZBoundary = False # @@ -607,7 +569,7 @@ class ConfiguredNewTrackingCuts : self.__maxSctHoles = 3 self.__maxDoubleHoles = 1 self.__minTRTonTrk = 15 - self.__minTRTOnly = 15 + self.__minTRTonly = 15 self.__roadWidth = 60. self.__seedFilterLevel = 3 self.__Xi2max = 60.0 diff --git a/InnerDetector/InDetExample/InDetRecExample/share/InDetRecConditionsAccess.py b/InnerDetector/InDetExample/InDetRecExample/share/InDetRecConditionsAccess.py index 335ae6e7d84d2b6e177b8898547cfac3fb1ea86a..80ec30c3f5f9d32059dd8961f1a7149443db943b 100644 --- a/InnerDetector/InDetExample/InDetRecExample/share/InDetRecConditionsAccess.py +++ b/InnerDetector/InDetExample/InDetRecExample/share/InDetRecConditionsAccess.py @@ -105,23 +105,24 @@ if DetFlags.pixel_on(): else: IdMappingDat="PixelCabling/Pixels_Atlas_IdMapping_344494.dat" - condSeq += PixelConfigCondAlg(name="PixelConfigCondAlg", - UseDeadmapConditions=(not athenaCommonFlags.isOnline()), - UseDCSStateConditions=(globalflags.DataSource=='data') and InDetFlags.usePixelDCS(), - UseDCSStatusConditions=(globalflags.DataSource=='data') and InDetFlags.usePixelDCS(), - UseTDAQConditions=athenaCommonFlags.isOnline(), - UseCalibConditions=True, - UseCablingConditions=useCablingConditions, - CablingMapFileName=IdMappingDat) + alg = PixelConfigCondAlg(name="PixelConfigCondAlg", + UseCablingConditions=useCablingConditions, + CablingMapFileName=IdMappingDat) + if athenaCommonFlags.isOnline(): + alg.ReadDeadMapKey = "" + condSeq += alg if useNewDeadmapFormat: if not conddb.folderRequested("/PIXEL/PixelModuleFeMask"): conddb.addFolder("PIXEL_OFL", "/PIXEL/PixelModuleFeMask", className="CondAttrListCollection") if not hasattr(condSeq, "PixelDeadMapCondAlg"): from PixelConditionsAlgorithms.PixelConditionsAlgorithmsConf import PixelDeadMapCondAlg - condSeq += PixelDeadMapCondAlg(name="PixelDeadMapCondAlg") + alg = PixelDeadMapCondAlg(name="PixelDeadMapCondAlg") + if athenaCommonFlags.isOnline(): + alg.ReadKey = "" + condSeq += alg - if not athenaCommonFlags.isOnline(): + if globalflags.DataSource=='data' and InDetFlags.usePixelDCS(): if not conddb.folderRequested("/PIXEL/DCS/FSMSTATE"): conddb.addFolder("DCS_OFL", "/PIXEL/DCS/FSMSTATE", className="CondAttrListCollection") if not conddb.folderRequested("/PIXEL/DCS/FSMSTATUS"): @@ -228,7 +229,17 @@ if DetFlags.pixel_on(): PixeldEdxAlg.CalibrationFile="dtpar_signed_234.txt" else: PixeldEdxAlg.CalibrationFile="mcpar_signed_234.txt" - + + ################ + # RUN-1 legacy # + ################ + if commonGeoFlags.Run()=="RUN1" and athenaCommonFlags.isOnline(): + if not conddb.folderRequested("/TDAQ/Resources/ATLAS/PIXEL/Modules"): + conddb.addFolder("TDAQ_ONL", "/TDAQ/Resources/ATLAS/PIXEL/Modules", className="CondAttrListCollection") + if not hasattr(condSeq, "PixelTDAQCondAlg"): + from PixelConditionsAlgorithms.PixelConditionsAlgorithmsConf import PixelTDAQCondAlg + condSeq += PixelTDAQCondAlg(name="PixelTDAQCondAlg", ReadKey="/TDAQ/Resources/ATLAS/PIXEL/Modules") + # # --- Load SCT Conditions Services # diff --git a/InnerDetector/InDetExample/InDetSLHC_Example/share/postInclude.SLHC_Rec.py b/InnerDetector/InDetExample/InDetSLHC_Example/share/postInclude.SLHC_Rec.py index 27da800e15350ddc504ae7f456ba0373baec487e..cf08dcad6818ad42a195fb2258c302dbdd918ff7 100644 --- a/InnerDetector/InDetExample/InDetSLHC_Example/share/postInclude.SLHC_Rec.py +++ b/InnerDetector/InDetExample/InDetSLHC_Example/share/postInclude.SLHC_Rec.py @@ -38,10 +38,22 @@ if rec.doWriteESD() or rec.doWriteAOD() or ('doWriteESD' in dir() and doWriteESD printfunc ('===> OVERWRITTEN TOOL SETTINGS ................') # --- turn off cluster calibration from DB, does not exist for IBL - from PixelConditionsAlgorithms.PixelConditionsAlgorithmsConf import PixelConfigCondAlg - PixelConfigCondAlg.UseCalibConditions = False - PixelConfigCondAlg.UseDeadmapConditions = False - + useNewChargeFormat = False + if not useNewChargeFormat: + from PixelConditionsAlgorithms.PixelConditionsAlgorithmsConf import PixelChargeCalibCondAlg + PixelChargeCalibCondAlg.ReadKey="" + else: + from PixelConditionsAlgorithms.PixelConditionsAlgorithmsConf import PixelChargeLUTCalibCondAlg + PixelChargeLUTCalibCondAlg.ReadKey="" + + useNewDeadmapFormat = False + if not useNewDeadmapFormat: + from PixelConditionsAlgorithms.PixelConditionsAlgorithmsConf import PixelConfigCondAlg + PixelConfigCondAlg.ReadDeadMapKey = "" + else: + from PixelConditionsAlgorithms.PixelConditionsAlgorithmsConf import PixelDeadMapCondAlg + PixelDeadMapCondAlg.ReadKey = "" + # --- switch alignment for IBL geometry off (gives WARNING) from PixelGeoModel.PixelGeoModelConf import PixelDetectorTool pixelTool = PixelDetectorTool() diff --git a/InnerDetector/InDetExample/InDetTrigRecExample/python/InDetTrigConfigConditions.py b/InnerDetector/InDetExample/InDetTrigRecExample/python/InDetTrigConfigConditions.py index 56fda0c7da43b7aced1c9c26ae36572bc389fe37..b6b92a9c868b8d298a33da7a7cbac67bc994624c 100644 --- a/InnerDetector/InDetExample/InDetTrigRecExample/python/InDetTrigConfigConditions.py +++ b/InnerDetector/InDetExample/InDetTrigRecExample/python/InDetTrigConfigConditions.py @@ -126,15 +126,12 @@ class PixelConditionsServicesSetup: else: IdMappingDat="PixelCabling/Pixels_Atlas_IdMapping_344494.dat" - condSeq += PixelConfigCondAlg(name="PixelConfigCondAlg", - UseDeadmapConditions=self.usePixMap, - UseDCSStateConditions=self.useDCS, - UseDCSStatusConditions=self.useDCS, - UseTDAQConditions=self.useTDAQ, # should be false. This is only valid in RUN-1. - UseCalibConditions=True, - UseCablingConditions=useCablingConditions, - CablingMapFileName=IdMappingDat) - + alg = PixelConfigCondAlg(name="PixelConfigCondAlg", + UseCablingConditions=useCablingConditions, + CablingMapFileName=IdMappingDat) + if not self.usePixMap: + alg.ReadDeadMapKey = "" + condSeq += alg ######################### # Deadmap Setup (RUN-3) # @@ -144,7 +141,10 @@ class PixelConditionsServicesSetup: conddb.addFolder("PIXEL_OFL", "/PIXEL/PixelModuleFeMask", className="CondAttrListCollection") if not hasattr(condSeq, "PixelDeadMapCondAlg"): from PixelConditionsAlgorithms.PixelConditionsAlgorithmsConf import PixelDeadMapCondAlg - condSeq += PixelDeadMapCondAlg(name="PixelDeadMapCondAlg") + alg = PixelDeadMapCondAlg(name="PixelDeadMapCondAlg") + if not self.usePixMap: + alg.ReadKey = "" + condSeq += alg ######################## # DCS Conditions Setup # @@ -163,8 +163,8 @@ class PixelConditionsServicesSetup: conddb.addFolder(PixelDBInstance, PixelHVFolder, className="CondAttrListCollection") if not conddb.folderRequested(PixelTempFolder): conddb.addFolder(PixelDBInstance, PixelTempFolder, className="CondAttrListCollection") - - if not self.onlineMode: #this is only for testing in offline like setup + + if not self.onlineMode and self.useDCS: #this is only for testing in offline like setup if not conddb.folderRequested("/PIXEL/DCS/FSMSTATE"): conddb.addFolder("DCS_OFL", "/PIXEL/DCS/FSMSTATE", className="CondAttrListCollection") if not conddb.folderRequested("/PIXEL/DCS/FSMSTATUS"): diff --git a/InnerDetector/InDetExample/InDetTrigRecExample/python/InDetTrigConfigRecPreProcessing.py b/InnerDetector/InDetExample/InDetTrigRecExample/python/InDetTrigConfigRecPreProcessing.py index b22d5446699f20728d2dd173986d900eacdaf926..af432f10d02c587d43fec63608c1f7a1730f854c 100755 --- a/InnerDetector/InDetExample/InDetTrigRecExample/python/InDetTrigConfigRecPreProcessing.py +++ b/InnerDetector/InDetExample/InDetTrigRecExample/python/InDetTrigConfigRecPreProcessing.py @@ -79,8 +79,8 @@ class PixelClustering_EF( InDet__Pixel_TrgClusterization ): InDetTrigMergedPixelsTool = InDet__MergedPixelsTool( name = "InDetTrigMergedPixelsTool", globalPosAlg = InDetTrigClusterMakerTool, PixelConditionsSummaryTool = InDetTrigPixelConditionsSummaryTool, - #UseSpecialPixelMap = False #simpler setup for EFID - UseSpecialPixelMap = True) + #UsePixelModuleMap = False #simpler setup for EFID + UsePixelModuleMap = True) # Enable duplcated RDO check for data15 because duplication mechanism was used. from RecExConfig.RecFlags import rec if len(rec.projectName())>=6 and rec.projectName()[:6]=="data15": diff --git a/InnerDetector/InDetMonitoring/InDetGlobalMonitoringRun3Test/python/InDetGlobalBeamSpotMonAlgCfg.py b/InnerDetector/InDetMonitoring/InDetGlobalMonitoringRun3Test/python/InDetGlobalBeamSpotMonAlgCfg.py index 89b5e2e1f360320a206757d4c35272e1f25f338a..f0f1b0604ed188ee25bfe9c3f05ccc4d418ffee7 100644 --- a/InnerDetector/InDetMonitoring/InDetGlobalMonitoringRun3Test/python/InDetGlobalBeamSpotMonAlgCfg.py +++ b/InnerDetector/InDetMonitoring/InDetGlobalMonitoringRun3Test/python/InDetGlobalBeamSpotMonAlgCfg.py @@ -22,7 +22,7 @@ def InDetGlobalBeamSpotMonAlgCfg(helper, alg, **kwargs): pathbs = '/InDetGlobal/BeamSpot' # Histograms for track-based beam spot monitoring: - varName = 'm_trkD0,m_trkD0Phi;trkDPhi' + varName = 'm_trkD0Phi,m_trkD0;trkDPhi' bsGroup.defineHistogram(varName,type="TH2F",title="DCA vs Phi; #varphi (rad);d_{0} (#mum)", path=pathbs, xbins=100, xmin=-3.5, xmax=3.5, ybins=100, ymin=-1000, ymax=1000) if (expert): @@ -33,7 +33,7 @@ def InDetGlobalBeamSpotMonAlgCfg(helper, alg, **kwargs): #Histograms of assumed beam spot position if (m_useBeamspot): - varName = 'm_trkD0Corr,m_trkD0PhiCorr;trkDPhiCorr' + varName = 'm_trkD0PhiCorr,m_trkD0Corr;trkDPhiCorr' bsGroup.defineHistogram(varName,type="TH2F",title="DCA vs Phi wrt Beamspot;#varphi (rad);d_{0} (#mum)",path=pathbs,xbins=100, xmin=-3.5,xmax=3.5, ybins=100, ymin=-500,ymax=500) varName = 'm_bsX;bsX' bsGroup.defineHistogram(varName, type="TH1F", title="Beam spot position: x;x (mm)",path=pathbs,xbins=100,xmin=-10,xmax=10) @@ -66,11 +66,11 @@ def InDetGlobalBeamSpotMonAlgCfg(helper, alg, **kwargs): #Histograms that are independent of the useBeamSpot parameters - varName = 'm_pvX,m_pvZ;pvXZ' + varName = 'm_pvZ,m_pvX;pvXZ' bsGroup.defineHistogram(varName, type="TH2F", title="Primary vertex: x vs z;z (mm);x (mm)", path=pathbs, xbins=100, xmin=-500, xmax=500, ybins=100, ymin=-10, ymax=10) - varName = 'm_pvY,m_pvZ;pvYZ' + varName = 'm_pvZ,m_pvY;pvYZ' bsGroup.defineHistogram(varName, type="TH2F", title="Primary vertex: y vs z;z (mm);y (mm)", path=pathbs, xbins=100, xmin=-500, xmax=500, ybins=100, ymin=-10,ymax=10) - varName = 'm_pvY,m_pvX;pvYX' + varName = 'm_pvX,m_pvY;pvYX' bsGroup.defineHistogram(varName, type="TH2F", title="Primary vertex: y vs x;x (mm);y (mm)", path=pathbs, xbins=100, xmin=-10, xmax=10, ybins=100, ymin=-10, ymax=10) varName = 'm_pvChiSqDof;pvChiSqDof' bsGroup.defineHistogram(varName, type="TH1F", title="",path=pathbs,xbins=100,xmin=0,xmax=20) diff --git a/InnerDetector/InDetMonitoring/InDetGlobalMonitoringRun3Test/python/InDetGlobalMonitoringRun3TestConfig.py b/InnerDetector/InDetMonitoring/InDetGlobalMonitoringRun3Test/python/InDetGlobalMonitoringRun3TestConfig.py index 58807dec5e6aa53aee2fb781192e8396f6f4ae58..79e20f002b58319c6ac2eab608ed5e333dd1ef10 100644 --- a/InnerDetector/InDetMonitoring/InDetGlobalMonitoringRun3Test/python/InDetGlobalMonitoringRun3TestConfig.py +++ b/InnerDetector/InDetMonitoring/InDetGlobalMonitoringRun3Test/python/InDetGlobalMonitoringRun3TestConfig.py @@ -14,6 +14,11 @@ def InDetGlobalMonitoringRun3TestConfig(flags): from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator acc = ComponentAccumulator() + from AthenaMonitoring import AthMonitorCfgHelper + helper = AthMonitorCfgHelper(flags, "InDetGlobalMonitoringRun3Test") + + from AthenaConfiguration.ComponentFactory import CompFactory + # run on RAW only if flags.DQ.Environment in ('online', 'tier0', 'tier0Raw'): ## from InDetRecExample.InDetKeys import InDetKeys ## not sure it works now @@ -27,17 +32,13 @@ def InDetGlobalMonitoringRun3TestConfig(flags): } - from AthenaMonitoring import AthMonitorCfgHelper - helper = AthMonitorCfgHelper(flags, "InDetGlobalMonitoringRun3Test") - - from AthenaConfiguration.ComponentFactory import CompFactory - # from InDetGlobalMonitoringRun3Test.InDetGlobalMonitoringRun3TestConf import InDetGlobalTrackMonAlg from InDetGlobalMonitoringRun3Test.InDetGlobalTrackMonAlgCfg import InDetGlobalTrackMonAlgCfg inDetGlobalTrackMonAlg = helper.addAlgorithm(CompFactory.InDetGlobalTrackMonAlg, 'InDetGlobalTrackMonAlg') for k, v in kwargsInDetGlobalTrackMonAlg.items(): setattr(inDetGlobalTrackMonAlg, k, v) + inDetGlobalTrackMonAlg.TrackSelectionTool = CompFactory.InDet.InDetTrackSelectionTool() inDetGlobalTrackMonAlg.TrackSelectionTool.UseTrkTrackTools = True inDetGlobalTrackMonAlg.TrackSelectionTool.CutLevel = "TightPrimary" inDetGlobalTrackMonAlg.TrackSelectionTool.maxNPixelHoles = 1 @@ -45,6 +46,7 @@ def InDetGlobalMonitoringRun3TestConfig(flags): # InDetGlobalTrackMonAlg.Baseline_TrackSelectionTool.TrackSummaryTool = InDetTrackSummaryTool # InDetGlobalTrackMonAlg.Baseline_TrackSelectionTool.Extrapolator = InDetExtrapolator # + inDetGlobalTrackMonAlg.Tight_TrackSelectionTool = CompFactory.InDet.InDetTrackSelectionTool() inDetGlobalTrackMonAlg.Tight_TrackSelectionTool.UseTrkTrackTools = True inDetGlobalTrackMonAlg.Tight_TrackSelectionTool.CutLevel = "TightPrimary" inDetGlobalTrackMonAlg.Tight_TrackSelectionTool.minPt = 5000 @@ -54,20 +56,23 @@ def InDetGlobalMonitoringRun3TestConfig(flags): # Run 3 configs - stolen from SCT from SCT_Monitoring.TrackSummaryToolWorkaround import TrackSummaryToolWorkaround - inDetGlobalTrackMonAlg.TrackSelectionTool.TrackSummaryTool = acc.popToolsAndMerge(TrackSummaryToolWorkaround(flags)) + InDetTrackSummaryTool = acc.popToolsAndMerge(TrackSummaryToolWorkaround(flags)) + inDetGlobalTrackMonAlg.TrackSummaryTool = InDetTrackSummaryTool + inDetGlobalTrackMonAlg.TrackSelectionTool.TrackSummaryTool = InDetTrackSummaryTool inDetGlobalTrackMonAlg.TrackSelectionTool.Extrapolator = acc.getPublicTool("InDetExtrapolator") - inDetGlobalTrackMonAlg.Tight_TrackSelectionTool.TrackSummaryTool = acc.popToolsAndMerge(TrackSummaryToolWorkaround(flags)) + inDetGlobalTrackMonAlg.Tight_TrackSelectionTool.TrackSummaryTool = InDetTrackSummaryTool inDetGlobalTrackMonAlg.Tight_TrackSelectionTool.Extrapolator = acc.getPublicTool("InDetExtrapolator") InDetGlobalTrackMonAlgCfg(helper, inDetGlobalTrackMonAlg, **kwargsInDetGlobalTrackMonAlg) ########### here ends InDetGlobalTrackMonAlg ########### - + # run on ESD + if flags.DQ.Environment != 'tier0Raw': ########### here begins InDetGlobalPrimaryVertexMonAlg ########### - from InDetGlobalMonitoringRun3Test.InDetGlobalMonitoringRun3TestConf import InDetGlobalPrimaryVertexMonAlg from InDetGlobalMonitoringRun3Test.InDetGlobalPrimaryVertexMonAlgCfg import InDetGlobalPrimaryVertexMonAlgCfg - myInDetGlobalPrimaryVertexMonAlg = helper.addAlgorithm(InDetGlobalPrimaryVertexMonAlg, 'InDetGlobalPrimaryVertexMonAlg') + myInDetGlobalPrimaryVertexMonAlg = helper.addAlgorithm(CompFactory.InDetGlobalPrimaryVertexMonAlg, + 'InDetGlobalPrimaryVertexMonAlg') kwargsInDetGlobalPrimaryVertexMonAlg = { 'vxContainerName' : 'PrimaryVertices', #InDetKeys.xAODVertexContainer(), @@ -77,18 +82,20 @@ def InDetGlobalMonitoringRun3TestConfig(flags): } for k, v in kwargsInDetGlobalPrimaryVertexMonAlg.items(): - setattr(kwargsInDetGlobalPrimaryVertexMonAlg, k, v) + setattr(myInDetGlobalPrimaryVertexMonAlg, k, v) InDetGlobalPrimaryVertexMonAlgCfg(helper, myInDetGlobalPrimaryVertexMonAlg, **kwargsInDetGlobalPrimaryVertexMonAlg) ########### here ends InDetGlobalPrimaryVertexMonAlg ########### ########### here begins InDetGlobalBeamSpotMonAlg ########### - - from InDetGlobalMonitoringRun3Test.InDetGlobalMonitoringRun3TestConf import InDetGlobalBeamSpotMonAlg + from BeamSpotConditions.BeamSpotConditionsConfig import BeamSpotCondAlgCfg + acc.merge(BeamSpotCondAlgCfg(flags)) + from InDetGlobalMonitoringRun3Test.InDetGlobalBeamSpotMonAlgCfg import InDetGlobalBeamSpotMonAlgCfg - myInDetGlobalBeamSpotMonAlg = helper.addAlgorithm(InDetGlobalBeamSpotMonAlg, 'InDetGlobalBeamSpotMonAlg') + myInDetGlobalBeamSpotMonAlg = helper.addAlgorithm(CompFactory.InDetGlobalBeamSpotMonAlg, + 'InDetGlobalBeamSpotMonAlg') kwargsInDetGlobalBeamSpotMonAlg = { 'BeamSpotKey' : 'BeamSpotData', #InDetKeys.BeamSpotData(), @@ -99,10 +106,10 @@ def InDetGlobalMonitoringRun3TestConfig(flags): } for k, v in kwargsInDetGlobalBeamSpotMonAlg.items(): - setattr(kwargsInDetGlobalBeamSpotMonAlg, k, v) + setattr(myInDetGlobalBeamSpotMonAlg, k, v) InDetGlobalBeamSpotMonAlgCfg(helper, myInDetGlobalBeamSpotMonAlg, **kwargsInDetGlobalBeamSpotMonAlg) ########### here ends InDetGlobalBeamSpotMonAlg ########### - + acc.merge(helper.result()) return acc diff --git a/InnerDetector/InDetMonitoring/InDetGlobalMonitoringRun3Test/src/InDetGlobalBeamSpotMonAlg.cxx b/InnerDetector/InDetMonitoring/InDetGlobalMonitoringRun3Test/src/InDetGlobalBeamSpotMonAlg.cxx index e4764edc45714a05f35b1f9eff19ea98a6788932..be7e6913a5dc37f6e059088b0b35c762c21d2aa9 100644 --- a/InnerDetector/InDetMonitoring/InDetGlobalMonitoringRun3Test/src/InDetGlobalBeamSpotMonAlg.cxx +++ b/InnerDetector/InDetMonitoring/InDetGlobalMonitoringRun3Test/src/InDetGlobalBeamSpotMonAlg.cxx @@ -90,11 +90,16 @@ StatusCode InDetGlobalBeamSpotMonAlg::fillHistograms( const EventContext& ctx ) const Amg::Vector3D &bpos = beamSpotHandle->beamPos(); - auto beamSpotX_m = Monitored::Scalar<float>("m_bsX", bpos.x() ); - auto beamSpotY_m = Monitored::Scalar<float>("m_bsY", bpos.y() ); - auto beamSpotZ_m = Monitored::Scalar<float>("m_bsZ", bpos.z() ); - auto beamTiltX_m = Monitored::Scalar<float>("m_bsTiltX", 1e6*beamSpotHandle->beamTilt(0) ); - auto beamTiltY_m = Monitored::Scalar<float>("m_bsTiltY", 1e6*beamSpotHandle->beamTilt(1) ); + beamSpotX = bpos.x(); + beamSpotY = bpos.y(); + beamSpotZ = bpos.z(); + auto beamSpotX_m = Monitored::Scalar<float>("m_bsX", beamSpotX ); + auto beamSpotY_m = Monitored::Scalar<float>("m_bsY", beamSpotY ); + auto beamSpotZ_m = Monitored::Scalar<float>("m_bsZ", beamSpotZ ); + beamTiltX = beamSpotHandle->beamTilt(0); + beamTiltY = beamSpotHandle->beamTilt(1); + auto beamTiltX_m = Monitored::Scalar<float>("m_bsTiltX", 1e6*beamTiltX ); + auto beamTiltY_m = Monitored::Scalar<float>("m_bsTiltY", 1e6*beamTiltY ); scaleFactor = 1000.; // Use microns for some histograms when showing distance relative to beamspot PJ not used here?! fill(bsGroup,beamSpotX_m); diff --git a/InnerDetector/InDetMonitoring/SCT_Monitoring/python/TrackSummaryToolWorkaround.py b/InnerDetector/InDetMonitoring/SCT_Monitoring/python/TrackSummaryToolWorkaround.py index a66b8c0877b0c46476221270b46496095b0eae9d..94ec785dcd39a027db823c8d24c85b5cd9f7c37c 100644 --- a/InnerDetector/InDetMonitoring/SCT_Monitoring/python/TrackSummaryToolWorkaround.py +++ b/InnerDetector/InDetMonitoring/SCT_Monitoring/python/TrackSummaryToolWorkaround.py @@ -17,14 +17,7 @@ def TrackSummaryToolWorkaround(flags): # Taken from InnerDetector/InDetDigitization/PixelDigitization/python/PixelDigitizationConfigNew.py from PixelConditionsAlgorithms.PixelConditionsConfig import PixelConfigCondAlgCfg - result.merge(PixelConfigCondAlgCfg(flags, - UseCalibConditions=True, - UseDeadmapConditions=True, - UseDCSStateConditions=(not flags.Input.isMC and flags.InDet.usePixelDCS), - UseDCSStatusConditions=(not flags.Input.isMC and flags.InDet.usePixelDCS), - UseDCSHVConditions=True, - UseDCSTemperatureConditions=True, - UseTDAQConditions=False)) + result.merge(PixelConfigCondAlgCfg(flags)) from PixelConditionsTools.PixelConditionsSummaryConfig import PixelConditionsSummaryCfg InDetPixelConditionsSummaryTool = result.popToolsAndMerge(PixelConditionsSummaryCfg(flags)) diff --git a/InnerDetector/InDetMonitoring/SCT_Monitoring/share/strippedDown.py b/InnerDetector/InDetMonitoring/SCT_Monitoring/share/strippedDown.py index 9893bb893701206cd2843679531eab76066ff5c0..8e01402e827cd10bdfca9b9651080555414e709b 100644 --- a/InnerDetector/InDetMonitoring/SCT_Monitoring/share/strippedDown.py +++ b/InnerDetector/InDetMonitoring/SCT_Monitoring/share/strippedDown.py @@ -62,9 +62,6 @@ elif globalflags.InputFormat() == 'bytestream': #-------------------------------------------------------------- # include SCT Clusterization #-------------------------------------------------------------- -from PixelConditionsAlgorithms.PixelConditionsAlgorithmsConf import PixelConfigCondAlg -PixelConfigCondAlg.UseCalibConditions = False - from SiClusterizationTool.SiClusterizationToolConf import InDet__ClusterMakerTool InDetClusterMakerTool = InDet__ClusterMakerTool(name = "InDetClusterMakerTool") ToolSvc += InDetClusterMakerTool diff --git a/InnerDetector/InDetMonitoring/TRTMonitoringRun3/python/TRTMonitoringRun3ESD_Alg.py b/InnerDetector/InDetMonitoring/TRTMonitoringRun3/python/TRTMonitoringRun3ESD_Alg.py index c8782e93c6d42e220638ee563123d2660f188958..0a9c0ae2892e8fb87c22f208a90c11e1101ddd76 100644 --- a/InnerDetector/InDetMonitoring/TRTMonitoringRun3/python/TRTMonitoringRun3ESD_Alg.py +++ b/InnerDetector/InDetMonitoring/TRTMonitoringRun3/python/TRTMonitoringRun3ESD_Alg.py @@ -27,6 +27,10 @@ def TRTMonitoringRun3ESD_AlgConfig(inputFlags): algTRTMonitoringRun3ESD = helper.addAlgorithm(CompFactory.TRTMonitoringRun3ESD_Alg, 'AlgTRTMonitoringRun3') + # trigger flag + if not inputFlags.DQ.triggerDataAvailable: + algTRTMonitoringRun3ESD.TrigDecisionObjectName = '' + from AtlasGeoModel.AtlasGeoModelConfig import AtlasGeometryCfg result.merge(AtlasGeometryCfg(inputFlags)) diff --git a/InnerDetector/InDetMonitoring/TRTMonitoringRun3/src/TRTMonitoringRun3ESD_Alg.cxx b/InnerDetector/InDetMonitoring/TRTMonitoringRun3/src/TRTMonitoringRun3ESD_Alg.cxx index 3a45c7ae8d3332f1b3076666aad178a6892a1bb8..52264c55fa7621a4d2a5b87595ce755aa2ebcc7b 100644 --- a/InnerDetector/InDetMonitoring/TRTMonitoringRun3/src/TRTMonitoringRun3ESD_Alg.cxx +++ b/InnerDetector/InDetMonitoring/TRTMonitoringRun3/src/TRTMonitoringRun3ESD_Alg.cxx @@ -208,7 +208,7 @@ StatusCode TRTMonitoringRun3ESD_Alg::initialize() { ATH_CHECK( m_xAODEventInfoKey.initialize() ); ATH_CHECK( m_TRT_BCIDCollectionKey.initialize() ); ATH_CHECK( m_comTimeObjectKey.initialize() ); - ATH_CHECK( m_trigDecisionKey.initialize() ); + ATH_CHECK( m_trigDecisionKey.initialize(SG::AllowEmpty) ); return StatusCode::SUCCESS; } @@ -1333,8 +1333,8 @@ StatusCode TRTMonitoringRun3ESD_Alg::fillHistograms( const EventContext& ctx ) c SG::ReadHandle<xAOD::EventInfo> xAODEventInfo(m_xAODEventInfoKey, ctx); SG::ReadHandle<InDetTimeCollection> trtBCIDCollection(m_TRT_BCIDCollectionKey, ctx); SG::ReadHandle<ComTime> comTimeObject(m_comTimeObjectKey, ctx); - SG::ReadHandle<xAOD::TrigDecision> trigDecision(m_trigDecisionKey, ctx); - + const xAOD::TrigDecision* trigDecision = nullptr; + if (!xAODEventInfo.isValid()) { ATH_MSG_ERROR("Could not find event info object " << m_xAODEventInfoKey.key() << " in store"); @@ -1347,16 +1347,19 @@ StatusCode TRTMonitoringRun3ESD_Alg::fillHistograms( const EventContext& ctx ) c " in store"); return StatusCode::FAILURE; } - if (!trigDecision.isValid()) { - ATH_MSG_INFO("Could not find trigger decision object " << m_trigDecisionKey.key() << - " in store"); + if (! m_trigDecisionKey.empty()) { + trigDecision = SG::get(m_trigDecisionKey, ctx); + if (!trigDecision) { + ATH_MSG_INFO("Could not find trigger decision object " << m_trigDecisionKey.key() << + " in store"); + } } // NOTE: failing to retrieve ComTime from store for some reason if (!comTimeObject.isValid()) { ATH_MSG_INFO("Could not find com time object " << m_comTimeObjectKey.key() << " in store"); } - ATH_CHECK( fillTRTTracks(*trackCollection, trigDecision.cptr(), comTimeObject.cptr()) ); + ATH_CHECK( fillTRTTracks(*trackCollection, trigDecision, comTimeObject.cptr()) ); } if (!m_doTracksMon) { diff --git a/InnerDetector/InDetRawAlgs/InDetOverlay/test/TRTOverlay_test.cxx b/InnerDetector/InDetRawAlgs/InDetOverlay/test/TRTOverlay_test.cxx index 76a29520ee30bb260b9bbbcd91f85f608646b5ee..cdca827807065784c3626f248385edbf418d135e 100644 --- a/InnerDetector/InDetRawAlgs/InDetOverlay/test/TRTOverlay_test.cxx +++ b/InnerDetector/InDetRawAlgs/InDetOverlay/test/TRTOverlay_test.cxx @@ -73,11 +73,11 @@ namespace OverlayTesting { // dummy methods implementing in pure virtual interface methods (to make class non-abstract) /** Return the local occupancy for the sectors crossed by a given track */ - virtual float LocalOccupancy( const Trk::Track& ) const { return 1.0; }; // not used - dummy implementation - virtual float LocalOccupancy(const double, const double) const { return 1.0; }; // not used - dummy implementation + virtual float LocalOccupancy( const Trk::Track& ) const override { return 1.0; }; // not used - dummy implementation + virtual float LocalOccupancy(const double, const double) const override{ return 1.0; }; // not used - dummy implementation /** Return the global occupancy of the event*/ - virtual std::vector<float> GlobalOccupancy( ) const { std::vector<float> dummyVect{}; return dummyVect; }; // not used - dummy implementation + virtual std::vector<float> GlobalOccupancy( ) const override { std::vector<float> dummyVect{}; return dummyVect; }; // not used - dummy implementation }; DECLARE_COMPONENT( MockTRT_LocalOccupancy ) @@ -102,18 +102,18 @@ namespace OverlayTesting { return StatusCode::SUCCESS; }; - virtual int getStatus(const Identifier ) const { return 1; }; // not used - dummy implementation - virtual int getStatusPermanent(const Identifier) const { return 1; }; // not used - dummy implementation + virtual int getStatus(const Identifier ) const override { return 1; }; // not used - dummy implementation + virtual int getStatusPermanent(const Identifier) const override { return 1; }; // not used - dummy implementation MOCK_CONST_METHOD1(getStatusHT, int(const Identifier)); // This is the only method that we actually need! <-------------- - virtual bool get_status(const Identifier) const { return false; }; // not used - dummy implementation - virtual bool get_statusHT(const Identifier) const { return false; }; // not used - dummy implementation - virtual const StrawStatusContainer* getStrawStatusHTContainer() const {return nullptr;}; // not used - dummy implementation - - virtual int getStatus(const Identifier, const EventContext& ) const { return 1; }; // not used - dummy implementation - virtual int getStatusPermanent(const Identifier, const EventContext& ) const { return 1; }; // not used - dummy implementation - virtual int getStatusHT(const Identifier, const EventContext& ) const { return 1; }; // not used - dummy implementation - virtual bool get_status(const Identifier, const EventContext& ) const { return false; }; // not used - dummy implementation - virtual bool get_statusHT(const Identifier, const EventContext& ) const { return false; }; // not used - dummy implementation + virtual bool get_status(const Identifier) const override { return false; }; // not used - dummy implementation + virtual bool get_statusHT(const Identifier) const override { return false; }; // not used - dummy implementation + virtual const StrawStatusContainer* getStrawStatusHTContainer() const override {return nullptr;}; // not used - dummy implementation + + virtual int getStatus(const Identifier, const EventContext& ) const override { return 1; }; // not used - dummy implementation + virtual int getStatusPermanent(const Identifier, const EventContext& ) const override { return 1; }; // not used - dummy implementation + virtual int getStatusHT(const Identifier, const EventContext& ) const override { return 1; }; // not used - dummy implementation + virtual bool get_status(const Identifier, const EventContext& ) const override { return false; }; // not used - dummy implementation + virtual bool get_statusHT(const Identifier, const EventContext& ) const override { return false; }; // not used - dummy implementation }; diff --git a/InnerDetector/InDetRecAlgs/SiSPSeededTrackFinder/share/SiSPSeededTracksStandalone.py b/InnerDetector/InDetRecAlgs/SiSPSeededTrackFinder/share/SiSPSeededTracksStandalone.py index 3698aa44f90d365982a22940b96cbaf37268599d..c341ea7820e96b3e7b89a8b25d8e441d2ea114a1 100644 --- a/InnerDetector/InDetRecAlgs/SiSPSeededTrackFinder/share/SiSPSeededTracksStandalone.py +++ b/InnerDetector/InDetRecAlgs/SiSPSeededTrackFinder/share/SiSPSeededTracksStandalone.py @@ -247,24 +247,24 @@ if doPixel: else: IdMappingDat="PixelCabling/Pixels_Atlas_IdMapping_May08.dat" - condSeq += PixelConfigCondAlg(name="PixelConfigCondAlg", - UseDeadmapConditions=(not athenaCommonFlags.isOnline()), - UseDCSStateConditions=(globalflags.DataSource=='data') and InDetFlags.usePixelDCS(), - UseDCSStatusConditions=(globalflags.DataSource=='data') and InDetFlags.usePixelDCS(), - UseTDAQConditions=athenaCommonFlags.isOnline(), - ReadDeadMapKey="/PIXEL/PixMapOverlay", - UseCalibConditions=True, - UseCablingConditions=useCablingConditions, - CablingMapFileName=IdMappingDat) + alg = PixelConfigCondAlg(name="PixelConfigCondAlg", + UseCablingConditions=useCablingConditions, + CablingMapFileName=IdMappingDat) + if athenaCommonFlags.isOnline(): + alg.ReadDeadMapKey = '' + condSeq += alg if useNewDeadmapFormat: if not conddb.folderRequested("/PIXEL/PixelModuleFeMask"): conddb.addFolder("PIXEL_OFL", "/PIXEL/PixelModuleFeMask", className="CondAttrListCollection") if not hasattr(condSeq, "PixelDeadMapCondAlg"): from PixelConditionsAlgorithms.PixelConditionsAlgorithmsConf import PixelDeadMapCondAlg - condSeq += PixelDeadMapCondAlg(name="PixelDeadMapCondAlg") + alg = PixelDeadMapCondAlg(name="PixelDeadMapCondAlg",ReadKey="/PIXEL/PixelModuleFeMask") + if athenaCommonFlags.isOnline(): + alg.ReadKey = '' + condSeq += alg - if not athenaCommonFlags.isOnline(): + if globalflags.DataSource=='data' and InDetFlags.usePixelDCS(): if not conddb.folderRequested("/PIXEL/DCS/FSMSTATE"): conddb.addFolder("DCS_OFL", "/PIXEL/DCS/FSMSTATE", className="CondAttrListCollection") if not conddb.folderRequested("/PIXEL/DCS/FSMSTATUS"): @@ -442,7 +442,6 @@ if doPixel: InDetClusterMakerTool.PixelLorentzAngleTool = ToolSvc.PixelLorentzAngleTool else: InDetClusterMakerTool.PixelCablingSvc = None - InDetClusterMakerTool.PixelModuleData = "" InDetClusterMakerTool.PixelChargeCalibCondData = "" InDetClusterMakerTool.PixelLorentzAngleTool = None InDetClusterMakerTool.PixelOfflineCalibData = "" diff --git a/InnerDetector/InDetRecAlgs/SiSPSeededTrackFinder/share/SiSPSeededTracksStandaloneFromESD.py b/InnerDetector/InDetRecAlgs/SiSPSeededTrackFinder/share/SiSPSeededTracksStandaloneFromESD.py index ca041af9429607822e54be47f8915ad470a0e74a..a09c78c4d7d1e05a2e20c1eb5cb83daa7989716e 100644 --- a/InnerDetector/InDetRecAlgs/SiSPSeededTrackFinder/share/SiSPSeededTracksStandaloneFromESD.py +++ b/InnerDetector/InDetRecAlgs/SiSPSeededTrackFinder/share/SiSPSeededTracksStandaloneFromESD.py @@ -234,24 +234,24 @@ if doPixel: else: IdMappingDat="PixelCabling/Pixels_Atlas_IdMapping_May08.dat" - condSeq += PixelConfigCondAlg(name="PixelConfigCondAlg", - UseDeadmapConditions=(not athenaCommonFlags.isOnline()), - UseDCSStateConditions=(globalflags.DataSource=='data') and InDetFlags.usePixelDCS(), - UseDCSStatusConditions=(globalflags.DataSource=='data') and InDetFlags.usePixelDCS(), - UseTDAQConditions=athenaCommonFlags.isOnline(), - ReadDeadMapKey="/PIXEL/PixMapOverlay", - UseCalibConditions=True, - UseCablingConditions=useCablingConditions, - CablingMapFileName=IdMappingDat) + alg = PixelConfigCondAlg(name="PixelConfigCondAlg", + UseCablingConditions=useCablingConditions, + CablingMapFileName=IdMappingDat) + if athenaCommonFlags.isOnline(): + alg.ReadDeadMapKey = "" + condSeq += alg if useNewDeadmapFormat: if not conddb.folderRequested("/PIXEL/PixelModuleFeMask"): conddb.addFolder("PIXEL_OFL", "/PIXEL/PixelModuleFeMask", className="CondAttrListCollection") if not hasattr(condSeq, "PixelDeadMapCondAlg"): from PixelConditionsAlgorithms.PixelConditionsAlgorithmsConf import PixelDeadMapCondAlg - condSeq += PixelDeadMapCondAlg(name="PixelDeadMapCondAlg") + alg = PixelDeadMapCondAlg(name="PixelDeadMapCondAlg") + if athenaCommonFlags.isOnline(): + alg.ReadKey = "" + condSeq += alg - if not athenaCommonFlags.isOnline(): + if globalflags.DataSource=='data' and InDetFlags.usePixelDCS(): if not conddb.folderRequested("/PIXEL/DCS/FSMSTATE"): conddb.addFolder("DCS_OFL", "/PIXEL/DCS/FSMSTATE", className="CondAttrListCollection") if not conddb.folderRequested("/PIXEL/DCS/FSMSTATUS"): diff --git a/InnerDetector/InDetRecTools/InDetSecVxFinderTool/InDetSecVxFinderTool/InDetImprovedJetFitterVxFinder.h b/InnerDetector/InDetRecTools/InDetSecVxFinderTool/InDetSecVxFinderTool/InDetImprovedJetFitterVxFinder.h index da8aa4ff8e46730155227c84f84c1d9d55322821..ecc984ff3cc74672a0e04ccbb3afaa66204c1e69 100755 --- a/InnerDetector/InDetRecTools/InDetSecVxFinderTool/InDetSecVxFinderTool/InDetImprovedJetFitterVxFinder.h +++ b/InnerDetector/InDetRecTools/InDetSecVxFinderTool/InDetSecVxFinderTool/InDetImprovedJetFitterVxFinder.h @@ -14,6 +14,8 @@ christian.weiser@cern.ch changes: second version in January 2008! + 2008 (c) Atlas Detector Software + This class implements the finder functionality for using the JetFitter algorithm. It uses as input a ParticleJet and then gives the VxJetCandidate out after having performed the @@ -36,25 +38,18 @@ #include "TrkTrackLink/ITrackLink.h" namespace Trk { - class IVertexFitter; class TrackParticleBase; class VxSecVertexInfo; class VxJetCandidate; class RecVertex; - class JetFitterInitializationHelper; - class JetFitterHelper; - class JetFitterRoutines; - class ITrackSelectorTool; - class IExtrapolator; - class IVertexSeedFinder; - class IMode3dFinder; - class INeutralParticleParameterCalculator; - class IVxCandidateXAODVertex; } -namespace InDet -{ - class InDetJetFitterUtils; +// Hackathon: add any new package here +namespace InDet { + class JetFitterTrackSelectorTool; + class JetFitterTwoTrackVtxFinderTool; + class JetFitterV0FinderTool; + class JetFitterMultiStageFit; } namespace xAOD @@ -64,17 +59,11 @@ namespace xAOD namespace InDet { - // static const InterfaceID IID_InDetImprovedJetFitterVxFinder("InDetImprovedJetFitterVxFinder", 1, 0); - class InDetImprovedJetFitterVxFinder : public AthAlgTool, public ISecVertexInJetFinder { - + public: - - //static const InterfaceID& interfaceID() { - //return IID_InDetImprovedJetFitterVxFinder; - //} - + StatusCode initialize(); StatusCode finalize(); @@ -84,20 +73,13 @@ namespace InDet { ~InDetImprovedJetFitterVxFinder(); - Trk::VxSecVertexInfo* findSecVertex(const xAOD::Vertex & primaryVertex, - const TLorentzVector & jetMomentum, - const std::vector<const xAOD::IParticle*> & inputTracks) const; - - Trk::VxSecVertexInfo* findSecVertex(const Trk::RecVertex & primaryVertex, - const TLorentzVector & jetMomentum, - const std::vector<const Trk::TrackParticleBase*> & inputTracks) const; + virtual Trk::VxSecVertexInfo* findSecVertex(const xAOD::Vertex & primaryVertex, + const TLorentzVector & jetMomentum, + const std::vector<const xAOD::IParticle*> & inputTracks) const; private: - - Trk::VxSecVertexInfo* doTheFinding(const xAOD::Vertex & primaryVertex, //const Trk::RecVertex & primaryVertex , - const TLorentzVector & jetMomentum, - const std::vector<const Trk::ITrackLink*> & myTracks) const; - + + void sortTrackCollectionByPt( std::vector< const Trk::ITrackLink* >& ) const; Trk::VxJetCandidate* findSecVertex(const Trk::RecVertex & primaryVertex, const TLorentzVector & jetMomentum, @@ -109,115 +91,12 @@ namespace InDet { void doTheFit(Trk::VxJetCandidate* myJetCandidate, bool performClustering=true) const; - - ToolHandle<Trk::JetFitterInitializationHelper> m_initializationHelper; - ToolHandle<Trk::JetFitterHelper> m_helper; - ToolHandle<Trk::JetFitterRoutines> m_routines; - ToolHandle<Trk::ITrackSelectorTool> m_trkFilter; - ToolHandle<Trk::IExtrapolator> m_extrapolator; - ToolHandle<InDet::InDetJetFitterUtils> m_jetFitterUtils; - ToolHandle<Trk::IVertexSeedFinder> m_CrossDistancesSeedFinder; - ToolHandle<Trk::IMode3dFinder> m_mode3dfinder; - ToolHandle<Trk::IVertexFitter> m_SequentialVertexFitter; - //ToolHandle<Trk::INeutralParticleParameterCalculator> m_convUtils; - ToolHandle< Trk::IVxCandidateXAODVertex > m_VertexEdmFactory; - - - int m_maxNumDeleteIterations; - double m_vertexProbCut; - int m_maxClusteringIterations; - double m_vertexClusteringProbabilityCut; - double m_vertexClusteringProbabilityCutWithMass; - double m_vertexClusteringProbabilityCutWithMass0010; - double m_vertexClusteringProbabilityCutWithMass1015; - double m_vertexClusteringProbabilityCutWithMass1520; - double m_vertexClusteringProbabilityCutWithMass2025; - double m_vertexClusteringProbabilityCutWithMass2530; - double m_vertexClusteringProbabilityCutWithMass3040; - double m_vertexClusteringProbabilityCutWithMass4050; - double m_vertexClusteringProbabilityCutWithMass5060; - double m_vertexClusteringProbabilityCutWithMass6070; - double m_vertexClusteringTwoVtxMassForProbCut; - - bool m_useFastClustering; - - double m_cutCompatibilityPrimaryVertexForPositiveLifetimeTracks; - double m_cutCompatibilityPrimaryVertexForNegativeLifetimeTracks; - double m_twoVertexProbabilityCut; - double m_cutDeltaMKs; - double m_cutDeltaMLambda; - double m_cutDeltaMGamma; - double m_cutCompatibilityPrimaryVertexSingleTrackForKsAndLambda; - double m_cutCompatibilityPrimaryVertexBothTracksForKsAndLambda; - double m_cutTwoTrkVtxLifetimeSignificanceForKs; - double m_cutTwoTrkVtxLifetimeSignificanceForLambda; - double m_cutIPD0BothTracksCriteriumOneForKsAndLambda; - double m_cutIPZ0BothTracksCriteriumOneForKsAndLambda; - double m_cutTransverseTwoTrkVtxDistanceCriteriumTwoForKsAndLambda; - double m_cutCompatibilityChi2ToPrimaryNeutralTrackFromConversion; - double m_cutCompatibilityChi2ToPrimaryNeutralTrackFromKs; - double m_cutCompatibilityChi2ToPrimaryNeutralTrackFromLambda; - double m_cutCompatibilityPrimaryVertexSingleTrackForBFirstSelection; - double m_cutCompatibilityPrimaryVertexBothTracksForBFirstSelection; - double m_cutIPD0BothTracksForBFirstSelection; - double m_cutIPZ0BothTracksForBFirstSelection; - double m_cutPtBothTracksForBFirstSelection; - double m_cutTwoTrkVtxLifetimeSignificanceForBFirstSelectionFirstCriterium; - double m_cutTwoTrkVtxVertexProbForBFirstSelectionFirstCriterium; - double m_cutTwoTrkVtxLifetimeSignificanceForBFirstSelectionSecondCriterium; - double m_cutTwoTrkVtxVertexProbForBFirstSelectionSecondCriterium; -//material interaction removal... (is it usefull at all???) - double m_firstBeam_min; - double m_firstBeam_max; - double m_secondBeam_min; - double m_secondBeam_max; - double m_firstLayer_min; - double m_firstLayer_max; - double m_secondLayer_min; - double m_secondLayer_max; - double m_cutCompatibilityToPrimarySingleTrackForMatInteractions; - double m_cutCompatibilityToPrimaryBothTracksForMatInteractions; -//cuts for additional tracks (SecondSelection) - double m_cutIPD0SingleTrackForBSecondSelection; - double m_cutIPZ0SingleTrackForBSecondSelection; - double m_cutPtSingleTrackForBSecondSelection; - double m_cutIPD0SigBoxSingleTrackForBSecondSelection; //box cut for PU rejection in 1-t vtx - double m_cutIPZ0SigBoxSingleTrackForBSecondSelection; //box cut for PU rejection in 1-t vtx - double m_cutCompatibilityPrimaryVertexSinglePositiveLifetimeTrackForBSecondSelection; - double m_cutCompatibilityPrimaryVertexSingleNegativeLifetimeTrackForBSecondSelection; -//don't use the primary vertex finder information to estimate the compatibility! - double m_doNotUsePrimaryVertexCombatibilityInfo; -//invert the cuts for estimating the negative tags! - bool m_revertFromPositiveToNegativeTags; - - /* - * Avoid vertex to be initialize outside ID envelope given bu m_maxR and m_maxZ - */ - - double m_maxR; - double m_maxZ; - - std::string m_VxContainerName; - + private: + ToolHandle< JetFitterTrackSelectorTool > m_theTrackSelector {this,"JetFitterTrackSelectorTool","JetFitterTrackSelectorTool/JetFitterTrackSelectorTool",""}; //Hackathon addition + ToolHandle< JetFitterTwoTrackVtxFinderTool > m_theTwoTrackVtxFinderTool {this,"JetFitterTwoTrackVtxFinderTool","JetFitterV0FinderTool/JetFitterTwoTrackVtxFinderTool",""}; //Hackathon addition + ToolHandle< JetFitterV0FinderTool > m_theV0FinderTool {this,"JetFitterV0FinderTool","JetFitterV0FinderTool/JetFitterV0FinderTool",""}; //Hackathon addition + ToolHandle< JetFitterMultiStageFit > m_multiStageFitter {this,"JetFitterMultiStageFit","JetFitterMultiStageFit/JetFitterMultiStageFit",""}; //Hackathon addition - /* - * Number of tracks above which do not perform detailed clustering - * (to avoid explosion of combinatorics) - */ - - int m_maxTracksForDetailedClustering; - - /* - * sum pT dependent cuts on track pT - * pT(track)< pTMinOffset + pTsum * m_pTMinSlope - * OR pTsum - */ - bool m_usepTDepTrackSel; - double m_pTMinOffset; - double m_pTMinSlope; - double m_pTMax; - - };//end class declaration }//end namespace Rec diff --git a/InnerDetector/InDetRecTools/InDetSecVxFinderTool/InDetSecVxFinderTool/InDetJetFitterUtils.h b/InnerDetector/InDetRecTools/InDetSecVxFinderTool/InDetSecVxFinderTool/InDetJetFitterUtils.h index a85555615768d0a94c29016519d23626a2c78231..5079e999341f034f4ac44bcb828ea57bf3ce5d48 100644 --- a/InnerDetector/InDetRecTools/InDetSecVxFinderTool/InDetSecVxFinderTool/InDetJetFitterUtils.h +++ b/InnerDetector/InDetRecTools/InDetSecVxFinderTool/InDetSecVxFinderTool/InDetJetFitterUtils.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ /*************************************************************************** @@ -27,16 +27,20 @@ #include "CLHEP/Matrix/SymMatrix.h" #include "CLHEP/Matrix/Matrix.h" #include "CLHEP/Vector/LorentzVector.h" - +//#include "TrkParticleBase/LinkToTrackParticleBase.h" +//#include "TrkParticleBase/TrackParticleBaseCollection.h" +//#include "TrkParticleBase/TrackParticleBase.h" +//#include "TrkNeutralParameters/NeutralParameters.h" #include "TrkParameters/TrackParameters.h" #include "xAODTracking/Vertex.h" +#include "TrkExInterfaces/IExtrapolator.h" +#include "TrkVertexFitterInterfaces/IVertexLinearizedTrackFactory.h" + namespace Trk { class VxCandidate; class LinearizedTrack; - class IVertexLinearizedTrackFactory; class RecVertex; - class IExtrapolator; class Vertex; class LinkToTrackParticleBase; class ITrackLink; @@ -132,11 +136,9 @@ namespace InDet { const AmgSymMatrix(3) & vrt_weight) const; - - - ToolHandle<Trk::IVertexLinearizedTrackFactory> m_LinearizedTrackFactory; - ToolHandle<Trk::IExtrapolator> m_extrapolator; + ToolHandle<Trk::IVertexLinearizedTrackFactory> m_LinearizedTrackFactory {this,"LinearizedTrackFactory","Trk::FullLinearizedTrackFactory/FullLinearizedTrackFactory",""}; + ToolHandle<Trk::IExtrapolator> m_extrapolator {this,"Extrapolator","Trk::Extrapolator/InDetExtrapolator",""}; bool m_extrapolatorIsAvailable; bool m_linearizedTrackFactoryIsAvailable; diff --git a/InnerDetector/InDetRecTools/InDetSecVxFinderTool/InDetSecVxFinderTool/InDetJetFitterVxFinder.h b/InnerDetector/InDetRecTools/InDetSecVxFinderTool/InDetSecVxFinderTool/InDetJetFitterVxFinder.h index 9679b9e6fce85731b66af3a1f4f5e1d36105b489..c35aea272bb75610fe1f6438d0b95a8d34b9afef 100755 --- a/InnerDetector/InDetRecTools/InDetSecVxFinderTool/InDetSecVxFinderTool/InDetJetFitterVxFinder.h +++ b/InnerDetector/InDetRecTools/InDetSecVxFinderTool/InDetSecVxFinderTool/InDetJetFitterVxFinder.h @@ -33,7 +33,6 @@ #include "TrkParticleBase/TrackParticleBase.h" namespace Trk { - //class TrackParticleBase; class VxSecVertexInfo; class VxJetCandidate; class RecVertex; @@ -65,19 +64,18 @@ namespace InDet { ~InDetJetFitterVxFinder(); Trk::VxSecVertexInfo* findSecVertex(const xAOD::Vertex & /*primaryVertex*/, - const TLorentzVector & /*jetMomentum*/, - const std::vector<const xAOD::IParticle*> & /*inputTracks*/) const - { - /* not implemented */ - return 0; - } + const TLorentzVector & /*jetMomentum*/, + const std::vector<const xAOD::IParticle*> & /*inputTracks*/ ) const + { + /* not implemented */ + return 0; + } - - Trk::VxSecVertexInfo* findSecVertex(const Trk::RecVertex & primaryVertex, + const Trk::VxSecVertexInfo* findSecVertex(const Trk::RecVertex & primaryVertex, const TLorentzVector & jetMomentum, const std::vector<const Trk::TrackParticleBase*> & inputTracks) const; - Trk::VxSecVertexInfo* findSecVertex(const Trk::RecVertex & primaryVertex, + const Trk::VxSecVertexInfo* findSecVertex(const Trk::RecVertex & primaryVertex, const TLorentzVector & jetMomentum, const std::vector<const Trk::TrackParticleBase*> & firstInputTracks, const std::vector<const Trk::TrackParticleBase*> & secondInputTracks, @@ -88,20 +86,19 @@ namespace InDet { void doTheFit(Trk::VxJetCandidate* myJetCandidate, bool performClustering=true) const; - - ToolHandle<Trk::JetFitterInitializationHelper> m_initializationHelper; - ToolHandle<Trk::JetFitterHelper> m_helper; - ToolHandle<Trk::JetFitterRoutines> m_routines; - ToolHandle<Trk::ITrackSelectorTool> m_trkFilter; + ToolHandle< Trk::JetFitterInitializationHelper > m_initializationHelper {this,"JetFitterInitializationHelper","Trk::JetFitterInitializationHelper",""}; + ToolHandle< Trk::JetFitterHelper > m_helper {this,"JetFitterHelper","Trk::JetFitterHelper",""}; + ToolHandle< Trk::JetFitterRoutines > m_routines {this,"JetFitterRoutines","Trk::JetFitterRoutines",""}; + ToolHandle< Trk::ITrackSelectorTool > m_trkFilter {this,"TrackSelector","InDet::InDetDetailedTrackSelectorTool",""}; - int m_maxNumDeleteIterations; - float m_vertexProbCut; - int m_maxClusteringIterations; - float m_vertexClusteringProbabilityCut; - bool m_useFastClustering; + Gaudi::Property< int > m_maxNumDeleteIterations {this,"MaxNumDeleteIterations",30,""}; + Gaudi::Property< float > m_vertexProbCut {this,"VertexProbCut",0.01,""}; + Gaudi::Property< int > m_maxClusteringIterations {this,"MaxClusteringIterations",30,""}; + Gaudi::Property< float > m_vertexClusteringProbabilityCut {this,"VertexClusteringProbabilityCut",0.01,""}; + Gaudi::Property< bool > m_useFastClustering {this,"UseFastClustering",false,""}; - int m_maxTracksToFitAtOnce; + Gaudi::Property< int > m_maxTracksToFitAtOnce {this,"MaxTracksToFitAtOnce",15,""}; };//end class declaration diff --git a/InnerDetector/InDetRecTools/InDetSecVxFinderTool/InDetSecVxFinderTool/JetFitterMultiStageFit.h b/InnerDetector/InDetRecTools/InDetSecVxFinderTool/InDetSecVxFinderTool/JetFitterMultiStageFit.h new file mode 100644 index 0000000000000000000000000000000000000000..f5308e779b83e947d7a5101b87053893359fe4e7 --- /dev/null +++ b/InnerDetector/InDetRecTools/InDetSecVxFinderTool/InDetSecVxFinderTool/JetFitterMultiStageFit.h @@ -0,0 +1,92 @@ +/* + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration +*/ + +/* + * This tooltakes the tracks divided into those for a first fit, and additional tracks for a second + * It initializes a jet candidate, which consists of vertices with tracks fitted to them + * It runs the full JetFitter fitting algorithm, that is the merge cluster and kalman fit + * It returns the JetFitter output info + */ + +#include "AthenaBaseComps/AthAlgTool.h" +#include "GaudiKernel/ToolHandle.h" +#include "TrkTrackLink/ITrackLink.h" +#include "TLorentzVector.h" + +#include "TrkJetVxFitter/JetFitterRoutines.h" +#include "TrkJetVxFitter/JetFitterHelper.h" +#include "TrkJetVxFitter/JetFitterInitializationHelper.h" +#include "InDetSecVxFinderTool/InDetJetFitterUtils.h" + +namespace Trk { + class VxJetCandidate; + class RecVertex; +} + +namespace InDet { + + +static const InterfaceID IID_JetFitterMultiStageFit("JetFitterMultiStageFit", 1, 0); + +class JetFitterMultiStageFit : public AthAlgTool { +public: + + static const InterfaceID &interfaceID() { + return IID_JetFitterMultiStageFit; + } + + StatusCode initialize(); + + StatusCode finalize(); + + JetFitterMultiStageFit(const std::string &t, const std::string &n, const IInterface *p); + + ~JetFitterMultiStageFit(); + + /* + * Method for performing the two stage fit + */ + Trk::VxJetCandidate* doTwoStageFit( const Trk::RecVertex & primaryVertex, + const TLorentzVector & jetMomentum, + const std::vector<const Trk::ITrackLink*> & firstInputTracks, + const std::vector<const Trk::ITrackLink*> & secondInputTracks, + const Amg::Vector3D & vtxSeedDirection) const; + + +private: + /* + * Method which runs the merge procedure, at each cycle using the kalman filter + */ + void doTheFit(Trk::VxJetCandidate* myJetCandidate, + bool performClustering=true) const; + + ToolHandle< Trk::JetFitterInitializationHelper > m_initializationHelper {this,"JetFitterInitializationHelper","Trk::JetFitterInitializationHelper",""}; + ToolHandle< Trk::JetFitterHelper > m_helper {this,"JetFitterHelper","Trk::JetFitterHelper",""}; + ToolHandle< Trk::JetFitterRoutines > m_routines {this,"JetFitterRoutines","Trk::JetFitterRoutines",""}; + ToolHandle< InDet::InDetJetFitterUtils > m_jetFitterUtils {this,"InDetJetFitterUtils","InDet::InDetJetFitterUtils/InDetJetFitterUtils",""}; + + Gaudi::Property< int > m_maxNumDeleteIterations {this,"MaxNumDeleteIterations",30,""}; + Gaudi::Property< double > m_vertexProbCut {this,"VertexProbCut",0.001,""}; + Gaudi::Property< int > m_maxClusteringIterations {this,"MaxClusteringIterations",30,""}; + + Gaudi::Property< bool > m_useFastClustering {this,"UseFastClustering",false,""}; + + // to avoid combinatoric slow down, limit on max tracks for detailed clustering + Gaudi::Property< int > m_maxTracksForDetailedClustering {this,"maxTracksForDetailedClustering",25,""}; + + Gaudi::Property< double > m_vertexClusteringProbabilityCut {this,"VertexClusteringProbabilityCut",0.005,""}; + Gaudi::Property< double > m_vertexClusteringProbabilityCutWithMass {this,"VertexClusteringProbabilityCutWithMass",0.05,""}; + Gaudi::Property< double > m_vertexClusteringProbabilityCutWithMass0010 {this,"VertexClusteringProbabilityCutWithMass0010",0.002,""}; + Gaudi::Property< double > m_vertexClusteringProbabilityCutWithMass1015 {this,"VertexClusteringProbabilityCutWithMass1015",0.002,""}; + Gaudi::Property< double > m_vertexClusteringProbabilityCutWithMass1520 {this,"VertexClusteringProbabilityCutWithMass1520",0.050,""}; + Gaudi::Property< double > m_vertexClusteringProbabilityCutWithMass2025 {this,"VertexClusteringProbabilityCutWithMass2025",0.100,""}; + Gaudi::Property< double > m_vertexClusteringProbabilityCutWithMass2530 {this,"VertexClusteringProbabilityCutWithMass2530",0.200,""}; + Gaudi::Property< double > m_vertexClusteringProbabilityCutWithMass3040 {this,"VertexClusteringProbabilityCutWithMass3040",0.500,""}; + Gaudi::Property< double > m_vertexClusteringProbabilityCutWithMass4050 {this,"VertexClusteringProbabilityCutWithMass4050",0.700,""}; + Gaudi::Property< double > m_vertexClusteringProbabilityCutWithMass5060 {this,"VertexClusteringProbabilityCutWithMass5060",0.900,""}; + Gaudi::Property< double > m_vertexClusteringProbabilityCutWithMass6070 {this,"VertexClusteringProbabilityCutWithMass6070",0.900,""}; + +}; + +} diff --git a/InnerDetector/InDetRecTools/InDetSecVxFinderTool/InDetSecVxFinderTool/JetFitterTrackSelectorTool.h b/InnerDetector/InDetRecTools/InDetSecVxFinderTool/InDetSecVxFinderTool/JetFitterTrackSelectorTool.h new file mode 100644 index 0000000000000000000000000000000000000000..e8d4d1a1eaa101ecddb5c6554fe2f5740fdb1e29 --- /dev/null +++ b/InnerDetector/InDetRecTools/InDetSecVxFinderTool/InDetSecVxFinderTool/JetFitterTrackSelectorTool.h @@ -0,0 +1,73 @@ +/* + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration +*/ + +/* + * This tooltakes the input track collection of a jet candidate + * It runs a filter on track quality + * And separates tracks into primary vertex and secondary vertex tracks + * By computing their compatibility with the primary vertex + */ + +#ifndef JETFITTER_TRACKSELECTOR_TOOL_H +#define JETFITTER_TRACKSELECTOR_TOOL_H 1 + +#include "AthenaBaseComps/AthAlgTool.h" +#include "GaudiKernel/ToolHandle.h" + +#include "VxJetVertex/SelectedTracksInJet.h" +#include "xAODTracking/Vertex.h" + +#include "TrkExInterfaces/IExtrapolator.h" +#include "InDetSecVxFinderTool/InDetJetFitterUtils.h" +#include "TrkToolInterfaces/ITrackSelectorTool.h" +#include "xAODTracking/TrackParticleContainer.h" + +#include "TrkLinks/LinkToXAODTrackParticle.h" +#include "TrkTrackLink/ITrackLink.h" + +#include "VxVertex/RecVertex.h" + +namespace InDet { + + static const InterfaceID IID_JetFitterTrackSelectorTool("JetFitterTrackSelectorTool", 1, 0); + + class JetFitterTrackSelectorTool : public AthAlgTool { + public: + + static const InterfaceID& interfaceID() { + return IID_JetFitterTrackSelectorTool; + } + + StatusCode initialize(); + StatusCode finalize(); + + JetFitterTrackSelectorTool(const std::string &t, const std::string &n, const IInterface *p); + ~JetFitterTrackSelectorTool(); + + /* + * method for performing track selection + */ + const Trk::SelectedTracksInJet* doTrackSelection(const xAOD::Vertex &primaryVertex, + const TLorentzVector &jetMomentum, + const std::vector<const xAOD::IParticle *> &inputTracks) const; + + private: + int computeTrackCompatibility( const xAOD::Vertex &primaryVertex, + const TLorentzVector &jetMomentum, + const xAOD::TrackParticle &trk_iter ) const; + + private: + ToolHandle< Trk::IExtrapolator > m_extrapolator {this,"Extrapolator","Trk::Extrapolator/InDetExtrapolator",""}; + ToolHandle< InDet::InDetJetFitterUtils > m_jetFitterUtils {this,"InDetJetFitterUtils","InDet::InDetJetFitterUtils/InDetJetFitterUtils",""}; + ToolHandle< Trk::ITrackSelectorTool > m_trkFilter {this,"TrackSelector","InDet::InDetDetailedTrackSelectorTool",""}; + + private: + Gaudi::Property< bool > m_revertFromPositiveToNegativeTags {this,"revertFromPositiveToNegativeTags",false,""}; + Gaudi::Property< double > m_cutCompatibilityPrimaryVertexForPositiveLifetimeTracks {this,"cutCompPrimaryVertexForPosLifetimeTracks",1e-1,""}; + Gaudi::Property< double > m_cutCompatibilityPrimaryVertexForNegativeLifetimeTracks {this,"cutCompPrimaryVertexForNegLifetimeTracks",5e-2,""}; + }; + +} + +#endif diff --git a/InnerDetector/InDetRecTools/InDetSecVxFinderTool/InDetSecVxFinderTool/JetFitterTwoTrackVtxFinderTool.h b/InnerDetector/InDetRecTools/InDetSecVxFinderTool/InDetSecVxFinderTool/JetFitterTwoTrackVtxFinderTool.h new file mode 100644 index 0000000000000000000000000000000000000000..31f881c669a8310aea33660685e5636c333a43e9 --- /dev/null +++ b/InnerDetector/InDetRecTools/InDetSecVxFinderTool/InDetSecVxFinderTool/JetFitterTwoTrackVtxFinderTool.h @@ -0,0 +1,57 @@ +/* + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration +*/ + +#ifndef JETFITTER_TWOTRACKVTX_FINDER_TOOL_H +#define JETFITTER_TWOTRACKVTX_FINDER_TOOL_H 1 + +#include "AthenaBaseComps/AthAlgTool.h" +#include "GaudiKernel/ToolHandle.h" + +#include "VxJetVertex/TwoTrackVerticesInJet.h" +#include "TrkVertexFitterInterfaces/IVertexSeedFinder.h" +#include "TrkVertexFitterInterfaces/IVertexFitter.h" + +namespace InDet { + + static const InterfaceID IID_JetFitterTwoTrackVtxFinderTool("JetFitterTwoTrackVtxFinderTool", 1, 0); + + class JetFitterTwoTrackVtxFinderTool : public AthAlgTool { + public: + + static const InterfaceID& interfaceID() { + return IID_JetFitterTwoTrackVtxFinderTool; + } + + JetFitterTwoTrackVtxFinderTool(const std::string &t, const std::string &n, const IInterface *p); + ~JetFitterTwoTrackVtxFinderTool(); + + StatusCode initialize(); + StatusCode finalize(); + + const Trk::TwoTrackVerticesInJet* doVertexFinding( const xAOD::Vertex&, + const TLorentzVector&, + std::vector< const Trk::ITrackLink* >& ) const; + + + private: + xAOD::Vertex* computeVtxcandidate( const xAOD::Vertex&, + const TLorentzVector&, + const Trk::ITrackLink* trackA, + const Trk::ITrackLink* trackB ) const; + + private: + ToolHandle< Trk::IVertexSeedFinder > m_CrossDistancesSeedFinder {this,"CrossDistancesSeedFinder","Trk::CrossDistancesSeedFinder/CrossDistancesSeedFinder",""}; + ToolHandle< Trk::IVertexFitter > m_SequentialVertexFitter {this,"SequentialVertexFitter","Trk::SequentialVertexFitter/SequentialVertexFitter",""}; + + SG::AuxElement::Decorator< std::vector< const Trk::ITrackLink* > > m_tracksDecorator; + + Gaudi::Property< double > m_maxR {this,"ID_maxR",1150.,""}; + Gaudi::Property< double > m_maxZ {this,"ID_maxZ",2727.,""}; + Gaudi::Property< double > m_twoVertexProbabilityCut {this,"twoVertexProbabilityCut",3.4e-2,""}; + Gaudi::Property< bool > m_revertFromPositiveToNegativeTags {this,"revertFromPositiveToNegativeTags",false,""}; + }; + +} + +#endif diff --git a/InnerDetector/InDetRecTools/InDetSecVxFinderTool/InDetSecVxFinderTool/JetFitterV0FinderTool.h b/InnerDetector/InDetRecTools/InDetSecVxFinderTool/InDetSecVxFinderTool/JetFitterV0FinderTool.h new file mode 100644 index 0000000000000000000000000000000000000000..28a09ed32f2e2686f7a054a980be6373cf12ce74 --- /dev/null +++ b/InnerDetector/InDetRecTools/InDetSecVxFinderTool/InDetSecVxFinderTool/JetFitterV0FinderTool.h @@ -0,0 +1,106 @@ +/* + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration +*/ + +#ifndef JETFITTER_V0FINDER_TOOL_H +#define JETFITTER_V0FINDER_TOOL_H 1 + +#include "AthenaBaseComps/AthAlgTool.h" +#include "GaudiKernel/ToolHandle.h" + +#include "VxJetVertex/TwoTrackVerticesInJet.h" +#include "TrkVertexFitterInterfaces/IVertexSeedFinder.h" +#include "TrkVertexFitterInterfaces/IVertexFitter.h" +#include "InDetSecVxFinderTool/InDetJetFitterUtils.h" +#include "TrkVertexSeedFinderUtils/IMode3dFinder.h" + +namespace InDet { + + static const InterfaceID IID_JetFitterV0FinderTool("JetFitterV0FinderTool", 1, 0); + + class JetFitterV0FinderTool : public AthAlgTool { + public: + + static const InterfaceID& interfaceID() { + return IID_JetFitterV0FinderTool; + } + + StatusCode initialize(); + StatusCode finalize(); + + JetFitterV0FinderTool(const std::string &t, const std::string &n, const IInterface *p); + ~JetFitterV0FinderTool(); + + const Trk::TwoTrackVerticesInJet* doV0Finding( const xAOD::Vertex&, + const TLorentzVector&, + std::vector< const Trk::ITrackLink* >&, + const std::vector< const xAOD::Vertex* >&, + std::vector< const Trk::ITrackLink* >&, + std::vector< const Trk::ITrackLink* >&, + Amg::Vector3D& ) const; + + private: + std::vector< const xAOD::Vertex* > findV0candidates( const xAOD::Vertex&, + const TLorentzVector&, + std::vector< const Trk::ITrackLink* >&, + const std::vector< const xAOD::Vertex* >& ) const; + + bool checkCriteriaFirstFit( const xAOD::Vertex&, + const TLorentzVector&, + const xAOD::Vertex& ) const; + + bool checkCriteriaSecondFit( const xAOD::Vertex&, + const Trk::ITrackLink* ) const; + + Amg::Vector3D computeSeedDirection( const xAOD::Vertex&, + const TLorentzVector&, + const std::vector< Trk::PositionAndWeight >& ) const; + + private: + ToolHandle< InDet::InDetJetFitterUtils > m_jetFitterUtils {this,"InDetJetFitterUtils","InDet::InDetJetFitterUtils/InDetJetFitterUtils",""}; + ToolHandle< Trk::IMode3dFinder > m_mode3dfinder {this,"Mode3dFinder","Trk::Mode3dTo1dFinder/Mode3dTo1dFinder",""}; + + private: + SG::AuxElement::Accessor< float > m_compatibilityAccessor; + SG::AuxElement::Accessor< std::vector< const Trk::ITrackLink* > > m_tracksAccessor; + + private: + // @brief + Gaudi::Property< bool > m_revertFromPositiveToNegativeTags {this,"revertFromPositiveToNegativeTags",false,""}; + + Gaudi::Property< double > m_cutTwoTrkVtxVertexProbForBFirstSelectionFirstCriterium {this,"cutTwoTrkVtxVtxProbForBFirstSelectCriteriumA",0.05,""}; + Gaudi::Property< double > m_cutTwoTrkVtxVertexProbForBFirstSelectionSecondCriterium {this,"cutTwoTrkVtxVtxProbForBFirstSelectCriteriumB",0.034,""}; + + Gaudi::Property< double > m_cutCompatibilityPrimaryVertexSingleTrackForBFirstSelection {this,"cutCompatibilityPrimaryVertexSingleTrackForBFirstSelection",1e-1,""}; + Gaudi::Property< double > m_cutCompatibilityPrimaryVertexBothTracksForBFirstSelection {this,"cutCompatibilityPrimaryVertexBothTracksForBFirstSelection",1e-2,""}; + Gaudi::Property< double > m_cutIPD0BothTracksForBFirstSelection {this,"cutIPD0BothTracksForBFirstSelection",3.5,""}; + Gaudi::Property< double > m_cutIPZ0BothTracksForBFirstSelection {this,"cutIPZ0BothTracksForBFirstSelection",5.,""}; + Gaudi::Property< double > m_cutPtBothTracksForBFirstSelection {this,"cutPtBothTracksForBFirstSelection",500.,""}; + + Gaudi::Property< double > m_cutTwoTrkVtxLifetimeSignificanceForBFirstSelectionFirstCriterium {this,"cutTwoTrkVtxLifeSignForBFirstSelectCriteriumA",1.,""}; + Gaudi::Property< double > m_cutTwoTrkVtxLifetimeSignificanceForBFirstSelectionSecondCriterium {this,"cutTwoTrkVtxLifeSignForBFirstSelectCriteriumB",1.5,""}; + Gaudi::Property< double > m_cutCompatibilityToPrimarySingleTrackForMatInteractions {this,"cutCompToPrimarySingleTrackForMatInterac",1e-4,""}; + Gaudi::Property< double > m_cutCompatibilityToPrimaryBothTracksForMatInteractions {this,"cutCompToPrimaryBothTracksForMatInterac",1e-6,""}; + + Gaudi::Property< double > m_firstBeam_min {this,"firstBeam_min",23,""}; + Gaudi::Property< double > m_firstBeam_max {this,"firstBeam_max",25,""}; + Gaudi::Property< double > m_secondBeam_min {this,"secondBeam_min",23,""}; + Gaudi::Property< double > m_secondBeam_max {this,"secondBeam_max",25,""}; + Gaudi::Property< double > m_firstLayer_min {this,"firstLayer_min",34.0-2.5,""}; + Gaudi::Property< double > m_firstLayer_max {this,"firstLayer_max",34.0+2.5,""}; + Gaudi::Property< double > m_secondLayer_min {this,"secondLayer_min",51.5-3,""}; + Gaudi::Property< double > m_secondLayer_max {this,"secondLayer_max",51.5+3,""}; + + Gaudi::Property< double > m_cutCompatibilityPrimaryVertexSinglePositiveLifetimeTrackForBSecondSelection {this,"cutCompPVSinglePosLifeTrackForBSecondSelect",5e-2,""}; + Gaudi::Property< double > m_cutCompatibilityPrimaryVertexSingleNegativeLifetimeTrackForBSecondSelection {this,"cutCompPVSingleNegLifeTrackForBSecondSelect",1e-2,""}; + Gaudi::Property< double > m_cutIPD0SigBoxSingleTrackForBSecondSelection {this,"cutIPD0SigBoxSingleTrackForBSecondSelection",2.,""}; + Gaudi::Property< double > m_cutIPZ0SigBoxSingleTrackForBSecondSelection {this,"cutIPZ0SigBoxSingleTrackForBSecondSelection",5.,""}; + + Gaudi::Property< double > m_cutIPD0SingleTrackForBSecondSelection {this,"cutIPD0SingleTrackForBSecondSelection",1.5,""}; + Gaudi::Property< double > m_cutIPZ0SingleTrackForBSecondSelection {this,"cutIPZ0SingleTrackForBSecondSelection",3.,""}; + Gaudi::Property< double > m_cutPtSingleTrackForBSecondSelection {this,"cutPtSingleTrackForBSecondSelection",750,""}; + }; + +} + +#endif diff --git a/InnerDetector/InDetRecTools/InDetSecVxFinderTool/src/InDetImprovedJetFitterVxFinder.cxx b/InnerDetector/InDetRecTools/InDetSecVxFinderTool/src/InDetImprovedJetFitterVxFinder.cxx index 65fec3770c00b215de4a24de7219f88b4ebf3be7..6c1a49d750a893da03a28bfd11dc4c9326118dd9 100755 --- a/InnerDetector/InDetRecTools/InDetSecVxFinderTool/src/InDetImprovedJetFitterVxFinder.cxx +++ b/InnerDetector/InDetRecTools/InDetSecVxFinderTool/src/InDetImprovedJetFitterVxFinder.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ /*************************************************************************** @@ -11,19 +11,19 @@ email : nicola.giacinto.piacquadio@cern.ch changes: new version in January 2008! + + 2008 (c) Atlas Detector Software Look at the header file for more information. ***************************************************************************/ + #include "InDetSecVxFinderTool/InDetImprovedJetFitterVxFinder.h" #include "VxJetVertex/VxJetCandidate.h" #include "VxJetVertex/PairOfVxVertexOnJetAxis.h" #include "VxJetVertex/VxVertexOnJetAxis.h" #include "VxJetVertex/VxClusteringTable.h" -#include "TrkJetVxFitter/JetFitterHelper.h" -#include "TrkJetVxFitter/JetFitterInitializationHelper.h" -#include "TrkJetVxFitter/JetFitterRoutines.h" #include "VxSecVertex/VxJetFitterVertexInfo.h" #include <TMath.h> #include "TrkEventPrimitives/FitQuality.h" @@ -31,15 +31,9 @@ #include "VxVertex/RecVertex.h" #include "TrkTrack/Track.h" #include "TrkTrack/LinkToTrack.h" -#include "TrkToolInterfaces/ITrackSelectorTool.h" -#include "TrkExInterfaces/IExtrapolator.h" -#include "TrkVertexSeedFinderUtils/IMode3dFinder.h" -#include "TrkVertexFitters/SequentialVertexFitter.h" #include "TrkEventPrimitives/VertexType.h" #include "TrkSurfaces/PerigeeSurface.h" -#include "InDetSecVxFinderTool/InDetJetFitterUtils.h" #include "TrkNeutralParameters/NeutralParameters.h" -#include "TrkVertexSeedFinderTools/CrossDistancesSeedFinder.h" #include "TrkVertexSeedFinderUtils/SeedFinderParamDefs.h" #include "CLHEP/Vector/LorentzVector.h" #include "CLHEP/Vector/ThreeVector.h" @@ -56,7 +50,13 @@ //17.5.2015 This is for the EDM migration #include "TrkLinks/LinkToXAODTrackParticle.h" -#include "TrkVxEdmCnv/IVxCandidateXAODVertex.h" + +// Hackathon includes +#include "InDetSecVxFinderTool/JetFitterTrackSelectorTool.h" +#include "InDetSecVxFinderTool/JetFitterTwoTrackVtxFinderTool.h" +#include "InDetSecVxFinderTool/JetFitterV0FinderTool.h" +#include "InDetSecVxFinderTool/JetFitterMultiStageFit.h" + #define InDetImprovedJetFitterVxFinder_DEBUGAddOns @@ -84,188 +84,10 @@ namespace InDet }; InDetImprovedJetFitterVxFinder::InDetImprovedJetFitterVxFinder(const std::string& t, const std::string& n, const IInterface* p) : - AthAlgTool(t,n,p), - m_initializationHelper("Trk::JetFitterInitializationHelper",this), - m_helper("Trk::JetFitterHelper",this), - m_routines("Trk::JetFitterRoutines",this), - m_trkFilter("InDet::InDetDetailedTrackSelectorTool",this), - m_extrapolator("Trk::Extrapolator/InDetExtrapolator",this), - m_jetFitterUtils("InDet::InDetJetFitterUtils/InDetJetFitterUtils",this), - m_CrossDistancesSeedFinder("Trk::CrossDistancesSeedFinder/CrossDistancesSeedFinder",this), - m_mode3dfinder("Trk::Mode3dTo1dFinder/Mode3dTo1dFinder",this), - m_SequentialVertexFitter("Trk::SequentialVertexFitter/SequentialVertexFitter",this), - //m_convUtils("Trk::NeutralParticleParameterCalculator"), - m_VertexEdmFactory("Trk::VertexInternalEdmFactory",this), - m_maxNumDeleteIterations(30), - m_vertexProbCut(0.001), - m_maxClusteringIterations(30), - m_vertexClusteringProbabilityCut(0.005),//GP 11/6/16: changed to default in job option file - m_vertexClusteringProbabilityCutWithMass(0.05),//GP 11/7/16: keep default to not active - m_vertexClusteringProbabilityCutWithMass0010(0.002),//MB Mass dependent cut - m_vertexClusteringProbabilityCutWithMass1015(0.002),//MB Mass dependent cut - m_vertexClusteringProbabilityCutWithMass1520(0.050),//MB Mass dependent cut - m_vertexClusteringProbabilityCutWithMass2025(0.100),//MB Mass dependent cut - m_vertexClusteringProbabilityCutWithMass2530(0.200),//MB Mass dependent cut - m_vertexClusteringProbabilityCutWithMass3040(0.500),//MB Mass dependent cut - m_vertexClusteringProbabilityCutWithMass4050(0.700),//MB Mass dependent cut - m_vertexClusteringProbabilityCutWithMass5060(0.900),//MB Mass dependent cut - m_vertexClusteringProbabilityCutWithMass6070(0.900),//MB Mass dependent cut - m_vertexClusteringTwoVtxMassForProbCut(2000), - m_useFastClustering(false), - m_cutCompatibilityPrimaryVertexForPositiveLifetimeTracks(1e-1), - m_cutCompatibilityPrimaryVertexForNegativeLifetimeTracks(5e-2), - m_twoVertexProbabilityCut(3.4e-2), - m_cutDeltaMKs(18.), - m_cutDeltaMLambda(7.), - m_cutDeltaMGamma(30.), - m_cutCompatibilityPrimaryVertexSingleTrackForKsAndLambda(1e-3), - m_cutCompatibilityPrimaryVertexBothTracksForKsAndLambda(1e-4), - m_cutTwoTrkVtxLifetimeSignificanceForKs(4.5), - m_cutTwoTrkVtxLifetimeSignificanceForLambda(4.5), - m_cutIPD0BothTracksCriteriumOneForKsAndLambda(1.), - m_cutIPZ0BothTracksCriteriumOneForKsAndLambda(2.), - m_cutTransverseTwoTrkVtxDistanceCriteriumTwoForKsAndLambda(20.), - m_cutCompatibilityChi2ToPrimaryNeutralTrackFromConversion(36), - m_cutCompatibilityChi2ToPrimaryNeutralTrackFromKs(36), - m_cutCompatibilityChi2ToPrimaryNeutralTrackFromLambda(36), - m_cutCompatibilityPrimaryVertexSingleTrackForBFirstSelection(1e-1), - m_cutCompatibilityPrimaryVertexBothTracksForBFirstSelection(1e-2), - m_cutIPD0BothTracksForBFirstSelection(3.5), - m_cutIPZ0BothTracksForBFirstSelection(5.), - m_cutPtBothTracksForBFirstSelection(500.), - m_cutTwoTrkVtxLifetimeSignificanceForBFirstSelectionFirstCriterium(1.), - m_cutTwoTrkVtxVertexProbForBFirstSelectionFirstCriterium(0.05), - m_cutTwoTrkVtxLifetimeSignificanceForBFirstSelectionSecondCriterium(1.5), - m_cutTwoTrkVtxVertexProbForBFirstSelectionSecondCriterium(0.034), - m_firstBeam_min(23), //29.35-1.5*0.68), - m_firstBeam_max(25), //35+1.5*0.68), - m_secondBeam_min(23), //34.18-1.5*0.65), - m_secondBeam_max(25), //34.18+1.5*0.65), - m_firstLayer_min(34.0-2.5), //57.5) - m_firstLayer_max(34.0+2.5), //46.5), - m_secondLayer_min(51.5-3), //70.5-1.5*2.1), - m_secondLayer_max(51.5+3), //70.5+1.5*2.1), - m_cutCompatibilityToPrimarySingleTrackForMatInteractions(1e-4), - m_cutCompatibilityToPrimaryBothTracksForMatInteractions(1e-6), - m_cutIPD0SingleTrackForBSecondSelection(1.5), - m_cutIPZ0SingleTrackForBSecondSelection(3.), - m_cutPtSingleTrackForBSecondSelection(750.), - m_cutIPD0SigBoxSingleTrackForBSecondSelection(2.), //0 effectively disables the cut - m_cutIPZ0SigBoxSingleTrackForBSecondSelection(5.), - m_cutCompatibilityPrimaryVertexSinglePositiveLifetimeTrackForBSecondSelection(5e-2), - m_cutCompatibilityPrimaryVertexSingleNegativeLifetimeTrackForBSecondSelection(1e-2), - m_doNotUsePrimaryVertexCombatibilityInfo(false), - m_revertFromPositiveToNegativeTags(false), - m_maxR(1150.),//max R of ID - m_maxZ(2727.),//max Z of ID - m_VxContainerName("PrimaryVertices"), - m_maxTracksForDetailedClustering(25), - m_usepTDepTrackSel(false), - m_pTMinOffset(800),//MeV - m_pTMinSlope(0.01),//MeV(track cut)/MeV(sum of track pT) - m_pTMax(600e3)//MeV--> stop at 600 GeV sum of track pT + AthAlgTool(t,n,p) { - //JetFitter tools - declareProperty("JetFitterHelper",m_helper); - declareProperty("JetFitterInitializationHelper",m_initializationHelper); - declareProperty("JetFitterRoutines",m_routines); - - //JetFinder tools - declareProperty("InDetJetFitterUtils",m_jetFitterUtils); - - //Tracking tools - declareProperty("Extrapolator",m_extrapolator); - declareProperty("TrackSelector",m_trkFilter); - - //Vertexing tools - declareProperty("CrossDistancesSeedFinder",m_CrossDistancesSeedFinder); - declareProperty("Mode3dFinder",m_mode3dfinder); - declareProperty("SequentialVertexFitter",m_SequentialVertexFitter); - - //Name of primary vertex container - declareProperty("VxPrimaryContainer", m_VxContainerName); - - //Properties which steer the JetFitter clustering operations - declareProperty("MaxNumDeleteIterations",m_maxNumDeleteIterations); - declareProperty("VertexProbCut",m_vertexProbCut); - declareProperty("MaxClusteringIterations",m_maxClusteringIterations); - declareProperty("VertexClusteringProbabilityCut",m_vertexClusteringProbabilityCut); - declareProperty("VertexClusteringProbabilityCutWithMass",m_vertexClusteringProbabilityCutWithMass); - declareProperty("vertexClusteringTwoVtxMassForProbCut",m_vertexClusteringTwoVtxMassForProbCut); - declareProperty("UseFastClustering",m_useFastClustering); - - declareProperty("VertexClusteringProbabilityCutWithMass0010",m_vertexClusteringProbabilityCutWithMass0010); - declareProperty("VertexClusteringProbabilityCutWithMass1015",m_vertexClusteringProbabilityCutWithMass1015); - declareProperty("VertexClusteringProbabilityCutWithMass1520",m_vertexClusteringProbabilityCutWithMass1520); - declareProperty("VertexClusteringProbabilityCutWithMass2025",m_vertexClusteringProbabilityCutWithMass2025); - declareProperty("VertexClusteringProbabilityCutWithMass2530",m_vertexClusteringProbabilityCutWithMass2530); - declareProperty("VertexClusteringProbabilityCutWithMass3040",m_vertexClusteringProbabilityCutWithMass3040); - declareProperty("VertexClusteringProbabilityCutWithMass4050",m_vertexClusteringProbabilityCutWithMass4050); - declareProperty("VertexClusteringProbabilityCutWithMass5060",m_vertexClusteringProbabilityCutWithMass5060); - declareProperty("VertexClusteringProbabilityCutWithMass6070",m_vertexClusteringProbabilityCutWithMass6070); - - //Cuts which steer the finding in the seeding phase before JetFitter (yes, so many!!!) - declareProperty("cutCompPrimaryVertexForPosLifetimeTracks",m_cutCompatibilityPrimaryVertexForPositiveLifetimeTracks); - declareProperty("cutCompPrimaryVertexForNegLifetimeTracks",m_cutCompatibilityPrimaryVertexForNegativeLifetimeTracks); - declareProperty("twoVertexProbabilityCut",m_twoVertexProbabilityCut); - declareProperty("cutDeltaMKs",m_cutDeltaMKs); - declareProperty("cutDeltaMLambda",m_cutDeltaMLambda); - declareProperty("cutDeltaMGamma",m_cutDeltaMGamma); - declareProperty("cutCompPrimaryVertexSingleTrackForKsAndLambda",m_cutCompatibilityPrimaryVertexSingleTrackForKsAndLambda); - declareProperty("cutCompPrimaryVertexBothTracksForKsAndLambda",m_cutCompatibilityPrimaryVertexBothTracksForKsAndLambda); - declareProperty("cutTwoTrkVtxLifetimeSignificanceForKs",m_cutTwoTrkVtxLifetimeSignificanceForKs); - declareProperty("cutTwoTrkVtxLifetimeSignificanceForLambda",m_cutTwoTrkVtxLifetimeSignificanceForLambda); - declareProperty("cutIPD0BothTracksCriteriumAForKsAndLambda",m_cutIPD0BothTracksCriteriumOneForKsAndLambda); - declareProperty("cutIPZ0BothTracksCriteriumAForKsAndLambda",m_cutIPZ0BothTracksCriteriumOneForKsAndLambda); - declareProperty("cutTransvTwoTrkVtxDistCriteriumBForKsAndLambda",m_cutTransverseTwoTrkVtxDistanceCriteriumTwoForKsAndLambda); - declareProperty("cutCompChi2ToPrimaryNeutTrkFromConversion",m_cutCompatibilityChi2ToPrimaryNeutralTrackFromConversion); - declareProperty("cutCompChi2ToPrimaryNeutTrkFromKs",m_cutCompatibilityChi2ToPrimaryNeutralTrackFromKs); - declareProperty("cutCompChi2ToPrimaryNeutTrkFromLambda",m_cutCompatibilityChi2ToPrimaryNeutralTrackFromLambda); - declareProperty("cutCompPrimaryVertexSingleTrackForBFirstSelect",m_cutCompatibilityPrimaryVertexSingleTrackForBFirstSelection); - declareProperty("cutCompPrimaryVertexBothTracksForBFirstSelect",m_cutCompatibilityPrimaryVertexBothTracksForBFirstSelection); - declareProperty("cutIPD0BothTracksForBFirstSelection",m_cutIPD0BothTracksForBFirstSelection); - declareProperty("cutIPZ0BothTracksForBFirstSelection",m_cutIPZ0BothTracksForBFirstSelection); - declareProperty("cutPtBothTracksForBFirstSelection",m_cutPtBothTracksForBFirstSelection); - declareProperty("cutIPD0SigBoxSingleTrackForBSecondSelection",m_cutIPD0SigBoxSingleTrackForBSecondSelection); - declareProperty("cutIPZ0SigBoxSingleTrackForBSecondSelection",m_cutIPZ0SigBoxSingleTrackForBSecondSelection); - declareProperty("cutTwoTrkVtxLifeSignForBFirstSelectCriteriumA",m_cutTwoTrkVtxLifetimeSignificanceForBFirstSelectionFirstCriterium); - declareProperty("cutTwoTrkVtxVtxProbForBFirstSelectCriteriumA",m_cutTwoTrkVtxVertexProbForBFirstSelectionFirstCriterium); - declareProperty("cutTwoTrkVtxLifeSignForBFirstSelectCriteriumB",m_cutTwoTrkVtxLifetimeSignificanceForBFirstSelectionSecondCriterium); - declareProperty("cutTwoTrkVtxVtxProbForBFirstSelectCriteriumB",m_cutTwoTrkVtxVertexProbForBFirstSelectionSecondCriterium); - declareProperty("firstBeam_min",m_firstBeam_min); - declareProperty("secondBeam_min",m_secondBeam_min); - declareProperty("secondBeam_max",m_secondBeam_max); - declareProperty("firstLayer_min",m_firstLayer_min); - declareProperty("firstLayer_max",m_firstLayer_max); - declareProperty("secondLayer_min",m_secondLayer_min); - declareProperty("secondLayer_max",m_secondLayer_max); - declareProperty("cutCompToPrimarySingleTrackForMatInterac",m_cutCompatibilityToPrimarySingleTrackForMatInteractions); - declareProperty("cutCompToPrimaryBothTracksForMatInterac",m_cutCompatibilityToPrimaryBothTracksForMatInteractions); - declareProperty("cutIPD0SingleTrackForBSecondSelection",m_cutIPD0SingleTrackForBSecondSelection); - declareProperty("cutIPZ0SingleTrackForBSecondSelection",m_cutIPZ0SingleTrackForBSecondSelection); - declareProperty("cutPtSingleTrackForBSecondSelection",m_cutPtSingleTrackForBSecondSelection); - declareProperty("cutCompPVSinglePosLifeTrackForBSecondSelect",m_cutCompatibilityPrimaryVertexSinglePositiveLifetimeTrackForBSecondSelection); - declareProperty("cutCompPVSingleNegLifeTrackForBSecondSelect",m_cutCompatibilityPrimaryVertexSingleNegativeLifetimeTrackForBSecondSelection); - declareProperty("doNotUsePVCombInfo",m_doNotUsePrimaryVertexCombatibilityInfo); - declareProperty("ID_maxR",m_maxR); - declareProperty("ID_maxZ",m_maxZ); - - declareProperty("revertFromPositiveToNegativeTags",m_revertFromPositiveToNegativeTags); - - declareProperty("maxTracksForDetailedClustering",m_maxTracksForDetailedClustering); - - //declareProperty("ConversionUtils", m_convUtils,"Name of conversion utility"); - - declareProperty("VertexEdmFactory", m_VertexEdmFactory); - - declareProperty("usepTDepTrackSel",m_usepTDepTrackSel); - declareProperty("pTMinOffset",m_pTMinOffset); - declareProperty("pTMinSlope",m_pTMinSlope); - declareProperty("pTMax",m_pTMax); - - + // new package for hackathon declareInterface< ISecVertexInJetFinder >(this) ; - } @@ -274,80 +96,31 @@ namespace InDet StatusCode InDetImprovedJetFitterVxFinder::initialize() { - StatusCode sc = AlgTool::initialize(); - if(sc.isFailure()) - { - msg(MSG::ERROR)<<" Unable to initialize the AlgTool"<<endmsg; - return sc; - } - - //retrieving the udator itself - sc = m_helper.retrieve(); - if(sc.isFailure()) { - msg(MSG::ERROR) << " Unable to retrieve "<<m_helper<<endmsg; - return StatusCode::FAILURE; - }else msg(MSG::INFO) << "JetFitter Helper retrieved"<<endmsg; - - - sc = m_initializationHelper.retrieve(); - if(sc.isFailure()) { - msg(MSG::ERROR) << " Unable to retrieve "<<m_initializationHelper<<endmsg; - return StatusCode::FAILURE; - }else msg(MSG::INFO) << "JetFitter Initialization Helper retrieved"<<endmsg; - - sc = m_routines.retrieve(); - if(sc.isFailure()) - { - msg(MSG::ERROR) << " Unable to retrieve the JetFitter routines"<<m_routines<<endmsg; - return StatusCode::FAILURE; + if(sc.isFailure()) { + msg(MSG::ERROR)<<" Unable to initialize the AlgTool"<<endmsg; + return sc; } - else msg(MSG::INFO) << "JetFitter Routines class retrieved"<<endmsg; - if(m_trkFilter.retrieve().isFailure()) - { - msg(MSG::ERROR) << " Unable to retrieve "<<m_trkFilter<<endmsg; + if (m_theTrackSelector.retrieve().isFailure()) { + msg(MSG::ERROR) << "Could not find TrackSelector tool." << endmsg; return StatusCode::FAILURE; - } - else msg(MSG::INFO) << "Track filter retrieved"<<endmsg; - + } else msg(MSG::INFO) << " JetFitterTrackSelector retrieved" << endmsg; - if (m_jetFitterUtils.retrieve().isFailure()) - { - msg(MSG::ERROR) << "Could not find JetFitterUtils tool." << endmsg; + if (m_theTwoTrackVtxFinderTool.retrieve().isFailure()) { + msg(MSG::ERROR) << "Could not find TwoTrackVtxFinder tool." << endmsg; return StatusCode::FAILURE; - } - else msg(MSG::INFO) << " JetFitterUtils retrieved" << endmsg; + } else msg(MSG::INFO) << " JetFitterTwoTrackVtxFinder retrieved" << endmsg; - if (m_CrossDistancesSeedFinder.retrieve().isFailure()) - { - msg(MSG::ERROR) << "Could not find CrossDistancesSeedFinder tool." << endmsg; + if (m_theV0FinderTool.retrieve().isFailure()) { + msg(MSG::ERROR) << "Could not find V0Finder tool." << endmsg; return StatusCode::FAILURE; - } else msg(MSG::INFO) << " CrossDistancesSeedFinder tool retrieved" << endmsg; - - if (m_mode3dfinder.retrieve().isFailure()) - { - msg(MSG::ERROR) << "Could not find mode3dfinder tool." << endmsg; - return StatusCode::FAILURE; - } else msg(MSG::INFO) << " Mode3DFinder tool retrieved" << endmsg; + } else msg(MSG::INFO) << " JetFitterV0Finder retrieved" << endmsg; - if (m_SequentialVertexFitter.retrieve().isFailure()) - { - msg(MSG::ERROR) << "Could not get the sequential vertex fitter tool."<<endmsg; + if (m_multiStageFitter.retrieve().isFailure()) { + msg(MSG::ERROR) << "Could not find JetFitterMultiStageFit tool." << endmsg; return StatusCode::FAILURE; - } else msg(MSG::INFO) << " Sequential vertex fitter retrieved " << endmsg; - - if (m_extrapolator.retrieve().isFailure()) - { - msg(MSG::ERROR) << "Could not find extrapolator tool." << endmsg; - return StatusCode::FAILURE; - } else msg(MSG::INFO) << " Extrapolator retrieved " << endmsg; - - sc = m_VertexEdmFactory.retrieve(); - if(sc.isFailure()) { - msg(MSG::ERROR) << "Unable to retrieve" << m_VertexEdmFactory <<endmsg; - return StatusCode::FAILURE; - } else msg(MSG::INFO) << " xAOD vertex converter retrieved " <<endmsg; + } else msg(MSG::INFO) << " JetFitterMultiStageFit retrieved" << endmsg; msg(MSG::INFO) << "Initialize successful" << endmsg; return StatusCode::SUCCESS; @@ -361,1894 +134,132 @@ namespace InDet } - Trk::VxSecVertexInfo* - InDetImprovedJetFitterVxFinder::findSecVertex(const xAOD::Vertex & primaryVertex, - const TLorentzVector & jetMomentum, - const std::vector<const xAOD::IParticle*> & inputTracks) const{ - - std::vector<const Trk::ITrackLink*> selectedTracks; - std::vector<const xAOD::IParticle*>::const_iterator trk_iter; - double sumpT=0; - for (trk_iter= inputTracks.begin(); trk_iter != inputTracks.end(); ++trk_iter){ - const xAOD::TrackParticle * tmp=dynamic_cast<const xAOD::TrackParticle *> ((*trk_iter)); - if (!tmp or !m_trkFilter->decision(*tmp,&primaryVertex)){ - continue; - } - if (!m_usepTDepTrackSel){ - ElementLink<xAOD::TrackParticleContainer> linkTP; - linkTP.setElement(const_cast<xAOD::TrackParticle*>(tmp)); - Trk::LinkToXAODTrackParticle* link= new Trk::LinkToXAODTrackParticle(linkTP); - selectedTracks.push_back(link); - }else{ - sumpT+=tmp->pt(); - } - } - if (m_usepTDepTrackSel){ - for (trk_iter= inputTracks.begin(); trk_iter != inputTracks.end(); ++trk_iter){ - const xAOD::TrackParticle * tmp=dynamic_cast<const xAOD::TrackParticle *> ((*trk_iter)); - if (!tmp or !m_trkFilter->decision(*tmp,&primaryVertex)){ - continue; - } - if (!((tmp->pt()>m_pTMinOffset + sumpT * m_pTMinSlope) - || - (sumpT > m_pTMax && tmp->pt()>m_pTMinOffset+m_pTMax* m_pTMinSlope))){ - continue; - } - ElementLink<xAOD::TrackParticleContainer> linkTP; - linkTP.setElement(const_cast<xAOD::TrackParticle*>(tmp)); - Trk::LinkToXAODTrackParticle* link= new Trk::LinkToXAODTrackParticle(linkTP); - selectedTracks.push_back(link); - } - } - Trk::RecVertex dummy; - Trk::VxSecVertexInfo* secVxInfo=doTheFinding(primaryVertex, - jetMomentum, - selectedTracks); - - return secVxInfo; - } - - - Trk::VxSecVertexInfo* InDetImprovedJetFitterVxFinder::findSecVertex(const Trk::RecVertex & primaryVertex, - const TLorentzVector & jetMomentum, - const std::vector<const Trk::TrackParticleBase*> & myTracks) const { - if (msgLvl(MSG::VERBOSE)) msg() << " Starting findSecVertex " << endmsg; - - std::vector<const Trk::ITrackLink*> selectedTracks; - - std::vector<const Trk::TrackParticleBase*>::const_iterator tracksBegin=myTracks.begin(); - std::vector<const Trk::TrackParticleBase*>::const_iterator tracksEnd=myTracks.end(); - for (std::vector<const Trk::TrackParticleBase*>::const_iterator tracksIter=tracksBegin; - tracksIter!=tracksEnd;++tracksIter) { - if (m_trkFilter->decision(**tracksIter,&primaryVertex)==true) { - - if (msgLvl(MSG::VERBOSE)) msg() << " Adding new ElementLink " << endmsg; - - ElementLink<Trk::TrackParticleBaseCollection> link; - link.setElement(const_cast<Trk::TrackParticleBase*>(*tracksIter)); - Trk::LinkToTrackParticleBase * linkTT = new Trk::LinkToTrackParticleBase(link); -// linkTT->setStorableObject(*trackTES); - selectedTracks.push_back(linkTT); - } - } - - xAOD::Vertex dummy; - return doTheFinding(dummy, - jetMomentum, - selectedTracks); - } - - - - Trk::VxSecVertexInfo* InDetImprovedJetFitterVxFinder::doTheFinding(const xAOD::Vertex & primaryVertex, //const Trk::RecVertex & /* primaryVertex */, - const TLorentzVector & jetMomentum, - const std::vector<const Trk::ITrackLink*> & myTracks) const + Trk::VxSecVertexInfo* InDetImprovedJetFitterVxFinder::findSecVertex(const xAOD::Vertex & primaryVertex, + const TLorentzVector & jetMomentum, + const std::vector<const xAOD::IParticle*> & inputTracks) const { - - if (msgLvl(MSG::VERBOSE)) msg() << " doTheFinding called " << endmsg; - - //some fundamental masses - //I know they are hard coded here... - //sorry for this!! - const double s_masspion=139.57018; - const double s_masselectron=0.511; - const double s_massproton=938.272; - const double s_massks=497.648; - const double s_masslambda=1115.683; - - StatusCode sc; + // This function when called performs JetFitter secondary vertex finding + // It returns the JetFitter Vertex Info, VxJetFitterVertexInfo: + // The VxJetCandidate, the TwoTrackVerticesInJet (V0s and neutrals), the selected tracks (primary and secondary) + // So we need to do track selection, v0 finding, and then the fit with JetFitter. -// //get the primary vertex information -// const xAOD::VertexContainer* myVxContainer(0); -// StatusCode sc = evtStore()->retrieve(myVxContainer,m_VxContainerName); -// if (sc.isFailure()) { -// msg(MSG::ERROR) << m_VxContainerName << " not found in StoreGate." << endmsg; -// return 0; -// } // -// xAOD::Vertex* xAODprimaryVertex(0); -// -// xAOD::VertexContainer::const_iterator fz_end=myVxContainer->end(); -// for (xAOD::VertexContainer::const_iterator fz = myVxContainer->begin(); fz != fz_end; ++fz) -// { -// if ((*fz)->vertexType() == xAOD::VxType::PriVtx) -// { -// xAODprimaryVertex = *fz; -// break; -// } -// } -// -// if (!xAODprimaryVertex) -// { -// if (myVxContainer->size() > 0) -// { -// xAODprimaryVertex = *myVxContainer->begin(); -// } -// } - -// xAOD::Vertex xAODprimaryVertex(primaryVertex); - - - Trk::VxCandidate* signalVertex=0; - sc = m_VertexEdmFactory->createVxCandidate(primaryVertex, signalVertex); - if (sc.isFailure()) { - msg(MSG::ERROR) << m_VertexEdmFactory << " fail to createVxCandidate." << endmsg; - return 0; - } +// // Initial track selection, track filter applied, separate primary and secondary tracks + const Trk::SelectedTracksInJet* mySelectedTracksInJet = m_theTrackSelector->doTrackSelection( primaryVertex, jetMomentum, inputTracks ); + ATH_MSG_DEBUG( "the selected tracks now are " << mySelectedTracksInJet ); + std::vector< const Trk::ITrackLink* > primaryTracks = mySelectedTracksInJet->getPrimaryTrackLinks(); + std::vector< const Trk::ITrackLink* > secondaryTracks = mySelectedTracksInJet->getSecondaryTrackLinks(); - if (signalVertex==0) - { - if (msgLvl(MSG::WARNING)) msg() << " No primary vertex in collection for jetfitter... No secondary vertices fit can be performed" << endmsg; - } - const Trk::RecVertex& primaryVertexRecVertex = signalVertex->recVertex(); - - //create a Vector where you will store the compatibilites to the tracks in myTracks - std::map<const Trk::ITrackLink*,double> compatibilityOfTrack; - - //create other variables for later: primary tracks and secondary tracks - std::vector<const Trk::ITrackLink*> primaryTracks; - std::vector<const Trk::ITrackLink*> secondaryTracks; + // Two track vertex candidates + const Trk::TwoTrackVerticesInJet* twoTrackVertexCandidates = m_theTwoTrackVtxFinderTool->doVertexFinding( primaryVertex, jetMomentum, secondaryTracks ); + const std::vector< const xAOD::Vertex* > vertexCandidates = twoTrackVertexCandidates->getTwoTrackVertice(); - //here all the V0candidates will be stored - std::vector<const xAOD::Vertex*> V0candidates; - std::map<const Trk::ITrackLink*,const Trk::ITrackLink*> fromLinkInV0CandidateToOriginalLink; - - //here the Neutral Tracks to store as TrackParticleBase - //(identified conversions,Lambdas and Ks) - //std::vector<const Trk::TrackParticleBase*> neutralTracks; - std::vector<const Trk::LinkToTrackParticleBase*> neutralTracks; - - //one further information you absolutely need is: - //the mass information... (horrible map again) - std::map<const Trk::TrackParticleBase*,double> massOfNeutralTrack; - - //here the tracks for the first fit (higher purity) and for the second fit will be stored - std::vector<const Trk::ITrackLink*> tracksToUseInFirstFit; - std::vector<const Trk::ITrackLink*> tracksToUseInSecondFit; - - //positionAndWeight for the vertices which will be used as - //a first estimate of the B-flight direction to increase - //the fit reliability (JetFitter's linearization is strongly - //affected by the direction of the B-hardon flight axis) - std::vector<Trk::PositionAndWeight> positionsOfSeedingVertices; - - //store the number of found material interactions - int numberFirstBeamInteractions=0; - int numberSecondBeamInteractions=0; - int numberFirstLayerInteractions=0; - int numberSecondLayerInteractions=0; - +// // V0 finding AND further track selection, these could even be further separated +// // neutral identification, material interactions, ..., a lot is done here + std::vector< const Trk::ITrackLink* > tracksToUseInFirstFit; + std::vector< const Trk::ITrackLink* > tracksToUseInSecondFit; + Amg::Vector3D JFseedDirection; - //now you have the list of tracks... - //that's already something! - //now you need to get the compatibility of the tracks - //(you want to use the primary vertex chi2 if this is NEEDED) + const Trk::TwoTrackVerticesInJet* myTwoTrackVerticesInJet = m_theV0FinderTool->doV0Finding( primaryVertex, jetMomentum, secondaryTracks, vertexCandidates, + tracksToUseInFirstFit, tracksToUseInSecondFit, JFseedDirection ); - if (msgLvl(MSG::VERBOSE)) msg() << " JetFitterFinding phase 1: getting the compatibilities of all tracks to the primary vertex... " << endmsg; + // Sort track collection by pT + ATH_MSG_DEBUG( "Sorting track collection (tracksToUseInFirstFit) by pT..." ); + sortTrackCollectionByPt( tracksToUseInFirstFit ); + ATH_MSG_DEBUG( "Sorting track collection (tracksToUseInSecondFit) by pT..." ); + sortTrackCollectionByPt( tracksToUseInSecondFit ); - std::vector<Trk::VxTrackAtVertex*>::const_iterator trkBegin=signalVertex->vxTrackAtVertex()->begin(); - std::vector<Trk::VxTrackAtVertex*>::const_iterator trkEnd=signalVertex->vxTrackAtVertex()->end(); - - std::vector<const Trk::ITrackLink*>::const_iterator qualitytracksBegin=myTracks.begin(); - std::vector<const Trk::ITrackLink*>::const_iterator qualitytracksEnd=myTracks.end(); - - int countDebug=0; - - for (std::vector<const Trk::ITrackLink*>::const_iterator qualitytracksIter=qualitytracksBegin; - qualitytracksIter!=qualitytracksEnd;++qualitytracksIter) - { - - bool matched=false; - - const Trk::ITrackLink * trkTrackLink=*qualitytracksIter; - - const Trk::LinkToTrackParticleBase * trkCastedLinkTPBase= - dynamic_cast<const Trk::LinkToTrackParticleBase *>(trkTrackLink); - -// const Trk::LinkToTrack * trkCastedLinkT= -// dynamic_cast<const Trk::LinkToTrack *>(trkTrackLink); - - const Trk::LinkToXAODTrackParticle* trkCastedLinkTPxAOD= - dynamic_cast<const Trk::LinkToXAODTrackParticle *>(trkTrackLink); - - if (!trkCastedLinkTPxAOD && !trkCastedLinkTPBase) - { - if (msgLvl(MSG::WARNING)) msg() << " One track among the selected ones is neither an xAOD::TrackParticle nor a TrackParticle. Skipping track..." << endmsg; - continue; - } - - //obtain the wanted perigee now - - //needed for extrapolation (later to get the IP 3d sign) - Trk::PerigeeSurface mySurface(primaryVertexRecVertex.position()); - - //const Trk::Perigee* myMeasuredPerigee=0; - - if (msgLvl(MSG::VERBOSE)) msg() << "PV position " << primaryVertexRecVertex.position().x() << " " << primaryVertexRecVertex.position().y() << " " << primaryVertexRecVertex.position().z() << endmsg; - - const Trk::TrackParameters* myMeasuredPerigee=nullptr; - - if (trkCastedLinkTPBase) - { - - const Trk::TrackParticleBase & myTrackParticleBase=***trkCastedLinkTPBase; - - const Trk::TrackParameters * definingParameters=&(myTrackParticleBase.definingParameters()); - //const Trk::Perigee* perigeeBeforeExtrapolation= definingParameters.perigee(); - - - //if (perigeeBeforeExtrapolation==0) - //{ - // if (msgLvl(MSG::WARNING)) msg() << "No Perigee at TrackParticleBase: this is a problem!" << endmsg; - // continue; - //} - -// myMeasuredPerigee=dynamic_cast<const Trk::MeasuredPerigee*>(m_extrapolator->extrapolate(myTrackParticleBase, -// mySurface)); - - myMeasuredPerigee = m_extrapolator->extrapolateDirectly(*definingParameters,mySurface); - - - } - - if (trkCastedLinkTPxAOD) - { - const xAOD::TrackParticle & myTrack=***trkCastedLinkTPxAOD; - myMeasuredPerigee=m_extrapolator->extrapolate(myTrack,mySurface); - } - - if (!myMeasuredPerigee) - { - msg(MSG::WARNING) << " Extrapolation to primary vertex failed. Skipping track " << endmsg; - continue; - } - - if (!m_doNotUsePrimaryVertexCombatibilityInfo) - { - - for (std::vector<Trk::VxTrackAtVertex*>::const_iterator trkIter=trkBegin;trkIter!=trkEnd;++trkIter) - { - - const Trk::ITrackLink * vtxTrackLink=(*trkIter)->trackOrParticleLink(); - - - const Trk::LinkToTrackParticleBase * vtxCastedLinkTPBase= - dynamic_cast<const Trk::LinkToTrackParticleBase *>(vtxTrackLink); - - - const Trk::LinkToXAODTrackParticle* vtxCastedLinkTPxAOD= - dynamic_cast<const Trk::LinkToXAODTrackParticle *>(vtxTrackLink); - - - bool case11=vtxCastedLinkTPBase&&trkCastedLinkTPBase&& - &(***vtxCastedLinkTPBase)==&(***trkCastedLinkTPBase); - - - bool case22=trkCastedLinkTPxAOD&&vtxCastedLinkTPxAOD&& - &(***vtxCastedLinkTPxAOD)==&(***trkCastedLinkTPxAOD); - - - if (!case11 && !case22) - { -#ifdef InDetImprovedJetFitterVxFinder_DEBUGAddOns - if ((trkCastedLinkTPBase&&vtxCastedLinkTPxAOD)||(trkCastedLinkTPxAOD&&vtxCastedLinkTPBase)) - { - if (countDebug%500==0) - { - if (msgLvl(MSG::DEBUG)) msg() << " Jet Fitter Vertex Finding is done on TrackParticleBase, primary vertex information is stored based on xAOD::TrackParticleBase or viceversa." << endmsg; - if (msgLvl(MSG::DEBUG)) msg() << " Cannot use the fit of primary vertex for estimating the compatibility to the primary vertex. No correlation between primary vertex fit and track will be considered. Please activate PV REFITTING on AOD..." << endmsg; - } - countDebug+=1; - } -#endif - continue; - } - - if (case11&&case22) - { - msg(MSG::WARNING) << " Throwing exception " << endmsg; - throw std::string("Internal algorithmic error in InDetImprovedJetFitterVxFinder"); - } - - - const Trk::FitQuality & fitQuality=(*trkIter)->trackQuality(); - double withoutSign=fitQuality.chiSquared(); - - - if (fitQuality.chiSquared()==0.) - { - withoutSign=m_jetFitterUtils->compatibility(*myMeasuredPerigee,primaryVertexRecVertex).first; - } - - - - //now assign a sign to the found track (respect to the jet momentum direction) - Amg::Vector3D jetMomSpatial(jetMomentum.X(),jetMomentum.Y(),jetMomentum.Z()); - withoutSign=fabs(withoutSign)*m_jetFitterUtils->get3DLifetimeSignOfTrack(*myMeasuredPerigee, - jetMomSpatial, - primaryVertexRecVertex); - - compatibilityOfTrack[*qualitytracksIter]=withoutSign; - - //temporary: to check that everything is fine, notice if the result without considering - //that the track was part in the fit is consistent/similar to the correct onw... -#ifdef InDetImprovedJetFitterVxFinder_DEBUGAddOns + delete twoTrackVertexCandidates; +// +// // One last complication, primaryVertex needs to be a different object (old edm) +// // see lines 524-537 in old code and create primaryVertexRecVertex using the vertex edm factory - if (fitQuality.chiSquared()>0.) - { - double WouldBe=m_jetFitterUtils->compatibility(*myMeasuredPerigee,primaryVertexRecVertex).first; + Trk::RecVertex primaryVertexRecVertex( primaryVertex.position(), + primaryVertex.covariancePosition(), + primaryVertex.numberDoF(), + primaryVertex.chiSquared()); - if (fabs(WouldBe/fitQuality.chiSquared()-1)>0.02) - { - if (msgLvl(MSG::VERBOSE)) msg() << " Probability mismatch: 1st vertex chi2 is: " << fitQuality.chiSquared() << - " while a posteriori chi2 is: " << WouldBe << endmsg; - - if (msgLvl(MSG::VERBOSE)) msg() << "d0/s(d0)" << myMeasuredPerigee->parameters()[Trk::d0]/Amg::error(*myMeasuredPerigee->covariance(),Trk::d0) - << "z0/s(z0)" << myMeasuredPerigee->parameters()[Trk::z0]/Amg::error(*myMeasuredPerigee->covariance(),Trk::z0) << endmsg; - - } - } - // else - // { - // if (msgLvl(MSG::VERBOSE)) msg() << " Probability match: 1st vertex chi2 is: " << fitQuality.chiSquared() << - // " while a posteriori chi2 is: " << WouldBe << endmsg; - // } - -#endif - matched=true; - } - - } - else - { - if (msgLvl(MSG::VERBOSE)) msg() << " Not using any primary vertex information for track compatibilities." << endmsg; - } - - if (!matched) - { - double actualcomp=m_jetFitterUtils->compatibility(*myMeasuredPerigee, - primaryVertexRecVertex).first; -#ifdef InDetImprovedJetFitterVxFinder_DEBUGAddOns - - if (msgLvl(MSG::DEBUG)) msg() << " the compatibility which will be stored for a non primary vtx track is: " << - actualcomp << endmsg; - if (msgLvl(MSG::VERBOSE)) - { - //Amg::Vector3D trackParameters = myMeasuredPerigee->parameters(); - - msg(MSG::VERBOSE) << "d0/s(d0)" << myMeasuredPerigee->parameters()[Trk::d0]/Amg::error(*myMeasuredPerigee->covariance(),Trk::d0) - << "z0/s(z0)" << myMeasuredPerigee->parameters()[Trk::z0]/Amg::error(*myMeasuredPerigee->covariance(),Trk::z0) << endmsg; - } -#endif - - //get the sign (abs not needed but...) - Amg::Vector3D jetMomSpatial(jetMomentum.X(),jetMomentum.Y(),jetMomentum.Z()); - actualcomp=fabs(actualcomp)*m_jetFitterUtils->get3DLifetimeSignOfTrack(*myMeasuredPerigee, - jetMomSpatial, - primaryVertexRecVertex); - - compatibilityOfTrack[*qualitytracksIter]=actualcomp; - - } + // Refactoring: Instead at this point use JetFitterMultiStageFit: + Trk::VxJetCandidate* myJetCandidate= m_multiStageFitter->doTwoStageFit(primaryVertexRecVertex, + jetMomentum, + tracksToUseInFirstFit, + tracksToUseInSecondFit, + JFseedDirection); - delete myMeasuredPerigee; - myMeasuredPerigee=0; + if (myJetCandidate == 0) { + ATH_MSG_DEBUG( "JetFitter multi stage fit returned 0" ); + return 0; } - - //so now you have the following inputs: - //1) primary vertex: --> signalVertex (VxCandidate*) --> primaryVertexRecVertex (const RecVertex&) - //2) jetMomentum (const CLHEP::HepLorentzVector &) - //3) myTracks (const std::vector<const Trk::ITrackLink*>) - //4) compatibilityOfTrack (std::map<const Trk::ITrackLink*,double>) - - if (msgLvl(MSG::VERBOSE)) msg() << " JetFitterFinding phase 2: distinguish between primary and secondary tracks " << endmsg; - - //now distinguish between primary and secondary tracks - - std::vector<const Trk::ITrackLink*>::const_iterator myTracksBegin=myTracks.begin(); - std::vector<const Trk::ITrackLink*>::const_iterator myTracksEnd=myTracks.end(); - - for (std::vector<const Trk::ITrackLink*>::const_iterator myTracksIter=myTracksBegin; - myTracksIter!=myTracksEnd;++myTracksIter) - { - - double compatibilityOfActualTrack=compatibilityOfTrack[*myTracksIter]; - - double cutCompatibilityPVforNegTracks=m_cutCompatibilityPrimaryVertexForNegativeLifetimeTracks; - double cutCompatibilityPVforPosTracks=m_cutCompatibilityPrimaryVertexForPositiveLifetimeTracks; - - if (m_revertFromPositiveToNegativeTags)//revert cuts if needed - { - cutCompatibilityPVforNegTracks=m_cutCompatibilityPrimaryVertexForPositiveLifetimeTracks; - cutCompatibilityPVforPosTracks=m_cutCompatibilityPrimaryVertexForNegativeLifetimeTracks; - } - - if ( ( compatibilityOfActualTrack<0 && TMath::Prob(fabs(compatibilityOfActualTrack),2)< cutCompatibilityPVforNegTracks) || - ( compatibilityOfActualTrack>=0 && TMath::Prob(fabs(compatibilityOfActualTrack),2)< cutCompatibilityPVforPosTracks) ) - { - secondaryTracks.push_back(*myTracksIter); - } - else - { - primaryTracks.push_back(*myTracksIter); - } + else { + ATH_MSG_DEBUG( "USING JetFitterMultiStageFit return" ); } - //now you also have primaryTracks and secondaryTracks - - if (msgLvl(MSG::VERBOSE)) msg() << " JetFitterFinding phase 3: finding all two track vertices combinations " << endmsg; - - //iterate only on the secondaryTracks and go through all the 2-tracks combinations - - //temporary vector used to accumulate the parameters to fit... - //std::vector<const Trk::ParametersBase*> perigeeToFit(0); - //const Trk::ParametersBase* firstPerigee(0); - //const Trk::ParametersBase* secondPerigee(0); - - std::vector<const Trk::TrackParameters*> perigeeToFit(0); - const Trk::TrackParameters* firstPerigee(0); - const Trk::TrackParameters* secondPerigee(0); - - - std::vector<const Trk::ITrackLink*>::const_iterator secondaryTracksBegin=secondaryTracks.begin(); - std::vector<const Trk::ITrackLink*>::const_iterator secondaryTracksEnd=secondaryTracks.end(); - - for (std::vector<const Trk::ITrackLink*>::const_iterator secondaryTracksIter=secondaryTracksBegin; - secondaryTracksIter!=secondaryTracksEnd;++secondaryTracksIter) - { - - //this is independent of the kind of track: Kirill and Andi did this --> well done! - firstPerigee=(*secondaryTracksIter)->parameters(); - - for (std::vector<const Trk::ITrackLink*>::const_iterator secondaryTracksIter2=secondaryTracksBegin; - secondaryTracksIter2!=secondaryTracksIter; - ++secondaryTracksIter2) { - - perigeeToFit.clear(); - secondPerigee=(*secondaryTracksIter2)->parameters(); - perigeeToFit.push_back(firstPerigee); - perigeeToFit.push_back(secondPerigee); - - //MU Trk::Vertex seedVertex; - Amg::Vector3D seedVertex; - try { - seedVertex=m_CrossDistancesSeedFinder->findSeed(perigeeToFit); - - //MU Amg::Vector3D seedVertexPos=seedVertex.position(); - - //MU if (seedVertex.position().perp()>m_maxR || fabs(seedVertex.position().z())>m_maxZ) - if (seedVertex.perp()>m_maxR || fabs(seedVertex.z())>m_maxZ) - { - if (msgLvl(MSG::DEBUG)) msg(MSG::DEBUG) << "Vertex seed outside ID. R=" << seedVertex.perp() << " Z=" << seedVertex.z() << endmsg; - seedVertex[0] = (primaryVertexRecVertex.position().x()); - seedVertex[1] = (primaryVertexRecVertex.position().y()); - seedVertex[2] = (primaryVertexRecVertex.position().z()); - } - } catch (...) { - if (msgLvl(MSG::WARNING)) msg() << "Seed finding failed. Using primary vertex as seed... (clearly not optimal)" << endmsg; - seedVertex=Amg::Vector3D(primaryVertexRecVertex.position()); - } - - //N*(N-1) combinations are considered (this is why a cut on primary tracks is done) - //MU m_SequentialVertexFitter->fit(perigeeToFit, seedVertex); - xAOD::Vertex* myCandidate(m_SequentialVertexFitter->fit(perigeeToFit, - seedVertex)); - //MU ); - //MU Trk::VxCandidate* myCandidate(m_SequentialVertexFitter->fit(perigeeToFit, - //MU seedVertex)); - if (myCandidate==0) { - if (msgLvl(MSG::DEBUG)) msg() << " Sequential fit failed. shouldn't happen... Skipping V0 candidate... " << endmsg; - continue; - } +// // Lastly create the jetfitter info, ('save' our results) + std::vector<Trk::VxJetCandidate*> myCandidates; + // This push_back is problematic for the migration to xAOD::Vertex, it works simply because VxJetCandidate inherits from VxCandidate + myCandidates.push_back(myJetCandidate); - //now you are cloning the ITrackLink* - //so you need to update the map of the compatibilities - //(not great programming style, but this class is C not C++ :-) - Trk::ITrackLink* newLinkTrack1=(*secondaryTracksIter)->clone(); - Trk::ITrackLink* newLinkTrack2=(*secondaryTracksIter2)->clone(); + Trk::VxJetFitterVertexInfo* myOutputInfo=new Trk::VxJetFitterVertexInfo(myCandidates, + myTwoTrackVerticesInJet, + mySelectedTracksInJet); -// compatibilityOfTrack[newLinkTrack1]=compatibilityOfTrack[*secondaryTracksIter]; -// compatibilityOfTrack[newLinkTrack2]=compatibilityOfTrack[*secondaryTracksIter2]; - - ((myCandidate->vxTrackAtVertex()))[0].setOrigTrack ( newLinkTrack1 ); - ((myCandidate->vxTrackAtVertex()))[1].setOrigTrack ( newLinkTrack2 ); - - if (myCandidate->chiSquared()<0 || - myCandidate->numberDoF()<0) - { - msg(MSG::DEBUG) << " Fit for V0 candidate failed: chi2 or ndf negative. Deleting candidate..." << endmsg; - delete myCandidate; - myCandidate=0; - continue; - } - - - if (TMath::Prob(myCandidate->chiSquared(), - myCandidate->numberDoF())>m_twoVertexProbabilityCut) - { -#ifdef InDetImprovedJetFitterVxFinder_DEBUGAddOns - if (msgLvl(MSG::DEBUG)) msg() << " passed probability vertex: " << TMath::Prob(myCandidate->chiSquared(), - myCandidate->numberDoF()) << endmsg; -#endif - V0candidates.push_back(myCandidate); - fromLinkInV0CandidateToOriginalLink[newLinkTrack1]=*secondaryTracksIter; - fromLinkInV0CandidateToOriginalLink[newLinkTrack2]=*secondaryTracksIter2; - } - else - { -#ifdef InDetImprovedJetFitterVxFinder_DEBUGAddOns - if (msgLvl(MSG::DEBUG)) msg() << " didn't pass probability cut for 2-tr vtx: " << - std::setprecision(10) << - TMath::Prob(myCandidate->chiSquared(), - myCandidate->numberDoF()) << - endmsg; -#endif - delete myCandidate; - myCandidate=0; - } - } - } + myOutputInfo->setSVOwnership(true); + return myOutputInfo; + } + - //now the two track vertices were found - if (msgLvl(MSG::VERBOSE)) msg() << " JetFitterFinding phase 4: create neutral tracks out of recognized conversions, KS and Lambdas " << endmsg; + Trk::VxJetCandidate* InDetImprovedJetFitterVxFinder::findSecVertex(const Trk::RecVertex & /*primaryVertex*/, + const TLorentzVector & /*jetMomentum*/, + const std::vector<const Trk::ITrackLink*> & /*firstInputTracks*/, + const std::vector<const Trk::ITrackLink*> & /*secondInputTracks*/, + const Amg::Vector3D & /*vtxSeedDirection*/ ) const + { -#ifdef InDetImprovedJetFitterVxFinder_DEBUGAddOns - if (msgLvl(MSG::DEBUG)) msg() << "Found " << V0candidates.size() << " V0 candidates. " << endmsg; -#endif + // The overload is legacy. This is where we interface to JetFitter proper + // m_jetFitterMultiStageFit->performTwoStageFit(const Trk::RecVertex & primaryVertex, + // const TLorentzVector & jetMomentum, + // const std::vector<const Trk::ITrackLink*> & firstInputTracks, + // const std::vector<const Trk::ITrackLink*> & secondInputTracks, + // const Amg::Vector3D & vtxSeedDirection - //now iterate over all the two track vertices and realize if neutral tracks can be created from these... - - std::vector<const xAOD::Vertex*>::const_iterator v0candBegin=V0candidates.begin(); - std::vector<const xAOD::Vertex*>::const_iterator v0candEnd=V0candidates.end(); + // return myOutputInfo + return 0; - for (std::vector<const xAOD::Vertex*>::const_iterator v0candIter=v0candBegin;v0candIter!=v0candEnd;++v0candIter) - { - - const xAOD::Vertex * fittedVertex = *v0candIter; - - double radius=fittedVertex->position().perp(); - - if (msgLvl(MSG::VERBOSE)) msg() << " radius of 2-tr vertex is: " << radius; - -// double vertexprob= -// (fittedVertex.fitQuality().chiSquared()>0&&fittedVertex.fitQuality().numberDoF()>0) ? -// TMath::Prob(fittedVertex.fitQuality().chiSquared(),fittedVertex.fitQuality().numberDoF()) : -1; - - //now obtain the daughters of the two vertex - std::vector<Trk::VxTrackAtVertex>::const_iterator vtxIter = fittedVertex->vxTrackAtVertex().begin(); - //obtain first track - auto const & firstTrack = *vtxIter; - //obtain second track - ++vtxIter; - auto const & secondTrack = *vtxIter; - - int charge=m_jetFitterUtils->getTwoTrackVtxCharge(**v0candIter); - - if (msgLvl(MSG::VERBOSE)) msg() << " charge " << charge; - - double massee=m_jetFitterUtils->getTwoTrackVtxMass(**v0candIter, - s_masselectron, - s_masselectron); - - if (msgLvl(MSG::VERBOSE)) msg() << " massee " << massee; - - double masspipi=m_jetFitterUtils->getTwoTrackVtxMass(**v0candIter, - s_masspion, - s_masspion); - - if (msgLvl(MSG::VERBOSE)) msg() << " masspipi " << masspipi; - - double massprpi=m_jetFitterUtils->getTwoTrackVtxMass(**v0candIter, - s_massproton, - s_masspion); - - if (msgLvl(MSG::VERBOSE)) msg() << " massprpi " << massprpi << endmsg; - - std::pair<double,double> distanceAndError= - m_jetFitterUtils->getDistanceAndErrorBetweenTwoVertices(*fittedVertex,primaryVertexRecVertex); - - if (msgLvl(MSG::VERBOSE)) msg() <<" distance " << distanceAndError.first << " error " << distanceAndError.second << endmsg; - - //now assign a sign to the distance (decay in front or behind the primary vertex) - double signeddistance=distanceAndError.first; - - Amg::Vector3D jetMomSpatial(jetMomentum.X(),jetMomentum.Y(),jetMomentum.Z()); - double sign=(fittedVertex->position() - primaryVertexRecVertex.position()).dot(jetMomSpatial); - if (sign<0) - { - signeddistance*=-1.; - } - - if (msgLvl(MSG::VERBOSE)) msg() <<" signed distance " << signeddistance << endmsg; - - //now to understand if the 2-track vertex can represent a neutral track (conversion,Ks,Lambda) - bool isKs=fabs(masspipi-s_massks)<m_cutDeltaMKs; - bool isLambda=fabs(massprpi-s_masslambda)<m_cutDeltaMLambda; - bool isPhoton=fabs(massee)<m_cutDeltaMGamma; - - const Trk::ITrackLink* originalTrackLink1=fromLinkInV0CandidateToOriginalLink[firstTrack.trackOrParticleLink()]; - const Trk::ITrackLink* originalTrackLink2=fromLinkInV0CandidateToOriginalLink[secondTrack.trackOrParticleLink()]; - - double compatibilityTrack1=compatibilityOfTrack[originalTrackLink1]; - double compatibilityTrack2=compatibilityOfTrack[originalTrackLink2]; - - if (msgLvl(MSG::VERBOSE)) msg() <<" compatibility of track 1 " << compatibilityTrack1 << " compatibility of track 2 " << compatibilityTrack2 << endmsg; - - bool flightSignificance= - TMath::Prob(fabs(compatibilityTrack1),2)<m_cutCompatibilityPrimaryVertexSingleTrackForKsAndLambda&& - TMath::Prob(fabs(compatibilityTrack2),2)<m_cutCompatibilityPrimaryVertexSingleTrackForKsAndLambda&& - TMath::Prob(fabs(compatibilityTrack1)+ - fabs(compatibilityTrack2),4)<m_cutCompatibilityPrimaryVertexBothTracksForKsAndLambda; - - if (msgLvl(MSG::VERBOSE)) msg() <<" flightSignificance " << flightSignificance << endmsg; - - const Trk::TrackParameters* initialPerigee1=firstTrack.initialPerigee(); - const Trk::TrackParameters* initialPerigee2=secondTrack.initialPerigee(); - - if (!initialPerigee1 || !initialPerigee2) - { - msg(MSG::WARNING) << "No refitted parameters available for fitted v0 candidate. Discarding candidate..." << endmsg; - continue; - } - - std::pair<double,double> track1_IPd0z0=m_jetFitterUtils->getD0andZ0IP(*initialPerigee1, - primaryVertexRecVertex); - - std::pair<double,double> track2_IPd0z0=m_jetFitterUtils->getD0andZ0IP(*initialPerigee2, - primaryVertexRecVertex); - - - if (msgLvl(MSG::VERBOSE)) msg() <<" tr 1 d0ip " << track1_IPd0z0.first << " z0 ip " << track1_IPd0z0.second << endmsg; - if (msgLvl(MSG::VERBOSE)) msg() <<" tr 2 d0ip " << track2_IPd0z0.first << " z0 ip " << track2_IPd0z0.second << endmsg; - - bool tightIPcut1=fabs(track1_IPd0z0.first)<m_cutIPD0BothTracksCriteriumOneForKsAndLambda&&fabs(track1_IPd0z0.second)<m_cutIPZ0BothTracksCriteriumOneForKsAndLambda; - bool tightIPcut2=fabs(track2_IPd0z0.first)<m_cutIPD0BothTracksCriteriumOneForKsAndLambda&&fabs(track2_IPd0z0.second)<m_cutIPZ0BothTracksCriteriumOneForKsAndLambda; - - bool atLeastOneLoose=( !tightIPcut1 ) || ( !tightIPcut2 ); - - bool requirementForKs= - isKs&&charge==0&& - signeddistance/distanceAndError.second>m_cutTwoTrkVtxLifetimeSignificanceForKs&& - flightSignificance&& - ((radius>m_cutTransverseTwoTrkVtxDistanceCriteriumTwoForKsAndLambda&&(!atLeastOneLoose)) - ||(atLeastOneLoose)); - - if (m_revertFromPositiveToNegativeTags) - { - requirementForKs= - isKs&&charge==0&& - signeddistance/distanceAndError.second<-m_cutTwoTrkVtxLifetimeSignificanceForKs&& - flightSignificance&& - ((radius>m_cutTransverseTwoTrkVtxDistanceCriteriumTwoForKsAndLambda&&(!atLeastOneLoose)) - ||(atLeastOneLoose)); - } - - - bool requirementForLambda= - isLambda&&charge==0&& - signeddistance/distanceAndError.second>m_cutTwoTrkVtxLifetimeSignificanceForLambda&& - flightSignificance&& - ((radius>m_cutTransverseTwoTrkVtxDistanceCriteriumTwoForKsAndLambda&&(!atLeastOneLoose)) - ||(atLeastOneLoose)); - - if (m_revertFromPositiveToNegativeTags) - { - requirementForLambda= - isLambda&&charge==0&& - signeddistance/distanceAndError.second<-m_cutTwoTrkVtxLifetimeSignificanceForLambda&& - flightSignificance&& - ((radius>m_cutTransverseTwoTrkVtxDistanceCriteriumTwoForKsAndLambda&&(!atLeastOneLoose)) - ||(atLeastOneLoose)); - } - - - bool requirementForConversion= - isPhoton&& - signeddistance>0&& - charge==0; - - if (m_revertFromPositiveToNegativeTags) - { - requirementForConversion= - isPhoton&& - signeddistance<0&& - charge==0; - } - - - if (msgLvl(MSG::VERBOSE)) msg() <<" is Ks " << (requirementForKs?"yes":"no")<< " is conversion " << (requirementForConversion?"yes":"no")<< - " is Lambda " << (requirementForLambda?"yes":"no") << endmsg; + } - if (requirementForKs||requirementForLambda||requirementForConversion) - { - - //const Trk::NeutralPerigee* neutralParticle= m_convUtils->createNeutralTrackFromVertex(**v0candIter); - //const Trk::ParametersBase* myParametersBase = neutralParticle; NeutralPerigee is already just a typedef to Trk::ParametersBase<5,Trk::Neutral>, doesn't make sense to convert it again... - //const Trk::FitQuality* myFitQuality=new Trk::FitQuality( (*v0candIter)->recVertex().fitQuality() ); - //const Trk::TrackSummary* myTrackSummary=0;//new Trk::TrackSummary(); - //const Trk::VxCandidate* myVxCand=*v0candIter; - //const Trk::Track* myTrack=0; + void InDetImprovedJetFitterVxFinder::doTheFit(Trk::VxJetCandidate* /*myJetCandidate*/, + bool /*performClustering*/ ) const { - std::vector<const Trk::TrackParameters*> myDummyVector; - if (msgLvl(MSG::DEBUG)) msg() << "creating new neutral track particle base" << endmsg; - - ///THIS WILL NOT WORK IN NEW EDM! NEEDS A FIX!!! - /* - const Trk::TrackParticleBase* myTrackParticleBase=new Trk::TrackParticleBase(myTrack, - Trk::NoVtx, - myVxCand, - myTrackSummary,//summary - myDummyVector, - myParametersBase, - myFitQuality); + } - - ElementLink<Trk::TrackParticleBaseCollection> link; - link.setElement(const_cast<Trk::TrackParticleBase*>(myTrackParticleBase)); - Trk::LinkToTrackParticleBase * myNeutralTrackLink = new Trk::LinkToTrackParticleBase(link); - neutralTracks.push_back(myNeutralTrackLink); + void InDetImprovedJetFitterVxFinder::sortTrackCollectionByPt( std::vector< const Trk::ITrackLink* >& trackCollection ) const { - if (requirementForKs) - { - massOfNeutralTrack[myTrackParticleBase]=masspipi; - } - else if (requirementForConversion) - { - massOfNeutralTrack[myTrackParticleBase]=massee; - } - else if (requirementForLambda) - { - massOfNeutralTrack[myTrackParticleBase]=massprpi; - } - else - { - msg(MSG::WARNING) << " Internal error. Neutral candidate is discarded. " << endmsg; - continue; - } - */ - } - } - + if ( trackCollection.empty() ) return; - if (msgLvl(MSG::VERBOSE)) msg() <<" JetFitterFinding phase 5: try to further analyze conversions,Ks and Lambda and do some sort of overlap removal" << endmsg; - - //now you have the following things - //as before - //1) primary vertex: --> signalVertex (VxCandidate*) --> primaryVertexRecVertex (const RecVertex&) - //2) jetMomentum (const CLHEP::HepLorentzVector &) - //3) myTracks (const std::vector<const Trk::ITrackLink*>) - //4) compatibilityOfTrack (std::map<const Trk::ITrackLink*,double>) - // - //5)primaryTracks,secondaryTracks - //6)V0candidates - //7)neutralTracks + masses (massOfNeutralTrack) + ATH_MSG_DEBUG("re-order the tracks by pT: " << + ( trackCollection.front()->parameters() )->pT() << + " -- " << + ( trackCollection.back()->parameters() )->pT() ); - std::vector<const Trk::ITrackLink*> tracksToVeto; - std::vector<const xAOD::Vertex*> candidatesToVeto; - std::vector<const Trk::LinkToTrackParticleBase*> selectedNeutralTracks; - std::vector<const Trk::LinkToTrackParticleBase*> selectedNeutralTracksForIP; + std::sort( trackCollection.begin(), + trackCollection.end(), + //Lambda func to sort by pt + [](const Trk::ITrackLink* TL1, const Trk::ITrackLink* TL2) { + return ( (TL1->parameters())->pT() < (TL2->parameters())->pT() ); + } ); + ATH_MSG_DEBUG("after re-order the tracks by pT: " << + ( trackCollection.front()->parameters() )->pT() << + " -- " << + ( trackCollection.back()->parameters() )->pT() ); - - //v0candBegin - //v0candIter - - //first iteration to understand if there are conversions - for (std::vector<const xAOD::Vertex*>::const_iterator v0candIter=v0candBegin;v0candIter!=v0candEnd;++v0candIter) - { - const xAOD::Vertex* v0candPtr=*v0candIter; - - if (msgLvl(MSG::DEBUG)) msg() << " Analyzing new neutral candidate for conversion " << endmsg; - - if (v0candPtr==0) - { - msg(MSG::WARNING) << " Pointer for V0 is null pointer. Skipping V0 candidate..." << endmsg; - continue; - } - - //is there a neutral particle associated to this? Iterate over neutrals to understand this - //reurning 0 for the moment anyway, this is broken in new EDM. Needs Fixing! - const Trk::LinkToTrackParticleBase* correspondingNeutralLink= - m_jetFitterUtils->findNeutralTrackParticleBase(neutralTracks, - **v0candIter); - - if (!correspondingNeutralLink) - { - continue; - } - - const Trk::TrackParticleBase * correspondingNeutral=**correspondingNeutralLink; - - - //Can't get a neutral from a link to TrackParticleBase anymore...dynamic_cast to get this to compile, but this will not do anthing sensible. FIX ME! - const Trk::NeutralPerigee& myMeasuredNeutralPerigee=dynamic_cast<const Trk::NeutralPerigee&>(correspondingNeutral->definingParameters()); - - if (fabs(massOfNeutralTrack[correspondingNeutral])>m_cutDeltaMGamma) - { - continue; - } - - double compatibilityToPrimaryOfNeutralTrack= - m_jetFitterUtils->compatibility(myMeasuredNeutralPerigee,primaryVertexRecVertex).first; - -#ifdef InDetImprovedJetFitterVxFinder_DEBUGAddOns - if (msgLvl(MSG::DEBUG)) msg() << " The compatibility of the conversion is: " << compatibilityToPrimaryOfNeutralTrack << endmsg; -#endif - - selectedNeutralTracksForIP.push_back(correspondingNeutralLink); - - if (fabs(compatibilityToPrimaryOfNeutralTrack)<m_cutCompatibilityChi2ToPrimaryNeutralTrackFromConversion) - { - tracksToVeto.push_back(fromLinkInV0CandidateToOriginalLink[((v0candPtr->vxTrackAtVertex()))[0].trackOrParticleLink()]); - tracksToVeto.push_back(fromLinkInV0CandidateToOriginalLink[((v0candPtr->vxTrackAtVertex()))[1].trackOrParticleLink()]); - } - } - - //now do the same but trying to find out KSs - for (std::vector<const xAOD::Vertex*>::const_iterator v0candIter=v0candBegin;v0candIter!=v0candEnd;++v0candIter) - { - - const xAOD::Vertex * v0candPtr=*v0candIter; - - if (msgLvl(MSG::DEBUG)) msg() << " Analyzing new neutral candidate for KS " << endmsg; - - if (v0candPtr==0) - { - msg(MSG::WARNING) << " Pointer for V0 is null pointer. Skipping KS candidate..." << endmsg; - continue; - } - - //is there a neutral particle associated to this? Iterate over neutrals to understand this - //reurning 0 for the moment anyway, this is broken in new EDM. Needs Fixing! - const Trk::LinkToTrackParticleBase* correspondingNeutralLink= - m_jetFitterUtils->findNeutralTrackParticleBase(neutralTracks, - **v0candIter); - if (!correspondingNeutralLink) - { - continue; - } - - const Trk::TrackParticleBase * correspondingNeutral=**correspondingNeutralLink; - - //See above... FIX ME! - const Trk::NeutralPerigee& myMeasuredNeutralPerigee= - dynamic_cast<const Trk::NeutralPerigee&>(correspondingNeutral->definingParameters()); - - if (fabs(massOfNeutralTrack[correspondingNeutral]-s_massks)>m_cutDeltaMKs) - { - continue; - } - - double compatibilityToPrimaryOfNeutralTrack= - m_jetFitterUtils->compatibility(myMeasuredNeutralPerigee,primaryVertexRecVertex).first; - -#ifdef InDetImprovedJetFitterVxFinder_DEBUGAddOns - if (msgLvl(MSG::DEBUG)) msg() << " The compatibility of the KS is: " << compatibilityToPrimaryOfNeutralTrack << endmsg; -#endif - - auto const & firstTrack = v0candPtr->vxTrackAtVertex()[0]; - auto const & secondTrack = v0candPtr->vxTrackAtVertex()[1]; - - if (firstTrack==0 || secondTrack ==0) - { - msg(MSG::WARNING) << " Zero pointer (VxTrackAtVertex): skipping Ks candidate " << endmsg; - continue; - } - - - const Trk::ITrackLink* trackLink1=firstTrack.trackOrParticleLink(); - const Trk::ITrackLink* trackLink2=secondTrack.trackOrParticleLink(); - - if (trackLink1==0 || trackLink2==0) - { - msg(MSG::WARNING) << " Zero pointer (ITrackLink): skipping Ks candidate " << endmsg; - continue; - } - - //check if the candidate was vetoed - if (m_jetFitterUtils->checkIfVxCandidateIsInVector(v0candPtr,candidatesToVeto)) - continue; - - const Trk::ITrackLink* originalTrackLink1=fromLinkInV0CandidateToOriginalLink[trackLink1]; - const Trk::ITrackLink* originalTrackLink2=fromLinkInV0CandidateToOriginalLink[trackLink2]; - - - //check if the tracks were already vetoed (by conversions) - if (m_jetFitterUtils->checkIfTrackIsInVector(originalTrackLink1,tracksToVeto)) - continue; - if (m_jetFitterUtils->checkIfTrackIsInVector(originalTrackLink2,tracksToVeto)) - continue; - - if (fabs(compatibilityToPrimaryOfNeutralTrack)<m_cutCompatibilityChi2ToPrimaryNeutralTrackFromKs) - { - - if (msgLvl(MSG::VERBOSE)) msg() <<" Add neutral to the candidates to veto " << endmsg; - - //add neutral to the candidates to veto - candidatesToVeto.push_back(v0candPtr); - selectedNeutralTracksForIP.push_back(correspondingNeutralLink); - } - else - { - - - const Trk::TrackParameters * trackPerigee1=firstTrack.initialPerigee(); - const Trk::TrackParameters * trackPerigee2=secondTrack.initialPerigee(); - - if (trackPerigee1==0||trackPerigee2==0) - { - msg(MSG::WARNING) << " Null Pointer in Perigee returned. Skipping KS candidate... " << endmsg; - continue; - } - - - std::pair<double,double> track1IPd0z0= - m_jetFitterUtils->getD0andZ0IP(*trackPerigee1,primaryVertexRecVertex); - - std::pair<double,double> track2IPd0z0= - m_jetFitterUtils->getD0andZ0IP(*trackPerigee2,primaryVertexRecVertex); - - bool tightIPcut1=fabs(track1IPd0z0.first)<m_cutIPD0BothTracksCriteriumOneForKsAndLambda&&fabs(track1IPd0z0.second)<m_cutIPZ0BothTracksCriteriumOneForKsAndLambda; - bool tightIPcut2=fabs(track2IPd0z0.first)<m_cutIPD0BothTracksCriteriumOneForKsAndLambda&&fabs(track2IPd0z0.second)<m_cutIPZ0BothTracksCriteriumOneForKsAndLambda; - - if (msgLvl(MSG::VERBOSE)) msg() << " tightIPcut1 " << (tightIPcut1?"yes":"no") << " tightIPcut2: " << (tightIPcut2?"yes":"no") << endmsg; - - bool atLeastOneLoose=( !tightIPcut1 ) || ( !tightIPcut2 ); - - if (msgLvl(MSG::VERBOSE)) msg() <<" at least one loose " << (atLeastOneLoose?"yes":"no") << endmsg; - - if (atLeastOneLoose) - { - - ////////////////////// - - bool hasTrackInPreviousNeutral=false; - -// const Trk::ITrackLink* originalTrackLink1=fromLinkInV0CandidateToOriginalLink[trackLink1]; -// const Trk::ITrackLink* originalTrackLink2=fromLinkInV0CandidateToOriginalLink[trackLink2]; -// already calculated! - - //go from original ITrackLink to all other possible ITrackLink - std::vector<const Trk::ITrackLink*> vectorOfV0ITrackLink; - - std::map<const Trk::ITrackLink*,const Trk::ITrackLink*>::const_iterator fromLinkInV0CandidateToOriginalLinkBegin=fromLinkInV0CandidateToOriginalLink.begin(); - std::map<const Trk::ITrackLink*,const Trk::ITrackLink*>::const_iterator fromLinkInV0CandidateToOriginalLinkEnd=fromLinkInV0CandidateToOriginalLink.end(); - - for (std::map<const Trk::ITrackLink*,const Trk::ITrackLink*>::const_iterator fromLinkInV0CandidateToOriginalLinkIter=fromLinkInV0CandidateToOriginalLinkBegin; - fromLinkInV0CandidateToOriginalLinkIter!=fromLinkInV0CandidateToOriginalLinkEnd; - ++fromLinkInV0CandidateToOriginalLinkIter) - { - if ((*fromLinkInV0CandidateToOriginalLinkIter).second==originalTrackLink1|| - (*fromLinkInV0CandidateToOriginalLinkIter).second==originalTrackLink2) - { - if (msgLvl(MSG::VERBOSE)) msg() <<" Found one of the original ITrackLink " << endmsg; - vectorOfV0ITrackLink.push_back((*fromLinkInV0CandidateToOriginalLinkIter).first); - } - } - - std::vector<const Trk::ITrackLink*>::const_iterator vectorOfV0ITrackLinkBegin=vectorOfV0ITrackLink.begin(); - std::vector<const Trk::ITrackLink*>::const_iterator vectorOfV0ITrackLinkEnd=vectorOfV0ITrackLink.end(); - - for (std::vector<const Trk::ITrackLink*>::const_iterator vectorOfV0ITrackLinkIter=vectorOfV0ITrackLinkBegin; - vectorOfV0ITrackLinkIter!=vectorOfV0ITrackLinkEnd; - ++vectorOfV0ITrackLinkIter) - { - - if (m_jetFitterUtils->checkIfTrackIsInNeutralTrackVector(*vectorOfV0ITrackLinkIter,neutralTracks)) - { - hasTrackInPreviousNeutral=true; - if (msgLvl(MSG::DEBUG)) msg() << " Found track in previous neutral. Skipping new neutral candidate... " << endmsg; - break; - } - } - - if (hasTrackInPreviousNeutral) - continue; - - //check if the tracks are already in one neutral track (previous found KS) - //THIS CANNOT WORK... (tracks in different V0 candidates have different links) - //if (m_jetFitterUtils->checkIfTrackIsInNeutralTrackVector(trackLink1,neutralTracks)) - //continue; - //THIS CANNOT WORK... - //if (m_jetFitterUtils->checkIfTrackIsInNeutralTrackVector(trackLink2,neutralTracks)) - // continue; - - //PLEASE NOTE: when adding to tracksToUseInFirstFit, you need - //ALWAYS - - if (msgLvl(MSG::VERBOSE)) msg() <<" Add to the tracks to use in the first fit...! " << endmsg; - - tracksToUseInFirstFit.push_back(correspondingNeutralLink); - selectedNeutralTracks.push_back(correspondingNeutralLink); - selectedNeutralTracksForIP.push_back(correspondingNeutralLink); - } - // if not at Least One Loose, then it's probably a two track vertex which - // comes directly from the B continous... - } - } - - //now do the same but trying to find out Lambdas - for (std::vector<const xAOD::Vertex*>::const_iterator v0candIter=v0candBegin;v0candIter!=v0candEnd;++v0candIter) - { - - const xAOD::Vertex* v0candPtr=*v0candIter; - - if (msgLvl(MSG::DEBUG)) msg() << " Analyzing new neutral candidate for Lambdas " << endmsg; - - if (v0candPtr==0) - { - msg(MSG::WARNING) << " Pointer for V0 is null pointer. Skipping Lambdas candidate..." << endmsg; - continue; - } - - //is there a neutral particle associated to this? Iterate over neutrals to understand this - //reurning 0 for the moment anyway, this is broken in new EDM. Needs Fixing! - const Trk::LinkToTrackParticleBase* correspondingNeutralLink= - m_jetFitterUtils->findNeutralTrackParticleBase(neutralTracks, - **v0candIter); - - if (!correspondingNeutralLink) - { - continue; - } - - const Trk::TrackParticleBase * correspondingNeutral=**correspondingNeutralLink; - - //See comments above... FIX ME! - const Trk::NeutralPerigee& myMeasuredNeutralPerigee= - dynamic_cast<const Trk::NeutralPerigee&>(correspondingNeutral->definingParameters()); - - if (fabs(massOfNeutralTrack[correspondingNeutral]-s_masslambda)>m_cutDeltaMLambda) - { - continue; - } - - double compatibilityToPrimaryOfNeutralTrack= - m_jetFitterUtils->compatibility(myMeasuredNeutralPerigee,primaryVertexRecVertex).first; - -#ifdef InDetImprovedJetFitterVxFinder_DEBUGAddOns - if (msgLvl(MSG::DEBUG)) msg() << " The compatibility of the Lambda is: " << compatibilityToPrimaryOfNeutralTrack << endmsg; -#endif - - auto const & firstTrack = v0candPtr->vxTrackAtVertex()[0]; - auto const & secondTrack = v0candPtr->vxTrackAtVertex()[1]; - - if (firstTrack==0 || secondTrack ==0) - { - msg(MSG::WARNING) << " Zero pointer (VxTrackAtVertex): skipping Lambda candidate " << endmsg; - continue; - } - - - const Trk::ITrackLink* trackLink1=firstTrack.trackOrParticleLink(); - const Trk::ITrackLink* trackLink2=secondTrack.trackOrParticleLink(); - - if (trackLink1==0 || trackLink2==0) - { - msg(MSG::WARNING) << " Zero pointer (ITrackLink): skipping Lambda candidate " << endmsg; - continue; - } - - //check if the candidate was vetoed - if (m_jetFitterUtils->checkIfVxCandidateIsInVector(v0candPtr,candidatesToVeto)) - { - if (msgLvl(MSG::VERBOSE)) msg() <<" candidate has to be vetoed " << endmsg; - continue; - } - - - //check if the tracks were already vetoed (by conversions or KS) - if (m_jetFitterUtils->checkIfTrackIsInVector(fromLinkInV0CandidateToOriginalLink[trackLink1],tracksToVeto)) - continue; - if (m_jetFitterUtils->checkIfTrackIsInVector(fromLinkInV0CandidateToOriginalLink[trackLink2],tracksToVeto)) - continue; - - const Trk::TrackParameters * trackPerigee1=firstTrack.initialPerigee(); - const Trk::TrackParameters * trackPerigee2=secondTrack.initialPerigee(); - - if (trackPerigee1==0||trackPerigee2==0) - { - msg(MSG::WARNING) << " Null Pointer in Perigee returned. Skipping Lambda candidate... " << endmsg; - continue; - } - - std::pair<double,double> track1IPd0z0= - m_jetFitterUtils->getD0andZ0IP(*trackPerigee1,primaryVertexRecVertex); - - std::pair<double,double> track2IPd0z0= - m_jetFitterUtils->getD0andZ0IP(*trackPerigee2,primaryVertexRecVertex); - - bool tightIPcut1=fabs(track1IPd0z0.first)<m_cutIPD0BothTracksCriteriumOneForKsAndLambda&&fabs(track1IPd0z0.second)<m_cutIPZ0BothTracksCriteriumOneForKsAndLambda; - bool tightIPcut2=fabs(track2IPd0z0.first)<m_cutIPD0BothTracksCriteriumOneForKsAndLambda&&fabs(track2IPd0z0.second)<m_cutIPZ0BothTracksCriteriumOneForKsAndLambda; - - bool atLeastOneLoose=( !tightIPcut1 ) || ( !tightIPcut2 ); - - - if (fabs(compatibilityToPrimaryOfNeutralTrack)<m_cutCompatibilityChi2ToPrimaryNeutralTrackFromLambda) - { - - if (msgLvl(MSG::VERBOSE)) msg() <<" Adding Lambda to candidates to veto or veto the tracks directly " << endmsg; - - //add neutral to the candidates to veto - candidatesToVeto.push_back(v0candPtr); - - selectedNeutralTracksForIP.push_back(correspondingNeutralLink); - - if (atLeastOneLoose) - { - tracksToVeto.push_back(fromLinkInV0CandidateToOriginalLink[((v0candPtr->vxTrackAtVertex()))[0].trackOrParticleLink()]); - tracksToVeto.push_back(fromLinkInV0CandidateToOriginalLink[((v0candPtr->vxTrackAtVertex()))[1].trackOrParticleLink()]); - } - else - { - candidatesToVeto.push_back(v0candPtr); - } - } - else - { - if (atLeastOneLoose) - { - selectedNeutralTracksForIP.push_back(correspondingNeutralLink); - } - } - } - - if (msgLvl(MSG::VERBOSE)) msg() <<" JetFitterFinding phase 6: use two-track vertices as a first seed for JetFitter " << endmsg; - - //now you can add the tracks from the two-track vertices for a first fit with - //only the "best tracks" - for (std::vector<const xAOD::Vertex*>::const_iterator v0candIter=v0candBegin;v0candIter!=v0candEnd;++v0candIter) - { - - const xAOD::Vertex * v0candPtr = *v0candIter; - - if (msgLvl(MSG::DEBUG)) msg() << " Analyzing two track vertices to select the best tracks" << endmsg; - - if (v0candPtr==0) - { - msg(MSG::WARNING) << " Pointer for V0 is null pointer. Skipping V0 candidate..." << endmsg; - continue; - } - - if (m_jetFitterUtils->checkIfVxCandidateIsInVector(v0candPtr,candidatesToVeto)) - continue; - - auto const & firstTrack = v0candPtr->vxTrackAtVertex()[0]; - auto const & secondTrack = v0candPtr->vxTrackAtVertex()[1]; - - if (firstTrack==0 || secondTrack ==0) - { - msg(MSG::WARNING) << " Zero pointer (VxTrackAtVertex): skipping 2-track candidate " << endmsg; - continue; - } - - const Trk::ITrackLink* trackLink1=firstTrack.trackOrParticleLink(); - const Trk::ITrackLink* trackLink2=secondTrack.trackOrParticleLink(); - - if (trackLink1==0 || trackLink2==0) - { - msg(MSG::WARNING) << " Zero pointer (ITrackLink): skipping 2-track candidate " << endmsg; - continue; - } - - bool hasTrack1HardVetoed=m_jetFitterUtils->checkIfTrackIsInVector(fromLinkInV0CandidateToOriginalLink[trackLink1], - tracksToVeto); - - bool hasTrack2HardVetoed=m_jetFitterUtils->checkIfTrackIsInVector(fromLinkInV0CandidateToOriginalLink[trackLink2], - tracksToVeto); - - if (hasTrack1HardVetoed || hasTrack2HardVetoed) - continue; - - //MU const Trk::FitQuality & vertexQuality= v0candPtr->fitQuality(); - - double vertexProb=TMath::Prob(v0candPtr->chiSquared(),v0candPtr->numberDoF()); - - if (vertexProb<m_cutTwoTrkVtxVertexProbForBFirstSelectionFirstCriterium && - vertexProb<m_cutTwoTrkVtxVertexProbForBFirstSelectionSecondCriterium) - continue; - - const Trk::ITrackLink* originalTrackLink1=fromLinkInV0CandidateToOriginalLink[trackLink1]; - const Trk::ITrackLink* originalTrackLink2=fromLinkInV0CandidateToOriginalLink[trackLink2]; - - double compatibilityTrack1=compatibilityOfTrack[originalTrackLink1]; - double compatibilityTrack2=compatibilityOfTrack[originalTrackLink2]; - - bool flightSignificance= - TMath::Prob(fabs(compatibilityTrack1),2)<m_cutCompatibilityPrimaryVertexSingleTrackForBFirstSelection&& - TMath::Prob(fabs(compatibilityTrack2),2)<m_cutCompatibilityPrimaryVertexSingleTrackForBFirstSelection&& - TMath::Prob(fabs(compatibilityTrack1)+ - fabs(compatibilityTrack2),4)<m_cutCompatibilityPrimaryVertexBothTracksForBFirstSelection; - - if (!flightSignificance) - continue; - - const Trk::TrackParameters* initialPerigee1=firstTrack.initialPerigee(); - const Trk::TrackParameters* initialPerigee2=secondTrack.initialPerigee(); - - if (!initialPerigee1 || !initialPerigee2) - { - msg(MSG::WARNING) << "No refitted parameters available for 2-track vertex. Candidate not accepted..." << endmsg; - continue; - } - - std::pair<double,double> track1_IPd0z0=m_jetFitterUtils->getD0andZ0IP(*initialPerigee1, - primaryVertexRecVertex); - - std::pair<double,double> track2_IPd0z0=m_jetFitterUtils->getD0andZ0IP(*initialPerigee2, - primaryVertexRecVertex); - - bool goodQUALITYcut1=fabs(track1_IPd0z0.first)<m_cutIPD0BothTracksForBFirstSelection&&fabs(track1_IPd0z0.second)<m_cutIPZ0BothTracksForBFirstSelection&&initialPerigee1->momentum().perp()>m_cutPtBothTracksForBFirstSelection; - bool goodQUALITYcut2=fabs(track2_IPd0z0.first)<m_cutIPD0BothTracksForBFirstSelection&&fabs(track2_IPd0z0.second)<m_cutIPZ0BothTracksForBFirstSelection&&initialPerigee2->momentum().perp()>m_cutPtBothTracksForBFirstSelection; - - bool bothGoodQUALITY=goodQUALITYcut1&&goodQUALITYcut2; - - if (!bothGoodQUALITY) - continue; - - const xAOD::Vertex * fittedVertex = *v0candIter; - - std::pair<double,double> distanceAndError= - m_jetFitterUtils->getDistanceAndErrorBetweenTwoVertices(*fittedVertex,primaryVertexRecVertex); - - //now assign a sign to the distance (decay in front or behind the primary vertex) - double signeddistance=distanceAndError.first; - Amg::Vector3D jetMomSpatial(jetMomentum.X(),jetMomentum.Y(),jetMomentum.Z()); - double sign=(fittedVertex->position()-primaryVertexRecVertex.position()).dot(jetMomSpatial); - - if (sign<0) - { - signeddistance*=-1.; - } - - if (!m_revertFromPositiveToNegativeTags) - { - if (!((vertexProb>m_cutTwoTrkVtxVertexProbForBFirstSelectionFirstCriterium && - signeddistance/distanceAndError.second>m_cutTwoTrkVtxLifetimeSignificanceForBFirstSelectionFirstCriterium) - || - (vertexProb>m_cutTwoTrkVtxVertexProbForBFirstSelectionSecondCriterium && - signeddistance/distanceAndError.second>m_cutTwoTrkVtxLifetimeSignificanceForBFirstSelectionSecondCriterium))) - continue; - } - else - { - if (!((vertexProb>m_cutTwoTrkVtxVertexProbForBFirstSelectionFirstCriterium && - signeddistance/distanceAndError.second<-m_cutTwoTrkVtxLifetimeSignificanceForBFirstSelectionFirstCriterium) - || - (vertexProb>m_cutTwoTrkVtxVertexProbForBFirstSelectionSecondCriterium && - signeddistance/distanceAndError.second<-m_cutTwoTrkVtxLifetimeSignificanceForBFirstSelectionSecondCriterium))) - continue; - } - - - double radius=fittedVertex->position().perp(); - int interactiontype=-1; - - if (radius>m_firstBeam_min && radius<m_firstBeam_max) - { - interactiontype=0; - numberFirstBeamInteractions+=1; - } - else if (radius>m_secondBeam_min && radius<m_secondBeam_max) - { - interactiontype=1; - numberSecondBeamInteractions+=1; - } - else if (radius>m_firstLayer_min && radius<m_firstLayer_max) - { - interactiontype=2; - numberFirstLayerInteractions+=1; - } - else if (radius>m_secondLayer_min && radius<m_secondLayer_max) - { - interactiontype=3; - numberSecondLayerInteractions+=1; - } - - if (interactiontype==2 || interactiontype==3) - { - bool signifCutTight= - TMath::Prob(fabs(compatibilityTrack1),2)<m_cutCompatibilityToPrimarySingleTrackForMatInteractions&& - TMath::Prob(fabs(compatibilityTrack2),2)<m_cutCompatibilityToPrimarySingleTrackForMatInteractions&& - TMath::Prob(fabs(compatibilityTrack1)+ - fabs(compatibilityTrack2),4)<m_cutCompatibilityToPrimaryBothTracksForMatInteractions; - if (signifCutTight) - { - if (msgLvl(MSG::DEBUG)) msg() << " Material interaction in layer... Skipping candidate..." << endmsg; - continue; - } - } - -/////////////////////// - - //problem: you need to iterate over all V0 vertices in order to get all possible "names" (new clones) - //of the original ITrackLinks - - bool hasTrack2InCommonWithNeutral=false; - bool hasTrack1InCommonWithNeutral=false; - - - //go from original ITrackLink to all other possible ITrackLink - std::vector<const Trk::ITrackLink*> vectorOfV0ITrackLink1; - std::vector<const Trk::ITrackLink*> vectorOfV0ITrackLink2; - - std::map<const Trk::ITrackLink*,const Trk::ITrackLink*>::const_iterator fromLinkInV0CandidateToOriginalLinkBegin=fromLinkInV0CandidateToOriginalLink.begin(); - std::map<const Trk::ITrackLink*,const Trk::ITrackLink*>::const_iterator fromLinkInV0CandidateToOriginalLinkEnd=fromLinkInV0CandidateToOriginalLink.end(); - - for (std::map<const Trk::ITrackLink*,const Trk::ITrackLink*>::const_iterator fromLinkInV0CandidateToOriginalLinkIter=fromLinkInV0CandidateToOriginalLinkBegin; - fromLinkInV0CandidateToOriginalLinkIter!=fromLinkInV0CandidateToOriginalLinkEnd; - ++fromLinkInV0CandidateToOriginalLinkIter) - { - if ((*fromLinkInV0CandidateToOriginalLinkIter).second==originalTrackLink1) - { - if (msgLvl(MSG::VERBOSE)) msg() <<" Found one of the original ITrackLink " << endmsg; - vectorOfV0ITrackLink1.push_back((*fromLinkInV0CandidateToOriginalLinkIter).first); - } - if ((*fromLinkInV0CandidateToOriginalLinkIter).second==originalTrackLink2) - { - if (msgLvl(MSG::VERBOSE)) msg() <<" Found one of the original ITrackLink " << endmsg; - vectorOfV0ITrackLink2.push_back((*fromLinkInV0CandidateToOriginalLinkIter).first); - } - } - - std::vector<const Trk::ITrackLink*>::const_iterator vectorOfV0ITrackLink1Begin=vectorOfV0ITrackLink1.begin(); - std::vector<const Trk::ITrackLink*>::const_iterator vectorOfV0ITrackLink1End=vectorOfV0ITrackLink1.end(); - - for (std::vector<const Trk::ITrackLink*>::const_iterator vectorOfV0ITrackLink1Iter=vectorOfV0ITrackLink1Begin; - vectorOfV0ITrackLink1Iter!=vectorOfV0ITrackLink1End; - ++vectorOfV0ITrackLink1Iter) - { - - if (m_jetFitterUtils->checkIfTrackIsInNeutralTrackVector(*vectorOfV0ITrackLink1Iter,selectedNeutralTracks)) - { - hasTrack1InCommonWithNeutral=true; - break; - } - - } - - std::vector<const Trk::ITrackLink*>::const_iterator vectorOfV0ITrackLink2Begin=vectorOfV0ITrackLink2.begin(); - std::vector<const Trk::ITrackLink*>::const_iterator vectorOfV0ITrackLink2End=vectorOfV0ITrackLink2.end(); - - for (std::vector<const Trk::ITrackLink*>::const_iterator vectorOfV0ITrackLink2Iter=vectorOfV0ITrackLink2Begin; - vectorOfV0ITrackLink2Iter!=vectorOfV0ITrackLink2End; - ++vectorOfV0ITrackLink2Iter) - { - if (m_jetFitterUtils->checkIfTrackIsInNeutralTrackVector(*vectorOfV0ITrackLink2Iter,selectedNeutralTracks)) - { - hasTrack2InCommonWithNeutral=true; - continue; - } - } - - -/////////////////////// - - //THIS AGAIN CANNOT WORK! -// bool hasTrack2InCommonWithNeutral=m_jetFitterUtils->checkIfTrackIsInNeutralTrackVector(trackLink1,selectedNeutralTracks); -// bool hasTrack1InCommonWithNeutral=m_jetFitterUtils->checkIfTrackIsInNeutralTrackVector(trackLink2,selectedNeutralTracks); - - if (hasTrack2InCommonWithNeutral && hasTrack1InCommonWithNeutral ) - { - if (msgLvl(MSG::DEBUG)) msg() << " Both tracks in common with neutral " << endmsg; - continue; - } - else if (hasTrack1InCommonWithNeutral) - { - const Trk::ITrackLink* trackLink2Original=fromLinkInV0CandidateToOriginalLink[trackLink2]; - if (!m_jetFitterUtils->checkIfTrackIsInVector(trackLink2Original, - tracksToUseInFirstFit)) - { - if (msgLvl(MSG::DEBUG)) msg() << " Track 1 in common with neutrals. Adding track 2... " << endmsg; - tracksToUseInFirstFit.push_back(trackLink2Original); - } - else - { - if (msgLvl(MSG::DEBUG)) msg() << " Track 1 in common with neutrals.BUT NOT Adding track 2 because already there... " << endmsg; - } - positionsOfSeedingVertices.push_back(Trk::PositionAndWeight(v0candPtr->position(),1)); - } - else if (hasTrack2InCommonWithNeutral) - { - const Trk::ITrackLink* trackLink1Original=fromLinkInV0CandidateToOriginalLink[trackLink1]; - if (!m_jetFitterUtils->checkIfTrackIsInVector(trackLink1Original, - tracksToUseInFirstFit)) - { - if (msgLvl(MSG::DEBUG)) msg() << " Track 2 in common with neutrals. Adding track 1... " << endmsg; - tracksToUseInFirstFit.push_back(trackLink1Original); - } - else - { - if (msgLvl(MSG::DEBUG)) msg() << " Track 2 in common with neutrals.BUT NOT Adding track 1 because already there... " << endmsg; - } - - positionsOfSeedingVertices.push_back(Trk::PositionAndWeight(v0candPtr->position(),1)); - } - else //no tracks in common with neutrals - { - - const Trk::ITrackLink* trackLink2Original=fromLinkInV0CandidateToOriginalLink[trackLink2]; - const Trk::ITrackLink* trackLink1Original=fromLinkInV0CandidateToOriginalLink[trackLink1]; - - if (msgLvl(MSG::DEBUG)) msg() << " No track in common with neutrals. Considering adding both of them... " << endmsg; - - if (!m_jetFitterUtils->checkIfTrackIsInVector(trackLink2Original, - tracksToUseInFirstFit)) - { - if (msgLvl(MSG::DEBUG)) msg() << " Adding track 2... " << endmsg; - tracksToUseInFirstFit.push_back(trackLink2Original); - } - - if (!m_jetFitterUtils->checkIfTrackIsInVector(trackLink1Original, - tracksToUseInFirstFit)) - { - if (msgLvl(MSG::DEBUG)) msg() << " Adding track 1... " << endmsg; - tracksToUseInFirstFit.push_back(trackLink1Original); - } - positionsOfSeedingVertices.push_back(Trk::PositionAndWeight(v0candPtr->position(),1)); - } - } - - if (msgLvl(MSG::VERBOSE)) msg() <<" JetFitterFinding phase 7: determine single good tracks to add in the fit in a second step " << endmsg; - - //now the tracksToUseInFirstFit are filled, what is missing are the single tracks to be used - //in a further step of the fit - - for (std::vector<const Trk::ITrackLink*>::const_iterator secondaryTracksIter=secondaryTracksBegin; - secondaryTracksIter!=secondaryTracksEnd;++secondaryTracksIter) - { - - double compatibilityOfActualTrack=compatibilityOfTrack[*secondaryTracksIter]; - - const Trk::TrackParameters* perigee=(*secondaryTracksIter)->parameters(); - - const AmgSymMatrix(5)* measPerigee=perigee->covariance(); - - if (measPerigee==0) - { - msg(MSG::WARNING) << " Track parameters have no covariance. skipping single track candidate... " << endmsg; - continue; - } - - std::pair<double,double> track_IPd0z0=m_jetFitterUtils->getD0andZ0IP(*perigee, - primaryVertexRecVertex); - std::pair<double,double> track_IPd0z0Sig=m_jetFitterUtils->getD0andZ0IPSig(*perigee, - primaryVertexRecVertex); - - const double & IPd0=track_IPd0z0.first; - const double & IPz0=track_IPd0z0.second; - const double & IPd0Sig=track_IPd0z0Sig.first; - const double & IPz0Sig=track_IPd0z0Sig.second; - const double pT=perigee->momentum().perp(); - - double cutCompatibilityPrimaryVertexSinglePositiveLifetimeTrackForBSecondSelection=m_cutCompatibilityPrimaryVertexSinglePositiveLifetimeTrackForBSecondSelection; - double cutCompatibilityPrimaryVertexSingleNegativeLifetimeTrackForBSecondSelection=m_cutCompatibilityPrimaryVertexSingleNegativeLifetimeTrackForBSecondSelection; - - if (m_revertFromPositiveToNegativeTags) - { - cutCompatibilityPrimaryVertexSinglePositiveLifetimeTrackForBSecondSelection=m_cutCompatibilityPrimaryVertexSingleNegativeLifetimeTrackForBSecondSelection; - cutCompatibilityPrimaryVertexSingleNegativeLifetimeTrackForBSecondSelection=m_cutCompatibilityPrimaryVertexSinglePositiveLifetimeTrackForBSecondSelection; - } - - bool passBoxCut=( fabs(IPd0Sig)<m_cutIPD0SigBoxSingleTrackForBSecondSelection && fabs(IPz0Sig)>m_cutIPZ0SigBoxSingleTrackForBSecondSelection); - - if (fabs(IPd0)>m_cutIPD0SingleTrackForBSecondSelection|| - fabs(IPz0)>m_cutIPZ0SingleTrackForBSecondSelection|| - ( compatibilityOfActualTrack>=0 && TMath::Prob(fabs(compatibilityOfActualTrack),2)>cutCompatibilityPrimaryVertexSinglePositiveLifetimeTrackForBSecondSelection) || - ( compatibilityOfActualTrack<0 && TMath::Prob(fabs(compatibilityOfActualTrack),2)>cutCompatibilityPrimaryVertexSingleNegativeLifetimeTrackForBSecondSelection) || - pT< m_cutPtSingleTrackForBSecondSelection || passBoxCut) - { - if (msgLvl(MSG::DEBUG)) msg() << " Candidate didn't pass one of the selection cuts " << endmsg; - continue; - } - - bool alreadyUsed=m_jetFitterUtils->checkIfTrackIsInVector(*secondaryTracksIter, - tracksToUseInFirstFit); - - if (alreadyUsed) - { - if (msgLvl(MSG::VERBOSE)) msg() <<" Track was already used " << endmsg; - continue; - } - - bool isVetoed=m_jetFitterUtils->checkIfTrackIsInVector(*secondaryTracksIter, - tracksToVeto); - - if (isVetoed) - { - if (msgLvl(MSG::VERBOSE)) msg() <<" Track was vetoed " << endmsg; - continue; - } - - bool isInVetoedCandidate=false; - - //go from original ITrackLink to all other possible ITrackLink - std::vector<const Trk::ITrackLink*> vectorOfV0ITrackLink; - - std::map<const Trk::ITrackLink*,const Trk::ITrackLink*>::const_iterator fromLinkInV0CandidateToOriginalLinkBegin=fromLinkInV0CandidateToOriginalLink.begin(); - std::map<const Trk::ITrackLink*,const Trk::ITrackLink*>::const_iterator fromLinkInV0CandidateToOriginalLinkEnd=fromLinkInV0CandidateToOriginalLink.end(); - - for (std::map<const Trk::ITrackLink*,const Trk::ITrackLink*>::const_iterator fromLinkInV0CandidateToOriginalLinkIter=fromLinkInV0CandidateToOriginalLinkBegin; - fromLinkInV0CandidateToOriginalLinkIter!=fromLinkInV0CandidateToOriginalLinkEnd; - ++fromLinkInV0CandidateToOriginalLinkIter) - { - if ((*fromLinkInV0CandidateToOriginalLinkIter).second==*secondaryTracksIter) - { - if (msgLvl(MSG::VERBOSE)) msg() <<" Found one of the original ITrackLink " << endmsg; - vectorOfV0ITrackLink.push_back((*fromLinkInV0CandidateToOriginalLinkIter).first); - } - } - - std::vector<const Trk::ITrackLink*>::const_iterator vectorOfV0ITrackLinkBegin=vectorOfV0ITrackLink.begin(); - std::vector<const Trk::ITrackLink*>::const_iterator vectorOfV0ITrackLinkEnd=vectorOfV0ITrackLink.end(); - - for (std::vector<const Trk::ITrackLink*>::const_iterator vectorOfV0ITrackLinkIter=vectorOfV0ITrackLinkBegin; - vectorOfV0ITrackLinkIter!=vectorOfV0ITrackLinkEnd; - ++vectorOfV0ITrackLinkIter) - { - - isInVetoedCandidate=isInVetoedCandidate|| - m_jetFitterUtils->checkIfTrackIsInV0CandidatesVector(*vectorOfV0ITrackLinkIter, - candidatesToVeto); - if (isInVetoedCandidate) - { - break; - } - } - - //now isInVetoedCandidate has the correct answer... - - if (isInVetoedCandidate) - { - if (msgLvl(MSG::DEBUG)) msg() << " vetoed by existing V0 candidate veto " << endmsg; - continue; - } - - - bool alreadyUsedSecondFit=m_jetFitterUtils->checkIfTrackIsInVector(*secondaryTracksIter, - tracksToUseInSecondFit); - - if (alreadyUsedSecondFit) - { - msg(MSG::WARNING) << " Already used in second fit. Should this be really possible??? " << endmsg; - continue; - } - - tracksToUseInSecondFit.push_back(*secondaryTracksIter); - } - - int firstFitTracksNum=tracksToUseInFirstFit.size(); - int secondFitTracksNum=tracksToUseInSecondFit.size(); - - if (msgLvl(MSG::DEBUG)) msg() << " First fit with : " << firstFitTracksNum << - " tracks. Second fit with : " << secondFitTracksNum << endmsg; - - //now take the positionsOfSeedingVertices and try to obtain a good seed direction... - Amg::Vector3D JFseedDirection(jetMomentum.X(),jetMomentum.Y(),jetMomentum.Z()); - JFseedDirection.normalize(); - if (msgLvl(MSG::VERBOSE)) msg() <<" Jet Direction would be: " << JFseedDirection << endmsg; - - if (positionsOfSeedingVertices.size()!=0) - { - Amg::Vector3D theSeedVertex=m_mode3dfinder->getMode(0, 0, positionsOfSeedingVertices); - if (m_revertFromPositiveToNegativeTags==false) - { - if ((theSeedVertex-primaryVertexRecVertex.position()).dot(JFseedDirection)>0) - { - JFseedDirection=(theSeedVertex-primaryVertexRecVertex.position()).unit(); - if (msgLvl(MSG::DEBUG)) msg() << " Using twotrkvtx direction for start: " << JFseedDirection << endmsg; - } - else - { - msg(MSG::WARNING) << " NORMAL SEEDING: Seed vertex is on negative side... Using Jet Direction!" << endmsg; - } - } - else - { - if ((theSeedVertex-primaryVertexRecVertex.position()).dot(JFseedDirection)<0) - { - JFseedDirection=-(theSeedVertex-primaryVertexRecVertex.position()).unit(); - if (msgLvl(MSG::DEBUG)) msg() << " Using twotrkvtx direction for start: " << JFseedDirection << endmsg; - } - else - { - msg(MSG::WARNING) << " REVERSE SEEDING: Seed vertex is on positive side... Using Jet Direction!" << endmsg; - } - } - } - - if (msgLvl(MSG::VERBOSE)) msg() <<" JetFitterFinding phase 8: do the real finding with JetFitter " << endmsg; - - Trk::VxJetCandidate* myJetCandidate=findSecVertex(primaryVertexRecVertex, - jetMomentum, - tracksToUseInFirstFit, - tracksToUseInSecondFit, - JFseedDirection); - - if (msgLvl(MSG::VERBOSE)) msg() <<" JetFitterFinding phase 9: store the results " << endmsg; - - - //now in principle you just need to store the RESULT... - - - //create new neutral tracks (the one you want to store...) - std::vector<const Trk::TrackParticleBase*> selectedNeutralTracksToStore; - - std::vector<const Trk::LinkToTrackParticleBase*>::iterator selectedNeutralTracksBegin=selectedNeutralTracksForIP.begin(); - std::vector<const Trk::LinkToTrackParticleBase*>::iterator selectedNeutralTracksEnd=selectedNeutralTracksForIP.end(); - - for (std::vector<const Trk::LinkToTrackParticleBase*>::iterator selectedNeutralTracksIter=selectedNeutralTracksBegin; - selectedNeutralTracksIter!=selectedNeutralTracksEnd;++selectedNeutralTracksIter) - { - selectedNeutralTracksToStore.push_back(new Trk::TrackParticleBase(****selectedNeutralTracksIter)); - } - - //create the auxiliary objects... - const Trk::TwoTrackVerticesInJet* myTwoTrackVerticesInJet=new - Trk::TwoTrackVerticesInJet(V0candidates, - selectedNeutralTracksToStore); - - const Trk::SelectedTracksInJet* mySelectedTracksInJet=new - Trk::SelectedTracksInJet(primaryTracks, - secondaryTracks); - - //delete the old objects.. pay some attention here! - - //delete the neutralTracks that you didn't use... - std::vector<const Trk::LinkToTrackParticleBase*>::iterator neutralTracksBegin=neutralTracks.begin(); - std::vector<const Trk::LinkToTrackParticleBase*>::iterator neutralTracksEnd=neutralTracks.end(); - - for (std::vector<const Trk::LinkToTrackParticleBase*>::iterator neutralTracksIter=neutralTracksBegin; - neutralTracksIter!=neutralTracksEnd;++neutralTracksIter) - { - //if (!m_jetFitterUtils->checkIfTrackIsInVector(*neutralTracksIter,selectedNeutralTracks)) - //{ - delete ***neutralTracksIter; - //} - delete *neutralTracksIter; - *neutralTracksIter=0; - } - - - std::vector<Trk::VxJetCandidate*> myCandidates; - // This push_back is problematic for the migration to xAOD::Vertex, it works simply because VxJetCandidate inherits from VxCandidate - myCandidates.push_back(myJetCandidate); - - - - Trk::VxJetFitterVertexInfo* myOutputInfo=new Trk::VxJetFitterVertexInfo(myCandidates, - myTwoTrackVerticesInJet, - mySelectedTracksInJet); - - myOutputInfo->setSVOwnership(true); - - - delete signalVertex; - signalVertex=0; - - return myOutputInfo; } - - Trk::VxJetCandidate* - InDetImprovedJetFitterVxFinder::findSecVertex(const Trk::RecVertex & primaryVertex, - const TLorentzVector & jetMomentum, - const std::vector<const Trk::ITrackLink*> & firstInputTracks, - const std::vector<const Trk::ITrackLink*> & secondInputTracks, - const Amg::Vector3D & vtxSeedDirection) const { - ATH_MSG_VERBOSE( " entered findSecVertex(). Applying JetFitter finding to the found sets of tracks and performing clustering (pattern recognition) " ); - Amg::Vector3D myDirection(jetMomentum.X(),jetMomentum.Y(),jetMomentum.Z()); - std::vector<std::vector<const Trk::ITrackLink*> > bunchesOfTracks; - std::vector<const Trk::ITrackLink*> tracksToAdd; - std::vector<const Trk::ITrackLink*>::const_iterator tracks2Begin=firstInputTracks.begin(); - std::vector<const Trk::ITrackLink*>::const_iterator tracks2End=firstInputTracks.end(); - for (std::vector<const Trk::ITrackLink*>::const_iterator tracks2Iter=tracks2Begin; - tracks2Iter!=tracks2End;++tracks2Iter) { - ATH_MSG_VERBOSE(" adding track to fit " ); - tracksToAdd.push_back(*tracks2Iter); - } - bunchesOfTracks.push_back(tracksToAdd); - tracksToAdd.clear(); - std::vector<const Trk::ITrackLink*>::const_iterator tracks3Begin=secondInputTracks.begin(); - std::vector<const Trk::ITrackLink*>::const_iterator tracks3End=secondInputTracks.end(); - for (std::vector<const Trk::ITrackLink*>::const_iterator tracks3Iter=tracks3Begin; - tracks3Iter!=tracks3End;++tracks3Iter) { - ATH_MSG_VERBOSE(" adding track to fit "); - tracksToAdd.push_back(*tracks3Iter); - } - if (not tracksToAdd.empty()) { - bunchesOfTracks.push_back(tracksToAdd); - } - tracksToAdd.clear(); - //now it just uses these bunches... - //now I have just to make sure that no clustering is done at first iteration - //while it needs to be done at second iteration (there will be only two iterations) - std::vector<std::vector<const Trk::ITrackLink*> >::const_iterator BunchesBegin=bunchesOfTracks.begin(); - std::vector<std::vector<const Trk::ITrackLink*> >::const_iterator BunchesEnd=bunchesOfTracks.end(); - std::vector<const Trk::ITrackLink*>::const_iterator tracksToAddBegin; - std::vector<const Trk::ITrackLink*>::const_iterator tracksToAddEnd; - std::vector<const Trk::ITrackLink*>::const_iterator tracksToAddIter; - Trk::VxJetCandidate* myJetCandidate=nullptr; - for (std::vector<std::vector<const Trk::ITrackLink*> >::const_iterator BunchesIter=BunchesBegin; - BunchesIter!=BunchesEnd;++BunchesIter) { - if (BunchesIter==BunchesBegin) { - ATH_MSG_VERBOSE(" initial fit with " << (*BunchesIter).size() << " tracks " ); - myJetCandidate=m_initializationHelper->initializeJetCandidate(*BunchesIter,&primaryVertex,&myDirection,&vtxSeedDirection); - if (not myJetCandidate) continue; - m_routines->initializeToMinDistancesToJetAxis(myJetCandidate); - if (not BunchesIter->empty()){ - doTheFit(myJetCandidate,true); - } - } else { - if (not myJetCandidate) continue; - ATH_MSG_VERBOSE(" other fit with " << (*BunchesIter).size() << " tracks " ); - std::vector<Trk::VxVertexOnJetAxis*> setOfVertices=myJetCandidate->getVerticesOnJetAxis(); - std::vector<Trk::VxTrackAtVertex*>* setOfTracks=myJetCandidate->vxTrackAtVertex(); - tracksToAddBegin=(*BunchesIter).begin(); - tracksToAddEnd=(*BunchesIter).end(); - for (tracksToAddIter=tracksToAddBegin;tracksToAddIter!=tracksToAddEnd;++tracksToAddIter) { - std::vector<Trk::VxTrackAtVertex*> temp_vector_tracksAtVertex; - Trk::VxTrackAtVertex* newVxTrack=new Trk::VxTrackAtVertex((*tracksToAddIter)->clone()); - temp_vector_tracksAtVertex.push_back(newVxTrack); - setOfTracks->push_back(newVxTrack); - setOfVertices.push_back(new Trk::VxVertexOnJetAxis(temp_vector_tracksAtVertex)); - } - ATH_MSG_VERBOSE(" new overall number of tracks to fit : " << setOfVertices.size() ); - myJetCandidate->setVerticesOnJetAxis(setOfVertices); - m_initializationHelper->updateTrackNumbering(myJetCandidate); - //question: should this be done??? - m_routines->initializeToMinDistancesToJetAxis(myJetCandidate); - doTheFit(myJetCandidate); - } - } - return myJetCandidate; - } - void - InDetImprovedJetFitterVxFinder::doTheFit(Trk::VxJetCandidate* myJetCandidate, - bool performClustering) const { - int numClusteringLoops=0; - bool noMoreVerticesToCluster(false); - do {//reguards clustering - ATH_MSG_VERBOSE("InDetImprovedJetFitterVxFinder: ------>>>> new cycle of fit" ); - int numLoops=0; - bool noMoreTracksToDelete(false); - do {//reguards eliminating incompatible tracks... - m_routines->performTheFit(myJetCandidate,15,false,30,0.001); - const std::vector<Trk::VxVertexOnJetAxis*> & vertices=myJetCandidate->getVerticesOnJetAxis(); - std::vector<Trk::VxVertexOnJetAxis*>::const_iterator verticesBegin=vertices.begin(); - std::vector<Trk::VxVertexOnJetAxis*>::const_iterator verticesEnd=vertices.end(); - //delete incompatible tracks... - float max_prob(1.); - Trk::VxVertexOnJetAxis* worseVertex(nullptr); - for (std::vector<Trk::VxVertexOnJetAxis*>::const_iterator verticesIter=verticesBegin; - verticesIter!=verticesEnd;++verticesIter) { - if (*verticesIter==0) { - ATH_MSG_WARNING( "One vertex is empy. Problem when trying to delete incompatible vertices. No further vertices deleted."); - } else { - const Trk::FitQuality & fitQuality=(*verticesIter)->fitQuality(); - if (TMath::Prob(fitQuality.chiSquared(),(int)std::floor(fitQuality.numberDoF()+0.5))<max_prob) { - max_prob=TMath::Prob(fitQuality.chiSquared(),(int)std::floor(fitQuality.numberDoF()+0.5)); - worseVertex=*verticesIter; - } - } - } - if (worseVertex and (max_prob<m_vertexProbCut)) { - ATH_MSG_DEBUG( "Deleted vertex " << worseVertex->getNumVertex() << " with probability " << max_prob ); - if (worseVertex==myJetCandidate->getPrimaryVertex()) { - ATH_MSG_VERBOSE( " It's the primary" ); - } - m_routines->deleteVertexFromJetCandidate(worseVertex,myJetCandidate); - } else { - noMoreTracksToDelete=true; - ATH_MSG_VERBOSE("No tracks to delete: maximum probability is " << max_prob ); - } - numLoops+=1; - } while (numLoops<m_maxNumDeleteIterations&&!(noMoreTracksToDelete)); - if (!performClustering) break; - if (!m_useFastClustering && (int)myJetCandidate->getVerticesOnJetAxis().size()<m_maxTracksForDetailedClustering) { - m_routines->fillTableWithFullProbOfMerging(myJetCandidate,8,false,10,0.01); - } else { - m_routines->fillTableWithFastProbOfMerging(myJetCandidate); - } - const Trk::VxClusteringTable* clusteringTablePtr(myJetCandidate->getClusteringTable()); - if (not clusteringTablePtr) { - ATH_MSG_WARNING( " No Clustering Table while it should have been calculated... no more clustering performed during vertexing " ); - noMoreVerticesToCluster=true; - } else { - ATH_MSG_VERBOSE(" clustering table is " << *clusteringTablePtr ); - //now iterate over the full map and decide wether you want to do the clustering OR not... - float probVertex(0.); - Trk::PairOfVxVertexOnJetAxis pairOfVxVertexOnJetAxis=clusteringTablePtr->getMostCompatibleVertices(probVertex); - //a PairOfVxVertexOnJetAxis is a std::pair<VxVertexOnJetAxis*,VxVertexOnJetAxis*> - float probVertexExcludingPrimary(0.); - Trk::PairOfVxVertexOnJetAxis pairOfVxVertexOnJetAxisExcludingPrimary=clusteringTablePtr->getMostCompatibleVerticesExcludingPrimary(probVertexExcludingPrimary); - bool firstProbIsWithPrimary= ( std::fabs(probVertex-probVertexExcludingPrimary)>1e-6 ); - if (probVertex>0.&&probVertex>m_vertexClusteringProbabilityCut&&firstProbIsWithPrimary) { - ATH_MSG_VERBOSE(" merging vtx number " << (*pairOfVxVertexOnJetAxis.first).getNumVertex() << - " and " << (*pairOfVxVertexOnJetAxis.second).getNumVertex() << " (should be PV)." ); - m_helper->mergeVerticesInJetCandidate(*pairOfVxVertexOnJetAxis.first, - *pairOfVxVertexOnJetAxis.second, - *myJetCandidate); - //now you need to update the numbering scheme - m_initializationHelper->updateTrackNumbering(myJetCandidate);//maybe this should be moved to a lower level... - continue; - } - if (probVertexExcludingPrimary>0.){ - //GP suggested by Marco Battaglia, use vertex mass in order to decide wether to split or not, so derive vertex masses first - const Trk::VxVertexOnJetAxis* firstVertex=pairOfVxVertexOnJetAxisExcludingPrimary.first; - const Trk::VxVertexOnJetAxis* secondVertex=pairOfVxVertexOnJetAxisExcludingPrimary.second; - CLHEP::HepLorentzVector massVector1=m_jetFitterUtils->fourMomentumAtVertex(*firstVertex);//MeV - CLHEP::HepLorentzVector massVector2=m_jetFitterUtils->fourMomentumAtVertex(*secondVertex);//MeV - CLHEP::HepLorentzVector sumMassVector=massVector1+massVector2; - double massTwoVertex=sumMassVector.mag();//MeV - bool doMerge(false); - double vertexClusteringProbabilityCutWithMass; - if(massTwoVertex< 1000.){ - vertexClusteringProbabilityCutWithMass = m_vertexClusteringProbabilityCutWithMass0010; - }else if(massTwoVertex< 1500.){ - vertexClusteringProbabilityCutWithMass = m_vertexClusteringProbabilityCutWithMass1015; - }else if(massTwoVertex< 2000.){ - vertexClusteringProbabilityCutWithMass = m_vertexClusteringProbabilityCutWithMass1520; - }else if(massTwoVertex< 2500.){ - vertexClusteringProbabilityCutWithMass = m_vertexClusteringProbabilityCutWithMass2025; - }else if(massTwoVertex< 3000.){ - vertexClusteringProbabilityCutWithMass = m_vertexClusteringProbabilityCutWithMass2530; - }else if(massTwoVertex< 4000.){ - vertexClusteringProbabilityCutWithMass = m_vertexClusteringProbabilityCutWithMass3040; - }else if(massTwoVertex< 5000.){ - vertexClusteringProbabilityCutWithMass = m_vertexClusteringProbabilityCutWithMass4050; - }else if(massTwoVertex< 6000.){ - vertexClusteringProbabilityCutWithMass = m_vertexClusteringProbabilityCutWithMass5060; - }else{ - vertexClusteringProbabilityCutWithMass = m_vertexClusteringProbabilityCutWithMass6070; - } - if (probVertexExcludingPrimary>vertexClusteringProbabilityCutWithMass) { - doMerge=true; - } - if (doMerge){ - ATH_MSG_VERBOSE(" merging vtx number " << (*pairOfVxVertexOnJetAxis.first).getNumVertex() << - " and " << (*pairOfVxVertexOnJetAxis.second).getNumVertex() << " mass merged vertex: " << massTwoVertex ); - m_helper->mergeVerticesInJetCandidate(*pairOfVxVertexOnJetAxisExcludingPrimary.first, - *pairOfVxVertexOnJetAxisExcludingPrimary.second, - *myJetCandidate); - m_initializationHelper->updateTrackNumbering(myJetCandidate);//maybe this should be moved to a lower level... - continue;//go to next cycle, after a succesful merging - } - } - noMoreVerticesToCluster=true; - } - numClusteringLoops+=1; - } while (numClusteringLoops<m_maxClusteringIterations&&!(noMoreVerticesToCluster)); - - //now a section should follow where the "complicate" VxJetCandidate is transformed in a conventional "VxCandidate" - //so that it can be used also by the normal B-Tagging algorithms... - //TO BE COMPLETED - } }//end namespace Rec diff --git a/InnerDetector/InDetRecTools/InDetSecVxFinderTool/src/InDetJetFitterUtils.cxx b/InnerDetector/InDetRecTools/InDetSecVxFinderTool/src/InDetJetFitterUtils.cxx index 1500c3290703028a5dd266e1353099fb4e084a39..8e0704beb5a2c1c08af6eac2141b08ef8b761e14 100644 --- a/InnerDetector/InDetRecTools/InDetSecVxFinderTool/src/InDetJetFitterUtils.cxx +++ b/InnerDetector/InDetRecTools/InDetSecVxFinderTool/src/InDetJetFitterUtils.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ /*************************************************************************** @@ -29,9 +29,9 @@ #include "TrkEventPrimitives/ParamDefs.h" #include <TMath.h> -#include "TrkExInterfaces/IExtrapolator.h" +//#include "TrkExInterfaces/IExtrapolator.h" -#include "TrkVertexFitterInterfaces/IVertexLinearizedTrackFactory.h" +//#include "TrkVertexFitterInterfaces/IVertexLinearizedTrackFactory.h" #include "CLHEP/Vector/ThreeVector.h" #include "TrkParticleBase/LinkToTrackParticleBase.h" #include "TrkParticleBase/TrackParticleBase.h" @@ -68,15 +68,10 @@ namespace InDet InDetJetFitterUtils::InDetJetFitterUtils(const std::string& t, const std::string& n, const IInterface* p) : AthAlgTool(t,n,p), - m_LinearizedTrackFactory("Trk::FullLinearizedTrackFactory/FullLinearizedTrackFactory", this), - m_extrapolator("Trk::Extrapolator/InDetExtrapolator", this), m_extrapolatorIsAvailable(false), m_linearizedTrackFactoryIsAvailable(false) { - declareProperty("LinearizedTrackFactory",m_LinearizedTrackFactory); - declareProperty("Extrapolator",m_extrapolator); - declareInterface< InDetJetFitterUtils >(this) ; } @@ -526,7 +521,7 @@ namespace InDet if (m_linearizedTrackFactoryIsAvailable==false) { - msg(MSG::ERROR) << "Cannot perform requested extrapolation. No extrapolator defined...Returning 0 compatibility..." << endmsg; + ATH_MSG_ERROR( "Cannot perform requested extrapolation. No extrapolator defined...Returning 0 compatibility..." ); return std::pair<double,double>(0,0); } diff --git a/InnerDetector/InDetRecTools/InDetSecVxFinderTool/src/InDetJetFitterVxFinder.cxx b/InnerDetector/InDetRecTools/InDetSecVxFinderTool/src/InDetJetFitterVxFinder.cxx index 3561075b59fe091a06adbe11270219ef147722f7..d9c0440d058030846b819648752d4a84ebc79c8d 100755 --- a/InnerDetector/InDetRecTools/InDetSecVxFinderTool/src/InDetJetFitterVxFinder.cxx +++ b/InnerDetector/InDetRecTools/InDetSecVxFinderTool/src/InDetJetFitterVxFinder.cxx @@ -61,31 +61,9 @@ namespace InDet }; InDetJetFitterVxFinder::InDetJetFitterVxFinder(const std::string& t, const std::string& n, const IInterface* p) : - AthAlgTool(t,n,p), - m_initializationHelper("Trk::JetFitterInitializationHelper"), - m_helper("Trk::JetFitterHelper"), - m_routines("Trk::JetFitterRoutines"), - m_trkFilter("InDet::InDetDetailedTrackSelectorTool"), - m_maxNumDeleteIterations(30), - m_vertexProbCut(0.01), - m_maxClusteringIterations(30), - m_vertexClusteringProbabilityCut(0.01), - m_useFastClustering(false), - m_maxTracksToFitAtOnce(15) + AthAlgTool(t,n,p) { - declareProperty("JetFitterHelper",m_helper); - declareProperty("JetFitterInitializationHelper",m_initializationHelper); - declareProperty("JetFitterRoutines",m_routines); - declareProperty("TrackSelector",m_trkFilter); - - declareProperty("MaxNumDeleteIterations",m_maxNumDeleteIterations); - declareProperty("VertexProbCut",m_vertexProbCut); - declareProperty("MaxClusteringIterations",m_maxClusteringIterations); - declareProperty("VertexClusteringProbabilityCut",m_vertexClusteringProbabilityCut); - declareProperty("UseFastClustering",m_useFastClustering); - declareProperty("MaxTracksToFitAtOnce",m_maxTracksToFitAtOnce); declareInterface< ISecVertexInJetFinder >(this) ; - } @@ -93,96 +71,140 @@ namespace InDet StatusCode InDetJetFitterVxFinder::initialize() { + + + StatusCode sc = AthAlgTool::initialize(); + if(sc.isFailure()) + { + msg(MSG::ERROR) << " Unable to initialize the AlgTool" << endmsg; + return sc; + } + //retrieving the udator itself - ATH_CHECK(m_helper.retrieve()); - ATH_CHECK(m_initializationHelper.retrieve()); - ATH_CHECK(m_routines.retrieve()); - ATH_CHECK(m_trkFilter.retrieve()); + sc = m_helper.retrieve(); + if(sc.isFailure()) { + msg(MSG::ERROR) << " Unable to retrieve "<<m_helper<<endmsg; + return StatusCode::FAILURE; + }else msg(MSG::INFO) << "JetFitter Helper retrieved"<<endmsg; + + + sc = m_initializationHelper.retrieve(); + if(sc.isFailure()) { + msg(MSG::ERROR) << " Unable to retrieve "<<m_initializationHelper<<endmsg; + return StatusCode::FAILURE; + }else msg(MSG::INFO) << "JetFitter Initialization Helper retrieved"<<endmsg; + + sc = m_routines.retrieve(); + if(sc.isFailure()) { + msg(MSG::ERROR) << " Unable to retrieve the JetFitter routines"<<m_routines<<endmsg; + return StatusCode::FAILURE; + }else msg(MSG::INFO) << "JetFitter Routines class retrieved"<<endmsg; + + if(m_trkFilter.retrieve().isFailure()) { + msg(MSG::ERROR) << " Unable to retrieve "<<m_trkFilter<<endmsg; + return StatusCode::FAILURE; + } else msg(MSG::INFO) << "Track filter retrieved"<<endmsg; + + msg(MSG::INFO) << "Initialize successful" << endmsg; return StatusCode::SUCCESS; } StatusCode InDetJetFitterVxFinder::finalize() { - ATH_MSG_DEBUG("Finalize ok"); - return StatusCode::SUCCESS; + + msg(MSG::INFO) << "Finalize successful" << endmsg; + return StatusCode::SUCCESS; + } - Trk::VxSecVertexInfo* - InDetJetFitterVxFinder::findSecVertex(const Trk::RecVertex & primaryVertex, - const TLorentzVector & jetMomentum, - const std::vector<const Trk::TrackParticleBase*> & myTracks) const { - + const Trk::VxSecVertexInfo* InDetJetFitterVxFinder::findSecVertex(const Trk::RecVertex & primaryVertex, + const TLorentzVector & jetMomentum, + const std::vector<const Trk::TrackParticleBase*> & myTracks) const { Amg::Vector3D myDirection(jetMomentum.Vect().X(),jetMomentum.Vect().Y(),jetMomentum.Vect().Z()); + std::vector<TrackParticle_pair> tracks; + std::vector<const Trk::TrackParticleBase*>::const_iterator tracksBegin=myTracks.begin(); std::vector<const Trk::TrackParticleBase*>::const_iterator tracksEnd=myTracks.end(); for (std::vector<const Trk::TrackParticleBase*>::const_iterator tracksIter=tracksBegin; - tracksIter!=tracksEnd;++tracksIter) { + tracksIter!=tracksEnd;++tracksIter) { if (m_trkFilter->decision(**tracksIter,&primaryVertex)==true) { - tracks.push_back(TrackParticle_pair((*tracksIter)->perigee()->momentum().perp(),*tracksIter)); + tracks.push_back(TrackParticle_pair((*tracksIter)->perigee()->momentum().perp(),*tracksIter)); } } + std::vector<std::vector<const Trk::TrackParticleBase*> > bunchesOfTracks; + std::sort(tracks.begin(),tracks.end()); + std::vector<const Trk::TrackParticleBase*> tracksToAdd; + std::vector<TrackParticle_pair>::const_iterator tracks2Begin=tracks.begin(); std::vector<TrackParticle_pair>::const_iterator tracks2End=tracks.end(); for (std::vector<TrackParticle_pair>::const_iterator tracks2Iter=tracks2Begin; - tracks2Iter!=tracks2End;++tracks2Iter) { - ATH_MSG_VERBOSE( " track: " << (*tracks2Iter).first << " and : " << (*tracks2Iter).second ); + tracks2Iter!=tracks2End;++tracks2Iter) { + if (msgLvl(MSG::VERBOSE)) msg() << " track: " << (*tracks2Iter).first << " and : " << (*tracks2Iter).second << endmsg; + tracksToAdd.push_back((*tracks2Iter).second); if (tracksToAdd.size() % m_maxTracksToFitAtOnce == 0) { - ATH_MSG_VERBOSE( " new bunch " ); - bunchesOfTracks.push_back(tracksToAdd); - tracksToAdd.clear(); + if (msgLvl(MSG::VERBOSE)) msg() << " new bunch " << endmsg; + bunchesOfTracks.push_back(tracksToAdd); + tracksToAdd.clear(); } } + bunchesOfTracks.push_back(tracksToAdd); + std::vector<std::vector<const Trk::TrackParticleBase*> >::const_iterator BunchesBegin=bunchesOfTracks.begin(); std::vector<std::vector<const Trk::TrackParticleBase*> >::const_iterator BunchesEnd=bunchesOfTracks.end(); + std::vector<const Trk::TrackParticleBase*>::const_iterator tracksToAddBegin; std::vector<const Trk::TrackParticleBase*>::const_iterator tracksToAddEnd; std::vector<const Trk::TrackParticleBase*>::const_iterator tracksToAddIter; - Trk::VxJetCandidate* myJetCandidate=nullptr; + + + Trk::VxJetCandidate* myJetCandidate=0; + for (std::vector<std::vector<const Trk::TrackParticleBase*> >::const_iterator BunchesIter=BunchesBegin; - BunchesIter!=BunchesEnd;++BunchesIter) { + BunchesIter!=BunchesEnd;++BunchesIter) { + if (BunchesIter==BunchesBegin) { - if (not myJetCandidate) continue; - ATH_MSG_VERBOSE( " initial fit with " << (*BunchesIter).size() << " tracks " ); - myJetCandidate=m_initializationHelper->initializeJetCandidate(*BunchesIter,&primaryVertex,&myDirection); - m_routines->initializeToMinDistancesToJetAxis(myJetCandidate); - doTheFit(myJetCandidate); + if (msgLvl(MSG::VERBOSE)) msg() << " initial fit with " << (*BunchesIter).size() << " tracks " << endmsg; + myJetCandidate=m_initializationHelper->initializeJetCandidate(*BunchesIter,&primaryVertex,&myDirection); + m_routines->initializeToMinDistancesToJetAxis(myJetCandidate); + doTheFit(myJetCandidate); } else { - if (not myJetCandidate) continue; - ATH_MSG_VERBOSE(" other fit with " << (*BunchesIter).size() << " tracks " ); - std::vector<Trk::VxVertexOnJetAxis*> setOfVertices=myJetCandidate->getVerticesOnJetAxis(); - std::vector<Trk::VxTrackAtVertex*>* setOfTracks=myJetCandidate->vxTrackAtVertex(); - tracksToAddBegin=(*BunchesIter).begin(); - tracksToAddEnd=(*BunchesIter).end(); - for (tracksToAddIter=tracksToAddBegin;tracksToAddIter!=tracksToAddEnd;++tracksToAddIter) { - std::vector<Trk::VxTrackAtVertex*> temp_vector_tracksAtVertex; - ElementLink<Trk::TrackParticleBaseCollection> link; - link.setElement(const_cast<Trk::TrackParticleBase*>(*tracksToAddIter)); - Trk::LinkToTrackParticleBase * linkTT = new Trk::LinkToTrackParticleBase(link); - Trk::VxTrackAtVertex* newVxTrack=new Trk::VxTrackAtVertex(linkTT); - temp_vector_tracksAtVertex.push_back(newVxTrack); - setOfTracks->push_back(newVxTrack); - setOfVertices.push_back(new Trk::VxVertexOnJetAxis(temp_vector_tracksAtVertex)); - } - ATH_MSG_VERBOSE( " new overall number of tracks to fit : " << setOfVertices.size() ); - myJetCandidate->setVerticesOnJetAxis(setOfVertices); - m_initializationHelper->updateTrackNumbering(myJetCandidate); - doTheFit(myJetCandidate); + if (msgLvl(MSG::VERBOSE)) msg() << " other fit with " << (*BunchesIter).size() << " tracks " << endmsg; + std::vector<Trk::VxVertexOnJetAxis*> setOfVertices=myJetCandidate->getVerticesOnJetAxis(); + std::vector<Trk::VxTrackAtVertex*>* setOfTracks=myJetCandidate->vxTrackAtVertex(); + tracksToAddBegin=(*BunchesIter).begin(); + tracksToAddEnd=(*BunchesIter).end(); + for (tracksToAddIter=tracksToAddBegin;tracksToAddIter!=tracksToAddEnd;++tracksToAddIter) { + std::vector<Trk::VxTrackAtVertex*> temp_vector_tracksAtVertex; + ElementLink<Trk::TrackParticleBaseCollection> link; + link.setElement(const_cast<Trk::TrackParticleBase*>(*tracksToAddIter)); + Trk::LinkToTrackParticleBase * linkTT = new Trk::LinkToTrackParticleBase(link); + Trk::VxTrackAtVertex* newVxTrack=new Trk::VxTrackAtVertex(linkTT); + temp_vector_tracksAtVertex.push_back(newVxTrack); + setOfTracks->push_back(newVxTrack); + setOfVertices.push_back(new Trk::VxVertexOnJetAxis(temp_vector_tracksAtVertex)); + } + if (msgLvl(MSG::VERBOSE)) msg() << " new overall number of tracks to fit : " << setOfVertices.size() << endmsg; + myJetCandidate->setVerticesOnJetAxis(setOfVertices); + m_initializationHelper->updateTrackNumbering(myJetCandidate); + doTheFit(myJetCandidate); } } + std::vector<Trk::VxCandidate*> myCandidates; myCandidates.push_back(myJetCandidate); + +// return new Trk::VxSecVertexInfo(myCandidates);//ownership of the single objects is taken over! return 0; } - Trk::VxSecVertexInfo* - InDetJetFitterVxFinder::findSecVertex(const Trk::RecVertex & primaryVertex, + const Trk::VxSecVertexInfo* InDetJetFitterVxFinder::findSecVertex(const Trk::RecVertex & primaryVertex, const TLorentzVector & jetMomentum, const std::vector<const Trk::TrackParticleBase*> & firstInputTracks, const std::vector<const Trk::TrackParticleBase*> & secondInputTracks, @@ -190,149 +212,191 @@ namespace InDet { Amg::Vector3D myDirection(jetMomentum.Vect().X(),jetMomentum.Vect().Y(),jetMomentum.Vect().Z()); + std::vector<std::vector<const Trk::TrackParticleBase*> > bunchesOfTracks; + std::vector<const Trk::TrackParticleBase*> tracksToAdd; + std::vector<const Trk::TrackParticleBase*>::const_iterator tracks2Begin=firstInputTracks.begin(); std::vector<const Trk::TrackParticleBase*>::const_iterator tracks2End=firstInputTracks.end(); for (std::vector<const Trk::TrackParticleBase*>::const_iterator tracks2Iter=tracks2Begin; - tracks2Iter!=tracks2End;++tracks2Iter) { - ATH_MSG_VERBOSE( " adding track to fit " ); + tracks2Iter!=tracks2End;++tracks2Iter) { + if (msgLvl(MSG::VERBOSE)) msg() << " adding track to fit " << endmsg; tracksToAdd.push_back(*tracks2Iter); } + bunchesOfTracks.push_back(tracksToAdd); tracksToAdd.clear(); + std::vector<const Trk::TrackParticleBase*>::const_iterator tracks3Begin=secondInputTracks.begin(); std::vector<const Trk::TrackParticleBase*>::const_iterator tracks3End=secondInputTracks.end(); for (std::vector<const Trk::TrackParticleBase*>::const_iterator tracks3Iter=tracks3Begin; - tracks3Iter!=tracks3End;++tracks3Iter) { - ATH_MSG_VERBOSE( " adding track to fit " ); + tracks3Iter!=tracks3End;++tracks3Iter) { + if (msgLvl(MSG::VERBOSE)) msg() << " adding track to fit " << endmsg; tracksToAdd.push_back(*tracks3Iter); } - if (not tracksToAdd.empty()) { + + if (tracksToAdd.size()!=0) + { bunchesOfTracks.push_back(tracksToAdd); } tracksToAdd.clear(); + + //now it just uses these bunches... //now I have just to make sure that no clustering is done at first iteration //while it needs to be done at second iteration (there will be only two iterations) + + std::vector<std::vector<const Trk::TrackParticleBase*> >::const_iterator BunchesBegin=bunchesOfTracks.begin(); std::vector<std::vector<const Trk::TrackParticleBase*> >::const_iterator BunchesEnd=bunchesOfTracks.end(); + std::vector<const Trk::TrackParticleBase*>::const_iterator tracksToAddBegin; std::vector<const Trk::TrackParticleBase*>::const_iterator tracksToAddEnd; std::vector<const Trk::TrackParticleBase*>::const_iterator tracksToAddIter; + + Trk::VxJetCandidate* myJetCandidate=0; + for (std::vector<std::vector<const Trk::TrackParticleBase*> >::const_iterator BunchesIter=BunchesBegin; - BunchesIter!=BunchesEnd;++BunchesIter) { + BunchesIter!=BunchesEnd;++BunchesIter) { + if (BunchesIter==BunchesBegin) { - ATH_MSG_VERBOSE( " initial fit with " << (*BunchesIter).size() << " tracks " ); - myJetCandidate=m_initializationHelper->initializeJetCandidate(*BunchesIter,&primaryVertex,&myDirection,&vtxSeedDirection); - if (not myJetCandidate) continue; - m_routines->initializeToMinDistancesToJetAxis(myJetCandidate); - if (not BunchesIter->empty()) { + if (msgLvl(MSG::VERBOSE)) msg() << " initial fit with " << (*BunchesIter).size() << " tracks " << endmsg; + myJetCandidate=m_initializationHelper->initializeJetCandidate(*BunchesIter,&primaryVertex,&myDirection,&vtxSeedDirection); + m_routines->initializeToMinDistancesToJetAxis(myJetCandidate); + if ((*BunchesIter).size()>0) + { doTheFit(myJetCandidate,true); } } else { - if (not myJetCandidate) continue; - ATH_MSG_VERBOSE( " other fit with " << BunchesIter->size() << " tracks " ); - std::vector<Trk::VxVertexOnJetAxis*> setOfVertices=myJetCandidate->getVerticesOnJetAxis(); - std::vector<Trk::VxTrackAtVertex*>* setOfTracks=myJetCandidate->vxTrackAtVertex(); - tracksToAddBegin=(*BunchesIter).begin(); - tracksToAddEnd=(*BunchesIter).end(); - for (tracksToAddIter=tracksToAddBegin;tracksToAddIter!=tracksToAddEnd;++tracksToAddIter) { - std::vector<Trk::VxTrackAtVertex*> temp_vector_tracksAtVertex; - ElementLink<Trk::TrackParticleBaseCollection> link; - link.setElement(const_cast<Trk::TrackParticleBase*>(*tracksToAddIter)); - Trk::LinkToTrackParticleBase * linkTT = new Trk::LinkToTrackParticleBase(link); - Trk::VxTrackAtVertex* newVxTrack=new Trk::VxTrackAtVertex(linkTT); - temp_vector_tracksAtVertex.push_back(newVxTrack); - setOfTracks->push_back(newVxTrack); - setOfVertices.push_back(new Trk::VxVertexOnJetAxis(temp_vector_tracksAtVertex)); - } - ATH_MSG_VERBOSE( " new overall number of tracks to fit : " << setOfVertices.size() ); - myJetCandidate->setVerticesOnJetAxis(setOfVertices); - m_initializationHelper->updateTrackNumbering(myJetCandidate); - m_routines->initializeToMinDistancesToJetAxis(myJetCandidate); - doTheFit(myJetCandidate); + if (msgLvl(MSG::VERBOSE)) msg() << " other fit with " << (*BunchesIter).size() << " tracks " << endmsg; + std::vector<Trk::VxVertexOnJetAxis*> setOfVertices=myJetCandidate->getVerticesOnJetAxis(); + std::vector<Trk::VxTrackAtVertex*>* setOfTracks=myJetCandidate->vxTrackAtVertex(); + tracksToAddBegin=(*BunchesIter).begin(); + tracksToAddEnd=(*BunchesIter).end(); + for (tracksToAddIter=tracksToAddBegin;tracksToAddIter!=tracksToAddEnd;++tracksToAddIter) { + std::vector<Trk::VxTrackAtVertex*> temp_vector_tracksAtVertex; + ElementLink<Trk::TrackParticleBaseCollection> link; + link.setElement(const_cast<Trk::TrackParticleBase*>(*tracksToAddIter)); + Trk::LinkToTrackParticleBase * linkTT = new Trk::LinkToTrackParticleBase(link); + Trk::VxTrackAtVertex* newVxTrack=new Trk::VxTrackAtVertex(linkTT); + temp_vector_tracksAtVertex.push_back(newVxTrack); + setOfTracks->push_back(newVxTrack); + setOfVertices.push_back(new Trk::VxVertexOnJetAxis(temp_vector_tracksAtVertex)); + } + if (msgLvl(MSG::VERBOSE)) msg() << " new overall number of tracks to fit : " << setOfVertices.size() << endmsg; + myJetCandidate->setVerticesOnJetAxis(setOfVertices); + m_initializationHelper->updateTrackNumbering(myJetCandidate); + m_routines->initializeToMinDistancesToJetAxis(myJetCandidate); + doTheFit(myJetCandidate); } } + std::vector<Trk::VxCandidate*> myCandidates; myCandidates.push_back(myJetCandidate); + +// return new Trk::VxSecVertexInfo(myCandidates);//ownership of the single objects is taken over! return 0; } - void - InDetJetFitterVxFinder::doTheFit(Trk::VxJetCandidate* myJetCandidate, - bool performClustering) const { + void InDetJetFitterVxFinder::doTheFit(Trk::VxJetCandidate* myJetCandidate, + bool performClustering) const { + int numClusteringLoops=0; bool noMoreVerticesToCluster(false); + do {//reguards clustering - ATH_MSG_VERBOSE( "InDetJetFitterVxFinder: ------>>>> new cycle of fit" ); + + if (msgLvl(MSG::VERBOSE)) msg() << "InDetJetFitterVxFinder: ------>>>> new cycle of fit" << endmsg; + int numLoops=0; bool noMoreTracksToDelete(false); do {//reguards eliminating incompatible tracks... - m_routines->performTheFit(myJetCandidate,10,false,30,0.001); - const std::vector<Trk::VxVertexOnJetAxis*> & vertices=myJetCandidate->getVerticesOnJetAxis(); - std::vector<Trk::VxVertexOnJetAxis*>::const_iterator verticesBegin=vertices.begin(); - std::vector<Trk::VxVertexOnJetAxis*>::const_iterator verticesEnd=vertices.end(); - //delete incompatible tracks... - float max_prob(1.); - Trk::VxVertexOnJetAxis* worseVertex(0); - for (std::vector<Trk::VxVertexOnJetAxis*>::const_iterator verticesIter=verticesBegin; - verticesIter!=verticesEnd;++verticesIter) { - if (*verticesIter==0) { - ATH_MSG_WARNING( "One vertex is empy. Problem when trying to delete incompatible vertices. No further vertices deleted." ); - } else { - const Trk::FitQuality & fitQuality=(*verticesIter)->fitQuality(); - if (TMath::Prob(fitQuality.chiSquared(),(int)std::floor(fitQuality.numberDoF()+0.5))<max_prob) { - max_prob=TMath::Prob(fitQuality.chiSquared(),(int)std::floor(fitQuality.numberDoF()+0.5)); - worseVertex=*verticesIter; - } - } - } - if (worseVertex and (max_prob<m_vertexProbCut)) { - ATH_MSG_DEBUG( "Deleted vertex " << worseVertex->getNumVertex() << " with probability " << max_prob ); - if (worseVertex==myJetCandidate->getPrimaryVertex()) { - ATH_MSG_INFO( " The most incompatible vertex is the primary vertex. Please check..." ); - } - m_routines->deleteVertexFromJetCandidate(worseVertex,myJetCandidate); - } else { - noMoreTracksToDelete=true; - ATH_MSG_VERBOSE( "No tracks to delete: maximum probability is " << max_prob ); - } - numLoops+=1; + + m_routines->performTheFit(myJetCandidate,10,false,30,0.001); + + const std::vector<Trk::VxVertexOnJetAxis*> & vertices=myJetCandidate->getVerticesOnJetAxis(); + + std::vector<Trk::VxVertexOnJetAxis*>::const_iterator verticesBegin=vertices.begin(); + std::vector<Trk::VxVertexOnJetAxis*>::const_iterator verticesEnd=vertices.end(); + + + //delete incompatible tracks... + float max_prob(1.); + Trk::VxVertexOnJetAxis* worseVertex(0); + for (std::vector<Trk::VxVertexOnJetAxis*>::const_iterator verticesIter=verticesBegin; + verticesIter!=verticesEnd;++verticesIter) { + if (*verticesIter==0) { + if (msgLvl(MSG::WARNING)) msg() << "One vertex is empy. Problem when trying to delete incompatible vertices. No further vertices deleted." << endmsg; + } else { + const Trk::FitQuality & fitQuality=(*verticesIter)->fitQuality(); + if (TMath::Prob(fitQuality.chiSquared(),(int)std::floor(fitQuality.numberDoF()+0.5))<max_prob) { + max_prob=TMath::Prob(fitQuality.chiSquared(),(int)std::floor(fitQuality.numberDoF()+0.5)); + worseVertex=*verticesIter; + } + } + } + if (max_prob<m_vertexProbCut) { + if (msgLvl(MSG::DEBUG)) msg() << "Deleted vertex " << worseVertex->getNumVertex() << " with probability " << max_prob << endmsg; + // std::cout << "Deleted vertex " << worseVertex->getNumVertex() << " with probability " << max_prob << std::endl; + if (worseVertex==myJetCandidate->getPrimaryVertex()) { + if (msgLvl(MSG::INFO)) msg() << " The most incompatible vertex is the primary vertex. Please check..." << endmsg; + } + + m_routines->deleteVertexFromJetCandidate(worseVertex,myJetCandidate); + + } else { + noMoreTracksToDelete=true; + if (msgLvl(MSG::VERBOSE)) msg() << "No tracks to delete: maximum probability is " << max_prob << endmsg; + } + + numLoops+=1; } while (numLoops<m_maxNumDeleteIterations&&!(noMoreTracksToDelete)); + if (!performClustering) break; + if (!m_useFastClustering) { - m_routines->fillTableWithFullProbOfMerging(myJetCandidate,5,false,10,0.01); + m_routines->fillTableWithFullProbOfMerging(myJetCandidate,5,false,10,0.01); } else { - m_routines->fillTableWithFastProbOfMerging(myJetCandidate); + m_routines->fillTableWithFastProbOfMerging(myJetCandidate); } const Trk::VxClusteringTable* clusteringTablePtr(myJetCandidate->getClusteringTable()); + + + + if (clusteringTablePtr==0) { - ATH_MSG_WARNING( " No Clustering Table while it should have been calculated... no more clustering performed during vertexing " ); - noMoreVerticesToCluster=true; + if (msgLvl(MSG::WARNING)) msg() << " No Clustering Table while it should have been calculated... no more clustering performed during vertexing " << endmsg; + noMoreVerticesToCluster=true; } else { - ATH_MSG_VERBOSE( " clustering table is " << *clusteringTablePtr ); - //now iterate over the full map and decide wether you want to do the clustering OR not... - float probVertex(0.); - Trk::PairOfVxVertexOnJetAxis pairOfVxVertexOnJetAxis=clusteringTablePtr->getMostCompatibleVertices(probVertex); - //a PairOfVxVertexOnJetAxis is a std::pair<VxVertexOnJetAxis*,VxVertexOnJetAxis*> - if (probVertex>0.&&probVertex>m_vertexClusteringProbabilityCut) { - ATH_MSG_VERBOSE( " merging vtx number " << (*pairOfVxVertexOnJetAxis.first).getNumVertex() << - " and " << (*pairOfVxVertexOnJetAxis.second).getNumVertex() ); - m_helper->mergeVerticesInJetCandidate(*pairOfVxVertexOnJetAxis.first, - *pairOfVxVertexOnJetAxis.second, - *myJetCandidate); - //now you need to update the numbering scheme - m_initializationHelper->updateTrackNumbering(myJetCandidate);//maybe this should be moved to a lower level... - } else { - noMoreVerticesToCluster=true; - } + + if (msgLvl(MSG::VERBOSE)) msg() << " clustering table is " << *clusteringTablePtr << endmsg; + + //now iterate over the full map and decide wether you want to do the clustering OR not... + float probVertex(0.); + Trk::PairOfVxVertexOnJetAxis pairOfVxVertexOnJetAxis=clusteringTablePtr->getMostCompatibleVertices(probVertex); + //a PairOfVxVertexOnJetAxis is a std::pair<VxVertexOnJetAxis*,VxVertexOnJetAxis*> + + if (probVertex>0.&&probVertex>m_vertexClusteringProbabilityCut) { + if (msgLvl(MSG::VERBOSE)) msg() << " merging vtx number " << (*pairOfVxVertexOnJetAxis.first).getNumVertex() << + " and " << (*pairOfVxVertexOnJetAxis.second).getNumVertex() << endmsg; + // const Trk::VxVertexOnJetAxis & mergedVertex= + m_helper->mergeVerticesInJetCandidate(*pairOfVxVertexOnJetAxis.first, + *pairOfVxVertexOnJetAxis.second, + *myJetCandidate); + //now you need to update the numbering scheme + m_initializationHelper->updateTrackNumbering(myJetCandidate);//maybe this should be moved to a lower level... + + } else { + noMoreVerticesToCluster=true; + } } numClusteringLoops+=1; } while (numClusteringLoops<m_maxClusteringIterations&&!(noMoreVerticesToCluster)); + //now a section should follow where the "complicate" VxJetCandidate is transformed in a conventional "VxCandidate" //so that it can be used also by the normal B-Tagging algorithms... //TO BE COMPLETED diff --git a/InnerDetector/InDetRecTools/InDetSecVxFinderTool/src/JetFitterMultiStageFit.cxx b/InnerDetector/InDetRecTools/InDetSecVxFinderTool/src/JetFitterMultiStageFit.cxx new file mode 100644 index 0000000000000000000000000000000000000000..5a100fc739f8b185f0b454c013ed45a61dd4aa71 --- /dev/null +++ b/InnerDetector/InDetRecTools/InDetSecVxFinderTool/src/JetFitterMultiStageFit.cxx @@ -0,0 +1,359 @@ +/* + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration + */ + +#include "InDetSecVxFinderTool/JetFitterMultiStageFit.h" + +#include "VxJetVertex/VxJetCandidate.h" +#include "VxJetVertex/VxVertexOnJetAxis.h" +#include "VxJetVertex/VxClusteringTable.h" +#include "VxJetVertex/PairOfVxVertexOnJetAxis.h" +#include "VxVertex/VxTrackAtVertex.h" + + +using namespace InDet; + +/* + * For the Hackathon, an example of a new algorithm tool + */ + + +JetFitterMultiStageFit::JetFitterMultiStageFit(const std::string &t, const std::string &n, const IInterface *p) + : AthAlgTool(t, n, p) +{ + // constructor, declare all necessary things + declareInterface< JetFitterMultiStageFit >(this); +} + + +JetFitterMultiStageFit::~JetFitterMultiStageFit() {} + +StatusCode JetFitterMultiStageFit::initialize() { + + StatusCode sc = AlgTool::initialize(); + if (sc.isFailure()) { + msg(MSG::ERROR) << " Unable to initialize the AlgTool" << endmsg; + return sc; + } + + sc = m_helper.retrieve(); + if(sc.isFailure()) { + msg(MSG::ERROR) << " Unable to retrieve "<<m_helper<<endmsg; + return StatusCode::FAILURE; + }else msg(MSG::INFO) << "JetFitter Helper retrieved"<<endmsg; + + sc = m_initializationHelper.retrieve(); + if(sc.isFailure()) { + msg(MSG::ERROR) << " Unable to retrieve "<<m_initializationHelper<<endmsg; + return StatusCode::FAILURE; + }else msg(MSG::INFO) << "JetFitter Initialization Helper retrieved"<<endmsg; + + sc = m_routines.retrieve(); + if(sc.isFailure()) + { + msg(MSG::ERROR) << " Unable to retrieve the JetFitter routines"<<m_routines<<endmsg; + return StatusCode::FAILURE; + } + else msg(MSG::INFO) << "JetFitter Routines class retrieved"<<endmsg; + + if (m_jetFitterUtils.retrieve().isFailure()) + { + msg(MSG::ERROR) << "Could not find JetFitterUtils tool." << endmsg; + return StatusCode::FAILURE; + } + else msg(MSG::INFO) << " JetFitterUtils retrieved" << endmsg; + + return StatusCode::SUCCESS; +} + +StatusCode JetFitterMultiStageFit::finalize() { + msg(MSG::INFO) << "Finalize successful" << endmsg; + return StatusCode::SUCCESS; +} + +Trk::VxJetCandidate* JetFitterMultiStageFit::doTwoStageFit(const Trk::RecVertex & primaryVertex, + const TLorentzVector & jetMomentum, + const std::vector<const Trk::ITrackLink*> & firstInputTracks, + const std::vector<const Trk::ITrackLink*> & secondInputTracks, + const Amg::Vector3D & vtxSeedDirection) const { + + msg(MSG::VERBOSE) << " entered findSecVertex(). Applying JetFitter finding to the found sets of tracks and performing clustering (pattern recognition) " << endmsg; + + Amg::Vector3D myDirection(jetMomentum.X(),jetMomentum.Y(),jetMomentum.Z()); + + std::vector<std::vector<const Trk::ITrackLink*> > bunchesOfTracks; // vector of vector of tracks + + std::vector<const Trk::ITrackLink*> tracksToAdd; + + std::vector<const Trk::ITrackLink*>::const_iterator tracks2Begin=firstInputTracks.begin(); + std::vector<const Trk::ITrackLink*>::const_iterator tracks2End=firstInputTracks.end(); + for (std::vector<const Trk::ITrackLink*>::const_iterator tracks2Iter=tracks2Begin; + tracks2Iter!=tracks2End;++tracks2Iter) { + //msg(MSG::VERBOSE) <<" adding track to fit " << endmsg; + tracksToAdd.push_back(*tracks2Iter); + } + + bunchesOfTracks.push_back(tracksToAdd); + tracksToAdd.clear(); + + std::vector<const Trk::ITrackLink*>::const_iterator tracks3Begin=secondInputTracks.begin(); + std::vector<const Trk::ITrackLink*>::const_iterator tracks3End=secondInputTracks.end(); + for (std::vector<const Trk::ITrackLink*>::const_iterator tracks3Iter=tracks3Begin; + tracks3Iter!=tracks3End;++tracks3Iter) { + if (msgLvl(MSG::VERBOSE)) msg() <<" adding track to fit " << endmsg; + tracksToAdd.push_back(*tracks3Iter); + } + + if (tracksToAdd.size()!=0) + { + bunchesOfTracks.push_back(tracksToAdd); + } + tracksToAdd.clear(); + + //now it just uses these bunches... + //now I have just to make sure that no clustering is done at first iteration + //while it needs to be done at second iteration (there will be only two iterations) + + + std::vector<std::vector<const Trk::ITrackLink*> >::const_iterator BunchesBegin=bunchesOfTracks.begin(); + std::vector<std::vector<const Trk::ITrackLink*> >::const_iterator BunchesEnd=bunchesOfTracks.end(); + + std::vector<const Trk::ITrackLink*>::const_iterator tracksToAddBegin; + std::vector<const Trk::ITrackLink*>::const_iterator tracksToAddEnd; + std::vector<const Trk::ITrackLink*>::const_iterator tracksToAddIter; + + + Trk::VxJetCandidate* myJetCandidate=0; + + for (std::vector<std::vector<const Trk::ITrackLink*> >::const_iterator BunchesIter=BunchesBegin; + BunchesIter!=BunchesEnd;++BunchesIter) { + + if (BunchesIter == BunchesBegin) { // this simply means we are only using tracksToUseInFirstFit + msg(MSG::VERBOSE) << " initial fit with " << (*BunchesIter).size() << " tracks " << endmsg; + myJetCandidate = m_initializationHelper->initializeJetCandidate(*BunchesIter, &primaryVertex, &myDirection, + &vtxSeedDirection); + m_routines->initializeToMinDistancesToJetAxis(myJetCandidate); + if ((*BunchesIter).size() > 0) { + doTheFit(myJetCandidate, true); + // Im confused, didnt the comment above say no clustering done in first iteration? + // yet performClustering = true in the call above?? + } + } + + // second stage using all tracks, why is it done this way with an if-else in a for loop... + else { + msg(MSG::VERBOSE) <<" other fit with " << (*BunchesIter).size() << " tracks " << endmsg; + std::vector<Trk::VxVertexOnJetAxis*> setOfVertices=myJetCandidate->getVerticesOnJetAxis(); + std::vector<Trk::VxTrackAtVertex*>* setOfTracks=myJetCandidate->vxTrackAtVertex(); + tracksToAddBegin=(*BunchesIter).begin(); + tracksToAddEnd=(*BunchesIter).end(); + + for (tracksToAddIter=tracksToAddBegin;tracksToAddIter!=tracksToAddEnd;++tracksToAddIter) { + std::vector<Trk::VxTrackAtVertex*> temp_vector_tracksAtVertex; + Trk::VxTrackAtVertex* newVxTrack=new Trk::VxTrackAtVertex((*tracksToAddIter)->clone()); + temp_vector_tracksAtVertex.push_back(newVxTrack); + setOfTracks->push_back(newVxTrack); + //add the new tracks to the candidate's track collection + setOfVertices.push_back(new Trk::VxVertexOnJetAxis(temp_vector_tracksAtVertex)); + //add new vertex with all the *BunchesIter tracks attached to it + } + + msg(MSG::VERBOSE) <<" new overall number of tracks (vertices?) to fit : " << setOfVertices.size() << endmsg; + myJetCandidate->setVerticesOnJetAxis(setOfVertices); + m_initializationHelper->updateTrackNumbering(myJetCandidate); + //question: should this be done??? + m_routines->initializeToMinDistancesToJetAxis(myJetCandidate); + // we re-initialize, is this wise? We've merged vertices in the previous iteration... + doTheFit(myJetCandidate); + } + } + + + + ATH_MSG_DEBUG(" returning jet candidate"); + return myJetCandidate; +} + + +void JetFitterMultiStageFit::doTheFit(Trk::VxJetCandidate* myJetCandidate, + bool performClustering) const { + + int numClusteringLoops=0; + bool noMoreVerticesToCluster(false); + + do {//regards clustering + + if (msgLvl(MSG::VERBOSE)) + msg() << "InDetImprovedJetFitterVxFinder: ------>>>> new cycle of fit" << endmsg; + + int numLoops = 0; + bool noMoreTracksToDelete(false); + do {//regards eliminating incompatible tracks... + + m_routines->performTheFit(myJetCandidate, 15, false, 30, 0.001); + + const std::vector<Trk::VxVertexOnJetAxis *> &vertices = myJetCandidate->getVerticesOnJetAxis(); + + std::vector<Trk::VxVertexOnJetAxis *>::const_iterator verticesBegin = vertices.begin(); + std::vector<Trk::VxVertexOnJetAxis *>::const_iterator verticesEnd = vertices.end(); + + + //delete incompatible tracks... + float max_prob(1.); + Trk::VxVertexOnJetAxis *worseVertex(0); + for (std::vector<Trk::VxVertexOnJetAxis *>::const_iterator verticesIter = verticesBegin; + verticesIter != verticesEnd; ++verticesIter) { + if (*verticesIter == 0) { + msg(MSG::WARNING) + << "One vertex is empy. Problem when trying to delete incompatible vertices. No further vertices deleted." + << endmsg; + } else { + const Trk::FitQuality &fitQuality = (*verticesIter)->fitQuality(); + if (TMath::Prob(fitQuality.chiSquared(), (int) std::floor(fitQuality.numberDoF() + 0.5)) < + max_prob) { + max_prob = TMath::Prob(fitQuality.chiSquared(), (int) std::floor(fitQuality.numberDoF() + 0.5)); + worseVertex = *verticesIter; + } + } + } + if (max_prob < m_vertexProbCut) { + if (msgLvl(MSG::DEBUG)) + msg() << "Deleted vertex " << worseVertex->getNumVertex() << " with probability " << max_prob + << endmsg; + // std::cout << "Deleted vertex " << worseVertex->getNumVertex() << " with probability " << max_prob << std::endl; + if (worseVertex == myJetCandidate->getPrimaryVertex()) { + if (msgLvl(MSG::VERBOSE)) msg() << " It's the primary" << endmsg; + } + + m_routines->deleteVertexFromJetCandidate(worseVertex, myJetCandidate); + + } + else { + noMoreTracksToDelete = true; + if (msgLvl(MSG::VERBOSE)) msg() << "No tracks to delete: maximum probability is " << max_prob << endmsg; + } + + numLoops += 1; + } while (numLoops < m_maxNumDeleteIterations && !(noMoreTracksToDelete)); + + if (!performClustering) break; + + // m_useFastClustering is false, so possibly can be removed ?? + if (!m_useFastClustering && (int)myJetCandidate->getVerticesOnJetAxis().size()<m_maxTracksForDetailedClustering) { + m_routines->fillTableWithFullProbOfMerging(myJetCandidate,8,false,10,0.01); + } + + else { + m_routines->fillTableWithFastProbOfMerging(myJetCandidate); + } + const Trk::VxClusteringTable* clusteringTablePtr(myJetCandidate->getClusteringTable()); + msg(MSG::VERBOSE) << "clustering table retrieved" << endmsg; + + + if (clusteringTablePtr==0) { + msg(MSG::WARNING) << " No Clustering Table while it should have been calculated... no more clustering performed during vertexing " << endmsg; + noMoreVerticesToCluster=true; + } + // why else here? why not just continue in if above? + else { + msg(MSG::VERBOSE) <<" clustering table is " << *clusteringTablePtr << endmsg; //suppress this? + + //now iterate over the full map and decide wether you want to do the clustering OR not... + float probVertex(0.); + + // probVertex is passed by reference, below function modifies it... + Trk::PairOfVxVertexOnJetAxis pairOfVxVertexOnJetAxis=clusteringTablePtr->getMostCompatibleVertices(probVertex); + //a PairOfVxVertexOnJetAxis is a std::pair<VxVertexOnJetAxis*,VxVertexOnJetAxis*> + + float probVertexExcludingPrimary(0.); + Trk::PairOfVxVertexOnJetAxis pairOfVxVertexOnJetAxisExcludingPrimary=clusteringTablePtr->getMostCompatibleVerticesExcludingPrimary(probVertexExcludingPrimary); + + // essentially below ask if the two vals are the same, to a tolerance of 1e-6 ... + bool firstProbIsWithPrimary= ( fabs(probVertex-probVertexExcludingPrimary)>1e-6 ); + // is there a better way of establishing this? + + // merging vertex with primary (if cond satisfied + if (probVertex>0.&&probVertex>m_vertexClusteringProbabilityCut&&firstProbIsWithPrimary) { + msg(MSG::VERBOSE) <<" merging vtx number " << (*pairOfVxVertexOnJetAxis.first).getNumVertex() << + " and " << (*pairOfVxVertexOnJetAxis.second).getNumVertex() << " (should be PV)." << endmsg; // what do these numVertex mean? e.g. -10, 0, 1, ...? + + m_helper->mergeVerticesInJetCandidate(*pairOfVxVertexOnJetAxis.first, + *pairOfVxVertexOnJetAxis.second, + *myJetCandidate); + + //now you need to update the numbering scheme + m_initializationHelper->updateTrackNumbering(myJetCandidate);//maybe this should be moved to a lower level... + continue; + } + + // determine whether to merge vertices that are compatible, where neither are the primary + if (probVertexExcludingPrimary>0.) { + + //GP suggested by Marco Battaglia, use vertex mass in order to decide wether to split or not, so derive vertex masses first + const Trk::VxVertexOnJetAxis *firstVertex = pairOfVxVertexOnJetAxisExcludingPrimary.first; + const Trk::VxVertexOnJetAxis *secondVertex = pairOfVxVertexOnJetAxisExcludingPrimary.second; + + CLHEP::HepLorentzVector massVector1 = m_jetFitterUtils->fourMomentumAtVertex(*firstVertex);//MeV + CLHEP::HepLorentzVector massVector2 = m_jetFitterUtils->fourMomentumAtVertex(*secondVertex);//MeV + + CLHEP::HepLorentzVector sumMassVector = massVector1 + massVector2; + + double massTwoVertex = sumMassVector.mag();//MeV + + bool doMerge(false); + + double vertexClusteringProbabilityCutWithMass; + + // surely a better way than below... + if (massTwoVertex < 1000.) { + vertexClusteringProbabilityCutWithMass = m_vertexClusteringProbabilityCutWithMass0010; + } else if (massTwoVertex < 1500.) { + vertexClusteringProbabilityCutWithMass = m_vertexClusteringProbabilityCutWithMass1015; + } else if (massTwoVertex < 2000.) { + vertexClusteringProbabilityCutWithMass = m_vertexClusteringProbabilityCutWithMass1520; + } else if (massTwoVertex < 2500.) { + vertexClusteringProbabilityCutWithMass = m_vertexClusteringProbabilityCutWithMass2025; + } else if (massTwoVertex < 3000.) { + vertexClusteringProbabilityCutWithMass = m_vertexClusteringProbabilityCutWithMass2530; + } else if (massTwoVertex < 4000.) { + vertexClusteringProbabilityCutWithMass = m_vertexClusteringProbabilityCutWithMass3040; + } else if (massTwoVertex < 5000.) { + vertexClusteringProbabilityCutWithMass = m_vertexClusteringProbabilityCutWithMass4050; + } else if (massTwoVertex < 6000.) { + vertexClusteringProbabilityCutWithMass = m_vertexClusteringProbabilityCutWithMass5060; + } else { + vertexClusteringProbabilityCutWithMass = m_vertexClusteringProbabilityCutWithMass6070; + } + + if (probVertexExcludingPrimary > vertexClusteringProbabilityCutWithMass) { + doMerge = true; // why not just have doMerge = probVertexExcludingPrimary > vertexClusteringProbabilityCutWithMass ? + } + + if (doMerge) + { + + msg(MSG::VERBOSE) <<" merging vtx number " << (*pairOfVxVertexOnJetAxis.first).getNumVertex() << + " and " << (*pairOfVxVertexOnJetAxis.second).getNumVertex() << " mass merged vertex: " << massTwoVertex << endmsg; + + m_helper->mergeVerticesInJetCandidate(*pairOfVxVertexOnJetAxisExcludingPrimary.first, + *pairOfVxVertexOnJetAxisExcludingPrimary.second, + *myJetCandidate); + + m_initializationHelper->updateTrackNumbering(myJetCandidate);//maybe this should be moved to a lower level... + continue;//go to next cycle, after a succesful merging + } + } + + noMoreVerticesToCluster=true; + + } + + numClusteringLoops+=1; // when will this ever be greater than 1? + // noMoreVerticesToCluster has been set to true by the time this line is reached + // so numClusteringLoops will equal 1 and thats the end of the while loop (see below)... + + } while (numClusteringLoops<m_maxClusteringIterations&&!(noMoreVerticesToCluster)); + + + +} diff --git a/InnerDetector/InDetRecTools/InDetSecVxFinderTool/src/JetFitterTrackSelectorTool.cxx b/InnerDetector/InDetRecTools/InDetSecVxFinderTool/src/JetFitterTrackSelectorTool.cxx new file mode 100644 index 0000000000000000000000000000000000000000..28b48d77effbe51946345ccdc483e845341acbb0 --- /dev/null +++ b/InnerDetector/InDetRecTools/InDetSecVxFinderTool/src/JetFitterTrackSelectorTool.cxx @@ -0,0 +1,158 @@ +/* + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration +*/ + +#include "InDetSecVxFinderTool/JetFitterTrackSelectorTool.h" + +using namespace InDet; + + JetFitterTrackSelectorTool::JetFitterTrackSelectorTool(const std::string &t, const std::string &n, const IInterface *p) + : AthAlgTool(t, n, p) + { + declareInterface< JetFitterTrackSelectorTool >(this); + } + + JetFitterTrackSelectorTool::~JetFitterTrackSelectorTool() {} + + StatusCode JetFitterTrackSelectorTool::initialize() { + + if ( AlgTool::initialize().isFailure() ) { + msg(MSG::ERROR) << " Unable to initialize the AlgTool" << endmsg; + return StatusCode::FAILURE; + } + + if ( m_trkFilter.retrieve().isFailure() ) { + msg(MSG::ERROR) << " Unable to retrieve InDet::InDetDetailedTrackSelectorTool" << endmsg; + return StatusCode::FAILURE; + } + + if ( m_jetFitterUtils.retrieve().isFailure() ) { + msg(MSG::ERROR) << " Unable to retrieve InDet::InDetJetFitterUtils/InDetJetFitterUtils" << endmsg; + return StatusCode::FAILURE; + } + + if ( m_extrapolator.retrieve().isFailure() ) { + msg(MSG::ERROR) << " Unable to retrieve Trk::Extrapolator/InDetExtrapolator" << endmsg; + return StatusCode::FAILURE; + } + + return StatusCode::SUCCESS; + } + + StatusCode JetFitterTrackSelectorTool::finalize() { + msg(MSG::INFO) << "Finalize successful" << endmsg; + return StatusCode::SUCCESS; + } + + const Trk::SelectedTracksInJet* JetFitterTrackSelectorTool::doTrackSelection( const xAOD::Vertex &primaryVertex, + const TLorentzVector &jetMomentum, + const std::vector<const xAOD::IParticle *> &inputTracks) const { + // perform the track selection + // step 1, apply a track filter like "InDet::InDetDetailedTrackSelectorTool" + // step 2, calculate the compatibility of filtered tracks with primary vertex + // use this to deduce primaryTracks and secondaryTracks + + ATH_MSG_DEBUG( "Doing track selection on " << inputTracks.size() << " tracks ... " ); + + // We need to use normal pointers instead of smart pointers since the code breaks. + // We have to fix this issue in the future + // if ( m_selectedTracks != nullptr ) delete m_selectedTracks; // May this break the code? + Trk::SelectedTracksInJet *selectedTracks = new Trk::SelectedTracksInJet(); + + // Vectors of Trk::ITrackLink to be given to m_selectedTracks once we understand if they are primary of secondary tracks + std::vector< const Trk::ITrackLink* > primaryTrackLinks; + std::vector< const Trk::ITrackLink* > secondaryTrackLinks; + + // Running on input tracks + std::vector<const xAOD::IParticle *>::const_iterator trk_iter = inputTracks.begin(); + std::vector<const xAOD::IParticle*>::const_iterator trk_end = inputTracks.end(); + + int counter = 0; + for ( ; trk_iter != trk_end; trk_iter++ ) { + // Convert xAOD::IParticle to xAOD::TrackParticle + const xAOD::TrackParticle * tmp = dynamic_cast< const xAOD::TrackParticle* > ( *trk_iter ); + + // Apply track filter + if ( m_trkFilter->decision( *tmp,&primaryVertex ) == false ) continue; + + // Compute compatibility and understand track type + // 0: extrapolation of MeasuredPerigee failed + // 1: primary + // 2: secondary + int type = computeTrackCompatibility( primaryVertex,jetMomentum,*tmp ); + + // Create Trk::ITrackLink collections to be given to selected tracks + ElementLink< xAOD::TrackParticleContainer > linkTP; + linkTP.setElement( tmp ); + + Trk::LinkToXAODTrackParticle* link= new Trk::LinkToXAODTrackParticle( linkTP ); + + if ( type == 1) primaryTrackLinks.push_back( link ); + else if ( type == 2 ) secondaryTrackLinks.push_back( link ); + else continue; + + // How many tracks we are selecting + counter++; + } + + ATH_MSG_DEBUG( " Total of selected tracks: "<< counter ); + + selectedTracks->setPrimaryTrackLinks( primaryTrackLinks ); + selectedTracks->setSecondaryTrackLinks( secondaryTrackLinks ); + return selectedTracks; + } + + int JetFitterTrackSelectorTool::computeTrackCompatibility( const xAOD::Vertex &primaryVertex, + const TLorentzVector &jetMomentum, + const xAOD::TrackParticle &track ) const { + + // Decorators for tracks + SG::AuxElement::Decorator< float > compatibilityDecorator( "TrackCompatibility" ); + + // Recomputing Perigee w.r.t PV + Trk::PerigeeSurface mySurface( primaryVertex.position() ); + const Trk::TrackParameters* myMeasuredPerigee = m_extrapolator->extrapolate( track,mySurface ); + if ( myMeasuredPerigee == nullptr ) { + ATH_MSG_DEBUG( " Extrapolation to primary vertex failed. Skipping track " ); + compatibilityDecorator ( track ) = 0.; + return 0; + } + + + // Prepare for using jetFitterUtils (for the computation of the compatibility) + // Is this conrvertion really necessary? + Trk::RecVertex primaryVertexRecVertex( primaryVertex.position(), + primaryVertex.covariancePosition(), + primaryVertex.numberDoF(), + primaryVertex.chiSquared()); + + Amg::Vector3D jetMomSpatial( jetMomentum.X(),jetMomentum.Y(),jetMomentum.Z() ); + double compatibilityValue = m_jetFitterUtils->compatibility( *myMeasuredPerigee,primaryVertexRecVertex ).first; + compatibilityValue = fabs( compatibilityValue ) * m_jetFitterUtils->get3DLifetimeSignOfTrack( *myMeasuredPerigee, + jetMomSpatial, + primaryVertexRecVertex ); + + // Decorate + ATH_MSG_DEBUG( "compatibilityValue = " << compatibilityValue ); + compatibilityDecorator ( track ) = compatibilityValue; + + // Understand if primary or secondary track particle + double cutCompatibilityPVforPosTracks = m_cutCompatibilityPrimaryVertexForPositiveLifetimeTracks; + double cutCompatibilityPVforNegTracks = m_cutCompatibilityPrimaryVertexForNegativeLifetimeTracks; + + if ( m_revertFromPositiveToNegativeTags ) { + cutCompatibilityPVforNegTracks = m_cutCompatibilityPrimaryVertexForPositiveLifetimeTracks; + cutCompatibilityPVforPosTracks = m_cutCompatibilityPrimaryVertexForNegativeLifetimeTracks; + } + + if ( ( compatibilityValue < 0 && + TMath::Prob( fabs( compatibilityValue ),2 ) < cutCompatibilityPVforNegTracks) || + ( compatibilityValue >= 0 && + TMath::Prob( fabs( compatibilityValue ),2 ) < cutCompatibilityPVforPosTracks ) ) + return 2; + else return 1; + + } + + + diff --git a/InnerDetector/InDetRecTools/InDetSecVxFinderTool/src/JetFitterTwoTrackVtxFinderTool.cxx b/InnerDetector/InDetRecTools/InDetSecVxFinderTool/src/JetFitterTwoTrackVtxFinderTool.cxx new file mode 100644 index 0000000000000000000000000000000000000000..4f9e9b8602b73070055e328c59a504e14db91a87 --- /dev/null +++ b/InnerDetector/InDetRecTools/InDetSecVxFinderTool/src/JetFitterTwoTrackVtxFinderTool.cxx @@ -0,0 +1,155 @@ +/* + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration +*/ + +#include "InDetSecVxFinderTool/JetFitterTwoTrackVtxFinderTool.h" + +#include "TrkVertexSeedFinderTools/CrossDistancesSeedFinder.h" +#include "TrkVertexFitters/SequentialVertexFitter.h" + +#include "xAODTracking/TrackParticleContainer.h" +#include "xAODTracking/TrackParticleAuxContainer.h" +#include "TrkParticleBase/LinkToTrackParticleBase.h" +#include "TrkLinks/LinkToXAODTrackParticle.h" + +using namespace InDet; + +JetFitterTwoTrackVtxFinderTool::JetFitterTwoTrackVtxFinderTool(const std::string &t, const std::string &n, const IInterface *p) + : AthAlgTool(t, n, p), + m_tracksDecorator( "VxTrackAtVertex" ) +{ + declareInterface< JetFitterTwoTrackVtxFinderTool >(this); +} + +JetFitterTwoTrackVtxFinderTool::~JetFitterTwoTrackVtxFinderTool() {} + + +StatusCode JetFitterTwoTrackVtxFinderTool::initialize() { + + if ( m_CrossDistancesSeedFinder.retrieve().isFailure() ) { + ATH_MSG_ERROR( "Cannot retrieve Trk::CrossDistancesSeedFinder/CrossDistancesSeedFinder" ); + return StatusCode::FAILURE; + } + + if ( m_SequentialVertexFitter.retrieve().isFailure() ) { + ATH_MSG_ERROR( "Cannot retrieve Trk::SequentialVertexFitter/SequentialVertexFitter" ); + return StatusCode::FAILURE; + } + + return StatusCode::SUCCESS; +} + +StatusCode JetFitterTwoTrackVtxFinderTool::finalize() { + return StatusCode::SUCCESS; +} + + +const Trk::TwoTrackVerticesInJet* JetFitterTwoTrackVtxFinderTool::doVertexFinding( const xAOD::Vertex& primaryVertex, + const TLorentzVector& jetMomentum, + std::vector< const Trk::ITrackLink* >& inputTracks) const { + + std::vector< const xAOD::Vertex* > VtxCandidates; + + ATH_MSG_DEBUG( "Looping over " << inputTracks.size() << " input tracks... " ); + + // Loop over all the combinations + for ( unsigned int indexA(0); indexA<inputTracks.size(); indexA++ ) { + const Trk::ITrackLink* trackA = inputTracks.at( indexA ); + + for ( unsigned int indexB(0); indexB<indexA; indexB++ ) { + const Trk::ITrackLink* trackB = inputTracks.at( indexB ); + + // Computing the Vertex candidate + xAOD::Vertex *myCandidate = computeVtxcandidate( primaryVertex,jetMomentum,trackA,trackB ); + if ( myCandidate == nullptr ) continue; + + // Attaching tracks to vertex candidate + std::vector< const Trk::ITrackLink* > associatedTracksAtVertex; + associatedTracksAtVertex.push_back( trackA ); + associatedTracksAtVertex.push_back( trackB ); + m_tracksDecorator ( *myCandidate ) = associatedTracksAtVertex; + + VtxCandidates.push_back( myCandidate ); + } + } + + + ATH_MSG_DEBUG( "Found " << VtxCandidates.size() <<" 2-trk vertex candidates!" ); + + const Trk::TwoTrackVerticesInJet *twoTrackVerticesInJet = new Trk::TwoTrackVerticesInJet ( VtxCandidates, + std::vector< const Trk::TrackParticleBase* >() ); + return twoTrackVerticesInJet; +} + +xAOD::Vertex* JetFitterTwoTrackVtxFinderTool::computeVtxcandidate( const xAOD::Vertex& primaryVertex, + const TLorentzVector& jetMomentum, + const Trk::ITrackLink* trackA, + const Trk::ITrackLink* trackB ) const { + + const Trk::TrackParameters* perigeeTrackA = trackA->parameters(); + const Trk::TrackParameters* perigeeTrackB = trackB->parameters(); + + std::vector< const Trk::TrackParameters* > perigeeToFit; + perigeeToFit.push_back( perigeeTrackA ); + perigeeToFit.push_back( perigeeTrackB ); + + Amg::Vector3D seedVertex; + try { + seedVertex = m_CrossDistancesSeedFinder->findSeed( perigeeToFit ); + + if ( seedVertex.perp() > m_maxR || + fabs( seedVertex.z() ) > m_maxZ ) { + ATH_MSG_DEBUG( "Vertex seed outside ID. R=" << seedVertex.perp() << " Z=" << seedVertex.z() ); + seedVertex = primaryVertex.position(); + } + + } catch (...) { + ATH_MSG_DEBUG( "Seed finding failed. Using primary vertex as seed... (clearly not optimal)" ); + seedVertex = Amg::Vector3D( primaryVertex.position() ); + } + + ATH_MSG_DEBUG( "Seed: x=" << seedVertex.x() << + " y=" << seedVertex.y() << + " z=" << seedVertex.z() ); + + + // Compute V0 candidate + std::unique_ptr< xAOD::Vertex > myCandidate( m_SequentialVertexFitter->fit(perigeeToFit,seedVertex) ); + + // Check fit completed with success + if ( myCandidate == nullptr ) { + ATH_MSG_DEBUG( " Sequential fit failed. shouldn't happen... Skipping V0 candidate... " ); + return nullptr; + } + + // Check ChiSquared and nDof + if ( myCandidate->chiSquared() < 0 || + myCandidate->numberDoF() < 0 ) { + ATH_MSG_DEBUG( " Fit for V0 candidate failed: chi2 or ndf negative. Deleting candidate..." ); + return nullptr; + } + + // Check two-vertex probability + if ( TMath::Prob( myCandidate->chiSquared(),myCandidate->numberDoF() ) <= m_twoVertexProbabilityCut ) { + ATH_MSG_DEBUG( " Candidate not satisfying two-vertex probability " ); + return nullptr; + } + + // Check sign and revertFromPositiveToNegativeTags + Amg::Vector3D jetMomSpatial( jetMomentum.X(),jetMomentum.Y(),jetMomentum.Z() ); + Amg::Vector3D twoTrkVtxPos( myCandidate->position() ); + double sign = ( twoTrkVtxPos-primaryVertex.position() ).dot( jetMomSpatial ); + + if ( sign >= 0 && m_revertFromPositiveToNegativeTags ) { + ATH_MSG_DEBUG( "Not satisfying sign and revertFromPositiveToNegativeTags requirements" ); + return nullptr; + } + + ATH_MSG_DEBUG( " Candidate: x=" << myCandidate->x() << + " y=" << myCandidate->y() << + " z=" << myCandidate->z() ); + + return myCandidate.release(); +} + + diff --git a/InnerDetector/InDetRecTools/InDetSecVxFinderTool/src/JetFitterV0FinderTool.cxx b/InnerDetector/InDetRecTools/InDetSecVxFinderTool/src/JetFitterV0FinderTool.cxx new file mode 100644 index 0000000000000000000000000000000000000000..f23871503b4af6da55f2790afe0a53b0eb327209 --- /dev/null +++ b/InnerDetector/InDetRecTools/InDetSecVxFinderTool/src/JetFitterV0FinderTool.cxx @@ -0,0 +1,412 @@ +/* + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration +*/ + +#include "InDetSecVxFinderTool/JetFitterV0FinderTool.h" + +#include "xAODTracking/TrackParticleContainer.h" +#include "xAODTracking/TrackParticleAuxContainer.h" +#include "TrkParticleBase/LinkToTrackParticleBase.h" +#include "TrkLinks/LinkToXAODTrackParticle.h" + +using namespace InDet; + +JetFitterV0FinderTool::JetFitterV0FinderTool(const std::string &t, const std::string &n, const IInterface *p) + : AthAlgTool(t, n, p), + m_compatibilityAccessor( "TrackCompatibility" ), + m_tracksAccessor( "VxTrackAtVertex" ) +{ + declareInterface< JetFitterV0FinderTool >(this); +} + +JetFitterV0FinderTool::~JetFitterV0FinderTool() {} + + +StatusCode JetFitterV0FinderTool::initialize() { + + if ( m_jetFitterUtils.retrieve().isFailure() ) { + ATH_MSG_ERROR( "Cannot retrieve InDet::InDetJetFitterUtils/InDetJetFitterUtils" ); + return StatusCode::FAILURE; + } + + if ( m_mode3dfinder.retrieve().isFailure() ) { + ATH_MSG_ERROR( "Cannot retrieve Trk::Mode3dTo1dFinder/Mode3dTo1dFinder" ); + return StatusCode::FAILURE; + } + + return StatusCode::SUCCESS; +} + +StatusCode JetFitterV0FinderTool::finalize() { + return StatusCode::SUCCESS; +} + + + +const Trk::TwoTrackVerticesInJet* JetFitterV0FinderTool::doV0Finding( const xAOD::Vertex& primaryVertex, + const TLorentzVector& jetMomentum, + std::vector< const Trk::ITrackLink* >& inputTracks, + const std::vector< const xAOD::Vertex* >& vertexCandidates, + std::vector< const Trk::ITrackLink* >& tracksToUseInFirstFit, + std::vector< const Trk::ITrackLink* >& tracksToUseInSecondFit, + Amg::Vector3D& JFseedDirection ) const { + + // Vector of seeding vertices. + std::vector< Trk::PositionAndWeight > positionsOfSeedingVertices; + + // Using a function here, may become tool in the future! + // Phase 3, 4 and 5: find and select v0 candidates + std::vector< const xAOD::Vertex* > v0candidates = findV0candidates( primaryVertex,jetMomentum,inputTracks, vertexCandidates ); + ATH_MSG_DEBUG( "Found " << v0candidates.size() <<" V0 candidates!" ); + + // Phase 6 + // Select tracks for first fit using only the "best tracks" from the two-track vertices + ATH_MSG_DEBUG( "Analyzing two track vertices to select the best tracks" ); + for ( const xAOD::Vertex* v0candidate : v0candidates ) { + + // Check quality for first fit + bool satisfyCriteriaFirstFitQuality = checkCriteriaFirstFit( primaryVertex,jetMomentum,*v0candidate ); + if ( not satisfyCriteriaFirstFitQuality ) { + ATH_MSG_DEBUG( "Quality criteria for first fit not satisfied! skipping ... " ); + continue; + } + + // The v0 candidate satisfy the selection criteria + // Filling the vector of tracks to be used in the first fit + std::vector< const Trk::ITrackLink* > vxTrackAtVertex = m_tracksAccessor( *v0candidate ); + const Trk::ITrackLink *firstTrack = vxTrackAtVertex.at(0); + const Trk::ITrackLink *secondTrack = vxTrackAtVertex.at(1); + + // Second track added first, legacy from old jetfitter + bool secondTrackAlreadyStored = m_jetFitterUtils->checkIfTrackIsInVector( secondTrack,tracksToUseInFirstFit ); + if ( not secondTrackAlreadyStored ) + tracksToUseInFirstFit.push_back( secondTrack ); + + // First track + bool firstTrackAlreadyStored = m_jetFitterUtils->checkIfTrackIsInVector( firstTrack,tracksToUseInFirstFit ); + if ( not firstTrackAlreadyStored ) + tracksToUseInFirstFit.push_back( firstTrack ); + + positionsOfSeedingVertices.push_back( Trk::PositionAndWeight( v0candidate->position(),1 ) ); + } + + + // Phase 7 + ATH_MSG_DEBUG( "Determine single good tracks to add in the fit in a second step" ); + for ( const Trk::ITrackLink *trackLink : inputTracks ) { + + bool satisfyCriteriaSecondFitQuality = checkCriteriaSecondFit( primaryVertex,trackLink ); + if ( not satisfyCriteriaSecondFitQuality ) { + ATH_MSG_DEBUG( "Quality criteria for second fit not satisfied! skipping ... " ); + continue; + } + + bool alreadyUsed = m_jetFitterUtils->checkIfTrackIsInVector( trackLink,tracksToUseInFirstFit ); + if ( alreadyUsed ) { + ATH_MSG_VERBOSE( "Track was already used" ); + continue; + } + + bool trackAlreadyStored = m_jetFitterUtils->checkIfTrackIsInVector( trackLink,tracksToUseInSecondFit ); + if ( not trackAlreadyStored ) + tracksToUseInSecondFit.push_back( trackLink ); + } + + + // Compute JFseedDirection + JFseedDirection = computeSeedDirection( primaryVertex,jetMomentum,positionsOfSeedingVertices ); + + // First argument is the list of vertex candidates + // Second argument is the list of Selected Neutral Tracks To Store + // The Trk::TwoTrackVerticesInJet takes over the ownership + + // We need to use normal pointers instead of smart pointers since the code breaks. + // We have to fix this issue in the future + const Trk::TwoTrackVerticesInJet *twoTrackVerticesInJet = new Trk::TwoTrackVerticesInJet( v0candidates, + std::vector< const Trk::TrackParticleBase* >() ); + return twoTrackVerticesInJet; +} + +std::vector< const xAOD::Vertex* > JetFitterV0FinderTool::findV0candidates( const xAOD::Vertex& /*primaryVertex*/, + const TLorentzVector& /*jetMomentum*/, + std::vector< const Trk::ITrackLink* >& /*inputTracks*/, + const std::vector< const xAOD::Vertex* >& vertexCandidates ) const { + + std::vector< const xAOD::Vertex* > v0candidates; + ATH_MSG_DEBUG( "Looping over " << vertexCandidates.size() <<" input candidates" ); + + for ( unsigned int indexA(0); indexA<vertexCandidates.size(); indexA++ ) { + const xAOD::Vertex* myCandidate = vertexCandidates.at( indexA ); + + // Here a shortlist of candidates will be applied + + // Phase 4 and 5 (not called in old code)! + // Check for photon convertion, Ks and Lambda + // Veto candidates and tracks + + // Make a copy of the input candidate + // This way of creating a copy creates a discrepancy w.r.t. the code in rel21, which is propagated to Jet Fitter variables. + // However, this assures that the vertex positions retrieved via position().x() and x() are consistent + xAOD::Vertex* toAdd = new xAOD::Vertex(); + v0candidates.push_back( toAdd ); + *toAdd = *myCandidate; + } + + return v0candidates; +} + +bool JetFitterV0FinderTool::checkCriteriaFirstFit( const xAOD::Vertex& primaryVertex, + const TLorentzVector& jetMomentum, + const xAOD::Vertex& v0candidate ) const { + + + // Check vertex probability + double vertexProb = TMath::Prob( v0candidate.chiSquared(), + v0candidate.numberDoF() ); + + if ( ( vertexProb < m_cutTwoTrkVtxVertexProbForBFirstSelectionFirstCriterium ) && + ( vertexProb < m_cutTwoTrkVtxVertexProbForBFirstSelectionSecondCriterium ) ) { + ATH_MSG_DEBUG( "V0 candidate does not satisfy the vertex prob criteria!" ); + return false; + } + + + + // Retrieve and prepare objects + const std::vector< const Trk::ITrackLink* > vxTrackAtVertex = m_tracksAccessor( v0candidate ); + const Trk::ITrackLink* trackLink1 = vxTrackAtVertex.at( 0 ); + const Trk::ITrackLink* trackLink2 = vxTrackAtVertex.at( 1 ); + + if ( trackLink1 == nullptr || trackLink2 == nullptr ) { + ATH_MSG_DEBUG( "Zero pointer (ITrackLink): skipping 2-track candidate" ); + return false; + } + + const Trk::LinkToXAODTrackParticle* linkTrackA = dynamic_cast< const Trk::LinkToXAODTrackParticle* >( trackLink1 ); + const Trk::LinkToXAODTrackParticle* linkTrackB = dynamic_cast< const Trk::LinkToXAODTrackParticle* >( trackLink2 ); + + if ( !linkTrackA || !linkTrackB ) { + ATH_MSG_DEBUG( "Zero pointer (LinkToXAODTrackParticle): skipping 2-track candidate" ); + return false; + } + + + // TO-DO + // remove track candidates that are supposed to be voted ! + + + + + // Take track compatibility and compute flight significance + // compatibility is attached to tracks, so we need to retrieve xAOD::TrackParticles objects + float compatibiltyTrackA = m_compatibilityAccessor( ***linkTrackA ); + float compatibiltyTrackB = m_compatibilityAccessor( ***linkTrackB ); + + if ( TMath::Prob( fabs(compatibiltyTrackA),2 ) >= m_cutCompatibilityPrimaryVertexSingleTrackForBFirstSelection ) return false; + if ( TMath::Prob( fabs(compatibiltyTrackB),2 ) >= m_cutCompatibilityPrimaryVertexSingleTrackForBFirstSelection ) return false; + if ( TMath::Prob( fabs(compatibiltyTrackA) + fabs(compatibiltyTrackB),4 ) >= m_cutCompatibilityPrimaryVertexBothTracksForBFirstSelection ) return false; + + + // Criteria on D0 and Z0 of the tracks w.r.t. primary vertex + const Trk::TrackParameters* initialPerigee1 = linkTrackA->parameters(); + const Trk::TrackParameters* initialPerigee2 = linkTrackB->parameters(); + + if ( !initialPerigee1 || !initialPerigee2 ) { + ATH_MSG_DEBUG( "No refitted parameters available for 2-track vertex. Candidate not accepted..." ); + return false; + } + + if ( initialPerigee1->momentum().perp() <= m_cutPtBothTracksForBFirstSelection ) return false; + if ( initialPerigee2->momentum().perp() <= m_cutPtBothTracksForBFirstSelection ) return false; + + + + + // Need to create Trk::RecVertex object. Is this really necessary? + Trk::RecVertex primaryVertexRecVertex( primaryVertex.position(), + primaryVertex.covariancePosition(), + primaryVertex.numberDoF(), + primaryVertex.chiSquared()); + + std::pair<double,double> track1_IPd0z0 = m_jetFitterUtils->getD0andZ0IP( *initialPerigee1, + primaryVertexRecVertex ); + + std::pair<double,double> track2_IPd0z0 = m_jetFitterUtils->getD0andZ0IP(*initialPerigee2, + primaryVertexRecVertex); + + + + ATH_MSG_DEBUG( "Checking good quality for track A..." ); + if ( fabs( track1_IPd0z0.first ) >= m_cutIPD0BothTracksForBFirstSelection ) return false; + if ( fabs( track1_IPd0z0.second ) >= m_cutIPZ0BothTracksForBFirstSelection ) return false; + + ATH_MSG_DEBUG( "Checking good quality for track B..." ); + if ( fabs( track2_IPd0z0.first ) >= m_cutIPD0BothTracksForBFirstSelection ) return false; + if ( fabs( track2_IPd0z0.second ) >= m_cutIPZ0BothTracksForBFirstSelection ) return false; + + + + + + ATH_MSG_DEBUG( "Checking distance and error between two vertices..." ); + std::pair<double,double> distanceAndError = m_jetFitterUtils->getDistanceAndErrorBetweenTwoVertices( v0candidate,primaryVertexRecVertex ); + + Amg::Vector3D jetMomSpatial( jetMomentum.X(), jetMomentum.Y(), jetMomentum.Z() ); + double sign = ( v0candidate.position() - primaryVertexRecVertex.position() ).dot( jetMomSpatial ); + + double signedDistance = distanceAndError.first; + if ( sign < 0 ) signedDistance = -signedDistance; + double significance = signedDistance/distanceAndError.second; + + double FirstSelectionFirstCriterium = m_cutTwoTrkVtxLifetimeSignificanceForBFirstSelectionFirstCriterium; + double FirstSelectionSecondCriterium = m_cutTwoTrkVtxLifetimeSignificanceForBFirstSelectionSecondCriterium; + + if ( m_revertFromPositiveToNegativeTags ) { + FirstSelectionFirstCriterium = -FirstSelectionFirstCriterium; + FirstSelectionSecondCriterium = -FirstSelectionSecondCriterium; + } + + bool firstCriterium = ( vertexProb > m_cutTwoTrkVtxVertexProbForBFirstSelectionFirstCriterium ) && + ( significance > FirstSelectionFirstCriterium ); + bool secondCriterium = ( vertexProb > m_cutTwoTrkVtxVertexProbForBFirstSelectionSecondCriterium ) && + ( significance > FirstSelectionSecondCriterium ); + + if ( not ( firstCriterium || secondCriterium ) ) + return false; + + + + + ATH_MSG_DEBUG( "Checking material interaction in layer..." ); + double radius = v0candidate.position().perp(); + int interactiontype=-1; + + if ( (radius > m_firstBeam_min ) && + (radius < m_firstBeam_max) ) { + interactiontype=0; + } else if ( (radius > m_secondBeam_min ) && + ( radius < m_secondBeam_max ) ) { + interactiontype=1; + } else if ( ( radius > m_firstLayer_min ) && + ( radius < m_firstLayer_max ) ) { + interactiontype=2; + } else if ( (radius > m_secondLayer_min ) && + ( radius < m_secondLayer_max ) ) { + interactiontype=3; + } + + + + if ( interactiontype == 2 || interactiontype == 3 ) { + bool signifCutTight = ( TMath::Prob( fabs( compatibiltyTrackA ),2 ) < m_cutCompatibilityToPrimarySingleTrackForMatInteractions ) && + ( TMath::Prob( fabs( compatibiltyTrackB ),2 ) < m_cutCompatibilityToPrimarySingleTrackForMatInteractions ) && + ( TMath::Prob( fabs( compatibiltyTrackA ) + fabs( compatibiltyTrackB ),4 ) < m_cutCompatibilityToPrimaryBothTracksForMatInteractions ); + + if ( signifCutTight ) return false; + } + + + + // TO-DO + // Remove candidates with track overlaps + + + + return true; +} + + +bool JetFitterV0FinderTool::checkCriteriaSecondFit( const xAOD::Vertex& primaryVertex, + const Trk::ITrackLink *trackLink ) const { + + const Trk::LinkToXAODTrackParticle* linkTrack = dynamic_cast< const Trk::LinkToXAODTrackParticle* >( trackLink ); + if ( linkTrack == nullptr ) { + ATH_MSG_DEBUG( "Zero pointer (LinkToXAODTrackParticle): skipping 2-track candidate" ); + return false; + } + + float compatibilityTrack = m_compatibilityAccessor( ***linkTrack ); + + + const Trk::TrackParameters* perigee = trackLink->parameters(); + const AmgSymMatrix(5) *measPerigee = perigee->covariance(); + + if ( measPerigee == nullptr ) { + ATH_MSG_DEBUG( "Track parameters have no covariance. skipping single track candidate..." ); + return false; + } + + // Need to create Trk::RecVertex object. Is this really necessary? + Trk::RecVertex primaryVertexRecVertex( primaryVertex.position(), + primaryVertex.covariancePosition(), + primaryVertex.numberDoF(), + primaryVertex.chiSquared()); + + std::pair<double,double> track_IPd0z0 = m_jetFitterUtils->getD0andZ0IP( *perigee, + primaryVertexRecVertex ); + std::pair<double,double> track_IPd0z0Sig = m_jetFitterUtils->getD0andZ0IPSig( *perigee, + primaryVertexRecVertex ); + + const double IPd0 = track_IPd0z0.first; + const double IPz0 = track_IPd0z0.second; + const double IPd0Sig = track_IPd0z0Sig.first; + const double IPz0Sig = track_IPd0z0Sig.second; + const double pT = perigee->momentum().perp(); + + double cutCompatibilityPrimaryVertexSinglePositiveLifetimeTrackForBSecondSelection = m_cutCompatibilityPrimaryVertexSinglePositiveLifetimeTrackForBSecondSelection; + double cutCompatibilityPrimaryVertexSingleNegativeLifetimeTrackForBSecondSelection = m_cutCompatibilityPrimaryVertexSingleNegativeLifetimeTrackForBSecondSelection; + + if ( m_revertFromPositiveToNegativeTags ) { + cutCompatibilityPrimaryVertexSinglePositiveLifetimeTrackForBSecondSelection = m_cutCompatibilityPrimaryVertexSingleNegativeLifetimeTrackForBSecondSelection; + cutCompatibilityPrimaryVertexSingleNegativeLifetimeTrackForBSecondSelection = m_cutCompatibilityPrimaryVertexSinglePositiveLifetimeTrackForBSecondSelection; + } + + bool passBoxCut = ( fabs(IPd0Sig) < m_cutIPD0SigBoxSingleTrackForBSecondSelection ) && + ( fabs(IPz0Sig) > m_cutIPZ0SigBoxSingleTrackForBSecondSelection ); + + + if ( fabs(IPd0) > m_cutIPD0SingleTrackForBSecondSelection || + fabs(IPz0) > m_cutIPZ0SingleTrackForBSecondSelection || + ( compatibilityTrack >= 0 && TMath::Prob( fabs(compatibilityTrack),2) > cutCompatibilityPrimaryVertexSinglePositiveLifetimeTrackForBSecondSelection ) || + ( compatibilityTrack < 0 && TMath::Prob( fabs(compatibilityTrack),2) > cutCompatibilityPrimaryVertexSingleNegativeLifetimeTrackForBSecondSelection ) || + pT < m_cutPtSingleTrackForBSecondSelection || passBoxCut ) + { + ATH_MSG_DEBUG( "Candidate didn't pass one of the selection cuts" ); + return false; + } + + return true; +} + +Amg::Vector3D JetFitterV0FinderTool::computeSeedDirection( const xAOD::Vertex& primaryVertex, + const TLorentzVector& jetMomentum, + const std::vector< Trk::PositionAndWeight >& positionsOfSeedingVertices ) const { + + Amg::Vector3D JFseedDirection( jetMomentum.X(),jetMomentum.Y(),jetMomentum.Z() ); + JFseedDirection.normalize(); + ATH_MSG_VERBOSE( "Jet Direction would be: " << JFseedDirection ); + + if ( positionsOfSeedingVertices.size() == 0 ) + return JFseedDirection; + + Amg::Vector3D theSeedVertex = m_mode3dfinder->getMode( primaryVertex.x(),primaryVertex.y(),positionsOfSeedingVertices ); + double sign = ( theSeedVertex - primaryVertex.position() ).dot( JFseedDirection ); + + if ( m_revertFromPositiveToNegativeTags == false ) { + + if ( sign > 0 ) { + JFseedDirection = ( theSeedVertex - primaryVertex.position() ).unit(); + ATH_MSG_DEBUG( "Using twotrkvtx direction for start: " << JFseedDirection ); + } else ATH_MSG_DEBUG( "NORMAL SEEDING: Seed vertex is on negative side... Using Jet Direction!" ); + + } else { + + if ( sign < 0 ) { + JFseedDirection = -( theSeedVertex - primaryVertex.position() ).unit(); + ATH_MSG_DEBUG( "Using twotrkvtx direction for start: " << JFseedDirection ); + } else ATH_MSG_DEBUG( "REVERSE SEEDING: Seed vertex is on positive side... Using Jet Direction!" ); + + } + + return JFseedDirection; +} diff --git a/InnerDetector/InDetRecTools/InDetSecVxFinderTool/src/components/InDetSecVxFinderTool_entries.cxx b/InnerDetector/InDetRecTools/InDetSecVxFinderTool/src/components/InDetSecVxFinderTool_entries.cxx index b44277cf605fd64baf30851eaf869ee6d3da6feb..ac350c85b8e6de9a161cdbae604b6fcdc550a7fe 100644 --- a/InnerDetector/InDetRecTools/InDetSecVxFinderTool/src/components/InDetSecVxFinderTool_entries.cxx +++ b/InnerDetector/InDetRecTools/InDetSecVxFinderTool/src/components/InDetSecVxFinderTool_entries.cxx @@ -1,10 +1,17 @@ + #include "InDetSecVxFinderTool/InDetJetFitterVxFinder.h" #include "InDetSecVxFinderTool/InDetJetFitterUtils.h" #include "InDetSecVxFinderTool/InDetImprovedJetFitterVxFinder.h" +#include "InDetSecVxFinderTool/JetFitterTrackSelectorTool.h" +#include "InDetSecVxFinderTool/JetFitterTwoTrackVtxFinderTool.h" +#include "InDetSecVxFinderTool/JetFitterV0FinderTool.h" +#include "InDetSecVxFinderTool/JetFitterMultiStageFit.h" -using namespace InDet; - -DECLARE_COMPONENT( InDetJetFitterVxFinder ) -DECLARE_COMPONENT( InDetJetFitterUtils ) -DECLARE_COMPONENT( InDetImprovedJetFitterVxFinder ) +DECLARE_COMPONENT( InDet::InDetJetFitterUtils ) +DECLARE_COMPONENT( InDet::JetFitterTrackSelectorTool ) +DECLARE_COMPONENT( InDet::JetFitterTwoTrackVtxFinderTool ) +DECLARE_COMPONENT( InDet::JetFitterV0FinderTool ) +DECLARE_COMPONENT( InDet::InDetJetFitterVxFinder ) +DECLARE_COMPONENT( InDet::JetFitterMultiStageFit ) +DECLARE_COMPONENT( InDet::InDetImprovedJetFitterVxFinder ) diff --git a/InnerDetector/InDetRecTools/InDetSecVxFinderTool/src/components/InDetSecVxFinderTool_load.cxx b/InnerDetector/InDetRecTools/InDetSecVxFinderTool/src/components/InDetSecVxFinderTool_load.cxx new file mode 100755 index 0000000000000000000000000000000000000000..860b56e4f556369158e3a0830d77b9bb439ec8a3 --- /dev/null +++ b/InnerDetector/InDetRecTools/InDetSecVxFinderTool/src/components/InDetSecVxFinderTool_load.cxx @@ -0,0 +1,3 @@ +#include "GaudiKernel/LoadFactoryEntries.h" + +LOAD_FACTORY_ENTRIES( InDetSecVxFinderTool ) diff --git a/InnerDetector/InDetRecTools/SiClusterizationTool/SiClusterizationTool/ClusterMakerTool.h b/InnerDetector/InDetRecTools/SiClusterizationTool/SiClusterizationTool/ClusterMakerTool.h index 28e8514b8c07756dd5550076753ada6f61453844..3ab17002adacff39d96a8183f0266dbb1180493f 100644 --- a/InnerDetector/InDetRecTools/SiClusterizationTool/SiClusterizationTool/ClusterMakerTool.h +++ b/InnerDetector/InDetRecTools/SiClusterizationTool/SiClusterizationTool/ClusterMakerTool.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ /////////////////////////////////////////////////////////////////// @@ -23,7 +23,6 @@ #include "GeoPrimitives/GeoPrimitives.h" #include "InDetCondTools/ISiLorentzAngleTool.h" #include "PixelCabling/IPixelCablingSvc.h" -#include "PixelConditionsData/PixelModuleData.h" #include "PixelConditionsData/PixelChargeCalibCondData.h" #include "PixelConditionsData/PixelOfflineCalibData.h" #include "StoreGate/ReadCondHandleKey.h" @@ -146,9 +145,6 @@ private: ServiceHandle<IPixelCablingSvc> m_pixelCabling {this, "PixelCablingSvc", "PixelCablingSvc", "Pixel cabling service"}; - SG::ReadCondHandleKey<PixelModuleData> m_moduleDataKey - {this, "PixelModuleData", "PixelModuleData", "Pixel module data"}; - SG::ReadCondHandleKey<PixelChargeCalibCondData> m_chargeDataKey {this, "PixelChargeCalibCondData", "PixelChargeCalibCondData", "Pixel charge calibration data"}; diff --git a/InnerDetector/InDetRecTools/SiClusterizationTool/SiClusterizationTool/PixelClusteringToolBase.h b/InnerDetector/InDetRecTools/SiClusterizationTool/SiClusterizationTool/PixelClusteringToolBase.h index e573c219c093ab5ea783316aee3763f5ae2af18a..9de15c22262c9b2b97b4e292e25d1425b07fa685 100644 --- a/InnerDetector/InDetRecTools/SiClusterizationTool/SiClusterizationTool/PixelClusteringToolBase.h +++ b/InnerDetector/InDetRecTools/SiClusterizationTool/SiClusterizationTool/PixelClusteringToolBase.h @@ -68,7 +68,6 @@ protected: IntegerProperty m_splitClusters{this, "splitClusters", 0}; ToolHandle<IInDetConditionsTool> m_summaryTool{this, "PixelConditionsSummaryTool", "PixelConditionsSummaryTool", "Tool to retrieve Pixel Conditions summary"}; BooleanProperty m_useModuleMap{this, "UsePixelModuleMap", true, "Use bad modules map"}; - BooleanProperty m_usePixelMap{this, "UseSpecialPixelMap", true, "Use bad pixel map"}; }; diff --git a/InnerDetector/InDetRecTools/SiClusterizationTool/src/ClusterMakerTool.cxx b/InnerDetector/InDetRecTools/SiClusterizationTool/src/ClusterMakerTool.cxx index e08afbcac13274388492338131d4cbb3235d2915..8b3d9b2588351098284025f3f2cc908ed6e54c9b 100644 --- a/InnerDetector/InDetRecTools/SiClusterizationTool/src/ClusterMakerTool.cxx +++ b/InnerDetector/InDetRecTools/SiClusterizationTool/src/ClusterMakerTool.cxx @@ -60,12 +60,7 @@ StatusCode ClusterMakerTool::initialize(){ if (not m_pixelCabling.empty()) { ATH_CHECK(m_pixelCabling.retrieve()); } - if (not m_moduleDataKey.empty()) { - ATH_CHECK(m_moduleDataKey.initialize()); - } - if (not m_chargeDataKey.empty()) { - ATH_CHECK(m_chargeDataKey.initialize()); - } + ATH_CHECK(m_chargeDataKey.initialize(SG::AllowEmpty)); if (not m_pixelLorentzAngleTool.empty()) { ATH_CHECK(m_pixelLorentzAngleTool.retrieve()); @@ -136,13 +131,11 @@ PixelCluster* ClusterMakerTool::pixelCluster( return nullptr; } - SG::ReadCondHandle<PixelModuleData> moduleData(m_moduleDataKey); - SG::ReadCondHandle<PixelChargeCalibCondData> calibData(m_chargeDataKey); - if ( errorStrategy==2 && m_forceErrorStrategy1A ) errorStrategy=1; // Fill vector of charges std::vector<float> chargeList; - if (moduleData->getUseCalibConditions()) { + if (!m_chargeDataKey.empty()) { + SG::ReadCondHandle<PixelChargeCalibCondData> calibData(m_chargeDataKey); int nRDO=rdoList.size(); chargeList.reserve(nRDO); for (int i=0; i<nRDO; i++) { @@ -283,9 +276,6 @@ PixelCluster* ClusterMakerTool::pixelCluster( } if ( errorStrategy==2 && m_forceErrorStrategy1B ) errorStrategy=1; - SG::ReadCondHandle<PixelModuleData> moduleData(m_moduleDataKey); - SG::ReadCondHandle<PixelChargeCalibCondData> calibData(m_chargeDataKey); - // Fill vector of charges and compute charge balance const InDetDD::PixelModuleDesign* design = (dynamic_cast<const InDetDD::PixelModuleDesign*>(&element->design())); if (not design){ @@ -300,51 +290,60 @@ PixelCluster* ClusterMakerTool::pixelCluster( float qColMin = 0; float qColMax = 0; std::vector<float> chargeList; int nRDO=rdoList.size(); - if (moduleData->getUseCalibConditions()) { chargeList.reserve(nRDO); } + if (!m_chargeDataKey.empty()) { + chargeList.reserve(nRDO); + SG::ReadCondHandle<PixelChargeCalibCondData> calibData(m_chargeDataKey); + for (int i=0; i<nRDO; i++) { + Identifier pixid=rdoList[i]; + int ToT=totList[i]; + + float charge = ToT; + Identifier moduleID = pixelID.wafer_id(pixid); + IdentifierHash moduleHash = pixelID.wafer_hash(moduleID); // wafer hash + int circ = m_pixelCabling->getFE(&pixid,moduleID); + int type = m_pixelCabling->getPixelType(pixid); + charge = calibData->getCharge((int)moduleHash, circ, type, 1.0*ToT); + if (moduleHash<12 || moduleHash>2035) { + charge = ToT/8.0*(8000.0-1200.0)+1200.0; + } + chargeList.push_back(charge); + } + } + for (int i=0; i<nRDO; i++) { - Identifier pixid=rdoList[i]; - int ToT=totList[i]; - - float charge = ToT; - if (moduleData->getUseCalibConditions()) { - - Identifier moduleID = pixelID.wafer_id(pixid); - IdentifierHash moduleHash = pixelID.wafer_hash(moduleID); // wafer hash - int circ = m_pixelCabling->getFE(&pixid,moduleID); - int type = m_pixelCabling->getPixelType(pixid); - charge = calibData->getCharge((int)moduleHash, circ, type, 1.0*ToT); - if (moduleHash<12 || moduleHash>2035) { - charge = ToT/8.0*(8000.0-1200.0)+1200.0; - } - - chargeList.push_back(charge); - } - // std::cout << "tot, charge = " << ToT << " " << charge << std::endl; - int row = pixelID.phi_index(pixid); - int col = pixelID.eta_index(pixid); - if (row == rowMin) qRowMin += charge; - if (row < rowMin){ - rowMin = row; - qRowMin = charge; - } - - if (row == rowMax) qRowMax += charge; - if (row > rowMax){ - rowMax = row; - qRowMax = charge; - } - if (col == colMin) qColMin += charge; - if (col < colMin){ - colMin = col; - qColMin = charge; - } - - if (col == colMax) qColMax += charge; - if (col > colMax){ - colMax = col; - qColMax = charge; - } + Identifier pixid=rdoList[i]; + int ToT=totList[i]; + + float charge = ToT; + if (!m_chargeDataKey.empty()) { charge=chargeList[i]; } + + // std::cout << "tot, charge = " << ToT << " " << charge << std::endl; + int row = pixelID.phi_index(pixid); + int col = pixelID.eta_index(pixid); + if (row == rowMin) qRowMin += charge; + if (row < rowMin){ + rowMin = row; + qRowMin = charge; + } + + if (row == rowMax) qRowMax += charge; + if (row > rowMax){ + rowMax = row; + qRowMax = charge; + } + if (col == colMin) qColMin += charge; + if (col < colMin){ + colMin = col; + qColMin = charge; + } + + if (col == colMax) qColMax += charge; + if (col > colMax){ + colMax = col; + qColMax = charge; + } } + Identifier newClusterID = pixelID.pixel_id(pixelID.wafer_id(clusterID),rowMin,colMin); // Compute omega for charge interpolation correction (if required) // Two pixels may have charge=0 (very rarely, hopefully) diff --git a/InnerDetector/InDetRecTools/SiClusterizationTool/src/MergedPixelsTool.cxx b/InnerDetector/InDetRecTools/SiClusterizationTool/src/MergedPixelsTool.cxx index 0f0d077f69929b926511302b1472d18b397a3d36..c9f25be80436f54b5da7fbf584fda5e29cc7baf9 100644 --- a/InnerDetector/InDetRecTools/SiClusterizationTool/src/MergedPixelsTool.cxx +++ b/InnerDetector/InDetRecTools/SiClusterizationTool/src/MergedPixelsTool.cxx @@ -341,7 +341,7 @@ namespace InDet { std::unordered_set<Identifier> setOfIdentifiers{}; for(const auto & rdo : collection) { const Identifier rdoID= rdo->identify(); - if (m_usePixelMap and !(m_summaryTool->isGood(idHash,rdoID))) continue; + if (m_useModuleMap and !(m_summaryTool->isGood(idHash,rdoID))) continue; //check for duplication: //add to set of existing identifiers. If it fails (.second = false) then skip it. if (not setOfIdentifiers.insert(rdoID).second) continue; diff --git a/InnerDetector/InDetRecTools/SiClusterizationTool/src/PixelClusteringToolBase.cxx b/InnerDetector/InDetRecTools/SiClusterizationTool/src/PixelClusteringToolBase.cxx index 557000877301a6d82ea1d2fdb29231a3fe309e22..3a1462a88e672d43365bbfaac3346cc4b3b3685d 100644 --- a/InnerDetector/InDetRecTools/SiClusterizationTool/src/PixelClusteringToolBase.cxx +++ b/InnerDetector/InDetRecTools/SiClusterizationTool/src/PixelClusteringToolBase.cxx @@ -39,7 +39,7 @@ namespace InDet StatusCode sc = m_summaryTool.retrieve(); if (sc.isFailure() || !m_summaryTool) { ATH_MSG_WARNING(m_summaryTool.type() << " not found! "); - if ( m_usePixelMap || m_useModuleMap ) { + if (m_useModuleMap ) { ATH_MSG_FATAL(m_summaryTool.type() << " is compulsory with this tool configuration"); return StatusCode::FAILURE; } diff --git a/InnerDetector/InDetRecTools/TRT_ElectronPidTools/TRT_ElectronPidTools/ITRT_ToT_dEdx.h b/InnerDetector/InDetRecTools/TRT_ElectronPidTools/TRT_ElectronPidTools/ITRT_ToT_dEdx.h index 403eabcb4fd17c0b029fd7b5548d434ed9d97185..834e4dd8610e647498f6c7e0e29f303898a9bf48 100644 --- a/InnerDetector/InDetRecTools/TRT_ElectronPidTools/TRT_ElectronPidTools/ITRT_ToT_dEdx.h +++ b/InnerDetector/InDetRecTools/TRT_ElectronPidTools/TRT_ElectronPidTools/ITRT_ToT_dEdx.h @@ -8,6 +8,7 @@ // Gaudi #include "GaudiKernel/IAlgTool.h" +#include "GaudiKernel/EventContext.h" #include "TrkParameters/TrackParameters.h" // typedef namespace Trk { class Track ; } @@ -29,22 +30,35 @@ public: /** * @brief function to calculate sum ToT normalised to number of used hits + * @param Event context ctx * @param track pointer to track * @param useHitsHT decide if HT hits should be used in the estimate * @return dEdx value */ - virtual double dEdx(const Trk::Track* track, bool useHitsHT=true) const = 0; - + virtual double dEdx(const EventContext& ctx, + const Trk::Track* track, + bool useHitsHT = true) const = 0; + + virtual double dEdx(const Trk::Track* track, bool useHitsHT = true) const ; + /** * @brief function to calculate number of used hits + * @param Event context ctx * @param track pointer * @param useHitsHT decide if HT hits should be used in the estimate * @return nHits */ - virtual double usedHits(const Trk::Track* track, bool useHitsHT=true) const = 0; + virtual double usedHits(const EventContext& ctx, + const Trk::Track* track, + bool useHitsHT = true) const = 0; + + virtual double usedHits(const Trk::Track* track, + bool useHitsHT = true) const; + /** * @brief function to calculate likelihood ratio test + * @param Event context ctx * @param observed dEdx * @param track parameter * @param particle hypothesis @@ -52,7 +66,47 @@ public: * @param number of used hits * @return test value between 0 and 1 */ - virtual double getTest(const double dEdx_obs, const double pTrk, Trk::ParticleHypothesis hypothesis, Trk::ParticleHypothesis antihypothesis, int nUsedHits) const = 0; + virtual double getTest(const EventContext& ctx, + const double dEdx_obs, + const double pTrk, + Trk::ParticleHypothesis hypothesis, + Trk::ParticleHypothesis antihypothesis, + int nUsedHits) const = 0; + + virtual double getTest(const double dEdx_obs, + const double pTrk, + Trk::ParticleHypothesis hypothesis, + Trk::ParticleHypothesis antihypothesis, + int nUsedHits) const; }; +// implement the non ctx aware methods in terms of the ctx +// aware ones +inline double +ITRT_ToT_dEdx::dEdx(const Trk::Track* track, bool useHitsHT) const +{ + return dEdx(Gaudi::Hive::currentContext(), track, useHitsHT); +} + +inline double +ITRT_ToT_dEdx::usedHits(const Trk::Track* track, bool useHitsHT) const +{ + return usedHits(Gaudi::Hive::currentContext(), track, useHitsHT); +} + +inline double +ITRT_ToT_dEdx::getTest(const double dEdx_obs, + const double pTrk, + Trk::ParticleHypothesis hypothesis, + Trk::ParticleHypothesis antihypothesis, + int nUsedHits) const +{ + return getTest(Gaudi::Hive::currentContext(), + dEdx_obs, + pTrk, + hypothesis, + antihypothesis, + nUsedHits); +} + #endif // ITRT_TOT_DEDX_H diff --git a/InnerDetector/InDetRecTools/TRT_ElectronPidTools/src/TRT_ElectronPidToolRun2.cxx b/InnerDetector/InDetRecTools/TRT_ElectronPidTools/src/TRT_ElectronPidToolRun2.cxx index 85e533993268e85f40b413902e084ce52e7e4cf0..3c7bd26656f4edaaa934a4f21638f7fa5dceb3eb 100644 --- a/InnerDetector/InDetRecTools/TRT_ElectronPidTools/src/TRT_ElectronPidToolRun2.cxx +++ b/InnerDetector/InDetRecTools/TRT_ElectronPidTools/src/TRT_ElectronPidToolRun2.cxx @@ -138,7 +138,8 @@ std::vector<float> InDet::TRT_ElectronPidToolRun2::electronProbability(const Trk::Track& track) const { // Get the probability calculator - SG::ReadCondHandle<HTcalculator> readHandle{m_HTReadKey}; + const EventContext& ctx = Gaudi::Hive::currentContext(); + SG::ReadCondHandle<HTcalculator> readHandle{m_HTReadKey,ctx}; const HTcalculator* HTcalc = (*readHandle); // make sure some calibration is available if(HTcalc==nullptr) { @@ -189,7 +190,7 @@ InDet::TRT_ElectronPidToolRun2::electronProbability(const Trk::Track& track) con ATH_MSG_DEBUG ("check---------------------------------------------------------------------------------------"); ATH_MSG_DEBUG ("check Got track: pT: " << pT << " eta: " << eta << " phi: " << phi); ATH_MSG_DEBUG ("check---------------------------------------------------------------------------------------"); - + // For calculation of HT probability: double pHTel_prod = 1.0; double pHTpi_prod = 1.0; @@ -228,7 +229,7 @@ InDet::TRT_ElectronPidToolRun2::electronProbability(const Trk::Track& track) con driftcircle = static_cast<const InDet::TRT_DriftCircleOnTrack*>(tmpRio); } } - + if (!driftcircle) continue; // From now (May 2015) onwards, we ONLY USE MIDDLE HT BIT: @@ -316,7 +317,7 @@ InDet::TRT_ElectronPidToolRun2::electronProbability(const Trk::Track& track) con // Our representation of 'GasType' is 0:Xenon, 1:Argon, 2:Krypton int GasType=0; // Xenon is default if (!m_TRTStrawSummaryTool.empty()) { - int stat = m_TRTStrawSummaryTool->getStatusHT(DCid); + int stat = m_TRTStrawSummaryTool->getStatusHT(DCid,ctx); if ( stat==2 || stat==3 ) { GasType = 0; } // Xe else if ( stat==1 || stat==4 ) { GasType = 1; } // Ar else if ( stat==5 ) { GasType = 1; } // Kr -- ESTIMATED AS AR UNTIL PID IS TUNED TO HANDLE KR @@ -377,11 +378,11 @@ InDet::TRT_ElectronPidToolRun2::electronProbability(const Trk::Track& track) con if (isHTMB) {pHTel_prod *= pHTel; pHTpi_prod *= pHTpi;} else {pHTel_prod *= 1.0-pHTel; pHTpi_prod *= 1.0-pHTpi;} ATH_MSG_DEBUG ("check pHT(el): " << pHTel << " pHT(pi): " << pHTpi ); - - // Jared - Development Output... - + + // Jared - Development Output... + //std::cout << "check pHT(el): " << pHTel << " pHT(pi): " << pHTpi << std::endl; - + }//of loop over hits @@ -399,24 +400,24 @@ InDet::TRT_ElectronPidToolRun2::electronProbability(const Trk::Track& track) con ATH_MSG_DEBUG ("check---------------------------------------------------------------------------------------"); ATH_MSG_DEBUG (""); ATH_MSG_DEBUG (""); - + // Jared - ToT Implementation - dEdx = m_TRTdEdxTool->dEdx(&track, false); // Divide by L, exclude HT hits - double usedHits = m_TRTdEdxTool->usedHits(&track, false); - prob_El_ToT = m_TRTdEdxTool->getTest(dEdx, pTrk, Trk::electron, Trk::pion, usedHits); - + dEdx = m_TRTdEdxTool->dEdx(ctx,&track, false); // Divide by L, exclude HT hits + double usedHits = m_TRTdEdxTool->usedHits(ctx,&track, false); + prob_El_ToT = m_TRTdEdxTool->getTest(ctx,dEdx, pTrk, Trk::electron, Trk::pion, usedHits); + // Limit the probability values the upper and lower limits that are given/trusted for each part: - double limProbHT = HTcalc->Limit(prob_El_HT); - double limProbToT = HTcalc->Limit(prob_El_ToT); - + double limProbHT = HTcalc->Limit(prob_El_HT); + double limProbToT = HTcalc->Limit(prob_El_ToT); + // Calculate the combined probability, assuming no correlations (none are expected). prob_El_Comb = (limProbHT * limProbToT ) / ( (limProbHT * limProbToT) + ( (1.0-limProbHT) * (1.0-limProbToT)) ); - + // Troels: VERY NASTY NAMING, BUT AGREED UPON FOR NOW (for debugging, 27. NOV. 2014): - prob_El_Brem = pHTel_prod; // decorates electron LH to el brem for now... (still used?) - + prob_El_Brem = pHTel_prod; // decorates electron LH to el brem for now... (still used?) + //std::cout << "Prob_HT = " << prob_El_HT << " Prob_ToT = " << prob_El_ToT << " Prob_Comb = " << prob_El_Comb << std::endl; - + return PIDvalues; } @@ -442,9 +443,9 @@ bool InDet::TRT_ElectronPidToolRun2::CheckGeometry(int BEC, int Layer, int Straw ATH_MSG_ERROR("Found a negative TRT Layer"); return false; //must be positive } - + static const int nlayers[2]={3,14}; - + if( not ( Layer < nlayers[part] ) ){ ATH_MSG_ERROR("Found TRT Layer index "<<Layer<<" in part "<<BEC<<" but part only has "<<nlayers[part]<<" layers."); return false; @@ -455,15 +456,15 @@ bool InDet::TRT_ElectronPidToolRun2::CheckGeometry(int BEC, int Layer, int Straw ATH_MSG_ERROR("Found a negative TRT StrawLayer"); return false; //must be positive } - + static const int strawsPerBEC[2][14]={{19,24,30, 0, 0, 0,0,0,0,0,0,0,0,0}, {16,16,16,16,16,16,8,8,8,8,8,8,8,8}}; - + if(not(StrawLayer < strawsPerBEC[part][Layer])){ ATH_MSG_ERROR("TRT part "<<BEC<<" Layer "<<Layer<<" only has "<<strawsPerBEC[part][Layer]<<" straws. Found index "<<StrawLayer); return false; } - + return true; } diff --git a/InnerDetector/InDetRecTools/TRT_ElectronPidTools/src/TRT_ToT_dEdx.cxx b/InnerDetector/InDetRecTools/TRT_ElectronPidTools/src/TRT_ToT_dEdx.cxx index ff829d32ab1ecc5d16b84172ade775b8cc23c441..d2a667a933bfad08f5041c9e0859567a7b363d51 100644 --- a/InnerDetector/InDetRecTools/TRT_ElectronPidTools/src/TRT_ToT_dEdx.cxx +++ b/InnerDetector/InDetRecTools/TRT_ElectronPidTools/src/TRT_ToT_dEdx.cxx @@ -47,7 +47,7 @@ TRT_ToT_dEdx::TRT_ToT_dEdx(const std::string& t, const std::string& n, const IIn declareProperty("TRTStrawSummaryTool", m_TRTStrawSummaryTool); declareProperty("AssociationTool", m_assoTool); declareProperty("TRT_LocalOccupancyTool", m_localOccTool); - + setDefaultConfiguration(); m_timingProfile = nullptr; @@ -98,13 +98,13 @@ TRT_ToT_dEdx::~TRT_ToT_dEdx() = default; // initialize -StatusCode TRT_ToT_dEdx::initialize() +StatusCode TRT_ToT_dEdx::initialize() { MsgStream log(msgSvc(), name()); - + // retrieve TRT-ID helper - + StatusCode sc = detStore()->retrieve(m_trtId, "TRT_ID"); if (sc.isFailure()){ ATH_MSG_ERROR ( "Could not get TRT_ID helper !" ); @@ -116,7 +116,7 @@ StatusCode TRT_ToT_dEdx::initialize() if ( sc.isFailure() || nullptr == m_timingProfile) { ATH_MSG_DEBUG ("Can not find ChronoStatSvc name="<<m_timingProfile ); } - + // Initialize ReadHandleKey and ReadCondHandleKey ATH_CHECK(m_rdhkEvtInfo.initialize()); ATH_CHECK(m_ReadKey.initialize()); @@ -130,27 +130,27 @@ StatusCode TRT_ToT_dEdx::initialize() ATH_MSG_ERROR ("Failed to retrieve StrawStatus Summary " << m_TRTStrawSummaryTool); ATH_MSG_ERROR ("configure as 'None' to avoid its loading."); return sc; - } - if ( !m_TRTStrawSummaryTool.empty() ) + } + if ( !m_TRTStrawSummaryTool.empty() ) ATH_MSG_INFO ( "Retrieved tool " << m_TRTStrawSummaryTool ); - - if (m_useTrackPartWithGasType > EGasType::kUnset || + + if (m_useTrackPartWithGasType > EGasType::kUnset || m_useTrackPartWithGasType < EGasType::kXenon) { ATH_MSG_ERROR("Property TRT_dEdx_useTrackPartWithGasType has an invalid " << "value: " << m_useTrackPartWithGasType); return StatusCode::FAILURE; } - + showDEDXSetup(); - ATH_MSG_INFO ( name() << " initialize() successful" ); + ATH_MSG_INFO ( name() << " initialize() successful" ); return StatusCode::SUCCESS; } -StatusCode TRT_ToT_dEdx::finalize() +StatusCode TRT_ToT_dEdx::finalize() { MsgStream log(msgSvc(), name()); ATH_MSG_DEBUG ( "... in finalize() ..." ); @@ -158,7 +158,11 @@ StatusCode TRT_ToT_dEdx::finalize() return StatusCode::SUCCESS; } -bool TRT_ToT_dEdx::isGoodHit(const Trk::TrackStateOnSurface* trackState, bool useHitsHT, double& length) const +bool +TRT_ToT_dEdx::isGoodHit(const EventContext& ctx, + const Trk::TrackStateOnSurface* trackState, + bool useHitsHT, + double& length) const { const Trk::MeasurementBase* trkM = trackState->measurementOnTrack(); if (!trkM) { @@ -181,7 +185,7 @@ bool TRT_ToT_dEdx::isGoodHit(const Trk::TrackStateOnSurface* trackState, bool us } const Trk::TrackParameters* trkP = trackState->trackParameters(); - if(trkP==nullptr)return false; + if(trkP==nullptr)return false; double Trt_Rtrack = std::abs(trkP->parameters()[Trk::locR]); double Trt_RHit = std::abs(driftcircle->localParameters()[Trk::driftRadius]); @@ -197,25 +201,28 @@ bool TRT_ToT_dEdx::isGoodHit(const Trk::TrackStateOnSurface* trackState, bool us if (!useHitsHT) { int TrtHl = driftcircle->highLevel(); - if (TrtHl==1) return false; + if (TrtHl==1) return false; } if (m_useTrackPartWithGasType != kUnset) { // don't preselect hits - if(m_useTrackPartWithGasType != gasTypeInStraw(trackState)) return false; + if(m_useTrackPartWithGasType != gasTypeInStraw(ctx,trackState)) return false; } if (driftcircle->prepRawData()->timeOverThreshold()==0.) return false; // If ToT for this hit equal 0, skip it. - + return true; } -double TRT_ToT_dEdx::dEdx(const Trk::Track* track, bool useHitsHT) const -{ +double +TRT_ToT_dEdx::dEdx(const EventContext& ctx, + const Trk::Track* track, + bool useHitsHT) const +{ ATH_MSG_DEBUG("dEdx()"); double nVtx=-1.; // Event information - SG::ReadDecorHandle<xAOD::EventInfo,float> eventInfoDecor(m_rdhkEvtInfo); + SG::ReadDecorHandle<xAOD::EventInfo,float> eventInfoDecor(m_rdhkEvtInfo,ctx); if(!eventInfoDecor.isPresent()) { REPORT_MESSAGE(MSG::FATAL) << "EventInfo decoration not available!"; return 0; @@ -234,33 +241,33 @@ double TRT_ToT_dEdx::dEdx(const Trk::Track* track, bool useHitsHT) const if (!track) { return 0; } - const DataVector<const Trk::TrackStateOnSurface>* vtsos = track->trackStateOnSurfaces(); + const DataVector<const Trk::TrackStateOnSurface>* vtsos = track->trackStateOnSurfaces(); if (!vtsos) { return 0; } - + EGasType gasType; DataVector<const Trk::TrackStateOnSurface>::const_iterator itr = vtsos->begin(); - DataVector<const Trk::TrackStateOnSurface>::const_iterator itre = vtsos->end(); + DataVector<const Trk::TrackStateOnSurface>::const_iterator itre = vtsos->end(); double correctionFactor = 1.; - + if (m_toolScenario==kAlgStandard) { std::vector<double> vecToT; double ToTsum = 0; for ( ; itr!=itre ; ++itr) { double length = 0; - if ( isGoodHit((*itr), useHitsHT, length)) { - double ToT_correct = correctToT_corrRZ(*itr, length); + if ( isGoodHit(ctx,(*itr), useHitsHT, length)) { + double ToT_correct = correctToT_corrRZ(ctx,*itr, length); if (m_correctionType == kHitBased){ correctionFactor = hitOccupancyCorrection(*itr); ToT_correct*=correctionFactor; } vecToT.push_back(ToT_correct); } - } - + } + sort(vecToT.begin(), vecToT.end()); size_t nhits = vecToT.size(); @@ -275,26 +282,30 @@ double TRT_ToT_dEdx::dEdx(const Trk::Track* track, bool useHitsHT) const if (m_correctionType == kTrackBased) { correctionFactor=trackOccupancyCorrection(track, useHitsHT); } else { - correctionFactor=correctNormalization(nVtx); + correctionFactor=correctNormalization(ctx,nVtx); } ToTsum*=correctionFactor; return ToTsum/nhits; } - + if(m_toolScenario==kAlgReweight || m_toolScenario==kAlgReweightTrunkOne) { std::vector<double> vecToT_Xe; std::vector<double> vecToT_Ar; std::vector<double> vecToT_Kr; if(m_useTrackPartWithGasType!=kUnset) { - ATH_MSG_WARNING("dEdX_Estimator():: Using m_toolScenario="<<m_toolScenario<<" scenario m_useTrackPartWithGasType is set to"<<m_useTrackPartWithGasType<<", but kUnset is requiered. Check you tool configuration."); + ATH_MSG_WARNING( + "dEdX_Estimator():: Using m_toolScenario=" + << m_toolScenario << " scenario m_useTrackPartWithGasType is set to" + << m_useTrackPartWithGasType + << ", but kUnset is requiered. Check you tool configuration."); } for ( ; itr!=itre ; ++itr) { double length=0; - if (isGoodHit((*itr), useHitsHT, length)) { - gasType=gasTypeInStraw(*itr); - double ToT_correct = correctToT_corrRZ(*itr, length); + if (isGoodHit(ctx,(*itr), useHitsHT, length)) { + gasType=gasTypeInStraw(ctx,*itr); + double ToT_correct = correctToT_corrRZ(ctx,*itr, length); if (m_correctionType == kHitBased) { correctionFactor = hitOccupancyCorrection(*itr); } @@ -309,7 +320,7 @@ double TRT_ToT_dEdx::dEdx(const Trk::Track* track, bool useHitsHT) const ATH_MSG_ERROR("dEdX_Estimator():: During scenario kAlgReweight variable gasTypeInStraw got value kUnset."); } } - } + } sort(vecToT_Xe.begin(), vecToT_Xe.end()); sort(vecToT_Ar.begin(), vecToT_Ar.end()); @@ -348,7 +359,7 @@ double TRT_ToT_dEdx::dEdx(const Trk::Track* track, bool useHitsHT) const } } } - + // Boost speed. size_t nhits = nhitsXe + nhitsAr + nhitsKr; if(nhits<1) return 0.0; @@ -361,10 +372,10 @@ double TRT_ToT_dEdx::dEdx(const Trk::Track* track, bool useHitsHT) const } for (size_t i = 0; i < nhitsAr;i++) { ToTsumAr+=vecToT_Ar.at(i); - } + } for (size_t i = 0; i < nhitsKr;i++) { ToTsumKr+=vecToT_Kr.at(i); - } + } ToTsumXe = (nhitsXe>0) ? ToTsumXe/nhitsXe : 0; ToTsumAr = (nhitsAr>0) ? ToTsumAr/nhitsAr : 0; @@ -374,7 +385,7 @@ double TRT_ToT_dEdx::dEdx(const Trk::Track* track, bool useHitsHT) const if (m_correctionType == kTrackBased) { correctionFactor = trackOccupancyCorrection(track, useHitsHT); } else { - correctionFactor = correctNormalization(nVtx); + correctionFactor = correctNormalization(ctx,nVtx); } ToTsum *= correctionFactor; @@ -385,7 +396,10 @@ double TRT_ToT_dEdx::dEdx(const Trk::Track* track, bool useHitsHT) const return 0.; } -double TRT_ToT_dEdx::usedHits(const Trk::Track* track, bool useHitsHT) const +double +TRT_ToT_dEdx::usedHits(const EventContext& ctx, + const Trk::Track* track, + bool useHitsHT) const { ATH_MSG_DEBUG("usedHits()"); EGasType gasType = kUnset; @@ -393,23 +407,23 @@ double TRT_ToT_dEdx::usedHits(const Trk::Track* track, bool useHitsHT) const if (!track) { return 0; } - const DataVector<const Trk::TrackStateOnSurface>* vtsos = track->trackStateOnSurfaces(); + const DataVector<const Trk::TrackStateOnSurface>* vtsos = track->trackStateOnSurfaces(); if (!vtsos) { return 0; } DataVector<const Trk::TrackStateOnSurface>::const_iterator itr = vtsos->begin(); - DataVector<const Trk::TrackStateOnSurface>::const_iterator itre = vtsos->end(); - + DataVector<const Trk::TrackStateOnSurface>::const_iterator itre = vtsos->end(); + if (m_toolScenario==kAlgStandard) { int nhits =0; for ( ; itr!=itre ; ++itr) { double length=0; - if (isGoodHit((*itr), useHitsHT, length)) { + if (isGoodHit(ctx,(*itr), useHitsHT, length)) { nhits++; } - } + } if (m_divideByL) nhits -= m_nTrunkateHits; return nhits; } else if (m_toolScenario==kAlgReweight || m_toolScenario==kAlgReweightTrunkOne) { @@ -419,13 +433,17 @@ double TRT_ToT_dEdx::usedHits(const Trk::Track* track, bool useHitsHT) const int nhitsKr = 0; if(m_useTrackPartWithGasType!=kUnset) { - ATH_MSG_WARNING("usedHits_Estimator():: Using m_toolScenario="<<m_toolScenario<<" scenario m_useTrackPartWithGasType is set to "<<m_useTrackPartWithGasType<<", but kUnset is required. Check you tool configuration."); + ATH_MSG_WARNING( + "usedHits_Estimator():: Using m_toolScenario=" + << m_toolScenario << " scenario m_useTrackPartWithGasType is set to " + << m_useTrackPartWithGasType + << ", but kUnset is required. Check you tool configuration."); } for ( ; itr!=itre ; ++itr) { double length=0; - if ( isGoodHit((*itr), useHitsHT, length)) { - gasType=gasTypeInStraw(*itr); + if ( isGoodHit(ctx,(*itr), useHitsHT, length)) { + gasType=gasTypeInStraw(ctx,*itr); if (gasType==kXenon) { nhitsXe++; } else if (gasType==kArgon) { @@ -457,17 +475,29 @@ double TRT_ToT_dEdx::usedHits(const Trk::Track* track, bool useHitsHT) const return 0; } -double TRT_ToT_dEdx::getProb(const Trk::TrackStateOnSurface *itr, const double dEdx_obs, const double pTrk, Trk::ParticleHypothesis hypothesis, int nUsedHits) const +double +TRT_ToT_dEdx::getProb(const EventContext& ctx, + const Trk::TrackStateOnSurface* itr, + const double dEdx_obs, + const double pTrk, + Trk::ParticleHypothesis hypothesis, + int nUsedHits) const { - EGasType gasType = gasTypeInStraw(itr); - return getProb(gasType, dEdx_obs, pTrk, hypothesis, nUsedHits); + EGasType gasType = gasTypeInStraw(ctx, itr); + return getProb(ctx,gasType, dEdx_obs, pTrk, hypothesis, nUsedHits); } -double TRT_ToT_dEdx::getProb(EGasType gasType, const double dEdx_obs, const double pTrk, Trk::ParticleHypothesis hypothesis, int nUsedHits) const -{ +double +TRT_ToT_dEdx::getProb(const EventContext& ctx, + EGasType gasType, + const double dEdx_obs, + const double pTrk, + Trk::ParticleHypothesis hypothesis, + int nUsedHits) const +{ ATH_MSG_DEBUG("getProb():: gasTypeInStraw = "<<gasType<<""); - SG::ReadCondHandle<TRTDedxcorrection> readHandle{m_ReadKey}; + SG::ReadCondHandle<TRTDedxcorrection> readHandle{m_ReadKey,ctx}; const TRTDedxcorrection* dEdxCorrection{*readHandle}; if (dEdxCorrection==nullptr) { ATH_MSG_ERROR(" getProb: Could not find any dEdxCorrection in CondStore. Return zero."); @@ -480,7 +510,7 @@ double TRT_ToT_dEdx::getProb(EGasType gasType, const double dEdx_obs, const doub gasType = kXenon; } - double dEdx_pred = predictdEdx(gasType, pTrk, hypothesis); + double dEdx_pred = predictdEdx(ctx,gasType, pTrk, hypothesis); if (dEdx_pred==0) return 0.0; if (hypothesis==Trk::electron) { // correction for pTrk in [MeV] @@ -489,28 +519,45 @@ double TRT_ToT_dEdx::getProb(EGasType gasType, const double dEdx_obs, const doub dEdx_pred= dEdx_pred/correct; } - double Resolution = dEdxCorrection->resolution[gasType][0]+dEdxCorrection->resolution[gasType][1]*(nUsedHits+0.5)+dEdxCorrection->resolution[gasType][2]*(nUsedHits+0.5)*(nUsedHits+0.5)+dEdxCorrection->resolution[gasType][3]*(nUsedHits+0.5)*(nUsedHits+0.5)*(nUsedHits+0.5); - if(hypothesis==Trk::electron){ - Resolution = dEdxCorrection->resolutionElectron[gasType][0]+dEdxCorrection->resolutionElectron[gasType][1]*(nUsedHits+0.5)+dEdxCorrection->resolutionElectron[gasType][2]*(nUsedHits+0.5)*(nUsedHits+0.5)+dEdxCorrection->resolutionElectron[gasType][3]*(nUsedHits+0.5)*(nUsedHits+0.5)*(nUsedHits+0.5); + double Resolution = + dEdxCorrection->resolution[gasType][0] + + dEdxCorrection->resolution[gasType][1] * (nUsedHits + 0.5) + + dEdxCorrection->resolution[gasType][2] * (nUsedHits + 0.5) * + (nUsedHits + 0.5) + + dEdxCorrection->resolution[gasType][3] * (nUsedHits + 0.5) * + (nUsedHits + 0.5) * (nUsedHits + 0.5); + if (hypothesis == Trk::electron) { + Resolution = + dEdxCorrection->resolutionElectron[gasType][0] + + dEdxCorrection->resolutionElectron[gasType][1] * (nUsedHits + 0.5) + + dEdxCorrection->resolutionElectron[gasType][2] * (nUsedHits + 0.5) * + (nUsedHits + 0.5) + + dEdxCorrection->resolutionElectron[gasType][3] * (nUsedHits + 0.5) * + (nUsedHits + 0.5) * (nUsedHits + 0.5); } - double prob = std::exp( -0.5 * ( ( ( dEdx_obs - dEdx_pred ) / (Resolution*dEdx_pred) ) * - ( ( dEdx_obs - dEdx_pred ) / (Resolution*dEdx_pred) ) )) ; + double prob = std::exp( -0.5 * ( ( ( dEdx_obs - dEdx_pred ) / (Resolution*dEdx_pred) ) * + ( ( dEdx_obs - dEdx_pred ) / (Resolution*dEdx_pred) ) )) ; ATH_MSG_DEBUG("getProb():: return "<<prob<<""); return prob; } - -double TRT_ToT_dEdx::getTest(const double dEdx_obs, const double pTrk, Trk::ParticleHypothesis hypothesis, Trk::ParticleHypothesis antihypothesis, int nUsedHits) const +double +TRT_ToT_dEdx::getTest(const EventContext& ctx, + const double dEdx_obs, + const double pTrk, + Trk::ParticleHypothesis hypothesis, + Trk::ParticleHypothesis antihypothesis, + int nUsedHits) const { ATH_MSG_DEBUG("getTest()"); EGasType gasType = kUnset; if ( dEdx_obs<=0. || pTrk<=0. || nUsedHits<=0 ) return 0.5; - - double Pone = getProb(gasType, dEdx_obs,pTrk,hypothesis,nUsedHits); - double Ptwo = getProb(gasType, dEdx_obs,pTrk,antihypothesis,nUsedHits); + + double Pone = getProb(ctx,gasType, dEdx_obs,pTrk,hypothesis,nUsedHits); + double Ptwo = getProb(ctx,gasType, dEdx_obs,pTrk,antihypothesis,nUsedHits); if ((Pone+Ptwo) != 0) { ATH_MSG_DEBUG("getTest():: return "<<Pone/(Pone+Ptwo)<<""); return Pone/(Pone+Ptwo); @@ -519,60 +566,97 @@ double TRT_ToT_dEdx::getTest(const double dEdx_obs, const double pTrk, Trk::Part } } -double TRT_ToT_dEdx::predictdEdx(const Trk::TrackStateOnSurface *itr, const double pTrk, Trk::ParticleHypothesis hypothesis) const +double +TRT_ToT_dEdx::predictdEdx(const EventContext& ctx, + const Trk::TrackStateOnSurface* itr, + const double pTrk, + Trk::ParticleHypothesis hypothesis) const { - EGasType gasType = gasTypeInStraw(itr); - return predictdEdx(gasType, pTrk, hypothesis); + EGasType gasType = gasTypeInStraw(ctx, itr); + return predictdEdx(ctx,gasType, pTrk, hypothesis); } -double TRT_ToT_dEdx::predictdEdx(EGasType gasType, const double pTrk, Trk::ParticleHypothesis hypothesis) const +double +TRT_ToT_dEdx::predictdEdx(const EventContext& ctx, + EGasType gasType, + const double pTrk, + Trk::ParticleHypothesis hypothesis) const { - ATH_MSG_DEBUG("predictdEdx(): gasTypeInStraw = "<<gasType<<""); + ATH_MSG_DEBUG("predictdEdx(): gasTypeInStraw = " << gasType << ""); - SG::ReadCondHandle<TRTDedxcorrection> readHandle{m_ReadKey}; - const TRTDedxcorrection* dEdxCorrection{*readHandle}; - if(dEdxCorrection==nullptr) - { - ATH_MSG_ERROR(" predictdEdx: Could not find any dEdxCorrection in CondStore. Return zero."); - return 0; - } + SG::ReadCondHandle<TRTDedxcorrection> readHandle{ m_ReadKey,ctx }; + const TRTDedxcorrection* dEdxCorrection{ *readHandle }; + if (dEdxCorrection == nullptr) { + ATH_MSG_ERROR(" predictdEdx: Could not find any dEdxCorrection in " + "CondStore. Return zero."); + return 0; + } - if(gasType==kUnset) - { - ATH_MSG_DEBUG("predictdEdx():: gasTypeInStraw set kUnset that is not allowed! Use gasTypeInStraw(*itr) to get gas type info for that hit first!"); - ATH_MSG_DEBUG("predictdEdx():: Now gasTypeInStraw sets to kXenon."); - gasType = kXenon; - } + if (gasType == kUnset) { + ATH_MSG_DEBUG( + "predictdEdx():: gasTypeInStraw set kUnset that is not allowed! Use " + "gasTypeInStraw(*itr) to get gas type info for that hit first!"); + ATH_MSG_DEBUG("predictdEdx():: Now gasTypeInStraw sets to kXenon."); + gasType = kXenon; + } double mass = m_particlemasses.mass[hypothesis]; double betaGamma = pTrk/mass; /** @todo why is it possible that a 20 MeV particle reaches this point? (see Savannah bug 94644) */ - // low momentum particle can create floating point error + // low momentum particle can create floating point error // do we need the check in the log parameter in addition? will create CPU increase // do we want to throw an assertion here? - if(pTrk<100)return 0; - if(m_divideByL){ - if(dEdxCorrection->paraDivideByLengthDedxP3[gasType]+1./( std::pow( betaGamma, dEdxCorrection->paraDivideByLengthDedxP5[gasType]))<=0) return 0; - return dEdxCorrection->paraDivideByLengthDedxP1[gasType]/std::pow( std::sqrt( (betaGamma*betaGamma)/(1.+(betaGamma*betaGamma)) ), dEdxCorrection->paraDivideByLengthDedxP4[gasType]) * - (dEdxCorrection->paraDivideByLengthDedxP2[gasType] - std::pow( std::sqrt( (betaGamma*betaGamma)/(1.+(betaGamma*betaGamma)) ), dEdxCorrection->paraDivideByLengthDedxP4[gasType] ) - - log(dEdxCorrection->paraDivideByLengthDedxP3[gasType]+1./( std::pow( betaGamma, dEdxCorrection->paraDivideByLengthDedxP5[gasType]) ) ) ); - } - if(dEdxCorrection->paraDedxP3[gasType]+1./( std::pow( betaGamma, dEdxCorrection->paraDedxP5[gasType]) )<=0)return 0; - return dEdxCorrection->paraDedxP1[gasType]/std::pow( std::sqrt( (betaGamma*betaGamma)/(1.+(betaGamma*betaGamma)) ), dEdxCorrection->paraDedxP4[gasType]) * - (dEdxCorrection->paraDedxP2[gasType] - std::pow( std::sqrt( (betaGamma*betaGamma)/(1.+(betaGamma*betaGamma)) ), dEdxCorrection->paraDedxP4[gasType] ) - - log(dEdxCorrection->paraDedxP3[gasType]+1./( std::pow( betaGamma, dEdxCorrection->paraDedxP5[gasType]) ) ) ); - - //return 0; + if (pTrk < 100) + return 0; + if (m_divideByL) { + if (dEdxCorrection->paraDivideByLengthDedxP3[gasType] + + 1. / (std::pow(betaGamma, + dEdxCorrection->paraDivideByLengthDedxP5[gasType])) <= + 0) + return 0; + return dEdxCorrection->paraDivideByLengthDedxP1[gasType] / + std::pow(std::sqrt((betaGamma * betaGamma) / + (1. + (betaGamma * betaGamma))), + dEdxCorrection->paraDivideByLengthDedxP4[gasType]) * + (dEdxCorrection->paraDivideByLengthDedxP2[gasType] - + std::pow(std::sqrt((betaGamma * betaGamma) / + (1. + (betaGamma * betaGamma))), + dEdxCorrection->paraDivideByLengthDedxP4[gasType]) - + log(dEdxCorrection->paraDivideByLengthDedxP3[gasType] + + 1. / (std::pow( + betaGamma, + dEdxCorrection->paraDivideByLengthDedxP5[gasType])))); + } + if (dEdxCorrection->paraDedxP3[gasType] + + 1. / (std::pow(betaGamma, dEdxCorrection->paraDedxP5[gasType])) <= + 0) + return 0; + return dEdxCorrection->paraDedxP1[gasType] / + std::pow( + std::sqrt((betaGamma * betaGamma) / (1. + (betaGamma * betaGamma))), + dEdxCorrection->paraDedxP4[gasType]) * + (dEdxCorrection->paraDedxP2[gasType] - + std::pow( + std::sqrt((betaGamma * betaGamma) / (1. + (betaGamma * betaGamma))), + dEdxCorrection->paraDedxP4[gasType]) - + log(dEdxCorrection->paraDedxP3[gasType] + + 1. / (std::pow(betaGamma, dEdxCorrection->paraDedxP5[gasType])))); + + //return 0; } -double TRT_ToT_dEdx::mass(const Trk::TrackStateOnSurface *itr, const double pTrk, double dEdx ) const +double +TRT_ToT_dEdx::mass(const EventContext& ctx, + const Trk::TrackStateOnSurface* itr, + const double pTrk, + double dEdx) const { - EGasType gasType = gasTypeInStraw(itr); + EGasType gasType = gasTypeInStraw(ctx,itr); ATH_MSG_DEBUG("mass(): gasTypeInStraw = "<<gasType<<""); - SG::ReadCondHandle<TRTDedxcorrection> readHandle{m_ReadKey}; + SG::ReadCondHandle<TRTDedxcorrection> readHandle{m_ReadKey,ctx}; const TRTDedxcorrection* dEdxCorrection{*readHandle}; if(dEdxCorrection==nullptr) { @@ -592,9 +676,11 @@ double TRT_ToT_dEdx::mass(const Trk::TrackStateOnSurface *itr, const double pTrk /** @todo make failsafe */ static const double bg_min = 0.001; static const double bg_max = 3; // maximal allowed bg - - static const std::string blumRolandiFunction = "( [0]/sqrt( (x*x/([5]*[5]))/(1.+(x*x/([5]*[5]))) )^[3] ) * ([1] - sqrt( (x*x/([5]*[5]))/(1.+(x*x/([5]*[5]))) )^[3] - log([2]+1./((x/[5])^[4]) ) )"; - + + static const std::string blumRolandiFunction = + "( [0]/sqrt( (x*x/([5]*[5]))/(1.+(x*x/([5]*[5]))) )^[3] ) * ([1] - sqrt( " + "(x*x/([5]*[5]))/(1.+(x*x/([5]*[5]))) )^[3] - log([2]+1./((x/[5])^[4]) ) )"; + TF1 blumRolandi( "BR", blumRolandiFunction.c_str(), 0.7, 100000); blumRolandi.SetParameters(dEdxCorrection->paraDedxP1[gasType], @@ -604,24 +690,25 @@ double TRT_ToT_dEdx::mass(const Trk::TrackStateOnSurface *itr, const double pTrk dEdxCorrection->paraDedxP5[gasType], 1.); //blumRolandi.SetParameters(&dEdxCorrection->para_dEdx_BB); - double betaGamma = blumRolandi.GetX(dEdx, bg_min, bg_max); - + double betaGamma = blumRolandi.GetX(dEdx, bg_min, bg_max); + ATH_MSG_DEBUG("mass():: return "<<pTrk/betaGamma<<""); - + return pTrk/betaGamma; } /* returns gas type for given straw */ // TODO: move this functionality to TRT_StrawStatusSummaryTool. -TRT_ToT_dEdx::EGasType TRT_ToT_dEdx::gasTypeInStraw(const Trk::TrackStateOnSurface *itr) const +TRT_ToT_dEdx::EGasType TRT_ToT_dEdx::gasTypeInStraw(const EventContext& ctx, + const Trk::TrackStateOnSurface *itr) const { const Trk::MeasurementBase* trkM = itr->measurementOnTrack(); if (!trkM) { - return kUnset; + return kUnset; } // Check if this is RIO on track - //annd if yes check if is TRT Drift Circle + //annd if yes check if is TRT Drift Circle //then set the ptr const InDet::TRT_DriftCircleOnTrack* driftcircle = nullptr; if (trkM->type(Trk::MeasurementBaseType::RIO_OnTrack)) { @@ -635,24 +722,33 @@ TRT_ToT_dEdx::EGasType TRT_ToT_dEdx::gasTypeInStraw(const Trk::TrackStateOnSurfa return kUnset; } - return gasTypeInStraw(driftcircle); + return gasTypeInStraw(ctx,driftcircle); } -TRT_ToT_dEdx::EGasType TRT_ToT_dEdx::gasTypeInStraw(const InDet::TRT_DriftCircleOnTrack *driftcircle) const +TRT_ToT_dEdx::EGasType +TRT_ToT_dEdx::gasTypeInStraw( + const EventContext& ctx, + const InDet::TRT_DriftCircleOnTrack* driftcircle) const { - Identifier DCid = driftcircle->identify(); - + Identifier DCid = driftcircle->identify(); + // getStatusHT returns enum {Undefined, Dead, Good, Xenon, Argon, Krypton, EmulatedArgon, EmulatedKrypton}. // Our representation of 'GasType' is 0:Xenon, 1:Argon, 2:Krypton EGasType GasType=kUnset; // kUnset is default if (!m_TRTStrawSummaryTool.empty()) { - int stat = m_TRTStrawSummaryTool->getStatusHT(DCid); + int stat = m_TRTStrawSummaryTool->getStatusHT(DCid,ctx); if ( stat==2 || stat==3 ) { GasType = kXenon; } // Xe else if ( stat==1 || stat==4 ) { GasType = kArgon; } // Ar else if ( stat==5 ) { GasType = kKrypton; } // Kr else if ( stat==6 ) { GasType = kArgon; } // Emulated Ar - else if ( stat==7 ) { GasType = kKrypton; } // Emulated Kr - else { ATH_MSG_FATAL ("getStatusHT = " << stat << ", must be 'Good(2)||Xenon(3)' or 'Dead(1)||Argon(4)' or 'Krypton(5)' or 'EmulatedArgon(6)' or 'EmulatedKr(7)'!"); + else if ( stat==7 ) { GasType = kKrypton; + } // Emulated Kr + else { + ATH_MSG_FATAL( + "getStatusHT = " + << stat + << ", must be 'Good(2)||Xenon(3)' or 'Dead(1)||Argon(4)' or " + "'Krypton(5)' or 'EmulatedArgon(6)' or 'EmulatedKr(7)'!"); throw std::exception(); } } @@ -664,9 +760,10 @@ TRT_ToT_dEdx::EGasType TRT_ToT_dEdx::gasTypeInStraw(const InDet::TRT_DriftCircle // Corrections ///////////////////////////////// -double TRT_ToT_dEdx::correctNormalization(double nVtx) const +double +TRT_ToT_dEdx::correctNormalization(const EventContext& ctx, double nVtx) const { - SG::ReadCondHandle<TRTDedxcorrection> readHandle{m_ReadKey}; + SG::ReadCondHandle<TRTDedxcorrection> readHandle{m_ReadKey,ctx}; const TRTDedxcorrection* dEdxCorrection{*readHandle}; if(dEdxCorrection==nullptr) { ATH_MSG_ERROR(" correctNormalization: Could not find any dEdxCorrection in CondStore. Return zero."); @@ -687,7 +784,10 @@ double TRT_ToT_dEdx::correctNormalization(double nVtx) const return (slope*dEdxCorrection->normNzero[gasType]+offset)/(slope*nVtx+offset+shift); } -double TRT_ToT_dEdx::correctToT_corrRZ(const Trk::TrackStateOnSurface* itr, double length) const +double +TRT_ToT_dEdx::correctToT_corrRZ(const EventContext& ctx, + const Trk::TrackStateOnSurface* itr, + double length) const { const Trk::MeasurementBase* trkM = itr->measurementOnTrack(); const Trk::TrackParameters* trkP = itr->trackParameters(); @@ -702,7 +802,7 @@ double TRT_ToT_dEdx::correctToT_corrRZ(const Trk::TrackStateOnSurface* itr, doub driftcircle = static_cast<const InDet::TRT_DriftCircleOnTrack*>(tmpRio); } } - + if (!driftcircle) { return 0; } @@ -720,22 +820,22 @@ double TRT_ToT_dEdx::correctToT_corrRZ(const Trk::TrackStateOnSurface* itr, doub int StrawLayer = m_trtId->straw_layer(DCId); int Layer = m_trtId->layer_or_wheel(DCId); double hitRtrack = std::abs(trkP->parameters()[Trk::locR]); - EGasType gasType = gasTypeInStraw(itr); + EGasType gasType = gasTypeInStraw(ctx,itr); if(gasType==kUnset) { ATH_MSG_ERROR("correctToT_corrRZ(const Trk::TrackStateOnSurface *itr):: Gas type in straw is kUnset! Return ToT = 0"); return 0; } - + if(m_divideByL && length>0) timeOverThreshold = timeOverThreshold/length; if(!m_corrected) return timeOverThreshold; /* else correct */ - + double hitZ = driftcircle->globalPosition().z(); double trackx = driftcircle->globalPosition().x(); double tracky = driftcircle->globalPosition().y(); double hitPosR = std::sqrt(trackx*trackx+tracky*tracky); - - /** @todo implement possiblity to set the scaling factor run-by-run from database, + + /** @todo implement possiblity to set the scaling factor run-by-run from database, should probably be done later on track- level */ double ToTmip = 1; double valToT = 0; @@ -749,7 +849,7 @@ double TRT_ToT_dEdx::correctToT_corrRZ(const Trk::TrackStateOnSurface* itr, doub valToT = fitFuncBarrel_corrRZ(gasType, hitRtrack, hitZ, Layer, StrawLayer); else // End-cap valToT = fitFuncEndcap_corrRZ(gasType, hitRtrack, hitPosR, Layer, hitZ>0?1:(hitZ<0?-1:0)); - } + } if (std::isinf(valToT)) return 0.; if (valToT!=0) return ToTmip*timeOverThreshold/valToT; return 0.; @@ -763,7 +863,7 @@ double TRT_ToT_dEdx::fitFuncBarrel_corrRZ(EGasType gasType, double driftRadius,d return fitFuncBarrelLong_corrRZ(gasType, driftRadius, zPosition, Layer, StrawLayer); } -double TRT_ToT_dEdx::fitFuncEndcap_corrRZ(EGasType gasType, double driftRadius,double radialPosition, int Layer, int sign) const +double TRT_ToT_dEdx::fitFuncEndcap_corrRZ(EGasType gasType, double driftRadius,double radialPosition, int Layer, int sign) const { /** * T(r,R) = T0(r)+ a(r)*R @@ -779,7 +879,7 @@ double TRT_ToT_dEdx::fitFuncBarrelLong_corrRZ(EGasType gasType, double driftRadi * |z| /|z| - l \ * T(r,z) = T0(r) + --- exp|----------| * v(r) \ s(r) / - */ + */ double z = std::abs(zPosition); int sign=1; if(zPosition<0)sign=-1; @@ -807,7 +907,7 @@ double TRT_ToT_dEdx::fitFuncBarrelShort_corrRZ(EGasType gasType, double driftRad if(zPosition<0)sign=-1; double T0 = fitFuncPol_corrRZ(gasType, 0,driftRadius,0,StrawLayer,sign,1); double b = fitFuncPol_corrRZ(gasType, 1,driftRadius,0,StrawLayer,sign,1); - return T0+b*z; + return T0+b*z; } @@ -820,7 +920,7 @@ double TRT_ToT_dEdx::fitFuncPol_corrRZ(EGasType gasType, int parameter, double d ATH_MSG_ERROR(" fitFuncPol_corrRZ: Could not find any dEdxCorrection in CondStore. Return zero."); return 0; } - + double a = 0; double b = 0; double c = 0; @@ -837,7 +937,7 @@ double TRT_ToT_dEdx::fitFuncPol_corrRZ(EGasType gasType, int parameter, double d d = dEdxCorrection->paraLongCorrRZ[gasType][(6*parameter+3)*30*3+Layer*30+Strawlayer+offset]; e = dEdxCorrection->paraLongCorrRZ[gasType][(6*parameter+4)*30*3+Layer*30+Strawlayer+offset]; f = dEdxCorrection->paraLongCorrRZ[gasType][(6*parameter+5)*30*3+Layer*30+Strawlayer+offset]; - + }else if (set ==1) { // short straws in barrel if(sign > 0) offset+=108; a = dEdxCorrection->paraShortCorrRZ[gasType][(6*parameter+0)*9+Layer+offset]; @@ -880,12 +980,12 @@ double TRT_ToT_dEdx::fitFuncPol_corrRZ(EGasType gasType, int parameter, double d d = dEdxCorrection->paraEndCorrRZMC[gasType][(6*parameter+3)*28+Layer]; e = dEdxCorrection->paraEndCorrRZMC[gasType][(6*parameter+4)*28+Layer]; f = dEdxCorrection->paraEndCorrRZMC[gasType][(6*parameter+5)*28+Layer]; - } + } } return a+b*r+c*r*r+d*r*r*r+e*r*r*r*r+f*r*r*r*r*r; } -double TRT_ToT_dEdx::fitFuncEndcap_corrRZL(EGasType gasType, double driftRadius,double radialPosition, int Layer, int sign) const +double TRT_ToT_dEdx::fitFuncEndcap_corrRZL(EGasType gasType, double driftRadius,double radialPosition, int Layer, int sign) const { /* * T(r,R) = T0(r)+ a(r)*R @@ -899,7 +999,7 @@ double TRT_ToT_dEdx::fitFuncEndcap_corrRZL(EGasType gasType, double driftRadius, } double r = std::abs(driftRadius); - double a,b,c,d,e,f,g,h,i; + double a,b,c,d,e,f,g,h,i; if(sign >0) Layer+=14; if(m_isData){ a = dEdxCorrection->paraEndCorrRZDivideByLengthDATA[gasType][(0)*28+Layer]; @@ -907,33 +1007,33 @@ double TRT_ToT_dEdx::fitFuncEndcap_corrRZL(EGasType gasType, double driftRadius, c = dEdxCorrection->paraEndCorrRZDivideByLengthDATA[gasType][(2)*28+Layer]; d = dEdxCorrection->paraEndCorrRZDivideByLengthDATA[gasType][(3)*28+Layer]; e = dEdxCorrection->paraEndCorrRZDivideByLengthDATA[gasType][(4)*28+Layer]; - f = dEdxCorrection->paraEndCorrRZDivideByLengthDATA[gasType][(5)*28+Layer]; - g = dEdxCorrection->paraEndCorrRZDivideByLengthDATA[gasType][(6)*28+Layer]; - h = dEdxCorrection->paraEndCorrRZDivideByLengthDATA[gasType][(7)*28+Layer]; - i = dEdxCorrection->paraEndCorrRZDivideByLengthDATA[gasType][(8)*28+Layer]; + f = dEdxCorrection->paraEndCorrRZDivideByLengthDATA[gasType][(5)*28+Layer]; + g = dEdxCorrection->paraEndCorrRZDivideByLengthDATA[gasType][(6)*28+Layer]; + h = dEdxCorrection->paraEndCorrRZDivideByLengthDATA[gasType][(7)*28+Layer]; + i = dEdxCorrection->paraEndCorrRZDivideByLengthDATA[gasType][(8)*28+Layer]; }else{ a = dEdxCorrection->paraEndCorrRZDivideByLengthMC[gasType][(0)*28+Layer]; b = dEdxCorrection->paraEndCorrRZDivideByLengthMC[gasType][(1)*28+Layer]; c = dEdxCorrection->paraEndCorrRZDivideByLengthMC[gasType][(2)*28+Layer]; d = dEdxCorrection->paraEndCorrRZDivideByLengthMC[gasType][(3)*28+Layer]; e = dEdxCorrection->paraEndCorrRZDivideByLengthMC[gasType][(4)*28+Layer]; - f = dEdxCorrection->paraEndCorrRZDivideByLengthMC[gasType][(5)*28+Layer]; - g = dEdxCorrection->paraEndCorrRZDivideByLengthMC[gasType][(6)*28+Layer]; - h = dEdxCorrection->paraEndCorrRZDivideByLengthMC[gasType][(7)*28+Layer]; - i = dEdxCorrection->paraEndCorrRZDivideByLengthMC[gasType][(8)*28+Layer]; - } + f = dEdxCorrection->paraEndCorrRZDivideByLengthMC[gasType][(5)*28+Layer]; + g = dEdxCorrection->paraEndCorrRZDivideByLengthMC[gasType][(6)*28+Layer]; + h = dEdxCorrection->paraEndCorrRZDivideByLengthMC[gasType][(7)*28+Layer]; + i = dEdxCorrection->paraEndCorrRZDivideByLengthMC[gasType][(8)*28+Layer]; + } double T1 = b*r+c*r*r+d*r*r*r+e*r*r*r*r+f*r*r*r*r*r; double slope = g+h*r+i*r*r; double T0 = a; - + return T0+T1+slope*radialPosition; } -double TRT_ToT_dEdx::fitFuncBarrel_corrRZL(EGasType gasType, double driftRadius,double zPosition, int Layer, int Strawlayer) const +double TRT_ToT_dEdx::fitFuncBarrel_corrRZL(EGasType gasType, double driftRadius,double zPosition, int Layer, int Strawlayer) const { /* - * T(r,z) = T0(r)+ b(r)*z*z + * T(r,z) = T0(r)+ b(r)*z*z */ SG::ReadCondHandle<TRTDedxcorrection> readHandle{m_ReadKey}; const TRTDedxcorrection* dEdxCorrection{*readHandle}; @@ -942,7 +1042,7 @@ double TRT_ToT_dEdx::fitFuncBarrel_corrRZL(EGasType gasType, double driftRadius, return 0; } - double a,b,c,d,e,f,g; + double a,b,c,d,e,f,g; if (Layer==0 && Strawlayer<9) { // short straws if (m_isData){ a = dEdxCorrection->paraShortCorrRZDivideByLengthDATA[gasType][(0)*9+Strawlayer]; @@ -983,9 +1083,9 @@ double TRT_ToT_dEdx::fitFuncBarrel_corrRZL(EGasType gasType, double driftRadius, double z = std::abs(zPosition); double r = std::abs(driftRadius); double T0neg=a; - double T0pos=b; + double T0pos=b; double T1 = std::exp(-c*r*r)+d*r; - double slope = e*r+f*r*r+g*r*r*r; + double slope = e*r+f*r*r+g*r*r*r; double result; result = T0neg+T1+slope*z; if (zPosition>0) result = T0pos+T1+slope*z; @@ -997,7 +1097,7 @@ double TRT_ToT_dEdx::hitOccupancyCorrection(const Trk::TrackStateOnSurface *itr) { SG::ReadCondHandle<TRTDedxcorrection> readHandle{m_ReadKey}; const TRTDedxcorrection* dEdxCorrection{*readHandle}; - + const Trk::MeasurementBase* trkM = itr->measurementOnTrack(); // Check if this is RIO on track @@ -1029,11 +1129,11 @@ double TRT_ToT_dEdx::hitOccupancyCorrection(const Trk::TrackStateOnSurface *itr) int HitPart = m_trtId->barrel_ec(DCId); double Trt_HitTheta = trkP->parameters()[Trk::theta]; double trackEta = -log(tan(Trt_HitTheta/2.0)); - + double localOccupancy = m_localOccTool->LocalOccupancy(trackEta, phimodule); double ToTmip = 1; double valToT = 1.; - + double p0=0., p1=0., p2=0., p0_flat=0.; //the calibration array is structured as follows (hence the non intuitive numbers) @@ -1073,7 +1173,7 @@ double TRT_ToT_dEdx::hitOccupancyCorrection(const Trk::TrackStateOnSurface *itr) //Hence the tot value is divided by the value of the function //multiplied to the non-shared intercept valToT = p0_flat/(p0+p1*localOccupancy+p2*localOccupancy*localOccupancy); - + return ToTmip*valToT; } @@ -1081,7 +1181,7 @@ double TRT_ToT_dEdx::trackOccupancyCorrection(const Trk::Track* track, bool use { SG::ReadCondHandle<TRTDedxcorrection> readHandle{m_ReadKey}; const TRTDedxcorrection* dEdxCorrection{*readHandle}; - + double corr=-999.; double trackOcc = m_localOccTool->LocalOccupancy(*track); const Trk::TrackParameters* perigee = track->perigeeParameters(); @@ -1106,7 +1206,7 @@ double TRT_ToT_dEdx::trackOccupancyCorrection(const Trk::Track* track, bool use double TRT_ToT_dEdx::calculateTrackLengthInStraw(const Trk::TrackStateOnSurface* trackState, const TRT_ID* identifier) { if (trackState->type(Trk::TrackStateOnSurface::Outlier)) return 0.; //Outliers - + const Trk::MeasurementBase* trkM = trackState->measurementOnTrack(); if (!trkM) { return 0.; diff --git a/InnerDetector/InDetRecTools/TRT_ElectronPidTools/src/TRT_ToT_dEdx.h b/InnerDetector/InDetRecTools/TRT_ElectronPidTools/src/TRT_ToT_dEdx.h index 0c948b006ba7bca027c701112561ebe3cb23ace1..05e33f860725ddd081c24391f9edaee2490edfb6 100644 --- a/InnerDetector/InDetRecTools/TRT_ElectronPidTools/src/TRT_ToT_dEdx.h +++ b/InnerDetector/InDetRecTools/TRT_ElectronPidTools/src/TRT_ToT_dEdx.h @@ -112,9 +112,9 @@ public: /** Virtual destructor*/ virtual ~TRT_ToT_dEdx(); /** AlgTool initailize method.*/ - StatusCode initialize(); + virtual StatusCode initialize() override; /** AlgTool finalize method */ - StatusCode finalize(); + virtual StatusCode finalize() override; /** * @brief function to calculate sum ToT normalised to number of used hits @@ -122,7 +122,12 @@ public: * @param useHitsHT decide if HT hits should be used in the estimate * @return dEdx value */ - double dEdx(const Trk::Track* track, bool useHThits=true) const; + using ITRT_ToT_dEdx::dEdx; + using ITRT_ToT_dEdx::usedHits; + using ITRT_ToT_dEdx::getTest; + virtual double dEdx(const EventContext& ctx, + const Trk::Track* track, + bool useHThits = true) const override final; /** * @brief function to calculate number of used hits @@ -130,7 +135,24 @@ public: * @param useHitsHT decide if HT hits should be used in the estimate * @return nHits */ - double usedHits(const Trk::Track* track, bool useHThits=true) const; + virtual double usedHits(const EventContext& ctx, + const Trk::Track* track, + bool useHThits = true) const override final; + /** + * @brief function to calculate likelihood ratio test + * @param observed dEdx + * @param track parameter + * @param particle hypothesis + * @param antihypothesis + * @param number of used hits + * @return test value between 0 and 1 + */ + virtual double getTest(const EventContext& ctx, + const double dEdx_obs, + const double pTrk, + Trk::ParticleHypothesis hypothesis, + Trk::ParticleHypothesis antihypothesis, + int nUsedHits) const override final; protected: /** @@ -141,16 +163,18 @@ protected: * @param length length in straw * @return decision */ - bool isGoodHit(const Trk::TrackStateOnSurface* trackState, bool useHitsHT, double& length) const; + bool isGoodHit(const EventContext& ctx, + const Trk::TrackStateOnSurface* trackState, + bool useHitsHT, + double& length) const; /** * @brief correct overall dEdx normalization on track level * @param number of primary vertices per event * @return scaling variable */ - double correctNormalization(double nVtx=-1) const; + double correctNormalization(const EventContext& ctx, double nVtx = -1) const; -public: /** * @brief function to calculate likelihood from prediction and resolution * @param observed dEdx @@ -159,30 +183,34 @@ public: * @param number of used hits * @return brobability value between 0 and 1 */ - double getProb(const Trk::TrackStateOnSurface *itr, const double dEdx_obs, const double pTrk, Trk::ParticleHypothesis hypothesis, int nUsedHits) const; - double getProb(EGasType gasType, const double dEdx_obs, const double pTrk, Trk::ParticleHypothesis hypothesis, int nUsedHits) const; + double getProb(const EventContext& ctx, + const Trk::TrackStateOnSurface* itr, + const double dEdx_obs, + const double pTrk, + Trk::ParticleHypothesis hypothesis, + int nUsedHits) const; + double getProb(const EventContext& ctx, + EGasType gasType, + const double dEdx_obs, + const double pTrk, + Trk::ParticleHypothesis hypothesis, + int nUsedHits) const; - /** - * @brief function to calculate likelihood ratio test - * @param observed dEdx - * @param track parameter - * @param particle hypothesis - * @param antihypothesis - * @param number of used hits - * @return test value between 0 and 1 - */ - double getTest(const double dEdx_obs, const double pTrk, Trk::ParticleHypothesis hypothesis, Trk::ParticleHypothesis antihypothesis, int nUsedHits) const; /** * @brief function to calculate expectation value for dEdx using BB fit * @param track momentum * @param hypothesis * @return dEdx_pred */ - double predictdEdx(const Trk::TrackStateOnSurface *itr, const double pTrk, Trk::ParticleHypothesis hypothesis) const; - - double predictdEdx(EGasType gasType, const double pTrk, Trk::ParticleHypothesis hypothesis) const; - + double predictdEdx(const EventContext& ctx, + const Trk::TrackStateOnSurface* itr, + const double pTrk, + Trk::ParticleHypothesis hypothesis) const; + double predictdEdx(const EventContext& ctx, + EGasType gasType, + const double pTrk, + Trk::ParticleHypothesis hypothesis) const; /** * @brief function to extract most likely mass in bg [0,3] @@ -190,9 +218,11 @@ public: * @param measured dEdx * @return mass */ - double mass(const Trk::TrackStateOnSurface *itr, const double pTrk, double dEdx ) const; + double mass(const EventContext& ctx, + const Trk::TrackStateOnSurface* itr, + const double pTrk, + double dEdx) const; -protected: /** * @brief main function to correct ToT values on hit level as a function of track radius and z-position * @param track on surface object @@ -202,16 +232,21 @@ protected: * @param bool variable whether mimic ToT to other gas hits shoule be used * @return corrected value for ToT */ - double correctToT_corrRZ(const Trk::TrackStateOnSurface *itr, double length) const; - + double correctToT_corrRZ(const EventContext& ctx, + const Trk::TrackStateOnSurface* itr, + double length) const; + /** * @brief return gas type for that hit * @param track on surface object * @return gasType */ - EGasType gasTypeInStraw(const Trk::TrackStateOnSurface *itr) const; - EGasType gasTypeInStraw(const InDet::TRT_DriftCircleOnTrack *driftcircle) const; - + EGasType gasTypeInStraw(const EventContext& ctx, + const Trk::TrackStateOnSurface* itr) const; + EGasType gasTypeInStraw( + const EventContext& ctx, + const InDet::TRT_DriftCircleOnTrack* driftcircle) const; + private: SG::ReadCondHandleKey<TRTDedxcorrection> m_ReadKey{this,"Dedxcorrection","Dedxcorrection","Dedx constants in-key"}; diff --git a/InnerDetector/InDetRecTools/TrackVertexAssociationTool/Root/MVATrackVertexAssociationTool.cxx b/InnerDetector/InDetRecTools/TrackVertexAssociationTool/Root/MVATrackVertexAssociationTool.cxx index 3c7563ab8dce30872b895fbdeccb1b1cb38b3324..16b2c4b3315d2a06520e1324d759c5c75089b1c4 100644 --- a/InnerDetector/InDetRecTools/TrackVertexAssociationTool/Root/MVATrackVertexAssociationTool.cxx +++ b/InnerDetector/InDetRecTools/TrackVertexAssociationTool/Root/MVATrackVertexAssociationTool.cxx @@ -241,7 +241,7 @@ StatusCode MVATrackVertexAssociationTool::initializeNetwork() { // For sequential: if (m_isSequential) { lwt::JSONConfig netDef = lwt::parse_json(netFile); - m_network = std::move(std::unique_ptr<lwt::LightweightNeuralNetwork>(new lwt::LightweightNeuralNetwork(netDef.inputs, netDef.layers, netDef.outputs))); + m_network = std::unique_ptr<lwt::LightweightNeuralNetwork>(new lwt::LightweightNeuralNetwork(netDef.inputs, netDef.layers, netDef.outputs)); } // For functional: else { @@ -251,7 +251,7 @@ StatusCode MVATrackVertexAssociationTool::initializeNetwork() { return StatusCode::FAILURE; } m_inputNodeName = netDef.inputs[0].name; - m_graph = std::move(std::unique_ptr<lwt::LightweightGraph>(new lwt::LightweightGraph(netDef))); + m_graph = std::unique_ptr<lwt::LightweightGraph>(new lwt::LightweightGraph(netDef)); } return StatusCode::SUCCESS; diff --git a/InnerDetector/InDetValidation/InDetExperimentalReco/share/jobOptions_RecExCommon_masking.py b/InnerDetector/InDetValidation/InDetExperimentalReco/share/jobOptions_RecExCommon_masking.py index 771d5e3bb8dcc941e57ff2b313aa83a9b0e8e33e..0cd2a14338cfec574a0003943af9c97b0639a228 100755 --- a/InnerDetector/InDetValidation/InDetExperimentalReco/share/jobOptions_RecExCommon_masking.py +++ b/InnerDetector/InDetValidation/InDetExperimentalReco/share/jobOptions_RecExCommon_masking.py @@ -208,9 +208,6 @@ from IOVDbSvc.CondDB import conddb conddb.addOverride ('/SCT/Manual/BadModules', 'SCTManualBadModules-000-00') -ServiceMgr.SpecialPixelMapSvc.MaskLayers = True -ServiceMgr.SpecialPixelMapSvc.LayersToMask = [0] - #ServiceMgr.InDetSCT_ModuleVetoSvc.MaskLayers = True #ServiceMgr.InDetSCT_ModuleVetoSvc.MaskSide = -1 #ServiceMgr.InDetSCT_ModuleVetoSvc.DisksToMask = [-9] diff --git a/LArCalorimeter/LArBadChannelTool/python/LArBadChannelConfig.py b/LArCalorimeter/LArBadChannelTool/python/LArBadChannelConfig.py index 44ff1145650a2bf9441dcb75e3178dab7ca96bf2..8963b7a358e2d8819c08eceb40d167cfd6becefc 100644 --- a/LArCalorimeter/LArBadChannelTool/python/LArBadChannelConfig.py +++ b/LArCalorimeter/LArBadChannelTool/python/LArBadChannelConfig.py @@ -11,7 +11,10 @@ def LArBadChannelCfg(configFlags, tag=None): result=LArOnOffIdMappingCfg(configFlags) rekey="/LAR/BadChannels/BadChannels" - if configFlags.Input.isMC: + if configFlags.Overlay.DataOverlay: + # TODO: move this in a better location + result.merge(addFolders(configFlags, "/LAR/BadChannels/BadChannels", "LAR_OFL", className="CondAttrListCollection", tag="LARBadChannelsBadChannels-HECAQ3Missing", db="OFLP200")) + elif configFlags.Input.isMC: result.merge(addFolders(configFlags,"/LAR/BadChannels/BadChannels","LAR_OFL",tag=tag, className="CondAttrListCollection")) else: @@ -27,7 +30,10 @@ def LArBadFebCfg(configFlags, tag=None): result=ComponentAccumulator() rekey="/LAR/BadChannels/MissingFEBs" - if configFlags.Input.isMC: + if configFlags.Overlay.DataOverlay: + # TODO: move this in a better location + result.merge(addFolders(configFlags, "/LAR/BadChannels/MissingFEBs", "LAR_OFL", className="AthenaAttributeList", tag="LArBadChannelsMissingFEBs-IOVDEP-04", db="OFLP200")) + elif configFlags.Input.isMC: result.merge(addFolders(configFlags,"/LAR/BadChannels/MissingFEBs","LAR_OFL",tag=tag, className="AthenaAttributeList")) else: diff --git a/LArCalorimeter/LArDigitization/LArDigitization/LArHitEMap.h b/LArCalorimeter/LArDigitization/LArDigitization/LArHitEMap.h index 8c9ba224013e220c83045aecefb21d84786a5c23..428a802fdfb2f69754ccb62d18bcdfad1e2c762c 100644 --- a/LArCalorimeter/LArDigitization/LArDigitization/LArHitEMap.h +++ b/LArCalorimeter/LArDigitization/LArDigitization/LArHitEMap.h @@ -1,6 +1,6 @@ //Dear emcas this is -*-c++-*-- /* - Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ #ifndef LARDIGITIZATION_LARHITEMAP_H @@ -16,6 +16,9 @@ #include "AthenaKernel/CLASS_DEF.h" +class McEventCollection; + + class LArHitEMap { @@ -42,7 +45,8 @@ public: ~LArHitEMap(void); bool AddEnergy(const IdentifierHash index, const float energy, const float time); bool AddEnergy(const Identifier cellid, const float energy, const float time); - bool BuildWindows(float deta, float dphi, float ptmin); + bool BuildWindows(const McEventCollection* mcCollptr, + float deta, float dphi, float ptmin); int GetNbCells(void) const; inline const LArHitList& GetCell(const unsigned int index) const {return m_emap[index];} ; inline const std::vector<std::pair<float,float> >& GetTimeE(const IdentifierHash index) const { return m_emap[index].getData();} diff --git a/LArCalorimeter/LArDigitization/src/LArHitEMap.cxx b/LArCalorimeter/LArDigitization/src/LArHitEMap.cxx index 50c707e6b56d2f624840a5cc150a4d57903e99d4..ad87463246f1f3501641daf0c0c8157b76563ec5 100644 --- a/LArCalorimeter/LArDigitization/src/LArHitEMap.cxx +++ b/LArCalorimeter/LArDigitization/src/LArHitEMap.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ #include <iostream> @@ -15,7 +15,6 @@ #include "GaudiKernel/MsgStream.h" #include "GaudiKernel/IService.h" #include "StoreGate/StoreGateSvc.h" -#include "StoreGate/StoreGate.h" #include "GeneratorObjects/McEventCollection.h" #include "AtlasHepMC/GenEvent.h" #include "AtlasHepMC/GenParticle.h" @@ -73,7 +72,8 @@ int LArHitEMap::GetNbCells(void) const return m_emap.size() ; } -bool LArHitEMap::BuildWindows(float deta,float dphi, float ptmin) +bool LArHitEMap::BuildWindows(const McEventCollection* mcCollptr, + float deta,float dphi, float ptmin) { // get list of particles std::vector<double> phiPart; @@ -82,16 +82,11 @@ bool LArHitEMap::BuildWindows(float deta,float dphi, float ptmin) // std::cout << " in BuildWindows " << deta << dphi << ptmin << std::endl; etaPart.clear(); phiPart.clear(); - //get pointer of MC collection - StoreGateSvc* SgSvc = StoreGate::pointer(); - const McEventCollection* mcCollptr = nullptr; - if ( SgSvc->retrieve(mcCollptr,"").isFailure() ) { - MsgStream log(Athena::getMessageSvc(), "LArHitEMap"); - log << MSG::WARNING - << "LArHitEMap:cannot retrieve McEventCollection (keyless)" - << endmsg; - return false; + + if (!mcCollptr) { + return false; } + McEventCollection::const_iterator itr; // std::cout << " start loop over particles " << std::endl; for (itr = mcCollptr->begin(); itr!=mcCollptr->end(); ++itr) { diff --git a/LArCalorimeter/LArDigitization/src/LArPileUpTool.cxx b/LArCalorimeter/LArDigitization/src/LArPileUpTool.cxx index 776959abc397bf877a6d19eb1b6d0fd8a67ff228..2ae44ac2ca4420d8b2cfcabcac2895ec6154a86d 100755 --- a/LArCalorimeter/LArDigitization/src/LArPileUpTool.cxx +++ b/LArCalorimeter/LArDigitization/src/LArPileUpTool.cxx @@ -26,6 +26,7 @@ #include "CaloDetDescr/CaloDetDescrManager.h" #include "CaloIdentifier/CaloIdManager.h" #include "EventInfoUtils/EventIDFromStore.h" +#include "GeneratorObjects/McEventCollection.h" #include "AthenaKernel/RNGWrapper.h" #include "CLHEP/Random/RandomEngine.h" @@ -292,10 +293,19 @@ StatusCode LArPileUpTool::prepareEvent(const EventContext& ctx, unsigned int /*n if (m_Windows) { ATH_MSG_DEBUG(" redefine windows list "); - m_hitmap->BuildWindows(m_WindowsEtaSize,m_WindowsPhiSize, - m_WindowsPtCut); + + // FIXME: Use a ReadHandle. + const McEventCollection* mcCollptr = nullptr; + if ( evtStore()->retrieve(mcCollptr).isFailure() ) { + ATH_MSG_WARNING ("LArHitEMap:cannot retrieve McEventCollection (keyless)"); + } + + m_hitmap->BuildWindows(mcCollptr, + m_WindowsEtaSize,m_WindowsPhiSize, + m_WindowsPtCut); if(m_doDigiTruth) { - m_hitmap_DigiHSTruth->BuildWindows(m_WindowsEtaSize,m_WindowsPhiSize, m_WindowsPtCut); + m_hitmap_DigiHSTruth->BuildWindows(mcCollptr, + m_WindowsEtaSize,m_WindowsPhiSize, m_WindowsPtCut); } } diff --git a/LArCalorimeter/LArMonitoring/python/LArNoisyROMonAlg.py b/LArCalorimeter/LArMonitoring/python/LArNoisyROMonAlg.py index c5049af4a844d7566c471a131e3f6b330e24be3d..a0203ef6865ee8d0a0d64000b015243139873369 100644 --- a/LArCalorimeter/LArMonitoring/python/LArNoisyROMonAlg.py +++ b/LArCalorimeter/LArMonitoring/python/LArNoisyROMonAlg.py @@ -106,7 +106,7 @@ def LArNoisyROMonConfigCore(helper,algoinstance,inputFlags, ] doTrigger=False if isRun3Cfg(): - if inputFlags.Trigger.doHLT or LArNoisyROMonForceTrigger: + if inputFlags.DQ.useTrigger or LArNoisyROMonForceTrigger: doTrigger=True else: if inputFlags.doHLTMon or LArNoisyROMonForceTrigger: diff --git a/LumiBlock/LumiBlockComps/python/BunchCrossingCondAlgConfig.py b/LumiBlock/LumiBlockComps/python/BunchCrossingCondAlgConfig.py index 1ec4df0ac0995d633face79d6638d87e95a1d316..42674515bcb927ddb6c3f238e65e6bf4f2008046 100644 --- a/LumiBlock/LumiBlockComps/python/BunchCrossingCondAlgConfig.py +++ b/LumiBlock/LumiBlockComps/python/BunchCrossingCondAlgConfig.py @@ -18,7 +18,7 @@ def BunchCrossingCondAlgCfg(configFlags): result.merge(addFolders(configFlags,folder,None,className="AthenaAttributeList")) else: #data case folder = '/TDAQ/OLC/LHC/FILLPARAMS' - result.merge(addFolders(configFlags,folder,'TDAQ',className = 'AthenaAttributeList')) + result.merge(addFolders(configFlags,folder,'TDAQ',className = 'AthenaAttributeList',tag='HEAD')) alg = BunchCrossingCondAlg(Run1=run1, diff --git a/LumiBlock/LumiBlockComps/python/BunchCrossingCondAlgTest.py b/LumiBlock/LumiBlockComps/python/BunchCrossingCondAlgTest.py index 7889e9d039c6daf26f7bbe18cb83df1d83063cc8..9fd8e749c5f0bd413567b28d6d0950f2542ba87b 100644 --- a/LumiBlock/LumiBlockComps/python/BunchCrossingCondAlgTest.py +++ b/LumiBlock/LumiBlockComps/python/BunchCrossingCondAlgTest.py @@ -92,6 +92,7 @@ from AthenaConfiguration.MainServicesConfig import MainServicesCfg ConfigFlags.IOVDb.DatabaseInstance="CONDBR2" ConfigFlags.Input.isMC=False ConfigFlags.IOVDb.GlobalTag="CONDBR2-BLKPA-2017-05" +ConfigFlags.GeoModel.AtlasVersion="ATLAS-R2-2016-01-00-01" ConfigFlags.lock() result=MainServicesCfg(ConfigFlags) diff --git a/MuonSpectrometer/Amdcsimrec/AmdcDb/src/AmdcDbSvcMakerFromAmdc.cxx b/MuonSpectrometer/Amdcsimrec/AmdcDb/src/AmdcDbSvcMakerFromAmdc.cxx index 89285e9eacf0a8ec599a5c87830e9f26ced76eda..0db7b7f9184ee6e2b1a1ece6ce8924ffe1d3f7da 100755 --- a/MuonSpectrometer/Amdcsimrec/AmdcDb/src/AmdcDbSvcMakerFromAmdc.cxx +++ b/MuonSpectrometer/Amdcsimrec/AmdcDb/src/AmdcDbSvcMakerFromAmdc.cxx @@ -7,6 +7,9 @@ #include "AmdcDb/AmdcDbSvc.h" #include "AmdcDb/AmdcDbRecordset.h" #include "AmdcDb/AmdcDbRecord.h" +#include "GaudiKernel/MsgStream.h" +#include "AthenaKernel/getMessageSvc.h" + #include <cmath> AmdcDbSvcMakerFromAmdc::AmdcDbSvcMakerFromAmdc(){ @@ -1339,7 +1342,30 @@ if ((StationNameHEAD[0] != 'T' DbVar = "VERS" ; DbVarComment="VERSION" ; iDbVal = m_version ; pAmdcDbRecord->addInt(DbVar,DbVarComment,iDbVal); DbVar = "DX" ; DbVarComment="X RELATIVE POSITION OF THE SUB-CUT" ; dDbVal = pAmdcsimrec->Cutdx (pAmdcsimrec->INOCUT(DB_JTYP,DB_INDX,DB_ICUT),KounterCutLines)/ 10. ; pAmdcDbRecord->addDouble(DbVar,DbVarComment,dDbVal,LocalEpsLengthCM); - DbVar = "DY" ; DbVarComment="Y RELATIVE POSITION OF THE SUB-CUT" ; dDbVal = pAmdcsimrec->Cutdy (pAmdcsimrec->INOCUT(DB_JTYP,DB_INDX,DB_ICUT),KounterCutLines)/ 10. ; + DbVar = "DY"; + DbVarComment="Y RELATIVE POSITION OF THE SUB-CUT"; + int theDbIdx = DB_INDX; + // when amdb is mirroring chambers from the Aside to the Cside, it increments the station numbers, e.g. BIS7 becomes BIS17 etc. + // however, something inside the INOCUT function (https://acode-browser1.usatlas.bnl.gov/lxr/source/athena/MuonSpectrometer/Amdcsimrec/AmdcStand/src/readmdb.F90#0611) + // cannot translate these larger station numbers to the correct amdb numbers needed by the amdb Cut_dy function + // (https://acode-browser1.usatlas.bnl.gov/lxr/source/athena/MuonSpectrometer/Amdcsimrec/AmdcStand/src/readmdb.F90#0971) + // this Cut_dy function only returns the correct H Line dy values in case the original amdb station number is given. + // This only happens for BI upgrades, BIS78 and BI1-6 + if (TheStationName.find("BI")!=std::string::npos) { + if (DB_INDX>16) { + MsgStream log(Athena::getMessageSvc(),"AmdcDbSvcMakerFromAmdc::ALIN"); + log<<MSG::WARNING<<"ATTENTION: Adjusting DB_INDX value for H Line Cutdy method call. This should only be done for BI upgrade chambers."<<endmsg; + } + if (DB_INDX==17) theDbIdx=7; + else if (DB_INDX==18) theDbIdx=13; + else if (DB_INDX==19) theDbIdx=9; + else if (DB_INDX==20) theDbIdx=10; + else if (DB_INDX==21) theDbIdx=8; + else if (DB_INDX==24) theDbIdx=11; + else if (DB_INDX==25) theDbIdx=12; + else if (DB_INDX==26) theDbIdx=14; + } + dDbVal = pAmdcsimrec->Cutdy(pAmdcsimrec->INOCUT(DB_JTYP,theDbIdx,DB_ICUT),KounterCutLines)/10.; // JFL Thu Apr 3 14:47:44 CEST 2008: // found by Stefania Spagnolo: When computed for the -Z part there are rounding errors which giving non nul value to Dy while it should be null // patch: put it a 0. if too small diff --git a/MuonSpectrometer/MSVertexReconstruction/MSVertexTools/src/MSVertexRecoTool.cxx b/MuonSpectrometer/MSVertexReconstruction/MSVertexTools/src/MSVertexRecoTool.cxx index fcedd0f04ee2ec6e58b2ed89ad2ceaf11007fb92..71c7c01dba5746ab9af28e794c64c147a38e150e 100644 --- a/MuonSpectrometer/MSVertexReconstruction/MSVertexTools/src/MSVertexRecoTool.cxx +++ b/MuonSpectrometer/MSVertexReconstruction/MSVertexTools/src/MSVertexRecoTool.cxx @@ -1064,11 +1064,11 @@ namespace Muon { //core algorithm for endcap vertex reconstruction Amg::Vector3D MSVertexRecoTool::VxMinQuad(const std::vector<Tracklet> &tracks) const { - float s(0.),sx(0.),sy(0.),sxy(0.),sxx(0.),d(0.); - float sigma = 1.; + double s(0.),sx(0.),sy(0.),sxy(0.),sxx(0.),d(0.); + double sigma = 1.; for(unsigned int i=0; i<tracks.size(); ++i) { - float TrkSlope = std::tan(tracks.at(i).getML1seg().alpha()); - float TrkInter = tracks.at(i).getML1seg().globalPosition().perp() - tracks.at(i).getML1seg().globalPosition().z()*TrkSlope; + double TrkSlope = std::tan(tracks.at(i).getML1seg().alpha()); + double TrkInter = tracks.at(i).getML1seg().globalPosition().perp() - tracks.at(i).getML1seg().globalPosition().z()*TrkSlope; s += 1./(sq(sigma)); sx += TrkSlope/(sq(sigma)); sxx += sq(TrkSlope)/sq(sigma); @@ -1081,9 +1081,9 @@ namespace Muon { return MyVx; } - float Rpos = (sxx*sy - sx*sxy)/d; - float Zpos = (sx*sy - s*sxy)/d; - + double Rpos = (sxx*sy - sx*sxy)/d; + double Zpos = (sx*sy - s*sxy)/d; + Amg::Vector3D MyVx(Rpos,0,Zpos); return MyVx; diff --git a/MuonSpectrometer/MuonCnv/MuonByteStreamCnvTest/src/MdtDigitToMdtRDO.cxx b/MuonSpectrometer/MuonCnv/MuonByteStreamCnvTest/src/MdtDigitToMdtRDO.cxx index 2e69f7421a4a86d179d64c11f39cb1c56a69cce3..689dfbe4ed13bbc0e31f9b9f28ed442974023c77 100644 --- a/MuonSpectrometer/MuonCnv/MuonByteStreamCnvTest/src/MdtDigitToMdtRDO.cxx +++ b/MuonSpectrometer/MuonCnv/MuonByteStreamCnvTest/src/MdtDigitToMdtRDO.cxx @@ -123,7 +123,7 @@ StatusCode MdtDigitToMdtRDO::fill_MDTdata(const EventContext& ctx) const { ATH_MSG_ERROR( name << " " << eta << " " << phi << " " << "and dummy multilayer=1, layer=1, tube=1 ." ); - std::abort(); + return StatusCode::FAILURE; } Identifier chid1, chid2; @@ -173,7 +173,7 @@ StatusCode MdtDigitToMdtRDO::fill_MDTdata(const EventContext& ctx) const { ATH_MSG_ERROR( name << " " << eta << " " << phi << " " << " and dummy multilayer=1, layer=1, tube=1 ." ); - std::abort(); + return StatusCode::FAILURE; } mdtCsm_2nd = new MdtCsm(chid2, elementHash_2nd, subsystem_2ndcsm, mrod_2ndcsm, link_2ndcsm); @@ -200,13 +200,21 @@ StatusCode MdtDigitToMdtRDO::fill_MDTdata(const EventContext& ctx) const { subsystem, mrod, link, tdc, channel); - if (!cabling) { - ATH_MSG_ERROR( "MDTcabling can't return an online ID for the channel : " ); - ATH_MSG_ERROR( name << " " - << eta << " " << phi << " " - << multilayer << " " << layer << " " << tube ); - std::abort(); - } + if (!cabling) { + // as long as there is no BIS78 cabling, to avoid a hard crash, replace the tubeNumber + // of tubes not covered in the cabling by 1 + if (m_idHelperSvc->mdtIdHelper().stationName(channelId)==1 + && std::abs(m_idHelperSvc->mdtIdHelper().stationEta(channelId))>6 + && m_idHelperSvc->issMdt(channelId)) { + ATH_MSG_WARNING("Found BIS78 sMDT with tubeLayer="<<layer<<" and tubeNumber="<<tube<<". Setting to 1,1 for now..."); + cabling = readCdo->getOnlineId(name, eta, phi, multilayer, 1, 1,subsystem, mrod, link, tdc, channel); + } + if (!cabling) { + ATH_MSG_ERROR( "MDTcabling can't return an online ID for the channel : " ); + ATH_MSG_ERROR( name << " " << eta << " " << phi << " " << multilayer << " " << layer << " " << tube ); + return StatusCode::FAILURE; + } + } bool masked = mdtDigit->is_masked(); // Create the new AMT hit diff --git a/MuonSpectrometer/MuonCnv/MuonCSC_CnvTools/src/CscDigitToCscRDOTool.cxx b/MuonSpectrometer/MuonCnv/MuonCSC_CnvTools/src/CscDigitToCscRDOTool.cxx index e2a81339732e975d0485d5f96e07b718b86f5476..c3902c58c34ce1a4d9eeeecfb3aafefe04ad460f 100644 --- a/MuonSpectrometer/MuonCnv/MuonCSC_CnvTools/src/CscDigitToCscRDOTool.cxx +++ b/MuonSpectrometer/MuonCnv/MuonCSC_CnvTools/src/CscDigitToCscRDOTool.cxx @@ -213,7 +213,7 @@ StatusCode CscDigitToCscRDOTool::fill_CSCdata() ((neutron & 1) << 23) | ((calAmplitude & 0x3f)<<24) | ((enableCal & 1) << 30) | - ((m_samplingRate==20?0:1)<<31); + ((m_samplingRate==20?0u:1u)<<31); cscRdoCollection->set_eventType( eventType ); diff --git a/MuonSpectrometer/MuonCnv/MuonCSC_CnvTools/src/CscRODReadOut.cxx b/MuonSpectrometer/MuonCnv/MuonCSC_CnvTools/src/CscRODReadOut.cxx index 3f4415bb193ceb4420446515273a756ae34b02c7..0e68539d0e18f471e3fb89b33539e27d55fe3c49 100644 --- a/MuonSpectrometer/MuonCnv/MuonCSC_CnvTools/src/CscRODReadOut.cxx +++ b/MuonSpectrometer/MuonCnv/MuonCSC_CnvTools/src/CscRODReadOut.cxx @@ -70,7 +70,7 @@ CscRODReadOut::CscRODReadOut(double startTime, uint16_t samplingTime, } -void CscRODReadOut::encodeFragments(const std::vector<uint16_t> amplitude, +void CscRODReadOut::encodeFragments(const std::vector<uint16_t>& amplitude, std::vector<uint32_t>& v) const { int numberOfFragments = amplitude.size(); diff --git a/MuonSpectrometer/MuonCnv/MuonCSC_CnvTools/src/CscRODReadOut.h b/MuonSpectrometer/MuonCnv/MuonCSC_CnvTools/src/CscRODReadOut.h index efebb1b38ab14b5f836e61aa4fd774dbc8986feb..5f5a603aae594179e69122beb584bbacb15d6864 100644 --- a/MuonSpectrometer/MuonCnv/MuonCSC_CnvTools/src/CscRODReadOut.h +++ b/MuonSpectrometer/MuonCnv/MuonCSC_CnvTools/src/CscRODReadOut.h @@ -52,7 +52,7 @@ public: // encoding uint32_t getSourceID(uint16_t side, uint16_t rodId); - void encodeFragments(const std::vector<uint16_t> amplitude, + void encodeFragments(const std::vector<uint16_t>& amplitude, std::vector<uint32_t>& v) const; // initialize helper diff --git a/MuonSpectrometer/MuonCnv/MuonCSC_CnvTools/src/CscRODReadOutV1.cxx b/MuonSpectrometer/MuonCnv/MuonCSC_CnvTools/src/CscRODReadOutV1.cxx index 8565ff75e77a0b7b6b9ec36c694bbffa5ce161ff..9e5f46ca4d83e6c96696be85ab1ddfa8283c9d0d 100644 --- a/MuonSpectrometer/MuonCnv/MuonCSC_CnvTools/src/CscRODReadOutV1.cxx +++ b/MuonSpectrometer/MuonCnv/MuonCSC_CnvTools/src/CscRODReadOutV1.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ #include "CscRODReadOutV1.h" @@ -74,7 +74,7 @@ CscRODReadOutV1::CscRODReadOutV1(double startTime, uint16_t samplingTime, CscRODReadOutV1::~CscRODReadOutV1() {} -void CscRODReadOutV1::encodeFragments(const std::vector<uint16_t> amplitude, +void CscRODReadOutV1::encodeFragments(const std::vector<uint16_t>& amplitude, std::vector<uint32_t>& v) const { int numberOfFragments = amplitude.size(); diff --git a/MuonSpectrometer/MuonCnv/MuonCSC_CnvTools/src/CscRODReadOutV1.h b/MuonSpectrometer/MuonCnv/MuonCSC_CnvTools/src/CscRODReadOutV1.h index 1c306d1cb7125432d4656d7fbc36fa54e749bc30..fabc685f8e8984702de083daf6a9c3fd7c74dd0d 100644 --- a/MuonSpectrometer/MuonCnv/MuonCSC_CnvTools/src/CscRODReadOutV1.h +++ b/MuonSpectrometer/MuonCnv/MuonCSC_CnvTools/src/CscRODReadOutV1.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ #ifndef MUONCSC_CNVTOOL_CSCRODREADOUTV1_H @@ -50,7 +50,7 @@ public: // encoding uint32_t getSourceID(uint16_t side, uint16_t rodId); - void encodeFragments(const std::vector<uint16_t> amplitude, + void encodeFragments(const std::vector<uint16_t>& amplitude, std::vector<uint32_t>& v) const; // initialize helper diff --git a/MuonSpectrometer/MuonCnv/MuonCSC_CnvTools/src/CscROD_Encoder.cxx b/MuonSpectrometer/MuonCnv/MuonCSC_CnvTools/src/CscROD_Encoder.cxx index 0b7ab38f01bd657227c7dda06159c95287da8b82..922359b9fc1e02aed5f4783cf3eef3b624897b97 100644 --- a/MuonSpectrometer/MuonCnv/MuonCSC_CnvTools/src/CscROD_Encoder.cxx +++ b/MuonSpectrometer/MuonCnv/MuonCSC_CnvTools/src/CscROD_Encoder.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ // Implementation of CscROD_Encoder class @@ -73,16 +73,13 @@ StatusCode CscROD_Encoder::fillROD(std::vector<uint32_t>& v, MsgStream& mLog) uint8_t firstBitSummary = m_cscRdo->firstBitSummary(); /** encode strip data fragments :: ROD body */ - std::map<uint16_t,rpu>::iterator rpuBegin = mapRPU.begin(); - std::map<uint16_t,rpu>::iterator rpuEnd = mapRPU.end(); - mLog << MSG::DEBUG << "Number of RPU in this ROD = " << mapRPU.size() << endmsg; unsigned int rpuIndex = 0; - for (; rpuBegin != rpuEnd; rpuBegin++) { + for (std::pair<const uint16_t, rpu>& rpuPair : mapRPU) { /** this RPU identifier */ - uint16_t rpuID = (*rpuBegin).first; + uint16_t rpuID = rpuPair.first; mLog << MSG::DEBUG << "CscROD_Encoder : RPU id " << rpuID << endmsg; /** RPU size from simulation - assume no ghost words: @@ -96,12 +93,10 @@ StatusCode CscROD_Encoder::fillROD(std::vector<uint32_t>& v, MsgStream& mLog) where one sample = 12-bit ADC. The 2 words at the start of the cluster describe the cluster size and location. The %2 accounts for the old number of samples */ uint32_t spuSize[] = {0, 0, 0, 0, 0}; - std::vector<const CscRawData*>::const_iterator it = (*rpuBegin).second.begin(); - std::vector<const CscRawData*>::const_iterator it_end = (*rpuBegin).second.end(); uint16_t numberOfDataWords = 0; uint32_t sampleDataWords = 0; - for (; it != it_end; ++it) { - uint16_t spuID = (*it)->rpuID(); + for (const CscRawData* rawData : rpuPair.second) { + uint16_t spuID = rawData->rpuID(); mLog << MSG::DEBUG << "CscROD_Encoder : The SPU ID " << spuID << endmsg; unsigned int i = 0x800; if ( spuID < 4 ) i=spuID; @@ -111,7 +106,7 @@ StatusCode CscROD_Encoder::fillROD(std::vector<uint32_t>& v, MsgStream& mLog) mLog << MSG::ERROR << "CscROD_Encoder : SPU ID out of range - " << spuID << " Stop and fix it " << endmsg; } else { mLog << MSG::DEBUG << "CscROD_Encoder : SPU ID and Index = " << spuID << " " << i << endmsg; - uint16_t size = ((*it)->samples()).size(); + uint16_t size = (rawData->samples()).size(); uint16_t unitSize = size/2 + size%2; spuSize[i] += 1; numberOfDataWords += 2 + unitSize; @@ -174,16 +169,11 @@ StatusCode CscROD_Encoder::fillROD(std::vector<uint32_t>& v, MsgStream& mLog) (0xFF & spuSize[4] ) << 24; v.push_back( secondClusterWord ); - /** reset the iterators */ - it = (*rpuBegin).second.begin(); - it_end = (*rpuBegin).second.end(); - /** strip addresses and ADC samples - the first 2 words contain the address and the width+time+timeFlag, following the ADC samplings */ unsigned int check = 0; - for (; it != it_end; ++it) { + for (const CscRawData* rawData : rpuPair.second) { - const CscRawData * rawData = (*it); uint32_t address = rawData->address(); uint16_t time = rawData->time(); uint16_t width = rawData->width(); diff --git a/MuonSpectrometer/MuonCnv/MuonMDT_CnvTools/src/MDT_RawDataProviderTool.h b/MuonSpectrometer/MuonCnv/MuonMDT_CnvTools/src/MDT_RawDataProviderTool.h index ee6302337ed2a36e4ed501164237ea1c6c6ae19f..a23afd654652b521bfa439f3ffe934e116e4cf0b 100644 --- a/MuonSpectrometer/MuonCnv/MuonMDT_CnvTools/src/MDT_RawDataProviderTool.h +++ b/MuonSpectrometer/MuonCnv/MuonMDT_CnvTools/src/MDT_RawDataProviderTool.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ #ifndef MUONMDTCNVTOOLS_MUONMDTRAWDATAPROVIDERTOOL_H @@ -39,7 +39,7 @@ class ATLAS_NOT_THREAD_SAFE MDT_RawDataProviderTool : virtual public IMuonRawDat virtual StatusCode finalize (); /** Convert method - declared in Muon::IMuonRdoToPrepDataTool*/ - virtual StatusCode convert( const std::vector<const OFFLINE_FRAGMENTS_NAMESPACE::ROBFragment*>& vecRobs); + virtual StatusCode convert ATLAS_NOT_THREAD_SAFE ( const std::vector<const OFFLINE_FRAGMENTS_NAMESPACE::ROBFragment*>& vecRobs); virtual StatusCode convert( const std::vector<const OFFLINE_FRAGMENTS_NAMESPACE::ROBFragment*>& vecRobs, const std::vector<IdentifierHash>&); /** the new ones */ virtual StatusCode convert(); //!< for the entire event diff --git a/MuonSpectrometer/MuonCnv/MuonMDT_CnvTools/src/MDT_RawDataProviderToolCore.cxx b/MuonSpectrometer/MuonCnv/MuonMDT_CnvTools/src/MDT_RawDataProviderToolCore.cxx index 68f35f99e780c6858d08f6a1c2bd9be3370b1c6f..f9161b42b6d4ab2dd4d4f50a0d9fe213c832b45c 100644 --- a/MuonSpectrometer/MuonCnv/MuonMDT_CnvTools/src/MDT_RawDataProviderToolCore.cxx +++ b/MuonSpectrometer/MuonCnv/MuonMDT_CnvTools/src/MDT_RawDataProviderToolCore.cxx @@ -48,17 +48,15 @@ StatusCode Muon::MDT_RawDataProviderToolCore::convertIntoContainer( const std::v { ATH_MSG_VERBOSE("convert(): " << vecRobs.size()<<" ROBFragments."); - std::vector<const OFFLINE_FRAGMENTS_NAMESPACE::ROBFragment*>::const_iterator itFrag; - - for (itFrag = vecRobs.begin(); itFrag != vecRobs.end(); itFrag++) + for (const OFFLINE_FRAGMENTS_NAMESPACE::ROBFragment* frag : vecRobs) { //convert only if data payload is delivered - if ( (**itFrag).rod_ndata()!=0 ) + if ( frag->rod_ndata()!=0 ) { //std::vector<IdentifierHash> coll = - // to_be_converted(**itFrag,collections); + // to_be_converted(*frag,collections); - if (m_decoder->fillCollections(**itFrag, mdtContainer).isFailure()) + if (m_decoder->fillCollections(*frag, mdtContainer).isFailure()) { // store the error conditions into the StatusCode and continue } @@ -67,7 +65,7 @@ StatusCode Muon::MDT_RawDataProviderToolCore::convertIntoContainer( const std::v { if(msgLvl(MSG::DEBUG)) { - uint32_t sourceId= (**itFrag).source_id(); + uint32_t sourceId= frag->source_id(); msg(MSG::DEBUG) << " ROB " << MSG::hex << sourceId << " is delivered with an empty payload" << MSG::dec; } diff --git a/MuonSpectrometer/MuonCnv/MuonMDT_CnvTools/src/MdtRdoToPrepDataTool.cxx b/MuonSpectrometer/MuonCnv/MuonMDT_CnvTools/src/MdtRdoToPrepDataTool.cxx index 1c11ae58838e5bd6ec8088a563610350ad2a6800..0506b43b1a26af45529ddc09188a0fc425e6e298 100644 --- a/MuonSpectrometer/MuonCnv/MuonMDT_CnvTools/src/MdtRdoToPrepDataTool.cxx +++ b/MuonSpectrometer/MuonCnv/MuonMDT_CnvTools/src/MdtRdoToPrepDataTool.cxx @@ -21,7 +21,7 @@ StatusCode Muon::MdtRdoToPrepDataTool::initialize() return StatusCode::SUCCESS; } -Muon::MdtRdoToPrepDataTool::SetupMdtPrepDataContainerStatus Muon::MdtRdoToPrepDataTool::setupMdtPrepDataContainer ATLAS_NOT_THREAD_SAFE() +Muon::MdtRdoToPrepDataTool::SetupMdtPrepDataContainerStatus Muon::MdtRdoToPrepDataTool::setupMdtPrepDataContainer() { if(!evtStore()->contains<Muon::MdtPrepDataContainer>(m_mdtPrepDataContainerKey.key())){ m_fullEventDone=false; diff --git a/MuonSpectrometer/MuonCnv/MuonMDT_CnvTools/src/MdtRdoToPrepDataTool.h b/MuonSpectrometer/MuonCnv/MuonMDT_CnvTools/src/MdtRdoToPrepDataTool.h index 1ea69192d30d15b768039d8daf7a2c2822630e1c..9b0a3fc60de81f8add488c9d773095432c582348 100644 --- a/MuonSpectrometer/MuonCnv/MuonMDT_CnvTools/src/MdtRdoToPrepDataTool.h +++ b/MuonSpectrometer/MuonCnv/MuonMDT_CnvTools/src/MdtRdoToPrepDataTool.h @@ -6,6 +6,7 @@ #define MUONMdtRdoToPrepDataTool_H #include "MdtRdoToPrepDataToolCore.h" +#include "CxxUtils/checker_macros.h" namespace Muon { @@ -21,7 +22,7 @@ namespace Muon @author Edward Moyse <Edward.Moyse@cern.ch> */ - class MdtRdoToPrepDataTool : virtual public MdtRdoToPrepDataToolCore + class ATLAS_NOT_THREAD_SAFE MdtRdoToPrepDataTool : virtual public MdtRdoToPrepDataToolCore { public: MdtRdoToPrepDataTool(const std::string&,const std::string&,const IInterface*); diff --git a/MuonSpectrometer/MuonCnv/MuonMDT_CnvTools/src/MdtRdoToPrepDataToolCore.cxx b/MuonSpectrometer/MuonCnv/MuonMDT_CnvTools/src/MdtRdoToPrepDataToolCore.cxx index fd346bf9618ddc1ae960f21772a72fbb94cd5810..1d432258d6acb65fd0de6704f4a59165bbc20aa3 100644 --- a/MuonSpectrometer/MuonCnv/MuonMDT_CnvTools/src/MdtRdoToPrepDataToolCore.cxx +++ b/MuonSpectrometer/MuonCnv/MuonMDT_CnvTools/src/MdtRdoToPrepDataToolCore.cxx @@ -404,13 +404,12 @@ void Muon::MdtRdoToPrepDataToolCore::printPrepData( ) if ( mdtColl->size() > 0 ) { ATH_MSG_DEBUG("PrepData Collection ID "<<m_idHelperSvc->toString(mdtColl->identify())); - MdtPrepDataCollection::const_iterator it_mdtPrepData; - for (it_mdtPrepData=mdtColl->begin(); it_mdtPrepData != mdtColl->end(); it_mdtPrepData++) { + for (const MdtPrepData* prepData : *mdtColl) { nhitcoll++; nhits++; ATH_MSG_DEBUG(" in this coll. "<<nhitcoll<<" prepData id = " - <<m_idHelperSvc->toString((*it_mdtPrepData)->identify()) - <<" tdc/adc ="<<(*it_mdtPrepData)->tdc()<<"/"<< (*it_mdtPrepData)->adc()); + <<m_idHelperSvc->toString(prepData->identify()) + <<" tdc/adc ="<<prepData->tdc()<<"/"<< prepData->adc()); } ncoll++; ATH_MSG_DEBUG("*** Collection "<<ncoll<<" Summary: N. hits = "<<nhitcoll); @@ -552,7 +551,7 @@ StatusCode Muon::MdtRdoToPrepDataToolCore::processCsm(const MdtCsm* rdoColl, std ATH_MSG_WARNING("Found issue MDT RDO decoder for subdetId/mrodId/csmId " <<subdetId<<"/"<<mrodId<<"/"<<csmId<<" amtHit channelId/tdcId =" <<amtHit->channelId()<<"/"<<amtHit->tdcId()); - itD++; + ++itD; continue; } @@ -565,7 +564,7 @@ StatusCode Muon::MdtRdoToPrepDataToolCore::processCsm(const MdtCsm* rdoColl, std if( std::find( (myIt->second).begin(), (myIt->second).end(), channelId) != (myIt->second).end() ) { ATH_MSG_DEBUG("processCsm : Deleting BMG digit with identifier" << m_idHelperSvc->mdtIdHelper().show_to_string(channelId) ); delete newDigit; - itD++; + ++itD; continue; } } @@ -637,7 +636,7 @@ StatusCode Muon::MdtRdoToPrepDataToolCore::processCsm(const MdtCsm* rdoColl, std ATH_MSG_WARNING("Detector Element not found for Identifier from the cabling service <" <<m_idHelperSvc->toString(channelId)<<"> =>>ignore this hit"); delete newDigit; - itD++; + ++itD; continue; } if (!descriptor->containsId(channelId)) { @@ -645,7 +644,7 @@ StatusCode Muon::MdtRdoToPrepDataToolCore::processCsm(const MdtCsm* rdoColl, std <<" does not contains candidate prd Identifier <" <<m_idHelperSvc->toString(channelId)<<"> =>>ignore this hit"); delete newDigit; - itD++; + ++itD; continue; } @@ -893,15 +892,12 @@ StatusCode Muon::MdtRdoToPrepDataToolCore::processCsmTwin(const MdtCsm* rdoColl, } }// end for-loop over rdoColl - // make iterator over mdtDigitColl map - std::map<int, std::pair<MdtDigit*, MdtDigit*> >::iterator iter_map; - //iterate over mdtDigitColl - for( iter_map = mdtDigitColl.begin(); iter_map != mdtDigitColl.end(); iter_map++ ) { + for (const std::pair<const int, std::pair<MdtDigit*, MdtDigit*> >& digitPair : mdtDigitColl) { // get the twin hits from mdtDigitColl - MdtDigit* digit = iter_map->second.first; - MdtDigit* second_digit = iter_map->second.second; + MdtDigit* digit = digitPair.second.first; + MdtDigit* second_digit = digitPair.second.second; if (!digit) { ATH_MSG_FATAL("nullptr to a digit "); diff --git a/MuonSpectrometer/MuonCnv/MuonTGC_CnvTools/src/TgcRdoToPrepDataTool.cxx b/MuonSpectrometer/MuonCnv/MuonTGC_CnvTools/src/TgcRdoToPrepDataTool.cxx index 864fe64509875f83897ed3a6e1bce8abbd092ad0..f932c97545ee76a48b1bf4b81c764a30b370d6b1 100644 --- a/MuonSpectrometer/MuonCnv/MuonTGC_CnvTools/src/TgcRdoToPrepDataTool.cxx +++ b/MuonSpectrometer/MuonCnv/MuonTGC_CnvTools/src/TgcRdoToPrepDataTool.cxx @@ -199,7 +199,19 @@ StatusCode Muon::TgcRdoToPrepDataTool::decode(std::vector<IdentifierHash>& reque TgcRdo::const_iterator itD = (*iRdo)->begin(); TgcRdo::const_iterator itD_e = (*iRdo)->end(); for(; itD!=itD_e; itD++) { - selectDecoder(itD, (*iRdo)); + //Since OnlineIds are not unique, need some additional filtering on offline hashId + //to avoid decoding RDO outside of an RoI + Identifier offlineId; + IdentifierHash tgcHashId; + IdContext tgcContext = m_idHelperSvc->tgcIdHelper().module_context(); + + if(m_tgcCabling->getElementIDfromReadoutID(offlineId, (*itD)->subDetectorId(), (*itD)->rodId(), (*itD)->sswId(), (*itD)->slbId(), (*itD)->bitpos())){ + if(m_idHelperSvc->tgcIdHelper().get_hash(offlineId, tgcHashId, &tgcContext)){ + if(std::find(requestedIdHashVect.begin(), requestedIdHashVect.end(), tgcHashId) != requestedIdHashVect.end()){ + selectDecoder(itD, (*iRdo)); + } + } + } } m_decodedRdoCollVec.push_back(*iRdo); } diff --git a/MuonSpectrometer/MuonCnv/MuonTGC_CnvTools/src/TgcRdoToPrepDataToolMT.cxx b/MuonSpectrometer/MuonCnv/MuonTGC_CnvTools/src/TgcRdoToPrepDataToolMT.cxx index b36db087959922e7080f1f1217bf688bf04cdffc..cc5156af280a2f6cfb8f3bc9d35f7e3357c2801b 100644 --- a/MuonSpectrometer/MuonCnv/MuonTGC_CnvTools/src/TgcRdoToPrepDataToolMT.cxx +++ b/MuonSpectrometer/MuonCnv/MuonTGC_CnvTools/src/TgcRdoToPrepDataToolMT.cxx @@ -161,7 +161,19 @@ StatusCode Muon::TgcRdoToPrepDataToolMT::decode(std::vector<IdentifierHash>& req TgcRdo::const_iterator itD = (*iRdo)->begin(); TgcRdo::const_iterator itD_e = (*iRdo)->end(); for(; itD!=itD_e; itD++) { - selectDecoder(itD, (*iRdo)); + //Since OnlineIds are not unique, need some additional filtering on offline hashId + //to avoid decoding RDO outside of an RoI + Identifier offlineId; + IdentifierHash tgcHashId; + IdContext tgcContext = m_idHelperSvc->tgcIdHelper().module_context(); + + if(m_tgcCabling->getElementIDfromReadoutID(offlineId, (*itD)->subDetectorId(), (*itD)->rodId(), (*itD)->sswId(), (*itD)->slbId(), (*itD)->bitpos())){ + if(m_idHelperSvc->tgcIdHelper().get_hash(offlineId, tgcHashId, &tgcContext)){ + if(std::find(requestedIdHashVect.begin(), requestedIdHashVect.end(), tgcHashId) != requestedIdHashVect.end()){ + selectDecoder(itD, (*iRdo)); + } + } + } } m_decodedRdoCollVec.push_back(*iRdo); } diff --git a/MuonSpectrometer/MuonDetDescr/MuonAGDD/share/NSWAGDD_BlobProduction.py b/MuonSpectrometer/MuonDetDescr/MuonAGDD/share/NSWAGDD_BlobProduction.py index fe429325a2c26880c1ed9cd790f8870bbec2bcf0..3b525ada886af0f7e7919092b5efc40622b9e42b 100644 --- a/MuonSpectrometer/MuonDetDescr/MuonAGDD/share/NSWAGDD_BlobProduction.py +++ b/MuonSpectrometer/MuonDetDescr/MuonAGDD/share/NSWAGDD_BlobProduction.py @@ -1,11 +1,23 @@ # Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration +try: + if muonLayout: + from GeoModelSvc.GeoModelSvcConf import GeoModelSvc + GeoModelSvc = GeoModelSvc() + GeoModelSvc.MuonVersionOverride=muonLayout +except NameError: + pass + from MuonAGDD.MuonAGDDConfig import NSWAGDDTool NSWAGDDDumper = NSWAGDDTool(name="NSWAGDDDumper") NSWAGDDDumper.WriteAGDDFile=True # creates Out.AmdcOracle.AM.AGDDtemp.data and Out.AmdcOracle.AM.AGDD.PREsql NSWAGDDDumper.Locked=False -NSWAGDDDumper.ReadAGDD=False # turn off reading from data base (true means read from DB) -NSWAGDDDumper.XMLFiles=[input_nsw_xml] +try: + if input_nsw_xml: + NSWAGDDDumper.ReadAGDD = False # turn off reading from data base (true means read from DB) + NSWAGDDDumper.XMLFiles=[input_nsw_xml] +except NameError: + pass NSWAGDDDumper.Volumes=["NewSmallWheel"] # for the NSWAGDDTool volumes must always be given ("NewSmallWheel" usually includes everything) NSWAGDDDumper.DefaultDetector="Muon" diff --git a/MuonSpectrometer/MuonDetDescr/MuonAGDDDescription/MuonAGDDDescription/MMDetectorHelper.h b/MuonSpectrometer/MuonDetDescr/MuonAGDDDescription/MuonAGDDDescription/MMDetectorHelper.h index 64a6f043540cad7cef70f15cda164252c21a7a65..28eea16397456e1e1dc9f26a2452f085379e0102 100644 --- a/MuonSpectrometer/MuonDetDescr/MuonAGDDDescription/MuonAGDDDescription/MMDetectorHelper.h +++ b/MuonSpectrometer/MuonDetDescr/MuonAGDDDescription/MuonAGDDDescription/MMDetectorHelper.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ #ifndef MMDetectorHelper_H @@ -12,6 +12,7 @@ class MMDetectorDescription; class AGDDDetectorPositioner; typedef std::map<std::string,MMDetectorDescription*> MicromegasMap; +typedef std::map<std::string,MMDetectorDescription*> MicromegasMapSubType; typedef std::map<std::string,MMDetectorDescription*>::const_iterator MicromegasIterator; typedef std::pair<MMDetectorDescription*,AGDDDetectorPositioner*> AGDDPositionedDetector; @@ -22,12 +23,14 @@ public: MicromegasIterator MM_begin() {return m_MicromegasList.begin();} MicromegasIterator MM_end() {return m_MicromegasList.end();} - MMDetectorDescription* Get_MMDetectorType(std::string type); + MMDetectorDescription* Get_MMDetectorType(const std::string& type); + MMDetectorDescription* Get_MMDetectorSubType(const std::string& type); MMDetectorDescription* Get_MMDetector(char type,int ieta,int iphi,int layer=1,char side='A'); AGDDPositionedDetector Get_MMPositionedDetector(char type,int ieta,int iphi,int layer=1,char side='A'); private: MicromegasMap m_MicromegasList; + MicromegasMapSubType m_MicromegasListSubType; }; diff --git a/MuonSpectrometer/MuonDetDescr/MuonAGDDDescription/MuonAGDDDescription/sTGCDetectorHelper.h b/MuonSpectrometer/MuonDetDescr/MuonAGDDDescription/MuonAGDDDescription/sTGCDetectorHelper.h index af50614a8a56c5f9789d1deafad6e971e15fcc12..e03fb9b9e304d951b994740ad2301dffd84e2006 100644 --- a/MuonSpectrometer/MuonDetDescr/MuonAGDDDescription/MuonAGDDDescription/sTGCDetectorHelper.h +++ b/MuonSpectrometer/MuonDetDescr/MuonAGDDDescription/MuonAGDDDescription/sTGCDetectorHelper.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ #ifndef sTGCDetectorHelper_H @@ -12,6 +12,7 @@ class sTGCDetectorDescription; class AGDDDetectorPositioner; typedef std::map<std::string,sTGCDetectorDescription*> sTGCMap; +typedef std::map<std::string,sTGCDetectorDescription*> sTGCMapSubType; typedef std::map<std::string,sTGCDetectorDescription*>::const_iterator sTGCIterator; typedef std::pair<sTGCDetectorDescription*,AGDDDetectorPositioner*> AGDDPositionedDetector; @@ -23,11 +24,13 @@ public: sTGCIterator sTGC_end() {return m_sTGCList.end();} sTGCDetectorDescription* Get_sTGCDetector(char type,int ieta,int iphi,int layer=1,char side='A'); - sTGCDetectorDescription* Get_sTGCDetectorType(std::string type); + sTGCDetectorDescription* Get_sTGCDetectorType(const std::string& type); + sTGCDetectorDescription* Get_sTGCDetectorSubType(const std::string& type); AGDDPositionedDetector Get_sTGCPositionedDetector(char type,int ieta,int iphi,int layer=1,char side='A'); private: sTGCMap m_sTGCList; + sTGCMapSubType m_sTGCListSubType; }; diff --git a/MuonSpectrometer/MuonDetDescr/MuonAGDDDescription/src/MMDetectorHelper.cxx b/MuonSpectrometer/MuonDetDescr/MuonAGDDDescription/src/MMDetectorHelper.cxx index 83da1fede83f0f864824b16867b93f7af023a894..3596e70d6ad691c801320dc86436fc413e2ee3b8 100644 --- a/MuonSpectrometer/MuonDetDescr/MuonAGDDDescription/src/MMDetectorHelper.cxx +++ b/MuonSpectrometer/MuonDetDescr/MuonAGDDDescription/src/MMDetectorHelper.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ #include "MuonAGDDDescription/MMDetectorHelper.h" @@ -18,8 +18,10 @@ MMDetectorHelper::MMDetectorHelper() for ( auto vl_iter: vl) { MMDetectorDescription* st=dynamic_cast<MMDetectorDescription*>(vl_iter.second); - if (st) + if (st) { m_MicromegasList[vl_iter.first]=st; + m_MicromegasListSubType[vl_iter.second->subType()]=st; + } } } @@ -96,8 +98,15 @@ AGDDPositionedDetector MMDetectorHelper::Get_MMPositionedDetector(char type,int return p_mm; } -MMDetectorDescription* MMDetectorHelper::Get_MMDetectorType(std::string type) +MMDetectorDescription* MMDetectorHelper::Get_MMDetectorType(const std::string& type) { if (m_MicromegasList.find(type) != m_MicromegasList.end()) return m_MicromegasList[type]; return nullptr; } + +MMDetectorDescription* MMDetectorHelper::Get_MMDetectorSubType(const std::string& type) +{ + if (m_MicromegasListSubType.find(type) != m_MicromegasListSubType.end()) return m_MicromegasListSubType[type]; + return nullptr; +} + diff --git a/MuonSpectrometer/MuonDetDescr/MuonAGDDDescription/src/sTGCDetectorHelper.cxx b/MuonSpectrometer/MuonDetDescr/MuonAGDDDescription/src/sTGCDetectorHelper.cxx index 6be96f08d3f06841a1edb1e0cb8999a7d8d50f42..5e51b3499bce8a0ff527823d236a44a4c3426510 100644 --- a/MuonSpectrometer/MuonDetDescr/MuonAGDDDescription/src/sTGCDetectorHelper.cxx +++ b/MuonSpectrometer/MuonDetDescr/MuonAGDDDescription/src/sTGCDetectorHelper.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ #include "MuonAGDDDescription/sTGCDetectorHelper.h" @@ -18,9 +18,10 @@ sTGCDetectorHelper::sTGCDetectorHelper() for ( auto vl_iter: vl) { sTGCDetectorDescription* st=dynamic_cast<sTGCDetectorDescription*>(vl_iter.second); - //AGDDMicromegas* st1=dynamic_cast<AGDDMicromegas*>(st); - if (st) + if (st) { m_sTGCList[vl_iter.first]=st; + m_sTGCListSubType[vl_iter.second->subType()]=st; + } } } @@ -97,8 +98,15 @@ AGDDPositionedDetector sTGCDetectorHelper::Get_sTGCPositionedDetector(char type, return p_sTGC; } -sTGCDetectorDescription* sTGCDetectorHelper::Get_sTGCDetectorType(std::string type) +sTGCDetectorDescription* sTGCDetectorHelper::Get_sTGCDetectorType(const std::string& type) { if (m_sTGCList.find(type) != m_sTGCList.end()) return m_sTGCList[type]; return nullptr; } + +sTGCDetectorDescription* sTGCDetectorHelper::Get_sTGCDetectorSubType(const std::string& type) +{ + if (m_sTGCListSubType.find(type) != m_sTGCListSubType.end()) return m_sTGCListSubType[type]; + return nullptr; +} + diff --git a/MuonSpectrometer/MuonDetDescr/MuonReadoutGeometry/MuonReadoutGeometry/MMReadoutElement.h b/MuonSpectrometer/MuonDetDescr/MuonReadoutGeometry/MuonReadoutGeometry/MMReadoutElement.h index 90f2f19df3ae02864a15283ae4fb8c3ba829e892..3f33043c2b9bd88062782344fe98610c43b8d8f8 100644 --- a/MuonSpectrometer/MuonDetDescr/MuonReadoutGeometry/MuonReadoutGeometry/MMReadoutElement.h +++ b/MuonSpectrometer/MuonDetDescr/MuonReadoutGeometry/MuonReadoutGeometry/MMReadoutElement.h @@ -138,6 +138,7 @@ namespace MuonGM { double m_halfX; // 0.5*radial_size double m_minHalfY; // 0.5*bottom length (active area) double m_maxHalfY; // 0.5*top length (active area) + double m_offset; double m_rots; double m_rotz; diff --git a/MuonSpectrometer/MuonDetDescr/MuonReadoutGeometry/MuonReadoutGeometry/MuonChannelDesign.h b/MuonSpectrometer/MuonDetDescr/MuonReadoutGeometry/MuonReadoutGeometry/MuonChannelDesign.h index a64d221ae21739e5c3b96d5200198870ac90bd57..d611d4f9f0722d46029071ef4c2b2e576fa20979 100644 --- a/MuonSpectrometer/MuonDetDescr/MuonReadoutGeometry/MuonReadoutGeometry/MuonChannelDesign.h +++ b/MuonSpectrometer/MuonDetDescr/MuonReadoutGeometry/MuonReadoutGeometry/MuonChannelDesign.h @@ -38,7 +38,6 @@ namespace MuonGM { double deadO; //this param is not used for MM double deadS; //this param is not used for MM double signY; - //Amg::Vector2D firstChannelPos; double firstPos; //the position of the first active strip double firstPitch; // Pitch of 1st strip or number of wires in 1st group double groupWidth; // Number of Wires per group @@ -64,9 +63,6 @@ namespace MuonGM { double dlStereoTop; // length between the first eta and stereo double dlStereoBottom; int totalStrips; //total strips per MM module - - /** channel transform */ - //HepGeom::Transform3D channelTransform( int channel ) const; /** distance to readout */ double distanceToReadout( const Amg::Vector2D& pos ) const; @@ -100,7 +96,7 @@ namespace MuonGM { int chNum = channelNumber( pos ); - if (chNum <0 ) return -1.; + if (chNum <1 ) return -1.; Amg::Vector2D chPos; if (!channelPosition( chNum, chPos) ) return -1.; @@ -123,7 +119,7 @@ namespace MuonGM { // if channel number is out of bounds, get the nearest channel ( mostly for validation purposes ) bool validMode = false; if (type==MuonChannelDesign::etaStrip && detType==MuonChannelDesign::DetType::MM) { - if( chNum < 0 || chNum > totalStrips ){ + if( chNum < 1 || chNum > totalStrips ){ chNum = channelNumber(pos); validMode = true; } @@ -396,7 +392,7 @@ namespace MuonGM { else if (detType==MuonChannelDesign::DetType::MM) { - if( (st >= nMissedBottomEta) || (st < (totalStrips-nMissedTopEta))){ + if( (st > nMissedBottomEta) || (st < (totalStrips-nMissedTopEta))){ stLen = inputLength + 2*(0.5*(maxYSize-minYSize)*(st-nMissedBottomEta)*inputPitch/xSize); return stLen; @@ -415,16 +411,16 @@ namespace MuonGM { - if( st >= nMissedBottomStereo && st < (nMissedBottomStereo+nRoutedBottom) ) + if( st > nMissedBottomStereo && st < (nMissedBottomStereo+nRoutedBottom) ) stLen = (minYPhiR + (st-nMissedBottomStereo)*inputPitch)/sin(sAngle); - if(st >= (nMissedBottomStereo+nRoutedBottom) ) + if(st > (nMissedBottomStereo+nRoutedBottom) ) stLen = (inputLength + 2*(0.5*(maxYSize-minYSize)*(st-nMissedBottomEta)*inputPitch/xSize) )/cos(sAngle); return stLen; } //length for routed strips is not defined - else if(st>=(totalStrips-(nMissedTopStereo+nRoutedTop)) && st < (totalStrips-nMissedTopStereo)) + else if(st>(totalStrips-(nMissedTopStereo+nRoutedTop)) && st < (totalStrips-nMissedTopStereo)) { stLen = ( maxYPhi + (totalStrips-nMissedTopStereo-(st+1))*inputPitch)/sin(sAngle); return stLen; diff --git a/MuonSpectrometer/MuonDetDescr/MuonReadoutGeometry/MuonReadoutGeometry/sTgcReadoutElement.h b/MuonSpectrometer/MuonDetDescr/MuonReadoutGeometry/MuonReadoutGeometry/sTgcReadoutElement.h index 12e869bd182564926bc47e9ef66f2d66689fb106..f1dfc00daa68171bcfe03787e5dfe0a8757308c1 100644 --- a/MuonSpectrometer/MuonDetDescr/MuonReadoutGeometry/MuonReadoutGeometry/sTgcReadoutElement.h +++ b/MuonSpectrometer/MuonDetDescr/MuonReadoutGeometry/MuonReadoutGeometry/sTgcReadoutElement.h @@ -62,6 +62,8 @@ namespace MuonGM { If the strip number is outside the range of valid strips, the function will return false */ virtual bool stripPosition( const Identifier& id, Amg::Vector2D& pos ) const override; + bool stripGlobalPosition( const Identifier& id, Amg::Vector3D& gpos ) const; + /** pad number corresponding to local position */ int padNumber( const Amg::Vector2D& pos, const Identifier& id) const; @@ -164,6 +166,7 @@ namespace MuonGM { int m_nlayers; int m_ml; + double m_offset; int m_sTGC_type; @@ -221,14 +224,9 @@ namespace MuonGM { } inline int sTgcReadoutElement::layerHash( const Identifier& id ) const { - //return layerHash(manager()->stgcIdHelper()->gasGap(id)); return surfaceHash(id); // don't have a choice here : rewrite MuonClusterReadoutElement first } - //inline int sTgcReadoutElement::layerHash( int gasGap ) const { - // return gasGap-1; - //} - inline int sTgcReadoutElement::boundaryHash( const Identifier& id ) const { int iphi = manager()->stgcIdHelper()->channelType(id)!=1 ? 1:0 ; // wires and pads have locX oriented along phi if (std::abs(getStationEta())<3) iphi += 2*(manager()->stgcIdHelper()->gasGap(id)-1); @@ -293,6 +291,13 @@ namespace MuonGM { } + inline bool sTgcReadoutElement::stripGlobalPosition( const Identifier& id, Amg::Vector3D& gpos ) const { + Amg::Vector2D lpos(0., 0.); + if (!stripPosition(id, lpos)) return false; + surface(id).localToGlobal(lpos, Amg::Vector3D(0., 0., 0.), gpos); + return true; + } + inline bool sTgcReadoutElement::padPosition( const Identifier& id, Amg::Vector2D& pos ) const { const MuonPadDesign* design = getPadDesign(id); diff --git a/MuonSpectrometer/MuonDetDescr/MuonReadoutGeometry/src/MMReadoutElement.cxx b/MuonSpectrometer/MuonDetDescr/MuonReadoutGeometry/src/MMReadoutElement.cxx index 9bc2b1a9c4c478a7e0b6ce4c2e4bea0745bc70af..a715cfbd843ef3ad382d4d4740de2252c686e850 100644 --- a/MuonSpectrometer/MuonDetDescr/MuonReadoutGeometry/src/MMReadoutElement.cxx +++ b/MuonSpectrometer/MuonDetDescr/MuonReadoutGeometry/src/MMReadoutElement.cxx @@ -35,6 +35,7 @@ namespace MuonGM { m_rots = 0.; m_rotz = 0.; m_rott = 0.; + m_offset = 0.; m_hasALines = false; m_hasBLines = false; @@ -168,6 +169,8 @@ namespace MuonGM { MMDetectorDescription* mm = aHelper.Get_MMDetector(sector_l, std::abs(getStationEta()), getStationPhi(), m_ml, side); MMReadoutParameters roParam = mm->GetReadoutParameters(); + double ylFrame = mm->ylFrame(); + double ysFrame = mm->ysFrame(); m_halfX = roParam.activeH/2; //0.5*radial length (active area) m_minHalfY = roParam.activeBottomLength/2; //0.5*bottom length (active area) @@ -199,6 +202,9 @@ namespace MuonGM { m_etaDesign[il].maxYPhi = roParam.maxYPhi; m_etaDesign[il].totalStrips = roParam.tStrips; m_etaDesign[il].sAngle = (roParam.stereoAngle).at(il); + m_etaDesign[il].ylFrame = ylFrame; + m_etaDesign[il].ysFrame = ysFrame; + m_offset = -0.5*(m_etaDesign[il].ylFrame - m_etaDesign[il].ysFrame); if (m_ml < 1 || m_ml > 2) { MsgStream log(Athena::getMessageSvc(),"MMReadoutElement"); log << MSG::WARNING <<"MMReadoutElement -- Unexpected Multilayer: m_ml= " << m_ml <<endmsg; @@ -208,7 +214,7 @@ namespace MuonGM { m_etaDesign[il].firstPos = -0.5*m_etaDesign[il].xSize + pitch; m_etaDesign[il].signY = 1 ; - m_etaDesign[il].nch = ((int) std::round( (m_etaDesign[il].xSize/pitch))) + 1; // Total number of active strips + m_etaDesign[il].nch = ((int) std::round( (m_etaDesign[il].xSize/pitch))); // Total number of active strips } else { // stereo layers @@ -229,7 +235,7 @@ namespace MuonGM { double fPos = -0.5*m_etaDesign[il].xSize - low_swift + lm1_swift; double lPos = 0.5*m_etaDesign[il].xSize + up_swift; - m_etaDesign[il].nch = ((int)std::round( (lPos - fPos)/pitch )) + 1; + m_etaDesign[il].nch = ((int)std::round( (lPos - fPos)/pitch )); m_etaDesign[il].firstPos = ( -0.5*m_etaDesign[il].xSize + (m_etaDesign[il].nMissedBottomStereo - m_etaDesign[il].nMissedBottomEta)*pitch) + pitch; } @@ -263,7 +269,7 @@ namespace MuonGM { // keep the tracking surface at the center of the gap // need to operate switch x<->z because of GeoTrd definition m_surfaceData->m_layerSurfaces.push_back( new Trk::PlaneSurface(*this, id) ); - m_surfaceData->m_layerTransforms.push_back(absTransform()*m_Xlg[layer]* + m_surfaceData->m_layerTransforms.push_back(absTransform()*m_Xlg[layer]*Amg::Translation3D(0.,0.,m_offset)* Amg::AngleAxis3D(-90.*CLHEP::deg,Amg::Vector3D(0.,1.,0.)) ); // surface info (center, normal) @@ -298,8 +304,7 @@ namespace MuonGM { { int gg = manager()->mmIdHelper()->gasGap(id); - // Amg::Vector3D locP = (m_Xlg[gg-1].inverse())*locPos; - Amg::Vector3D locP = (m_Xlg[gg-1])*locPos; + Amg::Vector3D locP = (m_Xlg[gg-1])*Amg::Translation3D(0.,0.,m_offset)*locPos; #ifndef NDEBUG MsgStream log(Athena::getMessageSvc(),"MMReadoutElement"); if (log.level()<=MSG::DEBUG) { diff --git a/MuonSpectrometer/MuonDetDescr/MuonReadoutGeometry/src/sTgcReadoutElement.cxx b/MuonSpectrometer/MuonDetDescr/MuonReadoutGeometry/src/sTgcReadoutElement.cxx index 9eb83dc2a66a5bba90235af0f5258a8c7823c073..c49edf66f2a0138c12b4f47a74781fa7d9ed11eb 100644 --- a/MuonSpectrometer/MuonDetDescr/MuonReadoutGeometry/src/sTgcReadoutElement.cxx +++ b/MuonSpectrometer/MuonDetDescr/MuonReadoutGeometry/src/sTgcReadoutElement.cxx @@ -44,6 +44,7 @@ namespace MuonGM { m_hasALines = false; m_hasBLines = false; m_delta = Amg::Transform3D::Identity(); + m_offset = 0.; m_ml = mL; // get the setting of the caching flag from the manager @@ -240,6 +241,9 @@ namespace MuonGM { m_etaDesign[il].inputPitch = stgc->stripPitch(); m_etaDesign[il].inputLength = m_etaDesign[il].minYSize; m_etaDesign[il].inputWidth = stgc->stripWidth(); + // If the top and bottom frames are not the same widths, the active geometry is incorrectly positionned by half the difference + m_offset = 0.5*(m_etaDesign[il].ylFrame-m_etaDesign[il].ysFrame); + if (!tech){ throw std::runtime_error(Form("File: %s, Line: %d\nsTgcReadoutElement::initDesign() - Failed To get Technology for stgc element: %s", __FILE__, __LINE__, stgc->GetName().c_str())); } @@ -396,9 +400,6 @@ namespace MuonGM { m_surfaceData->m_surfBounds.push_back( new Trk::RotatedTrapezoidBounds( m_halfX[layer], m_minHalfY[layer], m_maxHalfY[layer])); // strips m_surfaceData->m_surfBounds.push_back( new Trk::TrapezoidBounds( m_PadminHalfY[layer], m_PadmaxHalfY[layer], m_PadhalfX[layer])); } - - // If the top and bottom frames are not the same widths, the active geometry is incorrectly positionned by half the difference - double offset = 0.5*(m_etaDesign[layer].ylFrame-m_etaDesign[layer].ysFrame); // identifier of the first channel - wire plane - locX along phi, locY max->min R Identifier id = manager()->stgcIdHelper()->channelID(getStationName(),getStationEta(),getStationPhi(),m_ml, layer+1, 2, 1); @@ -407,12 +408,12 @@ namespace MuonGM { m_surfaceData->m_layerSurfaces.push_back( new Trk::PlaneSurface(*this, id) ); if (m_sTGC_type == 1 || m_sTGC_type == 2) m_surfaceData->m_layerTransforms.push_back(absTransform()*m_Xlg[layer]* - Amg::Translation3D(0,0.,-offset)* + Amg::Translation3D(0,0.,-m_offset)* Amg::AngleAxis3D(-90*CLHEP::deg,Amg::Vector3D(0.,1.,0.))* Amg::AngleAxis3D(-90*CLHEP::deg,Amg::Vector3D(0.,0.,1.)) ); else if (m_sTGC_type == 3) // if QL3, diamond. have to shift geometry to account for origin not being in center m_surfaceData->m_layerTransforms.push_back(absTransform()*m_Xlg[layer]* - Amg::Translation3D(0,0.,-offset + m_PadhalfX[layer] - m_padDesign[layer].yCutout)* + Amg::Translation3D(0,0.,-m_offset + m_PadhalfX[layer] - m_padDesign[layer].yCutout)* Amg::AngleAxis3D(-90*CLHEP::deg,Amg::Vector3D(0.,1.,0.))* Amg::AngleAxis3D(-90*CLHEP::deg,Amg::Vector3D(0.,0.,1.)) ); else throw std::runtime_error(Form("File: %s, Line: %d\nsTgcReadoutElement::fillCache() - sTGC_type %d is not valid! Wire Geometry not Created!", __FILE__, __LINE__, m_sTGC_type)); @@ -436,12 +437,12 @@ namespace MuonGM { if (m_sTGC_type == 1 || m_sTGC_type == 2) m_surfaceData->m_layerTransforms.push_back(absTransform()*m_Xlg[layer]* - Amg::Translation3D(shift,0.,-offset)* + Amg::Translation3D(shift,0.,-m_offset)* Amg::AngleAxis3D(-90*CLHEP::deg,Amg::Vector3D(0.,1.,0.))); else if (m_sTGC_type == 3) // if QL3, diamond. have to shift geometry to account for origin not being in center m_surfaceData->m_layerTransforms.push_back(absTransform()*m_Xlg[layer]* - Amg::Translation3D(shift,0.,-offset + m_halfX[layer] - m_etaDesign[layer].yCutout)* + Amg::Translation3D(shift,0.,-m_offset + m_halfX[layer] - m_etaDesign[layer].yCutout)* Amg::AngleAxis3D(-90*CLHEP::deg,Amg::Vector3D(0.,1.,0.)) ); else std::runtime_error(Form("File: %s, Line: %d\nsTgcReadoutElement::fillCache() - sTGC_type %d is not valid! Strip Geometry not Created!", __FILE__, __LINE__, m_sTGC_type)); @@ -456,12 +457,12 @@ namespace MuonGM { m_surfaceData->m_layerSurfaces.push_back( new Trk::PlaneSurface(*this, id) ); if (m_sTGC_type == 1 || m_sTGC_type == 2) m_surfaceData->m_layerTransforms.push_back(absTransform()*m_Xlg[layer]* - Amg::Translation3D(-shift,0.,-offset)* + Amg::Translation3D(-shift,0.,-m_offset)* Amg::AngleAxis3D(-90*CLHEP::deg,Amg::Vector3D(0.,1.,0.))* Amg::AngleAxis3D(-90*CLHEP::deg,Amg::Vector3D(0.,0.,1.)) ); else if (m_sTGC_type == 3) // if QL3, diamond. have to shift geometry to account for origin not being in center m_surfaceData->m_layerTransforms.push_back(absTransform()*m_Xlg[layer]* - Amg::Translation3D(-shift,0.,-offset + m_PadhalfX[layer] - m_padDesign[layer].yCutout)* + Amg::Translation3D(-shift,0.,-m_offset + m_PadhalfX[layer] - m_padDesign[layer].yCutout)* Amg::AngleAxis3D(-90*CLHEP::deg,Amg::Vector3D(0.,1.,0.))* Amg::AngleAxis3D(-90*CLHEP::deg,Amg::Vector3D(0.,0.,1.)) ); else std::runtime_error(Form("File: %s, Line: %d\nsTgcReadoutElement::fillCache() - sTGC_type %d is not valid! Pad Geometry not Created!", __FILE__, __LINE__, m_sTGC_type)); @@ -500,7 +501,34 @@ namespace MuonGM { Amg::Vector3D sTgcReadoutElement::localToGlobalCoords(Amg::Vector3D locPos, Identifier id) const { int gg = manager()->stgcIdHelper()->gasGap(id); - Amg::Vector3D locP = m_Xlg[gg-1]*locPos; + int channelType = manager()->stgcIdHelper()->channelType(id); + + Amg::Vector3D locP(0,0,0); + // strip plane moved along normal, pad plane in the opposite direction + // We no longer want the readout elements to be seperated by the gas gas volume + // We place all 3 readouts at the center of the gas gap in z, with a 10 micron offset to seperate them + double shift = 0.01; + if((gg-1)%2) shift = -shift; + + if(channelType == 0){ //if pad plane + if(m_sTGC_type == 1 || m_sTGC_type == 2) + locP = m_Xlg[gg-1]*Amg::Translation3D(-shift,0.,-m_offset)*locPos; + else if(m_sTGC_type == 3) + locP = m_Xlg[gg-1]*Amg::Translation3D(-shift,0.,-m_offset + m_PadhalfX[gg-1] - m_padDesign[gg-1].yCutout)*locPos; + } + else if( channelType == 1 ){ //if strip plane + if(m_sTGC_type == 1 || m_sTGC_type == 2) + locP = m_Xlg[gg-1]*Amg::Translation3D(shift,0.,-m_offset)*locPos; + else if(m_sTGC_type == 3) + locP = m_Xlg[gg-1]*Amg::Translation3D(shift,0.,-m_offset + m_halfX[gg-1] - m_etaDesign[gg-1].yCutout)*locPos; + } + else if(channelType == 2){ //if wire plane + if(m_sTGC_type == 1 || m_sTGC_type == 2) + locP = m_Xlg[gg-1]*Amg::Translation3D(0,0.,-m_offset)*locPos; + else if(m_sTGC_type == 3) + locP = m_Xlg[gg-1]*Amg::Translation3D(0,0.,-m_offset + m_PadhalfX[gg-1] - m_padDesign[gg-1].yCutout)*locPos; + } + #ifndef NDEBUG MsgStream log(Athena::getMessageSvc(),"sTgcReadoutElement"); if (log.level()<=MSG::DEBUG) { diff --git a/MuonSpectrometer/MuonDigitization/MDT_Digitization/MDT_Digitization/chargeCalculator.h b/MuonSpectrometer/MuonDigitization/MDT_Digitization/MDT_Digitization/chargeCalculator.h index 11b1235138e2e7613e24cb1b935faae30737525e..b59aec11c52743f18d0adb24ba36246446a62c52 100644 --- a/MuonSpectrometer/MuonDigitization/MDT_Digitization/MDT_Digitization/chargeCalculator.h +++ b/MuonSpectrometer/MuonDigitization/MDT_Digitization/MDT_Digitization/chargeCalculator.h @@ -20,10 +20,6 @@ to the third digit of decimal number of the pdgid. #include "MuonSimData/MuonSimDataCollection.h" #include "MuonSimData/MuonSimData.h" - -#include "MuonIdHelpers/MdtIdHelper.h" -#include "MuonSimEvent/MdtHitIdHelper.h" - #include "StoreGate/StoreGateSvc.h" #include "PileUpTools/PileUpMergeSvc.h" #include "PathResolver/PathResolver.h" diff --git a/MuonSpectrometer/MuonDigitization/MDT_Digitization/MDT_Digitization/chargeCalculator_PileUp.h b/MuonSpectrometer/MuonDigitization/MDT_Digitization/MDT_Digitization/chargeCalculator_PileUp.h index 3bb032a48041ce6010ec7eba1b0aa016404b8f55..482a7de958bf9db3ec7968939837a097c8a79121 100644 --- a/MuonSpectrometer/MuonDigitization/MDT_Digitization/MDT_Digitization/chargeCalculator_PileUp.h +++ b/MuonSpectrometer/MuonDigitization/MDT_Digitization/MDT_Digitization/chargeCalculator_PileUp.h @@ -20,11 +20,6 @@ to the third digit of decimal number of the pdgid. #include "MuonSimData/MuonSimDataCollection.h" #include "MuonSimData/MuonSimData.h" -#include "GaudiKernel/MsgStream.h" - -#include "MuonIdHelpers/MdtIdHelper.h" -#include "MuonSimEvent/MdtHitIdHelper.h" - #include "StoreGate/StoreGateSvc.h" #include "PileUpTools/PileUpMergeSvc.h" #include "PathResolver/PathResolver.h" diff --git a/MuonSpectrometer/MuonDigitization/MDT_Digitization/MDT_Digitization/particleGamma.h b/MuonSpectrometer/MuonDigitization/MDT_Digitization/MDT_Digitization/particleGamma.h index bbca95f9fbfaa03fc7359909ddb3725e66418fa7..54a1f2c0cc6c7ebcf889e0d426b6722860062728 100644 --- a/MuonSpectrometer/MuonDigitization/MDT_Digitization/MDT_Digitization/particleGamma.h +++ b/MuonSpectrometer/MuonDigitization/MDT_Digitization/MDT_Digitization/particleGamma.h @@ -15,10 +15,6 @@ Function particleGamma returns the value of gamma factor for Qball particle. #include "MuonSimData/MuonSimDataCollection.h" #include "MuonSimData/MuonSimData.h" - -#include "MuonIdHelpers/MdtIdHelper.h" -#include "MuonSimEvent/MdtHitIdHelper.h" - #include "StoreGate/StoreGateSvc.h" #include "PileUpTools/PileUpMergeSvc.h" #include "PathResolver/PathResolver.h" diff --git a/MuonSpectrometer/MuonDigitization/MDT_Digitization/MDT_Digitization/particleGamma_PileUp.h b/MuonSpectrometer/MuonDigitization/MDT_Digitization/MDT_Digitization/particleGamma_PileUp.h index 9a5690fc5b61e262e3d7c7c02a77eac650a77e7a..fa3a8cee83a145d7bbdb7ca2b628148c46b4cb79 100644 --- a/MuonSpectrometer/MuonDigitization/MDT_Digitization/MDT_Digitization/particleGamma_PileUp.h +++ b/MuonSpectrometer/MuonDigitization/MDT_Digitization/MDT_Digitization/particleGamma_PileUp.h @@ -15,10 +15,6 @@ Function particleGamma returns the value of gamma factor for Qball particle. #include "MuonSimData/MuonSimDataCollection.h" #include "MuonSimData/MuonSimData.h" - -#include "MuonIdHelpers/MdtIdHelper.h" -#include "MuonSimEvent/MdtHitIdHelper.h" - #include "StoreGate/StoreGateSvc.h" #include "PileUpTools/PileUpMergeSvc.h" #include "PathResolver/PathResolver.h" diff --git a/MuonSpectrometer/MuonDigitization/MDT_Digitization/src/MdtDigitizationTool.cxx b/MuonSpectrometer/MuonDigitization/MDT_Digitization/src/MdtDigitizationTool.cxx index deff99b51f64ff4cbfe74903c2103dadd6d0800b..0630af53b2ce83340a9ab86773eb281f0c03eee6 100644 --- a/MuonSpectrometer/MuonDigitization/MDT_Digitization/src/MdtDigitizationTool.cxx +++ b/MuonSpectrometer/MuonDigitization/MDT_Digitization/src/MdtDigitizationTool.cxx @@ -140,7 +140,7 @@ StatusCode MdtDigitizationTool::initialize() { ATH_MSG_DEBUG ( "Output Digits: '" << m_outputObjectKey.key() << "'" ); //simulation identifier helper - m_muonHelper = MdtHitIdHelper::GetHelper(); + m_muonHelper = MdtHitIdHelper::GetHelper(m_idHelperSvc->mdtIdHelper().tubeMax()); //get the r->t conversion tool ATH_CHECK(m_digiTool.retrieve()); diff --git a/MuonSpectrometer/MuonDigitization/MM_Digitization/src/MM_StripResponse.cxx b/MuonSpectrometer/MuonDigitization/MM_Digitization/src/MM_StripResponse.cxx index a1af25ef29a67d0b0df18c42f7610c37e1c2033d..663d14296df1f387d1f25e142f3a714ccbc70066 100644 --- a/MuonSpectrometer/MuonDigitization/MM_Digitization/src/MM_StripResponse.cxx +++ b/MuonSpectrometer/MuonDigitization/MM_Digitization/src/MM_StripResponse.cxx @@ -107,7 +107,7 @@ void MM_StripResponse::calculateSummaries(float chargeThreshold) { // Last active strip numbrer is maxStripID-1 if (stripVal < m_minstripID || stripVal > m_maxstripID-1) continue; // remove PCB gap strips - if (stripVal == 1023 || stripVal == 1024 || stripVal == 2047 || stripVal == 2048 || stripVal == 3071 || stripVal == 3072 || stripVal == 4095 || stripVal == 4096) continue; + if (stripVal == 1024 || stripVal == 1025 || stripVal == 2048 || stripVal == 2049 || stripVal == 3072 || stripVal == 3073 || stripVal == 4096 || stripVal == 4097) continue; float stripChargeVal = stripCharge.second; if(stripChargeVal < chargeThreshold) continue; diff --git a/MuonSpectrometer/MuonDigitization/RPC_Digitization/src/RpcDigitizationTool.cxx b/MuonSpectrometer/MuonDigitization/RPC_Digitization/src/RpcDigitizationTool.cxx index 2db59976e68639cabc410b672d4c4997991c3de9..9bce3813df2ab0778d5d5d0ecbb48ceff19a057d 100644 --- a/MuonSpectrometer/MuonDigitization/RPC_Digitization/src/RpcDigitizationTool.cxx +++ b/MuonSpectrometer/MuonDigitization/RPC_Digitization/src/RpcDigitizationTool.cxx @@ -608,7 +608,14 @@ StatusCode RpcDigitizationTool::doDigitization(const EventContext& ctx, RpcDigit const HepMcParticleLink::PositionFlag idxFlag = (phit.eventId()==0) ? HepMcParticleLink::IS_POSITION: HepMcParticleLink::IS_INDEX; const HepMcParticleLink particleLink(phit->trackNumber(),phit.eventId(),evColl,idxFlag); - ATH_CHECK(DetectionEfficiency(ctx, &atlasRpcIdeta,&atlasRpcIdphi, undefPhiStripStat, rndmEngine, particleLink)); + // as long there is no proper implementation of the BIS78 cabling and digitisation, + // skip this method to avoid hard crash of digitisation + if (stationName.find("BIS")!=std::string::npos && std::abs(stationEta)>6) { + ATH_MSG_WARNING("skipping DetectionEfficiency for BIS78"); + } else { + ATH_CHECK(DetectionEfficiency(ctx, &atlasRpcIdeta,&atlasRpcIdphi, undefPhiStripStat, rndmEngine, particleLink)); + } + ATH_MSG_DEBUG ( "SetPhiOn " << m_SetPhiOn << " SetEtaOn " << m_SetEtaOn ); for( int imeasphi=0 ; imeasphi!=2; ++imeasphi){ @@ -2092,7 +2099,7 @@ int RpcDigitizationTool::ClusterSizeEvaluation(const EventContext& ctx, const Id index += m_FracClusterSize1_A.size()/2*measuresPhi ; if( index>m_FracClusterSize1_A.size() || index>m_FracClusterSize2_A.size() || index>m_FracClusterSizeTail_A.size() || index>m_MeanClusterSizeTail_A.size() ) { - ATH_MSG_ERROR ( "Index out of array in ClusterSizeEvaluation SideA " << index <<" statName "<<stationName) ; + ATH_MSG_WARNING ( "Index out of array in ClusterSizeEvaluation SideA " << index <<" statName "<<stationName) ; return 1; } FracClusterSize1 = m_FracClusterSize1_A [index]; @@ -2104,7 +2111,7 @@ int RpcDigitizationTool::ClusterSizeEvaluation(const EventContext& ctx, const Id index += m_FracClusterSize1_C.size()/2*measuresPhi - m_FracClusterSize1_A.size()/2*measuresPhi ; if( index>m_FracClusterSize1_C.size() || index>m_FracClusterSize2_C.size() || index>m_FracClusterSizeTail_C.size() || index>m_MeanClusterSizeTail_C.size() ) { - ATH_MSG_ERROR ( "Index out of array in ClusterSizeEvaluation SideC " << index <<" statName "<<stationName) ; + ATH_MSG_WARNING ( "Index out of array in ClusterSizeEvaluation SideC " << index <<" statName "<<stationName) ; return 1; } @@ -2145,7 +2152,7 @@ int RpcDigitizationTool::ClusterSizeEvaluation(const EventContext& ctx, const Id index += m_FracClusterSize1_A.size()/2*measuresPhi ; if( index>m_FracClusterSize1_A.size() || index>m_FracClusterSize2_A.size() || index>m_FracClusterSizeTail_A.size() || index>m_MeanClusterSizeTail_A.size() ) { - ATH_MSG_ERROR ( "Index out of array in ClusterSizeEvaluation SideA " << index << " statName "<<stationName) ; + ATH_MSG_WARNING ( "Index out of array in ClusterSizeEvaluation SideA " << index << " statName "<<stationName) ; return 1; } FracClusterSize1 = m_FracClusterSize1_A [index]; @@ -2157,7 +2164,7 @@ int RpcDigitizationTool::ClusterSizeEvaluation(const EventContext& ctx, const Id index += m_FracClusterSize1_C.size()/2*measuresPhi - m_FracClusterSize1_A.size()/2*measuresPhi ; if( index>m_FracClusterSize1_C.size() || index>m_FracClusterSize2_C.size() || index>m_FracClusterSizeTail_C.size() || index>m_MeanClusterSizeTail_C.size() ) { - ATH_MSG_ERROR ( "Index out of array in ClusterSizeEvaluation SideC " << index << " statName "<<stationName ) ; + ATH_MSG_WARNING ( "Index out of array in ClusterSizeEvaluation SideC " << index << " statName "<<stationName ) ; return 1; } diff --git a/MuonSpectrometer/MuonG4/MuonG4SD/src/MDTSensitiveDetector.cxx b/MuonSpectrometer/MuonG4/MuonG4SD/src/MDTSensitiveDetector.cxx index 7fdd79823312848b1714387bdd26efe288bb1f37..b23950a27e25a74163b3eaa1696f7b1b2034028d 100755 --- a/MuonSpectrometer/MuonG4/MuonG4SD/src/MDTSensitiveDetector.cxx +++ b/MuonSpectrometer/MuonG4/MuonG4SD/src/MDTSensitiveDetector.cxx @@ -14,14 +14,14 @@ #include "GeoPrimitives/CLHEPtoEigenConverter.h" // construction/destruction -MDTSensitiveDetector::MDTSensitiveDetector(const std::string& name, const std::string& hitCollectionName) +MDTSensitiveDetector::MDTSensitiveDetector(const std::string& name, const std::string& hitCollectionName, const unsigned int nTubesMax) : G4VSensitiveDetector( name ) , m_MDTHitColl( hitCollectionName ) , m_driftRadius(0.) , m_globalTime(0.) , m_DEFAULT_TUBE_RADIUS( std::numeric_limits<double>::max() ) { - m_muonHelper = MdtHitIdHelper::GetHelper(); + m_muonHelper = MdtHitIdHelper::GetHelper(nTubesMax); } // Implemenation of memebr functions diff --git a/MuonSpectrometer/MuonG4/MuonG4SD/src/MDTSensitiveDetector.h b/MuonSpectrometer/MuonG4/MuonG4SD/src/MDTSensitiveDetector.h index 253bfe1efc12614407428f50d9557f1522ed0634..b08f6e90769da1b36e5e5409ab1494a4f3160736 100755 --- a/MuonSpectrometer/MuonG4/MuonG4SD/src/MDTSensitiveDetector.h +++ b/MuonSpectrometer/MuonG4/MuonG4SD/src/MDTSensitiveDetector.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ /** @class MDTSensitiveDetector @@ -88,8 +88,8 @@ FRIEND_TEST( MDTSensitiveDetectortest, GetIdentifier ); public: /** construction/destruction */ - MDTSensitiveDetector(const std::string& name, const std::string& hitCollectionName); - ~MDTSensitiveDetector() {} + MDTSensitiveDetector(const std::string& name, const std::string& hitCollectionName, const unsigned int nTubesMax); + ~MDTSensitiveDetector()=default; /** member functions */ void Initialize(G4HCofThisEvent* HCE) override final; diff --git a/MuonSpectrometer/MuonG4/MuonG4SD/src/MDTSensitiveDetectorCosmics.cxx b/MuonSpectrometer/MuonG4/MuonG4SD/src/MDTSensitiveDetectorCosmics.cxx index 2b1cebf437fda49ac7903fcdaf31ea3ccc9f5c1d..b44478a00a941e806b7946ba59cbd7d0f2f45e7c 100755 --- a/MuonSpectrometer/MuonG4/MuonG4SD/src/MDTSensitiveDetectorCosmics.cxx +++ b/MuonSpectrometer/MuonG4/MuonG4SD/src/MDTSensitiveDetectorCosmics.cxx @@ -17,7 +17,7 @@ typedef std::istringstream my_isstream; // construction/destruction -MDTSensitiveDetectorCosmics::MDTSensitiveDetectorCosmics(const std::string& name, const std::string& hitCollectionName) +MDTSensitiveDetectorCosmics::MDTSensitiveDetectorCosmics(const std::string& name, const std::string& hitCollectionName, const unsigned int nTubesMax) : G4VSensitiveDetector( name ) , m_momMag(0.) , m_MDTHitColl( hitCollectionName ) @@ -25,7 +25,7 @@ MDTSensitiveDetectorCosmics::MDTSensitiveDetectorCosmics(const std::string& name , m_globalTime(0.) , m_DEFAULT_TUBE_RADIUS( std::numeric_limits<double>::max() ) { - m_muonHelper = MdtHitIdHelper::GetHelper(); + m_muonHelper = MdtHitIdHelper::GetHelper(nTubesMax); } // Implemenation of member functions diff --git a/MuonSpectrometer/MuonG4/MuonG4SD/src/MDTSensitiveDetectorCosmics.h b/MuonSpectrometer/MuonG4/MuonG4SD/src/MDTSensitiveDetectorCosmics.h index 625516cb683fbf792dd94e832a8c9cee2df0c93e..ee45b2e14ab408e51fe6490d611dbfa8143e373b 100755 --- a/MuonSpectrometer/MuonG4/MuonG4SD/src/MDTSensitiveDetectorCosmics.h +++ b/MuonSpectrometer/MuonG4/MuonG4SD/src/MDTSensitiveDetectorCosmics.h @@ -93,8 +93,8 @@ FRIEND_TEST( MDTSensitiveDetectorCosmicstest, GetIdentifier ); public: /** construction/destruction */ - MDTSensitiveDetectorCosmics(const std::string& name, const std::string& hitCollectionName); - ~MDTSensitiveDetectorCosmics() {} + MDTSensitiveDetectorCosmics(const std::string& name, const std::string& hitCollectionName, const unsigned int nTubesMax); + ~MDTSensitiveDetectorCosmics()=default; /** member functions */ void Initialize(G4HCofThisEvent* HCE) override final; diff --git a/MuonSpectrometer/MuonG4/MuonG4SD/src/MDTSensitiveDetectorCosmicsTool.cxx b/MuonSpectrometer/MuonG4/MuonG4SD/src/MDTSensitiveDetectorCosmicsTool.cxx index e82255f9890d4d2940aa3c4c3b72aff791e4e2b7..d5df98ee5eaf65b4dbdd350559958170f47749f1 100755 --- a/MuonSpectrometer/MuonG4/MuonG4SD/src/MDTSensitiveDetectorCosmicsTool.cxx +++ b/MuonSpectrometer/MuonG4/MuonG4SD/src/MDTSensitiveDetectorCosmicsTool.cxx @@ -1,9 +1,10 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ #include "MDTSensitiveDetectorCosmicsTool.h" #include "MDTSensitiveDetectorCosmics.h" +#include <TString.h> // for Form MDTSensitiveDetectorCosmicsTool::MDTSensitiveDetectorCosmicsTool(const std::string& type, const std::string& name, const IInterface* parent) : SensitiveDetectorBase( type , name , parent ) @@ -13,5 +14,7 @@ MDTSensitiveDetectorCosmicsTool::MDTSensitiveDetectorCosmicsTool(const std::stri G4VSensitiveDetector* MDTSensitiveDetectorCosmicsTool::makeSD() const { ATH_MSG_DEBUG( "Initializing SD" ); - return new MDTSensitiveDetectorCosmics(name(), m_outputCollectionNames[0]); + StatusCode sc = m_idHelperSvc.retrieve(); + if (sc.isFailure()) throw std::runtime_error(Form("File: %s, Line: %d\nMDTSensitiveDetectorCosmicsTool::makeSD() - could not retrieve MuonIdHelperSvc", __FILE__, __LINE__)); + return new MDTSensitiveDetectorCosmics(name(), m_outputCollectionNames[0], m_idHelperSvc->mdtIdHelper().tubeMax()); } diff --git a/MuonSpectrometer/MuonG4/MuonG4SD/src/MDTSensitiveDetectorCosmicsTool.h b/MuonSpectrometer/MuonG4/MuonG4SD/src/MDTSensitiveDetectorCosmicsTool.h index 2e28d88c6f2637d4969743dd641813ff1bf319f1..2b6bbe28992554e8ada14ca85650e89699967cb9 100755 --- a/MuonSpectrometer/MuonG4/MuonG4SD/src/MDTSensitiveDetectorCosmicsTool.h +++ b/MuonSpectrometer/MuonG4/MuonG4SD/src/MDTSensitiveDetectorCosmicsTool.h @@ -1,19 +1,23 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ #ifndef MDTSensitiveDetectorCosmicsTool_H #define MDTSensitiveDetectorCosmicsTool_H #include "G4AtlasTools/SensitiveDetectorBase.h" +#include "GaudiKernel/ServiceHandle.h" +#include "MuonIdHelpers/IMuonIdHelperSvc.h" class MDTSensitiveDetectorCosmicsTool : public SensitiveDetectorBase { public: MDTSensitiveDetectorCosmicsTool(const std::string& type, const std::string& name, const IInterface *parent); - ~MDTSensitiveDetectorCosmicsTool() {} + ~MDTSensitiveDetectorCosmicsTool()=default; protected: G4VSensitiveDetector* makeSD() const override final; +private: + ServiceHandle<Muon::IMuonIdHelperSvc> m_idHelperSvc {this, "MuonIdHelperSvc", "Muon::MuonIdHelperSvc/MuonIdHelperSvc"}; }; #endif diff --git a/MuonSpectrometer/MuonG4/MuonG4SD/src/MDTSensitiveDetectorTool.cxx b/MuonSpectrometer/MuonG4/MuonG4SD/src/MDTSensitiveDetectorTool.cxx index 00e4b67b58a298cdbcbfcff4babaf9cb757a2bed..989244d88e06eee962e90269d2dc7335662f343e 100755 --- a/MuonSpectrometer/MuonG4/MuonG4SD/src/MDTSensitiveDetectorTool.cxx +++ b/MuonSpectrometer/MuonG4/MuonG4SD/src/MDTSensitiveDetectorTool.cxx @@ -1,9 +1,10 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ #include "MDTSensitiveDetectorTool.h" #include "MDTSensitiveDetector.h" +#include <TString.h> // for Form MDTSensitiveDetectorTool::MDTSensitiveDetectorTool(const std::string& type, const std::string& name, const IInterface* parent) : SensitiveDetectorBase( type , name , parent ) @@ -13,5 +14,7 @@ MDTSensitiveDetectorTool::MDTSensitiveDetectorTool(const std::string& type, cons G4VSensitiveDetector* MDTSensitiveDetectorTool::makeSD() const { ATH_MSG_DEBUG( "Initializing SD" ); - return new MDTSensitiveDetector(name(), m_outputCollectionNames[0]); + StatusCode sc = m_idHelperSvc.retrieve(); + if (sc.isFailure()) throw std::runtime_error(Form("File: %s, Line: %d\nMDTSensitiveDetectorTool::makeSD() - could not retrieve MuonIdHelperSvc", __FILE__, __LINE__)); + return new MDTSensitiveDetector(name(), m_outputCollectionNames[0], m_idHelperSvc->mdtIdHelper().tubeMax()); } diff --git a/MuonSpectrometer/MuonG4/MuonG4SD/src/MDTSensitiveDetectorTool.h b/MuonSpectrometer/MuonG4/MuonG4SD/src/MDTSensitiveDetectorTool.h index bfb8bf61d6fb22067a46703208d1dcd5690b24c5..4734fcbdcd1106865ba4dda175f3d90c34e374a5 100755 --- a/MuonSpectrometer/MuonG4/MuonG4SD/src/MDTSensitiveDetectorTool.h +++ b/MuonSpectrometer/MuonG4/MuonG4SD/src/MDTSensitiveDetectorTool.h @@ -1,19 +1,23 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ #ifndef MDTSENSITIVEDETECTORTOOL_H #define MDTSENSITIVEDETECTORTOOL_H #include "G4AtlasTools/SensitiveDetectorBase.h" +#include "GaudiKernel/ServiceHandle.h" +#include "MuonIdHelpers/IMuonIdHelperSvc.h" class MDTSensitiveDetectorTool : public SensitiveDetectorBase { public: MDTSensitiveDetectorTool(const std::string& type, const std::string& name, const IInterface *parent); - ~MDTSensitiveDetectorTool() {} + ~MDTSensitiveDetectorTool()=default; protected: G4VSensitiveDetector* makeSD() const override final; +private: + ServiceHandle<Muon::IMuonIdHelperSvc> m_idHelperSvc {this, "MuonIdHelperSvc", "Muon::MuonIdHelperSvc/MuonIdHelperSvc"}; }; #endif diff --git a/MuonSpectrometer/MuonG4/MuonG4SD/test/MDTSensitiveDetectorCosmics_gtest.cxx b/MuonSpectrometer/MuonG4/MuonG4SD/test/MDTSensitiveDetectorCosmics_gtest.cxx index 4ba3740ea73c3c62eaabe7360e48033be3915cae..42c16521e124e1d0a339286a7a0c1f80fa4a2a82 100644 --- a/MuonSpectrometer/MuonG4/MuonG4SD/test/MDTSensitiveDetectorCosmics_gtest.cxx +++ b/MuonSpectrometer/MuonG4/MuonG4SD/test/MDTSensitiveDetectorCosmics_gtest.cxx @@ -49,7 +49,7 @@ class MDTSensitiveDetectorCosmicstest : public ::testing::Test { TEST_F ( MDTSensitiveDetectorCosmicstest, Initialize ) { G4HCofThisEvent hce; - MDTSensitiveDetectorCosmics sd1("name1", "name1" ); + MDTSensitiveDetectorCosmics sd1("name1", "name1", 78); // all MDT/sMDT chambers used in Run1/2 have maximum 78 tubes sd1.Initialize( &hce ); ASSERT_TRUE(sd1.m_MDTHitColl.isValid()); //check if initialization of m_MDTHitColl is successful } @@ -208,7 +208,7 @@ TEST_F ( MDTSensitiveDetectorCosmicstest, ProcessHits ) sp.SetTrack(track); - MDTSensitiveDetectorCosmics sd2("name2", "name2"); + MDTSensitiveDetectorCosmics sd2("name2", "name2", 78); // all MDT/sMDT chambers used in Run1/2 have maximum 78 tubes sd2.Initialize( &hce ); sd2.ProcessHits(&sp, &th );//invoke the memberfunction that is being tested @@ -254,7 +254,7 @@ TEST_F ( MDTSensitiveDetectorCosmicstest, GetIdentifier ) navigationHistory->NewLevel(physicalVolume, kNormal, nReplica); G4TouchableHistory* touchableHistory = new G4TouchableHistory(*navigationHistory); - MDTSensitiveDetectorCosmics sd3("name3", "name3"); + MDTSensitiveDetectorCosmics sd3("name3", "name3", 78); // all MDT/sMDT chambers used in Run1/2 have maximum 78 tubes sd3.Initialize( &hce ); int theID = sd3.GetIdentifier(touchableHistory); diff --git a/MuonSpectrometer/MuonG4/MuonG4SD/test/MDTSensitiveDetector_gtest.cxx b/MuonSpectrometer/MuonG4/MuonG4SD/test/MDTSensitiveDetector_gtest.cxx index 50ea955f9bb61174d4b9d121462ab29277c349ce..453fe6805ffcd2e98d942f69f3e9813a94a5343d 100644 --- a/MuonSpectrometer/MuonG4/MuonG4SD/test/MDTSensitiveDetector_gtest.cxx +++ b/MuonSpectrometer/MuonG4/MuonG4SD/test/MDTSensitiveDetector_gtest.cxx @@ -49,7 +49,7 @@ class MDTSensitiveDetectortest : public ::testing::Test { TEST_F ( MDTSensitiveDetectortest, Initialize ) { G4HCofThisEvent hce; - MDTSensitiveDetector sd1("name1", "name1" ); + MDTSensitiveDetector sd1("name1", "name1", 78); // all MDT/sMDT chambers used in Run1/2 have maximum 78 tubes sd1.Initialize( &hce ); ASSERT_TRUE(sd1.m_MDTHitColl.isValid()); //check if initialization of m_MDTHitColl is successful @@ -208,7 +208,7 @@ TEST_F ( MDTSensitiveDetectortest, ProcessHits ) sp.SetTrack(track); //end - MDTSensitiveDetector sd2("name2", "name2"); + MDTSensitiveDetector sd2("name2", "name2", 78); // all MDT/sMDT chambers used in Run1/2 have maximum 78 tubes sd2.Initialize( &hce ); sd2.ProcessHits(&sp, &th ); @@ -254,7 +254,7 @@ TEST_F ( MDTSensitiveDetectortest, GetIdentifier ) navigationHistory->NewLevel(physicalVolume, kNormal, nReplica); G4TouchableHistory* touchableHistory = new G4TouchableHistory(*navigationHistory); - MDTSensitiveDetector sd3("name3", "name3"); + MDTSensitiveDetector sd3("name3", "name3", 78); // all MDT/sMDT chambers used in Run1/2 have maximum 78 tubes sd3.Initialize( &hce ); int theID = sd3.GetIdentifier(touchableHistory); diff --git a/MuonSpectrometer/MuonGeoModel/MuonGeoModel/MultiLayer.h b/MuonSpectrometer/MuonGeoModel/MuonGeoModel/MultiLayer.h index 6615cdbd61fd99958cf145ee41ee54b1d467557f..6035b7d52b534b4921edcecaf06e418bbb909f75 100755 --- a/MuonSpectrometer/MuonGeoModel/MuonGeoModel/MultiLayer.h +++ b/MuonSpectrometer/MuonGeoModel/MuonGeoModel/MultiLayer.h @@ -37,6 +37,11 @@ public: double cutoutTubeLength[5]; // tube length bool cutoutFullLength[5]; // true if this region is outside the cutout bool cutoutAtAngle; // true if this station has cutouts at an angle; //EMS1,3 and BOS6 + + // the same but for several cutouts along the amdb x (GeoModel y) + // gives the (x1,x2) and (y1,y2) tuples of rectangles which are NOT cutout + std::vector<std::pair<double,double>> m_nonCutoutXSteps; + std::vector<std::pair<double,double>> m_nonCutoutYSteps; }; } // namespace MuonGM diff --git a/MuonSpectrometer/MuonGeoModel/src/Mdt.cxx b/MuonSpectrometer/MuonGeoModel/src/Mdt.cxx index 9a477a8a478cdf10d49ed1036f31a35b667d48a9..d33adce59ca9daedcd94b7b731f37a34d78fd166 100755 --- a/MuonSpectrometer/MuonGeoModel/src/Mdt.cxx +++ b/MuonSpectrometer/MuonGeoModel/src/Mdt.cxx @@ -2,7 +2,6 @@ Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ - #include "MuonGeoModel/Mdt.h" #include "MuonGeoModel/MDT_Technology.h" #include "MuonGeoModel/MYSQL.h" @@ -12,10 +11,19 @@ #include "GeoModelKernel/GeoFullPhysVol.h" #include "GeoModelKernel/GeoShape.h" +#include <TString.h> // for Form + +#include "float.h" + #define verbose_mdt false namespace MuonGM { +float round(const float toRound, const unsigned int decimals) { + unsigned int factor = std::pow(10,decimals); + return std::round(toRound*factor)/factor; +} + Mdt::Mdt(Component* ss, std::string lVName): DetectorElement(ss->name) { logVolName = lVName; @@ -65,6 +73,23 @@ GeoFullPhysVol* Mdt::build(std::vector<Cutout*> vcutdef) if (verbose_mdt) { log << MSG::VERBOSE << " mdt cutouts are on " << endmsg; } + + bool cutoutsVsX=false; + bool cutoutsVsY=false; + // first check whether there are several cutouts with different amdb x or y coordinates + float lastX(FLT_MAX); + float lastY(FLT_MAX); + for (int i = 0; i < Ncuts; ++i) { + if (lastX!=FLT_MAX && lastX*vcutdef[i]->dx<0) cutoutsVsX=true; + lastX = vcutdef[i]->dx; + if (lastY!=FLT_MAX && lastY*vcutdef[i]->dy<0) cutoutsVsY=true; + lastY = vcutdef[i]->dy; + } + if (cutoutsVsX&&cutoutsVsY) { + throw std::runtime_error(Form("File: %s, Line: %d\nMdt::build() - Found more than one cutout in amdb-x direction and more than one cutout in amdb-y direction, currently not supported", __FILE__, __LINE__)); + } + +if (!cutoutsVsX) { // nominal case (used for BMS/BOG/BMG etc.) int cutoutNtubes[5]; // Number of tubes in sub-multilayer[i] bool cutoutFullLength[5]; // True if this region is outside the cutout double cutoutXtubes[5]; // Location of tube center within sub-ml[i] along x-amdb @@ -95,7 +120,7 @@ GeoFullPhysVol* Mdt::build(std::vector<Cutout*> vcutdef) int cutLocationCode[3] = {0, 0, 0}; for (int i = 0; i < Ncuts; i++) { if (vcutdef[i]->dy <= 0) cutLocationCode[i] = -1; - if (vcutdef[i]->dy + vcutdef[i]->lengthY >= top) cutLocationCode[i] = 1; + if (round(vcutdef[i]->dy + vcutdef[i]->lengthY,2) >= round(top,2)) cutLocationCode[i] = 1; } // Calculate quantities needed by multilayer @@ -260,6 +285,79 @@ GeoFullPhysVol* Mdt::build(std::vector<Cutout*> vcutdef) } layer->cutoutAtAngle = cutAtAngle; + } else { + // there are several cutouts along the amdb-x coordinate + + if (longWidth!=width) { + throw std::runtime_error(Form("File: %s, Line: %d\nMdt::build() - only support cutouts along amdb-x for rectangular chambers", __FILE__, __LINE__)); + } + + std::vector<std::pair<double,double>> nonCutoutXSteps; + std::vector<std::pair<double,double>> nonCutoutYSteps; + + // Order cutouts by increasing dx + for (int i = 0; i < Ncuts; i++) { + for (int j = i+1; j < Ncuts; j++) { + if (vcutdef[j]->dx < vcutdef[i]->dx) { + Cutout* c = vcutdef[i]; + vcutdef[i] = vcutdef[j]; + vcutdef[j] = c; + } + } + } + + // in amdb-coordinates + double xminChamber = round(-width/2,2); + double xmaxChamber = round(width/2,2); + double yminChamber = 0; + double ymaxChamber = round(length-tubePitch/2,2); + + double latestXMax=xminChamber; + + for (int i = 0; i < Ncuts; ++i) { + Cutout* c = vcutdef[i]; + double lowerX = round(c->dx - c->widthXs/2,2); + double xmin = (lowerX <= xminChamber) ? xminChamber : lowerX; + if (xmin<latestXMax) { + throw std::runtime_error(Form("File: %s, Line: %d\nMdt::build() - cannot have cutouts along amdb-x which overlap in amdb-x", __FILE__, __LINE__)); + } + if (i==0 && xmin>xminChamber) { + // we start with a full slice without cutout + nonCutoutXSteps.push_back(std::make_pair(xminChamber,lowerX)); + nonCutoutYSteps.push_back(std::make_pair(yminChamber,ymaxChamber)); + } + double upperX = round(c->dx + c->widthXs/2,2); + double xmax = (upperX >= xmaxChamber) ? xmaxChamber : upperX; + + double ymin = round(c->dy+c->lengthY,2) < ymaxChamber ? c->dy+c->lengthY : 0; + double ymax = ymaxChamber <= round(c->dy+c->lengthY,2) ? c->dy : ymaxChamber; + + if (latestXMax<xmin) { + // there is a full slice between latestXMax and xmin + nonCutoutXSteps.push_back(std::make_pair(latestXMax,xmin)); + nonCutoutYSteps.push_back(std::make_pair(yminChamber,ymaxChamber)); + } + + nonCutoutXSteps.push_back(std::make_pair(xmin,xmax)); + nonCutoutYSteps.push_back(std::make_pair(ymin,ymax)); + + + if (i==Ncuts-1 && xmax<xmaxChamber) { + // we end with a full slice without cutout + nonCutoutXSteps.push_back(std::make_pair(xmax,xmaxChamber)); + nonCutoutYSteps.push_back(std::make_pair(yminChamber,ymaxChamber)); + } + + latestXMax = xmax; + } + + // Pass information to multilayer and MdtComponent + m_component->cutoutTubeXShift = 0; + layer->cutoutNsteps = nonCutoutXSteps.size(); + layer->m_nonCutoutXSteps = nonCutoutXSteps; + layer->m_nonCutoutYSteps = nonCutoutYSteps; + layer->cutoutAtAngle = false; + } return layer->build(); diff --git a/MuonSpectrometer/MuonGeoModel/src/Micromegas.cxx b/MuonSpectrometer/MuonGeoModel/src/Micromegas.cxx index 1e82edc57c12cdf87effb7d9e80fad78210d281d..e56450176cfe24d7c171f35c6142a1f001747482 100755 --- a/MuonSpectrometer/MuonGeoModel/src/Micromegas.cxx +++ b/MuonSpectrometer/MuonGeoModel/src/Micromegas.cxx @@ -2,9 +2,11 @@ Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ - #include "MuonGeoModel/Micromegas.h" + #include "MuonAGDDDescription/MM_Technology.h" +#include "MuonAGDDDescription/MMDetectorDescription.h" +#include "MuonAGDDDescription/MMDetectorHelper.h" #include "AGDDKernel/AGDDDetectorStore.h" #include "MuonGeoModel/Station.h" #include "MuonGeoModel/MicromegasComponent.h" @@ -21,7 +23,6 @@ #include "GeoModelKernel/GeoSerialIdentifier.h" #include "GeoModelKernel/GeoIdentifierTag.h" #include "GeoModelKernel/GeoDefinitions.h" -// for cutouts: #include "GeoModelKernel/GeoShapeSubtraction.h" #include "GeoModelKernel/GeoShapeIntersection.h" #include "GeoModelKernel/GeoShapeShift.h" @@ -49,15 +50,17 @@ GeoFullPhysVol* Micromegas::build(int minimalgeo) GeoFullPhysVol* Micromegas::build(int minimalgeo, int , std::vector<Cutout*> ) { AGDDDetectorStore* ds = AGDDDetectorStore::GetDetectorStore(); + MMDetectorHelper mmHelper; + MMDetectorDescription* mm_descr = mmHelper.Get_MMDetectorSubType(m_component->subType); + MM_Technology* t = (MM_Technology*) ds->GetTechnology(name); thickness = t->Thickness(); double gasTck=t->gasThickness; double pcbTck=t->pcbThickness; double roTck=t->roThickness; - double f1=t->f1Thickness; - double f2=t->f2Thickness; - double f3=t->f3Thickness; - + double f1=mm_descr->ylFrame(); + double f2=mm_descr->ysFrame(); + double f3=mm_descr->xFrame(); minimalgeo=t->geoLevel; diff --git a/MuonSpectrometer/MuonGeoModel/src/MultiLayer.cxx b/MuonSpectrometer/MuonGeoModel/src/MultiLayer.cxx index 9e39419bd90d15d53d97697e7c8d404379bde802..6dee99d7e56b3d9b0fa832ca5061e2cbe4bb4655 100755 --- a/MuonSpectrometer/MuonGeoModel/src/MultiLayer.cxx +++ b/MuonSpectrometer/MuonGeoModel/src/MultiLayer.cxx @@ -31,6 +31,7 @@ #include <vector> #include <cassert> + using namespace GeoXF; #define verbose_multilayer false @@ -39,13 +40,14 @@ namespace MuonGM { MultiLayer::MultiLayer(std::string n): DetectorElement(n), nrOfLayers(0), nrOfTubes(0), tubePitch(0.), width(0.), length(0.), thickness(0.), - mdtthickness(0.), longWidth(0.), nrOfSteps(0), cutoutNsteps(0), cutoutAtAngle(false) -{ + mdtthickness(0.), longWidth(0.), nrOfSteps(0), cutoutNsteps(0), cutoutAtAngle(false), + m_nonCutoutXSteps(), + m_nonCutoutYSteps() { MsgStream log(Athena::getMessageSvc(), "MultiLayer::MultiLayer"); MYSQL* mysql = MYSQL::GetPointer(); MDT* md = (MDT*)mysql->GetTechnology(name); - if (md != NULL) { + if (md) { nrOfLayers = md->numOfLayers; mdtthickness = md->totalThickness; tubePitch = md->pitch; @@ -86,9 +88,9 @@ GeoFullPhysVol* MultiLayer::build() << endmsg; } - const GeoShape* slay = NULL; - const GeoShape* sfoamup = NULL; // do them both together when there are cutouts - const GeoShape* sfoamlow = NULL; // do them both together when there are cutouts + const GeoShape* slay = nullptr; + const GeoShape* sfoamup = nullptr; // do them both together when there are cutouts + const GeoShape* sfoamlow = nullptr; // do them both together when there are cutouts // so calculate other foam-related info first: double foamthicknesslow = yy[0] - tuberad; double foamthicknessup; @@ -106,7 +108,9 @@ GeoFullPhysVol* MultiLayer::build() } else if (fabs(foamthicknessup - 10.00*Gaudi::Units::mm) < 0.1 && logVolName.find("BMG") != std::string::npos ) { foamthicknessup = 10.00*Gaudi::Units::mm; - } else if ( logVolName == "BME1MDT09" || logVolName == "BME2MDT09" ) { //@@ + } else if ( logVolName.find("MDT09") != std::string::npos || logVolName.find("MDT14") != std::string::npos ) { + // MDT09 is used for BME and BIS sMDTs, MDT14 is used for 2nd multilayer of BIS78 + // All those sMDTs have no foam layer foamthicknesslow = 0.; foamthicknessup = 0.; } else { @@ -127,7 +131,9 @@ GeoFullPhysVol* MultiLayer::build() } else if (fabs(foamthicknesslow - 10.00*Gaudi::Units::mm) < 0.1 && logVolName.find("BMG") != std::string::npos ) { foamthicknesslow = 10.00*Gaudi::Units::mm; - } else if ( logVolName == "BME1MDT09" || logVolName == "BME2MDT09" ) { //@@ + } else if ( logVolName.find("MDT09") != std::string::npos || logVolName.find("MDT14") != std::string::npos ) { + // MDT09 is used for BME and BIS sMDTs, MDT14 is used for 2nd multilayer of BIS78 + // All those sMDTs have no foam layer foamthicknesslow = 0.; foamthicknessup = 0.; } else { @@ -143,6 +149,38 @@ GeoFullPhysVol* MultiLayer::build() // No cutouts - layer is a simple box or trapezoid slay = new GeoTrd(mdtthickness/2, mdtthickness/2, width/2, longWidth/2, length/2); + } else if (m_nonCutoutXSteps.size()) { + // there are cutouts sliced along amdb-x (slices in amdb-y) + double submlthick = mdtthickness/2.; // corresponds to half amdb-z (chamber height=constant) + + // loop on the cutout slices and create rectangular boxes which are NOT cutout and add them together to an envelope + for (unsigned int i = 0; i < m_nonCutoutXSteps.size(); ++i) { + + double submlwidth = (m_nonCutoutXSteps.at(i).second-m_nonCutoutXSteps.at(i).first)/2; // corresponds to half amdb-x + double submllength = (m_nonCutoutYSteps.at(i).second-m_nonCutoutYSteps.at(i).first)/2; // corresponds to half amdb-y + + // need a transform between center multilayer and center of trapezoid (y is amdb-x, z is amdb-y) + double yPos = (m_nonCutoutXSteps.at(i).first+m_nonCutoutXSteps.at(i).second)/2; + double zPos = (m_nonCutoutYSteps.at(i).first+m_nonCutoutYSteps.at(i).second)/2-length/2; + GeoTrf::Transform3D submlpos = GeoTrf::Translate3D(0.,yPos,zPos); + + const GeoTrd* tempSLay = nullptr; + const GeoShape* tempSLay1 = nullptr; + + if (submlthick*submlwidth*submllength > 0) { + tempSLay = new GeoTrd(submlthick, submlthick, submlwidth, submlwidth, submllength); + tempSLay1 = &( (*tempSLay)<<submlpos); + } else { + log << MSG::WARNING << " problem with shape of temporary trapezoid in LogVolName " + << logVolName << " thick,width,length=" << submlthick << "," << submlwidth << "," << submllength << endmsg; + } + + if (slay) { + slay = &(slay->add(*tempSLay1)); + } else { + slay = tempSLay1; + } + } // Loop over cutout steps } else { // Layer to be built as a boolean of boxes and trapezoids to represent cutouts if (verbose_multilayer) { @@ -176,12 +214,12 @@ GeoFullPhysVol* MultiLayer::build() double widthPos = cutoutXtubes[isub]; GeoTrf::Transform3D submlpos = GeoTrf::Translate3D(0.,widthPos,lengthPos); - const GeoTrd* tempSLay = NULL; - const GeoShape* tempSLay1 = NULL; - const GeoTrd* tempSFoamup = NULL; - const GeoShape* tempSFoamup1 = NULL; - const GeoTrd* tempSFoamlow = NULL; - const GeoShape* tempSFoamlow1 = NULL; + const GeoTrd* tempSLay = nullptr; + const GeoShape* tempSLay1 = nullptr; + const GeoTrd* tempSFoamup = nullptr; + const GeoShape* tempSFoamup1 = nullptr; + const GeoTrd* tempSFoamlow = nullptr; + const GeoShape* tempSFoamlow1 = nullptr; if (submlthick*submlwidthl*submllength > 0) { if (verbose_multilayer) { @@ -210,38 +248,40 @@ GeoFullPhysVol* MultiLayer::build() << endmsg; } - if (foamthicknessup > foamthicknesslow) { - if (foamthicknessup*submlwidths*submllength > 0) { - if (cutoutFullLength[isub]) { - tempSFoamup = new GeoTrd(foamthicknessup/2., foamthicknessup/2., - submlwidths, submlwidthl, submllength); + if (!(foamthicknessup==0 && foamthicknesslow==0)) { + if (foamthicknessup > foamthicknesslow) { + if (foamthicknessup*submlwidths*submllength > 0) { + if (cutoutFullLength[isub]) { + tempSFoamup = new GeoTrd(foamthicknessup/2., foamthicknessup/2., + submlwidths, submlwidthl, submllength); + } else { + tempSFoamup = new GeoTrd(foamthicknessup/2., foamthicknessup/2., + cutoutTubeLength[isub]/2., cutoutTubeLength[isub]/2., + submllength); + } + + tempSFoamup1 = &( (*tempSFoamup)<<submlpos); } else { - tempSFoamup = new GeoTrd(foamthicknessup/2., foamthicknessup/2., - cutoutTubeLength[isub]/2., cutoutTubeLength[isub]/2., - submllength); + log << MSG::INFO << " problem with shape of upper foam trapezoid in LogVolName " + << logVolName << " thick,width,length " << foamthicknessup + << " " << submlwidths << " " << submllength << endmsg; } - - tempSFoamup1 = &( (*tempSFoamup)<<submlpos); } else { - log << MSG::INFO << " problem with shape of upper foam trapezoid in LogVolName " - << logVolName << " thick,width,length " << foamthicknessup - << " " << submlwidths << " " << submllength << endmsg; - } - } else { - if (foamthicknesslow*submlwidths*submllength > 0) { - if (cutoutFullLength[isub]) { - tempSFoamlow = new GeoTrd(foamthicknesslow/2., foamthicknesslow/2., - submlwidths, submlwidthl, submllength); + if (foamthicknesslow*submlwidths*submllength > 0) { + if (cutoutFullLength[isub]) { + tempSFoamlow = new GeoTrd(foamthicknesslow/2., foamthicknesslow/2., + submlwidths, submlwidthl, submllength); + } else { + tempSFoamlow = new GeoTrd(foamthicknesslow/2., foamthicknesslow/2., + cutoutTubeLength[isub]/2., cutoutTubeLength[isub]/2., + submllength); + } + tempSFoamlow1 = &( (*tempSFoamlow)<<submlpos); } else { - tempSFoamlow = new GeoTrd(foamthicknesslow/2., foamthicknesslow/2., - cutoutTubeLength[isub]/2., cutoutTubeLength[isub]/2., - submllength); + log << MSG::INFO << " problem with shape of lower foam trapezoid in LogVolName " + << logVolName << " thick,width,length " << foamthicknesslow + << " " << submlwidths << " " << submllength << endmsg; } - tempSFoamlow1 = &( (*tempSFoamlow)<<submlpos); - } else { - log << MSG::INFO << " problem with shape of lower foam trapezoid in LogVolName " - << logVolName << " thick,width,length " << foamthicknesslow - << " " << submlwidths << " " << submllength << endmsg; } } @@ -272,12 +312,12 @@ GeoFullPhysVol* MultiLayer::build() // Add/subtract cylinders at ends of layers 2 and 4 to accommodate the last MDT - const GeoShape* stube = NULL; + const GeoShape* stube = nullptr; double tL = longWidth/2.0 - (tubePitch/2.)*TrdDwoverL; stube = new GeoTube(0.0, tubePitch/2., tL); stube = & ( (*stube) << GeoTrf::RotateX3D(90.*Gaudi::Units::deg) ); - const GeoShape* stubewithcut = NULL; - if (cutoutNsteps > 1) { + const GeoShape* stubewithcut = nullptr; + if (cutoutNsteps > 1 && !m_nonCutoutXSteps.size()) { // adaption of tube cuts only needed for cutouts along amdb-y double toptubelength = cutoutTubeLength[cutoutNsteps-1]; if (cutoutFullLength[cutoutNsteps-1]) toptubelength = longWidth; stubewithcut = new GeoTube(0.0, tubePitch/2., toptubelength/2.0); @@ -301,7 +341,7 @@ GeoFullPhysVol* MultiLayer::build() slay = &(slay->subtract( (*stube)<<GeoTrf::Translate3D(-mdtthickness/2.+yy[i],0.,-length/2.) )); // add tube at the end // distinguish stations with/without cutouts - if (cutoutNsteps == 1) { + if (cutoutNsteps == 1 || m_nonCutoutXSteps.size()) { // no cutouts if (verbose_multilayer) { log << MSG::VERBOSE @@ -309,7 +349,7 @@ GeoFullPhysVol* MultiLayer::build() << " z = " << length/2. << endmsg; } slay = &(slay->add( (*stube)<<GeoTrf::Translate3D(-mdtthickness/2.+yy[i],0.,length/2.-tubePitch/2.) )); - } else { + } else { // adaption of tube cuts only needed for cutouts along amdb-y // there are cutouts if (verbose_multilayer) { log << MSG::VERBOSE @@ -330,10 +370,10 @@ GeoFullPhysVol* MultiLayer::build() GeoFullPhysVol* play = new GeoFullPhysVol(llay); double foamposition = 0.; - const GeoShape* sfoam = NULL; - const GeoMaterial* mfoam = NULL; - GeoLogVol* lfoam = NULL; - GeoPhysVol* pfoam = NULL; + const GeoShape* sfoam = nullptr; + const GeoMaterial* mfoam = nullptr; + GeoLogVol* lfoam = nullptr; + GeoPhysVol* pfoam = nullptr; if (foamthicknesslow != 0) { foamposition = -(mdtthickness - foamthicknesslow)/2.; @@ -359,14 +399,16 @@ GeoFullPhysVol* MultiLayer::build() mfoam = getMaterialManager()->getMaterial("muo::Foam"); lfoam = new GeoLogVol("MultiLayerFoam", sfoam, mfoam); - } else if (logVolName == "BME1MDT09" || logVolName == "BME2MDT09") { - lfoam = 0; + } else if ( logVolName.find("MDT09") != std::string::npos || logVolName.find("MDT14") != std::string::npos ) { + // MDT09 is used for BME and BIS sMDTs, MDT14 is used for 2nd multilayer of BIS78 + // All those sMDTs have no foam layer + lfoam = nullptr; } else { log << MSG::ERROR << " no foam thickeness, while it was expected " << endmsg; throw std::runtime_error("ATTENTION: no foam"); } - if ( logVolName != "BME1MDT09" && logVolName != "BME2MDT09" ) { //@@ + if ( lfoam ) { //@@ pfoam = new GeoPhysVol(lfoam); GeoTransform* xf = new GeoTransform (GeoTrf::TranslateX3D(foamposition)); GeoNameTag* nt = new GeoNameTag(name+" MultiLayerFoam"); @@ -387,7 +429,7 @@ GeoFullPhysVol* MultiLayer::build() std::vector<int> Ntubes; // No cutouts - if (cutoutNsteps <= 1) { + if (cutoutNsteps <= 1 || m_nonCutoutXSteps.size()) { // adaption of tube cuts only needed for cutouts along amdb-y for (int j = 0; j < nrOfSteps; j++) { tube.length=width+j*diff/nrOfSteps; @@ -621,7 +663,7 @@ GeoFullPhysVol* MultiLayer::build() } } // Loop over layers - } else if (cutoutNsteps > 1) { + } else if (cutoutNsteps > 1 && !m_nonCutoutXSteps.size()) { // adaption of tube cuts only needed for cutouts along amdb-y bool arrowpointoutwards=false; bool cutAtAngle = cutoutAtAngle; if (xx[1]-xx[0]>0.) { diff --git a/MuonSpectrometer/MuonGeoModel/src/MuonChamber.cxx b/MuonSpectrometer/MuonGeoModel/src/MuonChamber.cxx index ae08912e1a3580e9f6c5c3473d6a21dbc0bcf014..090ba7f9c2d1618b5d400d7925a1b189a24838df 100755 --- a/MuonSpectrometer/MuonGeoModel/src/MuonChamber.cxx +++ b/MuonSpectrometer/MuonGeoModel/src/MuonChamber.cxx @@ -747,8 +747,8 @@ GeoVPhysVol* MuonChamber::build( std::string key=stName+techname; // for cutouts: - // MDT cutouts for BOS1,5, BMS7,14, (problem with BMS4,10), EMS - bool mdtCutoutFlag = ((stname == "BOS" && std::abs(zi) == 6) || stname == "BMG" || + // MDT cutouts for BOS1,5, BMS7,14, (problem with BMS4,10), EMS, BMG and BIS MDT14 + bool mdtCutoutFlag = ((stname == "BOS" && std::abs(zi) == 6) || stname == "BMG" || techname=="MDT14" || (stname == "BMS" && (std::abs(zi) == 1 && fi == 3)) || (stname == "EMS" && (std::abs(zi) == 1 || std::abs(zi) == 3))); if (((manager->IncludeCutoutsFlag() && mdtCutoutFlag) || @@ -1396,17 +1396,18 @@ GeoVPhysVol* MuonChamber::build( ndbz[doubletR-1]++; float zdivision=100.;// point between doubletZ=1 and 2; - if (stname.find("BI")!=std::string::npos && std::abs(zi)==7) zdivision=400.;//BIS78 : RPC8 is smaller than other RPCs - // do the following check for all RPCs but the BI (station1-6) ones - if (stname.find("BI")==std::string::npos || std::abs(zi)==7) { + // the BIS RPCs are 3-gap RPCs mounted inside of the BIS sMDTs, + // for BIS78, there is a second RPC doubletZ at amdb-y (MuonGeoModel-z)=144mm inside the station + if (stname.find("BI")!=std::string::npos) { + if (std::abs(stationPhi)>=7 && rp->posz>100) doubletZ=2; + else doubletZ = ndbz[doubletR-1]; + } else { if (zi <= 0 && !is_mirrored) { if (zpos < -zdivision*Gaudi::Units::mm) doubletZ=2; } else { if (zpos > zdivision*Gaudi::Units::mm) doubletZ=2; } - } else { - doubletZ = ndbz[doubletR-1]; } // BMS (BOG) RPCs can have |xpos|=950 (|xpos|=350) diff --git a/MuonSpectrometer/MuonGeoModel/src/sTGC.cxx b/MuonSpectrometer/MuonGeoModel/src/sTGC.cxx index 6741762fb40139e10f4d36498cffa4d35bc42897..b7b6a3a92fcb9e9c7c0f2cc6e9b29cfb54306f94 100755 --- a/MuonSpectrometer/MuonGeoModel/src/sTGC.cxx +++ b/MuonSpectrometer/MuonGeoModel/src/sTGC.cxx @@ -3,7 +3,10 @@ */ #include "MuonGeoModel/sTGC.h" + #include "MuonAGDDDescription/sTGC_Technology.h" +#include "MuonAGDDDescription/sTGCDetectorDescription.h" +#include "MuonAGDDDescription/sTGCDetectorHelper.h" #include "AGDDKernel/AGDDDetectorStore.h" #include "MuonGeoModel/Station.h" #include "MuonGeoModel/MYSQL.h" @@ -21,7 +24,6 @@ #include "GeoModelKernel/GeoTransform.h" #include "GeoModelKernel/GeoSerialIdentifier.h" #include "GeoModelKernel/GeoIdentifierTag.h" -// for cutouts: #include "GeoModelKernel/GeoShapeSubtraction.h" #include "GeoModelKernel/GeoShapeIntersection.h" #include "GeoModelKernel/GeoShapeShift.h" @@ -54,14 +56,17 @@ GeoFullPhysVol* sTGC::build(int minimalgeo) GeoFullPhysVol* sTGC::build(int minimalgeo, int , std::vector<Cutout*> ) { AGDDDetectorStore* ds = AGDDDetectorStore::GetDetectorStore(); + sTGCDetectorHelper stgcHelper; + sTGCDetectorDescription* stgc_descr = stgcHelper.Get_sTGCDetectorSubType(m_component->subType); sTGC_Technology* t = (sTGC_Technology*) ds->GetTechnology(name); thickness = t->Thickness(); double gasTck=t->gasThickness; double pcbTck=t->pcbThickness; - double f4=t->f4Thickness; - double f5=t->f5Thickness; - double f6=t->f6Thickness; + double f4=stgc_descr->ylFrame(); + double f5=stgc_descr->ysFrame(); + double f6=stgc_descr->xFrame(); + //Evaluate honeycomb thickness double chamberTck = gasTck+pcbTck; //Note: pcbTck is the xml value and is the combined thickness of 2 pcbs. double honeycombTck = (thickness - 4*chamberTck)/5; diff --git a/MuonSpectrometer/MuonGeoModelTest/MuonGeoModelTest/MuonHitRelocation.h b/MuonSpectrometer/MuonGeoModelTest/MuonGeoModelTest/MuonHitRelocation.h index 875880c81cb1dd6c85b548ca0b1c82f71250ad56..4920a33dcb32289d976d2f8238e8c0b305ebf462 100644 --- a/MuonSpectrometer/MuonGeoModelTest/MuonGeoModelTest/MuonHitRelocation.h +++ b/MuonSpectrometer/MuonGeoModelTest/MuonGeoModelTest/MuonHitRelocation.h @@ -7,6 +7,7 @@ #include "AthenaBaseComps/AthAlgorithm.h" #include "GaudiKernel/ServiceHandle.h" + #include "MuonSimEvent/MdtHitIdHelper.h" #include "MuonSimEvent/RpcHitIdHelper.h" #include "MuonSimEvent/TgcHitIdHelper.h" @@ -15,6 +16,8 @@ #include "MuonSimEvent/MicromegasHitIdHelper.h" #include "MuonIdHelpers/IMuonIdHelperSvc.h" +#include <string> + // Histograms quantities related to G4 Hits in the Atlas // Detector. Used to validate GeoModel + much more. diff --git a/MuonSpectrometer/MuonGeoModelTest/src/MuonHitRelocation.cxx b/MuonSpectrometer/MuonGeoModelTest/src/MuonHitRelocation.cxx index d6c7ad5c1b7781ee1bd0ea471037e16c599cddac..fcec4757a47e7b21a0ce6e999f66f636ccd0030d 100644 --- a/MuonSpectrometer/MuonGeoModelTest/src/MuonHitRelocation.cxx +++ b/MuonSpectrometer/MuonGeoModelTest/src/MuonHitRelocation.cxx @@ -3,7 +3,7 @@ */ #include "MuonGeoModelTest/MuonHitRelocation.h" -#include "GaudiKernel/MsgStream.h" + #include "GaudiKernel/NTuple.h" #include "GaudiKernel/INTupleSvc.h" #include "GaudiKernel/SmartDataPtr.h" @@ -19,12 +19,8 @@ #include "MuonSimEvent/RPCSimHit.h" #include "MuonSimEvent/TGCSimHit.h" #include "MuonSimEvent/CSCSimHit.h" - #include "GeoAdaptors/GeoMuonHits.h" - -#include <string> - class MuonHitRelocation::Clockwork { public: @@ -134,7 +130,7 @@ StatusCode MuonHitRelocation::initialize(){ m_cmuonHelper = CscHitIdHelper::GetHelper(); m_rmuonHelper = RpcHitIdHelper::GetHelper(m_idHelperSvc->rpcIdHelper().gasGapMax()); m_tmuonHelper = TgcHitIdHelper::GetHelper(); - m_mmuonHelper = MdtHitIdHelper::GetHelper(); + m_mmuonHelper = MdtHitIdHelper::GetHelper(m_idHelperSvc->mdtIdHelper().tubeMax()); return StatusCode::SUCCESS; } diff --git a/MuonSpectrometer/MuonIdHelpers/MuonIdHelpers/MdtIdHelper.h b/MuonSpectrometer/MuonIdHelpers/MuonIdHelpers/MdtIdHelper.h index ec318ddf578ed6515b25f5bf5456347d6a029028..89647084a44557c81c81061f279744f771da8848 100644 --- a/MuonSpectrometer/MuonIdHelpers/MuonIdHelpers/MdtIdHelper.h +++ b/MuonSpectrometer/MuonIdHelpers/MuonIdHelpers/MdtIdHelper.h @@ -69,7 +69,7 @@ class MdtIdHelper : public MuonIdHelper // Destructor - virtual ~MdtIdHelper(); + virtual ~MdtIdHelper()=default; ////////////// compact identifier stuff begins ////////////////////////////////////// @@ -198,6 +198,7 @@ class MdtIdHelper : public MuonIdHelper TubeMin = 1, TubeMax = 78 }; + unsigned int m_tubesMax; // maximum number of tubes in any chamber }; // For backwards compatibility @@ -430,7 +431,7 @@ inline int MdtIdHelper::tubeMin() const inline int MdtIdHelper::tubeMax() const { - return TubeMax; + return m_tubesMax; } /// Utility methods diff --git a/MuonSpectrometer/MuonIdHelpers/share/muon_id_test.ref b/MuonSpectrometer/MuonIdHelpers/share/muon_id_test.ref index 91e3a621d34314237180d92462a91ac5c48bc9b2..e3b438e25cd32988cb14343dd62e256a1a701df9 100644 --- a/MuonSpectrometer/MuonIdHelpers/share/muon_id_test.ref +++ b/MuonSpectrometer/MuonIdHelpers/share/muon_id_test.ref @@ -440,6 +440,7 @@ MdtIdHelper INFO The element hash max is 1188 MdtIdHelper INFO The detector element hash max is 2328 MdtIdHelper INFO Initializing MDT hash indices for finding neighbors ... MdtIdHelper VERBOSE MuonIdHelper::init_neighbors +MdtIdHelper DEBUG Maximum number of MDT tubes is 78 RpcIdHelper DEBUG (Re)initialize AtlasDetectorIDHelper::initialize_from_dictionary - Warning: unable to find mm region index: group, region size 0 0 AtlasDetectorIDHelper::initialize_from_dictionary - Warning: unable to find stgc region index: group, region size 0 0 @@ -774,7 +775,7 @@ CscIdHelper INFO The detector element hash max is 64 CscIdHelper INFO The channel hash max is 61440 CscIdHelper INFO Initializing CSC hash indices for finding neighbors ... CscIdHelper VERBOSE MuonIdHelper::init_neighbors -=========> checking dictionnary file=IdDictMuonSpectrometer_R.09.AsymNSW.xml +=========> checking dictionnary file=IdDictMuonSpectrometer_R.09.02.Asym.xml MdtIdHelper DEBUG (Re)initialize AtlasDetectorID DEBUG Could not get value for label 'no_side' of field 'DetZside' in dictionary Calorimeter AtlasDetectorID::initialize_from_dictionary - OK @@ -786,10 +787,10 @@ MdtIdHelper DEBUG phi decode 1 vals 1:8 mask/zero m MdtIdHelper DEBUG technology decode 1 vals 0,2 mask/zero mask/shift/bits/offset 1 ffffbfffffffffff 46 1 17 indexes 0 0 1 mode enumerated MdtIdHelper DEBUG multilayer decode 1 vals 1:2 mask/zero mask/shift/bits/offset 1 ffffdfffffffffff 45 1 18 indexes mode both_bounded MdtIdHelper DEBUG layer decode 1 vals 1:4 mask/zero mask/shift/bits/offset 3 ffffe7ffffffffff 43 2 19 indexes mode both_bounded -MdtIdHelper DEBUG tube decode 1 vals 1:78 mask/zero mask/shift/bits/offset 7f fffff80fffffffff 36 7 21 indexes mode both_bounded -MdtIdHelper INFO MultiRange built successfully to Technology: MultiRange size is 216 -MdtIdHelper INFO MultiRange built successfully to detector element: Multilayer MultiRange size is 257 -MdtIdHelper INFO MultiRange built successfully to tube: MultiRange size is 257 +MdtIdHelper DEBUG tube decode 1 vals 1:110 mask/zero mask/shift/bits/offset 7f fffff80fffffffff 36 7 21 indexes mode both_bounded +MdtIdHelper INFO MultiRange built successfully to Technology: MultiRange size is 218 +MdtIdHelper INFO MultiRange built successfully to detector element: Multilayer MultiRange size is 259 +MdtIdHelper INFO MultiRange built successfully to tube: MultiRange size is 259 MdtIdHelper DEBUG module field size is 5 field index = 0 MdtIdHelper DEBUG module field size is 1 field index = 1 MdtIdHelper DEBUG module field size is 4 field index = 2 @@ -820,83 +821,83 @@ MdtIdHelper DEBUG module field size is 16 field index = 26 MdtIdHelper DEBUG module field size is 16 field index = 27 MdtIdHelper DEBUG module field size is 16 field index = 28 MdtIdHelper DEBUG module field size is 16 field index = 29 -MdtIdHelper DEBUG module field size is 10 field index = 30 -MdtIdHelper DEBUG module field size is 6 field index = 31 -MdtIdHelper DEBUG module field size is 16 field index = 32 -MdtIdHelper DEBUG module field size is 16 field index = 33 +MdtIdHelper DEBUG module field size is 5 field index = 30 +MdtIdHelper DEBUG module field size is 3 field index = 31 +MdtIdHelper DEBUG module field size is 8 field index = 32 +MdtIdHelper DEBUG module field size is 8 field index = 33 MdtIdHelper DEBUG module field size is 16 field index = 34 -MdtIdHelper DEBUG module field size is 1 field index = 35 +MdtIdHelper DEBUG module field size is 16 field index = 35 MdtIdHelper DEBUG module field size is 1 field index = 36 MdtIdHelper DEBUG module field size is 1 field index = 37 MdtIdHelper DEBUG module field size is 1 field index = 38 -MdtIdHelper DEBUG module field size is 2 field index = 39 +MdtIdHelper DEBUG module field size is 1 field index = 39 MdtIdHelper DEBUG module field size is 2 field index = 40 -MdtIdHelper DEBUG module field size is 1 field index = 41 -MdtIdHelper DEBUG module field size is 4 field index = 42 -MdtIdHelper DEBUG module field size is 2 field index = 43 -MdtIdHelper DEBUG module field size is 1 field index = 44 -MdtIdHelper DEBUG module field size is 32 field index = 45 -MdtIdHelper DEBUG module field size is 16 field index = 46 -MdtIdHelper DEBUG module field size is 14 field index = 47 -MdtIdHelper DEBUG module field size is 2 field index = 48 -MdtIdHelper DEBUG module field size is 14 field index = 49 -MdtIdHelper DEBUG module field size is 2 field index = 50 -MdtIdHelper DEBUG module field size is 12 field index = 51 +MdtIdHelper DEBUG module field size is 2 field index = 41 +MdtIdHelper DEBUG module field size is 1 field index = 42 +MdtIdHelper DEBUG module field size is 4 field index = 43 +MdtIdHelper DEBUG module field size is 2 field index = 44 +MdtIdHelper DEBUG module field size is 1 field index = 45 +MdtIdHelper DEBUG module field size is 32 field index = 46 +MdtIdHelper DEBUG module field size is 16 field index = 47 +MdtIdHelper DEBUG module field size is 14 field index = 48 +MdtIdHelper DEBUG module field size is 2 field index = 49 +MdtIdHelper DEBUG module field size is 14 field index = 50 +MdtIdHelper DEBUG module field size is 2 field index = 51 MdtIdHelper DEBUG module field size is 12 field index = 52 MdtIdHelper DEBUG module field size is 12 field index = 53 MdtIdHelper DEBUG module field size is 12 field index = 54 MdtIdHelper DEBUG module field size is 12 field index = 55 MdtIdHelper DEBUG module field size is 12 field index = 56 -MdtIdHelper DEBUG module field size is 4 field index = 57 +MdtIdHelper DEBUG module field size is 12 field index = 57 MdtIdHelper DEBUG module field size is 4 field index = 58 MdtIdHelper DEBUG module field size is 4 field index = 59 -MdtIdHelper DEBUG module field size is 2 field index = 60 -MdtIdHelper DEBUG module field size is 1 field index = 61 -MdtIdHelper DEBUG module field size is 2 field index = 62 -MdtIdHelper DEBUG module field size is 1 field index = 63 -MdtIdHelper DEBUG module field size is 3 field index = 64 -MdtIdHelper DEBUG module field size is 2 field index = 65 -MdtIdHelper DEBUG module field size is 3 field index = 66 -MdtIdHelper DEBUG module field size is 1 field index = 67 +MdtIdHelper DEBUG module field size is 4 field index = 60 +MdtIdHelper DEBUG module field size is 2 field index = 61 +MdtIdHelper DEBUG module field size is 1 field index = 62 +MdtIdHelper DEBUG module field size is 2 field index = 63 +MdtIdHelper DEBUG module field size is 1 field index = 64 +MdtIdHelper DEBUG module field size is 3 field index = 65 +MdtIdHelper DEBUG module field size is 2 field index = 66 +MdtIdHelper DEBUG module field size is 3 field index = 67 MdtIdHelper DEBUG module field size is 1 field index = 68 -MdtIdHelper DEBUG module field size is 7 field index = 69 -MdtIdHelper DEBUG module field size is 6 field index = 70 -MdtIdHelper DEBUG module field size is 2 field index = 71 -MdtIdHelper DEBUG module field size is 1 field index = 72 -MdtIdHelper DEBUG module field size is 14 field index = 73 -MdtIdHelper DEBUG module field size is 2 field index = 74 -MdtIdHelper DEBUG module field size is 16 field index = 75 +MdtIdHelper DEBUG module field size is 1 field index = 69 +MdtIdHelper DEBUG module field size is 7 field index = 70 +MdtIdHelper DEBUG module field size is 6 field index = 71 +MdtIdHelper DEBUG module field size is 2 field index = 72 +MdtIdHelper DEBUG module field size is 1 field index = 73 +MdtIdHelper DEBUG module field size is 14 field index = 74 +MdtIdHelper DEBUG module field size is 2 field index = 75 MdtIdHelper DEBUG module field size is 16 field index = 76 MdtIdHelper DEBUG module field size is 16 field index = 77 -MdtIdHelper DEBUG module field size is 10 field index = 78 -MdtIdHelper DEBUG module field size is 2 field index = 79 -MdtIdHelper DEBUG module field size is 12 field index = 80 +MdtIdHelper DEBUG module field size is 16 field index = 78 +MdtIdHelper DEBUG module field size is 10 field index = 79 +MdtIdHelper DEBUG module field size is 2 field index = 80 MdtIdHelper DEBUG module field size is 12 field index = 81 MdtIdHelper DEBUG module field size is 12 field index = 82 MdtIdHelper DEBUG module field size is 12 field index = 83 MdtIdHelper DEBUG module field size is 12 field index = 84 -MdtIdHelper DEBUG module field size is 4 field index = 85 +MdtIdHelper DEBUG module field size is 12 field index = 85 MdtIdHelper DEBUG module field size is 4 field index = 86 MdtIdHelper DEBUG module field size is 4 field index = 87 MdtIdHelper DEBUG module field size is 4 field index = 88 -MdtIdHelper DEBUG module field size is 2 field index = 89 -MdtIdHelper DEBUG module field size is 4 field index = 90 +MdtIdHelper DEBUG module field size is 4 field index = 89 +MdtIdHelper DEBUG module field size is 2 field index = 90 MdtIdHelper DEBUG module field size is 4 field index = 91 MdtIdHelper DEBUG module field size is 4 field index = 92 MdtIdHelper DEBUG module field size is 4 field index = 93 -MdtIdHelper DEBUG module field size is 8 field index = 94 +MdtIdHelper DEBUG module field size is 4 field index = 94 MdtIdHelper DEBUG module field size is 8 field index = 95 MdtIdHelper DEBUG module field size is 8 field index = 96 -MdtIdHelper DEBUG module field size is 4 field index = 97 -MdtIdHelper DEBUG module field size is 8 field index = 98 -MdtIdHelper DEBUG module field size is 4 field index = 99 +MdtIdHelper DEBUG module field size is 8 field index = 97 +MdtIdHelper DEBUG module field size is 4 field index = 98 +MdtIdHelper DEBUG module field size is 8 field index = 99 MdtIdHelper DEBUG module field size is 4 field index = 100 -MdtIdHelper DEBUG module field size is 8 field index = 101 +MdtIdHelper DEBUG module field size is 4 field index = 101 MdtIdHelper DEBUG module field size is 8 field index = 102 -MdtIdHelper DEBUG module field size is 14 field index = 103 +MdtIdHelper DEBUG module field size is 8 field index = 103 MdtIdHelper DEBUG module field size is 14 field index = 104 -MdtIdHelper DEBUG module field size is 2 field index = 105 -MdtIdHelper DEBUG module field size is 16 field index = 106 +MdtIdHelper DEBUG module field size is 14 field index = 105 +MdtIdHelper DEBUG module field size is 2 field index = 106 MdtIdHelper DEBUG module field size is 16 field index = 107 MdtIdHelper DEBUG module field size is 16 field index = 108 MdtIdHelper DEBUG module field size is 16 field index = 109 @@ -920,11 +921,12 @@ MdtIdHelper DEBUG module field size is 16 field index = 126 MdtIdHelper DEBUG module field size is 16 field index = 127 MdtIdHelper DEBUG module field size is 16 field index = 128 MdtIdHelper DEBUG module field size is 16 field index = 129 -MdtIdHelper DEBUG module field size is 2 field index = 130 +MdtIdHelper DEBUG module field size is 16 field index = 130 MdtIdHelper DEBUG module field size is 2 field index = 131 -MdtIdHelper DEBUG module field size is 4 field index = 132 +MdtIdHelper DEBUG module field size is 2 field index = 132 MdtIdHelper DEBUG module field size is 4 field index = 133 MdtIdHelper DEBUG module field size is 4 field index = 134 +MdtIdHelper DEBUG module field size is 4 field index = 135 MdtIdHelper DEBUG detector element field size is 10 field index = 0 MdtIdHelper DEBUG detector element field size is 2 field index = 1 MdtIdHelper DEBUG detector element field size is 8 field index = 2 @@ -959,85 +961,85 @@ MdtIdHelper DEBUG detector element field size is 32 field index = 30 MdtIdHelper DEBUG detector element field size is 32 field index = 31 MdtIdHelper DEBUG detector element field size is 32 field index = 32 MdtIdHelper DEBUG detector element field size is 32 field index = 33 -MdtIdHelper DEBUG detector element field size is 20 field index = 34 -MdtIdHelper DEBUG detector element field size is 12 field index = 35 -MdtIdHelper DEBUG detector element field size is 16 field index = 36 +MdtIdHelper DEBUG detector element field size is 10 field index = 34 +MdtIdHelper DEBUG detector element field size is 6 field index = 35 +MdtIdHelper DEBUG detector element field size is 8 field index = 36 MdtIdHelper DEBUG detector element field size is 16 field index = 37 MdtIdHelper DEBUG detector element field size is 16 field index = 38 -MdtIdHelper DEBUG detector element field size is 2 field index = 39 +MdtIdHelper DEBUG detector element field size is 16 field index = 39 MdtIdHelper DEBUG detector element field size is 2 field index = 40 MdtIdHelper DEBUG detector element field size is 2 field index = 41 MdtIdHelper DEBUG detector element field size is 2 field index = 42 -MdtIdHelper DEBUG detector element field size is 4 field index = 43 +MdtIdHelper DEBUG detector element field size is 2 field index = 43 MdtIdHelper DEBUG detector element field size is 4 field index = 44 -MdtIdHelper DEBUG detector element field size is 2 field index = 45 -MdtIdHelper DEBUG detector element field size is 8 field index = 46 -MdtIdHelper DEBUG detector element field size is 4 field index = 47 -MdtIdHelper DEBUG detector element field size is 2 field index = 48 -MdtIdHelper DEBUG detector element field size is 64 field index = 49 -MdtIdHelper DEBUG detector element field size is 32 field index = 50 -MdtIdHelper DEBUG detector element field size is 28 field index = 51 -MdtIdHelper DEBUG detector element field size is 4 field index = 52 -MdtIdHelper DEBUG detector element field size is 28 field index = 53 -MdtIdHelper DEBUG detector element field size is 4 field index = 54 -MdtIdHelper DEBUG detector element field size is 24 field index = 55 +MdtIdHelper DEBUG detector element field size is 4 field index = 45 +MdtIdHelper DEBUG detector element field size is 2 field index = 46 +MdtIdHelper DEBUG detector element field size is 8 field index = 47 +MdtIdHelper DEBUG detector element field size is 4 field index = 48 +MdtIdHelper DEBUG detector element field size is 2 field index = 49 +MdtIdHelper DEBUG detector element field size is 64 field index = 50 +MdtIdHelper DEBUG detector element field size is 32 field index = 51 +MdtIdHelper DEBUG detector element field size is 28 field index = 52 +MdtIdHelper DEBUG detector element field size is 4 field index = 53 +MdtIdHelper DEBUG detector element field size is 28 field index = 54 +MdtIdHelper DEBUG detector element field size is 4 field index = 55 MdtIdHelper DEBUG detector element field size is 24 field index = 56 MdtIdHelper DEBUG detector element field size is 24 field index = 57 -MdtIdHelper DEBUG detector element field size is 12 field index = 58 +MdtIdHelper DEBUG detector element field size is 24 field index = 58 MdtIdHelper DEBUG detector element field size is 12 field index = 59 -MdtIdHelper DEBUG detector element field size is 24 field index = 60 -MdtIdHelper DEBUG detector element field size is 12 field index = 61 +MdtIdHelper DEBUG detector element field size is 12 field index = 60 +MdtIdHelper DEBUG detector element field size is 24 field index = 61 MdtIdHelper DEBUG detector element field size is 12 field index = 62 -MdtIdHelper DEBUG detector element field size is 8 field index = 63 +MdtIdHelper DEBUG detector element field size is 12 field index = 63 MdtIdHelper DEBUG detector element field size is 8 field index = 64 MdtIdHelper DEBUG detector element field size is 8 field index = 65 -MdtIdHelper DEBUG detector element field size is 4 field index = 66 -MdtIdHelper DEBUG detector element field size is 2 field index = 67 -MdtIdHelper DEBUG detector element field size is 4 field index = 68 -MdtIdHelper DEBUG detector element field size is 2 field index = 69 -MdtIdHelper DEBUG detector element field size is 6 field index = 70 -MdtIdHelper DEBUG detector element field size is 4 field index = 71 -MdtIdHelper DEBUG detector element field size is 6 field index = 72 -MdtIdHelper DEBUG detector element field size is 2 field index = 73 +MdtIdHelper DEBUG detector element field size is 8 field index = 66 +MdtIdHelper DEBUG detector element field size is 4 field index = 67 +MdtIdHelper DEBUG detector element field size is 2 field index = 68 +MdtIdHelper DEBUG detector element field size is 4 field index = 69 +MdtIdHelper DEBUG detector element field size is 2 field index = 70 +MdtIdHelper DEBUG detector element field size is 6 field index = 71 +MdtIdHelper DEBUG detector element field size is 4 field index = 72 +MdtIdHelper DEBUG detector element field size is 6 field index = 73 MdtIdHelper DEBUG detector element field size is 2 field index = 74 -MdtIdHelper DEBUG detector element field size is 14 field index = 75 -MdtIdHelper DEBUG detector element field size is 12 field index = 76 -MdtIdHelper DEBUG detector element field size is 4 field index = 77 -MdtIdHelper DEBUG detector element field size is 2 field index = 78 -MdtIdHelper DEBUG detector element field size is 28 field index = 79 -MdtIdHelper DEBUG detector element field size is 4 field index = 80 -MdtIdHelper DEBUG detector element field size is 32 field index = 81 +MdtIdHelper DEBUG detector element field size is 2 field index = 75 +MdtIdHelper DEBUG detector element field size is 14 field index = 76 +MdtIdHelper DEBUG detector element field size is 12 field index = 77 +MdtIdHelper DEBUG detector element field size is 4 field index = 78 +MdtIdHelper DEBUG detector element field size is 2 field index = 79 +MdtIdHelper DEBUG detector element field size is 28 field index = 80 +MdtIdHelper DEBUG detector element field size is 4 field index = 81 MdtIdHelper DEBUG detector element field size is 32 field index = 82 MdtIdHelper DEBUG detector element field size is 32 field index = 83 -MdtIdHelper DEBUG detector element field size is 20 field index = 84 -MdtIdHelper DEBUG detector element field size is 4 field index = 85 -MdtIdHelper DEBUG detector element field size is 24 field index = 86 +MdtIdHelper DEBUG detector element field size is 32 field index = 84 +MdtIdHelper DEBUG detector element field size is 20 field index = 85 +MdtIdHelper DEBUG detector element field size is 4 field index = 86 MdtIdHelper DEBUG detector element field size is 24 field index = 87 MdtIdHelper DEBUG detector element field size is 24 field index = 88 MdtIdHelper DEBUG detector element field size is 24 field index = 89 MdtIdHelper DEBUG detector element field size is 24 field index = 90 -MdtIdHelper DEBUG detector element field size is 8 field index = 91 +MdtIdHelper DEBUG detector element field size is 24 field index = 91 MdtIdHelper DEBUG detector element field size is 8 field index = 92 MdtIdHelper DEBUG detector element field size is 8 field index = 93 MdtIdHelper DEBUG detector element field size is 8 field index = 94 -MdtIdHelper DEBUG detector element field size is 4 field index = 95 -MdtIdHelper DEBUG detector element field size is 8 field index = 96 +MdtIdHelper DEBUG detector element field size is 8 field index = 95 +MdtIdHelper DEBUG detector element field size is 4 field index = 96 MdtIdHelper DEBUG detector element field size is 8 field index = 97 MdtIdHelper DEBUG detector element field size is 8 field index = 98 MdtIdHelper DEBUG detector element field size is 8 field index = 99 -MdtIdHelper DEBUG detector element field size is 16 field index = 100 +MdtIdHelper DEBUG detector element field size is 8 field index = 100 MdtIdHelper DEBUG detector element field size is 16 field index = 101 MdtIdHelper DEBUG detector element field size is 16 field index = 102 -MdtIdHelper DEBUG detector element field size is 8 field index = 103 -MdtIdHelper DEBUG detector element field size is 16 field index = 104 -MdtIdHelper DEBUG detector element field size is 8 field index = 105 +MdtIdHelper DEBUG detector element field size is 16 field index = 103 +MdtIdHelper DEBUG detector element field size is 8 field index = 104 +MdtIdHelper DEBUG detector element field size is 16 field index = 105 MdtIdHelper DEBUG detector element field size is 8 field index = 106 -MdtIdHelper DEBUG detector element field size is 16 field index = 107 +MdtIdHelper DEBUG detector element field size is 8 field index = 107 MdtIdHelper DEBUG detector element field size is 16 field index = 108 -MdtIdHelper DEBUG detector element field size is 28 field index = 109 +MdtIdHelper DEBUG detector element field size is 16 field index = 109 MdtIdHelper DEBUG detector element field size is 28 field index = 110 -MdtIdHelper DEBUG detector element field size is 4 field index = 111 -MdtIdHelper DEBUG detector element field size is 32 field index = 112 +MdtIdHelper DEBUG detector element field size is 28 field index = 111 +MdtIdHelper DEBUG detector element field size is 4 field index = 112 MdtIdHelper DEBUG detector element field size is 32 field index = 113 MdtIdHelper DEBUG detector element field size is 32 field index = 114 MdtIdHelper DEBUG detector element field size is 32 field index = 115 @@ -1061,11 +1063,12 @@ MdtIdHelper DEBUG detector element field size is 32 field index = 132 MdtIdHelper DEBUG detector element field size is 32 field index = 133 MdtIdHelper DEBUG detector element field size is 32 field index = 134 MdtIdHelper DEBUG detector element field size is 32 field index = 135 -MdtIdHelper DEBUG detector element field size is 4 field index = 136 +MdtIdHelper DEBUG detector element field size is 32 field index = 136 MdtIdHelper DEBUG detector element field size is 4 field index = 137 -MdtIdHelper DEBUG detector element field size is 8 field index = 138 +MdtIdHelper DEBUG detector element field size is 4 field index = 138 MdtIdHelper DEBUG detector element field size is 8 field index = 139 MdtIdHelper DEBUG detector element field size is 8 field index = 140 +MdtIdHelper DEBUG detector element field size is 8 field index = 141 MdtIdHelper DEBUG channel field size is 1200 field index = 0 MdtIdHelper DEBUG channel field size is 192 field index = 1 MdtIdHelper DEBUG channel field size is 960 field index = 2 @@ -1100,88 +1103,88 @@ MdtIdHelper DEBUG channel field size is 3840 field index = 30 MdtIdHelper DEBUG channel field size is 3840 field index = 31 MdtIdHelper DEBUG channel field size is 3840 field index = 32 MdtIdHelper DEBUG channel field size is 3840 field index = 33 -MdtIdHelper DEBUG channel field size is 2400 field index = 34 -MdtIdHelper DEBUG channel field size is 1728 field index = 35 -MdtIdHelper DEBUG channel field size is 768 field index = 36 -MdtIdHelper DEBUG channel field size is 3072 field index = 37 +MdtIdHelper DEBUG channel field size is 1200 field index = 34 +MdtIdHelper DEBUG channel field size is 864 field index = 35 +MdtIdHelper DEBUG channel field size is 384 field index = 36 +MdtIdHelper DEBUG channel field size is 7040 field index = 37 MdtIdHelper DEBUG channel field size is 3072 field index = 38 -MdtIdHelper DEBUG channel field size is 192 field index = 39 -MdtIdHelper DEBUG channel field size is 288 field index = 40 -MdtIdHelper DEBUG channel field size is 240 field index = 41 -MdtIdHelper DEBUG channel field size is 336 field index = 42 -MdtIdHelper DEBUG channel field size is 672 field index = 43 -MdtIdHelper DEBUG channel field size is 576 field index = 44 -MdtIdHelper DEBUG channel field size is 288 field index = 45 -MdtIdHelper DEBUG channel field size is 960 field index = 46 -MdtIdHelper DEBUG channel field size is 384 field index = 47 -MdtIdHelper DEBUG channel field size is 192 field index = 48 -MdtIdHelper DEBUG channel field size is 10752 field index = 49 -MdtIdHelper DEBUG channel field size is 3840 field index = 50 -MdtIdHelper DEBUG channel field size is 3360 field index = 51 -MdtIdHelper DEBUG channel field size is 576 field index = 52 -MdtIdHelper DEBUG channel field size is 4032 field index = 53 -MdtIdHelper DEBUG channel field size is 192 field index = 54 -MdtIdHelper DEBUG channel field size is 4032 field index = 55 -MdtIdHelper DEBUG channel field size is 3456 field index = 56 +MdtIdHelper DEBUG channel field size is 3072 field index = 39 +MdtIdHelper DEBUG channel field size is 192 field index = 40 +MdtIdHelper DEBUG channel field size is 288 field index = 41 +MdtIdHelper DEBUG channel field size is 240 field index = 42 +MdtIdHelper DEBUG channel field size is 336 field index = 43 +MdtIdHelper DEBUG channel field size is 672 field index = 44 +MdtIdHelper DEBUG channel field size is 576 field index = 45 +MdtIdHelper DEBUG channel field size is 288 field index = 46 +MdtIdHelper DEBUG channel field size is 960 field index = 47 +MdtIdHelper DEBUG channel field size is 384 field index = 48 +MdtIdHelper DEBUG channel field size is 192 field index = 49 +MdtIdHelper DEBUG channel field size is 10752 field index = 50 +MdtIdHelper DEBUG channel field size is 3840 field index = 51 +MdtIdHelper DEBUG channel field size is 3360 field index = 52 +MdtIdHelper DEBUG channel field size is 576 field index = 53 +MdtIdHelper DEBUG channel field size is 4032 field index = 54 +MdtIdHelper DEBUG channel field size is 192 field index = 55 +MdtIdHelper DEBUG channel field size is 4032 field index = 56 MdtIdHelper DEBUG channel field size is 3456 field index = 57 -MdtIdHelper DEBUG channel field size is 1440 field index = 58 -MdtIdHelper DEBUG channel field size is 1728 field index = 59 -MdtIdHelper DEBUG channel field size is 2304 field index = 60 -MdtIdHelper DEBUG channel field size is 1440 field index = 61 -MdtIdHelper DEBUG channel field size is 1728 field index = 62 +MdtIdHelper DEBUG channel field size is 3456 field index = 58 +MdtIdHelper DEBUG channel field size is 1440 field index = 59 +MdtIdHelper DEBUG channel field size is 1728 field index = 60 +MdtIdHelper DEBUG channel field size is 2304 field index = 61 +MdtIdHelper DEBUG channel field size is 1440 field index = 62 MdtIdHelper DEBUG channel field size is 1728 field index = 63 -MdtIdHelper DEBUG channel field size is 1536 field index = 64 -MdtIdHelper DEBUG channel field size is 1152 field index = 65 -MdtIdHelper DEBUG channel field size is 864 field index = 66 -MdtIdHelper DEBUG channel field size is 384 field index = 67 -MdtIdHelper DEBUG channel field size is 576 field index = 68 -MdtIdHelper DEBUG channel field size is 288 field index = 69 -MdtIdHelper DEBUG channel field size is 1008 field index = 70 -MdtIdHelper DEBUG channel field size is 672 field index = 71 -MdtIdHelper DEBUG channel field size is 864 field index = 72 -MdtIdHelper DEBUG channel field size is 336 field index = 73 -MdtIdHelper DEBUG channel field size is 432 field index = 74 -MdtIdHelper DEBUG channel field size is 3024 field index = 75 -MdtIdHelper DEBUG channel field size is 2592 field index = 76 -MdtIdHelper DEBUG channel field size is 576 field index = 77 -MdtIdHelper DEBUG channel field size is 288 field index = 78 -MdtIdHelper DEBUG channel field size is 4704 field index = 79 -MdtIdHelper DEBUG channel field size is 576 field index = 80 -MdtIdHelper DEBUG channel field size is 6912 field index = 81 +MdtIdHelper DEBUG channel field size is 1728 field index = 64 +MdtIdHelper DEBUG channel field size is 1536 field index = 65 +MdtIdHelper DEBUG channel field size is 1152 field index = 66 +MdtIdHelper DEBUG channel field size is 864 field index = 67 +MdtIdHelper DEBUG channel field size is 384 field index = 68 +MdtIdHelper DEBUG channel field size is 576 field index = 69 +MdtIdHelper DEBUG channel field size is 288 field index = 70 +MdtIdHelper DEBUG channel field size is 1008 field index = 71 +MdtIdHelper DEBUG channel field size is 672 field index = 72 +MdtIdHelper DEBUG channel field size is 864 field index = 73 +MdtIdHelper DEBUG channel field size is 336 field index = 74 +MdtIdHelper DEBUG channel field size is 432 field index = 75 +MdtIdHelper DEBUG channel field size is 3024 field index = 76 +MdtIdHelper DEBUG channel field size is 2592 field index = 77 +MdtIdHelper DEBUG channel field size is 576 field index = 78 +MdtIdHelper DEBUG channel field size is 288 field index = 79 +MdtIdHelper DEBUG channel field size is 4704 field index = 80 +MdtIdHelper DEBUG channel field size is 576 field index = 81 MdtIdHelper DEBUG channel field size is 6912 field index = 82 -MdtIdHelper DEBUG channel field size is 5376 field index = 83 -MdtIdHelper DEBUG channel field size is 4320 field index = 84 -MdtIdHelper DEBUG channel field size is 576 field index = 85 -MdtIdHelper DEBUG channel field size is 5184 field index = 86 +MdtIdHelper DEBUG channel field size is 6912 field index = 83 +MdtIdHelper DEBUG channel field size is 5376 field index = 84 +MdtIdHelper DEBUG channel field size is 4320 field index = 85 +MdtIdHelper DEBUG channel field size is 576 field index = 86 MdtIdHelper DEBUG channel field size is 5184 field index = 87 MdtIdHelper DEBUG channel field size is 5184 field index = 88 MdtIdHelper DEBUG channel field size is 5184 field index = 89 -MdtIdHelper DEBUG channel field size is 4608 field index = 90 -MdtIdHelper DEBUG channel field size is 1728 field index = 91 -MdtIdHelper DEBUG channel field size is 1536 field index = 92 -MdtIdHelper DEBUG channel field size is 1152 field index = 93 -MdtIdHelper DEBUG channel field size is 960 field index = 94 -MdtIdHelper DEBUG channel field size is 480 field index = 95 -MdtIdHelper DEBUG channel field size is 960 field index = 96 +MdtIdHelper DEBUG channel field size is 5184 field index = 90 +MdtIdHelper DEBUG channel field size is 4608 field index = 91 +MdtIdHelper DEBUG channel field size is 1728 field index = 92 +MdtIdHelper DEBUG channel field size is 1536 field index = 93 +MdtIdHelper DEBUG channel field size is 1152 field index = 94 +MdtIdHelper DEBUG channel field size is 960 field index = 95 +MdtIdHelper DEBUG channel field size is 480 field index = 96 MdtIdHelper DEBUG channel field size is 960 field index = 97 MdtIdHelper DEBUG channel field size is 960 field index = 98 MdtIdHelper DEBUG channel field size is 960 field index = 99 -MdtIdHelper DEBUG channel field size is 2304 field index = 100 +MdtIdHelper DEBUG channel field size is 960 field index = 100 MdtIdHelper DEBUG channel field size is 2304 field index = 101 -MdtIdHelper DEBUG channel field size is 768 field index = 102 -MdtIdHelper DEBUG channel field size is 384 field index = 103 -MdtIdHelper DEBUG channel field size is 3456 field index = 104 -MdtIdHelper DEBUG channel field size is 1344 field index = 105 +MdtIdHelper DEBUG channel field size is 2304 field index = 102 +MdtIdHelper DEBUG channel field size is 768 field index = 103 +MdtIdHelper DEBUG channel field size is 384 field index = 104 +MdtIdHelper DEBUG channel field size is 3456 field index = 105 MdtIdHelper DEBUG channel field size is 1344 field index = 106 -MdtIdHelper DEBUG channel field size is 2688 field index = 107 -MdtIdHelper DEBUG channel field size is 2304 field index = 108 -MdtIdHelper DEBUG channel field size is 3360 field index = 109 +MdtIdHelper DEBUG channel field size is 1344 field index = 107 +MdtIdHelper DEBUG channel field size is 2688 field index = 108 +MdtIdHelper DEBUG channel field size is 2304 field index = 109 MdtIdHelper DEBUG channel field size is 3360 field index = 110 -MdtIdHelper DEBUG channel field size is 576 field index = 111 -MdtIdHelper DEBUG channel field size is 4608 field index = 112 -MdtIdHelper DEBUG channel field size is 3840 field index = 113 -MdtIdHelper DEBUG channel field size is 5376 field index = 114 -MdtIdHelper DEBUG channel field size is 6144 field index = 115 +MdtIdHelper DEBUG channel field size is 3360 field index = 111 +MdtIdHelper DEBUG channel field size is 576 field index = 112 +MdtIdHelper DEBUG channel field size is 4608 field index = 113 +MdtIdHelper DEBUG channel field size is 3840 field index = 114 +MdtIdHelper DEBUG channel field size is 5376 field index = 115 MdtIdHelper DEBUG channel field size is 6144 field index = 116 MdtIdHelper DEBUG channel field size is 6144 field index = 117 MdtIdHelper DEBUG channel field size is 6144 field index = 118 @@ -1190,28 +1193,30 @@ MdtIdHelper DEBUG channel field size is 6144 field index = 120 MdtIdHelper DEBUG channel field size is 6144 field index = 121 MdtIdHelper DEBUG channel field size is 6144 field index = 122 MdtIdHelper DEBUG channel field size is 6144 field index = 123 -MdtIdHelper DEBUG channel field size is 5376 field index = 124 +MdtIdHelper DEBUG channel field size is 6144 field index = 124 MdtIdHelper DEBUG channel field size is 5376 field index = 125 -MdtIdHelper DEBUG channel field size is 4608 field index = 126 +MdtIdHelper DEBUG channel field size is 5376 field index = 126 MdtIdHelper DEBUG channel field size is 4608 field index = 127 MdtIdHelper DEBUG channel field size is 4608 field index = 128 MdtIdHelper DEBUG channel field size is 4608 field index = 129 -MdtIdHelper DEBUG channel field size is 5376 field index = 130 +MdtIdHelper DEBUG channel field size is 4608 field index = 130 MdtIdHelper DEBUG channel field size is 5376 field index = 131 MdtIdHelper DEBUG channel field size is 5376 field index = 132 -MdtIdHelper DEBUG channel field size is 4608 field index = 133 +MdtIdHelper DEBUG channel field size is 5376 field index = 133 MdtIdHelper DEBUG channel field size is 4608 field index = 134 MdtIdHelper DEBUG channel field size is 4608 field index = 135 -MdtIdHelper DEBUG channel field size is 1248 field index = 136 -MdtIdHelper DEBUG channel field size is 864 field index = 137 -MdtIdHelper DEBUG channel field size is 1728 field index = 138 +MdtIdHelper DEBUG channel field size is 4608 field index = 136 +MdtIdHelper DEBUG channel field size is 1248 field index = 137 +MdtIdHelper DEBUG channel field size is 864 field index = 138 MdtIdHelper DEBUG channel field size is 1728 field index = 139 MdtIdHelper DEBUG channel field size is 1728 field index = 140 +MdtIdHelper DEBUG channel field size is 1728 field index = 141 MdtIdHelper INFO Initializing MDT hash indices ... -MdtIdHelper INFO The element hash max is 1148 -MdtIdHelper INFO The detector element hash max is 2248 +MdtIdHelper INFO The element hash max is 1140 +MdtIdHelper INFO The detector element hash max is 2240 MdtIdHelper INFO Initializing MDT hash indices for finding neighbors ... MdtIdHelper VERBOSE MuonIdHelper::init_neighbors +MdtIdHelper DEBUG Maximum number of MDT tubes is 110 RpcIdHelper DEBUG (Re)initialize AtlasDetectorID DEBUG Could not get value for label 'no_side' of field 'DetZside' in dictionary Calorimeter AtlasDetectorID::initialize_from_dictionary - OK @@ -1224,182 +1229,185 @@ RpcIdHelper DEBUG technology decode 1 vals 0,2 mask/zero m RpcIdHelper DEBUG TR decode 1 vals 1:2 mask/zero mask/shift/bits/offset 1 ffffdfffffffffff 45 1 18 indexes mode both_bounded RpcIdHelper DEBUG TZ decode 1 vals 1:3 mask/zero mask/shift/bits/offset 3 ffffe7ffffffffff 43 2 19 indexes mode both_bounded RpcIdHelper DEBUG TPHI decode 1 vals 1:2 mask/zero mask/shift/bits/offset 1 fffffbffffffffff 42 1 21 indexes mode both_bounded -RpcIdHelper DEBUG gas gap decode 1 vals 1:2 mask/zero mask/shift/bits/offset 1 fffffdffffffffff 41 1 22 indexes mode both_bounded -RpcIdHelper DEBUG phi decode 0 vals 0:1 mask/zero mask/shift/bits/offset 1 fffffeffffffffff 40 1 23 indexes mode both_bounded -RpcIdHelper DEBUG strip decode 1 vals 1:99 mask/zero mask/shift/bits/offset 7f ffffff01ffffffff 33 7 24 indexes mode both_bounded -RpcIdHelper INFO MultiRange built successfully to doubletR: MultiRange size is 257 -RpcIdHelper INFO MultiRange built successfully to detectorElement: DetectorElement MultiRange size is 257 -RpcIdHelper INFO MultiRange built successfully to rpcStrip: MultiRange size is 257 -RpcIdHelper DEBUG field size is 4 field index = 145 -RpcIdHelper DEBUG field size is 2 field index = 146 +RpcIdHelper DEBUG gas gap decode 1 vals 1:3 mask/zero mask/shift/bits/offset 3 fffffcffffffffff 40 2 22 indexes mode both_bounded +RpcIdHelper DEBUG phi decode 0 vals 0:1 mask/zero mask/shift/bits/offset 1 ffffff7fffffffff 39 1 24 indexes mode both_bounded +RpcIdHelper DEBUG strip decode 1 vals 1:99 mask/zero mask/shift/bits/offset 7f ffffff80ffffffff 32 7 25 indexes mode both_bounded +RpcIdHelper INFO MultiRange built successfully to doubletR: MultiRange size is 259 +RpcIdHelper INFO MultiRange built successfully to detectorElement: DetectorElement MultiRange size is 259 +RpcIdHelper INFO MultiRange built successfully to rpcStrip: MultiRange size is 259 +RpcIdHelper DEBUG field size is 4 field index = 146 RpcIdHelper DEBUG field size is 2 field index = 147 -RpcIdHelper DEBUG field size is 4 field index = 148 -RpcIdHelper DEBUG field size is 2 field index = 149 +RpcIdHelper DEBUG field size is 2 field index = 148 +RpcIdHelper DEBUG field size is 4 field index = 149 RpcIdHelper DEBUG field size is 2 field index = 150 -RpcIdHelper DEBUG field size is 4 field index = 151 -RpcIdHelper DEBUG field size is 2 field index = 152 +RpcIdHelper DEBUG field size is 2 field index = 151 +RpcIdHelper DEBUG field size is 4 field index = 152 RpcIdHelper DEBUG field size is 2 field index = 153 -RpcIdHelper DEBUG field size is 8 field index = 154 -RpcIdHelper DEBUG field size is 32 field index = 155 +RpcIdHelper DEBUG field size is 2 field index = 154 +RpcIdHelper DEBUG field size is 8 field index = 155 RpcIdHelper DEBUG field size is 32 field index = 156 -RpcIdHelper DEBUG field size is 28 field index = 157 -RpcIdHelper DEBUG field size is 4 field index = 158 -RpcIdHelper DEBUG field size is 28 field index = 159 -RpcIdHelper DEBUG field size is 4 field index = 160 -RpcIdHelper DEBUG field size is 28 field index = 161 -RpcIdHelper DEBUG field size is 2 field index = 162 -RpcIdHelper DEBUG field size is 14 field index = 163 -RpcIdHelper DEBUG field size is 24 field index = 164 +RpcIdHelper DEBUG field size is 32 field index = 157 +RpcIdHelper DEBUG field size is 28 field index = 158 +RpcIdHelper DEBUG field size is 4 field index = 159 +RpcIdHelper DEBUG field size is 28 field index = 160 +RpcIdHelper DEBUG field size is 4 field index = 161 +RpcIdHelper DEBUG field size is 28 field index = 162 +RpcIdHelper DEBUG field size is 2 field index = 163 +RpcIdHelper DEBUG field size is 14 field index = 164 RpcIdHelper DEBUG field size is 24 field index = 165 RpcIdHelper DEBUG field size is 24 field index = 166 -RpcIdHelper DEBUG field size is 12 field index = 167 +RpcIdHelper DEBUG field size is 24 field index = 167 RpcIdHelper DEBUG field size is 12 field index = 168 -RpcIdHelper DEBUG field size is 24 field index = 169 +RpcIdHelper DEBUG field size is 12 field index = 169 RpcIdHelper DEBUG field size is 24 field index = 170 -RpcIdHelper DEBUG field size is 8 field index = 171 +RpcIdHelper DEBUG field size is 24 field index = 171 RpcIdHelper DEBUG field size is 8 field index = 172 -RpcIdHelper DEBUG field size is 16 field index = 173 +RpcIdHelper DEBUG field size is 8 field index = 173 RpcIdHelper DEBUG field size is 16 field index = 174 RpcIdHelper DEBUG field size is 16 field index = 175 RpcIdHelper DEBUG field size is 16 field index = 176 RpcIdHelper DEBUG field size is 16 field index = 177 -RpcIdHelper DEBUG field size is 12 field index = 178 +RpcIdHelper DEBUG field size is 16 field index = 178 RpcIdHelper DEBUG field size is 12 field index = 179 RpcIdHelper DEBUG field size is 12 field index = 180 RpcIdHelper DEBUG field size is 12 field index = 181 RpcIdHelper DEBUG field size is 12 field index = 182 RpcIdHelper DEBUG field size is 12 field index = 183 -RpcIdHelper DEBUG field size is 8 field index = 184 +RpcIdHelper DEBUG field size is 12 field index = 184 RpcIdHelper DEBUG field size is 8 field index = 185 -RpcIdHelper DEBUG field size is 4 field index = 186 +RpcIdHelper DEBUG field size is 8 field index = 186 RpcIdHelper DEBUG field size is 4 field index = 187 RpcIdHelper DEBUG field size is 4 field index = 188 -RpcIdHelper DEBUG field size is 8 field index = 189 +RpcIdHelper DEBUG field size is 4 field index = 189 RpcIdHelper DEBUG field size is 8 field index = 190 RpcIdHelper DEBUG field size is 8 field index = 191 -RpcIdHelper DEBUG field size is 2 field index = 192 -RpcIdHelper DEBUG field size is 4 field index = 193 +RpcIdHelper DEBUG field size is 8 field index = 192 +RpcIdHelper DEBUG field size is 2 field index = 193 RpcIdHelper DEBUG field size is 4 field index = 194 -RpcIdHelper DEBUG field size is 8 field index = 195 +RpcIdHelper DEBUG field size is 4 field index = 195 RpcIdHelper DEBUG field size is 8 field index = 196 -RpcIdHelper DEBUG field size is 4 field index = 197 -RpcIdHelper DEBUG field size is 2 field index = 198 -RpcIdHelper DEBUG detectorElement field size is 16 field index = 145 -RpcIdHelper DEBUG detectorElement field size is 4 field index = 146 -RpcIdHelper DEBUG detectorElement field size is 8 field index = 147 -RpcIdHelper DEBUG detectorElement field size is 16 field index = 148 -RpcIdHelper DEBUG detectorElement field size is 8 field index = 149 +RpcIdHelper DEBUG field size is 8 field index = 197 +RpcIdHelper DEBUG field size is 4 field index = 198 +RpcIdHelper DEBUG field size is 2 field index = 199 +RpcIdHelper DEBUG field size is 8 field index = 200 +RpcIdHelper DEBUG detectorElement field size is 16 field index = 146 +RpcIdHelper DEBUG detectorElement field size is 4 field index = 147 +RpcIdHelper DEBUG detectorElement field size is 8 field index = 148 +RpcIdHelper DEBUG detectorElement field size is 16 field index = 149 RpcIdHelper DEBUG detectorElement field size is 8 field index = 150 RpcIdHelper DEBUG detectorElement field size is 8 field index = 151 -RpcIdHelper DEBUG detectorElement field size is 4 field index = 152 +RpcIdHelper DEBUG detectorElement field size is 8 field index = 152 RpcIdHelper DEBUG detectorElement field size is 4 field index = 153 -RpcIdHelper DEBUG detectorElement field size is 16 field index = 154 -RpcIdHelper DEBUG detectorElement field size is 128 field index = 155 +RpcIdHelper DEBUG detectorElement field size is 4 field index = 154 +RpcIdHelper DEBUG detectorElement field size is 16 field index = 155 RpcIdHelper DEBUG detectorElement field size is 128 field index = 156 -RpcIdHelper DEBUG detectorElement field size is 56 field index = 157 -RpcIdHelper DEBUG detectorElement field size is 8 field index = 158 -RpcIdHelper DEBUG detectorElement field size is 56 field index = 159 -RpcIdHelper DEBUG detectorElement field size is 16 field index = 160 -RpcIdHelper DEBUG detectorElement field size is 112 field index = 161 -RpcIdHelper DEBUG detectorElement field size is 4 field index = 162 -RpcIdHelper DEBUG detectorElement field size is 28 field index = 163 -RpcIdHelper DEBUG detectorElement field size is 96 field index = 164 -RpcIdHelper DEBUG detectorElement field size is 144 field index = 165 -RpcIdHelper DEBUG detectorElement field size is 96 field index = 166 -RpcIdHelper DEBUG detectorElement field size is 48 field index = 167 -RpcIdHelper DEBUG detectorElement field size is 72 field index = 168 -RpcIdHelper DEBUG detectorElement field size is 48 field index = 169 -RpcIdHelper DEBUG detectorElement field size is 96 field index = 170 -RpcIdHelper DEBUG detectorElement field size is 32 field index = 171 +RpcIdHelper DEBUG detectorElement field size is 128 field index = 157 +RpcIdHelper DEBUG detectorElement field size is 56 field index = 158 +RpcIdHelper DEBUG detectorElement field size is 8 field index = 159 +RpcIdHelper DEBUG detectorElement field size is 56 field index = 160 +RpcIdHelper DEBUG detectorElement field size is 16 field index = 161 +RpcIdHelper DEBUG detectorElement field size is 112 field index = 162 +RpcIdHelper DEBUG detectorElement field size is 4 field index = 163 +RpcIdHelper DEBUG detectorElement field size is 28 field index = 164 +RpcIdHelper DEBUG detectorElement field size is 96 field index = 165 +RpcIdHelper DEBUG detectorElement field size is 144 field index = 166 +RpcIdHelper DEBUG detectorElement field size is 96 field index = 167 +RpcIdHelper DEBUG detectorElement field size is 48 field index = 168 +RpcIdHelper DEBUG detectorElement field size is 72 field index = 169 +RpcIdHelper DEBUG detectorElement field size is 48 field index = 170 +RpcIdHelper DEBUG detectorElement field size is 96 field index = 171 RpcIdHelper DEBUG detectorElement field size is 32 field index = 172 -RpcIdHelper DEBUG detectorElement field size is 64 field index = 173 +RpcIdHelper DEBUG detectorElement field size is 32 field index = 173 RpcIdHelper DEBUG detectorElement field size is 64 field index = 174 RpcIdHelper DEBUG detectorElement field size is 64 field index = 175 RpcIdHelper DEBUG detectorElement field size is 64 field index = 176 RpcIdHelper DEBUG detectorElement field size is 64 field index = 177 -RpcIdHelper DEBUG detectorElement field size is 48 field index = 178 +RpcIdHelper DEBUG detectorElement field size is 64 field index = 178 RpcIdHelper DEBUG detectorElement field size is 48 field index = 179 RpcIdHelper DEBUG detectorElement field size is 48 field index = 180 RpcIdHelper DEBUG detectorElement field size is 48 field index = 181 RpcIdHelper DEBUG detectorElement field size is 48 field index = 182 RpcIdHelper DEBUG detectorElement field size is 48 field index = 183 -RpcIdHelper DEBUG detectorElement field size is 32 field index = 184 +RpcIdHelper DEBUG detectorElement field size is 48 field index = 184 RpcIdHelper DEBUG detectorElement field size is 32 field index = 185 -RpcIdHelper DEBUG detectorElement field size is 8 field index = 186 -RpcIdHelper DEBUG detectorElement field size is 16 field index = 187 +RpcIdHelper DEBUG detectorElement field size is 32 field index = 186 +RpcIdHelper DEBUG detectorElement field size is 8 field index = 187 RpcIdHelper DEBUG detectorElement field size is 16 field index = 188 -RpcIdHelper DEBUG detectorElement field size is 32 field index = 189 +RpcIdHelper DEBUG detectorElement field size is 16 field index = 189 RpcIdHelper DEBUG detectorElement field size is 32 field index = 190 -RpcIdHelper DEBUG detectorElement field size is 16 field index = 191 -RpcIdHelper DEBUG detectorElement field size is 4 field index = 192 -RpcIdHelper DEBUG detectorElement field size is 8 field index = 193 +RpcIdHelper DEBUG detectorElement field size is 32 field index = 191 +RpcIdHelper DEBUG detectorElement field size is 16 field index = 192 +RpcIdHelper DEBUG detectorElement field size is 4 field index = 193 RpcIdHelper DEBUG detectorElement field size is 8 field index = 194 -RpcIdHelper DEBUG detectorElement field size is 16 field index = 195 +RpcIdHelper DEBUG detectorElement field size is 8 field index = 195 RpcIdHelper DEBUG detectorElement field size is 16 field index = 196 -RpcIdHelper DEBUG detectorElement field size is 8 field index = 197 -RpcIdHelper DEBUG detectorElement field size is 4 field index = 198 -RpcIdHelper DEBUG channel field size is 6336 field index = 145 -RpcIdHelper DEBUG channel field size is 1584 field index = 146 -RpcIdHelper DEBUG channel field size is 3168 field index = 147 -RpcIdHelper DEBUG channel field size is 6336 field index = 148 -RpcIdHelper DEBUG channel field size is 3168 field index = 149 +RpcIdHelper DEBUG detectorElement field size is 16 field index = 197 +RpcIdHelper DEBUG detectorElement field size is 8 field index = 198 +RpcIdHelper DEBUG detectorElement field size is 4 field index = 199 +RpcIdHelper DEBUG detectorElement field size is 32 field index = 200 +RpcIdHelper DEBUG channel field size is 6336 field index = 146 +RpcIdHelper DEBUG channel field size is 1584 field index = 147 +RpcIdHelper DEBUG channel field size is 3168 field index = 148 +RpcIdHelper DEBUG channel field size is 6336 field index = 149 RpcIdHelper DEBUG channel field size is 3168 field index = 150 RpcIdHelper DEBUG channel field size is 3168 field index = 151 -RpcIdHelper DEBUG channel field size is 1584 field index = 152 +RpcIdHelper DEBUG channel field size is 3168 field index = 152 RpcIdHelper DEBUG channel field size is 1584 field index = 153 -RpcIdHelper DEBUG channel field size is 6336 field index = 154 -RpcIdHelper DEBUG channel field size is 50688 field index = 155 +RpcIdHelper DEBUG channel field size is 1584 field index = 154 +RpcIdHelper DEBUG channel field size is 6336 field index = 155 RpcIdHelper DEBUG channel field size is 50688 field index = 156 -RpcIdHelper DEBUG channel field size is 22176 field index = 157 -RpcIdHelper DEBUG channel field size is 3168 field index = 158 -RpcIdHelper DEBUG channel field size is 22176 field index = 159 -RpcIdHelper DEBUG channel field size is 6336 field index = 160 -RpcIdHelper DEBUG channel field size is 44352 field index = 161 -RpcIdHelper DEBUG channel field size is 1584 field index = 162 -RpcIdHelper DEBUG channel field size is 11088 field index = 163 -RpcIdHelper DEBUG channel field size is 38016 field index = 164 -RpcIdHelper DEBUG channel field size is 57024 field index = 165 -RpcIdHelper DEBUG channel field size is 38016 field index = 166 -RpcIdHelper DEBUG channel field size is 19008 field index = 167 -RpcIdHelper DEBUG channel field size is 28512 field index = 168 -RpcIdHelper DEBUG channel field size is 19008 field index = 169 -RpcIdHelper DEBUG channel field size is 38016 field index = 170 -RpcIdHelper DEBUG channel field size is 12672 field index = 171 +RpcIdHelper DEBUG channel field size is 50688 field index = 157 +RpcIdHelper DEBUG channel field size is 22176 field index = 158 +RpcIdHelper DEBUG channel field size is 3168 field index = 159 +RpcIdHelper DEBUG channel field size is 22176 field index = 160 +RpcIdHelper DEBUG channel field size is 6336 field index = 161 +RpcIdHelper DEBUG channel field size is 44352 field index = 162 +RpcIdHelper DEBUG channel field size is 1584 field index = 163 +RpcIdHelper DEBUG channel field size is 11088 field index = 164 +RpcIdHelper DEBUG channel field size is 38016 field index = 165 +RpcIdHelper DEBUG channel field size is 57024 field index = 166 +RpcIdHelper DEBUG channel field size is 38016 field index = 167 +RpcIdHelper DEBUG channel field size is 19008 field index = 168 +RpcIdHelper DEBUG channel field size is 28512 field index = 169 +RpcIdHelper DEBUG channel field size is 19008 field index = 170 +RpcIdHelper DEBUG channel field size is 38016 field index = 171 RpcIdHelper DEBUG channel field size is 12672 field index = 172 -RpcIdHelper DEBUG channel field size is 25344 field index = 173 +RpcIdHelper DEBUG channel field size is 12672 field index = 173 RpcIdHelper DEBUG channel field size is 25344 field index = 174 RpcIdHelper DEBUG channel field size is 25344 field index = 175 RpcIdHelper DEBUG channel field size is 25344 field index = 176 RpcIdHelper DEBUG channel field size is 25344 field index = 177 -RpcIdHelper DEBUG channel field size is 19008 field index = 178 +RpcIdHelper DEBUG channel field size is 25344 field index = 178 RpcIdHelper DEBUG channel field size is 19008 field index = 179 RpcIdHelper DEBUG channel field size is 19008 field index = 180 RpcIdHelper DEBUG channel field size is 19008 field index = 181 RpcIdHelper DEBUG channel field size is 19008 field index = 182 RpcIdHelper DEBUG channel field size is 19008 field index = 183 -RpcIdHelper DEBUG channel field size is 12672 field index = 184 +RpcIdHelper DEBUG channel field size is 19008 field index = 184 RpcIdHelper DEBUG channel field size is 12672 field index = 185 -RpcIdHelper DEBUG channel field size is 3168 field index = 186 -RpcIdHelper DEBUG channel field size is 6336 field index = 187 +RpcIdHelper DEBUG channel field size is 12672 field index = 186 +RpcIdHelper DEBUG channel field size is 3168 field index = 187 RpcIdHelper DEBUG channel field size is 6336 field index = 188 -RpcIdHelper DEBUG channel field size is 12672 field index = 189 +RpcIdHelper DEBUG channel field size is 6336 field index = 189 RpcIdHelper DEBUG channel field size is 12672 field index = 190 -RpcIdHelper DEBUG channel field size is 6336 field index = 191 -RpcIdHelper DEBUG channel field size is 1584 field index = 192 -RpcIdHelper DEBUG channel field size is 3168 field index = 193 +RpcIdHelper DEBUG channel field size is 12672 field index = 191 +RpcIdHelper DEBUG channel field size is 6336 field index = 192 +RpcIdHelper DEBUG channel field size is 1584 field index = 193 RpcIdHelper DEBUG channel field size is 3168 field index = 194 -RpcIdHelper DEBUG channel field size is 6336 field index = 195 +RpcIdHelper DEBUG channel field size is 3168 field index = 195 RpcIdHelper DEBUG channel field size is 6336 field index = 196 -RpcIdHelper DEBUG channel field size is 3168 field index = 197 -RpcIdHelper DEBUG channel field size is 1584 field index = 198 -RpcIdHelper DEBUG full module range size is 54 -RpcIdHelper DEBUG full channel range size is 54 +RpcIdHelper DEBUG channel field size is 6336 field index = 197 +RpcIdHelper DEBUG channel field size is 3168 field index = 198 +RpcIdHelper DEBUG channel field size is 1584 field index = 199 +RpcIdHelper DEBUG channel field size is 19008 field index = 200 +RpcIdHelper DEBUG full module range size is 55 +RpcIdHelper DEBUG full channel range size is 55 RpcIdHelper INFO Initializing RPC hash indices ... -RpcIdHelper INFO The element hash max is 600 -RpcIdHelper INFO The detector element hash max is 1122 +RpcIdHelper INFO The element hash max is 608 +RpcIdHelper INFO The detector element hash max is 1138 RpcIdHelper INFO Initializing RPC hash indices for finding neighbors ... RpcIdHelper VERBOSE MuonIdHelper::init_neighbors -RpcIdHelper DEBUG Maximum number of RPC gas gaps is 2 +RpcIdHelper DEBUG Maximum number of RPC gas gaps is 3 TgcIdHelper DEBUG (Re)initialize AtlasDetectorID DEBUG Could not get value for label 'no_side' of field 'DetZside' in dictionary Calorimeter AtlasDetectorID::initialize_from_dictionary - OK @@ -1412,85 +1420,85 @@ TgcIdHelper DEBUG technology decode 1 vals 3 mask/zero m TgcIdHelper DEBUG gas gap decode 1 vals 1:3 mask/zero mask/shift/bits/offset 3 fffff3ffffffffff 42 2 20 indexes mode both_bounded TgcIdHelper DEBUG is strip decode 0 vals 0:1 mask/zero mask/shift/bits/offset 1 fffffdffffffffff 41 1 22 indexes mode both_bounded TgcIdHelper DEBUG channel decode 1 vals 1:125 mask/zero mask/shift/bits/offset 7f fffffe03ffffffff 34 7 23 indexes mode both_bounded -TgcIdHelper INFO MultiRange built successfully to Technology: MultiRange size is 216 -TgcIdHelper INFO MultiRange built successfully to detector element: Multilayer MultiRange size is 216 -TgcIdHelper INFO MultiRange built successfully to channel: MultiRange size is 257 -TgcIdHelper DEBUG field size is 48 field index = 189 -TgcIdHelper DEBUG field size is 96 field index = 190 -TgcIdHelper DEBUG field size is 96 field index = 191 +TgcIdHelper INFO MultiRange built successfully to Technology: MultiRange size is 218 +TgcIdHelper INFO MultiRange built successfully to detector element: Multilayer MultiRange size is 218 +TgcIdHelper INFO MultiRange built successfully to channel: MultiRange size is 259 +TgcIdHelper DEBUG field size is 48 field index = 191 TgcIdHelper DEBUG field size is 96 field index = 192 TgcIdHelper DEBUG field size is 96 field index = 193 -TgcIdHelper DEBUG field size is 48 field index = 194 +TgcIdHelper DEBUG field size is 96 field index = 194 TgcIdHelper DEBUG field size is 96 field index = 195 -TgcIdHelper DEBUG field size is 96 field index = 196 +TgcIdHelper DEBUG field size is 48 field index = 196 TgcIdHelper DEBUG field size is 96 field index = 197 TgcIdHelper DEBUG field size is 96 field index = 198 TgcIdHelper DEBUG field size is 96 field index = 199 -TgcIdHelper DEBUG field size is 48 field index = 200 +TgcIdHelper DEBUG field size is 96 field index = 200 TgcIdHelper DEBUG field size is 96 field index = 201 -TgcIdHelper DEBUG field size is 96 field index = 202 +TgcIdHelper DEBUG field size is 48 field index = 202 TgcIdHelper DEBUG field size is 96 field index = 203 TgcIdHelper DEBUG field size is 96 field index = 204 TgcIdHelper DEBUG field size is 96 field index = 205 -TgcIdHelper DEBUG field size is 24 field index = 206 -TgcIdHelper DEBUG field size is 42 field index = 207 -TgcIdHelper DEBUG detector element field size is 48 field index = 189 -TgcIdHelper DEBUG detector element field size is 96 field index = 190 -TgcIdHelper DEBUG detector element field size is 96 field index = 191 +TgcIdHelper DEBUG field size is 96 field index = 206 +TgcIdHelper DEBUG field size is 96 field index = 207 +TgcIdHelper DEBUG field size is 24 field index = 208 +TgcIdHelper DEBUG field size is 42 field index = 209 +TgcIdHelper DEBUG detector element field size is 48 field index = 191 TgcIdHelper DEBUG detector element field size is 96 field index = 192 TgcIdHelper DEBUG detector element field size is 96 field index = 193 -TgcIdHelper DEBUG detector element field size is 48 field index = 194 +TgcIdHelper DEBUG detector element field size is 96 field index = 194 TgcIdHelper DEBUG detector element field size is 96 field index = 195 -TgcIdHelper DEBUG detector element field size is 96 field index = 196 +TgcIdHelper DEBUG detector element field size is 48 field index = 196 TgcIdHelper DEBUG detector element field size is 96 field index = 197 TgcIdHelper DEBUG detector element field size is 96 field index = 198 TgcIdHelper DEBUG detector element field size is 96 field index = 199 -TgcIdHelper DEBUG detector element field size is 48 field index = 200 +TgcIdHelper DEBUG detector element field size is 96 field index = 200 TgcIdHelper DEBUG detector element field size is 96 field index = 201 -TgcIdHelper DEBUG detector element field size is 96 field index = 202 +TgcIdHelper DEBUG detector element field size is 48 field index = 202 TgcIdHelper DEBUG detector element field size is 96 field index = 203 TgcIdHelper DEBUG detector element field size is 96 field index = 204 TgcIdHelper DEBUG detector element field size is 96 field index = 205 -TgcIdHelper DEBUG detector element field size is 24 field index = 206 -TgcIdHelper DEBUG detector element field size is 42 field index = 207 -TgcIdHelper DEBUG channel field size is 15120 field index = 199 -TgcIdHelper DEBUG channel field size is 4608 field index = 200 -TgcIdHelper DEBUG channel field size is 26496 field index = 201 -TgcIdHelper DEBUG channel field size is 17856 field index = 202 -TgcIdHelper DEBUG channel field size is 6624 field index = 203 -TgcIdHelper DEBUG channel field size is 6912 field index = 204 -TgcIdHelper DEBUG channel field size is 9216 field index = 205 -TgcIdHelper DEBUG channel field size is 9216 field index = 206 +TgcIdHelper DEBUG detector element field size is 96 field index = 206 +TgcIdHelper DEBUG detector element field size is 96 field index = 207 +TgcIdHelper DEBUG detector element field size is 24 field index = 208 +TgcIdHelper DEBUG detector element field size is 42 field index = 209 +TgcIdHelper DEBUG channel field size is 15120 field index = 201 +TgcIdHelper DEBUG channel field size is 4608 field index = 202 +TgcIdHelper DEBUG channel field size is 26496 field index = 203 +TgcIdHelper DEBUG channel field size is 17856 field index = 204 +TgcIdHelper DEBUG channel field size is 6624 field index = 205 +TgcIdHelper DEBUG channel field size is 6912 field index = 206 TgcIdHelper DEBUG channel field size is 9216 field index = 207 TgcIdHelper DEBUG channel field size is 9216 field index = 208 -TgcIdHelper DEBUG channel field size is 12000 field index = 209 -TgcIdHelper DEBUG channel field size is 3072 field index = 210 -TgcIdHelper DEBUG channel field size is 21120 field index = 211 -TgcIdHelper DEBUG channel field size is 19776 field index = 212 -TgcIdHelper DEBUG channel field size is 6144 field index = 213 -TgcIdHelper DEBUG channel field size is 6144 field index = 214 +TgcIdHelper DEBUG channel field size is 9216 field index = 209 +TgcIdHelper DEBUG channel field size is 9216 field index = 210 +TgcIdHelper DEBUG channel field size is 12000 field index = 211 +TgcIdHelper DEBUG channel field size is 3072 field index = 212 +TgcIdHelper DEBUG channel field size is 21120 field index = 213 +TgcIdHelper DEBUG channel field size is 19776 field index = 214 TgcIdHelper DEBUG channel field size is 6144 field index = 215 TgcIdHelper DEBUG channel field size is 6144 field index = 216 TgcIdHelper DEBUG channel field size is 6144 field index = 217 TgcIdHelper DEBUG channel field size is 6144 field index = 218 TgcIdHelper DEBUG channel field size is 6144 field index = 219 TgcIdHelper DEBUG channel field size is 6144 field index = 220 -TgcIdHelper DEBUG channel field size is 11712 field index = 221 -TgcIdHelper DEBUG channel field size is 3072 field index = 222 -TgcIdHelper DEBUG channel field size is 18432 field index = 223 -TgcIdHelper DEBUG channel field size is 20352 field index = 224 -TgcIdHelper DEBUG channel field size is 6144 field index = 225 -TgcIdHelper DEBUG channel field size is 6144 field index = 226 -TgcIdHelper DEBUG channel field size is 5952 field index = 227 +TgcIdHelper DEBUG channel field size is 6144 field index = 221 +TgcIdHelper DEBUG channel field size is 6144 field index = 222 +TgcIdHelper DEBUG channel field size is 11712 field index = 223 +TgcIdHelper DEBUG channel field size is 3072 field index = 224 +TgcIdHelper DEBUG channel field size is 18432 field index = 225 +TgcIdHelper DEBUG channel field size is 20352 field index = 226 +TgcIdHelper DEBUG channel field size is 6144 field index = 227 TgcIdHelper DEBUG channel field size is 6144 field index = 228 -TgcIdHelper DEBUG channel field size is 6144 field index = 229 +TgcIdHelper DEBUG channel field size is 5952 field index = 229 TgcIdHelper DEBUG channel field size is 6144 field index = 230 TgcIdHelper DEBUG channel field size is 6144 field index = 231 TgcIdHelper DEBUG channel field size is 6144 field index = 232 -TgcIdHelper DEBUG channel field size is 1536 field index = 233 -TgcIdHelper DEBUG channel field size is 1536 field index = 234 -TgcIdHelper DEBUG channel field size is 2016 field index = 235 -TgcIdHelper DEBUG channel field size is 2688 field index = 236 +TgcIdHelper DEBUG channel field size is 6144 field index = 233 +TgcIdHelper DEBUG channel field size is 6144 field index = 234 +TgcIdHelper DEBUG channel field size is 1536 field index = 235 +TgcIdHelper DEBUG channel field size is 1536 field index = 236 +TgcIdHelper DEBUG channel field size is 2016 field index = 237 +TgcIdHelper DEBUG channel field size is 2688 field index = 238 TgcIdHelper INFO Initializing TGC hash indices ... TgcIdHelper INFO The element hash max is 1554 TgcIdHelper INFO The detector element hash max is 1554 @@ -1509,17 +1517,17 @@ CscIdHelper DEBUG cham layer decode 1 vals 2 mask/zero m CscIdHelper DEBUG layer decode 1 vals 1:4 mask/zero mask/shift/bits/offset 3 fffe7fffffffffff 47 2 15 indexes mode both_bounded CscIdHelper DEBUG phi decode 0 vals 0:1 mask/zero mask/shift/bits/offset 1 ffffbfffffffffff 46 1 17 indexes mode both_bounded CscIdHelper DEBUG strip decode 1 vals 1:192 mask/zero mask/shift/bits/offset ff ffffc03fffffffff 38 8 18 indexes mode both_bounded -CscIdHelper INFO MultiRange built successfully to Technology: MultiRange size is 216 -CscIdHelper INFO MultiRange built successfully to detector element: Multilayer MultiRange size is 255 -CscIdHelper INFO MultiRange built successfully to cscStrip: MultiRange size is 257 -CscIdHelper DEBUG field size is 8 field index = 135 +CscIdHelper INFO MultiRange built successfully to Technology: MultiRange size is 218 +CscIdHelper INFO MultiRange built successfully to detector element: Multilayer MultiRange size is 257 +CscIdHelper INFO MultiRange built successfully to cscStrip: MultiRange size is 259 CscIdHelper DEBUG field size is 8 field index = 136 -CscIdHelper DEBUG detector element field size is 8 field index = 141 +CscIdHelper DEBUG field size is 8 field index = 137 CscIdHelper DEBUG detector element field size is 8 field index = 142 -CscIdHelper DEBUG channel field size is 6144 field index = 141 -CscIdHelper DEBUG channel field size is 1536 field index = 142 -CscIdHelper DEBUG channel field size is 6144 field index = 143 -CscIdHelper DEBUG channel field size is 1536 field index = 144 +CscIdHelper DEBUG detector element field size is 8 field index = 143 +CscIdHelper DEBUG channel field size is 6144 field index = 142 +CscIdHelper DEBUG channel field size is 1536 field index = 143 +CscIdHelper DEBUG channel field size is 6144 field index = 144 +CscIdHelper DEBUG channel field size is 1536 field index = 145 CscIdHelper INFO Initializing CSC hash indices ... CscIdHelper INFO The element hash max is 16 CscIdHelper INFO The detector element hash max is 16 @@ -1538,85 +1546,85 @@ TgcIdHelper DEBUG technology decode 1 vals 3 mask/zero m TgcIdHelper DEBUG gas gap decode 1 vals 1:3 mask/zero mask/shift/bits/offset 3 fffff3ffffffffff 42 2 20 indexes mode both_bounded TgcIdHelper DEBUG is strip decode 0 vals 0:1 mask/zero mask/shift/bits/offset 1 fffffdffffffffff 41 1 22 indexes mode both_bounded TgcIdHelper DEBUG channel decode 1 vals 1:125 mask/zero mask/shift/bits/offset 7f fffffe03ffffffff 34 7 23 indexes mode both_bounded -TgcIdHelper INFO MultiRange built successfully to Technology: MultiRange size is 216 -TgcIdHelper INFO MultiRange built successfully to detector element: Multilayer MultiRange size is 216 -TgcIdHelper INFO MultiRange built successfully to channel: MultiRange size is 257 -TgcIdHelper DEBUG field size is 48 field index = 189 -TgcIdHelper DEBUG field size is 96 field index = 190 -TgcIdHelper DEBUG field size is 96 field index = 191 +TgcIdHelper INFO MultiRange built successfully to Technology: MultiRange size is 218 +TgcIdHelper INFO MultiRange built successfully to detector element: Multilayer MultiRange size is 218 +TgcIdHelper INFO MultiRange built successfully to channel: MultiRange size is 259 +TgcIdHelper DEBUG field size is 48 field index = 191 TgcIdHelper DEBUG field size is 96 field index = 192 TgcIdHelper DEBUG field size is 96 field index = 193 -TgcIdHelper DEBUG field size is 48 field index = 194 +TgcIdHelper DEBUG field size is 96 field index = 194 TgcIdHelper DEBUG field size is 96 field index = 195 -TgcIdHelper DEBUG field size is 96 field index = 196 +TgcIdHelper DEBUG field size is 48 field index = 196 TgcIdHelper DEBUG field size is 96 field index = 197 TgcIdHelper DEBUG field size is 96 field index = 198 TgcIdHelper DEBUG field size is 96 field index = 199 -TgcIdHelper DEBUG field size is 48 field index = 200 +TgcIdHelper DEBUG field size is 96 field index = 200 TgcIdHelper DEBUG field size is 96 field index = 201 -TgcIdHelper DEBUG field size is 96 field index = 202 +TgcIdHelper DEBUG field size is 48 field index = 202 TgcIdHelper DEBUG field size is 96 field index = 203 TgcIdHelper DEBUG field size is 96 field index = 204 TgcIdHelper DEBUG field size is 96 field index = 205 -TgcIdHelper DEBUG field size is 24 field index = 206 -TgcIdHelper DEBUG field size is 42 field index = 207 -TgcIdHelper DEBUG detector element field size is 48 field index = 189 -TgcIdHelper DEBUG detector element field size is 96 field index = 190 -TgcIdHelper DEBUG detector element field size is 96 field index = 191 +TgcIdHelper DEBUG field size is 96 field index = 206 +TgcIdHelper DEBUG field size is 96 field index = 207 +TgcIdHelper DEBUG field size is 24 field index = 208 +TgcIdHelper DEBUG field size is 42 field index = 209 +TgcIdHelper DEBUG detector element field size is 48 field index = 191 TgcIdHelper DEBUG detector element field size is 96 field index = 192 TgcIdHelper DEBUG detector element field size is 96 field index = 193 -TgcIdHelper DEBUG detector element field size is 48 field index = 194 +TgcIdHelper DEBUG detector element field size is 96 field index = 194 TgcIdHelper DEBUG detector element field size is 96 field index = 195 -TgcIdHelper DEBUG detector element field size is 96 field index = 196 +TgcIdHelper DEBUG detector element field size is 48 field index = 196 TgcIdHelper DEBUG detector element field size is 96 field index = 197 TgcIdHelper DEBUG detector element field size is 96 field index = 198 TgcIdHelper DEBUG detector element field size is 96 field index = 199 -TgcIdHelper DEBUG detector element field size is 48 field index = 200 +TgcIdHelper DEBUG detector element field size is 96 field index = 200 TgcIdHelper DEBUG detector element field size is 96 field index = 201 -TgcIdHelper DEBUG detector element field size is 96 field index = 202 +TgcIdHelper DEBUG detector element field size is 48 field index = 202 TgcIdHelper DEBUG detector element field size is 96 field index = 203 TgcIdHelper DEBUG detector element field size is 96 field index = 204 TgcIdHelper DEBUG detector element field size is 96 field index = 205 -TgcIdHelper DEBUG detector element field size is 24 field index = 206 -TgcIdHelper DEBUG detector element field size is 42 field index = 207 -TgcIdHelper DEBUG channel field size is 15120 field index = 199 -TgcIdHelper DEBUG channel field size is 4608 field index = 200 -TgcIdHelper DEBUG channel field size is 26496 field index = 201 -TgcIdHelper DEBUG channel field size is 17856 field index = 202 -TgcIdHelper DEBUG channel field size is 6624 field index = 203 -TgcIdHelper DEBUG channel field size is 6912 field index = 204 -TgcIdHelper DEBUG channel field size is 9216 field index = 205 -TgcIdHelper DEBUG channel field size is 9216 field index = 206 +TgcIdHelper DEBUG detector element field size is 96 field index = 206 +TgcIdHelper DEBUG detector element field size is 96 field index = 207 +TgcIdHelper DEBUG detector element field size is 24 field index = 208 +TgcIdHelper DEBUG detector element field size is 42 field index = 209 +TgcIdHelper DEBUG channel field size is 15120 field index = 201 +TgcIdHelper DEBUG channel field size is 4608 field index = 202 +TgcIdHelper DEBUG channel field size is 26496 field index = 203 +TgcIdHelper DEBUG channel field size is 17856 field index = 204 +TgcIdHelper DEBUG channel field size is 6624 field index = 205 +TgcIdHelper DEBUG channel field size is 6912 field index = 206 TgcIdHelper DEBUG channel field size is 9216 field index = 207 TgcIdHelper DEBUG channel field size is 9216 field index = 208 -TgcIdHelper DEBUG channel field size is 12000 field index = 209 -TgcIdHelper DEBUG channel field size is 3072 field index = 210 -TgcIdHelper DEBUG channel field size is 21120 field index = 211 -TgcIdHelper DEBUG channel field size is 19776 field index = 212 -TgcIdHelper DEBUG channel field size is 6144 field index = 213 -TgcIdHelper DEBUG channel field size is 6144 field index = 214 +TgcIdHelper DEBUG channel field size is 9216 field index = 209 +TgcIdHelper DEBUG channel field size is 9216 field index = 210 +TgcIdHelper DEBUG channel field size is 12000 field index = 211 +TgcIdHelper DEBUG channel field size is 3072 field index = 212 +TgcIdHelper DEBUG channel field size is 21120 field index = 213 +TgcIdHelper DEBUG channel field size is 19776 field index = 214 TgcIdHelper DEBUG channel field size is 6144 field index = 215 TgcIdHelper DEBUG channel field size is 6144 field index = 216 TgcIdHelper DEBUG channel field size is 6144 field index = 217 TgcIdHelper DEBUG channel field size is 6144 field index = 218 TgcIdHelper DEBUG channel field size is 6144 field index = 219 TgcIdHelper DEBUG channel field size is 6144 field index = 220 -TgcIdHelper DEBUG channel field size is 11712 field index = 221 -TgcIdHelper DEBUG channel field size is 3072 field index = 222 -TgcIdHelper DEBUG channel field size is 18432 field index = 223 -TgcIdHelper DEBUG channel field size is 20352 field index = 224 -TgcIdHelper DEBUG channel field size is 6144 field index = 225 -TgcIdHelper DEBUG channel field size is 6144 field index = 226 -TgcIdHelper DEBUG channel field size is 5952 field index = 227 +TgcIdHelper DEBUG channel field size is 6144 field index = 221 +TgcIdHelper DEBUG channel field size is 6144 field index = 222 +TgcIdHelper DEBUG channel field size is 11712 field index = 223 +TgcIdHelper DEBUG channel field size is 3072 field index = 224 +TgcIdHelper DEBUG channel field size is 18432 field index = 225 +TgcIdHelper DEBUG channel field size is 20352 field index = 226 +TgcIdHelper DEBUG channel field size is 6144 field index = 227 TgcIdHelper DEBUG channel field size is 6144 field index = 228 -TgcIdHelper DEBUG channel field size is 6144 field index = 229 +TgcIdHelper DEBUG channel field size is 5952 field index = 229 TgcIdHelper DEBUG channel field size is 6144 field index = 230 TgcIdHelper DEBUG channel field size is 6144 field index = 231 TgcIdHelper DEBUG channel field size is 6144 field index = 232 -TgcIdHelper DEBUG channel field size is 1536 field index = 233 -TgcIdHelper DEBUG channel field size is 1536 field index = 234 -TgcIdHelper DEBUG channel field size is 2016 field index = 235 -TgcIdHelper DEBUG channel field size is 2688 field index = 236 +TgcIdHelper DEBUG channel field size is 6144 field index = 233 +TgcIdHelper DEBUG channel field size is 6144 field index = 234 +TgcIdHelper DEBUG channel field size is 1536 field index = 235 +TgcIdHelper DEBUG channel field size is 1536 field index = 236 +TgcIdHelper DEBUG channel field size is 2016 field index = 237 +TgcIdHelper DEBUG channel field size is 2688 field index = 238 TgcIdHelper INFO Initializing TGC hash indices ... TgcIdHelper INFO The element hash max is 1554 TgcIdHelper INFO The detector element hash max is 1554 @@ -1634,31 +1642,31 @@ MmIdHelper DEBUG technology decode 1 vals 5 mask/zero m MmIdHelper DEBUG multilayer decode 1 vals 1:2 mask/zero mask/shift/bits/offset 1 fffdffffffffffff 49 1 14 indexes mode both_bounded MmIdHelper DEBUG gasgap decode 1 vals 1:4 mask/zero mask/shift/bits/offset 3 fffe7fffffffffff 47 2 15 indexes mode both_bounded MmIdHelper DEBUG channel decode 1 vals 1:5120 mask/zero mask/shift/bits/offset 1fff ffff8003ffffffff 34 13 17 indexes mode both_bounded -MmIdHelper INFO MultiRange built successfully to Technology: MultiRange size is 216 -MmIdHelper INFO MultiRange built successfully to detector element: Multilayer MultiRange size is 253 -MmIdHelper INFO MultiRange built successfully to channel: MultiRange size is 257 -MmIdHelper DEBUG field size is 8 field index = 212 -MmIdHelper DEBUG field size is 8 field index = 213 +MmIdHelper INFO MultiRange built successfully to Technology: MultiRange size is 218 +MmIdHelper INFO MultiRange built successfully to detector element: Multilayer MultiRange size is 255 +MmIdHelper INFO MultiRange built successfully to channel: MultiRange size is 259 MmIdHelper DEBUG field size is 8 field index = 214 MmIdHelper DEBUG field size is 8 field index = 215 -MmIdHelper DEBUG detector element field size is 16 field index = 249 -MmIdHelper DEBUG detector element field size is 16 field index = 250 +MmIdHelper DEBUG field size is 8 field index = 216 +MmIdHelper DEBUG field size is 8 field index = 217 MmIdHelper DEBUG detector element field size is 16 field index = 251 MmIdHelper DEBUG detector element field size is 16 field index = 252 -MmIdHelper DEBUG channel field size is 163840 field index = 249 -MmIdHelper DEBUG channel field size is 163840 field index = 250 -MmIdHelper DEBUG channel field size is 98304 field index = 251 -MmIdHelper DEBUG channel field size is 98304 field index = 252 -MmIdHelper DEBUG channel field size is 163840 field index = 253 -MmIdHelper DEBUG channel field size is 163840 field index = 254 -MmIdHelper DEBUG channel field size is 98304 field index = 255 -MmIdHelper DEBUG channel field size is 98304 field index = 256 +MmIdHelper DEBUG detector element field size is 16 field index = 253 +MmIdHelper DEBUG detector element field size is 16 field index = 254 +MmIdHelper DEBUG channel field size is 163840 field index = 251 +MmIdHelper DEBUG channel field size is 163840 field index = 252 +MmIdHelper DEBUG channel field size is 98304 field index = 253 +MmIdHelper DEBUG channel field size is 98304 field index = 254 +MmIdHelper DEBUG channel field size is 163840 field index = 255 +MmIdHelper DEBUG channel field size is 163840 field index = 256 +MmIdHelper DEBUG channel field size is 98304 field index = 257 +MmIdHelper DEBUG channel field size is 98304 field index = 258 MmIdHelper INFO Initializing MicroMegas hash indices ... MmIdHelper INFO The element hash max is 32 MmIdHelper INFO The detector element hash max is 64 MmIdHelper INFO Initializing MicroMegas hash indices for finding neighbors ... MmIdHelper VERBOSE MuonIdHelper::init_neighbors -=========> checking dictionnary file=IdDictMuonSpectrometer_R.09.NSW.xml +=========> checking dictionnary file=IdDictMuonSpectrometer_R.09.02.xml MdtIdHelper DEBUG (Re)initialize AtlasDetectorIDHelper::initialize_from_dictionary - Warning: unable to find csc region index: group, region size 0 0 AtlasDetectorID DEBUG Could not get value for label 'no_side' of field 'DetZside' in dictionary Calorimeter @@ -1671,10 +1679,10 @@ MdtIdHelper DEBUG phi decode 1 vals 1:8 mask/zero m MdtIdHelper DEBUG technology decode 1 vals 0,2 mask/zero mask/shift/bits/offset 1 ffff7fffffffffff 47 1 16 indexes 0 0 1 mode enumerated MdtIdHelper DEBUG multilayer decode 1 vals 1:2 mask/zero mask/shift/bits/offset 1 ffffbfffffffffff 46 1 17 indexes mode both_bounded MdtIdHelper DEBUG layer decode 1 vals 1:4 mask/zero mask/shift/bits/offset 3 ffffcfffffffffff 44 2 18 indexes mode both_bounded -MdtIdHelper DEBUG tube decode 1 vals 1:78 mask/zero mask/shift/bits/offset 7f fffff01fffffffff 37 7 20 indexes mode both_bounded -MdtIdHelper INFO MultiRange built successfully to Technology: MultiRange size is 208 -MdtIdHelper INFO MultiRange built successfully to detector element: Multilayer MultiRange size is 246 -MdtIdHelper INFO MultiRange built successfully to tube: MultiRange size is 246 +MdtIdHelper DEBUG tube decode 1 vals 1:110 mask/zero mask/shift/bits/offset 7f fffff01fffffffff 37 7 20 indexes mode both_bounded +MdtIdHelper INFO MultiRange built successfully to Technology: MultiRange size is 207 +MdtIdHelper INFO MultiRange built successfully to detector element: Multilayer MultiRange size is 245 +MdtIdHelper INFO MultiRange built successfully to tube: MultiRange size is 245 MdtIdHelper DEBUG module field size is 5 field index = 0 MdtIdHelper DEBUG module field size is 1 field index = 1 MdtIdHelper DEBUG module field size is 4 field index = 2 @@ -1705,77 +1713,77 @@ MdtIdHelper DEBUG module field size is 16 field index = 26 MdtIdHelper DEBUG module field size is 16 field index = 27 MdtIdHelper DEBUG module field size is 16 field index = 28 MdtIdHelper DEBUG module field size is 16 field index = 29 -MdtIdHelper DEBUG module field size is 10 field index = 30 -MdtIdHelper DEBUG module field size is 6 field index = 31 +MdtIdHelper DEBUG module field size is 16 field index = 30 +MdtIdHelper DEBUG module field size is 16 field index = 31 MdtIdHelper DEBUG module field size is 16 field index = 32 -MdtIdHelper DEBUG module field size is 16 field index = 33 -MdtIdHelper DEBUG module field size is 16 field index = 34 +MdtIdHelper DEBUG module field size is 1 field index = 33 +MdtIdHelper DEBUG module field size is 1 field index = 34 MdtIdHelper DEBUG module field size is 1 field index = 35 MdtIdHelper DEBUG module field size is 1 field index = 36 -MdtIdHelper DEBUG module field size is 1 field index = 37 -MdtIdHelper DEBUG module field size is 1 field index = 38 -MdtIdHelper DEBUG module field size is 2 field index = 39 -MdtIdHelper DEBUG module field size is 2 field index = 40 -MdtIdHelper DEBUG module field size is 1 field index = 41 -MdtIdHelper DEBUG module field size is 4 field index = 42 -MdtIdHelper DEBUG module field size is 2 field index = 43 -MdtIdHelper DEBUG module field size is 1 field index = 44 -MdtIdHelper DEBUG module field size is 32 field index = 45 -MdtIdHelper DEBUG module field size is 16 field index = 46 +MdtIdHelper DEBUG module field size is 2 field index = 37 +MdtIdHelper DEBUG module field size is 2 field index = 38 +MdtIdHelper DEBUG module field size is 1 field index = 39 +MdtIdHelper DEBUG module field size is 4 field index = 40 +MdtIdHelper DEBUG module field size is 2 field index = 41 +MdtIdHelper DEBUG module field size is 1 field index = 42 +MdtIdHelper DEBUG module field size is 32 field index = 43 +MdtIdHelper DEBUG module field size is 16 field index = 44 +MdtIdHelper DEBUG module field size is 14 field index = 45 +MdtIdHelper DEBUG module field size is 2 field index = 46 MdtIdHelper DEBUG module field size is 14 field index = 47 MdtIdHelper DEBUG module field size is 2 field index = 48 -MdtIdHelper DEBUG module field size is 14 field index = 49 -MdtIdHelper DEBUG module field size is 2 field index = 50 +MdtIdHelper DEBUG module field size is 12 field index = 49 +MdtIdHelper DEBUG module field size is 12 field index = 50 MdtIdHelper DEBUG module field size is 12 field index = 51 MdtIdHelper DEBUG module field size is 12 field index = 52 MdtIdHelper DEBUG module field size is 12 field index = 53 MdtIdHelper DEBUG module field size is 12 field index = 54 -MdtIdHelper DEBUG module field size is 12 field index = 55 -MdtIdHelper DEBUG module field size is 12 field index = 56 +MdtIdHelper DEBUG module field size is 4 field index = 55 +MdtIdHelper DEBUG module field size is 4 field index = 56 MdtIdHelper DEBUG module field size is 4 field index = 57 -MdtIdHelper DEBUG module field size is 4 field index = 58 -MdtIdHelper DEBUG module field size is 4 field index = 59 +MdtIdHelper DEBUG module field size is 2 field index = 58 +MdtIdHelper DEBUG module field size is 1 field index = 59 MdtIdHelper DEBUG module field size is 2 field index = 60 MdtIdHelper DEBUG module field size is 1 field index = 61 -MdtIdHelper DEBUG module field size is 2 field index = 62 -MdtIdHelper DEBUG module field size is 1 field index = 63 +MdtIdHelper DEBUG module field size is 3 field index = 62 +MdtIdHelper DEBUG module field size is 2 field index = 63 MdtIdHelper DEBUG module field size is 3 field index = 64 -MdtIdHelper DEBUG module field size is 2 field index = 65 -MdtIdHelper DEBUG module field size is 3 field index = 66 -MdtIdHelper DEBUG module field size is 1 field index = 67 -MdtIdHelper DEBUG module field size is 1 field index = 68 -MdtIdHelper DEBUG module field size is 7 field index = 69 -MdtIdHelper DEBUG module field size is 6 field index = 70 -MdtIdHelper DEBUG module field size is 2 field index = 71 -MdtIdHelper DEBUG module field size is 1 field index = 72 -MdtIdHelper DEBUG module field size is 14 field index = 73 -MdtIdHelper DEBUG module field size is 2 field index = 74 +MdtIdHelper DEBUG module field size is 1 field index = 65 +MdtIdHelper DEBUG module field size is 1 field index = 66 +MdtIdHelper DEBUG module field size is 7 field index = 67 +MdtIdHelper DEBUG module field size is 6 field index = 68 +MdtIdHelper DEBUG module field size is 2 field index = 69 +MdtIdHelper DEBUG module field size is 1 field index = 70 +MdtIdHelper DEBUG module field size is 14 field index = 71 +MdtIdHelper DEBUG module field size is 2 field index = 72 +MdtIdHelper DEBUG module field size is 16 field index = 73 +MdtIdHelper DEBUG module field size is 16 field index = 74 MdtIdHelper DEBUG module field size is 16 field index = 75 -MdtIdHelper DEBUG module field size is 16 field index = 76 -MdtIdHelper DEBUG module field size is 16 field index = 77 -MdtIdHelper DEBUG module field size is 10 field index = 78 -MdtIdHelper DEBUG module field size is 2 field index = 79 +MdtIdHelper DEBUG module field size is 10 field index = 76 +MdtIdHelper DEBUG module field size is 2 field index = 77 +MdtIdHelper DEBUG module field size is 12 field index = 78 +MdtIdHelper DEBUG module field size is 12 field index = 79 MdtIdHelper DEBUG module field size is 12 field index = 80 MdtIdHelper DEBUG module field size is 12 field index = 81 MdtIdHelper DEBUG module field size is 12 field index = 82 -MdtIdHelper DEBUG module field size is 12 field index = 83 -MdtIdHelper DEBUG module field size is 12 field index = 84 +MdtIdHelper DEBUG module field size is 4 field index = 83 +MdtIdHelper DEBUG module field size is 4 field index = 84 MdtIdHelper DEBUG module field size is 4 field index = 85 MdtIdHelper DEBUG module field size is 4 field index = 86 -MdtIdHelper DEBUG module field size is 4 field index = 87 +MdtIdHelper DEBUG module field size is 2 field index = 87 MdtIdHelper DEBUG module field size is 4 field index = 88 -MdtIdHelper DEBUG module field size is 2 field index = 89 +MdtIdHelper DEBUG module field size is 4 field index = 89 MdtIdHelper DEBUG module field size is 4 field index = 90 MdtIdHelper DEBUG module field size is 4 field index = 91 MdtIdHelper DEBUG module field size is 4 field index = 92 -MdtIdHelper DEBUG module field size is 4 field index = 93 +MdtIdHelper DEBUG module field size is 8 field index = 93 MdtIdHelper DEBUG module field size is 4 field index = 94 -MdtIdHelper DEBUG module field size is 8 field index = 95 -MdtIdHelper DEBUG module field size is 4 field index = 96 -MdtIdHelper DEBUG module field size is 4 field index = 97 -MdtIdHelper DEBUG module field size is 14 field index = 98 -MdtIdHelper DEBUG module field size is 14 field index = 99 -MdtIdHelper DEBUG module field size is 2 field index = 100 +MdtIdHelper DEBUG module field size is 4 field index = 95 +MdtIdHelper DEBUG module field size is 14 field index = 96 +MdtIdHelper DEBUG module field size is 14 field index = 97 +MdtIdHelper DEBUG module field size is 2 field index = 98 +MdtIdHelper DEBUG module field size is 16 field index = 99 +MdtIdHelper DEBUG module field size is 16 field index = 100 MdtIdHelper DEBUG module field size is 16 field index = 101 MdtIdHelper DEBUG module field size is 16 field index = 102 MdtIdHelper DEBUG module field size is 16 field index = 103 @@ -1798,13 +1806,11 @@ MdtIdHelper DEBUG module field size is 16 field index = 119 MdtIdHelper DEBUG module field size is 16 field index = 120 MdtIdHelper DEBUG module field size is 16 field index = 121 MdtIdHelper DEBUG module field size is 16 field index = 122 -MdtIdHelper DEBUG module field size is 16 field index = 123 -MdtIdHelper DEBUG module field size is 16 field index = 124 -MdtIdHelper DEBUG module field size is 2 field index = 125 -MdtIdHelper DEBUG module field size is 2 field index = 126 +MdtIdHelper DEBUG module field size is 2 field index = 123 +MdtIdHelper DEBUG module field size is 2 field index = 124 +MdtIdHelper DEBUG module field size is 4 field index = 125 +MdtIdHelper DEBUG module field size is 4 field index = 126 MdtIdHelper DEBUG module field size is 4 field index = 127 -MdtIdHelper DEBUG module field size is 4 field index = 128 -MdtIdHelper DEBUG module field size is 4 field index = 129 MdtIdHelper DEBUG detector element field size is 10 field index = 0 MdtIdHelper DEBUG detector element field size is 2 field index = 1 MdtIdHelper DEBUG detector element field size is 8 field index = 2 @@ -1839,79 +1845,79 @@ MdtIdHelper DEBUG detector element field size is 32 field index = 30 MdtIdHelper DEBUG detector element field size is 32 field index = 31 MdtIdHelper DEBUG detector element field size is 32 field index = 32 MdtIdHelper DEBUG detector element field size is 32 field index = 33 -MdtIdHelper DEBUG detector element field size is 20 field index = 34 -MdtIdHelper DEBUG detector element field size is 12 field index = 35 +MdtIdHelper DEBUG detector element field size is 32 field index = 34 +MdtIdHelper DEBUG detector element field size is 16 field index = 35 MdtIdHelper DEBUG detector element field size is 16 field index = 36 -MdtIdHelper DEBUG detector element field size is 16 field index = 37 -MdtIdHelper DEBUG detector element field size is 16 field index = 38 +MdtIdHelper DEBUG detector element field size is 2 field index = 37 +MdtIdHelper DEBUG detector element field size is 2 field index = 38 MdtIdHelper DEBUG detector element field size is 2 field index = 39 MdtIdHelper DEBUG detector element field size is 2 field index = 40 -MdtIdHelper DEBUG detector element field size is 2 field index = 41 -MdtIdHelper DEBUG detector element field size is 2 field index = 42 -MdtIdHelper DEBUG detector element field size is 4 field index = 43 -MdtIdHelper DEBUG detector element field size is 4 field index = 44 -MdtIdHelper DEBUG detector element field size is 2 field index = 45 -MdtIdHelper DEBUG detector element field size is 8 field index = 46 -MdtIdHelper DEBUG detector element field size is 4 field index = 47 -MdtIdHelper DEBUG detector element field size is 2 field index = 48 -MdtIdHelper DEBUG detector element field size is 64 field index = 49 -MdtIdHelper DEBUG detector element field size is 32 field index = 50 +MdtIdHelper DEBUG detector element field size is 4 field index = 41 +MdtIdHelper DEBUG detector element field size is 4 field index = 42 +MdtIdHelper DEBUG detector element field size is 2 field index = 43 +MdtIdHelper DEBUG detector element field size is 8 field index = 44 +MdtIdHelper DEBUG detector element field size is 4 field index = 45 +MdtIdHelper DEBUG detector element field size is 2 field index = 46 +MdtIdHelper DEBUG detector element field size is 64 field index = 47 +MdtIdHelper DEBUG detector element field size is 32 field index = 48 +MdtIdHelper DEBUG detector element field size is 28 field index = 49 +MdtIdHelper DEBUG detector element field size is 4 field index = 50 MdtIdHelper DEBUG detector element field size is 28 field index = 51 MdtIdHelper DEBUG detector element field size is 4 field index = 52 -MdtIdHelper DEBUG detector element field size is 28 field index = 53 -MdtIdHelper DEBUG detector element field size is 4 field index = 54 +MdtIdHelper DEBUG detector element field size is 24 field index = 53 +MdtIdHelper DEBUG detector element field size is 24 field index = 54 MdtIdHelper DEBUG detector element field size is 24 field index = 55 -MdtIdHelper DEBUG detector element field size is 24 field index = 56 -MdtIdHelper DEBUG detector element field size is 24 field index = 57 -MdtIdHelper DEBUG detector element field size is 12 field index = 58 +MdtIdHelper DEBUG detector element field size is 12 field index = 56 +MdtIdHelper DEBUG detector element field size is 12 field index = 57 +MdtIdHelper DEBUG detector element field size is 24 field index = 58 MdtIdHelper DEBUG detector element field size is 12 field index = 59 -MdtIdHelper DEBUG detector element field size is 24 field index = 60 -MdtIdHelper DEBUG detector element field size is 12 field index = 61 -MdtIdHelper DEBUG detector element field size is 12 field index = 62 +MdtIdHelper DEBUG detector element field size is 12 field index = 60 +MdtIdHelper DEBUG detector element field size is 8 field index = 61 +MdtIdHelper DEBUG detector element field size is 8 field index = 62 MdtIdHelper DEBUG detector element field size is 8 field index = 63 -MdtIdHelper DEBUG detector element field size is 8 field index = 64 -MdtIdHelper DEBUG detector element field size is 8 field index = 65 +MdtIdHelper DEBUG detector element field size is 4 field index = 64 +MdtIdHelper DEBUG detector element field size is 2 field index = 65 MdtIdHelper DEBUG detector element field size is 4 field index = 66 MdtIdHelper DEBUG detector element field size is 2 field index = 67 -MdtIdHelper DEBUG detector element field size is 4 field index = 68 -MdtIdHelper DEBUG detector element field size is 2 field index = 69 +MdtIdHelper DEBUG detector element field size is 6 field index = 68 +MdtIdHelper DEBUG detector element field size is 4 field index = 69 MdtIdHelper DEBUG detector element field size is 6 field index = 70 -MdtIdHelper DEBUG detector element field size is 4 field index = 71 -MdtIdHelper DEBUG detector element field size is 6 field index = 72 -MdtIdHelper DEBUG detector element field size is 2 field index = 73 -MdtIdHelper DEBUG detector element field size is 2 field index = 74 -MdtIdHelper DEBUG detector element field size is 14 field index = 75 -MdtIdHelper DEBUG detector element field size is 12 field index = 76 -MdtIdHelper DEBUG detector element field size is 4 field index = 77 -MdtIdHelper DEBUG detector element field size is 2 field index = 78 -MdtIdHelper DEBUG detector element field size is 28 field index = 79 -MdtIdHelper DEBUG detector element field size is 4 field index = 80 +MdtIdHelper DEBUG detector element field size is 2 field index = 71 +MdtIdHelper DEBUG detector element field size is 2 field index = 72 +MdtIdHelper DEBUG detector element field size is 14 field index = 73 +MdtIdHelper DEBUG detector element field size is 12 field index = 74 +MdtIdHelper DEBUG detector element field size is 4 field index = 75 +MdtIdHelper DEBUG detector element field size is 2 field index = 76 +MdtIdHelper DEBUG detector element field size is 28 field index = 77 +MdtIdHelper DEBUG detector element field size is 4 field index = 78 +MdtIdHelper DEBUG detector element field size is 32 field index = 79 +MdtIdHelper DEBUG detector element field size is 32 field index = 80 MdtIdHelper DEBUG detector element field size is 32 field index = 81 -MdtIdHelper DEBUG detector element field size is 32 field index = 82 -MdtIdHelper DEBUG detector element field size is 32 field index = 83 -MdtIdHelper DEBUG detector element field size is 20 field index = 84 -MdtIdHelper DEBUG detector element field size is 4 field index = 85 +MdtIdHelper DEBUG detector element field size is 20 field index = 82 +MdtIdHelper DEBUG detector element field size is 4 field index = 83 +MdtIdHelper DEBUG detector element field size is 24 field index = 84 +MdtIdHelper DEBUG detector element field size is 24 field index = 85 MdtIdHelper DEBUG detector element field size is 24 field index = 86 MdtIdHelper DEBUG detector element field size is 24 field index = 87 MdtIdHelper DEBUG detector element field size is 24 field index = 88 -MdtIdHelper DEBUG detector element field size is 24 field index = 89 -MdtIdHelper DEBUG detector element field size is 24 field index = 90 +MdtIdHelper DEBUG detector element field size is 8 field index = 89 +MdtIdHelper DEBUG detector element field size is 8 field index = 90 MdtIdHelper DEBUG detector element field size is 8 field index = 91 MdtIdHelper DEBUG detector element field size is 8 field index = 92 -MdtIdHelper DEBUG detector element field size is 8 field index = 93 +MdtIdHelper DEBUG detector element field size is 4 field index = 93 MdtIdHelper DEBUG detector element field size is 8 field index = 94 -MdtIdHelper DEBUG detector element field size is 4 field index = 95 +MdtIdHelper DEBUG detector element field size is 8 field index = 95 MdtIdHelper DEBUG detector element field size is 8 field index = 96 MdtIdHelper DEBUG detector element field size is 8 field index = 97 MdtIdHelper DEBUG detector element field size is 8 field index = 98 -MdtIdHelper DEBUG detector element field size is 8 field index = 99 +MdtIdHelper DEBUG detector element field size is 16 field index = 99 MdtIdHelper DEBUG detector element field size is 8 field index = 100 -MdtIdHelper DEBUG detector element field size is 16 field index = 101 -MdtIdHelper DEBUG detector element field size is 8 field index = 102 -MdtIdHelper DEBUG detector element field size is 8 field index = 103 -MdtIdHelper DEBUG detector element field size is 28 field index = 104 -MdtIdHelper DEBUG detector element field size is 28 field index = 105 -MdtIdHelper DEBUG detector element field size is 4 field index = 106 +MdtIdHelper DEBUG detector element field size is 8 field index = 101 +MdtIdHelper DEBUG detector element field size is 28 field index = 102 +MdtIdHelper DEBUG detector element field size is 28 field index = 103 +MdtIdHelper DEBUG detector element field size is 4 field index = 104 +MdtIdHelper DEBUG detector element field size is 32 field index = 105 +MdtIdHelper DEBUG detector element field size is 32 field index = 106 MdtIdHelper DEBUG detector element field size is 32 field index = 107 MdtIdHelper DEBUG detector element field size is 32 field index = 108 MdtIdHelper DEBUG detector element field size is 32 field index = 109 @@ -1934,13 +1940,11 @@ MdtIdHelper DEBUG detector element field size is 32 field index = 125 MdtIdHelper DEBUG detector element field size is 32 field index = 126 MdtIdHelper DEBUG detector element field size is 32 field index = 127 MdtIdHelper DEBUG detector element field size is 32 field index = 128 -MdtIdHelper DEBUG detector element field size is 32 field index = 129 -MdtIdHelper DEBUG detector element field size is 32 field index = 130 -MdtIdHelper DEBUG detector element field size is 4 field index = 131 -MdtIdHelper DEBUG detector element field size is 4 field index = 132 +MdtIdHelper DEBUG detector element field size is 4 field index = 129 +MdtIdHelper DEBUG detector element field size is 4 field index = 130 +MdtIdHelper DEBUG detector element field size is 8 field index = 131 +MdtIdHelper DEBUG detector element field size is 8 field index = 132 MdtIdHelper DEBUG detector element field size is 8 field index = 133 -MdtIdHelper DEBUG detector element field size is 8 field index = 134 -MdtIdHelper DEBUG detector element field size is 8 field index = 135 MdtIdHelper DEBUG channel field size is 1200 field index = 0 MdtIdHelper DEBUG channel field size is 192 field index = 1 MdtIdHelper DEBUG channel field size is 960 field index = 2 @@ -1975,82 +1979,82 @@ MdtIdHelper DEBUG channel field size is 3840 field index = 30 MdtIdHelper DEBUG channel field size is 3840 field index = 31 MdtIdHelper DEBUG channel field size is 3840 field index = 32 MdtIdHelper DEBUG channel field size is 3840 field index = 33 -MdtIdHelper DEBUG channel field size is 2400 field index = 34 -MdtIdHelper DEBUG channel field size is 1728 field index = 35 -MdtIdHelper DEBUG channel field size is 768 field index = 36 -MdtIdHelper DEBUG channel field size is 3072 field index = 37 -MdtIdHelper DEBUG channel field size is 3072 field index = 38 -MdtIdHelper DEBUG channel field size is 192 field index = 39 -MdtIdHelper DEBUG channel field size is 288 field index = 40 -MdtIdHelper DEBUG channel field size is 240 field index = 41 -MdtIdHelper DEBUG channel field size is 336 field index = 42 -MdtIdHelper DEBUG channel field size is 672 field index = 43 -MdtIdHelper DEBUG channel field size is 576 field index = 44 -MdtIdHelper DEBUG channel field size is 288 field index = 45 -MdtIdHelper DEBUG channel field size is 960 field index = 46 -MdtIdHelper DEBUG channel field size is 384 field index = 47 -MdtIdHelper DEBUG channel field size is 192 field index = 48 -MdtIdHelper DEBUG channel field size is 10752 field index = 49 -MdtIdHelper DEBUG channel field size is 3840 field index = 50 -MdtIdHelper DEBUG channel field size is 3360 field index = 51 -MdtIdHelper DEBUG channel field size is 576 field index = 52 +MdtIdHelper DEBUG channel field size is 14080 field index = 34 +MdtIdHelper DEBUG channel field size is 3072 field index = 35 +MdtIdHelper DEBUG channel field size is 3072 field index = 36 +MdtIdHelper DEBUG channel field size is 192 field index = 37 +MdtIdHelper DEBUG channel field size is 288 field index = 38 +MdtIdHelper DEBUG channel field size is 240 field index = 39 +MdtIdHelper DEBUG channel field size is 336 field index = 40 +MdtIdHelper DEBUG channel field size is 672 field index = 41 +MdtIdHelper DEBUG channel field size is 576 field index = 42 +MdtIdHelper DEBUG channel field size is 288 field index = 43 +MdtIdHelper DEBUG channel field size is 960 field index = 44 +MdtIdHelper DEBUG channel field size is 384 field index = 45 +MdtIdHelper DEBUG channel field size is 192 field index = 46 +MdtIdHelper DEBUG channel field size is 10752 field index = 47 +MdtIdHelper DEBUG channel field size is 3840 field index = 48 +MdtIdHelper DEBUG channel field size is 3360 field index = 49 +MdtIdHelper DEBUG channel field size is 576 field index = 50 +MdtIdHelper DEBUG channel field size is 4032 field index = 51 +MdtIdHelper DEBUG channel field size is 192 field index = 52 MdtIdHelper DEBUG channel field size is 4032 field index = 53 -MdtIdHelper DEBUG channel field size is 192 field index = 54 -MdtIdHelper DEBUG channel field size is 4032 field index = 55 -MdtIdHelper DEBUG channel field size is 3456 field index = 56 -MdtIdHelper DEBUG channel field size is 3456 field index = 57 -MdtIdHelper DEBUG channel field size is 1440 field index = 58 -MdtIdHelper DEBUG channel field size is 1728 field index = 59 -MdtIdHelper DEBUG channel field size is 2304 field index = 60 -MdtIdHelper DEBUG channel field size is 1440 field index = 61 -MdtIdHelper DEBUG channel field size is 1728 field index = 62 -MdtIdHelper DEBUG channel field size is 1728 field index = 63 -MdtIdHelper DEBUG channel field size is 1536 field index = 64 -MdtIdHelper DEBUG channel field size is 1152 field index = 65 -MdtIdHelper DEBUG channel field size is 864 field index = 66 -MdtIdHelper DEBUG channel field size is 384 field index = 67 -MdtIdHelper DEBUG channel field size is 576 field index = 68 -MdtIdHelper DEBUG channel field size is 288 field index = 69 -MdtIdHelper DEBUG channel field size is 1008 field index = 70 -MdtIdHelper DEBUG channel field size is 672 field index = 71 -MdtIdHelper DEBUG channel field size is 864 field index = 72 -MdtIdHelper DEBUG channel field size is 336 field index = 73 -MdtIdHelper DEBUG channel field size is 432 field index = 74 -MdtIdHelper DEBUG channel field size is 3024 field index = 75 -MdtIdHelper DEBUG channel field size is 2592 field index = 76 -MdtIdHelper DEBUG channel field size is 576 field index = 77 -MdtIdHelper DEBUG channel field size is 288 field index = 78 -MdtIdHelper DEBUG channel field size is 4704 field index = 79 -MdtIdHelper DEBUG channel field size is 576 field index = 80 -MdtIdHelper DEBUG channel field size is 6912 field index = 81 -MdtIdHelper DEBUG channel field size is 6912 field index = 82 -MdtIdHelper DEBUG channel field size is 5376 field index = 83 -MdtIdHelper DEBUG channel field size is 4320 field index = 84 -MdtIdHelper DEBUG channel field size is 576 field index = 85 +MdtIdHelper DEBUG channel field size is 3456 field index = 54 +MdtIdHelper DEBUG channel field size is 3456 field index = 55 +MdtIdHelper DEBUG channel field size is 1440 field index = 56 +MdtIdHelper DEBUG channel field size is 1728 field index = 57 +MdtIdHelper DEBUG channel field size is 2304 field index = 58 +MdtIdHelper DEBUG channel field size is 1440 field index = 59 +MdtIdHelper DEBUG channel field size is 1728 field index = 60 +MdtIdHelper DEBUG channel field size is 1728 field index = 61 +MdtIdHelper DEBUG channel field size is 1536 field index = 62 +MdtIdHelper DEBUG channel field size is 1152 field index = 63 +MdtIdHelper DEBUG channel field size is 864 field index = 64 +MdtIdHelper DEBUG channel field size is 384 field index = 65 +MdtIdHelper DEBUG channel field size is 576 field index = 66 +MdtIdHelper DEBUG channel field size is 288 field index = 67 +MdtIdHelper DEBUG channel field size is 1008 field index = 68 +MdtIdHelper DEBUG channel field size is 672 field index = 69 +MdtIdHelper DEBUG channel field size is 864 field index = 70 +MdtIdHelper DEBUG channel field size is 336 field index = 71 +MdtIdHelper DEBUG channel field size is 432 field index = 72 +MdtIdHelper DEBUG channel field size is 3024 field index = 73 +MdtIdHelper DEBUG channel field size is 2592 field index = 74 +MdtIdHelper DEBUG channel field size is 576 field index = 75 +MdtIdHelper DEBUG channel field size is 288 field index = 76 +MdtIdHelper DEBUG channel field size is 4704 field index = 77 +MdtIdHelper DEBUG channel field size is 576 field index = 78 +MdtIdHelper DEBUG channel field size is 6912 field index = 79 +MdtIdHelper DEBUG channel field size is 6912 field index = 80 +MdtIdHelper DEBUG channel field size is 5376 field index = 81 +MdtIdHelper DEBUG channel field size is 4320 field index = 82 +MdtIdHelper DEBUG channel field size is 576 field index = 83 +MdtIdHelper DEBUG channel field size is 5184 field index = 84 +MdtIdHelper DEBUG channel field size is 5184 field index = 85 MdtIdHelper DEBUG channel field size is 5184 field index = 86 MdtIdHelper DEBUG channel field size is 5184 field index = 87 -MdtIdHelper DEBUG channel field size is 5184 field index = 88 -MdtIdHelper DEBUG channel field size is 5184 field index = 89 -MdtIdHelper DEBUG channel field size is 4608 field index = 90 -MdtIdHelper DEBUG channel field size is 1728 field index = 91 -MdtIdHelper DEBUG channel field size is 1536 field index = 92 -MdtIdHelper DEBUG channel field size is 1152 field index = 93 +MdtIdHelper DEBUG channel field size is 4608 field index = 88 +MdtIdHelper DEBUG channel field size is 1728 field index = 89 +MdtIdHelper DEBUG channel field size is 1536 field index = 90 +MdtIdHelper DEBUG channel field size is 1152 field index = 91 +MdtIdHelper DEBUG channel field size is 960 field index = 92 +MdtIdHelper DEBUG channel field size is 480 field index = 93 MdtIdHelper DEBUG channel field size is 960 field index = 94 -MdtIdHelper DEBUG channel field size is 480 field index = 95 +MdtIdHelper DEBUG channel field size is 960 field index = 95 MdtIdHelper DEBUG channel field size is 960 field index = 96 MdtIdHelper DEBUG channel field size is 960 field index = 97 -MdtIdHelper DEBUG channel field size is 960 field index = 98 -MdtIdHelper DEBUG channel field size is 960 field index = 99 -MdtIdHelper DEBUG channel field size is 384 field index = 100 -MdtIdHelper DEBUG channel field size is 3456 field index = 101 -MdtIdHelper DEBUG channel field size is 1344 field index = 102 -MdtIdHelper DEBUG channel field size is 1344 field index = 103 -MdtIdHelper DEBUG channel field size is 3360 field index = 104 -MdtIdHelper DEBUG channel field size is 3360 field index = 105 -MdtIdHelper DEBUG channel field size is 576 field index = 106 -MdtIdHelper DEBUG channel field size is 4608 field index = 107 -MdtIdHelper DEBUG channel field size is 3840 field index = 108 -MdtIdHelper DEBUG channel field size is 5376 field index = 109 +MdtIdHelper DEBUG channel field size is 384 field index = 98 +MdtIdHelper DEBUG channel field size is 3456 field index = 99 +MdtIdHelper DEBUG channel field size is 1344 field index = 100 +MdtIdHelper DEBUG channel field size is 1344 field index = 101 +MdtIdHelper DEBUG channel field size is 3360 field index = 102 +MdtIdHelper DEBUG channel field size is 3360 field index = 103 +MdtIdHelper DEBUG channel field size is 576 field index = 104 +MdtIdHelper DEBUG channel field size is 4608 field index = 105 +MdtIdHelper DEBUG channel field size is 3840 field index = 106 +MdtIdHelper DEBUG channel field size is 5376 field index = 107 +MdtIdHelper DEBUG channel field size is 6144 field index = 108 +MdtIdHelper DEBUG channel field size is 6144 field index = 109 MdtIdHelper DEBUG channel field size is 6144 field index = 110 MdtIdHelper DEBUG channel field size is 6144 field index = 111 MdtIdHelper DEBUG channel field size is 6144 field index = 112 @@ -2058,30 +2062,29 @@ MdtIdHelper DEBUG channel field size is 6144 field index = 113 MdtIdHelper DEBUG channel field size is 6144 field index = 114 MdtIdHelper DEBUG channel field size is 6144 field index = 115 MdtIdHelper DEBUG channel field size is 6144 field index = 116 -MdtIdHelper DEBUG channel field size is 6144 field index = 117 -MdtIdHelper DEBUG channel field size is 6144 field index = 118 -MdtIdHelper DEBUG channel field size is 5376 field index = 119 -MdtIdHelper DEBUG channel field size is 5376 field index = 120 +MdtIdHelper DEBUG channel field size is 5376 field index = 117 +MdtIdHelper DEBUG channel field size is 5376 field index = 118 +MdtIdHelper DEBUG channel field size is 4608 field index = 119 +MdtIdHelper DEBUG channel field size is 4608 field index = 120 MdtIdHelper DEBUG channel field size is 4608 field index = 121 MdtIdHelper DEBUG channel field size is 4608 field index = 122 -MdtIdHelper DEBUG channel field size is 4608 field index = 123 -MdtIdHelper DEBUG channel field size is 4608 field index = 124 +MdtIdHelper DEBUG channel field size is 5376 field index = 123 +MdtIdHelper DEBUG channel field size is 5376 field index = 124 MdtIdHelper DEBUG channel field size is 5376 field index = 125 -MdtIdHelper DEBUG channel field size is 5376 field index = 126 -MdtIdHelper DEBUG channel field size is 5376 field index = 127 +MdtIdHelper DEBUG channel field size is 4608 field index = 126 +MdtIdHelper DEBUG channel field size is 4608 field index = 127 MdtIdHelper DEBUG channel field size is 4608 field index = 128 -MdtIdHelper DEBUG channel field size is 4608 field index = 129 -MdtIdHelper DEBUG channel field size is 4608 field index = 130 -MdtIdHelper DEBUG channel field size is 1248 field index = 131 -MdtIdHelper DEBUG channel field size is 864 field index = 132 +MdtIdHelper DEBUG channel field size is 1248 field index = 129 +MdtIdHelper DEBUG channel field size is 864 field index = 130 +MdtIdHelper DEBUG channel field size is 1728 field index = 131 +MdtIdHelper DEBUG channel field size is 1728 field index = 132 MdtIdHelper DEBUG channel field size is 1728 field index = 133 -MdtIdHelper DEBUG channel field size is 1728 field index = 134 -MdtIdHelper DEBUG channel field size is 1728 field index = 135 MdtIdHelper INFO Initializing MDT hash indices ... -MdtIdHelper INFO The element hash max is 1108 -MdtIdHelper INFO The detector element hash max is 2168 +MdtIdHelper INFO The element hash max is 1092 +MdtIdHelper INFO The detector element hash max is 2152 MdtIdHelper INFO Initializing MDT hash indices for finding neighbors ... MdtIdHelper VERBOSE MuonIdHelper::init_neighbors +MdtIdHelper DEBUG Maximum number of MDT tubes is 110 RpcIdHelper DEBUG (Re)initialize AtlasDetectorIDHelper::initialize_from_dictionary - Warning: unable to find csc region index: group, region size 0 0 AtlasDetectorID DEBUG Could not get value for label 'no_side' of field 'DetZside' in dictionary Calorimeter @@ -2095,182 +2098,185 @@ RpcIdHelper DEBUG technology decode 1 vals 0,2 mask/zero m RpcIdHelper DEBUG TR decode 1 vals 1:2 mask/zero mask/shift/bits/offset 1 ffffbfffffffffff 46 1 17 indexes mode both_bounded RpcIdHelper DEBUG TZ decode 1 vals 1:3 mask/zero mask/shift/bits/offset 3 ffffcfffffffffff 44 2 18 indexes mode both_bounded RpcIdHelper DEBUG TPHI decode 1 vals 1:2 mask/zero mask/shift/bits/offset 1 fffff7ffffffffff 43 1 20 indexes mode both_bounded -RpcIdHelper DEBUG gas gap decode 1 vals 1:2 mask/zero mask/shift/bits/offset 1 fffffbffffffffff 42 1 21 indexes mode both_bounded -RpcIdHelper DEBUG phi decode 0 vals 0:1 mask/zero mask/shift/bits/offset 1 fffffdffffffffff 41 1 22 indexes mode both_bounded -RpcIdHelper DEBUG strip decode 1 vals 1:99 mask/zero mask/shift/bits/offset 7f fffffe03ffffffff 34 7 23 indexes mode both_bounded -RpcIdHelper INFO MultiRange built successfully to doubletR: MultiRange size is 246 -RpcIdHelper INFO MultiRange built successfully to detectorElement: DetectorElement MultiRange size is 246 -RpcIdHelper INFO MultiRange built successfully to rpcStrip: MultiRange size is 246 -RpcIdHelper DEBUG field size is 4 field index = 136 -RpcIdHelper DEBUG field size is 2 field index = 137 +RpcIdHelper DEBUG gas gap decode 1 vals 1:3 mask/zero mask/shift/bits/offset 3 fffff9ffffffffff 41 2 21 indexes mode both_bounded +RpcIdHelper DEBUG phi decode 0 vals 0:1 mask/zero mask/shift/bits/offset 1 fffffeffffffffff 40 1 23 indexes mode both_bounded +RpcIdHelper DEBUG strip decode 1 vals 1:99 mask/zero mask/shift/bits/offset 7f ffffff01ffffffff 33 7 24 indexes mode both_bounded +RpcIdHelper INFO MultiRange built successfully to doubletR: MultiRange size is 245 +RpcIdHelper INFO MultiRange built successfully to detectorElement: DetectorElement MultiRange size is 245 +RpcIdHelper INFO MultiRange built successfully to rpcStrip: MultiRange size is 245 +RpcIdHelper DEBUG field size is 4 field index = 134 +RpcIdHelper DEBUG field size is 2 field index = 135 +RpcIdHelper DEBUG field size is 2 field index = 136 +RpcIdHelper DEBUG field size is 4 field index = 137 RpcIdHelper DEBUG field size is 2 field index = 138 -RpcIdHelper DEBUG field size is 4 field index = 139 -RpcIdHelper DEBUG field size is 2 field index = 140 +RpcIdHelper DEBUG field size is 2 field index = 139 +RpcIdHelper DEBUG field size is 4 field index = 140 RpcIdHelper DEBUG field size is 2 field index = 141 -RpcIdHelper DEBUG field size is 4 field index = 142 -RpcIdHelper DEBUG field size is 2 field index = 143 -RpcIdHelper DEBUG field size is 2 field index = 144 -RpcIdHelper DEBUG field size is 8 field index = 145 -RpcIdHelper DEBUG field size is 32 field index = 146 -RpcIdHelper DEBUG field size is 32 field index = 147 +RpcIdHelper DEBUG field size is 2 field index = 142 +RpcIdHelper DEBUG field size is 8 field index = 143 +RpcIdHelper DEBUG field size is 32 field index = 144 +RpcIdHelper DEBUG field size is 32 field index = 145 +RpcIdHelper DEBUG field size is 28 field index = 146 +RpcIdHelper DEBUG field size is 4 field index = 147 RpcIdHelper DEBUG field size is 28 field index = 148 RpcIdHelper DEBUG field size is 4 field index = 149 RpcIdHelper DEBUG field size is 28 field index = 150 -RpcIdHelper DEBUG field size is 4 field index = 151 -RpcIdHelper DEBUG field size is 28 field index = 152 -RpcIdHelper DEBUG field size is 2 field index = 153 -RpcIdHelper DEBUG field size is 14 field index = 154 +RpcIdHelper DEBUG field size is 2 field index = 151 +RpcIdHelper DEBUG field size is 14 field index = 152 +RpcIdHelper DEBUG field size is 24 field index = 153 +RpcIdHelper DEBUG field size is 24 field index = 154 RpcIdHelper DEBUG field size is 24 field index = 155 -RpcIdHelper DEBUG field size is 24 field index = 156 -RpcIdHelper DEBUG field size is 24 field index = 157 -RpcIdHelper DEBUG field size is 12 field index = 158 -RpcIdHelper DEBUG field size is 12 field index = 159 -RpcIdHelper DEBUG field size is 24 field index = 160 -RpcIdHelper DEBUG field size is 24 field index = 161 -RpcIdHelper DEBUG field size is 8 field index = 162 -RpcIdHelper DEBUG field size is 8 field index = 163 +RpcIdHelper DEBUG field size is 12 field index = 156 +RpcIdHelper DEBUG field size is 12 field index = 157 +RpcIdHelper DEBUG field size is 24 field index = 158 +RpcIdHelper DEBUG field size is 24 field index = 159 +RpcIdHelper DEBUG field size is 8 field index = 160 +RpcIdHelper DEBUG field size is 8 field index = 161 +RpcIdHelper DEBUG field size is 16 field index = 162 +RpcIdHelper DEBUG field size is 16 field index = 163 RpcIdHelper DEBUG field size is 16 field index = 164 RpcIdHelper DEBUG field size is 16 field index = 165 RpcIdHelper DEBUG field size is 16 field index = 166 -RpcIdHelper DEBUG field size is 16 field index = 167 -RpcIdHelper DEBUG field size is 16 field index = 168 +RpcIdHelper DEBUG field size is 12 field index = 167 +RpcIdHelper DEBUG field size is 12 field index = 168 RpcIdHelper DEBUG field size is 12 field index = 169 RpcIdHelper DEBUG field size is 12 field index = 170 RpcIdHelper DEBUG field size is 12 field index = 171 RpcIdHelper DEBUG field size is 12 field index = 172 -RpcIdHelper DEBUG field size is 12 field index = 173 -RpcIdHelper DEBUG field size is 12 field index = 174 -RpcIdHelper DEBUG field size is 8 field index = 175 -RpcIdHelper DEBUG field size is 8 field index = 176 +RpcIdHelper DEBUG field size is 8 field index = 173 +RpcIdHelper DEBUG field size is 8 field index = 174 +RpcIdHelper DEBUG field size is 4 field index = 175 +RpcIdHelper DEBUG field size is 4 field index = 176 RpcIdHelper DEBUG field size is 4 field index = 177 -RpcIdHelper DEBUG field size is 4 field index = 178 -RpcIdHelper DEBUG field size is 4 field index = 179 +RpcIdHelper DEBUG field size is 8 field index = 178 +RpcIdHelper DEBUG field size is 8 field index = 179 RpcIdHelper DEBUG field size is 8 field index = 180 -RpcIdHelper DEBUG field size is 8 field index = 181 -RpcIdHelper DEBUG field size is 8 field index = 182 -RpcIdHelper DEBUG field size is 2 field index = 183 -RpcIdHelper DEBUG field size is 4 field index = 184 -RpcIdHelper DEBUG field size is 4 field index = 185 -RpcIdHelper DEBUG field size is 8 field index = 186 -RpcIdHelper DEBUG field size is 8 field index = 187 -RpcIdHelper DEBUG field size is 4 field index = 188 -RpcIdHelper DEBUG field size is 2 field index = 189 -RpcIdHelper DEBUG detectorElement field size is 16 field index = 136 -RpcIdHelper DEBUG detectorElement field size is 4 field index = 137 +RpcIdHelper DEBUG field size is 2 field index = 181 +RpcIdHelper DEBUG field size is 4 field index = 182 +RpcIdHelper DEBUG field size is 4 field index = 183 +RpcIdHelper DEBUG field size is 8 field index = 184 +RpcIdHelper DEBUG field size is 8 field index = 185 +RpcIdHelper DEBUG field size is 4 field index = 186 +RpcIdHelper DEBUG field size is 2 field index = 187 +RpcIdHelper DEBUG field size is 16 field index = 188 +RpcIdHelper DEBUG detectorElement field size is 16 field index = 134 +RpcIdHelper DEBUG detectorElement field size is 4 field index = 135 +RpcIdHelper DEBUG detectorElement field size is 8 field index = 136 +RpcIdHelper DEBUG detectorElement field size is 16 field index = 137 RpcIdHelper DEBUG detectorElement field size is 8 field index = 138 -RpcIdHelper DEBUG detectorElement field size is 16 field index = 139 +RpcIdHelper DEBUG detectorElement field size is 8 field index = 139 RpcIdHelper DEBUG detectorElement field size is 8 field index = 140 -RpcIdHelper DEBUG detectorElement field size is 8 field index = 141 -RpcIdHelper DEBUG detectorElement field size is 8 field index = 142 -RpcIdHelper DEBUG detectorElement field size is 4 field index = 143 -RpcIdHelper DEBUG detectorElement field size is 4 field index = 144 -RpcIdHelper DEBUG detectorElement field size is 16 field index = 145 -RpcIdHelper DEBUG detectorElement field size is 128 field index = 146 -RpcIdHelper DEBUG detectorElement field size is 128 field index = 147 +RpcIdHelper DEBUG detectorElement field size is 4 field index = 141 +RpcIdHelper DEBUG detectorElement field size is 4 field index = 142 +RpcIdHelper DEBUG detectorElement field size is 16 field index = 143 +RpcIdHelper DEBUG detectorElement field size is 128 field index = 144 +RpcIdHelper DEBUG detectorElement field size is 128 field index = 145 +RpcIdHelper DEBUG detectorElement field size is 56 field index = 146 +RpcIdHelper DEBUG detectorElement field size is 8 field index = 147 RpcIdHelper DEBUG detectorElement field size is 56 field index = 148 -RpcIdHelper DEBUG detectorElement field size is 8 field index = 149 -RpcIdHelper DEBUG detectorElement field size is 56 field index = 150 -RpcIdHelper DEBUG detectorElement field size is 16 field index = 151 -RpcIdHelper DEBUG detectorElement field size is 112 field index = 152 -RpcIdHelper DEBUG detectorElement field size is 4 field index = 153 -RpcIdHelper DEBUG detectorElement field size is 28 field index = 154 +RpcIdHelper DEBUG detectorElement field size is 16 field index = 149 +RpcIdHelper DEBUG detectorElement field size is 112 field index = 150 +RpcIdHelper DEBUG detectorElement field size is 4 field index = 151 +RpcIdHelper DEBUG detectorElement field size is 28 field index = 152 +RpcIdHelper DEBUG detectorElement field size is 96 field index = 153 +RpcIdHelper DEBUG detectorElement field size is 144 field index = 154 RpcIdHelper DEBUG detectorElement field size is 96 field index = 155 -RpcIdHelper DEBUG detectorElement field size is 144 field index = 156 -RpcIdHelper DEBUG detectorElement field size is 96 field index = 157 +RpcIdHelper DEBUG detectorElement field size is 48 field index = 156 +RpcIdHelper DEBUG detectorElement field size is 72 field index = 157 RpcIdHelper DEBUG detectorElement field size is 48 field index = 158 -RpcIdHelper DEBUG detectorElement field size is 72 field index = 159 -RpcIdHelper DEBUG detectorElement field size is 48 field index = 160 -RpcIdHelper DEBUG detectorElement field size is 96 field index = 161 -RpcIdHelper DEBUG detectorElement field size is 32 field index = 162 -RpcIdHelper DEBUG detectorElement field size is 32 field index = 163 +RpcIdHelper DEBUG detectorElement field size is 96 field index = 159 +RpcIdHelper DEBUG detectorElement field size is 32 field index = 160 +RpcIdHelper DEBUG detectorElement field size is 32 field index = 161 +RpcIdHelper DEBUG detectorElement field size is 64 field index = 162 +RpcIdHelper DEBUG detectorElement field size is 64 field index = 163 RpcIdHelper DEBUG detectorElement field size is 64 field index = 164 RpcIdHelper DEBUG detectorElement field size is 64 field index = 165 RpcIdHelper DEBUG detectorElement field size is 64 field index = 166 -RpcIdHelper DEBUG detectorElement field size is 64 field index = 167 -RpcIdHelper DEBUG detectorElement field size is 64 field index = 168 +RpcIdHelper DEBUG detectorElement field size is 48 field index = 167 +RpcIdHelper DEBUG detectorElement field size is 48 field index = 168 RpcIdHelper DEBUG detectorElement field size is 48 field index = 169 RpcIdHelper DEBUG detectorElement field size is 48 field index = 170 RpcIdHelper DEBUG detectorElement field size is 48 field index = 171 RpcIdHelper DEBUG detectorElement field size is 48 field index = 172 -RpcIdHelper DEBUG detectorElement field size is 48 field index = 173 -RpcIdHelper DEBUG detectorElement field size is 48 field index = 174 -RpcIdHelper DEBUG detectorElement field size is 32 field index = 175 -RpcIdHelper DEBUG detectorElement field size is 32 field index = 176 -RpcIdHelper DEBUG detectorElement field size is 8 field index = 177 -RpcIdHelper DEBUG detectorElement field size is 16 field index = 178 -RpcIdHelper DEBUG detectorElement field size is 16 field index = 179 -RpcIdHelper DEBUG detectorElement field size is 32 field index = 180 -RpcIdHelper DEBUG detectorElement field size is 32 field index = 181 -RpcIdHelper DEBUG detectorElement field size is 16 field index = 182 -RpcIdHelper DEBUG detectorElement field size is 4 field index = 183 -RpcIdHelper DEBUG detectorElement field size is 8 field index = 184 -RpcIdHelper DEBUG detectorElement field size is 8 field index = 185 -RpcIdHelper DEBUG detectorElement field size is 16 field index = 186 -RpcIdHelper DEBUG detectorElement field size is 16 field index = 187 -RpcIdHelper DEBUG detectorElement field size is 8 field index = 188 -RpcIdHelper DEBUG detectorElement field size is 4 field index = 189 -RpcIdHelper DEBUG channel field size is 6336 field index = 136 -RpcIdHelper DEBUG channel field size is 1584 field index = 137 +RpcIdHelper DEBUG detectorElement field size is 32 field index = 173 +RpcIdHelper DEBUG detectorElement field size is 32 field index = 174 +RpcIdHelper DEBUG detectorElement field size is 8 field index = 175 +RpcIdHelper DEBUG detectorElement field size is 16 field index = 176 +RpcIdHelper DEBUG detectorElement field size is 16 field index = 177 +RpcIdHelper DEBUG detectorElement field size is 32 field index = 178 +RpcIdHelper DEBUG detectorElement field size is 32 field index = 179 +RpcIdHelper DEBUG detectorElement field size is 16 field index = 180 +RpcIdHelper DEBUG detectorElement field size is 4 field index = 181 +RpcIdHelper DEBUG detectorElement field size is 8 field index = 182 +RpcIdHelper DEBUG detectorElement field size is 8 field index = 183 +RpcIdHelper DEBUG detectorElement field size is 16 field index = 184 +RpcIdHelper DEBUG detectorElement field size is 16 field index = 185 +RpcIdHelper DEBUG detectorElement field size is 8 field index = 186 +RpcIdHelper DEBUG detectorElement field size is 4 field index = 187 +RpcIdHelper DEBUG detectorElement field size is 64 field index = 188 +RpcIdHelper DEBUG channel field size is 6336 field index = 134 +RpcIdHelper DEBUG channel field size is 1584 field index = 135 +RpcIdHelper DEBUG channel field size is 3168 field index = 136 +RpcIdHelper DEBUG channel field size is 6336 field index = 137 RpcIdHelper DEBUG channel field size is 3168 field index = 138 -RpcIdHelper DEBUG channel field size is 6336 field index = 139 +RpcIdHelper DEBUG channel field size is 3168 field index = 139 RpcIdHelper DEBUG channel field size is 3168 field index = 140 -RpcIdHelper DEBUG channel field size is 3168 field index = 141 -RpcIdHelper DEBUG channel field size is 3168 field index = 142 -RpcIdHelper DEBUG channel field size is 1584 field index = 143 -RpcIdHelper DEBUG channel field size is 1584 field index = 144 -RpcIdHelper DEBUG channel field size is 6336 field index = 145 -RpcIdHelper DEBUG channel field size is 50688 field index = 146 -RpcIdHelper DEBUG channel field size is 50688 field index = 147 +RpcIdHelper DEBUG channel field size is 1584 field index = 141 +RpcIdHelper DEBUG channel field size is 1584 field index = 142 +RpcIdHelper DEBUG channel field size is 6336 field index = 143 +RpcIdHelper DEBUG channel field size is 50688 field index = 144 +RpcIdHelper DEBUG channel field size is 50688 field index = 145 +RpcIdHelper DEBUG channel field size is 22176 field index = 146 +RpcIdHelper DEBUG channel field size is 3168 field index = 147 RpcIdHelper DEBUG channel field size is 22176 field index = 148 -RpcIdHelper DEBUG channel field size is 3168 field index = 149 -RpcIdHelper DEBUG channel field size is 22176 field index = 150 -RpcIdHelper DEBUG channel field size is 6336 field index = 151 -RpcIdHelper DEBUG channel field size is 44352 field index = 152 -RpcIdHelper DEBUG channel field size is 1584 field index = 153 -RpcIdHelper DEBUG channel field size is 11088 field index = 154 +RpcIdHelper DEBUG channel field size is 6336 field index = 149 +RpcIdHelper DEBUG channel field size is 44352 field index = 150 +RpcIdHelper DEBUG channel field size is 1584 field index = 151 +RpcIdHelper DEBUG channel field size is 11088 field index = 152 +RpcIdHelper DEBUG channel field size is 38016 field index = 153 +RpcIdHelper DEBUG channel field size is 57024 field index = 154 RpcIdHelper DEBUG channel field size is 38016 field index = 155 -RpcIdHelper DEBUG channel field size is 57024 field index = 156 -RpcIdHelper DEBUG channel field size is 38016 field index = 157 +RpcIdHelper DEBUG channel field size is 19008 field index = 156 +RpcIdHelper DEBUG channel field size is 28512 field index = 157 RpcIdHelper DEBUG channel field size is 19008 field index = 158 -RpcIdHelper DEBUG channel field size is 28512 field index = 159 -RpcIdHelper DEBUG channel field size is 19008 field index = 160 -RpcIdHelper DEBUG channel field size is 38016 field index = 161 -RpcIdHelper DEBUG channel field size is 12672 field index = 162 -RpcIdHelper DEBUG channel field size is 12672 field index = 163 +RpcIdHelper DEBUG channel field size is 38016 field index = 159 +RpcIdHelper DEBUG channel field size is 12672 field index = 160 +RpcIdHelper DEBUG channel field size is 12672 field index = 161 +RpcIdHelper DEBUG channel field size is 25344 field index = 162 +RpcIdHelper DEBUG channel field size is 25344 field index = 163 RpcIdHelper DEBUG channel field size is 25344 field index = 164 RpcIdHelper DEBUG channel field size is 25344 field index = 165 RpcIdHelper DEBUG channel field size is 25344 field index = 166 -RpcIdHelper DEBUG channel field size is 25344 field index = 167 -RpcIdHelper DEBUG channel field size is 25344 field index = 168 +RpcIdHelper DEBUG channel field size is 19008 field index = 167 +RpcIdHelper DEBUG channel field size is 19008 field index = 168 RpcIdHelper DEBUG channel field size is 19008 field index = 169 RpcIdHelper DEBUG channel field size is 19008 field index = 170 RpcIdHelper DEBUG channel field size is 19008 field index = 171 RpcIdHelper DEBUG channel field size is 19008 field index = 172 -RpcIdHelper DEBUG channel field size is 19008 field index = 173 -RpcIdHelper DEBUG channel field size is 19008 field index = 174 -RpcIdHelper DEBUG channel field size is 12672 field index = 175 -RpcIdHelper DEBUG channel field size is 12672 field index = 176 -RpcIdHelper DEBUG channel field size is 3168 field index = 177 -RpcIdHelper DEBUG channel field size is 6336 field index = 178 -RpcIdHelper DEBUG channel field size is 6336 field index = 179 -RpcIdHelper DEBUG channel field size is 12672 field index = 180 -RpcIdHelper DEBUG channel field size is 12672 field index = 181 -RpcIdHelper DEBUG channel field size is 6336 field index = 182 -RpcIdHelper DEBUG channel field size is 1584 field index = 183 -RpcIdHelper DEBUG channel field size is 3168 field index = 184 -RpcIdHelper DEBUG channel field size is 3168 field index = 185 -RpcIdHelper DEBUG channel field size is 6336 field index = 186 -RpcIdHelper DEBUG channel field size is 6336 field index = 187 -RpcIdHelper DEBUG channel field size is 3168 field index = 188 -RpcIdHelper DEBUG channel field size is 1584 field index = 189 -RpcIdHelper DEBUG full module range size is 54 -RpcIdHelper DEBUG full channel range size is 54 +RpcIdHelper DEBUG channel field size is 12672 field index = 173 +RpcIdHelper DEBUG channel field size is 12672 field index = 174 +RpcIdHelper DEBUG channel field size is 3168 field index = 175 +RpcIdHelper DEBUG channel field size is 6336 field index = 176 +RpcIdHelper DEBUG channel field size is 6336 field index = 177 +RpcIdHelper DEBUG channel field size is 12672 field index = 178 +RpcIdHelper DEBUG channel field size is 12672 field index = 179 +RpcIdHelper DEBUG channel field size is 6336 field index = 180 +RpcIdHelper DEBUG channel field size is 1584 field index = 181 +RpcIdHelper DEBUG channel field size is 3168 field index = 182 +RpcIdHelper DEBUG channel field size is 3168 field index = 183 +RpcIdHelper DEBUG channel field size is 6336 field index = 184 +RpcIdHelper DEBUG channel field size is 6336 field index = 185 +RpcIdHelper DEBUG channel field size is 3168 field index = 186 +RpcIdHelper DEBUG channel field size is 1584 field index = 187 +RpcIdHelper DEBUG channel field size is 38016 field index = 188 +RpcIdHelper DEBUG full module range size is 55 +RpcIdHelper DEBUG full channel range size is 55 RpcIdHelper INFO Initializing RPC hash indices ... -RpcIdHelper INFO The element hash max is 600 -RpcIdHelper INFO The detector element hash max is 1122 +RpcIdHelper INFO The element hash max is 616 +RpcIdHelper INFO The detector element hash max is 1154 RpcIdHelper INFO Initializing RPC hash indices for finding neighbors ... RpcIdHelper VERBOSE MuonIdHelper::init_neighbors -RpcIdHelper DEBUG Maximum number of RPC gas gaps is 2 +RpcIdHelper DEBUG Maximum number of RPC gas gaps is 3 TgcIdHelper DEBUG (Re)initialize AtlasDetectorIDHelper::initialize_from_dictionary - Warning: unable to find csc region index: group, region size 0 0 AtlasDetectorID DEBUG Could not get value for label 'no_side' of field 'DetZside' in dictionary Calorimeter @@ -2284,59 +2290,60 @@ TgcIdHelper DEBUG technology decode 1 vals 3 mask/zero m TgcIdHelper DEBUG gas gap decode 1 vals 1:3 mask/zero mask/shift/bits/offset 3 ffffe7ffffffffff 43 2 19 indexes mode both_bounded TgcIdHelper DEBUG is strip decode 0 vals 0:1 mask/zero mask/shift/bits/offset 1 fffffbffffffffff 42 1 21 indexes mode both_bounded TgcIdHelper DEBUG channel decode 1 vals 1:125 mask/zero mask/shift/bits/offset 7f fffffc07ffffffff 35 7 22 indexes mode both_bounded -TgcIdHelper INFO MultiRange built successfully to Technology: MultiRange size is 208 -TgcIdHelper INFO MultiRange built successfully to detector element: Multilayer MultiRange size is 208 -TgcIdHelper INFO MultiRange built successfully to channel: MultiRange size is 246 -TgcIdHelper DEBUG field size is 48 field index = 182 +TgcIdHelper INFO MultiRange built successfully to Technology: MultiRange size is 207 +TgcIdHelper INFO MultiRange built successfully to detector element: Multilayer MultiRange size is 207 +TgcIdHelper INFO MultiRange built successfully to channel: MultiRange size is 245 +TgcIdHelper DEBUG field size is 48 field index = 181 +TgcIdHelper DEBUG field size is 96 field index = 182 TgcIdHelper DEBUG field size is 96 field index = 183 TgcIdHelper DEBUG field size is 96 field index = 184 TgcIdHelper DEBUG field size is 96 field index = 185 -TgcIdHelper DEBUG field size is 96 field index = 186 -TgcIdHelper DEBUG field size is 48 field index = 187 +TgcIdHelper DEBUG field size is 48 field index = 186 +TgcIdHelper DEBUG field size is 96 field index = 187 TgcIdHelper DEBUG field size is 96 field index = 188 TgcIdHelper DEBUG field size is 96 field index = 189 TgcIdHelper DEBUG field size is 96 field index = 190 TgcIdHelper DEBUG field size is 96 field index = 191 -TgcIdHelper DEBUG field size is 96 field index = 192 -TgcIdHelper DEBUG field size is 48 field index = 193 +TgcIdHelper DEBUG field size is 48 field index = 192 +TgcIdHelper DEBUG field size is 96 field index = 193 TgcIdHelper DEBUG field size is 96 field index = 194 TgcIdHelper DEBUG field size is 96 field index = 195 TgcIdHelper DEBUG field size is 96 field index = 196 TgcIdHelper DEBUG field size is 96 field index = 197 -TgcIdHelper DEBUG field size is 96 field index = 198 -TgcIdHelper DEBUG field size is 42 field index = 199 -TgcIdHelper DEBUG detector element field size is 48 field index = 182 +TgcIdHelper DEBUG field size is 42 field index = 198 +TgcIdHelper DEBUG detector element field size is 48 field index = 181 +TgcIdHelper DEBUG detector element field size is 96 field index = 182 TgcIdHelper DEBUG detector element field size is 96 field index = 183 TgcIdHelper DEBUG detector element field size is 96 field index = 184 TgcIdHelper DEBUG detector element field size is 96 field index = 185 -TgcIdHelper DEBUG detector element field size is 96 field index = 186 -TgcIdHelper DEBUG detector element field size is 48 field index = 187 +TgcIdHelper DEBUG detector element field size is 48 field index = 186 +TgcIdHelper DEBUG detector element field size is 96 field index = 187 TgcIdHelper DEBUG detector element field size is 96 field index = 188 TgcIdHelper DEBUG detector element field size is 96 field index = 189 TgcIdHelper DEBUG detector element field size is 96 field index = 190 TgcIdHelper DEBUG detector element field size is 96 field index = 191 -TgcIdHelper DEBUG detector element field size is 96 field index = 192 -TgcIdHelper DEBUG detector element field size is 48 field index = 193 +TgcIdHelper DEBUG detector element field size is 48 field index = 192 +TgcIdHelper DEBUG detector element field size is 96 field index = 193 TgcIdHelper DEBUG detector element field size is 96 field index = 194 TgcIdHelper DEBUG detector element field size is 96 field index = 195 TgcIdHelper DEBUG detector element field size is 96 field index = 196 TgcIdHelper DEBUG detector element field size is 96 field index = 197 -TgcIdHelper DEBUG detector element field size is 96 field index = 198 -TgcIdHelper DEBUG detector element field size is 42 field index = 199 -TgcIdHelper DEBUG channel field size is 15120 field index = 190 -TgcIdHelper DEBUG channel field size is 4608 field index = 191 -TgcIdHelper DEBUG channel field size is 26496 field index = 192 -TgcIdHelper DEBUG channel field size is 17856 field index = 193 -TgcIdHelper DEBUG channel field size is 6624 field index = 194 -TgcIdHelper DEBUG channel field size is 6912 field index = 195 +TgcIdHelper DEBUG detector element field size is 42 field index = 198 +TgcIdHelper DEBUG channel field size is 15120 field index = 189 +TgcIdHelper DEBUG channel field size is 4608 field index = 190 +TgcIdHelper DEBUG channel field size is 26496 field index = 191 +TgcIdHelper DEBUG channel field size is 17856 field index = 192 +TgcIdHelper DEBUG channel field size is 6624 field index = 193 +TgcIdHelper DEBUG channel field size is 6912 field index = 194 +TgcIdHelper DEBUG channel field size is 9216 field index = 195 TgcIdHelper DEBUG channel field size is 9216 field index = 196 TgcIdHelper DEBUG channel field size is 9216 field index = 197 TgcIdHelper DEBUG channel field size is 9216 field index = 198 -TgcIdHelper DEBUG channel field size is 9216 field index = 199 -TgcIdHelper DEBUG channel field size is 12000 field index = 200 -TgcIdHelper DEBUG channel field size is 3072 field index = 201 -TgcIdHelper DEBUG channel field size is 21120 field index = 202 -TgcIdHelper DEBUG channel field size is 19776 field index = 203 +TgcIdHelper DEBUG channel field size is 12000 field index = 199 +TgcIdHelper DEBUG channel field size is 3072 field index = 200 +TgcIdHelper DEBUG channel field size is 21120 field index = 201 +TgcIdHelper DEBUG channel field size is 19776 field index = 202 +TgcIdHelper DEBUG channel field size is 6144 field index = 203 TgcIdHelper DEBUG channel field size is 6144 field index = 204 TgcIdHelper DEBUG channel field size is 6144 field index = 205 TgcIdHelper DEBUG channel field size is 6144 field index = 206 @@ -2344,21 +2351,20 @@ TgcIdHelper DEBUG channel field size is 6144 field index = 207 TgcIdHelper DEBUG channel field size is 6144 field index = 208 TgcIdHelper DEBUG channel field size is 6144 field index = 209 TgcIdHelper DEBUG channel field size is 6144 field index = 210 -TgcIdHelper DEBUG channel field size is 6144 field index = 211 -TgcIdHelper DEBUG channel field size is 11712 field index = 212 -TgcIdHelper DEBUG channel field size is 3072 field index = 213 -TgcIdHelper DEBUG channel field size is 18432 field index = 214 -TgcIdHelper DEBUG channel field size is 20352 field index = 215 +TgcIdHelper DEBUG channel field size is 11712 field index = 211 +TgcIdHelper DEBUG channel field size is 3072 field index = 212 +TgcIdHelper DEBUG channel field size is 18432 field index = 213 +TgcIdHelper DEBUG channel field size is 20352 field index = 214 +TgcIdHelper DEBUG channel field size is 6144 field index = 215 TgcIdHelper DEBUG channel field size is 6144 field index = 216 -TgcIdHelper DEBUG channel field size is 6144 field index = 217 -TgcIdHelper DEBUG channel field size is 5952 field index = 218 +TgcIdHelper DEBUG channel field size is 5952 field index = 217 +TgcIdHelper DEBUG channel field size is 6144 field index = 218 TgcIdHelper DEBUG channel field size is 6144 field index = 219 TgcIdHelper DEBUG channel field size is 6144 field index = 220 TgcIdHelper DEBUG channel field size is 6144 field index = 221 TgcIdHelper DEBUG channel field size is 6144 field index = 222 -TgcIdHelper DEBUG channel field size is 6144 field index = 223 -TgcIdHelper DEBUG channel field size is 2016 field index = 224 -TgcIdHelper DEBUG channel field size is 2688 field index = 225 +TgcIdHelper DEBUG channel field size is 2016 field index = 223 +TgcIdHelper DEBUG channel field size is 2688 field index = 224 TgcIdHelper INFO Initializing TGC hash indices ... TgcIdHelper INFO The element hash max is 1530 TgcIdHelper INFO The detector element hash max is 1530 @@ -2377,59 +2383,60 @@ TgcIdHelper DEBUG technology decode 1 vals 3 mask/zero m TgcIdHelper DEBUG gas gap decode 1 vals 1:3 mask/zero mask/shift/bits/offset 3 ffffe7ffffffffff 43 2 19 indexes mode both_bounded TgcIdHelper DEBUG is strip decode 0 vals 0:1 mask/zero mask/shift/bits/offset 1 fffffbffffffffff 42 1 21 indexes mode both_bounded TgcIdHelper DEBUG channel decode 1 vals 1:125 mask/zero mask/shift/bits/offset 7f fffffc07ffffffff 35 7 22 indexes mode both_bounded -TgcIdHelper INFO MultiRange built successfully to Technology: MultiRange size is 208 -TgcIdHelper INFO MultiRange built successfully to detector element: Multilayer MultiRange size is 208 -TgcIdHelper INFO MultiRange built successfully to channel: MultiRange size is 246 -TgcIdHelper DEBUG field size is 48 field index = 182 +TgcIdHelper INFO MultiRange built successfully to Technology: MultiRange size is 207 +TgcIdHelper INFO MultiRange built successfully to detector element: Multilayer MultiRange size is 207 +TgcIdHelper INFO MultiRange built successfully to channel: MultiRange size is 245 +TgcIdHelper DEBUG field size is 48 field index = 181 +TgcIdHelper DEBUG field size is 96 field index = 182 TgcIdHelper DEBUG field size is 96 field index = 183 TgcIdHelper DEBUG field size is 96 field index = 184 TgcIdHelper DEBUG field size is 96 field index = 185 -TgcIdHelper DEBUG field size is 96 field index = 186 -TgcIdHelper DEBUG field size is 48 field index = 187 +TgcIdHelper DEBUG field size is 48 field index = 186 +TgcIdHelper DEBUG field size is 96 field index = 187 TgcIdHelper DEBUG field size is 96 field index = 188 TgcIdHelper DEBUG field size is 96 field index = 189 TgcIdHelper DEBUG field size is 96 field index = 190 TgcIdHelper DEBUG field size is 96 field index = 191 -TgcIdHelper DEBUG field size is 96 field index = 192 -TgcIdHelper DEBUG field size is 48 field index = 193 +TgcIdHelper DEBUG field size is 48 field index = 192 +TgcIdHelper DEBUG field size is 96 field index = 193 TgcIdHelper DEBUG field size is 96 field index = 194 TgcIdHelper DEBUG field size is 96 field index = 195 TgcIdHelper DEBUG field size is 96 field index = 196 TgcIdHelper DEBUG field size is 96 field index = 197 -TgcIdHelper DEBUG field size is 96 field index = 198 -TgcIdHelper DEBUG field size is 42 field index = 199 -TgcIdHelper DEBUG detector element field size is 48 field index = 182 +TgcIdHelper DEBUG field size is 42 field index = 198 +TgcIdHelper DEBUG detector element field size is 48 field index = 181 +TgcIdHelper DEBUG detector element field size is 96 field index = 182 TgcIdHelper DEBUG detector element field size is 96 field index = 183 TgcIdHelper DEBUG detector element field size is 96 field index = 184 TgcIdHelper DEBUG detector element field size is 96 field index = 185 -TgcIdHelper DEBUG detector element field size is 96 field index = 186 -TgcIdHelper DEBUG detector element field size is 48 field index = 187 +TgcIdHelper DEBUG detector element field size is 48 field index = 186 +TgcIdHelper DEBUG detector element field size is 96 field index = 187 TgcIdHelper DEBUG detector element field size is 96 field index = 188 TgcIdHelper DEBUG detector element field size is 96 field index = 189 TgcIdHelper DEBUG detector element field size is 96 field index = 190 TgcIdHelper DEBUG detector element field size is 96 field index = 191 -TgcIdHelper DEBUG detector element field size is 96 field index = 192 -TgcIdHelper DEBUG detector element field size is 48 field index = 193 +TgcIdHelper DEBUG detector element field size is 48 field index = 192 +TgcIdHelper DEBUG detector element field size is 96 field index = 193 TgcIdHelper DEBUG detector element field size is 96 field index = 194 TgcIdHelper DEBUG detector element field size is 96 field index = 195 TgcIdHelper DEBUG detector element field size is 96 field index = 196 TgcIdHelper DEBUG detector element field size is 96 field index = 197 -TgcIdHelper DEBUG detector element field size is 96 field index = 198 -TgcIdHelper DEBUG detector element field size is 42 field index = 199 -TgcIdHelper DEBUG channel field size is 15120 field index = 190 -TgcIdHelper DEBUG channel field size is 4608 field index = 191 -TgcIdHelper DEBUG channel field size is 26496 field index = 192 -TgcIdHelper DEBUG channel field size is 17856 field index = 193 -TgcIdHelper DEBUG channel field size is 6624 field index = 194 -TgcIdHelper DEBUG channel field size is 6912 field index = 195 +TgcIdHelper DEBUG detector element field size is 42 field index = 198 +TgcIdHelper DEBUG channel field size is 15120 field index = 189 +TgcIdHelper DEBUG channel field size is 4608 field index = 190 +TgcIdHelper DEBUG channel field size is 26496 field index = 191 +TgcIdHelper DEBUG channel field size is 17856 field index = 192 +TgcIdHelper DEBUG channel field size is 6624 field index = 193 +TgcIdHelper DEBUG channel field size is 6912 field index = 194 +TgcIdHelper DEBUG channel field size is 9216 field index = 195 TgcIdHelper DEBUG channel field size is 9216 field index = 196 TgcIdHelper DEBUG channel field size is 9216 field index = 197 TgcIdHelper DEBUG channel field size is 9216 field index = 198 -TgcIdHelper DEBUG channel field size is 9216 field index = 199 -TgcIdHelper DEBUG channel field size is 12000 field index = 200 -TgcIdHelper DEBUG channel field size is 3072 field index = 201 -TgcIdHelper DEBUG channel field size is 21120 field index = 202 -TgcIdHelper DEBUG channel field size is 19776 field index = 203 +TgcIdHelper DEBUG channel field size is 12000 field index = 199 +TgcIdHelper DEBUG channel field size is 3072 field index = 200 +TgcIdHelper DEBUG channel field size is 21120 field index = 201 +TgcIdHelper DEBUG channel field size is 19776 field index = 202 +TgcIdHelper DEBUG channel field size is 6144 field index = 203 TgcIdHelper DEBUG channel field size is 6144 field index = 204 TgcIdHelper DEBUG channel field size is 6144 field index = 205 TgcIdHelper DEBUG channel field size is 6144 field index = 206 @@ -2437,21 +2444,20 @@ TgcIdHelper DEBUG channel field size is 6144 field index = 207 TgcIdHelper DEBUG channel field size is 6144 field index = 208 TgcIdHelper DEBUG channel field size is 6144 field index = 209 TgcIdHelper DEBUG channel field size is 6144 field index = 210 -TgcIdHelper DEBUG channel field size is 6144 field index = 211 -TgcIdHelper DEBUG channel field size is 11712 field index = 212 -TgcIdHelper DEBUG channel field size is 3072 field index = 213 -TgcIdHelper DEBUG channel field size is 18432 field index = 214 -TgcIdHelper DEBUG channel field size is 20352 field index = 215 +TgcIdHelper DEBUG channel field size is 11712 field index = 211 +TgcIdHelper DEBUG channel field size is 3072 field index = 212 +TgcIdHelper DEBUG channel field size is 18432 field index = 213 +TgcIdHelper DEBUG channel field size is 20352 field index = 214 +TgcIdHelper DEBUG channel field size is 6144 field index = 215 TgcIdHelper DEBUG channel field size is 6144 field index = 216 -TgcIdHelper DEBUG channel field size is 6144 field index = 217 -TgcIdHelper DEBUG channel field size is 5952 field index = 218 +TgcIdHelper DEBUG channel field size is 5952 field index = 217 +TgcIdHelper DEBUG channel field size is 6144 field index = 218 TgcIdHelper DEBUG channel field size is 6144 field index = 219 TgcIdHelper DEBUG channel field size is 6144 field index = 220 TgcIdHelper DEBUG channel field size is 6144 field index = 221 TgcIdHelper DEBUG channel field size is 6144 field index = 222 -TgcIdHelper DEBUG channel field size is 6144 field index = 223 -TgcIdHelper DEBUG channel field size is 2016 field index = 224 -TgcIdHelper DEBUG channel field size is 2688 field index = 225 +TgcIdHelper DEBUG channel field size is 2016 field index = 223 +TgcIdHelper DEBUG channel field size is 2688 field index = 224 TgcIdHelper INFO Initializing TGC hash indices ... TgcIdHelper INFO The element hash max is 1530 TgcIdHelper INFO The detector element hash max is 1530 @@ -2470,25 +2476,25 @@ MmIdHelper DEBUG technology decode 1 vals 5 mask/zero m MmIdHelper DEBUG multilayer decode 1 vals 1:2 mask/zero mask/shift/bits/offset 1 fffdffffffffffff 49 1 14 indexes mode both_bounded MmIdHelper DEBUG gasgap decode 1 vals 1:4 mask/zero mask/shift/bits/offset 3 fffe7fffffffffff 47 2 15 indexes mode both_bounded MmIdHelper DEBUG channel decode 1 vals 1:5120 mask/zero mask/shift/bits/offset 1fff ffff8003ffffffff 34 13 17 indexes mode both_bounded -MmIdHelper INFO MultiRange built successfully to Technology: MultiRange size is 208 -MmIdHelper INFO MultiRange built successfully to detector element: Multilayer MultiRange size is 242 -MmIdHelper INFO MultiRange built successfully to channel: MultiRange size is 246 +MmIdHelper INFO MultiRange built successfully to Technology: MultiRange size is 207 +MmIdHelper INFO MultiRange built successfully to detector element: Multilayer MultiRange size is 241 +MmIdHelper INFO MultiRange built successfully to channel: MultiRange size is 245 +MmIdHelper DEBUG field size is 16 field index = 203 MmIdHelper DEBUG field size is 16 field index = 204 MmIdHelper DEBUG field size is 16 field index = 205 MmIdHelper DEBUG field size is 16 field index = 206 -MmIdHelper DEBUG field size is 16 field index = 207 +MmIdHelper DEBUG detector element field size is 32 field index = 237 MmIdHelper DEBUG detector element field size is 32 field index = 238 MmIdHelper DEBUG detector element field size is 32 field index = 239 MmIdHelper DEBUG detector element field size is 32 field index = 240 -MmIdHelper DEBUG detector element field size is 32 field index = 241 +MmIdHelper DEBUG channel field size is 327680 field index = 237 MmIdHelper DEBUG channel field size is 327680 field index = 238 -MmIdHelper DEBUG channel field size is 327680 field index = 239 +MmIdHelper DEBUG channel field size is 196608 field index = 239 MmIdHelper DEBUG channel field size is 196608 field index = 240 -MmIdHelper DEBUG channel field size is 196608 field index = 241 +MmIdHelper DEBUG channel field size is 327680 field index = 241 MmIdHelper DEBUG channel field size is 327680 field index = 242 -MmIdHelper DEBUG channel field size is 327680 field index = 243 +MmIdHelper DEBUG channel field size is 196608 field index = 243 MmIdHelper DEBUG channel field size is 196608 field index = 244 -MmIdHelper DEBUG channel field size is 196608 field index = 245 MmIdHelper INFO Initializing MicroMegas hash indices ... MmIdHelper INFO The element hash max is 64 MmIdHelper INFO The detector element hash max is 128 diff --git a/MuonSpectrometer/MuonIdHelpers/src/MdtIdHelper.cxx b/MuonSpectrometer/MuonIdHelpers/src/MdtIdHelper.cxx index 135bed971c3890667cda81e86de4acb646b26083..a433dbc3150ba30ce56d16260e702103448623d2 100644 --- a/MuonSpectrometer/MuonIdHelpers/src/MdtIdHelper.cxx +++ b/MuonSpectrometer/MuonIdHelpers/src/MdtIdHelper.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ /** @@ -9,11 +9,6 @@ * ============================================================================== */ -//<doc><file> $Id: MdtIdHelper.cxx,v 1.41 2009-01-20 22:44:13 kblack Exp $ -//<version> $Name: not supported by cvs2svn $ - -/// Includes - #include "MuonIdHelpers/MdtIdHelper.h" #include "GaudiKernel/ISvcLocator.h" @@ -21,21 +16,13 @@ #include "GaudiKernel/MsgStream.h" #include "GaudiKernel/IMessageSvc.h" - -/// Constructor - -MdtIdHelper::MdtIdHelper() : MuonIdHelper("MdtIdHelper"), m_TUBELAYER_INDEX(0) {} - -/// Destructor - -MdtIdHelper::~MdtIdHelper() -{ - // m_Log deleted in base class. +MdtIdHelper::MdtIdHelper() : + MuonIdHelper("MdtIdHelper"), + m_TUBELAYER_INDEX(0), + m_tubesMax(UINT_MAX) { } - /// initialize dictionary - int MdtIdHelper::initialize_from_dictionary(const IdDictMgr& dict_mgr) { int status = 0; @@ -302,6 +289,30 @@ int MdtIdHelper::initialize_from_dictionary(const IdDictMgr& dict_mgr) (*m_Log) << MSG::INFO << "Initializing MDT hash indices for finding neighbors ... " << endmsg; status = init_neighbors(); + // retrieve the maximum number of tubes in any chamber + ExpandedIdentifier expId; + IdContext channel_context(expId, 0, m_CHANNEL_INDEX); + for (const auto &id : m_detectorElement_vec) { + if (!get_expanded_id(id, expId, &channel_context)) { + for (unsigned int i = 0; i < m_full_channel_range.size(); ++i) { + const Range& range = m_full_channel_range[i]; + if (range.match(expId)) { + const Range::field& channel_field = range[m_CHANNEL_INDEX]; + if (channel_field.has_maximum()) { + unsigned int max = channel_field.get_maximum(); + if (m_tubesMax == UINT_MAX) m_tubesMax = max; + else if (max > m_tubesMax) m_tubesMax = max; + } + } + } + } + } + if (m_tubesMax == UINT_MAX) { + (*m_Log) << MSG::ERROR << "No maximum number of MDT tubes was retrieved" << endmsg; + status = 1; + } else { + if (m_Log->level()<=MSG::DEBUG) (*m_Log) << MSG::DEBUG << " Maximum number of MDT tubes is " << m_tubesMax << endmsg; + } m_init = true; return (status); } diff --git a/MuonSpectrometer/MuonIdHelpers/test/muon_id_test.cxx b/MuonSpectrometer/MuonIdHelpers/test/muon_id_test.cxx index faafa5e26d1d730e38f5cc0702c16641a7c2b7af..681bf2e1dbed2ad344b905c2bcb3d1926fee0e24 100644 --- a/MuonSpectrometer/MuonIdHelpers/test/muon_id_test.cxx +++ b/MuonSpectrometer/MuonIdHelpers/test/muon_id_test.cxx @@ -175,9 +175,9 @@ int main () // check Run 2 layout (no STgc/MM) if (checkDictFile("IdDictMuonSpectrometer_R.03.xml", true, false, false)) return 1; // check asymmetric Run 3 layout - if (checkDictFile("IdDictMuonSpectrometer_R.09.AsymNSW.xml")) return 1; + if (checkDictFile("IdDictMuonSpectrometer_R.09.02.Asym.xml")) return 1; // check symmetric Run 3 layout (no CSC) - if (checkDictFile("IdDictMuonSpectrometer_R.09.NSW.xml", false, true, true)) return 1; + if (checkDictFile("IdDictMuonSpectrometer_R.09.02.xml", false, true, true)) return 1; return 0; } diff --git a/MuonSpectrometer/MuonIdHelpersAlgs/MuonIdHelpersAlgs/ATLAS_CHECK_THREAD_SAFETY b/MuonSpectrometer/MuonIdHelpersAlgs/MuonIdHelpersAlgs/ATLAS_CHECK_THREAD_SAFETY old mode 100644 new mode 100755 diff --git a/MuonSpectrometer/MuonSimEvent/MuonSimEvent/MdtHitIdHelper.h b/MuonSpectrometer/MuonSimEvent/MuonSimEvent/MdtHitIdHelper.h index 7c0fd21a1cd2ef23a6c4c1f7e289716fb5696c00..0490b3a36616d393b0c301b33dd4649bf69be1ba 100644 --- a/MuonSpectrometer/MuonSimEvent/MuonSimEvent/MdtHitIdHelper.h +++ b/MuonSpectrometer/MuonSimEvent/MuonSimEvent/MdtHitIdHelper.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ #ifndef MdtHitIdHelper_H @@ -14,6 +14,7 @@ class MdtHitIdHelper: public HitIdHelper { public: static MdtHitIdHelper* GetHelper(); + static MdtHitIdHelper* GetHelper(const unsigned int nTubes); std::string GetStationName(const int& hid) const; void SetStationName(std::string name, int& hid) const; int GetPhiSector(const int& hid) const; @@ -27,7 +28,8 @@ public: private: MdtHitIdHelper(); - void Initialize(); + MdtHitIdHelper(const unsigned int nTubes); + void Initialize(const unsigned int nTubes=78); // all MDT/sMDT chambers used in Run1/2 have maximum 78 tubes void InitializeStationName(); static MdtHitIdHelper* m_help; diff --git a/MuonSpectrometer/MuonSimEvent/src/MdtHitIdHelper.cxx b/MuonSpectrometer/MuonSimEvent/src/MdtHitIdHelper.cxx index fdc9330603867e3b24526d89d133ef6a103bf569..b41707681aa575a5badb513264590a25f5da94d3 100644 --- a/MuonSpectrometer/MuonSimEvent/src/MdtHitIdHelper.cxx +++ b/MuonSpectrometer/MuonSimEvent/src/MdtHitIdHelper.cxx @@ -22,19 +22,31 @@ MdtHitIdHelper::MdtHitIdHelper() : HitIdHelper() Initialize(); } +MdtHitIdHelper::MdtHitIdHelper(const unsigned int nTubes) : HitIdHelper() +{ + InitializeStationName(); + Initialize(nTubes); +} + MdtHitIdHelper* MdtHitIdHelper::GetHelper() { if (!m_help) m_help = new MdtHitIdHelper(); return m_help; } -void MdtHitIdHelper::Initialize() +MdtHitIdHelper* MdtHitIdHelper::GetHelper(const unsigned int nTubes) +{ + if (!m_help) m_help = new MdtHitIdHelper(nTubes); + return m_help; +} + +void MdtHitIdHelper::Initialize(const unsigned int nTubes) { InitializeField("PhiSector",1,8); InitializeField("ZSector",-8,8); InitializeField("MultiLayer",1,2); InitializeField("Layer",1,4); - InitializeField("Tube",1,78); + InitializeField("Tube",1,nTubes); } void MdtHitIdHelper::InitializeStationName() diff --git a/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/CscRawDataMonitoring/CscRawDataMonitoring/CSCSegmValMonAlg.h b/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/CscRawDataMonitoring/CscRawDataMonitoring/CSCSegmValMonAlg.h new file mode 100755 index 0000000000000000000000000000000000000000..54a68b8bf31d1f13c2927ddadc747f6459ca7f79 --- /dev/null +++ b/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/CscRawDataMonitoring/CscRawDataMonitoring/CSCSegmValMonAlg.h @@ -0,0 +1,69 @@ +/* + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration +*/ + +#ifndef CSCSegmValMonAlg_H +#define CSCSegmValMonAlg_H + +#include "AthenaMonitoring/AthMonitorAlgorithm.h" +#include "AthenaMonitoring/ManagedMonitorToolBase.h" +#include "AthenaMonitoringKernel/Monitored.h" + +#include "GaudiKernel/ServiceHandle.h" +#include "GaudiKernel/ToolHandle.h" + +#include "MuonSegment/MuonSegment.h" +#include "TrkSegment/SegmentCollection.h" +#include "TrkTrack/Track.h" + +#include "TrigDecisionTool/TrigDecisionTool.h" +#include "StoreGate/ReadHandleKey.h" +#include "MuonRecHelperTools/IMuonEDMHelperSvc.h" +#include "MuonIdHelpers/IMuonIdHelperSvc.h" + +#include <vector> +#include <string> + +namespace Trk { + class MeasurementBase; +} + +class CSCSegmValMonAlg : public AthMonitorAlgorithm { + + public: + /** Constructor */ + CSCSegmValMonAlg( const std::string& name, ISvcLocator* pSvcLocator ); + /** Destructor */ + virtual ~CSCSegmValMonAlg()=default; + virtual StatusCode initialize() override; + virtual StatusCode fillHistograms( const EventContext& ctx ) const override; + + private: + + typedef std::vector<TH1 *> SegmHistType; + typedef std::vector<TH1 *>::const_iterator SegmHistIter; + + typedef std::vector<const Trk::MeasurementBase*> TrkSegmType; + typedef std::vector<const Trk::MeasurementBase*>::const_iterator TrkSegmIter; + + typedef enum EndCaps { ECA = 0, ECC } EndCapType; + + bool isCscSegment( const Muon::MuonSegment* seg ) const; + unsigned int cscHits( const Muon::MuonSegment* seg ) const; + bool segmSlopeCut(const float csc_x, const float csc_ax, const float cut ) const; + //Trigger aware monitoring + bool evtSelTriggersPassed() const; + + ServiceHandle<Muon::IMuonEDMHelperSvc> m_edmHelperSvc {this, "edmHelper", + "Muon::MuonEDMHelperSvc/MuonEDMHelperSvc", + "Handle to the service providing the IMuonEDMHelperSvc interface" }; + ServiceHandle<Muon::IMuonIdHelperSvc> m_idHelperSvc {this, "MuonIdHelperSvc", "Muon::MuonIdHelperSvc/MuonIdHelperSvc"}; + SG::ReadHandleKey<Trk::SegmentCollection> m_segmKey{this,"SegmentKey","MuonSegments","muon segments"}; + + Gaudi::Property<std::vector<std::string>> m_sampSelTriggers{this,"EventSelTriggers",{}}; + Gaudi::Property<bool> m_doEvtSel{this,"DoEventSelection",false}; + Gaudi::Property<double> m_segmSlope{this,"SegmentSlopeCut",0}; + +}; + +#endif diff --git a/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/CscRawDataMonitoring/CscRawDataMonitoring/CscClusterValMonAlg.h b/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/CscRawDataMonitoring/CscRawDataMonitoring/CscClusterValMonAlg.h index 813613e7159c7414653a5ef2570af8f4c045ffb5..5a85d20849ce45962c00090a824a555cb93d6bcb 100644 --- a/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/CscRawDataMonitoring/CscRawDataMonitoring/CscClusterValMonAlg.h +++ b/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/CscRawDataMonitoring/CscRawDataMonitoring/CscClusterValMonAlg.h @@ -29,7 +29,9 @@ public: private: - + //Trigger aware monitoring + bool evtSelTriggersPassed() const; + ServiceHandle<Muon::IMuonIdHelperSvc> m_idHelperSvc {this, "MuonIdHelperSvc", "Muon::MuonIdHelperSvc/MuonIdHelperSvc"}; // Strip fitter. ToolHandle<ICscStripFitter> m_stripFitter{this, "CSCStripFitter", "CSCStripFitter", "Strip fitter Tool"}; @@ -41,10 +43,9 @@ private: SG::ReadHandleKey<Muon::CscPrepDataContainer> m_cscClusterKey{this,"CSCClusterKey","CSC_Clusters","CSC clusters"}; SG::ReadHandleKey<Muon::CscStripPrepDataContainer> m_cscPRDKey{this,"CSCPrepRawDataKey", "CSC_Measurements","CSC PRDs"}; - unsigned int m_qmaxADCCut; - - bool m_doEvtSel; - std::vector<std::string> m_sampSelTriggers; - + Gaudi::Property<std::vector<std::string>> m_sampSelTriggers{this,"CSCEventSelTriggers",{}}; + Gaudi::Property<bool> m_doEvtSel{this,"CSCDoEventSelection",false}; + Gaudi::Property<double> m_qmaxADCCut{this,"CSCQmaxCutADC",100}; + }; #endif diff --git a/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/CscRawDataMonitoring/CscRawDataMonitoring/CscPrdValMonAlg.h b/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/CscRawDataMonitoring/CscRawDataMonitoring/CscPrdValMonAlg.h index 29b8c74ede319da4ae2f3a147a255219af37b595..bad9a1ad686764add17efcd50763938c8b43a2f2 100755 --- a/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/CscRawDataMonitoring/CscRawDataMonitoring/CscPrdValMonAlg.h +++ b/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/CscRawDataMonitoring/CscRawDataMonitoring/CscPrdValMonAlg.h @@ -30,14 +30,15 @@ public: private: ServiceHandle<Muon::IMuonIdHelperSvc> m_idHelperSvc {this, "MuonIdHelperSvc", "Muon::MuonIdHelperSvc/MuonIdHelperSvc"}; - - size_t m_cscNoiseCut; + SG::ReadHandleKey<Muon::CscStripPrepDataContainer> m_cscPrdKey{this,"CSCPrepRawDataKey","CSC_Measurements","CSC PRDs"}; - bool m_mapxyrz; // Strip fitter ToolHandle<ICscStripFitter> m_stripFitter{this, "CSCStripFitter", "CSCStripFitter", "Strip fitter Tool"}; + Gaudi::Property<bool> m_mapxyrz{this,"MapYXandRZ",false}; + Gaudi::Property<size_t> m_cscNoiseCut{this,"NoiseCutADC",50}; + }; #endif diff --git a/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/CscRawDataMonitoring/python/CscMonitorAlgorithm.py b/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/CscRawDataMonitoring/python/CscMonitorAlgorithm.py index cad0836c34f96157e17d2ba36319179a1b0448b4..2162a404b3ed2e212c11d25c670d5ea87ef1fc59 100644 --- a/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/CscRawDataMonitoring/python/CscMonitorAlgorithm.py +++ b/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/CscRawDataMonitoring/python/CscMonitorAlgorithm.py @@ -42,7 +42,7 @@ def CscMonitoringConfig(inputFlags): # This uses the new Configurables object system. cscClusMonAlg = helper.addAlgorithm(CompFactory.CscClusterValMonAlg,'CscClusMonAlg') cscPrdMonAlg = helper.addAlgorithm(CompFactory.CscPrdValMonAlg,'CscPrdMonAlg') - # cscSegmMonAlg = helper.addAlgorithm(CompFactory.CscSegmValMonAlg,'CscSegmValMonAlg') + cscSegmMonAlg = helper.addAlgorithm(CompFactory.CSCSegmValMonAlg,'CscSegmMonAlg') ### STEP 3 ### @@ -50,9 +50,12 @@ def CscMonitoringConfig(inputFlags): # some generic property # exampleMonAlg.RandomHist = True cscClusMonAlg.CSCQmaxCutADC = 100 + cscClusMonAlg.CSCDoEventSelection = False + cscClusMonAlg.CSCEventSelTriggers = [ "" ] cscPrdMonAlg.NoiseCutADC = 50 cscPrdMonAlg.MapYXandRZ = False - + cscSegmMonAlg.DoEventSelection = False + cscSegmMonAlg.EventSelTriggers = [ "" ] #[ "L1_MU10", "L1_MU15", "EF_mu20_muCombTag_NoEF", "EF_mu15", "EF_mu15_mu10_EFFS", "EF_2mu10", "EF_2mu10_loose" ] # to enable a trigger filter, for example: #exampleMonAlg.TriggerChain = 'HLT_mu26_ivarmedium' @@ -79,7 +82,7 @@ def CscMonitoringConfig(inputFlags): # object here is the standard GenericMonitoringTool. cscClusGroup = helper.addGroup(cscClusMonAlg,'CscClusMonitor','Muon/MuonRawDataMonitoring/CSC/') cscPrdGroup = helper.addGroup(cscPrdMonAlg,'CscPrdMonitor','Muon/MuonRawDataMonitoring/CSC/') - # cscSegmGroup = helper.addGroup(cscSegmMonAlg,'CscSegmMonitor','Muon/MuonRawDataMonitoring/CSC/') + cscSegmGroup = helper.addGroup(cscSegmMonAlg,'CscSegmMonitor','Muon/MuonSegmentMonitoring/') @@ -351,6 +354,147 @@ def CscMonitoringConfig(inputFlags): cscClusGroup.defineHistogram('nPhiClusWidthCnt_mon,nEtaClusWidthCnt_mon;h2csc_prd_eta_vs_phi_cluswidth',type='TH2F',title='Eta vs. Phi Cluster width correlation;#varphi-cluster width;#eta-cluster width', path='PRD/Expert',xbins=100,xmin=0,xmax=100,ybins=100,ymin=0,ymax=100) + #Segments + + cscSegmGroup.defineHistogram('n_clust,segm_sectorNo;Muon_Segm_NumSegments_EA',cutmask='sideA',type='TH2F',title='EndCap A: No. of segments; #segments; [sector] + [0.2 #times layer]', + path='EndCapA/Overview/MuonSegments/CSC',xbins=20,xmin=0,xmax=80,ybins=90,ymin=0,ymax=18.) + + cscSegmGroup.defineHistogram('n_clust,segm_sectorNo;Muon_Segm_NumSegments_EC',cutmask='sideC',type='TH2F',title='EndCap C: No. of segments; #segments; [sector] + [0.2 #times layer]', + path='EndCapC/Overview/MuonSegments/CSC',xbins=20,xmin=0,xmax=80,ybins=85,ymin=-17,ymax=0.) + + thisLabelx=getCSCLabelx("labels_sgm_status") + status_bins = len(thisLabelx) + cscSegmGroup.defineHistogram('status_mon;Muon_Segm_EtaClusterStatus_EA',cutmask='sideA_phi0',type='TH1F',title='Endcap A: #eta-cluster status;;entries', + path='EndCapA/Detail/CSC',xbins=status_bins,xmin=-0.5,xmax=status_bins-0.5,xlabels=thisLabelx) + + thisLabelx=getCSCLabelx("labels_sgm_status") + status_bins = len(thisLabelx) + cscSegmGroup.defineHistogram('status_mon;Muon_Segm_EtaClusterStatus_EC',cutmask='sideC_phi0',type='TH1F',title='Endcap C: #eta-cluster status;;entries', + path='EndCapC/Detail/CSC',xbins=status_bins,xmin=-0.5,xmax=status_bins-0.5,xlabels=thisLabelx) + + thisLabelx=getCSCLabelx("labels_sgm_status") + status_bins = len(thisLabelx) + cscSegmGroup.defineHistogram('status_mon;Muon_Segm_PhiClusterStatus_EA',cutmask='sideA_phi',type='TH1F',title='Endcap A: #phi-cluster status;;entries', + path='EndCapA/Detail/CSC',xbins=status_bins,xmin=-0.5,xmax=status_bins-0.5,xlabels=thisLabelx) + + thisLabelx=getCSCLabelx("labels_sgm_status") + status_bins = len(thisLabelx) + cscSegmGroup.defineHistogram('status_mon;Muon_Segm_PhiClusterStatus_EC',cutmask='sideC_phi',type='TH1F',title='Endcap C: #phi-cluster status;;entries', + path='EndCapC/Detail/CSC',xbins=status_bins,xmin=-0.5,xmax=status_bins-0.5,xlabels=thisLabelx) + + + cscSegmGroup.defineHistogram('clus_qsum_mon,clus_secLayer;Muon_Segm_QSumEtaGoodClusPerLayer_EA',cutmask='checkStatusEtaA',type='TH2F',title='EndCap A: #eta-cluster charge per layer;counts;[sector] + [0.2 #times layer]', + path='EndCapA/Overview/MuonSegments/CSC',xbins=80,xmin=0.,xmax=4000.,ybins=90,ymin=0.,ymax=18.) #PLEASE CHECk + + cscSegmGroup.defineHistogram('clus_time_mon,clus_secLayer;Muon_Segm_TimeEtaGoodClusPerLayer_EA',cutmask='checkTimeEtaA',type='TH2F',title='EndCap A: #eta-cluster time per layer;time [ns];[sector] + [0.2 #times layer]', + path='EndCapA/Overview/MuonSegments/CSC',xbins=40,xmin=-200.,xmax=200.,ybins=90,ymin=0.,ymax=18.) #PLEASE CHECk + + cscSegmGroup.defineHistogram('clus_qsum_mon,clus_secLayer;Muon_Segm_QSumEtaGoodClusPerLayer_EC',cutmask='checkStatusEtaC',type='TH2F',title='EndCap C: #eta-cluster charge per layer;counts;[sector] + [0.2 #times layer]', + path='EndCapC/Overview/MuonSegments/CSC',xbins=80,xmin=0.,xmax=4000.,ybins=85,ymin=-17.,ymax=0.) + + cscSegmGroup.defineHistogram('clus_time_mon,clus_secLayer;Muon_Segm_TimeEtaGoodClusPerLayer_EC',cutmask='checkTimeEtaC',type='TH2F',title='EndCap C: #eta-cluster time per layer;time [ns];[sector] + [0.2 #times layer]', + path='EndCapC/Overview/MuonSegments/CSC',xbins=40,xmin=-200.,xmax=200.,ybins=85,ymin=-17.,ymax=0.) + + cscSegmGroup.defineHistogram('clus_qsum_mon,clus_secLayer;Muon_Segm_QSumPhiGoodClusPerLayer_EA',cutmask='checkStatusPhiA',type='TH2F',title='EndCap A: #phi-cluster charge per layer;counts;[sector] + [0.2 #times layer]', + path='EndCapA/Overview/MuonSegments/CSC',xbins=80,xmin=0.,xmax=4000,ybins=90,ymin=0.,ymax=18.) + + cscSegmGroup.defineHistogram('clus_time_mon,clus_secLayer;Muon_Segm_TimePhiGoodClusPerLayer_EA',cutmask='checkTimePhiA',type='TH2F',title='EndCap A: #phi-cluster time per layer;time [ns];[sector] + [0.2 #times layer]', + path='EndCapA/Overview/MuonSegments/CSC',xbins=40,xmin=-200.,xmax=200.,ybins=90, ymin=0.,ymax=18.) + + cscSegmGroup.defineHistogram('clus_qsum_mon,clus_secLayer;Muon_Segm_QSumPhiGoodClusPerLayer_EC',cutmask='checkStatusPhiC',type='TH2F',title='EndCap C: #phi-cluster charge per layer;counts;[sector] + [0.2 #times layer]', + path='EndCapC/Overview/MuonSegments/CSC',xbins=80,xmin=0.,xmax=4000,ybins=85,ymin=-17.,ymax=0.) + + cscSegmGroup.defineHistogram('clus_time_mon,clus_secLayer;Muon_Segm_TimePhiGoodClusPerLayer_EC',cutmask='checkTimePhiC',type='TH2F',title='EndCap A: #phi-cluster time per layer;time [ns];[sector] + [0.2 #times layer]', + path='EndCapC/Overview/MuonSegments/CSC',xbins=40,xmin=-200.,xmax=200.,ybins=85,ymin=-17.,ymax=0.) + + cscSegmGroup.defineHistogram('tmp_etaClusA;Muon_Segm_NumEtaCluster_EA',cutmask='checkClusEtaA',type='TH1F',title='Endcap A: No. of #eta-clusters on segment;#clusters;entries', + path='EndCapA/Detail/CSC',xbins=11,xmin=-0.5,xmax=10.5) + + cscSegmGroup.defineHistogram('tmp_etaClusGoodA;Muon_Segm_NumGoodEtaCluster_EA',cutmask='checkClusEtaGoodA',type='TH1F',title='Endcap A: No. of good #eta-clusters on segment;#good-clusters;entries', + path='EndCapA/Detail/CSC',xbins=11,xmin=-0.5,xmax=10.5) + + cscSegmGroup.defineHistogram('tmp_phiClusA;Muon_Segm_NumPhiCluster_EA',cutmask='checkClusPhiA',type='TH1F',title='Endcap A: No. of #phi-clusters on segment;#clusters;entries', + path='EndCapA/Detail/CSC',xbins=11,xmin=-0.5,xmax=10.5) + + cscSegmGroup.defineHistogram('tmp_phiClusGoodA;Muon_Segm_NumGoodPhiCluster_EA',cutmask='checkClusPhiGoodA',type='TH1F',title='Endcap A: No. of good #phi-clusters on segment;#good-clusters;entries', + path='EndCapA/Detail/CSC',xbins=11,xmin=-0.5,xmax=10.5) + + cscSegmGroup.defineHistogram('tmp_etaClusC;Muon_Segm_NumEtaCluster_EC',cutmask='checkClusEtaC',type='TH1F',title='Endcap C: No. of #eta-clusters on segment;#clusters;entries', + path='EndCapC/Detail/CSC',xbins=11,xmin=-0.5,xmax=10.5) + + cscSegmGroup.defineHistogram('tmp_etaClusGoodC;Muon_Segm_NumGoodEtaCluster_EC',cutmask='checkClusEtaGoodC',type='TH1F',title='Endcap C: No. of good #eta-clusters on segment;#good-clusters;entries', + path='EndCapC/Detail/CSC',xbins=11,xmin=-0.5,xmax=10.5) + + cscSegmGroup.defineHistogram('tmp_phiClusC;Muon_Segm_NumPhiCluster_EC',cutmask='checkClusPhiC',type='TH1F',title='Endcap C: No. of #phi-clusters on segment;#clusters;entries', + path='EndCapC/Detail/CSC',xbins=11,xmin=-0.5,xmax=10.5) + + cscSegmGroup.defineHistogram('tmp_phiClusGoodC;Muon_Segm_NumGoodPhiCluster_EC',cutmask='checkClusPhiGoodC',type='TH1F',title='Endcap C: No. of good #phi-clusters on segment;#good-clusters;entries', + path='EndCapC/Detail/CSC',xbins=11,xmin=-0.5,xmax=10.5) + + thisLabelx=getCSCLabelx("labels_sgm_clusCounts") + cscSegmGroup.defineHistogram('tmp_layerIndexA_mon,tmp_isectA_mon;Muon_Segm_NumNClusSegments_EA',type='TH2F',title='EndCap A: #eta-number of 3 and 4 cluster segments with each layer;counts;[sector] + [0.2 #times layer]', + path='EndCapA/Detail/CSC',xbins=50,xmin=.5,xmax=5.5,ybins=90,ymin=0,ymax=18.,xlabels=thisLabelx) + + thisLabelx=getCSCLabelx("labels_sgm_clusCounts") + cscSegmGroup.defineHistogram('tmp_layerIndexC_mon,tmp_isectC_mon;Muon_Segm_NumNClusSegments_EC',type='TH2F',title='EndCap C: #eta-number of 3 and 4 cluster segments with each layer;counts;[sector] + [0.2 #times layer]', + path='EndCapC/Detail/CSC',xbins=50,xmin=.5,xmax=5.5,ybins=85,ymin=-17,ymax=0.,xlabels=thisLabelx) + + cscSegmGroup.defineHistogram('etaClusQSumA;Muon_Segm_QSumEtaCluster_EA',type='TH1F',title='Endcap A: #eta-cluster Qsum;counts;entries', + path='EndCapA/Detail/CSC',xbins=80,xmin=0.,xmax=4000.) + + cscSegmGroup.defineHistogram('phiClusQSumA;Muon_Segm_QSumPhiCluster_EA',type='TH1F',title='Endcap A: #phi-cluster Qsum;counts;entries', + path='EndCapA/Detail/CSC',xbins=80,xmin=0.,xmax=4000.) + + cscSegmGroup.defineHistogram('etaTimeClusA;Muon_Segm_TimeEtaCluster_EA',type='TH1F',title='Endcap A: #eta-cluster Time;time [ns];entries', + path='EndCapA/Detail/CSC',xbins=40,xmin=-200.,xmax=200.) + + cscSegmGroup.defineHistogram('phiTimeClusA;Muon_Segm_TimePhiCluster_EA',type='TH1F',title='Endcap A: #phi-cluster Time;time [ns];entries', + path='EndCapA/Detail/CSC',xbins=40,xmin=-200.,xmax=200.) + + cscSegmGroup.defineHistogram('etaClusQSumC;Muon_Segm_QSumEtaCluster_EC',type='TH1F',title='Endcap C: #eta-cluster Qsum;counts;entries', + path='EndCapC/Detail/CSC',xbins=80,xmin=0.,xmax=4000.) + + cscSegmGroup.defineHistogram('phiClusQSumC;Muon_Segm_QSumPhiCluster_EC',type='TH1F',title='Endcap C: #phi-cluster Qsum;counts;entries', + path='EndCapC/Detail/CSC',xbins=80,xmin=0.,xmax=4000.) + + cscSegmGroup.defineHistogram('etaTimeClusC;Muon_Segm_TimeEtaCluster_EC',type='TH1F',title='Endcap C: #eta-cluster Time;time [ns];entries', + path='EndCapC/Detail/CSC',xbins=40,xmin=-200.,xmax=200.) + + cscSegmGroup.defineHistogram('phiTimeClusC;Muon_Segm_TimePhiCluster_EC',type='TH1F',title='Endcap C: #phi-cluster Time;time [ns];entries', + path='EndCapC/Detail/CSC',xbins=40,xmin=-200.,xmax=200.) + + cscSegmGroup.defineHistogram('etaQSumGoodClusA;Muon_Segm_QSumGoodEtaCluster_EA',type='TH1F',title='Endcap A: Good #eta-cluster Qsum;counts;entries', + path='EndCapA/Detail/CSC',xbins=80,xmin=0.,xmax=4000.) + + cscSegmGroup.defineHistogram('phiQSumGoodClusA;Muon_Segm_QSumGoodPhiCluster_EA',type='TH1F',title='Endcap A: Good #phi-cluster Qsum;counts;entries', + path='EndCapA/Detail/CSC',xbins=80,xmin=0.,xmax=4000.) + + cscSegmGroup.defineHistogram('etaQSumGoodClusC;Muon_Segm_QSumGoodEtaCluster_EC',type='TH1F',title='Endcap C: Good #eta-cluster Qsum;counts;entries', + path='EndCapC/Detail/CSC',xbins=80,xmin=0.,xmax=4000.) + + cscSegmGroup.defineHistogram('phiQSumGoodClusC;Muon_Segm_QSumGoodPhiCluster_EC',type='TH1F',title='Endcap C: Good #phi-cluster Qsum;counts;entries', + path='EndCapC/Detail/CSC',xbins=80,xmin=0.,xmax=4000.) + + cscSegmGroup.defineHistogram('etaTimeGoodClusA;Muon_Segm_TimeGoodEtaCluster_EA',type='TH1F',title='Endcap A: Good #eta-cluster Time;time [ns];entries', + path='EndCapA/Detail/CSC',xbins=40,xmin=-200.,xmax=200.) + + cscSegmGroup.defineHistogram('etaTimeGoodClusC;Muon_Segm_TimeGoodEtaCluster_EC',type='TH1F',title='Endcap C: Good #eta-cluster Time;time [ns];entries', + path='EndCapC/Detail/CSC',xbins=40,xmin=-200.,xmax=200.) + + cscSegmGroup.defineHistogram('phiTimeGoodClusA;Muon_Segm_TimeGoodPhiCluster_EA',type='TH1F',title='Endcap A: Good #phi-cluster Time;time [ns];entries', + path='EndCapA/Detail/CSC',xbins=40,xmin=-200.,xmax=200.) + + cscSegmGroup.defineHistogram('phiTimeGoodClusC;Muon_Segm_TimeGoodPhiCluster_EC',type='TH1F',title='Endcap C: Good #phi-cluster Time;time [ns];entries', + path='EndCapC/Detail/CSC',xbins=40,xmin=-200.,xmax=200.) + + cscSegmGroup.defineHistogram('etaQSumTot0,phiQSumTot0;Muon_Segm_QSumGoodClusCorrelation_EA',type='TH2F',title='Endcap A: #phi-cluster vs. good #eta-cluster;good #eta-cluster counts;good #phi-cluster counts', + path='EndCapA/Detail/CSC',xbins=80,xmin=0.,xmax=4000.,ybins=80,ymin=0.,ymax=4000.) + + cscSegmGroup.defineHistogram('etaQSumTot,phiQSumTot;Muon_Segm_QSumGoodClusCorrelation_EC',type='TH2F',title='Endcap C: #phi-cluster vs. good #eta-cluster;good #eta-cluster counts;good #phi-cluster counts', + path='EndCapC/Detail/CSC',xbins=80,xmin=0.,xmax=4000.,ybins=80,ymin=0.,ymax=4000.) + + + #myGroup.defineHistogram('lb', title='Luminosity Block;lb;Events', @@ -432,6 +576,7 @@ if __name__=='__main__': from AthenaConfiguration.TestDefaults import defaultTestFiles ConfigFlags.Input.Files = defaultTestFiles.ESD + ConfigFlags.Output.HISTFileName = 'CscMonitorOutput.root' ConfigFlags.Muon.doCSCs = True ConfigFlags.Muon.doRPCs = False diff --git a/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/CscRawDataMonitoring/python/CscRawMonLabels.py b/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/CscRawDataMonitoring/python/CscRawMonLabels.py index 3fd6aa2d74a60d8c35773837d2dabb5888017cd7..7d02001b3c2e34ad7bd89b6b0026fbd5c1653409 100644 --- a/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/CscRawDataMonitoring/python/CscRawMonLabels.py +++ b/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/CscRawDataMonitoring/python/CscRawMonLabels.py @@ -3,4 +3,6 @@ # labels_clus_occupancy_signal_EA=['','','','','','L01:1', 'L01:2', 'L01:3', 'L01:4', '', 'S02:1', 'S02:2', 'S02:3', 'S02:4', '', 'L03:1', 'L03:2', 'L03:3', 'L03:4', '', 'S04:1', 'S04:2', 'S04:3', 'S04:4', '', 'L05:1', 'L05:2', 'L05:3', 'L05:4', '', 'S06:1', 'S06:2', 'S06:3', 'S06:4', '', 'L07:1', 'L07:2', 'L07:3', 'L07:4', '', 'S08:1', 'S08:2', 'S08:3', 'S08:4', '', 'L09:1', 'L09:2', 'L09:3', 'L09:4', '', 'S10:1', 'S10:2', 'S10:3', 'S10:4', '', 'L11:1', 'L11:2', 'L11:3', 'L11:4', '', 'S12:1', 'S12:2', 'S12:3', 'S12:4', '', 'L13:1', 'L13:2', 'L13:3', 'L13:4', '', 'S14:1', 'S14:2', 'S14:3', 'S14:4', '', 'L15:1', 'L15:2', 'L15:3', 'L15:4', '', 'S16:1', 'S16:2', 'S16:3', 'S16:4', '','','','','',''] -labels_clus_occupancy_signal_EC=['','','','','','L15:4', 'L15:3', 'L15:2', 'L15:1', '', 'S14:4', 'S14:3', 'S14:2', 'S14:1', '', 'L13:4', 'L13:3', 'L13:2', 'L13:1', '', 'S12:4', 'S12:3', 'S12:2', 'S12:1', '', 'L11:4', 'L11:3', 'L11:2', 'L11:1', '', 'S10:4', 'S10:3', 'S10:2', 'S10:1', '', 'L09:4', 'L09:3', 'L09:2', 'L09:1', '', 'S08:4', 'S08:3', 'S08:2', 'S08:1', '', 'L07:4', 'L07:3', 'L07:2', 'L07:1', '', 'S06:4', 'S06:3', 'S06:2', 'S06:1', '', 'L05:4', 'L05:3', 'L05:2', 'L05:1', '', 'S04:4', 'S04:3', 'S04:2', 'S04:1', '', 'L03:4', 'L03:3', 'L03:2', 'L03:1', '', 'S02:4', 'S02:3', 'S02:2', 'S02:1', '', 'L01:4', 'L01:3', 'L01:2', 'L01:1', '', 'S00:4', 'S00:3', 'S00:2', 'S00:1', ''] \ No newline at end of file +labels_clus_occupancy_signal_EC=['','','','','','L15:4', 'L15:3', 'L15:2', 'L15:1', '', 'S14:4', 'S14:3', 'S14:2', 'S14:1', '', 'L13:4', 'L13:3', 'L13:2', 'L13:1', '', 'S12:4', 'S12:3', 'S12:2', 'S12:1', '', 'L11:4', 'L11:3', 'L11:2', 'L11:1', '', 'S10:4', 'S10:3', 'S10:2', 'S10:1', '', 'L09:4', 'L09:3', 'L09:2', 'L09:1', '', 'S08:4', 'S08:3', 'S08:2', 'S08:1', '', 'L07:4', 'L07:3', 'L07:2', 'L07:1', '', 'S06:4', 'S06:3', 'S06:2', 'S06:1', '', 'L05:4', 'L05:3', 'L05:2', 'L05:1', '', 'S04:4', 'S04:3', 'S04:2', 'S04:1', '', 'L03:4', 'L03:3', 'L03:2', 'L03:1', '', 'S02:4', 'S02:3', 'S02:2', 'S02:1', '', 'L01:4', 'L01:3', 'L01:2', 'L01:1', '', 'S00:4', 'S00:3', 'S00:2', 'S00:1', ''] +labels_sgm_status = [ "Unspoiled", "Simple", "Edge", "MultiPeak", "Narrow", "Wide", "Skewed", "QRatInc", "StripFitFailed", "SplitUnspoiled", "SplitSimple", "SplitEdge", "SplitMultiPeak", "SplitNarrow", "SplitWide", "SplitSkewed", "SplitQRatInc", "SplitStripFitFailed", "Undefined" ] +labels_sgm_clusCounts = [ "234", "134", "124", "123", "All" ] \ No newline at end of file diff --git a/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/CscRawDataMonitoring/src/CSCSegmValMonAlg.cxx b/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/CscRawDataMonitoring/src/CSCSegmValMonAlg.cxx new file mode 100755 index 0000000000000000000000000000000000000000..d4461e6b8873b9f3115775381b7fee5d9b79a8c0 --- /dev/null +++ b/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/CscRawDataMonitoring/src/CSCSegmValMonAlg.cxx @@ -0,0 +1,542 @@ +/* + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration +*/ +#include "AthenaMonitoring/AthenaMonManager.h" + +#include "CscRawDataMonitoring/CSCSegmValMonAlg.h" + +#include "MuonPrepRawData/CscClusterStatus.h" +#include "MuonPrepRawData/CscStripPrepDataCollection.h" +#include "MuonPrepRawData/CscStripPrepDataContainer.h" +#include "MuonPrepRawData/CscPrepData.h" + +// Track +#include "TrkTrack/TrackCollection.h" +#include "TrkEventPrimitives/PropDirection.h" +#include "TrkEventPrimitives/LocalDirection.h" +#include "TrkSurfaces/PlaneSurface.h" + +#include "TrkCompetingRIOsOnTrack/CompetingRIOsOnTrack.h" +#include "MuonRIO_OnTrack/CscClusterOnTrack.h" + +// STL +#include <sstream> +#include <utility> +#include "GaudiKernel/SystemOfUnits.h" + +//________________________________________________________________________________________________________ +CSCSegmValMonAlg::CSCSegmValMonAlg( const std::string& name, ISvcLocator* pSvcLocator ) : + AthMonitorAlgorithm(name,pSvcLocator) + { } + + +//________________________________________________________________________________________________________ +StatusCode CSCSegmValMonAlg::initialize() { + + ATH_MSG_INFO( "in CSCSegmValMonAlg::init()" ); + if( m_doEvtSel ) ATH_CHECK(m_trigDecTool.retrieve()); + + if(m_sampSelTriggers.empty() && m_doEvtSel) { + ATH_MSG_WARNING("Event selection triggers not specified. Switching off trigger-aware monitoring"); + m_doEvtSel = false; + } + + StoreGateSvc* detStore = nullptr; + ATH_CHECK(service("DetectorStore", detStore)); + ATH_CHECK(m_edmHelperSvc.retrieve()); + ATH_CHECK(m_idHelperSvc.retrieve()); + ATH_CHECK(m_segmKey.initialize()); + + return AthMonitorAlgorithm::initialize(); +} + +// +// fillHistograms----------------------------------------------------------------------------------------- +// + +StatusCode CSCSegmValMonAlg::fillHistograms(const EventContext& ctx) const{ + + ATH_MSG_DEBUG( "in CSCSegmValMonAlg::fillHistograms() " ); + + if( m_environment == AthMonitorAlgorithm::Environment_t::tier0 || m_environment == AthMonitorAlgorithm::Environment_t::tier0ESD || m_environment == AthMonitorAlgorithm::Environment_t::user ) { + + // if required, check if event passed sample-selection triggers + if(m_doEvtSel && !evtSelTriggersPassed()) return StatusCode::SUCCESS; + + // Segment Cluster counter + int segmClustCount[33]; + + // arrays to hold cluster-count + // 32 chambers and 8 layers (each has one extra - index '0' is not counted) + int clusCount[33][9]; + for(unsigned int kl = 0; kl < 33; kl++ ) { + for(unsigned int cm3 = 0; cm3 < 9; cm3++ ){ + clusCount[kl][cm3] = 0; + } + } + + SG::ReadHandle<Trk::SegmentCollection> segments(m_segmKey, ctx); + + if ( segments->empty() ){ + ATH_MSG_DEBUG( " Segm Collection is Empty, done... "); + return StatusCode::SUCCESS; + } + + ATH_MSG_DEBUG( " Segm Collection size " ); + ATH_MSG_DEBUG( "Number of segms found: " << segments->size() ); + + if(segments->size() > 0){ + ATH_MSG_DEBUG( "Number of segms in event is: " << segments->size() ); + ATH_MSG_DEBUG( "This algorithm is designed to operate for single segm / event only" ); + ATH_MSG_DEBUG( "Processing only the first segm in the segm collection" ); + } + + int segnum = 0; + int layerindex = 0; + + //Loop over segms + for (Trk::SegmentCollection::const_iterator s = segments->begin(); s != segments->end(); ++s) { + + //Get segm + const Muon::MuonSegment *segm=dynamic_cast<const Muon::MuonSegment*>(*s); + + if (!segm){ + ATH_MSG_WARNING( "no pointer to segm!!!" ); + continue; + } + + ATH_MSG_DEBUG( "Looking at segment id" ); + // Skip segment if there are no csc hits + if ( cscHits(segm)<1 ) continue; + + // Get contained measurements + const std::vector<const Trk::MeasurementBase*> meas = segm->containedMeasurements(); + + // Skip segment if no measurements + // Number of clusters on segment + auto n_clust = Monitored::Scalar<int>("n_clust", meas.size()); + + if ( n_clust < 2 ) continue; + + // Analyze segment if it is a csc segment + if ( isCscSegment(segm) ){ + + segnum++; + + // Initialize cluster counter + for(int sect = 0; sect < 33; sect++) { + segmClustCount[sect] = 0; + for(unsigned int ilay = 0; ilay < 9; ilay++ ){ + clusCount[sect][ilay] = 0; + } + } + + // Print out segment information + const Trk::FitQuality* fq = segm->fitQuality(); + double chi2 = 999.; + int ndof = -1; + if( fq ) { + chi2 = fq->chiSquared(); + ndof = fq->numberDoF(); + ATH_MSG_DEBUG( "Chi2 " << chi2 ); + ATH_MSG_DEBUG( "Ndof " << ndof ); + } + + // cut on segment angle + float segm_ly = segm->localParameters()[Trk::locY]; + float segm_ayz = segm->localDirection().angleYZ(); + segm_ayz -= M_PI/2.; + float segm_cut = m_segmSlope; + bool segmAngle_cut = segmSlopeCut(segm_ly, segm_ayz, segm_cut); + ATH_MSG_DEBUG(" local_pos: " << segm_ly << "\tangle_yz: " << segm_ayz << "\tcut: " << segm_cut << "\t pass = " << segmAngle_cut ); + + ATH_MSG_DEBUG( "R " << segm->globalPosition().perp() ); + ATH_MSG_DEBUG( "Z " << segm->globalPosition().z() ); + ATH_MSG_DEBUG( "Phi " << segm->globalPosition().phi() ); + ATH_MSG_DEBUG( "Eta " << segm->globalPosition().eta() ); + ATH_MSG_DEBUG( "Dir Phi " << segm->globalDirection().phi() ); + ATH_MSG_DEBUG( "Dir Eta " << segm->globalDirection().eta() ); + + // ============================================================================== + // Field Range Notes + // ============================================================================== + // StationName unsigned integer maps to "CSS", "CSL", etc. + // StationEta [-1,1] -1 for backward, 1 for forward endcap + // StationPhi [1,8] increases with Phi + // Technology [1] maps to "CSC" + // ChamberLayer [1,2] increases with |Z| + // WireLayer [1,4] increases with |Z| + // MeasuresPhi [0,1] 0 if measures R, 1 if measures Phi + // Strip [1,n] increases with R for MeasuresPhi=0 + // increases with Phi for MeasuresPhi=1 + // ============================================================================== + + // identify the segment location + const Trk::MeasurementBase* rio = meas.at(0); + Identifier segmId = m_edmHelperSvc->getIdentifier(*rio); + + int segm_stationPhi = m_idHelperSvc->cscIdHelper().stationPhi(segmId); + int segm_stationEta = m_idHelperSvc->cscIdHelper().stationEta(segmId); + int segm_stationName = m_idHelperSvc->cscIdHelper().stationName(segmId); + std::string segm_stationString = m_idHelperSvc->cscIdHelper().stationNameString(segm_stationName); + int segm_chamberType = Muon::MuonStationIndex::CSS == segm_stationName ? 0 : 1; + auto segm_sectorNo = Monitored::Scalar<int>("segm_sectorNo", (segm_stationEta * (2 * segm_stationPhi - segm_chamberType)) ); // [-16 -> -1] and [+1 -> +16] + int segm_isec = segm_sectorNo < 0 ? segm_sectorNo*(-1) : segm_sectorNo+16; // [-16 -> -1] shifted to [1 -> 16] and [+1 -> +16] shifted to [+17 -> +32] + ATH_MSG_DEBUG(" sgsec = " << segm_isec << "\tsec = " << segm_sectorNo); + auto sideA = Monitored::Scalar<int>("sideA", (int) (segm_stationEta==1)); + auto sideC = Monitored::Scalar<int>("sideC",(int)(segm_stationEta==-1)); + fill("CscSegmMonitor",n_clust,segm_sectorNo,sideA,sideC); + + float clus_kiloele = 1.0e-3; // multiply # of electrons by this number to get kiloElectrons (1 ke = 1 ADC) + int eta_clus_count[2][2] = {{0, 0},{0, 0}}, phi_clus_count[2][2] = {{0, 0},{0, 0}}; // no. of prec/trans hits per segment + float eta_clus_qsum[2][5] = {{-1., -1.}, {-1., -1., -1., -1., -1.}}, phi_clus_qsum[2][5] = {{-1., -1.}, {-1., -1., -1., -1., -1.}}; // qsum over each prec/trans. layer on segment + float eta_clus_time[2][5] = {{-1., -1.}, {-1., -1., -1., -1., -1.}}, phi_clus_time[2][5] = {{-1., -1.}, {-1., -1., -1., -1., -1.}}; // time over each prec/trans. layer on segment + int eta_clus_use[2][5] = {{0, 0},{0,0,0,0,0}}, phi_clus_use[2][5] = {{0,0}, {0,0,0,0,0}}; + + layerindex = 0; + + for( auto& hit : segm->containedMeasurements()) { + const Muon::CscClusterOnTrack* clust_rot = dynamic_cast<const Muon::CscClusterOnTrack*>(hit); + if ( clust_rot ) { + Identifier clusId = m_edmHelperSvc->getIdentifier(*clust_rot); + + // get the cluster coordinates + int clus_stationName = m_idHelperSvc->cscIdHelper().stationName(clusId); + int clus_chamberType = Muon::MuonStationIndex::CSS == clus_stationName ? 0 : 1; + int clus_stationEta = m_idHelperSvc->cscIdHelper().stationEta(clusId); + int clus_stationPhi = m_idHelperSvc->cscIdHelper().stationPhi(clusId); + int clus_wireLayer = m_idHelperSvc->cscIdHelper().wireLayer(clusId); + int clus_measuresPhi = m_idHelperSvc->cscIdHelper().measuresPhi(clusId); + + // convert to my coordinates + int clus_sectorNo = clus_stationEta * (2 * clus_stationPhi - clus_chamberType); // [-16 -> -1] and [+1 -> +16] + auto clus_secLayer = Monitored::Scalar<float>("clus_secLayer", clus_sectorNo + 0.2 * (clus_wireLayer - 1) + 0.1); + int clus_isec = clus_sectorNo < 0 ? clus_sectorNo*(-1) : clus_sectorNo+16; // [-16 -> -1] shifted to [1 -> 16] and [+1 -> +16] shifted to [+17 -> +32] + int clus_ilay = (clus_measuresPhi ? clus_wireLayer : clus_wireLayer+4); + + // check the cluster status; probably need to read status info from jobOptions - not done for the moment + Muon::CscClusterStatus status = clust_rot->status(); + auto status_mon = Monitored::Scalar<int>("status_mon",(int)clust_rot->status()); + auto sideA_phi0 = Monitored::Scalar<int>("sideA_phi0",(int) (segm_stationEta==1)&& (int)(clus_measuresPhi==0)); + auto sideC_phi0 = Monitored::Scalar<int>("sideC_phi0",(int) (segm_stationEta==-1) && (int)(clus_measuresPhi == 0)); + auto sideA_phi = Monitored::Scalar<int>("sideA_phi", (int) (segm_stationEta==1) && (int)(clus_measuresPhi!=0)); + auto sideC_phi = Monitored::Scalar<int>("sideC_phi", (int) (segm_stationEta==-1) && (int)(clus_measuresPhi!=0)); + + fill("CscSegmMonitor",status_mon, sideA_phi0, sideC_phi0, sideA_phi, sideC_phi); + + std::string clus_stat = Muon::toString(status); + bool clus_status = ( (int(status)==Muon::CscStatusUnspoiled) || (int(status)==Muon::CscStatusSplitUnspoiled) || (int(status)==Muon::CscStatusSimple)) ? true : false; + bool clus_stat_eff = ( (int(status) >= 0 && int(status) < 8 ) || (int(status) > 8 && int(status) < 18) ) ? true : false; + + // get cluster + const Muon::CscPrepData* theClus = clust_rot->prepRawData(); + float clus_qsum = 0, clus_time = -1.; + + if(theClus){ + clus_qsum = theClus->charge() * clus_kiloele; + clus_time = theClus->time(); + + if(clus_measuresPhi == 0){ + if(clus_stationEta == 1) eta_clus_count[0][0]++; + else eta_clus_count[1][0]++; + } else{ + if(clus_stationEta == 1) phi_clus_count[0][0]++; + else phi_clus_count[1][0]++; + } + } + + auto clus_qsum_mon = Monitored::Scalar<float>("clus_qsum_mon",clus_qsum); + auto clus_time_mon = Monitored::Scalar<float>("clus_time_mon",clus_time); + + // get no. of strips per cluster + unsigned int clus_noStrips = theClus->rdoList().size(); + + //need at least three strips in an eta-cluster + bool clus_eta_status = clus_status && ( clus_noStrips > 2 ) && (clus_measuresPhi == 0); + bool clus_eta_eff = clus_stat_eff && ( clus_noStrips > 2 ) && (clus_measuresPhi == 0); + if(clus_eta_eff){ + if(clus_stationEta == 1) eta_clus_count[0][1]++; + else phi_clus_count[1][1]++; + } + if(clus_eta_status){ + if(clus_stationEta == 1){ + eta_clus_qsum[0][clus_wireLayer] = clus_qsum; + eta_clus_time[0][clus_wireLayer] = clus_time; + eta_clus_use[0][clus_wireLayer] = 1; + } + else{ + eta_clus_qsum[1][clus_wireLayer] = clus_qsum; + eta_clus_time[1][clus_wireLayer] = clus_time; + eta_clus_use[1][clus_wireLayer] = 1; + } + } + + // need at least one strip in a phi-cluster + bool clus_phi_status = clus_status && ( clus_noStrips > 0 ) && (clus_measuresPhi == 1); + if(clus_phi_status) { + if(clus_stationEta==1){ + phi_clus_qsum[0][clus_wireLayer] = clus_qsum; + phi_clus_time[0][clus_wireLayer] = clus_time; + phi_clus_use[0][clus_wireLayer] = 1; + phi_clus_count[0][1]++; + } else { + phi_clus_qsum[1][clus_wireLayer] = clus_qsum; + phi_clus_time[1][clus_wireLayer] = clus_time; + phi_clus_use[1][clus_wireLayer] = 1; + phi_clus_count[1][1]++; + } + } + + + auto checkStatusEtaA = Monitored::Scalar<int>("checkStatusEtaA", (int)clus_eta_status && (int)(clus_stationEta==1)); + auto checkStatusEtaC = Monitored::Scalar<int>("checkStatusEtaC", (int)clus_eta_status && (int)(clus_stationEta==-1)); + auto checkTimeEtaA = Monitored::Scalar<int>("checkTimeEtaA", (int)clus_eta_status && (int)(clus_stationEta==1) && (int) (std::abs(clus_time) <= 200)); + auto checkTimeEtaC = Monitored::Scalar<int>("checkTimeEtaC", (int)clus_eta_status && (int)(clus_stationEta==-1) && (int) (std::abs(clus_time) <= 200)); + + auto checkStatusPhiA = Monitored::Scalar<int>("checkStatusPhiA", (int)clus_phi_status && (int)(clus_stationEta==1)); + auto checkStatusPhiC = Monitored::Scalar<int>("checkStatusPhiC", (int)clus_phi_status && (int)(clus_stationEta==-1)); + auto checkTimePhiA = Monitored::Scalar<int>("checkTimePhiA", (int)clus_phi_status && (int)(clus_stationEta==1) && (int) (std::abs(clus_time) <= 200)); + auto checkTimePhiC = Monitored::Scalar<int>("checkTimePhiC", (int)clus_phi_status && (int)(clus_stationEta==-1) && (int) (std::abs(clus_time) <= 200)); + fill("CscSegmMonitor", clus_qsum_mon, clus_secLayer, clus_time_mon, checkStatusEtaA, checkStatusEtaC, checkTimeEtaA, checkTimeEtaC, checkStatusPhiA, checkStatusPhiC, checkTimePhiA, checkTimePhiC ); + + // increment the cluster-count for this layer + if(clus_eta_status || clus_phi_status) clusCount[clus_isec][clus_ilay]++; + + // increment segment cluster count + if(clus_eta_status) segmClustCount[clus_isec]++; + + if(clus_eta_status) layerindex+=clus_wireLayer; + + ATH_MSG_DEBUG("status = " << clus_stat << "\tcharge = " << clus_qsum << "\ttime= " << clus_time << "\tnstrips = " << clus_noStrips); + + + } // if clust_rot + + } // for loop over clusters + + auto tmp_etaClusA = Monitored::Scalar<int>("tmp_etaClusA", eta_clus_count[0][0]); + auto tmp_etaClusGoodA = Monitored::Scalar<int>("tmp_etaClusGoodA", eta_clus_count[0][1]); + + auto tmp_phiClusA = Monitored::Scalar<int>("tmp_phiClusA", phi_clus_count[0][0]); + auto tmp_phiClusGoodA = Monitored::Scalar<int>("tmp_phiClusGoodA", phi_clus_count[0][1]); + + auto checkClusEtaA = Monitored::Scalar<int>("checkClusEtaA", (int)eta_clus_count[0][0] > 0); + auto checkClusEtaGoodA = Monitored::Scalar<int>("checkClusEtaGoodA", (int)eta_clus_count[0][1] > 0); + + auto checkClusPhiA = Monitored::Scalar<int>("checkClusPhiA", (int)phi_clus_count[0][0] > 0); + auto checkClusPhiGoodA = Monitored::Scalar<int>("checkClusPhiGoodA", (int)phi_clus_count[0][1] > 0); + + auto tmp_etaClusC = Monitored::Scalar<int>("tmp_etaClusC", eta_clus_count[1][0]); + auto tmp_etaClusGoodC = Monitored::Scalar<int>("tmp_etaClusGoodC", eta_clus_count[1][1]); + + auto tmp_phiClusC = Monitored::Scalar<int>("tmp_phiClusC", phi_clus_count[1][0]); + auto tmp_phiClusGoodC = Monitored::Scalar<int>("tmp_phiClusGoodC", phi_clus_count[1][1]); + + auto checkClusEtaC = Monitored::Scalar<int>("checkClusEtaC", (int)eta_clus_count[1][0] > 0); + auto checkClusEtaGoodC = Monitored::Scalar<int>("checkClusEtaGoodC", (int)eta_clus_count[1][1] > 0); + + auto checkClusPhiC = Monitored::Scalar<int>("checkClusPhiC", (int)phi_clus_count[1][0] > 0); + auto checkClusPhiGoodC = Monitored::Scalar<int>("checkClusPhiGoodC", (int)phi_clus_count[1][1] > 0); + + fill("CscSegmMonitor", tmp_etaClusA, checkClusEtaA, tmp_etaClusGoodA, checkClusEtaGoodA, tmp_phiClusA, tmp_phiClusGoodA, checkClusPhiA, checkClusPhiGoodA, tmp_etaClusC, checkClusEtaC, tmp_etaClusGoodC, checkClusEtaGoodC, tmp_phiClusC, tmp_phiClusGoodC, checkClusPhiC, checkClusPhiGoodC); + + // Fill number of 3 and 4 cluster segment histogram + std::vector<int> tmp_layerIndexA; + std::vector<int> tmp_isectA; + std::vector<int> tmp_layerIndexC; + std::vector<int> tmp_isectC; + + for( int isect = 1; isect < 17; isect++) { + + if(segmClustCount[isect+16] > 2 ) { + tmp_layerIndexA.push_back(layerindex-5); + tmp_isectA.push_back(isect); + } + + if(segmClustCount[isect+16] > 3){ + for(int i=1; i<=4; i++) { + tmp_layerIndexA.push_back(i); + tmp_isectA.push_back(isect); + } + } + + if(segmClustCount[isect] > 2) { + tmp_layerIndexC.push_back(layerindex-5); + tmp_isectC.push_back(-1.*isect); + } + + + if(segmClustCount[isect] > 3) { + for(int i=1; i<=4; i++) { + tmp_layerIndexC.push_back(i); + tmp_isectC.push_back(-1.*isect); + } + } + } + + auto tmp_layerIndexA_mon = Monitored::Collection("tmp_layerIndexA_mon", tmp_layerIndexA); + auto tmp_isectA_mon = Monitored::Collection("tmp_isectA_mon", tmp_isectA); + auto tmp_layerIndexC_mon = Monitored::Collection("tmp_layerIndexC_mon", tmp_layerIndexA); + auto tmp_isectC_mon = Monitored::Collection("tmp_isectC_mon", tmp_isectA); + fill("CscSegmMonitor", tmp_layerIndexA_mon, tmp_isectA_mon, tmp_layerIndexC_mon, tmp_isectC_mon); + + float eta_clus_qsum_tot = 0., phi_clus_qsum_tot = 0.; // total qsum over all prec. trans. layers on segment + + for(unsigned int i=0; i < 2; i++){ + eta_clus_qsum_tot = 0; phi_clus_qsum_tot = 0.; + + for(unsigned int j = 1; j <5; j++) { + if(i==0){ + auto etaClusQSumA = Monitored::Scalar<float>("etaClusQSumA", eta_clus_qsum[i][j]); + auto phiClusQSumA = Monitored::Scalar<float>("phiClusQSumA", phi_clus_qsum[i][j]); + fill("CscSegmMonitor", etaClusQSumA, phiClusQSumA); + + if(std::abs(eta_clus_time[i][j]) <= 200) { + auto etaTimeClusA = Monitored::Scalar<float>("etaTimeClusA",eta_clus_time[i][j]); + fill("CscSegmMonitor", etaTimeClusA); + } + + if(std::abs(phi_clus_time[i][j]) <= 200) { + auto phiTimeClusA = Monitored::Scalar<float>("phiTimeClusA",phi_clus_time[i][j]); + fill("CscSegmMonitor", phiTimeClusA); + } + } + + if(i==1){ + auto etaClusQSumC = Monitored::Scalar<float>("etaClusQSumC", eta_clus_qsum[i][j]); + auto phiClusQSumC = Monitored::Scalar<float>("phiClusQSumC", phi_clus_qsum[i][j]); + fill("CscSegmMonitor", etaClusQSumC, phiClusQSumC); + + if(std::abs(eta_clus_time[i][j]) <= 200) { + auto etaTimeClusC = Monitored::Scalar<float>("etaTimeClusC",eta_clus_time[i][j]); + fill("CscSegmMonitor", etaTimeClusC); + } + + if(std::abs(phi_clus_time[i][j]) <= 200) { + auto phiTimeClusC = Monitored::Scalar<float>("phiTimeClusC",phi_clus_time[i][j]); + fill("CscSegmMonitor", phiTimeClusC); + } + } + + + if(phi_clus_use[i][j] && eta_clus_use[i][j]){ + eta_clus_qsum_tot += eta_clus_qsum[i][j]; + phi_clus_qsum_tot += phi_clus_qsum[i][j]; + + if(i==0){ + auto etaQSumGoodClusA = Monitored::Scalar<float>("etaQSumGoodClusA",eta_clus_qsum[i][j]); + auto phiQSumGoodClusA = Monitored::Scalar<float>("phiQSumGoodClusA",phi_clus_qsum[i][j]); + fill("CscSegmMonitor", etaQSumGoodClusA, phiQSumGoodClusA); + if(std::abs(eta_clus_time[i][j]) <= 200){ + auto etaTimeGoodClusA = Monitored::Scalar<float>("etaTimeGoodClusA",eta_clus_time[i][j]); + fill("CscSegmMonitor", etaTimeGoodClusA); + } + + if(std::abs(phi_clus_time[i][j]) <= 200) { + auto phiTimeGoodClusA = Monitored::Scalar<float>("phiTimeGoodClusA",phi_clus_time[i][j]); + fill("CscSegmMonitor", phiTimeGoodClusA); + } + } + + if(i==1){ + auto etaQSumGoodClusC = Monitored::Scalar<float>("etaQSumGoodClusC",eta_clus_qsum[i][j]); + auto phiQSumGoodClusC = Monitored::Scalar<float>("phiQSumGoodClusC",phi_clus_qsum[i][j]); + fill("CscSegmMonitor", etaQSumGoodClusC, phiQSumGoodClusC); + if(std::abs(eta_clus_time[i][j]) <= 200){ + auto etaTimeGoodClusC = Monitored::Scalar<float>("etaTimeGoodClusC",eta_clus_time[i][j]); + fill("CscSegmMonitor", etaTimeGoodClusC); + } + + if(std::abs(phi_clus_time[i][j]) <= 200) { + auto phiTimeGoodClusC = Monitored::Scalar<float>("phiTimeGoodClusC",phi_clus_time[i][j]); + fill("CscSegmMonitor", phiTimeGoodClusC); + } + } + } + } + + if(i==0) { + auto etaQSumTot0 = Monitored::Scalar<float>("etaQSumTot0", eta_clus_qsum_tot); + auto phiQSumTot0 = Monitored::Scalar<float>("phiQSumTot0", phi_clus_qsum_tot); + fill("CscSegmMonitor", etaQSumTot0, phiQSumTot0); + } + + if(i==1) { + auto etaQSumTot = Monitored::Scalar<float>("etaQSumTot", eta_clus_qsum_tot); + auto phiQSumTot = Monitored::Scalar<float>("phiQSumTot", phi_clus_qsum_tot); + fill("CscSegmMonitor", etaQSumTot, phiQSumTot); + } + } + } // if is csc segment + } // loop over segms + } // environment if + + return StatusCode::SUCCESS; +} + +//________________________________________________________________________________________________________ +bool CSCSegmValMonAlg::evtSelTriggersPassed() const { + + if(!m_doEvtSel) return true; + + for (const auto& trig : m_sampSelTriggers) { + if(m_trigDecTool->isPassed(trig, TrigDefs::eventAccepted)) { + return true; + } + } + return false; + +} // end evtSelTriggersPassed + +//________________________________________________________________________________________________________ +bool CSCSegmValMonAlg::isCscSegment( const Muon::MuonSegment* seg ) const { + bool isCsc(false); + + std::vector<const Trk::MeasurementBase*> mbs = seg->containedMeasurements(); + for( unsigned int i = 0; i< mbs.size(); ++i){ + + const Trk::RIO_OnTrack* rot = dynamic_cast<const Trk::RIO_OnTrack*> (mbs[i]); + if (!rot){ + const Trk::CompetingRIOsOnTrack* crot = dynamic_cast<const Trk::CompetingRIOsOnTrack*> (mbs[i]); + if (crot) rot = &(crot->rioOnTrack(0)); + } + if( !rot ) { + continue; + } + if( m_idHelperSvc->isCsc( rot->identify() ) ) isCsc=true; + } + + return isCsc; +} + + +//________________________________________________________________________________________________________ +unsigned int CSCSegmValMonAlg::cscHits( const Muon::MuonSegment* seg ) const { + unsigned int nrHits(0); + + std::vector<const Trk::MeasurementBase*> mbs = seg->containedMeasurements(); + for( unsigned int i = 0; i< mbs.size(); ++i){ + + const Trk::RIO_OnTrack* rot = dynamic_cast<const Trk::RIO_OnTrack*> (mbs[i]); + if (!rot){ + const Trk::CompetingRIOsOnTrack* crot = dynamic_cast<const Trk::CompetingRIOsOnTrack*> (mbs[i]); + if (crot) rot = &(crot->rioOnTrack(0)); + } + if( !rot ) { + continue; + } + if( m_idHelperSvc->isCsc( rot->identify() ) ) ++nrHits; + } + + return nrHits ; +} + +//________________________________________________________________________________________________________ +bool CSCSegmValMonAlg::segmSlopeCut(const float csc_x, const float csc_ax, const float cut ) const { + float s0 = csc_x; + float s1 = -std::tan(csc_ax); + float s1corr = s1 - 0.000119 * s0; + bool good_segm = std::abs(s1corr)<cut ? true : false; + return good_segm; +} + diff --git a/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/CscRawDataMonitoring/src/CscClusterValMonAlg.cxx b/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/CscRawDataMonitoring/src/CscClusterValMonAlg.cxx index 3b42684744905c9069431393deb2e176ebc5f097..77279b9049eff51ff7a576031b7bfcc012a66823 100644 --- a/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/CscRawDataMonitoring/src/CscClusterValMonAlg.cxx +++ b/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/CscRawDataMonitoring/src/CscClusterValMonAlg.cxx @@ -2,16 +2,6 @@ Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ -//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~// -/* NAME : CscClusterValMonAlg.cxx - * PACKAGE : MuonRawDataMonitoring/CscRawDataMonitoring - * PURPOSE : CSC cluster monitoring - * AUTHOR : Venkatesh Kaushik <venkat.kaushik@cern.ch> (2009-04-27) - * - * MODIFIED: C.Paraskevopoulos, C.Kitsaki - */ -//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~// - #include "AthenaMonitoring/AthenaMonManager.h" // Athena include(s) @@ -27,13 +17,7 @@ using namespace Muon; CscClusterValMonAlg::CscClusterValMonAlg( const std::string& name, ISvcLocator* pSvcLocator ) : AthMonitorAlgorithm(name,pSvcLocator) - { - declareProperty("CSCQmaxCutADC", m_qmaxADCCut = 100); - - //trigger aware monitoring - declareProperty("CSCDoEventSelection", m_doEvtSel = false ); - declareProperty("CSCEventSelTriggers", m_sampSelTriggers ); - } + { } StatusCode CscClusterValMonAlg::initialize() { @@ -63,18 +47,7 @@ StatusCode CscClusterValMonAlg::fillHistograms( const EventContext& ctx ) const StatusCode sc = StatusCode::SUCCESS; // check if event passed sample-selection triggers - //if(m_doEvtSel) { if(!evtSelTriggersPassed()) return sc; } - - bool check = false; - - if(!m_doEvtSel) check = true; - std::vector<std::string>::const_iterator - it = m_sampSelTriggers.begin(), itE = m_sampSelTriggers.end(); - for ( ; it != itE; it++ ) { - if (m_trigDecTool->isPassed(*it, TrigDefs::eventAccepted)) check = true; - } - - if(m_doEvtSel) { if(!check) return sc; } + if(m_doEvtSel) { if(!evtSelTriggersPassed()) return sc; } // retrieve cluster / strip collection SG::ReadHandle<CscPrepDataContainer> cscCluster(m_cscClusterKey, ctx); @@ -453,3 +426,20 @@ StatusCode CscClusterValMonAlg::fillHistograms( const EventContext& ctx ) const return sc; } + +// +// evtSelTriggersPassed ---------------------------------------------------------------- +// +bool CscClusterValMonAlg::evtSelTriggersPassed() const { + + if(!m_doEvtSel) return true; + + for(const auto& trig : m_sampSelTriggers) { + if(m_trigDecTool->isPassed(trig,TrigDefs::eventAccepted)){ + return true; + } + } + return false; + +} // end evtSelTriggersPassed + diff --git a/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/CscRawDataMonitoring/src/CscPrdValMonAlg.cxx b/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/CscRawDataMonitoring/src/CscPrdValMonAlg.cxx index 30e457638e64aef8de7d4cb380b4e7fb561c9f75..923d7dbf8426567124d3a3b0ac434ffbcb546d4a 100755 --- a/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/CscRawDataMonitoring/src/CscPrdValMonAlg.cxx +++ b/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/CscRawDataMonitoring/src/CscPrdValMonAlg.cxx @@ -2,20 +2,6 @@ Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ -//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~// -/* NAME : CscPrdValMonAlg.cxx - * PACKAGE : MuonRawDataMonitoring/CscRawDataMonitoring - * PURPOSE : CSC PrepRawData (PRD) monitoring - * AUTHOR : Ken Johns, Xiaowen Lei (U.Arizona) - * - * MODIFIED: N. Benekos(Illinois) - * V. Kaushik(U.Arizona) : 2009-05-12 - * J. Veatch(U.Arizona) : 2012-02-08 - - * MODIFIED: C.Kitsaki, C.Paraskevopoulos - */ -//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~// - #include "AthenaMonitoring/AthenaMonManager.h" // Athena include(s) @@ -26,13 +12,9 @@ using namespace Muon; CscPrdValMonAlg::CscPrdValMonAlg( const std::string& name, ISvcLocator* pSvcLocator ) : - AthMonitorAlgorithm(name,pSvcLocator) - { - declareProperty("NoiseCutADC", m_cscNoiseCut = 50); - declareProperty("MapYXandRZ", m_mapxyrz = false); - } - - + AthMonitorAlgorithm(name,pSvcLocator) + { } + StatusCode CscPrdValMonAlg::initialize() { ATH_MSG_INFO( "CscPrdValMonAlg: in initialize" ); ATH_CHECK(m_idHelperSvc.retrieve()); diff --git a/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/CscRawDataMonitoring/src/components/CscRawDataMonitoring_entries.cxx b/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/CscRawDataMonitoring/src/components/CscRawDataMonitoring_entries.cxx index 366e04e5294f89848259ffa628e11ff9758d25f0..4b633badcd78eb502821939ea45a0d2f26dd2cbb 100644 --- a/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/CscRawDataMonitoring/src/components/CscRawDataMonitoring_entries.cxx +++ b/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/CscRawDataMonitoring/src/components/CscRawDataMonitoring_entries.cxx @@ -4,6 +4,7 @@ #include "CscRawDataMonitoring/CSCSegmValAlg.h" #include "CscRawDataMonitoring/CscClusterValMonAlg.h" #include "CscRawDataMonitoring/CscPrdValMonAlg.h" +#include "CscRawDataMonitoring/CSCSegmValMonAlg.h" DECLARE_COMPONENT( CscRdoValAlg ) @@ -12,4 +13,4 @@ DECLARE_COMPONENT( CscClusterValAlg ) DECLARE_COMPONENT( CSCSegmValAlg ) DECLARE_COMPONENT( CscClusterValMonAlg ) DECLARE_COMPONENT( CscPrdValMonAlg ) - +DECLARE_COMPONENT( CSCSegmValMonAlg ) diff --git a/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/MdtRawDataMonitoring/python/MDTMonitorAlgorithm.py b/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/MdtRawDataMonitoring/python/MDTMonitorAlgorithm.py index da1a66572d62e3f8ba36b8a0ae3dd8240e57f933..25a11b32020662d7f42680ab56cc24d4b85e8660 100644 --- a/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/MdtRawDataMonitoring/python/MDTMonitorAlgorithm.py +++ b/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/MdtRawDataMonitoring/python/MDTMonitorAlgorithm.py @@ -48,7 +48,9 @@ def MdtMonitoringConfig(inputFlags): mdtMonAlg.do_mdtChamberHits=True mdtMonAlg.do_mdttdccut_sector=True mdtMonAlg.do_mdtchamberstatphislice=True - # Add a gezneric monitoring tool (a "group" in old language). The returned + if not inputFlags.DQ.triggerDataAvailable: + mdtMonAlg.L1RoiKey='' + # Add a generic monitoring tool (a "group" in old language). The returned # object here is the standard GenericMonitoringTool. mdtGroup = helper.addGroup(mdtMonAlg,'MdtMonitor','Muon/MuonRawDataMonitoring/MDT/') diff --git a/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/MdtRawDataMonitoring/src/MdtRawDataMonAlg.cxx b/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/MdtRawDataMonitoring/src/MdtRawDataMonAlg.cxx index 173475953f63fd5f9688fd0ede093a6b53731e84..9d0df654342e6b918637829f99048b778174608b 100755 --- a/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/MdtRawDataMonitoring/src/MdtRawDataMonAlg.cxx +++ b/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/MdtRawDataMonitoring/src/MdtRawDataMonAlg.cxx @@ -197,7 +197,7 @@ StatusCode MdtRawDataMonAlg::initialize() else m_masked_tubes = new MDTNoisyTubes(false); mdtchamberId(); - ATH_CHECK(m_l1RoiKey.initialize()); + ATH_CHECK(m_l1RoiKey.initialize(SG::AllowEmpty)); ATH_CHECK(m_muonKey.initialize()); ATH_CHECK(m_segm_type.initialize()); ATH_CHECK(m_key_mdt.initialize()); @@ -302,7 +302,7 @@ StatusCode MdtRawDataMonAlg::fillHistograms(const EventContext& ctx) const // Retrieve the LVL1 Muon RoIs: bool trig_BARREL = false; bool trig_ENDCAP = false; - try{ + if (!m_l1RoiKey.empty()) { SG::ReadHandle<xAOD::MuonRoIContainer> muonRoIs(m_l1RoiKey, ctx); if(!muonRoIs.isValid()){ ATH_MSG_ERROR("evtStore() does not contain muon L1 ROI Collection with name "<< m_l1RoiKey); @@ -315,8 +315,6 @@ StatusCode MdtRawDataMonAlg::fillHistograms(const EventContext& ctx) const trig_ENDCAP = std::any_of(muonRoIs->begin(), muonRoIs->end(), [](const auto& i){return i->getSource() == xAOD::MuonRoI::RoISource::Endcap;}); } - } catch (SG::ExcNoAuxStore & excpt){ - ATH_MSG_INFO("SG::ExcNoAuxStore caught, "<<m_l1RoiKey.key()<<" not available."); } //declare MDT stuff diff --git a/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/RpcRawDataMonitoring/python/RpcMonitorAlgorithm.py b/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/RpcRawDataMonitoring/python/RpcMonitorAlgorithm.py index b2935e9946d25ad5359b5bbf9fe38fd7718dc3bb..5405b9a27267c91c904df15161b3c78229a16715 100644 --- a/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/RpcRawDataMonitoring/python/RpcMonitorAlgorithm.py +++ b/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/RpcRawDataMonitoring/python/RpcMonitorAlgorithm.py @@ -19,6 +19,8 @@ def RpcMonitoringConfig(inputFlags): rpcMonitorAlg.MinRoIDR = 0.3 rpcMonitorAlg.MinPt = 2000 rpcMonitorAlg.MuQuality = 1 + if not inputFlags.DQ.triggerDataAvailable: + rpcMonitorAlg.L1RoiContainerKey = '' myGroup = helper.addGroup(rpcMonitorAlg, 'RPCMonitorAlgorithm', 'Muon/MuonRawDataMonitoring/RPC/') diff --git a/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/RpcRawDataMonitoring/src/RPCMonitorAlgorithm.cxx b/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/RpcRawDataMonitoring/src/RPCMonitorAlgorithm.cxx index a650050ed2f64d37bcc7da73aad8bdec76e92464..82411ee1d15eea6957b800d91b0f363ad9f95a26 100644 --- a/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/RpcRawDataMonitoring/src/RPCMonitorAlgorithm.cxx +++ b/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/RpcRawDataMonitoring/src/RPCMonitorAlgorithm.cxx @@ -24,7 +24,7 @@ StatusCode RPCMonitorAlgorithm::initialize() { ATH_CHECK( m_MuonContainerKey .initialize()); ATH_CHECK( m_rpcPadContainerKey.initialize()); - ATH_CHECK( m_l1RoiContainerKey .initialize()); + ATH_CHECK( m_l1RoiContainerKey .initialize(SG::AllowEmpty)); ATH_CHECK( m_muonSelectionTool.retrieve()); @@ -74,29 +74,31 @@ StatusCode RPCMonitorAlgorithm::fillHistograms(const EventContext& ctx) const // // read rois // - SG::ReadHandle<xAOD::MuonRoIContainer> muonRoIs(m_l1RoiContainerKey, ctx); - if(!muonRoIs.isValid()){ - ATH_MSG_ERROR("evtStore() does not contain muon L1 ROI Collection with name "<< m_l1RoiContainerKey); - return StatusCode::FAILURE; - } - std::vector<const xAOD::MuonRoI*> roisBarrel; std::vector<const xAOD::MuonRoI*> roisBarrelThr1; - for(const auto& roi : *muonRoIs) { - roiEtaVec.push_back(roi->eta()); - if(roi->getSource() != xAOD::MuonRoI::RoISource::Barrel) { - continue; + if (! m_l1RoiContainerKey.empty()) { + SG::ReadHandle<xAOD::MuonRoIContainer> muonRoIs(m_l1RoiContainerKey, ctx); + if(!muonRoIs.isValid()){ + ATH_MSG_ERROR("evtStore() does not contain muon L1 ROI Collection with name "<< m_l1RoiContainerKey); + return StatusCode::FAILURE; } - roiBarrelEtaVec.push_back(roi->eta()); - roiBarrelThrVec.push_back(roi->getThrNumber()); - roisBarrel.push_back(roi); - // - // collect roi according to the threshold - // - int thr = roi->getThrNumber(); - if(thr >= 1) roisBarrelThr1.push_back(roi); + for(const auto& roi : *muonRoIs) { + roiEtaVec.push_back(roi->eta()); + if(roi->getSource() != xAOD::MuonRoI::RoISource::Barrel) { + continue; + } + + roiBarrelEtaVec.push_back(roi->eta()); + roiBarrelThrVec.push_back(roi->getThrNumber()); + roisBarrel.push_back(roi); + // + // collect roi according to the threshold + // + int thr = roi->getThrNumber(); + if(thr >= 1) roisBarrelThr1.push_back(roi); + } } auto roiEtaCollection = Collection("roiEtaCollection", roiEtaVec); auto roiBarrelEtaCollection = Collection("roiBarrelEtaCollection", roiBarrelEtaVec); diff --git a/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/TgcRawDataMonitoring/python/TgcRawDataMonitorAlgorithm.py b/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/TgcRawDataMonitoring/python/TgcRawDataMonitorAlgorithm.py index 3de766bd0c5963020501d85e7769cb5298d309f3..f1aca9130cdf715edb83d9e0d5e41d59ec79ded9 100644 --- a/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/TgcRawDataMonitoring/python/TgcRawDataMonitorAlgorithm.py +++ b/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/TgcRawDataMonitoring/python/TgcRawDataMonitorAlgorithm.py @@ -26,6 +26,9 @@ def TgcRawDataMonitoringConfig(inputFlags): tgcRawDataMonAlg.TagTrigList += ',HLT_mu6_L1MU6' tgcRawDataMonAlg.TagTrigList += ',HLT_mu20_mu8noL1;HLT_mu20' + if not inputFlags.DQ.triggerDataAvailable: + tgcRawDataMonAlg.MuonRoIContainerName = '' + if 'HLT_xAOD__MuonContainer_MuonEFInfo' in inputFlags.Input.Collections: tgcRawDataMonAlg.MuonEFContainerName='HLT_xAOD__MuonContainer_MuonEFInfo' if 'TGC_MeasurementsAllBCs' in inputFlags.Input.Collections: diff --git a/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/TgcRawDataMonitoring/src/TgcRawDataMonitorAlgorithm.cxx b/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/TgcRawDataMonitoring/src/TgcRawDataMonitorAlgorithm.cxx index 2d0e7fbbfc142ed0c56e0940d695be21071ec1fc..5c60f071005e44865e473cb7757dd35b484f888c 100644 --- a/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/TgcRawDataMonitoring/src/TgcRawDataMonitorAlgorithm.cxx +++ b/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/TgcRawDataMonitoring/src/TgcRawDataMonitorAlgorithm.cxx @@ -16,7 +16,7 @@ StatusCode TgcRawDataMonitorAlgorithm::initialize() { ATH_CHECK(m_idHelperSvc.retrieve()); ATH_CHECK(m_extrapolator.retrieve()); ATH_CHECK(m_MuonContainerKey.initialize()); - ATH_CHECK(m_MuonRoIContainerKey.initialize()); + ATH_CHECK(m_MuonRoIContainerKey.initialize(SG::AllowEmpty)); ATH_CHECK(m_TgcPrepDataContainerKey.initialize()); ATH_CHECK(m_TgcCoinDataContainerCurrBCKey.initialize()); ATH_CHECK(m_TgcCoinDataContainerNextBCKey.initialize()); @@ -70,47 +70,52 @@ StatusCode TgcRawDataMonitorAlgorithm::fillHistograms( const EventContext& ctx ) variables.clear(); return StatusCode::SUCCESS; } - /* raw LVL1MuonRoIs distributions */ - SG::ReadHandle<xAOD::MuonRoIContainer> rois(m_MuonRoIContainerKey, ctx); - if(!rois.isValid()){ - ATH_MSG_ERROR("evtStore() does not contain muon RoI Collection with name "<< m_MuonRoIContainerKey); - return StatusCode::FAILURE; + + xAOD::MuonRoIContainer rois; + if (!m_MuonRoIContainerKey.empty()) { + /* raw LVL1MuonRoIs distributions */ + auto roisptr = SG::get<xAOD::MuonRoIContainer>(m_MuonRoIContainerKey, ctx); + if(! roisptr){ + ATH_MSG_ERROR("evtStore() does not contain muon RoI Collection with name "<< m_MuonRoIContainerKey); + return StatusCode::FAILURE; + } + rois = *roisptr; } - auto roi_eta = Monitored::Collection("roi_eta",*rois, []( const xAOD::MuonRoI* m ){return m->eta();}); variables.push_back( roi_eta ); - auto roi_phi = Monitored::Collection("roi_phi",*rois, []( const xAOD::MuonRoI* m ){return m->phi();}); variables.push_back( roi_phi ); - auto roi_phi_rpc = Monitored::Collection("roi_phi_rpc",*rois, []( const xAOD::MuonRoI* m ){return (m->getSource()==xAOD::MuonRoI::Barrel)?m->phi():-10;}); variables.push_back( roi_phi_rpc ); - auto roi_phi_tgc = Monitored::Collection("roi_phi_tgc",*rois, []( const xAOD::MuonRoI* m ){return (m->getSource()!=xAOD::MuonRoI::Barrel)?m->phi():-10;}); variables.push_back( roi_phi_tgc ); - auto roi_thr = Monitored::Collection("roi_thr",*rois, []( const xAOD::MuonRoI* m ){return m->getThrNumber();}); variables.push_back( roi_thr ); - auto roi_rpc = Monitored::Collection("roi_rpc",*rois, []( const xAOD::MuonRoI* m ){return m->getSource()==xAOD::MuonRoI::Barrel;}); variables.push_back( roi_rpc ); - auto roi_tgc = Monitored::Collection("roi_tgc",*rois, []( const xAOD::MuonRoI* m ){return m->getSource()!=xAOD::MuonRoI::Barrel;}); variables.push_back( roi_tgc ); + auto roi_eta = Monitored::Collection("roi_eta",rois, []( const xAOD::MuonRoI* m ){return m->eta();}); variables.push_back( roi_eta ); + auto roi_phi = Monitored::Collection("roi_phi",rois, []( const xAOD::MuonRoI* m ){return m->phi();}); variables.push_back( roi_phi ); + auto roi_phi_rpc = Monitored::Collection("roi_phi_rpc",rois, []( const xAOD::MuonRoI* m ){return (m->getSource()==xAOD::MuonRoI::Barrel)?m->phi():-10;}); variables.push_back( roi_phi_rpc ); + auto roi_phi_tgc = Monitored::Collection("roi_phi_tgc",rois, []( const xAOD::MuonRoI* m ){return (m->getSource()!=xAOD::MuonRoI::Barrel)?m->phi():-10;}); variables.push_back( roi_phi_tgc ); + auto roi_thr = Monitored::Collection("roi_thr",rois, []( const xAOD::MuonRoI* m ){return m->getThrNumber();}); variables.push_back( roi_thr ); + auto roi_rpc = Monitored::Collection("roi_rpc",rois, []( const xAOD::MuonRoI* m ){return m->getSource()==xAOD::MuonRoI::Barrel;}); variables.push_back( roi_rpc ); + auto roi_tgc = Monitored::Collection("roi_tgc",rois, []( const xAOD::MuonRoI* m ){return m->getSource()!=xAOD::MuonRoI::Barrel;}); variables.push_back( roi_tgc ); - auto roi_barrel = Monitored::Collection("roi_barrel",*rois, []( const xAOD::MuonRoI* m ){return m->getSource()==xAOD::MuonRoI::Barrel;}); variables.push_back( roi_barrel ); - auto roi_endcap = Monitored::Collection("roi_endcap",*rois, []( const xAOD::MuonRoI* m ){return m->getSource()==xAOD::MuonRoI::Endcap;}); variables.push_back( roi_endcap ); - auto roi_forward = Monitored::Collection("roi_forward",*rois, []( const xAOD::MuonRoI* m ){return m->getSource()==xAOD::MuonRoI::Forward;}); variables.push_back( roi_forward ); + auto roi_barrel = Monitored::Collection("roi_barrel",rois, []( const xAOD::MuonRoI* m ){return m->getSource()==xAOD::MuonRoI::Barrel;}); variables.push_back( roi_barrel ); + auto roi_endcap = Monitored::Collection("roi_endcap",rois, []( const xAOD::MuonRoI* m ){return m->getSource()==xAOD::MuonRoI::Endcap;}); variables.push_back( roi_endcap ); + auto roi_forward = Monitored::Collection("roi_forward",rois, []( const xAOD::MuonRoI* m ){return m->getSource()==xAOD::MuonRoI::Forward;}); variables.push_back( roi_forward ); - auto roi_phi_barrel = Monitored::Collection("roi_phi_barrel",*rois, []( const xAOD::MuonRoI* m ){return (m->getSource()==xAOD::MuonRoI::Barrel)?m->phi():-10;}); variables.push_back( roi_phi_barrel ); - auto roi_phi_endcap = Monitored::Collection("roi_phi_endcap",*rois, []( const xAOD::MuonRoI* m ){return (m->getSource()==xAOD::MuonRoI::Endcap)?m->phi():-10;}); variables.push_back( roi_phi_endcap ); - auto roi_phi_forward = Monitored::Collection("roi_phi_forward",*rois, []( const xAOD::MuonRoI* m ){return (m->getSource()==xAOD::MuonRoI::Forward)?m->phi():-10;}); variables.push_back( roi_phi_forward ); + auto roi_phi_barrel = Monitored::Collection("roi_phi_barrel",rois, []( const xAOD::MuonRoI* m ){return (m->getSource()==xAOD::MuonRoI::Barrel)?m->phi():-10;}); variables.push_back( roi_phi_barrel ); + auto roi_phi_endcap = Monitored::Collection("roi_phi_endcap",rois, []( const xAOD::MuonRoI* m ){return (m->getSource()==xAOD::MuonRoI::Endcap)?m->phi():-10;}); variables.push_back( roi_phi_endcap ); + auto roi_phi_forward = Monitored::Collection("roi_phi_forward",rois, []( const xAOD::MuonRoI* m ){return (m->getSource()==xAOD::MuonRoI::Forward)?m->phi():-10;}); variables.push_back( roi_phi_forward ); - auto roi_sideA = Monitored::Collection("roi_sideA",*rois, []( const xAOD::MuonRoI* m ){return m->getHemisphere()==xAOD::MuonRoI::Positive;}); variables.push_back( roi_sideA ); - auto roi_sideC = Monitored::Collection("roi_sideC",*rois, []( const xAOD::MuonRoI* m ){return m->getHemisphere()==xAOD::MuonRoI::Negative;}); variables.push_back( roi_sideC ); + auto roi_sideA = Monitored::Collection("roi_sideA",rois, []( const xAOD::MuonRoI* m ){return m->getHemisphere()==xAOD::MuonRoI::Positive;}); variables.push_back( roi_sideA ); + auto roi_sideC = Monitored::Collection("roi_sideC",rois, []( const xAOD::MuonRoI* m ){return m->getHemisphere()==xAOD::MuonRoI::Negative;}); variables.push_back( roi_sideC ); - auto thrmask1 = Monitored::Collection("thrmask1",*rois,[](const xAOD::MuonRoI* m){return m->getThrNumber()==1;});variables.push_back(thrmask1); - auto thrmask2 = Monitored::Collection("thrmask2",*rois,[](const xAOD::MuonRoI* m){return m->getThrNumber()==2;});variables.push_back(thrmask2); - auto thrmask3 = Monitored::Collection("thrmask3",*rois,[](const xAOD::MuonRoI* m){return m->getThrNumber()==3;});variables.push_back(thrmask3); - auto thrmask4 = Monitored::Collection("thrmask4",*rois,[](const xAOD::MuonRoI* m){return m->getThrNumber()==4;});variables.push_back(thrmask4); - auto thrmask5 = Monitored::Collection("thrmask5",*rois,[](const xAOD::MuonRoI* m){return m->getThrNumber()==5;});variables.push_back(thrmask5); - auto thrmask6 = Monitored::Collection("thrmask6",*rois,[](const xAOD::MuonRoI* m){return m->getThrNumber()==6;});variables.push_back(thrmask6); - auto thrmask7 = Monitored::Collection("thrmask7",*rois,[](const xAOD::MuonRoI* m){return m->getThrNumber()==7;});variables.push_back(thrmask7); - auto thrmask8 = Monitored::Collection("thrmask8",*rois,[](const xAOD::MuonRoI* m){return m->getThrNumber()==8;});variables.push_back(thrmask8); - auto thrmask9 = Monitored::Collection("thrmask9",*rois,[](const xAOD::MuonRoI* m){return m->getThrNumber()==9;});variables.push_back(thrmask9); - auto thrmask10 = Monitored::Collection("thrmask10",*rois,[](const xAOD::MuonRoI* m){return m->getThrNumber()==10;});variables.push_back(thrmask10); - auto thrmask11 = Monitored::Collection("thrmask11",*rois,[](const xAOD::MuonRoI* m){return m->getThrNumber()==11;});variables.push_back(thrmask11); - auto thrmask12 = Monitored::Collection("thrmask12",*rois,[](const xAOD::MuonRoI* m){return m->getThrNumber()==12;});variables.push_back(thrmask12); - auto thrmask13 = Monitored::Collection("thrmask13",*rois,[](const xAOD::MuonRoI* m){return m->getThrNumber()==13;});variables.push_back(thrmask13); - auto thrmask14 = Monitored::Collection("thrmask14",*rois,[](const xAOD::MuonRoI* m){return m->getThrNumber()==14;});variables.push_back(thrmask14); - auto thrmask15 = Monitored::Collection("thrmask15",*rois,[](const xAOD::MuonRoI* m){return m->getThrNumber()==15;});variables.push_back(thrmask15); + auto thrmask1 = Monitored::Collection("thrmask1",rois,[](const xAOD::MuonRoI* m){return m->getThrNumber()==1;});variables.push_back(thrmask1); + auto thrmask2 = Monitored::Collection("thrmask2",rois,[](const xAOD::MuonRoI* m){return m->getThrNumber()==2;});variables.push_back(thrmask2); + auto thrmask3 = Monitored::Collection("thrmask3",rois,[](const xAOD::MuonRoI* m){return m->getThrNumber()==3;});variables.push_back(thrmask3); + auto thrmask4 = Monitored::Collection("thrmask4",rois,[](const xAOD::MuonRoI* m){return m->getThrNumber()==4;});variables.push_back(thrmask4); + auto thrmask5 = Monitored::Collection("thrmask5",rois,[](const xAOD::MuonRoI* m){return m->getThrNumber()==5;});variables.push_back(thrmask5); + auto thrmask6 = Monitored::Collection("thrmask6",rois,[](const xAOD::MuonRoI* m){return m->getThrNumber()==6;});variables.push_back(thrmask6); + auto thrmask7 = Monitored::Collection("thrmask7",rois,[](const xAOD::MuonRoI* m){return m->getThrNumber()==7;});variables.push_back(thrmask7); + auto thrmask8 = Monitored::Collection("thrmask8",rois,[](const xAOD::MuonRoI* m){return m->getThrNumber()==8;});variables.push_back(thrmask8); + auto thrmask9 = Monitored::Collection("thrmask9",rois,[](const xAOD::MuonRoI* m){return m->getThrNumber()==9;});variables.push_back(thrmask9); + auto thrmask10 = Monitored::Collection("thrmask10",rois,[](const xAOD::MuonRoI* m){return m->getThrNumber()==10;});variables.push_back(thrmask10); + auto thrmask11 = Monitored::Collection("thrmask11",rois,[](const xAOD::MuonRoI* m){return m->getThrNumber()==11;});variables.push_back(thrmask11); + auto thrmask12 = Monitored::Collection("thrmask12",rois,[](const xAOD::MuonRoI* m){return m->getThrNumber()==12;});variables.push_back(thrmask12); + auto thrmask13 = Monitored::Collection("thrmask13",rois,[](const xAOD::MuonRoI* m){return m->getThrNumber()==13;});variables.push_back(thrmask13); + auto thrmask14 = Monitored::Collection("thrmask14",rois,[](const xAOD::MuonRoI* m){return m->getThrNumber()==14;});variables.push_back(thrmask14); + auto thrmask15 = Monitored::Collection("thrmask15",rois,[](const xAOD::MuonRoI* m){return m->getThrNumber()==15;});variables.push_back(thrmask15); if( !m_anaOfflMuon.value() ){ fill(m_packageName,variables); @@ -156,7 +161,7 @@ StatusCode TgcRawDataMonitorAlgorithm::fillHistograms( const EventContext& ctx ) if( pt/1000.>15.)max_dr = m_l1trigMatchWindow1.value(); else if(pt/1000.>10.)max_dr = m_l1trigMatchWindow2.value() + m_l1trigMatchWindow3.value() * pt/1000.; else max_dr = m_l1trigMatchWindow4.value() + m_l1trigMatchWindow5.value() * pt/1000.; - for(const auto& roi : *rois){ + for(const auto& roi : rois){ TLorentzVector roivec; roivec.SetPtEtaPhiM(1,roi->eta(),roi->phi(),1); double dr = roivec.DeltaR( mymuon.fourvec ); @@ -352,6 +357,7 @@ StatusCode TgcRawDataMonitorAlgorithm::fillHistograms( const EventContext& ctx ) StatusCode TgcRawDataMonitorAlgorithm::triggerMatching(const xAOD::Muon* offline_muon, const std::vector<TagDef>& list_of_triggers ) const { if( !m_TagAndProbe.value() )return StatusCode::SUCCESS; + if( getTrigDecisionTool().empty() ) return StatusCode::SUCCESS; TVector3 muonvec; muonvec.SetPtEtaPhi(offline_muon->pt(),offline_muon->eta(),offline_muon->phi()); for(auto tagTrig : list_of_triggers ){ if( !getTrigDecisionTool()->isPassed( tagTrig.eventTrig.Data() ) ) return StatusCode::FAILURE; diff --git a/MuonSpectrometer/MuonValidation/MuonPRDTest/src/MDTPRDValAlg.cxx b/MuonSpectrometer/MuonValidation/MuonPRDTest/src/MDTPRDValAlg.cxx index 58ff142d121afd7061b0f4c910c9c658c1038dd1..b3dce30d5df7408742e1bff6a0133ab2b221e8bf 100644 --- a/MuonSpectrometer/MuonValidation/MuonPRDTest/src/MDTPRDValAlg.cxx +++ b/MuonSpectrometer/MuonValidation/MuonPRDTest/src/MDTPRDValAlg.cxx @@ -529,7 +529,7 @@ void MDTPRDValAlg::addSimHits( MDTPRDValAlg::MuonMdtHitMap& muonMdtHitMap, MDTPR } - MdtHitIdHelper* mdthelper = MdtHitIdHelper::GetHelper(); + MdtHitIdHelper* mdthelper = MdtHitIdHelper::GetHelper(m_idHelperSvc->mdtIdHelper().tubeMax()); for(MDTSimHitCollection::const_iterator i_hit=p_collection->begin(); i_hit!=p_collection->end(); ++i_hit) { diff --git a/MuonSpectrometer/MuonValidation/MuonPRDTest/src/MDTSimHitVariables.cxx b/MuonSpectrometer/MuonValidation/MuonPRDTest/src/MDTSimHitVariables.cxx index d543f0ad34c570e9756f427165a160b0e7c44ad0..39303b5ad312c38c874936d05251628131cd879f 100644 --- a/MuonSpectrometer/MuonValidation/MuonPRDTest/src/MDTSimHitVariables.cxx +++ b/MuonSpectrometer/MuonValidation/MuonPRDTest/src/MDTSimHitVariables.cxx @@ -27,7 +27,7 @@ StatusCode MDTSimHitVariables::fillVariables(const MuonGM::MuonDetectorManager* CHECK( m_evtStore->retrieve(mdtContainer, m_ContainerName.c_str() ) ); // Get the MDT Id hit helper - MdtHitIdHelper* mdthhelper = MdtHitIdHelper::GetHelper(); + MdtHitIdHelper* mdthhelper = MdtHitIdHelper::GetHelper(m_MdtIdHelper->tubeMax()); if(mdtContainer->size()==0) ATH_MSG_WARNING(" MdtSimHit empty "); for( auto it : *mdtContainer ) { diff --git a/PhysicsAnalysis/Algorithms/TriggerAnalysisAlgorithms/CMakeLists.txt b/PhysicsAnalysis/Algorithms/TriggerAnalysisAlgorithms/CMakeLists.txt index 25126a762396acb1aaf9d156ad217444026464a6..c46755354baa3a84fbefda471fafd19b93baf567 100644 --- a/PhysicsAnalysis/Algorithms/TriggerAnalysisAlgorithms/CMakeLists.txt +++ b/PhysicsAnalysis/Algorithms/TriggerAnalysisAlgorithms/CMakeLists.txt @@ -27,9 +27,6 @@ atlas_install_joboptions( share/*_jobOptions.py ) atlas_install_scripts( share/*_eljob.py ) if( XAOD_STANDALONE ) - # FIX ME: temporarily disabled as part of the migration of AnalysisBase - # to master - atlas_add_test( TriggerAlgorithmsTestJobData SCRIPT TriggerAlgorithmsTest_eljob.py --data-type data --unit-test PROPERTIES TIMEOUT 600 ) diff --git a/PhysicsAnalysis/Algorithms/TriggerAnalysisAlgorithms/share/TriggerAlgorithmsTest_eljob.py b/PhysicsAnalysis/Algorithms/TriggerAnalysisAlgorithms/share/TriggerAlgorithmsTest_eljob.py index 4ac99cd0b355a9b992f3f3080329de19f92a7fe9..9dfbaa71e841e56c6e7fadd31c5850f04aba1a0f 100755 --- a/PhysicsAnalysis/Algorithms/TriggerAnalysisAlgorithms/share/TriggerAlgorithmsTest_eljob.py +++ b/PhysicsAnalysis/Algorithms/TriggerAnalysisAlgorithms/share/TriggerAlgorithmsTest_eljob.py @@ -1,6 +1,6 @@ #!/usr/bin/env python # -# Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration +# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration # # @author Tadej Novak @@ -24,6 +24,11 @@ parser.add_option( '-u', '--unit-test', dest='unit_test', import ROOT ROOT.xAOD.Init().ignore() +# Force-load some xAOD dictionaries. To avoid issues from ROOT-10940. +ROOT.xAOD.CaloClusterContainer() +ROOT.xAOD.MuonContainer() +ROOT.xAOD.TauJetContainer() + # ideally we'd run over all of them, but we don't have a mechanism to # configure per-sample right now diff --git a/PhysicsAnalysis/AnalysisCommon/PATInterfaces/CMakeLists.txt b/PhysicsAnalysis/AnalysisCommon/PATInterfaces/CMakeLists.txt index 3c0e7f91eca3c500a3b5ee3294f51b4b440039d8..2e938137e965946f2ac6c2e99457e7689f18ae3b 100644 --- a/PhysicsAnalysis/AnalysisCommon/PATInterfaces/CMakeLists.txt +++ b/PhysicsAnalysis/AnalysisCommon/PATInterfaces/CMakeLists.txt @@ -1,18 +1,8 @@ -# $Id: CMakeLists.txt 744627 2016-05-03 18:51:43Z krasznaa $ -################################################################################ -# Package: PATInterfaces -################################################################################ +# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration # Declare the package name: atlas_subdir( PATInterfaces ) -# Declare the package's dependencies: -atlas_depends_on_subdirs( - PUBLIC - Control/AthToolSupport/AsgTools - PRIVATE - PhysicsAnalysis/D3PDTools/RootCoreUtils ) - # External dependencies: find_package( Boost COMPONENTS regex ) find_package( ROOT COMPONENTS Core MathCore ) @@ -23,7 +13,7 @@ atlas_add_root_dictionary( PATInterfaces _dictionary ROOT_HEADERS PATInterfaces/SystematicVariation.h PATInterfaces/SystematicSet.h PATInterfaces/SystematicRegistry.h PATInterfaces/SystematicsUtil.h PATInterfaces/StreamTestWrapper.h - Root/LinkDef.h + PATInterfaces/CorrectionCode.h Root/LinkDef.h EXTERNAL_PACKAGES ROOT ) # Component(s) in the package: diff --git a/PhysicsAnalysis/AnalysisCommon/PATInterfaces/Root/LinkDef.h b/PhysicsAnalysis/AnalysisCommon/PATInterfaces/Root/LinkDef.h index 1acce08e71f7bb894cb129b9a782602eafe57e6d..aae5f73330b40dedfabfbc2f908a32fe80fa8803 100644 --- a/PhysicsAnalysis/AnalysisCommon/PATInterfaces/Root/LinkDef.h +++ b/PhysicsAnalysis/AnalysisCommon/PATInterfaces/Root/LinkDef.h @@ -1,14 +1,22 @@ -// $Id: LinkDef.h 726905 2016-02-29 20:49:20Z sfarrell $ // Dear emacs, this is -*- c++ -*- +// +// Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration +// +#ifndef PATINTERFACES_LINKDEF_H +#define PATINTERFACES_LINKDEF_H -#include <vector> - +// Local include(s). +#include "PATInterfaces/CorrectionCode.h" #include "PATInterfaces/SystematicVariation.h" #include "PATInterfaces/SystematicSet.h" #include "PATInterfaces/SystematicRegistry.h" #include "PATInterfaces/SystematicsUtil.h" #include "PATInterfaces/StreamTestWrapper.h" +// System include(s). +#include <set> +#include <vector> + #ifdef __CINT__ #pragma link off all globals; @@ -17,6 +25,7 @@ #pragma link C++ nestedclass; #pragma link C++ namespace CP; +#pragma link C++ class CP::CorrectionCode+; #pragma link C++ class CP::SystematicVariation+; #pragma link C++ class std::set<CP::SystematicVariation>+; #pragma link C++ class CP::SystematicSet+; @@ -29,4 +38,5 @@ #pragma link C++ namespace SysStreamTest; #pragma link C++ class SysStreamTest::StreamTestWrapper+; -#endif +#endif // __CINT__ +#endif // not PATINTERFACES_LINKDEF_H diff --git a/PhysicsAnalysis/AnalysisCommon/PileupReweighting/CMakeLists.txt b/PhysicsAnalysis/AnalysisCommon/PileupReweighting/CMakeLists.txt index 203f5d62669c0b5bce447ed6629c7517ae097fd4..2b29bf114cdc00516cc2d88f7ac3457efd45041d 100644 --- a/PhysicsAnalysis/AnalysisCommon/PileupReweighting/CMakeLists.txt +++ b/PhysicsAnalysis/AnalysisCommon/PileupReweighting/CMakeLists.txt @@ -5,26 +5,6 @@ # Declare the package name: atlas_subdir( PileupReweighting ) -# Extra dependencies based on the environment: -set( extra_dep ) -if( XAOD_STANDALONE ) - set( extra_dep PhysicsAnalysis/AnalysisCommon/ReweightUtils ) -else() - set( extra_Dep GaudiKernel Control/AthenaBaseComps ) -endif() - -# Declare the package's dependencies: -atlas_depends_on_subdirs( - PUBLIC - Control/AthToolSupport/AsgTools - PhysicsAnalysis/Interfaces/AsgAnalysisInterfaces - Trigger/TrigEvent/TrigDecisionInterface - PhysicsAnalysis/AnalysisCommon/PATInterfaces - PRIVATE - Event/xAOD/xAODEventInfo - Tools/PathResolver - ${extra_dep} ) - # External dependencies: find_package( ROOT COMPONENTS MathCore RIO Core Tree Hist ) @@ -92,4 +72,4 @@ atlas_add_test( ut_PRWDataWeightExample_test # Install files from the package: atlas_install_python_modules( python/*.py ) atlas_install_joboptions( share/*.py ) -atlas_install_scripts( scripts/PURW_create_actual_mu_profile.py ) +atlas_install_runtime( scripts/*.py ) diff --git a/PhysicsAnalysis/AnalysisCommon/PileupReweighting/python/__init__.py b/PhysicsAnalysis/AnalysisCommon/PileupReweighting/python/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..74583d364ec2ca794156596c7254d9b234a940c6 --- /dev/null +++ b/PhysicsAnalysis/AnalysisCommon/PileupReweighting/python/__init__.py @@ -0,0 +1,2 @@ +# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + diff --git a/PhysicsAnalysis/AnalysisCommon/PileupReweighting/src/PileupReweightingProvider.h b/PhysicsAnalysis/AnalysisCommon/PileupReweighting/src/PileupReweightingProvider.h index 7be829d5e557d3ee965efb08df305eb07e8dfd46..03f7434f53f8ca8584761611115351256f7163b4 100644 --- a/PhysicsAnalysis/AnalysisCommon/PileupReweighting/src/PileupReweightingProvider.h +++ b/PhysicsAnalysis/AnalysisCommon/PileupReweighting/src/PileupReweightingProvider.h @@ -23,6 +23,7 @@ class PileupReweightingProvider : public AthAlgorithm { declareProperty("Input",m_inputKey="","Specify a specific EventInfo object"); declareProperty("Output",m_outputKey="","Specify an output EventInfo object. If differs from input, will create a clone of EventInfo and decorate that"); declareProperty("ConfigOutputStream",m_configStream="","Specify the stream to output config file to"); + declareProperty("RunSystematics",m_systematics=true,"Enable systematics during run"); } ~PileupReweightingProvider() { } @@ -69,15 +70,17 @@ class PileupReweightingProvider : public AthAlgorithm { //here's an example of systematic variations - for(auto& syst : m_allSysts) { - ATH_MSG_VERBOSE("Doing systematic : " << syst.name()); - if(! m_tool->isAffectedBySystematic( syst )) continue; - CP::SystematicSet tmp; tmp.insert( syst ); - if( m_tool->applySystematicVariation( tmp ) != CP::SystematicCode::Ok ) continue; - CHECK( m_tool->apply(*evtInfo) ); + if (m_systematics){ + for(auto& syst : m_allSysts) { + ATH_MSG_VERBOSE("Doing systematic : " << syst.name()); + if(! m_tool->isAffectedBySystematic( syst )) continue; + CP::SystematicSet tmp; tmp.insert( syst ); + if( m_tool->applySystematicVariation( tmp ) != CP::SystematicCode::Ok ) continue; + CHECK( m_tool->apply(*evtInfo) ); + } + //make sure we leave the tool in the nominal mode + if( m_tool->applySystematicVariation( CP::SystematicSet() ) != CP::SystematicCode::Ok ) return StatusCode::FAILURE; } - //make sure we leave the tool in the nominal mode - if( m_tool->applySystematicVariation( CP::SystematicSet() ) != CP::SystematicCode::Ok ) return StatusCode::FAILURE; return StatusCode::SUCCESS; } @@ -89,6 +92,8 @@ class PileupReweightingProvider : public AthAlgorithm { CP::SystematicSet m_allSysts; + bool m_systematics; + }; } //end of CP namespace diff --git a/PhysicsAnalysis/AnalysisCommon/PileupReweighting/src/testPRWTool.C b/PhysicsAnalysis/AnalysisCommon/PileupReweighting/src/testPRWTool.C deleted file mode 100644 index e329b8bf8719df3a106026872a559e24ecbdf082..0000000000000000000000000000000000000000 --- a/PhysicsAnalysis/AnalysisCommon/PileupReweighting/src/testPRWTool.C +++ /dev/null @@ -1,189 +0,0 @@ -/* - Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration -*/ - - -#include "PileupReweighting/PileupReweightingTool.h" -#include "TTree.h" - -void testValue(double v1, double v2) { - if( (!v1 && v2) || (!v2 && v1) ) throw std::runtime_error("zero-non-zero mismatch"); - if( fabs(v1-v2)/v1 > 0.001 ) throw std::runtime_error("mismatch > 0.1% in values"); -} - - -int main() { - //create a 'dummy' lumicalc file, with only a few runs, with a few lumiblocks - TFile l("dummy.None.lumicalc.root","RECREATE"); - TTree *t = new TTree("LumiMetaData","LumiMetaData"); - UInt_t runNbr=0;Float_t ps1=1;Float_t ps2=1; Float_t ps3=1;UInt_t lbn=0;Float_t intLumi=0;Float_t mu=0; - t->Branch("RunNbr",&runNbr);t->Branch("L1Presc",&ps1);t->Branch("L2Presc",&ps2);t->Branch("L3Presc",&ps3);t->Branch("LBStart",&lbn);t->Branch("IntLumi",&intLumi);t->Branch("AvergeInteractionPerXing",&mu); - - runNbr=1;lbn=1;intLumi=5;mu=0.5;t->Fill(); - runNbr=1;lbn=2;intLumi=10;mu=1.5;t->Fill(); - runNbr=2;lbn=1;intLumi=3;mu=1.5;t->Fill(); - runNbr=3;lbn=1;intLumi=7;mu=1.5;t->Fill(); - runNbr=3;lbn=2;intLumi=2;mu=2.5;t->Fill(); //will be unrepresented data in the setup in channel 2000 - - t->Write();delete t; - l.Close(); - - //make some trigger lumicalcs... only the prescale numbers are important! - TFile l2("dummy.TriggerA.lumicalc.root","RECREATE"); - t = new TTree("LumiMetaData","LumiMetaData"); - t->Branch("RunNbr",&runNbr);t->Branch("L1Presc",&ps1);t->Branch("L2Presc",&ps2);t->Branch("L3Presc",&ps3);t->Branch("LBStart",&lbn);t->Branch("IntLumi",&intLumi);t->Branch("AvergeInteractionPerXing",&mu); - - runNbr=1;lbn=1;ps1=2;mu=0.5;t->Fill(); - runNbr=1;lbn=2;ps1=3;mu=1.5;t->Fill(); - runNbr=2;lbn=1;ps1=3;mu=1.5;t->Fill(); - runNbr=3;lbn=1;ps1=4;mu=1.5;t->Fill(); - runNbr=3;lbn=2;ps1=2;mu=2.5;t->Fill(); - - t->Write();delete t; - l2.Close(); - - TFile l3("dummy.TriggerB.lumicalc.root","RECREATE"); - t = new TTree("LumiMetaData","LumiMetaData"); - t->Branch("RunNbr",&runNbr);t->Branch("L1Presc",&ps1);t->Branch("L2Presc",&ps2);t->Branch("L3Presc",&ps3);t->Branch("LBStart",&lbn);t->Branch("IntLumi",&intLumi);t->Branch("AvergeInteractionPerXing",&mu); - - runNbr=1;lbn=1;ps1=4;mu=0.5;t->Fill(); - runNbr=1;lbn=2;ps1=6;mu=1.5;t->Fill(); - runNbr=2;lbn=1;ps1=6;mu=1.5;t->Fill(); - runNbr=3;lbn=1;ps1=8;mu=1.5;t->Fill(); - runNbr=3;lbn=2;ps1=4;mu=2.5;t->Fill(); - - t->Write();delete t; - l3.Close(); - - //now create a config file ... this test config file generating - - CP::TPileupReweighting g; - g.AddPeriod(100,1,2); - g.AddPeriod(101,3,3); - g.SetUniformBinning(10,0,10); - g.Initialize(); - - g.Fill(100,2002,1,0.5); - g.Fill(100,2002,1,1.5); - g.Fill(101,2002,1,1.5); - g.Fill(101,2002,1,2.5); - g.Fill(101,2002,1,3.5); - - g.WriteToFile("dummy1.prw.root"); - - CP::TPileupReweighting* genConfig = new CP::TPileupReweighting("genConfig"); - genConfig->AddPeriod(100,1,2); - genConfig->AddPeriod(101,3,3); - genConfig->SetUniformBinning(10,0,10); - genConfig->Initialize(); - - genConfig->Fill(100,2000/*channel number*/,1/*evt_weight*/,0.5); - genConfig->Fill(100,2000,1,1.5); - genConfig->Fill(101,2000,1,1.5);genConfig->Fill(101,2000,1,1.5);genConfig->Fill(101,2000,1,1.5); //three times stats in this bin - - genConfig->Fill(100,2001,0.5,1.5); - genConfig->Fill(101,2001,2,1.5); - genConfig->Fill(101,2001,1,2.5); - - genConfig->WriteToFile("dummy2.prw.root"); - - - std::vector<std::string> configFiles = {"dummy2.prw.root"}; - std::vector<std::string> lumicalcFiles = {"dummy.None.lumicalc.root"}; - - //check multi period failure - CP::IPileupReweightingTool* prw_bad = new CP::PileupReweightingTool("prw_bad"); - asg::setProperty(prw_bad,"ConfigFiles",configFiles).ignore(); - asg::setProperty(prw_bad,"LumiCalcFiles",lumicalcFiles).ignore(); - - try { - prw_bad->initialize().ignore(); - } catch(const std::runtime_error& e) { - std::cout << "correctly caught:" << e.what() << std::endl; - } - - - - //repeat with action=3 ... - CP::IPileupReweightingTool* prw = new CP::PileupReweightingTool("prw"); - asg::setProperty(prw,"ConfigFiles",configFiles).ignore(); - asg::setProperty(prw,"LumiCalcFiles",lumicalcFiles).ignore(); - asg::setProperty(prw,"UseMultiPeriods",true).ignore(); //channel 2000 has periods 100 and 101 - prw->initialize().ignore(); - - - - prw->expert()->SetUnrepresentedDataAction(3,1); - - std::cout << "prw channel2000 combined weights: " << prw->expert()->GetCombinedWeight(100,2000,0.5) << " (expected 0.0) " << prw->expert()->GetCombinedWeight(100,2000,1.5) << " (expected 3.33333) " << prw->expert()->GetCombinedWeight(101,2000,1.5) << " (expected=0.555555) " << std::endl; - std::cout << "prw channel2000 'sum of weights': " << prw->expert()->GetCombinedWeight(100,2000,0.5)+prw->expert()->GetCombinedWeight(100,2000,1.5)+3*prw->expert()->GetCombinedWeight(101,2000,1.5) << " from 5 events (sum of evtweights=5)" << std::endl; - - std::cout << "prw channel2001 combined weights: " << prw->expert()->GetCombinedWeight(100,2001,1.5) << " (expected 4.66666) " << prw->expert()->GetCombinedWeight(101,2001,1.5) << " (expected 0.58333) " << prw->expert()->GetCombinedWeight(101,2001,2.5) << " (expected=0.259259) " << std::endl; - std::cout << "prw channel2001 'sum of weights': " << 0.5*prw->expert()->GetCombinedWeight(100,2001,1.5)+2.*prw->expert()->GetCombinedWeight(101,2001,1.5)+1.*prw->expert()->GetCombinedWeight(101,2001,2.5) << " from 3 events (of various weights, sum of evtweights=3.5)" << std::endl; - - - - - CP::IPileupReweightingTool* prw1 = new CP::PileupReweightingTool("prw1"); - std::vector<std::string> configFiles1 = {"dummy1.prw.root"}; - std::vector<std::string> lumicalcFiles1 = {"dummy.None.lumicalc.root","dummy.TriggerA.lumicalc.root:TriggerA","dummy.TriggerB.lumicalc.root:TriggerB"}; - asg::setProperty(prw1, "ConfigFiles",configFiles1).ignore(); - asg::setProperty(prw1, "LumiCalcFiles",lumicalcFiles1).ignore(); - asg::setProperty(prw1,"UseMultiPeriods",true).ignore(); //channel 2000 has periods 100 and 101 - prw1->initialize().ignore(); - - std::cout << "prw1 Integrated lumi = " << prw1->GetIntegratedLumi() << " (expected=2.7e-5) " << std::endl; testValue(prw1->GetIntegratedLumi(),2.7e-5); - std::cout << "prw1 periodWeights : " << prw1->expert()->GetPeriodWeight(100,2002) << " (expected=1.6666) " << prw1->expert()->GetPeriodWeight(101,2002) << " (expected=0.5555)" << std::endl; testValue(prw1->expert()->GetPeriodWeight(100,2002),1.6666); - std::cout << "prw1 primaryWeights : " << prw1->expert()->GetPrimaryWeight(100,2002,0.5) << " (expected=0.5555) " << prw1->expert()->GetPrimaryWeight(100,2002,1.5) << " (expected=1.4444) " << prw1->expert()->GetPrimaryWeight(101,2002,0.5) << " (expected=inf .. no MC) " << prw1->expert()->GetPrimaryWeight(101,2002,1.5) << " (expected=2.3333) " << prw1->expert()->GetPrimaryWeight(101,2002,2.5) << " (expected=0.6666) " << prw1->expert()->GetPrimaryWeight(101,2002,3.5) << " (expected=0.) " << std::endl; - testValue(prw1->expert()->GetPrimaryWeight(100,2002,0.5),0.5555); - testValue(prw1->expert()->GetPrimaryWeight(100,2002,1.5),1.4444); - testValue(prw1->expert()->GetPrimaryWeight(101,2002,1.5),2.3333); - testValue(prw1->expert()->GetPrimaryWeight(101,2002,2.5),0.6666); - testValue(prw1->expert()->GetPrimaryWeight(101,2002,3.5),0); - - //test the random run number and lumiblock number generating - int num1(0); int lnum1(0); - for(int i=0;i<1000000;i++) { - if(prw1->expert()->GetRandomRunNumber(100)==1) { //returns 1 or 2 in this test case .. should give 1 about 15/18ths of the time - num1++; - if(prw1->expert()->GetRandomLumiBlockNumber(1)==1) lnum1++; - } - } - std::cout << "prw1 fraction of run1 = " << float(num1)/1000000 << " (expected=0.833333) " << " fraction of these with lbn1 = " << float(lnum1)/num1 << " (expected=0.333333) " << std::endl; - testValue(float(num1)/1000000,0.8333333); - testValue(float(lnum1)/num1,0.333333); - - //test the DataWeights functionality .. first test the IntegratedLumi ... - std::cout << "prw1 TriggerA lumi = " << prw1->expert()->GetIntegratedLumi("TriggerA") << " (expected=9.58333e-6) " << std::endl; testValue(prw1->expert()->GetIntegratedLumi("TriggerA"),9.58333e-6); - std::cout << "prw1 TriggerB lumi = " << prw1->expert()->GetIntegratedLumi("TriggerB") << " (expected=4.79166e-6) " << std::endl; testValue(prw1->expert()->GetIntegratedLumi("TriggerB"),4.79166e-6); - std::cout << "prw1 TriggerA&&TriggerB lumi = " << prw1->expert()->GetIntegratedLumi("TriggerA&&TriggerB") << " (expected=1.81597e-6) " << std::endl;testValue(prw1->expert()->GetIntegratedLumi("TriggerA&&TriggerB"),1.81597e-6); - - //now check the dataweight .. remember the runNumber is converted into a periodNumber (i.e. the weights aren't unique to a runNumber, they are unique to the periodNumber) - std::cout << "prw1 TriggerA DataWeights (mu independent): " << prw1->expert()->GetDataWeight(1,"TriggerA") << " (expected=2.63415) " << prw1->expert()->GetDataWeight(2,"TriggerA") << " (expected=2.63415) " << prw1->expert()->GetDataWeight(3,"TriggerA") << " (expected=3.2727)" << std::endl; - std::cout << "prw1 TriggerA DataWeights (mu dependent): " << prw1->expert()->GetDataWeight(1,"TriggerA",0.5) << " (expected=2) " << prw1->expert()->GetDataWeight(1,"TriggerA",1.5) << " (expected=3) " << prw1->expert()->GetDataWeight(2,"TriggerA",1.5) << " (expected=3.0000) " << prw1->expert()->GetDataWeight(3,"TriggerA",1.5) << " (expected=4) " << prw1->expert()->GetDataWeight(3,"TriggerA",2.5) << " (expected=2) " << std::endl; - - try { - prw1->expert()->GetDataWeight(3,"TriggerA",3.5); - } catch(...) { - std::cout << "correctly threw exception for out of range mu" << std::endl; - } - - testValue(prw1->expert()->GetDataWeight(1,"TriggerA"),2.63415); - testValue(prw1->expert()->GetDataWeight(2,"TriggerA"),2.63415); - testValue(prw1->expert()->GetDataWeight(3,"TriggerA"),3.2727); - testValue(prw1->expert()->GetDataWeight(1,"TriggerA",0.5),2.); - testValue(prw1->expert()->GetDataWeight(2,"TriggerA",1.5),3.); - testValue(prw1->expert()->GetDataWeight(3,"TriggerA",1.5),4); - testValue(prw1->expert()->GetDataWeight(3,"TriggerA",2.5),2); - //testValue(prw1->expert()->GetDataWeight(3,"TriggerA",3.5),nan); - - - //CP::TPileupReweighting t; - - //t.AddLumiCalcFile("/usera/will/testareas/ZZ8TeV/ZZAnalysis/share/GRL_v61.None.lumicalc.root"); - - - - - return 0; -} diff --git a/PhysicsAnalysis/D3PDMaker/ForwardDetectorsD3PDMaker/src/ZdcDigitsFillerTool.cxx b/PhysicsAnalysis/D3PDMaker/ForwardDetectorsD3PDMaker/src/ZdcDigitsFillerTool.cxx index 6663e3e52c03faed9a891d566b250ed49a914a92..0e6d0320879f7b3151870420f4b6888d395b8dba 100644 --- a/PhysicsAnalysis/D3PDMaker/ForwardDetectorsD3PDMaker/src/ZdcDigitsFillerTool.cxx +++ b/PhysicsAnalysis/D3PDMaker/ForwardDetectorsD3PDMaker/src/ZdcDigitsFillerTool.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ // $Id: ZdcDigitsFillerTool.cxx 524378 2012-11-04 10:06:03Z ssnyder $ @@ -55,9 +55,6 @@ namespace D3PD { */ CHECK( detStore()->retrieve( m_zdcID ) ); - // Initialize the singleton: - ZdcCablingService::getInstance()->setZdcID( m_zdcID ); - ATH_MSG_INFO( "ZdcDigitsFillerTool---> Initialized" ); return StatusCode::SUCCESS; diff --git a/PhysicsAnalysis/D3PDMaker/ForwardDetectorsD3PDMaker/src/ZdcFillerTool.cxx b/PhysicsAnalysis/D3PDMaker/ForwardDetectorsD3PDMaker/src/ZdcFillerTool.cxx index e054c088648bb210d21a0e9d908eb73041673b8b..763322fa5365a0927d90b080a3f3e416cecc7620 100644 --- a/PhysicsAnalysis/D3PDMaker/ForwardDetectorsD3PDMaker/src/ZdcFillerTool.cxx +++ b/PhysicsAnalysis/D3PDMaker/ForwardDetectorsD3PDMaker/src/ZdcFillerTool.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ // $Id: ZdcFillerTool.cxx 524378 2012-11-04 10:06:03Z ssnyder $ @@ -60,9 +60,6 @@ namespace D3PD { */ CHECK( detStore()->retrieve( m_zdcID ) ); - // Configure the singleton: - ZdcCablingService::getInstance()->setZdcID( m_zdcID ); - //Prepare the calibration objects fillCalibrationConstants(); diff --git a/PhysicsAnalysis/D3PDMaker/ForwardDetectorsD3PDMaker/src/ZdcRecoFillerTool.cxx b/PhysicsAnalysis/D3PDMaker/ForwardDetectorsD3PDMaker/src/ZdcRecoFillerTool.cxx index 8fc8076b1e18ed5e5d3d9b21ed62fa55d2a2a855..e579d8bc4f3c99ab1ccfe38b010ddfc888290935 100644 --- a/PhysicsAnalysis/D3PDMaker/ForwardDetectorsD3PDMaker/src/ZdcRecoFillerTool.cxx +++ b/PhysicsAnalysis/D3PDMaker/ForwardDetectorsD3PDMaker/src/ZdcRecoFillerTool.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ // $Id: ZdcRecoFillerTool.cxx 538890 2013-02-25 04:49:38Z leite $ @@ -61,9 +61,6 @@ namespace D3PD { //Get mapping from detector store CHECK( detStore()->retrieve( m_zdcID ) ); - // Configure the singleton: - ZdcCablingService::getInstance()->setZdcID( m_zdcID ); - //Prepare the calibration objects fillCalibrationConstants(); diff --git a/PhysicsAnalysis/DerivationFramework/DerivationFrameworkCore/python/CompulsoryContent.py b/PhysicsAnalysis/DerivationFramework/DerivationFrameworkCore/python/CompulsoryContent.py index cea6c9fca0bf35e313ba4bc3b6f6c91f05945097..ef0be61df36e91462828a66e215244437f35b355 100644 --- a/PhysicsAnalysis/DerivationFramework/DerivationFrameworkCore/python/CompulsoryContent.py +++ b/PhysicsAnalysis/DerivationFramework/DerivationFrameworkCore/python/CompulsoryContent.py @@ -11,4 +11,7 @@ CompulsoryContent = [ CompulsoryTriggerNavigation = [ 'xAOD::TrigNavigation#*', 'xAOD::TrigNavigationAuxInfo#*', +# Run 3 navigation: +'xAOD::TrigCompositeContainer#HLTNav*', +'xAOD::TrigCompositeAuxContainer#HLTNav*' ] diff --git a/PhysicsAnalysis/DerivationFramework/DerivationFrameworkCore/python/DerivationFrameworkProdFlags.py b/PhysicsAnalysis/DerivationFramework/DerivationFrameworkCore/python/DerivationFrameworkProdFlags.py index 06e568d75917a54708321e155ca08d79d8f55f59..9ca72cb748a521400fdf4fcb27cd13a8b0e3fcd5 100644 --- a/PhysicsAnalysis/DerivationFramework/DerivationFrameworkCore/python/DerivationFrameworkProdFlags.py +++ b/PhysicsAnalysis/DerivationFramework/DerivationFrameworkCore/python/DerivationFrameworkProdFlags.py @@ -92,7 +92,7 @@ class WriteDAOD_TRIGStream(JobProperty): StreamName = "StreamDAOD_TRIG" FileName = "" isVirtual = False - DPDMakerScript = "DerivationFrameworkExamples/TRIG.py" + DPDMakerScript = "DerivationFrameworkTrigger/TRIG.py" pass jobproperties.DerivationFrameworkProdFlags.add_JobProperty(WriteDAOD_TRIGStream) listAODtoDPD.append(WriteDAOD_TRIGStream.StreamName) diff --git a/PhysicsAnalysis/DerivationFramework/DerivationFrameworkCore/python/JetTauEtMissTriggerContent.py b/PhysicsAnalysis/DerivationFramework/DerivationFrameworkCore/python/JetTauEtMissTriggerContent.py index fa4564cb277ddc95f8f27296de20ff2caa72d97a..54a2c67b2b4d5de387422db6f2e35187035f34d3 100644 --- a/PhysicsAnalysis/DerivationFramework/DerivationFrameworkCore/python/JetTauEtMissTriggerContent.py +++ b/PhysicsAnalysis/DerivationFramework/DerivationFrameworkCore/python/JetTauEtMissTriggerContent.py @@ -14,5 +14,10 @@ JetTauEtMissTriggerContent = [ 'xAOD::JetContainer#HLT_xAOD__JetContainer_SplitJet', 'xAOD::JetTrigAuxContainer#HLT_xAOD__JetContainer_SplitJetAux.', 'xAOD::TauJetContainer#HLT_xAOD__TauJetContainer_TrigTauRecMerged', -'xAOD::TauJetAuxContainer#HLT_xAOD__TauJetContainer_TrigTauRecMergedAux.' +'xAOD::TauJetAuxContainer#HLT_xAOD__TauJetContainer_TrigTauRecMergedAux.', +# Run 3 collections +'xAOD::JetContainer#HLT_bJets', +'xAOD::JetAuxContainer#HLT_bJetsAux.btaggingLink', +'xAOD::BTaggingContainer#HLT_BTagging', +'xAOD::BTaggingAuxContainer#HLT_BTaggingAux.' ] diff --git a/PhysicsAnalysis/DerivationFramework/DerivationFrameworkPhys/share/PHYS.py b/PhysicsAnalysis/DerivationFramework/DerivationFrameworkPhys/share/PHYS.py index 2b68f07cc31679c15d15a96211f4f0505145d216..0e35be7ce88393740fc086d1928d17bc3f083faf 100644 --- a/PhysicsAnalysis/DerivationFramework/DerivationFrameworkPhys/share/PHYS.py +++ b/PhysicsAnalysis/DerivationFramework/DerivationFrameworkPhys/share/PHYS.py @@ -8,14 +8,14 @@ # It requires the reductionConf flag PHYS in Reco_tf.py #==================================================================== -from DerivationFrameworkCore.DerivationFrameworkMaster import * -from DerivationFrameworkInDet.InDetCommon import * -from DerivationFrameworkJetEtMiss.JetCommon import * -from DerivationFrameworkJetEtMiss.ExtendedJetCommon import * -from DerivationFrameworkJetEtMiss.METCommon import * -from DerivationFrameworkEGamma.EGammaCommon import * -from DerivationFrameworkEGamma.ElectronsCPDetailedContent import * -from DerivationFrameworkMuons.MuonsCommon import * +from DerivationFrameworkCore.DerivationFrameworkMaster import buildFileName, DerivationFrameworkIsMonteCarlo, DerivationFrameworkJob +from DerivationFrameworkInDet import InDetCommon +from DerivationFrameworkJetEtMiss.JetCommon import OutputJets +from DerivationFrameworkJetEtMiss.ExtendedJetCommon import replaceAODReducedJets, addDefaultTrimmedJets, addJetTruthLabel, addQGTaggerTool +from DerivationFrameworkJetEtMiss import METCommon +from DerivationFrameworkEGamma import EGammaCommon +from DerivationFrameworkEGamma import ElectronsCPDetailedContent +from DerivationFrameworkMuons import MuonsCommon from TriggerMenu.api.TriggerAPI import TriggerAPI from TriggerMenu.api.TriggerEnums import TriggerPeriod, TriggerType @@ -68,7 +68,7 @@ if (DerivationFrameworkIsMonteCarlo): # SUSY signal from DerivationFrameworkSUSY.DecorateSUSYProcess import IsSUSYSignal if IsSUSYSignal(): - from DerivationFrameworkSUSY.SUSYWeightMetadata import * + from DerivationFrameworkSUSY import SUSYWeightMetadata # Add sumOfWeights metadata for LHE3 multiweights ======= #from DerivationFrameworkCore.LHE3WeightMetadata import * diff --git a/PhysicsAnalysis/DerivationFramework/DerivationFrameworkTrigger/share/TRIG.py b/PhysicsAnalysis/DerivationFramework/DerivationFrameworkTrigger/share/TRIG.py new file mode 100644 index 0000000000000000000000000000000000000000..027573b26ecc8206be9c4b251fbd3a44b32d5559 --- /dev/null +++ b/PhysicsAnalysis/DerivationFramework/DerivationFrameworkTrigger/share/TRIG.py @@ -0,0 +1,355 @@ +# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration + +#==================================================================== +# DAOD_TRIG.py +# This defines DAOD_TRIG, a (skimmed) DAOD format for Run 3 trigger studies. +# It is supposed to contain sufficiently complete trigger information for understanding +# and developing trigger. +# It requires the reductionConf flag TRIG in Reco_tf.py +#==================================================================== + +from DerivationFrameworkCore.DerivationFrameworkMaster import buildFileName, DerivationFrameworkIsMonteCarlo, DerivationFrameworkJob +from DerivationFrameworkInDet import InDetCommon +from DerivationFrameworkJetEtMiss.JetCommon import OutputJets +from DerivationFrameworkJetEtMiss.ExtendedJetCommon import replaceAODReducedJets, addDefaultTrimmedJets, addJetTruthLabel, addQGTaggerTool +from DerivationFrameworkJetEtMiss import METCommon +from DerivationFrameworkEGamma import EGammaCommon +from DerivationFrameworkEGamma import ElectronsCPDetailedContent +from DerivationFrameworkMuons import MuonsCommon +from TriggerMenu.api.TriggerAPI import TriggerAPI +from TriggerMenu.api.TriggerEnums import TriggerPeriod, TriggerType + +#==================================================================== +# SET UP STREAM +#==================================================================== +streamName = derivationFlags.WriteDAOD_TRIGStream.StreamName +fileName = buildFileName( derivationFlags.WriteDAOD_TRIGStream ) +TRIGStream = MSMgr.NewPoolRootStream( streamName, fileName ) +TRIGStream.AcceptAlgs(["TRIGKernel"]) + +### Thinning and augmentation tools lists +thinningTools = [] +AugmentationTools = [] + +# Special sequence +SeqTRIG = CfgMgr.AthSequencer("SeqTRIG") + +#==================================================================== +# MONTE CARLO TRUTH +#==================================================================== +if (DerivationFrameworkIsMonteCarlo): + from DerivationFrameworkMCTruth.MCTruthCommon import addStandardTruthContents,addMiniTruthCollectionLinks,addHFAndDownstreamParticles,addPVCollection + #import DerivationFrameworkHiggs.TruthCategories + # Add charm quark collection + from DerivationFrameworkMCTruth.DerivationFrameworkMCTruthConf import DerivationFramework__TruthCollectionMaker + TRIGTruthCharmTool = DerivationFramework__TruthCollectionMaker(name = "TRIGTruthCharmTool", + NewCollectionName = "TruthCharm", + KeepNavigationInfo = False, + ParticleSelectionString = "(abs(TruthParticles.pdgId) == 4)", + Do_Compress = True) + ToolSvc += TRIGTruthCharmTool + #from DerivationFrameworkCore.DerivationFrameworkCoreConf import DerivationFramework__CommonAugmentation + SeqTRIG += CfgMgr.DerivationFramework__CommonAugmentation("TRIGTruthCharmKernel",AugmentationTools=[TRIGTruthCharmTool]) + # Add HF particles + addHFAndDownstreamParticles(SeqTRIG) + # Add standard truth + addStandardTruthContents(SeqTRIG,prefix='TRIG_') + # Update to include charm quarks and HF particles - require a separate instance to be train safe + from DerivationFrameworkMCTruth.DerivationFrameworkMCTruthConf import DerivationFramework__TruthNavigationDecorator + TRIGTruthNavigationDecorator = DerivationFramework__TruthNavigationDecorator( name="TRIGTruthNavigationDecorator", + InputCollections=["TruthElectrons", "TruthMuons", "TruthPhotons", "TruthTaus", "TruthNeutrinos", "TruthBSM", "TruthBottom", "TruthTop", "TruthBoson","TruthCharm","TruthHFWithDecayParticles"]) + ToolSvc += TRIGTruthNavigationDecorator + SeqTRIG.TRIG_MCTruthNavigationDecoratorKernel.AugmentationTools = [TRIGTruthNavigationDecorator] + # Re-point links on reco objects + addMiniTruthCollectionLinks(SeqTRIG) + addPVCollection(SeqTRIG) + # Set appropriate truth jet collection for tau truth matching + ToolSvc.DFCommonTauTruthMatchingTool.TruthJetContainerName = "AntiKt4TruthDressedWZJets" + # SUSY signal + from DerivationFrameworkSUSY.DecorateSUSYProcess import IsSUSYSignal + if IsSUSYSignal(): + from DerivationFrameworkSUSY import SUSYWeightMetadata + # Add sumOfWeights metadata for LHE3 multiweights ======= + #from DerivationFrameworkCore.LHE3WeightMetadata import * + + + +#==================================================================== +# TRIGGER CONTENT +#==================================================================== +## Lines commented out temporarily 29th July 2020 to allow validation to proceed. Will need a new MR to fix. +## See https://twiki.cern.ch/twiki/bin/view/Atlas/TriggerAPI +## Get single and multi mu, e, photon triggers +## Jet, tau, multi-object triggers not available in the matching code +#allperiods = TriggerPeriod.y2015 | TriggerPeriod.y2016 | TriggerPeriod.y2017 | TriggerPeriod.y2018 | TriggerPeriod.future2e34 +#trig_el = TriggerAPI.getLowestUnprescaledAnyPeriod(allperiods, triggerType=TriggerType.el, livefraction=0.8) +#trig_mu = TriggerAPI.getLowestUnprescaledAnyPeriod(allperiods, triggerType=TriggerType.mu, livefraction=0.8) +#trig_g = TriggerAPI.getLowestUnprescaledAnyPeriod(allperiods, triggerType=TriggerType.g, livefraction=0.8) +#trig_tau = TriggerAPI.getLowestUnprescaledAnyPeriod(allperiods, triggerType=TriggerType.tau, livefraction=0.8) +## Add cross-triggers for some sets +#trig_em = TriggerAPI.getLowestUnprescaledAnyPeriod(allperiods, triggerType=TriggerType.el, additionalTriggerType=TriggerType.mu, livefraction=0.8) +#trig_et = TriggerAPI.getLowestUnprescaledAnyPeriod(allperiods, triggerType=TriggerType.el, additionalTriggerType=TriggerType.tau, livefraction=0.8) +#trig_mt = TriggerAPI.getLowestUnprescaledAnyPeriod(allperiods, triggerType=TriggerType.mu, additionalTriggerType=TriggerType.tau, livefraction=0.8) +## Note that this seems to pick up both isolated and non-isolated triggers already, so no need for extra grabs +#trig_txe = TriggerAPI.getLowestUnprescaledAnyPeriod(allperiods, triggerType=TriggerType.tau, additionalTriggerType=TriggerType.xe, livefraction=0.8) +# +## Merge and remove duplicates +#trigger_names_full_notau = list(set(trig_el+trig_mu+trig_g+trig_em+trig_et+trig_mt)) +#trigger_names_full_tau = list(set(trig_tau+trig_txe)) +# +## Now reduce the list... +#from RecExConfig.InputFilePeeker import inputFileSummary +#trigger_names_notau = [] +#trigger_names_tau = [] +#for trig_item in inputFileSummary['metadata']['/TRIGGER/HLT/Menu']: +# if not 'ChainName' in trig_item: continue +# if trig_item['ChainName'] in trigger_names_full_notau: trigger_names_notau += [ trig_item['ChainName'] ] +# if trig_item['ChainName'] in trigger_names_full_tau: trigger_names_tau += [ trig_item['ChainName'] ] + + +#==================================================================== +# INNER DETECTOR TRACK THINNING +#==================================================================== +# See recommedations here: +# https://twiki.cern.ch/twiki/bin/viewauth/AtlasProtected/DaodRecommendations + +# Inner detector group recommendations for indet tracks in analysis +TRIG_thinning_expression = "InDetTrackParticles.DFCommonTightPrimary && abs(DFCommonInDetTrackZ0AtPV)*sin(InDetTrackParticles.theta) < 3.0*mm && InDetTrackParticles.pt > 10*GeV" +from DerivationFrameworkInDet.DerivationFrameworkInDetConf import DerivationFramework__TrackParticleThinning +TRIGTrackParticleThinningTool = DerivationFramework__TrackParticleThinning(name = "TRIGTrackParticleThinningTool", + StreamName = TRIGStream.Name, + SelectionString = TRIG_thinning_expression, + InDetTrackParticlesKey = "InDetTrackParticles") + +ToolSvc += TRIGTrackParticleThinningTool +thinningTools.append(TRIGTrackParticleThinningTool) + +# Include inner detector tracks associated with muons +from DerivationFrameworkInDet.DerivationFrameworkInDetConf import DerivationFramework__MuonTrackParticleThinning +TRIGMuonTPThinningTool = DerivationFramework__MuonTrackParticleThinning(name = "TRIGMuonTPThinningTool", + StreamName = TRIGStream.Name, + MuonKey = "Muons", + InDetTrackParticlesKey = "InDetTrackParticles") + +ToolSvc += TRIGMuonTPThinningTool +thinningTools.append(TRIGMuonTPThinningTool) + +# TauJets thinning +tau_thinning_expression = "(TauJets.ptFinalCalib >= 13.*GeV) && (TauJets.nTracks>=1) && (TauJets.nTracks<=3) && (TauJets.RNNJetScoreSigTrans>0.01)" +from DerivationFrameworkTools.DerivationFrameworkToolsConf import DerivationFramework__GenericObjectThinning +TRIGTauJetsThinningTool = DerivationFramework__GenericObjectThinning(name = "TRIGTauJetsThinningTool", + StreamName = TRIGStream.Name, + ContainerName = "TauJets", + SelectionString = tau_thinning_expression) +ToolSvc += TRIGTauJetsThinningTool +thinningTools.append(TRIGTauJetsThinningTool) + +# Only keep tau tracks (and associated ID tracks) classified as charged tracks +from DerivationFrameworkInDet.DerivationFrameworkInDetConf import DerivationFramework__TauTrackParticleThinning +TRIGTauTPThinningTool = DerivationFramework__TauTrackParticleThinning(name = "TRIGTauTPThinningTool", + StreamName = TRIGStream.Name, + TauKey = "TauJets", + InDetTrackParticlesKey = "InDetTrackParticles", + SelectionString = tau_thinning_expression, + DoTauTracksThinning = True, + TauTracksKey = "TauTracks") +ToolSvc += TRIGTauTPThinningTool +thinningTools.append(TRIGTauTPThinningTool) + +# ID tracks associated with high-pt di-tau +from DerivationFrameworkInDet.DerivationFrameworkInDetConf import DerivationFramework__DiTauTrackParticleThinning +TRIGDiTauTPThinningTool = DerivationFramework__DiTauTrackParticleThinning(name = "TRIGDiTauTPThinningTool", + StreamName = TRIGStream.Name, + DiTauKey = "DiTauJets", + InDetTrackParticlesKey = "InDetTrackParticles") +ToolSvc += TRIGDiTauTPThinningTool +thinningTools.append(TRIGDiTauTPThinningTool) + +#==================================================================== +# JET/MET +#==================================================================== + +OutputJets["TRIG"] = ["AntiKt10LCTopoTrimmedPtFrac5SmallR20Jets"] +reducedJetList = ["AntiKt2PV0TrackJets","AntiKt4PV0TrackJets"] + +if (DerivationFrameworkIsMonteCarlo): + OutputJets["TRIG"].append("AntiKt10TruthTrimmedPtFrac5SmallR20Jets") + +replaceAODReducedJets(reducedJetList,SeqTRIG,"TRIG") +add_largeR_truth_jets = DerivationFrameworkIsMonteCarlo and not hasattr(SeqTRIG,'jetalgAntiKt10TruthTrimmedPtFrac5SmallR20') +addDefaultTrimmedJets(SeqTRIG,"TRIG",dotruth=add_largeR_truth_jets) + +# Add large-R jet truth labeling +if (DerivationFrameworkIsMonteCarlo): + addJetTruthLabel(jetalg="AntiKt10LCTopoTrimmedPtFrac5SmallR20",sequence=SeqTRIG,algname="JetTruthLabelingAlg",labelname="R10TruthLabel_R21Consolidated") + +addQGTaggerTool(jetalg="AntiKt4EMTopo",sequence=SeqTRIG,algname="QGTaggerToolAlg") +addQGTaggerTool(jetalg="AntiKt4EMPFlow",sequence=SeqTRIG,algname="QGTaggerToolPFAlg") + +# fJVT +# getPFlowfJVT(jetalg='AntiKt4EMPFlow',sequence=SeqTRIG, algname='TRIGJetForwardPFlowJvtToolAlg') + +#==================================================================== +# EGAMMA +#==================================================================== + +if DerivationFrameworkIsMonteCarlo: + # Schedule the two energy density tools for running after the pseudojets are created. + for alg in ['EDTruthCentralAlg', 'EDTruthForwardAlg']: + if hasattr(topSequence, alg): + edtalg = getattr(topSequence, alg) + delattr(topSequence, alg) + SeqTRIG += edtalg + +#==================================================================== +# Add our sequence to the top sequence +#==================================================================== +# Ideally, this should come at the end of the job +DerivationFrameworkJob += SeqTRIG + +#==================================================================== +# Tau +#==================================================================== +# Add low-pt di-tau reconstruction +from DerivationFrameworkTau.TauCommon import addDiTauLowPt +addDiTauLowPt(Seq=SeqTRIG) + +# Low-pt di-tau thinning +from DerivationFrameworkTools.DerivationFrameworkToolsConf import DerivationFramework__GenericObjectThinning +TRIGDiTauLowPtThinningTool = DerivationFramework__GenericObjectThinning(name = "TRIGDiTauLowPtThinningTool", + StreamName = TRIGStream.Name, + ContainerName = "DiTauJetsLowPt", + SelectionString = "DiTauJetsLowPt.nSubjets > 1") +ToolSvc += TRIGDiTauLowPtThinningTool +thinningTools.append(TRIGDiTauLowPtThinningTool) + +# ID tracks associated with low-pt ditau +TRIGDiTauLowPtTPThinningTool = DerivationFramework__DiTauTrackParticleThinning(name = "TRIGDiTauLowPtTPThinningTool", + StreamName = TRIGStream.Name, + DiTauKey = "DiTauJetsLowPt", + InDetTrackParticlesKey = "InDetTrackParticles", + SelectionString = "DiTauJetsLowPt.nSubjets > 1") +ToolSvc += TRIGDiTauLowPtTPThinningTool +thinningTools.append(TRIGDiTauLowPtTPThinningTool) + +#==================================================================== +# CREATE THE DERIVATION KERNEL ALGORITHM +#==================================================================== +# Add the kernel for thinning (requires the objects be defined) +#from DerivationFrameworkCore.DerivationFrameworkCoreConf import DerivationFramework__DerivationKernel +SeqTRIG += CfgMgr.DerivationFramework__DerivationKernel("TRIGKernel", + ThinningTools = thinningTools) + + +#==================================================================== +# FLAVOUR TAGGING +#==================================================================== + +from DerivationFrameworkFlavourTag.FtagRun3DerivationConfig import FtagJetCollection + +FtagJetCollection('AntiKt4EMPFlowJets',SeqTRIG) + + +#==================================================================== +# TC-LVT Vertices +#==================================================================== + +# from SoftBVrtClusterTool.SoftBVrtConfig import addSoftBVrt +# addSoftBVrt(SeqTRIG,'Loose') +# addSoftBVrt(SeqTRIG,'Medium') +# addSoftBVrt(SeqTRIG,'Tight') + +#==================================================================== +# CONTENTS +#==================================================================== +from DerivationFrameworkCore.SlimmingHelper import SlimmingHelper +TRIGSlimmingHelper = SlimmingHelper("TRIGSlimmingHelper") + +TRIGSlimmingHelper.SmartCollections = ["Electrons", + "Photons", + "Muons", + "PrimaryVertices", + "InDetTrackParticles", + "AntiKt4EMTopoJets", + "AntiKt4EMPFlowJets", + "BTagging_AntiKt4EMPFlow", + #"MET_Baseline_AntiKt4EMTopo", + #"MET_Baseline_AntiKt4EMPFlow", + "TauJets", + "DiTauJets", + "DiTauJetsLowPt", + "AntiKt10LCTopoTrimmedPtFrac5SmallR20Jets", + #"AntiKtVR30Rmax4Rmin02TrackJets_BTagging201903", + #"BTagging_AntiKtVR30Rmax4Rmin02Track_201903" + ] + +excludedVertexAuxData = "-vxTrackAtVertex.-MvfFitInfo.-isInitialized.-VTAV" +StaticContent = [] +StaticContent += ["xAOD::VertexContainer#SoftBVrtClusterTool_Tight_Vertices"] +StaticContent += ["xAOD::VertexAuxContainer#SoftBVrtClusterTool_Tight_VerticesAux." + excludedVertexAuxData] +StaticContent += ["xAOD::VertexContainer#SoftBVrtClusterTool_Medium_Vertices"] +StaticContent += ["xAOD::VertexAuxContainer#SoftBVrtClusterTool_Medium_VerticesAux." + excludedVertexAuxData] +StaticContent += ["xAOD::VertexContainer#SoftBVrtClusterTool_Loose_Vertices"] +StaticContent += ["xAOD::VertexAuxContainer#SoftBVrtClusterTool_Loose_VerticesAux." + excludedVertexAuxData] + +TRIGSlimmingHelper.StaticContent = StaticContent + +# Trigger content +TRIGSlimmingHelper.IncludeTriggerNavigation = True +TRIGSlimmingHelper.IncludeJetTriggerContent = True +TRIGSlimmingHelper.IncludeMuonTriggerContent = True +TRIGSlimmingHelper.IncludeEGammaTriggerContent = True +TRIGSlimmingHelper.IncludeJetTauEtMissTriggerContent = True +TRIGSlimmingHelper.IncludeTauTriggerContent = True +TRIGSlimmingHelper.IncludeEtMissTriggerContent = True +TRIGSlimmingHelper.IncludeBJetTriggerContent = True +TRIGSlimmingHelper.IncludeBPhysTriggerContent = True +TRIGSlimmingHelper.IncludeMinBiasTriggerContent = True + +# Add the jet containers to the stream (defined in JetCommon if import needed) +#addJetOutputs(TRIGSlimmingHelper,["TRIG"]) + +# Truth containers +if DerivationFrameworkIsMonteCarlo: + TRIGSlimmingHelper.AppendToDictionary = {'TruthEvents':'xAOD::TruthEventContainer','TruthEventsAux':'xAOD::TruthEventAuxContainer', + 'MET_Truth':'xAOD::MissingETContainer','MET_TruthAux':'xAOD::MissingETAuxContainer', + 'TruthElectrons':'xAOD::TruthParticleContainer','TruthElectronsAux':'xAOD::TruthParticleAuxContainer', + 'TruthMuons':'xAOD::TruthParticleContainer','TruthMuonsAux':'xAOD::TruthParticleAuxContainer', + 'TruthPhotons':'xAOD::TruthParticleContainer','TruthPhotonsAux':'xAOD::TruthParticleAuxContainer', + 'TruthTaus':'xAOD::TruthParticleContainer','TruthTausAux':'xAOD::TruthParticleAuxContainer', + 'TruthNeutrinos':'xAOD::TruthParticleContainer','TruthNeutrinosAux':'xAOD::TruthParticleAuxContainer', + 'TruthBSM':'xAOD::TruthParticleContainer','TruthBSMAux':'xAOD::TruthParticleAuxContainer', + 'TruthBoson':'xAOD::TruthParticleContainer','TruthBosonAux':'xAOD::TruthParticleAuxContainer', + 'TruthTop':'xAOD::TruthParticleContainer','TruthTopAux':'xAOD::TruthParticleAuxContainer', + 'TruthForwardProtons':'xAOD::TruthParticleContainer','TruthForwardProtonsAux':'xAOD::TruthParticleAuxContainer', + 'BornLeptons':'xAOD::TruthParticleContainer','BornLeptonsAux':'xAOD::TruthParticleAuxContainer', + 'TruthBosonsWithDecayParticles':'xAOD::TruthParticleContainer','TruthBosonsWithDecayParticlesAux':'xAOD::TruthParticleAuxContainer', + 'TruthBosonsWithDecayVertices':'xAOD::TruthVertexContainer','TruthBosonsWithDecayVerticesAux':'xAOD::TruthVertexAuxContainer', + 'TruthBSMWithDecayParticles':'xAOD::TruthParticleContainer','TruthBSMWithDecayParticlesAux':'xAOD::TruthParticleAuxContainer', + 'TruthBSMWithDecayVertices':'xAOD::TruthVertexContainer','TruthBSMWithDecayVerticesAux':'xAOD::TruthVertexAuxContainer', + 'HardScatterParticles':'xAOD::TruthParticleContainer','HardScatterParticlesAux':'xAOD::TruthParticleAuxContainer', + 'HardScatterVertices':'xAOD::TruthVertexContainer','HardScatterVerticesAux':'xAOD::TruthVertexAuxContainer', + 'TruthHFWithDecayParticles':'xAOD::TruthParticleContainer','TruthHFWithDecayParticlesAux':'xAOD::TruthParticleAuxContainer', + 'TruthHFWithDecayVertices':'xAOD::TruthVertexContainer','TruthHFWithDecayVerticesAux':'xAOD::TruthVertexAuxContainer', + 'TruthCharm':'xAOD::TruthParticleContainer','TruthCharmAux':'xAOD::TruthParticleAuxContainer', + 'TruthPrimaryVertices':'xAOD::TruthVertexContainer','TruthPrimaryVerticesAux':'xAOD::TruthVertexAuxContainer', + 'AntiKt10TruthTrimmedPtFrac5SmallR20Jets':'xAOD::JetContainer', 'AntiKt10TruthTrimmedPtFrac5SmallR20JetsAux':'xAOD::JetAuxContainer' + } + + from DerivationFrameworkMCTruth.MCTruthCommon import addTruth3ContentToSlimmerTool + addTruth3ContentToSlimmerTool(TRIGSlimmingHelper) + TRIGSlimmingHelper.AllVariables += ['TruthHFWithDecayParticles','TruthHFWithDecayVertices','TruthCharm'] + +TRIGSlimmingHelper.ExtraVariables += ["AntiKt10TruthTrimmedPtFrac5SmallR20Jets.Tau1_wta.Tau2_wta.Tau3_wta.D2.GhostBHadronsFinalCount", + "Electrons.TruthLink", + "Muons.TruthLink", + "Photons.TruthLink", + "AntiKt2PV0TrackJets.pt.eta.phi.m", + "AntiKt4EMTopoJets.DFCommonJets_QGTagger_truthjet_nCharged.DFCommonJets_QGTagger_truthjet_pt.DFCommonJets_QGTagger_truthjet_eta.DFCommonJets_QGTagger_NTracks.DFCommonJets_QGTagger_TracksWidth.DFCommonJets_QGTagger_TracksC1.PartonTruthLabelID", + "AntiKt4EMPFlowJets.DFCommonJets_QGTagger_truthjet_nCharged.DFCommonJets_QGTagger_truthjet_pt.DFCommonJets_QGTagger_truthjet_eta.DFCommonJets_QGTagger_NTracks.DFCommonJets_QGTagger_TracksWidth.DFCommonJets_QGTagger_TracksC1.PartonTruthLabelID.DFCommonJets_fJvt", + "TruthPrimaryVertices.t.x.y.z"] + + +# Final construction of output stream +TRIGSlimmingHelper.AppendContentToStream(TRIGStream) + diff --git a/PhysicsAnalysis/ElectronPhotonID/PhotonVertexSelection/CMakeLists.txt b/PhysicsAnalysis/ElectronPhotonID/PhotonVertexSelection/CMakeLists.txt index 360ebdf48ab3eec5e45faa897c5374c657bff6ec..03a6d01115cce93170b3bea1bcaba06718243287 100644 --- a/PhysicsAnalysis/ElectronPhotonID/PhotonVertexSelection/CMakeLists.txt +++ b/PhysicsAnalysis/ElectronPhotonID/PhotonVertexSelection/CMakeLists.txt @@ -1,29 +1,8 @@ -################################################################################ -# Package: PhotonVertexSelection -################################################################################ +# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration # Declare the package name: atlas_subdir( PhotonVertexSelection ) -# Extra dependencies, based on the build environment: -set( extra_deps ) -if( NOT XAOD_STANDALONE ) - set( extra_deps Control/AthenaBaseComps GaudiKernel ) -endif() - -# Declare the package's dependencies: -atlas_depends_on_subdirs( - PUBLIC - Control/AthToolSupport/AsgTools - Event/xAOD/xAODEgamma - Event/xAOD/xAODEventInfo - Event/xAOD/xAODTracking - PRIVATE - Control/AthContainers - PhysicsAnalysis/ElectronPhotonID/IsolationCorrections - Tools/PathResolver - ${extra_deps} ) - # External dependencies: find_package( ROOT COMPONENTS Core Hist RIO Physics TMVA ) @@ -49,10 +28,5 @@ atlas_add_dictionary( PhotonVertexSelectionDict LINK_LIBRARIES PhotonVertexSelectionLib ) # Test(s) in the package: -if( XAOD_STANDALONE ) - # FIX ME: temporarily disabled as part of the migration of - # AnalysisBase to master - - # atlas_add_test( PhotonVertexSelection_test - # SCRIPT test/testPhotonVertexSelection.py ) -endif() +atlas_add_test( PhotonVertexSelection_test + SCRIPT test/testPhotonVertexSelection.py ) diff --git a/PhysicsAnalysis/ElectronPhotonID/PhotonVertexSelection/test/testPhotonVertexSelection.py b/PhysicsAnalysis/ElectronPhotonID/PhotonVertexSelection/test/testPhotonVertexSelection.py index 7c3478866c7fd4ecb4b8bd4bbeb01b3a86285241..a5fbaa361b4adc07240ed2973560f90853418053 100755 --- a/PhysicsAnalysis/ElectronPhotonID/PhotonVertexSelection/test/testPhotonVertexSelection.py +++ b/PhysicsAnalysis/ElectronPhotonID/PhotonVertexSelection/test/testPhotonVertexSelection.py @@ -21,7 +21,7 @@ def getViewContainer(container): return x.author() not in [xAOD.EgammaParameters.AuthorCaloTopo35, xAOD.EgammaParameters.AuthorFwdElectron] egammas = container.__class__(ROOT.SG.VIEW_ELEMENTS) - for eg in filter(filterAuthor, container)[:2]: + for eg in list(filter(filterAuthor, container))[:2]: egammas.push_back( eg ) return egammas @@ -128,17 +128,10 @@ else: # Initialize the xAOD infrastructure: ROOT.xAOD.Init().ignore() - ROOT.xAOD.TruthParticleContainer() - ROOT.xAOD.MuonRoIContainer() - ROOT.xAOD.CaloClusterContainer() - ROOT.xAOD.TrackParticleContainer() - ROOT.xAOD.ElectronContainer() - ROOT.xAOD.MuonContainer() - ROOT.xAOD.JetContainer() - ROOT.xAOD.TauJetContainer() - ROOT.xAOD.PFOContainer() - ROOT.xAOD.TrigElectronContainer() ROOT.xAOD.L2CombinedMuonContainer() + ROOT.xAOD.TrigElectronContainer() + ROOT.xAOD.MuonContainer() + ROOT.xAOD.ParticleContainer() # Setup the tools vertexTool = ROOT.CP.PhotonVertexSelectionTool("PhotonVertexSelectionTool") @@ -154,7 +147,7 @@ else: sys.exit( 1 ) pass - for entry in xrange(options.nEvents): + for entry in range(options.nEvents): print ('*** Analysing entry %s ***' % entry) _ = t.GetEntry(entry) container = getattr(t, options.container) diff --git a/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/python/BTagSecVertexingConfig.py b/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/python/BTagSecVertexingConfig.py index d5a24bec5980b51ee95dad940462d48666296814..4ead25cf3a3d98fe9dcfe8b1acdbcd342794727d 100644 --- a/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/python/BTagSecVertexingConfig.py +++ b/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/python/BTagSecVertexingConfig.py @@ -2,7 +2,8 @@ from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator from AthenaConfiguration.ComponentFactory import CompFactory -from BTagging.NewJetFitterVxFinderConfig import NewJetFitterVxFinderCfg +#from BTagging.NewJetFitterVxFinderConfig import NewJetFitterVxFinderCfg +from BTagging.InDetImprovedJetFitterVxFinderConfig import InDetImprovedJetFitterVxFinderCfg from BTagging.InDetVKalVxInJetToolConfig import InDetVKalVxInJetToolCfg from JetTagTools.JetFitterVariablesFactoryConfig import JetFitterVariablesFactoryCfg from BTagging.MSVVariablesFactoryConfig import MSVVariablesFactoryCfg @@ -29,7 +30,7 @@ def BTagSecVtxToolCfg(flags, Name, JetCollection, TimeStamp = "", **options): if TimeStamp: TimeStamp = '_' + TimeStamp - newJetFitterVxFinder = acc.popToolsAndMerge(NewJetFitterVxFinderCfg(flags, 'JFVxFinder')) + newJetFitterVxFinder = acc.popToolsAndMerge(InDetImprovedJetFitterVxFinderCfg(flags, 'JFVxFinder')) secVtxFinderList.append(newJetFitterVxFinder) secVtxFinderTrackNameList.append('BTagTrackToJetAssociator') secVtxFinderxAODBaseNameList.append('JetFitter') diff --git a/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/python/BTaggingConfiguration_NewJetFitterCollection.py b/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/python/BTaggingConfiguration_NewJetFitterCollection.py index f74a576c645fd240767972e7b47c4457c1b9ddcf..16d1741f74048150e78d366551cb8d4f1ed0cacc 100644 --- a/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/python/BTaggingConfiguration_NewJetFitterCollection.py +++ b/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/python/BTaggingConfiguration_NewJetFitterCollection.py @@ -167,7 +167,7 @@ def toolVxInternalEdmFactory_SV(name, useBTagFlagsDefaults = True, **options): if useBTagFlagsDefaults: jetFitterFullLinearizedTrackFactory = toolJetFitterFullLinearizedTrackFactory('JetFitterFullLinearizedTrackFactory') defaults = { 'OutputLevel' : BTaggingFlags.OutputLevel, - 'LinearizedTrackFactory' : jetFitterFullLinearizedTrackFactory, } + 'LinearizedTrackFactory' : jetFitterFullLinearizedTrackFactory } for option in defaults: options.setdefault(option, defaults[option]) options['name'] = name @@ -382,110 +382,7 @@ def toolInDetJetFitterUtils_SV(name, useBTagFlagsDefaults = True, **options): #-------------------------------------------------------------------------- -metaNewJetFitterVxFinder = { 'IsAVertexFinder' : True, - 'VertexFinderxAODBaseName' : 'JetFitter', - 'VertexFinderPassByPointer': {'JetFitterVariableFactory' : 'JetFitterVariablesFactory' }, - 'DependsOn' : ['BTagTrackToVertexTool', - 'InDetJetFitterUtils', - 'ImprovedJetFitterRoutines', - 'TrkDistanceFinderNeutralCharged', - 'TrkDistanceFinderNeutralNeutral', - 'ImprovedJetFitterInitializationHelper', - 'JetFitterSequentialVertexFitter', - 'JetFitterSequentialVertexSmoother', - 'JetFitterMode3dTo1dFinder', - 'InDetImprovedJetFitterTrackSelectorTool', - 'JetFitterExtrapolator', - 'JetFitterFullLinearizedTrackFactory', - 'JetFitterVariablesFactory', - 'VxInternalEdmFactory'], - 'PassByPointer' : { 'Mode3dFinder' : 'JetFitterMode3dTo1dFinder', - 'JetFitterInitializationHelper' : 'ImprovedJetFitterInitializationHelper', - 'TrackSelector' : 'InDetImprovedJetFitterTrackSelectorTool', - 'InDetJetFitterUtils' : 'InDetJetFitterUtils', - 'Extrapolator' : 'JetFitterExtrapolator', - 'SequentialVertexFitter' : 'JetFitterSequentialVertexFitter', - 'JetFitterRoutines' : 'ImprovedJetFitterRoutines', - 'VertexEdmFactory' : 'VxInternalEdmFactory' }, - 'ToolCollection' : 'JetFitterCollection' } - -def toolNewJetFitterVxFinder(name, useBTagFlagsDefaults = True, **options): - """Sets up a NewJetFitterVxFinder tool and returns it. - - The following options have BTaggingFlags defaults: - - OutputLevel default: BTaggingFlags.OutputLevel - VxPrimaryContainer default: BTaggingFlags.PrimaryVertexCollectionName - MaxNumDeleteIterations default: 30 - VertexProbCut default: 0.001 - MaxClusteringIterations default: 30 - VertexClusteringProbabilityCut default: 0.005 - - input: name: The name of the tool (should be unique). - useBTagFlagsDefaults : Whether to use BTaggingFlags defaults for options that are not specified. - **options: Python dictionary with options for the tool. - output: The actual tool, which can then by added to ToolSvc via ToolSvc += output.""" - if useBTagFlagsDefaults: - if not 'InDetKeys' in dir(): - from InDetRecExample.InDetKeys import InDetKeys - defaults = { 'OutputLevel' : BTaggingFlags.OutputLevel, - 'VxPrimaryContainer' : BTaggingFlags.PrimaryVertexCollectionName, - 'MaxNumDeleteIterations' : 30, - 'VertexProbCut' : 0.001, - 'MaxClusteringIterations' : 30, - 'VertexClusteringProbabilityCut' : 0.005 } - for option in defaults: - options.setdefault(option, defaults[option]) - options['name'] = name - from InDetSecVxFinderTool.InDetSecVxFinderToolConf import InDet__InDetImprovedJetFitterVxFinder - return InDet__InDetImprovedJetFitterVxFinder(**options) - -def toolNewJetFitterVxFinder_SV(name, suffix = "", useBTagFlagsDefaults = True, **options): - """Sets up a NewJetFitterVxFinder tool and returns it. - - The following options have BTaggingFlags defaults: - OutputLevel default: BTaggingFlags.OutputLevel - VxPrimaryContainer default: BTaggingFlags.PrimaryVertexCollectionName - MaxNumDeleteIterations default: 30 - VertexProbCut default: 0.001 - MaxClusteringIterations default: 30 - VertexClusteringProbabilityCut default: 0.005 - - input: name: The name of the tool (should be unique). - useBTagFlagsDefaults : Whether to use BTaggingFlags defaults for options that are not specified. - **options: Python dictionary with options for the tool. - output: The actual tool, which can then by added to ToolSvc via ToolSvc += output.""" - if useBTagFlagsDefaults: - if not 'InDetKeys' in dir(): - from InDetRecExample.InDetKeys import InDetKeys - inDetJetFitterUtils = toolInDetJetFitterUtils_SV('InDetJFUtils'+suffix) - improvedJetFitterRoutines = toolImprovedJetFitterRoutines('ImprovedJFRoutines'+suffix) - jetFitterMode3dTo1dFinder = toolJetFitterMode3dTo1dFinder('JFMode3dTo1dFinder'+suffix) - inDetImprovedJetFitterTrackSelectorTool = toolInDetImprovedJetFitterTrackSelectorTool('InDetImprovedJFTrackSelTool'+suffix) - jetFitterSequentialVertexFitter = toolJetFitterSequentialVertexFitter_SV('JFSeqVxFitter'+suffix) - jetFitterExtrapolator = toolJetFitterExtrapolator('JFExtrapolator'+suffix) - improvedJetFitterInitializationHelper = toolImprovedJetFitterInitializationHelper('ImprovedJFInitHelper'+suffix) - vertexEdmFactory = toolVxInternalEdmFactory_SV('VxInternalEdmFactory'+suffix) - defaults = { 'OutputLevel' : BTaggingFlags.OutputLevel, - 'VxPrimaryContainer' : BTaggingFlags.PrimaryVertexCollectionName, - 'MaxNumDeleteIterations' : 30, - 'VertexProbCut' : 0.001, - 'MaxClusteringIterations' : 30, - 'VertexClusteringProbabilityCut' : 0.005 , - 'VertexEdmFactory' : vertexEdmFactory, - 'JetFitterInitializationHelper' : improvedJetFitterInitializationHelper, - 'InDetJetFitterUtils' : inDetJetFitterUtils, - 'Extrapolator' : jetFitterExtrapolator, - 'JetFitterRoutines' : improvedJetFitterRoutines, - 'TrackSelector' : inDetImprovedJetFitterTrackSelectorTool, - 'Mode3dFinder' : jetFitterMode3dTo1dFinder, - 'SequentialVertexFitter' : jetFitterSequentialVertexFitter} - for option in defaults: - options.setdefault(option, defaults[option]) - options['name'] = name + suffix - from InDetSecVxFinderTool.InDetSecVxFinderToolConf import InDet__InDetImprovedJetFitterVxFinder - return InDet__InDetImprovedJetFitterVxFinder(**options) #-------------------------------------------------------------------------- @@ -796,3 +693,310 @@ def toolJetFitterTagCOMBNN(name, useBTagFlagsDefaults = True, **options): options['name'] = name from JetTagTools.JetTagToolsConf import Analysis__JetFitterTag return Analysis__JetFitterTag(**options) + +#-------------------------------------------------------------------------- +# new jf track selector tool for hackathon 2019 +metaJetFitterTrackSelectorTool = {'VertexFinderxAODBaseName' : 'JetFitter', + 'VertexFinderPassByPointer': {'JetFitterVariableFactory' : 'JetFitterVariablesFactory' }, + 'DependsOn' : ['InDetJetFitterUtils', + 'InDetImprovedJetFitterTrackSelectorTool', + 'JetFitterExtrapolator'], + 'PassByPointer' : {'TrackSelector' : 'InDetImprovedJetFitterTrackSelectorTool', + 'InDetJetFitterUtils' : 'InDetJetFitterUtils', + 'Extrapolator' : 'JetFitterExtrapolator' }, + 'ToolCollection' : 'JetFitterCollection' } + +def toolJetFitterTrackSelectorTool(name, useBTagFlagsDefaults = True, **options): + """Sets up a InDetJetFitterUtils tool and returns it. + + The following options have BTaggingFlags defaults: + + OutputLevel default: BTaggingFlags.OutputLevel + + input: name: The name of the tool (should be unique). + useBTagFlagsDefaults : Whether to use BTaggingFlags defaults for options that are not specified. + **options: Python dictionary with options for the tool. + output: The actual tool, which can then by added to ToolSvc via ToolSvc += output.""" + if useBTagFlagsDefaults: + defaults = { 'OutputLevel' : BTaggingFlags.OutputLevel } + for option in defaults: + options.setdefault(option, defaults[option]) + options['name'] = name + from InDetSecVxFinderTool.InDetSecVxFinderToolConf import InDet__JetFitterTrackSelectorTool + return InDet__JetFitterTrackSelectorTool(**options) + +def toolJetFitterTrackSelectorTool_SV(name, suffix="", useBTagFlagsDefaults = True, **options): + """Sets up a InDetJetFitterUtils tool and returns it. + + The following options have BTaggingFlags defaults: + + OutputLevel default: BTaggingFlags.OutputLevel + + input: name: The name of the tool (should be unique). + useBTagFlagsDefaults : Whether to use BTaggingFlags defaults for options that are not specified. + **options: Python dictionary with options for the tool. + output: The actual tool, which can then by added to ToolSvc via ToolSvc += output.""" + if useBTagFlagsDefaults: + inDetJetFitterUtils = toolInDetJetFitterUtils_SV('InDetJFUtils'+suffix) + ImprovedJetFitterTrackSelectorTool = toolInDetImprovedJetFitterTrackSelectorTool('ImprovedJFTrackSelTool'+suffix) + jetFitterExtrapolator = toolJetFitterExtrapolator('JFExtrapolator'+suffix) + defaults = { 'OutputLevel' : BTaggingFlags.OutputLevel, + 'InDetJetFitterUtils' : inDetJetFitterUtils, + 'TrackSelector' : ImprovedJetFitterTrackSelectorTool, + 'Extrapolator' : jetFitterExtrapolator } + for option in defaults: + options.setdefault(option, defaults[option]) + options['name'] = name + suffix + from InDetSecVxFinderTool.InDetSecVxFinderToolConf import InDet__JetFitterTrackSelectorTool + return InDet__JetFitterTrackSelectorTool(**options) + +#-------------------------------------------------------------------------- + + +metaJetFitterMultiStageFit = { 'DependsOn' : ['InDetJetFitterUtils', + 'ImprovedJetFitterRoutines', + 'ImprovedJetFitterInitializationHelper'], + 'PassByPointer' : {'JetFitterInitializationHelper' : 'ImprovedJetFitterInitializationHelper', + 'InDetJetFitterUtils' : 'InDetJetFitterUtils', + 'JetFitterRoutines' : 'ImprovedJetFitterRoutines'}, + 'ToolCollection' : 'JetFitterCollection'} + +def toolJetFitterMultiStageFit(name, useBTagFlagsDefaults = True, **options): + """Sets up the new JetFitterMultiStageFit tool and returns it. + + + + input: name: The name of the tool (should be unique). + useBTagFlagsDefaults : Whether to use BTaggingFlags defaults for options that are not specified. + **options: Python dictionary with options for the tool. + output: The actual tool, which can then by added to ToolSvc via ToolSvc += output.""" + if useBTagFlagsDefaults: + defaults = { 'OutputLevel' : BTaggingFlags.OutputLevel, + 'MaxNumDeleteIterations' : 30, + 'VertexProbCut' : 0.001, + 'MaxClusteringIterations' : 30, + 'VertexClusteringProbabilityCut' : 0.005 } + for option in defaults: + options.setdefault(option, defaults[option]) + options['name'] = name + from InDetSecVxFinderTool.InDetSecVxFinderToolConf import InDet__JetFitterMultiStageFit + return InDet__JetFitterMultiStageFit(**options) + +def toolJetFitterMultiStageFit_SV(name, suffix="", useBTagFlagsDefaults = True, **options): + """Sets up the new JetFitterMultiStageFit tool and returns it. + + + + input: name: The name of the tool (should be unique). + useBTagFlagsDefaults : Whether to use BTaggingFlags defaults for options that are not specified. + **options: Python dictionary with options for the tool. + output: The actual tool, which can then by added to ToolSvc via ToolSvc += output.""" + if useBTagFlagsDefaults: + improvedJetFitterInitializationHelper = toolImprovedJetFitterInitializationHelper('ImprovedJFInitHelper'+suffix) + inDetJetFitterUtils = toolInDetJetFitterUtils_SV('InDetJFUtils'+suffix) + inDetJetFitterRoutines = toolImprovedJetFitterRoutines('ImprovedJetFitterRoutines'+suffix) + defaults = { 'OutputLevel' : BTaggingFlags.OutputLevel, + 'MaxNumDeleteIterations' : 30, + 'VertexProbCut' : 0.001, + 'MaxClusteringIterations' : 30, + 'VertexClusteringProbabilityCut' : 0.005, + 'InDetJetFitterUtils' : inDetJetFitterUtils, + 'JetFitterInitializationHelper': improvedJetFitterInitializationHelper, + 'JetFitterRoutines': inDetJetFitterRoutines } + for option in defaults: + options.setdefault(option, defaults[option]) + options['name'] = name + suffix + from InDetSecVxFinderTool.InDetSecVxFinderToolConf import InDet__JetFitterMultiStageFit + return InDet__JetFitterMultiStageFit(**options) + +#-------------------------------------------------------------------------- +metaNewJetFitterVxFinder = { 'IsAVertexFinder' : True, + 'VertexFinderxAODBaseName' : 'JetFitter', + 'VertexFinderPassByPointer': {'JetFitterVariableFactory' : 'JetFitterVariablesFactory' }, + 'DependsOn' : ['BTagTrackToVertexTool', + 'TrkDistanceFinderNeutralCharged', + 'TrkDistanceFinderNeutralNeutral', + 'JetFitterSequentialVertexSmoother', + 'JetFitterFullLinearizedTrackFactory', + 'JetFitterVariablesFactory', + 'JetFitterTrackSelectorTool', + 'JetFitterTwoTrackVtxFinderTool', + 'JetFitterV0FinderTool', + 'JetFitterMultiStageFit'], + 'PassByPointer' : { 'JetFitterTrackSelectorTool' : 'JetFitterTrackSelectorTool', + 'JetFitterTwoTrackVtxFinderTool': 'JetFitterTwoTrackVtxFinderTool', + 'JetFitterV0FinderTool' : 'JetFitterV0FinderTool', + 'JetFitterMultiStageFit' : 'JetFitterMultiStageFit'}, + 'ToolCollection' : 'JetFitterCollection' } + +def toolNewJetFitterVxFinder(name, useBTagFlagsDefaults = True, **options): + """Sets up a NewJetFitterVxFinder tool and returns it. + + The following options have BTaggingFlags defaults: + + OutputLevel default: BTaggingFlags.OutputLevel + + input: name: The name of the tool (should be unique). + useBTagFlagsDefaults : Whether to use BTaggingFlags defaults for options that are not specified. + **options: Python dictionary with options for the tool. + output: The actual tool, which can then by added to ToolSvc via ToolSvc += output.""" + if useBTagFlagsDefaults: + if not 'InDetKeys' in dir(): + from InDetRecExample.InDetKeys import InDetKeys + defaults = { 'OutputLevel' : BTaggingFlags.OutputLevel } + for option in defaults: + options.setdefault(option, defaults[option]) + options['name'] = name + from InDetSecVxFinderTool.InDetSecVxFinderToolConf import InDet__InDetImprovedJetFitterVxFinder + return InDet__InDetImprovedJetFitterVxFinder(**options) + +#-------------------------------------------------------------------------- + +metaJetFitterTwoTrackVtxFinderTool = { 'DependsOn': ['JetFitterSequentialVertexFitter'], + 'PassByPointer': {'SequentialVertexFitter' : 'JetFitterSequentialVertexFitter'}, + 'ToolCollection' : 'JetFitterCollection'} + +def toolJetFitterTwoTrackVtxFinderTool(name , useBTagFlagsDefaults = True, **options): + """Sets up the new JetFitter TwoTrack Vtx Finder Tool and returns it. + + OutputLevel default: BTaggingFlags.OutputLevel + + input: name: The name of the tool (should be unique). + useBTagFlagsDefaults : Whether to use BTaggingFlags defaults for options that are not specified. + **options: Python dictionary with options for the tool. + output: The actual tool, which can then by added to ToolSvc via ToolSvc += output.""" + if useBTagFlagsDefaults: + defaults = { 'OutputLevel' : BTaggingFlags.OutputLevel } + for option in defaults: + options.setdefault(option, defaults[option]) + options['name'] = name + from InDetSecVxFinderTool.InDetSecVxFinderToolConf import InDet__JetFitterTwoTrackVtxFinderTool + return InDet__JetFitterTwoTrackVtxFinderTool(**options) + +def toolJetFitterTwoTrackVtxFinderTool_SV(name, suffix="" , useBTagFlagsDefaults = True, **options): + """Sets up the new JetFitter TwoTrack Vtx Finder Tool and returns it. + + OutputLevel default: BTaggingFlags.OutputLevel + + input: name: The name of the tool (should be unique). + useBTagFlagsDefaults : Whether to use BTaggingFlags defaults for options that are not specified. + **options: Python dictionary with options for the tool. + output: The actual tool, which can then by added to ToolSvc via ToolSvc += output.""" + if useBTagFlagsDefaults: + inDetJetFitterSequentialVertexFitter = toolJetFitterSequentialVertexFitter_SV("toolJetFitterSequentialVertexFitter"+suffix) + defaults = { 'OutputLevel' : BTaggingFlags.OutputLevel, + 'SequentialVertexFitter' : inDetJetFitterSequentialVertexFitter } + for option in defaults: + options.setdefault(option, defaults[option]) + options['name'] = name + suffix + from InDetSecVxFinderTool.InDetSecVxFinderToolConf import InDet__JetFitterTwoTrackVtxFinderTool + return InDet__JetFitterTwoTrackVtxFinderTool(**options) + + +#-------------------------------------------------------------------------- + +metaJetFitterV0FinderTool = { 'DependsOn': ['JetFitterMode3dTo1dFinder','InDetJetFitterUtils'], + 'PassByPointer': { 'Mode3dFinder' : 'JetFitterMode3dTo1dFinder', + 'InDetJetFitterUtils' : 'InDetJetFitterUtils' }, + 'ToolCollection' : 'JetFitterCollection'} + +def toolJetFitterV0FinderTool(name , useBTagFlagsDefaults = True, **options): + """Sets up the new JetFitter V0 Finder Tool and returns it. + + OutputLevel default: BTaggingFlags.OutputLevel + + input: name: The name of the tool (should be unique). + useBTagFlagsDefaults : Whether to use BTaggingFlags defaults for options that are not specified. + **options: Python dictionary with options for the tool. + output: The actual tool, which can then by added to ToolSvc via ToolSvc += output.""" + if useBTagFlagsDefaults: + defaults = { 'OutputLevel' : BTaggingFlags.OutputLevel } + for option in defaults: + options.setdefault(option, defaults[option]) + options['name'] = name + from InDetSecVxFinderTool.InDetSecVxFinderToolConf import InDet__JetFitterV0FinderTool + return InDet__JetFitterV0FinderTool(**options) + +def toolJetFitterV0FinderTool_SV(name , suffix="", useBTagFlagsDefaults = True, **options): + """Sets up the new JetFitter V0 Finder Tool and returns it. + + OutputLevel default: BTaggingFlags.OutputLevel + + input: name: The name of the tool (should be unique). + useBTagFlagsDefaults : Whether to use BTaggingFlags defaults for options that are not specified. + **options: Python dictionary with options for the tool. + output: The actual tool, which can then by added to ToolSvc via ToolSvc += output.""" + if useBTagFlagsDefaults: + inDetJetFitterUtils = toolInDetJetFitterUtils_SV('InDetJFUtils'+suffix) + inDetMode3dTo1dFinder = toolJetFitterMode3dTo1dFinder('Mode3dTo1dFinder'+suffix) + defaults = { 'OutputLevel' : BTaggingFlags.OutputLevel, + 'InDetJetFitterUtils' : inDetJetFitterUtils, + 'Mode3dFinder': inDetMode3dTo1dFinder } + for option in defaults: + options.setdefault(option, defaults[option]) + options['name'] = name + suffix + from InDetSecVxFinderTool.InDetSecVxFinderToolConf import InDet__JetFitterV0FinderTool + return InDet__JetFitterV0FinderTool(**options) + + +#-------------------------------------------------------------------------- + +def toolNewJetFitterVxFinder(name, useBTagFlagsDefaults = True, **options): + """Sets up a NewJetFitterVxFinder tool and returns it. + + The following options have BTaggingFlags defaults: + + OutputLevel default: BTaggingFlags.OutputLevel + + input: name: The name of the tool (should be unique). + useBTagFlagsDefaults : Whether to use BTaggingFlags defaults for options that are not specified. + **options: Python dictionary with options for the tool. + output: The actual tool, which can then by added to ToolSvc via ToolSvc += output.""" + if useBTagFlagsDefaults: + if not 'InDetKeys' in dir(): + from InDetRecExample.InDetKeys import InDetKeys + defaults = { 'OutputLevel' : BTaggingFlags.OutputLevel } + for option in defaults: + options.setdefault(option, defaults[option]) + options['name'] = name + from InDetSecVxFinderTool.InDetSecVxFinderToolConf import InDet__InDetImprovedJetFitterVxFinder + return InDet__InDetImprovedJetFitterVxFinder(**options) + +#-------------------------------------------------------------------------- + +def toolNewJetFitterVxFinder_SV(name, suffix = "", useBTagFlagsDefaults = True, **options): + """Sets up a NewJetFitterVxFinder tool and returns it. + + The following options have BTaggingFlags defaults: + + OutputLevel default: BTaggingFlags.OutputLevel + VxPrimaryContainer default: BTaggingFlags.PrimaryVertexCollectionName + MaxNumDeleteIterations default: 30 + VertexProbCut default: 0.001 + MaxClusteringIterations default: 30 + VertexClusteringProbabilityCut default: 0.005 + + input: name: The name of the tool (should be unique). + useBTagFlagsDefaults : Whether to use BTaggingFlags defaults for options that are not specified. + **options: Python dictionary with options for the tool. + output: The actual tool, which can then by added to ToolSvc via ToolSvc += output.""" + if useBTagFlagsDefaults: + if not 'InDetKeys' in dir(): + from InDetRecExample.InDetKeys import InDetKeys + inDetImprovedJetFitterTrackSelectorTool = toolJetFitterTrackSelectorTool_SV('InDetImprovedJFTrackSelTool'+suffix,suffix) + inDetJetFitterTwoTrackVtxFinderTool = toolJetFitterTwoTrackVtxFinderTool_SV('inDetJetFitterTwoTrackVtxFinderTool'+suffix,suffix) + inDetImprovedJFV0FinderTool = toolJetFitterV0FinderTool_SV('inDetImprovedJFV0FinderTool'+suffix,suffix) + inDetJetFitterMultiStageFit = toolJetFitterMultiStageFit_SV('inDetJetFitterMultiStageFit'+suffix,suffix) + defaults = { 'OutputLevel' : BTaggingFlags.OutputLevel, + 'JetFitterTwoTrackVtxFinderTool' : inDetJetFitterTwoTrackVtxFinderTool, + 'JetFitterTrackSelectorTool' : inDetImprovedJetFitterTrackSelectorTool, + 'JetFitterV0FinderTool' : inDetImprovedJFV0FinderTool, + 'JetFitterMultiStageFit' : inDetJetFitterMultiStageFit + } + for option in defaults: + options.setdefault(option, defaults[option]) + options['name'] = name + suffix + from InDetSecVxFinderTool.InDetSecVxFinderToolConf import InDet__InDetImprovedJetFitterVxFinder + return InDet__InDetImprovedJetFitterVxFinder(**options) + +#-------------------------------------------------------------------------- diff --git a/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/python/BTaggingConfiguration_NewJetFitterTrigCollection.py b/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/python/BTaggingConfiguration_NewJetFitterTrigCollection.py index 075dc6e487522fcc7c647f802f89001268a93c70..5f18cc36fda18ba5dad013f1be1179d05501c744 100644 --- a/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/python/BTaggingConfiguration_NewJetFitterTrigCollection.py +++ b/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/python/BTaggingConfiguration_NewJetFitterTrigCollection.py @@ -167,7 +167,7 @@ def toolVxInternalEdmFactory_SV(name, useBTagFlagsDefaults = True, **options): if useBTagFlagsDefaults: jetFitterFullLinearizedTrackFactory = toolJetFitterFullLinearizedTrackFactory('JetFitterFullLinearizedTrackFactory') defaults = { 'OutputLevel' : BTaggingFlags.OutputLevel, - 'LinearizedTrackFactory' : jetFitterFullLinearizedTrackFactory, } + 'LinearizedTrackFactory' : jetFitterFullLinearizedTrackFactory } for option in defaults: options.setdefault(option, defaults[option]) options['name'] = name @@ -382,110 +382,7 @@ def toolInDetJetFitterUtils_SV(name, useBTagFlagsDefaults = True, **options): #-------------------------------------------------------------------------- -metaNewJetFitterVxFinder = { 'IsAVertexFinder' : True, - 'VertexFinderxAODBaseName' : 'JetFitter', - 'VertexFinderPassByPointer': {'JetFitterVariableFactory' : 'JetFitterVariablesFactory' }, - 'DependsOn' : ['BTagTrackToVertexTool', - 'InDetJetFitterUtils', - 'ImprovedJetFitterRoutines', - 'TrkDistanceFinderNeutralCharged', - 'TrkDistanceFinderNeutralNeutral', - 'ImprovedJetFitterInitializationHelper', - 'JetFitterSequentialVertexFitter', - 'JetFitterSequentialVertexSmoother', - 'JetFitterMode3dTo1dFinder', - 'InDetImprovedJetFitterTrackSelectorTool', - 'JetFitterExtrapolator', - 'JetFitterFullLinearizedTrackFactory', - 'JetFitterVariablesFactory', - 'VxInternalEdmFactory'], - 'PassByPointer' : { 'Mode3dFinder' : 'JetFitterMode3dTo1dFinder', - 'JetFitterInitializationHelper' : 'ImprovedJetFitterInitializationHelper', - 'TrackSelector' : 'InDetImprovedJetFitterTrackSelectorTool', - 'InDetJetFitterUtils' : 'InDetJetFitterUtils', - 'Extrapolator' : 'JetFitterExtrapolator', - 'SequentialVertexFitter' : 'JetFitterSequentialVertexFitter', - 'JetFitterRoutines' : 'ImprovedJetFitterRoutines', - 'VertexEdmFactory' : 'VxInternalEdmFactory' }, - 'ToolCollection' : 'JetFitterCollection' } - -def toolNewJetFitterVxFinder(name, useBTagFlagsDefaults = True, **options): - """Sets up a NewJetFitterVxFinder tool and returns it. - - The following options have BTaggingFlags defaults: - - OutputLevel default: BTaggingFlags.OutputLevel - VxPrimaryContainer default: BTaggingFlags.PrimaryVertexCollectionName - MaxNumDeleteIterations default: 30 - VertexProbCut default: 0.001 - MaxClusteringIterations default: 30 - VertexClusteringProbabilityCut default: 0.005 - - input: name: The name of the tool (should be unique). - useBTagFlagsDefaults : Whether to use BTaggingFlags defaults for options that are not specified. - **options: Python dictionary with options for the tool. - output: The actual tool, which can then by added to ToolSvc via ToolSvc += output.""" - if useBTagFlagsDefaults: - if not 'InDetKeys' in dir(): - from InDetRecExample.InDetKeys import InDetKeys - defaults = { 'OutputLevel' : BTaggingFlags.OutputLevel, - 'VxPrimaryContainer' : BTaggingFlags.PrimaryVertexCollectionName, - 'MaxNumDeleteIterations' : 30, - 'VertexProbCut' : 0.001, - 'MaxClusteringIterations' : 30, - 'VertexClusteringProbabilityCut' : 0.005 } - for option in defaults: - options.setdefault(option, defaults[option]) - options['name'] = name - from InDetSecVxFinderTool.InDetSecVxFinderToolConf import InDet__InDetImprovedJetFitterVxFinder - return InDet__InDetImprovedJetFitterVxFinder(**options) - -def toolNewJetFitterVxFinder_SV(name, suffix = "", useBTagFlagsDefaults = True, **options): - """Sets up a NewJetFitterVxFinder tool and returns it. - - The following options have BTaggingFlags defaults: - OutputLevel default: BTaggingFlags.OutputLevel - VxPrimaryContainer default: BTaggingFlags.PrimaryVertexCollectionName - MaxNumDeleteIterations default: 30 - VertexProbCut default: 0.001 - MaxClusteringIterations default: 30 - VertexClusteringProbabilityCut default: 0.005 - - input: name: The name of the tool (should be unique). - useBTagFlagsDefaults : Whether to use BTaggingFlags defaults for options that are not specified. - **options: Python dictionary with options for the tool. - output: The actual tool, which can then by added to ToolSvc via ToolSvc += output.""" - if useBTagFlagsDefaults: - if not 'InDetKeys' in dir(): - from InDetRecExample.InDetKeys import InDetKeys - inDetJetFitterUtils = toolInDetJetFitterUtils_SV('InDetJFUtils'+suffix) - improvedJetFitterRoutines = toolImprovedJetFitterRoutines('ImprovedJFRoutines'+suffix) - jetFitterMode3dTo1dFinder = toolJetFitterMode3dTo1dFinder('JFMode3dTo1dFinder'+suffix) - inDetImprovedJetFitterTrackSelectorTool = toolInDetImprovedJetFitterTrackSelectorTool('InDetImprovedJFTrackSelTool'+suffix) - jetFitterSequentialVertexFitter = toolJetFitterSequentialVertexFitter_SV('JFSeqVxFitter'+suffix) - jetFitterExtrapolator = toolJetFitterExtrapolator('JFExtrapolator'+suffix) - improvedJetFitterInitializationHelper = toolImprovedJetFitterInitializationHelper('ImprovedJFInitHelper'+suffix) - vertexEdmFactory = toolVxInternalEdmFactory_SV('VxInternalEdmFactory'+suffix) - defaults = { 'OutputLevel' : BTaggingFlags.OutputLevel, - 'VxPrimaryContainer' : BTaggingFlags.PrimaryVertexCollectionName, - 'MaxNumDeleteIterations' : 30, - 'VertexProbCut' : 0.001, - 'MaxClusteringIterations' : 30, - 'VertexClusteringProbabilityCut' : 0.005 , - 'VertexEdmFactory' : vertexEdmFactory, - 'JetFitterInitializationHelper' : improvedJetFitterInitializationHelper, - 'InDetJetFitterUtils' : inDetJetFitterUtils, - 'Extrapolator' : jetFitterExtrapolator, - 'JetFitterRoutines' : improvedJetFitterRoutines, - 'TrackSelector' : inDetImprovedJetFitterTrackSelectorTool, - 'Mode3dFinder' : jetFitterMode3dTo1dFinder, - 'SequentialVertexFitter' : jetFitterSequentialVertexFitter} - for option in defaults: - options.setdefault(option, defaults[option]) - options['name'] = name + suffix - from InDetSecVxFinderTool.InDetSecVxFinderToolConf import InDet__InDetImprovedJetFitterVxFinder - return InDet__InDetImprovedJetFitterVxFinder(**options) #-------------------------------------------------------------------------- @@ -796,3 +693,310 @@ def toolJetFitterTagCOMBNN(name, useBTagFlagsDefaults = True, **options): options['name'] = name from JetTagTools.JetTagToolsConf import Analysis__JetFitterTag return Analysis__JetFitterTag(**options) + +#-------------------------------------------------------------------------- +# new jf track selector tool for hackathon 2019 +metaJetFitterTrackSelectorTool = {'VertexFinderxAODBaseName' : 'JetFitter', + 'VertexFinderPassByPointer': {'JetFitterVariableFactory' : 'JetFitterVariablesFactory' }, + 'DependsOn' : ['InDetJetFitterUtils', + 'InDetImprovedJetFitterTrackSelectorTool', + 'JetFitterExtrapolator'], + 'PassByPointer' : {'TrackSelector' : 'InDetImprovedJetFitterTrackSelectorTool', + 'InDetJetFitterUtils' : 'InDetJetFitterUtils', + 'Extrapolator' : 'JetFitterExtrapolator' }, + 'ToolCollection' : 'JetFitterCollection' } + +def toolJetFitterTrackSelectorTool(name, useBTagFlagsDefaults = True, **options): + """Sets up a InDetJetFitterUtils tool and returns it. + + The following options have BTaggingFlags defaults: + + OutputLevel default: BTaggingFlags.OutputLevel + + input: name: The name of the tool (should be unique). + useBTagFlagsDefaults : Whether to use BTaggingFlags defaults for options that are not specified. + **options: Python dictionary with options for the tool. + output: The actual tool, which can then by added to ToolSvc via ToolSvc += output.""" + if useBTagFlagsDefaults: + defaults = { 'OutputLevel' : BTaggingFlags.OutputLevel } + for option in defaults: + options.setdefault(option, defaults[option]) + options['name'] = name + from InDetSecVxFinderTool.InDetSecVxFinderToolConf import InDet__JetFitterTrackSelectorTool + return InDet__JetFitterTrackSelectorTool(**options) + +def toolJetFitterTrackSelectorTool_SV(name, suffix="", useBTagFlagsDefaults = True, **options): + """Sets up a InDetJetFitterUtils tool and returns it. + + The following options have BTaggingFlags defaults: + + OutputLevel default: BTaggingFlags.OutputLevel + + input: name: The name of the tool (should be unique). + useBTagFlagsDefaults : Whether to use BTaggingFlags defaults for options that are not specified. + **options: Python dictionary with options for the tool. + output: The actual tool, which can then by added to ToolSvc via ToolSvc += output.""" + if useBTagFlagsDefaults: + inDetJetFitterUtils = toolInDetJetFitterUtils_SV('InDetJFUtils'+suffix) + ImprovedJetFitterTrackSelectorTool = toolInDetImprovedJetFitterTrackSelectorTool('ImprovedJFTrackSelTool'+suffix) + jetFitterExtrapolator = toolJetFitterExtrapolator('JFExtrapolator'+suffix) + defaults = { 'OutputLevel' : BTaggingFlags.OutputLevel, + 'InDetJetFitterUtils' : inDetJetFitterUtils, + 'TrackSelector' : ImprovedJetFitterTrackSelectorTool, + 'Extrapolator' : jetFitterExtrapolator } + for option in defaults: + options.setdefault(option, defaults[option]) + options['name'] = name + suffix + from InDetSecVxFinderTool.InDetSecVxFinderToolConf import InDet__JetFitterTrackSelectorTool + return InDet__JetFitterTrackSelectorTool(**options) + +#-------------------------------------------------------------------------- + + +metaJetFitterMultiStageFit = { 'DependsOn' : ['InDetJetFitterUtils', + 'ImprovedJetFitterRoutines', + 'ImprovedJetFitterInitializationHelper'], + 'PassByPointer' : {'JetFitterInitializationHelper' : 'ImprovedJetFitterInitializationHelper', + 'InDetJetFitterUtils' : 'InDetJetFitterUtils', + 'JetFitterRoutines' : 'ImprovedJetFitterRoutines'}, + 'ToolCollection' : 'JetFitterCollection'} + +def toolJetFitterMultiStageFit(name, useBTagFlagsDefaults = True, **options): + """Sets up the new JetFitterMultiStageFit tool and returns it. + + + + input: name: The name of the tool (should be unique). + useBTagFlagsDefaults : Whether to use BTaggingFlags defaults for options that are not specified. + **options: Python dictionary with options for the tool. + output: The actual tool, which can then by added to ToolSvc via ToolSvc += output.""" + if useBTagFlagsDefaults: + defaults = { 'OutputLevel' : BTaggingFlags.OutputLevel, + 'MaxNumDeleteIterations' : 30, + 'VertexProbCut' : 0.001, + 'MaxClusteringIterations' : 30, + 'VertexClusteringProbabilityCut' : 0.005 } + for option in defaults: + options.setdefault(option, defaults[option]) + options['name'] = name + from InDetSecVxFinderTool.InDetSecVxFinderToolConf import InDet__JetFitterMultiStageFit + return InDet__JetFitterMultiStageFit(**options) + +def toolJetFitterMultiStageFit_SV(name, suffix="", useBTagFlagsDefaults = True, **options): + """Sets up the new JetFitterMultiStageFit tool and returns it. + + + + input: name: The name of the tool (should be unique). + useBTagFlagsDefaults : Whether to use BTaggingFlags defaults for options that are not specified. + **options: Python dictionary with options for the tool. + output: The actual tool, which can then by added to ToolSvc via ToolSvc += output.""" + if useBTagFlagsDefaults: + improvedJetFitterInitializationHelper = toolImprovedJetFitterInitializationHelper('ImprovedJFInitHelper'+suffix) + inDetJetFitterUtils = toolInDetJetFitterUtils_SV('InDetJFUtils'+suffix) + inDetJetFitterRoutines = toolImprovedJetFitterRoutines('ImprovedJetFitterRoutines'+suffix) + defaults = { 'OutputLevel' : BTaggingFlags.OutputLevel, + 'MaxNumDeleteIterations' : 30, + 'VertexProbCut' : 0.001, + 'MaxClusteringIterations' : 30, + 'VertexClusteringProbabilityCut' : 0.005, + 'InDetJetFitterUtils' : inDetJetFitterUtils, + 'JetFitterInitializationHelper': improvedJetFitterInitializationHelper, + 'JetFitterRoutines': inDetJetFitterRoutines } + for option in defaults: + options.setdefault(option, defaults[option]) + options['name'] = name + suffix + from InDetSecVxFinderTool.InDetSecVxFinderToolConf import InDet__JetFitterMultiStageFit + return InDet__JetFitterMultiStageFit(**options) + +#-------------------------------------------------------------------------- +metaNewJetFitterVxFinder = { 'IsAVertexFinder' : True, + 'VertexFinderxAODBaseName' : 'JetFitter', + 'VertexFinderPassByPointer': {'JetFitterVariableFactory' : 'JetFitterVariablesFactory' }, + 'DependsOn' : ['BTagTrackToVertexTool', + 'TrkDistanceFinderNeutralCharged', + 'TrkDistanceFinderNeutralNeutral', + 'JetFitterSequentialVertexSmoother', + 'JetFitterFullLinearizedTrackFactory', + 'JetFitterVariablesFactory', + 'JetFitterTrackSelectorTool', + 'JetFitterTwoTrackVtxFinderTool', + 'JetFitterV0FinderTool', + 'JetFitterMultiStageFit'], + 'PassByPointer' : { 'JetFitterTrackSelectorTool' : 'JetFitterTrackSelectorTool', + 'JetFitterTwoTrackVtxFinderTool': 'JetFitterTwoTrackVtxFinderTool', + 'JetFitterV0FinderTool' : 'JetFitterV0FinderTool', + 'JetFitterMultiStageFit' : 'JetFitterMultiStageFit'}, + 'ToolCollection' : 'JetFitterCollection' } + +def toolNewJetFitterVxFinder(name, useBTagFlagsDefaults = True, **options): + """Sets up a NewJetFitterVxFinder tool and returns it. + + The following options have BTaggingFlags defaults: + + OutputLevel default: BTaggingFlags.OutputLevel + + input: name: The name of the tool (should be unique). + useBTagFlagsDefaults : Whether to use BTaggingFlags defaults for options that are not specified. + **options: Python dictionary with options for the tool. + output: The actual tool, which can then by added to ToolSvc via ToolSvc += output.""" + if useBTagFlagsDefaults: + if not 'InDetKeys' in dir(): + from InDetRecExample.InDetKeys import InDetKeys + defaults = { 'OutputLevel' : BTaggingFlags.OutputLevel } + for option in defaults: + options.setdefault(option, defaults[option]) + options['name'] = name + from InDetSecVxFinderTool.InDetSecVxFinderToolConf import InDet__InDetImprovedJetFitterVxFinder + return InDet__InDetImprovedJetFitterVxFinder(**options) + +#-------------------------------------------------------------------------- + +metaJetFitterTwoTrackVtxFinderTool = { 'DependsOn': ['JetFitterSequentialVertexFitter'], + 'PassByPointer': {'SequentialVertexFitter' : 'JetFitterSequentialVertexFitter'}, + 'ToolCollection' : 'JetFitterCollection'} + +def toolJetFitterTwoTrackVtxFinderTool(name , useBTagFlagsDefaults = True, **options): + """Sets up the new JetFitter TwoTrack Vtx Finder Tool and returns it. + + OutputLevel default: BTaggingFlags.OutputLevel + + input: name: The name of the tool (should be unique). + useBTagFlagsDefaults : Whether to use BTaggingFlags defaults for options that are not specified. + **options: Python dictionary with options for the tool. + output: The actual tool, which can then by added to ToolSvc via ToolSvc += output.""" + if useBTagFlagsDefaults: + defaults = { 'OutputLevel' : BTaggingFlags.OutputLevel } + for option in defaults: + options.setdefault(option, defaults[option]) + options['name'] = name + from InDetSecVxFinderTool.InDetSecVxFinderToolConf import InDet__JetFitterTwoTrackVtxFinderTool + return InDet__JetFitterTwoTrackVtxFinderTool(**options) + +def toolJetFitterTwoTrackVtxFinderTool_SV(name, suffix="" , useBTagFlagsDefaults = True, **options): + """Sets up the new JetFitter TwoTrack Vtx Finder Tool and returns it. + + OutputLevel default: BTaggingFlags.OutputLevel + + input: name: The name of the tool (should be unique). + useBTagFlagsDefaults : Whether to use BTaggingFlags defaults for options that are not specified. + **options: Python dictionary with options for the tool. + output: The actual tool, which can then by added to ToolSvc via ToolSvc += output.""" + if useBTagFlagsDefaults: + inDetJetFitterSequentialVertexFitter = toolJetFitterSequentialVertexFitter_SV("toolJetFitterSequentialVertexFitter"+suffix) + defaults = { 'OutputLevel' : BTaggingFlags.OutputLevel, + 'SequentialVertexFitter' : inDetJetFitterSequentialVertexFitter } + for option in defaults: + options.setdefault(option, defaults[option]) + options['name'] = name + suffix + from InDetSecVxFinderTool.InDetSecVxFinderToolConf import InDet__JetFitterTwoTrackVtxFinderTool + return InDet__JetFitterTwoTrackVtxFinderTool(**options) + + +#-------------------------------------------------------------------------- + +metaJetFitterV0FinderTool = { 'DependsOn': ['JetFitterMode3dTo1dFinder','InDetJetFitterUtils'], + 'PassByPointer': { 'Mode3dFinder' : 'JetFitterMode3dTo1dFinder', + 'InDetJetFitterUtils' : 'InDetJetFitterUtils' }, + 'ToolCollection' : 'JetFitterCollection'} + +def toolJetFitterV0FinderTool(name , useBTagFlagsDefaults = True, **options): + """Sets up the new JetFitter V0 Finder Tool and returns it. + + OutputLevel default: BTaggingFlags.OutputLevel + + input: name: The name of the tool (should be unique). + useBTagFlagsDefaults : Whether to use BTaggingFlags defaults for options that are not specified. + **options: Python dictionary with options for the tool. + output: The actual tool, which can then by added to ToolSvc via ToolSvc += output.""" + if useBTagFlagsDefaults: + defaults = { 'OutputLevel' : BTaggingFlags.OutputLevel } + for option in defaults: + options.setdefault(option, defaults[option]) + options['name'] = name + from InDetSecVxFinderTool.InDetSecVxFinderToolConf import InDet__JetFitterV0FinderTool + return InDet__JetFitterV0FinderTool(**options) + +def toolJetFitterV0FinderTool_SV(name , suffix="", useBTagFlagsDefaults = True, **options): + """Sets up the new JetFitter V0 Finder Tool and returns it. + + OutputLevel default: BTaggingFlags.OutputLevel + + input: name: The name of the tool (should be unique). + useBTagFlagsDefaults : Whether to use BTaggingFlags defaults for options that are not specified. + **options: Python dictionary with options for the tool. + output: The actual tool, which can then by added to ToolSvc via ToolSvc += output.""" + if useBTagFlagsDefaults: + inDetJetFitterUtils = toolInDetJetFitterUtils_SV('InDetJFUtils'+suffix) + inDetMode3dTo1dFinder = toolJetFitterMode3dTo1dFinder('Mode3dTo1dFinder'+suffix) + defaults = { 'OutputLevel' : BTaggingFlags.OutputLevel, + 'InDetJetFitterUtils' : inDetJetFitterUtils, + 'Mode3dFinder': inDetMode3dTo1dFinder } + for option in defaults: + options.setdefault(option, defaults[option]) + options['name'] = name + suffix + from InDetSecVxFinderTool.InDetSecVxFinderToolConf import InDet__JetFitterV0FinderTool + return InDet__JetFitterV0FinderTool(**options) + + +#-------------------------------------------------------------------------- + +def toolNewJetFitterVxFinder(name, useBTagFlagsDefaults = True, **options): + """Sets up a NewJetFitterVxFinder tool and returns it. + + The following options have BTaggingFlags defaults: + + OutputLevel default: BTaggingFlags.OutputLevel + + input: name: The name of the tool (should be unique). + useBTagFlagsDefaults : Whether to use BTaggingFlags defaults for options that are not specified. + **options: Python dictionary with options for the tool. + output: The actual tool, which can then by added to ToolSvc via ToolSvc += output.""" + if useBTagFlagsDefaults: + if not 'InDetKeys' in dir(): + from InDetRecExample.InDetKeys import InDetKeys + defaults = { 'OutputLevel' : BTaggingFlags.OutputLevel } + for option in defaults: + options.setdefault(option, defaults[option]) + options['name'] = name + from InDetSecVxFinderTool.InDetSecVxFinderToolConf import InDet__InDetImprovedJetFitterVxFinder + return InDet__InDetImprovedJetFitterVxFinder(**options) + +#-------------------------------------------------------------------------- + +def toolNewJetFitterVxFinder_SV(name, suffix = "", useBTagFlagsDefaults = True, **options): + """Sets up a NewJetFitterVxFinder tool and returns it. + + The following options have BTaggingFlags defaults: + + OutputLevel default: BTaggingFlags.OutputLevel + VxPrimaryContainer default: BTaggingFlags.PrimaryVertexCollectionName + MaxNumDeleteIterations default: 30 + VertexProbCut default: 0.001 + MaxClusteringIterations default: 30 + VertexClusteringProbabilityCut default: 0.005 + + input: name: The name of the tool (should be unique). + useBTagFlagsDefaults : Whether to use BTaggingFlags defaults for options that are not specified. + **options: Python dictionary with options for the tool. + output: The actual tool, which can then by added to ToolSvc via ToolSvc += output.""" + if useBTagFlagsDefaults: + if not 'InDetKeys' in dir(): + from InDetRecExample.InDetKeys import InDetKeys + inDetImprovedJetFitterTrackSelectorTool = toolJetFitterTrackSelectorTool_SV('InDetImprovedJFTrackSelTool'+suffix,suffix) + inDetJetFitterTwoTrackVtxFinderTool = toolJetFitterTwoTrackVtxFinderTool_SV('inDetJetFitterTwoTrackVtxFinderTool'+suffix,suffix) + inDetImprovedJFV0FinderTool = toolJetFitterV0FinderTool_SV('inDetImprovedJFV0FinderTool'+suffix,suffix) + inDetJetFitterMultiStageFit = toolJetFitterMultiStageFit_SV('inDetJetFitterMultiStageFit'+suffix,suffix) + defaults = { 'OutputLevel' : BTaggingFlags.OutputLevel, + 'JetFitterTwoTrackVtxFinderTool' : inDetJetFitterTwoTrackVtxFinderTool, + 'JetFitterTrackSelectorTool' : inDetImprovedJetFitterTrackSelectorTool, + 'JetFitterV0FinderTool' : inDetImprovedJFV0FinderTool, + 'JetFitterMultiStageFit' : inDetJetFitterMultiStageFit + } + for option in defaults: + options.setdefault(option, defaults[option]) + options['name'] = name + suffix + from InDetSecVxFinderTool.InDetSecVxFinderToolConf import InDet__InDetImprovedJetFitterVxFinder + return InDet__InDetImprovedJetFitterVxFinder(**options) + +#-------------------------------------------------------------------------- diff --git a/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/python/InDetImprovedJetFitterVxFinderConfig.py b/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/python/InDetImprovedJetFitterVxFinderConfig.py new file mode 100644 index 0000000000000000000000000000000000000000..7e19f3bd2527eba7587cf73041d8f3f11ea31e21 --- /dev/null +++ b/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/python/InDetImprovedJetFitterVxFinderConfig.py @@ -0,0 +1,41 @@ +# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration + +from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator +from AthenaConfiguration.ComponentFactory import CompFactory + +from BTagging.JetFitterMultiStageFitConfig import InDetJetFitterMultiStageFitCfg +from BTagging.JetFitterTrackSelectorToolConfig import InDetJetFitterTrackSelectorToolCfg +from BTagging.JetFitterTwoTrackVtxFinderToolConfig import InDetJetFitterTwoTrackVtxFinderToolCfg +from BTagging.JetFitterV0FinderToolConfig import JetFitterV0FinderToolCfg + +# import the InDetDetailedTrackSelectorTool configurable +InDet__InDetImprovedJetFitterVxFinder=CompFactory.InDet.InDetImprovedJetFitterVxFinder + +def InDetImprovedJetFitterVxFinderCfg(flags, name, suffix = "", useBTagFlagsDefaults = True, **options): + """Sets up a InDetJetFitterTrackSelectorTool tool and returns it. + + The following options have BTaggingFlags defaults: + + input: name: The name of the tool (should be unique). + useBTagFlagsDefaults : Whether to use BTaggingFlags defaults for options that are not specified. + **options: Python dictionary with options for the tool. + output: The actual tool, which can then by added to ToolSvc via ToolSvc += output.""" + acc = ComponentAccumulator() + if useBTagFlagsDefaults: + InDetJetFitterMultiStageFit = acc.popToolsAndMerge( InDetJetFitterMultiStageFitCfg(flags,"JetFitterMultiStageFit"+suffix,suffix) ) + InDetJetFitterTrackSelectorTool = acc.popToolsAndMerge( InDetJetFitterTrackSelectorToolCfg(flags,"JetFitterTrackSelectorTool"+suffix,suffix) ) + InDetJetFitterTwoTrackVtxFinderTool = acc.popToolsAndMerge( InDetJetFitterTwoTrackVtxFinderToolCfg("InDetJetFitterTwoTrackVtxFinderTool"+suffix,suffix) ) + InDetJetFitterV0FinderTool = acc.popToolsAndMerge( JetFitterV0FinderToolCfg(flags,"JetFitterV0FinderTool"+suffix,suffix) ) + defaults = { 'JetFitterTrackSelectorTool' : InDetJetFitterTrackSelectorTool , + 'JetFitterTwoTrackVtxFinderTool' : InDetJetFitterTwoTrackVtxFinderTool , + 'JetFitterV0FinderTool' : InDetJetFitterV0FinderTool , + 'JetFitterMultiStageFit' : InDetJetFitterMultiStageFit } + for option in defaults: + options.setdefault(option, defaults[option]) + + options['name'] = name + acc.setPrivateTools( InDet__InDetImprovedJetFitterVxFinder(**options) ) + return acc + + + diff --git a/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/python/InDetJetFitterUtilsConfig.py b/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/python/InDetJetFitterUtilsConfig.py index 243a4d6e655b668a8c8e65c569e19e527067e3b7..0bc47ec0e4045038e3aee793783fd1d816b3fe40 100644 --- a/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/python/InDetJetFitterUtilsConfig.py +++ b/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/python/InDetJetFitterUtilsConfig.py @@ -1,4 +1,4 @@ -# Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration +# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration from JetTagTools.BTagFullLinearizedTrackFactoryConfig import BTagFullLinearizedTrackFactoryCfg from AthenaConfiguration.ComponentFactory import CompFactory diff --git a/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/python/InDetJetFitterVxFinderConfig.py b/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/python/InDetJetFitterVxFinderConfig.py new file mode 100644 index 0000000000000000000000000000000000000000..f3950a6886968db1bd07b94f82fd6bd01078dbea --- /dev/null +++ b/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/python/InDetJetFitterVxFinderConfig.py @@ -0,0 +1,53 @@ +# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration + +from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator +from AthenaConfiguration.ComponentFactory import CompFactory + +from BTagging.ImprovedJetFitterInitializationHelperConfig import ImprovedJetFitterInitializationHelperCfg +from BTagging.ImprovedJetFitterRoutinesConfig import ImprovedJetFitterRoutinesCfg +from BTagging.InDetImprovedJetFitterTrackSelectorToolConfig import InDetImprovedJetFitterTrackSelectorToolCfg + +# import the InDetDetailedTrackSelectorTool configurable +InDet__InDetJetFitterVxFinder=CompFactory.InDet.InDetJetFitterVxFinder + +def InDetInDetJetFitterVxFinderCfg(name, suffix="", useBTagFlagsDefaults = True, **options): + """Sets up a InDetJetFitterVxFinder tool and returns it. + + The following options have BTaggingFlags defaults: + + MaxNumDeleteIterations default: 30 + VertexProbCut default: 0.001 + MaxClusteringIterations default: 30 + VertexClusteringProbabilityCut default: 0.005 + UseFastClustering default: False + MaxTracksToFitAtOnce default: 15 + + input: name: The name of the tool (should be unique). + useBTagFlagsDefaults : Whether to use BTaggingFlags defaults for options that are not specified. + **options: Python dictionary with options for the tool. + output: The actual tool, which can then by added to ToolSvc via ToolSvc += output.""" + acc = ComponentAccumulator() + if useBTagFlagsDefaults: + improvedJetFitterInitializationHelper = acc.popToolsAndMerge(ImprovedJetFitterInitializationHelperCfg('ImprovedJFInitHelper'+suffix)) + improvedJetFitterRoutines = acc.popToolsAndMerge(ImprovedJetFitterRoutinesCfg('ImprovedJFRoutines'+suffix)) + inDetImprovedJetFitterTrackSelectorTool = acc.popToolsAndMerge(InDetImprovedJetFitterTrackSelectorToolCfg('InDetImprovedJFTrackSelTool'+suffix)) + defaults = { 'MaxNumDeleteIterations' : 30, + 'VertexProbCut' : 0.001, + 'MaxClusteringIterations' : 30, + 'VertexClusteringProbabilityCut' : 0.005 , + 'UseFastClustering' : False, + 'MaxTracksToFitAtOnce' : 15, + 'JetFitterInitializationHelper' : improvedJetFitterInitializationHelper, +# 'JetFitterHelper' : , + 'JetFitterRoutines' : improvedJetFitterRoutines, + 'TrackSelector' : inDetImprovedJetFitterTrackSelectorTool } + + for option in defaults: + options.setdefault(option, defaults[option]) + + options['name'] = name + acc.setPrivateTools( InDet__InDetJetFitterVxFinder(**options) ) + return acc + + + diff --git a/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/python/JetFitterMultiStageFitConfig.py b/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/python/JetFitterMultiStageFitConfig.py new file mode 100644 index 0000000000000000000000000000000000000000..1826bbfd5f7d5147f4d3848a45e290a47fbed1ed --- /dev/null +++ b/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/python/JetFitterMultiStageFitConfig.py @@ -0,0 +1,73 @@ +# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration + +from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator +from AthenaConfiguration.ComponentFactory import CompFactory + +from BTagging.InDetJetFitterUtilsConfig import InDetJetFitterUtilsCfg +from BTagging.ImprovedJetFitterInitializationHelperConfig import ImprovedJetFitterInitializationHelperCfg +from BTagging.ImprovedJetFitterRoutinesConfig import ImprovedJetFitterRoutinesCfg + +# import the InDetDetailedTrackSelectorTool configurable +InDet__JetFitterMultiStageFit = CompFactory.InDet.JetFitterMultiStageFit + +def InDetJetFitterMultiStageFitCfg(flags, name, suffix="", useBTagFlagsDefaults = True, **options): + """Sets up a JetFitterMultiStageFit tool and returns it. + + The following options have BTaggingFlags defaults: + + MaxNumDeleteIterations default:30 + VertexProbCut default: 0.001 + MaxClusteringIterations default: 30 + UseFastClustering default: False + maxTracksForDetailedClustering default:25 + VertexClusteringProbabilityCut default:0.005 + VertexClusteringProbabilityCutWithMass default:0.05 + VertexClusteringProbabilityCutWithMass0010 default:0.002 + VertexClusteringProbabilityCutWithMass1015 default:0.002 + VertexClusteringProbabilityCutWithMass1520 default:0.050 + VertexClusteringProbabilityCutWithMass2025 default: 0.100 + VertexClusteringProbabilityCutWithMass2530 default:0.200 + VertexClusteringProbabilityCutWithMass3040 default:0.500 + VertexClusteringProbabilityCutWithMass4050 default:0.700 + VertexClusteringProbabilityCutWithMass5060 default:0.900 + VertexClusteringProbabilityCutWithMass6070 default:0.900 + + input: name: The name of the tool (should be unique). + useBTagFlagsDefaults : Whether to use BTaggingFlags defaults for options that are not specified. + **options: Python dictionary with options for the tool. + output: The actual tool, which can then by added to ToolSvc via ToolSvc += output.""" + + acc = ComponentAccumulator() + if useBTagFlagsDefaults: + improvedJetFitterRoutines = acc.popToolsAndMerge(ImprovedJetFitterRoutinesCfg('ImprovedJFRoutines'+suffix)) + inDetJetFitterUtils = acc.popToolsAndMerge(InDetJetFitterUtilsCfg(flags,'InDetJFUtils'+suffix)) + improvedJetFitterInitializationHelper = acc.popToolsAndMerge(ImprovedJetFitterInitializationHelperCfg('ImprovedJFInitHelper'+suffix)) + defaults = { 'MaxNumDeleteIterations' : 30 , + 'VertexProbCut' : 0.001 , + 'MaxClusteringIterations' : 30 , + 'UseFastClustering' : False , + 'maxTracksForDetailedClustering' : 25 , + 'VertexClusteringProbabilityCut' : 0.005 , + 'VertexClusteringProbabilityCutWithMass' : 0.05 , + 'VertexClusteringProbabilityCutWithMass0010' : 0.002 , + 'VertexClusteringProbabilityCutWithMass1015' : 0.002 , + 'VertexClusteringProbabilityCutWithMass1520' : 0.050 , + 'VertexClusteringProbabilityCutWithMass2025' : 0.100 , + 'VertexClusteringProbabilityCutWithMass2530' : 0.200 , + 'VertexClusteringProbabilityCutWithMass3040' : 0.500 , + 'VertexClusteringProbabilityCutWithMass4050' : 0.700 , + 'VertexClusteringProbabilityCutWithMass5060' : 0.900 , + 'VertexClusteringProbabilityCutWithMass6070' : 0.900 , + 'JetFitterInitializationHelper' : improvedJetFitterInitializationHelper, +# 'JetFitterHelper' : , + 'JetFitterRoutines' : improvedJetFitterRoutines, + 'InDetJetFitterUtils' : inDetJetFitterUtils } + for option in defaults: + options.setdefault(option, defaults[option]) + + options['name'] = name + acc.setPrivateTools( InDet__JetFitterMultiStageFit(**options) ) + return acc + + + diff --git a/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/python/JetFitterTrackSelectorToolConfig.py b/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/python/JetFitterTrackSelectorToolConfig.py new file mode 100644 index 0000000000000000000000000000000000000000..7c5727752ecc815ef450bbf2411f7badb7619beb --- /dev/null +++ b/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/python/JetFitterTrackSelectorToolConfig.py @@ -0,0 +1,45 @@ +# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration + +from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator +from AthenaConfiguration.ComponentFactory import CompFactory + +from BTagging.InDetJetFitterUtilsConfig import InDetJetFitterUtilsCfg +from BTagging.InDetImprovedJetFitterTrackSelectorToolConfig import InDetImprovedJetFitterTrackSelectorToolCfg +from TrkConfig.AtlasExtrapolatorConfig import AtlasExtrapolatorCfg + +# import the InDetDetailedTrackSelectorTool configurable +InDet__JetFitterTrackSelectorTool=CompFactory.InDet.JetFitterTrackSelectorTool + +def InDetJetFitterTrackSelectorToolCfg(flags, name, suffix="", useBTagFlagsDefaults = True, **options): + """Sets up a InDetJetFitterTrackSelectorTool tool and returns it. + + The following options have BTaggingFlags defaults: + + revertFromPositiveToNegativeTags default: False + cutCompPrimaryVertexForPosLifetimeTracks default: 1e-1 + cutCompPrimaryVertexForNegLifetimeTracks default: 5e-2 + + input: name: The name of the tool (should be unique). + useBTagFlagsDefaults : Whether to use BTaggingFlags defaults for options that are not specified. + **options: Python dictionary with options for the tool. + output: The actual tool, which can then by added to ToolSvc via ToolSvc += output.""" + acc = ComponentAccumulator() + if useBTagFlagsDefaults: + jetFitterExtrapolator= acc.popToolsAndMerge(AtlasExtrapolatorCfg(flags,'JFExtrapolator'+suffix)) + inDetJetFitterUtils = acc.popToolsAndMerge(InDetJetFitterUtilsCfg(flags,'InDetJFUtils'+suffix)) + inDetImprovedJetFitterTrackSelectorTool = acc.popToolsAndMerge(InDetImprovedJetFitterTrackSelectorToolCfg('InDetImprovedJFTrackSelTool'+suffix)) + defaults = { 'revertFromPositiveToNegativeTags' : False, + 'cutCompPrimaryVertexForPosLifetimeTracks' : 0.1, + 'cutCompPrimaryVertexForNegLifetimeTracks' : 0.05, + 'Extrapolator' : jetFitterExtrapolator , + 'InDetJetFitterUtils' : inDetJetFitterUtils, + 'TrackSelector' : inDetImprovedJetFitterTrackSelectorTool } + for option in defaults: + options.setdefault(option, defaults[option]) + + options['name'] = name + acc.setPrivateTools( InDet__JetFitterTrackSelectorTool(**options) ) + return acc + + + diff --git a/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/python/JetFitterTwoTrackVtxFinderToolConfig.py b/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/python/JetFitterTwoTrackVtxFinderToolConfig.py new file mode 100644 index 0000000000000000000000000000000000000000..7d8cff80bb4916b029512e0288ba0dbac2d13a1e --- /dev/null +++ b/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/python/JetFitterTwoTrackVtxFinderToolConfig.py @@ -0,0 +1,44 @@ +# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration + +from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator +from AthenaConfiguration.ComponentFactory import CompFactory + +from BTagging.JetFitterSequentialVertexFitterConfig import JetFitterSequentialVertexFitterCfg + +# import the InDetDetailedTrackSelectorTool configurable +InDet__JetFitterTwoTrackVtxFinderTool=CompFactory.InDet.JetFitterTwoTrackVtxFinderTool + +def InDetJetFitterTwoTrackVtxFinderToolCfg(name, suffix="", useBTagFlagsDefaults = True, **options): + + """Sets up a InDetJetFitterTwoTrackVtxFinderTool tool and returns it. + + The following options have BTaggingFlags defaults: + + ID_maxR default: 1150. + ID_maxZ default: 2727. + twoVertexProbabilityCut default: 3.4e-2 + revertFromPositiveToNegativeTags default: False + + input: name: The name of the tool (should be unique). + useBTagFlagsDefaults : Whether to use BTaggingFlags defaults for options that are not specified. + **options: Python dictionary with options for the tool. + output: The actual tool, which can then by added to ToolSvc via ToolSvc += output.""" + acc = ComponentAccumulator() + if useBTagFlagsDefaults: + jetFitterSequentialVertexFitter = acc.popToolsAndMerge(JetFitterSequentialVertexFitterCfg('JFSeqVxFitter'+suffix)) + defaults = { 'ID_maxR' : 1150., + 'ID_maxZ' : 2727., + 'twoVertexProbabilityCut' : 0.034, + 'revertFromPositiveToNegativeTags' : False, +# 'CrossDistancesSeedFinder' : , + 'SequentialVertexFitter' : jetFitterSequentialVertexFitter } + for option in defaults: + options.setdefault(option, defaults[option]) + + options['name'] = name + acc.setPrivateTools( InDet__JetFitterTwoTrackVtxFinderTool(**options) ) + return acc + + + + diff --git a/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/python/JetFitterV0FinderToolConfig.py b/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/python/JetFitterV0FinderToolConfig.py new file mode 100644 index 0000000000000000000000000000000000000000..50568fbc3a320626e51f7bce54407f852c09a161 --- /dev/null +++ b/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/python/JetFitterV0FinderToolConfig.py @@ -0,0 +1,90 @@ +# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration + +from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator +from AthenaConfiguration.ComponentFactory import CompFactory + +from BTagging.InDetJetFitterUtilsConfig import InDetJetFitterUtilsCfg +from BTagging.JetFitterMode3dTo1dFinderConfig import JetFitterMode3dTo1dFinderCfg + +# import the InDetDetailedTrackSelectorTool configurable +InDet__JetFitterV0FinderTool=CompFactory.InDet.JetFitterV0FinderTool + +def JetFitterV0FinderToolCfg(flags, name, suffix="", useBTagFlagsDefaults = True, **options): + """Sets up a JetFitterV0FinderTool tool and returns it. + + The following options have BTaggingFlags defaults: + + revertFromPositiveToNegativeTags default: False + cutTwoTrkVtxVtxProbForBFirstSelectCriteriumA default: 0.05 + cutTwoTrkVtxVtxProbForBFirstSelectCriteriumB default: 0.034 + cutCompatibilityPrimaryVertexSingleTrackForBFirstSelection default: 1e-1 + cutCompatibilityPrimaryVertexBothTracksForBFirstSelection default: 1e-2 + cutIPD0BothTracksForBFirstSelection default: 3.5 + cutIPZ0BothTracksForBFirstSelection default: 5. + cutPtBothTracksForBFirstSelection default: 500. + cutTwoTrkVtxLifeSignForBFirstSelectCriteriumA default: 1. + cutTwoTrkVtxLifeSignForBFirstSelectCriteriumB default: 1.5 + cutCompToPrimarySingleTrackForMatInterac default: 1e-4 + cutCompToPrimaryBothTracksForMatInterac default: 1e-6 + firstBeam_min default: 23 + firstBeam_max default: 25 + secondBeam_min default: 23 + secondBeam_max default: 24 + firstLayer_min default: 34.0-2.5 + firstLayer_max default: 34.0+2.5 + secondLayer_min default: 51.5-3 + secondLayer_max default: 51.5+3 + cutCompPVSinglePosLifeTrackForBSecondSelect default: 5e-2 + cutCompPVSingleNegLifeTrackForBSecondSelect default: 1e-2 + cutIPD0SigBoxSingleTrackForBSecondSelection default: 2. + cutIPZ0SigBoxSingleTrackForBSecondSelection default: 5. + cutIPD0SingleTrackForBSecondSelection default: 1.5 + cutIPZ0SingleTrackForBSecondSelection default: 3. + cutPtSingleTrackForBSecondSelection default: 750 + + input: name: The name of the tool (should be unique). + useBTagFlagsDefaults : Whether to use BTaggingFlags defaults for options that are not specified. + **options: Python dictionary with options for the tool. + output: The actual tool, which can then by added to ToolSvc via ToolSvc += output.""" + acc = ComponentAccumulator() + if useBTagFlagsDefaults: + inDetJetFitterUtils = acc.popToolsAndMerge(InDetJetFitterUtilsCfg(flags,'InDetJFUtils'+suffix)) + jetFitterMode3dTo1dFinder = acc.popToolsAndMerge(JetFitterMode3dTo1dFinderCfg('JFMode3dTo1dFinder'+suffix)) + defaults = { 'revertFromPositiveToNegativeTags' : False , + 'cutTwoTrkVtxVtxProbForBFirstSelectCriteriumA' : 0.05 , + 'cutTwoTrkVtxVtxProbForBFirstSelectCriteriumB' : 0.034 , + 'cutCompatibilityPrimaryVertexSingleTrackForBFirstSelection' : 1e-1 , + 'cutCompatibilityPrimaryVertexBothTracksForBFirstSelection' : 1e-2 , + 'cutIPD0BothTracksForBFirstSelection' : 3.5 , + 'cutIPZ0BothTracksForBFirstSelection' : 5. , + 'cutPtBothTracksForBFirstSelection' : 500. , + 'cutTwoTrkVtxLifeSignForBFirstSelectCriteriumA' : 1. , + 'cutTwoTrkVtxLifeSignForBFirstSelectCriteriumB' : 1.5 , + 'cutCompToPrimarySingleTrackForMatInterac' : 1e-4 , + 'cutCompToPrimaryBothTracksForMatInterac' : 1e-6 , + 'firstBeam_min' : 23 , + 'firstBeam_max' : 25 , + 'secondBeam_min' : 23 , + 'secondBeam_max' : 24 , + 'firstLayer_min' : 34.0-2.5 , + 'firstLayer_max' : 34.0+2.5 , + 'secondLayer_min' : 51.5-3 , + 'secondLayer_max' : 51.5+3 , + 'cutCompPVSinglePosLifeTrackForBSecondSelect' : 5e-2 , + 'cutCompPVSingleNegLifeTrackForBSecondSelect' : 1e-2 , + 'cutIPD0SigBoxSingleTrackForBSecondSelection' : 2. , + 'cutIPZ0SigBoxSingleTrackForBSecondSelection' : 5. , + 'cutIPD0SingleTrackForBSecondSelection' : 1.5 , + 'cutIPZ0SingleTrackForBSecondSelection' : 3. , + 'cutPtSingleTrackForBSecondSelection' : 750, + 'InDetJetFitterUtils' : inDetJetFitterUtils, + 'Mode3dFinder' : jetFitterMode3dTo1dFinder } + for option in defaults: + options.setdefault(option, defaults[option]) + + options['name'] = name + acc.setPrivateTools( InDet__JetFitterV0FinderTool(**options) ) + return acc + + + diff --git a/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/python/JetSecVtxFindingAlgConfig.py b/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/python/JetSecVtxFindingAlgConfig.py index 277acf5ed53424b9a103b95ee90e9cab29959c06..034740715cf4e6cc1073eddb18079672c802dd8b 100644 --- a/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/python/JetSecVtxFindingAlgConfig.py +++ b/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/python/JetSecVtxFindingAlgConfig.py @@ -2,7 +2,7 @@ from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator from AthenaConfiguration.ComponentFactory import CompFactory -from BTagging.NewJetFitterVxFinderConfig import NewJetFitterVxFinderCfg +from BTagging.InDetImprovedJetFitterVxFinderConfig import InDetImprovedJetFitterVxFinderCfg from BTagging.InDetVKalVxInJetToolConfig import InDetVKalVxInJetToolCfg Analysis__JetSecVtxFindingAlg=CompFactory.Analysis.JetSecVtxFindingAlg @@ -21,7 +21,7 @@ def JetSecVtxFindingAlgCfg(ConfigFlags, JetCollection, PrimaryVertexCollectionNa jetcol = JetCollection if SVFinder == 'JetFitter': - secVtxFinder = acc.popToolsAndMerge(NewJetFitterVxFinderCfg(ConfigFlags, 'JFVxFinder')) + secVtxFinder = acc.popToolsAndMerge(InDetImprovedJetFitterVxFinderCfg(ConfigFlags, 'JFVxFinder')) elif SVFinder == 'SV1': secVtxFinder = acc.popToolsAndMerge(InDetVKalVxInJetToolCfg("IDVKalVxInJet")) elif SVFinder == 'MSV': diff --git a/PhysicsAnalysis/MuonID/MuonPerformanceAnalysis/MuonResonanceTools/Root/MuonResonanceSelectionTool.cxx b/PhysicsAnalysis/MuonID/MuonPerformanceAnalysis/MuonResonanceTools/Root/MuonResonanceSelectionTool.cxx index 3b0abe7c171f6fbf9c2da54e941712917f5fd554..605ec43afa9bea56f3fa1407b8058be5c94c0ad5 100644 --- a/PhysicsAnalysis/MuonID/MuonPerformanceAnalysis/MuonResonanceTools/Root/MuonResonanceSelectionTool.cxx +++ b/PhysicsAnalysis/MuonID/MuonPerformanceAnalysis/MuonResonanceTools/Root/MuonResonanceSelectionTool.cxx @@ -15,20 +15,20 @@ MuonResonanceSelectionTool::MuonResonanceSelectionTool(std::string myname) m_highMassWindow(110000.0), m_lowMassWindow(90000.0), #ifndef ROOTCORE - m_seliTool("CP::MuonSelectionTool/MuonSelectionTool", this), + m_seliTool("CP::MuonSelectionTool/MuonSelectionTool", this), m_sfTool("CP::MuonEfficiencyScaleFactors/MuonEfficiencyScaleFactors", this ), m_calibTool("CP::MuonCalibrationAndSmearingTool/MuonCalibrationAndSmearingTool", this ), m_matchTool(""), m_trigTool("") -#else - m_seliTool("CP::MuonSelectionTool/MuonSelectionTool"), +#else + m_seliTool("CP::MuonSelectionTool/MuonSelectionTool"), m_sfTool("CP::MuonEfficiencyScaleFactors/MuonEfficiencyScaleFactors" ), m_calibTool("CP::MuonCalibrationAndSmearingTool/MuonCalibrationAndSmearingTool" ), m_matchTool("Trig::TrigMuonMatching/TrigMuonMatching"), m_trigTool("Trig::TrigDecisionTool/TrigDecisionTool") #endif { - + declareProperty("PtCut", m_ptCut = 20000.0); declareProperty("EtaCut", m_etaCut = 2.5); declareProperty("IsoCaloCut", m_isoCaloCut = 0.12); @@ -44,19 +44,19 @@ MuonResonanceSelectionTool::MuonResonanceSelectionTool(std::string myname) declareProperty("MuonSelectionTool", m_seliTool ); declareProperty("ScaleFactorTool", m_sfTool ); declareProperty("MuonCalibrationTool", m_calibTool ); - declareProperty("TriggerDecisionTool", m_trigTool ); - declareProperty("TriggerMatchingTool", m_matchTool ); - + declareProperty("TriggerDecisionTool", m_trigTool ); + declareProperty("TriggerMatchingTool", m_matchTool ); + } StatusCode MuonResonanceSelectionTool::initialize() { - + ATH_CHECK( m_seliTool.retrieve() ); if (m_doEff) ATH_CHECK( m_sfTool.retrieve() ); if (m_doCalib) ATH_CHECK( m_calibTool.retrieve() ); if (!m_trigTool.empty()) ATH_CHECK( m_trigTool.retrieve() ); - if (!m_matchTool.empty()) ATH_CHECK( m_matchTool.retrieve() ); + if (!m_matchTool.empty()) ATH_CHECK( m_matchTool.retrieve() ); ATH_MSG_INFO("Tools initialized:" ); ATH_MSG_INFO("SelectionTool :: \t" << m_seliTool ); @@ -75,8 +75,8 @@ StatusCode MuonResonanceSelectionTool::initialize() ATH_MSG_INFO("Max_d0 = " << m_Abs_d0Cut ); ATH_MSG_INFO("Max_z0 = " << m_Abs_z0Cut ); ATH_MSG_INFO("Calibrate = " << m_doCalib ); - ATH_MSG_INFO("Eff. Corr = " << m_doEff ); - + ATH_MSG_INFO("Eff. Corr = " << m_doEff ); + return StatusCode::SUCCESS; } @@ -84,7 +84,7 @@ StatusCode MuonResonanceSelectionTool::initialize() std::pair<std::vector<const xAOD::Muon*>,std::vector<const xAOD::Muon*> > MuonResonanceSelectionTool::selectMuons(const xAOD::MuonContainer* tags, bool isMC, CP::SystematicSet sys) { - ATH_MSG_DEBUG("Number of found Muons :"<< tags->size() ); + ATH_MSG_DEBUG("Number of found Muons :"<< tags->size() ); std::pair<std::vector<const xAOD::Muon*>,std::vector<const xAOD::Muon*> > goodMuons = std::make_pair(std::vector<const xAOD::Muon*>(), std::vector<const xAOD::Muon*>()); const xAOD::EventInfo* info = 0; @@ -98,19 +98,19 @@ std::pair<std::vector<const xAOD::Muon*>,std::vector<const xAOD::Muon*> > MuonRe return goodMuons; } - if (m_doCalib) { - if( m_calibTool->applySystematicVariation( sys ) != CP::SystematicCode::Ok ) - ATH_MSG_WARNING( "Cannot configure muon calibration tool for systematic " << sys.name() ); + if (m_doCalib) { + if( m_calibTool->applySystematicVariation( sys ) != CP::SystematicCode::Ok ) + ATH_MSG_WARNING( "Cannot configure muon calibration tool for systematic " << sys.name() ); } if (m_doEff) { - if( m_sfTool->applySystematicVariation( sys ) != CP::SystematicCode::Ok ) + if( m_sfTool->applySystematicVariation( sys ) != CP::SystematicCode::Ok ) ATH_MSG_WARNING( "Cannot configure muon efficiency corrections for systematic " << sys.name() ); } - + // loop over muon container for(auto tag : *tags) { - + // select muon type (Combined = 0) if(tag->muonType() != xAOD::Muon::MuonType::Combined) continue; @@ -119,32 +119,32 @@ std::pair<std::vector<const xAOD::Muon*>,std::vector<const xAOD::Muon*> > MuonRe // correct muon xAOD::Muon* mu = 0; - if(m_doCalib){ - try{ m_calibTool->correctedCopy( *tag, mu );} + if(m_doCalib){ + try{ m_calibTool->correctedCopy( *tag, mu ).ignore();} catch(SG::ExcBadAuxVar&){ ATH_MSG_WARNING( "Cannot retrieve aux-item - rejecting muon" ); delete mu; continue; } } - else{ + else{ try{ mu = copy(*tag);} - catch(SG::ExcBadAuxVar&){ + catch(SG::ExcBadAuxVar&){ ATH_MSG_WARNING( "Cannot retrieve aux-item - rejecting muon" ); delete mu; continue; } } - ATH_MSG_DEBUG("Selected muon TLV Pt|Eta|Phi|E :: " + ATH_MSG_DEBUG("Selected muon TLV Pt|Eta|Phi|E :: " << mu->p4().Pt() << " | " << mu->p4().Eta() << " | " << mu->p4().Phi() << " | " << mu->p4().E() ); ATH_MSG_DEBUG("pT(corr)/pT : " << mu->pt()/tag->pt() ); // apply efficiency SF if(m_doEff) applySF(*mu, isMC); - + // pass MuonSelectionTool - if(!m_seliTool->accept(*mu)){ + if(!m_seliTool->accept(*mu)){ ATH_MSG_DEBUG("Muon rejected by " << m_seliTool ); delete mu; continue; @@ -163,11 +163,11 @@ std::pair<std::vector<const xAOD::Muon*>,std::vector<const xAOD::Muon*> > MuonRe // TriggerMatching applyTriggerMatch(*mu); - if( mu->trackParticle(xAOD::Muon::Primary)->charge()>0) goodMuons.first.push_back(mu); + if( mu->trackParticle(xAOD::Muon::Primary)->charge()>0) goodMuons.first.push_back(mu); else goodMuons.second.push_back(mu); } - + ATH_MSG_DEBUG("Number of selected Muons : " << goodMuons.first.size()<< " "<< goodMuons.second.size() ); return goodMuons; @@ -175,7 +175,7 @@ std::pair<std::vector<const xAOD::Muon*>,std::vector<const xAOD::Muon*> > MuonRe // apply efficiency scale factors void MuonResonanceSelectionTool::applySF(const xAOD::Muon& mu, bool isMC) const{ - + float sf = 1.; if(isMC){ if( m_sfTool->applyEfficiencyScaleFactor(mu) == CP::CorrectionCode::Error ){ @@ -228,7 +228,7 @@ bool MuonResonanceSelectionTool::IPCut(const xAOD::Muon& mu, float z0cut, float if (IP_d0<d0cut && IP_z0<z0cut) return true; else return false; } - else{ + else{ ATH_MSG_DEBUG("no associated track found, rejecting muon" ); return false; } @@ -236,11 +236,11 @@ bool MuonResonanceSelectionTool::IPCut(const xAOD::Muon& mu, float z0cut, float // apply cut on total values of IPs bool MuonResonanceSelectionTool::IPCutAbs(const xAOD::Muon& mu, float Abs_z0, float Abs_d0) const{ - + const xAOD::TrackParticle* tp = mu.primaryTrackParticle(); if( mu.muonType() == xAOD::Muon::Combined && !tp ) tp = *mu.inDetTrackParticleLink(); - + if(tp){ const xAOD::VertexContainer* primVertices = 0; const xAOD::Vertex* vx = 0; @@ -256,7 +256,7 @@ bool MuonResonanceSelectionTool::IPCutAbs(const xAOD::Muon& mu, float Abs_z0, fl if(tp->d0()<Abs_d0 && delta_z0<Abs_z0) return true; else return false; } - else{ + else{ ATH_MSG_DEBUG("no associated track found, rejecting muon" ); return false; } @@ -264,7 +264,7 @@ bool MuonResonanceSelectionTool::IPCutAbs(const xAOD::Muon& mu, float Abs_z0, fl // creates uncorrected copy of muon xAOD::Muon* MuonResonanceSelectionTool::copy(const xAOD::Muon& mu) const{ - + xAOD::Muon *mu_c = 0; if(mu.m()<=0) return mu_c; mu_c = new xAOD::Muon(); @@ -391,7 +391,7 @@ if (runNb == 284154){ if (runNb == 284213){ if ((lumiBL >=43 && lumiBL <=164) || (lumiBL >=166 && lumiBL <=303) || (lumiBL >=306 && lumiBL <=433) || (lumiBL >=438 && lumiBL <=490) || (lumiBL >=492 && lumiBL <=776) || (lumiBL >=779 && lumiBL <=930) || (lumiBL >=932 && lumiBL <=962) || (lumiBL >=965 && lumiBL <=1033)) return true; } -if (runNb == 284420){ +if (runNb == 284420){ if ((lumiBL >=126 && lumiBL <=131) || (lumiBL >=133 && lumiBL <=165) || (lumiBL >=167 && lumiBL <=189) || (lumiBL >=191 && lumiBL <=230) || (lumiBL >=232 && lumiBL <=274) || (lumiBL >=277 && lumiBL <=277) || (lumiBL >=279 && lumiBL <=290) || (lumiBL >=292 && lumiBL <=348) || (lumiBL >=352 && lumiBL <=364) || (lumiBL >=367 && lumiBL <=377)) return true; } if (runNb == 284427){ @@ -409,28 +409,27 @@ if (runNb == 284484){ bool MuonResonanceSelectionTool::isTriggered (void) const{ ATH_MSG_DEBUG("Selected triggers " << (int)m_triggerList.size() << "\t Triggers found by tool " << (int)m_trigTool->getListOfTriggers().size() ); - if (m_triggerList.size() == 0 || m_trigTool->getListOfTriggers().size() == 0) return true; + if (m_triggerList.size() == 0 || m_trigTool->getListOfTriggers().size() == 0) return true; for (auto trigger : m_triggerList){ - ATH_MSG_DEBUG("Asking trigger "<< trigger); - if ( m_trigTool->isPassed(trigger) ) return true; - } - return false; + ATH_MSG_DEBUG("Asking trigger "<< trigger); + if ( m_trigTool->isPassed(trigger) ) return true; + } + return false; } // trigger matching void MuonResonanceSelectionTool::applyTriggerMatch(xAOD::Muon& mu) { - if(m_triggerList.size() == 0 || m_trigTool->getListOfTriggers().size() == 0 ){ + if(m_triggerList.size() == 0 || m_trigTool->getListOfTriggers().size() == 0 ){ mu.auxdata< bool >("isTriggered") = true; return; - } + } bool isTriggered = false; for (auto trigger : m_triggerList) { - ATH_MSG_DEBUG("Matching on " << trigger << " : \t" << m_matchTool->match(mu.eta(), mu.phi(), trigger) ); + ATH_MSG_DEBUG("Matching on " << trigger << " : \t" << m_matchTool->match(mu.eta(), mu.phi(), trigger) ); if( m_matchTool->match(mu.eta(), mu.phi(), trigger) ) isTriggered = true; } mu.auxdata< bool >("isTriggered") = isTriggered; return; } - diff --git a/PhysicsAnalysis/TruthParticleID/McParticleUtils/test/McParticleUtils.sh b/PhysicsAnalysis/TruthParticleID/McParticleUtils/test/McParticleUtils.sh deleted file mode 100755 index 408b03eebb4fa5c104e7a833e923eeeb8a446a17..0000000000000000000000000000000000000000 --- a/PhysicsAnalysis/TruthParticleID/McParticleUtils/test/McParticleUtils.sh +++ /dev/null @@ -1,13 +0,0 @@ -#!/bin/sh -# This just selects the directory to run cmt commands -# But with project builds and as this package (McParticleUtils) can be moved -# from some project to another, we wildcard the AtlasXyzRelease directory -cd ${NIGHTLYAREA}/Atlas*Release/cmt -# -cmt broadcast -select=McParticleUtils make CppUnit -stat=$? -if [ "$stat" != "0" ]; then - echo " -------------------------------- " - echo " FAILURE : test McParticleUtils " - echo " -------------------------------- " -fi diff --git a/PhysicsAnalysis/TruthParticleID/McParticleUtils/test/McVtxFilterTest_CppUnit.cxx b/PhysicsAnalysis/TruthParticleID/McParticleUtils/test/McVtxFilterTest_CppUnit.cxx index f205bc92ffaef5f81966b0844caff46ba536a1dd..ed34b698b8977e574466a222b50283ba5804c38f 100755 --- a/PhysicsAnalysis/TruthParticleID/McParticleUtils/test/McVtxFilterTest_CppUnit.cxx +++ b/PhysicsAnalysis/TruthParticleID/McParticleUtils/test/McVtxFilterTest_CppUnit.cxx @@ -66,7 +66,9 @@ public: { const int signalProcessId = 1000082; const int evtNbr = 1; - m_evt = new HepMC::GenEvent( signalProcessId, evtNbr ); + m_evt = new HepMC::GenEvent(); + HepMC::set_signal_process_id(m_evt,signalProcessId); + m_evt->set_event_number(evtNbr ); m_evt->set_event_scale( -1 ); m_evt->set_alphaQCD( -1 ); m_evt->set_alphaQED( -1 ); @@ -81,29 +83,29 @@ public: m_evt->set_random_states( rdmStates ); // Add 2 vertices - HepMC::GenVertex * v1 = new HepMC::GenVertex(); + HepMC::GenVertexPtr v1 = HepMC::newGenVertexPtr(); m_evt->add_vertex( v1 ); - v1->add_particle_in( new HepMC::GenParticle( HLV_t(0,0, + v1->add_particle_in( HepMC::newGenParticlePtr( HepMC::FourVector(0,0, 7000*GeV, 7000*GeV), 2212, 3 ) ); - HepMC::GenVertex* v2 = new HepMC::GenVertex; + HepMC::GenVertexPtr v2 = HepMC::newGenVertexPtr(); m_evt->add_vertex( v2 ); - v2->add_particle_in( new HepMC::GenParticle( HLV_t(0,0, + v2->add_particle_in( HepMC::newGenParticlePtr( HepMC::FourVector(0,0, -7000*GeV, +7000*GeV), 2212, 3 ) ); // // create the outgoing particles of v1 and v2 - HepMC::GenParticle* p3 = - new HepMC::GenParticle( HLV_t(.750*GeV, + HepMC::GenParticlePtr p3 = + HepMC::newGenParticlePtr( HepMC::FourVector(.750*GeV, -1.569*GeV, 32.191*GeV, 32.238*GeV), 1, 3 ); v1->add_particle_out( p3 ); - HepMC::GenParticle* p4 = - new HepMC::GenParticle( HLV_t( -3.047*GeV, + HepMC::GenParticlePtr p4 = + HepMC::newGenParticlePtr( HepMC::FourVector( -3.047*GeV, -19.*GeV, -54.629*GeV, 57.920*GeV), -2, 3 ); @@ -111,16 +113,16 @@ public: // // create v3 - HepMC::GenVertex* v3 = new HepMC::GenVertex(); + HepMC::GenVertexPtr v3 = HepMC::newGenVertexPtr(); m_evt->add_vertex( v3 ); v3->add_particle_in( p3 ); v3->add_particle_in( p4 ); v3->add_particle_out( - new HepMC::GenParticle( HLV_t(-3.813,0.113,-1.833,4.233 ), + HepMC::newGenParticlePtr( HepMC::FourVector(-3.813,0.113,-1.833,4.233 ), 22, 1 ) ); - HepMC::GenParticle* p5 = - new HepMC::GenParticle( HLV_t(1.517,-20.68,-20.605,85.925), + HepMC::GenParticlePtr p5 = + HepMC::newGenParticlePtr( HepMC::FourVector(1.517,-20.68,-20.605,85.925), -24,3); v3->add_particle_out( p5 ); @@ -134,39 +136,39 @@ public: HepMC::GenVertex * vZgee = new HepMC::GenVertex; m_evt->add_vertex( vZgee ); // Z0 - vZgee->add_particle_in( new HepMC::GenParticle( HLV_t( -4.49e+04, + vZgee->add_particle_in( HepMC::newGenParticlePtr( HepMC::FourVector( -4.49e+04, +8.36e+03, -2.70e+05, +2.89e+05 ), 23, 2 ) ); // Gammas - vZgee->add_particle_out( new HepMC::GenParticle( HLV_t( -1.28e+03, + vZgee->add_particle_out( HepMC::newGenParticlePtr( HepMC::FourVector( -1.28e+03, +1.03e+03, -5.47e+03, +5.71e+03 ), 22, 1 ) ); - vZgee->add_particle_out( new HepMC::GenParticle( HLV_t( +3.89e+02, + vZgee->add_particle_out( HepMC::newGenParticlePtr( HepMC::FourVector( +3.89e+02, -3.16e+02, -6.69e+03, +6.70e+03 ), 22, 1 ) ); - vZgee->add_particle_out( new HepMC::GenParticle( HLV_t( +7.34e+00, + vZgee->add_particle_out( HepMC::newGenParticlePtr( HepMC::FourVector( +7.34e+00, -2.71e+01, -4.12e+01, +4.98e+01 ), 22, 1 ) ); - vZgee->add_particle_out( new HepMC::GenParticle( HLV_t( -1.36e+02, + vZgee->add_particle_out( HepMC::newGenParticlePtr( HepMC::FourVector( -1.36e+02, +9.38e+01, -5.62e+02, +5.86e+02 ), 22, 1 ) ); // Electrons - vZgee->add_particle_out( new HepMC::GenParticle( HLV_t( +8.01e+03, + vZgee->add_particle_out( HepMC::newGenParticlePtr( HepMC::FourVector( +8.01e+03, -2.96e+04, -4.50e+04, +5.44e+04 ), -11, 1 ) ); - vZgee->add_particle_out( new HepMC::GenParticle( HLV_t( -5.19e+04, + vZgee->add_particle_out( HepMC::newGenParticlePtr( HepMC::FourVector( -5.19e+04, +3.72e+04, -2.13e+05, +2.22e+05 ), @@ -176,20 +178,20 @@ public: // // Add a Z->e+e- - HepMC::GenVertex * vZee = new HepMC::GenVertex; + HepMC::GenVertexPtr vZee = HepMC::newGenVertexPtr(); m_evt->add_vertex( vZee ); - vZee->add_particle_in( new HepMC::GenParticle( HLV_t( +7.29e+03, + vZee->add_particle_in( HepMC::newGenParticlePtr( HepMC::FourVector( +7.29e+03, +2.34e+04, +2.81e+05, +2.96e+05 ), 23, 2 ) ); - vZee->add_particle_out( new HepMC::GenParticle( HLV_t( +2.74e+04, + vZee->add_particle_out( HepMC::newGenParticlePtr( HepMC::FourVector( +2.74e+04, -1.83e+04, +4.70e+04, +5.74e+04 ), 11, 1 ) ); - vZee->add_particle_out( new HepMC::GenParticle( HLV_t( -2.01e+04, + vZee->add_particle_out( HepMC::newGenParticlePtr( HepMC::FourVector( -2.01e+04, +4.17e+04, +2.34e+05, +2.38e+05 ), @@ -198,32 +200,32 @@ public: // // Add a t->W+bgg - HepMC::GenVertex * vtWbgg = new HepMC::GenVertex; + HepMC::GenVertexPtr vtWbgg = HepMC::newGenVertexPtr(); m_evt->add_vertex( vtWbgg ); // top - vtWbgg->add_particle_in(new HepMC::GenParticle(HLV_t(-2.35e+05, + vtWbgg->add_particle_in(HepMC::newGenParticlePtr(HLV_t(-2.35e+05, +7.34e+04, +3.60e+04, +3.04e+05), 6, 3 ) ); // Wbgg - vtWbgg->add_particle_out(new HepMC::GenParticle(HLV_t(-1.09e+05, + vtWbgg->add_particle_out(HepMC::newGenParticlePtr(HLV_t(-1.09e+05, +6.99e+04, -3.86e+04, +1.57e+05), 24, 2 ) ); - vtWbgg->add_particle_out(new HepMC::GenParticle(HLV_t(-9.23e+04, + vtWbgg->add_particle_out(HepMC::newGenParticlePtr(HLV_t(-9.23e+04, +2.54e+03, +5.32e+04, +1.07e+05), 5, 2 ) ); - vtWbgg->add_particle_out(new HepMC::GenParticle(HLV_t(-4.76e+03, + vtWbgg->add_particle_out(HepMC::newGenParticlePtr(HLV_t(-4.76e+03, +6.72e+02, +2.90e+03, +5.62e+03), 21, 2 ) ); - vtWbgg->add_particle_out(new HepMC::GenParticle(HLV_t(-2.93e+04, + vtWbgg->add_particle_out(HepMC::newGenParticlePtr(HLV_t(-2.93e+04, +2.13e+02, +1.85e+04, +3.46e+04), @@ -457,14 +459,14 @@ public: /// Test full vtx void testFullVtx() { - HepMC::GenVertex * vtx = new HepMC::GenVertex; + HepMC::GenVertexPtr vtx = HepMC::newGenVertexPtr(); m_evt->add_vertex( vtx ); - vtx->add_particle_in( new HepMC::GenParticle( HLV_t( -2.45e+04, + vtx->add_particle_in( HepMC::newGenParticlePtr( HepMC::FourVector( -2.45e+04, +1.88e+04, -8.65e+05, +8.65e+05 ), 22, 3 ) ); - vtx->add_particle_out( new HepMC::GenParticle( HLV_t( -2.45e+04, + vtx->add_particle_out( HepMC::newGenParticlePtr( HepMC::FourVector( -2.45e+04, +1.88e+04, -8.65e+05, +8.65e+05 ), @@ -507,7 +509,7 @@ public: McVtxFilter filter; filter.setDecayPattern( "23 -> -11 + 11" ); - const HepMC::GenVertex * vtx = m_evt->barcode_to_vertex(m_bcZee); + auto vtx = HepMC::barcode_to_vertex(m_evt,m_bcZee); CPPUNIT_ASSERT( 0 != vtx ); CPPUNIT_ASSERT( filter.isAccepted(vtx) ); @@ -544,7 +546,7 @@ public: /// Test some vertices void testTopWbggVertices() { - const HepMC::GenVertex * vtx = m_evt->barcode_to_vertex(m_bcTopWbgg); + auto vtx = HepMC::barcode_to_vertex(m_evt,m_bcTopWbgg); CPPUNIT_ASSERT( 0 != vtx ); { @@ -573,20 +575,20 @@ public: void testWlnuVertices() { - HepMC::GenVertex * vtx = new HepMC::GenVertex; + HepMC::GenVertexPtr vtx = HepMC::newGenVertexPtr(); m_evt->add_vertex( vtx ); - vtx->add_particle_in( new HepMC::GenParticle( HLV_t( -6.76e+04, + vtx->add_particle_in( HepMC::newGenParticlePtr( HepMC::FourVector( -6.76e+04, +4.85e+03, -1.46e+03, +9.51e+04 ), -24, 2 ) ); - vtx->add_particle_out( new HepMC::GenParticle( HLV_t( -7.14e+04, + vtx->add_particle_out( HepMC::newGenParticlePtr( HepMC::FourVector( -7.14e+04, -6.17e+03, +1.67e+04, +7.36e+04 ), 13, 1 ) ); - vtx->add_particle_out( new HepMC::GenParticle( HLV_t( +3.75e+03, + vtx->add_particle_out( HepMC::newGenParticlePtr( HepMC::FourVector( +3.75e+03, +1.10e+04, -1.81e+04, +2.15e+04 ), @@ -625,45 +627,45 @@ GenVertex: -39 ID: 0 (X,cT):0 void testQuarkVertices() { // create a b->g+b vertex - HepMC::GenVertex * vtxgb = new HepMC::GenVertex; + HepMC::GenVertexPtr vtxgb = HepMC::newGenVertexPtr(); m_evt->add_vertex( vtxgb ); - vtxgb->add_particle_in( new HepMC::GenParticle( HLV_t( -3.21e+04, + vtxgb->add_particle_in( HepMC::newGenParticlePtr( HepMC::FourVector( -3.21e+04, -6.19e+03, +5.05e+04, +6.38e+04 ), -5, 2 ) ); - vtxgb->add_particle_out( new HepMC::GenParticle( HLV_t( -1.29e+04, + vtxgb->add_particle_out( HepMC::newGenParticlePtr( HepMC::FourVector( -1.29e+04, +1.12e+03, +3.50e+04, +3.77e+04 ), -5, 2 ) ); - vtxgb->add_particle_out( new HepMC::GenParticle( HLV_t( -1.92e+04, + vtxgb->add_particle_out( HepMC::newGenParticlePtr( HepMC::FourVector( -1.92e+04, -7.30e+03, +1.55e+04, +2.61e+04 ), 21, 2 ) ); // create a gg->b+bbar vertex - HepMC::GenVertex * vtxbb = new HepMC::GenVertex; + HepMC::GenVertex * vtxbb = HepMC::newGenVertexPtr(); m_evt->add_vertex( vtxbb ); - vtxbb->add_particle_in( new HepMC::GenParticle( HLV_t( +1.23e+04, + vtxbb->add_particle_in( HepMC::newGenParticlePtr( HepMC::FourVector( +1.23e+04, -4.79e+03, +6.52e+04, +6.65e+04 ), 21, 3 ) ); - vtxbb->add_particle_in( new HepMC::GenParticle( HLV_t( +1.14e+02, + vtxbb->add_particle_in( HepMC::newGenParticlePtr( HepMC::FourVector( +1.14e+02, +1.35e+04, -6.42e+04, +6.56e+04 ), 21, 3 ) ); - vtxbb->add_particle_out( new HepMC::GenParticle( HLV_t( +4.56e+04, + vtxbb->add_particle_out( HepMC::newGenParticlePtr( HepMC::FourVector( +4.56e+04, +1.53e+04, -5.08e+04, +7.01e+04 ), 5, 3 ) ); - vtxbb->add_particle_out( new HepMC::GenParticle( HLV_t( -3.32e+04, + vtxbb->add_particle_out( HepMC::newGenParticlePtr( HepMC::FourVector( -3.32e+04, -6.56e+03, +5.18e+04, +6.20e+04 ), @@ -703,15 +705,15 @@ GenVertex: -39 ID: 0 (X,cT):0 /// Test Stable particles (no end_vertex) void testStableParticle() { - HepMC::GenVertex * vtx = new HepMC::GenVertex; + HepMC::GenVertexPtr vtx = HepMC::newGenVertexPtr(); m_evt->add_vertex( vtx ); - vtx->add_particle_in( new HepMC::GenParticle( HLV_t( -2.45e+04, + vtx->add_particle_in( HepMC::newGenParticlePtr( HepMC::FourVector( -2.45e+04, +1.88e+04, -8.65e+05, +8.65e+05 ), 23, 3 ) ); HepMC::GenParticle * photon = 0; - photon = new HepMC::GenParticle( HLV_t( -2.45e+04, + photon = HepMC::newGenParticlePtr( HepMC::FourVector( -2.45e+04, +1.88e+04, -8.65e+05, +8.65e+05 ), diff --git a/Projects/AnalysisBase/externals.txt b/Projects/AnalysisBase/externals.txt index 042f340bf18b8af525eeaecc7d293a0ff82af286..e606c3417349cedc47466ac865c3d63a256c0b8a 100644 --- a/Projects/AnalysisBase/externals.txt +++ b/Projects/AnalysisBase/externals.txt @@ -6,4 +6,4 @@ # forbidden. # The version of atlas/atlasexternals to use: -AnalysisBaseExternalsVersion = 2.0.78 +AnalysisBaseExternalsVersion = 2.0.79 diff --git a/Projects/AnalysisBase/version.txt b/Projects/AnalysisBase/version.txt index c0b885324f71e1eac612d6a61c4f01370140ddca..44e031ba9ba43444a4a4413b5755e21a977f3470 100644 --- a/Projects/AnalysisBase/version.txt +++ b/Projects/AnalysisBase/version.txt @@ -1 +1 @@ -22.0.18 +22.2.0 diff --git a/Projects/AthDataQuality/externals.txt b/Projects/AthDataQuality/externals.txt index d94fd24c8789a0c18e1805194484772a1ec2be21..60a8e3eda802599a664f95b155f2f61cba1dadde 100644 --- a/Projects/AthDataQuality/externals.txt +++ b/Projects/AthDataQuality/externals.txt @@ -5,4 +5,4 @@ # an "origin/" prefix before it. For tags however this is explicitly # forbidden. -AtlasExternalsVersion = 2.0.78 +AtlasExternalsVersion = 2.0.79 diff --git a/Projects/AthGeneration/externals.txt b/Projects/AthGeneration/externals.txt index 9e3fc448673e196c76123f63660a76eb7c81e22d..8ca2061a961b362875deb87c560875042ab14c17 100644 --- a/Projects/AthGeneration/externals.txt +++ b/Projects/AthGeneration/externals.txt @@ -6,7 +6,7 @@ # forbidden. # The version of atlas/atlasexternals to use: -AthGenerationExternalsVersion = 2.0.78 +AthGenerationExternalsVersion = 2.0.79 # The version of atlas/Gaudi to use: -GaudiVersion = v34r0.004 +GaudiVersion = v34r0.005 diff --git a/Projects/AthSimulation/externals.txt b/Projects/AthSimulation/externals.txt index cc1aa0a4b08c847adeea2bd5f11f4035b750cc5a..5fa9b8f3cb86bd23a8094d5634e33d37903eeb00 100644 --- a/Projects/AthSimulation/externals.txt +++ b/Projects/AthSimulation/externals.txt @@ -6,7 +6,7 @@ # forbidden. # The version of atlas/atlasexternals to use: -AthSimulationExternalsVersion = 2.0.78 +AthSimulationExternalsVersion = 2.0.79 # The version of atlas/Gaudi to use: -GaudiVersion = v34r0.004 +GaudiVersion = v34r0.005 diff --git a/Projects/AthSimulation/package_filters.txt b/Projects/AthSimulation/package_filters.txt index 9e7ac7acb89a71d11350e45723d7d3445a65d656..717087ee48431922fed2224e5f36c3f75da10df4 100644 --- a/Projects/AthSimulation/package_filters.txt +++ b/Projects/AthSimulation/package_filters.txt @@ -144,6 +144,8 @@ + Event/xAOD/xAODCoreAthenaPool + Event/xAOD/xAODCoreCnv + Event/xAOD/xAODEventFormat ++ Event/xAOD/xAODEventFormatAthenaPool ++ Event/xAOD/xAODEventFormatCnv + Event/xAOD/xAODEventInfo + Event/xAOD/xAODEventInfoAthenaPool + Event/xAOD/xAODEventInfoCnv diff --git a/Projects/Athena/externals.txt b/Projects/Athena/externals.txt index 7955b584ecacbf2f3a4b1c076dd37ae7af813849..8186ac440d888a0fa3af5ffd32506eda8fee12c3 100644 --- a/Projects/Athena/externals.txt +++ b/Projects/Athena/externals.txt @@ -6,7 +6,7 @@ # forbidden. # The version of atlas/atlasexternals to use: -AthenaExternalsVersion = 2.0.78 +AthenaExternalsVersion = 2.0.79 # The version of atlas/Gaudi to use: -GaudiVersion = v34r0.004 +GaudiVersion = v34r0.005 diff --git a/Projects/Athena/package_filters.txt b/Projects/Athena/package_filters.txt index 9a10110a4df8d70642210e464d02531b5a417ef4..8779682027579b450902ff9b35b609de1301e998 100644 --- a/Projects/Athena/package_filters.txt +++ b/Projects/Athena/package_filters.txt @@ -38,7 +38,6 @@ - PhysicsAnalysis/D3PDTools/MultiDraw - PhysicsAnalysis/D3PDTools/SampleHandler - PhysicsAnalysis/ElectronPhotonID/PhotonEfficiencyCorrection -- PhysicsAnalysis/ElectronPhotonID/PhotonVertexSelection - PhysicsAnalysis/HiggsPhys/Run2/HZZ/Tools/ZMassConstraint - PhysicsAnalysis/JetPhys/SemileptonicCorr - PhysicsAnalysis/SUSYPhys/SUSYTools @@ -64,4 +63,3 @@ # Old packages that don't work with AthenaMT - LArCalorimeter/LArSim - PhysicsAnalysis/HiggsPhys/HSG5/HSG5DPDUtils - diff --git a/Projects/Athena/version.txt b/Projects/Athena/version.txt index c0b885324f71e1eac612d6a61c4f01370140ddca..e7efe3421ba225a99d20587239c44dea5f11e0db 100644 --- a/Projects/Athena/version.txt +++ b/Projects/Athena/version.txt @@ -1 +1 @@ -22.0.18 +22.0.19 diff --git a/Projects/VP1Light/externals.txt b/Projects/VP1Light/externals.txt index 52c304c08b24d3e66e59e3e191e71fba3b576148..8edf53d6d2e2d5dbd7445365e429e21cab74cde3 100644 --- a/Projects/VP1Light/externals.txt +++ b/Projects/VP1Light/externals.txt @@ -6,4 +6,4 @@ # forbidden. # The version of atlas/atlasexternals to use: -VP1LightExternalsVersion = 2.0.78 +VP1LightExternalsVersion = 2.0.79 diff --git a/Reconstruction/Jet/JetMonitoring/src/JetMonitoringAlg.cxx b/Reconstruction/Jet/JetMonitoring/src/JetMonitoringAlg.cxx index 7d4f2ef4ab7b28251dee4f1be06fdbb879787cd3..39b27484ecda7bf4027fa82a7e5dca16d1958e3c 100644 --- a/Reconstruction/Jet/JetMonitoring/src/JetMonitoringAlg.cxx +++ b/Reconstruction/Jet/JetMonitoring/src/JetMonitoringAlg.cxx @@ -52,7 +52,7 @@ StatusCode JetMonitoringAlg::fillHistograms( const EventContext& ctx ) const { const xAOD::Jet *trigjet = dynamic_cast<const xAOD::Jet*>(*j); tmpList.push_back( trigjet ); } - auto sort = [this] (const xAOD::Jet * j1, const xAOD::Jet * j2) {return j1->p4().Et() > j2->p4().Et(); } ; + auto sort = [] (const xAOD::Jet * j1, const xAOD::Jet * j2) {return j1->p4().Et() > j2->p4().Et(); } ; tmpList.sort( sort ); ConstDataVector< xAOD::JetContainer > tmpCont(SG::VIEW_ELEMENTS); for(const xAOD::Jet* jet : tmpList ) tmpCont.push_back(jet); diff --git a/Reconstruction/RecExample/RecExCommon/share/AnalysisCommon_topOptions.py b/Reconstruction/RecExample/RecExCommon/share/AnalysisCommon_topOptions.py index 016939583cb57e63861776be56b0fa272ec210a6..7c8d575f4ace775943f551ba0b7dc5bbdc1291e3 100644 --- a/Reconstruction/RecExample/RecExCommon/share/AnalysisCommon_topOptions.py +++ b/Reconstruction/RecExample/RecExCommon/share/AnalysisCommon_topOptions.py @@ -333,24 +333,6 @@ if rec.doFileMetaData(): #pdr.flag_domain('aod') -if rec.doWriteAOD() or rec.doWriteESD(): #For xAOD writing: - try: - if rec.doFileMetaData(): #needed to have xAOD readable outside athena - theApp.CreateSvc += [ "xAODMaker::EventFormatSvc" ] - if rec.doWriteAOD(): - StreamAOD_Augmented.AddMetaDataItem("xAOD::EventFormat#EventFormat") - pass - if rec.doWriteESD(): - StreamESD_Augmented.AddMetaDataItem("xAOD::EventFormat#EventFormat") - pass - pass - pass - except Exception: - treatException("Problem with extra attributes for xAOD output") - pass - pass - - ######### ## DPD ## ######### diff --git a/Reconstruction/RecExample/RecExCommon/share/RecExCommon_topOptions.py b/Reconstruction/RecExample/RecExCommon/share/RecExCommon_topOptions.py index 2fd95abd9dc0f196b3cbe862719f8a876ca36fd5..0fe51f4a91002c57d78daa3f30bb3c839dc79a3e 100644 --- a/Reconstruction/RecExample/RecExCommon/share/RecExCommon_topOptions.py +++ b/Reconstruction/RecExample/RecExCommon/share/RecExCommon_topOptions.py @@ -1407,21 +1407,6 @@ if rec.doAOD() or rec.doWriteAOD(): protectedInclude ("HIRecExample/heavyion_postOptionsAOD.py") -if rec.doWriteAOD() or rec.doWriteESD(): #For xAOD writing: - try: - if rec.doFileMetaData(): #needed to have xAOD readable outside athena - theApp.CreateSvc += [ "xAODMaker::EventFormatSvc" ] - if rec.doWriteAOD(): - StreamAOD_Augmented.AddMetaDataItem("xAOD::EventFormat#EventFormat") - pass - if rec.doWriteESD(): - StreamESD_Augmented.AddMetaDataItem("xAOD::EventFormat#EventFormat") - pass - pass - pass - except Exception: - treatException("Problem with extra attributes for xAOD output") - try: # event dumper at the very end if rec.doPyDump(): diff --git a/Reconstruction/RecJobTransforms/share/skeleton.ESDtoAOD_tf.py b/Reconstruction/RecJobTransforms/share/skeleton.ESDtoAOD_tf.py index b31ce24acd7b3ccd7142d9b9061cf437ae8df1ea..9603a7832b76ae046b34ede7d043f06305e61100 100644 --- a/Reconstruction/RecJobTransforms/share/skeleton.ESDtoAOD_tf.py +++ b/Reconstruction/RecJobTransforms/share/skeleton.ESDtoAOD_tf.py @@ -50,6 +50,13 @@ if hasattr(runArgs,"outputAODFile"): athenaCommonFlags.PoolAODOutput.set_Value_and_Lock( runArgs.outputAODFile ) # Begin temporary trigger block if TriggerFlags.doMT(): + # Lock DQ configuration to prevent downstream override + from AthenaMonitoring.DQMonFlags import DQMonFlags + print('DQMonFlags override') + if not rec.doTrigger(): + DQMonFlags.useTrigger.set_Value_and_Lock(False) + if DQMonFlags.useTrigger() and rec.doTrigger(): + DQMonFlags.useTrigger.set_Value_and_Lock(True) # Don't run any trigger - only pass the HLT contents from ESD to AOD from RecExConfig.RecAlgsFlags import recAlgs recAlgs.doTrigger.set_Value_and_Lock( False ) @@ -80,7 +87,6 @@ if hasattr(runArgs,"tmpAOD"): if hasattr(runArgs,"outputHIST_AOD_INTFile"): rec.doMonitoring.set_Value_and_Lock(True) - from AthenaMonitoring.DQMonFlags import DQMonFlags DQMonFlags.histogramFile.set_Value_and_Lock( runArgs.outputHIST_AOD_INTFile ) if hasattr(runArgs,"outputNTUP_BTAGFile"): @@ -154,9 +160,9 @@ if hasattr(runArgs,"outputDESDM_BEAMSPOTFile"): include("InDetBeamSpotFinder/DESDM_BEAMSPOTFragment.py") #========================================================== -# Use LZIB for compression of temporary outputs of AthenaMP +# Use ZLIB for compression of all temporary outputs #========================================================== -if hasattr(runArgs, "outputAODFile") and '_000' in runArgs.outputAODFile: +if hasattr(runArgs, "outputAODFile") and ('_000' in runArgs.outputAODFile or 'tmp.' in runArgs.outputAODFile): ServiceMgr.AthenaPoolCnvSvc.PoolAttributes += [ "DatabaseName = '" + athenaCommonFlags.PoolAODOutput()+ "'; COMPRESSION_ALGORITHM = '1'" ] ServiceMgr.AthenaPoolCnvSvc.PoolAttributes += [ "DatabaseName = '" + athenaCommonFlags.PoolAODOutput()+ "'; COMPRESSION_LEVEL = '1'" ] diff --git a/Reconstruction/RecJobTransforms/share/skeleton.RAWtoALL_tf.py b/Reconstruction/RecJobTransforms/share/skeleton.RAWtoALL_tf.py index 2cf64f9b22e42ad4ad70678bb72a7d4d5982521b..ccf0cbd7d94adf16801b90dafefa34c60aae0d2c 100644 --- a/Reconstruction/RecJobTransforms/share/skeleton.RAWtoALL_tf.py +++ b/Reconstruction/RecJobTransforms/share/skeleton.RAWtoALL_tf.py @@ -146,13 +146,13 @@ if hasattr(runArgs,"inputRDO_TRIGFile") and rec.doFileMetaData(): svcMgr.MetaDataSvc.MetaDataTools += [ ToolSvc.TriggerMenuMetaDataTool ] #========================================================== -# Use LZIB for compression of temporary outputs of AthenaMP +# Use ZLIB for compression of all temporary outputs #========================================================== -if hasattr(runArgs, "outputESDFile") and '_000' in runArgs.outputESDFile: +if hasattr(runArgs, "outputESDFile") and ('_000' in runArgs.outputESDFile or 'tmp.' in runArgs.outputESDFile): ServiceMgr.AthenaPoolCnvSvc.PoolAttributes += [ "DatabaseName = '" + athenaCommonFlags.PoolESDOutput()+ "'; COMPRESSION_ALGORITHM = '1'" ] ServiceMgr.AthenaPoolCnvSvc.PoolAttributes += [ "DatabaseName = '" + athenaCommonFlags.PoolESDOutput()+ "'; COMPRESSION_LEVEL = '1'" ] -if hasattr(runArgs, "outputAODFile") and '_000' in runArgs.outputAODFile: +if hasattr(runArgs, "outputAODFile") and ('_000' in runArgs.outputAODFile or 'tmp.' in runArgs.outputAODFile): ServiceMgr.AthenaPoolCnvSvc.PoolAttributes += [ "DatabaseName = '" + athenaCommonFlags.PoolAODOutput()+ "'; COMPRESSION_ALGORITHM = '1'" ] ServiceMgr.AthenaPoolCnvSvc.PoolAttributes += [ "DatabaseName = '" + athenaCommonFlags.PoolAODOutput()+ "'; COMPRESSION_LEVEL = '1'" ] diff --git a/Reconstruction/RecJobTransforms/share/skeleton.RAWtoESD_tf.py b/Reconstruction/RecJobTransforms/share/skeleton.RAWtoESD_tf.py index 5353261f7e73613e93e3a5cdb2b38f7ee399d416..62236d0468778075c2ef45b5ab401bf3a2f71e31 100644 --- a/Reconstruction/RecJobTransforms/share/skeleton.RAWtoESD_tf.py +++ b/Reconstruction/RecJobTransforms/share/skeleton.RAWtoESD_tf.py @@ -207,9 +207,9 @@ if hasattr(runArgs,"inputRDO_TRIGFile") and rec.doFileMetaData(): svcMgr.MetaDataSvc.MetaDataTools += [ ToolSvc.TriggerMenuMetaDataTool ] #========================================================== -# Use LZIB for compression of temporary outputs of AthenaMP +# Use ZLIB for compression of all temporary outputs #========================================================== -if hasattr(runArgs, "outputESDFile") and '_000' in runArgs.outputESDFile: +if hasattr(runArgs, "outputESDFile") and ('_000' in runArgs.outputESDFile or 'tmp.' in runArgs.outputESDFile): ServiceMgr.AthenaPoolCnvSvc.PoolAttributes += [ "DatabaseName = '" + athenaCommonFlags.PoolESDOutput()+ "'; COMPRESSION_ALGORITHM = '1'" ] ServiceMgr.AthenaPoolCnvSvc.PoolAttributes += [ "DatabaseName = '" + athenaCommonFlags.PoolESDOutput()+ "'; COMPRESSION_LEVEL = '1'" ] diff --git a/Reconstruction/RecoTools/ITrackToVertex/ITrackToVertex/ITrackToVertexAssociator.h b/Reconstruction/RecoTools/ITrackToVertex/ITrackToVertex/ITrackToVertexAssociator.h deleted file mode 100644 index ff13095c2b1f8ac4c21caaed80a7915e1b2eba3c..0000000000000000000000000000000000000000 --- a/Reconstruction/RecoTools/ITrackToVertex/ITrackToVertex/ITrackToVertexAssociator.h +++ /dev/null @@ -1,144 +0,0 @@ -/* - Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration -*/ - -/////////////////////////////////////////////////////////////////// -// ITrackToVertexAssociator.h, (c) ATLAS Detector software 2010 -/////////////////////////////////////////////////////////////////// - -#ifndef TRACKTOVERTEX_ITRACKTOVERTEXASSOCIATOR_H -#define TRACKTOVERTEX_ITRACKTOVERTEXASSOCIATOR_H - -// Gaudi -#include "GaudiKernel/IAlgTool.h" -// Trk -#include "TrkDetDescrUtils/SharedObject.h" - -// (Track/Neutral)Parameters -#include "TrkParameters/TrackParameters.h" -#include "TrkNeutralParameters/NeutralParameters.h" - -namespace Trk { - class Track; - class TrackParticleBase; - class VxCandidate; - -} - -namespace Reco { - - /** - @class TrackToVertexAssociation - -- this is a container class with reference counting for the private members - NEVER DELETE A RETURN OBJECT ! - */ - class TrackToVertexAssociation { - public : - /** Constructor */ - TrackToVertexAssociation(const Trk::VxCandidate* vertex, - const Amg::Vector3D& vertexPositionBLFrame, - Trk::SharedObject<const Amg::Vector2D> impactParameterBLFrame, - Trk::SharedObject<const Amg::MatrixX> covarianceMatrixBlFrame - ) : - m_vertex(vertex), - m_impactParameterBLFrame(impactParameterBLFrame), - m_covarianceMatrixBlFrame(covarianceMatrixBlFrame) - { - m_longitudinalDistance = (*impactParameterBLFrame)[Trk::z0] - vertexPositionBLFrame.z(); - m_transverseDistance = (*impactParameterBLFrame)[Trk::d0] - vertexPositionBLFrame.perp(); - } - - //** Destructor */ - ~TrackToVertexAssociation(){} - - // Copy constructor - TrackToVertexAssociation(const TrackToVertexAssociation& ttva) : - m_vertex(ttva.m_vertex), - m_impactParameterBLFrame(ttva.m_impactParameterBLFrame), - m_covarianceMatrixBlFrame(ttva.m_covarianceMatrixBlFrame), - m_longitudinalDistance(ttva.m_longitudinalDistance), - m_transverseDistance(ttva.m_transverseDistance) - {} - - // Assignment operator - TrackToVertexAssociation& operator=(const TrackToVertexAssociation& ttva ){ - if (&ttva != this){ - m_vertex = ttva.m_vertex; - m_impactParameterBLFrame = ttva.m_impactParameterBLFrame; - m_covarianceMatrixBlFrame = ttva.m_covarianceMatrixBlFrame; - m_longitudinalDistance = ttva.m_longitudinalDistance; - m_transverseDistance = ttva.m_transverseDistance; - } - return (*this); - } - - // define the smaller operator for this object - bool operator<(const TrackToVertexAssociation& b) const - { return m_longitudinalDistance*m_longitudinalDistance < b.longitudinalDistance()*b.longitudinalDistance(); } - - // Return the vertex -- original frame - const Trk::VxCandidate* vertex() const { return m_vertex; } - - // Return the local position - const Amg::Vector2D* impactParameterBeamLineFrame() const { return (m_impactParameterBLFrame.get()); }; - - // Return the Covariance Matrix* - const Amg::MatrixX* covarianceMatrixBeamLineFrame() const { return (m_covarianceMatrixBlFrame.get()); } - - // distances (1) : transverse - double transverseDistance() const { return m_transverseDistance; } - - // distances (2) : longitudinal - double longitudinalDistance() const { return m_longitudinalDistance; } - - - private : - // Default constructor is private - TrackToVertexAssociation() {}; - - // the vertices in original frame in beam-line frame - const Trk::VxCandidate* m_vertex; - // the local position and error to the BL, to do : add Covariance matrix - Trk::SharedObject<const Amg::Vector2D> m_impactParameterBLFrame; - Trk::SharedObject<const Amg::MatrixX> m_covarianceMatrixBlFrame; - // for the sorting - double m_longitudinalDistance; - double m_transverseDistance; - }; - - - static const InterfaceID IID_ITrackToVertexAssociator("ITrackToVertexAssociator", 1, 0); - - /** - @class ITrackToVertexAssociator - - @author Andreas.Salzburger@cern.ch - */ - - - class ITrackToVertexAssociator : virtual public IAlgTool { - - public: - /** Virtual destructor */ - virtual ~ITrackToVertexAssociator(){}; - - /** AlgTool interface methods */ - static const InterfaceID& interfaceID() { return IID_ITrackToVertexAssociator; }; - - /** Interface method for use with TrackParticle - AOD */ - virtual const std::vector<TrackToVertexAssociation>* associateTrack ATLAS_NOT_THREAD_SAFE (const Trk::TrackParticleBase& part) const = 0; - - /** Interface method for use with Track - ESD */ - virtual const std::vector<TrackToVertexAssociation>* associateTrack ATLAS_NOT_THREAD_SAFE (const Trk::Track& trk) const = 0; - - /** Interface method for use with charged TPs - work horse */ - virtual const std::vector<TrackToVertexAssociation>* associateTrack ATLAS_NOT_THREAD_SAFE (const Trk::TrackParameters& pars) const = 0; - - /** Interface method for use with neutral TPs */ - virtual const std::vector<TrackToVertexAssociation>* associateTrack ATLAS_NOT_THREAD_SAFE (const Trk::NeutralParameters& pars) const = 0; - }; - -} - -#endif // TRACKTOVERTEX_ITRACKTOVERTEXASSOCIATOR_H - diff --git a/Reconstruction/RecoTools/TrackToCalo/src/ParticleCaloClusterAssociationTool.h b/Reconstruction/RecoTools/TrackToCalo/src/ParticleCaloClusterAssociationTool.h index 6c0afda2355607f11b715a00c5d012688e501931..13ec089aa7d2bb95e492a491a130b700df18c758 100644 --- a/Reconstruction/RecoTools/TrackToCalo/src/ParticleCaloClusterAssociationTool.h +++ b/Reconstruction/RecoTools/TrackToCalo/src/ParticleCaloClusterAssociationTool.h @@ -32,7 +32,7 @@ namespace Rec { * as it still uses the old style caching * to be updated if needed */ - class ATLAS_NOT_THREAD_SAFE ParticleCaloClusterAssociationTool : + class ParticleCaloClusterAssociationTool : virtual public IParticleCaloClusterAssociationTool, public AthAlgTool { public: diff --git a/Reconstruction/RecoTools/TrackToVertex/TrackToVertex/TrackToVertexAssociator.h b/Reconstruction/RecoTools/TrackToVertex/TrackToVertex/TrackToVertexAssociator.h deleted file mode 100644 index 69c01f9cd08ae4b7c58a1a8fd74216bd6f4d1f59..0000000000000000000000000000000000000000 --- a/Reconstruction/RecoTools/TrackToVertex/TrackToVertex/TrackToVertexAssociator.h +++ /dev/null @@ -1,172 +0,0 @@ -///////////////////////// -*- C++ -*- ///////////////////////////// - -/* - Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration -*/ - -// TrackToVertexAssociator.h -// Header file for class TrackToVertexAssociator -// Author: Andreas.Salzburger -at- cern.ch -/////////////////////////////////////////////////////////////////// -#ifndef TRACKTOVERTEX_TRACKTOVERTEXASSOCIATOR_H -#define TRACKTOVERTEX_TRACKTOVERTEXASSOCIATOR_H 1 - -// STL includes -#include <string> - -// FrameWork includes -#include "AthenaBaseComps/AthAlgTool.h" -#include "GaudiKernel/ServiceHandle.h" -#include "GaudiKernel/ToolHandle.h" -#include "GaudiKernel/IIncidentListener.h" - -// ITrackToVertex includes -#include "ITrackToVertex/ITrackToVertexAssociator.h" - -// Tracking includes -#include "TrkEventPrimitives/ParticleHypothesis.h" -#include "TrkExInterfaces/IExtrapolator.h" -#include "TrkParameters/TrackParameters.h" -#include "TrkNeutralParameters/NeutralParameters.h" -#include "GeoPrimitives/GeoPrimitives.h" -#include "EventPrimitives/EventPrimitives.h" -#include "BeamSpotConditionsData/BeamSpotData.h" -#include "CxxUtils/checker_macros.h" - -// Forward declaration -class StoreGateSvc; -class IIncidentSvc; -class VxContainer; - -namespace Trk { - class Track; - class TrackParticleBase; - class StraightLineSurface; - class StraightLineSurface; -} - - -namespace Reco { - - class ATLAS_NOT_THREAD_SAFE TrackToVertexAssociator - : virtual public ITrackToVertexAssociator, - public AthAlgTool, virtual public IIncidentListener { - - /////////////////////////////////////////////////////////////////// - // Public methods: - /////////////////////////////////////////////////////////////////// - public: - - // Copy constructor: - - /// Constructor with parameters: - TrackToVertexAssociator( const std::string& type, - const std::string& name, - const IInterface* parent ); - - /// Destructor: - virtual ~TrackToVertexAssociator(); - - // Athena algtool's Hooks - StatusCode initialize(); - StatusCode finalize(); - - /** handle for incident service */ - void handle(const Incident& inc) ; - - /** Interface method for use with TrackParticle - AOD */ - const std::vector<TrackToVertexAssociation>* associateTrack ATLAS_NOT_THREAD_SAFE (const Trk::TrackParticleBase& part) const; - - /** Interface method for use with Track - ESD */ - const std::vector<TrackToVertexAssociation>* associateTrack ATLAS_NOT_THREAD_SAFE (const Trk::Track& trk) const; - - /** Interface method for use with ParametersBase - parameters */ - const std::vector<TrackToVertexAssociation>* associateTrack ATLAS_NOT_THREAD_SAFE (const Trk::TrackParameters& pbase) const; - - /** Interface method for use with neutral TPs */ - const std::vector<TrackToVertexAssociation>* associateTrack ATLAS_NOT_THREAD_SAFE (const Trk::NeutralParameters& pars) const; - private: - - template < class T > const std::vector<TrackToVertexAssociation>* runAssociation ATLAS_NOT_THREAD_SAFE (const T& input) const; - - // Default constructor: - TrackToVertexAssociator(); - - // private methods - StatusCode updateCache ATLAS_NOT_THREAD_SAFE () const; - StatusCode cleanCache ATLAS_NOT_THREAD_SAFE () const; - - // Services - ServiceHandle<StoreGateSvc> m_storeGate; //!< Event store - SG::ReadCondHandleKey<InDet::BeamSpotData> m_beamSpotKey { this, "BeamSpotKey", "BeamSpotData", "SG key for beam spot" }; //!< BeamCondSvc to get the beam parameters - ServiceHandle<IIncidentSvc> m_incidentSvc; //!< IncidentSvc to catch begin of event and end of envent - - // Tools - ToolHandle<Trk::IExtrapolator> m_extrapolator; //!< Extrapolation engine for estimation of the impact - - std::string m_primaryVertexContainer; - mutable const VxContainer* m_primaryVertices; - mutable std::vector<const Trk::VxCandidate*> m_primaryVerticesWoDummy; - mutable std::vector<Amg::Vector3D> m_primaryVerticesBLFrame; - - mutable Trk::StraightLineSurface* m_beamLine; - bool m_particleHypo; - double m_cut; - - - }; - - /////////////////////////////////////////////////////////////////// - // Inline methods: - /////////////////////////////////////////////////////////////////// - - /** Interface method for use with ParametersBase - work horse */ - template < class T > const std::vector<TrackToVertexAssociation>* TrackToVertexAssociator::runAssociation(const T& tinput) const - { - if (!m_primaryVerticesBLFrame.size() && updateCache().isFailure()){ - ATH_MSG_DEBUG("No primary vertices for this event, return 0."); - return 0; - } - // extrapolate to the beam line, can we use a data pool for this ? - const Trk::TrackParameters* ataLine = m_extrapolator->extrapolate(tinput,*m_beamLine,Trk::anyDirection,(Trk::ParticleHypothesis)m_particleHypo); - if (!ataLine) { - ATH_MSG_DEBUG("Extrapolation to beamline did not succeed, return 0."); - return 0; - } - - Trk::SharedObject<const Amg::Vector2D> localImpactParameter(new Amg::Vector2D(ataLine->localPosition())); - Amg::MatrixX* cov = 0; - if (ataLine->covariance()){ - // d0, z0 - double covD0 = (*ataLine->covariance())(Trk::d0,Trk::d0); - double covZ0 = (*ataLine->covariance())(Trk::z0,Trk::z0); - // covariance matrix - cov = new Amg::MatrixX(2,2); - cov->setZero(); - (*cov)(Trk::d0,Trk::d0) = covD0; - (*cov)(Trk::z0,Trk::z0) = covZ0; - } - Trk::SharedObject<const Amg::MatrixX> localCovariance(cov); - // create the return vector and reserve the maximum you could possibly need - std::vector< Reco::TrackToVertexAssociation>* tvaVector = new std::vector< Reco::TrackToVertexAssociation >(); - tvaVector->reserve(m_primaryVerticesBLFrame.size()); - // loop and build the associations - std::vector<Amg::Vector3D>::const_iterator vBLIter = m_primaryVerticesBLFrame.begin(); - std::vector<Amg::Vector3D>::const_iterator vBLIterEnd = m_primaryVerticesBLFrame.end(); - std::vector<const Trk::VxCandidate*>::const_iterator vIter = m_primaryVerticesWoDummy.begin(); - std::vector<const Trk::VxCandidate*>::const_iterator vIterEnd = m_primaryVerticesWoDummy.end(); - // loop over and build the TrackToVertex associations - for ( ; vBLIter!= vBLIterEnd && vIter != vIterEnd; ++vBLIter, ++vIter ) - tvaVector->push_back(Reco::TrackToVertexAssociation(*vIter,*vBLIter,localImpactParameter,localCovariance)); - // memory cleanup - delete ataLine; - // sort the vector before returning, using operator< defined for TrackToVertexAssociation - std::sort(tvaVector->begin(),tvaVector->end()); - // return what you have - return tvaVector; - } - - -} - -#endif //> !TRACKTOVERTEX_TRACKTOVERTEXASSOCIATOR_H diff --git a/Reconstruction/RecoTools/TrackToVertex/src/TrackToVertexAssociator.cxx b/Reconstruction/RecoTools/TrackToVertex/src/TrackToVertexAssociator.cxx deleted file mode 100644 index 03b295970ba3817a7bd8c5177a8337779fa99f90..0000000000000000000000000000000000000000 --- a/Reconstruction/RecoTools/TrackToVertex/src/TrackToVertexAssociator.cxx +++ /dev/null @@ -1,170 +0,0 @@ -///////////////////////// -*- C++ -*- ///////////////////////////// - -/* - Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration -*/ - -// TrackToVertexAssociator.cxx -// Implementation file for class TrackToVertexAssociator -/////////////////////////////////////////////////////////////////// - -// TrackToVertex includes -#include "TrackToVertex/TrackToVertexAssociator.h" -// Tracking includes -#include "TrkTrack/Track.h" -#include "TrkParticleBase/TrackParticleBase.h" -#include "TrkSurfaces/StraightLineSurface.h" -#include "VxVertex/VxContainer.h" -#include "VxVertex/VxCandidate.h" - -//#include "CLHEP/Units/SystemOfUnits.h" -// StoreGate -#include "StoreGate/StoreGateSvc.h" - - - -///////////////// -// Constructors -//////////////// -Reco::TrackToVertexAssociator::TrackToVertexAssociator( const std::string& type, - const std::string& name, - const IInterface* parent ) : - ::AthAlgTool ( type, name, parent ), - m_storeGate( "StoreGateSvc", name ), - m_incidentSvc("IncidentSvc", name), - m_extrapolator("Trk::Extrapolator/AtlasExtrapolator"), - m_primaryVertexContainer("VxPrimaryVertices"), - m_primaryVertices(nullptr), - m_beamLine(nullptr), - m_particleHypo(2), - m_cut(0) -{ - declareInterface< Reco::ITrackToVertexAssociator >(this); - // Property declaration - // Services - declareProperty( "EventStore", m_storeGate ); - declareProperty( "IncidentService", m_incidentSvc ); - // Tools - declareProperty( "Extrapolator", m_extrapolator ); - declareProperty( "ParticleHypothesis", m_particleHypo ); - // input / output vertex collection - declareProperty( "PrimaryVertexCollection", m_primaryVertexContainer); - -} - -// Destructor -/////////////// -Reco::TrackToVertexAssociator::~TrackToVertexAssociator() -{} - -// Athena algtool's Hooks -//////////////////////////// -StatusCode Reco::TrackToVertexAssociator::initialize() -{ - if (m_storeGate.retrieve().isFailure()){ - ATH_MSG_WARNING("Can not retrieve " << m_storeGate << ". Exiting."); - return StatusCode::FAILURE; - } - ATH_CHECK(m_beamSpotKey.initialize()); - if (m_incidentSvc.retrieve().isFailure()){ - ATH_MSG_WARNING("Can not retrieve " << m_incidentSvc << ". Exiting."); - return StatusCode::FAILURE; - } - // register to the incident service: EndEvent needed for memory cleanup - m_incidentSvc->addListener( this, IncidentType::EndEvent ); - - return StatusCode::SUCCESS; -} - -void Reco::TrackToVertexAssociator::handle(const Incident& inc) { - - if ( inc.type() == IncidentType::EndEvent ){ - ATH_MSG_VERBOSE("'EndEvent' incident caught. Refreshing Cache."); - if (cleanCache().isFailure()) - ATH_MSG_WARNING("Failure triggered while refreshing Cache."); - } -} - -/** Interface method for use with TrackParticle - AOD - hiding templated method*/ -const std::vector<Reco::TrackToVertexAssociation>* Reco::TrackToVertexAssociator::associateTrack(const Trk::TrackParticleBase& /*particle*/) const -{ - ATH_MSG_WARNING("Method not implemented"); - return nullptr; - //return runAssociation<Trk::TrackParticleBase>(particle); -} - -/** Interface method for use with Track - ESD - hiding templated method*/ -const std::vector<Reco::TrackToVertexAssociation>* Reco::TrackToVertexAssociator::associateTrack(const Trk::Track& track) const -{ - return runAssociation<Trk::Track>(track); -} - -/** Interface method for use with Parameters - ESD/AOD - hiding templated method*/ -const std::vector<Reco::TrackToVertexAssociation>* Reco::TrackToVertexAssociator::associateTrack(const Trk::TrackParameters& parameters) const -{ - return runAssociation<Trk::TrackParameters>(parameters); -} - - -/** Interface method for use with TrackParticle - AOD - hiding templated method*/ -const std::vector<Reco::TrackToVertexAssociation>* Reco::TrackToVertexAssociator::associateTrack(const Trk::NeutralParameters& /*particle*/) const -{ - ATH_MSG_WARNING("Method not implemented"); - return nullptr; - //return runAssociation<Trk::NeutralParameters>(particle); -} - -StatusCode Reco::TrackToVertexAssociator::cleanCache() const -{ - // clean out what you have - // delete the beam line - delete m_beamLine; m_beamLine = nullptr; - // set primary vertices to 0 - memory handled by storegate - m_primaryVertices = nullptr; - m_primaryVerticesWoDummy.clear(); - m_primaryVerticesBLFrame.clear(); - // return SUCCESS - return StatusCode::SUCCESS; -} - -StatusCode Reco::TrackToVertexAssociator::updateCache() const -{ - - if (m_storeGate->retrieve(m_primaryVertices, m_primaryVertexContainer).isFailure() || m_primaryVertices->size() == 1){ - ATH_MSG_DEBUG("Could not retrieve Primary Vertex Container, or only dummy vertex in event. Doing nothing."); - return StatusCode::RECOVERABLE; - } - - - delete m_beamLine; m_beamLine = nullptr; - - // get the transform - SG::ReadCondHandle<InDet::BeamSpotData> beamSpotHandle { m_beamSpotKey }; - Amg::Transform3D* beamTransform = new Amg::Transform3D(Amg::AngleAxis3D(beamSpotHandle->beamTilt(0),Amg::Vector3D(0.,1.,0.))); - (*beamTransform) *= Amg::AngleAxis3D(beamSpotHandle->beamTilt(1),Amg::Vector3D(1.,0.,0.)); - beamTransform->pretranslate(beamSpotHandle->beamPos()); - m_beamLine = new Trk::StraightLineSurface(beamTransform); - - - Amg::Transform3D invBeamTransform = beamTransform->inverse(); - // fill in the Vertices w/o dummy vertex and transform the position - m_primaryVerticesWoDummy.reserve(m_primaryVertices->size()); - m_primaryVerticesBLFrame.reserve(m_primaryVertices->size()); - VxContainer::const_iterator vxIter = m_primaryVertices->begin(); - VxContainer::const_iterator vxIterEnd = m_primaryVertices->end(); - for ( ; vxIter != vxIterEnd-1; ++vxIter ){ - m_primaryVerticesWoDummy.push_back(*vxIter); - m_primaryVerticesBLFrame.push_back(invBeamTransform*((*vxIter)->recVertex().position())); - } - return StatusCode::SUCCESS; -} - - -StatusCode Reco::TrackToVertexAssociator::finalize() -{ - return StatusCode::SUCCESS; -} - - - - diff --git a/Reconstruction/RecoTools/TrackToVertex/src/components/TrackToVertex_entries.cxx b/Reconstruction/RecoTools/TrackToVertex/src/components/TrackToVertex_entries.cxx index 3ccfa2fd0c2971af3bb663168daaa778bec34efe..eb0ef654ec78261091c1fb93209a781d7e242768 100644 --- a/Reconstruction/RecoTools/TrackToVertex/src/components/TrackToVertex_entries.cxx +++ b/Reconstruction/RecoTools/TrackToVertex/src/components/TrackToVertex_entries.cxx @@ -1,8 +1,6 @@ #include "TrackToVertex/TrackToVertex.h" -#include "TrackToVertex/TrackToVertexAssociator.h" using namespace Reco; DECLARE_COMPONENT( TrackToVertex ) -DECLARE_COMPONENT( TrackToVertexAssociator ) diff --git a/Reconstruction/TrackCaloClusterRec/TrackCaloClusterRecAlgs/CMakeLists.txt b/Reconstruction/TrackCaloClusterRec/TrackCaloClusterRecAlgs/CMakeLists.txt deleted file mode 100644 index f8c76278261675a6a7c5e74e526d54db3bb4d67e..0000000000000000000000000000000000000000 --- a/Reconstruction/TrackCaloClusterRec/TrackCaloClusterRecAlgs/CMakeLists.txt +++ /dev/null @@ -1,30 +0,0 @@ -################################################################################ -# Package: TrackCaloClusterRecAlgs -################################################################################ - -# Declare the package name: -atlas_subdir( TrackCaloClusterRecAlgs ) - -# Declare the package's dependencies: -atlas_depends_on_subdirs( PRIVATE - Control/AthenaBaseComps - Tracking/TrkEvent/TrkParametersIdentificationHelpers - DetectorDescription/AtlasDetDescr - PUBLIC - GaudiKernel - Event/xAOD/xAODBase - Event/xAOD/xAODTracking - Event/xAOD/xAODAssociations - Event/xAOD/xAODPFlow - Reconstruction/TrackCaloClusterRec/TrackCaloClusterRecTools) - -find_package( FastJet ) -find_package( FastJetContrib ) - -# Component(s) in the package: -atlas_add_component( TrackCaloClusterRecAlgs - src/*.cxx - src/components/*.cxx - INCLUDE_DIRS ${FASTJET_INCLUDE_DIRS} ${FASTJETCONTRIB_INCLUDE_DIRS} - LINK_LIBRARIES ${FASTJET_LIBRARIES} ${FASTJETCONTRIB_LIBRARIES} AthenaBaseComps GaudiKernel AtlasDetDescr xAODBase - xAODTracking xAODAssociations xAODPFlow TrackCaloClusterRecToolsLib TrkParametersIdentificationHelpers ) diff --git a/Reconstruction/TrackCaloClusterRec/TrackCaloClusterRecAlgs/TrackCaloClusterRecAlgs/TrackCaloClusterRecAlg.h b/Reconstruction/TrackCaloClusterRec/TrackCaloClusterRecAlgs/TrackCaloClusterRecAlgs/TrackCaloClusterRecAlg.h deleted file mode 100644 index b1a19fc3145abca0e90e79f26c1d54ceab6d1717..0000000000000000000000000000000000000000 --- a/Reconstruction/TrackCaloClusterRec/TrackCaloClusterRecAlgs/TrackCaloClusterRecAlgs/TrackCaloClusterRecAlg.h +++ /dev/null @@ -1,62 +0,0 @@ -/* - Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration -*/ -#ifndef TRACKCALOCLUSTERREC_TRACKCALOCLUSTERRECALGS_TRACKCALOCLUSTERRECALG_H -#define TRACKCALOCLUSTERREC_TRACKCALOCLUSTERRECALGS_TRACKCALOCLUSTERRECALG_H - -#include "AthenaBaseComps/AthAlgorithm.h" -#include "GaudiKernel/ToolHandle.h" //included under assumption you'll want to use some tools! Remove if you don't! -#include "xAODBase/IParticle.h" -#include "xAODPFlow/TrackCaloClusterContainer.h" -#include "xAODTracking/TrackParticleContainer.h" - -#include "TrackCaloClusterRecTools/TrackCaloClusterWeightsTool.h" -#include "TrackCaloClusterRecTools/TrackCaloClusterCreatorTool.h" - -class TrackCaloClusterRecAlg: public ::AthAlgorithm { -public: - TrackCaloClusterRecAlg( const std::string& name, ISvcLocator* pSvcLocator ); - virtual ~TrackCaloClusterRecAlg(); - - virtual StatusCode initialize(); - virtual StatusCode execute(); - virtual StatusCode finalize(); - - /// Definition of the 4-momentum type. - typedef xAOD::IParticle::FourMom_t FourMom_t; - -private: - - // Get a data container; implementation at end of this header file - template<class T> const T* getContainer( const std::string & containerName); - - /// fill the maps - void fillMaps(std::multimap <const xAOD::CaloCluster*, const xAOD::TrackParticle*>& clusterToTracksMap, std::map <const xAOD::TrackParticle*, FourMom_t>& TrackTotalClusterPt, std::map <const xAOD::CaloCluster*, FourMom_t>& clusterToTracksWeightMap ); - - ToolHandle <TrackCaloClusterWeightsTool> m_trackCaloClusterWeightsTool; - ToolHandle <TrackCaloClusterCreatorTool> m_trackCaloClusterCreatorTool; - - ///TrackParticle container's name - std::string m_trkParticleName; - - ///Output Collection container's name postfix - std::string m_outputPostFix; - - ///Cluster Collection container - std::string m_caloClusters; - - ///Cluster Collection container - std::string m_trackCaloClusterContainerName; - -}; - -template<class T> -inline const T* TrackCaloClusterRecAlg::getContainer(const std::string & containerName){ - const T * ptr = evtStore()->retrieve< const T >( containerName ); - if (!ptr) { - ATH_MSG_WARNING("Container '"<<containerName<<"' could not be retrieved"); - } - return ptr; -} - -#endif //> !TRACKCALOCLUSTERREC_TRACKCALOCLUSTERRECALGS_TRACKCALOCLUSTERRECALG_H diff --git a/Reconstruction/TrackCaloClusterRec/TrackCaloClusterRecAlgs/share/TrackCaloClusterReco_Standalone.py b/Reconstruction/TrackCaloClusterRec/TrackCaloClusterRecAlgs/share/TrackCaloClusterReco_Standalone.py deleted file mode 100644 index 36128571be535330f95fb933b34ec4ee5c8c75a8..0000000000000000000000000000000000000000 --- a/Reconstruction/TrackCaloClusterRec/TrackCaloClusterRecAlgs/share/TrackCaloClusterReco_Standalone.py +++ /dev/null @@ -1,552 +0,0 @@ -import AthenaPoolCnvSvc.ReadAthenaPool - -from AthenaCommon import CfgMgr - -InputFiles = ["/eos/user/r/rjansky/TCCTestFiles/mc15_13TeV.301282.Pythia8EvtGen_A14NNPDF23LO_Wprime_WZqqqq_m4000.merge.AOD.e3743_s2608_s2183_r7772_r7676/AOD.08110078._000001.pool.root.1"] - -svcMgr.EventSelector.InputCollections = InputFiles - -# Name = Sample -Name = "WprimeCovMatch" - -from AthenaCommon.AthenaCommonFlags import athenaCommonFlags -athenaCommonFlags.FilesInput = svcMgr.EventSelector.InputCollections - -from AthenaCommon.GlobalFlags import globalflags -DetDescrVersion = 'ATLAS-R2-2015-03-01-00' -globalflags.DetDescrVersion = DetDescrVersion - -from IOVDbSvc.CondDB import conddb -conddb.setGlobalTag('OFLCOND-MC15c-SDR-09') - -print "globalflags.DetDescrVersion = ", globalflags.DetDescrVersion -# Set up geometry and BField -include("RecExCond/AllDet_detDescr.py") - -from JetRec.JetRecConf import JetAlgorithm -#from JetRecTools.JetRecToolsConf import JetConstituentModSequence, CaloClusterConstituentsOrigin, ClusterTimeCutTool -from JetRecTools.JetRecToolsConf import JetConstituentModSequence, CaloClusterConstituentsOrigin -ccco = CaloClusterConstituentsOrigin("JetConstit_LCOrigin") -ToolSvc += ccco - -#ctct = ClusterTimeCutTool("JetConstit_Timecut") -#ToolSvc += ctct - -PFSequence = JetConstituentModSequence("JetConstitSeq_LCOriginAndTime", - InputContainer = "CaloCalTopoClusters", - OutputContainer = "TimedCaloCalTopoClusters", - InputType = "CaloCluster", - Modifiers = [ccco], - SaveAsShallow = False - ) -ToolSvc += PFSequence - -#Configure the extrapolator -from TrkExTools.AtlasExtrapolator import AtlasExtrapolator -theAtlasExtrapolator=AtlasExtrapolator("AtlasExtrapolator") -ToolSvc += theAtlasExtrapolator - -from TrackCaloClusterRecTools.TrackCaloClusterRecToolsConf import ParticleToCaloExtrapolationTool -ParticleToCaloExtrapolationTool = ParticleToCaloExtrapolationTool(name = "ParticleToCaloExtrapolationTool", - Extrapolator = theAtlasExtrapolator, - ParticleType = "pion" ) -#ParticleToCaloExtrapolationTool.OutputLevel = DEBUG -ToolSvc += ParticleToCaloExtrapolationTool - -print ParticleToCaloExtrapolationTool - -from ParticlesInConeTools.ParticlesInConeToolsConf import xAOD__CaloClustersInConeTool -CaloClustersInCone = xAOD__CaloClustersInConeTool(name = "CaloClustersInCone", - CaloClusterLocation = "TimedCaloCalTopoClusters") -# CaloClustersInCone.OutputLevel = DEBUG -ToolSvc += CaloClustersInCone - -print CaloClustersInCone - -from TrackToCalo.TrackToCaloConf import Rec__ParticleCaloClusterAssociationTool -ParticleCaloCellAssociation = Rec__ParticleCaloClusterAssociationTool(name = "ParticleCaloCellAssociationInDet", - ParticleCaloExtensionTool = ParticleToCaloExtrapolationTool, - - CaloClusterLocation = "TimedCaloCalTopoClusters", - ClustersInConeTool = CaloClustersInCone, - ConeSize = 0.1, - UseCovariance = True ) -ParticleCaloCellAssociation.OutputLevel = DEBUG -ToolSvc+=ParticleCaloCellAssociation -print ParticleCaloCellAssociation - -# Access the algorithm sequence: -from AthenaCommon.AlgSequence import AlgSequence -topSequence = AlgSequence() - -# Add the algorithm. -jetalg = JetAlgorithm("JetAlg_OriginAndTime") -jetalg.OutputLevel = INFO -jetalg.Tools += [PFSequence] -topSequence += jetalg - -from TrackParticleAssociationAlgs.TrackParticleAssociationAlgsConf import TrackParticleClusterAssociationAlg -TrackParticleClusterAssociation = TrackParticleClusterAssociationAlg(name = "TrackParticleClusterAssociationInDet", - ParticleCaloClusterAssociationTool = ParticleCaloCellAssociation, - TrackParticleContainerName = "InDetTrackParticles", - PtCut = 400., - OutputCollectionPostFix = "Test", - CaloClusterLocation = "TimedCaloCalTopoClusters") -# TrackParticleClusterAssociation.OutputLevel = DEBUG -topSequence += TrackParticleClusterAssociation - -print TrackParticleClusterAssociation - -from TrackCaloClusterRecTools.TrackCaloClusterRecToolsConf import TrackCaloClusterWeightsTool -TrackCaloClusterWeights = TrackCaloClusterWeightsTool(name = "TrackCaloClusterWeights" ) -# TrackCaloClusterWeights.OutputLevel = VERBOSE -ToolSvc+=TrackCaloClusterWeights -print TrackCaloClusterWeights - -trackvertexassotool=CfgMgr.CP__TrackVertexAssociationTool("TrackVertexAssociationTool", WorkingPoint="Nominal") -ToolSvc+=trackvertexassotool - -from JetRecTools.JetRecToolsConf import TrackVertexAssociationTool -jettva = TrackVertexAssociationTool( name = "tvassoc", - TrackParticleContainer = "InDetTrackParticles", - TrackVertexAssociation = "JetTrackVtxAssoc", - VertexContainer = "PrimaryVertices", - TrackVertexAssoTool = trackvertexassotool - ) -ToolSvc+=jettva -print jettva - -#from TrackCaloClusterRecTools.TrackCaloClusterRecToolsConf import ClusterFilterTool -#clusterfiltertool = ClusterFilterTool(name = "clusterfiltertool", -# LooseTrackVertexAssoTool = trackvertexassotool, -# TrackParticleContainerName = "InDetTrackParticles", -# ConeSize = 0.2, -# StoreParameters = False) - -#ToolSvc+=clusterfiltertool -#clusterfiltertool.OutputLevel = VERBOSE -#print clusterfiltertool - -from TrackCaloClusterRecTools.TrackCaloClusterRecToolsConf import TrackCaloClusterCreatorTool -TrackCaloClusterCreator = TrackCaloClusterCreatorTool(name = "TrackCaloClusterCreator", - VertexContainerName = "PrimaryVertices", - LooseTrackVertexAssoTool = trackvertexassotool, - ApplyClusterFilter = False ) -# TrackCaloClusterCreator.OutputLevel = VERBOSE -ToolSvc+=TrackCaloClusterCreator -print TrackCaloClusterCreator - -from TrackCaloClusterRecAlgs.TrackCaloClusterRecAlgsConf import TrackCaloClusterRecAlg -ParticleToCaloExtrapolation = TrackCaloClusterRecAlg(name = "TrackCaloClusterRecAlg", - OutputCollectionPostFix = "Test", - CaloClustersLocation = "TimedCaloCalTopoClusters", - TrackCaloClusterContainerName = "TrackCaloClusters", - TrackCaloClusterWeightsTool = TrackCaloClusterWeights, - TrackCaloClusterCreatorTool = TrackCaloClusterCreator) -# ParticleToCaloExtrapolation.OutputLevel = VERBOSE -topSequence += ParticleToCaloExtrapolation - -print ParticleToCaloExtrapolation - -theApp.EvtMax = -1 - -### Jet Stuff -if 1: - from JetRec.JetRecConf import JetFromPseudojet - jetFromPseudojet = JetFromPseudojet("jetFromPseudojet",Attributes = [] ) - ToolSvc += jetFromPseudojet - - from JetRec.JetRecConf import JetTrimmer - groomer = JetTrimmer("JetGroomer") - groomer.RClus = 0.2 - groomer.PtFrac = 0.05 - groomer.JetBuilder = jetFromPseudojet - ToolSvc += groomer - - # Add filter for copied jets. - #from JetSubStructureMomentTools.JetSubStructureMomentToolsConf import NSubjettinessTool - #ToolSvc += NSubjettinessTool("nsubjettiness") - #nsubjettiness = ToolSvc.nsubjettiness - - #from JetSubStructureMomentTools.JetSubStructureMomentToolsConf import NSubjettinessRatiosTool - #ToolSvc += NSubjettinessRatiosTool("nsubjettinessratios") - #nsubjettinessratios = ToolSvc.nsubjettinessratios - - # from JetSubStructureMomentTools.JetSubStructureMomentToolsConf import KTSplittingScaleTool - # ToolSvc += KTSplittingScaleTool("ktsplittingscale") - # ktsplittingscale = ToolSvc.ktsplittingscale - - # from JetSubStructureMomentTools.JetSubStructureMomentToolsConf import DipolarityTool - # ToolSvc += DipolarityTool("dipolarity") - # dipolarity = ToolSvc.dipolarity - - # from JetSubStructureMomentTools.JetSubStructureMomentToolsConf import AngularityTool - # ToolSvc += AngularityTool("angularity") - # angularity = ToolSvc.angularity - - # from JetSubStructureMomentTools.JetSubStructureMomentToolsConf import KtDeltaRTool - # ToolSvc += KtDeltaRTool("ktdr") - # ktdr = ToolSvc.ktdr - - # from JetSubStructureMomentTools.JetSubStructureMomentToolsConf import KtMassDropTool - # ToolSvc += KtMassDropTool("ktmassdrop") - # ktmassdrop = ToolSvc.ktmassdrop - - # from JetSubStructureMomentTools.JetSubStructureMomentToolsConf import PlanarFlowTool - # ToolSvc += PlanarFlowTool("planarflow") - # planarflow = ToolSvc.planarflow - - # from JetSubStructureMomentTools.JetSubStructureMomentToolsConf import CenterOfMassShapesTool - # ToolSvc += CenterOfMassShapesTool("centerofmassshapes") - # centerofmassshapes = ToolSvc.centerofmassshapes - - #from JetSubStructureMomentTools.JetSubStructureMomentToolsConf import EnergyCorrelatorTool - #ToolSvc += EnergyCorrelatorTool("energycorrelator") - #energycorrelator = ToolSvc.energycorrelator - - #from JetSubStructureMomentTools.JetSubStructureMomentToolsConf import EnergyCorrelatorRatiosTool - #ToolSvc += EnergyCorrelatorRatiosTool("energycorrelatorratios") - #energycorrelatorratios = ToolSvc.energycorrelatorratios - - # from JetSubStructureMomentTools.JetSubStructureMomentToolsConf import JetPullTool - # ToolSvc += JetPullTool("pull") - # pull = ToolSvc.pull - - # from JetSubStructureMomentTools.JetSubStructureMomentToolsConf import JetChargeTool - # ToolSvc += JetChargeTool("charge") - # charge = ToolSvc.charge - - # from JetSubStructureMomentTools.JetSubStructureMomentToolsConf import VolatilityTool - # ToolSvc += VolatilityTool("volatility") - # volatility = ToolSvc.volatility - # volatility.TruncationFactor = 0.0 - - # from JetSubStructureMomentTools.JetSubStructureMomentToolsConf import SubjetMakerTool - # ToolSvc += SubjetMakerTool("subjetmaker") - # subjetmaker = ToolSvc.subjetmaker - # subjetmaker.type = "Kt" - # subjetmaker.R = 0.2 - # subjetmaker.PtCut = 5000; - - # from JetSubStructureMomentTools.JetSubStructureMomentToolsConf import SubjetFinderTool - # ToolSvc += SubjetFinderTool("subjetfinder") - # subjetfinder = ToolSvc.subjetfinder - # from JetSubStructureMomentTools.JetSubStructureMomentToolsConf import SubjetRecorderTool - # ToolSvc += SubjetRecorderTool("subjetrecorder") - # subjetrecorder = ToolSvc.subjetrecorder - # subjetfinder.JetAlgorithm = "Kt" - # subjetfinder.JetRadius = 0.2 - # subjetrecorder.SubjetLabel = "Kt2Subjets" - # subjetrecorder.SubjetContainerName = "Kt2TrackCaloClusterSubJets" - # subjetfinder.SubjetRecorder = subjetrecorder - - clname = "TrackCaloClustersCombined" -# clname1 = "TrackCaloClustersCombinedAndNeutral" -# clname2 = "TrackCaloClustersCombinedAndCharged" - clname3 = "TrackCaloClustersAll" - -# clnames = [clname, clname1, clname2, clname3] - clnames = [clname, clname3] - - from JetRec.JetRecConf import JetPseudojetRetriever - from JetRec.JetRecConf import JetRecTool - - for name in clnames: - #-------------------------------------------------------------- - # Configure tools. - #-------------------------------------------------------------- - - # Find jet inputs. - from JetRecTools.JetRecToolsConf import TCCPseudoJetGetter - psjget = TCCPseudoJetGetter("TCCPseudoJetGetter_"+name) - psjget.InputContainer = name - psjget.Label = "TrackCaloCluster" - psjget.OutputContainer = "PseudoJetClusters"+name - # psjget.OutputLevel = INFO - psjget.SkipNegativeEnergy = True - ToolSvc += psjget - - # Find jets. - from JetRec.JetRecConf import JetFinder - jfind = JetFinder("JetFinder_"+name) - jfind.JetAlgorithm = "AntiKt" - jfind.JetRadius = 1.0 - jfind.GhostArea = 0.01; - jfind.PtMin = 200000.0 - # jfind.OutputLevel = VERBOSE - ToolSvc += jfind - - # JetRec tool for finding. - jetrec = JetRecTool("JetRecTool_"+name) - jetrec.OutputContainer = "AntiKt10"+name+"Jets" - # jetrec.OutputLevel = INFO - jetrec.PseudoJetGetters += [psjget] - jetrec.JetFinder = jfind - #jetrec.JetModifiers += [nsubjettiness] - #jetrec.JetModifiers += [nsubjettinessratios] - # jetrec.JetModifiers += [ktsplittingscale] - # jetrec.JetModifiers += [dipolarity] - # jetrec.JetModifiers += [angularity] - # jetrec.JetModifiers += [ktdr] - # jetrec.JetModifiers += [ktmassdrop] - # jetrec.JetModifiers += [planarflow] - # jetrec.JetModifiers += [centerofmassshapes] - #jetrec.JetModifiers += [energycorrelator] - #jetrec.JetModifiers += [energycorrelatorratios] - # jetrec.JetModifiers += [pull] - # jetrec.JetModifiers += [charge] - # jetrec.JetModifiers += [subjetmaker] - # jetrec.JetModifiers += [subjetfinder] - ToolSvc += jetrec - - jetPseudojetRetriever = JetPseudojetRetriever("JetPseudojetRetriever_"+name) - ToolSvc += jetPseudojetRetriever - - # JetRec tool for finding. - jetrec_trimm = JetRecTool("JetRecTool_"+name+"Trimm") - jetrec_trimm.JetGroomer = groomer - jetrec_trimm.InputContainer = "AntiKt10"+name+"Jets" - jetrec_trimm.OutputContainer = "AntiKt10"+name+"TrimmedJets" - jetrec_trimm.JetPseudojetRetriever = jetPseudojetRetriever - #jetrec_trimm.JetModifiers += [nsubjettiness] - #jetrec_trimm.JetModifiers += [nsubjettinessratios] - # jetrec_trimm.JetModifiers += [ktsplittingscale] - # jetrec_trimm.JetModifiers += [dipolarity] - # jetrec_trimm.JetModifiers += [angularity] - # jetrec_trimm.JetModifiers += [ktdr] - # jetrec_trimm.JetModifiers += [ktmassdrop] - # jetrec_trimm.JetModifiers += [planarflow] - # jetrec_trimm.JetModifiers += [centerofmassshapes] - #jetrec_trimm.JetModifiers += [energycorrelator] - #jetrec_trimm.JetModifiers += [energycorrelatorratios] - # jetrec_trimm.JetModifiers += [pull] - # jetrec_trimm.JetModifiers += [charge] - # jetrec_trimm.JetModifiers += [subjetmaker] - # jetrec_trimm.JetModifiers += [subjetfinder] - ToolSvc += jetrec_trimm - - # Add the algorithm. It runs the demo tools. - jetalg = JetAlgorithm("JetAlg_"+name) - # jetalg.OutputLevel = INFO - jetalg.Tools += [jetrec, jetrec_trimm] - topSequence += jetalg - - # Find jet inputs. - from JetRec.JetRecConf import PseudoJetGetter - psjget = PseudoJetGetter("PseudoJetGetter") - psjget.InputContainer = "TimedCaloCalTopoClusters" - psjget.Label = "LCTopoOrigin" - psjget.OutputContainer = "PseudoJetLCTopoOrigin" - # psjget.OutputLevel = INFO - psjget.SkipNegativeEnergy = True - ToolSvc += psjget - - psjget2 = PseudoJetGetter("cget_ghost") - psjget2.InputContainer = "InDetTrackParticles" - psjget2.Label = "GhostTrack" - psjget2.OutputContainer = "PseudoJetGhostTrack" - # psjget.OutputLevel = INFO - psjget2.GhostScale = 1e-40 - ToolSvc += psjget2 - - # Find jets. - from JetRec.JetRecConf import JetFinder - jfind = JetFinder("JetFinder") - jfind.JetAlgorithm = "AntiKt" - jfind.JetRadius = 1.0 - jfind.GhostArea = 0.01; - jfind.PtMin = 200000.0 - # jfind.OutputLevel = VERBOSE - ToolSvc += jfind - - from JetMomentTools.JetMomentToolsConf import JetTrackSumMomentsTool - TrackSumMomentsTool = JetTrackSumMomentsTool( name = "trksummoms", - VertexContainer = "PrimaryVertices", - AssociatedTracks = "GhostTrack", - TrackVertexAssociation = jettva.TrackVertexAssociation, - RequireTrackPV = True) - # TrackSumMomentsTool.OutputLevel = DEBUG - ToolSvc += TrackSumMomentsTool - - # JetRec tool for finding. - jetrec = JetRecTool("JetRecTool") - jetrec.OutputContainer = "MyAntiKt10LCTopoJets" - # jetrec.OutputLevel = INFO - jetrec.PseudoJetGetters += [psjget, psjget2] - jetrec.JetFinder = jfind - #jetrec.JetModifiers += [nsubjettiness] - #jetrec.JetModifiers += [nsubjettinessratios] - # jetrec.JetModifiers += [ktsplittingscale] - # jetrec.JetModifiers += [dipolarity] - # jetrec.JetModifiers += [angularity] - # jetrec.JetModifiers += [ktdr] - # jetrec.JetModifiers += [ktmassdrop] - # jetrec.JetModifiers += [planarflow] - # jetrec.JetModifiers += [centerofmassshapes] - #jetrec.JetModifiers += [energycorrelator] - #jetrec.JetModifiers += [energycorrelatorratios] - # jetrec.JetModifiers += [pull] - # jetrec.JetModifiers += [charge] - # jetrec.JetModifiers += [subjetmaker] - # jetrec.JetModifiers += [subjetfinder] - # jetrec.JetModifiers += [TrackSumMomentsTool] - ToolSvc += jetrec - - from JetCalibTools.JetCalibToolsConf import JetCalibrationTool - calib_tool=JetCalibrationTool('JetCalibTool',JetCollection="AntiKt10LCTopoTrimmedPtFrac5SmallR20",ConfigFile='JES_MC15recommendation_FatJet_Nov2016_QCDCombinationUncorrelatedWeights.config',CalibSequence='EtaJES_JMS',IsData=False) - ToolSvc += calib_tool - print calib_tool - - jetPseudojetRetriever = JetPseudojetRetriever("JetPseudojetRetriever") - ToolSvc += jetPseudojetRetriever - - # JetRec tool for finding. - jetrec_trimm = JetRecTool("JetRecToolTrimm") - jetrec_trimm.JetGroomer = groomer - jetrec_trimm.InputContainer = "MyAntiKt10LCTopoJets" - jetrec_trimm.OutputContainer = "MyAntiKt10LCTopoTrimmedJets" - jetrec_trimm.JetPseudojetRetriever = jetPseudojetRetriever - #jetrec_trimm.JetModifiers += [nsubjettiness] - #jetrec_trimm.JetModifiers += [nsubjettinessratios] - # jetrec_trimm.JetModifiers += [ktsplittingscale] - # jetrec_trimm.JetModifiers += [dipolarity] - # jetrec_trimm.JetModifiers += [angularity] - # jetrec_trimm.JetModifiers += [ktdr] - # jetrec_trimm.JetModifiers += [ktmassdrop] - # jetrec_trimm.JetModifiers += [planarflow] - # jetrec_trimm.JetModifiers += [centerofmassshapes] - #jetrec_trimm.JetModifiers += [energycorrelator] - #jetrec_trimm.JetModifiers += [energycorrelatorratios] - # jetrec_trimm.JetModifiers += [pull] - # jetrec_trimm.JetModifiers += [charge] - # jetrec_trimm.JetModifiers += [subjetmaker] - # jetrec_trimm.JetModifiers += [subjetfinder] - jetrec_trimm.JetModifiers += [TrackSumMomentsTool] - jetrec_trimm.JetModifiers += [calib_tool] - ToolSvc += jetrec_trimm - - - # Add the algorithm. It runs the demo tools. - jetalg = JetAlgorithm("JetAlg") - # jetalg.OutputLevel = INFO - jetalg.Tools += [jetrec, jettva, jetrec_trimm] - topSequence += jetalg - - from MCTruthClassifier.MCTruthClassifierConf import MCTruthClassifier - truth_classifier_name='JetMCTruthClassifier' - truthClassifier = MCTruthClassifier(name = truth_classifier_name, - ParticleCaloExtensionTool="") - ToolSvc += truthClassifier - - from ParticleJetTools.ParticleJetToolsConf import CopyTruthJetParticles - copytruth = CopyTruthJetParticles(name = "truthpartcopy", OutputName="JetInputTruthParticles", - MCTruthClassifier=truthClassifier) - ToolSvc += copytruth - - # Find jet inputs. - from JetRec.JetRecConf import PseudoJetGetter - psjget = PseudoJetGetter("PseudoTruthJetGetter") - psjget.InputContainer = "JetInputTruthParticles" - psjget.Label = "Truth" - psjget.OutputContainer = "PseudoJetTruth" - # psjget.OutputLevel = INFO - psjget.GhostScale = 0.0 - psjget.SkipNegativeEnergy = True - ToolSvc += psjget - - # Find jets. - jfind = JetFinder("JetFinderTruth") - jfind.JetAlgorithm = "AntiKt" - jfind.JetRadius = 1.0 - jfind.GhostArea = 0.0; - jfind.PtMin = 150000.0 - # jfind.OutputLevel = VERBOSE - ToolSvc += jfind - - # JetRec tool for finding. - jetrec = JetRecTool("JetRecToolTruth") - jetrec.OutputContainer = "MyAntiKt10TruthJets" - # jetrec.OutputLevel = INFO - jetrec.PseudoJetGetters += [psjget] - jetrec.JetFinder = jfind - #jetrec.JetModifiers += [nsubjettiness] - #jetrec.JetModifiers += [nsubjettinessratios] - # jetrec.JetModifiers += [ktsplittingscale] - # jetrec.JetModifiers += [dipolarity] - # jetrec.JetModifiers += [angularity] - # jetrec.JetModifiers += [ktdr] - # jetrec.JetModifiers += [ktmassdrop] - # jetrec.JetModifiers += [planarflow] - # jetrec.JetModifiers += [centerofmassshapes] - #jetrec.JetModifiers += [energycorrelator] - #jetrec.JetModifiers += [energycorrelatorratios] - # jetrec.JetModifiers += [pull] - # jetrec.JetModifiers += [charge] - # jetrec.JetModifiers += [subjetmaker] - # jetrec.JetModifiers += [subjetfinder] - # jetrec.JetModifiers += [TrackSumMomentsTool] - ToolSvc += jetrec - - # JetRec tool for finding. - jetrec_trimm = JetRecTool("JetRecToolTruthTrimm") - jetrec_trimm.JetGroomer = groomer - jetrec_trimm.InputContainer = "MyAntiKt10TruthJets" - jetrec_trimm.OutputContainer = "MyAntiKt10TruthTrimmedJets" - jetrec_trimm.JetPseudojetRetriever = jetPseudojetRetriever - #jetrec_trimm.JetModifiers += [nsubjettiness] - #jetrec_trimm.JetModifiers += [nsubjettinessratios] - # jetrec_trimm.JetModifiers += [ktsplittingscale] - # jetrec_trimm.JetModifiers += [dipolarity] - # jetrec_trimm.JetModifiers += [angularity] - # jetrec_trimm.JetModifiers += [ktdr] - # jetrec_trimm.JetModifiers += [ktmassdrop] - # jetrec_trimm.JetModifiers += [planarflow] - # jetrec_trimm.JetModifiers += [centerofmassshapes] - #jetrec_trimm.JetModifiers += [energycorrelator] - #jetrec_trimm.JetModifiers += [energycorrelatorratios] - # jetrec_trimm.JetModifiers += [pull] - # jetrec_trimm.JetModifiers += [charge] - # jetrec_trimm.JetModifiers += [subjetmaker] - # jetrec_trimm.JetModifiers += [subjetfinder] - ToolSvc += jetrec_trimm - - - # Add the algorithm. It runs the demo tools. - jetalg = JetAlgorithm("JetAlgTruth") - - # jetalg.OutputLevel = INFO - jetalg.Tools += [copytruth, jetrec, jetrec_trimm] - topSequence += jetalg - - - - -###end jet stuff - -from OutputStreamAthenaPool.MultipleStreamManager import MSMgr -xaodStream = MSMgr.NewPoolRootStream( "StreamAOD", "XAOD_"+Name+".pool.root" ) -# xaodStream.Stream.TakeItemsFromInput = True #this will only work for the event-by-event items. MetadataItems must still be specified -xaodStream.AddItem("xAOD::EventInfo#*") -xaodStream.AddItem("xAOD::EventAuxInfo#*") -xaodStream.AddItem("xAOD::EventShape#*") -xaodStream.AddItem("xAOD::EventShapeAuxInfo#*") -xaodStream.AddItem("xAOD::VertexContainer#*") -xaodStream.AddItem("xAOD::VertexAuxContainer#*") -# xaodStream.AddItem( "xAOD::TrackCaloClusterContainer#TrackCaloClusters") -# xaodStream.AddItem( "xAOD::TrackCaloClusterAuxContainer#TrackCaloClustersAux.") -# xaodStream.AddItem( "xAOD::TrackCaloClusterContainer#TrackCaloClustersCombined") -# xaodStream.AddItem( "xAOD::TrackCaloClusterAuxContainer#TrackCaloClustersCombinedAux.") -# xaodStream.AddItem( "xAOD::TrackCaloClusterContainer#TrackCaloClustersAll") -# xaodStream.AddItem( "xAOD::TrackCaloClusterAuxContainer#TrackCaloClustersAllAux.") -# xaodStream.AddItem( "xAOD::TrackCaloClusterContainer#TrackCaloClustersAllTrack") -# xaodStream.AddItem( "xAOD::TrackCaloClusterAuxContainer#TrackCaloClustersAllTrackAux.") -xaodStream.AddItem( "xAOD::JetContainer#My*") -xaodStream.AddItem( "xAOD::JetAuxContainer#My*") -xaodStream.AddItem( "xAOD::JetContainer#*TrackCaloClusters*") -xaodStream.AddItem( "xAOD::JetAuxContainer#*TrackCaloClusters*") -# xaodStream.AddItem( "xAOD::CaloClusterContainer#*") -# xaodStream.AddItem( "xAOD::CaloClusterAuxContainer#*") - -#from PerfMonComps.PerfMonFlags import jobproperties as pmon_properties -#pmon_properties.PerfMonFlags.doSemiDetailedMonitoring=True - diff --git a/Reconstruction/TrackCaloClusterRec/TrackCaloClusterRecAlgs/share/TrackCaloClusterReco_TrackClusterInfo.py b/Reconstruction/TrackCaloClusterRec/TrackCaloClusterRecAlgs/share/TrackCaloClusterReco_TrackClusterInfo.py deleted file mode 100644 index 62443724a5e46d7a7f1a87515f8c3b32aa4b3813..0000000000000000000000000000000000000000 --- a/Reconstruction/TrackCaloClusterRec/TrackCaloClusterRecAlgs/share/TrackCaloClusterReco_TrackClusterInfo.py +++ /dev/null @@ -1,170 +0,0 @@ -import AthenaPoolCnvSvc.ReadAthenaPool - -from AthenaCommon import CfgMgr - -##InputFiles = ["/eos/user/r/rjansky/TCCTestFiles/mc15_13TeV.301282.Pythia8EvtGen_A14NNPDF23LO_Wprime_WZqqqq_m4000.merge.AOD.e3743_s2608_s2183_r7772_r7676/AOD.08110078._000001.pool.root.1"] -##InputFiles = ["root://eosatlas.cern.ch//eos/atlas/user/n/ncalace/Samples_Physics/WPrime_4000/DAOD_JETM8.09331772._000001.pool.root.1"] -#InputFiles = ["/eos/atlas/user/r/rjansky/mc15_13TeV.301282.Pythia8EvtGen_A14NNPDF23LO_Wprime_WZqqqq_m4000.merge.AOD.e3743_s2608_s2183_r7772_r7676/AOD.08110078._000001.pool.root.1"] -InputFiles = ["/afs/cern.ch/user/n/ncalace/work/public/mc15_13TeV/AOD.08110078._000001.pool.root.1"] - -svcMgr.EventSelector.InputCollections = InputFiles - -# Name = Sample -Name = "WprimeCovMatch_AllTests_TCC" - -from AthenaCommon.AthenaCommonFlags import athenaCommonFlags -athenaCommonFlags.FilesInput = svcMgr.EventSelector.InputCollections - -from AthenaCommon.GlobalFlags import globalflags -DetDescrVersion = 'ATLAS-R2-2015-03-01-00' -globalflags.DetDescrVersion = DetDescrVersion - -from IOVDbSvc.CondDB import conddb -conddb.setGlobalTag('OFLCOND-MC15c-SDR-09') - -print "globalflags.DetDescrVersion = ", globalflags.DetDescrVersion -# Set up geometry and BField -include("RecExCond/AllDet_detDescr.py") - -from JetRec.JetRecConf import JetAlgorithm -from JetRecTools.JetRecToolsConf import JetConstituentModSequence, CaloClusterConstituentsOrigin, ClusterTimeCutTool -ccco = CaloClusterConstituentsOrigin("JetConstit_LCOrigin") -ToolSvc += ccco - -ctct = ClusterTimeCutTool("JetConstit_Timecut") -ToolSvc += ctct - -PFSequence = JetConstituentModSequence("JetConstitSeq_LCOriginAndTime", - InputContainer = "CaloCalTopoClusters", - OutputContainer = "TimedCaloCalTopoClusters", - InputType = "CaloCluster", - Modifiers = [ctct, ccco], - SaveAsShallow = True) -ToolSvc += PFSequence - -#Configure the extrapolator -from TrkExTools.AtlasExtrapolator import AtlasExtrapolator -theAtlasExtrapolator=AtlasExtrapolator("AtlasExtrapolator") -ToolSvc += theAtlasExtrapolator - -from TrackCaloClusterRecTools.TrackCaloClusterRecToolsConf import ParticleToCaloExtrapolationTool -ParticleToCaloExtrapolationTool = ParticleToCaloExtrapolationTool(name = "ParticleToCaloExtrapolationTool", - Extrapolator = theAtlasExtrapolator, - ParticleType = "pion", - StoreParameters=True) -# ParticleToCaloExtrapolationTool.OutputLevel = DEBUG -ToolSvc += ParticleToCaloExtrapolationTool - -print ParticleToCaloExtrapolationTool - -from ParticlesInConeTools.ParticlesInConeToolsConf import xAOD__CaloClustersInConeTool -CaloClustersInCone = xAOD__CaloClustersInConeTool(name = "CaloClustersInCone", - CaloClusterLocation = "TimedCaloCalTopoClusters") -# CaloClustersInCone.OutputLevel = DEBUG -ToolSvc += CaloClustersInCone - -print CaloClustersInCone - -from TrackToCalo.TrackToCaloConf import Rec__ParticleCaloClusterAssociationTool -ParticleCaloCellAssociation = Rec__ParticleCaloClusterAssociationTool(name = "ParticleCaloCellAssociationInDet", - ParticleCaloExtensionTool = ParticleToCaloExtrapolationTool, - CaloClusterLocation = "TimedCaloCalTopoClusters", - ClustersInConeTool = CaloClustersInCone, - ConeSize = 0.1, - UseCovariance = True, - StoreParameters = True) -#ParticleCaloCellAssociation.OutputLevel = DEBUG -ToolSvc+=ParticleCaloCellAssociation -print ParticleCaloCellAssociation - -# Access the algorithm sequence: -from AthenaCommon.AlgSequence import AlgSequence -topSequence = AlgSequence() - -# Add the algorithm. -jetalg = JetAlgorithm("JetAlg_OriginAndTime") -#jetalg.OutputLevel = INFO -jetalg.Tools += [PFSequence] -topSequence += jetalg - -from TrackParticleAssociationAlgs.TrackParticleAssociationAlgsConf import TrackParticleClusterAssociationAlg -TrackParticleClusterAssociation = TrackParticleClusterAssociationAlg(name = "TrackParticleClusterAssociationInDet", - ParticleCaloClusterAssociationTool = ParticleCaloCellAssociation, - TrackParticleContainerName = "InDetTrackParticles", - PtCut = 400., - OutputCollectionPostFix = "Test", - CaloClusterLocation = "TimedCaloCalTopoClusters") -#TrackParticleClusterAssociation.OutputLevel = DEBUG -topSequence += TrackParticleClusterAssociation - -print TrackParticleClusterAssociation - -from TrackCaloClusterRecTools.TrackCaloClusterRecToolsConf import TrackCaloClusterWeightsTool -TrackCaloClusterWeights = TrackCaloClusterWeightsTool(name = "TrackCaloClusterWeights") -# TrackCaloClusterWeights.OutputLevel = VERBOSE -ToolSvc+=TrackCaloClusterWeights -print TrackCaloClusterWeights - -trackvertexassotool=CfgMgr.CP__TrackVertexAssociationTool("TrackVertexAssociationTool", WorkingPoint="Nominal") -ToolSvc+=trackvertexassotool - -from JetRecTools.JetRecToolsConf import TrackVertexAssociationTool -jettva = TrackVertexAssociationTool( name = "tvassoc", - TrackParticleContainer = "InDetTrackParticles", - TrackVertexAssociation = "JetTrackVtxAssoc", - VertexContainer = "PrimaryVertices", - TrackVertexAssoTool = trackvertexassotool - ) -ToolSvc+=jettva -print jettva - -from TrackCaloClusterRecTools.TrackCaloClusterRecToolsConf import ClusterFilterTool -clusterfiltertool = ClusterFilterTool(name = "clusterfiltertool", - LooseTrackVertexAssoTool = trackvertexassotool, - TrackParticleContainerName = "InDetTrackParticles", - ConeSize = 0.2, - PtFractionAtPV0 = 0.1, - StoreParameters = True) - -ToolSvc+=clusterfiltertool -#clusterfiltertool.OutputLevel = VERBOSE -print clusterfiltertool - -from TrackCaloClusterRecTools.TrackCaloClusterRecToolsConf import TrackCaloClusterCreatorTool -TrackCaloClusterCreator = TrackCaloClusterCreatorTool(name = "TrackCaloClusterCreator", - VertexContainerName = "PrimaryVertices", - LooseTrackVertexAssoTool = trackvertexassotool, - ApplyClusterFilter = False, - ClusterFilterTool = clusterfiltertool) -#TrackCaloClusterCreator.OutputLevel = VERBOSE -ToolSvc+=TrackCaloClusterCreator -print TrackCaloClusterCreator - -from TrackCaloClusterRecAlgs.TrackCaloClusterRecAlgsConf import TrackCaloClusterRecAlg -ParticleToCaloExtrapolation = TrackCaloClusterRecAlg(name = "TrackCaloClusterRecAlg", - OutputCollectionPostFix = "Test", - CaloClustersLocation = "TimedCaloCalTopoClusters", - TrackCaloClusterContainerName = "TrackCaloClusters", - TrackCaloClusterWeightsTool = TrackCaloClusterWeights, - TrackCaloClusterCreatorTool = TrackCaloClusterCreator, - StoreStatistics = True ) -#ParticleToCaloExtrapolation.OutputLevel = VERBOSE -topSequence += ParticleToCaloExtrapolation - -print ParticleToCaloExtrapolation - -theApp.EvtMax = 1000 - -from OutputStreamAthenaPool.MultipleStreamManager import MSMgr -xaodStream = MSMgr.NewPoolRootStream( "StreamAOD", "XAOD_"+Name+".pool.root" ) -xaodStream.AddItem( "xAOD::CaloClusterContainer#TimedCaloCalTopoClusters") -xaodStream.AddItem( "xAOD::ShallowAuxContainer#TimedCaloCalTopoClustersAux.") -xaodStream.AddItem( "xAOD::TrackParticleContainer#InDetTrackParticles") -xaodStream.AddItem( "xAOD::TrackParticleAuxContainer#InDetTrackParticlesAux.") -xaodStream.AddItem( "xAOD::TrackCaloClusterContainer#*") -xaodStream.AddItem( "xAOD::TrackCaloClusterAuxContainer#*") -xaodStream.AddItem( "xAOD::TruthParticleContainer#TruthParticles") -xaodStream.AddItem( "xAOD::TruthParticleAuxContainer#TruthParticlesAux.") - -ServiceMgr.MessageSvc.Format = "% F%30W%S%7W%R%T %0W%M" -#ServiceMgr.StoreGateSvc.Dump=True diff --git a/Reconstruction/TrackCaloClusterRec/TrackCaloClusterRecAlgs/src/TrackCaloClusterRecAlg.cxx b/Reconstruction/TrackCaloClusterRec/TrackCaloClusterRecAlgs/src/TrackCaloClusterRecAlg.cxx deleted file mode 100644 index 10b6be51ea13adb6fdaf8c0caf508a366c67ec0c..0000000000000000000000000000000000000000 --- a/Reconstruction/TrackCaloClusterRec/TrackCaloClusterRecAlgs/src/TrackCaloClusterRecAlg.cxx +++ /dev/null @@ -1,138 +0,0 @@ -/* - Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration -*/ -// TrackCaloClusterRecAlgs includes -#include "TrackCaloClusterRecAlgs/TrackCaloClusterRecAlg.h" - -#include "TrkParametersIdentificationHelpers/TrackParametersIdHelper.h" -#include "AtlasDetDescr/AtlasDetectorID.h" - -#include "xAODAssociations/TrackParticleClusterAssociationContainer.h" -#include "xAODPFlow/TrackCaloClusterAuxContainer.h" - -TrackCaloClusterRecAlg::TrackCaloClusterRecAlg( const std::string& name, ISvcLocator* pSvcLocator ) : - AthAlgorithm( name, pSvcLocator ), - m_trackCaloClusterWeightsTool("TrackCaloClusterRecTools/TrackCaloClusterWeightsTool"), - m_trackCaloClusterCreatorTool("TrackCaloClusterRecTools/TrackCaloClusterCreatorTool") { - - declareProperty("TrackParticleContainerName" , m_trkParticleName = "InDetTrackParticles" ); - declareProperty("OutputCollectionPostFix" , m_outputPostFix = "" ); - declareProperty("CaloClustersLocation" , m_caloClusters = "CaloCalTopoClusters" ); - declareProperty("TrackCaloClusterContainerName", m_trackCaloClusterContainerName = "TrackCaloClusters" ); - declareProperty("TrackCaloClusterWeightsTool" , m_trackCaloClusterWeightsTool ); - declareProperty("TrackCaloClusterCreatorTool" , m_trackCaloClusterCreatorTool ); - } - -TrackCaloClusterRecAlg::~TrackCaloClusterRecAlg() {} - -StatusCode TrackCaloClusterRecAlg::initialize() { - ATH_MSG_INFO ("Initializing " << name() << "..."); - ATH_CHECK(m_trackCaloClusterWeightsTool.retrieve()); - ATH_CHECK(m_trackCaloClusterCreatorTool.retrieve()); - return StatusCode::SUCCESS; -} - -StatusCode TrackCaloClusterRecAlg::finalize() { - ATH_MSG_INFO ("Finalizing " << name() << "..."); - return StatusCode::SUCCESS; -} - -StatusCode TrackCaloClusterRecAlg::execute() { - ATH_MSG_DEBUG ("Executing " << name() << "..."); - // Create cluster-to-tracks map - std::multimap <const xAOD::CaloCluster*, const xAOD::TrackParticle*> clusterToTracksMap; - std::map <const xAOD::TrackParticle*, FourMom_t> TrackTotalClusterPt; - std::map <const xAOD::CaloCluster*, FourMom_t> clusterToTracksWeightMap; - - // Combined - xAOD::TrackCaloClusterContainer* tccContainer = new xAOD::TrackCaloClusterContainer(); - ATH_CHECK( evtStore()->record( tccContainer, m_trackCaloClusterContainerName + "Combined" ) ); - - xAOD::TrackCaloClusterAuxContainer* tccContainerAux = new xAOD::TrackCaloClusterAuxContainer(); - ATH_CHECK( evtStore()->record( tccContainerAux, m_trackCaloClusterContainerName + "Combined" + "Aux." ) ); - tccContainer->setStore( tccContainerAux ); - ATH_MSG_DEBUG( "Recorded TrackCaloClusterContainer with key: " << m_trackCaloClusterContainerName + "Combined" ); - - // Look at associated clusters - if ( !evtStore()->contains<xAOD::TrackParticleClusterAssociationContainer>( m_trkParticleName+"ClusterAssociations"+m_outputPostFix) ) { - ATH_MSG_WARNING ("Couldn't retrieve TrackParticleClusterAssociations with key: " << m_trkParticleName+"ClusterAssociations"+m_outputPostFix ); - return StatusCode::SUCCESS; - } - - const auto associatedClusters = getContainer<xAOD::TrackParticleClusterAssociationContainer>(m_trkParticleName+"ClusterAssociations"+m_outputPostFix); - - // Look at all clusters - if ( !evtStore()->contains<xAOD::CaloClusterContainer>( m_caloClusters) ) { - ATH_MSG_WARNING ("Couldn't retrieve CaloClusterContainer with key: " << m_caloClusters ); - return StatusCode::SUCCESS; - } - - const auto allClusters = getContainer<xAOD::CaloClusterContainer>(m_caloClusters); - - // Look at all tracks - if ( !evtStore()->contains<xAOD::TrackParticleContainer>( m_trkParticleName) ) { - ATH_MSG_WARNING ("Couldn't retrieve TrackParticleContainer with key: " << m_trkParticleName ); - return StatusCode::SUCCESS; - } - - const auto allTracks = getContainer<xAOD::TrackParticleContainer>(m_trkParticleName); - - // Create the weights - m_trackCaloClusterWeightsTool->fillWeightMaps(associatedClusters, &clusterToTracksMap, &TrackTotalClusterPt, &clusterToTracksWeightMap); - - // Create Combined xAOD::TCC - m_trackCaloClusterCreatorTool->createCombinedTCCs(tccContainer, associatedClusters, &TrackTotalClusterPt, &clusterToTracksWeightMap); - - // Combined + Neutral - xAOD::TrackCaloClusterContainer* tccContainer1 = new xAOD::TrackCaloClusterContainer; - ATH_CHECK( evtStore()->record( tccContainer1, m_trackCaloClusterContainerName + "CombinedAndNeutral" ) ); - - xAOD::TrackCaloClusterAuxContainer* tccContainerAux1 = new xAOD::TrackCaloClusterAuxContainer(); - ATH_CHECK( evtStore()->record( tccContainerAux1, m_trackCaloClusterContainerName + "CombinedAndNeutral" + "Aux." ) ); - tccContainer1->setStore( tccContainerAux1 ); - ATH_MSG_DEBUG( "Recorded TrackCaloClusterContainer with key: " << m_trackCaloClusterContainerName ); - - for (xAOD::TrackCaloCluster* combined: *tccContainer) { - tccContainer1->push_back(new xAOD::TrackCaloCluster); - *tccContainer1->back() = *combined; - } - - // Create neutral xAOD::TCC - m_trackCaloClusterCreatorTool->createNeutralTCCs(tccContainer1, allClusters, &clusterToTracksWeightMap); - - // Combined + Neutral + Charged - xAOD::TrackCaloClusterContainer* tccContainer2 = new xAOD::TrackCaloClusterContainer; - ATH_CHECK( evtStore()->record( tccContainer2, m_trackCaloClusterContainerName + "All" ) ); - - xAOD::TrackCaloClusterAuxContainer* tccContainerAux2 = new xAOD::TrackCaloClusterAuxContainer(); - ATH_CHECK( evtStore()->record( tccContainerAux2, m_trackCaloClusterContainerName + "All" + "Aux." ) ); - tccContainer2->setStore( tccContainerAux2 ); - ATH_MSG_DEBUG( "Recorded TrackCaloClusterContainer with key: " << m_trackCaloClusterContainerName + "All" ); - - for (xAOD::TrackCaloCluster* combinedAndNeutral: *tccContainer1) { - tccContainer2->push_back(new xAOD::TrackCaloCluster); - *tccContainer2->back() = *combinedAndNeutral; - } - - // Create trackonly xAOD::TCC - m_trackCaloClusterCreatorTool->createChargedTCCs(tccContainer2, allTracks, &TrackTotalClusterPt); - - // Combined + Charged - xAOD::TrackCaloClusterContainer* tccContainer3 = new xAOD::TrackCaloClusterContainer; - ATH_CHECK( evtStore()->record( tccContainer3, m_trackCaloClusterContainerName + "CombinedAndCharged" ) ); - - xAOD::TrackCaloClusterAuxContainer* tccContainerAux3 = new xAOD::TrackCaloClusterAuxContainer(); - ATH_CHECK( evtStore()->record( tccContainerAux3, m_trackCaloClusterContainerName + "CombinedAndCharged" + "Aux." ) ); - tccContainer3->setStore( tccContainerAux3 ); - ATH_MSG_DEBUG( "Recorded TrackCaloClusterContainer with key: " << m_trackCaloClusterContainerName + "AllTrack" ); - - for (xAOD::TrackCaloCluster* combined: *tccContainer) { - tccContainer3->push_back(new xAOD::TrackCaloCluster); - *tccContainer3->back() = *combined; - } - - // Create trackonly xAOD::TCC - m_trackCaloClusterCreatorTool->createChargedTCCs(tccContainer3, allTracks, &TrackTotalClusterPt); - - return StatusCode::SUCCESS; -} diff --git a/Reconstruction/TrackCaloClusterRec/TrackCaloClusterRecAlgs/src/components/TrackCaloClusterRecAlgs_entries.cxx b/Reconstruction/TrackCaloClusterRec/TrackCaloClusterRecAlgs/src/components/TrackCaloClusterRecAlgs_entries.cxx deleted file mode 100644 index e73f0a474803f8963c5266b0729e2c839e9d4a81..0000000000000000000000000000000000000000 --- a/Reconstruction/TrackCaloClusterRec/TrackCaloClusterRecAlgs/src/components/TrackCaloClusterRecAlgs_entries.cxx +++ /dev/null @@ -1,6 +0,0 @@ -#include "TrackCaloClusterRecAlgs/TrackCaloClusterRecAlg.h" - -DECLARE_COMPONENT( TrackCaloClusterRecAlg ) - - - diff --git a/Reconstruction/eflowRec/share/PFlowMTConfig.py b/Reconstruction/eflowRec/share/PFlowMTConfig.py index edd98bf0749f3fb7f105888d0a1d6d295059910e..0b0e004c21e1f93093232fb1813bccde5bdedfff 100644 --- a/Reconstruction/eflowRec/share/PFlowMTConfig.py +++ b/Reconstruction/eflowRec/share/PFlowMTConfig.py @@ -245,7 +245,7 @@ if True == jobproperties.eflowRecFlags.provideShowerSubtractedClusters: topSequence += PFONeutralCreatorAlgorithm from eflowRec.eflowRecFlags import jobproperties # set reco flags for eFlowRec algorithms jobproperties.eflowRecFlags.usePFEGammaPFOAssoc.set_Value_and_Lock(True) -jobproperties.eflowRecFlags.useFlowElements.set_Value_and_Lock(True) + if jobproperties.eflowRecFlags.usePFEGammaPFOAssoc: diff --git a/Reconstruction/egamma/egammaAlgs/src/EMGSFCaloExtensionBuilder.cxx b/Reconstruction/egamma/egammaAlgs/src/EMGSFCaloExtensionBuilder.cxx index ac8170d3284fbc9dc6343eeeaa4b5c944634fd3b..c7afddd8e11b450569c5d03b86720549e34cc5bb 100644 --- a/Reconstruction/egamma/egammaAlgs/src/EMGSFCaloExtensionBuilder.cxx +++ b/Reconstruction/egamma/egammaAlgs/src/EMGSFCaloExtensionBuilder.cxx @@ -25,7 +25,7 @@ PURPOSE: Performs Calo Extension for all GSF tracks EMGSFCaloExtensionBuilder::EMGSFCaloExtensionBuilder(const std::string& name, ISvcLocator* pSvcLocator) - : AthAlgorithm(name, pSvcLocator) + : AthReentrantAlgorithm(name, pSvcLocator) {} StatusCode @@ -52,7 +52,7 @@ EMGSFCaloExtensionBuilder::EMGSFCaloExtensionBuilder::finalize() } StatusCode -EMGSFCaloExtensionBuilder::execute_r(const EventContext& ctx) const +EMGSFCaloExtensionBuilder::execute(const EventContext& ctx) const { SG::ReadHandle<xAOD::TrackParticleContainer> tracks(m_GSFTrkPartContainerKey, ctx); diff --git a/Reconstruction/egamma/egammaAlgs/src/EMGSFCaloExtensionBuilder.h b/Reconstruction/egamma/egammaAlgs/src/EMGSFCaloExtensionBuilder.h index 501353144e7928623f361bd7cb2ecf6096cca109..a9b957110194f965cdaddba26bc0edb9baf262e0 100644 --- a/Reconstruction/egamma/egammaAlgs/src/EMGSFCaloExtensionBuilder.h +++ b/Reconstruction/egamma/egammaAlgs/src/EMGSFCaloExtensionBuilder.h @@ -9,7 +9,7 @@ Algorithm which creates calo extension for all GSF Track Particles */ -#include "AthenaBaseComps/AthAlgorithm.h" +#include "AthenaBaseComps/AthReentrantAlgorithm.h" #include "GaudiKernel/EventContext.h" #include "GaudiKernel/ToolHandle.h" #include "RecoToolInterfaces/IParticleCaloExtensionTool.h" @@ -18,7 +18,7 @@ #include "TrkCaloExtension/CaloExtensionCollection.h" #include "xAODTracking/TrackParticleContainerFwd.h" -class EMGSFCaloExtensionBuilder : public AthAlgorithm +class EMGSFCaloExtensionBuilder : public AthReentrantAlgorithm { public: /** @brief Default constructor*/ @@ -26,12 +26,7 @@ public: virtual StatusCode initialize() override final; virtual StatusCode finalize() override final; - virtual StatusCode execute() override final { - return execute_r(Algorithm::getContext()); - } - // This will become the normal execute when - // inheriting from AthReentrantAlgorithm - StatusCode execute_r(const EventContext& ctx) const; + virtual StatusCode execute(const EventContext& ctx) const override final; private: /** @brief the Calo Extension tool*/ @@ -41,11 +36,12 @@ private: "Trk::ParticleCaloExtensionTool/EMLastCaloExtensionTool" }; - ToolHandle<Trk::IParticleCaloExtensionTool> m_perigeeParticleCaloExtensionTool{ - this, - "PerigeeCaloExtensionTool", - "Trk::ParticleCaloExtensionTool/EMParticleCaloExtensionTool" - }; + ToolHandle<Trk::IParticleCaloExtensionTool> + m_perigeeParticleCaloExtensionTool{ + this, + "PerigeeCaloExtensionTool", + "Trk::ParticleCaloExtensionTool/EMParticleCaloExtensionTool" + }; // Cache collections for GSF Track Particle extrapolation Perigee SG::WriteHandleKey<CaloExtensionCollection> m_GSFPerigeeCacheKey{ diff --git a/Reconstruction/tauMonitoring/src/tauMonitorAlgorithm.cxx b/Reconstruction/tauMonitoring/src/tauMonitorAlgorithm.cxx index 07e39297516a446d35092f0aff4b8a2fc26f1867..52eb4bf8acc1a8d3e646812fdd909acc9fd7179b 100644 --- a/Reconstruction/tauMonitoring/src/tauMonitorAlgorithm.cxx +++ b/Reconstruction/tauMonitoring/src/tauMonitorAlgorithm.cxx @@ -176,8 +176,11 @@ StatusCode tauMonitorAlgorithm::fillHistograms( const EventContext& ctx ) const for (const auto& tau : *shallowTaus) { - TLorentzVector calibratedVec = tau->p4(xAOD::TauJetParameters::FinalCalib); - tau->setP4(calibratedVec.Pt(), calibratedVec.Eta(), calibratedVec.Phi(), calibratedVec.M()); + // avoid unphysical tau calibration + if (abs(tau->etaFinalCalib()) < 5) { + TLorentzVector calibratedVec = tau->p4(xAOD::TauJetParameters::FinalCalib); + tau->setP4(calibratedVec.Pt(), calibratedVec.Eta(), calibratedVec.Phi(), calibratedVec.M()); + } tauEta = tau->eta(); tauPhi = tau->phi(); @@ -270,9 +273,9 @@ StatusCode tauMonitorAlgorithm::fillHistograms( const EventContext& ctx ) const if ( (m_kinGroupName != "tauMonKinGroupTauTrig" && m_kinGroupName != "tauMonKinGroupEleTrig" && m_kinGroupName != "tauMonKinGroupJetTrig") || - (m_kinGroupName == "tauMonKinGroupTauTrig" && trigDecTool !=0 && trigDecTool->isPassed("HLT_tau[2-9][0-9]_.*")) || - (m_kinGroupName == "tauMonKinGroupEleTrig" && trigDecTool !=0 && trigDecTool->isPassed("HLT_e[2-9][0-9]_.*")) || - (m_kinGroupName == "tauMonKinGroupJetTrig" && trigDecTool !=0 && trigDecTool->isPassed("HLT_j[2-9][0-9]_.*")) + (m_kinGroupName == "tauMonKinGroupTauTrig" && !trigDecTool.empty() && trigDecTool->isPassed("HLT_tau[2-9][0-9]_.*")) || + (m_kinGroupName == "tauMonKinGroupEleTrig" && !trigDecTool.empty() && trigDecTool->isPassed("HLT_e[2-9][0-9]_.*")) || + (m_kinGroupName == "tauMonKinGroupJetTrig" && !trigDecTool.empty() && trigDecTool->isPassed("HLT_j[2-9][0-9]_.*")) ){ if(m_kinGroupName != "tauMonKinGroupGlobal" && tauEt > lowerEtThreshold && tauBDTLoose){ diff --git a/Reconstruction/tauRec/python/TauRecBuilder.py b/Reconstruction/tauRec/python/TauRecBuilder.py index d7ae84c0b8b9fbd1022f6fc8e4973351aa4fcbec..cdab5f3e925a016e0ad897c3a02412181076a8f6 100644 --- a/Reconstruction/tauRec/python/TauRecBuilder.py +++ b/Reconstruction/tauRec/python/TauRecBuilder.py @@ -47,16 +47,12 @@ class TauRecCoreBuilder ( TauRecConfigured ) : 'CaloCellContainer' : 'TauCommonPi0Cells', } - # drop TauCommonPi0Cells container from nominal xAODs, too heavy - _outputAOD = _output.copy() - _outputAOD.pop('CaloCellContainer') - def __init__(self, name = "TauCoreBuilder",doPi0Clus=False, doTJVA=False): self.name = name self.doPi0Clus = doPi0Clus self.do_TJVA = doTJVA - TauRecConfigured.__init__(self, name) + TauRecConfigured.__init__(self, name, doPi0Clus) @@ -69,8 +65,8 @@ class TauRecCoreBuilder ( TauRecConfigured ) : from RecExConfig.ObjKeyStore import objKeyStore objKeyStore.addManyTypesStreamESD(self._output) - objKeyStore.addManyTypesStreamAOD(self._outputAOD) - objKeyStore.addManyTypesTransient(self._output) + objKeyStore.addManyTypesStreamAOD(self._output) + objKeyStore.addManyTypesTransient(self._output) import tauRec.TauAlgorithmsHolder as taualgs from tauRec.tauRecFlags import tauFlags @@ -99,9 +95,11 @@ class TauRecCoreBuilder ( TauRecConfigured ) : tools.append(taualgs.getTauTrackRNNClassifier()) if jobproperties.Beam.beamType()!="cosmics": tools.append(taualgs.getEnergyCalibrationLC(correctEnergy=True, correctAxis=False, postfix='_onlyEnergy')) + tools.append(taualgs.getCellVariables()) tools.append(taualgs.getElectronVetoVars()) tools.append(taualgs.getTauShotFinder()) + if self.doPi0Clus: tools.append(taualgs.getPi0ClusterFinder()) @@ -127,181 +125,4 @@ class TauRecCoreBuilder ( TauRecConfigured ) : def outputType(self): return self._outputType - -# No longer used -################################################################################ -## @class TauRecPi0EflowProcessor -# Calculate eflow information and run the Pi0 finder algorithms -################################################################################ -class TauRecPi0EflowProcessor ( TauRecConfigured ) : - """Calculate eflow information and run the Pi0 finder algorithms. - This needs to be done in a separate step, because first special cluster and cell container have to be build. - """ - - def __init__(self, name = "TauProcessorPi0EflowTools",doPi0Clus=False): - self.name = name - self.doPi0Clus = doPi0Clus - TauRecConfigured.__init__(self, name) - - def configure(self): - mlog = logging.getLogger ('TauRecPi0EflowProcessor::configure:') - mlog.info('entering') - - - import tauRec.TauAlgorithmsHolder as taualgs - - ######################################################################## - # Tau Modifier Algos - ######################################################################## - try: - from tauRecTools.tauRecToolsConf import TauProcessorTool - self._TauProcessorToolHandle = TauProcessorTool( - name = self.name, - TauContainer = _outputKey, - TauAuxContainer = _outputAuxKey, - ) - except Exception: - mlog.error("could not get handle to TauProcessor") - traceback.print_exc() - return False - - tools = [] - try: - #tools.append(taualgs.getTauEflowTrackMatchCells()) - #tools.append(taualgs.getTauEflowAddCaloInfo()) - #tools.append(taualgs.getTauEflowVariables()) - - if self.doPi0Clus: tools.append(taualgs.getPi0ClusterCreator()) - - TauRecConfigured.AddToolsToToolSvc(self, tools) - self.TauProcessorToolHandle().Tools = tools - - except Exception: - mlog.error("could not append tools to TauProcessor") - traceback.print_exc() - return False - - TauRecConfigured.WrapTauRecToolExecHandle(self, self.TauProcessorToolHandle()) - - return True - - # Helpers - def TauProcessorToolHandle(self): - return self._TauProcessorToolHandle - -# No longer used -################################################################################ -## @class TauRecVariablesProcessor -# Calculate remaining Tau variables and properties -################################################################################ -class TauRecVariablesProcessor ( TauRecConfigured ) : - """Calculate remaining Tau variables and properties. - Use informations available also in AODs, so no cell level is needed. - """ - - def __init__(self, name = "TauRecVariablesProcessor", inAODmode=False, doPi0Clus=False): - self.name = name - self.doPi0Clus = doPi0Clus - self.AODmode = inAODmode - TauRecConfigured.__init__(self, name) - - - def configure(self): - mlog = logging.getLogger ('TauRecVariablesProcessor::configure:') - mlog.info('entering') - - - import tauRec.TauAlgorithmsHolder as taualgs - - ######################################################################## - # Tau Modifier Algos - ######################################################################## - try: - from tauRecTools.tauRecToolsConf import TauProcessorTool - self._TauProcessorToolHandle = TauProcessorTool( - name = self.name, - TauContainer = _outputKey, - TauAuxContainer = _outputAuxKey, - runOnAOD = self.AODmode) - - except Exception: - mlog.error("could not get handle to TauProcessorTool") - traceback.print_exc() - return False - - tools = [] - try: - #tools.append(taualgs.getEnergyCalibrationEM()) - # run vertex finder only in case vertexing is available. This check can also be done in TauAlgorithmsHolder instead doing it here. - from InDetRecExample.InDetJobProperties import InDetFlags - if InDetFlags.doVertexFinding(): - tools.append(taualgs.getTauVertexVariables()) - tools.append(taualgs.getTauCommonCalcVars()) - tools.append(taualgs.getTauSubstructure()) - if self.doPi0Clus: - tools.append(taualgs.getPi0ClusterScaler()) - tools.append(taualgs.getPi0ScoreCalculator()) - # SWITCHED OFF SELECTOR< SINCE NO CHARGED PFOS AVAILABLE ATM - tools.append(taualgs.getPi0Selector()) - tools.append(taualgs.getEnergyCalibrationLC(correctEnergy=False, correctAxis=True, postfix='_onlyAxis')) - # - ## for testing purpose - #tools.append(taualgs.getTauTestDump()) - # - - from tauRec.tauRecFlags import tauFlags - - # PanTau: - if tauFlags.doPanTau() : - import PanTauAlgs.JobOptions_Main_PanTau as pantau - tools.append(pantau.getPanTau()) - - #these tools need pantau info - tools.append(taualgs.getCombinedP4FromRecoTaus()) - if jobproperties.Beam.beamType()!="cosmics": - tools.append(taualgs.getMvaTESVariableDecorator()) - tools.append(taualgs.getMvaTESEvaluator()) - - if tauFlags.doRunTauDiscriminant(): - tools.append(taualgs.getTauIDVarCalculator()) - tools.append(taualgs.getTauJetBDTEvaluator("TauJetBDT1P", weightsFile="vars2016_pt_gamma_1p_isofix.root", minNTracks=0, maxNTracks=1)) #update config? - tools.append(taualgs.getTauJetBDTEvaluator("TauJetBDT3P", weightsFile="vars2016_pt_gamma_3p_isofix.root", minNTracks=2, maxNTracks=1000)) #update config? - tools.append(taualgs.getTauWPDecoratorJetBDT()) - tools.append(taualgs.getTauJetBDTEvaluator("TauEleBDT_def", weightsFile="", outputVarName="BDTEleScore"))#just inits values - tools.append(taualgs.getTauJetBDTEvaluator("TauEleBDT_bar", - weightsFile="EleBDT1PBar.root", minNTracks=1, maxAbsTrackEta=1.37, - outputVarName="BDTEleScore")) #update config? - tools.append(taualgs.getTauJetBDTEvaluator("TauEleBDT_end1", - weightsFile="EleBDT1PEnd1.root", minNTracks=1, minAbsTrackEta=1.37, - maxAbsTrackEta=2.0, outputVarName="BDTEleScore")) #update config? - tools.append(taualgs.getTauJetBDTEvaluator("TauEleBDT_end23", - weightsFile="EleBDT1PEnd23.root", minNTracks=1, minAbsTrackEta=2.0, - maxAbsTrackEta=3.0, outputVarName="BDTEleScore")) #update config? - tools.append(taualgs.getTauWPDecoratorEleBDT()) - tools.append(taualgs.getTauEleOLRDecorator()) - pass - - tools+=tauFlags.tauRecToolsDevToolListProcessor() - ## lock tau containers -> must be the last tau tool!! - #tools.append(taualgs.getContainerLock()) - TauRecConfigured.AddToolsToToolSvc(self, tools) - self.TauProcessorToolHandle().Tools = tools - - except Exception: - mlog.error("could not append tools to TauProcessor") - traceback.print_exc() - return False - - self - - TauRecConfigured.WrapTauRecToolExecHandle(self, self.TauProcessorToolHandle()) - - - return True - - - #helpers - def TauProcessorToolHandle(self): - return self._TauProcessorToolHandle - #end diff --git a/Reconstruction/tauRec/python/TauRecConfigured.py b/Reconstruction/tauRec/python/TauRecConfigured.py index 40ae35427c91ea5c7404621935ed40a3c81e1edf..3f304e835bdbfadba75e95ddb99dbd4744870996 100644 --- a/Reconstruction/tauRec/python/TauRecConfigured.py +++ b/Reconstruction/tauRec/python/TauRecConfigured.py @@ -26,7 +26,7 @@ class TauRecConfigured ( Configured ) : into a tauRec/TauProcessorAlg algorithm """ - def __init__(self, name = "TauRecConfigured", msglevel=3, ignoreExistingDataObject=True) : + def __init__(self, name = "TauRecConfigured", doPi0Clus = True, msglevel=3, ignoreExistingDataObject=True) : self.name = name self.msglevel = msglevel from tauRec.tauRecConf import TauProcessorAlg @@ -42,7 +42,7 @@ class TauRecConfigured ( Configured ) : Key_tauTrackOutputContainer="TauTracks", Key_tauShotClusOutputContainer="TauShotClusters", Key_tauShotPFOOutputContainer="TauShotParticleFlowObjects", - Key_tauPi0CellOutputContainer="TauCommonPi0Cells", + Key_tauPi0CellOutputContainer = "TauCommonPi0Cells" if doPi0Clus else "", MaxEta = tauFlags.tauRecSeedMaxEta(), MinPt = tauFlags.tauRecSeedMinPt(), CellMakerTool = TauCellContainerFinalizer) diff --git a/Reconstruction/tauRec/src/TauProcessorAlg.cxx b/Reconstruction/tauRec/src/TauProcessorAlg.cxx index 3a8ce013473ac1b99d02342588fd800da346d8e9..3d7d313906c4dacb1fec5a8f9cb3a2dfca46fdfb 100644 --- a/Reconstruction/tauRec/src/TauProcessorAlg.cxx +++ b/Reconstruction/tauRec/src/TauProcessorAlg.cxx @@ -40,16 +40,18 @@ TauProcessorAlg::~TauProcessorAlg() { // Initializer //----------------------------------------------------------------------------- StatusCode TauProcessorAlg::initialize() { - ATH_CHECK( detStore()->retrieve(m_cellID) ); ATH_CHECK( m_jetInputContainer.initialize() ); ATH_CHECK( m_tauOutputContainer.initialize() ); ATH_CHECK( m_tauTrackOutputContainer.initialize() ); ATH_CHECK( m_tauShotClusOutputContainer.initialize() ); ATH_CHECK( m_tauShotPFOOutputContainer.initialize() ); - ATH_CHECK( m_tauPi0CellOutputContainer.initialize() ); - - ATH_CHECK( m_cellMakerTool.retrieve() ); + ATH_CHECK( m_tauPi0CellOutputContainer.initialize(SG::AllowEmpty) ); + + if(!m_tauPi0CellOutputContainer.empty()) { + ATH_CHECK( detStore()->retrieve(m_cellID) ); + ATH_CHECK( m_cellMakerTool.retrieve() ); + } //------------------------------------------------------------------------- // No tools allocated! @@ -98,24 +100,28 @@ StatusCode TauProcessorAlg::execute(const EventContext& ctx) const { ATH_CHECK(tauShotPFOHandle.record(std::make_unique<xAOD::PFOContainer>(), std::make_unique<xAOD::PFOAuxContainer>())); xAOD::PFOContainer* tauShotPFOContainer = tauShotPFOHandle.ptr(); - SG::WriteHandle<CaloCellContainer> tauPi0CellHandle( m_tauPi0CellOutputContainer, ctx ); - ATH_CHECK(tauPi0CellHandle.record(std::make_unique<CaloCellContainer>())); - CaloCellContainer* Pi0CellContainer = tauPi0CellHandle.ptr(); + CaloCellContainer* Pi0CellContainer = nullptr; + std::vector<CaloCell*> addedCellsMap; + + if(!m_tauPi0CellOutputContainer.empty()) { + SG::WriteHandle<CaloCellContainer> tauPi0CellHandle( m_tauPi0CellOutputContainer, ctx ); + ATH_CHECK(tauPi0CellHandle.record(std::make_unique<CaloCellContainer>())); + Pi0CellContainer = tauPi0CellHandle.ptr(); + + // Initialize the cell map per event, used to avoid dumplicate cell in TauPi0CreateROI + IdentifierHash hashMax = m_cellID->calo_cell_hash_max(); + ATH_MSG_DEBUG("CaloCell Hash Max: " << hashMax); + addedCellsMap.resize(hashMax,NULL); + } - /// retrieve the input jet seed container + // retrieve the input jet seed container SG::ReadHandle<xAOD::JetContainer> jetHandle( m_jetInputContainer, ctx ); if (!jetHandle.isValid()) { ATH_MSG_ERROR ("Could not retrieve HiveDataObj with key " << jetHandle.key()); return StatusCode::FAILURE; } const xAOD::JetContainer *pSeedContainer = jetHandle.cptr(); - - /// Initialize the cell map per event, used to avoid dumplicate cell in TauPi0CreateROI - IdentifierHash hashMax = m_cellID->calo_cell_hash_max(); - ATH_MSG_DEBUG("CaloCell Hash Max: " << hashMax); - std::vector<CaloCell*> addedCellsMap; - addedCellsMap.resize(hashMax,NULL); - + //--------------------------------------------------------------------- // Loop over seeds //--------------------------------------------------------------------- @@ -157,10 +163,10 @@ StatusCode TauProcessorAlg::execute(const EventContext& ctx) const { else if ( tool->type() == "tauRecTools::TauTrackClassifier" || tool->type() == "tauRecTools::TauTrackRNNClassifier" ) { sc = tool->executeTrackClassifier(*pTau, *pTauTrackCont); } - else if ( tool->type() == "TauShotFinder"){ + else if ( tool->type() == "TauShotFinder") { sc = tool->executeShotFinder(*pTau, *tauShotClusContainer, *tauShotPFOContainer); } - else if ( tool->type() == "TauPi0CreateROI"){ + else if ( tool->type() == "TauPi0CreateROI") { sc = tool->executePi0CreateROI(*pTau, *Pi0CellContainer, addedCellsMap); } else { @@ -183,11 +189,13 @@ StatusCode TauProcessorAlg::execute(const EventContext& ctx) const { }// loop through seeds // Check this is needed for the cell container? - // symlink as INavigable4MomentumCollection (as in CaloRec/CaloCellMaker) - ATH_CHECK(evtStore()->symLink(Pi0CellContainer, static_cast<INavigable4MomentumCollection*> (0))); - - // sort the cell container by hash - ATH_CHECK( m_cellMakerTool->process(static_cast<CaloCellContainer*> (Pi0CellContainer), ctx) ); + if(Pi0CellContainer) { + // symlink as INavigable4MomentumCollection (as in CaloRec/CaloCellMaker) + ATH_CHECK(evtStore()->symLink(Pi0CellContainer, static_cast<INavigable4MomentumCollection*> (0))); + + // sort the cell container by hash + ATH_CHECK( m_cellMakerTool->process(static_cast<CaloCellContainer*> (Pi0CellContainer), ctx) ); + } ATH_MSG_VERBOSE("The tau candidate container has been modified"); diff --git a/Reconstruction/tauRec/test/test_tau_standalone_multithread.sh b/Reconstruction/tauRec/test/test_tau_standalone_multithread.sh index 6e2de893c5172a1f1fb4a99400465a854da52e4d..01a1d13a0bbbc1a2fa88af104441ad3b62aca987 100755 --- a/Reconstruction/tauRec/test/test_tau_standalone_multithread.sh +++ b/Reconstruction/tauRec/test/test_tau_standalone_multithread.sh @@ -18,7 +18,7 @@ athena.py --threads 4 --evtMax ${NEVENTS} tauRec/tau_standalone_ESDtoAOD.py >> echo "art-result: $? Reconstrution" # compare the AOD file -art.py compare ref --entries ${NEVENTS} --mode semi-detailed --excluded-vars=mc_event_number --order-trees --diff-root AOD.pool.root ${REF_DIR}/AOD.pool.root >> AOD_diff_root.log 2>&1 +art.py compare ref --entries ${NEVENTS} --mode detailed --excluded-vars=mc_event_number --order-trees --diff-root AOD.pool.root ${REF_DIR}/AOD.pool.root >> AOD_diff_root.log 2>&1 echo "art-result: $? diff-root" # run the physics validation diff --git a/Reconstruction/tauRec/test/test_tau_standalone_serial.sh b/Reconstruction/tauRec/test/test_tau_standalone_serial.sh index 1dbaf0c82c2f3259c4c97e2bffc9419360fd9711..db14045c9fc76108732c2660701b62055ea2f27c 100755 --- a/Reconstruction/tauRec/test/test_tau_standalone_serial.sh +++ b/Reconstruction/tauRec/test/test_tau_standalone_serial.sh @@ -17,7 +17,7 @@ athena.py --evtMax ${NEVENTS} tauRec/tau_standalone_ESDtoAOD.py >> tau_standalo echo "art-result: $? Reconstrution" # compare the AOD file -art.py compare ref --entries ${NEVENTS} --mode semi-detailed --order-trees --diff-root AOD.pool.root ${REF_DIR}/AOD.pool.root >> AOD_diff_root.log 2>&1 +art.py compare ref --entries ${NEVENTS} --mode detailed --order-trees --diff-root AOD.pool.root ${REF_DIR}/AOD.pool.root >> AOD_diff_root.log 2>&1 echo "art-result: $? diff-root" # run the physics validation diff --git a/Reconstruction/tauRecTools/src/TauElectronVetoVariables.cxx b/Reconstruction/tauRecTools/src/TauElectronVetoVariables.cxx index c4ffe0d518f418d3c1649abf04187eb0371970fe..9816326736b008a9988da4e162ccd5b4db0f441c 100644 --- a/Reconstruction/tauRecTools/src/TauElectronVetoVariables.cxx +++ b/Reconstruction/tauRecTools/src/TauElectronVetoVariables.cxx @@ -4,9 +4,7 @@ #ifndef XAOD_ANALYSIS -#include <algorithm> -#include <cmath> -#include <sstream> + #include "GaudiKernel/SystemOfUnits.h" #include "CaloUtils/CaloVertexedCell.h" @@ -19,7 +17,10 @@ #include "TrkParametersIdentificationHelpers/TrackParametersIdHelper.h" #include "RecoToolInterfaces/IParticleCaloExtensionTool.h" #include "TauElectronVetoVariables.h" - +#include <algorithm> +#include <cmath> +#include <unordered_map> +#include <array> using Gaudi::Units::GeV; //------------------------------------------------------------------------- @@ -40,10 +41,11 @@ TauElectronVetoVariables::~TauElectronVetoVariables() { } StatusCode TauElectronVetoVariables::initialize() { ATH_CHECK( m_caloExtensionTool.retrieve() ); - - if (!m_ParticleCacheKey.key().empty()) {ATH_CHECK(m_ParticleCacheKey.initialize());} - else {m_useOldCalo = true;} - + if (!m_ParticleCacheKey.key().empty()) { + ATH_CHECK(m_ParticleCacheKey.initialize()); + } else { + m_useOldCalo = true; + } return StatusCode::SUCCESS; } @@ -55,14 +57,11 @@ StatusCode TauElectronVetoVariables::execute(xAOD::TauJet& pTau) const if (pTau.nTracks() < 1) { return StatusCode::SUCCESS; } - ATH_MSG_DEBUG("in execute()"); - float detPhiTrk = 0.; float detEtaTrk = 0.; float clEtaTrk = 0.; float distEtaTrk = 0.; - float energy_3phi[101] = {0.0}; float eta[101] = {0.0}; int max1 = 0; @@ -74,9 +73,7 @@ StatusCode TauElectronVetoVariables::execute(xAOD::TauJet& pTau) const float etamaxcut = 0.158; float phimaxcut = 0.1; float signum_eta = 0.; - signum_eta = pTau.track(0)->eta() / std::abs(pTau.track(0)->eta()); - float sumETCellsLAr = 0.; float eta0cut = 0.075; float eta1cut = 0.0475; @@ -93,31 +90,26 @@ StatusCode TauElectronVetoVariables::execute(xAOD::TauJet& pTau) const float sumETCellsHad1 = 0.; float etahadcut = 0.2; float phihadcut = 0.2; - const CaloCell *pCell; - int trackIndex = -1; //--------------------------------------------------------------------- // Calculate eta, phi impact point of leading track at calorimeter layers EM 0,1,2,3 //--------------------------------------------------------------------- Trk::TrackParametersIdHelper parsIdHelper; - - const int numOfsampEM = 4; - double eta_extrapol[4]; - double phi_extrapol[4]; - - for (int i = 0; i < numOfsampEM; ++i) { - eta_extrapol[i] = -11111.; - phi_extrapol[i] = -11111.; - } - + constexpr size_t numberOfEM_Layers{4}; + constexpr double invalidCoordinate{-11111.}; + constexpr double invalidCoordinateThreshold{-11110.}; + std::array<double, numberOfEM_Layers> extrapolatedEta{}; + std::array<double, numberOfEM_Layers> extrapolatedPhi{}; + extrapolatedEta.fill(invalidCoordinate); + extrapolatedPhi.fill(invalidCoordinate); + /*get the CaloExtension object*/ const Trk::CaloExtension * caloExtension = nullptr; std::unique_ptr<Trk::CaloExtension> uniqueExtension ; const xAOD::TrackParticle *orgTrack = pTau.track(0)->track(); trackIndex = orgTrack->index(); - if (m_useOldCalo) { /* If CaloExtensionBuilder is unavailable, use the calo extension tool */ ATH_MSG_VERBOSE("Using the CaloExtensionTool"); @@ -135,20 +127,15 @@ StatusCode TauElectronVetoVariables::execute(xAOD::TauJet& pTau) const caloExtension = uniqueExtension.get(); } } - const std::vector<const Trk::CurvilinearParameters*>& clParametersVector = caloExtension->caloLayerIntersections(); - if( not caloExtension || clParametersVector.empty() ){ ATH_MSG_WARNING("extrapolation of leading track to calo surfaces failed : caloLayerIntersection is empty" ); return StatusCode::SUCCESS; } - // loop over calo layers for( const Trk::CurvilinearParameters * cur : clParametersVector ){ - // only use entry layer if( !parsIdHelper.isEntryToVolume(cur->cIdentifier()) ) continue; - CaloSampling::CaloSample sample = parsIdHelper.caloSample(cur->cIdentifier()); int index = -1; if( sample == CaloSampling::PreSamplerE || sample == CaloSampling::PreSamplerB ) index = 0; @@ -156,91 +143,68 @@ StatusCode TauElectronVetoVariables::execute(xAOD::TauJet& pTau) const else if( sample == CaloSampling::EME2 || sample == CaloSampling::EMB2 ) index = 2; else if( sample == CaloSampling::EME3 || sample == CaloSampling::EMB3 ) index = 3; if( index < 0 ) continue; - eta_extrapol[index] = cur->position().eta(); - phi_extrapol[index] = cur->position().phi(); + extrapolatedEta[index] = cur->position().eta(); + extrapolatedPhi[index] = cur->position().phi(); } - - for (int i = 0; i < numOfsampEM; ++i) { - if ( eta_extrapol[i] < -11110. || phi_extrapol[i] < -11110. ) - { + for (size_t i = 0; i < numberOfEM_Layers; ++i) { + if ( extrapolatedEta[i] < invalidCoordinateThreshold || extrapolatedPhi[i] < invalidCoordinateThreshold ){ ATH_MSG_DEBUG("extrapolation of leading track to calo surfaces failed for sampling : " << i ); return StatusCode::SUCCESS; } } - if (! pTau.jetLink().isValid()) { ATH_MSG_ERROR("tau does not have jet seed for electron veto cell variable calculation"); return StatusCode::FAILURE; } const xAOD::Jet* pJetSeed = pTau.jet(); - // Loop through jets, get links to clusters std::vector<const xAOD::CaloCluster*> clusterList; ATH_CHECK(tauRecTools::GetJetClusterList(pJetSeed, clusterList, m_useSubtractedCluster)); - - std::bitset<200000> cellSeen; - + std::bitset<200000> cellSeen{}; + const std::unordered_map<int, int> samplingLookup{ + {4,0}, {5,1}, {6,2}, {7,3}, {8,12}, + {15, 12}, {16,13}, {17,14}, {18,12}, {19, 13}, {20,14} + }; + const auto notFound{samplingLookup.end()}; for (auto cluster : clusterList){ - CaloClusterCellLink::const_iterator pCellIter = cluster->getCellLinks()->begin(); CaloClusterCellLink::const_iterator pCellIterE = cluster->getCellLinks()->end(); - - for (; pCellIter != pCellIterE; pCellIter++) { - - double cellEta, cellPhi, cellET; - + for (; pCellIter != pCellIterE; ++pCellIter) { + double cellEta{}, cellPhi{}, cellET{}; pCell = *pCellIter; - if (cellSeen.test(pCell->caloDDE()->calo_hash())) continue; - else cellSeen.set(pCell->caloDDE()->calo_hash()); - + if (cellSeen.test(pCell->caloDDE()->calo_hash())) continue; + else cellSeen.set(pCell->caloDDE()->calo_hash()); if (m_doVertexCorrection && pTau.vertexLink().isValid()) { CaloVertexedCell vxCell (*pCell, pTau.vertex()->position()); cellPhi = vxCell.phi(); cellEta = vxCell.eta(); cellET = vxCell.et(); - } - else { + } else { cellPhi = pCell->phi(); cellEta = pCell->eta(); cellET = pCell->et(); } - int sampling = pCell->caloDDE()->getSampling(); - if (sampling == 4) sampling = 0; - if (sampling == 5) sampling = 1; - if (sampling == 6) sampling = 2; - if (sampling == 7) sampling = 3; - if (sampling == 18) sampling = 12; - if (sampling == 8) sampling = 12; - if (sampling == 15) sampling = 12; - if (sampling == 19) sampling = 13; - if (sampling == 16) sampling = 13; - if (sampling == 20) sampling = 14; - if (sampling == 17) sampling = 14; - + if (const auto & pElement {samplingLookup.find(sampling)};pElement != notFound){ + sampling = pElement->second; + } int i = 2; if (sampling < 4) i = sampling; if (sampling == 12 || sampling == 13 || sampling == 14) i = 3; - - detPhiTrk = Tau1P3PKineUtils::deltaPhi( cellPhi, phi_extrapol[i] ); - detEtaTrk = std::abs( cellEta - eta_extrapol[i] ); - clEtaTrk = eta_extrapol[i]; - distEtaTrk = cellEta - eta_extrapol[i]; - + detPhiTrk = Tau1P3PKineUtils::deltaPhi( cellPhi, extrapolatedPhi[i] ); + detEtaTrk = std::abs( cellEta - extrapolatedEta[i] ); + clEtaTrk = extrapolatedEta[i]; + distEtaTrk = cellEta - extrapolatedEta[i]; if ((sampling == 0 && detEtaTrk < eta0cut && detPhiTrk < phi0cut) || (sampling == 1 && detEtaTrk < eta1cut && detPhiTrk < phi1cut) || (sampling == 2 && detEtaTrk < eta2cut && detPhiTrk < phi2cut) || (sampling == 3 && detEtaTrk < eta3cut && detPhiTrk < phi3cut)) { - sumETCellsLAr += cellET; } - if (sampling == 12 && detEtaTrk < etahadcut && detPhiTrk < phihadcut) sumETCellsHad1 += cellET; - if (std::abs(cellEta) > 0.8 && std::abs(cellEta) <= 1.2 && (sampling == 13 || sampling == 14) && detEtaTrk < etahadcut && detPhiTrk < phihadcut) { sumETCellsHad1 += cellET; } - if (std::abs(pTau.track(0)->eta()) <= 1.7) { if (sampling == 1 && detEtaTrk < etamaxcut && detPhiTrk <= phimaxcut) { if ((std::abs(cellEta) < 1.37 || std::abs(cellEta) > 1.52) && std::abs(cellEta) < 1.85) { @@ -261,82 +225,62 @@ StatusCode TauElectronVetoVariables::execute(xAOD::TauJet& pTau) const energy_3phi[n] = 0; eta[n] = 0; } - if (std::abs(cellEta) <= etacase1) { etareg = 0.00315; } else { etareg = 0.00415; } - } //end cell loop - }// end jet constituent loop - for (int m1 = 0; m1 < 101; m1++) { if ((energy_3phi[m1] > Emax1)) { Emax1 = energy_3phi[m1]; max1 = m1; } } - for (int m2 = 1; m2 < 100; m2++) { if (m2 == max1) continue; - if ((energy_3phi[m2] > Emax2) && (energy_3phi[m2] > energy_3phi[m2 - 1]) && (energy_3phi[m2] > energy_3phi[m2 + 1])) { Emax2 = energy_3phi[m2]; max2 = m2; } } - if (std::abs(eta[max1]) >= etareg) { max = max1; } else { max = max2; } - float TRTratio = -9999.0; - uint8_t TRTHTHits; - uint8_t TRTHTOutliers; - uint8_t TRTHits; - uint8_t TRTOutliers; - + uint8_t TRTHTHits{0}; + uint8_t TRTHTOutliers{0}; + uint8_t TRTHits{0}; + uint8_t TRTOutliers{0}; const xAOD::TrackParticle* leadTrack = pTau.track(0)->track(); - - if ( !leadTrack->summaryValue( TRTHits, xAOD::SummaryType::numberOfTRTHits ) ) - { + if ( !leadTrack->summaryValue( TRTHits, xAOD::SummaryType::numberOfTRTHits ) ){ ATH_MSG_DEBUG("retrieval of track summary value failed. Not filling electron veto variables for this one prong candidate"); return StatusCode::SUCCESS; } - if ( !leadTrack->summaryValue( TRTHTHits, xAOD::SummaryType::numberOfTRTHighThresholdHits ) ) - { + if ( !leadTrack->summaryValue( TRTHTHits, xAOD::SummaryType::numberOfTRTHighThresholdHits ) ){ ATH_MSG_DEBUG("retrieval of track summary value failed. Not filling electron veto variables for this one prong candidate"); return StatusCode::SUCCESS; } - if ( !leadTrack->summaryValue( TRTOutliers, xAOD::SummaryType::numberOfTRTOutliers ) ) - { + if ( !leadTrack->summaryValue( TRTOutliers, xAOD::SummaryType::numberOfTRTOutliers ) ){ ATH_MSG_DEBUG("retrieval of track summary value failed. Not filling electron veto variables for this one prong candidate"); return StatusCode::SUCCESS; } - if ( !leadTrack->summaryValue( TRTHTOutliers, xAOD::SummaryType::numberOfTRTHighThresholdOutliers ) ) - { + if ( !leadTrack->summaryValue( TRTHTOutliers, xAOD::SummaryType::numberOfTRTHighThresholdOutliers ) ) { ATH_MSG_DEBUG("retrieval of track summary value failed. Not filling electron veto variables for this one prong candidate"); return StatusCode::SUCCESS; } - - if (TRTHits + TRTOutliers != 0) { TRTratio = float( TRTHTHits + TRTHTOutliers) / float( TRTHits + TRTOutliers ); - } - else { + } else { TRTratio = 0.0; } - pTau.setDetail(xAOD::TauJetParameters::TRT_NHT_OVER_NLT , TRTratio ); pTau.setDetail(xAOD::TauJetParameters::secMaxStripEt , energy_3phi[max] ); pTau.setDetail(xAOD::TauJetParameters::hadLeakEt , static_cast<float>( sumETCellsHad1 / ( pTau.track(0)->pt() ) ) ); pTau.setDetail(xAOD::TauJetParameters::sumEMCellEtOverLeadTrkPt , static_cast<float>( ( sumETCellsLAr / ( pTau.track(0)->pt() ) ) ) ); - - return StatusCode::SUCCESS; } diff --git a/Reconstruction/tauRecTools/src/TauVertexVariables.cxx b/Reconstruction/tauRecTools/src/TauVertexVariables.cxx index 8f4370d01b1c36aac7b1c0870adeb9b69e993032..b8ce1f397581e49384995debcfcd836857929a7f 100644 --- a/Reconstruction/tauRecTools/src/TauVertexVariables.cxx +++ b/Reconstruction/tauRecTools/src/TauVertexVariables.cxx @@ -123,31 +123,56 @@ StatusCode TauVertexVariables::executeVertexVariables(xAOD::TauJet& pTau, xAOD:: pTau.setDetail(xAOD::TauJetParameters::trFlightPathSig, (float)(-1111.)); - //try to find secondary vertex if more than 1 track and the tau vertex is available + // try to find secondary vertex if more than 1 track and the tau vertex is available if ( pTau.nTracks() < 2 || !pTau.vertexLink().isValid() ) { return StatusCode::SUCCESS; } - // get xAOD TrackParticles and Trk::Tracks + // xAOD TrackParticles std::vector<const xAOD::TrackParticle*> xaodTracks; + // standard reconstruction uses Trk::Tracks in SeedFinder std::vector<const Trk::Track*> origTracks; + // reconstruction from xAOD uses Trk::TrackParameters (Trk::Track not available) + std::vector<const Trk::TrackParameters*> origTrackParameters; + for (unsigned i = 0; i < pTau.nTracks(); ++i) { xaodTracks.push_back(pTau.track(i)->track()); - ATH_MSG_VERBOSE("xAOD::TrackParticle " <<i<<": "<< pTau.track(i)->pt() << " " << pTau.track(i)->eta() << " " << pTau.track(i)->phi()); + if (pTau.track(i)->track()) { - origTracks.push_back(pTau.track(i)->track()->track()); + if(pTau.track(i)->track()->track()) { + origTracks.push_back(pTau.track(i)->track()->track()); + } + else { + const Trk::Perigee& perigee = pTau.track(i)->track()->perigeeParameters(); + origTrackParameters.push_back(static_cast<const Trk::TrackParameters*>(&perigee)); + } } else { - ATH_MSG_WARNING("no Trk::Track for xAOD::TrackParticle"); + ATH_MSG_WARNING("No TrackParticle found."); } } - // get the starting point for the fit using Trk::Tracks - const Amg::Vector3D& seedPoint = m_SeedFinder->findSeed(origTracks); - ATH_MSG_VERBOSE("seedPoint x/y/perp=" << seedPoint.x() << " " << seedPoint.y() << " "<< seedPoint.z() << " " << std::sqrt(seedPoint.x()*seedPoint.x()+seedPoint.y()+seedPoint.y())); + // origTrackParameters should be empty in standard reconstruction, origTracks should be empty when re-running from xAOD + if(origTracks.size()>0 && origTrackParameters.size()>0) { + ATH_MSG_ERROR("Inconsistent mix of Trk::Track and Trk::TrackParameter"); + return StatusCode::FAILURE; + } + + xAOD::Vertex* xAODvertex = nullptr; + + if(origTracks.size() > 0) { + // get the starting point for the fit using Trk::Tracks + const Amg::Vector3D& seedPoint = m_SeedFinder->findSeed(origTracks); + // fitting the vertex + xAODvertex = m_fitTool->fit(xaodTracks, seedPoint); + } + else if (origTrackParameters.size() > 0) { + // get the starting point for the fit using Trk::TrackParameters + const Amg::Vector3D& seedPoint = m_SeedFinder->findSeed(origTrackParameters); + // fitting the vertex + xAODvertex = m_fitTool->fit(xaodTracks, seedPoint); + } - // fitting the vertex itself - xAOD::Vertex* xAODvertex = m_fitTool->fit(xaodTracks, seedPoint); if (!xAODvertex) { ATH_MSG_WARNING("no secondary vertex found!"); return StatusCode::SUCCESS; @@ -163,7 +188,7 @@ StatusCode TauVertexVariables::executeVertexVariables(xAOD::TauJet& pTau, xAOD:: ATH_MSG_VERBOSE("secondary vertex recorded! x="<<xAODvertex->position().x()<< ", y="<<xAODvertex->position().y()<<", perp="<<xAODvertex->position().perp()); pSecVtxContainer.push_back(xAODvertex); xAODvertex->setVertexType(xAOD::VxType::NotSpecified); - pTau.setSecondaryVertex(&pSecVtxContainer, xAODvertex); // set the link to the vertex + pTau.setSecondaryVertex(&pSecVtxContainer, xAODvertex); } else { delete xAODvertex; // delete the vertex when in trigger mode, because we can not save it diff --git a/Simulation/BeamEffects/python/BeamEffectsAlgConfig.py b/Simulation/BeamEffects/python/BeamEffectsAlgConfig.py index baae1d130d89e10398dea878de53319f8aed74df..5d6eb8d20bac9f602c7377ce769aab0328ee2765 100755 --- a/Simulation/BeamEffects/python/BeamEffectsAlgConfig.py +++ b/Simulation/BeamEffects/python/BeamEffectsAlgConfig.py @@ -102,7 +102,7 @@ def BeamEffectsAlgBasicCfg(ConfigFlags, **kwargs): alg = Simulation__BeamEffectsAlg(name="BeamEffectsAlg", **kwargs) # Set default properties - alg.ISFRun = False + alg.ISFRun = ConfigFlags.Sim.ISFRun alg.InputMcEventCollection = "GEN_EVENT" alg.OutputMcEventCollection = "BeamTruthEvent" @@ -170,7 +170,7 @@ if __name__ == "__main__": #included to stop segmentation error - TODO see why it's failing ConfigFlags.Input.isMC = True ConfigFlags.IOVDb.GlobalTag = "OFLCOND-MC16-SDR-14" #conditions tag for conddb (which one to use - old one for simulation) - ConfigFlags.Input.RunNumber = 284500 # run test job with and without run number and 222510 + ConfigFlags.Input.RunNumber = [284500] # run test job with and without run number and 222510 # Finalize ConfigFlags.lock() diff --git a/Simulation/BeamEffects/src/BeamEffectsAlg.cxx b/Simulation/BeamEffects/src/BeamEffectsAlg.cxx index 6ea0fb81b47f2f8664fb7bc300605acb54f2663c..3896ca65118d31382c343b8656d97db7c123fd72 100644 --- a/Simulation/BeamEffects/src/BeamEffectsAlg.cxx +++ b/Simulation/BeamEffects/src/BeamEffectsAlg.cxx @@ -83,19 +83,19 @@ namespace Simulation { //Ensure that we have a valid signal_process_vertex #ifdef HEPMC3 - if( !HepMC::signal_process_vertex(ge) ) { + if( !HepMC::signal_process_vertex(&ge) ) { if(m_ISFRun) { ATH_MSG_DEBUG("No signal_process_vertex found - creating a dummy GenVertex."); HepMC::FourVector signalPos( 0.0, 0.0, 0.0, 0.0); HepMC::GenVertexPtr signalVertex = HepMC::newGenVertexPtr( signalPos ); // ge will now take ownership of the signal process vertex - HepMC::set_signal_process_vertex(ge, signalVertex ); + HepMC::set_signal_process_vertex(&ge, signalVertex ); } else { - if (!ge.vertices_empty()) { + if (!ge.vertices().empty()) { ATH_MSG_DEBUG("No signal_process_vertex found - using the first GenVertex in the event."); HepMC::GenVertexPtr signalVertex = ge.vertices().front(); - HepMC::set_signal_process_vertex(ge,signalVertex ); + HepMC::set_signal_process_vertex(&ge,signalVertex ); } } if( !HepMC::signal_process_vertex(&ge) ) { // Insanity check diff --git a/Simulation/BeamEffects/src/BeamSpotReweightingAlg.cxx b/Simulation/BeamEffects/src/BeamSpotReweightingAlg.cxx index fc8a8c89f806f496d8fa7985a3e6400ccbbc665d..381722b61e741250bb547898e8c20156e7871152 100644 --- a/Simulation/BeamEffects/src/BeamSpotReweightingAlg.cxx +++ b/Simulation/BeamEffects/src/BeamSpotReweightingAlg.cxx @@ -76,7 +76,7 @@ namespace Simulation ATH_MSG_WARNING("No first event found in the McEventCollection input collection, use default weight="<<weight); break; } - HepMC::GenVertex *signalVertex = GetSignalProcessVertex(*currentGenEvent); + auto signalVertex = GetSignalProcessVertex(*currentGenEvent); if(signalVertex) { //now calculate weight @@ -130,17 +130,17 @@ namespace Simulation return StatusCode::SUCCESS; } - HepMC::GenVertex* BeamSpotReweightingAlg::GetSignalProcessVertex(const HepMC::GenEvent& ge) const + HepMC::ConstGenVertexPtr BeamSpotReweightingAlg::GetSignalProcessVertex(const HepMC::GenEvent& ge) const { //Ensure that we have a valid signal_process_vertex #ifdef HEPMC3 - if( !HepMC::signal_process_vertex(ge) ) { - if (!ge.vertices_empty()) { + if( !HepMC::signal_process_vertex(&ge) ) { + if (!ge.vertices().empty()) { ATH_MSG_DEBUG("No signal_process_vertex found - using the first GenVertex in the event."); - HepMC::GenVertexPtr signalVertex = ge.vertices().front(); + auto signalVertex = ge.vertices().front(); return signalVertex; } - if( !HepMC::signal_process_vertex(ge) ) { // Insanity check + if( !HepMC::signal_process_vertex(&ge) ) { // Insanity check if (!ge.vertices().empty()) { ATH_MSG_ERROR("Failed to set signal_process_vertex for GenEvent!!"); return nullptr; @@ -151,7 +151,7 @@ namespace Simulation } else { ATH_MSG_DEBUG("signal_process_vertex set by Generator."); - return HepMC::signal_process_vertex(ge); + return HepMC::signal_process_vertex(&ge); } #else if( !ge.signal_process_vertex() ) { diff --git a/Simulation/BeamEffects/src/BeamSpotReweightingAlg.h b/Simulation/BeamEffects/src/BeamSpotReweightingAlg.h index 88d81b5d80e2c40018578ac5426d16112857e88e..5a53f6b27b25d3a2556bf8b091b988e6f07b3be0 100644 --- a/Simulation/BeamEffects/src/BeamSpotReweightingAlg.h +++ b/Simulation/BeamEffects/src/BeamSpotReweightingAlg.h @@ -53,7 +53,7 @@ namespace Simulation private: /** Ensure that the GenEvent::signal_process_vertex has been set */ - HepMC::GenVertex* GetSignalProcessVertex(const HepMC::GenEvent& ge) const; + HepMC::ConstGenVertexPtr GetSignalProcessVertex(const HepMC::GenEvent& ge) const; SG::ReadHandleKey<McEventCollection> m_inputMcEventCollection { this, "InputMcEventCollection", "TruthEvent", "The name of the input McEventCollection" }; diff --git a/Simulation/BeamEffects/test/BeamEffectsAlg_test.cxx b/Simulation/BeamEffects/test/BeamEffectsAlg_test.cxx index a6f12833eb2eace2f4b2ba35e84545051883b03f..4a7ac7cb8306a1e7eaa59e694a2c936ca99be7a1 100644 --- a/Simulation/BeamEffects/test/BeamEffectsAlg_test.cxx +++ b/Simulation/BeamEffects/test/BeamEffectsAlg_test.cxx @@ -20,6 +20,7 @@ #include "AtlasHepMC/GenEvent.h" #include "AtlasHepMC/GenVertex.h" #include "AtlasHepMC/GenParticle.h" +#include "AtlasHepMC/Operators.h" // CLHEP includes #include "CLHEP/Vector/LorentzVector.h" @@ -94,41 +95,49 @@ namespace SimTesting { TEST_F(BeamEffectsAlg_test, patchSignalProcessVertex_empty_GenEvent) { HepMC::GenEvent ge; ASSERT_TRUE( patchSignalProcessVertex(ge).isSuccess() ); - ASSERT_TRUE( ge.signal_process_vertex()==nullptr ); + ASSERT_TRUE( HepMC::signal_process_vertex(&ge)==nullptr ); } TEST_F(BeamEffectsAlg_test, signal_process_vertex_exists) { HepMC::GenEvent ge; CLHEP::HepLorentzVector myPos( 1.0, 1.0, 1.0, 1.0); - HepMC::GenVertexPtr myVertex = HepMC::newGenVertexPtr( myPos, -1 ); - ge.set_signal_process_vertex( myVertex ); + HepMC::GenVertexPtr myVertex = HepMC::newGenVertexPtr( HepMC::FourVector(myPos.x(),myPos.y(),myPos.z(),myPos.t()), -1 ); + HepMC::set_signal_process_vertex(&ge, myVertex ); ASSERT_TRUE( patchSignalProcessVertex(ge).isSuccess() ); - ASSERT_TRUE( ge.signal_process_vertex()==myVertex ); + ASSERT_TRUE( HepMC::signal_process_vertex(&ge)==myVertex ); } TEST_F(BeamEffectsAlg_test, add_signal_process_vertex_atlasG4) { HepMC::GenEvent ge; CLHEP::HepLorentzVector myPos( 1.0, 1.0, 1.0, 1.0); - HepMC::GenVertexPtr myVertex = HepMC::newGenVertexPtr( myPos, -1 ); + HepMC::GenVertexPtr myVertex = HepMC::newGenVertexPtr( HepMC::FourVector(myPos.x(),myPos.y(),myPos.z(),myPos.t()), -1 ); ge.add_vertex( myVertex ); - ASSERT_TRUE( ge.signal_process_vertex()==nullptr ); + ASSERT_TRUE( HepMC::signal_process_vertex(&ge)==nullptr ); ASSERT_TRUE( m_alg->setProperty( "ISFRun", false).isSuccess() ); ASSERT_TRUE( patchSignalProcessVertex(ge).isSuccess() ); - ASSERT_TRUE( ge.signal_process_vertex()==myVertex ); - ASSERT_EQ( *ge.signal_process_vertex(), *myVertex ); + ASSERT_TRUE( HepMC::signal_process_vertex(&ge)==myVertex ); +#ifdef HEPMC3 +//Not needed for HepMC3 +#else + ASSERT_EQ( *HepMC::signal_process_vertex(&ge), *myVertex ); +#endif } TEST_F(BeamEffectsAlg_test, add_signal_process_vertex_isfG4) { HepMC::GenEvent ge; CLHEP::HepLorentzVector myPos( 1.0, 1.0, 1.0, 1.0); - HepMC::GenVertexPtr myVertex = HepMC::newGenVertexPtr( myPos, -1 ); + HepMC::GenVertexPtr myVertex = HepMC::newGenVertexPtr( HepMC::FourVector(myPos.x(),myPos.y(),myPos.z(),myPos.t()), -1 ); HepMC::GenVertexPtr dummyVertex = HepMC::newGenVertexPtr(); ge.add_vertex( myVertex ); - ASSERT_TRUE( ge.signal_process_vertex()==nullptr ); + ASSERT_TRUE( HepMC::signal_process_vertex(&ge)==nullptr ); ASSERT_TRUE( m_alg->setProperty( "ISFRun", true).isSuccess() ); ASSERT_TRUE( patchSignalProcessVertex(ge).isSuccess() ); - ASSERT_TRUE( ge.signal_process_vertex()!=myVertex ); - ASSERT_EQ( *ge.signal_process_vertex(), *dummyVertex ); + ASSERT_TRUE( HepMC::signal_process_vertex(&ge)!=myVertex ); +#ifdef HEPMC3 +//Not needed for HepMC3 +#else + ASSERT_EQ( *HepMC::signal_process_vertex(&ge), *dummyVertex ); +#endif } TEST_F(BeamEffectsAlg_test, execute_pass_through) { @@ -142,7 +151,7 @@ namespace SimTesting { inputTestDataHandle->push_back(new HepMC::GenEvent()); HepMC::GenEvent& ge = *(inputTestDataHandle->at(0)); CLHEP::HepLorentzVector myPos( 0.0, 0.0, 0.0, 0.0); - HepMC::GenVertexPtr myVertex = HepMC::newGenVertexPtr( myPos, -1 ); + HepMC::GenVertexPtr myVertex = HepMC::newGenVertexPtr( HepMC::FourVector(myPos.x(),myPos.y(),myPos.z(),myPos.t()), -1 ); HepMC::FourVector fourMomentum1( 0.0, 0.0, 1.0, 1.0*CLHEP::TeV); HepMC::GenParticlePtr inParticle1 = HepMC::newGenParticlePtr(fourMomentum1, 2, 10); myVertex->add_particle_in(inParticle1); @@ -156,7 +165,7 @@ namespace SimTesting { HepMC::GenParticlePtr inParticle4 = HepMC::newGenParticlePtr(fourMomentum4, -2, 10); myVertex->add_particle_out(inParticle4); ge.add_vertex( myVertex ); - ge.set_signal_process_vertex( myVertex ); + HepMC::set_signal_process_vertex(&ge, myVertex ); ge.set_beam_particles(inParticle1,inParticle2); // ASSERT_TRUE( m_alg->initialize().isSuccess() ); @@ -165,10 +174,17 @@ namespace SimTesting { ASSERT_TRUE( outputTestDataKey.initialize().isSuccess() ); SG::ReadHandle<McEventCollection> outputTestDataHandle{outputTestDataKey,ctx}; ASSERT_TRUE( outputTestDataHandle.isValid() ); +#ifdef HEPMC3 + ASSERT_EQ(HepMC::signal_process_vertex(outputTestDataHandle->at(0)), HepMC::signal_process_vertex(inputTestDataHandle->at(0))); + ASSERT_EQ(outputTestDataHandle->at(0)->vertices().begin(), ((const HepMC::GenEvent*)inputTestDataHandle->at(0))->vertices().begin()); + ASSERT_EQ(outputTestDataHandle->at(0)->beams().at(0), inputTestDataHandle->at(0)->beams().at(0)); + ASSERT_EQ(outputTestDataHandle->at(0)->beams().at(1),inputTestDataHandle->at(0)->beams().at(1)); +#else ASSERT_EQ(*(outputTestDataHandle->at(0)->signal_process_vertex()), *(inputTestDataHandle->at(0)->signal_process_vertex())); ASSERT_EQ(**(outputTestDataHandle->at(0)->vertices_begin()), **(inputTestDataHandle->at(0)->vertices_begin())); ASSERT_EQ(*(outputTestDataHandle->at(0)->beam_particles().first), *(inputTestDataHandle->at(0)->beam_particles().first)); ASSERT_EQ(*(outputTestDataHandle->at(0)->beam_particles().second), *(inputTestDataHandle->at(0)->beam_particles().second)); +#endif } } // <-- namespace SimTesting diff --git a/Simulation/Digitization/python/PileUpConfigNew.py b/Simulation/Digitization/python/PileUpConfigNew.py index 3e820245dd08627e16249fc6bd4792aa243290cb..9f4a8c8fd0035a35805b38c2ead06ad2cb27adcb 100644 --- a/Simulation/Digitization/python/PileUpConfigNew.py +++ b/Simulation/Digitization/python/PileUpConfigNew.py @@ -5,14 +5,19 @@ Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator from AthenaConfiguration.ComponentFactory import CompFactory from AthenaPoolCnvSvc.PoolReadConfig import PoolReadCfg -from RngComps.RandomServices import RNG +from RngComps.RandomServices import dSFMT from Digitization import PileUpEventType from Digitization.RunDependentConfigNew import ( - MaxNevtsPerXing, + maxNevtsPerXing, LumiProfileSvcCfg, NoProfileSvcCfg, ) +def PileUpConfigdSFMT(name): + """Local wrapper for dSFMT RNG service""" + return dSFMT(name + " OFFSET 340 123 345") + + def StepArrayBMCfg(flags, name="StepArrayBM", **kwargs): acc = ComponentAccumulator() kwargs.setdefault("IntensityPattern", flags.Digitization.PU.BeamIntensityPattern) @@ -32,8 +37,8 @@ def FixedArrayBMCfg(flags, name="FixedArrayBM", **kwargs): def ArrayBMCfg(flags, name="ArrayBM", **kwargs): acc = ComponentAccumulator() kwargs.setdefault("IntensityPattern", flags.Digitization.PU.BeamIntensityPattern) - acc.merge(RNG()) - kwargs.setdefault("RandomSvc", acc.getService("AthRNGSvc")) + acc.merge(PileUpConfigdSFMT("PileUpCollXingStream")) + kwargs.setdefault("RandomSvc", acc.getService("AtDSFMTGenSvc")) acc.addService(CompFactory.ArrayBM(name, **kwargs)) return acc @@ -81,6 +86,7 @@ def BeamHaloEventSelectorCfg(flags, name="BeamHaloEventSelector", **kwargs): return acc + def MinBiasCacheCfg(flags, name="MinBiasCache", **kwargs): acc = ComponentAccumulator() kwargs.setdefault("CollPerXing", flags.Digitization.PU.NumberOfLowPtMinBias + flags.Digitization.PU.NumberOfHighPtMinBias) @@ -98,9 +104,10 @@ def MinBiasCacheCfg(flags, name="MinBiasCache", **kwargs): kwargs.setdefault("OccupationFraction", (float(flags.Digitization.PU.BunchSpacing)/ float(flags.Beam.BunchSpacing))) + RndmStreamName = "PileUpCollXingStream" - acc.merge(RNG(name=RndmStreamName)) - kwargs.setdefault("RndmGenSvc", acc.getService(RndmStreamName)) + acc.merge(PileUpConfigdSFMT(RndmStreamName)) + kwargs.setdefault("RndmGenSvc", acc.getService("AtDSFMTGenSvc")) kwargs.setdefault("RndmStreamName", RndmStreamName) # FIXME migrated, but SplitBkgStreamsCache does not exist @@ -120,9 +127,10 @@ def LowPtMinBiasCacheCfg(flags, name="LowPtMinBiasCache", **kwargs): kwargs.setdefault("OccupationFraction", (float(flags.Digitization.PU.BunchSpacing)/ float(flags.Beam.BunchSpacing))) + RndmStreamName = "PileUpCollXingStream" - acc.merge(RNG(name=RndmStreamName)) - kwargs.setdefault("RndmGenSvc", acc.getService(RndmStreamName)) + acc.merge(PileUpConfigdSFMT(RndmStreamName)) + kwargs.setdefault("RndmGenSvc", acc.getService("AtDSFMTGenSvc")) kwargs.setdefault("RndmStreamName", RndmStreamName) # Use BkgStreamsStepCaches when using the StepArrayBM and BkgStreamsCache otherwise @@ -146,9 +154,10 @@ def HighPtMinBiasCacheCfg(flags, name="HighPtMinBiasCache", **kwargs): kwargs.setdefault("EventSelector", acc.getService("HighPtMinBiasEventSelector")) kwargs.setdefault("OccupationFraction", (float(flags.Digitization.PU.BunchSpacing)/ float(flags.Beam.BunchSpacing))) + RndmStreamName = "PileUpCollXingStream" - acc.merge(RNG(name=RndmStreamName)) - kwargs.setdefault("RndmGenSvc", acc.getService(RndmStreamName)) + acc.merge(PileUpConfigdSFMT(RndmStreamName)) + kwargs.setdefault("RndmGenSvc", acc.getService("AtDSFMTGenSvc")) kwargs.setdefault("RndmStreamName", RndmStreamName) # Use BkgStreamsStepCaches when using the StepArrayBM and BkgStreamsCache otherwise @@ -179,9 +188,10 @@ def CavernCacheCfg(flags, name="CavernCache", **kwargs): kwargs.setdefault("OccupationFraction", OccupationFraction) acc.merge(CavernEventSelectorCfg(flags)) kwargs.setdefault("EventSelector", acc.getService("cavernEventSelector")) + RndmStreamName = "PileUpCollXingStream" - acc.merge(RNG(name=RndmStreamName)) - kwargs.setdefault("RndmGenSvc", acc.getService(RndmStreamName)) + acc.merge(PileUpConfigdSFMT(RndmStreamName)) + kwargs.setdefault("RndmGenSvc", acc.getService("AtDSFMTGenSvc")) kwargs.setdefault("RndmStreamName", RndmStreamName) # Use BkgStreamsStepCaches when using the StepArrayBM and BkgStreamsCache otherwise @@ -206,8 +216,8 @@ def BeamGasCacheCfg(flags, name="BeamGasCache", **kwargs): kwargs.setdefault("EventSelector", acc.getService("BeamGasEventSelector")) RndmStreamName = "PileUpCollXingStream" - acc.merge(RNG(name=RndmStreamName)) - kwargs.setdefault("RndmGenSvc", acc.getService(RndmStreamName)) + acc.merge(PileUpConfigdSFMT(RndmStreamName)) + kwargs.setdefault("RndmGenSvc", acc.getService("AtDSFMTGenSvc")) kwargs.setdefault("RndmStreamName", RndmStreamName) # Use BkgStreamsStepCaches when using the StepArrayBM and BkgStreamsCache otherwise @@ -233,8 +243,8 @@ def BeamHaloCacheCfg(flags, name="BeamHaloCache", **kwargs): kwargs.setdefault("EventSelector", acc.getService("BeamHaloEventSelector")) RndmStreamName = "PileUpCollXingStream" - acc.merge(RNG(name=RndmStreamName)) - kwargs.setdefault("RndmGenSvc", acc.getService(RndmStreamName)) + acc.merge(PileUpConfigdSFMT(RndmStreamName)) + kwargs.setdefault("RndmGenSvc", acc.getService("AtDSFMTGenSvc")) kwargs.setdefault("RndmStreamName", RndmStreamName) #Use BkgStreamsStepCaches when using the StepArrayBM and BkgStreamsCache otherwise @@ -295,7 +305,7 @@ def PileUpEventLoopMgrCfg(flags, name="PileUpEventLoopMgr", **kwargs): kwargs.setdefault("lastXing", flags.Digitization.PU.FinalBunchCrossing) if flags.Digitization.PU.RunAndLumiOverrideList: - kwargs.setdefault("MaxMinBiasCollPerXing", MaxNevtsPerXing(flags)) + kwargs.setdefault("MaxMinBiasCollPerXing", maxNevtsPerXing(flags)) acc.merge(LumiProfileSvcCfg(flags)) kwargs.setdefault("BeamLuminosity", acc.getService("LumiProfileSvc")) else: diff --git a/Simulation/Digitization/test/DigitizationPUConfigNew_test.py b/Simulation/Digitization/test/DigitizationPUConfigNew_test.py index c224fe37e8f4bc52d431094c8eee8e05a2c63bdf..74545bff07333b3b15196f3829c88466c493d4b1 100755 --- a/Simulation/Digitization/test/DigitizationPUConfigNew_test.py +++ b/Simulation/Digitization/test/DigitizationPUConfigNew_test.py @@ -17,43 +17,91 @@ from Digitization.DigitizationParametersConfig import writeDigitizationMetadata from MCTruthSimAlgs.RecoTimingConfig import MergeRecoTimingObjCfg from AthenaConfiguration.JobOptsDumper import JobOptsDumperCfg from xAODEventInfoCnv.xAODEventInfoCnvConfig import EventInfoCnvAlgCfg +from Digitization.PileUpConfigNew import PileUpEventLoopMgrCfg from DigitizationPUConfigNew_test_setup import ( - test_HighPtMinbiasHitsFile, - test_LowPtMinbiasHitsFile, test_BeamIntensityPattern, test_fragment, pileUpCalc, makeBkgInputCol, ) +from BCM_Digitization.BCM_DigitizationConfigNew import BCM_DigitizationCfg +from SCT_Digitization.SCT_DigitizationConfigNew import SCT_DigitizationCfg +from TRT_Digitization.TRT_DigitizationConfigNew import TRT_DigitizationCfg +from PixelDigitization.PixelDigitizationConfigNew import PixelDigitizationCfg +from LArDigitization.LArDigitizationConfigNew import LArTriggerDigitizationCfg +from TileSimAlgs.TileDigitizationConfig import TileDigitizationCfg, TileTriggerDigitizationCfg +from MuonConfig.MDT_DigitizationConfig import MDT_DigitizationDigitToRDOCfg +from MuonConfig.TGC_DigitizationConfig import TGC_DigitizationDigitToRDOCfg +from MuonConfig.RPC_DigitizationConfig import RPC_DigitizationDigitToRDOCfg +from MuonConfig.CSC_DigitizationConfig import CSC_DigitizationDigitToRDOCfg + +def EvtIdModifierSvc_add_modifier(svc, + run_nbr=None, evt_nbr=None, time_stamp=None, lbk_nbr=None, + nevts=1): + if run_nbr is None: + modify_run_nbr = 0 + run_nbr = 0 + else: + modify_run_nbr = 1 + + if evt_nbr is None: + modify_evt_nbr = 0 + evt_nbr = 0 + else: + modify_evt_nbr = 1 + + if time_stamp is None: + modify_time_stamp = 0 + time_stamp = 0 + else: + modify_time_stamp = 1 + + if lbk_nbr is None: + modify_lbk_nbr = 0 + lbk_nbr = 0 + else: + modify_lbk_nbr = 1 + + mod_bit = int(0b0000 + | (modify_run_nbr << 0) + | (modify_evt_nbr << 1) + | (modify_time_stamp << 2) + | (modify_lbk_nbr << 3)) + + svc.Modifiers += [run_nbr, evt_nbr, time_stamp, lbk_nbr, + nevts, mod_bit] + # Set up logging and new style config log.setLevel(DEBUG) Configurable.configurableRun3Behavior = True -evtMax = 4 +ConfigFlags.Exec.MaxEvents = 4 -# Configure ConfigFlags.Input.Files = defaultTestFiles.HITS -ConfigFlags.Output.RDOFileName = "myRDO.pool.root" -ConfigFlags.IOVDb.GlobalTag = "OFLCOND-MC16-SDR-20" +ConfigFlags.Output.RDOFileName = "mc16d_ttbar.CA.RDO.pool.root" +ConfigFlags.IOVDb.GlobalTag = "OFLCOND-MC16-SDR-16" + ConfigFlags.GeoModel.Align.Dynamic = False -ConfigFlags.Concurrency.NumThreads = 1 -ConfigFlags.Concurrency.NumConcurrentEvents = 1 +ConfigFlags.GeoModel.AtlasVersion = "ATLAS-R2-2016-01-00-01" ConfigFlags.Beam.BunchSpacing = 25 -# TODO deduplicate NumberOfCollisions? ConfigFlags.Beam.NumberOfCollisions = 20. -ConfigFlags.Exec.MaxEvents = evtMax - ConfigFlags.LAr.ROD.NumberOfCollisions = 20 ConfigFlags.LAr.ROD.nSamples = 4 ConfigFlags.LAr.ROD.DoOFCPileupOptimization = True ConfigFlags.LAr.ROD.FirstSample = 0 ConfigFlags.LAr.ROD.UseHighestGainAutoCorr = True -ConfigFlags.Digitization.DoXingByXingPileUp = True +ConfigFlags.Digitization.Pileup = False +ConfigFlags.Digitization.DoDigiTruth = True +ConfigFlags.Digitization.TruthOutput = True +ConfigFlags.Digitization.RandomSeedOffset = 170 + +ConfigFlags.Digitization.DoXingByXingPileUp = True # TODO get success with this flag enabled ConfigFlags.Digitization.HighGainEMECIW = False + ConfigFlags.Digitization.PU.BunchSpacing = 25 ConfigFlags.Digitization.PU.CavernIgnoresBeamInt = True ConfigFlags.Digitization.PU.NumberOfCavern = 0.0 @@ -62,14 +110,18 @@ ConfigFlags.Digitization.PU.NumberOfLowPtMinBias = 80.290021063135 ConfigFlags.Digitization.PU.BeamIntensityPattern = test_BeamIntensityPattern ConfigFlags.Digitization.PU.RunAndLumiOverrideList = test_fragment -cols = makeBkgInputCol(ConfigFlags, [test_HighPtMinbiasHitsFile], +cols = makeBkgInputCol(ConfigFlags, defaultTestFiles.HITS_MINBIAS_HIGH, ConfigFlags.Digitization.PU.NumberOfHighPtMinBias, True) ConfigFlags.Digitization.PU.HighPtMinBiasInputCols = cols -cols = makeBkgInputCol(ConfigFlags, [test_LowPtMinbiasHitsFile], +cols = makeBkgInputCol(ConfigFlags, defaultTestFiles.HITS_MINBIAS_LOW, ConfigFlags.Digitization.PU.NumberOfLowPtMinBias, True) ConfigFlags.Digitization.PU.LowPtMinBiasInputCols = cols +ConfigFlags.Concurrency.NumThreads = 1 +ConfigFlags.Concurrency.NumConcurrentEvents = 1 +ConfigFlags.Tile.BestPhaseFromCOOL = False +ConfigFlags.Tile.correctTime = False ConfigFlags.lock() @@ -80,17 +132,10 @@ ConfigFlags.Sim.RunToTimestampDict acc = MainServicesCfg(ConfigFlags) acc.merge(PoolReadCfg(ConfigFlags)) acc.merge(PoolWriteCfg(ConfigFlags)) -acc.merge(writeDigitizationMetadata(ConfigFlags)) - -# Old EventInfo conversion -if "EventInfo" not in ConfigFlags.Input.Collections: - acc.merge(EventInfoCnvAlgCfg(ConfigFlags, - inputKey="McEventInfo", - outputKey="EventInfo")) -from Digitization.RunDependentConfigNew import EvtIdModifierSvcCfg -acc.merge(EvtIdModifierSvcCfg(ConfigFlags)) +acc.merge(writeDigitizationMetadata(ConfigFlags)) +# Signal-only truth information from Digitization.PileUpToolsConfig import PileUpToolsCfg from MCTruthSimAlgs.MCTruthSimAlgsConfigNew import ( SignalOnlyMcEventCollCfg, @@ -99,27 +144,69 @@ from MCTruthSimAlgs.MCTruthSimAlgsConfigNew import ( MergeCalibHitsCfg, ) +acc.merge(PileUpEventLoopMgrCfg(ConfigFlags)) + acc.merge(SignalOnlyMcEventCollCfg(ConfigFlags)) acc.merge(MergeTruthJetsCfg(ConfigFlags)) acc.merge(MergeMuonEntryLayerCfg(ConfigFlags)) acc.merge(MergeCalibHitsCfg(ConfigFlags)) - -# Migration of --digiSteeringConf -# TODO configure output -#acc.getEventAlgo("OutputStreamRDO").AcceptAlgs = ["StandardPileUpToolsAlg"] +# Inner Detector +acc.merge(BCM_DigitizationCfg(ConfigFlags)) +acc.merge(PixelDigitizationCfg(ConfigFlags)) +acc.merge(SCT_DigitizationCfg(ConfigFlags)) +acc.merge(TRT_DigitizationCfg(ConfigFlags)) + +# Calorimeter +acc.merge(LArTriggerDigitizationCfg(ConfigFlags)) +acc.merge(TileDigitizationCfg(ConfigFlags)) +acc.merge(TileTriggerDigitizationCfg(ConfigFlags)) + +# Muon Spectrometer +acc.merge(MDT_DigitizationDigitToRDOCfg(ConfigFlags)) +acc.merge(TGC_DigitizationDigitToRDOCfg(ConfigFlags)) +acc.merge(RPC_DigitizationDigitToRDOCfg(ConfigFlags)) +acc.merge(CSC_DigitizationDigitToRDOCfg(ConfigFlags)) + +# Timing +acc.merge(MergeRecoTimingObjCfg(ConfigFlags)) + +# FIXME hack to match to buggy behaviour in old style configuration +OutputStreamRDO = acc.getEventAlgo("OutputStreamRDO") +OutputStreamRDO.ItemList += ["EventInfo#*"] +OutputStreamRDO.ItemList.remove("xAOD::EventInfo#EventInfo") +OutputStreamRDO.ItemList.remove("xAOD::EventAuxInfo#EventInfoAux.") +# FIXME this is marked "# Temporary for debugging MBTSHits" in DigiOutput.py +OutputStreamRDO.ItemList += ["TileHitVector#MBTSHits"] +# for Tile +# new style configures these, but they are left default in old config +TilePulseForTileMuonReceiver = acc.getEventAlgo("TilePulseForTileMuonReceiver") +TilePulseForTileMuonReceiver.TileRawChannelBuilderMF.TimeMaxForAmpCorrection = 25. +TilePulseForTileMuonReceiver.TileRawChannelBuilderMF.TimeMinForAmpCorrection = -25. +TileRChMaker = acc.getEventAlgo("TileRChMaker") +TileRChMaker.TileRawChannelBuilderFitOverflow.TimeMaxForAmpCorrection = 25. +TileRChMaker.TileRawChannelBuilderFitOverflow.TimeMinForAmpCorrection = -25. # Dump config -acc.merge(JobOptsDumperCfg(ConfigFlags, FileName="DigiPUConfig.txt")) +acc.merge(JobOptsDumperCfg(ConfigFlags, FileName="DigiPUConfigCA.txt")) acc.getService("StoreGateSvc").Dump = True acc.getService("ConditionStore").Dump = True -acc.printConfig(withDetails=True) +acc.printConfig(withDetails=True, summariseProps=True) ConfigFlags.dump() +# print services +from AthenaConfiguration.ComponentAccumulator import filterComponents +for s, _ in filterComponents(acc._services): + acc._msg.info(s) +# print conditions +for s in acc._conditionsAlgs: + acc._msg.info(s) + +# dump pickle +with open("DigiPUConfigCA.pkl", "wb") as f: + acc.store(f) -# Was not merged; this prevents errors -acc.wasMerged() # TODO uncomment running in the test once successful # Execute and finish -#sc = acc.run(maxEvents=evtMax) +#sc = acc.run(maxEvents=ConfigFlags.Exec.MaxEvents) # Success should be 0 #sys.exit(not sc.isSuccess()) diff --git a/Simulation/Digitization/test/DigitizationPUConfigNew_test_setup.py b/Simulation/Digitization/test/DigitizationPUConfigNew_test_setup.py index 7b91471cc89dccaa2cd480ab2d3a999f1ab7cf85..87f5c3ed5ba1899031ad503fb977d972eb495515 100644 --- a/Simulation/Digitization/test/DigitizationPUConfigNew_test_setup.py +++ b/Simulation/Digitization/test/DigitizationPUConfigNew_test_setup.py @@ -3,10 +3,6 @@ Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration """ -test_HighPtMinbiasHitsFile = "/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/Tier0ChainTests/mc16_13TeV.361239.Pythia8EvtGen_A3NNPDF23LO_minbias_inelastic_high.merge.HITS.e4981_s3087_s3089/*" -test_LowPtMinbiasHitsFile = "/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/Tier0ChainTests/mc16_13TeV.361238.Pythia8EvtGen_A3NNPDF23LO_minbias_inelastic_low.merge.HITS.e4981_s3087_s3089/*" - - # lifted from preInlcude.PileUpBunchTrainsMC16c_2017_Config1.py test_BeamIntensityPattern = [0.0, # bunch crossing zero is always empty 0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0, @@ -342,8 +338,9 @@ JobMaker=[ ] import math +# TODO this should be integrated into the test (ConfigFlags.Exec.MaxEvents?) trfJobNumber = 1 -trfMaxEvents = 25 +trfMaxEvents = 4 corrMaxEvents = float(trfMaxEvents) #We may need to repeat this run for long production jobs. @@ -406,6 +403,7 @@ def makeBkgInputCol(flags, initialList, nBkgEvtsPerCrossing, correctForEmptyBunc nBkgEventsPerFile = 5000 try: from PyUtils.MetaReader import read_metadata + # TODO fix traceback messages generated here metadata = read_metadata(initialList[0]) metadata = metadata[initialList[0]] # promote all keys one level up nBkgEventsPerFile = int(metadata["nentries"]) diff --git a/Simulation/G4Atlas/G4AtlasTests/src/MDTHitsTestTool.cxx b/Simulation/G4Atlas/G4AtlasTests/src/MDTHitsTestTool.cxx index 86f4359a4e084002e696617986f3b71d23defa71..ae2873aa66ad09ebb14a00db4e68b2dbef0a3a66 100644 --- a/Simulation/G4Atlas/G4AtlasTests/src/MDTHitsTestTool.cxx +++ b/Simulation/G4Atlas/G4AtlasTests/src/MDTHitsTestTool.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ #include "MDTHitsTestTool.h" @@ -40,7 +40,7 @@ using namespace MuonGM; Identifier MDTHitsTestTool::getIdentifier(HitID mdthit) { - MdtHitIdHelper* mdthelper = MdtHitIdHelper::GetHelper(); + MdtHitIdHelper* mdthelper = MdtHitIdHelper::GetHelper(m_pMdtIdHelper->tubeMax()); std::string mdt_stname = mdthelper->GetStationName(mdthit); int mdt_steta = mdthelper->GetZSector(mdthit); int mdt_stphi = mdthelper->GetPhiSector(mdthit); diff --git a/Simulation/G4Sim/MCTruth/src/TrackInformation.cxx b/Simulation/G4Sim/MCTruth/src/TrackInformation.cxx index fcaa59ba654156430121eb730b89a20a43e1cf97..a983733076c4cc575cf5847627260bd272f6916a 100644 --- a/Simulation/G4Sim/MCTruth/src/TrackInformation.cxx +++ b/Simulation/G4Sim/MCTruth/src/TrackInformation.cxx @@ -4,6 +4,8 @@ #include "MCTruth/TrackInformation.h" #include "AtlasHepMC/GenEvent.h" +#include "AtlasHepMC/GenParticle.h" +#include "AtlasHepMC/GenVertex.h" TrackInformation::TrackInformation():m_regenerationNr(0),m_theParticle(0),m_theBaseISFParticle(0),m_returnedToISF(false) { @@ -28,7 +30,7 @@ const ISF::ISFParticle* TrackInformation::GetBaseISFParticle() const int TrackInformation::GetParticleBarcode() const { - return ( m_theParticle ? m_theParticle->barcode() : 0 ); + return ( m_theParticle ? HepMC::barcode(m_theParticle) : 0 ); } void TrackInformation::SetParticle(HepMC::ConstGenParticlePtr p) diff --git a/Simulation/G4Utilities/G4UserActions/src/AthenaTrackingAction.cxx b/Simulation/G4Utilities/G4UserActions/src/AthenaTrackingAction.cxx index acc9cd35f9db2bec38c7ab640caa961fa173a232..df81bf59ce08e50b2353286dcdc710ebb0c617d5 100644 --- a/Simulation/G4Utilities/G4UserActions/src/AthenaTrackingAction.cxx +++ b/Simulation/G4Utilities/G4UserActions/src/AthenaTrackingAction.cxx @@ -46,10 +46,15 @@ namespace G4UA { // Why a const_cast??? // This is an ugly way to communicate the GenParticle... +#ifdef HEPMC3 + HepMC::GenParticlePtr part = + std::const_pointer_cast<HepMC3::GenParticle>( trackHelper.GetTrackInformation()-> + GetHepMCParticle() ); +#else HepMC::GenParticlePtr part = const_cast<HepMC::GenParticlePtr>( trackHelper.GetTrackInformation()-> GetHepMCParticle() ); - +#endif // Assign the GenParticle to the AtlasG4EventUserInfo. AtlasG4EventUserInfo* atlasG4EvtUserInfo = static_cast<AtlasG4EventUserInfo*> (G4EventManager::GetEventManager()->GetConstCurrentEvent()->GetUserInformation()); diff --git a/Simulation/G4Utilities/MCTruthSimAlgs/src/MergeMcEventCollTool.cxx b/Simulation/G4Utilities/MCTruthSimAlgs/src/MergeMcEventCollTool.cxx index 262a6f240acf722b7cf38e2fed115960f377b338..e91a39b74fe6ea5ccedf7a29e5f5001a3f6796c7 100644 --- a/Simulation/G4Utilities/MCTruthSimAlgs/src/MergeMcEventCollTool.cxx +++ b/Simulation/G4Utilities/MCTruthSimAlgs/src/MergeMcEventCollTool.cxx @@ -449,7 +449,7 @@ StatusCode MergeMcEventCollTool::processUnfilteredEvent(const McEventCollection const HepMC::GenEvent& currentBackgroundEvent(**(pMcEvtColl->begin())); //background event //handle the slimming case //ATH_MSG_VERBOSE( "The MB Event Number is " << currentBkgEventIndex << ". m_nBkgEventsReadSoFar = " << m_nBkgEventsReadSoFar ); - HepMC::GenVertex *pCopyOfGenVertex(NULL); + HepMC::GenVertexPtr pCopyOfGenVertex(NULL); if ( currentBackgroundEvent.signal_process_vertex() ) pCopyOfGenVertex = new HepMC::GenVertex ( *currentBackgroundEvent.signal_process_vertex() ); //insert the GenEvent into the overlay McEventCollection. m_pOvrlMcEvColl->at(m_startingIndexForBackground+m_nBkgEventsReadSoFar) = new HepMC::GenEvent(currentBackgroundEvent.signal_process_id(), currentBkgEventIndex, pCopyOfGenVertex ); @@ -462,9 +462,9 @@ StatusCode MergeMcEventCollTool::processUnfilteredEvent(const McEventCollection ATH_MSG_VERBOSE( "Starting a vertex loop ... " ); //cout << "Starting a vertex loop ... " <<endl; for (; currentVertexIter != endOfCurrentListOfVertices; ++currentVertexIter) { - const HepMC::GenVertex *pCurrentVertex(*currentVertexIter); - HepMC::GenVertex *pCopyOfVertexForClassification[NOPUTYPE]; - for (int type(INTIME); type<NOPUTYPE; ++type) pCopyOfVertexForClassification[type]=(HepMC::GenVertex*)0; + const HepMC::GenVertexPtr pCurrentVertex(*currentVertexIter); + HepMC::GenVertexPtr pCopyOfVertexForClassification[NOPUTYPE]; + for (int type(INTIME); type<NOPUTYPE; ++type) pCopyOfVertexForClassification[type]=(HepMC::GenVertexPtr )0; //check for collision vertices for in-time events bool isCollisionVertex(false); @@ -480,8 +480,8 @@ StatusCode MergeMcEventCollTool::processUnfilteredEvent(const McEventCollection const HepMC::GenVertex::particles_out_const_iterator endOfListOfParticlesFromCurrentVertex(pCurrentVertex->particles_out_const_end()); for (; currentVertexParticleIter != endOfListOfParticlesFromCurrentVertex; ++currentVertexParticleIter) { ATH_MSG_VERBOSE( "Found a particle at location " << std::hex << *currentVertexParticleIter << std::dec << " with PDG ID = " << (*currentVertexParticleIter)->pdg_id() ); - const HepMC::GenParticle *pCurrentVertexParticle(*currentVertexParticleIter); - const HepMC::GenVertex *pCurrentParticleProductionVertex(pCurrentVertexParticle->production_vertex()); + const HepMC::GenParticlePtr pCurrentVertexParticle(*currentVertexParticleIter); + const HepMC::GenVertexPtr pCurrentParticleProductionVertex(pCurrentVertexParticle->production_vertex()); puType particleClassification(classifyVertex(pCurrentVertexParticle, pCurrentParticleProductionVertex,currentEventTime)); //hack to keep the complete vertex information for the interaction vertices of in-time background events if(isCollisionVertex && NOPUTYPE==particleClassification) { @@ -525,11 +525,11 @@ StatusCode MergeMcEventCollTool::processUnfilteredEvent(const McEventCollection return StatusCode::SUCCESS; } -bool MergeMcEventCollTool::isInitialCollisionVertex(const HepMC::GenVertex *pCurrentVertex) const { +bool MergeMcEventCollTool::isInitialCollisionVertex(const HepMC::GenVertexPtr pCurrentVertex) const { HepMC::GenVertex::particles_in_const_iterator currentVertexParticleIter(pCurrentVertex->particles_in_const_begin()); const HepMC::GenVertex::particles_in_const_iterator endOfListOfParticlesFromCurrentVertex(pCurrentVertex->particles_in_const_end()); while(currentVertexParticleIter != endOfListOfParticlesFromCurrentVertex) { - const HepMC::GenParticle *pCurrentVertexParticle(*currentVertexParticleIter); + const HepMC::GenParticlePtr pCurrentVertexParticle(*currentVertexParticleIter); // FIXME: Nasty kludge will only work for Pythia minbias currently // Eventually just look for beam particles with status 4, but this // requires an update to the HepMC version used by ATLAS. @@ -543,7 +543,7 @@ bool MergeMcEventCollTool::isInitialCollisionVertex(const HepMC::GenVertex *pCur return false; } -MergeMcEventCollTool::puType MergeMcEventCollTool::classifyVertex(const HepMC::GenParticle *pCurrentVertexParticle, const HepMC::GenVertex *pCurrentParticleProductionVertex, double currentEventTime) { +MergeMcEventCollTool::puType MergeMcEventCollTool::classifyVertex(const HepMC::GenParticlePtr pCurrentVertexParticle, const HepMC::GenVertexPtr pCurrentParticleProductionVertex, double currentEventTime) { //======================================================================= //handle the slimming case //======================================================================= diff --git a/Simulation/G4Utilities/MCTruthSimAlgs/src/MergeMcEventCollTool.h b/Simulation/G4Utilities/MCTruthSimAlgs/src/MergeMcEventCollTool.h index 038b9aefa9285373060744f0e1c14690d6d6a6cc..0fff5864e4553f4fc5253a80b08a5086044c1469 100755 --- a/Simulation/G4Utilities/MCTruthSimAlgs/src/MergeMcEventCollTool.h +++ b/Simulation/G4Utilities/MCTruthSimAlgs/src/MergeMcEventCollTool.h @@ -67,9 +67,9 @@ private: //** Ensure that any GenEvent::HeavyIon info is stored in the signal GenEvent. StatusCode saveHeavyIonInfo(const McEventCollection *pMcEvtColl); //** Classify the current GenParticle according to the MC Truth Taskforce requirements - MergeMcEventCollTool::puType classifyVertex(const HepMC::GenParticle *pCurrentVertexParticle, const HepMC::GenVertex *pCurrentParticleProductionVertex, double currentEventTime); + MergeMcEventCollTool::puType classifyVertex(const HepMC::GenParticlePtr pCurrentVertexParticle, const HepMC::GenVertexPtr pCurrentParticleProductionVertex, double currentEventTime); //** Check if the current GenVertex contains beam particles - bool isInitialCollisionVertex(const HepMC::GenVertex *pCurrentVertex) const; + bool isInitialCollisionVertex(const HepMC::GenVertexPtr pCurrentVertex) const; //** Check whether the current McEventCollection has already been truth-filtered bool isTruthFiltertedMcEventCollection(const McEventCollection *pMcEvtColl) const; //** Map from GenEvent to puType FIXME: Simpler to key the map on GenEvent* ? diff --git a/Simulation/ISF/ISF_Config/python/ISF_MainConfigNew.py b/Simulation/ISF/ISF_Config/python/ISF_MainConfigNew.py index d7da235d5aba8660917d735b6802ff121aaf1ee0..d93468092c307e1db6c9b497e5fd3056b8e36f4e 100644 --- a/Simulation/ISF/ISF_Config/python/ISF_MainConfigNew.py +++ b/Simulation/ISF/ISF_Config/python/ISF_MainConfigNew.py @@ -87,9 +87,8 @@ def Kernel_FullG4MTCfg(flags, name="ISF_Kernel_FullG4MT", **kwargs): acc = ComponentAccumulator() acc.merge(ParticleKillerToolCfg(flags)) - acc.merge(FullGeant4ToolCfg(flags)) + Fulltool = acc.popToolsAndMerge(FullGeant4ToolCfg(flags)) PKtool = acc.getPublicTool("ISF_ParticleKillerTool") - Fulltool = acc.getPublicTool("ISF_FullGeant4Tool") kwargs.setdefault("SimulationTools", [PKtool, Fulltool]) acc.merge(Kernel_GenericG4OnlyMTCfg(flags, name, **kwargs)) diff --git a/Simulation/ISF/ISF_Config/test/ISF_MainConfigNew_Test.py b/Simulation/ISF/ISF_Config/test/ISF_MainConfigNew_Test.py index 441273c0e6424dff4bad5335fc072fd16f4cf7e8..eba37944670f66c483e6193f160d2b90cf522e59 100644 --- a/Simulation/ISF/ISF_Config/test/ISF_MainConfigNew_Test.py +++ b/Simulation/ISF/ISF_Config/test/ISF_MainConfigNew_Test.py @@ -15,6 +15,7 @@ def EvtIdModifierSvc_add_modifier(svc, else: modify_run_nbr = 1 + if evt_nbr is None: modify_evt_nbr = 0 evt_nbr = 0 @@ -64,12 +65,12 @@ if __name__ == '__main__': from AthenaConfiguration.TestDefaults import defaultTestFiles inputDir = defaultTestFiles.d ConfigFlags.Input.Files = ['/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/SimCoreTests/valid1.410000.PowhegPythiaEvtGen_P2012_ttbar_hdamp172p5_nonallhad.evgen.EVNT.e4993.EVNT.08166201._000012.pool.root.1'] #defaultTestFiles.EVNT - ConfigFlags.Output.HITSFileName = "myHITSnew1106_2.pool.root" + ConfigFlags.Output.HITSFileName = "myHITSnew.pool.root" #Sim ConfigFlags #ConfigFlags.Sim.WorldRRange = 15000 #ConfigFlags.Sim.WorldZRange = 27000 #change defaults? - ConfigFlags.Sim.CalibrationRun = "Off" + ConfigFlags.Sim.CalibrationRun = "Off" #"DeadLAr" ConfigFlags.Sim.RecordStepInfo = False ConfigFlags.Sim.CavernBG = "Signal" ConfigFlags.Sim.BeamPipeSimMode = 'FastSim' @@ -130,6 +131,10 @@ if __name__ == '__main__': ConfigFlags.Detector.SimulateFwdRegion = False ConfigFlags.Detector.SimulateForward = False + #Frozen showers OFF = 0 + ConfigFlags.Sim.LArParameterization = 2 + + ConfigFlags.Sim.TruthStrategy = "MC15aPlus" # Finalize ConfigFlags.lock() @@ -143,7 +148,7 @@ if __name__ == '__main__': myRunNumber = 284500 myFirstLB = 1 myInitialTimeStamp = 1446539185 - evtMax = 4 + evtMax = 1 from AthenaConfiguration.ComponentFactory import CompFactory evtIdModifierSvc = CompFactory.EvtIdModifierSvc(EvtStoreName="StoreGateSvc") iovDbMetaDataTool = CompFactory.IOVDbMetaDataTool() @@ -171,6 +176,72 @@ if __name__ == '__main__': from TileGeoG4SD.TileGeoG4SDToolConfig import TileGeoG4SDCalcCfg cfg.merge(TileGeoG4SDCalcCfg(ConfigFlags)) + + + #Add to item list + #TODO - make a separate function (combine with G4AtlasAlg one?) + ItemList = ["EventInfo#*", + "McEventCollection#TruthEvent", + "JetCollection#*"] + + if ConfigFlags.Sim.IncludeParentsInG4Event: + ItemList += ["McEventCollection#GEN_EVENT"] + + ItemList += ["xAOD::JetContainer#*", + "xAOD::JetAuxContainer#*"] + + if ConfigFlags.Detector.SimulateID: + ItemList += ["SiHitCollection#*", + "TRTUncompressedHitCollection#*", + "TrackRecordCollection#CaloEntryLayer"] + + if ConfigFlags.Detector.SimulateITk: + ItemList += ["SiHitCollection#*", + "TrackRecordCollection#CaloEntryLayer"] + + if ConfigFlags.Detector.SimulateCalo: + ItemList += ["CaloCalibrationHitContainer#*", + "LArHitContainer#*", + "TileHitVector#*", + "TrackRecordCollection#MuonEntryLayer"] + + if ConfigFlags.Detector.SimulateMuon: + ItemList += ["RPCSimHitCollection#*", + "TGCSimHitCollection#*", + "MDTSimHitCollection#*", + "TrackRecordCollection#MuonExitLayer"] + if ConfigFlags.Detector.GeometryCSC: + ItemList += ["CSCSimHitCollection#*"] + if ConfigFlags.Detector.GeometrysTGC: + ItemList += ["sTGCSimHitCollection#*"] + if ConfigFlags.Detector.GeometryMM: + ItemList += ["MMSimHitCollection#*"] + + if ConfigFlags.Detector.SimulateLucid: + ItemList += ["LUCID_SimHitCollection#*"] + + if ConfigFlags.Detector.SimulateFwdRegion: + ItemList += ["SimulationHitCollection#*"] + + if ConfigFlags.Detector.SimulateZDC: + ItemList += ["ZDC_SimPixelHit_Collection#*", + "ZDC_SimStripHit_Collection#*"] + + if ConfigFlags.Detector.SimulateALFA: + ItemList += ["ALFA_HitCollection#*", + "ALFA_ODHitCollection#*"] + + if ConfigFlags.Detector.SimulateAFP: + ItemList += ["AFP_TDSimHitCollection#*", + "AFP_SIDSimHitCollection#*"] + + # TimingAlg + ItemList += ["RecoTimingObj#EVNTtoHITS_timings"] + + from OutputStreamAthenaPool.OutputStreamConfig import OutputStreamCfg + cfg.merge( OutputStreamCfg(ConfigFlags,"HITS", ItemList=ItemList, disableEventTag=True) ) + + # FIXME hack to match to buggy behaviour in old style configuration OutputStreamHITS = cfg.getEventAlgo("OutputStreamHITS") OutputStreamHITS.ItemList.remove("xAOD::EventInfo#EventInfo") @@ -193,7 +264,7 @@ if __name__ == '__main__': sc = cfg.run(maxEvents=evtMax) b = time.time() - log.info("Run G4AtlasAlg in " + str(b-a) + " seconds") + log.info("Run ISF_MainConfigNew_Test in " + str(b-a) + " seconds") # Success should be 0 #os.sys.exit(not sc.isSuccess()) diff --git a/Simulation/ISF/ISF_Core/ISF_Algorithms/test/SimKernelMT_test.cxx b/Simulation/ISF/ISF_Core/ISF_Algorithms/test/SimKernelMT_test.cxx index e5d3ea91ee6b0e96e771313847839fdb2dfa7e25..bb5bf49a7643574cf7dbaef9276c920b4c93c970 100644 --- a/Simulation/ISF/ISF_Core/ISF_Algorithms/test/SimKernelMT_test.cxx +++ b/Simulation/ISF/ISF_Core/ISF_Algorithms/test/SimKernelMT_test.cxx @@ -385,10 +385,17 @@ protected: // checks if the two given HepMC::GenEvent instances are equal. // returns true if they are equal, false otherwise bool GenEventsEq(const HepMC::GenEvent& a, const HepMC::GenEvent& b) { +#ifdef HEPMC3 + auto aVertexIterator = a.vertices().begin(); + auto bVertexIterator = b.vertices().begin(); + auto aVertexIteratorEnd = a.vertices().end(); + auto bVertexIteratorEnd = b.vertices().end(); +#else HepMC::GenEvent::vertex_const_iterator aVertexIterator = a.vertices_begin(); HepMC::GenEvent::vertex_const_iterator bVertexIterator = b.vertices_begin(); const auto& aVertexIteratorEnd = a.vertices_end(); const auto& bVertexIteratorEnd = b.vertices_end(); +#endif bool eventsAreEqual = true; @@ -399,7 +406,11 @@ protected: break; } +#ifdef HEPMC3 + eventsAreEqual = *aVertexIterator == *bVertexIterator; +#else eventsAreEqual = **aVertexIterator == **bVertexIterator; +#endif ++aVertexIterator; ++bVertexIterator; @@ -509,12 +520,12 @@ protected: TEST_F(SimKernelMT_test, filledInputCollection_expectFullConversion) { auto* genEvent = new HepMC::GenEvent{}; - HepMC::GenParticlePtr genPart = new HepMC::GenParticle{}; + HepMC::GenParticlePtr genPart = HepMC::newGenParticlePtr(); HepMC::FourVector mom{12.3, 45.6, 78.9, 0.12}; - HepMC::GenParticlePtr genPart2 = new HepMC::GenParticle{mom, + HepMC::GenParticlePtr genPart2 = HepMC::newGenParticlePtr(mom, 11, // pdg id (e-) 1 // status - }; + ); auto* genVertex = new HepMC::GenVertex{}; genVertex->add_particle_out(genPart); genVertex->add_particle_out(genPart2); @@ -726,10 +737,10 @@ protected: TEST_F(SimKernelMT_test, filledInputCollectionAndEmptySimulationTools_expectConvertedParticleSentToParticleKiller) { auto* genEvent = new HepMC::GenEvent{}; HepMC::FourVector mom{12.3, 45.6, 78.9, 1234.5}; - HepMC::GenParticlePtr genPart = new HepMC::GenParticle{mom, + HepMC::GenParticlePtr genPart = HepMC::newGenParticlePtr(mom, 11, // pdg id (e-) 1 // status - }; + ); HepMC::FourVector pos{9., 8., 7., 678.9}; auto* genVertex = new HepMC::GenVertex{pos}; genVertex->add_particle_out(genPart); diff --git a/Simulation/ISF/ISF_Core/ISF_Event/CMakeLists.txt b/Simulation/ISF/ISF_Core/ISF_Event/CMakeLists.txt index 9b64379cba7ff9a57d945eef28f72b87c5aa1e25..f9cebdddb05d9df617e133ab416b210ef7d5ced5 100644 --- a/Simulation/ISF/ISF_Core/ISF_Event/CMakeLists.txt +++ b/Simulation/ISF/ISF_Core/ISF_Event/CMakeLists.txt @@ -15,10 +15,10 @@ atlas_add_library( ISF_Event PUBLIC_HEADERS ISF_Event INCLUDE_DIRS ${CLHEP_INCLUDE_DIRS} ${EIGEN_INCLUDE_DIRS} DEFINITIONS ${CLHEP_DEFINITIONS} - LINK_LIBRARIES ${CLHEP_LIBRARIES} AtlasHepMCLib ${EIGEN_LIBRARIES} TestTools AthenaBaseComps AtlasDetDescr BarcodeEventLib GeoPrimitives GeneratorObjects GaudiKernel ) + LINK_LIBRARIES ${CLHEP_LIBRARIES} AtlasHepMCLib AtlasHepMCsearchLib ${EIGEN_LIBRARIES} TestTools AthenaBaseComps AtlasDetDescr BarcodeEventLib GeoPrimitives GeneratorObjects GaudiKernel ) atlas_add_test( ISFParticle_test SOURCES test/ISFParticle_test.cxx INCLUDE_DIRS ${CLHEP_INCLUDE_DIRS} ${EIGEN_INCLUDE_DIRS} - LINK_LIBRARIES ${CLHEP_LIBRARIES} AtlasHepMCLib ${EIGEN_LIBRARIES} TestTools AthenaBaseComps AtlasDetDescr GeoPrimitives GeneratorObjects GaudiKernel ISF_Event ) + LINK_LIBRARIES ${CLHEP_LIBRARIES} AtlasHepMCLib AtlasHepMCsearchLib ${EIGEN_LIBRARIES} TestTools AthenaBaseComps AtlasDetDescr GeoPrimitives GeneratorObjects GaudiKernel ISF_Event ) diff --git a/Simulation/ISF/ISF_Core/ISF_Event/ISF_Event/HepMCHelper.h b/Simulation/ISF/ISF_Core/ISF_Event/ISF_Event/HepMCHelper.h index 903b6c6a266c95c0a02afb8f8638508fabcd0950..d1b54866a0d72de7a4ae7d41c762a0e94f3b524f 100644 --- a/Simulation/ISF/ISF_Core/ISF_Event/ISF_Event/HepMCHelper.h +++ b/Simulation/ISF/ISF_Core/ISF_Event/ISF_Event/HepMCHelper.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ /////////////////////////////////////////////////////////////////// @@ -52,7 +52,7 @@ namespace ISF { at least one particle with one of the given PDG codes appears. returns pointer to first found particle that matches any of the given PDG codes in relativesPDG */ - static inline HepMC::ConstGenParticlePtr findRealtiveWithPDG( const HepMC::GenParticle &genParticle, + static inline HepMC::ConstGenParticlePtr findRealtiveWithPDG( HepMC::ConstGenParticlePtr genParticle, const HepMC::IteratorRange &relation, const std::set<int> &relativesPDG ); }; diff --git a/Simulation/ISF/ISF_Core/ISF_Event/ISF_Event/HepMCHelper.icc b/Simulation/ISF/ISF_Core/ISF_Event/ISF_Event/HepMCHelper.icc index ba477d1d70cebcb551e5bdcf5bc51c7b1735609b..f14a71ede0e1c2f513fdf808aac486d448180fe9 100644 --- a/Simulation/ISF/ISF_Core/ISF_Event/ISF_Event/HepMCHelper.icc +++ b/Simulation/ISF/ISF_Core/ISF_Event/ISF_Event/HepMCHelper.icc @@ -12,6 +12,9 @@ // @TODO: probably replace this by an enum some day #define ISF_UNDEF_CHARGE -99999. +#include "AtlasHepMC/GenEvent.h" +#include "AtlasHepMC/IteratorRange.h" +#include "AtlasHepMC/Relatives.h" /** constructor */ ISF::HepMCHelper::HepMCHelper() { } @@ -29,12 +32,54 @@ HepMC::IteratorRange ISF::HepMCHelper::convertIteratorRange( int intItRange ) { else return ( HepMC::parents ); } -HepMC::ConstGenParticlePtr ISF::HepMCHelper::findRealtiveWithPDG( const HepMC::GenParticle &genParticle, +#ifdef HEPMC3 +HepMC::ConstGenParticlePtr ISF::HepMCHelper::findRealtiveWithPDG( HepMC::ConstGenParticlePtr genParticle, + const HepMC::IteratorRange &relation, + const std::set<int> &relativesPDG ) { + // get range of relative particles + std::vector<HepMC::ConstGenParticlePtr> relativesRng; + switch(relation) { + case HepMC::parents: { + if (genParticle->production_vertex()) relativesRng= genParticle->production_vertex()->particles_in(); + break; + } + case HepMC::family: { + if (genParticle->production_vertex()) relativesRng= genParticle->production_vertex()->particles_in(); + std::vector<HepMC::ConstGenParticlePtr> temp; + if (genParticle->end_vertex()) temp=genParticle->end_vertex()->particles_out(); + relativesRng.insert(relativesRng.end(),temp.begin(),temp.end()); + break; + } + case HepMC::ancestors: { + relativesRng= HepMC::ancestor_particles(genParticle); + break; + } + case HepMC::relatives: { + relativesRng= HepMC::ancestor_particles(genParticle); + std::vector<HepMC::ConstGenParticlePtr> temp=HepMC::descendant_particles(genParticle); + relativesRng.insert(relativesRng.end(),temp.begin(),temp.end()); + break; + } + default: { + if (genParticle->production_vertex()) relativesRng= genParticle->production_vertex()->particles_in(); + break; + } + } + // loop over relatives + for (auto curRelative: relativesRng) { + if (relativesPDG.count( curRelative->pdg_id() ) != 0) return curRelative; + } + + return nullptr; +} +#else +HepMC::ConstGenParticlePtr ISF::HepMCHelper::findRealtiveWithPDG( HepMC::ConstGenParticlePtr genParticle, const HepMC::IteratorRange &relation, const std::set<int> &relativesPDG ) { + if (!genParticle) return 0; // get range of relative particles - HepMC::ConstGenParticleProductionRange relativesRng = genParticle.particles_in( relation ); + HepMC::ConstGenParticleProductionRange relativesRng = genParticle->particles_in( relation ); // loop over relatives HepMC::GenVertex::particle_iterator partIt = relativesRng.begin(); @@ -49,4 +94,5 @@ HepMC::ConstGenParticlePtr ISF::HepMCHelper::findRealtiveWithPDG( const HepMC::G return (found ? curRelative : 0); } +#endif diff --git a/Simulation/ISF/ISF_Core/ISF_Event/ISF_Event/TruthBinding.icc b/Simulation/ISF/ISF_Core/ISF_Event/ISF_Event/TruthBinding.icc index 91c73a6f98b9244429b0e80eb907e607b97d062f..0206becfa45c434dda2b9282d28c9140d0ba3f80 100644 --- a/Simulation/ISF/ISF_Core/ISF_Event/ISF_Event/TruthBinding.icc +++ b/Simulation/ISF/ISF_Core/ISF_Event/ISF_Event/TruthBinding.icc @@ -59,21 +59,33 @@ namespace ISF { const auto rhsTruth = rhs.getTruthParticle(); if (m_truthParticle && rhsTruth) { +#ifdef HEPMC3 + pass &= (m_truthParticle == rhsTruth); +#else pass &= *m_truthParticle == *rhsTruth; +#endif } else { return false; } const auto rhsPrimary = rhs.getPrimaryTruthParticle(); if (m_primaryTruthParticle && rhsPrimary) { +#ifdef HEPMC3 + pass &= (m_primaryTruthParticle == rhsPrimary); +#else pass &= *m_primaryTruthParticle == *rhsPrimary; +#endif } else { return false; } const auto rhsGenZero = rhs.getGenerationZeroTruthParticle(); if (m_generationZeroTruthParticle && rhsGenZero) { +#ifdef HEPMC3 + pass &= (m_generationZeroTruthParticle == rhsGenZero); +#else pass &= *m_generationZeroTruthParticle == *rhsGenZero; +#endif } else { return false; } diff --git a/Simulation/ISF/ISF_Core/ISF_Event/src/ISFTruthIncident.cxx b/Simulation/ISF/ISF_Core/ISF_Event/src/ISFTruthIncident.cxx index 4c8aa3f2b174d8212a787254c2141a54cc5e74c7..68b924af61e8479986ab2c2968f5bfa80f5b6c6b 100644 --- a/Simulation/ISF/ISF_Core/ISF_Event/src/ISFTruthIncident.cxx +++ b/Simulation/ISF/ISF_Core/ISF_Event/src/ISFTruthIncident.cxx @@ -164,13 +164,17 @@ void ISF::ISFTruthIncident::setAllChildrenBarcodes(Barcode::ParticleBarcode bc) /** return attached truth particle */ HepMC::GenParticlePtr ISF::ISFTruthIncident::getHepMCTruthParticle( const ISF::ISFParticle& particle ) const { auto* truthBinding = particle.getTruthBinding(); - auto* hepTruthParticle = truthBinding ? truthBinding->getTruthParticle() : nullptr; + HepMC::GenParticlePtr hepTruthParticle = truthBinding ? truthBinding->getTruthParticle() : nullptr; // HepMC::GenParticle not in TruthBinding -> see if the HepMcParticleLink can retrieve it if (!hepTruthParticle) { const HepMcParticleLink* oldHMPL = particle.getParticleLink(); if (oldHMPL && oldHMPL->cptr()) +#ifdef HEPMC3 + hepTruthParticle = std::shared_ptr<HepMC3::GenParticle>(const_cast<HepMC3::GenParticle*>(oldHMPL->cptr())); +#else hepTruthParticle = const_cast<HepMC::GenParticlePtr>(oldHMPL->cptr()); +#endif } return hepTruthParticle; @@ -181,14 +185,14 @@ HepMC::GenParticlePtr ISF::ISFTruthIncident::getHepMCTruthParticle( const ISF::I HepMC::GenParticlePtr ISF::ISFTruthIncident::updateHepMCTruthParticle( ISF::ISFParticle& particle, const ISF::ISFParticle* parent ) const { auto* truthBinding = particle.getTruthBinding(); - auto* hepTruthParticle = ParticleHelper::convert( particle ); + HepMC::GenParticlePtr hepTruthParticle = ParticleHelper::convert( particle ); if (truthBinding) { truthBinding->setTruthParticle(hepTruthParticle); } else { - auto* parentTruthBinding = parent ? parent->getTruthBinding() : nullptr; - auto* hepPrimaryParticle = parentTruthBinding ? parentTruthBinding->getPrimaryTruthParticle() : nullptr; - auto* hepGenZeroParticle = hepTruthParticle; + auto parentTruthBinding = parent ? parent->getTruthBinding() : nullptr; + auto hepPrimaryParticle = parentTruthBinding ? parentTruthBinding->getPrimaryTruthParticle() : nullptr; + auto hepGenZeroParticle = hepTruthParticle; truthBinding = new TruthBinding( hepTruthParticle, hepPrimaryParticle, hepGenZeroParticle ); particle.setTruthBinding(truthBinding); } diff --git a/Simulation/ISF/ISF_Core/ISF_Services/src/InputConverter.cxx b/Simulation/ISF/ISF_Core/ISF_Services/src/InputConverter.cxx index d1fb4dbc389630b7fe49c9e46b07db1fd702eb91..02a3746d867e555a0f866d651925fea67af67188 100644 --- a/Simulation/ISF/ISF_Core/ISF_Services/src/InputConverter.cxx +++ b/Simulation/ISF/ISF_Core/ISF_Services/src/InputConverter.cxx @@ -154,7 +154,7 @@ ISF::InputConverter::convert(const McEventCollection& inputGenEvents, const auto passedGenParticles = getSelectedParticles(*eventPtr, legacyOrdering); for ( auto& genPartPtr : passedGenParticles ) { - ATH_MSG_VERBOSE("Picking up following GenParticle for conversion to ISFParticle: " << *genPartPtr); + ATH_MSG_VERBOSE("Picking up following GenParticle for conversion to ISFParticle: " << genPartPtr); auto simParticlePtr = convertParticle(genPartPtr, kindOfCollection); if (!simParticlePtr) { ATH_MSG_ERROR("Error while trying to convert input generator particles. Aborting."); @@ -227,50 +227,49 @@ ISF::InputConverter::getSelectedParticles(const HepMC::GenEvent& evnt, bool lega ISF::ISFParticle* ISF::InputConverter::convertParticle(HepMC::GenParticlePtr genPartPtr, EBC_EVCOLL kindOfCollection) const { if (!genPartPtr) { return nullptr; } - auto& genPart = *genPartPtr; - // @FIXME: set the bunch-crossing identifier for pile-up dynamically - // rather than a constant '1' (e.g. could use GenEvent index for that?) - const int bcid = (kindOfCollection==EBC_MAINEVCOLL) ? 0 : 1; - - HepMC::GenVertexPtr pVertex = genPart.production_vertex(); + auto pVertex = genPartPtr->production_vertex(); if (!pVertex) { - ATH_MSG_ERROR("Unable to convert following generator particle due to missing " - << "production vertex: " << genPart); + ATH_MSG_ERROR("Unable to convert following generator particle due to missing production vertex for: " << genPartPtr); + return nullptr; + } + auto parentEvent = genPartPtr->parent_event(); + if(!parentEvent) { + ATH_MSG_ERROR("Cannot convert a GenParticle without a parent GenEvent into an ISFParticle!!!"); return nullptr; } - const Amg::Vector3D pos(pVertex->position().x(), pVertex->position().y(), pVertex->position().z()); - const auto& pMomentum(genPart.momentum()); + const auto& pMomentum(genPartPtr->momentum()); const Amg::Vector3D mom(pMomentum.px(), pMomentum.py(), pMomentum.pz()); - const double pMass = this->getParticleMass(genPart); - +#ifdef HEPMC3 + const double pMass = this->getParticleMass(genPartPtr); +#else + const double pMass = this->getParticleMass(*genPartPtr); +#endif double e=pMomentum.e(); if(e>1) { //only test for >1 MeV in momentum double px=pMomentum.px(); double py=pMomentum.py(); double pz=pMomentum.pz(); - double teste=sqrt(px*px + py*py + pz*pz + pMass*pMass); - if(std::abs(e-teste)/e>0.01) { - ATH_MSG_WARNING("Difference in energy for: " << genPart<<" Morg="<<pMomentum.m()<<" Mmod="<<pMass<<" Eorg="<<e<<" Emod="<<teste); + double teste=std::sqrt(px*px + py*py + pz*pz + pMass*pMass); + if(std::abs(e-teste)>0.01*e) { + ATH_MSG_WARNING("Difference in energy for: " << genPartPtr<<" Morg="<<pMomentum.m()<<" Mmod="<<pMass<<" Eorg="<<e<<" Emod="<<teste); } } - const int pPdgId = genPart.pdg_id(); + const int pPdgId = genPartPtr->pdg_id(); const double charge = HepPDT::ParticleID(pPdgId).charge(); const double pTime = pVertex->position().t() / Gaudi::Units::c_light; /// particle origin (TODO: add proper GeoID, collision/cosmics) DetRegionSvcIDPair origin(AtlasDetDescr::fUndefinedAtlasRegion, ISF::fEventGeneratorSimID); - const auto pBarcode = HepMC::barcode(genPart); + const auto pBarcode = HepMC::barcode(genPartPtr); auto tBinding = std::make_unique<ISF::TruthBinding>(genPartPtr); + // @FIXME: set the bunch-crossing identifier for pile-up dynamically + // rather than a constant '1' (e.g. could use GenEvent index for that?) + const int bcid = (kindOfCollection==EBC_MAINEVCOLL) ? 0 : 1; - auto *parentEvent = genPart.parent_event(); - if(!parentEvent) { - ATH_MSG_ERROR("Cannot convert a GenParticle without a parent GenEvent into an ISFParticle!!!"); - return nullptr; - } - auto hmpl = std::make_unique<HepMcParticleLink>(&genPart, parentEvent->event_number(), kindOfCollection); + auto hmpl = std::make_unique<HepMcParticleLink>(genPartPtr, parentEvent->event_number(), kindOfCollection); auto sParticle = std::make_unique<ISF::ISFParticle>( std::move(pos), std::move(mom), pMass, @@ -540,7 +539,7 @@ G4PrimaryParticle* ISF::InputConverter::getG4PrimaryParticle(const ISF::ISFParti ATH_MSG_VERBOSE( "Detected primary particle with end vertex." ); ATH_MSG_VERBOSE( "Will add the primary particle set on." ); ATH_MSG_VERBOSE( "ISF Particle: " << isp ); - ATH_MSG_VERBOSE( "Primary Particle: " << *genpart ); + ATH_MSG_VERBOSE( "Primary Particle: " << genpart ); ATH_MSG_VERBOSE( "Number of daughters of "<<genpart->barcode()<<": " << genpart->end_vertex()->particles_out_size() ); } else { @@ -549,19 +548,22 @@ G4PrimaryParticle* ISF::InputConverter::getG4PrimaryParticle(const ISF::ISFParti ATH_MSG_WARNING( "yet validated - you'd better know what you're doing. Will add the primary" ); ATH_MSG_WARNING( "particle set on." ); ATH_MSG_WARNING( "ISF Particle: " << isp ); - ATH_MSG_WARNING( "Primary Particle: " << *genpart ); + ATH_MSG_WARNING( "Primary Particle: " << genpart ); ATH_MSG_WARNING( "Number of daughters of "<<genpart->barcode()<<": " << genpart->end_vertex()->particles_out_size() ); } // Add all necessary daughter particles - for ( auto daughterIter=genpart->end_vertex()->particles_out_const_begin(); - daughterIter!=genpart->end_vertex()->particles_out_const_end(); ++daughterIter ) { + for ( auto daughter: *(genpart->end_vertex())) { if(m_quasiStableParticlesIncluded) { - ATH_MSG_VERBOSE ( "Attempting to add daughter particle of "<<HepMC::barcode(genpart)<<": " << **daughterIter ); + ATH_MSG_VERBOSE ( "Attempting to add daughter particle of "<<HepMC::barcode(genpart)<<": " << daughter ); } else { - ATH_MSG_WARNING ( "Attempting to add daughter particle of "<<HepMC::barcode(genpart)<<": " << **daughterIter ); + ATH_MSG_WARNING ( "Attempting to add daughter particle of "<<HepMC::barcode(genpart)<<": " << daughter ); } - G4PrimaryParticle *daughterG4Particle = this->getG4PrimaryParticle( **daughterIter ); +#ifdef HEPMC3 + G4PrimaryParticle *daughterG4Particle = this->getG4PrimaryParticle( daughter ); +#else + G4PrimaryParticle *daughterG4Particle = this->getG4PrimaryParticle( *daughter ); +#endif if(!daughterG4Particle) { ATH_MSG_ERROR("Bailing out of loop over daughters of particle with barcode: "<<HepMC::barcode(genpart) << " due to errors - will not return G4Particle."); @@ -616,7 +618,7 @@ G4PrimaryParticle* ISF::InputConverter::getG4PrimaryParticle(const ISF::ISFParti } } - genpart->set_momentum(CLHEP::HepLorentzVector(px,py,pz,pe)); + genpart->set_momentum(HepMC::FourVector(px,py,pz,pe)); } // Truth was detected ATH_MSG_VERBOSE("PrimaryParticleInformation:"); diff --git a/Simulation/ISF/ISF_Core/ISF_Services/src/TruthSvc.cxx b/Simulation/ISF/ISF_Core/ISF_Services/src/TruthSvc.cxx index 5ae0ceca71c4b4cb42a7c03db70c66f167f1ed80..041a868249c8b940a2f8a52b0cc7b9ec47080668 100644 --- a/Simulation/ISF/ISF_Core/ISF_Services/src/TruthSvc.cxx +++ b/Simulation/ISF/ISF_Core/ISF_Services/src/TruthSvc.cxx @@ -500,11 +500,8 @@ void ISF::TruthSvc::setSharedChildParticleBarcode( ISF::ITruthIncident& ti) cons int ISF::TruthSvc::maxGeneratedParticleBarcode(HepMC::GenEvent *genEvent) const { int maxBarcode=0; const int firstSecondaryParticleBarcode(m_barcodeSvc->secondaryParticleBcOffset()); - HepMC::GenEvent::particle_const_iterator currentGenParticleIter; - for (currentGenParticleIter= genEvent->particles_begin(); - currentGenParticleIter!= genEvent->particles_end(); - ++currentGenParticleIter) { - const int barcode((*currentGenParticleIter)->barcode()); + for (auto currentGenParticle: *genEvent) { + const int barcode=HepMC::barcode(currentGenParticle); if(barcode > maxBarcode && barcode < firstSecondaryParticleBarcode) { maxBarcode=barcode; } } return maxBarcode; diff --git a/Simulation/ISF/ISF_Core/ISF_Services/test/InputConverter_test.cxx b/Simulation/ISF/ISF_Core/ISF_Services/test/InputConverter_test.cxx index 17813c67825ba28e507970a03bd22fb37ae5ef1d..a5323da69977a4e5773baaae2d83c2b6df30878f 100644 --- a/Simulation/ISF/ISF_Core/ISF_Services/test/InputConverter_test.cxx +++ b/Simulation/ISF/ISF_Core/ISF_Services/test/InputConverter_test.cxx @@ -39,6 +39,7 @@ // HepMC #include "AtlasHepMC/GenParticle.h" #include "AtlasHepMC/GenVertex.h" +#include "AtlasHepMC/Operators.h" #include "GeneratorObjects/HepMcParticleLink.h" #include "GeneratorObjects/McEventCollection.h" @@ -62,7 +63,11 @@ class MockFilterTool : public AthAlgTool, virtual ~MockFilterTool() {}; // mock method which will be called by tested code +#ifdef HEPMC3 + MOCK_CONST_METHOD1(pass, bool(HepMC::ConstGenParticlePtr)); +#else MOCK_CONST_METHOD1(pass, bool(const HepMC::GenParticle&)); +#endif }; DECLARE_COMPONENT( MockFilterTool ) @@ -165,7 +170,11 @@ TEST_F(InputConverter_test, convertParticle_without_production_vertex) { ); ISF::ISFParticle* expected = nullptr; ASSERT_EQ( expected, convertParticle(genPart, EBC_FIRSTPUEVCOLL) ); +#ifdef HEPMC3 + //When compiled with HepMC3, genPart is smart pointer +#else delete genPart; +#endif } @@ -177,16 +186,16 @@ TEST_F(InputConverter_test, convertParticle_using_generated_mass) { HepMC::FourVector mom(12.3, 45.6, 78.9, 0.12); // dynamic allocation necessary as particle ownership is // handed over to a HepMC::GenVertex later - HepMC::GenParticlePtr genPart = new HepMC::GenParticle(mom, + HepMC::GenParticlePtr genPart = HepMC::newGenParticlePtr(mom, 11, // pdg id (e-) 1 // status ); genPart->set_generated_mass(1234.56); - genPart->suggest_barcode(particleBarcode); + HepMC::suggest_barcode(genPart,particleBarcode); HepMC::FourVector pos(9.8, 7.65, 4.3, 0.321); // NB: 4th component is time*c int vtx_id = -123; - HepMC::GenVertexPtr prodVtx = new HepMC::GenVertex(pos, vtx_id); + HepMC::GenVertexPtr prodVtx = HepMC::newGenVertexPtr(pos, vtx_id); prodVtx->add_particle_out(genPart); // create dummy input McEventCollection containing a dummy GenEvent @@ -237,7 +246,7 @@ TEST_F(InputConverter_test, convertParticle_using_particleDataTable_photon) { 1 // status ); genPart->set_generated_mass(1234.56); // should be ignored later on - genPart->suggest_barcode(particleBarcode); + HepMC::suggest_barcode(genPart,particleBarcode); HepMC::FourVector pos(9.8, 7.65, 4.3, 0.321); // NB: 4th component is time*c int vtx_id = -123; @@ -291,7 +300,7 @@ TEST_F(InputConverter_test, convertParticle_using_particleDataTable_electron) { 1 // status ); genPart->set_generated_mass(1234.56); // should be ignored later on - genPart->suggest_barcode(particleBarcode); + HepMC::suggest_barcode(genPart,particleBarcode); HepMC::FourVector pos(9.8, 7.65, 4.3, 0.321); // NB: 4th component is time*c int vtx_id = -123; @@ -337,7 +346,11 @@ TEST_F(InputConverter_test, convertParticle_using_particleDataTable_electron) { TEST_F(InputConverter_test, passesFilters_empty_filters_defaultconstructed_genpart) { ASSERT_TRUE( m_svc->initialize().isSuccess() ); +#ifdef HEPMC3 + auto genPart=HepMC::newGenParticlePtr(); +#else const HepMC::GenParticle genPart{}; +#endif ASSERT_TRUE( passesFilters(genPart) ); } @@ -347,15 +360,24 @@ TEST_F(InputConverter_test, passesFilters_empty_filters) { const int particleBarcode(546); HepMC::FourVector mom(12.3, 45.6, 78.9, 0.12); +#ifdef HEPMC3 + //It seems this test makes no sense for HepMC3 + HepMC::GenParticlePtr genPart=HepMC::newGenParticlePtr(mom, + 11, // pdg id (e-) + 1 // status + ); + ASSERT_TRUE( true ); +#else HepMC::GenParticle genPart(mom, 11, // pdg id (e-) 1 // status ); genPart.set_generated_mass(1234.56); - genPart.suggest_barcode(particleBarcode); + HepMC::suggest_barcode( genPart,particleBarcode); const HepMC::GenParticle constGenPart(std::move(genPart)); ASSERT_TRUE( passesFilters(constGenPart) ); +#endif } @@ -368,7 +390,11 @@ TEST_F(InputConverter_test, passesFilters_one_pass_filter) { ASSERT_EQ (genParticleFilters.size(), expectedSize); MockFilterTool* filterTool = dynamic_cast<MockFilterTool*>(&*(genParticleFilters[0])); ASSERT_TRUE( filterTool ); +#ifdef HEPMC3 + HepMC::ConstGenParticlePtr genPart{}; +#else const HepMC::GenParticle genPart{}; +#endif HepMC::FourVector mom(12.3, 45.6, 78.9, 0.12); HepMC::GenParticle genPart2(mom, 11, // pdg id (e-) @@ -392,7 +418,11 @@ TEST_F(InputConverter_test, passesFilters_one_nonpass_filter) { MockFilterTool* filterTool = dynamic_cast<MockFilterTool*>(&*(genParticleFilters[0])); ASSERT_TRUE( filterTool ); +#ifdef HEPMC3 + HepMC::ConstGenParticlePtr genPart{}; +#else const HepMC::GenParticle genPart{}; +#endif HepMC::FourVector mom(12.3, 45.6, 78.9, 0.12); HepMC::GenParticle genPart2(mom, 11, // pdg id (e-) @@ -418,7 +448,11 @@ TEST_F(InputConverter_test, passesFilters_two_filters) { MockFilterTool* filterTool2 = dynamic_cast<MockFilterTool*>(&*(genParticleFilters[1])); ASSERT_TRUE( filterTool2 ); +#ifdef HEPMC3 + HepMC::ConstGenParticlePtr genPart{}; +#else const HepMC::GenParticle genPart{}; +#endif HepMC::FourVector mom(12.3, 45.6, 78.9, 0.12); HepMC::GenParticle genPart2(mom, 11, // pdg id (e-) diff --git a/Simulation/ISF/ISF_Core/ISF_Services/test/TruthSvc_test.cxx b/Simulation/ISF/ISF_Core/ISF_Services/test/TruthSvc_test.cxx index d84da3d267a51187176bfb48ca71c8c40dd9d843..f3d593c8f8dfd7b1d935265dd8db399ef5d8b76c 100644 --- a/Simulation/ISF/ISF_Core/ISF_Services/test/TruthSvc_test.cxx +++ b/Simulation/ISF/ISF_Core/ISF_Services/test/TruthSvc_test.cxx @@ -272,9 +272,11 @@ namespace ISFTesting { const int event_number1(17); const int pdgid1(-13); const int pdgid2(13); - std::unique_ptr<HepMC::GenEvent> anEvent = std::make_unique<HepMC::GenEvent>(process_id1, event_number1); + std::unique_ptr<HepMC::GenEvent> anEvent = std::make_unique<HepMC::GenEvent>(); + anEvent->set_event_number(event_number1); + HepMC::set_signal_process_id(anEvent.get(),process_id1); const CLHEP::HepLorentzVector myPos( 0.0, 0.0, 0.0, 0.0); - HepMC::GenVertexPtr myVertex = HepMC::newGenVertexPtr( myPos, -1 ); + HepMC::GenVertexPtr myVertex = HepMC::newGenVertexPtr( HepMC::FourVector(myPos.x(),myPos.y(),myPos.z(),myPos.t()), -1 ); const HepMC::FourVector fourMomentum1( 0.0, 0.0, 1.0, 1.0*CLHEP::TeV); HepMC::GenParticlePtr inParticle1 = HepMC::newGenParticlePtr(fourMomentum1, pdgid1, 2); myVertex->add_particle_in(inParticle1); @@ -288,7 +290,7 @@ namespace ISFTesting { HepMC::GenParticlePtr inParticle4 = HepMC::newGenParticlePtr(fourMomentum4, pdgid2, 1); myVertex->add_particle_out(inParticle4); anEvent->add_vertex( myVertex ); - anEvent->set_signal_process_vertex( myVertex ); + HepMC::set_signal_process_vertex(anEvent.get(), myVertex ); anEvent->set_beam_particles(inParticle1,inParticle2); MockTruthIncident ti(AtlasDetDescr::fAtlasID, 2); @@ -298,7 +300,7 @@ namespace ISFTesting { .WillOnce(::testing::Return(21)); EXPECT_CALL(ti, parentBarcode()) .Times(1) - .WillOnce(::testing::Return(inParticle3->barcode())); + .WillOnce(::testing::Return(HepMC::barcode(inParticle3))); EXPECT_CALL(ti, parentParticle()) .Times(1) .WillOnce(::testing::Return(inParticle3)); @@ -306,10 +308,16 @@ namespace ISFTesting { ASSERT_EQ( vtxPosition, generated->position() ); ASSERT_EQ( 1021, generated->id() ); - ASSERT_EQ( -200001, generated->barcode() ); + ASSERT_EQ( -200001, HepMC::barcode(generated) ); +#ifdef HEPMC3 + ASSERT_EQ( 1, generated->particles_in().size()); + ASSERT_EQ( 0, generated->particles_out().size()); + ASSERT_EQ( inParticle3, *(generated->particles_in().cbegin())); +#else ASSERT_EQ( 1, generated->particles_in_size()); ASSERT_EQ( 0, generated->particles_out_size()); ASSERT_EQ( inParticle3, *(generated->particles_in_const_begin())); +#endif } @@ -320,9 +328,11 @@ namespace ISFTesting { const int event_number1(17); const int pdgid1(-13); const int pdgid2(13); - std::unique_ptr<HepMC::GenEvent> anEvent = std::make_unique<HepMC::GenEvent>(process_id1, event_number1); + std::unique_ptr<HepMC::GenEvent> anEvent = std::make_unique<HepMC::GenEvent>(); + anEvent->set_event_number(event_number1); + HepMC::set_signal_process_id(anEvent.get(),process_id1); const CLHEP::HepLorentzVector myPos( 0.0, 0.0, 0.0, 0.0); - HepMC::GenVertexPtr myVertex = HepMC::newGenVertexPtr( myPos, -1 ); + HepMC::GenVertexPtr myVertex = HepMC::newGenVertexPtr( HepMC::FourVector(myPos.x(),myPos.y(),myPos.z(),myPos.t()), -1 ); const HepMC::FourVector fourMomentum1( 0.0, 0.0, 1.0, 1.0*CLHEP::TeV); HepMC::GenParticlePtr inParticle1 = HepMC::newGenParticlePtr(fourMomentum1, pdgid1, 2); myVertex->add_particle_in(inParticle1); @@ -336,7 +346,7 @@ namespace ISFTesting { HepMC::GenParticlePtr inParticle4 = HepMC::newGenParticlePtr(fourMomentum4, pdgid2, 1); myVertex->add_particle_out(inParticle4); anEvent->add_vertex( myVertex ); - anEvent->set_signal_process_vertex( myVertex ); + HepMC::set_signal_process_vertex(anEvent.get(), myVertex ); anEvent->set_beam_particles(inParticle1,inParticle2); MockTruthIncident ti(AtlasDetDescr::fAtlasID, 2); @@ -347,8 +357,8 @@ namespace ISFTesting { .WillOnce(::testing::Return(21)); EXPECT_CALL(ti, parentBarcode()) .Times(2) - .WillOnce(::testing::Return(inParticle3->barcode())) - .WillOnce(::testing::Return(inParticle3->barcode())); + .WillOnce(::testing::Return(HepMC::barcode(inParticle3))) + .WillOnce(::testing::Return(HepMC::barcode(inParticle3))); EXPECT_CALL(ti, parentParticle()) .Times(2) .WillOnce(::testing::Return(inParticle3)) @@ -358,13 +368,19 @@ namespace ISFTesting { .WillOnce(::testing::Return(nullptr)); recordIncidentToMCTruth(ti); - HepMC::GenVertexPtr generated = anEvent->barcode_to_vertex(-200001); //Find a nicer way to get this. + HepMC::GenVertexPtr generated = HepMC::barcode_to_vertex(anEvent.get(),-200001); //Find a nicer way to get this. ASSERT_EQ( vtxPosition, generated->position() ); ASSERT_EQ( 1021, generated->id() ); - ASSERT_EQ( -200001, generated->barcode() ); // by construction at the moment + ASSERT_EQ( -200001, HepMC::barcode(generated) ); // by construction at the moment +#ifdef HEPMC3 + ASSERT_EQ( 1, generated->particles_in().size()); + ASSERT_EQ( 0, generated->particles_out().size()); + ASSERT_EQ( inParticle3, *(generated->particles_in().cbegin())); +#else ASSERT_EQ( 1, generated->particles_in_size()); ASSERT_EQ( 0, generated->particles_out_size()); ASSERT_EQ( inParticle3, *(generated->particles_in_const_begin())); +#endif } @@ -375,9 +391,11 @@ namespace ISFTesting { const int event_number1(17); const int pdgid1(-13); const int pdgid2(13); - std::unique_ptr<HepMC::GenEvent> anEvent = std::make_unique<HepMC::GenEvent>(process_id1, event_number1); + std::unique_ptr<HepMC::GenEvent> anEvent = std::make_unique<HepMC::GenEvent>(); + anEvent->set_event_number(event_number1); + HepMC::set_signal_process_id(anEvent.get(),process_id1); const CLHEP::HepLorentzVector myPos( 0.0, 0.0, 0.0, 0.0); - HepMC::GenVertexPtr myVertex = HepMC::newGenVertexPtr( myPos, -1 ); + HepMC::GenVertexPtr myVertex = HepMC::newGenVertexPtr( HepMC::FourVector(myPos.x(),myPos.y(),myPos.z(),myPos.t()), -1 ); const HepMC::FourVector fourMomentum1( 0.0, 0.0, 1.0, 1.0*CLHEP::TeV); HepMC::GenParticlePtr inParticle1 = HepMC::newGenParticlePtr(fourMomentum1, pdgid1, 2); myVertex->add_particle_in(inParticle1); @@ -391,7 +409,7 @@ namespace ISFTesting { HepMC::GenParticlePtr inParticle4 = HepMC::newGenParticlePtr(fourMomentum4, pdgid2, 1); myVertex->add_particle_out(inParticle4); anEvent->add_vertex( myVertex ); - anEvent->set_signal_process_vertex( myVertex ); + HepMC::set_signal_process_vertex(anEvent.get(), myVertex ); anEvent->set_beam_particles(inParticle1,inParticle2); MockTruthIncident ti(AtlasDetDescr::fAtlasID, 2); @@ -400,11 +418,11 @@ namespace ISFTesting { .WillOnce(::testing::Return(21)); EXPECT_CALL(ti, parentBarcode()) .Times(2) - .WillOnce(::testing::Return(inParticle3->barcode())) - .WillOnce(::testing::Return(inParticle3->barcode())); + .WillOnce(::testing::Return(HepMC::barcode(inParticle3))) + .WillOnce(::testing::Return(HepMC::barcode(inParticle3))); registerTruthIncident(ti); - HepMC::GenVertexPtr generated = anEvent->barcode_to_vertex(-200001); //Find a nicer way to get this. + HepMC::GenVertexPtr generated = HepMC::barcode_to_vertex(anEvent.get(),-200001); //Find a nicer way to get this. HepMC::GenVertexPtr expectedVtx(nullptr); ASSERT_EQ( expectedVtx, generated); } @@ -419,9 +437,11 @@ namespace ISFTesting { const int event_number1(17); const int pdgid1(-13); const int pdgid2(13); - std::unique_ptr<HepMC::GenEvent> anEvent = std::make_unique<HepMC::GenEvent>(process_id1, event_number1); + std::unique_ptr<HepMC::GenEvent> anEvent = std::make_unique<HepMC::GenEvent>(); + anEvent->set_event_number(event_number1); + HepMC::set_signal_process_id(anEvent.get(),process_id1); const CLHEP::HepLorentzVector myPos( 0.0, 0.0, 0.0, 0.0); - HepMC::GenVertexPtr myVertex = HepMC::newGenVertexPtr( myPos, -1 ); + HepMC::GenVertexPtr myVertex = HepMC::newGenVertexPtr( HepMC::FourVector(myPos.x(),myPos.y(),myPos.z(),myPos.t()), -1 ); const HepMC::FourVector fourMomentum1( 0.0, 0.0, 1.0, 1.0*CLHEP::TeV); HepMC::GenParticlePtr inParticle1 = HepMC::newGenParticlePtr(fourMomentum1, pdgid1, 2); myVertex->add_particle_in(inParticle1); @@ -435,7 +455,7 @@ namespace ISFTesting { HepMC::GenParticlePtr inParticle4 = HepMC::newGenParticlePtr(fourMomentum4, pdgid2, 1); myVertex->add_particle_out(inParticle4); anEvent->add_vertex( myVertex ); - anEvent->set_signal_process_vertex( myVertex ); + HepMC::set_signal_process_vertex(anEvent.get(), myVertex ); anEvent->set_beam_particles(inParticle1,inParticle2); MockTruthIncident ti(AtlasDetDescr::fAtlasID, 2); @@ -446,21 +466,27 @@ namespace ISFTesting { .WillOnce(::testing::Return(21)); EXPECT_CALL(ti, parentBarcode()) .Times(3) - .WillOnce(::testing::Return(inParticle3->barcode())) - .WillOnce(::testing::Return(inParticle3->barcode())) - .WillOnce(::testing::Return(inParticle3->barcode())); + .WillOnce(::testing::Return(HepMC::barcode(inParticle3))) + .WillOnce(::testing::Return(HepMC::barcode(inParticle3))) + .WillOnce(::testing::Return(HepMC::barcode(inParticle3))); EXPECT_CALL(ti, parentParticle()) .Times(1) .WillOnce(::testing::Return(inParticle3)); registerTruthIncident(ti); - HepMC::GenVertexPtr generated = anEvent->barcode_to_vertex(-200001); //Find a nicer way to get this. + HepMC::GenVertexPtr generated = HepMC::barcode_to_vertex(anEvent.get(),-200001); //Find a nicer way to get this. ASSERT_EQ( vtxPosition, generated->position() ); ASSERT_EQ( 1021, generated->id() ); - ASSERT_EQ( -200001, generated->barcode() ); // by construction at the moment + ASSERT_EQ( -200001, HepMC::barcode(generated) ); // by construction at the moment +#ifdef HEPMC3 + ASSERT_EQ( 1, generated->particles_in().size()); + ASSERT_EQ( 0, generated->particles_out().size()); + ASSERT_EQ( inParticle3, *(generated->particles_in().cbegin())); +#else ASSERT_EQ( 1, generated->particles_in_size()); ASSERT_EQ( 0, generated->particles_out_size()); ASSERT_EQ( inParticle3, *(generated->particles_in_const_begin())); +#endif } @@ -482,9 +508,11 @@ namespace ISFTesting { const int event_number1(17); const int pdgid1(-13); const int pdgid2(13); - std::unique_ptr<HepMC::GenEvent> anEvent = std::make_unique<HepMC::GenEvent>(process_id1, event_number1); + std::unique_ptr<HepMC::GenEvent> anEvent = std::make_unique<HepMC::GenEvent>(); + anEvent->set_event_number(event_number1); + HepMC::set_signal_process_id(anEvent.get(),process_id1); const CLHEP::HepLorentzVector myPos( 0.0, 0.0, 0.0, 0.0); - HepMC::GenVertexPtr myVertex = HepMC::newGenVertexPtr( myPos, -1 ); + HepMC::GenVertexPtr myVertex = HepMC::newGenVertexPtr( HepMC::FourVector(myPos.x(),myPos.y(),myPos.z(),myPos.t()), -1 ); const HepMC::FourVector fourMomentum1( 0.0, 0.0, 1.0, 1.0*CLHEP::TeV); HepMC::GenParticlePtr inParticle1 = HepMC::newGenParticlePtr(fourMomentum1, pdgid1, 2); myVertex->add_particle_in(inParticle1); @@ -498,7 +526,7 @@ namespace ISFTesting { HepMC::GenParticlePtr inParticle4 = HepMC::newGenParticlePtr(fourMomentum4, pdgid2, 1); myVertex->add_particle_out(inParticle4); anEvent->add_vertex( myVertex ); - anEvent->set_signal_process_vertex( myVertex ); + HepMC::set_signal_process_vertex(anEvent.get(), myVertex ); anEvent->set_beam_particles(inParticle1,inParticle2); @@ -510,9 +538,9 @@ namespace ISFTesting { .WillOnce(::testing::Return(21)); EXPECT_CALL(ti, parentBarcode()) .Times(3) - .WillOnce(::testing::Return(inParticle3->barcode())) - .WillOnce(::testing::Return(inParticle3->barcode())) - .WillOnce(::testing::Return(inParticle3->barcode())); + .WillOnce(::testing::Return(HepMC::barcode(inParticle3))) + .WillOnce(::testing::Return(HepMC::barcode(inParticle3))) + .WillOnce(::testing::Return(HepMC::barcode(inParticle3))); EXPECT_CALL(ti, parentParticle()) .Times(1) .WillOnce(::testing::Return(inParticle3)); @@ -524,13 +552,19 @@ namespace ISFTesting { .WillOnce(::testing::Return(false)); registerTruthIncident(ti); - HepMC::GenVertexPtr generated = anEvent->barcode_to_vertex(-200001); //Find a nicer way to get this. + HepMC::GenVertexPtr generated = HepMC::barcode_to_vertex(anEvent.get(),-200001); //Find a nicer way to get this. ASSERT_EQ( vtxPosition, generated->position() ); ASSERT_EQ( 1021, generated->id() ); - ASSERT_EQ( -200001, generated->barcode() ); // by construction at the moment + ASSERT_EQ( -200001, HepMC::barcode(generated) ); // by construction at the moment +#ifdef HEPMC3 + ASSERT_EQ( 1, generated->particles_in().size()); + ASSERT_EQ( 0, generated->particles_out().size()); + ASSERT_EQ( inParticle3, *(generated->particles_in().cbegin())); +#else ASSERT_EQ( 1, generated->particles_in_size()); ASSERT_EQ( 0, generated->particles_out_size()); ASSERT_EQ( inParticle3, *(generated->particles_in_const_begin())); +#endif } @@ -549,9 +583,11 @@ namespace ISFTesting { const int event_number1(17); const int pdgid1(-13); const int pdgid2(13); - std::unique_ptr<HepMC::GenEvent> anEvent = std::make_unique<HepMC::GenEvent>(process_id1, event_number1); + std::unique_ptr<HepMC::GenEvent> anEvent = std::make_unique<HepMC::GenEvent>(); + anEvent->set_event_number(event_number1); + HepMC::set_signal_process_id(anEvent.get(),process_id1); const CLHEP::HepLorentzVector myPos( 0.0, 0.0, 0.0, 0.0); - HepMC::GenVertexPtr myVertex = HepMC::newGenVertexPtr( myPos, -1 ); + HepMC::GenVertexPtr myVertex = HepMC::newGenVertexPtr( HepMC::FourVector(myPos.x(),myPos.y(),myPos.z(),myPos.t()), -1 ); const HepMC::FourVector fourMomentum1( 0.0, 0.0, 1.0, 1.0*CLHEP::TeV); HepMC::GenParticlePtr inParticle1 = HepMC::newGenParticlePtr(fourMomentum1, pdgid1, 2); myVertex->add_particle_in(inParticle1); @@ -565,10 +601,10 @@ namespace ISFTesting { HepMC::GenParticlePtr inParticle4 = HepMC::newGenParticlePtr(fourMomentum4, pdgid2, 1); myVertex->add_particle_out(inParticle4); anEvent->add_vertex( myVertex ); - anEvent->set_signal_process_vertex( myVertex ); + HepMC::set_signal_process_vertex(anEvent.get(), myVertex ); anEvent->set_beam_particles(inParticle1,inParticle2); HepMC::GenParticlePtr inParticle5 = HepMC::newGenParticlePtr(fourMomentum3, pdgid1, 1); - inParticle5->suggest_barcode(1010003); + HepMC::suggest_barcode(inParticle5,1010003); inParticle5->set_status(1); MockTruthIncident ti(AtlasDetDescr::fAtlasID, 2); @@ -579,9 +615,9 @@ namespace ISFTesting { .WillOnce(::testing::Return(21)); EXPECT_CALL(ti, parentBarcode()) .Times(3) - .WillOnce(::testing::Return(inParticle3->barcode())) - .WillOnce(::testing::Return(inParticle3->barcode())) - .WillOnce(::testing::Return(inParticle3->barcode())); + .WillOnce(::testing::Return(HepMC::barcode(inParticle3))) + .WillOnce(::testing::Return(HepMC::barcode(inParticle3))) + .WillOnce(::testing::Return(HepMC::barcode(inParticle3))); EXPECT_CALL(ti, parentParticle()) .Times(2) .WillOnce(::testing::Return(inParticle3)) @@ -597,14 +633,21 @@ namespace ISFTesting { .WillOnce(::testing::Return(true)); registerTruthIncident(ti); - HepMC::GenVertexPtr generated = anEvent->barcode_to_vertex(-200001); //Find a nicer way to get this. + HepMC::GenVertexPtr generated = HepMC::barcode_to_vertex(anEvent.get(),-200001); //Find a nicer way to get this. ASSERT_EQ( vtxPosition, generated->position() ); ASSERT_EQ( 1021, generated->id() ); - ASSERT_EQ( -200001, generated->barcode() ); // by construction at the moment + ASSERT_EQ( -200001, HepMC::barcode(generated) ); // by construction at the moment +#ifdef HEPMC3 + ASSERT_EQ( 1, generated->particles_in().size()); + ASSERT_EQ( inParticle3, *(generated->particles_in().cbegin())); + ASSERT_EQ( 1, generated->particles_out().size()); + ASSERT_EQ( inParticle5, *(generated->particles_out().cbegin())); +#else ASSERT_EQ( 1, generated->particles_in_size()); ASSERT_EQ( inParticle3, *(generated->particles_in_const_begin())); ASSERT_EQ( 1, generated->particles_out_size()); ASSERT_EQ( inParticle5, *(generated->particles_out_const_begin())); +#endif } //TODO Add tests for the following cases: diff --git a/Simulation/ISF/ISF_Fatras/ISF_FatrasRecoTools/ISF_FatrasRecoTools/PRD_PlanarTruthTrajectoryBuilder.h b/Simulation/ISF/ISF_Fatras/ISF_FatrasRecoTools/ISF_FatrasRecoTools/PRD_PlanarTruthTrajectoryBuilder.h index 274be6f77222800a8ac8a27289213f62ff896b8a..eaecaae9ae4ccdfb030c77825559b12ff4d534f8 100644 --- a/Simulation/ISF/ISF_Fatras/ISF_FatrasRecoTools/ISF_FatrasRecoTools/PRD_PlanarTruthTrajectoryBuilder.h +++ b/Simulation/ISF/ISF_Fatras/ISF_FatrasRecoTools/ISF_FatrasRecoTools/PRD_PlanarTruthTrajectoryBuilder.h @@ -57,7 +57,7 @@ namespace iFatras { StatusCode finalize(); /** return a vector of PrepRawData trajectories - uses internal cache**/ - const std::map< const HepMC::GenParticle*, Trk::PRD_TruthTrajectory >& truthTrajectories() const; + const std::map< HepMC::ConstGenParticlePtr , Trk::PRD_TruthTrajectory >& truthTrajectories() const; /** Event refresh - can't be an IIncident, because it has to run after PRD creation and PRD truth creation */ StatusCode refreshEvent(); @@ -83,7 +83,7 @@ namespace iFatras { //!< Track geantinos or not bool m_geantinos; //!< the cache for the return (cleared by Incident) - mutable std::map< const HepMC::GenParticle*, Trk::PRD_TruthTrajectory > m_gpPrdTruthTrajectories; + mutable std::map<HepMC::ConstGenParticlePtr , Trk::PRD_TruthTrajectory > m_gpPrdTruthTrajectories; }; } // end of namespace diff --git a/Simulation/ISF/ISF_Fatras/ISF_FatrasRecoTools/src/PRD_PlanarTruthTrajectoryBuilder.cxx b/Simulation/ISF/ISF_Fatras/ISF_FatrasRecoTools/src/PRD_PlanarTruthTrajectoryBuilder.cxx index 0e31e6c0261fcda6ed5b53c0f54c6b1e80cf691d..2e03f261a8b5888bc71bcdfb4e10ecb733649464 100644 --- a/Simulation/ISF/ISF_Fatras/ISF_FatrasRecoTools/src/PRD_PlanarTruthTrajectoryBuilder.cxx +++ b/Simulation/ISF/ISF_Fatras/ISF_FatrasRecoTools/src/PRD_PlanarTruthTrajectoryBuilder.cxx @@ -105,7 +105,7 @@ StatusCode iFatras::PRD_PlanarTruthTrajectoryBuilder::refreshEvent() { } -const std::map< const HepMC::GenParticle*, Trk::PRD_TruthTrajectory >& iFatras::PRD_PlanarTruthTrajectoryBuilder::truthTrajectories() const { +const std::map< HepMC::ConstGenParticlePtr , Trk::PRD_TruthTrajectory >& iFatras::PRD_PlanarTruthTrajectoryBuilder::truthTrajectories() const { // ndof size_t ndofTotal = 0; size_t ndof = 0; @@ -125,7 +125,7 @@ const std::map< const HepMC::GenParticle*, Trk::PRD_TruthTrajectory >& iFatras:: for ( ; prdMtCIter != prdMtCIterE; ++ prdMtCIter ){ ATH_MSG_VERBOSE(" 2-Count " << second_count++ ); // check if entry exists and if - const HepMC::GenParticle* curGenP = (*prdMtCIter).second; + auto curGenP = (*prdMtCIter).second; Identifier curIdentifier = (*prdMtCIter).first; // apply the min pT cut if ( curGenP->momentum().perp() < m_minPt ) continue; @@ -139,7 +139,7 @@ const std::map< const HepMC::GenParticle*, Trk::PRD_TruthTrajectory >& iFatras:: if (prd){ ATH_MSG_VERBOSE(" I got the PRD for Id = " << curIdentifier ); // try to find the entry for this GenParticle - std::map< const HepMC::GenParticle*, Trk::PRD_TruthTrajectory >::iterator prdTrajIter = m_gpPrdTruthTrajectories.find(curGenP); + std::map< HepMC::ConstGenParticlePtr , Trk::PRD_TruthTrajectory >::iterator prdTrajIter = m_gpPrdTruthTrajectories.find(curGenP); if ( prdTrajIter == m_gpPrdTruthTrajectories.end() ){ // first PRD associated to this: create PRD_TruthTrajectory object Trk::PRD_TruthTrajectory newPrdTruthTrajectory; @@ -164,8 +164,8 @@ const std::map< const HepMC::GenParticle*, Trk::PRD_TruthTrajectory >& iFatras:: // PART 2 -------------------------------------------------------------------------------------------------------- // loop through the provided list of manipulators ( sorter is included ) - std::map< const HepMC::GenParticle*, Trk::PRD_TruthTrajectory >::iterator prdTruthTrajIter = m_gpPrdTruthTrajectories.begin(); - std::map< const HepMC::GenParticle*, Trk::PRD_TruthTrajectory >::iterator prdTruthTrajIterE = m_gpPrdTruthTrajectories.end(); + std::map< HepMC::ConstGenParticlePtr , Trk::PRD_TruthTrajectory >::iterator prdTruthTrajIter = m_gpPrdTruthTrajectories.begin(); + std::map< HepMC::ConstGenParticlePtr , Trk::PRD_TruthTrajectory >::iterator prdTruthTrajIterE = m_gpPrdTruthTrajectories.end(); for ( ; prdTruthTrajIter != prdTruthTrajIterE; ++prdTruthTrajIter ){ if ( m_prdTruthTrajectoryManipulators.size() ){ ToolHandleArray<Trk::IPRD_TruthTrajectoryManipulator>::const_iterator prdTTMIter = m_prdTruthTrajectoryManipulators.begin(); diff --git a/Simulation/ISF/ISF_Fatras/ISF_FatrasToolsMS/src/SimHitCreatorMS.cxx b/Simulation/ISF/ISF_Fatras/ISF_FatrasToolsMS/src/SimHitCreatorMS.cxx index 2217cade89a52814a888dc32056a43c1a0d73a96..45c752072f738ac15da5fa068c2e6da19374e796 100644 --- a/Simulation/ISF/ISF_Fatras/ISF_FatrasToolsMS/src/SimHitCreatorMS.cxx +++ b/Simulation/ISF/ISF_Fatras/ISF_FatrasToolsMS/src/SimHitCreatorMS.cxx @@ -93,7 +93,7 @@ StatusCode iFatras::SimHitCreatorMS::initialize() // Get IdHelper from ToolService ATH_CHECK(m_idHelperSvc.retrieve()); // the MS helpers for the different technologies - m_mdtHitIdHelper = MdtHitIdHelper::GetHelper(); + m_mdtHitIdHelper = MdtHitIdHelper::GetHelper(m_idHelperSvc->mdtIdHelper().tubeMax()); m_rpcHitIdHelper = RpcHitIdHelper::GetHelper(m_idHelperSvc->rpcIdHelper().gasGapMax()); m_tgcHitIdHelper = TgcHitIdHelper::GetHelper(); m_cscHitIdHelper = CscHitIdHelper::GetHelper(); diff --git a/Simulation/ISF/ISF_Geant4/ISF_Geant4Event/src/ISFG4Helper.cxx b/Simulation/ISF/ISF_Geant4/ISF_Geant4Event/src/ISFG4Helper.cxx index f84bbcf0bade9cb204721a8f0c9cfb3abf0bd62e..33f155a795ca2757468cec3526657ea7b3ab494c 100644 --- a/Simulation/ISF/ISF_Geant4/ISF_Geant4Event/src/ISFG4Helper.cxx +++ b/Simulation/ISF/ISF_Geant4/ISF_Geant4Event/src/ISFG4Helper.cxx @@ -43,7 +43,11 @@ iGeant4::ISFG4Helper::convertG4TrackToISFParticle(const G4Track& aTrack, double charge = particleDefinition.GetPDGCharge(); int pdgID = particleDefinition.GetPDGEncoding(); +#ifdef HEPMC3 + HepMC::GenParticlePtr genParticle = (truth) ? truth->getTruthParticle(): nullptr; +#else auto* genParticle = (truth) ? truth->getTruthParticle(): nullptr; +#endif Barcode::ParticleBarcode barcode = (genParticle) ? HepMC::barcode(genParticle) : Barcode::fUndefinedBarcode; ISF::ISFParticle *isp = new ISF::ISFParticle( position, diff --git a/Simulation/ISF/ISF_Geant4/ISF_Geant4Tools/python/ISF_Geant4ToolsConfigNew.py b/Simulation/ISF/ISF_Geant4/ISF_Geant4Tools/python/ISF_Geant4ToolsConfigNew.py index a3dccf52b7a660d7561f400e782c8cbbace98de9..480d0a898236be71e60de48fac4c120af267ed1f 100644 --- a/Simulation/ISF/ISF_Geant4/ISF_Geant4Tools/python/ISF_Geant4ToolsConfigNew.py +++ b/Simulation/ISF/ISF_Geant4/ISF_Geant4Tools/python/ISF_Geant4ToolsConfigNew.py @@ -4,7 +4,9 @@ Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration """ from AthenaConfiguration.ComponentFactory import CompFactory from RngComps.RandomServices import RNG -from G4AtlasServices.G4AtlasServicesConfigNew import DetectorGeometrySvcCfg +from G4AtlasServices.G4AtlasServicesConfigNew import ( + DetectorGeometrySvcCfg, PhysicsListSvcCfg +) from G4AtlasServices.G4AtlasUserActionConfigNew import ( ISFUserActionSvcCfg, ISFFullUserActionSvcCfg, ISFPassBackUserActionSvcCfg, ISF_AFIIUserActionSvcCfg, @@ -19,7 +21,7 @@ from ISF_FatrasServices.ISF_FatrasConfig import G4RunManagerHelperCfg def Geant4ToolCfg(flags, name="ISF_Geant4Tool", **kwargs): - acc = RNG(flags.Random.Engine) + acc = RNG(flags.Random.Engine, name="AthRNGSvc") kwargs.setdefault("RandomNumberService", acc.getService("AthRNGSvc")) acc.merge(DetectorGeometrySvcCfg(flags)) @@ -28,8 +30,11 @@ def Geant4ToolCfg(flags, name="ISF_Geant4Tool", **kwargs): acc.merge(InputConverterCfg(flags)) kwargs.setdefault("InputConverter", acc.getService("ISF_InputConverter")) - acc.merge(ISFUserActionSvcCfg(flags)) - kwargs.setdefault("UserActionSvc", acc.getService("G4UA::ISFUserActionSvc")) + #Only add it if it's not added already + if "UserActionSvc" not in kwargs.keys(): + acc.merge(ISFUserActionSvcCfg(flags)) + kwargs.setdefault("UserActionSvc", acc.getService("G4UA::ISFUserActionSvc")) + kwargs.setdefault("RecordFlux", flags.Sim.RecordFlux) kwargs.setdefault("MultiThreading", flags.Concurrency.NumThreads > 0) @@ -42,20 +47,26 @@ def Geant4ToolCfg(flags, name="ISF_Geant4Tool", **kwargs): acc.merge(FastSimulationMasterToolCfg(flags)) tool = acc.getPublicTool("FastSimulationMasterTool") kwargs.setdefault("FastSimMasterTool", tool) + + #PhysicsListSvc + acc.merge( PhysicsListSvcCfg(flags) ) + kwargs.setdefault("PhysicsListSvc", acc.getService( "PhysicsListSvc") ) + # Workaround to keep other simulation flavours working while we migrate everything to be AthenaMT-compatible. if flags.Sim.ISF.Simulator in ["FullG4", "FullG4MT", "PassBackG4", "PassBackG4MT", "G4FastCalo", "G4FastCaloMT"]: - acc.addPublicTool(CompFactory.iGeant4.G4TransportTool(name, **kwargs)) + acc.setPrivateTools(CompFactory.iGeant4.G4TransportTool(name, **kwargs)) else: acc.merge(G4RunManagerHelperCfg(flags)) kwargs.setdefault("G4RunManagerHelper", acc.getPublicTool("ISF_G4RunManagerHelper")) - acc.addPublicTool(CompFactory.iGeant4.G4LegacyTransportTool(name, **kwargs)) + acc.setPrivateTools(CompFactory.iGeant4.G4LegacyTransportTool(name, **kwargs)) return acc def FullGeant4ToolCfg(flags, name="ISF_FullGeant4Tool", **kwargs): acc = ISFFullUserActionSvcCfg(flags) kwargs.setdefault("UserActionSvc", acc.getService("G4UA::ISFFullUserActionSvc")) - acc.merge(Geant4ToolCfg(flags, name, **kwargs)) + FullGeant4Tool = acc.popToolsAndMerge(Geant4ToolCfg(flags, name, **kwargs)) + acc.setPrivateTools(FullGeant4Tool) return acc diff --git a/Simulation/ISF/ISF_Geant4/ISF_Geant4Tools/src/ISFTrajectory.cxx b/Simulation/ISF/ISF_Geant4/ISF_Geant4Tools/src/ISFTrajectory.cxx index ae443c2c671facec8b09193eb53644b850ea0411..a4bcb087f9768c8e9581b7ea4288df929e99f7d8 100644 --- a/Simulation/ISF/ISF_Geant4/ISF_Geant4Tools/src/ISFTrajectory.cxx +++ b/Simulation/ISF/ISF_Geant4/ISF_Geant4Tools/src/ISFTrajectory.cxx @@ -113,7 +113,7 @@ void iGeant4::ISFTrajectory::AppendStep(const G4Step* aStep) // make sure that the TruthBinding of the ISFParticle points to the newest // HepMC::GenParticle instance in case it got updated by the // ITruthSvc::registerTruthIncident call above - auto* currentGenPart = atlasG4EvtUserInfo->GetCurrentlyTraced(); + auto currentGenPart = atlasG4EvtUserInfo->GetCurrentlyTraced(); baseIsp->getTruthBinding()->setTruthParticle( currentGenPart ); Barcode::ParticleBarcode newBarcode = HepMC::barcode(currentGenPart); baseIsp->setBarcode( newBarcode ); diff --git a/Simulation/ISF/ISF_Geant4/ISF_Geant4Tools/src/PhysicsValidationUserAction.cxx b/Simulation/ISF/ISF_Geant4/ISF_Geant4Tools/src/PhysicsValidationUserAction.cxx index 17e8a0fb8ef22330d152d7c083005dc364dd931b..94959767cfeced39bcff975f2269339210eac0b6 100644 --- a/Simulation/ISF/ISF_Geant4/ISF_Geant4Tools/src/PhysicsValidationUserAction.cxx +++ b/Simulation/ISF/ISF_Geant4/ISF_Geant4Tools/src/PhysicsValidationUserAction.cxx @@ -240,16 +240,27 @@ namespace G4UA{ m_scIn = creation? creation->GetProcessSubType() : -1; VTrackInformation * trackInfo= static_cast<VTrackInformation*>(track->GetUserInformation()); +#ifdef HEPMC3 + HepMC::GenParticlePtr genpart=trackInfo ? std::const_pointer_cast<HepMC3::GenParticle>(trackInfo->GetHepMCParticle()):nullptr; +#else HepMC::GenParticlePtr genpart= trackInfo ? const_cast<HepMC::GenParticlePtr>(trackInfo->GetHepMCParticle()):0; - HepMC::GenVertex* vtx = genpart ? genpart->production_vertex() : 0; +#endif + HepMC::GenVertexPtr vtx = genpart ? genpart->production_vertex() : 0; m_gen = genpart? 0 : -1; if (genpart) { // mc truth known while (genpart && vtx ) { int pdgID=genpart->pdg_id(); +#ifdef HEPMC3 + HepMC::GenParticlePtr genmom = vtx->particles_in().size()>0 ? vtx->particles_in().front() : nullptr; + if ( genmom && pdgID!=genmom->pdg_id() ) m_gen++; + else if (vtx->particles_out().size()>0 && genpart!=vtx->particles_out().front()) m_gen++; + +#else HepMC::GenParticlePtr genmom = vtx->particles_in_size()>0 ? *(vtx->particles_in_const_begin()) : 0; if ( genmom && pdgID!=genmom->pdg_id() ) m_gen++; else if (vtx->particles_out_size()>0 && genpart!=*(vtx->particles_out_const_begin())) m_gen++; +#endif vtx = genmom ? genmom->production_vertex() : 0; genpart = genmom; } diff --git a/Simulation/ISF/ISF_Geant4/ISF_Geant4Tools/src/TrackProcessorUserActionBase.cxx b/Simulation/ISF/ISF_Geant4/ISF_Geant4Tools/src/TrackProcessorUserActionBase.cxx index dab4b903e4322dbf9843578bf08f789080e64b0b..6e496908dd31cabe19f632359e954b9f67d2c569 100644 --- a/Simulation/ISF/ISF_Geant4/ISF_Geant4Tools/src/TrackProcessorUserActionBase.cxx +++ b/Simulation/ISF/ISF_Geant4/ISF_Geant4Tools/src/TrackProcessorUserActionBase.cxx @@ -166,9 +166,15 @@ void TrackProcessorUserActionBase::setupPrimary(G4Track& aTrack) } int regenerationNr = ppInfo->GetRegenerationNr(); +#ifdef HEPMC3 + auto primaryTruthParticle = truthBinding->getGenerationZeroTruthParticle(); + auto generationZeroTruthParticle = truthBinding->getGenerationZeroTruthParticle(); + auto currentlyTracedHepPart = truthBinding->getTruthParticle(); +#else auto* primaryTruthParticle = truthBinding->getGenerationZeroTruthParticle(); auto* generationZeroTruthParticle = truthBinding->getGenerationZeroTruthParticle(); auto* currentlyTracedHepPart = truthBinding->getTruthParticle(); +#endif auto classification = classify(primaryTruthParticle, generationZeroTruthParticle, currentlyTracedHepPart, @@ -191,11 +197,19 @@ void TrackProcessorUserActionBase::setupSecondary(const G4Track& aTrack) auto* trackInfo = ::iGeant4::ISFG4Helper::getISFTrackInfo(aTrack); // why does TrackInformation return *const* GenParticle and ISFParticle objects!? +#ifdef HEPMC3 + HepMC::GenParticlePtr currentlyTracedTruthParticle = std::const_pointer_cast<HepMC3::GenParticle>( trackInfo->GetHepMCParticle() ); + HepMC::GenParticlePtr primaryTruthParticle = std::const_pointer_cast<HepMC3::GenParticle>( trackInfo->GetPrimaryHepMCParticle() ); + auto* baseISFParticle = const_cast<ISF::ISFParticle*>( trackInfo->GetBaseISFParticle() ); + + setCurrentParticle(baseISFParticle, primaryTruthParticle, currentlyTracedTruthParticle); +#else HepMC::GenParticlePtr currentlyTracedTruthParticle = const_cast<HepMC::GenParticlePtr>( trackInfo->GetHepMCParticle() ); HepMC::GenParticlePtr primaryTruthParticle = const_cast<HepMC::GenParticlePtr>( trackInfo->GetPrimaryHepMCParticle() ); auto* baseISFParticle = const_cast<ISF::ISFParticle*>( trackInfo->GetBaseISFParticle() ); setCurrentParticle(baseISFParticle, primaryTruthParticle, currentlyTracedTruthParticle); +#endif return; } diff --git a/Simulation/ISF/ISF_Geant4/ISF_Geant4Tools/src/TrackProcessorUserActionPassBack.cxx b/Simulation/ISF/ISF_Geant4/ISF_Geant4Tools/src/TrackProcessorUserActionPassBack.cxx index 1fdfb5dbe154f816eb4b5fc403f3dc5122e61a83..d7877b97ee4c8d3977d05372a98e1aa0ae610f8d 100644 --- a/Simulation/ISF/ISF_Geant4/ISF_Geant4Tools/src/TrackProcessorUserActionPassBack.cxx +++ b/Simulation/ISF/ISF_Geant4/ISF_Geant4Tools/src/TrackProcessorUserActionPassBack.cxx @@ -241,9 +241,14 @@ namespace G4UA { G4Exception("iGeant4::TrackProcessorUserActionPassBack", "NoTrackInformation", FatalException, description); return nullptr; //The G4Exception call above should abort the job, but Coverity does not seem to pick this up. } +#ifdef HEPMC3 + HepMC::GenParticlePtr primaryHepParticle = std::const_pointer_cast<HepMC3::GenParticle>(trackInfo->GetPrimaryHepMCParticle()); + HepMC::GenParticlePtr generationZeroHepParticle = std::const_pointer_cast<HepMC3::GenParticle>(trackInfo->GetHepMCParticle()); +#else HepMC::GenParticlePtr primaryHepParticle = const_cast<HepMC::GenParticlePtr>(trackInfo->GetPrimaryHepMCParticle()); HepMC::GenParticlePtr generationZeroHepParticle = const_cast<HepMC::GenParticlePtr>(trackInfo->GetHepMCParticle()); +#endif ISF::TruthBinding* tBinding = new ISF::TruthBinding(truthParticle, primaryHepParticle, generationZeroHepParticle); diff --git a/Simulation/ISF/ISF_HepMC/ISF_HepMC_Interfaces/ISF_HepMC_Interfaces/IGenParticleFilter.h b/Simulation/ISF/ISF_HepMC/ISF_HepMC_Interfaces/ISF_HepMC_Interfaces/IGenParticleFilter.h index a982785281580ae4db0a0837817e3c4ffcc9cae6..ef30901c0889be01d4a901763cf28b8ff6342f09 100644 --- a/Simulation/ISF/ISF_HepMC/ISF_HepMC_Interfaces/ISF_HepMC_Interfaces/IGenParticleFilter.h +++ b/Simulation/ISF/ISF_HepMC/ISF_HepMC_Interfaces/ISF_HepMC_Interfaces/IGenParticleFilter.h @@ -37,8 +37,13 @@ namespace ISF { /// Creates the InterfaceID and interfaceID() method DeclareInterfaceID(IGenParticleFilter, 1, 0); +#ifdef HEPMC3 + /** Returns a boolean if the particle has passed or not */ + virtual bool pass(HepMC::ConstGenParticlePtr particle) const = 0; +#else /** Returns a boolean if the particle has passed or not */ virtual bool pass(const HepMC::GenParticle& particle) const = 0; +#endif }; diff --git a/Simulation/ISF/ISF_HepMC/ISF_HepMC_Tools/src/GenParticleFinalStateFilter.cxx b/Simulation/ISF/ISF_HepMC/ISF_HepMC_Tools/src/GenParticleFinalStateFilter.cxx index 7ce0aa81d86ca7ba0ba4b21994e8bc12cc0f5334..954e498d03e153e8f970955ef8ed8c5048259db1 100644 --- a/Simulation/ISF/ISF_HepMC/ISF_HepMC_Tools/src/GenParticleFinalStateFilter.cxx +++ b/Simulation/ISF/ISF_HepMC/ISF_HepMC_Tools/src/GenParticleFinalStateFilter.cxx @@ -39,6 +39,17 @@ StatusCode ISF::GenParticleFinalStateFilter::initialize() /** returns true if the the particle is considered stable */ +#ifdef HEPMC3 +bool ISF::GenParticleFinalStateFilter::pass(HepMC::ConstGenParticlePtr particle) const +{ + bool passFilter = true; + passFilter &= isFinalState(particle); + passFilter &= (!m_checkGenSimStable) || MC::isSimStable(particle); + passFilter &= (!m_checkGenInteracting) || MC::isSimInteracting(particle); + return passFilter; +} + +#else bool ISF::GenParticleFinalStateFilter::pass(const HepMC::GenParticle& particle) const { bool passFilter = true; @@ -48,6 +59,7 @@ bool ISF::GenParticleFinalStateFilter::pass(const HepMC::GenParticle& particle) return passFilter; } +#endif StatusCode ISF::GenParticleFinalStateFilter::finalize() @@ -57,9 +69,18 @@ StatusCode ISF::GenParticleFinalStateFilter::finalize() } /** checks if the particle is in its final state (no end vertex) */ +#ifdef HEPMC3 +bool ISF::GenParticleFinalStateFilter::isFinalState(HepMC::ConstGenParticlePtr p) const { + // particle is in its final state if both: + // * no end_vertex + // * status==1 + return ( !p->end_vertex() && p->status()==1 ); +} +#else bool ISF::GenParticleFinalStateFilter::isFinalState(const HepMC::GenParticle &p) const { // particle is in its final state if both: // * no end_vertex // * status==1 return ( !p.end_vertex() && p.status()==1 ); } +#endif diff --git a/Simulation/ISF/ISF_HepMC/ISF_HepMC_Tools/src/GenParticleFinalStateFilter.h b/Simulation/ISF/ISF_HepMC/ISF_HepMC_Tools/src/GenParticleFinalStateFilter.h index 1e6e3dceb61d493ac4a4d48a138e224568724e02..b00e661f55ac82284557c1bbe9d1575687149045 100644 --- a/Simulation/ISF/ISF_HepMC/ISF_HepMC_Tools/src/GenParticleFinalStateFilter.h +++ b/Simulation/ISF/ISF_HepMC/ISF_HepMC_Tools/src/GenParticleFinalStateFilter.h @@ -42,12 +42,21 @@ namespace ISF { StatusCode initialize(); StatusCode finalize(); +#ifdef HEPMC3 + /** Returns the Particle Stack, should register truth */ + bool pass(HepMC::ConstGenParticlePtr particle) const; + private: + /** checks if the particle is in its final state (no end vertex) */ + bool isFinalState( HepMC::ConstGenParticlePtr p) const; +#else + /** Returns the Particle Stack, should register truth */ bool pass(const HepMC::GenParticle& particle) const; private: /** checks if the particle is in its final state (no end vertex) */ bool isFinalState( const HepMC::GenParticle& p) const; +#endif bool m_checkGenSimStable; //!< boolean switch to check on sim stable bool m_checkGenInteracting; //!< boolean switch to check on gen interacting diff --git a/Simulation/ISF/ISF_HepMC/ISF_HepMC_Tools/src/GenParticleGenericFilter.cxx b/Simulation/ISF/ISF_HepMC/ISF_HepMC_Tools/src/GenParticleGenericFilter.cxx index f4a54d5845c4ca7d9078e81d47da90a3a465a8ab..efee0b2b74bbc92fdc02c9532837fd07a173a282 100644 --- a/Simulation/ISF/ISF_HepMC/ISF_HepMC_Tools/src/GenParticleGenericFilter.cxx +++ b/Simulation/ISF/ISF_HepMC/ISF_HepMC_Tools/src/GenParticleGenericFilter.cxx @@ -81,17 +81,29 @@ StatusCode ISF::GenParticleGenericFilter::finalize() /** Returns whether the given particle passes all cuts or not */ +#ifdef HEPMC3 +bool ISF::GenParticleGenericFilter::pass(HepMC::ConstGenParticlePtr particle) const +#else bool ISF::GenParticleGenericFilter::pass(const HepMC::GenParticle& particle) const +#endif { bool pass = true; +#ifdef HEPMC3 + HepMC::ConstGenVertexPtr productionVertex = particle->production_vertex(); +#else HepMC::ConstGenVertexPtr productionVertex = particle.production_vertex(); +#endif const auto* position = productionVertex ? &productionVertex->position() : nullptr; if (!position || position->perp()<=m_maxApplicableRadius) { pass = check_cuts_passed(particle); } +#ifdef HEPMC3 + const auto& momentum = particle->momentum(); +#else const auto& momentum = particle.momentum(); +#endif ATH_MSG_VERBOSE( "GenParticle '" << particle << "' with " << (position ? "pos: r=" + std::to_string(position->perp()) : "") << ", mom: eta=" << momentum.eta() << " phi=" << momentum.phi() @@ -102,12 +114,18 @@ bool ISF::GenParticleGenericFilter::pass(const HepMC::GenParticle& particle) con /** Check whether the given particle passes all configure cuts or not */ +#ifdef HEPMC3 +bool ISF::GenParticleGenericFilter::check_cuts_passed(HepMC::ConstGenParticlePtr particle) const { + const auto momentum = particle->momentum(); + int pdg = particle->pdg_id(); +#else bool ISF::GenParticleGenericFilter::check_cuts_passed(const HepMC::GenParticle &particle) const { const auto& momentum = particle.momentum(); + int pdg = particle.pdg_id(); +#endif double mom = std::sqrt(momentum.x()*momentum.x()+momentum.y()*momentum.y()+momentum.z()*momentum.z()); double eta = momentum.eta(); double phi = momentum.phi(); - int pdg = particle.pdg_id(); // check the particle pdg code if( m_pdgs.size() && std::find(std::begin(m_pdgs), std::end(m_pdgs), pdg) == std::end(m_pdgs) ) { diff --git a/Simulation/ISF/ISF_HepMC/ISF_HepMC_Tools/src/GenParticleGenericFilter.h b/Simulation/ISF/ISF_HepMC/ISF_HepMC_Tools/src/GenParticleGenericFilter.h index b4c7129bcac638e5e794fe3ae6f0f250b26032a6..ed77e642c0e77e2ea7f4ce9a7276609a7ae7a16c 100644 --- a/Simulation/ISF/ISF_HepMC/ISF_HepMC_Tools/src/GenParticleGenericFilter.h +++ b/Simulation/ISF/ISF_HepMC/ISF_HepMC_Tools/src/GenParticleGenericFilter.h @@ -52,11 +52,19 @@ typedef std::vector<int> PDGCodes; StatusCode finalize(); /// Interface method that returns whether the given particle passes all cuts or not +#ifdef HEPMC3 + bool pass(HepMC::ConstGenParticlePtr particle) const; +#else bool pass(const HepMC::GenParticle& particle) const; +#endif private: /// Check whether the given particle passes all configure cuts or not +#ifdef HEPMC3 + bool check_cuts_passed(HepMC::ConstGenParticlePtr particle) const; +#else bool check_cuts_passed(const HepMC::GenParticle& particle) const; +#endif /// the cuts defined by the use double m_minEta; //!< min pseudorapidity cut diff --git a/Simulation/ISF/ISF_HepMC/ISF_HepMC_Tools/src/GenParticleInteractingFilter.cxx b/Simulation/ISF/ISF_HepMC/ISF_HepMC_Tools/src/GenParticleInteractingFilter.cxx index dbf3eff7450518947215361baa8f25e2e23b0dd5..c5d93d002fd25b912d1562ce5ec5bf743be0e6a0 100644 --- a/Simulation/ISF/ISF_HepMC/ISF_HepMC_Tools/src/GenParticleInteractingFilter.cxx +++ b/Simulation/ISF/ISF_HepMC/ISF_HepMC_Tools/src/GenParticleInteractingFilter.cxx @@ -11,6 +11,7 @@ // HepMC includes #include "AtlasHepMC/GenParticle.h" +#include "AtlasHepMC/Flow.h" // Helper function #include "TruthUtils/HepMCHelpers.h" @@ -67,6 +68,19 @@ StatusCode ISF::GenParticleInteractingFilter::initialize() } /** passes through to the private version of the filter */ +#ifdef HEPMC3 +bool ISF::GenParticleInteractingFilter::pass(HepMC::ConstGenParticlePtr particle) const +{ + const int pdg_id = particle->pdg_id(); + const bool isInteracting = find(m_additionalInteractingParticleTypes.begin(), + m_additionalInteractingParticleTypes.end(), + pdg_id) != m_additionalInteractingParticleTypes.end(); + const bool isNonInteracting = find(m_additionalNonInteractingParticleTypes.begin(), + m_additionalNonInteractingParticleTypes.end(), + pdg_id) != m_additionalNonInteractingParticleTypes.end(); + return !(MC::isNonInteracting( particle ) || isNonInteracting) || isInteracting; +} +#else bool ISF::GenParticleInteractingFilter::pass(const HepMC::GenParticle& particle) const { const int& pdg_id = particle.pdg_id(); @@ -78,4 +92,5 @@ bool ISF::GenParticleInteractingFilter::pass(const HepMC::GenParticle& particle) pdg_id) != m_additionalNonInteractingParticleTypes.end(); return !(MC::isNonInteracting( &particle ) || isNonInteracting) || isInteracting; } +#endif diff --git a/Simulation/ISF/ISF_HepMC/ISF_HepMC_Tools/src/GenParticleInteractingFilter.h b/Simulation/ISF/ISF_HepMC/ISF_HepMC_Tools/src/GenParticleInteractingFilter.h index 97f0011043c85df66ccbcbabcbe3737547953f16..ea2f829f04770bedbc1074b1a1fa818f95676012 100644 --- a/Simulation/ISF/ISF_HepMC/ISF_HepMC_Tools/src/GenParticleInteractingFilter.h +++ b/Simulation/ISF/ISF_HepMC/ISF_HepMC_Tools/src/GenParticleInteractingFilter.h @@ -18,6 +18,7 @@ // STL includes #include <string> +#include "AtlasHepMC/GenParticle.h" namespace ISF { class ISFParticle; @@ -40,9 +41,14 @@ namespace ISF { /** Framework methods */ virtual StatusCode initialize() override; +#ifdef HEPMC3 + /** passes through to the private version */ + virtual bool pass(HepMC::ConstGenParticlePtr particle ) const override; +#else /** passes through to the private version */ virtual bool pass(const HepMC::GenParticle& particle ) const override; +#endif /** Additional PDG codes to classify as interacting */ std::vector<int> m_additionalInteractingParticleTypes; diff --git a/Simulation/ISF/ISF_HepMC/ISF_HepMC_Tools/src/GenParticleLifetimeFilter.cxx b/Simulation/ISF/ISF_HepMC/ISF_HepMC_Tools/src/GenParticleLifetimeFilter.cxx index dd4edc16bdb1fb559a6aad539a3f5d2087d2ec3c..10891c17de6a4ccf1e8c73f869677f40c3d69611 100644 --- a/Simulation/ISF/ISF_HepMC/ISF_HepMC_Tools/src/GenParticleLifetimeFilter.cxx +++ b/Simulation/ISF/ISF_HepMC/ISF_HepMC_Tools/src/GenParticleLifetimeFilter.cxx @@ -27,10 +27,18 @@ ISF::GenParticleLifetimeFilter::GenParticleLifetimeFilter( const std::string& t, /** does the given particle pass the filter? */ +#ifdef HEPMC3 +bool ISF::GenParticleLifetimeFilter::pass(HepMC::ConstGenParticlePtr particle) const +#else bool ISF::GenParticleLifetimeFilter::pass(const HepMC::GenParticle& particle) const +#endif { // the GenParticle end vertex +#ifdef HEPMC3 + auto endVtx = particle->end_vertex(); +#else auto endVtx = particle.end_vertex(); +#endif // no production vertex? if (!endVtx) { ATH_MSG_DEBUG("GenParticle does not have an end vertex, this is fine"); @@ -40,7 +48,11 @@ bool ISF::GenParticleLifetimeFilter::pass(const HepMC::GenParticle& particle) co const auto& end4Vec = endVtx->position(); // the GenParticle production vertex +#ifdef HEPMC3 + auto prodVtx = particle->production_vertex(); +#else auto prodVtx = particle.production_vertex(); +#endif // no production vertex? if (!prodVtx) { ATH_MSG_DEBUG("GenParticle does not have a production vertex, filtering it out"); diff --git a/Simulation/ISF/ISF_HepMC/ISF_HepMC_Tools/src/GenParticleLifetimeFilter.h b/Simulation/ISF/ISF_HepMC/ISF_HepMC_Tools/src/GenParticleLifetimeFilter.h index f5629f8adde5119f4db87219932a1a8d47362f4b..b434bb8c10d976a97dcf8a07e98a2c47a459ec16 100644 --- a/Simulation/ISF/ISF_HepMC/ISF_HepMC_Tools/src/GenParticleLifetimeFilter.h +++ b/Simulation/ISF/ISF_HepMC/ISF_HepMC_Tools/src/GenParticleLifetimeFilter.h @@ -34,7 +34,11 @@ namespace ISF { ~GenParticleLifetimeFilter(){} /** does the given particle pass the filter? */ +#ifdef HEPMC3 + bool pass(HepMC::ConstGenParticlePtr particle) const; +#else bool pass(const HepMC::GenParticle& particle) const; +#endif private: double m_minLifetime{0.000001}; //units of c*ns diff --git a/Simulation/ISF/ISF_HepMC/ISF_HepMC_Tools/src/GenParticlePositionFilter.cxx b/Simulation/ISF/ISF_HepMC/ISF_HepMC_Tools/src/GenParticlePositionFilter.cxx index 597933ec224e891d99c7fe75bb8bc64755828033..33031f1e66d1d7c4a2f81428e299483298e8785b 100644 --- a/Simulation/ISF/ISF_HepMC/ISF_HepMC_Tools/src/GenParticlePositionFilter.cxx +++ b/Simulation/ISF/ISF_HepMC/ISF_HepMC_Tools/src/GenParticlePositionFilter.cxx @@ -12,6 +12,7 @@ // HepMC includes #include "AtlasHepMC/GenParticle.h" #include "AtlasHepMC/GenVertex.h" +#include "AtlasHepMC/SimpleVector.h" /** Constructor **/ ISF::GenParticlePositionFilter::GenParticlePositionFilter( const std::string& t, @@ -48,10 +49,17 @@ StatusCode ISF::GenParticlePositionFilter::initialize() /** does the given particle pass the filter? */ +#ifdef HEPMC3 +bool ISF::GenParticlePositionFilter::pass(HepMC::ConstGenParticlePtr particle) const +{ + // the GenParticle production vertex + auto vtx = particle->production_vertex(); +#else bool ISF::GenParticlePositionFilter::pass(const HepMC::GenParticle& particle) const { // the GenParticle production vertex HepMC::GenVertexPtr vtx = particle.production_vertex(); +#endif // no production vertex? if (!vtx) { diff --git a/Simulation/ISF/ISF_HepMC/ISF_HepMC_Tools/src/GenParticlePositionFilter.h b/Simulation/ISF/ISF_HepMC/ISF_HepMC_Tools/src/GenParticlePositionFilter.h index 18b0c3201542fab123b18be0dc50150b42fd8818..8bbe7b4c06228ec50d71d71e122a56e39facde4c 100644 --- a/Simulation/ISF/ISF_HepMC/ISF_HepMC_Tools/src/GenParticlePositionFilter.h +++ b/Simulation/ISF/ISF_HepMC/ISF_HepMC_Tools/src/GenParticlePositionFilter.h @@ -45,7 +45,11 @@ namespace ISF { StatusCode finalize(); /** does the given particle pass the filter? */ +#ifdef HEPMC3 + bool pass(HepMC::ConstGenParticlePtr particle) const; +#else bool pass(const HepMC::GenParticle& particle) const; +#endif private: ServiceHandle<IGeoIDSvc> m_geoIDSvc; diff --git a/Simulation/ISF/ISF_HepMC/ISF_HepMC_Tools/src/GenParticleSimWhiteList.cxx b/Simulation/ISF/ISF_HepMC/ISF_HepMC_Tools/src/GenParticleSimWhiteList.cxx index c4fefcb3daf6369f5a2641e073cd7c9a61cdc0e0..dcffa77c2c0c17d36803f7abff92f52f8e433721 100644 --- a/Simulation/ISF/ISF_HepMC/ISF_HepMC_Tools/src/GenParticleSimWhiteList.cxx +++ b/Simulation/ISF/ISF_HepMC/ISF_HepMC_Tools/src/GenParticleSimWhiteList.cxx @@ -72,6 +72,33 @@ StatusCode ISF::GenParticleSimWhiteList::initialize() } /** passes through to the private version of the filter */ +#ifdef HEPMC3 +bool ISF::GenParticleSimWhiteList::pass(HepMC::ConstGenParticlePtr particle) const +{ + + ATH_MSG_VERBOSE( "Checking whether " << particle << " passes the filter." ); + + static std::vector<int> vertices(500); + vertices.clear(); + bool so_far_so_good = pass( particle , vertices ); + + // Test all parent particles + if (so_far_so_good && particle->production_vertex() && m_qs){ + for (auto pit: particle->production_vertex()->particles_in()){ + // Loop breaker + if ( HepMC::barcode(pit) == HepMC::barcode(particle) ) continue; + // Check this particle + vertices.clear(); + bool parent_all_clear = pass( pit , vertices ); + ATH_MSG_VERBOSE( "Parent all clear: " << parent_all_clear << + "\nIf true, will not pass the daughter because it should have been picked up through the parent already (to avoid multi-counting)." ); + so_far_so_good = so_far_so_good && !parent_all_clear; + } // Loop over parents + } // particle had parents + + return so_far_so_good; +} +#else bool ISF::GenParticleSimWhiteList::pass(const HepMC::GenParticle& particle) const { @@ -98,8 +125,42 @@ bool ISF::GenParticleSimWhiteList::pass(const HepMC::GenParticle& particle) cons return so_far_so_good; } +#endif /** returns true if the the particle and all daughters are on the white list */ +#ifdef HEPMC3 +bool ISF::GenParticleSimWhiteList::pass(HepMC::ConstGenParticlePtr particle , std::vector<int> & used_vertices ) const +{ + // See if the particle is in the white list + bool passFilter = std::binary_search( m_pdgId.begin() , m_pdgId.end() , particle->pdg_id() ) || MC::PID::isNucleus( particle->pdg_id() ); + // Remove documentation particles + passFilter = passFilter && particle->status()<3; + // Test all daughter particles + if (particle->end_vertex() && m_qs && passFilter){ + // Break loops + if ( std::find( used_vertices.begin() , used_vertices.end() , HepMC::barcode(particle->end_vertex()) )==used_vertices.end() ){ + used_vertices.push_back( HepMC::barcode(particle->end_vertex()) ); + for (auto pit: particle->end_vertex()->particles_out()){ + passFilter = passFilter && pass( pit , used_vertices ); + if (!passFilter) { + ATH_MSG_VERBOSE( "Daughter particle " << pit << " does not pass." ); + break; + } + } // Loop over daughters + } // Break loops + } // particle had daughters + else if (!particle->end_vertex() && !passFilter && particle->status()<3) { // no daughters... No end vertex... Check if this isn't trouble + ATH_MSG_ERROR( "Found a particle with no end vertex that does not appear in the white list." ); + ATH_MSG_ERROR( "This is VERY likely pointing to a problem with either the configuration you "); + ATH_MSG_ERROR( "are using, or a bug in the generator. Either way it should be fixed. The"); + ATH_MSG_ERROR( "particle will come next, and then we will throw."); + ATH_MSG_ERROR( particle ); + throw; + } + + return passFilter; +} +#else bool ISF::GenParticleSimWhiteList::pass(const HepMC::GenParticle& particle , std::vector<int> & used_vertices ) const { // See if the particle is in the white list @@ -132,6 +193,7 @@ bool ISF::GenParticleSimWhiteList::pass(const HepMC::GenParticle& particle , std return passFilter; } +#endif StatusCode ISF::GenParticleSimWhiteList::finalize() { diff --git a/Simulation/ISF/ISF_HepMC/ISF_HepMC_Tools/src/GenParticleSimWhiteList.h b/Simulation/ISF/ISF_HepMC/ISF_HepMC_Tools/src/GenParticleSimWhiteList.h index bcd25eebef1da8bf59e7b2571b9a84810a3919a0..9dd60edc95a351016f5ef48c895030660a558002 100644 --- a/Simulation/ISF/ISF_HepMC/ISF_HepMC_Tools/src/GenParticleSimWhiteList.h +++ b/Simulation/ISF/ISF_HepMC/ISF_HepMC_Tools/src/GenParticleSimWhiteList.h @@ -19,6 +19,7 @@ #include <string> #include <vector> +#include "AtlasHepMC/GenParticle.h" namespace ISF { class ISFParticle; @@ -44,11 +45,19 @@ namespace ISF { StatusCode finalize(); /** passes through to the private version */ +#ifdef HEPMC3 + bool pass(HepMC::ConstGenParticlePtr particle ) const; +#else bool pass(const HepMC::GenParticle& particle ) const; +#endif private: /** returns true if the the particle and all daughters are on the white list */ +#ifdef HEPMC3 + bool pass(HepMC::ConstGenParticlePtr particle , std::vector<int> & used_vertices ) const; +#else bool pass(const HepMC::GenParticle& particle , std::vector<int> & used_vertices ) const; +#endif std::vector<std::string> m_whiteLists; //!< The location of the white lists std::vector<long int> m_pdgId; //!< Allowed PDG IDs bool m_qs; //!< Switch for quasi-stable particle simulation diff --git a/Simulation/ISF/ISF_HepMC/ISF_HepMC_Tools/test/GenParticleGenericFilter_test.cxx b/Simulation/ISF/ISF_HepMC/ISF_HepMC_Tools/test/GenParticleGenericFilter_test.cxx index 2988dfbf80678dbc267547a7d5da3f274b65a460..bd44aadecf473169fdc7f32e5be1d626629901b6 100644 --- a/Simulation/ISF/ISF_HepMC/ISF_HepMC_Tools/test/GenParticleGenericFilter_test.cxx +++ b/Simulation/ISF/ISF_HepMC/ISF_HepMC_Tools/test/GenParticleGenericFilter_test.cxx @@ -27,6 +27,7 @@ // Truth related includes #include "AtlasHepMC/GenParticle.h" #include "AtlasHepMC/GenVertex.h" +#include "AtlasHepMC/SimpleVector.h" namespace ISFTesting { @@ -108,7 +109,11 @@ protected: TEST_F(GenParticleGenericFilter_test, allPropertiesUnset_expectParticlePass) { EXPECT_TRUE( m_filterTool->initialize().isSuccess() ); +#ifdef HEPMC3 + HepMC::ConstGenParticlePtr part{}; +#else const HepMC::GenParticle part{}; +#endif ASSERT_TRUE( m_filterTool->pass(part) ); } @@ -118,7 +123,11 @@ TEST_F(GenParticleGenericFilter_test, minEtaGreaterThanParticleEta_expectNoPass) EXPECT_TRUE( m_filterTool->initialize().isSuccess() ); const HepMC::FourVector mom4(1.0*sin(150.*M_PI/180.), 0.0, 1.0*cos(150.*M_PI/180.), 1.0); // rho=1, eta=-1.32 +#ifdef HEPMC3 + HepMC::GenParticlePtr part=HepMC::newGenParticlePtr(mom4, /*pdg id=*/11); +#else const HepMC::GenParticle part(mom4, /*pdg id=*/11); +#endif ASSERT_FALSE( m_filterTool->pass(part) ); } @@ -129,7 +138,11 @@ TEST_F(GenParticleGenericFilter_test, minEtaSmallerThanParticleEta_expectPass) { EXPECT_TRUE( m_filterTool->initialize().isSuccess() ); const HepMC::FourVector mom4(1.0*sin(135.*M_PI/180.), 0.0, 1.0*cos(135.*M_PI/180.), 1.0); // rho=1, eta=-0.88 +#ifdef HEPMC3 + HepMC::GenParticlePtr part=HepMC::newGenParticlePtr(mom4, /*pdg id=*/11); +#else const HepMC::GenParticle part(mom4, /*pdg id=*/11); +#endif ASSERT_TRUE( m_filterTool->pass(part) ); } @@ -140,7 +153,11 @@ TEST_F(GenParticleGenericFilter_test, maxEtaSmallerThanParticleEta_expectNoPass) EXPECT_TRUE( m_filterTool->initialize().isSuccess() ); const HepMC::FourVector mom4(1.0*sin(30.*M_PI/180.), 0.0, 1.0*cos(30.*M_PI/180.), 1.0); // rho=1, eta=+1.32 +#ifdef HEPMC3 + HepMC::GenParticlePtr part=HepMC::newGenParticlePtr(mom4, /*pdg id=*/11); +#else const HepMC::GenParticle part(mom4, /*pdg id=*/11); +#endif ASSERT_FALSE( m_filterTool->pass(part) ); } @@ -151,7 +168,11 @@ TEST_F(GenParticleGenericFilter_test, maxEtaGreaterThanParticleEta_expectPass) { EXPECT_TRUE( m_filterTool->initialize().isSuccess() ); const HepMC::FourVector mom4(1.0*sin(45.*M_PI/180.), 0.0, 1.0*cos(45.*M_PI/180.), 1.0); // rho=1, eta=+0.88 +#ifdef HEPMC3 + HepMC::GenParticlePtr part=HepMC::newGenParticlePtr(mom4, /*pdg id=*/11); +#else const HepMC::GenParticle part(mom4, /*pdg id=*/11); +#endif ASSERT_TRUE( m_filterTool->pass(part) ); } @@ -163,7 +184,11 @@ TEST_F(GenParticleGenericFilter_test, particlePositiveEtaWithinEtaRange_expectPa EXPECT_TRUE( m_filterTool->initialize().isSuccess() ); const HepMC::FourVector mom4(1.0*sin(45.*M_PI/180.), 0.0, 1.0*cos(45.*M_PI/180.), 1.0); // rho=1, eta=+0.88 +#ifdef HEPMC3 + HepMC::GenParticlePtr part=HepMC::newGenParticlePtr(mom4, /*pdg id=*/11); +#else const HepMC::GenParticle part(mom4, /*pdg id=*/11); +#endif ASSERT_TRUE( m_filterTool->pass(part) ); } @@ -175,7 +200,11 @@ TEST_F(GenParticleGenericFilter_test, particleNegativeEtaWithinEtaRange_expectPa EXPECT_TRUE( m_filterTool->initialize().isSuccess() ); const HepMC::FourVector mom4(1.0*sin(135.*M_PI/180.), 0.0, 1.0*cos(135.*M_PI/180.), 1.0); // rho=1, eta=-0.88 +#ifdef HEPMC3 + HepMC::GenParticlePtr part=HepMC::newGenParticlePtr(mom4, /*pdg id=*/11); +#else const HepMC::GenParticle part(mom4, /*pdg id=*/11); +#endif ASSERT_TRUE( m_filterTool->pass(part) ); } @@ -187,7 +216,11 @@ TEST_F(GenParticleGenericFilter_test, particlePositiveEtaOutsideEtaRange_expectN EXPECT_TRUE( m_filterTool->initialize().isSuccess() ); const HepMC::FourVector mom4(1.0*sin(45.*M_PI/180.), 0.0, 1.0*cos(45.*M_PI/180.), 1.0); // rho=1, eta=+0.88 +#ifdef HEPMC3 + HepMC::GenParticlePtr part=HepMC::newGenParticlePtr(mom4, /*pdg id=*/11); +#else const HepMC::GenParticle part(mom4, /*pdg id=*/11); +#endif ASSERT_FALSE( m_filterTool->pass(part) ); } @@ -199,7 +232,11 @@ TEST_F(GenParticleGenericFilter_test, particleNegativeEtaOutsideEtaRange_expectN EXPECT_TRUE( m_filterTool->initialize().isSuccess() ); const HepMC::FourVector mom4(1.0*sin(135.*M_PI/180.), 0.0, 1.0*cos(135.*M_PI/180.), 1.0); // rho=1, eta=-0.88 +#ifdef HEPMC3 + HepMC::GenParticlePtr part=HepMC::newGenParticlePtr(mom4, /*pdg id=*/11); +#else const HepMC::GenParticle part(mom4, /*pdg id=*/11); +#endif ASSERT_FALSE( m_filterTool->pass(part) ); } @@ -210,7 +247,11 @@ TEST_F(GenParticleGenericFilter_test, minPhiGreaterThanParticlePhi_expectNoPass) EXPECT_TRUE( m_filterTool->initialize().isSuccess() ); const HepMC::FourVector mom4(1.0*cos(-1.1), 1.0*sin(-1.1), 0.0, 1.0); // rho=1, phi=-1.1 +#ifdef HEPMC3 + HepMC::GenParticlePtr part=HepMC::newGenParticlePtr(mom4, /*pdg id=*/11); +#else const HepMC::GenParticle part(mom4, /*pdg id=*/11); +#endif ASSERT_FALSE( m_filterTool->pass(part) ); } @@ -221,7 +262,11 @@ TEST_F(GenParticleGenericFilter_test, maxPhiSmallerThanParticlePhi_expectNoPass) EXPECT_TRUE( m_filterTool->initialize().isSuccess() ); const HepMC::FourVector mom4(1.0*cos(1.1), 1.0*sin(1.1), 0.0, 1.0); // rho=1, phi=1.1 +#ifdef HEPMC3 + HepMC::GenParticlePtr part=HepMC::newGenParticlePtr(mom4, /*pdg id=*/11); +#else const HepMC::GenParticle part(mom4, /*pdg id=*/11); +#endif ASSERT_FALSE( m_filterTool->pass(part) ); } @@ -231,7 +276,11 @@ TEST_F(GenParticleGenericFilter_test, pdgDoesntMatchParticle_expectNoPass) { EXPECT_TRUE( m_filterTool->setProperty("ParticlePDG", "[123,34,5678]").isSuccess() ); EXPECT_TRUE( m_filterTool->initialize().isSuccess() ); +#ifdef HEPMC3 + HepMC::GenParticlePtr part=HepMC::newGenParticlePtr(); +#else const HepMC::GenParticle part{}; +#endif ASSERT_FALSE( m_filterTool->pass(part) ); } @@ -241,7 +290,11 @@ TEST_F(GenParticleGenericFilter_test, pdgMatchesParticle_expectPass) { EXPECT_TRUE( m_filterTool->initialize().isSuccess() ); const HepMC::FourVector mom(0, 0, 0, 0); +#ifdef HEPMC3 + HepMC::GenParticlePtr part=HepMC::newGenParticlePtr(mom, /*pdg id=*/34); +#else const HepMC::GenParticle part(mom, /*pdg id=*/34); +#endif ASSERT_TRUE( m_filterTool->pass(part) ); } @@ -251,7 +304,11 @@ TEST_F(GenParticleGenericFilter_test, lastPdgMatchesParticle_expectPass) { EXPECT_TRUE( m_filterTool->initialize().isSuccess() ); const HepMC::FourVector mom(0, 0, 0, 0); +#ifdef HEPMC3 + HepMC::GenParticlePtr part=HepMC::newGenParticlePtr(mom, /*pdg id=*/5678); +#else const HepMC::GenParticle part(mom, /*pdg id=*/5678); +#endif ASSERT_TRUE( m_filterTool->pass(part) ); } @@ -261,7 +318,11 @@ TEST_F(GenParticleGenericFilter_test, minMomentumSmallerThanParticleMom_expectPa EXPECT_TRUE( m_filterTool->initialize().isSuccess() ); const HepMC::FourVector mom4(100.1, 0., 0., 0.); +#ifdef HEPMC3 + HepMC::GenParticlePtr part=HepMC::newGenParticlePtr(mom4, /*pdg id=*/11); +#else const HepMC::GenParticle part(mom4, /*pdg id=*/11); +#endif ASSERT_TRUE( m_filterTool->pass(part) ); } @@ -272,7 +333,11 @@ TEST_F(GenParticleGenericFilter_test, minMomentumGreaterThanParticleMom_expectNo EXPECT_TRUE( m_filterTool->initialize().isSuccess() ); const HepMC::FourVector mom4(99.9, 0., 0., 0.); +#ifdef HEPMC3 + HepMC::GenParticlePtr part=HepMC::newGenParticlePtr(mom4, /*pdg id=*/11); +#else const HepMC::GenParticle part(mom4, /*pdg id=*/11); +#endif ASSERT_FALSE( m_filterTool->pass(part) ); } @@ -283,7 +348,11 @@ TEST_F(GenParticleGenericFilter_test, maxMomentumGreaterThanParticleMom_expectPa EXPECT_TRUE( m_filterTool->initialize().isSuccess() ); const HepMC::FourVector mom4(0., 0., 99.9, 0.); +#ifdef HEPMC3 + HepMC::GenParticlePtr part=HepMC::newGenParticlePtr(mom4, /*pdg id=*/11); +#else const HepMC::GenParticle part(mom4, /*pdg id=*/11); +#endif ASSERT_TRUE( m_filterTool->pass(part) ); } @@ -294,7 +363,11 @@ TEST_F(GenParticleGenericFilter_test, maxMomentumSmallerThanParticleMom_expectNo EXPECT_TRUE( m_filterTool->initialize().isSuccess() ); const HepMC::FourVector mom4(0., 0., 100.1, 0.); +#ifdef HEPMC3 + HepMC::GenParticlePtr part=HepMC::newGenParticlePtr(mom4, /*pdg id=*/11); +#else const HepMC::GenParticle part(mom4, /*pdg id=*/11); +#endif ASSERT_FALSE( m_filterTool->pass(part) ); } @@ -306,7 +379,11 @@ TEST_F(GenParticleGenericFilter_test, particleMomentumWithinMomRange_expectPass) EXPECT_TRUE( m_filterTool->initialize().isSuccess() ); const HepMC::FourVector mom4(0., 101., 0., 0.); +#ifdef HEPMC3 + HepMC::GenParticlePtr part=HepMC::newGenParticlePtr(mom4, /*pdg id=*/11); +#else const HepMC::GenParticle part(mom4, /*pdg id=*/11); +#endif ASSERT_TRUE( m_filterTool->pass(part) ); } @@ -318,7 +395,11 @@ TEST_F(GenParticleGenericFilter_test, particleMomentumBelowMomRange_expectNoPass EXPECT_TRUE( m_filterTool->initialize().isSuccess() ); const HepMC::FourVector mom4(0., 99.9, 0., 0.); +#ifdef HEPMC3 + HepMC::GenParticlePtr part=HepMC::newGenParticlePtr(mom4, /*pdg id=*/11); +#else const HepMC::GenParticle part(mom4, /*pdg id=*/11); +#endif ASSERT_FALSE( m_filterTool->pass(part) ); } @@ -330,7 +411,11 @@ TEST_F(GenParticleGenericFilter_test, particleMomentumAboveMomRange_expectNoPass EXPECT_TRUE( m_filterTool->initialize().isSuccess() ); const HepMC::FourVector mom4(0., 0., 1000.1, 0.); +#ifdef HEPMC3 + HepMC::GenParticlePtr part=HepMC::newGenParticlePtr(mom4, /*pdg id=*/11); +#else const HepMC::GenParticle part(mom4, /*pdg id=*/11); +#endif ASSERT_FALSE( m_filterTool->pass(part) ); } @@ -341,11 +426,19 @@ TEST_F(GenParticleGenericFilter_test, productionVertexInsideApplicableRadius_exp EXPECT_TRUE( m_filterTool->initialize().isSuccess() ); const HepMC::FourVector pos(0., 0., 0., 0.); +#ifdef HEPMC3 + HepMC3::GenVertex vtx(pos); + auto part = HepMC::newGenParticlePtr(); + vtx.add_particle_out(part); + + ASSERT_TRUE( m_filterTool->pass(part) ); +#else HepMC::GenVertex vtx(pos); auto part = HepMC::newGenParticlePtr(); // need dynamic allocation as GenVertex takes ownership vtx.add_particle_out(part); ASSERT_TRUE( m_filterTool->pass(*part) ); +#endif } @@ -358,10 +451,17 @@ TEST_F(GenParticleGenericFilter_test, productionVertexOutsideApplicableRadiusAnd auto part = HepMC::newGenParticlePtr(mom4, /*pdg id=*/11); // need dynamic allocation as GenVertex takes ownership const HepMC::FourVector pos(0., 100., 0., 0.); +#ifdef HEPMC3 + HepMC3::GenVertex vtx(pos); + vtx.add_particle_out(part); + + ASSERT_TRUE( m_filterTool->pass(part) ); +#else HepMC::GenVertex vtx(pos); vtx.add_particle_out(part); ASSERT_TRUE( m_filterTool->pass(*part) ); +#endif } @@ -374,10 +474,17 @@ TEST_F(GenParticleGenericFilter_test, productionVertexWithinApplicableRadiusAndU auto part = HepMC::newGenParticlePtr(mom4, /*pdg id=*/11); // need dynamic allocation as GenVertex takes ownership const HepMC::FourVector pos(0., 9.9, 0., 0.); +#ifdef HEPMC3 + HepMC3::GenVertex vtx(pos); + vtx.add_particle_out(part); + + ASSERT_FALSE( m_filterTool->pass(part) ); +#else HepMC::GenVertex vtx(pos); vtx.add_particle_out(part); ASSERT_FALSE( m_filterTool->pass(*part) ); +#endif } @@ -391,11 +498,17 @@ TEST_F(GenParticleGenericFilter_test, productionVertexFarForwardInsideApplicable auto part = HepMC::newGenParticlePtr(mom4, /*pdg id=*/11); // need dynamic allocation as GenVertex takes ownership const HepMC::FourVector pos(0., 0., 9999., 0.); +#ifdef HEPMC3 + HepMC3::GenVertex vtx(pos); + vtx.add_particle_out(part); + ASSERT_FALSE( m_filterTool->pass(part) ); +#else HepMC::GenVertex vtx(pos); vtx.add_particle_out(part); ASSERT_FALSE( m_filterTool->pass(*part) ); +#endif } @@ -409,10 +522,17 @@ TEST_F(GenParticleGenericFilter_test, productionVertexFarForwardOutsideApplicabl auto part = HepMC::newGenParticlePtr(mom4, /*pdg id=*/11); // need dynamic allocation as GenVertex takes ownership const HepMC::FourVector pos(1.1, 0., 9999., 0.); +#ifdef HEPMC3 + HepMC3::GenVertex vtx(pos); + vtx.add_particle_out(part); + + ASSERT_TRUE( m_filterTool->pass(part) ); +#else HepMC::GenVertex vtx(pos); vtx.add_particle_out(part); ASSERT_TRUE( m_filterTool->pass(*part) ); +#endif } } // namespace ISFTesting diff --git a/Simulation/ISF/ISF_HepMC/ISF_HepMC_Tools/test/GenParticleInteractingFilter_test.cxx b/Simulation/ISF/ISF_HepMC/ISF_HepMC_Tools/test/GenParticleInteractingFilter_test.cxx index 8bd2fec655ccc9287d77f364ea7cd69ac30cc922..0456c492d9a8f3565ead3653b1051872ac18e05d 100644 --- a/Simulation/ISF/ISF_HepMC/ISF_HepMC_Tools/test/GenParticleInteractingFilter_test.cxx +++ b/Simulation/ISF/ISF_HepMC/ISF_HepMC_Tools/test/GenParticleInteractingFilter_test.cxx @@ -27,6 +27,7 @@ // Truth related includes #include "AtlasHepMC/GenParticle.h" #include "AtlasHepMC/GenVertex.h" +#include "AtlasHepMC/SimpleVector.h" namespace ISFTesting { @@ -109,7 +110,11 @@ TEST_F(GenParticleInteractingFilter_test, allPropertiesUnset_stdParticle_expectP EXPECT_TRUE( m_filterTool->initialize().isSuccess() ); const HepMC::FourVector mom4(1.0*sin(150.*M_PI/180.), 0.0, 1.0*cos(150.*M_PI/180.), 1.0); // rho=1, eta=-1.32 +#ifdef HEPMC3 + HepMC::GenParticlePtr part=HepMC::newGenParticlePtr(mom4, /*pdg id=*/11); +#else const HepMC::GenParticle part(mom4, /*pdg id=*/11); +#endif ASSERT_TRUE( m_filterTool->pass(part) ); } @@ -118,7 +123,11 @@ TEST_F(GenParticleInteractingFilter_test, allPropertiesUnset_stdParticle_expectN EXPECT_TRUE( m_filterTool->initialize().isSuccess() ); const HepMC::FourVector mom4(1.0*sin(150.*M_PI/180.), 0.0, 1.0*cos(150.*M_PI/180.), 1.0); // rho=1, eta=-1.32 +#ifdef HEPMC3 + HepMC::GenParticlePtr part=HepMC::newGenParticlePtr(mom4, /*pdg id=*/12); +#else const HepMC::GenParticle part(mom4, /*pdg id=*/12); +#endif ASSERT_FALSE( m_filterTool->pass(part) ); } @@ -127,7 +136,11 @@ TEST_F(GenParticleInteractingFilter_test, allPropertiesUnset_exoticParticle_expe EXPECT_TRUE( m_filterTool->initialize().isSuccess() ); const HepMC::FourVector mom4(1.0*sin(150.*M_PI/180.), 0.0, 1.0*cos(150.*M_PI/180.), 1.0); // rho=1, eta=-1.32 +#ifdef HEPMC3 + HepMC::GenParticlePtr part=HepMC::newGenParticlePtr(mom4, /*pdg id=*/4110000); +#else const HepMC::GenParticle part(mom4, /*pdg id=*/4110000); +#endif ASSERT_FALSE( m_filterTool->pass(part) ); } @@ -138,7 +151,11 @@ TEST_F(GenParticleInteractingFilter_test, stdParticle_expectPass) { EXPECT_TRUE( m_filterTool->initialize().isSuccess() ); const HepMC::FourVector mom4(1.0*sin(150.*M_PI/180.), 0.0, 1.0*cos(150.*M_PI/180.), 1.0); // rho=1, eta=-1.32 +#ifdef HEPMC3 + HepMC::GenParticlePtr part=HepMC::newGenParticlePtr(mom4, /*pdg id=*/11); +#else const HepMC::GenParticle part(mom4, /*pdg id=*/11); +#endif ASSERT_TRUE( m_filterTool->pass(part) ); } @@ -148,7 +165,11 @@ TEST_F(GenParticleInteractingFilter_test, stdParticle_expectNoPass) { EXPECT_TRUE( m_filterTool->initialize().isSuccess() ); const HepMC::FourVector mom4(1.0*sin(150.*M_PI/180.), 0.0, 1.0*cos(150.*M_PI/180.), 1.0); // rho=1, eta=-1.32 +#ifdef HEPMC3 + HepMC::GenParticlePtr part=HepMC::newGenParticlePtr(mom4, /*pdg id=*/12); +#else const HepMC::GenParticle part(mom4, /*pdg id=*/12); +#endif ASSERT_FALSE( m_filterTool->pass(part) ); } @@ -158,7 +179,11 @@ TEST_F(GenParticleInteractingFilter_test, exoticParticle_expectPass) { EXPECT_TRUE( m_filterTool->initialize().isSuccess() ); const HepMC::FourVector mom4(1.0*sin(150.*M_PI/180.), 0.0, 1.0*cos(150.*M_PI/180.), 1.0); // rho=1, eta=-1.32 +#ifdef HEPMC3 + HepMC::GenParticlePtr part=HepMC::newGenParticlePtr(mom4, /*pdg id=*/4110000); +#else const HepMC::GenParticle part(mom4, /*pdg id=*/4110000); +#endif ASSERT_TRUE( m_filterTool->pass(part) ); } diff --git a/Simulation/ISF/ISF_HepMC/ISF_HepMC_Tools/test/GenParticleLifetimeFilter_test.cxx b/Simulation/ISF/ISF_HepMC/ISF_HepMC_Tools/test/GenParticleLifetimeFilter_test.cxx index 81187e7f99f7b0fb777a892b727ef3eaad0cf331..9db4a0b022bc3116be9d96424005d2e32eb3af82 100644 --- a/Simulation/ISF/ISF_HepMC/ISF_HepMC_Tools/test/GenParticleLifetimeFilter_test.cxx +++ b/Simulation/ISF/ISF_HepMC/ISF_HepMC_Tools/test/GenParticleLifetimeFilter_test.cxx @@ -25,6 +25,7 @@ // Truth related includes #include "AtlasHepMC/GenParticle.h" #include "AtlasHepMC/GenVertex.h" +#include "AtlasHepMC/SimpleVector.h" namespace ISFTesting { @@ -106,7 +107,11 @@ protected: TEST_F(GenParticleLifetimeFilter_test, allPropertiesUnset_expectPass) { EXPECT_TRUE( m_filterTool->initialize().isSuccess() ); +#ifdef HEPMC3 + auto part = HepMC::newGenParticlePtr(); +#else const HepMC::GenParticle part{}; +#endif ASSERT_TRUE( m_filterTool->pass(part) ); // will pass as no end vertex } @@ -115,7 +120,11 @@ TEST_F(GenParticleLifetimeFilter_test, setMinimumLifetime_expectPass) { EXPECT_TRUE( m_filterTool->setProperty("MinimumLifetime", "1.3").isSuccess() ); EXPECT_TRUE( m_filterTool->initialize().isSuccess() ); +#ifdef HEPMC3 + auto part = HepMC::newGenParticlePtr(); +#else const HepMC::GenParticle part{}; +#endif ASSERT_TRUE( m_filterTool->pass(part) ); // will pass as no end vertex } @@ -129,7 +138,11 @@ TEST_F(GenParticleLifetimeFilter_test, addProdVtx_expectPass) { HepMC::GenVertex prodVtx(prodPos); auto part = HepMC::newGenParticlePtr(); // need dynamic allocation as GenVertex takes ownership prodVtx.add_particle_out(part); +#ifdef HEPMC3 + ASSERT_TRUE( m_filterTool->pass(part) ); // will pass as no end vertex +#else ASSERT_TRUE( m_filterTool->pass(*part) ); // will pass as no end vertex +#endif } @@ -144,7 +157,11 @@ TEST_F(GenParticleLifetimeFilter_test, minLifetimeGreaterThanParticleLifetime_ex const HepMC::FourVector endPos(0., 0., 0., 1.); HepMC::GenVertex endVtx(endPos); endVtx.add_particle_in(part); +#ifdef HEPMC3 + ASSERT_FALSE( m_filterTool->pass(part) ); // will fail as particle lifetime is only 1.0 +#else ASSERT_FALSE( m_filterTool->pass(*part) ); // will fail as particle lifetime is only 1.0 +#endif } @@ -159,7 +176,11 @@ TEST_F(GenParticleLifetimeFilter_test, minLifetimeLessThanParticleLifetime_expec const HepMC::FourVector endPos(0., 0., 0., 2.); HepMC::GenVertex endVtx(endPos); endVtx.add_particle_in(part); +#ifdef HEPMC3 + ASSERT_TRUE( m_filterTool->pass(part) ); // will pass as particle lifetime is 2.0 +#else ASSERT_TRUE( m_filterTool->pass(*part) ); // will pass as particle lifetime is 2.0 +#endif } @@ -171,7 +192,11 @@ TEST_F(GenParticleLifetimeFilter_test, endVtxButNoProdVtx_expectNoPass) { const HepMC::FourVector endPos(0., 0., 0., 2.); HepMC::GenVertex endVtx(endPos); endVtx.add_particle_in(part); +#ifdef HEPMC3 + ASSERT_FALSE( m_filterTool->pass(part) ); // will fail as prodVtx undefined +#else ASSERT_FALSE( m_filterTool->pass(*part) ); // will fail as prodVtx undefined +#endif } } // namespace ISFTesting diff --git a/Simulation/ISF/ISF_SimulationSelectors/src/ConeSimSelector.cxx b/Simulation/ISF/ISF_SimulationSelectors/src/ConeSimSelector.cxx index d298c9de756c187a313b25b030c14985838878a8..1a89e4ae86e3c8a2bd284a5a49a85911c1fc3410 100644 --- a/Simulation/ISF/ISF_SimulationSelectors/src/ConeSimSelector.cxx +++ b/Simulation/ISF/ISF_SimulationSelectors/src/ConeSimSelector.cxx @@ -142,7 +142,7 @@ void ISF::ConeSimSelector::update(const ISFParticle& particle) } // test whether any of the pdg codes is found in the genParticle history - HepMC::ConstGenParticlePtr relative = HepMCHelper::findRealtiveWithPDG( *genParticle, m_relation, m_relatives); + HepMC::ConstGenParticlePtr relative = HepMCHelper::findRealtiveWithPDG( genParticle, m_relation, m_relatives); if (relative) { diff --git a/Simulation/ISF/ISF_SimulationSelectors/src/TruthAssocSimSelector.cxx b/Simulation/ISF/ISF_SimulationSelectors/src/TruthAssocSimSelector.cxx index 4bf6af110ea8935baa3c1501977481db28c3f91c..62fc69e8e6ed4c491ed33a7f0d97b6bf37c13769 100644 --- a/Simulation/ISF/ISF_SimulationSelectors/src/TruthAssocSimSelector.cxx +++ b/Simulation/ISF/ISF_SimulationSelectors/src/TruthAssocSimSelector.cxx @@ -73,7 +73,7 @@ bool ISF::TruthAssocSimSelector::passSelectorCuts(const ISFParticle& particle) if (genParticle) { // test whether any of the pdg codes is found in the genParticle history - HepMC::ConstGenParticlePtr relative = HepMCHelper::findRealtiveWithPDG( *genParticle, m_relation, m_relatives); + HepMC::ConstGenParticlePtr relative = HepMCHelper::findRealtiveWithPDG( genParticle, m_relation, m_relatives); // in case a relative was found if (relative) { @@ -84,7 +84,7 @@ bool ISF::TruthAssocSimSelector::passSelectorCuts(const ISFParticle& particle) << " barcode=" << particle.barcode() << ")" << " passes due relative particle" << " (pdg=" << relative->pdg_id() << "," - << " barcode=" << HepMC::barcode(*relative) << ")" ); + << " barcode=" << HepMC::barcode(relative) << ")" ); // selector cuts passed return true; } // found relative diff --git a/Simulation/SimuJobTransforms/share/skeleton.HITtoRDO.py b/Simulation/SimuJobTransforms/share/skeleton.HITtoRDO.py index 1bf94188e53084c4a4143b2fb4c8766546e102c8..5fd42e4bc53bcff86931840b1dab4a65551a7dc1 100644 --- a/Simulation/SimuJobTransforms/share/skeleton.HITtoRDO.py +++ b/Simulation/SimuJobTransforms/share/skeleton.HITtoRDO.py @@ -421,10 +421,10 @@ if hasattr(runArgs,"AMITag"): svcMgr.TagInfoMgr.ExtraTagValuePairs.update({"AMITag": runArgs.AMITag}) #========================================================== -# Use LZIB for compression of temporary outputs of AthenaMP +# Use ZLIB for compression of all temporary outputs #========================================================== from AthenaCommon.AppMgr import ServiceMgr as svcMgr; import AthenaPoolCnvSvc.AthenaPool -if hasattr(runArgs, "outputRDOFile") and '_000' in runArgs.outputRDOFile: +if hasattr(runArgs, "outputRDOFile") and ('_000' in runArgs.outputRDOFile or 'tmp.' in runArgs.outputRDOFile): svcMgr.AthenaPoolCnvSvc.PoolAttributes += [ "DatabaseName = '" + athenaCommonFlags.PoolRDOOutput()+ "'; COMPRESSION_ALGORITHM = '1'" ] svcMgr.AthenaPoolCnvSvc.PoolAttributes += [ "DatabaseName = '" + athenaCommonFlags.PoolRDOOutput()+ "'; COMPRESSION_LEVEL = '1'" ] diff --git a/Simulation/Tests/DigitizationTests/test/test_PileUpDigiComparison.sh b/Simulation/Tests/DigitizationTests/test/test_PileUpDigiComparison.sh new file mode 100755 index 0000000000000000000000000000000000000000..e97e3189f892316b5f3ffd8680d05340bc132758 --- /dev/null +++ b/Simulation/Tests/DigitizationTests/test/test_PileUpDigiComparison.sh @@ -0,0 +1,75 @@ +#!/bin/sh +# +# art-description: Run a digitization example to compare configuration between ConfGetter and the new ComponentAccumulator approch. +# art-type: grid +# art-include: master/Athena +# art-output: mc16a_ttbar.CG.RDO.pool.root +# art-output: mc16a_ttbar.CA.RDO.pool.root +# art-output: log.* + +DigitizationPUConfigNew_test.py +rc=$? +echo "art-result: $rc CAdigi" + +DigiOutFileName="mc16d_ttbar.CG.RDO.pool.root" +HighPtMinbiasHitsFiles="/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/Tier0ChainTests/mc16_13TeV.361239.Pythia8EvtGen_A3NNPDF23LO_minbias_inelastic_high.merge.HITS.e4981_s3087_s3089/*" +LowPtMinbiasHitsFiles="/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/Tier0ChainTests/mc16_13TeV.361238.Pythia8EvtGen_A3NNPDF23LO_minbias_inelastic_low.merge.HITS.e4981_s3087_s3089/*" + +rc2=-9999 +if [ $rc -eq 0 ] +then + # config only + Digi_tf.py \ + --inputHITSFile /cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/Tier0ChainTests/valid1.410000.PowhegPythiaEvtGen_P2012_ttbar_hdamp172p5_nonallhad.simul.HITS.e4993_s3091/HITS.10504490._000425.pool.root.1 \ + --conditionsTag default:OFLCOND-MC16-SDR-20 \ + --digiSeedOffset1 170 --digiSeedOffset2 170 \ + --geometryVersion default:ATLAS-R2-2016-01-00-01 \ + --inputHighPtMinbiasHitsFile ${HighPtMinbiasHitsFiles} \ + --inputLowPtMinbiasHitsFile ${LowPtMinbiasHitsFiles} \ + --jobNumber 1 \ + --maxEvents 4 \ + --numberOfCavernBkg 0 \ + --numberOfHighPtMinBias 0.2099789464 \ + --numberOfLowPtMinBias 80.290021063135 \ + --outputRDOFile ${DigiOutFileName} \ + --digiSteeringConf "StandardSignalOnlyTruth" \ + --postExec 'all:CfgMgr.MessageSvc().setError+=["HepMcParticleLink"]' 'condSeq.LArAutoCorrTotalCondAlg.deltaBunch=1' 'job+=CfgMgr.JobOptsDumperAlg(FileName="DigiPUConfigCG.txt")' \ + --postInclude 'default:PyJobTransforms/UseFrontier.py' \ + --pileupFinalBunch 6 \ + --preExec 'all:from AthenaCommon.BeamFlags import jobproperties;jobproperties.Beam.numberOfCollisions.set_Value_and_Lock(20.0);from LArROD.LArRODFlags import larRODFlags;larRODFlags.NumberOfCollisions.set_Value_and_Lock(20);larRODFlags.nSamples.set_Value_and_Lock(4);larRODFlags.doOFCPileupOptimization.set_Value_and_Lock(True);larRODFlags.firstSample.set_Value_and_Lock(0);larRODFlags.useHighestGainAutoCorr.set_Value_and_Lock(True); from LArDigitization.LArDigitizationFlags import jobproperties;jobproperties.LArDigitizationFlags.useEmecIwHighGain.set_Value_and_Lock(False)' \ + --preInclude 'HITtoRDO:Digitization/ForceUseOfPileUpTools.py,SimulationJobOptions/preInlcude.PileUpBunchTrainsMC16c_2017_Config1.py,RunDependentSimData/configLumi_run300000_mc16d.py' \ + --skipEvents 0 \ + --athenaopts '"--config-only=DigiPUConfigCG.pkl"' + # full run + Digi_tf.py \ + --inputHITSFile /cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/Tier0ChainTests/valid1.410000.PowhegPythiaEvtGen_P2012_ttbar_hdamp172p5_nonallhad.simul.HITS.e4993_s3091/HITS.10504490._000425.pool.root.1 \ + --conditionsTag default:OFLCOND-MC16-SDR-20 \ + --digiSeedOffset1 170 --digiSeedOffset2 170 \ + --geometryVersion default:ATLAS-R2-2016-01-00-01 \ + --inputHighPtMinbiasHitsFile ${HighPtMinbiasHitsFiles} \ + --inputLowPtMinbiasHitsFile ${LowPtMinbiasHitsFiles} \ + --jobNumber 1 \ + --maxEvents 4 \ + --numberOfCavernBkg 0 \ + --numberOfHighPtMinBias 0.2099789464 \ + --numberOfLowPtMinBias 80.290021063135 \ + --outputRDOFile ${DigiOutFileName} \ + --digiSteeringConf "StandardSignalOnlyTruth" \ + --postExec 'all:CfgMgr.MessageSvc().setError+=["HepMcParticleLink"]' 'condSeq.LArAutoCorrTotalCondAlg.deltaBunch=1' 'job+=CfgMgr.JobOptsDumperAlg(FileName="DigiPUConfigCG.txt")' \ + --postInclude 'default:PyJobTransforms/UseFrontier.py' \ + --pileupFinalBunch 6 \ + --preExec 'all:from AthenaCommon.BeamFlags import jobproperties;jobproperties.Beam.numberOfCollisions.set_Value_and_Lock(20.0);from LArROD.LArRODFlags import larRODFlags;larRODFlags.NumberOfCollisions.set_Value_and_Lock(20);larRODFlags.nSamples.set_Value_and_Lock(4);larRODFlags.doOFCPileupOptimization.set_Value_and_Lock(True);larRODFlags.firstSample.set_Value_and_Lock(0);larRODFlags.useHighestGainAutoCorr.set_Value_and_Lock(True); from LArDigitization.LArDigitizationFlags import jobproperties;jobproperties.LArDigitizationFlags.useEmecIwHighGain.set_Value_and_Lock(False)' \ + --preInclude 'HITtoRDO:Digitization/ForceUseOfPileUpTools.py,SimulationJobOptions/preInlcude.PileUpBunchTrainsMC16c_2017_Config1.py,RunDependentSimData/configLumi_run300000_mc16d.py' \ + --skipEvents 0 +fi + +echo "art-result: $rc2 STdigi" + +rc3=-9999 +if [ $rc2 -eq 0 ] +then + acmd.py diff-root mc16d_ttbar.CG.RDO.pool.root mc16d_ttbar.CA.RDO.pool.root --mode=semi-detailed --order-trees --ignore-leaves RecoTimingObj_p1_HITStoRDO_timings index_ref --error-mode resilient + rc3=$? +fi + +echo "art-result: $rc3 comparison" diff --git a/Simulation/Tools/McEventCollectionFilter/src/McEventCollectionFilter.cxx b/Simulation/Tools/McEventCollectionFilter/src/McEventCollectionFilter.cxx index 173e660195c5a8f83d245a2b9a7f0afe9bb76613..29ed3a489040b87978ae51d6e507d481cf42d443 100644 --- a/Simulation/Tools/McEventCollectionFilter/src/McEventCollectionFilter.cxx +++ b/Simulation/Tools/McEventCollectionFilter/src/McEventCollectionFilter.cxx @@ -9,6 +9,9 @@ // #include "AtlasHepMC/GenEvent.h" #include "AtlasHepMC/GenVertex.h" +#include "AtlasHepMC/GenParticle.h" +#include "AtlasHepMC/Flow.h" +#include "AtlasHepMC/Polarization.h" // #include "InDetSimEvent/SiHit.h" #include "MuonSimEvent/TGCSimHit.h" @@ -203,8 +206,13 @@ StatusCode McEventCollectionFilter::ReduceMCEventCollection(){ const HepMC::FourVector& pmvxpos=hScatVx->position(); genVertex->set_position(pmvxpos); //to set geantino kinematic phi=eta=0, E=p=E_hard_scat +#ifdef HEPMC3 + auto itrp = hScatVx->particles_in().begin(); + if (hScatVx->particles_in().size()==2){ +#else HepMC::GenVertex::particles_in_const_iterator itrp =hScatVx->particles_in_const_begin(); if (hScatVx->particles_in_size()==2){ +#endif HepMC::FourVector mom1=(*itrp)->momentum(); HepMC::FourVector mom2=(*(++itrp))->momentum(); HepMC::FourVector vxmom; @@ -217,6 +225,9 @@ StatusCode McEventCollectionFilter::ReduceMCEventCollection(){ } } +#ifdef HEPMC3 + if(!evt->vertices().empty()) for (auto vtx: evt->vertices()) evt->remove_vertex(vtx); +#else if(!evt->vertices_empty()){ HepMC::GenEvent::vertex_iterator itvtx = evt->vertices_begin(); for (;itvtx != evt ->vertices_end(); ++itvtx ) { @@ -225,6 +236,7 @@ StatusCode McEventCollectionFilter::ReduceMCEventCollection(){ delete vtx; } } +#endif //-------------------------------------- if(m_IsKeepTRTElect){ diff --git a/TileCalorimeter/TileMonitoring/src/TileRODMonitorAlgorithm.h b/TileCalorimeter/TileMonitoring/src/TileRODMonitorAlgorithm.h index ad0c254dc53ff1af1ecd0dcd89c5482f0fc1d0c6..b1da4dc06858bb18deea21822df2f650ce9b7729 100644 --- a/TileCalorimeter/TileMonitoring/src/TileRODMonitorAlgorithm.h +++ b/TileCalorimeter/TileMonitoring/src/TileRODMonitorAlgorithm.h @@ -115,7 +115,7 @@ class TileRODMonitorAlgorithm : public TileMonitorAlgorithm { std::vector<std::vector<int>> m_dspChanTimeGroups; std::vector<uint32_t> m_tileRobIds; - static const int MAX_TILE_ROBS = 32; + static constexpr int MAX_TILE_ROBS = 32; }; diff --git a/Tools/PyJobTransforms/test/test_HelloWorldTrf.sh b/Tools/PyJobTransforms/test/test_HelloWorldTrf.sh index 989703b84fb3081e8da2dd58237c54d63bd5d0c4..af1afb31f1628a8710f1f11c13e9a30e83a30e21 100755 --- a/Tools/PyJobTransforms/test/test_HelloWorldTrf.sh +++ b/Tools/PyJobTransforms/test/test_HelloWorldTrf.sh @@ -2,6 +2,9 @@ set -e +mkdir -p test_HelloWorldTrf +cd test_HelloWorldTrf + # ST test HelloWorld_tf.py --maxEvents=5 --CA diff --git a/Tools/PyUtils/python/MetaReader.py b/Tools/PyUtils/python/MetaReader.py index 76b86552df67322c6cd3aa7a46cc98922611620b..52c3d8ad8e45ba56b552affcd83d14eada4a08f9 100644 --- a/Tools/PyUtils/python/MetaReader.py +++ b/Tools/PyUtils/python/MetaReader.py @@ -223,8 +223,12 @@ def read_metadata(filenames, file_type = None, mode = 'lite', promote = None, me aux = None if key == 'TriggerMenu' and 'TriggerMenuAux.' in persistent_instances: aux = persistent_instances['TriggerMenuAux.'] + elif key == 'DataVector<xAOD::TriggerMenu_v1>_TriggerMenu' and 'xAOD::TriggerMenuAuxContainer_v1_TriggerMenuAux.' in persistent_instances: + aux = persistent_instances['xAOD::TriggerMenuAuxContainer_v1_TriggerMenuAux.'] elif key == 'TriggerMenuAux.': continue + elif key == 'xAOD::TriggerMenuAuxContainer_v1_TriggerMenuAux.': + continue meta_dict[filename][key] = _convert_value(content, aux) @@ -608,9 +612,8 @@ def _extract_fields_triggermenu(interface, aux): firstMenu = interface.at(0) L1Items = [ item for item in firstMenu.itemNames() ] HLTChains = [ chain for chain in firstMenu.chainNames() ] - except Exception as err: + except Exception as err: # noqa: F841 msg.warn('Problem reading xAOD::TriggerMenu:') - msg.warn(err) result = {} result['L1Items'] = L1Items diff --git a/Tracking/TrkDetDescr/TrkGeometry/TrkGeometry/TrackingVolume.h b/Tracking/TrkDetDescr/TrkGeometry/TrkGeometry/TrackingVolume.h index 072c141f83bff89a8e27599fb9405e562cc55915..8fffd7c08503b260b82128fb417474dd87753681 100755 --- a/Tracking/TrkDetDescr/TrkGeometry/TrkGeometry/TrackingVolume.h +++ b/Tracking/TrkDetDescr/TrkGeometry/TrkGeometry/TrackingVolume.h @@ -410,10 +410,10 @@ namespace Trk { void moveTV ATLAS_NOT_THREAD_SAFE(Amg::Transform3D& transform) const; /** Forbidden copy constructor */ - TrackingVolume(const TrackingVolume&): Volume(), Material() {} + TrackingVolume(const TrackingVolume&) = delete; /** Forbid assignment. */ - TrackingVolume &operator=(const TrackingVolume&) { return *this; } + TrackingVolume &operator=(const TrackingVolume&) = delete; const TrackingVolume* m_motherVolume; //!< mother volume of this volume diff --git a/Tracking/TrkDetDescr/TrkGeometry/src/CompoundLayerMaterial.cxx b/Tracking/TrkDetDescr/TrkGeometry/src/CompoundLayerMaterial.cxx index ca7aa4626addc56e7b193b7bd045fd44edccdfab..730fe2bc5a881889faff74c857fc913207a3b1c2 100644 --- a/Tracking/TrkDetDescr/TrkGeometry/src/CompoundLayerMaterial.cxx +++ b/Tracking/TrkDetDescr/TrkGeometry/src/CompoundLayerMaterial.cxx @@ -13,9 +13,9 @@ Trk::CompoundLayerMaterial::CompoundLayerMaterial() : Trk::LayerMaterialProperties(), m_materialProperties(new Trk::MaterialProperties()), m_binUtility(nullptr), - m_fullComposition(false) + m_fullComposition(false), + m_elementTable (Trk::SharedObject<const Trk::ElementTable>(nullptr)) { - m_elementTable = Trk::SharedObject<const Trk::ElementTable>(nullptr); } Trk::CompoundLayerMaterial::CompoundLayerMaterial(const Trk::BinUtility& binutility, diff --git a/Tracking/TrkDetDescr/TrkGeometry/src/Layer.cxx b/Tracking/TrkDetDescr/TrkGeometry/src/Layer.cxx index 03df945f5755486e71ef66cfe65b10e84860f66d..cbdde4c2ebd1755d9df78a7ec499a8ff85d19f90 100755 --- a/Tracking/TrkDetDescr/TrkGeometry/src/Layer.cxx +++ b/Tracking/TrkDetDescr/TrkGeometry/src/Layer.cxx @@ -118,6 +118,7 @@ Trk::Layer& Trk::Layer::operator=(const Trk::Layer& lay) if (this != &lay){ delete m_overlapDescriptor; delete m_surfaceArray; + m_layerThickness = lay.m_layerThickness; m_enclosingTrackingVolume = lay.m_enclosingTrackingVolume; m_enclosingDetachedTrackingVolume = lay.m_enclosingDetachedTrackingVolume; m_overlapDescriptor = (lay.m_overlapDescriptor) ? lay.m_overlapDescriptor->clone() : nullptr; diff --git a/Tracking/TrkExtrapolation/TrkExUtils/src/RungeKuttaUtils.cxx b/Tracking/TrkExtrapolation/TrkExUtils/src/RungeKuttaUtils.cxx index 0432aec84d85351977455c99d759f9b273797fe2..7a46860b2b3cf2db2f9e7a467d85849d4ed09d67 100755 --- a/Tracking/TrkExtrapolation/TrkExUtils/src/RungeKuttaUtils.cxx +++ b/Tracking/TrkExtrapolation/TrkExUtils/src/RungeKuttaUtils.cxx @@ -947,77 +947,52 @@ std::pair<double,int> Trk::RungeKuttaUtils::stepEstimator // New covariance matrix calculation from old matrix and jacobian ///////////////////////////////////////////////////////////////////////////////// -AmgSymMatrix(5)* Trk::RungeKuttaUtils::newCovarianceMatrix -(const double* J,const AmgSymMatrix(5)& M) +AmgSymMatrix(5) * Trk::RungeKuttaUtils::newCovarianceMatrix( + const double* J, + const AmgSymMatrix(5) & M) { AmgSymMatrix(5)* nM = new AmgSymMatrix(5); AmgSymMatrix(5)& m = (*nM); - const double V[15]={M(0,0), - M(1,0),M(1,1), - M(2,0),M(2,1),M(2,2), - M(3,0),M(3,1),M(3,2),M(3,3), - M(4,0),M(4,1),M(4,2),M(4,3),M(4,4)}; - - const double a11 = (J[ 0]*V[ 0]+J[ 1]*V[ 1]+J[ 2]*V[ 3])+(J[ 3]*V[ 6]+J[ 4]*V[10]); - const double a12 = (J[ 0]*V[ 1]+J[ 1]*V[ 2]+J[ 2]*V[ 4])+(J[ 3]*V[ 7]+J[ 4]*V[11]); - const double a13 = (J[ 0]*V[ 3]+J[ 1]*V[ 4]+J[ 2]*V[ 5])+(J[ 3]*V[ 8]+J[ 4]*V[12]); - const double a14 = (J[ 0]*V[ 6]+J[ 1]*V[ 7]+J[ 2]*V[ 8])+(J[ 3]*V[ 9]+J[ 4]*V[13]); - const double a15 = (J[ 0]*V[10]+J[ 1]*V[11]+J[ 2]*V[12])+(J[ 3]*V[13]+J[ 4]*V[14]); - - m(0,0) = (a11*J[ 0]+a12*J[ 1]+a13*J[ 2])+(a14*J[ 3]+a15*J[ 4]); - - const double a21 = (J[ 5]*V[ 0]+J[ 6]*V[ 1]+J[ 7]*V[ 3])+(J[ 8]*V[ 6]+J[ 9]*V[10]); - const double a22 = (J[ 5]*V[ 1]+J[ 6]*V[ 2]+J[ 7]*V[ 4])+(J[ 8]*V[ 7]+J[ 9]*V[11]); - const double a23 = (J[ 5]*V[ 3]+J[ 6]*V[ 4]+J[ 7]*V[ 5])+(J[ 8]*V[ 8]+J[ 9]*V[12]); - const double a24 = (J[ 5]*V[ 6]+J[ 6]*V[ 7]+J[ 7]*V[ 8])+(J[ 8]*V[ 9]+J[ 9]*V[13]); - const double a25 = (J[ 5]*V[10]+J[ 6]*V[11]+J[ 7]*V[12])+(J[ 8]*V[13]+J[ 9]*V[14]); - - m(1,0) = (a21*J[ 0]+a22*J[ 1]+a23*J[ 2])+(a24*J[ 3]+a25*J[ 4]); - m(1,1) = (a21*J[ 5]+a22*J[ 6]+a23*J[ 7])+(a24*J[ 8]+a25*J[ 9]); - m(0,1) = m(1,0); - - const double a31 = (J[10]*V[ 0]+J[11]*V[ 1]+J[12]*V[ 3])+(J[13]*V[ 6]+J[14]*V[10]); - const double a32 = (J[10]*V[ 1]+J[11]*V[ 2]+J[12]*V[ 4])+(J[13]*V[ 7]+J[14]*V[11]); - const double a33 = (J[10]*V[ 3]+J[11]*V[ 4]+J[12]*V[ 5])+(J[13]*V[ 8]+J[14]*V[12]); - const double a34 = (J[10]*V[ 6]+J[11]*V[ 7]+J[12]*V[ 8])+(J[13]*V[ 9]+J[14]*V[13]); - const double a35 = (J[10]*V[10]+J[11]*V[11]+J[12]*V[12])+(J[13]*V[13]+J[14]*V[14]); - - m(2,0) = (a31*J[ 0]+a32*J[ 1]+a33*J[ 2])+(a34*J[ 3]+a35*J[ 4]); - m(2,1) = (a31*J[ 5]+a32*J[ 6]+a33*J[ 7])+(a34*J[ 8]+a35*J[ 9]); - m(2,2) = (a31*J[10]+a32*J[11]+a33*J[12])+(a34*J[13]+a35*J[14]); - m(0,2) = m(2,0); - m(1,2) = m(2,1); - - const double a41 = (J[15]*V[ 0]+J[16]*V[ 1]+J[17]*V[ 3])+(J[18]*V[ 6]+J[19]*V[10]); - const double a42 = (J[15]*V[ 1]+J[16]*V[ 2]+J[17]*V[ 4])+(J[18]*V[ 7]+J[19]*V[11]); - const double a43 = (J[15]*V[ 3]+J[16]*V[ 4]+J[17]*V[ 5])+(J[18]*V[ 8]+J[19]*V[12]); - const double a44 = (J[15]*V[ 6]+J[16]*V[ 7]+J[17]*V[ 8])+(J[18]*V[ 9]+J[19]*V[13]); - const double a45 = (J[15]*V[10]+J[16]*V[11]+J[17]*V[12])+(J[18]*V[13]+J[19]*V[14]); - - m(3,0) = (a41*J[ 0]+a42*J[ 1]+a43*J[ 2])+(a44*J[ 3]+a45*J[ 4]); - m(3,1) = (a41*J[ 5]+a42*J[ 6]+a43*J[ 7])+(a44*J[ 8]+a45*J[ 9]); - m(3,2) = (a41*J[10]+a42*J[11]+a43*J[12])+(a44*J[13]+a45*J[14]); - m(3,3) = (a41*J[15]+a42*J[16]+a43*J[17])+(a44*J[18]+a45*J[19]); - m(0,3) = m(3,0); - m(1,3) = m(3,1); - m(2,3) = m(3,2); - - const double a51 = J[20]*V[10]; - const double a52 = J[20] * V[11]; - const double a53 = J[20] * V[12]; - const double a54 = J[20] * V[13]; - const double a55 = J[20] * V[14]; - - m(4,0) = (a51*J[ 0]+a52*J[ 1]+a53*J[ 2])+(a54*J[ 3]+a55*J[ 4]); - m(4,1) = (a51*J[ 5]+a52*J[ 6]+a53*J[ 7])+(a54*J[ 8]+a55*J[ 9]); - m(4,2) = (a51*J[10]+a52*J[11]+a53*J[12])+(a54*J[13]+a55*J[14]); - m(4,3) = (a51*J[15]+a52*J[16]+a53*J[17])+(a54*J[18]+a55*J[19]); - m(4,4) = a55*J[20]; - m(0,4) = m(4,0); - m(1,4) = m(4,1); - m(2,4) = m(4,2); - m(3,4) = m(4,3); + Eigen::Map<const AmgVector(5)> JacMap0(&J[0], 5, 1); + const AmgVector(5) a1 = M * JacMap0; //(5x5 * 5x1) + m(0, 0) = a1.dot(JacMap0); // dot product + + Eigen::Map<const AmgVector(5)> JacMap5(&J[5]); + const AmgVector(5) a2 = M * JacMap5; + m(1, 0) = a2.dot(JacMap0); + m(1, 1) = a2.dot(JacMap5); + m(0, 1) = m(1, 0); + + Eigen::Map<const AmgVector(5)> JacMap10(&J[10], 5, 1); + const AmgVector(5) a3 = M * JacMap10; + m(2, 0) = a3.dot(JacMap0); + m(2, 1) = a3.dot(JacMap5); + m(2, 2) = a3.dot(JacMap10); + m(0, 2) = m(2, 0); + m(1, 2) = m(2, 1); + + Eigen::Map<const AmgVector(5)> JacMap15(&J[15], 5, 1); + const AmgVector(5) a4 = M * JacMap15; + m(3, 0) = a4.dot(JacMap0); + m(3, 1) = a4.dot(JacMap5); + m(3, 2) = a4.dot(JacMap10); + m(3, 3) = a4.dot(JacMap15); + m(0, 3) = m(3, 0); + m(1, 3) = m(3, 1); + m(2, 3) = m(3, 2); + + const AmgVector(5) a5 = M.row(4) * J[20]; + m(4, 0) = a5.dot(JacMap0); + m(4, 1) = a5.dot(JacMap5); + m(4, 2) = a5.dot(JacMap10); + m(4, 3) = a5.dot(JacMap15); + m(4, 4) = a5[4] * J[20]; + m(0, 4) = m(4, 0); + m(1, 4) = m(4, 1); + m(2, 4) = m(4, 2); + m(3, 4) = m(4, 3); + return nM; } diff --git a/Tracking/TrkFitter/TrkGaussianSumFilter/TrkGaussianSumFilter/GsfBetheHeitlerEffects.h b/Tracking/TrkFitter/TrkGaussianSumFilter/TrkGaussianSumFilter/GsfBetheHeitlerEffects.h index 591ad30217889a8f39e992dd4ff593c09791be76..4dd080aa15b834d7bb5d7fa20a35a746ce0a48f9 100644 --- a/Tracking/TrkFitter/TrkGaussianSumFilter/TrkGaussianSumFilter/GsfBetheHeitlerEffects.h +++ b/Tracking/TrkFitter/TrkGaussianSumFilter/TrkGaussianSumFilter/GsfBetheHeitlerEffects.h @@ -27,15 +27,43 @@ class GsfBetheHeitlerEffects { public: + static constexpr int maxNumberofComponents = 8; + static constexpr int maxOrderPolynomial = 10; + struct ComponentValues + { + // Default ctors/dtor/assignment operators + ComponentValues() = default; + ~ComponentValues() = default; + ComponentValues(const ComponentValues&) = default; + ComponentValues& operator=(const ComponentValues&) = default; + ComponentValues(ComponentValues&&) = default; + ComponentValues& operator=(ComponentValues&&) = default; + // Constructor with arguments + ComponentValues(double aWeight, double aMean, double aVariance) + : weight(aWeight) + , mean(aMean) + , variance(aVariance) + {} + double weight; + double mean; + double variance; + }; + + using MixtureParameters = std::array<ComponentValues, maxNumberofComponents>; + /** Helper class for construction and evaluation of polynomial */ class Polynomial { public: - // Default constructor Polynomial() = default; - - /** Constructor from a vector of coefficients (in decreasing order of powers - * of x */ + ~Polynomial() = default; + Polynomial(const Polynomial&) = default; + Polynomial& operator=(const Polynomial&) = default; + Polynomial(Polynomial&&) = default; + Polynomial& operator=(Polynomial&&) = default; + + /** Constructor from a vector of coefficients + * (in decreasing order of powers of x) */ Polynomial(const std::vector<double>& coefficients) : m_coefficients(coefficients){}; @@ -56,26 +84,6 @@ public: std::vector<double> m_coefficients; }; - struct ComponentValues - { - // Default ctors/dtor/assignment operators - ComponentValues() = default; - ~ComponentValues() = default; - ComponentValues(const ComponentValues&) = default; - ComponentValues& operator=(const ComponentValues&) = default; - ComponentValues(ComponentValues&&) = default; - ComponentValues& operator=(ComponentValues&&) = default; - // Constructor with arguments - ComponentValues(double aWeight, double aMean, double aVariance) - : weight(aWeight) - , mean(aMean) - , variance(aVariance) - {} - double weight; - double mean; - double variance; - }; - GsfBetheHeitlerEffects(const std::string&, const std::string&, const IInterface*); @@ -93,16 +101,13 @@ public: ParticleHypothesis particleHypothesis = nonInteracting) const override final; - typedef std::vector<ComponentValues> MixtureParameters; private: - // Read polynomial fit parameters from a specified file bool readParameters(); // Read coeffients for a single polynomial fit Polynomial readPolynomial(std::ifstream&, const int); - std::vector<Polynomial> m_polynomialWeights; std::vector<Polynomial> m_polynomialMeans; std::vector<Polynomial> m_polynomialVariances; @@ -110,7 +115,6 @@ private: std::vector<Polynomial> m_polynomialMeansHighX0; std::vector<Polynomial> m_polynomialVariancesHighX0; - int m_numberOfComponents; int m_transformationCode; int m_correctionFlag; @@ -122,11 +126,10 @@ private: double m_xOverRange; double m_upperRange; double m_componentMeanCut; - + bool m_useHighX0; std::string m_parameterisationFileName; std::string m_parameterisationFileNameHighX0; - }; } diff --git a/Tracking/TrkFitter/TrkGaussianSumFilter/TrkGaussianSumFilter/GsfCombinedMaterialEffects.h b/Tracking/TrkFitter/TrkGaussianSumFilter/TrkGaussianSumFilter/GsfCombinedMaterialEffects.h index c22f1c11c5ce7156c841a29a355c6a20d8090c56..1a903fd9a7ea5b2441f08784c1b5bb6fba5c71ca 100644 --- a/Tracking/TrkFitter/TrkGaussianSumFilter/TrkGaussianSumFilter/GsfCombinedMaterialEffects.h +++ b/Tracking/TrkFitter/TrkGaussianSumFilter/TrkGaussianSumFilter/GsfCombinedMaterialEffects.h @@ -16,7 +16,6 @@ #include "AthenaBaseComps/AthAlgTool.h" #include "GaudiKernel/ToolHandle.h" #include "TrkExInterfaces/IEnergyLossUpdator.h" -#include "TrkExInterfaces/IMultipleScatteringUpdator.h" #include "TrkGaussianSumFilter/IBetheHeitlerEffects.h" #include "TrkGaussianSumFilter/IMultiStateMaterialEffects.h" @@ -35,10 +34,7 @@ public: virtual ~GsfCombinedMaterialEffects() override; /** AlgTool initialise method */ - virtual StatusCode initialize() override; - - /** AlgTool finalise method */ - StatusCode finalize() override; + virtual StatusCode initialize() override final; virtual void compute( IMultiStateMaterialEffects::Cache&, @@ -73,12 +69,6 @@ private: PropDirection direction = anyDirection, ParticleHypothesis particleHypothesis = nonInteracting) const; - ToolHandle<IMultipleScatteringUpdator> m_msUpdator{ - this, - "MultipleScatteringUpdator", - "Trk::MultipleScatteringUpdator/AtlasMultipleScatteringUpdator", - "" - }; ToolHandle<IEnergyLossUpdator> m_EnergyLossUpdator{ this, diff --git a/Tracking/TrkFitter/TrkGaussianSumFilter/TrkGaussianSumFilter/GsfExtrapolator.h b/Tracking/TrkFitter/TrkGaussianSumFilter/TrkGaussianSumFilter/GsfExtrapolator.h index 0d936b2d1dde39c753c6fd8b2b5904737bae67e1..fc6e6283a8ba87e7ab637586f982dc4786fca345 100644 --- a/Tracking/TrkFitter/TrkGaussianSumFilter/TrkGaussianSumFilter/GsfExtrapolator.h +++ b/Tracking/TrkFitter/TrkGaussianSumFilter/TrkGaussianSumFilter/GsfExtrapolator.h @@ -19,8 +19,8 @@ #include "TrkExInterfaces/INavigator.h" #include "TrkExInterfaces/IPropagator.h" #include "TrkGaussianSumFilter/IMultiStateExtrapolator.h" -#include "TrkGaussianSumFilter/IMultiStateMaterialEffects.h" - +#include "TrkGaussianSumFilter/IMaterialMixtureConvolution.h" +#include "TrkExInterfaces/IMultipleScatteringUpdator.h" #include "AthenaBaseComps/AthAlgTool.h" #include "GaudiKernel/ToolHandle.h" #include "TrkMaterialOnTrack/MaterialEffectsOnTrack.h" @@ -41,9 +41,6 @@ class TrackingVolume; class TrackingGeometry; class TrackStateOnSurface; class MaterialProperties; -class IMultiComponentStateMerger; -class IMaterialMixtureConvolution; -class IMultipleScatteringUpdator; /** @class GsfExtrapolator */ class GsfExtrapolator final diff --git a/Tracking/TrkFitter/TrkGaussianSumFilter/TrkGaussianSumFilter/IBetheHeitlerEffects.h b/Tracking/TrkFitter/TrkGaussianSumFilter/TrkGaussianSumFilter/IBetheHeitlerEffects.h index 029d8860859bcb8f0b3ccc936315913c7a59cf31..8af03a16a9e7037318df80089e49e789bd1bcfb6 100644 --- a/Tracking/TrkFitter/TrkGaussianSumFilter/TrkGaussianSumFilter/IBetheHeitlerEffects.h +++ b/Tracking/TrkFitter/TrkGaussianSumFilter/TrkGaussianSumFilter/IBetheHeitlerEffects.h @@ -16,13 +16,9 @@ #include "GaudiKernel/IAlgTool.h" #include "GaudiKernel/ToolHandle.h" - +#include "TrkMultiComponentStateOnSurface/ComponentParameters.h" #include "TrkEventPrimitives/ParticleHypothesis.h" #include "TrkEventPrimitives/PropDirection.h" -#include "TrkMultiComponentStateOnSurface/MultiComponentState.h" - -#include <Eigen/StdVector> -#include <memory> namespace Trk { struct GSFEnergyLossCache diff --git a/Tracking/TrkFitter/TrkGaussianSumFilter/src/GaussianSumFitter.cxx b/Tracking/TrkFitter/TrkGaussianSumFilter/src/GaussianSumFitter.cxx index afef29f20f45ef69d7c37a7b60ecd1811255d6af..77bada201f6e21ab29fcce823e56058cfa57c81f 100644 --- a/Tracking/TrkFitter/TrkGaussianSumFilter/src/GaussianSumFitter.cxx +++ b/Tracking/TrkFitter/TrkGaussianSumFilter/src/GaussianSumFitter.cxx @@ -87,9 +87,9 @@ Trk::GaussianSumFitter::initialize() "Trk::ParticleHypothesis: " << m_overideMaterialEffects); } - if( m_maximumNumberOfComponents > 16){ - ATH_MSG_FATAL("Requested MaximumNumberOfComponents > 16"); - return StatusCode::FAILURE; + if (m_maximumNumberOfComponents > 16) { + ATH_MSG_FATAL("Requested MaximumNumberOfComponents > 16"); + return StatusCode::FAILURE; } // Initialise the closest track parameters search algorithm Amg::Vector3D referencePosition(m_sortingReferencePoint[0], @@ -207,8 +207,6 @@ Trk::GaussianSumFitter::fit( ++measurementOnTrack) { if (!(*measurementOnTrack)) { - ATH_MSG_DEBUG("This track contains an empty MeasurementBase object... " - "Ignoring object"); continue; } @@ -219,17 +217,12 @@ Trk::GaussianSumFitter::fit( } if (!rioOnTrack) { - ATH_MSG_DEBUG( - "Measurement could not be cast as a RIO_OnTrack object... continuing"); continue; } const PrepRawData* prepRawData = rioOnTrack->prepRawData(); if (!prepRawData) { - ATH_MSG_DEBUG( - "Defined RIO_OnTrack object has no associated PrepRawData object..." - << "this object will be ignored in fit"); continue; } @@ -293,7 +286,6 @@ Trk::GaussianSumFitter::fit( particleHypothesis); if (!forwardTrajectory || forwardTrajectory->empty()) { - ATH_MSG_DEBUG("Forward GSF fit failed... Exiting!"); ++m_ForwardFailure; return nullptr; } @@ -304,7 +296,6 @@ Trk::GaussianSumFitter::fit( // Protect against failed smoother fit if (!smoothedTrajectory) { - ATH_MSG_DEBUG("Smoother GSF fit failed... Exiting!"); ++m_SmootherFailure; return nullptr; } @@ -312,7 +303,6 @@ Trk::GaussianSumFitter::fit( // Outlier m_logic and track finalisation std::unique_ptr<FitQuality> fitQuality = buildFitQuality(*smoothedTrajectory); if (!fitQuality) { - ATH_MSG_DEBUG("Chi squared could not be calculated... Bailing"); ++m_fitQualityFailure; return nullptr; } @@ -321,12 +311,9 @@ Trk::GaussianSumFitter::fit( const Trk::MultiComponentStateOnSurface* perigeeMultiStateOnSurface = makePerigee( ctx, extrapolatorCache, *smoothedTrajectory, particleHypothesis); - ATH_MSG_DEBUG( - "perigeeMultiStateOnSurface :" << perigeeMultiStateOnSurface); if (perigeeMultiStateOnSurface) { smoothedTrajectory->push_back(perigeeMultiStateOnSurface); } else { - ATH_MSG_DEBUG("Perigee asked to be created but failed.....Exiting"); ++m_PerigeeFailure; return nullptr; } @@ -402,9 +389,6 @@ Trk::GaussianSumFitter::fit( } if (!ccot) { cleanedMeasurementSet.push_back(*itSet); - } else { - ATH_MSG_DEBUG( - "The MeasurementBase object is a Trk::CaloCluster_OnTrack"); } } } @@ -436,13 +420,11 @@ Trk::GaussianSumFitter::fit( particleHypothesis); if (!forwardTrajectory) { - ATH_MSG_DEBUG("Forward GSF fit failed... Exiting!"); ++m_ForwardFailure; return nullptr; } if (forwardTrajectory->empty()) { - ATH_MSG_DEBUG("No states in forward trajectory... Exiting!"); ++m_ForwardFailure; return nullptr; } @@ -454,7 +436,6 @@ Trk::GaussianSumFitter::fit( // Protect against failed smoother fit if (!smoothedTrajectory) { - ATH_MSG_DEBUG("Smoother GSF fit failed... Exiting!"); ++m_SmootherFailure; return nullptr; } @@ -463,7 +444,6 @@ Trk::GaussianSumFitter::fit( std::unique_ptr<FitQuality> fitQuality = buildFitQuality(*smoothedTrajectory); if (!fitQuality) { - ATH_MSG_DEBUG("Chi squared could not be calculated... Bailing"); ++m_fitQualityFailure; return nullptr; } @@ -472,13 +452,9 @@ Trk::GaussianSumFitter::fit( const Trk::MultiComponentStateOnSurface* perigeeMultiStateOnSurface = makePerigee( ctx, extrapolatorCache, *smoothedTrajectory, particleHypothesis); - ATH_MSG_DEBUG( - "perigeeMultiStateOnSurface :" << perigeeMultiStateOnSurface); - if (perigeeMultiStateOnSurface) { smoothedTrajectory->push_back(perigeeMultiStateOnSurface); } else { - ATH_MSG_DEBUG("Perigee asked to be created but failed.....Exiting"); ++m_PerigeeFailure; return nullptr; } @@ -529,8 +505,6 @@ Trk::GaussianSumFitter::fit(const EventContext& ctx, /* determine the Track Parameter which is the start of the trajectory, i.e. closest to the reference point */ - ATH_MSG_DEBUG("get track parameters near origin " - << (m_doHitSorting ? "via STL sort" : "from 1st state")); const TrackParameters* estimatedStartParameters = m_doHitSorting ? *(std::min_element(intrk.trackParameters()->begin(), @@ -544,14 +518,10 @@ Trk::GaussianSumFitter::fit(const EventContext& ctx, m_sortingReferencePoint[1], m_sortingReferencePoint[2]); - TrackFitInputPreparator* inputPreparator = - new TrackFitInputPreparator(referencePosition); - - PrepRawDataSet orderedPRDColl = inputPreparator->stripPrepRawData( + TrackFitInputPreparator inputPreparator(referencePosition); + PrepRawDataSet orderedPRDColl = inputPreparator.stripPrepRawData( intrk, addPrdColl, m_doHitSorting, true /* do not lose outliers! */); - delete inputPreparator; - return fit( ctx, orderedPRDColl, *estimatedStartParameters, runOutlier, matEffects); } @@ -711,7 +681,6 @@ Trk::GaussianSumFitter::makePerigee( particleHypothesis); if (stateExtrapolatedToPerigee.empty()) { - ATH_MSG_DEBUG("Track could not be extrapolated to perigee... returning 0"); return nullptr; } @@ -751,7 +720,6 @@ Trk::GaussianSumFitter::makePerigee( nullptr, pattern, modeQoverP); - ATH_MSG_DEBUG("makePerigee() returning sucessfully!"); return perigeeMultiStateOnSurface; } @@ -857,7 +825,6 @@ Trk::GaussianSumFitter::fitPRD( configuredParticleHypothesis); if (!stepIsValid) { - ATH_MSG_DEBUG("Fitter step is not valid... Exiting!"); return nullptr; } } @@ -976,11 +943,7 @@ Trk::GaussianSumFitter::stepForwardFit( false, particleHypothesis); if (extrapolatedState.empty()) { - ATH_MSG_DEBUG("Extrapolation failed... returning false"); return false; - } else { - ATH_MSG_DEBUG( - "Extrapolation worked... state size: " << extrapolatedState.size()); } // ======================= // Measurement Preparation @@ -1016,15 +979,12 @@ Trk::GaussianSumFitter::stepForwardFit( *measurement, *fitQuality); if (updatedState.empty()) { - ATH_MSG_DEBUG("Measurement update of the state failed... Exiting!"); return false; } // Reject hits with excessive Chi2 if (fitQuality->chiSquared() > m_cutChiSquaredPerNumberDOF * fitQuality->numberDoF()) { - ATH_MSG_DEBUG("Update with new measurement caused track to fail Chi " - "Squared test, removing the object"); fitQuality = std::make_unique<FitQuality>(1, 1); std::bitset<TrackStateOnSurface::NumberOfTrackStateOnSurfaceTypes> type(0); type.set(TrackStateOnSurface::Outlier); @@ -1073,8 +1033,8 @@ Trk::GaussianSumFitter::fit( * In general for things we want to control their lifetime locally * we use unique_ptr * - * For things where we get or pass ownership to a multistate and then continue - * to use them we opt for const ptr* for now. + * For things where we will not really own, but we need to point at + * we opt for const ptr* */ auto smoothedTrajectory = std::make_unique<Trk::SmoothedTrajectory>(); auto smootherPredictionMultiState = @@ -1083,12 +1043,11 @@ Trk::GaussianSumFitter::fit( * Get the initial smoother prediction. It is the last prediction in the * forwards trajectory */ - /* these can be owned by the input so const ptr*/ + + // these can be owned by the input so const ptr*/ const Trk::TrackStateOnSurface* smootherPredictionStateOnSurface = forwardTrajectory.back(); - /* - * We can have single or Multi components here, so we choose what to clone - */ + // We can have single or Multi components here, so we choose what to clone const Trk::MultiComponentStateOnSurface* smootherPredictionMultiStateOnSurface = nullptr; @@ -1119,10 +1078,9 @@ Trk::GaussianSumFitter::fit( */ Trk::FitQualityOnSurface fitQuality; /* - * The following 2 pointers if not null will be owned by the + * The following pointer if not null will be owned by the * MultiComponentStateOnSurface* updatedStateOnSurface - * at the end of the code and we need to re-use them. - * So const ptr + * at the end of the code and we need to re-use it */ const Trk::MeasurementBase* firstSmootherMeasurementOnTrack = smootherPredictionStateOnSurface->measurementOnTrack()->clone(); @@ -1138,7 +1096,6 @@ Trk::GaussianSumFitter::fit( fitQuality); if (firstSmoothedState.empty()) { - ATH_MSG_DEBUG("First GSF smoothing update failed... Exiting!"); delete firstSmootherMeasurementOnTrack; return nullptr; } @@ -1513,11 +1470,10 @@ Trk::GaussianSumFitter::addCCOT( } // Build TSOS with CCOT at the surface of the surface of calo - Trk::MultiComponentStateOnSurface* updatedMCSOS = - new Trk::MultiComponentStateOnSurface( - ccot->clone(), - MultiComponentStateHelpers::clone(updatedState).release(), - (std::make_unique<Trk::FitQualityOnSurface>(fitQuality)).release()); + auto updatedMCSOS = std::make_unique<Trk::MultiComponentStateOnSurface>( + ccot->clone(), + MultiComponentStateHelpers::clone(updatedState).release(), + (std::make_unique<Trk::FitQualityOnSurface>(fitQuality)).release()); // Extrapolate back to the surface nearest the origin extrapolatedState = m_extrapolator->extrapolateDirectly(ctx, @@ -1528,7 +1484,6 @@ Trk::GaussianSumFitter::addCCOT( Trk::nonInteracting); if (extrapolatedState.empty()) { - delete updatedMCSOS; return {}; } @@ -1545,8 +1500,8 @@ Trk::GaussianSumFitter::addCCOT( defPar.push_back(locX); Trk::LocalParameters locpars(defPar); - Trk::PseudoMeasurementOnTrack* pseudoMeasurement = - new PseudoMeasurementOnTrack(locpars, covMatrix, *currentSurface); + auto pseudoMeasurement = std::make_unique<Trk::PseudoMeasurementOnTrack>( + locpars, covMatrix, *currentSurface); // Combine the state using and find the mode of the distribution std::unique_ptr<Trk::TrackParameters> combinedState = @@ -1555,14 +1510,15 @@ Trk::GaussianSumFitter::addCCOT( m_updator.fitQuality(extrapolatedState, *ccot)); // Build a TSOS using the dummy measurement and combined state - Trk::MultiComponentStateOnSurface* finalSOS = - new Trk::MultiComponentStateOnSurface( - pseudoMeasurement, - combinedState.release(), - MultiComponentStateHelpers::clone(extrapolatedState).release(), - combinedFitQuality.release()); - smoothedTrajectory.push_back(updatedMCSOS); - smoothedTrajectory.push_back(finalSOS); + auto finalSOS = std::make_unique<Trk::MultiComponentStateOnSurface>( + pseudoMeasurement.release(), + combinedState.release(), + MultiComponentStateHelpers::clone(extrapolatedState).release(), + combinedFitQuality.release()); + + // Pointers owned by the smoothedTrajectory + smoothedTrajectory.push_back(updatedMCSOS.release()); + smoothedTrajectory.push_back(finalSOS.release()); return extrapolatedState; } diff --git a/Tracking/TrkFitter/TrkGaussianSumFilter/src/GsfBetheHeitlerEffects.cxx b/Tracking/TrkFitter/TrkGaussianSumFilter/src/GsfBetheHeitlerEffects.cxx index 3c6063f1c849aa314188a699efce428357dcf5ff..4607881ddba3f9e457b4e6ea0da367f84eb89afa 100644 --- a/Tracking/TrkFitter/TrkGaussianSumFilter/src/GsfBetheHeitlerEffects.cxx +++ b/Tracking/TrkFitter/TrkGaussianSumFilter/src/GsfBetheHeitlerEffects.cxx @@ -49,47 +49,39 @@ betheHeitlerVariance(const double r) } void -correctWeights(Trk::GsfBetheHeitlerEffects::MixtureParameters& mixture) +correctWeights(Trk::GsfBetheHeitlerEffects::MixtureParameters& mixture, + const int numberOfComponents) { - if (mixture.empty()) { + if (numberOfComponents < 1) { return; } - // Obtain the sum of weights double weightSum(0.); - - Trk::GsfBetheHeitlerEffects::MixtureParameters::const_iterator component = - mixture.begin(); - for (; component != mixture.end(); ++component) { - weightSum += (*component).weight; + for (int i = 0; i < numberOfComponents; ++i) { + weightSum += mixture[i].weight; } - // Rescale so that total weighting is 1 - Trk::GsfBetheHeitlerEffects::MixtureParameters::iterator modifiableComponent = - mixture.begin(); - - for (; modifiableComponent != mixture.end(); ++modifiableComponent) { - (*modifiableComponent).weight /= weightSum; + for (int i = 0; i < numberOfComponents; ++i) { + mixture[i].weight /= weightSum; } } double correctedFirstMean( const double pathlengthInX0, - const Trk::GsfBetheHeitlerEffects::MixtureParameters& mixture) + const Trk::GsfBetheHeitlerEffects::MixtureParameters& mixture, + const int numberOfComponents) { - - if (mixture.empty()) { - return 0.; + if (numberOfComponents < 1) { + return 0; } // Obtain the difference between the true and weighted sum double meanBH = betheHeitlerMean(pathlengthInX0); - Trk::GsfBetheHeitlerEffects::MixtureParameters::const_iterator component = - mixture.begin() + 1; - for (; component != mixture.end(); ++component) { - meanBH -= (*component).weight * (*component).mean; + for (int i = 1; i < numberOfComponents; ++i) { + meanBH -= mixture[i].weight * mixture[i].mean; } + // return the corrected mean for the first component return std::max(std::min(meanBH / mixture[0].weight, 1.), 0.); } @@ -97,25 +89,25 @@ correctedFirstMean( double correctedFirstVariance( const double pathlengthInX0, - const Trk::GsfBetheHeitlerEffects::MixtureParameters& mixture) + const Trk::GsfBetheHeitlerEffects::MixtureParameters& mixture, + const int numberOfComponents) { - - if (mixture.empty()) { - return 0.; + if (numberOfComponents < 1) { + return 0; } // Obtain the difference between the true and weighed sum variances double varianceBH = betheHeitlerVariance(pathlengthInX0) + (betheHeitlerMean(pathlengthInX0) * betheHeitlerMean(pathlengthInX0)); + varianceBH -= mixture[0].weight * mixture[0].mean * mixture[0].mean; - Trk::GsfBetheHeitlerEffects::MixtureParameters::const_iterator component = - mixture.begin() + 1; - for (; component != mixture.end(); ++component) { - varianceBH -= (*component).weight * ((*component).mean * (*component).mean + - (*component).variance); + for (int i = 1; i < numberOfComponents; ++i) { + varianceBH -= mixture[i].weight * + (mixture[i].mean * mixture[i].mean + mixture[i].variance); } + return std::max(varianceBH / mixture[0].weight, 0.); } @@ -123,20 +115,20 @@ Trk::GsfBetheHeitlerEffects::MixtureParameters getTranformedMixtureParameters( const std::vector<Trk::GsfBetheHeitlerEffects::Polynomial>& polynomialWeights, const std::vector<Trk::GsfBetheHeitlerEffects::Polynomial>& polynomialMeans, - const std::vector<Trk::GsfBetheHeitlerEffects::Polynomial>& polynomialVariances, + const std::vector<Trk::GsfBetheHeitlerEffects::Polynomial>& + polynomialVariances, const double pathlengthInX0, const int numberOfComponents) { - Trk::GsfBetheHeitlerEffects::MixtureParameters mixture; - mixture.reserve(numberOfComponents); + Trk::GsfBetheHeitlerEffects::MixtureParameters mixture{}; for (int i = 0; i < numberOfComponents; ++i) { const double updatedWeight = polynomialWeights[i](pathlengthInX0); const double updatedMean = polynomialMeans[i](pathlengthInX0); const double updatedVariance = polynomialVariances[i](pathlengthInX0); - mixture.emplace_back(logisticFunction(updatedWeight), - logisticFunction(updatedMean), - exp(updatedVariance)); + mixture[i] = { logisticFunction(updatedWeight), + logisticFunction(updatedMean), + exp(updatedVariance) }; } return mixture; } @@ -145,22 +137,24 @@ Trk::GsfBetheHeitlerEffects::MixtureParameters getMixtureParameters( const std::vector<Trk::GsfBetheHeitlerEffects::Polynomial>& polynomialWeights, const std::vector<Trk::GsfBetheHeitlerEffects::Polynomial>& polynomialMeans, - const std::vector<Trk::GsfBetheHeitlerEffects::Polynomial>& polynomialVariances, + const std::vector<Trk::GsfBetheHeitlerEffects::Polynomial>& + polynomialVariances, const double pathlengthInX0, const int numberOfComponents) { - Trk::GsfBetheHeitlerEffects::MixtureParameters mixture; - mixture.reserve(numberOfComponents); + Trk::GsfBetheHeitlerEffects::MixtureParameters mixture{}; for (int i = 0; i < numberOfComponents; ++i) { const double updatedWeight = polynomialWeights[i](pathlengthInX0); const double updatedMean = polynomialMeans[i](pathlengthInX0); const double updatedVariance = polynomialVariances[i](pathlengthInX0); - mixture.emplace_back( - updatedWeight, updatedMean, updatedVariance * updatedVariance); + mixture[i] = { updatedWeight, + updatedMean, + updatedVariance * updatedVariance }; } return mixture; } + } // end of Anonymous namespace for Helper methods Trk::GsfBetheHeitlerEffects::GsfBetheHeitlerEffects(const std::string& type, @@ -217,6 +211,8 @@ Trk::GsfBetheHeitlerEffects::initialize() bool Trk::GsfBetheHeitlerEffects::readParameters() { + + // Read std polynomial std::string resolvedFileName = PathResolver::find_file(m_parameterisationFileName, "DATAPATH"); if (!resolvedFileName.empty()) { @@ -238,14 +234,14 @@ Trk::GsfBetheHeitlerEffects::readParameters() fin >> orderPolynomial; fin >> m_transformationCode; // - if (not inRange(m_numberOfComponents, 0, 8)) { - ATH_MSG_ERROR("numberOfComponents Parameter out of range 0-8: " - << m_numberOfComponents); + if (not inRange(m_numberOfComponents, 0, maxNumberofComponents)) { + ATH_MSG_ERROR("numberOfComponents Parameter out of range 0- " + << maxNumberofComponents << " : " << m_numberOfComponents); return false; } - if (not inRange(orderPolynomial, 0, 10)) { - ATH_MSG_ERROR( - "orderPolynomial Parameter out of range 0-10: " << orderPolynomial); + if (not inRange(orderPolynomial, 0, maxOrderPolynomial)) { + ATH_MSG_ERROR("orderPolynomial Parameter out of range 0- " + << maxOrderPolynomial << " : " << orderPolynomial); return false; } if (not inRange(m_transformationCode, 0, 10)) { @@ -265,6 +261,7 @@ Trk::GsfBetheHeitlerEffects::readParameters() m_polynomialVariances.push_back(readPolynomial(fin, orderPolynomial)); } + // Read the high X0 polynomial if (m_useHighX0) { resolvedFileName = PathResolver::find_file(m_parameterisationFileNameHighX0, "DATAPATH"); @@ -288,14 +285,20 @@ Trk::GsfBetheHeitlerEffects::readParameters() fin >> orderPolynomial; fin >> m_transformationCodeHighX0; // - if (not inRange(m_numberOfComponentsHighX0, 0, 8)) { - ATH_MSG_ERROR("numberOfComponents Parameter out of range 0-8: " + if (not inRange(m_numberOfComponentsHighX0, 0, maxNumberofComponents)) { + ATH_MSG_ERROR("numberOfComponentsHighX0 Parameter out of range 0- " + << maxNumberofComponents << " : " << m_numberOfComponentsHighX0); return false; } - if (not inRange(orderPolynomial, 0, 10)) { - ATH_MSG_ERROR( - "orderPolynomial Parameter out of range 0-10: " << orderPolynomial); + if (m_numberOfComponentsHighX0 != m_numberOfComponents) { + ATH_MSG_ERROR(" numberOfComponentsHighX0 != numberOfComponents"); + return false; + } + + if (not inRange(orderPolynomial, 0, maxOrderPolynomial)) { + ATH_MSG_ERROR("orderPolynomial Parameter out of range 0- " + << maxOrderPolynomial << " : " << orderPolynomial); return false; } if (not inRange(m_transformationCodeHighX0, 0, 10)) { @@ -354,9 +357,6 @@ Trk::GsfBetheHeitlerEffects::compute( double pathlengthInX0 = pathLength / radiationLength; if (pathlengthInX0 < m_singleGaussianRange) { - ATH_MSG_DEBUG("Trying to apply energy loss to " - << pathlengthInX0 - << " x/x0. No Bethe-Heitler effects applied"); cache.weights.push_back(1.); cache.deltaPs.push_back(0.); cache.deltaQOvePCov.push_back(0.); @@ -423,17 +423,19 @@ Trk::GsfBetheHeitlerEffects::compute( } // Correct the mixture - correctWeights(mixture); + correctWeights(mixture, m_numberOfComponents); if (m_correctionFlag == 1) { - mixture[0].mean = correctedFirstMean(pathlengthInX0, mixture); + mixture[0].mean = + correctedFirstMean(pathlengthInX0, mixture, m_numberOfComponents); } if (m_correctionFlag == 2) { - mixture[0].mean = correctedFirstMean(pathlengthInX0, mixture); - mixture[0].variance = correctedFirstVariance(pathlengthInX0, mixture); + mixture[0].mean = + correctedFirstMean(pathlengthInX0, mixture, m_numberOfComponents); + mixture[0].variance = + correctedFirstVariance(pathlengthInX0, mixture, m_numberOfComponents); } - // int componentIndex = 0; double weightToBeRemoved(0.); int componentWithHighestMean(0); @@ -476,10 +478,6 @@ Trk::GsfBetheHeitlerEffects::compute( varianceInverseMomentum = mixture[componentIndex].variance / (momentum * momentum); } // end backwards propagation if clause - - AmgSymMatrix(5) newCovarianceMatrix; - newCovarianceMatrix.setZero(); - newCovarianceMatrix(Trk::qOverP, Trk::qOverP) = varianceInverseMomentum; cache.deltaQOvePCov.push_back(varianceInverseMomentum); } // end for loop over all components } diff --git a/Tracking/TrkFitter/TrkGaussianSumFilter/src/GsfCombinedMaterialEffects.cxx b/Tracking/TrkFitter/TrkGaussianSumFilter/src/GsfCombinedMaterialEffects.cxx index fdd34dbfe29a7e71db9d1c83c634bb1afeeaa9b9..6448dc58c53a4b9103dc4c4b5852f9b7b7f78830 100644 --- a/Tracking/TrkFitter/TrkGaussianSumFilter/src/GsfCombinedMaterialEffects.cxx +++ b/Tracking/TrkFitter/TrkGaussianSumFilter/src/GsfCombinedMaterialEffects.cxx @@ -9,10 +9,9 @@ */ #include "TrkGaussianSumFilter/GsfCombinedMaterialEffects.h" - -#include "GaudiKernel/ToolHandle.h" #include "TrkEventPrimitives/ParamDefs.h" -#include "TrkGeometry/Layer.h" +#include "TrkExUtils/MaterialInteraction.h" +#include "TrkGeometry/MaterialProperties.h" #include "TrkMaterialOnTrack/EnergyLoss.h" #include "TrkParameters/TrackParameters.h" #include "TrkSurfaces/Surface.h" @@ -35,17 +34,8 @@ Trk::GsfCombinedMaterialEffects::~GsfCombinedMaterialEffects() = default; StatusCode Trk::GsfCombinedMaterialEffects::initialize() { - ATH_CHECK(m_msUpdator.retrieve()); ATH_CHECK(m_EnergyLossUpdator.retrieve()); ATH_CHECK(m_betheHeitlerEffects.retrieve()); - ATH_MSG_INFO("Initialisation of " << name() << " was successful"); - return StatusCode::SUCCESS; -} - -StatusCode -Trk::GsfCombinedMaterialEffects::finalize() -{ - ATH_MSG_INFO("Finalisation of " << name() << " was successful"); return StatusCode::SUCCESS; } @@ -68,10 +58,8 @@ Trk::GsfCombinedMaterialEffects::compute( * 1. Retrieve multiple scattering corrections */ GSFScatteringCache cache_multipleScatter; - this->scattering(cache_multipleScatter, - componentParameters, - materialProperties, - pathLength); + this->scattering( + cache_multipleScatter, componentParameters, materialProperties, pathLength); /* * 2. Retrieve energy loss corrections @@ -157,20 +145,20 @@ Trk::GsfCombinedMaterialEffects::scattering( } const Amg::Vector3D& globalMomentum = trackParameters->momentum(); - double p = globalMomentum.mag(); - + const double p = globalMomentum.mag(); double pathcorrection = 1.; if (materialProperties.thickness() != 0) { pathcorrection = pathLength / materialProperties.thickness(); } - - // Here we know the path length to be meff.thicknessX0, so we set - // pathcorrection = 1 and create a dummy materialProperties with the - // properties we are interested in - MaterialProperties mprop( - materialProperties.thicknessInX0(), 1., 0., 0., 0., 0.); - const double angularVariation = - m_msUpdator->sigmaSquare(mprop, p, pathcorrection, Trk::muon); + const double t = pathcorrection * materialProperties.thicknessInX0(); + // We were/are using muon here, + // not sure is what we want 100%. + const double m = s_particleMasses.mass[Trk::muon]; + const double E = sqrt(p * p + m * m); + const double beta = p / E; + const Trk::MaterialInteraction matInt; + const double sigma = matInt.sigmaMS(t, p, beta); + const double angularVariation = sigma * sigma; const double sinTheta = std::sin(trackParameters->parameters()[Trk::theta]); cache.deltaThetaCov = angularVariation; diff --git a/Trigger/TrigAlgorithms/TrigFastTrackFinder/src/TrigFastTrackFinder.cxx b/Trigger/TrigAlgorithms/TrigFastTrackFinder/src/TrigFastTrackFinder.cxx index 098c684fa716cdf0e98237c9e02791e997408c22..b8bd2079a362f6248689512c736702f4e72eecf3 100644 --- a/Trigger/TrigAlgorithms/TrigFastTrackFinder/src/TrigFastTrackFinder.cxx +++ b/Trigger/TrigAlgorithms/TrigFastTrackFinder/src/TrigFastTrackFinder.cxx @@ -379,17 +379,20 @@ namespace InDet { } StatusCode TrigFastTrackFinder::execute() { + auto ctx = getContext(); //RoI preparation/update + SG::ReadHandle<TrigRoiDescriptorCollection> roiCollection(m_roiCollectionKey, ctx); + ATH_CHECK(roiCollection.isValid()); - TrigRoiDescriptorCollection::const_iterator roi = roiCollection->begin(); - TrigRoiDescriptorCollection::const_iterator roiE = roiCollection->end(); + TrigRoiDescriptor internalRoI; - for (; roi != roiE; ++roi) { - internalRoI.push_back(*roi); - } - internalRoI.manageConstituents(false);//Don't try to delete RoIs at the end + + if ( roiCollection->size()>1 ) ATH_MSG_WARNING( "More than one Roi in the collection: " << m_roiCollectionKey << ", this is not supported - use a composite Roi" ); + if ( roiCollection->size()>0 ) internalRoI = **roiCollection->begin(); + + // internalRoI.manageConstituents(false);//Don't try to delete RoIs at the end m_countTotalRoI++; SG::WriteHandle<TrackCollection> outputTracks(m_outputTracksKey, ctx); diff --git a/Trigger/TrigAlgorithms/TrigT2MinBias/src/T2ZdcFex.cxx b/Trigger/TrigAlgorithms/TrigT2MinBias/src/T2ZdcFex.cxx index d2f9b4e4f8eb3a122e1eea0b2c0800f5c0010cfa..92992e33897e11d2c7b0b14876a2fb12564dd602 100644 --- a/Trigger/TrigAlgorithms/TrigT2MinBias/src/T2ZdcFex.cxx +++ b/Trigger/TrigAlgorithms/TrigT2MinBias/src/T2ZdcFex.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ #include "T2ZdcFex.h" @@ -194,7 +194,6 @@ HLT::ErrorCode T2ZdcFex::hltInitialize() { } m_zdcID = zdcID; - ZdcCablingService::getInstance()->setZdcID(m_zdcID); // Create timers if(timerSvc()) { diff --git a/Trigger/TrigAlgorithms/TrigmuComb/python/TrigmuCombConfig_newJO.py b/Trigger/TrigAlgorithms/TrigmuComb/python/TrigmuCombConfig_newJO.py index 35c2417cf93cc122fa63cf32735682bf899b11a7..322877c9e030d2ed7c08eb16f78b30d17e866665 100644 --- a/Trigger/TrigAlgorithms/TrigmuComb/python/TrigmuCombConfig_newJO.py +++ b/Trigger/TrigAlgorithms/TrigmuComb/python/TrigmuCombConfig_newJO.py @@ -35,10 +35,9 @@ def muCombCfg(flags, postFix="", useBackExtrp=True): idScanEndcap2Res = [0.030, 0.0000002] idScanEndcap3Res = [0.036, 0.0000004] idScanEndcap4Res = [0.046, 0.0000002] - - from TrigmuComb.TrigmuCombMTConfig import muCombMT from TrigmuComb.TrigmuCombMonitoring import TrigMuCombMonitoring - muCombAlg = muCombMT(name = "Muon"+postFix, + muCombMT = CompFactory.muCombMT + muCombAlg = muCombMT(name = "MuComb"+postFix, MuCombStrategy = 0, UseBackExtrapolatorG4 = useBackExtrp, MinPtTRK = 0., @@ -51,19 +50,20 @@ def muCombCfg(flags, postFix="", useBackExtrp=True): IDSCANEndcap3Res = idScanEndcap3Res, IDSCANEndcap4Res = idScanEndcap4Res, IDalgo = "InDetTrigTrackingxAODCnv_Muon_FTF", - MonTool = TrigMuCombMonitoring() ) + MonTool = TrigMuCombMonitoring()) return acc, muCombAlg -def l2MuCombRecoCfg(flags): +def l2MuCombRecoCfg(flags, name="L2MuCombReco"): from TriggerMenuMT.HLTMenuConfig.Menu.MenuComponents import InViewReco - reco = InViewReco("L2MuCombReco") + reco = InViewReco(name) acc, alg = muCombCfg(flags) alg.L2StandAloneMuonContainerName=muFastInfo alg.L2CombinedMuonContainerName = muCombInfo + alg.TrackParticlesContainerName="TrigFastTrackFinder_Tracks__Muon" muCombAcc = ComponentAccumulator() muCombAcc.addEventAlgo(alg) diff --git a/Trigger/TrigAnalysis/TrigInDetAnalysisUser/share/TIDAdata-chains-run3.dat b/Trigger/TrigAnalysis/TrigInDetAnalysisUser/share/TIDAdata-chains-run3.dat index 827cd51155d14c752bb9e0752bc03453090bc1f9..9704e02ecdfe0f16e81972b4878f68579d73b0a2 100644 --- a/Trigger/TrigAnalysis/TrigInDetAnalysisUser/share/TIDAdata-chains-run3.dat +++ b/Trigger/TrigAnalysis/TrigInDetAnalysisUser/share/TIDAdata-chains-run3.dat @@ -25,9 +25,10 @@ testChains = { "HLT_tau25_idperf_tracktwo_L1TAU12IM:HLT_IDTrack_Tau_IDTrig", "HLT_tau25_idperf_tracktwo_L1TAU12IM:HLT_IDTrack_Tau_IDTrig:HLT_TAURoI", - "HLT_j45_ftf_subjesgscIS_boffperf_split_L1J20:HLT_IDTrack_Bjet_FTF", - "HLT_j45_ftf_subjesgscIS_boffperf_split_L1J20:HLT_IDTrack_Bjet_IDTrig", - + "HLT_j45_subjesgscIS_ftf_boffperf_split_L1J20:HLT_IDTrack_Bjet_FTF", + "HLT_j45_subjesgscIS_ftf_boffperf_split_L1J20:HLT_IDTrack_Bjet_IDTrig", + + "HLT_j45_subjesgscIS_ftf_boffperf_split_L1J20:HLT_IDTrack_FS_FTF:HLT_FSRoI:HLT_IDVertex_FS", "HLT_j45_ftf_subjesgscIS_boffperf_split_L1J20:HLT_IDTrack_FS_FTF:HLT_FSRoI:HLT_IDVertex_FS", "HLT_j45_ftf_L1J15:HLT_IDTrack_FS_FTF:HLT_FSRoI:HLT_IDVertex_FS", diff --git a/Trigger/TrigConfiguration/TrigConfIO/python/L1TriggerConfigAccess.py b/Trigger/TrigConfiguration/TrigConfIO/python/L1TriggerConfigAccess.py index a65c73ef09f31f80badf4d5565901eacaad2f433..4ce2fb5226ce9dca1b798eff66cdd8a1ee97674b 100644 --- a/Trigger/TrigConfiguration/TrigConfIO/python/L1TriggerConfigAccess.py +++ b/Trigger/TrigConfiguration/TrigConfIO/python/L1TriggerConfigAccess.py @@ -35,7 +35,7 @@ class L1MenuAccess(TriggerConfigAccess): return self._config["items"] def thresholdTypes(self): - thrTypes = self._config["thresholds"].keys() + thrTypes = list(self._config["thresholds"].keys()) if "legacyCalo" in thrTypes: thrTypes.remove("legacyCalo") thrTypes += self._config["thresholds"]["legacyCalo"].keys() diff --git a/Trigger/TrigConfiguration/TrigConfIO/python/TriggerConfigAccessBase.py b/Trigger/TrigConfiguration/TrigConfIO/python/TriggerConfigAccessBase.py index 5bf1fff4605a4c8ccafd75d23f023af0a11a8a37..029113e24ebf13ee00592995e04cf9fa6e7d25b5 100644 --- a/Trigger/TrigConfiguration/TrigConfIO/python/TriggerConfigAccessBase.py +++ b/Trigger/TrigConfiguration/TrigConfIO/python/TriggerConfigAccessBase.py @@ -127,6 +127,8 @@ class ConfigDBLoader(ConfigLoader): connection = connect(userpw["user"], userpw["password"], tns, threaded=False) elif connSvc.startswith("frontier:"): raise NotImplementedError("Python-loading of trigger configuration from Frontier has not yet been implemented") + elif connSvc.startswith("sqlite_file:"): + raise NotImplementedError("Python-loading of trigger configuration from sqlite has not yet been implemented") return connection, schema except Exception as e: raise RuntimeError(e) diff --git a/Trigger/TrigConfiguration/TrigConfIO/scripts/AtlTriggerDBCopy.py b/Trigger/TrigConfiguration/TrigConfIO/scripts/AtlTriggerDBCopy.py index 0e84acaddab78afd53cc72074782f4cd6c21df44..ca0af41bae964f52c388db294f13f0365e270302 100755 --- a/Trigger/TrigConfiguration/TrigConfIO/scripts/AtlTriggerDBCopy.py +++ b/Trigger/TrigConfiguration/TrigConfIO/scripts/AtlTriggerDBCopy.py @@ -10,19 +10,18 @@ import sqlite3 def parseCmdline(): import argparse - parser = argparse.ArgumentParser(prog = "AtlTriggerDBCopy.py") + parser = argparse.ArgumentParser(prog = "AtlTriggerDBCopy.py", description="Example: %(prog)s -d TRIGGERDBMC -c triggerDBMC_Run2.db") parser.add_argument("-d", "--dbalias", dest="dbalias", help="TriggerDB connection alias for the source DB") parser.add_argument("-c", "--create", dest="createfile", help="create sqlite db file") - parser.add_argument("-u", "--update", dest="updatefile", help="update sqlite db file") parser.add_argument("-v", help="increase output verbosity", action="count", default=0) args = parser.parse_args() if not args.dbalias: print("No source Trigger DB specified") parser.print_help() return None - if not args.createfile and not args.updatefile: - print("No sqlite target file specified (use create or update)") - parser.print_help() + if not args.createfile: + print("No sqlite target file specified") + parser.print_help(parser) return None return args @@ -63,8 +62,8 @@ class SQLiteInserter: print("Not connected to an output file, will print the insert commands instead") import os if filename and os.path.exists(filename): - print(f"File or path {filename} exists already, will not overwrite it and only print the insert commands instead") - self.filename = None + print(f"Target file {filename} exists already, will abort in order to prevent overwriting") + raise RuntimeError("Target file already exists") if self.filename is not None: self.connection = sqlite3.connect(self.filename) self.cursor = self.connection.cursor() @@ -109,11 +108,10 @@ class OracleExporter: self.tables = None self.ignoreTablesR2 = [ 'TT_WRITELOCK', 'HLT_SMT_TO_HRE', 'HLT_PARAMETER', 'HLT_RELEASE', 'TRIGGER_LOG', 'DBCOPY_SOURCE_DATABASE', 'HLT_RULE_SET', 'TEMP', 'HLT_RULE_PARAMETER', 'HLT_RULE_COMPONENT', - 'ACTIVE_MASTERS', 'HLT_SETUP', 'TT_USERS', 'HLT_RULE', "HLT_HRC_TO_HRP", "HLT_HRE_TO_HRS", + 'HLT_SETUP', 'TT_USERS', 'HLT_RULE', "HLT_HRC_TO_HRP", "HLT_HRE_TO_HRS", "HLT_HRS_TO_HRU", "HLT_HRU_TO_HRC", "HLT_PRESCALE_SET_ALIAS", "HLT_PRESCALE_SET_COLL", - "PRESCALE_SET_ALIAS", "TRIGGER_ALIAS", "L1_PRESCALE_SET_ALIAS", "L1_PITS", "L1_CALO_SIN_COS", - "L1_CI_TO_CSC", "L1_DEAD_TIME", "L1_JET_INPUT", "L1_MUON_THRESHOLD_SET", "HLT_TRIGGER_TYPE", - "L1_CTP_FILES", "L1_CTP_SMX" ] + "PRESCALE_SET_ALIAS", "TRIGGER_ALIAS", "L1_PRESCALE_SET_ALIAS", "L1_CALO_SIN_COS", + "L1_CI_TO_CSC", "L1_JET_INPUT", "L1_MUON_THRESHOLD_SET", "L1_CTP_FILES", "L1_CTP_SMX" ] def getTables(self, isRun2MC = True): if self.tables: diff --git a/Trigger/TrigConfiguration/TrigConfxAOD/share/xAODMenuWriterTest_jobOptions.py b/Trigger/TrigConfiguration/TrigConfxAOD/share/xAODMenuWriterTest_jobOptions.py index 0be1059d608ffbaec8ba40ba055a0a6448ff2baa..50c1ce8b58a2b90d5185e6bea38d05feec959fc7 100644 --- a/Trigger/TrigConfiguration/TrigConfxAOD/share/xAODMenuWriterTest_jobOptions.py +++ b/Trigger/TrigConfiguration/TrigConfxAOD/share/xAODMenuWriterTest_jobOptions.py @@ -55,10 +55,6 @@ xaodStream.AddItem( "xAOD::TruthVertexAuxContainer_v1#*" ) xaodStream.AddItem( "xAOD::TruthEventContainer_v1#*" ) xaodStream.AddItem( "xAOD::TruthEventAuxContainer_v1#*" ) -# Make sure that the event format object is added to the output: -theApp.CreateSvc += [ "xAODMaker::EventFormatSvc" ] -xaodStream.AddMetaDataItem( "xAOD::EventFormat_v1#EventFormat" ) - # Convert the LVL1 information: from xAODTriggerCnv.xAODRoICreator import xAODRoICreator xAODRoICreator() diff --git a/Trigger/TrigEvent/TrigInDetEvent/TrigInDetEvent/TrigL2Vertex.h b/Trigger/TrigEvent/TrigInDetEvent/TrigInDetEvent/TrigL2Vertex.h index dc2195cceabbca431ca8dfcc57dece29e8123c31..091d8df86e75d0876f373cabf9ade5fa60c49466 100755 --- a/Trigger/TrigEvent/TrigInDetEvent/TrigInDetEvent/TrigL2Vertex.h +++ b/Trigger/TrigEvent/TrigInDetEvent/TrigInDetEvent/TrigL2Vertex.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ #ifndef TRIGINDETEVENT_TRIGL2VERTEX_H @@ -147,6 +147,8 @@ class TrigL2Vertex public: TrigL2Vertex(); ~TrigL2Vertex(); + TrigL2Vertex(const TrigL2Vertex&) = delete; + TrigL2Vertex& operator=(const TrigL2Vertex&) = delete; bool prepareForFit();//!< resets all internal structures + initialization of the covariance void reset();//!< resets all internal structures double chi2();//!< returns accumulated \f$\chi^2\f$ of the fit diff --git a/Trigger/TrigHypothesis/TrigBjetHypo/python/TrigBjetOnlineMonitoringMTConfig.py b/Trigger/TrigHypothesis/TrigBjetHypo/python/TrigBjetOnlineMonitoringMTConfig.py index 82042b783b8de12bc79f53dc0947ce332f948538..2c575e3ad3702e883c92d7abd80108a6e558e1ed 100755 --- a/Trigger/TrigHypothesis/TrigBjetHypo/python/TrigBjetOnlineMonitoringMTConfig.py +++ b/Trigger/TrigHypothesis/TrigBjetHypo/python/TrigBjetOnlineMonitoringMTConfig.py @@ -2,10 +2,11 @@ from AthenaMonitoringKernel.GenericMonitoringTool import GenericMonitoringTool class TrigBjetOnlineMonitoring(GenericMonitoringTool): - def make_btag_hists(self, btag_name, btag_opts): - self.defineHistogram('btag_'+btag_name+'_pb', title=btag_name+" PB", **btag_opts) - self.defineHistogram('btag_'+btag_name+'_pc', title=btag_name+" PC", **btag_opts) - self.defineHistogram('btag_'+btag_name+'_pu', title=btag_name+" PU", **btag_opts) + def make_flavor_hists(self, tagger): + for probability in ['pb','pc','pu']: + self.defineHistogram('btag_'+tagger+'_'+probability, title=tagger+' '+probability.capitalize(), type='TH1F', path='EXPERT', xbins=100, xmin=0, xmax=1) + self.defineHistogram('btag_'+tagger+'_llr', title=tagger+' LLR', type='TH1F', path='EXPERT', xbins=100, xmin=-10, xmax=50) + def __init__ (self, name="TrigBjetOnlineMonitoring"): super(TrigBjetOnlineMonitoring, self).__init__(name) @@ -19,6 +20,11 @@ class TrigBjetOnlineMonitoring(GenericMonitoringTool): self.defineHistogram('jet_count', title="Number of Jets", xbins = 20, xmin=0, xmax=20, **TH1F_opts) self.defineHistogram('vertex_count', title="Number of Vertices", xbins = 200, xmin=0, xmax=200, **TH1F_opts) + # Primary Vertex Histogram + self.defineHistogram('primVtx_x', title="Primary Vertex X", xbins = default_bin_count, xmin=-2, xmax=2, **TH1F_opts) + self.defineHistogram('primVtx_y', title="Primary Vertex Y", xbins = default_bin_count, xmin=-2, xmax=2, **TH1F_opts) + self.defineHistogram('primVtx_z', title="Primary Vertex Z", xbins = default_bin_count, xmin=-300, xmax=300, **TH1F_opts) + ## Track Histograms self.defineHistogram('track_Et', title="Track Transverse Energy;E_{T} (GeV)", xbins = default_bin_count, xmin=0, xmax=200, **TH1F_opts) self.defineHistogram('track_eta', title="Track #eta;#eta", xbins = default_bin_count, xmin=-5, xmax=5, **TH1F_opts) @@ -28,12 +34,12 @@ class TrigBjetOnlineMonitoring(GenericMonitoringTool): self.defineHistogram('track_d0', title="Track d_{0};d_{0} (mm)", xbins = default_bin_count, xmin=-5, xmax=5, **TH1F_opts) self.defineHistogram('track_d0err', title="Track d_{0} Error;d_{0} Error (mm)", xbins = default_bin_count, xmin=0, xmax=10, **TH1F_opts) self.defineHistogram('track_d0sig', title="Track d_{0} Significance;d_{0} #sigma", xbins = default_bin_count, xmin=-100, xmax=100, **TH1F_opts) - self.defineHistogram('track_z0', title="Track z_{0};z_{0} (mm)", xbins = default_bin_count, xmin=-100, xmax=100, **TH1F_opts) + self.defineHistogram('track_z0', title="Track z_{0};z_{0} (mm)", xbins = default_bin_count, xmin=-200, xmax=200, **TH1F_opts) self.defineHistogram('track_z0err', title="Track z_{0} Error;z_{0} Error (mm)", xbins = default_bin_count, xmin=0, xmax=10, **TH1F_opts) self.defineHistogram('track_z0sig', title="Track z_{0} Significance;z_{0} #sigma", xbins = default_bin_count, xmin=-1000, xmax=1000, **TH1F_opts) # Jet Histograms - self.defineHistogram('jet_pt', title="Jet Transverse Momentum;p_{T} (GeV)", xbins = default_bin_count, xmin=0, xmax=200, **TH1F_opts) + self.defineHistogram('jet_pt', title="Jet Transverse Momentum;p_{T} (GeV)", xbins = default_bin_count, xmin=0, xmax=1000, **TH1F_opts) self.defineHistogram('jet_eta', title="Jet #eta;#eta", xbins = default_bin_count, xmin=-5, xmax=5, **TH1F_opts) self.defineHistogram('jet_phi', title="Jet #phi;#phi", xbins = default_bin_count, xmin=-3.5, xmax=3.5, **TH1F_opts) self.defineHistogram('jet_eta,jet_phi', path='EXPERT', type='TH2F', title="Jet #eta vs #phi;#eta;#phi", @@ -41,16 +47,64 @@ class TrigBjetOnlineMonitoring(GenericMonitoringTool): # B-Tagging Histograms - btag_options=TH1F_opts.copy() - btag_options.update({'xbins':default_bin_count, 'xmin':0, 'xmax':1}) - self.make_btag_hists('IP2D', btag_options) - self.make_btag_hists('IP3D', btag_options) - self.make_btag_hists('SV1', btag_options) - self.make_btag_hists('DL1r', btag_options) - self.make_btag_hists('RNNIP', btag_options) + for tagger in ['IP2D', 'IP3D', 'DL1r', 'rnnip']: self.make_flavor_hists(tagger) + self.defineHistogram('btag_MV2c10', title="MV2c10", xbins = default_bin_count, xmin=-1, xmax=1, **TH1F_opts) - self.defineHistogram('btag_valD0wrtPVofTracks', title="Track d_{0} w/ Respect to PV of Tracks;d_{0} (mm)", xbins = default_bin_count, xmin=-2, xmax=2, **TH1F_opts) - self.defineHistogram('btag_sigD0wrtPVofTracks', title="Track d_{0} Significance w/ Respect to PV of Tracks;d_{0} #sigma", xbins = default_bin_count, xmin=-100, xmax=100, **TH1F_opts) - self.defineHistogram('btag_valZ0wrtPVofTracks', title="Track z_{0} w/ Respect to PV of Tracks;z_{0} (mm)", xbins = default_bin_count, xmin=-2, xmax=2, **TH1F_opts) - self.defineHistogram('btag_sigZ0wrtPVofTracks', title="Track z_{0} Significance w/ Respect to PV of Tracks;z_{0} #sigma", xbins = default_bin_count, xmin=-100, xmax=100, **TH1F_opts) + + aux_variables_list = [ # title, xmin, xmax, xbins, plottype + ('JetFitter_N2Tpair', 0, 100, 100, 'TH1I'), + ('JetFitter_nVTX', 0, 50, 50, 'TH1I'), + ('JetFitter_nSingleTracks', 0, 50, 50, 'TH1I'), + ('JetFitter_nTracksAtVtx', 0, 50, 50, 'TH1I'), + ('JetFitter_mass', 0, 20000, 1000, 'TH1F'), + ('JetFitter_energyFraction', 0, 1.1, 100, 'TH1F'), + ('JetFitter_significance3d', 0, 100, 100, 'TH1F'), + ('JetFitter_deltaeta', 0, 2, 100, 'TH1F'), + ('JetFitter_deltaphi', 0, 2, 100, 'TH1F'), + ('JetFitter_isDefaults', 0, 2, 2, 'TH1I'), + ('JetFitter_deltaR', 0, 2, 100, 'TH1F'), + + ('SV1_NGTinSvx', 0, 100, 100, 'TH1I'), + ('SV1_masssvx', 0, 10000, 1000, 'TH1F'), + ('SV1_isDefaults', 0, 2, 2, 'TH1I'), + ('SV1_N2Tpair', 0, 50, 50, 'TH1I'), + ('SV1_efracsvx', 0, 1.1, 100, 'TH1F'), + ('SV1_deltaR', 0, 2, 100, 'TH1F'), + ('SV1_Lxy', 0, 100, 100, 'TH1F'), + ('SV1_L3d', 0, 100, 100, 'TH1F'), + ('SV1_significance3d', 0, 50, 100, 'TH1F'), + + ('IP2D_isDefaults', 0, 2, 2, 'TH1I'), + ('IP2D_bu', 0, 50, 100, 'TH1F'), + ('IP2D_bc', 0, 50, 100, 'TH1F'), + ('IP2D_cu', 0, 50, 100, 'TH1F'), + ('IP3D_isDefaults', 0, 2, 2, 'TH1I'), + ('IP3D_bu', 0, 50, 100, 'TH1F'), + ('IP3D_bc', 0, 50, 100, 'TH1F'), + ('IP3D_cu', 0, 50, 100, 'TH1F'), + + ('JetFitterSecondaryVertex_nTracks', 0, 50, 50, 'TH1I'), + ('JetFitterSecondaryVertex_isDefaults', 0, 2, 2, 'TH1I'), + ('JetFitterSecondaryVertex_mass', 0, 1e4, 100, 'TH1F'), + ('JetFitterSecondaryVertex_energy', 0, 1e6, 100, 'TH1F'), + ('JetFitterSecondaryVertex_energyFraction', 0, 1.1, 100, 'TH1F'), + ('JetFitterSecondaryVertex_displacement3d', 0, 500, 100, 'TH1F'), + ('JetFitterSecondaryVertex_displacement2d', 0, 500, 100, 'TH1F'), + ('JetFitterSecondaryVertex_maximumTrackRelativeEta', 0, 8, 100, 'TH1F'), + ('JetFitterSecondaryVertex_minimumTrackRelativeEta', 0, 8, 100, 'TH1F'), + ('JetFitterSecondaryVertex_averageTrackRelativeEta', 0, 8, 100, 'TH1F'), + + ('maximumTrackRelativeEta', 0, 8, 100, 'TH1F'), + ('minimumTrackRelativeEta', 0, 8, 100, 'TH1F'), + ('averageTrackRelativeEta', 0, 8, 100, 'TH1F') + ] + + for title, xmin, xmax, xbins, plottype in aux_variables_list: + self.defineHistogram(title, title=title, xmin=xmin, xmax=xmax, xbins=xbins, type=plottype, path='EXPERT') + + self.defineHistogram('IP3D_valD0wrtPVofTracks', title="Track d_{0} w/ Respect to PV of Tracks of IP3D;d_{0} (mm)", xmin=-2, xmax=2, xbins = default_bin_count, **TH1F_opts) + self.defineHistogram('IP3D_sigD0wrtPVofTracks', title="Track d_{0} Significance w/ Respect to PV of Tracks of IP3D;d_{0} #sigma", xmin=-100, xmax=100, xbins = default_bin_count, **TH1F_opts) + self.defineHistogram('IP3D_valZ0wrtPVofTracks', title="Track z_{0} w/ Respect to PV of Tracks of IP3D;z_{0} (mm)", xmin=-2, xmax=2, xbins = default_bin_count, **TH1F_opts) + self.defineHistogram('IP3D_sigZ0wrtPVofTracks', title="Track z_{0} Significance w/ Respect to PV of Tracks of IP3D;z_{0} #sigma", xmin=-100, xmax=100, xbins = default_bin_count, **TH1F_opts) + diff --git a/Trigger/TrigHypothesis/TrigBjetHypo/src/TrigBjetBtagHypoAlgMT.cxx b/Trigger/TrigHypothesis/TrigBjetHypo/src/TrigBjetBtagHypoAlgMT.cxx index 0292bb962e2d5526df1d65dee659a0c85a2637d4..ad1cd899055d16160254e4c7ea87265e41424deb 100644 --- a/Trigger/TrigHypothesis/TrigBjetHypo/src/TrigBjetBtagHypoAlgMT.cxx +++ b/Trigger/TrigHypothesis/TrigBjetHypo/src/TrigBjetBtagHypoAlgMT.cxx @@ -134,9 +134,10 @@ StatusCode TrigBjetBtagHypoAlgMT::execute( const EventContext& context ) const { // online monitoring for btagging, with a check to ensure the PV is marked ElementLink< xAOD::VertexContainer > vertexEL; - CHECK( retrieveObjectFromNavigation( m_prmVtxLink.value(), vertexEL, prevDecisionContainer->at(index) ) ); + CHECK( retrieveObjectFromNavigation( m_prmVtxLink.value(), vertexEL, prevDecisionContainer->at(index) ) ); if ( (*vertexEL)->vertexType() == xAOD::VxType::VertexType::PriVtx ) { + CHECK( monitor_primary_vertex( vertexEL ) ); CHECK( monitor_btagging( bTaggingEL ) ); } @@ -264,7 +265,7 @@ StatusCode TrigBjetBtagHypoAlgMT::monitor_tracks( const ElementLinkVector< xAOD: } -StatusCode TrigBjetBtagHypoAlgMT::monitor_flavor_tag_variable( const ElementLinkVector< xAOD::BTaggingContainer >& bTaggingEL, const std::string& var_name ) const { +StatusCode TrigBjetBtagHypoAlgMT::monitor_flavor_probabilities( const ElementLinkVector< xAOD::BTaggingContainer >& bTaggingEL, const std::string& var_name ) const { auto monitor_pu = Monitored::Collection( "btag_"+var_name+"_pu", bTaggingEL, [var_name](const ElementLink< xAOD::BTaggingContainer >& bTagLink) { double pu = -1; @@ -286,19 +287,83 @@ StatusCode TrigBjetBtagHypoAlgMT::monitor_flavor_tag_variable( const ElementLink return pc; } ); - auto monitor_group_for_flavor_tag_var = Monitored::Group( m_monTool, monitor_pu, monitor_pb, monitor_pc ); + auto monitor_llr = Monitored::Collection( "btag_"+var_name+"_llr", bTaggingEL, + [var_name](const ElementLink< xAOD::BTaggingContainer >& bTagLink) { + double llr = -1; + (*bTagLink)->loglikelihoodratio( var_name, llr ); + return llr; + } ); + + auto monitor_group_for_flavor_tag_var = Monitored::Group( m_monTool, monitor_pu, monitor_pb, monitor_pc, monitor_llr ); return StatusCode::SUCCESS; } - + + +StatusCode TrigBjetBtagHypoAlgMT::monitor_primary_vertex( const ElementLink< xAOD::VertexContainer >& primVertexEL ) const { + auto monitor_for_primVtx_x = Monitored::Scalar( "primVtx_x", (*primVertexEL)->x() ); + auto monitor_for_primVtx_y = Monitored::Scalar( "primVtx_y", (*primVertexEL)->y() ); + auto monitor_for_primVtx_z = Monitored::Scalar( "primVtx_z", (*primVertexEL)->z() ); + + auto monitor_group_for_primary_vertex = Monitored::Group( m_monTool, monitor_for_primVtx_x, monitor_for_primVtx_y, monitor_for_primVtx_z ); + return StatusCode::SUCCESS; +} + StatusCode TrigBjetBtagHypoAlgMT::monitor_btagging( const ElementLinkVector< xAOD::BTaggingContainer >& bTaggingEL ) const { - // Monitor IP2D, IP3D, SV1, DL1r, RNNIP - CHECK( monitor_flavor_tag_variable(bTaggingEL, "IP2D") ); - CHECK( monitor_flavor_tag_variable(bTaggingEL, "IP3D") ); - CHECK( monitor_flavor_tag_variable(bTaggingEL, "SV1") ); - CHECK( monitor_flavor_tag_variable(bTaggingEL, "DL1r") ); - CHECK( monitor_flavor_tag_variable(bTaggingEL, "RNNIP") ); + // Monitor flavor probabilites + CHECK( monitor_flavor_probabilities(bTaggingEL, "IP2D") ); + CHECK( monitor_flavor_probabilities(bTaggingEL, "IP3D") ); + CHECK( monitor_flavor_probabilities(bTaggingEL, "DL1r") ); + CHECK( monitor_flavor_probabilities(bTaggingEL, "rnnip") ); + + MONITOR_BTAG_AUX_VAR(JetFitter_N2Tpair, int, bTaggingEL); + MONITOR_BTAG_AUX_VAR(JetFitter_nVTX, int, bTaggingEL); + MONITOR_BTAG_AUX_VAR(JetFitter_nSingleTracks, int, bTaggingEL); + MONITOR_BTAG_AUX_VAR(JetFitter_nTracksAtVtx, int, bTaggingEL); + MONITOR_BTAG_AUX_VAR(JetFitter_mass, float, bTaggingEL); + MONITOR_BTAG_AUX_VAR(JetFitter_energyFraction, float, bTaggingEL); + MONITOR_BTAG_AUX_VAR(JetFitter_significance3d, float, bTaggingEL); + MONITOR_BTAG_AUX_VAR(JetFitter_deltaeta, float, bTaggingEL); + MONITOR_BTAG_AUX_VAR(JetFitter_deltaphi, float, bTaggingEL); + MONITOR_BTAG_AUX_VAR(JetFitter_isDefaults, char, bTaggingEL); + MONITOR_BTAG_AUX_VAR(JetFitter_deltaR, float, bTaggingEL); + + MONITOR_BTAG_AUX_VAR(SV1_NGTinSvx, int, bTaggingEL); + MONITOR_BTAG_AUX_VAR(SV1_masssvx, float, bTaggingEL); + MONITOR_BTAG_AUX_VAR(SV1_isDefaults, char, bTaggingEL); + MONITOR_BTAG_AUX_VAR(SV1_N2Tpair, int, bTaggingEL); + MONITOR_BTAG_AUX_VAR(SV1_efracsvx, float, bTaggingEL); + MONITOR_BTAG_AUX_VAR(SV1_deltaR, float, bTaggingEL); + MONITOR_BTAG_AUX_VAR(SV1_Lxy, float, bTaggingEL); + MONITOR_BTAG_AUX_VAR(SV1_L3d, float, bTaggingEL); + MONITOR_BTAG_AUX_VAR(SV1_significance3d, float, bTaggingEL); + + MONITOR_BTAG_AUX_VAR(IP2D_isDefaults, char, bTaggingEL); + MONITOR_BTAG_AUX_VAR(IP2D_bu, double, bTaggingEL); + MONITOR_BTAG_AUX_VAR(IP2D_bc, double, bTaggingEL); + MONITOR_BTAG_AUX_VAR(IP2D_cu, double, bTaggingEL); + MONITOR_BTAG_AUX_VAR(IP3D_isDefaults, char, bTaggingEL); + MONITOR_BTAG_AUX_VAR(IP3D_bu, double, bTaggingEL); + MONITOR_BTAG_AUX_VAR(IP3D_bc, double, bTaggingEL); + MONITOR_BTAG_AUX_VAR(IP3D_cu, double, bTaggingEL); + + MONITOR_BTAG_AUX_VAR(JetFitterSecondaryVertex_nTracks, int, bTaggingEL); + MONITOR_BTAG_AUX_VAR(JetFitterSecondaryVertex_isDefaults, char, bTaggingEL); + MONITOR_BTAG_AUX_VAR(JetFitterSecondaryVertex_mass, float, bTaggingEL); + MONITOR_BTAG_AUX_VAR(JetFitterSecondaryVertex_energy, float, bTaggingEL); + MONITOR_BTAG_AUX_VAR(JetFitterSecondaryVertex_energyFraction, float, bTaggingEL); + MONITOR_BTAG_AUX_VAR(JetFitterSecondaryVertex_displacement3d, float, bTaggingEL); + MONITOR_BTAG_AUX_VAR(JetFitterSecondaryVertex_displacement2d, float, bTaggingEL); + MONITOR_BTAG_AUX_VAR(JetFitterSecondaryVertex_maximumTrackRelativeEta, float, bTaggingEL); + MONITOR_BTAG_AUX_VAR(JetFitterSecondaryVertex_minimumTrackRelativeEta, float, bTaggingEL); + MONITOR_BTAG_AUX_VAR(JetFitterSecondaryVertex_averageTrackRelativeEta, float, bTaggingEL); + + MONITOR_BTAG_AUX_VAR(maximumTrackRelativeEta, float, bTaggingEL); + MONITOR_BTAG_AUX_VAR(minimumTrackRelativeEta, float, bTaggingEL); + MONITOR_BTAG_AUX_VAR(averageTrackRelativeEta, float, bTaggingEL); + + // Monitor MV2c10 auto monitor_for_MV2c10 = Monitored::Collection( "btag_MV2c10", bTaggingEL, @@ -307,28 +372,66 @@ StatusCode TrigBjetBtagHypoAlgMT::monitor_btagging( const ElementLinkVector< xAO (*bTagLink)->MVx_discriminant( "MV2c10", mv2c10_discriminant ); return mv2c10_discriminant; } ); - auto monitor_group_for_btagging = Monitored::Group( m_monTool, monitor_for_MV2c10); + + auto monitor_group_for_btagging = Monitored::Group( m_monTool, + monitor_for_JetFitter_N2Tpair, + monitor_for_JetFitter_nVTX, + monitor_for_JetFitter_nSingleTracks, + monitor_for_JetFitter_nTracksAtVtx, + monitor_for_JetFitter_mass, + monitor_for_JetFitter_energyFraction, + monitor_for_JetFitter_significance3d, + monitor_for_JetFitter_deltaeta, + monitor_for_JetFitter_deltaphi, + monitor_for_JetFitter_isDefaults, + monitor_for_JetFitter_deltaR, + monitor_for_SV1_NGTinSvx, + monitor_for_SV1_masssvx, + monitor_for_SV1_isDefaults, + monitor_for_SV1_N2Tpair, + monitor_for_SV1_efracsvx, + monitor_for_SV1_deltaR, + monitor_for_SV1_Lxy, + monitor_for_SV1_L3d, + monitor_for_SV1_significance3d, + monitor_for_IP2D_bu, + monitor_for_IP2D_isDefaults, + monitor_for_IP2D_bc, + monitor_for_IP2D_cu, + monitor_for_IP3D_bu, + monitor_for_IP3D_isDefaults, + monitor_for_IP3D_bc, + monitor_for_IP3D_cu, + monitor_for_JetFitterSecondaryVertex_nTracks, + monitor_for_JetFitterSecondaryVertex_isDefaults, + monitor_for_JetFitterSecondaryVertex_mass, + monitor_for_JetFitterSecondaryVertex_energy, + monitor_for_JetFitterSecondaryVertex_energyFraction, + monitor_for_JetFitterSecondaryVertex_displacement3d, + monitor_for_JetFitterSecondaryVertex_displacement2d, + monitor_for_JetFitterSecondaryVertex_maximumTrackRelativeEta, + monitor_for_JetFitterSecondaryVertex_minimumTrackRelativeEta, + monitor_for_JetFitterSecondaryVertex_averageTrackRelativeEta, + monitor_for_maximumTrackRelativeEta, + monitor_for_minimumTrackRelativeEta, + monitor_for_averageTrackRelativeEta, + monitor_for_MV2c10 + ); - // Monitor tracks used in calculating btagging quantities for ( const ElementLink< xAOD::BTaggingContainer >& bTagLink : bTaggingEL ) { - auto monitor_for_btag_valD0wrtPVofTracks = Monitored::Collection( "btag_valD0wrtPVofTracks", - (*bTagLink)->auxdata< std::vector<float> >("IP3D_valD0wrtPVofTracks")); - auto monitor_for_btag_sigD0wrtPVofTracks = Monitored::Collection( "btag_sigD0wrtPVofTracks", - (*bTagLink)->auxdata< std::vector<float> >("IP3D_sigD0wrtPVofTracks")); - auto monitor_for_btag_valZ0wrtPVofTracks = Monitored::Collection( "btag_valZ0wrtPVofTracks", - (*bTagLink)->auxdata< std::vector<float> >("IP3D_valZ0wrtPVofTracks")); - auto monitor_for_btag_sigZ0wrtPVofTracks = Monitored::Collection( "btag_sigZ0wrtPVofTracks", - (*bTagLink)->auxdata< std::vector<float> >("IP3D_sigZ0wrtPVofTracks")); + MONITOR_BTAG_AUX_TRACK_VAR(IP3D_valD0wrtPVofTracks, float); + MONITOR_BTAG_AUX_TRACK_VAR(IP3D_sigD0wrtPVofTracks, float); + MONITOR_BTAG_AUX_TRACK_VAR(IP3D_valZ0wrtPVofTracks, float); + MONITOR_BTAG_AUX_TRACK_VAR(IP3D_sigZ0wrtPVofTracks, float); auto monitor_group_for_btag_track_vars = Monitored::Group( m_monTool, - monitor_for_btag_valD0wrtPVofTracks, monitor_for_btag_sigD0wrtPVofTracks, - monitor_for_btag_valZ0wrtPVofTracks, monitor_for_btag_sigZ0wrtPVofTracks + monitor_for_IP3D_valD0wrtPVofTracks, monitor_for_IP3D_sigD0wrtPVofTracks, + monitor_for_IP3D_valZ0wrtPVofTracks, monitor_for_IP3D_sigZ0wrtPVofTracks ); } - return StatusCode::SUCCESS; } diff --git a/Trigger/TrigHypothesis/TrigBjetHypo/src/TrigBjetBtagHypoAlgMT.h b/Trigger/TrigHypothesis/TrigBjetHypo/src/TrigBjetBtagHypoAlgMT.h index 8a064606bfc989a31d38c1015d2b6cc5491d6dea..9b04198988673009c09e50d41d5e3c3f9ace8599 100644 --- a/Trigger/TrigHypothesis/TrigBjetHypo/src/TrigBjetBtagHypoAlgMT.h +++ b/Trigger/TrigHypothesis/TrigBjetHypo/src/TrigBjetBtagHypoAlgMT.h @@ -24,6 +24,18 @@ #include "AthenaMonitoringKernel/Monitored.h" #include "AthenaMonitoringKernel/GenericMonitoringTool.h" +#define MONITOR_BTAG_AUX_TRACK_VAR(VAR_NAME, VAR_TYPE ) \ + auto monitor_for_##VAR_NAME = Monitored::Collection( #VAR_NAME, \ + (*bTagLink)->auxdata< std::vector<VAR_TYPE> >( #VAR_NAME )); + +#define MONITOR_BTAG_AUX_VAR(VAR_NAME, VAR_TYPE, CONTAINER ) \ + auto monitor_for_##VAR_NAME = Monitored::Collection( #VAR_NAME, CONTAINER, \ + [](const ElementLink< xAOD::BTaggingContainer >& bTagLink) { \ + return (*bTagLink)->auxdata<VAR_TYPE>( #VAR_NAME ); \ + } \ + ); + + class TrigBjetBtagHypoAlgMT : public TrigBjetHypoAlgBaseMT { public: TrigBjetBtagHypoAlgMT( const std::string& name, ISvcLocator* pSvcLocator ); @@ -37,7 +49,8 @@ class TrigBjetBtagHypoAlgMT : public TrigBjetHypoAlgBaseMT { // online monitoring virtual StatusCode monitor_jets( const ElementLinkVector<xAOD::JetContainer >& jetELs ) const ; virtual StatusCode monitor_tracks( const ElementLinkVector< xAOD::TrackParticleContainer >& trackELs ) const; - virtual StatusCode monitor_flavor_tag_variable( const ElementLinkVector< xAOD::BTaggingContainer >& bTaggingEL, const std::string& var_name) const; + virtual StatusCode monitor_primary_vertex( const ElementLink< xAOD::VertexContainer >& primVertexEL ) const; + virtual StatusCode monitor_flavor_probabilities( const ElementLinkVector< xAOD::BTaggingContainer >& bTaggingEL, const std::string& var_name) const; virtual StatusCode monitor_btagging( const ElementLinkVector< xAOD::BTaggingContainer >& bTaggingEL ) const; private: diff --git a/Trigger/TrigHypothesis/TrigEgammaHypo/python/TrigEgammaPrecisionElectronHypoTool.py b/Trigger/TrigHypothesis/TrigEgammaHypo/python/TrigEgammaPrecisionElectronHypoTool.py index e8a6238c17f386e78642bd42d90b09af05f82e71..2d606e035e4607d23c3b9f207d39ca5273f3af5a 100644 --- a/Trigger/TrigHypothesis/TrigEgammaHypo/python/TrigEgammaPrecisionElectronHypoTool.py +++ b/Trigger/TrigHypothesis/TrigEgammaHypo/python/TrigEgammaPrecisionElectronHypoTool.py @@ -8,7 +8,14 @@ log = logging.getLogger("TrigEgammaHypo.TrigEgammaPrecisionElectronHypoTool") from AthenaCommon.SystemOfUnits import GeV from TriggerMenuMT.HLTMenuConfig.Egamma.EgammaDefs import TrigElectronSelectors -def _IncTool(name, threshold, sel): +# isolation cuts +IsolationCut = { + None: None, + 'ivarloose': 0.1, + 'ivarmedium': 0.065, + 'ivartight': 0.05 + } +def _IncTool(name, threshold, sel, iso): log.debug('TrigEgammaPrecisionElectronHypoTool _IncTool("'+name+'", threshold = '+str(threshold) + ', sel = '+str(sel)) @@ -59,6 +66,13 @@ def _IncTool(name, threshold, sel): # No other cuts applied tool.dETACLUSTERthr = 9999. tool.dPHICLUSTERthr = 9999. + + + if iso and iso != '': + if iso not in IsolationCut: + log.error('Isolation cut %s not defined!', iso) + log.debug('Configuring Isolation cut %s with value %d',iso,IsolationCut[iso]) + tool.RelPtConeCut = IsolationCut[iso] return tool @@ -75,10 +89,14 @@ def TrigEgammaPrecisionElectronHypoToolFromDict( d ): def __sel(cpart): return cpart['addInfo'][0] if cpart['addInfo'] else cpart['IDinfo'] + + def __iso(cpart): + return cpart['isoInfo'] + name = d['chainName'] - return _IncTool( name, __th( cparts[0]), __sel( cparts[0] ) ) + return _IncTool( name, __th( cparts[0]), __sel( cparts[0] ), __iso ( cparts[0]) ) diff --git a/Trigger/TrigHypothesis/TrigEgammaHypo/python/TrigEgammaPrecisionPhotonHypoTool.py b/Trigger/TrigHypothesis/TrigEgammaHypo/python/TrigEgammaPrecisionPhotonHypoTool.py index 62c0a226c6b7f3aa22f88bdc7afcdffd4302c237..eebbd4a6f6ae98322a2bc5fb5cb08a406e0135bd 100644 --- a/Trigger/TrigHypothesis/TrigEgammaHypo/python/TrigEgammaPrecisionPhotonHypoTool.py +++ b/Trigger/TrigHypothesis/TrigEgammaHypo/python/TrigEgammaPrecisionPhotonHypoTool.py @@ -1,12 +1,20 @@ -# Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration +# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration from AthenaCommon.Logging import logging logging.getLogger().info("Importing %s",__name__) log = logging.getLogger("TrigEgammaHypo.TrigEgammaPrecisionPhotonHypoTool") from TriggerMenuMT.HLTMenuConfig.Egamma.EgammaDefs import TrigPhotonSelectors -def _IncTool(name, threshold, sel): - log.debug('TrigEgammaPrecisionPhotonHypoTool _IncTool("'+name+'", threshold = '+str(threshold) + ', sel = '+str(sel)) +CaloIsolationCut = { + None: None, + 'icaloloose': 0.1, + 'icalomedium': 0.075, + 'icalotight': 0. + } + +def _IncTool(name, threshold, sel, iso): + + log.debug('TrigEgammaPrecisionPhotonHypoTool _IncTool("'+name+'", threshold = '+str(threshold) + ', sel = '+str(sel)+', iso = '+str(iso)) from TrigEgammaHypo.TrigEgammaHypoConf import TrigEgammaPrecisionPhotonHypoToolInc @@ -39,6 +47,13 @@ def _IncTool(name, threshold, sel): # configure the selector tool corresponding the selection set by sel tool.PhotonIsEMSelector = TrigPhotonSelectors(sel) + if iso and iso != '': + if iso not in CaloIsolationCut: + log.error('Isolation cut %s not defined!', iso) + log.debug('Configuring Isolation cut %s with value %d',iso,CaloIsolationCut[iso]) + tool.RelEtConeCut = CaloIsolationCut[iso] + + return tool @@ -52,9 +67,13 @@ def TrigEgammaPrecisionPhotonHypoToolFromDict( d ): def __sel(cpart): return cpart['addInfo'][0] if cpart['addInfo'] else cpart['IDinfo'] + + def __iso(cpart): + return cpart['isoInfo'] + name = d['chainName'] - return _IncTool( name, __th( cparts[0]), __sel( cparts[0] ) ) + return _IncTool( name, __th( cparts[0]), __sel( cparts[0] ), __iso( cparts[0]) ) diff --git a/Trigger/TrigHypothesis/TrigEgammaHypo/src/TrigEgammaPrecisionElectronHypoToolInc.cxx b/Trigger/TrigHypothesis/TrigEgammaHypo/src/TrigEgammaPrecisionElectronHypoToolInc.cxx index 284c40895c2ce013ed11883e6cccff06a57bad13..2aa52f195167ddd5bbe0615639b5cafcfc7f8fd2 100644 --- a/Trigger/TrigHypothesis/TrigEgammaHypo/src/TrigEgammaPrecisionElectronHypoToolInc.cxx +++ b/Trigger/TrigHypothesis/TrigEgammaHypo/src/TrigEgammaPrecisionElectronHypoToolInc.cxx @@ -20,6 +20,7 @@ TrigEgammaPrecisionElectronHypoToolInc::TrigEgammaPrecisionElectronHypoToolInc( m_decisionId( HLT::Identifier::fromToolName( name ) ) { declareProperty("ElectronLHSelector" ,m_egammaElectronLHTool ); + declareProperty("RelPtConeCut" ,m_RelPtConeCut=-999.); } StatusCode TrigEgammaPrecisionElectronHypoToolInc::initialize() { @@ -62,24 +63,21 @@ bool TrigEgammaPrecisionElectronHypoToolInc::decide( const ITrigEgammaPrecisionE bool pass = false; - // Likelihood output - std::vector<float> lhval_monitored; - // Lumi monitoring - std::vector<double> avgmu_monitored; - auto ET = Monitored::Scalar( "Et_em" , -1.0 ); - auto dEta = Monitored::Scalar( "dEta", -1. ); + auto dEta = Monitored::Scalar( "dEta", -1. ); auto dPhi = Monitored::Scalar( "dPhi", -1. ); auto etaBin = Monitored::Scalar( "EtaBin", -1. ); - auto monEta = Monitored::Scalar( "Eta", -99. ); + auto monEta = Monitored::Scalar( "Eta", -99. ); auto monPhi = Monitored::Scalar( "Phi", -99. ); auto PassedCuts = Monitored::Scalar<int>( "CutCounter", -1 ); - auto mon_lhval = Monitored::Collection("LikelihoodRatio", lhval_monitored); - auto mon_mu = Monitored::Collection("mu", avgmu_monitored); + auto mon_lhval = Monitored::Scalar("LikelihoodRatio", -99.); + auto mon_mu = Monitored::Scalar("mu", -1.); + auto mon_ptcone20 = Monitored::Scalar("ptcone20", -99.); + auto mon_relptcone20 = Monitored::Scalar("ptcone20", -99.); auto monitorIt = Monitored::Group( m_monTool, dEta, dPhi, etaBin, monEta, - monPhi,PassedCuts,mon_lhval,mon_mu); + monPhi,PassedCuts,mon_lhval,mon_mu, mon_ptcone20, mon_relptcone20); // when leaving scope it will ship data to monTool PassedCuts = PassedCuts + 1; //got called (data in place) @@ -168,14 +166,14 @@ bool TrigEgammaPrecisionElectronHypoToolInc::decide( const ITrigEgammaPrecisionE if(eventInfoDecor.isPresent()) { avg_mu = eventInfoDecor(0); ATH_MSG_DEBUG("Average mu " << avg_mu); - avgmu_monitored.push_back(avg_mu); + mon_mu = avg_mu; asg::AcceptData accept = m_egammaElectronLHTool->accept(ctx,input.electron,avg_mu); pass = (bool) accept; // Monitor the LH value lhval=m_egammaElectronLHTool->calculate(ctx, input.electron,avg_mu); ATH_MSG_DEBUG("LHValue with avgmu " << lhval); - lhval_monitored.push_back(lhval); + mon_lhval = lhval; } else{ ATH_MSG_WARNING("EventInfo decoration not available!"); @@ -184,15 +182,12 @@ bool TrigEgammaPrecisionElectronHypoToolInc::decide( const ITrigEgammaPrecisionE // Monitor the LH value lhval=m_egammaElectronLHTool->calculate(ctx, input.electron); ATH_MSG_DEBUG("LHValue without avgmu " << lhval); - lhval_monitored.push_back(lhval); + mon_lhval = lhval; } - ATH_MSG_DEBUG("AthenaLHSelectorTool: TAccept = " << pass); - - float Rhad1(0), Rhad(0), Reta(0), Rphi(0), e277(0), weta2c(0), //emax2(0), Eratio(0), DeltaE(0), f1(0), weta1c(0), wtot(0), fracm(0); - float ptcone20(999), ptcone30(999), ptcone40(999), etcone20(999), etcone30(999), etcone40(999), topoetcone20(999), topoetcone30(999), topoetcone40(999); + float ptcone20(999), ptcone30(999), ptcone40(999), etcone20(999), etcone30(999), etcone40(999), topoetcone20(999), topoetcone30(999), topoetcone40(999), relptcone20(999); // variables based on HCAL @@ -270,14 +265,33 @@ bool TrigEgammaPrecisionElectronHypoToolInc::decide( const ITrigEgammaPrecisionE ATH_MSG_DEBUG( " topoetcone20 " << topoetcone20 ) ; ATH_MSG_DEBUG( " topoetcone30 " << topoetcone30 ) ; ATH_MSG_DEBUG( " topoetcone40 " << topoetcone40 ) ; - - + // Monitor showershapes + mon_ptcone20 = ptcone20; + relptcone20 = ptcone20/input.electron->pt(); + ATH_MSG_DEBUG("relptcone20 = " <<relptcone20 ); + mon_relptcone20 = relptcone20; + ATH_MSG_DEBUG("m_RelPtConeCut = " << m_RelPtConeCut ); + + // Evaluating lh *after* retrieving variables for monitoing and debuging purposes + ATH_MSG_DEBUG("AthenaLHSelectorTool: TAccept = " << pass); if ( !pass ){ ATH_MSG_DEBUG("REJECT Likelihood failed"); + return pass; } else { ATH_MSG_DEBUG("ACCEPT Likelihood passed"); } + // Check if need to apply isolation + // First check logic. if cut is very negative, then no isolation cut is defined + // if m_RelPtConeCut <-100 then hypo is configured not to apply isolation + if (m_RelPtConeCut < -100){ + ATH_MSG_DEBUG(" not applying isolation. Returning NOW"); + ATH_MSG_DEBUG("TAccept = " << pass); + return pass; + } + // Then, It will pass if relptcone20 is less than cut: + pass = (relptcone20 < m_RelPtConeCut); + // // Reach this point successfully ATH_MSG_DEBUG( "pass = " << pass ); diff --git a/Trigger/TrigHypothesis/TrigEgammaHypo/src/TrigEgammaPrecisionElectronHypoToolInc.h b/Trigger/TrigHypothesis/TrigEgammaHypo/src/TrigEgammaPrecisionElectronHypoToolInc.h index c4c37d3e3cc903b3ce9ed78f372996d580c5e251..f39964f8e3816eb057b7ac501cc51fc470400ebc 100644 --- a/Trigger/TrigHypothesis/TrigEgammaHypo/src/TrigEgammaPrecisionElectronHypoToolInc.h +++ b/Trigger/TrigHypothesis/TrigEgammaHypo/src/TrigEgammaPrecisionElectronHypoToolInc.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ #ifndef TRIGEGAMMAHYPO_TRIGPRECISIONELECTRONPRECISIONHYPOTOOLINC_H #define TRIGEGAMMAHYPO_TRIGPRECISIONELECTRONPRECISIONHYPOTOOLINC_H 1 @@ -50,6 +50,9 @@ class TrigEgammaPrecisionElectronHypoToolInc : public extends<AthAlgTool, ITrigE /*Likelihood tool*/ ToolHandle<IAsgElectronLikelihoodTool> m_egammaElectronLHTool; + + /* TRack isolation cut */ + float m_RelPtConeCut; /*Luminosity info*/ SG::ReadDecorHandleKey<xAOD::EventInfo> m_avgMuKey { this, "AveIntPerXKey", "EventInfo.AveIntPerXDecor", "Decoration for Average Interaction Per Crossing" }; diff --git a/Trigger/TrigHypothesis/TrigEgammaHypo/src/TrigEgammaPrecisionPhotonHypoToolInc.cxx b/Trigger/TrigHypothesis/TrigEgammaHypo/src/TrigEgammaPrecisionPhotonHypoToolInc.cxx index d3c6bbc166589e5341812f54522dca0982acd6f4..fa119ef3cf7224e6aa1f86339e29c77115e7e165 100644 --- a/Trigger/TrigHypothesis/TrigEgammaHypo/src/TrigEgammaPrecisionPhotonHypoToolInc.cxx +++ b/Trigger/TrigHypothesis/TrigEgammaHypo/src/TrigEgammaPrecisionPhotonHypoToolInc.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ #include <algorithm> @@ -17,6 +17,8 @@ TrigEgammaPrecisionPhotonHypoToolInc::TrigEgammaPrecisionPhotonHypoToolInc( cons : base_class( type, name, parent ), m_decisionId( HLT::Identifier::fromToolName( name ) ) { declareProperty("PhotonIsEMSelector" ,m_egammaPhotonCutIDTool ); + declareProperty("RelEtConeCut" ,m_RelEtConeCut=-999.); + } StatusCode TrigEgammaPrecisionPhotonHypoToolInc::initialize() { @@ -35,6 +37,10 @@ StatusCode TrigEgammaPrecisionPhotonHypoToolInc::initialize() { ATH_MSG_DEBUG( "Retrieving egammaPhotonCutIDTool..." ); CHECK( m_egammaPhotonCutIDTool.retrieve() ); + // Retrieving Luminosity info + ATH_MSG_DEBUG( "Retrieving luminosityCondData..." ); + ATH_CHECK( m_avgMuKey.initialize() ); + unsigned int nEtaBin = m_etabin.size(); #define CHECK_SIZE( __n) if ( m_##__n.size() != (nEtaBin - 1) ) \ { ATH_MSG_DEBUG(" __n size is " << m_##__n.size() << " but needs to be " << (nEtaBin - 1) ); return StatusCode::FAILURE; } @@ -63,11 +69,14 @@ bool TrigEgammaPrecisionPhotonHypoToolInc::decide( const ITrigEgammaPrecisionPho auto etaBin = Monitored::Scalar( "EtaBin", -1. ); auto monEta = Monitored::Scalar( "Eta", -99. ); auto monPhi = Monitored::Scalar( "Phi", -99. ); + auto mon_mu = Monitored::Scalar("mu", -1.); + auto mon_etcone20 = Monitored::Scalar("etcone20", -99.); + auto mon_reletcone20 = Monitored::Scalar("reletcone20", -99.); auto PassedCuts = Monitored::Scalar<int>( "CutCounter", -1 ); auto monitorIt = Monitored::Group( m_monTool, ET, dEta, dPhi, etaBin, monEta, - monPhi,PassedCuts ); + monPhi, mon_mu, mon_etcone20, mon_reletcone20, PassedCuts ); // when leaving scope it will ship data to monTool PassedCuts = PassedCuts + 1; //got called (data in place) @@ -146,10 +155,19 @@ bool TrigEgammaPrecisionPhotonHypoToolInc::decide( const ITrigEgammaPrecisionPho std::bitset<32> isEMdecision = m_egammaPhotonCutIDTool->accept(input.photon).getCutResultInvertedBitSet(); ATH_MSG_DEBUG("isEM Result bitset: " << isEMdecision); + // get average luminosity information to calculate LH + + float avg_mu = 0; + SG::ReadDecorHandle<xAOD::EventInfo,float> eventInfoDecor(m_avgMuKey); + if(eventInfoDecor.isPresent()) { + avg_mu = eventInfoDecor(0); + ATH_MSG_DEBUG("Average mu " << avg_mu); + mon_mu = avg_mu; + } float Rhad1(0), Rhad(0), Reta(0), Rphi(0), e277(0), weta2c(0), //emax2(0), Eratio(0), DeltaE(0), f1(0), weta1c(0), wtot(0), fracm(0); - float ptcone20(999), ptcone30(999), ptcone40(999), etcone20(999), etcone30(999), etcone40(999), topoetcone20(999), topoetcone30(999), topoetcone40(999); + float ptcone20(999), ptcone30(999), ptcone40(999), etcone20(999), etcone30(999), etcone40(999), topoetcone20(999), topoetcone30(999), topoetcone40(999), reletcone20(999); // variables based on HCAL @@ -223,6 +241,12 @@ bool TrigEgammaPrecisionPhotonHypoToolInc::decide( const ITrigEgammaPrecisionPho ATH_MSG_DEBUG( " topoetcone20 " << topoetcone20 ) ; ATH_MSG_DEBUG( " topoetcone30 " << topoetcone30 ) ; ATH_MSG_DEBUG( " topoetcone40 " << topoetcone40 ) ; + // Monitor showershapes + mon_etcone20 = etcone20; + reletcone20 = etcone20/input.photon->caloCluster()->et(); + ATH_MSG_DEBUG("reletcone20 = " <<reletcone20 ); + mon_reletcone20 = reletcone20; + ATH_MSG_DEBUG("m_RelEtConeCut = " << m_RelEtConeCut ); // Decode isEM bits of result to see which bits passed and which bits fialed @@ -230,9 +254,25 @@ bool TrigEgammaPrecisionPhotonHypoToolInc::decide( const ITrigEgammaPrecisionPho if ( !pass ){ ATH_MSG_DEBUG("REJECT isEM failed"); + return pass; } else { ATH_MSG_DEBUG("ACCEPT isEM passed"); } + // Check if need to apply isolation + // First check logic. if cut is very negative, then no isolation cut is defined + // if m_RelEtConeCut <-100 then hypo is configured not to apply isolation + if (m_RelEtConeCut < -100){ + ATH_MSG_DEBUG(" not applying isolation. Returning NOW"); + ATH_MSG_DEBUG("TAccept = " << pass); + return pass; + } + // Then, It will pass if reletcone20 is less than cut: + pass = (reletcone20 < m_RelEtConeCut); + // + // Reach this point successfully + ATH_MSG_DEBUG( "pass = " << pass ); + + return pass; // Reach this point successfully ATH_MSG_DEBUG( "pass = " << pass ); diff --git a/Trigger/TrigHypothesis/TrigEgammaHypo/src/TrigEgammaPrecisionPhotonHypoToolInc.h b/Trigger/TrigHypothesis/TrigEgammaHypo/src/TrigEgammaPrecisionPhotonHypoToolInc.h index 952b6ebb0070566855f4cc36692aaab589dc68ab..2a31172ff82aac24514fdde9b4642c3719dbe7ce 100644 --- a/Trigger/TrigHypothesis/TrigEgammaHypo/src/TrigEgammaPrecisionPhotonHypoToolInc.h +++ b/Trigger/TrigHypothesis/TrigEgammaHypo/src/TrigEgammaPrecisionPhotonHypoToolInc.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ #ifndef TRIGEGAMMAHYPO_TRIGPRECISIONPHOTONHYPOTOOLINC_H #define TRIGEGAMMAHYPO_TRIGPRECISIONPHOTONHYPOTOOLINC_H 1 @@ -16,6 +16,7 @@ #include "ITrigEgammaPrecisionPhotonHypoTool.h" #include "PATCore/AcceptData.h" #include "EgammaAnalysisInterfaces/IAsgPhotonIsEMSelector.h" +#include "StoreGate/ReadDecorHandle.h" /** * @class Implementation of the Egamma selection for Photons @@ -44,8 +45,14 @@ class TrigEgammaPrecisionPhotonHypoToolInc : public extends<AthAlgTool, ITrigEga Gaudi::Property< float > m_detacluster { this, "dETACLUSTERthr", 0. , "" }; Gaudi::Property< float > m_dphicluster { this, "dPHICLUSTERthr", 0. , "" }; + /* Calo isolation cut */ + float m_RelEtConeCut; + ToolHandle< GenericMonitoringTool > m_monTool { this, "MonTool", "", "Monitoring tool" }; ToolHandle<IAsgPhotonIsEMSelector> m_egammaPhotonCutIDTool; +/*Luminosity info*/ + SG::ReadDecorHandleKey<xAOD::EventInfo> m_avgMuKey { this, "AveIntPerXKey", "EventInfo.AveIntPerXDecor", "Decoration for Average Interaction Per Crossing" }; + int findCutIndex( float eta ) const; }; diff --git a/Trigger/TrigMonitoring/TrigBphysMonitoring/src/BphysTrigDiMuDecoratorTool.cxx b/Trigger/TrigMonitoring/TrigBphysMonitoring/src/BphysTrigDiMuDecoratorTool.cxx index b9e80ea56036fdb9cb2198d11941aa098cbfaf35..7996facba14a7d6b87d956a57cf00c6d23092877 100644 --- a/Trigger/TrigMonitoring/TrigBphysMonitoring/src/BphysTrigDiMuDecoratorTool.cxx +++ b/Trigger/TrigMonitoring/TrigBphysMonitoring/src/BphysTrigDiMuDecoratorTool.cxx @@ -117,6 +117,7 @@ StatusCode BphysTrigDiMuDecoratorTool::decorateVertex(const xAOD::Vertex* vtx, std::unique_ptr<xAOD::Vertex> bsVertex = std::make_unique<xAOD::Vertex>(); bsVertex->makePrivateStore(); AmgSymMatrix(3) cov; + cov.setZero(); if (beamspot.isValid()) { bsVertex->setX(beamspot->beamPos()[0]); bsVertex->setY(beamspot->beamPos()[1]); diff --git a/Trigger/TrigMonitoring/TrigJetMonitoring/python/TrigJetMonitorAlgorithm.py b/Trigger/TrigMonitoring/TrigJetMonitoring/python/TrigJetMonitorAlgorithm.py index 994f265356beb1d40d11dbdd48aaf9378b191613..6dab07fb71e7586bbd1fee6ebfeae6e92e7c1459 100644 --- a/Trigger/TrigMonitoring/TrigJetMonitoring/python/TrigJetMonitorAlgorithm.py +++ b/Trigger/TrigMonitoring/TrigJetMonitoring/python/TrigJetMonitorAlgorithm.py @@ -60,12 +60,12 @@ Chain2JetCollDict['MT'] = { 'HLT_j460_a10_lcw_subjes_L1J100' : 'HLT_AntiKt10LCTopoJets_subjes', 'HLT_j460_a10t_lcw_jes_L1J100' : 'HLT_AntiKt10LCTopoTrimmedPtFrac5SmallR20Jets_jes', 'HLT_2j330_a10t_lcw_jes_35smcINF_L1J100' : 'HLT_AntiKt10LCTopoTrimmedPtFrac5SmallR20Jets_jes', - 'HLT_j45_ftf_pf_L1J20' : 'HLT_AntiKt4EMPFlowJets_subjesIS_ftf', - 'HLT_j45_ftf_subjesgscIS_pf_L1J20' : 'HLT_AntiKt4EMPFlowJets_subjesgscIS_ftf', - 'HLT_j45_ftf_subresjesgscIS_pf_L1J20' : 'HLT_AntiKt4EMPFlowJets_subresjesgscIS_ftf', - 'HLT_j85_ftf_pf_L1J20' : 'HLT_AntiKt4EMPFlowJets_subjesIS_ftf', - 'HLT_j45_ftf_pf_nojcalib_L1J20' : 'HLT_AntiKt4EMPFlowJets_nojcalib_ftf', - 'HLT_j45_ftf_csskpf_nojcalib_L1J20' : 'HLT_AntiKt4EMPFlowCSSKJets_nojcalib_ftf', + 'HLT_j45_pf_ftf_L1J20' : 'HLT_AntiKt4EMPFlowJets_subjesIS_ftf', + 'HLT_j45_pf_subjesgscIS_ftf_L1J20' : 'HLT_AntiKt4EMPFlowJets_subjesgscIS_ftf', + 'HLT_j45_pf_subresjesgscIS_ftf_L1J20' : 'HLT_AntiKt4EMPFlowJets_subresjesgscIS_ftf', + 'HLT_j85_pf_ftf_L1J20' : 'HLT_AntiKt4EMPFlowJets_subjesIS_ftf', + 'HLT_j45_pf_nojcalib_ftf_L1J20' : 'HLT_AntiKt4EMPFlowJets_nojcalib_ftf', + 'HLT_j45_csskpf_nojcalib_ftf_L1J20' : 'HLT_AntiKt4EMPFlowCSSKJets_nojcalib_ftf', } TurnOnCurves['MT'] = { # ref chain, offline jet coll 'HLT_j420_L1J100' : ['HLT_j80_L1J15','AntiKt4EMTopoJets'], @@ -74,7 +74,7 @@ TurnOnCurves['MT'] = { # ref chain, offline jet coll 'HLT_j460_a10_lcw_subjes_L1J100' : ['HLT_j80_L1J15','AntiKt4EMTopoJets'], 'HLT_j460_a10t_lcw_jes_L1J100' : ['HLT_j80_L1J15','AntiKt4EMTopoJets'], 'HLT_2j330_a10t_lcw_jes_35smcINF_L1J100' : ['HLT_j80_L1J15','AntiKt4EMTopoJets'], - 'HLT_j85_ftf_pf_L1J20' : ['HLT_j45_ftf_pf_L1J20','AntiKt4EMPFlowJets'], + 'HLT_j85_pf_ftf_L1J20' : ['HLT_j45_pf_ftf_L1J20','AntiKt4EMPFlowJets'], } # Legacy @@ -471,14 +471,14 @@ def jetEfficiencyMonitoringConfig(inputFlags,onlinejetcoll,offlinejetcoll,chain, if 'smc' in chain: trigConf.appendHistos( SelectSpec( 'm50', '50<m', chainFolder, FillerTools = [ - ToolSpec('JetHistoTriggEfficiency', chain, + ToolSpec('JetHistoTriggEfficiency', chain+'_m50', Group='jetTrigGroup_'+chain+'_m50', Var=retrieveVarToolConf("pt"), # In this context we can not just pass a str alias to describe a histo variable ProbeTrigChain=chain,defineHistoFunc=defineHistoForJetTrigg ), ] ), SelectSpec( 'et500', '500<et', chainFolder, FillerTools = [ - ToolSpec('JetHistoTriggEfficiency', chain, + ToolSpec('JetHistoTriggEfficiency', chain+'_et500', Group='jetTrigGroup_'+chain+'_et500', Var=retrieveVarToolConf("m"), # In this context we can not just pass a str alias to describe a histo variable ProbeTrigChain=chain,defineHistoFunc=defineHistoForJetTrigg diff --git a/Trigger/TrigMonitoring/TrigMuonMonitoringMT/python/L1MuonMonConfig.py b/Trigger/TrigMonitoring/TrigMuonMonitoringMT/python/L1MuonMonConfig.py index 740775e1965572040f322fe3b3b1be366430e8bd..aa460d2a9009d60618c13cbc66761a098b58bca5 100644 --- a/Trigger/TrigMonitoring/TrigMuonMonitoringMT/python/L1MuonMonConfig.py +++ b/Trigger/TrigMonitoring/TrigMuonMonitoringMT/python/L1MuonMonConfig.py @@ -4,7 +4,7 @@ def L1MuonMonConfig(helper): from AthenaConfiguration.ComponentFactory import CompFactory - monAlg = helper.addAlgorithm(CompFactory.L1MuonMonMT,'L1MuonMonMT') + monAlg = helper.addAlgorithm(CompFactory.L1MuonMonMT,'L1MuonMonMTAlg') histGroup = helper.addGroup(monAlg, 'L1MuonMonMT', 'HLT/MuonMon/') diff --git a/Trigger/TrigMonitoring/TrigTauMonitoring/src/TrigTauMonitorAlgorithm.cxx b/Trigger/TrigMonitoring/TrigTauMonitoring/src/TrigTauMonitorAlgorithm.cxx index 114a3df0814b56cc22dd195efdb75959638d2c5b..f764c4bb49571483703de5a4ee9648a34e4f5aa9 100644 --- a/Trigger/TrigMonitoring/TrigTauMonitoring/src/TrigTauMonitorAlgorithm.cxx +++ b/Trigger/TrigMonitoring/TrigTauMonitoring/src/TrigTauMonitorAlgorithm.cxx @@ -244,6 +244,20 @@ void TrigTauMonitorAlgorithm::fillRNNTrack(const std::string trigger, std::vecto auto monGroup = getGroup(trigger+( online ? "/RNN/HLT/InputTrack" : "/RNN/Offline/InputTrack")); for(auto tau: tau_vec){ + // Don't call ->allTracks() unless the element links are valid + static const SG::AuxElement::ConstAccessor< std::vector<ElementLink<xAOD::TauTrackContainer>> > tauTrackAcc("tauTrackLinks"); + bool linksValid = true; + for (const ElementLink<xAOD::TauTrackContainer>& trackEL : tauTrackAcc(*tau)) { + if (!trackEL.isValid()) { + linksValid = false; + } + break; + } + if (!linksValid) { + ATH_MSG_WARNING("Invalid track element links from TauJet in " << trigger); + continue; + } + auto tracks = tau->allTracks(); auto track_pt_jetseed_log = Monitored::Collection("track_pt_jetseed_log", tau_vec, [] (const xAOD::TauJet* tau){ return TMath::Log10( tau->ptJetSeed());}); diff --git a/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/Root/DeltaRApproxBoxCutIncl1.cxx b/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/Root/DeltaRApproxBoxCutIncl1.cxx index f1ac7e20feeb31e6250ffd894d99d26c01a6582a..ce755cd5a87346800587811c945afa1cde9cba88 100644 --- a/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/Root/DeltaRApproxBoxCutIncl1.cxx +++ b/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/Root/DeltaRApproxBoxCutIncl1.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ /********************************* * DeltaRApproxBoxCutIncl1.cpp @@ -33,7 +33,7 @@ namespace { unsigned int calcDeltaEta(const TCS::GenericTOB* tob1, const TCS::GenericTOB* tob2) { - double deta = fabs( tob1->eta() - tob2->eta() ); + double deta = std::abs( tob1->eta() - tob2->eta() ); return deta; } } diff --git a/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/Root/DisambiguationDetaDPhiIncl3.cxx b/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/Root/DisambiguationDetaDPhiIncl3.cxx index f9c0909cb06a42998e1d3458ed249dfebb0dc22c..d16a33b25cbe145d45822d0b27ce898b2846e866 100644 --- a/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/Root/DisambiguationDetaDPhiIncl3.cxx +++ b/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/Root/DisambiguationDetaDPhiIncl3.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ /********************************* * DisambiguationDetaDPhiIncl3.cpp @@ -128,16 +128,16 @@ TCS::DisambiguationDetaDPhiIncl3::processBitCorrect( const std::vector<TCS::TOBA { if( parType_t((*tob1)->Et()) <= p_MinET1) continue; // ET cut - if( parType_t(fabs((*tob1)->eta())) > p_EtaMax1 ) continue; // Eta cut - if( parType_t(fabs((*tob1)->eta())) < p_EtaMin1 ) continue; // Eta cut + if( parType_t(std::abs((*tob1)->eta())) > p_EtaMax1 ) continue; // Eta cut + if( parType_t(std::abs((*tob1)->eta())) < p_EtaMin1 ) continue; // Eta cut for( TCS::TOBArray::const_iterator tob2 = input[1]->begin(); tob2 != input[1]->end() && distance(input[1]->begin(), tob2) < p_NumberLeading2; ++tob2) { if( parType_t((*tob2)->Et()) <= p_MinET2) continue; // ET cut - if( parType_t(fabs((*tob2)->eta())) > p_EtaMax2 ) continue; // Eta cut - if( parType_t(fabs((*tob2)->eta())) < p_EtaMin2 ) continue; // Eta cut + if( parType_t(std::abs((*tob2)->eta())) > p_EtaMax2 ) continue; // Eta cut + if( parType_t(std::abs((*tob2)->eta())) < p_EtaMin2 ) continue; // Eta cut // DeltaPhi cuts unsigned int deltaPhi = TSU::Kinematics::calcDeltaPhiBW( *tob1, *tob2 ); @@ -151,8 +151,8 @@ TCS::DisambiguationDetaDPhiIncl3::processBitCorrect( const std::vector<TCS::TOBA tob3 != input[2]->end() ; ++tob3) { if( parType_t((*tob3)->Et()) <= p_MinET3) continue; // ET cut - if( parType_t(fabs((*tob3)->eta())) > p_EtaMax3 ) continue; // Eta cut - if( parType_t(fabs((*tob3)->eta())) < p_EtaMin3 ) continue; // Eta cut + if( parType_t(std::abs((*tob3)->eta())) > p_EtaMax3 ) continue; // Eta cut + if( parType_t(std::abs((*tob3)->eta())) < p_EtaMin3 ) continue; // Eta cut unsigned int deltaR13 = TSU::Kinematics::calcDeltaR2BW( *tob1, *tob3 ); unsigned int deltaR23 = TSU::Kinematics::calcDeltaR2BW( *tob2, *tob3 ); for(unsigned int i=0; i<numberOutputBits(); ++i) { @@ -190,16 +190,16 @@ TCS::DisambiguationDetaDPhiIncl3::process( const std::vector<TCS::TOBArray const { if( parType_t((*tob1)->Et()) <= p_MinET1) continue; // ET cut - if( parType_t(fabs((*tob1)->eta())) > p_EtaMax1 ) continue; // Eta cut - if( parType_t(fabs((*tob1)->eta())) < p_EtaMin1 ) continue; // Eta cut + if( parType_t(std::abs((*tob1)->eta())) > p_EtaMax1 ) continue; // Eta cut + if( parType_t(std::abs((*tob1)->eta())) < p_EtaMin1 ) continue; // Eta cut for( TCS::TOBArray::const_iterator tob2 = input[1]->begin(); tob2 != input[1]->end() && distance(input[1]->begin(), tob2) < p_NumberLeading2; ++tob2) { if( parType_t((*tob2)->Et()) <= p_MinET2) continue; // ET cut - if( parType_t(fabs((*tob2)->eta())) > p_EtaMax2 ) continue; // Eta cut - if( parType_t(fabs((*tob2)->eta())) < p_EtaMin2 ) continue; // Eta cut + if( parType_t(std::abs((*tob2)->eta())) > p_EtaMax2 ) continue; // Eta cut + if( parType_t(std::abs((*tob2)->eta())) < p_EtaMin2 ) continue; // Eta cut // DeltaPhi cuts unsigned int deltaPhi = TSU::Kinematics::calcDeltaPhi( *tob1, *tob2 ); @@ -213,8 +213,8 @@ TCS::DisambiguationDetaDPhiIncl3::process( const std::vector<TCS::TOBArray const tob3 != input[2]->end() ; ++tob3) { if( parType_t((*tob3)->Et()) <= p_MinET3) continue; // ET cut - if( parType_t(fabs((*tob3)->eta())) > p_EtaMax3 ) continue; // Eta cut - if( parType_t(fabs((*tob3)->eta())) < p_EtaMin3 ) continue; // Eta cut + if( parType_t(std::abs((*tob3)->eta())) > p_EtaMax3 ) continue; // Eta cut + if( parType_t(std::abs((*tob3)->eta())) < p_EtaMin3 ) continue; // Eta cut unsigned int deltaR13 = TSU::Kinematics::calcDeltaR2( *tob1, *tob3 ); unsigned int deltaR23 = TSU::Kinematics::calcDeltaR2( *tob2, *tob3 ); for(unsigned int i=0; i<numberOutputBits(); ++i) { diff --git a/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/Root/JetHT.cxx b/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/Root/JetHT.cxx index ef4d3f5a881a3c96824117de9fccc84cacb18f18..9f75ca7a417fed57785f552552d8bf4068f953c8 100644 --- a/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/Root/JetHT.cxx +++ b/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/Root/JetHT.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ /********************************* * JetHT.cpp @@ -108,8 +108,8 @@ TCS::JetHT::process( const std::vector<TCS::TOBArray const *> & input, ++tob) { - if( parType_t(fabs((*tob)->eta())) > p_EtaMax ) continue; // Eta cut - if( parType_t(fabs((*tob)->eta())) < p_EtaMin ) continue; // Eta cut + if( parType_t(std::abs((*tob)->eta())) > p_EtaMax ) continue; // Eta cut + if( parType_t(std::abs((*tob)->eta())) < p_EtaMin ) continue; // Eta cut if( parType_t((*tob)->Et()) <= p_MinET ) continue; // E_T cut TRG_MSG_DEBUG("Jet : ET = " << (*tob)->Et()); diff --git a/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/Root/JetMatch.cxx b/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/Root/JetMatch.cxx index 9f1359db89223947654ecc99d2f6e85f1c15583f..6cf7999707f8d6be4191e8cf302e12b7848e7cdf 100644 --- a/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/Root/JetMatch.cxx +++ b/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/Root/JetMatch.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ /********************************* * JetMatch.cpp @@ -86,8 +86,8 @@ TCS::JetMatch::process( const std::vector<TCS::TOBArray const *> & input, for( TCS::GenericTOB * tob : *input[0]) { ++objC; - if( parType_t(fabs(tob->eta())) > p_EtaMax ) continue; // Eta cut - if( parType_t(fabs(tob->eta())) < p_EtaMin ) continue; // Eta cut + if( parType_t(std::abs(tob->eta())) > p_EtaMax ) continue; // Eta cut + if( parType_t(std::abs(tob->eta())) < p_EtaMin ) continue; // Eta cut if( tob->EtWide() <= p_MinET1 ) continue; // E_T cut if( tob->EtNarrow() <= p_MinET2 ) continue; // E_T cut diff --git a/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/Root/MultiplicityCustom.cxx b/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/Root/MultiplicityCustom.cxx index e3ad9c24060b537b2372beaa61b32e7a37d13b1d..93f57b9b3ead36dfb90fd74a7d60a1536b2f881c 100644 --- a/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/Root/MultiplicityCustom.cxx +++ b/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/Root/MultiplicityCustom.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ /********************************* * MultiplicityCustom.cpp @@ -85,8 +85,8 @@ TCS::MultiplicityCustom::process( const std::vector<TCS::TOBArray const *> & inp tob1 != input[0]->end() && distance( input[0]->begin(), tob1) < nLeading; ++tob1) { - if (parType_t(fabs((*tob1)-> eta())) < p_EtaMin) continue; - if (parType_t(fabs((*tob1)-> eta())) > p_EtaMax) continue; + if (parType_t(std::abs((*tob1)-> eta())) < p_EtaMin) continue; + if (parType_t(std::abs((*tob1)-> eta())) > p_EtaMax) continue; if( parType_t((*tob1)->Et()) <= p_MinET ) continue; // E_T cut // diff --git a/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/Root/NotMatch.cxx b/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/Root/NotMatch.cxx index 3dda9a616d74177071680830065c2ba2d531b5f4..caf98facaf53372f3c4b714bce06b48b3f10209f 100644 --- a/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/Root/NotMatch.cxx +++ b/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/Root/NotMatch.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ /********************************* * NotMatch.cpp @@ -127,16 +127,16 @@ TCS::NotMatch::processBitCorrect( const std::vector<TCS::TOBArray const *> & inp ++tob1) { if( parType_t((*tob1)->Et()) <= p_MinET1[i]) continue; // ET cut - if( parType_t(fabs((*tob1)->eta())) > p_EtaMax1[i] ) continue; // Eta cut - if( parType_t(fabs((*tob1)->eta())) < p_EtaMin1[i] ) continue; // Eta cut + if( parType_t(std::abs((*tob1)->eta())) > p_EtaMax1[i] ) continue; // Eta cut + if( parType_t(std::abs((*tob1)->eta())) < p_EtaMin1[i] ) continue; // Eta cut matched = false; deltaR2 = 999; for( TCS::TOBArray::const_iterator tob2 = input[1]->begin(); tob2 != input[1]->end() && distance(input[1]->begin(), tob2) < p_NumberLeading2 && matched != true ; ++tob2) { if( parType_t((*tob2)->Et()) <= p_MinET2[i]) continue; // ET cut - if( parType_t(fabs((*tob2)->eta())) > p_EtaMax2[i] ) continue; // Eta cut - if( parType_t(fabs((*tob2)->eta())) < p_EtaMin2[i] ) continue; // Eta cut + if( parType_t(std::abs((*tob2)->eta())) > p_EtaMax2[i] ) continue; // Eta cut + if( parType_t(std::abs((*tob2)->eta())) < p_EtaMin2[i] ) continue; // Eta cut // test DeltaR2Min, DeltaR2Max deltaR2 = calcDeltaR2BW( *tob1, *tob2 ); if (deltaR2 <= p_DRCut[i]) matched = true; @@ -177,16 +177,16 @@ TCS::NotMatch::process( const std::vector<TCS::TOBArray const *> & input, ++tob1) { if( parType_t((*tob1)->Et()) <= p_MinET1[i]) continue; // ET cut - if( parType_t(fabs((*tob1)->eta())) > p_EtaMax1[i] ) continue; // Eta cut - if( parType_t(fabs((*tob1)->eta())) < p_EtaMin1[i] ) continue; // Eta cut + if( parType_t(std::abs((*tob1)->eta())) > p_EtaMax1[i] ) continue; // Eta cut + if( parType_t(std::abs((*tob1)->eta())) < p_EtaMin1[i] ) continue; // Eta cut matched = false; deltaR2 = 999; for( TCS::TOBArray::const_iterator tob2 = input[1]->begin(); tob2 != input[1]->end() && distance(input[1]->begin(), tob2) < p_NumberLeading2 && matched != true ; ++tob2) { if( parType_t((*tob2)->Et()) <= p_MinET2[i]) continue; // ET cut - if( parType_t(fabs((*tob2)->eta())) > p_EtaMax2[i] ) continue; // Eta cut - if( parType_t(fabs((*tob2)->eta())) < p_EtaMin2[i] ) continue; // Eta cut + if( parType_t(std::abs((*tob2)->eta())) > p_EtaMax2[i] ) continue; // Eta cut + if( parType_t(std::abs((*tob2)->eta())) < p_EtaMin2[i] ) continue; // Eta cut // test DeltaR2Min, DeltaR2Max deltaR2 = calcDeltaR2( *tob1, *tob2 ); if (deltaR2 <= p_DRCut[i]) matched = true; diff --git a/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/Root/Ratio.cxx b/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/Root/Ratio.cxx index 37ce171f4ecab9cf1ce9bb08e8f218c37f683f25..5a9dfcad8ebfe28ea3afbed2774f4036880933f1 100644 --- a/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/Root/Ratio.cxx +++ b/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/Root/Ratio.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ /********************************* * Ratio.cpp @@ -100,8 +100,8 @@ TCS::Ratio::process( const std::vector<TCS::TOBArray const *> & input, for( TCS::GenericTOB * tob : *input[1]) { - if( parType_t(fabs(tob->eta())) > p_EtaMax ) continue; // Eta cut - if( parType_t(fabs(tob->eta())) < p_EtaMin ) continue; // Eta cut + if( parType_t(std::abs(tob->eta())) > p_EtaMax ) continue; // Eta cut + if( parType_t(std::abs(tob->eta())) < p_EtaMin ) continue; // Eta cut if( tob->Et() <= p_MinET2 ) continue; // E_T cut TRG_MSG_DEBUG("Jet ET = " << tob->Et()); diff --git a/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/Root/Ratio2.cxx b/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/Root/Ratio2.cxx index befccb97171949780b5ddc0a64ba744ac2f966fd..200156b1e2a6003b1481c40df31565f266474179 100644 --- a/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/Root/Ratio2.cxx +++ b/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/Root/Ratio2.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ /********************************* * Ratio2.cpp @@ -95,8 +95,8 @@ TCS::Ratio2::process( const std::vector<TCS::TOBArray const *> & input, for( TCS::GenericTOB * tob : *input[1]) { - if( parType_t(fabs(tob->eta())) > p_EtaMax ) continue; // Eta cut - if( parType_t(fabs(tob->eta())) < p_EtaMin ) continue; // Eta cut + if( parType_t(std::abs(tob->eta())) > p_EtaMax ) continue; // Eta cut + if( parType_t(std::abs(tob->eta())) < p_EtaMin ) continue; // Eta cut if( tob->Et() <= p_MinET2 ) continue; // E_T cut TRG_MSG_DEBUG("Jet : ET = " << tob->Et()); diff --git a/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/Root/RatioSum.cxx b/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/Root/RatioSum.cxx index 687f150a67178b874b9b3db8dcff76e0dd20308a..0900ad4a3a772a24d6bf91be559bb3716b6235c7 100644 --- a/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/Root/RatioSum.cxx +++ b/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/Root/RatioSum.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ /********************************* * RatioSum.cpp @@ -199,8 +199,8 @@ TCS::RatioSum::process( const std::vector<TCS::TOBArray const *> & input, unsigned int objC(0); for( TCS::GenericTOB * tob : *input[1]) { - if( parType_t(fabs(tob->eta())) > p_EtaMax2 ) continue; // Eta cut - if( parType_t(fabs(tob->eta())) < p_EtaMin2 ) continue; // Eta cut + if( parType_t(std::abs(tob->eta())) > p_EtaMax2 ) continue; // Eta cut + if( parType_t(std::abs(tob->eta())) < p_EtaMin2 ) continue; // Eta cut if( tob->Et() <= p_MinET2 ) continue; // E_T cut TRG_MSG_DEBUG("Jet : ET = " << tob->Et()); @@ -216,8 +216,8 @@ TCS::RatioSum::process( const std::vector<TCS::TOBArray const *> & input, ++tob1) { - if( parType_t(fabs((*tob1)->eta())) > p_EtaMax3 ) continue; // Eta cut - if( parType_t(fabs((*tob1)->eta())) < p_EtaMin3 ) continue; // Eta cut + if( parType_t(std::abs((*tob1)->eta())) > p_EtaMax3 ) continue; // Eta cut + if( parType_t(std::abs((*tob1)->eta())) < p_EtaMin3 ) continue; // Eta cut if( (*tob1)->Et() <= p_MinET3 ) continue; // E_T cut sumET += (*tob1)->Et() ; diff --git a/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/Root/SimpleCone.cxx b/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/Root/SimpleCone.cxx index 4adc595020758ab34e57bfa6fcaf65e6d0db9cfc..2be36ed6ca8a64687c87a3a825e94cf2cb05df18 100644 --- a/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/Root/SimpleCone.cxx +++ b/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/Root/SimpleCone.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ /********************************* * SimpleCone.cpp @@ -110,8 +110,8 @@ TCS::SimpleCone::process( const std::vector<TCS::TOBArray const *> & input, tob != input[0]->end() && distance(input[0]->begin(), tob) < p_NumberLeading1; ++tob) { - if( parType_t(fabs((*tob)->eta())) > p_EtaMax ) continue; // Eta cut - if( parType_t(fabs((*tob)->eta())) < p_EtaMin ) continue; // Eta cut + if( parType_t(std::abs((*tob)->eta())) > p_EtaMax ) continue; // Eta cut + if( parType_t(std::abs((*tob)->eta())) < p_EtaMin ) continue; // Eta cut if( parType_t((*tob)->Et()) <= p_MinET ) continue; // E_T cut TRG_MSG_DEBUG("Jet : ET = " << (*tob)->Et()); @@ -123,8 +123,8 @@ TCS::SimpleCone::process( const std::vector<TCS::TOBArray const *> & input, ++tob1) { if( tob1 == tob ) continue; // Avoid double counting of central jet - if( parType_t(fabs((*tob1)->eta())) > p_EtaMax ) continue; // Eta cut - if( parType_t(fabs((*tob1)->eta())) < p_EtaMin ) continue; // Eta cut + if( parType_t(std::abs((*tob1)->eta())) > p_EtaMax ) continue; // Eta cut + if( parType_t(std::abs((*tob1)->eta())) < p_EtaMin ) continue; // Eta cut if( parType_t((*tob1)->Et()) <= p_MinET ) continue; // E_T cut double deta = ( (*tob)->etaDouble() - (*tob1)->etaDouble() ); diff --git a/Trigger/TrigT1/L1Topo/L1TopoConfig/Root/test/go.sh b/Trigger/TrigT1/L1Topo/L1TopoConfig/Root/test/go.sh deleted file mode 100644 index 04cd7e4425bebd796136cdc780019421a8f6dac3..0000000000000000000000000000000000000000 --- a/Trigger/TrigT1/L1Topo/L1TopoConfig/Root/test/go.sh +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/bash - -cd ../../cmt -cmt config -cmt make -cd ../src/test - -TrigConfTopoReader L1TopoMenu_smk_2323.xml \ No newline at end of file diff --git a/Trigger/TrigT1/TrigT1CaloByteStream/src/CpByteStreamV2Tool.cxx b/Trigger/TrigT1/TrigT1CaloByteStream/src/CpByteStreamV2Tool.cxx index 9dca2a78374baa360b7b3e764b0440bc8f6f9fb2..2c4966e11e5eb770bf1a27ce9697e41bdb003402 100755 --- a/Trigger/TrigT1/TrigT1CaloByteStream/src/CpByteStreamV2Tool.cxx +++ b/Trigger/TrigT1/TrigT1CaloByteStream/src/CpByteStreamV2Tool.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ @@ -55,9 +55,7 @@ CpByteStreamV2Tool::CpByteStreamV2Tool(const std::string &type, m_robDataProvider("ROBDataProviderSvc", name), m_channels(80), m_crates(4), m_modules(14), m_cmxs(2), m_maxTobs(5), m_chips(16), m_locs(4), - m_coreOverlap(0), m_subDetector(eformat::TDAQ_CALO_CLUSTER_PROC_DAQ), - m_srcIdMap(0), m_towerKey(0), m_cpmSubBlock(0), m_cmxCpSubBlock(0), - m_rodStatus(0), m_fea(0) + m_subDetector(eformat::TDAQ_CALO_CLUSTER_PROC_DAQ) { declareInterface<CpByteStreamV2Tool>(this); @@ -72,7 +70,7 @@ CpByteStreamV2Tool::CpByteStreamV2Tool(const std::string &type, "Offset of CP crate numbers in RDOs"); // Properties for reading bytestream only - declareProperty("ROBSourceIDs", m_sourceIDs, + declareProperty("ROBSourceIDs", m_sourceIDsProp, "ROB fragment source identifiers"); // Properties for writing bytestream only @@ -111,13 +109,6 @@ StatusCode CpByteStreamV2Tool::initialize() CHECK(m_errorTool.retrieve()); CHECK(m_robDataProvider.retrieve()); - m_srcIdMap = new L1CaloSrcIdMap(); - m_towerKey = new LVL1::TriggerTowerKey(); - m_cpmSubBlock = new CpmSubBlockV2(); - m_cmxCpSubBlock = new CmxCpSubBlock(); - m_rodStatus = new std::vector<uint32_t>(2); - m_fea = new FullEventAssembler<L1CaloSrcIdMap>(); - return StatusCode::SUCCESS; } @@ -125,92 +116,88 @@ StatusCode CpByteStreamV2Tool::initialize() StatusCode CpByteStreamV2Tool::finalize() { - delete m_fea; - delete m_rodStatus; - delete m_cmxCpSubBlock; - delete m_cpmSubBlock; - delete m_towerKey; - delete m_srcIdMap; return StatusCode::SUCCESS; } // Conversion bytestream to CPM towers StatusCode CpByteStreamV2Tool::convert( const std::string& sgKey, - DataVector<LVL1::CPMTower> *const ttCollection) + DataVector<LVL1::CPMTower> *const ttCollection) const { - const std::vector<uint32_t>& vID(sourceIDs(sgKey)); + const std::vector<uint32_t>& vID(sourceIDs()); // // get ROB fragments IROBDataProviderSvc::VROBFRAG robFrags; m_robDataProvider->getROBData(vID, robFrags, "CpByteStreamV2Tool"); ATH_MSG_DEBUG("Number of ROB fragments:" << robFrags.size()); - return convert(robFrags, ttCollection); + return convert(sgKey, robFrags, ttCollection); } StatusCode CpByteStreamV2Tool::convert( + const std::string& sgKey, const IROBDataProviderSvc::VROBFRAG &robFrags, - DataVector<LVL1::CPMTower> *const ttCollection) + DataVector<LVL1::CPMTower> *const ttCollection) const { CpmTowerData data (ttCollection); - return convertBs(robFrags, data); + return convertBs(sgKey, robFrags, data); } // Conversion bytestream to CMX-CP TOBs StatusCode CpByteStreamV2Tool::convert( const std::string& sgKey, - DataVector<LVL1::CMXCPTob> *const tobCollection) + DataVector<LVL1::CMXCPTob> *const tobCollection) const { - const std::vector<uint32_t>& vID(sourceIDs(sgKey)); + const std::vector<uint32_t>& vID(sourceIDs()); // // get ROB fragments IROBDataProviderSvc::VROBFRAG robFrags; m_robDataProvider->getROBData(vID, robFrags, "CpByteStreamV2Tool"); ATH_MSG_DEBUG("Number of ROB fragments:" << robFrags.size()); - return convert(robFrags, tobCollection); + return convert(sgKey, robFrags, tobCollection); } StatusCode CpByteStreamV2Tool::convert( + const std::string& sgKey, const IROBDataProviderSvc::VROBFRAG &robFrags, - DataVector<LVL1::CMXCPTob> *const tobCollection) + DataVector<LVL1::CMXCPTob> *const tobCollection) const { CmxCpTobData data (tobCollection); - return convertBs(robFrags, data); + return convertBs(sgKey, robFrags, data); } // Conversion bytestream to CMX-CP hits StatusCode CpByteStreamV2Tool::convert( const std::string& sgKey, - DataVector<LVL1::CMXCPHits> *const hitCollection) + DataVector<LVL1::CMXCPHits> *const hitCollection) const { - const std::vector<uint32_t>& vID(sourceIDs(sgKey)); + const std::vector<uint32_t>& vID(sourceIDs()); // // get ROB fragments IROBDataProviderSvc::VROBFRAG robFrags; m_robDataProvider->getROBData(vID, robFrags, "CpByteStreamV2Tool"); ATH_MSG_DEBUG("Number of ROB fragments:" << robFrags.size()); - return convert(robFrags, hitCollection); + return convert(sgKey, robFrags, hitCollection); } StatusCode CpByteStreamV2Tool::convert( + const std::string& sgKey, const IROBDataProviderSvc::VROBFRAG &robFrags, - DataVector<LVL1::CMXCPHits> *const hitCollection) + DataVector<LVL1::CMXCPHits> *const hitCollection) const { CmxCpHitsData data (hitCollection); - return convertBs(robFrags, data); + return convertBs(sgKey, robFrags, data); } // Conversion of CP container to bytestream StatusCode CpByteStreamV2Tool::convert(const LVL1::CPBSCollectionV2 *const cp, - RawEventWrite *const re) + RawEventWrite *const re) const { const bool debug = msgLvl(MSG::DEBUG); if (debug) msg(MSG::DEBUG); // Clear the event assembler - - m_fea->clear(); - const uint16_t minorVersion = m_srcIdMap->minorVersion(); - m_fea->setRodMinorVersion(minorVersion); - m_rodStatusMap.clear(); + FullEventAssembler<L1CaloSrcIdMap> fea; + fea.clear(); + const uint16_t minorVersion = m_srcIdMap.minorVersion(); + fea.setRodMinorVersion(minorVersion); // Pointer to ROD data vector @@ -218,9 +205,19 @@ StatusCode CpByteStreamV2Tool::convert(const LVL1::CPBSCollectionV2 *const cp, // Set up the container maps - setupCpmTowerMap(cp->towers()); - setupCmxCpTobMap(cp->tobs()); - setupCmxCpHitsMap(cp->hits()); + LVL1::TriggerTowerKey towerKey; + + // CPM tower map + ConstCpmTowerMap ttMap; + setupCpmTowerMap(cp->towers(), ttMap, towerKey); + + // CMX-CP TOB map + ConstCmxCpTobMap tobMap; + setupCmxCpTobMap(cp->tobs(), tobMap); + + // CMX-CP hits map + ConstCmxCpHitsMap hitsMap; + setupCmxCpHitsMap(cp->hits(), hitsMap); // Loop over data @@ -254,7 +251,11 @@ StatusCode CpByteStreamV2Tool::convert(const LVL1::CPBSCollectionV2 *const cp, // Get number of CPM slices and triggered slice offset // for this slink if ( ! slinkSlices(crate, module, modulesPerSlink, - timeslices, trigCpm)) + timeslices, trigCpm, + ttMap, + tobMap, + hitsMap, + towerKey)) { msg(MSG::ERROR) << "Inconsistent number of slices or " << "triggered slice offsets in data for crate " @@ -276,23 +277,22 @@ StatusCode CpByteStreamV2Tool::convert(const LVL1::CPBSCollectionV2 *const cp, } L1CaloUserHeader userHeader; userHeader.setCpm(trigCpmNew); - const uint32_t rodIdCpm = m_srcIdMap->getRodID(hwCrate, slink, daqOrRoi, + const uint32_t rodIdCpm = m_srcIdMap.getRodID(hwCrate, slink, daqOrRoi, m_subDetector); - theROD = m_fea->getRodData(rodIdCpm); + theROD = fea.getRodData(rodIdCpm); theROD->push_back(userHeader.header()); - m_rodStatusMap.insert(make_pair(rodIdCpm, m_rodStatus)); } if (debug) msg() << "Module " << module << endmsg; // Create a sub-block for each slice (except Neutral format) - m_cpmBlocks.clear(); + DataVector<CpmSubBlockV2> cpmBlocks; for (int slice = 0; slice < timeslicesNew; ++slice) { CpmSubBlockV2 *const subBlock = new CpmSubBlockV2(); subBlock->setCpmHeader(m_version, m_dataFormat, slice, hwCrate, module, timeslicesNew); - m_cpmBlocks.push_back(subBlock); + cpmBlocks.push_back(subBlock); if (neutralFormat) break; } @@ -306,8 +306,8 @@ StatusCode CpByteStreamV2Tool::convert(const LVL1::CPBSCollectionV2 *const cp, int layer = 0; if (m_cpmMaps->mapping(crate, module, chan, eta, phi, layer)) { - const unsigned int key = m_towerKey->ttKey(phi, eta); - const LVL1::CPMTower *const tt = findCpmTower(key); + const unsigned int key = towerKey.ttKey(phi, eta); + const LVL1::CPMTower *const tt = findCpmTower(key, ttMap); if (tt ) { std::vector<int> emData; @@ -329,7 +329,7 @@ StatusCode CpByteStreamV2Tool::convert(const LVL1::CPBSCollectionV2 *const cp, (hadErrBits.get(LVL1::DataError::LinkDown) << 1) | hadErrBits.get(LVL1::DataError::Parity); const int index = ( neutralFormat ) ? 0 : slice; - CpmSubBlockV2 *const subBlock = m_cpmBlocks[index]; + CpmSubBlockV2 *const subBlock = cpmBlocks[index]; subBlock->fillTowerData(slice, chan, emData[slice], hadData[slice], emErr, hadErr); if ((emErrBits.error() >> LVL1::DataError::GLinkParity)) @@ -354,7 +354,7 @@ StatusCode CpByteStreamV2Tool::convert(const LVL1::CPBSCollectionV2 *const cp, // Pack and write the sub-blocks DataVector<CpmSubBlockV2>::iterator pos; - for (pos = m_cpmBlocks.begin(); pos != m_cpmBlocks.end(); ++pos) + for (pos = cpmBlocks.begin(); pos != cpmBlocks.end(); ++pos) { CpmSubBlockV2 *const subBlock = *pos; if ( !subBlock->pack()) @@ -378,7 +378,7 @@ StatusCode CpByteStreamV2Tool::convert(const LVL1::CPBSCollectionV2 *const cp, // Create a sub-block for each slice (except Neutral format) - m_cmxBlocks.clear(); + DataVector<CmxCpSubBlock> cmxBlocks; const int summing = (crate == m_crates - 1) ? CmxSubBlock::SYSTEM : CmxSubBlock::CRATE; for (int slice = 0; slice < timeslicesNew; ++slice) @@ -386,7 +386,7 @@ StatusCode CpByteStreamV2Tool::convert(const LVL1::CPBSCollectionV2 *const cp, CmxCpSubBlock *const block = new CmxCpSubBlock(); block->setCmxHeader(m_version, m_dataFormat, slice, hwCrate, summing, CmxSubBlock::CMX_CP, cmx, timeslicesNew); - m_cmxBlocks.push_back(block); + cmxBlocks.push_back(block); if (neutralFormat) break; } @@ -399,7 +399,8 @@ StatusCode CpByteStreamV2Tool::convert(const LVL1::CPBSCollectionV2 *const cp, for (int loc = 0; loc < m_locs; ++loc) { const int key = tobKey(crate, cmx, cpm, chip, loc); - const LVL1::CMXCPTob *const ct = findCmxCpTob(key); + const LVL1::CMXCPTob *const ct = findCmxCpTob(key, + tobMap); if ( ct ) { std::vector<int> energy; @@ -420,7 +421,7 @@ StatusCode CpByteStreamV2Tool::convert(const LVL1::CPBSCollectionV2 *const cp, err |= (errBits.get(LVL1::DataError::ParityPhase3)) << 4; err |= (errBits.get(LVL1::DataError::Overflow)) << 5; const int index = ( neutralFormat ) ? 0 : slice; - CmxCpSubBlock *const subBlock = m_cmxBlocks[index]; + CmxCpSubBlock *const subBlock = cmxBlocks[index]; subBlock->setTob(slice, cpm, chip, loc, energy[slice], isolation[slice], err); subBlock->setPresenceMap(slice, cpm, presence[slice]); @@ -435,7 +436,7 @@ StatusCode CpByteStreamV2Tool::convert(const LVL1::CPBSCollectionV2 *const cp, for (int source = 0; source < LVL1::CMXCPHits::MAXSOURCE; ++source) { const int key = hitsKey(crate, cmx, source); - const LVL1::CMXCPHits *const ch = findCmxCpHits(key); + const LVL1::CMXCPHits *const ch = findCmxCpHits(key, hitsMap); if ( ch ) { std::vector<unsigned int> hits0; @@ -451,7 +452,7 @@ StatusCode CpByteStreamV2Tool::convert(const LVL1::CPBSCollectionV2 *const cp, const LVL1::DataError err0Bits(err0[slice]); const LVL1::DataError err1Bits(err1[slice]); const int index = ( neutralFormat ) ? 0 : slice; - CmxCpSubBlock *const subBlock = m_cmxBlocks[index]; + CmxCpSubBlock *const subBlock = cmxBlocks[index]; subBlock->setHits(slice, source, 0, hits0[slice], // Assuming CMXCPHits::source == CmxCpSubBlock::source err0Bits.get(LVL1::DataError::Parity)); subBlock->setHits(slice, source, 1, hits1[slice], @@ -464,7 +465,7 @@ StatusCode CpByteStreamV2Tool::convert(const LVL1::CPBSCollectionV2 *const cp, } } } - for (CmxCpSubBlock* subBlock : m_cmxBlocks) + for (CmxCpSubBlock* subBlock : cmxBlocks) { if ( !subBlock->pack()) { @@ -483,55 +484,65 @@ StatusCode CpByteStreamV2Tool::convert(const LVL1::CPBSCollectionV2 *const cp, // Fill the raw event - m_fea->fill(re, msg()); - - // Set ROD status words - - //L1CaloRodStatus::setStatus(re, m_rodStatusMap, m_srcIdMap); + fea.fill(re, msg()); return StatusCode::SUCCESS; } // Return reference to vector with all possible Source Identifiers -const std::vector<uint32_t> &CpByteStreamV2Tool::sourceIDs( - const std::string &sgKey) +std::vector<uint32_t> CpByteStreamV2Tool::makeSourceIDs() const { - // Check if overlap tower channels wanted - const std::string flag("Overlap"); - const std::string::size_type pos = sgKey.find(flag); - m_coreOverlap = - (pos == std::string::npos || pos != sgKey.length() - flag.length()) ? 0 : 1; - - if (m_sourceIDs.empty()) + std::vector<uint32_t> sourceIDs; + + if (!m_sourceIDsProp.empty()) { + sourceIDs = m_sourceIDsProp; + } + else { + const int maxCrates = m_crates + m_crateOffsetHw; + const int maxSlinks = m_srcIdMap.maxSlinks(); + for (int hwCrate = m_crateOffsetHw; hwCrate < maxCrates; ++hwCrate) { - const int maxCrates = m_crates + m_crateOffsetHw; - const int maxSlinks = m_srcIdMap->maxSlinks(); - for (int hwCrate = m_crateOffsetHw; hwCrate < maxCrates; ++hwCrate) - { - for (int slink = 0; slink < maxSlinks; ++slink) - { - const int daqOrRoi = 0; - const uint32_t rodId = m_srcIdMap->getRodID(hwCrate, slink, daqOrRoi, - m_subDetector); - const uint32_t robId = m_srcIdMap->getRobID(rodId); - m_sourceIDs.push_back(robId); - } - } + for (int slink = 0; slink < maxSlinks; ++slink) + { + const int daqOrRoi = 0; + const uint32_t rodId = m_srcIdMap.getRodID(hwCrate, slink, daqOrRoi, + m_subDetector); + const uint32_t robId = m_srcIdMap.getRobID(rodId); + sourceIDs.push_back(robId); + } } - return m_sourceIDs; + } + return sourceIDs; +} + +const std::vector<uint32_t> &CpByteStreamV2Tool::sourceIDs() const +{ + static const std::vector<uint32_t> sourceIDs = makeSourceIDs(); + return sourceIDs; } // Convert bytestream to given container type StatusCode CpByteStreamV2Tool::convertBs( + const std::string& sgKey, const IROBDataProviderSvc::VROBFRAG &robFrags, - CpByteStreamToolData& data) + CpByteStreamToolData& data) const { + LocalData ld; + + const std::string flag("Overlap"); + const std::string::size_type pos = sgKey.find(flag); + ld.coreOverlap = + (pos == std::string::npos || pos != sgKey.length() - flag.length()) ? 0 : 1; + const bool debug = msgLvl(MSG::DEBUG); if (debug) msg(MSG::DEBUG); - // Loop over ROB fragments + CmxCpSubBlock cmxCpSubBlock; + CpmSubBlockV2 cpmSubBlock; + + // Loop over ROB fragments int robCount = 0; std::set<uint32_t> dupCheck; @@ -582,12 +593,12 @@ StatusCode CpByteStreamV2Tool::convertBs( // Check identifier const uint32_t sourceID = (*rob)->rod_source_id(); - if (m_srcIdMap->getRobID(sourceID) != robid || - m_srcIdMap->subDet(sourceID) != m_subDetector || - m_srcIdMap->daqOrRoi(sourceID) != 0 || - (m_srcIdMap->slink(sourceID) != 0 && m_srcIdMap->slink(sourceID) != 2) || - m_srcIdMap->crate(sourceID) < m_crateOffsetHw || - m_srcIdMap->crate(sourceID) >= m_crateOffsetHw + m_crates) + if (m_srcIdMap.getRobID(sourceID) != robid || + m_srcIdMap.subDet(sourceID) != m_subDetector || + m_srcIdMap.daqOrRoi(sourceID) != 0 || + (m_srcIdMap.slink(sourceID) != 0 && m_srcIdMap.slink(sourceID) != 2) || + m_srcIdMap.crate(sourceID) < m_crateOffsetHw || + m_srcIdMap.crate(sourceID) >= m_crateOffsetHw + m_crates) { m_errorTool->rodError(robid, L1CaloSubBlock::ERROR_ROD_ID); if (debug) @@ -602,16 +613,16 @@ StatusCode CpByteStreamV2Tool::convertBs( // Check minor version const int minorVersion = (*rob)->rod_version() & 0xffff; - if (minorVersion <= m_srcIdMap->minorVersionPreLS1()) + if (minorVersion <= m_srcIdMap.minorVersionPreLS1()) { if (debug) msg() << "Skipping pre-LS1 data" << endmsg; continue; } - const int rodCrate = m_srcIdMap->crate(sourceID); + const int rodCrate = m_srcIdMap.crate(sourceID); if (debug) { msg() << "Treating crate " << rodCrate - << " slink " << m_srcIdMap->slink(sourceID) << endmsg; + << " slink " << m_srcIdMap.slink(sourceID) << endmsg; } // First word should be User Header @@ -643,13 +654,13 @@ StatusCode CpByteStreamV2Tool::convertBs( // Loop over sub-blocks - m_rodErr = L1CaloSubBlock::ERROR_NONE; + ld.rodErr = L1CaloSubBlock::ERROR_NONE; while (payload != payloadEnd) { if (L1CaloSubBlock::wordType(*payload) != L1CaloSubBlock::HEADER) { if (debug) msg() << "Unexpected data sequence" << endmsg; - m_rodErr = L1CaloSubBlock::ERROR_MISSING_HEADER; + ld.rodErr = L1CaloSubBlock::ERROR_MISSING_HEADER; break; } @@ -665,20 +676,20 @@ StatusCode CpByteStreamV2Tool::convertBs( // CMX if (CmxSubBlock::cmxType(*payload) == CmxSubBlock::CMX_CP) { - m_cmxCpSubBlock->clear(); - payload = m_cmxCpSubBlock->read(payload, payloadEnd); - if (m_cmxCpSubBlock->crate() != rodCrate) + cmxCpSubBlock.clear(); + payload = cmxCpSubBlock.read(payload, payloadEnd); + if (cmxCpSubBlock.crate() != rodCrate) { if (debug) msg() << "Inconsistent crate number in ROD source ID" << endmsg; - m_rodErr = L1CaloSubBlock::ERROR_CRATE_NUMBER; + ld.rodErr = L1CaloSubBlock::ERROR_CRATE_NUMBER; break; } if (data.m_collection == CMX_CP_TOBS || data.m_collection == CMX_CP_HITS) { - decodeCmxCp(m_cmxCpSubBlock, trigCpm, data); - if (m_rodErr != L1CaloSubBlock::ERROR_NONE) + decodeCmxCp(&cmxCpSubBlock, trigCpm, data, ld); + if (ld.rodErr != L1CaloSubBlock::ERROR_NONE) { if (debug) msg() << "decodeCmxCp failed" << endmsg; break; @@ -688,26 +699,26 @@ StatusCode CpByteStreamV2Tool::convertBs( else { if (debug) msg() << "Invalid CMX type in module field" << endmsg; - m_rodErr = L1CaloSubBlock::ERROR_MODULE_NUMBER; + ld.rodErr = L1CaloSubBlock::ERROR_MODULE_NUMBER; break; } } else { // CPM - m_cpmSubBlock->clear(); - payload = m_cpmSubBlock->read(payload, payloadEnd); - if (m_cpmSubBlock->crate() != rodCrate) + cpmSubBlock.clear(); + payload = cpmSubBlock.read(payload, payloadEnd); + if (cpmSubBlock.crate() != rodCrate) { if (debug) msg() << "Inconsistent crate number in ROD source ID" << endmsg; - m_rodErr = L1CaloSubBlock::ERROR_CRATE_NUMBER; + ld.rodErr = L1CaloSubBlock::ERROR_CRATE_NUMBER; break; } if (data.m_collection == CPM_TOWERS) { - decodeCpm(m_cpmSubBlock, trigCpm, static_cast<CpmTowerData&>(data)); - if (m_rodErr != L1CaloSubBlock::ERROR_NONE) + decodeCpm(&cpmSubBlock, trigCpm, static_cast<CpmTowerData&>(data), ld); + if (ld.rodErr != L1CaloSubBlock::ERROR_NONE) { if (debug) msg() << "decodeCpm failed" << endmsg; break; @@ -715,9 +726,9 @@ StatusCode CpByteStreamV2Tool::convertBs( } } } - if (m_rodErr != L1CaloSubBlock::ERROR_NONE) + if (ld.rodErr != L1CaloSubBlock::ERROR_NONE) { - m_errorTool->rodError(robid, m_rodErr); + m_errorTool->rodError(robid, ld.rodErr); } } return StatusCode::SUCCESS; @@ -726,7 +737,8 @@ StatusCode CpByteStreamV2Tool::convertBs( // Unpack CMX-CP sub-block void CpByteStreamV2Tool::decodeCmxCp(CmxCpSubBlock *subBlock, int trigCpm, - CpByteStreamToolData& data) + CpByteStreamToolData& data, + LocalData& ld) const { const bool debug = msgLvl(MSG::DEBUG); if (debug) msg(MSG::DEBUG); @@ -752,14 +764,14 @@ void CpByteStreamV2Tool::decodeCmxCp(CmxCpSubBlock *subBlock, int trigCpm, if (debug) msg() << "Triggered slice from header " << "inconsistent with number of slices: " << trigCpm << ", " << timeslices << endmsg; - m_rodErr = L1CaloSubBlock::ERROR_SLICES; + ld.rodErr = L1CaloSubBlock::ERROR_SLICES; return; } if (timeslices <= sliceNum) { if (debug) msg() << "Total slices inconsistent with slice number: " << timeslices << ", " << sliceNum << endmsg; - m_rodErr = L1CaloSubBlock::ERROR_SLICES; + ld.rodErr = L1CaloSubBlock::ERROR_SLICES; return; } // Unpack sub-block @@ -770,7 +782,7 @@ void CpByteStreamV2Tool::decodeCmxCp(CmxCpSubBlock *subBlock, int trigCpm, std::string errMsg(subBlock->unpackErrorMsg()); msg() << "CMX-CP sub-block unpacking failed: " << errMsg << endmsg; } - m_rodErr = subBlock->unpackErrorCode(); + ld.rodErr = subBlock->unpackErrorCode(); return; } @@ -821,47 +833,47 @@ void CpByteStreamV2Tool::decodeCmxCp(CmxCpSubBlock *subBlock, int trigCpm, LVL1::CMXCPTob *tb = findCmxCpTob(tdata, key); if ( ! tb ) // create new CMX TOB { - m_energyVec.assign(timeslices, 0); - m_isolVec.assign(timeslices, 0); - m_errorVec.assign(timeslices, 0); - m_presenceMapVec.assign(timeslices, 0); - m_energyVec[slice] = energy; - m_isolVec[slice] = isolation; - m_errorVec[slice] = error; - m_presenceMapVec[slice] = presenceMap; + ld.energyVec.assign(timeslices, 0); + ld.isolVec.assign(timeslices, 0); + ld.errorVec.assign(timeslices, 0); + ld.presenceMapVec.assign(timeslices, 0); + ld.energyVec[slice] = energy; + ld.isolVec[slice] = isolation; + ld.errorVec[slice] = error; + ld.presenceMapVec[slice] = presenceMap; auto tbp = std::make_unique<LVL1::CMXCPTob>(swCrate, cmx, cpm, chip, loc, - m_energyVec, m_isolVec, m_errorVec, - m_presenceMapVec, trigCpm); + ld.energyVec, ld.isolVec, ld.errorVec, + ld.presenceMapVec, trigCpm); tdata.m_tobMap.insert(std::make_pair(key, tbp.get())); tdata.m_tobCollection->push_back(std::move(tbp)); } else { - m_energyVec = tb->energyVec(); - m_isolVec = tb->isolationVec(); - m_errorVec = tb->errorVec(); - m_presenceMapVec = tb->presenceMapVec(); - const int nsl = m_energyVec.size(); + ld.energyVec = tb->energyVec(); + ld.isolVec = tb->isolationVec(); + ld.errorVec = tb->errorVec(); + ld.presenceMapVec = tb->presenceMapVec(); + const int nsl = ld.energyVec.size(); if (timeslices != nsl) { if (debug) msg() << "Inconsistent number of slices in sub-blocks" << endmsg; - m_rodErr = L1CaloSubBlock::ERROR_SLICES; + ld.rodErr = L1CaloSubBlock::ERROR_SLICES; return; } - if (m_energyVec[slice] != 0 || m_isolVec[slice] != 0 || - m_errorVec[slice] != 0) + if (ld.energyVec[slice] != 0 || ld.isolVec[slice] != 0 || + ld.errorVec[slice] != 0) { if (debug) msg() << "Duplicate data for slice " << slice << endmsg; - m_rodErr = L1CaloSubBlock::ERROR_DUPLICATE_DATA; + ld.rodErr = L1CaloSubBlock::ERROR_DUPLICATE_DATA; return; } - m_energyVec[slice] = energy; - m_isolVec[slice] = isolation; - m_errorVec[slice] = error; - m_presenceMapVec[slice] = presenceMap; - tb->addTob(m_energyVec, m_isolVec, m_errorVec, m_presenceMapVec); + ld.energyVec[slice] = energy; + ld.isolVec[slice] = isolation; + ld.errorVec[slice] = error; + ld.presenceMapVec[slice] = presenceMap; + tb->addTob(ld.energyVec, ld.isolVec, ld.errorVec, ld.presenceMapVec); } } } @@ -899,47 +911,47 @@ void CpByteStreamV2Tool::decodeCmxCp(CmxCpSubBlock *subBlock, int trigCpm, LVL1::CMXCPHits *ch = findCmxCpHits(hdata, key); if ( ! ch ) // create new CMX hits { - m_hitsVec0.assign(timeslices, 0); - m_hitsVec1.assign(timeslices, 0); - m_errVec0.assign(timeslices, 0); - m_errVec1.assign(timeslices, 0); - m_hitsVec0[slice] = hits0; - m_hitsVec1[slice] = hits1; - m_errVec0[slice] = err0; - m_errVec1[slice] = err1; + ld.hitsVec0.assign(timeslices, 0); + ld.hitsVec1.assign(timeslices, 0); + ld.errVec0.assign(timeslices, 0); + ld.errVec1.assign(timeslices, 0); + ld.hitsVec0[slice] = hits0; + ld.hitsVec1[slice] = hits1; + ld.errVec0[slice] = err0; + ld.errVec1[slice] = err1; auto chp = std::make_unique<LVL1::CMXCPHits>(swCrate, cmx, source, - m_hitsVec0, m_hitsVec1, - m_errVec0, m_errVec1, trigCpm); + ld.hitsVec0, ld.hitsVec1, + ld.errVec0, ld.errVec1, trigCpm); hdata.m_hitsMap.insert(std::make_pair(key, chp.get())); hdata.m_hitCollection->push_back(std::move(chp)); } else { - m_hitsVec0 = ch->hitsVec0(); - m_hitsVec1 = ch->hitsVec1(); - m_errVec0 = ch->errorVec0(); - m_errVec1 = ch->errorVec1(); - const int nsl = m_hitsVec0.size(); + ld.hitsVec0 = ch->hitsVec0(); + ld.hitsVec1 = ch->hitsVec1(); + ld.errVec0 = ch->errorVec0(); + ld.errVec1 = ch->errorVec1(); + const int nsl = ld.hitsVec0.size(); if (timeslices != nsl) { if (debug) msg() << "Inconsistent number of slices in sub-blocks" << endmsg; - m_rodErr = L1CaloSubBlock::ERROR_SLICES; + ld.rodErr = L1CaloSubBlock::ERROR_SLICES; return; } - if (m_hitsVec0[slice] != 0 || m_hitsVec1[slice] != 0 || - m_errVec0[slice] != 0 || m_errVec1[slice] != 0) + if (ld.hitsVec0[slice] != 0 || ld.hitsVec1[slice] != 0 || + ld.errVec0[slice] != 0 || ld.errVec1[slice] != 0) { if (debug) msg() << "Duplicate data for slice " << slice << endmsg; - m_rodErr = L1CaloSubBlock::ERROR_DUPLICATE_DATA; + ld.rodErr = L1CaloSubBlock::ERROR_DUPLICATE_DATA; return; } - m_hitsVec0[slice] = hits0; - m_hitsVec1[slice] = hits1; - m_errVec0[slice] = err0; - m_errVec1[slice] = err1; - ch->addHits(m_hitsVec0, m_hitsVec1, m_errVec0, m_errVec1); + ld.hitsVec0[slice] = hits0; + ld.hitsVec1[slice] = hits1; + ld.errVec0[slice] = err0; + ld.errVec1[slice] = err1; + ch->addHits(ld.hitsVec0, ld.hitsVec1, ld.errVec0, ld.errVec1); } } } @@ -952,7 +964,8 @@ void CpByteStreamV2Tool::decodeCmxCp(CmxCpSubBlock *subBlock, int trigCpm, // Unpack CPM sub-block void CpByteStreamV2Tool::decodeCpm(CpmSubBlockV2 *subBlock, int trigCpm, - CpmTowerData& data) + CpmTowerData& data, + LocalData& ld) const { const bool debug = msgLvl(MSG::DEBUG); const bool verbose = msgLvl(MSG::VERBOSE); @@ -972,7 +985,7 @@ void CpByteStreamV2Tool::decodeCpm(CpmSubBlockV2 *subBlock, int trigCpm, if (module < 1 || module > m_modules) { if (debug) msg() << "Unexpected module number: " << module << endmsg; - m_rodErr = L1CaloSubBlock::ERROR_MODULE_NUMBER; + ld.rodErr = L1CaloSubBlock::ERROR_MODULE_NUMBER; return; } if (timeslices <= trigCpm) @@ -980,14 +993,14 @@ void CpByteStreamV2Tool::decodeCpm(CpmSubBlockV2 *subBlock, int trigCpm, if (debug) msg() << "Triggered slice from header " << "inconsistent with number of slices: " << trigCpm << ", " << timeslices << endmsg; - m_rodErr = L1CaloSubBlock::ERROR_SLICES; + ld.rodErr = L1CaloSubBlock::ERROR_SLICES; return; } if (timeslices <= sliceNum) { if (debug) msg() << "Total slices inconsistent with slice number: " << timeslices << ", " << sliceNum << endmsg; - m_rodErr = L1CaloSubBlock::ERROR_SLICES; + ld.rodErr = L1CaloSubBlock::ERROR_SLICES; return; } // Unpack sub-block @@ -998,7 +1011,7 @@ void CpByteStreamV2Tool::decodeCpm(CpmSubBlockV2 *subBlock, int trigCpm, std::string errMsg(subBlock->unpackErrorMsg()); msg() << "CPM sub-block unpacking failed: " << errMsg << endmsg; } - m_rodErr = subBlock->unpackErrorCode(); + ld.rodErr = subBlock->unpackErrorCode(); return; } @@ -1045,33 +1058,33 @@ void CpByteStreamV2Tool::decodeCpm(CpmSubBlockV2 *subBlock, int trigCpm, int layer = 0; if (m_cpmMaps->mapping(crate, module, chan, eta, phi, layer)) { - if (layer == m_coreOverlap) + if (layer == ld.coreOverlap) { - const unsigned int key = m_towerKey->ttKey(phi, eta); + const unsigned int key = ld.towerKey.ttKey(phi, eta); LVL1::CPMTower *tt = findCpmTower(data, key); if ( ! tt ) // create new CPM tower { - m_emVec.assign(timeslices, 0); - m_hadVec.assign(timeslices, 0); - m_emErrVec.assign(timeslices, 0); - m_hadErrVec.assign(timeslices, 0); - m_emVec[slice] = em; - m_hadVec[slice] = had; - m_emErrVec[slice] = emErr1; - m_hadErrVec[slice] = hadErr1; + ld.emVec.assign(timeslices, 0); + ld.hadVec.assign(timeslices, 0); + ld.emErrVec.assign(timeslices, 0); + ld.hadErrVec.assign(timeslices, 0); + ld.emVec[slice] = em; + ld.hadVec[slice] = had; + ld.emErrVec[slice] = emErr1; + ld.hadErrVec[slice] = hadErr1; auto ttp = - std::make_unique<LVL1::CPMTower>(phi, eta, m_emVec, m_emErrVec, - m_hadVec, m_hadErrVec, trigCpm); + std::make_unique<LVL1::CPMTower>(phi, eta, ld.emVec, ld.emErrVec, + ld.hadVec, ld.hadErrVec, trigCpm); data.m_ttMap.insert(std::make_pair(key, ttp.get())); data.m_ttCollection->push_back(std::move(ttp)); } else { - m_emVec = tt->emEnergyVec(); - m_hadVec = tt->hadEnergyVec(); - m_emErrVec = tt->emErrorVec(); - m_hadErrVec = tt->hadErrorVec(); - const int nsl = m_emVec.size(); + ld.emVec = tt->emEnergyVec(); + ld.hadVec = tt->hadEnergyVec(); + ld.emErrVec = tt->emErrorVec(); + ld.hadErrVec = tt->hadErrorVec(); + const int nsl = ld.emVec.size(); if (timeslices != nsl) { if (debug) @@ -1079,22 +1092,22 @@ void CpByteStreamV2Tool::decodeCpm(CpmSubBlockV2 *subBlock, int trigCpm, msg() << "Inconsistent number of slices in sub-blocks" << endmsg; } - m_rodErr = L1CaloSubBlock::ERROR_SLICES; + ld.rodErr = L1CaloSubBlock::ERROR_SLICES; return; } - if (m_emVec[slice] != 0 || m_hadVec[slice] != 0 || - m_emErrVec[slice] != 0 || m_hadErrVec[slice] != 0) + if (ld.emVec[slice] != 0 || ld.hadVec[slice] != 0 || + ld.emErrVec[slice] != 0 || ld.hadErrVec[slice] != 0) { if (debug) msg() << "Duplicate data for slice " << slice << endmsg; - m_rodErr = L1CaloSubBlock::ERROR_DUPLICATE_DATA; + ld.rodErr = L1CaloSubBlock::ERROR_DUPLICATE_DATA; return; } - m_emVec[slice] = em; - m_hadVec[slice] = had; - m_emErrVec[slice] = emErr1; - m_hadErrVec[slice] = hadErr1; - tt->fill(m_emVec, m_emErrVec, m_hadVec, m_hadErrVec, trigCpm); + ld.emVec[slice] = em; + ld.hadVec[slice] = had; + ld.emErrVec[slice] = emErr1; + ld.hadErrVec[slice] = hadErr1; + tt->fill(ld.emVec, ld.emErrVec, ld.hadVec, ld.hadErrVec, trigCpm); } } } @@ -1119,10 +1132,11 @@ void CpByteStreamV2Tool::decodeCpm(CpmSubBlockV2 *subBlock, int trigCpm, // Find a CPM tower for given key const -LVL1::CPMTower *CpByteStreamV2Tool::findCpmTower(const unsigned int key) const +LVL1::CPMTower *CpByteStreamV2Tool::findCpmTower(const unsigned int key, + const ConstCpmTowerMap& ttMap) const { - ConstCpmTowerMap::const_iterator mapIter = m_ttMap.find(key); - if (mapIter != m_ttMap.end()) return mapIter->second; + ConstCpmTowerMap::const_iterator mapIter = ttMap.find(key); + if (mapIter != ttMap.end()) return mapIter->second; return nullptr; } @@ -1137,10 +1151,11 @@ LVL1::CPMTower *CpByteStreamV2Tool::findCpmTower(const CpmTowerData& data, // Find CMX-CP TOB for given key const -LVL1::CMXCPTob *CpByteStreamV2Tool::findCmxCpTob(const int key) const +LVL1::CMXCPTob *CpByteStreamV2Tool::findCmxCpTob(const int key, + const ConstCmxCpTobMap& tobMap) const { - ConstCmxCpTobMap::const_iterator mapIter = m_tobMap.find(key); - if (mapIter != m_tobMap.end()) return mapIter->second; + ConstCmxCpTobMap::const_iterator mapIter = tobMap.find(key); + if (mapIter != tobMap.end()) return mapIter->second; return nullptr; } @@ -1155,10 +1170,11 @@ LVL1::CMXCPTob *CpByteStreamV2Tool::findCmxCpTob(const CmxCpTobData& data, // Find CMX-CP hits for given key const -LVL1::CMXCPHits *CpByteStreamV2Tool::findCmxCpHits(const int key) const +LVL1::CMXCPHits *CpByteStreamV2Tool::findCmxCpHits(const int key, + const ConstCmxCpHitsMap& hitsMap) const { - ConstCmxCpHitsMap::const_iterator mapIter = m_hitsMap.find(key); - if (mapIter != m_hitsMap.end()) return mapIter->second; + ConstCmxCpHitsMap::const_iterator mapIter = hitsMap.find(key); + if (mapIter != hitsMap.end()) return mapIter->second; return nullptr; } @@ -1173,9 +1189,11 @@ LVL1::CMXCPHits *CpByteStreamV2Tool::findCmxCpHits(const CmxCpHitsData& data, // Set up CPM tower map void CpByteStreamV2Tool::setupCpmTowerMap(const CpmTowerCollection * - const ttCollection) + const ttCollection, + ConstCpmTowerMap& ttMap, + LVL1::TriggerTowerKey& towerKey) const { - m_ttMap.clear(); + ttMap.clear(); if (ttCollection) { CpmTowerCollection::const_iterator pos = ttCollection->begin(); @@ -1183,8 +1201,8 @@ void CpByteStreamV2Tool::setupCpmTowerMap(const CpmTowerCollection * for (; pos != pose; ++pos) { const LVL1::CPMTower *const tt = *pos; - const unsigned int key = m_towerKey->ttKey(tt->phi(), tt->eta()); - m_ttMap.insert(std::make_pair(key, tt)); + const unsigned int key = towerKey.ttKey(tt->phi(), tt->eta()); + ttMap.insert(std::make_pair(key, tt)); } } } @@ -1192,9 +1210,10 @@ void CpByteStreamV2Tool::setupCpmTowerMap(const CpmTowerCollection * // Set up CMX-CP TOB map void CpByteStreamV2Tool::setupCmxCpTobMap(const CmxCpTobCollection * - const tobCollection) + const tobCollection, + ConstCmxCpTobMap& tobMap) const { - m_tobMap.clear(); + tobMap.clear(); if (tobCollection) { CmxCpTobCollection::const_iterator pos = tobCollection->begin(); @@ -1208,7 +1227,7 @@ void CpByteStreamV2Tool::setupCmxCpTobMap(const CmxCpTobCollection * const int chip = tob->chip(); const int loc = tob->location(); const int key = tobKey(crate, cmx, cpm, chip, loc); - m_tobMap.insert(std::make_pair(key, tob)); + tobMap.insert(std::make_pair(key, tob)); } } } @@ -1216,9 +1235,10 @@ void CpByteStreamV2Tool::setupCmxCpTobMap(const CmxCpTobCollection * // Set up CMX-CP hits map void CpByteStreamV2Tool::setupCmxCpHitsMap(const CmxCpHitsCollection * - const hitCollection) + const hitCollection, + ConstCmxCpHitsMap& hitsMap) const { - m_hitsMap.clear(); + hitsMap.clear(); if (hitCollection) { CmxCpHitsCollection::const_iterator pos = hitCollection->begin(); @@ -1230,7 +1250,7 @@ void CpByteStreamV2Tool::setupCmxCpHitsMap(const CmxCpHitsCollection * const int cmx = hits->cmx(); const int source = hits->source(); const int key = hitsKey(crate, cmx, source); - m_hitsMap.insert(std::make_pair(key, hits)); + hitsMap.insert(std::make_pair(key, hits)); } } } @@ -1254,7 +1274,11 @@ int CpByteStreamV2Tool::hitsKey(const int crate, const int cmx, // Get number of slices and triggered slice offset for next slink bool CpByteStreamV2Tool::slinkSlices(const int crate, const int module, - const int modulesPerSlink, int ×lices, int &trigCpm) + const int modulesPerSlink, int ×lices, int &trigCpm, + const ConstCpmTowerMap& ttMap, + const ConstCmxCpTobMap& tobMap, + const ConstCmxCpHitsMap& hitsMap, + LVL1::TriggerTowerKey& towerKey) const { int slices = -1; int trigC = m_dfltSlices / 2; @@ -1266,8 +1290,8 @@ bool CpByteStreamV2Tool::slinkSlices(const int crate, const int module, double phi = 0.; int layer = 0; if ( !m_cpmMaps->mapping(crate, mod, chan, eta, phi, layer)) continue; - const unsigned int key = m_towerKey->ttKey(phi, eta); - const LVL1::CPMTower *const tt = findCpmTower(key); + const unsigned int key = towerKey.ttKey(phi, eta); + const LVL1::CPMTower *const tt = findCpmTower(key, ttMap); if ( !tt ) continue; const int numdat = 4; std::vector<int> sums(numdat); @@ -1309,7 +1333,8 @@ bool CpByteStreamV2Tool::slinkSlices(const int crate, const int module, for (int loc = 0; loc < m_locs; ++loc) { const int key = tobKey(crate, cmx, cpm, chip, loc); - const LVL1::CMXCPTob *const tob = findCmxCpTob(key); + const LVL1::CMXCPTob *const tob = findCmxCpTob(key, + tobMap); if (tob) { const int numdat = 3; @@ -1342,7 +1367,9 @@ bool CpByteStreamV2Tool::slinkSlices(const int crate, const int module, for (int source = 0; source < LVL1::CMXCPHits::MAXSOURCE; ++source) { const int key = hitsKey(crate, cmx, source); - const LVL1::CMXCPHits *const hits = findCmxCpHits(key); + + const LVL1::CMXCPHits *const hits = findCmxCpHits(key, + hitsMap); if (hits) { const int numdat = 4; diff --git a/Trigger/TrigT1/TrigT1CaloByteStream/src/CpByteStreamV2Tool.h b/Trigger/TrigT1/TrigT1CaloByteStream/src/CpByteStreamV2Tool.h index 2843ffa580e9a3814d5bcab01475a682b5880902..b3653412790c6bece90a6095d00fee69cbd79216 100755 --- a/Trigger/TrigT1/TrigT1CaloByteStream/src/CpByteStreamV2Tool.h +++ b/Trigger/TrigT1/TrigT1CaloByteStream/src/CpByteStreamV2Tool.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ #ifndef TRIGT1CALOBYTESTREAM_CPBYTESTREAMV2TOOL_H @@ -11,6 +11,8 @@ #include <string> #include <vector> +#include "TrigT1CaloUtils/TriggerTowerKey.h" +#include "L1CaloSrcIdMap.h" #include "AthenaBaseComps/AthAlgTool.h" #include "ByteStreamCnvSvcBase/IROBDataProviderSvc.h" #include "ByteStreamData/RawEvent.h" @@ -58,31 +60,67 @@ class CpByteStreamV2Tool : public AthAlgTool { /// AlgTool InterfaceID static const InterfaceID& interfaceID(); - virtual StatusCode initialize(); - virtual StatusCode finalize(); + virtual StatusCode initialize() override; + virtual StatusCode finalize() override; /// Convert ROB fragments to CPM towers - StatusCode convert(const std::string& sgKey, DataVector<LVL1::CPMTower>* ttCollection); - StatusCode convert(const IROBDataProviderSvc::VROBFRAG& robFrags, - DataVector<LVL1::CPMTower>* ttCollection); + StatusCode convert(const std::string& sgKey, DataVector<LVL1::CPMTower>* ttCollection) const; + StatusCode convert(const std::string& sgKey, + const IROBDataProviderSvc::VROBFRAG& robFrags, + DataVector<LVL1::CPMTower>* ttCollection) const; /// Convert ROB fragments to CMX-CP TOBs StatusCode convert(const std::string& sgKey, - DataVector<LVL1::CMXCPTob>* tobCollection); - StatusCode convert(const IROBDataProviderSvc::VROBFRAG& robFrags, - DataVector<LVL1::CMXCPTob>* tobCollection); + DataVector<LVL1::CMXCPTob>* tobCollection) const; + StatusCode convert(const std::string& sgKey, + const IROBDataProviderSvc::VROBFRAG& robFrags, + DataVector<LVL1::CMXCPTob>* tobCollection) const; /// Convert ROB fragments to CMX-CP hits StatusCode convert(const std::string& sgKey, - DataVector<LVL1::CMXCPHits>* hitCollection); - StatusCode convert(const IROBDataProviderSvc::VROBFRAG& robFrags, - DataVector<LVL1::CMXCPHits>* hitCollection); + DataVector<LVL1::CMXCPHits>* hitCollection) const; + StatusCode convert(const std::string& sgKey, + const IROBDataProviderSvc::VROBFRAG& robFrags, + DataVector<LVL1::CMXCPHits>* hitCollection) const; /// Convert CP Container to bytestream - StatusCode convert(const LVL1::CPBSCollectionV2* cp, RawEventWrite* re); + StatusCode convert(const LVL1::CPBSCollectionV2* cp, RawEventWrite* re) const; /// Return reference to vector with all possible Source Identifiers - const std::vector<uint32_t>& sourceIDs(const std::string& sgKey); + const std::vector<uint32_t>& sourceIDs() const; private: + struct LocalData + { + /// Tower channels to accept (1=Core, 2=Overlap) + int coreOverlap = 0; + /// Unpacking error code + unsigned int rodErr = 0; + /// Energy vector for unpacking + std::vector<int> energyVec; + /// Isolation vector for unpacking + std::vector<int> isolVec; + /// TOB error vector for unpacking + std::vector<int> errorVec; + /// Presence map vector for unpacking + std::vector<unsigned int> presenceMapVec; + /// Hits0 vector for unpacking + std::vector<unsigned int> hitsVec0; + /// Hits1 vector for unpacking + std::vector<unsigned int> hitsVec1; + /// Error0 vector for unpacking + std::vector<int> errVec0; + /// Error1 vector for unpacking + std::vector<int> errVec1; + /// EM data vector for unpacking + std::vector<int> emVec; + /// Had data vector for unpacking + std::vector<int> hadVec; + /// EM error data vector for unpacking + std::vector<int> emErrVec; + /// Had error data vector for unpacking + std::vector<int> hadErrVec; + /// Trigger tower key provider + LVL1::TriggerTowerKey towerKey; + }; enum CollectionType { CPM_TOWERS, CMX_CP_TOBS, CMX_CP_HITS }; @@ -127,30 +165,43 @@ class CpByteStreamV2Tool : public AthAlgTool { CmxCpHitsMap m_hitsMap; }; + /// Create list of all source IDs. + std::vector<uint32_t> makeSourceIDs() const; + /// Convert bytestream to given container type - StatusCode convertBs(const IROBDataProviderSvc::VROBFRAG& robFrags, - CpByteStreamToolData& data); + StatusCode convertBs(const std::string& sgKey, + const IROBDataProviderSvc::VROBFRAG& robFrags, + CpByteStreamToolData& data) const; /// Unpack CMX-CP sub-block - void decodeCmxCp(CmxCpSubBlock* subBlock, int trigCpm, CpByteStreamToolData& data); + void decodeCmxCp(CmxCpSubBlock* subBlock, int trigCpm, CpByteStreamToolData& data, + LocalData& ld) const; /// Unpack CPM sub-block - void decodeCpm(CpmSubBlockV2* subBlock, int trigCpm, CpmTowerData& data); + void decodeCpm(CpmSubBlockV2* subBlock, int trigCpm, CpmTowerData& data, + LocalData& ld) const; /// Find a CPM tower for given key - const LVL1::CPMTower* findCpmTower(unsigned int key) const; + const LVL1::CPMTower* findCpmTower(unsigned int key, + const ConstCpmTowerMap& ttMap) const; LVL1::CPMTower* findCpmTower(const CpmTowerData& data, unsigned int key) const; /// Find CMX-CP TOB for given key - const LVL1::CMXCPTob* findCmxCpTob(int key) const; + const LVL1::CMXCPTob* findCmxCpTob(int key, + const ConstCmxCpTobMap& tobMap) const; LVL1::CMXCPTob* findCmxCpTob(const CmxCpTobData& data, int key) const; /// Find CMX-CP hits for given key - const LVL1::CMXCPHits* findCmxCpHits(int key) const; + const LVL1::CMXCPHits* findCmxCpHits(int key, + const ConstCmxCpHitsMap& hitsMap) const; LVL1::CMXCPHits* findCmxCpHits(const CmxCpHitsData& data, int key) const; /// Set up CPM tower map - void setupCpmTowerMap(const CpmTowerCollection* ttCollection); + void setupCpmTowerMap(const CpmTowerCollection* ttCollection, + ConstCpmTowerMap& ttMap, + LVL1::TriggerTowerKey& towerKey) const; /// Set up CMX-CP TOB map - void setupCmxCpTobMap(const CmxCpTobCollection* tobCollection); + void setupCmxCpTobMap(const CmxCpTobCollection* tobCollection, + ConstCmxCpTobMap& tobMap) const; /// Set up CMX-CP hits map - void setupCmxCpHitsMap(const CmxCpHitsCollection* hitCollection); + void setupCmxCpHitsMap(const CmxCpHitsCollection* hitCollection, + ConstCmxCpHitsMap& hitsMap) const; /// Key for TOBs int tobKey(int crate, int cmx, int cpm, int chip, int loc) const; @@ -159,101 +210,55 @@ class CpByteStreamV2Tool : public AthAlgTool { /// Get number of slices and triggered slice offset for next slink bool slinkSlices(int crate, int module, int modulesPerSlink, - int& timeslices, int& trigJem); + int& timeslices, int& trigJem, + const ConstCpmTowerMap& ttMap, + const ConstCmxCpTobMap& tobMap, + const ConstCmxCpHitsMap& hitsMap, + LVL1::TriggerTowerKey& towerKey) const; /// Channel mapping tool ToolHandle<LVL1::IL1CaloMappingTool> m_cpmMaps; /// Error collection tool ToolHandle<LVL1BS::L1CaloErrorByteStreamTool> m_errorTool; ServiceHandle<IROBDataProviderSvc> m_robDataProvider; - /// Hardware crate number offset + /// Property: Hardware crate number offset int m_crateOffsetHw; - /// Software crate number offset + /// Property: Software crate number offset int m_crateOffsetSw; - /// Sub_block header version + /// Property: Sub_block header version int m_version; - /// Data compression format + /// Property: Data compression format int m_dataFormat; /// Number of channels per module - int m_channels; - /// Number of crates + const int m_channels; + /// Property: Number of crates int m_crates; /// Number of CPM modules per crate - int m_modules; + const int m_modules; /// Number of CMXs per crate - int m_cmxs; + const int m_cmxs; /// Maximum number of TOBS per module - int m_maxTobs; + const int m_maxTobs; /// Number of chips - int m_chips; + const int m_chips; /// Number of Local coordinates - int m_locs; - /// Number of slinks per crate when writing out bytestream + const int m_locs; + /// Property: Number of slinks per crate when writing out bytestream int m_slinks; - /// Default number of slices in simulation + /// Property: Default number of slices in simulation int m_dfltSlices; - /// Force number of slices in bytestream + /// Property: Force number of slices in bytestream int m_forceSlices; - /// Minimum crate number when writing out bytestream + /// Property: Minimum crate number when writing out bytestream int m_crateMin; - /// Maximum crate number when writing out bytestream + /// Property: Maximum crate number when writing out bytestream int m_crateMax; - /// Tower channels to accept (1=Core, 2=Overlap) - int m_coreOverlap; - /// Unpacking error code - unsigned int m_rodErr; - /// ROB source IDs - std::vector<uint32_t> m_sourceIDs; /// Sub-detector type - eformat::SubDetector m_subDetector; + const eformat::SubDetector m_subDetector; /// Source ID converter - L1CaloSrcIdMap* m_srcIdMap; - /// Trigger tower key provider - LVL1::TriggerTowerKey* m_towerKey; - /// CPM sub-block for unpacking - CpmSubBlockV2* m_cpmSubBlock; - /// CMX-CP sub-block for unpacking - CmxCpSubBlock* m_cmxCpSubBlock; - /// Energy vector for unpacking - std::vector<int> m_energyVec; - /// Isolation vector for unpacking - std::vector<int> m_isolVec; - /// TOB error vector for unpacking - std::vector<int> m_errorVec; - /// Presence map vector for unpacking - std::vector<unsigned int> m_presenceMapVec; - /// Hits0 vector for unpacking - std::vector<unsigned int> m_hitsVec0; - /// Hits1 vector for unpacking - std::vector<unsigned int> m_hitsVec1; - /// Error0 vector for unpacking - std::vector<int> m_errVec0; - /// Error1 vector for unpacking - std::vector<int> m_errVec1; - /// EM data vector for unpacking - std::vector<int> m_emVec; - /// Had data vector for unpacking - std::vector<int> m_hadVec; - /// EM error data vector for unpacking - std::vector<int> m_emErrVec; - /// Had error data vector for unpacking - std::vector<int> m_hadErrVec; - /// Vector for current CPM sub-blocks - DataVector<CpmSubBlockV2> m_cpmBlocks; - /// Vector for current CMX-CP sub-blocks - DataVector<CmxCpSubBlock> m_cmxBlocks; - /// CPM tower map - ConstCpmTowerMap m_ttMap; - /// CMX-CP TOB map - ConstCmxCpTobMap m_tobMap; - /// CMX-CP hits map - ConstCmxCpHitsMap m_hitsMap; - /// ROD Status words - std::vector<uint32_t>* m_rodStatus; - /// ROD status map - std::map<uint32_t, std::vector<uint32_t>* > m_rodStatusMap; - /// Event assembler - FullEventAssembler<L1CaloSrcIdMap>* m_fea; + const L1CaloSrcIdMap m_srcIdMap; + /// Property: ROB source IDs + std::vector<uint32_t> m_sourceIDsProp; }; } // end namespace diff --git a/Trigger/TrigT1/TrigT1CaloByteStream/src/CpReadByteStreamV1V2Cnv.cxx b/Trigger/TrigT1/TrigT1CaloByteStream/src/CpReadByteStreamV1V2Cnv.cxx index 9a5b91ff89914788fcc164694c10567c73ce15ac..5cf6b9e8070901a85affc52592cc0e0805751a13 100644 --- a/Trigger/TrigT1/TrigT1CaloByteStream/src/CpReadByteStreamV1V2Cnv.cxx +++ b/Trigger/TrigT1/TrigT1CaloByteStream/src/CpReadByteStreamV1V2Cnv.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ @@ -117,7 +117,7 @@ StatusCode CpReadByteStreamV1V2Cnv::createObj( IOpaqueAddress* pAddr, // get SourceIDs const std::vector<uint32_t>& vID1(m_tool1->sourceIDs(nm)); - const std::vector<uint32_t>& vID2(m_tool2->sourceIDs(nm)); + const std::vector<uint32_t>& vID2(m_tool2->sourceIDs()); // get ROB fragments IROBDataProviderSvc::VROBFRAG robFrags1; @@ -147,7 +147,7 @@ StatusCode CpReadByteStreamV1V2Cnv::createObj( IOpaqueAddress* pAddr, } // Post-LS1 data if (robFrags2.size() > 0) { - StatusCode sc = m_tool2->convert(robFrags2, towerCollection); + StatusCode sc = m_tool2->convert(nm, robFrags2, towerCollection); if ( sc.isFailure() ) { m_log << MSG::ERROR << " Failed to create Objects " << nm << endmsg; delete towerCollection; diff --git a/Trigger/TrigT1/TrigT1CaloByteStream/src/L1CaloSrcIdMap.cxx b/Trigger/TrigT1/TrigT1CaloByteStream/src/L1CaloSrcIdMap.cxx index a74dd44723e7fbd9dd5dc8ff0c6c31f1477043ff..65d55d9ea2c59b2f2b85723950316608c036a81a 100755 --- a/Trigger/TrigT1/TrigT1CaloByteStream/src/L1CaloSrcIdMap.cxx +++ b/Trigger/TrigT1/TrigT1CaloByteStream/src/L1CaloSrcIdMap.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ @@ -14,7 +14,7 @@ L1CaloSrcIdMap::L1CaloSrcIdMap() // Make a ROD Source ID uint32_t L1CaloSrcIdMap::getRodID(int crate, int slink, int daqOrRoi, - eformat::SubDetector subdet) + eformat::SubDetector subdet) const { // module ID = r0sscccc (ROD-spec-version1_06d, P33) uint16_t moduleId = (daqOrRoi << 7) | (slink << 4) | crate; @@ -24,14 +24,14 @@ uint32_t L1CaloSrcIdMap::getRodID(int crate, int slink, int daqOrRoi, // Make a ROB Source ID from a ROD source ID -uint32_t L1CaloSrcIdMap::getRobID(uint32_t rod_id) +uint32_t L1CaloSrcIdMap::getRobID(uint32_t rod_id) const { return rod_id; } // Make a ROS Source ID from a ROB source ID -uint32_t L1CaloSrcIdMap::getRosID(uint32_t rob_id) +uint32_t L1CaloSrcIdMap::getRosID(uint32_t rob_id) const { eformat::helper::SourceIdentifier id(rob_id); eformat::helper::SourceIdentifier id2(id.subdetector_id(), 0); @@ -40,7 +40,7 @@ uint32_t L1CaloSrcIdMap::getRosID(uint32_t rob_id) // Make a SubDetector ID from ROS source ID -uint32_t L1CaloSrcIdMap::getDetID(uint32_t ros_id) +uint32_t L1CaloSrcIdMap::getDetID(uint32_t ros_id) const { eformat::helper::SourceIdentifier id(ros_id); eformat::helper::SourceIdentifier id2(id.subdetector_id(), 0); @@ -49,7 +49,7 @@ uint32_t L1CaloSrcIdMap::getDetID(uint32_t ros_id) // Return crate from unpacked moduleID -int L1CaloSrcIdMap::crate(uint32_t code) +int L1CaloSrcIdMap::crate(uint32_t code) const { eformat::helper::SourceIdentifier id(code); return id.module_id() & 0xf; @@ -57,7 +57,7 @@ int L1CaloSrcIdMap::crate(uint32_t code) // Return daqOrRoi from unpacked moduleID -int L1CaloSrcIdMap::daqOrRoi(uint32_t code) +int L1CaloSrcIdMap::daqOrRoi(uint32_t code) const { eformat::helper::SourceIdentifier id(code); return (id.module_id() >> 7) & 0x1; @@ -65,7 +65,7 @@ int L1CaloSrcIdMap::daqOrRoi(uint32_t code) // Return slink from unpacked moduleID -int L1CaloSrcIdMap::slink(uint32_t code) +int L1CaloSrcIdMap::slink(uint32_t code) const { eformat::helper::SourceIdentifier id(code); return (id.module_id() >> 4) & 0x3; @@ -74,14 +74,14 @@ int L1CaloSrcIdMap::slink(uint32_t code) // Return the maximum possible number of slinks given number of // bits in module ID -int L1CaloSrcIdMap::maxSlinks() +int L1CaloSrcIdMap::maxSlinks() const { return 4; } // Return sub-detector for given ID -eformat::SubDetector L1CaloSrcIdMap::subDet(uint32_t code) { +eformat::SubDetector L1CaloSrcIdMap::subDet(uint32_t code) const { eformat::helper::SourceIdentifier id(code); return id.subdetector_id(); } diff --git a/Trigger/TrigT1/TrigT1CaloByteStream/src/L1CaloSrcIdMap.h b/Trigger/TrigT1/TrigT1CaloByteStream/src/L1CaloSrcIdMap.h index 329f47eabcd791298a6f7dc89aff3826ff2ee7d1..8badc9f824dbf5d3ac36282f82ed103644768337 100755 --- a/Trigger/TrigT1/TrigT1CaloByteStream/src/L1CaloSrcIdMap.h +++ b/Trigger/TrigT1/TrigT1CaloByteStream/src/L1CaloSrcIdMap.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ #ifndef TRIGT1CALOBYTESTREAM_L1CALOSRCIDMAP_H @@ -26,37 +26,37 @@ public: /// Make a ROD Source ID uint32_t getRodID (int crate, int slink, int daqOrRoi, - eformat::SubDetector subdet); + eformat::SubDetector subdet) const; /// Make a ROB Source ID from a ROD source ID - uint32_t getRobID (uint32_t rod_id); + uint32_t getRobID (uint32_t rod_id) const; /// Make a ROS Source ID from a ROB source ID - uint32_t getRosID (uint32_t rob_id); + uint32_t getRosID (uint32_t rob_id) const; /// Make a SubDetector ID from ROS source ID - uint32_t getDetID (uint32_t ros_id); + uint32_t getDetID (uint32_t ros_id) const; /// Return crate from unpacked moduleID - int crate(uint32_t code); + int crate(uint32_t code) const; /// Return daqOrRoi from unpacked moduleID - int daqOrRoi(uint32_t code); + int daqOrRoi(uint32_t code) const; /// Return slink from unpacked moduleID - int slink(uint32_t code); + int slink(uint32_t code) const; /// Return the maximum possible number of slinks - int maxSlinks(); + int maxSlinks() const; /// Return sub-detector for given ID - eformat::SubDetector subDet(uint32_t code); + eformat::SubDetector subDet(uint32_t code) const; /// Return ROD header minor version to use when writing BS - uint16_t minorVersion() {return 0x1004;} // Or may go up to 0x2000, CHECK + uint16_t minorVersion() const {return 0x1004;} // Or may go up to 0x2000, CHECK /// Return last ROD header minor version for pre-LS1 data - uint16_t minorVersionPreLS1() {return 0x1003;} + uint16_t minorVersionPreLS1() const {return 0x1003;} }; diff --git a/Trigger/TrigT1/TrigT1CaloMonitoring/python/LVL1CaloMonitoringConfig.py b/Trigger/TrigT1/TrigT1CaloMonitoring/python/LVL1CaloMonitoringConfig.py index 4cf615e6d1e13a1d70adbf3cd694e3148d413885..0b81df5c3fda339582d8f7b891a99d7e0b15ef4c 100644 --- a/Trigger/TrigT1/TrigT1CaloMonitoring/python/LVL1CaloMonitoringConfig.py +++ b/Trigger/TrigT1/TrigT1CaloMonitoring/python/LVL1CaloMonitoringConfig.py @@ -14,6 +14,10 @@ def LVL1CaloMonitoringConfig(flags): result = ComponentAccumulator() + # If we're not putting trigger objects in event store, can't monitor them + if not flags.DQ.triggerDataAvailable: + return result + isData = not flags.Input.isMC # monitoring algorithm configs diff --git a/Trigger/TrigTools/TrigInDetConfig/python/InDetSetup.py b/Trigger/TrigTools/TrigInDetConfig/python/InDetSetup.py index 6acaa889727aa2a1e94b4887174ac8de53ee09c0..18f20c074665f41c34be365c12df45475bbe4cef 100644 --- a/Trigger/TrigTools/TrigInDetConfig/python/InDetSetup.py +++ b/Trigger/TrigTools/TrigInDetConfig/python/InDetSetup.py @@ -158,9 +158,6 @@ def makeInDetAlgs( config = None, rois = 'EMViewRoIs', doFTF = True, viewVerifie #Pixel clusterisation from InDetTrigRecExample.InDetTrigConfigRecLoadTools import TrigPixelLorentzAngleTool, TrigSCTLorentzAngleTool - from PixelConditionsAlgorithms.PixelConditionsAlgorithmsConf import PixelConfigCondAlg - PixelConfigCondAlg.UseCalibConditions = False - from SiClusterizationTool.SiClusterizationToolConf import InDet__ClusterMakerTool InDetClusterMakerTool = InDet__ClusterMakerTool(name = "InDetClusterMakerTool_" + signature, SCTLorentzAngleTool = TrigSCTLorentzAngleTool, diff --git a/Trigger/TrigTools/TrigInDetConfig/python/TrigInDetConfig.py b/Trigger/TrigTools/TrigInDetConfig/python/TrigInDetConfig.py index 9099aac72f957488fae1c25d2a8b21b9606ae71f..1e7baed4d29cbab006a0a43ab8bf8318653f5b9e 100644 --- a/Trigger/TrigTools/TrigInDetConfig/python/TrigInDetConfig.py +++ b/Trigger/TrigTools/TrigInDetConfig/python/TrigInDetConfig.py @@ -386,15 +386,7 @@ def TrigInDetCondCfg( flags ): from PixelCabling.PixelCablingConfigNew import PixelCablingSvcCfg # module parameters - acc.merge(PixelConfigCondAlgCfg(flags, - UseCalibConditions=False, - UseDeadmapConditions=True, - UseDCSStateConditions=False, - UseDCSStatusConditions=False, - UseDCSHVConditions=True, - UseDCSTemperatureConditions=True, - UseTDAQConditions=False)) - + acc.merge(PixelConfigCondAlgCfg(flags)) # charge calibration acc.merge(PixelChargeCalibCondAlgCfg(flags)) # NEW FOR RUN3 acc.merge(PixelChargeLUTCalibCondAlgCfg(flags)) @@ -431,7 +423,10 @@ def TrigInDetCondCfg( flags ): acc.merge( mfsc ) return acc -def TrigInDetConfig( flags, roisKey="EMRoIs", signatureName='' ): +def TrigInDetConfig( inflags, roisKey="EMRoIs", signatureName='' ): + + # redirect InDet.Tracking flags to point to a specific trigger setting + flags = inflags.cloneAndReplace("InDet.Tracking", "Trigger.InDetTracking."+signatureName) #If signature specified add suffix to the name of each algorithms signature = "_" + signatureName if signatureName else '' @@ -715,13 +710,10 @@ def TrigInDetConfig( flags, roisKey="EMRoIs", signatureName='' ): return acc -def indetInViewRecoCfg( inflags, viewMakerName, signature='' ): +def indetInViewRecoCfg( flags, viewMakerName, signature='' ): """ TBD if this function should be defined here or moved to the menu are, for sake of symmetry it is kept here now There would certainly be additional algorithms """ - # redirect InDet.Tracking flags to point to a specific trigger setting - flags = inflags.cloneAndReplace("InDet.Tracking", "Trigger.InDetTracking."+signature) - from TriggerMenuMT.HLTMenuConfig.Menu.MenuComponents import InViewReco reco = InViewReco( viewMakerName ) diff --git a/Trigger/TrigTools/TrigInDetConfig/python/TrigTrackingCutFlags.py b/Trigger/TrigTools/TrigInDetConfig/python/TrigTrackingCutFlags.py index 6c9e24bbad58e1d8b58f039a740cc57160502a21..a984bb29856117bc606ac2cc81098aabd404e5b4 100644 --- a/Trigger/TrigTools/TrigInDetConfig/python/TrigTrackingCutFlags.py +++ b/Trigger/TrigTools/TrigInDetConfig/python/TrigTrackingCutFlags.py @@ -20,9 +20,15 @@ def __electronFlags(): flags.checkRedundantSeeds=True return flags +def __muonFlags(): + flags = __sliceFlags() + flags.minPT=Units.GeV * 1.0 + return flags + def createTrigTrackingFlags(): flags = AthConfigFlags() flags.addFlagsCategory('Trigger.InDetTracking.Electron', __electronFlags, prefix=True) + flags.addFlagsCategory('Trigger.InDetTracking.Muon', __muonFlags, prefix=True) return flags if __name__ == "__main__": diff --git a/Trigger/TrigTools/TrigInDetPattRecoTools/CMakeLists.txt b/Trigger/TrigTools/TrigInDetPattRecoTools/CMakeLists.txt index e6dcc1b165aa0b041780abbbc8935c6e898172db..9429b5539d2ee7e7d2c35ff7113b5ca82b082021 100644 --- a/Trigger/TrigTools/TrigInDetPattRecoTools/CMakeLists.txt +++ b/Trigger/TrigTools/TrigInDetPattRecoTools/CMakeLists.txt @@ -14,5 +14,6 @@ find_package(Boost) atlas_add_test( mockSeeds SOURCES test/mockSeeds.cxx - LINK_LIBRARIES PathResolver TrigInDetEvent TrigInDetPattRecoEvent TrigInDetPattRecoTools TrigSteeringEvent IRegionSelector ) + LINK_LIBRARIES PathResolver TrigInDetEvent TrigInDetPattRecoEvent TrigInDetPattRecoTools TrigSteeringEvent IRegionSelector + PROPERTIES TIMEOUT 300 ) diff --git a/Trigger/TrigValidation/TrigAnalysisTest/share/ref_RDOtoRDOTrig_v1Dev_build.ref b/Trigger/TrigValidation/TrigAnalysisTest/share/ref_RDOtoRDOTrig_v1Dev_build.ref index 7a5a00e23ad80112bee04cf9c6ec58ef759b6f9a..009533aecf697058558503bb83460cc19081e823 100644 --- a/Trigger/TrigValidation/TrigAnalysisTest/share/ref_RDOtoRDOTrig_v1Dev_build.ref +++ b/Trigger/TrigValidation/TrigAnalysisTest/share/ref_RDOtoRDOTrig_v1Dev_build.ref @@ -1,3 +1,12 @@ +TrigSignatureMoniMT INFO HLT_10j40_pf_subresjesgscIS_ftf_L14J15 #3575805394 +TrigSignatureMoniMT INFO -- #3575805394 Events 9 9 0 0 0 0 0 0 0 0 0 0 - - - 0 +TrigSignatureMoniMT INFO -- #3575805394 Features 0 0 0 0 0 0 0 0 0 0 - - - +TrigSignatureMoniMT INFO HLT_10j40_subjesIS_L14J15 #2760204981 +TrigSignatureMoniMT INFO -- #2760204981 Events 9 9 0 0 0 0 0 0 0 0 0 0 - - - 0 +TrigSignatureMoniMT INFO -- #2760204981 Features 0 0 0 0 0 0 0 0 0 0 - - - +TrigSignatureMoniMT INFO HLT_10j40_subresjesgscIS_ftf_L14J15 #3568675904 +TrigSignatureMoniMT INFO -- #3568675904 Events 9 9 0 0 0 0 0 0 0 0 0 0 - - - 0 +TrigSignatureMoniMT INFO -- #3568675904 Features 0 0 0 0 0 0 0 0 0 0 - - - TrigSignatureMoniMT INFO HLT_2e12_lhloose_mu10_L12EM8VH_MU10 #2518246928 TrigSignatureMoniMT INFO -- #2518246928 Events 1 1 0 0 0 0 0 0 0 0 - - - - - 0 TrigSignatureMoniMT INFO -- #2518246928 Features 0 0 0 0 0 0 0 0 - - - - - @@ -22,6 +31,9 @@ TrigSignatureMoniMT INFO -- #3765708828 Features TrigSignatureMoniMT INFO HLT_2g20_tight_L12EM15VH #3837353071 TrigSignatureMoniMT INFO -- #3837353071 Events 2 2 2 0 0 0 - - - - - - - - - 0 TrigSignatureMoniMT INFO -- #3837353071 Features 2 0 0 0 - - - - - - - - - +TrigSignatureMoniMT INFO HLT_2g20_tight_icaloloose_L12EM15VH #1319738689 +TrigSignatureMoniMT INFO -- #1319738689 Events 2 2 2 0 0 0 - - - - - - - - - 0 +TrigSignatureMoniMT INFO -- #1319738689 Features 2 0 0 0 - - - - - - - - - TrigSignatureMoniMT INFO HLT_2g22_tight_L12EM15VH #708421357 TrigSignatureMoniMT INFO -- #708421357 Events 2 2 2 0 0 0 - - - - - - - - - 0 TrigSignatureMoniMT INFO -- #708421357 Features 2 0 0 0 - - - - - - - - - @@ -53,53 +65,56 @@ TrigSignatureMoniMT INFO HLT_2j60_L1J15 #9277355 TrigSignatureMoniMT INFO -- #927735533 Events 20 20 0 0 0 0 0 0 0 0 0 10 - - - 10 TrigSignatureMoniMT INFO -- #927735533 Features 0 0 0 0 0 0 0 0 0 28 - - - TrigSignatureMoniMT INFO HLT_2mu10_bJpsimumu_L12MU10 #3498558358 -TrigSignatureMoniMT INFO -- #3498558358 Events 3 3 0 0 0 0 3 3 3 2 - - - - - 0 -TrigSignatureMoniMT INFO -- #3498558358 Features 0 0 0 0 12 12 16 4 - - - - - +TrigSignatureMoniMT INFO -- #3498558358 Events 3 3 0 0 0 0 2 2 2 2 - - - - - 0 +TrigSignatureMoniMT INFO -- #3498558358 Features 0 0 0 0 8 8 8 4 - - - - - TrigSignatureMoniMT INFO HLT_2mu10_bUpsimumu_L12MU10 #234102568 -TrigSignatureMoniMT INFO -- #234102568 Events 3 3 0 0 0 0 3 3 3 2 - - - - - 0 -TrigSignatureMoniMT INFO -- #234102568 Features 0 0 0 0 12 12 16 4 - - - - - +TrigSignatureMoniMT INFO -- #234102568 Events 3 3 0 0 0 0 2 2 2 2 - - - - - 0 +TrigSignatureMoniMT INFO -- #234102568 Features 0 0 0 0 8 8 8 4 - - - - - TrigSignatureMoniMT INFO HLT_2mu14_L12MU10 #2619091790 -TrigSignatureMoniMT INFO -- #2619091790 Events 3 3 0 0 0 0 3 1 1 1 - - - - - 1 -TrigSignatureMoniMT INFO -- #2619091790 Features 0 0 0 0 12 4 4 4 - - - - - +TrigSignatureMoniMT INFO -- #2619091790 Events 3 3 0 0 0 0 2 1 1 1 - - - - - 1 +TrigSignatureMoniMT INFO -- #2619091790 Features 0 0 0 0 8 4 4 4 - - - - - TrigSignatureMoniMT INFO HLT_2mu15_L12MU10 #557204938 -TrigSignatureMoniMT INFO -- #557204938 Events 3 3 0 0 0 0 3 1 1 1 - - - - - 1 -TrigSignatureMoniMT INFO -- #557204938 Features 0 0 0 0 12 4 4 4 - - - - - +TrigSignatureMoniMT INFO -- #557204938 Events 3 3 0 0 0 0 2 1 1 1 - - - - - 1 +TrigSignatureMoniMT INFO -- #557204938 Features 0 0 0 0 8 4 4 4 - - - - - TrigSignatureMoniMT INFO HLT_2mu4_L12MU4 #2999632714 -TrigSignatureMoniMT INFO -- #2999632714 Events 4 4 0 0 0 0 4 4 4 4 - - - - - 4 -TrigSignatureMoniMT INFO -- #2999632714 Features 0 0 0 0 16 16 24 20 - - - - - +TrigSignatureMoniMT INFO -- #2999632714 Events 4 4 0 0 0 0 3 3 2 2 - - - - - 2 +TrigSignatureMoniMT INFO -- #2999632714 Features 0 0 0 0 12 12 8 8 - - - - - TrigSignatureMoniMT INFO HLT_2mu4_bDimu_L12MU4 #1730084172 -TrigSignatureMoniMT INFO -- #1730084172 Events 4 4 0 0 0 0 4 4 4 4 - - - - - 0 -TrigSignatureMoniMT INFO -- #1730084172 Features 0 0 0 0 16 16 24 10 - - - - - +TrigSignatureMoniMT INFO -- #1730084172 Events 4 4 0 0 0 0 3 3 2 2 - - - - - 0 +TrigSignatureMoniMT INFO -- #1730084172 Features 0 0 0 0 12 12 8 4 - - - - - TrigSignatureMoniMT INFO HLT_2mu4_bJpsimumu_L12MU4 #4276347155 -TrigSignatureMoniMT INFO -- #4276347155 Events 4 4 0 0 0 0 4 4 4 4 - - - - - 0 -TrigSignatureMoniMT INFO -- #4276347155 Features 0 0 0 0 16 16 24 10 - - - - - +TrigSignatureMoniMT INFO -- #4276347155 Events 4 4 0 0 0 0 3 3 2 2 - - - - - 0 +TrigSignatureMoniMT INFO -- #4276347155 Features 0 0 0 0 12 12 8 4 - - - - - TrigSignatureMoniMT INFO HLT_2mu4_bUpsimumu_L12MU4 #4008168535 -TrigSignatureMoniMT INFO -- #4008168535 Events 4 4 0 0 0 0 4 4 4 4 - - - - - 0 -TrigSignatureMoniMT INFO -- #4008168535 Features 0 0 0 0 16 16 24 10 - - - - - +TrigSignatureMoniMT INFO -- #4008168535 Events 4 4 0 0 0 0 3 3 2 2 - - - - - 0 +TrigSignatureMoniMT INFO -- #4008168535 Features 0 0 0 0 12 12 8 4 - - - - - TrigSignatureMoniMT INFO HLT_2mu4_muonqual_L12MU4 #1584776935 -TrigSignatureMoniMT INFO -- #1584776935 Events 4 4 0 0 0 0 4 4 4 4 - - - - - 4 -TrigSignatureMoniMT INFO -- #1584776935 Features 0 0 0 0 16 16 24 20 - - - - - +TrigSignatureMoniMT INFO -- #1584776935 Events 4 4 0 0 0 0 3 3 2 2 - - - - - 2 +TrigSignatureMoniMT INFO -- #1584776935 Features 0 0 0 0 12 12 8 8 - - - - - TrigSignatureMoniMT INFO HLT_2mu6Comb_L12MU6 #2046267508 -TrigSignatureMoniMT INFO -- #2046267508 Events 4 4 0 0 0 0 4 3 - - - - - - - 3 -TrigSignatureMoniMT INFO -- #2046267508 Features 0 0 0 0 16 12 - - - - - - - +TrigSignatureMoniMT INFO -- #2046267508 Events 4 4 0 0 0 0 3 2 - - - - - - - 2 +TrigSignatureMoniMT INFO -- #2046267508 Features 0 0 0 0 12 8 - - - - - - - TrigSignatureMoniMT INFO HLT_2mu6_10invm70_L1MU6 #1316992871 -TrigSignatureMoniMT INFO -- #1316992871 Events 10 10 0 0 0 0 4 3 3 3 - - - - - 3 -TrigSignatureMoniMT INFO -- #1316992871 Features 0 0 0 0 16 12 18 16 - - - - - +TrigSignatureMoniMT INFO -- #1316992871 Events 10 10 0 0 0 0 3 2 2 2 - - - - - 2 +TrigSignatureMoniMT INFO -- #1316992871 Features 0 0 0 0 12 8 8 8 - - - - - TrigSignatureMoniMT INFO HLT_2mu6_Dr_L12MU4 #3304584056 -TrigSignatureMoniMT INFO -- #3304584056 Events 4 4 0 0 0 0 4 3 - - - - - - - 3 -TrigSignatureMoniMT INFO -- #3304584056 Features 0 0 0 0 16 12 - - - - - - - +TrigSignatureMoniMT INFO -- #3304584056 Events 4 4 0 0 0 0 3 2 - - - - - - - 2 +TrigSignatureMoniMT INFO -- #3304584056 Features 0 0 0 0 12 8 - - - - - - - TrigSignatureMoniMT INFO HLT_2mu6_L12MU6 #1747073535 -TrigSignatureMoniMT INFO -- #1747073535 Events 4 4 0 0 0 0 4 3 3 3 - - - - - 3 -TrigSignatureMoniMT INFO -- #1747073535 Features 0 0 0 0 16 12 18 16 - - - - - +TrigSignatureMoniMT INFO -- #1747073535 Events 4 4 0 0 0 0 3 2 2 2 - - - - - 2 +TrigSignatureMoniMT INFO -- #1747073535 Features 0 0 0 0 12 8 8 8 - - - - - TrigSignatureMoniMT INFO HLT_2mu6_muonqual_L12MU6 #2398136098 -TrigSignatureMoniMT INFO -- #2398136098 Events 4 4 0 0 0 0 4 3 3 3 - - - - - 3 -TrigSignatureMoniMT INFO -- #2398136098 Features 0 0 0 0 16 12 18 16 - - - - - +TrigSignatureMoniMT INFO -- #2398136098 Events 4 4 0 0 0 0 3 2 2 2 - - - - - 2 +TrigSignatureMoniMT INFO -- #2398136098 Features 0 0 0 0 12 8 8 8 - - - - - TrigSignatureMoniMT INFO HLT_3j200_L1J100 #2199422919 TrigSignatureMoniMT INFO -- #2199422919 Events 3 3 0 0 0 0 0 0 0 0 0 0 - - - 0 TrigSignatureMoniMT INFO -- #2199422919 Features 0 0 0 0 0 0 0 0 0 0 - - - -TrigSignatureMoniMT INFO HLT_3j200_L1J20 #493765146 -TrigSignatureMoniMT INFO -- #493765146 Events 19 19 0 0 0 0 0 0 0 0 0 0 - - - 0 -TrigSignatureMoniMT INFO -- #493765146 Features 0 0 0 0 0 0 0 0 0 0 - - - +TrigSignatureMoniMT INFO HLT_3j200_pf_subresjesgscIS_ftf_L1J100 #794428037 +TrigSignatureMoniMT INFO -- #794428037 Events 3 3 0 0 0 0 0 0 0 0 0 0 - - - 0 +TrigSignatureMoniMT INFO -- #794428037 Features 0 0 0 0 0 0 0 0 0 0 - - - +TrigSignatureMoniMT INFO HLT_3j200_subresjesgscIS_ftf_L1J100 #1801834652 +TrigSignatureMoniMT INFO -- #1801834652 Events 3 3 0 0 0 0 0 0 0 0 0 0 - - - 0 +TrigSignatureMoniMT INFO -- #1801834652 Features 0 0 0 0 0 0 0 0 0 0 - - - TrigSignatureMoniMT INFO HLT_3mu6_L13MU6 #1832399408 TrigSignatureMoniMT INFO -- #1832399408 Events 0 0 0 0 0 0 0 0 0 0 - - - - - 0 TrigSignatureMoniMT INFO -- #1832399408 Features 0 0 0 0 0 0 0 0 - - - - - @@ -109,12 +124,63 @@ TrigSignatureMoniMT INFO -- #1199773318 Features TrigSignatureMoniMT INFO HLT_3mu8_msonly_L13MU6 #424835335 TrigSignatureMoniMT INFO -- #424835335 Events 0 0 0 0 0 0 0 0 0 - - - - - - 0 TrigSignatureMoniMT INFO -- #424835335 Features 0 0 0 0 0 0 0 - - - - - - +TrigSignatureMoniMT INFO HLT_4j120_pf_subresjesgscIS_ftf_L13J50 #1755129033 +TrigSignatureMoniMT INFO -- #1755129033 Events 1 1 0 0 0 0 0 0 0 0 0 0 - - - 0 +TrigSignatureMoniMT INFO -- #1755129033 Features 0 0 0 0 0 0 0 0 0 0 - - - +TrigSignatureMoniMT INFO HLT_4j120_subjesIS_L13J50 #3722303680 +TrigSignatureMoniMT INFO -- #3722303680 Events 1 1 0 0 0 0 0 0 0 0 0 0 - - - 0 +TrigSignatureMoniMT INFO -- #3722303680 Features 0 0 0 0 0 0 0 0 0 0 - - - +TrigSignatureMoniMT INFO HLT_4j120_subresjesgscIS_ftf_L13J50 #91006165 +TrigSignatureMoniMT INFO -- #91006165 Events 1 1 0 0 0 0 0 0 0 0 0 0 - - - 0 +TrigSignatureMoniMT INFO -- #91006165 Features 0 0 0 0 0 0 0 0 0 0 - - - TrigSignatureMoniMT INFO HLT_4mu4_L14MU4 #1834383636 TrigSignatureMoniMT INFO -- #1834383636 Events 0 0 0 0 0 0 0 0 0 0 - - - - - 0 TrigSignatureMoniMT INFO -- #1834383636 Features 0 0 0 0 0 0 0 0 - - - - - TrigSignatureMoniMT INFO HLT_5j70_0eta240_L14J20 #1175391812 TrigSignatureMoniMT INFO -- #1175391812 Events 7 7 0 0 0 0 0 0 0 0 0 1 - - - 1 TrigSignatureMoniMT INFO -- #1175391812 Features 0 0 0 0 0 0 0 0 0 5 - - - +TrigSignatureMoniMT INFO HLT_5j70_pf_subresjesgscIS_ftf_0eta240_L14J15 #4189027854 +TrigSignatureMoniMT INFO -- #4189027854 Events 9 9 0 0 0 0 0 0 0 0 0 1 - - - 1 +TrigSignatureMoniMT INFO -- #4189027854 Features 0 0 0 0 0 0 0 0 0 5 - - - +TrigSignatureMoniMT INFO HLT_5j70_subresjesgscIS_ftf_0eta240_L14J15 #819918597 +TrigSignatureMoniMT INFO -- #819918597 Events 9 9 0 0 0 0 0 0 0 0 0 0 - - - 0 +TrigSignatureMoniMT INFO -- #819918597 Features 0 0 0 0 0 0 0 0 0 0 - - - +TrigSignatureMoniMT INFO HLT_5j85_pf_subresjesgscIS_ftf_L14J15 #4208121018 +TrigSignatureMoniMT INFO -- #4208121018 Events 9 9 0 0 0 0 0 0 0 0 0 0 - - - 0 +TrigSignatureMoniMT INFO -- #4208121018 Features 0 0 0 0 0 0 0 0 0 0 - - - +TrigSignatureMoniMT INFO HLT_5j85_subjesIS_L14J15 #2745094401 +TrigSignatureMoniMT INFO -- #2745094401 Events 9 9 0 0 0 0 0 0 0 0 0 0 - - - 0 +TrigSignatureMoniMT INFO -- #2745094401 Features 0 0 0 0 0 0 0 0 0 0 - - - +TrigSignatureMoniMT INFO HLT_5j85_subresjesgscIS_ftf_L14J15 #1148892499 +TrigSignatureMoniMT INFO -- #1148892499 Events 9 9 0 0 0 0 0 0 0 0 0 0 - - - 0 +TrigSignatureMoniMT INFO -- #1148892499 Features 0 0 0 0 0 0 0 0 0 0 - - - +TrigSignatureMoniMT INFO HLT_6j55_pf_subresjesgscIS_ftf_0eta240_L14J15 #1526259867 +TrigSignatureMoniMT INFO -- #1526259867 Events 9 9 0 0 0 0 0 0 0 0 0 0 - - - 0 +TrigSignatureMoniMT INFO -- #1526259867 Features 0 0 0 0 0 0 0 0 0 0 - - - +TrigSignatureMoniMT INFO HLT_6j55_subjesIS_0eta240_L14J15 #68179418 +TrigSignatureMoniMT INFO -- #68179418 Events 9 9 0 0 0 0 0 0 0 0 0 0 - - - 0 +TrigSignatureMoniMT INFO -- #68179418 Features 0 0 0 0 0 0 0 0 0 0 - - - +TrigSignatureMoniMT INFO HLT_6j55_subresjesgscIS_ftf_0eta240_L14J15 #1068073241 +TrigSignatureMoniMT INFO -- #1068073241 Events 9 9 0 0 0 0 0 0 0 0 0 0 - - - 0 +TrigSignatureMoniMT INFO -- #1068073241 Features 0 0 0 0 0 0 0 0 0 0 - - - +TrigSignatureMoniMT INFO HLT_6j70_pf_subresjesgscIS_ftf_L14J15 #1755772565 +TrigSignatureMoniMT INFO -- #1755772565 Events 9 9 0 0 0 0 0 0 0 0 0 0 - - - 0 +TrigSignatureMoniMT INFO -- #1755772565 Features 0 0 0 0 0 0 0 0 0 0 - - - +TrigSignatureMoniMT INFO HLT_6j70_subjesIS_L14J15 #1003115860 +TrigSignatureMoniMT INFO -- #1003115860 Events 9 9 0 0 0 0 0 0 0 0 0 0 - - - 0 +TrigSignatureMoniMT INFO -- #1003115860 Features 0 0 0 0 0 0 0 0 0 0 - - - +TrigSignatureMoniMT INFO HLT_6j70_subresjesgscIS_ftf_L14J15 #59957514 +TrigSignatureMoniMT INFO -- #59957514 Events 9 9 0 0 0 0 0 0 0 0 0 0 - - - 0 +TrigSignatureMoniMT INFO -- #59957514 Features 0 0 0 0 0 0 0 0 0 0 - - - +TrigSignatureMoniMT INFO HLT_7j45_pf_subresjesgscIS_ftf_L14J15 #2701381398 +TrigSignatureMoniMT INFO -- #2701381398 Events 9 9 0 0 0 0 0 0 0 0 0 0 - - - 0 +TrigSignatureMoniMT INFO -- #2701381398 Features 0 0 0 0 0 0 0 0 0 0 - - - +TrigSignatureMoniMT INFO HLT_7j45_subjesIS_L14J15 #2617173782 +TrigSignatureMoniMT INFO -- #2617173782 Events 9 9 0 0 0 0 0 0 0 0 0 0 - - - 0 +TrigSignatureMoniMT INFO -- #2617173782 Features 0 0 0 0 0 0 0 0 0 0 - - - +TrigSignatureMoniMT INFO HLT_7j45_subresjesgscIS_ftf_L14J15 #2928962349 +TrigSignatureMoniMT INFO -- #2928962349 Events 9 9 0 0 0 0 0 0 0 0 0 0 - - - 0 +TrigSignatureMoniMT INFO -- #2928962349 Features 0 0 0 0 0 0 0 0 0 0 - - - TrigSignatureMoniMT INFO HLT_JetDS_j0_L1J100 #3302698716 TrigSignatureMoniMT INFO -- #3302698716 Events 3 3 0 0 0 0 0 0 0 0 0 3 3 3 - 3 TrigSignatureMoniMT INFO -- #3302698716 Features 0 0 0 0 0 0 0 0 0 81 32 3 - @@ -166,6 +232,9 @@ TrigSignatureMoniMT INFO -- #1703681121 Features TrigSignatureMoniMT INFO HLT_e26_lhtight_L1EM22VHI #1995263521 TrigSignatureMoniMT INFO -- #1995263521 Events 6 6 5 5 5 4 - - - - - - - - - 4 TrigSignatureMoniMT INFO -- #1995263521 Features 5 64 8 4 - - - - - - - - - +TrigSignatureMoniMT INFO HLT_e26_lhtight_ivarloose_L1EM22VHI #2918307206 +TrigSignatureMoniMT INFO -- #2918307206 Events 6 6 5 5 5 3 - - - - - - - - - 3 +TrigSignatureMoniMT INFO -- #2918307206 Features 5 64 8 3 - - - - - - - - - TrigSignatureMoniMT INFO HLT_e26_lhtight_nod0_L1EM22VHI #939763520 TrigSignatureMoniMT INFO -- #939763520 Events 6 6 5 5 5 4 - - - - - - - - - 4 TrigSignatureMoniMT INFO -- #939763520 Features 5 64 8 4 - - - - - - - - - @@ -232,6 +301,18 @@ TrigSignatureMoniMT INFO -- #1776910226 Features TrigSignatureMoniMT INFO HLT_g20_etcut_LArPEB_L1EM15 #2706532790 TrigSignatureMoniMT INFO -- #2706532790 Events 14 14 14 14 12 12 - - - - - - - - - 12 TrigSignatureMoniMT INFO -- #2706532790 Features 24 24 22 20 - - - - - - - - - +TrigSignatureMoniMT INFO HLT_g20_tight_L1EM15VH #270010748 +TrigSignatureMoniMT INFO -- #270010748 Events 8 8 8 8 8 5 - - - - - - - - - 5 +TrigSignatureMoniMT INFO -- #270010748 Features 8 8 16 5 - - - - - - - - - +TrigSignatureMoniMT INFO HLT_g20_tight_icaloloose_L1EM15VH #4091638976 +TrigSignatureMoniMT INFO -- #4091638976 Events 8 8 8 8 8 5 - - - - - - - - - 5 +TrigSignatureMoniMT INFO -- #4091638976 Features 8 8 16 5 - - - - - - - - - +TrigSignatureMoniMT INFO HLT_g20_tight_icalomedium_L1EM15VH #2032419080 +TrigSignatureMoniMT INFO -- #2032419080 Events 8 8 8 8 8 5 - - - - - - - - - 5 +TrigSignatureMoniMT INFO -- #2032419080 Features 8 8 16 5 - - - - - - - - - +TrigSignatureMoniMT INFO HLT_g20_tight_icalotight_L1EM15VH #2824200612 +TrigSignatureMoniMT INFO -- #2824200612 Events 8 8 8 8 8 0 - - - - - - - - - 0 +TrigSignatureMoniMT INFO -- #2824200612 Features 8 8 16 0 - - - - - - - - - TrigSignatureMoniMT INFO HLT_g25_etcut_L1EM20VH #1417839619 TrigSignatureMoniMT INFO -- #1417839619 Events 7 7 7 7 7 - - - - - - - - - - 7 TrigSignatureMoniMT INFO -- #1417839619 Features 11 11 10 - - - - - - - - - - @@ -301,12 +382,12 @@ TrigSignatureMoniMT INFO -- #4176355792 Features TrigSignatureMoniMT INFO HLT_j420_L1J100 #2659902019 TrigSignatureMoniMT INFO -- #2659902019 Events 3 3 0 0 0 0 0 0 0 0 0 0 - - - 0 TrigSignatureMoniMT INFO -- #2659902019 Features 0 0 0 0 0 0 0 0 0 0 - - - -TrigSignatureMoniMT INFO HLT_j420_L1J20 #2205518067 -TrigSignatureMoniMT INFO -- #2205518067 Events 19 19 0 0 0 0 0 0 0 0 0 0 - - - 0 -TrigSignatureMoniMT INFO -- #2205518067 Features 0 0 0 0 0 0 0 0 0 0 - - - -TrigSignatureMoniMT INFO HLT_j420_subjesgscIS_ftf_L1J20 #2116995085 -TrigSignatureMoniMT INFO -- #2116995085 Events 19 19 0 0 0 0 0 0 0 0 0 0 - - - 0 -TrigSignatureMoniMT INFO -- #2116995085 Features 0 0 0 0 0 0 0 0 0 0 - - - +TrigSignatureMoniMT INFO HLT_j420_pf_subresjesgscIS_ftf_L1J100 #3936932891 +TrigSignatureMoniMT INFO -- #3936932891 Events 3 3 0 0 0 0 0 0 0 0 0 0 - - - 0 +TrigSignatureMoniMT INFO -- #3936932891 Features 0 0 0 0 0 0 0 0 0 0 - - - +TrigSignatureMoniMT INFO HLT_j420_subresjesgscIS_ftf_L1J100 #2477128298 +TrigSignatureMoniMT INFO -- #2477128298 Events 3 3 0 0 0 0 0 0 0 0 0 0 - - - 0 +TrigSignatureMoniMT INFO -- #2477128298 Features 0 0 0 0 0 0 0 0 0 0 - - - TrigSignatureMoniMT INFO HLT_j45_L1J15 #1364976160 TrigSignatureMoniMT INFO -- #1364976160 Events 20 20 0 0 0 0 0 0 0 0 0 19 - - - 19 TrigSignatureMoniMT INFO -- #1364976160 Features 0 0 0 0 0 0 0 0 0 49 - - - @@ -351,7 +432,7 @@ TrigSignatureMoniMT INFO -- #1960278431 Events TrigSignatureMoniMT INFO -- #1960278431 Features 0 0 0 0 0 0 0 0 0 50 - - - TrigSignatureMoniMT INFO HLT_j45_subjesgscIS_ftf_bmv2c1070_split_L1J20 #980453000 TrigSignatureMoniMT INFO -- #980453000 Events 19 19 0 0 0 0 0 0 0 0 0 19 11 - - 11 -TrigSignatureMoniMT INFO -- #980453000 Features 0 0 0 0 0 0 0 0 0 49 21 - - +TrigSignatureMoniMT INFO -- #980453000 Features 0 0 0 0 0 0 0 0 0 49 20 - - TrigSignatureMoniMT INFO HLT_j45_subjesgscIS_ftf_boffperf_split_L1J20 #3374916154 TrigSignatureMoniMT INFO -- #3374916154 Events 19 19 0 0 0 0 0 0 0 0 0 19 19 - - 19 TrigSignatureMoniMT INFO -- #3374916154 Features 0 0 0 0 0 0 0 0 0 49 49 - - @@ -429,67 +510,67 @@ TrigSignatureMoniMT INFO -- #782182242 Events TrigSignatureMoniMT INFO -- #782182242 Features 0 0 0 0 0 - - - - - - - - TrigSignatureMoniMT INFO HLT_mu10_L1MU10 #209090273 TrigSignatureMoniMT INFO -- #209090273 Events 10 10 0 0 0 0 10 10 10 9 - - - - - 9 -TrigSignatureMoniMT INFO -- #209090273 Features 0 0 0 0 13 12 13 11 - - - - - +TrigSignatureMoniMT INFO -- #209090273 Features 0 0 0 0 12 12 13 11 - - - - - TrigSignatureMoniMT INFO HLT_mu10_ivarmedium_mu10_10invm70_L12MU10 #2386882549 -TrigSignatureMoniMT INFO -- #2386882549 Events 3 3 0 0 0 0 3 2 2 2 2 - - - - 2 -TrigSignatureMoniMT INFO -- #2386882549 Features 0 0 0 0 6 4 4 4 2 - - - - +TrigSignatureMoniMT INFO -- #2386882549 Events 3 3 0 0 0 0 2 2 2 2 2 - - - - 2 +TrigSignatureMoniMT INFO -- #2386882549 Features 0 0 0 0 4 4 4 4 2 - - - - TrigSignatureMoniMT INFO HLT_mu10_lateMu_L1MU10 #48780310 TrigSignatureMoniMT INFO -- #48780310 Events 10 10 0 0 0 0 0 0 - - - - - - - 0 TrigSignatureMoniMT INFO -- #48780310 Features 0 0 0 0 0 0 - - - - - - - TrigSignatureMoniMT INFO HLT_mu11_mu6_bBmumu_L1MU11_2MU6 #947854469 -TrigSignatureMoniMT INFO -- #947854469 Events 4 4 0 0 0 0 4 0 3 0 - - - - - 0 -TrigSignatureMoniMT INFO -- #947854469 Features 0 0 0 0 8 0 6 0 - - - - - +TrigSignatureMoniMT INFO -- #947854469 Events 4 4 0 0 0 0 3 0 2 0 - - - - - 0 +TrigSignatureMoniMT INFO -- #947854469 Features 0 0 0 0 6 0 4 0 - - - - - TrigSignatureMoniMT INFO HLT_mu11_mu6_bDimu2700_L1MU11_2MU6 #4293593869 -TrigSignatureMoniMT INFO -- #4293593869 Events 4 4 0 0 0 0 4 0 3 0 - - - - - 0 -TrigSignatureMoniMT INFO -- #4293593869 Features 0 0 0 0 8 0 6 0 - - - - - +TrigSignatureMoniMT INFO -- #4293593869 Events 4 4 0 0 0 0 3 0 2 0 - - - - - 0 +TrigSignatureMoniMT INFO -- #4293593869 Features 0 0 0 0 6 0 4 0 - - - - - TrigSignatureMoniMT INFO HLT_mu11_mu6_bDimu_L1MU11_2MU6 #2381335347 -TrigSignatureMoniMT INFO -- #2381335347 Events 4 4 0 0 0 0 4 0 3 0 - - - - - 0 -TrigSignatureMoniMT INFO -- #2381335347 Features 0 0 0 0 8 0 6 0 - - - - - +TrigSignatureMoniMT INFO -- #2381335347 Events 4 4 0 0 0 0 3 0 2 0 - - - - - 0 +TrigSignatureMoniMT INFO -- #2381335347 Features 0 0 0 0 6 0 4 0 - - - - - TrigSignatureMoniMT INFO HLT_mu11_mu6_bJpsimumu_L1MU11_2MU6 #2504965945 -TrigSignatureMoniMT INFO -- #2504965945 Events 4 4 0 0 0 0 4 0 3 0 - - - - - 0 -TrigSignatureMoniMT INFO -- #2504965945 Features 0 0 0 0 8 0 6 0 - - - - - +TrigSignatureMoniMT INFO -- #2504965945 Events 4 4 0 0 0 0 3 0 2 0 - - - - - 0 +TrigSignatureMoniMT INFO -- #2504965945 Features 0 0 0 0 6 0 4 0 - - - - - TrigSignatureMoniMT INFO HLT_mu11_mu6_bPhi_L1MU11_2MU6 #2079901197 -TrigSignatureMoniMT INFO -- #2079901197 Events 4 4 0 0 0 0 4 0 3 0 - - - - - 0 -TrigSignatureMoniMT INFO -- #2079901197 Features 0 0 0 0 8 0 6 0 - - - - - +TrigSignatureMoniMT INFO -- #2079901197 Events 4 4 0 0 0 0 3 0 2 0 - - - - - 0 +TrigSignatureMoniMT INFO -- #2079901197 Features 0 0 0 0 6 0 4 0 - - - - - TrigSignatureMoniMT INFO HLT_mu11_mu6_bTau_L1MU11_2MU6 #1292401093 -TrigSignatureMoniMT INFO -- #1292401093 Events 4 4 0 0 0 0 4 0 3 0 - - - - - 0 -TrigSignatureMoniMT INFO -- #1292401093 Features 0 0 0 0 8 0 6 0 - - - - - +TrigSignatureMoniMT INFO -- #1292401093 Events 4 4 0 0 0 0 3 0 2 0 - - - - - 0 +TrigSignatureMoniMT INFO -- #1292401093 Features 0 0 0 0 6 0 4 0 - - - - - TrigSignatureMoniMT INFO HLT_mu11_mu6_bUpsimumu_L1MU11_2MU6 #1171632195 -TrigSignatureMoniMT INFO -- #1171632195 Events 4 4 0 0 0 0 4 0 3 0 - - - - - 0 -TrigSignatureMoniMT INFO -- #1171632195 Features 0 0 0 0 8 0 6 0 - - - - - +TrigSignatureMoniMT INFO -- #1171632195 Events 4 4 0 0 0 0 3 0 2 0 - - - - - 0 +TrigSignatureMoniMT INFO -- #1171632195 Features 0 0 0 0 6 0 4 0 - - - - - TrigSignatureMoniMT INFO HLT_mu14_L1MU10 #1696906927 -TrigSignatureMoniMT INFO -- #1696906927 Events 10 10 0 0 0 0 10 7 7 7 - - - - - 7 -TrigSignatureMoniMT INFO -- #1696906927 Features 0 0 0 0 13 8 8 8 - - - - - +TrigSignatureMoniMT INFO -- #1696906927 Events 10 10 0 0 0 0 10 8 8 7 - - - - - 7 +TrigSignatureMoniMT INFO -- #1696906927 Features 0 0 0 0 12 9 10 8 - - - - - TrigSignatureMoniMT INFO HLT_mu20_2mu4noL1_L1MU20 #1029128679 TrigSignatureMoniMT INFO -- #1029128679 Events 8 8 0 0 0 0 8 5 5 5 0 0 0 1 1 1 TrigSignatureMoniMT INFO -- #1029128679 Features 0 0 0 0 10 6 6 6 0 0 0 2 2 TrigSignatureMoniMT INFO HLT_mu20_ivar_L1MU6 #2083734526 -TrigSignatureMoniMT INFO -- #2083734526 Events 10 10 0 0 0 0 10 5 5 - - - - - - 5 -TrigSignatureMoniMT INFO -- #2083734526 Features 0 0 0 0 14 6 5 - - - - - - +TrigSignatureMoniMT INFO -- #2083734526 Events 10 10 0 0 0 0 10 6 5 - - - - - - 5 +TrigSignatureMoniMT INFO -- #2083734526 Features 0 0 0 0 13 7 5 - - - - - - TrigSignatureMoniMT INFO HLT_mu20_ivarmedium_mu8noL1_L1MU20 #3249386942 TrigSignatureMoniMT INFO -- #3249386942 Events 8 8 0 0 0 0 8 5 5 5 3 0 0 1 1 1 TrigSignatureMoniMT INFO -- #3249386942 Features 0 0 0 0 10 6 6 6 3 0 0 1 1 TrigSignatureMoniMT INFO HLT_mu22_2mu4noL1_L1MU20 #3427670100 -TrigSignatureMoniMT INFO -- #3427670100 Events 8 8 0 0 0 0 8 5 5 5 0 0 0 1 1 1 -TrigSignatureMoniMT INFO -- #3427670100 Features 0 0 0 0 10 6 6 6 0 0 0 2 2 +TrigSignatureMoniMT INFO -- #3427670100 Events 8 8 0 0 0 0 8 5 4 4 0 0 0 1 1 1 +TrigSignatureMoniMT INFO -- #3427670100 Features 0 0 0 0 10 6 5 5 0 0 0 2 2 TrigSignatureMoniMT INFO HLT_mu22_mu8noL1_L1MU20 #3165652409 -TrigSignatureMoniMT INFO -- #3165652409 Events 8 8 0 0 0 0 8 5 5 5 0 0 0 2 2 2 -TrigSignatureMoniMT INFO -- #3165652409 Features 0 0 0 0 10 6 6 6 0 0 0 3 3 +TrigSignatureMoniMT INFO -- #3165652409 Events 8 8 0 0 0 0 8 5 4 4 0 0 0 2 2 2 +TrigSignatureMoniMT INFO -- #3165652409 Features 0 0 0 0 10 6 5 5 0 0 0 3 3 TrigSignatureMoniMT INFO HLT_mu24_2mu4noL1_L1MU20 #3233544630 -TrigSignatureMoniMT INFO -- #3233544630 Events 8 8 0 0 0 0 8 5 5 5 0 0 0 1 1 1 -TrigSignatureMoniMT INFO -- #3233544630 Features 0 0 0 0 10 6 6 6 0 0 0 2 2 +TrigSignatureMoniMT INFO -- #3233544630 Events 8 8 0 0 0 0 8 5 4 4 0 0 0 1 1 1 +TrigSignatureMoniMT INFO -- #3233544630 Features 0 0 0 0 10 6 5 5 0 0 0 2 2 TrigSignatureMoniMT INFO HLT_mu24_L1MU20 #417425162 -TrigSignatureMoniMT INFO -- #417425162 Events 8 8 0 0 0 0 8 5 5 5 - - - - - 5 -TrigSignatureMoniMT INFO -- #417425162 Features 0 0 0 0 10 6 6 6 - - - - - +TrigSignatureMoniMT INFO -- #417425162 Events 8 8 0 0 0 0 8 5 4 4 - - - - - 4 +TrigSignatureMoniMT INFO -- #417425162 Features 0 0 0 0 10 6 5 5 - - - - - TrigSignatureMoniMT INFO HLT_mu24_idperf_L1MU20 #677658909 -TrigSignatureMoniMT INFO -- #677658909 Events 8 8 0 0 0 0 6 6 6 6 - - - - - 6 -TrigSignatureMoniMT INFO -- #677658909 Features 0 0 0 0 7 7 7 7 - - - - - +TrigSignatureMoniMT INFO -- #677658909 Events 8 8 0 0 0 0 6 6 5 5 - - - - - 5 +TrigSignatureMoniMT INFO -- #677658909 Features 0 0 0 0 7 7 6 6 - - - - - TrigSignatureMoniMT INFO HLT_mu24_ivarmedium_L1MU20 #737407430 -TrigSignatureMoniMT INFO -- #737407430 Events 8 8 0 0 0 0 8 5 5 5 3 - - - - 3 -TrigSignatureMoniMT INFO -- #737407430 Features 0 0 0 0 10 6 6 6 3 - - - - +TrigSignatureMoniMT INFO -- #737407430 Events 8 8 0 0 0 0 8 5 4 4 2 - - - - 2 +TrigSignatureMoniMT INFO -- #737407430 Features 0 0 0 0 10 6 5 5 2 - - - - TrigSignatureMoniMT INFO HLT_mu24_mu10noL1_L1MU20 #2563354236 -TrigSignatureMoniMT INFO -- #2563354236 Events 8 8 0 0 0 0 8 5 5 5 0 0 0 2 2 2 -TrigSignatureMoniMT INFO -- #2563354236 Features 0 0 0 0 10 6 6 6 0 0 0 3 3 +TrigSignatureMoniMT INFO -- #2563354236 Events 8 8 0 0 0 0 8 5 4 4 0 0 0 2 2 2 +TrigSignatureMoniMT INFO -- #2563354236 Features 0 0 0 0 10 6 5 5 0 0 0 3 3 TrigSignatureMoniMT INFO HLT_mu26_L1MU20 #311138376 TrigSignatureMoniMT INFO -- #311138376 Events 8 8 0 0 0 0 8 5 4 3 - - - - - 3 TrigSignatureMoniMT INFO -- #311138376 Features 0 0 0 0 10 6 5 4 - - - - - @@ -512,11 +593,11 @@ TrigSignatureMoniMT INFO HLT_mu35_ivarmedium_L1M TrigSignatureMoniMT INFO -- #597064890 Events 8 8 0 0 0 0 8 5 3 2 1 - - - - 1 TrigSignatureMoniMT INFO -- #597064890 Features 0 0 0 0 10 6 4 2 1 - - - - TrigSignatureMoniMT INFO HLT_mu50_L1MU20 #3657158931 -TrigSignatureMoniMT INFO -- #3657158931 Events 8 8 0 0 0 0 8 5 1 1 - - - - - 1 -TrigSignatureMoniMT INFO -- #3657158931 Features 0 0 0 0 10 6 1 1 - - - - - +TrigSignatureMoniMT INFO -- #3657158931 Events 8 8 0 0 0 0 8 5 2 1 - - - - - 1 +TrigSignatureMoniMT INFO -- #3657158931 Features 0 0 0 0 10 6 2 1 - - - - - TrigSignatureMoniMT INFO HLT_mu50_RPCPEBSecondaryReadout_L1MU20 #827327262 -TrigSignatureMoniMT INFO -- #827327262 Events 8 8 0 0 0 0 8 5 1 1 1 - - - - 1 -TrigSignatureMoniMT INFO -- #827327262 Features 0 0 0 0 10 6 1 1 1 - - - - +TrigSignatureMoniMT INFO -- #827327262 Events 8 8 0 0 0 0 8 5 2 1 1 - - - - 1 +TrigSignatureMoniMT INFO -- #827327262 Features 0 0 0 0 10 6 2 1 1 - - - - TrigSignatureMoniMT INFO HLT_mu60_0eta105_msonly_L1MU20 #1642591450 TrigSignatureMoniMT INFO -- #1642591450 Events 8 8 0 0 0 0 1 0 0 - - - - - - 0 TrigSignatureMoniMT INFO -- #1642591450 Features 0 0 0 0 2 0 0 - - - - - - @@ -525,28 +606,28 @@ TrigSignatureMoniMT INFO -- #2871837722 Events TrigSignatureMoniMT INFO -- #2871837722 Features 0 0 0 0 10 6 1 1 - - - - - TrigSignatureMoniMT INFO HLT_mu6Comb_L1MU6 #996392590 TrigSignatureMoniMT INFO -- #996392590 Events 10 10 0 0 0 0 10 10 - - - - - - - 10 -TrigSignatureMoniMT INFO -- #996392590 Features 0 0 0 0 14 13 - - - - - - - +TrigSignatureMoniMT INFO -- #996392590 Features 0 0 0 0 13 12 - - - - - - - TrigSignatureMoniMT INFO HLT_mu6_L1MU6 #2560542253 TrigSignatureMoniMT INFO -- #2560542253 Events 10 10 0 0 0 0 10 10 10 10 - - - - - 10 -TrigSignatureMoniMT INFO -- #2560542253 Features 0 0 0 0 14 13 16 15 - - - - - +TrigSignatureMoniMT INFO -- #2560542253 Features 0 0 0 0 13 12 13 13 - - - - - TrigSignatureMoniMT INFO HLT_mu6_idperf_L1MU6 #934918532 TrigSignatureMoniMT INFO -- #934918532 Events 10 10 0 0 0 0 10 10 10 10 - - - - - 10 -TrigSignatureMoniMT INFO -- #934918532 Features 0 0 0 0 14 14 17 17 - - - - - +TrigSignatureMoniMT INFO -- #934918532 Features 0 0 0 0 13 13 13 13 - - - - - TrigSignatureMoniMT INFO HLT_mu6_ivarmedium_L1MU6 #1012713062 TrigSignatureMoniMT INFO -- #1012713062 Events 10 10 0 0 0 0 10 10 10 10 6 - - - - 6 -TrigSignatureMoniMT INFO -- #1012713062 Features 0 0 0 0 14 13 16 15 6 - - - - +TrigSignatureMoniMT INFO -- #1012713062 Features 0 0 0 0 13 12 13 13 6 - - - - TrigSignatureMoniMT INFO HLT_mu6_msonly_L1MU6 #3895421032 TrigSignatureMoniMT INFO -- #3895421032 Events 10 10 0 0 0 0 10 0 10 - - - - - - 10 -TrigSignatureMoniMT INFO -- #3895421032 Features 0 0 0 0 14 0 17 - - - - - - +TrigSignatureMoniMT INFO -- #3895421032 Features 0 0 0 0 13 0 13 - - - - - - TrigSignatureMoniMT INFO HLT_mu6_mu4_L12MU4 #1713982776 -TrigSignatureMoniMT INFO -- #1713982776 Events 4 4 0 0 0 0 4 4 4 4 - - - - - 4 -TrigSignatureMoniMT INFO -- #1713982776 Features 0 0 0 0 8 8 12 10 - - - - - +TrigSignatureMoniMT INFO -- #1713982776 Events 4 4 0 0 0 0 3 3 2 2 - - - - - 2 +TrigSignatureMoniMT INFO -- #1713982776 Features 0 0 0 0 6 6 4 4 - - - - - TrigSignatureMoniMT INFO HLT_mu6_mu6noL1_L1MU6 #451489897 TrigSignatureMoniMT INFO -- #451489897 Events 10 10 0 0 0 0 10 10 10 10 0 0 0 5 3 3 -TrigSignatureMoniMT INFO -- #451489897 Features 0 0 0 0 14 13 16 15 0 0 0 8 6 +TrigSignatureMoniMT INFO -- #451489897 Features 0 0 0 0 13 12 13 13 0 0 0 7 5 TrigSignatureMoniMT INFO HLT_mu6fast_L1MU6 #3518031697 TrigSignatureMoniMT INFO -- #3518031697 Events 10 10 0 0 0 0 10 - - - - - - - - 10 -TrigSignatureMoniMT INFO -- #3518031697 Features 0 0 0 0 14 - - - - - - - - +TrigSignatureMoniMT INFO -- #3518031697 Features 0 0 0 0 13 - - - - - - - - TrigSignatureMoniMT INFO HLT_mu6fast_j45_nojcalib_L1J20 #1776326110 TrigSignatureMoniMT INFO -- #1776326110 Events 19 19 0 0 0 0 0 0 0 0 0 0 - - - 0 TrigSignatureMoniMT INFO -- #1776326110 Features 0 0 0 0 0 0 0 0 0 0 - - - @@ -554,14 +635,17 @@ TrigSignatureMoniMT INFO HLT_mu6fast_xe30_mht_L1 TrigSignatureMoniMT INFO -- #1876869651 Events 19 19 0 0 0 0 0 0 0 0 0 0 - - - 0 TrigSignatureMoniMT INFO -- #1876869651 Features 0 0 0 0 0 0 0 0 0 0 - - - TrigSignatureMoniMT INFO HLT_mu80_L1MU20 #387900377 -TrigSignatureMoniMT INFO -- #387900377 Events 8 8 0 0 0 0 8 5 0 0 - - - - - 0 -TrigSignatureMoniMT INFO -- #387900377 Features 0 0 0 0 10 6 0 0 - - - - - +TrigSignatureMoniMT INFO -- #387900377 Events 8 8 0 0 0 0 8 5 1 0 - - - - - 0 +TrigSignatureMoniMT INFO -- #387900377 Features 0 0 0 0 10 6 1 0 - - - - - TrigSignatureMoniMT INFO HLT_mu80_msonly_3layersEC_L1MU20 #761101109 -TrigSignatureMoniMT INFO -- #761101109 Events 8 8 0 0 0 0 8 0 0 - - - - - - 0 -TrigSignatureMoniMT INFO -- #761101109 Features 0 0 0 0 10 0 0 - - - - - - +TrigSignatureMoniMT INFO -- #761101109 Events 8 8 0 0 0 0 8 0 1 - - - - - - 1 +TrigSignatureMoniMT INFO -- #761101109 Features 0 0 0 0 10 0 1 - - - - - - TrigSignatureMoniMT INFO HLT_mu8_L1MU6 #1467711434 TrigSignatureMoniMT INFO -- #1467711434 Events 10 10 0 0 0 0 10 10 10 10 - - - - - 10 -TrigSignatureMoniMT INFO -- #1467711434 Features 0 0 0 0 14 13 15 15 - - - - - +TrigSignatureMoniMT INFO -- #1467711434 Features 0 0 0 0 13 12 13 13 - - - - - +TrigSignatureMoniMT INFO HLT_noalg_L1All #2979253164 +TrigSignatureMoniMT INFO -- #2979253164 Events 20 20 - - - - - - - - - - - - - 20 +TrigSignatureMoniMT INFO -- #2979253164 Features - - - - - - - - - - - - - TrigSignatureMoniMT INFO HLT_noalg_L1Calo #355689512 TrigSignatureMoniMT INFO -- #355689512 Events 20 20 - - - - - - - - - - - - - 20 TrigSignatureMoniMT INFO -- #355689512 Features - - - - - - - - - - - - - @@ -850,6 +934,9 @@ TrigSignatureMoniMT INFO -- #1063154655 Features TrigSignatureMoniMT INFO HLT_timeburner_L1All #819160059 TrigSignatureMoniMT INFO -- #819160059 Events 20 0 0 - - - - - - - - - - - - 0 TrigSignatureMoniMT INFO -- #819160059 Features 0 - - - - - - - - - - - - +TrigSignatureMoniMT INFO HLT_unconvtrk0_L1EM3 #2063803903 +TrigSignatureMoniMT INFO -- #2063803903 Events 20 20 0 - - - - - - - - - - - - 20 +TrigSignatureMoniMT INFO -- #2063803903 Features 0 - - - - - - - - - - - - TrigSignatureMoniMT INFO HLT_xe100_mht_L1XE50 #532175988 TrigSignatureMoniMT INFO -- #532175988 Events 10 10 0 0 0 0 0 0 0 0 0 9 - - - 9 TrigSignatureMoniMT INFO -- #532175988 Features 0 0 0 0 0 0 0 0 0 9 - - - diff --git a/Trigger/TrigValidation/TrigInDetValidation/CMakeLists.txt b/Trigger/TrigValidation/TrigInDetValidation/CMakeLists.txt index b79b909a9db537df7afb7b87e37f12c42c3a41e1..80bc59b6fef0e28732a66f65198c45f7fb59f9fa 100644 --- a/Trigger/TrigValidation/TrigInDetValidation/CMakeLists.txt +++ b/Trigger/TrigValidation/TrigInDetValidation/CMakeLists.txt @@ -10,8 +10,8 @@ find_package( requests ) # Install files from the package: atlas_install_python_modules( python/*.py ) -atlas_install_joboptions( share/TrigInDetValidation_*.py share/Cosmic.py) -atlas_install_data( share/*.json) +atlas_install_joboptions( share/*.py) +atlas_install_data( share/*.json ) atlas_install_runtime( test/TrigInDetValidation_TestConfiguration.xml share/TrigInDetValidation_*.py TIDAbuild ) atlas_install_scripts( scripts/TIDA*.py test/test*.py POST_BUILD_CMD ${ATLAS_FLAKE8} --extend-ignore=ATL902 ) diff --git a/Trigger/TrigValidation/TrigInDetValidation/python/TrigInDetArtSteps.py b/Trigger/TrigValidation/TrigInDetValidation/python/TrigInDetArtSteps.py index a2729962d6a8f9b8c2a0651365dc217d8759c280..1fdbf0dd4623c1be090390d909cfad5bfb02dd42 100644 --- a/Trigger/TrigValidation/TrigInDetValidation/python/TrigInDetArtSteps.py +++ b/Trigger/TrigValidation/TrigInDetValidation/python/TrigInDetArtSteps.py @@ -22,7 +22,7 @@ from AthenaCommon.Utils.unixtools import FindFile class TrigInDetReco(ExecStep): - def __init__(self, name='TrigInDetReco', postexec_file='' ): + def __init__(self, name='TrigInDetReco', postinclude_file='' ): ExecStep.__init__(self, name) ## super(TrigInDetReco, self).__init__(name) self.type = 'Reco_tf' @@ -34,6 +34,7 @@ class TrigInDetReco(ExecStep): self.timeout = 18*3600 self.slices = [] self.preexec_trig = ' ' + self.postinclude_trig = postinclude_file self.preexec_reco = ';'.join([ 'from RecExConfig.RecFlags import rec', 'rec.doForwardDet=False', @@ -58,11 +59,6 @@ class TrigInDetReco(ExecStep): ]) self.postexec_trig = "from AthenaCommon.AppMgr import ServiceMgr; ServiceMgr.AthenaPoolCnvSvc.MaxFileSizes=['tmp.RDO_TRIG=100000000000']" - if postexec_file!='' : - pe_file = open( postexec_file ) - self.postexec_trig += ";"+pe_file.read() - print( "postexec_trig: ", self.postexec_trig ) - self.postexec_reco = "from AthenaCommon.AppMgr import ServiceMgr; ServiceMgr.AthenaPoolCnvSvc.MaxFileSizes=['tmp.ESD=100000000000']" self.args = '--outputAODFile=AOD.pool.root --steering="doRDO_TRIG" ' @@ -85,7 +81,7 @@ class TrigInDetReco(ExecStep): chains += "'HLT_tau25_idperf_tracktwoMVA_L1TAU12IM'," flags += 'doTauSlice=True;' if (i=='bjet') : - chains += "'HLT_j45_ftf_subjesgscIS_boffperf_split_L1J20'," + chains += "'HLT_j45_ftf_subjesgscIS_boffperf_split_L1J20','HLT_j45_subjesgscIS_ftf_boffperf_split_L1J20'," flags += 'doBjetSlice=True;' if ( i=='fsjet' or i=='fs' or i=='jet' ) : chains += "'HLT_j45_ftf_L1J15'," @@ -103,10 +99,13 @@ class TrigInDetReco(ExecStep): chains += ']' self.preexec_trig = 'doEmptyMenu=True;'+flags+'selectChains='+chains + self.args += ' --preExec "RDOtoRDOTrigger:{:s};" "all:{:s};" "RAWtoESD:{:s};" "ESDtoAOD:{:s};"'.format( self.preexec_trig, self.preexec_all, self.preexec_reco, self.preexec_aod) if (self.postexec_trig != ' '): self.args += ' --postExec "RDOtoRDOTrigger:{:s};" "RAWtoESD:{:s};" '.format(self.postexec_trig, self.postexec_reco) + if (self.postinclude_trig != ''): + self.args += ' --postInclude "RDOtoRDOTrigger:{:s}" '.format(self.postinclude_trig) super(TrigInDetReco, self).configure(test) @@ -211,8 +210,8 @@ class TrigInDetCompStep(RefComparisonStep): if (self.test=='ttbar'): self.output_dir = self.output_dir+"-"+self.slice - if (self.type == 'offl'): - self.output_dir = self.output_dir+'-offl' + if (self.type == 'offline'): + self.output_dir = self.output_dir+'-offline' self.input_file = 'data-hists-offline.root' self.args += self.input_file + ' ' diff --git a/Trigger/TrigValidation/TrigInDetValidation/share/TIDAml_extensions.py b/Trigger/TrigValidation/TrigInDetValidation/share/TIDAml_extensions.py index 7cc870252a8e940b1ede3170727b668f5d907073..158b8b4453ed61aa62a1caa9392f60069bc1e916 100644 --- a/Trigger/TrigValidation/TrigInDetValidation/share/TIDAml_extensions.py +++ b/Trigger/TrigValidation/TrigInDetValidation/share/TIDAml_extensions.py @@ -1,7 +1,8 @@ -ftf = findAlgorithm(topSequence, "TrigFastTrackFinder_JetFS") -ftf.doSeedRedundancyCheck = True -ftf.UseTrigSeedML = 1 #can be 0, 1, 2, or 3, 0 means the -# ML-based seed filtering is off -ftf.TrigSeedML_LUT = 'trigseed_ML_medium.lut' -ftf.OutputLevel=DEBUG +ftf = findAlgorithm(topSequence, "TrigFastTrackFinder__jet") +### ML seeding not yet in master. This file is a placeholder until it is implemented. +#ftf.doSeedRedundancyCheck = True +#ftf.UseTrigSeedML = 1 #can be 0, 1, 2, or 3, 0 means the +## ML-based seed filtering is off +#ftf.TrigSeedML_LUT = 'trigseed_ML_medium.lut' +#ftf.OutputLevel=DEBUG diff --git a/Trigger/TrigValidation/TrigInDetValidation/share/TrigInDetValidation_AODtoTrkNtuple.py b/Trigger/TrigValidation/TrigInDetValidation/share/TrigInDetValidation_AODtoTrkNtuple.py index dce517b9b1d764e1380ec2302d8e6f789aed9ae6..d92aee0f710b01cc1043f26811451ab9395c1333 100644 --- a/Trigger/TrigValidation/TrigInDetValidation/share/TrigInDetValidation_AODtoTrkNtuple.py +++ b/Trigger/TrigValidation/TrigInDetValidation/share/TrigInDetValidation_AODtoTrkNtuple.py @@ -149,7 +149,9 @@ if ( True ) : # ":HLT_IDTrack_FS_FTF", # ":HLT_IDTrack_FS_FTF:roi=HLT_FSRoI:vtx=HLT_IDVertex_FS", - "HLT_j45_ftf_subjesgscIS_boffperf_split_L1J20:HLT_IDTrack_FS_FTF:roi=HLT_FSRoI:vtx=HLT_IDVertex_FS", + "HLT_j45_subjesgscIS_ftf_boffperf_split_L1J20:key=HLT_IDTrack_Bjet_FTF", + "HLT_j45_subjesgscIS_ftf_boffperf_split_L1J20:key=HLT_IDTrack_Bjet_IDTrig", + "HLT_j45_ftf_subjesgscIS_boffperf_split_L1J20:key=HLT_IDTrack_FS_FTF:roi=HLT_FSRoI:vtx=HLT_IDVertex_FS", "HLT_j45_ftf_L1J15:key=HLT_IDTrack_FS_FTF:roi=HLT_FSRoI:vtx=HLT_IDVertex_FS", "HLT_mu.*_idperf.*:HLT_IDTrack_Muon_FTF", diff --git a/Trigger/TrigValidation/TrigInDetValidation/share/TrigInDetValidation_Base.py b/Trigger/TrigValidation/TrigInDetValidation/share/TrigInDetValidation_Base.py index 010a4e1cf97bf7a4ca5f61c0531cac78b2617496..25b27f48a2e18e54b42fcfafad4b39fca0963371 100755 --- a/Trigger/TrigValidation/TrigInDetValidation/share/TrigInDetValidation_Base.py +++ b/Trigger/TrigValidation/TrigInDetValidation/share/TrigInDetValidation_Base.py @@ -29,12 +29,21 @@ except getopt.GetoptError: print("-n N run only on N events per job") -LEvents = 0 -local = False -exclude = False -postproc = False +Events_local = 0 +local = False +exclude = False +postproc = False +lowpt_local = [] +try: GridFiles +except NameError: GridFiles=False + +if GridFiles==True : + use_gridfiles = True +else: + use_gridfiles = False + for opt,arg in opts: if opt in ("-l", "--local"): local=True @@ -43,10 +52,10 @@ for opt,arg in opts: if opt=="-p": postproc=True if opt=="-n": - LEvents=arg + Events_local=arg -if 'postexec' in dir() : - rdo2aod = TrigInDetReco( postexec_file=postexec ) +if 'postinclude_file' in dir() : + rdo2aod = TrigInDetReco( postinclude_file = postinclude_file ) else : rdo2aod = TrigInDetReco() @@ -56,25 +65,37 @@ rdo2aod.slices = Slices rdo2aod.threads = Threads rdo2aod.concurrent_events = Slots +if "Lowpt" in locals() : + if isinstance( Lowpt, list ) : + lowpt_local = Lowpt + else : + lowpt_local = [ Lowpt ] +else : + lowpt_local = [ False ] + + +if "Args" not in locals() : + Args = " " # allow command line to override programed number of events to process -if LEvents != 0 : - rdo2aod.max_events = LEvents +if Events_local != 0 : + rdo2aod.max_events = Events_local else : rdo2aod.max_events = Events rdo2aod.perfmon = False rdo2aod.timeout = 18*3600 -rdo2aod.input = Input # defined in TrigValTools/share/TrigValInputs.json +rdo2aod.input = Input # defined in TrigValTools/share/TrigValInputs.json -if local: +if use_gridfiles: + if local: # rdo2aod.input = 'Single_el_larged0' # defined in TrigValTools/share/TrigValInputs.json - rdo2aod.input = Input # should match definition in TrigValTools/share/TrigValInputs.json -else: - rdo2aod.input = '' - rdo2aod.args += ' --inputRDOFile=$ArtInFile ' + rdo2aod.input = Input # should match definition in TrigValTools/share/TrigValInputs.json + else: + rdo2aod.input = '' + rdo2aod.args += ' --inputRDOFile=$ArtInFile ' @@ -99,16 +120,15 @@ for ref in TrackReference : hist_file = 'data-hists.root' ext = '' - ext1 = '' if ( ref == 'Truth' ) : - args = 'TIDAdata-run3.dat -b Test_bin.dat -o '+hist_file + args = 'TIDAdata-run3.dat -b Test_bin.dat -o ' + hist_file + Args elif ( ref == 'Offline' ) : + # if more than one reefrence ... if len(TrackReference)>1 : hist_file = 'data-hists-offline.root' - ext = '_off' - ext1 = 'offl' - args = 'TIDAdata-run3-offline.dat -b Test_bin.dat -o '+hist_file + ext = 'offline' + args = 'TIDAdata-run3-offline.dat -r Offline -b Test_bin.dat -o ' + hist_file else : # here actually we should allow functionality # to use different pdgid truth or offline as @@ -126,18 +146,26 @@ for ref in TrackReference : # Now the comparitor steps # here, the compararitor must know the name of the root file to process - # we set it in the comparitor job, using the _off extension - # this isn't ideal, since we set the hist file in this code, + # we set it in the comparitor job, using the "offline" extension + # this isn't ideal, since we set the hist file in this code also # so really we should pass it in consistently, and the options # for the directory names should be unrelated - + for slice in Slices : - comp1=TrigInDetCompStep( 'Comp_L2'+slice+ext, 'L2', slice, type=ext1) - test.check_steps.append(comp1) - - if ( RunEF ) : - comp2=TrigInDetCompStep( 'Comp_EF'+slice+ext, 'EF', slice, type=ext1) - test.check_steps.append(comp2) + for _lowpt in lowpt_local : + + stagetag = slice+ext + if _lowpt : + stagetag += "-lowpt" + + print( "stagetag "+stagetag ) + + comp1=TrigInDetCompStep( 'Comp_L2'+stagetag, 'L2', slice, type=ext, lowpt=_lowpt ) + test.check_steps.append(comp1) + + if ( RunEF ) : + comp2=TrigInDetCompStep( 'Comp_EF'+stagetag, 'EF', slice, type=ext, lowpt=_lowpt ) + test.check_steps.append(comp2) diff --git a/Trigger/TrigValidation/TrigInDetValidation/share/comparitor.json b/Trigger/TrigValidation/TrigInDetValidation/share/comparitor.json index 29f2967cbd181333c66b3279749086691f6a2b1d..efd06d7fc0863eae20513e672a7605388af11326 100644 --- a/Trigger/TrigValidation/TrigInDetValidation/share/comparitor.json +++ b/Trigger/TrigValidation/TrigInDetValidation/share/comparitor.json @@ -30,10 +30,10 @@ "chains" : "HLT_tau25_idperf_tracktwo_L1TAU12IM:HLT_IDTrack_TauCore_FTF:HLT_Roi_TauCore HLT_tau25_idperf_tracktwo_L1TAU12IM:HLT_IDTrack_Tau_IDTrig:HLT_TAURoI" }, "L2bjet":{ - "chains" : "HLT_j45_ftf_subjesgscIS_boffperf_split_L1J20:HLT_IDTrack_Bjet_FTF" + "chains" : "HLT_j45_subjesgscIS_ftf_boffperf_split_L1J20:HLT_IDTrack_Bjet_FTF" }, "EFbjet":{ - "chains" : "HLT_j45_ftf_subjesgscIS_boffperf_split_L1J20:HLT_IDTrack_Bjet_FTF HLT_j45_ftf_subjesgscIS_boffperf_split_L1J20:HLT_IDTrack_Bjet_IDTrig" + "chains" : "HLT_j45_subjesgscIS_ftf_boffperf_split_L1J20:HLT_IDTrack_Bjet_FTF HLT_j45_subjesgscIS_ftf_boffperf_split_L1J20:HLT_IDTrack_Bjet_IDTrig" }, "L2FS":{ "chains" : "HLT_j45_ftf_subjesgscIS_boffperf_split_L1J20:HLT_IDTrack_FS_FTF:HLT_FSRoI:HLT_IDVertex_FS" diff --git a/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_el_jpsiee_pu40.py b/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_el_jpsiee_pu40.py index 81ccb5ba4b9c5f9d5da268415225d92bcc902379..6e7be8e1d757a46977c924d2b9c24752cfdef582 100755 --- a/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_el_jpsiee_pu40.py +++ b/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_el_jpsiee_pu40.py @@ -96,19 +96,19 @@ comp4=TrigInDetCompStep('Comp_EFeleLowpt','EF','electron',lowpt=True) test.check_steps.append(comp4) comp5=TrigInDetCompStep('Comp_L2ele_off','L2','electron') -comp5.type='offl' +comp5.type = 'offline' test.check_steps.append(comp5) comp6=TrigInDetCompStep('Comp_EFele_off','EF','electron') -comp6.type='offl' +comp6.type = 'offline' test.check_steps.append(comp6) comp7=TrigInDetCompStep('Comp_L2eleLowpt_off','L2','electron',lowpt=True) -comp7.type='offl' +comp7.type = 'offline' test.check_steps.append(comp7) comp8=TrigInDetCompStep('Comp_EFeleLowpt_off','EF','electron',lowpt=True) -comp8.type='offl' +comp8.type = 'offline' test.check_steps.append(comp8) # CPU cost steps diff --git a/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_el_jpsiee_pu40_mt.py b/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_el_jpsiee_pu40_mt.py index 69ec8f6584f9dbb0b7907c622849d5ada238aa36..c0b2e77ab9c12f15ee5999976f1bd81ab179fe53 100755 --- a/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_el_jpsiee_pu40_mt.py +++ b/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_el_jpsiee_pu40_mt.py @@ -99,19 +99,19 @@ comp4=TrigInDetCompStep('Comp_EFeleLowpt','EF','electron',lowpt=True) test.check_steps.append(comp4) comp5=TrigInDetCompStep('Comp_L2ele_off','L2','electron') -comp5.type='offl' +comp5.type = 'offline' test.check_steps.append(comp5) comp6=TrigInDetCompStep('Comp_EFele_off','EF','electron') -comp6.type='offl' +comp6.type = 'offline' test.check_steps.append(comp6) comp7=TrigInDetCompStep('Comp_L2eleLowpt_off','L2','electron',lowpt=True) -comp7.type='offl' +comp7.type = 'offline' test.check_steps.append(comp7) comp8=TrigInDetCompStep('Comp_EFeleLowpt_off','EF','electron',lowpt=True) -comp8.type='offl' +comp8.type = 'offline' test.check_steps.append(comp8) # CPU cost steps diff --git a/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_el_singlee_7-80.py b/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_el_singlee_7-80.py index 4cd643a07d049c3c85193aade6f0f8563de7d8ec..52c850c961165d71d6dd59a3c55b6122363f082b 100755 --- a/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_el_singlee_7-80.py +++ b/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_el_singlee_7-80.py @@ -99,19 +99,19 @@ comp4=TrigInDetCompStep('Comp_EFeleLowpt','EF','electron',lowpt=True) test.check_steps.append(comp4) comp5=TrigInDetCompStep('Comp_L2ele_off','L2','electron') -comp5.type='offl' +comp5.type = 'offline' test.check_steps.append(comp5) comp6=TrigInDetCompStep('Comp_EFele_off','EF','electron') -comp6.type='offl' +comp6.type = 'offline' test.check_steps.append(comp6) comp7=TrigInDetCompStep('Comp_L2eleLowpt_off','L2','electron',lowpt=True) -comp7.type='offl' +comp7.type = 'offline' test.check_steps.append(comp7) comp8=TrigInDetCompStep('Comp_EFeleLowpt_off','EF','electron',lowpt=True) -comp8.type='offl' +comp8.type = 'offline' test.check_steps.append(comp8) # CPU cost steps diff --git a/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_el_singlee_7-80_larged0.py b/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_el_singlee_7-80_larged0.py index 1c43c8664a8b4b3eb1a3d6cea2800620bf0960a3..4ac76f32f8c1a7ba4d079e651c8e0e7b455f5b47 100755 --- a/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_el_singlee_7-80_larged0.py +++ b/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_el_singlee_7-80_larged0.py @@ -99,19 +99,19 @@ comp4=TrigInDetCompStep('Comp_EFeleLowpt','EF','electron',lowpt=True) test.check_steps.append(comp4) comp5=TrigInDetCompStep('Comp_L2ele_off','L2','electron') -comp5.type='offl' +comp5.type = 'offline' test.check_steps.append(comp5) comp6=TrigInDetCompStep('Comp_EFele_off','EF','electron') -comp6.type='offl' +comp6.type = 'offline' test.check_steps.append(comp6) comp7=TrigInDetCompStep('Comp_L2eleLowpt_off','L2','electron',lowpt=True) -comp7.type='offl' +comp7.type = 'offline' test.check_steps.append(comp7) comp8=TrigInDetCompStep('Comp_EFeleLowpt_off','EF','electron',lowpt=True) -comp8.type='offl' +comp8.type = 'offline' test.check_steps.append(comp8) # CPU cost steps diff --git a/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_el_singlee_7-80_larged0_mt.py b/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_el_singlee_7-80_larged0_mt.py index c7f1fa50f7b4571c85fefcfaf4376d9574e55d6c..fd9ef5187a06d18ba4639670ca87cbc2dc15adbb 100755 --- a/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_el_singlee_7-80_larged0_mt.py +++ b/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_el_singlee_7-80_larged0_mt.py @@ -99,19 +99,19 @@ comp4=TrigInDetCompStep('Comp_EFeleLowpt','EF','electron',lowpt=True) test.check_steps.append(comp4) comp5=TrigInDetCompStep('Comp_L2ele_off','L2','electron') -comp5.type='offl' +comp5.type = 'offline' test.check_steps.append(comp5) comp6=TrigInDetCompStep('Comp_EFele_off','EF','electron') -comp6.type='offl' +comp6.type = 'offline' test.check_steps.append(comp6) comp7=TrigInDetCompStep('Comp_L2eleLowpt_off','L2','electron',lowpt=True) -comp7.type='offl' +comp7.type = 'offline' test.check_steps.append(comp7) comp8=TrigInDetCompStep('Comp_EFeleLowpt_off','EF','electron',lowpt=True) -comp8.type='offl' +comp8.type = 'offline' test.check_steps.append(comp8) # CPU cost steps diff --git a/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_el_singlee_7-80_larged0_pu.py b/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_el_singlee_7-80_larged0_pu.py index 4ffd5df12dbfe5a744f7b06fb83419162eb9f183..927a393c34e6ff0ceb976c1d98c01e90f8b8f6d4 100755 --- a/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_el_singlee_7-80_larged0_pu.py +++ b/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_el_singlee_7-80_larged0_pu.py @@ -96,19 +96,19 @@ comp4=TrigInDetCompStep('Comp_EFeleLowpt','EF','electron',lowpt=True) test.check_steps.append(comp4) comp5=TrigInDetCompStep('Comp_L2ele_off','L2','electron') -comp5.type='offl' +comp5.type = 'offline' test.check_steps.append(comp5) comp6=TrigInDetCompStep('Comp_EFele_off','EF','electron') -comp6.type='offl' +comp6.type = 'offline' test.check_steps.append(comp6) comp7=TrigInDetCompStep('Comp_L2eleLowpt_off','L2','electron',lowpt=True) -comp7.type='offl' +comp7.type = 'offline' test.check_steps.append(comp7) comp8=TrigInDetCompStep('Comp_EFeleLowpt_off','EF','electron',lowpt=True) -comp8.type='offl' +comp8.type = 'offline' test.check_steps.append(comp8) # CPU cost steps diff --git a/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_el_singlee_7-80_larged0_pu_mt.py b/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_el_singlee_7-80_larged0_pu_mt.py index 07649383b63317da7bad7a3dcd935158535bc903..7e3e64be260835e8adf3776a1e86db71ed9d5dee 100755 --- a/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_el_singlee_7-80_larged0_pu_mt.py +++ b/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_el_singlee_7-80_larged0_pu_mt.py @@ -99,19 +99,19 @@ comp4=TrigInDetCompStep('Comp_EFeleLowpt','EF','electron',lowpt=True) test.check_steps.append(comp4) comp5=TrigInDetCompStep('Comp_L2ele_off','L2','electron') -comp5.type='offl' +comp5.type = 'offline' test.check_steps.append(comp5) comp6=TrigInDetCompStep('Comp_EFele_off','EF','electron') -comp6.type='offl' +comp6.type = 'offline' test.check_steps.append(comp6) comp7=TrigInDetCompStep('Comp_L2eleLowpt_off','L2','electron',lowpt=True) -comp7.type='offl' +comp7.type = 'offline' test.check_steps.append(comp7) comp8=TrigInDetCompStep('Comp_EFeleLowpt_off','EF','electron',lowpt=True) -comp8.type='offl' +comp8.type = 'offline' test.check_steps.append(comp8) # CPU cost steps diff --git a/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_el_singlee_7-80_mt.py b/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_el_singlee_7-80_mt.py index 58396e47f29abb82f761786712bae1f1b6aeb35c..e85b7fadb9d3a82c6430fe475efe2f9431b9f3f3 100755 --- a/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_el_singlee_7-80_mt.py +++ b/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_el_singlee_7-80_mt.py @@ -96,19 +96,19 @@ comp4=TrigInDetCompStep('Comp_EFeleLowpt','EF','electron',lowpt=True) test.check_steps.append(comp4) comp5=TrigInDetCompStep('Comp_L2ele_off','L2','electron') -comp5.type='offl' +comp5.type = 'offline' test.check_steps.append(comp5) comp6=TrigInDetCompStep('Comp_EFele_off','EF','electron') -comp6.type='offl' +comp6.type = 'offline' test.check_steps.append(comp6) comp7=TrigInDetCompStep('Comp_L2eleLowpt_off','L2','electron',lowpt=True) -comp7.type='offl' +comp7.type = 'offline' test.check_steps.append(comp7) comp8=TrigInDetCompStep('Comp_EFeleLowpt_off','EF','electron',lowpt=True) -comp8.type='offl' +comp8.type = 'offline' test.check_steps.append(comp8) # CPU cost steps diff --git a/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_el_singlee_7-80_pu40.py b/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_el_singlee_7-80_pu40.py index 092c2a68e3ba2161f95769536d4b2a32ff1dd7e3..6427e643af7636a9ca0946268f66bf51d67ee034 100755 --- a/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_el_singlee_7-80_pu40.py +++ b/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_el_singlee_7-80_pu40.py @@ -99,19 +99,19 @@ comp4=TrigInDetCompStep('Comp_EFeleLowpt','EF','electron',lowpt=True) test.check_steps.append(comp4) comp5=TrigInDetCompStep('Comp_L2ele_off','L2','electron') -comp5.type='offl' +comp5.type = 'offline' test.check_steps.append(comp5) comp6=TrigInDetCompStep('Comp_EFele_off','EF','electron') -comp6.type='offl' +comp6.type = 'offline' test.check_steps.append(comp6) comp7=TrigInDetCompStep('Comp_L2eleLowpt_off','L2','electron',lowpt=True) -comp7.type='offl' +comp7.type = 'offline' test.check_steps.append(comp7) comp8=TrigInDetCompStep('Comp_EFeleLowpt_off','EF','electron',lowpt=True) -comp8.type='offl' +comp8.type = 'offline' test.check_steps.append(comp8) # CPU cost steps diff --git a/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_el_singlee_7-80_pu40_mt.py b/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_el_singlee_7-80_pu40_mt.py index 3576f7f167d536532602f17000a47637b386904f..76095b55c3da9ae5d0ee9d26ba61ac5e9ef74ad1 100755 --- a/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_el_singlee_7-80_pu40_mt.py +++ b/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_el_singlee_7-80_pu40_mt.py @@ -99,19 +99,19 @@ comp4=TrigInDetCompStep('Comp_EFeleLowpt','EF','electron',lowpt=True) test.check_steps.append(comp4) comp5=TrigInDetCompStep('Comp_L2ele_off','L2','electron') -comp5.type='offl' +comp5.type = 'offline' test.check_steps.append(comp5) comp6=TrigInDetCompStep('Comp_EFele_off','EF','electron') -comp6.type='offl' +comp6.type = 'offline' test.check_steps.append(comp6) comp7=TrigInDetCompStep('Comp_L2eleLowpt_off','L2','electron',lowpt=True) -comp7.type='offl' +comp7.type = 'offline' test.check_steps.append(comp7) comp8=TrigInDetCompStep('Comp_EFeleLowpt_off','EF','electron',lowpt=True) -comp8.type='offl' +comp8.type = 'offline' test.check_steps.append(comp8) # CPU cost steps diff --git a/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_el_zee_pu40.py b/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_el_zee_pu40.py index 34b754fab8bf24cb74b8b5d47bfc5f76ee4a47a4..6ac9af2d62a050c1741a96ba8225f273a154ba97 100755 --- a/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_el_zee_pu40.py +++ b/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_el_zee_pu40.py @@ -99,19 +99,19 @@ comp4=TrigInDetCompStep('Comp_EFeleLowpt','EF','electron',lowpt=True) test.check_steps.append(comp4) comp5=TrigInDetCompStep('Comp_L2ele_off','L2','electron') -comp5.type='offl' +comp5.type = 'offline' test.check_steps.append(comp5) comp6=TrigInDetCompStep('Comp_EFele_off','EF','electron') -comp6.type='offl' +comp6.type = 'offline' test.check_steps.append(comp6) comp7=TrigInDetCompStep('Comp_L2eleLowpt_off','L2','electron',lowpt=True) -comp7.type='offl' +comp7.type = 'offline' test.check_steps.append(comp7) comp8=TrigInDetCompStep('Comp_EFeleLowpt_off','EF','electron',lowpt=True) -comp8.type='offl' +comp8.type = 'offline' test.check_steps.append(comp8) # CPU cost steps diff --git a/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_el_zee_pu40_mt.py b/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_el_zee_pu40_mt.py index bbc1c4c283ba919e962322a2edf940133f87bc02..3a09f79728db4cde3f28de22a091ee3b89fde9ec 100755 --- a/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_el_zee_pu40_mt.py +++ b/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_el_zee_pu40_mt.py @@ -99,19 +99,19 @@ comp4=TrigInDetCompStep('Comp_EFeleLowpt','EF','electron',lowpt=True) test.check_steps.append(comp4) comp5=TrigInDetCompStep('Comp_L2ele_off','L2','electron') -comp5.type='offl' +comp5.type = 'offline' test.check_steps.append(comp5) comp6=TrigInDetCompStep('Comp_EFele_off','EF','electron') -comp6.type='offl' +comp6.type = 'offline' test.check_steps.append(comp6) comp7=TrigInDetCompStep('Comp_L2eleLowpt_off','L2','electron',lowpt=True) -comp7.type='offl' +comp7.type = 'offline' test.check_steps.append(comp7) comp8=TrigInDetCompStep('Comp_EFeleLowpt_off','EF','electron',lowpt=True) -comp8.type='offl' +comp8.type = 'offline' test.check_steps.append(comp8) # CPU cost steps diff --git a/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_fsjet_ml_pu40.py b/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_fsjet_ml_pu40.py index 6fe968139ba3126c5c29b632752db2807d396d8f..af59f067543aa08b6cc7d28d80cc8ae17c348c73 100755 --- a/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_fsjet_ml_pu40.py +++ b/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_fsjet_ml_pu40.py @@ -3,7 +3,6 @@ # art-description: art job for fsjet_ml_pu40 # art-type: grid # art-include: master/Athena -# art-input: valid1.410000.PowhegPythiaEvtGen_P2012_ttbar_hdamp172p5_nonallhad.merge.RDO.e4993_s3214_r11315 # art-input-nfiles: 3 # art-athena-mt: 4 # art-memory: 4096 diff --git a/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_fsjet_pu40.py b/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_fsjet_pu40.py index 7215b315d0af0c394b1234bb9871922edd3d9390..1ae91bacce43836497c084fb114abbd1a94a21dc 100755 --- a/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_fsjet_pu40.py +++ b/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_fsjet_pu40.py @@ -3,7 +3,6 @@ # art-description: art job for fsjet_pu40 # art-type: grid # art-include: master/Athena -# art-input: valid1.410000.PowhegPythiaEvtGen_P2012_ttbar_hdamp172p5_nonallhad.merge.RDO.e4993_s3214_r11315 # art-input-nfiles: 3 # art-athena-mt: 4 # art-memory: 4096 diff --git a/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_fsjet_pu40_mt.py b/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_fsjet_pu40_mt.py index 8ffa41345cf08531a60a1c4268645437abd7e917..4360e666a676720dadb833219ae1fb5d097cad5e 100755 --- a/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_fsjet_pu40_mt.py +++ b/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_fsjet_pu40_mt.py @@ -3,7 +3,6 @@ # art-description: art job for fsjet_pu40_mt # art-type: grid # art-include: master/Athena -# art-input: valid1.410000.PowhegPythiaEvtGen_P2012_ttbar_hdamp172p5_nonallhad.merge.RDO.e4993_s3214_r11315 # art-input-nfiles: 3 # art-athena-mt: 4 # art-memory: 4096 diff --git a/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_minbias.py b/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_minbias.py index 66b7477c5d5a9b267fd0cc578c0af5f2269d5319..9ea8361af669cfe89a85e208919a01dad4bea15b 100755 --- a/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_minbias.py +++ b/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_minbias.py @@ -5,7 +5,6 @@ # art-type: grid # art-include: master/Athena # art-html: https://idtrigger-val.web.cern.ch/idtrigger-val/TIDAWeb/TIDAart/?jobdir= -# art-input: mc15_13TeV.361203.Pythia8_A2_MSTW2008LO_ND_minbias.recon.RDO.e3639_s2606_s2174_r7661_tid07858100_00 # art-athena-mt: 4 # art-memory: 4096 # art-output: *.txt diff --git a/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_minbias_mt.py b/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_minbias_mt.py index 99fed652af5e273f99d116bf40a255c550733675..c15bd428cca8c9e0f7d1d34e58f0441776a8601b 100755 --- a/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_minbias_mt.py +++ b/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_minbias_mt.py @@ -5,7 +5,6 @@ # art-type: grid # art-include: master/Athena # art-html: https://idtrigger-val.web.cern.ch/idtrigger-val/TIDAWeb/TIDAart/?jobdir= -# art-input: mc15_13TeV.361203.Pythia8_A2_MSTW2008LO_ND_minbias.recon.RDO.e3639_s2606_s2174_r7661_tid07858100_00 # art-athena-nfiles: 4 # art-athena-mt: 4 # art-memory: 4096 diff --git a/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_mu_bphys.py b/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_mu_bphys.py index 5fdbf2ce1b077a3014efab075b31f64b7dcd56a6..da6abbc0f00dbf4750d2ade060e4cf42ce0428f1 100755 --- a/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_mu_bphys.py +++ b/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_mu_bphys.py @@ -92,19 +92,19 @@ comp4=TrigInDetCompStep('Comp_EFmuonLowpt','EF','muon',lowpt=True) test.check_steps.append(comp4) comp5=TrigInDetCompStep('Comp_L2muon_off','L2','muon') -comp5.type = 'offl' +comp5.type = 'offline' test.check_steps.append(comp5) comp6=TrigInDetCompStep('Comp_EFmuon_off','EF','muon') -comp6.type = 'offl' +comp6.type = 'offline' test.check_steps.append(comp6) comp7=TrigInDetCompStep('Comp_L2muonLowpt_off','L2','muon',lowpt=True) -comp7.type = 'offl' +comp7.type = 'offline' test.check_steps.append(comp7) comp8=TrigInDetCompStep('Comp_EFmuonLowpt_off','EF','muon',lowpt=True) -comp8.type = 'offl' +comp8.type = 'offline' test.check_steps.append(comp8) # CPU cost steps diff --git a/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_mu_bphys_mt.py b/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_mu_bphys_mt.py index 899cff53906cfedd6f975e8439f92101caf323aa..cd4fd198ae58b6c8acfea76066e580171fe140e5 100755 --- a/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_mu_bphys_mt.py +++ b/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_mu_bphys_mt.py @@ -92,19 +92,19 @@ comp4=TrigInDetCompStep('Comp_EFmuonLowpt','EF','muon',lowpt=True) test.check_steps.append(comp4) comp5=TrigInDetCompStep('Comp_L2muon_off','L2','muon') -comp5.type = 'offl' +comp5.type = 'offline' test.check_steps.append(comp5) comp6=TrigInDetCompStep('Comp_EFmuon_off','EF','muon') -comp6.type = 'offl' +comp6.type = 'offline' test.check_steps.append(comp6) comp7=TrigInDetCompStep('Comp_L2muonLowpt_off','L2','muon',lowpt=True) -comp7.type = 'offl' +comp7.type = 'offline' test.check_steps.append(comp7) comp8=TrigInDetCompStep('Comp_EFmuonLowpt_off','EF','muon',lowpt=True) -comp8.type = 'offl' +comp8.type = 'offline' test.check_steps.append(comp8) # CPU cost steps diff --git a/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_mu_singlemu_larged0.py b/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_mu_singlemu_larged0.py index f88401a4f6f90b9b3eb0629e48d31d56d4d0c39e..e4e07c42a1a13fae54c7be02997bfd9f2cc50c31 100755 --- a/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_mu_singlemu_larged0.py +++ b/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_mu_singlemu_larged0.py @@ -99,19 +99,19 @@ comp4=TrigInDetCompStep('Comp_EFmuonLowpt','EF','muon',lowpt=True) test.check_steps.append(comp4) comp5=TrigInDetCompStep('Comp_L2muon_off','L2','muon') -comp5.type = 'offl' +comp5.type = 'offline' test.check_steps.append(comp5) comp6=TrigInDetCompStep('Comp_EFmuon_off','EF','muon') -comp6.type = 'offl' +comp6.type = 'offline' test.check_steps.append(comp6) comp7=TrigInDetCompStep('Comp_L2muonLowpt_off','L2','muon',lowpt=True) -comp7.type = 'offl' +comp7.type = 'offline' test.check_steps.append(comp7) comp8=TrigInDetCompStep('Comp_EFmuonLowpt_off','EF','muon',lowpt=True) -comp8.type = 'offl' +comp8.type = 'offline' test.check_steps.append(comp8) # CPU cost steps diff --git a/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_mu_singlemu_larged0_mt.py b/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_mu_singlemu_larged0_mt.py index ff730d9aa732f5b44d728456c3051315a4f2bc51..e8ae714e91ac5cce5ccd108be4e8120d4c65f85d 100755 --- a/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_mu_singlemu_larged0_mt.py +++ b/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_mu_singlemu_larged0_mt.py @@ -99,19 +99,19 @@ comp4=TrigInDetCompStep('Comp_EFmuonLowpt','EF','muon',lowpt=True) test.check_steps.append(comp4) comp5=TrigInDetCompStep('Comp_L2muon_off','L2','muon') -comp5.type = 'offl' +comp5.type = 'offline' test.check_steps.append(comp5) comp6=TrigInDetCompStep('Comp_EFmuon_off','EF','muon') -comp6.type = 'offl' +comp6.type = 'offline' test.check_steps.append(comp6) comp7=TrigInDetCompStep('Comp_L2muonLowpt_off','L2','muon',lowpt=True) -comp7.type = 'offl' +comp7.type = 'offline' test.check_steps.append(comp7) comp8=TrigInDetCompStep('Comp_EFmuonLowpt_off','EF','muon',lowpt=True) -comp8.type = 'offl' +comp8.type = 'offline' test.check_steps.append(comp8) # CPU cost steps diff --git a/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_mu_singlemu_larged0_pu.py b/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_mu_singlemu_larged0_pu.py index e9b5f086437ade4d571281558db930a61f3b5f79..202384a123070da312ba9c106d49623a27c23582 100755 --- a/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_mu_singlemu_larged0_pu.py +++ b/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_mu_singlemu_larged0_pu.py @@ -99,19 +99,19 @@ comp4=TrigInDetCompStep('Comp_EFmuonLowpt','EF','muon',lowpt=True) test.check_steps.append(comp4) comp5=TrigInDetCompStep('Comp_L2muon_off','L2','muon') -comp5.type = 'offl' +comp5.type = 'offline' test.check_steps.append(comp5) comp6=TrigInDetCompStep('Comp_EFmuon_off','EF','muon') -comp6.type = 'offl' +comp6.type = 'offline' test.check_steps.append(comp6) comp7=TrigInDetCompStep('Comp_L2muonLowpt_off','L2','muon',lowpt=True) -comp7.type = 'offl' +comp7.type = 'offline' test.check_steps.append(comp7) comp8=TrigInDetCompStep('Comp_EFmuonLowpt_off','EF','muon',lowpt=True) -comp8.type = 'offl' +comp8.type = 'offline' test.check_steps.append(comp8) # CPU cost steps cpucost=TrigInDetCpuCostStep('CpuCostStep1', ftf_times=False) diff --git a/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_mu_singlemu_larged0_pu_mt.py b/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_mu_singlemu_larged0_pu_mt.py index bd05f49197d38b0861d6f6bc53992268447c807c..44a3bef9eb28e2b46b10d151e78b3aa5d44e862d 100755 --- a/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_mu_singlemu_larged0_pu_mt.py +++ b/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_mu_singlemu_larged0_pu_mt.py @@ -99,19 +99,19 @@ comp4=TrigInDetCompStep('Comp_EFmuonLowpt','EF','muon',lowpt=True) test.check_steps.append(comp4) comp5=TrigInDetCompStep('Comp_L2muon_off','L2','muon') -comp5.type = 'offl' +comp5.type = 'offline' test.check_steps.append(comp5) comp6=TrigInDetCompStep('Comp_EFmuon_off','EF','muon') -comp6.type = 'offl' +comp6.type = 'offline' test.check_steps.append(comp6) comp7=TrigInDetCompStep('Comp_L2muonLowpt_off','L2','muon',lowpt=True) -comp7.type = 'offl' +comp7.type = 'offline' test.check_steps.append(comp7) comp8=TrigInDetCompStep('Comp_EFmuonLowpt_off','EF','muon',lowpt=True) -comp8.type = 'offl' +comp8.type = 'offline' test.check_steps.append(comp8) # CPU cost steps diff --git a/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_mu_zmumu_pu40.py b/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_mu_zmumu_pu40.py index 202d49a31921ce55acebc89c5f5e5ef59aded857..cfee297e6e69c43a39addbe6c996b153b57efa6f 100755 --- a/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_mu_zmumu_pu40.py +++ b/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_mu_zmumu_pu40.py @@ -5,7 +5,7 @@ # art-include: master/Athena # art-input: mc15_13TeV.361107.PowhegPythia8EvtGen_AZNLOCTEQ6L1_Zmumu.recon.RDO.e3601_s2576_s2132_r7143 # art-input-nfiles: 4 -# art-athena-mt: 4 +# art-athena-mt: 1 # art-memory: 4096 # art-html: https://idtrigger-val.web.cern.ch/idtrigger-val/TIDAWeb/TIDAart/?jobdir= # art-output: *.txt @@ -27,99 +27,18 @@ # art-output: *.dat -from TrigValTools.TrigValSteering import Test, CheckSteps -from TrigInDetValidation.TrigInDetArtSteps import TrigInDetReco, TrigInDetAna, TrigInDetdictStep, TrigInDetCompStep, TrigInDetCpuCostStep +Slices = ['muon'] +RunEF = True +Events = 2000 +Threads = 1 +Slots = 1 # what about the mt: 4 art directive ? nfiles: 3 ? +Input = 'Zmumu_pu40' # defined in TrigValTools/share/TrigValInputs.json -import sys,getopt +TrackReference = [ 'Truth', 'Offline' ] +Lowpt = [ False, True ] -try: - opts, args = getopt.getopt(sys.argv[1:],"lxp",["local"]) -except getopt.GetoptError: - print("Usage: ") - print("-l(--local) run locally with input file from art eos grid-input") - print("-x don't run athena or post post-processing, only plotting") - print("-p run post-processing, even if -x is set") +from AthenaCommon.Include import include +include("TrigInDetValidation/TrigInDetValidation_Base.py") -local=False -exclude=False -postproc=False -for opt,arg in opts: - if opt in ("-l", "--local"): - local=True - if opt=="-x": - exclude=True - if opt=="-p": - postproc=True - - -rdo2aod = TrigInDetReco() -rdo2aod.slices = ['muon'] -rdo2aod.max_events = 8000 -rdo2aod.threads = 1 # TODO: change to 4 -rdo2aod.concurrent_events = 1 # TODO: change to 4 -rdo2aod.perfmon = False -rdo2aod.timeout = 18*3600 -if local: - rdo2aod.input = 'Zmumu_pu40' # defined in TrigValTools/share/TrigValInputs.json -else: - rdo2aod.input = '' - rdo2aod.args += '--inputRDOFile=$ArtInFile ' - - -test = Test.Test() -test.art_type = 'grid' -if (not exclude): - test.exec_steps = [rdo2aod] - test.exec_steps.append(TrigInDetAna()) # Run analysis to produce TrkNtuple - test.check_steps = CheckSteps.default_check_steps(test) - - -# Run Tidardict -if ((not exclude) or postproc ): - rdict = TrigInDetdictStep('TrigInDetDict') - rdict.args='TIDAdata-run3.dat -f data-hists.root -p 13 -b Test_bin.dat ' - test.check_steps.append(rdict) - rdict2 = TrigInDetdictStep('TrigInDetDict2') - rdict2.args='TIDAdata-run3-offline.dat -r Offline -f data-hists-offline.root -b Test_bin.dat ' - test.check_steps.append(rdict2) - -# Now the comparitor steps -comp=TrigInDetCompStep('Comp_L2muon','L2','muon') -test.check_steps.append(comp) - -comp2=TrigInDetCompStep('Comp_EFmuon','EF','muon') -test.check_steps.append(comp2) - -comp3=TrigInDetCompStep('Comp_L2muon_off','L2','muon') -comp3.type = 'offl' -test.check_steps.append(comp3) - -comp4=TrigInDetCompStep('Comp_EFmuon_off','EF','muon') -comp4.type = 'offl' -test.check_steps.append(comp4) - -comp5=TrigInDetCompStep('Comp_L2muonLowpt','L2','muon',lowpt=True) -test.check_steps.append(comp5) - -comp6=TrigInDetCompStep('Comp_EFmuonLowpt','EF','muon',lowpt=True) -test.check_steps.append(comp6) - -comp7=TrigInDetCompStep('Comp_L2muonLowpt_off','L2','muon',lowpt=True) -comp7.type = 'offl' -test.check_steps.append(comp7) - -comp8=TrigInDetCompStep('Comp_EFmuonLowpt_off','EF','muon',lowpt=True) -comp8.type = 'offl' -test.check_steps.append(comp8) - -# CPU cost steps -cpucost=TrigInDetCpuCostStep('CpuCostStep1', ftf_times=False) -test.check_steps.append(cpucost) - -cpucost2=TrigInDetCpuCostStep('CpuCostStep2') -test.check_steps.append(cpucost2) - -import sys -sys.exit(test.run()) diff --git a/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_mu_zmumu_pu40_mt-old.py b/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_mu_zmumu_pu40_mt-old.py new file mode 100755 index 0000000000000000000000000000000000000000..59d3c9157039750270ecbd2419b3cf5ec9a73999 --- /dev/null +++ b/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_mu_zmumu_pu40_mt-old.py @@ -0,0 +1,125 @@ +#!/usr/bin/env python + +# art-description: art job for mu_Zmumu_pu40_mt-old +# art-type: grid +# art-include: master/Athena +# art-input: mc15_13TeV.361107.PowhegPythia8EvtGen_AZNLOCTEQ6L1_Zmumu.recon.RDO.e3601_s2576_s2132_r7143 +# art-input-nfiles: 4 +# art-athena-mt: 4 +# art-memory: 4096 +# art-html: https://idtrigger-val.web.cern.ch/idtrigger-val/TIDAWeb/TIDAart/?jobdir= +# art-output: *.txt +# art-output: *.log +# art-output: log.* +# art-output: *.out +# art-output: *.err +# art-output: *.log.tar.gz +# art-output: *.new +# art-output: *.json +# art-output: *.root +# art-output: *.check* +# art-output: HLT* +# art-output: times* +# art-output: cost-perCall +# art-output: cost-perEvent +# art-output: cost-perCall-chain +# art-output: cost-perEvent-chain +# art-output: *.dat + + +from TrigValTools.TrigValSteering import Test, CheckSteps +from TrigInDetValidation.TrigInDetArtSteps import TrigInDetReco, TrigInDetAna, TrigInDetdictStep, TrigInDetCompStep, TrigInDetCpuCostStep + +import sys,getopt + +try: + opts, args = getopt.getopt(sys.argv[1:],"lxp",["local"]) +except getopt.GetoptError: + print("Usage: ") + print("-l(--local) run locally with input file from art eos grid-input") + print("-x don't run athena or post post-processing, only plotting") + print("-p run post-processing, even if -x is set") + + +local=False +exclude=False +postproc=False +for opt,arg in opts: + if opt in ("-l", "--local"): + local=True + if opt=="-x": + exclude=True + if opt=="-p": + postproc=True + + +rdo2aod = TrigInDetReco() +rdo2aod.slices = ['muon'] +rdo2aod.max_events = 8000 +rdo2aod.threads = 4 +rdo2aod.concurrent_events = 4 +rdo2aod.perfmon = False +rdo2aod.timeout = 18*3600 +if local: + rdo2aod.input = 'Zmumu_pu40' # defined in TrigValTools/share/TrigValInputs.json +else: + rdo2aod.input = '' + rdo2aod.args += '--inputRDOFile=$ArtInFile ' + + +test = Test.Test() +test.art_type = 'grid' +if (not exclude): + test.exec_steps = [rdo2aod] + test.exec_steps.append(TrigInDetAna()) # Run analysis to produce TrkNtuple + test.check_steps = CheckSteps.default_check_steps(test) + + +# Run Tidardict +if ((not exclude) or postproc ): + rdict = TrigInDetdictStep('TrigInDetDict') + rdict.args='TIDAdata-run3.dat -f data-hists.root -p 13 -b Test_bin.dat ' + test.check_steps.append(rdict) + rdict2 = TrigInDetdictStep('TrigInDetDict2') + rdict2.args='TIDAdata-run3-offline.dat -r Offline -f data-hists-offline.root -b Test_bin.dat ' + test.check_steps.append(rdict2) + + +# Now the comparitor steps +comp=TrigInDetCompStep('Comp_L2muon','L2','muon') +test.check_steps.append(comp) + +comp2=TrigInDetCompStep('Comp_EFmuon','EF','muon') +test.check_steps.append(comp2) + +comp3=TrigInDetCompStep('Comp_L2muon_off','L2','muon') +comp3.type = 'offline' +test.check_steps.append(comp3) + +comp4=TrigInDetCompStep('Comp_EFmuon_off','EF','muon') +comp4.type = 'offline' +test.check_steps.append(comp4) + +comp5=TrigInDetCompStep('Comp_L2muonLowpt','L2','muon',lowpt=True) +test.check_steps.append(comp5) + +comp6=TrigInDetCompStep('Comp_EFmuonLowpt','EF','muon',lowpt=True) +test.check_steps.append(comp6) + +comp7=TrigInDetCompStep('Comp_L2muonLowpt_off','L2','muon',lowpt=True) +comp7.type = 'offline' +test.check_steps.append(comp7) + +comp8=TrigInDetCompStep('Comp_EFmuonLowpt_off','EF','muon',lowpt=True) +comp8.type = 'offline' +test.check_steps.append(comp8) + +# CPU cost steps +cpucost=TrigInDetCpuCostStep('CpuCostStep1', ftf_times=False) +test.check_steps.append(cpucost) + +cpucost2=TrigInDetCpuCostStep('CpuCostStep2') +test.check_steps.append(cpucost2) + +import sys +sys.exit(test.run()) diff --git a/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_mu_zmumu_pu40_mt.py b/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_mu_zmumu_pu40_mt.py index b3886bb083bbde1f243756823b8950b0002e6f5c..58c31f0e5ca5543aa335c3bd456d882a8f1b93af 100755 --- a/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_mu_zmumu_pu40_mt.py +++ b/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_mu_zmumu_pu40_mt.py @@ -27,99 +27,20 @@ # art-output: *.dat -from TrigValTools.TrigValSteering import Test, CheckSteps -from TrigInDetValidation.TrigInDetArtSteps import TrigInDetReco, TrigInDetAna, TrigInDetdictStep, TrigInDetCompStep, TrigInDetCpuCostStep +Slices = ['muon'] +RunEF = True +Events = 8000 +Threads = 4 +Slots = 4 # what about the mt: 4 art directive ? nfiles: 3 ? +Input = 'Zmumu_pu40' # defined in TrigValTools/share/TrigValInputs.json +GridFiles=True -import sys,getopt +Args = " -p 13 " +TrackReference = [ 'Truth', 'Offline' ] +Lowpt = [ False, True ] -try: - opts, args = getopt.getopt(sys.argv[1:],"lxp",["local"]) -except getopt.GetoptError: - print("Usage: ") - print("-l(--local) run locally with input file from art eos grid-input") - print("-x don't run athena or post post-processing, only plotting") - print("-p run post-processing, even if -x is set") +from AthenaCommon.Include import include +include("TrigInDetValidation/TrigInDetValidation_Base.py") -local=False -exclude=False -postproc=False -for opt,arg in opts: - if opt in ("-l", "--local"): - local=True - if opt=="-x": - exclude=True - if opt=="-p": - postproc=True - - -rdo2aod = TrigInDetReco() -rdo2aod.slices = ['muon'] -rdo2aod.max_events = 8000 -rdo2aod.threads = 4 -rdo2aod.concurrent_events = 4 -rdo2aod.perfmon = False -rdo2aod.timeout = 18*3600 -if local: - rdo2aod.input = 'Zmumu_pu40' # defined in TrigValTools/share/TrigValInputs.json -else: - rdo2aod.input = '' - rdo2aod.args += '--inputRDOFile=$ArtInFile ' - - -test = Test.Test() -test.art_type = 'grid' -if (not exclude): - test.exec_steps = [rdo2aod] - test.exec_steps.append(TrigInDetAna()) # Run analysis to produce TrkNtuple - test.check_steps = CheckSteps.default_check_steps(test) - - -# Run Tidardict -if ((not exclude) or postproc ): - rdict = TrigInDetdictStep('TrigInDetDict') - rdict.args='TIDAdata-run3.dat -f data-hists.root -p 13 -b Test_bin.dat ' - test.check_steps.append(rdict) - rdict2 = TrigInDetdictStep('TrigInDetDict2') - rdict2.args='TIDAdata-run3-offline.dat -r Offline -f data-hists-offline.root -b Test_bin.dat ' - test.check_steps.append(rdict2) - -# Now the comparitor steps -comp=TrigInDetCompStep('Comp_L2muon','L2','muon') -test.check_steps.append(comp) - -comp2=TrigInDetCompStep('Comp_EFmuon','EF','muon') -test.check_steps.append(comp2) - -comp3=TrigInDetCompStep('Comp_L2muon_off','L2','muon') -comp3.type = 'offl' -test.check_steps.append(comp3) - -comp4=TrigInDetCompStep('Comp_EFmuon_off','EF','muon') -comp4.type = 'offl' -test.check_steps.append(comp4) - -comp5=TrigInDetCompStep('Comp_L2muonLowpt','L2','muon',lowpt=True) -test.check_steps.append(comp5) - -comp6=TrigInDetCompStep('Comp_EFmuonLowpt','EF','muon',lowpt=True) -test.check_steps.append(comp6) - -comp7=TrigInDetCompStep('Comp_L2muonLowpt_off','L2','muon',lowpt=True) -comp7.type = 'offl' -test.check_steps.append(comp7) - -comp8=TrigInDetCompStep('Comp_EFmuonLowpt_off','EF','muon',lowpt=True) -comp8.type = 'offl' -test.check_steps.append(comp8) - -# CPU cost steps -cpucost=TrigInDetCpuCostStep('CpuCostStep1', ftf_times=False) -test.check_steps.append(cpucost) - -cpucost2=TrigInDetCpuCostStep('CpuCostStep2') -test.check_steps.append(cpucost2) - -import sys -sys.exit(test.run()) diff --git a/Trigger/TrigValidation/TriggerTest/share/ref_data_v1Dev_build.ref b/Trigger/TrigValidation/TriggerTest/share/ref_data_v1Dev_build.ref index 2971de46756b0b0571b9f53d21d1b52114d3a440..e6bce93957dd51cc4c88b06d102e626857065215 100644 --- a/Trigger/TrigValidation/TriggerTest/share/ref_data_v1Dev_build.ref +++ b/Trigger/TrigValidation/TriggerTest/share/ref_data_v1Dev_build.ref @@ -1,3 +1,12 @@ +TrigSignatureMoniMT INFO HLT_10j40_pf_subresjesgscIS_ftf_L14J15 #3575805394 +TrigSignatureMoniMT INFO -- #3575805394 Events 20 20 0 0 0 0 0 0 0 0 0 0 - - - 0 +TrigSignatureMoniMT INFO -- #3575805394 Features 0 0 0 0 0 0 0 0 0 0 - - - +TrigSignatureMoniMT INFO HLT_10j40_subjesIS_L14J15 #2760204981 +TrigSignatureMoniMT INFO -- #2760204981 Events 20 20 0 0 0 0 0 0 0 0 0 0 - - - 0 +TrigSignatureMoniMT INFO -- #2760204981 Features 0 0 0 0 0 0 0 0 0 0 - - - +TrigSignatureMoniMT INFO HLT_10j40_subresjesgscIS_ftf_L14J15 #3568675904 +TrigSignatureMoniMT INFO -- #3568675904 Events 20 20 0 0 0 0 0 0 0 0 0 0 - - - 0 +TrigSignatureMoniMT INFO -- #3568675904 Features 0 0 0 0 0 0 0 0 0 0 - - - TrigSignatureMoniMT INFO HLT_2e12_lhloose_mu10_L12EM8VH_MU10 #2518246928 TrigSignatureMoniMT INFO -- #2518246928 Events 20 20 0 0 0 0 0 0 0 0 - - - - - 0 TrigSignatureMoniMT INFO -- #2518246928 Features 0 0 0 0 0 0 0 0 - - - - - @@ -22,6 +31,9 @@ TrigSignatureMoniMT INFO -- #3765708828 Features TrigSignatureMoniMT INFO HLT_2g20_tight_L12EM15VH #3837353071 TrigSignatureMoniMT INFO -- #3837353071 Events 20 20 0 0 0 0 - - - - - - - - - 0 TrigSignatureMoniMT INFO -- #3837353071 Features 0 0 0 0 - - - - - - - - - +TrigSignatureMoniMT INFO HLT_2g20_tight_icaloloose_L12EM15VH #1319738689 +TrigSignatureMoniMT INFO -- #1319738689 Events 20 20 0 0 0 0 - - - - - - - - - 0 +TrigSignatureMoniMT INFO -- #1319738689 Features 0 0 0 0 - - - - - - - - - TrigSignatureMoniMT INFO HLT_2g22_tight_L12EM15VH #708421357 TrigSignatureMoniMT INFO -- #708421357 Events 20 20 0 0 0 0 - - - - - - - - - 0 TrigSignatureMoniMT INFO -- #708421357 Features 0 0 0 0 - - - - - - - - - @@ -97,9 +109,12 @@ TrigSignatureMoniMT INFO -- #2398136098 Features TrigSignatureMoniMT INFO HLT_3j200_L1J100 #2199422919 TrigSignatureMoniMT INFO -- #2199422919 Events 20 20 0 0 0 0 0 0 0 0 0 0 - - - 0 TrigSignatureMoniMT INFO -- #2199422919 Features 0 0 0 0 0 0 0 0 0 0 - - - -TrigSignatureMoniMT INFO HLT_3j200_L1J20 #493765146 -TrigSignatureMoniMT INFO -- #493765146 Events 20 20 0 0 0 0 0 0 0 0 0 0 - - - 0 -TrigSignatureMoniMT INFO -- #493765146 Features 0 0 0 0 0 0 0 0 0 0 - - - +TrigSignatureMoniMT INFO HLT_3j200_pf_subresjesgscIS_ftf_L1J100 #794428037 +TrigSignatureMoniMT INFO -- #794428037 Events 20 20 0 0 0 0 0 0 0 0 0 0 - - - 0 +TrigSignatureMoniMT INFO -- #794428037 Features 0 0 0 0 0 0 0 0 0 0 - - - +TrigSignatureMoniMT INFO HLT_3j200_subresjesgscIS_ftf_L1J100 #1801834652 +TrigSignatureMoniMT INFO -- #1801834652 Events 20 20 0 0 0 0 0 0 0 0 0 0 - - - 0 +TrigSignatureMoniMT INFO -- #1801834652 Features 0 0 0 0 0 0 0 0 0 0 - - - TrigSignatureMoniMT INFO HLT_3mu6_L13MU6 #1832399408 TrigSignatureMoniMT INFO -- #1832399408 Events 20 20 0 0 0 0 0 0 0 0 - - - - - 0 TrigSignatureMoniMT INFO -- #1832399408 Features 0 0 0 0 0 0 0 0 - - - - - @@ -109,12 +124,63 @@ TrigSignatureMoniMT INFO -- #1199773318 Features TrigSignatureMoniMT INFO HLT_3mu8_msonly_L13MU6 #424835335 TrigSignatureMoniMT INFO -- #424835335 Events 20 20 0 0 0 0 0 0 0 - - - - - - 0 TrigSignatureMoniMT INFO -- #424835335 Features 0 0 0 0 0 0 0 - - - - - - +TrigSignatureMoniMT INFO HLT_4j120_pf_subresjesgscIS_ftf_L13J50 #1755129033 +TrigSignatureMoniMT INFO -- #1755129033 Events 20 20 0 0 0 0 0 0 0 0 0 0 - - - 0 +TrigSignatureMoniMT INFO -- #1755129033 Features 0 0 0 0 0 0 0 0 0 0 - - - +TrigSignatureMoniMT INFO HLT_4j120_subjesIS_L13J50 #3722303680 +TrigSignatureMoniMT INFO -- #3722303680 Events 20 20 0 0 0 0 0 0 0 0 0 0 - - - 0 +TrigSignatureMoniMT INFO -- #3722303680 Features 0 0 0 0 0 0 0 0 0 0 - - - +TrigSignatureMoniMT INFO HLT_4j120_subresjesgscIS_ftf_L13J50 #91006165 +TrigSignatureMoniMT INFO -- #91006165 Events 20 20 0 0 0 0 0 0 0 0 0 0 - - - 0 +TrigSignatureMoniMT INFO -- #91006165 Features 0 0 0 0 0 0 0 0 0 0 - - - TrigSignatureMoniMT INFO HLT_4mu4_L14MU4 #1834383636 TrigSignatureMoniMT INFO -- #1834383636 Events 20 20 0 0 0 0 0 0 0 0 - - - - - 0 TrigSignatureMoniMT INFO -- #1834383636 Features 0 0 0 0 0 0 0 0 - - - - - TrigSignatureMoniMT INFO HLT_5j70_0eta240_L14J20 #1175391812 TrigSignatureMoniMT INFO -- #1175391812 Events 20 20 0 0 0 0 0 0 0 0 0 0 - - - 0 TrigSignatureMoniMT INFO -- #1175391812 Features 0 0 0 0 0 0 0 0 0 0 - - - +TrigSignatureMoniMT INFO HLT_5j70_pf_subresjesgscIS_ftf_0eta240_L14J15 #4189027854 +TrigSignatureMoniMT INFO -- #4189027854 Events 20 20 0 0 0 0 0 0 0 0 0 0 - - - 0 +TrigSignatureMoniMT INFO -- #4189027854 Features 0 0 0 0 0 0 0 0 0 0 - - - +TrigSignatureMoniMT INFO HLT_5j70_subresjesgscIS_ftf_0eta240_L14J15 #819918597 +TrigSignatureMoniMT INFO -- #819918597 Events 20 20 0 0 0 0 0 0 0 0 0 0 - - - 0 +TrigSignatureMoniMT INFO -- #819918597 Features 0 0 0 0 0 0 0 0 0 0 - - - +TrigSignatureMoniMT INFO HLT_5j85_pf_subresjesgscIS_ftf_L14J15 #4208121018 +TrigSignatureMoniMT INFO -- #4208121018 Events 20 20 0 0 0 0 0 0 0 0 0 0 - - - 0 +TrigSignatureMoniMT INFO -- #4208121018 Features 0 0 0 0 0 0 0 0 0 0 - - - +TrigSignatureMoniMT INFO HLT_5j85_subjesIS_L14J15 #2745094401 +TrigSignatureMoniMT INFO -- #2745094401 Events 20 20 0 0 0 0 0 0 0 0 0 0 - - - 0 +TrigSignatureMoniMT INFO -- #2745094401 Features 0 0 0 0 0 0 0 0 0 0 - - - +TrigSignatureMoniMT INFO HLT_5j85_subresjesgscIS_ftf_L14J15 #1148892499 +TrigSignatureMoniMT INFO -- #1148892499 Events 20 20 0 0 0 0 0 0 0 0 0 0 - - - 0 +TrigSignatureMoniMT INFO -- #1148892499 Features 0 0 0 0 0 0 0 0 0 0 - - - +TrigSignatureMoniMT INFO HLT_6j55_pf_subresjesgscIS_ftf_0eta240_L14J15 #1526259867 +TrigSignatureMoniMT INFO -- #1526259867 Events 20 20 0 0 0 0 0 0 0 0 0 0 - - - 0 +TrigSignatureMoniMT INFO -- #1526259867 Features 0 0 0 0 0 0 0 0 0 0 - - - +TrigSignatureMoniMT INFO HLT_6j55_subjesIS_0eta240_L14J15 #68179418 +TrigSignatureMoniMT INFO -- #68179418 Events 20 20 0 0 0 0 0 0 0 0 0 0 - - - 0 +TrigSignatureMoniMT INFO -- #68179418 Features 0 0 0 0 0 0 0 0 0 0 - - - +TrigSignatureMoniMT INFO HLT_6j55_subresjesgscIS_ftf_0eta240_L14J15 #1068073241 +TrigSignatureMoniMT INFO -- #1068073241 Events 20 20 0 0 0 0 0 0 0 0 0 0 - - - 0 +TrigSignatureMoniMT INFO -- #1068073241 Features 0 0 0 0 0 0 0 0 0 0 - - - +TrigSignatureMoniMT INFO HLT_6j70_pf_subresjesgscIS_ftf_L14J15 #1755772565 +TrigSignatureMoniMT INFO -- #1755772565 Events 20 20 0 0 0 0 0 0 0 0 0 0 - - - 0 +TrigSignatureMoniMT INFO -- #1755772565 Features 0 0 0 0 0 0 0 0 0 0 - - - +TrigSignatureMoniMT INFO HLT_6j70_subjesIS_L14J15 #1003115860 +TrigSignatureMoniMT INFO -- #1003115860 Events 20 20 0 0 0 0 0 0 0 0 0 0 - - - 0 +TrigSignatureMoniMT INFO -- #1003115860 Features 0 0 0 0 0 0 0 0 0 0 - - - +TrigSignatureMoniMT INFO HLT_6j70_subresjesgscIS_ftf_L14J15 #59957514 +TrigSignatureMoniMT INFO -- #59957514 Events 20 20 0 0 0 0 0 0 0 0 0 0 - - - 0 +TrigSignatureMoniMT INFO -- #59957514 Features 0 0 0 0 0 0 0 0 0 0 - - - +TrigSignatureMoniMT INFO HLT_7j45_pf_subresjesgscIS_ftf_L14J15 #2701381398 +TrigSignatureMoniMT INFO -- #2701381398 Events 20 20 0 0 0 0 0 0 0 0 0 0 - - - 0 +TrigSignatureMoniMT INFO -- #2701381398 Features 0 0 0 0 0 0 0 0 0 0 - - - +TrigSignatureMoniMT INFO HLT_7j45_subjesIS_L14J15 #2617173782 +TrigSignatureMoniMT INFO -- #2617173782 Events 20 20 0 0 0 0 0 0 0 0 0 0 - - - 0 +TrigSignatureMoniMT INFO -- #2617173782 Features 0 0 0 0 0 0 0 0 0 0 - - - +TrigSignatureMoniMT INFO HLT_7j45_subresjesgscIS_ftf_L14J15 #2928962349 +TrigSignatureMoniMT INFO -- #2928962349 Events 20 20 0 0 0 0 0 0 0 0 0 0 - - - 0 +TrigSignatureMoniMT INFO -- #2928962349 Features 0 0 0 0 0 0 0 0 0 0 - - - TrigSignatureMoniMT INFO HLT_JetDS_j0_L1J100 #3302698716 TrigSignatureMoniMT INFO -- #3302698716 Events 20 20 0 0 0 0 0 0 0 0 0 0 0 0 - 0 TrigSignatureMoniMT INFO -- #3302698716 Features 0 0 0 0 0 0 0 0 0 0 0 0 - @@ -166,6 +232,9 @@ TrigSignatureMoniMT INFO -- #1703681121 Features TrigSignatureMoniMT INFO HLT_e26_lhtight_L1EM22VHI #1995263521 TrigSignatureMoniMT INFO -- #1995263521 Events 20 20 0 0 0 0 - - - - - - - - - 0 TrigSignatureMoniMT INFO -- #1995263521 Features 0 0 0 0 - - - - - - - - - +TrigSignatureMoniMT INFO HLT_e26_lhtight_ivarloose_L1EM22VHI #2918307206 +TrigSignatureMoniMT INFO -- #2918307206 Events 20 20 0 0 0 0 - - - - - - - - - 0 +TrigSignatureMoniMT INFO -- #2918307206 Features 0 0 0 0 - - - - - - - - - TrigSignatureMoniMT INFO HLT_e26_lhtight_nod0_L1EM22VHI #939763520 TrigSignatureMoniMT INFO -- #939763520 Events 20 20 0 0 0 0 - - - - - - - - - 0 TrigSignatureMoniMT INFO -- #939763520 Features 0 0 0 0 - - - - - - - - - @@ -232,6 +301,18 @@ TrigSignatureMoniMT INFO -- #1776910226 Features TrigSignatureMoniMT INFO HLT_g20_etcut_LArPEB_L1EM15 #2706532790 TrigSignatureMoniMT INFO -- #2706532790 Events 20 20 4 4 3 3 - - - - - - - - - 3 TrigSignatureMoniMT INFO -- #2706532790 Features 5 5 4 4 - - - - - - - - - +TrigSignatureMoniMT INFO HLT_g20_tight_L1EM15VH #270010748 +TrigSignatureMoniMT INFO -- #270010748 Events 20 20 0 0 0 0 - - - - - - - - - 0 +TrigSignatureMoniMT INFO -- #270010748 Features 0 0 0 0 - - - - - - - - - +TrigSignatureMoniMT INFO HLT_g20_tight_icaloloose_L1EM15VH #4091638976 +TrigSignatureMoniMT INFO -- #4091638976 Events 20 20 0 0 0 0 - - - - - - - - - 0 +TrigSignatureMoniMT INFO -- #4091638976 Features 0 0 0 0 - - - - - - - - - +TrigSignatureMoniMT INFO HLT_g20_tight_icalomedium_L1EM15VH #2032419080 +TrigSignatureMoniMT INFO -- #2032419080 Events 20 20 0 0 0 0 - - - - - - - - - 0 +TrigSignatureMoniMT INFO -- #2032419080 Features 0 0 0 0 - - - - - - - - - +TrigSignatureMoniMT INFO HLT_g20_tight_icalotight_L1EM15VH #2824200612 +TrigSignatureMoniMT INFO -- #2824200612 Events 20 20 0 0 0 0 - - - - - - - - - 0 +TrigSignatureMoniMT INFO -- #2824200612 Features 0 0 0 0 - - - - - - - - - TrigSignatureMoniMT INFO HLT_g25_etcut_L1EM20VH #1417839619 TrigSignatureMoniMT INFO -- #1417839619 Events 20 20 3 3 2 - - - - - - - - - - 2 TrigSignatureMoniMT INFO -- #1417839619 Features 3 3 2 - - - - - - - - - - @@ -301,12 +382,12 @@ TrigSignatureMoniMT INFO -- #4176355792 Features TrigSignatureMoniMT INFO HLT_j420_L1J100 #2659902019 TrigSignatureMoniMT INFO -- #2659902019 Events 20 20 0 0 0 0 0 0 0 0 0 0 - - - 0 TrigSignatureMoniMT INFO -- #2659902019 Features 0 0 0 0 0 0 0 0 0 0 - - - -TrigSignatureMoniMT INFO HLT_j420_L1J20 #2205518067 -TrigSignatureMoniMT INFO -- #2205518067 Events 20 20 0 0 0 0 0 0 0 0 0 0 - - - 0 -TrigSignatureMoniMT INFO -- #2205518067 Features 0 0 0 0 0 0 0 0 0 0 - - - -TrigSignatureMoniMT INFO HLT_j420_subjesgscIS_ftf_L1J20 #2116995085 -TrigSignatureMoniMT INFO -- #2116995085 Events 20 20 0 0 0 0 0 0 0 0 0 0 - - - 0 -TrigSignatureMoniMT INFO -- #2116995085 Features 0 0 0 0 0 0 0 0 0 0 - - - +TrigSignatureMoniMT INFO HLT_j420_pf_subresjesgscIS_ftf_L1J100 #3936932891 +TrigSignatureMoniMT INFO -- #3936932891 Events 20 20 0 0 0 0 0 0 0 0 0 0 - - - 0 +TrigSignatureMoniMT INFO -- #3936932891 Features 0 0 0 0 0 0 0 0 0 0 - - - +TrigSignatureMoniMT INFO HLT_j420_subresjesgscIS_ftf_L1J100 #2477128298 +TrigSignatureMoniMT INFO -- #2477128298 Events 20 20 0 0 0 0 0 0 0 0 0 0 - - - 0 +TrigSignatureMoniMT INFO -- #2477128298 Features 0 0 0 0 0 0 0 0 0 0 - - - TrigSignatureMoniMT INFO HLT_j45_L1J15 #1364976160 TrigSignatureMoniMT INFO -- #1364976160 Events 20 20 0 0 0 0 0 0 0 0 0 6 - - - 6 TrigSignatureMoniMT INFO -- #1364976160 Features 0 0 0 0 0 0 0 0 0 6 - - - @@ -562,6 +643,9 @@ TrigSignatureMoniMT INFO -- #761101109 Features TrigSignatureMoniMT INFO HLT_mu8_L1MU6 #1467711434 TrigSignatureMoniMT INFO -- #1467711434 Events 20 20 0 0 0 0 1 1 0 0 - - - - - 0 TrigSignatureMoniMT INFO -- #1467711434 Features 0 0 0 0 1 1 0 0 - - - - - +TrigSignatureMoniMT INFO HLT_noalg_L1All #2979253164 +TrigSignatureMoniMT INFO -- #2979253164 Events 20 20 - - - - - - - - - - - - - 20 +TrigSignatureMoniMT INFO -- #2979253164 Features - - - - - - - - - - - - - TrigSignatureMoniMT INFO HLT_noalg_L1Calo #355689512 TrigSignatureMoniMT INFO -- #355689512 Events 20 20 - - - - - - - - - - - - - 20 TrigSignatureMoniMT INFO -- #355689512 Features - - - - - - - - - - - - - @@ -850,6 +934,9 @@ TrigSignatureMoniMT INFO -- #1063154655 Features TrigSignatureMoniMT INFO HLT_timeburner_L1All #819160059 TrigSignatureMoniMT INFO -- #819160059 Events 20 20 0 - - - - - - - - - - - - 0 TrigSignatureMoniMT INFO -- #819160059 Features 0 - - - - - - - - - - - - +TrigSignatureMoniMT INFO HLT_unconvtrk0_L1EM3 #2063803903 +TrigSignatureMoniMT INFO -- #2063803903 Events 20 20 0 - - - - - - - - - - - - 20 +TrigSignatureMoniMT INFO -- #2063803903 Features 0 - - - - - - - - - - - - TrigSignatureMoniMT INFO HLT_xe100_mht_L1XE50 #532175988 TrigSignatureMoniMT INFO -- #532175988 Events 20 20 0 0 0 0 0 0 0 0 0 1 - - - 1 TrigSignatureMoniMT INFO -- #532175988 Features 0 0 0 0 0 0 0 0 0 1 - - - diff --git a/Trigger/TriggerCommon/TrigEDMConfig/python/TriggerEDM.py b/Trigger/TriggerCommon/TrigEDMConfig/python/TriggerEDM.py index 03b000d1d0d3ce1311dad690d06357e7698fd7b1..958c933a3c3201cc7b45a42a3d149c6a5b25235c 100644 --- a/Trigger/TriggerCommon/TrigEDMConfig/python/TriggerEDM.py +++ b/Trigger/TriggerCommon/TrigEDMConfig/python/TriggerEDM.py @@ -10,8 +10,8 @@ from TrigEDMConfig.TriggerEDMRun1 import TriggerL2List,TriggerEFList,TriggerResultsRun1List from TrigEDMConfig.TriggerEDMRun2 import TriggerResultsList,TriggerLvl1List,TriggerIDTruth,TriggerHLTList,EDMDetails,EDMLibraries,TriggerL2EvolutionList,TriggerEFEvolutionList -from TrigEDMConfig.TriggerEDMRun3 import TriggerHLTListRun3, AllowedOutputFormats - +from TrigEDMConfig.TriggerEDMRun3 import TriggerHLTListRun3, AllowedOutputFormats,addExtraCollectionsToEDMList +from AthenaConfiguration.AllConfigFlags import ConfigFlags as flags from AthenaCommon.Logging import logging log = logging.getLogger('TriggerEDM') @@ -22,6 +22,12 @@ import six # For Run 3 # #************************************************************ +# Let adding collections via preExec for detailed validation +if flags.Trigger.ExtraEDMList: + log.info( "Adding extra collections to EDM (): {}".format(len(TriggerHLTListRun3), flags.Trigger.ExtraEDMList) ) + addExtraCollectionsToEDMList(TriggerHLTListRun3, flags.Trigger.ExtraEDMList) + log.info( "Number of EDM items after adding extra collections: {}".format(len(TriggerHLTListRun3)) ) + def getTriggerEDMList(key, runVersion): """ diff --git a/Trigger/TriggerCommon/TrigEDMConfig/python/TriggerEDMRun3.py b/Trigger/TriggerCommon/TrigEDMConfig/python/TriggerEDMRun3.py index 325aceef6e9e58fc22bd569cd43a98421f6ed02b..f50ac967409aa0571b53d2369d90c17cbd9c6b2b 100644 --- a/Trigger/TriggerCommon/TrigEDMConfig/python/TriggerEDMRun3.py +++ b/Trigger/TriggerCommon/TrigEDMConfig/python/TriggerEDMRun3.py @@ -539,3 +539,42 @@ def addHLTNavigationToEDMList(edmList, allDecisions, hypoDecisions): edmList.extend([ (typeName, HLTNavEDMTargets, 'Steer'), (typeNameAux, HLTNavEDMTargets, 'Steer')]) + +def addExtraCollectionsToEDMList(edmList, extraList): + """ + Extend edmList with extraList, keeping track whether a completely new + collection is being added, or a dynamic variable is added to an existing collection. + The format of extraList is the same as those of TriggerHLTListRun3. + """ + existing_collections = [(c[0].split("#")[1]).split(".")[0] for c in edmList] + for item in extraList: + colname = (item[0].split("#")[1]).split(".")[0] + if colname not in existing_collections: + # a new collection is added + edmList.append(item) + __log.info("added new item to Trigger EDM: {}".format(item)) + else: + if "Aux." in item[0]: + # probably an extra dynamic variable is added + # new variables to add: + dynVars = (item[0].split("#")[1]).split(".")[1:] + # find the index of the existing item + existing_item_nr = [i for i,s in enumerate(edmList) if colname == (s[0].split("#")[1]).split(".")[0]] + if len(existing_item_nr) != 1: + __log.error("Found {} existing edm items corresponding to new item {}, but it must be exactly one!".format(len(existing_item_nr), item)) + # merge lists of variables + existing_dynVars = (edmList[existing_item_nr[0]][0].split("#")[1]).split(".")[1:] + dynVars.extend(existing_dynVars) + # remove duplicates: + dynVars = list(dict.fromkeys(dynVars)) + newVars = '.'.join(dynVars) + typename = item[0].split("#")[0] + __log.info("old item in Trigger EDM: {}".format(edmList[existing_item_nr[0]])) + targets = edmList[existing_item_nr[0]][1] + signature = edmList[existing_item_nr[0]][2] + edmList.pop(existing_item_nr[0]) + edmList.insert(existing_item_nr[0] , (typename + "#" + colname + "." + newVars, targets, signature)) + __log.info("updated item in Trigger EDM: {}".format(edmList[existing_item_nr[0]])) + else: + # asking to add some collection which is already in the list - do nothing + pass diff --git a/Trigger/TriggerCommon/TriggerJobOpts/CMakeLists.txt b/Trigger/TriggerCommon/TriggerJobOpts/CMakeLists.txt index 1c0d28c58ca9099bd75df90592ae0b61854b7946..f3b6e1be2175f875e38551ab4b15dfa02e292dfb 100644 --- a/Trigger/TriggerCommon/TriggerJobOpts/CMakeLists.txt +++ b/Trigger/TriggerCommon/TriggerJobOpts/CMakeLists.txt @@ -4,7 +4,7 @@ atlas_subdir( TriggerJobOpts ) # Install files from the package: -atlas_install_python_modules( python/*.py ${ATLAS_FLAKE8} ) +atlas_install_python_modules( python/*.py POST_BUILD_CMD ${ATLAS_FLAKE8} ) atlas_install_scripts( test/*.py POST_BUILD_CMD ${ATLAS_FLAKE8} ) atlas_install_joboptions( share/*.py POST_BUILD_CMD ${ATLAS_FLAKE8} ) diff --git a/Trigger/TriggerCommon/TriggerJobOpts/python/SliceFlagsMT.py b/Trigger/TriggerCommon/TriggerJobOpts/python/SliceFlagsMT.py index fc81778f69eed406788d2050be9561c5816099c0..63371925ede90ef4503d2d8a514c6b01ad378cb5 100644 --- a/Trigger/TriggerCommon/TriggerJobOpts/python/SliceFlagsMT.py +++ b/Trigger/TriggerCommon/TriggerJobOpts/python/SliceFlagsMT.py @@ -16,4 +16,5 @@ import TriggerJobOpts.StreamingSliceFlags import TriggerJobOpts.MonitorSliceFlags import TriggerJobOpts.BeamspotSliceFlags import TriggerJobOpts.EnhancedBiasSliceFlags +import TriggerJobOpts.UnconventionalTrackingSliceFlags import TriggerJobOpts.TestSliceFlags diff --git a/Trigger/TriggerCommon/TriggerJobOpts/python/TriggerConfig.py b/Trigger/TriggerCommon/TriggerJobOpts/python/TriggerConfig.py index 982ba3d80f4857ffd18173903d2869a0ee28c67c..24cb4b5f01dbee30919e8a3076d44c777acf2ca5 100644 --- a/Trigger/TriggerCommon/TriggerJobOpts/python/TriggerConfig.py +++ b/Trigger/TriggerCommon/TriggerJobOpts/python/TriggerConfig.py @@ -33,7 +33,7 @@ def collectHypos( steps ): __log.debug( "collecting hypos from step " + stepSeq.getName() ) # start = {} for seq,algs in six.iteritems (flatAlgorithmSequences( stepSeq )): - for alg in algs: + for alg in sorted(algs, key=lambda t: str(t.name)): if isSequence( alg ): continue # will replace by function once dependencies are sorted @@ -45,7 +45,7 @@ def collectHypos( steps ): else: __log.verbose("Not a hypo" + alg.getName()) - return hypos + return OrderedDict(hypos) def __decisionsFromHypo( hypo ): """ return all chains served by this hypo and the key of produced decision object """ @@ -159,7 +159,7 @@ def collectDecisionObjects( hypos, filters, l1decoder, hltSummary ): decisionObjects.update(decObjHypo) decisionObjects.update(decObjFilter) decisionObjects.update(decObjSummary) - return sorted(decisionObjects) + return list(sorted(decisionObjects)) def triggerSummaryCfg(flags, hypos): """ @@ -335,9 +335,10 @@ def triggerBSOutputCfg(flags, summaryAlg, offline=False): # Tool serialising EDM objects to fill the HLT result serialiser = TriggerEDMSerialiserToolCfg('Serialiser') - for item, modules in six.iteritems (ItemModuleDict): - __log.debug('adding to serialiser list: %s, modules: %s', item, modules) - serialiser.addCollection(item, modules) + for item, modules in ItemModuleDict.items(): + sModules = sorted(modules) + __log.debug('adding to serialiser list: %s, modules: %s', item, sModules) + serialiser.addCollection(item, sModules) # Tools adding stream tags and trigger bits to HLT result stmaker = StreamTagMakerToolCfg() @@ -433,10 +434,17 @@ def triggerPOOLOutputCfg(flags, edmSet): return acc -def triggerMergeViewsAndAddMissingEDMCfg( edmSet, hypos, viewMakers, decObj, decObjHypoOut ): +def triggerMergeViewsAndAddMissingEDMCfg( flags, edmSet, hypos, viewMakers, decObj, decObjHypoOut ): HLTEDMCreatorAlg, HLTEDMCreator=CompFactory.getComps("HLTEDMCreatorAlg","HLTEDMCreator",) - from TrigEDMConfig.TriggerEDMRun3 import TriggerHLTListRun3 + from TrigEDMConfig.TriggerEDMRun3 import TriggerHLTListRun3, addExtraCollectionsToEDMList + + __log.info( "Number of EDM items in triggerMergeViewsAndAddMissingEDMCfg: {}".format(len(TriggerHLTListRun3)) ) + if flags.Trigger.ExtraEDMList: + __log.info( "Adding extra collections to EDM: {}".format(flags.Trigger.ExtraEDMList) ) + addExtraCollectionsToEDMList(TriggerHLTListRun3, flags.Trigger.ExtraEDMList) + __log.info( "Number of EDM items after adding extra collections: {}".format(len(TriggerHLTListRun3)) ) + alg = HLTEDMCreatorAlg("EDMCreatorAlg") @@ -577,14 +585,16 @@ def triggerRunCfg( flags, seqName = None, menu=None ): # Add HLT Navigation to EDM list from TrigEDMConfig import TriggerEDMRun3 + __log.info( "Number of EDM items before adding navigation: {}".format(len(TriggerEDMRun3.TriggerHLTListRun3)) ) TriggerEDMRun3.addHLTNavigationToEDMList(TriggerEDMRun3.TriggerHLTListRun3, decObj, decObjHypoOut) + __log.info( "Number of EDM items after adding navigation: {}".format(len(TriggerEDMRun3.TriggerHLTListRun3)) ) # Configure output writing outputAcc, edmSet = triggerOutputCfg( flags, summaryAlg ) acc.merge( outputAcc ) if edmSet: - mergingAlg = triggerMergeViewsAndAddMissingEDMCfg( [edmSet] , hypos, viewMakers, decObj, decObjHypoOut ) + mergingAlg = triggerMergeViewsAndAddMissingEDMCfg( flags, [edmSet] , hypos, viewMakers, decObj, decObjHypoOut ) acc.addEventAlgo( mergingAlg, sequenceName="HLTFinalizeSeq" ) return acc diff --git a/Trigger/TriggerCommon/TriggerJobOpts/python/TriggerConfigFlags.py b/Trigger/TriggerCommon/TriggerJobOpts/python/TriggerConfigFlags.py index 20b243769ba91f9e613c0a16f74f0d592d7db22a..d46f3d48a559f3b82dc7136d69eb06fbb3bc82f2 100644 --- a/Trigger/TriggerCommon/TriggerJobOpts/python/TriggerConfigFlags.py +++ b/Trigger/TriggerCommon/TriggerJobOpts/python/TriggerConfigFlags.py @@ -154,6 +154,9 @@ def createTriggerFlags(): # list of objects to be written to ESD flags.addFlag('Trigger.ESDEDMSet', 'ESD') + # to allow stroing extra EDM items via preExec + flags.addFlag('Trigger.ExtraEDMList', []) + # tag to be used for condutions used by HLT code flags.addFlag('Trigger.OnlineCondTag', 'CONDBR2-HLTP-2018-01') diff --git a/Trigger/TriggerCommon/TriggerJobOpts/python/UnconventionalTrackingSliceFlags.py b/Trigger/TriggerCommon/TriggerJobOpts/python/UnconventionalTrackingSliceFlags.py new file mode 100644 index 0000000000000000000000000000000000000000..0862c49c1a3f57c46e677087eaec455e90213dd5 --- /dev/null +++ b/Trigger/TriggerCommon/TriggerJobOpts/python/UnconventionalTrackingSliceFlags.py @@ -0,0 +1,45 @@ +# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration + +""" UnconventionalTracking slice specific flags """ + +from AthenaCommon.JobProperties import JobProperty, JobPropertyContainer +from AthenaCommon.JobProperties import jobproperties # noqa: F401 +from TriggerJobOpts.CommonSignatureHelper import CommonSignatureHelper + +__doc__="UnconventionalTracking slice specific flags " + + +_flags = [] + + +class SliceList(JobProperty): + """ List of chains provided by the Unconventional Tracking slice """ + statusOn=True + allowedTypes=['list'] + StoredValue=[] +_flags.append(SliceList) + + +class signatures(JobProperty): + """ signatures in UnconventionalTracking slice """ + statusOn=True + allowedTypes = ['list'] + StoredValue = [] +_flags.append(signatures) + + +class UnconventionalTrackingSlice(JobPropertyContainer, CommonSignatureHelper): + """ UnconventionalTracking Slice Flags """ + +from TriggerJobOpts.TriggerFlags import TriggerFlags +TriggerFlags.add_Container(UnconventionalTrackingSlice) + +# add add common slice flags +#TriggerFlags.UnconventionalTrackingSlice.import_JobProperties('TriggerJobOpts.CommonSignatureFlags') + +for flag in _flags: + TriggerFlags.UnconventionalTrackingSlice.add_JobProperty(flag) +del _flags + +# make an alias +UnconventionalTrackingSliceFlags = TriggerFlags.UnconventionalTrackingSlice diff --git a/Trigger/TriggerCommon/TriggerJobOpts/share/runHLT_standalone.py b/Trigger/TriggerCommon/TriggerJobOpts/share/runHLT_standalone.py index 2a9b7361c5a8f3d487307cb496d8149bcd5a35a5..8db42b0135da28dd333fdcb46e2a7a45c868d222 100644 --- a/Trigger/TriggerCommon/TriggerJobOpts/share/runHLT_standalone.py +++ b/Trigger/TriggerCommon/TriggerJobOpts/share/runHLT_standalone.py @@ -1,3 +1,4 @@ + # Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration ################################################################################ # TriggerJobOpts/runHLT_standalone.py @@ -60,6 +61,7 @@ class opt: doMonitorSlice = True doBeamspotSlice = True doCosmicSlice = True + doUnconventionalTrackingSlice = True reverseViews = False filterViews = False enabledSignatures = [] diff --git a/Trigger/TriggerCommon/TriggerMenuMT/CMakeLists.txt b/Trigger/TriggerCommon/TriggerMenuMT/CMakeLists.txt index 7e0d8a6407f5b482542da2dc2e6e8cc1ab74b857..30eb25f176178ce758b0f84b881158719e49ad0c 100644 --- a/Trigger/TriggerCommon/TriggerMenuMT/CMakeLists.txt +++ b/Trigger/TriggerCommon/TriggerMenuMT/CMakeLists.txt @@ -111,6 +111,7 @@ atlas_install_scripts( scripts/generateMenuMT.py scripts/test_HLTmenu.sh scripts/generateL1MenuRun3.py scripts/trigCompareOldandNewL1Menus.py + scripts/trigL1MenuMigrationCheck.sh scripts/verify_menu_config.py scripts/test_full_menu_cf.py ) diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Egamma/ElectronDef.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Egamma/ElectronDef.py index baa42bc230ff14e9b2237f2853db2e1c23cb12ea..c720effd018a51a877c7eaf34d5fcb2eaffbde31 100644 --- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Egamma/ElectronDef.py +++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Egamma/ElectronDef.py @@ -29,6 +29,7 @@ def precisionCaloSequenceCfg( flags ): def precisionElectronSequenceCfg( flags ): return precisionElectronMenuSequence() + # this must be moved to the HypoTool file: def diElectronMassComboHypoToolFromDict(chainDict): from TrigEgammaHypo.TrigEgammaHypoConf import TrigEgammaDielectronMassHypoTool @@ -69,11 +70,21 @@ class ElectronChainConfiguration(ChainConfigurationBase): 'lhvloosenoringer' : ['getFastCalo', 'getFastElectron', 'getPrecisionCaloElectron', 'getPrecisionElectron'], 'lhmediumnoringer' : ['getFastCalo', 'getFastElectron', 'getPrecisionCaloElectron', 'getPrecisionElectron'], 'lhtightnoringer' : ['getFastCalo', 'getFastElectron', 'getPrecisionCaloElectron', 'getPrecisionElectron'], + 'lhlooseivarloose' : ['getFastCalo', 'getFastElectron', 'getPrecisionCaloElectron', 'getPrecisionElectron'], + 'lhlooseivarmedium' : ['getFastCalo', 'getFastElectron', 'getPrecisionCaloElectron', 'getPrecisionElectron'], + 'lhlooseivartight' : ['getFastCalo', 'getFastElectron', 'getPrecisionCaloElectron', 'getPrecisionElectron'], + 'lhlmediumivarloose' : ['getFastCalo', 'getFastElectron', 'getPrecisionCaloElectron', 'getPrecisionElectron'], + 'lhlmediumivarmedium': ['getFastCalo', 'getFastElectron', 'getPrecisionCaloElectron', 'getPrecisionElectron'], + 'lhlmediumivartight' : ['getFastCalo', 'getFastElectron', 'getPrecisionCaloElectron', 'getPrecisionElectron'], + 'lhtightivarloose' : ['getFastCalo', 'getFastElectron', 'getPrecisionCaloElectron', 'getPrecisionElectron'], + 'lhtightivarmedium' : ['getFastCalo', 'getFastElectron', 'getPrecisionCaloElectron', 'getPrecisionElectron'], + 'lhtightivartight' : ['getFastCalo', 'getFastElectron', 'getPrecisionCaloElectron', 'getPrecisionElectron'], } log.debug('electron chain part = ' + str(self.chainPart)) key = self.chainPart['extra'] + self.chainPart['IDinfo'] + self.chainPart['L2IDAlg'] + self.chainPart['isoInfo'] + for addInfo in self.chainPart['addInfo']: key+=addInfo @@ -110,10 +121,14 @@ class ElectronChainConfiguration(ChainConfigurationBase): return self.getStep(3,stepName,[ precisionCaloSequenceCfg]) def getPrecisionElectron(self): + + isocut = self.chainPart['isoInfo'] + log.debug(' isolation cut = ' + str(isocut)) + if "Zee" in self.chainName: - stepName = "precision_topoelectron" + stepName = "precision_topoelectron"+isocut return self.getStep(4,stepName,sequenceCfgArray=[precisionElectronSequenceCfg], comboTools=[diElectronMassComboHypoToolFromDict]) else: - stepName = "precision_electron" + stepName = "precision_electron"+isocut return self.getStep(4,stepName,[ precisionElectronSequenceCfg]) diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Egamma/PhotonDef.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Egamma/PhotonDef.py index 1f9709a6e941d25a7a6ec84793c2e35e138f2a50..69879d416c015c765f099e6f24f9e153d09d5281 100644 --- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Egamma/PhotonDef.py +++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Egamma/PhotonDef.py @@ -57,14 +57,21 @@ class PhotonChainConfiguration(ChainConfigurationBase): # -------------------- # define here the names of the steps and obtain the chainStep configuration # -------------------- - etcut_sequence = [self.getFastCalo(), self.getFastPhoton(), self.getPrecisionCaloPhoton()] - photon_sequence = [self.getFastCalo(), self.getFastPhoton(), self.getPrecisionCaloPhoton(), self.getPrecisionPhoton()] stepDictionary = { - "etcut": etcut_sequence, - "etcutetcut": etcut_sequence, - "loose": photon_sequence, - "medium": photon_sequence, - "tight": photon_sequence, + "etcut": ['getFastCalo', 'getFastPhoton', 'getPrecisionCaloPhoton'], + "etcutetcut": ['getFastCalo', 'getFastPhoton', 'getPrecisionCaloPhoton'], + "loose": ['getFastCalo', 'getFastPhoton', 'getPrecisionCaloPhoton', 'getPrecisionPhoton'], + "medium": ['getFastCalo', 'getFastPhoton', 'getPrecisionCaloPhoton', 'getPrecisionPhoton'], + "tight": ['getFastCalo', 'getFastPhoton', 'getPrecisionCaloPhoton', 'getPrecisionPhoton'], + "looseicaloloose": ['getFastCalo', 'getFastPhoton', 'getPrecisionCaloPhoton', 'getPrecisionPhoton'], + "mediumicaloloose": ['getFastCalo', 'getFastPhoton', 'getPrecisionCaloPhoton', 'getPrecisionPhoton'], + "tighticaloloose": ['getFastCalo', 'getFastPhoton', 'getPrecisionCaloPhoton', 'getPrecisionPhoton'], + "looseicalomedium": ['getFastCalo', 'getFastPhoton', 'getPrecisionCaloPhoton', 'getPrecisionPhoton'], + "mediumicalomedium": ['getFastCalo', 'getFastPhoton', 'getPrecisionCaloPhoton', 'getPrecisionPhoton'], + "tighticalomedium": ['getFastCalo', 'getFastPhoton', 'getPrecisionCaloPhoton', 'getPrecisionPhoton'], + "looseicalotight": ['getFastCalo', 'getFastPhoton', 'getPrecisionCaloPhoton', 'getPrecisionPhoton'], + "mediumicalotight": ['getFastCalo', 'getFastPhoton', 'getPrecisionCaloPhoton', 'getPrecisionPhoton'], + "tighticalotight": ['getFastCalo', 'getFastPhoton', 'getPrecisionCaloPhoton', 'getPrecisionPhoton'], } ## This needs to be configured by the Egamma Developer!! @@ -83,7 +90,8 @@ class PhotonChainConfiguration(ChainConfigurationBase): for step in steps: log.debug('Adding photon trigger step ' + str(step)) - chainSteps+=[step] + chainstep = getattr(self, step)() + chainSteps+=[chainstep] myChain = self.buildChain(chainSteps) return myChain diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/DictFromChainName.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/DictFromChainName.py index 43c8626b8c53888335abf2fec51b8454c0dc5f05..568f4ec9d19e1188d28c069268edf9ac88f8a3e4 100755 --- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/DictFromChainName.py +++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/DictFromChainName.py @@ -276,7 +276,7 @@ def analyseChainName(chainName, L1thresholds, L1item): (AllowedCalibChainIdentifiers, 'Calib', 'calib'), (AllowedMonitorChainIdentifiers, 'Monitor', 'calib'), (AllowedBeamspotChainIdentifiers, 'Beamspot', 'beamspot'), - (['eb'], 'EnhancedBias', 'eb') ]: + (['eb'], 'EnhancedBias', 'eb')]: if cpart in chainCategory[0]: log.debug('Doing chain type {}'.format(chainCategory[1])) multichainindex.append(hltChainNameShort.index(cpart)) diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/GenerateMenuMT.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/GenerateMenuMT.py index 139b8e871d87f2a9faa5eea11c9ae40af521edff..47b508b57744cead0aa12484615e0726b3d1844c 100755 --- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/GenerateMenuMT.py +++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/GenerateMenuMT.py @@ -66,7 +66,7 @@ class GenerateMenuMT(object): self.signaturesToGenerate = [] self.allSignatures = ['Egamma', 'Muon', 'Jet', 'Bjet', 'Bphysics', 'MET', 'Tau', 'HeavyIon', 'Beamspot', 'Cosmic', 'EnhancedBias', - 'Monitor', 'Calib', 'Streaming', 'Combined', 'MinBias', 'Test'] #, AFP + 'Monitor', 'Calib', 'Streaming', 'Combined', 'MinBias', 'UnconventionalTracking', 'Test'] #, AFP self.calibCosmicMonSigs = ['Streaming','Monitor','Beamspot','Cosmic', 'Calib'] #others not implemented yet ['Beamspot', 'Cosmic', 'EnhancedBias', 'Monitor', 'Calib', 'Streaming'] # flags @@ -86,6 +86,7 @@ class GenerateMenuMT(object): self.doMonitorChains = True self.doBeamspotChains = True self.doEnhancedBiasChains = True + self.doUnconventionalTrackingChains = True self.doCombinedChains = True self.doTestChains = True diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/HLTCFConfig.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/HLTCFConfig.py index b4a112df0a0bbee00903a67ac53e5b90b5fc3b74..8cb1cb454e15cb34937d47a02aa9895b36a8e518 100644 --- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/HLTCFConfig.py +++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/HLTCFConfig.py @@ -107,9 +107,8 @@ def createCFTree(CFseq): for menuseq in CFseq.step.sequences: menuseq.addToSequencer(recoSeqSet,hypoSet) - #list(dict.fromkeys()) is guaranteed to respect ordering from python 3.7 onwards - stepReco += list(dict.fromkeys([recoseq for recoseq in recoSeqSet])) - seqAndView += list(dict.fromkeys([hypo for hypo in hypoSet])) + stepReco += sorted(list(recoSeqSet), key=lambda t: t.name()) + seqAndView += sorted(list(hypoSet), key=lambda t: t.name()) if CFseq.step.isCombo: seqAndView += CFseq.step.combo.Alg @@ -190,7 +189,7 @@ def makeHLTTree(newJO=False, triggerConfigHLT = None): appendCAtoAthena( monAcc ) Configurable.configurableRun3Behavior=1 - edmAlg = triggerMergeViewsAndAddMissingEDMCfg(['AOD', 'ESD'], hypos, viewMakers, decObj, decObjHypoOut) + edmAlg = triggerMergeViewsAndAddMissingEDMCfg(ConfigFlags, ['AOD', 'ESD'], hypos, viewMakers, decObj, decObjHypoOut) Configurable.configurableRun3Behavior=0 # C) Finally, we create the EDM output hltFinalizeSeq += conf2toConfigurable(edmAlg) diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/LS2_v1.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/LS2_v1.py index d123fde87d4fb8665be8c3722f2e77e17dbf29ea..b8e6236f7c3d28860573425c1531b4c4d28e7d40 100644 --- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/LS2_v1.py +++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/LS2_v1.py @@ -118,6 +118,7 @@ def setupMenu(): # Primary ChainProp(name='HLT_e17_lhvloose_nod0_L1EM15VH', groups=SingleElectronGroup), ChainProp(name='HLT_e26_lhtight_L1EM22VHI', groups=SingleElectronGroup), + ChainProp(name='HLT_e26_lhtight_ivarloose_L1EM22VHI', groups=SingleElectronGroup), ChainProp(name='HLT_e26_lhtight_nod0_L1EM22VHI', groups=SingleElectronGroup), ChainProp(name='HLT_e26_lhtight_nod0_L1EM24VHI', groups=SingleElectronGroup), ChainProp(name='HLT_e60_lhmedium_L1EM22VHI', groups=SingleElectronGroup), @@ -147,12 +148,17 @@ def setupMenu(): ChainProp(name='HLT_g25_loose_L1EM20VH', groups=SinglePhotonGroup), ChainProp(name='HLT_g25_medium_L1EM20VH', groups=SinglePhotonGroup), ChainProp(name='HLT_g25_tight_L1EM20VH', groups=SinglePhotonGroup), + ChainProp(name='HLT_g20_tight_L1EM15VH', groups=SinglePhotonGroup), + ChainProp(name='HLT_g20_tight_icaloloose_L1EM15VH', groups=SinglePhotonGroup), + ChainProp(name='HLT_g20_tight_icalomedium_L1EM15VH', groups=SinglePhotonGroup), + ChainProp(name='HLT_g20_tight_icalotight_L1EM15VH', groups=SinglePhotonGroup), # Primary photon chains ChainProp(name='HLT_g140_loose_L1EM22VHI', groups=SinglePhotonGroup), ChainProp(name='HLT_2g35_medium_L12EM20VH', groups=MultiPhotonGroup), ChainProp(name='HLT_g35_medium_g25_medium_L12EM20VH', groups=MultiPhotonGroup), ChainProp(name='HLT_2g20_tight_L12EM15VH', groups=MultiPhotonGroup), #ChainProp(name='HLT_2g22_tight_L12EM15VHI', groups=MultiPhotonGroup), + ChainProp(name='HLT_2g20_tight_icaloloose_L12EM15VH', groups=MultiPhotonGroup), ChainProp(name='HLT_2g22_tight_L12EM15VH', groups=MultiPhotonGroup), ChainProp(name='HLT_2g50_loose_L12EM20VH', groups=MultiPhotonGroup), @@ -195,7 +201,6 @@ def setupMenu(): TriggerFlags.JetSlice.signatures = TriggerFlags.JetSlice.signatures() + [ ChainProp(name='HLT_j85_L1J20', groups=SingleJetGroup), ChainProp(name='HLT_j45_L1J15', groups=SingleJetGroup), - ChainProp(name='HLT_j420_L1J20', groups=SingleJetGroup), ChainProp(name='HLT_j45_subjesgscIS_ftf_L1J15', groups=SingleJetGroup), ChainProp(name='HLT_j45_subresjesgscIS_ftf_L1J15', groups=SingleJetGroup), ChainProp(name='HLT_j45_subjesgscIS_ftf_011jvt_L1J15', groups=SingleJetGroup), @@ -204,14 +209,11 @@ def setupMenu(): ChainProp(name='HLT_j45_ftf_L1J15', groups=SingleJetGroup), ChainProp(name='HLT_j85_ftf_L1J20', groups=SingleJetGroup), - ChainProp(name='HLT_j45_pf_ftf_L1J20', groups=SingleJetGroup), ChainProp(name='HLT_j45_pf_subjesgscIS_ftf_L1J20', groups=SingleJetGroup), ChainProp(name='HLT_j45_pf_subresjesgscIS_ftf_L1J20', groups=SingleJetGroup), ChainProp(name='HLT_j85_pf_ftf_L1J20', groups=SingleJetGroup), - ChainProp(name='HLT_j420_subjesgscIS_ftf_L1J20', groups=SingleJetGroup), - ChainProp(name='HLT_j45_nojcalib_L1J20', groups=SingleJetGroup), ChainProp(name='HLT_j45_sktc_nojcalib_L1J20', groups=SingleJetGroup), ChainProp(name='HLT_j45_cssktc_nojcalib_L1J20', groups=SingleJetGroup), @@ -234,7 +236,6 @@ def setupMenu(): ChainProp(name='HLT_j460_a10sd_csskpf_jes_ftf_35smcINF_L1J100', groups=SingleJetGroup), ChainProp(name='HLT_2j330_a10sd_csskpf_jes_ftf_35smcINF_L1J100', groups=SingleJetGroup), - ChainProp(name='HLT_3j200_L1J20', groups=MultiJetGroup), ChainProp(name='HLT_j0_vbenfSEP30etSEP34mass35SEP50fbet_L1J20', groups=SingleJetGroup), # ATR-20624 @@ -243,6 +244,39 @@ def setupMenu(): # TLA test chain, ATR-20395 ChainProp(name='HLT_JetDS_j0_L1J100', stream=['JetDS'], groups=SingleJetGroup), + # ATR-22096 + ChainProp(name='HLT_j420_subresjesgscIS_ftf_L1J100', groups=SingleJetGroup), + ChainProp(name='HLT_j420_pf_subresjesgscIS_ftf_L1J100', groups=SingleJetGroup), + # + ChainProp(name='HLT_3j200_subresjesgscIS_ftf_L1J100', groups=MultiJetGroup), + ChainProp(name='HLT_3j200_pf_subresjesgscIS_ftf_L1J100', groups=MultiJetGroup), + # + ChainProp(name='HLT_4j120_subjesIS_L13J50', groups=MultiJetGroup), + ChainProp(name='HLT_4j120_subresjesgscIS_ftf_L13J50', groups=MultiJetGroup), + ChainProp(name='HLT_4j120_pf_subresjesgscIS_ftf_L13J50', groups=MultiJetGroup), + # + ChainProp(name='HLT_5j70_subresjesgscIS_ftf_0eta240_L14J15', groups=MultiJetGroup), + ChainProp(name='HLT_5j70_pf_subresjesgscIS_ftf_0eta240_L14J15', groups=MultiJetGroup), + # + ChainProp(name='HLT_5j85_subjesIS_L14J15', groups=MultiJetGroup), + ChainProp(name='HLT_5j85_subresjesgscIS_ftf_L14J15', groups=MultiJetGroup), + ChainProp(name='HLT_5j85_pf_subresjesgscIS_ftf_L14J15', groups=MultiJetGroup), + # + ChainProp(name='HLT_6j55_subjesIS_0eta240_L14J15', groups=MultiJetGroup), + ChainProp(name='HLT_6j55_subresjesgscIS_ftf_0eta240_L14J15', groups=MultiJetGroup), + ChainProp(name='HLT_6j55_pf_subresjesgscIS_ftf_0eta240_L14J15', groups=MultiJetGroup), + # + ChainProp(name='HLT_6j70_subjesIS_L14J15', groups=MultiJetGroup), + ChainProp(name='HLT_6j70_subresjesgscIS_ftf_L14J15', groups=MultiJetGroup), + ChainProp(name='HLT_6j70_pf_subresjesgscIS_ftf_L14J15', groups=MultiJetGroup), + # + ChainProp(name='HLT_7j45_subjesIS_L14J15', groups=MultiJetGroup), + ChainProp(name='HLT_7j45_subresjesgscIS_ftf_L14J15', groups=MultiJetGroup), + ChainProp(name='HLT_7j45_pf_subresjesgscIS_ftf_L14J15', groups=MultiJetGroup), + # + ChainProp(name='HLT_10j40_subjesIS_L14J15', groups=MultiJetGroup), + ChainProp(name='HLT_10j40_subresjesgscIS_ftf_L14J15', groups=MultiJetGroup), + ChainProp(name='HLT_10j40_pf_subresjesgscIS_ftf_L14J15', groups=MultiJetGroup), ] TriggerFlags.BjetSlice.signatures = TriggerFlags.BjetSlice.signatures() + [ @@ -342,6 +376,7 @@ def setupMenu(): #ChainProp(name='HLT_noalg_zb_L1ZB', l1SeedThresholds=['FSNOSEED'], stream=['ZeroBias'], groups=ZeroBiasGroup), ChainProp(name='HLT_noalg_L1MBTS_2_EMPTY', l1SeedThresholds=['FSNOSEED'], stream=['MinBias'], groups=MinBiasGroup), #ATR-21999 ChainProp(name='HLT_noalg_L1MBTS_1_1_EMPTY', l1SeedThresholds=['FSNOSEED'], stream=['MinBias'], groups=MinBiasGroup), #ATR-21999 + ChainProp(name='HLT_noalg_L1All', l1SeedThresholds=['FSNOSEED'], stream=[PhysicsStream], groups=['RATE:SeededStreamers', 'BW:Other']), # ATR-22072, for rates in MC. To move to MC menu once good nightly in LS2_v1. ] TriggerFlags.MonitorSlice.signatures = TriggerFlags.MonitorSlice.signatures() + [ @@ -352,4 +387,7 @@ def setupMenu(): TriggerFlags.EnhancedBiasSlice.signatures = TriggerFlags.EnhancedBiasSlice.signatures() + [ ] + TriggerFlags.UnconventionalTrackingSlice.signatures = TriggerFlags.UnconventionalTrackingSlice.signatures() + [ + ChainProp(name='HLT_unconvtrk0_L1EM3', groups=SinglePhotonGroup, l1SeedThresholds=['FSNOSEED']), + ] 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 4d7d83583376656992385c9e0bdd110d4013abd3..7c4c3d12940e0ece729e80c5b745d497eebb1b1b 100644 --- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/LS2_v1_newJO.py +++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/LS2_v1_newJO.py @@ -41,7 +41,11 @@ def setupMenu(flags): flags.Trigger.menu.muon = [ ChainProp(name='HLT_mu20_L1MU20', groups=SingleMuonGroup), ChainProp(name='HLT_mu10_L1MU10', groups=SingleMuonGroup), - ChainProp(name='HLT_mu8_L1MU6', groups=SingleMuonGroup) + ChainProp(name='HLT_mu8_L1MU6', groups=SingleMuonGroup), + + ChainProp(name='HLT_mu20_msonly_L1MU20', groups=SingleMuonGroup), + ChainProp(name='HLT_mu10_msonly_L1MU10', groups=SingleMuonGroup), + ChainProp(name='HLT_mu8_msonly_L1MU6', groups=SingleMuonGroup) ] flags.Trigger.menu.electron = [ diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/MenuAlignmentTools.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/MenuAlignmentTools.py index 55a0690d61884ba351aff35323161257f3b7d95b..2d5252be534c8fec6cc94597afc10051cd999031 100644 --- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/MenuAlignmentTools.py +++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/MenuAlignmentTools.py @@ -20,7 +20,8 @@ the_signature_grouping = OrderedDict([ ('Jet','JetMET'), ('MET','JetMET'), ('Bjet','JetMET'), - ('MuonnoL1', 'MuonnoL1') + ('MuonnoL1', 'MuonnoL1'), + ('UnconventionalTracking','UnconventionalTracking'), ]) def getAlignmentGroupFromPattern(sName, extra): @@ -122,4 +123,3 @@ def setChainSignatures(signatures, lengthOfChainConfigs): # maybe they should all be added to the_signature_grouping, even if they never # need to be merged together return signatures, lengthOfChainConfigs - diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/Physics_pp_run3_v1.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/Physics_pp_run3_v1.py index f00186c181c169bdee7aaf4bc32113d601619ff8..6ad08d81ca8fa866498fa49c3d3182269b5baebd 100644 --- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/Physics_pp_run3_v1.py +++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/Physics_pp_run3_v1.py @@ -144,3 +144,4 @@ def setupMenu(): # Random Seeded EB chains which select at the HLT based on L1 TBP bits TriggerFlags.EnhancedBiasSlice.signatures = [ ] + TriggerFlags.UnconventionalTrackingSlice.signatures = [ ] diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/SignatureDicts.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/SignatureDicts.py index 75118f0600c4cd18be90967166a068135fe445da..3140cc69c7890bc49f1c0c15244e7ba0280a8c71 100644 --- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/SignatureDicts.py +++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/SignatureDicts.py @@ -28,6 +28,7 @@ SliceIDDict = { 'Monitor' : 'mon', 'Beamspot' : 'beamspot', 'EnhancedBias' : 'eb', + 'UnconventionalTracking' : 'unconvtrk', 'Test' : 'TestChain', } @@ -36,6 +37,7 @@ AllowedSignatures = ["jet", "bjet", "ht", "muon", "met", "tau", + "unconvtrk", "minbias", "heavyion", "cosmic", @@ -62,7 +64,7 @@ ChainDictTemplate = { #========================================================== # Test chains #========================================================== -# ---- Test Dictinary of all allowed Values ---- +# ---- Test Dictionary of all allowed Values ---- TestChainParts = { 'L1threshold' : '', 'signature' : ['Test'], @@ -90,7 +92,7 @@ TestChainParts_Default = { # Jet #========================================================== AllowedTopos_jet = [] -# ---- Jet Dictinary of all allowed Values ---- +# ---- Jet Dictionary of all allowed Values ---- JetChainParts = { 'signature' : ['Jet'], 'alignmentGroup': ['Jet','JetMET'], @@ -135,7 +137,7 @@ JetChainParts = { 'smc' : ['30smcINF', '35smcINF', '40smcINF', '50smcINF', '60smcINF', 'nosmc'], } -# ---- Jet Dictinary of default Values ---- +# ---- Jet Dictionary of default Values ---- JetChainParts_Default = { 'signature' : ['Jet'], 'alignmentGroup': ['Jet'], @@ -173,13 +175,13 @@ bJetChainParts_Default = { #========================================================== # HT chains #========================================================== -# ---- HT Dictinary of all allowed Values ---- +# ---- HT Dictionary of all allowed Values ---- HTChainParts = deepcopy(JetChainParts) HTChainParts['signature'] = ['HT'] HTChainParts['trigType'] = ['ht'] HTChainParts['extra'] = ['j20', 'j25', 'j30', 'test4'] -# ---- HTDictinary of default Values ---- +# ---- HTDictionary of default Values ---- HTChainParts_Default = deepcopy(JetChainParts_Default) HTChainParts_Default['signature'] = ['HT'] HTChainParts_Default['trigType'] = 'ht' @@ -190,7 +192,7 @@ HTChainParts_Default['extra'] = '' #========================================================== AllowedTopos_mu = [] -# ---- Muon Dictinary of all allowed Values ---- +# ---- Muon Dictionary of all allowed Values ---- MuonChainParts = { 'signature' : ['Muon'], 'alignmentGroup' : ['Muon','MuonnoL1'], @@ -208,7 +210,7 @@ MuonChainParts = { 'topo' : AllowedTopos_mu, 'flavour' : [], } -# ---- MuonDictinary of default Values ---- +# ---- MuonDictionary of default Values ---- MuonChainParts_Default = { 'signature' : ['Muon'], 'alignmentGroup' : ['Muon'], @@ -231,12 +233,12 @@ MuonChainParts_Default = { #========================================================== AllowedTopos_Bphysics = ['bJpsimumu','bUpsimumu','bBmumu','bDimu','bDimu2700','bPhi','bTau'] -# ---- Bphysics Dictinary of all allowed Values ---- +# ---- Bphysics Dictionary of all allowed Values ---- BphysicsChainParts = deepcopy(MuonChainParts) BphysicsChainParts['signature'] = ['Bphysics'] BphysicsChainParts['topo'] = AllowedTopos_Bphysics -# ---- Bphysics Dictinary of default Values ---- +# ---- Bphysics Dictionary of default Values ---- BphysicsChainParts_Default = deepcopy(MuonChainParts_Default) BphysicsChainParts_Default['signature'] = ['Bphysics'] BphysicsChainParts_Default['topo'] = [] @@ -286,7 +288,7 @@ TauChainParts_Default = { # MET #========================================================== AllowedTopos_xe = [] -# ---- Met Dictinary of all allowed Values ---- +# ---- Met Dictionary of all allowed Values ---- METChainParts = { 'signature' : ['MET'], 'alignmentGroup' : ['MET','JetMET'], @@ -306,7 +308,7 @@ METChainParts = { 'EFmuonCorr' : [], 'addInfo' : ['FStracks'], } -# ---- MetDictinary of default Values ---- +# ---- MetDictionary of default Values ---- METChainParts_Default = { 'signature' : ['MET'], 'alignmentGroup' : ['MET'], @@ -327,12 +329,12 @@ METChainParts_Default = { #========================================================== # XS #========================================================== -# ---- xs Dictinary of all allowed Values ---- +# ---- xs Dictionary of all allowed Values ---- XSChainParts = METChainParts XSChainParts['signature'] = ['XS'] XSChainParts['trigType'] = ['xs'] -# ---- xs Dictinary of default Values ---- +# ---- xs Dictionary of default Values ---- XSChainParts_Default = METChainParts_Default XSChainParts_Default['signature'] = ['XS'] XSChainParts_Default['trigType'] = ['xs'] @@ -340,12 +342,12 @@ XSChainParts_Default['trigType'] = ['xs'] #========================================================== # TE #========================================================== -# ---- te Dictinary of all allowed Values ---- +# ---- te Dictionary of all allowed Values ---- TEChainParts = METChainParts TEChainParts['signature'] = ['TE'] TEChainParts['trigType'] = ['te'] -# ---- te Dictinary of default Values ---- +# ---- te Dictionary of default Values ---- TEChainParts_Default = METChainParts_Default TEChainParts_Default['signature'] = ['TE'] TEChainParts_Default['trigType'] = ['te'] @@ -354,7 +356,7 @@ TEChainParts_Default['trigType'] = ['te'] # Electron Chains #========================================================== AllowedTopos_e = ["Jpsiee","Zeg","Zee"] -# ---- Electron Dictinary of all allowed Values ---- +# ---- Electron Dictionary of all allowed Values ---- ElectronChainParts = { 'signature' : ['Electron'], 'alignmentGroup' : ['Electron','Egamma'], @@ -366,14 +368,14 @@ ElectronChainParts = { 'threshold' : '', 'etaRange' : [], 'IDinfo' : ['lhvloose','lhloose','lhmedium','lhtight'], - 'isoInfo' : [], + 'isoInfo' : ['ivarloose','ivarmedium','ivartight'], 'trkInfo' : ['nod0', 'idperf'], 'caloInfo' : [], 'lhInfo' : [], 'L2IDAlg' : ['noringer'], 'addInfo' : [ 'etcut', 'etcut1step',"v2","v3"], } -# ---- Egamma Dictinary of default Values ---- +# ---- Egamma Dictionary of default Values ---- ElectronChainParts_Default = { 'signature' : ['Electron'], 'alignmentGroup' : ['Electron'], @@ -400,7 +402,7 @@ ElectronChainParts_Default = { #========================================================== # Photon chains #========================================================== -# ---- Photon Dictinary of all allowed Values ---- +# ---- Photon Dictionary of all allowed Values ---- PhotonChainParts = { 'L1threshold' : '', 'signature' : ['Photon'], @@ -411,7 +413,7 @@ PhotonChainParts = { 'threshold' : '', 'extra' : [], 'IDinfo' : ['etcut','loose','medium','tight'], - 'isoInfo' : [], + 'isoInfo' : ['icaloloose','icalomedium','icalotight'], 'reccalibInfo' : [], 'trkInfo' : [], 'caloInfo' : [], @@ -421,7 +423,7 @@ PhotonChainParts = { 'addInfo' : ['etcut',], } -# ---- Photon Dictinary of default Values ---- +# ---- Photon Dictionary of default Values ---- PhotonChainParts_Default = { 'signature' : ['Photon'], 'alignmentGroup' : ['Photon'], @@ -470,7 +472,7 @@ MinBiasChainParts = { 'recoAlg' : ['mbts', 'sptrk', 'sp', 'noalg', 'perf', 'hmt', 'hmtperf', 'idperf', 'zdcperf'], 'addInfo' : ['peb'], } -# ---- MinBiasDictinary of default Values ---- +# ---- MinBiasDictionary of default Values ---- MinBiasChainParts_Default = { 'signature' : ['MinBias'], 'alignmentGroup' : ['MinBias'], @@ -517,7 +519,7 @@ HeavyIonChainParts = { 'gap' : [], } -# ---- HeavyIonDictinary of default Values ---- +# ---- HeavyIonDictionary of default Values ---- HeavyIonChainParts_Default = { 'signature' : ['HeavyIon'], 'alignmentGroup' : ['HeavyIon'], @@ -547,7 +549,7 @@ AllowedCosmicChainIdentifiers = ['larps','larhec', 'tilecalib', 'sct', 'id',] -# ---- Cosmic Chain Dictinary of all allowed Values ---- +# ---- Cosmic Chain Dictionary of all allowed Values ---- CosmicChainParts = { 'signature' : ['Cosmic'], 'alignmentGroup' : ['Cosmic'], @@ -563,7 +565,7 @@ CosmicChainParts = { 'extra' : '', } -# ---- Cosmic Chain Default Dictinary of all allowed Values ---- +# ---- Cosmic Chain Default Dictionary of all allowed Values ---- CosmicChainParts_Default = { 'signature' : ['Cosmic'], 'alignmentGroup' : ['Cosmic'], @@ -585,7 +587,7 @@ CosmicChainParts_Default = { #========================================================== AllowedStreamingChainIdentifiers = ['noalg'] -# ---- Streaming Chain Dictinary of all allowed Values ---- +# ---- Streaming Chain Dictionary of all allowed Values ---- StreamingChainParts = { 'signature' : ['Streaming'], 'alignmentGroup' : ['Streaming'], @@ -603,7 +605,7 @@ StreamingChainParts = { 'algo' : ['NoAlg'] } -# ---- Cosmic Chain Default Dictinary of all allowed Values ---- +# ---- Cosmic Chain Default Dictionary of all allowed Values ---- StreamingChainParts_Default = { 'signature' : ['Streaming'], 'alignmentGroup' : ['Streaming'], @@ -629,7 +631,7 @@ AllowedCalibChainIdentifiers = ['csccalib', 'larcalib', 'calibAFP', ] -# ---- Calib Chain Dictinary of all allowed Values ---- +# ---- Calib Chain Dictionary of all allowed Values ---- ##stramingInfo not use in ChainConfiguration, only to distinguish streaming CalibChainParts = { @@ -648,7 +650,7 @@ CalibChainParts = { 'extra' : ['rerun','bs',''], } -# ---- Calib Chain Default Dictinary of all allowed Values ---- +# ---- Calib Chain Default Dictionary of all allowed Values ---- CalibChainParts_Default = { 'signature' : ['Calib'], 'alignmentGroup' : ['Calib'], @@ -676,7 +678,7 @@ AllowedMonitorChainIdentifiers = ['robrequest', 'timeburner', 'costmonitor', 'mistimemoncaltimenomu','mistimemoncaltime', 'mistimemonj400',] -# ---- Monitor Chain Dictinary of all allowed Values ---- +# ---- Monitor Chain Dictionary of all allowed Values ---- MonitorChainParts = { 'signature' : ['Monitor'], 'alignmentGroup' : ['Monitor'], @@ -690,7 +692,7 @@ MonitorChainParts = { 'extra' : '', } -# ---- Monitor Chain Default Dictinary of all allowed Values ---- +# ---- Monitor Chain Default Dictionary of all allowed Values ---- MonitorChainParts_Default = { 'signature' : ['Monitor'], 'alignmentGroup' : ['Monitor'], @@ -710,7 +712,7 @@ MonitorChainParts_Default = { #========================================================== AllowedEBChainIdentifiers = ['eb'] -# ---- Enhanced Bias Chain Dictinary of all allowed Values ---- +# ---- Enhanced Bias Chain Dictionary of all allowed Values ---- EnhancedBiasChainParts = { 'signature' : ['EnhancedBias'], 'alignmentGroup' : ['EnhancedBias'], @@ -723,7 +725,7 @@ EnhancedBiasChainParts = { 'extra' : '', } -# ---- EnhancedBias Chain Default Dictinary of all allowed Values ---- +# ---- EnhancedBias Chain Default Dictionary of all allowed Values ---- EnhancedBiasChainParts_Default = { 'signature' : ['EnhancedBias'], 'alignmentGroup' : ['EnhancedBias'], @@ -756,7 +758,7 @@ BeamspotChainParts = { 'extra' : '', } -# ---- Beamspot Chain Default Dictinary of all allowed Values ---- +# ---- Beamspot Chain Default Dictionary of all allowed Values ---- BeamspotChainParts_Default = { 'signature' : ['Beamspot'], 'alignmentGroup' : ['Beamspot'], @@ -773,17 +775,45 @@ BeamspotChainParts_Default = { 'extra' : '', } +#========================================================== +# Unconventional Tracking +#========================================================== +# ---- Unconventional Tracking Dictionary of all allowed Values ---- +UnconventionalTrackingChainParts = { + 'signature' : ['UnconventionalTracking'], + 'alignmentGroup' : ['UnconventionalTracking'], + 'L1threshold' : '', + 'chainPartName' : [], + 'multiplicity' : '', + 'trigType' : ['unconvtrk'], + 'threshold' : '', + 'extra' : '', + 'addInfo' : [], +} +# ---- Unconventional Tracking Dictionary of default Values ---- +UnconventionalTrackingChainParts_Default = { + 'signature' : ['UnconventionalTracking'], + 'alignmentGroup' : ['UnconventionalTracking'], + 'L1threshold' : '', + 'chainPartName' : [], + 'multiplicity' : '', + 'trigType' : ['unconvtrk'], + 'threshold' : '', + 'extra' : '', + 'addInfo' : [], +} + #========================================================== # Combined Chains #========================================================== AllowedTopos_comb = [] -# ---- Combined Dictinary of all allowed Values ---- +# ---- Combined Dictionary of all allowed Values ---- CombinedChainParts = deepcopy(PhotonChainParts) CombinedChainParts['signature'] = ['Photon','Muon'] CombinedChainParts['chainParts'] = ['g','mu'], CombinedChainParts['topo'] = AllowedTopos_comb -# ---- Combined Dictinary of default Values ---- +# ---- Combined Dictionary of default Values ---- CombinedChainParts_Default = deepcopy(PhotonChainParts_Default) CombinedChainParts_Default['signature'] = ['Photon','Muon'] CombinedChainParts_Default['chainParts'] = ['g','mu'], @@ -860,6 +890,8 @@ def getSignatureInformation(signature): return [BeamspotChainParts_Default, BeamspotChainParts] if signature == "EnhancedBias": return [EnhancedBiasChainParts_Default, EnhancedBiasChainParts] + if signature == "UnconventionalTracking": + return [UnconventionalTrackingChainParts_Default, UnconventionalTrackingChainParts] if signature == "Test": return [TestChainParts_Default, TestChainParts] else: diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Muon/generateMuon.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Muon/generateMuon.py index 5780500ccf8a50192d1d4fc3ccbc1db07a813019..1db8754f0591af5659981532677918d5b9ab171f 100644 --- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Muon/generateMuon.py +++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Muon/generateMuon.py @@ -4,7 +4,9 @@ from TriggerMenuMT.HLTMenuConfig.Menu.MenuComponents import CAMenuSequence, Chai from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator from TrigL2MuonSA.TrigL2MuonSAConfig_newJO import l2MuFastAlgCfg, l2MuFastHypoCfg -from TrigMuonHypoMT.TrigMuonHypoMTConfig import TrigMufastHypoToolFromDict, TrigMuonEFMSonlyHypoToolFromDict +from TrigmuComb.TrigmuCombConfig_newJO import l2MuCombRecoCfg, l2MuCombHypoCfg +from TrigMuonHypoMT.TrigMuonHypoMTConfig import TrigMufastHypoToolFromDict, TrigmuCombHypoToolFromDict, TrigMuonEFMSonlyHypoToolFromDict +from TrigInDetConfig.TrigInDetConfig import TrigInDetConfig from TriggerMenuMT.HLTMenuConfig.Menu.ChainDictTools import splitChainDict @@ -47,6 +49,13 @@ def MuFastViewDataVerifier(): result.addEventAlgo(alg) return result +def MuCombViewDataVerifier(): + result = ComponentAccumulator() + alg = CompFactory.AthViews.ViewDataVerifier( name = "VDVMuComb", + DataObjects = [( 'xAOD::L2StandAloneMuonContainer' , 'StoreGateSvc+MuonL2SAInfo' )]) + result.addEventAlgo(alg) + return result + #Not the ideal place to keep the track cnv alg configuration. Temproarily adding it here #until a better location can be found def MuonTrackCollectionCnvToolCfg(flags, name = "MuonTrackCollectionCnvTool", **kwargs): @@ -210,82 +219,117 @@ def generateChains( flags, chainDict ): l2muFastStep = ChainStep( name=stepName, Sequences=[l2muFastSequence], chainDicts=[chainDict] ) - ### Set muon step2 ### - # Please set up L2muComb step here - - #EF MS only - stepEFMSName = 'EFMSMuon' - stepEFMSReco, stepEFMSView = createStepView(stepEFMSName) - - #Clone and replace offline flags so we can set muon trigger specific values - muonflags = flags.cloneAndReplace('Muon', 'Trigger.Offline.Muon') - muonflags.Muon.useTGCPriorNextBC=True - muonflags.Muon.enableErrorTuning=False - muonflags.Muon.MuonTrigger=True - muonflags.Muon.SAMuonTrigger=True - muonflags.lock() - - accMS = ComponentAccumulator() - accMS.addSequence(stepEFMSView) - - from TriggerMenuMT.HLTMenuConfig.Menu.MenuComponents import InViewReco - recoMS = InViewReco("EFMuMSReco") - recoMS.inputMaker().RequireParentView = True + if 'msonly' not in chainDict['chainName']: + #only run in combined muon chains + ### Set muon step2 - L2muComb ### + stepL2CBName = 'L2MuonCB' + stepL2CBReco, stepL2CBView = createStepView(stepL2CBName) + + accL2CB = ComponentAccumulator() + accL2CB.addSequence(stepL2CBView) + + # Set EventViews for L2MuonCB step + recoL2CB = l2MuCombRecoCfg(flags) + #external data loading to view + recoL2CB.inputMaker().RequireParentView = True + recoL2CB.mergeReco( MuCombViewDataVerifier() ) + + #ID tracking + accID = TrigInDetConfig( flags, roisKey=recoL2CB.inputMaker().InViewRoIs, signatureName="Muon" ) + recoL2CB.mergeReco(accID) + + accL2CB.merge(recoL2CB, sequenceName = stepL2CBReco.getName()) + + l2muCombHypo = l2MuCombHypoCfg( flags, + name = 'TrigL2MuCombHypo', + muCombInfo = 'HLT_MuonL2CBInfo' ) + + accL2CB.addEventAlgo(l2muCombHypo, sequenceName=stepL2CBView.getName()) + + l2muCombSequence = CAMenuSequence( Sequence = recoL2CB.sequence(), + Maker = recoL2CB.inputMaker(), + Hypo = l2muCombHypo, + HypoToolGen = TrigmuCombHypoToolFromDict, + CA = accL2CB ) + + l2muCombStep = ChainStep( name=stepL2CBName, Sequences=[l2muCombSequence], chainDicts=[chainDict] ) - #Probably this block will eventually need to move somewhere more central - from BeamPipeGeoModel.BeamPipeGMConfig import BeamPipeGeometryCfg - accMS.merge( BeamPipeGeometryCfg(flags) ) - - from PixelGeoModel.PixelGeoModelConfig import PixelGeometryCfg - accMS.merge(PixelGeometryCfg(flags)) + + if 'msonly' in chainDict['chainName']: + #only runningn in MS-only chains for now + #EF MS only + stepEFMSName = 'EFMSMuon' + stepEFMSReco, stepEFMSView = createStepView(stepEFMSName) + + #Clone and replace offline flags so we can set muon trigger specific values + muonflags = flags.cloneAndReplace('Muon', 'Trigger.Offline.Muon') + muonflags.Muon.useTGCPriorNextBC=True + muonflags.Muon.enableErrorTuning=False + muonflags.Muon.MuonTrigger=True + muonflags.Muon.SAMuonTrigger=True + muonflags.lock() + + accMS = ComponentAccumulator() + accMS.addSequence(stepEFMSView) + + from TriggerMenuMT.HLTMenuConfig.Menu.MenuComponents import InViewReco + recoMS = InViewReco("EFMuMSReco") + recoMS.inputMaker().RequireParentView = True - from SCT_GeoModel.SCT_GeoModelConfig import SCT_GeometryCfg - accMS.merge(SCT_GeometryCfg(flags)) + #Probably this block will eventually need to move somewhere more central + from BeamPipeGeoModel.BeamPipeGMConfig import BeamPipeGeometryCfg + accMS.merge( BeamPipeGeometryCfg(flags) ) + + from PixelGeoModel.PixelGeoModelConfig import PixelGeometryCfg + accMS.merge(PixelGeometryCfg(flags)) - from TRT_GeoModel.TRT_GeoModelConfig import TRT_GeometryCfg - accMS.merge(TRT_GeometryCfg(flags)) + from SCT_GeoModel.SCT_GeoModelConfig import SCT_GeometryCfg + accMS.merge(SCT_GeometryCfg(flags)) + + from TRT_GeoModel.TRT_GeoModelConfig import TRT_GeometryCfg + accMS.merge(TRT_GeometryCfg(flags)) - from TrkConfig.AtlasTrackingGeometrySvcConfig import TrackingGeometrySvcCfg - accMS.merge(TrackingGeometrySvcCfg(flags)) - ################### + from TrkConfig.AtlasTrackingGeometrySvcConfig import TrackingGeometrySvcCfg + accMS.merge(TrackingGeometrySvcCfg(flags)) + ################### - EFMuonViewDataVerifier = EFMuonViewDataVerifierCfg() - recoMS.mergeReco(EFMuonViewDataVerifier) + EFMuonViewDataVerifier = EFMuonViewDataVerifierCfg() + recoMS.mergeReco(EFMuonViewDataVerifier) - from MuonConfig.MuonSegmentFindingConfig import MooSegmentFinderAlgCfg - segCfg = MooSegmentFinderAlgCfg(muonflags,name="TrigMooSegmentFinder",UseTGCNextBC=False, UseTGCPriorBC=False) - recoMS.mergeReco(segCfg) + from MuonConfig.MuonSegmentFindingConfig import MooSegmentFinderAlgCfg + segCfg = MooSegmentFinderAlgCfg(muonflags,name="TrigMooSegmentFinder",UseTGCNextBC=False, UseTGCPriorBC=False) + recoMS.mergeReco(segCfg) - from MuonConfig.MuonTrackBuildingConfig import MuonTrackBuildingCfg - trkCfg = MuonTrackBuildingCfg(muonflags, name="TrigMuPatTrackBuilder") - recoMS.mergeReco(trkCfg) + from MuonConfig.MuonTrackBuildingConfig import MuonTrackBuildingCfg + trkCfg = MuonTrackBuildingCfg(muonflags, name="TrigMuPatTrackBuilder") + recoMS.mergeReco(trkCfg) - cnvCfg = MuonTrackParticleCnvCfg(muonflags, name = "TrigMuonTrackParticleCnvAlg") - recoMS.mergeReco(cnvCfg) + cnvCfg = MuonTrackParticleCnvCfg(muonflags, name = "TrigMuonTrackParticleCnvAlg") + recoMS.mergeReco(cnvCfg) - from MuonCombinedConfig.MuonCombinedReconstructionConfig import MuonCombinedMuonCandidateAlgCfg - candCfg = MuonCombinedMuonCandidateAlgCfg(muonflags, name = "TrigMuonCandidateAlg") - recoMS.mergeReco(candCfg) + from MuonCombinedConfig.MuonCombinedReconstructionConfig import MuonCombinedMuonCandidateAlgCfg + candCfg = MuonCombinedMuonCandidateAlgCfg(muonflags, name = "TrigMuonCandidateAlg") + recoMS.mergeReco(candCfg) - from MuonCombinedConfig.MuonCombinedReconstructionConfig import MuonCreatorAlgCfg - creatorCfg = MuonCreatorAlgCfg(muonflags, name = "TrigMuonCreatorAlg") - recoMS.mergeReco(creatorCfg) + from MuonCombinedConfig.MuonCombinedReconstructionConfig import MuonCreatorAlgCfg + creatorCfg = MuonCreatorAlgCfg(muonflags, name = "TrigMuonCreatorAlg") + recoMS.mergeReco(creatorCfg) - accMS.merge(recoMS, sequenceName=stepEFMSReco.getName()) + accMS.merge(recoMS, sequenceName=stepEFMSReco.getName()) - efmuMSHypo = efMuMSHypoCfg( muonflags, - name = 'TrigMuonEFMSonlyHypo', - inputMuons = "Muons" ) + efmuMSHypo = efMuMSHypoCfg( muonflags, + name = 'TrigMuonEFMSonlyHypo', + inputMuons = "Muons" ) - accMS.addEventAlgo(efmuMSHypo, sequenceName=stepEFMSView.getName()) + accMS.addEventAlgo(efmuMSHypo, sequenceName=stepEFMSView.getName()) - efmuMSSequence = CAMenuSequence( Sequence = recoMS.sequence(), - Maker = recoMS.inputMaker(), - Hypo = efmuMSHypo, - HypoToolGen = TrigMuonEFMSonlyHypoToolFromDict, - CA = accMS ) + efmuMSSequence = CAMenuSequence( Sequence = recoMS.sequence(), + Maker = recoMS.inputMaker(), + Hypo = efmuMSHypo, + HypoToolGen = TrigMuonEFMSonlyHypoToolFromDict, + CA = accMS ) - efmuMSStep = ChainStep( name=stepEFMSName, Sequences=[efmuMSSequence], chainDicts=[chainDict] ) + efmuMSStep = ChainStep( name=stepEFMSName, Sequences=[efmuMSSequence], chainDicts=[chainDict] ) l1Thresholds=[] for part in chainDict['chainParts']: @@ -293,7 +337,9 @@ def generateChains( flags, chainDict ): log.debug('dictionary is: %s\n', pprint.pformat(chainDict)) - - chain = Chain( name=chainDict['chainName'], L1Thresholds=l1Thresholds, ChainSteps=[ l2muFastStep, efmuMSStep ] ) + if 'msonly' in chainDict['chainName']: + chain = Chain( name=chainDict['chainName'], L1Thresholds=l1Thresholds, ChainSteps=[ l2muFastStep, efmuMSStep ] ) + else: + chain = Chain( name=chainDict['chainName'], L1Thresholds=l1Thresholds, ChainSteps=[ l2muFastStep, l2muCombStep ] ) return chain diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/UnconventionalTracking/GenerateUnconventionalTrackingChainDefs.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/UnconventionalTracking/GenerateUnconventionalTrackingChainDefs.py new file mode 100644 index 0000000000000000000000000000000000000000..a71d9b172722bdb9735b2d869392dec9f23c9c8e --- /dev/null +++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/UnconventionalTracking/GenerateUnconventionalTrackingChainDefs.py @@ -0,0 +1,21 @@ +# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration + +from TriggerMenuMT.HLTMenuConfig.UnconventionalTracking.UnconventionalTrackingChainConfiguration import UnconventionalTrackingChainConfiguration + +import pprint +from AthenaCommon.Logging import logging +log = logging.getLogger( 'TriggerMenuMT.HLTMenuConfig.UnconventionalTracking.generateChainConfigs' ) +log.info("Importing %s",__name__) + + + +def generateChainConfigs( chainDict ): + log.debug('dictionary is: %s\n', pprint.pformat(chainDict)) + + # Unconventional tracking chain is assembled always from the full dictionary (multiple legs are handled internally by the jet reco / hypo) + theChainDef = UnconventionalTrackingChainConfiguration(chainDict) + + unconventionalTrackingChain = theChainDef.assembleChain() + + + return unconventionalTrackingChain diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/UnconventionalTracking/UnconventionalTrackingChainConfiguration.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/UnconventionalTracking/UnconventionalTrackingChainConfiguration.py new file mode 100644 index 0000000000000000000000000000000000000000..2f84064bc1494a34e1974fad43c77131e753578c --- /dev/null +++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/UnconventionalTracking/UnconventionalTrackingChainConfiguration.py @@ -0,0 +1,50 @@ +# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration + +from AthenaCommon.Logging import logging +logging.getLogger().info("Importing %s",__name__) +log = logging.getLogger("TriggerMenuMT.HLTMenuConfig.UnconventionalTracking.UnconventionalTrackingDef") + +from TriggerMenuMT.HLTMenuConfig.Menu.ChainConfigurationBase import ChainConfigurationBase + + +def unconventionalTrackingChainParts(chainParts): + unconvtrkChainParts = [] + for p in chainParts: + if p['trigType'] == 'unconvtrk': + unconvtrkChainParts.append(p) + return unconvtrkChainParts + +#---------------------------------------------------------------- +# Class to configure chain +#---------------------------------------------------------------- +class UnconventionalTrackingChainConfiguration(ChainConfigurationBase): + + def __init__(self, chainDict): + ChainConfigurationBase.__init__(self,chainDict) + + # ---------------------- + # Assemble the chain depending on information from chainName + # ---------------------- + def assembleChain(self): + log.debug("Assembling chain " + self.chainName) + + steps=[self.getEmptyStep(1, 'unconv_empty')] + + chainSteps = [] + for step in steps: + chainSteps+=[step] + + myChain = self.buildChain(chainSteps) + return myChain + + + # -------------------- + # Configuration of steps + # -------------------- + def getUnconventionalTrackingChainStep(self): + pass + + + + + diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/L1/Base/Boards.py b/Trigger/TriggerCommon/TriggerMenuMT/python/L1/Base/Boards.py index e2adb3164467a647e5d3c25cff833a4514dba38e..5fcc5071ece84bea508aa12e7492f8cfab3e26b7 100644 --- a/Trigger/TriggerCommon/TriggerMenuMT/python/L1/Base/Boards.py +++ b/Trigger/TriggerCommon/TriggerMenuMT/python/L1/Base/Boards.py @@ -12,20 +12,14 @@ class BoardType(Enum): NONE = 1 MUCTPI = 2 TOPO = 3 - MERGER = 4 - CTPIN = 5 + CTPIN = 4 + MERGER = 5 def __repr__(self): return self.name def __str__(self): return self.name - - -class MenuBoardsCollection(object): - def __init__(self): - self.boards = {} - - def addBoard(self, boardDef): - name = boardDef["name"] + @staticmethod + def fromBoardName(name): if 'muctpi' in name.lower(): btype = BoardType.MUCTPI elif 'alfactpin' in name.lower(): @@ -37,25 +31,28 @@ class MenuBoardsCollection(object): elif 'ctpin' in name.lower(): btype = BoardType.CTPIN else: - btype = BoardType.NONE + raise RuntimeError("No BoardType defined for board %s" % name) + return btype - isLegacy = 'legacy' in boardDef - self.boards[name] = Board(name, btype, isLegacy) +class MenuBoardsCollection(object): + def __init__(self): + self.boards = {} + def addBoard(self, boardDef): + name = boardDef["name"] + btype = BoardType.fromBoardName(name) + isLegacy = 'legacy' in boardDef + self.boards[name] = Board(name, btype, isLegacy) if "connectors" in boardDef: self.boards[name].addOutputConnectorNames([c["name"] for c in boardDef["connectors"]]) - return self.boards[name] def json(self): - boardOrder = ["MuCTPi", "Topo1", "Topo2", "Topo3", "Ctpin", "Ctpin7", "Ctpin8", "Ctpin9", - "LegacyTopo0", "LegacyTopo1", "LegacyTopoMerger", "AlfaCtpin"] from collections import OrderedDict as odict confObj = odict() - for boardName in boardOrder: - if boardName in self.boards: - confObj[boardName] = self.boards[boardName].json() + for boardName in sorted(self.boards): + confObj[boardName] = self.boards[boardName].json() return confObj diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/L1/Base/MenuConfObj.py b/Trigger/TriggerCommon/TriggerMenuMT/python/L1/Base/MenuConfObj.py index 08566f9453239705742959d64156b92626df3da8..2f9a5233326f92ecd86bb125400fd2c410aed86a 100644 --- a/Trigger/TriggerCommon/TriggerMenuMT/python/L1/Base/MenuConfObj.py +++ b/Trigger/TriggerCommon/TriggerMenuMT/python/L1/Base/MenuConfObj.py @@ -20,8 +20,11 @@ class TopoMenuDef: self.outputlines = outputlines self.outputbits = outputbits - def __repr__(self): + def __str__(self): return self.algoname + def __repr__(self): + return f"name = {self.algoname}, outputlines = {self.outputlines}, outputbits = {self.outputbits}" + def isMultiplicityDefinition(self): return self.algoname.startswith("Mult") diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/L1/Config/ItemDef.py b/Trigger/TriggerCommon/TriggerMenuMT/python/L1/Config/ItemDef.py index b391e69545359eaf778f7b28012eb849ffa05553..846421800e0cf9a4e680641c2ce533c42fd30568 100644 --- a/Trigger/TriggerCommon/TriggerMenuMT/python/L1/Config/ItemDef.py +++ b/Trigger/TriggerCommon/TriggerMenuMT/python/L1/Config/ItemDef.py @@ -1699,7 +1699,7 @@ class ItemDef: MenuItem('L1_EM15TAU12I-J25').setLogic( d.R2TOPO_1DISAMB_EM15his2_TAU12abi_J25ab & physcond) MenuItem('L1_DR-EM15TAU12I').setLogic( d.R2TOPO_DISAMB_0DR28_EM15his2_TAU12abi & physcond) - MenuItem('L1_DR-EM15TAU12I-J25').setLogic( d.TOPO_1DISAMB_J25ab_0DR28_EM15his2_TAU12abi & physcond) + MenuItem('L1_DR-EM15TAU12I-J25').setLogic( d.TOPO_2DISAMB_J25ab_0DR28_EM15his2_TAU12abi & physcond) MenuItem('L1_TAU20ITAU12I-J25').setLogic( d.R2TOPO_1DISAMB_TAU20abi_TAU12abi_J25ab & physcond) MenuItem('L1_DR25-TAU20ITAU12I').setLogic( d.TOPO_0DR25_TAU20abi_TAU12abi & physcond) diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/L1/Config/LegacyTopoMergerMap.py b/Trigger/TriggerCommon/TriggerMenuMT/python/L1/Config/LegacyTopoMergerMap.py new file mode 100644 index 0000000000000000000000000000000000000000..e06a8e50fe1485a62296df33fa7bdbc35d835068 --- /dev/null +++ b/Trigger/TriggerCommon/TriggerMenuMT/python/L1/Config/LegacyTopoMergerMap.py @@ -0,0 +1,102 @@ +# Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration + +from collections import namedtuple, OrderedDict as odict + +from AthenaCommon.Logging import logging +log = logging.getLogger("L1.Config.LegacyTopoMergerMap") + +MC = namedtuple('MC', "target_bit, topo_board, source_bit, signals") + +# the following mapping is hardcoded to match the hardwired legacy L1Topo +# merger board based on specifications from Stefan Haas +__mapping = [ + MC(target_bit = 0, topo_board = 0, source_bit = 0, signals = ( "900INVM9999-AJ30s6-AJ20s6", None )), + MC(target_bit = 1, topo_board = 0, source_bit = 1, signals = ( "800INVM9999-AJ30s6-AJ20s6", None )), + MC(target_bit = 2, topo_board = 0, source_bit = 2, signals = ( "700INVM9999-AJ30s6-AJ20s6", None )), + MC(target_bit = 3, topo_board = 0, source_bit = 3, signals = ( "500INVM9999-AJ30s6-AJ20s6", None )), + MC(target_bit = 4, topo_board = 0, source_bit = 4, signals = ( "400INVM9999-AJ30s6-AJ20s6", "0DR03-EM7ab-CJ15ab" )), + MC(target_bit = 5, topo_board = 0, source_bit = 5, signals = ( "300INVM9999-AJ30s6-AJ20s6", "10MINDPHI-J20s2-XE30" )), + MC(target_bit = 6, topo_board = 0, source_bit = 6, signals = ( "200INVM9999-AJ30s6-AJ20s6", "10MINDPHI-J20s2-XE50" )), + MC(target_bit = 7, topo_board = 0, source_bit = 7, signals = ( "100INVM9999-AJ30s6-AJ20s6", "100RATIO-0MATCH-TAU30si2-EMall" )), + MC(target_bit = 8, topo_board = 0, source_bit = 8, signals = ( "0INVM9-EM7ab-EMab", "NOT-0MATCH-TAU30si1-EMall" )), + MC(target_bit = 9, topo_board = 0, source_bit = 9, signals = ( "HT150-J20s5pETA31", None )), + MC(target_bit = 10, topo_board = 0, source_bit = 10, signals = ( "HT190-J15s5pETA21", None )), + MC(target_bit = 11, topo_board = 0, source_bit = 11, signals = ( "1INVM5-EMs1-EMs6", None )), + MC(target_bit = 12, topo_board = 0, source_bit = 12, signals = ( "1INVM5-EM7s1-EMs6", "27DPHI32-EMs1-EMs6" )), + MC(target_bit = 13, topo_board = 0, source_bit = 13, signals = ( "1INVM5-EM12s1-EMs6", None )), + MC(target_bit = 14, topo_board = 0, source_bit = 14, signals = ( None, None )), + MC(target_bit = 15, topo_board = 0, source_bit = 15, signals = ( "400INVM9999-AJ30s6pETA31-AJ20s6p31ETA49", None )), + MC(target_bit = 16, topo_board = 0, source_bit = 16, signals = ( None, "DISAMB-30INVM-EM20his2-TAU12ab" )), + MC(target_bit = 17, topo_board = 0, source_bit = 17, signals = ( None, None )), + MC(target_bit = 18, topo_board = 0, source_bit = 18, signals = ( None, None )), + MC(target_bit = 19, topo_board = 0, source_bit = 19, signals = ( "1DISAMB-J25ab-0DR28-EM15his2-TAU12abi", None)), + MC(target_bit = 20, topo_board = 0, source_bit = 28, signals = ( None, "600INVM9999-J30s6-AJ20s6" )), + MC(target_bit = 21, topo_board = 0, source_bit = 29, signals = ( None, "500INVM9999-J30s6-AJ20s6" )), + MC(target_bit = 22, topo_board = 0, source_bit = 30, signals = ( None, "400INVM9999-J30s6-AJ20s6" )), + MC(target_bit = 23, topo_board = 0, source_bit = 31, signals = ( None, "200INVM9999-J30s6-AJ20s6" )), + MC(target_bit = 24, topo_board = 1, source_bit = 10, signals = ( None, None )), + MC(target_bit = 25, topo_board = 1, source_bit = 11, signals = ( None, "SC111-CJ15abpETA26" )), + MC(target_bit = 26, topo_board = 1, source_bit = 18, signals = ( None, "0DR28-TAU20abi-TAU12abi" )), + MC(target_bit = 27, topo_board = 1, source_bit = 19, signals = ( None, "1DISAMB-J25ab-0DR28-TAU20abi-TAU12abi" )), + MC(target_bit = 28, topo_board = 1, source_bit = 20, signals = ( None, "1DISAMB-TAU12abi-J25ab" )), + MC(target_bit = 29, topo_board = 1, source_bit = 21, signals = ( None, None )), + MC(target_bit = 30, topo_board = 1, source_bit = 28, signals = ( "0DETA20-J50s1-Js2", None )), + MC(target_bit = 31, topo_board = 1, source_bit = 29, signals = ( None, None )), +] + + +def createMergerBoard(legacyBoard0, legacyBoard1): + + legacyOccupation = [[32*[None],32*[None]],[32*[None],32*[None]]] + for boardNumber, board in enumerate([legacyBoard0, legacyBoard1]): + for conn in board["connectors"][0]["algorithmGroups"]: + fpga = conn['fpga'] + clock = conn['clock'] + for topoAlgDef in conn['algorithms']: + lines = topoAlgDef.outputlines + if len(lines)==1: + legacyOccupation[boardNumber][clock][ 16*fpga + topoAlgDef.outputbits] = lines[0] + else: + for bit,line in enumerate(lines): + legacyOccupation[boardNumber][clock][ 16*fpga + bit + topoAlgDef.outputbits[0]] = line + + signals = [32*[None], 32*[None]] + for mc in __mapping: + for clock in [0,1]: + algFromMapping = mc.signals[clock] + if algFromMapping is None: + continue + signals[clock][mc.target_bit] = algFromMapping + algFromLegacyBoardDef = legacyOccupation[mc.topo_board][clock][mc.source_bit] + if algFromMapping != algFromLegacyBoardDef: + fpga = mc.source_bit // 16 + bit = mc.source_bit % 16 + msg = f"Legacy board mapping expects line {algFromMapping} on LegacyBoard{mc.topo_board}, fpga {fpga}, " +\ + f"clock {clock}, bit {bit} but board defines {algFromLegacyBoardDef}" + log.error(msg) + raise RuntimeError("Mapping doesn't match LegacyBoard definition") + + + + + board = odict() + board["connectors"] = [] + board["type"] = "merger" + board["connectors"].append({ + "name" : "LegacyTopoMerged", + "format" : "simple", + "nbitsDefault" : 1, + "type" : "electrical", + "legacy" : False, + "signalGroups" : [ + { + "clock" : 0, + "signals" : signals[0] + }, + { + "clock" : 1, + "signals" : signals[1] + } + ] + }) + return odict( [("LegacyTopoMerger", board)] ) diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/L1/Config/TopoAlgoDef.py b/Trigger/TriggerCommon/TriggerMenuMT/python/L1/Config/TopoAlgoDef.py index 10a4d1905f82dd2fa0520a54706996c5d1df5430..f87b3af90d3f9144bfbffa541a5b853ca90db4df 100644 --- a/Trigger/TriggerCommon/TriggerMenuMT/python/L1/Config/TopoAlgoDef.py +++ b/Trigger/TriggerCommon/TriggerMenuMT/python/L1/Config/TopoAlgoDef.py @@ -1,4 +1,4 @@ -# Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration +# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration from .TypeWideThresholdConfig import getTypeWideThresholdConfig @@ -25,14 +25,14 @@ class TopoAlgoDef: _emscale_for_decision = 1000 / getTypeWideThresholdConfig("EM")["resolutionMeV"] - alg = AlgConf.ClusterNoSort( name = 'EMall', inputs = 'ClusterTobArray', outputs = 'EMall', algoId = -1 ) + alg = AlgConf.ClusterNoSort( name = 'EMall', inputs = 'ClusterTobArray', outputs = 'EMall' ) alg.addgeneric('InputWidth', HW.InputWidthEM) alg.addgeneric('OutputWidth', HW.InputWidthEM) alg.addvariable('IsoMask', 0) tm.registerTopoAlgo(alg) - alg = AlgConf.ClusterSelect( name = 'TAUabi', inputs = 'ClusterTobArray', outputs = 'TAUabi', algoId = -1 ) + alg = AlgConf.ClusterSelect( name = 'TAUabi', inputs = 'ClusterTobArray', outputs = 'TAUabi' ) alg.addgeneric('InputWidth', HW.InputWidthTAU) alg.addgeneric('InputWidth1stStage', HW.InputWidth1stStageSelectTAU ) alg.addgeneric('OutputWidth', HW.OutputWidthSelectTAU) @@ -44,7 +44,7 @@ class TopoAlgoDef: tm.registerTopoAlgo(alg) - alg = AlgConf.ClusterSelect( name = 'EMabi', inputs = 'ClusterTobArray', outputs = 'EMabi', algoId = -1 ) + alg = AlgConf.ClusterSelect( name = 'EMabi', inputs = 'ClusterTobArray', outputs = 'EMabi' ) alg.addgeneric('InputWidth', HW.InputWidthEM) alg.addgeneric('InputWidth1stStage', HW.InputWidth1stStageSelectEM ) alg.addgeneric('OutputWidth', HW.OutputWidthSelectEM) @@ -56,7 +56,7 @@ class TopoAlgoDef: tm.registerTopoAlgo(alg) - alg = AlgConf.ClusterSelect( name = 'EMabhi', inputs = 'ClusterTobArray', outputs = 'EMabhi', algoId = -1 ) + alg = AlgConf.ClusterSelect( name = 'EMabhi', inputs = 'ClusterTobArray', outputs = 'EMabhi' ) alg.addgeneric('InputWidth', HW.InputWidthEM) alg.addgeneric('InputWidth1stStage', HW.InputWidth1stStageSelectEM ) alg.addgeneric('OutputWidth', HW.OutputWidthSelectEM) @@ -68,7 +68,7 @@ class TopoAlgoDef: tm.registerTopoAlgo(alg) - alg = AlgConf.ClusterSelect( name = 'TAUab', inputs = 'ClusterTobArray', outputs = 'TAUab', algoId = -1 ) + alg = AlgConf.ClusterSelect( name = 'TAUab', inputs = 'ClusterTobArray', outputs = 'TAUab' ) alg.addgeneric('InputWidth', HW.InputWidthTAU) alg.addgeneric('InputWidth1stStage', HW.InputWidth1stStageSelectTAU ) alg.addgeneric('OutputWidth', HW.OutputWidthSelectTAU) @@ -80,7 +80,7 @@ class TopoAlgoDef: tm.registerTopoAlgo(alg) - alg = AlgConf.ClusterSort( name = 'EMs', inputs = 'ClusterTobArray', outputs = 'EMs', algoId = -1 ) + alg = AlgConf.ClusterSort( name = 'EMs', inputs = 'ClusterTobArray', outputs = 'EMs' ) alg.addgeneric('InputWidth', HW.InputWidthEM) alg.addgeneric('InputWidth1stStage', HW.InputWidth1stStageSortEM) alg.addgeneric('OutputWidth', HW.OutputWidthSortEM) @@ -92,7 +92,7 @@ class TopoAlgoDef: tm.registerTopoAlgo(alg) - alg = AlgConf.ClusterSort( name = 'EMshi', inputs = 'ClusterTobArray', outputs = 'EMshi', algoId = -1 ) + alg = AlgConf.ClusterSort( name = 'EMshi', inputs = 'ClusterTobArray', outputs = 'EMshi' ) alg.addgeneric('InputWidth', HW.InputWidthEM) alg.addgeneric('InputWidth1stStage', HW.InputWidth1stStageSortEM) alg.addgeneric('OutputWidth', HW.OutputWidthSortEM) @@ -104,7 +104,7 @@ class TopoAlgoDef: tm.registerTopoAlgo(alg) - alg = AlgConf.ClusterSort( name = 'TAUsi', inputs = 'ClusterTobArray', outputs = 'TAUsi', algoId = -1 ) + alg = AlgConf.ClusterSort( name = 'TAUsi', inputs = 'ClusterTobArray', outputs = 'TAUsi' ) alg.addgeneric('InputWidth', HW.InputWidthTAU) alg.addgeneric('InputWidth1stStage', HW.InputWidth1stStageSortTAU) alg.addgeneric('OutputWidth', HW.OutputWidthSortTAU) @@ -116,14 +116,14 @@ class TopoAlgoDef: tm.registerTopoAlgo(alg) - alg = AlgConf.JetNoSort( name = 'AJall', inputs = 'JetTobArray', outputs = 'AJall', algoId = -1 ) + alg = AlgConf.JetNoSort( name = 'AJall', inputs = 'JetTobArray', outputs = 'AJall' ) alg.addgeneric('InputWidth', HW.InputWidthJET) alg.addgeneric('OutputWidth', HW.InputWidthJET) alg.addgeneric('JetSize', HW.DefaultJetSize) tm.registerTopoAlgo(alg) - alg = AlgConf.JetNoSort( name = 'AJjall', inputs = 'JetTobArray', outputs = 'AJjall', algoId = -1 ) + alg = AlgConf.JetNoSort( name = 'AJjall', inputs = 'JetTobArray', outputs = 'AJjall' ) alg.addgeneric('InputWidth', HW.InputWidthJET) alg.addgeneric('OutputWidth', HW.InputWidthJET) alg.addgeneric('JetSize', 1 if HW.DefaultJetSize.value==2 else 2) @@ -132,7 +132,7 @@ class TopoAlgoDef: # for 0MATCH-4AJ20-4AJj15 #if not usev8: - alg = AlgConf.JetNoSortMatch( name = 'AJMatchall', inputs = 'JetTobArray', outputs = 'AJMatchall', algoId = -1 ) + alg = AlgConf.JetNoSortMatch( name = 'AJMatchall', inputs = 'JetTobArray', outputs = 'AJMatchall' ) alg.addgeneric('InputWidth', HW.InputWidthJET) alg.addgeneric('OutputWidth', HW.InputWidthJET) alg.addgeneric('JetSize', 2 if HW.DefaultJetSize.value==2 else 1) @@ -156,7 +156,7 @@ class TopoAlgoDef: _minet = 15 - alg = AlgConf.JetSelect( name = jet_type+'ab', inputs = 'JetTobArray', outputs = jet_type+'ab', algoId = -1 ) + alg = AlgConf.JetSelect( name = jet_type+'ab', inputs = 'JetTobArray', outputs = jet_type+'ab' ) alg.addgeneric('InputWidth', HW.InputWidthJET) alg.addgeneric('InputWidth1stStage', HW.InputWidth1stStageSelectJET ) @@ -168,7 +168,7 @@ class TopoAlgoDef: alg.addgeneric('DoEtaCut', 1) tm.registerTopoAlgo(alg) - alg = AlgConf.JetSort( name = 'AJjs', inputs = 'JetTobArray', outputs = 'AJjs', algoId = -1) + alg = AlgConf.JetSort( name = 'AJjs', inputs = 'JetTobArray', outputs = 'AJjs') alg.addgeneric('InputWidth', HW.InputWidthJET) alg.addgeneric('InputWidth1stStage', HW.InputWidth1stStageSortJET ) @@ -182,7 +182,7 @@ class TopoAlgoDef: #input list needed for ATR-18824 if usev8: - alg = AlgConf.JetSort( name = 'FJjs23ETA49', inputs = 'JetTobArray', outputs = 'FJjs23ETA49', algoId = -1) + alg = AlgConf.JetSort( name = 'FJjs23ETA49', inputs = 'JetTobArray', outputs = 'FJjs23ETA49') alg.addgeneric('InputWidth', HW.InputWidthJET) alg.addgeneric('InputWidth1stStage', HW.InputWidth1stStageSortJET ) @@ -194,7 +194,7 @@ class TopoAlgoDef: tm.registerTopoAlgo(alg) - alg = AlgConf.JetSort( name = 'CJsETA21', inputs = 'JetTobArray', outputs = 'CJsETA21', algoId = -1) + alg = AlgConf.JetSort( name = 'CJsETA21', inputs = 'JetTobArray', outputs = 'CJsETA21') alg.addgeneric('InputWidth', HW.InputWidthJET) alg.addgeneric('InputWidth1stStage', HW.InputWidth1stStageSortJET ) alg.addgeneric('OutputWidth', HW.OutputWidthSortJET ) @@ -218,7 +218,7 @@ class TopoAlgoDef: _mineta = 31 _minet = 15 - alg = AlgConf.JetSort( name = jet_type+'s', inputs = 'JetTobArray', outputs = jet_type+'s', algoId = -1 ) + alg = AlgConf.JetSort( name = jet_type+'s', inputs = 'JetTobArray', outputs = jet_type+'s' ) alg.addgeneric('InputWidth', HW.InputWidthJET) alg.addgeneric('InputWidth1stStage', HW.InputWidth1stStageSortJET ) @@ -242,7 +242,7 @@ class TopoAlgoDef: jetabseta = 26 _minet = 15 - alg = AlgConf.JetSort( name = jet_type+'s', inputs = 'JetTobArray', outputs = jet_type+'s', algoId = -1 ) + alg = AlgConf.JetSort( name = jet_type+'s', inputs = 'JetTobArray', outputs = jet_type+'s' ) alg.addgeneric('InputWidth', HW.InputWidthJET) alg.addgeneric('InputWidth1stStage', HW.InputWidth1stStageSortJET ) @@ -254,20 +254,20 @@ class TopoAlgoDef: tm.registerTopoAlgo(alg) - alg = AlgConf.METNoSort( name = 'XENoSort', inputs = 'MetTobArray', outputs = 'XENoSort', algoId = -1 ) + alg = AlgConf.METNoSort( name = 'XENoSort', inputs = 'MetTobArray', outputs = 'XENoSort' ) alg.addgeneric('InputWidth', HW.InputWidthMET) alg.addgeneric('OutputWidth', HW.OutputWidthMET) tm.registerTopoAlgo(alg) - alg = AlgConf.MetSort( name = 'XE', inputs = 'MetTobArray', outputs = 'XE', algoId = -1 ) + alg = AlgConf.MetSort( name = 'XE', inputs = 'MetTobArray', outputs = 'XE' ) alg.addgeneric('InputWidth', HW.InputWidthMET) alg.addgeneric('OutputWidth', HW.OutputWidthMET) tm.registerTopoAlgo(alg) - alg = AlgConf.MuonSelect( name = 'MUab', inputs = 'MuonTobArray', outputs = 'MUab', algoId = -1 ) + alg = AlgConf.MuonSelect( name = 'MUab', inputs = 'MuonTobArray', outputs = 'MUab' ) alg.addgeneric('InputWidth', HW.InputWidthMU) alg.addgeneric('InputWidth1stStage', HW.InputWidth1stStageSelectMU ) @@ -278,7 +278,7 @@ class TopoAlgoDef: tm.registerTopoAlgo(alg) - alg = AlgConf.MuonSort( name = 'MUs', inputs = 'MuonTobArray', outputs = 'MUs', algoId = -1 ) + alg = AlgConf.MuonSort( name = 'MUs', inputs = 'MuonTobArray', outputs = 'MUs' ) alg.addgeneric('InputWidth', HW.InputWidthMU) alg.addgeneric('InputWidth1stStage', HW.InputWidth1stStageSortMU ) @@ -289,7 +289,7 @@ class TopoAlgoDef: tm.registerTopoAlgo(alg) - alg = AlgConf.MuonSelect( name = 'CMUab', inputs = 'MuonTobArray', outputs = 'CMUab', algoId = -1 ) + alg = AlgConf.MuonSelect( name = 'CMUab', inputs = 'MuonTobArray', outputs = 'CMUab' ) alg.addgeneric('InputWidth', HW.InputWidthMU) alg.addgeneric('InputWidth1stStage', HW.InputWidth1stStageSelectMU ) @@ -300,7 +300,7 @@ class TopoAlgoDef: tm.registerTopoAlgo(alg) - alg = AlgConf.MuonSort_1BC( name = 'LMUs', inputs = 'LateMuonTobArray', outputs = 'LMUs', algoId = -1 ) + alg = AlgConf.MuonSort_1BC( name = 'LMUs', inputs = 'LateMuonTobArray', outputs = 'LMUs' ) alg.addgeneric('InputWidth', HW.InputWidthMU) #alg.addgeneric('InputWidth1stStage', HW.InputWidth1stStageSortMU ) @@ -312,7 +312,7 @@ class TopoAlgoDef: # Abbreviated lists: - alg = AlgConf.ClusterSelect( name = 'EMab', inputs = 'ClusterTobArray', outputs = 'EMab', algoId = -1 ) + alg = AlgConf.ClusterSelect( name = 'EMab', inputs = 'ClusterTobArray', outputs = 'EMab' ) alg.addgeneric('InputWidth', HW.InputWidthEM) alg.addgeneric('InputWidth1stStage', HW.InputWidth1stStageSelectEM ) @@ -327,14 +327,14 @@ class TopoAlgoDef: # All lists: - alg = AlgConf.ClusterNoSort( name = 'TAUall', inputs = 'ClusterTobArray', outputs = 'TAUall', algoId = -1) + alg = AlgConf.ClusterNoSort( name = 'TAUall', inputs = 'ClusterTobArray', outputs = 'TAUall') alg.addgeneric('InputWidth', HW.InputWidthTAU) alg.addgeneric('OutputWidth', HW.InputWidthTAU) alg.addvariable('IsoMask', 0) tm.registerTopoAlgo(alg) - alg = AlgConf.MuonNoSort( name = 'MUall', inputs = 'MuonTobArray', outputs = 'MUall', algoId = -1) + alg = AlgConf.MuonNoSort( name = 'MUall', inputs = 'MuonTobArray', outputs = 'MUall') alg.addgeneric('InputWidth', HW.InputWidthMU) alg.addgeneric('OutputWidth', HW.InputWidthMU) tm.registerTopoAlgo(alg) @@ -370,7 +370,7 @@ class TopoAlgoDef: d.otype, str(d.ocut2) , d.olist, str(d.nleading2) if d.olist=="s" else "") toponames.append(toponame) - alg = AlgConf.InvariantMassInclusive1( name = d.algoname, inputs = inputList, outputs = toponames, algoId = -1) + alg = AlgConf.InvariantMassInclusive1( name = d.algoname, inputs = inputList, outputs = toponames) alg.addgeneric('InputWidth', d.inputwidth1) alg.addgeneric('MaxTob', d.nleading1) @@ -418,7 +418,7 @@ class TopoAlgoDef: inputList = [d.otype1 + d.olist] if (d.mult>1 or d.otype1==d.otype2) else [d.otype1 + d.olist, d.otype2 + d.olist] algoname = AlgConf.InvariantMassInclusive1 if (d.mult>1 or d.otype1==d.otype2) else AlgConf.InvariantMassInclusive2 - alg = algoname( name = toponame, inputs = inputList, outputs = [ toponame ], algoId = -1) + alg = algoname( name = toponame, inputs = inputList, outputs = [ toponame ]) if (d.mult>1 or d.otype1==d.otype2): alg.addgeneric('InputWidth', HW.OutputWidthSelectMU) @@ -470,7 +470,7 @@ class TopoAlgoDef: inputList = [d.otype1 + d.olist] if (d.mult>1 or d.otype1==d.otype2) else [d.otype1 + d.olist, d.otype2 + d.olist] algoname = AlgConf.DeltaRSqrIncl1 if (d.mult>1 or d.otype1==d.otype2) else AlgConf.DeltaRSqrIncl2 - alg = algoname( name = toponame, inputs = inputList, outputs = [ toponame ], algoId = -1) + alg = algoname( name = toponame, inputs = inputList, outputs = [ toponame ]) if (d.mult>1 or d.otype1==d.otype2): alg.addgeneric('InputWidth', HW.OutputWidthSelectMU) @@ -515,7 +515,7 @@ class TopoAlgoDef: inputList = [d.otype1 + d.olist1] if (d.mult>1 or d.otype1==d.otype2) else [d.otype1 + d.olist1, d.otype2 + d.olist2] algoname = AlgConf.DeltaEtaPhiIncl1 if (d.mult>1 or d.otype1==d.otype2) else AlgConf.DeltaEtaPhiIncl2 - alg = algoname( name = toponame, inputs = inputList, outputs = [ toponame ], algoId = -1) + alg = algoname( name = toponame, inputs = inputList, outputs = [ toponame ]) alg.addgeneric('NumResultBits', 1) @@ -565,7 +565,7 @@ class TopoAlgoDef: inputList = [d.otype1 + d.olist1] if d.otype1==d.otype2 else [d.otype1 + d.olist1, d.otype2 + d.olist2] algoname = AlgConf.DeltaRSqrIncl1 if d.otype1==d.otype2 else AlgConf.DeltaRSqrIncl2 - alg = algoname( name = toponame, inputs = inputList, outputs = [ toponame ], algoId = -1) + alg = algoname( name = toponame, inputs = inputList, outputs = [ toponame ]) if d.otype1==d.otype2: @@ -620,7 +620,7 @@ class TopoAlgoDef: inputList = d.otype + d.olist - alg = AlgConf.JetHT( name = toponame, inputs = inputList, outputs = [toponame], algoId = -1 ) + alg = AlgConf.JetHT( name = toponame, inputs = inputList, outputs = [toponame] ) alg.addgeneric('InputWidth', d.inputwidth) @@ -654,7 +654,7 @@ class TopoAlgoDef: toponame = "%iINVM%i-%s%s%s%s-EMs6" % (d.minInvm, d.maxInvm, d.otype, str(ocut) if ocut > 0 else "", d.olist, str(d.nleading) if d.olist=="s" else "") toponames.append(toponame) - alg = AlgConf.InvariantMassInclusive2( name = d.algoname, inputs = [inputList, 'EMs'], outputs = toponames, algoId = -1) + alg = AlgConf.InvariantMassInclusive2( name = d.algoname, inputs = [inputList, 'EMs'], outputs = toponames) alg.addgeneric('InputWidth1', d.inputwidth) @@ -700,7 +700,7 @@ class TopoAlgoDef: inputList = d.otype + d.olist - alg = AlgConf.MinDeltaPhiIncl2( name = toponame, inputs = [ inputList, 'XE'], outputs = [ toponame ], algoId = -1 ) + alg = AlgConf.MinDeltaPhiIncl2( name = toponame, inputs = [ inputList, 'XE'], outputs = [ toponame ] ) alg.addgeneric('InputWidth1', d.inputwidth) @@ -733,7 +733,7 @@ class TopoAlgoDef: inputList = d.otype + d.olist - alg = AlgConf.TransverseMassInclusive1( name = toponame, inputs = [ inputList, 'XE'], outputs = [ toponame ], algoId = -1 ) + alg = AlgConf.TransverseMassInclusive1( name = toponame, inputs = [ inputList, 'XE'], outputs = [ toponame ] ) @@ -747,18 +747,9 @@ class TopoAlgoDef: # VBF deta - if usev7: - algoList = [ - {"minDeta": 63, "maxDeta": 127, "otype" : "FJ", "ocut1" : 20, "olist" : "s", "nleading1" : 1, "inputwidth1": HW.OutputWidthSortJET, "ocut2" : 20, "nleading2": 2}, #63DETA127-FJ20s1-FJ20s2 - {"minDeta": 0, "maxDeta": 20, "otype" : "J", "ocut1" : 50, "olist" : "s", "nleading1" : 1, "inputwidth1": HW.OutputWidthSortJET, "ocut2" : 0, "nleading2": 2}, #0DETA20-J50s1-Js2 - ] - elif usev8: - algoList = [ - {"minDeta": 0, "maxDeta": 20, "otype" : "J", "ocut1" : 50, "olist" : "s", "nleading1" : 1, "inputwidth1": HW.OutputWidthSortJET, "ocut2" : 0, "nleading2": 2}, #0DETA20-J50s1-Js2 - ] - else: - algoList = [] - + algoList = [ + {"minDeta": 0, "maxDeta": 20, "otype" : "J", "ocut1" : 50, "olist" : "s", "nleading1" : 1, "inputwidth1": HW.OutputWidthSortJET, "ocut2" : 0, "nleading2": 2}, #0DETA20-J50s1-Js2 + ] for x in algoList: class d: pass @@ -772,7 +763,7 @@ class TopoAlgoDef: log.debug("Define %s", toponame) inputList = d.otype + d.olist - alg = AlgConf.DeltaEtaIncl1( name = toponame, inputs = inputList, outputs = toponame, algoId = -1 ) + alg = AlgConf.DeltaEtaIncl1( name = toponame, inputs = inputList, outputs = toponame ) @@ -813,7 +804,7 @@ class TopoAlgoDef: inputList = d.otype + d.olist - alg = AlgConf.MinDeltaPhiIncl2( name = toponame, inputs = [inputList, 'XE'], outputs = [ toponame ], algoId = -1 ) + alg = AlgConf.MinDeltaPhiIncl2( name = toponame, inputs = [inputList, 'XE'], outputs = [ toponame ] ) alg.addgeneric('InputWidth1', d.inputwidth) alg.addgeneric('InputWidth2', 1) @@ -835,7 +826,10 @@ class TopoAlgoDef: {"minDr": 0, "maxDr": 4, "otype1" : "MU" ,"ocut1": 4, "olist1" : "ab", "otype2" : "CJ", "ocut2": 20, "olist2" : "ab"}, #0DR04-MU6ab-CJ20ab ] if usev8: - algoList = [] + algoList = [ + {"minDr": 0, "maxDr": 4, "otype1" : "MU" ,"ocut1": 4, "olist1" : "ab", "otype2" : "CJ", "ocut2": 15, "olist2" : "ab"}, #0DR04-MU4ab-CJ15ab + {"minDr": 0, "maxDr": 4, "otype1" : "MU" ,"ocut1": 6, "olist1" : "ab", "otype2" : "CJ", "ocut2": 20, "olist2" : "ab"}, #0DR04-MU6ab-CJ20ab + ] for x in algoList: @@ -849,7 +843,7 @@ class TopoAlgoDef: inputList = [d.otype1 + d.olist1, d.otype2 + d.olist2] - alg = AlgConf.DeltaRSqrIncl2( name = toponame, inputs = inputList, outputs = [ toponame ], algoId = -1) + alg = AlgConf.DeltaRSqrIncl2( name = toponame, inputs = inputList, outputs = [ toponame ]) alg.addgeneric('InputWidth1', HW.OutputWidthSelectMU) alg.addgeneric('InputWidth2', HW.OutputWidthSelectJET) @@ -874,7 +868,7 @@ class TopoAlgoDef: setattr (d, k, x[k]) toponame = "MULT-%s%s%s" % (d.otype1, str(d.ocut1), d.olist1) # noqa: F821 toponames = [toponame+"[0]", toponame+"[1]"] - log.debug("Define %s", toponames) + log.debug("Define %s with outputs %r", toponame, toponames) inputList = [d.otype1 + d.olist1] # noqa: F821 alg = AlgConf.Multiplicity( name = toponame, inputs = inputList, outputs = toponames) alg.addgeneric('InputWidth', d.inputwidth1) # noqa: F821 @@ -922,7 +916,7 @@ class TopoAlgoDef: inputList = [d.otype1 + d.olist] if (d.mult>1 or d.otype1==d.otype2) else [d.otype1 + d.olist, d.otype2 + d.olist] algoname = AlgConf.InvariantMassInclusive1 if (d.mult>1 or d.otype1==d.otype2) else AlgConf.InvariantMassInclusive2 - alg = algoname( name = toponame, inputs = inputList, outputs = [ toponame ], algoId = -1) + alg = algoname( name = toponame, inputs = inputList, outputs = [ toponame ]) if (d.mult>1 or d.otype1==d.otype2): alg.addgeneric('InputWidth', HW.OutputWidthSelectMU) alg.addgeneric('MaxTob', HW.OutputWidthSelectMU) @@ -968,7 +962,7 @@ class TopoAlgoDef: inputList = [d.otype1 + d.olist] if (d.mult>1 or d.otype1==d.otype2) else [d.otype1 + d.olist, d.otype2 + d.olist] algoname = AlgConf.DeltaRSqrIncl1 if (d.mult>1 or d.otype1==d.otype2) else AlgConf.DeltaRSqrIncl2 - alg = algoname( name = toponame, inputs = inputList, outputs = [ toponame ], algoId = -1) + alg = algoname( name = toponame, inputs = inputList, outputs = [ toponame ]) if (d.mult>1 or d.otype1==d.otype2): alg.addgeneric('InputWidth', HW.OutputWidthSelectMU) alg.addgeneric('MaxTob', HW.OutputWidthSelectMU) @@ -988,11 +982,7 @@ class TopoAlgoDef: tm.registerTopoAlgo(alg) # deta-dphi with ab+ab - if usev7: - algoList = [ - {"minDeta": 0, "maxDeta": 20, "minDphi": 0, "maxDphi": 20, "mult": 1, "otype1" : "TAU", "ocut1": 20, "olist1" : "abi", "nleading1": HW.OutputWidthSelectTAU, "otype2" : "TAU", "ocut2": 12, "olist2": "abi", "nleading2": HW.OutputWidthSelectTAU}, - ] - elif usev8: + if usev8: algoList = [] # {"minDeta": 0, "maxDeta": "04", "minDphi": 0, "maxDphi": "03", "mult": 1, "otype1" : "EM", "ocut1": 8, "olist1" : "abi", "nleading1": HW.OutputWidthSelectEM, "otype2" : "MU", "ocut2": 10, "olist2": "ab", "nleading2": HW.OutputWidthSelectMU}, # {"minDeta": 0, "maxDeta": "04", "minDphi": 0, "maxDphi": "03", "mult": 1, "otype1" : "EM", "ocut1": 15, "olist1" : "abi", "nleading1": HW.OutputWidthSelectEM, "otype2" : "MU", "ocut2": 0, "olist2": "ab", "nleading2": HW.OutputWidthSelectMU}, @@ -1019,7 +1009,7 @@ class TopoAlgoDef: inputList = [d.otype1 + d.olist1] if (d.mult>1 or d.otype1==d.otype2) else [d.otype1 + d.olist1, d.otype2 + d.olist2] algoname = AlgConf.DeltaEtaPhiIncl1 if (d.mult>1 or d.otype1==d.otype2) else AlgConf.DeltaEtaPhiIncl2 - alg = algoname( name = toponame, inputs = inputList, outputs = [ toponame ], algoId = -1) + alg = algoname( name = toponame, inputs = inputList, outputs = [ toponame ]) alg.addgeneric('NumResultBits', 1) if (d.mult>1 or d.otype1==d.otype2): @@ -1067,7 +1057,7 @@ class TopoAlgoDef: log.debug("Define %s", toponame) inputList = [d.otype1 + d.olist1, d.otype2 + d.olist2] - alg = AlgConf.DeltaEtaIncl2( name = toponame, inputs = inputList, outputs = [ toponame ], algoId = -1) + alg = AlgConf.DeltaEtaIncl2( name = toponame, inputs = inputList, outputs = [ toponame ]) alg.addgeneric('NumResultBits', 1) alg.addgeneric('InputWidth1', d.nleading1) @@ -1101,7 +1091,7 @@ class TopoAlgoDef: log.debug("Define %s", toponame) inputList = [d.otype1 + d.olist1, d.otype2 + d.olist2] - alg = AlgConf.DeltaPhiIncl2( name = toponame, inputs = inputList, outputs = [ toponame ], algoId = -1) + alg = AlgConf.DeltaPhiIncl2( name = toponame, inputs = inputList, outputs = [ toponame ]) alg.addgeneric('NumResultBits', 1) alg.addgeneric('InputWidth1', d.nleading1) @@ -1118,7 +1108,7 @@ class TopoAlgoDef: # JetMatch if not usev8: toponame = "0MATCH-4AJ20pETA31-4AJj15pETA31" - alg = AlgConf.MultiplicityCustom( name = toponame, inputs = [ 'AJMatchall' ], outputs = [ toponame ], algoId = -1 ) + alg = AlgConf.MultiplicityCustom( name = toponame, inputs = [ 'AJMatchall' ], outputs = [ toponame ] ) alg.addgeneric('InputWidth', HW.InputWidthJET) alg.addgeneric('NumResultBits', 1) alg.addvariable('MinET', 0) @@ -1130,7 +1120,7 @@ class TopoAlgoDef: # NoMatch for W T&P if not usev8: toponame = "NOT-02MATCH-EM10s1-AJj15allpETA49" - alg = AlgConf.NotMatch( name = toponame, inputs = [ 'EMs', 'AJjall'], outputs = [ toponame ], algoId = -1 ) + alg = AlgConf.NotMatch( name = toponame, inputs = [ 'EMs', 'AJjall'], outputs = [ toponame ] ) alg.addgeneric('InputWidth1', HW.OutputWidthSortEM) alg.addgeneric('InputWidth2', HW.InputWidthJET) alg.addgeneric('MaxTob1', 1) @@ -1147,7 +1137,7 @@ class TopoAlgoDef: # RATIO SUM for W T&P #toponame = "05RATIO-XE0-SUM0-EM10s1-HT0-AJj15allpETA49" - #alg = AlgConf.RatioSum( name = toponame, inputs = ['XE', 'AJjall', 'EMs'], outputs = [ toponame ], algoId = -1 ); + #alg = AlgConf.RatioSum( name = toponame, inputs = ['XE', 'AJjall', 'EMs'], outputs = [ toponame ] ); #alg.addgeneric('InputWidth1', 1) #alg.addgeneric('InputWidth2', HW.InputWidthJET) #alg.addgeneric('InputWidth3', HW.OutputWidthSortEM) @@ -1188,7 +1178,7 @@ class TopoAlgoDef: toponame = "%02d%s-XE0-HT0-AJj%sallpETA49" % (d.minRatio, d.Ratio, str(d.ocut)) log.debug("Define %s", toponame) - alg = AlgConf.Ratio( name = toponame, inputs = ['XE', 'AJjall'], outputs = [ toponame ], algoId = -1 ) + alg = AlgConf.Ratio( name = toponame, inputs = ['XE', 'AJjall'], outputs = [ toponame ] ) alg.addgeneric('InputWidth1', 1) alg.addgeneric('InputWidth2', HW.InputWidthJET) alg.addgeneric('MaxTob1', 1) @@ -1205,7 +1195,7 @@ class TopoAlgoDef: # RATIO MATCH dedicated to Exotic toponame = '100RATIO-0MATCH-TAU30si2-EMall' - alg = AlgConf.RatioMatch( name = toponame, inputs = [ 'TAUsi', 'EMall'], outputs = [ toponame ], algoId = -1 ) + alg = AlgConf.RatioMatch( name = toponame, inputs = [ 'TAUsi', 'EMall'], outputs = [ toponame ] ) alg.addgeneric('InputWidth1', HW.OutputWidthSortTAU) alg.addgeneric('InputWidth2', HW.InputWidthEM) alg.addgeneric('MaxTob1', 2) @@ -1218,7 +1208,7 @@ class TopoAlgoDef: # NOT MATCH dedicated to Exotic toponame = 'NOT-0MATCH-TAU30si1-EMall' - alg = AlgConf.NotMatch( name = toponame, inputs = [ 'TAUsi', 'EMall'], outputs = [ toponame ], algoId = -1 ) + alg = AlgConf.NotMatch( name = toponame, inputs = [ 'TAUsi', 'EMall'], outputs = [ toponame ] ) alg.addgeneric('InputWidth1', HW.OutputWidthSortTAU) alg.addgeneric('InputWidth2', HW.InputWidthEM) alg.addgeneric('MaxTob1', 1) @@ -1233,27 +1223,24 @@ class TopoAlgoDef: alg.addvariable('DRCut', 0) tm.registerTopoAlgo(alg) - # DISAMB 2 lists - for x in [ - {"disamb": 1, "otype1" : "TAU", "ocut1": 12, "olist1" : "abi", "nleading1": HW.OutputWidthSelectTAU, "otype2" : "J", "ocut2": 25, "olist2": "ab", "nleading2": HW.OutputWidthSelectJET}, #1DISAMB-TAU12abi-J25ab - #{"disamb": 0, "otype1" : "EM", "ocut1": 15, "olist1" : "abhi", "nleading1": HW.OutputWidthSelectEM, "otype2" : "TAU", "ocut2": 40, "olist2": "ab", "nleading2": HW.OutputWidthSelectTAU}, - #{"disamb": 1, "otype1" : "TAU", "ocut1": 20, "olist1" : "ab", "nleading1": HW.OutputWidthSelectTAU, "otype2" : "J", "ocut2": 20, "olist2": "ab", "nleading2": HW.OutputWidthSelectJET}, - #{"disamb": 0, "otype1" : "EM", "ocut1": 15, "olist1" : "abhi", "nleading1": HW.OutputWidthSelectEM, "otype2" : "TAU", "ocut2": 12, "olist2": "abi", "nleading2": HW.OutputWidthSelectTAU}, - ]: - + # DISAMB 1 and 2 lists + algolist=[ + { "disamb": 1, "otype1" : "TAU", "ocut1": 12, "olist1" : "abi", "nleading1": HW.OutputWidthSelectTAU, + "otype2" : "J", "ocut2": 25, "olist2": "ab", "nleading2": HW.OutputWidthSelectJET}, #1DISAMB-TAU12abi-J25ab + { "disamb": 2, "otype1" : "TAU", "ocut1": 12, "olist1" : "abi", "nleading1": HW.OutputWidthSelectTAU, + "otype2" : "J", "ocut2": 25, "olist2": "ab", "nleading2": HW.OutputWidthSelectJET}, #2DISAMB-TAU12abi-J25ab + ] + for x in algolist: class d: pass for k in x: setattr (d, k, x[k]) - obj1 = "%s%s%s" % (d.otype1, str(d.ocut1), d.olist1) obj2 = "-%s%s%s" % (d.otype2, str(d.ocut2), d.olist2) - toponame = "%sDISAMB-%s%s" % ( d.disamb if d.disamb>0 else "", obj1, obj2) - + toponame = "%sDISAMB-%s%s" % ( d.disamb if d.disamb>0 else "", obj1, obj2) log.debug("Define %s", toponame) - inputList = [d.otype1 + d.olist1, d.otype2 + d.olist2] - alg = AlgConf.DisambiguationIncl2( name = toponame, inputs = inputList, outputs = [ toponame ], algoId = -1) + alg = AlgConf.DisambiguationIncl2( name = toponame, inputs = inputList, outputs = [ toponame ]) alg.addgeneric('InputWidth1', d.nleading1 if d.olist1.find("ab")>=0 else -1000) alg.addgeneric('InputWidth2', d.nleading2 if d.olist2.find("ab")>=0 else -1000) alg.addgeneric('MaxTob1', d.nleading1) @@ -1265,6 +1252,7 @@ class TopoAlgoDef: alg.addvariable('MinET2', d.ocut2) alg.addvariable('DisambDRSqrMin', d.disamb*d.disamb) tm.registerTopoAlgo(alg) + # DISAMB 3 lists if not usev8: @@ -1290,7 +1278,7 @@ class TopoAlgoDef: log.debug("Define %s", toponame) inputList = [d.otype1 + d.olist1, d.otype2 + d.olist2, d.otype3 + d.olist3] - alg = AlgConf.DisambiguationIncl3( name = toponame, inputs = inputList, outputs = [ toponame ], algoId = -1) + alg = AlgConf.DisambiguationIncl3( name = toponame, inputs = inputList, outputs = [ toponame ]) alg.addgeneric('InputWidth1', d.inputwidth1) alg.addgeneric('InputWidth2', d.inputwidth2) alg.addgeneric('InputWidth3', d.inputwidth3) @@ -1305,21 +1293,18 @@ class TopoAlgoDef: alg.addvariable('DisambDRSqr', d.disamb*d.disamb, 0) # DisambDR tm.registerTopoAlgo(alg) - # DISAMB 3 lists with DR cut to 2nd and 3rd lists - - if usev8: - algolist=[ - {"disamb": 1, "otype1" : "EM", "ocut1": 15, "olist1": "shi","nleading1": 2, "inputwidth1": HW.OutputWidthSortEM, "otype2" : "TAU", "ocut2": 12, "olist2": "abi", "nleading2": HW.OutputWidthSelectTAU, "inputwidth2": HW.OutputWidthSelectTAU, "otype3" : "J", "ocut3": 25, "olist3": "ab", "nleading3": HW.OutputWidthSelectJET, "inputwidth3": HW.OutputWidthSelectJET, "drcutmin": 0, "drcutmax": 28}, #1DISAMB-J25ab-0DR28-EM15his2-TAU12abi - {"disamb": 2, "otype1" : "TAU", "ocut1": 20, "olist1": "abi","nleading1": HW.OutputWidthSelectTAU, "inputwidth1": HW.OutputWidthSelectTAU, "otype2" : "TAU", "ocut2": 12, "olist2": "abi", "nleading2": HW.OutputWidthSelectTAU, "inputwidth2": HW.OutputWidthSelectTAU, "otype3" : "J", "ocut3": 25, "olist3": "ab", "nleading3": HW.OutputWidthSelectJET, "inputwidth3": HW.OutputWidthSelectJET, "drcutmin": 0, "drcutmax": 28}, # 2DISAMB-J25ab-0DR28-TAU20abi-TAU12abi - {"disamb": 2, "otype1" : "TAU", "ocut1": 20, "olist1": "abi","nleading1": HW.OutputWidthSelectTAU, "inputwidth1": HW.OutputWidthSelectTAU, "otype2" : "TAU", "ocut2": 12, "olist2": "abi", "nleading2": HW.OutputWidthSelectTAU, "inputwidth2": HW.OutputWidthSelectTAU, "otype3" : "J", "ocut3": 25, "olist3": "ab", "nleading3": HW.OutputWidthSelectJET, "inputwidth3": HW.OutputWidthSelectJET, "drcutmin": 0, "drcutmax": 25}, # 2DISAMB-J25ab-0DR25-TAU20abi-TAU12abi - ] - else: - algolist=[ - {"disamb": 1, "otype1" : "EM", "ocut1": 15, "olist1": "shi","nleading1": 2, "inputwidth1": HW.OutputWidthSortEM, "otype2" : "TAU", "ocut2": 12, "olist2": "abi", "nleading2": HW.OutputWidthSelectTAU, "inputwidth2": HW.OutputWidthSelectTAU, "otype3" : "J", "ocut3": 25, "olist3": "ab", "nleading3": HW.OutputWidthSelectJET, "inputwidth3": HW.OutputWidthSelectJET, "drcutmin": 0, "drcutmax": 28}, #1DISAMB-J25ab-0DR28-EM15his2-TAU12abi - {"disamb": 1, "otype1" : "TAU", "ocut1": 20, "olist1": "abi","nleading1": HW.OutputWidthSelectTAU, "inputwidth1": HW.OutputWidthSelectTAU, "otype2" : "TAU", "ocut2": 12, "olist2": "abi", "nleading2": HW.OutputWidthSelectTAU, "inputwidth2": HW.OutputWidthSelectTAU, "otype3" : "J", "ocut3": 25, "olist3": "ab", "nleading3": HW.OutputWidthSelectJET, "inputwidth3": HW.OutputWidthSelectJET, "drcutmin": 0, "drcutmax": 28}, # 1DISAMB-J25ab-0DR28-TAU20abi-TAU12abi - {"disamb": 1, "otype1" : "TAU", "ocut1": 20, "olist1": "abi","nleading1": HW.OutputWidthSelectTAU, "inputwidth1": HW.OutputWidthSelectTAU, "otype2" : "TAU", "ocut2": 12, "olist2": "abi", "nleading2": HW.OutputWidthSelectTAU, "inputwidth2": HW.OutputWidthSelectTAU, "otype3" : "J", "ocut3": 25, "olist3": "ab", "nleading3": HW.OutputWidthSelectJET, "inputwidth3": HW.OutputWidthSelectJET, "drcutmin": 0, "drcutmax": 25}, # 1DISAMB-J25ab-0DR25-TAU20abi-TAU12abi - ] + # DISAMB 3 lists with DR cut to 2nd and 3rd lists + algolist=[ + { "disamb": 1, "otype1" : "EM", "ocut1": 15, "olist1": "shi","nleading1": 2, "inputwidth1": HW.OutputWidthSortEM, "otype2" : "TAU", "ocut2": 12, "olist2": "abi", "nleading2": HW.OutputWidthSelectTAU, "inputwidth2": HW.OutputWidthSelectTAU, "otype3" : "J", "ocut3": 25, "olist3": "ab", "nleading3": HW.OutputWidthSelectJET, "inputwidth3": HW.OutputWidthSelectJET, "drcutmin": 0, "drcutmax": 28}, #1DISAMB-J25ab-0DR28-EM15his2-TAU12abi + { "disamb": 2, "otype1" : "EM", "ocut1": 15, "olist1": "shi","nleading1": 2, "inputwidth1": HW.OutputWidthSortEM, "otype2" : "TAU", "ocut2": 12, + "olist2": "abi", "nleading2": HW.OutputWidthSelectTAU, "inputwidth2": HW.OutputWidthSelectTAU, "otype3" : "J", "ocut3": 25, "olist3": "ab", + "nleading3": HW.OutputWidthSelectJET, "inputwidth3": HW.OutputWidthSelectJET, "drcutmin": 0, "drcutmax": 28}, #2DISAMB-J25ab-0DR28-EM15his2-TAU12abi + { "disamb": 2, "otype1" : "TAU", "ocut1": 20, "olist1": "abi","nleading1": HW.OutputWidthSelectTAU, "inputwidth1": HW.OutputWidthSelectTAU, "otype2" : "TAU", "ocut2": 12, "olist2": "abi", "nleading2": HW.OutputWidthSelectTAU, "inputwidth2": HW.OutputWidthSelectTAU, "otype3" : "J", "ocut3": 25, "olist3": "ab", "nleading3": HW.OutputWidthSelectJET, "inputwidth3": HW.OutputWidthSelectJET, "drcutmin": 0, "drcutmax": 28}, # 2DISAMB-J25ab-0DR28-TAU20abi-TAU12abi + { "disamb": 2, "otype1" : "TAU", "ocut1": 20, "olist1": "abi","nleading1": HW.OutputWidthSelectTAU, "inputwidth1": HW.OutputWidthSelectTAU, + "otype2" : "TAU", "ocut2": 12, "olist2": "abi", "nleading2": HW.OutputWidthSelectTAU, "inputwidth2": HW.OutputWidthSelectTAU, + "otype3" : "J", "ocut3": 25, "olist3": "ab", "nleading3": HW.OutputWidthSelectJET, "inputwidth3": HW.OutputWidthSelectJET, "drcutmin": 0, "drcutmax": 25}, # 2DISAMB-J25ab-0DR25-TAU20abi-TAU12abi + ] for x in algolist: class d: @@ -1335,7 +1320,7 @@ class TopoAlgoDef: log.debug("Define %s", toponame) inputList = [d.otype1 + d.olist1, d.otype2 + d.olist2, d.otype3 + d.olist3] - alg = AlgConf.DisambiguationDRIncl3( name = toponame, inputs = inputList, outputs = [ toponame ], algoId = -1) + alg = AlgConf.DisambiguationDRIncl3( name = toponame, inputs = inputList, outputs = [ toponame ]) alg.addgeneric('InputWidth1', d.inputwidth1) alg.addgeneric('InputWidth2', d.inputwidth2) alg.addgeneric('InputWidth3', d.inputwidth3) @@ -1374,7 +1359,7 @@ class TopoAlgoDef: inputList = d.otype + d.olist - alg = AlgConf.EtaPhiWindow( name = toponame, inputs = inputList, outputs = toponame, algoId = -1 ) + alg = AlgConf.EtaPhiWindow( name = toponame, inputs = inputList, outputs = toponame ) alg.addgeneric('InputWidth', d.inputwidth) alg.addgeneric('MaxTob', 0) alg.addgeneric('NumResultBits', 1) @@ -1403,7 +1388,7 @@ class TopoAlgoDef: for minxe in d.Threlist: toponames.append("KF-XE%s-AJall" % (minxe)) - alg = AlgConf.KalmanMETCorrection( name = "KF-XE-AJall", inputs = inputList, outputs = toponames, algoId = -1 ) + alg = AlgConf.KalmanMETCorrection( name = "KF-XE-AJall", inputs = inputList, outputs = toponames ) alg.addgeneric('InputWidth', HW.InputWidthJET) alg.addgeneric('NumResultBits', len(toponames)) alg.addvariable('MinET', 0) @@ -1434,7 +1419,7 @@ class TopoAlgoDef: inputList = d.otype + d.olist - alg = AlgConf.MinDeltaPhiIncl2( name = toponame, inputs = [ inputList, 'XE'], outputs = [ toponame ], algoId = -1 ) + alg = AlgConf.MinDeltaPhiIncl2( name = toponame, inputs = [ inputList, 'XE'], outputs = [ toponame ] ) alg.addgeneric('InputWidth1', d.inputwidth) @@ -1467,7 +1452,7 @@ class TopoAlgoDef: inputList = d.otype + d.olist - alg = AlgConf.TransverseMassInclusive1( name = toponame, inputs = [ inputList, 'XE'], outputs = [ toponame ], algoId = -1 ) + alg = AlgConf.TransverseMassInclusive1( name = toponame, inputs = [ inputList, 'XE'], outputs = [ toponame ] ) @@ -1501,7 +1486,7 @@ class TopoAlgoDef: log.debug("Define %s", toponame) inputList = [d.otype1 + d.olist1, d.otype2 + d.olist2] - alg = AlgConf.DisambiguationDRIncl2( name = toponame, inputs = inputList, outputs = [ toponame ], algoId = -1) + alg = AlgConf.DisambiguationDRIncl2( name = toponame, inputs = inputList, outputs = [ toponame ]) alg.addgeneric('InputWidth1', d.inputwidth1) alg.addgeneric('InputWidth2', d.inputwidth2) alg.addgeneric('MaxTob1', d.nleading1) @@ -1533,7 +1518,7 @@ class TopoAlgoDef: inputList = d.otype + d.olist - alg = AlgConf.MinDeltaPhiIncl2( name = toponame, inputs = [inputList, 'XE'], outputs = [ toponame ], algoId = -1 ) + alg = AlgConf.MinDeltaPhiIncl2( name = toponame, inputs = [inputList, 'XE'], outputs = [ toponame ] ) alg.addgeneric('InputWidth1', d.inputwidth) alg.addgeneric('InputWidth2', 1) @@ -1562,7 +1547,7 @@ class TopoAlgoDef: inputList = 'LMUs' - alg = AlgConf.EtCut( name = toponame, inputs = inputList, outputs = toponame, algoId = -1 ) + alg = AlgConf.EtCut( name = toponame, inputs = inputList, outputs = toponame ) alg.addgeneric('InputWidth', d.inputwidth) alg.addgeneric('MaxTob', 1) alg.addgeneric('NumResultBits', 1) @@ -1593,7 +1578,7 @@ class TopoAlgoDef: inputList = d.otype + d.olist - alg = AlgConf.SimpleCone( name = toponame, inputs = inputList, outputs = [toponame], algoId = -1 ) + alg = AlgConf.SimpleCone( name = toponame, inputs = inputList, outputs = [toponame] ) alg.addgeneric('InputWidth', d.inputwidth) @@ -1619,7 +1604,7 @@ class TopoAlgoDef: log.debug("Define %s", toponame) inputList = [d.otype1 + d.olist1, d.otype2 + d.olist2] - alg = AlgConf.DisambiguationInvmIncl2( name = toponame, inputs = inputList, outputs = toponame, algoId = -1) + alg = AlgConf.DisambiguationInvmIncl2( name = toponame, inputs = inputList, outputs = toponame) alg.addgeneric('InputWidth1', d.inputwidth1) alg.addgeneric('InputWidth2', d.inputwidth2) @@ -1652,7 +1637,7 @@ class TopoAlgoDef: inputList = [d.otype1 + d.olist1, d.otype2 + d.olist2] toponame = "%iINVM%i-%s%s" % (d.minInvm, d.maxInvm, obj1, obj2) - alg = AlgConf.InvariantMassInclusive2( name = toponame, inputs = inputList, outputs = toponame, algoId = -1) + alg = AlgConf.InvariantMassInclusive2( name = toponame, inputs = inputList, outputs = toponame) alg.addgeneric('InputWidth1', d.inputwidth1) @@ -1698,7 +1683,7 @@ class TopoAlgoDef: inputList = d.otype + d.olist - alg = AlgConf.InvariantMassInclusive1( name = toponame, inputs = inputList, outputs = toponame, algoId = -1) + alg = AlgConf.InvariantMassInclusive1( name = toponame, inputs = inputList, outputs = toponame) alg.addgeneric('InputWidth', d.inputwidth) alg.addgeneric('MaxTob', d.nleading1) @@ -1727,7 +1712,7 @@ class TopoAlgoDef: d.otype, str(d.ocut1) , d.olist, d.otype, d.olist) - alg = AlgConf.InvariantMassInclusive1( name = toponame, inputs = inputList, outputs = toponame, algoId = -1) + alg = AlgConf.InvariantMassInclusive1( name = toponame, inputs = inputList, outputs = toponame) alg.addgeneric('InputWidth', d.inputwidth) alg.addgeneric('MaxTob', HW.OutputWidthSelectEM) alg.addgeneric('NumResultBits', 1) @@ -1756,7 +1741,7 @@ class TopoAlgoDef: inputList = [d.otype1 + d.olist1, d.otype2 + d.olist2] - alg = AlgConf.DeltaRSqrIncl2( name = toponame, inputs = inputList, outputs = [ toponame ], algoId = -1) + alg = AlgConf.DeltaRSqrIncl2( name = toponame, inputs = inputList, outputs = [ toponame ]) alg.addgeneric('InputWidth1', HW.OutputWidthSelectEM) alg.addgeneric('InputWidth2', HW.OutputWidthSelectJET) @@ -1795,7 +1780,7 @@ class TopoAlgoDef: toponames.append(toponame) - alg = AlgConf.InvariantMassInclusive2( name = d.algoname, inputs = inputList, outputs = toponames, algoId = -1) + alg = AlgConf.InvariantMassInclusive2( name = d.algoname, inputs = inputList, outputs = toponames) alg.addgeneric('InputWidth1', d.inputwidth) @@ -1835,7 +1820,7 @@ class TopoAlgoDef: log.debug("Define %s", toponame) inputList = d.otype + d.olist - alg = AlgConf.DeltaPhiIncl1( name = toponame, inputs = inputList, outputs = toponame, algoId = -1 ) + alg = AlgConf.DeltaPhiIncl1( name = toponame, inputs = inputList, outputs = toponame ) alg.addgeneric('InputWidth', d.inputwidth1) alg.addgeneric('MaxTob', d.nleading2) @@ -1848,30 +1833,21 @@ class TopoAlgoDef: # VBF items INVM_NFF + DPHI - if usev8: - NFFDphimap = [{"minInvm": 400 , "maxInvm": 9999, "minDphi": 0, "maxDphiList": [26, 24, 22, 20], "otype1" : "J", "ocut1" : 30, "olist1" : "s", "nleading1" : 6, "inputwidth": HW.OutputWidthSortJET, "otype2" : "AJ", "ocut2" : 20, "olist2" : "s", "nleading2" : 6 }] - - else: - NFFDphimap = [] - + NFFDphimap = [ { "minInvm": 400 , "maxInvm": 9999, "minDphi": 0, "maxDphiList": [26, 24, 22, 20], + "otype1" : "J", "ocut1" : 30, "olist1" : "s", "nleading1" : 6, "inputwidth": HW.OutputWidthSortJET, + "otype2" : "AJ", "ocut2" : 20, "olist2" : "s", "nleading2" : 6 }] for x in NFFDphimap: - class d: pass for k in x: setattr (d, k, x[k]) - inputList = [d.otype1 + d.olist1, d.otype2 + d.olist1] toponames=[] - for maxDphi in d.maxDphiList: toponames.append ("%iINVM%i-%iDPHI%i-%s%s%s%s-%s%s%s%s" % (d.minInvm, d.maxInvm, d.minDphi, maxDphi, d.otype1, str(d.ocut1) , d.olist1, str(d.nleading1) if d.olist1=="s" else "", d.otype2, str(d.ocut2) , d.olist2, str(d.nleading2) if d.olist2=="s" else "")) - - alg = AlgConf.InvariantMassDeltaPhiInclusive2( name = 'INVM_DPHI_NFF', inputs = inputList, outputs = toponames, algoId = -1) - - + alg = AlgConf.InvariantMassDeltaPhiInclusive2( name = 'INVM_DPHI_NFF', inputs = inputList, outputs = toponames) alg.addgeneric('InputWidth1', d.inputwidth) alg.addgeneric('InputWidth2', d.inputwidth) alg.addgeneric('MaxTob1', d.nleading1) @@ -1884,112 +1860,89 @@ class TopoAlgoDef: alg.addvariable('MaxMSqr', d.maxInvm*d.maxInvm , bitid) alg.addvariable('MinDeltaPhi', d.minDphi, bitid) alg.addvariable('MaxDeltaPhi', maxDphi, bitid) - tm.registerTopoAlgo(alg) #ATR-19355 - if usev8: - toponame = "0INVM10-3MU4ab" - log.debug("Define %s", toponame) - - inputList = 'MUab' - - alg = AlgConf.InvariantMassThreeTOBsIncl( name = toponame, inputs = inputList, outputs = toponame, algoId = -1 ) - alg.addgeneric('InputWidth', HW.OutputWidthSelectMU) - alg.addgeneric('MaxTob', HW.OutputWidthSelectMU) - alg.addgeneric('NumResultBits', 1) - alg.addvariable('MinMSqr', 0) - alg.addvariable('MaxMSqr', 10*10) - alg.addvariable('MinET1', 4) - tm.registerTopoAlgo(alg) - + toponame = "0INVM10-3MU4ab" + log.debug("Define %s", toponame) + inputList = 'MUab' + alg = AlgConf.InvariantMassThreeTOBsIncl( name = toponame, inputs = inputList, outputs = toponame ) + alg.addgeneric('InputWidth', HW.OutputWidthSelectMU) + alg.addgeneric('MaxTob', HW.OutputWidthSelectMU) + alg.addgeneric('NumResultBits', 1) + alg.addvariable('MinMSqr', 0) + alg.addvariable('MaxMSqr', 10*10) + alg.addvariable('MinET1', 4) + tm.registerTopoAlgo(alg) #ATR-18815 - if usev8: - toponame = "0INVM10-0DR15-EM8abi-MU10ab" - log.debug("Define %s", toponame) - - inputList = ['EMabi','MUab'] + toponame = "0INVM10-0DR15-EM8abi-MU10ab" + log.debug("Define %s", toponame) + inputList = ['EMabi','MUab'] + alg = AlgConf.InvariantMassInclusiveDeltaRSqrIncl2( name = toponame, inputs = inputList, outputs = toponame ) + alg.addgeneric('InputWidth1', HW.OutputWidthSelectEM) + alg.addgeneric('InputWidth2', HW.OutputWidthSelectMU) + alg.addgeneric('MaxTob1', HW.OutputWidthSortEM) + alg.addgeneric('MaxTob2', HW.OutputWidthSelectMU) + alg.addgeneric('NumResultBits', 1) + alg.addvariable('MinMSqr', 0) + alg.addvariable('MaxMSqr', 10*10) + alg.addvariable('MinET1', 8) + alg.addvariable('MinET2', 10) + alg.addgeneric('ApplyEtaCut', 0) + alg.addvariable('MinEta1', 0) + alg.addvariable('MinEta2', 0) + alg.addvariable('MaxEta1', 9999) + alg.addvariable('MaxEta2', 9999) + alg.addvariable('DeltaRMin', 0) + alg.addvariable('DeltaRMax', 15*15) + tm.registerTopoAlgo(alg) - alg = AlgConf.InvariantMassInclusiveDeltaRSqrIncl2( name = toponame, inputs = inputList, outputs = toponame, algoId = -1 ) - alg.addgeneric('InputWidth1', HW.OutputWidthSelectEM) - alg.addgeneric('InputWidth2', HW.OutputWidthSelectMU) - alg.addgeneric('MaxTob1', HW.OutputWidthSortEM) - alg.addgeneric('MaxTob2', HW.OutputWidthSelectMU) - alg.addgeneric('NumResultBits', 1) - alg.addvariable('MinMSqr', 0) - alg.addvariable('MaxMSqr', 10*10) - alg.addvariable('MinET1', 8) - alg.addvariable('MinET2', 10) - alg.addgeneric('ApplyEtaCut', 0) - alg.addvariable('MinEta1', 0) - alg.addvariable('MinEta2', 0) - alg.addvariable('MaxEta1', 9999) - alg.addvariable('MaxEta2', 9999) - alg.addvariable('DeltaRMin', 0) - alg.addvariable('DeltaRMax', 15*15) - tm.registerTopoAlgo(alg) #ATR-18815 - if usev8: - toponame = "0INVM10-0DR15-EM12abi-MU6ab" - log.debug("Define %s", toponame) - - inputList = ['EMabi','MUab'] - - alg = AlgConf.InvariantMassInclusiveDeltaRSqrIncl2( name = toponame, inputs = inputList, outputs = toponame, algoId = -1 ) - alg.addgeneric('InputWidth1', HW.OutputWidthSelectEM) - alg.addgeneric('InputWidth2', HW.OutputWidthSelectMU) - alg.addgeneric('MaxTob1', HW.OutputWidthSortEM) - alg.addgeneric('MaxTob2', HW.OutputWidthSelectMU) - alg.addgeneric('NumResultBits', 1) - alg.addvariable('MinMSqr', 0) - alg.addvariable('MaxMSqr', 10*10) - alg.addvariable('MinET1', 12) - alg.addvariable('MinET2', 6) - alg.addgeneric('ApplyEtaCut', 0) - alg.addvariable('MinEta1', 0) - alg.addvariable('MinEta2', 0) - alg.addvariable('MaxEta1', 9999) - alg.addvariable('MaxEta2', 9999) - alg.addvariable('DeltaRMin', 0) - alg.addvariable('DeltaRMax', 15*15) - tm.registerTopoAlgo(alg) - + toponame = "0INVM10-0DR15-EM12abi-MU6ab" + log.debug("Define %s", toponame) + inputList = ['EMabi','MUab'] + alg = AlgConf.InvariantMassInclusiveDeltaRSqrIncl2( name = toponame, inputs = inputList, outputs = toponame ) + alg.addgeneric('InputWidth1', HW.OutputWidthSelectEM) + alg.addgeneric('InputWidth2', HW.OutputWidthSelectMU) + alg.addgeneric('MaxTob1', HW.OutputWidthSortEM) + alg.addgeneric('MaxTob2', HW.OutputWidthSelectMU) + alg.addgeneric('NumResultBits', 1) + alg.addvariable('MinMSqr', 0) + alg.addvariable('MaxMSqr', 10*10) + alg.addvariable('MinET1', 12) + alg.addvariable('MinET2', 6) + alg.addgeneric('ApplyEtaCut', 0) + alg.addvariable('MinEta1', 0) + alg.addvariable('MinEta2', 0) + alg.addvariable('MaxEta1', 9999) + alg.addvariable('MaxEta2', 9999) + alg.addvariable('DeltaRMin', 0) + alg.addvariable('DeltaRMax', 15*15) + tm.registerTopoAlgo(alg) #ATR-18824 ZAFB-DPHI - - if usev8: - ZAFBDphimap = [ - { "minInvm": 60 , "maxInvm": 9999, "minDphiList": [4, 25], "maxDphi": 32, "minEta2": 23, "maxEta2": 49, - "inputwidth1": HW.OutputWidthSortEM, "otype1" : "EM", "ocut1" : 15, "olist1" : "abhi", - "nleading1" : HW.OutputWidthSortEM, "inputwidth2": HW.OutputWidthSortJET, "ocut2" : 15, "nleading2" : 6 } - ] - else: - ZAFBDphimap = [] - + ZAFBDphimap = [ + { "minInvm": 60 , "maxInvm": 9999, "minDphiList": [4, 25], "maxDphi": 32, "minEta2": 23, "maxEta2": 49, + "inputwidth1": HW.OutputWidthSortEM, "otype1" : "EM", "ocut1" : 15, "olist1" : "abhi", + "nleading1" : HW.OutputWidthSortEM, "inputwidth2": HW.OutputWidthSortJET, "ocut2" : 15, "nleading2" : 6 } + ] for x in ZAFBDphimap: - class d: pass for k in x: setattr (d, k, x[k]) - inputList = [d.otype1 + d.olist1, 'FJjs23ETA49'] toponames=[] - for minDphi in d.minDphiList: toponames.append ("%iINVM%i-%02dDPHI%i-%s%s%s%s-FJj%ss%s%iETA%i" % (d.minInvm, d.maxInvm, minDphi, d.maxDphi, - d.otype1, str(d.ocut1) , d.olist1, str(d.nleading1) if d.olist1=="s" else "", - str(d.ocut2) , str(d.nleading2) , d.minEta2, d.maxEta2)) - - - alg = AlgConf.InvariantMassDeltaPhiInclusive2( name = 'ZAFB_DPHI', inputs = inputList, outputs = toponames, algoId = -1) - - + d.otype1, str(d.ocut1) , d.olist1, str(d.nleading1) if d.olist1=="s" else "", + str(d.ocut2) , str(d.nleading2) , d.minEta2, d.maxEta2)) + alg = AlgConf.InvariantMassDeltaPhiInclusive2( name = 'ZAFB_DPHI', inputs = inputList, outputs = toponames) alg.addgeneric('InputWidth1', d.inputwidth1) alg.addgeneric('InputWidth2', d.inputwidth2) alg.addgeneric('MaxTob1', d.nleading1) @@ -2003,179 +1956,188 @@ class TopoAlgoDef: for bitid,minDphi in enumerate(d.minDphiList): alg.addvariable('MinET1', d.ocut1, bitid) alg.addvariable('MinET2', d.ocut2, bitid) - alg.addvariable('MinMSqr', d.minInvm*d.minInvm , bitid) - alg.addvariable('MaxMSqr', d.maxInvm*d.maxInvm , bitid) + alg.addvariable('MinMSqr', d.minInvm*d.minInvm * _emscale_for_decision, bitid) + alg.addvariable('MaxMSqr', d.maxInvm*d.maxInvm * _emscale_for_decision, bitid) alg.addvariable('MinDeltaPhi', minDphi, bitid) alg.addvariable('MaxDeltaPhi', d.maxDphi, bitid) - tm.registerTopoAlgo(alg) + #ATR-19302: not included for now - if usev8: - toponame = "0INVM70-27DPHI32-EM10his1-EM10his6" - log.debug("Define %s", toponame) - inputList = ['EMshi','EMshi'] - alg = AlgConf.InvariantMassDeltaPhiInclusive2( name = toponame, inputs = inputList, outputs = toponame, algoId = -1 ) - alg.addgeneric('InputWidth1', HW.OutputWidthSortEM) - alg.addgeneric('InputWidth2', HW.OutputWidthSortEM) - alg.addgeneric('MaxTob1', 1) - alg.addgeneric('MaxTob2', 6) - alg.addgeneric('NumResultBits', 1) - alg.addvariable('MinMSqr', 0) - alg.addvariable('MaxMSqr', (70*_emscale_for_decision)*(70*_emscale_for_decision)) - alg.addvariable('MinET1', 10) - alg.addvariable('MinET2', 10) - alg.addgeneric('ApplyEtaCut', 1) - alg.addvariable('MinEta1', 0) - alg.addvariable('MaxEta1', 9999) - alg.addvariable('MinEta2', 0) - alg.addvariable('MaxEta2', 9999) - alg.addvariable('MinDeltaPhi', 27) - alg.addvariable('MaxDeltaPhi', 32) - tm.registerTopoAlgo(alg) + toponame = "0INVM70-27DPHI32-EM10his1-EM10his6" + log.debug("Define %s", toponame) + inputList = ['EMshi','EMshi'] + alg = AlgConf.InvariantMassDeltaPhiInclusive2( name = toponame, inputs = inputList, outputs = toponame ) + alg.addgeneric('InputWidth1', HW.OutputWidthSortEM) + alg.addgeneric('InputWidth2', HW.OutputWidthSortEM) + alg.addgeneric('MaxTob1', 1) + alg.addgeneric('MaxTob2', 6) + alg.addgeneric('NumResultBits', 1) + alg.addvariable('MinMSqr', 0) + alg.addvariable('MaxMSqr', (70*_emscale_for_decision)*(70*_emscale_for_decision)) + alg.addvariable('MinET1', 10) + alg.addvariable('MinET2', 10) + alg.addgeneric('ApplyEtaCut', 1) + alg.addvariable('MinEta1', 0) + alg.addvariable('MaxEta1', 9999) + alg.addvariable('MinEta2', 0) + alg.addvariable('MaxEta2', 9999) + alg.addvariable('MinDeltaPhi', 27) + alg.addvariable('MaxDeltaPhi', 32) + tm.registerTopoAlgo(alg) - if usev8: - toponame = "0INVM70-27DPHI32-EM12his1-EM12his6" - log.debug("Define %s", toponame) - inputList = ['EMshi','EMshi'] - alg = AlgConf.InvariantMassDeltaPhiInclusive2( name = toponame, inputs = inputList, outputs = toponame, algoId = -1 ) - alg.addgeneric('InputWidth1', HW.OutputWidthSortEM) - alg.addgeneric('InputWidth2', HW.OutputWidthSortEM) - alg.addgeneric('MaxTob1', 1) - alg.addgeneric('MaxTob2', 6) - alg.addgeneric('NumResultBits', 1) - alg.addvariable('MinMSqr', 0) - alg.addvariable('MaxMSqr', (70*_emscale_for_decision)*(70*_emscale_for_decision)) - alg.addvariable('MinET1', 10) - alg.addvariable('MinET2', 12) - alg.addgeneric('ApplyEtaCut', 1) - alg.addvariable('MinEta1', 0) - alg.addvariable('MaxEta1', 9999) - alg.addvariable('MinEta2', 0) - alg.addvariable('MaxEta2', 9999) - alg.addvariable('MinDeltaPhi', 27) - alg.addvariable('MaxDeltaPhi', 32) - tm.registerTopoAlgo(alg) + + toponame = "0INVM70-27DPHI32-EM12his1-EM12his6" + log.debug("Define %s", toponame) + inputList = ['EMshi','EMshi'] + alg = AlgConf.InvariantMassDeltaPhiInclusive2( name = toponame, inputs = inputList, outputs = toponame ) + alg.addgeneric('InputWidth1', HW.OutputWidthSortEM) + alg.addgeneric('InputWidth2', HW.OutputWidthSortEM) + alg.addgeneric('MaxTob1', 1) + alg.addgeneric('MaxTob2', 6) + alg.addgeneric('NumResultBits', 1) + alg.addvariable('MinMSqr', 0) + alg.addvariable('MaxMSqr', (70*_emscale_for_decision)*(70*_emscale_for_decision)) + alg.addvariable('MinET1', 10) + alg.addvariable('MinET2', 12) + alg.addgeneric('ApplyEtaCut', 1) + alg.addvariable('MinEta1', 0) + alg.addvariable('MaxEta1', 9999) + alg.addvariable('MinEta2', 0) + alg.addvariable('MaxEta2', 9999) + alg.addvariable('MinDeltaPhi', 27) + alg.addvariable('MaxDeltaPhi', 32) + tm.registerTopoAlgo(alg) #ATR-19720, L1_BPH-8M15-0DR22-2MU6 - if usev8: - toponame = "8INVM15-0DR22-2MU6ab" - log.debug("Define %s", toponame) - - inputList = ['MUab'] + toponame = "8INVM15-0DR22-2MU6ab" + log.debug("Define %s", toponame) + inputList = ['MUab'] + alg = AlgConf.InvariantMassInclusiveDeltaRSqrIncl1( name = toponame, inputs = inputList, outputs = toponame ) + alg.addgeneric('InputWidth', HW.OutputWidthSelectMU) + alg.addgeneric('MaxTob', HW.OutputWidthSelectMU) + alg.addgeneric('NumResultBits', 1) + alg.addvariable('MinMSqr', 8*8) + alg.addvariable('MaxMSqr', 15*15) + alg.addvariable('MinET1', 6) + alg.addvariable('MinET2', 6) + alg.addvariable('DeltaRMin', 0) + alg.addvariable('DeltaRMax', 22*22) + tm.registerTopoAlgo(alg) - alg = AlgConf.InvariantMassInclusiveDeltaRSqrIncl1( name = toponame, inputs = inputList, outputs = toponame, algoId = -1 ) - alg.addgeneric('InputWidth', HW.OutputWidthSelectMU) - alg.addgeneric('MaxTob', HW.OutputWidthSelectMU) - alg.addgeneric('NumResultBits', 1) - alg.addvariable('MinMSqr', 8*8) - alg.addvariable('MaxMSqr', 15*15) - alg.addvariable('MinET1', 6) - alg.addvariable('MinET2', 6) - alg.addvariable('DeltaRMin', 0) - alg.addvariable('DeltaRMax', 22*22) - tm.registerTopoAlgo(alg) #ATR-19720, L1_BPH-2M9-2DR15-2MU6 - if usev8: - toponame = "2INVM9-2DR15-2MU6ab" - log.debug("Define %s", toponame) - - inputList = ['MUab'] + toponame = "2INVM9-2DR15-2MU6ab" + log.debug("Define %s", toponame) + inputList = ['MUab'] + alg = AlgConf.InvariantMassInclusiveDeltaRSqrIncl1( name = toponame, inputs = inputList, outputs = toponame ) + alg.addgeneric('InputWidth', HW.OutputWidthSelectMU) + alg.addgeneric('MaxTob', HW.OutputWidthSelectMU) + alg.addgeneric('NumResultBits', 1) + alg.addvariable('MinMSqr', 2*2) + alg.addvariable('MaxMSqr', 9*9) + alg.addvariable('MinET1', 6) + alg.addvariable('MinET2', 6) + alg.addvariable('DeltaRMin', 2*2) + alg.addvariable('DeltaRMax', 15*15) + tm.registerTopoAlgo(alg) - alg = AlgConf.InvariantMassInclusiveDeltaRSqrIncl1( name = toponame, inputs = inputList, outputs = toponame, algoId = -1 ) - alg.addgeneric('InputWidth', HW.OutputWidthSelectMU) - alg.addgeneric('MaxTob', HW.OutputWidthSelectMU) - alg.addgeneric('NumResultBits', 1) - alg.addvariable('MinMSqr', 2*2) - alg.addvariable('MaxMSqr', 9*9) - alg.addvariable('MinET1', 6) - alg.addvariable('MinET2', 6) - alg.addvariable('DeltaRMin', 2*2) - alg.addvariable('DeltaRMax', 15*15) - tm.registerTopoAlgo(alg) #ATR-19720, L1_BPH-2M9-0DR15-MU6MU4 - if usev8: - toponame = "2INVM9-0DR15-MU6ab-MU4ab" - log.debug("Define %s", toponame) - - inputList = ['MUab'] + toponame = "2INVM9-0DR15-MU6ab-MU4ab" + log.debug("Define %s", toponame) + inputList = ['MUab'] + alg = AlgConf.InvariantMassInclusiveDeltaRSqrIncl1( name = toponame, inputs = inputList, outputs = toponame ) + alg.addgeneric('InputWidth', HW.OutputWidthSelectMU) + alg.addgeneric('MaxTob', HW.OutputWidthSelectMU) + alg.addgeneric('NumResultBits', 1) + alg.addvariable('MinMSqr', 2*2) + alg.addvariable('MaxMSqr', 9*9) + alg.addvariable('MinET1', 6) + alg.addvariable('MinET2', 4) + alg.addvariable('DeltaRMin', 0) + alg.addvariable('DeltaRMax', 15*15) + tm.registerTopoAlgo(alg) - alg = AlgConf.InvariantMassInclusiveDeltaRSqrIncl1( name = toponame, inputs = inputList, outputs = toponame, algoId = -1 ) - alg.addgeneric('InputWidth', HW.OutputWidthSelectMU) - alg.addgeneric('MaxTob', HW.OutputWidthSelectMU) - alg.addgeneric('NumResultBits', 1) - alg.addvariable('MinMSqr', 2*2) - alg.addvariable('MaxMSqr', 9*9) - alg.addvariable('MinET1', 6) - alg.addvariable('MinET2', 4) - alg.addvariable('DeltaRMin', 0) - alg.addvariable('DeltaRMax', 15*15) - tm.registerTopoAlgo(alg) #ATR-19720, L1_BPH-8M15-0DR22-MU6MU4-BO - if usev8: - toponame = "8INVM15-0DR22-MU6ab-MU4ab" - log.debug("Define %s", toponame) - - inputList = ['MUab'] + toponame = "8INVM15-0DR22-MU6ab-MU4ab" + log.debug("Define %s", toponame) + inputList = ['MUab'] + alg = AlgConf.InvariantMassInclusiveDeltaRSqrIncl1( name = toponame, inputs = inputList, outputs = toponame ) + alg.addgeneric('InputWidth', HW.OutputWidthSelectMU) + alg.addgeneric('MaxTob', HW.OutputWidthSelectMU) + alg.addgeneric('NumResultBits', 1) + alg.addvariable('MinMSqr', 8*8) + alg.addvariable('MaxMSqr', 15*15) + alg.addvariable('MinET1', 6) + alg.addvariable('MinET2', 4) + alg.addvariable('DeltaRMin', 0) + alg.addvariable('DeltaRMax', 22*22) + tm.registerTopoAlgo(alg) - alg = AlgConf.InvariantMassInclusiveDeltaRSqrIncl1( name = toponame, inputs = inputList, outputs = toponame, algoId = -1 ) - alg.addgeneric('InputWidth', HW.OutputWidthSelectMU) - alg.addgeneric('MaxTob', HW.OutputWidthSelectMU) - alg.addgeneric('NumResultBits', 1) - alg.addvariable('MinMSqr', 8*8) - alg.addvariable('MaxMSqr', 15*15) - alg.addvariable('MinET1', 6) - alg.addvariable('MinET2', 4) - alg.addvariable('DeltaRMin', 0) - alg.addvariable('DeltaRMax', 22*22) - tm.registerTopoAlgo(alg) #ATR-19720, L1_BPH-2M9-0DR15-2MU4 - if usev8: - toponame = "2INVM9-0DR15-2MU4ab" - log.debug("Define %s", toponame) - - inputList = ['MUab'] + toponame = "2INVM9-0DR15-2MU4ab" + log.debug("Define %s", toponame) + inputList = ['MUab'] + alg = AlgConf.InvariantMassInclusiveDeltaRSqrIncl1( name = toponame, inputs = inputList, outputs = toponame ) + alg.addgeneric('InputWidth', HW.OutputWidthSelectMU) + alg.addgeneric('MaxTob', HW.OutputWidthSelectMU) + alg.addgeneric('NumResultBits', 1) + alg.addvariable('MinMSqr', 2*2) + alg.addvariable('MaxMSqr', 9*9) + alg.addvariable('MinET1', 4) + alg.addvariable('MinET2', 4) + alg.addvariable('DeltaRMin', 0) + alg.addvariable('DeltaRMax', 15*15) + tm.registerTopoAlgo(alg) - alg = AlgConf.InvariantMassInclusiveDeltaRSqrIncl1( name = toponame, inputs = inputList, outputs = toponame, algoId = -1 ) - alg.addgeneric('InputWidth', HW.OutputWidthSelectMU) - alg.addgeneric('MaxTob', HW.OutputWidthSelectMU) - alg.addgeneric('NumResultBits', 1) - alg.addvariable('MinMSqr', 2*2) - alg.addvariable('MaxMSqr', 9*9) - alg.addvariable('MinET1', 4) - alg.addvariable('MinET2', 4) - alg.addvariable('DeltaRMin', 0) - alg.addvariable('DeltaRMax', 15*15) - tm.registerTopoAlgo(alg) - - if usev8: - for x in [50,60]: - toponame = "CEP-CJ%is6" % x - log.debug("Define %s", toponame) - - inputList = ['CJs'] - - alg = AlgConf.ExclusiveJets( name = toponame, inputs = inputList, outputs = toponame, algoId = -1) - alg.addvariable('MinET1', x) - alg.addvariable('MinXi', 13000.0*0.02) - alg.addvariable('MaxXi', 13000.0*0.05) - tm.registerTopoAlgo(alg) - if usev8: - x = 50 - toponame = "CEP-CJ%is6pETA21" % x - log.debug("Define %s", toponame) - - inputList = ['CJsETA21'] - - alg = AlgConf.ExclusiveJets( name = toponame, inputs = inputList, outputs = toponame, algoId = -1) - alg.addvariable('MinET1', x) - alg.addvariable('MinXi', 13000.0*0.02) - alg.addvariable('MaxXi', 13000.0*0.05) - tm.registerTopoAlgo(alg) + # CEP-CJ50s6, CEP-CJ60s6 + #for x in [50,60]: + # toponame = "CEP-CJ%is6" % x + # log.debug("Define %s", toponame) + # inputList = ['CJs'] + # alg = AlgConf.ExclusiveJets( name = toponame, inputs = inputList, outputs = toponame) + # alg.addvariable('MinET1', x) + # alg.addvariable('MinXi', 13000.0*0.02) + # alg.addvariable('MaxXi', 13000.0*0.05) + # tm.registerTopoAlgo(alg) + + + # CEP-CJ50s6pETA21 + x = 50 + toponame = "CEP-CJ%is6pETA21" % x + log.debug("Define %s", toponame) + inputList = ['CJsETA21'] + alg = AlgConf.ExclusiveJets( name = toponame, inputs = inputList, outputs = toponame) + alg.addvariable('MinET1', x) + alg.addvariable('MinXi', 13000.0*0.02) + alg.addvariable('MaxXi', 13000.0*0.05) + tm.registerTopoAlgo(alg) + + # CEP_CJ + CEPmap = [ + {"algoname": 'CEP_CJ', "minETlist": [50, 60]} + ] + for x in CEPmap: + class d: + pass + for k in x: + setattr (d, k, x[k]) + inputList = ['CJs'] + toponames=[] + for minET in d.minETlist: # noqa: F821 + toponames.append ("CEP-CJ%is6" % (minET)) # noqa: F821 + alg = AlgConf.ExclusiveJets( name = d.algoname, inputs = inputList, outputs = toponames) # noqa: F821 + alg.addgeneric('InputWidth', HW.InputWidthJET) # noqa: F821 + alg.addgeneric('MaxTob', HW.InputWidthJET) # noqa: F821 + alg.addgeneric('NumResultBits', len(toponames)) # noqa: F821 + for bitid,minET in enumerate(d.minETlist): # noqa: F821 + alg.addvariable('MinET1', minET, bitid)# noqa: F821 + alg.addvariable('MinXi', 13000.0*0.02, bitid) # noqa: F821 + alg.addvariable('MaxXi', 13000.0*0.05, bitid) # noqa: F821 + tm.registerTopoAlgo(alg) diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/L1/L1MenuConfig.py b/Trigger/TriggerCommon/TriggerMenuMT/python/L1/L1MenuConfig.py index 8e1d820bd79ed84497d1674b341265c923082fb0..00da7cbbb708fd0e59dc8688754eb96663a92ad5 100644 --- a/Trigger/TriggerCommon/TriggerMenuMT/python/L1/L1MenuConfig.py +++ b/Trigger/TriggerCommon/TriggerMenuMT/python/L1/L1MenuConfig.py @@ -3,11 +3,13 @@ import re from importlib import import_module from collections import defaultdict as ddict +from itertools import chain from AthenaCommon.Logging import logging from .Base.L1MenuFlags import L1MenuFlags from .Base.Limits import Limits +from .Base.Boards import BoardType from .Base.L1Menu import L1Menu from .Base.Thresholds import TopoThreshold from .Base.TopoAlgorithms import AlgCategory @@ -140,7 +142,7 @@ class L1MenuConfig(object): def _addThrToRegistry(self, thr): if self.thresholdExists(thr.name): - raise RuntimeError("LVL1 threshold of name '%s' already defined, need to abort", thr.name) + raise RuntimeError("LVL1 threshold of name '%s' already defined, need to abort" % thr.name) self._registeredThresholds[thr.name] = thr @@ -168,38 +170,32 @@ class L1MenuConfig(object): Add all L1Topo triggers that are part of the menu as allowed input to the menu """ - self._topoTriggers = {} + _topoTriggers = {} # for all topo algorithm categories the outputs (sometimes multiple) are defined as thresholds for cat in AlgCategory.getAllCategories(): - outputLines = [] + outputLines = [] for algo in self._registeredTopoAlgos[cat].values(): outputLines += algo.outputs if (type(algo.outputs) == list) else [ algo.outputs ] - self._topoTriggers[cat] = sorted(outputLines) - log.info("... found %i topo triggerlines (source: %s)", len(self._topoTriggers[cat]), cat ) - log.debug("%r", self._topoTriggers[cat]) + _topoTriggers[cat] = sorted(outputLines) + log.info("... found %i topo triggerlines (source: %s)", len(_topoTriggers[cat]), cat ) + log.debug("%r", _topoTriggers[cat]) - for cat in [AlgCategory.TOPO, AlgCategory.MUCTPI]: - for topoLineName in self._topoTriggers[cat]: - topoThrName = cat.prefix + topoLineName - TopoThreshold( name = topoThrName, algCategory = cat ) - - # multibit topo triggers are only supported for legacy central muon trigger - multibitTopoTriggers = set() multibitPattern = re.compile(r"(?P<line>.*)\[(?P<bit>\d+)\]") - for topoLineName in self._topoTriggers[AlgCategory.LEGACY]: - m = multibitPattern.match(topoLineName) # tries to match "trigger[bit]" - if m: - topoThrName = AlgCategory.LEGACY.prefix + m.groupdict()['line'] - multibitTopoTriggers.add( topoThrName ) - else: - topoThrName = AlgCategory.LEGACY.prefix + topoLineName # "topo", "muctpi", "legacy" - TopoThreshold( name = topoThrName, algCategory = AlgCategory.LEGACY ) - - # create thresholds from topo-multibit - for topoThrName in multibitTopoTriggers: # ( 'MULT-CMU4ab', ...) - TopoThreshold( name = topoThrName, algCategory = AlgCategory.LEGACY ) + for cat in [AlgCategory.TOPO, AlgCategory.MUCTPI, AlgCategory.LEGACY]: + multibitTopoTriggers = set() + for topoLineName in _topoTriggers[cat]: + m = multibitPattern.match(topoLineName) # tries to match "trigger[bit]" + if m: + topoThrName = cat.prefix + m.groupdict()['line'] + multibitTopoTriggers.add( topoThrName ) + else: + topoThrName = cat.prefix + topoLineName + TopoThreshold( name = topoThrName, algCategory = cat ) + # create thresholds from topo-multibit + for topoThrName in multibitTopoTriggers: # ( 'MULT-CMU4ab', ...) + TopoThreshold( name = topoThrName, algCategory = cat ) @@ -287,9 +283,11 @@ class L1MenuConfig(object): legacymenumodule = __import__('TriggerMenuMT.L1.Menu.Menu_%s_inputs_legacy' % self.menuFilesToLoad, globals(), locals(), ['defineMenu'], 0) legacymenumodule.defineLegacyInputsMenu() log.info("... L1 legacy menu %s contains %i legacy boards (%s)", self.menuFilesToLoad, len(L1MenuFlags.legacyBoards()), ', '.join(L1MenuFlags.legacyBoards().keys())) - except ImportError: - log.info("==> No menu defining the legacy inputs was found, will assume this intended") - + except ImportError as ie: + if ie.name == 'TriggerMenuMT.L1.Menu.Menu_%s_inputs_legacy' % self.menuFilesToLoad: + log.info(f"==> No menu defining the legacy inputs was found, will assume this intended. {ie.msg} {ie.name} {ie.path}") + else: + raise def _registerDefinedConfigurationObjects(self): """ @@ -386,9 +384,11 @@ class L1MenuConfig(object): def _generateTopoMenu(self): - allBoards = (list(L1MenuFlags.boards().items()) + list(L1MenuFlags.legacyBoards().items())) - allBoardsWithTopo = list(filter( lambda n : ('topo' in n[0].lower() or 'muctpi' in n[0].lower()), allBoards )) - + allBoardsWithTopo = list( filter ( + lambda b : BoardType.fromBoardName(b[0]) in [BoardType.TOPO, BoardType.MUCTPI], + chain(L1MenuFlags.boards().items(), L1MenuFlags.legacyBoards().items()) + )) + # # Add the topo thresholds to the menu # @@ -668,19 +668,18 @@ class L1MenuConfig(object): NIM and CALREQ types are not remapped !! """ - existingMappings = ddict(set) + alreadyUsedMappingNumbers = ddict(set) for thr in self.l1menu.thresholds: if thr.mapping<0: continue - existingMappings[thr.ttype].add(thr.mapping) + alreadyUsedMappingNumbers[thr.ttype].add(thr.mapping) nextFreeMapping = ddict(lambda: 0) - for k in existingMappings: + for k in alreadyUsedMappingNumbers: nextFreeMapping[k] = 0 - for thr in self.l1menu.thresholds(): if thr.mapping < 0: - while nextFreeMapping[thr.ttype] in existingMappings[thr.ttype]: + while nextFreeMapping[thr.ttype] in alreadyUsedMappingNumbers[thr.ttype]: nextFreeMapping[thr.ttype] += 1 log.debug('Setting mapping of threshold %s as %i', thr, nextFreeMapping[thr.ttype]) thr.mapping = nextFreeMapping[thr.ttype] diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/L1/Menu/Menu_MC_pp_v8.py b/Trigger/TriggerCommon/TriggerMenuMT/python/L1/Menu/Menu_MC_pp_v8.py index d6ea6aa2958a6343ac74b7da13a4fc3cc5505d28..f6799212a77a645fa33c240fff629b2f8729c785 100644 --- a/Trigger/TriggerCommon/TriggerMenuMT/python/L1/Menu/Menu_MC_pp_v8.py +++ b/Trigger/TriggerCommon/TriggerMenuMT/python/L1/Menu/Menu_MC_pp_v8.py @@ -312,7 +312,7 @@ def defineMenu(): #ATR-17320 'L1_CEP-CJ60', 'L1_CEP-CJ50' , - 'L1_CEP-CJ50.ETA21', + #'L1_CEP-CJ50.ETA21', #ATR-21371 'L1_ALFA_ANY', @@ -422,7 +422,7 @@ def defineMenu(): 'L1_TAU20IM_2TAU12IM_J25_2J20_3J12' : 70, 'L1_TAU20IM_2TAU12IM_4J12.0ETA23' : 316, - 'L1_DR-MU10TAU12I_TAU12I-J25' : 72, + #'L1_DR-MU10TAU12I_TAU12I-J25' : 72, 'L1_TAU20IM_2J20_XE45' : 74, 'L1_TAU20IM_2TAU12IM_4J12.0ETA28' : 77, 'L1_TAU20IM_2J20_XE50' : 79, @@ -507,7 +507,7 @@ def defineMenu(): 'L1_BCM_Wide_UNPAIRED_NONISO' : 161, 'L1_CEP-CJ60' : 162, 'L1_BCM_AC_UNPAIRED_ISO' : 163, - 'L1_CEP-CJ50' : 72, + 'L1_CEP-CJ50' : 73, 'L1_BPH-8M15-2MU4-BO' : 165, 'L1_MBTS_1_EMPTY' : 164, @@ -731,16 +731,15 @@ def defineMenu(): 'L1_2eEM8VH_MU10' : 417, 'L1_eEM15VHI_2eTAU12IM_4jJ12' : 462, 'L1_eEM15VHI_2eTAU12IM_gXERHO35' : 477, - 'L1_eEM18VHI_3jJ20' : 489, - 'L1_eEM20VHI_eTAU20IM_2eTAU20_jJ25_3jJ20' : 490, - 'L1_eEM20VH_3eEM10VH' : 491, - 'L1_eEM22VHI' : 492, - 'L1_eEM20VHI' : 493, - 'L1_eEM20VH' : 494, - 'L1_eEM7_MU20' : 495, - - 'L1_MU10_2jJ15_jJ20' : 496, - 'L1_MU10_2jJ20' : 497, + #'L1_eEM18VHI_3jJ20' : 489, + #'L1_eEM20VHI_eTAU20IM_2eTAU20_jJ25_3jJ20' : 490, + #'L1_eEM20VH_3eEM10VH' : 491, + #'L1_eEM22VHI' : 492, + #'L1_eEM20VHI' : 493, + #'L1_eEM20VH' : 494, + #'L1_eEM7_MU20' : 495, + #'L1_MU10_2jJ15_jJ20' : 496, + #'L1_MU10_2jJ20' : 497, 'L1_MU10_eTAU12IM_3jJ12' : 498, 'L1_MU10_eTAU12IM_jJ25_2jJ12' : 499, 'L1_MU10_eTAU12IM_gXERHO35' : 500, @@ -751,7 +750,19 @@ def defineMenu(): 'L1_eTAU20IM_2eTAU12IM_4jJ12.0ETA23' : 505, 'L1_eTAU25IM_2eTAU20IM_2jJ25_3jJ20' : 506, 'L1_eTAU40_2eTAU12IM_gXERHO40' : 507, - 'L1_eTAU60_2eTAU40' : 508, + #'L1_eTAU60_2eTAU40' : 508, + + 'L1_ALFA_A7L1L': 492, + 'L1_ALFA_A7L1U': 491, + 'L1_ALFA_A7R1L': 494, + 'L1_ALFA_A7R1U': 493, + 'L1_ALFA_ANY' : 490, + 'L1_ALFA_B7L1L': 72, + 'L1_ALFA_B7L1U': 489, + 'L1_ALFA_B7R1L': 496, + 'L1_ALFA_B7R1U': 495, + + # RNDM 'L1_RD0_UNPAIRED_NONISO' : 178, diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/L1/Menu/Menu_MC_pp_v8_inputs.py b/Trigger/TriggerCommon/TriggerMenuMT/python/L1/Menu/Menu_MC_pp_v8_inputs.py index b01559e0baca1dce2fa3f153e52581759f3bc7fd..af11d495eb0385157d36536e1ed8ee90e896af0a 100644 --- a/Trigger/TriggerCommon/TriggerMenuMT/python/L1/Menu/Menu_MC_pp_v8_inputs.py +++ b/Trigger/TriggerCommon/TriggerMenuMT/python/L1/Menu/Menu_MC_pp_v8_inputs.py @@ -16,6 +16,7 @@ def defineInputsMenu(): #----------------------------------- # SLOT 9 / CON 1 (CTPCal, NIM1,NIM2) + # https://twiki.cern.ch/twiki/bin/view/Atlas/LevelOneCentralTriggerSetup#CTPIN_Slot_9 #----------------------------------- ctpinBoards["Ctpin9"] = odict() ctpinBoards["Ctpin9"]["connectors"] = [] @@ -29,8 +30,7 @@ def defineInputsMenu(): "thresholds" : [ 'BCM_AtoC', 'BCM_CtoA', 'BCM_Wide', # 3 x 1-bit BCM ('BCM_Comb',3), # 1x 3-bit BCM - 'BCM_MCA', 'BCM_MCC', 'BCM_X', - (None,8), + (None,11), 'BPTX0','BPTX1', # 2x BPTX 'LUCID_A', 'LUCID_C', # 2x LUCID (None,4), @@ -61,7 +61,7 @@ def defineInputsMenu(): "legacy" : False, "thresholds" : [ 'MBTS_C0', 'MBTS_C1', 'MBTS_C2', 'MBTS_C3', 'MBTS_C4', 'MBTS_C5', 'MBTS_C6', 'MBTS_C7', 'MBTS_C8', 'MBTS_C10', 'MBTS_C12', 'MBTS_C14', - 'MBTS_C9', 'MBTS_C11', 'MBTS_C13', 'MBTS_C15', # 16x MBTSSI + 'MBTS_C11', 'MBTS_C13', 'MBTS_C9', 'MBTS_C15', # 16x MBTSSI ('MBTS_C',3), # 1x MBTS_C 'NIMTGC', # TGC 'NIMRPC', # RPC @@ -139,43 +139,22 @@ def defineInputsMenu(): "fpga" : 0, "clock" : 0, "algorithms" : [ - TopoMenuDef( 'HT190-J15s5pETA21', outputbits = 0 ), - TopoMenuDef( '0DR03-EM7ab-CJ15ab', outputbits = 1 ), - TopoMenuDef( 'INVM_NFF', outputbits = 2, outputlines = ['500INVM9999-J30s6-AJ20s6'] ), - TopoMenuDef( 'INVM_AJ_HighMass', outputbits = 3, outputlines = ['700INVM9999-AJ30s6-AJ20s6'] ), - TopoMenuDef( 'INVM_AJ_LowMass', outputbits = 4, outputlines = ['300INVM9999-AJ30s6-AJ20s6'] ), - TopoMenuDef( 'HT150-J20s5pETA31', outputbits = 5 ), - TopoMenuDef( '400INVM9999-AJ30s6pETA31-AJ20s6p31ETA49', outputbits = 6 ), - TopoMenuDef( '10MINDPHI-J20s2-XE30', outputbits = 7 ), - TopoMenuDef( '10MINDPHI-J20s2-XE50', outputbits = 8 ), - TopoMenuDef( 'SC111-CJ15abpETA26', outputbits = 9 ), - TopoMenuDef( '0DETA20-J50s1-Js2', outputbits = 10 ), - TopoMenuDef( '1DISAMB-J25ab-0DR28-EM15his2-TAU12abi', outputbits = 11 ), - TopoMenuDef( '2DISAMB-J25ab-0DR28-TAU20abi-TAU12abi', outputbits = 12 ), - TopoMenuDef( '1DISAMB-TAU12abi-J25ab', outputbits = 13 ), - TopoMenuDef( 'ZAFB_DPHI', outputbits = (14,15), outputlines = ['60INVM9999-04DPHI32-EM15abhi-FJj15s623ETA49', - '60INVM9999-25DPHI32-EM15abhi-FJj15s623ETA49']) + TopoMenuDef( '0DR25-TAU20abi-TAU12abi', outputbits = 0 ), + TopoMenuDef( '0DR28-TAU20abi-TAU12abi', outputbits = 1 ), + TopoMenuDef( '2DISAMB-J25ab-0DR25-TAU20abi-TAU12abi', outputbits = 2 ), + TopoMenuDef( '2DISAMB-J25ab-0DR28-TAU20abi-TAU12abi', outputbits = 3 ), + TopoMenuDef( 'INVM_DPHI_NFF', outputbits = (4,7), outputlines = ['400INVM9999-0DPHI26-J30s6-AJ20s6', + '400INVM9999-0DPHI24-J30s6-AJ20s6', + '400INVM9999-0DPHI22-J30s6-AJ20s6', + '400INVM9999-0DPHI20-J30s6-AJ20s6'] ), + TopoMenuDef( '0INVM10-3MU4ab', outputbits = 9 ), ] - }, - + }, + { "fpga" : 0, "clock" : 1, "algorithms" : [ - TopoMenuDef( 'CEP-CJ50s6pETA21', outputbits = 0 ), - TopoMenuDef( 'CEP-CJ60s6', outputbits = 1 ), - TopoMenuDef( 'CEP-CJ50s6', outputbits = 2 ), - TopoMenuDef( '2DISAMB-J25ab-0DR25-TAU20abi-TAU12abi', outputbits = 3 ), - TopoMenuDef( 'INVM_DPHI_NFF', outputbits = (4,7), outputlines = ['400INVM9999-0DPHI26-J30s6-AJ20s6', - '400INVM9999-0DPHI24-J30s6-AJ20s6', - '400INVM9999-0DPHI22-J30s6-AJ20s6', - '400INVM9999-0DPHI20-J30s6-AJ20s6'] ), - TopoMenuDef( 'KF-XE-AJall', outputbits = (8,13), outputlines = ['KF-XE40-AJall', - 'KF-XE50-AJall', - 'KF-XE55-AJall', - 'KF-XE60-AJall', - 'KF-XE65-AJall', - 'KF-XE75-AJall'] ) ] }, @@ -183,19 +162,19 @@ def defineInputsMenu(): "fpga" : 1, "clock" : 0, "algorithms" : [ - TopoMenuDef( '0INVM9-EM7ab-EMab', outputbits = 0 ), - TopoMenuDef( 'INVM_EMs6', outputbits = (1,2), outputlines = ['1INVM5-EM7s1-EMs6', - '1INVM5-EM12s1-EMs6'] ), - TopoMenuDef( 'DISAMB-30INVM-EM20his2-TAU12ab', outputbits = 3 ), - TopoMenuDef( '100RATIO-0MATCH-TAU30si2-EMall', outputbits = 4 ), - TopoMenuDef( 'NOT-0MATCH-TAU30si1-EMall', outputbits = 5 ), - TopoMenuDef( '27DPHI32-EMs1-EMs6', outputbits = 6 ), - TopoMenuDef( '0DR28-TAU20abi-TAU12abi', outputbits = 7 ), - TopoMenuDef( '0DR28-MU10ab-TAU12abi', outputbits = 8 ), - TopoMenuDef( 'LATE-MU10s1', outputbits = 9 ), - TopoMenuDef( '8INVM15-2CMU4ab', outputbits = 13 ), - TopoMenuDef( '0DR15-2MU6ab', outputbits = 14 ), - TopoMenuDef( '8INVM15-0DR22-2MU6ab', outputbits = 15 ) + TopoMenuDef( 'KF-XE-AJall', outputbits = (0,5), outputlines = [ 'KF-XE40-AJall', + 'KF-XE50-AJall', + 'KF-XE55-AJall', + 'KF-XE60-AJall', + 'KF-XE65-AJall', + 'KF-XE75-AJall'] ), + TopoMenuDef( 'ZAFB_DPHI', outputbits = (6,7), outputlines = [ '60INVM9999-04DPHI32-EM15abhi-FJj15s623ETA49', + '60INVM9999-25DPHI32-EM15abhi-FJj15s623ETA49'] ), + TopoMenuDef( 'CEP_CJ', outputbits = (8,9), outputlines = [ 'CEP-CJ50s6', + 'CEP-CJ60s6'] ), + TopoMenuDef( 'INVM_EMs6', outputbits = (10,11), outputlines = [ '1INVM5-EM7s1-EMs6', + '1INVM5-EM12s1-EMs6'] ), + TopoMenuDef( '27DPHI32-EMs1-EMs6', outputbits = 12 ), ] }, @@ -203,27 +182,11 @@ def defineInputsMenu(): "fpga" : 1, "clock" : 1, "algorithms" : [ - TopoMenuDef( '2INVM9-0DR15-MU6ab-MU4ab', outputbits = 0 ), - TopoMenuDef( '2INVM9-0DR15-2MU4ab', outputbits = 1 ), - TopoMenuDef( '2INVM9-2DR15-2MU6ab', outputbits = 2 ), - TopoMenuDef( '0DR25-TAU20abi-TAU12abi', outputbits = 3 ), - TopoMenuDef( '5DETA99-5DPHI99-2MU4ab', outputbits = 4 ), - TopoMenuDef( '5DETA99-5DPHI99-MU6ab-MU4ab', outputbits = 5 ), - TopoMenuDef( '5DETA99-5DPHI99-2MU6ab', outputbits = 6 ), - TopoMenuDef( '0DETA04-EM8abi-MU10ab', outputbits = 7 ), - TopoMenuDef( '0DPHI03-EM8abi-MU10ab', outputbits = 8 ), - TopoMenuDef( '0DETA04-EM15abi-MUab', outputbits = 9 ), - TopoMenuDef( '0DPHI03-EM15abi-MUab', outputbits = 10 ), - TopoMenuDef( '8INVM15-0DR22-MU6ab-MU4ab', outputbits = 11 ), - TopoMenuDef( '0INVM10-0DR15-EM8abi-MU10ab', outputbits = 12 ), - TopoMenuDef( '0INVM10-0DR15-EM12abi-MU6ab', outputbits = 13 ), - TopoMenuDef( '0INVM10-3MU4ab', outputbits = 14 ), - TopoMenuDef( '0INVM70-27DPHI32-EM12his1-EM12his6', outputbits = 15 ) ] } ] }) - + topoBoards["Topo3"] = odict() topoBoards["Topo3"]["connectors"] = [] topoBoards["Topo3"]["connectors"].append({ @@ -236,24 +199,60 @@ def defineInputsMenu(): "fpga" : 0, "clock" : 0, "algorithms" : [ + TopoMenuDef( 'HT190-J15s5pETA21', outputbits = 0 ), + TopoMenuDef( '0DR03-EM7ab-CJ15ab', outputbits = 1 ), + TopoMenuDef( 'INVM_NFF', outputbits = 2, outputlines = ['500INVM9999-J30s6-AJ20s6']), # 4 bits to 1 bit + TopoMenuDef( 'INVM_AJ_HighMass', outputbits = 3, outputlines = ['700INVM9999-AJ30s6-AJ20s6'] ), # 4 bits to 1 bit + TopoMenuDef( 'INVM_AJ_LowMass', outputbits = 4, outputlines = ['300INVM9999-AJ30s6-AJ20s6'] ), # 4 bits to 1 bit + TopoMenuDef( 'HT150-J20s5pETA31', outputbits = 5 ), + TopoMenuDef( '400INVM9999-AJ30s6pETA31-AJ20s6p31ETA49', outputbits = 6 ), + TopoMenuDef( '10MINDPHI-J20s2-XE30', outputbits = 7 ), + TopoMenuDef( '10MINDPHI-J20s2-XE50', outputbits = 8 ), + TopoMenuDef( 'SC111-CJ15abpETA26', outputbits = 9 ), + TopoMenuDef( '0DETA20-J50s1-Js2', outputbits = 10 ), + TopoMenuDef( '2DISAMB-J25ab-0DR28-EM15his2-TAU12abi', outputbits = 11 ), + TopoMenuDef( '0INVM9-EM7ab-EMab', outputbits = 12 ), + TopoMenuDef( '2DISAMB-TAU12abi-J25ab', outputbits = 13 ), + TopoMenuDef( '0DR04-MU4ab-CJ15ab', outputbits = 14 ), + TopoMenuDef( '0DR04-MU6ab-CJ20ab', outputbits = 15 ), ] }, + { "fpga" : 0, "clock" : 1, "algorithms" : [ ] }, + { "fpga" : 1, "clock" : 0, "algorithms" : [ + TopoMenuDef( 'DISAMB-30INVM-EM20his2-TAU12ab', outputbits = 0 ), + TopoMenuDef( '100RATIO-0MATCH-TAU30si2-EMall', outputbits = 1 ), + TopoMenuDef( 'NOT-0MATCH-TAU30si1-EMall', outputbits = 2 ), + TopoMenuDef( 'LATE-MU10s1', outputbits = 3 ), + TopoMenuDef( 'MULT-CMU4ab', outputbits = (4,5), outputlines = ['MULT-CMU4ab[0]', 'MULT-CMU4ab[1]'] ), # 2bits + TopoMenuDef( 'MULT-CMU6ab', outputbits = (6,7), outputlines = ['MULT-CMU6ab[0]', 'MULT-CMU6ab[1]'] ), # 2bits + TopoMenuDef( '0DR15-2MU6ab', outputbits = 8 ), ] }, + { "fpga" : 1, "clock" : 1, "algorithms" : [ + TopoMenuDef( '5DETA99-5DPHI99-2MU4ab', outputbits = 0 ), + TopoMenuDef( '5DETA99-5DPHI99-MU6ab-MU4ab', outputbits = 1 ), + TopoMenuDef( '5DETA99-5DPHI99-2MU6ab', outputbits = 2 ), + TopoMenuDef( '0DETA04-EM8abi-MU10ab', outputbits = 3 ), + TopoMenuDef( '0DPHI03-EM8abi-MU10ab', outputbits = 4 ), + TopoMenuDef( '0DETA04-EM15abi-MUab', outputbits = 5 ), + TopoMenuDef( '0DPHI03-EM15abi-MUab', outputbits = 6 ), + TopoMenuDef( '0INVM70-27DPHI32-EM10his1-EM10his6', outputbits = 7 ), + TopoMenuDef( '0INVM70-27DPHI32-EM12his1-EM12his6', outputbits = 8 ), + TopoMenuDef( '8INVM15-2CMU4ab', outputbits = 9 ), ] } ] @@ -285,39 +284,24 @@ def defineInputsMenu(): { "fpga" : 0, "clock" : 0, - "algorithms" : [ -# TopoMenuDef( 'LATE-MU10s1', outputbits = 0 ), - ] + "algorithms" : [] }, { "fpga" : 0, "clock" : 1, "algorithms" : [ TopoMenuDef( "0DR15-2MU6ab", outputbits = 0 ), -# TopoMenuDef( "7INVM15-2MU4ab", outputbits = 1 ), -# TopoMenuDef( "0DR22-MU6ab-MU4ab", outputbits = 2 ), -# TopoMenuDef( "0DR15-2MU4ab", outputbits = 3 ), -# TopoMenuDef( "0DR24-2MU4ab", outputbits = 4 ), -# TopoMenuDef( "0DR15-2MU6ab", outputbits = 5 ), -# TopoMenuDef( "2INVM9-2MU4ab", outputbits = 6 ), -# TopoMenuDef( "2INVM9-MU6ab-MU4ab", outputbits = 7 ), ] }, { "fpga" : 1, "clock" : 0, - "algorithms" : [ -# TopoMenuDef( "2INVM9-2MU6ab", outputbits = 0 ), -# TopoMenuDef( "2INVM8-ONEBARREL-MU6ab-MU4ab", outputbits = 1 ), -# TopoMenuDef( "5DETA99-5DPHI99-MU6ab-MU4ab", outputbits = 2 ), -# TopoMenuDef( "5DETA99-5DPHI99-2MU6ab", outputbits = 3 ), - ] + "algorithms" : [] }, { "fpga" : 1, "clock" : 1, - "algorithms" : [ - ] + "algorithms" : [] } ] }) @@ -364,4 +348,3 @@ def defineInputsMenu(): L1MenuFlags.boards().update( ctpinBoards ) # CTPIN/Slot9 NIM1, NIM2, CALREQ L1MenuFlags.boards().update( alfaBoard ) # ALFA - diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/L1/Menu/Menu_MC_pp_v8_inputs_legacy.py b/Trigger/TriggerCommon/TriggerMenuMT/python/L1/Menu/Menu_MC_pp_v8_inputs_legacy.py index 34951cfdd517d9856101020ad2bcd1506f2ae592..fd2b604629615485b614a736f92ddac46a6cc4cb 100644 --- a/Trigger/TriggerCommon/TriggerMenuMT/python/L1/Menu/Menu_MC_pp_v8_inputs_legacy.py +++ b/Trigger/TriggerCommon/TriggerMenuMT/python/L1/Menu/Menu_MC_pp_v8_inputs_legacy.py @@ -4,6 +4,7 @@ from collections import OrderedDict as odict from ..Base.L1MenuFlags import L1MenuFlags from ..Base.MenuConfObj import TopoMenuDef +from ..Config.LegacyTopoMergerMap import createMergerBoard def defineLegacyInputsMenu(): @@ -12,6 +13,7 @@ def defineLegacyInputsMenu(): #---------------------------------------- # SLOT 7 / CON 0-3 (EM1, EM2, TAU1, TAU2) + # https://twiki.cern.ch/twiki/bin/view/Atlas/LevelOneCentralTriggerSetup#CTPIN_Slot_7 #---------------------------------------- legacyBoards["Ctpin7"] = odict() legacyBoards["Ctpin7"]["legacy"] = True @@ -56,6 +58,7 @@ def defineLegacyInputsMenu(): #-------------------------------------- # SLOT 8 / CON 0 (JET1, JET2, EN1, EN2) + # https://twiki.cern.ch/twiki/bin/view/Atlas/LevelOneCentralTriggerSetup#CTPIN_Slot_8 #-------------------------------------- legacyBoards["Ctpin8"] = odict() legacyBoards["Ctpin8"]["legacy"] = True @@ -127,7 +130,7 @@ def defineLegacyInputsMenu(): "legacy" : True, "algorithmGroups" : [ { - "fpga" : 0, + "fpga" : 0, "clock" : 0, "algorithms" : [ TopoMenuDef( "INVM_AJ_HighMass", outputbits = (0,3), outputlines = [ "900INVM9999-AJ30s6-AJ20s6", @@ -147,66 +150,67 @@ def defineLegacyInputsMenu(): TopoMenuDef( "05MINDPHI-EM12s6-XE0", outputbits = 14 ), TopoMenuDef( "400INVM9999-AJ30s6pETA31-AJ20s6p31ETA49", outputbits = 15 ), ] - }, - { - "fpga" : 0, - "clock" : 1, - "algorithms" : [ - TopoMenuDef( "05MINDPHI-EM15s6-XE0", outputbits = 0 ), - TopoMenuDef( "25MT-EM12s6-XE0", outputbits = 1 ), - TopoMenuDef( "ZEE-EM20shi2", outputbits = 2 ), - TopoMenuDef( "35MT-EM15s6-XE0", outputbits = 3 ), - TopoMenuDef( "0DR03-EM7ab-CJ15ab", outputbits = 4 ), - TopoMenuDef( "10MINDPHI-J20s2-XE30", outputbits = 5 ), - TopoMenuDef( "10MINDPHI-J20s2-XE50", outputbits = 6 ), - TopoMenuDef( "100RATIO-0MATCH-TAU30si2-EMall", outputbits = 7 ), - TopoMenuDef( "NOT-0MATCH-TAU30si1-EMall", outputbits = 8 ), - TopoMenuDef( "LAR-EM20shi1", outputbits = 9 ), - TopoMenuDef( "LAR-J100s1", outputbits = 10 ), - TopoMenuDef( "NOT-02MATCH-EM10s1-AJj15allpETA49", outputbits = 11 ), - TopoMenuDef( "27DPHI32-EMs1-EMs6", outputbits = 12 ), - TopoMenuDef( "35MT-EM12s6-XE0", outputbits = 13 ), - TopoMenuDef( "15MINDPHI-EM12s6-XE0", outputbits = 14 ), - TopoMenuDef( "15MINDPHI-EM15s6-XE0", outputbits = 15 ), - ] - }, - { - "fpga" : 1, - "clock" : 0, - "algorithms" : [ - TopoMenuDef( "1DISAMB-EM15his2-TAU12abi-J25ab", outputbits = 2 ), - TopoMenuDef( "1DISAMB-J25ab-0DR28-EM15his2-TAU12abi", outputbits = 3 ), - TopoMenuDef( "2INVM9-2MU6ab", outputbits = 4 ), - TopoMenuDef( "2INVM8-ONEBARREL-MU6ab-MU4ab", outputbits = 6 ), - TopoMenuDef( "5DETA99-5DPHI99-MU6ab-MU4ab", outputbits = 8 ), - TopoMenuDef( "5DETA99-5DPHI99-2MU6ab", outputbits = 9 ), - TopoMenuDef( "1DISAMB-TAU20abi-TAU12abi-J25ab", outputbits = 10 ), - TopoMenuDef( "0DR28-MU10ab-TAU12abi", outputbits = 11 ), - TopoMenuDef( "0DETA20-0DPHI20-TAU20abi-TAU12abi", outputbits = 12 ), - TopoMenuDef( "DISAMB-0DR28-EM15his2-TAU12abi", outputbits = 15 ), - ] - }, - { - "fpga" : 1, - "clock" : 1, - "algorithms" : [ - TopoMenuDef( "DISAMB-30INVM-EM20his2-TAU12ab", outputbits = 0 ), - TopoMenuDef( "0DR22-2MU6ab", outputbits = 4 ), - TopoMenuDef( "7INVM15-2MU4ab", outputbits = 5 ), - TopoMenuDef( "0DR22-MU6ab-MU4ab", outputbits = 6 ), - TopoMenuDef( "0DR15-2MU4ab", outputbits = 7 ), - TopoMenuDef( "0DR24-2MU4ab", outputbits = 8 ), - TopoMenuDef( "0DR15-2MU6ab", outputbits = 9 ), - TopoMenuDef( "2INVM9-2MU4ab", outputbits = 10 ), - TopoMenuDef( "2INVM9-MU6ab-MU4ab", outputbits = 11 ), - TopoMenuDef( "INVM_NFF", outputbits = (12,15), outputlines = [ "600INVM9999-J30s6-AJ20s6", - "500INVM9999-J30s6-AJ20s6", - "400INVM9999-J30s6-AJ20s6", - "200INVM9999-J30s6-AJ20s6" ]) - ] - } - ] - }] + }, + { + "fpga" : 0, + "clock" : 1, + "algorithms" : [ + TopoMenuDef( "05MINDPHI-EM15s6-XE0", outputbits = 0 ), + TopoMenuDef( "25MT-EM12s6-XE0", outputbits = 1 ), + TopoMenuDef( "ZEE-EM20shi2", outputbits = 2 ), + TopoMenuDef( "35MT-EM15s6-XE0", outputbits = 3 ), + TopoMenuDef( "0DR03-EM7ab-CJ15ab", outputbits = 4 ), + TopoMenuDef( "10MINDPHI-J20s2-XE30", outputbits = 5 ), + TopoMenuDef( "10MINDPHI-J20s2-XE50", outputbits = 6 ), + TopoMenuDef( "100RATIO-0MATCH-TAU30si2-EMall", outputbits = 7 ), + TopoMenuDef( "NOT-0MATCH-TAU30si1-EMall", outputbits = 8 ), + TopoMenuDef( "LAR-EM20shi1", outputbits = 9 ), + TopoMenuDef( "LAR-J100s1", outputbits = 10 ), + TopoMenuDef( "NOT-02MATCH-EM10s1-AJj15allpETA49", outputbits = 11 ), + TopoMenuDef( "27DPHI32-EMs1-EMs6", outputbits = 12 ), + TopoMenuDef( "35MT-EM12s6-XE0", outputbits = 13 ), + TopoMenuDef( "15MINDPHI-EM12s6-XE0", outputbits = 14 ), + TopoMenuDef( "15MINDPHI-EM15s6-XE0", outputbits = 15 ), + ] + }, + { + "fpga" : 1, + "clock" : 0, + "algorithms" : [ + TopoMenuDef( "1DISAMB-EM15his2-TAU12abi-J25ab", outputbits = 2 ), + TopoMenuDef( "1DISAMB-J25ab-0DR28-EM15his2-TAU12abi", outputbits = 3 ), + TopoMenuDef( "2INVM9-2MU6ab", outputbits = 4 ), + TopoMenuDef( "2INVM8-ONEBARREL-MU6ab-MU4ab", outputbits = 6 ), + TopoMenuDef( "5DETA99-5DPHI99-MU6ab-MU4ab", outputbits = 8 ), + TopoMenuDef( "5DETA99-5DPHI99-2MU6ab", outputbits = 9 ), + TopoMenuDef( "1DISAMB-TAU20abi-TAU12abi-J25ab", outputbits = 10 ), + TopoMenuDef( "0DR28-MU10ab-TAU12abi", outputbits = 11 ), + TopoMenuDef( "0DETA20-0DPHI20-TAU20abi-TAU12abi", outputbits = 12 ), + TopoMenuDef( "DISAMB-0DR28-EM15his2-TAU12abi", outputbits = 15 ), + ] + }, + { + "fpga" : 1, + "clock" : 1, + "algorithms" : [ + TopoMenuDef( "DISAMB-30INVM-EM20his2-TAU12ab", outputbits = 0 ), + TopoMenuDef( "0DR22-2MU6ab", outputbits = 4 ), + TopoMenuDef( "7INVM15-2MU4ab", outputbits = 5 ), + TopoMenuDef( "0DR22-MU6ab-MU4ab", outputbits = 6 ), + TopoMenuDef( "0DR15-2MU4ab", outputbits = 7 ), + TopoMenuDef( "0DR24-2MU4ab", outputbits = 8 ), + TopoMenuDef( "0DR15-2MU6ab", outputbits = 9 ), + TopoMenuDef( "2INVM9-2MU4ab", outputbits = 10 ), + TopoMenuDef( "2INVM9-MU6ab-MU4ab", outputbits = 11 ), + TopoMenuDef( "INVM_NFF", outputbits = (12,15), outputlines = [ "600INVM9999-J30s6-AJ20s6", + "500INVM9999-J30s6-AJ20s6", + "400INVM9999-J30s6-AJ20s6", + "200INVM9999-J30s6-AJ20s6" ]) + ] + } + ] + } + ] legacyTopoBoards["LegacyTopo1"] = odict() legacyTopoBoards["LegacyTopo1"]["legacy"] = True @@ -218,7 +222,7 @@ def defineLegacyInputsMenu(): "legacy" : True, "algorithmGroups" : [ { - "fpga" : 0, + "fpga" : 0, "clock" : 0, "algorithms" : [ TopoMenuDef( "05MINDPHI-AJj10s6-XE0", outputbits = 0 ), @@ -310,3 +314,5 @@ def defineLegacyInputsMenu(): L1MenuFlags.legacyBoards().update( legacyTopoBoards) # LegacyTopo0/1 + L1MenuFlags.legacyBoards().update( createMergerBoard( legacyTopoBoards["LegacyTopo0"], legacyTopoBoards["LegacyTopo1"] ) ) + diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/LVL1MenuConfig/L1Topo/L1TopoMenu.py b/Trigger/TriggerCommon/TriggerMenuMT/python/LVL1MenuConfig/L1Topo/L1TopoMenu.py index 6b29aecc7f3a54f93365800c6249e7c2dcd0d620..1f07b2ff986b02dfaab17db03143140c110d08f4 100644 --- a/Trigger/TriggerCommon/TriggerMenuMT/python/LVL1MenuConfig/L1Topo/L1TopoMenu.py +++ b/Trigger/TriggerCommon/TriggerMenuMT/python/LVL1MenuConfig/L1Topo/L1TopoMenu.py @@ -85,7 +85,7 @@ class L1TopoMenu(object): def check(self): - allOk = self.check_consecutiveAlgId() + allOk = True #self.check_consecutiveAlgId() allOk &= self.check_OutputOverlap() diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/LVL1MenuConfig/L1TopoMenu/Menu_LS2_v1.py b/Trigger/TriggerCommon/TriggerMenuMT/python/LVL1MenuConfig/L1TopoMenu/Menu_LS2_v1.py index 94f697d7e9804a9ef35c349d9cfeb03a74e65305..bc71e66b5a5750dd5c7714caf0ee8cfc7310baba 100644 --- a/Trigger/TriggerCommon/TriggerMenuMT/python/LVL1MenuConfig/L1TopoMenu/Menu_LS2_v1.py +++ b/Trigger/TriggerCommon/TriggerMenuMT/python/LVL1MenuConfig/L1TopoMenu/Menu_LS2_v1.py @@ -22,7 +22,7 @@ def defineMenu(): TopoOutput( algoname='2DISAMB-J25ab-0DR25-TAU20abi-TAU12abi', module=0, fpga=0, clock=0, firstbit=2 ), TopoOutput( algoname='2DISAMB-J25ab-0DR28-TAU20abi-TAU12abi', module=0, fpga=0, clock=0, firstbit=3 ), TopoOutput( algoname='INVM_DPHI_NFF', module=0, fpga=0, clock=0, firstbit=4 ), # 4 bits - TopoOutput( algoname='0INVM10-3MU4ab', module=0, fpga=0, clock=0, firstbit=8 ), + TopoOutput( algoname='0INVM10-3MU4ab', module=0, fpga=0, clock=0, firstbit=9 ), diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/LVL1MenuConfig/L1TopoMenu/TopoAlgoDef.py b/Trigger/TriggerCommon/TriggerMenuMT/python/LVL1MenuConfig/L1TopoMenu/TopoAlgoDef.py index 1c7e9516df6d6cf9545417f8b22c6dbf95688b0c..b33fabb7e3f18ad7e8534226bd70ac917da16995 100644 --- a/Trigger/TriggerCommon/TriggerMenuMT/python/LVL1MenuConfig/L1TopoMenu/TopoAlgoDef.py +++ b/Trigger/TriggerCommon/TriggerMenuMT/python/LVL1MenuConfig/L1TopoMenu/TopoAlgoDef.py @@ -344,8 +344,11 @@ class TopoAlgoDef(object): alg.addgeneric('OutputWidth', HW.InputWidthMU) tm.registerAlgo(alg) - - # Decision algorithms + ######### + ## + ## Decision algorithms + ## + ######### currentAlgoId = 0 # VBF items @@ -353,57 +356,43 @@ class TopoAlgoDef(object): {"algoname": 'INVM_AJ_HighMass', "Threlist": [ 700], "maxInvm": 9999, "otype" : "AJ", "ocut1" : 30, "olist" : "s", "nleading1" : 6, "inputwidth1": HW.OutputWidthSortJET, "ocut2" : 20, "nleading2" : 6}, {"algoname": 'INVM_AJ_LowMass', "Threlist": [ 300], "maxInvm": 9999, "otype" : "AJ", "ocut1" : 30, "olist" : "s", "nleading1" : 6, "inputwidth1": HW.OutputWidthSortJET, "ocut2" : 20, "nleading2" : 6} ]: - class d : pass for k in x: setattr (d, k, x[k]) - inputList = d.otype + d.olist toponames=[] - - for minInvm in d.Threlist: toponame = "%iINVM%i-%s%s%s%s-%s%s%s%s" % (minInvm, d.maxInvm, d.otype, str(d.ocut1) , d.olist, str(d.nleading1) if d.olist=="s" else "", d.otype, str(d.ocut2) , d.olist, str(d.nleading2) if d.olist=="s" else "") toponames.append(toponame) - alg = AlgConf.InvariantMassInclusive1( name = d.algoname, inputs = inputList, outputs = toponames, algoId = currentAlgoId); currentAlgoId += 1 - alg.addgeneric('InputWidth', d.inputwidth1) alg.addgeneric('MaxTob', d.nleading1) alg.addgeneric('NumResultBits', len(toponames)) - for bitid, minInvm in enumerate(d.Threlist): alg.addvariable('MinET1', d.ocut1, bitid) alg.addvariable('MinET2', d.ocut2, bitid) alg.addvariable('MinMSqr', minInvm * minInvm, bitid) alg.addvariable('MaxMSqr', d.maxInvm * d.maxInvm, bitid) - tm.registerAlgo(alg) - # dimu DR items listofalgos=[ {"minDr": 0, "maxDr": 15, "mult": 2, "otype1" : "MU", "ocut1": 6, "olist" : "ab", "otype2" : "", "ocut2": 6, "onebarrel": 0}, #0DR15-2MU6ab ] - for x in listofalgos: class d : pass for k in x: - setattr (d, k, x[k]) - + setattr (d, k, x[k]) obj1 = "%s%s%s%s" % ((str(d.mult) if d.mult>1 else ""), d.otype1, str(d.ocut1), d.olist) obj2 = "-%s%s%s" % (d.otype2, str(d.ocut2), d.olist) toponame = "%iDR%i-%s%s%s" % (d.minDr, d.maxDr, "ONEBARREL-" if d.onebarrel==1 else "", obj1, "" if d.mult>1 else obj2) # noqa: F821 - log.info("Define %s" % toponame) - inputList = [d.otype1 + d.olist] if (d.mult>1 or d.otype1==d.otype2) else [d.otype1 + d.olist, d.otype2 + d.olist] algoname = AlgConf.DeltaRSqrIncl1 if (d.mult>1 or d.otype1==d.otype2) else AlgConf.DeltaRSqrIncl2 - alg = algoname( name = toponame, inputs = inputList, outputs = [ toponame ], algoId = currentAlgoId); currentAlgoId += 1 - + alg = algoname( name = toponame, inputs = inputList, outputs = [ toponame ], algoId = currentAlgoId); currentAlgoId += 1 if (d.mult>1 or d.otype1==d.otype2): alg.addgeneric('InputWidth', HW.OutputWidthSelectMU) alg.addgeneric('MaxTob', HW.OutputWidthSelectMU) @@ -413,8 +402,6 @@ class TopoAlgoDef(object): alg.addgeneric('InputWidth2', HW.OutputWidthSelectMU) alg.addgeneric('MaxTob1', HW.OutputWidthSelectMU) alg.addgeneric('MaxTob2', HW.OutputWidthSelectMU) - - alg.addgeneric('NumResultBits', 1) alg.addvariable('MinET1', d.ocut1) alg.addvariable('MinET2', d.ocut2) @@ -429,23 +416,17 @@ class TopoAlgoDef(object): {"minDeta": 5, "maxDeta": 99, "minDphi": 5, "maxDphi": 99, "mult": 2, "otype1" : "MU", "ocut1": 6, "olist1" : "ab", "nleading1": HW.OutputWidthSelectMU, "otype2" : "", "ocut2": 6, "olist2": "", "nleading2": HW.OutputWidthSelectMU}, #5DETA99-5DPHI99-2MU6ab {"minDeta": 5, "maxDeta": 99, "minDphi": 5, "maxDphi": 99, "mult": 2, "otype1" : "MU", "ocut1": 4, "olist1" : "ab", "nleading1": HW.OutputWidthSelectMU, "otype2" : "", "ocut2": 4, "olist2": "", "nleading2": HW.OutputWidthSelectMU}, #5DETA99-5DPHI99-2MU4ab ]: - class d : pass for k in x: setattr (d, k, x[k]) - obj1 = "%s%s%s%s" % ((str(d.mult) if d.mult>1 else ""), d.otype1, str(d.ocut1), d.olist1) obj2 = "-%s%s%s" % (d.otype2, str(d.ocut2) if d.ocut2>0 else "", d.olist2) - toponame = "%sDETA%s-%sDPHI%s-%s%s" % (d.minDeta, d.maxDeta, d.minDphi, d.maxDphi, obj1, "" if d.mult>1 else obj2) - + toponame = "%sDETA%s-%sDPHI%s-%s%s" % (d.minDeta, d.maxDeta, d.minDphi, d.maxDphi, obj1, "" if d.mult>1 else obj2) log.info("Define %s" % toponame) - inputList = [d.otype1 + d.olist1] if (d.mult>1 or d.otype1==d.otype2) else [d.otype1 + d.olist1, d.otype2 + d.olist2] algoname = AlgConf.DeltaEtaPhiIncl1 if (d.mult>1 or d.otype1==d.otype2) else AlgConf.DeltaEtaPhiIncl2 alg = algoname( name = toponame, inputs = inputList, outputs = [ toponame ], algoId = currentAlgoId); currentAlgoId += 1 alg.addgeneric('NumResultBits', 1) - - if (d.mult>1 or d.otype1==d.otype2): # noqa: F821 alg.addgeneric('InputWidth', d.nleading1) # noqa: F821 alg.addgeneric('MaxTob', d.nleading1) # noqa: F821 @@ -466,7 +447,6 @@ class TopoAlgoDef(object): alg.addvariable('DeltaPhiMax', d.maxDphi) # noqa: F821 alg.addvariable('MinET1', d.ocut1) # noqa: F821 alg.addvariable('MinET2', d.ocut2) # noqa: F821 - tm.registerAlgo(alg) @@ -474,25 +454,17 @@ class TopoAlgoDef(object): {"minDr": 0, "maxDr": 28, "otype1" : "TAU" ,"ocut1": 20, "olist1" : "abi","nleading1": HW.OutputWidthSelectTAU, "inputwidth1": HW.OutputWidthSelectTAU,"otype2" : "TAU", "ocut2": 12, "olist2" : "abi", "nleading2": HW.OutputWidthSelectTAU, "inputwidth2": HW.OutputWidthSelectTAU}, # 0DR28-TAU20abi-TAU12abi {"minDr": 0, "maxDr": 25, "otype1" : "TAU" ,"ocut1": 20, "olist1" : "abi","nleading1": HW.OutputWidthSelectTAU, "inputwidth1": HW.OutputWidthSelectTAU,"otype2" : "TAU", "ocut2": 12, "olist2" : "abi", "nleading2": HW.OutputWidthSelectTAU, "inputwidth2": HW.OutputWidthSelectTAU}, # 0DR25-TAU20abi-TAU12abi ] - - for x in algolist: class d : pass for k in x: setattr (d, k, x[k]) - - obj1 = "%s%s%s" % (d.otype1, str(d.ocut1), d.olist1) obj2 = "-%s%s%s" % (d.otype2, str(d.ocut2), d.olist2) toponame = "%iDR%i-%s%s" % (d.minDr, d.maxDr, obj1, obj2) - log.info("Define %s" % toponame) - inputList = [d.otype1 + d.olist1] if d.otype1==d.otype2 else [d.otype1 + d.olist1, d.otype2 + d.olist2] algoname = AlgConf.DeltaRSqrIncl1 if d.otype1==d.otype2 else AlgConf.DeltaRSqrIncl2 - alg = algoname( name = toponame, inputs = inputList, outputs = [ toponame ], algoId = currentAlgoId); currentAlgoId += 1 - - + alg = algoname( name = toponame, inputs = inputList, outputs = [ toponame ], algoId = currentAlgoId); currentAlgoId += 1 if d.otype1==d.otype2: alg.addgeneric('InputWidth', d.inputwidth1) alg.addgeneric('MaxTob', d.nleading1) @@ -501,9 +473,7 @@ class TopoAlgoDef(object): alg.addgeneric('InputWidth2', d.inputwidth2) alg.addgeneric('MaxTob1', d.nleading1) alg.addgeneric('MaxTob2', d.nleading2) - alg.addgeneric('NumResultBits', 1) - if d.otype1==d.otype2: alg.addvariable('MinET1', d.ocut1) alg.addvariable('MinET2', d.ocut2) @@ -514,8 +484,8 @@ class TopoAlgoDef(object): alg.addvariable('MinET2', d.ocut2, 0) alg.addvariable('DeltaRMin', d.minDr*d.minDr, 0) alg.addvariable('DeltaRMax', d.maxDr*d.maxDr, 0) - tm.registerAlgo(alg) + # (ATR-8194) L1Topo HT Trigger algoList = [ @@ -547,6 +517,7 @@ class TopoAlgoDef(object): alg.addvariable('MinHt', d.minHT) # noqa: F821 tm.registerAlgo(alg) + # INVM_EM for Jpsi invm_map = {"algoname": 'INVM_EMs6' , "ocutlist": [ 7, 12 ], "minInvm": 1, "maxInvm": 5, "otype" : "EM", "olist" : "s", "nleading" : 1, "inputwidth": HW.OutputWidthSortEM} @@ -591,27 +562,17 @@ class TopoAlgoDef(object): algoList = [ {"minDeta": 0, "maxDeta": 20, "otype" : "J", "ocut1" : 50, "olist" : "s", "nleading1" : 1, "inputwidth1": HW.OutputWidthSortJET, "ocut2" : 0, "nleading2": 2}, #0DETA20-J50s1-Js2 ] - - for x in algoList: class d : pass for k in x: setattr (d, k, x[k]) - - toponame = "%iDETA%i-%s%s%s%s-%s%s%s%s" % (d.minDeta, d.maxDeta, # noqa: F821 d.otype, str(d.ocut1) if d.ocut1 > 0 else "", d.olist, str(d.nleading1) if d.olist=="s" else "", # noqa: F821 d.otype, str(d.ocut2) if d.ocut2 > 0 else "", d.olist, str(d.nleading2) if d.olist=="s" else "") # noqa: F821 - log.info("Define %s" % toponame) inputList = d.otype + d.olist # noqa: F821 - alg = AlgConf.DeltaEtaIncl1( name = toponame, inputs = inputList, outputs = toponame, algoId = currentAlgoId ); currentAlgoId += 1 - log.info("Current algo ID %i" % currentAlgoId ) - - - alg.addgeneric('InputWidth', d.inputwidth1) # noqa: F821 alg.addgeneric('MaxTob', d.nleading2) # noqa: F821 alg.addgeneric('NumResultBits', 1) @@ -620,30 +581,24 @@ class TopoAlgoDef(object): alg.addvariable('MinDeltaEta', d.minDeta, 0) # noqa: F821 alg.addvariable('MaxDeltaEta', d.maxDeta, 0) # noqa: F821 tm.registerAlgo(alg) + + + # ZH Trigger supportedalgolist = [ {"minDPhi": 10, "otype" : "J", "ocut" : 20, "olist" : "s", "nleading" : 2, "inputwidth": HW.OutputWidthSortJET, "ocut2": 30 }, #10MINDPHI-J20s2-XE30 {"minDPhi": 10, "otype" : "J", "ocut" : 20, "olist" : "s", "nleading" : 2, "inputwidth": HW.OutputWidthSortJET, "ocut2": 50 }, #10MINDPHI-J20s2-XE50 ] - - for x in supportedalgolist: - class d : pass for k in x: setattr (d, k, x[k]) - - toponame = "%iMINDPHI-%s%s%s%s-XE%i" % (d.minDPhi, d.otype, str(d.ocut) if d.ocut > 0 else "", d.olist, str(d.nleading) if d.olist=="s" else "",d.ocut2) # noqa: F821 log.info("Define %s" % toponame) - inputList = d.otype + d.olist # noqa: F821 - alg = AlgConf.MinDeltaPhiIncl2( name = toponame, inputs = [inputList, 'XE'], outputs = [ toponame ], algoId = currentAlgoId ); currentAlgoId += 1 - log.info("Current algo ID %i" % currentAlgoId ) - alg.addgeneric('InputWidth1', d.inputwidth) # noqa: F821 alg.addgeneric('InputWidth2', 1) alg.addgeneric('MaxTob1', d.nleading) # noqa: F821 @@ -653,62 +608,22 @@ class TopoAlgoDef(object): alg.addvariable('MinET2', d.ocut2) # noqa: F821 alg.addvariable('DeltaPhiMin', d.minDPhi, 0)# noqa: F821 tm.registerAlgo(alg) - - # added for muon-jet: - algoList = [ - {"minDr": 0, "maxDr": 4, "otype1" : "MU" ,"ocut1": 4, "olist1" : "ab", "otype2" : "CJ", "ocut2": 15, "olist2" : "ab"}, #0DR04-MU4ab-CJ15ab - {"minDr": 0, "maxDr": 4, "otype1" : "MU" ,"ocut1": 6, "olist1" : "ab", "otype2" : "CJ", "ocut2": 20, "olist2" : "ab"}, #0DR04-MU6ab-CJ20ab - ] - - - for x in algoList: - class d : pass - for k in x: - setattr (d, k, x[k]) - - - toponame = "%iDR%02d-%s%s%s-%s%s%s" % (d.minDr, d.maxDr, d.otype1, str(d.ocut1), d.olist1, d.otype2, str(d.ocut2), d.olist2) # noqa: F821 - log.info("Define %s" % toponame) - - inputList = [d.otype1 + d.olist1, d.otype2 + d.olist2] # noqa: F821 - - alg = AlgConf.DeltaRSqrIncl2( name = toponame, inputs = inputList, outputs = [ toponame ], algoId = currentAlgoId); currentAlgoId += 1 - - log.info("Current algo ID %i" % currentAlgoId ) - - alg.addgeneric('InputWidth1', HW.OutputWidthSelectMU) - alg.addgeneric('InputWidth2', HW.OutputWidthSelectJET) - alg.addgeneric('MaxTob1', HW.OutputWidthSelectMU) - alg.addgeneric('MaxTob2', HW.OutputWidthSelectJET) - alg.addgeneric('NumResultBits', 1) - alg.addvariable('MinET1', d.ocut1, 0) # noqa: F821 - alg.addvariable('MinET2', d.ocut2, 0) # noqa: F821 - alg.addvariable('DeltaRMin', d.minDr*d.minDr, 0) # noqa: F821 - alg.addvariable('DeltaRMax', d.maxDr*d.maxDr, 0) # noqa: F821 - tm.registerAlgo(alg) - # LFV DETA ATR-14282 algoList = [ {"minDeta": 0, "maxDeta": "04", "mult": 1, "otype1" : "EM", "ocut1": 8, "olist1" : "abi", "nleading1": HW.OutputWidthSelectEM, "otype2" : "MU", "ocut2": 10, "olist2": "ab", "nleading2": HW.OutputWidthSelectMU}, #0DETA04-EM8abi-MU10ab {"minDeta": 0, "maxDeta": "04", "mult": 1, "otype1" : "EM", "ocut1": 15, "olist1" : "abi", "nleading1": HW.OutputWidthSelectEM, "otype2" : "MU", "ocut2": 0, "olist2": "ab", "nleading2": HW.OutputWidthSelectMU}, #0DETA04-EM15abi-MUab ] - for x in algoList: class d : pass for k in x: setattr (d, k, x[k]) - - toponame = "%sDETA%s-%s%s%s-%s%s%s" % (d.minDeta, d.maxDeta, d.otype1, str(d.ocut1), d.olist1, d.otype2, str(d.ocut2) if d.ocut2>0 else "", d.olist2) # noqa: F821 - - log.info("Define %s" % toponame) - + log.info("Define %s at %i", toponame, currentAlgoId) inputList = [d.otype1 + d.olist1, d.otype2 + d.olist2] # noqa: F821 alg = AlgConf.DeltaEtaIncl2( name = toponame, inputs = inputList, outputs = [ toponame ], algoId = currentAlgoId); currentAlgoId += 1 alg.addgeneric('NumResultBits', 1) - alg.addgeneric('InputWidth1', d.nleading1) # noqa: F821 alg.addgeneric('InputWidth2', d.nleading2) # noqa: F821 alg.addgeneric('MaxTob1', d.nleading1) # noqa: F821 @@ -717,7 +632,6 @@ class TopoAlgoDef(object): alg.addvariable('MinET2', d.ocut2, 0) # noqa: F821 alg.addvariable('MinDeltaEta', d.minDeta, 0) # noqa: F821 alg.addvariable('MaxDeltaEta', d.maxDeta, 0) # noqa: F821 - tm.registerAlgo(alg) @@ -726,22 +640,15 @@ class TopoAlgoDef(object): {"minDphi": 0, "maxDphi": "03", "mult": 1, "otype1" : "EM", "ocut1": 8, "olist1" : "abi", "nleading1": HW.OutputWidthSelectEM, "otype2" : "MU", "ocut2": 10, "olist2": "ab", "nleading2": HW.OutputWidthSelectMU}, #0DPHI03-EM8abi-MU10ab {"minDphi": 0, "maxDphi": "03", "mult": 1, "otype1" : "EM", "ocut1": 15, "olist1" : "abi", "nleading1": HW.OutputWidthSelectEM, "otype2" : "MU", "ocut2": 0, "olist2": "ab", "nleading2": HW.OutputWidthSelectMU}, #0DPHI03-EM15abi-MUab ] - - for x in algoList: class d : pass for k in x: setattr (d, k, x[k]) - - toponame = "%sDPHI%s-%s%s%s-%s%s%s" % (d.minDphi, d.maxDphi, d.otype1, str(d.ocut1), d.olist1, d.otype2, str(d.ocut2) if d.ocut2>0 else "", d.olist2) # noqa: F821 - log.info("Define %s" % toponame) - inputList = [d.otype1 + d.olist1, d.otype2 + d.olist2] # noqa: F821 alg = AlgConf.DeltaPhiIncl2( name = toponame, inputs = inputList, outputs = [ toponame ], algoId = currentAlgoId); currentAlgoId += 1 alg.addgeneric('NumResultBits', 1) - alg.addgeneric('InputWidth1', d.nleading1) # noqa: F821 alg.addgeneric('InputWidth2', d.nleading2) # noqa: F821 alg.addgeneric('MaxTob1', d.nleading1) # noqa: F821 @@ -750,11 +657,9 @@ class TopoAlgoDef(object): alg.addvariable('MinET2', d.ocut2, 0) # noqa: F821 alg.addvariable('MinDeltaPhi', d.minDphi, 0) # noqa: F821 alg.addvariable('MaxDeltaPhi', d.maxDphi, 0) # noqa: F821 - tm.registerAlgo(alg) - # RATIO MATCH dedicated to Exotic toponame = '100RATIO-0MATCH-TAU30si2-EMall' alg = AlgConf.RatioMatch( name = toponame, inputs = [ 'TAUsi', 'EMall'], outputs = [ toponame ], algoId = currentAlgoId ); currentAlgoId += 1 @@ -812,8 +717,7 @@ class TopoAlgoDef(object): # DISAMB 2 lists algolist=[ {"disamb": 2, "otype1" : "TAU", "ocut1": 12, "olist1" : "abi", "nleading1": HW.OutputWidthSelectTAU, "otype2" : "J", "ocut2": 25, "olist2": "ab", "nleading2": HW.OutputWidthSelectJET}, #2DISAMB-TAU12abi-J25ab - ] - + ] for x in algolist : class d : pass @@ -842,30 +746,28 @@ class TopoAlgoDef(object): alg.addvariable('DisambDRSqrMin', d.disamb*d.disamb) # noqa: F821 tm.registerAlgo(alg) - # DISAMB 3 lists with DR cut to 2nd and 3rd lists + # DISAMB 3 lists with DR cut to 2nd and 3rd lists algolist=[ - {"disamb": 2, "otype1" : "TAU", "ocut1": 20, "olist1": "abi","nleading1": HW.OutputWidthSelectTAU, "inputwidth1": HW.OutputWidthSelectTAU, "otype2" : "TAU", "ocut2": 12, "olist2": "abi", "nleading2": HW.OutputWidthSelectTAU, "inputwidth2": HW.OutputWidthSelectTAU, "otype3" : "J", "ocut3": 25, "olist3": "ab", "nleading3": HW.OutputWidthSelectJET, "inputwidth3": HW.OutputWidthSelectJET, "drcutmin": 0, "drcutmax": 25}, # 2DISAMB-J25ab-0DR25-TAU20abi-TAU12abi - {"disamb": 2, "otype1" : "EM", "ocut1": 15, "olist1": "shi","nleading1": 2, "inputwidth1": HW.OutputWidthSortEM, "otype2" : "TAU", "ocut2": 12, "olist2": "abi", "nleading2": HW.OutputWidthSelectTAU, "inputwidth2": HW.OutputWidthSelectTAU, "otype3" : "J", "ocut3": 25, "olist3": "ab", "nleading3": HW.OutputWidthSelectJET, "inputwidth3": HW.OutputWidthSelectJET, "drcutmin": 0, "drcutmax": 28}, #2DISAMB-J25ab-0DR28-EM15his2-TAU12abi - {"disamb": 2, "otype1" : "TAU", "ocut1": 20, "olist1": "abi","nleading1": HW.OutputWidthSelectTAU, "inputwidth1": HW.OutputWidthSelectTAU, "otype2" : "TAU", "ocut2": 12, "olist2": "abi", "nleading2": HW.OutputWidthSelectTAU, "inputwidth2": HW.OutputWidthSelectTAU, "otype3" : "J", "ocut3": 25, "olist3": "ab", "nleading3": HW.OutputWidthSelectJET, "inputwidth3": HW.OutputWidthSelectJET, "drcutmin": 0, "drcutmax": 28}, # 2DISAMB-J25ab-0DR28-TAU20abi-TAU12abi - + { "disamb": 2, "otype1" : "EM", "ocut1": 15, "olist1": "shi","nleading1": 2, "inputwidth1": HW.OutputWidthSortEM, "otype2" : "TAU", "ocut2": 12, + "olist2": "abi", "nleading2": HW.OutputWidthSelectTAU, "inputwidth2": HW.OutputWidthSelectTAU, "otype3" : "J", "ocut3": 25, "olist3": "ab", + "nleading3": HW.OutputWidthSelectJET, "inputwidth3": HW.OutputWidthSelectJET, "drcutmin": 0, "drcutmax": 28}, #2DISAMB-J25ab-0DR28-EM15his2-TAU12abi + { "disamb": 2, "otype1" : "TAU", "ocut1": 20, "olist1": "abi","nleading1": HW.OutputWidthSelectTAU, "inputwidth1": HW.OutputWidthSelectTAU, + "otype2" : "TAU", "ocut2": 12, "olist2": "abi", "nleading2": HW.OutputWidthSelectTAU, "inputwidth2": HW.OutputWidthSelectTAU, "otype3" : "J", "ocut3": 25, "olist3": "ab", + "nleading3": HW.OutputWidthSelectJET, "inputwidth3": HW.OutputWidthSelectJET, "drcutmin": 0, "drcutmax": 28}, # 2DISAMB-J25ab-0DR28-TAU20abi-TAU12abi + { "disamb": 2, "otype1" : "TAU", "ocut1": 20, "olist1": "abi","nleading1": HW.OutputWidthSelectTAU, "inputwidth1": HW.OutputWidthSelectTAU, + "otype2" : "TAU", "ocut2": 12, "olist2": "abi", "nleading2": HW.OutputWidthSelectTAU, "inputwidth2": HW.OutputWidthSelectTAU, "otype3" : "J", + "ocut3": 25, "olist3": "ab", "nleading3": HW.OutputWidthSelectJET, "inputwidth3": HW.OutputWidthSelectJET, "drcutmin": 0, "drcutmax": 25 }, # 2DISAMB-J25ab-0DR25-TAU20abi-TAU12abi ] - - for x in algolist: - class d : pass for k in x: setattr (d, k, x[k]) - - obj1 = "-%s%s%s" % (d.otype1, str(d.ocut1), d.olist1.replace('shi','his') + (str(d.nleading1) if d.olist1.find('s')>=0 else "")) # noqa: F821 obj2 = "-%s%s%s" % (d.otype2, str(d.ocut2), d.olist2.replace('shi','his') + (str(d.nleading2) if d.olist2.find('s')>=0 else "")) # noqa: F821 obj3 = "%s%s%s" % (d.otype3, str(d.ocut3), d.olist3) # noqa: F821 toponame = "%sDISAMB-%s-%dDR%d%s%s" % ( str(d.disamb) if d.disamb>0 else "", obj3, d.drcutmin, d.drcutmax, obj1, obj2) # noqa: F821 - log.info("Define %s" % toponame) - inputList = [d.otype1 + d.olist1, d.otype2 + d.olist2, d.otype3 + d.olist3] # noqa: F821 alg = AlgConf.DisambiguationDRIncl3( name = toponame, inputs = inputList, outputs = [ toponame ], algoId = currentAlgoId); currentAlgoId += 1 alg.addgeneric('InputWidth1', d.inputwidth1) # noqa: F821 @@ -884,51 +786,36 @@ class TopoAlgoDef(object): tm.registerAlgo(alg) - - # + # KF-XE-AJall xemap = [{"etcut": 0, "Threlist": [ 40, 50, 55, 60, 65, 75 ]}] for x in xemap: - class d : pass for k in x: setattr (d, k, x[k]) - - log.info("Define %s" % toponame) - inputList = ['XENoSort', 'AJall'] toponames=[] - for minxe in d.Threlist: # noqa: F821 toponames.append("KF-XE%s-AJall" % (minxe)) - alg = AlgConf.KalmanMETCorrection( name = "KF-XE-AJall", inputs = inputList, outputs = toponames, algoId = currentAlgoId ); currentAlgoId += 1 alg.addgeneric('InputWidth', HW.InputWidthJET) alg.addgeneric('NumResultBits', len(toponames)) alg.addvariable('MinET', 0) for bitid,minxe in enumerate(d.Threlist): # noqa: F821 alg.addvariable('KFXE', str(minxe), bitid) - tm.registerAlgo(alg) - + # LATE MUON : LATE-MU10s1 for x in [ {"otype" : "LATE-MU", "ocut" : 10, "inputwidth": HW.NumberOfDelayedMuons}, ]: - class d : pass for k in x: setattr (d, k, x[k]) - - - toponame = "%s%ss1" % ( d.otype, str(d.ocut) ) # noqa: F821 - log.info("Define %s" % toponame) - inputList = 'LMUs' - alg = AlgConf.EtCut( name = toponame, inputs = inputList, outputs = toponame, algoId = currentAlgoId ); currentAlgoId += 1 alg.addgeneric('InputWidth', d.inputwidth) # noqa: F821 alg.addgeneric('MaxTob', 1) @@ -942,27 +829,20 @@ class TopoAlgoDef(object): {"minHT": 111, "otype" : "CJ", "ocut" : 15, "olist" : "ab", "nleading" : HW.OutputWidthSelectJET, "inputwidth": HW.OutputWidthSelectJET, "oeta" : 26}, #SC111-CJ15ab.ETA26 ] for x in algoList: - class d : pass for k in x: setattr (d, k, x[k]) - - toponame = "SC%d-%s%s%s%s.ETA%s" % (d.minHT, d.otype, str(d.ocut), d.olist, str(d.nleading) if d.olist=="s" else "", str(d.oeta)) # noqa: F821 - log.info("Define %s" % toponame) - inputList = d.otype + d.olist # noqa: F821 - alg = AlgConf.SimpleCone( name = toponame, inputs = inputList, outputs = [toponame], algoId = currentAlgoId ); currentAlgoId += 1 - - alg.addgeneric('InputWidth', d.inputwidth) # noqa: F821 alg.addvariable('MinET', d.ocut) # noqa: F821 alg.addvariable('MinSumET', d.minHT) # noqa: F821 alg.addvariable('MaxRSqr', 10*10) tm.registerAlgo(alg) + # DISAMB-INVM for x in [ {"disamb": 0, "minInvm": 30, "maxInvm": 9999,"otype1" : "EM", "ocut1": 20, "olist1": "shi","nleading1": 2, "inputwidth1": HW.OutputWidthSortEM, "otype2" : "TAU", "ocut2": 12, "olist2": "ab", "nleading2": HW.OutputWidthSelectTAU, "inputwidth2": HW.OutputWidthSelectTAU}, # DISAMB-30INVM-EM20his2-TAU12ab @@ -970,30 +850,25 @@ class TopoAlgoDef(object): class d : pass for k in x: setattr (d, k, x[k]) - - obj1 = "%s%s%s" % (d.otype1, str(d.ocut1), d.olist1.replace('shi','his') + (str(d.nleading1) if d.olist1.find('s')>=0 else "")) # noqa: F821 obj2 = "-%s%s%s" % (d.otype2, str(d.ocut2), d.olist2) # noqa: F821 toponame = "%sDISAMB-%iINVM%s-%s%s" % ( d.disamb if d.disamb>0 else "", d.minInvm, str(d.maxInvm) if d.maxInvm<9999 else "", obj1, obj2) # noqa: F821 - log.info("Define %s" % toponame) inputList = [d.otype1 + d.olist1, d.otype2 + d.olist2] # noqa: F821 #alg = AlgConf.DisambiguationInvariantMass2( name = toponame, inputs = inputList, outputs = toponame, algoId = currentAlgoId); currentAlgoId += 1 alg = AlgConf.DisambiguationInvmIncl2( name = toponame, inputs = inputList, outputs = toponame, algoId = currentAlgoId); currentAlgoId += 1 - alg.addgeneric('InputWidth1', d.inputwidth1) # noqa: F821 alg.addgeneric('InputWidth2', d.inputwidth2) # noqa: F821 alg.addgeneric('MaxTob1', d.nleading1) # noqa: F821 alg.addgeneric('MaxTob2', d.nleading2) # noqa: F821 - alg.addgeneric('NumResultBits', 1) - + alg.addgeneric('NumResultBits', 1) alg.addvariable('MinET1', d.ocut1) # noqa: F821 alg.addvariable('MinET2', d.ocut2) # noqa: F821 alg.addvariable('MinMSqr', d.minInvm * d.minInvm) # noqa: F821 - alg.addvariable('MaxMSqr', d.maxInvm * d.maxInvm) # noqa: F821 - + alg.addvariable('MaxMSqr', d.maxInvm * d.maxInvm) # noqa: F821 tm.registerAlgo(alg) + # for x in [ { "minInvm": 400, "maxInvm": 9999, "otype1" : "AJ", "ocut1": 30, "olist1" : "s", "nleading1" : 6, "inputwidth1": HW.OutputWidthSortJET, "otype2" : "AJ", "ocut2": 20, "olist2" : "s", "nleading2" : 6, "inputwidth2": HW.OutputWidthSortJET, "applyEtaCut":1, "minEta1": 0 ,"maxEta1": 31 , "minEta2": 31 ,"maxEta2": 49 , }, #400INVM9999-AJ30s6.ETA31-AJ20s6.31ETA49 @@ -1001,25 +876,18 @@ class TopoAlgoDef(object): class d : pass for k in x: setattr (d, k, x[k]) - - obj1 = "%s%s%s.%sETA%i" % (d.otype1, str(d.ocut1), d.olist1 + (str(d.nleading1) if d.olist1.find('s')>=0 else ""),str(d.minEta1) if d.minEta1>0 else "", d.maxEta1) # noqa: F821 obj2 = "-%s%s%s.%sETA%i" % (d.otype2, str(d.ocut2), d.olist2 + (str(d.nleading2) if d.olist2.find('s')>=0 else ""),str(d.minEta2) if d.minEta2>0 else "", d.maxEta2) # noqa: F821 - inputList = [d.otype1 + d.olist1, d.otype2 + d.olist2] # noqa: F821 - toponame = "%iINVM%i-%s%s" % (d.minInvm, d.maxInvm, obj1, obj2) # noqa: F821 alg = AlgConf.InvariantMassInclusive2( name = toponame, inputs = inputList, outputs = toponame, algoId = currentAlgoId); currentAlgoId += 1 - - alg.addgeneric('InputWidth1', d.inputwidth1) # noqa: F821 alg.addgeneric('InputWidth2', d.inputwidth2) # noqa: F821 alg.addgeneric('MaxTob1', d.nleading1) # noqa: F821 alg.addgeneric('MaxTob2', d.nleading2) # noqa: F821 alg.addgeneric('NumResultBits', 1) if (d.applyEtaCut>0): # noqa: F821 - alg.addgeneric('ApplyEtaCut', d.applyEtaCut) # noqa: F821 - + alg.addgeneric('ApplyEtaCut', d.applyEtaCut) # noqa: F821 alg.addvariable('MinET1', d.ocut1) # noqa: F821 alg.addvariable('MinET2', d.ocut2) # noqa: F821 alg.addvariable('MinMSqr', d.minInvm * d.minInvm ) # noqa: F821 @@ -1028,8 +896,7 @@ class TopoAlgoDef(object): alg.addvariable('MinEta1', d.minEta1) # noqa: F821 alg.addvariable('MaxEta1', d.maxEta1) # noqa: F821 alg.addvariable('MinEta2', d.minEta2) # noqa: F821 - alg.addvariable('MaxEta2', d.maxEta2) # noqa: F821 - + alg.addvariable('MaxEta2', d.maxEta2) # noqa: F821 tm.registerAlgo(alg) @@ -1037,48 +904,37 @@ class TopoAlgoDef(object): for x in [ {"minInvm" : 0, "maxInvm": 9, "otype" : "EM", "ocut1" : 7, "olist" : "ab", "inputwidth": HW.OutputWidthSelectEM, "ocut2" : 0}, ]: - class d : pass for k in x: setattr (d, k, x[k]) - - inputList = d.otype + d.olist # noqa: F821 toponame = "%iINVM%i-%s%s%s-%s%s" % (d.minInvm, d.maxInvm, # noqa: F821 d.otype, str(d.ocut1) , d.olist, # noqa: F821 d.otype, d.olist) # noqa: F821 - alg = AlgConf.InvariantMassInclusive1( name = toponame, inputs = inputList, outputs = toponame, algoId = currentAlgoId); currentAlgoId += 1 # noqa: F821 alg.addgeneric('InputWidth', d.inputwidth) # noqa: F821 alg.addgeneric('MaxTob', HW.OutputWidthSelectEM) # noqa: F821 alg.addgeneric('NumResultBits', 1) - alg.addvariable('MinET1', d.ocut1) # noqa: F821 alg.addvariable('MinET2', d.ocut2) # noqa: F821 alg.addvariable('MinMSqr', (d.minInvm * _emscale_for_decision)*(d.minInvm * _emscale_for_decision)) # noqa: F821 alg.addvariable('MaxMSqr', (d.maxInvm * _emscale_for_decision)*(d.maxInvm * _emscale_for_decision)) # noqa: F821 - tm.registerAlgo(alg) + # added for b-phys, 0DR03-EM7ab-CJ15ab for x in [ {"minDr": 0, "maxDr": 3, "otype1" : "EM" ,"ocut1": 7, "olist1" : "ab", "otype2" : "CJ", "ocut2": 15, "olist2" : "ab"} ]: - class d : pass for k in x: setattr (d, k, x[k]) - - toponame = "%iDR%02d-%s%s%s-%s%s%s" % (d.minDr, d.maxDr, d.otype1, str(d.ocut1), d.olist1, d.otype2, str(d.ocut2), d.olist2) # noqa: F821 log.info("Define %s" % toponame) - inputList = [d.otype1 + d.olist1, d.otype2 + d.olist2] # noqa: F821 - alg = AlgConf.DeltaRSqrIncl2( name = toponame, inputs = inputList, outputs = [ toponame ], algoId = currentAlgoId); currentAlgoId += 1 - alg.addgeneric('InputWidth1', HW.OutputWidthSelectEM) alg.addgeneric('InputWidth2', HW.OutputWidthSelectJET) alg.addgeneric('MaxTob1', HW.OutputWidthSelectEM) @@ -1092,45 +948,31 @@ class TopoAlgoDef(object): # VBF items INVM_NFF - invm_nff_map = {"algoname": 'INVM_NFF', "Threlist": [ 500 ], "maxInvm": 9999, "otype1" : "J", "ocut1" : 30, "olist1" : "s", "nleading1" : 6, "inputwidth": HW.OutputWidthSortJET, "otype2" : "AJ", "ocut2" : 20, "olist2" : "s", "nleading2" : 6 } - - - - for x in [ invm_nff_map, - ]: - + invm_nff_map = { "algoname": 'INVM_NFF', "Threlist": [ 500 ], "maxInvm": 9999, "otype1" : "J", "ocut1" : 30, "olist1" : "s", "nleading1" : 6, + "inputwidth": HW.OutputWidthSortJET, "otype2" : "AJ", "ocut2" : 20, "olist2" : "s", "nleading2" : 6 } + for x in [ invm_nff_map ]: class d : pass for k in x: setattr (d, k, x[k]) - - inputList = [d.otype1 + d.olist1, d.otype2 + d.olist1] # noqa: F821 toponames=[] - - for minInvm in d.Threlist: # noqa: F821 toponame = "%iINVM%i-%s%s%s%s-%s%s%s%s" % (minInvm, d.maxInvm, d.otype1, str(d.ocut1) , d.olist1, str(d.nleading1) if d.olist1=="s" else "", d.otype2, str(d.ocut2) , d.olist2, str(d.nleading2) if d.olist2=="s" else "") toponames.append(toponame) - - alg = AlgConf.InvariantMassInclusive2( name = d.algoname, inputs = inputList, outputs = toponames, algoId = currentAlgoId); currentAlgoId += 1 # noqa: F821 - - alg.addgeneric('InputWidth1', d.inputwidth) # noqa: F821 alg.addgeneric('InputWidth2', d.inputwidth) # noqa: F821 alg.addgeneric('MaxTob1', d.nleading1) # noqa: F821 alg.addgeneric('MaxTob2', d.nleading2)# noqa: F821 alg.addgeneric('NumResultBits', len(toponames)) - for bitid, minInvm in enumerate(d.Threlist): # noqa: F821 alg.addvariable('MinET1', d.ocut1, bitid)# noqa: F821 alg.addvariable('MinET2', d.ocut2, bitid)# noqa: F821 alg.addvariable('MinMSqr', minInvm*minInvm , bitid) # noqa: F821 alg.addvariable('MaxMSqr', d.maxInvm *d.maxInvm , bitid) # noqa: F821 - - tm.registerAlgo(alg) + tm.registerAlgo(alg) # Axion 2EM DPHI @@ -1138,22 +980,18 @@ class TopoAlgoDef(object): algoList = [ {"minDphi": 27, "maxDphi": 32, "otype" : "EM", "ocut1" : 0, "olist" : "s", "nleading1" : 1, "inputwidth1": HW.OutputWidthSortEM, "ocut2" : 0, "nleading2": 6}, ] - for x in algoList: class d : pass for k in x: setattr (d, k, x[k]) - - toponame = "%iDPHI%i-%s%s%s%s-%s%s%s%s" % (d.minDphi, d.maxDphi, # noqa: F821 - d.otype, str(d.ocut1) if d.ocut1 > 0 else "", d.olist, str(d.nleading1) if d.olist=="s" else "", # noqa: F821 - d.otype, str(d.ocut2) if d.ocut2 > 0 else "", d.olist, str(d.nleading2) if d.olist=="s" else "") # noqa: F821 - + d.otype, str(d.ocut1) if d.ocut1 > 0 else "", d.olist, + str(d.nleading1) if d.olist=="s" else "", # noqa: F821 + d.otype, str(d.ocut2) if d.ocut2 > 0 else "", d.olist, + str(d.nleading2) if d.olist=="s" else "") # noqa: F821 log.info("Define %s" % toponame) inputList = d.otype + d.olist # noqa: F821 - alg = AlgConf.DeltaPhiIncl1( name = toponame, inputs = inputList, outputs = toponame, algoId = currentAlgoId ); currentAlgoId += 1 - alg.addgeneric('InputWidth', d.inputwidth1) # noqa: F821 alg.addgeneric('MaxTob', d.nleading2) # noqa: F821 alg.addgeneric('NumResultBits', 1) @@ -1164,28 +1002,20 @@ class TopoAlgoDef(object): tm.registerAlgo(alg) - # VBF items INVM_NFF + DPHI - NFFDphimap = [{"minInvm": 400 , "maxInvm": 9999, "minDphi": 0, "maxDphiList": [26, 24, 22, 20], "otype1" : "J", "ocut1" : 30, "olist1" : "s", "nleading1" : 6, "inputwidth": HW.OutputWidthSortJET, "otype2" : "AJ", "ocut2" : 20, "olist2" : "s", "nleading2" : 6 }] - - + # VBF items INVM_DPHI_NFF + NFFDphimap = [{ "minInvm": 400 , "maxInvm": 9999, "minDphi": 0, "maxDphiList": [26, 24, 22, 20], "otype1" : "J", "ocut1" : 30, "olist1" : "s", + "nleading1" : 6, "inputwidth": HW.OutputWidthSortJET, "otype2" : "AJ", "ocut2" : 20, "olist2" : "s", "nleading2" : 6 }] for x in NFFDphimap: - class d : pass for k in x: setattr (d, k, x[k]) - - inputList = [d.otype1 + d.olist1, d.otype2 + d.olist1] # noqa: F821 toponames=[] - for maxDphi in d.maxDphiList: # noqa: F821 toponames.append ("%iINVM%i-%iDPHI%i-%s%s%s%s-%s%s%s%s" % (d.minInvm, d.maxInvm, d.minDphi, maxDphi, d.otype1, str(d.ocut1) , d.olist1, str(d.nleading1) if d.olist1=="s" else "", d.otype2, str(d.ocut2) , d.olist2, str(d.nleading2) if d.olist2=="s" else "")) - alg = AlgConf.InvariantMassDeltaPhiInclusive2( name = 'INVM_DPHI_NFF', inputs = inputList, outputs = toponames, algoId = currentAlgoId); currentAlgoId += 1 # noqa: F821 - - alg.addgeneric('InputWidth1', d.inputwidth) # noqa: F821 alg.addgeneric('InputWidth2', d.inputwidth) # noqa: F821 alg.addgeneric('MaxTob1', d.nleading1) # noqa: F821 @@ -1198,16 +1028,13 @@ class TopoAlgoDef(object): alg.addvariable('MaxMSqr', d.maxInvm*d.maxInvm , bitid) # noqa: F821 alg.addvariable('MinDeltaPhi', d.minDphi, bitid) # noqa: F821 alg.addvariable('MaxDeltaPhi', maxDphi, bitid) # noqa: F821 - tm.registerAlgo(alg) #ATR-19355 toponame = "0INVM10-3MU4ab" # noqa: F821 - log.info("Define %s" % toponame) - - inputList = 'MUab' - + log.info("Define %s" % toponame) + inputList = 'MUab' alg = AlgConf.InvariantMassThreeTOBsIncl( name = toponame, inputs = inputList, outputs = toponame, algoId = currentAlgoId ); currentAlgoId += 1 alg.addgeneric('InputWidth', HW.OutputWidthSelectMU) alg.addgeneric('MaxTob', HW.OutputWidthSelectMU) @@ -1216,7 +1043,34 @@ class TopoAlgoDef(object): alg.addvariable('MaxMSqr', 10*10) alg.addvariable('MinET1', 4) tm.registerAlgo(alg) - + + + # added for muon-jet: + algoList = [ + {"minDr": 0, "maxDr": 4, "otype1" : "MU" ,"ocut1": 4, "olist1" : "ab", "otype2" : "CJ", "ocut2": 15, "olist2" : "ab"}, #0DR04-MU4ab-CJ15ab + {"minDr": 0, "maxDr": 4, "otype1" : "MU" ,"ocut1": 6, "olist1" : "ab", "otype2" : "CJ", "ocut2": 20, "olist2" : "ab"}, #0DR04-MU6ab-CJ20ab + ] + for x in algoList: + class d : pass + for k in x: + setattr (d, k, x[k]) + toponame = "%iDR%02d-%s%s%s-%s%s%s" % (d.minDr, d.maxDr, d.otype1, str(d.ocut1), d.olist1, d.otype2, str(d.ocut2), d.olist2) # noqa: F821 + log.info("Define %s" % toponame) + inputList = [d.otype1 + d.olist1, d.otype2 + d.olist2] # noqa: F821 + alg = AlgConf.DeltaRSqrIncl2( name = toponame, inputs = inputList, outputs = [ toponame ], algoId = currentAlgoId); currentAlgoId += 1 + log.info("Current algo ID %i" % currentAlgoId ) + alg.addgeneric('InputWidth1', HW.OutputWidthSelectMU) + alg.addgeneric('InputWidth2', HW.OutputWidthSelectJET) + alg.addgeneric('MaxTob1', HW.OutputWidthSelectMU) + alg.addgeneric('MaxTob2', HW.OutputWidthSelectJET) + alg.addgeneric('NumResultBits', 1) + alg.addvariable('MinET1', d.ocut1, 0) # noqa: F821 + alg.addvariable('MinET2', d.ocut2, 0) # noqa: F821 + alg.addvariable('DeltaRMin', d.minDr*d.minDr, 0) # noqa: F821 + alg.addvariable('DeltaRMax', d.maxDr*d.maxDr, 0) # noqa: F821 + tm.registerAlgo(alg) + + #ATR-18815 @@ -1276,23 +1130,15 @@ class TopoAlgoDef(object): ZAFBDphimap = [ {"minInvm": 60 ,"maxInvm": 9999, "minDphiList": [4, 25], "maxDphi": 32, "minEta2": 23, "maxEta2": 49, "inputwidth1": HW.OutputWidthSortEM, "otype1" : "EM", "ocut1" : 15, "olist1" : "abhi", "nleading1" : HW.OutputWidthSortEM, "inputwidth2": HW.OutputWidthSortJET, "ocut2" : 15,"nleading2" : 6} ] - for x in ZAFBDphimap: class d : pass for k in x: setattr (d, k, x[k]) - - inputList = [d.otype1 + d.olist1, 'FJjs23ETA49'] # noqa: F821 toponames=[] - for minDphi in d.minDphiList: # noqa: F821 toponames.append ("%iINVM%i-%02dDPHI%i-%s%s%s%s-FJj%ss%s%iETA%i" % (d.minInvm, d.maxInvm, minDphi, d.maxDphi, d.otype1, str(d.ocut1) , d.olist1, str(d.nleading1) if d.olist1=="s" else "", str(d.ocut2) , str(d.nleading2) , d.minEta2, d.maxEta2)) - - alg = AlgConf.InvariantMassDeltaPhiInclusive2( name = 'ZAFB_DPHI', inputs = inputList, outputs = toponames, algoId = currentAlgoId); currentAlgoId += 1 # noqa: F821 - - alg.addgeneric('InputWidth1', d.inputwidth1) # noqa: F821 alg.addgeneric('InputWidth2', d.inputwidth2) # noqa: F821 alg.addgeneric('MaxTob1', d.nleading1) # noqa: F821 @@ -1310,9 +1156,9 @@ class TopoAlgoDef(object): alg.addvariable('MaxMSqr', d.maxInvm*d.maxInvm*_emscale_for_decision , bitid) # noqa: F821 #ATR-18824 only one factor is needed as there is one EM object alg.addvariable('MinDeltaPhi', minDphi, bitid) # noqa: F821 alg.addvariable('MaxDeltaPhi', d.maxDphi, bitid) # noqa: F821 - tm.registerAlgo(alg) + #ATR-19302: not included for now toponame = "0INVM70-27DPHI32-EM10his1-EM10his6" log.info("Define %s" % toponame) @@ -1451,13 +1297,14 @@ class TopoAlgoDef(object): # alg.addvariable('DeltaRMax', 15*15) # tm.registerAlgo(alg) # + + + currentAlgoId = 47 + #ATR-20174, L1BPH-8M15-2MU4-BO - toponame = "8INVM15-2CMU4ab" - log.info("Define %s" % toponame) - - inputList = ['CMUab'] - + log.info("Define %s" % toponame) + inputList = ['CMUab'] alg = AlgConf.InvariantMassInclusive1( name = toponame, inputs = inputList, outputs = toponame, algoId = currentAlgoId ); currentAlgoId += 1 alg.addgeneric('InputWidth', HW.OutputWidthSelectMU) alg.addgeneric('MaxTob', HW.OutputWidthSelectMU) @@ -1465,27 +1312,20 @@ class TopoAlgoDef(object): alg.addvariable('MinMSqr', 8*8) alg.addvariable('MaxMSqr', 15*15) alg.addvariable('MinET1', 4) - alg.addvariable('MinET2', 4) - + alg.addvariable('MinET2', 4) tm.registerAlgo(alg) - #CEP algorithms + #CEP algorithms CEPmap = [{"algoname": 'CEP_CJ', "minETlist": [50, 60]}] - - for x in CEPmap: class d : pass for k in x: setattr (d, k, x[k]) - - inputList = ['CJs'] toponames=[] - for minET in d.minETlist: # noqa: F821 toponames.append ("CEP-CJ%is6" % (minET)) # noqa: F821 - alg = AlgConf.ExclusiveJets( name = d.algoname, inputs = inputList, outputs = toponames, algoId = currentAlgoId); currentAlgoId += 1 # noqa: F821 alg.addgeneric('InputWidth', HW.InputWidthJET) # noqa: F821 alg.addgeneric('MaxTob', HW.InputWidthJET) # noqa: F821 diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/LVL1MenuConfig/LVL1Menu/ItemDef.py b/Trigger/TriggerCommon/TriggerMenuMT/python/LVL1MenuConfig/LVL1Menu/ItemDef.py index a1c06071100e05964d84b4f61ea2478018ca40a4..787dce1806fbd9c704a5d38b335a0f4f54c33244 100755 --- a/Trigger/TriggerCommon/TriggerMenuMT/python/LVL1MenuConfig/LVL1Menu/ItemDef.py +++ b/Trigger/TriggerCommon/TriggerMenuMT/python/LVL1MenuConfig/LVL1Menu/ItemDef.py @@ -905,14 +905,14 @@ class ItemDef(object): LVL1MenuItem('L1_BCM_Wide_CALIB' ).setLogic( d.BCM_Wide & calibcond).setTriggerType(TT.minb) #AFP - LVL1MenuItem('L1_AFP_NSC').setLogic( d.AFP_NSC & physcond ) - LVL1MenuItem('L1_AFP_FSC').setLogic( d.AFP_FSC & physcond ) - LVL1MenuItem('L1_AFP_C_ANY').setLogic( (d.AFP_FSC | d.AFP_NSC) & physcond ) - LVL1MenuItem('L1_AFP_C_ANY_UNPAIRED_ISO').setLogic( (d.AFP_FSC | d.AFP_NSC) & unpaired_isocond) - LVL1MenuItem('L1_AFP_C_ANY_UNPAIRED_NONISO').setLogic( (d.AFP_FSC | d.AFP_NSC) & unpaired_nonisocond) - LVL1MenuItem('L1_AFP_C_ANY_EMPTY').setLogic( (d.AFP_FSC | d.AFP_NSC) & cosmiccond) - LVL1MenuItem('L1_AFP_C_ANY_FIRSTEMPTY').setLogic( (d.AFP_FSC | d.AFP_NSC) & firstempty) - LVL1MenuItem('L1_AFP_C_AND').setLogic( (d.AFP_FSC & d.AFP_NSC) & physcond ) + #LVL1MenuItem('L1_AFP_NSC').setLogic( d.AFP_NSC & physcond ) + #LVL1MenuItem('L1_AFP_FSC').setLogic( d.AFP_FSC & physcond ) + #LVL1MenuItem('L1_AFP_C_ANY').setLogic( (d.AFP_FSC | d.AFP_NSC) & physcond ) + #LVL1MenuItem('L1_AFP_C_ANY_UNPAIRED_ISO').setLogic( (d.AFP_FSC | d.AFP_NSC) & unpaired_isocond) + #LVL1MenuItem('L1_AFP_C_ANY_UNPAIRED_NONISO').setLogic( (d.AFP_FSC | d.AFP_NSC) & unpaired_nonisocond) + #LVL1MenuItem('L1_AFP_C_ANY_EMPTY').setLogic( (d.AFP_FSC | d.AFP_NSC) & cosmiccond) + #LVL1MenuItem('L1_AFP_C_ANY_FIRSTEMPTY').setLogic( (d.AFP_FSC | d.AFP_NSC) & firstempty) + #LVL1MenuItem('L1_AFP_C_AND').setLogic( (d.AFP_FSC & d.AFP_NSC) & physcond ) # RANDOM @@ -1029,16 +1029,16 @@ class ItemDef(object): # LVL1MenuItem('L1_AFP_C_ALFA_C').setLogic( AFP_C & ALFA_C & physcond ) # LVL1MenuItem('L1_AFP_C_ALFA_A').setLogic( AFP_C & ALFA_A & physcond ) - AFP_C = (d.AFP_FSC & d.AFP_NSC) - LVL1MenuItem('L1_AFP_C_MBTS_A').setLogic( AFP_C & d.MBTS_A & physcond ) - LVL1MenuItem('L1_AFP_C_ZDC_C').setLogic( AFP_C & d.ZDC_C & physcond ) - LVL1MenuItem('L1_AFP_C_J12').setLogic( AFP_C & d.J12 & physcond ) - LVL1MenuItem('L1_AFP_C_EM3').setLogic( AFP_C & d.EM3 & physcond ) - LVL1MenuItem('L1_AFP_C_MU4').setLogic( AFP_C & d.MU4 & physcond ) - LVL1MenuItem('L1_AFP_C_TE5').setLogic( AFP_C & d.TE5 & physcond ) - LVL1MenuItem('L1_AFP_C_ALFA_C').setLogic( AFP_C & ALFA_C & physcond ) - LVL1MenuItem('L1_AFP_C_ALFA_A').setLogic( AFP_C & ALFA_A & physcond ) - LVL1MenuItem('L1_AFP_C_ANY_MBTS_A').setLogic( (d.AFP_FSC | d.AFP_NSC) & d.MBTS_A & physcond ) + #AFP_C = (d.AFP_FSC & d.AFP_NSC) + #LVL1MenuItem('L1_AFP_C_MBTS_A').setLogic( AFP_C & d.MBTS_A & physcond ) + #LVL1MenuItem('L1_AFP_C_ZDC_C').setLogic( AFP_C & d.ZDC_C & physcond ) + #LVL1MenuItem('L1_AFP_C_J12').setLogic( AFP_C & d.J12 & physcond ) + #LVL1MenuItem('L1_AFP_C_EM3').setLogic( AFP_C & d.EM3 & physcond ) + #LVL1MenuItem('L1_AFP_C_MU4').setLogic( AFP_C & d.MU4 & physcond ) + #LVL1MenuItem('L1_AFP_C_TE5').setLogic( AFP_C & d.TE5 & physcond ) + #LVL1MenuItem('L1_AFP_C_ALFA_C').setLogic( AFP_C & ALFA_C & physcond ) + #LVL1MenuItem('L1_AFP_C_ALFA_A').setLogic( AFP_C & ALFA_A & physcond ) + #LVL1MenuItem('L1_AFP_C_ANY_MBTS_A').setLogic( (d.AFP_FSC | d.AFP_NSC) & d.MBTS_A & physcond ) ## ALFA Single items LVL1MenuItem('L1_ALFA_B7L1U').setLogic(d.ALFA_B7L1U & d.BGRP0).setTriggerType(TT.alfa) diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/LVL1MenuConfig/LVL1Menu/Menu_LS2_v1.py b/Trigger/TriggerCommon/TriggerMenuMT/python/LVL1MenuConfig/LVL1Menu/Menu_LS2_v1.py index 392cee0fe415902dda6796f308f41b41a57dd818..23c7d7f0467eccf77a1fd3563bb78af5f4209c18 100644 --- a/Trigger/TriggerCommon/TriggerMenuMT/python/LVL1MenuConfig/LVL1Menu/Menu_LS2_v1.py +++ b/Trigger/TriggerCommon/TriggerMenuMT/python/LVL1MenuConfig/LVL1Menu/Menu_LS2_v1.py @@ -111,7 +111,7 @@ def defineMenu(): #'RXE35', 'RXE40', 'RXE45', 'RXE50', 'RXE55', 'RXE60', 'RXE70', 'RXE80', # FTHR # 8 x restricted eta range - #'TE5.24ETA49', 'TE10.24ETA49', 'TE15.24ETA49', 'TE20.24ETA49', 'TE25.24ETA49', 'TE30.24ETA49', 'TE40.24ETA49', 'TE70.24ETA49', + 'TE5.0ETA24', 'TE10.0ETA24', 'TE15.0ETA24', 'TE20.0ETA24', 'TE25.0ETA24', 'TE30.0ETA24', 'TE40.0ETA24', 'TE70.0ETA24', @@ -185,8 +185,8 @@ def defineMenu(): # AFP 'AFP_NSC', 'AFP_NSA', - #'AFP_FSA_SIT', 'AFP_FSA_TOF', 'AFP_FSA_LOG', - #'AFP_FSC_SIT', 'AFP_FSC_LOG', 'AFP_FSC_TOF', + 'AFP_FSA_SIT', 'AFP_FSA_TOF', 'AFP_FSA_LOG', + 'AFP_FSC_SIT', 'AFP_FSC_LOG', 'AFP_FSC_TOF', #------------------------------------------------------------------- diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/LVL1MenuConfig/LVL1Menu/ThresholdDef.py b/Trigger/TriggerCommon/TriggerMenuMT/python/LVL1MenuConfig/LVL1Menu/ThresholdDef.py index 6bece23735bec1dba7a81c5a767d1902d6532770..865259784387a686779ad3901f398c25bc466f42 100644 --- a/Trigger/TriggerCommon/TriggerMenuMT/python/LVL1MenuConfig/LVL1Menu/ThresholdDef.py +++ b/Trigger/TriggerCommon/TriggerMenuMT/python/LVL1MenuConfig/LVL1Menu/ThresholdDef.py @@ -433,9 +433,13 @@ class ThresholdDef(object): ## AFP tc.registerThr('AFP_NSC', 'NIM', mapping=2).addThrValue(50) - tc.registerThr('AFP_FSC', 'NIM', mapping=3).addThrValue(50) - tc.registerThr('AFP_NSA', 'NIM', mapping=4).addThrValue(50) - tc.registerThr('AFP_FSA', 'NIM', mapping=5).addThrValue(50) + tc.registerThr('AFP_NSA', 'NIM', mapping=3).addThrValue(50) + tc.registerThr('AFP_FSA_SIT', 'NIM', mapping=4).addThrValue(50) + tc.registerThr('AFP_FSA_TOF', 'NIM', mapping=5).addThrValue(50) + tc.registerThr('AFP_FSA_LOG', 'NIM', mapping=6).addThrValue(50) + tc.registerThr('AFP_FSC_SIT', 'NIM', mapping=7).addThrValue(50) + tc.registerThr('AFP_FSC_LOG', 'NIM', mapping=8).addThrValue(50) + tc.registerThr('AFP_FSC_TOF', 'NIM', mapping=9).addThrValue(50) # Diamond beam monitors diff --git a/Trigger/TriggerCommon/TriggerMenuMT/scripts/trigCompareOldandNewL1Menus.py b/Trigger/TriggerCommon/TriggerMenuMT/scripts/trigCompareOldandNewL1Menus.py index 9419ccd3099953cf1c115493eec457ce93fd8a5c..12bcac7e3fc4c6ae8331d75a88353344a2b75e71 100755 --- a/Trigger/TriggerCommon/TriggerMenuMT/scripts/trigCompareOldandNewL1Menus.py +++ b/Trigger/TriggerCommon/TriggerMenuMT/scripts/trigCompareOldandNewL1Menus.py @@ -16,7 +16,6 @@ from itertools import chain from AthenaCommon.Logging import logging, Constants log = logging.getLogger("TestMenuMigration") log.setLevel(Constants.DEBUG) -from TriggerMenuMT.LVL1MenuConfig.LVL1.XMLReader import L1MenuXMLReader from TrigConfIO.L1TriggerConfigAccess import L1MenuAccess from TrigConfIO.HLTTriggerConfigAccess import HLTMenuAccess @@ -46,7 +45,6 @@ class MenuComp: self.fn_r22_l1_xml = None self.fn_r22_hlt = None self.fn_r22_topo = None - self.fn_r213_topo = None self.fn_r211_topo = None self.check = [True] @@ -60,8 +58,6 @@ class MenuComp: if fileName.startswith("L1Topo"): if "smk" in fileName.lower(): # EB run configuration => r21.1 self.fn_r211_topo = fileName - elif "21.3" in fileName: # r21.3 - self.fn_r213_topo = fileName elif '22.0' in fileName: # r22 self.fn_r22_topo = fileName else: @@ -69,54 +65,111 @@ class MenuComp: self.fn_r22_l1_xml = fileName self.r22_l1_json = L1MenuAccess(self.fn_r22_l1_json) if self.fn_r22_l1_json else None - self.r22_l1_xml = L1MenuXMLReader(self.fn_r22_l1_xml) if self.fn_r22_l1_xml else None + self.r22_l1_xml = ET.parse(self.fn_r22_l1_xml).getroot() if self.fn_r22_l1_xml else None self.r22_hlt = HLTMenuAccess(self.fn_r22_hlt) if self.fn_r22_hlt else None self.r22_topo = ET.parse(self.fn_r22_topo).getroot() if self.fn_r22_topo else None - self.r213_topo = ET.parse(self.fn_r213_topo).getroot() if self.fn_r213_topo else None self.r211_topo = ET.parse(self.fn_r211_topo).getroot() if self.fn_r211_topo else None log.info("Release 22 L1 Menu : %s", self.fn_r22_l1_json) log.info("Release 22 L1 Menu (xml): %s", self.fn_r22_l1_xml ) log.info("Release 22 HLT Menu : %s", self.fn_r22_hlt ) log.info("Release 22 L1Topo : %s", self.fn_r22_topo ) - log.info("Release 21.3 L1Topo : %s", self.fn_r213_topo ) log.info("Release 21.1 L1Topo : %s", self.fn_r211_topo ) + def compareCTPIN(self): + if self.r22_l1_xml is None or self.r22_l1_json is None: + return + log.info("Comparing the CTPIN inputs in r21.1 and r22") + log.info("===========================================") + # CHECK 1: all CTPIN thresholds must be migrated + THR = namedtuple("THR", "conn, firstbit, nbits, thrtype, mapping, name") + ctpinThresholdsXML = [] + for thr in self.r22_l1_xml.find("TriggerThresholdList").iterfind("TriggerThreshold"): + if thr.attrib['input'] != 'ctpin': + continue + cable = thr.find("Cable") + if cable.attrib["name"] == 'MUCTPI': + continue + signal = cable.find("Signal") + ctpinThresholdsXML += [ THR( name = thr.attrib["name"], thrtype = thr.attrib["type"], mapping = int(thr.attrib["mapping"]), + conn = cable.attrib["name"], firstbit = int(signal.attrib["range_begin"]), + nbits = int(signal.attrib["range_end"]) - int(signal.attrib["range_begin"]) + 1) ] + ctpinThresholdsJSON = [] + for connName,connDef in self.r22_l1_json.connectors().items(): + if connDef['type'] != 'ctpin': + continue + allThresholds = self.r22_l1_json.thresholds() + thr2typeMap = {} + for thrType in self.r22_l1_json.thresholdTypes(): + for thr in self.r22_l1_json.thresholds(thrType): + thr2typeMap[thr] = thrType + for tl in connDef['triggerlines']: + thrName = tl['name'] + thr = allThresholds[thrName] + ctpinThresholdsJSON += [ THR( name = thrName, thrtype = thr2typeMap[thrName], mapping = thr["mapping"], + conn = connName, firstbit = tl['startbit'], nbits = tl['nbits']) ] + onlyInXML = sorted(set(ctpinThresholdsXML) - set(ctpinThresholdsJSON)) + onlyInJSON = sorted(set(ctpinThresholdsJSON) - set(ctpinThresholdsXML)) + cc = len(self.check) + self.check += [ len(onlyInXML) + len(onlyInJSON) ==0 ] + log.info("CHECK %i: all ctpin inputs (except MUCTPI) must be correctly migrated from xml to json: %s", cc, boolStr(self.check[cc]) ) + if not self.check[cc]: + if len(onlyInXML)>0: + log.debug("These %i ctpin inputs have not been (correctly) migrated" , len(onlyInXML)) + for x in onlyInXML: + log.debug(" %s", x) + if len(onlyInJSON)>0: + log.debug("These %i ctpin inputs are new" , len(onlyInJSON)) + for x in onlyInJSON: + log.debug(" %s", x) + + #for x in onlyInXML: + #print("In XML %i" % len(ctpinThresholdsXML)) + #print("In JSON %i" % len(ctpinThresholdsJSON)) + #for i,x in enumerate(ctpinThresholdsXML): + # print(f"{i}: {x}") + #for i,x in enumerate(ctpinThresholdsJSON): + # print(f"{i}: {x}") + #for i,x in enumerate(onlyInXML): + # print(f"{i}: {x}") + + def compareL1MenusXMLwithJSON(self): if self.r22_l1_xml is None or self.r22_l1_json is None: return - l1items_xml = self.r22_l1_xml.getL1Items() + l1items_xml = self.r22_l1_xml.find("TriggerMenu").findall("TriggerItem") l1items_json = self.r22_l1_json.items() log.info("Comparing the r22-xml and r22-json") log.info("==================================") - itemNames_xml = [x['name'] for x in l1items_xml] + itemNames_xml = [x.attrib['name'] for x in l1items_xml] itemNames_json = l1items_json.keys() - legacyItemNames_json = [x['name'] for x in l1items_json.values() if 'legacy' in x ] - ids_xml = dict([ (x['name'],int(x['ctpid'])) for x in l1items_xml]) + ids_xml = dict([ (x.attrib['name'],int(x.attrib['ctpid'])) for x in l1items_xml]) ids_json = dict([ (x['name'],x['ctpid']) for x in l1items_json.values()]) - legacyItemsOnlyInJson = list( set(legacyItemNames_json) - set(itemNames_xml) ) - itemsOnlyInXML = list( set(itemNames_xml) - set(itemNames_json) ) - # CHECK 1 + # CHECK 1: All items migrated + itemsOnlyInXML = list( set(itemNames_xml) - set(itemNames_json) ) cc = len(self.check) self.check += [ len(itemsOnlyInXML)==0 ] - log.info("CHECK %i: All items from r22 xml should be in json: %s", cc, boolStr(self.check[cc]) ) + log.info("CHECK %i: All items from r22 xml must be migrated: %s", cc, boolStr(self.check[cc]) ) if not self.check[cc]: - log.debug("These %i items are in xml but not in json (but should be!):", len(itemsOnlyInXML)) + log.debug("These %i legacy items are not migrated:", len(itemsOnlyInXML)) for x in itemsOnlyInXML: log.debug(" %s", x) - # CHECK 2 + + # CHECK 2: No new legacy items + legacyItemNames_json = [x['name'] for x in l1items_json.values() if 'legacy' in x ] + legacyItemsOnlyInJson = list( set(legacyItemNames_json) - set(itemNames_xml) ) cc = len(self.check) self.check += [ len(legacyItemsOnlyInJson)==0 ] - log.info("CHECK %i: There should be no legacy items in json that are not in xml: %s", cc, boolStr(self.check[cc]) ) + log.info("CHECK %i: There should be no extra legacy items in json that are not in xml: %s", cc, boolStr(self.check[cc]) ) if not self.check[cc]: log.debug("These %i legacy items are new in the json version (should be none!)" , len(legacyItemsOnlyInJson)) for x in legacyItemsOnlyInJson: log.debug(" %s", x) - # CHECK 3 + # CHECK 3: CTPID match inboth = set(itemNames_json).intersection(set(itemNames_xml)) noMatchId = [] for name in sorted(inboth): @@ -347,6 +400,193 @@ class MenuComp: + def compareL1TopoMenusRun3(self): + if self.r22_topo is None or self.r22_l1_json is None: + return + log.info("Checking Run 3 L1Topo migration") + log.info("===============================") + + OL = namedtuple('OL','board, fpga, clock, bit, triggerline') + ALG = namedtuple('A','id, triggerline') + AP = namedtuple('AP', 'name, klass, inputs, outputs, gPars, vPars') + + # triggerlines + r2_xml = [] + # algos + r2_algos_xml = {} + r2_algDefs_xml = {} + + # extract info from xml file + for output in (dict(x.items()) for x in self.r22_topo.find('OutputList')): + algoname = output["algname"] + algoId = int(output["algoId"]) + board = int(output["module"]) + fpga = int(output['fpga']) + clock = int(output['clock']) + bit = int(output['firstbit']) + triggerline = output['triggerline'].split(',') + for tl in triggerline: + tl = tl.replace('.','p') + r2_xml.append( OL(board=board+2, fpga=fpga, clock=clock, bit=bit, triggerline=tl) ) + r2_algos_xml[algoname.replace('.','p')] = ALG( id = algoId, triggerline=','.join(triggerline)) + bit += 1 + + for sa in chain( self.r22_topo.iterfind('SortAlgo'), + self.r22_topo.iterfind('DecisionAlgo') ): + isSortAlg = "value" in sa.find("Fixed").find("Output").attrib + algName = sa.get('name') + algType = sa.get('type') + algId = int(sa.get('algoId')) + fixedParam = sa.find("Fixed") + inputs = [ x.attrib['value'] for x in fixedParam.iterfind("Input") ] + if isSortAlg: + outputs = [ fixedParam.find("Output").attrib["value"] ] + else: + outputs = [] + for o in fixedParam.find("Output").iterfind("Bit"): + outputs += [ o.attrib['name'].replace('.','p') ] + gpars = {} + for x in fixedParam.iterfind("Generic"): + gpars[x.attrib['name']] = x.attrib['value'] + allvPars = sa.find("Variable").findall("Parameter") + vpars = len(allvPars) * [None] + for x in allvPars: + vpars[int(x.attrib['pos'])] = (x.attrib['name'],x.attrib['value'],x.get('selection')) + r2_algDefs_xml[algName.replace('.','p')] = AP( name = algName, klass = algType, inputs = inputs, outputs = outputs, gPars = gpars, vPars = vpars) + r2_algos_xml[algName.replace('.','p')] = ALG( id = algId, triggerline = ','.join(outputs)) + + # json connector names + r3_json = [] + topoConn_json = self.r22_l1_json['connectors'] + for board in [2,3]: + for fpga in [0,1]: + for clock in [0,1]: + set1 = topoConn_json['Topo%iEl' % board]['triggerlines']['fpga%i' % fpga]['clock%i' % clock] + for tl in set1: + tl_name = tl['name'].split('_',1)[-1] + bit = tl['startbit'] + r3_json.append( OL(board=board, fpga=fpga, clock=clock, bit=bit, triggerline=tl_name) ) + + + # CHECK 1: topo lines + linesOnlyInR2Xml = sorted(set([x for x in r2_xml]) - set([x for x in r3_json])) + linesOnlyInR3Json = sorted(set([x for x in r3_json]) - set([x for x in r2_xml])) + cc = len(self.check) + self.check += [ len(linesOnlyInR3Json) + len(linesOnlyInR2Xml)==0 ] + log.info("CHECK %i: Topo lines must match: %s", cc, boolStr(self.check[cc]) ) + if not self.check[cc]: + if len(linesOnlyInR2Xml)>0: + log.debug("These %i topo lines are missing in the new L1 menu" , len(linesOnlyInR2Xml)) + for x in linesOnlyInR2Xml: + log.debug(f" {x.triggerline} on board {x.board}, fpga {x.fpga}, clock {x.clock}, bit {x.bit}") + if len(linesOnlyInR3Json)>0: + log.debug("These %i legacy topo items are new in the legacy part of the new L1 menu" , len(linesOnlyInR3Json)) + for x in linesOnlyInR3Json: + log.debug(f" {x.triggerline} on board {x.board}, fpga {x.fpga}, clock {x.clock}, bit {x.bit}") + + + # CHECK 2: Algo names + r3_algos_json = {} + for algName,algDef in self.r22_l1_json['topoAlgorithms']['TOPO']['decisionAlgorithms'].items(): + r3_algos_json[algName] = ALG( id = algDef['algId'], triggerline=','.join(algDef['output'])) + for algName,algDef in self.r22_l1_json['topoAlgorithms']['TOPO']['sortingAlgorithms'].items(): + r3_algos_json[algName] = ALG( id = algDef['algId'], triggerline=','.join(algDef['output'])) + algosOnlyInR2Xml = sorted(set(r2_algos_xml) - set(r3_algos_json)) + algosOnlyInR3Json = sorted(set(r3_algos_json) - set(r2_algos_xml)) + cc = len(self.check) + self.check += [ len(algosOnlyInR2Xml) + len(algosOnlyInR3Json)==0 ] + log.info("CHECK %i: Algorithm names must match: %s", cc, boolStr(self.check[cc]) ) + if not self.check[cc]: + if len(algosOnlyInR2Xml)>0: + log.debug("These %i legacy topo algoriths are missing in the legacy part of the new L1 menu" , len(algosOnlyInR2Xml)) + for algName in algosOnlyInR2Xml: + log.debug(f" {algName}") + if len(algosOnlyInR3Json)>0: + log.debug("These %i legacy topo items are new in the legacy part of the new L1 menu" , len(algosOnlyInR3Json)) + for algName in algosOnlyInR3Json: + log.debug(f" {algName}") + + + # CHECK algo class match + klassMismatch = [] + for (algName, algDef) in chain( self.r22_l1_json['topoAlgorithms']['TOPO']['sortingAlgorithms'].items(), + self.r22_l1_json['topoAlgorithms']['TOPO']['decisionAlgorithms'].items()): + if algName not in r2_algDefs_xml: + continue + r2alg = r2_algDefs_xml[algName] + if algDef['klass'] != r2alg.klass: + klassMismatch += [ (algName, r2alg.klass, algDef['klass']) ] + cc = len(self.check) + self.check += [ len(klassMismatch)==0 ] + log.info("CHECK %i: All class names must match: %s", cc, boolStr(self.check[cc]) ) + if not self.check[cc]: + for algName, r2klass, r3klass in klassMismatch: + log.debug(f"Class of algorithm {algName} changes from {r2klass} to {r3klass}") + + + # CHECK: properties match + fixedPropertyMismatch = [] + varPropertyMismatch = [] + varNumberMismatch = [] + for (algName, algDef) in chain( self.r22_l1_json['topoAlgorithms']['TOPO']['sortingAlgorithms'].items(), + self.r22_l1_json['topoAlgorithms']['TOPO']['decisionAlgorithms'].items() ): + if algName not in r2_algDefs_xml: + continue + r2alg = r2_algDefs_xml[algName] + if _liststr(r2alg.inputs) != _liststr(algDef['input']): + fixedPropertyMismatch += [ (algName, "Input", _liststr(r2alg.inputs), _liststr(algDef['input'])) ] + if _liststr(r2alg.outputs) != _liststr(algDef['output']): + fixedPropertyMismatch += [ (algName, "Output", _liststr(r2alg.outputs), _liststr(algDef['output'])) ] + for (gname, gval) in algDef['fixedParameters']['generics'].items(): + if r2alg.gPars[gname] != str(gval['value']): + fixedPropertyMismatch += [ (algName, "Generic parameter " + gname, r2alg.gPars[gname], str(gval['value'])) ] + if len(algDef['variableParameters']) != len(r2alg.vPars): + varNumberMismatch += [ (algName, len(r2alg.vPars), len(algDef['variableParameters'])) ] + else: + for pos,par in enumerate(algDef['variableParameters']): + if r2alg.vPars[pos][0] != par['name']: + varPropertyMismatch += [ (algName, pos, "name", r2alg.vPars[pos][0], par['name']) ] + if r2alg.vPars[pos][1] != str(par['value']): + varPropertyMismatch += [ (algName, "%i (%s)" % (pos,par['name']), "value", r2alg.vPars[pos][1], str(par['value'])) ] + if par.get('selection') is not None or r2alg.vPars[pos][2] in range(1,10): + if str(r2alg.vPars[pos][2]) != str(par.get('selection')): + varPropertyMismatch += [ (algName, pos, "selection", r2alg.vPars[pos][2], par.get('selection')) ] + + + # CHECK number variables + cc = len(self.check) + self.check += [ len(varNumberMismatch)==0 ] + log.info("CHECK %i: Number of algorithm variable parameters must match: %s", cc, boolStr(self.check[cc]) ) + if not self.check[cc]: + for algName, l1, l2 in varNumberMismatch: + log.debug(f" Number of variable parameters for algorithm {algName} changes from {l1} to {l2}") + + + # CHECK algorithm properties + cc = len(self.check) + self.check += [ len(fixedPropertyMismatch) + len(varPropertyMismatch) ==0 ] + log.info( "CHECK %i: Algorithm property values must match: %s", cc, boolStr(self.check[cc]) ) + if not self.check[cc]: + for algName, var, r2val, r3val in fixedPropertyMismatch: + log.debug(f" {var} of algorithm {algName} changes from {r2val} to {r3val}") + for (algName, pos, nameOrVal, r2, r3) in varPropertyMismatch: + log.debug(f" Variable parameter at pos {pos} of algorithm {algName} changes {nameOrVal} from {r2} to {r3}") + + + + + + + + + + + + + + + + def main(): if len(sys.argv) <3: @@ -356,10 +596,13 @@ def main(): mc.compareL1MenusXMLwithJSON() + mc.compareCTPIN() + mc.checkHltInputsPresent() mc.compareL1TopoMenusRun2Legacy() - + + mc.compareL1TopoMenusRun3() return 0 diff --git a/Trigger/TriggerCommon/TriggerMenuMT/scripts/trigL1MenuMigrationCheck.sh b/Trigger/TriggerCommon/TriggerMenuMT/scripts/trigL1MenuMigrationCheck.sh new file mode 100755 index 0000000000000000000000000000000000000000..5c1d9f62a4ed7148c4c1d77356e06dbda4d8aebb --- /dev/null +++ b/Trigger/TriggerCommon/TriggerMenuMT/scripts/trigL1MenuMigrationCheck.sh @@ -0,0 +1,47 @@ +#!/bin/env sh + +testdir=tmp +rm -rf ${testdir} +mkdir ${testdir} +cd ${testdir} +mkdir log + +echo "Test directory: ${testdir}/" +echo "Log files directory: ${testdir}/log/" +echo "AtlasVersion = ${AtlasVersion}" + +echo "Generating L1 menus: L1Topoconfig_LS2_v1_${AtlasVersion}.xml LVL1config_LS2_v1_${AtlasVersion}.xml L1Menu_LS2_v1_${AtlasVersion}.json" +cmd="generateL1MenuMT.sh LS2_v1" +echo "Command:" > ./log/l1menuGeneration.log +echo "${cmd}" >> ./log/l1menuGeneration.log +echo "Output:" >> ./log/l1menuGeneration.log +${cmd} >> ./log/l1menuGeneration.log 2>&1 + +echo "Generating HLT menu: HLTMenu_LS2_v1_${AtlasVersion}.json" +DS=/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/TriggerTest/valid1.410000.PowhegPythiaEvtGen_P2012_ttbar_hdamp172p5_nonallhad.merge.RDO.e4993_s3214_r11315/RDO.17533168._000001.pool.root.1 +echo "Command:" > ./log/hltmenuGeneration.log +echo "DS=${DS}" >> ./log/hltmenuGeneration.log +echo "Output:" >> ./log/hltmenuGeneration.log +echo "athena.py -b -c \"endJobAfterGenerate=True;setMenu='LS2_v1'\" --threads=1 --filesInput=${DS} TriggerJobOpts/runHLT_standalone.py" >> ./log/hltmenuGeneration.log +athena.py -b -c "endJobAfterGenerate=True;setMenu='LS2_v1'" --threads=1 --filesInput=${DS} TriggerJobOpts/runHLT_standalone.py >> ./log/hltmenuGeneration.log 2>&1 + +# generate EB run 360026 files: LVL1 menu LVL1config_SMK_2749.xml, HLTconfig_SMK_2749.xml, L1TopoConfig_SMK_2749.xml +echo "Downloading L1Topo menu from EB run 360026: L1TopoConfig_SMK_2749.xml" +cmd="TrigConfReadWrite -i TRIGGERDB 2749 -o xml SMK_2749" +echo "Command:" > ./log/run2L1TopoDownload.log +echo "${cmd}" >> ./log/run2L1TopoDownload.log +echo "Output:" >> ./log/run2L1TopoDownload.log +${cmd} >> ./log/run2L1TopoDownload.log 2>&1 + +cmd="trigCompareOldandNewL1Menus.py \ +L1Menu_LS2_v1_${AtlasVersion}.json \ +LVL1config_LS2_v1_${AtlasVersion}.xml \ +HLTMenu_LS2_v1_${AtlasVersion}.json \ +L1Topoconfig_LS2_v1_${AtlasVersion}.xml \ +L1TopoConfig_SMK_2749.xml" + +echo "Running menu comparison" +echo "Command:" +echo "${cmd}" +echo "Output:" +${cmd}