]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
Added MakePID method the embryo of Bayesian PID with PHOS
authorschutz <schutz@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 11 May 2004 12:32:15 +0000 (12:32 +0000)
committerschutz <schutz@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 11 May 2004 12:32:15 +0000 (12:32 +0000)
PHOS/AliPHOSPIDv1.cxx
PHOS/AliPHOSPIDv1.h

index ddc83da641a92cba6b9f201e2c596ad69fa64810..4ed5ee2efb829bc1b075afd194233a791d3458da 100644 (file)
@@ -208,6 +208,7 @@ void  AliPHOSPIDv1::Exec(Option_t *option)
     if(gime->TrackSegments() && //Skip events, where no track segments made
        gime->TrackSegments()->GetEntriesFast()) {
       MakeRecParticles() ;
+      MakePID() ; 
       WriteRecParticles();
       if(strstr(option,"deb"))
        PrintRecParticles(option) ;
@@ -528,6 +529,26 @@ TVector3 AliPHOSPIDv1::GetMomentumDirection(AliPHOSEmcRecPoint * emc, AliPHOSCpv
   return dir ;  
 }
 
+//____________________________________________________________________________
+void  AliPHOSPIDv1::MakePID()
+{
+  // construct the PID weight from a Bayesian Method
+
+  Int_t index ;
+  Float_t pid1, pid2, pid3, pid4, pid5, pid6 ; 
+  pid1 = pid2 = pid3 = pid4 = pid5 = pid6 = 0 ;
+  Int_t nparticles = AliPHOSGetter::Instance()->RecParticles()->GetEntriesFast() ;
+  for(index = 0 ; index < nparticles ; index ++) {
+    AliPHOSRecParticle * recpar = AliPHOSGetter::Instance()->RecParticle(index) ;  
+    if (recpar->IsPhoton() || recpar->IsHardPhoton())  pid1++ ; 
+    else if (recpar->IsPi0() || recpar->IsHardPi0())   pid2++ ; 
+    else if (recpar->IsElectron())                     pid3++ ; 
+    else if (recpar->IsChargedHadron())                pid4++ ; 
+    else if (recpar->IsNeutralHadron())                pid5++ ; 
+    else if (recpar->IsEleCon())                       pid6++ ;  
+  }
+}
+
 //____________________________________________________________________________
 void  AliPHOSPIDv1::MakeRecParticles()
 {
@@ -609,7 +630,8 @@ void  AliPHOSPIDv1::MakeRecParticles()
       fPPi0[1]   =-100.0;
     }
     
-    Float_t time =emc->GetTime() ;
+    Float_t time = emc->GetTime() ;
+    rp->SetTof(time) ; 
     
     // Loop of Efficiency-Purity (the 3 points of purity or efficiency 
     // are taken into account to set the particle identification)
@@ -623,9 +645,9 @@ void  AliPHOSPIDv1::MakeRecParticles()
       
       // Looking the TOF. If TOF smaller than gate,  4th, 5th or 6th 
       // bit (depending on the efficiency-purity point )is set to 1             
-      if(time< (*fParameters)(2,effPur)) 
+      if(time< (*fParameters)(3,effPur)) 
        rp->SetPIDBit(effPur+3) ;                   
-      
+  
       //Photon PCA
       //If we are inside the ellipse, 7th, 8th or 9th 
       // bit (depending on the efficiency-purity point )is set to 1 
@@ -666,7 +688,6 @@ void  AliPHOSPIDv1::MakeRecParticles()
     TVector3 pos ; 
     geom->GetGlobal(erp, pos) ; 
     rp->SetPos(pos);
-
     index++ ; 
   }
 }
@@ -779,7 +800,7 @@ void  AliPHOSPIDv1::SetParameters()
           &(*fParameters)(i,0), &(*fParameters)(i,1), 
           &(*fParameters)(i,2), &(*fParameters)(i,3));
     i++;
-    //printf("line %d: %s",i,string);
+    //Info("SetParameters", "line %d: %s",i,string);
   }
   fclose(fd);
 }
index 049abf38aeb920622ec810f3c3e2a10dcebd27c4..a04a35dea0f5331ce3c4132b5c4e10b63b19d01c 100644 (file)
@@ -79,7 +79,8 @@ private:
   virtual void  Init() ;
   virtual void  InitParameters() ;
   void          MakeRecParticles(void ) ;
-  // Relative Distance CPV-EMC
+  void          MakePID(void ) ;
+ // Relative Distance CPV-EMC
   Float_t GetDistance     (AliPHOSEmcRecPoint * emc, AliPHOSCpvRecPoint * cpv, Option_t * axis)const ; 
   Int_t   GetCPVBit       (AliPHOSEmcRecPoint * emc, AliPHOSCpvRecPoint * cpv, Int_t EffPur, Float_t e) const;
   Int_t   GetPrincipalBit (TString particle, const Double_t* P, Int_t EffPur, Float_t e)const ; //Principal cut