]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - PHOS/AliPHOSFastRecParticle.cxx
GetPrimaries modified
[u/mrichter/AliRoot.git] / PHOS / AliPHOSFastRecParticle.cxx
index 770f92703f83a0f6d851255db0141b74c6e270ab..3dcbfcc712fafb7f8dd7bd0d8caca1c0241afd6d 100644 (file)
  * provided "as is" without express or implied warranty.                  *
  **************************************************************************/
 
+/* $Id$ */
+
 //_________________________________________________________________________
-// Particle modified by PHOS response to be used by AliPHOSvFast
-//*-- Y. Schutz:   SUBATECH 
-//////////////////////////////////////////////////////////////////////////////
+//  A  Particle modified by PHOS response and produced by AliPHOSvFast
+//  To become a general class of AliRoot ?    
+//               
+//*-- Author: Yves Schutz (SUBATECH)
 
 // --- ROOT system ---
 
 // --- Standard library ---
 
-#include <iostream>
+#include <iostream.h>
 
 // --- AliRoot header files ---
 
 #include "TPad.h"
 #include "TPaveText.h"
 
-ClassImp(AliPHOSFastRecParticle)
+ClassImp(AliPHOSFastRecParticle) ; 
 
 //____________________________________________________________________________
  AliPHOSFastRecParticle::AliPHOSFastRecParticle(const AliPHOSFastRecParticle & rp)
 {
+  // copy ctor
+
   fType        = rp.fType ; 
-//   fPdgCode     = rp.fPdgCode;
-//   fStatusCode  = rp.fStatusCode;
-//   fMother[0]   = rp.fMother[0];
-//   fMother[1]   = rp.fMother[1];
-//   fDaughter[0] = rp.fDaughter[0];
-//   fDaughter[1] = rp.fDaughter[1];
-//   fWeight      = rp.fWeight;
-//   fCalcMass    = rp.fCalcMass;
-//   fPx          = rp.fPx;
-//   fPy          = rp.fPy;
-//   fPz          = rp.fPz;
-//   fE           = rp.fE;
-//   fVx          = rp.fVx;
-//   fVy          = rp.fVy;
-//   fVz          = rp.fVz;
-//   fVt          = rp.fVt;
-//   fPolarTheta  = rp.fPolarTheta;
-//   fPolarPhi    = rp.fPolarPhi;
-//   fParticlePDG = rp.fParticlePDG; 
+  fPdgCode     = rp.fPdgCode;
+  fStatusCode  = rp.fStatusCode;
+  fMother[0]   = rp.fMother[0];
+  fMother[1]   = rp.fMother[1];
+  fDaughter[0] = rp.fDaughter[0];
+  fDaughter[1] = rp.fDaughter[1];
+  fWeight      = rp.fWeight;
+  fCalcMass    = rp.fCalcMass;
+  fPx          = rp.fPx;
+  fPy          = rp.fPy;
+  fPz          = rp.fPz;
+  fE           = rp.fE;
+  fVx          = rp.fVx;
+  fVy          = rp.fVy;
+  fVz          = rp.fVz;
+  fVt          = rp.fVt;
+  fPolarTheta  = rp.fPolarTheta;
+  fPolarPhi    = rp.fPolarPhi;
+  fParticlePDG = rp.fParticlePDG; 
 }
 
 //____________________________________________________________________________
  AliPHOSFastRecParticle::AliPHOSFastRecParticle(const TParticle & pp)
 {
-  TParticle & pnoconst = const_cast<TParticle &>(pp) ;
-  AliPHOSFastRecParticle & p = static_cast<AliPHOSFastRecParticle&>(pnoconst) ;
+  // ctor from a TParticle (crummy?!)
+  TParticle & pnoconst = (TParticle &)(pp) ;
+  AliPHOSFastRecParticle & p = (AliPHOSFastRecParticle &)(pnoconst) ;
 
   fPdgCode     = p.fPdgCode;
   fStatusCode  = p.fStatusCode;
@@ -82,11 +89,7 @@ ClassImp(AliPHOSFastRecParticle)
   fPolarTheta  = p.fPolarTheta;
   fPolarPhi    = p.fPolarPhi;
   fParticlePDG = p.fParticlePDG; 
-}
 
-//____________________________________________________________________________
- AliPHOSFastRecParticle::~AliPHOSFastRecParticle()
-{
 }
 
 //____________________________________________________________________________
@@ -121,8 +124,7 @@ 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 ;
 
@@ -156,9 +158,12 @@ void AliPHOSFastRecParticle::ExecuteEvent(Int_t event, Int_t px, Int_t py)
   }
 
 }
+
 //____________________________________________________________________________
 TString AliPHOSFastRecParticle::Name()
 {
+  // Returns the name of the particle type
+  
   TString  name ; 
   switch (fType) {
   case kGAMMA:
@@ -167,20 +172,17 @@ TString AliPHOSFastRecParticle::Name()
    case kELECTRON:
      name = "ELECTRON" ;
     break ; 
-  case kNEUTRAL:
-    name = "NEUTRAL" ;
-    break ; 
-   case kCHARGEDHADRON:
-    name = "CHARGED HADRON" ;
+   case kCHARGEDHA:
+    name = "CHARGED_HA" ;
     break ; 
-  case kNEUTRALHADRON:
-    name = "NEUTRAL HADRON" ; 
+  case kNEUTRALHA:
+    name = "NEUTRAL_HA" ; 
     break ; 
   case kNEUTRALEM:
-    name = "NEUTRAL EM" ; 
+    name = "NEUTRAL_EM" ; 
     break ; 
-  case kGAMMAHADRON:
-    name = "PHOTON HADRON" ; 
+  case kGAMMAHA:
+    name = "PHOTON_HA" ; 
     break ; 
 
   }
@@ -190,27 +192,29 @@ TString AliPHOSFastRecParticle::Name()
 //______________________________________________________________________________
 void AliPHOSFastRecParticle::Paint(Option_t *)
 {
-// Paint this ALiRecParticle in theta,phi coordinate as a TMarker  with its current attributes
+  // Paint this ALiRecParticle in theta,phi coordinate as a TMarker  with its current attributes
 
   Double_t kRADDEG = 180. / TMath::Pi() ; 
-   Coord_t x = Phi() * kRADDEG     ;
-   Coord_t y = Theta() * kRADDEG     ;
-   Color_t markercolor = 1 ;
-   Size_t  markersize  = 1. ;
-   Style_t markerstyle = 5 ;
-
-   if (!gPad->IsBatch()) {
-     gVirtualX->SetMarkerColor(markercolor) ;
-     gVirtualX->SetMarkerSize (markersize)  ;
-     gVirtualX->SetMarkerStyle(markerstyle) ;
-   }
-   gPad->SetAttMarkerPS(markercolor,markerstyle,markersize) ;
-   gPad->PaintPolyMarker(1,&x,&y,"") ;
+  Coord_t x = Phi() * kRADDEG     ;
+  Coord_t y = Theta() * kRADDEG     ;
+  Color_t markercolor = 1 ;
+  Size_t  markersize  = 1. ;
+  Style_t markerstyle = 5 ;
+  
+  if (!gPad->IsBatch()) {
+    gVirtualX->SetMarkerColor(markercolor) ;
+    gVirtualX->SetMarkerSize (markersize)  ;
+    gVirtualX->SetMarkerStyle(markerstyle) ;
+  }
+  gPad->SetAttMarkerPS(markercolor,markerstyle,markersize) ;
+  gPad->PaintPolyMarker(1,&x,&y,"") ;
 }
 
 //____________________________________________________________________________
-void AliPHOSFastRecParticle::Print()
+void AliPHOSFastRecParticle::Print(const char * opt)
 {
+  // Print the typr, energy and momentum
+  
   cout << "AliPHOSFastRecParticle > " << "type is  " << Name() << endl 
        << "                     " << "Energy = " << fE << endl 
        << "                     " << "Px     = " << fPx << endl