Project
Loading...
Searching...
No Matches
Geometry.h
Go to the documentation of this file.
1// Copyright 2019-2020 CERN and copyright holders of ALICE O2.
2// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
3// All rights not expressly granted are reserved.
4//
5// This software is distributed under the terms of the GNU General Public
6// License v3 (GPL Version 3), copied verbatim in the file "COPYING".
7//
8// In applying this license CERN does not waive the privileges and immunities
9// granted to it by virtue of its status as an Intergovernmental Organization
10// or submit itself to any jurisdiction.
11
16
17#ifndef ALICEO2_ECAL_GEOMETRY_H
18#define ALICEO2_ECAL_GEOMETRY_H
19
20#include <vector>
21#include <math.h>
22#include <Rtypes.h>
23
24namespace o2
25{
26namespace ecal
27{
29{
30 public:
32 {
33 static Geometry sGeom;
34 return sGeom;
35 }
36
37 int getNcols() const;
38 int getNrows() const;
39 std::pair<int, int> getSectorChamber(int cellId) const;
40 std::pair<int, int> getSectorChamber(int iphi, int iz) const;
41
43 int getCellID(int moduleId, int sectorId, bool isCrystal);
44 void detIdToRelIndex(int cellId, int& chamber, int& sector, int& iphi, int& iz) const;
45 void detIdToGlobalPosition(int detId, double& x, double& y, double& z);
46 std::pair<int, int> globalRowColFromIndex(int cellID) const;
47 bool isCrystal(int cellID);
48 int areNeighboursVertex(int detId1, int detId2) const;
49
50 double getTanBeta(int i) { return mTanBeta[i]; }
51 double getFrontFaceZatMinR(int i) { return mFrontFaceZatMinR[i]; }
52 double getFrontFaceCenterR(int i) { return mFrontFaceCenterR[i]; }
53 double getFrontFaceCenterZ(int i) { return mFrontFaceCenterZ[i]; }
54 double getFrontFaceCenterSamplingPhi(int i) { return mFrontFaceCenterSamplingPhi[i]; }
55 double getFrontFaceCenterCrystalPhi(int i) { return mFrontFaceCenterCrystalPhi[i]; }
56 double getFrontFaceCenterTheta(int i) { return mFrontFaceCenterTheta[i]; }
57 double getRMin() { return mRMin; }
58 double getCrystalModW() { return mCrystalModW; }
59 double getSamplingModW() { return mSamplingModW; }
60 double getCrystalAlpha() { return mCrystalAlpha; }
61 double getSamplingAlpha() { return mSamplingAlpha; }
62 double getCrystalDeltaPhi() { return 2 * std::atan(mCrystalModW / 2 / mRMin); }
63 double getSamplingDeltaPhi() { return 2 * std::atan(mSamplingModW / 2 / mRMin); }
64 double getFrontFaceMaxEta(int i);
65 double getCrystalPhiMin();
66 double getSamplingPhiMin();
67 int getNModulesZ() { return mNModulesZ; }
68 bool isAtTheEdge(int cellId);
69
70 private:
71 Geometry();
72 Geometry(const Geometry&) = delete;
73 Geometry& operator=(const Geometry&) = delete;
74 ~Geometry() = default;
75 double mRMin{0.};
76 int mNSuperModules{0};
77 int mNCrystalModulesZ{0};
78 int mNSamplingModulesZ{0};
79 int mNCrystalModulesPhi{0};
80 int mNSamplingModulesPhi{0};
81 double mCrystalModW{0.};
82 double mSamplingModW{0.};
83 double mSamplingAlpha{0.};
84 double mCrystalAlpha{0.};
85 double mMarginCrystalToSampling{0.};
86 int mNModulesZ{0};
87 std::vector<double> mFrontFaceZatMinR;
88 std::vector<double> mFrontFaceCenterR;
89 std::vector<double> mFrontFaceCenterZ;
90 std::vector<double> mFrontFaceCenterSamplingPhi;
91 std::vector<double> mFrontFaceCenterCrystalPhi;
92 std::vector<double> mFrontFaceCenterTheta;
93 std::vector<double> mTanBeta;
94
95 ClassDefNV(Geometry, 1);
96};
97} // namespace ecal
98} // namespace o2
99
100#endif // ALICEO2_ECAL_GEOMETRY_H
int32_t i
double getFrontFaceCenterTheta(int i)
Definition Geometry.h:56
double getFrontFaceCenterCrystalPhi(int i)
Definition Geometry.h:55
int getNcols() const
Definition Geometry.cxx:49
std::pair< int, int > globalRowColFromIndex(int cellID) const
Definition Geometry.cxx:170
double getSamplingPhiMin()
Definition Geometry.cxx:69
double getSamplingAlpha()
Definition Geometry.h:61
bool isAtTheEdge(int cellId)
Definition Geometry.cxx:246
void detIdToGlobalPosition(int detId, double &x, double &y, double &z)
Definition Geometry.cxx:212
std::pair< int, int > getSectorChamber(int cellId) const
Definition Geometry.cxx:185
bool isCrystal(int cellID)
Definition Geometry.cxx:178
double getFrontFaceZatMinR(int i)
Definition Geometry.h:51
double getFrontFaceCenterR(int i)
Definition Geometry.h:52
double getFrontFaceCenterSamplingPhi(int i)
Definition Geometry.h:54
double getTanBeta(int i)
Definition Geometry.h:50
double getFrontFaceCenterZ(int i)
Definition Geometry.h:53
double getCrystalModW()
Definition Geometry.h:58
int getNrows() const
Definition Geometry.cxx:55
static Geometry & instance()
Definition Geometry.h:31
void fillFrontFaceCenterCoordinates()
Definition Geometry.cxx:83
double getSamplingDeltaPhi()
Definition Geometry.h:63
double getCrystalPhiMin()
Definition Geometry.cxx:61
void detIdToRelIndex(int cellId, int &chamber, int &sector, int &iphi, int &iz) const
Definition Geometry.cxx:201
double getCrystalDeltaPhi()
Definition Geometry.h:62
int areNeighboursVertex(int detId1, int detId2) const
Definition Geometry.cxx:230
double getFrontFaceMaxEta(int i)
Definition Geometry.cxx:76
int getCellID(int moduleId, int sectorId, bool isCrystal)
Definition Geometry.cxx:150
double getCrystalAlpha()
Definition Geometry.h:60
double getRMin()
Definition Geometry.h:57
double getSamplingModW()
Definition Geometry.h:59
GLint GLenum GLint x
Definition glcorearb.h:403
GLdouble GLdouble GLdouble z
Definition glcorearb.h:843
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...