ATLAS Offline Software
Loading...
Searching...
No Matches
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
20class IInterface;
21class StatusCode;
22
23namespace LVL1 {
24
25
35
36class 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
Scalar eta() const
pseudorapidity method
Scalar phi() const
phi method
double coord
Type of coordination system.
Holds eta/phi coordinates corresponding to a crate/module channel.
PPM crate/module/channel to eta/phi/layer mappings.
std::array< ModuleMap, s_crates > CrateMap
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.
std::pair< Offsets, const CoordinateMap * > ModuleInfo
static const int s_modules
std::array< ModuleInfo, s_modules > ModuleMap
std::array< ModuleMap, s_crates > m_crateInfo
Pointer to crate/module map.
std::array< ChannelCoordinate, s_channels > CoordinateMap
static const int s_channels
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.
double etaSim(const ChannelCoordinate &coord) const
Correction for Had FCAL eta which is adjusted to EM value in TriggerTower.
unsigned int etaPhiKey(double eta, double phi) const
Simple eta/phi key.
void setupInverseMap()
Set up eta/phi map.
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.
std::pair< unsigned int, unsigned int > ChannelIds
virtual StatusCode initialize() override
void setupMap()
Set up crate/module map.
std::vector< std::unique_ptr< CoordinateMap > > m_coordMaps
Vector of CoordinateMaps.
std::map< unsigned int, ChannelIds > EtaPhiMap
virtual StatusCode finalize() override
std::pair< double, double > Offsets
static const int s_crates
EtaPhiMap m_etaPhiMap
Pointer to inverse map.
eFexTowerBuilder creates xAOD::eFexTowerContainer from supercells (LATOME) and triggerTowers (TREX) i...