| 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 |
//-------------------------------------- |
//-------------------------------------- |
| 94 |
// |
// |
| 95 |
//-------------------------------------- |
//-------------------------------------- |
| 96 |
/** |
/** |
| 97 |
* Evaluate the cluster signal including all adjacent strip with a significant signal ( s > cut*sigma ). |
* Evaluate the cluster signal including a maximum number of adjacent |
| 98 |
* @param cut Inclusion cut. |
* strips, around maxs, having a significant signal. |
| 99 |
|
* @param nstrip Maximum number of strips. |
| 100 |
|
* @param cut Inclusion cut ( s > cut*sigma ). |
| 101 |
|
* If nstrip<=0 only the inclusion cut is used to determine the cluster size. |
| 102 |
*/ |
*/ |
| 103 |
Float_t TrkCluster::GetSignal(Float_t cut){ |
Float_t TrkCluster::GetSignal(Int_t nstrip, Float_t cut){ |
| 104 |
Float_t s = 0; |
|
| 105 |
for(Int_t is = 0; is < CLlength; is++){ |
Float_t s = 0; |
| 106 |
Float_t scut = cut*clsigma[is]; |
|
| 107 |
if(clsignal[is] > scut) s += clsignal[is]; |
if( nstrip<=0 ){ |
| 108 |
|
// for(Int_t is = 0; is < CLlength; is++){ |
| 109 |
|
// Float_t scut = cut*clsigma[is]; |
| 110 |
|
// if(clsignal[is] > scut) s += clsignal[is]; |
| 111 |
|
// }; |
| 112 |
|
for(Int_t is = indmax+1; is < CLlength; is++){ |
| 113 |
|
Float_t scut = cut*clsigma[is]; |
| 114 |
|
if(clsignal[is] > scut) s += clsignal[is]; |
| 115 |
|
else break; |
| 116 |
|
}; |
| 117 |
|
for(Int_t is = indmax; is >=0; is--){ |
| 118 |
|
Float_t scut = cut*clsigma[is]; |
| 119 |
|
if(clsignal[is] > scut) s += clsignal[is]; |
| 120 |
|
else break; |
| 121 |
}; |
}; |
| 122 |
return s; |
return s; |
| 123 |
|
}; |
| 124 |
|
|
| 125 |
|
|
| 126 |
|
Int_t il = indmax; |
| 127 |
|
Int_t ir = indmax; |
| 128 |
|
Int_t inc = 0; |
| 129 |
|
|
| 130 |
|
if( clsignal[indmax] < cut*clsigma[indmax] ) return 0; |
| 131 |
|
|
| 132 |
|
while ( inc < nstrip ){ |
| 133 |
|
Float_t sl = -100000; |
| 134 |
|
Float_t sr = -100000; |
| 135 |
|
if( il >= 0 ) sl = clsignal[il]; |
| 136 |
|
if( ir < CLlength ) sr = clsignal[ir]; |
| 137 |
|
if( sl == sr && inc == 0 ){ |
| 138 |
|
s += clsignal[il]; //cout << inc<<" - "<< clsignal[il]<<" "<<s<<endl; |
| 139 |
|
il--; |
| 140 |
|
ir++; |
| 141 |
|
}else if ( sl >= sr && sl > cut*clsigma[il] && inc !=0 ){ |
| 142 |
|
s += sl;//cout << inc<<" - "<< clsignal[il]<<" "<<s<<endl; |
| 143 |
|
il--; |
| 144 |
|
}else if ( sl < sr && sr > cut*clsigma[ir] ){ |
| 145 |
|
s += sr;//cout << inc<<" - " << clsignal[ir]<<" "<<s<<endl; |
| 146 |
|
ir++; |
| 147 |
|
}else break; |
| 148 |
|
|
| 149 |
|
inc++; |
| 150 |
|
} |
| 151 |
|
return s; |
| 152 |
}; |
}; |
| 153 |
|
|
| 154 |
/** |
/** |
| 155 |
* Evaluate the cluster signal including a ( maximum ) fixed number of adjacent strips (with s>0) around the maxs. |
including a ( maximum ) fixed number of adjacent strips (with s>0) around the maxs. |
| 156 |
* @param nstrip Number of strips. |
* @param nstrip Number of strips. |
| 157 |
*/ |
*/ |
|
Float_t TrkCluster::GetSignal(Int_t nstrip){ |
|
|
|
|
|
Float_t s = 0; |
|
|
Int_t il = indmax; |
|
|
Int_t ir = indmax; |
|
|
Int_t inc = 0; |
|
|
|
|
|
while ( inc<nstrip ){ |
|
|
Float_t sl = 0; |
|
|
Float_t sr = 0; |
|
|
if( il >= 0 ) sl = clsignal[il]; |
|
|
if( ir < CLlength ) sr = clsignal[ir]; |
|
|
if( sl == sr && inc == 0 ){ |
|
|
s += clsignal[il]; |
|
|
il--; |
|
|
ir++; |
|
|
}else if ( sl >= sr && sl>0 && inc !=0){ |
|
|
s += sl; |
|
|
il--; |
|
|
}else if ( sl < sr && sr>0 ){ |
|
|
s += sr; |
|
|
ir++; |
|
|
}else break; |
|
|
|
|
|
inc++; |
|
|
} |
|
|
return s; |
|
|
}; |
|
|
/** |
|
|
* Evaluate the cluster signal-to-noise, as defined by Turchetta, including all adjacent strip with a significant signal ( s > cut*sigma ). |
|
|
* @param cut Inclusion cut. |
|
|
*/ |
|
|
Float_t TrkCluster::GetSignalToNoise(Float_t cut){ |
|
|
Float_t sn = 0; |
|
|
for(Int_t is = 0; is < CLlength; is++){ |
|
|
Float_t scut = cut*clsigma[is]; |
|
|
if(clsignal[is] > scut) sn += clsignal[is]/clsigma[is]; |
|
|
}; |
|
|
return sn; |
|
|
}; |
|
| 158 |
/** |
/** |
| 159 |
* Evaluate the cluster signal-to-noise, as defined by Turchetta, 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 maximum number of adjacent strips, around maxs, having a significant signal. |
| 160 |
* @param nstrip Number of strips. |
* @param nstrip Maximum number of strips. |
| 161 |
|
* @param cut Inclusion cut ( s > cut*sigma ). |
| 162 |
|
* If nstrip<=0 only the inclusion cut is used to determine the cluster size. |
| 163 |
*/ |
*/ |
| 164 |
Float_t TrkCluster::GetSignalToNoise(Int_t nstrip){ |
Float_t TrkCluster::GetSignalToNoise(Int_t nstrip, Float_t cut){ |
| 165 |
|
|
| 166 |
Float_t sn = 0; |
Float_t sn = 0; |
| 167 |
Int_t il = indmax; |
|
| 168 |
Int_t ir = indmax; |
if( nstrip<=0 ){ |
| 169 |
Int_t inc = 0; |
for(Int_t is = indmax+1; is < CLlength; is++){ |
| 170 |
|
Float_t scut = cut*clsigma[is]; |
| 171 |
while ( inc<nstrip ){ |
if(clsignal[is] > scut) sn += clsignal[is]/clsigma[is]; |
| 172 |
Float_t sl = 0; |
else break; |
| 173 |
Float_t sr = 0; |
}; |
| 174 |
if( il >= 0 ) sl = clsignal[il]; |
for(Int_t is = indmax; is >=0; is--){ |
| 175 |
if( ir < CLlength ) sr = clsignal[ir]; |
Float_t scut = cut*clsigma[is]; |
| 176 |
if( sl == sr && inc == 0 ){ |
if(clsignal[is] > scut) sn += clsignal[is]/clsigma[is]; |
| 177 |
sn += clsignal[il]/clsigma[il]; |
else break; |
| 178 |
il--; |
}; |
|
ir++; |
|
|
}else if ( sl >= sr && sl>0 && inc !=0){ |
|
|
sn += sl/clsigma[il]; |
|
|
il--; |
|
|
}else if ( sl < sr && sr>0 ){ |
|
|
sn += sr/clsigma[ir]; |
|
|
ir++; |
|
|
}else break; |
|
|
|
|
|
inc++; |
|
|
} |
|
| 179 |
return sn; |
return sn; |
| 180 |
|
}; |
| 181 |
|
|
| 182 |
|
|
| 183 |
|
Int_t il = indmax; |
| 184 |
|
Int_t ir = indmax; |
| 185 |
|
Int_t inc = 0; |
| 186 |
|
|
| 187 |
|
if( clsignal[indmax] < cut*clsigma[indmax] ) return 0; |
| 188 |
|
|
| 189 |
|
while ( inc < nstrip ){ |
| 190 |
|
Float_t sl = -100000; |
| 191 |
|
Float_t sr = -100000; |
| 192 |
|
if( il >= 0 ) sl = clsignal[il]; |
| 193 |
|
if( ir < CLlength ) sr = clsignal[ir]; |
| 194 |
|
if( sl == sr && inc == 0 ){ |
| 195 |
|
sn += clsignal[il]/clsigma[il]; |
| 196 |
|
il--; |
| 197 |
|
ir++; |
| 198 |
|
}else if ( sl >= sr && sl > cut*clsigma[il] && inc !=0 ){ |
| 199 |
|
sn += sl/clsigma[il]; |
| 200 |
|
il--; |
| 201 |
|
}else if ( sl < sr && sr > cut*clsigma[ir] ){ |
| 202 |
|
sn += sr/clsigma[ir]; |
| 203 |
|
ir++; |
| 204 |
|
}else break; |
| 205 |
|
|
| 206 |
|
inc++; |
| 207 |
|
} |
| 208 |
|
return sn; |
| 209 |
}; |
}; |
| 210 |
/** |
/** |
| 211 |
* Evaluate the cluster multiplicity. |
* Evaluate the cluster multiplicity. |
| 290 |
*/ |
*/ |
| 291 |
cTrkLevel1* TrkCluster::GetLevel1Struct(){ |
cTrkLevel1* TrkCluster::GetLevel1Struct(){ |
| 292 |
|
|
| 293 |
cTrkLevel1* l1 = new cTrkLevel1; |
// cTrkLevel1* l1 = new cTrkLevel1; |
| 294 |
|
|
| 295 |
l1->nclstr1 = 1; |
cTrkLevel1* l1 = &level1event_ ; |
|
l1->view[0] = view; |
|
|
l1->ladder[0] = GetLadder(); |
|
|
l1->maxs[0] = maxs; |
|
|
l1->mult[0] = GetMultiplicity(); |
|
|
l1->dedx[0] = GetSignal(); |
|
|
l1->indstart[0] = 1; |
|
|
l1->indmax[0] = indmax+1; |
|
|
l1->totCLlength = CLlength; |
|
|
for(Int_t i=0; i<CLlength; i++){ |
|
|
l1->clsignal[i] = clsignal[i]; |
|
|
l1->clsigma[i] = clsigma[i]; |
|
|
l1->cladc[i] = cladc[i]; |
|
|
l1->clbad[i] = clbad[i]; |
|
|
}; |
|
| 296 |
|
|
| 297 |
return l1; |
l1->nclstr1 = 1; |
| 298 |
|
l1->view[0] = view; |
| 299 |
|
l1->ladder[0] = GetLadder(); |
| 300 |
|
l1->maxs[0] = maxs; |
| 301 |
|
l1->mult[0] = GetMultiplicity(); |
| 302 |
|
l1->dedx[0] = GetSignal(); |
| 303 |
|
l1->indstart[0] = 1; |
| 304 |
|
l1->indmax[0] = indmax+1; |
| 305 |
|
l1->totCLlength = CLlength; |
| 306 |
|
for(Int_t i=0; i<CLlength; i++){ |
| 307 |
|
l1->clsignal[i] = clsignal[i]; |
| 308 |
|
l1->clsigma[i] = clsigma[i]; |
| 309 |
|
l1->cladc[i] = cladc[i]; |
| 310 |
|
l1->clbad[i] = clbad[i]; |
| 311 |
|
}; |
| 312 |
|
|
| 313 |
|
return l1; |
| 314 |
}; |
}; |
| 315 |
//-------------------------------------- |
//-------------------------------------- |
| 316 |
// |
// |
| 324 |
*/ |
*/ |
| 325 |
Float_t TrkCluster::GetCOG(Int_t ncog){ |
Float_t TrkCluster::GetCOG(Int_t ncog){ |
| 326 |
|
|
| 327 |
int ic = 1; |
int ic = 1; |
| 328 |
level1event_ = *GetLevel1Struct(); |
GetLevel1Struct(); |
| 329 |
return cog_(&ncog,&ic); |
return cog_(&ncog,&ic); |
| 330 |
|
|
| 331 |
|
}; |
| 332 |
|
/** |
| 333 |
|
* Evaluates the Center-Of-Gravity (COG) of the cluster, in strips, relative to the strip with the maximum signal (TrkCluster::maxs), |
| 334 |
|
* choosing the number of strips according to the angle, as implemented for the eta-algorythm . |
| 335 |
|
* @param angle Projected angle in degree. |
| 336 |
|
*/ |
| 337 |
|
Float_t TrkCluster::GetCOG(Float_t angle){ |
| 338 |
|
|
| 339 |
|
Int_t neta = 0; |
| 340 |
|
|
| 341 |
|
// Float_t eta = GetETA(0,angle); |
| 342 |
|
// for(neta=2; neta<10; neta++) if( eta == GetETA(neta,angle) ) break; |
| 343 |
|
// if(eta != GetETA(neta,angle) )cout << "Attenzione!! pasticcio "<<endl; |
| 344 |
|
|
| 345 |
|
if( view%2 ){ //Y |
| 346 |
|
neta=2; |
| 347 |
|
}else{ //X |
| 348 |
|
if( fabs(angle) <= 10. ){ |
| 349 |
|
neta = 2; |
| 350 |
|
}else if( fabs(angle) > 10. && fabs(angle) <= 15. ){ |
| 351 |
|
neta = 3; |
| 352 |
|
}else{ |
| 353 |
|
neta = 4; |
| 354 |
|
}; |
| 355 |
|
}; |
| 356 |
|
|
| 357 |
|
return GetCOG(neta); |
| 358 |
|
|
| 359 |
}; |
}; |
| 360 |
//-------------------------------------- |
//-------------------------------------- |
| 369 |
*/ |
*/ |
| 370 |
Float_t TrkCluster::GetETA(Int_t neta, float angle){ |
Float_t TrkCluster::GetETA(Int_t neta, float angle){ |
| 371 |
|
|
| 372 |
|
// cout << "GetETA(neta,angle) "<< neta << " "<< angle; |
| 373 |
// LoadPfaParam(); |
// LoadPfaParam(); |
| 374 |
int ic = 1; |
|
| 375 |
level1event_ = *GetLevel1Struct(); |
float ax = angle; |
| 376 |
if(neta == 0) return pfaeta_(&ic,&angle); |
int ic = 1; |
| 377 |
else if(neta == 2) return pfaeta2_(&ic,&angle); |
GetLevel1Struct(); |
| 378 |
else if(neta == 3) return pfaeta3_(&ic,&angle); |
if(neta == 0) return pfaeta_(&ic,&ax); |
| 379 |
else if(neta == 4) return pfaeta4_(&ic,&angle); |
else if(neta == 2) return pfaeta2_(&ic,&ax); |
| 380 |
else cout << "ETA"<<neta<<" not implemented\n"; |
else if(neta == 3) return pfaeta3_(&ic,&ax); |
| 381 |
return 0; |
else if(neta == 4) return pfaeta4_(&ic,&ax); |
| 382 |
|
else cout << "ETA"<<neta<<" not implemented\n"; |
| 383 |
|
return 0; |
| 384 |
|
|
| 385 |
}; |
}; |
| 386 |
|
|
| 387 |
//-------------------------------------- |
//-------------------------------------- |
| 389 |
// |
// |
| 390 |
//-------------------------------------- |
//-------------------------------------- |
| 391 |
TrkLevel1::TrkLevel1(){ |
TrkLevel1::TrkLevel1(){ |
| 392 |
|
|
| 393 |
|
Cluster = new TClonesArray("TrkCluster"); |
| 394 |
|
|
| 395 |
// good1 = -1; |
for(Int_t i=0; i<12 ; i++){ |
| 396 |
|
good[i] = -1; |
| 397 |
Cluster = new TClonesArray("TrkCluster"); |
for(Int_t j=0; j<24 ; j++){ |
| 398 |
|
cn[j][i]=0; |
| 399 |
for(Int_t i=0; i<12 ; i++){ |
// cnrms[j][i]=0; |
| 400 |
// crc[i] = -1; |
cnn[j][i]=0; |
|
good[i] = -1; |
|
|
for(Int_t j=0; j<24 ; j++){ |
|
|
cnev[j][i]=0; |
|
|
cnnev[j][i]=0; |
|
|
}; |
|
|
// fshower[i]=0; |
|
| 401 |
}; |
}; |
| 402 |
|
}; |
| 403 |
} |
} |
| 404 |
//-------------------------------------- |
//-------------------------------------- |
| 405 |
// |
// |
| 407 |
//-------------------------------------- |
//-------------------------------------- |
| 408 |
void TrkLevel1::Dump(){ |
void TrkLevel1::Dump(){ |
| 409 |
|
|
| 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 |
TClonesArray &t = *Cluster; |
for(Int_t i=0; i<12 ; i++){ |
| 415 |
for(int i=0; i<this->nclstr(); i++) ((TrkCluster *)t[i])->Dump(); |
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; |
| 424 |
|
for(int i=0; i<this->nclstr(); i++) ((TrkCluster *)t[i])->Dump(); |
| 425 |
|
|
| 426 |
} |
} |
| 427 |
//-------------------------------------- |
//-------------------------------------- |
| 428 |
// |
// |
| 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){ |
|
|
|
|
// *** CLUSTER *** |
|
|
TrkCluster* t_cl = new TrkCluster(); |
|
|
TClonesArray &t = *Cluster; |
|
|
for(int i=0; i<l1->nclstr1; i++){ |
|
|
|
|
|
t_cl->view = l1->view[i]; |
|
|
t_cl->maxs = l1->maxs[i]; |
|
|
t_cl->indmax = l1->indmax[i] - l1->indstart[i]; |
|
|
|
|
|
Int_t from = l1->indstart[i] -1; |
|
|
Int_t to = l1->totCLlength ; |
|
|
if(i != l1->nclstr1-1)to = l1->indstart[i+1] -1 ; |
|
|
t_cl->CLlength = to - from ; |
|
|
|
|
|
t_cl->clsignal = new Float_t[t_cl->CLlength]; |
|
|
t_cl->clsigma = new Float_t[t_cl->CLlength]; |
|
|
t_cl->cladc = new Int_t[t_cl->CLlength]; |
|
|
t_cl->clbad = new Bool_t[t_cl->CLlength]; |
|
|
Int_t index = 0; |
|
|
for(Int_t is = from; is < to; is++ ){ |
|
|
t_cl->clsignal[index] = (Float_t) l1->clsignal[is]; |
|
|
t_cl->clsigma[index] = (Float_t) l1->clsigma[is]; |
|
|
t_cl->cladc[index] = (Int_t) l1->cladc[is]; |
|
|
t_cl->clbad[index] = (Bool_t) l1->clbad[is]; |
|
|
index++; |
|
|
}; |
|
|
|
|
|
new(t[i]) TrkCluster(*t_cl); |
|
|
}; |
|
|
|
|
|
delete t_cl; |
|
|
|
|
|
// ****general variables**** |
|
| 435 |
|
|
| 436 |
for(Int_t i=0; i<12 ; i++){ |
// --------------- |
| 437 |
good[i] = -1; |
// *** CLUSTER *** |
| 438 |
for(Int_t j=0; j<24 ; j++){ |
// --------------- |
| 439 |
cnev[j][i] = l1->cnev[j][i]; |
TrkCluster* t_cl = new TrkCluster(); |
| 440 |
cnnev[j][i] = l1->cnnev[j][i]; |
TClonesArray &t = *Cluster; |
| 441 |
}; |
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]; |
| 447 |
|
t_cl->maxs = l1->maxs[i]; |
| 448 |
|
t_cl->indmax = l1->indmax[i] - l1->indstart[i]; |
| 449 |
|
|
| 450 |
|
Int_t from = l1->indstart[i] -1; |
| 451 |
|
Int_t to = l1->totCLlength ; |
| 452 |
|
if(i != l1->nclstr1-1)to = l1->indstart[i+1] -1 ; |
| 453 |
|
t_cl->CLlength = to - from ; |
| 454 |
|
|
| 455 |
|
t_cl->clsignal = new Float_t[t_cl->CLlength]; |
| 456 |
|
t_cl->clsigma = new Float_t[t_cl->CLlength]; |
| 457 |
|
t_cl->cladc = new Int_t[t_cl->CLlength]; |
| 458 |
|
t_cl->clbad = new Bool_t[t_cl->CLlength]; |
| 459 |
|
Int_t index = 0; |
| 460 |
|
for(Int_t is = from; is < to; is++ ){ |
| 461 |
|
t_cl->clsignal[index] = (Float_t) l1->clsignal[is]; |
| 462 |
|
t_cl->clsigma[index] = (Float_t) l1->clsigma[is]; |
| 463 |
|
t_cl->cladc[index] = (Int_t) l1->cladc[is]; |
| 464 |
|
t_cl->clbad[index] = (Bool_t) l1->clbad[is]; |
| 465 |
|
index++; |
| 466 |
|
}; |
| 467 |
|
} |
| 468 |
|
new(t[i]) TrkCluster(*t_cl); // <<< store cluster |
| 469 |
|
}; |
| 470 |
|
|
| 471 |
|
delete t_cl; |
| 472 |
|
|
| 473 |
|
// ------------------------- |
| 474 |
|
// ****general variables**** |
| 475 |
|
// ------------------------- |
| 476 |
|
for(Int_t i=0; i<12 ; i++){ |
| 477 |
|
good[i] = l1->good[i]; |
| 478 |
|
for(Int_t j=0; j<24 ; j++){ |
| 479 |
|
cn[j][i] = l1->cnev[j][i]; |
| 480 |
|
// cnrms[j][i] = l1->cnrmsev[j][i]; |
| 481 |
|
cnn[j][i] = l1->cnnev[j][i]; |
| 482 |
}; |
}; |
| 483 |
|
}; |
| 484 |
|
|
| 485 |
} |
} |
| 486 |
/** |
/** |
| 487 |
* Fills a struct cTrkLevel1 with values from a TrkLevel1 object (to put data into a F77 common). |
* Fills a struct cTrkLevel1 with values from a TrkLevel1 object (to put data into a F77 common). |
| 489 |
|
|
| 490 |
cTrkLevel1* TrkLevel1::GetLevel1Struct() { |
cTrkLevel1* TrkLevel1::GetLevel1Struct() { |
| 491 |
|
|
| 492 |
cTrkLevel1 *l1=0; |
cTrkLevel1 *l1=0; |
| 493 |
// |
// |
| 494 |
for(Int_t i=0; i<12 ; i++){ |
for(Int_t i=0; i<12 ; i++){ |
| 495 |
l1->good[i] = good[i]; |
l1->good[i] = good[i]; |
| 496 |
for(Int_t j=0; j<24 ; j++){ |
for(Int_t j=0; j<24 ; j++){ |
| 497 |
l1->cnev[j][i] = cnev[j][i]; |
l1->cnev[j][i] = cn[j][i]; |
| 498 |
l1->cnnev[j][i] = cnnev[j][i]; |
// l1->cnrmsev[j][i] = cnrms[j][i]; |
| 499 |
}; |
l1->cnnev[j][i] = cnn[j][i]; |
| 500 |
}; |
}; |
| 501 |
|
}; |
| 502 |
|
|
| 503 |
// *** CLUSTERS *** |
// *** CLUSTERS *** |
| 504 |
l1->nclstr1 = Cluster->GetEntries(); |
l1->nclstr1 = Cluster->GetEntries(); |
| 505 |
for(Int_t i=0;i<l1->nclstr1;i++){ |
for(Int_t i=0;i<l1->nclstr1;i++){ |
| 506 |
|
|
| 507 |
l1->view[i] = ((TrkCluster *)Cluster->At(i))->view; |
l1->view[i] = ((TrkCluster *)Cluster->At(i))->view; |
| 508 |
l1->maxs[i] = ((TrkCluster *)Cluster->At(i))->maxs; |
l1->maxs[i] = ((TrkCluster *)Cluster->At(i))->maxs; |
|
// COMPLETARE // |
|
|
// COMPLETARE // |
|
|
// COMPLETARE // |
|
|
// COMPLETARE // |
|
|
// COMPLETARE // |
|
|
// COMPLETARE // |
|
|
|
|
|
} |
|
| 509 |
// COMPLETARE // |
// COMPLETARE // |
| 510 |
// COMPLETARE // |
// COMPLETARE // |
| 511 |
// COMPLETARE // |
// COMPLETARE // |
| 512 |
// COMPLETARE // |
// COMPLETARE // |
| 513 |
// COMPLETARE // |
// COMPLETARE // |
| 514 |
// COMPLETARE // |
// COMPLETARE // |
| 515 |
return l1; |
|
| 516 |
|
} |
| 517 |
|
// COMPLETARE // |
| 518 |
|
// COMPLETARE // |
| 519 |
|
// COMPLETARE // |
| 520 |
|
// COMPLETARE // |
| 521 |
|
// COMPLETARE // |
| 522 |
|
// COMPLETARE // |
| 523 |
|
return l1; |
| 524 |
} |
} |
| 525 |
//-------------------------------------- |
//-------------------------------------- |
| 526 |
// |
// |
| 527 |
// |
// |
| 528 |
//-------------------------------------- |
//-------------------------------------- |
| 529 |
void TrkLevel1::Clear(){ |
void TrkLevel1::Clear(){ |
| 530 |
|
|
| 531 |
for(Int_t i=0; i<12 ; i++){ |
for(Int_t i=0; i<12 ; i++){ |
| 532 |
good[i] = -1; |
good[i] = -1; |
| 533 |
for(Int_t j=0; j<24 ; j++){ |
for(Int_t j=0; j<24 ; j++){ |
| 534 |
cnev[j][i] = 0; |
cn[j][i] = 0; |
| 535 |
cnnev[j][i] = 0; |
// cnrms[j][i] = 0; |
| 536 |
}; |
cnn[j][i] = 0; |
| 537 |
}; |
}; |
| 538 |
// |
}; |
| 539 |
Cluster->Clear(); |
// |
| 540 |
|
Cluster->Clear(); |
| 541 |
|
|
| 542 |
} |
} |
| 543 |
//-------------------------------------- |
//-------------------------------------- |
| 544 |
// |
// |
| 546 |
//-------------------------------------- |
//-------------------------------------- |
| 547 |
void TrkLevel1::Delete(){ |
void TrkLevel1::Delete(){ |
| 548 |
|
|
| 549 |
for(Int_t i=0; i<12 ; i++){ |
for(Int_t i=0; i<12 ; i++){ |
| 550 |
good[i] = -1; |
good[i] = -1; |
| 551 |
for(Int_t j=0; j<24 ; j++){ |
for(Int_t j=0; j<24 ; j++){ |
| 552 |
cnev[j][i] = 0; |
cn[j][i] = 0; |
| 553 |
cnnev[j][i] = 0; |
// cnrms[j][i] = 0; |
| 554 |
}; |
cnn[j][i] = 0; |
| 555 |
}; |
}; |
| 556 |
// |
}; |
| 557 |
Cluster->Delete(); |
// |
| 558 |
|
Cluster->Delete(); |
| 559 |
|
|
| 560 |
} |
} |
| 561 |
|
|
| 562 |
//-------------------------------------- |
//-------------------------------------- |
| 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 |
} |
} |