From c25b5e1b6aea9a48a294960f609f71621ee9d73f Mon Sep 17 00:00:00 2001 From: cholm Date: Fri, 25 Mar 2011 15:35:03 +0000 Subject: [PATCH] Code clean-up in dN/deta calculation. - First properly calculate d2N/detadphi - Then project. Removed Energy loss fitter from AOD tasks - it just takes up memory and is largely useless there. --- PWG2/FORWARD/analysis2/AddTaskCentraldNdeta.C | 4 + PWG2/FORWARD/analysis2/AddTaskForwarddNdeta.C | 4 + PWG2/FORWARD/analysis2/AliBasedNdetaTask.cxx | 195 +++++++++++------- PWG2/FORWARD/analysis2/AliBasedNdetaTask.h | 41 ++++ .../AliForwardMCMultiplicityTask.cxx | 15 -- .../analysis2/AliForwardMCMultiplicityTask.h | 14 -- .../analysis2/AliForwardMultiplicityBase.cxx | 2 - .../analysis2/AliForwardMultiplicityBase.h | 12 -- .../analysis2/AliForwardMultiplicityTask.cxx | 15 -- .../analysis2/AliForwardMultiplicityTask.h | 14 -- .../analysis2/AliForwarddNdetaTask.cxx | 11 +- PWG2/FORWARD/analysis2/AliForwarddNdetaTask.h | 2 + PWG2/FORWARD/analysis2/DrawdNdeta.C | 7 +- PWG2/FORWARD/analysis2/ForwardAODConfig.C | 26 --- PWG2/FORWARD/analysis2/TrainSetup.C | 3 +- 15 files changed, 188 insertions(+), 177 deletions(-) diff --git a/PWG2/FORWARD/analysis2/AddTaskCentraldNdeta.C b/PWG2/FORWARD/analysis2/AddTaskCentraldNdeta.C index ed74af2fcbc..e34704a6e22 100644 --- a/PWG2/FORWARD/analysis2/AddTaskCentraldNdeta.C +++ b/PWG2/FORWARD/analysis2/AddTaskCentraldNdeta.C @@ -42,6 +42,10 @@ AddTaskCentraldNdeta(const char* trig = "INEL", task->SetTriggerMask(trig); // Whether to cut edges when re-binning task->SetCutEdges(cutEdges); + // Whether to correct for empty bins when projecting + task->SetCorrEmpty(false); + // Whether to use TH2::ProjectionX + task->SetUseROOTProjectX(false); // Bit mask of // // kNone Normalise to accepted events diff --git a/PWG2/FORWARD/analysis2/AddTaskForwarddNdeta.C b/PWG2/FORWARD/analysis2/AddTaskForwarddNdeta.C index 4ac3119e297..2d0de44af5c 100644 --- a/PWG2/FORWARD/analysis2/AddTaskForwarddNdeta.C +++ b/PWG2/FORWARD/analysis2/AddTaskForwarddNdeta.C @@ -42,6 +42,10 @@ AddTaskForwarddNdeta(const char* trig = "INEL", task->SetTriggerMask(trig); // Whether to cut edges when re-binning task->SetCutEdges(cutEdges); + // Whether to correct for empty bins when projecting + task->SetCorrEmpty(true); + // Whether to use TH2::ProjectionX + task->SetUseROOTProjectX(false); // Bit mask of // // kNone Normalise to accepted events diff --git a/PWG2/FORWARD/analysis2/AliBasedNdetaTask.cxx b/PWG2/FORWARD/analysis2/AliBasedNdetaTask.cxx index c979a75a23b..a100dbe6042 100644 --- a/PWG2/FORWARD/analysis2/AliBasedNdetaTask.cxx +++ b/PWG2/FORWARD/analysis2/AliBasedNdetaTask.cxx @@ -26,6 +26,7 @@ AliBasedNdetaTask::AliBasedNdetaTask() fCutEdges(false), fSymmetrice(true), fCorrEmpty(true), + fUseROOTProj(false), fTriggerEff(1), fShapeCorr(0), fListOfCentralities(0), @@ -54,6 +55,7 @@ AliBasedNdetaTask::AliBasedNdetaTask(const char* name) fCutEdges(false), fSymmetrice(true), fCorrEmpty(true), + fUseROOTProj(false), fTriggerEff(1), fShapeCorr(0), fListOfCentralities(0), @@ -91,8 +93,9 @@ AliBasedNdetaTask::AliBasedNdetaTask(const AliBasedNdetaTask& o) fTriggerMask(o.fTriggerMask),// Int_t - Trigger mask fRebin(o.fRebin), // Int_t - Rebinning factor fCutEdges(o.fCutEdges), // Bool_t - Whether to cut edges when rebinning - fSymmetrice(true), - fCorrEmpty(true), + fSymmetrice(o.fSymmetrice), + fCorrEmpty(o.fCorrEmpty), + fUseROOTProj(o.fUseROOTProj), fTriggerEff(o.fTriggerEff), fShapeCorr(o.fShapeCorr), fListOfCentralities(o.fListOfCentralities), @@ -417,6 +420,7 @@ AliBasedNdetaTask::ProjectX(const TH2D* h, const char* name, Int_t firstbin, Int_t lastbin, + bool useRoot, bool corr, bool error) { @@ -434,9 +438,8 @@ AliBasedNdetaTask::ProjectX(const TH2D* h, // Newly created histogram or null // if (!h) return 0; -#if USE_ROOT_PROJECT - return h->ProjectionX(name, firstbin, lastbin, (error ? "e" : "")); -#endif + if (useRoot) + return h->ProjectionX(name, firstbin, lastbin, (error ? "e" : "")); TAxis* xaxis = h->GetXaxis(); TAxis* yaxis = h->GetYaxis(); @@ -486,6 +489,11 @@ AliBasedNdetaTask::ProjectX(const TH2D* h, } // for (ybin) if(content > 0 && nbins > 0) { Double_t factor = (corr ? Double_t(ybins) / nbins : 1); +#if 0 + AliWarningGeneral(ret->GetName(), + Form("factor @ %d is %d/%d -> %f", + xbin, ybins, nbins, factor)); +#endif if (error) { // Calculate weighted average ret->SetBinContent(xbin, content * factor); @@ -542,7 +550,7 @@ AliBasedNdetaTask::Terminate(Option_t *) CentralityBin* bin = 0; while ((bin = static_cast(next()))) bin->End(fSums, fOutput, fNormalizationScheme, fShapeCorr, fTriggerEff, - fSymmetrice, fRebin, fCorrEmpty, fCutEdges, + fSymmetrice, fRebin, fUseROOTProj, fCorrEmpty, fCutEdges, fTriggerMask, GetColor(), GetMarker()); // Output collision energy string @@ -570,6 +578,14 @@ AliBasedNdetaTask::Terminate(Option_t *) fOutput->Add(new TParameter("triggerEff", fTriggerEff)); if (fShapeCorr) fOutput->Add(fShapeCorr); + TNamed* options = new TNamed("options",""); + TString str; + str.Append(Form("Edges %scut, ", fCutEdges ? "" : "not ")); + str.Append(Form("Empty bins %scorrected for, ", fCorrEmpty ? "" : "not ")); + str.Append(Form("TH2::ProjectionX %sused", fUseROOTProj ? "" : "not ")); + options->SetTitle(str); + fOutput->Add(options); + PostData(2, fOutput); } //________________________________________________________________________ @@ -640,6 +656,7 @@ AliBasedNdetaTask::Print(Option_t*) const << " Rebin factor: " << fRebin << "\n" << " Cut edges: " << fCutEdges << "\n" << " Symmertrice: " << fSymmetrice << "\n" + << " Use TH2::ProjectionX: " << fUseROOTProj << "\n" << " Correct for empty: " << fCorrEmpty << "\n" << " Normalization scheme: " << (fSchemeString ? fSchemeString->GetTitle() : @@ -1037,14 +1054,27 @@ AliBasedNdetaTask::CentralityBin::Normalization(const TH1I& t, ntotal, scaler)); if (scheme & kBackground) { - AliInfo(Form("Correcting for background\n" - " beta = N_a + N_c + 2N_e = %d + %d - 2 * %d = %d", - Int_t(nA), Int_t(nC), Int_t(nE), Int_t(beta))); + // 1 E_V E_V + // s = --------- = ------------- = ------------ + // 1 - beta 1 - beta E_V 1 - beta N_V + // --- ---- -------- ---- --- + // E_V N_V N_V N_V N_T + // + // E_V + // = ------------ + // 1 - beta + // ---- + // N_T + // ntotal -= nAccepted * beta / nWithVertex; - scaler = 1. / (1. / vtxEff - beta / nWithVertex); - // scaler -= (beta > 0 ? nWithVertex / beta : 0); + // This one is direct and correct. + // scaler = 1. / (1. / vtxEff - beta / nWithVertex); + // A simpler expresion + scaler /= (1 - beta / nTriggered); // 0.831631 -> 0.780689 AliInfo(Form("Calculating event normalisation as\n" + " beta = N_a + N_c + 2 N_e = %d + %d - 2 * %d = %d\n" " N = N - N_A * beta / N_V = %f - %d * %d / %d = %f (%f)", + Int_t(nA), Int_t(nC), Int_t(nE), Int_t(beta), nAccepted / vtxEff, Int_t(nAccepted), Int_t(beta), Int_t(nWithVertex), ntotal, scaler)); } @@ -1078,6 +1108,80 @@ AliBasedNdetaTask::CentralityBin::Normalization(const TH1I& t, return scaler; } +//________________________________________________________________________ +void +AliBasedNdetaTask::CentralityBin::MakeResult(const TH2D* sum, + const char* postfix, + bool rootProj, + bool corrEmpty, + const TH1* shapeCorr, + Double_t scaler, + bool symmetrice, + Int_t rebin, + bool cutEdges, + Int_t color, + Int_t marker) +{ + // + // Generate the dN/deta result from input + // + // Parameters: + // sum Sum of 2D hists + // postfix Post fix on names + // rootProj Whether to use ROOT TH2::ProjectionX + // corrEmpty Correct for empty bins + // shapeCorr Shape correction to use + // scaler Event-level normalization scaler + // symmetrice Whether to make symmetric extensions + // rebin Whether to rebin + // cutEdges Whether to cut edges when rebinning + // + TH2D* copy = static_cast(sum->Clone(Form("d2Ndetadphi%s%s", + GetName(), postfix))); + TH1D* accNorm = ProjectX(sum, Form("norm%s%s",GetName(), postfix), 0, 0, + rootProj, corrEmpty, false); + accNorm->SetDirectory(0); + + // ---- Scale by shape correction ---------------------------------- + if (shapeCorr) copy->Divide(shapeCorr); + else AliInfo("No shape correction specified, or disabled"); + + // Normalize to the acceptance - + // dndeta->Divide(accNorm); + for (Int_t i = 1; i <= copy->GetNbinsX(); i++) { + for (Int_t j = 1; j <= copy->GetNbinsY(); j++) { + Double_t c = copy->GetBinContent(i, j); + Double_t e = copy->GetBinError(i, j); + Double_t a = accNorm->GetBinContent(i); + copy->SetBinContent(i, j, a <= 0 ? 0 : c / a); + copy->SetBinError(i, j, a <= 0 ? 0 : e / a); + } + } + // --- Event-level normalization ----------------------------------- + copy->Scale(scaler); + + // --- Project on X axis ------------------------------------------- + TH1D* dndeta = ProjectX(copy, Form("dndeta%s%s",GetName(), postfix), + 1, sum->GetNbinsY(), rootProj, corrEmpty); + dndeta->SetDirectory(0); + // Event-level normalization + dndeta->Scale(1., "width"); + copy->Scale(1., "width"); + + // --- Set some histogram attributes ------------------------------- + SetHistogramAttributes(dndeta, color, marker, Form("ALICE %s", GetName())); + SetHistogramAttributes(accNorm, color, marker, Form("ALICE %s normalisation", + GetName())); + + // --- Make symmetric extensions and rebinnings -------------------- + if (symmetrice) fOutput->Add(Symmetrice(dndeta)); + fOutput->Add(dndeta); + fOutput->Add(accNorm); + fOutput->Add(copy); + fOutput->Add(Rebin(dndeta, rebin, cutEdges)); + if (symmetrice) fOutput->Add(Symmetrice(Rebin(dndeta, rebin, cutEdges))); +} + //________________________________________________________________________ void AliBasedNdetaTask::CentralityBin::End(TList* sums, @@ -1087,6 +1191,7 @@ AliBasedNdetaTask::CentralityBin::End(TList* sums, Double_t trigEff, Bool_t symmetrice, Int_t rebin, + Bool_t rootProj, Bool_t corrEmpty, Bool_t cutEdges, Int_t triggerMask, @@ -1132,23 +1237,6 @@ AliBasedNdetaTask::CentralityBin::End(TList* sums, return; } - // --- Get acceptance normalisation from underflow bins ------------ - const char* name = GetName(); - TH1D* accNorm = ProjectX(fSum, Form("norm%s",name), 0, 0, corrEmpty, false); - accNorm->SetDirectory(0); - - // ---- Scale by shape correction ---------------------------------- - if ((scheme & kShape) && shapeCorr) fSum->Divide(shapeCorr); - else AliInfo("No shape correction specified, or disabled"); - - // --- Project on X axis ------------------------------------------- - TH1D* dndeta = ProjectX(fSum, Form("dndeta%s",name), 1, fSum->GetNbinsY(), - corrEmpty); - dndeta->SetDirectory(0); - - // Normalize to the acceptance - - dndeta->Divide(accNorm); - // --- Get normalization scaler ------------------------------------ Double_t ntotal = 0; Double_t epsilonT = trigEff; @@ -1163,54 +1251,17 @@ AliBasedNdetaTask::CentralityBin::End(TList* sums, AliError("Failed to calculate normalization - bailing out"); return; } - // Event-level normalization - dndeta->Scale(scaler, "width"); - - // --- Set some histogram attributes ------------------------------- - SetHistogramAttributes(dndeta, color, marker, Form("ALICE %s", name)); - SetHistogramAttributes(accNorm, color, marker, Form("ALICE %s normalisation", - name)); - - // --- Make symmetric extensions and rebinnings -------------------- fOutput->Add(fTriggers->Clone()); - if (symmetrice) fOutput->Add(Symmetrice(dndeta)); - fOutput->Add(dndeta); - fOutput->Add(accNorm); - fOutput->Add(Rebin(dndeta, rebin, cutEdges)); - if (symmetrice) fOutput->Add(Symmetrice(Rebin(dndeta, rebin, cutEdges))); + + // --- Make result and store --------------------------------------- + MakeResult(fSum, "", rootProj, corrEmpty, (scheme & kShape) ? shapeCorr : 0, + scaler, symmetrice, rebin, cutEdges, color, marker); // --- Process result from TrackRefs ------------------------------- if (fSumMC) { - // Project onto eta axis - _ignoring_underflow_bins_! - TH1D* dndetaMC = ProjectX(fSumMC,Form("dndeta%sMC", name),1, - fSum->GetNbinsY(), corrEmpty); - // Get acceptance normalisation from underflow bins - TH1D* accNormMC = ProjectX(fSumMC,Form("norm%sMC", name), 0, 0, - corrEmpty, false); - // Scale by shape correction - if ((scheme & kShape) && shapeCorr) fSum->Divide(shapeCorr); - - // Normalize to the acceptance - dndetaMC->Divide(accNormMC); - - // Scale by the vertex efficiency - dndetaMC->Scale(scaler, "width"); - - // Set hisotgram attributes - SetHistogramAttributes(dndetaMC, color+2, marker, - Form("ALICE %s (MC)",name)); - SetHistogramAttributes(accNormMC, color+2, marker, - Form("ALICE %s (MC) normalisation",name)); - - // Make symmetric extensions, rebinnings, and add to output - fOutput->Add(dndetaMC); - if (symmetrice) fOutput->Add(Symmetrice(dndetaMC)); - - fOutput->Add(accNormMC); - fOutput->Add(Rebin(dndetaMC, rebin, cutEdges)); - - if (symmetrice) - fOutput->Add(Symmetrice(Rebin(dndetaMC, rebin, cutEdges))); + MakeResult(fSumMC, "MC", rootProj, corrEmpty, + (scheme & kShape) ? shapeCorr : 0, + scaler, symmetrice, rebin, cutEdges, color+2, marker); } // Temporary stuff diff --git a/PWG2/FORWARD/analysis2/AliBasedNdetaTask.h b/PWG2/FORWARD/analysis2/AliBasedNdetaTask.h index 2123b1f3e06..68f4a8ad7b9 100644 --- a/PWG2/FORWARD/analysis2/AliBasedNdetaTask.h +++ b/PWG2/FORWARD/analysis2/AliBasedNdetaTask.h @@ -138,6 +138,19 @@ public: * @param cut If true, cut edges */ void SetCutEdges(Bool_t cut) {fCutEdges = cut;} + /** + * Set whether to correct for empty bins when projecting on the X axis. + * + * @param use Whether to correct for empty bins + */ + void SetCorrEmpty(Bool_t use) { fCorrEmpty = use; } + /** + * Set whether to use the ROOT TH2::ProjectionX method when + * projecting on the X axis. + * + * @param use Whether to use TH2::ProjectionX + */ + void SetUseROOTProjectX(Bool_t use) { fUseROOTProj = use; } /** * Trigger efficiency for selected trigger(s) * @@ -245,6 +258,7 @@ public: const char* name, Int_t firstbin, Int_t lastbin, + bool useROOT=false, bool corr=true, bool error=true); /** @@ -436,6 +450,30 @@ protected: UShort_t scheme, Double_t trgEff, Double_t& ntotal) const; + /** + * Generate the dN/deta result from input + * + * @param sum Sum of 2D hists + * @param postfix Post fix on names + * @param rootProj Whether to use ROOT TH2::ProjectionX + * @param corrEmpty Correct for empty bins + * @param shapeCorr Shape correction to use + * @param scaler Event-level normalization scaler + * @param symmetrice Whether to make symmetric extensions + * @param rebin Whether to rebin + * @param cutEdges Whether to cut edges when rebinning + */ + virtual void MakeResult(const TH2D* sum, + const char* postfix, + bool rootProj, + bool corrEmpty, + const TH1* shapeCorr, + Double_t scaler, + bool symmetrice, + Int_t rebin, + bool cutEdges, + Int_t color, + Int_t marker); /** * End of processing * @@ -446,6 +484,7 @@ protected: * @param trigEff Trigger efficiency * @param symmetrice Whether to symmetrice the results * @param rebin Whether to rebin the results + * @param rootProj If true, use TH2::ProjectionX * @param corrEmpty Whether to correct for empty bins * @param cutEdges Whether to cut edges when rebinning * @param triggerMask Trigger mask @@ -459,6 +498,7 @@ protected: Double_t trigEff, Bool_t symmetrice, Int_t rebin, + Bool_t rootProj, Bool_t corrEmpty, Bool_t cutEdges, Int_t triggerMask, @@ -538,6 +578,7 @@ protected: Bool_t fCutEdges; // Whether to cut edges when rebinning Bool_t fSymmetrice; // Whether to symmetrice data Bool_t fCorrEmpty; // Correct for empty bins + Bool_t fUseROOTProj; // Whether to use ROOT's ProjectionX Double_t fTriggerEff; // Trigger efficiency for selected trigger(s) TH1* fShapeCorr; // Shape correction TObjArray* fListOfCentralities; // Centrality bins diff --git a/PWG2/FORWARD/analysis2/AliForwardMCMultiplicityTask.cxx b/PWG2/FORWARD/analysis2/AliForwardMCMultiplicityTask.cxx index 95b220f49b3..4e29b526770 100644 --- a/PWG2/FORWARD/analysis2/AliForwardMCMultiplicityTask.cxx +++ b/PWG2/FORWARD/analysis2/AliForwardMCMultiplicityTask.cxx @@ -40,7 +40,6 @@ AliForwardMCMultiplicityTask::AliForwardMCMultiplicityTask() fMCAODFMD(), fPrimary(0), fEventInspector(), - fEnergyFitter(), fSharingFilter(), fDensityCalculator(), fCorrections(), @@ -64,7 +63,6 @@ AliForwardMCMultiplicityTask::AliForwardMCMultiplicityTask(const char* name) fMCAODFMD(kTRUE), fPrimary(0), fEventInspector("event"), - fEnergyFitter("energy"), fSharingFilter("sharing"), fDensityCalculator("density"), fCorrections("corrections"), @@ -92,7 +90,6 @@ AliForwardMCMultiplicityTask::AliForwardMCMultiplicityTask(const AliForwardMCMul fMCAODFMD(o.fMCAODFMD), fPrimary(o.fPrimary), fEventInspector(o.fEventInspector), - fEnergyFitter(o.fEnergyFitter), fSharingFilter(o.fSharingFilter), fDensityCalculator(o.fDensityCalculator), fCorrections(o.fCorrections), @@ -125,7 +122,6 @@ AliForwardMCMultiplicityTask::operator=(const AliForwardMCMultiplicityTask& o) fHData = o.fHData; fEventInspector = o.fEventInspector; - fEnergyFitter = o.fEnergyFitter; fSharingFilter = o.fSharingFilter; fDensityCalculator = o.fDensityCalculator; fCorrections = o.fCorrections; @@ -151,7 +147,6 @@ AliForwardMCMultiplicityTask::SetDebug(Int_t dbg) // dbg debug level // fEventInspector.SetDebug(dbg); - fEnergyFitter.SetDebug(dbg); fSharingFilter.SetDebug(dbg); fDensityCalculator.SetDebug(dbg); fCorrections.SetDebug(dbg); @@ -181,7 +176,6 @@ AliForwardMCMultiplicityTask::InitializeSubs() fList->Add(fHData); - fEnergyFitter.Init(*pe); fEventInspector.Init(*pv); fDensityCalculator.Init(*pe); fCorrections.Init(*pe); @@ -224,7 +218,6 @@ AliForwardMCMultiplicityTask::UserCreateOutputObjects() ah->AddBranch("TH2D", &fPrimary); fEventInspector.DefineOutput(fList); - fEnergyFitter.DefineOutput(fList); fSharingFilter.DefineOutput(fList); fDensityCalculator.DefineOutput(fList); fCorrections.DefineOutput(fList); @@ -331,13 +324,6 @@ AliForwardMCMultiplicityTask::UserExec(Option_t*) //MarkEventForStore(); fSharingFilter.CompareResults(fESDFMD, fMCESDFMD); - // Do the energy stuff - if (!fEnergyFitter.Accumulate(*esdFMD, cent, - triggers & AliAODForwardMult::kEmpty)){ - AliWarning("Energy fitter failed"); - return; - } - // Calculate the inclusive charged particle density if (!fDensityCalculator.Calculate(fESDFMD, fHistos, ivz, lowFlux)) { AliWarning("Density calculator failed!"); @@ -425,7 +411,6 @@ AliForwardMCMultiplicityTask::Terminate(Option_t*) list->Add(dNdeta); list->Add(norm); - fEnergyFitter.Fit(list); fSharingFilter.ScaleHistograms(list,Int_t(hEventsTr->Integral())); fDensityCalculator.ScaleHistograms(list,Int_t(hEventsTrVtx->Integral())); fCorrections.ScaleHistograms(list,Int_t(hEventsTrVtx->Integral())); diff --git a/PWG2/FORWARD/analysis2/AliForwardMCMultiplicityTask.h b/PWG2/FORWARD/analysis2/AliForwardMCMultiplicityTask.h index 8412b3c70e0..96c9cd910ca 100644 --- a/PWG2/FORWARD/analysis2/AliForwardMCMultiplicityTask.h +++ b/PWG2/FORWARD/analysis2/AliForwardMCMultiplicityTask.h @@ -16,7 +16,6 @@ #include "AliForwardMultiplicityBase.h" #include "AliForwardUtil.h" #include "AliFMDMCEventInspector.h" -#include "AliFMDEnergyFitter.h" #include "AliFMDMCSharingFilter.h" #include "AliFMDMCDensityCalculator.h" #include "AliFMDMCCorrector.h" @@ -110,12 +109,6 @@ public: * @return Reference to AliFMDEventInspector object */ AliFMDEventInspector& GetEventInspector() { return fEventInspector; } - /** - * Get reference to the EnergyFitter algorithm - * - * @return Reference to AliFMDEnergyFitter object - */ - AliFMDEnergyFitter& GetEnergyFitter() { return fEnergyFitter; } /** * Get reference to the SharingFilter algorithm * @@ -146,12 +139,6 @@ public: * @return Reference to AliFMDEventInspector object */ const AliFMDEventInspector& GetEventInspector() const { return fEventInspector; } - /** - * Get reference to the EnergyFitter algorithm - * - * @return Reference to AliFMDEnergyFitter object - */ - const AliFMDEnergyFitter& GetEnergyFitter() const { return fEnergyFitter; } /** * Get reference to the SharingFilter algorithm * @@ -202,7 +189,6 @@ protected: TH2D* fPrimary; // Per event primary particles AliFMDMCEventInspector fEventInspector; // Algorithm - AliFMDEnergyFitter fEnergyFitter; // Algorithm AliFMDMCSharingFilter fSharingFilter; // Algorithm AliFMDMCDensityCalculator fDensityCalculator; // Algorithm AliFMDMCCorrector fCorrections; // Algorithm diff --git a/PWG2/FORWARD/analysis2/AliForwardMultiplicityBase.cxx b/PWG2/FORWARD/analysis2/AliForwardMultiplicityBase.cxx index 7db23ec3b02..19fafc3520a 100644 --- a/PWG2/FORWARD/analysis2/AliForwardMultiplicityBase.cxx +++ b/PWG2/FORWARD/analysis2/AliForwardMultiplicityBase.cxx @@ -20,7 +20,6 @@ #include "AliInputEventHandler.h" #include "AliAnalysisManager.h" #include "AliFMDEventInspector.h" -#include "AliFMDEnergyFitter.h" #include "AliFMDSharingFilter.h" #include "AliFMDDensityCalculator.h" #include "AliFMDCorrector.h" @@ -231,7 +230,6 @@ AliForwardMultiplicityBase::Print(Option_t* option) const else std::cout << " Correction manager not set yet" << std::endl; GetEventInspector() .Print(option); - GetEnergyFitter() .Print(option); GetSharingFilter() .Print(option); GetDensityCalculator().Print(option); GetCorrections() .Print(option); diff --git a/PWG2/FORWARD/analysis2/AliForwardMultiplicityBase.h b/PWG2/FORWARD/analysis2/AliForwardMultiplicityBase.h index d4c9e504c40..270b1369e4e 100644 --- a/PWG2/FORWARD/analysis2/AliForwardMultiplicityBase.h +++ b/PWG2/FORWARD/analysis2/AliForwardMultiplicityBase.h @@ -180,12 +180,6 @@ public: * @return Reference to AliFMDEventInspector object */ virtual AliFMDEventInspector& GetEventInspector() = 0; - /** - * Get reference to the EnergyFitter algorithm - * - * @return Reference to AliFMDEnergyFitter object - */ - virtual AliFMDEnergyFitter& GetEnergyFitter() = 0; /** * Get reference to the SharingFilter algorithm * @@ -216,12 +210,6 @@ public: * @return Reference to AliFMDEventInspector object */ virtual const AliFMDEventInspector& GetEventInspector() const = 0; - /** - * Get reference to the EnergyFitter algorithm - * - * @return Reference to AliFMDEnergyFitter object - */ - virtual const AliFMDEnergyFitter& GetEnergyFitter() const = 0; /** * Get reference to the SharingFilter algorithm * diff --git a/PWG2/FORWARD/analysis2/AliForwardMultiplicityTask.cxx b/PWG2/FORWARD/analysis2/AliForwardMultiplicityTask.cxx index 77f424f177f..ca348400ace 100644 --- a/PWG2/FORWARD/analysis2/AliForwardMultiplicityTask.cxx +++ b/PWG2/FORWARD/analysis2/AliForwardMultiplicityTask.cxx @@ -35,7 +35,6 @@ AliForwardMultiplicityTask::AliForwardMultiplicityTask() fHistos(), fAODFMD(), fEventInspector(), - fEnergyFitter(), fSharingFilter(), fDensityCalculator(), fCorrections(), @@ -55,7 +54,6 @@ AliForwardMultiplicityTask::AliForwardMultiplicityTask(const char* name) fHistos(), fAODFMD(false), fEventInspector("event"), - fEnergyFitter("energy"), fSharingFilter("sharing"), fDensityCalculator("density"), fCorrections("corrections"), @@ -79,7 +77,6 @@ AliForwardMultiplicityTask::AliForwardMultiplicityTask(const AliForwardMultiplic fHistos(o.fHistos), fAODFMD(o.fAODFMD), fEventInspector(o.fEventInspector), - fEnergyFitter(o.fEnergyFitter), fSharingFilter(o.fSharingFilter), fDensityCalculator(o.fDensityCalculator), fCorrections(o.fCorrections), @@ -112,7 +109,6 @@ AliForwardMultiplicityTask::operator=(const AliForwardMultiplicityTask& o) fHData = o.fHData; fEventInspector = o.fEventInspector; - fEnergyFitter = o.fEnergyFitter; fSharingFilter = o.fSharingFilter; fDensityCalculator = o.fDensityCalculator; fCorrections = o.fCorrections; @@ -135,7 +131,6 @@ AliForwardMultiplicityTask::SetDebug(Int_t dbg) // dbg Debug level // fEventInspector.SetDebug(dbg); - fEnergyFitter.SetDebug(dbg); fSharingFilter.SetDebug(dbg); fDensityCalculator.SetDebug(dbg); fCorrections.SetDebug(dbg); @@ -163,7 +158,6 @@ AliForwardMultiplicityTask::InitializeSubs() fHData->SetDirectory(0); fList->Add(fHData); - fEnergyFitter.Init(*pe); fEventInspector.Init(*pv); fDensityCalculator.Init(*pe); fCorrections.Init(*pe); @@ -193,7 +187,6 @@ AliForwardMultiplicityTask::UserCreateOutputObjects() ah->AddBranch("AliAODForwardMult", &obj); fEventInspector.DefineOutput(fList); - fEnergyFitter.DefineOutput(fList); fSharingFilter.DefineOutput(fList); fDensityCalculator.DefineOutput(fList); fCorrections.DefineOutput(fList); @@ -261,13 +254,6 @@ AliForwardMultiplicityTask::UserExec(Option_t*) return; } - // Do the energy stuff - if (!fEnergyFitter.Accumulate(*esdFMD, cent, - triggers & AliAODForwardMult::kEmpty)){ - AliWarning("Energy fitter failed"); - return; - } - // Calculate the inclusive charged particle density //if (!fDensityCalculator.Calculate(fESDFMD, fHistos, ivz, lowFlux)) { if (!fDensityCalculator.Calculate(*esdFMD, fHistos, ivz, lowFlux)) { @@ -343,7 +329,6 @@ AliForwardMultiplicityTask::Terminate(Option_t*) list->Add(dNdeta); list->Add(norm); - fEnergyFitter.Fit(list); fSharingFilter.ScaleHistograms(list,Int_t(hEventsTr->Integral())); fDensityCalculator.ScaleHistograms(list,Int_t(hEventsTrVtx->Integral())); fCorrections.ScaleHistograms(list,Int_t(hEventsTrVtx->Integral())); diff --git a/PWG2/FORWARD/analysis2/AliForwardMultiplicityTask.h b/PWG2/FORWARD/analysis2/AliForwardMultiplicityTask.h index 63b4149415f..1d784b82c38 100644 --- a/PWG2/FORWARD/analysis2/AliForwardMultiplicityTask.h +++ b/PWG2/FORWARD/analysis2/AliForwardMultiplicityTask.h @@ -16,7 +16,6 @@ #include "AliForwardMultiplicityBase.h" #include "AliForwardUtil.h" #include "AliFMDEventInspector.h" -#include "AliFMDEnergyFitter.h" #include "AliFMDSharingFilter.h" #include "AliFMDDensityCalculator.h" #include "AliFMDCorrector.h" @@ -106,12 +105,6 @@ public: * @return Reference to AliFMDEventInspector object */ AliFMDEventInspector& GetEventInspector() { return fEventInspector; } - /** - * Get reference to the EnergyFitter algorithm - * - * @return Reference to AliFMDEnergyFitter object - */ - AliFMDEnergyFitter& GetEnergyFitter() { return fEnergyFitter; } /** * Get reference to the SharingFilter algorithm * @@ -142,12 +135,6 @@ public: * @return Reference to AliFMDEventInspector object */ const AliFMDEventInspector& GetEventInspector() const { return fEventInspector; } - /** - * Get reference to the EnergyFitter algorithm - * - * @return Reference to AliFMDEnergyFitter object - */ - const AliFMDEnergyFitter& GetEnergyFitter() const { return fEnergyFitter; } /** * Get reference to the SharingFilter algorithm * @@ -194,7 +181,6 @@ protected: AliAODForwardMult fAODFMD; // Output object AliFMDEventInspector fEventInspector; // Algorithm - AliFMDEnergyFitter fEnergyFitter; // Algorithm AliFMDSharingFilter fSharingFilter; // Algorithm AliFMDDensityCalculator fDensityCalculator; // Algorithm AliFMDCorrector fCorrections; // Algorithm diff --git a/PWG2/FORWARD/analysis2/AliForwarddNdetaTask.cxx b/PWG2/FORWARD/analysis2/AliForwarddNdetaTask.cxx index 45fcab723b0..a07aeb979ad 100644 --- a/PWG2/FORWARD/analysis2/AliForwarddNdetaTask.cxx +++ b/PWG2/FORWARD/analysis2/AliForwarddNdetaTask.cxx @@ -170,17 +170,20 @@ AliForwarddNdetaTask::CentralityBin::End(TList* sums, Double_t trigEff, Bool_t symmetrice, Int_t rebin, + Bool_t rootProj, Bool_t corrEmpty, - Bool_t cutEdges, + Bool_t cutEdges, Int_t triggerMask, Int_t color, Int_t marker) { + AliInfo(Form("In End of %s with corrEmpty=%d, cutEdges=%d, rootProj=%d", + GetName(), corrEmpty, cutEdges, rootProj)); AliBasedNdetaTask::CentralityBin::End(sums, results, scheme, shapeCorr, trigEff, - symmetrice, rebin, corrEmpty, cutEdges, - triggerMask, - color, marker); + symmetrice, rebin, + rootProj, corrEmpty, cutEdges, + triggerMask, color, marker); fSumPrimary = static_cast(fSums->FindObject("truth")); diff --git a/PWG2/FORWARD/analysis2/AliForwarddNdetaTask.h b/PWG2/FORWARD/analysis2/AliForwarddNdetaTask.h index 56318161aff..0859946f21d 100644 --- a/PWG2/FORWARD/analysis2/AliForwarddNdetaTask.h +++ b/PWG2/FORWARD/analysis2/AliForwarddNdetaTask.h @@ -144,6 +144,7 @@ protected: * @param trigEff Trigger efficiency * @param symmetrice Whether to symmetrice the results * @param rebin Whether to rebin the results + * @param rootProj If true, use TH2::ProjectionX * @param corrEmpty Whether to correct for empty bins * @param cutEdges Whether to cut edges when rebinning * @param triggerMask Trigger mask @@ -157,6 +158,7 @@ protected: Double_t trigEff, Bool_t symmetrice, Int_t rebin, + Bool_t rootProj, Bool_t corrEmpty, Bool_t cutEdges, Int_t triggerMask, diff --git a/PWG2/FORWARD/analysis2/DrawdNdeta.C b/PWG2/FORWARD/analysis2/DrawdNdeta.C index eded880e61a..c6afac18bff 100644 --- a/PWG2/FORWARD/analysis2/DrawdNdeta.C +++ b/PWG2/FORWARD/analysis2/DrawdNdeta.C @@ -327,6 +327,8 @@ struct dNdetaDrawer fVtxAxis = static_cast(results->FindObject("vtxAxis")); if (!fCentAxis) fCentAxis = static_cast(results->FindObject("centAxis")); + + TNamed* options = static_cast(results->FindObject("options")); if (!fTrigString) fTrigString = new TNamed("trigger", "unknown"); if (!fNormString) fNormString = new TNamed("scheme", "unknown"); if (!fSNNString) fSNNString = new TNamed("sNN", "unknown"); @@ -352,13 +354,14 @@ struct dNdetaDrawer " System: %-30s (%d)\n" " Vz range: %-30s (%f,%f)\n" " Normalization: %-30s (%d)\n" - " Centrality: %s", + " Centrality: %s\n" + " Options: %s", fTrigString->GetTitle(), fTrigString->GetUniqueID(), fSNNString->GetTitle(), fSNNString->GetUniqueID(), fSysString->GetTitle(), fSysString->GetUniqueID(), fVtxAxis->GetTitle(), fVtxAxis->GetXmin(), fVtxAxis->GetXmax(), fNormString->GetTitle(), fNormString->GetUniqueID(), - centTxt.Data()); + centTxt.Data(), (options ? options->GetTitle() : "none")); } //__________________________________________________________________ TMultiGraph* FetchOthers(UShort_t centLow, UShort_t centHigh) diff --git a/PWG2/FORWARD/analysis2/ForwardAODConfig.C b/PWG2/FORWARD/analysis2/ForwardAODConfig.C index ad3af975311..89528561dc1 100644 --- a/PWG2/FORWARD/analysis2/ForwardAODConfig.C +++ b/PWG2/FORWARD/analysis2/ForwardAODConfig.C @@ -34,32 +34,6 @@ ForwardAODConfig(AliForwardMultiplicityBase* task) task->GetEventInspector().SetLowFluxCut(1000); // Set the maximum error on v_z [cm] task->GetEventInspector().SetMaxVzErr(0.2); - - // --- Energy Loss Fitter ------------------------------------------ - // Set the eta axis to use - note, this overrides whatever is used - // by the rest of the algorithms - but only for the energy fitter - // algorithm. - task->GetEnergyFitter().SetEtaAxis(200, -4, 6); - // Set maximum energy loss to consider - task->GetEnergyFitter().SetMaxE(10); - // Set number of energy loss bins - task->GetEnergyFitter().SetNEbins(300); - // Set whether to use increasing bin sizes - task->GetEnergyFitter().SetUseIncreasingBins(true); - // Set whether to do fit the energy distributions - task->GetEnergyFitter().SetDoFits(kFALSE); - // Set whether to make the correction object - task->GetEnergyFitter().SetDoMakeObject(kFALSE); - // Set the low cut used for energy - task->GetEnergyFitter().SetLowCut(0.4); - // Set the number of bins to subtract from maximum of distributions - // to get the lower bound of the fit range - task->GetEnergyFitter().SetFitRangeBinWidth(4); - // Set the maximum number of landaus to try to fit (max 5) - task->GetEnergyFitter().SetNParticles(5); - // Set the minimum number of entries in the distribution before - // trying to fit to the data - task->GetEnergyFitter().SetMinEntries(1000); // --- Sharing filter ---------------------------------------------- // Set the low cut used for sharing - overrides settings in eloss fits diff --git a/PWG2/FORWARD/analysis2/TrainSetup.C b/PWG2/FORWARD/analysis2/TrainSetup.C index b5ba0102b86..97097072f80 100644 --- a/PWG2/FORWARD/analysis2/TrainSetup.C +++ b/PWG2/FORWARD/analysis2/TrainSetup.C @@ -1521,7 +1521,7 @@ protected: Bool_t mc = mgr->GetMCtruthEventHandler() != 0; // --- Add the task ---------------------------------------------- - gROOT->Macro(Form("AddTaskForwardMultEloss.C(%d)", mc)); + gROOT->Macro(Form("AddTaskFMDEloss.C(%d)", mc, fUseCent)); } /** * Crete output handler - we don't want one here. @@ -1529,6 +1529,7 @@ protected: * @return 0 */ AliVEventHandler* CreateOutputHandler(EType) { return 0; } + Bool_t fUseCent; }; //==================================================================== -- 2.43.0