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

#include <PndTrkCleanup.h>

Inheritance diagram for PndTrkCleanup:

Public Member Functions

 PndTrkCleanup ()
 
 ~PndTrkCleanup ()
 
bool BadTrack_ParStt (Double_t Oxx, Double_t Oyy, Double_t Rr, Double_t Stawradius, Short_t Charge, Double_t Xcross[2], Double_t Ycross[2], Short_t nHits, Short_t *ListHits, Double_t info[][7], int istampa, Double_t cut, Short_t maxnum, Short_t islack)
 
bool GoodTrack (Double_t info[][7], bool farthest_hit_is_boundary, Double_t Ox, Double_t Oy, Double_t R, Short_t Charge, Short_t nHits, Short_t *ListHits, Short_t *StrawCode, Short_t *StrawCode2, Short_t *TubeID, Short_t *nParContiguous, Short_t ListParContiguous[][6], Double_t *xTube, Double_t *yTube, Double_t *zTube, Double_t *xxyyTube, Short_t &holes)
 
bool IsThereMvdHitInBarrel (Double_t Xintersect, Double_t Yintersect, Double_t Zintersect, Short_t nPixelHitsinTrack, Short_t *ListMvdPixelHitsinTrack, Double_t *XMvdPixel, Double_t *YMvdPixel, Double_t *ZMvdPixel, Short_t nStripHitsinTrack, Short_t *ListMvdStripHitsinTrack, Double_t *XMvdStrip, Double_t *YMvdStrip, Double_t *ZMvdStrip)
 
bool IsThereHitInMvdMiniDisk (Double_t ZLayerBegin, Short_t nPixelHitsinTrack, Short_t *ListMvdPixelHitsinTrack, Double_t *XMvdPixel, Double_t *YMvdPixel, Double_t *ZMvdPixel, Short_t nStripHitsinTrack, Short_t *ListMvdStripHitsinTrack, Double_t *XMvdStrip, Double_t *YMvdStrip, Double_t *ZMvdStrip, PndTrkCTGeometryCalculations *GeometryCalculator)
 
bool MvdCleanup (Double_t Ox, Double_t Oy, Double_t R, Double_t fi0, Double_t kappa, Double_t charge, Double_t *XMvdPixel, Double_t *XMvdStrip, Double_t *YMvdPixel, Double_t *YMvdStrip, Double_t *ZMvdPixel, Double_t *ZMvdStrip, Short_t nPixelHitsinTrack, Short_t *ListMvdPixelHitsinTrack, Short_t nStripHitsinTrack, Short_t *ListMvdStripHitsinTrack, Double_t extra_distance, Double_t extra_distance_Z, PndTrkCTGeometryCalculations *GeomCalculator)
 
bool MvdCleanup_prova (Double_t Ox, Double_t Oy, Double_t R, Double_t fi0, Double_t kappa, Double_t charge, Double_t semiverticalgap, Short_t nMvdHits, PndTrkCTGeometryCalculations *GeomCalculator)
 
void SeparateInnerOuterParallel (Short_t nHits, Short_t *ListHits, Double_t info[][7], Double_t RStrawDetInnerParMax, Short_t *nInnerHits, Short_t *ListInnerHits, Short_t *nOuterHits, Short_t *ListOuterHits, Short_t *nInnerHitsLeft, Short_t *ListInnerHitsLeft, Short_t *nInnerHitsRight, Short_t *ListInnerHitsRight, Short_t *nOuterHitsLeft, Short_t *ListOuterHitsLeft, Short_t *nOuterHitsRight, Short_t *ListOuterHitsRight)
 
void SeparateInnerOuterRightLeftAxialStt (Double_t info[][7], Short_t *ListHits, Short_t nHits, Double_t RStrawDetInnerParMax, Short_t *ListInnerHitsLeft, Short_t *ListInnerHitsRight, Short_t *ListOuterHitsLeft, Short_t *ListOuterHitsRight, Short_t *nInnerHitsLeft, Short_t *nInnerHitsRight, Short_t *nOuterHitsLeft, Short_t *nOuterHitsRight)
 
bool SttParalCleanup (Double_t ApotemaInnerParMax, Double_t ApotemaMinOuterPar, Short_t Charge, Double_t FI0, Double_t FiLimitAdmissible, Double_t GAP, Double_t info[][7], int istampa, int IVOLTE, Short_t *Listofhits, Short_t nHits, Double_t Oxx, Double_t Oyy, Double_t Rr, Double_t RStrawDetMax, Double_t RStrawDetMin, Double_t Start[3], Double_t Strawradius)
 
bool SttSkewCleanup (Double_t ApotemaMaxSkew, Double_t ApotemaMinSkew, Short_t Charge, Double_t cut, Double_t FI0, Double_t FiLimitAdmissible, Double_t GAP, Double_t info[][7], int istampa, int IVOLTE, Short_t *Listofhits, Short_t maxnum, int MAXSTTHITS, Short_t nHits, Double_t Oxx, Double_t Oyy, Double_t Rr, Double_t RStrawDetMax, Double_t *S, Double_t Start[3], Double_t Strawradius)
 
bool TrackCleanup (Double_t ApotemaMaxInnerPar, Double_t ApotemaMaxSkew, Double_t ApotemaMinOuterPar, Double_t ApotemaMinSkew, Double_t *auxS, Short_t Charge, Double_t FI0, Double_t GAP, Double_t info[][7], int istampa, int IVOLTE, Double_t KAPPA, Short_t *ListHitsPar, Short_t *ListHitsSkew, int MAXSTTHITS, Short_t nHitsPar, Short_t nHitsSkew, Double_t Oxx, Double_t Oyy, Double_t Rr, Double_t RStrawDetMax, Double_t RStrawDetMin, Double_t Start[3], Double_t Strawradius)
 
bool Track_Crosses_MvdBarrelFullAzimuthalCoverage (Double_t Ox, Double_t Oy, Double_t R, Double_t fi0, Double_t kappa, Double_t charge, const Double_t Zlow, const Double_t Zup, Double_t RBarrel, PndTrkCTGeometryCalculations *GeometryCalculator, Double_t extra_distance_Z, Double_t &Xintersect, Double_t &Yintersect, Double_t &Zintersect)
 
bool Track_Crosses_MvdBarrelPartialAzimuthalCoverage (Double_t Ox, Double_t Oy, Double_t R, Double_t fi0, Double_t kappa, Double_t charge, Double_t Zlow, Double_t Zup, Double_t RInnerBarrel, int ngapInner, const Double_t *gap_lowInner, const Double_t *gap_upInner, Double_t ROuterBarrel, int ngapOuter, const Double_t *gap_lowOuter, const Double_t *gap_upOuter, PndTrkCTGeometryCalculations *GeometryCalculator, Double_t extra_distance_Z, Double_t *Xintersect, Double_t *Yintersect, Double_t *Zintersect)
 
bool Track_Crosses_MvdMiniDisk_withMargin (Double_t ZLayerBegin, Double_t xmargin, Double_t ymargin, Double_t Ox, Double_t Oy, Double_t R, Double_t fi0, Double_t kappa, Double_t charge, PndTrkCTGeometryCalculations *GeometryCalculator)
 
bool XYCleanup (int istampa, Double_t info[][7], Short_t(*ListParContiguous)[6], Short_t *nParContiguous, Short_t *StrawCode, Short_t *StrawCode2, Short_t *TubeID, Double_t *xTube, Double_t *yTube, Double_t *zTube, Double_t *xxyyTube, Double_t Ox, Double_t Oy, Double_t R, Short_t Charge, Short_t *ListHits, Short_t nHits, Double_t RStrawDetInnerParMax, Short_t nScitilHitsInTrack, Short_t *ListSciTilHitsinTrack, Double_t posizSciTil[][3])
 
 ClassDef (PndTrkCleanup, 1)
 

Detailed Description

Definition at line 11 of file PndTrkCleanup.h.

Constructor & Destructor Documentation

PndTrkCleanup::PndTrkCleanup ( )
inline

Default constructor

Definition at line 19 of file PndTrkCleanup.h.

19 {};
PndTrkCleanup::~PndTrkCleanup ( )
inline

Destructor

Definition at line 21 of file PndTrkCleanup.h.

21 {};

Member Function Documentation

bool PndTrkCleanup::BadTrack_ParStt ( Double_t  Oxx,
Double_t  Oyy,
Double_t  Rr,
Double_t  Stawradius,
Short_t  Charge,
Double_t  Xcross[2],
Double_t  Ycross[2],
Short_t  nHits,
Short_t *  ListHits,
Double_t  info[][7],
int  istampa,
Double_t  cut,
Short_t  maxnum,
Short_t  islack 
)

Definition at line 19 of file PndTrkCleanup.cxx.

References atan2(), PndTrkCTGeometryCalculations::CalculateArcLength(), cut, Double_t, PndTrkCTGeometryCalculations::IsInsideArc(), nHits, PI, and sqrt().

37 {
38  Short_t ibad,
39  ihit,
40  ninside;
41 
42  Double_t cut2,
43  length,
44  Xprevious,
45  Yprevious,
46  S,
47  Distance[nHits+1];
48 
49  // class with all the geometry calculations :
50  PndTrkCTGeometryCalculations GeometryCalculator;
51 
52  cut2=cut*cut;
53  ibad=0;
54 
55  Xprevious=Xcross[0];
56  Yprevious=Ycross[0];
57 
58  length= GeometryCalculator.CalculateArcLength(
59  Oxx,
60  Oyy,
61  Rr,
62  Charge,
63  Xcross,
64  Ycross
65  );
66 if(istampa>1) {cout<<"in BadTrack_ParStt : Xingresso "<<Xcross[0]<<", Yingresso "<<Ycross[0]
67  <<", Xuscita "<<Xcross[1]<<", Yuscita "<<Ycross[1]<<", Lungh. arco "
68  <<length<<", islack "<<islack<<endl;
69  }
70 
71 
72  ninside=0;
73  for(ihit=0; ihit<nHits;ihit++){
74  S = atan2(info[ListHits[ihit]][1]-Oyy,info[ListHits[ihit]][0]-Oxx);
75  if(S<0.) S += 2.*PI;
76  if(S<0.) S = 0.;
77  if( ! GeometryCalculator.IsInsideArc(
78  Oxx,Oyy,Charge,
79  Xcross,
80  Ycross,
81  S)
82  ) {
83  continue;
84  }
85  ninside++;
86  Distance[ihit]=
87  (info[ListHits[ihit]][0]-Xprevious)*
88  (info[ListHits[ihit]][0]-Xprevious)+
89  (info[ListHits[ihit]][1]-Yprevious)*
90  (info[ListHits[ihit]][1]-Yprevious);
91 if(istampa>1) {cout<<"in BadTrack_ParStt :hit || n. "<<ListHits[ihit]<<", X "<<info[ListHits[ihit]][0]
92 <<", Y "<<info[ListHits[ihit]][1]<<"\n\tX prima "<<Xprevious
93 <<", Y prima "<<Yprevious<<", Distanza "<<sqrt(Distance[ihit])<<", cut = "
94 <<cut<<endl;
95 }
96  Xprevious=info[ListHits[ihit]][0];
97  Yprevious=info[ListHits[ihit]][1];
98 
99 
100  if(Distance[ihit]>cut2){
101  if(Distance[ihit]>16.*cut2){
102  return true;
103  }
104  ibad++;
105  }
106 
107  } // end of for(ihit=0 ;ihit<nHits;ihit++)
108 
109 
110  // cut on the minimum (conservative) n. hits that must have fired
111 
112  int nume;
113  nume = 0.5*length/strawradius -islack;
114  if( ninside < nume ){
115  if(istampa>1){
116  int icz = 0.5*length/strawradius;
117  cout<<"in BadTrack_ParStt, n. Hits inside = "<<ninside
118  <<" is < n. hits that should be inside at least = "
119  <<icz<<"-islack ("<<islack<<"), track rejected!\n";
120  }
121  return true;
122  }
123 
124  // compute the distance of last hit to point at which track leaves this detector volume.
125  // In case nHits = 0 don't do this check (whether or not the track is genuine has
126  // been decided already in the previous for(ihit=0 ;ihit<nHits;ihit++) loop).
127 
128  if(nHits>0){
129 
130  // here S is already the fi of the last point.
131  if( GeometryCalculator.IsInsideArc(Oxx,Oyy,Charge,
132  Xcross,
133  Ycross,
134  S ))
135  {
136 
137  Distance[nHits] =
138  (info[ListHits[nHits-1]][0]-Xcross[1])*
139  (info[ListHits[nHits-1]][0]-Xcross[1])+
140  (info[ListHits[nHits-1]][1]-Ycross[1])*
141  (info[ListHits[nHits-1]][1]-Ycross[1]);
142  ;
143  if(istampa>1)cout<<"in BadTrack_ParStt, Stt || hit n. (original notation) "
144  <<ListHits[nHits-1]<<", Distance to boundary = "
145  <<sqrt(Distance[nHits])<<", 4*cut "<<4.*cut<<endl;
146 
147  if( Distance[nHits]>cut2 ){
148  if( Distance[nHits]>16.*cut2)return true;
149  ibad++;
150  } // end of if( Distance[nHits]>cut2 )
151  } // end of if( IsInsideArc
152 
153 if(istampa>1)cout<<"in BadTrack_ParStt, ibad "<<ibad<<", max bad allowed = "<< maxnum<<endl;
154 
155  if( ibad > maxnum) return true;
156  return false;
157 
158  } // end of if(nHits>0)
159 
160 
161 
162  return true;
163 }
friend F32vec4 sqrt(const F32vec4 &a)
Definition: P4_F32vec4.h:29
double cut[MAX]
Definition: autocutx.C:36
const Double_t PI
int nHits
Definition: RiemannTest.C:16
Double_t
bool IsInsideArc(Double_t Oxx, Double_t Oyy, Short_t Charge, Double_t Xcross[2], Double_t Ycross[2], Double_t Spoint)
friend F32vec4 atan2(const F32vec4 &y, const F32vec4 &x)
Definition: P4_F32vec4.h:117
Double_t CalculateArcLength(Double_t Oxx, Double_t Oyy, Double_t Rr, Short_t Charge, Double_t *Xcross, Double_t *Ycross)
PndTrkCleanup::ClassDef ( PndTrkCleanup  ,
 
)
bool PndTrkCleanup::GoodTrack ( Double_t  info[][7],
bool  farthest_hit_is_boundary,
Double_t  Ox,
Double_t  Oy,
Double_t  R,
Short_t  Charge,
Short_t  nHits,
Short_t *  ListHits,
Short_t *  StrawCode,
Short_t *  StrawCode2,
Short_t *  TubeID,
Short_t *  nParContiguous,
Short_t  ListParContiguous[][6],
Double_t xTube,
Double_t yTube,
Double_t zTube,
Double_t xxyyTube,
Short_t &  holes 
)

Definition at line 171 of file PndTrkCleanup.cxx.

References atan2(), DIAMETERSTRAWTUBE2, Double_t, fabs(), fi, i, PndTrkCTGeometryCalculations::IsInsideArc(), MAX_NOT_CONNECTED, PI, sqrt(), and STRAWRADIUS.

192 {
193 
194  // Convention for the Sector number used in GoodTrack :
195  // Sector = 1 --> Axial Outer Right
196  // Sector = 2 --> Axial Inner Right
197  // Sector = 3 --> Axial Inner Left
198  // Sector = 4 --> Axial Outer Left
199 
200 
201  // holes == # of "holes" in the track;
202  // no_holes == flag requiring total continuity of track (no holes) ;
203  //farthest_hit_is_boundary --> if this flag is true the hit of the track furthest from the origin is
204  // at the boundary of the sector;
205 
206  // nHits == # hits in this track under scrutiny;
207  // info == some information on the hits;
208  // ListHits == list hits in this track under scrutiny;
209  // TubeID == hit number;
210 
211 
212  bool boundary,
213  yes;
214 
215  Short_t
216  i,
217  index,
218  index_last,
219  inner,
220  j,
221  //nIntersections, //[R.K. 01/2017] unused variable?
222  outer,
223  //tube_current, //[R.K. 01/2017] unused variable?
224  tube_next;
225 
226 
227  Double_t
228  dist,
229  dist2,
230  fi,
231  //Start[3], //[R.K. 01/2017] unused variable?
232  Xend[2],
233  Yend[2];
234 
235  PndTrkCTGeometryCalculations GeometryCalculator;
236 
237 // the first hit is the farthest from (0,0,0);
238 // StrawCode convention (in the following left or right is looking to the beam from downstream) :
239 // -1 = not a boundary straw;
240 // 10= inner axial boundary left;
241 // 20= inner axial boundary right;
242 // 12= outer VERTICAL (BUT NOT OUTERMOST) axial boundary left;
243 // 22= outer VERTICAL (BUT NOT OUTERMOST) axial boundary right;
244 // 13= outermost axial boundary left;
245 // 23= outermost axial boundary right;
246 
247 // the flags are 2 (StrawCode and StrawCode2) since a straw can belong to 2 boundaries;
248 
249 
250 
251 
252  // first check if the first hit is required to be at the boundary; if so verify the condition;
253  // only one hole is allowed;
254  if( farthest_hit_is_boundary ){
255  index = TubeID[ ListHits[nHits-1] ]; // number corresponding to the Straw of the last hit in the list;
256  if( StrawCode[ index -1 ] == -1 && StrawCode2[ index -1 ] ==-1 ) {
257  // not at any boundary; before returning false check if one hole is still allowed and if so
258  // check if any of the neighbours of the first hit, is at boundary : if so increment the
259  // number of holes and go on;
260  if( holes >= MAX_NOT_CONNECTED) return false; // because we know already that holes becomes >= MAX_NOT_CONNECTED+1;
261  yes=false;
262  // loop over the Straws contiguous to the current under scrutiny;
263  for(i=0;i<nParContiguous[index-1];i++){
264  if( StrawCode[ ListParContiguous[index-1][i] -1 ] > -1 ||
265  StrawCode2[ ListParContiguous[index-1][i] -1 ] > -1)
266  {
267  holes++;
268  yes=true;
269  break;
270  }
271  } // end of for(i=0;i<nHits-1;i++)
272  if(!yes) return false; // none of the neighbouring Straws is at the boundary;
273 
274 
275  } // end of if( StrawCode[ index -1 ] == -1 && StrawCode2[ index -1 ] ==-1 )
276 
277  } // end of if( farthest_hit_is_boundary )
278 
279  //---------------------------------------------------
280  // now check if hits are contiguous going from the outermost to the innermost;
281  for(i=0;i<nHits-1;i++){
282  outer = nHits-i-1;
283  inner = nHits-i-2;
284 // tube_current = TubeID[ ListHits[outer] ];
285 // tube_next = TubeID[ ListHits[inner] ];
286 
287  // distance squared between centers of the two straws;
288  dist2 = (info[ListHits[outer]][0]-info[ListHits[inner]][0])*(info[ListHits[outer]][0]-info[ListHits[inner]][0]);
289  dist2 += (info[ListHits[outer]][1]-info[ListHits[inner]][1])*(info[ListHits[outer]][1]-info[ListHits[inner]][1]);
290  if( dist2 < DIAMETERSTRAWTUBE2 * 1.1) continue; //tubes are contiguous; the factor 1.1 just to be sure
291  // against rounding errors ;
292 
293  // ----------------------------------------------------------------------------------------------------------
294  // case when tube_current and tube_next are not contiguous;
295 
296  // case in which there are only 1 entrance point and 1 exit point for the track (the most common one);
297  // in this case all hits of the track are internal in this sector --> calculate the contiguity level
298  // of the two hits under scrutiny;
299 
300  // next-to-contiguos hits;
301  if( dist2 < 16.*STRAWRADIUS*STRAWRADIUS * 1.1) {
302  // increase holes by 1 and then check if holes>MAX_NOT_CONNECTED discard the track;
303  holes++;
304  if(holes > MAX_NOT_CONNECTED) return false;
305  continue; // case accepted;
306  } else {
307  // distance between tube_current and tube_next >= 2 straws, discard the track;
308  return false;
309  }
310 
311 
312  } // end of for(i=0;i<nHits;i++
313 
314 
315 //-----------------------------------------------------------------------------------------------
316 
317  // check on the innermost hit (namely : ListHits[0]) ; it must be a boundary hit OR a next-to-boundary hit;
318 
319  index_last = TubeID[ListHits[0]] -1 ;
320  // it is at the boundary, therefore track is accepted;
321  if(!(StrawCode[index_last] == -1 && StrawCode2[index_last] == -1)){
322  return true;
323  }
324 
325  if(holes == MAX_NOT_CONNECTED){
326  // in this case the track must be rejected because the number of holes is > MAX_NOT_CONNECTED;
327  return false;
328 
329  } else {
330  // check if any of the neighbor straws, BELONGING TO THE TRACK AND IN THE RIGHT
331  // ORDER (according to the Charge), is a boundary track;
332 
333  boundary = false;
334  Xend[0] = Yend[0] = 0. ; // the origin;
335  Xend[1] = xTube[index_last];
336  Yend[1] = yTube[index_last];
337  for(j=0;j<nParContiguous[ index_last ];j++){
338  tube_next = ListParContiguous[index_last][j] ;
339 
340  // calculate the distance between the center of the trajectory and the center of the straw;
341  // xxyyTube has been calculated (and passed trough various calling sequences) in
342  // PndTrkTracking2.cxx
343  dist2 = xxyyTube[tube_next-1] -2.*(xTube[tube_next-1]*Ox + yTube[tube_next-1]*Oy)+
344  Ox*Ox + Oy*Oy;
345  dist = fabs(sqrt(dist2)-R);
346  if( dist > STRAWRADIUS * 1.5) continue; //tubes doesn't lie on trajectory; the factor 1.5 just to be sure
347 
348  // now check that the tube_next lies between (0,0) and the hit = ListHits[0] when running on the
349  // trajectory according to the charge (namely : +ve --> clockwise, -ve --> anticlockwise);
350  // the coordinates of the ends of the arc are given in Xend[2] and Yend[2];
351  // fi is the angle (between 0. and 2 PI ) of the point under srutiny (==tube_next center);
352 
353  fi = atan2( yTube[tube_next-1]-Oy, xTube[tube_next-1]-Ox);
354  if(fi<0.) fi += 2.*PI;
355  if(fi<0.) fi = 0.;
356 
357  if( GeometryCalculator.IsInsideArc(Ox,Oy,Charge,Xend,Yend,fi)){
358  // check if this is at boundary;
359  if( !(StrawCode[tube_next-1] == -1 && StrawCode2[tube_next-1] == -1) ) {
360  boundary = true;
361  break;
362  }
363  } // end of if( GeometryCalculator.IsInsideArc(Ox,Oy,Charge,Xend,Yend,f))
364 
365  } // end of for(j=0;j<nParContiguous[ index_last ];j++)
366 
367  if(boundary){
368  holes++;
369  return true;
370  } else {
371  return false;
372  }
373 
374  } // end of if(holes == MAX_NOT_CONNECTED)
375 
376 
377 }
const Double_t DIAMETERSTRAWTUBE2
Int_t i
Definition: run_full.C:25
friend F32vec4 sqrt(const F32vec4 &a)
Definition: P4_F32vec4.h:29
const int MAX_NOT_CONNECTED
const Double_t PI
int nHits
Definition: RiemannTest.C:16
TFile * fi
Double_t
const Double_t STRAWRADIUS
friend F32vec4 fabs(const F32vec4 &a)
Definition: P4_F32vec4.h:47
bool IsInsideArc(Double_t Oxx, Double_t Oyy, Short_t Charge, Double_t Xcross[2], Double_t Ycross[2], Double_t Spoint)
friend F32vec4 atan2(const F32vec4 &y, const F32vec4 &x)
Definition: P4_F32vec4.h:117
Double_t R
Definition: checkhelixhit.C:61
bool PndTrkCleanup::IsThereHitInMvdMiniDisk ( Double_t  ZLayerBegin,
Short_t  nPixelHitsinTrack,
Short_t *  ListMvdPixelHitsinTrack,
Double_t XMvdPixel,
Double_t YMvdPixel,
Double_t ZMvdPixel,
Short_t  nStripHitsinTrack,
Short_t *  ListMvdStripHitsinTrack,
Double_t XMvdStrip,
Double_t YMvdStrip,
Double_t ZMvdStrip,
PndTrkCTGeometryCalculations GeometryCalculator 
)

Definition at line 442 of file PndTrkCleanup.cxx.

References i, PndTrkCTGeometryCalculations::IsInMvdMiniDisk10_41to10_43(), PndTrkCTGeometryCalculations::IsInMvdMiniDisk14_77to14_79(), PndTrkCTGeometryCalculations::IsInMvdMiniDisk15_21to15_23(), PndTrkCTGeometryCalculations::IsInMvdMiniDisk1_97to1_99(), PndTrkCTGeometryCalculations::IsInMvdMiniDisk21_77to21_79(), PndTrkCTGeometryCalculations::IsInMvdMiniDisk22_21to22_23(), PndTrkCTGeometryCalculations::IsInMvdMiniDisk2_41to2_43(), PndTrkCTGeometryCalculations::IsInMvdMiniDisk3_97to3_99(), PndTrkCTGeometryCalculations::IsInMvdMiniDisk4_41to4_43(), PndTrkCTGeometryCalculations::IsInMvdMiniDisk6_97to6_99(), PndTrkCTGeometryCalculations::IsInMvdMiniDisk7_41to7_43(), and PndTrkCTGeometryCalculations::IsInMvdMiniDisk9_97to9_99().

459 {
460 
461  int i;
462 
463 
464  // all the MvdMiniDisks sensitive layers begin at Z position ZLayerBegin and ends at ZLayerBegin+0.02;
465 
466 
467 
468 
469  if( ZLayerBegin == 1.97){
470 
471  // first the Mvd Pixel hits;
472 
473  for(i=0;i<nPixelHitsinTrack;i++){
474  if( ZMvdPixel[ ListMvdPixelHitsinTrack[i] ] <= ZLayerBegin+0.02
475  && ZMvdPixel[ ListMvdPixelHitsinTrack[i] ] >= ZLayerBegin){
476 
477  if(
478  GeometryCalculator->IsInMvdMiniDisk1_97to1_99(
479  XMvdPixel[ListMvdPixelHitsinTrack[i]],
480  YMvdPixel[ListMvdPixelHitsinTrack[i]]
481  )
482  ) return true;
483  }
484  } // end of for(i=0;i<nPixelHitsinTrack;i++)
485 
486  // then the Mvd Strip hits;
487 
488  for(i=0;i<nStripHitsinTrack;i++){
489  if( ZMvdStrip[ ListMvdStripHitsinTrack[i] ] <= ZLayerBegin+0.02
490  && ZMvdStrip[ ListMvdStripHitsinTrack[i] ] >= ZLayerBegin){
491 
492  if(
493  GeometryCalculator->IsInMvdMiniDisk1_97to1_99(
494  XMvdStrip[ListMvdStripHitsinTrack[i]],
495  YMvdStrip[ListMvdStripHitsinTrack[i]]
496  )
497  ) return true;
498  }
499  } // end of for(i=0;i<nPixelHitsinTrack;i++)
500 
501  return false;
502 
503 
504 
505  } else if( ZLayerBegin == 2.41) {
506 
507  // first the Mvd Pixel hits;
508 
509  for(i=0;i<nPixelHitsinTrack;i++){
510  if( ZMvdPixel[ ListMvdPixelHitsinTrack[i] ] <= ZLayerBegin+0.02
511  && ZMvdPixel[ ListMvdPixelHitsinTrack[i] ] >= ZLayerBegin){
512 
513  if(
514  GeometryCalculator->IsInMvdMiniDisk2_41to2_43(
515  XMvdPixel[ListMvdPixelHitsinTrack[i]],
516  YMvdPixel[ListMvdPixelHitsinTrack[i]]
517  )
518  ) return true;
519  }
520  } // end of for(i=0;i<nPixelHitsinTrack;i++)
521 
522  // then the Mvd Strip hits;
523 
524  for(i=0;i<nStripHitsinTrack;i++){
525  if( ZMvdStrip[ ListMvdStripHitsinTrack[i] ] <= ZLayerBegin+0.02
526  && ZMvdStrip[ ListMvdStripHitsinTrack[i] ] >= ZLayerBegin){
527 
528  if(
529  GeometryCalculator->IsInMvdMiniDisk2_41to2_43(
530  XMvdStrip[ListMvdStripHitsinTrack[i]],
531  YMvdStrip[ListMvdStripHitsinTrack[i]]
532  )
533  ) return true;
534  }
535  } // end of for(i=0;i<nPixelHitsinTrack;i++)
536 
537  return false;
538 
539 
540  } else if( ZLayerBegin == 3.97) {
541 
542 
543  // first the Mvd Pixel hits;
544 
545  for(i=0;i<nPixelHitsinTrack;i++){
546  if( ZMvdPixel[ ListMvdPixelHitsinTrack[i] ] <= ZLayerBegin+0.02
547  && ZMvdPixel[ ListMvdPixelHitsinTrack[i] ] >= ZLayerBegin){
548 
549  if(
550  GeometryCalculator->IsInMvdMiniDisk3_97to3_99(
551  XMvdPixel[ListMvdPixelHitsinTrack[i]],
552  YMvdPixel[ListMvdPixelHitsinTrack[i]]
553  )
554  ) return true;
555  }
556  } // end of for(i=0;i<nPixelHitsinTrack;i++)
557 
558  // then the Mvd Strip hits;
559 
560  for(i=0;i<nStripHitsinTrack;i++){
561  if( ZMvdStrip[ ListMvdStripHitsinTrack[i] ] <= ZLayerBegin+0.02
562  && ZMvdStrip[ ListMvdStripHitsinTrack[i] ] >= ZLayerBegin){
563 
564  if(
565  GeometryCalculator->IsInMvdMiniDisk3_97to3_99(
566  XMvdStrip[ListMvdStripHitsinTrack[i]],
567  YMvdStrip[ListMvdStripHitsinTrack[i]]
568  )
569  ) return true;
570  }
571  } // end of for(i=0;i<nPixelHitsinTrack;i++)
572 
573  return false;
574 
575 
576 
577  } else if( ZLayerBegin == 4.41) {
578 
579 
580  // first the Mvd Pixel hits;
581 
582  for(i=0;i<nPixelHitsinTrack;i++){
583  if( ZMvdPixel[ ListMvdPixelHitsinTrack[i] ] <= ZLayerBegin+0.02
584  && ZMvdPixel[ ListMvdPixelHitsinTrack[i] ] >= ZLayerBegin){
585 
586  if(
587  GeometryCalculator->IsInMvdMiniDisk4_41to4_43(
588  XMvdPixel[ListMvdPixelHitsinTrack[i]],
589  YMvdPixel[ListMvdPixelHitsinTrack[i]]
590  )
591  ) return true;
592  }
593  } // end of for(i=0;i<nPixelHitsinTrack;i++)
594 
595  // then the Mvd Strip hits;
596 
597  for(i=0;i<nStripHitsinTrack;i++){
598  if( ZMvdStrip[ ListMvdStripHitsinTrack[i] ] <= ZLayerBegin+0.02
599  && ZMvdStrip[ ListMvdStripHitsinTrack[i] ] >= ZLayerBegin){
600 
601  if(
602  GeometryCalculator->IsInMvdMiniDisk4_41to4_43(
603  XMvdStrip[ListMvdStripHitsinTrack[i]],
604  YMvdStrip[ListMvdStripHitsinTrack[i]]
605  )
606  ) return true;
607  }
608  } // end of for(i=0;i<nPixelHitsinTrack;i++)
609 
610  return false;
611 
612 
613 
614  } else if( ZLayerBegin == 6.97) {
615 
616 
617  // first the Mvd Pixel hits;
618 
619  for(i=0;i<nPixelHitsinTrack;i++){
620  if( ZMvdPixel[ ListMvdPixelHitsinTrack[i] ] <= ZLayerBegin+0.02
621  && ZMvdPixel[ ListMvdPixelHitsinTrack[i] ] >= ZLayerBegin){
622 
623  if(
624  GeometryCalculator->IsInMvdMiniDisk6_97to6_99(
625  XMvdPixel[ListMvdPixelHitsinTrack[i]],
626  YMvdPixel[ListMvdPixelHitsinTrack[i]]
627  )
628  ) return true;
629  }
630  } // end of for(i=0;i<nPixelHitsinTrack;i++)
631 
632  // then the Mvd Strip hits;
633 
634  for(i=0;i<nStripHitsinTrack;i++){
635  if( ZMvdStrip[ ListMvdStripHitsinTrack[i] ] <= ZLayerBegin+0.02
636  && ZMvdStrip[ ListMvdStripHitsinTrack[i] ] >= ZLayerBegin){
637 
638  if(
639  GeometryCalculator->IsInMvdMiniDisk6_97to6_99(
640  XMvdStrip[ListMvdStripHitsinTrack[i]],
641  YMvdStrip[ListMvdStripHitsinTrack[i]]
642  )
643  ) return true;
644  }
645  } // end of for(i=0;i<nPixelHitsinTrack;i++)
646 
647  return false;
648 
649 
650  } else if( ZLayerBegin == 7.41) {
651 
652 
653  // first the Mvd Pixel hits;
654 
655  for(i=0;i<nPixelHitsinTrack;i++){
656  if( ZMvdPixel[ ListMvdPixelHitsinTrack[i] ] <= ZLayerBegin+0.02
657  && ZMvdPixel[ ListMvdPixelHitsinTrack[i] ] >= ZLayerBegin){
658 
659  if(
660  GeometryCalculator->IsInMvdMiniDisk7_41to7_43(
661  XMvdPixel[ListMvdPixelHitsinTrack[i]],
662  YMvdPixel[ListMvdPixelHitsinTrack[i]]
663  )
664  ) return true;
665  }
666  } // end of for(i=0;i<nPixelHitsinTrack;i++)
667 
668  // then the Mvd Strip hits;
669 
670  for(i=0;i<nStripHitsinTrack;i++){
671  if( ZMvdStrip[ ListMvdStripHitsinTrack[i] ] <= ZLayerBegin+0.02
672  && ZMvdStrip[ ListMvdStripHitsinTrack[i] ] >= ZLayerBegin){
673 
674  if(
675  GeometryCalculator->IsInMvdMiniDisk7_41to7_43(
676  XMvdStrip[ListMvdStripHitsinTrack[i]],
677  YMvdStrip[ListMvdStripHitsinTrack[i]]
678  )
679  ) return true;
680  }
681  } // end of for(i=0;i<nPixelHitsinTrack;i++)
682 
683  return false;
684 
685 
686 
687  } else if( ZLayerBegin == 9.97) {
688 
689 
690  // first the Mvd Pixel hits;
691 
692  for(i=0;i<nPixelHitsinTrack;i++){
693  if( ZMvdPixel[ ListMvdPixelHitsinTrack[i] ] <= ZLayerBegin+0.02
694  && ZMvdPixel[ ListMvdPixelHitsinTrack[i] ] >= ZLayerBegin){
695 
696  if(
697  GeometryCalculator->IsInMvdMiniDisk9_97to9_99(
698  XMvdPixel[ListMvdPixelHitsinTrack[i]],
699  YMvdPixel[ListMvdPixelHitsinTrack[i]]
700  )
701  ) return true;
702  }
703  } // end of for(i=0;i<nPixelHitsinTrack;i++)
704 
705  // then the Mvd Strip hits;
706 
707  for(i=0;i<nStripHitsinTrack;i++){
708  if( ZMvdStrip[ ListMvdStripHitsinTrack[i] ] <= ZLayerBegin+0.02
709  && ZMvdStrip[ ListMvdStripHitsinTrack[i] ] >= ZLayerBegin){
710 
711  if(
712  GeometryCalculator->IsInMvdMiniDisk9_97to9_99(
713  XMvdStrip[ListMvdStripHitsinTrack[i]],
714  YMvdStrip[ListMvdStripHitsinTrack[i]]
715  )
716  ) return true;
717  }
718  } // end of for(i=0;i<nPixelHitsinTrack;i++)
719 
720  return false;
721 
722 
723 
724  } else if( ZLayerBegin == 10.41) {
725 
726 
727  // first the Mvd Pixel hits;
728 
729  for(i=0;i<nPixelHitsinTrack;i++){
730  if( ZMvdPixel[ ListMvdPixelHitsinTrack[i] ] <= ZLayerBegin+0.02
731  && ZMvdPixel[ ListMvdPixelHitsinTrack[i] ] >= ZLayerBegin){
732 
733  if(
734  GeometryCalculator->IsInMvdMiniDisk10_41to10_43(
735  XMvdPixel[ListMvdPixelHitsinTrack[i]],
736  YMvdPixel[ListMvdPixelHitsinTrack[i]]
737  )
738  ) return true;
739  }
740  } // end of for(i=0;i<nPixelHitsinTrack;i++)
741 
742  // then the Mvd Strip hits;
743 
744  for(i=0;i<nStripHitsinTrack;i++){
745  if( ZMvdStrip[ ListMvdStripHitsinTrack[i] ] <= ZLayerBegin+0.02
746  && ZMvdStrip[ ListMvdStripHitsinTrack[i] ] >= ZLayerBegin){
747 
748  if(
749  GeometryCalculator->IsInMvdMiniDisk10_41to10_43(
750  XMvdStrip[ListMvdStripHitsinTrack[i]],
751  YMvdStrip[ListMvdStripHitsinTrack[i]]
752  )
753  ) return true;
754  }
755  } // end of for(i=0;i<nPixelHitsinTrack;i++)
756 
757  return false;
758 
759 
760 
761  } else if( ZLayerBegin == 14.77) {
762 
763 
764  // first the Mvd Pixel hits;
765 
766  for(i=0;i<nPixelHitsinTrack;i++){
767  if( ZMvdPixel[ ListMvdPixelHitsinTrack[i] ] <= ZLayerBegin+0.02
768  && ZMvdPixel[ ListMvdPixelHitsinTrack[i] ] >= ZLayerBegin){
769 
770  if(
771  GeometryCalculator->IsInMvdMiniDisk14_77to14_79(
772  XMvdPixel[ListMvdPixelHitsinTrack[i]],
773  YMvdPixel[ListMvdPixelHitsinTrack[i]]
774  )
775  ) return true;
776  }
777  } // end of for(i=0;i<nPixelHitsinTrack;i++)
778 
779  // then the Mvd Strip hits;
780 
781  for(i=0;i<nStripHitsinTrack;i++){
782  if( ZMvdStrip[ ListMvdStripHitsinTrack[i] ] <= ZLayerBegin+0.02
783  && ZMvdStrip[ ListMvdStripHitsinTrack[i] ] >= ZLayerBegin){
784 
785  if(
786  GeometryCalculator->IsInMvdMiniDisk14_77to14_79(
787  XMvdStrip[ListMvdStripHitsinTrack[i]],
788  YMvdStrip[ListMvdStripHitsinTrack[i]]
789  )
790  ) return true;
791  }
792  } // end of for(i=0;i<nPixelHitsinTrack;i++)
793 
794  return false;
795 
796 
797 
798  } else if( ZLayerBegin == 15.21) {
799 
800 
801  // first the Mvd Pixel hits;
802 
803  for(i=0;i<nPixelHitsinTrack;i++){
804  if( ZMvdPixel[ ListMvdPixelHitsinTrack[i] ] <= ZLayerBegin+0.02
805  && ZMvdPixel[ ListMvdPixelHitsinTrack[i] ] >= ZLayerBegin){
806 
807  if(
808  GeometryCalculator->IsInMvdMiniDisk15_21to15_23(
809  XMvdPixel[ListMvdPixelHitsinTrack[i]],
810  YMvdPixel[ListMvdPixelHitsinTrack[i]]
811  )
812  ) return true;
813  }
814  } // end of for(i=0;i<nPixelHitsinTrack;i++)
815 
816  // then the Mvd Strip hits;
817 
818  for(i=0;i<nStripHitsinTrack;i++){
819  if( ZMvdStrip[ ListMvdStripHitsinTrack[i] ] <= ZLayerBegin+0.02
820  && ZMvdStrip[ ListMvdStripHitsinTrack[i] ] >= ZLayerBegin){
821 
822  if(
823  GeometryCalculator->IsInMvdMiniDisk15_21to15_23(
824  XMvdStrip[ListMvdStripHitsinTrack[i]],
825  YMvdStrip[ListMvdStripHitsinTrack[i]]
826  )
827  ) return true;
828  }
829  } // end of for(i=0;i<nPixelHitsinTrack;i++)
830 
831  return false;
832 
833 
834 
835  } else if( ZLayerBegin == 21.77) {
836 
837 
838  // first the Mvd Pixel hits;
839 
840  for(i=0;i<nPixelHitsinTrack;i++){
841  if( ZMvdPixel[ ListMvdPixelHitsinTrack[i] ] <= ZLayerBegin+0.02
842  && ZMvdPixel[ ListMvdPixelHitsinTrack[i] ] >= ZLayerBegin){
843 
844  if(
845  GeometryCalculator->IsInMvdMiniDisk21_77to21_79(
846  XMvdPixel[ListMvdPixelHitsinTrack[i]],
847  YMvdPixel[ListMvdPixelHitsinTrack[i]]
848  )
849  ) return true;
850  }
851  } // end of for(i=0;i<nPixelHitsinTrack;i++)
852 
853  // then the Mvd Strip hits;
854 
855  for(i=0;i<nStripHitsinTrack;i++){
856  if( ZMvdStrip[ ListMvdStripHitsinTrack[i] ] <= ZLayerBegin+0.02
857  && ZMvdStrip[ ListMvdStripHitsinTrack[i] ] >= ZLayerBegin){
858 
859  if(
860  GeometryCalculator->IsInMvdMiniDisk21_77to21_79(
861  XMvdStrip[ListMvdStripHitsinTrack[i]],
862  YMvdStrip[ListMvdStripHitsinTrack[i]]
863  )
864  ) return true;
865  }
866  } // end of for(i=0;i<nPixelHitsinTrack;i++)
867 
868  return false;
869 
870 
871 
872  } else if( ZLayerBegin == 22.21) {
873 
874 
875  // first the Mvd Pixel hits;
876 
877  for(i=0;i<nPixelHitsinTrack;i++){
878  if( ZMvdPixel[ ListMvdPixelHitsinTrack[i] ] <= ZLayerBegin+0.02
879  && ZMvdPixel[ ListMvdPixelHitsinTrack[i] ] >= ZLayerBegin){
880 
881  if(
882  GeometryCalculator->IsInMvdMiniDisk22_21to22_23(
883  XMvdPixel[ListMvdPixelHitsinTrack[i]],
884  YMvdPixel[ListMvdPixelHitsinTrack[i]]
885  )
886  ) return true;
887  }
888  } // end of for(i=0;i<nPixelHitsinTrack;i++)
889 
890  // then the Mvd Strip hits;
891 
892  for(i=0;i<nStripHitsinTrack;i++){
893  if( ZMvdStrip[ ListMvdStripHitsinTrack[i] ] <= ZLayerBegin+0.02
894  && ZMvdStrip[ ListMvdStripHitsinTrack[i] ] >= ZLayerBegin){
895 
896  if(
897  GeometryCalculator->IsInMvdMiniDisk22_21to22_23(
898  XMvdStrip[ListMvdStripHitsinTrack[i]],
899  YMvdStrip[ListMvdStripHitsinTrack[i]]
900  )
901  ) return true;
902  }
903  } // end of for(i=0;i<nPixelHitsinTrack;i++)
904 
905  return false;
906 
907 
908 
909  } else {
910  cout<<"PndTrkCleanup.cxx::IsThereHitInMvdMiniDisk WARNING, this Mvd MiniDisk apparently"<<
911  " is not in the list of known Mvd MiniDisks !";
912  }
913 
914  return false; //FIXME Is this logically correct?
915 
916 }
bool IsInMvdMiniDisk6_97to6_99(Double_t X, Double_t Y)
Int_t i
Definition: run_full.C:25
bool IsInMvdMiniDisk10_41to10_43(Double_t X, Double_t Y)
bool IsInMvdMiniDisk9_97to9_99(Double_t X, Double_t Y)
bool IsInMvdMiniDisk14_77to14_79(Double_t X, Double_t Y)
bool IsInMvdMiniDisk22_21to22_23(Double_t X, Double_t Y)
bool IsInMvdMiniDisk21_77to21_79(Double_t X, Double_t Y)
bool IsInMvdMiniDisk4_41to4_43(Double_t X, Double_t Y)
bool IsInMvdMiniDisk2_41to2_43(Double_t X, Double_t Y)
bool IsInMvdMiniDisk7_41to7_43(Double_t X, Double_t Y)
bool IsInMvdMiniDisk15_21to15_23(Double_t X, Double_t Y)
bool IsInMvdMiniDisk1_97to1_99(Double_t X, Double_t Y)
bool IsInMvdMiniDisk3_97to3_99(Double_t X, Double_t Y)
bool PndTrkCleanup::IsThereMvdHitInBarrel ( Double_t  Xintersect,
Double_t  Yintersect,
Double_t  Zintersect,
Short_t  nPixelHitsinTrack,
Short_t *  ListMvdPixelHitsinTrack,
Double_t XMvdPixel,
Double_t YMvdPixel,
Double_t ZMvdPixel,
Short_t  nStripHitsinTrack,
Short_t *  ListMvdStripHitsinTrack,
Double_t XMvdStrip,
Double_t YMvdStrip,
Double_t ZMvdStrip 
)

Definition at line 383 of file PndTrkCleanup.cxx.

References Double_t, and fabs().

399 {
400  //bool at_least_one_good_hit; //[R.K. 01/2017] unused variable?
401 
402  Short_t //i, //[R.K. 01/2017] unused variable?
403  j;
404 
405  const Double_t Ximprecision=1. ,
406  Yimprecision=1. ,
407  Zimprecision=1.5 ;
408 
409 
410  for(j=0;j<nPixelHitsinTrack;j++){
411 
412 
413  if(
414  fabs(XMvdPixel[ ListMvdPixelHitsinTrack[j] ]-Xintersect) < Ximprecision
415  && fabs(YMvdPixel[ ListMvdPixelHitsinTrack[j] ]-Yintersect) < Yimprecision
416  && fabs(ZMvdPixel[ ListMvdPixelHitsinTrack[j] ] - Zintersect) < Zimprecision
417  ) return true;
418  } // end of for(j=0;j<nPixelHitsinTrack;j++)
419 
420  for(j=0;j<nStripHitsinTrack;j++){
421 
422  if(
423  fabs(XMvdStrip[ ListMvdStripHitsinTrack[j] ]-Xintersect) < Ximprecision
424  && fabs(YMvdStrip[ ListMvdStripHitsinTrack[j] ]-Yintersect) < Yimprecision
425  && fabs(ZMvdStrip[ ListMvdStripHitsinTrack[j] ] - Zintersect) < Zimprecision
426  ) return true;
427  } // end of for(j=0;j<nStripHitsinTrack;j++)
428 
429  return false;
430 
431 
432 }
Double_t
friend F32vec4 fabs(const F32vec4 &a)
Definition: P4_F32vec4.h:47
bool PndTrkCleanup::MvdCleanup ( Double_t  Ox,
Double_t  Oy,
Double_t  R,
Double_t  fi0,
Double_t  kappa,
Double_t  charge,
Double_t XMvdPixel,
Double_t XMvdStrip,
Double_t YMvdPixel,
Double_t YMvdStrip,
Double_t ZMvdPixel,
Double_t ZMvdStrip,
Short_t  nPixelHitsinTrack,
Short_t *  ListMvdPixelHitsinTrack,
Short_t  nStripHitsinTrack,
Short_t *  ListMvdStripHitsinTrack,
Double_t  extra_distance,
Double_t  extra_distance_Z,
PndTrkCTGeometryCalculations GeomCalculator 
)

Definition at line 928 of file PndTrkCleanup.cxx.

References cos(), Double_t, fabs(), i, MVD_BARREL_FULL_AZIMUTH_MAX_RADIUS, MVD_BARREL_FULL_AZIMUTH_Z_LOW, MVD_BARREL_FULL_AZIMUTH_Z_UP, MVD_BARREL_LAYERS_FULL_AZIMUTH, MVD_BARREL_LAYERS_PARTIAL_AZIMUTH, MVD_BARREL_PARTIAL_AZIMUTH_GAP_LOW_INNER, MVD_BARREL_PARTIAL_AZIMUTH_GAP_LOW_OUTER, MVD_BARREL_PARTIAL_AZIMUTH_GAP_UP_INNER, MVD_BARREL_PARTIAL_AZIMUTH_GAP_UP_OUTER, MVD_BARREL_PARTIAL_AZIMUTH_NGAP, MVD_BARREL_PARTIAL_AZIMUTH_RADIUS_INNER, MVD_BARREL_PARTIAL_AZIMUTH_RADIUS_OUTER, MVD_BARREL_PARTIAL_AZIMUTH_Z_LOW, MVD_BARREL_PARTIAL_AZIMUTH_Z_UP, MVD_DISK_LAYERS, MVD_DISK_MAX_RADIUS, MVD_DISK_MIN_RADIUS, MVD_DISK_Z, MVD_MINIDISK_LAYERS, MVD_Z_LAYER_BEGIN, r, sin(), and sqrt().

Referenced by PndTrkTracking2::Exec().

949 {
950 
951 /*
952  Double_t Ox --> X of center of the Helix of the particle trajectory;
953  Double_t Oy --> Y of center of the Helix of the particle trajectory;
954  Double_t R, --> radius of the Helix of the particle trajectory;
955  Double_t fi0 --> FI0 of the Helix of the particle trajectory;
956  Double_t kappa --> KAPPA of the Helix of the particle trajectory;
957  Double_t charge --> charge of the particle;
958  Double_t semiverticalgap --> half dimension of the gap between the two STT sectors;
959  Short_t nMvdHits --> number of Mvd hits in this track;
960  Double_t extra_distance --> in cm; extra distance (in X and Y) allowed during the process to decide whether there
961  should be an hit in a Mvd sensitive layer;
962  Double_t extra_distance_Z --> in cm; extra distance in Z allowed during the process to decide whether there
963  should be an hit in a Mvd sensitive layer;
964  PndTrkCTGeometryCalculations* GeomCalculator --> class that makes the geometrical calculations;
965 */
966 
967  bool
968  yes_hit;
969 
970  Short_t
971  i,
972  j,
973  nFaults,
974  n_forseen_hits,
975  n_present_hits,
976  type_of_intersection_in_disk[MVD_DISK_LAYERS] // = +1 --> track completely in the sensors;
977  // = 0 --> uncertain; = -1 --> out of the sensor;
978  //,yes_intersect //[R.K. 01/2017] unused variable?
979  ;
980  Double_t
981  //FiOrderedList[2], //[R.K. 01/2017] unused variable?
982  phase,
983  r,
984  rmax,
985  rmin,
986  //r2, //[R.K. 01/2017] unused variable?
987  //Xcross[2], //[R.K. 01/2017] unused variable?
988  X_disk,
989  Xintersect[2],
990  //Xlow, //[R.K.02/2017] Unused variable?
991  //Xup, //[R.K.02/2017] Unused variable?
992  //Ycross[2], //[R.K. 01/2017] unused variable?
993  Y_disk,
994  Yintersect[2],
995  //Ylow, //[R.K. 01/2017] unused variable?
996  //Yup, //[R.K. 01/2017] unused variable?
997  //Z_disk, //[R.K. 01/2017] unused variable?
998  Zintersect[2];
999 
1000  PndTrkCTGeometryCalculations GeometryCalculator;
1001 
1002 
1003 
1004  // total Mvd hits that are supposed to be in this track (if the parameter of the track were totally right);
1005  n_forseen_hits = 0;
1006  // number of 'right' hits that are present in this track (belonging to the predicted Mvd layers);
1007  n_present_hits = 0;
1008 
1009 //------------------------------------------------------- MVD BARREL ----------------------------------------------------------
1010 
1011  // check of the barrels with full azimuthal coverage ; ----------------------------------------------------
1012 
1013  // loop over the number of barrel Mvd layers with full azimuthal coverage;
1014  // calculate if trajectory intersects such Mvd barrel layers;
1015 
1016 
1017 
1018 
1019  for(i=0;i<MVD_BARREL_LAYERS_FULL_AZIMUTH;i++){
1020 
1021 
1022 
1023  // yes_hit = true --> at least one Mvd hit from this barrel; yes_hit = false --> no Mvd hits from this barrel;
1024 
1026  Ox, // track trajectory center;
1027  Oy, // track trajectory center;
1028  R, // track trajectory radius;
1029  fi0, // track trajectory starting FI;
1030  kappa, // track trajectory Kappa parameter;
1031  charge, // track charge;
1032 
1033  MVD_BARREL_FULL_AZIMUTH_Z_LOW[i], // Z low limit of this barrel;
1034  MVD_BARREL_FULL_AZIMUTH_Z_UP[i], // Z upper limit of this barrel;
1035  MVD_BARREL_FULL_AZIMUTH_MAX_RADIUS[i], // R maximum of this barrel;
1036  GeomCalculator, // pointer to the class making useful geometry
1037  // calculation;
1038  extra_distance_Z,// in cm; extra distance allowed during decision
1039  // if there should be an hit in a Mvd sensitive layer;
1040  Xintersect[0], // output, X position of the point of crossing;
1041  Yintersect[0], // output, Y position of the point of crossing;
1042  Zintersect[0] // output, Z position of the point of crossing;
1043 
1044  );
1045  // verify if actually there is a hit in this MVD barrel;
1046 
1047 
1048  if( yes_hit){
1049  n_forseen_hits++;
1051  Xintersect[0],
1052  Yintersect[0],
1053  Zintersect[0],
1054 
1055  nPixelHitsinTrack,
1056  ListMvdPixelHitsinTrack,
1057  ZMvdPixel, // list of the X positions of ALL Mvd hits of the event;
1058  YMvdPixel, // list of the Y positions of ALL Mvd hits of the event;
1059  ZMvdPixel, // list of the Z positions of ALL Mvd hits of the event;
1060  nStripHitsinTrack, // number of Mvd Strip hits in this track;
1061  ListMvdStripHitsinTrack,
1062  XMvdStrip, // list of the X positions of ALL Mvd hits of the event;
1063  YMvdStrip, // list of the Y positions of ALL Mvd hits of the event;
1064  ZMvdStrip // list of the Z positions of ALL Mvd hits of the event;
1065  )
1066  ) n_present_hits ++;
1067 
1068 
1069 
1070  } // end of if( yes_hit)
1071 
1072  } // end of for(i=0;i<MVD_BARREL_LAYERS_FULL_AZIMUTH;i++)
1073 
1074  // check on the Barrel Mvd sector; allow only for one hit mismatch;
1075 
1076 
1077  nFaults = n_forseen_hits - n_present_hits;
1078  if( nFaults > 1 ) return false;
1079 
1080 
1081  // end of check of the barrels with full azimuthal coverage ; ---------------------------------------------
1082 
1083 
1084 
1085 
1086  //-------------------------------------------start the check of the barrels with partial azimuthal coverage ;
1087 
1088 
1089  // loop over the number of barrel Mvd layers with partial azimuthal coverage;
1090  // calculate if trajectory intersects such Mvd barrel layers;
1091  for(i=0;i<MVD_BARREL_LAYERS_PARTIAL_AZIMUTH;i++){
1092 
1093 
1094 
1095 
1096  // yes_hit = true --> at least one Mvd hit from this barrel; yes_hit = false --> no Mvd hits from this barrel;
1098  Ox, // track trajectory center;
1099  Oy, // track trajectory center;
1100  R, // track trajectory radius;
1101  fi0, // track trajectory starting FI;
1102  kappa, // track trajectory Kappa parameter;
1103  charge, // track charge;
1104 
1105  MVD_BARREL_PARTIAL_AZIMUTH_Z_LOW[i], // Z low limit of this barrel;
1106  MVD_BARREL_PARTIAL_AZIMUTH_Z_UP[i], // Z upper limit of this barrel;
1107 
1108  MVD_BARREL_PARTIAL_AZIMUTH_RADIUS_INNER[i], // R of this barrel;
1109  MVD_BARREL_PARTIAL_AZIMUTH_NGAP[i][0], // number of gaps in azimuthal angle coverage of INNER;
1110  &MVD_BARREL_PARTIAL_AZIMUTH_GAP_LOW_INNER[i][0], // low limit of the azimuthal gap range;
1111  &MVD_BARREL_PARTIAL_AZIMUTH_GAP_UP_INNER[i][0], // upper limit of the azimuthal gap range;
1112 
1113  MVD_BARREL_PARTIAL_AZIMUTH_RADIUS_OUTER[i], // R of this barrel;
1114  MVD_BARREL_PARTIAL_AZIMUTH_NGAP[i][1], // number of gaps in azimuthal angle coverage og OUTER;
1115  &MVD_BARREL_PARTIAL_AZIMUTH_GAP_LOW_OUTER[i][0], // low limit of the azimuthal gap range;
1116  &MVD_BARREL_PARTIAL_AZIMUTH_GAP_UP_OUTER[i][0], // upper limit of the azimuthal gap range;
1117 
1118  GeomCalculator, // pointer to the class making useful geometry
1119  // calculation;
1120  extra_distance_Z,// in cm; extra distance allowed during decision
1121  // if there should be an hit in a Mvd sensitive layer;
1122  Xintersect, // output, X position of the point of crossing track-Inner Barrel
1123  // and track-Outer Barrel;
1124  Yintersect, // output, Y position of the point of crossing;
1125  Zintersect // output, Z position of the point of crossing;
1126  );
1127 
1128 
1129 
1130 
1131 
1132  if(yes_hit){
1133  // loop over the at most 2 intersections (one with the Inner Barrel, one with the Outer Barrel);
1134  for(j=0; j<2; j++){
1135 
1136  // when there is no intersection between track and Barrel
1137  // Xintersect[j] is set at -99999. ;
1138  if(Xintersect[j] < -99998.) continue ;
1139 
1140 
1141  // there was intersection between this track and this Barrel;
1142  n_forseen_hits++;
1143  // check if there is actually a hit in this Mvd Barrel (Inner or Outer);
1144  if(
1146  Xintersect[j],
1147  Yintersect[j],
1148  Zintersect[j],
1149 
1150  nPixelHitsinTrack,
1151  ListMvdPixelHitsinTrack,
1152  XMvdPixel, // list of the X positions of ALL Mvd hits of the event;
1153  YMvdPixel, // list of the Y positions of ALL Mvd hits of the event;
1154  ZMvdPixel, // list of the Z positions of ALL Mvd hits of the event;
1155  nStripHitsinTrack, // number of Mvd Strip hits in this track;
1156  ListMvdStripHitsinTrack,
1157  XMvdStrip, // list of the X positions of ALL Mvd hits of the event;
1158  YMvdStrip, // list of the Y positions of ALL Mvd hits of the event;
1159  ZMvdStrip // list of the Z positions of ALL Mvd hits of the event;
1160  )
1161  ) n_present_hits ++;
1162 
1163 
1164  } // end of for(j=0; j<2; j++)
1165 
1166 
1167 
1168 
1169  } // end of if(yes_hit){
1170 
1171  } // end of for(i=0;i<MVD_BARREL_LAYERS_PARTIAL_AZIMUTH;i++)
1172 
1173 
1174 
1175  // check on the Barrel Mvd sector; allow only for one hit mismatch;
1176  nFaults = n_forseen_hits - n_present_hits;
1177  if( nFaults > 1 ) return false;
1178 
1179 //------------------------------------------------------- END OF MVD BARREL --------------------------------------------------
1180 
1181 
1182 //------------------------------------------------------- MVD MINIDISK LAYERS ------------------------------------------------
1183 
1184  // loop over all Mvd Minidisks ;
1185 
1186  for(i=0;i<MVD_MINIDISK_LAYERS;i++){
1187 
1189  MVD_Z_LAYER_BEGIN[i], // Z of the beginning of the layer (end of layer = + 0.02);
1190  0.5, // xmargin;
1191  0.5, // ymargin;
1192  Ox, // track trajectory center;
1193  Oy, // track trajectory center;
1194  R, // track trajectory radius;
1195  fi0, // FI0 of the Helix of the particle trajectory;
1196  kappa, // KAPPA of the Helix of the particle trajectory;
1197  charge, // charge of the particle;
1198  GeomCalculator // pointer to the class making useful geometry
1199  // calculation;
1200  )
1201  ){
1202  yes_hit = IsThereHitInMvdMiniDisk(
1203  MVD_Z_LAYER_BEGIN[i], // Z of the beginning of the layer (end of layer = + 0.02);
1204  nPixelHitsinTrack,
1205  ListMvdPixelHitsinTrack,
1206  XMvdPixel,
1207  YMvdPixel,
1208  ZMvdPixel,
1209 
1210  nStripHitsinTrack,
1211  ListMvdStripHitsinTrack,
1212  XMvdStrip,
1213  YMvdStrip,
1214  ZMvdStrip,
1215 
1216  GeomCalculator
1217  );
1218 
1219 
1220 
1221  if (!yes_hit ) {
1222  nFaults++;
1223 
1224  }
1225 
1226 
1227  }
1228  if( nFaults > 1 ) return false;
1229 
1230 
1231  } // end of for(i=0;i<MVD_MINIDISK_LAYERS;i++)
1232 
1233 
1234 
1235 //------------------------------------------------------- END OF MVD MINIDISK LAYERS -----------------------------------------
1236 
1237 //------------------------------------------------------- MVD DISKS ----------------------------------------------------------
1238 
1239 
1240  // loop over the number of Disks Mvd;
1241  // calculate if trajectory intersects the Mvd Disk layers;
1242  for(i=0;i<MVD_DISK_LAYERS;i++){
1243 
1244  // calculate the intersections on the Mvd Disks;
1245  phase = fi0 + kappa * MVD_DISK_Z[i];
1246  X_disk = Ox + R* cos(phase) ;
1247  //Xup = X_disk + extra_distance; //[R.K.02/2017] Unused variable?
1248  //Xlow = X_disk - extra_distance; //[R.K.02/2017] Unused variable?
1249  Y_disk = Oy + R* sin(phase) ;
1250  //Ylow = Y_disk - extra_distance; //[R.K.02/2017] Unused variable?
1251  //Yup = Y_disk + extra_distance; //[R.K.02/2017] Unused variable?
1252 
1253  // now calculate if the intersection falls in the sensor active region of the Mvd Disk;
1254  // theoretical radius**2 of the intersection point;
1255  r = sqrt(X_disk*X_disk + Y_disk*Y_disk);
1256  // conservative maximum possible radius**2 of the intersection point;
1257  rmax = r + extra_distance;
1258  // conservative minimum possible radius**2 of the intersection point;
1259  rmin = r - extra_distance;
1260  if(rmin<0.) rmin=0.;
1261 
1262  if(rmax < MVD_DISK_MAX_RADIUS[i] && rmin > MVD_DISK_MIN_RADIUS[i]) { // certainly in;
1263  type_of_intersection_in_disk[i]=1;
1264  } else if (rmin>MVD_DISK_MAX_RADIUS[i] || rmax < MVD_DISK_MIN_RADIUS[i]){
1265  type_of_intersection_in_disk[i]= -1; // certainly out;
1266  } else {
1267  type_of_intersection_in_disk[i]= 0; // partly in;
1268  }
1269 
1270 
1271 
1272 
1273  }; // end of for(i=0;i<MVD_DISKS_LAYERS;i++)
1274 
1275 
1276  // check if there are the hits in the layer predicted by the previous extrapolation of the track;
1277  // nFaults can be 0 or 1, depending on the analysis of the Barrel layers and Minidisk layers;
1278 
1279  for(i=0;i<MVD_DISK_LAYERS;i++){
1280  if (type_of_intersection_in_disk[i]==1){
1281 
1282  yes_hit = false;
1283 
1284  // loop over all Mvd hits of the track;
1285  for(j=0;j< nPixelHitsinTrack; j++){
1286  if( fabs( ZMvdPixel[ ListMvdPixelHitsinTrack[j] ]-MVD_DISK_Z[i]) < 1.)
1287  {
1288  yes_hit = true;
1289  break;
1290  }
1291  } // end of for(j=0;j< nPixelHitsinTrack; j++)
1292 
1293  if(!yes_hit){
1294  for(j=0;j< nStripHitsinTrack; j++){
1295  if( fabs( ZMvdStrip[ ListMvdStripHitsinTrack[j] ]-MVD_DISK_Z[i]) < 1.)
1296  {
1297  yes_hit = true;
1298  break;
1299  }
1300  } // end of for(j=0;j< nStripHitsinTrack; j++)
1301  } // end of if(!yes_hit)
1302 
1303 // if( yes_hit) cout<<" true "<<endl ; else cout<<" false "<<endl ;
1304 
1305  if(!yes_hit){
1306  nFaults++;
1307  if(nFaults>1) return false;
1308  }
1309 
1310  } // end of if (type_of_intersection_in_disk[i]==1)
1311 
1312  }; // end of for(i=0;i<MVD_DISKS_LAYERS;i++)
1313 
1314 
1315 
1316  return true;
1317 
1318 }
const int MVD_BARREL_LAYERS_PARTIAL_AZIMUTH
friend F32vec4 cos(const F32vec4 &a)
Definition: P4_F32vec4.h:112
const Double_t MVD_BARREL_PARTIAL_AZIMUTH_GAP_LOW_OUTER[11][13]
bool IsThereHitInMvdMiniDisk(Double_t ZLayerBegin, Short_t nPixelHitsinTrack, Short_t *ListMvdPixelHitsinTrack, Double_t *XMvdPixel, Double_t *YMvdPixel, Double_t *ZMvdPixel, Short_t nStripHitsinTrack, Short_t *ListMvdStripHitsinTrack, Double_t *XMvdStrip, Double_t *YMvdStrip, Double_t *ZMvdStrip, PndTrkCTGeometryCalculations *GeometryCalculator)
double r
Definition: RiemannTest.C:14
Int_t i
Definition: run_full.C:25
bool Track_Crosses_MvdBarrelPartialAzimuthalCoverage(Double_t Ox, Double_t Oy, Double_t R, Double_t fi0, Double_t kappa, Double_t charge, Double_t Zlow, Double_t Zup, Double_t RInnerBarrel, int ngapInner, const Double_t *gap_lowInner, const Double_t *gap_upInner, Double_t ROuterBarrel, int ngapOuter, const Double_t *gap_lowOuter, const Double_t *gap_upOuter, PndTrkCTGeometryCalculations *GeometryCalculator, Double_t extra_distance_Z, Double_t *Xintersect, Double_t *Yintersect, Double_t *Zintersect)
friend F32vec4 sqrt(const F32vec4 &a)
Definition: P4_F32vec4.h:29
const int MVD_MINIDISK_LAYERS
friend F32vec4 sin(const F32vec4 &a)
Definition: P4_F32vec4.h:111
bool Track_Crosses_MvdMiniDisk_withMargin(Double_t ZLayerBegin, Double_t xmargin, Double_t ymargin, Double_t Ox, Double_t Oy, Double_t R, Double_t fi0, Double_t kappa, Double_t charge, PndTrkCTGeometryCalculations *GeometryCalculator)
const int MVD_DISK_LAYERS
const Double_t MVD_BARREL_PARTIAL_AZIMUTH_GAP_LOW_INNER[11][13]
const int MVD_BARREL_LAYERS_FULL_AZIMUTH
Double_t
const Double_t MVD_BARREL_FULL_AZIMUTH_MAX_RADIUS[3]
const Double_t MVD_BARREL_PARTIAL_AZIMUTH_RADIUS_INNER[11]
const Double_t MVD_BARREL_PARTIAL_AZIMUTH_GAP_UP_INNER[11][13]
friend F32vec4 fabs(const F32vec4 &a)
Definition: P4_F32vec4.h:47
const Double_t MVD_DISK_Z[2]
bool Track_Crosses_MvdBarrelFullAzimuthalCoverage(Double_t Ox, Double_t Oy, Double_t R, Double_t fi0, Double_t kappa, Double_t charge, const Double_t Zlow, const Double_t Zup, Double_t RBarrel, PndTrkCTGeometryCalculations *GeometryCalculator, Double_t extra_distance_Z, Double_t &Xintersect, Double_t &Yintersect, Double_t &Zintersect)
const Double_t MVD_BARREL_PARTIAL_AZIMUTH_Z_LOW[11]
const Double_t MVD_BARREL_FULL_AZIMUTH_Z_LOW[3]
const Double_t MVD_Z_LAYER_BEGIN[12]
const Double_t MVD_DISK_MAX_RADIUS[2]
bool IsThereMvdHitInBarrel(Double_t Xintersect, Double_t Yintersect, Double_t Zintersect, Short_t nPixelHitsinTrack, Short_t *ListMvdPixelHitsinTrack, Double_t *XMvdPixel, Double_t *YMvdPixel, Double_t *ZMvdPixel, Short_t nStripHitsinTrack, Short_t *ListMvdStripHitsinTrack, Double_t *XMvdStrip, Double_t *YMvdStrip, Double_t *ZMvdStrip)
const Double_t MVD_DISK_MIN_RADIUS[2]
const Double_t MVD_BARREL_PARTIAL_AZIMUTH_Z_UP[11]
Double_t R
Definition: checkhelixhit.C:61
const Double_t MVD_BARREL_FULL_AZIMUTH_Z_UP[3]
const int MVD_BARREL_PARTIAL_AZIMUTH_NGAP[11][2]
const Double_t MVD_BARREL_PARTIAL_AZIMUTH_RADIUS_OUTER[11]
const Double_t MVD_BARREL_PARTIAL_AZIMUTH_GAP_UP_OUTER[11][13]
bool PndTrkCleanup::MvdCleanup_prova ( Double_t  Ox,
Double_t  Oy,
Double_t  R,
Double_t  fi0,
Double_t  kappa,
Double_t  charge,
Double_t  semiverticalgap,
Short_t  nMvdHits,
PndTrkCTGeometryCalculations GeomCalculator 
)

Definition at line 1327 of file PndTrkCleanup.cxx.

References PndTrkCTGeometryCalculations::IsInTargetPipe().

1338 {
1339 
1340  if( !GeomCalculator->IsInTargetPipe(
1341  Ox,
1342  Oy,
1343  R,
1344  fi0,
1345  kappa,
1346  charge,
1347  semiverticalgap
1348  ) && nMvdHits==0 ) return false;
1349  return true;
1350 
1351 }
bool IsInTargetPipe(Double_t Oxx, Double_t Oyy, Double_t Rr, Double_t fi0, Double_t kappa, Short_t charge, Double_t gap)
Double_t R
Definition: checkhelixhit.C:61
void PndTrkCleanup::SeparateInnerOuterParallel ( Short_t  nHits,
Short_t *  ListHits,
Double_t  info[][7],
Double_t  RStrawDetInnerParMax,
Short_t *  nInnerHits,
Short_t *  ListInnerHits,
Short_t *  nOuterHits,
Short_t *  ListOuterHits,
Short_t *  nInnerHitsLeft,
Short_t *  ListInnerHitsLeft,
Short_t *  nInnerHitsRight,
Short_t *  ListInnerHitsRight,
Short_t *  nOuterHitsLeft,
Short_t *  ListOuterHitsLeft,
Short_t *  nOuterHitsRight,
Short_t *  ListOuterHitsRight 
)

Definition at line 1357 of file PndTrkCleanup.cxx.

References Double_t, nHits, r, and sqrt().

1381 {
1382 
1383  Short_t ihit;
1384 
1385  Double_t r;
1386 
1387 // separation of inner Parallel Stt hits from outer Parallel Stt hits.
1388 
1389  *nInnerHits=0;
1390  *nInnerHitsLeft=0;
1391  *nInnerHitsRight=0;
1392  *nOuterHits=0;
1393  *nOuterHitsLeft=0;
1394  *nOuterHitsRight=0;
1395  for(ihit=0 ;ihit<nHits;ihit++){
1396  r = sqrt( info[ListHits[ihit]][0]*info[ListHits[ihit]][0] +
1397  info[ListHits[ihit]][1]*info[ListHits[ihit]][1]);
1398  // the value 2.*RStrawDetectorParMax/sqrt(3.) is because RStrawDetectorParMax
1399  // is an Apotema !
1400  if(r>R_STT_INNER_PAR_MAX ){ // outer Parallel hit.
1401  ListOuterHits[ *nOuterHits ] = ListHits[ihit];
1402  (*nOuterHits)++;
1403  if(info[ListHits[ihit]][0]<0.){
1404  ListOuterHitsLeft[ *nOuterHitsLeft ] = ListHits[ihit];
1405  (*nOuterHitsLeft)++;
1406  } else {
1407  ListOuterHitsRight[ *nOuterHitsRight ] = ListHits[ihit];
1408  (*nOuterHitsRight)++;
1409  }
1410  }else{
1411  ListInnerHits[ *nInnerHits ] = ListHits[ihit];
1412  (*nInnerHits)++;
1413  if(info[ListHits[ihit]][0]<0.){
1414  ListInnerHitsLeft[ *nInnerHitsLeft ] = ListHits[ihit];
1415  (*nInnerHitsLeft)++;
1416  } else {
1417  ListInnerHitsRight[ *nInnerHitsRight ] = ListHits[ihit];
1418  (*nInnerHitsRight)++;
1419  }
1420  }
1421  }
1422 
1423 }
double r
Definition: RiemannTest.C:14
friend F32vec4 sqrt(const F32vec4 &a)
Definition: P4_F32vec4.h:29
int nHits
Definition: RiemannTest.C:16
Double_t
void PndTrkCleanup::SeparateInnerOuterRightLeftAxialStt ( Double_t  info[][7],
Short_t *  ListHits,
Short_t  nHits,
Double_t  RStrawDetInnerParMax,
Short_t *  ListInnerHitsLeft,
Short_t *  ListInnerHitsRight,
Short_t *  ListOuterHitsLeft,
Short_t *  ListOuterHitsRight,
Short_t *  nInnerHitsLeft,
Short_t *  nInnerHitsRight,
Short_t *  nOuterHitsLeft,
Short_t *  nOuterHitsRight 
)

Definition at line 1433 of file PndTrkCleanup.cxx.

References Double_t, nHits, r, and sqrt().

1452 {
1453 
1454  Short_t ihit;
1455 
1456  Double_t r;
1457 
1458 // separation of inner Parallel Stt hits from outer Parallel Stt hits.
1459 
1460  *nInnerHitsLeft=0;
1461  *nInnerHitsRight=0;
1462  *nOuterHitsLeft=0;
1463  *nOuterHitsRight=0;
1464  for(ihit=0 ;ihit<nHits;ihit++){
1465  r = sqrt( info[ListHits[ihit]][0]*info[ListHits[ihit]][0] +
1466  info[ListHits[ihit]][1]*info[ListHits[ihit]][1]);
1467  // the value 2.*RStrawDetectorParMax/sqrt(3.) is because RStrawDetectorParMax
1468  // is an Apotema !
1469  if(r>R_STT_INNER_PAR_MAX ){ // outer Parallel hit.
1470  if(info[ListHits[ihit]][0]<0.){
1471  ListOuterHitsLeft[ *nOuterHitsLeft ] = ListHits[ihit];
1472  (*nOuterHitsLeft)++;
1473  } else {
1474  ListOuterHitsRight[ *nOuterHitsRight ] = ListHits[ihit];
1475  (*nOuterHitsRight)++;
1476  }
1477  }else{
1478  if(info[ListHits[ihit]][0]<0.){
1479  ListInnerHitsLeft[ *nInnerHitsLeft ] = ListHits[ihit];
1480  (*nInnerHitsLeft)++;
1481  } else {
1482  ListInnerHitsRight[ *nInnerHitsRight ] = ListHits[ihit];
1483  (*nInnerHitsRight)++;
1484  }
1485  } // end of if(r>R_STT_INNER_PAR_MAX )
1486  } // end of for(ihit=0 ;ihit<nHits;ihit++)
1487 
1488 
1489  return;
1490 }
double r
Definition: RiemannTest.C:14
friend F32vec4 sqrt(const F32vec4 &a)
Definition: P4_F32vec4.h:29
int nHits
Definition: RiemannTest.C:16
Double_t
bool PndTrkCleanup::SttParalCleanup ( Double_t  ApotemaInnerParMax,
Double_t  ApotemaMinOuterPar,
Short_t  Charge,
Double_t  FI0,
Double_t  FiLimitAdmissible,
Double_t  GAP,
Double_t  info[][7],
int  istampa,
int  IVOLTE,
Short_t *  Listofhits,
Short_t  nHits,
Double_t  Oxx,
Double_t  Oyy,
Double_t  Rr,
Double_t  RStrawDetMax,
Double_t  RStrawDetMin,
Double_t  Start[3],
Double_t  Strawradius 
)

Definition at line 1498 of file PndTrkCleanup.cxx.

References atan2(), PndTrkCTGeometryCalculations::ChooseEntranceExitbis(), cos(), Double_t, fabs(), fi, PndTrkCTGeometryCalculations::FindIntersectionsOuterCircle(), PndTrkCTGeometryCalculations::FindTrackEntranceExitbiHexagonLeft(), PndTrkCTGeometryCalculations::FindTrackEntranceExitbiHexagonRight(), PndTrkCTGeometryCalculations::FindTrackEntranceExitHexagonCircleLeft(), PndTrkCTGeometryCalculations::FindTrackEntranceExitHexagonCircleRight(), i, nHits, PI, sin(), and sqrt().

1519 {
1520 
1521 
1522 // this method does 3 things :
1523 //
1524 // 1) finds the entrance and exit points in the STT parallel volumes of the current track;
1525 // 2) eliminates from the track hit list possible spurious hits that are not encompassed
1526 // by the entrance and exit point;
1527 // 3) eliminates the tracks if the hit sequence is not continuous enough.
1528 
1529 
1530  bool flaggo= true ; // when flaggo is true it means that the track CROSSED the
1531  // STT axial layer(s); flaggo can be falsified later in this method;
1532 
1533  Short_t flagInnerSttL,
1534  flagInnerSttR,
1535  flagOuterSttL,
1536  flagOuterSttR,
1537  flagOutStt,
1538  i,
1539  ipurged,
1540  islack,
1541  nintersections,
1542  nConsideredHits,
1543  nInnerHits,
1544  nInnerHitsLeft,
1545  nInnerHitsRight,
1546  nOuterHits,
1547  nOuterHitsLeft,
1548  nOuterHitsRight,
1549  ListHits[nHits],
1550  ListInnerHits[nHits],
1551  ListInnerHitsLeft[nHits],
1552  ListInnerHitsRight[nHits],
1553  ListOuterHits[nHits],
1554  ListOuterHitsLeft[nHits],
1555  ListOuterHitsRight[nHits];
1556 
1557  Double_t epsilonTheta,
1558  fi,
1559  LimitCoord[2],
1560  Xcross[2],
1561  Ycross[2],
1562  XcrossL[2],
1563  YcrossL[2],
1564  XcrossR[2],
1565  YcrossR[2],
1566  XcrossOut[2],
1567  YcrossOut[2],
1568  XintersectionList[7], // there is also the last boundary FiLimitAdmissible
1569  YintersectionList[7]; // take into account and the two possible
1570  // intersections with the external circle.
1571 
1572 
1573  islack=1; // uncertainty allowed in the # of straws that should be hit in a given part
1574  // of the Stt detector.
1575 
1576 // calculation of the Limit X Y coordinates, corresponding to the Limiting angle FiLimitAdmissible,
1577 // used later in some circumstances;
1578 
1579  LimitCoord[0] = Oxx+Rr*cos(FiLimitAdmissible);
1580  LimitCoord[1] = Oyy+Rr*sin(FiLimitAdmissible);
1581 
1582 
1583 
1584 //-------------------------------------------------------------------------------------------
1585 // elimination of hits outside the physical FI range (FiLimitAdmissible). The physical
1586 // FI range depends on Pz and Pt of the track : given the Pz of the track, the azimuthal angle
1587 // covered by te Helix of the trajectory may very well be less than 2 pi radians.
1588 
1589  epsilonTheta = strawradius/Rr; // some extra slac for being conservative.
1590 
1591  for(i=0, ipurged=0; i< nHits; i++){
1592 
1593  fi = atan2( info[Listofhits[i]][1]-Oyy,info[Listofhits[i]][0]-Oxx);
1594  if (fi<0.) fi+=2.*PI;
1595 
1596  if(Charge <0) {
1597  if( fi > FI0){
1598  if( fi>FiLimitAdmissible+epsilonTheta) continue;
1599  } else {
1600  fi += 2.*PI;
1601  if( fi >FiLimitAdmissible+epsilonTheta ) continue;
1602  } // end of if( fi > FI0)
1603  } else { // continuation of if(Charge <0)
1604  if( fi > FI0){
1605  fi -= 2.*PI;
1606  } // end of if( fi > FI0)
1607  if (fi < FiLimitAdmissible-epsilonTheta) continue;
1608  } // end of if(Charge <0)
1609 
1610  ListHits[ipurged]=Listofhits[i];
1611  ipurged++;
1612  } // end of for(i=0, ipurged=0; i< nHits; i++)
1613 
1614  // nHits is the final outcome of the elimination; it is the # of remaining hits;
1615  nHits = ipurged;
1616 
1617 
1618 
1619  if(nHits==0){
1620  // if the remaining hits is 0, don't discard track yet : maybe that
1621  // its particular trajectory is such that it doesn't cross any axial
1622  // straws (this doesn't prevent the Pattern Recognition - which requires
1623  // at least
1624  nInnerHits=0;
1625  nInnerHitsRight=0;
1626  nInnerHitsLeft=0;
1627  nOuterHits=0;
1628  nOuterHitsRight=0;
1629  nOuterHitsLeft=0;
1630  // don't discard track yet, see if it should have parallel hits.
1631 
1632 
1633 
1634  } else {
1635 
1636 //------------------
1637 // separation of inner Parallel Stt hits from outer Parallel Stt hits.
1638 
1640 
1641  // input
1642  nHits,
1643  ListHits,
1644  info,
1645  2.*ApotemaInnerParMax/sqrt(3.),
1646 
1647  // output
1648  &nInnerHits,
1649  ListInnerHits,
1650  &nOuterHits,
1651  ListOuterHits,
1652 
1653  &nInnerHitsLeft,
1654  ListInnerHitsLeft,
1655  &nInnerHitsRight,
1656  ListInnerHitsRight,
1657 
1658  &nOuterHitsLeft,
1659  ListOuterHitsLeft,
1660  &nOuterHitsRight,
1661  ListOuterHitsRight
1662  );
1663 
1664 
1665  } // end of if(nHits==0)
1666 
1667 
1668 
1669 //--------------------------------------------------------------------------
1670  // class with all the geometry calculations:
1671  PndTrkCTGeometryCalculations GeometryCalculator;
1672 
1673 //-------------------------- intersection points with outer circle encompassing
1674 // the Stt system.
1675 
1676  // flag meaning :
1677  // -1 --> track does NOT intersect the Outer Circle (which has radius RStrawDetMax);
1678  // 0 --> 2 intersections;
1679 
1680  flagOutStt = GeometryCalculator.FindIntersectionsOuterCircle(
1681  Oxx,
1682  Oyy,
1683  Rr,
1684  RStrawDetMax,
1685  XcrossOut,
1686  YcrossOut
1687  );
1688 
1689 
1690 //-----------------------------------------intersection with Inner Section.
1691  // flag meaning :
1692  // -1 --> track outside outer perimeter OR less than 2 intersections;
1693  // 0 --> at least 2 intersection with polygon, therefore a possible entry and an exit;
1694  // 1 --> track contained completely between the two polygons : it should be
1695  // impossible for a track coming really from (0,0,0);
1696 
1697  flagInnerSttL= GeometryCalculator.FindTrackEntranceExitbiHexagonLeft(
1698  GAP,
1699  Oxx,
1700  Oyy,
1701  Rr,
1702  Charge,
1703  Start,
1704  RStrawDetMin,
1705  ApotemaInnerParMax,
1706  XcrossL,
1707  YcrossL
1708  );
1709  // find the entrance and exit of the track in the Inner Right Parallel Straw region.
1710  // This region is bounded by two Hexagons, and it has the target gap in the middle.
1711 
1712  flagInnerSttR= GeometryCalculator.FindTrackEntranceExitbiHexagonRight(
1713  GAP,
1714  Oxx,
1715  Oyy,
1716  Rr,
1717  Charge,
1718  Start,
1719  RStrawDetMin,
1720  ApotemaInnerParMax,
1721  XcrossR,
1722  YcrossR
1723  );
1724 
1725 
1726 
1727 //-----------------
1728 
1729 // working in the hypothesis that his is a track coming from Vertex at (0,0).
1730 
1731  // case when track is completely contained either in Left of Right Inner Stt Parallel
1732  // sections; that should not be possible if the track comes from (0,0,0) !
1733  if( flagInnerSttL == 1 || flagInnerSttR == 1 ){
1734 
1735 
1736  return false;
1737  }
1738 
1739  // if a track enters only marginally in the volumes, define the track
1740  // as non-entering and the corresponding flag to -1.
1741 
1742  if( flagInnerSttR == 0 && (XcrossR[0]-XcrossR[1])*(XcrossR[0]-XcrossR[1])+
1743  (YcrossR[0]-YcrossR[1])*(YcrossR[0]-YcrossR[1])
1744  < 9.*strawradius*strawradius ) flagInnerSttR=-1;
1745 
1746  if( flagInnerSttL == 0 && (XcrossL[0]-XcrossL[1])*(XcrossL[0]-XcrossL[1])+
1747  (YcrossL[0]-YcrossL[1])*(YcrossL[0]-YcrossL[1])
1748  < 9.*strawradius*strawradius ) flagInnerSttR=-1;
1749 
1750 
1751 
1752 
1753  // case when track is outside both Inner Stt Parallel sections.
1754 
1755  if( flagInnerSttL == -1 && flagInnerSttR == -1 ){
1756 
1757  } else {
1758  // here at least one of flagInnerSttL or flagInnerSttR is 0;
1759  // namely the track has at least 2 intersections with an Inner
1760  // section, Left or Right, or both;
1761  if( flagInnerSttL == 0 && flagInnerSttR == 0 ) {
1762  // case when the track crosses both InnerLeft and InnerRight.
1763  // Decide what was crossed first and ignore the other part.
1764  // This may be changed in the future.
1765  XintersectionList[0]=XcrossL[0];
1766  YintersectionList[0]=YcrossL[0];
1767  XintersectionList[1]=XcrossL[1];
1768  YintersectionList[1]=YcrossL[1];
1769  XintersectionList[2]=XcrossR[0];
1770  YintersectionList[2]=YcrossR[0];
1771  XintersectionList[3]=XcrossR[1];
1772  YintersectionList[3]=YcrossR[1];
1773  nintersections=4;
1774  GeometryCalculator.ChooseEntranceExitbis(
1775  Oxx,
1776  Oyy,
1777  Charge,
1778  FI0,
1779  nintersections,// n. intersection in input.
1780  XintersectionList,
1781  YintersectionList,
1782  Xcross, // output
1783  Ycross // output
1784  );
1785  // now decide which sector was crossed first.
1786  if( (fabs(XcrossL[0]-Xcross[0])<1.e-5&&fabs(YcrossL[0]-Ycross[0])<1.e-5)
1787  ||
1788  (fabs(XcrossL[1]-Xcross[0])<1.e-5&&fabs(YcrossL[1]-Ycross[0])<1.e-5)
1789  )
1790  { // the Left part was entered first.
1791  flagInnerSttR=-1;
1792  } else { // the Right part was entered first.
1793  flagInnerSttL=-1;
1794  } // end of if( (fabs(XcrossL[0]-Xcross.....
1795  } // end of if( (flagInnerSttL == 0 && flagInnerSttR = 0 )
1796 
1797 //--------- the other 2 possible cases.
1798 
1799  if( flagInnerSttL == 0){
1800  nConsideredHits=nInnerHitsLeft;
1801  for(i=0;i<2;i++)
1802  {
1803  XintersectionList[i]=XcrossL[i];
1804  YintersectionList[i]=YcrossL[i];
1805  }
1806  } else { // continuation of if( (flagInnerSttL == 0), case in which
1807  nConsideredHits=nInnerHitsRight;
1808 
1809  for(i=0;i<2;i++)
1810  {
1811  XintersectionList[i]=XcrossR[i];
1812  YintersectionList[i]=YcrossR[i];
1813  }
1814  } // end of if( (flagInnerSttL == 0)
1815 
1816 
1817  nintersections=2;
1818  if(fabs(FiLimitAdmissible-FI0) < 2.*PI)
1819  { // in this case the point
1820  // corresponding to FiLimitAdmissible can play a role in the
1821  // determination of the limiting points of the hits.
1822  XintersectionList[2]=LimitCoord[0];
1823  YintersectionList[2]=LimitCoord[1];
1824  nintersections++;
1825  } // end of if(fabs(FiLimitAdmissible-FI0) < 2.*PI)
1826 
1827  if( flagOutStt ==0)
1828  {// 2 intersections with outer Stt circle.
1829  XintersectionList[nintersections]=XcrossOut[0];
1830  XintersectionList[nintersections+1]=XcrossOut[1];
1831  YintersectionList[nintersections]=YcrossOut[0];
1832  YintersectionList[nintersections+1]=YcrossOut[1];
1833  nintersections +=2;
1834  }
1835 
1836 
1837 // the method ChooseEntranceExitbis works under the hypothesis that there are
1838 // at least 2 intersections.
1839 // It orders the nintersections intersections using as order parameter the azimuthal
1840 // angle fi (in the reference frame of the trajectory helix); then it returns the FIRST
1841 // TWO INTERSECTIONS assuming that the track was originated from (0,0,0) and taking into
1842 // account its charge;
1843  GeometryCalculator.ChooseEntranceExitbis(
1844  Oxx,
1845  Oyy,
1846  Charge,
1847  FI0,
1848  nintersections,// n. intersection in input.
1849  XintersectionList,
1850  YintersectionList,
1851  Xcross, // output
1852  Ycross // output
1853  );
1854 
1855 
1856  if(fabs(FiLimitAdmissible-FI0) < 2.*PI)
1857  {
1858  // case when this track exits in Z before having the possibility
1859  // of hitting the Stt parallel inner section.
1860  if( fabs(LimitCoord[0]-Xcross[0])<1.e-5&& fabs(LimitCoord[1]-Ycross[0])<1.e-5 )
1861  {
1862  return true;
1863  }
1864 
1865 
1866  // case when this track exits in Z AFTER having the possibility
1867  // of hitting the Stt parallel inner section.
1868 
1869  if( flagOutStt ==0 // 2 intersections with outer Stt circle;
1870  // those intersections were calculated in this method before,
1871  // they are called XcrossOut and YcrossOut ;
1872  // case when this track exits the Stt outer circle without
1873  // hitting the Stt parallel inner section;
1874  // this is achieved by comparing the coordinates Xcross[0]
1875  // and Ycross[0] (i.e. the FIRST crossing point of this track)
1876  // to the crossing point with the outer Stt circle (i.e.
1877  // XcrossOut and YcrossOut );
1878 
1879  && ((fabs(XcrossOut[0]-Xcross[0])<1.e-5
1880  &&fabs(YcrossOut[0]-Ycross[0])<1.e-5 )
1881  ||
1882  (fabs(XcrossOut[1]-Xcross[0])<1.e-5
1883  &&fabs(YcrossOut[1]-Ycross[0])<1.e-5 )
1884  )
1885  )
1886  {
1887  flaggo=false ; // this track DOES NOT intersect any STT axial layer;
1888  } else
1889  { // continuation of if( flagOutStt ==0)
1890 
1891  // most usual case when track crossed the Inner parallel Stt;
1892  if (nConsideredHits == 0)
1893  {
1894  return false;
1895  }
1896 
1897  // if the exit point is actually given by FiLimitAdmissible, then allow
1898  // an extra uncertainty in the # Stt hit that must be present;
1899  // this is done because FiLimitAdmissible is not a very precise number.
1900  if( fabs(LimitCoord[0]-Xcross[1])<1.e-5&& fabs(LimitCoord[1]-Ycross[1])<1.e-5 )
1901  {
1902  islack = 3;
1903  }
1904  } // end of if( flagOutStt ==0)
1905 
1906  } else { // continuation of if(fabs(FiLimitAdmissible-FI0) < 2.*PI)
1907  if( flagOutStt ==0)
1908  { // 2 intersections with outer Stt circle.
1909  // case when this track exits the Stt outer circle without
1910  // hitting the Stt parallel inner section
1911  if( (fabs(XcrossOut[0]-Xcross[0])<1.e-5
1912  &&fabs(YcrossOut[0]-Ycross[0])<1.e-5 )
1913  ||
1914  (fabs(XcrossOut[1]-Xcross[0])<1.e-5
1915  &&fabs(YcrossOut[1]-Ycross[0])<1.e-5 )
1916  )
1917  {
1918  flaggo=false;//this track DOES NOT intersect any STT axial layer;
1919  }
1920  } else { // continuation of if( flagOutStt ==0)
1921 
1922  // most usual case when track crossed the Inner parallel Stt.
1923  if (nConsideredHits == 0)
1924  {
1925  return false;
1926  }
1927  } // end of if( flagOutStt ==0)
1928  } // end of if(fabs(FiLimitAdmissible-FI0) < 2.*PI)
1929 
1930 
1931 
1932  if(flaggo){
1933 //------------- cleanup of the spurious tracks first using the inner parallel straws.
1934 
1935 if(istampa>=1) {
1936  cout<<"SttParalCleanup, evento n. "<<IVOLTE<<", prima di BadTrack_ParStt; Xin Inner "<<
1937  Xcross[0]<<", Yin Inner "<<Ycross[0]<<
1938  ", Xout Inner "<<Xcross[1]<<", Yout Inner "<<Ycross[1]<<endl; }
1939 
1940  // at this point the n. of inner hits cannot be 0 for a true track.
1941  if ( BadTrack_ParStt(
1942  Oxx,
1943  Oyy,
1944  Rr,
1945  strawradius,
1946  Charge,
1947  Xcross, // Xcross[0]=point of entrance; Xcross[1]=point of exit.
1948  Ycross,
1949  nInnerHits,
1950  ListInnerHits,
1951  info,
1952  istampa,
1953  2.*2*strawradius, // cut of proximity between hits.
1954  1, // maximum allowed # consecutive hits with distance > cut.
1955  islack // uncertainty allowed as far as the n. of hits that should be present.
1956  )
1957  ){
1958 
1959  return false;
1960  }
1961 
1962 
1963  } // end of if(flaggo)
1964  } // end of if( flagInnerSttL == -1 && flagInnerSttR == -1 )
1965 
1966  islack=1; // reset the extra uncertainty in the # Stt.
1967 
1968 
1969 
1970 //------------------------------------------------------------------------------------------------
1971 
1972 //------------ Outer Parallel Stt hits section.
1973  // find the entrance and exit of the track in the Outer Parallel Straw region, Left side.
1974  // This region is bounded by a Hexagon (inner), a Circle (outer) and it has
1975  // the target gap in the middle.
1976 
1977  // It returns -1 if there are 0 or 1 intersections, or it returns 0
1978  // if they are at least 2.
1979  flagOuterSttL= GeometryCalculator.FindTrackEntranceExitHexagonCircleLeft(
1980  Oxx,
1981  Oyy,
1982  Rr,
1983  Charge,
1984  Start,
1985  ApotemaMinOuterPar,
1986  RStrawDetMax,
1987  GAP,
1988  XcrossL,
1989  YcrossL
1990  );
1991 //------------
1992  // find the entrance and exit of the track in the Outer Parallel Straw region, Right side.
1993  // This region is bounded by a Hexagon (inner), a Circle (outer) and it has
1994  // the target gap in the middle.
1995  flagOuterSttR= GeometryCalculator.FindTrackEntranceExitHexagonCircleRight(
1996  Oxx,
1997  Oyy,
1998  Rr,
1999  Charge,
2000  Start,
2001  ApotemaMinOuterPar,
2002  RStrawDetMax,
2003  GAP,
2004  XcrossR,
2005  YcrossR
2006  );
2007 
2008 
2009 if(istampa>0) {
2010  cout<<"SttParalCleanup, evento n. "<<IVOLTE<<
2011  ", flagOuterSttR (-1,or 0 --> 2 or more inter.) = "<<flagOuterSttR
2012  <<", flagOuterSttL "<<flagOuterSttL<<endl; }
2013 
2014 
2015 //--------------------------------
2016 
2017  // if a track enters only marginally in the volumes, define the track
2018  // as non-entering and the corresponding flag to -1.
2019 
2020  if( flagOuterSttR == 0 && (XcrossR[0]-XcrossR[1])*(XcrossR[0]-XcrossR[1])+
2021  (YcrossR[0]-YcrossR[1])*(YcrossR[0]-YcrossR[1])
2022  < 9.*strawradius*strawradius ) flagOuterSttR=-1;
2023 
2024  if( flagOuterSttL == 0 && (XcrossL[0]-XcrossL[1])*(XcrossL[0]-XcrossL[1])+
2025  (YcrossL[0]-YcrossL[1])*(YcrossL[0]-YcrossL[1])
2026  < 9.*strawradius*strawradius ) flagOuterSttR=-1;
2027 
2028 
2029  // case when track is outside both Outer Stt Parallel sections; in such case
2030  // the tracks doesn't have to have Stt Parallel hits in a continuos fashion
2031  // in the Outer Sections;
2032  if( flagOuterSttL == -1 && flagOuterSttR == -1 ){
2033  return true ;
2034  }
2035 
2036 
2037  // case when the track crosses both OuterLeft and OuterRight.
2038  // Decide what was crossed first and ignore the other part.
2039  // This may be changed in the future.
2040  if( flagOuterSttL == 0 && flagOuterSttR == 0 ) {
2041 
2042 
2043  XintersectionList[0]=XcrossL[0];
2044  YintersectionList[0]=YcrossL[0];
2045  XintersectionList[1]=XcrossL[1];
2046  YintersectionList[1]=YcrossL[1];
2047  XintersectionList[2]=XcrossR[0];
2048  YintersectionList[2]=YcrossR[0];
2049  XintersectionList[3]=XcrossR[1];
2050  YintersectionList[3]=YcrossR[1];
2051  nintersections=4;
2052  GeometryCalculator.ChooseEntranceExitbis(
2053  Oxx,
2054  Oyy,
2055  Charge,
2056  FI0,
2057  nintersections,// n. intersection in input.
2058  XintersectionList,
2059  YintersectionList,
2060  Xcross, // output
2061  Ycross // output
2062  );
2063  // now decide which sector was crossed first.
2064  if( (fabs(XcrossL[0]-Xcross[0])<1.e-5&&fabs(YcrossL[0]-Ycross[0])<1.e-5)
2065  ||
2066  (fabs(XcrossL[1]-Xcross[0])<1.e-5&&fabs(YcrossL[1]-Ycross[0])<1.e-5)
2067  ) { // the Left part was entered first.
2068  flagOuterSttR=-1;
2069  } else { // the Right part was entered first.
2070  flagOuterSttL=-1;
2071  } // end of if( (fabs(XcrossL[0]-Xcross.....
2072  } // end of if( (flagInnerSttL == 0 && flagInnerSttR = 0 )
2073 
2074 
2075  if( flagOuterSttL == 0){
2076  nConsideredHits=nOuterHitsLeft;
2077 
2078 
2079  for(i=0;i<2;i++){
2080  XintersectionList[i]=XcrossL[i];
2081  YintersectionList[i]=YcrossL[i];
2082  }
2083  } else { // continuation of if( (flagOuterSttL == 0), case in which
2084  // flagOuterSttR == 0.
2085  nConsideredHits=nOuterHitsRight;
2086  for(i=0;i<2;i++){
2087  XintersectionList[i]=XcrossR[i];
2088  YintersectionList[i]=YcrossR[i];
2089  }
2090  } // end of if( (flagOuterSttL == 0)
2091 
2092 
2093 
2094 
2095  nintersections=2;
2096  if(fabs(FiLimitAdmissible-FI0) < 2.*PI){ // in this case the point
2097  // corresponding to FiLimitAdmissible can play a role in the
2098  // determination of the limiting points of the hits.
2099  XintersectionList[2]=LimitCoord[0];
2100  YintersectionList[2]=LimitCoord[1];
2101  nintersections++;
2102 //-------------stampe.
2103 if(istampa>1) {
2104 cout<<"in SttParalCleanup Outer, caso in cui FiLimitAdmissible = "<< FiLimitAdmissible
2105 <<" conta!" <<endl;
2106 }
2107 //-------------fine stampe.
2108  } // end of if(fabs(FiLimitAdmissible-FI0) < 2.*PI)
2109 
2110  if( flagOutStt ==0){// 2 intersections with outer Stt circle.
2111  XintersectionList[nintersections]=XcrossOut[0];
2112  XintersectionList[nintersections+1]=XcrossOut[1];
2113  YintersectionList[nintersections]=YcrossOut[0];
2114  YintersectionList[nintersections+1]=YcrossOut[1];
2115  nintersections +=2;
2116  }
2117 //-------------stampe.
2118 if(istampa>1) {
2119 cout<<"in SttParalCleanup Outer, prima di ChooseEntranceExitbis, nintersections "
2120 << nintersections<<" e loro lista :"<<endl;
2121  for(int ic=0;ic<nintersections;ic++){
2122  cout<<"\tX["<<ic<<"] = "<<XintersectionList[ic]
2123  <<", Y["<<ic<<"] = "<<YintersectionList[ic]<<endl;
2124  }
2125 }
2126 
2127 
2128 //-------------fine stampe.
2129 
2130 
2131 
2132  GeometryCalculator.ChooseEntranceExitbis(
2133  Oxx,
2134  Oyy,
2135  Charge,
2136  FI0,
2137  nintersections,// n. intersection in input.
2138  XintersectionList,
2139  YintersectionList,
2140  Xcross, // output
2141  Ycross // output
2142  );
2143 //-------------stampe.
2144 if(istampa>=1) {
2145 cout<<"in SttParalCleanup Outer, dopo di ChooseEntranceExitbis, Xin"
2146 << Xcross[0]<<", Yin "<< Ycross[0]<<", Xout " << Xcross[1]<<", Yout "<< Ycross[1]
2147 <<endl;
2148 }
2149 //-------------fine stampe.
2150 
2151 
2152  if(fabs(FiLimitAdmissible-FI0) < 2.*PI){
2153  // case when this track exit in Z before having the possibility
2154  // of hitting the Stt parallel inner section.
2155 
2156  if( fabs(LimitCoord[0]-Xcross[0])<1.e-5&& fabs(LimitCoord[1]-Ycross[0])<1.e-5 ){
2157  return true;
2158  }
2159 
2160  if( flagOutStt ==0){// 2 intersections with outer Stt circle.
2161  // case when this track exits the Stt outer circle without
2162  // hitting the Stt parallel Outer section (for instance the track
2163  if( (fabs(XcrossOut[0]-Xcross[0])<1.e-5
2164  &&fabs(YcrossOut[0]-Ycross[0])<1.e-5 )
2165  ||
2166  (fabs(XcrossOut[1]-Xcross[0])<1.e-5
2167  &&fabs(YcrossOut[1]-Ycross[0])<1.e-5 )
2168  ){
2169  //nOuterHits=0; // eliminate all the hits from hit list.
2170  //nOuterHitsRight=0;
2171  //nOuterHitsLeft=0;
2172  return true ;
2173  }
2174  } // end of if( flagOutStt ==0)
2175 
2176 
2177  // most usual case when track crossed the Outer parallel Stt.
2178  if (nConsideredHits == 0){
2179  return false;
2180  }
2181 
2182  // if the exit point is actually given by FiLimitAdmissible, then allow
2183  // an extra uncertainty in the # Stt hit that must be present;
2184  // this is done because FiLimitAdmissible is not a very precise number.
2185  if( fabs(LimitCoord[0]-Xcross[1])<1.e-5&& fabs(LimitCoord[1]-Ycross[1])<1.e-5 ){
2186  islack = 3;
2187  }
2188 
2189  } else { // continuation of if(fabs(FiLimitAdmissible-FI0) < 2.*PI)
2190 
2191  if( flagOutStt ==0){// 2 intersections with outer Stt circle.
2192  // case when this track exits the Stt outer circle without
2193  // hitting the Stt parallel Outer section (for instance the track
2194  if( (fabs(XcrossOut[0]-Xcross[0])<1.e-5
2195  &&fabs(YcrossOut[0]-Ycross[0])<1.e-5 )
2196  ||
2197  (fabs(XcrossOut[1]-Xcross[0])<1.e-5
2198  &&fabs(YcrossOut[1]-Ycross[0])<1.e-5 )
2199  ){
2200  //nOuterHits=0; // eliminate all the hits from hit list.
2201  //nOuterHitsRight=0;
2202  //nOuterHitsLeft=0;
2203  return true ;
2204  }
2205  } // end of if( flagOutStt ==0)
2206 
2207 
2208  // most usual case when track crossed the Outer parallel Stt.
2209  if (nConsideredHits == 0){
2210  return false;
2211  }
2212 
2213  } // end of if(fabs(FiLimitAdmissible-FI0) < 2.*PI)
2214 
2215 
2216 
2217 
2218 //-------------------- stampe
2219 if(istampa>=2){
2220 cout<<"SttParalCleanup, OUTER, caso R || L true, IVOLTE = "<<IVOLTE<<"\n\t Xcross[0] "
2221 << Xcross[0]<<", Ycross[0] " <<Ycross[0]<<"\n\t Xcross[1] "
2222 << Xcross[1]<<", Ycross[1] " <<Ycross[1]<<" e charge = "<<Charge<<", FiLimitAdmissible "
2223 <<FiLimitAdmissible<<" (X="<<Oxx+Rr*cos(FiLimitAdmissible)
2224  <<", Y="<< Oyy+Rr*sin(FiLimitAdmissible)<<")." <<endl;
2225 }
2226 //-------------------fine stampe
2227 
2228 
2229 
2230 // cleanup of the spurious tracks now using the outer parallel straws.
2231 
2232 
2233  // at this point nOuterHits cannot be 0 for a real track.
2234  if ( BadTrack_ParStt(
2235  Oxx,
2236  Oyy,
2237  Rr,
2238  strawradius,
2239  Charge,
2240  Xcross, // Xcross[0]=point of entrance; Xcross[1]=point of exit.
2241  Ycross,
2242  nOuterHits,
2243  ListOuterHits,
2244  info,
2245  istampa,
2246  2.*2.*strawradius, // cut of proximity between hits.
2247  1, // maximum allowed # consecutive hits with distance > cut.
2248  islack // uncertainty allowed as far as the n. of hits that should be present.
2249  )
2250  ){
2251  return false;
2252  }
2253 
2254 // } // end of if(nOuterHits==0)
2255 
2256 //----------------------------------------------------------------------------
2257 
2258 
2259  // if the code comes here it means that the track is acceptable.
2260 
2261 // nHits = nOuterHits+nInnerHits;
2262 
2263  return true;
2264 
2265 };
friend F32vec4 cos(const F32vec4 &a)
Definition: P4_F32vec4.h:112
Int_t i
Definition: run_full.C:25
friend F32vec4 sqrt(const F32vec4 &a)
Definition: P4_F32vec4.h:29
friend F32vec4 sin(const F32vec4 &a)
Definition: P4_F32vec4.h:111
Short_t FindTrackEntranceExitHexagonCircleLeft(Double_t Oxx, Double_t Oyy, Double_t Rr, Short_t Charge, Double_t Start[3], Double_t ApotemaMin, Double_t ApotemaMax, Double_t GAP, Double_t Xcross[2], Double_t Ycross[2])
timer Start()
void SeparateInnerOuterParallel(Short_t nHits, Short_t *ListHits, Double_t info[][7], Double_t RStrawDetInnerParMax, Short_t *nInnerHits, Short_t *ListInnerHits, Short_t *nOuterHits, Short_t *ListOuterHits, Short_t *nInnerHitsLeft, Short_t *ListInnerHitsLeft, Short_t *nInnerHitsRight, Short_t *ListInnerHitsRight, Short_t *nOuterHitsLeft, Short_t *ListOuterHitsLeft, Short_t *nOuterHitsRight, Short_t *ListOuterHitsRight)
void ChooseEntranceExitbis(Double_t Oxx, Double_t Oyy, Short_t Charge, Double_t FiStart, Short_t nIntersections, Double_t *XintersectionList, Double_t *YintersectionList, Double_t Xcross[2], Double_t Ycross[2])
const Double_t PI
int nHits
Definition: RiemannTest.C:16
TFile * fi
Double_t
friend F32vec4 fabs(const F32vec4 &a)
Definition: P4_F32vec4.h:47
friend F32vec4 atan2(const F32vec4 &y, const F32vec4 &x)
Definition: P4_F32vec4.h:117
Short_t FindTrackEntranceExitHexagonCircleRight(Double_t Oxx, Double_t Oyy, Double_t Rr, Short_t Charge, Double_t Start[3], Double_t ApotemaMin, Double_t ApotemaMax, Double_t GAP, Double_t Xcross[2], Double_t Ycross[2])
bool BadTrack_ParStt(Double_t Oxx, Double_t Oyy, Double_t Rr, Double_t Stawradius, Short_t Charge, Double_t Xcross[2], Double_t Ycross[2], Short_t nHits, Short_t *ListHits, Double_t info[][7], int istampa, Double_t cut, Short_t maxnum, Short_t islack)
Short_t FindIntersectionsOuterCircle(Double_t Oxx, Double_t Oyy, Double_t Rr, Double_t RMax, Double_t Xcross[2], Double_t Ycross[2])
Short_t FindTrackEntranceExitbiHexagonLeft(Double_t vgap, Double_t Oxx, Double_t Oyy, Double_t Rr, Short_t Charge, Double_t Start[3], Double_t ApotemaMin, Double_t ApotemaMax, Double_t Xcross[2], Double_t Ycross[2])
Short_t FindTrackEntranceExitbiHexagonRight(Double_t vgap, Double_t Oxx, Double_t Oyy, Double_t Rr, Short_t Charge, Double_t Start[3], Double_t ApotemaMin, Double_t ApotemaMax, Double_t Xcross[2], Double_t Ycross[2])
bool PndTrkCleanup::SttSkewCleanup ( Double_t  ApotemaMaxSkew,
Double_t  ApotemaMinSkew,
Short_t  Charge,
Double_t  cut,
Double_t  FI0,
Double_t  FiLimitAdmissible,
Double_t  GAP,
Double_t  info[][7],
int  istampa,
int  IVOLTE,
Short_t *  Listofhits,
Short_t  maxnum,
int  MAXSTTHITS,
Short_t  nHits,
Double_t  Oxx,
Double_t  Oyy,
Double_t  Rr,
Double_t  RStrawDetMax,
Double_t S,
Double_t  Start[3],
Double_t  Strawradius 
)

Definition at line 2272 of file PndTrkCleanup.cxx.

References atan2(), PndTrkCTGeometryCalculations::CalculateArcLength(), PndTrkCTGeometryCalculations::ChooseEntranceExitbis(), cos(), cut, Double_t, fabs(), fi, PndTrkCTGeometryCalculations::FindIntersectionsOuterCircle(), PndTrkCTGeometryCalculations::FindTrackEntranceExitbiHexagonLeft(), PndTrkCTGeometryCalculations::FindTrackEntranceExitbiHexagonRight(), i, PndTrkCTGeometryCalculations::IsInsideArc(), nHits, PI, sin(), and sqrt().

2296 {
2297 
2298  //bool ConsiderLastHit; //[R.K. 01/2017] unused variable?
2299 
2300  Short_t flagSttL,
2301  flagSttR,
2302  flagOutStt;
2303 
2304  Short_t i,
2305  ipurged,
2306  ibad,
2307  islack,
2308  nHitsLeft,
2309  nHitsRight,
2310  nintersections,
2311  ninside,
2312  nnn,
2313  //nIntersections[2], //[R.K. 01/2017] unused variable?
2314  ListHits[nHits];
2315  //ListHitsRight[nHits], //[R.K. 01/2017] unused variable?
2316  //ListHitsLeft[nHits]; //[R.K. 01/2017] unused variable?
2317 
2318  Double_t cut2,
2319  epsilonTheta,
2320  fi,
2321  //FiStart, //[R.K. 01/2017] unused variable?
2322  length,
2323  //r, //[R.K. 01/2017] unused variable?
2324  Sprevious,
2325  aux[2],
2326  Distance[MAXSTTHITS+1],
2327  Xcross[2],
2328  Ycross[2],
2329  XcrossL[2],
2330  YcrossL[2],
2331  XcrossR[2],
2332  YcrossR[2],
2333  XcrossOut[2],
2334  YcrossOut[2],
2335  XintersectionList[5], // second index =0 --> inner Hexagon, =1 --> outer.
2336  YintersectionList[5]; // first index : all the possible intersections
2337  // (up to 12 intersections).
2338 
2339  // class with all the geometry calculations :
2340  PndTrkCTGeometryCalculations GeometryCalculator;
2341 
2342 
2343 
2344  cut2=cut*cut;
2345  islack=1;// uncertainty allowed as far as
2346  // the n. of hits that should be present in a given section of the Stt track.
2347 
2348 
2349 //------------------------
2350 // elimination of hits outside the physical FI range (FiLimitAdmissible) due to finite length of
2351 // Straws.
2352 
2353  epsilonTheta = strawradius/Rr; // some extra slac for being conservative.
2354 
2355 if(istampa>1)
2356 cout<<"\n\nevt "<<IVOLTE<<", FI0 "<<FI0<<", Filimit "
2357 << FiLimitAdmissible+epsilonTheta <<", Ox "<<Oxx<<", Oy "<<Oyy<<", R "<<Rr<<endl;
2358 
2359  for(i=0, ipurged=0; i< nHits; i++){
2360  fi = S[i];
2361 
2362 if(istampa>1)cout<<"\thit // n. "<<Listofhits[i]<<", fi "<<fi<<endl;
2363 
2364  if(Charge <0) {
2365  if(fi > FI0){
2366  if( fi>FiLimitAdmissible+epsilonTheta) continue;
2367  } else {
2368  fi += 2.*PI;
2369  if( fi > FiLimitAdmissible+epsilonTheta ) continue;
2370  } // end of if( fi > FI0)
2371  } else { // continuation of if(Charge <0)
2372  if( fi > FI0){
2373  fi -= 2.*PI;
2374  } // end of if( fi > FI0)
2375  if (fi < FiLimitAdmissible-epsilonTheta) continue;
2376  } // end of if(Charge <0)
2377 if(istampa>1)cout<<"in SttSkewCleanup : hit preso!"<<endl;
2378 
2379  ListHits[ipurged]=Listofhits[i];
2380  S[ipurged]=S[i];
2381  ipurged++;
2382  } // end of for(i=0, ipurged=0; i< nHits; i++)
2383 
2384 if(istampa>1)cout<<"in SttSkewCleanup : hit skew prima di purga = "
2385 <<nHits<<", dopo purga "<<ipurged<<endl;
2386 
2387  nHits = ipurged;
2388  if(nHits==0){ // don't discard track yet, see if it should have
2389  // skew hits or not.
2390  nHitsRight=nHitsLeft=0;
2391 // goto jampa;
2392  } else {
2393 
2394 
2395 
2396  // separation of Right and Left Skew hits.
2397 
2398  nHitsRight=nHitsLeft=0;
2399  for(i=0;i< nHits; i++){
2400  if(info[ListHits[i]][0]<0.){
2401  //ListHitsLeft[nHitsLeft]=ListHits[i]; //[R.K. 01/2017] unused variable?
2402  nHitsLeft++;
2403  }else{
2404  //ListHitsRight[nHitsRight]=ListHits[i]; //[R.K. 01/2017] unused variable?
2405  nHitsRight++;
2406  }
2407  }
2408 
2409 if(istampa>1)cout<<"in SttSkewCleanup : n. hit skew Left = "
2410 <<nHitsLeft<<", right "<< nHitsRight <<endl;
2411 
2412  } // end of if(nHits==0)
2413 //jampa: ;
2414 // first of all, find possible intersection points with outer circle encompassing
2415 // the Stt system.
2416 
2417  flagOutStt = GeometryCalculator.FindIntersectionsOuterCircle(
2418  Oxx,
2419  Oyy,
2420  Rr,
2421  RStrawDetMax,
2422  XcrossOut,
2423  YcrossOut
2424  );
2425 
2426 //------------------------------------------
2427  // find the entrance and exit of the track in the Skew Straw region.
2428  // This region is bounded by two Hexagons, and it has the target gap
2429  // in the middle. So Left is the left looking from downstream.
2430 
2431  flagSttL=GeometryCalculator.FindTrackEntranceExitbiHexagonLeft(
2432  GAP,
2433  Oxx,
2434  Oyy,
2435  Rr,
2436  Charge,
2437  Start,
2438  ApotemaMinSkew,
2439  ApotemaMaxSkew, // Apotema is the distance of a Hexagonal side from (0,0)
2440  XcrossL,
2441  YcrossL
2442  );
2443 
2444 
2445  flagSttR= GeometryCalculator.FindTrackEntranceExitbiHexagonRight(
2446  GAP,
2447  Oxx,
2448  Oyy,
2449  Rr,
2450  Charge,
2451  Start,
2452  ApotemaMinSkew,
2453  ApotemaMaxSkew, // Apotema is the distance of a Hexagonal side from (0,0)
2454  XcrossR,
2455  YcrossR
2456  );
2457 
2458  // find the entrance and exit of the track in the Skew Straw region.
2459  // This region is bounded by two Hexagons, and it has the target gap in the middle.
2460 
2461 if(istampa>1)cout<<"in SttSkewCleanup : flagLeft (-1,0,1) = "<<flagSttL
2462 <<", right "<< flagSttR <<endl;
2463  if (flagSttR == 1 || flagSttL == 1 ) { // the trajectory is contained completely
2464  // in the Right or Left Skew section, reject!
2465  return false ;
2466  }
2467 
2468  // if a track enters only marginally in the skew volumes, define the track
2469  // as non-entering and the corresponding flag to -1.
2470 
2471  if( flagSttR == 0 && (XcrossR[0]-XcrossR[1])*(XcrossR[0]-XcrossR[1])+
2472  (YcrossR[0]-YcrossR[1])*(YcrossR[0]-YcrossR[1])
2473  < 16.*strawradius*strawradius ){
2474  flagSttR=-1;
2475 if(istampa>1)cout<<"in SttSkewCleanup : distanza entrata-uscita<4*strawradius,flagSttR set at -1!\n";
2476  }
2477 
2478  if( flagSttL == 0 && (XcrossL[0]-XcrossL[1])*(XcrossL[0]-XcrossL[1])+
2479  (YcrossL[0]-YcrossL[1])*(YcrossL[0]-YcrossL[1])
2480  < 16.*strawradius*strawradius ){
2481  flagSttR=-1;
2482 if(istampa>1)cout<<"in SttSkewCleanup : distanza entrata-uscita<4*strawradius,flagSttL set at -1!\n";
2483  }
2484 
2485  if (flagSttR != 0 && flagSttL != 0 ) {
2486  //nHits=0;
2487  if(istampa>1)cout<<"in SttSkewCleanup : flagSttR = "<<flagSttR
2488  <<", e flagSttL = "<<flagSttL<<", exit con true!\n";
2489  return true; // don't discard track because it may have Mvd hits anyway
2490  // and/or they can have Inner Parallel hits.
2491  }
2492 
2493 
2494  // case when the track crosses both SkewLeft and SkewRight.
2495  // Decide what was crossed first and ignore the other part.
2496  // This may be changed in the future.
2497 
2498 
2499 
2500  if( flagSttL == 0 && flagSttR == 0 ) { // crosses both right and left sections.
2501  XintersectionList[0]=XcrossL[0];
2502  YintersectionList[0]=YcrossL[0];
2503  XintersectionList[1]=XcrossL[1];
2504  YintersectionList[1]=YcrossL[1];
2505  XintersectionList[2]=XcrossR[0];
2506  YintersectionList[2]=YcrossR[0];
2507  XintersectionList[3]=XcrossR[1];
2508  YintersectionList[3]=YcrossR[1];
2509  nintersections=4;
2510  GeometryCalculator.ChooseEntranceExitbis(
2511  Oxx,
2512  Oyy,
2513  Charge,
2514  FI0,
2515  nintersections,// n. intersection in input.
2516  XintersectionList,
2517  YintersectionList,
2518  Xcross, // output
2519  Ycross // output
2520  );
2521  // now decide which sector was crossed first.
2522  if( (fabs(XcrossL[0]-Xcross[0])<1.e-5&&fabs(YcrossL[0]-Ycross[0])<1.e-5)
2523  ||
2524  (fabs(XcrossL[1]-Xcross[0])<1.e-5&&fabs(YcrossL[1]-Ycross[0])<1.e-5)
2525  ) { // the Left part was entered first.
2526  flagSttR=-1;
2527  } else { // the Right part was entered first.
2528  flagSttL=-1;
2529  } // end of if( (fabs(XcrossL[0]-Xcross.....
2530  } // end of if( (flagInnerSttL == 0 && flagInnerSttR = 0 )
2531 
2532 
2533 
2534 //--------- the other 2 possible cases.
2535 
2536 
2537 
2538  if( flagSttL == 0){
2539  nnn=nHitsLeft;
2540  for(i=0;i<2;i++){
2541  XintersectionList[i]=XcrossL[i];
2542  YintersectionList[i]=YcrossL[i];
2543  }
2544  } else { // continuation of if( (flagSttL == 0), case in which
2545  // flagSttR == 0.
2546  nnn=nHitsRight;
2547  for(i=0;i<2;i++){
2548  XintersectionList[i]=XcrossR[i];
2549  YintersectionList[i]=YcrossR[i];
2550  }
2551  } // end of if( (flagInnerSttL == 0)
2552 
2553  nintersections=2;
2554  if(fabs(FiLimitAdmissible-FI0) < 2.*PI){ // in this case the point
2555  // corresponding to FiLimitAdmissible can play a role in the
2556  // determination of the limiting points of the hits.
2557  aux[0]=Oxx+Rr*cos(FiLimitAdmissible);
2558  aux[1]=Oyy+Rr*sin(FiLimitAdmissible);
2559  XintersectionList[2]=aux[0];
2560  YintersectionList[2]=aux[1];
2561  nintersections++;
2562  } // end of if(fabs(FiLimitAdmissible-FI0) < 2.*PI)
2563 
2564 
2565  if( flagOutStt ==0){// 2 intersections with outer Stt circle.
2566  XintersectionList[nintersections]=XcrossOut[0];
2567  XintersectionList[nintersections+1]=XcrossOut[1];
2568  YintersectionList[nintersections]=YcrossOut[0];
2569  YintersectionList[nintersections+1]=YcrossOut[1];
2570  nintersections +=2;
2571  }
2572 
2573  GeometryCalculator.ChooseEntranceExitbis(
2574  Oxx,
2575  Oyy,
2576  Charge,
2577  FI0,
2578  nintersections,// n. intersection in input.
2579  XintersectionList,
2580  YintersectionList,
2581  Xcross, // output
2582  Ycross // output
2583  );
2584 
2585  if(fabs(FiLimitAdmissible-FI0) < 2.*PI){
2586  // case when this track exit in Z before having the possibility
2587  // of hitting the Stt parallel inner section.
2588  if( fabs(aux[0]-Xcross[0])<1.e-5&& fabs(aux[1]-Ycross[0])<1.e-5 ){
2589  return true;
2590  }
2591  if( flagOutStt ==0){// 2 intersections with outer Stt circle.
2592  // case when this track exits the Stt outer circle without
2593  // hitting the Stt parallel inner section (for instance the track
2594  if( (fabs(XcrossOut[0]-Xcross[0])<1.e-5
2595  &&fabs(YcrossOut[0]-Ycross[0])<1.e-5 )
2596  ||
2597  (fabs(XcrossOut[1]-Xcross[0])<1.e-5
2598  &&fabs(YcrossOut[1]-Ycross[0])<1.e-5 )
2599  ){
2600  return true ;
2601  }
2602  } // end of if( flagOutStt ==0)
2603 
2604  // most usual case when track crossed the Inner parallel Stt.
2605  if (nnn == 0) return false;
2606 
2607  // if the exit point is actually given by FiLimitAdmissible, then allow
2608  // an extra uncertainty in the # Stt hit that must be present;
2609  // this is done because FiLimitAdmissible is not a very precise number.
2610  if( fabs(aux[0]-Xcross[1])<1.e-5&& fabs(aux[1]-Ycross[1])<1.e-5 ){
2611  islack = 3;
2612  }
2613 
2614 
2615  } else { // continuation of if(fabs(FiLimitAdmissible-FI0) < 2.*PI)
2616  if( flagOutStt ==0){// 2 intersections with outer Stt circle.
2617  // case when this track exits the Stt outer circle without
2618  // hitting the Stt parallel inner section (for instance the track
2619  if( (fabs(XcrossOut[0]-Xcross[0])<1.e-5
2620  &&fabs(YcrossOut[0]-Ycross[0])<1.e-5 )
2621  ||
2622  (fabs(XcrossOut[1]-Xcross[0])<1.e-5
2623  &&fabs(YcrossOut[1]-Ycross[0])<1.e-5 )
2624  ){
2625  return true ;
2626  }
2627  } // end of if( flagOutStt ==0)
2628 
2629  // most usual case when track crossed the Skew Stt.
2630  if (nnn == 0) return false;
2631 
2632  } // end of if(fabs(FiLimitAdmissible-FI0) < 2.*PI)
2633 
2634 
2635 
2636  length= GeometryCalculator.CalculateArcLength(Oxx,
2637  Oyy,
2638  Rr,
2639  Charge,
2640  Xcross,
2641  Ycross
2642  );
2643 //-------------------- stampe
2644 if(istampa>=2){
2645 cout<<"in SttSkewCleanup, IVOLTE = "<<IVOLTE<<"\n\t Xcross[0] "
2646 << Xcross[0]<<", Ycross[0] " <<Ycross[0]<<"\n\t Xcross[1] "
2647 << Xcross[1]<<", Ycross[1] " <<Ycross[1]<<", R = "<<Rr<<", Lungh. arco "<<length<<endl;
2648 }
2649 //-------------------fine stampe
2650 
2651 //-------------------------------------------------------------------------
2652 
2653 
2654  Sprevious = atan2(Ycross[0]-Oyy,Xcross[0]-Oxx);
2655  ibad=0;
2656  ninside=0;
2657 
2658  for (i=0; i<nHits;i++){
2659  if( ! GeometryCalculator.IsInsideArc(
2660  Oxx,Oyy,Charge,
2661  Xcross,
2662  Ycross,
2663  S[i])
2664  ){
2665  continue;
2666 if(istampa>1)cout<<"in SttSkewCleanup :hit n. "<< ListHits[i]
2667  <<" is NOT inside the arc between entrance and exit; hit excluded!\n";
2668  }
2669 
2670  ninside++;
2671 
2672  Distance[i] = 2.*Rr*Rr*(1.-cos(S[i]-Sprevious)); // this is the usual
2673  // distance**2 formula: (x1-x2)**2+(y1-y2)**2;
2674  // it is already 'protected' against S[i] jumps
2675  // around 2PI/0.
2676  Sprevious = S[i];
2677  if(Distance[i]<0.) Distance[i]=0.; // rounding errors protection.
2678 if(istampa>=2)cout<<"in SttSkewCleanup, Hit n. "<< ListHits[i]<<" has Distance "
2679 <<sqrt(Distance[i]) <<endl;
2680  if(Distance[i]>cut2){
2681  if(Distance[i]>16.*cut2){
2682 if(istampa>=2)cout<<"in SttSkewCleanup, Hit n. "<< ListHits[i]<<" has Distance "
2683 <<sqrt(Distance[i]) <<" which is >4.*cut [="<<cut<<"], discard the track!"<<endl;
2684  return false;
2685  }
2686 if(istampa>=2)cout<<"in SttSkewCleanup, Hit n. "<< ListHits[i]<<" has Distance "
2687 <<sqrt(Distance[i]) <<" which is > cut [="<<cut<<"]."<<endl;
2688  ibad++;
2689  }
2690  } // end of do (i=1; i<nHits;i++)
2691 
2692 
2693 
2694  // cut on the minimum (conservative) n. hits that must have fired
2695  if( ninside < ((int) 0.5*length/strawradius )-islack ){
2696  if(istampa>1){
2697  cout<<"in SttSkewCleanup, n. Hits inside = "<<ninside
2698  <<" is < n. hits that should be inside at least = "
2699  <<((int) 0.5*length/strawradius)<<"-islack ("<<
2700  islack<<"), track rejected!\n";
2701  return false;
2702  }
2703  }
2704 
2705 
2706  // compute the distance of last hit to point at which track leaves this detector volume
2707  // or the last physical possible Fi (given the length of the straw).
2708 
2709  if(GeometryCalculator.IsInsideArc(Oxx,Oyy,Charge,
2710  Xcross,
2711  Ycross,
2712  S[nHits-1])
2713  ) {
2714  Distance[nHits] =
2715  (Oxx+Rr*cos(S[nHits-1])-Xcross[1])*(Oxx+Rr*cos(S[nHits-1])-Xcross[1]) +
2716  (Oyy+Rr*sin(S[nHits-1])-Ycross[1])*(Oyy+Rr*sin(S[nHits-1])-Ycross[1]);
2717 
2718 if(istampa>=2)cout<<"in SttSkewCleanup, last Hit n. "<< ListHits[nHits-1]<<" has Distance from boundary "
2719 <<sqrt(Distance[nHits]) <<endl;
2720  if( Distance[nHits]>cut2 ){
2721  if( Distance[nHits]>16.*cut2){
2722 if(istampa>=2)cout<<"in SttSkewCleanup, last Hit n. "<< ListHits[nHits-1]<<" has Distance from boundary "
2723 <<sqrt(Distance[nHits]) <<" which is >4 .*cut [="<<cut<<"], discard the track!"<<endl;
2724  return false;
2725  }
2726 if(istampa>=2)cout<<"in SttSkewCleanup, last Hit n. "<< ListHits[nHits-1]<<" has Distance from boundary "
2727 <<sqrt(Distance[nHits]) <<" and it is > cut [="<<cut<<"]."<<endl;
2728  ibad++;
2729  }
2730  } // end of if(IsInsideArc(
2731 
2732 
2733 
2734  if( ibad > maxnum){
2735 if(istampa>=2)cout<<"in SttSkewCleanup, reject this track because ibad = "<< ibad
2736 <<" and it is > maxnum [="<<maxnum<<"].\n";
2737  return false;
2738  }
2739 
2740  return true;
2741 
2742 };
friend F32vec4 cos(const F32vec4 &a)
Definition: P4_F32vec4.h:112
Int_t i
Definition: run_full.C:25
friend F32vec4 sqrt(const F32vec4 &a)
Definition: P4_F32vec4.h:29
friend F32vec4 sin(const F32vec4 &a)
Definition: P4_F32vec4.h:111
timer Start()
void ChooseEntranceExitbis(Double_t Oxx, Double_t Oyy, Short_t Charge, Double_t FiStart, Short_t nIntersections, Double_t *XintersectionList, Double_t *YintersectionList, Double_t Xcross[2], Double_t Ycross[2])
double cut[MAX]
Definition: autocutx.C:36
const Double_t PI
int nHits
Definition: RiemannTest.C:16
TFile * fi
Double_t
friend F32vec4 fabs(const F32vec4 &a)
Definition: P4_F32vec4.h:47
bool IsInsideArc(Double_t Oxx, Double_t Oyy, Short_t Charge, Double_t Xcross[2], Double_t Ycross[2], Double_t Spoint)
friend F32vec4 atan2(const F32vec4 &y, const F32vec4 &x)
Definition: P4_F32vec4.h:117
Short_t FindIntersectionsOuterCircle(Double_t Oxx, Double_t Oyy, Double_t Rr, Double_t RMax, Double_t Xcross[2], Double_t Ycross[2])
Double_t CalculateArcLength(Double_t Oxx, Double_t Oyy, Double_t Rr, Short_t Charge, Double_t *Xcross, Double_t *Ycross)
Short_t FindTrackEntranceExitbiHexagonLeft(Double_t vgap, Double_t Oxx, Double_t Oyy, Double_t Rr, Short_t Charge, Double_t Start[3], Double_t ApotemaMin, Double_t ApotemaMax, Double_t Xcross[2], Double_t Ycross[2])
Short_t FindTrackEntranceExitbiHexagonRight(Double_t vgap, Double_t Oxx, Double_t Oyy, Double_t Rr, Short_t Charge, Double_t Start[3], Double_t ApotemaMin, Double_t ApotemaMax, Double_t Xcross[2], Double_t Ycross[2])
bool PndTrkCleanup::Track_Crosses_MvdBarrelFullAzimuthalCoverage ( Double_t  Ox,
Double_t  Oy,
Double_t  R,
Double_t  fi0,
Double_t  kappa,
Double_t  charge,
const Double_t  Zlow,
const Double_t  Zup,
Double_t  RBarrel,
PndTrkCTGeometryCalculations GeometryCalculator,
Double_t  extra_distance_Z,
Double_t Xintersect,
Double_t Yintersect,
Double_t Zintersect 
)

Definition at line 2896 of file PndTrkCleanup.cxx.

References PndTrkCTGeometryCalculations::ChooseEntranceExit3(), Double_t, and PndTrkCTGeometryCalculations::FindIntersectionsOuterCircle().

2916 {
2917  Short_t yes_intersect;
2918 
2919  Double_t
2920  FiOrderedList[2],
2921  Xcross[2],
2922  Ycross[2];
2923 
2924 
2925  // since Pz of the track is given by -charge*0.003*BField/kappa, the sign of
2926  // Pz is the opposite of charge/kappa;
2927  // the first check is the check that Pz of the track is consistent with the Z limits of
2928  // this Mvd Barrel;
2929  // yes_intersect = 0 --> 2 intersections
2930  // otherwise yes_intersect = -1;
2931  // I use the method FindIntersectionsOuterCircle that calculates the intersection between
2932  // two circles;
2933  yes_intersect = GeometryCalculator->FindIntersectionsOuterCircle(
2934  Ox,
2935  Oy,
2936  R,
2937  RBarrel, // AVERAGE radius of the i-th Mvd barrel layer;
2938  Xcross,
2939  Ycross
2940  );
2941 
2942 
2943 
2944  if(yes_intersect==0 ) { // there are 2 intersections of the trajectory with this barrel;
2945  // calculate the entrance point based on the rotation direction of the particle
2946  // (positive --> clockwise);
2947  GeometryCalculator->ChooseEntranceExit3(
2948  Ox,
2949  Oy,
2950  charge,
2951  fi0,
2952  2,
2953  Xcross, // input and output;
2954  Ycross, // input and output;
2955  FiOrderedList // output; Fi in the Helix reference frame;
2956  );
2957 
2958 
2959  Xintersect = Xcross[0];
2960  Yintersect = Ycross[0];
2961  // calculate the Z coordinate of the intersection; since kappa is necessarily
2962  // > 1.e-10 by construction, then Z is always well defined;
2963  Zintersect = (FiOrderedList[0]-fi0)/kappa;
2964 
2965 
2966 
2967 
2968  // condition for having Mvd hits in the Mvd Barrel layers certainly, namely taking
2969  // into account also possible errors in the Z caused by the uncertainty of the
2970  // trajectory; such an error is called extra_distance_Z (in cm);
2971 
2972  // condition by which the trajectory surely had to cross the barrel layer;
2973  if( Zintersect<= Zup - extra_distance_Z &&
2974  Zintersect>= Zlow + extra_distance_Z
2975  ){ // case in which there should be Mvd hits;
2976  return true;
2977  }
2978  } // end of if(yes_intersect>0 )
2979 
2980  return false;
2981 }
void ChooseEntranceExit3(Double_t Oxx, Double_t Oyy, Short_t Charge, Double_t FiStart, Short_t nIntersections, Double_t *XintersectionList, Double_t *YintersectionList, Double_t *FiOrderedList)
Double_t
Short_t FindIntersectionsOuterCircle(Double_t Oxx, Double_t Oyy, Double_t Rr, Double_t RMax, Double_t Xcross[2], Double_t Ycross[2])
Double_t R
Definition: checkhelixhit.C:61
bool PndTrkCleanup::Track_Crosses_MvdBarrelPartialAzimuthalCoverage ( Double_t  Ox,
Double_t  Oy,
Double_t  R,
Double_t  fi0,
Double_t  kappa,
Double_t  charge,
Double_t  Zlow,
Double_t  Zup,
Double_t  RInnerBarrel,
int  ngapInner,
const Double_t gap_lowInner,
const Double_t gap_upInner,
Double_t  ROuterBarrel,
int  ngapOuter,
const Double_t gap_lowOuter,
const Double_t gap_upOuter,
PndTrkCTGeometryCalculations GeometryCalculator,
Double_t  extra_distance_Z,
Double_t Xintersect,
Double_t Yintersect,
Double_t Zintersect 
)

Definition at line 2991 of file PndTrkCleanup.cxx.

References atan2(), PndTrkCTGeometryCalculations::ChooseEntranceExit3(), Double_t, fi, PndTrkCTGeometryCalculations::FindIntersectionsOuterCircle(), i, and TWO_PI.

3030 {
3031  bool cross;
3032 
3033  Short_t i,
3034  yes_intersect;
3035 
3036  Double_t
3037  fi,
3038  FiOrderedList[2],
3039  Xcross[2],
3040  Ycross[2];
3041 
3042  // yes_intersect = 0 --> 2 intersections
3043  // otherwise yes_intersect = -1;
3044  // I use the method FindIntersectionsOuterCircle that calculates the intersection between
3045  // two circles;
3046 
3047  cross = false; // at the end, if there is a crossing point in this Inner or Outer Barrel then
3048  // cross will be true, otherwise it will be false;
3049 
3050 
3051  // first check if the trajectory crosses this Inner Barrel;
3052  // to check that, the function GeometryCalculator->FindIntersectionsOuterCircle is
3053  // used (despite the name, it is only a fuction that checks if a circular trajectory
3054  // of center Ox and Oy and radius R crosses (in the XY view) another circle with center in 0,0
3055  // and radius RInnerBarrel);
3056 
3057 
3058  yes_intersect = GeometryCalculator->FindIntersectionsOuterCircle(
3059  Ox,
3060  Oy,
3061  R,
3062  RInnerBarrel, // radius of this Inner Mvd Barrel layer;
3063  Xcross,
3064  Ycross
3065  );
3066  if(yes_intersect==0 ) { // there are 2 intersections of the trajectory with this barrel;
3067  // calculate the entrance point based on the rotation direction of the particle
3068  // (positive --> clockwise);
3069  GeometryCalculator->ChooseEntranceExit3(
3070  Ox,
3071  Oy,
3072  charge,
3073  fi0,
3074  2,
3075  Xcross, // input and output;
3076  Ycross, // input and output;
3077  FiOrderedList // output; Fi of the intersections in the Helix frame;
3078  );
3079 
3080  // calculate the Z coordinate of the intersection; since |kappa| is necessarily
3081  // > 1.e-10 by construction, so Z is always well defined;
3082  Zintersect[0] = (FiOrderedList[0]-fi0)/kappa;
3083 
3084 
3085  // condition for having Mvd hits in the Mvd Barrel layers certainly, namely taking
3086  // into account also possible errors in the Z caused by the uncertainty of the
3087  // trajectory; such an error is called extra_distance_Z (in cm);
3088 
3089  // condition by which the trajectory surely had to cross the barrel layer;
3090  if( Zintersect[0]<= Zup - extra_distance_Z &&
3091  Zintersect[0]>= Zlow + extra_distance_Z
3092  ){ // case in which there should be Mvd hits;
3093  // loop to check that the track doesn't fall in the gap region;
3094  // fi must be between 0. and 2Pi;
3095  fi = atan2(Ycross[0],Xcross[0]);
3096  if(fi<0.) fi += TWO_PI;
3097  if(fi<0.) fi = 0.;
3098  if(fi> TWO_PI) fi = TWO_PI;
3099 
3100  cross = true;
3101  for(i=0; i<ngapInner; i++){
3102  if( fi <gap_upInner[i] && fi > gap_lowInner[i] ) {
3103  cross = false;
3104  break;
3105  }
3106  } // end of for(i=0; i<ngapInner; i++)
3107  } // end of if( Zintersect[0]<= Zup - extra_distance...
3108  } // end of if(yes_intersect==0 )
3109 
3110 
3111  // in case the trajectory crosses the Inner Barrel then there must be a hit in this Barrel section ;
3112  // now check this Mvd Outer Barrel; at any rate if now cross is true it will remain so no matter the result
3113  // of the nalysis of the Outer Barrel;
3114 
3115  // if there was no intersection Xintersect[0] is conventionally set at -99999.
3116 
3117  if(cross)
3118  {
3119  Xintersect[0] = Xcross[0];
3120  Yintersect[0] = Ycross[0];
3121 
3122 
3123 
3124  } else {
3125  Xintersect[0] = -99999. ;
3126  }
3127 
3128  // then check if the trajectory crosses this Outer Barrel;
3129  // first of all check if there is an Outer Barrel; if it doesn't its radius is conventionally set at -1.;
3130 
3131  if(ROuterBarrel < 0. ){
3132  // since there was no intersection Xintersect[1] is conventionally set at -99999.
3133  Xintersect[1] = -99999. ;
3134  // at this point cross can be either true or false;
3135  return cross;
3136  }
3137 
3138 
3139 
3140  yes_intersect = GeometryCalculator->FindIntersectionsOuterCircle(
3141  Ox,
3142  Oy,
3143  R,
3144  ROuterBarrel, // radius of this Outer Mvd Barrel layer;
3145  Xcross,
3146  Ycross
3147  );
3148 
3149  if(yes_intersect==0 ) { // there are 2 intersections of the trajectory with this barrel;
3150  // calculate the entrance point based on the rotation direction of the particle
3151  // (positive --> clockwise);
3152  GeometryCalculator->ChooseEntranceExit3(
3153  Ox,
3154  Oy,
3155  charge,
3156  fi0,
3157  2,
3158  Xcross, // input and output;
3159  Ycross, // input and output;
3160  FiOrderedList // output; Fi of the intersections in the Helix frame;
3161  );
3162 
3163  // calculate the Z coordinate of the intersection; since kappa is necessarily
3164  // > 1.e-10 by construction, then Z is always well defined;
3165  Zintersect[1] = (FiOrderedList[0]-fi0)/kappa;
3166 
3167 
3168 
3169 
3170  // condition for having Mvd hits in the Mvd Barrel layers certainly, namely taking
3171  // into account also possible errors in the Z caused by the uncertainty of the
3172  // trajectory; such an error is called extra_distance_Z (in cm);
3173 
3174  // condition by which the trajectory surely had to cross the barrel layer;
3175  if( Zintersect[1]<= Zup - extra_distance_Z &&
3176  Zintersect[1]>= Zlow + extra_distance_Z
3177  ){ // case in which there should be Mvd hits;
3178  // loop to check that the track doesn't fall in the gap region; fi must be between 0. and 2Pi;
3179  fi = atan2(Ycross[0],Xcross[0]);
3180  if(fi<0.) fi += TWO_PI;
3181  if(fi<0.) fi = 0.;
3182  if(fi> TWO_PI) fi = TWO_PI;
3183 
3184 
3185  Xintersect[1] = Xcross[0];
3186  for(i=0; i<ngapOuter; i++){
3187  if( fi <gap_upOuter[i] && fi > gap_lowOuter[i] ) {
3188  Xintersect[1] = -99999.;
3189  break;
3190  }
3191  } // end of for(i=0; i<ngapOuter; i++)
3192  } else {
3193  Xintersect[1] = -99999.;
3194  } // end of if( Zintersect[1]<= Zup - extra....
3195  } else { // continuation of if(yes_intersect==0 )
3196 
3197  Xintersect[1] = -99999.;
3198 
3199  } // end of if(yes_intersect==0 )
3200 
3201  if( Xintersect[1] > -99998. ) // in this case there was intersection between this track and the Barrel;
3202  {
3203  Yintersect[1] = Ycross[0];
3204  return true; // because there is at least one intersection : the one with the Outer Barrel;
3205  } else {
3206  return cross; // this is the result of the analysis of the Inner Barrel;
3207  }
3208 
3209 }
Int_t i
Definition: run_full.C:25
void ChooseEntranceExit3(Double_t Oxx, Double_t Oyy, Short_t Charge, Double_t FiStart, Short_t nIntersections, Double_t *XintersectionList, Double_t *YintersectionList, Double_t *FiOrderedList)
const Double_t TWO_PI
TFile * fi
Double_t
friend F32vec4 atan2(const F32vec4 &y, const F32vec4 &x)
Definition: P4_F32vec4.h:117
Short_t FindIntersectionsOuterCircle(Double_t Oxx, Double_t Oyy, Double_t Rr, Double_t RMax, Double_t Xcross[2], Double_t Ycross[2])
Double_t R
Definition: checkhelixhit.C:61
bool PndTrkCleanup::Track_Crosses_MvdMiniDisk_withMargin ( Double_t  ZLayerBegin,
Double_t  xmargin,
Double_t  ymargin,
Double_t  Ox,
Double_t  Oy,
Double_t  R,
Double_t  fi0,
Double_t  kappa,
Double_t  charge,
PndTrkCTGeometryCalculations GeometryCalculator 
)

Definition at line 3218 of file PndTrkCleanup.cxx.

References angle, cos(), Double_t, PndTrkCTGeometryCalculations::IsInMvdMiniDisk10_41to10_43withMargin(), PndTrkCTGeometryCalculations::IsInMvdMiniDisk14_77to14_79withMargin(), PndTrkCTGeometryCalculations::IsInMvdMiniDisk15_21to15_23withMargin(), PndTrkCTGeometryCalculations::IsInMvdMiniDisk1_97to1_99withMargin(), PndTrkCTGeometryCalculations::IsInMvdMiniDisk21_77to21_79withMargin(), PndTrkCTGeometryCalculations::IsInMvdMiniDisk22_21to22_23withMargin(), PndTrkCTGeometryCalculations::IsInMvdMiniDisk2_41to2_43withMargin(), PndTrkCTGeometryCalculations::IsInMvdMiniDisk3_97to3_99withMargin(), PndTrkCTGeometryCalculations::IsInMvdMiniDisk4_41to4_43withMargin(), PndTrkCTGeometryCalculations::IsInMvdMiniDisk6_97to6_99withMargin(), PndTrkCTGeometryCalculations::IsInMvdMiniDisk7_41to7_43withMargin(), PndTrkCTGeometryCalculations::IsInMvdMiniDisk9_97to9_99withMargin(), sin(), X, and Y.

3233 {
3234 
3235  Double_t angle,
3236  X,
3237  Y;
3238 
3239  // since Pz of the track is given by -charge*0.003*BField/kappa, the sign of
3240  // Pz is the opposite of charge/kappa (or charge*kappa) ;
3241  // so when the sign of Pz is > 0, ZLayerBegin must be positive otherwise
3242  // return false; viceversa when Pz is negative;
3243 
3244  if( -charge*kappa * ZLayerBegin <= 0. ) {
3245  // this is a track travelling in the Z direction opposite to where the
3246  // ZLayerBegin is, consequently it cannot cross this MiniDisk;
3247 
3248  return false;
3249  }
3250 
3251  angle = fi0 + ZLayerBegin* kappa;
3252 
3253  X = Ox + R*cos( angle ); // X position reached by the track at Z = 1.98, the
3254  // middle of this MiniDisk;
3255 
3256  Y = Oy + R*sin( angle ); // Y position reached by the track at Z = 1.98, the
3257  // middle of this MiniDisk;
3258 
3259 
3260 
3261  // the list of Mvd MiniDisks, listed according to the Z position of the silicon sensitive layer;
3262  if ( ZLayerBegin == 1.97){
3263 
3264  if(GeometryCalculator->IsInMvdMiniDisk1_97to1_99withMargin(X,Y,xmargin,ymargin)
3265  ) return true ; else return false;
3266 
3267  } else if( ZLayerBegin == 2.41) {
3268 
3269  if(GeometryCalculator->IsInMvdMiniDisk2_41to2_43withMargin(X,Y,xmargin,ymargin)
3270  ) return true ; else return false;
3271 
3272  } else if( ZLayerBegin == 3.97) {
3273 
3274  if(GeometryCalculator->IsInMvdMiniDisk3_97to3_99withMargin(X,Y,xmargin,ymargin)
3275  ) return true ; else return false;
3276 
3277  } else if( ZLayerBegin == 4.41) {
3278 
3279  if(GeometryCalculator->IsInMvdMiniDisk4_41to4_43withMargin(X,Y,xmargin,ymargin)
3280  ) return true ; else return false;
3281 
3282  } else if( ZLayerBegin == 6.97) {
3283 
3284  if(GeometryCalculator->IsInMvdMiniDisk6_97to6_99withMargin(X,Y,xmargin,ymargin)
3285  ) return true ; else return false;
3286 
3287  } else if( ZLayerBegin == 7.41) {
3288 
3289  if(GeometryCalculator->IsInMvdMiniDisk7_41to7_43withMargin(X,Y,xmargin,ymargin)
3290  ) return true ; else return false;
3291 
3292  } else if( ZLayerBegin == 9.97) {
3293 
3294  if(GeometryCalculator->IsInMvdMiniDisk9_97to9_99withMargin(X,Y,xmargin,ymargin)
3295  ) return true ; else return false;
3296 
3297  } else if( ZLayerBegin == 10.41) {
3298 
3299  if(GeometryCalculator->IsInMvdMiniDisk10_41to10_43withMargin(X,Y,xmargin,ymargin)
3300  ) return true ; else return false;
3301 
3302  } else if( ZLayerBegin == 14.77) {
3303 
3304  if(GeometryCalculator->IsInMvdMiniDisk14_77to14_79withMargin(X,Y,xmargin,ymargin)
3305  ) return true ; else return false;
3306 
3307  } else if( ZLayerBegin == 15.21) {
3308 
3309  if(GeometryCalculator->IsInMvdMiniDisk15_21to15_23withMargin(X,Y,xmargin,ymargin)
3310  ) return true ; else return false;
3311 
3312  } else if( ZLayerBegin == 21.77) {
3313 
3314  if(GeometryCalculator->IsInMvdMiniDisk21_77to21_79withMargin(X,Y,xmargin,ymargin)
3315  ) return true ; else return false;
3316 
3317  } else if( ZLayerBegin == 22.21) {
3318 
3319  if(GeometryCalculator->IsInMvdMiniDisk22_21to22_23withMargin(X,Y,xmargin,ymargin)
3320  ) return true ; else return false;
3321 
3322  } else {
3323  cout<<"PndTrkCleanup.cxx::Track_Crosses_MvdMiniDisk_withMargin WARNING, this Mvd MiniDisk apparently"<<
3324  " is not in the list of known Mvd MiniDisks !";
3325 
3326  }
3327  return false; //FIXME Is this logically correct?
3328 
3329 }
bool IsInMvdMiniDisk9_97to9_99withMargin(Double_t X, Double_t Y, Double_t xmargin, Double_t ymargin)
friend F32vec4 cos(const F32vec4 &a)
Definition: P4_F32vec4.h:112
bool IsInMvdMiniDisk6_97to6_99withMargin(Double_t X, Double_t Y, Double_t xmargin, Double_t ymargin)
friend F32vec4 sin(const F32vec4 &a)
Definition: P4_F32vec4.h:111
bool IsInMvdMiniDisk2_41to2_43withMargin(Double_t X, Double_t Y, Double_t xmargin, Double_t ymargin)
double Y
Definition: anaLmdDigi.C:68
bool IsInMvdMiniDisk21_77to21_79withMargin(Double_t X, Double_t Y, Double_t xmargin, Double_t ymargin)
bool IsInMvdMiniDisk7_41to7_43withMargin(Double_t X, Double_t Y, Double_t xmargin, Double_t ymargin)
bool IsInMvdMiniDisk15_21to15_23withMargin(Double_t X, Double_t Y, Double_t xmargin, Double_t ymargin)
Double_t
bool IsInMvdMiniDisk1_97to1_99withMargin(Double_t X, Double_t Y, Double_t xmargin, Double_t ymargin)
bool IsInMvdMiniDisk14_77to14_79withMargin(Double_t X, Double_t Y, Double_t xmargin, Double_t ymargin)
double X
Definition: anaLmdDigi.C:68
bool IsInMvdMiniDisk3_97to3_99withMargin(Double_t X, Double_t Y, Double_t xmargin, Double_t ymargin)
Double_t angle
bool IsInMvdMiniDisk22_21to22_23withMargin(Double_t X, Double_t Y, Double_t xmargin, Double_t ymargin)
bool IsInMvdMiniDisk4_41to4_43withMargin(Double_t X, Double_t Y, Double_t xmargin, Double_t ymargin)
Double_t R
Definition: checkhelixhit.C:61
bool IsInMvdMiniDisk10_41to10_43withMargin(Double_t X, Double_t Y, Double_t xmargin, Double_t ymargin)
bool PndTrkCleanup::TrackCleanup ( Double_t  ApotemaMaxInnerPar,
Double_t  ApotemaMaxSkew,
Double_t  ApotemaMinOuterPar,
Double_t  ApotemaMinSkew,
Double_t auxS,
Short_t  Charge,
Double_t  FI0,
Double_t  GAP,
Double_t  info[][7],
int  istampa,
int  IVOLTE,
Double_t  KAPPA,
Short_t *  ListHitsPar,
Short_t *  ListHitsSkew,
int  MAXSTTHITS,
Short_t  nHitsPar,
Short_t  nHitsSkew,
Double_t  Oxx,
Double_t  Oyy,
Double_t  Rr,
Double_t  RStrawDetMax,
Double_t  RStrawDetMin,
Double_t  Start[3],
Double_t  Strawradius 
)

Definition at line 2750 of file PndTrkCleanup.cxx.

References cos(), Double_t, SEMILENGTH_STRAIGHT, sin(), and ZCENTER_STRAIGHT.

Referenced by PndTrkTracking2::Exec().

2776 {
2777 
2778 
2779 // this method is called by PdnTrkTracking2::Exec for each track found (inside a loop over the
2780 // number of tracks found by the pattern recognition);
2781 
2782 
2783 
2784 
2785 
2786 // this method does 3 things :
2787 //
2788 // 1) finds the entrance and exit points in the STT parallel and skew volumes of the current track;
2789 // 2) eliminates from the track hit list possible spurious hits that are not encompassed
2790 // by the entrance and exit point;
2791 // 3) eliminates the tracks if the hit sequence is not continuous enough.
2792 
2793 
2794  //bool ConsiderLastHit; //[R.K. 01/2017] unused variable?
2795 
2796  //Short_t flagInnerStt, //[R.K. 01/2017] unused variable?
2797  //flagOuterStt; //[R.K. 01/2017] unused variable?
2798 
2799  //Short_t ihit, //[R.K. 01/2017] unused variable?
2800  //nInnerHits, //[R.K. 01/2017] unused variable?
2801  //nOuterHits, //[R.K. 01/2017] unused variable?
2802  //nIntersections[2], //[R.K. 01/2017] unused variable?
2803  //ListInnerHits[MAXSTTHITS], //[R.K. 01/2017] unused variable?
2804  //ListOuterHits[MAXSTTHITS]; //[R.K. 01/2017] unused variable?
2805 
2806  Double_t FiLimitAdmissible;
2807  //r, //[R.K. 01/2017] unused variable?
2808  //Xcross[2], //[R.K. 01/2017] unused variable?
2809  //Ycross[2], //[R.K. 01/2017] unused variable?
2810  //XintersectionList[12][2], //[R.K. 01/2017] unused variable?// second index =0 --> inner Hexagon, =1 --> outer.
2811  //YintersectionList[12][2]; //[R.K. 01/2017] unused variable?// first index : all the possible intersections
2812  // (up to 12 intersections).
2813 
2814 //------------------------
2815  // calculation of the Maximum FI angle possible (if it is a +ve charge) of the Minimum
2816  // for this track, taking into account
2817  // that the maximum possible Z of a hit is ZCENTER_STRAIGHT + SEMILENGTH_STRAIGHT; the minimum
2818  // Z of a hit is ZCENTER_STRAIGHT - SEMILENGTH_STRAIGHT.
2819  if(Charge<0){
2820  if( KAPPA>0.){
2821  FiLimitAdmissible = FI0 + KAPPA*(ZCENTER_STRAIGHT + SEMILENGTH_STRAIGHT) ;
2822  } else {
2823  FiLimitAdmissible = FI0 + KAPPA*(ZCENTER_STRAIGHT - SEMILENGTH_STRAIGHT) ;
2824  }
2825  } else {
2826  if( KAPPA>0.){
2827  FiLimitAdmissible = FI0 + KAPPA*(ZCENTER_STRAIGHT - SEMILENGTH_STRAIGHT) ;
2828  } else {
2829  FiLimitAdmissible = FI0 + KAPPA*(ZCENTER_STRAIGHT + SEMILENGTH_STRAIGHT) ;
2830  }
2831  } // end of if(Charge<0)
2832 //-----------------------------------------------------------------------------------------------------
2833 
2834  // parallel cleanup.
2835 
2836 
2837 
2838 //----------------stampe
2839 if(istampa>=2){
2840 cout<<" IVOLTE = "<<IVOLTE<<", prima di paral cleanup, nHitsPar "<<nHitsPar<<
2841 ", KAPPA = "<<KAPPA <<", charge "<<Charge<<", FI0 "<<FI0
2842 <<"\n\tFiLimitAdmissible "<<
2843 FiLimitAdmissible<<", X limit "<<Oxx+Rr*cos(FiLimitAdmissible)<<
2844 ", Y limit "<<Oyy+Rr*sin(FiLimitAdmissible)<<", Ox "<<Oxx<<", Oy "<<Oyy<<", R "<<Rr<<endl;
2845 }
2846 
2847 //-------------------- fine stampe
2848 
2849 
2850 
2851  if(!SttParalCleanup(
2852  ApotemaMaxInnerPar,
2853  ApotemaMinOuterPar,
2854  Charge,
2855  FI0,
2856  FiLimitAdmissible,
2857  GAP,
2858  info,
2859  istampa,
2860  IVOLTE,
2861  ListHitsPar, // input only for now.
2862  nHitsPar, // it doesn't get modify for now.
2863  Oxx,
2864  Oyy,
2865  Rr,
2866  RStrawDetMax,
2867  RStrawDetMin,
2868  Start,
2869  strawradius
2870  )
2871  ){
2872 
2873 
2874 
2875 
2876  return false;
2877  }
2878 
2879 
2880 
2881 
2882  return true;
2883 
2884 
2885 
2886 };
friend F32vec4 cos(const F32vec4 &a)
Definition: P4_F32vec4.h:112
friend F32vec4 sin(const F32vec4 &a)
Definition: P4_F32vec4.h:111
timer Start()
const Double_t SEMILENGTH_STRAIGHT
Double_t
bool SttParalCleanup(Double_t ApotemaInnerParMax, Double_t ApotemaMinOuterPar, Short_t Charge, Double_t FI0, Double_t FiLimitAdmissible, Double_t GAP, Double_t info[][7], int istampa, int IVOLTE, Short_t *Listofhits, Short_t nHits, Double_t Oxx, Double_t Oyy, Double_t Rr, Double_t RStrawDetMax, Double_t RStrawDetMin, Double_t Start[3], Double_t Strawradius)
const Double_t ZCENTER_STRAIGHT
bool PndTrkCleanup::XYCleanup ( int  istampa,
Double_t  info[][7],
Short_t(*)  ListParContiguous[6],
Short_t *  nParContiguous,
Short_t *  StrawCode,
Short_t *  StrawCode2,
Short_t *  TubeID,
Double_t xTube,
Double_t yTube,
Double_t zTube,
Double_t xxyyTube,
Double_t  Ox,
Double_t  Oy,
Double_t  R,
Short_t  Charge,
Short_t *  ListHits,
Short_t  nHits,
Double_t  RStrawDetInnerParMax,
Short_t  nScitilHitsInTrack,
Short_t *  ListSciTilHitsinTrack,
Double_t  posizSciTil[][3] 
)

Definition at line 3338 of file PndTrkCleanup.cxx.

References atan2(), PndTrkCTGeometryCalculations::ChooseEntranceExit3(), DIMENSIONSCITIL, Double_t, PndTrkCTGeometryCalculations::FindIntersectionsOuterCircle(), i, PndTrkCTGeometryCalculations::ListAxialSectorsCrossedbyTrack_and_Hits(), MAXSTTHITSINTRACK, nHits, RADIUSSCITIL, and TWO_PI.

3363 {
3364 
3365  bool //connected, //[R.K. 01/2017] unused variable?
3366  farthest_hit_is_boundary,
3367  good;
3368 
3369  Short_t
3370  auxListHits[MAXSTTHITSINTRACK],
3371  holes,
3372  i,
3373  j,
3374  //k, //[R.K. 01/2017] unused variable?
3375  nArcs_populated,
3376 
3377  tListInnerHitsLeft[nHits],
3378  tListInnerHitsRight[nHits],
3379  tListOuterHitsLeft[nHits],
3380  tListOuterHitsRight[nHits],
3381  //tube_adjacent, //[R.K. 01/2017] unused variable?
3382  //tube_current, //[R.K. 01/2017] unused variable?
3383  //tube_next, //[R.K. 01/2017] unused variable?
3384  //tube_near, //[R.K. 01/2017] unused variable?
3385  ListHitsInArc[MAXSTTHITSINTRACK][56], // ordered list of hits in each Arc (from first to last
3386  // according to the charge of the particle;if the maximum
3387  // # of Intersected Sector is 56, than the maximum # of Arcs is 28;
3388 
3389  nHitsInArc[56]; // number of hits in each Arc; the maximum # of Arcs is 56;
3390  //nInnerHitsLeft, //[R.K. 01/2017] unused variable?
3391  //nInnerHitsRight, //[R.K. 01/2017] unused variable?
3392  //nOuterHitsLeft, //[R.K. 01/2017] unused variable?
3393  //nOuterHitsRight; //[R.K. 01/2017] unused variable?
3394 // OrderedSectorList[56]; // ordered list of Sectors crossed (from first to last); each
3395  // Sector number is the Sector where the Arc lies;
3396 
3397  Double_t dist2,
3398  FiOrderedList[2],
3399  FiStart,
3400  Xcross[2],
3401  Ycross[2];
3402 
3404  ListInnerHitsLeft(tListInnerHitsLeft,nHits,"ListInnerHitsLeft"),
3405  ListInnerHitsRight(tListInnerHitsRight,nHits,"ListInnerHitsRight"),
3406  ListOuterHitsLeft(tListOuterHitsLeft,nHits,"ListOuterHitsLeft"),
3407  ListOuterHitsRight(tListOuterHitsRight,nHits,"ListOuterHitsRight");
3408 
3409 
3410  // class with all the geometry calculations:
3411  PndTrkCTGeometryCalculations GeometryCalculator;
3412 
3413 
3414 
3415  //------------------------------------------------------------------------------------------------------------
3416  // first of all, eliminate spurious with SciTil's since it is faster;
3417 
3418  // now check if there is an intersection with the SciTil;
3419 
3420  // calculate the intersection points in XY of the track trajectory with a circle tangent to the SciTil in
3421  // the middle of each SciTil tile; these can be 0 or 2;
3422  // if there are no intersections don't do anything; if there are 2 intersections check that there is a SciTil
3423  // hit in the proper place;
3424  // FindIntersectionsOuterCircle returns -1 or 0;
3425  // if FindIntersectionsOuterCircle returns -1 there are no intersections, if it returns 0 there are 2;
3426  if( GeometryCalculator.FindIntersectionsOuterCircle(
3427  Ox,
3428  Oy,
3429  R,
3430  RADIUSSCITIL,
3431  Xcross,
3432  Ycross
3433  ) >= 0 ){
3434 
3435  // there are 2 intersections;
3436  // choose the first entrance point according to the charge of the particle;
3437  // ChooseEntranceExit3 works under the hypothesis that there are at least 2 intersections.
3438 
3439  FiStart = atan2(-Oy,-Ox);
3440  if( FiStart < 0.) FiStart += TWO_PI;
3441  if( FiStart < 0.) FiStart = 0.;
3442 
3443  GeometryCalculator.ChooseEntranceExit3(
3444  Ox,
3445  Oy,
3446  Charge,
3447  FiStart,
3448  2, // # of Intersections between track and Circle;
3449  Xcross, // input and output; these are the intersections;
3450  Ycross, // input and output; these are the intersections;
3451  FiOrderedList // output
3452  );
3453 
3454  // the intersection point must be close enough to at least 1 SciTil hit;
3455 
3456  good = false;
3457  for(i=0;i<nScitilHitsInTrack;i++){
3458  dist2 = (posizSciTil[ ListSciTilHitsinTrack[i] ][0] - Xcross[0])*
3459  (posizSciTil[ ListSciTilHitsinTrack[i] ][0] - Xcross[0])
3460  +
3461  (posizSciTil[ ListSciTilHitsinTrack[i] ][1] - Ycross[0])*
3462  (posizSciTil[ ListSciTilHitsinTrack[i] ][1] - Ycross[0]);
3463 
3464  if(dist2 < 2.25*DIMENSIONSCITIL*DIMENSIONSCITIL) { good = true; break;}// oversizing; in principle
3465  // dist2 should be < DIMENSIONSCITIL*DIMENSIONSCITIL/4 ;
3466 
3467  } // end of for(i=0;i<nScitilHitsInTrack;i++)
3468  // failed to find a hit SciTil close to trajectory;
3469  if(!good) return false;
3470  } // end of if( GeometryCalculator.FindIntersectionsOuterCircle(
3471 
3472  // ----------------------------------------------------------------------------- end of check with SciTil's;
3473 
3474 
3475 
3476 // now use the STT hits for cleaning;
3477 
3478  // Convention for the Sector number used in GoodTrack :
3479  // Sector = 1 --> Axial Outer Right
3480  // Sector = 2 --> Axial Inner Right
3481  // Sector = 3 --> Axial Inner Left
3482  // Sector = 4 --> Axial Outer Left
3483 
3484 
3485  // --------------------------------------------------------------------------------------------------
3486 
3487  // the intersections of the current track with the boundaries of each Axial Sector (Inner Left, Outer Left,
3488  // Inner Right, Outer Right) determine the number of Arcs in which the trajectory is subdivided;
3489  // for each Arc the number of ordered (according to the charge of the particle) axial STT hits are
3490  // found and listed;
3491  // nArcs_populated = # of Arcs (maximum possible 28 in the Left side + 28 in the Right Side of STT axial detector
3492  // ---> 56 maximum) populated by axial STT hits;
3493  // OrderedSectorList = ordered list, from last to first, of the Sectors corresponding to each Arc ;
3494  // nHitsInArc[56] = # of hits of the track belonging to each Arc (in order corresponding to the Sector order);
3495  // ListHitsInArc[MAXSTTHITSINTRACK][56] = list of hits in each Arc; this list is ordered clockwise or anticlockwise
3496  // according to the charge;
3497 
3498  GeometryCalculator.ListAxialSectorsCrossedbyTrack_and_Hits(
3499  Ox, // input;
3500  Oy, // input;
3501  R, // input;
3502  Charge, // input;
3503  nHits, // input;
3504  ListHits, // input;
3505  info, // input;
3506  nArcs_populated, // output; # Arcs of trajectory populated by at least 1 axial hit; this is <= 28;
3507 // OrderedSectorList, // output; ordered list of Sectors crossed (from first to last); each
3508 // // Sector number correspond to the Sector where the Arc lies;
3509  nHitsInArc, // output; number of hits in each Sector; if the maximun # of Intersected Sector is 56,
3510  // than the maximum # of Arcs is 28;
3511 
3512  ListHitsInArc // output; ordered list of hits in each Arc (from first to last
3513  // according to the charge of the particle;if the maximum
3514  // # of Intersected Sector is 56, than the maximum # of Arcs is 28;
3515  );
3516 
3517 
3518 //-------------------------------------------------
3519 if(istampa>0){ cout<<"from XYCleanup,after ListAxialSectorsCrossedbyTrack_and_Hits :"<<endl<<
3520  "\tnArcs_populated "<<nArcs_populated<<", ordered list of Sectors crossed :"<<endl;
3521  for(int kg=0;kg<nArcs_populated;kg++){cout<<"\tSector populated with "
3522  <<nHitsInArc[kg]<<" hits; loro lista :"<<endl;
3523  for(int nn=0;nn<nHitsInArc[kg];nn++){cout<<"\t\taxial hit n. "<<ListHitsInArc[nn][kg]<<
3524  ", R**2 "<< info[ListHitsInArc[nn][kg]][0]*info[ListHitsInArc[nn][kg]][0]+
3525  info[ListHitsInArc[nn][kg]][1]*info[ListHitsInArc[nn][kg]][1] << endl;}
3526  };
3527  };
3528 //-------------------------------------------------
3529 
3530 // ------------------- starts analysis of the track; loop over the number of Arcs in which the track has been
3531 // subdivided and allow a maximum total number of holes of 1 per track;
3532 
3533 
3534 
3535  // Sector number convention:
3536  // 1 --> Right Axial Outer;
3537  // 2 --> Right Axial Inner;
3538  // 3 --> Left Axial Inner;
3539  // 4 --> Left Axial Outer;
3540 
3541 
3542  // # of "holes" in the track;
3543  holes = 0;
3544 
3545 // no_holes = false;
3546 
3547  // if the following flag is true the hit of the track furthest from the origin is at the boundary of
3548  // this sector;
3549  farthest_hit_is_boundary = false;
3550 
3551  // loop from the last Arc (the farthest according to the charge of the track) to the first one;
3552  for(i=nArcs_populated-1;i>=0; i--){
3553  for(j=0;j<nHitsInArc[i];j++){auxListHits[j]=ListHitsInArc[j][i];}
3554 
3555  if( ! GoodTrack(
3556  info, // input
3557  farthest_hit_is_boundary, // input
3558  Ox, // input; center of the current track;
3559  Oy, // input; center of the current track;
3560  R, // input; Radius of the current track;
3561  Charge, // input; charge of the current track;
3562  nHitsInArc[i], // input
3563  auxListHits, // input
3564  StrawCode, // input
3565  StrawCode2, // input
3566  TubeID, // input
3567  nParContiguous, // input
3568  ListParContiguous, // input
3569  xTube, // input
3570  yTube, // input
3571  zTube, // input
3572  xxyyTube, // input
3573  holes // input and output
3574  )
3575  ) { return false;}
3576 
3577  // now the first farthest hit in the next arc must be boundary;
3578  farthest_hit_is_boundary=true;
3579  } // end of for(i=nArcs_populated;i>0; i--)
3580 
3581  // -----------------------------------------------------------------------
3582 
3583 
3584 
3585  return true;
3586 }
void ListAxialSectorsCrossedbyTrack_and_Hits(Double_t Ox, Double_t Oy, Double_t R, Double_t Charge, Short_t nHits, Short_t *ListHits, Double_t info[][7], Short_t &nArcs_populated, Short_t nHitsInArc[56], Short_t(*ListHitsInArc)[56])
Int_t i
Definition: run_full.C:25
void ChooseEntranceExit3(Double_t Oxx, Double_t Oyy, Short_t Charge, Double_t FiStart, Short_t nIntersections, Double_t *XintersectionList, Double_t *YintersectionList, Double_t *FiOrderedList)
const Double_t TWO_PI
const Double_t RADIUSSCITIL
int nHits
Definition: RiemannTest.C:16
Double_t
friend F32vec4 atan2(const F32vec4 &y, const F32vec4 &x)
Definition: P4_F32vec4.h:117
const int MAXSTTHITSINTRACK
bool GoodTrack(Double_t info[][7], bool farthest_hit_is_boundary, Double_t Ox, Double_t Oy, Double_t R, Short_t Charge, Short_t nHits, Short_t *ListHits, Short_t *StrawCode, Short_t *StrawCode2, Short_t *TubeID, Short_t *nParContiguous, Short_t ListParContiguous[][6], Double_t *xTube, Double_t *yTube, Double_t *zTube, Double_t *xxyyTube, Short_t &holes)
Short_t FindIntersectionsOuterCircle(Double_t Oxx, Double_t Oyy, Double_t Rr, Double_t RMax, Double_t Xcross[2], Double_t Ycross[2])
Double_t R
Definition: checkhelixhit.C:61
const Double_t DIMENSIONSCITIL

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