]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - PHOS/AliPHOSFastRecParticle.cxx
coding conventions corrections
[u/mrichter/AliRoot.git] / PHOS / AliPHOSFastRecParticle.cxx
index 4e548dd1c5ee275fb04cc78495d53cf868db0667..e35c942b86466535d548061aaf5cb85f335c7715 100644 (file)
 
 // --- Standard library ---
 
-#include <iostream>
-
 // --- AliRoot header files ---
 
 #include "AliPHOSFastRecParticle.h"
 #include "TPad.h"
 #include "TPaveText.h"
 
-ClassImp(AliPHOSFastRecParticle)
+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 +74,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 +94,7 @@ ClassImp(AliPHOSFastRecParticle)
   fPolarTheta  = p.fPolarTheta;
   fPolarPhi    = p.fPolarPhi;
   fParticlePDG = p.fParticlePDG; 
+
 }
 
 //____________________________________________________________________________
@@ -123,12 +129,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,57 +157,85 @@ 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) 
+TString AliPHOSFastRecParticle::Name()const
 {
-  // Retrieves the unique primary particle at the origine of the present reconstruced particle
+  // Returns the name of the particle type (only valid if PIDv1 is employed)
 
-  number = 1 ; 
-  Int_t * list = new Int_t[1] ;
-  list[0] = fPrimary ; 
+  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
   
-  return list ;
+  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  
+  
+  return name ; 
 }
 
-//____________________________________________________________________________
-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 kNEUTRAL:
-    name = "NEUTRAL" ;
-    break ; 
-   case kCHARGEDHADRON:
-    name = "CHARGED HADRON" ;
-    break ; 
-  case kNEUTRALHADRON:
-    name = "NEUTRAL HADRON" ; 
-    break ; 
-  case kNEUTRALEM:
-    name = "NEUTRAL EM" ; 
-    break ; 
-  case kGAMMAHADRON:
-    name = "PHOTON HADRON" ; 
-    break ; 
 
+//______________________________________________________________________________
+void AliPHOSFastRecParticle::SetType(Int_t type) { 
+  // sets the particle type 
+  fType = type ; 
+  
+  if((type == 127) || (fType == 511) || (fType == 255) ||(fType == 383)||(fType == 447)){
+    fPdgCode = 22 ; 
+    return ;
   }
-  return name ; 
-}
+  
+  if ((fType == 63)|| ((fType < 8)&&(fType > 0)) ){
+    fPdgCode = 2112 ; 
+    return ;
+  }
+  if ( ((fType == 504) || (fType == 505) ||(fType == 248)||(fType == 249)||(fType == 120)||(fType == 121)) ){
+    fPdgCode = 11 ; 
+    return ;
+  }
+  if ((fType == 448) || (fType == 449) ||(fType == 192)||(fType == 193)||(fType == 64)||(fType == 64)){
+    fPdgCode = 13 ; 
+    return ;
+  }
+  if((fType == 56)||(fType == 57)){
+    fPdgCode = 211 ; 
+    return ;
+  }
+  if (fType == 0){
+    fPdgCode = 2212 ; 
+    return ;
+  }
+
+}          
 
 //______________________________________________________________________________
 void AliPHOSFastRecParticle::Paint(Option_t *)
@@ -225,13 +259,20 @@ void AliPHOSFastRecParticle::Paint(Option_t *)
 }
 
 //____________________________________________________________________________
-void AliPHOSFastRecParticle::Print()
+void AliPHOSFastRecParticle::Print(Option_t * opt)const
 {
-  // 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 
-       << "                     " << "Px     = " << fPx << endl 
-       << "                     " << "Py     = " << fPy << endl 
-       << "                     " << "Pz     = " << fPz << endl ; 
+  TString message ; 
+  message  = "AliPHOSFastRecParticle > type is  %s\n" ; 
+  message += "                         Energy = %e\n" ; 
+  message += "                         Px     = %e\n" ; 
+  message += "                         Py     = %e\n" ;
+  message += "                         Pz     = %e\n" ;
+  Info("Print", message.Data(), 
+       Name().Data(), 
+       Energy(), 
+       Px(), 
+       Py(),
+       Pz() ); 
 }