ATLAS Offline Software
PpmMappingTool.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #ifndef TRIGT1CALOMAPPINGTOOLS_PPMMAPPINGTOOL_H
6 #define TRIGT1CALOMAPPINGTOOLS_PPMMAPPINGTOOL_H
7 
8 #include <map>
9 #include <string>
10 #include <utility>
11 #include <vector>
12 #include <array>
13 
15 
16 #include "ChannelCoordinate.h"
17 
19 
20 class IInterface;
21 class StatusCode;
22 
23 namespace LVL1 {
24 
25 
36 class PpmMappingTool : public extends<AthAlgTool, IL1CaloMappingTool>
37 {
38  public:
39 
40  using base_class::base_class;
41 
42  virtual StatusCode initialize() override;
43  virtual StatusCode finalize() override;
44 
46  virtual bool mapping(int crate, int module, int channel,
47  double& eta, double& phi, int& layer) const override;
49  virtual bool mapping(double eta, double phi, int layer,
50  int& crate, int& module, int& channel) const override;
51 
52  private:
53  static const int s_crates = 8;
54  static const int s_modules = 16;
55  static const int s_channels = 64;
56 
57  // Crate/module map constituents
58  typedef std::pair< double, double > Offsets;
59  typedef std::array< ChannelCoordinate, s_channels> CoordinateMap;
60  typedef std::pair< Offsets, const CoordinateMap* > ModuleInfo;
61  typedef std::array< ModuleInfo, s_modules > ModuleMap;
62  typedef std::array< ModuleMap, s_crates > CrateMap;
63  // Inverse map constituents
64  typedef std::pair< unsigned int, unsigned int > ChannelIds;
65  typedef std::map< unsigned int, ChannelIds > EtaPhiMap;
66 
68  void setupMap();
70  void setupInverseMap();
72  void addCoords(int nrows, int ncols, double etaGran, double phiGran,
73  double etaOffset, double phiOffset,
74  const int* in, const int* out, int incr,
77  void addMods(int crate, int modOffset, int nrows, int ncols,
78  double etaBase, double phiBase, double etaRange, double phiRange,
79  const CoordinateMap* coordMap);
81  double etaSim(const ChannelCoordinate& coord) const;
83  unsigned int etaPhiKey(double eta, double phi) const;
84 
86  std::array<ModuleMap, s_crates> m_crateInfo;
88  std::vector<std::unique_ptr<CoordinateMap> > m_coordMaps;
91 };
92 
93 } // end namespace
94 
95 #endif
LVL1::PpmMappingTool::addMods
void addMods(int crate, int modOffset, int nrows, int ncols, double etaBase, double phiBase, double etaRange, double phiRange, const CoordinateMap *coordMap)
Add a block of similar modules to a crate.
Definition: PpmMappingTool.cxx:432
LVL1::PpmMappingTool::ChannelIds
std::pair< unsigned int, unsigned int > ChannelIds
Definition: PpmMappingTool.h:64
plotting.yearwise_efficiency.channel
channel
Definition: yearwise_efficiency.py:24
LVL1::PpmMappingTool::m_crateInfo
std::array< ModuleMap, s_crates > m_crateInfo
Pointer to crate/module map.
Definition: PpmMappingTool.h:86
LArCellBinning.etaRange
etaRange
Filling Eta range.
Definition: LArCellBinning.py:128
python.AthDsoLogger.out
out
Definition: AthDsoLogger.py:71
LVL1::PpmMappingTool
PPM crate/module/channel to eta/phi/layer mappings.
Definition: PpmMappingTool.h:37
LVL1::PpmMappingTool::s_modules
static const int s_modules
Definition: PpmMappingTool.h:54
LVL1
eFexTowerBuilder creates xAOD::eFexTowerContainer from supercells (LATOME) and triggerTowers (TREX) i...
Definition: ICMMCPHitsCnvTool.h:18
LVL1::PpmMappingTool::mapping
virtual bool mapping(int crate, int module, int channel, double &eta, double &phi, int &layer) const override
Return eta, phi and layer mapping for given crate/module/channel.
Definition: PpmMappingTool.cxx:37
LVL1::PpmMappingTool::setupInverseMap
void setupInverseMap()
Set up eta/phi map.
Definition: PpmMappingTool.cxx:383
LVL1::PpmMappingTool::Offsets
std::pair< double, double > Offsets
Definition: PpmMappingTool.h:58
LVL1::PpmMappingTool::m_etaPhiMap
EtaPhiMap m_etaPhiMap
Pointer to inverse map.
Definition: PpmMappingTool.h:90
LVL1::ChannelCoordinate
Holds eta/phi coordinates corresponding to a crate/module channel.
Definition: ChannelCoordinate.h:19
python.PyAthena.module
module
Definition: PyAthena.py:131
LVL1::PpmMappingTool::s_channels
static const int s_channels
Definition: PpmMappingTool.h:55
LVL1::PpmMappingTool::etaPhiKey
unsigned int etaPhiKey(double eta, double phi) const
Simple eta/phi key.
Definition: PpmMappingTool.cxx:466
LVL1::PpmMappingTool::addCoords
void addCoords(int nrows, int ncols, double etaGran, double phiGran, double etaOffset, double phiOffset, const int *in, const int *out, int incr, ChannelCoordinate::CaloLayer layer, CoordinateMap &coordMap)
Add entries to a coordinate map.
Definition: PpmMappingTool.cxx:414
LVL1::PpmMappingTool::etaSim
double etaSim(const ChannelCoordinate &coord) const
Correction for Had FCAL eta which is adjusted to EM value in TriggerTower.
Definition: PpmMappingTool.cxx:452
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
TRT::Hit::layer
@ layer
Definition: HitInfo.h:79
AthAlgTool.h
IL1CaloMappingTool.h
LVL1::ChannelCoordinate::CaloLayer
CaloLayer
Definition: ChannelCoordinate.h:23
LVL1::PpmMappingTool::CrateMap
std::array< ModuleMap, s_crates > CrateMap
Definition: PpmMappingTool.h:62
JetVoronoiDiagramHelpers::coord
double coord
Definition: JetVoronoiDiagramHelpers.h:45
LVL1::PpmMappingTool::ModuleInfo
std::pair< Offsets, const CoordinateMap * > ModuleInfo
Definition: PpmMappingTool.h:60
LVL1::PpmMappingTool::finalize
virtual StatusCode finalize() override
Definition: PpmMappingTool.cxx:30
LVL1::PpmMappingTool::setupMap
void setupMap()
Set up crate/module map.
Definition: PpmMappingTool.cxx:91
LVL1::PpmMappingTool::EtaPhiMap
std::map< unsigned int, ChannelIds > EtaPhiMap
Definition: PpmMappingTool.h:65
LVL1::PpmMappingTool::m_coordMaps
std::vector< std::unique_ptr< CoordinateMap > > m_coordMaps
Vector of CoordinateMaps.
Definition: PpmMappingTool.h:88
LVL1::PpmMappingTool::CoordinateMap
std::array< ChannelCoordinate, s_channels > CoordinateMap
Definition: PpmMappingTool.h:59
LVL1::PpmMappingTool::s_crates
static const int s_crates
Definition: PpmMappingTool.h:53
LVL1::PpmMappingTool::ModuleMap
std::array< ModuleInfo, s_modules > ModuleMap
Definition: PpmMappingTool.h:61
LArCellBinning.phiRange
phiRange
Filling Phi ranges.
Definition: LArCellBinning.py:107
ChannelCoordinate.h
LVL1::PpmMappingTool::initialize
virtual StatusCode initialize() override
Definition: PpmMappingTool.cxx:21