From 09fc14a05f8da34f099349118ed9c2f8b078f6c4 Mon Sep 17 00:00:00 2001 From: schutz Date: Wed, 16 Feb 2000 18:07:54 +0000 Subject: [PATCH] Particle identification improved by shower profile analysis --- PHOS/AliPHOSAnalyze.cxx | 67 +++++++++++++++++++----------------- PHOS/AliPHOSAnalyze.h | 12 +++---- PHOS/AliPHOSPID.h | 2 ++ PHOS/AliPHOSPIDv1.cxx | 44 +++++++++++++++++++++-- PHOS/AliPHOSPIDv1.h | 15 +++++++- PHOS/AliPHOSRecParticle.cxx | 22 +++++++++--- PHOS/AliPHOSRecParticle.h | 11 +++++- PHOS/AliPHOSTrackSegment.cxx | 42 +--------------------- PHOS/AliPHOSTrackSegment.h | 11 ++---- 9 files changed, 130 insertions(+), 96 deletions(-) diff --git a/PHOS/AliPHOSAnalyze.cxx b/PHOS/AliPHOSAnalyze.cxx index 04e26a1c58f..196f53883b8 100644 --- a/PHOS/AliPHOSAnalyze.cxx +++ b/PHOS/AliPHOSAnalyze.cxx @@ -164,6 +164,8 @@ void AliPHOSAnalyze::AnalyzeOneEvent(Int_t evt) 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 @@ -219,31 +221,32 @@ void AliPHOSAnalyze::AnalyzeOneEvent(Int_t evt) { 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 ; } @@ -280,16 +283,16 @@ void AliPHOSAnalyze::BookingHistograms() 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.); } //____________________________________________________________________________ @@ -753,15 +756,15 @@ void AliPHOSAnalyze::SavingHistograms() 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(); diff --git a/PHOS/AliPHOSAnalyze.h b/PHOS/AliPHOSAnalyze.h index 3d41013b054..2b702492e76 100644 --- a/PHOS/AliPHOSAnalyze.h +++ b/PHOS/AliPHOSAnalyze.h @@ -64,16 +64,16 @@ private: 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 diff --git a/PHOS/AliPHOSPID.h b/PHOS/AliPHOSPID.h index 39640ec4317..2f99a522747 100644 --- a/PHOS/AliPHOSPID.h +++ b/PHOS/AliPHOSPID.h @@ -37,6 +37,8 @@ public: 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 diff --git a/PHOS/AliPHOSPIDv1.cxx b/PHOS/AliPHOSPIDv1.cxx index 9eb7804036a..0e03756cc0c 100644 --- a/PHOS/AliPHOSPIDv1.cxx +++ b/PHOS/AliPHOSPIDv1.cxx @@ -34,7 +34,8 @@ ClassImp( AliPHOSPIDv1) //____________________________________________________________________________ - AliPHOSPIDv1::AliPHOSPIDv1() + AliPHOSPIDv1::AliPHOSPIDv1(): fCutOnDispersion(1.5) + { // ctor @@ -55,11 +56,48 @@ void AliPHOSPIDv1::GetParticleType(TrackSegmentsList * trsl, RecParticlesList * 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 ; +} diff --git a/PHOS/AliPHOSPIDv1.h b/PHOS/AliPHOSPIDv1.h index 117107a0ea9..4ddb24df226 100644 --- a/PHOS/AliPHOSPIDv1.h +++ b/PHOS/AliPHOSPIDv1.h @@ -28,7 +28,20 @@ public: 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 diff --git a/PHOS/AliPHOSRecParticle.cxx b/PHOS/AliPHOSRecParticle.cxx index 2d3fc2ad232..cc717d0b909 100644 --- a/PHOS/AliPHOSRecParticle.cxx +++ b/PHOS/AliPHOSRecParticle.cxx @@ -35,13 +35,24 @@ ClassImp(AliPHOSRecParticle) // 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 ; + } //____________________________________________________________________________ @@ -49,18 +60,21 @@ TString AliPHOSRecParticle::Name() { 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 ; } diff --git a/PHOS/AliPHOSRecParticle.h b/PHOS/AliPHOSRecParticle.h index f6216fd6fc9..1da0c026fb5 100644 --- a/PHOS/AliPHOSRecParticle.h +++ b/PHOS/AliPHOSRecParticle.h @@ -23,6 +23,14 @@ #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: @@ -35,7 +43,8 @@ public: AliPHOSTrackSegment * GetPHOSTrackSegment() { return fPHOSTrackSegment ; } Int_t GetType() { return fType ; } TString Name() ; - void Print() ; + void Print() ; + void SetType(Int_t type) { fType = type ; } private: diff --git a/PHOS/AliPHOSTrackSegment.cxx b/PHOS/AliPHOSTrackSegment.cxx index fae3164d70f..12e1421421b 100644 --- a/PHOS/AliPHOSTrackSegment.cxx +++ b/PHOS/AliPHOSTrackSegment.cxx @@ -47,7 +47,6 @@ AliPHOSTrackSegment::AliPHOSTrackSegment( AliPHOSEmcRecPoint * emc , AliPHOSPpsd if( ppsdRP2 ) fPpsdLow = ppsdRP2 ; - fCutOnDispersion = 1.5 ; } //____________________________________________________________________________ @@ -141,15 +140,7 @@ void AliPHOSTrackSegment::ExecuteEvent(Int_t event, Int_t px, Int_t py) 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() ; @@ -223,37 +214,6 @@ TVector3 AliPHOSTrackSegment::GetMomentumDirection() 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 ) diff --git a/PHOS/AliPHOSTrackSegment.h b/PHOS/AliPHOSTrackSegment.h index 1323117ef15..c72e77664ef 100644 --- a/PHOS/AliPHOSTrackSegment.h +++ b/PHOS/AliPHOSTrackSegment.h @@ -27,11 +27,6 @@ #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: @@ -46,16 +41,17 @@ 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: @@ -64,7 +60,6 @@ private: AliPHOSPpsdRecPoint * fPpsdLow ; AliPHOSPpsdRecPoint * fPpsdUp ; - Float_t fCutOnDispersion ; ClassDef(AliPHOSTrackSegment,1) // description , version 1 -- 2.39.3