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