ATLAS Offline Software
Loading...
Searching...
No Matches
MissingCellListTool.h
Go to the documentation of this file.
1
2
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
24
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
52class ITileBadChanTool ;
53
54namespace 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;
83 CaloSample m_sampling = CaloSampling::Unknown;
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;}
100 protected:
102 };
103
104
105}
106
107CLASS_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
Scalar eta() const
pseudorapidity method
Scalar phi() const
phi method
#define ASG_TOOL_CLASS(CLASSNAME, INT1)
Definition of CaloDetDescrManager.
#define CLASS_DEF(NAME, CID, VERSION)
associate a clid and a version to a type eg
File providing the different SG_BASE macros.
Property holding a SG store/key/clid from which a ReadHandle is made.
Property holding a SG store/key/clid from which a WriteHandle is made.
Define a fast lookup map for points on the eta-phi cylinder and related utilities.
CaloSampling::CaloSample CaloSample
Definition CaloCell_ID.h:53
IJetExecuteTool is a dual-use tool interface for generic tools, i.e. those that behave like algorithm...
An abstract inteface to get Tile channel and ADC status.
An eta-phi map providing a relatively fast way of retrieving points at a given distance of a point in...
std::vector< CellPosition > pointsInDr(CellPosition &p, double r) const
MissingCellListTool(const std::string &name)
Default constructor:
SG::ReadHandleKey< CaloCellContainer > m_cells_name
SG::WriteHandleKey< jet::CaloCellFastMap > m_badCellMap_key
SG::ReadCondHandleKey< LArBadChannelCont > m_BCKey
virtual ~MissingCellListTool()
Destructor:
SG::ReadCondHandleKey< CaloDetDescrManager > m_caloDetDescrMgrKey
ServiceHandle< TileCablingSvc > m_tileCabling
ToolHandle< ITileBadChanTool > m_tileTool
std::vector< unsigned int > cellidvec_t
virtual int execute() const
Method to be called for each event.
virtual StatusCode finalize()
Property holding a SG store/key/clid from which a ReadHandle is made.
Property holding a SG store/key/clid from which a WriteHandle is made.
AsgTool(const std::string &name)
Constructor specifying the tool instance's name.
Definition AsgTool.cxx:58
std::vector< CellPosition > cellsInDeltaR(double eta, double phi, double r) const
const cellset_t & cells() const
int r
Definition globals.cxx:22
std::unordered_set< Identifier > cellset_t
void initialize()
static constexpr double DR2(double eta1, double phi1, double eta2, double phi2)
double operator()(const CellPosition &p1, const CellPosition &p2) const
a cell position for the geometric map of missing/bad cells
CaloSample sampling() const
CellPosition(double eta, double phi, Identifier id, CaloSample samp)
CaloCell_ID::CaloSample CaloSample
CellPosition(double eta, double phi)