diff --git a/Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimEvent/CMakeLists.txt b/Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimEvent/CMakeLists.txt
index add0e4febf2f32f3fa2b1b5c89625f88e3bb2622..47e92798fcc368b2ccd2158322c544eb850df2e0 100644
--- a/Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimEvent/CMakeLists.txt
+++ b/Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimEvent/CMakeLists.txt
@@ -1,4 +1,4 @@
-# $Id: CMakeLists.txt 769423 2016-08-23 09:45:44Z krasznaa $
+# $Id: CMakeLists.txt 781795 2016-11-02 06:28:22Z vpascuzz $
 ################################################################################
 # Package: ISF_FastCaloSimEvent
 ################################################################################
@@ -25,7 +25,7 @@ atlas_disable_as_needed()
 
 # Component(s) in the package:
 atlas_add_root_dictionary( ISF_FastCaloSimEvent _dictSource
-   ROOT_HEADERS ISF_FastCaloSimEvent/IntArray.h )
+  ROOT_HEADERS ISF_FastCaloSimEvent/IntArray.h ISF_FastCaloSimEvent/TFCS1DFunction.h ISF_FastCaloSimEvent/TFCSEnergyParametrization.h ISF_FastCaloSimEvent/TFCSExtrapolationState.h ISF_FastCaloSimEvent/TFCSParametrization.h ISF_FastCaloSimEvent/TFCSParametrizationBase.h ISF_FastCaloSimEvent/TFCSPCAEnergyParametrization.h ISF_FastCaloSimEvent/TFCSSimulationState.h ISF_FastCaloSimEvent/TFCSTruthState.h ISF_FastCaloSimEvent/LinkDef.h )
 
 atlas_add_library( ISF_FastCaloSimEvent
    ISF_FastCaloSimEvent/*.h ${_dictSource} src/*.cxx
diff --git a/Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimEvent/ISF_FastCaloSimEvent/FastCaloSim_CaloCell_ID.h b/Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimEvent/ISF_FastCaloSimEvent/FastCaloSim_CaloCell_ID.h
index 006e00553e44899124d3743afb5587f5ba5561ca..40479d0fd27b678d65f5dcef16b90534f4691aef 100644
--- a/Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimEvent/ISF_FastCaloSimEvent/FastCaloSim_CaloCell_ID.h
+++ b/Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimEvent/ISF_FastCaloSimEvent/FastCaloSim_CaloCell_ID.h
@@ -7,6 +7,12 @@
 
 #include "CaloGeoHelpers/CaloSampling.h"
 
+enum CaloSubPos {
+  SUBPOS_MID = 0, // middle
+  SUBPOS_ENT = 1, // entrance
+  SUBPOS_EXT = 2  // exit
+};
+
 namespace CaloCell_ID_FCS {
   enum CaloSample_FCS {
     FirstSample=CaloSampling::PreSamplerB,
diff --git a/Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimEvent/ISF_FastCaloSimEvent/LinkDef.h b/Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimEvent/ISF_FastCaloSimEvent/LinkDef.h
new file mode 100644
index 0000000000000000000000000000000000000000..002071ac2367724fa2642be2392e72991b5254b7
--- /dev/null
+++ b/Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimEvent/ISF_FastCaloSimEvent/LinkDef.h
@@ -0,0 +1,27 @@
+/*
+  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+*/
+
+#include "ISF_FastCaloSimEvent/IntArray.h"
+#include "ISF_FastCaloSimEvent/TFCS1DFunction.h"
+#include "ISF_FastCaloSimEvent/TFCSEnergyParametrization.h"
+#include "ISF_FastCaloSimEvent/TFCSExtrapolationState.h"
+#include "ISF_FastCaloSimEvent/TFCSParametrization.h"
+#include "ISF_FastCaloSimEvent/TFCSParametrizationBase.h"
+#include "ISF_FastCaloSimEvent/TFCSPCAEnergyParametrization.h"
+#include "ISF_FastCaloSimEvent/TFCSSimulationState.h"
+#include "ISF_FastCaloSimEvent/TFCSTruthState.h"
+
+#ifdef __CINT__
+#pragma link C++ class IntArray+;
+#pragma link C++ class TFCS1DFunction+;
+#pragma link C++ class TFCSEnergyParametrization+;
+#pragma link C++ class TFCSExtrapolationState+;
+#pragma link C++ class TFCSParametrization+;
+#pragma link C++ class TFCSParametrizationBase+;
+#pragma link C++ class TFCSPCAEnergyParametrization+;
+#pragma link C++ class TFCSSimulationState+;
+#pragma link C++ class TFCSTruthState+;
+#endif
+
+
diff --git a/Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimEvent/ISF_FastCaloSimEvent/TFCS1DFunction.h b/Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimEvent/ISF_FastCaloSimEvent/TFCS1DFunction.h
index 4b585de7f265cd79d8fc1e04c49ace2afa3c59b9..b60fffc80df313c4a509ad0b3c54c99a8ff6afde 100644
--- a/Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimEvent/ISF_FastCaloSimEvent/TFCS1DFunction.h
+++ b/Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimEvent/ISF_FastCaloSimEvent/TFCS1DFunction.h
@@ -17,8 +17,9 @@ class TFCS1DFunction:public TObject
     TFCS1DFunction();
     TFCS1DFunction(TH1* hist);
     
-    virtual void Initialize(TH1* hist);
-    int testHisto(TH1* hist, std::string, float&, float&, std::string, int, std::string);
+    void Initialize(TH1* hist);
+    //int testHisto(TH1* hist, std::string, float&, float&, std::string, int, std::string);
+    int testHisto(TH1* hist, std::string, float&, float&, std::string, int, int, int, double, int);
     
     virtual double rnd_to_fct(double rnd);
     
@@ -31,12 +32,11 @@ class TFCS1DFunction:public TObject
 
   private:
  
- //ClassDef(TFCS1DFunction,1)  //TFCS1DFunction
+ ClassDef(TFCS1DFunction,1)  //TFCS1DFunction
 };
 
-
-#if defined(__MAKECINT__)
-#pragma link C++ class TFCS1DFunction;
-#endif
+//#if defined(__MAKECINT__)
+//#pragma link C++ class TFCS1DFunction+;
+//#endif
 
 #endif
diff --git a/Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimEvent/ISF_FastCaloSimEvent/TFCSEnergyParametrization.h b/Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimEvent/ISF_FastCaloSimEvent/TFCSEnergyParametrization.h
index 7f844be747a491a8847c1d02350ea230758fe181..e30740f77a2f1d22f9d895201ef61ae8f4f60242 100644
--- a/Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimEvent/ISF_FastCaloSimEvent/TFCSEnergyParametrization.h
+++ b/Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimEvent/ISF_FastCaloSimEvent/TFCSEnergyParametrization.h
@@ -19,11 +19,11 @@ public:
   
 private:
 
-  //ClassDef(TFCSEnergyParametrization,1)  //TFCSEnergyParametrization
+  ClassDef(TFCSEnergyParametrization,1)  //TFCSEnergyParametrization
 };
 
-#if defined(__MAKECINT__)
-#pragma link C++ class TFCSEnergyParametrization;
-#endif
+//#if defined(__MAKECINT__)
+//#pragma link C++ class TFCSEnergyParametrization+;
+//#endif
 
 #endif
diff --git a/Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimEvent/ISF_FastCaloSimEvent/TFCSExtrapolationState.h b/Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimEvent/ISF_FastCaloSimEvent/TFCSExtrapolationState.h
index b7d94d8abf7b64f15f662334f344d0197fbdf73d..69bd7264e70484be6d401398c7e4d66a6c1339e4 100644
--- a/Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimEvent/ISF_FastCaloSimEvent/TFCSExtrapolationState.h
+++ b/Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimEvent/ISF_FastCaloSimEvent/TFCSExtrapolationState.h
@@ -55,11 +55,11 @@ class TFCSExtrapolationState:public TObject {
     double m_IDCaloBoundary_r;
     double m_IDCaloBoundary_z;
 
-  //ClassDef(TFCSExtrapolationState,1)  //TFCSExtrapolationState
+  ClassDef(TFCSExtrapolationState,1)  //TFCSExtrapolationState
 };
 
-#if defined(__MAKECINT__)
-#pragma link C++ class TFCSExtrapolationState;
-#endif
+//#if defined(__MAKECINT__)
+//#pragma link C++ class TFCSExtrapolationState+;
+//#endif
 
 #endif
diff --git a/Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimEvent/ISF_FastCaloSimEvent/TFCSPCAEnergyParametrization.h b/Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimEvent/ISF_FastCaloSimEvent/TFCSPCAEnergyParametrization.h
index c8621b6cb94f618cf0fd58c64826e5ccd609654a..98447aeb318dfc0253f79120e8e90ea790357acb 100644
--- a/Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimEvent/ISF_FastCaloSimEvent/TFCSPCAEnergyParametrization.h
+++ b/Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimEvent/ISF_FastCaloSimEvent/TFCSPCAEnergyParametrization.h
@@ -44,13 +44,13 @@ class TFCSPCAEnergyParametrization:public TFCSEnergyParametrization
   std::vector<TFCS1DFunction*> m_cumulative;
   std::vector<TH1D*> h_cumulative;
   
-  //ClassDef(TFCSPCAEnergyParametrization,1)  //TFCSPCAEnergyParametrization
+  ClassDef(TFCSPCAEnergyParametrization,1)  //TFCSPCAEnergyParametrization
  
 };
 
-#if defined(__MAKECINT__)
-#pragma link C++ class TFCSPCAEnergyParametrization;
-#endif
+//#if defined(__MAKECINT__)
+//#pragma link C++ class TFCSPCAEnergyParametrization+;
+//#endif
 
 #endif
 
diff --git a/Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimEvent/ISF_FastCaloSimEvent/TFCSParametrization.h b/Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimEvent/ISF_FastCaloSimEvent/TFCSParametrization.h
index dae0718a5a281695be8ccf0f186f2e1ff0f95878..e5cabf2497e309509ee938792cfa3ef1f71aee4d 100644
--- a/Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimEvent/ISF_FastCaloSimEvent/TFCSParametrization.h
+++ b/Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimEvent/ISF_FastCaloSimEvent/TFCSParametrization.h
@@ -39,11 +39,11 @@ private:
   double m_Ekin_nominal,m_Ekin_min,m_Ekin_max;
   double m_eta_nominal,m_eta_min,m_eta_max;
 
-  //ClassDef(TFCSParametrization,1)  //TFCSParametrization
+  ClassDef(TFCSParametrization,1)  //TFCSParametrization
 };
 
-#if defined(__MAKECINT__)
-#pragma link C++ class TFCSParametrization;
-#endif
+//#if defined(__MAKECINT__)
+//#pragma link C++ class TFCSParametrization+;
+//#endif
 
 #endif
diff --git a/Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimEvent/ISF_FastCaloSimEvent/TFCSParametrizationBase.h b/Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimEvent/ISF_FastCaloSimEvent/TFCSParametrizationBase.h
index 22bb448c6d1b2642ba806baa3b960fe7d3233aad..af606ba8acd6ce7bdbdcd78682a5dfebac527e52 100644
--- a/Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimEvent/ISF_FastCaloSimEvent/TFCSParametrizationBase.h
+++ b/Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimEvent/ISF_FastCaloSimEvent/TFCSParametrizationBase.h
@@ -39,11 +39,11 @@ public:
 private:
   static std::set< int > m_no_pdgid;
 
-  //ClassDef(TFCSParametrizationBase,1)  //TFCSParametrizationBase
+  ClassDef(TFCSParametrizationBase,1)  //TFCSParametrizationBase
 };
 
-#if defined(__MAKECINT__)
-#pragma link C++ class TFCSParametrizationBase;
-#endif
+//#if defined(__MAKECINT__)
+//#pragma link C++ class TFCSParametrizationBase+;
+//#endif
 
 #endif
diff --git a/Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimEvent/ISF_FastCaloSimEvent/TFCSSimulationState.h b/Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimEvent/ISF_FastCaloSimEvent/TFCSSimulationState.h
index dbaeaf7fb9f2a91602ebb0a065aee095ef36767f..a6693abebf611a913221887cb7dd86a6bb6d427c 100644
--- a/Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimEvent/ISF_FastCaloSimEvent/TFCSSimulationState.h
+++ b/Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimEvent/ISF_FastCaloSimEvent/TFCSSimulationState.h
@@ -33,11 +33,11 @@ class TFCSSimulationState:public TObject
     double m_Etot;
     double m_E[CaloCell_ID_FCS::MaxSample];
 
-  //ClassDef(TFCSSimulationState,1)  //TFCSSimulationState
+  ClassDef(TFCSSimulationState,1)  //TFCSSimulationState
 };
 
-#if defined(__MAKECINT__)
-#pragma link C++ class TFCSSimulationState;
-#endif
+//#if defined(__MAKECINT__)
+//#pragma link C++ class TFCSSimulationState+;
+//#endif
 
 #endif
diff --git a/Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimEvent/ISF_FastCaloSimEvent/TFCSTruthState.h b/Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimEvent/ISF_FastCaloSimEvent/TFCSTruthState.h
index b56e6a0aada6b79bfe68b064ee496cb7f2c4b27a..4e8ce4f60716d0dd459aa742b30cdd9acd0243b9 100644
--- a/Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimEvent/ISF_FastCaloSimEvent/TFCSTruthState.h
+++ b/Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimEvent/ISF_FastCaloSimEvent/TFCSTruthState.h
@@ -23,11 +23,11 @@ class TFCSTruthState:public TLorentzVector {
     int m_pdgid;
     TLorentzVector m_vertex;
 
-  //ClassDef(TFCSTruthState,1)  //TFCSTruthState
+  ClassDef(TFCSTruthState,1)  //TFCSTruthState
 };
 
-#if defined(__MAKECINT__)
-#pragma link C++ class TFCSTruthState;
-#endif
+//#if defined(__MAKECINT__)
+//#pragma link C++ class TFCSTruthState+;
+//#endif
 
 #endif
diff --git a/Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimEvent/cmt/requirements b/Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimEvent/cmt/requirements
index 2723248edde81e8a41bcff982062c8716d547995..b7a019fe74eb846046666bd168f56e1be74f7c82 100644
--- a/Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimEvent/cmt/requirements
+++ b/Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimEvent/cmt/requirements
@@ -13,7 +13,7 @@ use CaloGeoHelpers             CaloGeoHelpers-*                Calorimeter
 library ISF_FastCaloSimEventLib *.cxx
 #apply_pattern installed_library
 apply_pattern named_installed_library library=ISF_FastCaloSimEventLib
-apply_pattern have_root_headers root_headers="IntArray.h" headers_lib="ISF_FastCaloSimEventLib"
+apply_pattern have_root_headers root_headers="IntArray.h TFCS1DFunction.h TFCSEnergyParametrization.h TFCSExtrapolationState.h TFCSParametrization.h TFCSParametrizationBase.h TFCSPCAEnergyParametrization.h TFCSSimulationState.h TFCSTruthState.h ../ISF_FastCaloSimEvent/LinkDef.h" headers_lib="ISF_FastCaloSimEventLib"
 
 #for dictionaries
 private
diff --git a/Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimEvent/src/TFCS1DFunction.cxx b/Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimEvent/src/TFCS1DFunction.cxx
index fa4df6975c531eab86611e724441a330e443acef..f734de0e223527439bd23c50db021c47c80640c2 100644
--- a/Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimEvent/src/TFCS1DFunction.cxx
+++ b/Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimEvent/src/TFCS1DFunction.cxx
@@ -2,370 +2,376 @@
   Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
 */
 
-#include "ISF_FastCaloSimEvent/TFCS1DFunction.h"
-
-#include "TMVA/Config.h"
-#include "TMVA/Tools.h"
-#include "TMVA/Reader.h"
-#include "TMVA/Factory.h"
-#include "TFile.h"
-
-#include "TRandom1.h"
-
-
-//=============================================
-//======= TFCS1DFunction =========
-//=============================================
-
-TFCS1DFunction::TFCS1DFunction()
-{
-}
-
-TFCS1DFunction::TFCS1DFunction(TH1* hist)
-{
-  Initialize(hist);
-}
-
-void TFCS1DFunction::Initialize(TH1* /*hist*/)
-{
-}
-
-int TFCS1DFunction::testHisto(TH1* hist, std::string weightfilename, float &rangeval, float &startval, std::string outfilename, int skip_regression, std::string label)
-{
-  
- //transform the histogram
- TH1* h_transf=transform(hist, rangeval, startval); h_transf->SetName("h_transf");
- 
- //Turn the histogram into a tree:
- std::vector<double> contents;
- std::vector<double> centers;
- for(int b=1;b<=h_transf->GetNbinsX();b++)
- {
-  contents.push_back(h_transf->GetBinContent(b));
-  centers.push_back(h_transf->GetBinCenter(b));
- }
- 
- TTree* tree=new TTree("tree","tree");
- Float_t x,y;
- tree->Branch("x",&x,"x/F");
- tree->Branch("y",&y,"y/F");
- 
- for(unsigned int i=0;i<centers.size();i++)
- {
- 	y=(Float_t)(contents[i]);   //xvals are the BinContents
-  x=(Float_t)(centers[i]);    //yvals are the BinCenters
-  
-  tree->Fill();
- }
- 
- double range_low=get_range_low(h_transf);
- 
- TRandom1* myRandom=new TRandom1(); myRandom->SetSeed(0);
- int Ntoys=10000;
- 
- int do_iteration=1;
- int do_range=1;
- double maxdev=100;
- int neurons=2;
- 
- double maxdev_cut=5; //5!!
- 
- std::vector<TH1*> histos;
- while(!skip_regression && maxdev>maxdev_cut && neurons<11) //11
- {
- 	
-  tmvaregression_training(neurons, tree, weightfilename, outfilename);
-  
-  std::cout<<"Testing the regression with "<<Ntoys<<" toys"<<std::endl;
-  TH1* h_output=(TH1*)h_transf->Clone("h_output");
-  h_output->Reset();
-  for(int i=0;i<Ntoys;i++)
-  {
-   double random=myRandom->Uniform(1);
-   if(do_range && random<range_low) random=range_low;
- 	 double value =tmvaregression_application(random,weightfilename);
- 	 h_output->Fill(value); 	 
-  }
-  
-  TH1* h_cumul=get_cumul(h_output);
-  h_cumul->SetName(Form("h_cumul_neurons%i",neurons));
-  histos.push_back(h_cumul);
-  
-  maxdev=get_maxdev(h_transf,h_cumul);
-  std::cout<<"---> Neurons="<<neurons<<" MAXDEV="<<maxdev<<"%"<<std::endl;
-  neurons++;
-  if(!do_iteration) break;
- }
- 
- TH1* histclone=(TH1*)hist->Clone("histclone");
- 
- TFile* out_iteration=new TFile(Form("output/iteration_%s.root",label.c_str()),"RECREATE");
- for(unsigned h=0;h<histos.size();h++)
- {
- 	out_iteration->Add(histos[h]);
- }
- out_iteration->Add(histclone);
- out_iteration->Write();
- out_iteration->Close();
- 
- int regression_success=1;
- if(maxdev>maxdev_cut) regression_success=0;
- 
- int status=0;
- if(regression_success)
- {
-    std::cout<<"Regression successful. Weights are stored."<<std::endl;
-	if(rangeval<0)  status=1;
-	if(rangeval>=0) status=2;
- }
-	
- 
- if(!regression_success)
- {
-    std::cout<<"Regression failed. Histogram is stored."<<std::endl;
-	status=3;
- } //!success
- 
- return status;
- 
-}
-
-double TFCS1DFunction::rnd_to_fct(double /*rnd*/)
-{
-	
-  return 0;
-}
-
-
-double TFCS1DFunction::get_range_low(TH1* hist)
-{
- double range_low=0.0;
- int bin_start=-1;
- for(int b=1;b<=hist->GetNbinsX();b++)
- {
- 	if(hist->GetBinContent(b)>0 && bin_start<0)
- 	{
- 	 bin_start=b;
- 	 range_low=hist->GetBinContent(b);
- 	 b=hist->GetNbinsX()+1;
- 	}
- }
- return range_low;
-}
-
-void TFCS1DFunction::tmvaregression_training(int neurons, TTree *regTree, std::string weightfile, std::string outfilename)
-{
- using namespace TMVA;
-
- TString myMethodList = "" ;
- TMVA::Tools::Instance();
- std::map<std::string,int> Use;
- 
- Use["PDERS"] = 0;  Use["PDEFoam"] = 0; Use["KNN"] = 0;  Use["LD"]  = 0; Use["FDA_GA"] = 0; Use["FDA_MC"] = 0;
- Use["FDA_MT"] = 0; Use["FDA_GAMT"] = 0; Use["MLP"] = 1; Use["SVM"] = 0; Use["BDT"] = 0; Use["BDTG"] = 0;
- 
- std::cout << std::endl; std::cout << "==> Start TMVARegression with "<<neurons<<" Neurons "<<std::endl;
- 
- if(myMethodList != "")
- {
-  for (std::map<std::string,int>::iterator it = Use.begin(); it != Use.end(); it++) it->second = 0;
-  std::vector<TString> mlist = gTools().SplitString( myMethodList, ',' );
-  for (UInt_t i=0; i<mlist.size(); i++)
-  {
-   std::string regMethod(mlist[i]);
-   if (Use.find(regMethod) == Use.end())
-   {
-    std::cout << "Method \"" << regMethod << "\" not known in TMVA under this name. Choose among the following:" << std::endl;
-    for (std::map<std::string,int>::iterator it = Use.begin(); it != Use.end(); it++) std::cout << it->first << " ";
-    std::cout << std::endl;
-    return;
-   }
-   Use[regMethod] = 1;
-  }
- }
- 
-// TString outfileName("TMVAReg.root");
- TFile* outputFile = TFile::Open( outfilename.c_str(), "RECREATE" );
- TMVA::Factory *factory = new TMVA::Factory( "TMVARegression", outputFile, "!V:!Silent:Color:DrawProgressBar" );
- TString dirname=Form("%s/",weightfile.c_str());
- (TMVA::gConfig().GetIONames()).fWeightFileDir = dirname;
- factory->AddVariable( "y", "y", 'F' );
- factory->AddTarget( "x" );
- //TFile *input(0);
- Double_t regWeight  = 1.0;   
- 
- factory->AddRegressionTree( regTree, regWeight );
- TCut mycut = "";
- factory->PrepareTrainingAndTestTree( mycut,"nTrain_Regression=0:nTest_Regression=0:SplitMode=Random:NormMode=NumEvents:!V" );
- 
- if(Use["MLP"])
-  //factory->BookMethod( TMVA::Types::kMLP, "MLP", Form("!H:!V:VarTransform=Norm:NeuronType=tanh:NCycles=20000:HiddenLayers=%i:TestRate=6:TrainingMethod=BFGS:Sampling=0.3:SamplingEpoch=0.8:ConvergenceImprove=1e-6:ConvergenceTests=15:!UseRegulator",neurons) );
-  factory->BookMethod( TMVA::Types::kMLP, "MLP", Form("!H:!V:NeuronType=tanh:NCycles=20000:HiddenLayers=%i:TestRate=6:TrainingMethod=BFGS:Sampling=0.3:SamplingEpoch=0.8:ConvergenceImprove=1e-6:ConvergenceTests=15:!UseRegulator",neurons) ); 
- 
- // Train MVAs using the set of training events
- factory->TrainAllMethods();
- 
- // ---- Evaluate all MVAs using the set of test events
- factory->TestAllMethods();
- 
- // ----- Evaluate and compare performance of all configured MVAs
- factory->EvaluateAllMethods();
- 
- // Save the output
- outputFile->Close();
- 
- std::cout << "==> Wrote root file: " << outputFile->GetName() << std::endl;
- std::cout << "==> TMVARegression is done!" << std::endl;      
-  
- delete factory;  
- 
-}
-
-
-TH1* TFCS1DFunction::transform(TH1* h_input, float &rangeval, float& startval)
-{
- 
- bool do_transform=false;
- float xmin=h_input->GetXaxis()->GetXmin();
- float xmax=h_input->GetXaxis()->GetXmax();
- if(xmin<0 || xmax>1) do_transform=true;
- 
- TH1D* h_out;
- 
- if(do_transform)
- {
-  int nbins=h_input->GetNbinsX();
-  double min=0;
-  double max=1;
-  h_out=new TH1D("h_out","h_out",nbins,min,max);
-  
-  for(int b=1;b<=nbins;b++)
- 	 h_out->SetBinContent(b,h_input->GetBinContent(b));
- 	 
- 	//store the inital range
- 	rangeval=xmax-xmin;
- 	startval=xmin;
- }
- if(!do_transform)
- {
- 	rangeval=-1;
- 	h_out=(TH1D*)h_input->Clone("h_out");
- }
- return h_out;
- 
-}
-
-
-double TFCS1DFunction::get_maxdev(TH1* h_input1, TH1* h_approx1)
-{
- 
- TH1D* h_input =(TH1D*)h_input1->Clone("h_input");
- TH1D* h_approx=(TH1D*)h_approx1->Clone("h_approx");
-	
- double maxdev=0.0;
- 
- //normalize the histos to the same area:
- double integral_input=h_input->Integral();
- double integral_approx=0.0;
- for(int b=1;b<=h_input->GetNbinsX();b++)
- 	integral_approx+=h_approx->GetBinContent(h_approx->FindBin(h_input->GetBinCenter(b)));
- h_approx->Scale(integral_input/integral_approx);
- 
- double ymax=h_approx->GetBinContent(h_approx->GetNbinsX())-h_approx->GetBinContent(h_approx->GetMinimumBin());
- for(int i=1;i<=h_input->GetNbinsX();i++)
- {
-  double val=fabs(h_approx->GetBinContent(h_approx->FindBin(h_input->GetBinCenter(i)))-h_input->GetBinContent(i))/ymax;
-  if(val>maxdev) maxdev=val;
- }
- 
- delete h_input;
- delete h_approx;
- 
- return maxdev*100.0;
- 
-}
-
-
-double TFCS1DFunction::tmvaregression_application(double uniform, std::string weightfile)
-{
- 
- using namespace TMVA;
- 
- TString myMethodList = "" ;
- TMVA::Tools::Instance();
- 
- std::map<std::string,int> Use;
- 
- // --- Mutidimensional likelihood and Nearest-Neighbour methods
- Use["PDERS"]           = 0;   Use["PDEFoam"]         = 0;   Use["KNN"]            = 0;
- Use["LD"]		          = 0;   Use["FDA_GA"]          = 0;   Use["FDA_MC"]          = 0;
- Use["FDA_MT"]          = 0;   Use["FDA_GAMT"]        = 0;   Use["MLP"]             = 1; 
- Use["SVM"]             = 0;   Use["BDT"]             = 0;   Use["BDTG"]            = 0;
- // ---------------------------------------------------------------
- 
- // Select methods (don't look at this code - not of interest)
- if(myMethodList != "")
- {
-  for (std::map<std::string,int>::iterator it = Use.begin(); it != Use.end(); it++) it->second = 0;
-  std::vector<TString> mlist = gTools().SplitString( myMethodList, ',' );
-  for (UInt_t i=0; i<mlist.size(); i++)
-  {
-   std::string regMethod(mlist[i]);
-   if (Use.find(regMethod) == Use.end())
-   {
-    std::cout << "Method \"" << regMethod << "\" not known in TMVA under this name. Choose among the following:" << std::endl;
-    for(std::map<std::string,int>::iterator it = Use.begin(); it != Use.end(); it++) std::cout << it->first << " ";
-    std::cout << std::endl;
-    return 0;
-   }
-   Use[regMethod] = 1;
-  }
- }
- 
- // --------------------------------------------------------------------------------------------------
- 
- TMVA::Reader *reader = new TMVA::Reader( "!Color:Silent");    
- 
- Float_t y=uniform;
- reader->AddVariable( "y", &y );
- 
- TString dir    = Form("%s/",weightfile.c_str());
- TString prefix = "TMVARegression";
- 
- // Book method(s)
- for (std::map<std::string,int>::iterator it = Use.begin(); it != Use.end(); it++)
- {
-  if (it->second)
-  {
-   TString methodName = it->first + " method";
-   TString weightfile = dir + prefix + "_" + TString(it->first) + ".weights.xml";
-   reader->BookMVA( methodName, weightfile ); 
-  }
- }
- 
- Float_t val = (reader->EvaluateRegression("MLP method"))[0];
- delete reader;
- return val;
- 
-}
-
-
-TH1* TFCS1DFunction::get_cumul(TH1* hist)
-{
- TH1D* h_cumul=(TH1D*)hist->Clone("h_cumul");
- double sum=0;
- for(int b=1;b<=h_cumul->GetNbinsX();b++)
- {
- 	sum+=hist->GetBinContent(b);
- 	h_cumul->SetBinContent(b,sum);
- }
- return h_cumul; 
-}
-
-
-//=============================================
-//========== ROOT persistency stuff ===========
-//=============================================
-
-//ClassImp(TFCS1DFunction)
-
+#include "ISF_FastCaloSimEvent/TFCS1DFunction.h"
+
+#include "TMVA/Config.h"
+#include "TMVA/Tools.h"
+#include "TMVA/Reader.h"
+#include "TMVA/Factory.h"
+#include "TMVA/DataLoader.h"
+#include "TFile.h"
+
+#include "TRandom1.h"
+
+//=============================================
+//======= TFCS1DFunction =========
+//=============================================
+
+TFCS1DFunction::TFCS1DFunction()
+{
+}
+
+TFCS1DFunction::TFCS1DFunction(TH1* hist)
+{
+  Initialize(hist);
+}
+
+void TFCS1DFunction::Initialize(TH1* /*hist*/)
+{
+}
+
+int TFCS1DFunction::testHisto(TH1* hist, std::string weightfilename, float &rangeval, float &startval, std::string outfilename, int skip_regression,
+    int neurons_start, int neurons_end, double cut_maxdev, int ntoys)
+{
+
+  //int debug=1;
+
+  //transform the histogram
+  TH1* h_transf=transform(hist, rangeval, startval); h_transf->SetName("h_transf");
+
+  //Turn the histogram into a tree:
+  std::vector<double> contents;
+  std::vector<double> centers;
+  for(int b=1;b<=h_transf->GetNbinsX();b++)
+  {
+    contents.push_back(h_transf->GetBinContent(b));
+    centers.push_back(h_transf->GetBinCenter(b));
+  }
+
+  TTree* tree=new TTree("tree","tree");
+  Float_t x,y;
+  tree->Branch("x",&x,"x/F");
+  tree->Branch("y",&y,"y/F");
+
+  for(unsigned int i=0;i<centers.size();i++)
+  {
+    y=(Float_t)(contents[i]);   //xvals are the BinContents
+    x=(Float_t)(centers[i]);    //yvals are the BinCenters
+
+    tree->Fill();
+  }
+
+  double range_low=get_range_low(h_transf);
+
+  TRandom1* myRandom=new TRandom1(); myRandom->SetSeed(0);
+
+  //int do_iteration=1;
+  int do_range=1;
+  double maxdev=1000;
+  int neurons=neurons_start;
+  std::vector<TH1*> histos;
+  if(skip_regression) std::cout<<"skipping regression"<<std::endl;
+  while(!skip_regression && maxdev>cut_maxdev && neurons<=neurons_end)
+  {
+
+    tmvaregression_training(neurons, tree, weightfilename, outfilename);
+
+    std::cout<<"Testing the regression with "<<ntoys<<" toys"<<std::endl;
+    TH1* h_output=(TH1*)h_transf->Clone("h_output");
+    h_output->Reset();
+    for(int i=0;i<ntoys;i++)
+    {
+      double random=myRandom->Uniform(1);
+      if(do_range && random<range_low) random=range_low;
+      double value =tmvaregression_application(random,weightfilename);
+      h_output->Fill(value);    
+    }
+
+    TH1* h_cumul=get_cumul(h_output);
+    h_cumul->SetName(Form("h_cumul_neurons%i",neurons));
+    histos.push_back(h_cumul);
+
+    maxdev=get_maxdev(h_transf,h_cumul);
+    std::cout<<"---> Neurons="<<neurons<<" MAXDEV="<<maxdev<<"%"<<std::endl;
+    neurons++;
+    //if(!do_iteration) break;
+  }
+
+  //TH1* histclone=(TH1*)hist->Clone("histclone");
+
+  /* 
+     TFile* out_iteration=new TFile(Form("output/iteration_%s.root",label.c_str()),"RECREATE");
+     for(int h=0;h<histos.size();h++)
+     {
+     out_iteration->Add(histos[h]);
+     }
+     out_iteration->Add(histclone);
+     out_iteration->Write();
+     out_iteration->Close();
+     */
+
+  int regression_success=1;
+  if(maxdev>cut_maxdev) regression_success=0;
+
+  int status=0;
+  if(regression_success)
+  {
+    std::cout<<"Regression successful. Weights are stored."<<std::endl;
+    if(rangeval<0)  status=1;
+    if(rangeval>=0) status=2;
+  }
+
+  if(!regression_success)
+  {
+    std::cout<<"Regression failed. Histogram is stored."<<std::endl;
+    status=3;
+  } //!success
+
+  return status;
+
+}
+
+double TFCS1DFunction::rnd_to_fct(double /*rnd*/)
+{
+
+  return 0;
+}
+
+
+double TFCS1DFunction::get_range_low(TH1* hist)
+{
+  double range_low=0.0;
+  int bin_start=-1;
+  for(int b=1;b<=hist->GetNbinsX();b++)
+  {
+    if(hist->GetBinContent(b)>0 && bin_start<0)
+    {
+      bin_start=b;
+      range_low=hist->GetBinContent(b);
+      b=hist->GetNbinsX()+1;
+    }
+  }
+  return range_low;
+}
+
+void TFCS1DFunction::tmvaregression_training(int neurons, TTree *regTree, std::string weightfile, std::string outfilename)
+{
+  using namespace TMVA;
+
+  TString myMethodList = "" ;
+  TMVA::Tools::Instance();
+  std::map<std::string,int> Use;
+
+  Use["PDERS"] = 0;  Use["PDEFoam"] = 0; Use["KNN"] = 0;  Use["LD"]  = 0; Use["FDA_GA"] = 0; Use["FDA_MC"] = 0;
+  Use["FDA_MT"] = 0; Use["FDA_GAMT"] = 0; Use["MLP"] = 1; Use["SVM"] = 0; Use["BDT"] = 0; Use["BDTG"] = 0;
+
+  std::cout << std::endl; std::cout << "==> Start TMVARegression with "<<neurons<<" Neurons "<<std::endl;
+
+  if(myMethodList != "")
+  {
+    for (std::map<std::string,int>::iterator it = Use.begin(); it != Use.end(); it++) it->second = 0;
+    std::vector<TString> mlist = gTools().SplitString( myMethodList, ',' );
+    for (UInt_t i=0; i<mlist.size(); i++)
+    {
+      std::string regMethod(mlist[i]);
+      if (Use.find(regMethod) == Use.end())
+      {
+        std::cout << "Method \"" << regMethod << "\" not known in TMVA under this name. Choose among the following:" << std::endl;
+        for (std::map<std::string,int>::iterator it = Use.begin(); it != Use.end(); it++) std::cout << it->first << " ";
+        std::cout << std::endl;
+        return;
+      }
+      Use[regMethod] = 1;
+    }
+  }
+
+  // TString outfileName("TMVAReg.root");
+  TFile* outputFile = TFile::Open( outfilename.c_str(), "RECREATE" );
+  TMVA::Factory *factory = new TMVA::Factory( "TMVARegression", outputFile, "!V:!Silent:Color:DrawProgressBar" );
+  TString dirname=Form("%s/",weightfile.c_str());
+  (TMVA::gConfig().GetIONames()).fWeightFileDir = dirname;
+  	
+  TMVA::DataLoader *dl=new TMVA::DataLoader("dl");
+
+  if(Use["MLP"])
+    //factory->BookMethod( TMVA::Types::kMLP, "MLP", Form("!H:!V:VarTransform=Norm:NeuronType=tanh:NCycles=20000:HiddenLayers=%i:TestRate=6:TrainingMethod=BFGS:Sampling=0.3:SamplingEpoch=0.8:ConvergenceImprove=1e-6:ConvergenceTests=15:!UseRegulator",neurons) );
+    factory->BookMethod(dl, TMVA::Types::kMLP, "MLP", Form("!H:!V:VerbosityLevel=Info:NeuronType=tanh:NCycles=20000:HiddenLayers=%i:TestRate=6:TrainingMethod=BFGS:Sampling=0.3:SamplingEpoch=0.8:ConvergenceImprove=1e-6:ConvergenceTests=15:!UseRegulator",neurons)); 
+    	
+  dl->AddVariable( "y", "y", 'F' );
+  dl->AddTarget( "x" );
+  //TFile *input(0);
+  Double_t regWeight  = 1.0;   
+
+  dl->AddRegressionTree( regTree, regWeight );
+  TCut mycut = "";
+  dl->PrepareTrainingAndTestTree( mycut,"nTrain_Regression=0:nTest_Regression=0:SplitMode=Random:NormMode=NumEvents:!V" );
+
+
+  // Train MVAs using the set of training events
+  factory->TrainAllMethods();
+
+  // ---- Evaluate all MVAs using the set of test events
+  factory->TestAllMethods();
+
+  // ----- Evaluate and compare performance of all configured MVAs
+  factory->EvaluateAllMethods();
+
+  // Save the output
+  outputFile->Close();
+
+  std::cout << "==> Wrote root file: " << outputFile->GetName() << std::endl;
+  std::cout << "==> TMVARegression is done!" << std::endl;      
+
+  delete factory;  
+
+}
+
+
+TH1* TFCS1DFunction::transform(TH1* h_input, float &rangeval, float& startval)
+{
+
+  bool do_transform=false;
+  float xmin=h_input->GetXaxis()->GetXmin();
+  float xmax=h_input->GetXaxis()->GetXmax();
+  if(xmin<0 || xmax>1) do_transform=true;
+
+  TH1D* h_out;
+
+  if(do_transform)
+  {
+    int nbins=h_input->GetNbinsX();
+    double min=0;
+    double max=1;
+    h_out=new TH1D("h_out","h_out",nbins,min,max);
+
+    for(int b=1;b<=nbins;b++)
+      h_out->SetBinContent(b,h_input->GetBinContent(b));
+
+    //store the inital range
+    rangeval=xmax-xmin;
+    startval=xmin;
+  }
+  if(!do_transform)
+  {
+    rangeval=-1;
+    h_out=(TH1D*)h_input->Clone("h_out");
+  }
+  return h_out;
+
+}
+
+
+double TFCS1DFunction::get_maxdev(TH1* h_input1, TH1* h_approx1)
+{
+
+  TH1D* h_input =(TH1D*)h_input1->Clone("h_input");
+  TH1D* h_approx=(TH1D*)h_approx1->Clone("h_approx");
+
+  double maxdev=0.0;
+
+  //normalize the histos to the same area:
+  double integral_input=h_input->Integral();
+  double integral_approx=0.0;
+  for(int b=1;b<=h_input->GetNbinsX();b++)
+    integral_approx+=h_approx->GetBinContent(h_approx->FindBin(h_input->GetBinCenter(b)));
+  h_approx->Scale(integral_input/integral_approx);
+
+  double ymax=h_approx->GetBinContent(h_approx->GetNbinsX())-h_approx->GetBinContent(h_approx->GetMinimumBin());
+  for(int i=1;i<=h_input->GetNbinsX();i++)
+  {
+    double val=fabs(h_approx->GetBinContent(h_approx->FindBin(h_input->GetBinCenter(i)))-h_input->GetBinContent(i))/ymax;
+    if(val>maxdev) maxdev=val;
+  }
+
+  delete h_input;
+  delete h_approx;
+
+  return maxdev*100.0;
+
+}
+
+
+double TFCS1DFunction::tmvaregression_application(double uniform, std::string weightfile)
+{
+
+  using namespace TMVA;
+
+  TString myMethodList = "" ;
+  TMVA::Tools::Instance();
+
+  std::map<std::string,int> Use;
+
+  // --- Mutidimensional likelihood and Nearest-Neighbour methods
+  Use["PDERS"]           = 0;   Use["PDEFoam"]         = 0;   Use["KNN"]            = 0;
+  Use["LD"]             = 0;   Use["FDA_GA"]          = 0;   Use["FDA_MC"]          = 0;
+  Use["FDA_MT"]          = 0;   Use["FDA_GAMT"]        = 0;   Use["MLP"]             = 1; 
+  Use["SVM"]             = 0;   Use["BDT"]             = 0;   Use["BDTG"]            = 0;
+  // ---------------------------------------------------------------
+
+  // Select methods (don't look at this code - not of interest)
+  if(myMethodList != "")
+  {
+    for (std::map<std::string,int>::iterator it = Use.begin(); it != Use.end(); it++) it->second = 0;
+    std::vector<TString> mlist = gTools().SplitString( myMethodList, ',' );
+    for (UInt_t i=0; i<mlist.size(); i++)
+    {
+      std::string regMethod(mlist[i]);
+      if (Use.find(regMethod) == Use.end())
+      {
+        std::cout << "Method \"" << regMethod << "\" not known in TMVA under this name. Choose among the following:" << std::endl;
+        for(std::map<std::string,int>::iterator it = Use.begin(); it != Use.end(); it++) std::cout << it->first << " ";
+        std::cout << std::endl;
+        return 0;
+      }
+      Use[regMethod] = 1;
+    }
+  }
+
+  // --------------------------------------------------------------------------------------------------
+
+  TMVA::Reader *reader = new TMVA::Reader( "!Color:Silent");    
+
+  Float_t y=uniform;
+  reader->AddVariable( "y", &y );
+
+  TString dir    = Form("%s/",weightfile.c_str());
+  TString prefix = "TMVARegression";
+
+  // Book method(s)
+  for (std::map<std::string,int>::iterator it = Use.begin(); it != Use.end(); it++)
+  {
+    if (it->second)
+    {
+      TString methodName = it->first + " method";
+      TString weightfile = dir + prefix + "_" + TString(it->first) + ".weights.xml";
+      reader->BookMVA( methodName, weightfile ); 
+    }
+  }
+
+  Float_t val = (reader->EvaluateRegression("MLP method"))[0];
+  delete reader;
+  return val;
+
+}
+
+
+TH1* TFCS1DFunction::get_cumul(TH1* hist)
+{
+  TH1D* h_cumul=(TH1D*)hist->Clone("h_cumul");
+  double sum=0;
+  for(int b=1;b<=h_cumul->GetNbinsX();b++)
+  {
+    sum+=hist->GetBinContent(b);
+    h_cumul->SetBinContent(b,sum);
+  }
+  return h_cumul; 
+}
+
+
+//=============================================
+//========== ROOT persistency stuff ===========
+//=============================================
+
+ClassImp(TFCS1DFunction)
+
+
diff --git a/Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimEvent/src/TFCSEnergyParametrization.cxx b/Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimEvent/src/TFCSEnergyParametrization.cxx
index 8121cc7025575ba03c35ad44fd734cd90bc46cb4..1012dd791ff83a1f8c065877ecac2bc3c67acd22 100644
--- a/Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimEvent/src/TFCSEnergyParametrization.cxx
+++ b/Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimEvent/src/TFCSEnergyParametrization.cxx
@@ -17,5 +17,5 @@ TFCSEnergyParametrization::TFCSEnergyParametrization(const char* name, const cha
 //========== ROOT persistency stuff ===========
 //=============================================
 
-//ClassImp(TFCSEnergyParametrization)
+ClassImp(TFCSEnergyParametrization)
 
diff --git a/Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimEvent/src/TFCSExtrapolationState.cxx b/Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimEvent/src/TFCSExtrapolationState.cxx
index 191f338b2ef7f73e32477f592ba11f217fbfb826..07d7619e92812927cc45849ebe7e11baf3adc482 100644
--- a/Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimEvent/src/TFCSExtrapolationState.cxx
+++ b/Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimEvent/src/TFCSExtrapolationState.cxx
@@ -38,5 +38,5 @@ void TFCSExtrapolationState::clear()
 //========== ROOT persistency stuff ===========
 //=============================================
 
-//ClassImp(TFCSExtrapolationState)
+ClassImp(TFCSExtrapolationState)
 
diff --git a/Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimEvent/src/TFCSPCAEnergyParametrization.cxx b/Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimEvent/src/TFCSPCAEnergyParametrization.cxx
index d198e6cd36be71e635659031540685b6cf174270..cf875550070b264fef3e5b92a1e54e725dfd0ee2 100644
--- a/Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimEvent/src/TFCSPCAEnergyParametrization.cxx
+++ b/Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimEvent/src/TFCSPCAEnergyParametrization.cxx
@@ -57,8 +57,8 @@ void TFCSPCAEnergyParametrization::simulate(TFCSSimulationState& simulstate,cons
  double* gauss_rms  =m_Gauss_rms->GetMatrixArray();
  double* lowerBounds=m_LowerBounds->GetMatrixArray();
  
- double output_data[layer.size()];
- double input_data[layer.size()];
+ double output_data[layer.size()] = { };
+ double input_data[layer.size()]  = { };
  
  for(unsigned int l=0;l<layer.size();l++)
  {
@@ -348,5 +348,5 @@ void TFCSPCAEnergyParametrization::loadInputs(TFile* file)
 //========== ROOT persistency stuff ===========
 //=============================================
 
-//ClassImp(TFCSPCAEnergyParametrization)
+ClassImp(TFCSPCAEnergyParametrization)
 
diff --git a/Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimEvent/src/TFCSParametrization.cxx b/Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimEvent/src/TFCSParametrization.cxx
index 1b3453aa9cdae331d2e057ca711ddffbc9347579..492de4fe4dfe39de5edbac596eb253161a980707 100644
--- a/Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimEvent/src/TFCSParametrization.cxx
+++ b/Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimEvent/src/TFCSParametrization.cxx
@@ -63,5 +63,5 @@ void TFCSParametrization::set_eta_max(double max)
 //========== ROOT persistency stuff ===========
 //=============================================
 
-//ClassImp(TFCSParametrization)
+ClassImp(TFCSParametrization)
 
diff --git a/Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimEvent/src/TFCSParametrizationBase.cxx b/Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimEvent/src/TFCSParametrizationBase.cxx
index 28a3180a3da06641b78d7a2c31c128f12a917a54..d6137f89b402a251dbe0cff496f9205cadfe1b1a 100644
--- a/Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimEvent/src/TFCSParametrizationBase.cxx
+++ b/Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimEvent/src/TFCSParametrizationBase.cxx
@@ -35,5 +35,5 @@ void TFCSParametrizationBase::Print(Option_t *option) const
 //========== ROOT persistency stuff ===========
 //=============================================
 
-//ClassImp(TFCSParametrizationBase)
+ClassImp(TFCSParametrizationBase)
 
diff --git a/Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimEvent/src/TFCSSimulationState.cxx b/Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimEvent/src/TFCSSimulationState.cxx
index c5669b9f6090523d205ffc01d3f0efb423d72d0b..8dc77587b981d10f32fe52def5d2c689f357f1e3 100644
--- a/Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimEvent/src/TFCSSimulationState.cxx
+++ b/Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimEvent/src/TFCSSimulationState.cxx
@@ -31,5 +31,5 @@ void TFCSSimulationState::deposit_HIT(int /*sample*/,double /*hit_eta*/,double /
 //========== ROOT persistency stuff ===========
 //=============================================
 
-//ClassImp(TFCSSimulationState)
+ClassImp(TFCSSimulationState)
 
diff --git a/Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimEvent/src/TFCSTruthState.cxx b/Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimEvent/src/TFCSTruthState.cxx
index 272556ad143dcd579d60e2e1b98fc983342b1936..73bdca4a1785bfec9aeb70d9a50b6aab66627d40 100644
--- a/Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimEvent/src/TFCSTruthState.cxx
+++ b/Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimEvent/src/TFCSTruthState.cxx
@@ -21,5 +21,5 @@ TFCSTruthState::TFCSTruthState(Double_t x, Double_t y, Double_t z, Double_t t, i
 //========== ROOT persistency stuff ===========
 //=============================================
 
-//ClassImp(TFCSTruthState)
+ClassImp(TFCSTruthState)