X-Git-Url: http://git.uio.no/git/?a=blobdiff_plain;f=PHOS%2FAliPHOSFastRecParticle.cxx;h=d9df9866f3d57c56103d0ebe56b6041c2ebbe0c9;hb=5104b23eb16e0d2f3643636cb85bf52f604edd66;hp=61cbe85d7c04cbc689fc78c01f2b1f43a7271a89;hpb=084903f1063c9dbb47ef0461f8bd3d5e48fe47a8;p=u%2Fmrichter%2FAliRoot.git diff --git a/PHOS/AliPHOSFastRecParticle.cxx b/PHOS/AliPHOSFastRecParticle.cxx index 61cbe85d7c0..d9df9866f3d 100644 --- a/PHOS/AliPHOSFastRecParticle.cxx +++ b/PHOS/AliPHOSFastRecParticle.cxx @@ -15,6 +15,14 @@ /* $Id$ */ +/* History of cvs commits: + * + * $Log$ + * Revision 1.39 2005/05/28 14:19:04 schutz + * Compilation warnings fixed by T.P. + * + */ + //_________________________________________________________________________ // A Particle modified by PHOS response and produced by AliPHOSvFast // To become a general class of AliRoot ? @@ -29,26 +37,35 @@ // --- Standard library --- // --- AliRoot header files --- - +#include "AliLog.h" #include "AliPHOSFastRecParticle.h" #include "TPad.h" #include "TPaveText.h" -ClassImp(AliPHOSFastRecParticle) ; +ClassImp(AliPHOSFastRecParticle) //____________________________________________________________________________ -AliPHOSFastRecParticle::AliPHOSFastRecParticle() : TParticle() +AliPHOSFastRecParticle::AliPHOSFastRecParticle() : + fIndexInList(0), + fTof(0.f), + fType(0) { // ctor - fType = 0 ; + + for(Int_t i=0; iAddText(line1) ; clustertext ->AddText(line2) ; clustertext ->Draw(""); @@ -167,62 +194,115 @@ void AliPHOSFastRecParticle::ExecuteEvent(Int_t event, Int_t px, Int_t py) } //____________________________________________________________________________ -Bool_t AliPHOSFastRecParticle::IsPhoton(const char* purity) const +Bool_t AliPHOSFastRecParticle::IsPhoton(TString purity) const { // Rec.Particle is a photon if it has a photon-like shape, fast and neutral // photon-like shape is defined with a purity "low", "medium" or "high" + purity.ToLower(); Bool_t photonLike = kFALSE; - if (strcmp(purity,"low") ==0) photonLike = TestPIDBit(6); - else if (strcmp(purity,"medium")==0) photonLike = TestPIDBit(7); - else if (strcmp(purity,"high") ==0) photonLike = TestPIDBit(8); - else Error("IsPhoton","Wrong purity type: \'%s\'",purity); + if (purity == "low" ) photonLike = TestPIDBit(6); + else if (purity == "medium") photonLike = TestPIDBit(7); + else if (purity == "high" ) photonLike = TestPIDBit(8); if (photonLike && // photon by PCA (TestPIDBit(5)||TestPIDBit(4)||TestPIDBit(3))&& // fast by TOF - (TestPIDBit(2)||TestPIDBit(1)||TestPIDBit(0))) // neutral by CPV + (TestPIDBit(2)||TestPIDBit(1)||TestPIDBit(0))&& // neutral by CPV + !TestPIDBit(14)) // no charged track return kTRUE ; else return kFALSE; } //____________________________________________________________________________ -Bool_t AliPHOSFastRecParticle::IsPi0(const char* purity) const +Bool_t AliPHOSFastRecParticle::IsPi0(TString purity) const { // Rec.Particle is a pi0 if it has a pi0-like shape, fast and neutral // pi0-like shape is defined with a purity "low", "medium" or "high" + purity.ToLower(); Bool_t pi0Like = kFALSE; - if (strcmp(purity,"low") ==0) pi0Like = TestPIDBit(9); - else if (strcmp(purity,"medium")==0) pi0Like = TestPIDBit(10); - else if (strcmp(purity,"high") ==0) pi0Like = TestPIDBit(11); - else Error("IsPi0","Wrong purity type: %s",purity); + if (purity == "low" ) pi0Like = TestPIDBit(9); + else if (purity == "medium") pi0Like = TestPIDBit(10); + else if (purity == "high" ) pi0Like = TestPIDBit(11); + else + AliError(Form("Wrong purity type: %s",purity.Data())); if (pi0Like && // pi0 by PCA (TestPIDBit(5)||TestPIDBit(4)||TestPIDBit(3))&& // fast by TOF - (TestPIDBit(2)||TestPIDBit(1)||TestPIDBit(0))) // neutral by CPV + (TestPIDBit(2)||TestPIDBit(1)||TestPIDBit(0))&& // neutral by CPV + !TestPIDBit(14)) // no charged track return kTRUE ; else return kFALSE; } //____________________________________________________________________________ -Bool_t AliPHOSFastRecParticle::IsElectron(const char* purity) const +Bool_t AliPHOSFastRecParticle::IsElectron(TString purity) const { // Rec.Particle is an electron if it has a photon-like shape, fast and charged // photon-like shape is defined with a purity "low", "medium" or "high" + purity.ToLower(); Bool_t photonLike = kFALSE; - if (strcmp(purity,"low") ==0) photonLike = TestPIDBit(6); - else if (strcmp(purity,"medium")==0) photonLike = TestPIDBit(7); - else if (strcmp(purity,"high") ==0) photonLike = TestPIDBit(8); - else Error("IsElectron","Wrong purity type: %s",purity); + if (purity == "low" ) photonLike = TestPIDBit(6); + else if (purity == "medium") photonLike = TestPIDBit(7); + else if (purity == "high" ) photonLike = TestPIDBit(8); + else + AliError(Form("Wrong purity type: %s",purity.Data())); + if (photonLike && // photon by PCA - (TestPIDBit(5)||TestPIDBit(4)||TestPIDBit(3))&& // fast by TOF - !(TestPIDBit(2)||TestPIDBit(1)||TestPIDBit(0))) // charged by CPV + (TestPIDBit(5)|| TestPIDBit(4)|| TestPIDBit(3))&& // fast by TOF + (!TestPIDBit(2)||!TestPIDBit(1)||!TestPIDBit(0))&& // charged by CPV + TestPIDBit(14)) // no charged track + return kTRUE ; + else + return kFALSE; +} + +//____________________________________________________________________________ +Bool_t AliPHOSFastRecParticle::IsEleCon(TString purity) const +{ + // Rec.Particle is an electron if it has a photon-like shape, fast and charged + // photon-like shape is defined with a purity "low", "medium" or "high" + + purity.ToLower(); + Bool_t photonLike = kFALSE; + if (purity == "low" ) photonLike = TestPIDBit(6); + else if (purity == "medium") photonLike = TestPIDBit(7); + else if (purity == "high" ) photonLike = TestPIDBit(8); + else + AliError(Form("Wrong purity type: %s",purity.Data())); + + if (photonLike && // photon by PCA + (TestPIDBit(5)|| TestPIDBit(4)|| TestPIDBit(3))&& // fast by TOF + (!TestPIDBit(2)||!TestPIDBit(1)||!TestPIDBit(0))&& // charged by CPV + !TestPIDBit(14)) // no charged track return kTRUE ; else return kFALSE; } +//____________________________________________________________________________ +Bool_t AliPHOSFastRecParticle::IsHardPhoton() const +{ + // Rec.Particle is a hard photon (E > 30 GeV) if its second moment M2x + // corresponds to photons + if (TestPIDBit(12) && !TestPIDBit(14)) + return kTRUE; + else + return kFALSE; +} + +//____________________________________________________________________________ +Bool_t AliPHOSFastRecParticle::IsHardPi0() const +{ + // Rec.Particle is a hard pi0 (E > 30 GeV) if its second moment M2x + // corresponds to pi0 + if (TestPIDBit(13)&& !TestPIDBit(14)) + return kTRUE; + else + return kFALSE; +} + //____________________________________________________________________________ Bool_t AliPHOSFastRecParticle::IsHadron() const { @@ -332,41 +412,41 @@ TString AliPHOSFastRecParticle::Name() const name = "Undefined particle" ; if (IsPhoton("low")) - name = "Photon low purity "; + name = "Photon low purity, "; else if (IsPhoton("medium")) - name = "Photon medium purity"; + name = "Photon medium purity, "; else if (IsPhoton("high")) - name = "Photon high purity "; + name = "Photon high purity, "; if (IsPi0("low")) - name += "Pi0 low purity "; + name = "Pi0 low purity, "; else if (IsPi0("medium")) - name += "Pi0 medium purity "; + name = "Pi0 medium purity, "; else if (IsPi0("high")) - name += "Pi0 high purity "; + name = "Pi0 high purity, "; if (IsElectron("low")) - name += "Electron low purity "; + name = "Electron low purity, "; else if (IsElectron("medium")) - name += "Electron medium purity "; + name = "Electron medium purity, "; else if (IsElectron("high")) - name += "Electron high purity "; + name = "Electron high purity, "; if (IsHadron()) { name = "hadron"; if (IsChargedHadron()) { - name.Prepend("charged "); + name.Prepend("charged, "); if (IsFastChargedHadron()) - name.Prepend("fast "); + name.Prepend("fast, "); else if (IsSlowChargedHadron()) - name.Prepend("slow "); + name.Prepend("slow, "); } else if (IsNeutralHadron()) { - name.Prepend("neutral "); + name.Prepend("neutral, "); if (IsFastNeutralHadron()) - name.Prepend("fast "); + name.Prepend("fast, "); else if (IsSlowNeutralHadron()) - name.Prepend("slow "); + name.Prepend("slow, "); } } @@ -435,24 +515,35 @@ void AliPHOSFastRecParticle::Paint(Option_t *) } //____________________________________________________________________________ -void AliPHOSFastRecParticle::Print(Option_t * opt)const +void AliPHOSFastRecParticle::Print(const Option_t *)const { // Print the type, energy and momentum of the reconstructed particle - TString message ; - message = "\n PID bits are %d%d%d %d%d%d %d%d%d %d%d%d" ; - message += ", type is \"%s\"\n" ; - message += " (E,Px,Py,Pz) = (% .3e, % .3e, % .3e, % .3e) GeV\n" ; - Info("Print", message.Data(), - TestPIDBit(0),TestPIDBit(1), - TestPIDBit(2),TestPIDBit(3), - TestPIDBit(4),TestPIDBit(5), - TestPIDBit(6),TestPIDBit(7), - TestPIDBit(8),TestPIDBit(9), - TestPIDBit(10),TestPIDBit(11), - Name().Data(), - Energy(), - Px(), - Py(), - Pz() ); + AliInfo(Form("Print -----------------------------")) ; + printf("PID bits are %d%d%d %d%d%d %d%d%d %d%d%d", + TestPIDBit(0),TestPIDBit(1), + TestPIDBit(2),TestPIDBit(3), + TestPIDBit(4),TestPIDBit(5), + TestPIDBit(6),TestPIDBit(7), + TestPIDBit(8),TestPIDBit(9), + TestPIDBit(10),TestPIDBit(11)) ; + printf(", type is \"%s\"\n", Name().Data()) ; + printf(" (E,Px,Py,Pz) = (% .3e, % .3e, % .3e, % .3e) GeV\n", + Energy(), + Px(), + Py(), + Pz() ) ; + printf(" TOF = %.3e ns\n", ToF() ) ; + printf(" PID weight: \n" ) ; + printf(" photon -> %f\n", fPID[AliPID::kPhoton] ) ; + printf(" electron -> %f\n", fPID[AliPID::kElectron] ) ; + printf(" Conversion electron -> %f\n", fPID[AliPID::kEleCon] ) ; + printf(" muon -> %f\n", fPID[AliPID::kMuon] ) ; + printf(" neutral pion -> %f\n", fPID[AliPID::kPi0] ) ; + printf(" charged pion -> %f\n", fPID[AliPID::kPion] ) ; + printf(" charged kaon -> %f\n", fPID[AliPID::kKaon] ) ; + printf(" neutral kaon -> %f\n", fPID[AliPID::kKaon0] ) ; + printf(" proton -> %f\n", fPID[AliPID::kProton] ) ; + printf(" neutron -> %f\n", fPID[AliPID::kNeutron] ) ; + }