From 3fc07b7ccae8a8f8efb7891aed163c0649efd507 Mon Sep 17 00:00:00 2001
From: Mark Hodgkinson <m.hodgkinson@sheffield.ac.uk>
Date: Wed, 29 Jun 2016 14:55:06 +0200
Subject: [PATCH] 29 June Mark Hodgkinson Update histogram binnings Tag as
 PFOHistUtils-00-00-12 (PFOHistUtils-00-00-12)

---
 .../PFlowValidation/PFOHistUtils/Changelog    |  8 +++++
 .../PFOHistUtils/PFOAlgPropertyPlots.h        | 32 +++++++++++++++++
 .../PFOHistUtils/src/PFOAlgPropertyPlots.cxx  | 36 +++++++++++++++++++
 .../PFOHistUtils/src/PFOAttributePlots.cxx    |  6 ++--
 .../src/PFOClusterMomentPlots.cxx             | 10 +++---
 .../PFOHistUtils/src/PFOEMPlots.cxx           |  4 +--
 .../PFOHistUtils/src/PFOPlots.cxx             |  4 +--
 7 files changed, 88 insertions(+), 12 deletions(-)
 create mode 100644 Reconstruction/PFlow/PFlowValidation/PFOHistUtils/PFOHistUtils/PFOAlgPropertyPlots.h
 create mode 100644 Reconstruction/PFlow/PFlowValidation/PFOHistUtils/src/PFOAlgPropertyPlots.cxx

diff --git a/Reconstruction/PFlow/PFlowValidation/PFOHistUtils/Changelog b/Reconstruction/PFlow/PFlowValidation/PFOHistUtils/Changelog
index 53ee2602aac4..f07adaca28d1 100644
--- a/Reconstruction/PFlow/PFlowValidation/PFOHistUtils/Changelog
+++ b/Reconstruction/PFlow/PFlowValidation/PFOHistUtils/Changelog
@@ -1,3 +1,11 @@
+29 June Mark Hodgkinson
+Update histogram binnings
+Tag as PFOHistUtils-00-00-12
+	
+29 June 2016 Mark Hodgkinson
+Add PFOAlgPropertyPlots	to monitor PFlow algorithm internal variables.
+Tag as PFOHistUtils-00-00-11	
+
 6 July 2015 Mark Hodgkinson
 Fix Coverity issues 19828, 25016,17411,17009,17168 (all related to unitialised histogram pointers)
 Tag as PFOHistUtils-00-00-10
diff --git a/Reconstruction/PFlow/PFlowValidation/PFOHistUtils/PFOHistUtils/PFOAlgPropertyPlots.h b/Reconstruction/PFlow/PFlowValidation/PFOHistUtils/PFOHistUtils/PFOAlgPropertyPlots.h
new file mode 100644
index 000000000000..7a94671fe865
--- /dev/null
+++ b/Reconstruction/PFlow/PFlowValidation/PFOHistUtils/PFOHistUtils/PFOAlgPropertyPlots.h
@@ -0,0 +1,32 @@
+/*
+  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+*/
+
+#ifndef PFOALGPROPERTYPLOTS_H
+#define PFOALGPROPERTYPLOTS_H
+
+#include "TrkValHistUtils/PlotBase.h"
+#include "xAODPFlow/PFO.h"
+
+namespace PFO {
+
+  class PFOAlgPropertyPlots : public PlotBase {
+
+    public:
+
+     PFOAlgPropertyPlots(PlotBase *pParent, std::string sDir, std::string sPFOContainerName);
+
+     void fill(const xAOD::PFO& PFO);
+
+  private:
+
+    TH1* m_PFO_isInDenseEnvironment;
+    TH1* m_PFO_tracksExpectedEnergyDeposit;
+
+    void initializePlots();
+    std::string m_sPFOContainerName;
+    
+  };
+}
+  
+#endif
diff --git a/Reconstruction/PFlow/PFlowValidation/PFOHistUtils/src/PFOAlgPropertyPlots.cxx b/Reconstruction/PFlow/PFlowValidation/PFOHistUtils/src/PFOAlgPropertyPlots.cxx
new file mode 100644
index 000000000000..9d2dda1c0a29
--- /dev/null
+++ b/Reconstruction/PFlow/PFlowValidation/PFOHistUtils/src/PFOAlgPropertyPlots.cxx
@@ -0,0 +1,36 @@
+/*
+  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+*/
+
+#include "PFOHistUtils/PFOAlgPropertyPlots.h"
+
+namespace PFO {
+
+  PFOAlgPropertyPlots::PFOAlgPropertyPlots(PlotBase* pParent, std::string sDir, std::string sPFOContainerName) : PlotBase(pParent, sDir), m_sPFOContainerName(sPFOContainerName){
+    m_PFO_isInDenseEnvironment = nullptr;
+    m_PFO_tracksExpectedEnergyDeposit = nullptr;
+  }
+
+  void PFOAlgPropertyPlots::initializePlots(){
+
+    m_PFO_isInDenseEnvironment = Book1D("PFO_isInDenseEnvironment",m_sPFOContainerName+"PFO_isInDenseEnvironment",3,-1,2);
+    m_PFO_tracksExpectedEnergyDeposit = Book1D("PFO_tracksExpectedEnergyDeposit",m_sPFOContainerName+"PFO_tracksExpectedEnergyDeposit",11,-1,10);
+    
+  }
+
+  void PFOAlgPropertyPlots::fill(const xAOD::PFO& PFO){
+
+    xAOD::PFODetails::PFOAttributes myAttribute_isInDenseEnvironment = xAOD::PFODetails::PFOAttributes::eflowRec_isInDenseEnvironment;
+    int isInDenseEnvironment = false;
+    bool gotAttribute = PFO.attribute(myAttribute_isInDenseEnvironment,isInDenseEnvironment);
+    if (true == gotAttribute) m_PFO_isInDenseEnvironment->Fill(isInDenseEnvironment);
+    else m_PFO_isInDenseEnvironment->Fill(-1.0);
+
+    float expectedEnergy = 0.0;
+    xAOD::PFODetails::PFOAttributes myAttribute_tracksExpectedEnergyDeposit = xAOD::PFODetails::PFOAttributes::eflowRec_tracksExpectedEnergyDeposit;
+    gotAttribute = PFO.attribute(myAttribute_tracksExpectedEnergyDeposit,expectedEnergy);
+    if (true == gotAttribute) m_PFO_tracksExpectedEnergyDeposit->Fill(expectedEnergy/1000.0);
+    else  m_PFO_tracksExpectedEnergyDeposit->Fill(-1.0);
+  
+  }
+}
diff --git a/Reconstruction/PFlow/PFlowValidation/PFOHistUtils/src/PFOAttributePlots.cxx b/Reconstruction/PFlow/PFlowValidation/PFOHistUtils/src/PFOAttributePlots.cxx
index be331eb18796..2587e01d092e 100644
--- a/Reconstruction/PFlow/PFlowValidation/PFOHistUtils/src/PFOAttributePlots.cxx
+++ b/Reconstruction/PFlow/PFlowValidation/PFOHistUtils/src/PFOAttributePlots.cxx
@@ -17,9 +17,9 @@ namespace PFO {
   void PFOAttributePlots::initializePlots(){
 
     m_PFO_LAYER_ENERGY_EM3 = Book1D("PFO_LAYER_ENEGRY_EM3",m_sPFOContainerName+"_LAYER_ENERGY_EM3",201,-1,100);
-    m_PFO_LAYER_ENERGY_HEC0 = Book1D("PFO_LAYER_ENEGRY_HEC0",m_sPFOContainerName+"_LAYER_ENERGY_HEC0",201,-1,100);
-    m_PFO_LAYER_ENERGY_HEC = Book1D("PFO_LAYER_ENEGRY_HEC",m_sPFOContainerName+"_LAYER_ENERGY_HEC",201,-1,100);
-    m_PFO_LAYER_ENERGY_Tile0 = Book1D("PFO_LAYER_ENEGRY_Tile0",m_sPFOContainerName+"_LAYER_ENERGY_Tile0",201,-1,100);
+    m_PFO_LAYER_ENERGY_HEC0 = Book1D("PFO_LAYER_ENEGRY_HEC0",m_sPFOContainerName+"_LAYER_ENERGY_HEC0",60,-1,5);
+    m_PFO_LAYER_ENERGY_HEC = Book1D("PFO_LAYER_ENEGRY_HEC",m_sPFOContainerName+"_LAYER_ENERGY_HEC",60,-1,5);
+    m_PFO_LAYER_ENERGY_Tile0 = Book1D("PFO_LAYER_ENEGRY_Tile0",m_sPFOContainerName+"_LAYER_ENERGY_Tile0",60,-1,5);
     m_PFO_TIMING = Book1D("PFO_TIMING",m_sPFOContainerName+"_TIMING",10,-50,50);
     
   }
diff --git a/Reconstruction/PFlow/PFlowValidation/PFOHistUtils/src/PFOClusterMomentPlots.cxx b/Reconstruction/PFlow/PFlowValidation/PFOHistUtils/src/PFOClusterMomentPlots.cxx
index 47e25433e205..2e3a989fe848 100644
--- a/Reconstruction/PFlow/PFlowValidation/PFOHistUtils/src/PFOClusterMomentPlots.cxx
+++ b/Reconstruction/PFlow/PFlowValidation/PFOHistUtils/src/PFOClusterMomentPlots.cxx
@@ -29,16 +29,16 @@ namespace PFO {
     m_PFO_LONGITUDINAL = Book1D("PFO_LONGITUDINAL",m_sPFOContainerName + "_LONGITUDINAL",60,-1.0,2.0);
     m_PFO_SECOND_R = Book1D("PFO_SECOND_R",m_sPFOContainerName + "_SECOND_R",60,-1.0,50.0); 
     m_PFO_CENTER_LAMBDA = Book1D("PFO_CENTER_LAMBDA",m_sPFOContainerName + "_CENTER_LAMBDA",60,-1.0,3000.0);
-    m_PFO_FIRST_ENG_DENS = Book1D("PFO_FIRST_ENG_DENS",m_sPFOContainerName + "_FIRST_ENG_DENS",60,-1.0,2.0);
+    m_PFO_FIRST_ENG_DENS = Book1D("PFO_FIRST_ENG_DENS",m_sPFOContainerName + "_FIRST_ENG_DENS",26,-1.0,0.3);
     m_PFO_ENG_FRAC_MAX = Book1D("PFO_ENG_FRAC_MAX",m_sPFOContainerName + "_ENG_FRAC_MAX",60,-1.0,2.0);
     m_PFO_ISOLATION = Book1D("PFO_ISOLATION",m_sPFOContainerName + "_ISOLATION",60,-1.0,2.0);
-    m_PFO_ENG_BAD_CELLS = Book1D("PFO_ENG_BAD_CELLS",m_sPFOContainerName + "_ENG_BAD_CELLS",120,-1.0,100.0);
-    m_PFO_N_BAD_CELLS = Book1D("PFO_N_BAD_CELLS",m_sPFOContainerName + "_N_BAD_CELLS",120,-1.0,20.0);
-    m_PFO_BADLARQ_FRAC = Book1D("PFO_BADLARQ_FRAC",m_sPFOContainerName + "_BADLARQ_FRAC",140,-3.0,5.0);
+    m_PFO_ENG_BAD_CELLS = Book1D("PFO_ENG_BAD_CELLS",m_sPFOContainerName + "_ENG_BAD_CELLS",20,-1.0,1);
+    m_PFO_N_BAD_CELLS = Book1D("PFO_N_BAD_CELLS",m_sPFOContainerName + "_N_BAD_CELLS",30,-1.0,2.0);
+    m_PFO_BADLARQ_FRAC = Book1D("PFO_BADLARQ_FRAC",m_sPFOContainerName + "_BADLARQ_FRAC",25,-1.0,1.5);
     m_PFO_ENG_POS = Book1D("PFO_ENG_POS",m_sPFOContainerName + "_ENG_POS",60,-100.0,10000.0);
     m_PFO_SIGNIFICANCE = Book1D("PFO_SIGNIFICANCE",m_sPFOContainerName + "_SIGNIFICANCE",300,-20.0,20.0);
     m_PFO_AVG_LAR_Q = Book1D("PFO_AVG_LAR_Q",m_sPFOContainerName + "_AVG_LAR_Q",240,-1.0,200.0);
-    m_PFO_AVG_TILE_Q = Book1D("PFO_AVG_TILE_Q",m_sPFOContainerName + "_AVG_TILE_Q",240,-1.0,200.0);
+    m_PFO_AVG_TILE_Q = Book1D("PFO_AVG_TILE_Q",m_sPFOContainerName + "_AVG_TILE_Q",21,-1.0,20.0);
 
   }
 
diff --git a/Reconstruction/PFlow/PFlowValidation/PFOHistUtils/src/PFOEMPlots.cxx b/Reconstruction/PFlow/PFlowValidation/PFOHistUtils/src/PFOEMPlots.cxx
index 420cfa419d77..d1d5c6e34b65 100644
--- a/Reconstruction/PFlow/PFlowValidation/PFOHistUtils/src/PFOEMPlots.cxx
+++ b/Reconstruction/PFlow/PFlowValidation/PFOHistUtils/src/PFOEMPlots.cxx
@@ -15,10 +15,10 @@ namespace PFO {
 
   void PFOEMPlots::initializePlots(){
 
-    m_PFO_ptEM = Book1D("PFO_PtEM",m_sPFOContainerName + "_PtEM (Entries/1 GeV)",300,-100.0,200.0);
+    m_PFO_ptEM = Book1D("PFO_PtEM",m_sPFOContainerName + "_PtEM (Entries/1 GeV)",30,-10.0,20.0);
     m_PFO_etaEM = Book1D("PFO_EtaEM",m_sPFOContainerName + "_EtaEM (Entries/0.1)",100,-5.0,5.0);
     m_PFO_phiEM = Book1D("PFO_PhiEM",m_sPFOContainerName + "_PhiEM (Entries/0.1)",64,-3.2,3.2);
-    m_PFO_mEM = Book1D("PFO_mEM",m_sPFOContainerName + "_mEM (Entries/100 MeV)",100,0.0,10.0);
+    m_PFO_mEM = Book1D("PFO_mEM",m_sPFOContainerName + "_mEM (Entries/100 MeV)",10,0.0,0.5);
 
   }
 
diff --git a/Reconstruction/PFlow/PFlowValidation/PFOHistUtils/src/PFOPlots.cxx b/Reconstruction/PFlow/PFlowValidation/PFOHistUtils/src/PFOPlots.cxx
index 695886266a97..4738c741566e 100644
--- a/Reconstruction/PFlow/PFlowValidation/PFOHistUtils/src/PFOPlots.cxx
+++ b/Reconstruction/PFlow/PFlowValidation/PFOHistUtils/src/PFOPlots.cxx
@@ -15,10 +15,10 @@ namespace PFO {
 
   void PFOPlots::initializePlots(){
 
-    m_PFO_pt = Book1D("PFO_Pt",m_sPFOContainerName + "_Pt (Entries/1 GeV)",300,-100.0,200.0);
+    m_PFO_pt = Book1D("PFO_Pt",m_sPFOContainerName + "_Pt (Entries/1 GeV)",30,-10.0,20.0);
     m_PFO_eta = Book1D("PFO_Eta",m_sPFOContainerName + "_Eta (Entries/0.1)",100,-5.0,5.0);
     m_PFO_phi = Book1D("PFO_Phi",m_sPFOContainerName + "_Phi (Entries/0.1)",64,-3.2,3.2);
-    m_PFO_m = Book1D("PFO_m",m_sPFOContainerName + "_m (Entries/100 MeV)",100,0.0,10.0);
+    m_PFO_m = Book1D("PFO_m",m_sPFOContainerName + "_m (Entries/100 MeV)",10,0.0,0.5);
 
   }
 
-- 
GitLab