FlyoDoc_2011 Pisa 2011 by GmP --- 011
Public Member Functions | Public Attributes

AnaK6g Class Reference

#include <anak6g.h>

Inheritance diagram for AnaK6g:
AnaK4g Analisi

List of all members.

Public Member Functions

 AnaK6g ()
void Reset_parm ()
int Fisica ()
void Permutazione (int)
int Get_Data_from_saved (int)
int * Get_Permuta (int)
int Fitta ()
double Calcolo_Vincoli ()
double F_Vinc (int i4, double *ec, double dist, int id, double delta)
void Reset_Dummy_Data ()
void Save_good_fit ()

Public Attributes

int ngm
int dead6
int permut_fit
int iter_fit
float eg_fit [6]
float dist_fit
float cog_fit
float egamt_fit
float bmax
float ws6 [3]
float ss6 [3]
float vss6 [3]
float ss6_sort
float vss6_sort
float dist_sort
double last_chiq
double dchi2
gmatrix Bm64
gmatrix Az41
gmatrix F41
gmatrix R41
gmatrix De61
gmatrix Lmd41
gmatrix Zm11
gmatrix Var66
gmatrix InV66
gmatrix BVB
gmatrix GB
gmatrix AGBA
gmatrix Gx
gmatrix CHQ
float Ass [3]
float Ae_fit [6]
float Ax_fit [6]
float Ay_fit [6]
float Ase_fit [6]
float Asx_fit [6]
float Asy_fit [6]
float Azeta
float Avita
float Vertex [3]
float Vsigsq [3]
float Ener
float Esigsq
float ChiKin
int iter_flag
int permut_flag
float xg_fit [6]
float yg_fit [6]
double em [6]
double ec [6]
double egtk6
double sq [6]
double xg [6]
double yg [6]
double dist_vertex
double dq [6][6]
double xg_sav [12]
double yg_sav [12]
double zg_sav [12]
double eg_sav [12]
int idpr_fit [12]
int idpr_sav [12]
qvet Gq [6]
qvet Pio01
qvet Pio23
qvet Pio45
gvet Versg
gvet Pgam

Detailed Description

Procedura per Kl->6gam analysis

Author:
Giuseppe Pierazzini

Definition at line 20 of file anak6g.h.


Constructor & Destructor Documentation

AnaK6g::AnaK6g ( )

Ipotesi K-> 3 pi neutri Studio del cups

Definition at line 23 of file anak6g.cpp.

{
  tipo=2;nfit=6;titol="K--> 3 pi0 -> 6 gam" ;nome="K6gam";
  Gout<<"\n Ridefinito e creato il fit di "<<titol;
  // gmatrix set size;
  Bm64.Set_Size ( 6,4 );Az41.Set_Size ( 4,1 );
  F41.Set_Size ( 4,1 ); R41.Set_Size ( 4,1 );
  De61.Set_Size ( 6,1 );Lmd41.Set_Size ( 4,1 );
  Zm11.Set_Size ( 1,1 );
  Var66.Set_Size ( 6,6 ); InV66.Set_Size ( 6,6 );

  BVB.Set_Size ( 4,4 );
  GB.Set_Size ( 4,4 );
  AGBA.Set_Size ( 1,1 );
  Gx.Set_Size ( 1,1 );
  CHQ.Set_Size ( 1,1 );

}

Member Function Documentation

int AnaK6g::Fisica ( ) [virtual]

Fit ipotesi K-> 3 pi neutri Studio del cups

Reimplemented from AnaK4g.

Definition at line 57 of file anak6g.cpp.

{
  
  if ( Debugon==1 ) Write_titol();

  count_call++;
  Reset_parm();
  ngm = mishit=lkry->mhit;
  if ( WrtNt>1 ) Reset_Dummy_Data();  // se si scrivono tutti gli eventi

// also 7 gammas for dalitz....
  if ( mishit<6 ) {getta_gg++;dead6=-1;return -1;}
//if( mishit>6 ) {getta_gg++;dead6=-1;return -1;}   //too many gammas..

  double xi,yi,egx;
  bmax=0.;egamtot=0.;
  int ngood=-1;
  for ( int i=0;i<mishit;i++ )
  {

    xi=lkry->M_Hits[i].Xdev.x;
    yi=lkry->M_Hits[i].Xdev.y;
    egx=lkry->M_Hits[i].e_rivela;


    if ( egx<3.||egx>100. ) {nextra++; continue;}  // giudici 2007 energia test

    // goemetrical cut

    double braccio=sqrt ( xi*xi+yi*yi ); if ( braccio>bmax ) bmax=braccio;
    if ( braccio<15. )               continue;
//    if ( braccio>116. )             continue;   // circolar 116.

    double absx=fabs ( xi ), absy=fabs ( yi );
    if ( absx >116. || absy >116. ) continue;
    if ( absx +absy > 164. )       continue; // rectangular  116.*sqrt(2)
    if ( absx >63.2 && absy >84.7 ) continue;
    if ( absx >52.2 && absy >94.7 ) continue;
    if ( pow ( ( absx-63.2 ),2 ) +pow ( ( absy-94.7 ),2 ) < 121. )  continue;  //octagonal

// save the good gammas in _sav
    ngood++;
    eg_sav[ngood]  =egx;
    xg_sav[ngood]  =xi;
    yg_sav[ngood]  =yi;
    zg_sav[ngood]  =lkry->M_Hits[i].Xlab.z;
    idpr_sav[ngood]=lkry->M_Hits[i].idm;
    egamtot+=egx;
  }


  // cut on gammas  on the base of fit type..here 6 [5 in C++]
  if ( ngood<5 ) {getta_gg++;dead6=-3;return -3;}
  if ( egamtot< 60. ) {getta_en++; dead6=-4;return -4;}


  int Debug_fit=0;  // per test se ==1
  if ( Debug_fit==1 )
  {
    int ngboni=ngood+1;
    Gout<<setprecision ( 3 );
    Gout<<"\n Start   "<<evento_.Gen.Event<<" whit "<<ngboni
    <<" gam  e zv "<<setw ( 8 ) <<evento_.Gen.zv <<" etot "<<setw ( 8 ) <<egamtot
    <<" Lkrz "<<lkry->Get_Cface().z;
    for ( int i=0;i<ngboni;i++ )
      Gout<<"\nG xyze "<<setw ( 8 ) <<xg_sav[i]<<" "
      <<setw ( 8 ) <<yg_sav[i]<<" "
      <<setw ( 8 ) <<eg_sav[i]<<" Idm "<<idpr_sav[i];
    Gout<<endl;
  }

//    FITTING   begin
  nd=0;
  chisq=15.;

// se ci sono sette gamma si itera sulle possibili 6-ple (sette ipotesi)
  int ik =0, ipotesi=1, iok=0;
  if ( ngood==6 ) ipotesi=7;
  while ( ik< ipotesi )
  {
    if ( Get_Data_from_saved ( ik ) <0 ) { ik++;continue;} // select the 6-pla

// first large cuts on neasured values....just to speed up the fitting...gmatrix
    if ( egamtot< 60.||egamtot>180. ) {ik++;continue;}
    if ( cog > 100.0 ) {ik++;continue;}
    ik++;

// debug ======gmatrix
    if ( Debug_fit>=2 )
    {
      for ( int i=0;i<6;i++ )
        Gout<<"\nC xyze "<<setw ( 8 ) <<xgood[i]<<" "
        <<setw ( 8 ) <<ygood[i]<<" "
        <<setw ( 8 ) <<egood[i]<<" Idm "<<idpr[i];
      Gout<<endl;
    }
// end debug =====

//    procedure    F I T T A


    if ( Fitta() ==1 ) iok=1;
  }
  if ( iok==0 ) return -1; // non ci sono fit ok...
  // debug =====

  if ( Debug_fit==1 )
  {
    Gout<<setprecision ( 3 );
    Gout<<"\n Fit ev   "<<evento_.Gen.Event<<" ipot. "<<ik<<" itr "<<iter_fit
    <<" chq "<<setw ( 8 ) <<chisq<<" zeta "<<setw ( 8 ) <<zeta <<" et "<<setw ( 8 ) <<egamt_fit;

    for ( int i=0;i<6;i++ )
      Gout<<"\nF xyze "<<setw ( 8 ) <<xg_fit[i]<<" " <<setw ( 8 ) <<yg_fit[i]
      <<setw ( 8 ) <<eg_fit[i]<<"  Perm "<<permut_fit<<" Idm "<<idpr_fit[i];
    Gout<<endl;

  }

//  ------------fit done ----
  if ( egamt_fit<70. ||egamt_fit>170. ) {getta_en++; dead6=-4;return -4;}

  if ( chisq>15. )  {getta_fit++;dead6=-6;return -6;} // wrong chiq in the fit!
  if ( dist_fit<0.0 ) {getta_gf++;dead6=-7;return -7;} // wrong vx dist_fit
//  if (cog_fit>20.0) {getta_cog++; dead6=-5;return -5;} // wrong cog_fit
  if ( cog_fit>100.0 ) {getta_cog++; dead6=-5;return -5;} // wrong cog_fit  19.07.09
//  time life cut from aks for Kl
//  aks=607.2; // posizione della coincidenza
  double volo=zeta-607.2;

//massa Ks=0.497648;
  cvita= ( ( volo*0.497648 ) /egamt_fit ) /2.6842;    //19.07.09
//  if ( cvita<-2.|| cvita>10. ) {getta_tau++;dead6=-8;return -8;}   //no il 19.07.09
  if ( cvita> ( 0.8+0.06*egamt_fit ) ) {getta_tau++;dead6=-9;return -9;}

// define cinematic variables

  for ( int i=0;i<6;i++ )
  {
    Versg.setvn ( xg_fit[i],yg_fit[i],dist_fit ); Pgam=Versg.NVerso() *eg_fit[i];
    Gq[i].setvn ( Pgam,0.0 );
  }


  Pio01=Gq[0]+Gq[1];mgg[0]=  Pio01.Invarq();
  Pio23=Gq[2]+Gq[3];mgg[1]=  Pio23.Invarq();
  Pio45=Gq[4]+Gq[5];mgg[2]=  Pio45.Invarq();
  
  if(mgg[0]>0.)mgg[0]=sqrt(mgg[0]); else mgg[0]=-sqrt(fabs(mgg[0]));
  if(mgg[1]>0.)mgg[1]=sqrt(mgg[1]); else mgg[1]=-sqrt(fabs(mgg[1]));
  if(mgg[2]>0.)mgg[2]=sqrt(mgg[2]); else mgg[2]=-sqrt(fabs(mgg[2]));
  
  qvet Pm12=Pio23+Pio45;
  qvet Pm02=Pio01+Pio45;
  qvet Pm01=Pio23+Pio01;

  ss6[0]= Pm12.Invarq();
  ss6[1]= Pm02.Invarq();
  ss6[2]= Pm01.Invarq();
  
  vss6[0]= fabs(ss6[1]-ss6[2])*0.577350269;//1./sqrt(3.)
  vss6[1]= fabs(ss6[2]-ss6[0])*0.577350269;
  vss6[2]= fabs(ss6[0]-ss6[1])*0.577350269;

  int Irand=evento_.Gen.Irand_ss;

  if ( Irand==0 )
  {
    ss6_sort=ss6[0];  
    vss6_sort=vss6[0];
  }
  else if ( Irand==1 )
  {
    ss6_sort=ss6[1];  
    vss6_sort=vss6[1];
  }
  else if ( Irand==2 )
  {
    ss6_sort=ss6[2];  
    vss6_sort=vss6[2]; 
  }
  
  
  

//   Pio01.print("p01");  Gout<<setprecision(6)<<" "<<Pio01.m<<"  pi0m "<<pi0mass<<" " <<4.*pi0massq;
//   Pio23.print("p23");  Gout<<setprecision(6)<<" "<<Pio23.m<<" ss6[0] "<<ss6[0]<<" " <<evento_.Gen.ss0;
//   Pio45.print("p45");  Gout<<setprecision(6)<<" "<<Pio45.m<<" dif "<<ss6[0]-evento_.Gen.ss0;


// calcolo il peso per ogni ss
  double wpeso;
  wpeso=Fspace ( 0.49767,Pm12.m, 0.13497 )  *Fspace ( Pm12.m, 0.13497,0.13497 );
  if ( wpeso>0.0 ) ws6[0]=1./wpeso;
  wpeso=Fspace ( 0.49767,Pm02.m, 0.13497 ) *Fspace ( Pm02.m, 0.13497,0.13497 );
  if ( wpeso>0.0 ) ws6[1]=1./wpeso;
  wpeso=Fspace ( 0.49767,Pm01.m, 0.13497 ) *Fspace ( Pm01.m, 0.13497,0.13497 );
  if ( wpeso>0.0 ) ws6[2]=1./wpeso;
  //-------------------------
  count_wnt++; dead6=0;
  return 1;
}

The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables