BOSS 8.0.0
BESIII Offline Software System
Loading...
Searching...
No Matches
Emc_helix Class Reference

#include <Emc_helix.h>

Public Member Functions

 Emc_helix (void)
 ~Emc_helix (void)
int Emc_Get (double, int, double[])
void debugOpt (int deb)
void pathlCut (double pathl_max)
void zemcCut (double zemc_min, double zemc_max)

Public Attributes

double R_emc
double Fi_emc
double W_emc
double Z_emc
double theta_emc
double phi_emc
double Dr
double Phi0
double Kappa
double Dz
double Tanl
int NTrk
double Phi1

Detailed Description

Definition at line 15 of file Emc_helix.h.

Constructor & Destructor Documentation

◆ Emc_helix()

Emc_helix::Emc_helix ( void )

Definition at line 58 of file Emc_helix.cxx.

58 {
59 piby1 = 3.141593;
60 pi2 = 2.0 * piby1;
61 _debug = 0;
62 _pathl_cut = 1000.0;
63}

◆ ~Emc_helix()

Emc_helix::~Emc_helix ( void )
inline

Definition at line 21 of file Emc_helix.h.

21{};

Member Function Documentation

◆ debugOpt()

void Emc_helix::debugOpt ( int deb)
inline

Definition at line 40 of file Emc_helix.h.

40{ _debug = deb; }

◆ Emc_Get()

int Emc_helix::Emc_Get ( double rEmc,
int id,
double fzisan[] )

Definition at line 65 of file Emc_helix.cxx.

65 {
66 // crossing points of the helix on the Emc cylinder
67 double xc, yc; // center of the circle
68 double rho; // radius of emc cyclinder
69 double xx[2], yy[2]; // coordinates of hits
70 double emcx, emcy; // (x,y) on the radius of R_emc
71 double nx, ny; // direction cosines of mom vector at vertex
72 double cosx, sinx;
73 double aa, ca, cb, cc, detm;
74
75 // fzisan track ID and EMC radius
76 int Id_cdfztrk = id;
77 R_emc = rEmc;
78
79 if ( Id_cdfztrk < 0 )
80 {
81 if ( _debug ) std::cout << " Emc_helix *** wrong id_cdfztrk =" << Id_cdfztrk << std::endl;
82 return ( -1 );
83 }
84
85 // fzisan track
86 /* FTFinder * ftrk = FTFinder:: GetPointer();
87 FTList<FTTrack *> & FsTrks = ftrk->tracks();
88 NTrk = FsTrks.length();
89
90 if (NTrk<=0) return (-3);
91
92 // get helix params for Id_cdfztrk
93 FTTrack & trk = * FsTrks[Id_cdfztrk];
94 const Helix hel = * trk.helix();
95
96 const HepPoint3D pivot1(0.,0.,0.);
97 HepVector a(5,0);
98 a[0] = hel.a()[0];
99 a[1] = hel.a()[1];
100 a[2] = hel.a()[2];
101 a[3] = hel.a()[3];
102 a[4] = hel.a()[4];
103 */
104 const HepPoint3D pivot1( 0., 0., 0. );
105 HepVector a( 5, 0 );
106 a[0] = fzisan[0];
107 a[1] = fzisan[1];
108 a[2] = fzisan[2];
109 a[3] = fzisan[3];
110 a[4] = fzisan[4];
111
112 // Ill-fitted track in fzisan (dz=tanl=-9999.)
113 if ( abs( a[3] ) > 50.0 || abs( a[4] ) > 500.0 ) return ( -5 );
114
115 // D e f i n e h e l i x
116 Helix helix1( pivot1, a );
117 Dr = helix1.a()[0];
118 Phi0 = helix1.a()[1];
119 Kappa = helix1.a()[2];
120 Dz = helix1.a()[3];
121 Tanl = helix1.a()[4];
122
123 /* double detaphi=asin(0.5*0.81*0.3*fabs(Kappa));
124 double phi=Phi0+detaphi+ piby1/2;
125 */
126
127 // check cdfztrk hit on Emc cyclinder
128 rho = helix1.radius();
129 // cout<<" Emc_helix:: rho ="<<rho<<endl; // radius of the circle in cm
130 HepPoint3D xyz = helix1.center();
131 xc = xyz( 0 );
132 yc = xyz( 1 );
133
134 Hep3Vector vxyz = helix1.direction();
135 nx = vxyz( 0 ); // direction of track at the vertex
136 ny = vxyz( 1 );
137
138 // get hit on Emc cylinder at radius R_Emc;
139 if ( xc == 0.0 && yc == 0.0 ) return ( -3 );
140
141 // coefficients of quadratic equation
142 ca = xc * xc + yc * yc;
143 aa = 0.5 * ( ca - rho * rho + R_emc * R_emc );
144
145 if ( xc != 0.0 )
146 {
147 cb = aa * yc;
148 cc = aa * aa - R_emc * R_emc * xc * xc;
149 // determinant
150 detm = cb * cb - ca * cc;
151 if ( detm > 0.0 )
152 {
153 yy[0] = ( cb + sqrt( detm ) ) / ca;
154 xx[0] = ( aa - yy[0] * yc ) / xc;
155 yy[1] = ( cb - sqrt( detm ) ) / ca;
156 xx[1] = ( aa - yy[1] * yc ) / xc;
157 }
158 else return ( -1 );
159 }
160 else
161 {
162 cb = aa * xc;
163 cc = aa * aa - R_emc * R_emc * yc * yc;
164 // determinant
165 detm = cb * cb - ca * cc;
166 if ( detm > 0.0 )
167 {
168 xx[0] = ( cb + sqrt( detm ) ) / ca;
169 yy[0] = ( aa - xx[0] * xc ) / yc;
170 xx[1] = ( cb - sqrt( detm ) ) / ca;
171 yy[1] = ( aa - xx[1] * xc ) / yc;
172 }
173 else return ( -2 );
174 }
175
176 // choose one of hits according to track direction at the vertex.
177
178 if ( xx[0] * nx + yy[0] * ny > 0.0 )
179 {
180 emcx = xx[0];
181 emcy = yy[0];
182 }
183 else
184 {
185 emcx = xx[1];
186 emcy = yy[1];
187 }
188
189 double fi = atan2( emcy, emcx ); // atna2 from -pi to pi
190
191 if ( fi < 0.0 ) fi = pi2 + fi;
192 Fi_emc = fi;
193
194 // get phi and z on the emc counter
195 const HepPoint3D pivot2( emcx, emcy, 0.0 );
196 helix1.pivot( pivot2 );
197
198 // corrected by Ozaki san to avoid negative path length on Aug.10,99
199 Phi1 = helix1.a()[1];
200 Z_emc = helix1.a()[3];
201
202 // get(thepa,phi)from the intersection (x,y,z)
203 Hep3Vector intersec( emcx, emcy, Z_emc );
204 theta_emc = intersec.getTheta();
205 phi_emc = intersec.getPhi();
206
207 return ( 1 );
208}
HepGeom::Point3D< double > HepPoint3D
double Kappa
Definition Emc_helix.h:33
double Z_emc
Definition Emc_helix.h:28
double Phi1
Definition Emc_helix.h:35
double theta_emc
Definition Emc_helix.h:29
double Tanl
Definition Emc_helix.h:33
double Fi_emc
Definition Emc_helix.h:26
double Dr
Definition Emc_helix.h:33
double Dz
Definition Emc_helix.h:33
double phi_emc
Definition Emc_helix.h:30
double R_emc
Definition Emc_helix.h:25
double Phi0
Definition Emc_helix.h:33

Referenced by EsTimeAlg::execute().

◆ pathlCut()

void Emc_helix::pathlCut ( double pathl_max)
inline

Definition at line 42 of file Emc_helix.h.

42{ _pathl_cut = pathl_max; }

Referenced by EsTimeAlg::execute().

◆ zemcCut()

void Emc_helix::zemcCut ( double zemc_min,
double zemc_max )
inline

Definition at line 44 of file Emc_helix.h.

44 {
45 _zemc_cutm = zemc_min;
46 _zemc_cutx = zemc_max;
47 }

Member Data Documentation

◆ Dr

double Emc_helix::Dr

Definition at line 33 of file Emc_helix.h.

Referenced by Emc_Get().

◆ Dz

double Emc_helix::Dz

Definition at line 33 of file Emc_helix.h.

Referenced by Emc_Get().

◆ Fi_emc

double Emc_helix::Fi_emc

Definition at line 26 of file Emc_helix.h.

Referenced by Emc_Get().

◆ Kappa

double Emc_helix::Kappa

Definition at line 33 of file Emc_helix.h.

Referenced by Emc_Get().

◆ NTrk

int Emc_helix::NTrk

Definition at line 34 of file Emc_helix.h.

◆ Phi0

double Emc_helix::Phi0

Definition at line 33 of file Emc_helix.h.

Referenced by Emc_Get().

◆ Phi1

double Emc_helix::Phi1

Definition at line 35 of file Emc_helix.h.

Referenced by Emc_Get().

◆ phi_emc

double Emc_helix::phi_emc

Definition at line 30 of file Emc_helix.h.

Referenced by Emc_Get(), and EsTimeAlg::execute().

◆ R_emc

double Emc_helix::R_emc

Definition at line 25 of file Emc_helix.h.

Referenced by Emc_Get().

◆ Tanl

double Emc_helix::Tanl

Definition at line 33 of file Emc_helix.h.

Referenced by Emc_Get().

◆ theta_emc

double Emc_helix::theta_emc

Definition at line 29 of file Emc_helix.h.

Referenced by Emc_Get(), and EsTimeAlg::execute().

◆ W_emc

double Emc_helix::W_emc

Definition at line 27 of file Emc_helix.h.

◆ Z_emc

double Emc_helix::Z_emc

Definition at line 28 of file Emc_helix.h.

Referenced by Emc_Get(), and EsTimeAlg::execute().


The documentation for this class was generated from the following files: