ATLAS Offline Software
MissingCellListTool.h
Go to the documentation of this file.
1 
3 /*
4  Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
5 */
6 
7 #ifndef JETMOMENTTOOLS_MISSINGCALOCELLLISTTOOL_H
8 #define JETMOMENTTOOLS_MISSINGCALOCELLLISTTOOL_H 1
9 
25 // STL includes
26 #include <string>
27 #include <list>
28 #include <unordered_set>
29 
30 // FrameWork includes
31 //#include "AthenaBaseComps/AthAlgTool.h"
32 #include "GaudiKernel/ServiceHandle.h"
33 #include "GaudiKernel/ToolHandle.h"
37 //
43 //
45 //
46 #include "xAODCore/CLASS_DEF.h"
47 #include "AsgTools/AsgTool.h"
49 
50 // Forward declaration
51 
52 class ITileBadChanTool ;
53 
54 namespace jet {
59  struct CellPosition {
61 
63  CellPosition(double eta, double phi): m_eta(eta),m_phi(phi),m_sampling(),m_id(){};
64  CellPosition(double eta, double phi, Identifier id, CaloSample samp): m_eta(eta),m_phi(phi), m_sampling(samp),m_id(id){};
65 
66  double x()const {return m_eta;}
67  double y()const {return m_phi;}
68  void setX(double x){m_eta=x;}
69  void setY(double x){m_phi=x;}
70 
71  double eta()const {return m_eta;}
72  double phi()const {return m_phi;}
73  CaloSample sampling() const {return m_sampling;}
74  // define a distance.
75  struct DR2 {
76  double operator()(const CellPosition &p1,const CellPosition &p2) const {
77  return JetTiledMap::utils::DR2(p1.x(),p1.y(), p2.x(), p2.y() );
78  }
79  };
80 
81  double m_eta = 0;
82  double m_phi = 0;
85  };
86 
87  typedef std::unordered_set<Identifier> cellset_t;
88 
89 
90  class CaloCellFastMap : public JetTiledMap::TiledEtaPhiMap<CellPosition> {
91  public:
92  virtual ~CaloCellFastMap() {}
93  std::vector<CellPosition> cellsInDeltaR(double eta,double phi, double r) const {
95  return pointsInDr( p , r);
96  }
97 
98  const cellset_t & cells() const {return m_allCells;}
99  cellset_t & cells() {return m_allCells;}
100  protected:
102  };
103 
104 
105 }
106 
107 CLASS_DEF( jet::CaloCellFastMap , 35228686 , 1 )
108 
109 
110 
112  : public asg::AsgTool,
113  virtual public IJetExecuteTool
114 
115 //virtual public IIncidentListener // allows to detect begining of events
116 {
118  public:
119 
120 
121 
122  // Copy constructor:
123 
125  MissingCellListTool(const std::string& name);
126 
127 
130 
131  // Athena algtool's Hooks
132  virtual StatusCode initialize();
133  virtual StatusCode finalize();
134 
135 
136  // Interface implementation
137  // virtual StatusCode prepareCellList();
138  // virtual const_iterator begin() ;
139  // virtual const_iterator end() ;
140  // virtual size_t size() ;
141 
142 
143  // virtual const list_t & missingCellList() {return m_missingCells;};
144  // virtual const list_t & extendedList() {return m_badandmissingCells;};
145 
146  virtual int execute() const;
147 
148  // /// returns all bad cells within r of (eta,phi).
149  // std::vector<CellPosition> cellsInDeltaR(double eta,double phi, double r);
150 
151  // /// Implementation of IIncidentListener::handle
152  // virtual void handle(const Incident&);
153 
154 
156  // PRIVATE data:
158  private:
159 
160 
161 
162  typedef std::vector<unsigned int> cellidvec_t;
165 
166 
167  double m_rmax;
168  //bool m_needSetup;
171  unsigned int m_larMaskBit;
172  unsigned int m_tileMaskBit;
173 
175  ToolHandle<ITileBadChanTool> m_tileTool;
177  "BadChanKey",
178  "LArBadChannel",
179  "SG bad channels key" };
181  this,
182  "CaloDetDescrManager",
183  "CaloDetDescrManager",
184  "SG Key for CaloDetDescrManager in the Condition Store"
185  };
186 
188  "cells_name",
189  "AllCalo",
190  "" };
191 
193  this,
194  "MissingCellMapName",
195  "MissingCaloCellsMap",
196  "SG key for missing cell map"
197  };
198 };
199 
200 // I/O operators
202 
204 // Inline methods:
206 
207 
208 #endif //> !JETMOMENTTOOLS_BADCALOCELLLISTTOOL_H
209 // DoxygenDocumentation
MissingCellListTool::m_rmax
double m_rmax
Definition: MissingCellListTool.h:167
jet::CellPosition::CaloSample
CaloCell_ID::CaloSample CaloSample
Definition: MissingCellListTool.h:60
ReadHandleKey.h
Property holding a SG store/key/clid from which a ReadHandle is made.
beamspotman.r
def r
Definition: beamspotman.py:672
GetLCDefs::Unknown
@ Unknown
Definition: GetLCDefs.h:21
TileCablingSvc.h
MissingCellListTool::cellidvec_t
std::vector< unsigned int > cellidvec_t
Definition: MissingCellListTool.h:162
python.tests.PyTestsLib.finalize
def finalize(self)
_info( "content of StoreGate..." ) self.sg.dump()
Definition: PyTestsLib.py:50
phi
Scalar phi() const
phi method
Definition: AmgMatrixBasePlugin.h:67
eta
Scalar eta() const
pseudorapidity method
Definition: AmgMatrixBasePlugin.h:83
MissingCellListTool::m_tileCabling
ServiceHandle< TileCablingSvc > m_tileCabling
Definition: MissingCellListTool.h:174
MissingCellListTool::m_tileMaskBit
unsigned int m_tileMaskBit
Definition: MissingCellListTool.h:172
jet::CellPosition::m_phi
double m_phi
Definition: MissingCellListTool.h:82
initialize
void initialize()
Definition: run_EoverP.cxx:894
TRTCalib_cfilter.p1
p1
Definition: TRTCalib_cfilter.py:130
MissingCellListTool::~MissingCellListTool
virtual ~MissingCellListTool()
Destructor:
jet::CellPosition::CellPosition
CellPosition()
Definition: MissingCellListTool.h:62
asg
Definition: DataHandleTestTool.h:28
jet::CellPosition::phi
double phi() const
Definition: MissingCellListTool.h:72
MissingCellListTool::m_userAddedCells
cellidvec_t m_userAddedCells
Definition: MissingCellListTool.h:164
jet::CellPosition::eta
double eta() const
Definition: MissingCellListTool.h:71
IJetExecuteTool
IJetExecuteTool is a dual-use tool interface for generic tools, i.e. those that behave like algorithm...
Definition: IJetExecuteTool.h:19
jet::CellPosition::DR2::operator()
double operator()(const CellPosition &p1, const CellPosition &p2) const
Definition: MissingCellListTool.h:76
JetTiledMap::TiledEtaPhiMap< CellPosition >::pointsInDr
std::vector< CellPosition > pointsInDr(CellPosition &p, double r) const
retrieve all points within deltaR of p. WARNING !! wrong results if r>rmax !
SG::ReadHandleKey< CaloCellContainer >
jet::CellPosition::m_sampling
CaloSample m_sampling
Definition: MissingCellListTool.h:83
TiledEtaPhiMap.h
jet::CellPosition::y
double y() const
Definition: MissingCellListTool.h:67
CaloDetDescrManager.h
Definition of CaloDetDescrManager.
CaloCell_ID.h
LArG4FSStartPointFilterLegacy.execute
execute
Definition: LArG4FSStartPointFilterLegacy.py:20
LArBadChannelCont.h
TRTCalib_cfilter.p2
p2
Definition: TRTCalib_cfilter.py:131
jet::CellPosition
Definition: MissingCellListTool.h:59
python.utils.AtlRunQueryDQUtils.p
p
Definition: AtlRunQueryDQUtils.py:209
jet
Definition: JetCalibTools_PlotJESFactors.cxx:23
SG::WriteHandleKey< jet::CaloCellFastMap >
IJetExecuteTool.h
jet::CaloCellFastMap::cellsInDeltaR
std::vector< CellPosition > cellsInDeltaR(double eta, double phi, double r) const
Definition: MissingCellListTool.h:93
jet::CellPosition::x
double x() const
Definition: MissingCellListTool.h:66
jet::CellPosition::DR2
Definition: MissingCellListTool.h:75
CaloSampling::CaloSample
CaloSample
Definition: Calorimeter/CaloGeoHelpers/CaloGeoHelpers/CaloSampling.h:22
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
MissingCellListTool::m_larMaskBit
unsigned int m_larMaskBit
Definition: MissingCellListTool.h:171
jet::CaloCellFastMap::cells
cellset_t & cells()
Definition: MissingCellListTool.h:99
jet::CellPosition::setX
void setX(double x)
Definition: MissingCellListTool.h:68
jet::CaloCellFastMap::cells
const cellset_t & cells() const
Definition: MissingCellListTool.h:98
jet::CaloCellFastMap::~CaloCellFastMap
virtual ~CaloCellFastMap()
Definition: MissingCellListTool.h:92
jet::CellPosition::CellPosition
CellPosition(double eta, double phi, Identifier id, CaloSample samp)
Definition: MissingCellListTool.h:64
jet::CellPosition::m_id
Identifier m_id
Definition: MissingCellListTool.h:84
ReadCondHandleKey.h
jet::CaloCellFastMap::m_allCells
cellset_t m_allCells
Definition: MissingCellListTool.h:101
WriteHandleKey.h
Property holding a SG store/key/clid from which a WriteHandle is made.
id
SG::auxid_t id
Definition: Control/AthContainers/Root/debug.cxx:239
MissingCellListTool
MissingCellListTool.h Header file for class MissingCellListTool Author: P.A.
Definition: MissingCellListTool.h:116
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:240
MissingCellListTool::m_tileTool
ToolHandle< ITileBadChanTool > m_tileTool
Definition: MissingCellListTool.h:175
jet::CellPosition::CellPosition
CellPosition(double eta, double phi)
Definition: MissingCellListTool.h:63
CaloCellContainer.h
CLASS_DEF.h
File providing the different SG_BASE macros.
MissingCellListTool::m_userRemovedCells
cellidvec_t m_userRemovedCells
Definition: MissingCellListTool.h:163
SG::ReadCondHandleKey
Definition: ReadCondHandleKey.h:20
JetTiledMap::utils::DR2
static constexpr double DR2(double eta1, double phi1, double eta2, double phi2)
Definition: TiledEtaPhiMap.h:32
MissingCellListTool::m_addBadCells
bool m_addBadCells
Definition: MissingCellListTool.h:169
ASG_TOOL_CLASS
#define ASG_TOOL_CLASS(CLASSNAME, INT1)
Definition: AsgToolMacros.h:68
CLASS_DEF
#define CLASS_DEF(NAME, CID, VERSION)
associate a clid and a version to a type eg
Definition: Control/AthenaKernel/AthenaKernel/CLASS_DEF.h:67
JetTiledMap::TiledEtaPhiMap
Definition: TiledEtaPhiMap.h:85
jet::CellPosition::m_eta
double m_eta
Definition: MissingCellListTool.h:81
ITileBadChanTool
An abstract inteface to get Tile channel and ADC status.
Definition: ITileBadChanTool.h:21
jet::CellPosition::sampling
CaloSample sampling() const
Definition: MissingCellListTool.h:73
jet::CellPosition::setY
void setY(double x)
Definition: MissingCellListTool.h:69
AsgTool.h
MissingCellListTool::m_addCellFromTool
bool m_addCellFromTool
Definition: MissingCellListTool.h:170
jet::cellset_t
std::unordered_set< Identifier > cellset_t
Definition: MissingCellListTool.h:87
jet::CaloCellFastMap
Definition: MissingCellListTool.h:90
ServiceHandle< TileCablingSvc >
Identifier
Definition: IdentifierFieldParser.cxx:14