Fix DCA templates for TPC+TOF
authoreserradi <eserradi@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 25 Jan 2013 10:37:07 +0000 (10:37 +0000)
committereserradi <eserradi@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 25 Jan 2013 10:37:07 +0000 (10:37 +0000)
13 files changed:
PWGLF/SPECTRA/Nuclei/B2/AliAnalysisTaskB2.cxx
PWGLF/SPECTRA/Nuclei/B2/AliAnalysisTaskB2.h
PWGLF/SPECTRA/Nuclei/B2/AliLnDriver.cxx
PWGLF/SPECTRA/Nuclei/B2/AliLnDriver.h
PWGLF/SPECTRA/Nuclei/B2/AliLnID.cxx
PWGLF/SPECTRA/Nuclei/B2/AliLnID.h
PWGLF/SPECTRA/Nuclei/B2/AliLnPt.cxx
PWGLF/SPECTRA/Nuclei/B2/AliLnPt.h
PWGLF/SPECTRA/Nuclei/B2/AliLnSecondaries.cxx
PWGLF/SPECTRA/Nuclei/B2/AliLnSecondaries.h
PWGLF/SPECTRA/Nuclei/B2/Config.h
PWGLF/SPECTRA/Nuclei/B2/macros/DrawDir.C
PWGLF/SPECTRA/Nuclei/B2/macros/DrawPt.C

index abc2ef0..9633db6 100644 (file)
@@ -59,61 +59,52 @@ AliAnalysisTaskB2::AliAnalysisTaskB2()
 : AliAnalysisTask()
 , fSpecies("Proton")
 , fPartCode(AliPID::kProton)
-       
 , fHeavyIons(0)
 , fSimulation(0)
-       
 , fMultTrigger(0)
 , fCentTrigger(0)
 , fTriggerFired(0)
 , fGoodVertex(0)
 , fPileUpEvent(0)
-       
 , fV0AND(0)
 , fNoFastOnly(0)
 , fMinKNOmult(-10)
 , fMaxKNOmult(100000)
 , fMinCentrality(0)
 , fMaxCentrality(100)
-       
 , fNtrk(0)
 , fMeanNtrk(1)
 , fKNOmult(1)
 , fMinVx(-1)
 , fMaxVx(1)
 , fMinVy(-1)
 , fMaxVy(1)
 , fMinVz(-10)
 , fMaxVz(10)
-       
 , fMinDCAxy(-1)
 , fMaxDCAxy(1)
 , fMinDCAz(-2)
 , fMaxDCAz(2)
 , fMaxNSigma(3)
-       
 , fMinEta(-0.8)
 , fMaxEta(0.8)
 , fMinY(-0.5)
 , fMaxY(0.5)
-       
 , fMCevent(0)
 , fESDevent(0)
-       
 , fHistoMap(0)
 , fESDtrackCuts(0)
 , fLnID(0)
-
 , fMaxNSigmaITS(3)
 , fMaxNSigmaTPC(3)
 , fMaxNSigmaTOF(3)
-       
 , fTrigAna(0)
 , fESDpid(0)
 , fIsPidOwner(0)
 , fTimeZeroType(AliESDpid::kTOF_T0)
 , fTOFmatch(0)
+, fMinM2(2.)
+, fMaxM2(6.)
 
 {
 //
@@ -128,61 +119,52 @@ AliAnalysisTaskB2::AliAnalysisTaskB2(const char* name)
 : AliAnalysisTask(name,"")
 , fSpecies("Proton")
 , fPartCode(AliPID::kProton)
-       
 , fHeavyIons(0)
 , fSimulation(0)
-       
 , fMultTrigger(0)
 , fCentTrigger(0)
 , fTriggerFired(0)
 , fGoodVertex(0)
 , fPileUpEvent(0)
-       
 , fV0AND(0)
 , fNoFastOnly(0)
 , fMinKNOmult(-10)
 , fMaxKNOmult(100000)
 , fMinCentrality(-1)
 , fMaxCentrality(100)
-       
 , fNtrk(0)
 , fMeanNtrk(1)
 , fKNOmult(1)
 , fMinVx(-1)
 , fMaxVx(1)
 , fMinVy(-1)
 , fMaxVy(1)
 , fMinVz(-10)
 , fMaxVz(10)
-       
 , fMinDCAxy(-1)
 , fMaxDCAxy(1)
 , fMinDCAz(-2)
 , fMaxDCAz(2)
 , fMaxNSigma(3)
-       
 , fMinEta(-0.8)
 , fMaxEta(0.8)
 , fMinY(-0.5)
 , fMaxY(0.5)
-       
 , fMCevent(0)
 , fESDevent(0)
-       
 , fHistoMap(0)
 , fESDtrackCuts(0)
 , fLnID(0)
-
 , fMaxNSigmaITS(3)
 , fMaxNSigmaTPC(3)
 , fMaxNSigmaTOF(3)
-       
 , fTrigAna(0)
 , fESDpid(0)
 , fIsPidOwner(0)
 , fTimeZeroType(AliESDpid::kTOF_T0)
 , fTOFmatch(0)
+, fMinM2(2.)
+, fMaxM2(6.)
 
 {
 //
@@ -727,22 +709,18 @@ Int_t AliAnalysisTaskB2::GetTracks()
                                                                ((TH2D*)fHistoMap->Get(simparticle + "_Sim_Prim_M2_P"))->Fill(pTOF, m2);
                                                                ((TH2D*)fHistoMap->Get(simparticle + "_Sim_Prim_M2_Pt"))->Fill(pt, m2);
                                                        }
+                                               }
+                                               else if(this->IsFromWeakDecay(iParticle))
+                                               {
+                                                       ((TH1D*)fHistoMap->Get(simparticle + "_Sim_Fdwn_Pt"))->Fill(simPt);
                                                        
+                                                       ((TH2D*)fHistoMap->Get(simparticle + "_Sim_Fdwn_DCAxy_Pt"))->Fill(simPt,dcaxy);
                                                }
-                                               else
+                                               else // if(this->IsFromMaterial(iParticle)
                                                {
-                                                       if(this->IsFromWeakDecay(iParticle))
-                                                       {
-                                                               ((TH1D*)fHistoMap->Get(simparticle + "_Sim_Fdwn_Pt"))->Fill(simPt);
-                                                               
-                                                               ((TH2D*)fHistoMap->Get(simparticle + "_Sim_Fdwn_DCAxy_Pt"))->Fill(simPt,dcaxy);
-                                                       }
-                                                       else // if(this->IsFromMaterial(iParticle)
-                                                       {
-                                                               ((TH1D*)fHistoMap->Get(simparticle + "_Sim_Mat_Pt"))->Fill(simPt);
-                                                               
-                                                               ((TH2D*)fHistoMap->Get(simparticle + "_Sim_Mat_DCAxy_Pt"))->Fill(simPt,dcaxy);
-                                                       }
+                                                       ((TH1D*)fHistoMap->Get(simparticle + "_Sim_Mat_Pt"))->Fill(simPt);
+                                                       
+                                                       ((TH2D*)fHistoMap->Get(simparticle + "_Sim_Mat_DCAxy_Pt"))->Fill(simPt,dcaxy);
                                                }
                                        }
                                        else // fake tracks
@@ -756,7 +734,7 @@ Int_t AliAnalysisTaskB2::GetTracks()
                                                {
                                                        ((TH1D*)fHistoMap->Get(simparticle + "_Sim_Fake_Fdwn_Pt"))->Fill(simPt);
                                                }
-                                               else if(this->IsFromMaterial(iParticle))
+                                               else
                                                {
                                                        ((TH1D*)fHistoMap->Get(simparticle + "_Sim_Fake_Mat_Pt"))->Fill(simPt);
                                                }
@@ -836,16 +814,15 @@ Int_t AliAnalysisTaskB2::GetTracks()
                }
                
                // secondaries
-               if(fTOFmatch && fLnID->GetPidProcedure() > AliLnID::kMaxLikelihood)
+               
+               Bool_t m2match = kTRUE;
+               
+               if( fTOFmatch && (fLnID->GetPidProcedure() > AliLnID::kMaxLikelihood))
                {
-                       if(fLnID->GetM2match(fPartCode, pTOF, m2, 3))
-                       {
-                               ((TH2D*)fHistoMap->Get(particle + "_PID_DCAxy_Pt"))->Fill(pt, dcaxy);
-                               ((TH2D*)fHistoMap->Get(particle + "_PID_DCAz_Pt"))->Fill(pt, dcaz);
-                               ((TH2D*)fHistoMap->Get(particle + "_PID_NSigma_Pt"))->Fill(pt, nSigmaVtx);
-                       }
+                       if((m2 < fMinM2) || (m2 >= fMaxM2)) m2match = kFALSE;
                }
-               else
+               
+               if(m2match)
                {
                        ((TH2D*)fHistoMap->Get(particle + "_PID_DCAxy_Pt"))->Fill(pt, dcaxy);
                        ((TH2D*)fHistoMap->Get(particle + "_PID_DCAz_Pt"))->Fill(pt, dcaz);
@@ -867,20 +844,23 @@ Int_t AliAnalysisTaskB2::GetTracks()
                                if(this->IsPhysicalPrimary(iParticle))
                                {
                                        ((TH1D*)fHistoMap->Get(particle + "_Sim_PID_Prim_Pt"))->Fill(simPt);
-                                       
-                                       ((TH2D*)fHistoMap->Get(particle + "_Sim_PID_Prim_DCAxy_Pt"))->Fill(pt, dcaxy);
-                                       ((TH2D*)fHistoMap->Get(particle + "_Sim_PID_Prim_DCAz_Pt"))->Fill(pt, dcaz);
-                                       ((TH2D*)fHistoMap->Get(particle + "_Sim_PID_Prim_NSigma_Pt"))->Fill(pt, nSigmaVtx);
                                }
-                               else
+                               
+                               if(m2match)
                                {
-                                       if(this->IsFromWeakDecay(iParticle))
+                                       if(this->IsPhysicalPrimary(iParticle))
+                                       {
+                                               ((TH2D*)fHistoMap->Get(particle + "_Sim_PID_Prim_DCAxy_Pt"))->Fill(pt, dcaxy);
+                                               ((TH2D*)fHistoMap->Get(particle + "_Sim_PID_Prim_DCAz_Pt"))->Fill(pt, dcaz);
+                                               ((TH2D*)fHistoMap->Get(particle + "_Sim_PID_Prim_NSigma_Pt"))->Fill(pt, nSigmaVtx);
+                                       }
+                                       else if(this->IsFromWeakDecay(iParticle))
                                        {
                                                ((TH2D*)fHistoMap->Get(particle + "_Sim_PID_Fdwn_DCAxy_Pt"))->Fill(pt, dcaxy);
                                                ((TH2D*)fHistoMap->Get(particle + "_Sim_PID_Fdwn_DCAz_Pt"))->Fill(pt, dcaz);
                                                ((TH2D*)fHistoMap->Get(particle + "_Sim_PID_Fdwn_NSigma_Pt"))->Fill(pt, nSigmaVtx);
                                        }
-                                       else
+                                       else // from materials
                                        {
                                                ((TH2D*)fHistoMap->Get(particle + "_Sim_PID_Mat_DCAxy_Pt"))->Fill(pt, dcaxy);
                                                ((TH2D*)fHistoMap->Get(particle + "_Sim_PID_Mat_DCAz_Pt"))->Fill(pt, dcaz);
@@ -892,17 +872,20 @@ Int_t AliAnalysisTaskB2::GetTracks()
                        {
                                ((TH1D*)fHistoMap->Get(particle + "_Sim_PID_Fake_Pt"))->Fill(simPt);
                                
-                               if(this->IsPhysicalPrimary(iParticle))
-                               {
-                                       ((TH2D*)fHistoMap->Get(particle + "_Sim_PID_Fake_Prim_DCAxy_Pt"))->Fill(pt, dcaxy);
-                               }
-                               else if(this->IsFromWeakDecay(iParticle))
-                               {
-                                       ((TH2D*)fHistoMap->Get(particle + "_Sim_PID_Fake_Fdwn_DCAxy_Pt"))->Fill(pt, dcaxy);
-                               }
-                               else
+                               if(m2match)
                                {
-                                       ((TH2D*)fHistoMap->Get(particle + "_Sim_PID_Fake_Mat_DCAxy_Pt"))->Fill(pt, dcaxy);
+                                       if(this->IsPhysicalPrimary(iParticle))
+                                       {
+                                               ((TH2D*)fHistoMap->Get(particle + "_Sim_PID_Fake_Prim_DCAxy_Pt"))->Fill(pt, dcaxy);
+                                       }
+                                       else if(this->IsFromWeakDecay(iParticle))
+                                       {
+                                               ((TH2D*)fHistoMap->Get(particle + "_Sim_PID_Fake_Fdwn_DCAxy_Pt"))->Fill(pt, dcaxy);
+                                       }
+                                       else // from materials
+                                       {
+                                               ((TH2D*)fHistoMap->Get(particle + "_Sim_PID_Fake_Mat_DCAxy_Pt"))->Fill(pt, dcaxy);
+                                       }
                                }
                        }
                }
index ca2e85c..23170f1 100644 (file)
@@ -65,6 +65,8 @@ class AliAnalysisTaskB2: public AliAnalysisTask
        void SetTOFmatch(Bool_t flag = kTRUE) { fTOFmatch = flag; }
        Bool_t AcceptTOFtrack(const AliESDtrack* trk) const;
        
+       void SetM2Interval(Double_t min, Double_t max) { fMinM2 = min; fMaxM2 = max; };
+       
        void SetParticleSpecies(const TString& species);
        
     private:
@@ -169,6 +171,9 @@ class AliAnalysisTaskB2: public AliAnalysisTask
        
        Bool_t fTOFmatch; // TOF match flag
        
+       Double_t fMinM2; // minimum m2 for TPC+TOF pid
+       Double_t fMaxM2; // maximum m2 for TPC+TOF pid
+       
        ClassDef(AliAnalysisTaskB2, 1)
 };
 
index efc543e..34b1a4c 100644 (file)
@@ -49,7 +49,7 @@ AliLnDriver::AliLnDriver()
 , fMakeSpectra(1)
 , fMakeStats(1)
 , fLowPtBin(3)
-, fHighPtBin(15)
+, fHiPtBin(15)
 , fLowM2Bin(9)
 , fHighM2Bin(17)
 , fUnfolding(0)
@@ -83,7 +83,8 @@ AliLnDriver::AliLnDriver()
 , fOutputSpectra()
 , fOutputPtCorrDebug()
 , fOutputPtDebug()
-, fFitFrac(1)
+, fFitFrac(0)
+, fFdwnCorr(1)
 , fSameFdwn(0)
 , fVtxCorr(0)
 , fVtxCorrVal(1)
@@ -206,7 +207,7 @@ void AliLnDriver::MakePtCorr() const
                
                AliLnCorr lncorr(kParticle[i], fInputData, fInputSimu, fInputSimuFix, outputfile1, fOutputCorTag);
                
-               lncorr.GetLnSecondaries()->SetCorBins(fLowPtBin, fHighPtBin);
+               lncorr.GetLnSecondaries()->SetCorBins(fLowPtBin, fHiPtBin);
                lncorr.GetLnSecondaries()->SetProcedure(fSecProd);
                lncorr.GetLnSecondaries()->SetMatDCAxyModel(fMatDCAxyMod);
                lncorr.GetLnSecondaries()->SetAntiNucleusAsTemplate(fANucTemplate);
@@ -255,7 +256,7 @@ void AliLnDriver::MakePt() const
                lnpt.SetOnlyGeneration(fIsOnlyGen);
                lnpt.SetRapidityInterval(fYMin, fYMax);
                
-               lnpt.SetPtBinInterval(fLowPtBin, fHighPtBin);
+               lnpt.SetPtBinInterval(fLowPtBin, fHiPtBin);
                lnpt.SetM2BinInterval(fLowM2Bin, fHighM2Bin);
                lnpt.SetM2BkgInterval(fMinM2Bkg, fMaxM2Bkg);
                lnpt.SetM2TPCInterval(fMinM2tpc, fMaxM2tpc);
@@ -267,6 +268,7 @@ void AliLnDriver::MakePt() const
                lnpt.SetMakeStats(fMakeStats);
                lnpt.SetVertexCorrection(fVtxCorr, fVtxCorrVal);
                lnpt.SetFitFractionCorr(fFitFrac);
+               lnpt.SetFeedDownCorr(fFdwnCorr);
                lnpt.SetSameFeedDownCorr(fSameFdwn);
                
                lnpt.Exec();
index 0065c8b..2de659e 100644 (file)
@@ -58,7 +58,7 @@ class AliLnDriver: public TObject
        
        void SetRapidityInterval(Double_t ymin, Double_t ymax) { fYMin = ymin; fYMax = ymax; }
        
-       void SetPtBinInterval(Int_t lowbin, Int_t hibin) { fLowPtBin = lowbin; fHighPtBin = hibin; }
+       void SetPtBinInterval(Int_t lowbin, Int_t hibin) { fLowPtBin = lowbin; fHiPtBin = hibin; }
        void SetM2BinInterval(Int_t lowbin, Int_t hibin) { fLowM2Bin = lowbin; fHighM2Bin = hibin; }
        void SetM2BkgInterval(Double_t min, Double_t max) { fMinM2Bkg = min; fMaxM2Bkg = max; }
        void SetM2TPCInterval(Double_t min, Double_t max) { fMinM2tpc = min; fMaxM2tpc = max; }
@@ -76,6 +76,7 @@ class AliLnDriver: public TObject
        
        void SetVertexCorrection(Bool_t flag=1, Double_t val=1) { fVtxCorr = flag; fVtxCorrVal=val; }
        void SetFitFractionCorr(Bool_t flag=1) { fFitFrac=flag; }
+       void SetFeedDownCorr(Bool_t flag=1) { fFdwnCorr=flag; }
        void SetSameFeedDownCorr(Bool_t flag=1) { fSameFdwn = flag; }
        
        void SetSysErr( Double_t pos, Double_t neg) { fSysPos = pos; fSysNeg = neg; }
@@ -89,7 +90,7 @@ class AliLnDriver: public TObject
  
        TString fSpecies;       // particle species
        TString fOutputTag;     // tag for output file
-       TString fOutputCorTag;        // tag for correction file
+       TString fOutputCorTag;  // tag for correction file
        
        Double_t fTrigEff[3];   // trigger efficiency, stat. and syst. errors
        Double_t fXsec[3];      // total inelastic cross section, stat. and syst. errors
@@ -103,7 +104,7 @@ class AliLnDriver: public TObject
        Bool_t  fMakeStats;     // make event stats
        
        Int_t    fLowPtBin;     // low pt bin
-       Int_t    fHighPtBin;    // high pt bin
+       Int_t    fHiPtBin;      // high pt bin
        Bool_t   fPidM2;        // enable m2 pid correction
        Int_t    fLowM2Bin;     // low m2 bin for pid contamination
        Int_t    fHighM2Bin;    // high m2 bin for pid contamination
@@ -144,6 +145,7 @@ class AliLnDriver: public TObject
        TString fOutputPtDebug;     // output filename for debugging pt
        
        Bool_t fFitFrac;        // fit for fraction of secondaries
+       Bool_t fFdwnCorr;       // enable feed-down correction
        Bool_t fSameFdwn;       // same feed-down correction for positives and negatives
        Bool_t fVtxCorr;        // enable vertex correction from simulation
        Double_t fVtxCorrVal;   // vertex correction value
index d71b936..d5620f7 100644 (file)
@@ -514,17 +514,6 @@ Double_t AliLnID::GetBetaExpectedSigma(Double_t p, Double_t m) const
        return kappa*Beta(p,m);
 }
 
-Double_t AliLnID::GetM2ExpectedSigma(Double_t p, Double_t m2) const
-{
-//
-// Expected deuteron M2 width for the given momentum
-//
-       Double_t c0 = 6.76363e-03;
-       Double_t c1 = 7.04984e-02;
-       
-       return c0/(p*p) + c1*(p*p/m2 + 1.);
-}
-
 Bool_t AliLnID::GetITSmatch(Int_t pid, Double_t pITS, Double_t dEdxITS, Int_t nPointsITS, Double_t nSigma) const
 {
 //
@@ -579,23 +568,6 @@ Bool_t AliLnID::GetTOFmatch(Int_t pid, Double_t pTOF, Double_t beta, Double_t nS
        return kFALSE;
 }
 
-Bool_t AliLnID::GetM2match(Int_t pid, Double_t pTOF, Double_t m2, Double_t nSigma) const
-{
-//
-// Check if the signal is less than nSigma from the expected m2
-//
-       Double_t p = (pid > AliPID::kTriton) ? 2.*pTOF : pTOF; // correct by Z
-       Double_t expM2 = AliPID::ParticleMass(pid); expM2 *= expM2;
-       Double_t sigma = this->GetM2ExpectedSigma(p, expM2);
-       
-       if(TMath::Abs(m2-expM2) < nSigma*sigma)
-       {
-               return kTRUE;
-       }
-       
-       return kFALSE;
-}
-
 Bool_t AliLnID::IsITSTPCmismatch(Double_t pITS, Double_t dEdxITS, Int_t nPointsITS, Double_t pTPC, Double_t dEdxTPC, Int_t nPointsTPC, Double_t nSigma) const
 {
 //
index 2a075ec..a72d817 100644 (file)
@@ -38,12 +38,10 @@ class AliLnID: public TObject
        Bool_t GetTOFlikelihood(Double_t p, Double_t beta, Double_t* r) const;
        
        Double_t GetBetaExpectedSigma(Double_t p, Double_t mass) const;
-       Double_t GetM2ExpectedSigma(Double_t p, Double_t mass) const;
        
        Bool_t GetITSmatch(Int_t pid, Double_t p, Double_t dEdx, Int_t nPoints, Double_t nSigma=3.) const;
        Bool_t GetTPCmatch(Int_t pid, Double_t pTPC, Double_t dEdx, Double_t nPoints, Double_t nSigma=3.) const;
        Bool_t GetTOFmatch(Int_t pid, Double_t pTOF, Double_t beta, Double_t nSigma=3.) const;
-       Bool_t GetM2match(Int_t pid, Double_t pTOF, Double_t m2, Double_t nSigma=3.) const;
        
        Int_t GetPidProcedure() const { return fPidProcedure; }
        
index 592ba6d..07aa811 100644 (file)
@@ -67,11 +67,12 @@ AliLnPt::AliLnPt(const TString& particle, Double_t trigEff, const TString& input
 , fMinM2Bkg(2.2)
 , fMaxM2Bkg(5.)
 , fMinM2tpc(2.)
-, fMaxM2tpc(6.5)
+, fMaxM2tpc(6.)
 , fMakeStats(1)
 , fVtxCorr(0)
 , fVtxFactor(1)
 , fFitFrac(1)
+, fFdwnCorr(1)
 , fSameFdwn(0)
 {
 //
@@ -172,43 +173,43 @@ Int_t AliLnPt::Exec()
                        hPidPt = (TH1D*)hOrigPt->Clone(Form("%s_M2Corr_Pt", fParticle.Data()));
                }
                
-               TH1D* hFakeCorPt = 0;
-               if(fFakeTracks)
-               {
-                       hFakeCorPt = this->FakeTracks(hPidPt, hFracFakePt, fParticle + "_FakeCor_Pt");
-               }
-               else
-               {
-                       hFakeCorPt = (TH1D*)hPidPt->Clone(Form("%s_FakeCor_Pt", fParticle.Data()));
-               }
-               
                TH1D* hSecCorPt = 0;
                if(fSecondaries)
                {
                        if(fFitFrac)
                        {
-                               hSecCorPt = this->Secondaries(hFakeCorPt, fncFracMatPt, fncFracFdwnPt, fParticle + "_SecCor_Pt");
+                               hSecCorPt = this->Secondaries(hPidPt, fncFracMatPt, fncFracFdwnPt, fParticle + "_SecCor_Pt");
                        }
                        else
                        {
-                               hSecCorPt = this->Secondaries(hFakeCorPt, hFracMatPt, hFracFdwnPt, fParticle + "_SecCor_Pt");
+                               hSecCorPt = this->Secondaries(hPidPt, hFracMatPt, hFracFdwnPt, fParticle + "_SecCor_Pt");
                        }
                }
                else
                {
-                       hSecCorPt = (TH1D*)hFakeCorPt->Clone(Form("%s_SecCor_Pt", fParticle.Data()));
+                       hSecCorPt = (TH1D*)hPidPt->Clone(Form("%s_SecCor_Pt", fParticle.Data()));
+               }
+               
+               TH1D* hFakeCorPt = 0;
+               if(fFakeTracks)
+               {
+                       hFakeCorPt = this->FakeTracks(hSecCorPt, hFracFakePt, fParticle + "_FakeCor_Pt");
+               }
+               else
+               {
+                       hFakeCorPt = (TH1D*)hSecCorPt->Clone(Form("%s_FakeCor_Pt", fParticle.Data()));
                }
                
                TH1D* hUnfoldedPt = 0;
 #ifdef HAVE_ROOUNFOLD
                if(fUnfolding)
                {
-                       hUnfoldedPt = this->Unfolding(hSecCorPt, hMeasuredPt, hTruePt, hResponseMtx, fParticle + "_Unfolded_Pt", fNIter);
+                       hUnfoldedPt = this->Unfolding(hFakeCorPt, hMeasuredPt, hTruePt, hResponseMtx, fParticle + "_Unfolded_Pt", fNIter);
                }
                else
 #endif
                {
-                       hUnfoldedPt = (TH1D*)hSecCorPt->Clone(Form("%s_Unfolded_Pt", fParticle.Data()));
+                       hUnfoldedPt = (TH1D*)hFakeCorPt->Clone(Form("%s_Unfolded_Pt", fParticle.Data()));
                }
                
                TH1D* hEffCorPt = 0;
@@ -429,7 +430,7 @@ TH1D* AliLnPt::PID(const TH1D* hPt, const TH2D* hM2Pt, Int_t lowbin, Int_t hibin
        // first bins are not contaminated since the identification is clear
        // integrate around the m2 value
        
-       this->GetPtFromM2(hPidPt, 3, lowbin, hM2Pt, fMinM2tpc, fMaxM2tpc);
+       this->GetPtFromM2(hPidPt, 0, lowbin, hM2Pt, fMinM2tpc, fMaxM2tpc);
        
        // the remaining bins are contaminated
        // slice the m2-pt and fit each slice with a gaussian + exponentials bkg
@@ -510,8 +511,8 @@ TH1D* AliLnPt::Secondaries(const TH1D* hPt, const TH1D* hFracMatPt, const TH1D*
 //
        TF1* one = new TF1("one","1",0,10);
        
-       TH1D* xfactor = (TH1D*)hFracFdwnPt->Clone(Form("%s_fdwn_fmat_1_",fParticle.Data()));
-       xfactor->Add(hFracMatPt);
+       TH1D* xfactor = (TH1D*)hFracMatPt->Clone(Form("%s_1_fmat_fdwn_",fParticle.Data()));
+       if(fFdwnCorr) xfactor->Add(hFracFdwnPt);
        xfactor->Add(one);
        
        TH1D* hSecCorPt = (TH1D*)hPt->Clone(name.Data());
@@ -532,13 +533,13 @@ TH1D* AliLnPt::Secondaries(const TH1D* hPt, TF1* fncMatPt, TF1* fncFdwnPt, const
 //
        TF1* fnc = new TF1("_secondaries_","1 + [0]*exp(-[1]*x)+[2] + [3]*exp(-[4]*x)+[5]", 0, 10);
        
-       Double_t param[6];
+       Double_t param[6] = {0};
        fncMatPt->GetParameters(param);
-       fncFdwnPt->GetParameters(&param[3]);
+       if(fFdwnCorr) fncFdwnPt->GetParameters(&param[3]);
        
-       Double_t err[6];
+       Double_t err[6] = {0};
        for(Int_t i=0; i<3; ++i) err[i] = fncMatPt->GetParError(i);
-       for(Int_t i=3; i<6; ++i) err[i] = fncFdwnPt->GetParError(i);
+       if(fFdwnCorr) for(Int_t i=3; i<6; ++i) err[i] = fncFdwnPt->GetParError(i);
        
        fnc->SetParameters(param);
        fnc->SetParErrors(err);
index 299620e..a459d05 100644 (file)
@@ -63,6 +63,7 @@ class AliLnPt: public TObject
        
        void SetVertexCorrection(Bool_t flag=1, Double_t factor=1) { fVtxCorr=flag; fVtxFactor=factor; }
        void SetFitFractionCorr(Bool_t flag=1) { fFitFrac=flag; }
+       void SetFeedDownCorr(Bool_t flag=1) { fFdwnCorr=flag; }
        void SetSameFeedDownCorr(Bool_t flag=1) { fSameFdwn=flag; }
        
   private:
@@ -118,6 +119,7 @@ class AliLnPt: public TObject
        Double_t fVtxFactor; // correction factor between simulation and data
        
        Bool_t fFitFrac; // fit for fraction of secondaries
+       Bool_t fFdwnCorr; // enable feed-down correction
        Bool_t fSameFdwn; // same feed-down correction for positives and negatives
        
        ClassDef(AliLnPt,1)
index 6ada515..3c10ff8 100644 (file)
@@ -31,6 +31,7 @@
 #include <RooHistPdf.h>
 #include <RooWorkspace.h>
 #include <RooMsgService.h>
+#include <TBackCompFitter.h>
 
 #include "AliLnSecondaries.h"
 #include "B2.h"
@@ -44,8 +45,8 @@ AliLnSecondaries::AliLnSecondaries(const TString& particle, const TString& dataF
 , fSimuFilename(simuFilename)
 , fOutputFilename(outputFilename)
 , fOutputTag(otag)
-, fLowBin(3)
-, fHiBin(15)
+, fLowPtBin(3)
+, fHiPtBin(15)
 , fNbin(1)
 , fMinDCAxy(-1.5)
 , fMaxDCAxy(1.5)
@@ -263,6 +264,8 @@ Int_t AliLnSecondaries::Exec()
        delete fsimu;
        delete fdata;
        
+       delete dynamic_cast<TBackCompFitter*>(TVirtualFitter::GetFitter());
+       
        return 0;
 }
 
@@ -286,7 +289,7 @@ void AliLnSecondaries::GetFraction(TH1D* hPrimPt, TH1D* hSecPt, const TH2D* hDCA
 //
        TString nosec = (sec == "Fdwn") ? "Mat" : "Fdwn";
        
-       for(Int_t i=fLowBin; i<fHiBin; ++i)
+       for(Int_t i=fLowPtBin; i<fHiPtBin; ++i)
        {
                TH1D* hDCAxy      = hDCAxyPt->ProjectionY(Form("%s_Data_DCAxy_%02d",fParticle.Data(),i),i,i);
                TH1D* hMCDCAxy    = hMCDCAxyPt->ProjectionY(Form("%s_SimData_DCAxy_%02d",fParticle.Data(),i),i,i);
@@ -345,7 +348,7 @@ void AliLnSecondaries::GetFraction(TH1D* hFracPt[3], const TH2D* hDCAxyPt, const
 // slice the DCA distribution and get the fractions for each pt bin
 // (3 contributions)
 //
-       for(Int_t i=fLowBin; i<fHiBin; ++i)
+       for(Int_t i=fLowPtBin; i<fHiPtBin; ++i)
        {
                // slices
                TH1D* hDCAxy     = hDCAxyPt->ProjectionY(Form("%s_Data_DCAxy_%02d",fParticle.Data(),i),i,i);
@@ -458,7 +461,7 @@ Int_t AliLnSecondaries::GetTFFfractions(Double_t* frac, Double_t* err, TH1D* hDa
        return status;
 }
 
-void AliLnSecondaries::WriteTFFdebug(TH1D* hData, TFractionFitter* fit, Int_t status, Int_t ibin, const char* contrib[], Double_t* frac, Int_t kmax) const
+void AliLnSecondaries::WriteTFFdebug(const TH1D* hData, TFractionFitter* fit, Int_t status, Int_t ibin, const char* contrib[], Double_t* frac, Int_t kmax) const
 {
 //
 // Write TFractionFitter debug histograms
index 4779cb5..3b4ac2c 100644 (file)
@@ -34,7 +34,7 @@ class AliLnSecondaries: public TObject
        
        void SetOutputTag(const TString& tag) { fOutputTag = tag; }
        
-       void SetCorBins(Int_t lowbin, Int_t hibin) { fLowBin = lowbin; fHiBin = hibin; }
+       void SetCorBins(Int_t lowbin, Int_t hibin) { fLowPtBin = lowbin; fHiPtBin = hibin; }
        void SetDCAxyInterval(Double_t lowdca, Double_t hidca) { fMinDCAxy = lowdca; fMaxDCAxy = hidca; }
        
        void SetNBin(Int_t nbin) { fNbin = nbin; }
@@ -68,7 +68,7 @@ class AliLnSecondaries: public TObject
        TF1* GetFdwnFraction(const TString& name) const;
        
        TH1D* ZeroClone(const TH1D* h, const TString& name) const;
-       void WriteTFFdebug(TH1D* hData, TFractionFitter* fit, Int_t status, Int_t ibin, const char* contrib[], Double_t* frac, Int_t kmax) const;
+       void WriteTFFdebug(const TH1D* hData, TFractionFitter* fit, Int_t status, Int_t ibin, const char* contrib[], Double_t* frac, Int_t kmax) const;
        
   private:
   
@@ -79,8 +79,8 @@ class AliLnSecondaries: public TObject
        TString fOutputFilename; // output filename
        TString fOutputTag; // tag for the ouput
        
-       Int_t fLowBin; // low pt bin for the corrections
-       Int_t fHiBin ; // high pt bin for the corrections
+       Int_t fLowPtBin; // low pt bin for the corrections
+       Int_t fHiPtBin ; // high pt bin for the corrections
        
        Int_t fNbin; // for rebinning DCA distributions
        
index 42a9477..459fc84 100644 (file)
@@ -190,6 +190,7 @@ TString GetSimuFixPeriod(const TString& period)
        if(period=="lhc10c")      return "lhc12a5bc";
        if(period=="lhc10d")      return "lhc12a5bd";
        if(period=="lhc10e")      return "lhc12a5be";
+       if(period=="lhc10cde")    return "lhc12a5bcde";
        if(period=="lhc10bcde")   return "lhc12a5bbcde";
        if(period=="lhc11a_wsdd") return "lhc12a5c_wsdd";
        
index 789f758..42f3e80 100644 (file)
@@ -48,7 +48,7 @@ void DrawDir(const TString& inputFile,
 // draw histograms/graphs with same name located in different directories
 // if option = 0 no comparison,
 // if option = 1 draw a bottom pad with the comparison, and
-// if option = 2 draw the comparasion in a different canvas
+// if option = 2 draw the comparison in a different canvas
 //
        const Int_t kMax = 10; // maximum number of subdirectories
        
index 65d9532..9ebd08a 100644 (file)
@@ -133,8 +133,8 @@ void DrawPt(const TString& inputFile="debug.root", const TString& tag="test", co
        // remaining corrections
        
        const Int_t kNum = 6;
-       const TString kCorr[kNum] = { "EffCor", "Unfolded", "SecCor", "FakeCor", "M2Corr", "PID"};
-       const TString kLabel[kNum] = { "Efficiency", "Unfolding", "Secondaries", "Fake tracks", "PID contamination", "Raw"};
+       const TString kCorr[kNum] = { "EffCor", "Unfolded", "FakeCor", "SecCor", "M2Corr", "PID"};
+       const TString kLabel[kNum] = { "Efficiency", "Unfolding", "Fake tracks", "Secondaries", "PID contamination", "Raw"};
        const Int_t kColor[kNum]  = {kGreen-3, kGreen-2, kRed, kBlue, kOrange+1, kAzure};
        const Int_t kMarker[kNum] = {kFullSquare, kFullCircle, kFullTriangleDown, kOpenCircle, kFullTriangleUp, kOpenSquare};