FairRoot/PandaRoot
PndTrkSttConformalFilling.cxx
Go to the documentation of this file.
2 #include "PndTrkVectors.h"
3 #include <cmath>
4 #include <iostream>
5 // Root includes
6 #include "TROOT.h"
7 
8 using namespace std;
9 
10 #define PI 3.141592654
11 
12 //----------begin of function PndTrkSttConformalFilling::BoxConformalFilling
13 
15  Vec <Short_t>& FiConformalIndex,
16  Vec <Short_t>& HitsinBoxConformal,
17  bool *InclusionListStt,
18  Double_t infoparalConformal[][5],
19  Short_t *ListSttParHits,
20  Short_t MAXHITSINCELL,
21  Vec <Short_t>& nBoxConformal,
22  Short_t NFIDIVCONFORMAL,
23  Int_t Nparal,
24  Short_t NRDIVCONFORMAL,
25  Double_t *radiaConf,
26  Vec <Short_t>& RConformalIndex
27  )
28 {
29 
30  Short_t
31  bi_index,
32  i,
33  iFi,
34  iR,
35  j,
36  tri_index;
37 
38  Double_t Fi;
39 
40 
41 
42  // initialize nBoxConformal (each event);
43  for(j = 0; j< NFIDIVCONFORMAL*NRDIVCONFORMAL ; j++){
44  nBoxConformal[j]= 0;
45  }
46 
47  // fill the nBoxConformal and the list contained in HitsinBoxConformal with
48  // all the axial straw hits;
49  for(i = 0; i< Nparal ; i++){
50 
51  if( ! InclusionListStt[ ListSttParHits[i] ] ) continue;
52  Fi = atan2(infoparalConformal[ListSttParHits[i]][1],
53  infoparalConformal[ListSttParHits[i]][0]) ;
54  if ( Fi < 0. ) Fi += 2.*PI;
55  iFi = (Short_t) (0.5*NFIDIVCONFORMAL*Fi/PI);
56  if(iFi > NFIDIVCONFORMAL ) {
57  iFi = NFIDIVCONFORMAL;
58  } else if (iFi<0) {
59  iFi = 0;
60  }
61 
62 
63 
64  Double_t RRR = sqrt(infoparalConformal[ListSttParHits[i]][0]*
65  infoparalConformal[ListSttParHits[i]][0]+
66  infoparalConformal[ListSttParHits[i]][1]*
67  infoparalConformal[ListSttParHits[i]][1]);
68 
69  for(j=NRDIVCONFORMAL-1, iR=0; j>0; j--){
70  if( RRR> radiaConf[j] ){
71  iR = j;
72  break;
73  }
74  }
75 
76 
77  bi_index = iR*NFIDIVCONFORMAL+iFi;
78  tri_index = nBoxConformal[bi_index]*NRDIVCONFORMAL*NFIDIVCONFORMAL + bi_index;
79  if( nBoxConformal[bi_index] >= MAXHITSINCELL ){
80  cout<<"Warning from PndTrkSttConformalFilling::BoxConformalFilling\t:"
81  <<"\n\tcontent in nBoxConformal["<<iR<<"]["<<
82  iFi<<"] has reached the Max allowed value = "
83  <<MAXHITSINCELL<<endl;
84  continue;
85  }
86  HitsinBoxConformal[ tri_index ] = (Short_t) ListSttParHits[i];
87  nBoxConformal[bi_index]++;
88  RConformalIndex[ ListSttParHits[i] ] = iR;
89  FiConformalIndex[ ListSttParHits[i] ] = iFi;
90 
91 
92 
93  } // end of for(i = 0; i< Nparal ; i++)
94 
95  return;
96 
97 }
98 //----------end of function PndTrkSttConformalFilling::BoxConformalFilling
99 
100 
101 
102 
103 
104 //----------begin of function PndTrkSttConformalFilling::FromXYtoConformal
105 
107  Double_t trajectory_vertex[2],
108  Double_t info[][7],
109  Short_t *ListSttParHits,
110  Int_t Nparal,
111  Double_t infoparalConformal[][5],
113  )
114 {
115 
116 
117 // do the transformation in the conformal space : u= x/(x**2+y**2), v= y/(x**2+y**2) for each hit from parallel
118 // straws; also the equidrift radius changes.
119 
120 //
121 
122  Short_t
123  i;
124 
125  Double_t
126  gamma,
127  r,
128  x,
129  y;
130 
131  for(i=0; i<Nparal; i++){
132  x = info[ListSttParHits[i]][0]-trajectory_vertex[0];
133  y = info[ListSttParHits[i]][1]-trajectory_vertex[1];
134  r = info[ListSttParHits[i]][3];
135  gamma = x*x + y*y - r*r;
136  infoparalConformal[ListSttParHits[i]][0] = x / gamma;
137  infoparalConformal[ListSttParHits[i]][1] = y / gamma;
138  infoparalConformal[ListSttParHits[i]][2] = r/fabs(gamma);
139  // n. of the Hit (in the original order)
140  infoparalConformal[ListSttParHits[i]][3] = ListSttParHits[i] ;
141  infoparalConformal[ListSttParHits[i]][4] = STRAWRADIUS/fabs(gamma);
142 
143  }
144 
145 
146  return;
147 }
148 
149 //----------end of function PndTrkSttConformalFilling::FromXYtoConformal
150 
151 
152 
153 
155 
double r
Definition: RiemannTest.C:14
Int_t i
Definition: run_full.C:25
friend F32vec4 sqrt(const F32vec4 &a)
Definition: P4_F32vec4.h:29
void BoxConformalFilling(Vec< Short_t > &FiConformalIndex, Vec< Short_t > &HitsinBoxConformal, bool *InclusionListStt, Double_t infoparalConformal[][5], Short_t *ListSttParHits, Short_t MAXHITSINCELL, Vec< Short_t > &nBoxConformal, Short_t NFIDIVCONFORMAL, Int_t Nparal, Short_t NRDIVCONFORMAL, Double_t *radiaConf, Vec< Short_t > &RConformalIndex)
const int MAXHITSINCELL
Double_t
const Double_t STRAWRADIUS
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
Double_t x
ClassImp(PndAnaContFact)
void FromXYtoConformal(Double_t trajectory_vertex[2], Double_t info[][7], Short_t *ListSttParHits, Int_t Nparal, Double_t infoparalConformal[][5], Double_t STRAWRADIUS)
Double_t y