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 |
float pfaetal_(int*,float*); |
float pfaetal_(int*,float*); |
20 |
int npfastrips_(int*,float*); |
float digsat_(int*); |
21 |
|
int npfastrips_(int*,float*); |
22 |
|
|
23 |
|
float fbad_cog_(int*,int*); |
24 |
|
float risx_cog_(float*); |
25 |
|
float risy_cog_(float*); |
26 |
} |
} |
27 |
//-------------------------------------- |
//-------------------------------------- |
28 |
// |
// |
411 |
* @param ncog Number of strips to evaluate COG. |
* @param ncog Number of strips to evaluate COG. |
412 |
* If ncog=0, the COG of the cluster is evaluated according to the cluster multiplicity (defined by the inclusion cut). |
* If ncog=0, the COG of the cluster is evaluated according to the cluster multiplicity (defined by the inclusion cut). |
413 |
* If ncog>0, the COG is evaluated using ncog strips, even if they have a negative signal (according to G.Landi) |
* If ncog>0, the COG is evaluated using ncog strips, even if they have a negative signal (according to G.Landi) |
414 |
|
* |
415 |
|
* (NB TrkCluster::GetLevel1Struct() showld be called first, in order to fill the F77 level1 common with this single cluster) |
416 |
*/ |
*/ |
417 |
Float_t TrkCluster::GetCOG(Int_t ncog){ |
Float_t TrkCluster::GetCOG(Int_t ncog){ |
418 |
|
|
419 |
int ic = 1; |
int ic = 1; |
420 |
GetLevel1Struct(); |
// GetLevel1Struct(); //Elena: dangerous... |
421 |
return cog_(&ncog,&ic); |
return cog_(&ncog,&ic); |
422 |
|
|
423 |
}; |
}; |
461 |
* @param angle Projected (effective) angle between particle track and detector plane. |
* @param angle Projected (effective) angle between particle track and detector plane. |
462 |
* @landi flag to apply Landi correction |
* @landi flag to apply Landi correction |
463 |
* Implemented values of neta are 2,3,4. If neta=0, ETA2, ETA3 and ETA4 are applied according to the angle. |
* Implemented values of neta are 2,3,4. If neta=0, ETA2, ETA3 and ETA4 are applied according to the angle. |
464 |
|
* (NB TrkCluster::GetLevel1Struct() showld be called first, in order to fill the F77 level1 common with this single cluster) |
465 |
*/ |
*/ |
466 |
Float_t TrkCluster::GetETA(Int_t neta, float angle, bool landi){ |
Float_t TrkCluster::GetETA(Int_t neta, float angle, bool landi){ |
467 |
|
|
476 |
|
|
477 |
float ax = angle; |
float ax = angle; |
478 |
int ic = 1; |
int ic = 1; |
479 |
GetLevel1Struct(); |
//GetLevel1Struct(); //Elena: dangerous... |
480 |
if( neta == 0 && !landi) return pfaeta_(&ic,&ax); |
if( neta == 0 && !landi) return pfaeta_(&ic,&ax); |
481 |
else if(neta == 0 && landi ) return pfaetal_(&ic,&ax); |
else if(neta == 0 && landi ) return pfaetal_(&ic,&ax); |
482 |
else if(neta == 2 ) return pfaeta2_(&ic,&ax); |
else if(neta == 2 ) return pfaeta2_(&ic,&ax); |
488 |
}; |
}; |
489 |
|
|
490 |
/** |
/** |
491 |
|
* Evaluates the cluster position, in pitch units, relative to the strip |
492 |
|
* with the maximum signal (TrkCluster::maxs), by applying the digital |
493 |
|
* algorithm for saturated clusters. |
494 |
|
* |
495 |
|
* @return The cluster position (0 also if if no saturated strip is found). |
496 |
|
* |
497 |
|
* (NB TrkCluster::GetLevel1Struct() showld be called first, in order to fill the F77 level1 common with this single cluster) |
498 |
|
*/ |
499 |
|
Float_t TrkCluster::GetDigSat() { |
500 |
|
|
501 |
|
// GetLevel1Struct(); //Elena: dangerous... |
502 |
|
int ic = 1; |
503 |
|
return digsat_(&ic); |
504 |
|
|
505 |
|
} |
506 |
|
|
507 |
|
/** |
508 |
* Evaluates the cluster position, in pitch unit, relative to the strip with |
* Evaluates the cluster position, in pitch unit, relative to the strip with |
509 |
* the maximum signal (TrkCluster::maxs), by applying the PFA set as default (see TrkParams). |
* the maximum signal (TrkCluster::maxs), by applying the PFA set as default (see TrkParams). |
510 |
* @param angle Projected (effective) angle between particle track and detector plane. |
* @param angle Projected (effective) angle between particle track and detector plane. |
532 |
* according to the p.f.a. |
* according to the p.f.a. |
533 |
* It returns 0 when the COG is used (in this case the number of strip used |
* It returns 0 when the COG is used (in this case the number of strip used |
534 |
* equals the multiplicity). |
* equals the multiplicity). |
535 |
|
* (NB TrkCluster::GetLevel1Struct() showld be called first, in order to fill the F77 level1 common with this single cluster) |
536 |
*/ |
*/ |
537 |
Int_t TrkCluster::GetPFAstrips(float angle){ |
Int_t TrkCluster::GetPFAstrips(float angle){ |
538 |
|
|
539 |
float ax = angle; |
float ax = angle; |
540 |
int ic = 1; |
int ic = 1; |
541 |
GetLevel1Struct(); |
// GetLevel1Struct(); //Elena: dangerous... |
542 |
return npfastrips_(&ic,&ax); |
return npfastrips_(&ic,&ax); |
543 |
|
|
544 |
} |
} |
897 |
|
|
898 |
} |
} |
899 |
|
|
900 |
|
//-------------------------------------- |
901 |
|
// |
902 |
|
// |
903 |
|
//-------------------------------------- |
904 |
|
/** |
905 |
|
* Method to fill a TrkLevel1 object from an existing one, by cleaning low-signal clusters. |
906 |
|
* |
907 |
|
*/ |
908 |
|
void TrkLevel1::Set(TrkLevel1 *trkl1, float mipCut, float fCut){ |
909 |
|
|
910 |
|
|
911 |
|
|
912 |
|
if(!trkl1)return; |
913 |
|
|
914 |
|
// ------------------------- |
915 |
|
// ****general variables**** |
916 |
|
// ------------------------- |
917 |
|
for(Int_t i=0; i<12 ; i++){ |
918 |
|
good[i] = trkl1->good[i]; |
919 |
|
for(Int_t j=0; j<24 ; j++){ |
920 |
|
cn[j][i] = trkl1->cn[j][i]; |
921 |
|
cnn[j][i] = trkl1->cnn[j][i]; |
922 |
|
}; |
923 |
|
}; |
924 |
|
// ------------------------- |
925 |
|
// ****cluster array**** |
926 |
|
// ------------------------- |
927 |
|
|
928 |
|
if(Cluster)Cluster->Clear("C"); |
929 |
|
Cluster = new TClonesArray("TrkCluster"); |
930 |
|
TClonesArray &t = *Cluster; |
931 |
|
|
932 |
|
if ( trkl1->GetClusters() ){ // EM: crash nuclei alg when DSP status: -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 |
933 |
|
int isel=0; |
934 |
|
for(int icl=0 ; icl< trkl1->GetClusters()->GetEntries(); icl++){ |
935 |
|
TrkCluster *cl = trkl1->GetCluster(icl); |
936 |
|
|
937 |
|
float mip = TrkParams::GetMIP(cl->GetLadder()-1,cl->view-1); |
938 |
|
float smip = cl->GetSignal()/(mip>0.?mip:1.); |
939 |
|
float smax = cl->clsignal[cl->indmax]/(mip>0.?mip:1.); |
940 |
|
if(smax/smip<fCut)continue; |
941 |
|
if(smip<mipCut)continue; |
942 |
|
if(smax<0.5*mipCut)continue; |
943 |
|
|
944 |
|
|
945 |
|
|
946 |
|
new(t[isel]) TrkCluster(*cl); // <<< store cluster |
947 |
|
isel++; |
948 |
|
} |
949 |
|
} |
950 |
|
|
951 |
|
|
952 |
|
|
953 |
|
} |
954 |
|
|
955 |
ClassImp(TrkLevel1); |
ClassImp(TrkLevel1); |
956 |
ClassImp(TrkCluster); |
ClassImp(TrkCluster); |