39 |
houghtime=0; |
houghtime=0; |
40 |
fittime=0; |
fittime=0; |
41 |
|
|
42 |
}; |
// ntracks=0; |
43 |
//-------------------------------------- |
// al0=0; |
44 |
// |
// al1=0; |
45 |
// |
// al2=0; |
46 |
//-------------------------------------- |
// al3=0; |
47 |
TrkHough::~TrkHough(){ |
// al4=0; |
48 |
|
|
49 |
delete [] alfayz1; |
Candidates = 0; |
50 |
delete [] alfayz2; |
|
|
delete [] db_cloud; |
|
|
|
|
|
delete [] alfaxz1; |
|
|
delete [] alfaxz2; |
|
|
delete [] alfaxz3; |
|
|
delete [] tr_cloud; |
|
|
|
|
|
delete [] alfayz1_av; |
|
|
delete [] alfayz2_av; |
|
|
delete [] ptcloud_yz; |
|
|
|
|
|
delete [] alfaxz1_av; |
|
|
delete [] alfaxz2_av; |
|
|
delete [] alfaxz3_av; |
|
|
delete [] ptcloud_xz; |
|
|
|
|
51 |
}; |
}; |
52 |
//-------------------------------------- |
//-------------------------------------- |
53 |
// |
// |
56 |
/** |
/** |
57 |
* Fills a TrkHough object with values from a struct cTrkhough (to get data from F77 common). |
* Fills a TrkHough object with values from a struct cTrkhough (to get data from F77 common). |
58 |
*/ |
*/ |
59 |
void TrkHough::SetFromHoughStruct(cTrkHough *lh){ |
void TrkHough::SetFromHoughStruct(cTrkHough *lh, cTrkCandidates *lc){ |
60 |
|
|
61 |
ndblt = lh->ndblt_nt; |
if(!lh) return; |
62 |
ntrpt = lh->ntrpt_nt; |
// ------------------------- |
63 |
nclouds_yz = lh->nclouds_yz_nt; |
// fill hough transform info |
64 |
nclouds_xz = lh->nclouds_xz_nt; |
// ------------------------- |
65 |
nclstr = lh->nclstr; |
ndblt = lh->ndblt_nt; |
66 |
totaltime = lh->totaltime; |
ntrpt = lh->ntrpt_nt; |
67 |
houghtime = lh->houghtime; |
nclouds_yz = lh->nclouds_yz_nt; |
68 |
fittime = lh->fittime; |
nclouds_xz = lh->nclouds_xz_nt; |
69 |
|
nclstr = lh->nclstr; |
70 |
alfayz1 = new Float_t[ndblt]; |
totaltime = lh->totaltime; |
71 |
alfayz2 = new Float_t[ndblt]; |
houghtime = lh->houghtime; |
72 |
db_cloud = new Int_t[ndblt]; |
fittime = lh->fittime; |
73 |
for(int i=0; i<ndblt; i++){ |
|
74 |
alfayz1[i] = (Float_t) lh->alfayz1_nt[i]; |
alfayz1 = new Float_t[ndblt]; |
75 |
alfayz2[i] = (Float_t) lh->alfayz2_nt[i]; |
alfayz2 = new Float_t[ndblt]; |
76 |
db_cloud[i] = (Int_t) lh->db_cloud_nt[i]; |
db_cloud = new Int_t[ndblt]; |
77 |
} |
for(int i=0; i<ndblt; i++){ |
78 |
|
alfayz1[i] = (Float_t) lh->alfayz1_nt[i]; |
79 |
alfaxz1 = new Float_t[ntrpt]; |
alfayz2[i] = (Float_t) lh->alfayz2_nt[i]; |
80 |
alfaxz2 = new Float_t[ntrpt]; |
db_cloud[i] = (Int_t) lh->db_cloud_nt[i]; |
81 |
alfaxz3 = new Float_t[ntrpt]; |
} |
82 |
tr_cloud = new Int_t[ntrpt]; |
|
83 |
for(int i=0; i<ntrpt; i++){ |
alfaxz1 = new Float_t[ntrpt]; |
84 |
alfaxz1[i] = (Float_t) lh->alfaxz1_nt[i]; |
alfaxz2 = new Float_t[ntrpt]; |
85 |
alfaxz2[i] = (Float_t) lh->alfaxz2_nt[i]; |
alfaxz3 = new Float_t[ntrpt]; |
86 |
alfaxz3[i] = (Float_t) lh->alfaxz3_nt[i]; |
tr_cloud = new Int_t[ntrpt]; |
87 |
tr_cloud[i] = (Int_t) lh->tr_cloud_nt[i]; |
for(int i=0; i<ntrpt; i++){ |
88 |
} |
alfaxz1[i] = (Float_t) lh->alfaxz1_nt[i]; |
89 |
|
alfaxz2[i] = (Float_t) lh->alfaxz2_nt[i]; |
90 |
|
alfaxz3[i] = (Float_t) lh->alfaxz3_nt[i]; |
91 |
|
tr_cloud[i] = (Int_t) lh->tr_cloud_nt[i]; |
92 |
|
} |
93 |
|
|
94 |
alfayz1_av = new Float_t[nclouds_yz]; |
alfayz1_av = new Float_t[nclouds_yz]; |
95 |
alfayz2_av = new Float_t[nclouds_yz]; |
alfayz2_av = new Float_t[nclouds_yz]; |
96 |
ptcloud_yz = new Int_t[nclouds_yz]; |
ptcloud_yz = new Int_t[nclouds_yz]; |
97 |
for(int i=0; i<nclouds_yz; i++){ |
for(int i=0; i<nclouds_yz; i++){ |
98 |
alfayz1_av[i] = (Float_t) lh->alfayz1_av_nt[i]; |
alfayz1_av[i] = (Float_t) lh->alfayz1_av_nt[i]; |
99 |
alfayz2_av[i] = (Float_t) lh->alfayz2_av_nt[i]; |
alfayz2_av[i] = (Float_t) lh->alfayz2_av_nt[i]; |
100 |
ptcloud_yz[i] = (Int_t) lh->ptcloud_yz_nt[i]; |
ptcloud_yz[i] = (Int_t) lh->ptcloud_yz_nt[i]; |
101 |
} |
} |
102 |
|
|
103 |
alfaxz1_av = new Float_t[nclouds_xz]; |
alfaxz1_av = new Float_t[nclouds_xz]; |
104 |
alfaxz2_av = new Float_t[nclouds_xz]; |
alfaxz2_av = new Float_t[nclouds_xz]; |
105 |
alfaxz3_av = new Float_t[nclouds_xz]; |
alfaxz3_av = new Float_t[nclouds_xz]; |
106 |
ptcloud_xz = new Int_t[nclouds_xz]; |
ptcloud_xz = new Int_t[nclouds_xz]; |
107 |
for(int i=0; i<nclouds_xz; i++){ |
for(int i=0; i<nclouds_xz; i++){ |
108 |
alfaxz1_av[i] = (Float_t) lh->alfaxz1_av_nt[i] ; |
alfaxz1_av[i] = (Float_t) lh->alfaxz1_av_nt[i] ; |
109 |
alfaxz2_av[i] = (Float_t) lh->alfaxz2_av_nt[i]; |
alfaxz2_av[i] = (Float_t) lh->alfaxz2_av_nt[i]; |
110 |
alfaxz3_av[i] = (Float_t) lh->alfaxz3_av_nt[i]; |
alfaxz3_av[i] = (Float_t) lh->alfaxz3_av_nt[i]; |
111 |
ptcloud_xz[i] = (Int_t) lh->ptcloud_xz_nt[i]; |
ptcloud_xz[i] = (Int_t) lh->ptcloud_xz_nt[i]; |
112 |
} |
} |
113 |
|
|
114 |
|
if(!lc) return; |
115 |
|
// -------------------------- |
116 |
|
// fill track candidates info |
117 |
|
// -------------------------- |
118 |
|
// ntracks = lc->ntracks; |
119 |
|
// al0 = new Float_t[ntracks]; |
120 |
|
// al1 = new Float_t[ntracks]; |
121 |
|
// al2 = new Float_t[ntracks]; |
122 |
|
// al3 = new Float_t[ntracks]; |
123 |
|
// al4 = new Float_t[ntracks]; |
124 |
|
// for(int ii=0; ii<ntracks; ii++){ |
125 |
|
// al0[ii] = (Float_t) lc->al[ii][0]; |
126 |
|
// al1[ii] = (Float_t) lc->al[ii][1]; |
127 |
|
// al2[ii] = (Float_t) lc->al[ii][2]; |
128 |
|
// al3[ii] = (Float_t) lc->al[ii][3]; |
129 |
|
// al4[ii] = (Float_t) lc->al[ii][4]; |
130 |
|
// } |
131 |
|
TrkTrack* t_track = new TrkTrack(); |
132 |
|
Candidates = new TClonesArray("TrkTrack"); |
133 |
|
TClonesArray &t = *Candidates; |
134 |
|
for(int i=0; i<lc->ntracks; i++){ |
135 |
|
t_track->seqno = i; |
136 |
|
t_track->image = 0; |
137 |
|
t_track->chi2 = lc->chi2[i]; |
138 |
|
t_track->nstep = 0; |
139 |
|
for(int it1=0;it1<5;it1++){ |
140 |
|
t_track->al[it1] = lc->al[i][it1]; |
141 |
|
for(int it2=0;it2<5;it2++) |
142 |
|
t_track->coval[it1][it2] = 0.; |
143 |
|
}; |
144 |
|
for(int ip=0;ip<6;ip++){ |
145 |
|
// --------------------------------- |
146 |
|
// new implementation of xgood/ygood |
147 |
|
// --------------------------------- |
148 |
|
t_track->xgood[ip] = (Int_t) lc->xgood[i][ip]; |
149 |
|
t_track->ygood[ip] = (Int_t) lc->ygood[i][ip]; |
150 |
|
int ssensor = lc->sensor[i][ip]; |
151 |
|
int sladder = lc->ladder[i][ip]; |
152 |
|
if(ip==5&&ssensor!=0)ssensor = 3 - ssensor; //notazione paolo x align |
153 |
|
t_track->xgood[ip] += 10000000*ssensor+10*sladder ; // ladder+sensor |
154 |
|
t_track->ygood[ip] += 10000000*ssensor+10*sladder ; // ladder+sensor |
155 |
|
// if(l2->xbad[i][ip]>0)t_track->xgood[ip]=-t_track->xgood[ip]; |
156 |
|
// if(l2->ybad[i][ip]>0)t_track->ygood[ip]=-t_track->ygood[ip]; |
157 |
|
t_track->xm[ip] = lc->xm[i][ip]; |
158 |
|
t_track->ym[ip] = lc->ym[i][ip]; |
159 |
|
t_track->zm[ip] = lc->zm[i][ip]; |
160 |
|
t_track->resx[ip] = lc->resx[i][ip]; |
161 |
|
t_track->resy[ip] = lc->resy[i][ip]; |
162 |
|
t_track->tailx[ip] = 0.; |
163 |
|
t_track->taily[ip] = 0.; |
164 |
|
t_track->xv[ip] = lc->xv[i][ip]; |
165 |
|
t_track->yv[ip] = lc->yv[i][ip]; |
166 |
|
t_track->zv[ip] = lc->zv[i][ip]; |
167 |
|
t_track->axv[ip] = lc->axv[i][ip]; |
168 |
|
t_track->ayv[ip] = lc->ayv[i][ip]; |
169 |
|
t_track->dedx_x[ip] = 0.; |
170 |
|
t_track->dedx_y[ip] = 0.; |
171 |
|
t_track->multmaxx[ip] = 0; |
172 |
|
t_track->multmaxy[ip] = 0; |
173 |
|
t_track->seedx[ip] = 0.; |
174 |
|
t_track->seedy[ip] = 0.; |
175 |
|
t_track->xpu[ip] = 0.; |
176 |
|
t_track->ypu[ip] = 0.; |
177 |
|
//----------------------------------------------------- |
178 |
|
//----------------------------------------------------- |
179 |
|
//----------------------------------------------------- |
180 |
|
//----------------------------------------------------- |
181 |
|
}; |
182 |
|
// if(t_track->IsSaturated())t_track->Dump(); |
183 |
|
new(t[i]) TrkTrack(*t_track); |
184 |
|
t_track->Clear(); |
185 |
|
}; |
186 |
|
|
187 |
|
delete t_track; |
188 |
|
|
189 |
|
|
190 |
}; |
}; |
191 |
//-------------------------------------- |
//-------------------------------------- |
192 |
// |
// |
193 |
// |
// |
194 |
//-------------------------------------- |
//-------------------------------------- |
195 |
|
TrkTrack *TrkHough::GetCandidate(int it){ |
196 |
|
|
197 |
|
if(it >= GetNCandidates()){ |
198 |
|
cout << "** TrkHough ** Track-candidate "<< it << "does not exits! " << endl; |
199 |
|
cout << " n.candidates = "<< GetNCandidates() << endl; |
200 |
|
return 0; |
201 |
|
} |
202 |
|
if(!Candidates){ |
203 |
|
cout << "TrkTrack *TrkHough::GetCandidate(int is) >> (TClonesArray*) Candidate ==0 "<<endl; |
204 |
|
}; |
205 |
|
|
206 |
|
TClonesArray &t = *(Candidates); |
207 |
|
TrkTrack *track = (TrkTrack*)t[it]; |
208 |
|
return track; |
209 |
|
} |
210 |
|
//-------------------------------------- |
211 |
|
// |
212 |
|
// |
213 |
|
//-------------------------------------- |
214 |
void TrkHough::Clear(){ |
void TrkHough::Clear(){ |
215 |
|
|
216 |
|
|
217 |
ndblt = 0; |
ndblt = 0; |
218 |
ntrpt = 0; |
ntrpt = 0; |
219 |
nclouds_yz = 0; |
nclouds_yz = 0; |
222 |
totaltime = 0; |
totaltime = 0; |
223 |
houghtime = 0; |
houghtime = 0; |
224 |
fittime = 0; |
fittime = 0; |
225 |
|
// ntracks = 0; |
226 |
|
|
227 |
|
if(Candidates)Candidates->Delete(); |
228 |
}; |
}; |
229 |
//-------------------------------------- |
//-------------------------------------- |
230 |
// |
// |
232 |
//-------------------------------------- |
//-------------------------------------- |
233 |
void TrkHough::Delete(){ |
void TrkHough::Delete(){ |
234 |
|
|
235 |
ndblt = 0; |
Clear(); |
236 |
ntrpt = 0; |
|
237 |
nclouds_yz = 0; |
delete [] alfayz1; |
238 |
nclouds_xz = 0; |
delete [] alfayz2; |
239 |
nclstr = 0; |
delete [] db_cloud; |
240 |
totaltime = 0; |
|
241 |
houghtime = 0; |
delete [] alfaxz1; |
242 |
fittime = 0; |
delete [] alfaxz2; |
243 |
|
delete [] alfaxz3; |
244 |
|
delete [] tr_cloud; |
245 |
|
|
246 |
|
delete [] alfayz1_av; |
247 |
|
delete [] alfayz2_av; |
248 |
|
delete [] ptcloud_yz; |
249 |
|
|
250 |
|
delete [] alfaxz1_av; |
251 |
|
delete [] alfaxz2_av; |
252 |
|
delete [] alfaxz3_av; |
253 |
|
delete [] ptcloud_xz; |
254 |
|
|
255 |
|
// delete [] al0; |
256 |
|
// delete [] al1; |
257 |
|
// delete [] al2; |
258 |
|
// delete [] al3; |
259 |
|
// delete [] al4; |
260 |
|
|
261 |
this->~TrkHough(); |
if(Candidates)delete Candidates; |
262 |
|
|
263 |
}; |
}; |
264 |
|
|