Project
Loading...
Searching...
No Matches
V11Geometry.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
14
15#ifndef ALICEO2_ITS_V11GEOMETRY_H_
16#define ALICEO2_ITS_V11GEOMETRY_H_
17
18#include <TMath.h> // for DegToRad, Cos, Sin, Tan
19#include <TObject.h> // for TObject
20#include "Rtypes.h" // for Double_t, Int_t, Bool_t, V11Geometry::Class, etc
21
22class TGeoArb8; // lines 11-11
23class TGeoBBox; // lines 16-16
24class TGeoConeSeg; // lines 15-15
25class TGeoPcon; // lines 12-12
26class TGeoTube; // lines 13-13
27class TGeoTubeSeg; // lines 14-14
28
29namespace o2
30{
31namespace its
32{
33
40class V11Geometry : public TObject
41{
42
43 public:
44 V11Geometry() : mDebug(), mDetName("ITS"){};
45
46 V11Geometry(Int_t debug, const char* name = "ITS") : mDebug(debug), mDetName(name){};
47
49 override = default;
50
52 void SetDetName(const char* name)
53 {
54 mDetName = name;
55 }
56
58 const char* GetDetName() const
59 {
60 return mDetName;
61 }
62
64 void setDebug(Int_t level = 5)
65 {
66 mDebug = level;
67 }
68
71 {
72 mDebug = 0;
73 }
74
76 Bool_t getDebug(Int_t level = 1) const
77 {
78 return mDebug >= level;
79 }
80
81 // Static functions
82
85 Double_t sinD(Double_t deg) const
86 {
87 return TMath::Sin(deg * TMath::DegToRad());
88 }
89
91 Double_t cosD(Double_t deg) const
92 {
93 return TMath::Cos(deg * TMath::DegToRad());
94 }
95
97 Double_t tanD(Double_t deg) const
98 {
99 return TMath::Tan(deg * TMath::DegToRad());
100 }
101
111 void intersectLines(Double_t m, Double_t x0, Double_t y0, Double_t n, Double_t x1, Double_t y1, Double_t& xi,
112 Double_t& yi) const;
113
124 static Bool_t intersectCircle(Double_t m, Double_t x0, Double_t y0, Double_t rr, Double_t xc, Double_t yc,
125 Double_t& xi1, Double_t& yi1, Double_t& xi2, Double_t& yi2);
126
136 Double_t yFrom2Points(Double_t x0, Double_t y0, Double_t x1, Double_t y1, Double_t x) const;
137
147 Double_t xFrom2Points(Double_t x0, Double_t y0, Double_t x1, Double_t y1, Double_t y) const;
148
158 Double_t rMaxFrom2Points(const TGeoPcon* p, Int_t i1, Int_t i2, Double_t z) const;
159
168 Double_t rMinFrom2Points(const TGeoPcon* p, Int_t i1, Int_t i2, Double_t z) const;
169
179 Double_t rFrom2Points(const Double_t* ar, const Double_t* az, Int_t i1, Int_t i2, Double_t z) const;
180
189 Double_t zFrom2MinPoints(const TGeoPcon* p, Int_t i1, Int_t i2, Double_t r) const;
190
199 Double_t zFrom2MaxPoints(const TGeoPcon* p, Int_t i1, Int_t i2, Double_t r) const;
200
210 Double_t zFrom2Points(const Double_t* az, const Double_t* ar, Int_t i1, Int_t i2, Double_t r) const;
211
222 Double_t rMaxFromZpCone(const TGeoPcon* p, int ip, Double_t tc, Double_t z, Double_t th = 0.0) const;
223
224 // General Cone surface equation R(z). Returns the value R correstponding to the line at
225 // angle th, offset by th, and the point p->GetZ/Rmax[ip] at the location z.
226 // \param Double_t ar The array of R values
227 // \param Double_t az The array of Z values
228 // \param Int_t ip The index in p to get the point location
229 // \param Double_t tc The angle of that part of the cone is at
230 // \param Double_t z The value of z to compute R from
231 // \param Double_t th The perpendicular distance the parralell line is from the point ip
232 Double_t rFromZpCone(const Double_t* ar, const Double_t* az, int ip, Double_t tc, Double_t z,
233 Double_t th = 0.0) const;
234
245 Double_t rMinFromZpCone(const TGeoPcon* p, Int_t ip, Double_t tc, Double_t z, Double_t th = 0.0) const;
246
257 Double_t zFromRMaxpCone(const TGeoPcon* p, int ip, Double_t tc, Double_t r, Double_t th = 0.0) const;
258
268 Double_t zFromRMaxpCone(const Double_t* ar, const Double_t* az, Int_t ip, Double_t tc, Double_t r,
269 Double_t th = 0.0) const;
270
281 Double_t zFromRMinpCone(const TGeoPcon* p, int ip, Double_t tc, Double_t r, Double_t th = 0.0) const;
282
300 void insidePoint(const TGeoPcon* p, Int_t i1, Int_t i2, Int_t i3, Double_t Cthick, TGeoPcon* q, Int_t j1,
301 Bool_t max) const;
302
316 void insidePoint(Double_t x0, Double_t y0, Double_t x1, Double_t y1, Double_t x2, Double_t y2, Double_t c,
317 Double_t& x, Double_t& y) const;
318
329 void radiusOfCurvature(Double_t rc, Double_t theta0, Double_t z0, Double_t r0, Double_t theta1, Double_t& z1,
330 Double_t& r1) const;
331
332 // Output functions for debugging
333
336 void printArb8(const TGeoArb8* a) const;
337
340 void printPcon(const TGeoPcon* a) const;
341
344 void printTube(const TGeoTube* a) const;
345
348 void printTubeSeg(const TGeoTubeSeg* a) const;
349
352 void printConeSeg(const TGeoConeSeg* a) const;
353
356 void printBBox(const TGeoBBox* a) const;
357
369 void drawCrossSection(const TGeoPcon* p, Int_t fillc = 7, Int_t fills = 4050, Int_t linec = 3, Int_t lines = 1,
370 Int_t linew = 4, Int_t markc = 2, Int_t marks = 4, Float_t marksize = 1.0) const;
371
388 Bool_t angleOfIntersectionWithLine(Double_t x0, Double_t y0, Double_t x1, Double_t y1, Double_t xc, Double_t yc,
389 Double_t rc, Double_t& t0, Double_t& t1) const;
390
394 /*
395 <img src="picts/ITS/V11Geometry_AnglesForRoundedCorners.gif">
396 */
397 // End_Html
406 void anglesForRoundedCorners(Double_t x0, Double_t y0, Double_t r0, Double_t x1, Double_t y1, Double_t r1,
407 Double_t& t0, Double_t& t1) const;
408
416
417 virtual void createMaterials(){};
418
427 void makeFigure1(Double_t x0 = 0.0, Double_t y0 = 0.0, Double_t r0 = 2.0, Double_t x1 = -4.0, Double_t y1 = -2.0,
428 Double_t r1 = 1.0);
429
430 protected:
431 // Units, Convert from k?? to cm,degree,GeV,seconds,
432 static const Double_t sMicron;
433 static const Double_t sMm;
434 static const Double_t sCm;
435 static const Double_t sDegree;
436 static const Double_t sRadian;
437 static const Double_t sGCm3;
438 static const Double_t sKgm3;
439 static const Double_t sKgdm3;
440 static const Double_t sCelsius;
441 static const Double_t sPascal;
442 static const Double_t sKPascal;
443 static const Double_t sEV;
444 static const Double_t sKEV;
445 static const Double_t sMEV;
446 static const Double_t sGEV;
447
448 private:
455 Double_t angleForRoundedCorners0(Double_t dx, Double_t dy, Double_t sdr) const;
456
463 Double_t angleForRoundedCorners1(Double_t dx, Double_t dy, Double_t sdr) const;
464
465 Int_t mDebug;
466 const char* mDetName;
467 ClassDefOverride(V11Geometry, 1); // Base class for ITS v11 geometry
468};
469} // namespace its
470} // namespace o2
471
472#endif
uint32_t c
Definition RawData.h:2
std::ostringstream debug
Double_t zFrom2MaxPoints(const TGeoPcon *p, Int_t i1, Int_t i2, Double_t r) const
void printTube(const TGeoTube *a) const
void printPcon(const TGeoPcon *a) const
static Bool_t intersectCircle(Double_t m, Double_t x0, Double_t y0, Double_t rr, Double_t xc, Double_t yc, Double_t &xi1, Double_t &yi1, Double_t &xi2, Double_t &yi2)
static const Double_t sKEV
Energy in KeV.
void insidePoint(const TGeoPcon *p, Int_t i1, Int_t i2, Int_t i3, Double_t Cthick, TGeoPcon *q, Int_t j1, Bool_t max) const
Double_t rFromZpCone(const Double_t *ar, const Double_t *az, int ip, Double_t tc, Double_t z, Double_t th=0.0) const
void printTubeSeg(const TGeoTubeSeg *a) const
Double_t rFrom2Points(const Double_t *ar, const Double_t *az, Int_t i1, Int_t i2, Double_t z) const
static const Double_t sGCm3
Density in g/cm^3.
Double_t zFromRMaxpCone(const Double_t *ar, const Double_t *az, Int_t ip, Double_t tc, Double_t r, Double_t th=0.0) const
void intersectLines(Double_t m, Double_t x0, Double_t y0, Double_t n, Double_t x1, Double_t y1, Double_t &xi, Double_t &yi) const
Double_t cosD(Double_t deg) const
Cosine function.
Definition V11Geometry.h:91
void printConeSeg(const TGeoConeSeg *a) const
void printBBox(const TGeoBBox *a) const
const char * GetDetName() const
Get detector name.
Definition V11Geometry.h:58
Double_t zFromRMaxpCone(const TGeoPcon *p, int ip, Double_t tc, Double_t r, Double_t th=0.0) const
Double_t xFrom2Points(Double_t x0, Double_t y0, Double_t x1, Double_t y1, Double_t y) const
Double_t rMaxFromZpCone(const TGeoPcon *p, int ip, Double_t tc, Double_t z, Double_t th=0.0) const
Double_t sinD(Double_t deg) const
Definition V11Geometry.h:85
static const Double_t sKPascal
Preasure in KPascal.
Bool_t angleOfIntersectionWithLine(Double_t x0, Double_t y0, Double_t x1, Double_t y1, Double_t xc, Double_t yc, Double_t rc, Double_t &t0, Double_t &t1) const
void makeFigure1(Double_t x0=0.0, Double_t y0=0.0, Double_t r0=2.0, Double_t x1=-4.0, Double_t y1=-2.0, Double_t r1=1.0)
static const Double_t sMm
Convert mm to TGeom's cm.
Double_t rMaxFrom2Points(const TGeoPcon *p, Int_t i1, Int_t i2, Double_t z) const
Double_t yFrom2Points(Double_t x0, Double_t y0, Double_t x1, Double_t y1, Double_t x) const
void setNoDebug()
Clears the debug flag so no debugging output will be generated.
Definition V11Geometry.h:70
void drawCrossSection(const TGeoPcon *p, Int_t fillc=7, Int_t fills=4050, Int_t linec=3, Int_t lines=1, Int_t linew=4, Int_t markc=2, Int_t marks=4, Float_t marksize=1.0) const
static const Double_t sKgm3
Density in kg/m^3.
void radiusOfCurvature(Double_t rc, Double_t theta0, Double_t z0, Double_t r0, Double_t theta1, Double_t &z1, Double_t &r1) const
Double_t rMinFromZpCone(const TGeoPcon *p, Int_t ip, Double_t tc, Double_t z, Double_t th=0.0) const
static const Double_t sEV
Energy in eV.
void setDebug(Int_t level=5)
Sets the debug flag for debugging output.
Definition V11Geometry.h:64
Double_t zFromRMinpCone(const TGeoPcon *p, int ip, Double_t tc, Double_t r, Double_t th=0.0) const
virtual void createMaterials()
static const Double_t sPascal
Preasure in Pascal.
Double_t zFrom2MinPoints(const TGeoPcon *p, Int_t i1, Int_t i2, Double_t r) const
~V11Geometry() override=default
static const Double_t sDegree
Convert degrees to TGeom's degrees.
Double_t tanD(Double_t deg) const
Tangent function.
Definition V11Geometry.h:97
static const Double_t sMicron
Convert micron to TGeom's cm.
static const Double_t sKgdm3
Density in kg/dm^3.
void SetDetName(const char *name)
Set detector name.
Definition V11Geometry.h:52
V11Geometry(Int_t debug, const char *name="ITS")
Definition V11Geometry.h:46
Double_t zFrom2Points(const Double_t *az, const Double_t *ar, Int_t i1, Int_t i2, Double_t r) const
static const Double_t sGEV
Energy in GeV.
static const Double_t sRadian
To Radians.
static const Double_t sCelsius
Temperature in degrees Celcius.
void printArb8(const TGeoArb8 *a) const
Bool_t getDebug(Int_t level=1) const
Returns the debug flag value.
Definition V11Geometry.h:76
Double_t rMinFrom2Points(const TGeoPcon *p, Int_t i1, Int_t i2, Double_t z) const
static const Double_t sMEV
Energy in MeV.
static const Double_t sCm
Convert cm to TGeom's cm.
void anglesForRoundedCorners(Double_t x0, Double_t y0, Double_t r0, Double_t x1, Double_t y1, Double_t r1, Double_t &t0, Double_t &t1) const
GLdouble n
Definition glcorearb.h:1982
GLint GLenum GLint x
Definition glcorearb.h:403
const GLfloat * m
Definition glcorearb.h:4066
GLuint GLfloat GLfloat GLfloat GLfloat y1
Definition glcorearb.h:5034
GLuint GLfloat GLfloat GLfloat x1
Definition glcorearb.h:5034
GLuint const GLchar * name
Definition glcorearb.h:781
GLuint GLfloat x0
Definition glcorearb.h:5034
GLint level
Definition glcorearb.h:275
GLboolean r
Definition glcorearb.h:1233
GLuint GLfloat GLfloat GLfloat GLfloat GLfloat GLfloat GLfloat t0
Definition glcorearb.h:5034
GLboolean GLboolean GLboolean GLboolean a
Definition glcorearb.h:1233
GLuint GLfloat GLfloat y0
Definition glcorearb.h:5034
GLdouble GLdouble GLdouble z
Definition glcorearb.h:843
GLuint GLfloat GLfloat GLfloat GLfloat GLfloat GLfloat GLfloat GLfloat GLfloat t1
Definition glcorearb.h:5034
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...
constexpr size_t max