| 224 |
Double_t rz = s1_pz-s3_pz; |
Double_t rz = s1_pz-s3_pz; |
| 225 |
|
|
| 226 |
Double_t thmax = (180./Pi())*(ACos(rz/Sqrt(rx*rx+ry*ry+rz*rz))); |
Double_t thmax = (180./Pi())*(ACos(rz/Sqrt(rx*rx+ry*ry+rz*rz))); |
| 227 |
Double_t phmax = (180./Pi())*(ATan2(ry,rx)); |
//Double_t phmax = (180./Pi())*(ATan2(ry,rx)); |
| 228 |
//cout << "~~~~~~Theta max Phi max : " << thmax <<", "<< phmax << endl; |
//cout << "~~~~~~Theta max Phi max : " << thmax <<", "<< phmax << endl; |
| 229 |
|
|
| 230 |
//generate a track check and let it go only if it is passing through all |
//generate a track check and let it go only if it is passing through all |
| 234 |
do |
do |
| 235 |
{ |
{ |
| 236 |
//cout << "+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+" << endl; |
//cout << "+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+" << endl; |
| 237 |
GenSphDist(r, 0., thmax, 0., phmax); |
GenSphDist(r, 0., thmax, 0., 360.); |
| 238 |
|
|
| 239 |
Double_t th = (Pi()/180.)*fprim.fTHETA; |
Double_t th = (Pi()/180.)*fprim.fTHETA; |
| 240 |
Double_t ph = (Pi()/180.)*fprim.fPHI; |
Double_t ph = (Pi()/180.)*fprim.fPHI; |
| 242 |
|
|
| 243 |
Double_t x1, y1, x2, y2, x3, y3; |
Double_t x1, y1, x2, y2, x3, y3; |
| 244 |
|
|
| 245 |
x1 = s1_pz*Tan(th)*Cos(ph); |
x1 = s1_pz*Tan(th)*Cos(ph) - fprim.fX0; |
| 246 |
y1 = s1_pz*Tan(th)*Sin(ph); |
y1 = s1_pz*Tan(th)*Sin(ph) - fprim.fY0; |
| 247 |
x2 = s2_pz*Tan(th)*Cos(ph); |
x2 = s2_pz*Tan(th)*Cos(ph) - fprim.fX0; |
| 248 |
y2 = s2_pz*Tan(th)*Sin(ph); |
y2 = s2_pz*Tan(th)*Sin(ph) - fprim.fY0; |
| 249 |
x3 = s3_pz*Tan(th)*Cos(ph); |
x3 = s3_pz*Tan(th)*Cos(ph) - fprim.fX0; |
| 250 |
y3 = s3_pz*Tan(th)*Sin(ph); |
y3 = s3_pz*Tan(th)*Sin(ph) - fprim.fY0; |
| 251 |
|
|
| 252 |
if ( Abs(x1) <= Abs(s1_x) && Abs(y1) <= Abs(s1_y) && |
if ( Abs(x1) <= Abs(s1_x) && Abs(y1) <= Abs(s1_y) && |
| 253 |
Abs(x2) <= Abs(s2_x) && Abs(y2) <= Abs(s2_y) && |
Abs(x2) <= Abs(s2_x) && Abs(y2) <= Abs(s2_y) && |