ATLAS Offline Software
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 
17 bool operator < (unsigned int i, const FCALTile &t) {
18  return i < t.identify();
19 }
20 
21 bool operator < (const FCALTile &t, unsigned int i) {
22  return t.identify() < i;
23 }
24 
25 
26 
27 // Class FCALModule
28 
29 FCALModule::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 
47 {
48  return m_tileList.begin();
49 }
50 
52 {
53  return m_tileList.end();
54 }
55 
56 const 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 
70 {
71  return m_EC;
72 }
73 
75 {
76  return m_Mod;
77 }
78 
80 {
81  return getFullWidths (tile.getNumTubes()).first;
82 }
83 
85 {
86  return getFullWidths (tile.getNumTubes()).second;
87 }
88 
89 double 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 
124 FCALModule::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 }
GeoAlignmentStore
Ensure that the extensions for the Vector3D are properly loaded.
Definition: GeoAlignmentStore.h:24
FCALDetectorManager
A manager class providing access to readout geometry information for the forward calorimeter.
Definition: FCALDetectorManager.h:29
CxxUtils::CachedValue::ptr
const T * ptr() const
Return a pointer to the cached value.
FCAL_ChannelMap::end
tileMap_const_iterator end(int isam) const
Definition: LArCalorimeter/LArGeoModel/LArReadoutGeometry/LArReadoutGeometry/FCAL_ChannelMap.h:148
FCALModule::MAXTUBES
static constexpr size_t MAXTUBES
Definition: FCALModule.h:116
FCAL_ChannelMap
This class contains the tube and tile maps for the FCAL A tile is of a set of FCAL tubes.
Definition: LArCalorimeter/LArGeoModel/LArReadoutGeometry/LArReadoutGeometry/FCAL_ChannelMap.h:34
FCALModule::getFullWidths
const tubexy_t & getFullWidths(unsigned int ntubes) const
Definition: FCALModule.cxx:124
FCALDetectorManager.h
FCALModule::getAbsoluteTransform
const Amg::Transform3D & getAbsoluteTransform(const GeoAlignmentStore *alignStore=nullptr) const
Returns the absolute transform of this element.
Definition: FCALModule.cxx:94
FCALModule::endTiles
FCALModule::ConstIterator endTiles() const
Iteration over FCAL Tiles.
Definition: FCALModule.cxx:51
PlotCalibFromCool.begin
begin
Definition: PlotCalibFromCool.py:94
skel.it
it
Definition: skel.GENtoEVGEN.py:396
FCALModule::~FCALModule
~FCALModule()
Desctructor.
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
isValid
bool isValid(const T &p)
Av: we implement here an ATLAS-sepcific convention: all particles which are 99xxxxx are fine.
Definition: AtlasPID.h:620
const
bool const RAWDATA *ch2 const
Definition: LArRodBlockPhysicsV0.cxx:560
mergePhysValFiles.end
end
Definition: DataQuality/DataQualityUtils/scripts/mergePhysValFiles.py:93
FCALModule::FCALModule
FCALModule(const GeoVFullPhysVol *physVol, Module module, Endcap endcap, double projectivityDisplacement=4 *Gaudi::Units::cm)
Constructor.
Definition: FCALModule.cxx:29
ReadCellNoiseFromCool.tile
tile
Definition: ReadCellNoiseFromCool.py:92
FCALTile
A tile of the forward calorimeter readout geometry.
Definition: FCALTile.h:27
python.PyAthena.module
module
Definition: PyAthena.py:131
FCALModule::m_Mod
Module m_Mod
Module number: 1, 2, or 3.
Definition: FCALModule.h:135
lumiFormat.i
int i
Definition: lumiFormat.py:85
FCALModule::ConstIterator
std::vector< FCALTile >::const_iterator ConstIterator
Definition: FCALModule.h:36
FCALModule::getFullDepthZ
double getFullDepthZ(const FCALTile &) const
Gets Tile (full) Depth.
Definition: FCALModule.cxx:89
FCALModule::m_tileSizes
CxxUtils::CachedValue< tubexy_t > m_tileSizes[MAXTUBES]
Definition: FCALModule.h:151
FCALModule::getDefAbsoluteTransform
const Amg::Transform3D & getDefAbsoluteTransform(const GeoAlignmentStore *alignStore=nullptr) const
Returns the absolute transform of this element.
Definition: FCALModule.cxx:102
FCALModule::m_tileList
std::vector< FCALTile > m_tileList
A List of Tiles.
Definition: FCALModule.h:130
Amg::Transform3D
Eigen::Affine3d Transform3D
Definition: GeoPrimitives.h:46
FCALModule::getFullWidthX
double getFullWidthX(const FCALTile &tile) const
Gets Tile Full Width in X.
Definition: FCALModule.cxx:79
FCALModule::getModuleIndex
FCALModule::Module getModuleIndex() const
Returns the Module (1,2, or 3)
Definition: FCALModule.cxx:74
FCALModule::m_EC
Endcap m_EC
Endcap.
Definition: FCALModule.h:140
GeoAlignmentStore.h
FCALModule::Endcap
Endcap
Definition: FCALModule.h:38
CxxUtils::CachedValue::set
void set(const T &val) const
Set the value, assuming it is currently invalid.
FCALModule::setManager
void setManager(FCALDetectorManager *fcalManager)
Sets the manager.
Definition: FCALModule.cxx:110
FCALModule::getEndcapIndex
FCALModule::Endcap getEndcapIndex() const
Returns the side (O=Negative, 1=Positive)
Definition: FCALModule.cxx:69
FCALModule::tubexy_t
std::pair< double, double > tubexy_t
X/Y pairs of tile sizes.
Definition: FCALModule.h:150
FCALModule::m_manager
FCALDetectorManager * m_manager
Point to the manager.
Definition: FCALModule.h:145
makeTRTBarrelCans.dy
tuple dy
Definition: makeTRTBarrelCans.py:21
FCAL_ChannelMap::tileMap_const_iterator
tileMap_t::const_iterator tileMap_const_iterator
Definition: LArCalorimeter/LArGeoModel/LArReadoutGeometry/LArReadoutGeometry/FCAL_ChannelMap.h:144
FCALModule::getTile
const FCALTile * getTile(int i, int j) const
Returns a tile by indices i and j.
Definition: FCALModule.cxx:56
operator<
bool operator<(unsigned int i, const FCALTile &t)
Definition: FCALModule.cxx:17
FCALModule::getFullWidthY
double getFullWidthY(const FCALTile &tile) const
Gets Tile Full Width in Y.
Definition: FCALModule.cxx:84
FCALDetectorManager::getChannelMap
const FCAL_ChannelMap * getChannelMap() const
Returns the Channel Map.
Definition: FCALDetectorManager.h:126
makeTRTBarrelCans.dx
tuple dx
Definition: makeTRTBarrelCans.py:20
FCAL_ChannelMap::begin
tileMap_const_iterator begin(int isam) const
Definition: LArCalorimeter/LArGeoModel/LArReadoutGeometry/LArReadoutGeometry/FCAL_ChannelMap.h:147
FCAL_ChannelMap::tileSize
void tileSize(int sam, int eta, int phi, float &dx, float &dy) const
Definition: LArCalorimeter/LArGeoModel/LArReadoutGeometry/src/FCAL_ChannelMap.cxx:429
FCALModule::m_dz
double m_dz
Holds Delta Z, Full width of a cell.
Definition: FCALModule.h:158
FCALModule::Module
Module
Definition: FCALModule.h:37
FCALModule::beginTiles
FCALModule::ConstIterator beginTiles() const
Iteration over FCAL Tiles.
Definition: FCALModule.cxx:46
FCALModule.h