diff --git a/Calorimeter/CaloRec/python/CaloClusterTopoGetter.py b/Calorimeter/CaloRec/python/CaloClusterTopoGetter.py index 6bb4f7a8b29a490cd1e68c223d4aeba1b9ba0a93..2e494c623fc39b11d5e6cf920b0731dbc1829d72 100644 --- a/Calorimeter/CaloRec/python/CaloClusterTopoGetter.py +++ b/Calorimeter/CaloRec/python/CaloClusterTopoGetter.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 # # @@ -364,6 +364,7 @@ class CaloClusterTopoGetter ( Configured ) : TopoMaker.SeedThresholdOnEorAbsEinSigma = 4.0 #timing TopoMaker.SeedCutsInT = jobproperties.CaloTopoClusterFlags.doTimeCut() + TopoMaker.CutOOTseed = jobproperties.CaloTopoClusterFlags.extendTimeCut() and jobproperties.CaloTopoClusterFlags.doTimeCut() # note E or AbsE # diff --git a/Calorimeter/CaloRec/python/CaloTopoClusterFlags.py b/Calorimeter/CaloRec/python/CaloTopoClusterFlags.py index 5e12682f84a897d0a37b13c1eaf1087114ddcf7e..fe312414eb2ec93b3d928eb64f18b8f7d4d7add1 100644 --- a/Calorimeter/CaloRec/python/CaloTopoClusterFlags.py +++ b/Calorimeter/CaloRec/python/CaloTopoClusterFlags.py @@ -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: CaloTopoClusterFlags.py,v 1.5 2009-05-04 16:23:04 lochp Exp $ @@ -118,6 +118,14 @@ class doTimeCut(JobProperty): StoredValue=False +class extendTimeCut(JobProperty): + """ + """ + statusOn=True + allowedTypes=['bool'] + StoredValue=False + + # add the flags container to the top container jobproperties.add_Container(CaloTopoClusterFlags) @@ -139,6 +147,7 @@ list_jobproperties = [ ,doTreatEnergyCutAsAbsolute ,doMomentsfromAbs ,doTimeCut + ,extendTimeCut ] for i in list_jobproperties: diff --git a/Calorimeter/CaloRec/src/CaloTopoClusterMaker.cxx b/Calorimeter/CaloRec/src/CaloTopoClusterMaker.cxx index 69ce4b62dd38a6adf44087f8669a22946291bb14..9e5f534e2a52f4752b10fe89866ea81e3e747e36 100644 --- a/Calorimeter/CaloRec/src/CaloTopoClusterMaker.cxx +++ b/Calorimeter/CaloRec/src/CaloTopoClusterMaker.cxx @@ -73,6 +73,7 @@ CaloTopoClusterMaker::CaloTopoClusterMaker(const std::string& type, m_twogaussiannoise (false), m_treatL1PredictedCellsAsGood (true), m_seedCutsInT (false), + m_cutOOTseed (false), m_minSampling (0), m_maxSampling (0), m_hashMin (999999), @@ -105,6 +106,9 @@ CaloTopoClusterMaker::CaloTopoClusterMaker(const std::string& type, //do Seed cuts on Time declareProperty("SeedCutsInT",m_seedCutsInT); + //exclude out-of-time seeds from neighbouring and cell stage + declareProperty("CutOOTseed",m_cutOOTseed); + // Neighbor cuts are in E or Abs E declareProperty("NeighborCutsInAbsE",m_neighborCutsInAbsE); @@ -376,8 +380,17 @@ CaloTopoClusterMaker::execute(const EventContext& ctx, bool passedCellCut = (m_cellCutsInAbsE?std::abs(signedRatio):signedRatio) > m_cellThresholdOnEorAbsEinSigma; bool passedNeighborCut = (m_neighborCutsInAbsE?std::abs(signedRatio):signedRatio) > m_neighborThresholdOnEorAbsEinSigma; bool passedSeedCut = (m_seedCutsInAbsE?std::abs(signedRatio):signedRatio) > m_seedThresholdOnEorAbsEinSigma; - bool passedSeedAndTimeCut = (passedSeedCut && (!m_seedCutsInT || passCellTimeCut(pCell))); - if ( passedCellCut || passedNeighborCut || passedSeedAndTimeCut ) { + + bool passTimeCut_seedCell = (!m_seedCutsInT || passCellTimeCut(pCell,m_seedThresholdOnTAbs)); + bool passedSeedAndTimeCut = (passedSeedCut && passTimeCut_seedCell); + + bool passedNeighborAndTimeCut = passedNeighborCut; + if(m_cutOOTseed && passedSeedCut && !passTimeCut_seedCell) passedNeighborAndTimeCut=false; //exclude Out-Of-Time seeds from neighbouring stage as well (if required) + + bool passedCellAndTimeCut = passedCellCut; + if(m_cutOOTseed && passedSeedCut && !passTimeCut_seedCell) passedCellAndTimeCut=false; //exclude Out-Of-Time seeds from cluster (if required) + + if ( passedCellAndTimeCut || passedNeighborAndTimeCut || passedSeedAndTimeCut ) { const CaloDetDescrElement* dde = pCell->caloDDE(); IdentifierHash hashid = dde ? dde->calo_hash() : m_calo_id->calo_cell_hash(pCell->ID()); CaloTopoTmpClusterCell *tmpClusterCell = @@ -401,7 +414,7 @@ CaloTopoClusterMaker::execute(const EventContext& ctx, } #endif HashCell hashCell(tmpClusterCell); - if ( passedNeighborCut || passedSeedAndTimeCut ) { + if ( passedNeighborAndTimeCut || passedSeedAndTimeCut ) { HashCluster *tmpCluster = new (tmpclus_pool.allocate()) HashCluster (tmplist_pool); tmpClusterCell->setCaloTopoTmpHashCluster(tmpCluster); @@ -659,7 +672,7 @@ void CaloTopoClusterMaker::getClusterSize(){ } -inline bool CaloTopoClusterMaker::passCellTimeCut(const CaloCell* pCell) const { +inline bool CaloTopoClusterMaker::passCellTimeCut(const CaloCell* pCell,float threshold) const { // get the cell time to cut on (the same as in CaloEvent/CaloCluster.h) // need sampling number already for time @@ -671,7 +684,7 @@ inline bool CaloTopoClusterMaker::passCellTimeCut(const CaloCell* pCell) const { //(from TWiki: https://twiki.cern.ch/twiki/bin/viewauth/AtlasComputing/CaloEventDataModel#The_Raw_Data_Model) // Is time defined? if(pCell->provenance() & pmask) { - return std::abs(pCell->time())<m_seedThresholdOnTAbs; + return std::abs(pCell->time())<threshold; } } return true; diff --git a/Calorimeter/CaloRec/src/CaloTopoClusterMaker.h b/Calorimeter/CaloRec/src/CaloTopoClusterMaker.h index 353484508ce349a718c82a97f822e62d6a19770f..ed3f8a7b1d70a4557e968f59e7d17454636cb7af 100644 --- a/Calorimeter/CaloRec/src/CaloTopoClusterMaker.h +++ b/Calorimeter/CaloRec/src/CaloTopoClusterMaker.h @@ -1,6 +1,6 @@ //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 */ #ifndef CALOTOPOCLUSTERMAKER_H @@ -63,7 +63,7 @@ public: private: - inline bool passCellTimeCut(const CaloCell*) const; + inline bool passCellTimeCut(const CaloCell*, float) const; const CaloCell_ID* m_calo_id; @@ -131,7 +131,7 @@ private: /** - * threshold used for timing cut. Implemented as |seed_cell_time|<m_seedThresholdOnTAbs. No such cut on neighbouring cells.*/ + * threshold used for timing cut on seed cells. Implemented as |seed_cell_time|<m_seedThresholdOnTAbs. No such cut on neighbouring cells.*/ float m_seedThresholdOnTAbs; @@ -240,6 +240,11 @@ private: */ bool m_seedCutsInT; + /** + * if set to true, seed cells failing the time cut are also excluded from cluster at all + */ + bool m_cutOOTseed; + /** * @brief vector of names of the calorimeter samplings to consider * for seeds.