MiniballSort
Loading...
Searching...
No Matches
MiniballGeometry.hh
Go to the documentation of this file.
1#ifndef __MINIBALLGEOMETRY_HH
2#define __MINIBALLGEOMETRY_HH
3
4#include <vector>
5#include <iostream>
6
7#include <TObject.h>
8#include <TVector3.h>
9#include <TMath.h>
10
12
20
21class MiniballGeometry : public TObject {
22
23public:
24
27
30
32 void SetupCluster();
39 void SetupCluster( double user_theta, double user_phi, double user_alpha, double user_r, double user_z );
40
43 inline void SetCluTheta( double user_theta ){ theta = user_theta * TMath::DegToRad(); };
44
47 inline void SetCluPhi( double user_phi ){ phi = user_phi * TMath::DegToRad(); };
48
51 inline void SetCluAlpha( double user_alpha ){ alpha = user_alpha * TMath::DegToRad(); };
52
55 inline void SetCluR( double user_r ){ r = user_r; };
56
59 inline void SetCluZ( double user_z ) { z = user_z; };
60
63 inline void SetGeometryType( unsigned char user_type ) { type = user_type; };
64
66 inline double GetCluTheta(){ return theta; };
67 inline double GetCluPhi(){ return phi; };
68 inline double GetCluAlpha(){ return alpha; };
69 inline double GetCluR(){ return r; };
70 inline unsigned char GetGeometryType(){ return type; };
71
75 inline double GetCryTheta( unsigned char cry ){
76 return GetCryVector(cry).Theta();
77 };
78
82 inline double GetCryPhi( unsigned char cry ){
83 return GetCryVector(cry).Phi();
84 };
85
89 inline TVector3 GetCryVector( unsigned char cry ){
90 return GetSegVector(cry,0);
91 };
92
97 inline double GetSegTheta( unsigned char cry, unsigned char seg ){
98 return GetSegVector(cry,seg).Theta();
99 };
100
105 inline double GetSegPhi( unsigned char cry, unsigned char seg ){
106 return GetSegVector(cry,seg).Phi();
107 };
108
113 inline double GetSegX( unsigned char cry, unsigned char seg ){
114 return GetSegVector(cry,seg).X();
115 };
116
121 inline double GetSegY( unsigned char cry, unsigned char seg ){
122 return GetSegVector(cry,seg).Y();
123 };
124
129 inline double GetSegZ( unsigned char cry, unsigned char seg ){
130 return GetSegVector(cry,seg).Z();
131 };
132
137 inline TVector3 GetSegVector( unsigned char cry, unsigned char seg ){
138 return seg_offset[cry][seg];
139 };
140
141private:
142
143 // Segments etc
144 const unsigned char ncry = 3;
145 const unsigned char nseg = 7; // 6 segments plus core
146
147 // Current values of theta, phi, alpha and r
148 unsigned char type;
149 double theta;
150 double phi;
151 double alpha;
152 double r;
153 double z;
154
155 // Geometry
156 std::vector<std::vector<TVector3>> seg_offset;
157 TVector3 mbzoffset;
159
161
162};
163
164#endif
Functions to convert Miniball angles read from the frame.
void SetCluPhi(double user_phi)
std::vector< std::vector< TVector3 > > seg_offset
vector for segment centre (0 = core)
double GetCryPhi(unsigned char cry)
void SetupCluster()
Setup cluster main routine.
const unsigned char nseg
double GetSegY(unsigned char cry, unsigned char seg)
const unsigned char ncry
double theta
theta angle in radians
~MiniballGeometry()
Destructor.
double alpha
alpha angle in radians
void SetCluAlpha(double user_alpha)
unsigned char type
geometry defintion type
void SetCluZ(double user_z)
ClassDef(MiniballGeometry, 2)
double GetCluTheta()
Getters for the various setters.
double phi
phi angle in radians
void SetCluR(double user_r)
double GetSegZ(unsigned char cry, unsigned char seg)
double z
distance from target to origin (beam direction is positive) in mm
double GetSegTheta(unsigned char cry, unsigned char seg)
double r
distance from target to detector in mm
TVector3 GetCryVector(unsigned char cry)
void SetCluTheta(double user_theta)
void SetupCluster(double user_theta, double user_phi, double user_alpha, double user_r, double user_z)
TVector3 mbzoffset
This shift is independent of the CD detector distance which is relative.
double GetCryTheta(unsigned char cry)
MiniballGeometry()
Constructor.
void SetGeometryType(unsigned char user_type)
double GetSegX(unsigned char cry, unsigned char seg)
unsigned char GetGeometryType()
double GetSegPhi(unsigned char cry, unsigned char seg)
TVector3 GetSegVector(unsigned char cry, unsigned char seg)