diff --git a/Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimParametrization/Root/TreeReader.cxx b/Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimParametrization/Root/TreeReader.cxx
index 56e8a183b701d8732571beb278788b759d1bad13..4cbca67c92b4ae4f2cf7692e179b3ab797ec5761 100644
--- a/Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimParametrization/Root/TreeReader.cxx
+++ b/Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimParametrization/Root/TreeReader.cxx
@@ -1,6 +1,6 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-*/
+ Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+ */
 
 #include "TTreeFormula.h"
 #include "TTreeFormulaManager.h"
@@ -114,16 +114,16 @@ int TreeReader::GetEntry(int entry)
     Long64_t localEntry = m_tree->LoadTree(entryNumber);   
     if (localEntry < 0) return 0;    
     m_currentEntry = entry;
-      if(m_isChain) // check file change in chain
-        {
-        int I = static_cast<TChain*>(m_tree)->GetTreeNumber();   
-        if(I!=m_currentTree) 
-          {
-          m_currentTree = I;
-          //fManager->Clear();
-          std::map<std::string, TTreeFormula*>::iterator itr = m_formulae.begin();
-          std::map<std::string, TTreeFormula*>::iterator itrE= m_formulae.end();  
-          TTreeFormula* dummy = m_formulae["__DUMMY__"];     
+    if(m_isChain) // check file change in chain
+    {
+      int I = static_cast<TChain*>(m_tree)->GetTreeNumber();
+      if(I!=m_currentTree)
+      {
+        m_currentTree = I;
+        //fManager->Clear();
+        std::map<std::string, TTreeFormula*>::iterator itr = m_formulae.begin();
+        std::map<std::string, TTreeFormula*>::iterator itrE= m_formulae.end();
+        TTreeFormula* dummy = m_formulae["__DUMMY__"];   
           for(;itr!=itrE;itr++) 
             { 
             if(itr->second!=dummy) itr->second->Notify(); //itr->second->UpdateFormulaLeaves();
diff --git a/Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimParametrization/tools/Binning/fBinning.C b/Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimParametrization/tools/Binning/fBinning.C
index cd261158bad46ca30108d40a6bf22477fe2d7c2e..e4e8738320bf0aefe64167a84710cc1713729a19 100644
--- a/Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimParametrization/tools/Binning/fBinning.C
+++ b/Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimParametrization/tools/Binning/fBinning.C
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
 */
 
 #include "TLorentzVector.h"
@@ -52,9 +52,7 @@ using namespace std;
 
 int fGetIndex(float myvar,Float_t *vvarBin, Int_t nbins);
 
-TH2F fBinning(string myfile, Int_t nxbins, Float_t *xbins, Int_t nybins, Float_t *ybins, Int_t nxbinsAlpha, Float_t *xbinsAlpha, Int_t nybinsR, Float_t *ybinsR, string mycase, float layer, string dopart, TH1F &halpha, TH1F &hdr, TH1F &halphaE, TH1F &hdrE, TMatrixD &mEnergy, TMatrixD &mxEnergy, TMatrixD &myEnergy);
-
-TH2F fBinning(string myfile, Int_t nxbins, Float_t *xbins, Int_t nybins, Float_t *ybins, Int_t nxbinsAlpha, Float_t *xbinsAlpha, Int_t nybinsR, Float_t *ybinsR, string mycase, float layer, string doPart, TH1F &halpha, TH1F& hdr, TH1F &halphaE, TH1F &hdrE, TMatrixD &mEnergy, TMatrixD &mxEnergy, TMatrixD &myEnergy){
+TH2F fBinning(const string& myfile, Int_t nxbins, Float_t *xbins, Int_t nybins, Float_t *ybins, Int_t nxbinsAlpha, Float_t *xbinsAlpha, Int_t nybinsR, Float_t *ybinsR, const string& mycase, float layer, const string& doPart, TH1F &halpha, TH1F& hdr, TH1F &halphaE, TH1F &hdrE, TMatrixD &mEnergy, TMatrixD &mxEnergy, TMatrixD &myEnergy){
 
   TH1::SetDefaultSumw2(kTRUE);
 
diff --git a/Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimParametrization/tools/CaloDetDescr/CaloDetDescrElement.h b/Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimParametrization/tools/CaloDetDescr/CaloDetDescrElement.h
index 5f4fec46fe8e90f8f0b6e19c389d8ccedbf083b1..dde4496b4f7bf98c571941efc685f0aa7dbc46c8 100755
--- a/Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimParametrization/tools/CaloDetDescr/CaloDetDescrElement.h
+++ b/Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimParametrization/tools/CaloDetDescr/CaloDetDescrElement.h
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
 */
 
 #ifndef ISF_FASTCALOSIMPARAMETRIZATION_CALODETDESCRELEMENT_H
@@ -38,6 +38,11 @@ class CaloDetDescrElement
     m_dx = 0;
     m_dy = 0;
     m_dz = 0;
+    m_sinTh = 0;
+    m_cosTh = 0;
+    m_volume = 0;
+    m_sinPhi = 0;
+    m_cosPhi = 0;
   };
 
   /** @brief virtual destructor
diff --git a/Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimParametrization/tools/CopyParam2File.cxx b/Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimParametrization/tools/CopyParam2File.cxx
index 4d7c8125d37319d03bf34555f33c6c12b56445d9..6ca9382e58c5ccc59f87f311676d359e7ff13b56 100644
--- a/Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimParametrization/tools/CopyParam2File.cxx
+++ b/Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimParametrization/tools/CopyParam2File.cxx
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
 */
 
 /**
@@ -32,7 +32,9 @@ std::string doSParam(std::string pstr, std::string kstr) {
 }
 
 // build string eparam.<pdgid>.<energy>.<eta>.<pca#>.<
-std::string doEParam(std::string pstr, std::string kstr, std::string dirstr) {
+std::string doEParam(const std::string& pstr,
+                     const std::string& kstr,
+                     const std::string& dirstr) {
   std::string lNum;
   std::string retstr = "";
   // bin/pca common amongst all
@@ -105,7 +107,7 @@ void copyDir(TDirectory* src, std::string param_str) {
   savdir->cd();
 }
 
-void copyFile(const char* fname, std::string param_str) {
+void copyFile(const char* fname, const std::string& param_str) {
   TDirectory* target = gDirectory;
   TFile* fsrc = TFile::Open(fname);
   if (!fsrc || fsrc->IsZombie()) {
@@ -121,7 +123,7 @@ void copyFile(const char* fname, std::string param_str) {
 }
 
 void 
-CopyParam2File(std::string src_str, std::string param_type, unsigned int pdgid, unsigned int energy, float eta, std::string dest_str = "FCSParams.root") {
+CopyParam2File(const std::string& src_str, const std::string& param_type, unsigned int pdgid, unsigned int energy, float eta, const std::string& dest_str = "FCSParams.root") {
   // ROOT-aware
   TLorentzVector* t;
   gROOT->LoadMacro("../20.20.X-VAL/Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimEvent/src/IntArray.cxx+");
diff --git a/Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimParametrization/tools/FCAL_ChannelMap.cxx b/Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimParametrization/tools/FCAL_ChannelMap.cxx
index 702c4c7da2543d31d150fd03cdfd735bd3ba493f..6fcb5ec1f5ae6cc0a7f797b58e64dcb5fcd8ab88 100755
--- a/Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimParametrization/tools/FCAL_ChannelMap.cxx
+++ b/Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimParametrization/tools/FCAL_ChannelMap.cxx
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
 */
 
 // ***************************************************************************
@@ -457,11 +457,11 @@ FCAL_ChannelMap::print_tubemap( int imap) const
   //boost::io::ios_all_saver ias (std::cout);
   std::cout << "First 10 elements of the New FCAL tube map : " << imap << std::endl;
   std::cout.precision(5);
-  for ( int i=0;  i<10; i++, it++)
-    std::cout << std::hex << it->first << "\t" 
-	      << (it->second).get_tileName() << std::dec <<"\t" 
-	      << (it->second).x() <<"\t" 
-	      << (it->second).y() << std::endl;
+  for ( int i=0;  i<10; ++i, ++it)
+    std::cout << std::hex << it->first << "\t"
+              << (it->second).get_tileName() << std::dec <<"\t"
+              << (it->second).x() <<"\t"
+              << (it->second).y() << std::endl;
 
 }
 
diff --git a/Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimParametrization/tools/old_stuff/PCA_Transformation.cpp b/Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimParametrization/tools/old_stuff/PCA_Transformation.cpp
index 8bc8990a5920e8f8b0433ff15edba67e3da20d35..ac3614ae48ffc15ccbfb16adb6e8bdcce1e42fc8 100755
--- a/Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimParametrization/tools/old_stuff/PCA_Transformation.cpp
+++ b/Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimParametrization/tools/old_stuff/PCA_Transformation.cpp
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
 */
 
 #include "PCA_Transformation.h"
@@ -8,31 +8,20 @@
 
 
 /////////////////////////////////////////////
-PCA_Transformation::PCA_Transformation(){
-/////////////////////////////////////////////
-    
-    TMatrixD initMatrix;
-    TVectorD initVector;
-    
-    NVariables_ = 0;
-	EigenVectors_ = initMatrix;
-    EigenValues_ = initVector;
-    MeanValues_ = initVector;
-    SigmaValues_ = initVector;
-	
-	}
+PCA_Transformation::PCA_Transformation()
+  : NVariables_(0)
+{
+}
 
 ////////////////////////////////////////////////////////////////////////////
-PCA_Transformation::PCA_Transformation(int init_NVariables, TMatrixD init_EigenVectors, TVectorD init_EigenValues, TVectorD init_MeanValues, TVectorD init_SigmaValues){
-////////////////////////////////////////////////////////////////////////////
-
-    NVariables_ = init_NVariables;
-    EigenVectors_ = init_EigenVectors;
-    EigenValues_ = init_EigenValues;
-    MeanValues_ = init_MeanValues;
-    SigmaValues_ = init_SigmaValues;
-    
-	}
+PCA_Transformation::PCA_Transformation(int init_NVariables, TMatrixD init_EigenVectors, TVectorD init_EigenValues, TVectorD init_MeanValues, TVectorD init_SigmaValues)
+  : NVariables_ (init_NVariables),
+    EigenVectors_ (init_EigenVectors),
+    EigenValues_ (init_EigenValues),
+    MeanValues_ (init_MeanValues),
+    SigmaValues_ (init_SigmaValues)
+{
+}
 
 
 ////////////////////////////////////////////////////////
diff --git a/Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimParametrization/tools/old_stuff/PCA_Validation.cpp b/Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimParametrization/tools/old_stuff/PCA_Validation.cpp
index 6423efa57ec560391028f09911ed505ea67ef12f..08c9410819d49fb2303867d9c0df570a9206f1bb 100644
--- a/Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimParametrization/tools/old_stuff/PCA_Validation.cpp
+++ b/Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimParametrization/tools/old_stuff/PCA_Validation.cpp
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
 */
 
 #include "TTree.h"
@@ -74,7 +74,7 @@ void P2X(int gNVariables, TMatrixD *EigenVectors,TVectorD *MeanValues, TVectorD
 }
 
 ///////////////////////////////////////////////////////////////////////
-void ScatterPlots(TTree *InputTree, std::string VarPlotted, std::string output){
+void ScatterPlots(TTree *InputTree, const std::string& VarPlotted, const std::string& output){
 ///////////////////////////////////////////////////////////////////////
     
     
@@ -127,7 +127,7 @@ void ScatterPlots(TTree *InputTree, std::string VarPlotted, std::string output){
 }
 
 ///////////////////////////////////////////////////////////////////////
-void PlotterToy1(TH1F* hinput, TH1F* houtput, std::string output){
+void PlotterToy1(TH1F* hinput, TH1F* houtput, const std::string& output){
 ///////////////////////////////////////////////////////////////////////
 
 
@@ -191,7 +191,7 @@ delete tcv;
 
 
 ///////////////////////////////////////////////////////////////////////
-void TransformationChainPlots(TTree *InputTree_Id, std::string VarPlotted_Id, TTree *InputTree_Uniform, std::string VarPlotted_Uniform, TTree *InputTree_Gauss, std::string VarPlotted_Gauss, TH1F* Cumulative , std::string output){
+void TransformationChainPlots(TTree *InputTree_Id, const std::string& VarPlotted_Id, TTree *InputTree_Uniform, const std::string& VarPlotted_Uniform, TTree *InputTree_Gauss, const std::string& VarPlotted_Gauss, TH1F* Cumulative , const std::string& output){
 ///////////////////////////////////////////////////////////////////////
     
     
diff --git a/Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimParametrization/tools/run_shapeparaLocal.C b/Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimParametrization/tools/run_shapeparaLocal.C
index bfe48fe1b7b2110c1314801c02ca5cff55661e3e..462cdab1f970c0e34becf0794d598d4fc52bfa9a 100644
--- a/Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimParametrization/tools/run_shapeparaLocal.C
+++ b/Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimParametrization/tools/run_shapeparaLocal.C
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
 */
 
 /**********************************************************************************
@@ -62,7 +62,8 @@ void run_shapeparaLocal(string action)
 
    // * set what you want to run
 
-   bool doThinning, doStudy, doBinning, doRegression, doPlotting;
+   bool doThinning = false;
+   bool doStudy, doBinning, doRegression, doPlotting;
 
    if (action.compare("thin") == 0)
    {
diff --git a/Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimParametrization/tools/testPersistency.C b/Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimParametrization/tools/testPersistency.C
index 22a10658679cc31102844befbe666ed2f2ae7e1e..c503c77ac70a0d53378000dc7442e36af33fb499 100644
--- a/Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimParametrization/tools/testPersistency.C
+++ b/Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimParametrization/tools/testPersistency.C
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
 */
 
 {
@@ -42,7 +42,7 @@
   
   //that one crashes:
   TFile *input=TFile::Open("PCA2_bin8_pions_calo_10bins.root");
-  TH1D* hist=(TH1D*)input->Get("h_cumulative_PCA_3")); hist->SetName("hist");
+  TH1D* hist=(TH1D*)input->Get("h_cumulative_PCA_3"); hist->SetName("hist");
   
   TFCS1DFunction* fct=TFCSFunction::Create(hist,0);
   cout<<fct<<endl;
diff --git a/Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimParametrization/tools/validate_Epara.C b/Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimParametrization/tools/validate_Epara.C
index b34e2f2778a44ff0de706b099272a660f1d3b3c2..6e23fd8e270c85beeb8a023a3924325f777d5796 100644
--- a/Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimParametrization/tools/validate_Epara.C
+++ b/Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimParametrization/tools/validate_Epara.C
@@ -1,7 +1,10 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
 */
 
+#ifdef __CPPCHECK__
+void validate_Epara()
+#endif
 {
   if(1==0)
   {
diff --git a/Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimParametrization/tools/wiggleClosureAndComparison.cxx b/Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimParametrization/tools/wiggleClosureAndComparison.cxx
index 0ff5d455140460ca312ca9a76e2fa266a9e29f1b..5e283fea1c07d61ca8aaf55c37cdca27ac4fd3c3 100644
--- a/Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimParametrization/tools/wiggleClosureAndComparison.cxx
+++ b/Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimParametrization/tools/wiggleClosureAndComparison.cxx
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
 */
 
 #include "FCS_Cell.h"
@@ -231,7 +231,7 @@ void wiggleClosureAndComparison(TString sampling="Sampling_0"){
 
 
     //NOW make the average shower shapes by looping over all maps
-    for ( std::map<Long64_t, double>::iterator it = Eoriginal.begin(); it!=Eoriginal.end(); it++) {
+    for ( std::map<Long64_t, double>::iterator it = Eoriginal.begin(); it!=Eoriginal.end(); ++it) {
       
       Long64_t myID = it->first;
 
@@ -249,7 +249,7 @@ void wiggleClosureAndComparison(TString sampling="Sampling_0"){
 
 
 
-    for ( std::map<Long64_t, double>::iterator it = EoriginalReco.begin(); it!=EoriginalReco.end(); it++) {
+    for ( std::map<Long64_t, double>::iterator it = EoriginalReco.begin(); it!=EoriginalReco.end(); ++it) {
       
       Long64_t myID = it->first;
 
@@ -265,7 +265,7 @@ void wiggleClosureAndComparison(TString sampling="Sampling_0"){
         
     }
 
-    for ( std::map<Long64_t, double>::iterator it = EoriginalG4.begin(); it!=EoriginalG4.end(); it++) {
+    for ( std::map<Long64_t, double>::iterator it = EoriginalG4.begin(); it!=EoriginalG4.end(); ++it) {
       
       Long64_t myID = it->first;
 
@@ -439,7 +439,7 @@ void wiggleClosureAndComparison(TString sampling="Sampling_0"){
     ///////////////////////////////////
 
     //now I iterate over my closure file and fill the plots
-    for ( std::map<Long64_t, double>::iterator it2 = Eclosure.begin(); it2!=Eclosure.end(); it2++) {
+    for ( std::map<Long64_t, double>::iterator it2 = Eclosure.begin(); it2!=Eclosure.end(); ++it2) {
       
       Long64_t myID = it2->first;
       const CaloGeoDetDescrElement* cell;
@@ -469,7 +469,7 @@ void wiggleClosureAndComparison(TString sampling="Sampling_0"){
 
     }
 
-    for (std::map<Long64_t, double>::iterator it = Eoriginal.begin(); it!=Eoriginal.end(); it++){
+    for (std::map<Long64_t, double>::iterator it = Eoriginal.begin(); it!=Eoriginal.end(); ++it){
 
       Long64_t myID = it->first;