ATLAS Offline Software
MissingCellListTool.h
Go to the documentation of this file.
1 
3 /*
4  Copyright (C) 2002-2020 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,m_phi;
84  };
85 
86  typedef std::unordered_set<Identifier> cellset_t;
87 
88 
89  class CaloCellFastMap : public JetTiledMap::TiledEtaPhiMap<CellPosition> {
90  public:
91  virtual ~CaloCellFastMap() {}
92  std::vector<CellPosition> cellsInDeltaR(double eta,double phi, double r) const {
94  return pointsInDr( p , r);
95  }
96 
97  const cellset_t & cells() const {return m_allCells;}
98  cellset_t & cells() {return m_allCells;}
99  protected:
101  };
102 
103 
104 }
105 
106 CLASS_DEF( jet::CaloCellFastMap , 35228686 , 1 )
107 
108 
109 
111  : public asg::AsgTool,
112  virtual public IJetExecuteTool
113 
114 //virtual public IIncidentListener // allows to detect begining of events
115 {
117  public:
118 
119 
120 
121  // Copy constructor:
122 
124  MissingCellListTool(const std::string& name);
125 
126 
129 
130  // Athena algtool's Hooks
131  virtual StatusCode initialize();
132  virtual StatusCode finalize();
133 
134 
135  // Interface implementation
136  // virtual StatusCode prepareCellList();
137  // virtual const_iterator begin() ;
138  // virtual const_iterator end() ;
139  // virtual size_t size() ;
140 
141 
142  // virtual const list_t & missingCellList() {return m_missingCells;};
143  // virtual const list_t & extendedList() {return m_badandmissingCells;};
144 
145  virtual int execute() const;
146 
147  // /// returns all bad cells within r of (eta,phi).
148  // std::vector<CellPosition> cellsInDeltaR(double eta,double phi, double r);
149 
150  // /// Implementation of IIncidentListener::handle
151  // virtual void handle(const Incident&);
152 
153 
155  // PRIVATE data:
157  private:
158 
159 
160 
161  typedef std::vector<unsigned int> cellidvec_t;
164 
165 
166  double m_rmax;
167  //bool m_needSetup;
170  unsigned int m_larMaskBit;
171  unsigned int m_tileMaskBit;
172 
174  ToolHandle<ITileBadChanTool> m_tileTool;
176  "BadChanKey",
177  "LArBadChannel",
178  "SG bad channels key" };
180  this,
181  "CaloDetDescrManager",
182  "CaloDetDescrManager",
183  "SG Key for CaloDetDescrManager in the Condition Store"
184  };
185 
187  "cells_name",
188  "AllCalo",
189  "" };
190 
192  this,
193  "MissingCellMapName",
194  "MissingCaloCellsMap",
195  "SG key for missing cell map"
196  };
197 };
198 
199 // I/O operators
201 
203 // Inline methods:
205 
206 
207 #endif //> !JETMOMENTTOOLS_BADCALOCELLLISTTOOL_H
208 // DoxygenDocumentation
MissingCellListTool::m_rmax
double m_rmax
Definition: MissingCellListTool.h:166
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:676
TileCablingSvc.h
MissingCellListTool::cellidvec_t
std::vector< unsigned int > cellidvec_t
Definition: MissingCellListTool.h:161
python.tests.PyTestsLib.finalize
def finalize(self)
_info( "content of StoreGate..." ) self.sg.dump()
Definition: PyTestsLib.py:53
python.PerfMonSerializer.p
def p
Definition: PerfMonSerializer.py:743
phi
Scalar phi() const
phi method
Definition: AmgMatrixBasePlugin.h:64
eta
Scalar eta() const
pseudorapidity method
Definition: AmgMatrixBasePlugin.h:79
MissingCellListTool::m_tileCabling
ServiceHandle< TileCablingSvc > m_tileCabling
Definition: MissingCellListTool.h:173
MissingCellListTool::m_tileMaskBit
unsigned int m_tileMaskBit
Definition: MissingCellListTool.h:171
jet::CellPosition::m_phi
double m_phi
Definition: MissingCellListTool.h:81
initialize
void initialize()
Definition: run_EoverP.cxx:894
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:163
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:82
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
jet::CellPosition
Definition: MissingCellListTool.h:59
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:92
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
Identifier
Definition: DetectorDescription/Identifier/Identifier/Identifier.h:32
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:170
jet::CaloCellFastMap::cells
cellset_t & cells()
Definition: MissingCellListTool.h:98
jet::CellPosition::setX
void setX(double x)
Definition: MissingCellListTool.h:68
jet::CaloCellFastMap::cells
const cellset_t & cells() const
Definition: MissingCellListTool.h:97
jet::CaloCellFastMap::~CaloCellFastMap
virtual ~CaloCellFastMap()
Definition: MissingCellListTool.h:91
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:83
ReadCondHandleKey.h
jet::CaloCellFastMap::m_allCells
cellset_t m_allCells
Definition: MissingCellListTool.h:100
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:191
MissingCellListTool
MissingCellListTool.h Header file for class MissingCellListTool Author: P.A.
Definition: MissingCellListTool.h:115
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:192
MissingCellListTool::m_tileTool
ToolHandle< ITileBadChanTool > m_tileTool
Definition: MissingCellListTool.h:174
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:162
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:168
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:64
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:169
jet::cellset_t
std::unordered_set< Identifier > cellset_t
Definition: MissingCellListTool.h:86
jet::CaloCellFastMap
Definition: MissingCellListTool.h:89
ServiceHandle< TileCablingSvc >