ATLAS Offline Software
Loading...
Searching...
No Matches
FCALModule.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
3*/
4
6#include "LArReadoutGeometry/FCAL_ChannelMap.h"
8
9#include "GeoModelKernel/GeoVFullPhysVol.h"
10#include "GeoModelKernel/GeoLogVol.h"
11#include "GeoModelKernel/GeoShape.h"
12#include "GeoModelKernel/GeoTubs.h"
14
15#include <algorithm>
16
17bool operator < (unsigned int i, const FCALTile &t) {
18 return i < t.identify();
19}
20
21bool operator < (const FCALTile &t, unsigned int i) {
22 return t.identify() < i;
23}
24
25
26
27// Class FCALModule
28
29FCALModule::FCALModule (const GeoVFullPhysVol *physVol, Module module, Endcap endcap, double projectivityDisplacement)
30 : GeoVDetectorElement(physVol)
31 , m_Mod(module)
32 , m_EC(endcap)
33 , m_manager(nullptr)
34 , m_dz(((const GeoTubs *) physVol->getLogVol()->getShape())->getZHalfLength()*2.0)
35 , m_projectivityDisplacement(projectivityDisplacement)
36{
37
38}
39
40
42= default;
43
44
45
50
55
56const FCALTile* FCALModule::getTile (int i, int j) const
57{
58
59 unsigned int id = (j<<16) | i;
60
61 std::vector<FCALTile>::const_iterator it = lower_bound(m_tileList.begin(),m_tileList.end(), id);
62 if ((*it).getIndexI()!=i || (*it).getIndexJ()!=j) {
63 return nullptr;
64 }
65 return &*it;
66
67}
68
73
78
79double FCALModule::getFullWidthX (const FCALTile& tile) const
80{
81 return getFullWidths (tile.getNumTubes()).first;
82}
83
84double FCALModule::getFullWidthY (const FCALTile& tile) const
85{
86 return getFullWidths (tile.getNumTubes()).second;
87}
88
89double FCALModule::getFullDepthZ (const FCALTile& ) const
90{
91 return m_dz;
92}
93
95{
96 const GeoVFullPhysVol *fullPhysVol = getMaterialGeom();
97 return alignStore
98 ? fullPhysVol->getCachedAbsoluteTransform(alignStore)
99 : fullPhysVol->getAbsoluteTransform();
100}
101
103{
104 const GeoVFullPhysVol *fullPhysVol = getMaterialGeom();
105 return alignStore
106 ? fullPhysVol->getCachedDefAbsoluteTransform(alignStore)
107 : fullPhysVol->getDefAbsoluteTransform();
108}
109
111{
112 m_manager = fcalManager;
113 const FCAL_ChannelMap *cMap = m_manager->getChannelMap();
115 for (t=begin;t!=end;++t) {
116 FCALTile tile(this,t);
117 m_tileList.push_back(tile);
118 }
119 std::sort(m_tileList.begin(),m_tileList.end());
120}
121
122
124FCALModule::getFullWidths (unsigned int ntubes) const
125{
126 if (ntubes > MAXTUBES) std::abort();
127 if (!m_tileSizes[ntubes-1].isValid()) {
128 const FCAL_ChannelMap *cMap=m_manager->getChannelMap();
129 float dx,dy;
130 cMap->tileSize(m_Mod,ntubes,dx,dy);
131 m_tileSizes[ntubes-1].set (std::make_pair (dx, dy));
132 }
133 return *m_tileSizes[ntubes-1].ptr();
134}
bool isValid(const T &p)
Av: we implement here an ATLAS-sepcific convention: all particles which are 99xxxxx are fine.
Definition AtlasPID.h:878
bool operator<(unsigned int i, const FCALTile &t)
FCALModule::Endcap getEndcapIndex() const
Returns the side (O=Negative, 1=Positive)
std::vector< FCALTile > m_tileList
A List of Tiles.
Definition FCALModule.h:130
double getFullWidthY(const FCALTile &tile) const
Gets Tile Full Width in Y.
double getFullDepthZ(const FCALTile &) const
Gets Tile (full) Depth.
double getFullWidthX(const FCALTile &tile) const
Gets Tile Full Width in X.
const Amg::Transform3D & getAbsoluteTransform(const GeoAlignmentStore *alignStore=nullptr) const
Returns the absolute transform of this element.
FCALDetectorManager * m_manager
Point to the manager.
Definition FCALModule.h:145
double m_dz
Holds Delta Z, Full width of a cell.
Definition FCALModule.h:158
~FCALModule()
Desctructor.
Module m_Mod
Module number: 1, 2, or 3.
Definition FCALModule.h:135
friend class FCALDetectorManager
Definition FCALModule.h:163
std::vector< FCALTile >::const_iterator ConstIterator
Definition FCALModule.h:36
std::pair< double, double > tubexy_t
X/Y pairs of tile sizes.
Definition FCALModule.h:150
FCALModule::ConstIterator beginTiles() const
Iteration over FCAL Tiles.
Endcap m_EC
Endcap.
Definition FCALModule.h:140
void setManager(FCALDetectorManager *fcalManager)
Sets the manager.
FCALModule::Module getModuleIndex() const
Returns the Module (1,2, or 3)
const FCALTile * getTile(int i, int j) const
Returns a tile by indices i and j.
double m_projectivityDisplacement
Definition FCALModule.h:161
static constexpr size_t MAXTUBES
Definition FCALModule.h:116
CxxUtils::CachedValue< tubexy_t > m_tileSizes[MAXTUBES]
Definition FCALModule.h:151
FCALModule(const GeoVFullPhysVol *physVol, Module module, Endcap endcap, double projectivityDisplacement=4 *Gaudi::Units::cm)
Constructor.
const Amg::Transform3D & getDefAbsoluteTransform(const GeoAlignmentStore *alignStore=nullptr) const
Returns the absolute transform of this element.
const tubexy_t & getFullWidths(unsigned int ntubes) const
FCALModule::ConstIterator endTiles() const
Iteration over FCAL Tiles.
A tile of the forward calorimeter readout geometry.
Definition FCALTile.h:27
This class contains the tube and tile maps for the FCAL A tile is of a set of FCAL tubes.
void tileSize(int sam, int eta, int phi, float &dx, float &dy) const
Ensure that the extensions for the Vector3D are properly loaded.
Eigen::Affine3d Transform3D
void sort(typename DataModel_detail::iterator< DVL > beg, typename DataModel_detail::iterator< DVL > end)
Specialization of sort for DataVector/List.