Changes due to the coding conventions
authorkowal2 <kowal2@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 11 Nov 2003 07:23:35 +0000 (07:23 +0000)
committerkowal2 <kowal2@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 11 Nov 2003 07:23:35 +0000 (07:23 +0000)
TPC/AliTPCPid.cxx
TPC/AliTPCPid.h

index 86c5941a185af50c80f65ae9b478635d3d7c67b7..912a40610fad2af5061da091a6cd4bc8d6dce195 100644 (file)
 
 #include "AliTPCPid.h"
 #include "TMath.h"
 
 #include "AliTPCPid.h"
 #include "TMath.h"
+//#include <TVector.h>
+#include <TF1.h>
+#include <TClonesArray.h>
 //#include "AliITSIOTrack.h"
 #include "Riostream.h"
 ClassImp(AliTPCPid)
 // Correction 13.01.2003 Z.S.,Dubna
 //            22.01.2003
 //------------------------------------------------------------
 //#include "AliITSIOTrack.h"
 #include "Riostream.h"
 ClassImp(AliTPCPid)
 // Correction 13.01.2003 Z.S.,Dubna
 //            22.01.2003
 //------------------------------------------------------------
-Float_t AliTPCPid::qcorr(Float_t xc)
+// pid class by B. Batyunya
+// stupid corrections by M.K.
+//
+//________________________________________________________
+  AliTPCPid::AliTPCPid( const AliTPCPid& r):TObject(r)
 {
 {
+  // dummy copy constructor
+}
+Float_t AliTPCPid::Qcorr(Float_t xc)
+{
+  //
+  // charge correction
+  //
     assert(0);
   Float_t fcorr;
   fcorr=( 0.766 +0.9692*xc -1.267*xc*xc )*( 1.-TMath::Exp(-xc*64.75) );
   if(fcorr<=0.1)fcorr=0.1;
     assert(0);
   Float_t fcorr;
   fcorr=( 0.766 +0.9692*xc -1.267*xc*xc )*( 1.-TMath::Exp(-xc*64.75) );
   if(fcorr<=0.1)fcorr=0.1;
-return qtot/fcorr;
+return fqtot/fcorr;
 }
 //-----------------------------------------------------------
 }
 //-----------------------------------------------------------
-Float_t AliTPCPid::qtrm(Int_t track)
+Float_t AliTPCPid::Qtrm(Int_t track) const
 {
 {
+  //
+  // dummy comment (Boris!!!)
+  //
     TVector q(*( this->GetVec(track)  ));
     Int_t ml=(Int_t)q(0);
     if(ml<1)return 0.;
     TVector q(*( this->GetVec(track)  ));
     Int_t ml=(Int_t)q(0);
     if(ml<1)return 0.;
@@ -57,9 +74,9 @@ Float_t AliTPCPid::qtrm(Int_t track)
     }
     for(Int_t i=0;i<nl;i++){q(i+1)=vf[i];} this->SetVec(track,q);
     return (q(6));
     }
     for(Int_t i=0;i<nl;i++){q(i+1)=vf[i];} this->SetVec(track,q);
     return (q(6));
-}// --- End AliTPCPid::qtrm ---
+}// --- End AliTPCPid::Qtrm ---
 
 
-Float_t AliTPCPid::qtrm(Float_t qarr[6],Int_t narr)
+Float_t AliTPCPid::Qtrm(Float_t qarr[6],Int_t narr)
 {
   //..................
   Float_t q[6],qm,qmin;
 {
   //..................
   Float_t q[6],qm,qmin;
@@ -82,18 +99,21 @@ Float_t AliTPCPid::qtrm(Float_t qarr[6],Int_t narr)
         break;
     }
     return qm;
         break;
     }
     return qm;
-}// --- End AliTPCPid::qtrm  ---
+}// --- End AliTPCPid::Qtrm  ---
 
 
-Int_t  AliTPCPid::wpik(Int_t nc,Float_t q)
+Int_t  AliTPCPid::Wpik(Int_t nc,Float_t q)
 {
 {
+  //
+  //  pi-k
+  //
     Float_t qmpi,qmk,sigpi,sigk,dpi,dk,ppi,pk;
     Float_t appi,apk;
     Float_t qmpi,qmk,sigpi,sigk,dpi,dk,ppi,pk;
     Float_t appi,apk;
-    qmpi =cut[nc][1];
-    sigpi=cut[nc][2];
-    qmk  =cut[nc][3];
-    sigk =cut[nc][4];
-    appi = aprob[0][nc-5];
-    apk  = aprob[1][nc-5];
+    qmpi =fcut[nc][1];
+    sigpi=fcut[nc][2];
+    qmk  =fcut[nc][3];
+    sigk =fcut[nc][4];
+    appi = faprob[0][nc-5];
+    apk  = faprob[1][nc-5];
     if( !fSilent ){
     cout<<"qmpi,sigpi,qmk,sigk="<<qmpi<<"  "<<sigpi<<"  "<<qmk<<"  "<<sigk<<endl;
     cout<<"appi,apk="<<appi<<","<<apk<<endl;
     if( !fSilent ){
     cout<<"qmpi,sigpi,qmk,sigk="<<qmpi<<"  "<<sigpi<<"  "<<qmk<<"  "<<sigk<<endl;
     cout<<"appi,apk="<<appi<<","<<apk<<endl;
@@ -106,33 +126,35 @@ Int_t     AliTPCPid::wpik(Int_t nc,Float_t q)
     if(dn>0.){
       ppi=appi*TMath::Gaus(q,qmpi,sigpi)/dn;
       pk = apk*TMath::Gaus(q,qmk, sigk )/dn;
     if(dn>0.){
       ppi=appi*TMath::Gaus(q,qmpi,sigpi)/dn;
       pk = apk*TMath::Gaus(q,qmk, sigk )/dn;
-    }else{fWpi=1;return pion();}
+    }else{fWpi=1;return Pion();}
     Float_t rpik=ppi/(pk+0.0000001); 
     if( !fSilent )
     Float_t rpik=ppi/(pk+0.0000001); 
     if( !fSilent )
-       cout<<"q,dqpi,dqk, wpik: ppi,pk,rpik="
+       cout<<"q,dqpi,dqk, Wpik: ppi,pk,rpik="
        <<q<<"  "<<dqpi<<"  "<<dqk<<"  "<<ppi<<"  "<<pk<<"  "<<rpik<<endl;
 
     fWp=0.; fWpi=ppi; fWk=pk;
        <<q<<"  "<<dqpi<<"  "<<dqk<<"  "<<ppi<<"  "<<pk<<"  "<<rpik<<endl;
 
     fWp=0.; fWpi=ppi; fWk=pk;
-    if( pk>ppi){return kaon();}else{return pion();}
+    if( pk>ppi){return Kaon();}else{return Pion();}
 }
 //-----------------------------------------------------------
 }
 //-----------------------------------------------------------
-//inline
-Int_t  AliTPCPid::wpikp(Int_t nc,Float_t q)
+Int_t  AliTPCPid::Wpikp(Int_t nc,Float_t q)
 {
 {
+  //
+  // pi-k-p
+  //
    Float_t qmpi,qmk,qmp,sigpi,sigk,sigp,ppi,pk,pp;
    Float_t appi,apk,app;
 
    Float_t qmpi,qmk,qmp,sigpi,sigk,sigp,ppi,pk,pp;
    Float_t appi,apk,app;
 
-    qmpi =cut[nc][1];
-    sigpi=cut[nc][2];
-    qmk  =cut[nc][3];
-    sigk =cut[nc][4];
-    qmp  =cut[nc][5];
-    sigp =cut[nc][6];
+    qmpi =fcut[nc][1];
+    sigpi=fcut[nc][2];
+    qmk  =fcut[nc][3];
+    sigk =fcut[nc][4];
+    qmp  =fcut[nc][5];
+    sigp =fcut[nc][6];
 
     //appi = apk = app = 1.;
 
     //appi = apk = app = 1.;
-    appi = aprob[0][nc-5];
-    apk  = aprob[1][nc-5];
-    app  = aprob[2][nc-5];
+    appi = faprob[0][nc-5];
+    apk  = faprob[1][nc-5];
+    app  = faprob[2][nc-5];
 
     Double_t dn= appi*TMath::Gaus(q,qmpi,sigpi)
       +apk*TMath::Gaus(q,qmk,sigk)+app*TMath::Gaus(q,qmp,sigp);
 
     Double_t dn= appi*TMath::Gaus(q,qmpi,sigpi)
       +apk*TMath::Gaus(q,qmk,sigk)+app*TMath::Gaus(q,qmp,sigp);
@@ -141,32 +163,38 @@ Int_t     AliTPCPid::wpikp(Int_t nc,Float_t q)
     pk = apk*TMath::Gaus(q,qmk, sigk )/dn;
     pp = app*TMath::Gaus(q,qmp, sigp )/dn;
      }
     pk = apk*TMath::Gaus(q,qmk, sigk )/dn;
     pp = app*TMath::Gaus(q,qmp, sigp )/dn;
      }
-    else{fWpi=1;return pion();}
+    else{fWpi=1;return Pion();}
     fWp=pp; fWpi=ppi; fWk=pk;
     if( !fSilent ){
     fWp=pp; fWpi=ppi; fWk=pk;
     if( !fSilent ){
-cout<<" wpikp: mid,sig pi,k,p="<<qmpi<<" "<<sigpi<<";   "<<qmk<<" "<<sigk<<";   "
+cout<<" Wpikp: mid,sig pi,k,p="<<qmpi<<" "<<sigpi<<";   "<<qmk<<" "<<sigk<<";   "
     <<qmp<<" "<<sigp<<"; "<<endl;
     <<qmp<<" "<<sigp<<"; "<<endl;
-cout<<" aprob: "<<appi<<"  "<<apk<<"  "<<app<<endl;
+cout<<" faprob: "<<appi<<"  "<<apk<<"  "<<app<<endl;
 cout<<" ppi,pk,pp="<<ppi<<"  "<<pk<<"  "<<pp<<endl;
      }
 cout<<" ppi,pk,pp="<<ppi<<"  "<<pk<<"  "<<pp<<endl;
      }
-    if( ppi>pk&&ppi>pp )  { return pion(); }
-    if(pk>pp){return kaon();}else{return proton();}
+    if( ppi>pk&&ppi>pp )  { return Pion(); }
+    if(pk>pp){return Kaon();}else{return Proton();}
 }
 //-----------------------------------------------------------
 }
 //-----------------------------------------------------------
-Int_t  AliTPCPid::GetPcode(TClonesArray* /*rps*/,Float_t /*pm*/)
+Int_t  AliTPCPid::GetPcode(TClonesArray* /*rps*/,Float_t /*pm*/) const
 {
 {
+  //
+  // dummy ???
+  //
     return 0;    
 }
 //-----------------------------------------------------------
 Int_t   AliTPCPid::GetPcode(AliTPCtrack *track)
 {
     return 0;    
 }
 //-----------------------------------------------------------
 Int_t   AliTPCPid::GetPcode(AliTPCtrack *track)
 {
+  //
+  // get particle code
+  //
       Double_t xk,par[5]; track->GetExternalParameters(xk,par);
       Float_t phi=TMath::ASin(par[2]) + track->GetAlpha();
       if (phi<-TMath::Pi()) phi+=2*TMath::Pi();
       if (phi>=TMath::Pi()) phi-=2*TMath::Pi();
       Float_t lam=TMath::ATan(par[3]); 
       Double_t xk,par[5]; track->GetExternalParameters(xk,par);
       Float_t phi=TMath::ASin(par[2]) + track->GetAlpha();
       if (phi<-TMath::Pi()) phi+=2*TMath::Pi();
       if (phi>=TMath::Pi()) phi-=2*TMath::Pi();
       Float_t lam=TMath::ATan(par[3]); 
-      Float_t pt_1=TMath::Abs(par[4]);
-      Float_t mom=1./(pt_1*TMath::Cos(lam));
+      Float_t pt1=TMath::Abs(par[4]);
+      Float_t mom=1./(pt1*TMath::Cos(lam));
       Float_t dedx=track->GetdEdx();
     Int_t pcode=GetPcode(dedx/40.,mom);
     cout<<"TPCtrack dedx,mom,pcode="<<dedx<<","<<mom<<","<<pcode<<endl;
       Float_t dedx=track->GetdEdx();
     Int_t pcode=GetPcode(dedx/40.,mom);
     cout<<"TPCtrack dedx,mom,pcode="<<dedx<<","<<mom<<","<<pcode<<endl;
@@ -175,17 +203,20 @@ Int_t   AliTPCPid::GetPcode(AliTPCtrack *track)
 //-----------------------------------------------------------
 Int_t   AliTPCPid::GetPcode(AliITStrackV2 *track)
 {
 //-----------------------------------------------------------
 Int_t   AliTPCPid::GetPcode(AliITStrackV2 *track)
 {
+  //
+  // get particle code
+  //
   if(track==0)return 0;
   //      track->Propagate(track->GetAlpha(),3.,0.1/65.19*1.848,0.1*1.848);
       track->PropagateTo(3.,0.0028,65.19);
       track->PropagateToVertex();
     Double_t xk,par[5]; track->GetExternalParameters(xk,par);
     Float_t lam=TMath::ATan(par[3]);
   if(track==0)return 0;
   //      track->Propagate(track->GetAlpha(),3.,0.1/65.19*1.848,0.1*1.848);
       track->PropagateTo(3.,0.0028,65.19);
       track->PropagateToVertex();
     Double_t xk,par[5]; track->GetExternalParameters(xk,par);
     Float_t lam=TMath::ATan(par[3]);
-    Float_t pt_1=TMath::Abs(par[4]);
+    Float_t pt1=TMath::Abs(par[4]);
     Float_t mom=0.;
     Float_t mom=0.;
-    if( (pt_1*TMath::Cos(lam))!=0. ){ mom=1./(pt_1*TMath::Cos(lam)); }else{mom=0.;};
+    if( (pt1*TMath::Cos(lam))!=0. ){ mom=1./(pt1*TMath::Cos(lam)); }else{mom=0.;};
     Float_t dedx=track->GetdEdx();
     Float_t dedx=track->GetdEdx();
-    cout<<"lam,pt_1,mom,dedx="<<lam<<","<<pt_1<<","<<mom<<","<<dedx<<endl;
+    cout<<"lam,pt1,mom,dedx="<<lam<<","<<pt1<<","<<mom<<","<<dedx<<endl;
     Int_t pcode=GetPcode(dedx,mom);
     cout<<"ITS V2 dedx,mom,pcode="<<dedx<<","<<mom<<","<<pcode<<endl;
 return pcode?pcode:211;
     Int_t pcode=GetPcode(dedx,mom);
     cout<<"ITS V2 dedx,mom,pcode="<<dedx<<","<<mom<<","<<pcode<<endl;
 return pcode?pcode:211;
@@ -193,60 +224,63 @@ return pcode?pcode:211;
 //-----------------------------------------------------------
 Int_t  AliTPCPid::GetPcode(Float_t q,Float_t pm)
 {
 //-----------------------------------------------------------
 Int_t  AliTPCPid::GetPcode(Float_t q,Float_t pm)
 {
+  //
+  // get particle code
+  //
     fWpi=fWk=fWp=0.;     fPcode=0;
 //1)---------------------- 0-120 MeV/c --------------
     fWpi=fWk=fWp=0.;     fPcode=0;
 //1)---------------------- 0-120 MeV/c --------------
-    if ( pm<=cut[1][0] )
-       { fWpi=1.; return pion(); }
+    if ( pm<=fcut[1][0] )
+       { fWpi=1.; return Pion(); }
 //2)----------------------120-200 Mev/c ( 29.7.2002 ) ------------- 
 //2)----------------------120-200 Mev/c ( 29.7.2002 ) ------------- 
-    if ( pm<=cut[2][0] )
-       { if( q<fCutKa->Eval(pm) ){fWpi=1.; return pion(); } 
-                            else {fWk =1.; return  kaon();} }
+    if ( pm<=fcut[2][0] )
+       { if( q<fCutKa->Eval(pm) ){fWpi=1.; return Pion(); } 
+                            else {fWk =1.; return  Kaon();} }
 //3)----------------------200-400 Mev/c -------------
 //3)----------------------200-400 Mev/c -------------
-    if ( pm<=cut[3][0] )
+    if ( pm<=fcut[3][0] )
        if( q<fCutKa->Eval(pm) )
        if( q<fCutKa->Eval(pm) )
-               { fWpi=1.;return pion(); }
+               { fWpi=1.;return Pion(); }
             else
                { if ( q<=fCutPr->Eval(pm) ) 
             else
                { if ( q<=fCutPr->Eval(pm) ) 
-                            {fWk=1.;return kaon();} 
-                       else {fWp=1.;return proton();}
+                            {fWk=1.;return Kaon();} 
+                       else {fWp=1.;return Proton();}
                }
 //4)----------------------400-450 Mev/c -------------
                }
 //4)----------------------400-450 Mev/c -------------
-    if ( pm<=cut[4][0] )
+    if ( pm<=fcut[4][0] )
        if( q<fCutKaTune*fCutKa->Eval(pm) )
        if( q<fCutKaTune*fCutKa->Eval(pm) )
-               { fWpi=1.;return pion(); }
+               { fWpi=1.;return Pion(); }
            else
                { if( q<fCutPr->Eval(pm) ) 
            else
                { if( q<fCutPr->Eval(pm) ) 
-                  {fWk=1.;return kaon();} else {fWp=1.;return proton(); }
+                  {fWk=1.;return Kaon();} else {fWp=1.;return Proton(); }
                 }
 //5)----------------------450-500 Mev/c -------------
                 }
 //5)----------------------450-500 Mev/c -------------
-    if ( pm<=cut[5][0] )
+    if ( pm<=fcut[5][0] )
        if ( q>fCutPr->Eval(pm) )
        if ( q>fCutPr->Eval(pm) )
-           {fWp=1.;return proton();} else {return wpik(5,q);};
+           {fWp=1.;return Proton();} else {return Wpik(5,q);};
 //6)----------------------500-550 Mev/c -------------
 //6)----------------------500-550 Mev/c -------------
-    if ( pm<=cut[6][0] )
+    if ( pm<=fcut[6][0] )
        if ( q>fCutPr->Eval(pm) )
        if ( q>fCutPr->Eval(pm) )
-           {fWp=1.;return proton();} else {return wpik(6,q);};
+           {fWp=1.;return Proton();} else {return Wpik(6,q);};
 //7)----------------------550-600 Mev/c -------------
 //7)----------------------550-600 Mev/c -------------
-    if ( pm<=cut[7][0] )
+    if ( pm<=fcut[7][0] )
        if ( q>fCutPr->Eval(pm) )
        if ( q>fCutPr->Eval(pm) )
-           {fWp=1.;return proton();} else {return wpik(7,q);};
+           {fWp=1.;return Proton();} else {return Wpik(7,q);};
 //8)----------------------600-650 Mev/c -------------
 //8)----------------------600-650 Mev/c -------------
-    if ( pm<=cut[8][0] )
-      if ( q>fCutPrTune*fCutPr->Eval(pm) ){fWp=1.;return proton();} 
-                                     else {return wpik(8,q);};
+    if ( pm<=fcut[8][0] )
+      if ( q>fCutPrTune*fCutPr->Eval(pm) ){fWp=1.;return Proton();} 
+                                     else {return Wpik(8,q);};
 //9)----------------------650-730 Mev/c -------------
 //9)----------------------650-730 Mev/c -------------
-    if ( pm<=cut[9][0] )
-      if ( q>fCutPrTune*fCutPr->Eval(pm) ){fWp=1.;return proton();}
-                                     else {return wpik(9,q);};
+    if ( pm<=fcut[9][0] )
+      if ( q>fCutPrTune*fCutPr->Eval(pm) ){fWp=1.;return Proton();}
+                                     else {return Wpik(9,q);};
 //10)----------------------730-830 Mev/c -------------
 //10)----------------------730-830 Mev/c -------------
-    if( pm<=cut[10][0] )
-      if ( q>fCutPrTune*fCutPr->Eval(pm) ){fWp=1.;return proton();}
-                                     else {return wpik(10,q);};
+    if( pm<=fcut[10][0] )
+      if ( q>fCutPrTune*fCutPr->Eval(pm) ){fWp=1.;return Proton();}
+                                     else {return Wpik(10,q);};
 //11)----------------------830-930 Mev/c -------------
 //11)----------------------830-930 Mev/c -------------
-    if( pm<=cut[11][0] ){ return wpikp(11,q); }
+    if( pm<=fcut[11][0] ){ return Wpikp(11,q); }
 //12)----------------------930-1030 Mev/c -------------
 //12)----------------------930-1030 Mev/c -------------
-    if( pm<=cut[12][0] )
-     { return wpikp(12,q); };
+    if( pm<=fcut[12][0] )
+     { return Wpikp(12,q); };
 
     return fPcode;    
 }
 
     return fPcode;    
 }
@@ -254,30 +288,42 @@ Int_t     AliTPCPid::GetPcode(Float_t q,Float_t pm)
 void   AliTPCPid::SetCut(Int_t n,Float_t pm,Float_t pilo,Float_t pihi,
                        Float_t klo,Float_t khi,Float_t plo,Float_t phi)
 {
 void   AliTPCPid::SetCut(Int_t n,Float_t pm,Float_t pilo,Float_t pihi,
                        Float_t klo,Float_t khi,Float_t plo,Float_t phi)
 {
-    cut[n][0]=pm;
-    cut[n][1]=pilo;
-    cut[n][2]=pihi;
-    cut[n][3]=klo;
-    cut[n][4]=khi;
-    cut[n][5]=plo;
-    cut[n][6]=phi;
+  //
+  // set cuts
+  //
+    fcut[n][0]=pm;
+    fcut[n][1]=pilo;
+    fcut[n][2]=pihi;
+    fcut[n][3]=klo;
+    fcut[n][4]=khi;
+    fcut[n][5]=plo;
+    fcut[n][6]=phi;
     return ;    
 }
 //------------------------------------------------------------
     return ;    
 }
 //------------------------------------------------------------
-void AliTPCPid::SetVec(Int_t ntrack,TVector info)
+void AliTPCPid::SetVec(Int_t ntrack,TVector info) const
 {
 {
+  //
+  // new track vector
+  //
 TClonesArray& arr=*trs;
     new( arr[ntrack] ) TVector(info);
 }
 //-----------------------------------------------------------
 TClonesArray& arr=*trs;
     new( arr[ntrack] ) TVector(info);
 }
 //-----------------------------------------------------------
-TVector* AliTPCPid::GetVec(Int_t ntrack)
+TVector* AliTPCPid::GetVec(Int_t ntrack) const
 {
 {
+  //
+  // get track vector
+  //
 TClonesArray& arr=*trs;
     return (TVector*)arr[ntrack];
 }
 //-----------------------------------------------------------
 void AliTPCPid::SetEdep(Int_t track,Float_t Edep)
 {
 TClonesArray& arr=*trs;
     return (TVector*)arr[ntrack];
 }
 //-----------------------------------------------------------
 void AliTPCPid::SetEdep(Int_t track,Float_t Edep)
 {
+  //
+  // energy deposit
+  //
     TVector xx(0,11);
     if( ((TVector*)trs->At(track))->IsValid() )
        {TVector yy( *((TVector*)trs->At(track)) );xx=yy; }
     TVector xx(0,11);
     if( ((TVector*)trs->At(track))->IsValid() )
        {TVector yy( *((TVector*)trs->At(track)) );xx=yy; }
@@ -289,6 +335,9 @@ void AliTPCPid::SetEdep(Int_t track,Float_t Edep)
 //-----------------------------------------------------------
 void AliTPCPid::SetPmom(Int_t track,Float_t Pmom)
 {
 //-----------------------------------------------------------
 void AliTPCPid::SetPmom(Int_t track,Float_t Pmom)
 {
+  //
+  // set part. momentum
+  //
     TVector xx(0,11);
     if( ((TVector*)trs->At(track))->IsValid() )
        {TVector yy( *((TVector*)trs->At(track)) );xx=yy; }
     TVector xx(0,11);
     if( ((TVector*)trs->At(track))->IsValid() )
        {TVector yy( *((TVector*)trs->At(track)) );xx=yy; }
@@ -299,18 +348,25 @@ void AliTPCPid::SetPmom(Int_t track,Float_t Pmom)
 //-----------------------------------------------------------
 void AliTPCPid::SetPcod(Int_t track,Int_t partcode)
 {
 //-----------------------------------------------------------
 void AliTPCPid::SetPcod(Int_t track,Int_t partcode)
 {
+  //
+  // set part. code
+  //
     TVector xx(0,11);
     if( ((TVector*)trs->At(track))->IsValid() )
        {TVector yy( *((TVector*)trs->At(track)) );xx=yy; }
     if(xx(11)==0)
     TVector xx(0,11);
     if( ((TVector*)trs->At(track))->IsValid() )
        {TVector yy( *((TVector*)trs->At(track)) );xx=yy; }
     if(xx(11)==0)
-       {xx(11)=partcode; mxtrs++;
+       {xx(11)=partcode; fmxtrs++;
        TClonesArray &arr=*trs;
        new(arr[track])TVector(xx);
        }
 }
 //-----------------------------------------------------------
 void AliTPCPid::Print(Int_t track)
        TClonesArray &arr=*trs;
        new(arr[track])TVector(xx);
        }
 }
 //-----------------------------------------------------------
 void AliTPCPid::Print(Int_t track)
-{cout<<mxtrs<<" tracks in AliITSPid obj."<<endl;
+{
+  //
+  // control print
+  //
+cout<<fmxtrs<<" tracks in AliITSPid obj."<<endl;
     if( ((TVector*)trs->At(track))->IsValid() )
        {TVector xx( *((TVector*)trs->At(track)) );
         xx.Print();
     if( ((TVector*)trs->At(track))->IsValid() )
        {TVector xx( *((TVector*)trs->At(track)) );
         xx.Print();
@@ -321,6 +377,9 @@ void AliTPCPid::Print(Int_t track)
 //-----------------------------------------------------------
 void AliTPCPid::Tab(void)
 {
 //-----------------------------------------------------------
 void AliTPCPid::Tab(void)
 {
+  //
+  // fill table
+  //
 if(trs->GetEntries()==0){cout<<"No entries in TAB"<<endl;return;}
 cout<<"------------------------------------------------------------------------"<<endl;
 cout<<"Nq"<<"   q1  "<<"   q2  "<<"   q3  "<<"   q4  "<<"   q5   "<<
 if(trs->GetEntries()==0){cout<<"No entries in TAB"<<endl;return;}
 cout<<"------------------------------------------------------------------------"<<endl;
 cout<<"Nq"<<"   q1  "<<"   q2  "<<"   q3  "<<"   q4  "<<"   q5   "<<
@@ -335,7 +394,7 @@ for(Int_t i=0;i<trs->GetEntries();i++)
            if(xx(0)>=2)
                {
 //       1)Calculate Qtrm      
            if(xx(0)>=2)
                {
 //       1)Calculate Qtrm      
-                   xx(6)=(this->qtrm(i));
+                   xx(6)=(this->Qtrm(i));
 
                 }else{
                     xx(6)=xx(1);
 
                 }else{
                     xx(6)=xx(1);
@@ -363,6 +422,9 @@ for(Int_t i=0;i<trs->GetEntries();i++)
 }
 void AliTPCPid::Reset(void)
 {
 }
 void AliTPCPid::Reset(void)
 {
+  //
+  // reset
+  //
   for(Int_t i=0;i<trs->GetEntries();i++){
     TVector xx(0,11);
     TClonesArray &arr=*trs;
   for(Int_t i=0;i<trs->GetEntries();i++){
     TVector xx(0,11);
     TClonesArray &arr=*trs;
@@ -375,13 +437,13 @@ AliTPCPid::AliTPCPid(Int_t ntrack)
     trs = new TClonesArray("TVector",ntrack);
     TClonesArray &arr=*trs;
     for(Int_t i=0;i<ntrack;i++)new(arr[i])TVector(0,11);
     trs = new TClonesArray("TVector",ntrack);
     TClonesArray &arr=*trs;
     for(Int_t i=0;i<ntrack;i++)new(arr[i])TVector(0,11);
-    mxtrs=0;
+    fmxtrs=0;
 
     //fCutKa = new TF1("fkaons","[0]/x/x+[1]",0.1,1.2);
     //fCutPr = new TF1("fprotons","[0]/x/x +[1]",0.2,1.2);
 
     //fCutKa = new TF1("fkaons","[0]/x/x+[1]",0.1,1.2);
     //fCutPr = new TF1("fprotons","[0]/x/x +[1]",0.2,1.2);
-    TF1 *f_rmska=0;
+    TF1 *frmska=0;
     
     
-    f_rmska = new TF1("x_frmska","1.46-7.82*x+16.78*x^2-15.53*x^3+5.24*x^4 ",
+    frmska = new TF1("x_frmska","1.46-7.82*x+16.78*x^2-15.53*x^3+5.24*x^4 ",
                0.1,1.2);
     fCutKa = new TF1("fkaons",
           "1.25+0.044/x/x+1.25+0.044*x-13.87*x^2+22.37*x^3-10.05*x^4-2.5*x_frmska",
                0.1,1.2);
     fCutKa = new TF1("fkaons",
           "1.25+0.044/x/x+1.25+0.044*x-13.87*x^2+22.37*x^3-10.05*x^4-2.5*x_frmska",
@@ -392,36 +454,36 @@ AliTPCPid::AliTPCPid(Int_t ntrack)
     fCutKaTune=1.1; // 0.92; 
     fCutPrTune=1.0; //0.80;
     
     fCutKaTune=1.1; // 0.92; 
     fCutPrTune=1.0; //0.80;
     
-const int inf=10;
+const int kinf=10;
 //         Ncut Pmom   pilo  pihi    klo    khi     plo    phi
 //         Ncut Pmom   pilo  pihi    klo    khi     plo    phi
-//       cut[j] [0]    [1]    [2]    [3]    [4]     [5]    [6]
+//       fcut[j] [0]    [1]    [2]    [3]    [4]     [5]    [6]
 //----------------------------------------------------------------
 //----------------------------------------------------------------
-    SetCut(  1, 0.120,  0.  ,  0.  , inf  , inf   , inf  , inf  );
-    SetCut(  2, 0.200,  0.  ,  6.0 , 6.0  , inf   , inf  , inf  ); //120-200
-    SetCut(  3, 0.400,  0.  ,  3.5 , 3.5  , 9.0   , 9.0  , inf  ); //200-400
-    SetCut(  4, 0.450,  0.  ,  1.9 , 1.9  , 4.0   , 4.0  , inf  ); //400-450
+    SetCut(  1, 0.120,  0.  ,  0.  , kinf  , kinf   , kinf  , kinf  );
+    SetCut(  2, 0.200,  0.  ,  6.0 , 6.0  , kinf   , kinf  , kinf  ); //120-200
+    SetCut(  3, 0.400,  0.  ,  3.5 , 3.5  , 9.0   , 9.0  , kinf  ); //200-400
+    SetCut(  4, 0.450,  0.  ,  1.9 , 1.9  , 4.0   , 4.0  , kinf  ); //400-450
 //----------------------------------------------------------------
 //----------------------------------------------------------------
-    SetCut(  5, 0.500, 0.976, 0.108, 1.484 , 0.159  , 3.5  , inf  );  //450-500
-    SetCut(  6, 0.550, 0.979, 0.108, 1.376 , 0.145  , 3.0  , inf  );  //500-550
+    SetCut(  5, 0.500, 0.976, 0.108, 1.484 , 0.159  , 3.5  , kinf  );  //450-500
+    SetCut(  6, 0.550, 0.979, 0.108, 1.376 , 0.145  , 3.0  , kinf  );  //500-550
 //----------------------------------------------------------------    
 //----------------------------------------------------------------    
-    SetCut(  7, 0.600, 0.984, 0.111, 1.295 , 0.146 , 2.7  , inf  );   //550-600
-    SetCut(  8, 0.650, 0.989, 0.113, 1.239 , 0.141 , 2.5  , inf  );   //600-650
-    SetCut(  9, 0.730, 0.995, 0.109, 1.172 , 0.132 , 2.0  , inf  );   //650-730
+    SetCut(  7, 0.600, 0.984, 0.111, 1.295 , 0.146 , 2.7  , kinf  );   //550-600
+    SetCut(  8, 0.650, 0.989, 0.113, 1.239 , 0.141 , 2.5  , kinf  );   //600-650
+    SetCut(  9, 0.730, 0.995, 0.109, 1.172 , 0.132 , 2.0  , kinf  );   //650-730
 //----------------------------------------------------------------    
     SetCut( 10, 0.830, 1.008, 0.116, 1.117 , 0.134 , 1.703, 0.209 ); //730-830
     SetCut( 11, 0.930, 1.019, 0.115, 1.072 , 0.121 , 1.535, 0.215 ); //830-930
     SetCut( 12, 1.230, 1.035, 0.117, 1.053 , 0.140  ,1.426, 0.270); //930-1030
     //------------------------ pi,K ---------------------
 //----------------------------------------------------------------    
     SetCut( 10, 0.830, 1.008, 0.116, 1.117 , 0.134 , 1.703, 0.209 ); //730-830
     SetCut( 11, 0.930, 1.019, 0.115, 1.072 , 0.121 , 1.535, 0.215 ); //830-930
     SetCut( 12, 1.230, 1.035, 0.117, 1.053 , 0.140  ,1.426, 0.270); //930-1030
     //------------------------ pi,K ---------------------
-    aprob[0][0]=33219.;   aprob[1][0]=1971.;   // aprob[0][i] -    pions 
-    aprob[0][1]=28828.;   aprob[1][1]=1973.; // aprob[1][i] -    kaons
+    faprob[0][0]=33219.;   faprob[1][0]=1971.;   // faprob[0][i] -    pions 
+    faprob[0][1]=28828.;   faprob[1][1]=1973.; // faprob[1][i] -    kaons
     //---------------------------------------------------
     //---------------------------------------------------
-    aprob[0][2]=24532.;   aprob[1][2]=1932.; aprob[2][2]=1948.;
-    aprob[0][3]=20797.;   aprob[1][3]=1823.; aprob[2][3]=1970.;   
-    aprob[0][4]=27017.;   aprob[1][4]=2681.; aprob[2][4]=2905.;
+    faprob[0][2]=24532.;   faprob[1][2]=1932.; faprob[2][2]=1948.;
+    faprob[0][3]=20797.;   faprob[1][3]=1823.; faprob[2][3]=1970.;   
+    faprob[0][4]=27017.;   faprob[1][4]=2681.; faprob[2][4]=2905.;
     //------------------------ pi,K,p -------------------
     //------------------------ pi,K,p -------------------
-    aprob[0][5]= 24563.;    aprob[1][5]=2816.;  aprob[2][5]=3219.;  
-    aprob[0][6]= 16877.;    aprob[1][6]=2231.;  aprob[2][6]=2746.;
-    aprob[0][7]= 11557.;    aprob[1][7]=1681;   aprob[2][7]=2190.;
+    faprob[0][5]= 24563.;    faprob[1][5]=2816.;  faprob[2][5]=3219.;  
+    faprob[0][6]= 16877.;    faprob[1][6]=2231.;  faprob[2][6]=2746.;
+    faprob[0][7]= 11557.;    faprob[1][7]=1681;   faprob[2][7]=2190.;
 
     fSilent=kTRUE;
 }
 
     fSilent=kTRUE;
 }
index 941795e65fe1f21060bd340e6bab77716764619b..14ea07d320cffdec4be450dda049df4b039b652a 100644 (file)
@@ -7,13 +7,16 @@
 /* $Id$ */
 
 #include <TObject.h>
 /* $Id$ */
 
 #include <TObject.h>
-#include <TF1.h>
-#include <TClonesArray.h>
+//#include <TF1.h>
+//#include <TClonesArray.h>
 #include <TVector.h>
 #include "../TPC/AliTPCtrack.h"
 //#include "../ITS/AliITSIOTrack.h"
 #include "../ITS/AliITStrackV2.h"
 #include <assert.h>
 #include <TVector.h>
 #include "../TPC/AliTPCtrack.h"
 //#include "../ITS/AliITSIOTrack.h"
 #include "../ITS/AliITStrackV2.h"
 #include <assert.h>
+
+class TF1;
+class TClonesArray;
 //___________________________________________________________________________
 class  AliTPCPid :
   public TObject {
 //___________________________________________________________________________
 class  AliTPCPid :
   public TObject {
@@ -21,54 +24,55 @@ class  AliTPCPid :
 public:
                AliTPCPid(Int_t ntrs=1000);
                virtual ~AliTPCPid(){}
 public:
                AliTPCPid(Int_t ntrs=1000);
                virtual ~AliTPCPid(){}
+                AliTPCPid( const AliTPCPid& r);
        void    SetEdep(Int_t track,Float_t Edep);
        void    SetPmom(Int_t track,Float_t Pmom);
        void    SetPcod(Int_t track,Int_t Pcod);
        void    Print(Int_t track);
        void    Tab(void);
        void    Reset(void);
        void    SetEdep(Int_t track,Float_t Edep);
        void    SetPmom(Int_t track,Float_t Pmom);
        void    SetPcod(Int_t track,Int_t Pcod);
        void    Print(Int_t track);
        void    Tab(void);
        void    Reset(void);
-       void    SetVec(Int_t track,TVector info);
-       TVector* GetVec(Int_t track);
-       Int_t   GetPcode(TClonesArray*,Float_t);
-       Int_t   GetPcode(Float_t,Float_t);
-       Int_t   GetPcode(AliTPCtrack*);
+       void    SetVec(Int_t track,TVector info) const;
+       TVector* GetVec(Int_t track) const;
+       Int_t   GetPcode(TClonesArray* ,Float_t) const;
+       Int_t   GetPcode(Float_t q,Float_t pm);
+       Int_t   GetPcode(AliTPCtrack*track);
 //        Int_t   GetPcode(AliITSIOTrack*); 
 //        Int_t   GetPcode(AliITSIOTrack*); 
-        Int_t   GetPcode(AliITStrackV2*);
-       void    SetCut(Int_t,Float_t,Float_t,Float_t,
-                           Float_t,Float_t,Float_t,Float_t);
-       void    SetAProb(Int_t ivar,Int_t icut,Float_t apro){ aprob[ivar][icut]=apro; } 
-       Float_t GetAProb(Int_t ivar,Int_t icut){ return aprob[ivar][icut]; } 
-       Float_t GetWpi(){return fWpi;}
-       Float_t GetWk(){return fWk;}
-       Float_t GetWp(){return fWp;}
-       Int_t   GetPid(){return fPcode;};
-protected:
-public:
-       Float_t cut[13][7],aprob[3][8];
-       Int_t       mxtrs;
-       TClonesArray *trs;
-       Float_t qtot;
-       Float_t fWpi,fWk,fWp;
-       Float_t fRpik,fRppi,fRpka,fRp; 
-       Int_t   fPcode;
-//private:
-public:
-       TF1 *fCutKa;
-       TF1 *fCutPr;
-       Float_t fCutKaTune,fCutPrTune;
-       Float_t qcorr(Float_t);
-       int     qcomp(Float_t* qa,Float_t* qb){return qa[0]>qb[0]?1:0;}
-       Float_t qtrm(Int_t track);
-       Float_t qtrm(Float_t qarr[6],Int_t narr);
-       Float_t fSigmin;
-       Int_t   wpik(Int_t,Float_t);
-       Int_t   wpikp(Int_t,Float_t);
-       Int_t   pion(){return /*fWpi=1.,*/fPcode=211;}
-       Int_t   kaon(){return /*fWk=1.,*/fPcode=321;}
-       Int_t   proton(){return /*fWp=1.,*/fPcode=2212;}
-        Int_t   fSilent;
-public:
+        Int_t   GetPcode(AliITStrackV2* track);
+       void    SetCut(Int_t n, Float_t pm, Float_t pilo, Float_t pihi,
+                           Float_t klo, Float_t khi, Float_t plo, 
+                            Float_t phi);
+       void    SetAProb(Int_t ivar,Int_t icut,Float_t apro){ faprob[ivar][icut]=apro; } 
+       Float_t GetAProb(Int_t ivar,Int_t icut) const
+                        { return faprob[ivar][icut]; } 
+       Float_t GetWpi() const {return fWpi;}
+       Float_t GetWk() const {return fWk;}
+       Float_t GetWp() const {return fWp;}
+       Int_t   GetPid() const {return fPcode;};
+       Float_t Qcorr(Float_t xc);
+       Int_t   Qcomp(Float_t* qa,Float_t* qb) const {return qa[0]>qb[0]?1:0;}
+       Float_t Qtrm(Int_t track) const;
+       Float_t Qtrm(Float_t qarr[6],Int_t narr);
+       Int_t   Wpik(Int_t nc, Float_t q);
+       Int_t   Wpikp(Int_t nc, Float_t q);
+       Int_t   Pion(){return /*fWpi=1.,*/fPcode=211;}
+       Int_t   Kaon(){return /*fWk=1.,*/fPcode=321;}
+       Int_t   Proton(){return /*fWp=1.,*/fPcode=2212;}
+private:
+       TF1 *fCutKa; // function
+       TF1 *fCutPr; // function
+       Float_t fCutKaTune,fCutPrTune; // tune cuts
+       Float_t fSigmin; // sigma min
+        Int_t   fSilent; // flag
+       Float_t fcut[13][7],faprob[3][8]; //cuts
+       Int_t       fmxtrs; // fmxtrs
+       TClonesArray *trs; //pointer
+       Float_t fqtot; // tot q
+       Float_t fWpi,fWk,fWp; // weights
+       Float_t fRpik,fRppi,fRpka,fRp; // ratios
+       Int_t   fPcode; //p-code
+
   ClassDef(AliTPCPid,1) // Class for TPC PID
   ClassDef(AliTPCPid,1) // Class for TPC PID
+
 };
 
 #endif 
 };
 
 #endif