diff --git a/.ci/github/Singularity b/.ci/github/Singularity
new file mode 100644
index 0000000000000000000000000000000000000000..4303d620e6086c0bd09b64a007e980416f357acb
--- /dev/null
+++ b/.ci/github/Singularity
@@ -0,0 +1,5 @@
+BootStrap:docker
+From:centos:7
+
+%post
+       yum install -y libicu which make redhat-lsb epel-release libglvnd-devel git mesa-libGLU-devel libXmu-devel motif-devel compat-db47
diff --git a/.ci/github/setup-github-runner.sh b/.ci/github/setup-github-runner.sh
new file mode 100755
index 0000000000000000000000000000000000000000..0d7147c42c106a38a9ce5364d720a25361c2a5b9
--- /dev/null
+++ b/.ci/github/setup-github-runner.sh
@@ -0,0 +1,154 @@
+#!/bin/bash
+############################################
+# Description:
+#   Manage the github runners in singularity
+# Usage:
+#   $ ./setup-github-runner new <TOKEN>
+#   $ ./setup-github-runner start
+# Author: Tao Lin <lintao AT ihep.ac.cn>
+############################################
+
+
+#############################################
+# Configuration
+#############################################
+export RUNNER_TOP_DIR=/tmp/$USER/github-runner
+export SINGULARITY_BINDPATH=/cvmfs
+export RUNNER_REPO=https://github.com/cepc/CEPCSW
+
+[ -d "$RUNNER_TOP_DIR" ] || mkdir $RUNNER_TOP_DIR
+
+#############################################
+# Create a new github action runner (gar)
+#############################################
+
+function gar-new-id() {
+    local currentid="$(find $RUNNER_TOP_DIR -maxdepth 1 -name github-runner-\* -type d | rev | cut -d- -f 1 | rev | sort -n | tail -n1)"
+    if [ -z "$currentid" ]; then
+        echo 1
+    else
+        echo $((currentid+1))
+    fi
+}
+
+function gar-new-name() {
+    echo github-runner-$(gar-new-id)
+}
+
+function gar-download-url() {
+    echo https://github.com/actions/runner/releases/download/v2.274.2/actions-runner-linux-x64-2.274.2.tar.gz
+}
+function gar-download-filename() {
+    echo actions-runner-linux-x64-2.274.2.tar.gz
+}
+
+function gar-new() {
+    local dn=$(gar-new-name)
+    local fdn=$RUNNER_TOP_DIR/$dn
+    if [ -d "$fdn" ]; then
+        echo "ERROR: $dn already exists" 1>&2
+        exit -1
+    fi
+
+    mkdir $fdn || {
+        echo "ERROR: Failed to create $fdn" 1>&2
+        exit -1
+    }
+
+
+    pushd $RUNNER_TOP_DIR
+    if [ ! -f "$(gar-download-filename)" ]; then
+        curl -O -L $(gar-download-url) || exit -1
+    fi
+    popd
+
+    pushd $fdn
+
+    tar xzf $RUNNER_TOP_DIR/$(gar-download-filename) || exit -1
+
+    # start singularity instance
+    singularity instance start ~/github-runner.sif ${dn}
+    
+    singularity run instance://${dn} ./config.sh --url ${RUNNER_REPO} --token ${token} || exit -1
+    singularity run instance://${dn} bash -c "./run.sh &"
+
+    popd
+    
+}
+
+function new() {
+
+    token=$1; shift
+    if [ -z "$token" ]; then
+        echo "Please pass the token to this script" 1>&2
+        exit -1
+    fi
+    gar-new
+}
+
+#############################################
+# Start github action runners (gar)
+#############################################
+
+function gar-lists() {
+    find $RUNNER_TOP_DIR -maxdepth 1 -name github-runner-\* -type d -exec basename {} \;
+}
+
+function gar-check() {
+    local gar=$1;
+    local result=$(singularity instance list $gar | grep $gar)
+    if [ -n "$result" ]; then
+        echo Y
+    else
+        echo N
+    fi
+}
+
+function gar-start() {
+    local gar=$1;
+
+    local isrunning=$(gar-check $gar)
+    if [ "$isrunning" = "Y" ]; then
+        echo "WARNING: $gar is already running. skip it."
+        return
+    fi
+
+    pushd $RUNNER_TOP_DIR/$gar
+    singularity instance start ~/github-runner.sif ${gar}
+    singularity run instance://${gar} bash -c "./run.sh &"
+    popd
+}
+
+function start() {
+    local gars="$*"
+    if [ -z "$gars" ]; then
+        echo "All the github action runners will be started"
+        gars="$(gar-lists)"
+    fi
+    local gar
+    for gar in $gars; do
+        gar-start $gar
+    done
+}
+
+#############################################
+# Command line options
+#############################################
+
+cmd=$1; shift
+if [ -z "$cmd" ]; then
+    echo "Please specify the command to be invoked" 1>&2
+    exit -1
+fi
+
+case $cmd in
+    new)
+        new $*
+        ;;
+    start)
+        start $*
+        ;;
+    *)
+        echo "Unknown command '$cmd'" 1>&2
+        ;;
+esac
diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml
new file mode 100644
index 0000000000000000000000000000000000000000..e74e4aedb362cf60ae35d0fd3a4f99f90650774b
--- /dev/null
+++ b/.github/workflows/main.yml
@@ -0,0 +1,46 @@
+# This is a basic workflow to help you get started with Actions
+
+name: CI
+
+# Controls when the action will run. 
+on:
+  # Triggers the workflow on push or pull request events but only for the master branch
+  push:
+    branches: [ master ]
+  pull_request:
+    branches: [ master ]
+
+  # Allows you to run this workflow manually from the Actions tab
+  workflow_dispatch:
+
+# A workflow run is made up of one or more jobs that can run sequentially or in parallel
+jobs:
+  # This workflow contains a single job called "build"
+  build:
+    # The type of runner that the job will run on
+    runs-on: self-hosted
+    strategy:
+      matrix:
+        LCG_RELEASE: [LCG_97, KEY4HEP_STACK]
+
+    # Steps represent a sequence of tasks that will be executed as part of the job
+    steps:
+      # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
+      - uses: actions/checkout@v2
+
+      # Runs a single command using the runners shell
+      - name: Run a one-line script
+        run: echo Hello, world!
+
+      # Runs a set of commands using the runners shell
+      - name: Run a multi-line script
+        run: |
+          echo Add other actions to build,
+          echo test, and deploy your project.
+          
+      - name: Run the build script
+        run: |
+          pwd
+          bash ./.build.ci.sh
+        env:
+          LCG_RELEASE: ${{strategy.LCG_RELEASE}}
diff --git a/Analysis/TotalInvMass/CMakeLists.txt b/Analysis/TotalInvMass/CMakeLists.txt
new file mode 100644
index 0000000000000000000000000000000000000000..f51ee995440c5b76114495421ba3bc2fd26b8528
--- /dev/null
+++ b/Analysis/TotalInvMass/CMakeLists.txt
@@ -0,0 +1,18 @@
+gaudi_subdir(TotalInvMass v0r0)
+
+find_package(CLHEP REQUIRED;CONFIG)
+find_package(DD4hep COMPONENTS DDG4 REQUIRED)
+find_package(EDM4HEP REQUIRED)
+find_package(GEAR REQUIRED)
+find_package(GSL REQUIRED ) 
+find_package(LCIO REQUIRED ) 
+find_package(podio REQUIRED ) 
+find_package(k4FWCore REQUIRED)
+
+set(TotalInvMass_srcs src/TotalInvMass.cc)
+
+gaudi_add_module(TotalInvMass ${TotalInvMass_srcs}
+    INCLUDE_DIRS k4FWCore GaudiKernel GaudiAlgLib ${CLHEP_INCLUDE_DIR} DD4hep gear ${GSL_INCLUDE_DIRS} ${LCIO_INCLUDE_DIRS}
+    LINK_LIBRARIES k4FWCore GaudiKernel GaudiAlgLib ${CLHEP_LIBRARIES} DD4hep ${GEAR_LIBRARIES} ${GSL_LIBRARIES} ${LCIO_LIBRARIES}
+    EDM4HEP::edm4hep EDM4HEP::edm4hepDict
+)
diff --git a/Analysis/TotalInvMass/src/TotalInvMass.cc b/Analysis/TotalInvMass/src/TotalInvMass.cc
new file mode 100644
index 0000000000000000000000000000000000000000..536739b25b1939bb841dbb54216c21671c78a28c
--- /dev/null
+++ b/Analysis/TotalInvMass/src/TotalInvMass.cc
@@ -0,0 +1,718 @@
+#include "TotalInvMass.hh"
+#include <EVENT/LCCollection.h>
+#include <IMPL/LCCollectionVec.h>
+#include <EVENT/LCFloatVec.h>
+#include <EVENT/MCParticle.h>
+#include <EVENT/ReconstructedParticle.h>
+#include <IMPL/MCParticleImpl.h>
+#include <values.h>
+#include <string>
+#include <iostream>
+#include <EVENT/LCFloatVec.h>
+#include <EVENT/LCParameters.h>
+#include <stdexcept>
+#include <TFile.h> 
+#include <TTree.h>
+#include <TH1F.h>
+#include <TVector3.h>
+#include <TRandom.h>
+#include <Rtypes.h> 
+#include <sstream>		
+#include <cmath>
+#include <vector>
+#include <TMath.h>
+#include "TLorentzVector.h"
+#include <UTIL/CellIDDecoder.h>
+
+using namespace std;
+
+DECLARE_COMPONENT(TotalInvMass)
+
+
+const float sqrts = 250.0; 	//GeV
+
+const string ECALCellIDDecoder = "M:3,S-1:3,I:9,J:9,K-1:6";
+//TH1F *h_hit;
+
+TotalInvMass::TotalInvMass(const std::string& name, ISvcLocator* svcLoc)
+    : GaudiAlgorithm(name, svcLoc),
+      _output(0)
+{
+    // _description = "Print MC Truth" ;
+
+    /*
+      _colName="MCParticle";
+      registerProcessorParameter( "MCObjects" ,
+      "The name of the PFOs" ,
+      _colName ,
+      _colName);
+    */
+	
+    /*
+      _leptonID = 13;
+      registerProcessorParameter( "LeptonIDTag" ,
+      "Lepton ID that will be used in this analysis." ,
+      _leptonID ,
+      _leptonID);
+    */	
+
+}
+
+StatusCode TotalInvMass::initialize() {
+    info() << "TotalInvMass::initializing..." << endmsg;
+    // printParameters();
+
+    TFile *tree_file=new TFile(_treeFileName.value().c_str(),(_overwrite ? "RECREATE" : "UPDATE"));
+
+    if (!tree_file->IsOpen()) {
+        delete tree_file;
+        tree_file=new TFile(_treeFileName.value().c_str(),"NEW");
+    }
+
+    //h_hit=new TH1F("hit","hit",80,0,80);
+    _outputTree = new TTree(_treeName.value().c_str(),_treeName.value().c_str());
+    _outputTree->SetAutoSave(32*1024*1024);  // autosave every 32MB
+    _outputTree->Branch("EventNr", &_eventNr, "EventNr/I");
+    _outputTree->Branch("Num", &_Num, "Num/I");
+	
+    _outputTree->Branch("OriQuarkID", &_OriQuarkID, "OriQuarkID/I");
+
+    _outputTree->Branch("ISREn", &_ISREn, "ISREn/F");
+    _outputTree->Branch("ISRP", _ISRP, "ISRP[3]/F");
+    _outputTree->Branch("ISRPt", &_ISRPt, "ISRPt/F");
+
+
+    _outputTree->Branch("NEn", &_NEn, "NEn/F");
+    _outputTree->Branch("NPt", &_NPt, "NPt/F");
+
+    _outputTree->Branch("N3En", &_N3En, "N3En/F");
+    _outputTree->Branch("N3Pt", &_N3Pt, "N3Pt/F");
+
+
+    _outputTree->Branch("OriJ1CosTheta", &_OriJ1CosTheta, "OriJ1CosTheta/F");
+    _outputTree->Branch("OriJ2CosTheta", &_OriJ2CosTheta, "OriJ2CosTheta/F");
+    _outputTree->Branch("MaxOriJetCosTheta", &_MaxOriJetCosTheta, "MaxOriJetCosTheta/F");
+
+    _outputTree->Branch("J1CosTheta", &_J1CosTheta, "J1CosTheta/F");
+    _outputTree->Branch("J2CosTheta", &_J2CosTheta, "J2CosTheta/F");
+    _outputTree->Branch("MaxJetCosTheta", &_MaxJetCosTheta, "MaxJetCosTheta/F");
+
+    _outputTree->Branch("OQDir", &_OQDir, "OQDir/F");
+    _outputTree->Branch("HDPID", &_HDPID, "HDPID/I");	//Higgs Daughter Type, Direction??
+    _outputTree->Branch("visE", &_visE, "visE/F");	//Higgs Daughter Type, Direction??
+    _outputTree->Branch("HDir", &_HDir, "HDir/F");
+    _outputTree->Branch("Mass_a", &_Mass_a, "Mass_a/F");
+    _outputTree->Branch("Mass_p", &_Mass_p, "Mass_p/F");
+    _outputTree->Branch("Mass_p_Pisr", &_Mass_p_Pisr, "Mass_p_Pisr");
+    _outputTree->Branch("Mass_a_Pisr", &_Mass_a_Pisr, "Mass_a_Pisr");
+    _outputTree->Branch("Mass_a_Plcal",&_Mass_a_Plcal, "Mass_a_Plcal");
+
+    _outputTree->Branch("TotalP_a", TotalP_a, "TotalP_a[4]/F");
+    _outputTree->Branch("ChP", ChP, "ChP[4]/F");
+    _outputTree->Branch("PhP", PhP, "PhP[4]/F");	//Gamma
+    _outputTree->Branch("NeP", NeP, "NeP[4]/F");
+    _outputTree->Branch("FrP", FrP, "FrP[4]/F");
+
+    _outputTree->Branch("FrPh", FrPh, "FrPh[4]/F");
+    _outputTree->Branch("FrNe", FrNe, "FrNe[4]/F");
+	
+    _outputTree->Branch("KPF", KPF, "KPF[4]/F");
+
+    _outputTree->Branch("UdP", UdP, "UdP[4]/F");
+
+    _outputTree->Branch("TotalP_p", TotalP_p, "TotalP_p[4]/F");
+    _outputTree->Branch("nCHPFO_a", &nCHPFO_a, "nCHPFO_a/I");
+    _outputTree->Branch("nCHPFO_p", &nCHPFO_p, "nCHPFO_p/I");
+    _outputTree->Branch("nNEPFO_a", &nNEPFO_a, "nNEPFO_a/I");
+    _outputTree->Branch("nNEPFO_p", &nNEPFO_p, "nNEPFO_p/I");
+    _outputTree->Branch("NeCaloE_a", NeCaloE_a, "NeCaloE_a[2]/F");
+    _outputTree->Branch("NeCaloE_p", NeCaloE_p, "NeCaloE_p[2]/F");
+    _outputTree->Branch("ElargeP", &ElargeP, "ElargeP[2]/F");
+    _outputTree->Branch("TrkSumEn", &TrkSumEn, "TrkSumEn/F");
+    _outputTree->Branch("EequP", &EequP, "EequP[2]/F");
+    _outputTree->Branch("EsmallP", &EsmallP, "EsmallP[2]/F");
+
+    _outputTree->Branch("EcalTotalE", &_EcalTotalE, "EcalTotalE/F");
+    _outputTree->Branch("EcalEn1", &_EcalEn1, "EcalEn1/F");
+    _outputTree->Branch("EcalEn2", &_EcalEn2, "EcalEn2/F");
+    _outputTree->Branch("EcalEn3", &_EcalEn3, "EcalEn3/F");
+    _outputTree->Branch("EcalEn4", &_EcalEn4, "EcalEn4/F");
+    _outputTree->Branch("EcalEn5", &_EcalEn5, "EcalEn5/F");
+    _outputTree->Branch("HcalTotalE", &_HcalTotalE, "HcalTotalE/F");
+    _outputTree->Branch("HcalEn1", &_HcalEn1, "HcalEn1/F");
+    _outputTree->Branch("HcalEn2", &_HcalEn2, "HcalEn2/F");
+    _outputTree->Branch("HcalEn3", &_HcalEn3, "HcalEn3/F");
+    _outputTree->Branch("HcalEn4", &_HcalEn4, "HcalEn4/F");
+    _outputTree->Branch("HcalEn5", &_HcalEn5, "HcalEn5/F");
+    _outputTree->Branch("EcalCluE", &_EcalCluE, "EcalCluE/F");
+    _outputTree->Branch("HcalCluE", &_HcalCluE, "HcalCluE/F");
+
+    _outputTree->Branch("EcalCluE_p", &_EcalCluE_p, "EcalCluE_p/F");
+    _outputTree->Branch("HcalCluE_p", &_HcalCluE_p, "HcalCluE_p/F");
+
+    _outputPFO = new TTree("PFO","PFO");
+    _outputPFO->Branch("EventNr", &_eventNr, "EventNr/I");
+    _outputPFO->Branch("Num", &_Num, "Num/I");
+    _outputPFO->Branch("Type", &Type, "Type/I");	// 0 == Arbor & 1 == Pandora
+    _outputPFO->Branch("Charge", &Charge, "Charge/I");
+    _outputPFO->Branch("Energy", &Energy, "Energy/F");
+    _outputPFO->Branch("P", P, "P[3]/F");
+    _outputPFO->Branch("CluEn", &CluEn, "CluEn/F");
+    _outputPFO->Branch("CluEnCom", CluEnCom, "CluEnCom[2]/F");
+
+    _outputPFO->Branch("TrackHit", &TrackHit, "TrackHit/I");
+    _outputPFO->Branch("StartPos", StartPos, "StartPos[3]/F");
+    _outputPFO->Branch("EndPos", EndPos, "EndPos[3]/F");
+
+    _Num = 0;
+
+    info() << "TotalInvMass::initializd" << endmsg;
+
+     return GaudiAlgorithm::initialize();
+
+}
+
+StatusCode TotalInvMass::execute() 
+{		
+    info() << "TotalInvMass::executing..." << endmsg;
+
+    EVENT::LCEvent* evtP = nullptr;
+
+    // if (evtP) {		
+
+    TLorentzVector ArborTotalP(0, 0, 0, 0);
+    TLorentzVector ArborChP(0, 0, 0, 0);
+    TLorentzVector ArborPhP(0, 0, 0, 0);
+    TLorentzVector ArborNeP(0, 0, 0, 0);
+    TLorentzVector ArborFrP(0, 0, 0, 0);
+    TLorentzVector ArborUdP(0, 0, 0, 0);
+    TLorentzVector ArborFrPh(0, 0, 0, 0);
+    TLorentzVector ArborFrNe(0, 0, 0, 0);
+    TLorentzVector ArborKPF(0, 0, 0, 0);
+    TLorentzVector PandoraTotalP(0, 0, 0, 0);
+    TLorentzVector ArborLCAL(0, 0, 0, 0);
+    TLorentzVector ArborISR(0, 0, 0, 0);
+    TLorentzVector PandoraISR(0, 0, 0, 0);
+
+    // TODO: using the event header
+    // _eventNr = evtP->getEventNumber();
+
+    for(int i0 = 0; i0 < 4; i0++) {
+        TotalP_a[i0] = 0;
+        TotalP_p[i0] = 0;
+        ChP[i0] = 0;
+        PhP[i0] = 0;
+        NeP[i0] = 0;
+        FrP[i0] = 0;
+        UdP[i0] = 0;
+        FrPh[i0] = 0;
+        FrNe[i0] = 0;
+        KPF[i0] = 0;
+        if(i0 < 2) {
+            NeCaloE_a[i0] = 0;
+            NeCaloE_p[i0] = 0;
+            CluEnCom[i0] = 0;
+            ElargeP[i0] = 0;
+            EequP[i0] = 0;
+            EsmallP[i0] = 0;
+        }
+        if(i0 < 3) {
+            P[i0] = 0;
+        }
+    }
+
+    nCHPFO_a = 0; 
+    nCHPFO_p = 0;
+    nNEPFO_a = 0; 
+    nNEPFO_p = 0;
+    Type = -100;
+    Charge = -100; 
+    Energy = 0;
+    CluEn = 0; 
+    TrkSumEn = 0; 
+
+    _EcalTotalE = 0; _HcalTotalE = 0; _EcalCluE = 0; _HcalCluE = 0; 
+    _EcalCluE_p = 0; _HcalCluE_p = 0;
+    _HcalEn1=0;_HcalEn2=0;_HcalEn3=0;_HcalEn4=0;_HcalEn5=0;
+    _EcalEn1=0;_EcalEn2=0;_EcalEn3=0;_EcalEn4=0;_EcalEn5=0;
+
+    _HDPID = -1; 
+    _OriQuarkID = 0; 
+    _OQDir = -10;
+    _HDir = -10;
+    _visE=0;
+
+    _J1CosTheta = -2;
+    _J2CosTheta = -2;
+
+    std::vector<CaloHitColHandler*> hdl_EcalHitColl{
+        &m_ecalbarrelhitcol,
+            &m_ecalendcaphitcol
+            };
+    std::vector<CaloHitColHandler*> hdl_HcalHitColl{
+        &m_hcalbarrelhitcol,
+            &m_hcalendcaphitcol,
+            &m_hcalotherhitcol
+            };
+
+    std::vector<std::string> EcalHitColl;
+    std::vector<std::string> HcalHitColl;
+    EcalHitColl.push_back("ECALBarrel");
+    EcalHitColl.push_back("ECALEndcap");
+    //EcalHitColl.push_back("ECALOther");
+    //EcalHitColl.push_back("LCAL");
+    //EcalHitColl.push_back("LHCAL");
+    HcalHitColl.push_back("HCALBarrel");
+    HcalHitColl.push_back("HCALEndcap");
+    HcalHitColl.push_back("HCALOther");
+
+    try{
+
+        for(int t = 0; t< int(hdl_EcalHitColl.size()); t++) {
+            const edm4hep::CalorimeterHitCollection* ecalcoll = hdl_EcalHitColl[t]->get();
+            for(auto hit: *ecalcoll) {
+                // TODO
+                int NLayer = 0;
+                _EcalTotalE += hit.getEnergy();
+
+                // UTIL::CellIDDecoder<EVENT::CalorimeterHit> idDecoder(ECALCellIDDecoder);
+                // int NLayer = idDecoder(a_hit)["K-1"];
+                //h_hit->Fill(NLayer,a_hit->getEnergy());
+                if(NLayer < 6) {
+                    _EcalEn1 += hit.getEnergy();
+                } else if(NLayer < 12) {
+                    _EcalEn2 += hit.getEnergy();
+                } else if(NLayer < 18) {
+                    _EcalEn3 += hit.getEnergy();
+                } else if(NLayer < 24) {
+                    _EcalEn4 += hit.getEnergy();
+                } else{
+                    _EcalEn5 += hit.getEnergy();
+                }
+            }
+        }
+
+        for(int t2 = 0; t2< int(hdl_HcalHitColl.size()); t2++) {
+            const edm4hep::CalorimeterHitCollection* hcalcoll = hdl_HcalHitColl[t2]->get();
+            for (auto hit: *hcalcoll) {
+                // TODO
+                int NLayer = 0;
+                int HLayer = NLayer+30;
+                // UTIL::CellIDDecoder<EVENT::CalorimeterHit> idDecoder(ECALCellIDDecoder);
+                // int NLayer = idDecoder(a_hit)["K-1"];
+
+                //h_hit->Fill(HLayer,a_hit->getEnergy());
+                _HcalTotalE += hit.getEnergy();
+                if(NLayer < 10) {
+                    _HcalEn1 += hit.getEnergy();
+                } else if(NLayer < 20) {
+                    _HcalEn2 += hit.getEnergy();
+                } else if(NLayer < 30) {
+                    _HcalEn3 += hit.getEnergy();
+                } else if(NLayer < 40) {
+                    _HcalEn4 += hit.getEnergy();
+                } else {
+                    _HcalEn5 += hit.getEnergy();
+                }
+            }
+        }
+
+
+    }catch(lcio::DataNotAvailableException err) { }
+
+    try{
+        auto MCPCol = m_mcParticle.get();
+
+        TVector3 tmpP; 
+        TVector3 ISRP(0, 0, 0);
+        _N3En = 0;
+        _N3Pt = 0;
+ 
+        int NNeutrinoCount = 0; 
+
+        for (int s0 = 0; s0 < MCPCol->size(); ++s0) {
+            auto MCP = (*MCPCol)[s0];
+            int tmpPID = MCP.getPDG();
+            int NParent = MCP.parents_size();
+            int NDaughter = MCP.daughters_size();
+            auto VTX0 = MCP.getVertex();
+            auto EndP0 = MCP.getEndpoint();
+            TVector3 VTX(VTX0.x, VTX0.y, VTX0.z);
+            TVector3 EndP(EndP0.x, EndP0.y, EndP0.z);
+
+            if(tmpPID == 22 && NParent == 0 && s0 < 4) {
+                auto tmpP0 = MCP.getMomentum();
+                tmpP = TVector3(tmpP0.x, tmpP0.y, tmpP0.z);
+                ISRP += tmpP; 
+            }
+
+            if( (abs(tmpPID) == 12 || abs(tmpPID) == 14 || abs(tmpPID) == 16) && NParent != 0 && NDaughter == 0 && VTX.Mag() < 100 && EndP.Mag() > 100) {
+                _NEn += tmpP.Mag();
+                _NPt += tmpP.Perp();
+                NNeutrinoCount++;
+                if(NNeutrinoCount > 2) {
+                    auto tmpP0 = MCP.getMomentum();
+                    tmpP = TVector3(tmpP0.x, tmpP0.y, tmpP0.z);
+                    _N3En += tmpP.Mag();
+                    _N3Pt += tmpP.Perp();
+                    cout<<"Found Neutrino: "<<NNeutrinoCount<<" En "<<_N3En<<" Pt "<<_N3Pt<<endl;
+                }
+            }
+
+            if(tmpPID == 25 && NDaughter > 1 && NParent !=0 ) { //Higgs
+                // cout<<"tmpPID:HDPID"<<tmpPID<<" "<<NDaughter<<" "<<NParent<<endl;
+                _HDPID = abs(MCP.getDaughters(0).getPDG());
+                _HDir = MCP.getMomentum()[2]/MCP.getEnergy();
+
+                if(NDaughter == 2) {
+                    auto D1 = MCP.getDaughters(0);
+                    _J1CosTheta = D1.getMomentum()[2]/D1.getEnergy();
+                    auto D2 = MCP.getDaughters(1);
+                    _J2CosTheta = D2.getMomentum()[2]/D2.getEnergy();
+                }
+            }
+            if(abs(tmpPID)<7 && NParent == 0) {
+                if(tmpPID>0)
+                    _OriJ1CosTheta =MCP.getMomentum()[2]/MCP.getEnergy();
+                else
+                    _OriJ2CosTheta = MCP.getMomentum()[2]/MCP.getEnergy();
+            }
+
+            if(abs(tmpPID)<7 && NParent == 0) {
+                _OriQuarkID = abs(tmpPID); 
+                _OQDir = MCP.getMomentum()[2]/MCP.getEnergy();
+            }	
+
+
+            if(abs(_J1CosTheta) > abs(_J2CosTheta))
+                _MaxJetCosTheta = _J1CosTheta;
+            else
+                _MaxJetCosTheta = _J2CosTheta;
+
+            if(abs(_OriJ1CosTheta) > abs(_OriJ2CosTheta))
+                _MaxOriJetCosTheta = _OriJ1CosTheta;
+            else
+                _MaxOriJetCosTheta = _OriJ2CosTheta;
+
+            if( (fabs(VTX.Z()) < 1000 && fabs(VTX.Perp()) < 1600 ) && ( fabs(EndP.Z()) > 2000 || fabs(EndP.Perp()) > 1600  )&&abs(tmpPID)!=12&&abs(tmpPID)!=14&&abs(tmpPID)!=16 ){
+                _visE+=MCP.getEnergy();
+            }
+        }
+
+        _ISRPt = ISRP.Perp();
+        _ISREn = ISRP.Mag();
+        _ISRP[0] = ISRP.X();
+        _ISRP[1] = ISRP.Y();
+        _ISRP[2] = ISRP.Z();
+
+    }catch(lcio::DataNotAvailableException err) { }
+
+    try{
+        auto col_RecoNeP = m_reconep.get();
+        for(int i0 = 0; i0 < col_RecoNeP->size(); i0++) {
+            auto a_RecoP = (*col_RecoNeP)[i0];
+            TLorentzVector currP( a_RecoP.getMomentum()[0], a_RecoP.getMomentum()[1], a_RecoP.getMomentum()[2], a_RecoP.getEnergy());
+            ArborTotalP += currP;
+            auto currMom0 = a_RecoP.getMomentum();
+            TVector3 currMom(currMom0.x, currMom0.y, currMom0.z);
+            //				if(a_RecoP->getType() == 22 && a_RecoP->getEnergy() > 2)	//Compensate...
+            //					ArborTotalP += 0.98*currP;
+            //				else 
+            //					ArborTotalP += currP;
+
+            if(a_RecoP.getCharge() != 0) {
+                ArborChP += currP;
+            } else if(a_RecoP.getType() == 310) {
+                ArborKPF += currP; 
+            } else if(a_RecoP.getType() == 22) {
+                if(a_RecoP.getEnergy() < 3.0)
+                    ArborFrPh += currP;
+                else
+                    ArborPhP += currP;
+            } else if(a_RecoP.getType() == 2112) {
+                if(a_RecoP.getEnergy() < 3.0)
+                    ArborFrNe += currP;
+                else
+                    ArborNeP += currP;
+            } else if(a_RecoP.getEnergy() < 3.0) {
+                ArborFrP += currP;
+                cout<<"Undef "<<a_RecoP.getType()<<endl;  
+            } else {
+                ArborUdP += currP;
+                cout<<"Undef "<<a_RecoP.getType() << "En "<<a_RecoP.getEnergy()<<endl;
+            }
+
+            if(a_RecoP.clusters_size() > 0) {
+                auto a_clu = a_RecoP.getClusters(0);
+                auto CluPos0 = a_clu.getPosition();
+                TVector3 CluPos(CluPos0.x, CluPos0.y, CluPos0.z);
+                if( CluPos.Perp() < 300 && abs(CluPos.Z()) < 1300 && a_RecoP.getCharge() == 0 )	// 1150-1300
+                    ArborLCAL += currP; 
+
+                float MinAngleToCH = 1.0E6;
+                float MinAngleToNE = 1.0E6;  
+
+                if(a_RecoP.getEnergy() > 5 && a_RecoP.getCharge() == 0) {
+                    for(int i1 = 0; i1 < col_RecoNeP->size(); i1++) {
+                        if(i1 != i0) {
+                            auto b_RecoP = (*col_RecoNeP)[i1];
+                            auto tmpMom0 = b_RecoP.getMomentum();
+                            TVector3 tmpMom(tmpMom0.x, tmpMom0.y, tmpMom0.z);
+                            float tmpAngle = currMom.Angle(tmpMom);
+                            if( b_RecoP.getEnergy() > 3.0 ) {
+                                if(b_RecoP.getCharge() != 0) {
+                                    if(tmpAngle < MinAngleToCH) {
+                                        MinAngleToCH = tmpAngle;
+                                    }
+                                } else {	
+                                    if(tmpAngle < MinAngleToNE) {
+                                        MinAngleToNE = tmpAngle;
+                                    }
+                                }
+                            }
+                        }
+                    }
+
+                    if( MinAngleToNE > 0.5 || MinAngleToCH > 0.5 ) {
+                        ArborISR += currP; 
+                    }
+                }
+            }
+
+            TrackHit = 0; 
+            for(int k = 0; k < 3; k++) {
+                StartPos[k] = 0;
+                EndPos[k] = 0;
+            }		
+
+            Charge = int(a_RecoP.getCharge());
+            CluEn = 0; 
+            CluEnCom[0] = 0;
+            CluEnCom[1] = 0;
+
+            if(Charge) {
+                Type = 1;
+                nCHPFO_a ++;
+            } else {
+                Type = 0;
+                nNEPFO_a ++;
+            }
+
+            Energy = a_RecoP.getEnergy();
+            P[0] = a_RecoP.getMomentum()[0];
+            P[1] = a_RecoP.getMomentum()[1];
+            P[2] = a_RecoP.getMomentum()[2];
+
+            if(a_RecoP.clusters_size() > 0) {
+
+                auto currClu = a_RecoP.getClusters(0);
+                CluEn = currClu.getEnergy();
+
+                if((!Charge) and (currClu.subdetectorEnergies_size() > 2)) {
+                    CluEnCom[0] = currClu.getSubdetectorEnergies(0);
+                    CluEnCom[1] = currClu.getSubdetectorEnergies(1);	
+                    NeCaloE_a[0] += currClu.getSubdetectorEnergies(0);
+                    NeCaloE_a[1] += currClu.getSubdetectorEnergies(1);
+                }
+
+                if (currClu.subdetectorEnergies_size() > 2) {
+                    _EcalCluE += currClu.getSubdetectorEnergies(0);
+                    _HcalCluE += currClu.getSubdetectorEnergies(1);
+                }
+
+
+                if(Charge) {
+                    TrkSumEn += Energy; 
+
+                    if (a_RecoP.tracks_size()>0) {
+                        auto a_Trk = a_RecoP.getTracks(0);
+                        TrackHit = a_Trk.trackerHits_size();
+
+                        if (TrackHit>2) {
+                            StartPos[0] = (a_Trk.getTrackerHits(0)).getPosition()[0];
+                            StartPos[1] = (a_Trk.getTrackerHits(0)).getPosition()[1];
+                            StartPos[2] = (a_Trk.getTrackerHits(0)).getPosition()[2];
+
+                            EndPos[0] = (a_Trk.getTrackerHits(TrackHit - 1)).getPosition()[0];
+                            EndPos[1] = (a_Trk.getTrackerHits(TrackHit - 1)).getPosition()[1];
+                            EndPos[2] = (a_Trk.getTrackerHits(TrackHit - 1)).getPosition()[2];	
+                        }
+                    }
+
+                    if( Energy > CluEn + sqrt(Energy)) {
+                        ElargeP[0] += Energy; 
+                        ElargeP[1] += CluEn; 
+                    } else if( fabs(Energy - CluEn) < sqrt(Energy) ) {
+                        EequP[0] += Energy;
+                        EequP[1] += CluEn; 
+                    } else {
+                        EsmallP[0] += Energy;
+                        EsmallP[1] += CluEn; 
+                    }
+
+                }
+            }
+
+            _outputPFO->Fill();
+
+        }
+    }catch (lcio::DataNotAvailableException err) { }
+
+    try{
+        //LCCollection* col_RecoPandora = evtP->getCollection( "PandoraPFOs" );			
+        //for(int i2 = 0; i2 < col_RecoPandora->getNumberOfElements(); i2++)
+        for(int s = 0; s < 1; s++) {
+            auto col_PFO_iter = m_arbopfo.get();
+            /* 
+               if(s==0)
+               col_PFO_iter = evtP->getCollection( "ArborChargedCore" );
+               else
+               col_PFO_iter = evtP->getCollection( "ArborNeutralCore" );	
+            */
+
+            for(int i2 = 0; i2 < col_PFO_iter->size(); i2++) {         
+                auto a_RecoP = (*col_PFO_iter)[i2];
+                TLorentzVector currP( a_RecoP.getMomentum()[0], a_RecoP.getMomentum()[1], a_RecoP.getMomentum()[2], a_RecoP.getEnergy());
+                PandoraTotalP += currP;
+
+                if(a_RecoP.getCharge()) {
+                    nCHPFO_p++;
+                } else {
+                    nNEPFO_p++;
+                }
+                        
+                auto currMom0 = a_RecoP.getMomentum();
+                TVector3 currMom(currMom0.x, currMom0.y, currMom0.z);
+
+                if(a_RecoP.clusters_size() > 0) {
+
+                    float MinAngleToCH = 1.0E6;
+                    float MinAngleToNE = 1.0E6;
+
+                    auto currClu = a_RecoP.getClusters(0);
+                    CluEn = currClu.getEnergy();
+
+                    _EcalCluE_p += CluEn;	
+                    _HcalCluE_p += currClu.getSubdetectorEnergies(1);
+
+                    if(a_RecoP.getEnergy() > 5 && a_RecoP.getCharge() == 0) {
+                        for(int i3 = 0; i3 < col_PFO_iter->size(); i3++) {
+                            if(i3 != i2) {
+                                auto b_RecoP = (*col_PFO_iter)[i3];
+                                auto tmpMom0 = b_RecoP.getMomentum();
+                                TVector3 tmpMom(tmpMom0.x, tmpMom0.y, tmpMom0.z);
+                                float tmpAngle = currMom.Angle(tmpMom);
+                                if( b_RecoP.getEnergy() > 3.0 ) {
+                                    if(b_RecoP.getCharge() != 0) {
+                                        if(tmpAngle < MinAngleToCH) {
+                                            MinAngleToCH = tmpAngle;
+                                        }
+                                    } else {
+                                        if(tmpAngle < MinAngleToNE) {
+                                            MinAngleToNE = tmpAngle;
+                                        }
+                                    }
+                                }
+                            }
+                        }
+
+                        if( MinAngleToNE > 0.5 || MinAngleToCH > 0.5 ) {
+                            PandoraISR += currP;
+                        }
+                    }
+                }
+            }
+        }
+    }catch (lcio::DataNotAvailableException err) { }
+
+    _Mass_a = 0; 
+    _Mass_p = 0; 
+    _Mass_a_Pisr = 0;
+    _Mass_a_Plcal = 0; 
+    _Mass_p_Pisr = 0; 
+
+    _Mass_a = ArborTotalP.M();
+    _Mass_p = PandoraTotalP.M();
+
+    _Mass_a_Pisr = (ArborTotalP - ArborISR).M();
+    _Mass_a_Plcal = (ArborTotalP - ArborLCAL).M();
+    _Mass_p_Pisr = (PandoraTotalP - PandoraISR).M();
+
+    TotalP_a[0] = ArborTotalP.X();
+    TotalP_a[1] = ArborTotalP.Y();
+    TotalP_a[2] = ArborTotalP.Z();
+    TotalP_a[3] = ArborTotalP.T();
+
+    TotalP_p[0] = PandoraTotalP.X();
+    TotalP_p[1] = PandoraTotalP.Y();
+    TotalP_p[2] = PandoraTotalP.Z();
+    TotalP_p[3] = PandoraTotalP.T();
+
+    ChP[0] = ArborChP.X();
+    ChP[1] = ArborChP.Y();
+    ChP[2] = ArborChP.Z();
+    ChP[3] = ArborChP.T();
+
+    PhP[0] = ArborPhP.X();
+    PhP[1] = ArborPhP.Y();
+    PhP[2] = ArborPhP.Z();
+    PhP[3] = ArborPhP.T();	
+
+    NeP[0] = ArborNeP.X();
+    NeP[1] = ArborNeP.Y();
+    NeP[2] = ArborNeP.Z();
+    NeP[3] = ArborNeP.T();
+
+    FrP[0] = ArborFrP.X();
+    FrP[1] = ArborFrP.Y();
+    FrP[2] = ArborFrP.Z();
+    FrP[3] = ArborFrP.T();
+
+    UdP[0] = ArborUdP.X();
+    UdP[1] = ArborUdP.Y();
+    UdP[2] = ArborUdP.Z();
+    UdP[3] = ArborUdP.T();
+
+    FrPh[0] = ArborFrPh.X();
+    FrPh[1] = ArborFrPh.Y();
+    FrPh[2] = ArborFrPh.Z();
+    FrPh[3] = ArborFrPh.T();
+
+    FrNe[0] = ArborFrNe.X();
+    FrNe[1] = ArborFrNe.Y();
+    FrNe[2] = ArborFrNe.Z();
+    FrNe[3] = ArborFrNe.T();
+
+    KPF[0] = ArborKPF.X();
+    KPF[1] = ArborKPF.Y();
+    KPF[2] = ArborKPF.Z();
+    KPF[3] = ArborKPF.T();
+
+    cout<<_Mass_a<<" : "<<_Mass_p<<endl;		
+
+    _outputTree->Fill();
+    _Num++;
+    // }  	  
+
+
+    info() << "TotalInvMass::execute done" << endmsg;
+
+    return StatusCode::SUCCESS;
+
+}	
+
+StatusCode TotalInvMass::finalize()
+{
+
+    if (_outputTree) {
+
+        TFile *tree_file = _outputTree->GetCurrentFile(); //just in case we switched to a new file
+        tree_file->Write();
+        delete tree_file;
+    }
+
+    return GaudiAlgorithm::finalize();
+}
+
+
+
diff --git a/Analysis/TotalInvMass/src/TotalInvMass.hh b/Analysis/TotalInvMass/src/TotalInvMass.hh
new file mode 100644
index 0000000000000000000000000000000000000000..98a36eeacf870e3728475947e7fb3811ed037cc4
--- /dev/null
+++ b/Analysis/TotalInvMass/src/TotalInvMass.hh
@@ -0,0 +1,125 @@
+#ifndef _TotalInvMass_hh_
+#define _TotalInvMass_hh_
+
+#include "GaudiAlg/GaudiAlgorithm.h"
+#include "GaudiKernel/Property.h"
+
+#include "k4FWCore/DataHandle.h"
+
+#include <string>
+#include <iostream>
+#include <fstream>
+#include <TNtuple.h>
+#include <TObject.h>
+#include <TTree.h>
+#include <TFile.h>
+
+#include "edm4hep/MCParticleCollection.h"
+#include "edm4hep/CalorimeterHitCollection.h"
+#include "edm4hep/ReconstructedParticleCollection.h"
+
+class TotalInvMass  : public GaudiAlgorithm
+{
+public:
+
+    TotalInvMass(const std::string& name, ISvcLocator* svcLoc);
+
+    ~TotalInvMass() {};
+
+    StatusCode initialize() override;
+
+    StatusCode execute() override;
+
+    StatusCode finalize() override;
+
+protected:
+    typedef DataHandle<edm4hep::MCParticleCollection> MCParticleColHandler;
+    MCParticleColHandler m_mcParticle{"MCParticle", Gaudi::DataHandle::Reader, this};
+
+    typedef DataHandle<edm4hep::CalorimeterHitCollection> CaloHitColHandler;
+    CaloHitColHandler m_ecalbarrelhitcol{"ECALBarrel", Gaudi::DataHandle::Reader, this};
+    CaloHitColHandler m_ecalendcaphitcol{"ECALEndcap", Gaudi::DataHandle::Reader, this};
+
+    CaloHitColHandler m_hcalbarrelhitcol{"HCALBarrel", Gaudi::DataHandle::Reader, this};
+    CaloHitColHandler m_hcalendcaphitcol{"HCALEndcap", Gaudi::DataHandle::Reader, this};
+    CaloHitColHandler m_hcalotherhitcol {"HCALOther", Gaudi::DataHandle::Reader, this};
+
+    typedef DataHandle<edm4hep::ReconstructedParticleCollection> RecParticleColHandler;
+    RecParticleColHandler m_reconep{"AncientPFOs", Gaudi::DataHandle::Reader, this};
+    RecParticleColHandler m_arbopfo{"ArborLICHPFOs", Gaudi::DataHandle::Reader, this};
+
+    Gaudi::Property<std::string> _treeFileName{this,
+            "TreeOutputFile", "MCTruth.root",
+            "The name of the file to which the ROOT tree will be written"};
+    Gaudi::Property<std::string> _treeName{this,
+            "TreeName", "MCPart",
+            "The name of the ROOT tree"};
+    std::string _colName;
+    std::string _colAdcVals;
+
+    Gaudi::Property<int> _overwrite{this,
+            "OverwriteFile", 0,
+            "If zero an already existing file will not be overwritten."};
+    int _leptonID;
+    float _cmsE; 
+    TTree *_outputTree, *_outputPFO;
+    float _ISRP[3];
+    float _ISREn, _ISRPt; 
+    float _N3En, _N3Pt; 
+    float _NEn, _NPt; 
+
+    int _HDPID, _OriQuarkID; 
+    float _OQDir, _HDir;
+    int _NMuP, _NMuM, _NChP, _NChM;
+    float _P_MuP[4], _P_MuM[4], _P_DL[4];
+    int _EventType; 
+    float _InvMass, _RecoilMass; 
+    float _J1CosTheta, _J2CosTheta, _MaxJetCosTheta; 
+    float _OriJ1CosTheta, _OriJ2CosTheta, _MaxOriJetCosTheta; 
+    float _Mass_a, _Mass_p; 
+
+    int _PID1, _PID2;
+    float _PL1[4], _PL2[4], _RPL1[4], _RPL2[4], _SM[4], _P_allCharged[4], _P_allNeutral[4], _P_Higgs[4], _P_allReco[4];
+    float _Hmass; 
+    int _Num;
+    int _NHDaug; 
+    int _HdaughterPID; 
+    int _ZdaughterPID; 
+    float _Pz[4], _Ph[4], _PzD1[4], _PzD2[4], _PhD1[4], _PhD2[4], _RPzD1[4], _RPzD2[4], _RPhD1[4], _RPhD2[4];
+    float _P[4], _SumP[4], _VisP[4], _MissP[4];
+    int _PID, _NFMCP, _MotherFlag, _NNeutrino; 
+    float _ENeutrino, _DiPhMass, _DiPhMassCorr; 
+    //		float _CosTheta, _Phi, _Charge;
+    float _Mz, _Mrecoil, _MzReco, _MhReco, _MrecoilReco; 
+    float KthEn[7][9];
+    unsigned int _eventNr;
+
+    float _Mass_p_Pisr, _Mass_a_Pisr, _Mass_a_Plcal;
+
+    float TotalP_a[4], TotalP_p[4];
+    int nCHPFO_a, nCHPFO_p, nNEPFO_a, nNEPFO_p;
+    float NeCaloE_a[2], NeCaloE_p[2];
+    float ElargeP[2], EequP[2], EsmallP[2];
+
+    float ChP[4], FrP[4], PhP[4], NeP[4], UdP[4], FrPh[4], FrNe[4], KPF[4];
+    float _EcalTotalE, _HcalTotalE, _EcalCluE, _HcalCluE, _EcalCluE_p, _HcalCluE_p; 
+    float _HcalEn1, _HcalEn2,_HcalEn3,_HcalEn4,_HcalEn5;
+    float _EcalEn1, _EcalEn2,_EcalEn3,_EcalEn4,_EcalEn5;
+
+    int Type, Charge;
+    float Energy, TrkSumEn; 
+    float P[3], CluEnCom[2];
+    float CluEn;
+
+    int TrackHit;
+    float StartPos[3], EndPos[3];
+    float _visE;
+
+    std::string _fileName;
+    std::ostream *_output;
+    std::string _histFileName;
+};
+
+#endif
+
+
diff --git a/Detector/DetCEPCv4/CMakeLists.txt b/Detector/DetCEPCv4/CMakeLists.txt
index e969df42e033b2bff74f08dd13c729fb0eec31f9..69bcc73e14484665c6ec628ae20e3fce63c765f3 100644
--- a/Detector/DetCEPCv4/CMakeLists.txt
+++ b/Detector/DetCEPCv4/CMakeLists.txt
@@ -32,6 +32,9 @@ set(DetCEPCv4_src
     src/calorimeter/SEcal05_Barrel.cpp
     src/calorimeter/SEcal05_Endcaps.cpp
     src/calorimeter/SEcal05_ECRing.cpp
+    src/calorimeter/SHcalRpc01_Barrel.cpp
+    src/calorimeter/SHcalRpc01_Endcaps.cpp
+    src/calorimeter/SHcalRpc01_EndcapRing.cpp
     src/other/BoxSupport_o1_v01_geo.cpp
     src/other/TubeSupport_o1_v01_geo.cpp
 )
diff --git a/Detector/DetCEPCv4/compact/Beampipe_o1_v01_01.xml b/Detector/DetCEPCv4/compact/Beampipe_o1_v01_01.xml
index 4b6d0ef0a0b00d7d66b9ecd0ade581b486def75d..a7ce385d21fae40fed2481ed1e541f7123c2d59f 100644
--- a/Detector/DetCEPCv4/compact/Beampipe_o1_v01_01.xml
+++ b/Detector/DetCEPCv4/compact/Beampipe_o1_v01_01.xml
@@ -103,17 +103,17 @@
            rMax1="TUBE_incoming_beamcalToQD0_InnerRadius+TUBE_upstream_thickness"  rMax2="TUBE_incoming_QD0andBeyond_InnerRadius+TUBE_upstream_thickness"
            material="stainless_steel" name="BeamCalToQD0UpstreamTrans" />
 
-  <section type ="Upstream"
+  <!--section type ="Upstream"
            start="TUBE_QD0_Lstar"                    end="TUBE_QD0_Lstar+TUBE_QD0_length"
            rMin1="TUBE_incoming_QD0andBeyond_InnerRadius"          rMin2="TUBE_incoming_QD0andBeyond_InnerRadius"
            rMax1="TUBE_incoming_QD0andBeyond_InnerRadius+20*mm"    rMax2="TUBE_incoming_QD0andBeyond_InnerRadius+20*mm"
-           material="stainless_steel" name="QD0CryoUpstream" />
+           material="stainless_steel" name="QD0CryoUpstream" /-->
 
-  <section type ="Upstream"
+  <!--section type ="Upstream"
            start="TUBE_QD0_Lstar+TUBE_QD0_length"    end="10*m"
            rMin1="TUBE_incoming_QD0andBeyond_InnerRadius"          rMin2="TUBE_incoming_QD0andBeyond_InnerRadius"
            rMax1="TUBE_incoming_QD0andBeyond_InnerRadius+TUBE_upstream_thickness"    rMax2="TUBE_incoming_QD0andBeyond_InnerRadius+TUBE_upstream_thickness"
-           material="stainless_steel" name="BeyondQD0Upstream" />
+           material="stainless_steel" name="BeyondQD0Upstream" /-->
 
 
 
@@ -137,17 +137,17 @@
            rMax1="TUBE_outgoing_beamcalToQD0_InnerRadius+TUBE_upstream_thickness"  rMax2="TUBE_outgoing_beamcalToQD0_InnerRadius+TUBE_upstream_thickness"
            material="stainless_steel" name="BeamCalToQDEX1ADnstream" />
 
-  <section type ="Dnstream"
+  <!--section type ="Dnstream"
            start="TUBE_QDEX1A_Lstar"                    end="TUBE_QD0_Lstar+TUBE_QD0_cryostat_length"
            rMin1="TUBE_outgoing_QD0andBeyond_InnerRadius"          rMin2="TUBE_outgoing_QD0andBeyond_InnerRadius"
            rMax1="TUBE_outgoing_QD0andBeyond_InnerRadius+20*mm"    rMax2="TUBE_outgoing_QD0andBeyond_InnerRadius+20*mm"
-           material="stainless_steel" name="QDEX1A" />
+           material="stainless_steel" name="QDEX1A" /-->
 
-  <section type ="Dnstream"
+  <!--section type ="Dnstream"
            start="TUBE_QD0_Lstar+TUBE_QD0_cryostat_length"         end="10*m"
            rMin1="TUBE_outgoing_QD0andBeyond_InnerRadius"          rMin2="TUBE_outgoing_QD0andBeyond_InnerRadius"
            rMax1="TUBE_outgoing_QD0andBeyond_InnerRadius+TUBE_upstream_thickness"    rMax2="TUBE_outgoing_QD0andBeyond_InnerRadius+TUBE_upstream_thickness"
-           material="stainless_steel" name="BeyondQD0Dnstream" />
+           material="stainless_steel" name="BeyondQD0Dnstream" /-->
 
 </detector>
 
diff --git a/Detector/DetCEPCv4/compact/CepC_v4-onlyTracker.xml b/Detector/DetCEPCv4/compact/CepC_v4-onlyTracker.xml
index 586e4a1f3a3acd99861ee9127b981d8091ca43fb..7610072d6cd18984b431d1d0837a4e34f65b92a1 100644
--- a/Detector/DetCEPCv4/compact/CepC_v4-onlyTracker.xml
+++ b/Detector/DetCEPCv4/compact/CepC_v4-onlyTracker.xml
@@ -75,12 +75,13 @@
   <include ref="Field_AntiDID_Map_s.xml"/>
   <include ref="Field_FwdMagnets_Ideal_1000GeV.xml"/-->
 
-
   <fields>
-
-    <field name="MagnetFields_Constant" type="ConstantField" field="magnetic">
-      <strength x="0" y="0" z="3.0*tesla"/>
+    <field name="GlobalSolenoid" type="solenoid"
+           inner_field="Field_nominal_value"
+           outer_field="outerField_nominal_value"
+           zmax="TPC_Ecal_Hcal_barrel_halfZ + Coil_extra_size"
+           outer_radius="Hcal_outer_radius + Coil_thickness/2">
     </field>
-
   </fields>
+
 </lccdd>
diff --git a/Detector/DetCEPCv4/compact/CepC_v4-onlyTrackerECAL.xml b/Detector/DetCEPCv4/compact/CepC_v4-onlyTrackerECAL.xml
new file mode 100644
index 0000000000000000000000000000000000000000..8978202b9380aadbc7e602a40e9a40ac36eefd41
--- /dev/null
+++ b/Detector/DetCEPCv4/compact/CepC_v4-onlyTrackerECAL.xml
@@ -0,0 +1,86 @@
+<lccdd xmlns:compact="http://www.lcsim.org/schemas/compact/1.0"
+       xmlns:xs="http://www.w3.org/2001/XMLSchema"
+       xs:noNamespaceSchemaLocation="http://www.lcsim.org/schemas/compact/1.0/compact.xsd">
+  <info name="CepC_v04"
+        title="CepC detctor used for the optimisation"
+        author="C.D.Fu"
+        url="http://cepc.ihep.ac.cn"
+        status="experimental"
+        version="v04">
+    <comment>CepC detector simulation models used for detector optimisation </comment>
+  </info>
+  <includes>
+    <gdmlFile  ref="elements.xml"/>
+    <gdmlFile  ref="materials.xml"/>
+  </includes>
+  <define>
+    <include ref="top_defs_CepC_v04.xml"/>
+    <include ref="top_defs.xml"/>
+    <include ref="basic_defs.xml"/>
+    <include ref="envelope_defs.xml"/>
+    <include ref="tube_defs.xml"/>
+    <include ref="misc_defs.xml"/>
+    <include ref="tracker_defs.xml"/>
+    <include ref="fcal_defs.xml"/>
+    <include ref="ecal_defs.xml"/>
+    <include ref="hcal_defs.xml"/>
+    <include ref="yoke_defs.xml"/>
+    <include ref="services_defs.xml"/>
+    <include ref="detector_types.xml"/>
+    <include ref="limits.xml"/>
+    <!-- Readout slice in ecal for reconstruction -->
+    <constant name="Ecal_readout_segmentation_slice0" value="4"/>
+    <constant name="Ecal_readout_segmentation_slice1" value="10"/>
+    <!-- Readout slice in hcal for reconstruction -->
+    <constant name="Hcal_readout_segmentation_slice" value="3"/>
+  </define>
+  <limits>
+    <limitset name="cal_limits">
+      <limit name="step_length_max" particles="*" value="cal_steplimit_val" unit="cal_steplimit_unit" />
+    </limitset>
+    <limitset name="TPC_limits">
+      <limit name="step_length_max" particles="*" value="tpc_steplimit_val" unit="tpc_steplimit_unit" />
+    </limitset>
+    <limitset name="Tracker_limits">
+      <limit name="step_length_max" particles="*" value="tracker_steplimit_val" unit="tracker_steplimit_unit" />
+    </limitset>
+  </limits>
+  <include ref="display.xml"/>
+  <include ref="Beampipe_o1_v01_01.xml"/>
+  <include ref="vxd07.xml"/>
+  <include ref="ftd_cepc.xml"/>
+  <include ref="sit_simple_planar_sensors_01.xml"/>
+  <include ref="tpc10_01.xml"/>
+  <include ref="set_simple_planar_sensors_01.xml"/>
+  <include ref="SEcal05_siw_Barrel.xml"/>
+  <include ref="SEcal05_siw_Endcaps.xml"/>
+  <include ref="SEcal05_siw_ECRing.xml"/>
+  <!--include ref="Hcal_Barrel_SD_v01.xml"/>
+  <include ref="Hcal_Endcaps_SD_v01.xml"/>
+  <include ref="Hcal_EndcapRing_SD_v01.xml"/>
+  <include ref="Yoke05_Barrel.xml"/>
+  <include ref="Yoke05_Endcaps.xml"/>
+  <include ref="LumiCal.xml"/-->
+
+  <!--include ref="LHCal01.xml"/>
+  <include ref="BeamCal08.xml"/-->
+
+  <!--include ref="coil03.xml"/-->
+  <!--include ref="SServices00.xml"/-->
+  <plugins>
+    <plugin name="DD4hepVolumeManager"/>
+    <plugin name="InstallSurfaceManager"/>
+  </plugins>
+  <!--include ref="Field_Solenoid_Map_s_4.0T.xml"/>
+  <include ref="Field_AntiDID_Map_s.xml"/>
+  <include ref="Field_FwdMagnets_Ideal_1000GeV.xml"/-->
+
+
+  <fields>
+
+    <field name="MagnetFields_Constant" type="ConstantField" field="magnetic">
+      <strength x="0" y="0" z="3.0*tesla"/>
+    </field>
+
+  </fields>
+</lccdd>
diff --git a/Detector/DetCEPCv4/compact/CepC_v4.xml b/Detector/DetCEPCv4/compact/CepC_v4.xml
index 393a40e9002e23cdfb6975e88e1117b53441becb..356e5bea0f1a29bc3112ebbc44e6232e5165351d 100644
--- a/Detector/DetCEPCv4/compact/CepC_v4.xml
+++ b/Detector/DetCEPCv4/compact/CepC_v4.xml
@@ -34,6 +34,15 @@
     <!-- Readout slice in hcal for reconstruction -->
     <constant name="Hcal_readout_segmentation_slice" value="3"/>
   </define>
+  <materials>
+    <material name="RPC2ECRMix" state="solid">
+      <D unit="g/cm3" value="Hcal_mix_density"/>
+      <composite n="Hcal_airgap_fraction" ref="Air"/>
+      <composite n="Hcal_graphite_fraction" ref="graphite"/>
+      <composite n="Hcal_mylar_fraction" ref="mylar"/>
+      <composite n="Hcal_g10_fraction" ref="g10"/>
+    </material>
+  </materials>
   <limits>
     <limitset name="cal_limits">
       <limit name="step_length_max" particles="*" value="cal_steplimit_val" unit="cal_steplimit_unit" />
@@ -47,18 +56,18 @@
   </limits>
   <include ref="display.xml"/>
   <include ref="Beampipe_o1_v01_01.xml"/>
-  <!--include ref="vxd07.xml"/>
-  <include ref="ftd_simple_staggered_02.xml"/>
-  <include ref="sit_simple_pixel_sensors_01.xml"/>
+  <include ref="vxd07.xml"/>
+  <include ref="ftd_cepc.xml"/>
+  <include ref="sit_simple_planar_sensors_01.xml"/>
   <include ref="tpc10_01.xml"/>
-  <include ref="set_simple_planar_sensors_01.xml"/-->
+  <include ref="set_simple_planar_sensors_01.xml"/>
   <include ref="SEcal05_siw_Barrel.xml"/>
   <include ref="SEcal05_siw_Endcaps.xml"/>
   <include ref="SEcal05_siw_ECRing.xml"/>
-  <!--include ref="Hcal_Barrel_SD_v01.xml"/>
-  <include ref="Hcal_Endcaps_SD_v01.xml"/>
-  <include ref="Hcal_EndcapRing_SD_v01.xml"/>
-  <include ref="Yoke05_Barrel.xml"/>
+  <include ref="SHcalRpc01_Barrel_01.xml"/>
+  <include ref="SHcalRpc01_Endcaps_01.xml"/>
+  <include ref="SHcalRpc01_EndcapRing_01.xml"/>
+  <!--include ref="Yoke05_Barrel.xml"/>
   <include ref="Yoke05_Endcaps.xml"/>
   <include ref="LumiCal.xml"/-->
 
diff --git a/Detector/DetCEPCv4/compact/Hcal_Barrel_SD_v01.xml b/Detector/DetCEPCv4/compact/Hcal_Barrel_SD_v01.xml
deleted file mode 100644
index bfee3f1b9cea39cc91b3e3938af66e2f45344d65..0000000000000000000000000000000000000000
--- a/Detector/DetCEPCv4/compact/Hcal_Barrel_SD_v01.xml
+++ /dev/null
@@ -1,47 +0,0 @@
-<lccdd>
-
-  <detectors>
-    <detector name="HcalBarrel" type="Hcal_Barrel_SD_v01" id="ILDDetID_HCAL" readout="HCalBarrelRPCHits" vis="GreenVis" insideTrackingVolume="false" >
-      <comment>Hadron Calorimeter Barrel</comment>
-
-      <envelope vis="ILD_HCALVis">
-        <shape type="BooleanShape" operation="Subtraction" material="Air" >
-          <shape type="Cone" z="Hcal_half_length + env_safety/2" rmin1="0.0" rmax1="Hcal_outer_radius + env_safety" rmin2="0.0" rmax2="Hcal_outer_radius + env_safety"/>
-          <shape type="PolyhedraRegular"  numsides="Hcal_inner_symmetry" rmin="0.0"
-                 rmax="Hcal_inner_radius - env_safety" dz="2*(Hcal_half_length + env_safety)"/>
-        </shape>
-        <rotation x="0" y="0" z="90*deg-180*deg/Hcal_inner_symmetry"/>
-      </envelope>
-      <type_flags type=" DetType_CALORIMETER + DetType_BARREL + DetType_HADRONIC " />
-
-      <staves  material = "Steel304L"  vis="BlueVis"/>
-
-      <!-- The layer structure reference in the following paper-->
-      <!-- ???  -->
-      <layer repeat="HcalBarrelSD_nlayers" vis="SeeThrough">
-        <slice material = "Steel304L"      thickness = "HcalSD_radiator_thickness"                    vis="BlueVis"   />
-        <slice material = "Air"            thickness = "HcalSD_airgap_thickness"                      vis="WhiteVis"   />
-        <slice material = "Steel304L"      thickness = "HcalSD_steel_casette_thickness"               vis="BlueVis"   />
-        <slice material = "epoxy"          thickness = "HcalSD_electronics_mask_thickness"            vis="GreenVis" />
-        <slice material = "PCB"            thickness = "HcalSD_PCB_thickness"                         vis="CyanVis" />
-        <slice material = "mylar"          thickness = "HcalSD_mylar_anode_thickness"                 vis="MagentaVis" />
-        <slice material = "graphite"       thickness = "HcalSD_graphite_anode_thickness"              vis="Invisible" />
-        <slice material = "FloatGlass"     thickness = "HcalSD_glass_anode_thickness"                 vis="RedVis" />
-        <slice material = "RPCGAS2"        thickness = "HcalSD_sensitive_gas_gap"   sensitive = "yes"   vis="YellowVis" />
-        <slice material = "FloatGlass"     thickness = "HcalSD_glass_cathode_thickness"               vis="RedVis" />
-        <slice material = "graphite"       thickness = "HcalSD_graphite_cathode_thickness"            vis="Invisible" />
-        <slice material = "mylar"          thickness = "HcalSD_mylar_cathode_thickness"               vis="MagentaVis" />
-        <slice material = "Steel304L"      thickness = "HcalSD_steel_casette_thickness"               vis="BlueVis"   />
-        <slice material = "Air"            thickness = "HcalSD_airgap_thickness"                      vis="WhiteVis"   />
-      </layer>
-    </detector>
-  </detectors>
-
-  <readouts>
-    <readout name="HCalBarrelRPCHits">
-      <segmentation type="CartesianGridXY" grid_size_x="HcalSD_cells_size" grid_size_y="HcalSD_cells_size"/>
-      <id>system:5,module:3,stave:3,tower:5,layer:6,slice:4,x:32:-16,y:-16</id>
-    </readout>
-  </readouts>
-
-</lccdd>
diff --git a/Detector/DetCEPCv4/compact/Hcal_EndcapRing_SD_v01.xml b/Detector/DetCEPCv4/compact/Hcal_EndcapRing_SD_v01.xml
deleted file mode 100644
index ee89545a0187d2cc8e87318e770aa9e7f408800d..0000000000000000000000000000000000000000
--- a/Detector/DetCEPCv4/compact/Hcal_EndcapRing_SD_v01.xml
+++ /dev/null
@@ -1,56 +0,0 @@
-<lccdd>
-
-  <detectors>
-    <detector name="HcalRing" type="Hcal_EndcapRing_SD_v01" id="ILDDetID_HCAL_RING" readout="HCalECRingRPCHits" vis="SeeThrough" insideTrackingVolume="false" >
-      <comment>Hadron Calorimeter EndcapRing</comment>
-
-      <envelope vis="ILD_HCALVis">
-        <shape type="BooleanShape" operation="Subtraction" material="Air">
-          <shape type="BooleanShape" operation="Intersection" material="Air">
-            <shape type="Box" dx="HcalEndcapRing_outer_radius + 2.0*env_safety" dy="HcalEndcapRing_outer_radius + 2.0*env_safety"
-                   dz="HcalEndcapRing_max_z + 2.0*env_safety"/> <!--Box defined the coordinate system-->
-            <shape type="PolyhedraRegular" numsides="HcalEndcapRingSD_inner_symmetry" rmin="HcalEndcapRing_inner_radius - env_safety"
-                   rmax="HcalEndcapRing_outer_radius + env_safety" dz="2.0*HcalEndcapRing_max_z + env_safety" material="Air"/>
-            <rotation x="0" y="0" z="90*deg-180*deg/HcalEndcapRingSD_inner_symmetry"/>
-          </shape>
-
-          <shape type="Box" dx="HcalEndcapRing_outer_radius + 2.0*env_safety" dy="HcalEndcapRing_outer_radius + 2.0*env_safety"
-                 dz="HcalEndcapRing_min_z - env_safety"/>
-        </shape>
-      </envelope>
-
-      <type_flags type=" DetType_CALORIMETER + DetType_ENDCAP + DetType_HADRONIC + DetType_AUXILIARY " />
-
-      <!-- absorber material
-        -->
-      <staves  material = "Steel304L"  vis="GreenVis"/>
-      <material name="Steel304L"/>
-
-      <layer repeat="HcalEndcapRingSD_nlayers" vis="SeeThrough">
-        <slice material = "Steel304L"      thickness = "HcalSD_radiator_thickness"                    vis="BlueVis"   />
-        <slice material = "Air"            thickness = "HcalSD_airgap_thickness"                      vis="WhiteVis"   />
-        <slice material = "Steel304L"      thickness = "HcalSD_steel_casette_thickness"               vis="BlueVis"   />
-        <slice material = "epoxy"          thickness = "HcalSD_electronics_mask_thickness"            vis="GreenVis" />
-        <slice material = "PCB"            thickness = "HcalSD_PCB_thickness"                         vis="CyanVis" />
-        <slice material = "mylar"          thickness = "HcalSD_mylar_anode_thickness"                 vis="MagentaVis" />
-        <slice material = "graphite"       thickness = "HcalSD_graphite_anode_thickness"              vis="Invisible" />
-        <slice material = "FloatGlass"     thickness = "HcalSD_glass_anode_thickness"                 vis="RedVis" />
-        <slice material = "RPCGAS2"        thickness = "HcalSD_sensitive_gas_gap"  sensitive = "yes"   vis="YellowVis" />
-        <slice material = "FloatGlass"     thickness = "HcalSD_glass_cathode_thickness"               vis="RedVis" />
-        <slice material = "graphite"       thickness = "HcalSD_graphite_cathode_thickness"            vis="Invisible" />
-        <slice material = "mylar"          thickness = "HcalSD_mylar_cathode_thickness"               vis="MagentaVis" />
-        <slice material = "Steel304L"      thickness = "HcalSD_steel_casette_thickness"               vis="BlueVis"   />
-        <slice material = "Air"            thickness = "HcalSD_airgap_thickness"                      vis="WhiteVis"   />
-      </layer>
-    </detector>
-  </detectors>
-
-  <readouts>
-    <readout name="HCalECRingRPCHits">
-      <segmentation type="CartesianGridXY" grid_size_x="HcalSD_cells_size" grid_size_y="HcalSD_cells_size"/>
-      <id>system:5,module:3,stave:4,tower:3,layer:6,x:32:-16,y:-16</id>
-    </readout>
-  </readouts>
-
-</lccdd>
-
diff --git a/Detector/DetCEPCv4/compact/Hcal_Endcaps_SD_v01.xml b/Detector/DetCEPCv4/compact/Hcal_Endcaps_SD_v01.xml
deleted file mode 100644
index 3b77b0fa6104dd0cd1e60b439d185ed6eb9af23c..0000000000000000000000000000000000000000
--- a/Detector/DetCEPCv4/compact/Hcal_Endcaps_SD_v01.xml
+++ /dev/null
@@ -1,53 +0,0 @@
-<lccdd>
-
-<detectors>
-<detector id="ILDDetID_HCAL_ENDCAP" name="HcalEndcap" type="Hcal_Endcaps_SD_v01" readout="HCalEndcapRPCHits"  vis="SeeThrough" calorimeterType="HAD_ENDCAP">
- <comment>Hadron Calorimeter Endcap</comment>
-
-
-    <envelope vis="ILD_HCALVis">    
-      <shape type="BooleanShape" operation="Subtraction" material="Air"><!--2. create center box hole -->
-        <shape type="BooleanShape" operation="Subtraction" material="Air"><!--1. create Endcaps envelope -->
-          <shape type="Tube" rmin="0.0" rmax="HcalEndcap_outer_radius + env_safety" dz="HcalEndcap_max_z + env_safety"/>
-          <shape type="Tube" rmin="0.0" rmax="HcalEndcap_outer_radius + 2.0*env_safety" dz="HcalEndcap_min_z - env_safety"/>
-        </shape>
-        <shape type="Box" dx="HcalEndcap_inner_radius - env_safety" dy="HcalEndcap_inner_radius - env_safety" 
-               dz="HcalEndcap_max_z + 2.0*env_safety"/>
-      </shape>
-      <rotation x="0" y="0" z="0"/>
-    </envelope>
-
-    <type_flags type=" DetType_CALORIMETER + DetType_ENDCAP + DetType_HADRONIC " />
-    <material name="Steel304L"/><!-- radiator and the thickness has been defined in the main xml file-->
-    <staves  material = "Steel235"  vis="SeeThrough"/>
-
-
-      <!-- slice: from inner  to outer -->  
-    <layer repeat="HcalEndcapSD_nlayers" vis="SeeThrough">  
-        <slice material = "Steel304L"      thickness = "HcalSD_radiator_thickness"                    vis="BlueVis"   />   
-        <slice material = "Air"            thickness = "HcalSD_airgap_thickness"                      vis="WhiteVis"  /> 
-        <slice material = "Steel304L"      thickness = "HcalSD_steel_casette_thickness"               vis="BlueVis"   />
-        <slice material = "epoxy"          thickness = "HcalSD_electronics_mask_thickness"            vis="GreenVis"  />
-        <slice material = "PCB"            thickness = "HcalSD_PCB_thickness"                         vis="CyanVis"   />
-        <slice material = "mylar"          thickness = "HcalSD_mylar_anode_thickness"                 vis="MagentaVis"/>
-        <slice material = "graphite"       thickness = "HcalSD_graphite_anode_thickness"              vis="Invisible" />
-        <slice material = "FloatGlass"     thickness = "HcalSD_glass_anode_thickness"                 vis="RedVis"    />
-        <slice material = "RPCGAS2"        thickness = "HcalSD_sensitive_gas_gap"   sensitive = "yes"   vis="YellowVis" />
-        <slice material = "FloatGlass"     thickness = "HcalSD_glass_cathode_thickness"               vis="RedVis"    />
-        <slice material = "graphite"       thickness = "HcalSD_graphite_cathode_thickness"            vis="Invisible" />
-        <slice material = "mylar"          thickness = "HcalSD_mylar_cathode_thickness"               vis="MagentaVis"/>
-        <slice material = "Steel304L"      thickness = "HcalSD_steel_casette_thickness"               vis="BlueVis"   /> 
-        <slice material = "Air"            thickness = "HcalSD_airgap_thickness"                      vis="WhiteVis"  />  
-    </layer>
-
-</detector>
-</detectors>
-
-<readouts>
-  <readout name="HCalEndcapRPCHits">
-    <segmentation type="CartesianGridXY" grid_size_x="HcalSD_cells_size" grid_size_y="HcalSD_cells_size" offset_x="HcalSD_cells_size/2.0" offset_y="HcalSD_cells_size/2.0" />
-    <id>system:5,module:3,stave:3,tower:5,layer:6,x:32:-16,y:-16</id>
-  </readout>
-</readouts>
-
-</lccdd>
diff --git a/Detector/DetCEPCv4/compact/README.md b/Detector/DetCEPCv4/compact/README.md
index 82da7ff49a3b444b1a19340295a69d5fbde13cd2..0150fa3782ecdea2b5b8256678848dd3bf193c65 100644
--- a/Detector/DetCEPCv4/compact/README.md
+++ b/Detector/DetCEPCv4/compact/README.md
@@ -20,10 +20,10 @@ The following CEPC_v4 detector models are available in CEPCSW
          - TPC_outer_radius = 1808*mm
  - EndcapTracker
          - with silicon pestals (FTDPixel + FTDStrip)
- - Ecal (un-implemented)
+ - Ecal
          - with si-W calorimeter
- - Hcal (un-implemented)
-         - with scintillator **and** RPC readout
-         - creates two sets of hit collections
+ - Hcal
+         - with RPC readout
+         - creates three sets of hit collections
  - compact files:
          - only Tracker [./CEPC_v4.xml](./CEPC_v4.xml)
diff --git a/Detector/DetCEPCv4/compact/SHcalRpc01_Barrel_01.xml b/Detector/DetCEPCv4/compact/SHcalRpc01_Barrel_01.xml
new file mode 100644
index 0000000000000000000000000000000000000000..8ea02125f3e24158e985c8f2dc9ac455b84c013f
--- /dev/null
+++ b/Detector/DetCEPCv4/compact/SHcalRpc01_Barrel_01.xml
@@ -0,0 +1,41 @@
+<lccdd>
+  <detectors>
+    <detector name="HcalBarrel" type="SHcalRpc01_Barrel" id="ILDDetID_HCAL" readout="HcalBarrelCollection" vis="GreenVis" insideTrackingVolume="false" >
+      <comment>Hadron Calorimeter Barrel</comment>
+      <envelope vis="ILD_HCALVis">
+        <shape type="BooleanShape" operation="Subtraction" material="Air" >
+          <shape type="Cone" z="Hcal_half_length + env_safety/2" rmin1="0.0" rmax1="Hcal_outer_radius + env_safety" rmin2="0.0" rmax2="Hcal_outer_radius + env_safety"/>
+          <shape type="PolyhedraRegular"  numsides="Hcal_inner_symmetry" rmin="0.0"
+                 rmax="Hcal_inner_radius - env_safety" dz="2*(Hcal_half_length + env_safety)"/>
+	  <rotation x="0" y="0" z="-180*deg/Hcal_inner_symmetry"/>
+        </shape>
+        <!--rotation x="0" y="0" z="90*deg-180*deg/Hcal_inner_symmetry"/-->
+      </envelope>
+      <type_flags type=" DetType_CALORIMETER + DetType_BARREL + DetType_HADRONIC " />
+
+      <staves  material="stainless_steel"  vis="BlueVis"/>
+
+      <layer repeat="Hcal_nlayers" vis="SeeThrough">
+        <slice material="stainless_steel" thickness="Hcal_radiator_thickness"                    vis="BlueVis"   />
+        <slice material="Air"             thickness="Hcal_airgap_thickness"                      vis="WhiteVis"   />
+	<slice material="mylar"           thickness="Hcal_mylar_cathode_thickness"               vis="MagentaVis" />
+	<slice material="graphite"        thickness="Hcal_graphite_cathode_thickness"            vis="Invisible" />
+	<slice material="FloatGlass"      thickness="Hcal_glass_cathode_thickness"               vis="RedVis" />
+	<slice material="RPCGAS2"         thickness="Hcal_sensitive_gas_gap"   sensitive = "yes" vis="YellowVis" edge_material="PEEK-GF30" spacer_material="Nylon"/>
+	<slice material="FloatGlass"      thickness="Hcal_glass_anode_thickness"                 vis="RedVis" />
+	<slice material="graphite"        thickness="Hcal_graphite_anode_thickness"              vis="Invisible" />
+	<slice material="mylar"           thickness="Hcal_mylar_anode_thickness"                 vis="MagentaVis" />
+	<slice material="g10"             thickness="Hcal_PCB_thickness"                         vis="CyanVis" />
+	<slice material="g10"             thickness="Hcal_electronics_mask_thickness"            vis="GreenVis" />
+      </layer>
+    </detector>
+  </detectors>
+
+  <readouts>
+    <readout name="HcalBarrelCollection">
+      <segmentation type="CartesianGridXY" grid_size_x="Hcal_cells_size" grid_size_y="Hcal_cells_size"/>
+      <id>system:5,module:3,stave:3,tower:5,layer:6,slice:4,x:32:-16,y:-16</id>
+    </readout>
+  </readouts>
+
+</lccdd>
diff --git a/Detector/DetCEPCv4/compact/SHcalRpc01_EndcapRing_01.xml b/Detector/DetCEPCv4/compact/SHcalRpc01_EndcapRing_01.xml
new file mode 100644
index 0000000000000000000000000000000000000000..824b932c8276357fe5373d57c78780f462aca381
--- /dev/null
+++ b/Detector/DetCEPCv4/compact/SHcalRpc01_EndcapRing_01.xml
@@ -0,0 +1,41 @@
+<lccdd>
+  <detectors>
+    <detector name="HcalRing" type="SHcalRpc01_EndcapRing" id="ILDDetID_HCAL_RING" readout="HcalEndcapRingCollection" vis="SeeThrough" insideTrackingVolume="false" >
+      <comment>Hadron Calorimeter EndcapRing</comment>
+      <envelope vis="ILD_HCALVis">
+	<!--shape type="Assembly"/-->
+        <shape type="BooleanShape" operation="Subtraction" material="Air">
+          <shape type="BooleanShape" operation="Intersection" material="Air">
+            <shape type="Box" dx="HcalEndcapRing_outer_radius + 2.0*env_safety" dy="HcalEndcapRing_outer_radius + 2.0*env_safety"
+                   dz="HcalEndcapRing_max_z + 2.0*env_safety"/>
+            <shape type="PolyhedraRegular" numsides="Hcal_ring_inner_symmetry" rmin="HcalEndcapRing_inner_radius - env_safety"
+                   rmax="HcalEndcapRing_outer_radius + env_safety" dz="2.0*HcalEndcapRing_max_z + env_safety" material="Air"/>
+            <rotation x="0" y="0" z="90*deg-180*deg/Hcal_ring_inner_symmetry"/>
+          </shape>
+          <shape type="Box" dx="HcalEndcapRing_outer_radius + 2.0*env_safety" dy="HcalEndcapRing_outer_radius + 2.0*env_safety"
+                 dz="HcalEndcapRing_min_z - env_safety"/>
+        </shape>
+      </envelope>
+
+      <type_flags type=" DetType_CALORIMETER + DetType_ENDCAP + DetType_HADRONIC + DetType_AUXILIARY " />
+      <staves material="stainless_steel" vis="GreenVis"/>
+
+      <layer repeat="HcalEndcapRing_nlayers" vis="SeeThrough">
+	<slice material="stainless_steel" thickness="Hcal_radiator_thickness"                    vis="BlueVis"/>
+	<slice material="FloatGlass"      thickness="Hcal_glass_cathode_thickness"               vis="RedVis"/>
+        <slice material="RPCGAS2"         thickness="Hcal_sensitive_gas_gap"   sensitive = "yes" vis="YellowVis"/>
+        <slice material="FloatGlass"      thickness="Hcal_glass_anode_thickness"                 vis="RedVis"/>
+        <slice material="RPC2ECRMix"      thickness="Hcal_mix_thickness"                         vis="CyanVis"/>
+      </layer>
+    </detector>
+  </detectors>
+
+  <readouts>
+    <readout name="HcalEndcapRingCollection">
+      <segmentation type="CartesianGridXY" grid_size_x="Hcal_cells_size" grid_size_y="Hcal_cells_size"/>
+      <id>system:5,module:3,stave:4,tower:3,layer:6,x:32:-16,y:-16</id>
+    </readout>
+  </readouts>
+  
+</lccdd>
+
diff --git a/Detector/DetCEPCv4/compact/SHcalRpc01_Endcaps_01.xml b/Detector/DetCEPCv4/compact/SHcalRpc01_Endcaps_01.xml
new file mode 100644
index 0000000000000000000000000000000000000000..677a23dd3dcdb7f207f11089a0144e0846f00a84
--- /dev/null
+++ b/Detector/DetCEPCv4/compact/SHcalRpc01_Endcaps_01.xml
@@ -0,0 +1,38 @@
+<lccdd>
+  <detectors>
+    <detector id="ILDDetID_HCAL_ENDCAP" name="HcalEndcap" type="SHcalRpc01_Endcaps" readout="HcalEndcapsCollection"  vis="SeeThrough" calorimeterType="HAD_ENDCAP">
+      <comment>Hadron Calorimeter Endcap</comment>
+      <envelope vis="ILD_HCALVis">    
+	<shape type="BooleanShape" operation="Subtraction" material="Air">
+          <shape type="BooleanShape" operation="Subtraction" material="Air">
+            <shape type="Tube" rmin="0.0" rmax="HcalEndcap_outer_radius + env_safety" dz="HcalEndcap_max_z + env_safety"/>
+            <shape type="Tube" rmin="0.0" rmax="HcalEndcap_outer_radius + 2.0*env_safety" dz="HcalEndcap_min_z - env_safety"/>
+          </shape>
+          <shape type="Box" dx="HcalEndcap_inner_radius - env_safety" dy="HcalEndcap_inner_radius - env_safety" dz="HcalEndcap_max_z + 2.0*env_safety"/>
+	</shape>
+	<rotation x="0" y="0" z="0"/>
+      </envelope>
+      
+      <type_flags type="DetType_CALORIMETER + DetType_ENDCAP + DetType_HADRONIC " />
+      
+      <staves material="stainless_steel" vis="SeeThrough"/>
+
+      <layer repeat="Hcal_endcap_nlayers" vis="SeeThrough">  
+	<slice material="stainless_steel" thickness="Hcal_radiator_thickness"                    vis="BlueVis"/>
+	<slice material="FloatGlass"      thickness="Hcal_glass_cathode_thickness"               vis="RedVis"/>
+	<slice material="RPCGAS2"         thickness="Hcal_sensitive_gas_gap"   sensitive = "yes" vis="YellowVis"/>
+        <slice material="FloatGlass"      thickness="Hcal_glass_anode_thickness"                 vis="RedVis"/>
+        <slice material="RPC2ECRMix"      thickness="Hcal_mix_thickness"                         vis="CyanVis"/>
+      </layer>
+      
+    </detector>
+  </detectors>
+
+  <readouts>
+    <readout name="HcalEndcapsCollection">
+      <segmentation type="CartesianGridXY" grid_size_x="Hcal_cells_size" grid_size_y="Hcal_cells_size" offset_x="Hcal_cells_size/2.0" offset_y="Hcal_cells_size/2.0" />
+      <id>system:5,module:3,stave:3,tower:5,layer:6,x:32:-16,y:-16</id>
+    </readout>
+  </readouts>
+  
+</lccdd>
diff --git a/Detector/DetCEPCv4/compact/envelope_defs.xml b/Detector/DetCEPCv4/compact/envelope_defs.xml
index e80faf2de8143bc34460b2c4b05ab373f2bd14aa..5b900a1b04eb2078bbab7e3eca2d67e4a1474bef 100644
--- a/Detector/DetCEPCv4/compact/envelope_defs.xml
+++ b/Detector/DetCEPCv4/compact/envelope_defs.xml
@@ -50,12 +50,13 @@
   <constant name="VXD_inner_radius"   value="top_VXD_inner_radius"/>
   <constant name="VXD_outer_radius"   value="top_VXD_outer_radius"/>
   <constant name="VXD_half_length"    value="top_VXD_half_length"/>
-  <constant name="VXD_cone_min_z"     value="TUBE_IPInnerTube_end_z"/>
+  <!--constant name="VXD_cone_min_z"     value="TUBE_IPInnerTube_end_z"/-->
+  <constant name="VXD_cone_min_z"     value="135*mm"/>
   <!--constant name="VXD_cone_max_z"     value="TUBE_IPInnerBulge_end_z"/-->
-  <constant name="VXD_cone_max_z"     value="VXD_half_length"/>
+  <constant name="VXD_cone_max_z"     value="VXD_half_length-10*mm"/>
   <!--constant name="VXD_cone_max_z"     value="125.1*mm "/-->
   <constant name="VXD_inner_radius_1" value="TUBE_IPInnerBulge_end_envradius + env_safety "/>
-
+  <!--constant name="VXD_inner_radius_1" value="TUBE_central_inner_radius + TUBE_central_thickness + env_safety"/-->
 
   <constant name="SIT_inner_radius"    value="SIT1_Radius - env_safety"/>
   <constant name="SIT_outer_radius_1"  value="SIT2_Radius - env_safety"/>
@@ -92,7 +93,8 @@
   <constant name="Ecal_symmetry"        value="Ecal_Hcal_symmetry"/>
 
   <constant name="Hcal_inner_radius"    value="Ecal_outer_radius+Hcal_Ecal_gap"/>
-  <constant name="Hcal_outer_radius"    value="(Hcal_inner_radius+Hcal_barrel_thickness)/cos(pi/Hcal_outer_symmetry)"/> <!-- cos(pi/16)   -->
+  <!--constant name="Hcal_outer_radius"    value="(Hcal_inner_radius+Hcal_barrel_thickness)/cos(pi/Hcal_outer_symmetry)"/--> <!-- cos(pi/16)   -->
+  <constant name="Hcal_outer_radius"    value="3144.43*mm"/>
   <constant name="Hcal_half_length"     value="TPC_Ecal_Hcal_barrel_halfZ"/>
   <constant name="Hcal_inner_symmetry"  value="Ecal_Hcal_symmetry"/>
 
diff --git a/Detector/DetCEPCv4/compact/ftd_cepc.xml b/Detector/DetCEPCv4/compact/ftd_cepc.xml
index 1566734d9cc99303396268d315a9df8f578a3aee..c32b76369a1474eb45996d855444066ed4bba94a 100644
--- a/Detector/DetCEPCv4/compact/ftd_cepc.xml
+++ b/Detector/DetCEPCv4/compact/ftd_cepc.xml
@@ -19,7 +19,8 @@
                   <shape type="Tube" rmin="FTD_inner_radius"   rmax="FTD_outer_radius" dz="FTD_half_length"  />
                   <shape type="Tube" rmin="0." rmax="FTD_outer_radius+env_safety" dz="FTD_min_z_0" />
                 </shape>
-                <shape type="Tube" rmin="FTD_outer_radius_1" rmax="FTD_outer_radius+env_safety" dz="FTD_min_z_2-petal_cp_support_thickness-petal_support_zoffset" />
+                <!--shape type="Tube" rmin="FTD_outer_radius_1" rmax="FTD_outer_radius+env_safety" dz="FTD_min_z_2-petal_cp_support_thickness-petal_support_zoffset" /-->
+		<shape type="Tube" rmin="FTD_outer_radius_1" rmax="FTD_outer_radius+env_safety" dz="FTD_min_z_2-FTD_layer_shift"/>
               </shape>
               <shape type="Tube" rmin="FTD_outer_radius_2" rmax="FTD_outer_radius+env_safety" dz="FTD_min_z_2" />
             </shape>
@@ -46,9 +47,9 @@
       <!-- SQL command: "select * from extended_reconstruction_parameters;"  same as ftd_cepc_v4 checked by fucd -->
       <extended_reconstruction_parameters strip_width="0.001*mm" strip_length="250*mm" strip_pitch="0.01*mm" strip_angle="5*deg"  />
 
-      <!-- SQL command: "select * from disks;"  same as ftd_cepc_v4 checked by fucd-->
-      <disk disk_number="1" z_position_ReltoTPCLength="0"                            disk_si_thickness="0.02*mm" petal_cp_support_dxMax="72*mm" padUp_Si_dxMax="68*mm" petal_cp_support_thickness="1*mm" petal_support_zoffset="1.5*mm" sensor_is_pixel="1" double_sided="0"  />
-      <disk disk_number="2" z_position_ReltoTPCLength="FTD_disk2_zPosRelToTpcLength" disk_si_thickness="0.02*mm" petal_cp_support_dxMax="72*mm" padUp_Si_dxMax="68*mm" petal_cp_support_thickness="1*mm" petal_support_zoffset="1.5*mm" sensor_is_pixel="1" double_sided="0"  />
+      <!-- SQL command: "select * from disks;"  same as ftd_cepc_v4 checked by fucd, but overlap exist, reduce petal_cp_support_dxMax from 72mm to 71.4mm/71.8mm-->
+      <disk disk_number="1" z_position_ReltoTPCLength="0"                            disk_si_thickness="0.02*mm" petal_cp_support_dxMax="71.4*mm" padUp_Si_dxMax="68*mm" petal_cp_support_thickness="1*mm" petal_support_zoffset="1.5*mm" sensor_is_pixel="1" double_sided="0"  />
+      <disk disk_number="2" z_position_ReltoTPCLength="FTD_disk2_zPosRelToTpcLength" disk_si_thickness="0.02*mm" petal_cp_support_dxMax="71.8*mm" padUp_Si_dxMax="68*mm" petal_cp_support_thickness="1*mm" petal_support_zoffset="1.5*mm" sensor_is_pixel="1" double_sided="0"  />
       <disk disk_number="3" z_position_ReltoTPCLength="FTD_disk3_zPosRelToTpcLength" disk_si_thickness="0.20*mm" petal_cp_support_dxMax="122.49*mm" padUp_Si_dxMax="118.46*mm" petal_cp_support_thickness="2*mm" petal_support_zoffset="1.5*mm" sensor_is_pixel="0" double_sided="1"  />
       <disk disk_number="4" z_position_ReltoTPCLength="FTD_disk4_zPosRelToTpcLength" disk_si_thickness="0.20*mm" petal_cp_support_dxMax="122.49*mm" padUp_Si_dxMax="118.46*mm" petal_cp_support_thickness="2*mm" petal_support_zoffset="1.5*mm" sensor_is_pixel="0" double_sided="1"  />
       <disk disk_number="5" z_position_ReltoTPCLength="FTD_disk5_zPosRelToTpcLength" disk_si_thickness="0.20*mm" petal_cp_support_dxMax="122.49*mm" padUp_Si_dxMax="118.46*mm" petal_cp_support_thickness="2*mm" petal_support_zoffset="1.5*mm" sensor_is_pixel="0" double_sided="1"  />
@@ -61,8 +62,7 @@
 
   <readouts>
     <readout name="FTDCollection">
-      <!-- fixme: for now DD4hep cannot handle signed values - side should actually be "-2" -->
-      <id>system:5,side:2,layer:9,module:8,sensor:8</id>
+      <id>system:5,side:-2,layer:9,module:8,sensor:8</id>
     </readout>
   </readouts>
 
diff --git a/Detector/DetCEPCv4/compact/hcal_defs.xml b/Detector/DetCEPCv4/compact/hcal_defs.xml
index 12f7ba31c749056b80cd53abd81378c13773c787..c9d72eae8ed9263a480936e222fed1ab76508715 100644
--- a/Detector/DetCEPCv4/compact/hcal_defs.xml
+++ b/Detector/DetCEPCv4/compact/hcal_defs.xml
@@ -1,85 +1,49 @@
 <define>
-
-
   <constant name="Hcal_radiator_thickness" value="20.0*mm"/>
-  <constant name="Hcal_chamber_thickness" value="6.73*mm"/>
-  <constant name="Hcal_back_plate_thickness" value="15*mm"/>
-  <constant name="Hcal_lateral_structure_thickness" value="10*mm"/>
-  <constant name="Hcal_stave_gaps" value="3*mm"/>
-  <constant name="Hcal_modules_gap" value="0.001*mm"/>
-  <constant name="Hcal_layer_air_gap" value="2*mm"/>
-  <constant name="Hcal_middle_stave_gaps" value="10*mm"/>
+  <constant name="Hcal_airgap_thickness" value="1*mm"/>
+  <constant name="Hcal_mylar_cathode_thickness" value="0.18*mm"/>
+  <constant name="Hcal_graphite_cathode_thickness" value="0.05*mm"/>
+  <constant name="Hcal_glass_cathode_thickness" value="1.1*mm"/>
+  <constant name="Hcal_sensitive_gas_gap" value="1.2*mm"/>
+  <constant name="Hcal_glass_anode_thickness" value="0.7*mm"/>
+  <constant name="Hcal_graphite_anode_thickness" value="0.05*mm"/>
+  <constant name="Hcal_mylar_anode_thickness" value="0.05*mm"/>
+  <constant name="Hcal_PCB_thickness" value="0.8*mm"/>
+  <constant name="Hcal_electronics_mask_thickness" value="1.6*mm"/>
+  
   <constant name="Hcal_nlayers" value="40"/>
-  <constant name="Hcal_fiber_gap" value="1.5*mm"/>
-  <constant name="Hcal_Cu_thickness" value="0.1*mm"/>
-  <constant name="Hcal_PCB_thickness" value="0.7*mm"/>
-  <constant name="Hcal_scintillator_thickness" value="3.0*mm"/>
+  <constant name="Hcal_endcap_nlayers" value="Hcal_nlayers"/>
+  <constant name="Hcal_ring_nlayers"         value="7"/>
   <constant name="Hcal_cells_size" value="10*mm"/>
-  <constant name="Hcal_endcap_lateral_structure_thickness" value="5.0*mm"/>
-  <constant name="Hcal_endcap_layer_air_gap" value="2.5*mm"/>
-  <constant name="Hcal_endcap_nlayers" value="40"/> <!-- needed for ring only? -->
-
-  <!-- fg:
-      copy extra parameters for SDHcal from ILD_o2_v01 here
-      maybe they should all be renamed to SDHCal_ for clarity ? 
-     TK: Yes, here are they ... HcalSD_  
-  -->
-  <constant name="HcalSD_cells_size" value="10.406*mm"/>
-  <constant name="HcalSD_pad_separation" value="0.406*mm"/>
-  <constant name="HcalSD_radiator_thickness" value="15.0*mm"/>
-  <constant name="HcalSD_sensitive_gas_gap" value="1.2*mm"/>
-  <constant name="HcalSD_graphite_cathode_thickness" value="0.05*mm"/>
-  <constant name="HcalSD_graphite_anode_thickness" value="0.05*mm"/>
-  <constant name="HcalSD_glass_cathode_thickness" value="1.1*mm"/>
-  <constant name="HcalSD_glass_anode_thickness" value="0.7*mm"/>
-  <constant name="HcalSD_g10_thickness" value="1.4*mm"/>
-  <constant name="HcalSD_mylar_anode_thickness" value="0.05*mm"/>
-  <constant name="HcalSD_mylar_cathode_thickness" value="0.175*mm"/>
-  <constant name="HcalSD_mylar_thickness" value="0.2*mm"/>
-  <constant name="HcalSD_PCB_thickness" value="1.2*mm"/>
-  <constant name="HcalSD_electronics_mask_thickness" value="1.6*mm"/>
-  <constant name="HcalSD_steel_casette_thickness" value="2.5*mm"/>
-  <constant name="HcalSD_airgap_thickness" value="0.5*mm"/>
-  <constant name="HcalSD_back_plate_thickness" value="10*mm"/>
-  <constant name="HcalSD_barrel_end_module_type" value="1"/>
-  <constant name="HcalSD_stave_gaps" value="10*mm"/>
-  <constant name="HcalSD_lateral_structure_thickness" value="10*mm"/>
-  <constant name="HcalSD_layer_air_gap" value="2*mm"/>
-  <constant name="HcalSD_endcap_lateral_structure_thickness" value="5.0*mm"/>
-
-  <constant name="HcalSD_module_wall_thickness" value="10*mm"/>   
-
-  <constant name="HcalBarrelSD_nlayers" value="40"/>
-  <constant name="HcalSD_MinNumCellsInTransvPlane" value="1"/>
-  <constant name="HcalBarrelSD_number_modules" value="5"/>
-  <constant name="HcalEndcap_symmetry" value="Hcal_outer_symmetry"/>
-  <constant name="HcalEndcapRingSD_inner_symmetry"  value="Ecal_Hcal_symmetry"/>
-  <constant name="HcalEndcapRingSD_outer_symmetry"  value="HcalEndcap_symmetry"/>
-  <constant name="HcalEndcapRingSD_nlayers"         value="7"/>
-  <constant name="HcalEndcapSD_nlayers" value="40"/>
-
-  <constant name="HcalSD_gasInlet_length" value="3.0*mm"/>
-  <constant name="HcalSD_modules_gap" value="20*mm"/>
-  <constant name="HcalSD_spacer_separation" value="100*mm"/>
-  <constant name="HcalSD_spacer_thickness" value="8*mm"/>
-  <constant name="HcalSD_gasInlet_innerRadius" value="0.4*mm"/>
-  <constant name="HcalSD_gasInlet_outerRadius" value="0.5*mm"/>
-
-  
-
-  <!-- translations -->
-  <constant name="Hcal_endcap_zmin" value="HcalEndcap_min_z"/>
-
-  <!-- used for "hybrid" readout segmentation -->
-  <constant name="AHCal_cell_size" value="3.0*cm"/>
-  <constant name="SDHCal_cell_size" value="1.0*cm"/>
-  
-  <!-- TODO move these two element at the correct place -->
-  <!-- TODO create the additional detectors for the different options for l/s4 and l/s5 -->
-  <!-- TODO merge the two variables to only one for both barrel and endcap -->
-  <!-- barrel and endcvap constructors use the slices in reversed order ! -->
-  <!-- <constant name="Hcal_readout_segmentation_slice_barrel" value="3"/> -->
-  <!-- <constant name="Hcal_readout_segmentation_slice_endcap" value="3"/> -->
-
 
+  <constant name="Hcal_gas_edge_width" value="1*mm"/>
+  <constant name="Hcal_MinNumCellsInTransvPlane" value="11"/>
+  <constant name="Hcal_barrel_number_modules" value="5"/>
+  <constant name="Hcal_chamber_thickness" value="6.73*mm"/>
+  <constant name="Hcal_back_plate_thickness" value="15*mm"/>
+  <constant name="Hcal_lateral_structure_thickness" value="10*mm"/>
+  <constant name="Hcal_stave_gaps" value="0*mm"/>
+  <constant name="Hcal_modules_gap" value="2*mm"/>
+
+  <constant name="Hcal_pad_separation" value="0*mm"/>
+  <constant name="Hcal_gasInlet_length" value="3.0*mm"/>
+  <constant name="Hcal_spacer_separation" value="100*mm"/>
+  <constant name="Hcal_spacer_thickness" value="8*mm"/>
+  <constant name="Hcal_gasInlet_inner_radius" value="0.4*mm"/>
+  <constant name="Hcal_gasInlet_outer_radius" value="0.5*mm"/>
+
+  <constant name="Hcal_endcap_outer_symmetry" value="Hcal_outer_symmetry"/>
+  <constant name="Hcal_ring_inner_symmetry"  value="Ecal_Hcal_symmetry"/>
+  <constant name="Hcal_ring_outer_symmetry"  value="Hcal_endcap_outer_symmetry"/>
+
+  <constant name="Hcal_graphite_thickness" value="Hcal_graphite_cathode_thickness+Hcal_graphite_anode_thickness"/>
+  <constant name="Hcal_mylar_thickness" value="Hcal_mylar_cathode_thickness+Hcal_mylar_anode_thickness"/>
+  <constant name="Hcal_g10_thickness" value="Hcal_PCB_thickness+Hcal_electronics_mask_thickness"/>
+  <constant name="Hcal_mix_thickness" value="Hcal_airgap_thickness+Hcal_graphite_thickness+Hcal_mylar_thickness+Hcal_g10_thickness"/>
+  <constant name="Hcal_mix_density" value="Hcal_airgap_thickness/Hcal_mix_thickness*0.00120479 + Hcal_graphite_thickness/Hcal_mix_thickness*2.21 +
+                                           Hcal_mylar_thickness/Hcal_mix_thickness*1.4 + Hcal_g10_thickness/Hcal_mix_thickness*1.7"/>
+  <constant name="Hcal_airgap_fraction" value="Hcal_airgap_thickness/Hcal_mix_thickness*0.00120479/Hcal_mix_density"/>
+  <constant name="Hcal_graphite_fraction" value="Hcal_graphite_thickness/Hcal_mix_thickness*2.21/Hcal_mix_density"/>
+  <constant name="Hcal_mylar_fraction" value="Hcal_mylar_thickness/Hcal_mix_thickness*1.4/Hcal_mix_density"/>
+  <constant name="Hcal_g10_fraction" value="Hcal_g10_thickness/Hcal_mix_thickness*1.7/Hcal_mix_density"/>
 </define>
diff --git a/Detector/DetCEPCv4/compact/services_defs.xml b/Detector/DetCEPCv4/compact/services_defs.xml
index 91e4ed58b436936f24818235a97d85022c8fbcf3..f60250d5862bbd44032db692743d159bb3daa210 100644
--- a/Detector/DetCEPCv4/compact/services_defs.xml
+++ b/Detector/DetCEPCv4/compact/services_defs.xml
@@ -39,6 +39,7 @@
   <constant name="SServices_FTD2_cone_thickness" value="0.040*mm"/>
   <constant name="SServices_FTD3_cone_thickness" value="0.020*mm"/>
   <constant name="SServices_FTD7_cables_thickness" value="0.85*mm"/>
+  <constant name="FTD_layer_shift" value="petal_cp_support_thickness+petal_support_zoffset+1*mm"/>
 
   <constant name="VXD_cable_cross_section_area" value="25.0*mm*mm"/>
   <constant name="VXD_cable_inner1_radius" value="30.0*mm"/>
diff --git a/Detector/DetCEPCv4/compact/top_defs.xml b/Detector/DetCEPCv4/compact/top_defs.xml
index 8516b3a129614567b22deb7163e22f09b69dd8b1..6b09c8a30df471c5354ff6227666c350894fe20d 100644
--- a/Detector/DetCEPCv4/compact/top_defs.xml
+++ b/Detector/DetCEPCv4/compact/top_defs.xml
@@ -10,11 +10,11 @@
   <constant name="CepC_Main_Crossing_Angle" value="33*mrad"/>
 
   <!-- the field inside and outside the solenoid -->
-  <constant name="outerField_nominal_value" value="-1.5*tesla"/>
+  <constant name="outerField_nominal_value" value="-1.33716*tesla"/>
 
 
   <!-- VXD -->
-  <constant name="top_VXD_inner_radius"   value="15.95*mm "/>
+  <constant name="top_VXD_inner_radius"   value="15*mm "/>
   <constant name="top_VXD_outer_radius"   value="101*mm "/>
   <constant name="top_VXD_half_length"    value="200*mm "/>
 
@@ -58,16 +58,17 @@
   <constant name="Ecal_EC_Ring_gap" value="10*mm"/>
 
   <!-- HCAL -->
-  <constant name="Hcal_barrel_thickness" value="1272.3*mm"/>
+  <constant name="Hcal_barrel_thickness" value="1086.43*mm"/>
   <constant name="Hcal_Coil_additional_gap" value="29.5*mm"/>
   <!--constant name="Hcal_outer_symmetry" value="16"/-->
   <constant name="Hcal_outer_symmetry" value="8"/>
 
   <constant name="Hcal_endcap_center_box_size" value="700.0*mm"/>
   <constant name="Hcal_endcap_zmin" value="2650*mm" />
-  <constant name="Hcal_endcap_thickness" value="1287.0*mm"/>
+  <constant name="Hcal_endcap_thickness" value="1084.2*mm"/>
   <constant name="Hcal_radial_ring_inner_gap" value="50*mm"/>
-  <constant name="Hcal_endcap_cryostat_gap" value="170*mm"/>
+  <constant name="Hcal_endcap_cryostat_gap" value="0*mm"/>
+  <constant name="Hcal_endcap_ecal_gap" value="15*mm"/>
 
   <!-- coil -->
   <constant name="Coil_extra_size" value="1522*mm"/>
diff --git a/Detector/DetCEPCv4/compact/tpc10_01.xml b/Detector/DetCEPCv4/compact/tpc10_01.xml
index aa769400e9d7e8abc95cc808e50da6d7c9971e63..539e06577a621ecf4a610af491c9d9c564a036c2 100644
--- a/Detector/DetCEPCv4/compact/tpc10_01.xml
+++ b/Detector/DetCEPCv4/compact/tpc10_01.xml
@@ -37,25 +37,25 @@
       <!-- SQL command: "SELECT * FROM `innerWall`;"  -->
       <innerWall>
 	<!-- updates from Dimitra 4/7/17 -->
-	<row dr="0.07*mm" material="G4_Cu"  />
+	<row dr="0.01*mm" material="G4_Al"  />
 	<row dr="0.05*mm" material="G4_KAPTON"  />
 	<row dr="0.3*mm" material="g10"  />
 	<row dr="24.22*mm" material="G4_AIR"  />
 	<row dr="0.3*mm" material="g10"  />
 	<row dr="0.05*mm" material="G4_KAPTON"  />
-	<row dr="0.01*mm" material="G4_Al"  />
+	<row dr="0.07*mm" material="G4_Cu"  />
       </innerWall>
       <!-- SQL command: "SELECT * FROM `outerWall`;"  -->
       <outerWall>
 	<!-- updates from Dimitra 4/7/17 --> <!--recover to tpc10_01 matching CEPC_v4, by fucd-->
-	<row dr="0.01*mm" material="G4_Al"  />
+	<row dr="0.07*mm" material="G4_Cu"  />
 	<row dr="0.05*mm" material="G4_KAPTON"  />
 	<row dr="0.3*mm" material="g10"  />
 	<!-- row dr="57.66*mm" material="G4_AIR"  / -->
 	<row dr="59.22*mm" material="G4_AIR"  /> <!-- removed 5 mm to accomadate fat ecal: to be finalised when numbers available -->
 	<row dr="0.3*mm" material="g10"  />
 	<row dr="0.05*mm" material="G4_KAPTON"  />
-	<row dr="0.07*mm" material="G4_Cu"  />
+	<row dr="0.01*mm" material="G4_Al"  />
       </outerWall>
       <!-- SQL command: "SELECT * FROM `readout`;"  -->
       <readout>
@@ -86,8 +86,7 @@
 
  <readouts>
     <readout name="TPCCollection">
-      <!-- fixme: for now DD4hep cannot handle signed values - side should actually be "-2" -->
-      <id>system:5,side:2,layer:9,module:8,sensor:8</id>
+      <id>system:5,side:-2,layer:9,module:8,sensor:8</id>
     </readout>
  </readouts>
 
diff --git a/Detector/DetCEPCv4/src/calorimeter/SEcal05_Barrel.cpp b/Detector/DetCEPCv4/src/calorimeter/SEcal05_Barrel.cpp
index 11104445600631b3e42ada1907e76389e1e3bfb0..ee42d87b617e7f9ab9df7329aa57442716007ee7 100644
--- a/Detector/DetCEPCv4/src/calorimeter/SEcal05_Barrel.cpp
+++ b/Detector/DetCEPCv4/src/calorimeter/SEcal05_Barrel.cpp
@@ -395,7 +395,7 @@ static Ref_t create_detector(Detector& theDetector, xml_h element, SensitiveDete
   //   end of slabs aligned to inner face of support plate in next stave (not the outer surface)
   // double Y = (module_thickness/2.) / sin(M_PI/4.);
   // double Y = (module_thickness_noSupport/2.) / sin(2.*M_PI/nsides);
-  double Y = (module_thickness/2.) / sin(2.*M_PI/nsides);
+  double Y = -(module_thickness/2.) / sin(2.*M_PI/nsides);
 
   // stave numbering from 1->8
   //   stave = 1 is in +ve x direction
@@ -422,7 +422,7 @@ static Ref_t create_detector(Detector& theDetector, xml_h element, SensitiveDete
 
     for (int imodule = 0; imodule < Ecal_barrel_z_modules; imodule++) {
       int module_id = imodule+1;
-      Transform3D tr( RotationZYX( 0 , phirot, M_PI/2.),  // magic rotation!
+      Transform3D tr( RotationZYX( M_PI , phirot, M_PI/2.),  // magic rotation!
                       Translation3D(
                                     ( X*cos(phirot2)-Y*sin(phirot2) ) ,
                                     ( X*sin(phirot2)+Y*cos(phirot2) ) ,
diff --git a/Detector/DetCEPCv4/src/calorimeter/SHcalRpc01_Barrel.cpp b/Detector/DetCEPCv4/src/calorimeter/SHcalRpc01_Barrel.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..9801a0a17418f93b03e46f8ea259be8f80e6ad6c
--- /dev/null
+++ b/Detector/DetCEPCv4/src/calorimeter/SHcalRpc01_Barrel.cpp
@@ -0,0 +1,333 @@
+//====================================================================
+//  SHcalRpc01 - Implementation from ILCSoft's Mokka version                              
+//====================================================================
+#include "DD4hep/DetFactoryHelper.h"
+#include "DD4hep/DD4hepUnits.h"
+#include "DD4hep/DetType.h"
+
+#include "DDRec/Surface.h"
+#include "DDRec/DetectorData.h"
+#include "XML/Utilities.h"
+
+using namespace std;
+
+using dd4hep::Ref_t;
+using dd4hep::BUILD_ENVELOPE;
+using dd4hep::DetElement;
+using dd4hep::Detector;
+using dd4hep::SensitiveDetector;
+using dd4hep::Segmentation;
+using dd4hep::Readout;
+using dd4hep::Material;
+using dd4hep::Volume;
+using dd4hep::PlacedVolume;
+using dd4hep::Position;
+using dd4hep::RotationZYX;
+using dd4hep::Transform3D;
+using dd4hep::Box;
+using dd4hep::Tube;
+using dd4hep::PolyhedraRegular;
+using dd4hep::SubtractionSolid;
+using dd4hep::_toString;
+using dd4hep::pi;
+using dd4hep::rec::LayeredCalorimeterData;
+
+/** Construction of SHcalRpc01 detector, ported from Mokka driver SHcalRpc01.cc
+ *
+ *  Mokka History:
+ * - first implementation from ILCSoft
+ * - http://cepcgit.ihep.ac.cn/cepcsoft/MokkaC
+ */
+static Ref_t create_detector(Detector& theDetector, xml_h element, SensitiveDetector sens)  {
+  cout << "--------------------------" << endl;
+  cout << "creating SHcalRpc01_Barrel" << endl;
+  cout << "--------------------------" << endl;
+
+  xml_det_t    x_det  = element;
+  string       name   = x_det.nameStr();
+  int          det_id = x_det.id();
+  DetElement   det(name, det_id);
+
+  Volume envelope = dd4hep::xml::createPlacedEnvelope(theDetector, element , det ) ;
+
+  dd4hep::xml::setDetectorTypeFlag(element, det) ;
+
+  if( theDetector.buildType() == BUILD_ENVELOPE ) return det ;
+
+  xml_comp_t    x_staves          = x_det.staves();
+  string   Hcal_radiator_material = x_staves.materialStr();
+  Material      stavesMaterial    = theDetector.material(Hcal_radiator_material);
+  Material      air               = theDetector.air();
+
+  sens.setType("calorimeter");
+
+  Readout readout = sens.readout();
+  Segmentation seg = readout.segmentation();
+
+  std::vector<double> cellSizeVector = seg.segmentation()->cellDimensions(0);
+  double cell_sizeX      = cellSizeVector[0];
+  double cell_sizeZ      = cellSizeVector[1];
+
+  double      Hcal_inner_radius   = theDetector.constant<double>("Hcal_inner_radius");
+  double      Hcal_outer_radius_set   = theDetector.constant<double>("Hcal_outer_radius");
+  double      Hcal_half_length    = theDetector.constant<double>("Hcal_half_length");
+  int         Hcal_inner_symmetry = theDetector.constant<int>("Hcal_inner_symmetry");
+  int         Hcal_outer_symmetry = 0;
+  double      Hcal_lateral_plate_thickness     = theDetector.constant<double>("Hcal_lateral_structure_thickness");
+  double      Hcal_modules_gap                 = theDetector.constant<double>("Hcal_modules_gap");
+  int         Hcal_nlayers                     = theDetector.constant<int>("Hcal_nlayers");
+  double      TPC_outer_radius               = theDetector.constant<double>("TPC_outer_radius");
+  double      Ecal_outer_radius               = theDetector.constant<double>("Ecal_outer_radius");
+  int Hcal_barrel_number_modules = theDetector.constant<int>("Hcal_barrel_number_modules");
+  
+  double hPrime =    Ecal_outer_radius + theDetector.constant<double>("Hcal_Ecal_gap");
+  Hcal_inner_radius = hPrime / cos(pi/8.);
+  
+  double Hcal_normal_dim_z = (2*Hcal_half_length - (Hcal_barrel_number_modules-1)*Hcal_modules_gap)/Hcal_barrel_number_modules;
+
+  xml_coll_t c(x_det,_U(layer));
+  xml_comp_t x_layer = c;
+
+  double Hcal_radiator_thickness = 0;
+  double layerThickness = 0.0;
+  for(xml_coll_t k(x_layer,_U(slice)); k; ++k)  {
+    xml_comp_t x_slice = k;
+    layerThickness += x_slice.thickness();
+    if(x_slice.materialStr()==Hcal_radiator_material) Hcal_radiator_thickness = x_slice.thickness();
+  }
+  cout << " layer_thickness (from slices) = " << layerThickness << " and radiator_thickness = " << Hcal_radiator_thickness << endl;
+  double Hcal_chamber_thickness = layerThickness - Hcal_radiator_thickness; 
+
+  int MinNumCellsInTransvPlane  = theDetector.constant<int>("Hcal_MinNumCellsInTransvPlane");
+  double RPC_EdgeWidth          = theDetector.constant<double>("Hcal_gas_edge_width");
+  double RPCGazInletInnerRadius = theDetector.constant<double>("Hcal_gasInlet_inner_radius");
+  double RPCGazInletOuterRadius = theDetector.constant<double>("Hcal_gasInlet_outer_radius");
+  double RPCGazInletLength      = theDetector.constant<double>("Hcal_gasInlet_length");
+  double RPC_PadSeparation      = theDetector.constant<double>("Hcal_pad_separation");
+  double Hcal_spacer_thickness  = theDetector.constant<double>("Hcal_spacer_thickness");
+  double Hcal_spacer_separation = theDetector.constant<double>("Hcal_spacer_separation");
+
+  //========== fill data for reconstruction ============================
+  LayeredCalorimeterData* caloData = new LayeredCalorimeterData ;
+  caloData->layoutType = LayeredCalorimeterData::BarrelLayout ;
+  caloData->inner_symmetry = Hcal_inner_symmetry  ;
+  caloData->outer_symmetry = Hcal_outer_symmetry  ;
+  caloData->phi0 = 0 ; // fg: also hardcoded below
+
+  // general calculated parameters
+  double AngleRatio=0.76536686;//"k"
+  double d_InnerOctoSize=AngleRatio*Hcal_inner_radius;//"d"
+  double LMin = 2*RPC_EdgeWidth+cell_sizeX*MinNumCellsInTransvPlane+(MinNumCellsInTransvPlane+1)*RPC_PadSeparation;
+
+  double Ynl = 0.5*d_InnerOctoSize - Hcal_nlayers*layerThickness;
+  double Hcal_outer_radius = sqrt((LMin-Ynl)*(LMin-Ynl) + (hPrime + Hcal_nlayers*layerThickness)*(hPrime + Hcal_nlayers*layerThickness));
+  if(Hcal_outer_radius!=Hcal_outer_radius_set){
+    cout << "calculated Hcal_outer_radius != input, will impact HcalEndcap and HcalEndcapRing. Hcal_outer_radius = " << Hcal_outer_radius
+	 << " but set as " << Hcal_outer_radius_set << " difference = " << Hcal_outer_radius-Hcal_outer_radius_set << endl;  
+  }
+
+  /// extent of the calorimeter in the r-z-plane [ rmin, rmax, zmin, zmax ] in cm.
+  caloData->extent[0] = Hcal_inner_radius ;
+  caloData->extent[1] = Hcal_outer_radius ;
+  caloData->extent[2] = 0. ; // Barrel zmin is "0" by default.
+  caloData->extent[3] = Hcal_half_length ;
+
+  double Hcal_total_dim_y = Hcal_outer_radius - hPrime;
+  
+  // the  y_dim1_for_z kept as the original value in TDR
+  double Hcal_regular_chamber_dim_z = Hcal_normal_dim_z - 2 *(Hcal_lateral_plate_thickness);
+  //int N_cells_z =  static_cast <int> ( (Hcal_regular_chamber_dim_z - 2*RPC_EdgeWidth - RPC_PadSeparation) / (Hcal_cell_dim_x + RPC_PadSeparation) );
+  //  Hcal_cell_dim_z=(Hcal_regular_chamber_dim_z-RPC_PadSeparation )/N_cells_z
+  //                      - RPC_PadSeparation;
+  Tube solidCaloTube(0, Hcal_outer_radius, Hcal_half_length);
+
+  PolyhedraRegular solidOctogon(8, 0, hPrime, 4*Hcal_half_length);
+  RotationZYX rotOctogon(dd4hep::twopi/16,0,0);
+  SubtractionSolid solidCalo(solidCaloTube, solidOctogon, rotOctogon);
+  Volume logicCalo(name+"_radiator", solidCalo, stavesMaterial);
+  logicCalo.setAttributes(theDetector,x_det.regionStr(),x_det.limitsStr(),x_det.visStr());
+  PlacedVolume calo_pv = envelope.placeVolume(logicCalo, Position(0,0,0));
+  DetElement calo(det, "envelope", det_id);
+  calo.setPlacement(calo_pv);
+
+  for(int layer_id=1; layer_id<=Hcal_nlayers; layer_id++){
+    double yn = sqrt(Hcal_outer_radius*Hcal_outer_radius - (hPrime + layer_id*layerThickness)*(hPrime + layer_id*layerThickness));
+    double Yn = 0.5*d_InnerOctoSize - layer_id*layerThickness;
+
+    double halfX = Hcal_chamber_thickness/2.;
+    double halfZ = (yn+Yn)/2.;
+    
+    LayeredCalorimeterData::Layer caloLayer ;
+    caloLayer.cellSize0 = cell_sizeX;
+    caloLayer.cellSize1 = cell_sizeZ;
+
+    //double halfY = Hcal_normal_dim_z / 2.;
+    double halfY = Hcal_regular_chamber_dim_z / 2.;
+
+    double localXPos = hPrime + Hcal_radiator_thickness + Hcal_chamber_thickness/2. + (layer_id-1)*layerThickness;
+    double localYPos = -Yn + 0.5*(Yn + yn);
+    Box chamberSolid(halfX, halfY, halfZ);
+    string chamberLogical_name      = name+_toString(layer_id,"_layer%d");
+    Volume chamberLogical(chamberLogical_name, chamberSolid, air);
+    chamberLogical.setAttributes(theDetector, x_layer.regionStr(), x_layer.limitsStr(), x_layer.visStr());
+
+    string layer_name      = name+_toString(layer_id,"_layer%d");
+
+    double nRadiationLengths=0.;
+    double nInteractionLengths=0.;
+    double thickness_sum=0;
+
+    nRadiationLengths   = Hcal_radiator_thickness/(stavesMaterial.radLength());
+    nInteractionLengths = Hcal_radiator_thickness/(stavesMaterial.intLength());
+
+    double slice_pos_z = -halfX;
+    int slice_number = 0;
+    for(xml_coll_t k(x_layer,_U(slice)); k; ++k)  {
+      xml_comp_t x_slice = k;
+      if(x_slice.materialStr()==Hcal_radiator_material) continue;
+      string   slice_name      = layer_name + _toString(slice_number,"_slice%d");
+      double   slice_thickness = x_slice.thickness();
+      Material slice_material  = theDetector.material(x_slice.materialStr());
+      if(layer_id==1) cout<<"  Layer_slice:  "<<  slice_name<<" slice_thickness:  "<< slice_thickness<< endl;
+      
+      slice_pos_z += slice_thickness/2.;
+      nRadiationLengths   += slice_thickness/(2.*slice_material.radLength());
+      nInteractionLengths += slice_thickness/(2.*slice_material.intLength());
+      thickness_sum       += slice_thickness/2;
+
+      // Slice volume & box
+      Box sliceSolid(slice_thickness/2., halfY, halfZ);
+      Volume sliceVol(slice_name, sliceSolid, slice_material);
+      
+      if ( x_slice.isSensitive() ) {
+	sliceVol.setSensitiveDetector(sens);
+	if(RPC_EdgeWidth>0){
+	  double RPC_GazInlet_In_Y  = halfY - RPC_EdgeWidth - RPCGazInletOuterRadius;
+	  double RPC_GazInlet_In_Z  = halfZ - RPC_EdgeWidth/2;
+	  double RPC_GazInlet_Out_Y = -RPC_GazInlet_In_Y;
+	  double RPC_GazInlet_Out_Z =  RPC_GazInlet_In_Z;
+
+	  string mateialName = x_slice.attr<string>(_Unicode(edge_material));
+	  Material edge_material = theDetector.material(mateialName);
+	  Box solidRPCEdge1(slice_thickness/2.,halfY, halfZ);
+	  Box solidRPCEdge2(slice_thickness/2.,halfY-RPC_EdgeWidth, halfZ-RPC_EdgeWidth);
+	  SubtractionSolid solidRPCEdge(solidRPCEdge1, solidRPCEdge2, Position(0,0,0));
+	  Volume logicRPCEdge(slice_name+"_edge", solidRPCEdge, edge_material);
+	  logicRPCEdge.setAttributes(theDetector,x_slice.regionStr(),x_slice.limitsStr(),x_slice.visStr());
+	  sliceVol.placeVolume(logicRPCEdge);
+
+	  Tube solidRPCGazInlet(RPCGazInletInnerRadius,RPCGazInletOuterRadius,RPC_EdgeWidth/*RPCGazInletLength*//2);
+	  Volume logicRPCGazInlet(slice_name+"_GazInlet", solidRPCGazInlet, edge_material);
+	  logicRPCGazInlet.setAttributes(theDetector,x_slice.regionStr(),x_slice.limitsStr(),x_slice.visStr());
+	  logicRPCEdge.placeVolume(logicRPCGazInlet, Position(0,RPC_GazInlet_In_Y,RPC_GazInlet_In_Z));
+	  logicRPCEdge.placeVolume(logicRPCGazInlet, Position(0,RPC_GazInlet_Out_Y,RPC_GazInlet_Out_Z));
+	  
+	  Tube solidRPCGazInsideInlet(0,RPCGazInletInnerRadius,RPC_EdgeWidth/*RPCGazInletLength*//2);
+	  Volume logicRPCGazInsideInlet(slice_name+"_GazInsideInlet", solidRPCGazInsideInlet, slice_material);
+	  logicRPCGazInsideInlet.setAttributes(theDetector,x_slice.regionStr(),x_slice.limitsStr(),"SeeThrough");
+	  logicRPCEdge.placeVolume(logicRPCGazInsideInlet, Position(0,RPC_GazInlet_In_Y,RPC_GazInlet_In_Z));
+	  logicRPCEdge.placeVolume(logicRPCGazInsideInlet, Position(0,RPC_GazInlet_Out_Y,RPC_GazInlet_Out_Z));
+	}
+	if(Hcal_spacer_thickness>0){
+	  Tube solidRPCSpacer(0,Hcal_spacer_thickness/2,slice_thickness/2);
+	  Material space_material = theDetector.material(x_slice.attr<string>(_Unicode(spacer_material)));
+	  Volume logicRPCSpacer(slice_name+"_spacer", solidRPCSpacer, space_material);
+	  logicRPCSpacer.setAttributes(theDetector,x_slice.regionStr(),x_slice.limitsStr(),x_slice.visStr());
+	  RotationZYX rotSpacer(0, pi/2., 0);
+	  
+	  double gap_hZ = halfZ-RPC_EdgeWidth;
+	  double gap_hY = halfY-RPC_EdgeWidth;
+	  int y_number_of_separations = (int)(2*gap_hY/Hcal_spacer_separation);
+	  int z_number_of_separations = (int)(2*gap_hZ/Hcal_spacer_separation);
+	  double y_lateral_space = (2*gap_hY - y_number_of_separations*Hcal_spacer_separation)/2;
+	  double z_lateral_space = (2*gap_hZ - z_number_of_separations*Hcal_spacer_separation)/2;
+	  if(y_lateral_space < Hcal_spacer_thickness/2.){
+	    y_number_of_separations = (int)((2*gap_hY-Hcal_spacer_thickness)/Hcal_spacer_separation);
+	    y_lateral_space = (2*gap_hY - y_number_of_separations*Hcal_spacer_separation)/2;
+	  }
+	  if(z_lateral_space < Hcal_spacer_thickness/2.){
+	    z_number_of_separations = (int)((2*gap_hZ-Hcal_spacer_thickness)/Hcal_spacer_separation);
+	    z_lateral_space = (2*gap_hZ - z_number_of_separations*Hcal_spacer_separation)/2;
+	  }
+	  for(int y_counter = 0; y_counter <=y_number_of_separations; y_counter++){
+	    double SpacerY = gap_hY - y_lateral_space - y_counter*Hcal_spacer_separation;
+	    for(int z_counter = 0; z_counter <=z_number_of_separations; z_counter++){
+	      double SpacerZ = gap_hZ - z_lateral_space - z_counter*Hcal_spacer_separation;
+	      PlacedVolume space_pv = sliceVol.placeVolume(logicRPCSpacer, Transform3D(rotSpacer, Position(0,SpacerY,SpacerZ)));
+	    }
+	  }
+	}
+
+	caloLayer.inner_nRadiationLengths = nRadiationLengths;
+	caloLayer.inner_nInteractionLengths = nInteractionLengths;
+	caloLayer.inner_thickness = thickness_sum;
+	if(layer_id==1) cout<<"Hcal_Barrel:  inner_thickness= "<<thickness_sum<<endl;
+        //Store readout gasgap thickness
+	caloLayer.sensitive_thickness = slice_thickness;
+        //Reset counters to measure "outside" quantitites
+	nRadiationLengths=0.;
+	nInteractionLengths=0.;
+	thickness_sum = 0.;
+	
+	sliceVol.setAttributes(theDetector,x_slice.regionStr(),x_slice.limitsStr(),"SeeThrough");
+      }
+      else{
+	sliceVol.setAttributes(theDetector,x_slice.regionStr(),x_slice.limitsStr(),x_slice.visStr());
+      }
+      nRadiationLengths += slice_thickness/(2.*slice_material.radLength());
+      nInteractionLengths += slice_thickness/(2.*slice_material.intLength());
+      thickness_sum += slice_thickness/2;
+
+      // slice PlacedVolume
+      PlacedVolume slice_phv = chamberLogical.placeVolume(sliceVol,Position(slice_pos_z,0,0));
+      if ( x_slice.isSensitive() ) {
+	int slice_id  = (layer_id > Hcal_nlayers)? 1:-1;
+	slice_phv.addPhysVolID("layer",layer_id).addPhysVolID("slice",slice_id);
+      }
+      DetElement sliceDetE(layer_name,_toString(slice_number,"slice%d"),x_det.id());
+      sliceDetE.setPlacement(slice_phv);
+      // Increment x position for next slice.
+      slice_pos_z += slice_thickness/2.;
+      // Increment slice number.
+      ++slice_number;
+    }
+    caloLayer.outer_nRadiationLengths = nRadiationLengths;
+    caloLayer.outer_nInteractionLengths = nInteractionLengths;
+    caloLayer.outer_thickness = thickness_sum;
+    if(layer_id==1) cout << "Hcal_Barrel:  outer_thickness= " << thickness_sum << endl;
+    
+    double chamber_y_offset = -(-Hcal_total_dim_y/2. + (layer_id-1)*layerThickness + layerThickness/2.);
+
+    caloLayer.distance = Hcal_inner_radius + Hcal_total_dim_y/2.0 + chamber_y_offset ;
+    caloLayer.absorberThickness = Hcal_radiator_thickness ;
+
+    caloData->layers.push_back( caloLayer ) ;
+    
+    double stave_phi_offset, module_z_offset;
+    
+    stave_phi_offset = pi*0.5;
+    for(int stave_id = 1; stave_id <= 8; stave_id++){
+      double phirot = stave_phi_offset+(stave_id-1)*pi/4.;
+
+      RotationZYX rot(0, phirot, pi*0.5);
+      RotationZYX rotInverse(0,-phirot, -pi*0.5);
+      for(int module_id = 1; module_id <= Hcal_barrel_number_modules; module_id++){
+        module_z_offset = - Hcal_half_length + Hcal_normal_dim_z/2. + (module_id-1)*(Hcal_normal_dim_z+Hcal_modules_gap);
+	
+        Position localPos(localXPos,-module_z_offset,localYPos);
+        Position newPos = rotInverse*localPos;
+	Transform3D tran3D(rot, newPos);
+	PlacedVolume pv = logicCalo.placeVolume(chamberLogical, tran3D);
+	pv.addPhysVolID("stave",stave_id).addPhysVolID("module",module_id).addPhysVolID("layer",layer_id);
+	DetElement layer(calo, name+_toString(stave_id,"_stave%d")+_toString(module_id,"_module%d")+_toString(layer_id,"_layer%d"), det_id);
+	layer.setPlacement(pv);
+      }
+    }
+  }
+
+  det.addExtension< LayeredCalorimeterData >( caloData ) ;
+
+  return det;
+}
+
+DECLARE_DETELEMENT(SHcalRpc01_Barrel, create_detector)
diff --git a/Detector/DetCEPCv4/src/calorimeter/SHcalRpc01_EndcapRing.cpp b/Detector/DetCEPCv4/src/calorimeter/SHcalRpc01_EndcapRing.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..3a9978cc85833ad6807f55cbaae2fd9d74d3656d
--- /dev/null
+++ b/Detector/DetCEPCv4/src/calorimeter/SHcalRpc01_EndcapRing.cpp
@@ -0,0 +1,266 @@
+//====================================================================
+//  SHcalRpc01 - Implementation from ILCSoft's Mokka version                              
+//====================================================================
+#include "DD4hep/DetFactoryHelper.h"
+#include "DD4hep/DD4hepUnits.h"
+#include "DD4hep/DetType.h"
+
+#include "DDRec/Surface.h"
+#include "DDRec/DetectorData.h"
+#include "XML/Utilities.h"
+
+using namespace std;
+
+using dd4hep::Ref_t;
+using dd4hep::BUILD_ENVELOPE;
+using dd4hep::DetElement;
+using dd4hep::Detector;
+using dd4hep::SensitiveDetector;
+using dd4hep::Segmentation;
+using dd4hep::Readout;
+using dd4hep::Material;
+using dd4hep::Volume;
+using dd4hep::PlacedVolume;
+using dd4hep::Position;
+using dd4hep::RotationZYX;
+using dd4hep::Transform3D;
+using dd4hep::Box;
+using dd4hep::Tube;
+using dd4hep::PolyhedraRegular;
+using dd4hep::SubtractionSolid;
+using dd4hep::IntersectionSolid;
+using dd4hep::_toString;
+using dd4hep::pi;
+using dd4hep::rec::LayeredCalorimeterData;
+
+/** Construction of SHcalRpc01 detector, ported from Mokka driver SHcalRpc01.cc
+ *
+ *  Mokka History:
+ * - first implementation from ILCSoft
+ * - http://cepcgit.ihep.ac.cn/cepcsoft/MokkaC
+ */
+static Ref_t create_detector(Detector& theDetector, xml_h element, SensitiveDetector sens)  {
+  cout << "------------------------------" << endl;
+  cout << "creating SHcalRpc01_EndcapRing" << endl;
+  cout << "------------------------------" << endl;
+
+  xml_det_t    x_det = element;
+  string       name  = x_det.nameStr();
+  
+  int          det_id    = x_det.id();
+  DetElement   det(name, det_id) ;
+  
+  xml_comp_t    x_staves          = x_det.staves();
+  string   Hcal_radiator_material = x_staves.materialStr();
+  Material      stavesMaterial    = theDetector.material(Hcal_radiator_material);
+  Material      air               = theDetector.air();
+
+  Volume envelope = dd4hep::xml::createPlacedEnvelope( theDetector,  element , det ) ;
+
+  dd4hep::xml::setDetectorTypeFlag( element, det ) ;
+
+  if( theDetector.buildType() == BUILD_ENVELOPE ) return det ;
+
+  sens.setType("calorimeter");
+
+  DetElement module(det,"module0",det_id);
+  DetElement layer(module, "stave_layer", det_id);
+  DetElement slice(layer, "slice", det_id);
+
+  Readout readout = sens.readout();
+  Segmentation seg = readout.segmentation();
+  
+  std::vector<double> cellSizeVector = seg.segmentation()->cellDimensions(0);
+  double cell_sizeX      = cellSizeVector[0];
+  double cell_sizeY      = cellSizeVector[1];
+
+  double Hcal_outer_radius            = theDetector.constant<double>("Hcal_outer_radius");
+  int    Hcal_endcap_outer_symmetry   = theDetector.constant<int>("Hcal_endcap_outer_symmetry");
+  double Hcal_stave_gaps              = theDetector.constant<double>("Hcal_stave_gaps");
+  int    Hcal_nlayers                 = theDetector.constant<int>("Hcal_endcap_nlayers");
+  double Hcal_start_z                 = theDetector.constant<double>("Hcal_endcap_zmin");
+  double Hcal_lateral_plate_thickness = theDetector.constant<double>("Hcal_lateral_structure_thickness");
+  double Ecal_endcap_zmin             = theDetector.constant<double>("Ecal_endcap_zmin");
+  double Hcal_endcap_ecal_gap         = theDetector.constant<double>("Hcal_endcap_ecal_gap");
+  double Ecal_endcap_outer_radius     = theDetector.constant<double>("EcalEndcap_outer_radius");
+  double Hcal_radial_ring_inner_gap   = theDetector.constant<double>("Hcal_radial_ring_inner_gap");
+
+  xml_coll_t c(x_det,_U(layer));
+  xml_comp_t x_layer = c;
+
+  double Hcal_radiator_thickness = 0;
+  double layerThickness = 0.0;
+  for(xml_coll_t k(x_layer,_U(slice)); k; ++k)  {
+    xml_comp_t x_slice = k;
+    layerThickness += x_slice.thickness();
+    if(x_slice.materialStr()==Hcal_radiator_material) Hcal_radiator_thickness = x_slice.thickness();
+  }
+  cout << " layer_thickness (from slices) = " << layerThickness << " and radiator_thickness = " << Hcal_radiator_thickness << endl;
+  double Hcal_chamber_thickness = layerThickness - Hcal_radiator_thickness;
+
+  int numSide = Hcal_endcap_outer_symmetry;
+  double Hcal_endcap_rmax = Hcal_outer_radius * cos(pi/numSide);
+
+  LayeredCalorimeterData* caloData = new LayeredCalorimeterData ;
+  caloData->layoutType = LayeredCalorimeterData::EndcapLayout ;
+  caloData->inner_symmetry = numSide;
+  caloData->outer_symmetry = numSide;
+  caloData->phi0           = 0;
+  
+  double start_z        = Ecal_endcap_zmin;
+  double SpaceForLayers = Hcal_start_z - Hcal_endcap_ecal_gap - Ecal_endcap_zmin - 2*Hcal_lateral_plate_thickness;
+  int MaxNumberOfLayers = (int)(SpaceForLayers / (Hcal_chamber_thickness + Hcal_radiator_thickness));
+  double stop_z         = start_z + MaxNumberOfLayers*layerThickness + 2*Hcal_lateral_plate_thickness;
+
+  double pRMax = Hcal_endcap_rmax;
+  double pDz   = (stop_z - start_z)/2.;
+  double pRMin = Ecal_endcap_outer_radius + Hcal_radial_ring_inner_gap;
+
+  cout << "Rings will have " << MaxNumberOfLayers << " layers." << endl;
+  cout << " Z: " << start_z << " -> " << stop_z << endl;
+  cout << " R: " << pRMin   << " -> " << pRMax  << endl;
+
+  caloData->extent[0] = pRMin;
+  caloData->extent[1] = pRMax;
+  caloData->extent[2] = start_z;
+  caloData->extent[3] = stop_z;
+  
+  PolyhedraRegular EndCapRingSolidPoly(numSide, -pi/numSide, pRMin, pRMax, 2*pDz);
+  Volume EndCapRingLogical(name+"_radiator", EndCapRingSolidPoly, stavesMaterial);
+  EndCapRingLogical.setAttributes(theDetector,x_staves.regionStr(),x_staves.limitsStr(),x_staves.visStr());
+
+  int number_of_chambers = Hcal_nlayers;
+  if(MaxNumberOfLayers < number_of_chambers) number_of_chambers = MaxNumberOfLayers;
+  
+  double rInner = pRMin + Hcal_lateral_plate_thickness;
+  double rOuter = pRMax - Hcal_lateral_plate_thickness;
+  
+  PolyhedraRegular EndCapRingChamberPoly(numSide, -pi/numSide, rInner, rOuter, Hcal_chamber_thickness);
+  Box IntersectionStaveBox(rOuter/2., rOuter/2., Hcal_chamber_thickness/2);
+  Position IntersectPos(rOuter/2. + Hcal_stave_gaps/2., rOuter/2. + Hcal_stave_gaps/2., 0.);
+  IntersectionSolid  EndCapRingStaveSolid(EndCapRingChamberPoly, IntersectionStaveBox, IntersectPos);
+  Volume EndCapRingChamberLogical(name+"_chamber", EndCapRingStaveSolid, air);
+  EndCapRingChamberLogical.setAttributes(theDetector,x_layer.regionStr(),x_layer.limitsStr(),x_layer.visStr());
+  
+  double nRadiationLengthsInside=0.;
+  double nInteractionLengthsInside=0.;
+  double inner_thickness=0;
+  double sensitive_thickness=0;
+  double nRadiationLengths=0.;
+  double nInteractionLengths=0.;
+  double thickness_sum=0;
+
+  double slice_pos_z = -Hcal_chamber_thickness/2.;
+  int slice_number = 0;
+  for(xml_coll_t k(x_layer,_U(slice)); k; ++k)  {
+    xml_comp_t x_slice = k;
+    string   slice_name      = name + _toString(slice_number,"_slice%d");
+    double   slice_thickness = x_slice.thickness();
+    Material slice_material  = theDetector.material(x_slice.materialStr());
+    cout<<"  Layer_slice:  " <<  slice_name << " slice_thickness:  " << slice_thickness<< endl;
+
+    nRadiationLengths   += slice_thickness/(2.*slice_material.radLength());
+    nInteractionLengths += slice_thickness/(2.*slice_material.intLength());
+    thickness_sum       += slice_thickness/2;
+    if(x_slice.materialStr()==Hcal_radiator_material) continue;
+
+    slice_pos_z += slice_thickness/2.;
+
+    PolyhedraRegular slicePoly(numSide, -pi/numSide, rInner, rOuter, slice_thickness);
+    IntersectionSolid sliceStaveSolid(slicePoly, IntersectionStaveBox, IntersectPos);
+    Volume sliceVol(name + _toString(slice_number,"_slice%d"), sliceStaveSolid, slice_material);
+    sliceVol.setAttributes(theDetector,x_slice.regionStr(),x_slice.limitsStr(),x_slice.visStr());
+    if(x_slice.isSensitive()){
+      sliceVol.setSensitiveDetector(sens);
+      nRadiationLengthsInside   = nRadiationLengths;
+      nInteractionLengthsInside = nInteractionLengths;
+      inner_thickness           = thickness_sum;
+      sensitive_thickness       = slice_thickness;
+      
+      nRadiationLengths=0.;
+      nInteractionLengths=0.;
+      thickness_sum = 0.;
+    }
+
+    nRadiationLengths   += slice_thickness/(2.*slice_material.radLength());
+    nInteractionLengths += slice_thickness/(2.*slice_material.intLength());
+    thickness_sum       += slice_thickness/2;
+    // slice PlacedVolume
+    PlacedVolume slice_phv = EndCapRingChamberLogical.placeVolume(sliceVol,Position(0,0,slice_pos_z));
+    //DetElement slice(layer_name,_toString(slice_number,"slice%d"),x_det.id());
+    slice.setPlacement(slice_phv);
+    // Increment x position for next slice.
+    slice_pos_z += slice_thickness/2.;
+    // Increment slice number.
+    ++slice_number;
+  }
+  
+  // chamber placements
+  for(int stave_id = 1; stave_id <= 4; stave_id++){
+    double angle = pi/2.*(stave_id-1);
+    RotationZYX lrot(angle,0,0);
+    for (int layer_id = 1; layer_id <= number_of_chambers; layer_id++){
+      double Zoff = -pDz + (layer_id-1)*layerThickness + Hcal_radiator_thickness + Hcal_chamber_thickness/2.;
+      Position l_pos(0., 0., Zoff);
+      Position l_new = lrot*l_pos;
+      Transform3D ltran3D(lrot,l_new);
+      PlacedVolume layer_phv = EndCapRingLogical.placeVolume(EndCapRingChamberLogical, ltran3D);
+      layer_phv.addPhysVolID("layer",layer_id);
+      layer_phv.addPhysVolID("stave",stave_id);
+      
+      //string l_name = _toString(layer_id,"layer%d");
+      //string stave_name = _toString(stave_id,"stave%d");
+      //DetElement layer(module_det, l_name+stave_name, det_id);
+      layer.setPlacement(layer_phv);
+
+      if(stave_id==1&&layer_id==1){
+	cout << "Hcal_EndcapRing:  inner_thickness= " << inner_thickness << endl;
+	cout << "Hcal_EndcapRing:  outer_thickness= " << thickness_sum << endl;
+      }
+      LayeredCalorimeterData::Layer caloLayer ;
+      caloLayer.cellSize0 = cell_sizeX;
+      caloLayer.cellSize1 = cell_sizeY;
+      caloLayer.inner_nRadiationLengths   = nRadiationLengthsInside;
+      caloLayer.inner_nInteractionLengths = nInteractionLengthsInside;
+      caloLayer.inner_thickness           = inner_thickness;
+      caloLayer.sensitive_thickness       = sensitive_thickness;
+      caloLayer.outer_nRadiationLengths   = nRadiationLengths;
+      caloLayer.outer_nInteractionLengths = nInteractionLengths;
+      caloLayer.outer_thickness           = thickness_sum;
+      
+      caloLayer.distance = start_z + (layer_id-1)*layerThickness;
+      caloLayer.absorberThickness = Hcal_radiator_thickness ;
+      
+      caloData->layers.push_back( caloLayer ) ;
+    }
+  }
+  
+  // Placements
+  double endcap_z_offset = start_z + pDz;
+  for(int side = 0; side <= 1; side++){
+    int module_id = (side==0) ? 0 : 6;
+    double this_module_z_offset = (side==0) ? endcap_z_offset : -endcap_z_offset;
+    // use reflect volume for z<0, therefore, same rotation
+    // segmentation violation happen if EndCapRingLogical.reflect(), back to rotate Y
+    // double this_module_rotY = (side==0) ? 0.0 : 0.0;
+    double this_module_rotY = (side==0) ? 0.0 : pi;
+    //double this_module_rotZ = (side==0) ? pi/8. : pi/8;
+    RotationZYX rot(0,this_module_rotY,0);
+    Transform3D tran3D(rot,Position(0,0,this_module_z_offset));
+    
+    PlacedVolume module_phv;
+    //if(side==0) module_phv = envelope.placeVolume(EndCapRingLogical, tran3D);
+    //else        module_phv = envelope.placeVolume(EndCapRingLogical.reflect(), tran3D);
+    module_phv = envelope.placeVolume(EndCapRingLogical, tran3D);
+    
+    module_phv.addPhysVolID("module", module_id);
+    //DetElement sd = (module_id==0) ? module_det : module_det.clone(_toString(side,"module%d"));
+    module.setPlacement(module_phv);
+  }
+
+  det.addExtension<LayeredCalorimeterData>(caloData) ;
+
+  return det;
+}
+
+DECLARE_DETELEMENT(SHcalRpc01_EndcapRing, create_detector)
diff --git a/Detector/DetCEPCv4/src/calorimeter/SHcalRpc01_Endcaps.cpp b/Detector/DetCEPCv4/src/calorimeter/SHcalRpc01_Endcaps.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..abe42b6588278d3ba043656bd109f89922693527
--- /dev/null
+++ b/Detector/DetCEPCv4/src/calorimeter/SHcalRpc01_Endcaps.cpp
@@ -0,0 +1,269 @@
+//====================================================================
+//  SHcalRpc01 - Implementation from ILCSoft's Mokka version                              
+//====================================================================
+#include "DD4hep/DetFactoryHelper.h"
+#include "DD4hep/DD4hepUnits.h"
+#include "DD4hep/DetType.h"
+
+#include "DDRec/Surface.h"
+#include "DDRec/DetectorData.h"
+#include "XML/Utilities.h"
+
+using namespace std;
+
+using dd4hep::Ref_t;
+using dd4hep::BUILD_ENVELOPE;
+using dd4hep::DetElement;
+using dd4hep::Detector;
+using dd4hep::SensitiveDetector;
+using dd4hep::Segmentation;
+using dd4hep::Readout;
+using dd4hep::Material;
+using dd4hep::Volume;
+using dd4hep::PlacedVolume;
+using dd4hep::Position;
+using dd4hep::RotationZYX;
+using dd4hep::Transform3D;
+using dd4hep::Box;
+using dd4hep::Tube;
+using dd4hep::PolyhedraRegular;
+using dd4hep::SubtractionSolid;
+using dd4hep::IntersectionSolid;
+using dd4hep::_toString;
+using dd4hep::pi;
+using dd4hep::rec::LayeredCalorimeterData;
+
+/** Construction of SHcalRpc01 detector, ported from Mokka driver SHcalRpc01.cc
+ *
+ *  Mokka History:
+ * - first implementation from ILCSoft
+ * - http://cepcgit.ihep.ac.cn/cepcsoft/MokkaC
+ */
+static Ref_t create_detector(Detector& theDetector, xml_h element, SensitiveDetector sens)  {
+  cout << "--------------------------" << endl;
+  cout << "creating SHcalRpc01_Endcap" << endl;
+  cout << "--------------------------" << endl;
+
+  xml_det_t    x_det = element;
+  string       name  = x_det.nameStr();
+  
+  int          det_id    = x_det.id();
+  DetElement   det(name, det_id) ;
+  
+  xml_comp_t    x_staves          = x_det.staves();
+  string   Hcal_radiator_material = x_staves.materialStr();
+  Material      stavesMaterial    = theDetector.material(Hcal_radiator_material);
+  Material      air               = theDetector.air();
+
+  Volume envelope = dd4hep::xml::createPlacedEnvelope( theDetector,  element , det ) ;
+
+  dd4hep::xml::setDetectorTypeFlag( element, det ) ;
+
+  if( theDetector.buildType() == BUILD_ENVELOPE ) return det ;
+
+  sens.setType("calorimeter");
+
+  DetElement module(det,"module0",det_id);
+  DetElement layer(module, "stave_layer", det_id);
+  DetElement slice(layer, "slice", det_id);
+
+  Readout readout = sens.readout();
+  Segmentation seg = readout.segmentation();
+
+  std::vector<double> cellSizeVector = seg.segmentation()->cellDimensions(0);
+  double cell_sizeX      = cellSizeVector[0];
+  double cell_sizeY      = cellSizeVector[1];
+
+  //double      Hcal_inner_radius   = theDetector.constant<double>("Hcal_inner_radius");
+  double Hcal_outer_radius            = theDetector.constant<double>("Hcal_outer_radius");
+  //double      Hcal_half_length    = theDetector.constant<double>("Hcal_half_length");
+  int    Hcal_endcap_outer_symmetry   = theDetector.constant<int>("Hcal_endcap_outer_symmetry");
+  //double      Hcal_cells_size                  = theDetector.constant<double>("Hcal_cells_size");
+  double Hcal_stave_gaps              = theDetector.constant<double>("Hcal_stave_gaps");
+  int    Hcal_nlayers                 = theDetector.constant<int>("Hcal_endcap_nlayers");
+  double Hcal_start_z                 = theDetector.constant<double>("Hcal_endcap_zmin");
+  double Hcal_back_plate_thickness    = theDetector.constant<double>("Hcal_back_plate_thickness");
+  double Hcal_lateral_plate_thickness = theDetector.constant<double>("Hcal_lateral_structure_thickness");
+  double Hcal_endcap_center_box_size  = theDetector.constant<double>("Hcal_endcap_center_box_size");
+  
+  xml_coll_t c(x_det,_U(layer));
+  xml_comp_t x_layer = c;
+
+  double Hcal_radiator_thickness = 0;
+  double layerThickness = 0.0;
+  for(xml_coll_t k(x_layer,_U(slice)); k; ++k)  {
+    xml_comp_t x_slice = k;
+    layerThickness += x_slice.thickness();
+    if(x_slice.materialStr()==Hcal_radiator_material) Hcal_radiator_thickness = x_slice.thickness();
+  }
+  cout << " layer_thickness (from slices) = " << layerThickness << " and radiator_thickness = " << Hcal_radiator_thickness << endl;
+  double Hcal_chamber_thickness = layerThickness - Hcal_radiator_thickness;
+
+  int numSide = Hcal_endcap_outer_symmetry;
+  double Hcal_endcap_thickness = Hcal_nlayers*layerThickness + Hcal_back_plate_thickness;
+  double Hcal_endcap_rmax = Hcal_outer_radius * cos(pi/numSide);
+
+  LayeredCalorimeterData* caloData = new LayeredCalorimeterData;
+  caloData->layoutType = LayeredCalorimeterData::EndcapLayout;
+  caloData->inner_symmetry = 4;
+  caloData->outer_symmetry = Hcal_endcap_outer_symmetry;
+  caloData->phi0           = 0;
+
+  caloData->extent[0] = Hcal_endcap_center_box_size/2.;
+  caloData->extent[1] = Hcal_outer_radius;
+  caloData->extent[2] = Hcal_start_z;
+  caloData->extent[3] = Hcal_start_z+Hcal_endcap_thickness;
+
+  double pRMax = Hcal_endcap_rmax;
+  double pDz   = Hcal_endcap_thickness/2.;
+  double pRMin = Hcal_endcap_center_box_size/2.;
+  
+  PolyhedraRegular EndCapSolidPoly(numSide, -pi/numSide, 0., pRMax, 2*pDz);
+  Box hcalECInnerHole(pRMin, pRMin, pDz);
+  SubtractionSolid solidHCalEC(EndCapSolidPoly,hcalECInnerHole);
+  Volume EndCapLogical(name+"_radiator", solidHCalEC, stavesMaterial);
+  EndCapLogical.setAttributes(theDetector,x_staves.regionStr(),x_staves.limitsStr(),x_staves.visStr());
+
+  int number_of_chambers = Hcal_nlayers;
+  int possible_number_of_chambers = (int) (floor(abs(Hcal_endcap_thickness-Hcal_back_plate_thickness) / (Hcal_chamber_thickness + Hcal_radiator_thickness)));
+  if(possible_number_of_chambers < number_of_chambers) number_of_chambers = possible_number_of_chambers;
+  
+  double rInner = 0.;
+  double rOuter= Hcal_endcap_rmax - Hcal_lateral_plate_thickness;
+  
+  PolyhedraRegular EndCapChamberPoly(numSide, -pi/numSide, rInner, rOuter, Hcal_chamber_thickness);
+  Box hcalECChamberInnerHole(pRMin + Hcal_lateral_plate_thickness, pRMin + Hcal_lateral_plate_thickness, Hcal_chamber_thickness/2);
+  SubtractionSolid EndCapChamberSolid(EndCapChamberPoly, hcalECChamberInnerHole);
+  Box IntersectionStaveBox(rOuter/2., rOuter/2., Hcal_chamber_thickness/2);
+  Position pos(rOuter/2. + Hcal_stave_gaps/2., rOuter/2. + Hcal_stave_gaps/2., 0.);
+  Position IntersectPos = pos;
+  IntersectionSolid  EndCapStaveSolid(EndCapChamberSolid, IntersectionStaveBox, IntersectPos);
+  Volume EndCapChamberLogical(name+"_chamber", EndCapStaveSolid, air);
+  EndCapChamberLogical.setAttributes(theDetector,x_layer.regionStr(),x_layer.limitsStr(),x_layer.visStr());
+
+  double nRadiationLengthsInside=0.;
+  double nInteractionLengthsInside=0.;
+  double inner_thickness=0;
+  double sensitive_thickness=0;
+  double nRadiationLengths=0.;
+  double nInteractionLengths=0.;
+  double thickness_sum=0;
+
+  double slice_pos_z = -Hcal_chamber_thickness/2.;
+  int slice_number = 0;
+  for(xml_coll_t k(x_layer,_U(slice)); k; ++k)  {
+    xml_comp_t x_slice = k;
+    string   slice_name      = name + _toString(slice_number,"_slice%d");
+    double   slice_thickness = x_slice.thickness();
+    Material slice_material  = theDetector.material(x_slice.materialStr());
+    cout<<"  Layer_slice:  " <<  slice_name << " slice_thickness:  " << slice_thickness<< endl;
+
+    nRadiationLengths   += slice_thickness/(2.*slice_material.radLength());
+    nInteractionLengths += slice_thickness/(2.*slice_material.intLength());
+    thickness_sum       += slice_thickness/2;
+    if(x_slice.materialStr()==Hcal_radiator_material) continue;
+
+    slice_pos_z += slice_thickness/2.;
+
+    PolyhedraRegular slicePoly(numSide, -pi/numSide, rInner, rOuter, slice_thickness);
+    SubtractionSolid sliceSolid(slicePoly, hcalECChamberInnerHole);
+    IntersectionSolid sliceStaveSolid(sliceSolid, IntersectionStaveBox, IntersectPos);
+
+    Volume sliceVol(name + _toString(slice_number,"_slice%d"), sliceStaveSolid, slice_material);
+    sliceVol.setAttributes(theDetector,x_slice.regionStr(),x_slice.limitsStr(),x_slice.visStr());
+    if(x_slice.isSensitive()){
+      sliceVol.setSensitiveDetector(sens);
+      nRadiationLengthsInside = nRadiationLengths;
+      nInteractionLengthsInside = nInteractionLengths;
+      inner_thickness = thickness_sum;
+      sensitive_thickness = slice_thickness;
+      
+      nRadiationLengths=0.;
+      nInteractionLengths=0.;
+      thickness_sum = 0.;
+    }
+
+    nRadiationLengths   += slice_thickness/(2.*slice_material.radLength());
+    nInteractionLengths += slice_thickness/(2.*slice_material.intLength());
+    thickness_sum       += slice_thickness/2;
+    // slice PlacedVolume
+    PlacedVolume slice_phv = EndCapChamberLogical.placeVolume(sliceVol,Position(0,0,slice_pos_z));
+    //DetElement slice(layer_name,_toString(slice_number,"slice%d"),x_det.id());
+    slice.setPlacement(slice_phv);
+    // Increment x position for next slice.
+    slice_pos_z += slice_thickness/2.;
+    // Increment slice number.
+    ++slice_number;
+  }
+
+  if(possible_number_of_chambers < number_of_chambers) number_of_chambers = possible_number_of_chambers;
+  // chamber placements
+  for(int stave_id = 1; stave_id <= 4; stave_id++){
+    double angle = pi/2.*(stave_id-1);
+    //RotationZ lrotz(angle);
+    RotationZYX lrot(angle,0,0);
+    for (int layer_id = 1; layer_id <= number_of_chambers; layer_id++){
+      double Zoff = -Hcal_endcap_thickness/2. + (layer_id-1) *(Hcal_chamber_thickness + Hcal_radiator_thickness) + Hcal_radiator_thickness + Hcal_chamber_thickness/2.;
+      Position l_pos(0., 0., Zoff);
+      Position l_new = lrot*l_pos;
+      Transform3D ltran3D(lrot,l_new);
+      PlacedVolume layer_phv = EndCapLogical.placeVolume(EndCapChamberLogical, ltran3D);
+      layer_phv.addPhysVolID("layer",layer_id);
+      layer_phv.addPhysVolID("stave",stave_id);
+      
+      //string l_name = _toString(layer_id,"layer%d");
+      //string stave_name = _toString(stave_id,"stave%d");
+      //DetElement layer(module_det, l_name+stave_name, det_id);
+      layer.setPlacement(layer_phv);
+
+      if(stave_id==1&&layer_id==1){
+	cout << "Hcal_Endcap:  inner_thickness= " << inner_thickness << endl;
+	cout << "Hcal_Endcap:  outer_thickness= " << thickness_sum << endl;
+      }
+      LayeredCalorimeterData::Layer caloLayer ;
+      caloLayer.cellSize0 = cell_sizeX;
+      caloLayer.cellSize1 = cell_sizeY;
+      caloLayer.inner_nRadiationLengths = nRadiationLengthsInside;
+      caloLayer.inner_nInteractionLengths = nInteractionLengthsInside;
+      caloLayer.inner_thickness = inner_thickness;
+      caloLayer.sensitive_thickness = sensitive_thickness;
+      caloLayer.outer_nRadiationLengths = nRadiationLengths;
+      caloLayer.outer_nInteractionLengths = nInteractionLengths;
+      caloLayer.outer_thickness = thickness_sum;
+      
+      caloLayer.distance = Hcal_start_z + (layer_id-1)*layerThickness;
+      caloLayer.absorberThickness = Hcal_radiator_thickness ;
+      
+      caloData->layers.push_back( caloLayer ) ;
+    }
+  }
+  
+  // Placements
+  double endcap_z_offset = Hcal_start_z + Hcal_endcap_thickness/2.;
+  for(int side = 0; side <= 1; side++){
+    int module_id = (side==0) ? 0 : 6;
+    double this_module_z_offset = (side==0) ? endcap_z_offset : -endcap_z_offset;
+    // use reflect volume for z<0, therefore, same rotation
+    // segmentation violation happen if EndCapRingLogical.reflect(), back to rotate Y
+    // double this_module_rotY = (side==0) ? 0.0 : 0.0;
+    double this_module_rotY = (side==0) ? 0.0 : pi;
+    //double this_module_rotZ = (side==0) ? pi/8. : pi/8;
+    RotationZYX rot(0,this_module_rotY,0);
+    Transform3D tran3D(rot,Position(0,0,this_module_z_offset));
+
+    PlacedVolume module_phv;
+    //if(side==0) module_phv = envelope.placeVolume(EndCapRingLogical, tran3D);
+    //else        module_phv = envelope.placeVolume(EndCapRingLogical.reflect(), tran3D);
+    module_phv = envelope.placeVolume(EndCapLogical, tran3D);
+
+    module_phv.addPhysVolID("module", module_id);
+    //DetElement sd = (module_id==0) ? module_det : module_det.clone(_toString(side,"module%d"));
+    module.setPlacement(module_phv);
+  }
+
+  det.addExtension<LayeredCalorimeterData>(caloData) ;
+
+  return det;
+}
+
+DECLARE_DETELEMENT(SHcalRpc01_Endcaps, create_detector)
diff --git a/Detector/DetDriftChamber/compact/det.xml b/Detector/DetDriftChamber/compact/det.xml
index e1ca33b20d4abc21b28bd4eb8415586c2e6c40b1..6770bdd4a65454a2a86fa69b9b692ec927314c7f 100644
--- a/Detector/DetDriftChamber/compact/det.xml
+++ b/Detector/DetDriftChamber/compact/det.xml
@@ -50,8 +50,13 @@
     <vis name="VisibleGreen" alpha="1.0" r="0.0" g="1.0" b="0.0" drawingStyle="solid" lineStyle="solid" showDaughters="true" visible="true"/>
   </display>
 
+  <regions>
+    <region name="DriftChamberRegion">
+    </region>
+  </regions>
+
   <detectors>
-    <detector id="1" name="DriftChamber" type="DriftChamber" readout="DriftChamberHitsCollection" vis="VisibleBlue" sensitive="true">
+    <detector id="1" name="DriftChamber" type="DriftChamber" readout="DriftChamberHitsCollection" vis="VisibleBlue" sensitive="true" region="DriftChamberRegion">
       <envelope vis="SeeThrough">
         <shape type="BooleanShape" operation="Union" material="Air">
           <shape type="Tube" rmin="SDT_radius_min" rmax="SDT_inner_chamber_radius_max" dz="SDT_half_length" />
diff --git a/Detector/DetSegmentation/src/GridDriftChamber.cpp b/Detector/DetSegmentation/src/GridDriftChamber.cpp
index 991f42a816953224c8138a488885983e3739d901..d4facaaea91861aea6166c8d117d8823178f3b4f 100644
--- a/Detector/DetSegmentation/src/GridDriftChamber.cpp
+++ b/Detector/DetSegmentation/src/GridDriftChamber.cpp
@@ -56,13 +56,13 @@ CellID GridDriftChamber::cellID(const Vector3D& /*localPosition*/, const Vector3
   _decoder->set(cID, m_phiID, lphi);
 
 
-//std::cout << "#######################################: " 
-//          <<  " offset : " << m_offset
-//          << " offsetphi: " << offsetphi
-//          << " layerID: " << layerID
-//          << " r: " << _currentRadius
-//          << " layerphi: " << _currentLayerphi
-//          << std::endl;
+// std::cout << "#######################################: " 
+//           <<  " offset : " << m_offset
+//           << " offsetphi: " << offsetphi
+//           << " layerID: " << layerID
+//           << " r: " << _currentRadius
+//           << " layerphi: " << _currentLayerphi
+//           << std::endl;
 
   return cID;
 }
diff --git a/Examples/options/LCIO_read_pan.py b/Examples/options/LCIO_read_pan.py
index 2f91258cd4dba49776fed8a96d361598333e55bc..c1e8997ff94ba0302440d811d987c1f700d79d71 100644
--- a/Examples/options/LCIO_read_pan.py
+++ b/Examples/options/LCIO_read_pan.py
@@ -8,7 +8,8 @@ dsvc = k4DataSvc("EventDataSvc")
 from Configurables import LCIOInput
 read = LCIOInput("read")
 read.inputs = [
-"/cefs/higgs/wxfang/cepc/Pandora/CaloDigi/gamma/Digi_sim_1.slcio"
+#"/cefs/higgs/wxfang/cepc/Pandora/ele_lcio_full_det_rec/reco_sim_0.slcio"
+"/cefs/higgs/wxfang/cepc/Pandora/ele_lcio_full_det_rec/reco_sim_34.slcio"
 ]
 read.collections = [
         "MCParticle:MCParticle",
@@ -54,6 +55,7 @@ ntsvc.Output = ["MyTuples DATAFILE='LCIO_Pan_ana.root' OPT='NEW' TYP='ROOT'"]
 from Configurables import PandoraPFAlg
 
 pandoralg = PandoraPFAlg("PandoraPFAlg")
+pandoralg.debug              = False
 pandoralg.use_dd4hep_geo     = False
 pandoralg.use_dd4hep_decoder = False
 pandoralg.use_preshower      = False
@@ -127,7 +129,7 @@ write.outputCommands = ["keep *"]
 # ApplicationMgr
 from Configurables import ApplicationMgr
 ApplicationMgr(
-        TopAlg = [read, pandoralg, write],
+        TopAlg = [read, pandoralg],
         EvtSel = 'NONE',
         EvtMax = 10,
         ExtSvc = [dsvc, gearSvc],
diff --git a/Examples/options/sim-rec-trackerecal.py b/Examples/options/sim-rec-trackerecal.py
new file mode 100644
index 0000000000000000000000000000000000000000..1117e414ab57dbc65ee71160ee28c5d3ca61af95
--- /dev/null
+++ b/Examples/options/sim-rec-trackerecal.py
@@ -0,0 +1,337 @@
+#!/usr/bin/env python
+
+from Gaudi.Configuration import *
+
+NTupleSvc().Output = ["MyTuples DATAFILE='sim-rec-trackerEcal.root' OPT='NEW' TYP='ROOT'"]
+
+from Configurables import RndmGenSvc, HepRndm__Engine_CLHEP__RanluxEngine_
+rndmengine = HepRndm__Engine_CLHEP__HepJamesRandom_()
+rndmengine.SetSingleton = True
+rndmengine.Seeds = [1]
+
+from Configurables import k4DataSvc
+dsvc = k4DataSvc("EventDataSvc")
+
+from Configurables import MarlinEvtSeeder
+evtseeder = MarlinEvtSeeder("EventSeeder")
+
+geometry_option = "CepC_v4-onlyTrackerECAL.xml"
+
+if not os.getenv("DETCEPCV4ROOT"):
+    print("Can't find the geometry. Please setup envvar DETCEPCV4ROOT." )
+    sys.exit(-1)
+
+geometry_path = os.path.join(os.getenv("DETCEPCV4ROOT"), "compact", geometry_option)
+if not os.path.exists(geometry_path):
+    print("Can't find the compact geometry file: %s"%geometry_path)
+    sys.exit(-1)
+
+from Configurables import GeomSvc
+geosvc = GeomSvc("GeomSvc")
+geosvc.compact = geometry_path
+
+from Configurables import GenAlgo
+from Configurables import GtGunTool
+from Configurables import StdHepRdr
+from Configurables import SLCIORdr
+from Configurables import HepMCRdr
+from Configurables import GenPrinter
+
+gun = GtGunTool("GtGunTool")
+gun.Particles = ["e-"]
+#gun.EnergyMins = [1]
+#gun.EnergyMaxs = [50]
+#gun.ThetaMins = [50]
+#gun.ThetaMaxs = [130]
+#gun.PhiMins = [-90]
+#gun.PhiMaxs = [90]
+gun.EnergyMins = [10]
+gun.EnergyMaxs = [10]
+gun.ThetaMins = [90]
+gun.ThetaMaxs = [90]
+gun.PhiMins = [0]
+gun.PhiMaxs = [0]
+
+genprinter = GenPrinter("GenPrinter")
+
+genalg = GenAlgo("GenAlgo")
+genalg.GenTools = ["GtGunTool"]
+
+from Configurables import DetSimSvc
+detsimsvc = DetSimSvc("DetSimSvc")
+
+from Configurables import DetSimAlg
+detsimalg = DetSimAlg("DetSimAlg")
+# detsimalg.VisMacs = ["vis.mac"]
+detsimalg.RunCmds = [
+#    "/physics_lists/factory/addOptical"
+]
+detsimalg.PhysicsList = "FTFP_BERT"
+detsimalg.AnaElems = ["Edm4hepWriterAnaElemTool"]
+detsimalg.RootDetElem = "WorldDetElemTool"
+
+from Configurables import AnExampleDetElemTool
+example_dettool = AnExampleDetElemTool("AnExampleDetElemTool")
+
+from Configurables import TimeProjectionChamberSensDetTool
+tpc_sensdettool = TimeProjectionChamberSensDetTool("TimeProjectionChamberSensDetTool")
+tpc_sensdettool.TypeOption = 1
+
+from Configurables import GearSvc
+gearsvc = GearSvc("GearSvc")
+gearsvc.GearXMLFile = "Detector/DetCEPCv4/compact/FullDetGear.xml"
+
+from Configurables import TrackSystemSvc
+tracksystemsvc = TrackSystemSvc("TrackSystemSvc")
+
+vxdhitname  = "VXDTrackerHits"
+sithitname  = "SITTrackerHits"
+sitspname   = "SITSpacePoints"
+tpchitname  = "TPCTrackerHits"
+sethitname  = "SETTrackerHits"
+setspname   = "SETSpacePoints"
+ftdspname   = "FTDSpacePoints"
+ftdhitname = "FTDTrackerHits"
+from Configurables import PlanarDigiAlg
+digiVXD = PlanarDigiAlg("VXDDigi")
+digiVXD.SimTrackHitCollection = "VXDCollection"
+digiVXD.TrackerHitCollection = vxdhitname
+digiVXD.ResolutionU = [0.0028, 0.006, 0.004, 0.004, 0.004, 0.004]
+digiVXD.ResolutionV = [0.0028, 0.006, 0.004, 0.004, 0.004, 0.004]
+
+digiSIT = PlanarDigiAlg("SITDigi")
+digiSIT.IsStrip = 1
+digiSIT.SimTrackHitCollection = "SITCollection"
+digiSIT.TrackerHitCollection = sithitname
+digiSIT.TrackerHitAssociationCollection = "SITTrackerHitAssociation"
+digiSIT.ResolutionU = [0.007]
+digiSIT.ResolutionV = [0.000]
+
+digiSET = PlanarDigiAlg("SETDigi")
+digiSET.IsStrip = 1
+digiSET.SimTrackHitCollection = "SETCollection"
+digiSET.TrackerHitCollection = sethitname
+digiSET.TrackerHitAssociationCollection = "SETTrackerHitAssociation"
+digiSET.ResolutionU = [0.007]
+digiSET.ResolutionV = [0.000]
+
+digiFTD = PlanarDigiAlg("FTDDigi")
+digiFTD.SimTrackHitCollection = "FTDCollection"
+digiFTD.TrackerHitCollection = ftdhitname
+digiFTD.TrackerHitAssociationCollection = "FTDTrackerHitAssociation"
+digiFTD.ResolutionU = [0.003, 0.003, 0.007, 0.007, 0.007, 0.007, 0.007, 0.007]
+digiFTD.ResolutionV = [0.003, 0.003, 0,     0,     0,     0,     0,     0    ]
+#digiFTD.OutputLevel = DEBUG
+
+from Configurables import SpacePointBuilderAlg
+spSIT = SpacePointBuilderAlg("SITBuilder")
+spSIT.TrackerHitCollection = sithitname
+spSIT.TrackerHitAssociationCollection = "SITTrackerHitAssociation"
+spSIT.SpacePointCollection = sitspname
+spSIT.SpacePointAssociationCollection = "SITSpacePointAssociation"
+#spSIT.OutputLevel = DEBUG
+
+spFTD = SpacePointBuilderAlg("FTDBuilder")
+spFTD.TrackerHitCollection = ftdhitname
+spFTD.TrackerHitAssociationCollection = "FTDTrackerHitAssociation"
+spFTD.SpacePointCollection = ftdspname
+spFTD.SpacePointAssociationCollection = "FTDSpacePointAssociation"
+#spFTD.OutputLevel = DEBUG
+
+from Configurables import TPCDigiAlg
+digiTPC = TPCDigiAlg("TPCDigi")
+digiTPC.TPCCollection = "TPCCollection"
+digiTPC.TPCLowPtCollection = "TPCLowPtCollection"
+digiTPC.TPCTrackerHitsCol = tpchitname
+#digiTPC.OutputLevel = DEBUG
+
+from Configurables import ClupatraAlg
+clupatra = ClupatraAlg("Clupatra")
+clupatra.TPCHitCollection = tpchitname
+#clupatra.OutputLevel = DEBUG
+
+from Configurables import SiliconTrackingAlg
+tracking = SiliconTrackingAlg("SiliconTracking")
+tracking.HeaderCol = "EventHeader"
+tracking.VTXHitCollection = vxdhitname
+tracking.SITHitCollection = sitspname
+tracking.FTDPixelHitCollection = ftdhitname
+tracking.FTDSpacePointCollection = ftdspname
+tracking.SITRawHitCollection = sithitname
+tracking.FTDRawHitCollection = ftdhitname
+tracking.UseSIT = 1
+tracking.SmoothOn = 0
+#tracking.OutputLevel = DEBUG
+
+from Configurables import ForwardTrackingAlg
+forward = ForwardTrackingAlg("ForwardTracking")
+forward.FTDPixelHitCollection = ftdhitname
+forward.FTDSpacePointCollection = ftdspname
+forward.FTDRawHitCollection = ftdhitname
+forward.Chi2ProbCut = 0.0
+forward.HitsPerTrackMin = 3
+forward.BestSubsetFinder = "SubsetSimple"
+forward.Criteria = ["Crit2_DeltaPhi","Crit2_StraightTrackRatio","Crit3_3DAngle","Crit3_ChangeRZRatio","Crit3_IPCircleDist","Crit4_3DAngleChange","Crit4_DistToExtrapolation",
+                    "Crit2_DeltaRho","Crit2_RZRatio","Crit3_PT"]
+forward.CriteriaMin = [0,  0.9,  0,  0.995, 0,  0.8, 0,   20,  1.002, 0.1,      0,   0.99, 0,    0.999, 0,   0.99, 0]  
+forward.CriteriaMax = [30, 1.02, 10, 1.015, 20, 1.3, 1.0, 150, 1.08,  99999999, 0.8, 1.01, 0.35, 1.001, 1.5, 1.01, 0.05] 
+#forward.OutputLevel = DEBUG
+
+from Configurables import TrackSubsetAlg
+subset = TrackSubsetAlg("TrackSubset")
+subset.TrackInputCollections = ["ForwardTracks", "SiTracks"]
+subset.RawTrackerHitCollections = [vxdhitname, sithitname, ftdhitname, sitspname, ftdspname]
+subset.TrackSubsetCollection = "SubsetTracks"
+#subset.OutputLevel = DEBUG
+
+from Configurables import FullLDCTrackingAlg
+full = FullLDCTrackingAlg("FullTracking")
+full.VTXTrackerHits = vxdhitname
+full.SITTrackerHits = sitspname
+full.TPCTrackerHits = tpchitname
+full.SETTrackerHits = setspname
+full.FTDPixelTrackerHits = ftdhitname
+full.FTDSpacePoints = ftdspname
+full.SITRawHits     = sithitname
+full.SETRawHits     = sethitname
+full.FTDRawHits     = ftdhitname
+full.TPCTracks = "ClupatraTracks"
+full.SiTracks  = "SubsetTracks"
+full.OutputTracks  = "MarlinTrkTracks"
+#full.OutputLevel = DEBUG
+'''
+from Configurables import DumpMCParticleAlg
+dumpMC = DumpMCParticleAlg("DumpMC")
+dumpMC.MCParticleCollection = "MCParticle"
+
+from Configurables import DumpTrackAlg
+dumpFu = DumpTrackAlg("DumpFu")
+dumpFu.TrackCollection = "MarlinTrkTracks"
+#dumpFu.OutputLevel = DEBUG
+
+dumpCl = DumpTrackAlg("DumpCl")
+dumpCl.TrackCollection = "ClupatraTracks"
+#dumpCl.OutputLevel = DEBUG
+
+dumpSu = DumpTrackAlg("DumpSu")
+dumpSu.TrackCollection = "SubsetTracks"
+#dumpSu.OutputLevel = DEBUG
+
+dumpSi = DumpTrackAlg("DumpSi")
+dumpSi.TrackCollection = "SiTracks"
+#dumpSi.OutputLevel = DEBUG
+
+dumpFo = DumpTrackAlg("DumpFo")
+dumpFo.TrackCollection = "ForwardTracks"
+#dumpFo.OutputLevel = DEBUG
+'''
+############################################################
+from Configurables import SimHitMergeAlg
+simHitMerge = SimHitMergeAlg("SimHitMergeAlg")
+simHitMerge.InputCollections=["EcalBarrelCollection", "EcalEndcapsCollection"]
+simHitMerge.OutputCollections=["EcalBarrelCollectionMerged", "EcalEndcapsCollectionMerged"]
+############################################################
+
+from Configurables import G2CDArborAlg
+caloDigi = G2CDArborAlg("G2CDArborAlg")
+caloDigi.ReadLCIO = False 
+#caloDigi.CalibrECAL = [48.16, 96.32]
+caloDigi.CalibrECAL = [46.538, 93.0769]
+caloDigi.ECALCollections = ["EcalBarrelCollectionMerged", "EcalEndcapsCollectionMerged"]
+caloDigi.ECALReadOutNames= ["EcalBarrelCollection", "EcalEndcapsCollection"]
+caloDigi.DigiECALCollection = ["ECALBarrel", "ECALEndcap"]
+caloDigi.HCALCollections = []
+caloDigi.HCALReadOutNames= []
+caloDigi.DigiHCALCollection = []
+caloDigi.EventReportEvery = 100
+##############################################################################
+from Configurables import PandoraPFAlg
+
+pandoralg = PandoraPFAlg("PandoraPFAlg")
+pandoralg.debug              = False
+pandoralg.use_dd4hep_geo     = True
+pandoralg.use_dd4hep_decoder = True
+pandoralg.use_preshower      = False
+pandoralg.WriteAna           = True
+pandoralg.collections = [
+        "MCParticle:MCParticle",
+        "CalorimeterHit:ECALBarrel",
+        "CalorimeterHit:ECALEndcap",
+        "CalorimeterHit:ECALOther" ,
+        "CalorimeterHit:HCALBarrel",
+        "CalorimeterHit:HCALEndcap",
+        "CalorimeterHit:HCALOther" ,
+        "CalorimeterHit:MUON", 
+        "CalorimeterHit:LCAL", 
+        "CalorimeterHit:LHCAL", 
+        "CalorimeterHit:BCAL", 
+        "Vertex:KinkVertices", 
+        "Vertex:ProngVertices", 
+        "Vertex:SplitVertices", 
+        "Vertex:V0Vertices", 
+        "Track:MarlinTrkTracks", 
+        "MCRecoCaloAssociation:MCRecoCaloAssociationCollection" 
+        ]
+pandoralg.WriteClusterCollection               = "PandoraClusters"              
+pandoralg.WriteReconstructedParticleCollection = "PandoraPFOs" 
+pandoralg.WriteVertexCollection                = "PandoraPFANewStartVertices"               
+
+pandoralg.PandoraSettingsDefault_xml = "Reconstruction/PFA/Pandora/PandoraSettingsDefault.xml"
+#### Do not chage the collection name, only add or remove ###############
+pandoralg.TrackCollections      =  ["MarlinTrkTracks"]
+pandoralg.ECalCaloHitCollections=  ["ECALBarrel"          , "ECALEndcap"           , "ECALOther"]
+pandoralg.ECalReadOutNames      =  ["EcalBarrelCollection", "EcalEndcapsCollection", "ECALOther"]
+pandoralg.HCalCaloHitCollections=  ["HCALBarrel", "HCALEndcap", "HCALOther"]
+pandoralg.HCalReadOutNames      =  ["HcalBarrelCollection", "HcalEndcapsCollection", "HCALOther"]
+pandoralg.LCalCaloHitCollections=  ["LCAL"]
+pandoralg.LCalReadOutNames      =  ["LcalCollection"]
+pandoralg.LHCalCaloHitCollections= ["LHCAL"]
+pandoralg.LHCalReadOutNames      = ["LHcalCollection"]
+pandoralg.MuonCaloHitCollections=  ["MUON"]
+pandoralg.MuonCalReadOutNames    = ["MuoncalCollection"]
+pandoralg.MCParticleCollections =  ["MCParticle"]
+pandoralg.RelCaloHitCollections =  ["MCRecoCaloAssociationCollection"]
+pandoralg.RelTrackCollections   =  ["MarlinTrkTracksMCTruthLink"]
+pandoralg.KinkVertexCollections =  ["KinkVertices"]
+pandoralg.ProngVertexCollections=  ["ProngVertices"]
+pandoralg.SplitVertexCollections=  ["SplitVertices"]
+pandoralg.V0VertexCollections   =  ["V0Vertices"]
+pandoralg.ECalToMipCalibration  = 160.0 
+pandoralg.HCalToMipCalibration  = 34.8 
+pandoralg.ECalMipThreshold      = 0.5 
+pandoralg.HCalMipThreshold      = 0.3 
+pandoralg.ECalToEMGeVCalibration= 0.9 #for G2CD Digi, 1.007 for NewLDCaloDigi 
+pandoralg.HCalToEMGeVCalibration= 1.007 
+pandoralg.ECalToHadGeVCalibrationBarrel= 1.12 #very small effect 
+pandoralg.ECalToHadGeVCalibrationEndCap= 1.12 
+pandoralg.HCalToHadGeVCalibration= 1.07
+pandoralg.MuonToMipCalibration= 10.0 
+pandoralg.DigitalMuonHits= 0 
+pandoralg.MaxHCalHitHadronicEnergy   = 1.0 
+pandoralg.UseOldTrackStateCalculation= 0 
+pandoralg.AbsorberRadLengthECal= 0.2854 #= 1/3.504 mm 
+pandoralg.AbsorberIntLengthECal= 0.0101 #= 1/99.46 mm 
+pandoralg.AbsorberRadLengthHCal= 0.0569 
+pandoralg.AbsorberIntLengthHCal= 0.006  
+pandoralg.AbsorberRadLengthOther= 0.0569
+pandoralg.AbsorberIntLengthOther= 0.006 
+
+##############################################################################
+
+# write PODIO file
+from Configurables import PodioOutput
+write = PodioOutput("write")
+write.filename = "test.root"
+write.outputCommands = ["keep *"]
+
+# ApplicationMgr
+from Configurables import ApplicationMgr
+ApplicationMgr(
+    #TopAlg = [genalg, detsimalg, digiVXD, digiSIT, digiSET, digiFTD, spSIT, spFTD, digiTPC, clupatra, tracking, forward, subset, full, dumpMC, dumpFu, dumpCl, dumpSu, dumpSi, dumpFo, write],
+    TopAlg = [genalg, detsimalg, digiVXD, digiSIT, digiSET, digiFTD, spSIT, spFTD, digiTPC, clupatra, tracking, forward, subset, full, simHitMerge, caloDigi, pandoralg, write],
+    EvtSel = 'NONE',
+    EvtMax = 10,
+    ExtSvc = [rndmengine, dsvc, evtseeder, gearsvc, geosvc, tracksystemsvc],
+    HistogramPersistency='ROOT',
+    OutputLevel=INFO
+)
diff --git a/Examples/options/tut_analysis_TotalInvMass.py b/Examples/options/tut_analysis_TotalInvMass.py
new file mode 100644
index 0000000000000000000000000000000000000000..eb7faebb30a6907790371ff4677735c2ece03b11
--- /dev/null
+++ b/Examples/options/tut_analysis_TotalInvMass.py
@@ -0,0 +1,48 @@
+#!/usr/bin/env python
+
+from Gaudi.Configuration import *
+
+from Configurables import k4DataSvc
+dsvc = k4DataSvc("EventDataSvc")
+
+# read LCIO files
+from Configurables import k4LCIOInput
+lcioinput = k4LCIOInput("k4LCIOInput")
+
+import glob
+
+# inputlists = ["/cefs/higgs/yudan/CEPC240/Reco_tpc_1800/qqh/Reco_qqh__00001.slcio"]
+inputlists = ["/cefs/higgs/yudan/CEPC240/Reco_tpc_1800/qqh/Reco_qqh__00003.slcio"]
+# inputlists = glob.glob("/cefs/higgs/yudan/CEPC240/Reco_tpc_1800/qqh/Reco_qqh__*.slcio")
+
+lcioinput.inputs = inputlists
+lcioinput.collections = [
+    "MCParticle:MCParticle",
+    "CalorimeterHit:ECALBarrel",
+    "CalorimeterHit:ECALEndcap",
+    "CalorimeterHit:HCALBarrel",
+    "CalorimeterHit:HCALEndcap",
+    "CalorimeterHit:HCALOther",
+    "ReconstructedParticle:AncientPFOs",
+    "ReconstructedParticle:ArborLICHPFOs"
+]
+
+from Configurables import TotalInvMass
+total_inv_mass = TotalInvMass("TotalInvMass")
+
+# # write PODIO file
+# from Configurables import PodioOutput
+# write = PodioOutput("write")
+# write.filename = "test.root"
+# write.outputCommands = ["keep *"]
+
+# ApplicationMgr
+from Configurables import ApplicationMgr
+ApplicationMgr(
+        TopAlg = [lcioinput, total_inv_mass],
+        EvtSel = 'NONE',
+        EvtMax = -1,
+        ExtSvc = [dsvc],
+        OutputLevel=INFO #DEBUG
+)
+
diff --git a/Examples/options/tut_detsim_SDT.py b/Examples/options/tut_detsim_SDT.py
index 779454ac323fdd87a20415dd3e3193dfbf643b14..4aa215871c5357e1ba5099a9d73ef7327b817cbc 100644
--- a/Examples/options/tut_detsim_SDT.py
+++ b/Examples/options/tut_detsim_SDT.py
@@ -117,6 +117,13 @@ if int(os.environ.get("VIS", 0)):
 detsimalg.RunCmds = [
 #    "/tracking/verbose 1",
 ]
+
+from Configurables import DummyFastSimG4Tool
+dummy_fastsim_tool = DummyFastSimG4Tool("DummyFastSimG4Tool")
+
+detsimalg.FastSimG4Tools = [
+    "DummyFastSimG4Tool"
+]
 detsimalg.AnaElems = [
     # example_anatool.name()
     # "ExampleAnaElemTool"
diff --git a/Examples/options/tut_detsim_digi_truthTracker_SDT.py b/Examples/options/tut_detsim_digi_truthTracker_SDT.py
new file mode 100644
index 0000000000000000000000000000000000000000..a5fd439aa790627b439c51e0146b233b5069399a
--- /dev/null
+++ b/Examples/options/tut_detsim_digi_truthTracker_SDT.py
@@ -0,0 +1,200 @@
+#!/usr/bin/env python
+
+import os
+print(os.environ["DD4HEP_LIBRARY_PATH"])
+import sys
+# sys.exit(0)
+
+from Gaudi.Configuration import *
+
+##############################################################################
+# Random Number Svc
+##############################################################################
+from Configurables import RndmGenSvc, HepRndm__Engine_CLHEP__RanluxEngine_
+
+# rndmengine = HepRndm__Engine_CLHEP__RanluxEngine_() # The default engine in Gaudi
+rndmengine = HepRndm__Engine_CLHEP__HepJamesRandom_() # The default engine in Geant4
+rndmengine.SetSingleton = True
+rndmengine.Seeds = [42]
+
+# rndmgensvc = RndmGenSvc("RndmGenSvc")
+# rndmgensvc.Engine = rndmengine.name()
+
+
+##############################################################################
+# Event Data Svc
+##############################################################################
+from Configurables import k4DataSvc
+dsvc = k4DataSvc("EventDataSvc")
+
+
+##############################################################################
+# Geometry Svc
+##############################################################################
+
+# geometry_option = "CepC_v4-onlyTracker.xml"
+geometry_option = "det.xml"
+
+if not os.getenv("DETDRIFTCHAMBERROOT"):
+    print("Can't find the geometry. Please setup envvar DETCEPCV4ROOT." )
+    sys.exit(-1)
+
+geometry_path = os.path.join(os.getenv("DETDRIFTCHAMBERROOT"), "compact", geometry_option)
+if not os.path.exists(geometry_path):
+    print("Can't find the compact geometry file: %s"%geometry_path)
+    sys.exit(-1)
+
+from Configurables import GeomSvc
+geosvc = GeomSvc("GeomSvc")
+geosvc.compact = geometry_path
+
+##############################################################################
+# Physics Generator
+##############################################################################
+from Configurables import GenAlgo
+from Configurables import GtGunTool
+from Configurables import StdHepRdr
+from Configurables import SLCIORdr
+from Configurables import HepMCRdr
+from Configurables import GenPrinter
+
+gun = GtGunTool("GtGunTool")
+# gun.Particles = ["pi+"]
+# gun.EnergyMins = [100.] # GeV
+# gun.EnergyMaxs = [100.] # GeV
+
+gun.Particles = ["e-"]
+
+# gun.PositionXs = [100.] # mm
+# gun.PositionYs = [100.] # mm
+# gun.PositionZs = [0.] # mm
+
+
+gun.EnergyMins = [10.] # GeV
+gun.EnergyMaxs = [10.] # GeV
+
+gun.ThetaMins = [90] # rad; 45deg
+gun.ThetaMaxs = [90] # rad; 45deg
+
+gun.PhiMins = [90] # rad; 0deg
+gun.PhiMaxs = [90] # rad; 360deg
+#gun.PhiMins = [0] # rad; 0deg
+#gun.PhiMaxs = [360] # rad; 360deg
+
+# stdheprdr = StdHepRdr("StdHepRdr")
+# stdheprdr.Input = "/cefs/data/stdhep/CEPC250/2fermions/E250.Pbhabha.e0.p0.whizard195/bhabha.e0.p0.00001.stdhep"
+
+# lciordr = SLCIORdr("SLCIORdr")
+# lciordr.Input = "/cefs/data/stdhep/lcio250/signal/Higgs/E250.Pbbh.whizard195/E250.Pbbh_X.e0.p0.whizard195/Pbbh_X.e0.p0.00001.slcio"
+
+# hepmcrdr = HepMCRdr("HepMCRdr")
+# hepmcrdr.Input = "example_UsingIterators.txt"
+
+genprinter = GenPrinter("GenPrinter")
+
+genalg = GenAlgo("GenAlgo")
+genalg.GenTools = ["GtGunTool"]
+# genalg.GenTools = ["StdHepRdr"]
+# genalg.GenTools = ["StdHepRdr", "GenPrinter"]
+# genalg.GenTools = ["SLCIORdr", "GenPrinter"]
+# genalg.GenTools = ["HepMCRdr", "GenPrinter"]
+
+##############################################################################
+# Detector Simulation
+##############################################################################
+from Configurables import DetSimSvc
+
+detsimsvc = DetSimSvc("DetSimSvc")
+
+# from Configurables import ExampleAnaElemTool
+# example_anatool = ExampleAnaElemTool("ExampleAnaElemTool")
+
+from Configurables import DetSimAlg
+
+detsimalg = DetSimAlg("DetSimAlg")
+
+if int(os.environ.get("VIS", 0)):
+    detsimalg.VisMacs = ["vis.mac"]
+
+detsimalg.RunCmds = [
+#    "/tracking/verbose 1",
+]
+detsimalg.AnaElems = [
+    # example_anatool.name()
+    # "ExampleAnaElemTool"
+    "Edm4hepWriterAnaElemTool"
+]
+detsimalg.RootDetElem = "WorldDetElemTool"
+
+from Configurables import AnExampleDetElemTool
+example_dettool = AnExampleDetElemTool("AnExampleDetElemTool")
+
+from Configurables import CalorimeterSensDetTool
+from Configurables import DriftChamberSensDetTool
+
+calo_sensdettool = CalorimeterSensDetTool("CalorimeterSensDetTool")
+driftchamber_sensdettool = DriftChamberSensDetTool("DriftChamberSensDetTool")
+
+# dedxoption = "DummyDedxSimTool"
+dedxoption = "BetheBlochEquationDedxSimTool"
+
+driftchamber_sensdettool.DedxSimTool = dedxoption
+
+from Configurables import DummyDedxSimTool
+from Configurables import BetheBlochEquationDedxSimTool
+
+if dedxoption == "DummyDedxSimTool":
+    dedx_simtool = DummyDedxSimTool("DummyDedxSimTool")
+elif dedxoption == "BetheBlochEquationDedxSimTool":
+    dedx_simtool = BetheBlochEquationDedxSimTool("BetheBlochEquationDedxSimTool")
+    dedx_simtool.material_Z = 2
+    dedx_simtool.material_A = 4
+    dedx_simtool.scale = 10
+    dedx_simtool.resolution = 0.0001
+
+##############################################################################
+from Configurables import NTupleSvc
+ntsvc = NTupleSvc("NTupleSvc")
+ntsvc.Output = ["MyTuples DATAFILE='DCH_digi_ana.root' OPT='NEW' TYP='ROOT'"]
+
+##############################################################################
+# DCHDigiAlg
+##############################################################################
+from Configurables import DCHDigiAlg
+dCHDigiAlg = DCHDigiAlg("DCHDigiAlg")
+dCHDigiAlg.readout = "DriftChamberHitsCollection"
+dCHDigiAlg.drift_velocity = 40#um/ns
+dCHDigiAlg.mom_threshold = 0 #GeV
+dCHDigiAlg.SimDCHitCollection = "DriftChamberHitsCollection"
+dCHDigiAlg.DigiDCHitCollection = "DigiDCHitsCollection"
+dCHDigiAlg.AssociationCollection = "DCHAssociationCollectio"
+dCHDigiAlg.WriteAna  = True
+
+##############################################################################
+# TruthTrackerAlg
+##############################################################################
+from Configurables import TruthTrackerAlg
+truthTrackerAlg = TruthTrackerAlg("TruthTrackerAlg")
+truthTrackerAlg.DCHitAssociationCollection="DCHAssociationCollectio"
+truthTrackerAlg.debug = 1
+
+##############################################################################
+# POD I/O
+##############################################################################
+from Configurables import PodioOutput
+out = PodioOutput("outputalg")
+out.filename = "truthRec_DCH.root"
+out.outputCommands = ["keep *"]
+
+##############################################################################
+# ApplicationMgr
+##############################################################################
+
+from Configurables import ApplicationMgr
+ApplicationMgr( TopAlg = [genalg, detsimalg, dCHDigiAlg, truthTrackerAlg, out],
+                EvtSel = 'NONE',
+                EvtMax = 10,
+                ExtSvc = [rndmengine, dsvc, geosvc],
+                HistogramPersistency = "ROOT",
+                OutputLevel=INFO
+)
diff --git a/Examples/options/tut_detsim_pandora.py b/Examples/options/tut_detsim_pandora.py
index a9bc9504bc7bd4f5a0835d90587ec66ab88952ff..2768ea499d7259f85fdf03099d593c82e81ed895 100644
--- a/Examples/options/tut_detsim_pandora.py
+++ b/Examples/options/tut_detsim_pandora.py
@@ -53,13 +53,13 @@ from Configurables import HepMCRdr
 from Configurables import GenPrinter
 
 gun = GtGunTool("GtGunTool")
-gun.Particles = ["gamma","gamma"]
-gun.EnergyMins= [10, 10] # GeV
-gun.EnergyMaxs= [10, 10] # GeV
-gun.ThetaMins = [90, 90] # degree
-gun.ThetaMaxs = [90, 90] # degree
-gun.PhiMins   = [0,  1 ] # degree
-gun.PhiMaxs   = [0,  1 ] # degree
+gun.Particles = ["gamma"]
+gun.EnergyMins= [10] # GeV
+gun.EnergyMaxs= [10] # GeV
+gun.ThetaMins = [80] # degree
+gun.ThetaMaxs = [80] # degree
+gun.PhiMins   = [0 ] # degree
+gun.PhiMaxs   = [0 ] # degree
 
 
 #stdheprdr = StdHepRdr("StdHepRdr")
@@ -104,13 +104,25 @@ detsimalg.RootDetElem = "WorldDetElemTool"
 from Configurables import AnExampleDetElemTool
 example_dettool = AnExampleDetElemTool("AnExampleDetElemTool")
 
-##############################################################################
-from Configurables import CaloDigiAlg
-example_CaloDigiAlg = CaloDigiAlg("CaloDigiAlg")
-example_CaloDigiAlg.Scale = 1
-example_CaloDigiAlg.SimCaloHitCollection = "EcalBarrelCollection"
-example_CaloDigiAlg.CaloHitCollection    = "ECALBarrel"
-example_CaloDigiAlg.CaloAssociationCollection    = "RecoCaloAssociation_ECALBarrel"
+############################################################
+from Configurables import SimHitMergeAlg
+simHitMerge = SimHitMergeAlg("SimHitMergeAlg")
+simHitMerge.InputCollections=["EcalBarrelCollection", "EcalEndcapsCollection"]
+simHitMerge.OutputCollections=["EcalBarrelCollectionMerged", "EcalEndcapsCollectionMerged"]
+############################################################
+
+from Configurables import G2CDArborAlg
+caloDigi = G2CDArborAlg("G2CDArborAlg")
+caloDigi.ReadLCIO = False 
+#caloDigi.CalibrECAL = [48.16, 96.32]
+caloDigi.CalibrECAL = [46.538, 93.0769]
+caloDigi.ECALCollections = ["EcalBarrelCollectionMerged", "EcalEndcapsCollectionMerged"]
+caloDigi.ECALReadOutNames= ["EcalBarrelCollection", "EcalEndcapsCollection"]
+caloDigi.DigiECALCollection = ["ECALBarrel", "ECALEndcap"]
+caloDigi.HCALCollections = []
+caloDigi.HCALReadOutNames= []
+caloDigi.DigiHCALCollection = []
+caloDigi.EventReportEvery = 100
 ##############################################################################
 from Configurables import GearSvc
 gearSvc  = GearSvc("GearSvc")
@@ -123,6 +135,7 @@ ntsvc.Output = ["MyTuples DATAFILE='detsim_Pan_ana.root' OPT='NEW' TYP='ROOT'"]
 from Configurables import PandoraPFAlg
 
 pandoralg = PandoraPFAlg("PandoraPFAlg")
+pandoralg.debug              = False
 pandoralg.use_dd4hep_geo     = True
 pandoralg.use_dd4hep_decoder = True
 pandoralg.use_preshower      = False
@@ -144,7 +157,7 @@ pandoralg.collections = [
         "Vertex:SplitVertices", 
         "Vertex:V0Vertices", 
         "Track:MarlinTrkTracks", 
-        "MCRecoCaloAssociation:RecoCaloAssociation_ECALBarrel" 
+        "MCRecoCaloAssociation:MCRecoCaloAssociationCollection" 
         ]
 pandoralg.WriteClusterCollection               = "PandoraClusters"              
 pandoralg.WriteReconstructedParticleCollection = "PandoraPFOs" 
@@ -154,12 +167,17 @@ pandoralg.PandoraSettingsDefault_xml = "Reconstruction/PFA/Pandora/PandoraSettin
 #### Do not chage the collection name, only add or remove ###############
 pandoralg.TrackCollections      =  ["MarlinTrkTracks"]
 pandoralg.ECalCaloHitCollections=  ["ECALBarrel", "ECALEndcap", "ECALOther"]
+pandoralg.ECalReadOutNames      =  ["EcalBarrelCollection", "EcalEndcapsCollection", "ECALOther"]
 pandoralg.HCalCaloHitCollections=  ["HCALBarrel", "HCALEndcap", "HCALOther"]
+pandoralg.HCalReadOutNames      =  ["HcalBarrelCollection", "HcalEndcapsCollection", "HCALOther"]
 pandoralg.LCalCaloHitCollections=  ["LCAL"]
+pandoralg.LCalReadOutNames      =  ["LcalCollection"]
 pandoralg.LHCalCaloHitCollections= ["LHCAL"]
+pandoralg.LHCalReadOutNames      = ["LHcalCollection"]
 pandoralg.MuonCaloHitCollections=  ["MUON"]
+pandoralg.MuonCalReadOutNames    = ["MuoncalCollection"]
 pandoralg.MCParticleCollections =  ["MCParticle"]
-pandoralg.RelCaloHitCollections =  ["RecoCaloAssociation_ECALBarrel", "RecoCaloAssociation_ECALEndcap", "RecoCaloAssociation_ECALOther", "RecoCaloAssociation_HCALBarrel", "RecoCaloAssociation_HCALEndcap", "RecoCaloAssociation_HCALOther", "RecoCaloAssociation_LCAL", "RecoCaloAssociation_LHCAL", "RecoCaloAssociation_MUON"]
+pandoralg.RelCaloHitCollections =  ["MCRecoCaloAssociationCollection"]
 pandoralg.RelTrackCollections   =  ["MarlinTrkTracksMCTruthLink"]
 pandoralg.KinkVertexCollections =  ["KinkVertices"]
 pandoralg.ProngVertexCollections=  ["ProngVertices"]
@@ -196,7 +214,7 @@ write.outputCommands = ["keep *"]
 # ApplicationMgr
 from Configurables import ApplicationMgr
 ApplicationMgr(
-        TopAlg = [genalg, detsimalg, example_CaloDigiAlg, pandoralg, write],
+        TopAlg = [genalg, detsimalg, simHitMerge, caloDigi, pandoralg, write],
         EvtSel = 'NONE',
         EvtMax = 10,
         ExtSvc = [rndmengine, dsvc, geosvc, gearSvc,detsimsvc],
diff --git a/Examples/src/Edm4hepTest/Edm4hepReadDCAlg.cpp b/Examples/src/Edm4hepTest/Edm4hepReadDCAlg.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..3c0baa9949049a4ff0d784b5900925dba56c1d6d
--- /dev/null
+++ b/Examples/src/Edm4hepTest/Edm4hepReadDCAlg.cpp
@@ -0,0 +1,85 @@
+#include "Edm4hepReadDCAlg.h"
+#include "edm4hep/EventHeaderCollection.h"
+#include "edm4hep/MCParticleCollection.h"
+#include "edm4hep/SimTrackerHitCollection.h"
+
+DECLARE_COMPONENT(Edm4hepReadDCAlg)
+
+Edm4hepReadDCAlg::Edm4hepReadDCAlg(const std::string& name, ISvcLocator* svcLoc)
+    : GaudiAlgorithm(name, svcLoc)
+{
+    declareProperty("MCParticleCol", m_mcParCol, "MCParticle collection (input)");
+    declareProperty("DCHitCol", m_dcCol, "Drift Chamber collections (input)");
+}
+
+StatusCode Edm4hepReadDCAlg::initialize()
+{
+    debug() << "begin initialize Edm4hepReadDCAlg" << endmsg;
+    return GaudiAlgorithm::initialize();
+}
+
+StatusCode Edm4hepReadDCAlg::execute()
+{
+    debug() << "begin execute Edm4hepReadDCAlg" << endmsg;
+
+    auto mcCol = m_mcParCol.get();
+    for ( auto p : *mcCol ) {
+        info() << p.getObjectID().index << " : [";
+        for ( auto it = p.daughters_begin(), end = p.daughters_end(); it != end; ++it ) {
+            info() << " " << it->getObjectID().index;
+        }
+        info() << " ]; ";
+    }
+    info() << "}" << endmsg;
+
+    auto trkCol = m_dcCol.get();
+    for (auto trkhit : *trkCol) {
+        auto position = trkhit.getPosition();
+        auto momentum = trkhit.getMomentum();
+        auto primary_particle = trkhit.getMCParticle();
+
+        info() << " cellID: " << trkhit.getCellID()
+               << " edep: " << trkhit.getEDep()
+               << " time: " << trkhit.getTime()
+               << " length: " << trkhit.getPathLength()
+               << " quality: " << trkhit.getQuality()
+               << " position: ("
+               << position[0] << ", " << position[1] << ", " << position[2]
+               << ")"
+               << " momentum: ("
+               << momentum[0] << ", " << momentum[1] << ", " << momentum[2]
+               << ")"
+               << " primary track: "
+               << primary_particle.getPDG()
+               << endmsg;
+            
+
+        // unsigned int contrib_size = calohit.contributions_size();
+        // info() << " contributions_size: " 
+        //        << contrib_size
+        //        << endmsg;
+        // for (unsigned int i = 0; i < contrib_size; ++i) {
+        //     auto contrib = calohit.getContributions(i);
+        //     auto primary_particle = contrib.getParticle();
+
+        //     info() << " - #" << i << ": "
+        //            << " track with "
+        //            << " PDG: " << contrib.getPDG() // current track
+        //            << ". "
+        //            << " primary track with "
+        //            << " PDG: " << primary_particle.getPDG()
+        //            << endmsg;
+
+
+        // }
+
+    }
+
+    return StatusCode::SUCCESS;
+}
+
+StatusCode Edm4hepReadDCAlg::finalize()
+{
+    debug() << "begin finalize Edm4hepReadDCAlg" << endmsg;
+    return GaudiAlgorithm::finalize();
+}
diff --git a/Examples/src/Edm4hepTest/Edm4hepReadDCAlg.h b/Examples/src/Edm4hepTest/Edm4hepReadDCAlg.h
new file mode 100644
index 0000000000000000000000000000000000000000..7a09eb6df5faa601afd0d0c614b43167926efd34
--- /dev/null
+++ b/Examples/src/Edm4hepTest/Edm4hepReadDCAlg.h
@@ -0,0 +1,33 @@
+#ifndef TEST_EDM4HEP_READ_DC_ALG_H
+#define TEST_EDM4HEP_READ_DC_ALG_H
+
+#include "k4FWCore/DataHandle.h"
+#include "GaudiAlg/GaudiAlgorithm.h"
+
+namespace edm4hep {
+    class EventHeaderCollection;
+    class MCParticleCollection;
+    class SimTrackerHitCollection;
+}
+
+class Edm4hepReadDCAlg : public GaudiAlgorithm
+{
+
+    public :
+
+        Edm4hepReadDCAlg(const std::string& name, ISvcLocator* svcLoc);
+
+        virtual StatusCode initialize();
+        virtual StatusCode execute();
+        virtual StatusCode finalize();
+
+    private :
+
+        // DataHandle<edm4hep::EventHeaderCollection> m_headerCol{"EventHeader", Gaudi::DataHandle::Reader, this};
+        DataHandle<edm4hep::MCParticleCollection> m_mcParCol{"MCParticle", Gaudi::DataHandle::Reader, this};
+        DataHandle<edm4hep::SimTrackerHitCollection> m_dcCol{"DriftChamberHitsCollection", 
+                Gaudi::DataHandle::Reader, this};
+
+};
+
+#endif
diff --git a/README.md b/README.md
index 995ab2bae06fe1b3306b413a83ea65eaadd46a3b..38d12a14f9f6ce83b206b1bec33c4ff17edc85ff 100644
--- a/README.md
+++ b/README.md
@@ -1,6 +1,7 @@
 # [CEPCSW](https://cepc.github.io/CEPCSW/)
 
 [![Build Status](https://www.travis-ci.com/cepc/CEPCSW.svg?branch=master)](https://www.travis-ci.com/cepc/CEPCSW)
+[![CI](https://github.com/cepc/CEPCSW/workflows/CI/badge.svg?branch=master)](https://github.com/cepc/CEPCSW/actions)
 
 CEPC offline software prototype based on [Key4hep](https://github.com/key4hep).
 
diff --git a/Reconstruction/PFA/Pandora/GaudiPandora/include/CaloHitCreator.h b/Reconstruction/PFA/Pandora/GaudiPandora/include/CaloHitCreator.h
index b947f49d25bf7e6147302d4c167e3bac7b026227..df9793abc42eca3ebf7c83ae6a968077ec65ee3a 100644
--- a/Reconstruction/PFA/Pandora/GaudiPandora/include/CaloHitCreator.h
+++ b/Reconstruction/PFA/Pandora/GaudiPandora/include/CaloHitCreator.h
@@ -50,10 +50,15 @@ public:
         Settings();
 
         StringVector    m_eCalCaloHitCollections;               ///< The ecal calorimeter hit collections
+        StringVector    m_eCalCaloReadOuts;                     ///< The ecal calorimeter ReadOut
         StringVector    m_hCalCaloHitCollections;               ///< The hcal calorimeter hit collections
+        StringVector    m_hCalCaloReadOuts;                     ///< The hcal calorimeter ReadOut
         StringVector    m_lCalCaloHitCollections;               ///< The lcal calorimeter hit collections
+        StringVector    m_lCalCaloReadOuts;                     ///< The lcal calorimeter ReadOut
         StringVector    m_lHCalCaloHitCollections;              ///< The lhcal calorimeter hit collections
+        StringVector    m_lHCalCaloReadOuts;                     ///< The lhcal calorimeter ReadOut
         StringVector    m_muonCaloHitCollections;               ///< The muon calorimeter hit collections
+        StringVector    m_muonCalCaloReadOuts;                     ///< The muon calorimeter ReadOut
 
         float           m_absorberRadLengthECal;                ///< The absorber radiation length in the ECal
         float           m_absorberIntLengthECal;                ///< The absorber interaction length in the ECal
@@ -100,6 +105,7 @@ public:
         bool            m_use_dd4hep_geo;                       /// 
         bool            m_use_dd4hep_decoder;                       /// 
         bool            m_use_preshower;                       /// 
+        bool            m_debug;
     };
 
     /**
diff --git a/Reconstruction/PFA/Pandora/GaudiPandora/include/GeometryCreator.h b/Reconstruction/PFA/Pandora/GaudiPandora/include/GeometryCreator.h
index de894a78c27d288fc54028afa002d2beedd9a1cb..442a356b05b90fe2dbf8999159e08aa6fac7872a 100644
--- a/Reconstruction/PFA/Pandora/GaudiPandora/include/GeometryCreator.h
+++ b/Reconstruction/PFA/Pandora/GaudiPandora/include/GeometryCreator.h
@@ -59,6 +59,7 @@ public:
         int             m_hCalRingOuterSymmetryOrder;           ///< HCal ring outer symmetry order (missing from ILD gear files)
         float           m_hCalRingOuterPhiCoordinate;           ///< HCal ring outer phi coordinate (missing from ILD gear files)
         bool            m_use_dd4hep_geo;           ///true to use dd4hep geo info
+        bool            m_debug;
     };
 
     /**
diff --git a/Reconstruction/PFA/Pandora/GaudiPandora/include/MCParticleCreator.h b/Reconstruction/PFA/Pandora/GaudiPandora/include/MCParticleCreator.h
index 0926f870b6dc8738a7122f1a412f2ece40077f7a..4e446cf9c59ed15ea3f28034f99adedd8f407917 100644
--- a/Reconstruction/PFA/Pandora/GaudiPandora/include/MCParticleCreator.h
+++ b/Reconstruction/PFA/Pandora/GaudiPandora/include/MCParticleCreator.h
@@ -39,6 +39,7 @@ public:
         StringVector    m_CaloHitRelationCollections;         ///< The SimCaloHit to CaloHit particle relations
         StringVector    m_TrackRelationCollections;           ///< The SimTrackerHit to TrackerHit particle relations
         float           m_bField;                             ///< m_bField
+        bool            m_debug;
     };
 
     /**
diff --git a/Reconstruction/PFA/Pandora/GaudiPandora/include/PandoraPFAlg.h b/Reconstruction/PFA/Pandora/GaudiPandora/include/PandoraPFAlg.h
index 4dd9b784d53fa83cf1fdb82086ade7ae4ec71b6f..a74b8a77297e8facbbf6aee29c6916d35c0497c8 100644
--- a/Reconstruction/PFA/Pandora/GaudiPandora/include/PandoraPFAlg.h
+++ b/Reconstruction/PFA/Pandora/GaudiPandora/include/PandoraPFAlg.h
@@ -132,10 +132,15 @@ protected:
 
   Gaudi::Property< std::vector<std::string> > m_TrackCollections{ this, "TrackCollections", {"MarlinTrkTracks"} };
   Gaudi::Property< std::vector<std::string> > m_ECalCaloHitCollections{ this, "ECalCaloHitCollections", {"ECALBarrel","ECALEndcap","ECALOther"} };
+  Gaudi::Property< std::vector<std::string> > m_ECalReadOutNames      { this, "ECalReadOutNames", {"EcalBarrelCollection","EcalEndcapsCollection","ECALOther"} };
   Gaudi::Property< std::vector<std::string> > m_HCalCaloHitCollections{ this, "HCalCaloHitCollections", {"HCALBarrel","HCALEndcap","HCALOther"} };
+  Gaudi::Property< std::vector<std::string> > m_HCalReadOutNames      { this, "HCalReadOutNames", {"HcalBarrelCollection","HcalEndcapsCollection","HCALOther"} };
   Gaudi::Property< std::vector<std::string> > m_LCalCaloHitCollections{ this, "LCalCaloHitCollections", {"LCAL"} };
+  Gaudi::Property< std::vector<std::string> > m_LCalReadOutNames      { this, "LCalReadOutNames", {"LcalBarrelCollection"} };
   Gaudi::Property< std::vector<std::string> > m_LHCalCaloHitCollections{ this, "LHCalCaloHitCollections", {"LHCAL"} };
+  Gaudi::Property< std::vector<std::string> > m_LHCalReadOutNames      { this, "LHCalReadOutNames", {"LHcalBarrelCollection"} };
   Gaudi::Property< std::vector<std::string> > m_MuonCaloHitCollections{ this, "MuonCaloHitCollections", {"MUON"} };
+  Gaudi::Property< std::vector<std::string> > m_MuonCalReadOutNames      { this, "MuonCalReadOutNames", {"MuonCollection"} };
   Gaudi::Property< std::vector<std::string> > m_MCParticleCollections{ this, "MCParticleCollections", {"MCParticle"} };
   Gaudi::Property< std::vector<std::string> > m_RelCaloHitCollections{ this, "RelCaloHitCollections", {"RelationCaloHit","RelationMuonHit"} };
   Gaudi::Property< std::vector<std::string> > m_RelTrackCollections{ this, "RelTrackCollections", {"MarlinTrkTracksMCTruthLink"} };
@@ -257,6 +262,7 @@ protected:
   NTuple::Item<long>   m_n_mc;
   NTuple::Item<long>   m_n_rec;
   NTuple::Item<int>   m_hasConversion;
+  NTuple::Item<int>   m_marlinTrack;
   NTuple::Array<int  > m_pReco_PID;    
   NTuple::Array<float> m_pReco_mass;
   NTuple::Array<float> m_pReco_energy;
@@ -275,6 +281,7 @@ protected:
 
 
   
+  Gaudi::Property<bool> m_debug {this, "debug", false,"if do debug"};
   Gaudi::Property<bool> m_WriteAna {this, "WriteAna", false,"if do ana"};
   Gaudi::Property<bool> m_use_dd4hep_geo{this, "use_dd4hep_geo", false,"choose if use geo info from dd4hep"};
   Gaudi::Property<bool> m_use_dd4hep_decoder {this, "use_dd4hep_decoder", true,"if use decoder from dd4hep"};
diff --git a/Reconstruction/PFA/Pandora/GaudiPandora/include/PfoCreator.h b/Reconstruction/PFA/Pandora/GaudiPandora/include/PfoCreator.h
index ed69d77817a5d5ead53263c0b7b93f11d0d46918..1f97017ac33da390169fa16ec1d922c1d62b85e8 100644
--- a/Reconstruction/PFA/Pandora/GaudiPandora/include/PfoCreator.h
+++ b/Reconstruction/PFA/Pandora/GaudiPandora/include/PfoCreator.h
@@ -51,6 +51,7 @@ public:
         float           m_hadStochasticTerm;                    ///< The stochastic term for Hadronic shower energy resolution
         float           m_emConstantTerm;                       ///< The constant term for EM shower energy resolution
         float           m_hadConstantTerm;                      ///< The constant term for Hadronic shower energy resolution
+        bool            m_debug;
     };
 
     /**
diff --git a/Reconstruction/PFA/Pandora/GaudiPandora/include/TrackCreator.h b/Reconstruction/PFA/Pandora/GaudiPandora/include/TrackCreator.h
index 2b2c4011d2b24434816cd6bc94050dd540864a5e..ad8f903451f4cea1a2a9b2a1879a615fd01d4139 100644
--- a/Reconstruction/PFA/Pandora/GaudiPandora/include/TrackCreator.h
+++ b/Reconstruction/PFA/Pandora/GaudiPandora/include/TrackCreator.h
@@ -105,6 +105,7 @@ public:
         float           m_minTpcHitFractionOfExpected;          ///< Minimum fraction of TPC hits compared to expected
         int             m_minFtdHitsForTpcHitFraction;          ///< Minimum number of FTD hits to ignore TPC hit fraction
         bool            m_use_dd4hep_geo;          ///
+        bool            m_debug;
     };
 
     /**
diff --git a/Reconstruction/PFA/Pandora/GaudiPandora/src/CaloHitCreator.cpp b/Reconstruction/PFA/Pandora/GaudiPandora/src/CaloHitCreator.cpp
index a97fff97ae3bba4284739af60e15e539f948e71c..7e0836c9330ad81423000b6c6beebd22ee2cb1cd 100644
--- a/Reconstruction/PFA/Pandora/GaudiPandora/src/CaloHitCreator.cpp
+++ b/Reconstruction/PFA/Pandora/GaudiPandora/src/CaloHitCreator.cpp
@@ -49,9 +49,11 @@ CaloHitCreator::CaloHitCreator(const Settings &settings, const pandora::Pandora
         throw "Failed to find GearSvc ...";
     }
     _GEAR = iSvc->getGearMgr();
-    if(m_settings.m_use_dd4hep_geo){
+    if(m_settings.m_use_dd4hep_decoder){
         sc = svcloc->service("GeomSvc", m_geosvc, false);
         if (!sc) throw "Failed to find GeomSvc.";
+    }
+    if(m_settings.m_use_dd4hep_geo){
         const dd4hep::rec::LayeredCalorimeterData * eCalBarrelExtension= PanUtil::getExtension( ( dd4hep::DetType::CALORIMETER | dd4hep::DetType::ELECTROMAGNETIC | dd4hep::DetType::BARREL),
 										     ( dd4hep::DetType::AUXILIARY  |  dd4hep::DetType::FORWARD ) );
         m_eCalBarrelOuterZ        = eCalBarrelExtension->extent[3]/dd4hep::mm;
@@ -121,13 +123,14 @@ pandora::StatusCode CaloHitCreator::CreateCaloHits(const CollectionMaps& collect
 
 pandora::StatusCode CaloHitCreator::CreateECalCaloHits(const CollectionMaps& collectionMaps)
 {
-    for (StringVector::const_iterator iter = m_settings.m_eCalCaloHitCollections.begin(), iterEnd = m_settings.m_eCalCaloHitCollections.end();
-        iter != iterEnd; ++iter)
+    for (unsigned int k = 0; k < m_settings.m_eCalCaloHitCollections.size(); k++)
     {
-        if(collectionMaps.collectionMap_CaloHit.find(*iter) == collectionMaps.collectionMap_CaloHit.end()) { std::cout<<"not find "<<(*iter)<<std::endl; continue;}
+        std::string tmp_col_name = m_settings.m_eCalCaloHitCollections.at(k);
+        if(collectionMaps.collectionMap_CaloHit.find(tmp_col_name) == collectionMaps.collectionMap_CaloHit.end()) { std::cout<<"not find "<<tmp_col_name<<std::endl; continue;}
         try
         {
-            const std::vector<edm4hep::CalorimeterHit>& pCaloHitCollection = (collectionMaps.collectionMap_CaloHit.find(*iter))->second;
+            if(m_settings.m_debug) std::cout<<"CaloHitCreator for "<<tmp_col_name<<std::endl;
+            const std::vector<edm4hep::CalorimeterHit>& pCaloHitCollection = (collectionMaps.collectionMap_CaloHit.find(tmp_col_name))->second;
             const int nElements(pCaloHitCollection.size());
 
             if (0 == nElements)
@@ -141,8 +144,9 @@ pandora::StatusCode CaloHitCreator::CreateECalCaloHits(const CollectionMaps& col
             const std::string layerCoding(this->GetLayerCoding(layerCodingString));
             const std::string staveCoding(this->GetStaveCoding(layerCodingString));
             // get the DD4hep readout
-            const std::string name_readout = "EcalBarrelCollection";
-            if(m_settings.m_use_dd4hep_geo && m_settings.m_use_dd4hep_decoder ){
+            const std::string name_readout = m_settings.m_eCalCaloReadOuts.at(k);
+            if(m_settings.m_debug) std::cout<<"readout= "<<name_readout<<std::endl;
+            if( m_settings.m_use_dd4hep_decoder ){
                 m_decoder = m_geosvc->getDecoder(name_readout);
                 if (!m_decoder) throw "Failed to get the decoder. ";
             }
@@ -163,7 +167,7 @@ pandora::StatusCode CaloHitCreator::CreateECalCaloHits(const CollectionMaps& col
                     // Hybrid ECAL including pure ScECAL.
                     if (m_settings.m_useEcalScLayers)
                     {
-                        std::string collectionName(*iter);
+                        std::string collectionName(tmp_col_name);
                         std::transform(collectionName.begin(), collectionName.end(), collectionName.begin(), ::tolower);
 
                         if (collectionName.find("ecal", 0) == std::string::npos)
@@ -265,7 +269,7 @@ pandora::StatusCode CaloHitCreator::CreateECalCaloHits(const CollectionMaps& col
         }
         catch (...)
         {
-            std::cout<< "Failed to extract ecal calo hit collection: " << *iter << std::endl;
+            std::cout<< "Failed to extract ecal calo hit collection: " << tmp_col_name << std::endl;
         }
     }
 
diff --git a/Reconstruction/PFA/Pandora/GaudiPandora/src/GeometryCreator.cpp b/Reconstruction/PFA/Pandora/GaudiPandora/src/GeometryCreator.cpp
index 2e996bfcdf35bdd963a5c214e48f08e082bac6d4..7a9a74cfe3ce2de993ba4c6a68a48bf00ab2ba00 100644
--- a/Reconstruction/PFA/Pandora/GaudiPandora/src/GeometryCreator.cpp
+++ b/Reconstruction/PFA/Pandora/GaudiPandora/src/GeometryCreator.cpp
@@ -111,6 +111,7 @@ void GeometryCreator::SetMandatorySubDetectorParameters(SubDetectorTypeMap &subD
         trackerParameters.m_innerRCoordinate = tpcParameters.getPadLayout().getPlaneExtent()[0];
         trackerParameters.m_outerRCoordinate = tpcParameters.getPadLayout().getPlaneExtent()[1];
         trackerParameters.m_outerZCoordinate = tpcParameters.getMaxDriftLength();
+        std::cout<<"Gear m_innerRCoordinate="<<trackerParameters.m_innerRCoordinate.Get()<<",m_outerRCoordinate="<<trackerParameters.m_outerRCoordinate.Get()<<",m_outerZCoordinate="<<trackerParameters.m_outerZCoordinate.Get()<<std::endl;
     }
     trackerParameters.m_innerZCoordinate = 0.f;
     trackerParameters.m_innerPhiCoordinate = 0.f;
diff --git a/Reconstruction/PFA/Pandora/GaudiPandora/src/PandoraPFAlg.cpp b/Reconstruction/PFA/Pandora/GaudiPandora/src/PandoraPFAlg.cpp
index 92eff92534fe76494250e43867e63b28049f1deb..9d94a93931dd76458ac5da6cdc49a4762ad2ba59 100644
--- a/Reconstruction/PFA/Pandora/GaudiPandora/src/PandoraPFAlg.cpp
+++ b/Reconstruction/PFA/Pandora/GaudiPandora/src/PandoraPFAlg.cpp
@@ -83,6 +83,16 @@ void PandoraPFAlg::FinaliseSteeringParameters(ISvcLocator* svcloc)
         std::cout<<"m_innerBField="<<m_settings.m_innerBField<<std::endl;    
         m_mcParticleCreatorSettings.m_bField = m_settings.m_innerBField;
     }
+    std::cout<<"m_absorberRadLengthECal        ="<< m_geometryCreatorSettings.m_absorberRadLengthECal       <<std::endl;
+    std::cout<<"m_absorberIntLengthECal        ="<< m_geometryCreatorSettings.m_absorberIntLengthECal       <<std::endl;
+    std::cout<<"m_absorberRadLengthHCal        ="<< m_geometryCreatorSettings.m_absorberRadLengthHCal       <<std::endl;
+    std::cout<<"m_absorberIntLengthHCal        ="<< m_geometryCreatorSettings.m_absorberIntLengthHCal       <<std::endl;
+    std::cout<<"m_absorberRadLengthOther       ="<< m_geometryCreatorSettings.m_absorberRadLengthOther      <<std::endl;
+    std::cout<<"m_absorberIntLengthOther       ="<< m_geometryCreatorSettings.m_absorberIntLengthOther      <<std::endl;
+    std::cout<<"m_hCalEndCapInnerSymmetryOrder ="<< m_geometryCreatorSettings.m_hCalEndCapInnerSymmetryOrder<<std::endl;
+    std::cout<<"m_hCalEndCapInnerPhiCoordinate ="<< m_geometryCreatorSettings.m_hCalEndCapInnerPhiCoordinate<<std::endl;
+
+
 }
 
 
@@ -116,6 +126,7 @@ StatusCode PandoraPFAlg::initialize()
             m_tuple->addItem( "m_mc_pz"    , m_n_mc  ,m_mc_pz     ).ignore();
             m_tuple->addItem( "m_mc_charge", m_n_mc  ,m_mc_charge ).ignore();
             m_tuple->addItem( "m_hasConversion", m_hasConversion  ).ignore();
+            m_tuple->addItem( "m_marlinTrack", m_marlinTrack ).ignore();
           } 
           else { // did not manage to book the N tuple....
             error() << "    Cannot book N-tuple:" << long( m_tuple ) << endmsg;
@@ -169,6 +180,7 @@ StatusCode PandoraPFAlg::initialize()
   m_settings.m_muonBarrelBField = m_MuonBarrelBField; 
   m_settings.m_muonEndCapBField = m_MuonEndCapBField;
   
+  m_trackCreatorSettings.m_debug = m_debug;
   m_trackCreatorSettings.m_trackCollections = m_TrackCollections ; 
   m_trackCreatorSettings.m_kinkVertexCollections = m_KinkVertexCollections; 
   m_trackCreatorSettings.m_prongVertexCollections = m_ProngVertexCollections;
@@ -176,20 +188,28 @@ StatusCode PandoraPFAlg::initialize()
   m_trackCreatorSettings.m_v0VertexCollections = m_V0VertexCollections; 
   m_trackCreatorSettings.m_use_dd4hep_geo      = m_use_dd4hep_geo; 
   
+  m_caloHitCreatorSettings.m_debug = m_debug;
   m_caloHitCreatorSettings.m_eCalCaloHitCollections = m_ECalCaloHitCollections;
+  m_caloHitCreatorSettings.m_eCalCaloReadOuts       = m_ECalReadOutNames;
   m_caloHitCreatorSettings.m_hCalCaloHitCollections = m_HCalCaloHitCollections;
+  m_caloHitCreatorSettings.m_hCalCaloReadOuts       = m_HCalReadOutNames;
   m_caloHitCreatorSettings.m_lCalCaloHitCollections = m_LCalCaloHitCollections;
+  m_caloHitCreatorSettings.m_lCalCaloReadOuts       = m_LCalReadOutNames;
   m_caloHitCreatorSettings.m_lHCalCaloHitCollections = m_LHCalCaloHitCollections;
+  m_caloHitCreatorSettings.m_lHCalCaloReadOuts       = m_LHCalReadOutNames;
   m_caloHitCreatorSettings.m_muonCaloHitCollections = m_MuonCaloHitCollections; 
+  m_caloHitCreatorSettings.m_muonCalCaloReadOuts    = m_MuonCalReadOutNames;
   m_caloHitCreatorSettings.m_use_dd4hep_geo         = m_use_dd4hep_geo; 
   m_caloHitCreatorSettings.m_use_dd4hep_decoder     = m_use_dd4hep_decoder ; 
   m_caloHitCreatorSettings.m_use_preshower          = m_use_preshower  ; 
   m_mcParticleCreatorSettings.m_mcParticleCollections = m_MCParticleCollections;
   m_mcParticleCreatorSettings.m_CaloHitRelationCollections = m_RelCaloHitCollections; 
   m_mcParticleCreatorSettings.m_TrackRelationCollections = m_RelTrackCollections;
+  m_mcParticleCreatorSettings.m_debug = m_debug;
   
   
   // Absorber properties
+  m_geometryCreatorSettings.m_debug = m_debug;
   m_geometryCreatorSettings.m_absorberRadLengthECal = m_AbsorberRadLengthECal;
   m_geometryCreatorSettings.m_absorberIntLengthECal = m_AbsorberIntLengthECal;
   m_geometryCreatorSettings.m_absorberRadLengthHCal = m_AbsorberRadLengthHCal;
@@ -199,6 +219,7 @@ StatusCode PandoraPFAlg::initialize()
   
   // Name of PFO collection written by GaudiPandora
   
+  m_pfoCreatorSettings.m_debug = m_debug;
   m_pfoCreatorSettings.m_clusterCollectionName = m_ClusterCollectionName;// not used  
   m_pfoCreatorSettings.m_pfoCollectionName = m_PFOCollectionName;//
   m_pfoCreatorSettings.m_startVertexCollectionName = m_StartVertexCollectionName; //
@@ -443,6 +464,7 @@ collectionMap_TrkRel.clear();
 
 StatusCode PandoraPFAlg::updateMap()
 {
+    m_marlinTrack = 0; //check
     for(auto &v : m_dataHandles){
         try{
             if(m_collections[v.first]=="MCParticle"){
@@ -479,6 +501,7 @@ StatusCode PandoraPFAlg::updateMap()
                     m_CollectionMaps->collectionMap_Track[v.first] = v_cal ;
                     for(unsigned int i=0 ; i< po->size(); i++) m_CollectionMaps->collectionMap_Track [v.first].push_back(po->at(i));
                     std::cout<<"saved col name="<<v.first<<std::endl;
+                    m_marlinTrack = po->size();
                 }
                 else{
                 std::cout<<"don't find col name="<<v.first<<std::endl;
@@ -562,10 +585,11 @@ StatusCode PandoraPFAlg::Ana()
         m_pReco_py    [m_n_rec]=py;
         m_pReco_pz    [m_n_rec]=pz;
         m_n_rec ++ ;
+        if(m_debug) std::cout<<"rec type="<<type<<",energy="<<energy<<std::endl;
         for(int j=0; j < reco_associa_col->size(); j++)
         {
             if(reco_associa_col->at(j).getRec().id() != pReco.id() ) continue;
-            std::cout<<"MC pid ="<<reco_associa_col->at(j).getSim().getPDG()<<",weight="<<reco_associa_col->at(j).getWeight()<<", px="<<reco_associa_col->at(j).getSim().getMomentum()[0]<<", py="<<reco_associa_col->at(j).getSim().getMomentum()[1]<<",pz="<<reco_associa_col->at(j).getSim().getMomentum()[2]<<std::endl;
+            if(m_debug) std::cout<<"MC pid ="<<reco_associa_col->at(j).getSim().getPDG()<<",weight="<<reco_associa_col->at(j).getWeight()<<", px="<<reco_associa_col->at(j).getSim().getMomentum()[0]<<", py="<<reco_associa_col->at(j).getSim().getMomentum()[1]<<",pz="<<reco_associa_col->at(j).getSim().getMomentum()[2]<<std::endl;
         }
     }
     const edm4hep::MCParticleCollection*     MCParticle = nullptr;
@@ -581,6 +605,8 @@ StatusCode PandoraPFAlg::Ana()
             m_mc_py    [m_n_mc] = MCParticle->at(i).getMomentum()[1];
             m_mc_pz    [m_n_mc] = MCParticle->at(i).getMomentum()[2];
             m_mc_charge[m_n_mc] = MCParticle->at(i).getCharge();
+            float mc_E = sqrt( MCParticle->at(i).getMass()*MCParticle->at(i).getMass() + MCParticle->at(i).getMomentum()[0]*MCParticle->at(i).getMomentum()[0] + MCParticle->at(i).getMomentum()[1]*MCParticle->at(i).getMomentum()[1] + MCParticle->at(i).getMomentum()[2]*MCParticle->at(i).getMomentum()[2]);
+            if(m_debug) std::cout<<"mc type="<<MCParticle->at(i).getPDG()<<",energy="<<mc_E<<std::endl;
             m_n_mc ++ ;
             if (MCParticle->at(i).getPDG() != 22) continue;
             int hasEm = 0;
diff --git a/Reconstruction/PFA/Pandora/GaudiPandora/src/TrackCreator.cpp b/Reconstruction/PFA/Pandora/GaudiPandora/src/TrackCreator.cpp
index 8e51d16c863803f9f1b97b5b7596fa7b189f4a5e..f9fd064f1a7195bb046ebcb4efcf5d24895e69e2 100644
--- a/Reconstruction/PFA/Pandora/GaudiPandora/src/TrackCreator.cpp
+++ b/Reconstruction/PFA/Pandora/GaudiPandora/src/TrackCreator.cpp
@@ -8,6 +8,7 @@
 
 
 #include "edm4hep/Vertex.h"
+#include "edm4hep/Vector3f.h"
 #include "edm4hep/ReconstructedParticle.h"
 
 #include "gear/BField.h"
@@ -61,10 +62,11 @@ TrackCreator::TrackCreator(const Settings &settings, const pandora::Pandora *con
               //There should only be one TPC
               if(tpcDets.size()==1) {
                   theExtension = tpcDets[0].extension<dd4hep::rec::FixedPadSizeTPCData>();
-                  m_tpcInnerR = theExtension->rMin/dd4hep::mm ;
-                  m_tpcOuterR = theExtension->rMax/dd4hep::mm ;
+                  m_tpcInnerR = theExtension->rMinReadout/dd4hep::mm ;// keep same as Gear
+                  m_tpcOuterR = theExtension->rMaxReadout/dd4hep::mm ;
+                  m_tpcZmax   = theExtension->driftLength/dd4hep::mm ;
                   m_tpcMaxRow = theExtension->maxRow;
-                  m_tpcZmax   = theExtension->zHalf/dd4hep::mm ;
+                  std::cout<<"DD4HEP m_tpcInnerR="<<m_tpcInnerR<<",m_tpcOuterR="<<m_tpcOuterR<<",m_tpcMaxRow="<<m_tpcMaxRow<<",m_tpcZmax="<<m_tpcZmax<<std::endl;
               }
               else{ 
                   m_tpcInnerR = 100 ;
@@ -102,7 +104,7 @@ TrackCreator::TrackCreator(const Settings &settings, const pandora::Pandora *con
                   // Take the mean z position of the staggered petals
                   const double zpos(thisLayer.zPosition/dd4hep::mm);
                   m_ftdZPositions.push_back(zpos);
-                  std::cout << "     layer " << i << " - mean z position = " << zpos << std::endl;
+                  std::cout << "DD:   layer " << i << " - mean z position = " << zpos << std::endl;
                 }
                 m_nFtdLayers = m_ftdZPositions.size() ;
             }
@@ -132,6 +134,7 @@ TrackCreator::TrackCreator(const Settings &settings, const pandora::Pandora *con
         m_tpcOuterR               = (_GEAR->getTPCParameters().getPadLayout().getPlaneExtent()[1]);
         m_tpcMaxRow               = (_GEAR->getTPCParameters().getPadLayout().getNRows());
         m_tpcZmax                 = (_GEAR->getTPCParameters().getMaxDriftLength());
+        std::cout<<"Gear: m_tpcInnerR="<<m_tpcInnerR<<",m_tpcOuterR="<<m_tpcOuterR<<",m_tpcMaxRow="<<m_tpcMaxRow<<",m_tpcZmax="<<m_tpcZmax<<std::endl;
         try{
             m_ftdInnerRadii = _GEAR->getGearParameters("FTD").getDoubleVals("FTDInnerRadius");
             m_ftdOuterRadii = _GEAR->getGearParameters("FTD").getDoubleVals("FTDOuterRadius");
@@ -149,7 +152,7 @@ TrackCreator::TrackCreator(const Settings &settings, const pandora::Pandora *con
                 // Take the mean z position of the staggered petals
                 const double zpos(ftdLayerLayout.getZposition(i));
                 m_ftdZPositions.push_back(zpos);
-                std::cout << "     layer " << i << " - mean z position = " << zpos << std::endl;
+                std::cout << "Gear: layer " << i << " - mean z position = " << zpos << std::endl;
             }
             m_nFtdLayers = m_ftdZPositions.size() ;
         }
@@ -502,7 +505,7 @@ const edm4hep::Track* TrackCreator::GetTrackAddress(const CollectionMaps& collec
 
 pandora::StatusCode TrackCreator::CreateTracks(const CollectionMaps& collectionMaps)
 {
-    std::cout<<"start TrackCreator::CreateTracks:"<<std::endl;
+    if(m_settings.m_debug) std::cout<<"start TrackCreator::CreateTracks:"<<std::endl;
     for (StringVector::const_iterator iter = m_settings.m_trackCollections.begin(), iterEnd = m_settings.m_trackCollections.end();
         iter != iterEnd; ++iter)
     {
@@ -511,6 +514,7 @@ pandora::StatusCode TrackCreator::CreateTracks(const CollectionMaps& collectionM
         {
             const std::vector<edm4hep::Track>& pTrackCollection = (collectionMaps.collectionMap_Track.find(*iter))->second;
 
+            if(m_settings.m_debug) std::cout<<"TrackSize:"<<pTrackCollection.size()<<std::endl;
             for (int i = 0, iMax = pTrackCollection.size(); i < iMax; ++i)
             {
                 try
@@ -519,7 +523,14 @@ pandora::StatusCode TrackCreator::CreateTracks(const CollectionMaps& collectionM
                     const edm4hep::Track* pTrack  = (const edm4hep::Track*)(&pTrack0);
 
                     if (NULL == pTrack) throw ("Collection type mismatch");
-
+                    if(m_settings.m_debug){
+                        for(int ip=0; ip<pTrack->trackStates_size(); ip++){
+                            edm4hep::TrackState tmp_pTrackState = pTrack->getTrackStates(ip);
+                            const double tmp_pt(m_bField * 2.99792e-4 / std::fabs(tmp_pTrackState.omega));
+                            edm4hep::Vector3f pref = tmp_pTrackState.referencePoint;
+                            std::cout<<"ip="<<ip<<",pt=" << tmp_pt <<",refx="<<pref[0]<<",refy="<<pref[1]<<",refz="<<pref[2]<<",tanLambda=" << tmp_pTrackState.tanLambda<<",D0="<<tmp_pTrackState.D0<<",Z0="<<tmp_pTrackState.Z0<<",phi="<<tmp_pTrackState.phi<< std::endl;
+                        }
+                    }
                     int minTrackHits = m_settings.m_minTrackHits;
                     const float tanLambda(std::fabs(pTrack->getTrackStates(0).tanLambda));
 
@@ -569,6 +580,7 @@ pandora::StatusCode TrackCreator::CreateTracks(const CollectionMaps& collectionM
                     this->TrackReachesECAL(pTrack, trackParameters);
                     this->DefineTrackPfoUsage(pTrack, trackParameters);
 
+                    if(m_settings.m_debug) std::cout<<"i="<<i<<",canFormPfo=" << trackParameters.m_canFormPfo.Get()<<", m_canFormClusterlessPfo="<<trackParameters.m_canFormClusterlessPfo.Get()<<",m_reachesCalorimeter="<< trackParameters.m_reachesCalorimeter.Get()<<"," << std::endl;
                     PANDORA_THROW_RESULT_IF(pandora::STATUS_CODE_SUCCESS, !=, PandoraApi::Track::Create(*m_pPandora, trackParameters));
                     m_trackVector.push_back(pTrack);
                 }
@@ -595,18 +607,17 @@ pandora::StatusCode TrackCreator::CreateTracks(const CollectionMaps& collectionM
 
 void TrackCreator::GetTrackStates(const edm4hep::Track *const pTrack, PandoraApi::Track::Parameters &trackParameters) const
 {
-    edm4hep::TrackState pTrackState = pTrack->getTrackStates(1); // ref  /cvmfs/cepcsw.ihep.ac.cn/prototype/LCIO/include/EVENT/TrackState.h 
+    // for DD4HEP, 0 is IP, 1 is AtFirstHit, 2 is AtLastHit, 3 is AtCalo
+    edm4hep::TrackState pTrackState = pTrack->getTrackStates(0); 
 
     const double pt(m_bField * 2.99792e-4 / std::fabs(pTrackState.omega));
     trackParameters.m_momentumAtDca = pandora::CartesianVector(std::cos(pTrackState.phi), std::sin(pTrackState.phi), pTrackState.tanLambda) * pt;
-    this->CopyTrackState(pTrack->getTrackStates(2), trackParameters.m_trackStateAtStart);
+    this->CopyTrackState(pTrack->getTrackStates(1), trackParameters.m_trackStateAtStart);//m_trackStateAtStart is AtFirstHit
 
     auto pEndTrack = (pTrack->tracks_size() ==0 ) ?  *pTrack  :  pTrack->getTracks(pTrack->tracks_size()-1);
 
-    this->CopyTrackState(pEndTrack.getTrackStates(3), trackParameters.m_trackStateAtEnd);
-    //FIXME ? LCIO input only has 4 states, so 4 can't be used.
-    if( pEndTrack.trackStates_size()<5) this->CopyTrackState(pEndTrack.getTrackStates(3), trackParameters.m_trackStateAtCalorimeter);
-    else  this->CopyTrackState(pEndTrack.getTrackStates(4), trackParameters.m_trackStateAtCalorimeter);
+    this->CopyTrackState(pEndTrack.getTrackStates(2), trackParameters.m_trackStateAtEnd);// m_trackStateAtEnd is AtLastHit
+    this->CopyTrackState(pEndTrack.getTrackStates(3), trackParameters.m_trackStateAtCalorimeter);
     
     
     trackParameters.m_isProjectedToEndCap = ((std::fabs(trackParameters.m_trackStateAtCalorimeter.Get().GetPosition().GetZ()) < m_eCalEndCapInnerZ) ? false : true);
@@ -802,6 +813,7 @@ void TrackCreator::DefineTrackPfoUsage(const edm4hep::Track *const pTrack, Pando
 
         if (this->PassesQualityCuts(pTrack, trackParameters))
         {
+            if(m_settings.m_debug) std::cout<<"passed PassesQualityCuts"<<std::endl;
             const pandora::CartesianVector &momentumAtDca(trackParameters.m_momentumAtDca.Get());
             const float pX(momentumAtDca.GetX()), pY(momentumAtDca.GetY()), pZ(momentumAtDca.GetZ());
             const float pT(std::sqrt(pX * pX + pY * pY));
@@ -949,7 +961,7 @@ int TrackCreator::GetNTpcHits(const edm4hep::Track *const pTrack) const
         //According to FG: [ 2 * lcio::ILDDetID::TPC - 2 ] is the first number and it is supposed to
         //be the number of hits in the fit and this is what should be used !
         // at least for DD4hep/DDSim
-        return pTrack->getSubDetectorHitNumbers(2 * 4 - 2 );//FIXME
+        return pTrack->getSubDetectorHitNumbers(3);//FIXME https://github.com/wenxingfang/CEPCSW/blob/master/Reconstruction/Tracking/src/FullLDCTracking/FullLDCTrackingAlg.cpp#L483
     }
     else return pTrack->getSubDetectorHitNumbers(2 * 4 - 1);// lcio::ILDDetID::TPC=4, still use LCIO code now
 }
@@ -965,7 +977,7 @@ int TrackCreator::GetNFtdHits(const edm4hep::Track *const pTrack) const
     // ---- use hitsInFit :
     //return pTrack->getSubdetectorHitNumbers()[ 2 * lcio::ILDDetID::FTD - 1 ];
     if(m_settings.m_use_dd4hep_geo){
-        return pTrack->getSubDetectorHitNumbers(2 * 3 - 1);//FIXME
+        return pTrack->getSubDetectorHitNumbers(1);//FIXME https://github.com/wenxingfang/CEPCSW/blob/master/Reconstruction/Tracking/src/FullLDCTracking/FullLDCTrackingAlg.cpp#L481
     }
     else return pTrack->getSubDetectorHitNumbers( 2 * 3 - 1 );// lcio::ILDDetID::FTD=3
 }
diff --git a/Reconstruction/PFA/Pandora/GaudiPandora/src/Utility.cpp b/Reconstruction/PFA/Pandora/GaudiPandora/src/Utility.cpp
index 02797f01c188f175867e7e1af78ac0fc1e239322..83edea103d7fab42363d57e7076ba8b4c7829177 100644
--- a/Reconstruction/PFA/Pandora/GaudiPandora/src/Utility.cpp
+++ b/Reconstruction/PFA/Pandora/GaudiPandora/src/Utility.cpp
@@ -22,7 +22,7 @@ std::vector<double> PanUtil::getTrackingRegionExtent(){
   extent.reserve(3);
   try{ 
       dd4hep::Detector & mainDetector = dd4hep::Detector::getInstance();
-      extent[0]=0.1; ///FIXME! CLIC-specific: Inner radius was set to 0 for SiD-type detectors
+      extent[0]=329; ///FIXME! CEPCv4-specific
       extent[1]=mainDetector.constantAsDouble("tracker_region_rmax")/dd4hep::mm;
       extent[2]=mainDetector.constantAsDouble("tracker_region_zmax")/dd4hep::mm;
   }
diff --git a/Reconstruction/PFA/Pandora/PandoraLikelihoodData9EBin.xml b/Reconstruction/PFA/Pandora/PandoraLikelihoodData9EBin.xml
index ab63905438a22a636fc7d58a6853acc4f858533e..3123ccf89061825c1974bf693d19bf5c58b200f5 100644
--- a/Reconstruction/PFA/Pandora/PandoraLikelihoodData9EBin.xml
+++ b/Reconstruction/PFA/Pandora/PandoraLikelihoodData9EBin.xml
@@ -1,652 +1,652 @@
 <NEnergyBins>9</NEnergyBins>
 <EnergyBinLowerEdges>0 0.2 0.5 1 1.5 2.5 5 10 20 </EnergyBinLowerEdges>
-<NSignalEvents>42213 22561 20497 14219 19767 26770 22039 14547 10186 </NSignalEvents>
-<NBackgroundEvents>109034 45109 13323 4171 3447 3033 2077 1206 1006 </NBackgroundEvents>
+<NSignalEvents>0 0 0 0 0 0 0 0 0 </NSignalEvents>
+<NBackgroundEvents>32791 5844 2492 1566 2072 3443 4109 5165 16767 </NBackgroundEvents>
 <PhotonSigPeakRms_0>
     <NBinsX>50</NBinsX>
     <XLow>0</XLow>
     <XHigh>5</XHigh>
-    <BinContents>0 0 0 0.000213204 0.00485632 0.0255372 0.0994717 0.15481 0.0870111 0.0978845 0.0800701 0.0638429 0.0593656 0.0497714 0.0426172 0.0375951 0.0313884 0.0267216 0.0234999 0.0200649 0.0174117 0.0140478 0.0110393 0.00916779 0.00864663 0.00575652 0.00547225 0.00381399 0.0035771 0.0028901 0.00232156 0.00198991 0.00172933 0.00127923 0.00116078 0.000947575 0.000639613 0.000331651 0.000473788 0.000426409 0.000355341 0.000331651 0.000260583 0.000260583 0.000260583 0.000118447 7.10682e-05 0.000331651 4.73788e-05 4.73788e-05 7.10682e-05 0 </BinContents>
+    <BinContents>0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 </BinContents>
 </PhotonSigPeakRms_0>
 <PhotonBkgPeakRms_0>
     <NBinsX>50</NBinsX>
     <XLow>0</XLow>
     <XHigh>5</XHigh>
-    <BinContents>0 0 0 0.000183429 0.00168755 0.0126291 0.0673093 0.147431 0.0799659 0.109259 0.0951355 0.0711154 0.0654383 0.0544968 0.0471596 0.0394831 0.0327054 0.0263221 0.0227177 0.0189482 0.0167562 0.0134729 0.011446 0.00903388 0.00792413 0.00656676 0.0058147 0.00423721 0.00423721 0.00329255 0.00319167 0.00265972 0.00228369 0.0020544 0.00180678 0.00159583 0.00145826 0.00132986 0.00114643 0.00113726 0.000953831 0.000953831 0.000935488 0.000834602 0.000596144 0.000412715 0.000412715 0.000403544 0.000421887 0.000247629 0.000394372 0 </BinContents>
+    <BinContents>0 0 0 6.09923e-05 0.00262267 0.0142417 0.0759355 0.146443 0.0792291 0.11125 0.0987466 0.0766369 0.0766979 0.0653533 0.0559605 0.0451953 0.035528 0.0278125 0.0219267 0.0175048 0.0124424 0.0101857 0.00741057 0.00530633 0.00387301 0.0024092 0.00213473 0.00170779 0.000731908 0.000853893 0.000518435 0.000457443 0.000243969 0.000243969 0.000121985 6.09923e-05 6.09923e-05 0 0 0 3.04962e-05 0 0 3.04962e-05 0 3.04962e-05 0 0 0 0 0 0 </BinContents>
 </PhotonBkgPeakRms_0>
 <PhotonSigPeakRms_1>
     <NBinsX>50</NBinsX>
     <XLow>0</XLow>
     <XHigh>5</XHigh>
-    <BinContents>0 0 0 0.000132973 0.00093081 0.00483135 0.0188378 0.0378086 0.0551837 0.0777448 0.1023 0.108949 0.1066 0.0948096 0.0789859 0.0641816 0.0491556 0.0402908 0.0274811 0.0224724 0.0156021 0.0133859 0.0121892 0.00979566 0.00771242 0.00611675 0.00540756 0.00483135 0.0047427 0.00367891 0.00305838 0.00257081 0.00248216 0.00164 0.00234919 0.00195027 0.00203892 0.00132973 0.00115243 0.00101946 0.00093081 0.0012854 0.000531891 0.000398918 0.000398918 0.000664864 0.000398918 0.000576216 0.000487567 0.00031027 0.000265946 0 </BinContents>
+    <BinContents>0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 </BinContents>
 </PhotonSigPeakRms_1>
 <PhotonBkgPeakRms_1>
     <NBinsX>50</NBinsX>
     <XLow>0</XLow>
     <XHigh>5</XHigh>
-    <BinContents>0 0 4.43371e-05 0.000665056 0.00181782 0.00589683 0.0195526 0.0389058 0.0514975 0.0672815 0.0762376 0.0795185 0.0771686 0.0732448 0.0666164 0.0605644 0.0513423 0.0425414 0.0407236 0.0338292 0.0288856 0.0250948 0.0215921 0.0178457 0.0153628 0.0141435 0.0114833 0.00935512 0.00791416 0.00773682 0.00649538 0.00476623 0.00418985 0.00474406 0.00399033 0.00336962 0.00272673 0.00270456 0.00266022 0.00195083 0.00192866 0.00172915 0.00157397 0.00175131 0.00164047 0.00168481 0.00104192 0.00113059 0.0011971 0.00115276 0.000709393 0 </BinContents>
+    <BinContents>0 0 0 0.000171116 0.00188227 0.00718686 0.0237851 0.0515058 0.0686174 0.08436 0.0833333 0.0879535 0.0817933 0.0773443 0.0793977 0.0626283 0.0511636 0.0482546 0.036961 0.0290897 0.0258385 0.0227584 0.0196783 0.0136893 0.0121492 0.00564682 0.00581793 0.00290897 0.00393566 0.00273785 0.00154004 0.00136893 0.00136893 0.00188227 0.000684463 0.000513347 0.000513347 0.000513347 0.000171116 0.000342231 0.000171116 0.000171116 0 0 0.000171116 0 0 0 0 0 0 0 </BinContents>
 </PhotonBkgPeakRms_1>
 <PhotonSigPeakRms_2>
     <NBinsX>50</NBinsX>
     <XLow>0</XLow>
     <XHigh>5</XHigh>
-    <BinContents>0 0 0 4.87876e-05 0 0.000487876 0.00278089 0.00482998 0.0105869 0.0228814 0.0499097 0.0847929 0.110894 0.131678 0.136605 0.115627 0.0926477 0.0687906 0.0494707 0.0325901 0.021369 0.0157096 0.0120018 0.00785481 0.00658633 0.00390301 0.00336635 0.00219544 0.00195151 0.0015612 0.00160999 0.000926965 0.000926965 0.000390301 0.000878177 0.000634239 0.000390301 0.000487876 0.000439089 0.000243938 0.000292726 0.000243938 4.87876e-05 0.000243938 0.000292726 9.75753e-05 0.000146363 0.000146363 0.000146363 4.87876e-05 0.000243938 0 </BinContents>
+    <BinContents>0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 </BinContents>
 </PhotonSigPeakRms_2>
 <PhotonBkgPeakRms_2>
     <NBinsX>50</NBinsX>
     <XLow>0</XLow>
     <XHigh>5</XHigh>
-    <BinContents>0 0 0.000225175 0.000600465 0.00150116 0.00360279 0.011559 0.0228177 0.02582 0.0390302 0.0531412 0.0672521 0.0832395 0.0880432 0.0803873 0.0737071 0.0711551 0.0585454 0.0469864 0.0385799 0.0316745 0.029648 0.0231179 0.0178638 0.0179389 0.0138107 0.0114088 0.0101329 0.00900698 0.0082564 0.00683029 0.00637994 0.00547925 0.00450349 0.00382797 0.00397808 0.00390302 0.00330256 0.00240186 0.00307738 0.00225174 0.0023268 0.00172634 0.00217669 0.00150116 0.00120093 0.00112587 0.00142611 0.00127599 0.00120093 0.00105081 0 </BinContents>
+    <BinContents>0 0 0 0 0.00120385 0.00280899 0.00963082 0.0292937 0.0658106 0.117175 0.117978 0.125201 0.110353 0.103531 0.0770466 0.0549759 0.0537721 0.0429374 0.0256822 0.0200642 0.0120385 0.0100321 0.00682183 0.00401284 0.00200642 0.00280899 0.0024077 0.000802568 0.000401284 0.000802568 0 0 0 0.000401284 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 </BinContents>
 </PhotonBkgPeakRms_2>
 <PhotonSigPeakRms_3>
     <NBinsX>50</NBinsX>
     <XLow>0</XLow>
     <XHigh>5</XHigh>
-    <BinContents>0 0 0 0 0 0.000562627 0.00105493 0.00281314 0.00464168 0.00829875 0.0132217 0.0302412 0.0673043 0.109923 0.138828 0.147338 0.131584 0.100992 0.0720866 0.0485969 0.0335467 0.0244743 0.0164569 0.0103383 0.00689219 0.0056966 0.00506365 0.00344609 0.00295379 0.00225051 0.00168788 0.0014769 0.00126591 0.00091427 0.00105493 0.000773613 0.000632956 0.000562627 0.000492299 0.000492299 0.000492299 0.000281314 0.000140657 7.03284e-05 0.000140657 7.03284e-05 0.000140657 0.000281314 0.000281314 7.03284e-05 7.03284e-05 0 </BinContents>
+    <BinContents>0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 </BinContents>
 </PhotonSigPeakRms_3>
 <PhotonBkgPeakRms_3>
     <NBinsX>50</NBinsX>
     <XLow>0</XLow>
     <XHigh>5</XHigh>
-    <BinContents>0 0 0.000959003 0.000959003 0.00119875 0.00263726 0.00455526 0.0129465 0.0148645 0.0275713 0.0357228 0.0417166 0.0592184 0.0748022 0.0863102 0.0949413 0.0937425 0.0791177 0.0678494 0.0537042 0.0431551 0.0364421 0.0198993 0.0218173 0.0177415 0.012467 0.0136658 0.00982978 0.00671302 0.00767202 0.00479501 0.00599377 0.00551427 0.00407576 0.00287701 0.00359626 0.00311676 0.00287701 0.00383601 0.00263726 0.00191801 0.00167825 0.00287701 0.00119875 0.00167825 0.00167825 0.0014385 0.00167825 0.00119875 0.00119875 0.00191801 0 </BinContents>
+    <BinContents>0 0 0 0 0 0 0.00446999 0.0159642 0.0434227 0.096424 0.132184 0.146871 0.1341 0.10281 0.0836526 0.0696041 0.054917 0.0408685 0.0255428 0.0172414 0.0108557 0.0083014 0.00446999 0.00063857 0.00319285 0.00191571 0.00127714 0 0.00063857 0 0 0 0 0 0.00063857 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 </BinContents>
 </PhotonBkgPeakRms_3>
 <PhotonSigPeakRms_4>
     <NBinsX>50</NBinsX>
     <XLow>0</XLow>
     <XHigh>5</XHigh>
-    <BinContents>0 0 0 0 0.000202357 0.000151768 0.00126473 0.00222593 0.00338949 0.00419892 0.00607072 0.0122932 0.0264582 0.0617696 0.105934 0.1459 0.14676 0.137047 0.103455 0.0766429 0.0498305 0.0324278 0.0233217 0.0125968 0.0107249 0.00698133 0.00490717 0.00480599 0.00344008 0.00288359 0.00212475 0.00156827 0.00106238 0.00131532 0.00080943 0.00101179 0.000708251 0.000910609 0.00075884 0.000556483 0.000657662 0.000404715 0.000354126 0.000455304 0.000202357 0.000354126 0.000151768 0.000252947 0.000202357 0.000252947 0.000202357 0 </BinContents>
+    <BinContents>0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 </BinContents>
 </PhotonSigPeakRms_4>
 <PhotonBkgPeakRms_4>
     <NBinsX>50</NBinsX>
     <XLow>0</XLow>
     <XHigh>5</XHigh>
-    <BinContents>0 0 0.000580215 0.000870322 0.00116043 0.00203075 0.00319118 0.00696258 0.0127647 0.018857 0.0208877 0.0345228 0.0368436 0.05396 0.0791993 0.0771685 0.100667 0.086452 0.0786191 0.0646939 0.0519292 0.0472875 0.0301712 0.0281404 0.0258196 0.0229185 0.0142153 0.00870322 0.00899333 0.0078329 0.00754279 0.00696258 0.00870322 0.00638236 0.00551204 0.00290107 0.00464172 0.00435161 0.00319118 0.00261097 0.00261097 0.00145054 0.00290107 0.00319118 0.00145054 0.00232086 0.00290107 0.00203075 0.000580215 0.00203075 0.000290107 0 </BinContents>
+    <BinContents>0 0 0 0 0.000482625 0.00144788 0.0111004 0.0183398 0.0241313 0.0511583 0.111004 0.151544 0.152992 0.124517 0.107143 0.0651544 0.0574324 0.0352317 0.0318533 0.0144788 0.0212355 0.00820463 0.00482625 0.0019305 0.00289575 0.000965251 0 0.000482625 0 0 0 0.000482625 0 0 0 0 0 0.000965251 0 0 0 0 0 0 0 0 0 0 0 0 0 0 </BinContents>
 </PhotonBkgPeakRms_4>
 <PhotonSigPeakRms_5>
     <NBinsX>50</NBinsX>
     <XLow>0</XLow>
     <XHigh>5</XHigh>
-    <BinContents>0 0 0 0 0 7.47105e-05 0.000747105 0.00194247 0.00265222 0.00414643 0.00489354 0.00638775 0.00762047 0.0194247 0.0411655 0.0872619 0.130855 0.147217 0.140082 0.115652 0.0861038 0.0577512 0.0395966 0.0255136 0.0187897 0.0132238 0.0100486 0.0075084 0.00649981 0.00377288 0.00373552 0.00272693 0.00212925 0.00164363 0.00164363 0.0014195 0.0010833 0.00100859 0.000971236 0.000560329 0.000933881 0.000635039 0.000373552 0.000448263 0.000485618 0.000410908 0.000298842 0.000112066 0.000261487 7.47105e-05 0.000112066 0 </BinContents>
+    <BinContents>0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 </BinContents>
 </PhotonSigPeakRms_5>
 <PhotonBkgPeakRms_5>
     <NBinsX>50</NBinsX>
     <XLow>0</XLow>
     <XHigh>5</XHigh>
-    <BinContents>0 0 0 0 0.000329707 0.000329707 0.00131883 0.00098912 0.00395648 0.00758325 0.0102209 0.0181339 0.0214309 0.0276954 0.0412133 0.0626442 0.0791296 0.0919881 0.0900099 0.0824266 0.0787999 0.0646225 0.0586878 0.0412133 0.0306627 0.0253874 0.019123 0.0211012 0.0151665 0.0121991 0.00923178 0.00890208 0.00758325 0.00956149 0.00626442 0.00560501 0.0052753 0.00395648 0.0052753 0.00296736 0.00395648 0.00296736 0.00395648 0.00296736 0.00329707 0.00263765 0.00296736 0.00164853 0.00329707 0.000659413 0.000659413 0 </BinContents>
+    <BinContents>0 0 0 0 0.000290444 0.002614 0.0136509 0.0217833 0.0226547 0.0255591 0.0752251 0.151322 0.187627 0.168167 0.114726 0.0659309 0.041824 0.0354342 0.0255591 0.0185884 0.0139413 0.005228 0.00319489 0.00348533 0.00116178 0.000871333 0.000580889 0.000290444 0.000290444 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 </BinContents>
 </PhotonBkgPeakRms_5>
 <PhotonSigPeakRms_6>
     <NBinsX>50</NBinsX>
     <XLow>0</XLow>
     <XHigh>5</XHigh>
-    <BinContents>0 0 0 0 0 4.53741e-05 0.000453741 0.0012251 0.00235945 0.00349381 0.00725986 0.0077136 0.00830346 0.0107083 0.0142475 0.030809 0.0653387 0.105949 0.14125 0.141113 0.126412 0.0980988 0.0671537 0.045601 0.0323517 0.02305 0.0158356 0.0112528 0.00925632 0.0064885 0.00480966 0.00426517 0.00299469 0.00190571 0.00163347 0.00167884 0.00154272 0.00131585 0.000408367 0.00077136 0.000499115 0.000408367 0.000544489 0.000226871 0.000317619 0.000317619 0.000181496 0.000181496 9.07482e-05 9.07482e-05 4.53741e-05 0 </BinContents>
+    <BinContents>0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 </BinContents>
 </PhotonSigPeakRms_6>
 <PhotonBkgPeakRms_6>
     <NBinsX>50</NBinsX>
     <XLow>0</XLow>
     <XHigh>5</XHigh>
-    <BinContents>0 0 0 0 0 0 0.000481464 0.000962927 0.00385171 0.00674049 0.00818488 0.00770342 0.0129995 0.0187771 0.0187771 0.0438132 0.0370727 0.0597015 0.0746269 0.0702937 0.0794415 0.0871449 0.0645161 0.0654791 0.0452576 0.0409244 0.0365912 0.0284064 0.0327395 0.0202215 0.0231103 0.0216659 0.0144439 0.0129995 0.0110737 0.00914781 0.00433317 0.0052961 0.0052961 0.00481464 0.00337025 0.00288878 0.00337025 0.00144439 0.00192585 0.00337025 0.00337025 0 0.00144439 0.000962927 0.000962927 0 </BinContents>
+    <BinContents>0 0 0 0 0 0.000243368 0.00584084 0.027744 0.0265271 0.0175225 0.0447798 0.13653 0.233147 0.20808 0.125091 0.0603553 0.0384522 0.0311511 0.0172791 0.0131419 0.00705768 0.00316379 0.00146021 0.00121684 0.000243368 0.000486736 0.000243368 0 0.000243368 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 </BinContents>
 </PhotonBkgPeakRms_6>
 <PhotonSigPeakRms_7>
     <NBinsX>50</NBinsX>
     <XLow>0</XLow>
     <XHigh>5</XHigh>
-    <BinContents>0 0 0 0 0 0 0 0 0.000481199 0.00288719 0.00481199 0.00749295 0.0103801 0.0105864 0.0139548 0.0204853 0.0338901 0.063587 0.10607 0.131986 0.147866 0.122225 0.0924589 0.0685365 0.0504571 0.0290094 0.021104 0.0145047 0.0129924 0.00866158 0.00680553 0.00501822 0.00281845 0.00247474 0.00213102 0.00130611 0.00116863 0.000962398 0.000824912 0.000618684 0.000343713 0.000206228 0.000274971 0.000206228 0.000137485 0.000137485 0 0 6.87427e-05 0 6.87427e-05 0 </BinContents>
+    <BinContents>0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 </BinContents>
 </PhotonSigPeakRms_7>
 <PhotonBkgPeakRms_7>
     <NBinsX>50</NBinsX>
     <XLow>0</XLow>
     <XHigh>5</XHigh>
-    <BinContents>0 0 0 0 0 0 0.000829187 0 0 0.00165837 0.00165837 0.00746269 0.00912106 0.0066335 0.0107794 0.0182421 0.0381426 0.0323383 0.0489221 0.0605307 0.0588723 0.0746269 0.0704809 0.0613599 0.0538972 0.0480929 0.0505804 0.0613599 0.053068 0.0414594 0.0290216 0.0273632 0.0298507 0.0215589 0.0182421 0.00829187 0.0107794 0.00912106 0.0107794 0.0066335 0.00165837 0.00497512 0.00248756 0.00414594 0.00248756 0.000829187 0 0 0.000829187 0 0.000829187 0 </BinContents>
+    <BinContents>0 0 0 0 0 0.000193611 0.000580833 0.00774443 0.0216844 0.0238141 0.0280736 0.0826718 0.245692 0.292546 0.155663 0.0658277 0.0340755 0.017425 0.0125847 0.00484027 0.00367861 0.00135528 0.00135528 0 0.000193611 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 </BinContents>
 </PhotonBkgPeakRms_7>
 <PhotonSigPeakRms_8>
     <NBinsX>50</NBinsX>
     <XLow>0</XLow>
     <XHigh>5</XHigh>
-    <BinContents>0 0 0 0 0 0 0 0 0 9.8174e-05 0.000883566 0.00137444 0.00274887 0.00382878 0.00854114 0.0105046 0.0196348 0.0350481 0.0608679 0.0949342 0.118692 0.125663 0.126743 0.112704 0.0869821 0.060966 0.0416258 0.0243471 0.0175731 0.0121736 0.009032 0.00628313 0.00549774 0.00343609 0.00274887 0.00215983 0.00137444 0.000687218 0.000687218 0.000785392 0.000589044 0.000392696 0.000196348 9.8174e-05 0 0 9.8174e-05 0 0 0 0 0 </BinContents>
+    <BinContents>0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 </BinContents>
 </PhotonSigPeakRms_8>
 <PhotonBkgPeakRms_8>
     <NBinsX>50</NBinsX>
     <XLow>0</XLow>
     <XHigh>5</XHigh>
-    <BinContents>0 0 0 0 0 0 0 0 0 0 0 0.000994036 0.000994036 0.00198807 0.00298211 0.00695825 0.0109344 0.0119284 0.0228628 0.0298211 0.0407555 0.05666 0.0685885 0.0854871 0.0755467 0.0805169 0.0785288 0.0675944 0.0606362 0.0536779 0.0447316 0.0377734 0.0357853 0.028827 0.026839 0.0208747 0.0139165 0.00894632 0.00397614 0.00397614 0.00795229 0.00397614 0.00198807 0.000994036 0.000994036 0 0 0.000994036 0 0 0 0 </BinContents>
+    <BinContents>0 0 0 0 0 0 0 0.000119282 0.000775333 0.00280313 0.00560625 0.017773 0.0948291 0.315978 0.374784 0.139679 0.03489 0.00834973 0.00316097 0.00059641 0.000417487 0.000238564 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 </BinContents>
 </PhotonBkgPeakRms_8>
 <PhotonSigRmsRatio_0>
     <NBinsX>30</NBinsX>
     <XLow>1</XLow>
     <XHigh>3</XHigh>
-    <BinContents>0 0.122877 0.0934072 0.085874 0.0783408 0.0719447 0.0632743 0.0581811 0.0520219 0.045223 0.04103 0.0363632 0.0317438 0.0279772 0.0241158 0.021581 0.0195201 0.0181698 0.0155639 0.0136688 0.0120105 0.00952313 0.00933362 0.00840973 0.00774643 0.00696468 0.00559069 0.00570914 0.00495108 0.00483263 0.00405088 0 </BinContents>
+    <BinContents>0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 </BinContents>
 </PhotonSigRmsRatio_0>
 <PhotonBkgRmsRatio_0>
     <NBinsX>30</NBinsX>
     <XLow>1</XLow>
     <XHigh>3</XHigh>
-    <BinContents>0 0.128409 0.085056 0.0776363 0.0704001 0.0624851 0.0577893 0.052103 0.0482327 0.0486545 0.0454445 0.0397216 0.0338885 0.0294954 0.0266064 0.0231121 0.0213328 0.0191867 0.0162243 0.015087 0.0132986 0.0117761 0.0114185 0.0105105 0.00974925 0.00872205 0.00805253 0.00725462 0.0067135 0.00589724 0.00574133 0 </BinContents>
+    <BinContents>0 0.115093 0.0951481 0.0821872 0.0746241 0.0691653 0.063371 0.0584612 0.0538867 0.047879 0.0431521 0.0374188 0.0333933 0.0294593 0.0275685 0.0230856 0.0207679 0.0179927 0.0152176 0.0142722 0.01168 0.0103382 0.00978927 0.00811198 0.00741057 0.00707511 0.00494038 0.00512336 0.0047879 0.0047879 0.00381202 0 </BinContents>
 </PhotonBkgRmsRatio_0>
 <PhotonSigRmsRatio_1>
     <NBinsX>30</NBinsX>
     <XLow>1</XLow>
     <XHigh>3</XHigh>
-    <BinContents>0 0.122512 0.112273 0.100483 0.0878064 0.0772129 0.0699437 0.0597048 0.0542529 0.0468064 0.0381189 0.0327556 0.0286335 0.0246886 0.0201675 0.019813 0.0155135 0.0132973 0.0117903 0.0107265 0.00899783 0.00802269 0.00589513 0.00567351 0.00465405 0.00429945 0.00421081 0.00367891 0.00279243 0.00314702 0.00212757 0 </BinContents>
+    <BinContents>0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 </BinContents>
 </PhotonSigRmsRatio_1>
 <PhotonBkgRmsRatio_1>
     <NBinsX>30</NBinsX>
     <XLow>1</XLow>
     <XHigh>3</XHigh>
-    <BinContents>0 0.11 0.0959232 0.0860139 0.0770135 0.0702077 0.0618724 0.0554657 0.0507438 0.0441154 0.0419428 0.0352923 0.0298832 0.0284644 0.024075 0.0227006 0.0205724 0.0195083 0.0161165 0.0146977 0.0127469 0.0120818 0.0100423 0.0101975 0.00966548 0.00804717 0.00755947 0.00720477 0.00620719 0.00607418 0.0055643 0 </BinContents>
+    <BinContents>0 0.119439 0.0966804 0.0965092 0.0896646 0.0809377 0.0663929 0.0583504 0.0573238 0.0432923 0.0431212 0.0335387 0.0323409 0.0253251 0.0208761 0.0213895 0.013347 0.0128337 0.0136893 0.011807 0.011807 0.0112936 0.00581793 0.00496235 0.00581793 0.00513347 0.00581793 0.00308008 0.0032512 0.0032512 0.00290897 0 </BinContents>
 </PhotonBkgRmsRatio_1>
 <PhotonSigRmsRatio_2>
     <NBinsX>30</NBinsX>
     <XLow>1</XLow>
     <XHigh>3</XHigh>
-    <BinContents>0 0.157535 0.138313 0.121725 0.104893 0.0883056 0.0722545 0.0612773 0.0521052 0.0390301 0.0320535 0.0252232 0.0215153 0.0172708 0.013319 0.0115627 0.00756208 0.00751329 0.00648875 0.00502513 0.0035615 0.00224423 0.00224423 0.00180514 0.00200029 0.00126848 0.00107333 0.00112212 0.000926965 0.000390301 0.000390301 0 </BinContents>
+    <BinContents>0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 </BinContents>
 </PhotonSigRmsRatio_2>
 <PhotonBkgRmsRatio_2>
     <NBinsX>30</NBinsX>
     <XLow>1</XLow>
     <XHigh>3</XHigh>
-    <BinContents>0 0.124446 0.117316 0.0990768 0.0917961 0.0779104 0.0668768 0.0587705 0.0504391 0.0409818 0.0385799 0.030999 0.0288974 0.0220671 0.0210163 0.0153869 0.0156121 0.0135105 0.0128349 0.010358 0.0101329 0.0082564 0.00698041 0.00668018 0.006455 0.00495384 0.00517901 0.00457855 0.00292727 0.00367785 0.00330256 0 </BinContents>
+    <BinContents>0 0.136838 0.140449 0.109149 0.0983146 0.0822632 0.0774478 0.0626003 0.0485554 0.0473515 0.0288925 0.0337079 0.0228732 0.0184591 0.0176565 0.00922953 0.00842697 0.0100321 0.00682183 0.00561798 0.00722311 0.00642055 0.00321027 0.0024077 0.0024077 0.0024077 0.00401284 0.00280899 0.00160514 0.00280899 0 0 </BinContents>
 </PhotonBkgRmsRatio_2>
 <PhotonSigRmsRatio_3>
     <NBinsX>30</NBinsX>
     <XLow>1</XLow>
     <XHigh>3</XHigh>
-    <BinContents>0 0.181096 0.166327 0.131936 0.113369 0.0912863 0.0707504 0.0577396 0.0446586 0.0326324 0.0264435 0.0197623 0.0148393 0.0110416 0.00787678 0.00675153 0.00478233 0.00337576 0.00344609 0.00281314 0.00189887 0.00161755 0.00140657 0.000984598 0.000703284 0.000351642 0.000492299 0.000492299 0.000281314 0.000421971 0.000421971 0 </BinContents>
+    <BinContents>0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 </BinContents>
 </PhotonSigRmsRatio_3>
 <PhotonBkgRmsRatio_3>
     <NBinsX>30</NBinsX>
     <XLow>1</XLow>
     <XHigh>3</XHigh>
-    <BinContents>0 0.157996 0.135939 0.110285 0.107169 0.078878 0.0733637 0.0618557 0.0409974 0.0419564 0.0347638 0.0246943 0.0165428 0.0239751 0.0158235 0.011508 0.00982978 0.00863102 0.00551427 0.00839127 0.00455526 0.00503476 0.00287701 0.00407576 0.00263726 0.00335651 0.00191801 0.00311676 0.00191801 0.00119875 0.00119875 0 </BinContents>
+    <BinContents>0 0.168582 0.145594 0.112388 0.0989783 0.0836526 0.0862069 0.0625798 0.0491699 0.0395913 0.0255428 0.0312899 0.0185185 0.0114943 0.0166028 0.00702427 0.0063857 0.0083014 0.00702427 0.00255428 0.00766284 0.00191571 0.00255428 0.00063857 0.00191571 0.00191571 0.00063857 0 0 0.00063857 0.00063857 0 </BinContents>
 </PhotonBkgRmsRatio_3>
 <PhotonSigRmsRatio_4>
     <NBinsX>30</NBinsX>
     <XLow>1</XLow>
     <XHigh>3</XHigh>
-    <BinContents>0 0.203572 0.180199 0.155765 0.116659 0.090302 0.0672839 0.0489199 0.035969 0.0283806 0.0197804 0.0142662 0.00900491 0.00804371 0.00500835 0.0033389 0.00268124 0.00252947 0.00197299 0.00136591 0.00101179 0.000860019 0.000657662 0.000860019 0.000556483 0.000252947 0.000404715 5.05894e-05 0.000101179 5.05894e-05 0.000151768 0 </BinContents>
+    <BinContents>0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 </BinContents>
 </PhotonSigRmsRatio_4>
 <PhotonBkgRmsRatio_4>
     <NBinsX>30</NBinsX>
     <XLow>1</XLow>
     <XHigh>3</XHigh>
-    <BinContents>0 0.173194 0.158979 0.120104 0.111981 0.0844212 0.0690455 0.0586017 0.0420656 0.0348129 0.0249492 0.0203075 0.0182768 0.0124746 0.010734 0.010734 0.010734 0.00899333 0.00725268 0.0037714 0.0037714 0.00232086 0.00145054 0.00116043 0.00261097 0.00174064 0.00174064 0.000870322 0.000870322 0.000580215 0.00145054 0 </BinContents>
+    <BinContents>0 0.165541 0.148166 0.131274 0.10666 0.0916988 0.0694981 0.0598456 0.0530888 0.0313707 0.0352317 0.0212355 0.0178571 0.0125483 0.011583 0.00965251 0.00772201 0.00723938 0.00530888 0.0019305 0.00289575 0.00144788 0.00241313 0.000965251 0.000965251 0.000965251 0.000482625 0 0 0.00144788 0.000965251 0 </BinContents>
 </PhotonBkgRmsRatio_4>
 <PhotonSigRmsRatio_5>
     <NBinsX>30</NBinsX>
     <XLow>1</XLow>
     <XHigh>3</XHigh>
-    <BinContents>0 0.240605 0.202652 0.159357 0.118379 0.0868136 0.0602167 0.0386627 0.0288383 0.0196489 0.0131117 0.00833022 0.00620097 0.00437056 0.002839 0.00212925 0.00149421 0.00119537 0.00104595 0.000896526 0.000672394 0.000522973 0.000448263 0.000298842 0.000373552 0.000149421 7.47105e-05 0.000224131 0.000112066 0.000261487 7.47105e-05 0 </BinContents>
+    <BinContents>0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 </BinContents>
 </PhotonSigRmsRatio_5>
 <PhotonBkgRmsRatio_5>
     <NBinsX>30</NBinsX>
     <XLow>1</XLow>
     <XHigh>3</XHigh>
-    <BinContents>0 0.183976 0.16881 0.149027 0.107814 0.0877019 0.0652819 0.0530828 0.0375865 0.0323112 0.0240686 0.0154962 0.0161556 0.0128586 0.00923178 0.00791296 0.00428619 0.00329707 0.0052753 0.00131883 0.00197824 0.00329707 0.00131883 0.00164853 0.000329707 0.00131883 0.000659413 0.00098912 0.00131883 0.00098912 0.000659413 0 </BinContents>
+    <BinContents>0 0.185013 0.157711 0.15016 0.123148 0.0923613 0.073192 0.0560558 0.0380482 0.0351438 0.023526 0.0177171 0.0121987 0.010456 0.00580889 0.00348533 0.00319489 0.00319489 0.00232356 0.00174267 0.000871333 0.00145222 0.000871333 0.00116178 0.000871333 0 0.000290444 0 0 0 0 0 </BinContents>
 </PhotonBkgRmsRatio_5>
 <PhotonSigRmsRatio_6>
     <NBinsX>30</NBinsX>
     <XLow>1</XLow>
     <XHigh>3</XHigh>
-    <BinContents>0 0.269931 0.222242 0.163755 0.1182 0.0780435 0.0516357 0.0320795 0.0208267 0.0135215 0.00871183 0.00657925 0.00381143 0.00317619 0.00186034 0.00163347 0.000907482 0.000635238 0.000408367 0.000408367 0.000408367 0.000362993 0.000226871 9.07482e-05 9.07482e-05 0.000136122 9.07482e-05 4.53741e-05 4.53741e-05 4.53741e-05 9.07482e-05 0 </BinContents>
+    <BinContents>0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 </BinContents>
 </PhotonSigRmsRatio_6>
 <PhotonBkgRmsRatio_6>
     <NBinsX>30</NBinsX>
     <XLow>1</XLow>
     <XHigh>3</XHigh>
-    <BinContents>0 0.202215 0.189215 0.135773 0.129032 0.0832932 0.0683678 0.0476649 0.0389986 0.0250361 0.0202215 0.0178142 0.00962927 0.00818488 0.0052961 0.00433317 0.0052961 0.00337025 0.000481464 0.000962927 0.00144439 0.000962927 0 0.000962927 0.000962927 0.000481464 0 0 0 0 0 0 </BinContents>
+    <BinContents>0 0.243125 0.23193 0.16184 0.112679 0.083962 0.0540277 0.0335848 0.0267705 0.0148455 0.0107082 0.00559747 0.00559747 0.00365052 0.00292042 0.00267705 0.00219031 0.000973473 0.00121684 0.000486736 0.000243368 0.000243368 0.000486736 0 0 0 0 0 0 0.000243368 0 0 </BinContents>
 </PhotonBkgRmsRatio_6>
 <PhotonSigRmsRatio_7>
     <NBinsX>30</NBinsX>
     <XLow>1</XLow>
     <XHigh>3</XHigh>
-    <BinContents>0 0.291538 0.231044 0.16842 0.116244 0.0696364 0.0448202 0.0283907 0.0171169 0.0116863 0.00673678 0.00474325 0.00302468 0.00240599 0.000962398 0.000687427 0.000549942 0.000687427 0.000343713 0.000137485 0.000206228 0 6.87427e-05 6.87427e-05 6.87427e-05 0.000137485 6.87427e-05 6.87427e-05 0 6.87427e-05 6.87427e-05 0 </BinContents>
+    <BinContents>0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 </BinContents>
 </PhotonSigRmsRatio_7>
 <PhotonBkgRmsRatio_7>
     <NBinsX>30</NBinsX>
     <XLow>1</XLow>
     <XHigh>3</XHigh>
-    <BinContents>0 0.237977 0.217247 0.1534 0.108624 0.0713101 0.0704809 0.0422886 0.0315091 0.0190713 0.0157546 0.00829187 0.00580431 0.00497512 0.00165837 0.00165837 0.00331675 0 0.00248756 0.00165837 0.000829187 0 0 0.000829187 0 0 0.000829187 0 0 0 0 0 </BinContents>
+    <BinContents>0 0.329913 0.252856 0.169216 0.106486 0.0565344 0.0317522 0.0201355 0.0100678 0.00735721 0.00387222 0.00271055 0.00232333 0.000968054 0.00154889 0.00135528 0.000193611 0.000387222 0.000387222 0.000580833 0 0.000193611 0.000387222 0.000193611 0 0 0.000193611 0 0.000387222 0 0 0 </BinContents>
 </PhotonBkgRmsRatio_7>
 <PhotonSigRmsRatio_8>
     <NBinsX>30</NBinsX>
     <XLow>1</XLow>
     <XHigh>3</XHigh>
-    <BinContents>0 0.311604 0.245042 0.174357 0.106421 0.0615551 0.0387787 0.0229727 0.0148243 0.00893383 0.00530139 0.00353426 0.002258 0.00147261 0.00098174 0.00049087 0.000196348 0.000294522 0.000392696 9.8174e-05 0.000294522 9.8174e-05 9.8174e-05 0 0 0 0 0 0 0 0 0 </BinContents>
+    <BinContents>0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 </BinContents>
 </PhotonSigRmsRatio_8>
 <PhotonBkgRmsRatio_8>
     <NBinsX>30</NBinsX>
     <XLow>1</XLow>
     <XHigh>3</XHigh>
-    <BinContents>0 0.305169 0.223658 0.161034 0.122266 0.0596421 0.0407555 0.0347912 0.0198807 0.0119284 0.0119284 0.00298211 0.00298211 0.00298211 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 </BinContents>
+    <BinContents>0 0.444266 0.291644 0.147552 0.0614898 0.0292837 0.0128228 0.00638158 0.00304169 0.0013121 0.00059641 0.000656051 0.000178923 0.000119282 5.9641e-05 0 0.000119282 0.000178923 5.9641e-05 5.9641e-05 0 5.9641e-05 0 0 0 0 0 5.9641e-05 0 5.9641e-05 0 0 </BinContents>
 </PhotonBkgRmsRatio_8>
 <PhotonSigLongProfileStart_0>
     <NBinsX>11</NBinsX>
     <XLow>-0.5</XLow>
     <XHigh>10.5</XHigh>
-    <BinContents>0 0.0520456 0.137233 0.112927 0.123682 0.130979 0.128586 0.106057 0.0800227 0.0637244 0.0455784 0.0191647 0 </BinContents>
+    <BinContents>0 0 0 0 0 0 0 0 0 0 0 0 0 </BinContents>
 </PhotonSigLongProfileStart_0>
 <PhotonBkgLongProfileStart_0>
     <NBinsX>11</NBinsX>
     <XLow>-0.5</XLow>
     <XHigh>10.5</XHigh>
-    <BinContents>0 0.0566245 0.189996 0.130592 0.128079 0.133674 0.130455 0.0956491 0.0595869 0.0397307 0.0255241 0.0100886 0 </BinContents>
+    <BinContents>0 0.101796 0.09527 0.129792 0.12537 0.133299 0.11552 0.102803 0.0751731 0.0626391 0.0419017 0.0164374 0 </BinContents>
 </PhotonBkgLongProfileStart_0>
 <PhotonSigLongProfileStart_1>
     <NBinsX>11</NBinsX>
     <XLow>-0.5</XLow>
     <XHigh>10.5</XHigh>
-    <BinContents>0 0.148797 0.282878 0.168565 0.116307 0.0837729 0.0670183 0.0447675 0.0332875 0.0282789 0.0185275 0.00780107 0 </BinContents>
+    <BinContents>0 0 0 0 0 0 0 0 0 0 0 0 0 </BinContents>
 </PhotonSigLongProfileStart_1>
 <PhotonBkgLongProfileStart_1>
     <NBinsX>11</NBinsX>
     <XLow>-0.5</XLow>
     <XHigh>10.5</XHigh>
-    <BinContents>0 0.0692545 0.182469 0.141901 0.13995 0.133122 0.119222 0.0809151 0.0543351 0.0391053 0.0279102 0.0118158 0 </BinContents>
+    <BinContents>0 0.177618 0.179671 0.145791 0.120465 0.108487 0.0853867 0.0645106 0.0470568 0.0330253 0.0278919 0.0100958 0 </BinContents>
 </PhotonBkgLongProfileStart_1>
 <PhotonSigLongProfileStart_2>
     <NBinsX>11</NBinsX>
     <XLow>-0.5</XLow>
     <XHigh>10.5</XHigh>
-    <BinContents>0 0.234425 0.335122 0.19998 0.102356 0.0572279 0.033322 0.0170269 0.00961116 0.00561058 0.00424452 0.00107333 0 </BinContents>
+    <BinContents>0 0 0 0 0 0 0 0 0 0 0 0 0 </BinContents>
 </PhotonSigLongProfileStart_2>
 <PhotonBkgLongProfileStart_2>
     <NBinsX>11</NBinsX>
     <XLow>-0.5</XLow>
     <XHigh>10.5</XHigh>
-    <BinContents>0 0.104781 0.189597 0.156571 0.140359 0.123996 0.101554 0.0642498 0.0463859 0.0344517 0.0266456 0.0114088 0 </BinContents>
+    <BinContents>0 0.288122 0.261236 0.148876 0.0943018 0.0726324 0.0501605 0.0313002 0.0176565 0.0176565 0.0148475 0.00321027 0 </BinContents>
 </PhotonBkgLongProfileStart_2>
 <PhotonSigLongProfileStart_3>
     <NBinsX>11</NBinsX>
     <XLow>-0.5</XLow>
     <XHigh>10.5</XHigh>
-    <BinContents>0 0.263169 0.352345 0.190027 0.0927632 0.0499332 0.0259512 0.0123778 0.0066812 0.00344609 0.00281314 0.000492299 0 </BinContents>
+    <BinContents>0 0 0 0 0 0 0 0 0 0 0 0 0 </BinContents>
 </PhotonSigLongProfileStart_3>
 <PhotonBkgLongProfileStart_3>
     <NBinsX>11</NBinsX>
     <XLow>-0.5</XLow>
     <XHigh>10.5</XHigh>
-    <BinContents>0 0.135459 0.198514 0.179094 0.132582 0.120834 0.083673 0.0510669 0.0371614 0.0278111 0.0249341 0.00887077 0 </BinContents>
+    <BinContents>0 0.326948 0.280971 0.144955 0.0836526 0.0625798 0.0389527 0.0249042 0.0159642 0.00957854 0.00957854 0.00191571 0 </BinContents>
 </PhotonBkgLongProfileStart_3>
 <PhotonSigLongProfileStart_4>
     <NBinsX>11</NBinsX>
     <XLow>-0.5</XLow>
     <XHigh>10.5</XHigh>
-    <BinContents>0 0.287348 0.345374 0.187181 0.0916173 0.045581 0.0222087 0.0110791 0.00495776 0.00278242 0.00126473 0.000607072 0 </BinContents>
+    <BinContents>0 0 0 0 0 0 0 0 0 0 0 0 0 </BinContents>
 </PhotonSigLongProfileStart_4>
 <PhotonBkgLongProfileStart_4>
     <NBinsX>11</NBinsX>
     <XLow>-0.5</XLow>
     <XHigh>10.5</XHigh>
-    <BinContents>0 0.156078 0.225413 0.178416 0.125036 0.100087 0.0699159 0.0490281 0.0365535 0.0284305 0.0211778 0.00986365 0 </BinContents>
+    <BinContents>0 0.371139 0.282336 0.137548 0.0796332 0.0472973 0.0323359 0.0212355 0.0111004 0.00772201 0.00627413 0.00337838 0 </BinContents>
 </PhotonBkgLongProfileStart_4>
 <PhotonSigLongProfileStart_5>
     <NBinsX>11</NBinsX>
     <XLow>-0.5</XLow>
     <XHigh>10.5</XHigh>
-    <BinContents>0 0.30777 0.33941 0.184535 0.0889055 0.0415764 0.0208069 0.00945088 0.00410908 0.00224131 0.000933881 0.000261487 0 </BinContents>
+    <BinContents>0 0 0 0 0 0 0 0 0 0 0 0 0 </BinContents>
 </PhotonSigLongProfileStart_5>
 <PhotonBkgLongProfileStart_5>
     <NBinsX>11</NBinsX>
     <XLow>-0.5</XLow>
     <XHigh>10.5</XHigh>
-    <BinContents>0 0.204748 0.23574 0.167491 0.102539 0.0748434 0.060666 0.0487966 0.0346192 0.0323112 0.0250577 0.0131883 0 </BinContents>
+    <BinContents>0 0.404589 0.285216 0.128086 0.0746442 0.0395004 0.0223642 0.0171362 0.0119082 0.00900378 0.00493755 0.002614 0 </BinContents>
 </PhotonBkgLongProfileStart_5>
 <PhotonSigLongProfileStart_6>
     <NBinsX>11</NBinsX>
     <XLow>-0.5</XLow>
     <XHigh>10.5</XHigh>
-    <BinContents>0 0.33114 0.330641 0.172512 0.0880258 0.0432869 0.0202369 0.00825809 0.00372068 0.00131585 0.000544489 0.000317619 0 </BinContents>
+    <BinContents>0 0 0 0 0 0 0 0 0 0 0 0 0 </BinContents>
 </PhotonSigLongProfileStart_6>
 <PhotonBkgLongProfileStart_6>
     <NBinsX>11</NBinsX>
     <XLow>-0.5</XLow>
     <XHigh>10.5</XHigh>
-    <BinContents>0 0.223881 0.217622 0.142995 0.102552 0.0741454 0.0635532 0.0539239 0.0418873 0.0370727 0.0317766 0.0105922 0 </BinContents>
+    <BinContents>0 0.4422 0.271842 0.124361 0.0618155 0.0391823 0.0236067 0.0148455 0.00900462 0.00705768 0.004624 0.00146021 0 </BinContents>
 </PhotonBkgLongProfileStart_6>
 <PhotonSigLongProfileStart_7>
     <NBinsX>11</NBinsX>
     <XLow>-0.5</XLow>
     <XHigh>10.5</XHigh>
-    <BinContents>0 0.349007 0.319379 0.178525 0.0798103 0.0387021 0.0201416 0.00783667 0.00426205 0.00137485 0.00075617 0.000206228 0 </BinContents>
+    <BinContents>0 0 0 0 0 0 0 0 0 0 0 0 0 </BinContents>
 </PhotonSigLongProfileStart_7>
 <PhotonBkgLongProfileStart_7>
     <NBinsX>11</NBinsX>
     <XLow>-0.5</XLow>
     <XHigh>10.5</XHigh>
-    <BinContents>0 0.212272 0.197347 0.126866 0.10199 0.0837479 0.0671642 0.0621891 0.0497512 0.0439469 0.039801 0.0149254 0 </BinContents>
+    <BinContents>0 0.504163 0.249177 0.109003 0.0590513 0.0360116 0.0207164 0.010455 0.00561471 0.00329138 0.0017425 0.000774443 0 </BinContents>
 </PhotonBkgLongProfileStart_7>
 <PhotonSigLongProfileStart_8>
     <NBinsX>11</NBinsX>
     <XLow>-0.5</XLow>
     <XHigh>10.5</XHigh>
-    <BinContents>0 0.417632 0.298645 0.151188 0.0719615 0.0337718 0.0147261 0.00736305 0.00323974 0.000785392 0.000392696 0.000294522 0 </BinContents>
+    <BinContents>0 0 0 0 0 0 0 0 0 0 0 0 0 </BinContents>
 </PhotonSigLongProfileStart_8>
 <PhotonBkgLongProfileStart_8>
     <NBinsX>11</NBinsX>
     <XLow>-0.5</XLow>
     <XHigh>10.5</XHigh>
-    <BinContents>0 0.237575 0.150099 0.102386 0.0805169 0.0785288 0.0904573 0.0854871 0.0536779 0.05666 0.0417495 0.0228628 0 </BinContents>
+    <BinContents>0 0.622055 0.22592 0.0796803 0.0419872 0.0180712 0.00721656 0.00268384 0.00155067 0.000536769 0.000238564 5.9641e-05 0 </BinContents>
 </PhotonBkgLongProfileStart_8>
 <PhotonSigLongProfileDiscrepancy_0>
     <NBinsX>42</NBinsX>
     <XLow>-0.02</XLow>
     <XHigh>0.82</XHigh>
-    <BinContents>0 0 0.000307962 0.000165826 0.00040272 0.000734371 0.0011134 0.000829128 0.00127923 0.00187146 0.00220311 0.00296117 0.00376661 0.00506953 0.00637244 0.00881245 0.011821 0.0150901 0.0186435 0.0240921 0.0282851 0.034018 0.0397271 0.0449625 0.0488475 0.0502926 0.0543671 0.0521403 0.0523772 0.0525667 0.0540592 0.0496766 0.0479473 0.0442518 0.0426646 0.0386137 0.0341127 0.0313174 0.0297302 0.0244474 0.0221496 0.0179092 0 0 </BinContents>
+    <BinContents>0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 </BinContents>
 </PhotonSigLongProfileDiscrepancy_0>
 <PhotonBkgLongProfileDiscrepancy_0>
     <NBinsX>42</NBinsX>
     <XLow>-0.02</XLow>
     <XHigh>0.82</XHigh>
-    <BinContents>0 0 0.000201772 0.000311829 0.000348515 0.000577801 0.000715373 0.000843773 0.00117395 0.00164169 0.0017976 0.00317332 0.00505347 0.00732799 0.0106664 0.0144542 0.0197278 0.0257259 0.0322193 0.0408405 0.0457564 0.0520296 0.0555698 0.0588073 0.0567713 0.0561843 0.0550654 0.051672 0.0497643 0.0474623 0.0426197 0.0395932 0.0371719 0.032577 0.0303116 0.025891 0.0234331 0.019847 0.0166095 0.0146101 0.011877 0.00957499 0 0 </BinContents>
+    <BinContents>0 0 0.000335458 0.000487939 0.000426946 0.000762404 0.000701412 0.00103687 0.00118935 0.00143332 0.00207374 0.00332408 0.00503187 0.00597725 0.00829496 0.0115276 0.0153091 0.0218048 0.0267756 0.031777 0.0384252 0.0429386 0.0465067 0.0529719 0.0549541 0.0552286 0.0578207 0.0576683 0.0578207 0.056174 0.0522704 0.0480315 0.0444329 0.0391266 0.0335458 0.0297033 0.0257083 0.020097 0.0170474 0.0132658 0.00969778 0.00829496 0 0 </BinContents>
 </PhotonBkgLongProfileDiscrepancy_0>
 <PhotonSigLongProfileDiscrepancy_1>
     <NBinsX>42</NBinsX>
     <XLow>-0.02</XLow>
     <XHigh>0.82</XHigh>
-    <BinContents>0 0 0 0 0 0 0 4.43243e-05 8.86486e-05 4.43243e-05 8.86486e-05 0.000132973 0.000753513 0.00168432 0.00332432 0.00558486 0.00944107 0.0123665 0.0179513 0.0242897 0.0314259 0.0373654 0.0428616 0.0487567 0.0504854 0.0563362 0.0557599 0.0583307 0.055627 0.0563362 0.056868 0.0530118 0.0464962 0.0424183 0.0396702 0.0368778 0.0342183 0.0302292 0.0274367 0.0234919 0.0214529 0.0187492 0 0 </BinContents>
+    <BinContents>0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 </BinContents>
 </PhotonSigLongProfileDiscrepancy_1>
 <PhotonBkgLongProfileDiscrepancy_1>
     <NBinsX>42</NBinsX>
     <XLow>-0.02</XLow>
     <XHigh>0.82</XHigh>
-    <BinContents>0 0 0 0 0 0 0 0 0.000110843 0.00015518 0.000731561 0.00126361 0.00219468 0.00396817 0.00605201 0.00793633 0.0109734 0.0134341 0.0167816 0.0216365 0.0263362 0.0294841 0.0341617 0.0377973 0.0412556 0.043539 0.0481722 0.0508768 0.0528276 0.0525616 0.0509433 0.0503226 0.0500787 0.0478175 0.0451129 0.0442705 0.0415438 0.0403911 0.0369328 0.0321 0.0310138 0.027223 0 0 </BinContents>
+    <BinContents>0 0 0 0 0 0 0 0 0 0 0.000342231 0.000342231 0.00119781 0.00205339 0.00444901 0.00684463 0.00735797 0.0164271 0.019165 0.0249829 0.0314853 0.0379877 0.0405544 0.0431212 0.0508214 0.0590349 0.0588638 0.057666 0.0566393 0.0580082 0.0549281 0.0485969 0.0499658 0.0400411 0.0405544 0.0350787 0.0321697 0.029603 0.0263518 0.0229295 0.0210472 0.0213895 0 0 </BinContents>
 </PhotonBkgLongProfileDiscrepancy_1>
 <PhotonSigLongProfileDiscrepancy_2>
     <NBinsX>42</NBinsX>
     <XLow>-0.02</XLow>
     <XHigh>0.82</XHigh>
-    <BinContents>0 0 0 0 0 0 0 0 4.87876e-05 4.87876e-05 4.87876e-05 0.000243938 0.000878177 0.00307362 0.00585452 0.0108796 0.0147339 0.0226375 0.0328341 0.0448846 0.0508855 0.057667 0.0659609 0.069376 0.0702542 0.0671806 0.0664487 0.0584964 0.0569839 0.0494219 0.0436649 0.0370298 0.0342977 0.0274674 0.0243938 0.0201005 0.0169781 0.0133678 0.0112212 0.00931844 0.00780602 0.005513 0 0 </BinContents>
+    <BinContents>0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 </BinContents>
 </PhotonSigLongProfileDiscrepancy_2>
 <PhotonBkgLongProfileDiscrepancy_2>
     <NBinsX>42</NBinsX>
     <XLow>-0.02</XLow>
     <XHigh>0.82</XHigh>
-    <BinContents>0 0 0 0 0 0 0 0 7.50582e-05 0.000225175 0.000150116 0.000600465 0.000750582 0.00187645 0.00255198 0.00442843 0.00818134 0.0106583 0.0127599 0.0179389 0.0230429 0.0286722 0.0322 0.0370037 0.0390302 0.0454102 0.0457104 0.0506643 0.0499137 0.0558433 0.0454102 0.0497636 0.0475869 0.0499137 0.0484876 0.0478121 0.042633 0.0445845 0.0433086 0.0411319 0.0390302 0.0326503 0 0 </BinContents>
+    <BinContents>0 0 0 0 0 0 0 0 0 0.000401284 0 0 0.000401284 0.00280899 0.00481541 0.0128411 0.0132424 0.0236758 0.0304976 0.0292937 0.0397271 0.0605939 0.0605939 0.0674157 0.0722311 0.0666132 0.0569823 0.0597913 0.0613965 0.0529695 0.0513644 0.0365169 0.0405297 0.0329053 0.0284912 0.0276886 0.0188604 0.0124398 0.011236 0.00922953 0.0076244 0.00682183 0 0 </BinContents>
 </PhotonBkgLongProfileDiscrepancy_2>
 <PhotonSigLongProfileDiscrepancy_3>
     <NBinsX>42</NBinsX>
     <XLow>-0.02</XLow>
     <XHigh>0.82</XHigh>
-    <BinContents>0 0 0 0 0 0 0 0 0 7.03284e-05 0.000140657 0.00126591 0.0019692 0.00555595 0.0115339 0.0174415 0.0301006 0.0395246 0.0504255 0.0635066 0.076236 0.0784162 0.0793305 0.0786975 0.0744075 0.0677263 0.0590056 0.0495815 0.0414938 0.0380477 0.0316478 0.0239117 0.0189887 0.0152613 0.0120262 0.00893171 0.00696251 0.00555595 0.00436036 0.00337576 0.00260215 0.00189887 0 0 </BinContents>
+    <BinContents>0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 </BinContents>
 </PhotonSigLongProfileDiscrepancy_3>
 <PhotonBkgLongProfileDiscrepancy_3>
     <NBinsX>42</NBinsX>
     <XLow>-0.02</XLow>
     <XHigh>0.82</XHigh>
-    <BinContents>0 0 0 0 0 0 0 0 0 0 0.000239751 0.000479501 0.000479501 0.00263726 0.00671302 0.00743227 0.0112683 0.0210981 0.0227763 0.0345241 0.0388396 0.0445936 0.0465116 0.0484296 0.0501079 0.0515464 0.0407576 0.0469911 0.0469911 0.0383601 0.0462719 0.0409974 0.0393191 0.0383601 0.0393191 0.0326061 0.0357228 0.0414769 0.0299688 0.0309278 0.0342843 0.0299688 0 0 </BinContents>
+    <BinContents>0 0 0 0 0 0 0 0 0 0 0.00063857 0.00191571 0.00127714 0.0063857 0.0172414 0.0153257 0.0293742 0.0383142 0.0568327 0.0568327 0.0708812 0.0664112 0.0708812 0.0702427 0.0753512 0.0676884 0.063857 0.0517241 0.0363985 0.0344828 0.041507 0.0185185 0.0236271 0.0223499 0.0121328 0.0108557 0.0114943 0.00893997 0.00510856 0.00510856 0.00510856 0.00319285 0 0 </BinContents>
 </PhotonBkgLongProfileDiscrepancy_3>
 <PhotonSigLongProfileDiscrepancy_4>
     <NBinsX>42</NBinsX>
     <XLow>-0.02</XLow>
     <XHigh>0.82</XHigh>
-    <BinContents>0 0 0 0 0 0 0 0 0 0.000303536 0.000455304 0.00212475 0.00440127 0.0130015 0.0211969 0.0348055 0.0498305 0.0649062 0.07897 0.0837254 0.0931856 0.0896949 0.0813477 0.0748217 0.0623767 0.0524612 0.0420904 0.0335913 0.0258512 0.020944 0.0177569 0.0131532 0.0102191 0.00753782 0.00581778 0.00424951 0.00288359 0.00288359 0.00217534 0.00146709 0.00131532 0.000455304 0 0 </BinContents>
+    <BinContents>0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 </BinContents>
 </PhotonSigLongProfileDiscrepancy_4>
 <PhotonBkgLongProfileDiscrepancy_4>
     <NBinsX>42</NBinsX>
     <XLow>-0.02</XLow>
     <XHigh>0.82</XHigh>
-    <BinContents>0 0 0 0 0 0 0 0 0 0.000580215 0 0.00145054 0.00174064 0.00522193 0.0118944 0.0159559 0.0252393 0.0316217 0.0409051 0.0490281 0.0571511 0.05396 0.056861 0.0522193 0.0571511 0.0438062 0.0501886 0.0394546 0.0371337 0.0403249 0.0409051 0.0348129 0.0295909 0.0287206 0.0275602 0.0261097 0.0272701 0.0232086 0.0211778 0.0237888 0.0205976 0.024369 0 0 </BinContents>
+    <BinContents>0 0 0 0 0 0 0 0 0 0 0.000965251 0.00241313 0.00868726 0.0135135 0.0183398 0.0415058 0.0472973 0.0545367 0.0704633 0.0767374 0.0873552 0.0796332 0.0651544 0.0752896 0.0569498 0.0583977 0.046332 0.0328185 0.0323359 0.0265444 0.0279923 0.0207529 0.0135135 0.0130309 0.00530888 0.00434363 0.00482625 0.00289575 0.00530888 0.003861 0.00241313 0.000482625 0 0 </BinContents>
 </PhotonBkgLongProfileDiscrepancy_4>
 <PhotonSigLongProfileDiscrepancy_5>
     <NBinsX>42</NBinsX>
     <XLow>-0.02</XLow>
     <XHigh>0.82</XHigh>
-    <BinContents>0 0 0 0 0 0 0 3.73552e-05 0.000112066 0.00078446 0.00321255 0.00847964 0.0212178 0.0367949 0.0561076 0.0758685 0.0914456 0.101233 0.0995144 0.0946956 0.083489 0.0738513 0.0589092 0.047217 0.0342921 0.0275682 0.0207695 0.0169966 0.0108704 0.00896526 0.00691072 0.00466941 0.00381024 0.00306313 0.00194247 0.00209189 0.00138214 0.00127008 0.000971236 0.000560329 0.000560329 0.000336197 0 0 </BinContents>
+    <BinContents>0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 </BinContents>
 </PhotonSigLongProfileDiscrepancy_5>
 <PhotonBkgLongProfileDiscrepancy_5>
     <NBinsX>42</NBinsX>
     <XLow>-0.02</XLow>
     <XHigh>0.82</XHigh>
-    <BinContents>0 0 0 0 0 0 0 0 0.000329707 0 0.00197824 0.00428619 0.0108803 0.0201121 0.0339598 0.0369271 0.0520936 0.0639631 0.0679196 0.0698978 0.0712166 0.0573689 0.060666 0.0544016 0.0418727 0.0333004 0.0356083 0.0342895 0.0257171 0.0253874 0.0194527 0.0201121 0.0201121 0.0171447 0.0220903 0.0131883 0.0141774 0.016815 0.0125288 0.0151665 0.0141774 0.0128586 0 0 </BinContents>
+    <BinContents>0 0 0 0 0 0 0 0 0 0.000290444 0.00406622 0.00958466 0.0203311 0.0447284 0.0665118 0.0737729 0.0897473 0.0880046 0.0911995 0.0865524 0.0821958 0.06535 0.0546035 0.0490851 0.0354342 0.0293349 0.0293349 0.018298 0.0133604 0.00987511 0.00697067 0.010456 0.00464711 0.00290444 0.00319489 0.00145222 0.00232356 0.00232356 0.00174267 0.00145222 0.000290444 0.000580889 0 0 </BinContents>
 </PhotonBkgLongProfileDiscrepancy_5>
 <PhotonSigLongProfileDiscrepancy_6>
     <NBinsX>42</NBinsX>
     <XLow>-0.02</XLow>
     <XHigh>0.82</XHigh>
-    <BinContents>0 0 0 0 0 0 0 0.000226871 0.00099823 0.00431054 0.0137484 0.0335315 0.0600753 0.0868007 0.10858 0.119515 0.11103 0.0988702 0.0870729 0.0678343 0.0551295 0.038931 0.0282227 0.0226417 0.0156994 0.0103907 0.00889332 0.00644312 0.00462816 0.00299469 0.00326694 0.00217796 0.00222333 0.00113435 0.00145197 0.000725986 0.000499115 0.000680612 0.000317619 0.000136122 0.000499115 0.000317619 0 0 </BinContents>
+    <BinContents>0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 </BinContents>
 </PhotonSigLongProfileDiscrepancy_6>
 <PhotonBkgLongProfileDiscrepancy_6>
     <NBinsX>42</NBinsX>
     <XLow>-0.02</XLow>
     <XHigh>0.82</XHigh>
-    <BinContents>0 0 0 0 0 0 0 0 0 0.00144439 0.00625903 0.0125181 0.0250361 0.0544054 0.0669234 0.0813674 0.0751083 0.0702937 0.0688493 0.0548869 0.0597015 0.0481464 0.046702 0.0380356 0.033221 0.0240732 0.0327395 0.0207029 0.0221473 0.0192585 0.0221473 0.013481 0.0110737 0.0129995 0.0129995 0.0139624 0.0115551 0.0110737 0.00722195 0.00722195 0.00577756 0.00866635 0 0 </BinContents>
+    <BinContents>0 0 0 0 0 0 0 0.000243368 0.000486736 0.00681431 0.0172791 0.0425894 0.0734972 0.0895595 0.111463 0.106352 0.104162 0.0871258 0.067413 0.0571915 0.0486736 0.0377221 0.0321246 0.0248236 0.0209297 0.0146021 0.0111949 0.00949136 0.00754441 0.00632757 0.00511073 0.00292042 0.00316379 0.00316379 0.00121684 0.00146021 0.00170358 0.00146021 0.000486736 0.000243368 0.000243368 0.00121684 0 0 </BinContents>
 </PhotonBkgLongProfileDiscrepancy_6>
 <PhotonSigLongProfileDiscrepancy_7>
     <NBinsX>42</NBinsX>
     <XLow>-0.02</XLow>
     <XHigh>0.82</XHigh>
-    <BinContents>0 0 0 0 0 0 0.000137485 0.000962398 0.0065993 0.0227538 0.0514883 0.0906029 0.112257 0.123874 0.11645 0.106139 0.0908778 0.0655805 0.0540318 0.0393896 0.0274971 0.0208978 0.0158108 0.0129924 0.00824912 0.00790541 0.00543067 0.00426205 0.00254348 0.00295594 0.00213102 0.00158108 0.00171857 0.00123737 0.000824912 0.00075617 0.000206228 0.000618684 0.000481199 0.000481199 0.000137485 0.000137485 0 0 </BinContents>
+    <BinContents>0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 </BinContents>
 </PhotonSigLongProfileDiscrepancy_7>
 <PhotonBkgLongProfileDiscrepancy_7>
     <NBinsX>42</NBinsX>
     <XLow>-0.02</XLow>
     <XHigh>0.82</XHigh>
-    <BinContents>0 0 0 0 0 0 0 0.000829187 0.00414594 0.013267 0.0257048 0.0489221 0.0547264 0.0646766 0.0878939 0.0704809 0.0754561 0.0555556 0.0679934 0.0588723 0.0257048 0.0422886 0.0257048 0.0257048 0.0306799 0.0248756 0.0290216 0.0174129 0.0174129 0.0157546 0.0165837 0.0174129 0.0140962 0.00912106 0.00912106 0.00580431 0.0116086 0.0066335 0.0116086 0.00497512 0.00331675 0.0066335 0 0 </BinContents>
+    <BinContents>0 0 0 0 0 0 0.000387222 0.00154889 0.00774443 0.0315586 0.0629235 0.0991288 0.109971 0.108035 0.105324 0.0904163 0.0733785 0.0586641 0.0524685 0.0425944 0.0352372 0.0272991 0.0216844 0.0123911 0.0123911 0.00793805 0.00851888 0.00619555 0.00464666 0.00367861 0.00367861 0.00212972 0.00251694 0.00135528 0.000580833 0.00154889 0.000774443 0.000580833 0.00116167 0.000387222 0.000968054 0.000193611 0 0 </BinContents>
 </PhotonBkgLongProfileDiscrepancy_7>
 <PhotonSigLongProfileDiscrepancy_8>
     <NBinsX>42</NBinsX>
     <XLow>-0.02</XLow>
     <XHigh>0.82</XHigh>
-    <BinContents>0 0 0 0 0 0.00049087 0.00628313 0.0170823 0.0405458 0.0650893 0.0862949 0.110151 0.11074 0.114078 0.098763 0.0793246 0.0642058 0.0460436 0.0341645 0.0269978 0.0233654 0.0172786 0.0139407 0.009032 0.0075594 0.00647948 0.00402513 0.00431965 0.00196348 0.00314157 0.00117809 0.000883566 0.000883566 0.000687218 0.000785392 0.00157078 0.000589044 0.000687218 0.000294522 0.000589044 0.000294522 0.000196348 0 0 </BinContents>
+    <BinContents>0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 </BinContents>
 </PhotonSigLongProfileDiscrepancy_8>
 <PhotonBkgLongProfileDiscrepancy_8>
     <NBinsX>42</NBinsX>
     <XLow>-0.02</XLow>
     <XHigh>0.82</XHigh>
-    <BinContents>0 0 0 0 0 0 0.00397614 0.0109344 0.0218688 0.0457256 0.0576541 0.0685885 0.0755467 0.083499 0.0626243 0.0616302 0.0636183 0.0487077 0.0347912 0.0397614 0.0328032 0.027833 0.0318091 0.0208747 0.0168986 0.0218688 0.0248509 0.00795229 0.0139165 0.0139165 0.0228628 0.0149105 0.0129225 0.00695825 0.00894632 0.00795229 0.00695825 0.0109344 0.00695825 0.00497018 0.00298211 0.000994036 0 0 </BinContents>
+    <BinContents>0 0 0 0 5.9641e-05 0.00345918 0.0187273 0.0481899 0.0753265 0.102582 0.107473 0.105028 0.0939345 0.0777718 0.071271 0.0572553 0.0499791 0.0412715 0.0320272 0.0291644 0.0214111 0.0159838 0.0110336 0.0108547 0.00739548 0.00554661 0.00333989 0.00298205 0.00184887 0.00137174 0.0010139 0.000954255 0.000357846 0.000417487 0.00059641 0.000298205 0.000238564 5.9641e-05 0.000357846 0.000178923 0.000119282 0.000119282 0 0 </BinContents>
 </PhotonBkgLongProfileDiscrepancy_8>
 <PhotonSigPeakEnergyFraction_0>
     <NBinsX>52</NBinsX>
     <XLow>-0.02</XLow>
     <XHigh>1.02</XHigh>
-    <BinContents>0 0 0.0229787 0.0358183 0.0323834 0.0279772 0.0252529 0.0217942 0.0179566 0.0172696 0.0155402 0.0154929 0.0144742 0.0133845 0.0126028 0.0116552 0.0111103 0.0106365 0.00992585 0.0104707 0.00978372 0.00862294 0.00916779 0.00791225 0.00805439 0.00734371 0.00698837 0.00656196 0.00686992 0.0064672 0.00594604 0.00596973 0.0053538 0.00521166 0.00497477 0.00466681 0.00360079 0.00338758 0.00281904 0.00258214 0.00189515 0.00175301 0.00151612 0.000923886 0.000686992 0.000497477 4.73788e-05 4.73788e-05 0 0 2.36894e-05 0 0.5436 0 </BinContents>
+    <BinContents>0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 </BinContents>
 </PhotonSigPeakEnergyFraction_0>
 <PhotonBkgPeakEnergyFraction_0>
     <NBinsX>52</NBinsX>
     <XLow>-0.02</XLow>
     <XHigh>1.02</XHigh>
-    <BinContents>0 0 0.0242585 0.0401343 0.0417943 0.0420694 0.0401618 0.0384376 0.0341912 0.0318616 0.0292661 0.0270008 0.0254966 0.0240384 0.0215621 0.0192692 0.0176 0.016582 0.0153163 0.0139865 0.0134453 0.0116936 0.0110608 0.0103637 0.00957499 0.00946494 0.00808922 0.00772236 0.00766733 0.00679605 0.00663096 0.00602564 0.00559459 0.00526441 0.00477833 0.00393455 0.00391621 0.00298072 0.00294404 0.00227452 0.00212778 0.00143075 0.00118312 0.000779573 0.000394372 0.000210943 7.33716e-05 1.83429e-05 9.17145e-06 9.17145e-06 0 0 0.350515 0 </BinContents>
+    <BinContents>0 0 0.000670916 0.00256168 0.00262267 0.00338508 0.00463542 0.00582477 0.00606874 0.00652618 0.00652618 0.00774603 0.00820347 0.00853893 0.00905736 0.00823397 0.00838645 0.00914885 0.00905736 0.00887439 0.0100637 0.00887439 0.0087829 0.00799 0.00805099 0.00930133 0.00899637 0.00853893 0.00780702 0.00655668 0.00677015 0.00670916 0.00701412 0.00643469 0.00606874 0.0055808 0.00454393 0.00451343 0.00362904 0.00338508 0.00292763 0.00308011 0.00152481 0.00106737 0.000731908 0.000457443 0.000243969 6.09923e-05 0 0 0 0 0.734226 0 </BinContents>
 </PhotonBkgPeakEnergyFraction_0>
 <PhotonSigPeakEnergyFraction_1>
     <NBinsX>52</NBinsX>
     <XLow>-0.02</XLow>
     <XHigh>1.02</XHigh>
-    <BinContents>0 0 0.00726918 0.0163557 0.0164443 0.012987 0.0111697 0.0102832 0.0101946 0.00868756 0.00886486 0.00851026 0.00695891 0.00802269 0.00842161 0.00726918 0.0076681 0.00740215 0.00704756 0.00731351 0.00704756 0.00651567 0.00687026 0.00695891 0.00709188 0.00722486 0.00678161 0.00647134 0.00660432 0.00802269 0.0076681 0.00797837 0.00780107 0.0091308 0.00921945 0.00842161 0.0107265 0.0101946 0.0109924 0.0103719 0.0110367 0.0108594 0.0103719 0.00970702 0.00859891 0.00642702 0.00554053 0.00412216 0.00141838 0.00031027 0 0 0.598644 0 </BinContents>
+    <BinContents>0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 </BinContents>
 </PhotonSigPeakEnergyFraction_1>
 <PhotonBkgPeakEnergyFraction_1>
     <NBinsX>52</NBinsX>
     <XLow>-0.02</XLow>
     <XHigh>1.02</XHigh>
-    <BinContents>0 0 0.00982066 0.0238977 0.0254938 0.0258485 0.0250504 0.0223237 0.0220133 0.0212818 0.0193975 0.0180895 0.0186881 0.0178457 0.0162052 0.0162495 0.0154958 0.0162717 0.015518 0.0145647 0.0143209 0.0140548 0.0138997 0.0146534 0.0141657 0.0127912 0.0129686 0.0123257 0.0115498 0.0117493 0.0118158 0.0106852 0.0115498 0.0112394 0.0105522 0.0100202 0.009998 0.00955463 0.00895608 0.00897825 0.00911126 0.00811368 0.00813585 0.00649538 0.0059855 0.00469973 0.00334745 0.00208384 0.00126361 0.00015518 2.21685e-05 0 0.370702 0 </BinContents>
+    <BinContents>0 0 0.000855578 0.00290897 0.00154004 0.0032512 0.00376455 0.00410678 0.00427789 0.00273785 0.00564682 0.00633128 0.00564682 0.00581793 0.00616016 0.00598905 0.00684463 0.00752909 0.00889802 0.00667351 0.00479124 0.00855578 0.00941136 0.00924025 0.00924025 0.011807 0.00975359 0.00975359 0.00975359 0.0100958 0.0102669 0.0107803 0.00855578 0.0114648 0.0116359 0.0124914 0.0135181 0.0128337 0.0123203 0.0142026 0.0135181 0.0104381 0.0121492 0.0114648 0.0087269 0.0065024 0.00804244 0.00342231 0.00154004 0.000513347 0 0 0.62423 0 </BinContents>
 </PhotonBkgPeakEnergyFraction_1>
 <PhotonSigPeakEnergyFraction_2>
     <NBinsX>52</NBinsX>
     <XLow>-0.02</XLow>
     <XHigh>1.02</XHigh>
-    <BinContents>0 0 0.00209787 0.00439089 0.00575694 0.00517149 0.00400059 0.00400059 0.00502513 0.00312241 0.00414695 0.0035615 0.00331756 0.00370786 0.00302483 0.00361028 0.00321998 0.0039518 0.00429331 0.00307362 0.00346392 0.00312241 0.00390301 0.00341513 0.00351271 0.00351271 0.00326877 0.00307362 0.00287847 0.00419574 0.00414695 0.00390301 0.00385422 0.00517149 0.00536664 0.00580573 0.005513 0.00653754 0.0086842 0.0103918 0.0107333 0.0144411 0.0161975 0.0178563 0.0207835 0.0223447 0.0228814 0.0206372 0.0168317 0.00878177 0.00170757 4.87876e-05 0.663561 0 </BinContents>
+    <BinContents>0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 </BinContents>
 </PhotonSigPeakEnergyFraction_2>
 <PhotonBkgPeakEnergyFraction_2>
     <NBinsX>52</NBinsX>
     <XLow>-0.02</XLow>
     <XHigh>1.02</XHigh>
-    <BinContents>0 0 0.00382797 0.0177888 0.0214666 0.023193 0.025745 0.02582 0.0240937 0.0228177 0.0237934 0.0225175 0.0209412 0.0187645 0.0192899 0.0183893 0.0159123 0.0176387 0.015537 0.0138858 0.0152368 0.0153869 0.0146363 0.0140359 0.0123846 0.0130601 0.0124597 0.0122345 0.0132102 0.0132853 0.0108084 0.0111086 0.0114839 0.0113338 0.0111086 0.0102079 0.010283 0.010358 0.0128349 0.0105081 0.0127599 0.0114088 0.010283 0.011634 0.00998274 0.0111837 0.0121594 0.0114088 0.00840651 0.00442843 0.00120093 0 0.297756 0 </BinContents>
+    <BinContents>0 0 0.000401284 0.00361156 0.000401284 0.0024077 0.00280899 0.00361156 0.00200642 0.0024077 0.00401284 0.00361156 0.00401284 0.00321027 0.00321027 0.0024077 0.00280899 0.00441413 0.00401284 0.00842697 0.00441413 0.00842697 0.00922953 0.00802568 0.00682183 0.00642055 0.00922953 0.00722311 0.0076244 0.0116372 0.00802568 0.00722311 0.00601926 0.0100321 0.0100321 0.011236 0.0124398 0.0108347 0.00963082 0.0100321 0.0136437 0.0128411 0.0144462 0.0120385 0.0128411 0.0192616 0.0164526 0.0148475 0.00882825 0.00361156 0.00120385 0 0.63764 0 </BinContents>
 </PhotonBkgPeakEnergyFraction_2>
 <PhotonSigPeakEnergyFraction_3>
     <NBinsX>52</NBinsX>
     <XLow>-0.02</XLow>
     <XHigh>1.02</XHigh>
-    <BinContents>0 0 0.000773613 0.00274281 0.00478233 0.00386806 0.00323511 0.00295379 0.00414938 0.00253182 0.00210985 0.00302412 0.00302412 0.00358675 0.00309445 0.00218018 0.00302412 0.00260215 0.00288347 0.00281314 0.00239117 0.00218018 0.00330544 0.00267248 0.00168788 0.00218018 0.00239117 0.00302412 0.00232084 0.00365708 0.00281314 0.00330544 0.00337576 0.00337576 0.00379774 0.00492299 0.00414938 0.004712 0.00696251 0.00647022 0.00696251 0.00858007 0.0128701 0.0160349 0.0175118 0.024193 0.0317884 0.0353049 0.0373444 0.0300302 0.0111822 0.000281314 0.644841 0 </BinContents>
+    <BinContents>0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 </BinContents>
 </PhotonSigPeakEnergyFraction_3>
 <PhotonBkgPeakEnergyFraction_3>
     <NBinsX>52</NBinsX>
     <XLow>-0.02</XLow>
     <XHigh>1.02</XHigh>
-    <BinContents>0 0 0.0014385 0.00982978 0.0191801 0.0196596 0.0246943 0.0230161 0.0184608 0.0246943 0.0227763 0.0249341 0.0220571 0.0179813 0.0206186 0.0191801 0.0206186 0.0198993 0.0201391 0.0179813 0.0165428 0.0170223 0.0177415 0.016303 0.0141453 0.0139055 0.0122273 0.0131863 0.0129465 0.013426 0.0103093 0.013426 0.0127068 0.0107888 0.0112683 0.0103093 0.010549 0.0131863 0.0112683 0.0119875 0.0122273 0.0119875 0.010549 0.00982978 0.0136658 0.0141453 0.014385 0.0177415 0.015344 0.013426 0.00575402 0 0.250539 0 </BinContents>
+    <BinContents>0 0 0 0.00383142 0.00319285 0.00446999 0.00383142 0.00383142 0.00255428 0.00063857 0.00574713 0.00255428 0.00191571 0.00446999 0.00319285 0.00319285 0.00255428 0.00191571 0.00319285 0.00383142 0.00127714 0.00127714 0.00191571 0.00574713 0.00191571 0.00127714 0.00510856 0.00510856 0.00319285 0.00191571 0.00766284 0.00957854 0.00446999 0.0063857 0.00766284 0.00766284 0.0102171 0.0063857 0.0063857 0.0102171 0.0114943 0.00893997 0.0121328 0.00893997 0.0153257 0.0191571 0.0191571 0.0223499 0.0153257 0.0127714 0.00383142 0 0.690294 0 </BinContents>
 </PhotonBkgPeakEnergyFraction_3>
 <PhotonSigPeakEnergyFraction_4>
     <NBinsX>52</NBinsX>
     <XLow>-0.02</XLow>
     <XHigh>1.02</XHigh>
-    <BinContents>0 0 0.000354126 0.00278242 0.00389538 0.00374361 0.00344008 0.00308595 0.00323772 0.00298477 0.00258006 0.00278242 0.00308595 0.002833 0.00217534 0.0023777 0.0019224 0.00298477 0.00258006 0.00182122 0.00263065 0.00303536 0.00268124 0.00217534 0.00197299 0.00273183 0.00202357 0.00263065 0.00298477 0.00273183 0.00268124 0.00288359 0.0033389 0.00349067 0.00344008 0.00323772 0.00409774 0.00394597 0.00627308 0.00490717 0.0061719 0.00748723 0.00860019 0.0109779 0.0134568 0.0185663 0.0262559 0.0361208 0.0457328 0.0574695 0.0339961 0.0023777 0.620226 0 </BinContents>
+    <BinContents>0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 </BinContents>
 </PhotonSigPeakEnergyFraction_4>
 <PhotonBkgPeakEnergyFraction_4>
     <NBinsX>52</NBinsX>
     <XLow>-0.02</XLow>
     <XHigh>1.02</XHigh>
-    <BinContents>0 0 0.000580215 0.00899333 0.0130548 0.0171163 0.0159559 0.0174064 0.0205976 0.0185669 0.0205976 0.0174064 0.0165361 0.0191471 0.0145054 0.0153757 0.0232086 0.0174064 0.0165361 0.0159559 0.0191471 0.0147955 0.0145054 0.0176965 0.0150856 0.0168262 0.0150856 0.013635 0.0156658 0.0156658 0.0145054 0.0124746 0.0150856 0.0116043 0.0118944 0.0191471 0.0165361 0.0124746 0.0133449 0.0121845 0.0127647 0.010734 0.0142153 0.0139252 0.0116043 0.0153757 0.0153757 0.0185669 0.0226284 0.0252393 0.0127647 0.00116043 0.239339 0 </BinContents>
+    <BinContents>0 0 0 0.00241313 0.0168919 0.00627413 0.00772201 0.0019305 0.00144788 0.00241313 0.000482625 0.00241313 0.000965251 0.000482625 0.00241313 0.00241313 0.00289575 0.00337838 0.000965251 0.00241313 0.00289575 0.00337838 0.0019305 0.00434363 0.000965251 0.003861 0.00337838 0.00241313 0.00241313 0.00241313 0.00337838 0.00144788 0.00289575 0.00144788 0.00482625 0.00337838 0.003861 0.0019305 0.00723938 0.00820463 0.00482625 0.00868726 0.00965251 0.0101351 0.011583 0.0139961 0.015444 0.0168919 0.0207529 0.0212355 0.0135135 0.00144788 0.727317 0 </BinContents>
 </PhotonBkgPeakEnergyFraction_4>
 <PhotonSigPeakEnergyFraction_5>
     <NBinsX>52</NBinsX>
     <XLow>-0.02</XLow>
     <XHigh>1.02</XHigh>
-    <BinContents>0 0 0 0.00115801 0.00310049 0.00414643 0.00354875 0.00328726 0.0031752 0.0031752 0.00381024 0.00351139 0.0031752 0.00310049 0.00246545 0.00306313 0.00339933 0.00354875 0.00324991 0.00313784 0.00313784 0.00261487 0.00276429 0.00272693 0.00257751 0.00242809 0.00246545 0.0025028 0.00246545 0.00302578 0.002839 0.00324991 0.00332462 0.00298842 0.00339933 0.00354875 0.00351139 0.00377288 0.00496825 0.00429585 0.00545387 0.00612626 0.00668659 0.00870377 0.0112066 0.0146433 0.0182294 0.0270078 0.0429959 0.0679492 0.0812103 0.0189391 0.574188 0 </BinContents>
+    <BinContents>0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 </BinContents>
 </PhotonSigPeakEnergyFraction_5>
 <PhotonBkgPeakEnergyFraction_5>
     <NBinsX>52</NBinsX>
     <XLow>-0.02</XLow>
     <XHigh>1.02</XHigh>
-    <BinContents>0 0 0.000329707 0.00230795 0.00725354 0.0125288 0.0108803 0.0118694 0.013518 0.0161556 0.01121 0.0161556 0.0131883 0.0105506 0.0151665 0.0121991 0.0194527 0.0194527 0.016815 0.0118694 0.0161556 0.0145071 0.0181339 0.0158259 0.0187933 0.0187933 0.013518 0.0171447 0.0154962 0.0171447 0.0184636 0.019123 0.0184636 0.016815 0.0145071 0.0164853 0.0148368 0.0174744 0.0154962 0.0201121 0.0148368 0.0164853 0.0148368 0.0197824 0.0161556 0.0141774 0.0178042 0.0184636 0.0243983 0.0339598 0.0425321 0.00791296 0.200462 0 </BinContents>
+    <BinContents>0 0 0 0 0.00668022 0.0203311 0.0177171 0.010456 0.00668022 0.002614 0.00319489 0.00377578 0.002614 0.00145222 0.00145222 0.00232356 0.00116178 0.00116178 0.00116178 0.00290444 0.00145222 0.000871333 0.00232356 0.00116178 0.00116178 0.00145222 0.00116178 0.00174267 0.00174267 0.000580889 0.00232356 0.00174267 0.002614 0.00406622 0.00232356 0.00145222 0.00377578 0.00174267 0.00464711 0.00290444 0.002614 0.00232356 0.00435667 0.00377578 0.00464711 0.00580889 0.00638978 0.0133604 0.0165553 0.0217833 0.0226547 0.00435667 0.76445 0 </BinContents>
 </PhotonBkgPeakEnergyFraction_5>
 <PhotonSigPeakEnergyFraction_6>
     <NBinsX>52</NBinsX>
     <XLow>-0.02</XLow>
     <XHigh>1.02</XHigh>
-    <BinContents>0 0 0 9.07482e-05 0.00099823 0.00249558 0.00390217 0.00417442 0.00521802 0.00571714 0.00598938 0.00626163 0.00671537 0.00417442 0.00562639 0.00535414 0.00521802 0.00544489 0.00517265 0.00435591 0.00499115 0.00412904 0.00362993 0.00462816 0.00435591 0.00376605 0.00362993 0.00362993 0.00317619 0.00390217 0.00390217 0.0040383 0.00362993 0.00358455 0.0036753 0.00372068 0.00390217 0.00444666 0.0040383 0.00539952 0.00467353 0.0052634 0.00780435 0.00644312 0.00907482 0.0111167 0.0127501 0.0186034 0.0286764 0.0484595 0.0945143 0.0617088 0.533826 0 </BinContents>
+    <BinContents>0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 </BinContents>
 </PhotonSigPeakEnergyFraction_6>
 <PhotonBkgPeakEnergyFraction_6>
     <NBinsX>52</NBinsX>
     <XLow>-0.02</XLow>
     <XHigh>1.02</XHigh>
-    <BinContents>0 0 0 0 0.00337025 0.0052961 0.00481464 0.00962927 0.0101107 0.0120366 0.0125181 0.0144439 0.0154068 0.0139624 0.0125181 0.00914781 0.00770342 0.0120366 0.0221473 0.0178142 0.0173327 0.0163698 0.0173327 0.013481 0.0178142 0.0125181 0.0115551 0.0144439 0.0154068 0.0129995 0.0129995 0.0168512 0.0202215 0.0173327 0.0202215 0.0192585 0.0173327 0.01974 0.0226288 0.0178142 0.0216659 0.0211844 0.0149254 0.0250361 0.0250361 0.0235917 0.0178142 0.0235917 0.0240732 0.0385171 0.052961 0.0284064 0.166586 0 </BinContents>
+    <BinContents>0 0 0 0 0 0.00292042 0.0111949 0.0201996 0.0194695 0.0136286 0.00949136 0.00657094 0.00584084 0.00365052 0.00243368 0.00243368 0.00389389 0.000730105 0.00243368 0.000486736 0.000730105 0.00121684 0.00146021 0.00194695 0.000730105 0.00146021 0.000973473 0.000730105 0.00243368 0.00146021 0.00170358 0.00292042 0.000486736 0.00194695 0.00243368 0.00243368 0.00170358 0.00146021 0.00170358 0.00121684 0.000973473 0.00170358 0.00365052 0.00146021 0.00146021 0.00243368 0.00292042 0.00292042 0.004624 0.00827452 0.0170358 0.0053541 0.81066 0 </BinContents>
 </PhotonBkgPeakEnergyFraction_6>
 <PhotonSigPeakEnergyFraction_7>
     <NBinsX>52</NBinsX>
     <XLow>-0.02</XLow>
     <XHigh>1.02</XHigh>
-    <BinContents>0 0 0 0 0 0.000343713 0.00123737 0.00206228 0.00364336 0.00371211 0.00543067 0.00577439 0.00653056 0.00714924 0.00845535 0.00941775 0.0080429 0.00983021 0.00879906 0.00996769 0.00859284 0.00866158 0.00824912 0.00859284 0.00955523 0.00818038 0.0075617 0.00687427 0.00818038 0.00687427 0.0075617 0.00632433 0.00666804 0.0061181 0.0061181 0.00701175 0.00577439 0.0061181 0.0056369 0.0056369 0.00584313 0.00604936 0.00673678 0.00879906 0.0061181 0.00859284 0.0120987 0.0136111 0.0181481 0.0317591 0.0653743 0.0873032 0.494879 0 </BinContents>
+    <BinContents>0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 </BinContents>
 </PhotonSigPeakEnergyFraction_7>
 <PhotonBkgPeakEnergyFraction_7>
     <NBinsX>52</NBinsX>
     <XLow>-0.02</XLow>
     <XHigh>1.02</XHigh>
-    <BinContents>0 0 0 0 0 0 0.000829187 0.00414594 0.00414594 0.00829187 0.0116086 0.00746269 0.00912106 0.0116086 0.00995025 0.013267 0.00497512 0.00912106 0.0107794 0.00995025 0.013267 0.00912106 0.0157546 0.013267 0.0165837 0.0140962 0.0165837 0.0174129 0.0165837 0.00912106 0.013267 0.0165837 0.0190713 0.00995025 0.0149254 0.0257048 0.0174129 0.0165837 0.0232172 0.0232172 0.0257048 0.0257048 0.0331675 0.0298507 0.0323383 0.0323383 0.0447761 0.0339967 0.0339967 0.0348259 0.053068 0.0373134 0.145937 0 </BinContents>
+    <BinContents>0 0 0 0 0 0 0 0.000774443 0.00329138 0.00696999 0.0112294 0.0145208 0.014908 0.010455 0.00987415 0.010455 0.00600194 0.00600194 0.00406583 0.00367861 0.00193611 0.00271055 0.00193611 0.00309777 0.00154889 0.00154889 0.0017425 0.00116167 0.000580833 0.00116167 0.00154889 0.000580833 0.0017425 0.00135528 0.000580833 0.00135528 0.000968054 0.00232333 0.00135528 0.00116167 0.000968054 0.0017425 0.00290416 0.00154889 0.0017425 0.00193611 0.00116167 0.00329138 0.00232333 0.00271055 0.00387222 0.0054211 0.837754 0 </BinContents>
 </PhotonBkgPeakEnergyFraction_7>
 <PhotonSigPeakEnergyFraction_8>
     <NBinsX>52</NBinsX>
     <XLow>-0.02</XLow>
     <XHigh>1.02</XHigh>
-    <BinContents>0 0 0 0 0 0 0 0 0.000294522 0.00049087 0.000589044 0.000883566 0.00166896 0.00245435 0.00284704 0.00598861 0.00314157 0.00657766 0.00657766 0.006774 0.00775574 0.00795209 0.00824661 0.00834479 0.0105046 0.0120754 0.00932653 0.0100137 0.013548 0.0144316 0.0123699 0.0127626 0.0145297 0.0126644 0.015806 0.0151188 0.0138425 0.0130571 0.0149224 0.0138425 0.0154133 0.0170823 0.0141371 0.0122717 0.0139407 0.0139407 0.0151188 0.017475 0.0177695 0.0226782 0.0336737 0.0731396 0.453956 0 </BinContents>
+    <BinContents>0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 </BinContents>
 </PhotonSigPeakEnergyFraction_8>
 <PhotonBkgPeakEnergyFraction_8>
     <NBinsX>52</NBinsX>
     <XLow>-0.02</XLow>
     <XHigh>1.02</XHigh>
-    <BinContents>0 0 0 0 0 0 0 0 0.000994036 0 0 0.000994036 0.00497018 0.00198807 0 0.00298211 0.00695825 0.00298211 0.00894632 0.00994036 0.0109344 0.00497018 0.0109344 0.00695825 0.00596421 0.0149105 0.0119284 0.0109344 0.0119284 0.0139165 0.00994036 0.0109344 0.0139165 0.0168986 0.0109344 0.0198807 0.0168986 0.0119284 0.026839 0.0208747 0.026839 0.0328032 0.0208747 0.027833 0.027833 0.028827 0.0337972 0.0497018 0.05666 0.0666004 0.0785288 0.0934394 0.153082 0 </BinContents>
+    <BinContents>0 0 0 0 0 0 0 0 0 0 0 0 0.000178923 0.000715692 0.0010139 0.00190851 0.00220672 0.00226636 0.00280313 0.00268384 0.00304169 0.002326 0.00274348 0.00369774 0.00268384 0.00208743 0.00143138 0.00143138 0.00161031 0.00202779 0.00143138 0.00172959 0.00119282 0.00161031 0.00137174 0.00184887 0.00149102 0.00178923 0.00256456 0.00149102 0.00178923 0.00238564 0.00244528 0.00214707 0.00184887 0.0026242 0.00333989 0.00298205 0.00256456 0.00256456 0.00125246 0.000894614 0.919783 0 </BinContents>
 </PhotonBkgPeakEnergyFraction_8>
 <PhotonSigMinDistanceToTrack_0>
     <NBinsX>40</NBinsX>
     <XLow>0</XLow>
     <XHigh>20</XHigh>
-    <BinContents>0 0 0 0 0 0.00172933 0.00206098 0.00151612 0.00187146 0.00139767 0.00130292 0.00132661 0.00106602 0.00130292 0.00127923 0.00130292 0.00113709 0.00132661 0.00137398 0.00132661 0.00149243 0.0015635 0.00144505 0.00158719 0.00168195 0.00144505 0.00198991 0.00168195 0.00258214 0.00198991 0.00232156 0.00227418 0.00260583 0.00244001 0.00213204 0.0028901 0.00281904 0.00307962 0.00305593 0.00329282 0.00293748 0.931372 </BinContents>
+    <BinContents>0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 </BinContents>
 </PhotonSigMinDistanceToTrack_0>
 <PhotonBkgMinDistanceToTrack_0>
     <NBinsX>40</NBinsX>
     <XLow>0</XLow>
     <XHigh>20</XHigh>
-    <BinContents>0 0 0 0 0 0.0364749 0.0241851 0.020434 0.017279 0.0143625 0.0117578 0.011125 0.00979511 0.00868536 0.00851111 0.00896968 0.00886879 0.00886879 0.00831851 0.00877708 0.00855696 0.00810756 0.00819928 0.00778656 0.00751142 0.00762148 0.00792413 0.00791496 0.0076123 0.00805253 0.00827265 0.00818093 0.00819011 0.00824513 0.00779573 0.00800668 0.0076765 0.00853862 0.00822679 0.00796999 0.00804336 0.625154 </BinContents>
+    <BinContents>0 0 0 0 0 0.000182977 9.14885e-05 0.000365954 0.000365954 0.000365954 0.000304962 0.000335458 0.00039645 0.000304962 0.000213473 0.000182977 0.000121985 0.000213473 0.000335458 0.000457443 0.000457443 0.00039645 0.000426946 0.000823397 0.000670916 0.000731908 0.00125034 0.00103687 0.00103687 0.00137233 0.00176878 0.00186027 0.00228721 0.00204324 0.00250069 0.00295813 0.00402549 0.00375103 0.003995 0.00436095 0.00500137 0.953005 </BinContents>
 </PhotonBkgMinDistanceToTrack_0>
 <PhotonSigMinDistanceToTrack_1>
     <NBinsX>40</NBinsX>
     <XLow>0</XLow>
     <XHigh>20</XHigh>
-    <BinContents>0 0 0 0 0 0.00616107 0.00390054 0.00328 0.0027481 0.00217189 0.00252648 0.00190594 0.00203892 0.00141838 0.00150703 0.00141838 0.00132973 0.00164 0.00177297 0.00212757 0.00199459 0.00234919 0.0018173 0.00177297 0.00164 0.00208324 0.00212757 0.00208324 0.00190594 0.00203892 0.00168432 0.00212757 0.00243784 0.00208324 0.00203892 0.00226054 0.00265946 0.00270378 0.0027481 0.00248216 0.00239351 0.918621 </BinContents>
+    <BinContents>0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 </BinContents>
 </PhotonSigMinDistanceToTrack_1>
 <PhotonBkgMinDistanceToTrack_1>
     <NBinsX>40</NBinsX>
     <XLow>0</XLow>
     <XHigh>20</XHigh>
-    <BinContents>0 0 0 0 0 0.031834 0.0211044 0.0196413 0.0171806 0.0157618 0.0126361 0.011439 0.0111729 0.0107739 0.0106409 0.0105522 0.0115941 0.0124144 0.0119488 0.0123257 0.0106852 0.011439 0.0117272 0.0105522 0.0106631 0.0108182 0.0111508 0.0112173 0.0114168 0.0106631 0.0111286 0.0107074 0.0100645 0.0102197 0.00968765 0.0090891 0.00886741 0.00964331 0.00937729 0.0103305 0.00982066 0.559711 </BinContents>
+    <BinContents>0 0 0 0 0 0.00273785 0.00359343 0.00735797 0.00598905 0.00359343 0.00410678 0.00256674 0.00171116 0.00136893 0.00136893 0.00136893 0.00102669 0.00136893 0.00102669 0.00119781 0.000684463 0.0022245 0.00239562 0.00308008 0.00359343 0.0032512 0.00290897 0.0032512 0.00427789 0.00564682 0.00564682 0.00633128 0.00735797 0.00598905 0.00701574 0.00821355 0.00838467 0.0123203 0.0111225 0.0116359 0.00975359 0.834531 </BinContents>
 </PhotonBkgMinDistanceToTrack_1>
 <PhotonSigMinDistanceToTrack_2>
     <NBinsX>40</NBinsX>
     <XLow>0</XLow>
     <XHigh>20</XHigh>
-    <BinContents>0 0 0 0 0 0.0035615 0.00175635 0.00136605 0.00131727 0.00107333 0.00082939 0.000780602 0.000487876 0.000634239 0.000683027 0.00126848 0.000780602 0.000731814 0.00151242 0.00131727 0.000731814 0.00180514 0.00151242 0.0011709 0.00131727 0.000878177 0.00190272 0.00141484 0.00234181 0.00239059 0.00219544 0.00209787 0.00190272 0.00180514 0.00165878 0.00146363 0.00180514 0.00185393 0.00224423 0.00200029 0.00239059 0.945016 </BinContents>
+    <BinContents>0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 </BinContents>
 </PhotonSigMinDistanceToTrack_2>
 <PhotonBkgMinDistanceToTrack_2>
     <NBinsX>40</NBinsX>
     <XLow>0</XLow>
     <XHigh>20</XHigh>
-    <BinContents>0 0 0 0 0 0.0443594 0.0261202 0.0249944 0.0190648 0.0199655 0.014186 0.014186 0.0146363 0.0114088 0.0124597 0.0117091 0.0150867 0.0177888 0.0149366 0.0159874 0.0135105 0.0146363 0.0144862 0.0126098 0.0117841 0.0114839 0.0118592 0.0107333 0.011559 0.0127599 0.0119342 0.00960745 0.0096825 0.00990768 0.00893192 0.00983262 0.00863169 0.00960745 0.0091571 0.00840651 0.0073557 0.494633 </BinContents>
+    <BinContents>0 0 0 0 0 0.0160514 0.00963082 0.0188604 0.0116372 0.00802568 0.00481541 0.00321027 0.00401284 0.00321027 0.00280899 0.000802568 0.00200642 0.0024077 0.000802568 0.0024077 0.00321027 0.00280899 0.00401284 0.00441413 0.00441413 0.00200642 0.00561798 0.00722311 0.00561798 0.00521669 0.00561798 0.00963082 0.00561798 0.00882825 0.0100321 0.0100321 0.00802568 0.0124398 0.0116372 0.0124398 0.0136437 0.756822 </BinContents>
 </PhotonBkgMinDistanceToTrack_2>
 <PhotonSigMinDistanceToTrack_3>
     <NBinsX>40</NBinsX>
     <XLow>0</XLow>
     <XHigh>20</XHigh>
-    <BinContents>0 0 0 0 0 0.000984598 0.00119558 0.000773613 0.000351642 0.000703284 0.000562627 0.000632956 0.000773613 0.000843941 0.000492299 0.00091427 0.00091427 0.00133624 0.00140657 0.00119558 0.00105493 0.00189887 0.00182854 0.00161755 0.00232084 0.00182854 0.00182854 0.00253182 0.00203952 0.0019692 0.00218018 0.00239117 0.00274281 0.00302412 0.00253182 0.00154723 0.00182854 0.00302412 0.00210985 0.00232084 0.00302412 0.941276 </BinContents>
+    <BinContents>0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 </BinContents>
 </PhotonSigMinDistanceToTrack_3>
 <PhotonBkgMinDistanceToTrack_3>
     <NBinsX>40</NBinsX>
     <XLow>0</XLow>
     <XHigh>20</XHigh>
-    <BinContents>0 0 0 0 0 0.0366818 0.0249341 0.0246943 0.0230161 0.017262 0.0165428 0.0151043 0.014385 0.012467 0.013426 0.0122273 0.0182211 0.0167825 0.0129465 0.0189403 0.0155838 0.011508 0.0139055 0.0103093 0.0129465 0.00935028 0.0141453 0.00911053 0.0107888 0.010549 0.0100695 0.0100695 0.0112683 0.00647327 0.00671302 0.00791177 0.00599377 0.00791177 0.00863102 0.00959003 0.00647327 0.513066 </BinContents>
+    <BinContents>0 0 0 0 0 0.0166028 0.0121328 0.0280971 0.0108557 0.00574713 0.00702427 0.0063857 0.00255428 0.00319285 0.00191571 0.00319285 0.00191571 0.00127714 0.00063857 0.00191571 0.00319285 0.00255428 0.00127714 0.00446999 0.00255428 0.00574713 0.0063857 0.00702427 0.0114943 0.00574713 0.00510856 0.0108557 0.0083014 0.0102171 0.0114943 0.0083014 0.0114943 0.00893997 0.0102171 0.00766284 0.0083014 0.745211 </BinContents>
 </PhotonBkgMinDistanceToTrack_3>
 <PhotonSigMinDistanceToTrack_4>
     <NBinsX>40</NBinsX>
     <XLow>0</XLow>
     <XHigh>20</XHigh>
-    <BinContents>0 0 0 0 0 0.00131532 0.000556483 0.000657662 0.000505894 0.000708251 0.000303536 0.000708251 0.000657662 0.000505894 0.00106238 0.00121414 0.00116356 0.00131532 0.00151768 0.00172004 0.00182122 0.00242829 0.00166945 0.00202357 0.00202357 0.00207416 0.002833 0.002833 0.00227652 0.00242829 0.00273183 0.00222593 0.00217534 0.00278242 0.00242829 0.00217534 0.002833 0.00258006 0.00318713 0.00303536 0.0033389 0.934183 </BinContents>
+    <BinContents>0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 </BinContents>
 </PhotonSigMinDistanceToTrack_4>
 <PhotonBkgMinDistanceToTrack_4>
     <NBinsX>40</NBinsX>
     <XLow>0</XLow>
     <XHigh>20</XHigh>
-    <BinContents>0 0 0 0 0 0.0272701 0.0194372 0.0203075 0.016246 0.0156658 0.0139252 0.0171163 0.0124746 0.010734 0.0121845 0.0110241 0.0121845 0.016246 0.016246 0.0168262 0.0113142 0.0124746 0.00957354 0.00841311 0.00899333 0.00841311 0.0101538 0.0104439 0.008123 0.00928343 0.00696258 0.00841311 0.00725268 0.00841311 0.00638236 0.0078329 0.00754279 0.00522193 0.00551204 0.00667247 0.00435161 0.590368 </BinContents>
+    <BinContents>0 0 0 0 0 0.0159266 0.0120656 0.0482625 0.0357143 0.0178571 0.0144788 0.00434363 0.0019305 0.000965251 0.00144788 0.000965251 0.00241313 0.00337838 0.00337838 0.00337838 0.00241313 0.003861 0.00289575 0.00772201 0.00627413 0.003861 0.00675676 0.00530888 0.00627413 0.00820463 0.00675676 0.00723938 0.00916988 0.00965251 0.0106178 0.00916988 0.011583 0.00820463 0.0164093 0.00627413 0.0125483 0.672297 </BinContents>
 </PhotonBkgMinDistanceToTrack_4>
 <PhotonSigMinDistanceToTrack_5>
     <NBinsX>40</NBinsX>
     <XLow>0</XLow>
     <XHigh>20</XHigh>
-    <BinContents>0 0 0 0 0 0.000933881 0.000522973 0.000747105 0.000672394 0.000410908 0.0010833 0.000859171 0.0010833 0.000933881 0.00134479 0.0014195 0.00235338 0.00201718 0.002839 0.00268958 0.00246545 0.00287635 0.00276429 0.00257751 0.0031752 0.00276429 0.00332462 0.00351139 0.00339933 0.00306313 0.00384759 0.0042585 0.00369817 0.0039223 0.00324991 0.00373552 0.00474412 0.0035861 0.00362346 0.0039223 0.00366081 0.907919 </BinContents>
+    <BinContents>0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 </BinContents>
 </PhotonSigMinDistanceToTrack_5>
 <PhotonBkgMinDistanceToTrack_5>
     <NBinsX>40</NBinsX>
     <XLow>0</XLow>
     <XHigh>20</XHigh>
-    <BinContents>0 0 0 0 0 0.0171447 0.0145071 0.0201121 0.0148368 0.0148368 0.0171447 0.0121991 0.0121991 0.0105506 0.00923178 0.0118694 0.0158259 0.0121991 0.0131883 0.0105506 0.00857237 0.00824266 0.0108803 0.0115397 0.00560501 0.013518 0.0115397 0.0102209 0.00956149 0.00791296 0.00725354 0.0049456 0.00461589 0.00461589 0.00791296 0.00824266 0.0049456 0.00824266 0.00758325 0.00461589 0.00461589 0.628421 </BinContents>
+    <BinContents>0 0 0 0 0 0.0101656 0.00638978 0.0853906 0.0560558 0.0435667 0.0252687 0.00580889 0.00290444 0.00174267 0.00203311 0.00203311 0.00290444 0.00290444 0.00290444 0.00348533 0.00493755 0.00697067 0.00668022 0.005228 0.00697067 0.00697067 0.00842289 0.00755155 0.00697067 0.007842 0.00755155 0.00580889 0.0101656 0.00697067 0.00842289 0.0110369 0.00929422 0.0101656 0.0127796 0.00813244 0.0116178 0.575951 </BinContents>
 </PhotonBkgMinDistanceToTrack_5>
 <PhotonSigMinDistanceToTrack_6>
     <NBinsX>40</NBinsX>
     <XLow>0</XLow>
     <XHigh>20</XHigh>
-    <BinContents>0 0 0 0 0 0.000907482 0.00077136 0.000725986 0.0010436 0.0010436 0.00167884 0.00231408 0.00204183 0.00208721 0.00267707 0.00322156 0.00412904 0.00458279 0.00394755 0.00394755 0.00458279 0.00444666 0.00512727 0.00449204 0.00539952 0.00503653 0.00585326 0.00499115 0.00535414 0.00589863 0.00512727 0.00503653 0.00512727 0.00576251 0.00626163 0.00571714 0.006307 0.00558102 0.00567176 0.00589863 0.00512727 0.85208 </BinContents>
+    <BinContents>0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 </BinContents>
 </PhotonSigMinDistanceToTrack_6>
 <PhotonBkgMinDistanceToTrack_6>
     <NBinsX>40</NBinsX>
     <XLow>0</XLow>
     <XHigh>20</XHigh>
-    <BinContents>0 0 0 0 0 0.0163698 0.0105922 0.0163698 0.0144439 0.0101107 0.0105922 0.0115551 0.0125181 0.00866635 0.00914781 0.0110737 0.0120366 0.0105922 0.0105922 0.0110737 0.00866635 0.00818488 0.00818488 0.00722195 0.0052961 0.00674049 0.0052961 0.00577756 0.0120366 0.00866635 0.00674049 0.00577756 0.00625903 0.0052961 0.00722195 0.00722195 0.00385171 0.00577756 0.00866635 0.00625903 0.00770342 0.677419 </BinContents>
+    <BinContents>0 0 0 0 0 0.0153322 0.0111949 0.126795 0.0846921 0.053541 0.0348017 0.0114383 0.004624 0.00316379 0.00413726 0.00292042 0.00365052 0.00170358 0.0053541 0.00584084 0.00608421 0.00438063 0.00608421 0.00657094 0.00511073 0.00949136 0.00778778 0.00827452 0.0099781 0.00681431 0.00803115 0.00851789 0.0099781 0.0104648 0.0099781 0.00924799 0.0124118 0.0121684 0.00876126 0.0131419 0.00803115 0.449501 </BinContents>
 </PhotonBkgMinDistanceToTrack_6>
 <PhotonSigMinDistanceToTrack_7>
     <NBinsX>40</NBinsX>
     <XLow>0</XLow>
     <XHigh>20</XHigh>
-    <BinContents>0 0 0 0 0 0.00123737 0.00116863 0.00171857 0.00233725 0.00171857 0.00247474 0.00295594 0.00398708 0.00350588 0.00426205 0.00460576 0.00488073 0.00783667 0.00701175 0.00666804 0.00701175 0.00721798 0.00584313 0.00776792 0.00653056 0.00714924 0.00907404 0.00831787 0.00797415 0.00701175 0.00790541 0.0075617 0.00763044 0.00653056 0.0065993 0.0065993 0.00769918 0.00584313 0.00749295 0.00776792 0.0061181 0.791985 </BinContents>
+    <BinContents>0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 </BinContents>
 </PhotonSigMinDistanceToTrack_7>
 <PhotonBkgMinDistanceToTrack_7>
     <NBinsX>40</NBinsX>
     <XLow>0</XLow>
     <XHigh>20</XHigh>
-    <BinContents>0 0 0 0 0 0.0124378 0.00829187 0.0165837 0.00912106 0.00829187 0.00829187 0.00497512 0.00746269 0.00829187 0.00829187 0.00746269 0.00746269 0.00912106 0.0149254 0.00580431 0.00746269 0.0066335 0.0066335 0.00746269 0.0107794 0.00414594 0.00580431 0.00995025 0.00746269 0.00497512 0.00912106 0.000829187 0.00912106 0.013267 0.00497512 0.0066335 0.00746269 0.00331675 0.00331675 0.00829187 0.00331675 0.722222 </BinContents>
+    <BinContents>0 0 0 0 0 0.0152953 0.0089061 0.170571 0.114424 0.0799613 0.0495644 0.0158761 0.0121975 0.00600194 0.00813166 0.00561471 0.00580833 0.00600194 0.00638916 0.00755082 0.00619555 0.00851888 0.00968054 0.00851888 0.0100678 0.0102614 0.0071636 0.0106486 0.0106486 0.00987415 0.0106486 0.0100678 0.011423 0.011423 0.0116167 0.0102614 0.0116167 0.0116167 0.00948693 0.00696999 0.00909971 0.281897 </BinContents>
 </PhotonBkgMinDistanceToTrack_7>
 <PhotonSigMinDistanceToTrack_8>
     <NBinsX>40</NBinsX>
     <XLow>0</XLow>
     <XHigh>20</XHigh>
-    <BinContents>0 0 0 0 0 0.00196348 0.00284704 0.002258 0.00363244 0.00481052 0.00441783 0.00530139 0.00539957 0.00500687 0.00638131 0.00549774 0.00854114 0.01129 0.00962105 0.0113882 0.0106028 0.00952287 0.0107991 0.0103083 0.0094247 0.0113882 0.009032 0.0109955 0.0106028 0.0104064 0.0113882 0.0102101 0.00932653 0.0106028 0.009032 0.0108973 0.00873748 0.0098174 0.00863931 0.00795209 0.00932653 0.702631 </BinContents>
+    <BinContents>0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 </BinContents>
 </PhotonSigMinDistanceToTrack_8>
 <PhotonBkgMinDistanceToTrack_8>
     <NBinsX>40</NBinsX>
     <XLow>0</XLow>
     <XHigh>20</XHigh>
-    <BinContents>0 0 0 0 0 0.00397614 0.00298211 0.0129225 0.00497018 0.00497018 0.00894632 0.00894632 0.00298211 0.00994036 0.00795229 0.00596421 0.00894632 0.0149105 0.00298211 0.0119284 0.00695825 0.0149105 0.00695825 0.00695825 0.00596421 0.0129225 0.00994036 0.0149105 0.0119284 0.00397614 0.00596421 0.0149105 0.00695825 0.00994036 0.00795229 0.00994036 0.00596421 0.0109344 0.00497018 0.00497018 0.00894632 0.699801 </BinContents>
+    <BinContents>0 0 0 0 0 0.0135981 0.0107354 0.312638 0.218644 0.145106 0.0873144 0.0228425 0.0113318 0.00745512 0.00518876 0.00453271 0.00441343 0.0036381 0.00435379 0.00387666 0.00351882 0.00250492 0.0036381 0.00274348 0.00208743 0.00351882 0.002326 0.00250492 0.00202779 0.00256456 0.00250492 0.00280313 0.002326 0.00256456 0.00328025 0.00220672 0.00274348 0.00250492 0.00190851 0.00172959 0.002326 0.0899982 </BinContents>
 </PhotonBkgMinDistanceToTrack_8>
diff --git a/Reconstruction/PFA/Pandora/PandoraSettingsDefault.xml b/Reconstruction/PFA/Pandora/PandoraSettingsDefault.xml
index 81a41e39c6bf686f35ea5664624c8e2ffde2efd9..ea248899b40a480e45bcc82688b33cfded165a9c 100644
--- a/Reconstruction/PFA/Pandora/PandoraSettingsDefault.xml
+++ b/Reconstruction/PFA/Pandora/PandoraSettingsDefault.xml
@@ -69,8 +69,7 @@
         <ClusterListName>PhotonClusters</ClusterListName>
         <ReplaceCurrentClusterList>false</ReplaceCurrentClusterList>
         <ShouldMakePdfHistograms>false</ShouldMakePdfHistograms>
-        <HistogramFile>./Reconstruction/PFA/Pandora/PandoraLikelihoodData9EBin.xml</HistogramFile>
-        <!--HistogramFile>/junofs/users/wxfang/MyGit/tmp/fork_update_pandora/CEPCSW/Reconstruction/PFA/Pandora/PandoraLikelihoodData9EBin.xml</HistogramFile-->
+        <HistogramFile>Reconstruction/PFA/Pandora/PandoraLikelihoodData9EBin.xml</HistogramFile>
     </algorithm>
 
     <!-- Clustering parent algorithm runs a daughter clustering algorithm -->
diff --git a/Reconstruction/Tracking/CMakeLists.txt b/Reconstruction/Tracking/CMakeLists.txt
index 44b8702ab554e7b705bfc597ae2046ae950c610b..166add75f15af42d8d3bdb8ee087fc3553108192 100644
--- a/Reconstruction/Tracking/CMakeLists.txt
+++ b/Reconstruction/Tracking/CMakeLists.txt
@@ -11,17 +11,20 @@ gaudi_depends_on_subdirs(
     Service/GearSvc
     Service/EventSeeder
     Service/TrackSystemSvc
+    Detector/DetSegmentation
 )
 
 set(Tracking_srcs
     src/Clupatra/*.cpp
     src/FullLDCTracking/*.cpp
+    src/TruthTracker/*.cpp
 )
 
 # Modules
 gaudi_add_module(Tracking ${Tracking_srcs}
     INCLUDE_DIRS GaudiKernel gear ${GSL_INCLUDE_DIRS} ${LCIO_INCLUDE_DIRS}
     LINK_LIBRARIES GaudiAlgLib GaudiKernel ${GEAR_LIBRARIES} ${GSL_LIBRARIES} ${LCIO_LIBRARIES} TrackSystemSvcLib
+    DetSegmentation
       -Wl,--no-as-needed
      EDM4HEP::edm4hep EDM4HEP::edm4hepDict
      -Wl,--as-needed
diff --git a/Reconstruction/Tracking/src/Clupatra/ClupatraAlg.cpp b/Reconstruction/Tracking/src/Clupatra/ClupatraAlg.cpp
index af73dccf723b0c9db0770543e79f0f194239900d..5c14a0fbdead30aab938178d07112e55c379bf03 100644
--- a/Reconstruction/Tracking/src/Clupatra/ClupatraAlg.cpp
+++ b/Reconstruction/Tracking/src/Clupatra/ClupatraAlg.cpp
@@ -232,12 +232,6 @@ StatusCode ClupatraAlg::initialize() {
 
 StatusCode ClupatraAlg::execute() {
 
-	TrackInfo_of_edm4hepTrack.init();
-	MarTrk_of_edm4hepTrack.init();
-	CluTrk_of_MarTrack.init();
-	MarTrkof.init();
-	GHitof.init();
-
 
 	debug() << "Clupatra Algorithm started" << endmsg;
 
@@ -1267,6 +1261,12 @@ StatusCode ClupatraAlg::execute() {
 
 	_nEvt++ ;
 
+	TrackInfo_of_edm4hepTrack.clear();
+	MarTrk_of_edm4hepTrack.clear();
+	CluTrk_of_MarTrack.clear();
+	MarTrkof.clear();
+	GHitof.clear();
+
 	return StatusCode::SUCCESS;
 }
 
diff --git a/Reconstruction/Tracking/src/Clupatra/RuntimeMap.h b/Reconstruction/Tracking/src/Clupatra/RuntimeMap.h
index 2b0b14a2ed1b0edcbcd75e427fa942f6d1f19853..a85f460913d7225f389d638ffb5c51dd4d0ebbbe 100644
--- a/Reconstruction/Tracking/src/Clupatra/RuntimeMap.h
+++ b/Reconstruction/Tracking/src/Clupatra/RuntimeMap.h
@@ -9,7 +9,7 @@ class RuntimeMap {
     V& operator()(const U& u) {
         return data[u];
     }
-    void init() {
+    void clear() {
         data.clear();
     }
 };
diff --git a/Reconstruction/Tracking/src/TruthTracker/TruthTrackerAlg.cpp b/Reconstruction/Tracking/src/TruthTracker/TruthTrackerAlg.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..612fae8e2a0de342361d2ad0527a5c90b9055629
--- /dev/null
+++ b/Reconstruction/Tracking/src/TruthTracker/TruthTrackerAlg.cpp
@@ -0,0 +1,180 @@
+#include "TruthTrackerAlg.h"
+#include "DataHelper/HelixClass.h"
+#include "edm4hep/EventHeaderCollection.h"
+#include "edm4hep/MCParticleCollection.h"
+#include "edm4hep/SimTrackerHitCollection.h"
+#include "edm4hep/TrackerHitCollection.h"
+#include "edm4hep/TrackCollection.h"
+#include "edm4hep/MCRecoTrackerAssociationCollection.h"
+#include "edm4hep/MCRecoParticleAssociationCollection.h"
+#include "edm4hep/ReconstructedParticleCollection.h"
+#include "DDSegmentation/Segmentation.h"
+#include "DetSegmentation/GridDriftChamber.h"
+#include "DetInterface/IGeomSvc.h"
+//#include "edm4hep/SimCalorimeterHitCollection.h"
+//#include "edm4hep/CaloHitContributionCollection.h"
+
+#include "DD4hep/Detector.h"
+#include "DD4hep/IDDescriptor.h"
+#include "DD4hep/Plugins.h"
+#include "DD4hep/DD4hepUnits.h"
+
+DECLARE_COMPONENT(TruthTrackerAlg)
+
+TruthTrackerAlg::TruthTrackerAlg(const std::string& name, ISvcLocator* svcLoc)
+: GaudiAlgorithm(name, svcLoc), m_dd4hep(nullptr), m_gridDriftChamber(nullptr),m_decoder(nullptr)
+{
+    declareProperty("MCParticle", m_mcParticleCol,
+            "Handle of the input MCParticle collection");
+    declareProperty("DigiDCHitCollection", m_digiDCHitsCol,
+            "Handle of digi DCHit collection");
+    declareProperty("DCHitAssociationCollection", m_dcHitAssociationCol,
+        "Handle of association collection");
+    declareProperty("DCTrackCollection", m_dcTrackCol,
+        "Handle of association collection");
+    declareProperty("DCRecParticleCollection", m_dcRecParticleCol,
+            "Handle of drift chamber reconstructed particle collection");
+    declareProperty("DCRecParticleAssociationCollection", m_dcRecParticleAssociationCol,
+            "Handle of drift chamber reconstructed particle collection");
+    declareProperty("debug", m_debug=false);
+}
+
+StatusCode TruthTrackerAlg::initialize()
+{
+    ///Get geometry
+    m_geomSvc=service<IGeomSvc>("GeomSvc");
+    if (!m_geomSvc) {
+        error() << "Failed to get GeomSvc." << endmsg;
+        return StatusCode::FAILURE;
+    }
+    ///Get Detector
+    m_dd4hep=m_geomSvc->lcdd();
+    if (nullptr==m_dd4hep) {
+        error() << "Failed to get dd4hep::Detector." << endmsg;
+        return StatusCode::FAILURE;
+    }
+    //Get Field
+    m_dd4hepField=m_geomSvc->lcdd()->field();
+    ///Get Readout
+    dd4hep::Readout readout=m_dd4hep->readout(m_readout_name);
+    ///Get Segmentation
+    m_gridDriftChamber=dynamic_cast<dd4hep::DDSegmentation::GridDriftChamber*>
+        (readout.segmentation().segmentation());
+    if(nullptr==m_gridDriftChamber){
+        error() << "Failed to get the GridDriftChamber" << endmsg;
+        return StatusCode::FAILURE;
+    }
+    ///Get Decoder
+    m_decoder = m_geomSvc->getDecoder(m_readout_name);
+    if (nullptr==m_decoder) {
+        error() << "Failed to get the decoder" << endmsg;
+        return StatusCode::FAILURE;
+    }
+
+    return GaudiAlgorithm::initialize();
+}
+
+StatusCode TruthTrackerAlg::execute()
+{
+    ///Retrieve MC particle(s)
+    const edm4hep::MCParticleCollection* mcParticleCol=nullptr;
+    mcParticleCol=m_mcParticleCol.get();
+    if(nullptr==mcParticleCol){
+        debug()<<"MCParticleCollection not found"<<endmsg;
+        return StatusCode::SUCCESS;
+    }
+    ///Retrieve DC digi
+    const edm4hep::TrackerHitCollection* digiDCHitsCol=nullptr;
+    digiDCHitsCol=m_digiDCHitsCol.get();//FIXME DEBUG
+    if(nullptr==digiDCHitsCol){
+        debug()<<"TrackerHitCollection not found"<<endmsg;
+        //return StatusCode::SUCCESS;
+    }
+
+    ///Output Track collection
+    edm4hep::TrackCollection* dcTrackCol=m_dcTrackCol.createAndPut();
+    ////TODO
+    /////Output MCRecoTrackerAssociationCollection collection
+    //const edm4hep::MCRecoTrackerAssociationCollection*
+    //    mcRecoTrackerAssociationCol=nullptr;
+    //if(nullptr==mcRecoTrackerAssociationCol){
+    //    log<<MSG::DEBUG<<"MCRecoTrackerAssociationCollection not found"
+    //        <<endmsg;
+    //    return StatusCode::SUCCESS;
+    //}
+    //mcRecoTrackerAssociationCol=m_mcRecoParticleAssociation.get();
+
+    ///Convert MCParticle to Track and ReconstructedParticle
+    if(m_debug){
+        debug()<<"MCParticleCol size="<<mcParticleCol->size()<<endmsg;
+    }
+    for(auto mcParticle : *mcParticleCol){
+        //if(fabs(mcParticle.getCharge()<1e-6) continue;//Skip neutral particles
+        edm4hep::Vector3d posV= mcParticle.getVertex();
+        edm4hep::Vector3f momV= mcParticle.getMomentum();//GeV
+        float pos[3]={posV.x, posV.y, posV.z};
+        float mom[3]={momV.x, momV.y, momV.z};
+        //FIXME
+        //pivotToFirstLayer(mcPocaPos,mcPocaMom,firstLayerPos,firstLayerMom);
+        double B[3]={1e9,1e9,1e9};
+        m_dd4hepField.magneticField({0.,0.,0.},B);
+        if(m_debug)std::cout<<" PDG "<<mcParticle.getPDG()<<" charge "
+            << mcParticle.getCharge()
+            <<" pos "<<pos[0]<<" "<<pos[1]<<" "<<pos[2]
+            <<" mom "<<mom[0]<<" "<<mom[1]<<" "<<mom[2]
+            <<" Bxyz "<<B[0]/dd4hep::tesla<<" "<<B[1]/dd4hep::tesla
+            <<" "<<B[2]/dd4hep::tesla<<" tesla"<<std::endl;
+
+        HelixClass helix;
+        helix.Initialize_VP(pos,mom,(int) mcParticle.getCharge(),B[2]/dd4hep::tesla);
+        edm4hep::TrackState trackState;
+        trackState.D0=helix.getD0();
+        trackState.phi=helix.getPhi0();
+        trackState.omega=helix.getOmega();
+        trackState.Z0=helix.getZ0();
+        trackState.tanLambda=helix.getTanLambda();
+        trackState.referencePoint=helix.getReferencePoint();
+        std::array<float,15> covMatrix;
+        for(int i=0;i<15;i++){covMatrix[i]=999.;}//FIXME
+        trackState.covMatrix=covMatrix;
+
+        if(m_debug){
+            std::cout<<" helix  d0 "<<trackState.D0<<
+                " phi "<<trackState.phi<<
+                " omega "<<trackState.omega<<
+                " z0 "<<trackState.Z0<<
+                " tanLambda "<<trackState.tanLambda<<
+                " referencePoint "<<trackState.referencePoint<< std::endl;
+        }
+        //new Track
+        edm4hep::Track track = dcTrackCol->create();
+        track.addToTrackStates(trackState);
+        if(nullptr!=digiDCHitsCol) {
+            //track.setType();//TODO
+            //track.setChi2(trackState->getChi2());
+            track.setNdf(digiDCHitsCol->size()-5);
+            //track.setDEdx();//TODO
+            //track.setRadiusOfInnermostHit();//TODO
+            for(int i=0; i<digiDCHitsCol->size(); i++ ){
+                edm4hep::TrackerHit digiDC=digiDCHitsCol->at(i);
+                //if(Sim->MCParti!=current) continue;//TODO
+                track.addToTrackerHits(digiDC);
+            }
+        }
+        //TODO
+        //new ReconstructedParticle
+        //recParticle->setType();
+        //dcRecParticle->setEnergy();
+        //edm4hep::Vector3f momVec3(helix.getMomentum()[0],
+        //        helix.getMomentum()[1],helix.getMomentum()[2]);
+        //recParticle->setMomentum(momVec3);
+    }
+
+    if(m_debug) std::cout<<"Output DCTrack size="<<dcTrackCol->size()<<std::endl;
+    return StatusCode::SUCCESS;
+}
+
+StatusCode TruthTrackerAlg::finalize()
+{
+    return GaudiAlgorithm::finalize();
+}
diff --git a/Reconstruction/Tracking/src/TruthTracker/TruthTrackerAlg.h b/Reconstruction/Tracking/src/TruthTracker/TruthTrackerAlg.h
new file mode 100644
index 0000000000000000000000000000000000000000..23e581e1b73a4e1f962ddc3e53cfb8e525258de6
--- /dev/null
+++ b/Reconstruction/Tracking/src/TruthTracker/TruthTrackerAlg.h
@@ -0,0 +1,65 @@
+#ifndef TruthTrackerAlg_h
+#define TruthTrackerAlg_h
+
+#include "GaudiAlg/GaudiAlgorithm.h"
+#include "k4FWCore/DataHandle.h"
+#include "DD4hep/Fields.h"
+
+class IGeomSvc;
+namespace dd4hep {
+    class Detector;
+    namespace DDSegmentation{
+        class GridDriftChamber;
+        class BitFieldCoder;
+    }
+}
+namespace edm4hep {
+    class MCParticleCollection;
+    class TrackerHitCollection;
+    class TrackCollection;
+    class MCRecoTrackerAssociationCollection;
+    class ReconstructedParticleCollection;
+    class MCRecoParticleAssociationCollection;
+}
+
+class TruthTrackerAlg: public GaudiAlgorithm
+{
+    public:
+        TruthTrackerAlg(const std::string& name, ISvcLocator* svcLoc);
+
+        virtual StatusCode initialize();
+        virtual StatusCode execute();
+        virtual StatusCode finalize();
+
+    private:
+        SmartIF<IGeomSvc> m_geomSvc;
+        dd4hep::Detector* m_dd4hep;
+        dd4hep::OverlayedField m_dd4hepField;
+        dd4hep::DDSegmentation::GridDriftChamber* m_gridDriftChamber;
+        dd4hep::DDSegmentation::BitFieldCoder* m_decoder;
+
+        //reader
+        DataHandle<edm4hep::MCParticleCollection> m_mcParticleCol{
+            "MCParticle", Gaudi::DataHandle::Reader, this};
+        DataHandle<edm4hep::TrackerHitCollection> m_digiDCHitsCol{
+            "DigiDCHitsCollection", Gaudi::DataHandle::Reader, this};
+        DataHandle<edm4hep::MCRecoTrackerAssociationCollection>
+            m_dcHitAssociationCol{ "DCHitAssociationCollection",
+                Gaudi::DataHandle::Reader, this};
+        //writer
+        DataHandle<edm4hep::TrackCollection> m_dcTrackCol{"DCTrackCollection",
+            Gaudi::DataHandle::Writer, this};
+        DataHandle<edm4hep::ReconstructedParticleCollection> m_dcRecParticleCol{
+            "DCRecParticleCollection", Gaudi::DataHandle::Writer, this};
+        DataHandle<edm4hep::MCRecoParticleAssociationCollection>
+            m_dcRecParticleAssociationCol{"DCRecMCRecoParticleAssociationCollection",
+                Gaudi::DataHandle::Writer, this};
+
+        //readout for getting segmentation
+        Gaudi::Property<std::string> m_readout_name{this, "readout",
+            "DriftChamberHitsCollection"};
+
+        Gaudi::Property<int>  m_debug{ this, "debug", false};
+};
+
+#endif
diff --git a/Simulation/DetSimAna/src/Edm4hepWriterAnaElemTool.cpp b/Simulation/DetSimAna/src/Edm4hepWriterAnaElemTool.cpp
index 954664bf21a5897f86285f1380299bf16068df1a..0a266b801be9532b1d51ac35498af790a48f86c8 100644
--- a/Simulation/DetSimAna/src/Edm4hepWriterAnaElemTool.cpp
+++ b/Simulation/DetSimAna/src/Edm4hepWriterAnaElemTool.cpp
@@ -193,6 +193,17 @@ Edm4hepWriterAnaElemTool::EndOfEventAction(const G4Event* anEvent) {
                                     trk_hit->momentum.z()/CLHEP::GeV};
                     edm_trk_hit.setMomentum(edm4hep::Vector3f(mom));
 
+                    // get the truth or contribution
+                    auto& truth = trk_hit->truth;
+                    int trackID = truth.trackID;
+                    
+                    int pritrkid = m_track2primary[trackID];
+                    if (pritrkid <= 0) {
+                        error() << "Failed to find the primary track for trackID #" << trackID << endmsg;
+                        pritrkid = 1;
+                    }
+
+                    edm_trk_hit.setMCParticle(mcCol->at(pritrkid-1));
                 }
 
                 dd4hep::sim::Geant4CalorimeterHit* cal_hit = dynamic_cast<dd4hep::sim::Geant4CalorimeterHit*>(h);
@@ -272,7 +283,38 @@ Edm4hepWriterAnaElemTool::PreUserTrackingAction(const G4Track* track) {
 }
 
 void
-Edm4hepWriterAnaElemTool::PostUserTrackingAction(const G4Track*) {
+Edm4hepWriterAnaElemTool::PostUserTrackingAction(const G4Track* track) {
+    int curtrkid = track->GetTrackID(); // starts from 1
+    int curparid = track->GetParentID();
+
+    if (curparid == 0) {
+        // select the primary tracks (parentID == 0)
+        auto mcCol = m_mcParCol.get();
+
+        if (curtrkid-1>=mcCol->size()) {
+            error() << "out of range: curtrkid is " << curtrkid
+                    << " while the MCParticle size is " << mcCol->size() << endmsg;
+            return;
+        }
+        auto primary_particle = mcCol->at(curtrkid-1);
+
+        const G4ThreeVector& stop_pos  = track->GetPosition();
+        edm4hep::Vector3d endpoint(stop_pos.x()/CLHEP::mm,
+                                   stop_pos.y()/CLHEP::mm,
+                                   stop_pos.z()/CLHEP::mm);
+        primary_particle.setEndpoint(endpoint);
+
+        const G4ThreeVector& stop_mom = track->GetMomentum();
+
+        edm4hep::Vector3f mom_endpoint(stop_mom.x()/CLHEP::GeV,
+                                       stop_mom.y()/CLHEP::GeV,
+                                       stop_mom.z()/CLHEP::GeV);
+        primary_particle.setMomentumAtEndpoint(mom_endpoint);
+
+
+    } else {
+        // TODO: select other interested tracks
+    }
 
 }
 
diff --git a/Simulation/DetSimCore/src/DetSimAlg.cpp b/Simulation/DetSimCore/src/DetSimAlg.cpp
index 17385cf701b1a40ce8370d7c86d17ae8c325e668..31583d82135590f33f4ed712740df02505d8199e 100644
--- a/Simulation/DetSimCore/src/DetSimAlg.cpp
+++ b/Simulation/DetSimCore/src/DetSimAlg.cpp
@@ -10,6 +10,9 @@
 
 #include "DetectorConstruction.h"
 #include "G4PhysListFactory.hh"
+#include "G4EmParameters.hh"
+#include "G4StepLimiterPhysics.hh"
+#include "G4FastSimulationPhysics.hh"
 #include "PrimaryGeneratorAction.h"
 
 #include "ActionInitialization.h"
@@ -42,14 +45,37 @@ DetSimAlg::initialize() {
 
     // Detector Construction
     m_root_detelem = ToolHandle<IDetElemTool>(m_root_det_elem.value());
-    runmgr->SetUserInitialization(new DetectorConstruction(m_root_detelem));
+
+    for (auto fastsimname: m_fast_simnames) {
+        info() << "Fast Sim Tool: " << fastsimname << endmsg;
+        m_fast_simtools.push_back(fastsimname);
+    }
+
+    runmgr->SetUserInitialization(new DetectorConstruction(m_root_detelem, m_fast_simtools));
     // Physics List
     G4VUserPhysicsList *physicsList = nullptr;
     if (m_physics_lists_name.value() == "CEPC") {
 
     } else {
         G4PhysListFactory *physListFactory = new G4PhysListFactory();
-        physicsList = physListFactory->GetReferencePhysList(m_physics_lists_name.value());
+        G4VModularPhysicsList* modularPhysicsList = physListFactory->GetReferencePhysList(m_physics_lists_name.value());
+
+        // PAI model
+        G4EmParameters::Instance()->AddPAIModel("all","DriftChamberRegion","pai");
+        // G4EmParameters::Instance()->AddPAIModel("all","DriftChamberRegion","pai_photon");
+
+        // register addition physics list
+        modularPhysicsList->RegisterPhysics(new G4StepLimiterPhysics());
+
+        // register fastsim physics
+        G4FastSimulationPhysics* fastsim_physics = new G4FastSimulationPhysics();
+        fastsim_physics->BeVerbose();
+        fastsim_physics->ActivateFastSimulation("e-");
+        fastsim_physics->ActivateFastSimulation("e+");
+        fastsim_physics->ActivateFastSimulation("gamma");
+        modularPhysicsList->RegisterPhysics(fastsim_physics);
+
+        physicsList = modularPhysicsList;
     }
     assert(physicsList);
     runmgr->SetUserInitialization(physicsList);
diff --git a/Simulation/DetSimCore/src/DetSimAlg.h b/Simulation/DetSimCore/src/DetSimAlg.h
index 0f66b74ccc89b9dc0d4d65f3bb590914d2ec249a..86754631d96ac78cec77510f1b75ba9bcf55983b 100644
--- a/Simulation/DetSimCore/src/DetSimAlg.h
+++ b/Simulation/DetSimCore/src/DetSimAlg.h
@@ -12,6 +12,7 @@
 #include <DetSimInterface/IG4PrimaryCnvTool.h>
 #include <DetSimInterface/IAnaElemTool.h>
 #include <DetSimInterface/IDetElemTool.h>
+#include <DetSimInterface/IFastSimG4Tool.h>
 
 class DetSimAlg: public Algorithm {
 public:
@@ -24,6 +25,7 @@ public:
 private:
     SmartIF<IDetSimSvc> m_detsimsvc;
     ToolHandleArray<IAnaElemTool> m_anaelemtools;
+    ToolHandleArray<IFastSimG4Tool> m_fast_simtools;
     ToolHandle<IDetElemTool> m_root_detelem;
     ToolHandle<IG4PrimaryCnvTool> m_prim_cnvtool{"G4PrimaryCnvTool", this};
 
@@ -36,6 +38,7 @@ private:
     Gaudi::Property<std::string> m_physics_lists_name{this, "PhysicsList", "QGSP_BERT"};
 
     Gaudi::Property<std::vector<std::string>> m_ana_elems{this, "AnaElems"};
+    Gaudi::Property<std::vector<std::string>> m_fast_simnames{this, "FastSimG4Tools"};
     Gaudi::Property<std::string> m_root_det_elem{this, "RootDetElem"};
 
 
diff --git a/Simulation/DetSimCore/src/DetectorConstruction.cpp b/Simulation/DetSimCore/src/DetectorConstruction.cpp
index 1f06435134761a8c0c14f3f9627396e166eaf51b..fb3bbb131afbbfefa6e1bbb5dfa1cc853f37c1c9 100644
--- a/Simulation/DetSimCore/src/DetectorConstruction.cpp
+++ b/Simulation/DetSimCore/src/DetectorConstruction.cpp
@@ -25,8 +25,9 @@
 #include "G4ios.hh"
 
 
-DetectorConstruction::DetectorConstruction(ToolHandle<IDetElemTool>& root_elem) 
-    : m_root_detelem(root_elem) {
+DetectorConstruction::DetectorConstruction(ToolHandle<IDetElemTool>& root_elem,
+                                           ToolHandleArray<IFastSimG4Tool>& fast_simtools) 
+    : m_root_detelem(root_elem), m_fast_simtools(fast_simtools) {
 
 }
 
@@ -60,6 +61,15 @@ DetectorConstruction::Construct() {
                                                       false,           // no boolean operations
                                                       0);              // no field specific to volume
 
+    // =======================================================================
+    // Associate Fast Simulation Model and Regions
+    // =======================================================================
+    for (auto fastsimtool: m_fast_simtools) {
+        G4cout << "Invoke CreateFastSimulationModel of fastsimtool instance "
+               << m_fast_simtools << G4endl;
+        fastsimtool->CreateFastSimulationModel();
+    }
+
     return physiWorld;
 
 }
diff --git a/Simulation/DetSimCore/src/DetectorConstruction.h b/Simulation/DetSimCore/src/DetectorConstruction.h
index 3e211205f782d3501addbb0ef055cd6383d0dd15..e8d992a30abc0caafe6afdcb75f457f9a66f80f4 100644
--- a/Simulation/DetSimCore/src/DetectorConstruction.h
+++ b/Simulation/DetSimCore/src/DetectorConstruction.h
@@ -3,6 +3,7 @@
 
 #include "GaudiKernel/ToolHandle.h"
 #include "DetSimInterface/IDetElemTool.h"
+#include "DetSimInterface/IFastSimG4Tool.h"
 
 #include "globals.hh"
 #include "G4VUserDetectorConstruction.hh"
@@ -16,7 +17,8 @@
 class DetectorConstruction: public G4VUserDetectorConstruction {
 
 public:
-    DetectorConstruction(ToolHandle<IDetElemTool>& root_elem);
+    DetectorConstruction(ToolHandle<IDetElemTool>& root_elem,
+                         ToolHandleArray<IFastSimG4Tool>& fast_simtools);
     ~DetectorConstruction();
 public:
     G4VPhysicalVolume* Construct() override;
@@ -24,6 +26,7 @@ public:
 
 private:
     ToolHandle<IDetElemTool>& m_root_detelem;
+    ToolHandleArray<IFastSimG4Tool>& m_fast_simtools;
 };
 
 #endif
diff --git a/Simulation/DetSimFastModel/CMakeLists.txt b/Simulation/DetSimFastModel/CMakeLists.txt
new file mode 100644
index 0000000000000000000000000000000000000000..3f968544a0953d2def1653b6d176c4992a65bd7b
--- /dev/null
+++ b/Simulation/DetSimFastModel/CMakeLists.txt
@@ -0,0 +1,24 @@
+gaudi_subdir(DetSimFastModel v0r0)
+
+gaudi_depends_on_subdirs(
+    k4FWCore
+    Simulation/DetSimInterface
+)
+
+find_package(Geant4 REQUIRED ui_all vis_all)
+include(${Geant4_USE_FILE})
+find_package(DD4hep COMPONENTS DDG4 REQUIRED)
+
+set(DetSimFastModel_srcs
+    src/DummyFastSimG4Tool.cpp
+    src/DummyFastSimG4Model.cpp
+)
+
+gaudi_add_module(DetSimFastModel ${DetSimFastModel_srcs}
+    INCLUDE_DIRS
+    LINK_LIBRARIES
+        DD4hep
+        ${DD4hep_COMPONENT_LIBRARIES}
+        GaudiKernel
+)
+
diff --git a/Simulation/DetSimFastModel/src/DummyFastSimG4Model.cpp b/Simulation/DetSimFastModel/src/DummyFastSimG4Model.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..0e7f7da425a2c8af576b2c69e8a8198ada98c03e
--- /dev/null
+++ b/Simulation/DetSimFastModel/src/DummyFastSimG4Model.cpp
@@ -0,0 +1,37 @@
+#include "DummyFastSimG4Model.h"
+
+#include "G4Track.hh"
+#include "G4FastTrack.hh"
+
+DummyFastSimG4Model::DummyFastSimG4Model(G4String aModelName, G4Region* aEnvelope)
+    : G4VFastSimulationModel(aModelName, aEnvelope) {
+
+}
+
+DummyFastSimG4Model::~DummyFastSimG4Model() {
+
+}
+
+G4bool DummyFastSimG4Model::IsApplicable(const G4ParticleDefinition& aParticle) {
+    return aParticle.GetPDGCharge() != 0;
+}
+
+G4bool DummyFastSimG4Model::ModelTrigger(const G4FastTrack& aFastTrack) {
+    // G4cout << __FILE__ << __LINE__ << ": ModelTrigger." << G4endl;
+
+    bool istrigged = false;
+
+    // only select the secondaries
+    const G4Track* track = aFastTrack.GetPrimaryTrack();
+    // secondaries
+    if (track->GetParentID() != 0) {
+        istrigged = true;
+    }
+    return istrigged;
+}
+
+void DummyFastSimG4Model::DoIt(const G4FastTrack& aFastTrack, G4FastStep& aFastStep) {
+    // G4cout << __FILE__ << __LINE__ << ": DoIt." << G4endl;
+
+    aFastStep.ProposeTrackStatus(fStopAndKill);
+}
diff --git a/Simulation/DetSimFastModel/src/DummyFastSimG4Model.h b/Simulation/DetSimFastModel/src/DummyFastSimG4Model.h
new file mode 100644
index 0000000000000000000000000000000000000000..fca5093f8574d8529df72b9e74e0bcbcdcc4414a
--- /dev/null
+++ b/Simulation/DetSimFastModel/src/DummyFastSimG4Model.h
@@ -0,0 +1,19 @@
+#ifndef DummyFastSimG4Model_h
+#define DummyFastSimG4Model_h
+
+#include "G4VFastSimulationModel.hh"
+
+class DummyFastSimG4Model: public G4VFastSimulationModel {
+public:
+
+    DummyFastSimG4Model(G4String aModelName, G4Region* aEnvelope);
+    ~DummyFastSimG4Model();
+
+    virtual G4bool IsApplicable( const G4ParticleDefinition& aParticle );
+    virtual G4bool ModelTrigger( const G4FastTrack& aFastTrack );
+    virtual void DoIt( const G4FastTrack& aFastTrack, G4FastStep& aFastStep );
+
+};
+
+#endif
+
diff --git a/Simulation/DetSimFastModel/src/DummyFastSimG4Tool.cpp b/Simulation/DetSimFastModel/src/DummyFastSimG4Tool.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..47420ae38d180150f29e5ed9f65edfb4ccf1d612
--- /dev/null
+++ b/Simulation/DetSimFastModel/src/DummyFastSimG4Tool.cpp
@@ -0,0 +1,40 @@
+#include "DummyFastSimG4Tool.h"
+
+#include "G4Region.hh"
+#include "G4RegionStore.hh"
+
+#include "G4VFastSimulationModel.hh"
+#include "DummyFastSimG4Model.h"
+
+DECLARE_COMPONENT(DummyFastSimG4Tool);
+
+StatusCode DummyFastSimG4Tool::initialize() {
+    StatusCode sc;
+
+    return sc;
+}
+
+StatusCode DummyFastSimG4Tool::finalize() {
+    StatusCode sc;
+
+    return sc;
+}
+
+bool DummyFastSimG4Tool::CreateFastSimulationModel() {
+    // In this method:
+    // * Retrieve the G4Region
+    // * Create Model
+    // * Associate model and region
+
+    G4String model_name = "DummyFastSimG4Model";
+    G4String region_name = "DriftChamberRegion";
+    G4Region* aEnvelope = G4RegionStore::GetInstance()->GetRegion(region_name);
+    if (!aEnvelope) {
+        error() << "Failed to find G4Region '" << region_name << "'" << endmsg;
+        return false;
+    }
+
+    DummyFastSimG4Model* model = new DummyFastSimG4Model(model_name, aEnvelope);
+    info() << "Create Model " << model_name << " for G4Region " << region_name << endmsg;
+    return true;
+}
diff --git a/Simulation/DetSimFastModel/src/DummyFastSimG4Tool.h b/Simulation/DetSimFastModel/src/DummyFastSimG4Tool.h
new file mode 100644
index 0000000000000000000000000000000000000000..2254d892cacce2110bf5ed61ebf4cde234480acb
--- /dev/null
+++ b/Simulation/DetSimFastModel/src/DummyFastSimG4Tool.h
@@ -0,0 +1,20 @@
+#ifndef DummyFastSimG4Tool_h
+#define DummyFastSimG4Tool_h
+
+#include "GaudiKernel/AlgTool.h"
+#include "DetSimInterface/IFastSimG4Tool.h"
+
+class DummyFastSimG4Tool: public extends<AlgTool, IFastSimG4Tool> {
+public:
+    using extends::extends;
+
+    StatusCode initialize() override;
+    StatusCode finalize() override;
+
+    bool CreateFastSimulationModel() override;
+
+private:
+
+};
+
+#endif
diff --git a/Simulation/DetSimInterface/DetSimInterface/IFastSimG4Tool.h b/Simulation/DetSimInterface/DetSimInterface/IFastSimG4Tool.h
new file mode 100644
index 0000000000000000000000000000000000000000..12d9c421f3a06f1fc4b2637e5284c3373cba471a
--- /dev/null
+++ b/Simulation/DetSimInterface/DetSimInterface/IFastSimG4Tool.h
@@ -0,0 +1,20 @@
+#ifndef IFastSimG4Tool_h
+#define IFastSimG4Tool_h
+
+// IFastSimG4Tool is to associate the G4Region and Fast simulation model in G4.
+// It is recommended to create one fast simulation model in one tool.
+// -- Tao Lin <lintao@ihep.ac.cn>, 7 Dec 2020
+
+#include "GaudiKernel/IAlgTool.h"
+
+class IFastSimG4Tool: virtual public IAlgTool {
+public:
+    DeclareInterfaceID(IFastSimG4Tool, 0, 1);
+
+    virtual ~IFastSimG4Tool() {}
+
+    // Build the association between G4Region and G4 Fast simulation model
+    virtual bool CreateFastSimulationModel() = 0;
+};
+
+#endif