PandaRoot
PndSttTrackFinderReal.h
Go to the documentation of this file.
1 #ifndef PNDSTTTRACKFINDERREAL
2 #define PNDSTTTRACKFINDERREAL 1
3 
4 #include "PndSttTrackFinder.h"
5 #include "PndMCTrack.h"
6 #include "PndSttTrack.h"
7 
8 #include "TList.h"
9 #include "TClonesArray.h"
10 #include "TH1.h"
11 //-------------------------------
12 
13 class FairMCPoint;
14 
16  Int_t Ncircles;
17  Double_t CX[8];
18  Double_t CY[8];
19  Double_t R[8];
20 };
21 
23  Int_t Nhelix[3];
24  Double_t CX;
25  Double_t CY;
26  Double_t R;
27  Double_t KAPPA[3][16];
28  Double_t FI0[3][16];
29 };
30 
32 
33  public:
36 
38  PndSttTrackFinderReal(Int_t verbose);
39 
41  PndSttTrackFinderReal(int istamp, bool iplot, bool doMcComparison);
42 
44  PndSttTrackFinderReal(int istamp, bool iplot, bool doMcComparison, bool doSciTil);
45 
47  virtual ~PndSttTrackFinderReal();
48 
50  virtual void Init();
51 
54  void WriteHistograms();
55 
57  virtual Int_t DoFind(TClonesArray *trackCandArray, TClonesArray *trackArray, TClonesArray *helixHitArray);
58  virtual Int_t DoFind(TClonesArray *mHitArray, TClonesArray *mHelixHitArray);
59 
60  virtual void AddHitCollection(TClonesArray *mHitArray, TClonesArray *mPointArray)
61  {
62  fHitCollectionList.Add(mHitArray);
63  fPointCollectionList.Add(mPointArray);
64  };
65 
66  void SetTubeArray(TClonesArray *tubeArray) { fTubeArray = tubeArray; };
67 
68  void SetInputBranchName(char *string1)
69  {
70  sprintf(fSttBranch, "%s", string1);
71  return;
72  };
73 
74  void Finish(){};
75 
76  private:
77  static const Short_t nmaxHits = 1000, // max hits total.
78  nmaxHitsInTrack = 60,
79  nmaxSciTilHits = 200, // max SciTil hits total.
80  nmaxSciTilHitsinTrack = 2, // max SciTil hits in one track.
81  MAXMCTRACKS = 10000, MAXTRACKSPEREVENT = 50, MAXHITSINCELL = 50, nmaxinclinationversors = 20, nAdmittedRadia = 3, nbinCX = 100, nbinCY = 100, nbinZ = 100, nbinR = 100,
82  nbinD = 250, nbinFi = 250, nbinKAPPA = 200, nbinFI0 = 200, MINIMUMCOUNTSDFiR = 18, MINIMUMCOUNTSKAPPAFI0 = 5, MAXElementsOverThresholdinHough = 500,
83  nRdivConformal = 10, NHITSINFIT = 15,
84  DELTAnR = 2; // defines the range of nR in PndSttTrkAssociatedParallelHitsToHelixBis
85 
86  static const Double_t PI = 3.141592654,
87  RStrawDetectorMin = 16.119, // minimum radius of the Stt detector in cm
88  ApotemaMaxInnerParStraw = 23.246827,
89  ApotemaMinSkewStraw = 23.246827, // delimitation of the skew area
90  ApotemaMaxSkewStraw = 31.517569, // delimitation of the skew area
91  ApotemaMinOuterParStraw = 31.863369,
92  RStrawDetectorMax = 40.73, // maximum radius of the Stt detector in cm
93  VERTICALGAP = 4., // in cm, the gap between Left and Right sections of the
94  // Central Detector.
95  Rmin = 20., Rmax = 700., PMAX = 100., STRAWRADIUS = 0.5, StrawDriftError = 0.02, SKEWinclination_DEGREES = 3., CXmin = -150., CXmax = 150., CYmin = -300., CYmax = 300.,
96  Dmin = -21., Dmax = 21., KAPPAmin = -2., KAPPAmax = 2., Zmin = -75., Zmax = 75., DELTA_R = 5., DELTA_Fi = 0.3, DELTA_D = 2., DELTA_KAPPA = 0.03,
97  DELTA_FI0 = 0.3,
98  RMAXSCITIL = 50., // cm
99  DIMENSIONSCITIL = 2.85, // cm
100  BFIELD = 2., // in Tesla
101  CVEL = 2.99792; // velocity of light
102  static const bool YesClean = false;
103  bool YesSciTil, InclusionListSciTil[nmaxSciTilHits];
104 
105  static const Short_t nFidivConformal = (Short_t)(3.141592654 * 45. / 0.5);
106 
107  static const int nmassimo = 50,
108  TIMEOUT = 60; // timeout in seconds for the GLPK fitting.
109 
110  int IVOLTE;
111 
112  bool iplotta, doMcComparison, TypeConf[MAXTRACKSPEREVENT];
113 
114  int istampa;
115 
116  TH1F *hdist, *hdistgoodlast, *hdistbadlast;
117 
118  FILE *HANDLE;
119  FILE *HANDLE2;
120  FILE *HANDLEXYZ;
121  FILE *PHANDLEX;
122  FILE *PHANDLEY;
123  FILE *PHANDLEZ;
124  FILE *SHANDLEX;
125  FILE *SHANDLEY;
126  FILE *SHANDLEZ;
127  Double_t veritaMC[nmaxHits][3];
128 
129  Short_t MINIMUMHITSPERTRACK, MINIMUMOUTERHITSPERTRACK, nRdivConformalEffective, nSciTilHits, nSttSkewhit, infoparal[nmaxHits], infoskew[nmaxHits],
130  nHitsInMCTrack[MAXTRACKSPEREVENT], nSciTilHitsinTrack[MAXTRACKSPEREVENT], nSttSkewhitInMCTrack[MAXTRACKSPEREVENT],
131  ListSciTilHitsinTrack[MAXTRACKSPEREVENT][nmaxSciTilHitsinTrack];
132 
133  Short_t nMCTracks;
134 
135  Double_t Fimin, Fimax, FI0min, FI0max, stepD, stepFi, stepR, stepKAPPA, stepFI0, stepfineKAPPA, stepfineFI0, SEMILENGTH_STRAIGHT, ZCENTER_STRAIGHT, ALFA[MAXTRACKSPEREVENT],
136  BETA[MAXTRACKSPEREVENT], GAMMA[MAXTRACKSPEREVENT], radiaConf[nRdivConformal], CxMC[MAXTRACKSPEREVENT], CyMC[MAXTRACKSPEREVENT], R_MC[MAXTRACKSPEREVENT],
137  posizSciTil[nmaxSciTilHits][3], S_SciTilHitsinTrack[MAXTRACKSPEREVENT][nmaxSciTilHits];
138 
139  TClonesArray *fMCTrackArray, *fSciTPointArray, *fSciTHitArray;
140 
141  TClonesArray *fTubeArray;
142  PndMCTrack *pMCtr;
143 
144  TList fHitCollectionList;
145  TList fPointCollectionList;
146 
147  PndSttHit *GetHitFromCollections(Int_t hitCounter);
148  FairMCPoint *GetPointFromCollections(Int_t hitCounter);
149  TClonesArray *fSttHitArray;
150 
152  char fSttBranch[100];
153 
154  void Initialization_ClassVariables();
155 
156  void PndSttFromXYtoConformal(Double_t trajectory_vertex[3], Double_t info[][7], Int_t Nparal, Double_t infoparalConformal[][5], Int_t *status);
157 
158  void PndSttFromXYtoConformal2(Double_t trajectory_vertex[3], Short_t nHitsinTrack, Short_t iExclude, Short_t *ListHits, Double_t info[][7], Double_t auxinfoparalConformal[][5],
159  Int_t *status);
160 
161  void PndSttBoxConformalFilling(bool ExclusionList[nmaxHits], Double_t infoparalConformal[][5], Int_t Nparal, Short_t nBoxConformal[nRdivConformal][nFidivConformal],
162  Short_t HitsinBoxConformal[][nRdivConformal][nFidivConformal], Short_t RConformalIndex[nmaxHits], Short_t FiConformalIndex[nmaxHits]);
163 
164  void Merge_Sort(Short_t n_ele, Double_t *array, Short_t *ind);
165 
166  void Merge(Short_t nl, Double_t *left, Short_t *ind_left, Short_t nr, Double_t *right, Short_t *ind_right, Double_t *result, Short_t *ind);
167 
168  Short_t PndSttFindTrackPatterninBoxConformal(Short_t NRCELLDISTANCE, Short_t NFiCELLDISTANCE, Short_t Nparal,
169  Short_t ihit, // seed hit;
170  Short_t nRcell, // R cell of the seed hit;
171  // can be negative beacuse of SciTil hits;
172  Short_t nFicell, // Fi cell of the seed hit;
173  Double_t info[][7], bool Exclusion_List[nmaxHits], Short_t RConformalIndex[nmaxHits], Short_t FiConformalIndex[nmaxHits],
174  Short_t nBoxConformal[nRdivConformal][nFidivConformal], Short_t HitsinBoxConformal[][nRdivConformal][nFidivConformal],
175  Short_t *ListHitsinTrack);
176 
177  Short_t PndSttFindTrackPatterninBoxConformalSpecial(Short_t NRCELLDISTANCE, Short_t NFiCELLDISTANCE, Short_t Nparal, Short_t NparallelToSearch, Short_t iSeed,
178  Short_t *ListHitsinTrackinWhichToSearch, Double_t info[][7], bool InclusionList[nmaxHits], Short_t RConformalIndex[nmaxHits],
179  Short_t FiConformalIndex[nmaxHits], Short_t nBoxConformal[nRdivConformal][nFidivConformal],
180  Short_t HitsinBoxConformal[][nRdivConformal][nFidivConformal], Short_t *OutputListHitsinTrack);
181 
182  Short_t PndSttFindTrackStrictCollection(Short_t NFiCELLDISTANCE,
183  Short_t iSeed, // seed track (parallel notation) as fa as the Fi angle is concerned
184  Short_t NParallelToSearch, // n. of hits to search in ListHitsinTrackinWhichToSearch
185  Short_t *ListHitsinTrackinWhichToSearch, bool ExclusionList[nmaxHits], Short_t FiConformalIndex[nmaxHits],
186  Short_t *OutputListHitsinTrack);
187 
188  //---- questa funzione e'
189  // identica a quella di sttmvd che funziona sia con soli STT hits che con
190  // Stt+Mvd hits.
191  Short_t FitHelixCylinder(Short_t nHitsinTrack, Double_t *Xconformal, Double_t *Yconformal, Double_t *DriftRadiusconformal, Double_t *ErrorDriftRadiusconformal,
192  Double_t rotationangle, Double_t *trajectory_vertex, Short_t NMAX, Double_t *m, Double_t *q, Double_t *ALFA, Double_t *BETA, Double_t *GAMMA,
193  bool *TypeConf);
194 
195  Short_t PndSttFitSZspacebis(Short_t nSttSkewhitinTrack, Double_t *S, Double_t *Z, Double_t *DriftRadius, Double_t FInot, Short_t NMAX, Double_t *m);
196 
197  // rimpiazza la precedente
198  Short_t FitSZspace(Short_t nSkewHitsinTrack, Double_t *S, Double_t *Z, Double_t *DriftRadius, Double_t *ErrorDriftRadius, Double_t FInot, Short_t NMAX, Double_t *emme);
199 
200  Short_t PndSttTrkAssociatedParallelHitsToHelix(Double_t Ox, Double_t Oy, Double_t R, Int_t Nhits, Double_t info[][7],
201  Short_t *auxListHitsinTrack // this is the output
202  );
203 
204  Short_t PndSttTrkAssociatedParallelHitsToHelixQuater(bool ExclusionList[nmaxHits], Double_t m, Double_t q, Short_t Status, Short_t nHitsinTrack, Short_t *ListHitsinTrack,
205  Int_t NhitsParallel, Double_t Ox, Double_t Oy, Double_t R, Double_t info[][7], Double_t infoparalConformal[][5],
206  Short_t *RConformalIndex, Short_t *FiConformalIndex, Short_t nBoxConformal[nRdivConformal][nFidivConformal],
207  Short_t HitsinBoxConformal[][nRdivConformal][nFidivConformal], Short_t *auxListHitsinTrack);
208 
209  Short_t PndSttTrkAssociatedParallelHitsToHelix5(bool ExclusionList[nmaxHits], Int_t NhitsParallel, Double_t Ox, Double_t Oy, Double_t R, Double_t info[][7], Double_t Fi_low,
210  Double_t Fi_up, Short_t *auxListHitsinTrack);
211 
212  bool PndSttAcceptHitsConformal(Double_t distance, Double_t DriftConfR, Double_t StrawConfR);
213 
214  CalculatedCircles PndSttTrkFindCircles(Double_t, Double_t, Double_t, Double_t, Double_t, Double_t, Double_t, Double_t, Double_t);
215 
216  CalculatedHelix PndSttTrkFindHelix(Double_t Ox, Double_t Oy, Double_t R, Double_t Zcenter1, Double_t Zcenter2, Double_t Zcenter3, Double_t semilengthStraight1,
217  Double_t semilengthStraight2, Double_t semilengthStraight3, Double_t C0x1, Double_t C0y1, Double_t C0z1, Double_t semilengthSkew1, Double_t r1,
218  Double_t vx1, Double_t vy1, Double_t vz1, Double_t C0x2, Double_t C0y2, Double_t C0z2, Double_t semilengthSkew2, Double_t r2, Double_t vx2,
219  Double_t vy2, Double_t vz2, Int_t *STATUS);
220 
221  void calculateintersections(Double_t Ox, Double_t Oy, Double_t R, Double_t C0x, Double_t C0y, Double_t C0z, Double_t r, Double_t vx, Double_t vy, Double_t vz, Int_t *STATUS,
222  Double_t *POINTS);
223 
224  void plottamentiParalleleGenerali(Int_t Nremaining, Float_t *RemainingR, Float_t *RemainingD, Float_t *RemainingFi, Float_t *RemainingCX, Float_t *RemainingCY, bool *Goodflag);
225 
226  void plottamentiParalleleconMassimo(char *tipo, Int_t nMaxima, Int_t Nremaining, Float_t *RemainingR, Float_t *RemainingD, Float_t *RemainingFi, Float_t *RemainingCX,
227  Float_t *RemainingCY, Double_t Rup, Double_t Rlow, Double_t Dup, Double_t Dlow, Double_t Fiup, Double_t Filow);
228 
229  bool iscontiguous(int ncomponents, Short_t *vec1, Short_t *vec2);
230 
231  void clustering2(Short_t vec1[2], // input
232  int nListElements, Short_t List[][2], // input
233  int &nClusterElementsFound, Short_t ClusterElementsFound[][2], // output
234  int &nRemainingElements, Short_t RemainingElements[][2] // output
235  );
236 
237  void clustering3(Short_t vec1[3], // input
238  int nListElements, Short_t List[][3], // input
239  int &nClusterElementsFound, Short_t ClusterElementsFound[][3], // output
240  int &nRemainingElements, Short_t RemainingElements[][3] // output
241  );
242 
243  void WriteMacroParallelAssociatedHits(Double_t Ox, Double_t Oy, Double_t R, Short_t Nhits, Short_t ListHitsinTrack[MAXTRACKSPEREVENT][nmaxHitsInTrack], Double_t info[][7],
244  Int_t Nincl, Int_t Minclinations[], Double_t inclination[][3], Short_t imaxima, Int_t sequencial, Short_t nscitilhitsintrack,
245  Short_t *listscitilhitsintrack);
246 
247  void WriteMacroParallelAssociatedHitswithMC(Double_t Ox, Double_t Oy, Double_t R, Short_t TrackFoundaTrackMC, Short_t Nhits,
248  Short_t ListHitsinTrack[MAXTRACKSPEREVENT][nmaxHitsInTrack], Double_t info[][7], Short_t ifoundtrack, Int_t sequentialNTrack,
249  Short_t nscitilhitsintrack, Short_t *listscitilhitsintrack, Short_t nParalCommon[MAXTRACKSPEREVENT],
250  Short_t ParalCommonList[MAXTRACKSPEREVENT][nmaxHits], Short_t nSpuriParinTrack[MAXTRACKSPEREVENT],
251  Short_t ParSpuriList[MAXTRACKSPEREVENT][nmaxHits], Short_t nMCParalAlone[MAXTRACKSPEREVENT],
252  Short_t MCParalAloneList[MAXTRACKSPEREVENT][nmaxHits]);
253  void WriteMacroParallelHitsGeneral(bool *keepit, Int_t Nhits, Double_t info[][7], Int_t Nincl, Int_t Minclinations[], Double_t inclination[][3], Short_t nTracksFoundSoFar);
254 
255  void WriteMacroParallelHitsGeneralConformalwithMC(bool *keepit, Int_t Nhits, Double_t info[][7], Int_t Nincl, Int_t Minclinations[], Double_t inclination[][3],
256  Short_t nTracksFoundSoFar);
257 
258  void WriteMacroParallelHitsConformalwithMCspecial(Int_t Nhits, Double_t auxinfoparalConformal[][5], Short_t nTracksFoundSoFar, Short_t Status, Double_t *trajectory_vertex);
259 
260  void WriteMacroSkewAssociatedHits(bool goodskewfit, Double_t KAPPA, Double_t FI0, Double_t D, Double_t Fi, Double_t R, Double_t info[][7], Int_t Nincl, Int_t Minclinations[],
261  Double_t inclination[][3], Int_t imaxima, Int_t sequentialNTrack, Short_t nSttSkewhitinTrack,
262  Short_t ListSkewHitsinTrack[MAXTRACKSPEREVENT][nmaxHitsInTrack], Short_t nscitilhits, Double_t *ESSE, Double_t *ZETA);
263 
264  void WriteMacroSkewAssociatedHitswithMC(bool goodskewfit, Double_t KAPPA, Double_t FI0, Double_t D, Double_t Fi, Double_t R, Double_t info[][7], Int_t Nincl,
265  Int_t Minclinations[], Double_t inclination[][3], Int_t imaxima, Int_t sequentialNTrack, Short_t nSttSkewhitinTrack,
266  Short_t ListSkewHitsinTrack[MAXTRACKSPEREVENT][nmaxHitsInTrack], Short_t nSkewCommon, Short_t SkewCommonList[MAXTRACKSPEREVENT][nmaxHits],
267  Short_t daTrackFoundaTrackMC, Short_t nMCSkewAlone[MAXTRACKSPEREVENT], Short_t MCSkewAloneList[MAXTRACKSPEREVENT][nmaxHits],
268  Short_t nscitilhits, Double_t *ESSE, Double_t *ZETA
269 
270  );
271 
272  Short_t AssociateSkewHitsToXYTrack(bool *ExclusionListSkew, Double_t Ox, Double_t Oy, Double_t R, Double_t info[][7], Double_t inclination[][3], Double_t Fi_low_limit,
273  Double_t Fi_up_limit,
274  // Double_t Fi_allowedforskew_low,
275  // Double_t Fi_allowedforskew_up,
276  Short_t Charge, Double_t Fi_initial_helix_referenceframe, Double_t Fi_final_helix_referenceframe,
277  Short_t SkewList[nmaxHits][2], // output, list of selected skew hits (in skew numbering)
278  Double_t *S, // output, S coordinate of selected Skew hit
279  Double_t *Z, // output, Z coordinate of selected Skew hit
280  Double_t *ZDrift, // output, drift distance IN Z DIRECTION only, of selected Skew hit
281  Double_t *ZRadiusafterTilt // output, Radius taking into account the tilt, IN Z DIRECTION only, of selected Skew hit
282  );
283 
284  Short_t AssociateBetterAfterFitSkewHitsToXYTrack(Short_t TemporarynSttSkewhitinTrack,
285  Short_t SkewList[nmaxHits][2], // input, list of selected skew hits (in skew numbering)
286  Double_t *S, // input, S coordinate of selected Skew hit
287  Double_t *Z, // input, Z coordinate of selected Skew hit
288  Double_t *ZDrift, // input, drift distance IN Z DIRECTION only, of selected Skew hit
289  Double_t *ZRadiusafterTilt, // input, Radius taking into account the tilt, IN Z DIRECTION only, of selected Skew hit
290  Double_t KAPPA, // input, KAPPA result of fit
291  Double_t FI0, // input, FI0 result of fit
292  Short_t *tempore,
293  Double_t *temporeS, // output, associated skew hit S
294  Double_t *temporeZ, // output, associated skew hits Z
295  Double_t *temporeZDrift, // output, associated skew hit Z drift
296  Double_t *temporeZErrorafterTilt, // output, associated skew hits Z error after tilt
297  Int_t *STATUS // output
298  );
299 
300  void PndSttOrderingParallel(Double_t oX, Double_t oY, Double_t info[][7], Short_t nParallelHits, Short_t *ListParallelHits, Short_t *Infoparal, Short_t Charge,
301  Double_t *Fi_initial_helix_referenceframe, Double_t *Fi_final_helix_referenceframe, Double_t *U, Double_t *V);
302 
303  void PndSttOrderingSkewandParallel(Short_t *Infoparal, Short_t *Infoskew, Double_t oX, Double_t oY, Double_t Rr, Short_t nSttSkewhit, Short_t *ListSkewHits, Double_t *SList,
304  Short_t Charge, Short_t nParHits, Short_t *ListParHits, Double_t *U, Double_t *V, Short_t *BigList
305 
306  );
307 
308  void PndSttOrdering(Double_t oX, Double_t oY, Double_t info[][7], Short_t nParallelHits, Short_t *ListParallelHits, Short_t nSttSkewhit, Short_t *ListSkewHits, Double_t *S,
309  Short_t *Infoparal, Short_t *Infoskew, Short_t *nTotal, Short_t *BigList, Short_t *Charge);
310 
311  void PndSttFindingParallelTrackAngularRange(Double_t oX, Double_t oY, Double_t r, Short_t Charge,
312  Double_t *Fi_low_limit, // Fi (in XY Helix frame) lower limit using
313  // the Stt detector minimum/maximum radius
314  // Fi_low_limit is ALWAYS between 0. and 2PI
315  Double_t *Fi_up_limit, // Fi (in XY Helix frame) upper limit using
316  // the Stt detector maximum/minimum radius
317  // Fi_up_limit is ALWAYS > Fi_low_limit and
318  // possibly > 2PI.
319  Short_t *status,
320  Double_t Rmin, // Rmin of cylindrical volume intersected by track;
321  Double_t Rmax // Rmax of cylindrical volume intersected by track;
322  );
323 
324  void WriteMacroParallelHitswithRfromMC(Int_t Nhits, Double_t info[][7], Short_t nTracksFoundSoFar,
325  // bool *TypeConf,
326  Double_t *Ox, Double_t *Oy, Short_t *daParTrackFoundaTrackMC);
327 
328  void WriteMacroSkewAssociatedHitswithRfromMC(Double_t KAPPA, Double_t FI0, Double_t D, Double_t Fi, Double_t R, Int_t Nhits, Double_t info[][7], Int_t Nincl,
329  Int_t Minclinations[], Double_t inclination[][3], Int_t imaxima, Int_t nMaxima);
330 
331  void AssociateFoundTrackstoMC(Double_t info[][7], Short_t nTracksFoundSoFar, Short_t *nHitsinTrack, Short_t ListHitsinTrack[MAXTRACKSPEREVENT][nmaxHits],
332  Short_t *nSttSkewhitinTrack, Short_t ListSkewHitsinTrack[MAXTRACKSPEREVENT][nmaxHits], Short_t daTrackFoundaTrackMC[MAXTRACKSPEREVENT]);
333 
334  void AssociateFoundTrackstoMCbis(bool *keepit, Double_t info[][7], Short_t nTracksFoundSoFar, Short_t nHitsinTrack[MAXTRACKSPEREVENT],
335  Short_t ListHitsinTrack[MAXTRACKSPEREVENT][nmaxHitsInTrack], Short_t nSttSkewhitinTrack[MAXTRACKSPEREVENT],
336  Short_t ListSkewHitsinTrack[MAXTRACKSPEREVENT][nmaxHitsInTrack], Short_t daTrackFoundaTrackMC[MAXTRACKSPEREVENT]);
337 
338  void PndSttInfoXYZParal(Double_t info[][7], Short_t infopar, Double_t Ox, Double_t Oy, Double_t R, Double_t KAPPA, Double_t FI0, Short_t Charge,
339  Double_t *Posiz // output
340  );
341 
342  void PndSttInfoXYZSkew(Double_t Z, // Z coordinate of selected Skew hit
343  Double_t ZDrift, // drift distance IN Z DIRECTION only, of Skew hit
344  Double_t S, Double_t Ox, Double_t Oy, Double_t R, Double_t KAPPA, Double_t FI0, Short_t Charge,
345  Double_t *Posiz // output
346  );
347 
348  void FixDiscontinuitiesFiangleinSZplane(Short_t TemporarynSttSkewhitinTrack, Double_t *S, Double_t *Fi_initial_helix_referenceframe, Short_t Charge);
349 
350  void FindCharge(Double_t oX, Double_t oY, Short_t nParallelHits, Double_t *X, Double_t *Y, Short_t *Charge);
351 
352  bool SttParalCleanup(Double_t GAP, Double_t Oxx, Double_t Oyy, Double_t Rr, Short_t Charge, Double_t Start[3], Double_t FI0, Double_t FiLimitAdmissible, Short_t nHits,
353  Short_t *Listofhits, Double_t info[][7], Double_t RStrawDetMin, Double_t RStrawDetInnerParMax, Double_t RStrawDetOuterParMin, Double_t RStrawDetMax);
354 
355  bool SttSkewCleanup(Double_t GAP, Double_t Oxx, Double_t Oyy, Double_t Rr, Short_t Charge, Double_t Start[3], Double_t FI0, Double_t FiLimitAdmissible, Short_t nHits,
356  Short_t *Listofhits, Double_t *S, Double_t info[][7], Double_t RminStrawSkew, Double_t RmaxStrawSkew,
357  Double_t cut, // cut distance (in cm).
358  Short_t maxnum // max number allowed of failures to pass the cut.
359  );
360 
361  bool BadTrack_ParStt(Double_t Oxx, Double_t Oyy, Double_t Rr, Short_t Charge,
362  Double_t Xcross[2], // Xcross[0]=point of entrance;
363  // Xcross[1]=point of exit.
364  Double_t Ycross[2], Short_t nHits, Short_t *ListHits, Double_t info[][7], Double_t cut, Short_t maxnum,
365  Short_t islack // uncertainty allowed as far as
366  // the n. of hits that should be present.
367  );
368 
369  Short_t IntersectionsWithClosedPolygon(Double_t Ox, Double_t Oy, Double_t R,
370  Double_t Rmi, // Rmin of cylindrical volume intersected by track;
371  Double_t Rma, // Rmax of cylindrical volume intersected by track;
372 
373  //-------- outputs
374  Short_t nIntersections[2], Double_t XintersectionList[][2], Double_t YintersectionList[][2]);
375  Short_t IntersectionsWithOpenPolygon(Double_t Ox, // Track parameter
376  Double_t Oy, // Track parameter
377  Double_t R, // Track parameter
378  Short_t nSides, // input, n. of Sides of open Polygon.
379  Double_t *a, // coefficient of formula : aX + bY + c = 0 defining
380  Double_t *b, // the Polygon sides.
381  Double_t *c,
382  Double_t *side_x, // X,Y coordinate of the Sides vertices (in sequence, following
383  Double_t *side_y, // the Polygon along.
384  //-------- outputs
385  Double_t *XintersectionList, // XintersectionList
386  Double_t *YintersectionList // YintersectionList.
387  );
388  Short_t IntersectionsWithClosedbiHexagonLeft(Double_t vgap, Double_t Ox, Double_t Oy, Double_t R,
389  Double_t Ami, // Apotema min of inner Hexagon;
390  Double_t Ama, // Apotema max of outer Hexagon;
391 
392  //-------- outputs
393  Short_t *nIntersections, Double_t *XintersectionList, Double_t *YintersectionList);
394 
395  Short_t IntersectionsWithClosedbiHexagonRight(Double_t vgap, Double_t Ox, Double_t Oy, Double_t R,
396  Double_t Ami, // Apotema min of inner Hexagon;
397  Double_t Ama, // Apotema max of outer Hexagon;
398 
399  //-------- outputs
400  Short_t *nIntersections, Double_t *XintersectionList, Double_t *YintersectionList);
401 
402  bool IntersectionCircle_Segment(Double_t a, // coefficients implicit equation.
403  Double_t b, // of segment : a*x + b*y + c =0.
404  Double_t c,
405  Double_t P1x, // point delimiting the segment.
406  Double_t P2x, // point delimiting the segment.
407  Double_t P1y, // point delimiting the segment.
408  Double_t P2y, // point delimiting the segment.
409  Double_t Ox, // center of circle.
410  Double_t Oy,
411  Double_t R, // Radius of circle.
412  Short_t *Nintersections, Double_t XintersectionList[2], Double_t YintersectionList[2], Double_t *distance);
413 
414  bool IntersectionSciTil_Circle(Double_t posizSciTilx, Double_t posizSciTily,
415  Double_t Oxx, // center of circle.
416  Double_t Oyy,
417  Double_t Rr, // Radius of circle.
418  Short_t *Nintersections, Double_t XintersectionList[2], Double_t YintersectionList[2]);
419 
420  Short_t IntersectionsWithGapSemicircle(Double_t Oxx, Double_t Oyy, Double_t Rr, Double_t gap, bool left, Double_t Rma, Double_t *XintersectionList, Double_t *YintersectionList);
421 
422  bool IsInternal(Double_t Px, // point
423  Double_t Py, Double_t Xtraslation, Double_t Ytraslation, Double_t Theta);
424 
425  void ChooseEntranceExit(Double_t Oxx, Double_t Oyy, Short_t flag, Short_t Charge, Double_t FiStart, Short_t nIntersections[2], Double_t XintersectionList[][2],
426  Double_t YintersectionList[][2],
427  Double_t Xcross[2], // output
428  Double_t Ycross[2] // output
429  );
430 
431  void ChooseEntranceExitbis(Double_t Oxx, Double_t Oyy, Short_t Charge, Double_t FiStart, Short_t nIntersections, Double_t *XintersectionList, Double_t *YintersectionList,
432  Double_t Xcross[2], // output
433  Double_t Ycross[2] // output
434  );
435 
436  Short_t FindTrackEntranceExitbiHexagon(Double_t Oxx, Double_t Oyy, Double_t Rr, Short_t Charge, Double_t Start[3],
437  Double_t ApotemaMin, // Apotema=distance Hexagon side from (0,0).
438  Double_t ApotemaMax, Double_t Xcross[2], Double_t Ycross[2]);
439 
440  Short_t FindTrackEntranceExitbiHexagonLeft(Double_t vgap, Double_t Oxx, Double_t Oyy, Double_t Rr, Short_t Charge, Double_t Start[3],
441  Double_t ApotemaMin, // Apotema=distance Hexagon side from (0,0).
442  Double_t ApotemaMax, Double_t Xcross[2], Double_t Ycross[2]);
443 
444  Short_t FindTrackEntranceExitbiHexagonRight(Double_t vgap, Double_t Oxx, Double_t Oyy, Double_t Rr, Short_t Charge, Double_t Start[3],
445  Double_t ApotemaMin, // Apotema=distance Hexagon side from (0,0).
446  Double_t ApotemaMax, Double_t Xcross[2], Double_t Ycross[2]);
447 
448  void SeparateInnerOuterParallel(
449 
450  // input
451  Short_t nHits, Short_t *ListHits, Double_t info[][7], Double_t RStrawDetInnerParMax,
452 
453  // output
454  Short_t *nInnerHits, Short_t *ListInnerHits, Short_t *nOuterHits, Short_t *ListOuterHits,
455 
456  Short_t *nInnerHitsLeft, Short_t *ListInnerHitsLeft, Short_t *nInnerHitsRight, Short_t *ListInnerHitsRight,
457 
458  Short_t *nOuterHitsLeft, Short_t *ListOuterHitsLeft, Short_t *nOuterHitsRight, Short_t *ListOuterHitsRight
459 
460  );
461 
462  Short_t FindTrackEntranceExitHexagonCircle(Double_t Oxx, Double_t Oyy, Double_t Rr, Short_t Charge, Double_t Start[3],
463  Double_t ApotemaMin, // Apotema=distance Hexagon side from (0,0).
464  Double_t ApotemaMax, Double_t Xcross[2], Double_t Ycross[2]);
465  Short_t FindTrackEntranceExitHexagonCircleLeft(Double_t Oxx, Double_t Oyy, Double_t Rr, Short_t Charge, Double_t Start[3],
466  Double_t ApotemaMin, // Apotema=distance Hexagon side from (0,0).
467  Double_t ApotemaMax, Double_t GAP, Double_t Xcross[2], Double_t Ycross[2]);
468  Short_t FindTrackEntranceExitHexagonCircleRight(Double_t Oxx, Double_t Oyy, Double_t Rr, Short_t Charge, Double_t Start[3],
469  Double_t ApotemaMin, // Apotema=distance Hexagon side from (0,0).
470  Double_t ApotemaMax, Double_t GAP, Double_t Xcross[2], Double_t Ycross[2]);
471  Short_t FindIntersectionsOuterCircle(Double_t Oxx, Double_t Oyy, Double_t Rr, Double_t RMax, Double_t Xcross[2], Double_t Ycross[2]);
472 
473  bool IsInsideArc(Double_t Oxx, Double_t Oyy, Short_t Charge, Double_t Xcross[2], Double_t Ycross[2], Double_t Spoint);
474 
475  bool IsInTargetPipe(Double_t Oxx, Double_t Oyy, Double_t Rr, Double_t fi0, Double_t kappa, Short_t charge, Double_t gap);
476 
477  Double_t CalculateArcLength(Double_t Oxx, Double_t Oyy, Double_t Rr, Short_t Charge,
478  Double_t Xcross[2], // entrance-exit point
479  Double_t Ycross[2] // entrance-exit point
480  );
481 
482  void OrderingUsingConformal(Double_t oX, Double_t oY, Int_t nHits, Double_t XY[][2],
483  Int_t Charge, // input
484  Short_t *ListHits);
485 
486  bool FindTrackInXYProjection(Short_t iHit, // seed hit; it is negative for SciTil Hits.
487  Short_t nRcell, // R cell of seed hit;negative for SciTil hits.
488  Short_t nFicell, // Fi cell of the seed hit;
489  Int_t *Minclinations, Double_t info[nmaxHits][7], bool *ExclusionList, Short_t *RConformalIndex, Short_t *FiConformalIndex,
490  Short_t nBoxConformal[nRdivConformal][nFidivConformal], Short_t HitsinBoxConformal[MAXHITSINCELL][nRdivConformal][nFidivConformal],
491  Short_t nTracksFoundSoFar, Short_t *nHitsinTrack, Short_t ListHitsinTrack[MAXTRACKSPEREVENT][nmaxHitsInTrack], Double_t *trajectory_vertex,
492  Double_t infoparalConformal[nmaxHits][5], Double_t posizSciTilx, Double_t posizSciTily, Double_t *S, Double_t *Ox, Double_t *Oy, Double_t *R,
493  Double_t *Fi_low_limit, Double_t *Fi_up_limit, Double_t *Fi_initial_helix_referenceframe, Double_t *Fi_final_helix_referenceframe, Short_t *Charge,
494  Double_t *U, Double_t *V);
495 
496  Short_t AssociateSciTilHit(Double_t Oxx, Double_t Oyy, Double_t Rr,
497  Short_t *List, // output, list of SciTil hits associated (max. 2);
498  Double_t *esse // output, list of S of the SciTil hits associated.
499  );
500 
501  void disegnaSciTilHit(FILE *MACRO, int ScitilHit, double posx, double posy, int tipo);
502 
503  void disegnaAssiXY(FILE *MACRO, double xmin, double xmax, double ymin, double ymax);
504 
505  //----------------------------------------------
506 
507  ClassDef(PndSttTrackFinderReal, 1);
508 };
509 
510 #endif
const int TIMEOUT
const Double_t PMAX
__m128 m
Definition: P4_F32vec4.h:26
virtual void AddHitCollection(TClonesArray *mHitArray, TClonesArray *mPointArray)
void SetInputBranchName(char *string1)
const Double_t BFIELD
const int MAXHITSINCELL
const Double_t SEMILENGTH_STRAIGHT
const Double_t PI
const Double_t STRAWRADIUS
const Double_t DELTAnR
const Double_t VERTICALGAP
void SetTubeArray(TClonesArray *tubeArray)
const Double_t CVEL
const Double_t ZCENTER_STRAIGHT
int status[10]
Definition: f_Init.h:24
const Double_t DIMENSIONSCITIL