FairRoot/PandaRoot
Public Member Functions | List of all members
PndTrkBoundaryParStraws2 Class Reference

#include <PndTrkBoundaryParStraws2.h>

Inheritance diagram for PndTrkBoundaryParStraws2:

Public Member Functions

 PndTrkBoundaryParStraws2 ()
 
 ~PndTrkBoundaryParStraws2 ()
 
void CalculateSpecialRegion (Double_t RSTRAWDETECTORMIN, Double_t APOTEMAMAXINNERPARSTRAW, Double_t APOTEMAMINOUTERPARSTRAW, Double_t VERTICALGAP, Double_t &x, Double_t &y)
 
void Set (Double_t APOTEMAMAXINNERPARSTRAW, Double_t APOTEMAMINOUTERPARSTRAW, Short_t NUMBER_STRAWS, Double_t RSTRAWDETECTORMIN, Double_t RSTRAWDETECTORMAX, bool stampa, TClonesArray *SttTubeArray, Double_t STRAWRADIUS, Double_t VERTICALGAP, Short_t *StrawCode, Short_t *StrawCode2)
 
void SttTubeList (TClonesArray *SttTubeArray, Double_t RSTRAWDETECTORMIN, Double_t RSTRAWDETECTORMAX, Double_t APOTEMAMAXINNERPARSTRAW, Double_t APOTEMAMINOUTERPARSTRAW, Double_t VERTICALGAP, Double_t STRAWRADIUS, Short_t NUMBER_STRAWS, bool stampa, Short_t *StrawCode, Short_t *StrawCode2)
 
 ClassDef (PndTrkBoundaryParStraws2, 1)
 

Detailed Description

Definition at line 8 of file PndTrkBoundaryParStraws2.h.

Constructor & Destructor Documentation

PndTrkBoundaryParStraws2::PndTrkBoundaryParStraws2 ( )
inline

Default constructor

Definition at line 15 of file PndTrkBoundaryParStraws2.h.

15 {};
PndTrkBoundaryParStraws2::~PndTrkBoundaryParStraws2 ( )
inline

Destructor

Definition at line 17 of file PndTrkBoundaryParStraws2.h.

17 {};

Member Function Documentation

void PndTrkBoundaryParStraws2::CalculateSpecialRegion ( Double_t  RSTRAWDETECTORMIN,
Double_t  APOTEMAMAXINNERPARSTRAW,
Double_t  APOTEMAMINOUTERPARSTRAW,
Double_t  VERTICALGAP,
Double_t x,
Double_t y 
)

Definition at line 17 of file PndTrkBoundaryParStraws2.cxx.

References APOTEMAMAXINNERPARSTRAW, APOTEMAMINOUTERPARSTRAW, APOTEMASTRAWDETECTORMIN, exit(), sqrt(), and VERTICALGAP.

25 {
26  double a1 = 16., a2 = 23., a3 = 31.86, delta = 2.;
27 
28 
29  double px, py, qx, qy;
30  double alfa, beta, D, A, B, x1, y1; //x2, y2, //[R.K.02/2017] Unused variable?
31 
35  delta = VERTICALGAP;
36  px = delta/2.;
37  qx = -px;
38  py = (2.*a2-0.5*delta)/sqrt(3.);
39  qy = (-0.5*delta + 2.*a1)/sqrt(3.);
40 
41  beta = -(px*px+py*py+qx*qx+qy*qy)/(py+qy);
42 
43  alfa = (-beta*py-px*px-py*py)/px;
44 
45  A = -4.*a3*sqrt(3.) - alfa*sqrt(3.) + beta ;
46  B = 4.*a3*a3+2.*alfa*a3;
47 
48  D = A*A-16.*B;
49  if( D <0. ) { cout<<"delta = "<<D<<", stop!\n"; exit(-1);};
50  D = sqrt(D);
51 // cout<<"A "<<A<<", B "<<B<<", delta "<<D<<endl;
52  y1 = (-A + D)/8. ;
53  //y2 = (-A - D)/8. ; //[R.K.02/2017] Unused variable?
54 
55  x1 = 2.*a3 - sqrt(3.)*y1;
56  //x2 = 2.*a3 - sqrt(3.)*y2; //[R.K.02/2017] Unused variable?
57 
58  // il punto nel 1 quadrante ha coordinate (x1,y1);
59  // la soluzione (x2,y2) e' l'intersezione che non interessa;
60 
61 // cout<<"soluzione 1 , x1 "<<x1<<", y1 "<<y1<<endl;
62 // cout<<"soluzione 2 , x2 "<<x2<<", y2 "<<y2<<endl;
63 
64  x = x1;
65  y = y1;
66 
67  return ;
68 
69 }
exit(0)
friend F32vec4 sqrt(const F32vec4 &a)
Definition: P4_F32vec4.h:29
const Double_t APOTEMAMINOUTERPARSTRAW
const Double_t VERTICALGAP
const Double_t APOTEMAMAXINNERPARSTRAW
Double_t x
Double_t y
const Double_t APOTEMASTRAWDETECTORMIN
PndTrkBoundaryParStraws2::ClassDef ( PndTrkBoundaryParStraws2  ,
 
)
void PndTrkBoundaryParStraws2::Set ( Double_t  APOTEMAMAXINNERPARSTRAW,
Double_t  APOTEMAMINOUTERPARSTRAW,
Short_t  NUMBER_STRAWS,
Double_t  RSTRAWDETECTORMIN,
Double_t  RSTRAWDETECTORMAX,
bool  stampa,
TClonesArray *  SttTubeArray,
Double_t  STRAWRADIUS,
Double_t  VERTICALGAP,
Short_t *  StrawCode,
Short_t *  StrawCode2 
)

Definition at line 76 of file PndTrkBoundaryParStraws2.cxx.

References i.

Referenced by PndTrkTracking2::Init().

91 {
92  // return true for those parallel Straws that are at the boundary
93  // of the Stt central tracker;
94 
95  // the Stt Straw original number goes from 1 to 4542 included;
96 
97 
98 // StrawCode convention (in the following left or right is looking to the beam from downstream) :
99 // -1 = not a boundary straw;
100 // 10= inner axial boundary left;
101 // 20= inner axial boundary right;
102 // 12= outer VERTICAL (BUT NOT OUTERMOST) axial boundary left;
103 // 22= outer VERTICAL (BUT NOT OUTERMOST) axial boundary right;
104 // 13= outermost axial boundary left;
105 // 23= outermost axial boundary right;
106 
107 
108 
109  for(int i=0;i<NUMBER_STRAWS; i++){
110  StrawCode[i] = -1 ;
111  StrawCode2[i] = -1 ;
112  }
113 
114 
115  SttTubeList(
116  // inputs :
117  SttTubeArray,
122  VERTICALGAP,
123  STRAWRADIUS,
124  NUMBER_STRAWS,
125  stampa,
126  // outputs :
127  StrawCode,
128  StrawCode2
129  );
130 
131  return;
132 
133 }
const Double_t RSTRAWDETECTORMAX
Int_t i
Definition: run_full.C:25
void SttTubeList(TClonesArray *SttTubeArray, Double_t RSTRAWDETECTORMIN, Double_t RSTRAWDETECTORMAX, Double_t APOTEMAMAXINNERPARSTRAW, Double_t APOTEMAMINOUTERPARSTRAW, Double_t VERTICALGAP, Double_t STRAWRADIUS, Short_t NUMBER_STRAWS, bool stampa, Short_t *StrawCode, Short_t *StrawCode2)
const Double_t STRAWRADIUS
const Double_t APOTEMAMINOUTERPARSTRAW
const Double_t VERTICALGAP
const Double_t APOTEMAMAXINNERPARSTRAW
const Double_t APOTEMASTRAWDETECTORMIN
void PndTrkBoundaryParStraws2::SttTubeList ( TClonesArray *  SttTubeArray,
Double_t  RSTRAWDETECTORMIN,
Double_t  RSTRAWDETECTORMAX,
Double_t  APOTEMAMAXINNERPARSTRAW,
Double_t  APOTEMAMINOUTERPARSTRAW,
Double_t  VERTICALGAP,
Double_t  STRAWRADIUS,
Short_t  NUMBER_STRAWS,
bool  stampa,
Short_t *  StrawCode,
Short_t *  StrawCode2 
)

Definition at line 138 of file PndTrkBoundaryParStraws2.cxx.

References APOTEMAMAXINNERPARSTRAW, APOTEMAMINOUTERPARSTRAW, APOTEMASTRAWDETECTORMIN, fabs(), PndSttTube::GetPosition(), PndSttTube::GetWireDirection(), i, num, sqrt(), STRAWRADIUS, x, and y.

153 {
154  int code,
155  i,
156  tubeID;
157  double
158  apotema,
159  dist_x,
160  dist_y,
161  Rrr,
162  x,
163  y,
164  xcircle,
165  ycircle;
166 
167  PndSttTube *pSttTube ;
168  TVector3 center;
169  TVector3 wiredirection;
170 
171 
172 //-----------------------------
173  int num = NUMBER_STRAWS;
174 
175  STRAWRADIUS += 0.005; // take into account the 30 micron Mylar thickness;
176 
177 // calcolo delle regioni 'speciali';
178 
183  VERTICALGAP,
184  x, // ascissa of intersection point in 1st quadrant;
185  y // ordinate of intersection point in 1st quadrant;
186  );
187 
188 
189 //---------------------------------
190 
191  if(stampa){
192  cout<<"numero totale di tubi "<<num<<endl;
193  // il primo tubo e' il n. 1;
194  tubeID=1;
195  pSttTube = (PndSttTube*) SttTubeArray->At(tubeID);
196  center = pSttTube->GetPosition();
197  wiredirection = pSttTube->GetWireDirection();
198  Rrr = sqrt( center.X()*center.X()+center.Y()*center.Y());
199  cout<<"\tFirst STT straw tubeID; n. "<<tubeID<<", centro X "<< center.X()
200  <<", centro Y "<< center.Y()<<", centro Z "<< center.Z()<<", fR = "<<Rrr<<endl;
201  // double HL = pSttTube->GetHalfLength();
202  // ultimo tubo;
203  tubeID=num;
204  pSttTube = (PndSttTube*) SttTubeArray->At(tubeID);
205  center = pSttTube->GetPosition();
206  wiredirection = pSttTube->GetWireDirection();
207  Rrr = sqrt( center.X()*center.X()+center.Y()*center.Y());
208  cout<<"\tLast STT straw tubeID, n. "<<tubeID<<", centro X "<< center.X()
209  <<", centro Y "<< center.Y()<<", centro Z "<< center.Z()<<", fR = "<<Rrr<<endl<<endl;
210  }
211 //---------------------------------
212 
213 
214 // Stt a sinistra (col beam in faccia) --> + 10 nello StrawCode;
215 // Stt a destra (col beam in faccia) --> + 20 nello StrawCode;
216 
217 
218 // Verticali al centro :
219  // abs( X ) < 3 ;
220  // 16 < abs(Y) < 25 --> inner Stt axial section;
221  // 35 < abs(Y) < 40 --> outer Stt axial section;
222 
223 
224  // STT al bordo verticale centrale;
225  cout<<"\tBOUNDARY Straws : Central Vertical Boundary, axial STT straws Center positions :\n";
226  for(i=1;i<=num;i++){
227  pSttTube = (PndSttTube*) SttTubeArray->At(i);
228  center = pSttTube->GetPosition();
229  wiredirection = pSttTube->GetWireDirection();
230  Rrr = sqrt( center.X()*center.X()+center.Y()*center.Y());
231  // solo STT parallel;
232  if(!(fabs( wiredirection.X() )< 0.00001 && fabs( wiredirection.Y() )< 0.00001))continue;
233  if(fabs(center.X())>3.) continue;
234  if(stampa){
235  cout<<"\tSTT straw || tubeID n. "<<i<<", centro X "<< center.X()
236  <<", centro Y "<< center.Y()<<", centro Z "<< center.Z()<<", fR = "<<Rrr;
237  }
238  if( center.X() < 0. ) {
239  if( fabs( center.Y() ) < 30. ) { code = 10;} else {code = 12;};
240  } else {
241  if( fabs( center.Y() ) < 30. ) { code = 20;} else {code = 22;};
242  }
243 
244  if(stampa) cout<<", SttCode = "<<code<<endl;
245 
246  if( StrawCode[i-1] > -1 && StrawCode[i-1] != code) { // to this Tube a StrawCode was already previously assigned;
247  // therefore set StrawCode2;
248  StrawCode2[i-1] = code;
249  } else {
250  StrawCode[i-1] = code;
251  }
252 
253 
254  } // end for(i=1;i<=num;i++)
255 
256 
257  // STT al bordo esterno;
258  if(stampa)cout<<"\n\tExternal Round Boundary || STT straws :\n";
259  for(i=1;i<=num;i++){
260  pSttTube = (PndSttTube*) SttTubeArray->At(i);
261  center = pSttTube->GetPosition();
262  wiredirection = pSttTube->GetWireDirection();
263  // solo STT parallel;
264  if(!(fabs( wiredirection.X() )< 0.00001 && fabs( wiredirection.Y() )< 0.00001))continue;
265 
266  // add also 30 micron of Mylar in the calculation;
267  xcircle = sqrt( RSTRAWDETECTORMAX*RSTRAWDETECTORMAX - center.Y()*center.Y() );
268  ycircle = sqrt( RSTRAWDETECTORMAX*RSTRAWDETECTORMAX - center.X()*center.X() );
269  dist_x = fabs(center.X()) + 3.5 * STRAWRADIUS ;
270  dist_y = fabs(center.Y()) + 3.5 * STRAWRADIUS ;
271  if( dist_x < xcircle && dist_y < ycircle ) continue; // this is not a Outer Stt Straw on the boundary;
272  // special exclusions :
273  if( i == 3628 || i==3514||i==3513 || i==3399 || i==3631 || i==3738 || i==3743 ||
274  i==3850|| i== 3855 || i== 3949|| i==3954 || i==4048) continue;
275 
276 
277  if( i == 3856 || i==3948||i==3955 || i==4047 || i==4045 || i==4137 || i==4144 ||
278  i==4227) continue;
279 
280  if( i == 4055 || i==4136||i==4145 || i==4226 ) continue;
281  if( i == 4235 || i==4301||i==4310 || i==4376 ) continue;
282  if( i == 4236 || i==4300||i==4311 || i==4375 ) continue;
283  if( 4386 <= i && i<=4393 ) continue;
284  if( 4422 <= i && i<=4429 ) continue;
285  if( 4440 <= i && i<=4447 ) continue;
286  if( 4476 <= i && i<=4483 ) continue;
287  if( i == 3883 || i==3921||i==3982 || i==4020 ) continue;
288  if( i == 3434 || i==3478 ||i==3549 || i== 3593 ) continue;
289  if( i == 3211 || i==3250||i==3323 || i==3362 ) continue;
290  if( i == 3438 || i==3474||i==3553 || i==3589 ) continue;
291  if( i == 3669 || i==3700||i==3781 || i== 3812 ) continue;
292  if( i == 3888 || i==3916||i==3987 || i==4015 ) continue;
293  if( 4084 <= i && i<=4085 ) continue;
294  if( 4106 <= i && i<=4107 ) continue;
295  if( 4174 <= i && i<=4175 ) continue;
296  if( 4196 <= i && i<=4197 ) continue;
297 
298  if( 4260 <= i && i<=4261 ) continue;
299  if( 4275 <= i && i<=4276 ) continue;
300  if( 4335 <= i && i<=4336 ) continue;
301  if( 4350 <= i && i<=4351 ) continue;
302 
303  if( 4404 <= i && i<=4407 ) continue;
304  if( 4408 <= i && i<=4411 ) continue;
305  if( 4458 <= i && i<=4461 ) continue;
306  if( 4462 <= i && i<=4465 ) continue;
307 
308 
309  if(stampa)cout<<"\tSTT straw || tubeID n. "<<i<<", centro X "<< center.X()
310  <<", centro Y "<< center.Y()<<", centro Z "<< center.Z()<<", fR = "<<Rrr;
311  if( center.X() < 0. ) {
312  code = 13;
313  if(stampa)cout<<", SttCode = 13\n";
314  } else {
315  code = 23;
316  if(stampa)cout<<", SttCode = 23\n";
317  }
318 
319  if( StrawCode[i-1] > -1 && StrawCode[i-1] != code) { // to this Tube a StrawCode was already previously assigned;
320  // therefore set StrawCode2;
321  StrawCode2[i-1] = code;
322  } else {
323  StrawCode[i-1] = code;
324  }
325  } // end for(i=1;i<=num;i++)
326 
327 
328  // boundary Inner delle Stt parallele a sinistra;
329 
330 
331  // apotema = DISTANZA DA (0,0) del lato dell'esagono;
332 
333  // Stt lato inner, del 2 quadrante; code 0 + n*10;
334  apotema = APOTEMASTRAWDETECTORMIN;
335  // equazione del bordo : x - sqrt(3)*y +2*apotema = 0 ;
336  if(stampa)cout<<"\n\tInner Boundary (smaller) with code 10; 2nd quadrant || STT straws :\n";
337  double distanza;
338  for(i=1;i<=num;i++){
339  pSttTube = (PndSttTube*) SttTubeArray->At(i);
340  center = pSttTube->GetPosition();
341  wiredirection = pSttTube->GetWireDirection();
342  // solo STT parallel;
343  if(center.X()>0.) continue;
344  if(!(fabs( wiredirection.X() )< 0.00001 && fabs( wiredirection.Y() )< 0.00001))continue;
345  distanza = fabs(sqrt(3.)*center.Y()-center.X() -2*apotema)/2.;
346  if(distanza>2.*STRAWRADIUS || center.X()< -apotema - 2.*STRAWRADIUS) continue;
347  Rrr = sqrt( center.X()*center.X()+center.Y()*center.Y());
348  if(stampa)cout<<"\tSTT straw || tubeID n. "<<i<<", centro X "<< center.X()
349  <<", centro Y "<< center.Y()<<", centro Z "<< center.Z()<<", fR = "<<Rrr
350  <<", SttCode = 10\n";
351  code = 10;
352  if( StrawCode[i-1] > -1 && StrawCode[i-1] != code) { // to this Tube a StrawCode was already previously assigned;
353  // therefore set StrawCode2;
354  StrawCode2[i-1] = code;
355  } else {
356  StrawCode[i-1] = code;
357  }
358  } // end for(i=1;i<=num;i++)
359 
360 
361  // Stt lato inner, lato verticale; code 0 + n*10;
362  apotema = APOTEMASTRAWDETECTORMIN;
363  // equazione del bordo : x = -apotema ;
364  if(stampa)cout<<"\n\tInner Vertical Boundary (smaller) with code 10; 2nd-3rd quadrant || STT straws :\n";
365  for(i=1;i<=num;i++){
366  pSttTube = (PndSttTube*) SttTubeArray->At(i);
367  center = pSttTube->GetPosition();
368  wiredirection = pSttTube->GetWireDirection();
369  // solo STT parallel;
370  if(!(fabs( wiredirection.X() )< 0.00001 && fabs( wiredirection.Y() )< 0.00001))continue;
371  if(center.X()>0.) continue;
372  if(center.X()< -apotema - 2.*STRAWRADIUS) continue;
373  if(fabs(center.Y())> apotema/sqrt(3.)) continue;
374  Rrr = sqrt( center.X()*center.X()+center.Y()*center.Y());
375  if(stampa)cout<<"\tSTT straw || tubeID n. "<<i<<", centro X "<< center.X()
376  <<", centro Y "<< center.Y()<<", centro Z "<< center.Z()<<", fR = "<<Rrr
377  <<", SttCode = 10\n";
378  code = 10;
379  if( StrawCode[i-1] > -1 && StrawCode[i-1] != code) { // to this Tube a StrawCode was already previously assigned;
380  // therefore set StrawCode2;
381  StrawCode2[i-1] = code;
382  } else {
383  StrawCode[i-1] = code;
384  }
385  } // end for(i=1;i<=num;i++)
386 
387 
388 
389  // Stt lato inner, del 3 quadrante; code 0 + n*10;
390  apotema = APOTEMASTRAWDETECTORMIN;
391  // equazione del bordo : x + sqrt(3)*y +2*apotema = 0 ;
392  if(stampa)cout<<"\n\tInner Boundary (smaller) with code 10; 3nd quadrant || STT straws :\n";
393  for(i=1;i<=num;i++){
394  pSttTube = (PndSttTube*) SttTubeArray->At(i);
395  center = pSttTube->GetPosition();
396  wiredirection = pSttTube->GetWireDirection();
397  // solo STT parallel;
398  if(center.X()>0.) continue;
399  if(!(fabs( wiredirection.X() )< 0.00001 && fabs( wiredirection.Y() )< 0.00001))continue;
400  distanza = fabs(-sqrt(3.)*center.Y()-center.X() -2*apotema)/2.;
401  if(distanza>2.*STRAWRADIUS || center.X()< -apotema - 2.*STRAWRADIUS) continue;
402  Rrr = sqrt( center.X()*center.X()+center.Y()*center.Y());
403  if(stampa)cout<<"\tSTT straw || tubeID n. "<<i<<", centro X "<< center.X()
404  <<", centro Y "<< center.Y()<<", centro Z "<< center.Z()<<", fR = "<<Rrr
405  <<", SttCode = 10\n";
406  code = 10;
407  if( StrawCode[i-1] > -1 && StrawCode[i-1] != code) { // to this Tube a StrawCode was already previously assigned;
408  // therefore set StrawCode2;
409  StrawCode2[i-1] = code;
410  } else {
411  StrawCode[i-1] = code;
412  }
413  } // end for(i=1;i<=num;i++)
414 
415  // parte a destra dell'inner Stt boundary; considero la parte a sinistra e cambio il segno a tutte le X;
416 
417  // Stt lato inner, del 1 quadrante; code 0 + n*10;
418  apotema = APOTEMASTRAWDETECTORMIN;
419  // equazione del bordo : x + sqrt(3)*y -2*apotema = 0 ;
420  if(stampa)cout<<"\n\tInner Boundary (smaller) with code 20; 1nd quadrant || STT straws :\n";
421  for(i=1;i<=num;i++){
422  pSttTube = (PndSttTube*) SttTubeArray->At(i);
423  center = pSttTube->GetPosition();
424  wiredirection = pSttTube->GetWireDirection();
425  // solo STT parallel;
426  if(center.X()<0.) continue;
427  if(!(fabs( wiredirection.X() )< 0.00001 && fabs( wiredirection.Y() )< 0.00001))continue;
428  distanza = fabs(sqrt(3.)*center.Y()+center.X() -2*apotema)/2.;
429  if(distanza>2.*STRAWRADIUS || center.X()> apotema + 2.*STRAWRADIUS) continue;
430  Rrr = sqrt( center.X()*center.X()+center.Y()*center.Y());
431  if(stampa)cout<<"\tSTT straw || tubeID n. "<<i<<", centro X "<< center.X()
432  <<", centro Y "<< center.Y()<<", centro Z "<< center.Z()<<", fR = "<<Rrr
433  <<", SttCode = 20\n";
434  code = 20;
435  if( StrawCode[i-1] > -1 && StrawCode[i-1] != code) { // to this Tube a StrawCode was already previously assigned;
436  // therefore set StrawCode2;
437  StrawCode2[i-1] = code;
438  } else {
439  StrawCode[i-1] = code;
440  }
441  } // end for(i=1;i<=num;i++)
442 
443 
444  // Stt lato inner, lato verticale + n*10;
445  apotema = APOTEMASTRAWDETECTORMIN;
446  // equazione del bordo : x = apotema ;
447  if(stampa)cout<<"\n\tInner Vertical Boundary (smaller) with code 20; 1st-2nd quadrant || STT straws :\n";
448  for(i=1;i<=num;i++){
449  pSttTube = (PndSttTube*) SttTubeArray->At(i);
450  center = pSttTube->GetPosition();
451  wiredirection = pSttTube->GetWireDirection();
452  // solo STT parallel;
453  if(!(fabs( wiredirection.X() )< 0.00001 && fabs( wiredirection.Y() )< 0.00001))continue;
454  if(center.X()<0.) continue;
455  if(center.X()> apotema + 2.*STRAWRADIUS) continue;
456  if(fabs(center.Y())> apotema/sqrt(3.)) continue;
457  Rrr = sqrt( center.X()*center.X()+center.Y()*center.Y());
458  if(stampa)cout<<"\tSTT straw || tubeID n. "<<i<<", centro X "<< center.X()
459  <<", centro Y "<< center.Y()<<", centro Z "<< center.Z()<<", fR = "<<Rrr
460  <<", SttCode = 20\n";
461  code = 20;
462  if( StrawCode[i-1] > -1 && StrawCode[i-1] != code) { // to this Tube a StrawCode was already previously assigned;
463  // therefore set StrawCode2;
464  StrawCode2[i-1] = code;
465  } else {
466  StrawCode[i-1] = code;
467  }
468  } // end for(i=1;i<=num;i++)
469 
470 
471 
472  // Stt lato inner, del 4 quadrante + n*10;
473  apotema = APOTEMASTRAWDETECTORMIN;
474  // equazione del bordo : x -sqrt(3)*y -2*apotema = 0 ;
475  if(stampa)cout<<"\n\tInner Boundary (smaller) with code 20; 4nd quadrant || STT straws :\n";
476  for(i=1;i<=num;i++){
477  pSttTube = (PndSttTube*) SttTubeArray->At(i);
478  center = pSttTube->GetPosition();
479  wiredirection = pSttTube->GetWireDirection();
480  // solo STT parallel;
481  if(center.X()<0.) continue;
482  if(!(fabs( wiredirection.X() )< 0.00001 && fabs( wiredirection.Y() )< 0.00001))continue;
483  distanza = fabs(-sqrt(3.)*center.Y()+center.X() -2*apotema)/2.;
484  if(distanza>2.*STRAWRADIUS || center.X()> apotema + 2.*STRAWRADIUS) continue;
485  Rrr = sqrt( center.X()*center.X()+center.Y()*center.Y());
486  if(stampa)cout<<"\tSTT straw || tubeID n. "<<i<<", centro X "<< center.X()
487  <<", centro Y "<< center.Y()<<", centro Z "<< center.Z()<<", fR = "<<Rrr
488  <<", SttCode = 20\n";
489  code = 20;
490  if( StrawCode[i-1] > -1 && StrawCode[i-1] != code) { // to this Tube a StrawCode was already previously assigned;
491  // therefore set StrawCode2;
492  StrawCode2[i-1] = code;
493  } else {
494  StrawCode[i-1] = code;
495  }
496  } // end for(i=1;i<=num;i++)
497 
498 
499 //--------------
500 
501 // la rimanente parte Inner a destra : parte obliqua del 1 quadrante; code 1 + n*10;
502  // Stt lato inner, del 1 quadrante;
503  apotema = APOTEMAMAXINNERPARSTRAW; // = 23.25 cm;
504  // equazione del bordo : x + sqrt(3)*y -2*apotema = 0 ;
505  if(stampa)cout<<"\n\tInner Boundary (the larger), the one with code 21; 1nd quadrant || STT straws :\n";
506  for(i=1;i<=num;i++){
507  pSttTube = (PndSttTube*) SttTubeArray->At(i);
508  center = pSttTube->GetPosition();
509  wiredirection = pSttTube->GetWireDirection();
510  // solo STT parallel;
511  if(center.X()<0.) continue;
512  if(!(fabs( wiredirection.X() )< 0.00001 && fabs( wiredirection.Y() )< 0.00001))continue;
513  distanza = fabs(sqrt(3.)*center.Y()+center.X() -2*apotema)/2.;
514  if(distanza>2.*STRAWRADIUS || center.X()> apotema + 2.*STRAWRADIUS) continue;
515  Rrr = sqrt( center.X()*center.X()+center.Y()*center.Y());
516  if(stampa)cout<<"\tSTT straw || tubeID n. "<<i<<", centro X "<< center.X()
517  <<", centro Y "<< center.Y()<<", centro Z "<< center.Z()<<", fR = "<<Rrr
518  <<", SttCode = 21\n";
519  code = 21;
520  if( StrawCode[i-1] > -1 && StrawCode[i-1] != code) { // to this Tube a StrawCode was already previously assigned;
521  // therefore set StrawCode2;
522  StrawCode2[i-1] = code;
523  } else {
524  StrawCode[i-1] = code;
525  }
526  } // end for(i=1;i<=num;i++)
527 
528 
529 // la rimanente parte Inner a destra : parte verticale a cavallo tra il 1 ed il 4 quadrante; code 1 + n*10;
530  // Stt lato inner, lato verticale;
531  apotema = APOTEMAMAXINNERPARSTRAW; // = 23.25 cm;
532  // equazione del bordo : x = apotema ;
533  if(stampa)cout<<"\n\tInner Vertical Boundary (the larger) the one with code 21; 1st-4th quadrant || STT straws :\n";
534  for(i=1;i<=num;i++){
535  pSttTube = (PndSttTube*) SttTubeArray->At(i);
536  center = pSttTube->GetPosition();
537  wiredirection = pSttTube->GetWireDirection();
538  // solo STT parallel;
539  if(!(fabs( wiredirection.X() )< 0.00001 && fabs( wiredirection.Y() )< 0.00001))continue;
540  if(center.X()<0.) continue;
541  if( fabs(center.X() - apotema) > 2.*STRAWRADIUS ) continue;
542  if(fabs(center.Y())> apotema/sqrt(3.)) continue;
543  Rrr = sqrt( center.X()*center.X()+center.Y()*center.Y());
544  if(stampa)cout<<"\tSTT straw || tubeID n. "<<i<<", centro X "<< center.X()
545  <<", centro Y "<< center.Y()<<", centro Z "<< center.Z()<<", fR = "<<Rrr
546  <<", SttCode = 21\n";
547  code = 21;
548  if( StrawCode[i-1] > -1 && StrawCode[i-1] != code) { // to this Tube a StrawCode was already previously assigned;
549  // therefore set StrawCode2;
550  StrawCode2[i-1] = code;
551  } else {
552  StrawCode[i-1] = code;
553  }
554  } // end for(i=1;i<=num;i++)
555 
556 
557 // la rimanente parte Inner a destra : parte obliqua del 4 quadrante; code 1 + n*10;
558  // Stt lato inner, del 4 quadrante;
559  apotema = APOTEMAMAXINNERPARSTRAW; // = 23.25 cm;
560  // equazione del bordo : x -sqrt(3)*y -2*apotema = 0 ;
561  if(stampa)cout<<"\n\tInner Boundary (the larger) the one with code 21; 4nd quadrant || STT straws :\n";
562  for(i=1;i<=num;i++){
563  pSttTube = (PndSttTube*) SttTubeArray->At(i);
564  center = pSttTube->GetPosition();
565  wiredirection = pSttTube->GetWireDirection();
566  // solo STT parallel;
567  if(center.X()<0.) continue;
568  if(!(fabs( wiredirection.X() )< 0.00001 && fabs( wiredirection.Y() )< 0.00001))continue;
569  distanza = fabs(-sqrt(3.)*center.Y()+center.X() -2*apotema)/2.;
570  if(distanza>2.*STRAWRADIUS || center.X()> apotema + 2.*STRAWRADIUS) continue;
571  Rrr = sqrt( center.X()*center.X()+center.Y()*center.Y());
572  if(stampa)cout<<"\tSTT straw || tubeID n. "<<i<<", centro X "<< center.X()
573  <<", centro Y "<< center.Y()<<", centro Z "<< center.Z()<<", fR = "<<Rrr
574  <<", SttCode = 21\n";
575  code = 21;
576  if( StrawCode[i-1] > -1 && StrawCode[i-1] != code) { // to this Tube a StrawCode was already previously assigned;
577  // therefore set StrawCode2;
578  StrawCode2[i-1] = code;
579  } else {
580  StrawCode[i-1] = code;
581  }
582  } // end for(i=1;i<=num;i++)
583 
584 // la rimanente parte Inner a sinistra : parte obliqua del 2 quadrante; code 1 + n*10;
585  // Stt lato inner (the larger) the one with code 11, del 2 quadrante;
586  apotema = APOTEMAMAXINNERPARSTRAW; // = 23.25 cm;
587  // equazione del bordo : x - sqrt(3)*y +2*apotema = 0 ;
588  if(stampa)cout<<"\n\tInner Boundary (the larger) the one with code 11, 2nd quadrant || STT straws :\n";
589  for(i=1;i<=num;i++){
590  pSttTube = (PndSttTube*) SttTubeArray->At(i);
591  center = pSttTube->GetPosition();
592  wiredirection = pSttTube->GetWireDirection();
593  // solo STT parallel;
594  if(center.X()>0.) continue;
595  if(!(fabs( wiredirection.X() )< 0.00001 && fabs( wiredirection.Y() )< 0.00001))continue;
596  distanza = fabs(sqrt(3.)*center.Y()-center.X() -2*apotema)/2.;
597  if(distanza>2.*STRAWRADIUS || center.X()< -apotema - 2.*STRAWRADIUS) continue;
598  Rrr = sqrt( center.X()*center.X()+center.Y()*center.Y());
599  if(stampa)cout<<"\tSTT straw || tubeID n. "<<i<<", centro X "<< center.X()
600  <<", centro Y "<< center.Y()<<", centro Z "<< center.Z()<<", fR = "<<Rrr
601  <<", SttCode = 11\n";
602  code = 11;
603  if( StrawCode[i-1] > -1 && StrawCode[i-1] != code) { // to this Tube a StrawCode was already previously assigned;
604  // therefore set StrawCode2;
605  StrawCode2[i-1] = code;
606  } else {
607  StrawCode[i-1] = code;
608  }
609  } // end for(i=1;i<=num;i++)
610 
611 
612 // la rimanente parte Inner a sinistra : parte verticale a cavallo tra il 2 e 3 quadrante; code 1 + n*10;
613  // Stt lato inner, lato verticale (larger) the one with code 11;
614  apotema = APOTEMAMAXINNERPARSTRAW; // = 23.25 cm;
615  // equazione del bordo : x = -apotema ;
616  if(stampa)cout<<"\n\tInner Vertical Boundary (the larger) the one with code 11; 2nd-3rd quadrant || STT straws :\n";
617  for(i=1;i<=num;i++){
618  pSttTube = (PndSttTube*) SttTubeArray->At(i);
619  center = pSttTube->GetPosition();
620  wiredirection = pSttTube->GetWireDirection();
621  // solo STT parallel;
622  if(!(fabs( wiredirection.X() )< 0.00001 && fabs( wiredirection.Y() )< 0.00001))continue;
623  if(center.X()>0.) continue;
624  if( fabs( center.X() + apotema ) > 2.*STRAWRADIUS ) continue;
625  if(fabs(center.Y())> apotema/sqrt(3.)) continue;
626  Rrr = sqrt( center.X()*center.X()+center.Y()*center.Y());
627  if(stampa)cout<<"\tSTT straw || tubeID n. "<<i<<", centro X "<< center.X()
628  <<", centro Y "<< center.Y()<<", centro Z "<< center.Z()<<", fR = "<<Rrr
629  <<", SttCode = 11\n";
630  code = 11;
631  if( StrawCode[i-1] > -1 && StrawCode[i-1] != code) { // to this Tube a StrawCode was already previously assigned;
632  // therefore set StrawCode2;
633  StrawCode2[i-1] = code;
634  } else {
635  StrawCode[i-1] = code;
636  }
637  } // end for(i=1;i<=num;i++)
638 
639 
640 
641 // la rimanente parte Inner a sinistra : parte obliqua del 3 quadrante; code 1 + n*10;
642  // Stt lato inner, del 3 quadrante (larger);
643  apotema = APOTEMAMAXINNERPARSTRAW; // = 23.25 cm;
644  // equazione del bordo : x + sqrt(3)*y +2*apotema = 0 ;
645  if(stampa)cout<<"\n\tInner Boundary 3nd quadrant (the larger) the one with code 11; || STT straws :\n";
646  for(i=1;i<=num;i++){
647  pSttTube = (PndSttTube*) SttTubeArray->At(i);
648  center = pSttTube->GetPosition();
649  wiredirection = pSttTube->GetWireDirection();
650  // solo STT parallel;
651  if(center.X()>0.) continue;
652  if(!(fabs( wiredirection.X() )< 0.00001 && fabs( wiredirection.Y() )< 0.00001))continue;
653  distanza = fabs(-sqrt(3.)*center.Y()-center.X() -2*apotema)/2.;
654  if(distanza>2.*STRAWRADIUS || center.X()< -apotema - 2.*STRAWRADIUS) continue;
655  Rrr = sqrt( center.X()*center.X()+center.Y()*center.Y());
656  if(stampa)cout<<"\tSTT straw || tubeID n. "<<i<<", centro X "<< center.X()
657  <<", centro Y "<< center.Y()<<", centro Z "<< center.Z()<<", fR = "<<Rrr
658  <<", SttCode = 11\n";
659  code = 11;
660  if( StrawCode[i-1] > -1 && StrawCode[i-1] != code) { // to this Tube a StrawCode was already previously assigned;
661  // therefore set StrawCode2;
662  StrawCode2[i-1] = code;
663  } else {
664  StrawCode[i-1] = code;
665  }
666  } // end for(i=1;i<=num;i++)
667 
668 
669 
670 //--------------------------------------------------------------------------------------------------------------
671 
672 // la rimanente parte Outer a destra : parte obliqua del 1 quadrante; code 25 per un piccolo tratto che
673 // puo' essere investito da tracce che provengono da (0,0) senza aver intersecato prima gli Straws
674 // assiali, e code 24 per il resto;
675  // Stt lato inner, del 1 quadrante;
676  apotema = APOTEMAMINOUTERPARSTRAW; // = 31.86 cm;
677  // equazione del bordo : x + sqrt(3)*y -2*apotema = 0 ;
678  if(stampa)cout<<"\n\tOuter Boundary (the larger), the one with code 24 or 25; 1nd quadrant || STT straws :\n";
679  for(i=1;i<=num;i++){
680  pSttTube = (PndSttTube*) SttTubeArray->At(i);
681  center = pSttTube->GetPosition();
682  wiredirection = pSttTube->GetWireDirection();
683  // solo STT parallel;
684  if(center.X()<0.) continue;
685  if(!(fabs( wiredirection.X() )< 0.00001 && fabs( wiredirection.Y() )< 0.00001))continue;
686  distanza = fabs(sqrt(3.)*center.Y()+center.X() -2*apotema)/2.;
687  if(distanza>2.*STRAWRADIUS || center.X()> apotema + 2.*STRAWRADIUS) continue;
688 
689  // condition to belong to the special section;
690  if( center.X() - STRAWRADIUS < x ) { code = 25; } else { code = 24; }
691 
692  Rrr = sqrt( center.X()*center.X()+center.Y()*center.Y());
693  if(stampa)cout<<"\tSTT straw || tubeID n. "<<i<<", centro X "<< center.X()
694  <<", centro Y "<< center.Y()<<", centro Z "<< center.Z()<<", fR = "<<Rrr
695  <<", SttCode = "<<code<<endl;
696  if( StrawCode[i-1] > -1 && StrawCode[i-1] != code) { // to this Tube a StrawCode was already previously assigned;
697  // therefore set StrawCode2;
698  StrawCode2[i-1] = code;
699  } else {
700  StrawCode[i-1] = code;
701  }
702  } // end for(i=1;i<=num;i++)
703 
704 
705 // la rimanente parte Outer a destra : parte verticale a cavallo tra il 1 ed il 4 quadrante;
706  // Stt lato Outer, lato verticale;
707  apotema = APOTEMAMINOUTERPARSTRAW; // = 31.86 cm;
708  // equazione del bordo : x = apotema ;
709  if(stampa)cout<<"\n\tOuter Vertical Boundary (the larger) the one with code 24; 1st-4th quadrant || STT straws :\n";
710  for(i=1;i<=num;i++){
711  pSttTube = (PndSttTube*) SttTubeArray->At(i);
712  center = pSttTube->GetPosition();
713  wiredirection = pSttTube->GetWireDirection();
714  // solo STT parallel;
715  if(!(fabs( wiredirection.X() )< 0.00001 && fabs( wiredirection.Y() )< 0.00001))continue;
716  if(center.X()<0.) continue;
717  if(fabs( center.X()- apotema ) > 2.*STRAWRADIUS ) continue;
718  if(fabs(center.Y())> apotema/sqrt(3.)) continue;
719  Rrr = sqrt( center.X()*center.X()+center.Y()*center.Y());
720  if(stampa)cout<<"\tSTT straw || tubeID n. "<<i<<", centro X "<< center.X()
721  <<", centro Y "<< center.Y()<<", centro Z "<< center.Z()<<", fR = "<<Rrr
722  <<", SttCode = 24\n";
723  code = 24;
724  if( StrawCode[i-1] > -1 && StrawCode[i-1] != code) { // to this Tube a StrawCode was already previously assigned;
725  // therefore set StrawCode2;
726  StrawCode2[i-1] = code;
727  } else {
728  StrawCode[i-1] = code;
729  }
730  } // end for(i=1;i<=num;i++)
731 
732 
733 // la rimanente parte Outer a destra : parte obliqua del 4 quadrante;
734  // Stt lato Outer, del 4 quadrante;
735  apotema = APOTEMAMINOUTERPARSTRAW; // = 31.86 cm;
736  // equazione del bordo : x -sqrt(3)*y -2*apotema = 0 ;
737  if(stampa)cout<<"\n\tOuter Boundary (the larger) the one with code 24 or 25; 4nd quadrant || STT straws :\n";
738  for(i=1;i<=num;i++){
739  pSttTube = (PndSttTube*) SttTubeArray->At(i);
740  center = pSttTube->GetPosition();
741  wiredirection = pSttTube->GetWireDirection();
742  // solo STT parallel;
743  if(center.X()<0.) continue;
744  if(!(fabs( wiredirection.X() )< 0.00001 && fabs( wiredirection.Y() )< 0.00001))continue;
745  distanza = fabs(-sqrt(3.)*center.Y()+center.X() -2*apotema)/2.;
746  if(distanza>2.*STRAWRADIUS || center.X()> apotema + 2.*STRAWRADIUS) continue;
747 
748  // condition to belong to the special section;
749  if( center.X() - STRAWRADIUS < x ) { code = 25; } else { code = 24; }
750 
751  Rrr = sqrt( center.X()*center.X()+center.Y()*center.Y());
752  if(stampa)cout<<"\tSTT straw || tubeID n. "<<i<<", centro X "<< center.X()
753  <<", centro Y "<< center.Y()<<", centro Z "<< center.Z()<<", fR = "<<Rrr
754  <<", SttCode = "<<code<<endl;
755  if( StrawCode[i-1] > -1 && StrawCode[i-1] != code) { // to this Tube a StrawCode was already previously assigned;
756  // therefore set StrawCode2;
757  StrawCode2[i-1] = code;
758  } else {
759  StrawCode[i-1] = code;
760  }
761  } // end for(i=1;i<=num;i++)
762 
763 // la rimanente parte Outer a sinistra : parte obliqua del 2 quadrante;
764  // Stt lato Outer (the larger) the one with code 12, del 2 quadrante;
765  apotema = APOTEMAMINOUTERPARSTRAW; // = 31.86 cm;
766  // equazione del bordo : x - sqrt(3)*y +2*apotema = 0 ;
767  if(stampa)cout<<"\n\tOuter Boundary (the larger) the one with code 14 or 15, 2nd quadrant || STT straws :\n";
768  for(i=1;i<=num;i++){
769  pSttTube = (PndSttTube*) SttTubeArray->At(i);
770  center = pSttTube->GetPosition();
771  wiredirection = pSttTube->GetWireDirection();
772  // solo STT parallel;
773  if(center.X()>0.) continue;
774  if(!(fabs( wiredirection.X() )< 0.00001 && fabs( wiredirection.Y() )< 0.00001))continue;
775  distanza = fabs(sqrt(3.)*center.Y()-center.X() -2*apotema)/2.;
776  if(distanza>2.*STRAWRADIUS || center.X()< -apotema - 2.*STRAWRADIUS) continue;
777 
778  // condition to belong to the special section;
779  if( center.X() + STRAWRADIUS > -x ) { code = 15; } else { code = 14; }
780 
781  Rrr = sqrt( center.X()*center.X()+center.Y()*center.Y());
782  if(stampa)cout<<"\tSTT straw || tubeID n. "<<i<<", centro X "<< center.X()
783  <<", centro Y "<< center.Y()<<", centro Z "<< center.Z()<<", fR = "<<Rrr
784  <<", SttCode = "<<code<<endl;
785  if( StrawCode[i-1] > -1 && StrawCode[i-1] != code) { // to this Tube a StrawCode was already previously assigned;
786  // therefore set StrawCode2;
787  StrawCode2[i-1] = code;
788  } else {
789  StrawCode[i-1] = code;
790  }
791  } // end for(i=1;i<=num;i++)
792 
793 
794 // la rimanente parte Outer a sinistra : parte verticale a cavallo tra il 2 e 3 quadrante;
795  // Stt lato Outer, lato verticale (larger) the one with code 14;
796  apotema = APOTEMAMINOUTERPARSTRAW; // = 31.86 cm;
797  // equazione del bordo : x = -apotema ;
798  if(stampa)cout<<"\n\tOuter Vertical Boundary (the larger) the one with code 12; 2nd-3rd quadrant || STT straws :\n";
799  for(i=1;i<=num;i++){
800  pSttTube = (PndSttTube*) SttTubeArray->At(i);
801  center = pSttTube->GetPosition();
802  wiredirection = pSttTube->GetWireDirection();
803  // solo STT parallel;
804  if(!(fabs( wiredirection.X() )< 0.00001 && fabs( wiredirection.Y() )< 0.00001))continue;
805  if(center.X()>0.) continue;
806  if(fabs(center.X()+apotema) > 2.*STRAWRADIUS) continue;
807  if(fabs(center.Y())> apotema/sqrt(3.)) continue;
808  Rrr = sqrt( center.X()*center.X()+center.Y()*center.Y());
809  if(stampa)cout<<"\tSTT straw || tubeID n. "<<i<<", centro X "<< center.X()
810  <<", centro Y "<< center.Y()<<", centro Z "<< center.Z()<<", fR = "<<Rrr
811  <<", SttCode = 14\n";
812  code = 14;
813  if( StrawCode[i-1] > -1 && StrawCode[i-1] != code) { // to this Tube a StrawCode was already previously assigned;
814  // therefore set StrawCode2;
815  StrawCode2[i-1] = code;
816  } else {
817  StrawCode[i-1] = code;
818  }
819  } // end for(i=1;i<=num;i++)
820 
821 
822 
823 // la rimanente parte Outer a sinistra : parte obliqua del 3 quadrante;
824  // Stt lato Outer, del 3 quadrante (larger);
825  apotema = APOTEMAMINOUTERPARSTRAW; // = 31.86 cm;
826  // equazione del bordo : x + sqrt(3)*y +2*apotema = 0 ;
827  if(stampa)cout<<"\n\tOuter Boundary 3nd quadrant (the larger) the one with code 14 or 15; || STT straws :\n";
828  for(i=1;i<=num;i++){
829  pSttTube = (PndSttTube*) SttTubeArray->At(i);
830  center = pSttTube->GetPosition();
831  wiredirection = pSttTube->GetWireDirection();
832  // solo STT parallel;
833  if(center.X()>0.) continue;
834  if(!(fabs( wiredirection.X() )< 0.00001 && fabs( wiredirection.Y() )< 0.00001))continue;
835  distanza = fabs(-sqrt(3.)*center.Y()-center.X() -2*apotema)/2.;
836  if(distanza>2.*STRAWRADIUS || center.X()< -apotema - 2.*STRAWRADIUS) continue;
837 
838  // condition to belong to the special section;
839  if( center.X() + STRAWRADIUS > -x ) { code = 15; } else { code = 14; }
840 
841  Rrr = sqrt( center.X()*center.X()+center.Y()*center.Y());
842  if(stampa)cout<<"\tSTT straw || tubeID n. "<<i<<", centro X "<< center.X()
843  <<", centro Y "<< center.Y()<<", centro Z "<< center.Z()<<", fR = "<<Rrr
844  <<", SttCode = "<<code<<endl;
845  if( StrawCode[i-1] > -1 && StrawCode[i-1] != code) { // to this Tube a StrawCode was already previously assigned;
846  // therefore set StrawCode2;
847  StrawCode2[i-1] = code;
848  } else {
849  StrawCode[i-1] = code;
850  }
851  } // end for(i=1;i<=num;i++)
852 
853 
854 
855 
856  return;
857 }
const Double_t RSTRAWDETECTORMAX
int num[96]
Definition: ranlxd.cxx:381
Int_t i
Definition: run_full.C:25
friend F32vec4 sqrt(const F32vec4 &a)
Definition: P4_F32vec4.h:29
void CalculateSpecialRegion(Double_t RSTRAWDETECTORMIN, Double_t APOTEMAMAXINNERPARSTRAW, Double_t APOTEMAMINOUTERPARSTRAW, Double_t VERTICALGAP, Double_t &x, Double_t &y)
const Double_t STRAWRADIUS
TVector3 GetPosition()
Definition: PndSttTube.cxx:87
const Double_t APOTEMAMINOUTERPARSTRAW
friend F32vec4 fabs(const F32vec4 &a)
Definition: P4_F32vec4.h:47
const Double_t VERTICALGAP
const Double_t APOTEMAMAXINNERPARSTRAW
Double_t x
Double_t y
const Double_t APOTEMASTRAWDETECTORMIN
TVector3 GetWireDirection()
Definition: PndSttTube.cxx:107

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