From d015ecfe2c0625b8ad5a62823495c226e1bb41ba Mon Sep 17 00:00:00 2001 From: cholm Date: Tue, 15 Nov 2011 11:49:50 +0000 Subject: [PATCH] Fixes for coverity checks. Added QA script Draw123.C to draw eloss from single, double, and triple hits Added QA shell script to draw all QA stuff and put the result in a PDF --- FMD/AliFMDBaseDA.h | 1 + FMD/AliFMDBaseDigitizer.cxx | 1 + FMD/AliFMDBoolMap.cxx | 1 + FMD/AliFMDCalibGain.cxx | 2 + FMD/AliFMDCalibPedestal.cxx | 2 + FMD/AliFMDDetector.cxx | 1 + FMD/AliFMDEdepHitPair.h | 1 + FMD/AliFMDEdepMap.cxx | 1 + FMD/AliFMDGeometry.cxx | 1 + FMD/AliFMDHitDigitizer.cxx | 1 + FMD/AliFMDIndex.cxx | 1 + FMD/AliFMDIndex.h | 6 + FMD/AliFMDUShortMap.cxx | 1 + PWG2/FORWARD/analysis2/AliBasedNdetaTask.cxx | 1 + .../analysis2/AliCentralMCCorrectionsTask.cxx | 2 + .../analysis2/AliCentralMultiplicityTask.cxx | 2 + PWG2/FORWARD/analysis2/AliFMDCorrELossFit.cxx | 2 + PWG2/FORWARD/analysis2/AliFMDCorrector.cxx | 2 + .../analysis2/AliFMDDensityCalculator.cxx | 2 + PWG2/FORWARD/analysis2/AliFMDEnergyFitter.cxx | 2 + .../analysis2/AliFMDEnergyFitterTask.cxx | 1 + .../analysis2/AliFMDEventInspector.cxx | 1 + .../FORWARD/analysis2/AliFMDHistCollector.cxx | 1 + PWG2/FORWARD/analysis2/AliFMDMCCorrector.cxx | 1 + .../analysis2/AliFMDMCTrackDensity.cxx | 1 + PWG2/FORWARD/analysis2/AliFMDMultCuts.cxx | 1 + .../FORWARD/analysis2/AliFMDSharingFilter.cxx | 2 + .../analysis2/AliForwardFlowTaskQC.cxx | 1 + .../analysis2/AliForwardMCCorrectionsTask.cxx | 2 + .../AliForwardMCMultiplicityTask.cxx | 1 + .../analysis2/AliForwardMultiplicityBase.cxx | 1 + .../analysis2/AliForwardMultiplicityTask.cxx | 1 + PWG2/FORWARD/analysis2/AliForwardQATask.cxx | 1 + PWG2/FORWARD/analysis2/AliForwardUtil.h | 1 + .../analysis2/AliPoissonCalculator.cxx | 1 + .../analysis2/AliSPDMCTrackDensity.cxx | 1 + PWG2/FORWARD/analysis2/corrs/DrawAnaELoss.C | 67 +++++---- PWG2/FORWARD/analysis2/qa/Draw123.C | 137 ++++++++++++++++++ PWG2/FORWARD/analysis2/qa/DrawBeforeAfter.C | 25 +++- PWG2/FORWARD/analysis2/qa/DrawELossPoisson.C | 40 ++++- PWG2/FORWARD/analysis2/qa/DrawNeighbors.C | 23 ++- PWG2/FORWARD/analysis2/qa/DrawOccupancy.C | 30 +++- PWG2/FORWARD/analysis2/qa/DrawQA.C | 23 ++- PWG2/FORWARD/analysis2/qa/DrawQA.sh | 92 ++++++++++++ PWG2/FORWARD/analysis2/qa/DrawRecAnaEloss.C | 27 ++-- 45 files changed, 450 insertions(+), 65 deletions(-) create mode 100644 PWG2/FORWARD/analysis2/qa/Draw123.C create mode 100755 PWG2/FORWARD/analysis2/qa/DrawQA.sh diff --git a/FMD/AliFMDBaseDA.h b/FMD/AliFMDBaseDA.h index dce3913095b..36fda2ee4f6 100644 --- a/FMD/AliFMDBaseDA.h +++ b/FMD/AliFMDBaseDA.h @@ -55,6 +55,7 @@ public: * */ ~AliFMDBaseDA() ; + AliFMDBaseDA& operator=(const AliFMDBaseDA&) { return *this; } /** * Run this DA * diff --git a/FMD/AliFMDBaseDigitizer.cxx b/FMD/AliFMDBaseDigitizer.cxx index a689e00b0b5..7dcf7e416de 100644 --- a/FMD/AliFMDBaseDigitizer.cxx +++ b/FMD/AliFMDBaseDigitizer.cxx @@ -285,6 +285,7 @@ AliFMDBaseDigitizer::operator=(const AliFMDBaseDigitizer& o) // Return: // Reference to this object // + if (&o == this) return *this; AliDigitizer::operator=(o); fRunLoader = o.fRunLoader; fEdep = o.fEdep; diff --git a/FMD/AliFMDBoolMap.cxx b/FMD/AliFMDBoolMap.cxx index 3a7b86e4649..16f20c67b41 100644 --- a/FMD/AliFMDBoolMap.cxx +++ b/FMD/AliFMDBoolMap.cxx @@ -85,6 +85,7 @@ AliFMDBoolMap& AliFMDBoolMap::operator=(const AliFMDBoolMap& other) { // Assignment operator + if (&other == this) return *this; fMaxDetectors = other.fMaxDetectors; fMaxRings = other.fMaxRings; fMaxSectors = other.fMaxSectors; diff --git a/FMD/AliFMDCalibGain.cxx b/FMD/AliFMDCalibGain.cxx index 42f14a5efcb..72ac806bd7f 100644 --- a/FMD/AliFMDCalibGain.cxx +++ b/FMD/AliFMDCalibGain.cxx @@ -65,6 +65,7 @@ AliFMDCalibGain& AliFMDCalibGain::operator=(const AliFMDCalibGain& o) { // Assignment operator + if (&o == this) return *this; fValue = o.fValue; fThreshold = o.fThreshold; return (*this); @@ -103,6 +104,7 @@ namespace { {} MakeDead& operator=(const MakeDead& other) { + if (&other == this) return *this; fDead = other.fDead; fMin = other.fMin; fMax = other.fMax; diff --git a/FMD/AliFMDCalibPedestal.cxx b/FMD/AliFMDCalibPedestal.cxx index 6735bc1e868..9ef31e30ca5 100644 --- a/FMD/AliFMDCalibPedestal.cxx +++ b/FMD/AliFMDCalibPedestal.cxx @@ -64,6 +64,7 @@ AliFMDCalibPedestal& AliFMDCalibPedestal::operator=(const AliFMDCalibPedestal& o) { // Assignment operator + if (&o == this) return *this; fValue = o.fValue; fWidth = o.fWidth; return (*this); @@ -111,6 +112,7 @@ namespace { {} MakeDead& operator=(const MakeDead& other) { + if (&other == this) return *this; fDead = other.fDead; fMax = other.fMax; fCount = other.fCount; diff --git a/FMD/AliFMDDetector.cxx b/FMD/AliFMDDetector.cxx index b9d636f11a2..78cc6ffd1e8 100644 --- a/FMD/AliFMDDetector.cxx +++ b/FMD/AliFMDDetector.cxx @@ -108,6 +108,7 @@ AliFMDDetector& AliFMDDetector::operator=(const AliFMDDetector& other) { // Assignment operator + if (&other == this) return *this; SetName(other.GetName()); SetTitle(other.GetTitle()); fId = other.fId; diff --git a/FMD/AliFMDEdepHitPair.h b/FMD/AliFMDEdepHitPair.h index 6c6b41cef84..88d0c598101 100644 --- a/FMD/AliFMDEdepHitPair.h +++ b/FMD/AliFMDEdepHitPair.h @@ -50,6 +50,7 @@ public: @return Reference to this object */ AliFMDEdepHitPair& operator=(const AliFMDEdepHitPair& o) { + if (&o == this) return *this; fEdep = o.fEdep; fN = o.fN; fNPrim = o.fNPrim; diff --git a/FMD/AliFMDEdepMap.cxx b/FMD/AliFMDEdepMap.cxx index 634161935fa..7a34c10ea98 100644 --- a/FMD/AliFMDEdepMap.cxx +++ b/FMD/AliFMDEdepMap.cxx @@ -87,6 +87,7 @@ AliFMDEdepMap& AliFMDEdepMap::operator=(const AliFMDEdepMap& other) { // Assignment operator + if (&other == this) return *this; fMaxDetectors = other.fMaxDetectors; fMaxRings = other.fMaxRings; fMaxSectors = other.fMaxSectors; diff --git a/FMD/AliFMDGeometry.cxx b/FMD/AliFMDGeometry.cxx index 7844a482ec3..8050cc0d98a 100644 --- a/FMD/AliFMDGeometry.cxx +++ b/FMD/AliFMDGeometry.cxx @@ -216,6 +216,7 @@ AliFMDGeometry::operator=(const AliFMDGeometry& other) // Return: // reference to this. // + if (&other == this) return *this; fUseFMD1 = other.fUseFMD1; fUseFMD2 = other.fUseFMD2; fUseFMD3 = other.fUseFMD3; diff --git a/FMD/AliFMDHitDigitizer.cxx b/FMD/AliFMDHitDigitizer.cxx index ad7d7f33459..3c4e1b6ae7e 100644 --- a/FMD/AliFMDHitDigitizer.cxx +++ b/FMD/AliFMDHitDigitizer.cxx @@ -231,6 +231,7 @@ AliFMDHitDigitizer::operator=(const AliFMDHitDigitizer& o) * @param o Object to assign from * @return Reference to this */ + if (&o == this) return *this; AliFMDBaseDigitizer::operator=(o); fHoldTime = o.fHoldTime; fOutput = o.fOutput; diff --git a/FMD/AliFMDIndex.cxx b/FMD/AliFMDIndex.cxx index 919b2b19042..16e80c3e004 100644 --- a/FMD/AliFMDIndex.cxx +++ b/FMD/AliFMDIndex.cxx @@ -95,6 +95,7 @@ AliFMDIndex& AliFMDIndex::operator=(const AliFMDIndex& o) { // Assignment operator + if (&o == this) return *this; fDetector = o.fDetector; fRing = o.fRing; fSector = o.fSector; diff --git a/FMD/AliFMDIndex.h b/FMD/AliFMDIndex.h index a16f0bfe66b..dac5c79efe9 100644 --- a/FMD/AliFMDIndex.h +++ b/FMD/AliFMDIndex.h @@ -121,6 +121,12 @@ public: {} /** DTOR */ virtual ~AliFMDObjIndex() {} + AliFMDObjIndex& operator=(const AliFMDObjIndex& o) + { + if (&o == this) return *this; + AliFMDIndex::operator=(o); + return *this; + } /** @return name */ virtual const char* GetName() const { return AliFMDIndex::Name(); } /** sort compare for TCollection's diff --git a/FMD/AliFMDUShortMap.cxx b/FMD/AliFMDUShortMap.cxx index b688651c947..b0e75f6e94d 100644 --- a/FMD/AliFMDUShortMap.cxx +++ b/FMD/AliFMDUShortMap.cxx @@ -86,6 +86,7 @@ AliFMDUShortMap& AliFMDUShortMap::operator=(const AliFMDUShortMap& other) { // Assignment operator + if (&other == this) return *this; fMaxDetectors = other.fMaxDetectors; fMaxRings = other.fMaxRings; fMaxSectors = other.fMaxSectors; diff --git a/PWG2/FORWARD/analysis2/AliBasedNdetaTask.cxx b/PWG2/FORWARD/analysis2/AliBasedNdetaTask.cxx index c543f4bad81..ac94b2ccb44 100644 --- a/PWG2/FORWARD/analysis2/AliBasedNdetaTask.cxx +++ b/PWG2/FORWARD/analysis2/AliBasedNdetaTask.cxx @@ -1229,6 +1229,7 @@ AliBasedNdetaTask::CentralityBin::operator=(const CentralityBin& o) // Return: // Reference to this // + if (&o == this) return *this; SetName(o.GetName()); SetTitle(o.GetTitle()); fSums = o.fSums; diff --git a/PWG2/FORWARD/analysis2/AliCentralMCCorrectionsTask.cxx b/PWG2/FORWARD/analysis2/AliCentralMCCorrectionsTask.cxx index dcbaf64036b..7c5581b6be6 100644 --- a/PWG2/FORWARD/analysis2/AliCentralMCCorrectionsTask.cxx +++ b/PWG2/FORWARD/analysis2/AliCentralMCCorrectionsTask.cxx @@ -138,6 +138,7 @@ AliCentralMCCorrectionsTask::operator=(const AliCentralMCCorrectionsTask& o) // Return: // Reference to this object // + if (&o == this) return *this; fInspector = o.fInspector; fTrackDensity = o.fTrackDensity; fVtxBins = o.fVtxBins; @@ -542,6 +543,7 @@ AliCentralMCCorrectionsTask::VtxBin::VtxBin(const VtxBin& o) AliCentralMCCorrectionsTask::VtxBin& AliCentralMCCorrectionsTask::VtxBin::operator=(const VtxBin& o) { + if (&o == this) return *this; TNamed::operator=(o); fHits = 0; fPrimary = 0; diff --git a/PWG2/FORWARD/analysis2/AliCentralMultiplicityTask.cxx b/PWG2/FORWARD/analysis2/AliCentralMultiplicityTask.cxx index 89866e465d5..6aa3c7986d2 100644 --- a/PWG2/FORWARD/analysis2/AliCentralMultiplicityTask.cxx +++ b/PWG2/FORWARD/analysis2/AliCentralMultiplicityTask.cxx @@ -107,6 +107,7 @@ AliCentralMultiplicityTask::operator=(const AliCentralMultiplicityTask& o) // // Assignment operator // + if (&o == this) return *this; fInspector = o.fInspector; fData = o.fData; fList = o.fList; @@ -570,6 +571,7 @@ AliCentralMultiplicityTask::Manager::operator=(const Manager& o) // // Assignment operator // + if (&o == this) return *this; fAcceptancePath = o.fAcceptancePath; fSecMapPath = o.fSecMapPath; fAcceptance = o.fAcceptance; diff --git a/PWG2/FORWARD/analysis2/AliFMDCorrELossFit.cxx b/PWG2/FORWARD/analysis2/AliFMDCorrELossFit.cxx index 0c2d89c2dd6..872ee734c3f 100644 --- a/PWG2/FORWARD/analysis2/AliFMDCorrELossFit.cxx +++ b/PWG2/FORWARD/analysis2/AliFMDCorrELossFit.cxx @@ -203,6 +203,7 @@ AliFMDCorrELossFit::ELossFit::operator=(const ELossFit& o) // Return: // Reference to this object // + if (&o == this) return *this; fN = o.fN; fNu = o.fNu; fChi2 = o.fChi2; @@ -606,6 +607,7 @@ AliFMDCorrELossFit::operator=(const AliFMDCorrELossFit& o) // Return: // Reference to this object // + if (&o == this) return *this; fRings = o.fRings; fLowCut = o.fLowCut; SetEtaAxis(o.fEtaAxis.GetNbins(), o.fEtaAxis.GetXmin(), o.fEtaAxis.GetXmax()); diff --git a/PWG2/FORWARD/analysis2/AliFMDCorrector.cxx b/PWG2/FORWARD/analysis2/AliFMDCorrector.cxx index 62a6f29f3c0..637599b86ea 100644 --- a/PWG2/FORWARD/analysis2/AliFMDCorrector.cxx +++ b/PWG2/FORWARD/analysis2/AliFMDCorrector.cxx @@ -95,6 +95,7 @@ AliFMDCorrector::operator=(const AliFMDCorrector& o) // // Parameters: // o Object to assign from + if (&o == this) return *this; TNamed::operator=(o); fDebug = o.fDebug; @@ -415,6 +416,7 @@ AliFMDCorrector::RingHistos::operator=(const RingHistos& o) // Return: // Reference to this // + if (&o == this) return *this; AliForwardUtil::RingHistos::operator=(o); if (fDensity) delete fDensity; diff --git a/PWG2/FORWARD/analysis2/AliFMDDensityCalculator.cxx b/PWG2/FORWARD/analysis2/AliFMDDensityCalculator.cxx index e383506b9f1..c96cdb64ad6 100644 --- a/PWG2/FORWARD/analysis2/AliFMDDensityCalculator.cxx +++ b/PWG2/FORWARD/analysis2/AliFMDDensityCalculator.cxx @@ -178,6 +178,7 @@ AliFMDDensityCalculator::operator=(const AliFMDDensityCalculator& o) // Return: // Reference to this object // + if (&o == this) return *this; TNamed::operator=(o); fDebug = o.fDebug; @@ -1075,6 +1076,7 @@ AliFMDDensityCalculator::RingHistos::operator=(const RingHistos& o) // Return: // Reference to this // + if (&o == this) return *this; AliForwardUtil::RingHistos::operator=(o); if (fEvsN) delete fEvsN; diff --git a/PWG2/FORWARD/analysis2/AliFMDEnergyFitter.cxx b/PWG2/FORWARD/analysis2/AliFMDEnergyFitter.cxx index efcce5232c0..152784c24c1 100644 --- a/PWG2/FORWARD/analysis2/AliFMDEnergyFitter.cxx +++ b/PWG2/FORWARD/analysis2/AliFMDEnergyFitter.cxx @@ -141,6 +141,7 @@ AliFMDEnergyFitter::operator=(const AliFMDEnergyFitter& o) // Return: // Reference to this // + if (&o == this) return *this; TNamed::operator=(o); fLowCut = o.fLowCut; @@ -545,6 +546,7 @@ AliFMDEnergyFitter::RingHistos::operator=(const RingHistos& o) // Return: // Reference to this // + if (&o == this) return *this; AliForwardUtil::RingHistos::operator=(o); if (fEDist) delete fEDist; diff --git a/PWG2/FORWARD/analysis2/AliFMDEnergyFitterTask.cxx b/PWG2/FORWARD/analysis2/AliFMDEnergyFitterTask.cxx index 4a91981e035..5178a5dcb54 100644 --- a/PWG2/FORWARD/analysis2/AliFMDEnergyFitterTask.cxx +++ b/PWG2/FORWARD/analysis2/AliFMDEnergyFitterTask.cxx @@ -99,6 +99,7 @@ AliFMDEnergyFitterTask::operator=(const AliFMDEnergyFitterTask& o) // Return: // Reference to this object // + if (&o == this) return *this; AliAnalysisTaskSE::operator=(o); fFirstEvent = o.fFirstEvent; diff --git a/PWG2/FORWARD/analysis2/AliFMDEventInspector.cxx b/PWG2/FORWARD/analysis2/AliFMDEventInspector.cxx index ba81ed383b5..a316282d988 100644 --- a/PWG2/FORWARD/analysis2/AliFMDEventInspector.cxx +++ b/PWG2/FORWARD/analysis2/AliFMDEventInspector.cxx @@ -144,6 +144,7 @@ AliFMDEventInspector::operator=(const AliFMDEventInspector& o) // Return: // Reference to this object // + if (&o == this) return *this; TNamed::operator=(o); fHEventsTr = o.fHEventsTr; fHEventsTrVtx = o.fHEventsTrVtx; diff --git a/PWG2/FORWARD/analysis2/AliFMDHistCollector.cxx b/PWG2/FORWARD/analysis2/AliFMDHistCollector.cxx index 7d73098f4c4..103c621ceae 100644 --- a/PWG2/FORWARD/analysis2/AliFMDHistCollector.cxx +++ b/PWG2/FORWARD/analysis2/AliFMDHistCollector.cxx @@ -95,6 +95,7 @@ AliFMDHistCollector::operator=(const AliFMDHistCollector& o) // Return: // Reference to this object // + if (&o == this) return *this; TNamed::operator=(o); fNCutBins = o.fNCutBins; diff --git a/PWG2/FORWARD/analysis2/AliFMDMCCorrector.cxx b/PWG2/FORWARD/analysis2/AliFMDMCCorrector.cxx index e12ec02d197..ca4ef2d0314 100644 --- a/PWG2/FORWARD/analysis2/AliFMDMCCorrector.cxx +++ b/PWG2/FORWARD/analysis2/AliFMDMCCorrector.cxx @@ -60,6 +60,7 @@ AliFMDMCCorrector::operator=(const AliFMDMCCorrector& o) // Return: // Reference to this object // + if (&o == this) return *this; AliFMDCorrector::operator=(o); fSecondaryForMC = o.fSecondaryForMC; return *this; diff --git a/PWG2/FORWARD/analysis2/AliFMDMCTrackDensity.cxx b/PWG2/FORWARD/analysis2/AliFMDMCTrackDensity.cxx index 0cf1e6e6aa6..63295dc558c 100644 --- a/PWG2/FORWARD/analysis2/AliFMDMCTrackDensity.cxx +++ b/PWG2/FORWARD/analysis2/AliFMDMCTrackDensity.cxx @@ -63,6 +63,7 @@ AliFMDMCTrackDensity& AliFMDMCTrackDensity::operator=(const AliFMDMCTrackDensity& o) { // Assignment operator + if (&o == this) return *this; TNamed::operator=(o); fUseOnlyPrimary = o.fUseOnlyPrimary; fMaxConsequtiveStrips = o.fMaxConsequtiveStrips; diff --git a/PWG2/FORWARD/analysis2/AliFMDMultCuts.cxx b/PWG2/FORWARD/analysis2/AliFMDMultCuts.cxx index ec4b8228984..10161fa0153 100644 --- a/PWG2/FORWARD/analysis2/AliFMDMultCuts.cxx +++ b/PWG2/FORWARD/analysis2/AliFMDMultCuts.cxx @@ -32,6 +32,7 @@ AliFMDMultCuts::AliFMDMultCuts(const AliFMDMultCuts& o) AliFMDMultCuts& AliFMDMultCuts::operator=(const AliFMDMultCuts& o) { + if (&o == this) return *this; fMPVFraction = o.fMPVFraction; fNXi = o.fNXi; fIncludeSigma = o.fIncludeSigma; diff --git a/PWG2/FORWARD/analysis2/AliFMDSharingFilter.cxx b/PWG2/FORWARD/analysis2/AliFMDSharingFilter.cxx index 978a1d926f9..32b9c5d5c67 100644 --- a/PWG2/FORWARD/analysis2/AliFMDSharingFilter.cxx +++ b/PWG2/FORWARD/analysis2/AliFMDSharingFilter.cxx @@ -161,6 +161,7 @@ AliFMDSharingFilter::operator=(const AliFMDSharingFilter& o) // Return: // Reference to this // + if (&o == this) return *this; TNamed::operator=(o); fCorrectAngles = o.fCorrectAngles; @@ -1163,6 +1164,7 @@ AliFMDSharingFilter::RingHistos::operator=(const RingHistos& o) // Return: // Reference to this // + if (&o == this) return *this; AliForwardUtil::RingHistos::operator=(o); fDet = o.fDet; fRing = o.fRing; diff --git a/PWG2/FORWARD/analysis2/AliForwardFlowTaskQC.cxx b/PWG2/FORWARD/analysis2/AliForwardFlowTaskQC.cxx index 951d3b1660a..e2813fdf41f 100644 --- a/PWG2/FORWARD/analysis2/AliForwardFlowTaskQC.cxx +++ b/PWG2/FORWARD/analysis2/AliForwardFlowTaskQC.cxx @@ -57,6 +57,7 @@ AliForwardFlowTaskQC::AliForwardFlowTaskQC() // // Default constructor // + for (Int_t n = 0; n <= 6; n++) fv[n] = kTRUE; } //_____________________________________________________________________ AliForwardFlowTaskQC::AliForwardFlowTaskQC(const char* name) : diff --git a/PWG2/FORWARD/analysis2/AliForwardMCCorrectionsTask.cxx b/PWG2/FORWARD/analysis2/AliForwardMCCorrectionsTask.cxx index 0bc47389e86..9a12d405261 100644 --- a/PWG2/FORWARD/analysis2/AliForwardMCCorrectionsTask.cxx +++ b/PWG2/FORWARD/analysis2/AliForwardMCCorrectionsTask.cxx @@ -140,6 +140,7 @@ AliForwardMCCorrectionsTask::operator=(const AliForwardMCCorrectionsTask& o) // Return: // Reference to this object // + if (&o == this) return *this; fInspector = o.fInspector; fTrackDensity = o.fTrackDensity; fESDFMD = o.fESDFMD; @@ -565,6 +566,7 @@ AliForwardMCCorrectionsTask::VtxBin::VtxBin(const VtxBin& o) AliForwardMCCorrectionsTask::VtxBin& AliForwardMCCorrectionsTask::VtxBin::operator=(const VtxBin& o) { + if (&o == this) return *this; TNamed::operator=(o); fHists = o.fHists; fPrimary = 0; diff --git a/PWG2/FORWARD/analysis2/AliForwardMCMultiplicityTask.cxx b/PWG2/FORWARD/analysis2/AliForwardMCMultiplicityTask.cxx index 185feef5508..1fcad32d8de 100644 --- a/PWG2/FORWARD/analysis2/AliForwardMCMultiplicityTask.cxx +++ b/PWG2/FORWARD/analysis2/AliForwardMCMultiplicityTask.cxx @@ -124,6 +124,7 @@ AliForwardMCMultiplicityTask::operator=(const AliForwardMCMultiplicityTask& o) // Return: // Reference to this object // + if (&o == this) return *this; AliForwardMultiplicityBase::operator=(o); fHData = o.fHData; diff --git a/PWG2/FORWARD/analysis2/AliForwardMultiplicityBase.cxx b/PWG2/FORWARD/analysis2/AliForwardMultiplicityBase.cxx index 7230dc5d588..34218555c65 100644 --- a/PWG2/FORWARD/analysis2/AliForwardMultiplicityBase.cxx +++ b/PWG2/FORWARD/analysis2/AliForwardMultiplicityBase.cxx @@ -49,6 +49,7 @@ AliForwardMultiplicityBase::AliForwardMultiplicityBase(const char* name) AliForwardMultiplicityBase& AliForwardMultiplicityBase::operator=(const AliForwardMultiplicityBase& o) { + if (&o == this) return *this; fEnableLowFlux = o.fEnableLowFlux; fFirstEvent = o.fFirstEvent; fCorrManager = o.fCorrManager; diff --git a/PWG2/FORWARD/analysis2/AliForwardMultiplicityTask.cxx b/PWG2/FORWARD/analysis2/AliForwardMultiplicityTask.cxx index ca934d6fb07..b7508e60aa9 100644 --- a/PWG2/FORWARD/analysis2/AliForwardMultiplicityTask.cxx +++ b/PWG2/FORWARD/analysis2/AliForwardMultiplicityTask.cxx @@ -108,6 +108,7 @@ AliForwardMultiplicityTask::operator=(const AliForwardMultiplicityTask& o) // Return: // Reference to this object // + if (&o == this) return *this; AliForwardMultiplicityBase::operator=(o); fHData = o.fHData; diff --git a/PWG2/FORWARD/analysis2/AliForwardQATask.cxx b/PWG2/FORWARD/analysis2/AliForwardQATask.cxx index a2e16ffdf05..807e96e169c 100644 --- a/PWG2/FORWARD/analysis2/AliForwardQATask.cxx +++ b/PWG2/FORWARD/analysis2/AliForwardQATask.cxx @@ -120,6 +120,7 @@ AliForwardQATask::operator=(const AliForwardQATask& o) // Return: // Reference to this object // + if (&o == this) return *this; AliAnalysisTaskSE::operator=(o); fEnableLowFlux = o.fEnableLowFlux; diff --git a/PWG2/FORWARD/analysis2/AliForwardUtil.h b/PWG2/FORWARD/analysis2/AliForwardUtil.h index f2728ea53b4..cef26e0b0af 100644 --- a/PWG2/FORWARD/analysis2/AliForwardUtil.h +++ b/PWG2/FORWARD/analysis2/AliForwardUtil.h @@ -568,6 +568,7 @@ public: */ RingHistos& operator=(const RingHistos& o) { + if (&o == this) return *this; TObject::operator=(o); fDet = o.fDet; fRing = o.fRing; diff --git a/PWG2/FORWARD/analysis2/AliPoissonCalculator.cxx b/PWG2/FORWARD/analysis2/AliPoissonCalculator.cxx index 2f517ffcdf4..aa7712af5bd 100644 --- a/PWG2/FORWARD/analysis2/AliPoissonCalculator.cxx +++ b/PWG2/FORWARD/analysis2/AliPoissonCalculator.cxx @@ -123,6 +123,7 @@ AliPoissonCalculator::CleanUp() AliPoissonCalculator& AliPoissonCalculator::operator=(const AliPoissonCalculator& o) { + if (&o == this) return *this; TNamed::operator=(o); fEtaLumping = o.fEtaLumping; fPhiLumping = o.fPhiLumping; diff --git a/PWG2/FORWARD/analysis2/AliSPDMCTrackDensity.cxx b/PWG2/FORWARD/analysis2/AliSPDMCTrackDensity.cxx index 4ba68d1c4f8..ad072af5532 100644 --- a/PWG2/FORWARD/analysis2/AliSPDMCTrackDensity.cxx +++ b/PWG2/FORWARD/analysis2/AliSPDMCTrackDensity.cxx @@ -64,6 +64,7 @@ AliSPDMCTrackDensity& AliSPDMCTrackDensity::operator=(const AliSPDMCTrackDensity& o) { // Assignment operator + if (&o == this) return *this; TNamed::operator=(o); fUseOnlyPrimary = o.fUseOnlyPrimary; fMinR = o.fMinR; diff --git a/PWG2/FORWARD/analysis2/corrs/DrawAnaELoss.C b/PWG2/FORWARD/analysis2/corrs/DrawAnaELoss.C index 7c45626c716..69af59ddc38 100644 --- a/PWG2/FORWARD/analysis2/corrs/DrawAnaELoss.C +++ b/PWG2/FORWARD/analysis2/corrs/DrawAnaELoss.C @@ -21,6 +21,7 @@ TList* fitter = 0; TCanvas* canvas = 0; const char* pdfName = "FitResults.pdf"; +bool landscape = true; //____________________________________________________________________ /** @@ -122,7 +123,14 @@ TCanvas* CheckCanvas() gStyle->SetStatColor(0); gStyle->SetStatBorderSize(1); - canvas = new TCanvas("c", "C", Int_t(800 / TMath::Sqrt(2)), 800); + Int_t w = Int_t(800 / TMath::Sqrt(2)); + Int_t h = 800; + if (landscape) { + Int_t tmp = h; + h = w; + w = tmp; + } + canvas = new TCanvas("c", "C", w, h); canvas->SetFillColor(0); canvas->SetBorderMode(0); canvas->SetBorderSize(0); @@ -145,13 +153,13 @@ void CleanStack(THStack* stack) //____________________________________________________________________ THStack* -AddToStack(TList* stacks, TList* fitter, const char* name) +AddToStack(TList* stacks, TList* list, const char* name) { - TObject* o = fitter->FindObject(name); + TObject* o = list->FindObject(name); if (!o) { Warning("AddToStack", "Object %s not found in %s", name, - fitter->GetName()); - // fitter->ls(); + list->GetName()); + // list->ls(); return 0; } THStack* toAdd = static_cast(o); @@ -170,7 +178,8 @@ AddToStack(TList* stacks, TList* fitter, const char* name) * * @ingroup pwg2_forward_scripts_corr */ -void DrawSummary(const char* fname="forward_eloss.root") +void DrawSummary(const char* fname="forward_eloss.root", + bool onlySummary=true) { if (!CheckFitter(fname)) { Error("DrawFits", "File not opened"); @@ -183,13 +192,13 @@ void DrawSummary(const char* fname="forward_eloss.root") canvas->Clear(); TList stacks; - THStack* chi2nu = AddToStack(&stacks, fitter, "chi2"); - THStack* c = AddToStack(&stacks, fitter, "c"); - THStack* delta = AddToStack(&stacks, fitter, "delta"); - THStack* xi = AddToStack(&stacks, fitter, "xi"); - THStack* sigma = AddToStack(&stacks, fitter, "sigma"); - THStack* sigman = AddToStack(&stacks, fitter, "sigman"); - THStack* n = AddToStack(&stacks, fitter, "n"); + /* THStack* chi2nu = */ AddToStack(&stacks, fitter, "chi2"); + /* THStack* c = */ AddToStack(&stacks, fitter, "c"); + /* THStack* delta = */ AddToStack(&stacks, fitter, "delta"); + /* THStack* xi = */ AddToStack(&stacks, fitter, "xi"); + /* THStack* sigma = */ AddToStack(&stacks, fitter, "sigma"); + /* THStack* sigman = */ AddToStack(&stacks, fitter, "sigman"); + /* THStack* n = */ AddToStack(&stacks, fitter, "n"); Int_t baseA = stacks.GetEntries()+1; Int_t i = 2; while (true) { @@ -198,7 +207,7 @@ void DrawSummary(const char* fname="forward_eloss.root") } // stacks.ls(); Int_t nMax = stacks.GetEntries(); - for (Int_t i = nMax-1; i >= baseA; i--) { + for (i = nMax-1; i >= baseA; i--) { THStack* stack = static_cast(stacks.At(i)); TIter nextH(stack->GetHists()); TH1* hist = 0; @@ -210,21 +219,28 @@ void DrawSummary(const char* fname="forward_eloss.root") canvas->SetRightMargin(0.01); canvas->SetTopMargin(0.01); + Int_t nL = (nMax+1) / 2; Int_t nX = 2; - Int_t nY = (nMax+1) / 2; + Int_t nY = nL; + if (landscape) { + Int_t tmp = nY; + nY = nX; + nX = tmp; + } + canvas->Divide(nX, nY, 0.1, 0, 0); TIter next(&stacks); THStack* stack = 0; i = 0; - Int_t b = 1; + // Int_t b = 1; while ((stack = static_cast(next()))) { if (i > nMax) break; - Int_t ipad = 1+i/nY + 2 * (i % nY); + Int_t ipad = 1+i/nL + 2 * (i % nL); Info("DrawSummary", "cd'ing to canvas %d for %s", ipad, stack->GetName()); TVirtualPad* p = canvas->cd(ipad); - p->SetLeftMargin(.6/nY); + p->SetLeftMargin(.6/nL); p->SetTopMargin(.01); p->SetRightMargin(.01); p->SetFillColor(0); @@ -242,18 +258,18 @@ void DrawSummary(const char* fname="forward_eloss.root") if (i == 4 || i == 5) stack->SetMaximum(0.5); // sigma{,n} if (i == 7) stack->SetMaximum(0.5); // a if (i == 0) p->SetLogy(); - yaxis->SetTitleSize(0.3/nY); + yaxis->SetTitleSize(0.3/nL); yaxis->SetLabelSize(0.08); - yaxis->SetTitleOffset(2.5/nY); + yaxis->SetTitleOffset(2.5/nL); yaxis->SetNdivisions(5); yaxis->SetTitleFont(42); yaxis->SetLabelFont(42); yaxis->SetDecimals(); TAxis* xaxis = stack->GetHistogram()->GetXaxis(); - xaxis->SetTitleSize(0.3/nY); + xaxis->SetTitleSize(0.3/nL); xaxis->SetLabelSize(0.08); - xaxis->SetTitleOffset(2./nY); + xaxis->SetTitleOffset(2./nL); xaxis->SetNdivisions(10); xaxis->SetTitleFont(42); xaxis->SetLabelFont(42); @@ -262,11 +278,12 @@ void DrawSummary(const char* fname="forward_eloss.root") // Redraw stack->Draw("nostack"); i++; - if (i >= 5) b = 2; + // if (i >= 5) b = 2; p->cd(); } canvas->SaveAs("fit_results.png"); - canvas->Print(pdfName, "Title:Fit summary"); + if (!onlySummary) + canvas->Print(pdfName, "Title:Fit summary"); } //____________________________________________________________________ @@ -445,7 +462,7 @@ DrawAnaELoss(const char* fname="forward_eloss.root", bool onlySummary=true) return; } if (!onlySummary) canvas->Print(Form("%s[", pdfName)); - DrawSummary(fname); + DrawSummary(fname, onlySummary); if (onlySummary) return; DrawRings(fname); DrawEtaBins(fname); diff --git a/PWG2/FORWARD/analysis2/qa/Draw123.C b/PWG2/FORWARD/analysis2/qa/Draw123.C new file mode 100644 index 00000000000..e3cbac27da9 --- /dev/null +++ b/PWG2/FORWARD/analysis2/qa/Draw123.C @@ -0,0 +1,137 @@ +#ifndef __CINT__ +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include +#else +class TList; +#endif + +/** + * Draw the before/after merging image for a single ring + * + * @param p + * @param d + * @param r + * + * @ingroup pwg2_forward_scripts_qa + */ +void +DrawRing123(TList* p, UShort_t d, Char_t r) +{ + if (!p) return; + + TList* ring = static_cast(p->FindObject(Form("FMD%d%c",d,r))); + if (!ring) { + Error("Draw123", "List FMD%d%c not found in %s",d,r,p->GetName()); + return; + } + + TH1* one = static_cast(ring->FindObject("singleEloss")); + TH1* two = static_cast(ring->FindObject("doubleEloss")); + TH1* three = static_cast(ring->FindObject("tripleEloss")); + if (!one || !two || !three) { + Error("DrawRing123", "Histograms of Eloss not found in FMD%d%c", d, r); + return; + } + one->SetStats(0); + one->SetTitle(Form("FMD%d%c", d, r)); + one->GetXaxis()->SetRangeUser(0, 8); + + gPad->SetLogy(); + gPad->SetFillColor(0); + + one->Draw(); + if (two) two->Draw("same"); + if (three) three->Draw("same"); + + TLegend* l = new TLegend(.6, .6, .95, 1); + l->SetFillColor(0); + l->SetBorderSize(0); + l->AddEntry(one); + if (two) l->AddEntry(two); + if (three) l->AddEntry(three); + l->Draw(); + + gPad->cd(); +} + + +/** + * Draw the before/after sharing image for all rings + * + * @param filename + * + * @ingroup pwg2_forward_scripts_qa + */ +void +Draw123(const char* filename="forward.root", + const char* folder="ForwardResults") +{ + gStyle->SetPalette(1); + gStyle->SetOptFit(0); + gStyle->SetOptStat(0); + gStyle->SetOptTitle(1); + gStyle->SetTitleW(.4); + gStyle->SetTitleH(.1); + gStyle->SetTitleColor(0); + gStyle->SetTitleStyle(0); + gStyle->SetTitleBorderSize(0); + gStyle->SetTitleX(.6); + + TFile* file = TFile::Open(filename, "READ"); + if (!file) { + Error("Draw123", "failed to open %s", filename); + return; + } + + TList* forward = static_cast(file->Get(folder)); + if (!forward) { + Error("Draw123", "List %s not found in %s", folder, filename); + return; + } + + TList* sf = static_cast(forward->FindObject("fmdSharingFilter")); + if (!sf) { + Error("Draw123", "List fmdSharingFilter not found in Forward"); + return; + } + + TCanvas* c = new TCanvas("123", + "singles, doubles, and tripples", 900, 700); + c->SetFillColor(0); + c->SetBorderSize(0); + c->SetLeftMargin(0.15); + c->SetRightMargin(0.02); + c->SetTopMargin(0.02); + c->Divide(3, 2, 0, 0); + + c->cd(1); DrawRing123(sf, 1, 'I'); + c->cd(2); DrawRing123(sf, 2, 'I'); + c->cd(5); DrawRing123(sf, 2, 'O'); + c->cd(3); DrawRing123(sf, 3, 'I'); + c->cd(6); DrawRing123(sf, 3, 'O'); + TVirtualPad* p = c->cd(4); + // p->SetTopMargin(0.05); + p->SetRightMargin(0.15); + p->SetFillColor(0); + TH2D* highCuts = static_cast(sf->FindObject("highCuts")); + if (highCuts) highCuts->Draw("colz"); + c->cd(); + c->SaveAs("123.png"); +} + + + + +// +// EOF +// diff --git a/PWG2/FORWARD/analysis2/qa/DrawBeforeAfter.C b/PWG2/FORWARD/analysis2/qa/DrawBeforeAfter.C index c345e82c681..3002e82947d 100644 --- a/PWG2/FORWARD/analysis2/qa/DrawBeforeAfter.C +++ b/PWG2/FORWARD/analysis2/qa/DrawBeforeAfter.C @@ -1,3 +1,19 @@ +#ifndef __CINT__ +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include +#else +class TList; +#endif + /** * Draw the before/after merging image for a single ring * @@ -43,7 +59,8 @@ DrawRingBeforeAfter(TList* p, UShort_t d, Char_t r) * @ingroup pwg2_forward_scripts_qa */ void -DrawBeforeAfter(const char* filename="forward.root") +DrawBeforeAfter(const char* filename="forward.root", + const char* folder="ForwardResults") { gStyle->SetPalette(1); gStyle->SetOptFit(0); @@ -62,9 +79,9 @@ DrawBeforeAfter(const char* filename="forward.root") return; } - TList* forward = static_cast(file->Get("Forward")); + TList* forward = static_cast(file->Get(folder)); if (!forward) { - Error("DrawBeforeAfter", "List Forward not found in %s", filename); + Error("DrawBeforeAfter", "List %s not found in %s", folder, filename); return; } @@ -95,7 +112,7 @@ DrawBeforeAfter(const char* filename="forward.root") TH2D* highCuts = static_cast(sf->FindObject("highCuts")); if (highCuts) highCuts->Draw("colz"); c->cd(); - + c->SaveAs("beforeAfter.png"); } diff --git a/PWG2/FORWARD/analysis2/qa/DrawELossPoisson.C b/PWG2/FORWARD/analysis2/qa/DrawELossPoisson.C index efe66cb9b11..1f2e34f144c 100644 --- a/PWG2/FORWARD/analysis2/qa/DrawELossPoisson.C +++ b/PWG2/FORWARD/analysis2/qa/DrawELossPoisson.C @@ -9,6 +9,24 @@ * @ingroup pwg2_forward_scripts_qa * */ +#ifndef __CINT__ +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include +#else +class TList; +#endif /** * Draw the poisson @f$N_{ch}@f$ estimate against the @f$\Delta@f$ @@ -28,19 +46,19 @@ Double_t DrawRingELossPoisson(TList* p, UShort_t d, Char_t r, Double_t xmin, Double_t xmax) { - if (!p) return; + if (!p) return 0; TList* ring = static_cast(p->FindObject(Form("FMD%d%c",d,r))); if (!ring) { Error("DrawELossPoisson", "List FMD%d%c not found in %s",d,r,p->GetName()); - return; + return 0; } TH2* corr = static_cast(ring->FindObject("elossVsPoisson")); if (!corr) { Error("DrawRingELossPoisson", "Histogram esdEloss not found in FMD%d%c", d, r); - return; + return 0; } TPad* pad = static_cast(gPad); pad->SetGridy(); @@ -56,11 +74,13 @@ DrawRingELossPoisson(TList* p, UShort_t d, Char_t r, corr->GetXaxis()->SetRangeUser(xmin,xmax); corr->GetYaxis()->SetRangeUser(xmin,xmax); corr->SetTitle(Form("FMD%d%c",d,r)); - Info("", "Entries: %d, integral: %f", corr->GetEntries(), corr->Integral()); + // Info("", "Entries: %d, integral: %f", + // int(corr->GetEntries()), corr->Integral()); corr->Draw("colz"); + if (corr->GetEntries() <= 0) return 0; // Calculate the linear regression - Double_t dx = (xmax-xmin); + // Double_t dx = (xmax-xmin); Double_t rxy = corr->GetCorrelationFactor(); Double_t sx = corr->GetRMS(1); Double_t sy = corr->GetRMS(2); @@ -73,6 +93,7 @@ DrawRingELossPoisson(TList* p, UShort_t d, Char_t r, #if 0 Double_t beta = rxy * sy / sx; #else + if (TMath::Abs(cxy) < 1e-6) return 0; Double_t beta = ((sy2 - delta*sx2 + TMath::Sqrt(TMath::Power(sy2-delta*sx2,2) + 4*delta*cxy*cxy)) @@ -92,8 +113,10 @@ DrawRingELossPoisson(TList* p, UShort_t d, Char_t r, l->Draw(); // corr->GetXaxis()->SetRangeUser(0, 2); +#if 0 Info("", "FMD%d%c correlation coefficient: %9.5f%% " "line y = %f + %f * x", d, r, 100*rxy, alpha, beta); +#endif Double_t x = pad->GetLeftMargin()+.01; Double_t y = 1-pad->GetTopMargin()-.01; @@ -130,6 +153,7 @@ DrawRingELossPoisson(TList* p, UShort_t d, Char_t r, fitter->EvalRobust(); else fitter->Eval(); +#if 0 for (Int_t i = 0; i < 2; i++) { std::cout << i << "\t" << fitter->GetParName(i) << "\t" @@ -143,6 +167,7 @@ DrawRingELossPoisson(TList* p, UShort_t d, Char_t r, fitter->GetNumberFreeParameters() ); std::cout << "chi2/ndf: " << chi2 << '/' << ndf << '=' << chi2 / ndf << std::endl; +#endif // corr->Scale(1. / corr->GetMaximum()); pad->cd(); @@ -162,6 +187,7 @@ DrawRingELossPoisson(TList* p, UShort_t d, Char_t r, */ void DrawELossPoisson(const char* filename="forward.root", + const char* folder="ForwardResults", Double_t xmax=-1, Double_t xmin=-1) { @@ -183,9 +209,9 @@ DrawELossPoisson(const char* filename="forward.root", return; } - TList* forward = static_cast(file->Get("Forward")); + TList* forward = static_cast(file->Get(folder)); if (!forward) { - Error("DrawELossPoisson", "List Forward not found in %s", filename); + Error("DrawELossPoisson", "List %s not found in %s", folder, filename); return; } diff --git a/PWG2/FORWARD/analysis2/qa/DrawNeighbors.C b/PWG2/FORWARD/analysis2/qa/DrawNeighbors.C index 764d772bbb1..e43e44071d5 100644 --- a/PWG2/FORWARD/analysis2/qa/DrawNeighbors.C +++ b/PWG2/FORWARD/analysis2/qa/DrawNeighbors.C @@ -1,3 +1,18 @@ +#ifndef __CINT__ +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include +#else +class TList; +#endif /** * Draw the correlation of neighboring strips before/after merging * @@ -65,7 +80,8 @@ DrawRingNeighbors(TList* p, UShort_t d, Char_t r) * @ingroup pwg2_forward_scripts_qa */ void -DrawNeighbors(const char* filename="forward.root") +DrawNeighbors(const char* filename="forward.root", + const char* folder="ForwardResults") { gStyle->SetPalette(1); gStyle->SetOptFit(0); @@ -85,9 +101,9 @@ DrawNeighbors(const char* filename="forward.root") return; } - TList* forward = static_cast(file->Get("Forward")); + TList* forward = static_cast(file->Get(folder)); if (!forward) { - Error("DrawNeighbors", "List Forward not found in %s", filename); + Error("DrawNeighbors", "List %s not found in %s", folder, filename); return; } @@ -110,6 +126,7 @@ DrawNeighbors(const char* filename="forward.root") c->cd(6); DrawRingNeighbors(sf, 3, 'O'); c->cd(4)->SetFillColor(0); c->cd(); + c->SaveAs("neighbors.png"); } diff --git a/PWG2/FORWARD/analysis2/qa/DrawOccupancy.C b/PWG2/FORWARD/analysis2/qa/DrawOccupancy.C index daf8ead3e39..fb5d5f1624c 100644 --- a/PWG2/FORWARD/analysis2/qa/DrawOccupancy.C +++ b/PWG2/FORWARD/analysis2/qa/DrawOccupancy.C @@ -9,6 +9,21 @@ * @ingroup pwg2_forward_scripts_qa * */ +#ifndef __CINT__ +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include +#else +class TList; +#endif /** * Draw the poisson @f$N_{ch}@f$ estimate against the @f$\Delta@f$ @@ -27,20 +42,22 @@ Double_t DrawRingOccupancy(TList* p, UShort_t d, Char_t r) { - if (!p) return; + if (!p) return 0; TList* ring = static_cast(p->FindObject(Form("FMD%d%c",d,r))); if (!ring) { Error("DrawOccupancy", "List FMD%d%c not found in %s",d,r,p->GetName()); - return; + return 0; } TH1* corr = static_cast(ring->FindObject("occupancy")); if (!corr) { Error("DrawRingOccupancy", "Histogram occupancy not found in FMD%d%c", d, r); - return; + return 0; } + corr->Rebin(4); + TPad* pad = static_cast(gPad); pad->SetGridy(); pad->SetGridx(); @@ -79,8 +96,7 @@ DrawRingOccupancy(TList* p, UShort_t d, Char_t r) */ void DrawOccupancy(const char* filename="forward.root", - Double_t xmax=-1, - Double_t xmin=-1) + const char* folder="ForwardResults") { gStyle->SetPalette(1); gStyle->SetOptFit(0); @@ -100,9 +116,9 @@ DrawOccupancy(const char* filename="forward.root", return; } - TList* forward = static_cast(file->Get("Forward")); + TList* forward = static_cast(file->Get(folder)); if (!forward) { - Error("DrawOccupancy", "List Forward not found in %s", filename); + Error("DrawOccupancy", "List %s not found in %s", folder, filename); return; } diff --git a/PWG2/FORWARD/analysis2/qa/DrawQA.C b/PWG2/FORWARD/analysis2/qa/DrawQA.C index a0a2d20b7e0..020f8c72ed7 100644 --- a/PWG2/FORWARD/analysis2/qa/DrawQA.C +++ b/PWG2/FORWARD/analysis2/qa/DrawQA.C @@ -20,19 +20,28 @@ DrawQA(const char* file, bool full=false) gROOT->SetMacroPath(Form(".:$(ALICE_ROOT)/PWG2/FORWARD/analysis2/qa:" "$(ALICE_ROOT)/PWG2/FORWARD/analysis2/corrs:%s", gROOT->GetMacroPath())); - gROOT->LoadMacro("DrawBeforeAfter.C"); - gROOT->LoadMacro("DrawELossPoisson.C"); - gROOT->LoadMacro("DrawNeighbors.C"); - gROOT->LoadMacro("DrawOccupancy.C"); - gROOT->LoadMacro("DrawRecAnaEloss.C"); + gROOT->LoadMacro("DrawBeforeAfter.C+g"); + gROOT->LoadMacro("DrawELossPoisson.C+g"); + gROOT->LoadMacro("DrawNeighbors.C+g"); + gROOT->LoadMacro("DrawOccupancy.C+g"); + gROOT->LoadMacro("DrawRecAnaEloss.C+g"); + gROOT->LoadMacro("Draw123.C+g"); + Info("DrawQA", "Drawing before-after"); DrawBeforeAfter(file); - DrawELossPoisson(file); + Info("DrawQA", "Drawing singles, doubles, tripples"); + Draw123(file); + Info("DrawQA", "Drawing Neighbors"); DrawNeighbors(file); - DrawOccupancy(file); + Info("DrawQA", "Drawing raw and analysed energy loss"); DrawRecAnaEloss(file); + Info("DrawQA", "Drawing poisson vs energy loss"); + DrawELossPoisson(file); + Info("DrawQA", "Drawing Occupancies"); + DrawOccupancy(file); if (!full) { + Info("DrawQA", "Drawing fit results"); gROOT->LoadMacro("DrawAnaELoss.C"); DrawAnaELoss(file); } diff --git a/PWG2/FORWARD/analysis2/qa/DrawQA.sh b/PWG2/FORWARD/analysis2/qa/DrawQA.sh new file mode 100755 index 00000000000..f8022a82b33 --- /dev/null +++ b/PWG2/FORWARD/analysis2/qa/DrawQA.sh @@ -0,0 +1,92 @@ +#!/bin/sh + +file=trending.root + +# --- Help message --------------------------------------------------- +usage () +{ + cat < /dev/stderr ; exit 1 ;; + esac + shift +done + +# --- Run aliroot ---------------------------------------------------- +scr=$ALICE_ROOT/PWG2/FORWARD/analysis2/qa/DrawQA.C + +root -l -b -q ${scr}\(\"$file\"\) + +# --- Make LaTeX code ------------------------------------------------ +if test "x$title" = "x" ; then + title=`echo "QA from $file" | sed -e 's/_/\\_/g'` +fi +if test "x$output" = "x" ; then + output=`basename $file .root` +else + output=`basename $file .pdf` +fi +doc=${output}.tex + +echo $title +cat < $doc +\documentclass[landscape,12pt,a4paper]{article} +\usepackage[a4paper,margin=2cm]{geometry} +\usepackage{graphicx} +\title{$title} +\author{FMD Team} +\date{\today} +\begin{document} +\maketitle +\clearpage + +EOF +pngs="fit_results neighbors beforeAfter 123 recAnaELoss occupancy elossVsPoisson" +for i in $pngs ; do + case $i in + fit_results) t="Energy loss fits" ;; + neighbors) t="Correlation of neighbors" ;; + beforeAfter) t="Effect of sharing correction" ;; + 123) t="Energy loss from single, double, and tripple hits" ;; + recAnaELoss) t="Energy loss from reconstruction and used in analysis" ;; + occupancy) t="Calculated occupancy" ;; + elossVsPoisson) t="Correlation of Poisson and Energy loss methods" ;; + *) t="Unkknown" ;; + esac + cat <> $doc +\section*{$t} +\begin{center} +\includegraphics[keepaspectratio,height=.9\textheight]{$i} +\end{center} +\clearpage +EOF +done + +cat <> $doc +\end{document} +EOF + +pdflatex $doc + +rm -f $doc $output.aux $output.log FitResults.pdf +for i in $pngs ; do rm -f $i.png ; done + +# +# EOF +# + diff --git a/PWG2/FORWARD/analysis2/qa/DrawRecAnaEloss.C b/PWG2/FORWARD/analysis2/qa/DrawRecAnaEloss.C index bc166be889d..9b875f04a91 100644 --- a/PWG2/FORWARD/analysis2/qa/DrawRecAnaEloss.C +++ b/PWG2/FORWARD/analysis2/qa/DrawRecAnaEloss.C @@ -104,7 +104,7 @@ DrawRingRecAnaEloss(TList* p, TList* p2, Double_t lowCut, UShort_t d, Char_t r) // after->Scale(1. / ib); // presented->Scale(1. / ib); // used->Scale(1. / ib); - + gPad->SetLogy(); gPad->SetFillColor(0); before->SetTitle(Form("FMD%d%c",d,r)); @@ -134,13 +134,15 @@ DrawRingRecAnaEloss(TList* p, TList* p2, Double_t lowCut, UShort_t d, Char_t r) TLine* l = new TLine; l->SetLineWidth(1); l->DrawLineNDC(x, y-0.9*ts, 1-gPad->GetRightMargin()-0.01, y-0.9*ts); - DrawText(ltx, x, y, "Change (merging)", Form("%5.1f%%", (100.*(ia-ib))/ib)); - DrawText(ltx, x, y, "Change (input)", Form("%5.1f%% (%5.1f%%)", - (100.*(ip-ia))/ia, - (100.*(ip-ib))/ib)); - DrawText(ltx, x, y, "Change (use)", Form("%5.1f%% (%5.1f%%)", - (100.*(iu-ip))/ip, - (100.*(iu-ib))/ib)); + if (ib != 0 && ia != 0) { + DrawText(ltx, x, y, "Change (merging)", Form("%5.1f%%", (100.*(ia-ib))/ib)); + DrawText(ltx, x, y, "Change (input)", Form("%5.1f%% (%5.1f%%)", + (100.*(ip-ia))/ia, + (100.*(ip-ib))/ib)); + DrawText(ltx, x, y, "Change (use)", Form("%5.1f%% (%5.1f%%)", + (100.*(iu-ip))/ip, + (100.*(iu-ib))/ib)); + } before->GetXaxis()->SetRangeUser(0, 4); gPad->cd(); } @@ -153,7 +155,8 @@ DrawRingRecAnaEloss(TList* p, TList* p2, Double_t lowCut, UShort_t d, Char_t r) * @ingroup pwg2_forward_scripts_qa */ void -DrawRecAnaEloss(const char* filename="forward.root") +DrawRecAnaEloss(const char* filename="forward.root", + const char* folder="ForwardResults") { gStyle->SetPalette(1); gStyle->SetOptFit(0); @@ -172,9 +175,9 @@ DrawRecAnaEloss(const char* filename="forward.root") return; } - TList* forward = static_cast(file->Get("Forward")); + TList* forward = static_cast(file->Get(folder)); if (!forward) { - Error("DrawRecAnaEloss", "List Forward not found in %s", filename); + Error("DrawRecAnaEloss", "List %s not found in %s", folder, filename); return; } @@ -216,7 +219,7 @@ DrawRecAnaEloss(const char* filename="forward.root") TH2D* highCuts = static_cast(sf->FindObject("highCuts")); if (highCuts) highCuts->Draw("colz"); c->cd(); - + c->SaveAs("recAnaELoss.png"); } -- 2.39.3