]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - PHOS/AliPHOSFastRecParticle.cxx
Give names to reconstructed particles with AliPHOSPIDv1
[u/mrichter/AliRoot.git] / PHOS / AliPHOSFastRecParticle.cxx
index 7db43b930bd4379f5d993a14b0ad50d40023b4fe..14d12133ea864a6f5126c8c80392c269c6f08a3f 100644 (file)
 
 ClassImp(AliPHOSFastRecParticle) ; 
 
+//____________________________________________________________________________
+AliPHOSFastRecParticle::AliPHOSFastRecParticle() : TParticle()
+{
+  // ctor
+  fType = 0 ; 
+}
+
 //____________________________________________________________________________
  AliPHOSFastRecParticle::AliPHOSFastRecParticle(const AliPHOSFastRecParticle & rp)
 {
   // copy ctor
 
-  fType        = rp.fType ; 
+  fType        = rp.fType ;
   fPdgCode     = rp.fPdgCode;
   fStatusCode  = rp.fStatusCode;
   fMother[0]   = rp.fMother[0];
@@ -69,7 +76,7 @@ ClassImp(AliPHOSFastRecParticle) ;
  
   TParticle & pnoconst = (TParticle &)(pp) ;
   AliPHOSFastRecParticle & p = (AliPHOSFastRecParticle &)(pnoconst) ;
-
+  fType        = 0  ;
   fPdgCode     = p.fPdgCode;
   fStatusCode  = p.fStatusCode;
   fMother[0]   = p.fMother[0];
@@ -89,6 +96,7 @@ ClassImp(AliPHOSFastRecParticle) ;
   fPolarTheta  = p.fPolarTheta;
   fPolarPhi    = p.fPolarPhi;
   fParticlePDG = p.fParticlePDG; 
+
 }
 
 //____________________________________________________________________________
@@ -123,12 +131,12 @@ void AliPHOSFastRecParticle::ExecuteEvent(Int_t event, Int_t px, Int_t py)
 {
   //  Execute action corresponding to one event
   //  This member function is called when a AliPHOSFastRecParticle is clicked with the locator
-     
+  
   if (!gPad->IsEditable()) 
     return ;
-
+  
   static TPaveText * clustertext = 0 ; 
-
+  
   switch (event) {
     
   case kButton1Down: {
@@ -151,52 +159,63 @@ void AliPHOSFastRecParticle::ExecuteEvent(Int_t event, Int_t px, Int_t py)
     delete clustertext ; 
     clustertext = 0 ; 
     gPad->Update() ; 
-   break ;
+    break ;
   }
-  
   }
-
-}
-
-//____________________________________________________________________________
-Int_t * AliPHOSFastRecParticle::GetPrimaries(Int_t & number) 
-{
-  // Retrieves the unique primary particle at the origine of the present reconstruced particle
-
-  number = 1 ; 
-  Int_t * list = new Int_t[1] ;
-  list[0] = fPrimary ; 
   
-  return list ;
 }
 
 //____________________________________________________________________________
 TString AliPHOSFastRecParticle::Name()
 {
-  // Returns the name of the particle type
-  
-  TString  name ; 
-  switch (fType) {
-  case kGAMMA:
-    name = "PHOTON" ;
-    break ; 
-   case kELECTRON:
-     name = "ELECTRON" ;
-    break ; 
-   case kCHARGEDHA:
-    name = "CHARGED_HA" ;
-    break ; 
-  case kNEUTRALHA:
-    name = "NEUTRAL_HA" ; 
-    break ; 
-  case kNEUTRALEM:
-    name = "NEUTRAL_EM" ; 
-    break ; 
-  case kGAMMAHA:
-    name = "PHOTON_HA" ; 
-    break ; 
+  // Returns the name of the particle type (only valid if PIDv1 is employed)
 
-  }
+  TString  name ; 
+  
+  if(fType == 127)
+    name = "PHOTON_LOPU_HIEF" ;    //PCA = 001 TOF = 111 CPV = 111
+  
+  if(fType == 511)
+    name = "PHOTON_HIPU_LOEF" ;    //PCA = 011 TOF = 111 CPV = 111
+  
+  if(fType == 255)
+       name = "PHOTON_MED_PU_EF" ;    //PCA = 111 TOF = 111 CPV = 111
+  
+  if((fType == 383)||(fType == 447)) 
+    name = "PHOTON_STRANGE" ;      //PCA = 101 or 110 TOF = 111 CPV = 111
+  
+  if(fType == 63)
+    name = "NEUTRAL_FAST_HADRON" ; //PCA = 000 TOF = 111 CPV = 111
+  
+  if((fType == 504) || (fType == 505) ||(fType == 248)||(fType == 249)||(fType == 120)||(fType == 121))
+    name = "CHARGED_FAST_EM" ;     //PCA = 111, 011 or 001 TOF =111 CPV = 000 or 001  
+  
+  if((fType == 56)||(fType == 57))
+    name = "CHARGED_FAST_HADRON" ; //PCA = 000 TOF = 111 CPV = 000 or 001 
+  
+  if((fType < 8)&&(fType > 0))
+    name = "NEUTRAL_SLOW_HADRON" ; //PCA = 000 TOF = 000 CPV = 001 or 011 or 111
+  
+  if((fType == 0))
+    name = "CHARGED_SLOW_HADRON" ; //PCA = 000 TOF = 000 CPV = 000
+  
+  if((fType == 448) || (fType == 449) ||(fType == 192)||(fType == 193)||(fType == 64)||(fType == 64))
+    name = "CHARGED_SLOW_EM" ;    //PCA = 111, 011 or 001 TOF =000 CPV = 000 or 001  
+  
+  
+  if ( name.Contains("PHOTON") )
+    fPdgCode = 22 ; // Sets the pdg GetName() to gamma  
+  if ( name.Contains("NEUTRAL") )
+    fPdgCode = 2112 ; // Sets the pdg GetName() to neutron 
+  if ( name.Contains("CHARGED_FAST_EM") )
+    fPdgCode = 11 ; // Sets the pdg GetName() to electron 
+  if ( name.Contains("CHARGED_SLOW_EM") )
+    fPdgCode = 13 ; // Sets the pdg GetName() to muon
+  if ( name.Contains("CHARGED_FAST_HADRON") )
+    fPdgCode = 211 ; // Sets the pdg GetName() to pion
+  if ( name.Contains("CHARGED_SLOW_HADRON") )
+    fPdgCode = 2212 ; // Sets the pdg GetName() to proton
+  
   return name ; 
 }
 
@@ -224,7 +243,7 @@ void AliPHOSFastRecParticle::Paint(Option_t *)
 //____________________________________________________________________________
 void AliPHOSFastRecParticle::Print(const char * opt)
 {
-  // Print the typr, energy and momentum
+  // Print the type, energy and momentum of the reconstructed particle
   
   cout << "AliPHOSFastRecParticle > " << "type is  " << Name() << endl 
        << "                     " << "Energy = " << fE << endl