ATLAS Offline Software
RingerReFex.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 
6 #ifndef TRIGT2CALOEGAMMA_RINGERREFEX_H
7 #define TRIGT2CALOEGAMMA_RINGERREFEX_H
8 
9 
10 #include <string>
11 #include "CaloGeoHelpers/CaloSampling.h"
12 #include "CaloEvent/CaloCell.h"
20 #include "../src/helpers/PhiComps.h"
21 #include "../src/helpers/VectorVectorIntParser.h"
23 
24 
26 {
27 
28  public:
29  class RingSet {
30 
31  public:
32  RingSet( unsigned int maxRings , double deta, double dphi,
33  const std::vector<int> &detectors,
34  const std::vector<int> &samplings,
35  const std::vector<int> &samples,
36  bool doQuarter, bool doEtaAxesDivision, bool doPhiAxesDivision);
37 
38  ~RingSet()=default;
39 
40  void buildRings( const double eta_hot, const double phi_hot,const CaloNoise* noiseCDO, const double m_noiseFactor, const bool m_doNoiseThrRings);
41 
42  const std::vector<double>& rings() const;
43  const std::vector<std::pair<int,int>> detectors() const;
44  bool isValid( const CaloCell * ) const;
45  void push_back( const CaloCell * );
46  void clear();
47  void fill_cells_info(std::vector<float> &cells_eta, std::vector<float> &cells_phi, std::vector<float> &cells_et, std::vector<int> &cells_sampling, std::vector<int> &cells_size, std::vector < double > &rings_sum, std::vector <int> &cells_id, std::vector <float> &cells_gain);
48 
49  private:
50 
52  std::vector<int> m_detectors, m_samplings, m_samples;
54 
55  std::vector<const CaloCell*> m_cells;
56  std::vector<double> m_rings;
57  };
58 
59 
60  public:
61 
62  RingerReFex(const std::string& type, const std::string& name, const IInterface* parent);
63  virtual ~RingerReFex () { };
64 
66 
67  virtual StatusCode initialize() override;
68 
69  virtual StatusCode execute(xAOD::TrigEMCluster &emCluster,
70  const IRoiDescriptor& roi,
71  const CaloDetDescrElement*& /*caloDDE*/,
72  const EventContext& context) const override;
73 
74  StatusCode prepareRinger(std::vector<RingerReFex::RingSet>& vec_rs,
75  const xAOD::TrigEMCluster& emCluster,
76  const IRoiDescriptor& roi,
77  const EventContext& context) const;
78 
79  private:
80 
81 
82  bool configurationInvalid();
83 
84  inline bool maxCell ( const CaloCell* cell, double &energy, const double eta_ref, const double phi_ref ) const;
85 
86  void printRings( std::vector<RingSet> &, const xAOD::TrigEMCluster & ) const;
87 
88 
89 
90  ToolHandle< GenericMonitoringTool > m_monTool { this, "MonTool", "", "Monitoring tool"};
91  SG::WriteHandleKey<xAOD::TrigRingerRingsContainer> m_ringerContainerKey {this, "RingerKey", "HLT_FastCaloRinger", "TrigRingerRings container key"};
92  SG::ReadHandleKey<xAOD::TrigEMClusterContainer> m_clusterContainerKey {this, "ClustersName", "HLT_FastCaloEMClusters", "TrigEMCluster container key"};
93  SG::ReadCondHandleKey<CaloNoise> m_noiseCDOKey{this,"CaloNoiseKey","totalNoise","SG Key of CaloNoise data object"};
94 
95  Gaudi::Property<double> m_etaSearchWindowSize {this, "EtaSearchWindowSize", 0.1, ""};
96  Gaudi::Property<double> m_phiSearchWindowSize {this, "PhiSearchWindowSize", 0.1, ""};
97  Gaudi::Property<std::vector<float>> m_deltaEta {this, "DeltaEta" , {} , "Eta step for each layer" };
98  Gaudi::Property<std::vector<float>> m_deltaPhi {this, "DeltaPhi" , {} , "Phi step for each layer" };
99  Gaudi::Property<std::vector<unsigned int>> m_nRings {this, "NRings" , {} , "Number of rings for each layer" };
100  Gaudi::Property<std::vector<float>> m_etaBins {this, "EtaBins" , {} , "Eta bins range cover by the reconstruction."};
101  Gaudi::Property<std::vector<std::vector<int>>> m_detectors {this, "Detectors" , {} , "" };
102  Gaudi::Property<std::vector<std::vector<int>>> m_samplings {this, "Samplings" , {} , "" };
103  Gaudi::Property<std::vector<std::vector<int>>> m_samples {this, "Samples" , {} , "samples per layer" };
104 
105  Gaudi::Property<bool> m_useTile {this, "UseTile" , true , "Use tile cells" };
106  Gaudi::Property<bool> m_dumpCells {this, "DumpCells" , false , "Dump Ringer Cells Information" };
107  Gaudi::Property<bool> m_doNoiseThrRings {this, "DoNoiseThrRings" , false , "Building rings with noise threshold" };
108  Gaudi::Property<double> m_noiseFactor {this, "NoiseFactor" , 2.0, "Building rings above a factor sigma noise" };
109  Gaudi::Property<bool> m_globalCenter{this, "GlobalCenter", false, "Use cluster position as center" };
110  Gaudi::Property<std::vector<bool>> m_doQuarter {this, "DoQuarter", {} , "Do Quarter Rings" };
111  Gaudi::Property<std::vector<bool>> m_doEtaAxesDivision{this, "DoEtaAxesDivision", {} , "Do Eta axes division" };
112  Gaudi::Property<std::vector<bool>> m_doPhiAxesDivision{this, "DoPhiAxesDivision",{}, "Do Phi axes division" };
113 
114 
115 
116 };
117 #endif
ReadHandleKey.h
Property holding a SG store/key/clid from which a ReadHandle is made.
TrigRingerRingsContainer.h
RingerReFex::RingSet::buildRings
void buildRings(const double eta_hot, const double phi_hot, const CaloNoise *noiseCDO, const double m_noiseFactor, const bool m_doNoiseThrRings)
=================================================================================
Definition: RingerReFex.cxx:460
RingerReFex::prepareRinger
StatusCode prepareRinger(std::vector< RingerReFex::RingSet > &vec_rs, const xAOD::TrigEMCluster &emCluster, const IRoiDescriptor &roi, const EventContext &context) const
Definition: RingerReFex.cxx:94
ReadCellNoiseFromCool.cell
cell
Definition: ReadCellNoiseFromCool.py:53
RingerReFex::m_noiseFactor
Gaudi::Property< double > m_noiseFactor
Definition: RingerReFex.h:108
RingerReFex::m_phiSearchWindowSize
Gaudi::Property< double > m_phiSearchWindowSize
Definition: RingerReFex.h:96
IReAlgToolCalo::execute
virtual StatusCode execute(xAOD::TrigEMCluster &ptrigEMCluster, const IRoiDescriptor &roi, const CaloDetDescrElement *&caloDDE, const EventContext &context) const =0
This is the execute method for Egamma Algorithms.
RingerReFex::m_doPhiAxesDivision
Gaudi::Property< std::vector< bool > > m_doPhiAxesDivision
Definition: RingerReFex.h:112
CaloDetDescrElement
This class groups all DetDescr information related to a CaloCell. Provides a generic interface for al...
Definition: Calorimeter/CaloDetDescr/CaloDetDescr/CaloDetDescrElement.h:66
RingerReFex::RingSet::m_samples
std::vector< int > m_samples
Definition: RingerReFex.h:52
RingerReFex::RingSet::push_back
void push_back(const CaloCell *)
=================================================================================
Definition: RingerReFex.cxx:447
RingerReFex::m_doNoiseThrRings
Gaudi::Property< bool > m_doNoiseThrRings
Definition: RingerReFex.h:107
CaloCell.h
RingerReFex::m_doQuarter
Gaudi::Property< std::vector< bool > > m_doQuarter
Definition: RingerReFex.h:110
RingerReFex::RingSet::m_cells
std::vector< const CaloCell * > m_cells
Definition: RingerReFex.h:55
SG::ReadHandleKey
Property holding a SG store/key/clid from which a ReadHandle is made.
Definition: StoreGate/StoreGate/ReadHandleKey.h:39
RingerReFex::RingSet::m_doEtaAxesDivision
bool m_doEtaAxesDivision
Definition: RingerReFex.h:53
TrigRingerRings.h
RingerReFex::RingSet::RingSet
RingSet(unsigned int maxRings, double deta, double dphi, const std::vector< int > &detectors, const std::vector< int > &samplings, const std::vector< int > &samples, bool doQuarter, bool doEtaAxesDivision, bool doPhiAxesDivision)
Definition: RingerReFex.cxx:384
RingerReFex::RingSet::rings
const std::vector< double > & rings() const
=================================================================================
Definition: RingerReFex.cxx:440
RingerReFex::m_etaSearchWindowSize
Gaudi::Property< double > m_etaSearchWindowSize
Definition: RingerReFex.h:95
RingerReFex
Definition: RingerReFex.h:26
RingerReFex::maxCell
bool maxCell(const CaloCell *cell, double &energy, const double eta_ref, const double phi_ref) const
Definition: RingerReFex.cxx:323
GenericMonitoringTool.h
RingerReFex::printRings
void printRings(std::vector< RingSet > &, const xAOD::TrigEMCluster &) const
=================================================================================
Definition: RingerReFex.cxx:355
TrigRingerRingsAuxContainer.h
SG::WriteHandleKey
Property holding a SG store/key/clid from which a WriteHandle is made.
Definition: StoreGate/StoreGate/WriteHandleKey.h:40
ParticleGun_FastCalo_ChargeFlip_Config.energy
energy
Definition: ParticleGun_FastCalo_ChargeFlip_Config.py:78
RingerReFex::m_detectors
Gaudi::Property< std::vector< std::vector< int > > > m_detectors
Definition: RingerReFex.h:101
RingerReFex::RingSet::m_doPhiAxesDivision
bool m_doPhiAxesDivision
Definition: RingerReFex.h:53
RingerReFex::m_globalCenter
Gaudi::Property< bool > m_globalCenter
Definition: RingerReFex.h:109
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
IRoiDescriptor
Describes the API of the Region of Ineterest geometry.
Definition: IRoiDescriptor.h:23
01SubmitToGrid.samples
samples
Definition: 01SubmitToGrid.py:58
RingerReFex::RingSet::m_samplings
std::vector< int > m_samplings
Definition: RingerReFex.h:52
RingerReFex::execute
virtual StatusCode execute(xAOD::TrigEMCluster &emCluster, const IRoiDescriptor &roi, const CaloDetDescrElement *&, const EventContext &context) const override
=================================================================================
Definition: RingerReFex.cxx:209
IReAlgToolCalo.h
test_pyathena.parent
parent
Definition: test_pyathena.py:15
RingerReFex::m_dumpCells
Gaudi::Property< bool > m_dumpCells
Definition: RingerReFex.h:106
RingerReFex::configurationInvalid
bool configurationInvalid()
=================================================================================
Definition: RingerReFex.cxx:44
RingerReFex::m_ringerContainerKey
SG::WriteHandleKey< xAOD::TrigRingerRingsContainer > m_ringerContainerKey
Definition: RingerReFex.h:91
RingerReFex::m_monTool
ToolHandle< GenericMonitoringTool > m_monTool
Definition: RingerReFex.h:90
CaloNoise
Definition: CaloNoise.h:16
WriteHandleKey.h
Property holding a SG store/key/clid from which a WriteHandle is made.
RingerReFex::RingSet::m_doQuarter
bool m_doQuarter
Definition: RingerReFex.h:53
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:195
RingerReFex::m_samplings
Gaudi::Property< std::vector< std::vector< int > > > m_samplings
Definition: RingerReFex.h:102
CaloNoise.h
RingerReFex::RingSet::fill_cells_info
void fill_cells_info(std::vector< float > &cells_eta, std::vector< float > &cells_phi, std::vector< float > &cells_et, std::vector< int > &cells_sampling, std::vector< int > &cells_size, std::vector< double > &rings_sum, std::vector< int > &cells_id, std::vector< float > &cells_gain)
=================================================================================
Definition: RingerReFex.cxx:307
RingerReFex::RingSet::m_deltaPhi
double m_deltaPhi
Definition: RingerReFex.h:51
RingerReFex::m_etaBins
Gaudi::Property< std::vector< float > > m_etaBins
Definition: RingerReFex.h:100
IReAlgToolCalo
Base Class for Tools used for Egamma and Tau Feature Extraction Algorithms.
Definition: IReAlgToolCalo.h:37
SG::ReadCondHandleKey< CaloNoise >
RingerReFex::~RingerReFex
virtual ~RingerReFex()
Definition: RingerReFex.h:63
RingerReFex::RingSet
Definition: RingerReFex.h:29
RingerReFex::RingSet::~RingSet
~RingSet()=default
RingerReFex::m_deltaPhi
Gaudi::Property< std::vector< float > > m_deltaPhi
Definition: RingerReFex.h:98
CaloCell
Data object for each calorimeter readout cell.
Definition: CaloCell.h:57
RingerReFex::RingSet::m_rings
std::vector< double > m_rings
Definition: RingerReFex.h:56
RingerReFex::m_clusterContainerKey
SG::ReadHandleKey< xAOD::TrigEMClusterContainer > m_clusterContainerKey
Definition: RingerReFex.h:92
RingerReFex::RingSet::clear
void clear()
=================================================================================
Definition: RingerReFex.cxx:453
RingerReFex::RingerReFex
RingerReFex(const std::string &type, const std::string &name, const IInterface *parent)
=================================================================================
Definition: RingerReFex.cxx:38
RingerReFex::m_useTile
Gaudi::Property< bool > m_useTile
Definition: RingerReFex.h:105
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
RingerReFex::m_noiseCDOKey
SG::ReadCondHandleKey< CaloNoise > m_noiseCDOKey
Definition: RingerReFex.h:93
RingerReFex::RingSet::isValid
bool isValid(const CaloCell *) const
=================================================================================
Definition: RingerReFex.cxx:427
RingerReFex::m_deltaEta
Gaudi::Property< std::vector< float > > m_deltaEta
Definition: RingerReFex.h:97
RingerReFex::m_samples
Gaudi::Property< std::vector< std::vector< int > > > m_samples
Definition: RingerReFex.h:103
xAOD::TrigEMCluster_v1
Description of a trigger EM cluster.
Definition: TrigEMCluster_v1.h:28
RingerReFex::m_nRings
Gaudi::Property< std::vector< unsigned int > > m_nRings
Definition: RingerReFex.h:99
RingerReFex::RingSet::detectors
const std::vector< std::pair< int, int > > detectors() const
=================================================================================
Definition: RingerReFex.cxx:417
RingerReFex::initialize
virtual StatusCode initialize() override
=================================================================================
Definition: RingerReFex.cxx:55
RingerReFex::m_doEtaAxesDivision
Gaudi::Property< std::vector< bool > > m_doEtaAxesDivision
Definition: RingerReFex.h:111
RingerReFex::RingSet::m_detectors
std::vector< int > m_detectors
Definition: RingerReFex.h:52
RingerReFex::RingSet::m_deltaEta
double m_deltaEta
Definition: RingerReFex.h:51