diff --git a/Calorimeter/CaloRec/src/CaloTopoClusterMaker.cxx b/Calorimeter/CaloRec/src/CaloTopoClusterMaker.cxx index fa627c12b0190286b7410278cbea4621e49260cb..f8265012137791c30e6ff08a2a26fab87a81c796 100644 --- a/Calorimeter/CaloRec/src/CaloTopoClusterMaker.cxx +++ b/Calorimeter/CaloRec/src/CaloTopoClusterMaker.cxx @@ -45,6 +45,7 @@ #include "CaloProtoCluster.h" using CLHEP::MeV; +using CLHEP::ns; //############################################################################# @@ -59,6 +60,7 @@ CaloTopoClusterMaker::CaloTopoClusterMaker(const std::string& type, m_cellThresholdOnEorAbsEinSigma ( 0.), m_neighborThresholdOnEorAbsEinSigma( 3.), m_seedThresholdOnEorAbsEinSigma ( 6.), + m_seedThresholdOnTAbs ( 12.5*ns), m_neighborOption ("super3D"), m_nOption (LArNeighbours::super3D), m_restrictHECIWandFCalNeighbors (false), @@ -69,6 +71,7 @@ CaloTopoClusterMaker::CaloTopoClusterMaker(const std::string& type, m_clusterEtorAbsEtCut ( 0.*MeV), m_twogaussiannoise (false), m_treatL1PredictedCellsAsGood (true), + m_seedCutsInT (false), m_minSampling (0), m_maxSampling (0), m_hashMin (999999), @@ -96,6 +99,12 @@ CaloTopoClusterMaker::CaloTopoClusterMaker(const std::string& type, // Seed and cluster cuts are in E or Abs E declareProperty("SeedCutsInAbsE",m_seedCutsInAbsE); + // Time thresholds (in abs. val.) + declareProperty("SeedThresholdOnTAbs",m_seedThresholdOnTAbs); + + //do Seed cuts on Time + declareProperty("SeedCutsInT",m_seedCutsInT); + // Neighbor cuts are in E or Abs E declareProperty("NeighborCutsInAbsE",m_neighborCutsInAbsE); @@ -362,11 +371,12 @@ CaloTopoClusterMaker::execute(const EventContext& ctx, float signedRatio = epsilon; // not 0 in order to keep bad cells if ( finite(noiseSigma) && noiseSigma > 0 && !CaloBadCellHelper::isBad(pCell,m_treatL1PredictedCellsAsGood) ) signedRatio = signedE/noiseSigma; + 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; - - if ( passedCellCut || passedNeighborCut || passedSeedCut ) { + bool passedSeedAndTimeCut = (passedSeedCut && (!m_seedCutsInT || passCellTimeCut(pCell))); + if ( passedCellCut || passedNeighborCut || passedSeedAndTimeCut ) { const CaloDetDescrElement* dde = pCell->caloDDE(); IdentifierHash hashid = dde ? dde->calo_hash() : m_calo_id->calo_cell_hash(pCell->ID()); CaloTopoTmpClusterCell *tmpClusterCell = @@ -390,14 +400,14 @@ CaloTopoClusterMaker::execute(const EventContext& ctx, } #endif HashCell hashCell(tmpClusterCell); - if ( passedNeighborCut || passedSeedCut ) { + if ( passedNeighborCut || passedSeedAndTimeCut ) { HashCluster *tmpCluster = new (tmpclus_pool.allocate()) HashCluster (tmplist_pool); tmpClusterCell->setCaloTopoTmpHashCluster(tmpCluster); tmpCluster->add(hashCell); myHashClusters.push_back(tmpCluster); int caloSample = dde ? dde->getSampling() : m_calo_id->calo_sample(pCell->ID()); - if ( passedSeedCut + if ( passedSeedAndTimeCut && caloSample >= m_minSampling && caloSample <= m_maxSampling && m_useSampling[caloSample-m_minSampling]) { @@ -648,3 +658,22 @@ void CaloTopoClusterMaker::getClusterSize(){ ATH_MSG_DEBUG( "Cluster size = " << m_clusterSize); return; } + + +inline bool CaloTopoClusterMaker::passCellTimeCut(const CaloCell* pCell) const { + // get the cell time to cut on (the same as in CaloEvent/CaloCluster.h) + + // need sampling number already for time + CaloSampling::CaloSample sam = pCell->caloDDE()->getSampling(); + // check for unknown sampling + if (sam != CaloSampling::PreSamplerB && sam != CaloSampling::PreSamplerE && sam != CaloSampling::Unknown) { + const unsigned pmask= pCell->caloDDE()->is_tile() ? 0x8080 : 0x2000; + //0x2000 is used to tell that time and quality information are available for this channel + //(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 true; +} diff --git a/Calorimeter/CaloRec/src/CaloTopoClusterMaker.h b/Calorimeter/CaloRec/src/CaloTopoClusterMaker.h index 91040ba3e280c4316d4af439bc1e090092556a44..353484508ce349a718c82a97f822e62d6a19770f 100644 --- a/Calorimeter/CaloRec/src/CaloTopoClusterMaker.h +++ b/Calorimeter/CaloRec/src/CaloTopoClusterMaker.h @@ -62,6 +62,8 @@ public: void getClusterSize(); private: + + inline bool passCellTimeCut(const CaloCell*) const; const CaloCell_ID* m_calo_id; @@ -127,6 +129,13 @@ private: * would be included in both clusters. */ float m_seedThresholdOnEorAbsEinSigma; + + /** + * threshold used for timing cut. Implemented as |seed_cell_time|<m_seedThresholdOnTAbs. No such cut on neighbouring cells.*/ + float m_seedThresholdOnTAbs; + + + /** @brief Key of the CaloNoise Conditions data object. Typical values are '"electronicNoise', 'pileupNoise', or '"totalNoise' (default) */ @@ -225,7 +234,12 @@ private: * @brief if set to true treat cells with a dead OTX which can be * predicted by L1 trigger info as good instead of bad cells */ bool m_treatL1PredictedCellsAsGood; - + + /** + * if set to true, time cut is applied to seed cells, no cut otherwise + */ + bool m_seedCutsInT; + /** * @brief vector of names of the calorimeter samplings to consider * for seeds.