// --- 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];
TParticle & pnoconst = (TParticle &)(pp) ;
AliPHOSFastRecParticle & p = (AliPHOSFastRecParticle &)(pnoconst) ;
-
+ fType = 0 ;
fPdgCode = p.fPdgCode;
fStatusCode = p.fStatusCode;
fMother[0] = p.fMother[0];
fPolarTheta = p.fPolarTheta;
fPolarPhi = p.fPolarPhi;
fParticlePDG = p.fParticlePDG;
+
}
//____________________________________________________________________________
{
// 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: {
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 *)
}
//____________________________________________________________________________
-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() );
}