diff --git a/Calorimeter/CaloRec/python/CaloClusterTopoGetter.py b/Calorimeter/CaloRec/python/CaloClusterTopoGetter.py index 6bb4f7a8b29a490cd1e68c223d4aeba1b9ba0a93..6d1cb8172c66bcaac4ce6c3d3f2a629641e6f5f3 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,9 @@ class CaloClusterTopoGetter ( Configured ) : TopoMaker.SeedThresholdOnEorAbsEinSigma = 4.0 #timing TopoMaker.SeedCutsInT = jobproperties.CaloTopoClusterFlags.doTimeCut() + TopoMaker.CutOOTseed = jobproperties.CaloTopoClusterFlags.extendTimeCut() and jobproperties.CaloTopoClusterFlags.doTimeCut() + TopoMaker.UseTimeCutUpperLimit = jobproperties.CaloTopoClusterFlags.useUpperLimitForTimeCut() + TopoMaker.TimeCutUpperLimit = 20.0 # note E or AbsE # diff --git a/Calorimeter/CaloRec/python/CaloConfigFlags.py b/Calorimeter/CaloRec/python/CaloConfigFlags.py index d21452e1f79257cf27b9056e5276ad9a405f169c..ac73c3e9645060bde7f296eff82413dd83008c9f 100644 --- a/Calorimeter/CaloRec/python/CaloConfigFlags.py +++ b/Calorimeter/CaloRec/python/CaloConfigFlags.py @@ -20,6 +20,9 @@ def createCaloConfigFlags(): ccf.addFlag("Calo.TopoCluster.doTwoGaussianNoise",True) ccf.addFlag("Calo.TopoCluster.doTreatEnergyCutAsAbsolute",False) ccf.addFlag("Calo.TopoCluster.doTopoClusterLocalCalib",True) + ccf.addFlag("Calo.TopoCluster.doTimeCut",False) + ccf.addFlag("Calo.TopoCluster.extendTimeCut",False) + ccf.addFlag("Calo.TopoCluster.useUpperLimitForTimeCut",False) #### Cluster correction flags: # If true, then reweight cells to prevent double-counting between clusters. diff --git a/Calorimeter/CaloRec/python/CaloTopoClusterConfig.py b/Calorimeter/CaloRec/python/CaloTopoClusterConfig.py index c529a81dc5692111fcb246ff074f7a8b4c68ebb8..7f334ebd4458aafe89e96d7e0028bfc962d7c952 100644 --- a/Calorimeter/CaloRec/python/CaloTopoClusterConfig.py +++ b/Calorimeter/CaloRec/python/CaloTopoClusterConfig.py @@ -288,6 +288,12 @@ def CaloTopoClusterCfg(configFlags,cellsname="AllCalo",clustersname="",doLCCalib TopoMaker.CellThresholdOnEorAbsEinSigma = 0.0 TopoMaker.NeighborThresholdOnEorAbsEinSigma = 2.0 TopoMaker.SeedThresholdOnEorAbsEinSigma = 4.0 + + #timing + TopoMaker.SeedCutsInT = configFlags.Calo.TopoCluster.doTimeCut + TopoMaker.CutOOTseed = configFlags.Calo.TopoCluster.extendTimeCut and configFlags.Calo.TopoCluster.doTimeCut + TopoMaker.UseTimeCutUpperLimit = configFlags.Calo.TopoCluster.useUpperLimitForTimeCut + TopoMaker.TimeCutUpperLimit = 20.0 # note E or AbsE # diff --git a/Calorimeter/CaloRec/python/CaloTopoClusterFlags.py b/Calorimeter/CaloRec/python/CaloTopoClusterFlags.py index 5e12682f84a897d0a37b13c1eaf1087114ddcf7e..8870666a20b1cdeed22dffe86b3d827a1655d190 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,20 @@ class doTimeCut(JobProperty): StoredValue=False +class extendTimeCut(JobProperty): + """ + """ + statusOn=True + allowedTypes=['bool'] + StoredValue=False + +class useUpperLimitForTimeCut(JobProperty): + """ + """ + statusOn=True + allowedTypes=['bool'] + StoredValue=False + # add the flags container to the top container jobproperties.add_Container(CaloTopoClusterFlags) @@ -139,6 +153,8 @@ list_jobproperties = [ ,doTreatEnergyCutAsAbsolute ,doMomentsfromAbs ,doTimeCut + ,extendTimeCut + ,useUpperLimitForTimeCut ] for i in list_jobproperties: diff --git a/Calorimeter/CaloRec/src/CaloTopoClusterMaker.cxx b/Calorimeter/CaloRec/src/CaloTopoClusterMaker.cxx index 69ce4b62dd38a6adf44087f8669a22946291bb14..36adc570b2e15e169e50463ee65c16a8a8686279 100644 --- a/Calorimeter/CaloRec/src/CaloTopoClusterMaker.cxx +++ b/Calorimeter/CaloRec/src/CaloTopoClusterMaker.cxx @@ -62,6 +62,7 @@ CaloTopoClusterMaker::CaloTopoClusterMaker(const std::string& type, m_neighborThresholdOnEorAbsEinSigma( 3.), m_seedThresholdOnEorAbsEinSigma ( 6.), m_seedThresholdOnTAbs ( 12.5*ns), + m_timeCutUpperLimit ( 20.), m_neighborOption ("super3D"), m_nOption (LArNeighbours::super3D), m_restrictHECIWandFCalNeighbors (false), @@ -73,6 +74,8 @@ CaloTopoClusterMaker::CaloTopoClusterMaker(const std::string& type, m_twogaussiannoise (false), m_treatL1PredictedCellsAsGood (true), m_seedCutsInT (false), + m_cutOOTseed (false), + m_useTimeCutUpperLimit (false), m_minSampling (0), m_maxSampling (0), m_hashMin (999999), @@ -103,8 +106,15 @@ CaloTopoClusterMaker::CaloTopoClusterMaker(const std::string& type, // Time thresholds (in abs. val.) declareProperty("SeedThresholdOnTAbs",m_seedThresholdOnTAbs); + // Significance upper limit for applying time cut + declareProperty("TimeCutUpperLimit",m_timeCutUpperLimit); + //do Seed cuts on Time declareProperty("SeedCutsInT",m_seedCutsInT); + //exclude out-of-time seeds from neighbouring and cell stage + declareProperty("CutOOTseed",m_cutOOTseed); + //do not apply time cut on cells of large significance + declareProperty("UseTimeCutUpperLimit",m_useTimeCutUpperLimit); // Neighbor cuts are in E or Abs E declareProperty("NeighborCutsInAbsE",m_neighborCutsInAbsE); @@ -155,6 +165,9 @@ StatusCode CaloTopoClusterMaker::initialize() << m_cellThresholdOnEorAbsEinSigma ); + ATH_MSG_INFO( "Time cut option: " << ((!m_seedCutsInT) ? "None" : (m_cutOOTseed ? "Seed Extended" : "Seed"))); + ATH_MSG_INFO( "E/sigma veto on T cut: m_useTimeCutUpperLimit=" << (m_useTimeCutUpperLimit ? "true" : "false") << ", m_timeCutUpperLimit=" << m_timeCutUpperLimit); + //--- set Neighbor Option if ( m_neighborOption == "all2D" ) @@ -376,8 +389,18 @@ 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 applyTimeCut = m_seedCutsInT && !(m_useTimeCutUpperLimit && signedRatio > m_timeCutUpperLimit); + bool passTimeCut_seedCell = (!applyTimeCut || 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 +424,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 +682,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 +694,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..7d49e879f82c87f04c54aa153255f2909b35105b 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,9 +131,12 @@ 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; + /** + * upper limit on the energy significance, for applying the cell time cut */ + float m_timeCutUpperLimit; /** @brief Key of the CaloNoise Conditions data object. Typical values @@ -240,6 +243,16 @@ private: */ bool m_seedCutsInT; + /** + * if set to true, seed cells failing the time cut are also excluded from cluster at all + */ + bool m_cutOOTseed; + + /** + * if set to true, the time cut is not applied on cell of large significance + */ + bool m_useTimeCutUpperLimit; + /** * @brief vector of names of the calorimeter samplings to consider * for seeds.