11 |
extern "C" { |
extern "C" { |
12 |
|
|
13 |
// int readetaparam_(); |
// int readetaparam_(); |
14 |
float cog_(int*,int*); |
float cog_(int*,int*); |
15 |
float pfaeta_(int*,float*); |
float pfaeta_(int*,float*); |
16 |
float pfaeta2_(int*,float*); |
float pfaeta2_(int*,float*); |
17 |
float pfaeta3_(int*,float*); |
float pfaeta3_(int*,float*); |
18 |
float pfaeta4_(int*,float*); |
float pfaeta4_(int*,float*); |
19 |
|
|
20 |
} |
} |
21 |
//-------------------------------------- |
//-------------------------------------- |
24 |
//-------------------------------------- |
//-------------------------------------- |
25 |
TrkCluster::TrkCluster(){ |
TrkCluster::TrkCluster(){ |
26 |
|
|
27 |
view = 0; |
// cout << "TrkCluster::TrkCluster()"<<endl; |
28 |
maxs = 0; |
view = -1; |
29 |
indmax = 0; |
maxs = -1; |
30 |
|
indmax = -1; |
31 |
CLlength = 0; |
|
32 |
clsignal = 0; |
CLlength = 0; |
33 |
clsigma = 0; |
clsignal = 0; |
34 |
cladc = 0; |
clsigma = 0; |
35 |
clbad = 0; |
cladc = 0; |
36 |
|
clbad = 0; |
37 |
|
|
38 |
}; |
}; |
39 |
//-------------------------------------- |
//-------------------------------------- |
40 |
// |
// |
41 |
// |
// |
42 |
//-------------------------------------- |
//-------------------------------------- |
|
TrkCluster::~TrkCluster(){ |
|
|
|
|
|
delete [] clsignal; |
|
|
delete [] clsigma; |
|
|
delete [] cladc; |
|
|
delete [] clbad; |
|
|
}; |
|
|
//-------------------------------------- |
|
|
// |
|
|
// |
|
|
//-------------------------------------- |
|
43 |
TrkCluster::TrkCluster(const TrkCluster& t){ |
TrkCluster::TrkCluster(const TrkCluster& t){ |
44 |
|
|
45 |
view = t.view; |
view = t.view; |
46 |
maxs = t.maxs; |
maxs = t.maxs; |
47 |
indmax = t.indmax; |
indmax = t.indmax; |
48 |
|
|
49 |
CLlength = t.CLlength; |
CLlength = t.CLlength; |
50 |
|
if(CLlength){ |
51 |
clsignal = new Float_t[CLlength]; |
clsignal = new Float_t[CLlength]; |
52 |
clsigma = new Float_t[CLlength]; |
clsigma = new Float_t[CLlength]; |
53 |
cladc = new Int_t[CLlength]; |
cladc = new Int_t[CLlength]; |
54 |
clbad = new Bool_t[CLlength]; |
clbad = new Bool_t[CLlength]; |
55 |
for(Int_t i=0; i<CLlength;i++){ |
for(Int_t i=0; i<CLlength;i++){ |
56 |
clsignal[i] = t.clsignal[i]; |
clsignal[i] = t.clsignal[i]; |
57 |
clsigma[i] = t.clsigma[i]; |
clsigma[i] = t.clsigma[i]; |
58 |
cladc[i] = t.cladc[i]; |
cladc[i] = t.cladc[i]; |
59 |
clbad[i] = t.clbad[i]; |
clbad[i] = t.clbad[i]; |
60 |
}; |
}; |
61 |
|
}; |
62 |
|
}; |
63 |
|
//-------------------------------------- |
64 |
|
// |
65 |
|
// |
66 |
|
//-------------------------------------- |
67 |
|
void TrkCluster::Clear(){ |
68 |
|
|
69 |
|
// cout << "void TrkCluster::Clear()"<<endl; |
70 |
|
if(CLlength){ |
71 |
|
delete [] clsignal; |
72 |
|
delete [] clsigma; |
73 |
|
delete [] cladc; |
74 |
|
delete [] clbad; |
75 |
|
} |
76 |
|
|
77 |
|
view = 0; |
78 |
|
maxs = 0; |
79 |
|
indmax = 0; |
80 |
|
|
81 |
|
CLlength = 0; |
82 |
|
clsignal = 0; |
83 |
|
clsigma = 0; |
84 |
|
cladc = 0; |
85 |
|
clbad = 0; |
86 |
|
|
87 |
}; |
}; |
88 |
//-------------------------------------- |
//-------------------------------------- |
97 |
* If nstrip<=0 only the inclusion cut is used to determine the cluster size. |
* If nstrip<=0 only the inclusion cut is used to determine the cluster size. |
98 |
*/ |
*/ |
99 |
Float_t TrkCluster::GetSignal(Int_t nstrip, Float_t cut){ |
Float_t TrkCluster::GetSignal(Int_t nstrip, Float_t cut){ |
100 |
|
|
101 |
|
if(CLlength<=0)return 0; |
102 |
|
|
103 |
Float_t s = 0; |
Float_t s = 0; |
104 |
|
|
105 |
if( nstrip<=0 ){ |
if( nstrip<=0 ){ |
149 |
return s; |
return s; |
150 |
}; |
}; |
151 |
|
|
152 |
|
|
153 |
/** |
/** |
154 |
including a ( maximum ) fixed number of adjacent strips (with s>0) around the maxs. |
* Evaluate the cluster signal-to-noise, as defined by Turchetta, including a |
155 |
* @param nstrip Number of strips. |
* maximum number of adjacent strips, around maxs, having a significant signal. |
|
*/ |
|
|
/** |
|
|
* Evaluate the cluster signal-to-noise, as defined by Turchetta, including a maximum number of adjacent strips, around maxs, having a significant signal. |
|
156 |
* @param nstrip Maximum number of strips. |
* @param nstrip Maximum number of strips. |
157 |
* @param cut Inclusion cut ( s > cut*sigma ). |
* @param cut Inclusion cut ( s > cut*sigma ). |
158 |
* If nstrip<=0 only the inclusion cut is used to determine the cluster size. |
* If nstrip<=0 only the inclusion cut is used to determine the cluster size. |
159 |
*/ |
*/ |
160 |
Float_t TrkCluster::GetSignalToNoise(Int_t nstrip, Float_t cut){ |
Float_t TrkCluster::GetSignalToNoise(Int_t nstrip, Float_t cut){ |
161 |
|
|
162 |
|
if(CLlength<=0)return 0; |
163 |
|
|
164 |
Float_t sn = 0; |
Float_t sn = 0; |
165 |
|
|
166 |
if( nstrip<=0 ){ |
if( nstrip<=0 ){ |
210 |
* @param cut Inclusion cut. |
* @param cut Inclusion cut. |
211 |
*/ |
*/ |
212 |
Int_t TrkCluster::GetMultiplicity(Float_t cut){ |
Int_t TrkCluster::GetMultiplicity(Float_t cut){ |
213 |
Int_t m = 0; |
|
214 |
for(Int_t is = 0; is < CLlength; is++){ |
if(CLlength<=0)return 0; |
215 |
Float_t scut = cut*clsigma[is]; |
|
216 |
if(clsignal[is] > scut) m++; |
Int_t m = 0; |
217 |
}; |
|
218 |
return m; |
for(Int_t is = indmax+1; is < CLlength; is++){ |
219 |
|
Float_t scut = cut*clsigma[is]; |
220 |
|
if(clsignal[is] > scut) m++; |
221 |
|
else break; |
222 |
|
}; |
223 |
|
for(Int_t is = indmax; is >=0; is--){ |
224 |
|
Float_t scut = cut*clsigma[is]; |
225 |
|
if(clsignal[is] > scut) m++; |
226 |
|
else break; |
227 |
|
}; |
228 |
|
return m; |
229 |
}; |
}; |
230 |
/** |
/** |
231 |
* True if the cluster contains bad strips. |
* True if the cluster contains bad strips. |
232 |
* @param nbad Number of strips around the maximum. |
* @param nbad Number of strips around the maximum. |
233 |
*/ |
*/ |
234 |
Bool_t TrkCluster::IsBad(Int_t nbad){ |
Bool_t TrkCluster::IsBad(Int_t nbad){ |
235 |
|
|
236 |
/* Float_t max = 0; |
if(CLlength<=0)return 0; |
237 |
Int_t imax = 0; |
|
238 |
for(Int_t is = 0; is < CLlength; is++){ |
Int_t il,ir; |
239 |
if(clsignal[is] > max){ |
il = indmax; |
240 |
max = clsignal[is]; |
ir = indmax; |
241 |
imax = is; |
for(Int_t i=1; i<nbad; i++){ |
242 |
}; |
if (ir == CLlength && il == 0)break; |
243 |
}; |
else if (ir == CLlength && il != 0)il--; |
244 |
|
else if (ir != CLlength && il == 0)ir++; |
245 |
Int_t il,ir; |
else{ |
246 |
il = imax; |
if(clsignal[il-1] > clsignal[ir+1])il--; |
247 |
ir = imax;*/ |
else ir++; |
|
|
|
|
Int_t il,ir; |
|
|
il = indmax; |
|
|
ir = indmax; |
|
|
for(Int_t i=1; i<nbad; i++){ |
|
|
if (ir == CLlength && il == 0)break; |
|
|
else if (ir == CLlength && il != 0)il--; |
|
|
else if (ir != CLlength && il == 0)ir++; |
|
|
else{ |
|
|
if(clsignal[il-1] > clsignal[ir+1])il--; |
|
|
else ir++; |
|
|
} |
|
248 |
} |
} |
249 |
Int_t isbad = 0; |
} |
250 |
for(Int_t i=il; i<=ir; i++)isbad += clbad[i]; |
Int_t isbad = 0; |
251 |
|
for(Int_t i=il; i<=ir; i++)isbad += clbad[i]; |
252 |
return ( isbad != nbad ); |
|
253 |
|
return ( isbad != nbad ); |
254 |
}; |
}; |
255 |
|
/** |
256 |
|
* True if the cluster contains saturated strips. |
257 |
|
* @param nbad Number of strips around the maximum. |
258 |
|
*/ |
259 |
|
Bool_t TrkCluster::IsSaturated(Int_t nbad){ |
260 |
|
|
261 |
|
if(CLlength<=0)return 0; |
262 |
|
|
263 |
|
Int_t il,ir; |
264 |
|
il = indmax; |
265 |
|
ir = indmax; |
266 |
|
for(Int_t i=1; i<nbad; i++){ |
267 |
|
if (ir == CLlength && il == 0)break; |
268 |
|
else if (ir == CLlength && il != 0)il--; |
269 |
|
else if (ir != CLlength && il == 0)ir++; |
270 |
|
else{ |
271 |
|
if(clsignal[il-1] > clsignal[ir+1])il--; |
272 |
|
else ir++; |
273 |
|
} |
274 |
|
} |
275 |
|
Int_t isbad = 0; |
276 |
|
for(Int_t i=il; i<=ir; i++){ |
277 |
|
if( IsX() && cladc[i] > 2980 )isbad++; |
278 |
|
if( IsY() && cladc[i] < 80 )isbad++; |
279 |
|
} |
280 |
|
return ( isbad != 0 ); |
281 |
|
|
282 |
|
} |
283 |
//-------------------------------------- |
//-------------------------------------- |
284 |
// |
// |
285 |
// |
// |
286 |
//-------------------------------------- |
//-------------------------------------- |
287 |
void TrkCluster::Dump(){ |
void TrkCluster::Dump(){ |
288 |
|
|
289 |
cout << "----- Cluster" << endl; |
cout << "----- Cluster" << endl; |
290 |
cout << "View "<<view << " - Ladder "<<GetLadder()<<endl; |
cout << "View "<<view << " - Ladder "<<GetLadder()<<endl; |
291 |
cout << "Position of maximun "<< maxs <<endl; |
cout << "Position of maximun "<< maxs <<endl; |
292 |
cout << "Multiplicity "<< GetMultiplicity() <<endl; |
cout << "Multiplicity "<< GetMultiplicity() <<endl; |
293 |
cout << "Tot signal "<< GetSignal() << " (ADC channels)"<<endl ; |
cout << "Tot signal "<< GetSignal() << " (ADC channels)"<<endl ; |
294 |
cout << "Signal/Noise "<< GetSignalToNoise(); |
cout << "Signal/Noise "<< GetSignalToNoise(); |
295 |
cout <<endl<< "Strip signals "; |
cout <<endl<< "Strip signals "; |
296 |
for(Int_t i =0; i<CLlength; i++)cout << " " <<clsignal[i]; |
for(Int_t i =0; i<CLlength; i++)cout << " " <<clsignal[i]; |
297 |
cout <<endl<< "Strip sigmas "; |
cout <<endl<< "Strip sigmas "; |
298 |
for(Int_t i =0; i<CLlength; i++)cout << " " <<clsigma[i]; |
for(Int_t i =0; i<CLlength; i++)cout << " " <<clsigma[i]; |
299 |
cout <<endl<< "Strip ADC "; |
cout <<endl<< "Strip ADC "; |
300 |
for(Int_t i =0; i<CLlength; i++)cout << " " <<cladc[i]; |
for(Int_t i =0; i<CLlength; i++)cout << " " <<cladc[i]; |
301 |
cout <<endl<< "Strip BAD "; |
cout <<endl<< "Strip BAD "; |
302 |
for(Int_t i =0; i<CLlength; i++){ |
for(Int_t i =0; i<CLlength; i++){ |
303 |
if(i==indmax)cout << " *" <<clbad[i]<<"*"; |
if(i==indmax)cout << " *" <<clbad[i]<<"*"; |
304 |
else cout << " " <<clbad[i]; |
else cout << " " <<clbad[i]; |
305 |
} |
} |
306 |
cout << endl; |
cout << endl; |
307 |
|
|
308 |
} |
} |
309 |
//-------------------------------------- |
//-------------------------------------- |
415 |
//-------------------------------------- |
//-------------------------------------- |
416 |
TrkLevel1::TrkLevel1(){ |
TrkLevel1::TrkLevel1(){ |
417 |
|
|
418 |
Cluster = new TClonesArray("TrkCluster"); |
// cout << "TrkLevel1::TrkLevel1()"<<endl; |
419 |
|
// Cluster = new TClonesArray("TrkCluster"); |
420 |
|
Cluster = 0; |
421 |
for(Int_t i=0; i<12 ; i++){ |
for(Int_t i=0; i<12 ; i++){ |
422 |
good[i] = -1; |
good[i] = -1; |
423 |
for(Int_t j=0; j<24 ; j++){ |
for(Int_t j=0; j<24 ; j++){ |
424 |
cn[j][i]=0; |
cn[j][i]=0; |
|
// cnrms[j][i]=0; |
|
425 |
cnn[j][i]=0; |
cnn[j][i]=0; |
426 |
}; |
}; |
427 |
}; |
}; |
430 |
// |
// |
431 |
// |
// |
432 |
//-------------------------------------- |
//-------------------------------------- |
433 |
|
void TrkLevel1::Set(){ |
434 |
|
if(!Cluster)Cluster = new TClonesArray("TrkCluster"); |
435 |
|
} |
436 |
|
//-------------------------------------- |
437 |
|
// |
438 |
|
// |
439 |
|
//-------------------------------------- |
440 |
void TrkLevel1::Dump(){ |
void TrkLevel1::Dump(){ |
441 |
|
|
442 |
cout<<"DSP status: "; |
cout<<"DSP status: "; |
443 |
for(Int_t i=0; i<12 ; i++)cout<<good[i]<<" "; |
for(Int_t i=0; i<12 ; i++)cout<<good[i]<<" "; |
444 |
cout<<endl; |
cout<<endl; |
445 |
|
cout<<"VA1 mask : "<<endl; |
446 |
|
for(Int_t i=0; i<12 ; i++){ |
447 |
|
for(Int_t ii=0; ii<24 ; ii++){ |
448 |
|
Int_t mask = cnn[ii][i]; |
449 |
|
if(mask>0)mask=1; |
450 |
|
cout<<mask<<" "; |
451 |
|
} |
452 |
|
cout <<endl; |
453 |
|
} |
454 |
|
|
455 |
|
if(!Cluster)return; |
456 |
TClonesArray &t = *Cluster; |
TClonesArray &t = *Cluster; |
457 |
for(int i=0; i<this->nclstr(); i++) ((TrkCluster *)t[i])->Dump(); |
for(int i=0; i<this->nclstr(); i++) ((TrkCluster *)t[i])->Dump(); |
458 |
|
|
464 |
/** |
/** |
465 |
* Fills a TrkLevel1 object with values from a struct cTrkLevel1 (to get data from F77 common). |
* Fills a TrkLevel1 object with values from a struct cTrkLevel1 (to get data from F77 common). |
466 |
*/ |
*/ |
467 |
void TrkLevel1::SetFromLevel1Struct(cTrkLevel1 *l1){ |
void TrkLevel1::SetFromLevel1Struct(cTrkLevel1 *l1, Bool_t full){ |
468 |
|
|
469 |
|
// --------------- |
470 |
// *** CLUSTER *** |
// *** CLUSTER *** |
471 |
|
// --------------- |
472 |
TrkCluster* t_cl = new TrkCluster(); |
TrkCluster* t_cl = new TrkCluster(); |
473 |
|
if(!Cluster)Cluster = new TClonesArray("TrkCluster"); |
474 |
TClonesArray &t = *Cluster; |
TClonesArray &t = *Cluster; |
475 |
for(int i=0; i<l1->nclstr1; i++){ |
for(int i=0; i<l1->nclstr1; i++){ |
476 |
|
|
477 |
|
t_cl->Clear(); |
478 |
|
// if( full || (!full && l1->whichtrack[i]) ){ |
479 |
|
|
480 |
t_cl->view = l1->view[i]; |
t_cl->view = l1->view[i]; |
481 |
t_cl->maxs = l1->maxs[i]; |
t_cl->maxs = l1->maxs[i]; |
482 |
t_cl->indmax = l1->indmax[i] - l1->indstart[i]; |
|
483 |
|
if( full || (!full && l1->whichtrack[i]) ){ |
484 |
Int_t from = l1->indstart[i] -1; |
t_cl->indmax = l1->indmax[i] - l1->indstart[i]; |
485 |
Int_t to = l1->totCLlength ; |
Int_t from = l1->indstart[i] -1; |
486 |
if(i != l1->nclstr1-1)to = l1->indstart[i+1] -1 ; |
Int_t to = l1->totCLlength ; |
487 |
t_cl->CLlength = to - from ; |
if(i != l1->nclstr1-1)to = l1->indstart[i+1] -1 ; |
488 |
|
t_cl->CLlength = to - from ; |
489 |
t_cl->clsignal = new Float_t[t_cl->CLlength]; |
|
490 |
t_cl->clsigma = new Float_t[t_cl->CLlength]; |
t_cl->clsignal = new Float_t[t_cl->CLlength]; |
491 |
t_cl->cladc = new Int_t[t_cl->CLlength]; |
t_cl->clsigma = new Float_t[t_cl->CLlength]; |
492 |
t_cl->clbad = new Bool_t[t_cl->CLlength]; |
t_cl->cladc = new Int_t[t_cl->CLlength]; |
493 |
Int_t index = 0; |
t_cl->clbad = new Bool_t[t_cl->CLlength]; |
494 |
for(Int_t is = from; is < to; is++ ){ |
Int_t index = 0; |
495 |
t_cl->clsignal[index] = (Float_t) l1->clsignal[is]; |
for(Int_t is = from; is < to; is++ ){ |
496 |
t_cl->clsigma[index] = (Float_t) l1->clsigma[is]; |
t_cl->clsignal[index] = (Float_t) l1->clsignal[is]; |
497 |
t_cl->cladc[index] = (Int_t) l1->cladc[is]; |
t_cl->clsigma[index] = (Float_t) l1->clsigma[is]; |
498 |
t_cl->clbad[index] = (Bool_t) l1->clbad[is]; |
t_cl->cladc[index] = (Int_t) l1->cladc[is]; |
499 |
index++; |
t_cl->clbad[index] = (Bool_t) l1->clbad[is]; |
500 |
}; |
index++; |
501 |
|
}; |
502 |
new(t[i]) TrkCluster(*t_cl); |
} |
503 |
|
new(t[i]) TrkCluster(*t_cl); // <<< store cluster |
504 |
}; |
}; |
505 |
|
|
506 |
delete t_cl; |
delete t_cl; |
507 |
|
|
508 |
|
// ------------------------- |
509 |
// ****general variables**** |
// ****general variables**** |
510 |
|
// ------------------------- |
511 |
for(Int_t i=0; i<12 ; i++){ |
for(Int_t i=0; i<12 ; i++){ |
512 |
good[i] = l1->good[i]; |
good[i] = l1->good[i]; |
513 |
for(Int_t j=0; j<24 ; j++){ |
for(Int_t j=0; j<24 ; j++){ |
525 |
cTrkLevel1* TrkLevel1::GetLevel1Struct() { |
cTrkLevel1* TrkLevel1::GetLevel1Struct() { |
526 |
|
|
527 |
cTrkLevel1 *l1=0; |
cTrkLevel1 *l1=0; |
528 |
// |
// |
529 |
for(Int_t i=0; i<12 ; i++){ |
for(Int_t i=0; i<12 ; i++){ |
530 |
l1->good[i] = good[i]; |
l1->good[i] = good[i]; |
531 |
for(Int_t j=0; j<24 ; j++){ |
for(Int_t j=0; j<24 ; j++){ |
536 |
}; |
}; |
537 |
|
|
538 |
// *** CLUSTERS *** |
// *** CLUSTERS *** |
539 |
l1->nclstr1 = Cluster->GetEntries(); |
if(Cluster){ |
540 |
for(Int_t i=0;i<l1->nclstr1;i++){ |
l1->nclstr1 = Cluster->GetEntries(); |
541 |
|
for(Int_t i=0;i<l1->nclstr1;i++){ |
542 |
|
|
543 |
|
l1->view[i] = ((TrkCluster *)Cluster->At(i))->view; |
544 |
|
l1->maxs[i] = ((TrkCluster *)Cluster->At(i))->maxs; |
545 |
|
// COMPLETARE // |
546 |
|
// COMPLETARE // |
547 |
|
// COMPLETARE // |
548 |
|
// COMPLETARE // |
549 |
|
// COMPLETARE // |
550 |
|
// COMPLETARE // |
551 |
|
|
552 |
l1->view[i] = ((TrkCluster *)Cluster->At(i))->view; |
} |
|
l1->maxs[i] = ((TrkCluster *)Cluster->At(i))->maxs; |
|
553 |
// COMPLETARE // |
// COMPLETARE // |
554 |
// COMPLETARE // |
// COMPLETARE // |
555 |
// COMPLETARE // |
// COMPLETARE // |
556 |
// COMPLETARE // |
// COMPLETARE // |
557 |
// COMPLETARE // |
// COMPLETARE // |
558 |
// COMPLETARE // |
// COMPLETARE // |
|
|
|
559 |
} |
} |
|
// COMPLETARE // |
|
|
// COMPLETARE // |
|
|
// COMPLETARE // |
|
|
// COMPLETARE // |
|
|
// COMPLETARE // |
|
|
// COMPLETARE // |
|
560 |
return l1; |
return l1; |
561 |
} |
} |
562 |
//-------------------------------------- |
//-------------------------------------- |
569 |
good[i] = -1; |
good[i] = -1; |
570 |
for(Int_t j=0; j<24 ; j++){ |
for(Int_t j=0; j<24 ; j++){ |
571 |
cn[j][i] = 0; |
cn[j][i] = 0; |
|
// cnrms[j][i] = 0; |
|
572 |
cnn[j][i] = 0; |
cnn[j][i] = 0; |
573 |
}; |
}; |
574 |
}; |
}; |
575 |
// |
// if(Cluster)Cluster->Clear("C"); |
576 |
Cluster->Clear(); |
if(Cluster)Cluster->Delete(); |
577 |
|
|
578 |
} |
} |
579 |
//-------------------------------------- |
//-------------------------------------- |
581 |
// |
// |
582 |
//-------------------------------------- |
//-------------------------------------- |
583 |
void TrkLevel1::Delete(){ |
void TrkLevel1::Delete(){ |
584 |
|
|
585 |
for(Int_t i=0; i<12 ; i++){ |
// Clear(); |
586 |
good[i] = -1; |
if(Cluster)Cluster->Delete(); |
587 |
for(Int_t j=0; j<24 ; j++){ |
if(Cluster)delete Cluster; |
|
cn[j][i] = 0; |
|
|
// cnrms[j][i] = 0; |
|
|
cnn[j][i] = 0; |
|
|
}; |
|
|
}; |
|
|
// |
|
|
Cluster->Delete(); |
|
588 |
|
|
589 |
} |
} |
|
|
|
590 |
//-------------------------------------- |
//-------------------------------------- |
591 |
// |
// |
592 |
// |
// |
593 |
//-------------------------------------- |
//-------------------------------------- |
594 |
TrkCluster *TrkLevel1::GetCluster(int is){ |
TrkCluster *TrkLevel1::GetCluster(int is){ |
595 |
|
|
596 |
if(is >= this->nclstr()){ |
if(!Cluster)return 0; |
597 |
cout << "** TrkLevel1::GetCluster(int) ** Cluster "<< is << " does not exits! " << endl; |
if(is >= nclstr()){ |
598 |
cout << "( Stored clusters nclstr() = "<< this->nclstr()<<" )" << endl; |
cout << "** TrkLevel1::GetCluster(int) ** Cluster "<< is << " does not exits! " << endl; |
599 |
return 0; |
cout << "( Stored clusters nclstr() = "<< this->nclstr()<<" )" << endl; |
600 |
} |
return 0; |
601 |
TClonesArray &t = *(Cluster); |
} |
602 |
TrkCluster *cluster = (TrkCluster*)t[is]; |
|
603 |
return cluster; |
TClonesArray &t = *(Cluster); |
604 |
|
TrkCluster *cluster = (TrkCluster*)t[is]; |
605 |
|
return cluster; |
606 |
} |
} |
607 |
//-------------------------------------- |
//-------------------------------------- |
608 |
// |
// |
614 |
*/ |
*/ |
615 |
int TrkLevel1::LoadPfaParam(TString path){ |
int TrkLevel1::LoadPfaParam(TString path){ |
616 |
|
|
617 |
if( strcmp(path_.path,path.Data()) ){ |
if( strcmp(path_.path,path.Data()) ){ |
618 |
cout <<"Loading p.f.a. parameters\n"; |
cout <<"Loading p.f.a. param::eters\n"; |
619 |
strcpy(path_.path,path.Data()); |
strcpy(path_.path,path.Data()); |
620 |
path_.pathlen = path.Length(); |
path_.pathlen = path.Length(); |
621 |
path_.error = 0; |
path_.error = 0; |
622 |
return readetaparam_(); |
return readetaparam_(); |
623 |
} |
} |
624 |
return 0; |
return 0; |
625 |
} |
} |
626 |
|
|
627 |
|
/** |
628 |
|
* |
629 |
|
* |
630 |
|
*/ |
631 |
|
float* TrkLevel1::GetPfaCoord(TString pfa, int nview, int nladder, int nang){ |
632 |
|
|
633 |
|
int nbins = GetPfaNbinsETA(); |
634 |
|
if(!nbins)return 0; |
635 |
|
|
636 |
|
float *fcorr = new float [nbins]; |
637 |
|
|
638 |
|
if(!pfa.CompareTo("ETA2",TString::kIgnoreCase)){ |
639 |
|
for(int ib=0; ib<nbins; ib++){ |
640 |
|
fcorr[ib] = pfa_.feta2[nang][nladder][nview][ib]; |
641 |
|
cout << pfa_.eta2[nang][ib] << " - " << pfa_.feta2[nang][nladder][nview][ib]<<endl;; |
642 |
|
} |
643 |
|
}else if (!pfa.CompareTo("ETA3",TString::kIgnoreCase)){ |
644 |
|
for(int ib=0; ib<nbins; ib++)fcorr[ib] = pfa_.feta3[nang][nladder][nview][ib]; |
645 |
|
}else if (!pfa.CompareTo("ETA4",TString::kIgnoreCase)){ |
646 |
|
for(int ib=0; ib<nbins; ib++)fcorr[ib] = pfa_.feta4[nang][nladder][nview][ib]; |
647 |
|
}else{ |
648 |
|
cout << pfa<<" pfa parameters not implemented "<<endl; |
649 |
|
return 0; |
650 |
|
} |
651 |
|
|
652 |
|
return fcorr; |
653 |
|
|
654 |
|
}; |
655 |
|
|
656 |
|
float* TrkLevel1::GetPfaAbs(TString pfa, int nang){ |
657 |
|
|
658 |
|
int nbins = GetPfaNbinsETA(); |
659 |
|
if(!nbins)return 0; |
660 |
|
|
661 |
|
float *fcorr = new float [nbins]; |
662 |
|
|
663 |
|
if(!pfa.CompareTo("ETA2",TString::kIgnoreCase)){ |
664 |
|
for(int ib=0; ib<nbins; ib++)fcorr[ib] = pfa_.eta2[nang][ib]; |
665 |
|
}else if (!pfa.CompareTo("ETA3",TString::kIgnoreCase)){ |
666 |
|
for(int ib=0; ib<nbins; ib++)fcorr[ib] = pfa_.eta3[nang][ib]; |
667 |
|
}else if (!pfa.CompareTo("ETA4",TString::kIgnoreCase)){ |
668 |
|
for(int ib=0; ib<nbins; ib++)fcorr[ib] = pfa_.eta4[nang][ib]; |
669 |
|
}else{ |
670 |
|
cout << pfa<<" pfa parameters not implemented "<<endl; |
671 |
|
return 0; |
672 |
|
} |
673 |
|
|
674 |
|
return fcorr; |
675 |
|
|
676 |
|
|
677 |
|
}; |
678 |
|
|
679 |
|
|
680 |
|
|
681 |
ClassImp(TrkLevel1); |
ClassImp(TrkLevel1); |
682 |
ClassImp(TrkCluster); |
ClassImp(TrkCluster); |