|
FlyoDoc_2011 Pisa 2011 by GmP --- 011
|
Public Member Functions | |
| void | Make_Trk () |
| double | Fitting (short int) |
| int | Verify (short int, int) |
Public Attributes | |
| Track | Traccia [MAXTRACK] |
| Track | TrkNow |
| int | charge_all |
| int | ntrk_done |
| struct { | |
| int id [MAXTRACK] | |
| int mask [MAXTRACK] | |
| int camere [MAXTRACK] | |
| int single [MAXTRACK] | |
| int usepl [MAXTRACK] | |
| int ic0 [MAXTRACK] | |
| int ic1 [MAXTRACK] | |
| int ic2 [MAXTRACK] | |
| int ic3 [MAXTRACK] | |
| float zbyy [MAXTRACK] | |
| float zbyx [MAXTRACK] | |
| float chiq [MAXTRACK] | |
| float charge [MAXTRACK] | |
| float xmg [MAXTRACK] | |
| float ymg [MAXTRACK] | |
| float p [MAXTRACK] | |
| float py [MAXTRACK] | |
| float pxin [MAXTRACK] | |
| float pzin [MAXTRACK] | |
| float pxout [MAXTRACK] | |
| float pzout [MAXTRACK] | |
| float xhodx [MAXTRACK] | |
| float yhodx [MAXTRACK] | |
| float xlkr [MAXTRACK] | |
| float ylkr [MAXTRACK] | |
| } | Trk2Root |
Definition at line 32 of file trgmpstraw.h.
| void TrgmpStraw::Make_Trk | ( | ) |
here find track,,,
Definition at line 61 of file trgmpstraw.cpp.
{
static int codemask[16]={0,1,1,2,1,2,2,3,1,2,2,3,2,3,3,4};
int c0ok,c1ok,c2ok,c3ok, nchamb,nsingle;
int c0flag[30],c1flag[30],c2flag[30],c3flag[30]; // flags to kill the used cluster
for (int i=0;i<30;i++)c0flag[i]=c1flag[i]=c2flag[i]=c3flag[i]=1;// flags set
double chicut=3.;
ntrk=-1;
// Find the Cluster number in straw chambers..
ncls0=ncls1=ncls2=ncls3=0;
if ( pcl0!=0 ) ncls0=pcl0->nclust+1;
if ( pcl1!=0 ) ncls1=pcl1->nclust+1;
if ( pcl2!=0 ) ncls2=pcl2->nclust+1;
if ( pcl3!=0 ) ncls3=pcl3->nclust+1;
int maxcamere=0;// camere coinvolte.
if (ncls0 >-1) maxcamere++;
if (ncls1 >-1) maxcamere++;
if (ncls2 >-1) maxcamere++;
if (ncls3 >-1) maxcamere++;
if (maxcamere <3) return; // minimum 3 chambers
int Single_esiste=pcl0->single_plans+pcl1->single_plans+pcl2->single_plans+pcl3->single_plans;
for (int VisCam=maxcamere; VisCam>2;VisCam--)
{
for (nsingle=0;nsingle<VisCam-1;nsingle++) // single plan loop
{
if (Single_esiste==0&&nsingle>0) continue;
int Istart=0;
if (VisCam <4)Istart=-1;
for ( int ic0=Istart;ic0<ncls0;ic0++)
{
c0ok=0;
if (ic0>-1&&c0flag[ic0]>-1)
{
Hitp[0]= pcl0->Clus[ic0];
c0ok=1;// prima camera
}
else Hitp[0].mask=Hitp[0].planes=0;
for ( int ic1=Istart;ic1<ncls1;ic1++)
{
c1ok=0;
if (ic1>-1&&c1flag[ic1]>-1) {
Hitp[1]= pcl1->Clus[ic1];
c1ok=2; // seconda camera
}
else Hitp[1].mask=Hitp[1].planes=0;
for ( int ic2=Istart;ic2<ncls2;ic2++)
{
c2ok=0;
if (ic2>-1&&c2flag[ic2]>-1) {
Hitp[2]= pcl2->Clus[ic2];
c2ok=4; // terza camera
}
else Hitp[2].mask=Hitp[2].planes=0;
for ( int ic3=Istart;ic3<ncls3;ic3++)
{
c3ok=0;
if (ic3>-1&&c3flag[ic3]>-1) {
Hitp[3]= pcl3->Clus[ic3];
c3ok=8;
}
else Hitp[3].mask=Hitp[3].planes=0;
short int mask_cam;
mask_cam=c0ok+c1ok+c2ok+c3ok;
nchamb=codemask[mask_cam];
if (nchamb!=VisCam) continue; // no enough active chamber
//verifica della configurazione per trattare i cluster con un piano
TrkNow.used_plans=0;
if (Single_esiste>0)
if (Verify(mask_cam,nsingle)<0) continue;
// fitting data
// double chiq= Fitting(mask_cam,Hitp);
double chiq= Fitting(mask_cam);
if (Eventi_Fatti==errordebug)
Gout<<"\n Ev "<< Eventi_Fatti <<" chiq "<<chiq
<<" camere "<< VisCam
<<" Single_esite "<<Single_esiste <<" Single "<<nsingle
<<" msk "<< Hitp[0].mask <<" "<< Hitp[1].mask <<" "<< Hitp[2].mask <<" "<< Hitp[3].mask
<<" Ic.. "<<ic0<<" "<<ic1 <<" "<<ic2 <<" "<<ic3<<flush;
//save track
if (chiq>-0.001&&chiq<chicut)
{
ntrk++;
// save traccia
Traccia[ntrk]=TrkNow;
Traccia[ntrk].id=ntrk;
Traccia[ntrk].camere=nchamb;
Traccia[ntrk].single=nsingle;
Traccia[ntrk].ic0=ic0;
Traccia[ntrk].ic1=ic1;
Traccia[ntrk].ic2=ic2;
Traccia[ntrk].ic3=ic3;
if (ic0>-1) {
c0flag[ic0]=-1;
c0ok=0;
}
if (ic1>-1) {
c1flag[ic1]=-1;
c1ok=0;
}
if (ic2>-1) {
c2flag[ic2]=-1;
c2ok=0;
}
if (ic3>-1) {
c3flag[ic3]=-1;
c3ok=0;
}
}
}
}
}
}
}
}
charge_all=0;
for (int i=0;i<ntrk+1;i++)
{
charge_all+=Traccia[i].charge;
// Traccia[i].Print_Trk();
}
Track2Root();
}