fTrs = new AliPHOSTrackSegmentMakerv1() ;
//========== Creates the particle identifier
fPID = new AliPHOSPIDv1() ;
+ fPID->SetShowerProfileCuts(0.5, 1.5, 0.5, 1.5 ) ;
+ fPID->Print() ;
//========== Creates the Reconstructioner
fRec = new AliPHOSReconstructioner(fClu, fTrs, fPID) ;
//========== Event Number
{
if ( tracksegment->GetPHOSMod() == module )
{
- switch(tracksegment->GetPartType())
+ AliPHOSRecParticle recpart(tracksegment) ;
+ switch(recpart.GetType())
{
- case 0:
- fhPhotonEnergy->Fill(tracksegment->GetEnergy() ) ;
- // fhPhotonPositionX->Fill(tracksegment-> ) ;
- //fhPhotonPositionY->Fill(tracksegment-> ) ;
+ case kGAMMA:
+ fhPhotonEnergy->Fill(recpart.Energy() ) ;
+ //fhPhotonPositionX->Fill(recpart. ) ;
+ //fhPhotonPositionY->Fill(recpart. ) ;
//cout << "PHOTON" << endl;
break;
- case 1 :
- fhElectronEnergy->Fill(tracksegment->GetEnergy() ) ;
- //fhElectronPositionX->Fill(tracksegment-> ) ;
- //fhElectronPositionY->Fill(tracksegment-> ) ;
+ case kELECTRON:
+ fhElectronEnergy->Fill(recpart.Energy() ) ;
+ //fhElectronPositionX->Fill(recpart. ) ;
+ //fhElectronPositionY->Fill(recpart. ) ;
//cout << "ELECTRON" << endl;
break;
- case 2 :
- fhNeutralEnergy->Fill(tracksegment->GetEnergy() ) ;
- //fhNeutralPositionX->Fill(tracksegment-> ) ;
- //fhNeutralPositionY->Fill(tracksegment-> ) ;
- //cout << "NEUTRAL" << endl;
+ case kNEUTRON:
+ fhNeutronEnergy->Fill(recpart.Energy() ) ;
+ //fhNeutronPositionX->Fill(recpart. ) ;
+ //fhNeutronPositionY->Fill(recpart. ) ;
+ //cout << "NEUTRON" << endl;
break ;
- case 3 :
- fhChargedEnergy->Fill(tracksegment->GetEnergy() ) ;
- //fhChargedPositionX->Fill(tracksegment-> ) ;
- //fhChargedPositionY->Fill(tracksegment-> ) ;
- //cout << "CHARGED" << endl;
+ case kCHARGEDHADRON :
+ fhChargedHadronEnergy->Fill(recpart.Energy() ) ;
+ //fhChargedHadronPositionX->Fill(recpart. ) ;
+ //fhChargedHadronPositionY->Fill(recpart. ) ;
+ //cout << "CHARGED HADRON" << endl;
break ;
}
fhConvertorEmc = new TH2F("hConvertorEmc", "hConvertorEmc", 200, 1. , 3., 200, 0., 3.e-5);
fhPhotonEnergy = new TH1F("hPhotonEnergy", "hPhotonEnergy", 1000, 0. , 30.);
fhElectronEnergy = new TH1F("hElectronEnergy","hElectronEnergy", 1000, 0. , 30.);
- fhNeutralEnergy = new TH1F("hNeutralEnergy", "hNeutralEnergy", 1000, 0. , 30.);
- fhChargedEnergy = new TH1F("hChargedEnergy", "hChargedEnergy", 1000, 0. , 30.);
+ fhNeutronEnergy = new TH1F("hNeutronEnergy", "hNeutronEnergy", 1000, 0. , 30.);
+ fhChargedHadronEnergy = new TH1F("hChargedHadronEnergy", "hChargedHadronEnergy", 1000, 0. , 30.);
fhPhotonPositionX = new TH1F("hPhotonPositionX","hPhotonPositionX", 500,-80. , 80.);
fhElectronPositionX= new TH1F("hElectronPositionX","hElectronPositionX",500,-80. , 80.);
- fhNeutralPositionX = new TH1F("hNeutralPositionX","hNeutralPositionX",500,-80. , 80.);
- fhChargedPositionX = new TH1F("hChargedPositionX","hChargedPositionX",500,-80. , 80.);
+ fhNeutronPositionX = new TH1F("hNeutronPositionX","hNeutronPositionX",500,-80. , 80.);
+ fhChargedHadronPositionX = new TH1F("hChargedHadronPositionX","hChargedHadronPositionX",500,-80. , 80.);
fhPhotonPositionY = new TH1F("hPhotonPositionY","hPhotonPositionY", 500,-80. , 80.);
fhElectronPositionY= new TH1F("hElectronPositionY","hElectronPositionY",500,-80. , 80.);
- fhNeutralPositionY = new TH1F("hNeutralPositionY","hNeutralPositionY",500,-80. , 80.);
- fhChargedPositionY = new TH1F("hChargedPositionY","hChargedPositionY",500,-80. , 80.);
+ fhNeutronPositionY = new TH1F("hNeutronPositionY","hNeutronPositionY",500,-80. , 80.);
+ fhChargedHadronPositionY = new TH1F("hChargedHadronPositionY","hChargedHadronPositionY",500,-80. , 80.);
}
//____________________________________________________________________________
if (fhPhotonEnergy) fhPhotonEnergy->Write() ;
if (fhPhotonPositionX) fhPhotonPositionX->Write() ;
if (fhPhotonPositionY) fhPhotonPositionX->Write() ;
- if (fhElectronEnergy) fhElectronEnergy->Write() ;
+ if (fhElectronEnergy) fhElectronEnergy->Write() ;
if (fhElectronPositionX) fhElectronPositionX->Write() ;
if (fhElectronPositionY) fhElectronPositionX->Write() ;
- if (fhNeutralEnergy) fhNeutralEnergy->Write() ;
- if (fhNeutralPositionX) fhNeutralPositionX->Write() ;
- if (fhNeutralPositionY) fhNeutralPositionX->Write() ;
- if (fhChargedEnergy) fhChargedEnergy->Write() ;
- if (fhChargedPositionX) fhChargedPositionX->Write() ;
- if (fhChargedPositionY) fhChargedPositionX->Write() ;
+ if (fhNeutronEnergy) fhNeutronEnergy->Write() ;
+ if (fhNeutronPositionX) fhNeutronPositionX->Write() ;
+ if (fhNeutronPositionY) fhNeutronPositionX->Write() ;
+ if (fhChargedHadronEnergy) fhChargedHadronEnergy->Write() ;
+ if (fhChargedHadronPositionX) fhChargedHadronPositionX->Write() ;
+ if (fhChargedHadronPositionY) fhChargedHadronPositionX->Write() ;
output.Write();
output.Close();
TH2F * fhConvertorEmc ; // 2d Convertor versus Emc energies
TH1F * fhPhotonEnergy ; // Spectrum of detected photons
TH1F * fhElectronEnergy ; // Spectrum of detected electrons
- TH1F * fhNeutralEnergy ; // Spectrum of detected neutrals
- TH1F * fhChargedEnergy ; // Spectrum of detected charged
+ TH1F * fhNeutronEnergy ; // Spectrum of detected neutrals
+ TH1F * fhChargedHadronEnergy ; // Spectrum of detected charged
TH1F * fhPhotonPositionX ; // X distribution of detected photons
TH1F * fhElectronPositionX ; // X distribution of detected electrons
- TH1F * fhNeutralPositionX ; // X distribution of detected neutrals
- TH1F * fhChargedPositionX ; // X distribution of detected charged
+ TH1F * fhNeutronPositionX ; // X distribution of detected neutrals
+ TH1F * fhChargedHadronPositionX ; // X distribution of detected charged
TH1F * fhPhotonPositionY ; // Y distribution of detected photons
TH1F * fhElectronPositionY ; // Y distribution of detected electrons
- TH1F * fhNeutralPositionY ; // Y distribution of detected neutrals
- TH1F * fhChargedPositionY ; // Y distribution of detected charged
+ TH1F * fhNeutronPositionY ; // Y distribution of detected neutrals
+ TH1F * fhChargedHadronPositionY ; // Y distribution of detected charged
ClassDef(AliPHOSAnalyze,1) // PHOS event analyzis , version 1
virtual ~AliPHOSPID() ; // dtor
virtual void GetParticleType(TrackSegmentsList * trsl, RecParticlesList * rpl) {} ;
+ virtual void SetShowerProfileCuts(Float_t, Float_t, Float_t, Float_t) {} ;
+ virtual void SetDispersionCutOff(Float_t ) {}
ClassDef(AliPHOSPID,1) // Particle Identifier interface, version 1
//____________________________________________________________________________
- AliPHOSPIDv1::AliPHOSPIDv1()
+ AliPHOSPIDv1::AliPHOSPIDv1(): fCutOnDispersion(1.5)
+
{
// ctor
TIter next(trsl) ;
AliPHOSTrackSegment * tracksegment ;
Int_t index = 0 ;
-
+ AliPHOSRecParticle * rp ;
while ( (tracksegment = (AliPHOSTrackSegment *)next()) ) {
- new( (*rpl)[index] ) AliPHOSRecParticle(tracksegment) ;
+ new( (*rpl)[index] ) AliPHOSRecParticle(tracksegment) ;
+ rp = (AliPHOSRecParticle *)(*rpl)[index] ;
+ Int_t type = rp->GetType() ;
+ if ( type == kNEUTRAL ) { // resolve neutral baryon from photon
+ AliPHOSEmcRecPoint * recp = tracksegment->GetEmcRecPoint() ;
+ Float_t * lambda = new Float_t[2];
+ recp->GetElipsAxis(lambda) ;
+ if ( ( lambda[0] > fLambda1m && lambda[0] < fLambda1M ) && // shower profile cut
+ ( lambda[1] > fLambda2m && lambda[1] < fLambda2M ) )
+ type = kGAMMA ;
+ else
+ type = kNEUTRON ;
+ delete lambda ;
+ }
+ if (type == kCHARGED) {
+ if( tracksegment->GetEmcRecPoint()->GetDispersion() > fCutOnDispersion) // shower dispersion cut
+ type = kCHARGEDHADRON ;
+ else
+ type = kELECTRON ;
+ }
+ rp->SetType(type) ;
index++ ;
}
}
+//____________________________________________________________________________
+void AliPHOSPIDv1:: Print()
+{
+ cout << "AliPHOSPIDv1 : cuts for the particle idendification based on the shower profile " << endl
+ << fLambda1m << " < value1 < " << fLambda1M << endl
+ << fLambda2m << " < value2 < " << fLambda2M << endl ;
+
+}
+
+//____________________________________________________________________________
+void AliPHOSPIDv1::SetShowerProfileCuts(Float_t l1m, Float_t l1M, Float_t l2m, Float_t l2M)
+{
+ fLambda1m = l1m ;
+ fLambda1M = l1M ;
+ fLambda2m = l2m ;
+ fLambda2M = l2M ;
+}
AliPHOSPIDv1() ;
virtual ~ AliPHOSPIDv1() ; // dtor
- void GetParticleType(TrackSegmentsList * trsl, RecParticlesList * rpl ) ; // does the job
+ virtual void GetParticleType(TrackSegmentsList * trsl, RecParticlesList * rpl ) ; // does the job
+ void Print() ;
+ virtual void SetDispersionCutOff(Float_t Dcut) {fCutOnDispersion = Dcut ; }
+ virtual void SetShowerProfileCuts(Float_t l1m, Float_t l1M, Float_t l2m, Float_t l2M) ;
+
+ private:
+
+ // cuts on the shower profile
+ Float_t fLambda1m ; // minimum value for first elips axis
+ Float_t fLambda1M ; // maximum value for first elips axis
+ Float_t fLambda2m ; // minimum value for second elips axis
+ Float_t fLambda2M ; // maximum value for second elips axis
+
+ Float_t fCutOnDispersion ; // cut on the shower dispersion to distinguish hadronic from EM showers
ClassDef( AliPHOSPIDv1,1) // particle identifier implementation , version 1
// ctor
fPHOSTrackSegment = new AliPHOSTrackSegment(*ts) ;
- fType = ts->GetPartType() ;
fE = ts->GetEnergy() ;
TVector3 momdir = ts->GetMomentumDirection() ;
fPx = fE * momdir.X() ;
fPy = fE * momdir.Y() ;
fPz = fE * momdir.Z() ;
+ fType = kUNDEFINED ; // undefined
+
+ if( ts->GetPpsdUp() == 0 ) { // Neutral
+
+ if( ts->GetPpsdLow() == 0 ) // Neutral
+ fType = kNEUTRAL ;
+ else // Gamma
+ fType = kGAMMA ;
+ }
+ else // Charged
+ fType = kCHARGED ;
+
}
//____________________________________________________________________________
{
TString name ;
switch (fType) {
- case kGAMMA :
+ case kGAMMA:
name = "PHOTON" ;
break ;
- case kELECTRON :
+ case kELECTRON:
name = "ELECTRON" ;
break ;
- case kNEUTRAL :
+ case kNEUTRAL:
name = "NEUTRAL" ;
break ;
case kCHARGEDHADRON:
name = "CHARGED HADRON" ;
break ;
+ case kNEUTRON:
+ name = "NEUTRAL BARYON" ;
+ break ;
}
return name ;
}
#include "AliPHOSTrackSegment.h"
+const static Int_t kUNDEFINED = -1;
+const static Int_t kGAMMA = 0 ;
+const static Int_t kELECTRON = 1 ;
+const static Int_t kNEUTRAL = 2 ;
+const static Int_t kCHARGED = 3 ;
+const static Int_t kCHARGEDHADRON = 4 ;
+const static Int_t kNEUTRON = 5 ;
+
class AliPHOSRecParticle : public TParticle {
public:
AliPHOSTrackSegment * GetPHOSTrackSegment() { return fPHOSTrackSegment ; }
Int_t GetType() { return fType ; }
TString Name() ;
- void Print() ;
+ void Print() ;
+ void SetType(Int_t type) { fType = type ; }
private:
if( ppsdRP2 )
fPpsdLow = ppsdRP2 ;
- fCutOnDispersion = 1.5 ;
}
//____________________________________________________________________________
fEmcRecPoint->GetLocalPosition(pos) ;
textTS = new TPaveText(pos.X()-10,pos.Z()+10,pos.X()+5,pos.Z()+15,"") ;
Text_t line1[40] ;
- if (GetPartType() == kGAMMA )
- sprintf(line1,"PHOTON") ;
- if (GetPartType() == kELECTRON )
- sprintf(line1,"ELECTRON") ;
- if (GetPartType() == kNEUTRAL )
- sprintf(line1,"NEUTRAL") ;
- if (GetPartType() == kCHARGEDHADRON )
- sprintf(line1,"CHARGED HADRON") ;
-
+ sprintf(line1,"See RecParticle for ID") ;
textTS ->AddText(line1) ;
textTS ->Draw("");
gPad->Update() ;
return dir ;
}
-//____________________________________________________________________________
-Int_t AliPHOSTrackSegment::GetPartType()
-{
- // Returns 0 - gamma
- // 1 - e+, e-
- // 2 - neutral
- // 3 - charged hadron
-
- Int_t typeofparticle = kGAMMA ;
-
- if( fPpsdUp == 0 ) { // Neutral
-
- if( fPpsdLow == 0 ) // Neutral
- typeofparticle = kNEUTRAL ;
- else // Gamma
- typeofparticle = kGAMMA ;
-
- }
-
- else { // Charged
-
- if( fEmcRecPoint->GetDispersion() > fCutOnDispersion)
- typeofparticle = kCHARGEDHADRON ;
- else
- typeofparticle = kELECTRON ;
-
- }
-
- return typeofparticle ;
-
-}
//____________________________________________________________________________
void AliPHOSTrackSegment::GetPosition( TVector3 & pos )
#include "AliPHOSEmcRecPoint.h"
#include "AliPHOSPpsdRecPoint.h"
-const static Int_t kGAMMA = 0 ;
-const static Int_t kELECTRON = 1 ;
-const static Int_t kNEUTRAL = 2 ;
-const static Int_t kCHARGEDHADRON = 3 ;
-
class AliPHOSTrackSegment : public TObject {
public:
virtual Int_t DistancetoPrimitive(Int_t px, Int_t py);
virtual void Draw(Option_t * option="") ;
virtual void ExecuteEvent(Int_t event, Int_t px, Int_t py);
- Int_t GetPartType() ; // Returns 0 - gamma, 1 - e+, e- ; 2 - neutral hadron ; 3 - charged hadron
Float_t GetEnergy(){ return fEmcRecPoint->GetTotalEnergy() ;} // Returns energy in EMC
Float_t GetDistanceInPHOSPlane(void) ; // Computes in PHOS plane the relative position between EMC and PPSD clusters
virtual Int_t GetPHOSMod(void) {return fEmcRecPoint->GetPHOSMod(); }
TVector3 GetMomentumDirection() ; // Returns the momentum direction
void GetPosition( TVector3 & pos ) ; // Returns positions of hit
+ AliPHOSEmcRecPoint * GetEmcRecPoint() const { return fEmcRecPoint ; }
+ AliPHOSPpsdRecPoint * GetPpsdLow() const { return fPpsdLow ; }
+ AliPHOSPpsdRecPoint * GetPpsdUp() const { return fPpsdUp ; }
virtual void Paint(Option_t * option="");
void Print() ;
- void SetDispersionCutOff(Float_t Dcut) {fCutOnDispersion = Dcut ; }
private:
AliPHOSPpsdRecPoint * fPpsdLow ;
AliPHOSPpsdRecPoint * fPpsdUp ;
- Float_t fCutOnDispersion ;
ClassDef(AliPHOSTrackSegment,1) // description , version 1