ATLAS Offline Software
Loading...
Searching...
No Matches
CaloGeometry.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3*/
4
5#ifndef ISF_FASTCALOSIMPARAMETRIZATION_CALOGEOMETRY_H
6#define ISF_FASTCALOSIMPARAMETRIZATION_CALOGEOMETRY_H
7
8#include <TMath.h>
9
10#include <atomic>
11#include <vector>
12#include <map>
13#include <iostream>
14
19#include "LArReadoutGeometry/FCAL_ChannelMap.h"
21
23class TCanvas;
24class TGraph;
25class TGraphErrors;
26
27class CaloGeometry : virtual public ICaloGeometry {
28 public :
29 static const int MAX_SAMPLING;
30
32 static std::atomic<bool> m_debug;
33
35 virtual ~CaloGeometry();
36
37 virtual bool PostProcessGeometry();
38
39 virtual void Validate ATLAS_NOT_THREAD_SAFE (int nrnd=100);
40
41 virtual const CaloDetDescrElement* getDDE(Identifier identify) const;
42 virtual const CaloDetDescrElement* getDDE(int sampling, Identifier identify) const;
43
44 virtual const CaloDetDescrElement* getDDE(int sampling,float eta,float phi,float* distance=0,int* steps=0) const;
45 virtual const CaloDetDescrElement* getFCalDDE(int sampling,float x,float y,float z,float* distance=0,int* steps=0) const;
46 bool getClosestFCalCellIndex(int sampling,float x,float y,int& ieta, int& iphi,int* steps=0) const;
47
48 double deta(int sample,double eta) const;
49 void minmaxeta(int sample,double eta,double& mineta,double& maxeta) const;
50 double rzmid(int sample,double eta) const;
51 double rzent(int sample,double eta) const;
52 double rzext(int sample,double eta) const;
53 double rmid(int sample,double eta) const;
54 double rent(int sample,double eta) const;
55 double rext(int sample,double eta) const;
56 double zmid(int sample,double eta) const;
57 double zent(int sample,double eta) const;
58 double zext(int sample,double eta) const;
59 double rpos(int sample,double eta,int subpos = CaloSubPos::SUBPOS_MID) const;
60 double zpos(int sample,double eta,int subpos = CaloSubPos::SUBPOS_MID) const;
61 double rzpos(int sample,double eta,int subpos = CaloSubPos::SUBPOS_MID) const;
62 bool isCaloBarrel(int sample) const {return m_isCaloBarrel[sample];};
63 static std::string SamplingName(int sample);
64
65 TGraphErrors* GetGraph(unsigned int sample) const {return m_graph_layers[sample];};
66 void SetDoGraphs(bool dographs=true) {m_dographs=dographs;};
67 bool DoGraphs() const {return m_dographs;};
68
69 TGraph* DrawGeoSampleForPhi0(int sample, int calocol, bool print=false);
70 TCanvas* DrawGeoForPhi0();
71
73 void SetFCal_ChannelMap(const FCAL_ChannelMap* fcal_ChannnelMap){m_FCal_ChannelMap=*fcal_ChannnelMap;}
75 virtual bool checkFCalGeometryConsistency();
76 virtual void PrintMapInfo(int i, int j);
77
78#ifdef USE_GPU
79 //needed by the FCS-GPU
80 t_cellmap * get_cells() { return &m_cells ; } ;
81 size_t get_n_regions(int sample ){ return m_cells_in_regions[sample].size() ;} ;
82 size_t get_region_size(int sample, int region ){ return m_cells_in_regions[sample][region]->size() ; } ;
83 int get_tot_regions() {
84 int n=0 ;
85 for (int s =0 ; s<MAX_SAMPLING; ++s) n += m_cells_in_regions[s].size();
86 return n ;
87 }
88 CaloGeometryLookup* get_region(int sample, int region) { return m_cells_in_regions[sample][region] ; } ;
89#endif
90
91 protected:
92 virtual void addcell(const CaloDetDescrElement* cell);
93
94 virtual void post_process(int layer);
95
96
97
98 virtual void InitRZmaps();
99
101 std::vector< t_cellmap > m_cells_in_sampling;
102 std::vector< t_eta_cellmap > m_cells_in_sampling_for_phi0;
103 std::vector< std::vector< CaloGeometryLookup* > > m_cells_in_regions;
104
105 std::vector< bool > m_isCaloBarrel;
106 std::vector< double > m_min_eta_sample[2]; //[side][calosample]
107 std::vector< double > m_max_eta_sample[2]; //[side][calosample]
108 std::vector< FSmap< double , double > > m_rmid_map[2]; //[side][calosample]
109 std::vector< FSmap< double , double > > m_zmid_map[2]; //[side][calosample]
110 std::vector< FSmap< double , double > > m_rent_map[2]; //[side][calosample]
111 std::vector< FSmap< double , double > > m_zent_map[2]; //[side][calosample]
112 std::vector< FSmap< double , double > > m_rext_map[2]; //[side][calosample]
113 std::vector< FSmap< double , double > > m_zext_map[2]; //[side][calosample]
114
116 std::vector< TGraphErrors* > m_graph_layers;
117 FCAL_ChannelMap m_FCal_ChannelMap; // for hit-to-cell assignment in FCal
118 std::vector<double> m_FCal_rmin,m_FCal_rmax;
119
120
121 /*
122 double m_min_eta_sample[2][MAX_SAMPLING]; //[side][calosample]
123 double m_max_eta_sample[2][MAX_SAMPLING]; //[side][calosample]
124 FSmap< double , double > m_rmid_map[2][MAX_SAMPLING]; //[side][calosample]
125 FSmap< double , double > m_zmid_map[2][MAX_SAMPLING]; //[side][calosample]
126 FSmap< double , double > m_rent_map[2][MAX_SAMPLING]; //[side][calosample]
127 FSmap< double , double > m_zent_map[2][MAX_SAMPLING]; //[side][calosample]
128 FSmap< double , double > m_rext_map[2][MAX_SAMPLING]; //[side][calosample]
129 FSmap< double , double > m_zext_map[2][MAX_SAMPLING]; //[side][calosample]
130 */
131};
132
133#endif
Scalar eta() const
pseudorapidity method
Scalar phi() const
phi method
std::map< Identifier, const CaloDetDescrElement * > t_cellmap
void print(char *figname, TCanvas *c1)
#define y
#define x
#define z
Define macros for attributes used to control the static checker.
This class groups all DetDescr information related to a CaloCell.
std::vector< FSmap< double, double > > m_zent_map[2]
t_cellmap m_cells
virtual void InitRZmaps()
double deta(int sample, double eta) const
std::vector< t_cellmap > m_cells_in_sampling
std::vector< t_eta_cellmap > m_cells_in_sampling_for_phi0
virtual void post_process(int layer)
std::vector< double > m_max_eta_sample[2]
double zmid(int sample, double eta) const
double rent(int sample, double eta) const
bool isCaloBarrel(int sample) const
double zent(int sample, double eta) const
std::vector< FSmap< double, double > > m_rext_map[2]
virtual const CaloDetDescrElement * getFCalDDE(int sampling, float x, float y, float z, float *distance=0, int *steps=0) const
std::vector< FSmap< double, double > > m_zext_map[2]
FCAL_ChannelMap m_FCal_ChannelMap
std::vector< FSmap< double, double > > m_zmid_map[2]
double rmid(int sample, double eta) const
static std::string SamplingName(int sample)
static std::atomic< bool > m_debug
virtual bool PostProcessGeometry()
TGraph * DrawGeoSampleForPhi0(int sample, int calocol, bool print=false)
static const int MAX_SAMPLING
double zpos(int sample, double eta, int subpos=CaloSubPos::SUBPOS_MID) const
double rzpos(int sample, double eta, int subpos=CaloSubPos::SUBPOS_MID) const
void calculateFCalRminRmax()
virtual void Validate ATLAS_NOT_THREAD_SAFE(int nrnd=100)
bool getClosestFCalCellIndex(int sampling, float x, float y, int &ieta, int &iphi, int *steps=0) const
double rext(int sample, double eta) const
virtual void PrintMapInfo(int i, int j)
virtual const CaloDetDescrElement * getDDE(Identifier identify) const
FCAL_ChannelMap * GetFCAL_ChannelMap()
double rzmid(int sample, double eta) const
std::vector< double > m_min_eta_sample[2]
bool DoGraphs() const
std::vector< TGraphErrors * > m_graph_layers
TCanvas * DrawGeoForPhi0()
std::vector< double > m_FCal_rmin
TGraphErrors * GetGraph(unsigned int sample) const
virtual void addcell(const CaloDetDescrElement *cell)
void SetFCal_ChannelMap(const FCAL_ChannelMap *fcal_ChannnelMap)
void minmaxeta(int sample, double eta, double &mineta, double &maxeta) const
std::vector< std::vector< CaloGeometryLookup * > > m_cells_in_regions
double zext(int sample, double eta) const
virtual bool checkFCalGeometryConsistency()
static const Identifier m_debug_identify
std::vector< FSmap< double, double > > m_rmid_map[2]
double rzext(int sample, double eta) const
double rpos(int sample, double eta, int subpos=CaloSubPos::SUBPOS_MID) const
std::vector< bool > m_isCaloBarrel
void SetDoGraphs(bool dographs=true)
std::vector< FSmap< double, double > > m_rent_map[2]
std::vector< double > m_FCal_rmax
virtual ~CaloGeometry()
double rzent(int sample, double eta) const
This class contains the tube and tile maps for the FCAL A tile is of a set of FCAL tubes.