ATLAS Offline Software
CaloSuperCellIDTool.h
Go to the documentation of this file.
1 // This file's extension implies that it's C, but it's really -*- C++ -*-.
2 
3 /*
4  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
5 */
6 
7 // $Id$
16 #ifndef CALODETDESCR_CALOSUPERCELLIDTOOL_H
17 #define CALODETDESCR_CALOSUPERCELLIDTOOL_H
18 
19 
23 #include "GaudiKernel/ToolHandle.h"
24 
25 
26 class CaloCell_ID;
28 
30  : public extends1<AthAlgTool, ICaloSuperCellIDTool>
31 {
32 public:
39  CaloSuperCellIDTool (const std::string& type,
40  const std::string& name,
41  const IInterface* parent);
42 
43 
45  virtual StatusCode initialize();
46 
47 
53  virtual Identifier offlineToSuperCellID (const Identifier& id) const;
54 
55 
60  virtual std::vector<Identifier>
61  superCellToOfflineID (const Identifier& id) const;
62 
63 
71  virtual std::vector<Identifier>
72  offlineToSuperCellRegion (const Identifier& reg_id) const;
73 
74 
82  virtual std::vector<Identifier>
83  superCellToOfflineRegion (const Identifier& reg_id) const;
84 
85 
86 private:
88  void initFCALIDMap();
89 
90  // During initialization, we create a table describing the mapping
91  // beween offline and supercell regions. There is one entry per
92  // unique pair of offline/supercell regions, sorted in increasing
93  // hash order. (So there may be multiple entries for a given
94  // offline or supercell region, but such entries should be adjacent
95  // in the table.)
96 
98  void initIDMap ();
99 
101  struct IDMapElt {
104 
107 
109  int m_etadiv;
110  int m_phidiv;
111 
117 
123 
132  };
133 
135  void addMapEntry (const IDMapElt& elt);
136 
138  std::vector<IDMapElt> m_idmap;
139 
142  std::vector<int> m_offlineIndex;
143 
146  std::vector<int> m_superCellIndex;
147 
151  std::vector<int> m_superCellIndexEnd;
152 
154  std::vector<Identifier> m_fcal_fromCell;
155  std::vector< std::vector<Identifier> > m_fcal_fromSuperCell;
156 
160 };
161 
162 
163 #endif // not CALODETDESCR_CALOSUPERCELLIDTOOL_H
CaloSuperCellIDTool::addMapEntry
void addMapEntry(const IDMapElt &elt)
Add an entry to the region mapping table.
Definition: CaloSuperCellIDTool.cxx:232
CaloSuperCellIDTool::IDMapElt::m_cell_reg
IdentifierHash m_cell_reg
Offline region hash for this entry.
Definition: CaloSuperCellIDTool.h:103
CaloSuperCellIDTool::offlineToSuperCellID
virtual Identifier offlineToSuperCellID(const Identifier &id) const
Given an offline cell identifier, return the corresponding supercell identifier.
Definition: CaloSuperCellIDTool.cxx:315
CaloSuperCellIDTool::initFCALIDMap
void initFCALIDMap()
FCAL is a special case.
Definition: CaloSuperCellIDTool.cxx:251
CaloSuperCellIDTool::IDMapElt::m_etadiv
int m_etadiv
Number of offline cells per supercell, in eta/phi.
Definition: CaloSuperCellIDTool.h:109
ICaloSuperCellIDTool.h
CaloSuperCellIDTool::IDMapElt::m_phidiv
int m_phidiv
Definition: CaloSuperCellIDTool.h:110
CaloSuperCellIDTool::m_idmap
std::vector< IDMapElt > m_idmap
List of mapping table entries.
Definition: CaloSuperCellIDTool.h:138
CaloSuperCellIDTool::IDMapElt::m_cell_ietamax
int m_cell_ietamax
Definition: CaloSuperCellIDTool.h:116
CaloSuperCellIDTool::m_fcal_fromSuperCell
std::vector< std::vector< Identifier > > m_fcal_fromSuperCell
Definition: CaloSuperCellIDTool.h:155
CaloSuperCellIDTool::initIDMap
void initIDMap()
Initialize the mapping table.
Definition: CaloSuperCellIDTool.cxx:80
CaloSuperCellIDTool::m_fcal_fromCell
std::vector< Identifier > m_fcal_fromCell
hashTable for FCAL
Definition: CaloSuperCellIDTool.h:154
CaloSuperCellIDTool::offlineToSuperCellRegion
virtual std::vector< Identifier > offlineToSuperCellRegion(const Identifier &reg_id) const
Given an offline region identifier, return the corresponding supercell region identifier(s).
Definition: CaloSuperCellIDTool.cxx:514
CaloCell_SuperCell_ID
Helper class for offline supercell identifiers.
Definition: CaloCell_SuperCell_ID.h:48
CaloSuperCellIDTool::m_superCellIndexEnd
std::vector< int > m_superCellIndexEnd
Entry I contains one past the index in the mapping table of the last entry for the supercell region w...
Definition: CaloSuperCellIDTool.h:151
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
CaloSuperCellIDTool::IDMapElt::m_sc_reg
IdentifierHash m_sc_reg
Supercell region hash for this entry.
Definition: CaloSuperCellIDTool.h:106
AthAlgTool.h
CaloSuperCellIDTool::superCellToOfflineID
virtual std::vector< Identifier > superCellToOfflineID(const Identifier &id) const
Given a supercell identifier, return the list of corresponding offline cell identifiers.
Definition: CaloSuperCellIDTool.cxx:409
test_pyathena.parent
parent
Definition: test_pyathena.py:15
CaloCell_ID
Helper class for offline cell identifiers.
Definition: CaloCell_ID.h:34
CaloSuperCellIDTool::IDMapElt::m_cell_ieta_adj
int m_cell_ieta_adj
Offset between the first defined cell in the region and the point were offline and supercells are ali...
Definition: CaloSuperCellIDTool.h:130
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:195
IdentifierHash.h
CaloSuperCellIDTool::IDMapElt::m_sc_ieta_adj
int m_sc_ieta_adj
Definition: CaloSuperCellIDTool.h:131
CaloSuperCellIDTool::IDMapElt::m_cell_ietamin
int m_cell_ietamin
Offline minimum and maximum (inclusive) eta indices for this entry.
Definition: CaloSuperCellIDTool.h:115
CaloSuperCellIDTool::initialize
virtual StatusCode initialize()
Standard Gaudi initialize method.
Definition: CaloSuperCellIDTool.cxx:65
CaloSuperCellIDTool::IDMapElt::m_sc_ietamin
int m_sc_ietamin
Supercell minimum and maximum (inclusive) eta indices for this entry.
Definition: CaloSuperCellIDTool.h:121
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
CaloSuperCellIDTool::CaloSuperCellIDTool
CaloSuperCellIDTool(const std::string &type, const std::string &name, const IInterface *parent)
Standard Gaudi tool constructor.
Definition: CaloSuperCellIDTool.cxx:52
CaloSuperCellIDTool::m_offlineIndex
std::vector< int > m_offlineIndex
Entry I contains the index in the mapping table of the first entry for the offline region with hash I...
Definition: CaloSuperCellIDTool.h:142
CaloSuperCellIDTool::IDMapElt
Mapping table entry.
Definition: CaloSuperCellIDTool.h:101
IdentifierHash
Definition: IdentifierHash.h:38
CaloSuperCellIDTool::m_sc_helper
const CaloCell_SuperCell_ID * m_sc_helper
Definition: CaloSuperCellIDTool.h:159
CaloSuperCellIDTool::superCellToOfflineRegion
virtual std::vector< Identifier > superCellToOfflineRegion(const Identifier &reg_id) const
Given a supercell region identifier, return the corresponding offline region identifier(s).
Definition: CaloSuperCellIDTool.cxx:542
CaloSuperCellIDTool::m_superCellIndex
std::vector< int > m_superCellIndex
Entry I contains the index in the mapping table of the first entry for the supercell region with hash...
Definition: CaloSuperCellIDTool.h:146
CaloSuperCellIDTool
Definition: CaloSuperCellIDTool.h:31
CaloSuperCellIDTool::m_cell_helper
const CaloCell_ID * m_cell_helper
Entry point for calorimeter ID helpers.
Definition: CaloSuperCellIDTool.h:158
CaloSuperCellIDTool::IDMapElt::m_sc_ietamax
int m_sc_ietamax
Definition: CaloSuperCellIDTool.h:122