From 66cf95f2e7ebb792c7b39df36d1d6bcdc832c81b Mon Sep 17 00:00:00 2001 From: cholm Date: Tue, 16 Oct 2012 10:31:17 +0000 Subject: [PATCH] Various fixes, and possibility to set trigger efficiency --- .../FORWARD/analysis2/AddTaskCentraldNdeta.C | 5 +- PWGLF/FORWARD/analysis2/AddTaskFMDELoss.C | 1 + .../FORWARD/analysis2/AddTaskForwarddNdeta.C | 5 +- .../FORWARD/analysis2/AddTaskMCTruthdNdeta.C | 7 +- PWGLF/FORWARD/analysis2/AliAODForwardMult.h | 2 +- PWGLF/FORWARD/analysis2/AliBasedNdetaTask.cxx | 137 ++++++++---------- PWGLF/FORWARD/analysis2/AliBasedNdetaTask.h | 25 ++-- .../analysis2/AliFMDEventInspector.cxx | 104 ++++++++++--- .../FORWARD/analysis2/AliFMDEventInspector.h | 2 + .../analysis2/AliFMDEventPlaneFinder.h | 2 +- .../analysis2/AliFMDMCEventInspector.h | 2 +- PWGLF/FORWARD/analysis2/AliFMDSharingFilter.h | 2 +- .../analysis2/AliForwarddNdetaTask.cxx | 6 +- .../FORWARD/analysis2/AliForwarddNdetaTask.h | 2 + .../analysis2/AliMCTruthdNdetaTask.cxx | 5 +- .../FORWARD/analysis2/AliMCTruthdNdetaTask.h | 2 + PWGLF/FORWARD/analysis2/CentralAODConfig.C | 17 +++ PWGLF/FORWARD/analysis2/DrawdNdeta.C | 29 ++-- PWGLF/FORWARD/analysis2/ForwardAODConfig.C | 4 +- PWGLF/FORWARD/analysis2/doc/Trains.C | 74 +++++++++- 20 files changed, 296 insertions(+), 137 deletions(-) diff --git a/PWGLF/FORWARD/analysis2/AddTaskCentraldNdeta.C b/PWGLF/FORWARD/analysis2/AddTaskCentraldNdeta.C index 269285a9270..ea976043b64 100644 --- a/PWGLF/FORWARD/analysis2/AddTaskCentraldNdeta.C +++ b/PWGLF/FORWARD/analysis2/AddTaskCentraldNdeta.C @@ -31,6 +31,8 @@ AddTaskCentraldNdeta(const char* trig = "INEL", Bool_t useCent = false, const char* scheme = 0, Bool_t cutEdges = false, + Double_t trigEff = 1, + Double_t trigEff0 = 1, const char* mcanalysisfilename = "none") { // --- Load libraries ---------------------------------------------- @@ -54,8 +56,9 @@ AddTaskCentraldNdeta(const char* trig = "INEL", // Set the vertex range to use task->SetVertexRange(vzMin, vzMax); // Set the trigger mask to use (INEL,INEL>0,NSD) - task->SetTriggerEff(0.997535); task->SetTriggerMask(trig); + task->SetTriggerEff(trigEff); // 0.997535); + task->SetTriggerEff0(trigEff0); // Whether to cut edges when re-binning task->SetCutEdges(cutEdges); // Whether to correct for empty bins when projecting diff --git a/PWGLF/FORWARD/analysis2/AddTaskFMDELoss.C b/PWGLF/FORWARD/analysis2/AddTaskFMDELoss.C index aef19adf757..dfa4eea7c00 100644 --- a/PWGLF/FORWARD/analysis2/AddTaskFMDELoss.C +++ b/PWGLF/FORWARD/analysis2/AddTaskFMDELoss.C @@ -21,6 +21,7 @@ * * @param mc Assume MC input * @param useCent Use centrality information + * @param debug Debug level * * @return Newly created task * diff --git a/PWGLF/FORWARD/analysis2/AddTaskForwarddNdeta.C b/PWGLF/FORWARD/analysis2/AddTaskForwarddNdeta.C index 98f82616e48..2988b91700e 100644 --- a/PWGLF/FORWARD/analysis2/AddTaskForwarddNdeta.C +++ b/PWGLF/FORWARD/analysis2/AddTaskForwarddNdeta.C @@ -31,6 +31,8 @@ AddTaskForwarddNdeta(const char* trig = "INEL", Bool_t useCent = false, const char* scheme = 0, Bool_t cutEdges = false, + Double_t trigEff = 1, + Double_t trigEff0 = 1, const char* mcanalysisfilename = "none") { // --- Load libraries ---------------------------------------------- @@ -58,7 +60,8 @@ AddTaskForwarddNdeta(const char* trig = "INEL", // Set the trigger mask to use (INEL,INEL>0,NSD) task->SetTriggerMask(trig); // Set the trigger efficiency - // task->SetTriggerEff(0.997535); + task->SetTriggerEff(trigEff); // 0.997535); + task->SetTriggerEff0(trigEff0); // Whether to cut edges when re-binning task->SetCutEdges(cutEdges); // Whether to correct for empty bins when projecting diff --git a/PWGLF/FORWARD/analysis2/AddTaskMCTruthdNdeta.C b/PWGLF/FORWARD/analysis2/AddTaskMCTruthdNdeta.C index 4efd6f75222..e36d8b4bbf2 100644 --- a/PWGLF/FORWARD/analysis2/AddTaskMCTruthdNdeta.C +++ b/PWGLF/FORWARD/analysis2/AddTaskMCTruthdNdeta.C @@ -29,7 +29,9 @@ AddTaskMCTruthdNdeta(const char* trig = "INEL", Double_t vzMax = +10, Bool_t useCent = false, const char* scheme = 0, - Bool_t cutEdges = false) + Bool_t cutEdges = false, + Double_t trigEff = 1, + Double_t trigEff0 = 1) { // --- Load libraries ---------------------------------------------- gROOT->LoadClass("AliAODForwardMult", "libPWGLFforward2"); @@ -44,7 +46,8 @@ AddTaskMCTruthdNdeta(const char* trig = "INEL", // Set the trigger mask to use (INEL,INEL>0,NSD) task->SetTriggerMask(trig); // Set the trigger efficiency - // task->SetTriggerEff(0.997535); + task->SetTriggerEff(trigEff); // 0.997535); + task->SetTriggerEff0(trigEff0); // Whether to cut edges when re-binning task->SetCutEdges(cutEdges); // Whether to correct for empty bins when projecting diff --git a/PWGLF/FORWARD/analysis2/AliAODForwardMult.h b/PWGLF/FORWARD/analysis2/AliAODForwardMult.h index 97336dff47f..554ecd21a54 100644 --- a/PWGLF/FORWARD/analysis2/AliAODForwardMult.h +++ b/PWGLF/FORWARD/analysis2/AliAODForwardMult.h @@ -131,7 +131,7 @@ public: /** At least one SPD cluster */ kNClusterGt0 = 0x1000, /** V0-AND trigger */ - kV0AND + kV0AND = 0x2000 }; /** * Bin numbers in trigger histograms diff --git a/PWGLF/FORWARD/analysis2/AliBasedNdetaTask.cxx b/PWGLF/FORWARD/analysis2/AliBasedNdetaTask.cxx index df834aa4b3a..ec2ae0556e3 100644 --- a/PWGLF/FORWARD/analysis2/AliBasedNdetaTask.cxx +++ b/PWGLF/FORWARD/analysis2/AliBasedNdetaTask.cxx @@ -28,6 +28,7 @@ AliBasedNdetaTask::AliBasedNdetaTask() fCorrEmpty(true), fUseROOTProj(false), fTriggerEff(1), + fTriggerEff0(1), fShapeCorr(0), fListOfCentralities(0), fSNNString(0), @@ -59,6 +60,7 @@ AliBasedNdetaTask::AliBasedNdetaTask(const char* name) fCorrEmpty(true), fUseROOTProj(false), fTriggerEff(1), + fTriggerEff0(1), fShapeCorr(0), fListOfCentralities(0), fSNNString(0), @@ -101,6 +103,7 @@ AliBasedNdetaTask::AliBasedNdetaTask(const AliBasedNdetaTask& o) fCorrEmpty(o.fCorrEmpty), fUseROOTProj(o.fUseROOTProj), fTriggerEff(o.fTriggerEff), + fTriggerEff0(o.fTriggerEff0), fShapeCorr(o.fShapeCorr), fListOfCentralities(o.fListOfCentralities), fSNNString(o.fSNNString), @@ -273,15 +276,8 @@ AliBasedNdetaTask::SetNormalizationScheme(UShort_t scheme) { DGUARD(fDebug,3,"Set the normalization scheme: 0x%x", scheme); fNormalizationScheme = scheme; -#if 0 - const Char_t* tit = NormalizationSchemeString(scheme); - if (!fSchemeString) fSchemeString = new TNamed("scheme", ""); - fSchemeString->SetTitle(tit); - fSchemeString->SetUniqueID(fNormalizationScheme); -#else if (fSchemeString) delete fSchemeString; fSchemeString = AliForwardUtil::MakeParameter("scheme", scheme); -#endif } //________________________________________________________________________ void @@ -302,16 +298,8 @@ AliBasedNdetaTask::SetTriggerMask(UShort_t mask) { DGUARD(fDebug,3,"Set the trigger mask: 0x%0x", mask); fTriggerMask = mask; -#if 0 - TString tit(AliAODForwardMult::GetTriggerString(mask)); - tit = tit.Strip(TString::kBoth); - if (!fTriggerString) fTriggerString = new TNamed("trigger", ""); - fTriggerString->SetTitle(tit); - fTriggerString->SetUniqueID(fTriggerMask); -#else if (fTriggerString) delete fTriggerString; fTriggerString = AliForwardUtil::MakeParameter("trigger", fTriggerMask); -#endif } //________________________________________________________________________ @@ -436,26 +424,6 @@ AliBasedNdetaTask::UserExec(Option_t *) } // Here, we get the update -#if 0 - if (!fSNNString) { - UShort_t sNN = forward->GetSNN(); - fSNNString = new TNamed("sNN", ""); - fSNNString->SetTitle(AliForwardUtil::CenterOfMassEnergyString(sNN)); - fSNNString->SetUniqueID(sNN); - fSums->Add(fSNNString); - - UShort_t sys = forward->GetSystem(); - fSysString = new TNamed("sys", ""); - fSysString->SetTitle(AliForwardUtil::CollisionSystemString(sys)); - fSysString->SetUniqueID(sys); - fSums->Add(fSysString); - - fSums->Add(fSchemeString); - fSums->Add(fTriggerString); - - // Print(); - } -#else if (!fSNNString) { fSNNString = AliForwardUtil::MakeParameter("sNN", forward->GetSNN()); fSysString = AliForwardUtil::MakeParameter("sys", forward->GetSystem()); @@ -467,8 +435,6 @@ AliBasedNdetaTask::UserExec(Option_t *) // Print(); } - -#endif PostData(1, fSums); } @@ -689,7 +655,8 @@ AliBasedNdetaTask::Terminate(Option_t *) AliInfo(Form("Marker style=%d, color=%d", style, color)); while ((bin = static_cast(next()))) { - bin->End(fSums, fOutput, fNormalizationScheme, fShapeCorr, fTriggerEff, + bin->End(fSums, fOutput, fNormalizationScheme, fShapeCorr, + fTriggerEff, fTriggerEff0, fSymmetrice, fRebin, fUseROOTProj, fCorrEmpty, fCutEdges, fTriggerMask, style, color, mclist, truthlist); if (fCentAxis && bin->IsAllBin()) continue; @@ -789,6 +756,7 @@ AliBasedNdetaTask::Terminate(Option_t *) // Output trigger efficiency and shape correction fOutput->Add(AliForwardUtil::MakeParameter("triggerEff", fTriggerEff)); + fOutput->Add(AliForwardUtil::MakeParameter("triggerEff0", fTriggerEff0)); if (fShapeCorr) fOutput->Add(fShapeCorr); TNamed* options = new TNamed("options",""); @@ -864,6 +832,21 @@ AliBasedNdetaTask::LoadNormalizationData(UShort_t sys, UShort_t energy) if (fTriggerEff != 1) SetTriggerEff(trigEff); if (fTriggerEff < 0) fTriggerEff = 1; + // Trigger efficiency + TString eff0Name(Form("%sTriggerEff0", + fTriggerMask == AliAODForwardMult::kInel ? "inel" : + fTriggerMask == AliAODForwardMult::kNSD ? "nsd" : + fTriggerMask == AliAODForwardMult::kInelGt0 ? + "inelgt0" : "all")); + + Double_t trigEff0 = 1; + if (fNormalizationScheme & kTriggerEfficiency) { + TObject* eff = fin->Get(eff0Name); + if (eff) AliForwardUtil::GetParameter(eff, trigEff0); + } + if (fTriggerEff0 != 1) SetTriggerEff0(trigEff0); + if (fTriggerEff0 < 0) fTriggerEff0 = 1; + // TEMPORARY FIX // Rescale the shape correction by the trigger efficiency if (fShapeCorr) { @@ -886,29 +869,31 @@ AliBasedNdetaTask::Print(Option_t*) const // std::cout << this->ClassName() << ": " << this->GetName() << "\n" << std::boolalpha - << " Trigger: " << (fTriggerString ? - fTriggerString->GetTitle() : - "none") << "\n" - << " Vertex range: [" << fVtxMin << ":" << fVtxMax << "]\n" - << " Rebin factor: " << fRebin << "\n" - << " Cut edges: " << fCutEdges << "\n" - << " Symmertrice: " << fSymmetrice << "\n" - << " Use TH2::ProjectionX: " << fUseROOTProj << "\n" - << " Correct for empty: " << fCorrEmpty << "\n" - << " Normalization scheme: " << (fSchemeString ? - fSchemeString->GetTitle() : + << " Trigger: " << (fTriggerString ? + fTriggerString->GetTitle() : + "none") << "\n" + << " Vertex range: [" << fVtxMin << ":" + << fVtxMax << "]\n" + << " Rebin factor: " << fRebin << "\n" + << " Cut edges: " << fCutEdges << "\n" + << " Symmertrice: " << fSymmetrice << "\n" + << " Use TH2::ProjectionX: " << fUseROOTProj << "\n" + << " Correct for empty: " << fCorrEmpty << "\n" + << " Normalization scheme: " << (fSchemeString ? + fSchemeString->GetTitle() : "none") <<"\n" - << " Trigger efficiency: " << fTriggerEff << "\n" - << " Shape correction: " << (fShapeCorr ? - fShapeCorr->GetName() : - "none") << "\n" - << " sqrt(s_NN): " << (fSNNString ? - fSNNString->GetTitle() : - "unknown") << "\n" - << " Collision system: " << (fSysString ? - fSysString->GetTitle() : - "unknown") << "\n" - << " Centrality bins: " << (fCentAxis ? "" : "none"); + << " Trigger efficiency: " << fTriggerEff << "\n" + << " Bin-0 Trigger efficiency: " << fTriggerEff0 << "\n" + << " Shape correction: " << (fShapeCorr ? + fShapeCorr->GetName() : + "none") << "\n" + << " sqrt(s_NN): " << (fSNNString ? + fSNNString->GetTitle() : + "unknown") << "\n" + << " Collision system: " << (fSysString ? + fSysString->GetTitle() : + "unknown") << "\n" + << " Centrality bins: " << (fCentAxis ? "" : "none"); if (fCentAxis) { Int_t nBins = fCentAxis->GetNbins(); const Double_t* bins = fCentAxis->GetXbins()->GetArray(); @@ -1546,7 +1531,7 @@ AliBasedNdetaTask::CentralityBin::Normalization(const TH1I& t, Double_t nOffline = t.GetBinContent(AliAODForwardMult::kBinOffline); Double_t nTriggered = t.GetBinContent(AliAODForwardMult::kWithTrigger); Double_t nWithVertex = t.GetBinContent(AliAODForwardMult::kWithVertex); - Double_t nAccepted = ntotal; // t.GetBinContent(AliAODForwardMult::kAccepted); + Double_t nAccepted = ntotal; ntotal = 0; if (nTriggered <= 0.1) { @@ -1744,24 +1729,23 @@ AliBasedNdetaTask::CentralityBin::MakeResult(const TH2D* sum, if(mclist) centlist = static_cast (mclist->FindObject(GetListName())); if(centlist) - dndetaMCCorrection = static_cast(centlist->FindObject(Form("dndeta%s%s",GetName(), postfix))); + dndetaMCCorrection = + static_cast(centlist->FindObject(Form("dndeta%s%s", + GetName(), postfix))); if(truthlist) - truthcentlist = static_cast (truthlist->FindObject(GetListName())); + truthcentlist =static_cast(truthlist->FindObject(GetListName())); if(truthcentlist) - dndetaMCtruth = static_cast (truthcentlist->FindObject("dndetaTruth")); - //std::cout<(truthcentlist->FindObject("dndetaTruth")); + if(dndetaMCCorrection && dndetaMCtruth) { AliInfo("Correcting with final MC correction"); dndetaMCCorrection->Divide(dndetaMCtruth); dndetaMCCorrection->SetTitle("Final MC correction"); dndetaMCCorrection->SetName("finalMCCorr"); - dndeta->Divide(dndetaMCCorrection); - - //std::cout<<"histo "<Divide(dndetaMCCorrection); } - else AliInfo("No final MC correction applied"); + else + AliInfo("No final MC correction applied"); // --- Set some histogram attributes ------------------------------- TString post; @@ -1790,6 +1774,7 @@ AliBasedNdetaTask::CentralityBin::End(TList* sums, UShort_t scheme, const TH2F* shapeCorr, Double_t trigEff, + Double_t trigEff0, Bool_t symmetrice, Int_t rebin, Bool_t rootProj, @@ -1845,7 +1830,10 @@ AliBasedNdetaTask::CentralityBin::End(TList* sums, // --- Get normalization scaler ------------------------------------ Double_t epsilonT = trigEff; - Double_t epsilonT0 = trigEff; + Double_t epsilonT0 = trigEff0; + AliInfoF("Using epsilonT=%f, epsilonT0=%f for %d", + epsilonT, epsilonT0, triggerMask); +#if 0 // TEMPORARY FIX if (triggerMask == AliAODForwardMult::kNSD) { // This is a local change @@ -1868,15 +1856,16 @@ AliBasedNdetaTask::CentralityBin::End(TList* sums, AliWarning(Form("Using hard-coded NCluster>0 trigger efficiency of %f", epsilonT0)); } +#endif // Get our histograms Double_t nSum = 0; - TH2D* sum = fSum->CalcSum(fOutput, nSum, epsilonT0, 1, + TH2D* sum = fSum->CalcSum(fOutput, nSum, epsilonT0, epsilonT, marker, rootProj, corrEmpty); Double_t nSumMC = 0; TH2D* sumMC = 0; if (fSumMC) sumMC = fSumMC->CalcSum(fOutput, nSumMC, - epsilonT0, 1, marker, + epsilonT0, epsilonT, marker, rootProj, corrEmpty); if (!sum) { AliError("Failed to get sum from summer - bailing out"); diff --git a/PWGLF/FORWARD/analysis2/AliBasedNdetaTask.h b/PWGLF/FORWARD/analysis2/AliBasedNdetaTask.h index 50d59e4a740..fed6d596283 100644 --- a/PWGLF/FORWARD/analysis2/AliBasedNdetaTask.h +++ b/PWGLF/FORWARD/analysis2/AliBasedNdetaTask.h @@ -171,6 +171,12 @@ public: * @param e Trigger efficiency */ void SetTriggerEff(Double_t e) { fTriggerEff = e; } + /** + * Trigger efficiency for 0-bin for selected trigger(s) + * + * @param e Trigger efficiency for 0-bin + */ + void SetTriggerEff0(Double_t e) { fTriggerEff0 = e; } /** * Set the shape correction (a.k.a., track correction) for selected * trigger(s) @@ -701,6 +707,7 @@ protected: * @param scheme Normalisation scheme options * @param shapeCorr Shape correction or nil * @param trigEff Trigger efficiency + * @param trigEff0 0-bin trigger efficiency * @param symmetrice Whether to symmetrice the results * @param rebin Whether to rebin the results * @param rootProj If true, use TH2::ProjectionX @@ -717,6 +724,7 @@ protected: UShort_t scheme, const TH2F* shapeCorr, Double_t trigEff, + Double_t trigEff0, Bool_t symmetrice, Int_t rebin, Bool_t rootProj, @@ -858,28 +866,19 @@ protected: Bool_t fCorrEmpty; // Correct for empty bins Bool_t fUseROOTProj; // Whether to use ROOT's ProjectionX Double_t fTriggerEff; // Trigger efficiency for selected trigger(s) + Double_t fTriggerEff0; // Bin-0 Trigger efficiency for sel trigger(s) TH2F* fShapeCorr; // Shape correction TObjArray* fListOfCentralities; // Centrality bins -#if 0 - TNamed* fSNNString; // sqrt(s_NN) string - TNamed* fSysString; // Collision system string -#else - TObject* fSNNString; // sqrt(s_NN) string - TObject* fSysString; // Collision system string -#endif + TObject* fSNNString; // sqrt(s_NN) string + TObject* fSysString; // Collision system string TH1D* fCent; // Centrality distribution TAxis* fCentAxis; // Centrality axis UShort_t fNormalizationScheme; // Normalization scheme -#if 0 - TNamed* fSchemeString; // Normalization scheme string - TNamed* fTriggerString; // Trigger string -#else TObject* fSchemeString; // Normalization scheme string TObject* fTriggerString; // Trigger string -#endif TString fFinalMCCorrFile; //Filename for final MC corr - ClassDef(AliBasedNdetaTask,8); // Determine multiplicity in base area + ClassDef(AliBasedNdetaTask,9); // Determine charged particle density }; #endif diff --git a/PWGLF/FORWARD/analysis2/AliFMDEventInspector.cxx b/PWGLF/FORWARD/analysis2/AliFMDEventInspector.cxx index b602cb40922..f98ffc6c2a3 100644 --- a/PWGLF/FORWARD/analysis2/AliFMDEventInspector.cxx +++ b/PWGLF/FORWARD/analysis2/AliFMDEventInspector.cxx @@ -48,23 +48,24 @@ AliFMDEventInspector::AliFMDEventInspector() fHEventsAccepted(0), fHEventsAcceptedXY(0), fHTriggers(0), + fHTriggerCorr(0), fHType(0), fHWords(0), - fHCent(0), + fHCent(0), fHCentVsQual(0), fHStatus(0), - fLowFluxCut(1000), - fMaxVzErr(0.2), - fList(0), - fEnergy(0), + fLowFluxCut(1000), + fMaxVzErr(0.2), + fList(0), + fEnergy(0), fField(999), - fCollisionSystem(kUnknown), + fCollisionSystem(kUnknown), fDebug(0), fCentAxis(0), fVtxAxis(10,-10,10), - fUseFirstPhysicsVertex(true), - fUseV0AND(false), - fMinPileupContrib(3), + fUseFirstPhysicsVertex(true), + fUseV0AND(false), + fMinPileupContrib(3), fMinPileupDistance(0.8), fUseDisplacedVertices(false), fDisplacedVertex(), @@ -85,6 +86,7 @@ AliFMDEventInspector::AliFMDEventInspector(const char* name) fHEventsAccepted(0), fHEventsAcceptedXY(0), fHTriggers(0), + fHTriggerCorr(0), fHType(0), fHWords(0), fHCent(0), @@ -125,6 +127,7 @@ AliFMDEventInspector::AliFMDEventInspector(const AliFMDEventInspector& o) fHEventsAccepted(o.fHEventsAccepted), fHEventsAcceptedXY(o.fHEventsAcceptedXY), fHTriggers(o.fHTriggers), + fHTriggerCorr(o.fHTriggerCorr), fHType(o.fHType), fHWords(o.fHWords), fHCent(o.fHCent), @@ -187,6 +190,7 @@ AliFMDEventInspector::operator=(const AliFMDEventInspector& o) fHEventsAccepted = o.fHEventsAccepted; fHEventsAcceptedXY = o.fHEventsAcceptedXY; fHTriggers = o.fHTriggers; + fHTriggerCorr = o.fHTriggerCorr; fHType = o.fHType; fHWords = o.fHWords; fHCent = o.fHCent; @@ -213,6 +217,7 @@ AliFMDEventInspector::operator=(const AliFMDEventInspector& o) if (fHEventsTr) fList->Add(fHEventsTr); if (fHEventsTrVtx) fList->Add(fHEventsTrVtx); if (fHTriggers) fList->Add(fHTriggers); + if (fHTriggerCorr) fList->Add(fHTriggerCorr); if (fHType) fList->Add(fHType); if (fHWords) fList->Add(fHWords); if (fHCent) fList->Add(fHCent); @@ -409,19 +414,45 @@ AliFMDEventInspector::Init(const TAxis& vtxAxis) fHTriggers->SetFillStyle(3001); fHTriggers->SetStats(0); fHTriggers->SetDirectory(0); - fHTriggers->GetXaxis()->SetBinLabel(kInel +1,"INEL"); - fHTriggers->GetXaxis()->SetBinLabel(kInelGt0+1,"INEL>0"); - fHTriggers->GetXaxis()->SetBinLabel(kNSD +1,"NSD"); - fHTriggers->GetXaxis()->SetBinLabel(kV0AND +1,"VOAND"); - fHTriggers->GetXaxis()->SetBinLabel(kEmpty +1,"Empty"); - fHTriggers->GetXaxis()->SetBinLabel(kA +1,"A"); - fHTriggers->GetXaxis()->SetBinLabel(kB +1,"B"); - fHTriggers->GetXaxis()->SetBinLabel(kC +1,"C"); - fHTriggers->GetXaxis()->SetBinLabel(kE +1,"E"); - fHTriggers->GetXaxis()->SetBinLabel(kPileUp +1,"Pileup"); - fHTriggers->GetXaxis()->SetBinLabel(kMCNSD +1,"NSD_{MC}"); - fHTriggers->GetXaxis()->SetBinLabel(kOffline+1,"Offline"); + + fHTriggerCorr = new TH2I("triggerCorr", "Trigger correlation", + kOffline+1, 0, kOffline+1, + kOffline+1, 0, kOffline+1); + fHTriggerCorr->SetStats(0); + fHTriggerCorr->SetDirectory(0); + + Int_t binNum[] = { kInel +1, + kInelGt0+1, + kNSD +1, + kV0AND +1, + kEmpty +1, + kA +1, + kB +1, + kC +1, + kE +1, + kPileUp +1, + kMCNSD +1, + kOffline+1 }; + const char* binLbl[] = { "INEL", + "INEL>0", + "NSD", + "VOAND", + "Empty", + "A", + "B", + "C", + "E", + "Pileup", + "NSD_{MC}", + "Offline" }; + for (Int_t i = 0; i < kOffline; i++) { + fHTriggers->GetXaxis()->SetBinLabel(binNum[i], binLbl[i]); + fHTriggerCorr->GetXaxis()->SetBinLabel(binNum[i], binLbl[i]); + fHTriggerCorr->GetYaxis()->SetBinLabel(binNum[i], binLbl[i]); + } fList->Add(fHTriggers); + fList->Add(fHTriggerCorr); + fHType = new TH1I("type", Form("Event type (cut: SPD mult>%d)", fLowFluxCut), 2, -.5, 1.5); @@ -768,7 +799,7 @@ AliFMDEventInspector::ReadTriggers(const AliESDEvent& esd, UInt_t& triggers, if (triggers & AliAODForwardMult::kB) { fHTriggers->Fill(kB+.5); if (triggers & AliAODForwardMult::kInel) - fHTriggers->Fill(kInel); + fHTriggers->Fill(kInel+.5); if (triggers & AliAODForwardMult::kInelGt0) fHTriggers->Fill(kInelGt0+.5); @@ -782,7 +813,36 @@ AliFMDEventInspector::ReadTriggers(const AliESDEvent& esd, UInt_t& triggers, if (triggers & AliAODForwardMult::kA) fHTriggers->Fill(kA+.5); if (triggers & AliAODForwardMult::kC) fHTriggers->Fill(kC+.5); if (triggers & AliAODForwardMult::kE) fHTriggers->Fill(kE+.5); + +#define TEST_TRIG_BIN(RET,BIN,TRIGGERS) \ + do { switch (BIN) { \ + case kInel: RET = triggers & AliAODForwardMult::kInel; break; \ + case kInelGt0: RET = triggers & AliAODForwardMult::kInelGt0; break; \ + case kNSD: RET = triggers & AliAODForwardMult::kNSD; break; \ + case kV0AND: RET = triggers & AliAODForwardMult::kV0AND; break; \ + case kEmpty: RET = triggers & AliAODForwardMult::kEmpty; break; \ + case kA: RET = triggers & AliAODForwardMult::kA; break; \ + case kB: RET = triggers & AliAODForwardMult::kB; break; \ + case kC: RET = triggers & AliAODForwardMult::kC; break; \ + case kE: RET = triggers & AliAODForwardMult::kE; break; \ + case kPileUp: RET = triggers & AliAODForwardMult::kPileUp; break; \ + case kMCNSD: RET = triggers & AliAODForwardMult::kMCNSD; break; \ + case kOffline: RET = triggers & AliAODForwardMult::kOffline; break; \ + default: RET = false; } } while(false) + + for (Int_t i = 0; i < kOffline+1; i++) { + Bool_t hasX = false; + TEST_TRIG_BIN(hasX, i, triggers); + if (!hasX) continue; + for (Int_t j = i; j < kOffline+1; j++) { + Bool_t hasY = false; + TEST_TRIG_BIN(hasY, j, triggers); + if (!hasY) continue; + + fHTriggerCorr->Fill(i+.5, j+.5); + } + } return kTRUE; } diff --git a/PWGLF/FORWARD/analysis2/AliFMDEventInspector.h b/PWGLF/FORWARD/analysis2/AliFMDEventInspector.h index ede32279d6e..f26f3a6accf 100644 --- a/PWGLF/FORWARD/analysis2/AliFMDEventInspector.h +++ b/PWGLF/FORWARD/analysis2/AliFMDEventInspector.h @@ -24,6 +24,7 @@ class TH1D; class TH1I; class TH1F; class TH2F; +class TH2I; class TAxis; // class TList; @@ -444,6 +445,7 @@ protected: TH1I* fHEventsAccepted; //! Events w/trigger and vertex in range TH2D* fHEventsAcceptedXY; //! XY vtx with trigger and Z vertex in range TH1I* fHTriggers; //! Triggers + TH2I* fHTriggerCorr; //! Correlation of triggers TH1I* fHType; //! Type (low/high flux) of event TH1I* fHWords; //! Trigger words TH1F* fHCent; //! Centrality diff --git a/PWGLF/FORWARD/analysis2/AliFMDEventPlaneFinder.h b/PWGLF/FORWARD/analysis2/AliFMDEventPlaneFinder.h index 3a7af3b9fc7..7a42fd00b1a 100644 --- a/PWGLF/FORWARD/analysis2/AliFMDEventPlaneFinder.h +++ b/PWGLF/FORWARD/analysis2/AliFMDEventPlaneFinder.h @@ -159,7 +159,7 @@ protected: */ Double_t GetPhiWeight(Int_t etaBin, Int_t phiBin) const; /** - * Calculat the difference @f$a_1 - a_2@$f between two angles + * Calculat the difference @f$a_1 - a_2@f$ between two angles * @f$a_1, a_2@f$ and normalize to @f$[-\pi/2,\pi/2]@f$ * * @param a1 First angle @f$a_1@f$ diff --git a/PWGLF/FORWARD/analysis2/AliFMDMCEventInspector.h b/PWGLF/FORWARD/analysis2/AliFMDMCEventInspector.h index 63754ac2e1a..622c1607eed 100644 --- a/PWGLF/FORWARD/analysis2/AliFMDMCEventInspector.h +++ b/PWGLF/FORWARD/analysis2/AliFMDMCEventInspector.h @@ -86,7 +86,7 @@ public: * means outside of the defined vertex range * @param vz On return, the z position of the interaction * @param b On return, impact parameter [fm] (if available) - * @param b On return, centrality estimate [%] (if available) + * @param c On return, centrality estimate [%] (if available) * @param npart On return, number of participants (if available) * @param nbin On return, number of binary collisions (if available) * @param phiR On return, reaction plane angle (if available) diff --git a/PWGLF/FORWARD/analysis2/AliFMDSharingFilter.h b/PWGLF/FORWARD/analysis2/AliFMDSharingFilter.h index 76ae5de9c7d..85cc3bbdbf4 100644 --- a/PWGLF/FORWARD/analysis2/AliFMDSharingFilter.h +++ b/PWGLF/FORWARD/analysis2/AliFMDSharingFilter.h @@ -98,7 +98,7 @@ public: /** * Initialize * - * @param default eta axis from parent task + * @param axis Default eta axis from parent task */ void Init(const TAxis& axis); /** diff --git a/PWGLF/FORWARD/analysis2/AliForwarddNdetaTask.cxx b/PWGLF/FORWARD/analysis2/AliForwarddNdetaTask.cxx index 6013234aaf0..d66dff3ce63 100644 --- a/PWGLF/FORWARD/analysis2/AliForwarddNdetaTask.cxx +++ b/PWGLF/FORWARD/analysis2/AliForwarddNdetaTask.cxx @@ -102,6 +102,7 @@ AliForwarddNdetaTask::CentralityBin::End(TList* sums, UShort_t scheme, const TH2F* shapeCorr, Double_t trigEff, + Double_t trigEff0, Bool_t symmetrice, Int_t rebin, Bool_t rootProj, @@ -116,7 +117,7 @@ AliForwarddNdetaTask::CentralityBin::End(TList* sums, DGUARD(fDebug, 1, "In End of %s with corrEmpty=%d, cutEdges=%d, rootProj=%d", GetName(), corrEmpty, cutEdges, rootProj); AliBasedNdetaTask::CentralityBin::End(sums, results, scheme, - shapeCorr, trigEff, + shapeCorr, trigEff, trigEff0, symmetrice, rebin, rootProj, corrEmpty, cutEdges, triggerMask, marker, color, mclist, @@ -145,14 +146,17 @@ AliForwarddNdetaTask::CentralityBin::End(TList* sums, AliError("Triggers histogram not set"); return; } + Double_t ntotal = 0; Double_t epsilonT = trigEff; +#if 0 // TEMPORARY FIX if (triggerMask == AliAODForwardMult::kNSD) { // This is a local change epsilonT = 0.92; AliWarning(Form("Using hard-coded NSD trigger efficiency of %f",epsilonT)); } +#endif AliInfo("Adding per-ring histograms to output"); Double_t scaler = Normalization(*fTriggers, scheme, epsilonT, ntotal); TIter next(res->GetHists()); diff --git a/PWGLF/FORWARD/analysis2/AliForwarddNdetaTask.h b/PWGLF/FORWARD/analysis2/AliForwarddNdetaTask.h index 87a460d5f90..0e2026a03aa 100644 --- a/PWGLF/FORWARD/analysis2/AliForwarddNdetaTask.h +++ b/PWGLF/FORWARD/analysis2/AliForwarddNdetaTask.h @@ -132,6 +132,7 @@ protected: * @param scheme Normalisation scheme options * @param shapeCorr Shape correction or nil * @param trigEff Trigger efficiency + * @param trigEff0 0-bin trigger efficiency * @param symmetrice Whether to symmetrice the results * @param rebin Whether to rebin the results * @param rootProj If true, use TH2::ProjectionX @@ -148,6 +149,7 @@ protected: UShort_t scheme, const TH2F* shapeCorr, Double_t trigEff, + Double_t trigEff0, Bool_t symmetrice, Int_t rebin, Bool_t rootProj, diff --git a/PWGLF/FORWARD/analysis2/AliMCTruthdNdetaTask.cxx b/PWGLF/FORWARD/analysis2/AliMCTruthdNdetaTask.cxx index ca949b98c4e..fe545e8c9e2 100644 --- a/PWGLF/FORWARD/analysis2/AliMCTruthdNdetaTask.cxx +++ b/PWGLF/FORWARD/analysis2/AliMCTruthdNdetaTask.cxx @@ -192,6 +192,7 @@ AliMCTruthdNdetaTask::CentralityBin::End(TList* sums, UShort_t scheme, const TH2F* shapeCorr, Double_t trigEff, + Double_t trigEff0, Bool_t symmetrice, Int_t rebin, Bool_t rootProj, @@ -208,13 +209,13 @@ AliMCTruthdNdetaTask::CentralityBin::End(TList* sums, "shapeCorr=%p, trigEff=%f, symmetrice=%d, rebin=%d, " "rootProj=%d, corrEmpty=%d, cutEdges=%d, triggerMask=0x%08x, " "marker=%d (%d)", - sums, results, scheme, shapeCorr, trigEff, symmetrice, + sums, results, scheme, shapeCorr, trigEff, trigEff0, symmetrice, rebin, rootProj, corrEmpty, cutEdges, triggerMask, marker, GetMarkerStyle(kStar))); #endif AliBasedNdetaTask::CentralityBin::End(sums, results, scheme, - shapeCorr, trigEff, + shapeCorr, trigEff, trigEff0, symmetrice, rebin, rootProj, corrEmpty, cutEdges, triggerMask, marker, color, mclist, diff --git a/PWGLF/FORWARD/analysis2/AliMCTruthdNdetaTask.h b/PWGLF/FORWARD/analysis2/AliMCTruthdNdetaTask.h index f9c190a8f58..36986b3a3e9 100644 --- a/PWGLF/FORWARD/analysis2/AliMCTruthdNdetaTask.h +++ b/PWGLF/FORWARD/analysis2/AliMCTruthdNdetaTask.h @@ -166,6 +166,7 @@ protected: * @param scheme Normalisation scheme options * @param shapeCorr Shape correction or nil * @param trigEff Trigger efficiency + * @param trigEff0 0-bin trigger efficiency * @param symmetrice Whether to symmetrice the results * @param rebin Whether to rebin the results * @param rootProj If true, use TH2::ProjectionX @@ -182,6 +183,7 @@ protected: UShort_t scheme, const TH2F* shapeCorr, Double_t trigEff, + Double_t trigEff0, Bool_t symmetrice, Int_t rebin, Bool_t rootProj, diff --git a/PWGLF/FORWARD/analysis2/CentralAODConfig.C b/PWGLF/FORWARD/analysis2/CentralAODConfig.C index 86be1dc2c5d..1d2005c7709 100644 --- a/PWGLF/FORWARD/analysis2/CentralAODConfig.C +++ b/PWGLF/FORWARD/analysis2/CentralAODConfig.C @@ -28,6 +28,23 @@ CentralAODConfig(AliCentralMultiplicityTask* task) task->SetUseSecondary(true); // Whether to do correction for acceptance task->SetUseAcceptance(true); + + // --- Event inspector --------------------------------------------- + // Set the number of SPD tracklets for which we consider the event a + // low flux event + task->GetInspector().SetLowFluxCut(1000); + // Set the maximum error on v_z [cm] + task->GetInspector().SetMaxVzErr(0.2); + // Least number of constributors to 2nd pile-up vertex + task->GetInspector().SetMinPileupContributors(3); + // Least distance from primary to 2nd pile-up vertex (cm) + task->GetInspector().SetMinPileupDistance(.8); + // V0-AND triggered events flagged as NSD + task->GetInspector().SetUseV0AndForNSD(false); + // Use primary vertex selection from 1st physics WG + // task->GetInspector().SetUseFirstPhysicsVtx(true); + // Use satellite collisions + // task->GetInspector().SetUseDisplacedVertices(true); // task->GetInspector().SetDebug(4); // task->GetManager().SetSecMapPath("."); diff --git a/PWGLF/FORWARD/analysis2/DrawdNdeta.C b/PWGLF/FORWARD/analysis2/DrawdNdeta.C index 2bff1cbf9e3..7a88035ca3a 100644 --- a/PWGLF/FORWARD/analysis2/DrawdNdeta.C +++ b/PWGLF/FORWARD/analysis2/DrawdNdeta.C @@ -529,11 +529,14 @@ struct dNdetaDrawer /** * Get the results from the top-level list * - * @param list List - * @param name name - * @param max On return, maximum of data - * @param rmax On return, maximum of ratios - * @param amax On return, maximum of left-right comparisons + * @param list List + * @param mcList List of histograms from MC + * @param empCorr Emperical correction if any + * @param name name + * @param max On return, maximum of data + * @param rmax On return, maximum of ratios + * @param amax On return, maximum of left-right comparisons + * @param truths List of MC truths to compare to. * * @return Array of results */ @@ -703,6 +706,8 @@ struct dNdetaDrawer * Fetch results for a particular centrality bin * * @param list List + * @param mcList List of MC results + * @param empCorr Emperical correction if any * @param name Name * @param thisOther Other graphs * @param color Color @@ -710,6 +715,7 @@ struct dNdetaDrawer * @param max On return, data maximum * @param rmax On return, ratio maximum * @param amax On return, left-right maximum + * @param truth MC truth to compare to or possibly update * * @return Histogram of results */ @@ -917,12 +923,13 @@ struct dNdetaDrawer /** * Build main legend * - * @param stack Stack to include - * @param mg (optional) Multi graph to include - * @param x1 Lower X coordinate in the range [0,1] - * @param y1 Lower Y coordinate in the range [0,1] - * @param x2 Upper X coordinate in the range [0,1] - * @param y2 Upper Y coordinate in the range [0,1] + * @param stack Stack to include + * @param mg (optional) Multi graph to include + * @param x1 Lower X coordinate in the range [0,1] + * @param y1 Lower Y coordinate in the range [0,1] + * @param x2 Upper X coordinate in the range [0,1] + * @param y2 Upper Y coordinate in the range [0,1] + * @param forceCol If non-zero, force this many columns */ void BuildLegend(THStack* stack, TMultiGraph* mg, Double_t x1, Double_t y1, Double_t x2, Double_t y2, diff --git a/PWGLF/FORWARD/analysis2/ForwardAODConfig.C b/PWGLF/FORWARD/analysis2/ForwardAODConfig.C index 0de5a230d7b..af7d1cca062 100644 --- a/PWGLF/FORWARD/analysis2/ForwardAODConfig.C +++ b/PWGLF/FORWARD/analysis2/ForwardAODConfig.C @@ -74,9 +74,11 @@ ForwardAODConfig(AliForwardMultiplicityBase* task) // Least distance from primary to 2nd pile-up vertex (cm) task->GetEventInspector().SetMinPileupDistance(.8); // V0-AND triggered events flagged as NSD - task->GetEventInspector().SetUseV0AndForNSD(true); + task->GetEventInspector().SetUseV0AndForNSD(false); // Use primary vertex selection from 1st physics WG // task->GetEventInspector().SetUseFirstPhysicsVtx(true); + // Use satellite collisions + // task->GetEventInspector().SetUseDisplacedVertices(true); // --- Sharing filter ---------------------------------------------- // Set the low cut used for sharing - overrides settings in eloss fits diff --git a/PWGLF/FORWARD/analysis2/doc/Trains.C b/PWGLF/FORWARD/analysis2/doc/Trains.C index e1e216088fe..f72bf6e9b07 100644 --- a/PWGLF/FORWARD/analysis2/doc/Trains.C +++ b/PWGLF/FORWARD/analysis2/doc/Trains.C @@ -57,9 +57,9 @@ * * or using the program @b runTrain * - * @verbatim - > runTrain --class=<class> --name=<name> [<options>] - @endverbatim + * @code + * > runTrain --class= --name= [] + * @endcode * * Here, * @@ -100,6 +100,67 @@ * setting used for the train and can easily be used to run merging * and terminate as needed. * + * @section train_setup_proof_spec PROOF specifics + * + * Local and Grid jobs are in a sense very similar. That is, the + * individual Grid jobs are very much like Local jobs, in that they + * always produce output files which albiet not after Terminate. + * + * PROOF jobs are very different. In a PROOF analysis, each slave + * only produces in memory output which is then sent via net + * connections (sockets) to the master. One therefore needs to be + * very of output object ownership and the like. + * + * Another major difference is that output files are generated within + * the PROOF cluster, and are generally not accessible from the + * outside. For plain PROOF clusters in a local area network or + * so-called Lite session, it is generally not a problem since + * the files are accessible on the LAN or local machine for Lite + * sessions. However, for large scale analysis farms (AAFs), the + * workers and masters are generally on a in-accessible sub-net, and + * there's no direct access to the produced files. Now, for normal + * output files, like histogram files, etc. there are provisions for + * this, which means the final merged output is sent back to the + * client. Special output, such as AODs, are however not merged nor + * sent back to the user by default. There are two ways to deal with this: + * + *
    + *
  1. Register the output tree as a data set on the cluster. This is useful if you need to process the results again on the cluster.
  2. + *
  3. Send the output to a (possibly custom) XRootd server. This is useful if you need to process the output outside of the cluster
  4. + *
+ * + * The first mode is specified by passing the option + * dsname=<name> in the cluster URI. The created + * dataset will normally be made in + * /default/<user>/<name>. If the + * =<name> part is left out, the escaped name of + * the job will be used. + * + * The second mode is triggered by passing the option + * storage=URI to the train setup. The URI + * should be of the form + * + * @code + * rootd://[:]/ + * @endcode + * + * where <host> is the name of a machine accessible by + * the cluster, <port> is an optional port number (e.g., + * if different from 1093), and <path> is an absolute + * path on <host>. + * + * The XRootd process should be started (optionally by the user) on + * <host> as + * + * @code + * xrootd -p + * @endcode + * + * When running jobs on AAFs, one can use the Grid handler to set-up + * aspects of the job. However, sometimes it's desirable to leave the + * Grid handler out. To do that, pass the option plain in + * the cluster URI. + * * @section train_setup_input Specifying the input * @subsection train_setup_local Local data input * @@ -128,13 +189,16 @@ * @subsection train_setup_proof PROOF input. * * The input data for a PROOF based analysis can be specified as per a - * Local job, in which case the data must be available to the slaves - * at the specified locations, or one can specify a data-set name via + * Local job if the cluster used is local, in which case the data must + * be available to the slaves at the specified locations, or one can + * specify a data-set name via * * @code * train->SetDataSet(""); * @endcode * + * @b Note: For AAFs using the Grid Handler one must use data sets. + * * @subsection train_setup_grid_esd Grid ESD input. * * Suppose the ESD files are stored on the Grid as -- 2.39.3