BOSS 7.1.1
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 16 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
64 }

◆ ~Emc_helix()

Emc_helix::~Emc_helix ( void )
inline

Definition at line 22 of file Emc_helix.h.

22{};

Member Function Documentation

◆ debugOpt()

void Emc_helix::debugOpt ( int deb)
inline

Definition at line 41 of file Emc_helix.h.

41 {
42 _debug = deb;
43 }

◆ Emc_Get()

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

Definition at line 67 of file Emc_helix.cxx.

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

Referenced by EsTimeAlg::execute().

◆ pathlCut()

void Emc_helix::pathlCut ( double pathl_max)
inline

Definition at line 45 of file Emc_helix.h.

45 {
46 _pathl_cut = pathl_max;
47 }

Referenced by EsTimeAlg::execute().

◆ zemcCut()

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

Definition at line 49 of file Emc_helix.h.

49 {
50 _zemc_cutm = zemc_min;
51 _zemc_cutx = zemc_max;
52 }

Member Data Documentation

◆ Dr

double Emc_helix::Dr

Definition at line 34 of file Emc_helix.h.

Referenced by Emc_Get().

◆ Dz

double Emc_helix::Dz

Definition at line 34 of file Emc_helix.h.

Referenced by Emc_Get().

◆ Fi_emc

double Emc_helix::Fi_emc

Definition at line 27 of file Emc_helix.h.

Referenced by Emc_Get().

◆ Kappa

double Emc_helix::Kappa

Definition at line 34 of file Emc_helix.h.

Referenced by Emc_Get().

◆ NTrk

int Emc_helix::NTrk

Definition at line 35 of file Emc_helix.h.

◆ Phi0

double Emc_helix::Phi0

Definition at line 34 of file Emc_helix.h.

Referenced by Emc_Get().

◆ Phi1

double Emc_helix::Phi1

Definition at line 36 of file Emc_helix.h.

Referenced by Emc_Get().

◆ phi_emc

double Emc_helix::phi_emc

Definition at line 31 of file Emc_helix.h.

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

◆ R_emc

double Emc_helix::R_emc

Definition at line 26 of file Emc_helix.h.

Referenced by Emc_Get().

◆ Tanl

double Emc_helix::Tanl

Definition at line 34 of file Emc_helix.h.

Referenced by Emc_Get().

◆ theta_emc

double Emc_helix::theta_emc

Definition at line 30 of file Emc_helix.h.

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

◆ W_emc

double Emc_helix::W_emc

Definition at line 28 of file Emc_helix.h.

◆ Z_emc

double Emc_helix::Z_emc

Definition at line 29 of file Emc_helix.h.

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


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