From 7ec4d8431be2b02fd574647404626a1385086386 Mon Sep 17 00:00:00 2001 From: cholm Date: Thu, 27 Jan 2011 15:12:54 +0000 Subject: [PATCH] Moved reading corrections into base class AliForwardMultiplicityBase. Fixes to AliFMDMCDensityCalculator - didn't call parent Init. Provide options for enabling/disabling corrections --- PWG2/FORWARD/analysis2/AddTaskFMD.C | 6 ++ PWG2/FORWARD/analysis2/AliFMDCorrector.cxx | 90 ++++++++++++++----- PWG2/FORWARD/analysis2/AliFMDCorrector.h | 63 +++++++++++-- PWG2/FORWARD/analysis2/AliFMDMCCorrector.cxx | 38 ++++---- .../analysis2/AliFMDMCDensityCalculator.cxx | 1 + .../analysis2/AliForwardMCCorrectionsTask.cxx | 14 +-- .../AliForwardMCMultiplicityTask.cxx | 50 ++--------- .../analysis2/AliForwardMultiplicityBase.cxx | 77 +++++++++++++++- .../analysis2/AliForwardMultiplicityBase.h | 14 +++ .../analysis2/AliForwardMultiplicityTask.cxx | 54 ++--------- 10 files changed, 260 insertions(+), 147 deletions(-) diff --git a/PWG2/FORWARD/analysis2/AddTaskFMD.C b/PWG2/FORWARD/analysis2/AddTaskFMD.C index 06cc038778c..6713fc84d5b 100644 --- a/PWG2/FORWARD/analysis2/AddTaskFMD.C +++ b/PWG2/FORWARD/analysis2/AddTaskFMD.C @@ -69,6 +69,12 @@ AddTaskFMD(Bool_t mc) task->GetDensityCalculator().SetMaxParticles(2); // Set the lower multiplicity cut. Overrides setting in energy loss fits. task->GetDensityCalculator().SetMultCut(0.3); + // Whether to use the secondary map correction + task->GetCorrections().SetUseSecondaryMap(true); + // Whether to use the vertex bias correction + task->GetCorrections().SetUseVertexBias(true); + // Whether to use the vertex bias correction + task->GetCorrections().SetUseAcceptance(true); // Whether to use the merging efficiency correction task->GetCorrections().SetUseMergingEfficiency(false); // Set the number of extra bins (beyond the secondary map border) diff --git a/PWG2/FORWARD/analysis2/AliFMDCorrector.cxx b/PWG2/FORWARD/analysis2/AliFMDCorrector.cxx index eeedace5a30..830f20cb03c 100644 --- a/PWG2/FORWARD/analysis2/AliFMDCorrector.cxx +++ b/PWG2/FORWARD/analysis2/AliFMDCorrector.cxx @@ -23,6 +23,9 @@ ClassImp(AliFMDCorrector) AliFMDCorrector::AliFMDCorrector() : TNamed(), fRingHistos(), + fUseSecondaryMap(true), + fUseVertexBias(true), + fUseAcceptance(true), fUseMergingEfficiency(true), fDebug(0) { @@ -33,6 +36,9 @@ AliFMDCorrector::AliFMDCorrector() AliFMDCorrector::AliFMDCorrector(const char* title) : TNamed("fmdCorrector", title), fRingHistos(), + fUseSecondaryMap(true), + fUseVertexBias(true), + fUseAcceptance(true), fUseMergingEfficiency(true), fDebug(0) { @@ -52,6 +58,9 @@ AliFMDCorrector::AliFMDCorrector(const char* title) AliFMDCorrector::AliFMDCorrector(const AliFMDCorrector& o) : TNamed(o), fRingHistos(), + fUseSecondaryMap(o.fUseSecondaryMap), + fUseVertexBias(o.fUseVertexBias), + fUseAcceptance(o.fUseAcceptance), fUseMergingEfficiency(o.fUseMergingEfficiency), fDebug(o.fDebug) { @@ -85,6 +94,9 @@ AliFMDCorrector::operator=(const AliFMDCorrector& o) fDebug = o.fDebug; fRingHistos.Delete(); + fUseSecondaryMap = o.fUseSecondaryMap; + fUseVertexBias = o.fUseVertexBias; + fUseAcceptance = o.fUseAcceptance; fUseMergingEfficiency = o.fUseMergingEfficiency; TIter next(&o.fRingHistos); TObject* obj = 0; @@ -93,6 +105,24 @@ AliFMDCorrector::operator=(const AliFMDCorrector& o) return *this; } +//____________________________________________________________________ +void +AliFMDCorrector::Init(const TAxis&) +{ + // + // Initialize this object + // + // Parameters: + // etaAxis Eta axis to use + // + if (!fUseSecondaryMap) + AliWarning("Secondary maps not used - BE CAREFUL"); + if (!fUseVertexBias) + AliWarning("Vertex bias not used"); + if (!fUseAcceptance) + AliWarning("Acceptance from dead-channels not used"); +} + //____________________________________________________________________ AliFMDCorrector::RingHistos* AliFMDCorrector::GetRingHistos(UShort_t d, Char_t r) const @@ -120,7 +150,7 @@ AliFMDCorrector::GetRingHistos(UShort_t d, Char_t r) const //____________________________________________________________________ Bool_t AliFMDCorrector::Correct(AliForwardUtil::Histos& hists, - UShort_t vtxbin) + UShort_t vtxbin) { // // Do the calculations @@ -140,33 +170,41 @@ AliFMDCorrector::Correct(AliForwardUtil::Histos& hists, Char_t r = (q == 0 ? 'I' : 'O'); TH2D* h = hists.Get(d,r); RingHistos* rh = GetRingHistos(d,r); - TH2D* bg = fcm.GetSecondaryMap()->GetCorrection(d, r, uvb); - TH2D* ef = fcm.GetVertexBias()->GetCorrection(r, uvb); - TH2D* ac = fcm.GetAcceptance()->GetCorrection(d, r, uvb); - if (!bg) { - AliWarning(Form("No secondary correction for FMDM%d%c in vertex bin %d", - d, r, uvb)); - continue; + + if (fUseSecondaryMap) { + TH2D* bg = fcm.GetSecondaryMap()->GetCorrection(d, r, uvb); + if (!bg) { + AliWarning(Form("No secondary correction for FMDM%d%c in vertex bin %d", + d, r, uvb)); + continue; + } + // Divide by primary/total ratio + h->Divide(bg); } - if (!ef) { - AliWarning(Form("No event %s vertex bias correction in vertex bin %d", - (r == 'I' || r == 'i' ? "inner" : "outer"), uvb)); - continue; + if (fUseVertexBias) { + TH2D* ef = fcm.GetVertexBias()->GetCorrection(r, uvb); + if (!ef) { + AliWarning(Form("No event %s vertex bias correction in vertex bin %d", + (r == 'I' || r == 'i' ? "inner" : "outer"), uvb)); + continue; + } + // Divide by the event selection efficiency + h->Divide(ef); } - if (!ac) { - AliWarning(Form("No acceptance correction for FMD%d%c in vertex bin %d", + if (fUseAcceptance) { + TH2D* ac = fcm.GetAcceptance()->GetCorrection(d, r, uvb); + if (!ac) { + AliWarning(Form("No acceptance correction for FMD%d%c in vertex bin %d", d, r, uvb)); - continue; + continue; + } + // Divide by the acceptance correction + h->Divide(ac); } - // Divide by primary/total ratio - h->Divide(bg); - - // Divide by the event selection efficiency - h->Divide(ef); - // Divide by the acceptance correction - h->Divide(ac); + + if (fUseMergingEfficiency) { if (!fcm.GetMergingEfficiency()) { @@ -250,7 +288,13 @@ AliFMDCorrector::Print(Option_t* /* option */) const char ind[gROOT->GetDirLevel()+1]; for (Int_t i = 0; i < gROOT->GetDirLevel(); i++) ind[i] = ' '; ind[gROOT->GetDirLevel()] = '\0'; - std::cout << ind << "AliFMDCorrector: " << GetName() << std::endl; + std::cout << ind << "AliFMDCorrector: " << GetName() << "\n" + << std::boolalpha + << ind << " Use secondary maps: " << fUseSecondaryMap << "\n" + << ind << " Use vertex bias: " << fUseVertexBias << "\n" + << ind << " Use acceptance: " << fUseAcceptance << "\n" + << ind << " Use merging efficiency: " << fUseMergingEfficiency + << std::endl; } //==================================================================== diff --git a/PWG2/FORWARD/analysis2/AliFMDCorrector.h b/PWG2/FORWARD/analysis2/AliFMDCorrector.h index c5671892c32..9df074d37ac 100644 --- a/PWG2/FORWARD/analysis2/AliFMDCorrector.h +++ b/PWG2/FORWARD/analysis2/AliFMDCorrector.h @@ -64,6 +64,12 @@ public: */ AliFMDCorrector& operator=(const AliFMDCorrector&); /** + * Initialize this object + * + * @param etaAxis Eta axis to use -- not used + */ + virtual void Init(const TAxis& etaAxis); + /** * Do the calculations * * @param hists Cache of histograms @@ -92,18 +98,60 @@ public: */ void SetDebug(Int_t dbg=1) { fDebug = dbg; } /** + * @{ + * @name Enable/disable parts of the corrections + */ + /** + * Whether to do correction for secondaries + * + * @param use If true, use the secondary correction + */ + void SetUseSecondaryMap(Bool_t use=true) { fUseSecondaryMap = use; } + /** + * Check + * + * @return true if the correction for secondaries is done + */ + Bool_t IsUseSecondaryMap() const { return fUseSecondaryMap; } + /** + * Whether to do correction for vertex bias + * + * @param use If true, use the vertex bias correction + */ + void SetUseVertexBias(Bool_t use=true) { fUseVertexBias = use; } + /** + * Check + * + * @return true if the correction for vertex bias is done + */ + Bool_t IsUseVertexBias() const { return fUseVertexBias; } + /** + * Whether to do correction for dead-channel acceptance + * + * @param use If true, use the dead-channel acceptance correction + */ + void SetUseAcceptance(Bool_t use=true) { fUseAcceptance = use; } + /** + * Check + * + * @return true if the correction for dead-channel acceptance is done + */ + Bool_t IsUseAcceptance() const { return fUseAcceptance; } + /** * Whether to use the merging efficiency correction - * + * * @param use If true, use the merging efficiency correction */ void SetUseMergingEfficiency(Bool_t use=true) { fUseMergingEfficiency = use; } - /** - * Check - * + /** + * Check + * * @return true if the merging efficiency correction is used. */ Bool_t IsUseMergingEfficiency() const { return fUseMergingEfficiency; } - /** + /* @} */ + + /** * Print information * * @param option Not used @@ -171,10 +219,13 @@ protected: RingHistos* GetRingHistos(UShort_t d, Char_t r) const; TList fRingHistos; // List of histogram containers + Bool_t fUseSecondaryMap; // Whether to do correction for secondaries + Bool_t fUseVertexBias; // Whether to do correction for vertex bias + Bool_t fUseAcceptance; // Whether to do correction for dead ch's. Bool_t fUseMergingEfficiency; // Whether to use the merging efficiency Int_t fDebug; // Debug level - ClassDef(AliFMDCorrector,2); // Calculate Nch density + ClassDef(AliFMDCorrector,2); // Correct the inclusive d2N/detadphi }; #endif diff --git a/PWG2/FORWARD/analysis2/AliFMDMCCorrector.cxx b/PWG2/FORWARD/analysis2/AliFMDMCCorrector.cxx index 68ee64af9b3..c59b2b17469 100644 --- a/PWG2/FORWARD/analysis2/AliFMDMCCorrector.cxx +++ b/PWG2/FORWARD/analysis2/AliFMDMCCorrector.cxx @@ -25,8 +25,6 @@ #include #include #include -#include -#include ClassImp(AliFMDMCCorrector) #if 0 @@ -89,24 +87,28 @@ AliFMDMCCorrector::CorrectMC(AliForwardUtil::Histos& hists, for (UShort_t q=0; qGetCorrection(d,r,uvb); - TH2D* ef = fcm.GetVertexBias()->GetCorrection(r, uvb); - if (!bg) { - AliWarning(Form("No secondary correction for FMDM%d%c in vertex bin %d", - d, r, uvb)); - continue; + + + if (fUseSecondaryMap) { + TH2D* bg = fcm.GetSecondaryMap()->GetCorrection(d,r,uvb); + if (!bg) { + AliWarning(Form("No secondary correction for FMDM%d%c in vertex bin %d", + d, r, uvb)); + continue; + } + // Divide by primary/total ratio + h->Divide(bg); } - if (!ef) { - AliWarning(Form("No event vertex bias correction in vertex bin %d", + if (fUseVertexBias) { + TH2D* ef = fcm.GetVertexBias()->GetCorrection(r, uvb); + if (!ef) { + AliWarning(Form("No event vertex bias correction in vertex bin %d", uvb)); - continue; + continue; + } + // Divide by the event selection efficiency + h->Divide(ef); } - - // Divide by primary/total ratio - h->Divide(bg); - - // Divide by the event selection efficiency - h->Divide(ef); } } @@ -123,6 +125,8 @@ AliFMDMCCorrector::Init(const TAxis& eAxis) // Parameters: // etaAxis Eta axis to use // + AliFMDCorrector::Init(eAxis); + fFMD1i = Make(1,'I',eAxis); fFMD2i = Make(2,'I',eAxis); fFMD2o = Make(2,'O',eAxis); diff --git a/PWG2/FORWARD/analysis2/AliFMDMCDensityCalculator.cxx b/PWG2/FORWARD/analysis2/AliFMDMCDensityCalculator.cxx index 775d4d43ddd..d338b629077 100644 --- a/PWG2/FORWARD/analysis2/AliFMDMCDensityCalculator.cxx +++ b/PWG2/FORWARD/analysis2/AliFMDMCDensityCalculator.cxx @@ -74,6 +74,7 @@ AliFMDMCDensityCalculator::Init(const TAxis& eAxis) // Parameters: // etaAxis Eta axis to use // + AliFMDDensityCalculator::Init(eAxis); fFMD1i = Make(1,'I',eAxis); fFMD2i = Make(2,'I',eAxis); fFMD2o = Make(2,'O',eAxis); diff --git a/PWG2/FORWARD/analysis2/AliForwardMCCorrectionsTask.cxx b/PWG2/FORWARD/analysis2/AliForwardMCCorrectionsTask.cxx index d973b5b5667..6bce92382cd 100644 --- a/PWG2/FORWARD/analysis2/AliForwardMCCorrectionsTask.cxx +++ b/PWG2/FORWARD/analysis2/AliForwardMCCorrectionsTask.cxx @@ -491,11 +491,11 @@ AliForwardMCCorrectionsTask::UserExec(Option_t*) return; } - UInt_t triggers; - Bool_t gotTrigggers; - Bool_t gotInel; - Double_t vZ; - Bool_t gotVertex; + // UInt_t triggers; + // Bool_t gotTrigggers = false; + Bool_t gotInel = false; + // Double_t vZ; + Bool_t gotVertex = false; #if 0 // Use event inspector instead // Get the triggers @@ -788,8 +788,8 @@ AliForwardMCCorrectionsTask::Terminate(Option_t*) // Get event counts Int_t nEventsAll = eventsAll->GetBinContent(v); Int_t nEventsTr = eventsTr->GetBinContent(v); - Int_t nEventsVtx = eventsVtx->GetBinContent(v); - Int_t nEventsTrVtx = eventsTrVtx->GetBinContent(v); + // Int_t nEventsVtx = eventsVtx->GetBinContent(v); + // Int_t nEventsTrVtx = eventsTrVtx->GetBinContent(v); // Project event histograms, set names, and store TH2D* primIAllV = GetVertexProj(v, primIAll); diff --git a/PWG2/FORWARD/analysis2/AliForwardMCMultiplicityTask.cxx b/PWG2/FORWARD/analysis2/AliForwardMCMultiplicityTask.cxx index 75e07db241e..cff88b5dab9 100644 --- a/PWG2/FORWARD/analysis2/AliForwardMCMultiplicityTask.cxx +++ b/PWG2/FORWARD/analysis2/AliForwardMCMultiplicityTask.cxx @@ -27,8 +27,6 @@ #include #include #include -#include -#include //==================================================================== AliForwardMCMultiplicityTask::AliForwardMCMultiplicityTask() @@ -167,24 +165,10 @@ AliForwardMCMultiplicityTask::InitializeSubs() // Initialise the sub objects and stuff. Called on first event // // - UInt_t what = AliForwardCorrectionManager::kAll; - if (!fEnableLowFlux) - what ^= AliForwardCorrectionManager::kDoubleHit; - if (!fCorrections.IsUseMergingEfficiency()) - what ^= AliForwardCorrectionManager::kMergingEfficiency; - - AliForwardCorrectionManager& fcm = AliForwardCorrectionManager::Instance(); - fcm.Init(fEventInspector.GetCollisionSystem(), - fEventInspector.GetEnergy(), - fEventInspector.GetField(), - true, - what); - if (!CheckCorrections(what)) return; - - const TAxis* pe = fcm.GetEtaAxis(); - const TAxis* pv = fcm.GetVertexAxis(); - if (!pe) AliFatal("No eta axis defined"); - if (!pv) AliFatal("No vertex axis defined"); + const TAxis* pe = 0; + const TAxis* pv = 0; + + if (!ReadCorrections(pe,pv)) return; fHistos.Init(*pe); fAODFMD.Init(*pe); @@ -258,32 +242,8 @@ AliForwardMCMultiplicityTask::UserExec(Option_t*) // // Get the input data - AliESDEvent* esd = dynamic_cast(InputEvent()); - if (!esd) { - AliWarning("No ESD event found for input event"); - return; - } + AliESDEvent* esd = GetESDEvent(); - // On the first event, initialize the parameters - if (fFirstEvent && esd->GetESDRun()) { - fEventInspector.ReadRunDetails(esd); - - AliInfo(Form("Initializing with parameters from the ESD:\n" - " AliESDEvent::GetBeamEnergy() ->%f\n" - " AliESDEvent::GetBeamType() ->%s\n" - " AliESDEvent::GetCurrentL3() ->%f\n" - " AliESDEvent::GetMagneticField()->%f\n" - " AliESDEvent::GetRunNumber() ->%d\n", - esd->GetBeamEnergy(), - esd->GetBeamType(), - esd->GetCurrentL3(), - esd->GetMagneticField(), - esd->GetRunNumber())); - - fFirstEvent = false; - - InitializeSubs(); - } // Clear stuff fHistos.Clear(); fESDFMD.Clear(); diff --git a/PWG2/FORWARD/analysis2/AliForwardMultiplicityBase.cxx b/PWG2/FORWARD/analysis2/AliForwardMultiplicityBase.cxx index 2f0b8f15231..d1933db50f4 100644 --- a/PWG2/FORWARD/analysis2/AliForwardMultiplicityBase.cxx +++ b/PWG2/FORWARD/analysis2/AliForwardMultiplicityBase.cxx @@ -24,9 +24,9 @@ #include "AliFMDDensityCalculator.h" #include "AliFMDCorrector.h" #include "AliFMDHistCollector.h" +#include "AliESDEvent.h" #include -#include -#include + //==================================================================== Bool_t @@ -88,7 +88,80 @@ AliForwardMultiplicityBase::CheckCorrections(UInt_t what) const } return true; } +//____________________________________________________________________ +Bool_t +AliForwardMultiplicityBase::ReadCorrections(const TAxis*& pe, const TAxis*& pv) +{ + UInt_t what = AliForwardCorrectionManager::kAll; + if (!fEnableLowFlux) + what ^= AliForwardCorrectionManager::kDoubleHit; + if (!GetCorrections().IsUseSecondaryMap()) { + what ^= AliForwardCorrectionManager::kSecondaryMap; + // Need to make eta and vertex axis here since we don't read + // that from the secondary correction objects + pe = new TAxis(200, -4, 6); + pv = new TAxis(10, -10, 10); + } + if (!GetCorrections().IsUseVertexBias()) + what ^= AliForwardCorrectionManager::kVertexBias; + if (!GetCorrections().IsUseAcceptance()) + what ^= AliForwardCorrectionManager::kAcceptance; + if (!GetCorrections().IsUseMergingEfficiency()) + what ^= AliForwardCorrectionManager::kMergingEfficiency; + + AliForwardCorrectionManager& fcm = AliForwardCorrectionManager::Instance(); + if (!fcm.Init(GetEventInspector().GetCollisionSystem(), + GetEventInspector().GetEnergy(), + GetEventInspector().GetField(), + false, + what)) return false; + if (!CheckCorrections(what)) return false; + + // Get the eta axis from the secondary maps - if read in + if (!pe) { + pe = fcm.GetEtaAxis(); + if (!pe) AliFatal("No eta axis defined"); + } + // Get the vertex axis from the secondary maps - if read in + if (!pv) { + pv = fcm.GetVertexAxis(); + if (!pv) AliFatal("No vertex axis defined"); + } + + return true; +} +//____________________________________________________________________ +AliESDEvent* +AliForwardMultiplicityBase::GetESDEvent() +{ + AliESDEvent* esd = dynamic_cast(InputEvent()); + if (!esd) { + AliWarning("No ESD event found for input event"); + return 0; + } + // On the first event, initialize the parameters + if (fFirstEvent && esd->GetESDRun()) { + GetEventInspector().ReadRunDetails(esd); + + AliInfo(Form("Initializing with parameters from the ESD:\n" + " AliESDEvent::GetBeamEnergy() ->%f\n" + " AliESDEvent::GetBeamType() ->%s\n" + " AliESDEvent::GetCurrentL3() ->%f\n" + " AliESDEvent::GetMagneticField()->%f\n" + " AliESDEvent::GetRunNumber() ->%d\n", + esd->GetBeamEnergy(), + esd->GetBeamType(), + esd->GetCurrentL3(), + esd->GetMagneticField(), + esd->GetRunNumber())); + + fFirstEvent = false; + + InitializeSubs(); + } + return esd; +} //____________________________________________________________________ void AliForwardMultiplicityBase::MarkEventForStore() const diff --git a/PWG2/FORWARD/analysis2/AliForwardMultiplicityBase.h b/PWG2/FORWARD/analysis2/AliForwardMultiplicityBase.h index babb194aa72..42856abc145 100644 --- a/PWG2/FORWARD/analysis2/AliForwardMultiplicityBase.h +++ b/PWG2/FORWARD/analysis2/AliForwardMultiplicityBase.h @@ -227,7 +227,21 @@ protected: * @return true if all present, false otherwise */ Bool_t CheckCorrections(UInt_t what) const; + /** + * Read corrections + * + */ + virtual Bool_t ReadCorrections(const TAxis*& pe, const TAxis*& pv); + /** + * Get the ESD event. IF this is the first event, initialise + */ + virtual AliESDEvent* GetESDEvent(); /** + * Initialise the sub objects and stuff. Called on first event + * + */ + virtual void InitializeSubs() = 0; + /** * Mark this event as one to store in the AOD * */ diff --git a/PWG2/FORWARD/analysis2/AliForwardMultiplicityTask.cxx b/PWG2/FORWARD/analysis2/AliForwardMultiplicityTask.cxx index 19072101ed0..eab2195cea5 100644 --- a/PWG2/FORWARD/analysis2/AliForwardMultiplicityTask.cxx +++ b/PWG2/FORWARD/analysis2/AliForwardMultiplicityTask.cxx @@ -25,8 +25,7 @@ #include #include #include -#include -#include + //==================================================================== AliForwardMultiplicityTask::AliForwardMultiplicityTask() @@ -151,25 +150,10 @@ AliForwardMultiplicityTask::InitializeSubs() // Initialise the sub objects and stuff. Called on first event // // - UInt_t what = AliForwardCorrectionManager::kAll; - if (!fEnableLowFlux) - what ^= AliForwardCorrectionManager::kDoubleHit; - if (!fCorrections.IsUseMergingEfficiency()) - what ^= AliForwardCorrectionManager::kMergingEfficiency; - - AliForwardCorrectionManager& fcm = AliForwardCorrectionManager::Instance(); - fcm.Init(fEventInspector.GetCollisionSystem(), - fEventInspector.GetEnergy(), - fEventInspector.GetField(), - false, - what); - if (!CheckCorrections(what)) return; - - - const TAxis* pe = fcm.GetEtaAxis(); - const TAxis* pv = fcm.GetVertexAxis(); - if (!pe) AliFatal("No eta axis defined"); - if (!pv) AliFatal("No vertex axis defined"); + const TAxis* pe = 0; + const TAxis* pv = 0; + + if (!ReadCorrections(pe,pv)) return; fHistos.Init(*pe); fAODFMD.Init(*pe); @@ -182,6 +166,7 @@ AliForwardMultiplicityTask::InitializeSubs() fEnergyFitter.Init(*pe); fEventInspector.Init(*pv); fDensityCalculator.Init(*pe); + fCorrections.Init(*pe); fHistCollector.Init(*pv); this->Print(); @@ -228,33 +213,8 @@ AliForwardMultiplicityTask::UserExec(Option_t*) // static Int_t cnt = 0; // cnt++; // Get the input data - AliESDEvent* esd = dynamic_cast(InputEvent()); - // AliInfo(Form("Event # %6d (esd=%p)", cnt, esd)); - if (!esd) { - AliWarning("No ESD event found for input event"); - return; - } + AliESDEvent* esd = GetESDEvent(); - // On the first event, initialize the parameters - if (fFirstEvent && esd->GetESDRun()) { - fEventInspector.ReadRunDetails(esd); - - AliInfo(Form("Initializing with parameters from the ESD:\n" - " AliESDEvent::GetBeamEnergy() ->%f\n" - " AliESDEvent::GetBeamType() ->%s\n" - " AliESDEvent::GetCurrentL3() ->%f\n" - " AliESDEvent::GetMagneticField()->%f\n" - " AliESDEvent::GetRunNumber() ->%d\n", - esd->GetBeamEnergy(), - esd->GetBeamType(), - esd->GetCurrentL3(), - esd->GetMagneticField(), - esd->GetRunNumber())); - - fFirstEvent = false; - - InitializeSubs(); - } // Clear stuff fHistos.Clear(); fESDFMD.Clear(); -- 2.43.0