40 |
// |
// |
41 |
//-------------------------------------- |
//-------------------------------------- |
42 |
TrkCluster::~TrkCluster(){ |
TrkCluster::~TrkCluster(){ |
43 |
|
|
44 |
|
if(CLlength){ |
45 |
delete [] clsignal; |
delete [] clsignal; |
46 |
delete [] clsigma; |
delete [] clsigma; |
47 |
delete [] cladc; |
delete [] cladc; |
48 |
delete [] clbad; |
delete [] clbad; |
49 |
|
} |
50 |
}; |
}; |
51 |
//-------------------------------------- |
//-------------------------------------- |
52 |
// |
// |
59 |
indmax = t.indmax; |
indmax = t.indmax; |
60 |
|
|
61 |
CLlength = t.CLlength; |
CLlength = t.CLlength; |
62 |
clsignal = new Float_t[CLlength]; |
if(CLlength){ |
63 |
clsigma = new Float_t[CLlength]; |
clsignal = new Float_t[CLlength]; |
64 |
cladc = new Int_t[CLlength]; |
clsigma = new Float_t[CLlength]; |
65 |
clbad = new Bool_t[CLlength]; |
cladc = new Int_t[CLlength]; |
66 |
for(Int_t i=0; i<CLlength;i++){ |
clbad = new Bool_t[CLlength]; |
67 |
|
for(Int_t i=0; i<CLlength;i++){ |
68 |
clsignal[i] = t.clsignal[i]; |
clsignal[i] = t.clsignal[i]; |
69 |
clsigma[i] = t.clsigma[i]; |
clsigma[i] = t.clsigma[i]; |
70 |
cladc[i] = t.cladc[i]; |
cladc[i] = t.cladc[i]; |
71 |
clbad[i] = t.clbad[i]; |
clbad[i] = t.clbad[i]; |
72 |
|
}; |
73 |
}; |
}; |
74 |
|
}; |
75 |
|
//-------------------------------------- |
76 |
|
// |
77 |
|
// |
78 |
|
//-------------------------------------- |
79 |
|
void TrkCluster::Clear(){ |
80 |
|
|
81 |
|
view = 0; |
82 |
|
maxs = 0; |
83 |
|
indmax = 0; |
84 |
|
|
85 |
|
CLlength = 0; |
86 |
|
clsignal = 0; |
87 |
|
clsigma = 0; |
88 |
|
cladc = 0; |
89 |
|
clbad = 0; |
90 |
|
|
91 |
}; |
}; |
92 |
//-------------------------------------- |
//-------------------------------------- |
410 |
cout<<"DSP status: "; |
cout<<"DSP status: "; |
411 |
for(Int_t i=0; i<12 ; i++)cout<<good[i]<<" "; |
for(Int_t i=0; i<12 ; i++)cout<<good[i]<<" "; |
412 |
cout<<endl; |
cout<<endl; |
413 |
|
cout<<"VA1 mask : "<<endl; |
414 |
|
for(Int_t i=0; i<12 ; i++){ |
415 |
|
for(Int_t ii=0; ii<24 ; ii++){ |
416 |
|
Int_t mask = cnn[ii][i]; |
417 |
|
if(mask>0)mask=1; |
418 |
|
cout<<mask<<" "; |
419 |
|
} |
420 |
|
cout <<endl; |
421 |
|
} |
422 |
|
|
423 |
TClonesArray &t = *Cluster; |
TClonesArray &t = *Cluster; |
424 |
for(int i=0; i<this->nclstr(); i++) ((TrkCluster *)t[i])->Dump(); |
for(int i=0; i<this->nclstr(); i++) ((TrkCluster *)t[i])->Dump(); |
431 |
/** |
/** |
432 |
* 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). |
433 |
*/ |
*/ |
434 |
void TrkLevel1::SetFromLevel1Struct(cTrkLevel1 *l1){ |
void TrkLevel1::SetFromLevel1Struct(cTrkLevel1 *l1, Bool_t full){ |
435 |
|
|
436 |
|
// --------------- |
437 |
// *** CLUSTER *** |
// *** CLUSTER *** |
438 |
|
// --------------- |
439 |
TrkCluster* t_cl = new TrkCluster(); |
TrkCluster* t_cl = new TrkCluster(); |
440 |
TClonesArray &t = *Cluster; |
TClonesArray &t = *Cluster; |
441 |
for(int i=0; i<l1->nclstr1; i++){ |
for(int i=0; i<l1->nclstr1; i++){ |
442 |
|
|
443 |
|
t_cl->Clear(); |
444 |
|
if( full || (!full && l1->whichtrack[i]) ){ |
445 |
|
|
446 |
t_cl->view = l1->view[i]; |
t_cl->view = l1->view[i]; |
447 |
t_cl->maxs = l1->maxs[i]; |
t_cl->maxs = l1->maxs[i]; |
448 |
t_cl->indmax = l1->indmax[i] - l1->indstart[i]; |
t_cl->indmax = l1->indmax[i] - l1->indstart[i]; |
449 |
|
|
450 |
Int_t from = l1->indstart[i] -1; |
Int_t from = l1->indstart[i] -1; |
451 |
Int_t to = l1->totCLlength ; |
Int_t to = l1->totCLlength ; |
452 |
if(i != l1->nclstr1-1)to = l1->indstart[i+1] -1 ; |
if(i != l1->nclstr1-1)to = l1->indstart[i+1] -1 ; |
453 |
t_cl->CLlength = to - from ; |
t_cl->CLlength = to - from ; |
454 |
|
|
455 |
t_cl->clsignal = new Float_t[t_cl->CLlength]; |
t_cl->clsignal = new Float_t[t_cl->CLlength]; |
456 |
t_cl->clsigma = new Float_t[t_cl->CLlength]; |
t_cl->clsigma = new Float_t[t_cl->CLlength]; |
457 |
t_cl->cladc = new Int_t[t_cl->CLlength]; |
t_cl->cladc = new Int_t[t_cl->CLlength]; |
458 |
t_cl->clbad = new Bool_t[t_cl->CLlength]; |
t_cl->clbad = new Bool_t[t_cl->CLlength]; |
459 |
Int_t index = 0; |
Int_t index = 0; |
460 |
for(Int_t is = from; is < to; is++ ){ |
for(Int_t is = from; is < to; is++ ){ |
461 |
t_cl->clsignal[index] = (Float_t) l1->clsignal[is]; |
t_cl->clsignal[index] = (Float_t) l1->clsignal[is]; |
462 |
t_cl->clsigma[index] = (Float_t) l1->clsigma[is]; |
t_cl->clsigma[index] = (Float_t) l1->clsigma[is]; |
463 |
t_cl->cladc[index] = (Int_t) l1->cladc[is]; |
t_cl->cladc[index] = (Int_t) l1->cladc[is]; |
464 |
t_cl->clbad[index] = (Bool_t) l1->clbad[is]; |
t_cl->clbad[index] = (Bool_t) l1->clbad[is]; |
465 |
index++; |
index++; |
466 |
}; |
}; |
467 |
|
} |
468 |
new(t[i]) TrkCluster(*t_cl); |
new(t[i]) TrkCluster(*t_cl); // <<< store cluster |
469 |
}; |
}; |
470 |
|
|
471 |
delete t_cl; |
delete t_cl; |
472 |
|
|
473 |
|
// ------------------------- |
474 |
// ****general variables**** |
// ****general variables**** |
475 |
|
// ------------------------- |
476 |
for(Int_t i=0; i<12 ; i++){ |
for(Int_t i=0; i<12 ; i++){ |
477 |
good[i] = l1->good[i]; |
good[i] = l1->good[i]; |
478 |
for(Int_t j=0; j<24 ; j++){ |
for(Int_t j=0; j<24 ; j++){ |
565 |
//-------------------------------------- |
//-------------------------------------- |
566 |
TrkCluster *TrkLevel1::GetCluster(int is){ |
TrkCluster *TrkLevel1::GetCluster(int is){ |
567 |
|
|
568 |
if(is >= this->nclstr()){ |
// if(is >= this->nclstr()){ |
569 |
cout << "** TrkLevel1::GetCluster(int) ** Cluster "<< is << " does not exits! " << endl; |
// cout << "** TrkLevel1::GetCluster(int) ** Cluster "<< is << " does not exits! " << endl; |
570 |
cout << "( Stored clusters nclstr() = "<< this->nclstr()<<" )" << endl; |
// cout << "( Stored clusters nclstr() = "<< this->nclstr()<<" )" << endl; |
571 |
return 0; |
// return 0; |
572 |
} |
// } |
573 |
TClonesArray &t = *(Cluster); |
TClonesArray &t = *(Cluster); |
574 |
TrkCluster *cluster = (TrkCluster*)t[is]; |
TrkCluster *cluster = (TrkCluster*)t[is]; |
575 |
return cluster; |
return cluster; |
585 |
int TrkLevel1::LoadPfaParam(TString path){ |
int TrkLevel1::LoadPfaParam(TString path){ |
586 |
|
|
587 |
if( strcmp(path_.path,path.Data()) ){ |
if( strcmp(path_.path,path.Data()) ){ |
588 |
cout <<"Loading p.f.a. parameters\n"; |
cout <<"Loading p.f.a. parameters\n"; |
589 |
strcpy(path_.path,path.Data()); |
strcpy(path_.path,path.Data()); |
590 |
path_.pathlen = path.Length(); |
path_.pathlen = path.Length(); |
591 |
path_.error = 0; |
path_.error = 0; |
592 |
return readetaparam_(); |
return readetaparam_(); |
593 |
} |
} |
594 |
return 0; |
return 0; |
595 |
} |
} |