From bd6bf3eec5f988ea40aaf00bfcdd354097af8376 Mon Sep 17 00:00:00 2001 From: pulvir Date: Thu, 15 Oct 2009 14:16:54 +0000 Subject: [PATCH] Added two new axes (mt and y) for pairs and the possibility to build histograms with MC data only --- PWG2/RESONANCES/AliRsnAnalysisSE.cxx | 4 ++-- PWG2/RESONANCES/AliRsnAnalysisSE.h | 2 +- PWG2/RESONANCES/AliRsnEvent.cxx | 4 ++++ PWG2/RESONANCES/AliRsnFunctionAxis.cxx | 19 ++++++++++++++++--- PWG2/RESONANCES/AliRsnFunctionAxis.h | 4 ++++ PWG2/RESONANCES/AliRsnPairParticle.h | 4 ++++ .../macros/train/AddAnalysisTaskRsnEffNoPID.C | 10 ++++------ PWG2/RESONANCES/macros/train/RsnConfig.C | 2 +- PWG2/libPWG2resonances.pkg | 2 +- 9 files changed, 37 insertions(+), 14 deletions(-) diff --git a/PWG2/RESONANCES/AliRsnAnalysisSE.cxx b/PWG2/RESONANCES/AliRsnAnalysisSE.cxx index f62e0cf28f7..0925e4fcaf1 100644 --- a/PWG2/RESONANCES/AliRsnAnalysisSE.cxx +++ b/PWG2/RESONANCES/AliRsnAnalysisSE.cxx @@ -18,8 +18,8 @@ ClassImp(AliRsnAnalysisSE) //_____________________________________________________________________________ -AliRsnAnalysisSE::AliRsnAnalysisSE(const char *name,Int_t numOfOutputs) : - AliRsnVAnalysisTaskSE(name,numOfOutputs), +AliRsnAnalysisSE::AliRsnAnalysisSE(const char *name,Int_t numOfOutputs,Bool_t useKine) : + AliRsnVAnalysisTaskSE(name,numOfOutputs,useKine), fRsnAnalysisManager(), fEventCuts(0x0), fZeroEventPercentWarning(50), diff --git a/PWG2/RESONANCES/AliRsnAnalysisSE.h b/PWG2/RESONANCES/AliRsnAnalysisSE.h index b165527bf83..32df5f016fd 100644 --- a/PWG2/RESONANCES/AliRsnAnalysisSE.h +++ b/PWG2/RESONANCES/AliRsnAnalysisSE.h @@ -23,7 +23,7 @@ class AliRsnAnalysisSE : public AliRsnVAnalysisTaskSE { public: - AliRsnAnalysisSE(const char *name = "AliRsnAnalysisSE",Int_t numOfOutputs=1); + AliRsnAnalysisSE(const char *name = "AliRsnAnalysisSE",Int_t numOfOutputs=1,Bool_t useKine=kFALSE); AliRsnAnalysisSE(const AliRsnAnalysisSE& copy); virtual ~AliRsnAnalysisSE() {;}; diff --git a/PWG2/RESONANCES/AliRsnEvent.cxx b/PWG2/RESONANCES/AliRsnEvent.cxx index 4ed67c09ee2..b18594a6608 100644 --- a/PWG2/RESONANCES/AliRsnEvent.cxx +++ b/PWG2/RESONANCES/AliRsnEvent.cxx @@ -102,6 +102,10 @@ void AliRsnEvent::SetDaughter(AliRsnDaughter &out, Int_t i) out.SetParticle(refMC); out.FindMotherPDG(fRefMC->Stack()); } + + // if fRef is MC event return + AliMCEvent *mc = dynamic_cast (fRef); + if (mc) return; // retrieve vertex and set impact parameters Double_t dx = out.Xv(), dy = out.Yv(), dz = out.Zv(); diff --git a/PWG2/RESONANCES/AliRsnFunctionAxis.cxx b/PWG2/RESONANCES/AliRsnFunctionAxis.cxx index 715ed13dcb8..8de88dadd32 100644 --- a/PWG2/RESONANCES/AliRsnFunctionAxis.cxx +++ b/PWG2/RESONANCES/AliRsnFunctionAxis.cxx @@ -23,7 +23,8 @@ AliRsnFunctionAxis::AliRsnFunctionAxis() : fType(kAxisTypes), fNBins(0), fMin(0.0), - fMax(0.0) + fMax(0.0), + fMass(0.0) { // // Default constructor @@ -36,7 +37,8 @@ AliRsnFunctionAxis::AliRsnFunctionAxis fType(type), fNBins(0), fMin(0.0), - fMax(0.0) + fMax(0.0), + fMass(0.0) { // // Main constructor (version 1) @@ -51,7 +53,8 @@ AliRsnFunctionAxis::AliRsnFunctionAxis fType(type), fNBins(0), fMin(0.0), - fMax(0.0) + fMax(0.0), + fMass(0.0) { // // Main constructor (version 2) @@ -80,6 +83,8 @@ const char* AliRsnFunctionAxis::GetName() const case kPairInvMassRes: return "IMRES"; case kPairPt: return "PT"; case kPairEta: return "ETA"; + case kPairMt: return "MT"; + case kPairY: return "Y"; case kEventMult: return "MULT"; default: return "UNDEF"; } @@ -123,6 +128,8 @@ AliRsnFunctionAxis::EAxisObject AliRsnFunctionAxis::GetAxisObject() const case kPairInvMassRes: case kPairPt: case kPairEta: + case kPairMt: + case kPairY: return kPair; case kEventMult: return kEvent; @@ -222,6 +229,12 @@ Double_t AliRsnFunctionAxis::Eval(AliRsnPairParticle * const pair, AliRsnPairDef return pair->GetPt(); case kPairEta: return pair->GetEta(); + case kPairMt: + if (TMath::Abs(fMass) < 1E-5) AliWarning(Form("Suspicious mass value specified: %f", fMass)); + return TMath::Sqrt(pair->GetPt()*pair->GetPt() + fMass*fMass); + case kPairY: + if (TMath::Abs(fMass) < 1E-5) AliWarning(Form("Suspicious mass value specified: %f", fMass)); + return pair->GetY(fMass); default: AliWarning("This axis type cannot be applied to pairs"); return -999.0; diff --git a/PWG2/RESONANCES/AliRsnFunctionAxis.h b/PWG2/RESONANCES/AliRsnFunctionAxis.h index 66ec004c1d0..90554b6eac6 100644 --- a/PWG2/RESONANCES/AliRsnFunctionAxis.h +++ b/PWG2/RESONANCES/AliRsnFunctionAxis.h @@ -31,6 +31,8 @@ class AliRsnFunctionAxis : public TObject kPairInvMassRes, kPairPt, kPairEta, + kPairMt, + kPairY, kEventMult, kAxisTypes }; @@ -58,6 +60,7 @@ class AliRsnFunctionAxis : public TObject void SetType(EAxisType type) {fType = type;} void SetBins(Int_t n, Double_t min, Double_t max); void SetBins(Double_t min, Double_t max, Double_t step); + void SetMass(Double_t mass) {fMass = mass;} Double_t Eval(AliRsnDaughter *daughter) const; Double_t Eval(AliRsnPairParticle*const pair, AliRsnPairDef*const pairDef) const; @@ -70,6 +73,7 @@ class AliRsnFunctionAxis : public TObject Int_t fNBins; // number of bins Double_t fMin; // lower edge Double_t fMax; // upper edge + Double_t fMass; // reference mass for Y and Mt bins // ROOT dictionary ClassDef(AliRsnFunctionAxis, 1) diff --git a/PWG2/RESONANCES/AliRsnPairParticle.h b/PWG2/RESONANCES/AliRsnPairParticle.h index 6c1f9df7f24..a53378f9826 100644 --- a/PWG2/RESONANCES/AliRsnPairParticle.h +++ b/PWG2/RESONANCES/AliRsnPairParticle.h @@ -32,6 +32,7 @@ class AliRsnPairParticle : public TObject Double_t GetInvMassMC(Double_t m1, Double_t m2); Double_t GetEtot(Double_t m1, Double_t m2) const; + Double_t GetEtot(Double_t mass) const {return TMath::Sqrt(mass*mass + GetP2());} Double_t GetP2() const {return (fPTot[0]*fPTot[0] + fPTot[1]*fPTot[1] + fPTot[2]*fPTot[2]);} Double_t GetPt2() const {return (fPTot[0]*fPTot[0] + fPTot[1]*fPTot[1]);} Double_t GetP() const {return TMath::Sqrt(GetP2());} @@ -46,8 +47,10 @@ class AliRsnPairParticle : public TObject } Double_t GetEta() const {Double_t a = TMath::Tan(0.5*GetTheta()); if (a > 0.) return -TMath::Log(a); return 999999.0;} Double_t GetY(Double_t m1, Double_t m2) const {return 0.5*TMath::Log((GetEtot(m1,m2)+fPTot[2])/(GetEtot(m1,m2)-fPTot[2]));} + Double_t GetY(Double_t mass) const {return 0.5*TMath::Log((GetEtot(mass)+fPTot[2])/(GetEtot(mass)-fPTot[2]));} Double_t GetEtotMC(Double_t m1, Double_t m2) const; + Double_t GetEtotMC(Double_t mass) const {return TMath::Sqrt(mass*mass + GetP2MC());} Double_t GetP2MC() const {return (fPTotMC[0]*fPTotMC[0] + fPTotMC[1]*fPTotMC[1] + fPTotMC[2]*fPTotMC[2]);} Double_t GetPt2MC() const {return (fPTotMC[0]*fPTotMC[0] + fPTotMC[1]*fPTotMC[1]);} Double_t GetPMC() const {return TMath::Sqrt(GetP2MC());} @@ -62,6 +65,7 @@ class AliRsnPairParticle : public TObject } Double_t GetEtaMC() const {return -TMath::Log(TMath::Tan(0.5*GetThetaMC()));} Double_t GetYMC(Double_t m1, Double_t m2) const {return 0.5*TMath::Log((GetEtotMC(m1,m2)+fPTotMC[2])/(GetEtotMC(m1,m2)-fPTotMC[2]));} + Double_t GetYMC(Double_t mass) const {return 0.5*TMath::Log((GetEtotMC(mass)+fPTot[2])/(GetEtotMC(mass)-fPTot[2]));} Double_t GetAngle() const; diff --git a/PWG2/RESONANCES/macros/train/AddAnalysisTaskRsnEffNoPID.C b/PWG2/RESONANCES/macros/train/AddAnalysisTaskRsnEffNoPID.C index 0f99a3ceb6d..8b290523bc3 100644 --- a/PWG2/RESONANCES/macros/train/AddAnalysisTaskRsnEffNoPID.C +++ b/PWG2/RESONANCES/macros/train/AddAnalysisTaskRsnEffNoPID.C @@ -1,6 +1,6 @@ Bool_t AddAnalysisTaskRsnEffNoPID ( - const char *outFile = "eff_nopid.root", // output file name + const char *outFile = "eff_nopid.root", // output file name ) { // retrieve analysis manager @@ -26,11 +26,9 @@ Bool_t AddAnalysisTaskRsnEffNoPID task->AddPairDef(pairDef3); // axis definition - //AliRsnFunctionAxis *axisIM = new AliRsnFunctionAxis(AliRsnFunctionAxis::kPairInvMass, 1000, 0.0, 2.0); - AliRsnFunctionAxis *axisPt = new AliRsnFunctionAxis(AliRsnFunctionAxis::kPairPt, 100, 0.0, 10.0); - AliRsnFunctionAxis *axisEta = new AliRsnFunctionAxis(AliRsnFunctionAxis::kPairEta, 10, -1.0, 1.0); - AliRsnFunctionAxis *axisMult = new AliRsnFunctionAxis(AliRsnFunctionAxis::kEventMult, 8, 0.0, 200.0); - //task->AddAxis(axisIM); + AliRsnFunctionAxis *axisPt = new AliRsnFunctionAxis(AliRsnFunctionAxis::kPairPt, 100, 0.0, 10.0); + AliRsnFunctionAxis *axisEta = new AliRsnFunctionAxis(AliRsnFunctionAxis::kPairEta, 10, -1.0, 1.0); + AliRsnFunctionAxis *axisMult = new AliRsnFunctionAxis(AliRsnFunctionAxis::kEventMult, 500, 0.0, 500.0); task->AddAxis(axisMult); task->AddAxis(axisPt); task->AddAxis(axisEta); diff --git a/PWG2/RESONANCES/macros/train/RsnConfig.C b/PWG2/RESONANCES/macros/train/RsnConfig.C index 4d3ac8422fd..85eafb81664 100644 --- a/PWG2/RESONANCES/macros/train/RsnConfig.C +++ b/PWG2/RESONANCES/macros/train/RsnConfig.C @@ -129,7 +129,7 @@ AliRsnPairManager* RsnConfig // define all binnings AliRsnFunctionAxis *axisIM = new AliRsnFunctionAxis(AliRsnFunctionAxis::kPairInvMass, 1000, 0.0, 2.0); - AliRsnFunctionAxis *axisPt = new AliRsnFunctionAxis(AliRsnFunctionAxis::kPairPt, 100, 0.0, 10.0); + AliRsnFunctionAxis *axisPt = new AliRsnFunctionAxis(AliRsnFunctionAxis::kPairPt, 400, 0.0, 10.0); AliRsnFunctionAxis *axisEta = new AliRsnFunctionAxis(AliRsnFunctionAxis::kPairEta, 10, -1.0, 1.0); AliRsnFunctionAxis *axisMult = new AliRsnFunctionAxis(AliRsnFunctionAxis::kEventMult, 8, 0.0, 200.0); diff --git a/PWG2/libPWG2resonances.pkg b/PWG2/libPWG2resonances.pkg index f934cb63860..ed65bbf591b 100644 --- a/PWG2/libPWG2resonances.pkg +++ b/PWG2/libPWG2resonances.pkg @@ -40,5 +40,5 @@ EINCLUDE:= PYTHIA6 ifeq (win32gcc,$(ALICE_TARGET)) PACKSOFLAGS:= $(SOFLAGS) -L$(ALICE_ROOT)/lib/tgt_$(ALICE_TARGET) -lSTEERBase \ -lESD -lANALYSIS -lANALYSISalice \ - -L$(ROOTLIBDIR) -lEG + -L$(shell root-config --libdir) -lEG endif -- 2.43.0