Fixes for coverity checks.
authorcholm <cholm@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 15 Nov 2011 11:49:50 +0000 (11:49 +0000)
committercholm <cholm@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 15 Nov 2011 11:49:50 +0000 (11:49 +0000)
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

45 files changed:
FMD/AliFMDBaseDA.h
FMD/AliFMDBaseDigitizer.cxx
FMD/AliFMDBoolMap.cxx
FMD/AliFMDCalibGain.cxx
FMD/AliFMDCalibPedestal.cxx
FMD/AliFMDDetector.cxx
FMD/AliFMDEdepHitPair.h
FMD/AliFMDEdepMap.cxx
FMD/AliFMDGeometry.cxx
FMD/AliFMDHitDigitizer.cxx
FMD/AliFMDIndex.cxx
FMD/AliFMDIndex.h
FMD/AliFMDUShortMap.cxx
PWG2/FORWARD/analysis2/AliBasedNdetaTask.cxx
PWG2/FORWARD/analysis2/AliCentralMCCorrectionsTask.cxx
PWG2/FORWARD/analysis2/AliCentralMultiplicityTask.cxx
PWG2/FORWARD/analysis2/AliFMDCorrELossFit.cxx
PWG2/FORWARD/analysis2/AliFMDCorrector.cxx
PWG2/FORWARD/analysis2/AliFMDDensityCalculator.cxx
PWG2/FORWARD/analysis2/AliFMDEnergyFitter.cxx
PWG2/FORWARD/analysis2/AliFMDEnergyFitterTask.cxx
PWG2/FORWARD/analysis2/AliFMDEventInspector.cxx
PWG2/FORWARD/analysis2/AliFMDHistCollector.cxx
PWG2/FORWARD/analysis2/AliFMDMCCorrector.cxx
PWG2/FORWARD/analysis2/AliFMDMCTrackDensity.cxx
PWG2/FORWARD/analysis2/AliFMDMultCuts.cxx
PWG2/FORWARD/analysis2/AliFMDSharingFilter.cxx
PWG2/FORWARD/analysis2/AliForwardFlowTaskQC.cxx
PWG2/FORWARD/analysis2/AliForwardMCCorrectionsTask.cxx
PWG2/FORWARD/analysis2/AliForwardMCMultiplicityTask.cxx
PWG2/FORWARD/analysis2/AliForwardMultiplicityBase.cxx
PWG2/FORWARD/analysis2/AliForwardMultiplicityTask.cxx
PWG2/FORWARD/analysis2/AliForwardQATask.cxx
PWG2/FORWARD/analysis2/AliForwardUtil.h
PWG2/FORWARD/analysis2/AliPoissonCalculator.cxx
PWG2/FORWARD/analysis2/AliSPDMCTrackDensity.cxx
PWG2/FORWARD/analysis2/corrs/DrawAnaELoss.C
PWG2/FORWARD/analysis2/qa/Draw123.C [new file with mode: 0644]
PWG2/FORWARD/analysis2/qa/DrawBeforeAfter.C
PWG2/FORWARD/analysis2/qa/DrawELossPoisson.C
PWG2/FORWARD/analysis2/qa/DrawNeighbors.C
PWG2/FORWARD/analysis2/qa/DrawOccupancy.C
PWG2/FORWARD/analysis2/qa/DrawQA.C
PWG2/FORWARD/analysis2/qa/DrawQA.sh [new file with mode: 0755]
PWG2/FORWARD/analysis2/qa/DrawRecAnaEloss.C

index dce3913..36fda2e 100644 (file)
@@ -55,6 +55,7 @@ public:
    * 
    */  
   ~AliFMDBaseDA() ;
+  AliFMDBaseDA& operator=(const AliFMDBaseDA&) { return *this; }
   /** 
    * Run this DA
    * 
index a689e00..7dcf7e4 100644 (file)
@@ -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;
index 3a7b86e..16f20c6 100644 (file)
@@ -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;
index 42f14a5..72ac806 100644 (file)
@@ -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;
index 6735bc1..9ef31e3 100644 (file)
@@ -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;
index b9d636f..78cc6ff 100644 (file)
@@ -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;
index 6c6b41c..88d0c59 100644 (file)
@@ -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;
index 6341619..7a34c10 100644 (file)
@@ -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;
index 7844a48..8050cc0 100644 (file)
@@ -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; 
index ad7d7f3..3c4e1b6 100644 (file)
@@ -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;
index 919b2b1..16e80c3 100644 (file)
@@ -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;
index a16f0bf..dac5c79 100644 (file)
@@ -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
index b688651..b0e75f6 100644 (file)
@@ -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;
index c543f4b..ac94b2c 100644 (file)
@@ -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;
index dcbaf64..7c5581b 100644 (file)
@@ -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;
index 89866e4..6aa3c79 100644 (file)
@@ -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;
index 0c2d89c..872ee73 100644 (file)
@@ -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());
index 62a6f29..637599b 100644 (file)
@@ -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;
index e383506..c96cdb6 100644 (file)
@@ -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;
index efcce52..152784c 100644 (file)
@@ -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;
index 4a91981..5178a5d 100644 (file)
@@ -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;
index ba81ed3..a316282 100644 (file)
@@ -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;
index 7d73098..103c621 100644 (file)
@@ -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;
index e12ec02..ca4ef2d 100644 (file)
@@ -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;
index 0cf1e6e..63295dc 100644 (file)
@@ -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;
index ec4b822..10161fa 100644 (file)
@@ -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;
index 978a1d9..32b9c5d 100644 (file)
@@ -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;
index 951d3b1..e2813fd 100644 (file)
@@ -57,6 +57,7 @@ AliForwardFlowTaskQC::AliForwardFlowTaskQC()
   // 
   // Default constructor
   //
+  for (Int_t n = 0; n <= 6; n++) fv[n] = kTRUE;
 }
 //_____________________________________________________________________
 AliForwardFlowTaskQC::AliForwardFlowTaskQC(const char* name) :
index 0bc4738..9a12d40 100644 (file)
@@ -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;
index 185feef..1fcad32 100644 (file)
@@ -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;
index 7230dc5..3421855 100644 (file)
@@ -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;
index ca934d6..b7508e6 100644 (file)
@@ -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;
index a2e16ff..807e96e 100644 (file)
@@ -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;
index f2728ea..cef26e0 100644 (file)
@@ -568,6 +568,7 @@ public:
      */
     RingHistos& operator=(const RingHistos& o) 
     {
+      if (&o == this) return *this;
       TObject::operator=(o);
       fDet  = o.fDet;
       fRing = o.fRing;
index 2f517ff..aa7712a 100644 (file)
@@ -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;
index 4ba68d1..ad072af 100644 (file)
@@ -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;
index 7c45626..69af59d 100644 (file)
@@ -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<THStack*>(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<THStack*>(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<THStack*>(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 (file)
index 0000000..e3cbac2
--- /dev/null
@@ -0,0 +1,137 @@
+#ifndef __CINT__
+# include <TH1.h>
+# include <TH2.h>
+# include <TList.h>
+# include <TFile.h>
+# include <TString.h>
+# include <TError.h>
+# include <TPad.h>
+# include <TCanvas.h>
+# include <TLine.h>
+# include <TLatex.h>
+# include <TStyle.h>
+# include <TLegend.h>
+#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<TList*>(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<TH1*>(ring->FindObject("singleEloss"));
+  TH1* two   = static_cast<TH1*>(ring->FindObject("doubleEloss"));
+  TH1* three = static_cast<TH1*>(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<TList*>(file->Get(folder));
+  if (!forward) { 
+    Error("Draw123", "List %s not found in %s", folder, filename);
+    return;
+  }
+
+  TList* sf = static_cast<TList*>(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<TH2D*>(sf->FindObject("highCuts"));
+  if (highCuts) highCuts->Draw("colz");
+  c->cd();
+  c->SaveAs("123.png");
+}
+
+  
+  
+//
+// EOF
+//
index c345e82..3002e82 100644 (file)
@@ -1,3 +1,19 @@
+#ifndef __CINT__
+# include <TH1.h>
+# include <TH2.h>
+# include <TList.h>
+# include <TFile.h>
+# include <TString.h>
+# include <TError.h>
+# include <TPad.h>
+# include <TCanvas.h>
+# include <TLine.h>
+# include <TLatex.h>
+# include <TStyle.h>
+#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<TList*>(file->Get("Forward"));
+  TList* forward = static_cast<TList*>(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<TH2D*>(sf->FindObject("highCuts"));
   if (highCuts) highCuts->Draw("colz");
   c->cd();
-  
+  c->SaveAs("beforeAfter.png");
 }
 
   
index efe66cb..1f2e34f 100644 (file)
@@ -9,6 +9,24 @@
  * @ingroup pwg2_forward_scripts_qa
  * 
  */
+#ifndef __CINT__
+# include <TH1.h>
+# include <TH2.h>
+# include <TList.h>
+# include <TFile.h>
+# include <TString.h>
+# include <TError.h>
+# include <TPad.h>
+# include <TCanvas.h>
+# include <TMath.h>
+# include <TF1.h>
+# include <TLine.h>
+# include <TLatex.h>
+# include <TLinearFitter.h>
+# include <TStyle.h>
+#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<TList*>(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<TH2D*>(ring->FindObject("elossVsPoisson"));
   if (!corr) { 
     Error("DrawRingELossPoisson", "Histogram esdEloss not found in FMD%d%c",
          d, r);
-    return;
+    return 0;
   }
   TPad* pad = static_cast<TPad*>(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<TList*>(file->Get("Forward"));
+  TList* forward = static_cast<TList*>(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;
   }
 
index 764d772..e43e440 100644 (file)
@@ -1,3 +1,18 @@
+#ifndef __CINT__
+# include <TH1.h>
+# include <TH2.h>
+# include <TList.h>
+# include <TFile.h>
+# include <TString.h>
+# include <TError.h>
+# include <TPad.h>
+# include <TCanvas.h>
+# include <TLine.h>
+# include <TLatex.h>
+# include <TStyle.h>
+#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<TList*>(file->Get("Forward"));
+  TList* forward = static_cast<TList*>(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");
 }
 
   
index daf8ead..fb5d5f1 100644 (file)
@@ -9,6 +9,21 @@
  * @ingroup pwg2_forward_scripts_qa
  * 
  */
+#ifndef __CINT__
+# include <TH1.h>
+# include <TH2.h>
+# include <TList.h>
+# include <TFile.h>
+# include <TString.h>
+# include <TError.h>
+# include <TPad.h>
+# include <TCanvas.h>
+# include <TLine.h>
+# include <TLatex.h>
+# include <TStyle.h>
+#else
+class TList;
+#endif
 
 /** 
  * Draw the poisson @f$N_{ch}@f$ estimate against the @f$\Delta@f$
 Double_t
 DrawRingOccupancy(TList* p, UShort_t d, Char_t r)
 {
-  if (!p) return;
+  if (!p) return 0;
 
   TList* ring = static_cast<TList*>(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<TH1*>(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<TPad*>(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<TList*>(file->Get("Forward"));
+  TList* forward = static_cast<TList*>(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;
   }
 
index a0a2d20..020f8c7 100644 (file)
@@ -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 (executable)
index 0000000..f8022a8
--- /dev/null
@@ -0,0 +1,92 @@
+#!/bin/sh 
+
+file=trending.root 
+
+# --- Help message ---------------------------------------------------
+usage ()
+{
+    cat <<EOF
+Usage: $0 [OPTIONS] 
+
+Options:
+       -f,--file    FILE       Input file 
+       -t,--title   STRING     Title string 
+       -o,--output  FILE       Write output on this file 
+       -h,--help               Show this help
+EOF
+}
+
+# --- Command line parsing -------------------------------------------
+while test $# -gt 0 ; do 
+    case $1 in  
+       -f|--file) file=$2 ; shift ;;
+       -t|--title) title=$2 ; shift ;; 
+       -h|--help) usage ; exit 0 ;; 
+       *)  echo "Uknown option $1" > /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 <<EOF > $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 <<EOF >> $doc
+\section*{$t}
+\begin{center}
+\includegraphics[keepaspectratio,height=.9\textheight]{$i}
+\end{center}
+\clearpage
+EOF
+done
+
+cat <<EOF >> $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
+# 
+
index bc166be..9b875f0 100644 (file)
@@ -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<TList*>(file->Get("Forward"));
+  TList* forward = static_cast<TList*>(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<TH2D*>(sf->FindObject("highCuts"));
   if (highCuts) highCuts->Draw("colz");
   c->cd();
-  
+  c->SaveAs("recAnaELoss.png");
 }