From 5934a3e3d644c36aae1631f3f6d94de11f395c79 Mon Sep 17 00:00:00 2001 From: cholm Date: Tue, 6 Nov 2012 15:31:54 +0000 Subject: [PATCH] Renamed some member functions for more logical names Init -> SetupForData DefineOutput -> CreateOutputObjects Output -> CreateOutputObjects InitializeSubs -> SetupForData ScaleHistograms -> Terminate since these better reflect when they are executed. Output of AliForward{,MC}MultiplicityTask is split into two - one for sums and one for Terminate results. This is for Grid where the output containers are not opened read/write while parameter containers are. Added a script that partially automatize the dN/deta analysis on the Grid. A similar script for CAF (or Proof) should come soon. --- PWGLF/FORWARD/analysis2/AddTaskForwardMult.C | 13 +- .../analysis2/AliBaseMCTrackDensity.cxx | 2 +- .../FORWARD/analysis2/AliBaseMCTrackDensity.h | 4 +- PWGLF/FORWARD/analysis2/AliBasedNdetaTask.h | 4 +- .../analysis2/AliCentralMCCorrectionsTask.cxx | 14 +- .../analysis2/AliCentralMCCorrectionsTask.h | 8 +- .../AliCentralMCMultiplicityTask.cxx | 2 +- .../analysis2/AliCentralMCMultiplicityTask.h | 2 +- .../analysis2/AliCentralMultiplicityTask.cxx | 9 +- .../analysis2/AliCentralMultiplicityTask.h | 4 +- .../FORWARD/analysis2/AliCentraldNdetaTask.h | 2 +- PWGLF/FORWARD/analysis2/AliCopyHeaderTask.cxx | 5 +- PWGLF/FORWARD/analysis2/AliCopyHeaderTask.h | 4 +- .../analysis2/AliDisplacedVertexSelection.cxx | 2 +- .../analysis2/AliDisplacedVertexSelection.h | 4 +- PWGLF/FORWARD/analysis2/AliFMDCorrector.cxx | 29 +- PWGLF/FORWARD/analysis2/AliFMDCorrector.h | 14 +- .../analysis2/AliFMDDensityCalculator.cxx | 33 +- .../analysis2/AliFMDDensityCalculator.h | 16 +- .../FORWARD/analysis2/AliFMDEnergyFitter.cxx | 12 +- PWGLF/FORWARD/analysis2/AliFMDEnergyFitter.h | 12 +- .../analysis2/AliFMDEnergyFitterTask.cxx | 15 +- .../analysis2/AliFMDEnergyFitterTask.h | 4 +- .../analysis2/AliFMDEventInspector.cxx | 46 +- .../FORWARD/analysis2/AliFMDEventInspector.h | 50 +- .../analysis2/AliFMDEventPlaneFinder.cxx | 4 +- .../analysis2/AliFMDEventPlaneFinder.h | 6 +- .../analysis2/AliFMDEventPlaneTask.cxx | 4 +- .../FORWARD/analysis2/AliFMDEventPlaneTask.h | 2 +- .../FORWARD/analysis2/AliFMDHistCollector.cxx | 4 +- PWGLF/FORWARD/analysis2/AliFMDHistCollector.h | 6 +- PWGLF/FORWARD/analysis2/AliFMDMCCorrector.cxx | 8 +- PWGLF/FORWARD/analysis2/AliFMDMCCorrector.h | 6 +- .../analysis2/AliFMDMCDensityCalculator.cxx | 8 +- .../analysis2/AliFMDMCDensityCalculator.h | 6 +- .../analysis2/AliFMDMCEventInspector.cxx | 4 +- .../analysis2/AliFMDMCEventInspector.h | 4 +- .../analysis2/AliFMDMCSharingFilter.cxx | 10 +- .../FORWARD/analysis2/AliFMDMCSharingFilter.h | 8 +- .../analysis2/AliFMDMCTrackDensity.cxx | 4 +- .../FORWARD/analysis2/AliFMDMCTrackDensity.h | 4 +- PWGLF/FORWARD/analysis2/AliFMDMultCuts.h | 2 +- .../FORWARD/analysis2/AliFMDSharingFilter.cxx | 30 +- PWGLF/FORWARD/analysis2/AliFMDSharingFilter.h | 16 +- .../AliForwardCreateResponseMatrices.cxx | 4 +- .../AliForwardCreateResponseMatrices.h | 6 +- .../FORWARD/analysis2/AliForwardFlowTaskQC.h | 4 +- .../FORWARD/analysis2/AliForwardFlowWeights.h | 2 +- .../analysis2/AliForwardMCCorrectionsTask.cxx | 17 +- .../analysis2/AliForwardMCCorrectionsTask.h | 8 +- .../analysis2/AliForwardMCFlowTaskQC.h | 2 +- .../AliForwardMCMultiplicityTask.cxx | 49 +- .../analysis2/AliForwardMCMultiplicityTask.h | 4 +- .../analysis2/AliForwardMultiplicityBase.cxx | 31 +- .../analysis2/AliForwardMultiplicityBase.h | 4 +- .../AliForwardMultiplicityDistribution.cxx | 4 +- .../AliForwardMultiplicityDistribution.h | 6 +- .../analysis2/AliForwardMultiplicityTask.cxx | 44 +- .../analysis2/AliForwardMultiplicityTask.h | 4 +- PWGLF/FORWARD/analysis2/AliForwardQATask.cxx | 34 +- PWGLF/FORWARD/analysis2/AliForwardQATask.h | 4 +- PWGLF/FORWARD/analysis2/AliForwardUtil.h | 2 +- .../FORWARD/analysis2/AliForwarddNdetaTask.h | 4 +- .../FORWARD/analysis2/AliMCTruthdNdetaTask.h | 4 +- .../FORWARD/analysis2/AliSPDMCTrackDensity.h | 2 +- PWGLF/FORWARD/analysis2/DrawAODSummary.C | 26 +- PWGLF/FORWARD/analysis2/DrawdNdeta.C | 34 +- PWGLF/FORWARD/analysis2/DrawdNdetaSummary.C | 75 ++- PWGLF/FORWARD/analysis2/ForwardAODConfig.C | 39 +- PWGLF/FORWARD/analysis2/gridAnalysis.sh | 613 ++++++++++++++++++ 70 files changed, 1126 insertions(+), 346 deletions(-) create mode 100755 PWGLF/FORWARD/analysis2/gridAnalysis.sh diff --git a/PWGLF/FORWARD/analysis2/AddTaskForwardMult.C b/PWGLF/FORWARD/analysis2/AddTaskForwardMult.C index fecd0f23612..42c54385738 100644 --- a/PWGLF/FORWARD/analysis2/AddTaskForwardMult.C +++ b/PWGLF/FORWARD/analysis2/AddTaskForwardMult.C @@ -70,19 +70,24 @@ AddTaskForwardMult(Bool_t mc, what ^= AliForwardCorrectionManager::kDoubleHit; what ^= AliForwardCorrectionManager::kVertexBias; what ^= AliForwardCorrectionManager::kMergingEfficiency; + what ^= AliForwardCorrectionManager::kAcceptance; if (!cm.Init(sys,sNN,field,mc,what)) Fatal("AddTaskForwardMult", "Failed to initialize corrections"); } // --- Make the output container and connect it -------------------- - TString outputfile = AliAnalysisManager::GetCommonFileName(); - // outputfile += ":PWGLFforwardDnDeta"; - // Form(":%s",pars->GetDndetaAnalysisName()); AliAnalysisDataContainer* histOut = mgr->CreateContainer("Forward", TList::Class(), - AliAnalysisManager::kOutputContainer,outputfile); + AliAnalysisManager::kOutputContainer, + AliAnalysisManager::GetCommonFileName()); + AliAnalysisDataContainer *output = + mgr->CreateContainer("ForwardResults", TList::Class(), + AliAnalysisManager::kParamContainer, + AliAnalysisManager::GetCommonFileName()); + mgr->ConnectInput(task, 0, mgr->GetCommonInputContainer()); mgr->ConnectOutput(task, 1, histOut); + mgr->ConnectOutput(task, 2, output); return task; } diff --git a/PWGLF/FORWARD/analysis2/AliBaseMCTrackDensity.cxx b/PWGLF/FORWARD/analysis2/AliBaseMCTrackDensity.cxx index 81d6447d3dd..39191024218 100644 --- a/PWGLF/FORWARD/analysis2/AliBaseMCTrackDensity.cxx +++ b/PWGLF/FORWARD/analysis2/AliBaseMCTrackDensity.cxx @@ -96,7 +96,7 @@ AliBaseMCTrackDensity::operator=(const AliBaseMCTrackDensity& o) //____________________________________________________________________ void -AliBaseMCTrackDensity::DefineOutput(TList* l) +AliBaseMCTrackDensity::CreateOutputObjects(TList* l) { DGUARD(fDebug,1,"MC track defines output"); TList* ll = new TList; diff --git a/PWGLF/FORWARD/analysis2/AliBaseMCTrackDensity.h b/PWGLF/FORWARD/analysis2/AliBaseMCTrackDensity.h index 7c086562747..475ddc08dfb 100644 --- a/PWGLF/FORWARD/analysis2/AliBaseMCTrackDensity.h +++ b/PWGLF/FORWARD/analysis2/AliBaseMCTrackDensity.h @@ -88,7 +88,7 @@ public: * * @param list List to add outputs to */ - virtual void DefineOutput(TList* list); + virtual void CreateOutputObjects(TList* list); /** * Print information to standard out * @@ -224,7 +224,7 @@ protected: Double_t fPhiR; // Reaction plane of this event Bool_t fDebug; // Debug flag - ClassDef(AliBaseMCTrackDensity,2); // Calculate track-ref density + ClassDef(AliBaseMCTrackDensity,3); // Calculate track-ref density }; #endif diff --git a/PWGLF/FORWARD/analysis2/AliBasedNdetaTask.h b/PWGLF/FORWARD/analysis2/AliBasedNdetaTask.h index 8ca3801f94c..9ac876f9298 100644 --- a/PWGLF/FORWARD/analysis2/AliBasedNdetaTask.h +++ b/PWGLF/FORWARD/analysis2/AliBasedNdetaTask.h @@ -863,7 +863,7 @@ protected: Bool_t fDoFinalMCCorrection; //Do final MC correction Int_t fDebug; // Debug level - ClassDef(CentralityBin,2); // A centrality bin + ClassDef(CentralityBin,3); // A centrality bin }; TList* fSums; // Container of sums TList* fOutput; // Container of outputs @@ -888,7 +888,7 @@ protected: TObject* fTriggerString; // Trigger string TString fFinalMCCorrFile; //Filename for final MC corr - ClassDef(AliBasedNdetaTask,9); // Determine charged particle density + ClassDef(AliBasedNdetaTask,10); // Determine charged particle density }; #endif diff --git a/PWGLF/FORWARD/analysis2/AliCentralMCCorrectionsTask.cxx b/PWGLF/FORWARD/analysis2/AliCentralMCCorrectionsTask.cxx index 5cdb512c3d5..b8f2dff04d3 100644 --- a/PWGLF/FORWARD/analysis2/AliCentralMCCorrectionsTask.cxx +++ b/PWGLF/FORWARD/analysis2/AliCentralMCCorrectionsTask.cxx @@ -255,7 +255,7 @@ AliCentralMCCorrectionsTask::DefineBins(TList* l) Double_t high = fVtxAxis.GetBinUpEdge(i); VtxBin* bin = new VtxBin(low, high, fEtaAxis, fNPhiBins); fVtxBins->AddAt(bin, i); - bin->DefineOutput(l); + bin->CreateOutputObjects(l); } } @@ -324,8 +324,8 @@ AliCentralMCCorrectionsTask::UserCreateOutputObjects() AliInfo(Form("Initialising sub-routines: %p, %p", &fInspector, &fTrackDensity)); - fInspector.DefineOutput(fList); - fTrackDensity.DefineOutput(fList); + fInspector.CreateOutputObjects(fList); + fTrackDensity.CreateOutputObjects(fList); PostData(1, fList); } @@ -371,7 +371,7 @@ AliCentralMCCorrectionsTask::UserExec(Option_t*) esd->GetMagneticField(), esd->GetRunNumber())); - fInspector.Init(fVtxAxis); + fInspector.SetupForData(fVtxAxis); Print(); fFirstEvent = false; @@ -472,7 +472,7 @@ AliCentralMCCorrectionsTask::Terminate(Option_t*) VtxBin* bin = 0; UShort_t iVz = 1; while ((bin = static_cast(next()))) - bin->Finish(fList, output, iVz++, fEffectiveCorr, corr,acorr); + bin->Terminate(fList, output, iVz++, fEffectiveCorr, corr,acorr); output->Add(corr); output->Add(acorr); @@ -612,7 +612,7 @@ AliCentralMCCorrectionsTask::VtxBin::operator=(const VtxBin& o) //____________________________________________________________________ void -AliCentralMCCorrectionsTask::VtxBin::DefineOutput(TList* l) +AliCentralMCCorrectionsTask::VtxBin::CreateOutputObjects(TList* l) { TList* d = new TList; d->SetName(GetName()); @@ -626,7 +626,7 @@ AliCentralMCCorrectionsTask::VtxBin::DefineOutput(TList* l) } //____________________________________________________________________ void -AliCentralMCCorrectionsTask::VtxBin::Finish(const TList* input, +AliCentralMCCorrectionsTask::VtxBin::Terminate(const TList* input, TList* output, UShort_t iVz, Bool_t effectiveCorr, diff --git a/PWGLF/FORWARD/analysis2/AliCentralMCCorrectionsTask.h b/PWGLF/FORWARD/analysis2/AliCentralMCCorrectionsTask.h index 8a6ecfc91f1..34cea94d1d4 100644 --- a/PWGLF/FORWARD/analysis2/AliCentralMCCorrectionsTask.h +++ b/PWGLF/FORWARD/analysis2/AliCentralMCCorrectionsTask.h @@ -218,7 +218,7 @@ protected: * * @param list List to put output in */ - void DefineOutput(TList* list); + void CreateOutputObjects(TList* list); /** * End of job process * @@ -229,7 +229,7 @@ protected: * @param acorr Acceptance correction * @param map Correctons map */ - void Finish(const TList* i, + void Terminate(const TList* i, TList* o, UShort_t iVz, Bool_t effective, @@ -241,7 +241,7 @@ protected: TH2D* fPrimary; // Cache or primary TH1D* fCounts; // Event count - ClassDef(VtxBin,2); // Vertex bin + ClassDef(VtxBin,3); // Vertex bin }; /** * Define our vertex bins @@ -263,7 +263,7 @@ protected: TList* fList; // Output list UShort_t fNPhiBins; // Nunber of phi bins Bool_t fEffectiveCorr; // Whether to make effective corrections - ClassDef(AliCentralMCCorrectionsTask,1) // Central corrections class + ClassDef(AliCentralMCCorrectionsTask,2) // Central corrections class }; #endif diff --git a/PWGLF/FORWARD/analysis2/AliCentralMCMultiplicityTask.cxx b/PWGLF/FORWARD/analysis2/AliCentralMCMultiplicityTask.cxx index b72872dd98d..3db1e138ab9 100644 --- a/PWGLF/FORWARD/analysis2/AliCentralMCMultiplicityTask.cxx +++ b/PWGLF/FORWARD/analysis2/AliCentralMCMultiplicityTask.cxx @@ -106,7 +106,7 @@ void AliCentralMCMultiplicityTask::UserCreateOutputObjects() ah->AddBranch("AliAODCentralMult", &obj); - fTrackDensity.DefineOutput(fList); + fTrackDensity.CreateOutputObjects(fList); } //____________________________________________________________________ diff --git a/PWGLF/FORWARD/analysis2/AliCentralMCMultiplicityTask.h b/PWGLF/FORWARD/analysis2/AliCentralMCMultiplicityTask.h index be5ac0b1d1d..e0e7fd13daf 100644 --- a/PWGLF/FORWARD/analysis2/AliCentralMCMultiplicityTask.h +++ b/PWGLF/FORWARD/analysis2/AliCentralMCMultiplicityTask.h @@ -99,7 +99,7 @@ protected: AliSPDMCTrackDensity fTrackDensity; // Calculate N_ch,incl // from MC AliAODCentralMult fAODMCCentral; // Output object - ClassDef(AliCentralMCMultiplicityTask,1) // Forward multiplicity class + ClassDef(AliCentralMCMultiplicityTask,2) // Forward multiplicity class }; #endif diff --git a/PWGLF/FORWARD/analysis2/AliCentralMultiplicityTask.cxx b/PWGLF/FORWARD/analysis2/AliCentralMultiplicityTask.cxx index 831c9f7cb2e..0882014ca18 100644 --- a/PWGLF/FORWARD/analysis2/AliCentralMultiplicityTask.cxx +++ b/PWGLF/FORWARD/analysis2/AliCentralMultiplicityTask.cxx @@ -181,7 +181,7 @@ void AliCentralMultiplicityTask::UserCreateOutputObjects() fList = new TList(); fList->SetOwner(); - fInspector.DefineOutput(fList); + fInspector.CreateOutputObjects(fList); PostData(1,fList); } @@ -200,7 +200,10 @@ AliCentralMultiplicityTask::GetESDEvent() AliWarning("No ESD event found for input event"); return 0; } - + + // Load in the data needed + LoadBranches(); + // IF we've read the first event already, just return the event if (fFirstEventSeen) return esd; @@ -269,7 +272,7 @@ AliCentralMultiplicityTask::GetESDEvent() fNTracklet->Sumw2(); // Initialize the inspecto - fInspector.Init(vaxis); + fInspector.SetupForData(vaxis); fFirstEventSeen = kTRUE; // Print some information diff --git a/PWGLF/FORWARD/analysis2/AliCentralMultiplicityTask.h b/PWGLF/FORWARD/analysis2/AliCentralMultiplicityTask.h index baa56686ae0..dc77b95ab93 100644 --- a/PWGLF/FORWARD/analysis2/AliCentralMultiplicityTask.h +++ b/PWGLF/FORWARD/analysis2/AliCentralMultiplicityTask.h @@ -320,7 +320,7 @@ public: TString fSecMapName; // Secindary name Bool_t fIsInit; // Are we init - ClassDef(Manager,1); // Manager of data + ClassDef(Manager,2); // Manager of data }; /** * Get the ESD event and initialise manager on first event if not @@ -379,7 +379,7 @@ protected: TH1D* fNTracklet; //! number of tracklets TArrayI fEtaMin; // Least eta bin to use TArrayI fEtaMax; // Largest eta bin to use - ClassDef(AliCentralMultiplicityTask,3) // Forward multiplicity class + ClassDef(AliCentralMultiplicityTask,4) // Forward multiplicity class }; #endif diff --git a/PWGLF/FORWARD/analysis2/AliCentraldNdetaTask.h b/PWGLF/FORWARD/analysis2/AliCentraldNdetaTask.h index 6f09d529250..ea063653990 100644 --- a/PWGLF/FORWARD/analysis2/AliCentraldNdetaTask.h +++ b/PWGLF/FORWARD/analysis2/AliCentraldNdetaTask.h @@ -66,7 +66,7 @@ protected: */ virtual Int_t GetMarker() const { return GetMarkerStyle(kSquare); } - ClassDef(AliCentraldNdetaTask,1); // Determine multiplicity in central area + ClassDef(AliCentraldNdetaTask,2); // Determine multiplicity in central area }; #endif diff --git a/PWGLF/FORWARD/analysis2/AliCopyHeaderTask.cxx b/PWGLF/FORWARD/analysis2/AliCopyHeaderTask.cxx index 914958d2360..61e050861ef 100644 --- a/PWGLF/FORWARD/analysis2/AliCopyHeaderTask.cxx +++ b/PWGLF/FORWARD/analysis2/AliCopyHeaderTask.cxx @@ -21,6 +21,7 @@ ClassImp(AliCopyHeaderTask) ; // for emacs - do not remove #endif + void AliCopyHeaderTask::UserExec(Option_t*) { @@ -40,7 +41,9 @@ AliCopyHeaderTask::UserExec(Option_t*) AliWarning("Missing AOD event"); return; } - + + LoadBranches(); + AliAODHeader* aodHeader = aod->GetHeader(); if (!aodHeader) { AliWarning("Missing AOD header"); diff --git a/PWGLF/FORWARD/analysis2/AliCopyHeaderTask.h b/PWGLF/FORWARD/analysis2/AliCopyHeaderTask.h index c31d8ca2d99..d5b6328acb6 100644 --- a/PWGLF/FORWARD/analysis2/AliCopyHeaderTask.h +++ b/PWGLF/FORWARD/analysis2/AliCopyHeaderTask.h @@ -27,7 +27,9 @@ public: */ AliCopyHeaderTask(const char* name="header") : AliAnalysisTaskSE(name) - {} + { + fBranchNames = "ESD:AliESDHeader.;AliESDRun."; + } /** * Copy constructor * diff --git a/PWGLF/FORWARD/analysis2/AliDisplacedVertexSelection.cxx b/PWGLF/FORWARD/analysis2/AliDisplacedVertexSelection.cxx index 75b11dbeac9..27af39b82d7 100644 --- a/PWGLF/FORWARD/analysis2/AliDisplacedVertexSelection.cxx +++ b/PWGLF/FORWARD/analysis2/AliDisplacedVertexSelection.cxx @@ -32,7 +32,7 @@ AliDisplacedVertexSelection::operator=(const AliDisplacedVertexSelection& o) //____________________________________________________________________ void -AliDisplacedVertexSelection::Output(TList* /*l*/, const char* /* name*/) const +AliDisplacedVertexSelection::CreateOutputObjects(TList* /*l*/, const char* /* name*/) const { } diff --git a/PWGLF/FORWARD/analysis2/AliDisplacedVertexSelection.h b/PWGLF/FORWARD/analysis2/AliDisplacedVertexSelection.h index ff70299e300..2a5aba63300 100644 --- a/PWGLF/FORWARD/analysis2/AliDisplacedVertexSelection.h +++ b/PWGLF/FORWARD/analysis2/AliDisplacedVertexSelection.h @@ -33,7 +33,7 @@ public: * @param l List to add output to * @param name Name of the list */ - void Output(TList* l, const char* name=0) const; + void CreateOutputObjects(TList* l, const char* name=0) const; /** * Print information * @@ -72,7 +72,7 @@ protected: Double_t fVertexZ; Double_t fCent; - ClassDef(AliDisplacedVertexSelection,1); // Cuts on ESD Mult + ClassDef(AliDisplacedVertexSelection,2); // Cuts on ESD Mult }; #endif diff --git a/PWGLF/FORWARD/analysis2/AliFMDCorrector.cxx b/PWGLF/FORWARD/analysis2/AliFMDCorrector.cxx index 28e335c3582..ef58bc61361 100644 --- a/PWGLF/FORWARD/analysis2/AliFMDCorrector.cxx +++ b/PWGLF/FORWARD/analysis2/AliFMDCorrector.cxx @@ -118,7 +118,7 @@ AliFMDCorrector::operator=(const AliFMDCorrector& o) //____________________________________________________________________ void -AliFMDCorrector::Init(const TAxis&) +AliFMDCorrector::SetupForData(const TAxis&) { // // Initialize this object @@ -300,7 +300,7 @@ AliFMDCorrector::Correct(AliForwardUtil::Histos& hists, //____________________________________________________________________ void -AliFMDCorrector::ScaleHistograms(const TList* dir, Int_t nEvents) +AliFMDCorrector::Terminate(const TList* dir, TList* output, Int_t nEvents) { // // Scale the histograms to the total number of events @@ -313,11 +313,19 @@ AliFMDCorrector::ScaleHistograms(const TList* dir, Int_t nEvents) TList* d = static_cast(dir->FindObject(GetName())); if (!d) return; + TList* out = new TList; + out->SetName(d->GetName()); + out->SetOwner(); + TIter next(&fRingHistos); RingHistos* o = 0; THStack* sums = new THStack("sums", "Sums of ring results"); while ((o = static_cast(next()))) { - o->ScaleHistograms(d, nEvents); + o->Terminate(d, nEvents); + if (!o->fDensity) { + Warning("Terminate", "No density from %s", o->GetName()); + continue; + } TH1D* sum = o->fDensity->ProjectionX(o->GetName(), 1, o->fDensity->GetNbinsY(),"e"); sum->Scale(1., "width"); @@ -326,12 +334,12 @@ AliFMDCorrector::ScaleHistograms(const TList* dir, Int_t nEvents) sum->SetYTitle("#sum N_{ch,primary}"); sums->Add(sum); } - d->Add(sums); - + out->Add(sums); + output->Add(out); } //____________________________________________________________________ void -AliFMDCorrector::DefineOutput(TList* dir) +AliFMDCorrector::CreateOutputObjects(TList* dir) { // // Output diagnostic histograms to directory @@ -353,7 +361,7 @@ AliFMDCorrector::DefineOutput(TList* dir) TIter next(&fRingHistos); RingHistos* o = 0; while ((o = static_cast(next()))) { - o->Output(d); + o->CreateOutputObjects(d); } } @@ -454,7 +462,7 @@ AliFMDCorrector::RingHistos::~RingHistos() //____________________________________________________________________ void -AliFMDCorrector::RingHistos::Output(TList* dir) +AliFMDCorrector::RingHistos::CreateOutputObjects(TList* dir) { // // Make output @@ -467,7 +475,7 @@ AliFMDCorrector::RingHistos::Output(TList* dir) //____________________________________________________________________ void -AliFMDCorrector::RingHistos::ScaleHistograms(TList* dir, Int_t nEvents) +AliFMDCorrector::RingHistos::Terminate(TList* dir, Int_t nEvents) { // // Scale the histograms to the total number of events @@ -478,8 +486,9 @@ AliFMDCorrector::RingHistos::ScaleHistograms(TList* dir, Int_t nEvents) TList* l = GetOutputList(dir); if (!l) return; - TH1* density = GetOutputHist(l,"primaryDensity"); + TH2D* density = static_cast(GetOutputHist(l,"primaryDensity")); if (density) density->Scale(1./nEvents); + fDensity = density; } //____________________________________________________________________ diff --git a/PWGLF/FORWARD/analysis2/AliFMDCorrector.h b/PWGLF/FORWARD/analysis2/AliFMDCorrector.h index adedf391cac..cf8e4d8f720 100644 --- a/PWGLF/FORWARD/analysis2/AliFMDCorrector.h +++ b/PWGLF/FORWARD/analysis2/AliFMDCorrector.h @@ -81,7 +81,7 @@ public: * * @param etaAxis Eta axis to use -- not used */ - virtual void Init(const TAxis& etaAxis); + virtual void SetupForData(const TAxis& etaAxis); /** * Do the calculations * @@ -97,13 +97,13 @@ public: * @param dir Where the output is stored * @param nEvents Number of events */ - virtual void ScaleHistograms(const TList* dir, Int_t nEvents); + virtual void Terminate(const TList* dir, TList* output, Int_t nEvents); /** * Output diagnostic histograms to directory * * @param dir List to write in */ - virtual void DefineOutput(TList* dir); + virtual void CreateOutputObjects(TList* dir); /** * Set the debug level. The higher the value the more output * @@ -210,16 +210,16 @@ protected: * * @param dir Where to put it */ - void Output(TList* dir); + void CreateOutputObjects(TList* dir); /** * Scale the histograms to the total number of events * * @param dir where the output is stored * @param nEvents Number of events */ - void ScaleHistograms(TList* dir, Int_t nEvents); + void Terminate(TList* dir, Int_t nEvents); TH2D* fDensity; // Distribution primary Nch - ClassDef(RingHistos,1); + ClassDef(RingHistos,2); }; /** * Get the ring histogram container @@ -247,7 +247,7 @@ protected: Bool_t fUseMergingEfficiency; // Whether to use the merging efficiency Int_t fDebug; // Debug level - ClassDef(AliFMDCorrector,3); // Correct the inclusive d2N/detadphi + ClassDef(AliFMDCorrector,4); // Correct the inclusive d2N/detadphi }; #endif diff --git a/PWGLF/FORWARD/analysis2/AliFMDDensityCalculator.cxx b/PWGLF/FORWARD/analysis2/AliFMDDensityCalculator.cxx index f1438ca6a7b..cc4de8d9116 100644 --- a/PWGLF/FORWARD/analysis2/AliFMDDensityCalculator.cxx +++ b/PWGLF/FORWARD/analysis2/AliFMDDensityCalculator.cxx @@ -220,7 +220,7 @@ AliFMDDensityCalculator::operator=(const AliFMDDensityCalculator& o) //____________________________________________________________________ void -AliFMDDensityCalculator::Init(const TAxis& axis) +AliFMDDensityCalculator::SetupForData(const TAxis& axis) { // Intialize this sub-algorithm // @@ -232,7 +232,7 @@ AliFMDDensityCalculator::Init(const TAxis& axis) TIter next(&fRingHistos); RingHistos* o = 0; while ((o = static_cast(next()))) { - o->Init(axis); + o->SetupForData(axis); // o->fMultCut = fCuts.GetFixedCut(o->fDet, o->fRing); // o->fPoisson.Init(o->fDet,o->fRing,fEtaLumping, fPhiLumping); } @@ -831,7 +831,8 @@ AliFMDDensityCalculator::AcceptanceCorrection(Char_t r, UShort_t t) const //____________________________________________________________________ void -AliFMDDensityCalculator::ScaleHistograms(const TList* dir, Int_t nEvents) +AliFMDDensityCalculator::Terminate(const TList* dir, TList* output, + Int_t nEvents) { // // Scale the histograms to the total number of events @@ -845,11 +846,19 @@ AliFMDDensityCalculator::ScaleHistograms(const TList* dir, Int_t nEvents) TList* d = static_cast(dir->FindObject(GetName())); if (!d) return; + TList* out = new TList; + out->SetName(d->GetName()); + out->SetOwner(); + TIter next(&fRingHistos); RingHistos* o = 0; THStack* sums = new THStack("sums", "sums of ring signals"); while ((o = static_cast(next()))) { - o->ScaleHistograms(d, nEvents); + o->Terminate(d, nEvents); + if (!o->fDensity) { + Warning("Terminate", "No density in %s", o->GetName()); + continue; + } TH1D* sum = o->fDensity->ProjectionX(o->GetName(), 1, o->fDensity->GetNbinsY(),"e"); sum->Scale(1., "width"); @@ -858,12 +867,13 @@ AliFMDDensityCalculator::ScaleHistograms(const TList* dir, Int_t nEvents) sum->SetYTitle("#sum N_{ch,incl}"); sums->Add(sum); } - d->Add(sums); + out->Add(sums); + output->Add(out); } //____________________________________________________________________ void -AliFMDDensityCalculator::DefineOutput(TList* dir) +AliFMDDensityCalculator::CreateOutputObjects(TList* dir) { // // Output diagnostic histograms to directory @@ -910,7 +920,7 @@ AliFMDDensityCalculator::DefineOutput(TList* dir) RingHistos* o = 0; while ((o = static_cast(next()))) { o->fPoisson.SetLumping(fEtaLumping, fPhiLumping); - o->Output(d); + o->CreateOutputObjects(d); } } //____________________________________________________________________ @@ -1213,7 +1223,7 @@ AliFMDDensityCalculator::RingHistos::~RingHistos() //____________________________________________________________________ void -AliFMDDensityCalculator::RingHistos::Init(const TAxis& eAxis) +AliFMDDensityCalculator::RingHistos::SetupForData(const TAxis& eAxis) { // Initialize // This is called on first event @@ -1240,7 +1250,7 @@ AliFMDDensityCalculator::RingHistos::Init(const TAxis& eAxis) //____________________________________________________________________ void -AliFMDDensityCalculator::RingHistos::Output(TList* dir) +AliFMDDensityCalculator::RingHistos::CreateOutputObjects(TList* dir) { // // Make output. This is called as part of SlaveBegin @@ -1281,7 +1291,7 @@ AliFMDDensityCalculator::RingHistos::Output(TList* dir) //____________________________________________________________________ void -AliFMDDensityCalculator::RingHistos::ScaleHistograms(TList* dir, Int_t nEvents) +AliFMDDensityCalculator::RingHistos::Terminate(TList* dir, Int_t nEvents) { // // Scale the histograms to the total number of events @@ -1293,8 +1303,9 @@ AliFMDDensityCalculator::RingHistos::ScaleHistograms(TList* dir, Int_t nEvents) TList* l = GetOutputList(dir); if (!l) return; - TH1* density = GetOutputHist(l,"inclDensity"); + TH2D* density = static_cast(GetOutputHist(l,"inclDensity")); if (density) density->Scale(1./nEvents); + fDensity = density; } //____________________________________________________________________ diff --git a/PWGLF/FORWARD/analysis2/AliFMDDensityCalculator.h b/PWGLF/FORWARD/analysis2/AliFMDDensityCalculator.h index 4168ee33ac9..db71189ab8b 100644 --- a/PWGLF/FORWARD/analysis2/AliFMDDensityCalculator.h +++ b/PWGLF/FORWARD/analysis2/AliFMDDensityCalculator.h @@ -98,7 +98,7 @@ public: * * @param etaAxis Not used */ - virtual void Init(const TAxis& etaAxis); + virtual void SetupForData(const TAxis& etaAxis); /** * Do the calculations * @@ -121,13 +121,13 @@ public: * @param dir where to put the output * @param nEvents Number of events */ - virtual void ScaleHistograms(const TList* dir, Int_t nEvents); + virtual void Terminate(const TList* dir, TList* output, Int_t nEvents); /** * Output diagnostic histograms to directory * * @param dir List to write in */ - virtual void DefineOutput(TList* dir); + virtual void CreateOutputObjects(TList* dir); /** * Set the debug level. The higher the value the more output * @@ -372,20 +372,20 @@ protected: * * @param eAxis */ - void Init(const TAxis& eAxis); + void SetupForData(const TAxis& eAxis); /** * Make output * * @param dir Where to put it */ - void Output(TList* dir); + void CreateOutputObjects(TList* dir); /** * Scale the histograms to the total number of events * * @param dir Where the output is * @param nEvents Number of events */ - void ScaleHistograms(TList* dir, Int_t nEvents); + void Terminate(TList* dir, Int_t nEvents); TList* fList; TH2D* fEvsN; // Correlation of Eloss vs uncorrected Nch TH2D* fEvsM; // Correlation of Eloss vs corrected Nch @@ -404,7 +404,7 @@ protected: TH2D* fPhiAcc; // Phi acceptance vs IpZ TH1D* fPhiBefore; // Phi before re-calce TH1D* fPhiAfter; // Phi after re-calc - ClassDef(RingHistos,8); + ClassDef(RingHistos,9); }; /** * Get the ring histogram container @@ -438,7 +438,7 @@ protected: Bool_t fRecalculateEta; // Whether to recalc eta and angle correction (disp vtx) Bool_t fRecalculatePhi; // Whether to correct for (X,Y) offset - ClassDef(AliFMDDensityCalculator,7); // Calculate Nch density + ClassDef(AliFMDDensityCalculator,9); // Calculate Nch density }; #endif diff --git a/PWGLF/FORWARD/analysis2/AliFMDEnergyFitter.cxx b/PWGLF/FORWARD/analysis2/AliFMDEnergyFitter.cxx index 956ede608c6..747ecae894e 100644 --- a/PWGLF/FORWARD/analysis2/AliFMDEnergyFitter.cxx +++ b/PWGLF/FORWARD/analysis2/AliFMDEnergyFitter.cxx @@ -208,7 +208,7 @@ AliFMDEnergyFitter::GetRingHistos(UShort_t d, Char_t r) const //____________________________________________________________________ void -AliFMDEnergyFitter::Init(const TAxis& eAxis) +AliFMDEnergyFitter::SetupForData(const TAxis& eAxis) { // // Initialise the task @@ -231,7 +231,7 @@ AliFMDEnergyFitter::Init(const TAxis& eAxis) TIter next(&fRingHistos); RingHistos* o = 0; while ((o = static_cast(next()))) - o->Init(fEtaAxis, fCentralityAxis, fMaxE, fNEbins, fUseIncreasingBins); + o->SetupForData(fEtaAxis, fCentralityAxis, fMaxE, fNEbins, fUseIncreasingBins); } //____________________________________________________________________ void @@ -415,7 +415,7 @@ AliFMDEnergyFitter::MakeCorrectionsObject(TList* d) //____________________________________________________________________ void -AliFMDEnergyFitter::DefineOutput(TList* dir) +AliFMDEnergyFitter::CreateOutputObjects(TList* dir) { // // Define the output histograms. These are put in a sub list of the @@ -436,7 +436,7 @@ AliFMDEnergyFitter::DefineOutput(TList* dir) TIter next(&fRingHistos); RingHistos* o = 0; while ((o = static_cast(next()))) { - o->Output(d); + o->CreateOutputObjects(d); } } //____________________________________________________________________ @@ -815,7 +815,7 @@ AliFMDEnergyFitter::RingHistos::MakeTotal(const char* name, //____________________________________________________________________ void -AliFMDEnergyFitter::RingHistos::Init(const TAxis& eAxis, +AliFMDEnergyFitter::RingHistos::SetupForData(const TAxis& eAxis, const TAxis& /* cAxis */, Double_t maxDE, Int_t nDEbins, Bool_t useIncrBin) @@ -1406,7 +1406,7 @@ AliFMDEnergyFitter::RingHistos::FindBestFit(const TH1* dist, //____________________________________________________________________ void -AliFMDEnergyFitter::RingHistos::Output(TList* dir) +AliFMDEnergyFitter::RingHistos::CreateOutputObjects(TList* dir) { // // Define outputs diff --git a/PWGLF/FORWARD/analysis2/AliFMDEnergyFitter.h b/PWGLF/FORWARD/analysis2/AliFMDEnergyFitter.h index 38be84c0af7..b5c93cb0bf4 100644 --- a/PWGLF/FORWARD/analysis2/AliFMDEnergyFitter.h +++ b/PWGLF/FORWARD/analysis2/AliFMDEnergyFitter.h @@ -92,7 +92,7 @@ public: * has already been set (using SetEtaAxis), then this parameter will be * ignored */ - void Init(const TAxis& etaAxis); + void SetupForData(const TAxis& etaAxis); /** * Set the eta axis to use. This will force the code to use this * eta axis definition - irrespective of whatever axis is passed to @@ -236,7 +236,7 @@ public: * * @param dir Directory to add to */ - void DefineOutput(TList* dir); + void CreateOutputObjects(TList* dir); /** * Set the debug level. The higher the value the more output * @@ -289,7 +289,7 @@ protected: * * @param dir */ - void Output(TList* dir); + void CreateOutputObjects(TList* dir); /** * Initialise object * @@ -299,7 +299,7 @@ protected: * @param nDEbins Number of bins * @param useIncrBin Whether to use an increasing bin size */ - void Init(const TAxis& eAxis, + void SetupForData(const TAxis& eAxis, const TAxis& cAxis, Double_t maxDE=10, Int_t nDEbins=300, @@ -481,7 +481,7 @@ protected: TList* fList; TClonesArray fFits; Int_t fDebug; - ClassDef(RingHistos,2); + ClassDef(RingHistos,3); }; /** * Get the ring histogram container @@ -511,7 +511,7 @@ protected: Int_t fDebug; // Debug level - ClassDef(AliFMDEnergyFitter,3); // + ClassDef(AliFMDEnergyFitter,4); // }; #endif diff --git a/PWGLF/FORWARD/analysis2/AliFMDEnergyFitterTask.cxx b/PWGLF/FORWARD/analysis2/AliFMDEnergyFitterTask.cxx index 91fcc8d24a6..b44a0faa5c4 100644 --- a/PWGLF/FORWARD/analysis2/AliFMDEnergyFitterTask.cxx +++ b/PWGLF/FORWARD/analysis2/AliFMDEnergyFitterTask.cxx @@ -149,7 +149,7 @@ AliFMDEnergyFitterTask::Init() //____________________________________________________________________ void -AliFMDEnergyFitterTask::InitializeSubs() +AliFMDEnergyFitterTask::SetupForData() { // // Initialise the sub objects and stuff. Called on first event @@ -163,8 +163,8 @@ AliFMDEnergyFitterTask::InitializeSubs() fcm.Init(sys, sNN, fld, 0); TAxis eAxis(0,0,0); TAxis vAxis(10,-10,10); - fEnergyFitter.Init(eAxis); - fEventInspector.Init(vAxis); + fEnergyFitter.SetupForData(eAxis); + fEventInspector.SetupForData(vAxis); } @@ -180,8 +180,8 @@ AliFMDEnergyFitterTask::UserCreateOutputObjects() fList = new TList; fList->SetOwner(); - fEventInspector.DefineOutput(fList); - fEnergyFitter.DefineOutput(fList); + fEventInspector.CreateOutputObjects(fList); + fEnergyFitter.CreateOutputObjects(fList); PostData(1, fList); } @@ -222,6 +222,9 @@ AliFMDEnergyFitterTask::UserExec(Option_t*) return; } + // --- Read in the data -------------------------------------------- + LoadBranches(); + // On the first event, initialize the parameters if (fFirstEvent && esd->GetESDRun()) { fEventInspector.ReadRunDetails(esd); @@ -245,7 +248,7 @@ AliFMDEnergyFitterTask::UserExec(Option_t*) // pars->PrintStatus(); fFirstEvent = false; - InitializeSubs(); + SetupForData(); } Bool_t lowFlux = kFALSE; UInt_t triggers = 0; diff --git a/PWGLF/FORWARD/analysis2/AliFMDEnergyFitterTask.h b/PWGLF/FORWARD/analysis2/AliFMDEnergyFitterTask.h index 8a5aaec051f..1b1afc1dae8 100644 --- a/PWGLF/FORWARD/analysis2/AliFMDEnergyFitterTask.h +++ b/PWGLF/FORWARD/analysis2/AliFMDEnergyFitterTask.h @@ -151,7 +151,7 @@ protected: * Initialise the sub objects and stuff. Called on first event * */ - virtual void InitializeSubs(); + virtual void SetupForData(); Bool_t fFirstEvent; // Whether the event is the first seen AliFMDEventInspector fEventInspector; // Algorithm @@ -160,7 +160,7 @@ protected: Float_t fbLow; // What's this? Float_t fbHigh; // What's this? - ClassDef(AliFMDEnergyFitterTask,1) // Forward multiplicity class + ClassDef(AliFMDEnergyFitterTask,2) // Forward multiplicity class }; #endif diff --git a/PWGLF/FORWARD/analysis2/AliFMDEventInspector.cxx b/PWGLF/FORWARD/analysis2/AliFMDEventInspector.cxx index 28cf603b12a..9696ca84aff 100644 --- a/PWGLF/FORWARD/analysis2/AliFMDEventInspector.cxx +++ b/PWGLF/FORWARD/analysis2/AliFMDEventInspector.cxx @@ -70,10 +70,11 @@ AliFMDEventInspector::AliFMDEventInspector() fUseV0AND(false), fMinPileupContrib(3), fMinPileupDistance(0.8), - fUseDisplacedVertices(false), + fUseDisplacedVertices(false), fDisplacedVertex(), fCollWords(), - fBgWords() + fBgWords(), + fCentMethod("V0M") { // // Constructor @@ -111,7 +112,8 @@ AliFMDEventInspector::AliFMDEventInspector(const char* name) fUseDisplacedVertices(false), fDisplacedVertex(), fCollWords(), - fBgWords() + fBgWords(), + fCentMethod("V0M") { // // Constructor @@ -152,7 +154,8 @@ AliFMDEventInspector::AliFMDEventInspector(const AliFMDEventInspector& o) fUseDisplacedVertices(o.fUseDisplacedVertices), fDisplacedVertex(o.fDisplacedVertex), fCollWords(), - fBgWords() + fBgWords(), + fCentMethod(o.fCentMethod) { // // Copy constructor @@ -215,6 +218,7 @@ AliFMDEventInspector::operator=(const AliFMDEventInspector& o) fMinPileupDistance = o.fMinPileupDistance; fUseDisplacedVertices = o.fUseDisplacedVertices; fDisplacedVertex = o.fDisplacedVertex; + fCentMethod = o.fCentMethod; if (fList) { fList->SetName(GetName()); if (fHEventsTr) fList->Add(fHEventsTr); @@ -230,6 +234,29 @@ AliFMDEventInspector::operator=(const AliFMDEventInspector& o) return *this; } +//____________________________________________________________________ +void +AliFMDEventInspector::SetCentralityMethod(ECentMethod m) +{ + switch (m) { + case kV0Multiplicity: fCentMethod = "VOM"; break; // VZERO multiplicity + case kV0Amplitude: fCentMethod = "V0A"; break; // VZERO amplitude + case kV0Charge: fCentMethod = "V0C"; break; // VZERO charge + case kFMDRough: fCentMethod = "FMD"; break; // FMD scaled energy l + case kNTracks: fCentMethod = "TRK"; break; // Number of tracks + case kLTracks: fCentMethod = "TKL"; break; // Number of tracks + case kCL0: fCentMethod = "CL0"; break; // + case kCL1: fCentMethod = "CL1"; break; // + case kCND: fCentMethod = "CND"; break; // + case kNParticles: fCentMethod = "NPA"; break; // Neutral particles + case kNeutrons: fCentMethod = "ZNA"; break; // ZDC neutron amplitu + case kV0vsFMD: fCentMethod = "V0MvsFMD"; break; // VZERO versus FMD + case kV0vsNTracks: fCentMethod = "TKLvsVOM"; break; // Tracks versus VZERO + case kZEMvsZDC: fCentMethod = "ZEMvsZDC"; break; // ZDC + default: fCentMethod = "V0M"; break; + } +} + //____________________________________________________________________ Bool_t AliFMDEventInspector::FetchHistograms(const TList* d, @@ -316,7 +343,7 @@ AliFMDEventInspector::CacheConfiguredTriggerClasses(TList& cache, //____________________________________________________________________ void -AliFMDEventInspector::Init(const TAxis& vtxAxis) +AliFMDEventInspector::SetupForData(const TAxis& vtxAxis) { // // Initialize the object - this is called on the first seen event. @@ -546,7 +573,7 @@ AliFMDEventInspector::StoreInformation(Int_t runNo) //____________________________________________________________________ void -AliFMDEventInspector::DefineOutput(TList* dir) +AliFMDEventInspector::CreateOutputObjects(TList* dir) { // // Define the output histograms. These are put in a sub list of the @@ -706,7 +733,7 @@ AliFMDEventInspector::ReadCentrality(const AliESDEvent& esd, AliCentrality* centObj = const_cast(esd).GetCentrality(); if (!centObj) return true; - cent = centObj->GetCentralityPercentile("V0M"); + cent = centObj->GetCentralityPercentile(fCentMethod); qual = centObj->GetQuality(); return true; @@ -1202,8 +1229,9 @@ AliFMDEventInspector::Print(Option_t*) const << AliForwardUtil::CollisionSystemString(fCollisionSystem) << '\n' << ind << " CMS energy per nucleon: " << sNN << '\n' << ind << " Field: " << field << '\n' - << ind << " Satellite events: " << fUseDisplacedVertices - << "\n" << std::noboolalpha; + << ind << " Satellite events: " << fUseDisplacedVertices<<'\n' + << ind << " Centrality method: " << fCentMethod << '\n' + << std::noboolalpha; if (!fCentAxis) { std::cout << std::flush; return; } Int_t nBin = fCentAxis->GetNbins(); std::cout << ind << " Centrality axis: " << nBin << " bins" diff --git a/PWGLF/FORWARD/analysis2/AliFMDEventInspector.h b/PWGLF/FORWARD/analysis2/AliFMDEventInspector.h index fc035d6f906..20e105272aa 100644 --- a/PWGLF/FORWARD/analysis2/AliFMDEventInspector.h +++ b/PWGLF/FORWARD/analysis2/AliFMDEventInspector.h @@ -87,6 +87,26 @@ public: kMCNSD, kOffline }; + /** + * Centrality methods + */ + enum ECentMethod { + kV0Multiplicity, + kV0Amplitude, + kV0Charge, + kFMDRough, + kNTracks, + kLTracks, + kCL0, + kCL1, + kCND, + kNParticles, + kNeutrons, + kV0vsFMD, + kV0vsNTracks, + kZEMvsZDC + }; + /** * Collision systems */ @@ -133,7 +153,7 @@ public: * * @param vtxAxis Vertex axis in use */ - virtual void Init(const TAxis& vtxAxis); + virtual void SetupForData(const TAxis& vtxAxis); /** * Process the event * @@ -166,7 +186,7 @@ public: * * @param dir Directory to add to */ - void DefineOutput(TList* dir); + void CreateOutputObjects(TList* dir); /** * Set the number of SPD tracklets for which we consider the event a * low-flux event or not . @@ -219,7 +239,28 @@ public: { fUseDisplacedVertices = use; } - + /** + * Set the centrality method to use. Possible values are + * + * - VOM - VZERO multiplicity + * - V0A - VZERO amplitude + * - V0C - VZERO charge + * - FMD - FMD scaled energy loss + * - TRK - Number of tracks + * - TKL - Number of tracks + * - CL0 - + * - CL1 - + * - CND - + * - NPA - Neutral particles + * - ZNA - ZDC neutron amplitude + * - V0MvsFMD - VZERO versus FMD + * - TKLvsVOM - Tracks versus VZERO + * - ZEMvsZDC - ZDC + * + * @param m + */ + void SetCentralityMethod(const TString& m) { fCentMethod = m; } + void SetCentralityMethod(ECentMethod m); /** * Set the debug level. The higher the value the more output * @@ -465,7 +506,8 @@ protected: AliDisplacedVertexSelection fDisplacedVertex; //Displaced vertex selector TList fCollWords; //! Configured collision words TList fBgWords; //! Configured background words - ClassDef(AliFMDEventInspector,5); // Inspect the event + TString fCentMethod; + ClassDef(AliFMDEventInspector,7); // Inspect the event }; #endif diff --git a/PWGLF/FORWARD/analysis2/AliFMDEventPlaneFinder.cxx b/PWGLF/FORWARD/analysis2/AliFMDEventPlaneFinder.cxx index 7c1c20e2508..0d28683298b 100644 --- a/PWGLF/FORWARD/analysis2/AliFMDEventPlaneFinder.cxx +++ b/PWGLF/FORWARD/analysis2/AliFMDEventPlaneFinder.cxx @@ -254,7 +254,7 @@ AliFMDEventPlaneFinder::MakeCorrHist(const char* name, //____________________________________________________________________ void -AliFMDEventPlaneFinder::Init(const TAxis& etaAxis) +AliFMDEventPlaneFinder::SetupForData(const TAxis& etaAxis) { // Intialize this sub-algorithm // @@ -310,7 +310,7 @@ AliFMDEventPlaneFinder::Init(const TAxis& etaAxis) //_____________________________________________________________________ void -AliFMDEventPlaneFinder::DefineOutput(TList* dir) +AliFMDEventPlaneFinder::CreateOutputObjects(TList* dir) { // // Output diagnostic histograms to directory diff --git a/PWGLF/FORWARD/analysis2/AliFMDEventPlaneFinder.h b/PWGLF/FORWARD/analysis2/AliFMDEventPlaneFinder.h index 7a42fd00b1a..00c2f76b0e0 100644 --- a/PWGLF/FORWARD/analysis2/AliFMDEventPlaneFinder.h +++ b/PWGLF/FORWARD/analysis2/AliFMDEventPlaneFinder.h @@ -64,7 +64,7 @@ public: * * @param etaAxis Eta axis to use */ - virtual void Init(const TAxis& etaAxis); + virtual void SetupForData(const TAxis& etaAxis); /** * Do the calculations * @@ -84,7 +84,7 @@ public: * * @param dir List to write in */ - virtual void DefineOutput(TList* dir); + virtual void CreateOutputObjects(TList* dir); /** * Print information * @@ -233,7 +233,7 @@ protected: Int_t fRunNumber; // Run number supplied Bool_t fUsePhiWeights; // Flag for phi weights - ClassDef(AliFMDEventPlaneFinder,1); // + ClassDef(AliFMDEventPlaneFinder,2); // }; #endif diff --git a/PWGLF/FORWARD/analysis2/AliFMDEventPlaneTask.cxx b/PWGLF/FORWARD/analysis2/AliFMDEventPlaneTask.cxx index f38527f0322..fd9544753cf 100644 --- a/PWGLF/FORWARD/analysis2/AliFMDEventPlaneTask.cxx +++ b/PWGLF/FORWARD/analysis2/AliFMDEventPlaneTask.cxx @@ -137,8 +137,8 @@ void AliFMDEventPlaneTask::UserCreateOutputObjects() // Init of EventPlaneFinder TAxis* pe = new TAxis(200, -4., 6.); - fEventPlaneFinder.DefineOutput(fSumList); - fEventPlaneFinder.Init(*pe); + fEventPlaneFinder.CreateOutputObjects(fSumList); + fEventPlaneFinder.SetupForData(*pe); PostData(1, fSumList); diff --git a/PWGLF/FORWARD/analysis2/AliFMDEventPlaneTask.h b/PWGLF/FORWARD/analysis2/AliFMDEventPlaneTask.h index 201084ce7f6..b6ab45e8243 100644 --- a/PWGLF/FORWARD/analysis2/AliFMDEventPlaneTask.h +++ b/PWGLF/FORWARD/analysis2/AliFMDEventPlaneTask.h @@ -127,7 +127,7 @@ protected: TH1D* fHistVertexSel; // Diagnostics histogram TH1D* fHistVertexAll; // Diagnostics histogram - ClassDef(AliFMDEventPlaneTask, 1); // Analysis task for FMD analysis + ClassDef(AliFMDEventPlaneTask, 2); // Analysis task for FMD analysis }; #endif diff --git a/PWGLF/FORWARD/analysis2/AliFMDHistCollector.cxx b/PWGLF/FORWARD/analysis2/AliFMDHistCollector.cxx index c4928e41e1f..4392a4c70ac 100644 --- a/PWGLF/FORWARD/analysis2/AliFMDHistCollector.cxx +++ b/PWGLF/FORWARD/analysis2/AliFMDHistCollector.cxx @@ -129,7 +129,7 @@ AliFMDHistCollector::operator=(const AliFMDHistCollector& o) //____________________________________________________________________ void -AliFMDHistCollector::Init(const TAxis& vtxAxis, +AliFMDHistCollector::SetupForData(const TAxis& vtxAxis, const TAxis& etaAxis) { // @@ -291,7 +291,7 @@ AliFMDHistCollector::CheckCorrection(const TH2D* bg, Int_t ie, Int_t ip) const //____________________________________________________________________ void -AliFMDHistCollector::DefineOutput(TList* dir) +AliFMDHistCollector::CreateOutputObjects(TList* dir) { // // Output diagnostic histograms to directory diff --git a/PWGLF/FORWARD/analysis2/AliFMDHistCollector.h b/PWGLF/FORWARD/analysis2/AliFMDHistCollector.h index c73d29c334e..4277425a83c 100644 --- a/PWGLF/FORWARD/analysis2/AliFMDHistCollector.h +++ b/PWGLF/FORWARD/analysis2/AliFMDHistCollector.h @@ -146,7 +146,7 @@ public: * @param vtxAxis @f$ v_z@f$ axis * @param etaAxis @f$ \eta@f$ axis */ - virtual void Init(const TAxis& vtxAxis, + virtual void SetupForData(const TAxis& vtxAxis, const TAxis& etaAxis); /** * Do the calculations @@ -167,7 +167,7 @@ public: * * @param dir List to write in */ - virtual void DefineOutput(TList* dir); + virtual void CreateOutputObjects(TList* dir); /** * Set the merge method * @@ -383,7 +383,7 @@ protected: UShort_t fSkipFMDRings; // FMD rings to ignore Bool_t fBgAndHitMaps; // Make hit/bg maps or not - ClassDef(AliFMDHistCollector,3); // Calculate Nch density + ClassDef(AliFMDHistCollector,4); // Calculate Nch density }; //____________________________________________________________________ diff --git a/PWGLF/FORWARD/analysis2/AliFMDMCCorrector.cxx b/PWGLF/FORWARD/analysis2/AliFMDMCCorrector.cxx index b21b561dfc0..cd92d9976e7 100644 --- a/PWGLF/FORWARD/analysis2/AliFMDMCCorrector.cxx +++ b/PWGLF/FORWARD/analysis2/AliFMDMCCorrector.cxx @@ -122,7 +122,7 @@ AliFMDMCCorrector::CorrectMC(AliForwardUtil::Histos& hists, //____________________________________________________________________ void -AliFMDMCCorrector::Init(const TAxis& eAxis) +AliFMDMCCorrector::SetupForData(const TAxis& eAxis) { // // Initialize this object @@ -130,7 +130,7 @@ AliFMDMCCorrector::Init(const TAxis& eAxis) // Parameters: // etaAxis Eta axis to use // - AliFMDCorrector::Init(eAxis); + AliFMDCorrector::SetupForData(eAxis); fFMD1i = Make(1,'I',eAxis); fFMD2i = Make(2,'I',eAxis); @@ -236,7 +236,7 @@ AliFMDMCCorrector::CompareResults(AliForwardUtil::Histos& esd, //____________________________________________________________________ void -AliFMDMCCorrector::DefineOutput(TList* dir) +AliFMDMCCorrector::CreateOutputObjects(TList* dir) { // // Output diagnostic histograms to directory @@ -244,7 +244,7 @@ AliFMDMCCorrector::DefineOutput(TList* dir) // Parameters: // dir List to write in // - AliFMDCorrector::DefineOutput(dir); + AliFMDCorrector::CreateOutputObjects(dir); TList* d = static_cast(dir->FindObject(GetName())); fComps = new TList; diff --git a/PWGLF/FORWARD/analysis2/AliFMDMCCorrector.h b/PWGLF/FORWARD/analysis2/AliFMDMCCorrector.h index f78a30267e9..d91f5c4dadb 100644 --- a/PWGLF/FORWARD/analysis2/AliFMDMCCorrector.h +++ b/PWGLF/FORWARD/analysis2/AliFMDMCCorrector.h @@ -116,7 +116,7 @@ public: * * @param etaAxis Eta axis to use */ - void Init(const TAxis& etaAxis); + void SetupForData(const TAxis& etaAxis); /** * Do the calculations * @@ -143,7 +143,7 @@ public: * * @param dir List to write in */ - void DefineOutput(TList* dir); + void CreateOutputObjects(TList* dir); /** * Print information @@ -180,7 +180,7 @@ protected: TList* fComps; // List of comparisons Bool_t fSecondaryForMC; // Whether to correct MC data - ClassDef(AliFMDMCCorrector,1); // Calculate Nch density + ClassDef(AliFMDMCCorrector,2); // Calculate Nch density }; #endif diff --git a/PWGLF/FORWARD/analysis2/AliFMDMCDensityCalculator.cxx b/PWGLF/FORWARD/analysis2/AliFMDMCDensityCalculator.cxx index 348ff61c2f0..5c31b604949 100644 --- a/PWGLF/FORWARD/analysis2/AliFMDMCDensityCalculator.cxx +++ b/PWGLF/FORWARD/analysis2/AliFMDMCDensityCalculator.cxx @@ -56,7 +56,7 @@ AliFMDMCDensityCalculator::operator=(const AliFMDMCDensityCalculator& o) //____________________________________________________________________ void -AliFMDMCDensityCalculator::Init(const TAxis& eAxis) +AliFMDMCDensityCalculator::SetupForData(const TAxis& eAxis) { // // Initialize this object @@ -64,7 +64,7 @@ AliFMDMCDensityCalculator::Init(const TAxis& eAxis) // Parameters: // etaAxis Eta axis to use // - AliFMDDensityCalculator::Init(eAxis); + AliFMDDensityCalculator::SetupForData(eAxis); fFMD1i = Make(1,'I',eAxis); fFMD2i = Make(2,'I',eAxis); fFMD2o = Make(2,'O',eAxis); @@ -298,7 +298,7 @@ AliFMDMCDensityCalculator::CompareResults(AliForwardUtil::Histos& esd, //____________________________________________________________________ void -AliFMDMCDensityCalculator::DefineOutput(TList* dir) +AliFMDMCDensityCalculator::CreateOutputObjects(TList* dir) { // // Output diagnostic histograms to directory @@ -306,7 +306,7 @@ AliFMDMCDensityCalculator::DefineOutput(TList* dir) // Parameters: // dir List to write in // - AliFMDDensityCalculator::DefineOutput(dir); + AliFMDDensityCalculator::CreateOutputObjects(dir); TList* d = static_cast(dir->FindObject(GetName())); fComps = new TList; diff --git a/PWGLF/FORWARD/analysis2/AliFMDMCDensityCalculator.h b/PWGLF/FORWARD/analysis2/AliFMDMCDensityCalculator.h index b6d866fbf31..0a0ded84fcc 100644 --- a/PWGLF/FORWARD/analysis2/AliFMDMCDensityCalculator.h +++ b/PWGLF/FORWARD/analysis2/AliFMDMCDensityCalculator.h @@ -129,7 +129,7 @@ public: * * @param etaAxis Eta axis to use */ - void Init(const TAxis& etaAxis); + void SetupForData(const TAxis& etaAxis); /** * Calculate the charged particle density from the MC track references. * @@ -158,7 +158,7 @@ public: * * @param dir List to write in */ - void DefineOutput(TList* dir); + void CreateOutputObjects(TList* dir); protected: /** * MAke comparison profiles @@ -216,7 +216,7 @@ protected: TH1D* fFMD3oD; // Correlation in FMD3o TList* fComps; // List of comparisons - ClassDef(AliFMDMCDensityCalculator,1); // Calculate Nch density + ClassDef(AliFMDMCDensityCalculator,2); // Calculate Nch density }; #endif diff --git a/PWGLF/FORWARD/analysis2/AliFMDMCEventInspector.cxx b/PWGLF/FORWARD/analysis2/AliFMDMCEventInspector.cxx index 1851f6e4bd3..02b4cc29a48 100644 --- a/PWGLF/FORWARD/analysis2/AliFMDMCEventInspector.cxx +++ b/PWGLF/FORWARD/analysis2/AliFMDMCEventInspector.cxx @@ -127,7 +127,7 @@ AliFMDMCEventInspector::operator=(const AliFMDMCEventInspector& o) //____________________________________________________________________ void -AliFMDMCEventInspector::Init(const TAxis& vtxAxis) +AliFMDMCEventInspector::SetupForData(const TAxis& vtxAxis) { // // Initialize the object @@ -135,7 +135,7 @@ AliFMDMCEventInspector::Init(const TAxis& vtxAxis) // Parameters: // vtxAxis Vertex axis in use // - AliFMDEventInspector::Init(vtxAxis); + AliFMDEventInspector::SetupForData(vtxAxis); Int_t maxPart = 450; Int_t maxBin = 225; diff --git a/PWGLF/FORWARD/analysis2/AliFMDMCEventInspector.h b/PWGLF/FORWARD/analysis2/AliFMDMCEventInspector.h index 622c1607eed..a041a9128a7 100644 --- a/PWGLF/FORWARD/analysis2/AliFMDMCEventInspector.h +++ b/PWGLF/FORWARD/analysis2/AliFMDMCEventInspector.h @@ -75,7 +75,7 @@ public: * * @param vtxAxis Vertex axis in use */ - void Init(const TAxis& vtxAxis); + void SetupForData(const TAxis& vtxAxis); /** * Process MC truth event. Note, returned values are the MC truth * values @@ -162,7 +162,7 @@ protected: TH2F* fHCentVsPart; // Centrality versus # participants TH2F* fHCentVsBin; // Centrality versus # binary collisions TString fProduction; // Production information - ClassDef(AliFMDMCEventInspector,3); // Inspect the event + ClassDef(AliFMDMCEventInspector,4); // Inspect the event }; #endif diff --git a/PWGLF/FORWARD/analysis2/AliFMDMCSharingFilter.cxx b/PWGLF/FORWARD/analysis2/AliFMDMCSharingFilter.cxx index 770c7c7fd62..1fe1c0a56a9 100644 --- a/PWGLF/FORWARD/analysis2/AliFMDMCSharingFilter.cxx +++ b/PWGLF/FORWARD/analysis2/AliFMDMCSharingFilter.cxx @@ -209,7 +209,7 @@ AliFMDMCSharingFilter::CompareResults(const AliESDFMD& esd, //____________________________________________________________________ void -AliFMDMCSharingFilter::DefineOutput(TList* dir) +AliFMDMCSharingFilter::CreateOutputObjects(TList* dir) { // // Define the output histograms. These are put in a sub list of the @@ -219,7 +219,7 @@ AliFMDMCSharingFilter::DefineOutput(TList* dir) // Parameters: // dir Directory to add to // - AliFMDSharingFilter::DefineOutput(dir); + AliFMDSharingFilter::CreateOutputObjects(dir); TList* d = static_cast(dir->FindObject(GetName())); TList* cd = new TList; cd->SetOwner(); @@ -231,12 +231,12 @@ AliFMDMCSharingFilter::DefineOutput(TList* dir) cd->Add(fFMD3i); cd->Add(fFMD3o); cd->Add(fOperComp); - fTrackDensity.DefineOutput(d); + fTrackDensity.CreateOutputObjects(d); } //____________________________________________________________________ void -AliFMDMCSharingFilter::ScaleHistograms(const TList* dir, Int_t nEvents) +AliFMDMCSharingFilter::Terminate(const TList* dir, TList* output, Int_t nEvents) { // // Scale the histograms to the total number of events @@ -245,7 +245,7 @@ AliFMDMCSharingFilter::ScaleHistograms(const TList* dir, Int_t nEvents) // dir Where the output is // nEvents Number of events // - AliFMDSharingFilter::ScaleHistograms(dir, nEvents); + AliFMDSharingFilter::Terminate(dir, output, nEvents); } //____________________________________________________________________ diff --git a/PWGLF/FORWARD/analysis2/AliFMDMCSharingFilter.h b/PWGLF/FORWARD/analysis2/AliFMDMCSharingFilter.h index fa3be6393ec..e23c0bae4df 100644 --- a/PWGLF/FORWARD/analysis2/AliFMDMCSharingFilter.h +++ b/PWGLF/FORWARD/analysis2/AliFMDMCSharingFilter.h @@ -34,7 +34,7 @@ * - For each ring (FMD1i, FMD2i, FMD2o, FMD3i, FMD3o) the distribution of * signals before and after the filter. * - For each ring (see above), an array of distributions of number of - * hit strips for each vertex bin (if enabled - see Init method) + * hit strips for each vertex bin (if enabled - see SetupForData method) * * * @ingroup pwglf_forward_algo @@ -128,14 +128,14 @@ public: * * @param dir Directory to add to */ - void DefineOutput(TList* dir); + void CreateOutputObjects(TList* dir); /** * Scale the histograms to the total number of events * * @param dir Where the output is * @param nEvents Number of events */ - void ScaleHistograms(const TList* dir, Int_t nEvents); + void Terminate(const TList* dir, TList* output, Int_t nEvents); /** * Print information * @@ -152,7 +152,7 @@ protected: TH2D* fFMD3i; // ESD-MC correlation TH2D* fFMD3o; // ESD-MC correlation TH2I* fOperComp; // Operation vs # trackrefs - ClassDef(AliFMDMCSharingFilter,1); // + ClassDef(AliFMDMCSharingFilter,2); // }; #endif diff --git a/PWGLF/FORWARD/analysis2/AliFMDMCTrackDensity.cxx b/PWGLF/FORWARD/analysis2/AliFMDMCTrackDensity.cxx index 44186164f4b..d1be374ce60 100644 --- a/PWGLF/FORWARD/analysis2/AliFMDMCTrackDensity.cxx +++ b/PWGLF/FORWARD/analysis2/AliFMDMCTrackDensity.cxx @@ -106,9 +106,9 @@ AliFMDMCTrackDensity::operator=(const AliFMDMCTrackDensity& o) //____________________________________________________________________ void -AliFMDMCTrackDensity::DefineOutput(TList* l) +AliFMDMCTrackDensity::CreateOutputObjects(TList* l) { - AliBaseMCTrackDensity::DefineOutput(l); + AliBaseMCTrackDensity::CreateOutputObjects(l); TList* ll = static_cast(l->FindObject(GetTitle())); if (!ll) ll = l; diff --git a/PWGLF/FORWARD/analysis2/AliFMDMCTrackDensity.h b/PWGLF/FORWARD/analysis2/AliFMDMCTrackDensity.h index d59493f6e54..3d34fbf178c 100644 --- a/PWGLF/FORWARD/analysis2/AliFMDMCTrackDensity.h +++ b/PWGLF/FORWARD/analysis2/AliFMDMCTrackDensity.h @@ -96,7 +96,7 @@ public: * * @param list List to add outputs to */ - void DefineOutput(TList* list); + void CreateOutputObjects(TList* list); void Print(Option_t* option="") const; protected: @@ -183,7 +183,7 @@ protected: TH2D* fNcr; // Number of clusters per track AliESDFMD* fOutput; //! Output ESD object - ClassDef(AliFMDMCTrackDensity,4); // Calculate track-ref density + ClassDef(AliFMDMCTrackDensity,5); // Calculate track-ref density }; #endif diff --git a/PWGLF/FORWARD/analysis2/AliFMDMultCuts.h b/PWGLF/FORWARD/analysis2/AliFMDMultCuts.h index c9e758cf899..ab0939658b5 100644 --- a/PWGLF/FORWARD/analysis2/AliFMDMultCuts.h +++ b/PWGLF/FORWARD/analysis2/AliFMDMultCuts.h @@ -141,7 +141,7 @@ protected: Double_t fNXi; // Times of Landau width Bool_t fIncludeSigma; // Include Gaussian variance - ClassDef(AliFMDMultCuts,2); // Cuts on ESD Mult + ClassDef(AliFMDMultCuts,3); // Cuts on ESD Mult }; #endif diff --git a/PWGLF/FORWARD/analysis2/AliFMDSharingFilter.cxx b/PWGLF/FORWARD/analysis2/AliFMDSharingFilter.cxx index de6d67ff92a..a83fdbf98e4 100644 --- a/PWGLF/FORWARD/analysis2/AliFMDSharingFilter.cxx +++ b/PWGLF/FORWARD/analysis2/AliFMDSharingFilter.cxx @@ -282,9 +282,9 @@ AliFMDSharingFilter::IsDead(UShort_t d, Char_t r, UShort_t s, UShort_t t) const } //____________________________________________________________________ void -AliFMDSharingFilter::Init(const TAxis& axis) +AliFMDSharingFilter::SetupForData(const TAxis& axis) { - // Initialise + // Initialise - called on first event DGUARD(fDebug,1, "Initialize for AliFMDSharingFilter"); AliForwardCorrectionManager& fcm = AliForwardCorrectionManager::Instance(); AliFMDCorrELossFit* fits = fcm.GetELossFit(); @@ -936,7 +936,7 @@ AliFMDSharingFilter::DeAngleCorrect(Double_t mult, Double_t eta) const //____________________________________________________________________ void -AliFMDSharingFilter::ScaleHistograms(const TList* dir, Int_t nEvents) +AliFMDSharingFilter::Terminate(const TList* dir, TList* output, Int_t nEvents) { // // Scale the histograms to the total number of events @@ -950,11 +950,19 @@ AliFMDSharingFilter::ScaleHistograms(const TList* dir, Int_t nEvents) TList* d = static_cast(dir->FindObject(GetName())); if (!d) return; + TList* out = new TList; + out->SetName(d->GetName()); + out->SetOwner(); + TIter next(&fRingHistos); RingHistos* o = 0; THStack* sums = new THStack("sums", "Sum of ring signals"); while ((o = static_cast(next()))) { - o->ScaleHistograms(d, nEvents); + o->Terminate(d, nEvents); + if (!o->fSum) { + Warning("Terminate", "No sum histogram found for ring %s", o->GetName()); + continue; + } TH1D* sum = o->fSum->ProjectionX(o->GetName(), 1, o->fSum->GetNbinsY(),"e"); sum->Scale(1., "width"); sum->SetTitle(o->GetName()); @@ -962,12 +970,13 @@ AliFMDSharingFilter::ScaleHistograms(const TList* dir, Int_t nEvents) sum->SetYTitle("#sum #Delta/#Delta_{mip}"); sums->Add(sum); } - d->Add(sums); + out->Add(sums); + output->Add(out); } //____________________________________________________________________ void -AliFMDSharingFilter::DefineOutput(TList* dir) +AliFMDSharingFilter::CreateOutputObjects(TList* dir) { // // Define the output histograms. These are put in a sub list of the @@ -1032,7 +1041,7 @@ AliFMDSharingFilter::DefineOutput(TList* dir) TIter next(&fRingHistos); RingHistos* o = 0; while ((o = static_cast(next()))) { - o->Output(d); + o->CreateOutputObjects(d); } } //____________________________________________________________________ @@ -1301,8 +1310,7 @@ AliFMDSharingFilter::RingHistos::Finish() //____________________________________________________________________ void -AliFMDSharingFilter::RingHistos::ScaleHistograms(const TList* dir, - Int_t nEvents) +AliFMDSharingFilter::RingHistos::Terminate(const TList* dir, Int_t nEvents) { // // Scale the histograms to the total number of events @@ -1323,12 +1331,12 @@ AliFMDSharingFilter::RingHistos::ScaleHistograms(const TList* dir, TH2D* summed = static_cast(l->FindObject("summed")); if (summed) summed->Scale(1./nEvents); - + fSum = summed; } //____________________________________________________________________ void -AliFMDSharingFilter::RingHistos::Output(TList* dir) +AliFMDSharingFilter::RingHistos::CreateOutputObjects(TList* dir) { // // Make output diff --git a/PWGLF/FORWARD/analysis2/AliFMDSharingFilter.h b/PWGLF/FORWARD/analysis2/AliFMDSharingFilter.h index 080d465ea57..27080d65b7d 100644 --- a/PWGLF/FORWARD/analysis2/AliFMDSharingFilter.h +++ b/PWGLF/FORWARD/analysis2/AliFMDSharingFilter.h @@ -46,7 +46,7 @@ class AliFMDFloatMap; * - For each ring (FMD1i, FMD2i, FMD2o, FMD3i, FMD3o) the distribution of * signals before and after the filter. * - For each ring (see above), an array of distributions of number of - * hit strips for each vertex bin (if enabled - see Init method) + * hit strips for each vertex bin (if enabled - see SetupForData method) * * * @ingroup pwglf_forward_algo @@ -100,7 +100,7 @@ public: * * @param axis Default eta axis from parent task */ - void Init(const TAxis& axis); + void SetupForData(const TAxis& axis); /** * Set the debug level. The higher the value the more output * @@ -167,7 +167,7 @@ public: * @param dir Where the output is * @param nEvents Number of events */ - virtual void ScaleHistograms(const TList* dir, Int_t nEvents); + virtual void Terminate(const TList* dir, TList* output, Int_t nEvents); /** * Define the output histograms. These are put in a sub list of the @@ -176,7 +176,7 @@ public: * * @param dir Directory to add to */ - virtual void DefineOutput(TList* dir); + virtual void CreateOutputObjects(TList* dir); /** * Print information * @@ -278,14 +278,14 @@ protected: * * @param dir where to store */ - void Output(TList* dir); + void CreateOutputObjects(TList* dir); /** * Scale the histograms to the total number of events * * @param nEvents Number of events * @param dir Where the output is */ - void ScaleHistograms(const TList* dir, Int_t nEvents); + void Terminate(const TList* dir, Int_t nEvents); TH1D* fBefore; // Distribution of signals before filter TH1D* fAfter; // Distribution of signals after filter TH1D* fSingle; // Distribution of 1 signal after filter @@ -300,7 +300,7 @@ protected: TH2D* fSum; // Summed signal TH1D* fHits; // Distribution of hit strips. Int_t fNHits; // Number of hit strips per event - ClassDef(RingHistos,1); + ClassDef(RingHistos,2); }; /** * Get the ring histogram container @@ -447,7 +447,7 @@ protected: Bool_t fThreeStripSharing; //In case of simple sharing allow 3 strips Bool_t fRecalculateEta; //Whether to recalculate eta and angle correction (disp vtx) TArrayI fExtraDead; // List of extra dead channels - ClassDef(AliFMDSharingFilter,5); // + ClassDef(AliFMDSharingFilter,6); // }; #endif diff --git a/PWGLF/FORWARD/analysis2/AliForwardCreateResponseMatrices.cxx b/PWGLF/FORWARD/analysis2/AliForwardCreateResponseMatrices.cxx index 40a76111b71..6f70e8291f8 100644 --- a/PWGLF/FORWARD/analysis2/AliForwardCreateResponseMatrices.cxx +++ b/PWGLF/FORWARD/analysis2/AliForwardCreateResponseMatrices.cxx @@ -76,7 +76,7 @@ void AliForwardCreateResponseMatrices::UserCreateOutputObjects() TIter next(&fBins); Bin * bin = 0; while ((bin = static_cast(next()))) { - bin->DefineOutputs(fOutput, 400); + bin->CreateOutputObjectss(fOutput, 400); } PostData(1, fOutput); @@ -270,7 +270,7 @@ AliForwardCreateResponseMatrices::Bin::Bin() // } //_____________________________________________________________________ -void AliForwardCreateResponseMatrices::Bin::DefineOutputs(TList* cont, Int_t max) +void AliForwardCreateResponseMatrices::Bin::CreateOutputObjectss(TList* cont, Int_t max) { // // Define eta bin output histos diff --git a/PWGLF/FORWARD/analysis2/AliForwardCreateResponseMatrices.h b/PWGLF/FORWARD/analysis2/AliForwardCreateResponseMatrices.h index 65a565e6680..7ee374a58c9 100644 --- a/PWGLF/FORWARD/analysis2/AliForwardCreateResponseMatrices.h +++ b/PWGLF/FORWARD/analysis2/AliForwardCreateResponseMatrices.h @@ -73,7 +73,7 @@ public: /** * Define outputs of a single eta bin */ - virtual void DefineOutputs(TList* cont, Int_t max); + virtual void CreateOutputObjectss(TList* cont, Int_t max); /** * Process a single eta bin */ @@ -97,7 +97,7 @@ public: TH1D* fMCNSD; //number of events found as NSD by the MC truth vs. multiplicity TH1D* fMCESDNSD; //number of events found as NSD by both analysis and MC truth vs. multiplicity TH1D* fTriggerBias; // histogram for trigger vertex bias correction - ClassDef(Bin,1); // Manager of data + ClassDef(Bin,2); // Manager of data }; /** * Create Output Objects @@ -129,7 +129,7 @@ public: TH1I* fTrigger; //Trigger histogram TList fBins; // List of eta bins TList* fOutput; // Output list - ClassDef(AliForwardCreateResponseMatrices, 1); + ClassDef(AliForwardCreateResponseMatrices, 2); }; #endif diff --git a/PWGLF/FORWARD/analysis2/AliForwardFlowTaskQC.h b/PWGLF/FORWARD/analysis2/AliForwardFlowTaskQC.h index e500728cb44..a67473b559a 100644 --- a/PWGLF/FORWARD/analysis2/AliForwardFlowTaskQC.h +++ b/PWGLF/FORWARD/analysis2/AliForwardFlowTaskQC.h @@ -255,7 +255,7 @@ public: TH2F* fOutliers; // Sigma histogram UShort_t fDebug; // Debug flag - ClassDef(VertexBin, 1); // object for cumulants ananlysis in FMD + ClassDef(VertexBin, 2); // object for cumulants ananlysis in FMD }; static Bool_t fgDispVtx; // static flag for disp vtx @@ -373,7 +373,7 @@ protected: TH1D* fHistCent; // Diagnostics hist for centrality TH1D* fHistVertexSel; // Diagnostics hist for selected vertices - ClassDef(AliForwardFlowTaskQC, 1); // Analysis task for FMD analysis + ClassDef(AliForwardFlowTaskQC, 2); // Analysis task for FMD analysis }; #endif diff --git a/PWGLF/FORWARD/analysis2/AliForwardFlowWeights.h b/PWGLF/FORWARD/analysis2/AliForwardFlowWeights.h index 2da8752bd02..1e94b314027 100644 --- a/PWGLF/FORWARD/analysis2/AliForwardFlowWeights.h +++ b/PWGLF/FORWARD/analysis2/AliForwardFlowWeights.h @@ -175,7 +175,7 @@ protected: TGraph* fV2B; // Contribution from v2 as a function of b TGraph* fV2C; // Contribution from v2 as a function of centrality - ClassDef(AliForwardFlowWeights,1); + ClassDef(AliForwardFlowWeights,2); }; #endif diff --git a/PWGLF/FORWARD/analysis2/AliForwardMCCorrectionsTask.cxx b/PWGLF/FORWARD/analysis2/AliForwardMCCorrectionsTask.cxx index f40451f6da7..46ab70906cf 100644 --- a/PWGLF/FORWARD/analysis2/AliForwardMCCorrectionsTask.cxx +++ b/PWGLF/FORWARD/analysis2/AliForwardMCCorrectionsTask.cxx @@ -258,7 +258,7 @@ AliForwardMCCorrectionsTask::DefineBins(TList* l) Double_t high = fVtxAxis.GetBinUpEdge(i); VtxBin* bin = new VtxBin(low, high, fEtaAxis); fVtxBins->AddAt(bin, i); - bin->DefineOutput(l); + bin->CreateOutputObjects(l); } } @@ -326,8 +326,8 @@ AliForwardMCCorrectionsTask::UserCreateOutputObjects() AliInfo(Form("Initialising sub-routines: %p, %p", &fInspector, &fTrackDensity)); - fInspector.DefineOutput(fList); - fTrackDensity.DefineOutput(fList); + fInspector.CreateOutputObjects(fList); + fTrackDensity.CreateOutputObjects(fList); PostData(1, fList); } @@ -356,6 +356,9 @@ AliForwardMCCorrectionsTask::UserExec(Option_t*) return; } + // --- Read in the data -------------------------------------------- + LoadBranches(); + //--- Read run information ----------------------------------------- if (fFirstEvent && esd->GetESDRun()) { fInspector.ReadRunDetails(esd); @@ -372,7 +375,7 @@ AliForwardMCCorrectionsTask::UserExec(Option_t*) esd->GetMagneticField(), esd->GetRunNumber())); - fInspector.Init(fVtxAxis); + fInspector.SetupForData(fVtxAxis); Print(); fFirstEvent = false; @@ -483,7 +486,7 @@ AliForwardMCCorrectionsTask::Terminate(Option_t*) VtxBin* bin = 0; UShort_t iVz = 1; while ((bin = static_cast(next()))) - bin->Finish(fList, output, iVz++, corr); + bin->Terminate(fList, output, iVz++, corr); output->Add(corr); @@ -594,7 +597,7 @@ AliForwardMCCorrectionsTask::VtxBin::operator=(const VtxBin& o) //____________________________________________________________________ void -AliForwardMCCorrectionsTask::VtxBin::DefineOutput(TList* l) +AliForwardMCCorrectionsTask::VtxBin::CreateOutputObjects(TList* l) { TList* d = new TList; d->SetName(GetName()); @@ -628,7 +631,7 @@ AliForwardMCCorrectionsTask::VtxBin::MakeBg(const TH2D* hits, //____________________________________________________________________ void -AliForwardMCCorrectionsTask::VtxBin::Finish(const TList* input, +AliForwardMCCorrectionsTask::VtxBin::Terminate(const TList* input, TList* output, UShort_t iVz, AliFMDCorrSecondaryMap* map) diff --git a/PWGLF/FORWARD/analysis2/AliForwardMCCorrectionsTask.h b/PWGLF/FORWARD/analysis2/AliForwardMCCorrectionsTask.h index e2bd87ce296..b7eb231ba33 100644 --- a/PWGLF/FORWARD/analysis2/AliForwardMCCorrectionsTask.h +++ b/PWGLF/FORWARD/analysis2/AliForwardMCCorrectionsTask.h @@ -205,7 +205,7 @@ protected: * * @param list List to put output in */ - void DefineOutput(TList* list); + void CreateOutputObjects(TList* list); /** * Calculate the background correction * @@ -223,7 +223,7 @@ protected: * @param iVz Vertex bin * @param map Corrections map */ - void Finish(const TList* i, + void Terminate(const TList* i, TList* o, UShort_t iVz, AliFMDCorrSecondaryMap* map); @@ -232,7 +232,7 @@ protected: TH2D* fPrimary; // Cache or primary TH1D* fCounts; // Event count - ClassDef(VtxBin,1); // Vertex bin + ClassDef(VtxBin,2); // Vertex bin }; /** * Define our vertex bins @@ -254,7 +254,7 @@ protected: TAxis fEtaAxis; // Eta axis TList* fList; // Output list - ClassDef(AliForwardMCCorrectionsTask,1) // Forward corrections class + ClassDef(AliForwardMCCorrectionsTask,2) // Forward corrections class }; #endif diff --git a/PWGLF/FORWARD/analysis2/AliForwardMCFlowTaskQC.h b/PWGLF/FORWARD/analysis2/AliForwardMCFlowTaskQC.h index 6c0659561a5..a5381d9c712 100644 --- a/PWGLF/FORWARD/analysis2/AliForwardMCFlowTaskQC.h +++ b/PWGLF/FORWARD/analysis2/AliForwardMCFlowTaskQC.h @@ -155,7 +155,7 @@ protected: Int_t fAddType; // Add flow type # Int_t fAddOrder; // Add flow order - ClassDef(AliForwardMCFlowTaskQC, 2); // FMD MC analysis task + ClassDef(AliForwardMCFlowTaskQC, 3); // FMD MC analysis task }; #endif diff --git a/PWGLF/FORWARD/analysis2/AliForwardMCMultiplicityTask.cxx b/PWGLF/FORWARD/analysis2/AliForwardMCMultiplicityTask.cxx index a7a6756c87b..8c84a92196b 100644 --- a/PWGLF/FORWARD/analysis2/AliForwardMCMultiplicityTask.cxx +++ b/PWGLF/FORWARD/analysis2/AliForwardMCMultiplicityTask.cxx @@ -84,6 +84,7 @@ AliForwardMCMultiplicityTask::AliForwardMCMultiplicityTask(const char* name) // name Name of task // DefineOutput(1, TList::Class()); + DefineOutput(2, TList::Class()); } //____________________________________________________________________ @@ -115,6 +116,7 @@ AliForwardMCMultiplicityTask::AliForwardMCMultiplicityTask(const AliForwardMCMul // o Object to copy from // DefineOutput(1, TList::Class()); + DefineOutput(2, TList::Class()); } //____________________________________________________________________ @@ -180,7 +182,7 @@ AliForwardMCMultiplicityTask::SetOnlyPrimary(Bool_t use) //____________________________________________________________________ Bool_t -AliForwardMCMultiplicityTask::InitializeSubs() +AliForwardMCMultiplicityTask::SetupForData() { // // Initialise the sub objects and stuff. Called on first event @@ -237,12 +239,12 @@ AliForwardMCMultiplicityTask::InitializeSubs() fMCRingSums.Get(3, 'I')->SetMarkerColor(AliForwardUtil::RingColor(3, 'I')); fMCRingSums.Get(3, 'O')->SetMarkerColor(AliForwardUtil::RingColor(3, 'O')); - fEventInspector.Init(*pv); - fSharingFilter.Init(*pe); - fDensityCalculator.Init(*pe); - fCorrections.Init(*pe); - fHistCollector.Init(*pv,*pe); - fEventPlaneFinder.Init(*pe); + fEventInspector.SetupForData(*pv); + fSharingFilter.SetupForData(*pe); + fDensityCalculator.SetupForData(*pe); + fCorrections.SetupForData(*pe); + fHistCollector.SetupForData(*pv,*pe); + fEventPlaneFinder.SetupForData(*pe); this->Print(); @@ -285,12 +287,12 @@ AliForwardMCMultiplicityTask::UserCreateOutputObjects() fPrimary->SetDirectory(0); ah->AddBranch("TH2D", &fPrimary); - fEventInspector.DefineOutput(fList); - fSharingFilter.DefineOutput(fList); - fDensityCalculator.DefineOutput(fList); - fCorrections.DefineOutput(fList); - fHistCollector.DefineOutput(fList); - fEventPlaneFinder.DefineOutput(fList); + fEventInspector.CreateOutputObjects(fList); + fSharingFilter.CreateOutputObjects(fList); + fDensityCalculator.CreateOutputObjects(fList); + fCorrections.CreateOutputObjects(fList); + fHistCollector.CreateOutputObjects(fList); + fEventPlaneFinder.CreateOutputObjects(fList); PostData(1, fList); } @@ -404,7 +406,7 @@ AliForwardMCMultiplicityTask::UserExec(Option_t*) fSharingFilter.CompareResults(fESDFMD, fMCESDFMD); // Calculate the inclusive charged particle density - if (!fDensityCalculator.Calculate(fESDFMD, fHistos, lowFlux, cent, ip.Z())) { + if (!fDensityCalculator.Calculate(fESDFMD, fHistos, lowFlux, cent, ip)) { AliWarning("Density calculator failed!"); return; } @@ -464,14 +466,21 @@ AliForwardMCMultiplicityTask::Terminate(Option_t*) return; } + // Output list + TList* output = new TList; + output->SetOwner(); + output->SetName(Form("%sResults", GetName())); + Double_t nTr = 0, nTrVtx = 0, nAcc = 0; - MakeSimpledNdeta(list, list, nTr, nTrVtx, nAcc); - MakeRingdNdeta(list, "ringSums", list, "ringResults"); - MakeRingdNdeta(list, "mcRingSums", list, "mcRingResults", 24); + MakeSimpledNdeta(list, output, nTr, nTrVtx, nAcc); + MakeRingdNdeta(list, "ringSums", output, "ringResults"); + MakeRingdNdeta(list, "mcRingSums", output, "mcRingResults", 24); + + fSharingFilter.Terminate(list,output,Int_t(nTr)); + fDensityCalculator.Terminate(list,output,Int_t(nTrVtx)); + fCorrections.Terminate(list,output,Int_t(nTrVtx)); - fSharingFilter.ScaleHistograms(list,Int_t(nTr)); - fDensityCalculator.ScaleHistograms(list,Int_t(nTrVtx)); - fCorrections.ScaleHistograms(list,Int_t(nTrVtx)); + PostData(2, output); } diff --git a/PWGLF/FORWARD/analysis2/AliForwardMCMultiplicityTask.h b/PWGLF/FORWARD/analysis2/AliForwardMCMultiplicityTask.h index 20c7a229724..b60b86a1b66 100644 --- a/PWGLF/FORWARD/analysis2/AliForwardMCMultiplicityTask.h +++ b/PWGLF/FORWARD/analysis2/AliForwardMCMultiplicityTask.h @@ -198,7 +198,7 @@ protected: * * @return false on errors */ - virtual Bool_t InitializeSubs(); + virtual Bool_t SetupForData(); TH2D* fHData; // Summed 1/Nd^2N_{ch}/dphideta AliESDFMD fESDFMD; // Sharing corrected ESD object @@ -221,7 +221,7 @@ protected: TList* fList; // Output list - ClassDef(AliForwardMCMultiplicityTask,1) // Forward multiplicity class + ClassDef(AliForwardMCMultiplicityTask,2) // Forward multiplicity class }; #endif diff --git a/PWGLF/FORWARD/analysis2/AliForwardMultiplicityBase.cxx b/PWGLF/FORWARD/analysis2/AliForwardMultiplicityBase.cxx index 71658caed23..05620cb06b0 100644 --- a/PWGLF/FORWARD/analysis2/AliForwardMultiplicityBase.cxx +++ b/PWGLF/FORWARD/analysis2/AliForwardMultiplicityBase.cxx @@ -207,26 +207,29 @@ AliForwardMultiplicityBase::GetESDEvent() return 0; } + // --- Load the data ----------------------------------------------- + LoadBranches(); + // 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", - esd->GetBeamEnergy(), - esd->GetBeamType(), - esd->GetCurrentL3(), - esd->GetMagneticField(), - esd->GetRunNumber())); - + " AliESDEvent::GetBeamEnergy() ->%f\n" + " AliESDEvent::GetBeamType() ->%s\n" + " AliESDEvent::GetCurrentL3() ->%f\n" + " AliESDEvent::GetMagneticField()->%f\n" + " AliESDEvent::GetRunNumber() ->%d", + esd->GetBeamEnergy(), + esd->GetBeamType(), + esd->GetCurrentL3(), + esd->GetMagneticField(), + esd->GetRunNumber())); + fFirstEvent = false; - + GetEventPlaneFinder().SetRunNumber(esd->GetRunNumber()); - if (!InitializeSubs()) { + if (!SetupForData()) { AliError("Failed to initialize sub-algorithms, making this a zombie"); esd = 0; // Make sure we do nothing on this event Info("GetESDEvent", "ESD event pointer %p", esd); diff --git a/PWGLF/FORWARD/analysis2/AliForwardMultiplicityBase.h b/PWGLF/FORWARD/analysis2/AliForwardMultiplicityBase.h index 0dbba2850c1..2e0eef26684 100644 --- a/PWGLF/FORWARD/analysis2/AliForwardMultiplicityBase.h +++ b/PWGLF/FORWARD/analysis2/AliForwardMultiplicityBase.h @@ -289,7 +289,7 @@ protected: * * @return false on errors */ - virtual Bool_t InitializeSubs() = 0; + virtual Bool_t SetupForData() = 0; /** * Mark this event as one to store in the AOD * @@ -337,7 +337,7 @@ private: */ AliForwardCorrectionManager* fCorrManager; // Pointer to corrections manager - ClassDef(AliForwardMultiplicityBase,2) // Forward multiplicity class + ClassDef(AliForwardMultiplicityBase,3) // Forward multiplicity class }; #endif diff --git a/PWGLF/FORWARD/analysis2/AliForwardMultiplicityDistribution.cxx b/PWGLF/FORWARD/analysis2/AliForwardMultiplicityDistribution.cxx index a7117dd4f0d..8c2418254c8 100644 --- a/PWGLF/FORWARD/analysis2/AliForwardMultiplicityDistribution.cxx +++ b/PWGLF/FORWARD/analysis2/AliForwardMultiplicityDistribution.cxx @@ -78,7 +78,7 @@ void AliForwardMultiplicityDistribution::UserCreateOutputObjects() TIter next(&fBins); Bin * bin = 0; while ((bin = static_cast(next()))) { - bin->DefineOutputs(fOutput, fNBins); + bin->CreateOutputObjectss(fOutput, fNBins); } //fOutput->ls(); PostData(1, fOutput); @@ -260,7 +260,7 @@ AliForwardMultiplicityDistribution::Bin::Bin(Double_t etaLow, Double_t etaHigh) } //_____________________________________________________________________ -void AliForwardMultiplicityDistribution::Bin::DefineOutputs(TList* cont, Int_t max) +void AliForwardMultiplicityDistribution::Bin::CreateOutputObjectss(TList* cont, Int_t max) { // // Define eta bin output histograms diff --git a/PWGLF/FORWARD/analysis2/AliForwardMultiplicityDistribution.h b/PWGLF/FORWARD/analysis2/AliForwardMultiplicityDistribution.h index a916d9a1471..0ce4511a780 100644 --- a/PWGLF/FORWARD/analysis2/AliForwardMultiplicityDistribution.h +++ b/PWGLF/FORWARD/analysis2/AliForwardMultiplicityDistribution.h @@ -66,7 +66,7 @@ public: /** * Define outputs of a single eta bin */ - virtual void DefineOutputs(TList* cont, Int_t max); + virtual void CreateOutputObjectss(TList* cont, Int_t max); /** * Process a single eta bin */ @@ -86,7 +86,7 @@ public: // BinContent of 1 shows a hole, and BinContent of 10 shows data coverage TH2D* fVtxZvsNdataBins; // VtxZ vs. number of data acceptance bins (normalised to the eta range) - ClassDef(Bin,1); // Manager of data + ClassDef(Bin,2); // Manager of data }; /** * Create Output Objects @@ -132,7 +132,7 @@ protected: Int_t fHighCent; // upper centrality limit Int_t fNBins; // multiplicity axis' runs from 0 to fNbins TH1D* fCent; // centrality - ClassDef(AliForwardMultiplicityDistribution, 1); + ClassDef(AliForwardMultiplicityDistribution, 2); }; #endif diff --git a/PWGLF/FORWARD/analysis2/AliForwardMultiplicityTask.cxx b/PWGLF/FORWARD/analysis2/AliForwardMultiplicityTask.cxx index 4ab265271af..99c11b9b0bb 100644 --- a/PWGLF/FORWARD/analysis2/AliForwardMultiplicityTask.cxx +++ b/PWGLF/FORWARD/analysis2/AliForwardMultiplicityTask.cxx @@ -75,6 +75,7 @@ AliForwardMultiplicityTask::AliForwardMultiplicityTask(const char* name) // DGUARD(fDebug, 3,"named CTOR of AliForwardMultiplicityTask: %s", name); DefineOutput(1, TList::Class()); + DefineOutput(2, TList::Class()); } //____________________________________________________________________ @@ -102,6 +103,7 @@ AliForwardMultiplicityTask::AliForwardMultiplicityTask(const AliForwardMultiplic // DGUARD(fDebug, 3,"Copy CTOR of AliForwardMultiplicityTask"); DefineOutput(1, TList::Class()); + DefineOutput(2, TList::Class()); } //____________________________________________________________________ @@ -157,7 +159,7 @@ AliForwardMultiplicityTask::SetDebug(Int_t dbg) //____________________________________________________________________ Bool_t -AliForwardMultiplicityTask::InitializeSubs() +AliForwardMultiplicityTask::SetupForData() { // // Initialise the sub objects and stuff. Called on first event @@ -195,12 +197,12 @@ AliForwardMultiplicityTask::InitializeSubs() fRingSums.Get(3, 'I')->SetMarkerColor(AliForwardUtil::RingColor(3, 'I')); fRingSums.Get(3, 'O')->SetMarkerColor(AliForwardUtil::RingColor(3, 'O')); - fEventInspector.Init(*pv); - fSharingFilter.Init(*pe); - fDensityCalculator.Init(*pe); - fCorrections.Init(*pe); - fHistCollector.Init(*pv,*pe); - fEventPlaneFinder.Init(*pe); + fEventInspector.SetupForData(*pv); + fSharingFilter.SetupForData(*pe); + fDensityCalculator.SetupForData(*pe); + fCorrections.SetupForData(*pe); + fHistCollector.SetupForData(*pv,*pe); + fEventPlaneFinder.SetupForData(*pe); this->Print(); return true; @@ -229,12 +231,12 @@ AliForwardMultiplicityTask::UserCreateOutputObjects() TObject* epobj = &fAODEP; ah->AddBranch("AliAODForwardEP", &epobj); - fEventInspector.DefineOutput(fList); - fSharingFilter.DefineOutput(fList); - fDensityCalculator.DefineOutput(fList); - fCorrections.DefineOutput(fList); - fHistCollector.DefineOutput(fList); - fEventPlaneFinder.DefineOutput(fList); + fEventInspector.CreateOutputObjects(fList); + fSharingFilter.CreateOutputObjects(fList); + fDensityCalculator.CreateOutputObjects(fList); + fCorrections.CreateOutputObjects(fList); + fHistCollector.CreateOutputObjects(fList); + fEventPlaneFinder.CreateOutputObjects(fList); PostData(1, fList); } @@ -366,13 +368,19 @@ AliForwardMultiplicityTask::Terminate(Option_t*) return; } + TList* output = new TList; + output->SetName(Form("%sResults", GetName())); + output->SetOwner(); + Double_t nTr = 0, nTrVtx = 0, nAcc = 0; - MakeSimpledNdeta(list, list, nTr, nTrVtx, nAcc); - MakeRingdNdeta(list, "ringSums", list, "ringResults"); + MakeSimpledNdeta(list, output, nTr, nTrVtx, nAcc); + MakeRingdNdeta(list, "ringSums", output, "ringResults"); + + fSharingFilter.Terminate(list,output,Int_t(nTr)); + fDensityCalculator.Terminate(list,output,Int_t(nTrVtx)); + fCorrections.Terminate(list,output,Int_t(nTrVtx)); - fSharingFilter.ScaleHistograms(list,Int_t(nTr)); - fDensityCalculator.ScaleHistograms(list,Int_t(nTrVtx)); - fCorrections.ScaleHistograms(list,Int_t(nTrVtx)); + PostData(2, output); } // diff --git a/PWGLF/FORWARD/analysis2/AliForwardMultiplicityTask.h b/PWGLF/FORWARD/analysis2/AliForwardMultiplicityTask.h index 44de2507637..37533256c6c 100644 --- a/PWGLF/FORWARD/analysis2/AliForwardMultiplicityTask.h +++ b/PWGLF/FORWARD/analysis2/AliForwardMultiplicityTask.h @@ -194,7 +194,7 @@ protected: * * @return false on errors */ - virtual Bool_t InitializeSubs(); + virtual Bool_t SetupForData(); TH2D* fHData; // Summed 1/Nd^2N_{ch}/dphideta AliESDFMD fESDFMD; // Sharing corrected ESD object @@ -212,7 +212,7 @@ protected: TList* fList; // Output list - ClassDef(AliForwardMultiplicityTask,1) // Forward multiplicity class + ClassDef(AliForwardMultiplicityTask,2) // Forward multiplicity class }; #endif diff --git a/PWGLF/FORWARD/analysis2/AliForwardQATask.cxx b/PWGLF/FORWARD/analysis2/AliForwardQATask.cxx index 394e81a830d..d17b88f293f 100644 --- a/PWGLF/FORWARD/analysis2/AliForwardQATask.cxx +++ b/PWGLF/FORWARD/analysis2/AliForwardQATask.cxx @@ -258,7 +258,7 @@ AliForwardQATask::GetESDEvent() esd->GetRunNumber()); - if (!InitializeSubs()) { + if (!SetupForData()) { AliWarning("Initialisation of sub algorithms failed!"); SetZombie(true); esd = 0; @@ -272,7 +272,7 @@ AliForwardQATask::GetESDEvent() } //____________________________________________________________________ Bool_t -AliForwardQATask::InitializeSubs() +AliForwardQATask::SetupForData() { // // Initialise the sub objects and stuff. Called on first event @@ -289,10 +289,10 @@ AliForwardQATask::InitializeSubs() fHistos.Init(*pe); - fEventInspector.Init(*pv); - fEnergyFitter.Init(*pe); - fSharingFilter.Init(*pe); - fDensityCalculator.Init(*pe); + fEventInspector.SetupForData(*pv); + fEnergyFitter.SetupForData(*pe); + fSharingFilter.SetupForData(*pe); + fDensityCalculator.SetupForData(*pe); this->Print(); @@ -310,10 +310,10 @@ AliForwardQATask::UserCreateOutputObjects() fList = new TList; fList->SetOwner(); - fEventInspector.DefineOutput(fList); - fEnergyFitter.DefineOutput(fList); - fSharingFilter.DefineOutput(fList); - fDensityCalculator.DefineOutput(fList); + fEventInspector.CreateOutputObjects(fList); + fEnergyFitter.CreateOutputObjects(fList); + fSharingFilter.CreateOutputObjects(fList); + fDensityCalculator.CreateOutputObjects(fList); PostData(1, fList); } @@ -424,6 +424,11 @@ AliForwardQATask::Terminate(Option_t*) return; } + // Make a deep copy and post that as output 2 + TList* list2 = static_cast(list->Clone(Form("%sResults", + list->GetName()))); + list2->SetOwner(); + // Get our histograms from the container TH1I* hEventsTr = 0;//static_cast(list->FindObject("nEventsTr")); TH1I* hEventsTrVtx = 0;//static_cast(list->FindObject("nEventsTrVtx")); @@ -447,21 +452,18 @@ AliForwardQATask::Terminate(Option_t*) AliInfoF("Fitting took %d real-time seconds, and %f CPU seconds", Int_t(swf.RealTime()), swf.CpuTime()); - fSharingFilter.ScaleHistograms(list,Int_t(hEventsTr->Integral())); - fDensityCalculator.ScaleHistograms(list,Int_t(hEventsTrVtx->Integral())); + fSharingFilter.Terminate(list,list2,Int_t(hEventsTr->Integral())); + fDensityCalculator.Terminate(list,list2,Int_t(hEventsTrVtx->Integral())); - // Make a deep copy and post that as output 2 - TList* list2 = static_cast(list->Clone(Form("%sResults", - list->GetName()))); if (fDebug) AliInfoF("Posting post processing results to %s", list2->GetName()); - list2->SetOwner(); PostData(2, list2); swt.Stop(); AliInfoF("Terminate took %d real-time seconds, and %f CPU seconds", Int_t(swt.RealTime()), swt.CpuTime()); + } //____________________________________________________________________ diff --git a/PWGLF/FORWARD/analysis2/AliForwardQATask.h b/PWGLF/FORWARD/analysis2/AliForwardQATask.h index eea8013bba6..24b3250e5de 100644 --- a/PWGLF/FORWARD/analysis2/AliForwardQATask.h +++ b/PWGLF/FORWARD/analysis2/AliForwardQATask.h @@ -193,7 +193,7 @@ protected: * Initialise the sub objects and stuff. Called on first event * @return false on error. */ - virtual Bool_t InitializeSubs(); + virtual Bool_t SetupForData(); Bool_t fEnableLowFlux;// Whether to use low-flux specific code Bool_t fFirstEvent; // Whether the event is the first seen @@ -216,7 +216,7 @@ protected: TList* fList; // Output list Int_t fDebug; // Debug flag - ClassDef(AliForwardQATask,1) // Forward QA class + ClassDef(AliForwardQATask,2) // Forward QA class }; #endif diff --git a/PWGLF/FORWARD/analysis2/AliForwardUtil.h b/PWGLF/FORWARD/analysis2/AliForwardUtil.h index 86bcbcb22cf..6a61ddcf8f3 100644 --- a/PWGLF/FORWARD/analysis2/AliForwardUtil.h +++ b/PWGLF/FORWARD/analysis2/AliForwardUtil.h @@ -644,7 +644,7 @@ public: TH2D* fFMD3i; // Histogram for FMD3i TH2D* fFMD3o; // Histogram for FMD3o - ClassDef(Histos,1) + ClassDef(Histos,2) }; //__________________________________________________________________ diff --git a/PWGLF/FORWARD/analysis2/AliForwarddNdetaTask.h b/PWGLF/FORWARD/analysis2/AliForwarddNdetaTask.h index 0e2026a03aa..a80b733c69c 100644 --- a/PWGLF/FORWARD/analysis2/AliForwarddNdetaTask.h +++ b/PWGLF/FORWARD/analysis2/AliForwarddNdetaTask.h @@ -161,10 +161,10 @@ protected: TList* mclist, TList* truthlist); protected: - ClassDef(CentralityBin,2); // A centrality bin + ClassDef(CentralityBin,3); // A centrality bin }; - ClassDef(AliForwarddNdetaTask,2); // Determine multiplicity in forward region + ClassDef(AliForwarddNdetaTask,3); // Determine multiplicity in forward region }; #endif diff --git a/PWGLF/FORWARD/analysis2/AliMCTruthdNdetaTask.h b/PWGLF/FORWARD/analysis2/AliMCTruthdNdetaTask.h index 295bfdec3d3..5b7f8fbfd62 100644 --- a/PWGLF/FORWARD/analysis2/AliMCTruthdNdetaTask.h +++ b/PWGLF/FORWARD/analysis2/AliMCTruthdNdetaTask.h @@ -196,10 +196,10 @@ protected: TList* truthlist); protected: TH2D* fSumTruth; // Sum of primary histograms - ClassDef(CentralityBin,1); // A centrality bin + ClassDef(CentralityBin,2); // A centrality bin }; Bool_t fHasData; // whether we actually have data or not - ClassDef(AliMCTruthdNdetaTask,1); // Determine multiplicity in forward region + ClassDef(AliMCTruthdNdetaTask,2); // Determine multiplicity in forward region }; #endif diff --git a/PWGLF/FORWARD/analysis2/AliSPDMCTrackDensity.h b/PWGLF/FORWARD/analysis2/AliSPDMCTrackDensity.h index 9802e0df188..4584478f0fb 100644 --- a/PWGLF/FORWARD/analysis2/AliSPDMCTrackDensity.h +++ b/PWGLF/FORWARD/analysis2/AliSPDMCTrackDensity.h @@ -126,7 +126,7 @@ protected: AliTrackReference* fStored; //! Last stored TH2D* fOutput; //! Output - ClassDef(AliSPDMCTrackDensity,3); // Calculate track-ref density + ClassDef(AliSPDMCTrackDensity,4); // Calculate track-ref density }; #endif diff --git a/PWGLF/FORWARD/analysis2/DrawAODSummary.C b/PWGLF/FORWARD/analysis2/DrawAODSummary.C index 96191607a4b..3db7438f472 100644 --- a/PWGLF/FORWARD/analysis2/DrawAODSummary.C +++ b/PWGLF/FORWARD/analysis2/DrawAODSummary.C @@ -945,7 +945,7 @@ void DrawSteps(const TCollection* forward, TCanvas* can) FixStack(rings, "dN/d#eta per ring", 23); TVirtualPad* body = can->cd(2); - body->Divide(2,3); + body->Divide(2,3,0,0); for (Int_t step = 1; step <= 6; step++) { DrawStep(deltas, nchs, prims, rings, dndeta, body, step); } @@ -954,22 +954,23 @@ void DrawSteps(const TCollection* forward, TCanvas* can) //____________________________________________________________________ -void DrawResults(const TCollection* forward, TCanvas* can) +void DrawResults(const TCollection* forward, + const TCollection* forwardRes, TCanvas* can) { // MakeChapter(can, "Results"); TVirtualPad* body = can->cd(2); - body->Divide(2,3); + body->Divide(2,3, .1, 0); - TCollection* c = GetCollection(forward, "ringResults"); + TCollection* c = GetCollection(forwardRes, "ringResults"); if (!c) return; DrawInPad(body, 1, GetStack(c, "all"), "nostack"); - DrawInPad(body, 2, GetH1(forward, "dNdeta")); - DrawInPad(body, 3, GetH1(forward, "dNdeta_")); - DrawInPad(body, 4, GetH1(forward, "norm")); - DrawInPad(body, 4, GetH1(forward, "phi"), "same", 0x10); - DrawInPad(body, 5, GetH1(forward, "d2Ndetadphi"), "colz"); + DrawInPad(body, 2, GetH1(forwardRes, "dNdeta")); + DrawInPad(body, 3, GetH1(forwardRes, "dNdeta_")); + DrawInPad(body, 4, GetH1(forwardRes, "norm")); + DrawInPad(body, 4, GetH1(forwardRes, "phi"), "same", 0x10); + DrawInPad(body, 5, GetH1(forward, "d2Ndetadphi"), "colz"); PrintCanvas(can, "Results"); } @@ -1003,8 +1004,11 @@ void DrawAODSummary(const TString& filename="forward.root") DrawHistCollector(forward, c); // --- Do the results ---------------------------------------------- - DrawSteps(forward, c); - DrawResults(forward, c); + TCollection* forwardRes = GetCollection(file, "ForwardResults"); + if (!forwardRes) return; + + DrawSteps(forwardRes, c); + DrawResults(forward, forwardRes, c); CloseCanvas(c); } diff --git a/PWGLF/FORWARD/analysis2/DrawdNdeta.C b/PWGLF/FORWARD/analysis2/DrawdNdeta.C index ad8f07062c3..cda1999d782 100644 --- a/PWGLF/FORWARD/analysis2/DrawdNdeta.C +++ b/PWGLF/FORWARD/analysis2/DrawdNdeta.C @@ -353,19 +353,31 @@ struct dNdetaDrawer // --- Try to get the emperical correction ----------------------- TGraphErrors* empCorr = 0; if (!fEmpirical.IsNull()) { - TFile* empirical = TFile::Open(fEmpirical, "READ"); - if (!empirical) { - empirical = TFile::Open(Form("$ALICE_ROOT/PWGLF/FORWARD/corrections/" - "Empirical/%s", fEmpirical.Data())); + if (gSystem->AccessPathName(fEmpirical.Data())) { // Not found here + fEmpirical = + Form(gSystem->ExpandPathName(Form("$ALICE_ROOT/PWGLF/FORWARD/" + "corrections/Empirical/%s", + fEmpirical.Data()))); + if (gSystem->AccessPathName(fEmpirical.Data())) { // Not found here + Warning("Open", "Couldn't get empirical correction file"); + fEmpirical = ""; + } } - if (empirical) { - empCorr = static_cast(empirical->Get("fmdfull/average")); - if (!empCorr) - Warning("Open", "couldn't get the empirical correction"); + if (!fEmpirical.IsNull()) { + TFile* empirical = TFile::Open(fEmpirical, "READ"); + if (!empirical) { + Warning("Open", "couldn't open empirical correction file: %s", + fEmpirical.Data()); + fEmpirical = ""; + } + const char* empPath = "fmdfull/average"; + empCorr = static_cast(empirical->Get(empPath)); + if (!empCorr) { + Warning("Open", "Didn't find the graph %s in %s", + empPath, fEmpirical.Data()); + fEmpirical = ""; + } } - else - Warning("Run", "Failed to open file %s for empirical corrections", - fEmpirical.Data()); } if (!empCorr) fEmpirical = ""; diff --git a/PWGLF/FORWARD/analysis2/DrawdNdetaSummary.C b/PWGLF/FORWARD/analysis2/DrawdNdetaSummary.C index 23f5f8d0ded..dab61dc4132 100644 --- a/PWGLF/FORWARD/analysis2/DrawdNdetaSummary.C +++ b/PWGLF/FORWARD/analysis2/DrawdNdetaSummary.C @@ -332,6 +332,8 @@ ClearCanvas(TCanvas* c) p2->SetFillStyle(0); p2->SetBorderSize(0); p2->SetBorderMode(0); + p2->SetRightMargin(0.02); + p2->SetTopMargin(0.02); c->cd(); p2->Draw(); p2->cd(); @@ -583,14 +585,30 @@ void DrawSums(TDirectory* top, const TString& base, TCanvas* can, bool onlyMB) } //____________________________________________________________________ -void CleanStack(THStack* stack, TLegend* l, const TAxis* axis) +THStack* CleanStack(const THStack* stack, TLegend* l, const TAxis* axis) { - TList* hists = stack->GetHists(); - // Clean up list of histogram. Histograms with no entries or - // no functions are deleted. We have to do this using the TObjLink - // objects stored in the list since ROOT cannot guaranty the validity - // of iterators when removing from a list - tsck. Should just implement - // TIter::Remove(). + THStack* ret = new THStack(stack->GetName(), stack->GetTitle()); + TList* hists = stack->GetHists(); + TIter next(hists); + TH1* h = 0; + Int_t j = 0; + while ((h = static_cast(next()))) { + TString name(h->GetName()); + if (name.Contains("_mirror")) continue; + if (l) { + j++; + name.Form("%3d%% - %3d%%", + Int_t(axis->GetBinLowEdge(j)), + Int_t(axis->GetBinUpEdge(j))); + TLegendEntry* e = l->AddEntry("dummy", name, "f"); + e->SetFillStyle(1001); + e->SetFillColor(h->GetMarkerColor()); + } + ret->Add(h); + } + return ret; +#if 0 + // There's no dictinary for TObjLink TObjLink* lnk = hists->FirstLink(); Int_t j = 0; while (lnk) { @@ -618,6 +636,7 @@ void CleanStack(THStack* stack, TLegend* l, const TAxis* axis) } lnk = lnk->Next(); } +#endif } //____________________________________________________________________ @@ -635,14 +654,24 @@ void DrawCentRes(const TCollection* sums, TCanvas* can, const TString& base, if (!c) return; TVirtualPad* body = can->cd(2); - body->Divide(2, 3); + body->Divide(2, 3, 0.05, 0); - DrawInPad(body, 1, GetH1(c, "triggers"), "HIST TEXT"); - DrawInPad(body, 2, GetH1(c, Form("norm%s",base.Data()))); - DrawInPad(body, 3, GetH1(c, Form("dndeta%s",base.Data()))); - DrawInPad(body, 4, GetH1(c, Form("dndeta%s_rebin05",base.Data()))); + Int_t trP = 1; + TVirtualPad* p = body->GetPad(trP); + p->SetBottomMargin(0.15); + p->SetLeftMargin(0.15); + if (trP > 2) p->SetTopMargin(0.05); + + DrawInPad(body, trP, GetH1(c, "triggers"), "HIST TEXT"); + DrawInPad(body, 2, GetH1(c, Form("norm%s",base.Data()))); + DrawInPad(body, 4, GetH1(c, Form("dndeta%s",base.Data()))); + DrawInPad(body, 6, GetH1(c, Form("dndeta%s_rebin05",base.Data()))); DrawInPad(body, 5, GetH2(c, Form("d2Ndetadphi%s", base.Data())),"colz"); + body->GetPad(2)->SetGridx(); body->GetPad(2)->SetLeftMargin(0.15); + body->GetPad(4)->SetGridx(); body->GetPad(4)->SetLeftMargin(0.15); + body->GetPad(6)->SetGridx(); body->GetPad(6)->SetLeftMargin(0.15); + TObject* normCalc = GetObject(c, "normCalc"); TString calc = normCalc->GetTitle(); TObjArray* lines = calc.Tokenize("\n"); @@ -654,7 +683,7 @@ void DrawCentRes(const TCollection* sums, TCanvas* can, const TString& base, disp->SetBorderSize(0); disp->SetBorderSize(0); disp->SetFillStyle(0); - DrawInPad(body, 6, disp); + DrawInPad(body, 3, disp); PrintCanvas(can, Form("%s result: %3d%% - %3d%%", base.Data(), cLow, cHigh)); } @@ -696,20 +725,22 @@ DrawRes(TDirectory* top, const TString& base, TCanvas* can, Bool_t onlyMB) PrintCanvas(can, Form("%s results", base.Data())); TVirtualPad* body = can->cd(2); - body->Divide(1, 3); + body->Divide(1, 3, 0, 0); TLegend* l = new TLegend(0.1, 0.1, 0.9, 0.9, "Centralities"); l->SetNColumns(2); l->SetFillStyle(0); l->SetBorderSize(0); - THStack* dndeta = GetStack(c, "dndeta"); - CleanStack(dndeta, l, centAxis); - THStack* dndeta5 = GetStack(c, "dndeta_rebin05"); - CleanStack(dndeta5, 0, 0); - - DrawInPad(body, 1, dndeta, "nostack"); - DrawInPad(body, 2, dndeta5, "nostack"); - DrawInPad(body, 3, l, ""); + THStack* dndeta_ = GetStack(c, "dndeta"); + THStack* dndeta = CleanStack(dndeta_, l, centAxis); + THStack* dndeta5_ = GetStack(c, "dndeta_rebin05"); + THStack* dndeta5 = CleanStack(dndeta5_, 0, 0); + + DrawInPad(body, 1, l, ""); + DrawInPad(body, 2, dndeta, "nostack"); + DrawInPad(body, 3, dndeta5, "nostack"); + body->GetPad(2)->SetGridx(); + body->GetPad(3)->SetGridx(); PrintCanvas(can, Form("%s results - stacks", base.Data())); diff --git a/PWGLF/FORWARD/analysis2/ForwardAODConfig.C b/PWGLF/FORWARD/analysis2/ForwardAODConfig.C index af7d1cca062..ac8d94c233f 100644 --- a/PWGLF/FORWARD/analysis2/ForwardAODConfig.C +++ b/PWGLF/FORWARD/analysis2/ForwardAODConfig.C @@ -32,34 +32,17 @@ ForwardAODConfig(AliForwardMultiplicityBase* task) // Would like to use dynamic cast but CINT interprets that as a // static cast - sigh! - Bool_t mc = false; - if (task->IsA() == AliForwardMCMultiplicityTask::Class()) - mc = true; - -#if 0 - if (mc) { - AliForwardMCMultiplicityTask* mcTask = - static_cast(task); - mcTask->SetOnlyPrimary(true); - } -#endif - + Bool_t mc = (task->IsA() == AliForwardMCMultiplicityTask::Class()); Double_t nXi = mc ? 2 : 2; //HHD test Bool_t includeSigma = false; //true; + // Sharing cut AliFMDMultCuts cSharing; - //c.SetNXi(mc ? 1 : 1); - //c.SetIncludeSigma(true); - //c.SetMPVFraction(0.5); Double_t factor = 1.; - //if(mc) factor = 1.15; cSharing.SetMultCuts(0.3, 0.3, 0.3, 0.3, 0.3); + // Density cut AliFMDMultCuts cDensity; - //c2.SetNXi(mc ? 1 : 1); - // c2.SetIncludeSigma(false); - //c2.SetMPVFraction(0.5); - //Double_t factor = 1.2; cDensity.SetMultCuts(0.3, 0.3, 0.3, 0.3, 0.3); @@ -76,15 +59,14 @@ ForwardAODConfig(AliForwardMultiplicityBase* task) // V0-AND triggered events flagged as NSD task->GetEventInspector().SetUseV0AndForNSD(false); // Use primary vertex selection from 1st physics WG - // task->GetEventInspector().SetUseFirstPhysicsVtx(true); + task->GetEventInspector().SetUseFirstPhysicsVtx(false); // Use satellite collisions - // task->GetEventInspector().SetUseDisplacedVertices(true); + task->GetEventInspector().SetUseDisplacedVertices(false); + // Which centrality estimator to use + task->GetEventInspector().SetCentralityMethod("V0M"); // --- Sharing filter ---------------------------------------------- // Set the low cut used for sharing - overrides settings in eloss fits - // Float_t factor = 1.; - //if(mc) factor = 1.2; - //task->GetSharingFilter().SetLowCut(0.3*factor); // Enable use of angle corrected signals in the algorithm task->GetSharingFilter().SetUseAngleCorrectedSignals(true); // Disable use of angle corrected signals in the algorithm @@ -101,15 +83,14 @@ ForwardAODConfig(AliForwardMultiplicityBase* task) task->GetSharingFilter().GetHCuts().SetIncludeSigma(includeSigma); // Enable use of angle corrected signals in the algorithm task->GetSharingFilter().SetLCuts(cSharing); - + // Dead region in FMD2i + task->GetSharingFilter().AddDeadRegion(2, 'I', 16, 17, 256, 511); // --- Density calculator ------------------------------------------ // Set the maximum number of particle to try to reconstruct task->GetDensityCalculator().SetMaxParticles(10); // Wet whether to use poisson statistics to estimate N_ch task->GetDensityCalculator().SetUsePoisson(true); - // Set to use the running average in Poisson - // task->GetDensityCalculator().SetUseRunningAverage(false); // Set whether or not to include sigma in cut task->GetDensityCalculator().SetCuts(cDensity); // Set lumping (nEta,nPhi) @@ -127,7 +108,7 @@ ForwardAODConfig(AliForwardMultiplicityBase* task) // Whether to use the vertex bias correction task->GetCorrections().SetUseVertexBias(false); // Whether to use the vertex bias correction - task->GetCorrections().SetUseAcceptance(true); + task->GetCorrections().SetUseAcceptance(false); // Whether to use the merging efficiency correction task->GetCorrections().SetUseMergingEfficiency(false); diff --git a/PWGLF/FORWARD/analysis2/gridAnalysis.sh b/PWGLF/FORWARD/analysis2/gridAnalysis.sh new file mode 100755 index 00000000000..13ff48cf153 --- /dev/null +++ b/PWGLF/FORWARD/analysis2/gridAnalysis.sh @@ -0,0 +1,613 @@ +#!/bin/bash +# +# BEGIN_MANUAL +# +# First, one need to figure out what to analyse. Visit the MonAlisa +# pages and find +# +# * The list of runs and put that in a file - say runs.list +# * The directory where the ESD files are stored +# - and the pattern that will match these for all runs +# * The directory where the MC ESD files are stored +# - and the pattern that will match these for all runs +# +# Then, one needs to run this script in set-up mode e.g., +# +# $0 --what setup \ +# --name=LHC10h --sys=pbpb --snn=2760 --field=5 \ +# --real-dir=/alice/data/2010/LHC10h \ +# --real-pattern=ESDs/pass2/*/AliESDs.root \ +# --mc-dir=/alice/sim/LHC11a7 \ +# --mc-pattern=*/AliESDs.root \ +# --runs=runs.list --par +# +# Note, all the settings are written to the file .config in the +# current directory, so you do not need to give the parameters at +# subsequent steps. As an alternative to giving the parameters, one +# can create the file by hand. +# +# Next, we need to generate the corrections. Do +# +# $0 --what corrs +# +# and then monitor output on MonAlisa. When enough has finished, execute +# +# $0 --what corrs --step terminate +# +# enough times to get the final merged result. Next, we need to download +# the results +# +# $0 --what corrs --step download +# +# and extract and upload the corrections to our local corrections folder +# +# $0 --what corrs --step upload +# +# Now we can submit our AOD generation jobs. Do +# +# $0 --what aods +# +# and then monitor output on MonAlisa. When enough has finished, execute +# +# $0 --what aods --step terminate +# +# enough times to get the final merged result. Next, we need to download +# the results +# +# $0 --what aods --step download +# +# and we can draw the summary results +# +# $0 --what aods --step draw +# +# Now, we should do the dN/deta analysis. Do +# +# $0 --what dndetas +# +# and then monitor output on MonAlisa. When enough has finished, execute +# +# $0 --what dndetas --step terminate +# +# enough times to get the final merged result. Next, we need to download +# the results +# +# $0 --what dndetas --step download +# +# and we can draw the final results +# +# $0 --what dndetas --step draw +# +# Enjoy +# +# END_MANUAL + +runs= +name= +sys=1 +snn=900 +field=5 +corrs=corrections +dotconf=.config +here=${PWD} +par=0 +noact=0 +aliroot="&aliroot=v5-03-75pATF-AN" +# root="root=v5-34-02-1" + +real_dir= +real_pat= +mc_dir= +mc_pat= +my_real_dir=/alice/cern.ch/users/ +my_mc_dir= + +# --- Usage ---------------------------------------------------------- +usage() +{ + cat <RedirectOutput("/dev/null"); +TGrid::Connect("alien://"); +gSystem->RedirectOutput(0); +std::cout << gGrid->GetHomeDirectory() << std::endl; +EOF` + + my_real_dir="$l/${name}_${now}_aod/output" + my_mc_dir="$l/${name}_${now}_mcaod/output" +} + +# --- Check settings ------------------------------------------------- +check() +{ + if test "x$runs" = "x" || test ! -f $runs ; then + echo "List of run file $runs not found" > /dev/stderr + exit 1 + fi + if test "X$name" = X ; then + echo "No name specified" > /dev/stderr + exit 1 + fi + if test "x$sys" = "x" ; then + echo "No collision system specified" > /dev/stderr + exit 1 + fi + if test "x$snn" = "x" ; then + echo "No center of mass energy specified" > /dev/stderr + exit 1 + fi + if test "x$field" = "x" ; then + echo "No L3 field setting specified" > /dev/stderr + exit 1 + fi + if test "x$real_dir" = "x" ; then + echo "No real data directory specified" > /dev/stderr + exit 1 + fi + if test "x$mc_dir" = "x" ; then + echo "No MC data directory specified" > /dev/stderr + exit 1 + fi + if test "x$real_pat" = "x" ; then + echo "No real data pattern specified" > /dev/stderr + exit 1 + fi + if test "x$mc_pat" = "x" ; then + echo "No MC data pattern specified" > /dev/stderr + exit 1 + fi + if test "X$1" != "Xsetup" && test x$now = x ; then + echo "No date/time specified" > /dev/stderr + exit 1 + fi + case $sys in + pp|p-p) sys=1 ;; + pbpb|pb-pb|aa|a-a) sys=2 ;; + ppb|p-pb|pa|p-a) sys=3 ;; + 1|2|3) ;; + *) echo "$0: Unknown system: $sys" ; exit 1 ;; + esac + + cat < /dev/stderr + exit 1 + fi + + now=`date '+%Y%m%d_%H%M'` + outputs + + # Write settings to a file, which we later can source + cat > ${dotconf} < /dev/stderr ; exit 1 ;; + esac + case $type in + *corr|*eloss|*aod) + if test $mc -gt 0; then + uopt="${uopt}&mc" + dir=$mc_dir + pat=$mc_pat + fi + ;; + *dndeta) + dir=$my_real_dir + pat="*/AliAOD.root" + if test $mc -gt 0 ; then + uopt="${uopt}&mc" + dir=$my_mc_dir + fi + ;; + esac + if test $par -gt 0 ; then + uopt="${uopt}&par" + fi + url="alien://${dir}?run=${runs}&pattern=${pat}${uopt}${aliroot}${root}#${tree}" + opts="${opts} --date=${now} --class=$cl --name=$nme" + + echo "Running train: runTrain2 ${opts} --url=${url} $@" + if test $noact -gt 0 ; then return ; fi + + runTrain2 ${opts} --overwrite --url=${url} $@ + + cat < /dev/stderr ; exit 1 ;; +esac + +case $step in + full) ;; + term*) func=${func}_terminate ;; + down*) func=${func}_download ;; + up*) func=${func}_upload ;; + dr*) func=${func}_draw ;; +esac + +echo "Will execute $func" +$func $@ + +# +# EOF +# + -- 2.43.0