diff --git a/Reconstruction/PFA/Pandora/GaudiPandora/CMakeLists.txt b/Reconstruction/PFA/Pandora/GaudiPandora/CMakeLists.txt
index 3842a7aaf8e49e03f6a91de2a98ff5c24b66f71b..c01c5ecfb917e6978d4d868e5a4d1b4d130bddf1 100644
--- a/Reconstruction/PFA/Pandora/GaudiPandora/CMakeLists.txt
+++ b/Reconstruction/PFA/Pandora/GaudiPandora/CMakeLists.txt
@@ -3,6 +3,7 @@ gaudi_subdir(GaudiPandora v0r0)
 find_package(LCIO REQUIRED ) 
 find_package(DD4hep COMPONENTS DDG4 REQUIRED)
 find_package(GEAR REQUIRED)
+find_package(CLHEP REQUIRED;CONFIG)
 message("ENV GEAR: $ENV{GEAR}")
 
 find_package(EDM4HEP REQUIRED )
diff --git a/Reconstruction/PFA/Pandora/GaudiPandora/include/PandoraPFAlg.h b/Reconstruction/PFA/Pandora/GaudiPandora/include/PandoraPFAlg.h
index c3c2599e7d518082db1d1981f388341bef069e26..3f029fe3be8c8031d22eebc7eec3e237cfd747ed 100644
--- a/Reconstruction/PFA/Pandora/GaudiPandora/include/PandoraPFAlg.h
+++ b/Reconstruction/PFA/Pandora/GaudiPandora/include/PandoraPFAlg.h
@@ -276,7 +276,7 @@ protected:
   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"};
   Gaudi::Property<bool> m_use_preshower {this, "use_preshower", false,"if use preshower layer for calorimeter"};
-  Gaudi::Property< std::string >              m_AnaOutput{ this, "AnaOutput", "/junofs/users/wxfang/MyGit/CEPCSW/Reconstruction/PFA/Pandora/GaudiPandora/Ana.root" };
+  Gaudi::Property< std::string >              m_AnaOutput{ this, "AnaOutput", "Pan_Ana.root" };
   //######################
   std::map< std::string, std::string > m_collections;
   Gaudi::Property<std::vector<std::string>> m_readCols{this, "collections", {}, "Places of collections to read"};
diff --git a/Reconstruction/PFA/Pandora/GaudiPandora/include/Utility.h b/Reconstruction/PFA/Pandora/GaudiPandora/include/Utility.h
index 07ae48091b2be4ea02d2bd79b547afdf9f3f0912..b29092bf53c2496149d1e304f2bae19377c113be 100644
--- a/Reconstruction/PFA/Pandora/GaudiPandora/include/Utility.h
+++ b/Reconstruction/PFA/Pandora/GaudiPandora/include/Utility.h
@@ -1,5 +1,5 @@
-#ifndef MYUTILITY
-#define MYUTILITY 1
+#ifndef PanUTIL
+#define PanUTIL 1
 
 #include <sstream>
 #include "DD4hep/Detector.h"
@@ -7,12 +7,14 @@
 #include "DD4hep/DetType.h"
 #include "DDRec/DetectorData.h"
 #include "DD4hep/DetectorSelector.h"
-std::string Convert (float number);
-dd4hep::rec::LayeredCalorimeterData * getExtension(unsigned int includeFlag, unsigned int excludeFlag) ;
-void line_a_b(float x1, float y1, float x2, float y2, float& a, float& b);
-float getPhi(float x, float y);
-int partition(float x, float y);
-int getLayer(float x, float y, float z, std::vector<float>& layers);
-int getLayer_v1(float x, float y, float z, std::vector<float>& layers);
-int getStave(float x, float y);
+namespace PanUtil{
+    std::string Convert (float number);
+    dd4hep::rec::LayeredCalorimeterData * getExtension(unsigned int includeFlag, unsigned int excludeFlag) ;
+    void line_a_b(float x1, float y1, float x2, float y2, float& a, float& b);
+    float getPhi(float x, float y);
+    int partition(float x, float y);
+    int getLayer(float x, float y, float z, std::vector<float>& layers);
+    int getLayer_v1(float x, float y, float z, std::vector<float>& layers);
+    int getStave(float x, float y);
+}
 #endif
diff --git a/Reconstruction/PFA/Pandora/GaudiPandora/src/CaloHitCreator.cpp b/Reconstruction/PFA/Pandora/GaudiPandora/src/CaloHitCreator.cpp
index 02009a5bdc83e9930e4f7b3642ddcdded49b300b..818f78bf87f4b3a768799b6e3bf51511c68fd645 100644
--- a/Reconstruction/PFA/Pandora/GaudiPandora/src/CaloHitCreator.cpp
+++ b/Reconstruction/PFA/Pandora/GaudiPandora/src/CaloHitCreator.cpp
@@ -52,7 +52,7 @@ CaloHitCreator::CaloHitCreator(const Settings &settings, const pandora::Pandora
     if(m_settings.m_use_dd4hep_geo){
         sc = svcloc->service("GeomSvc", m_geosvc, false);
         if (!sc) throw "Failed to find GeomSvc.";
-        const dd4hep::rec::LayeredCalorimeterData * eCalBarrelExtension= getExtension( ( dd4hep::DetType::CALORIMETER | dd4hep::DetType::ELECTROMAGNETIC | dd4hep::DetType::BARREL),
+        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;
         m_eCalBarrelInnerPhi0     = eCalBarrelExtension->inner_phi0/dd4hep::rad;
@@ -211,7 +211,7 @@ pandora::StatusCode CaloHitCreator::CreateECalCaloHits(const CollectionMaps& col
                     if (std::fabs(pCaloHit->getPosition()[2]) < m_eCalBarrelOuterZ)
                     {
                         if(m_settings.m_use_dd4hep_geo){
-                            const std::vector<dd4hep::rec::LayeredCalorimeterStruct::Layer>& barrelLayers= getExtension( ( dd4hep::DetType::CALORIMETER | dd4hep::DetType::ELECTROMAGNETIC | dd4hep::DetType::BARREL), ( dd4hep::DetType::AUXILIARY  |  dd4hep::DetType::FORWARD ) )->layers;
+                            const std::vector<dd4hep::rec::LayeredCalorimeterStruct::Layer>& barrelLayers= PanUtil::getExtension( ( dd4hep::DetType::CALORIMETER | dd4hep::DetType::ELECTROMAGNETIC | dd4hep::DetType::BARREL), ( dd4hep::DetType::AUXILIARY  |  dd4hep::DetType::FORWARD ) )->layers;
                             this->GetBarrelCaloHitProperties(pCaloHit, barrelLayers, m_eCalBarrelInnerSymmetry, m_eCalBarrelInnerPhi0,
                             Stave, caloHitParameters, absorberCorrection);
                         }
@@ -225,7 +225,7 @@ pandora::StatusCode CaloHitCreator::CreateECalCaloHits(const CollectionMaps& col
                     else
                     {
                         if(m_settings.m_use_dd4hep_geo){
-                            const std::vector<dd4hep::rec::LayeredCalorimeterStruct::Layer>& endcapLayers= getExtension( ( dd4hep::DetType::CALORIMETER | dd4hep::DetType::ELECTROMAGNETIC | dd4hep::DetType::ENDCAP), ( dd4hep::DetType::AUXILIARY  |  dd4hep::DetType::FORWARD ) )->layers;
+                            const std::vector<dd4hep::rec::LayeredCalorimeterStruct::Layer>& endcapLayers= PanUtil::getExtension( ( dd4hep::DetType::CALORIMETER | dd4hep::DetType::ELECTROMAGNETIC | dd4hep::DetType::ENDCAP), ( dd4hep::DetType::AUXILIARY  |  dd4hep::DetType::FORWARD ) )->layers;
                             this->GetEndCapCaloHitProperties(pCaloHit, endcapLayers, caloHitParameters, absorberCorrection);
                         }
                         else{
diff --git a/Reconstruction/PFA/Pandora/GaudiPandora/src/GeometryCreator.cpp b/Reconstruction/PFA/Pandora/GaudiPandora/src/GeometryCreator.cpp
index 4c3bcb3673d6c531060de032c9f9b943f12ede30..890c0f8b2bb658aa7c506701385f1c2e901fa2bd 100644
--- a/Reconstruction/PFA/Pandora/GaudiPandora/src/GeometryCreator.cpp
+++ b/Reconstruction/PFA/Pandora/GaudiPandora/src/GeometryCreator.cpp
@@ -76,8 +76,8 @@ void GeometryCreator::SetMandatorySubDetectorParameters(SubDetectorTypeMap &subD
         muonBarrelParameters, muonEndCapParameters;
     if(m_settings.m_use_dd4hep_geo){
         std::cout << "Use dd4hep geo info for ECAL" << std::endl;
-        this->SetDefaultSubDetectorParameters(*const_cast<dd4hep::rec::LayeredCalorimeterData*>(getExtension( ( dd4hep::DetType::CALORIMETER | dd4hep::DetType::ELECTROMAGNETIC | dd4hep::DetType::BARREL), ( dd4hep::DetType::AUXILIARY  |  dd4hep::DetType::FORWARD ) )), "ECalBarrel", pandora::ECAL_BARREL, eCalBarrelParameters);
-        this->SetDefaultSubDetectorParameters(*const_cast<dd4hep::rec::LayeredCalorimeterData*>(getExtension( ( dd4hep::DetType::CALORIMETER | dd4hep::DetType::ELECTROMAGNETIC | dd4hep::DetType::ENDCAP), ( dd4hep::DetType::AUXILIARY  |  dd4hep::DetType::FORWARD ) )), "ECalEndCap", pandora::ECAL_ENDCAP, eCalEndCapParameters);
+        this->SetDefaultSubDetectorParameters(*const_cast<dd4hep::rec::LayeredCalorimeterData*>(PanUtil::getExtension( ( dd4hep::DetType::CALORIMETER | dd4hep::DetType::ELECTROMAGNETIC | dd4hep::DetType::BARREL), ( dd4hep::DetType::AUXILIARY  |  dd4hep::DetType::FORWARD ) )), "ECalBarrel", pandora::ECAL_BARREL, eCalBarrelParameters);
+        this->SetDefaultSubDetectorParameters(*const_cast<dd4hep::rec::LayeredCalorimeterData*>(PanUtil::getExtension( ( dd4hep::DetType::CALORIMETER | dd4hep::DetType::ELECTROMAGNETIC | dd4hep::DetType::ENDCAP), ( dd4hep::DetType::AUXILIARY  |  dd4hep::DetType::FORWARD ) )), "ECalEndCap", pandora::ECAL_ENDCAP, eCalEndCapParameters);
     }
     else{
         this->SetDefaultSubDetectorParameters(_GEAR->getEcalBarrelParameters(), "ECalBarrel", pandora::ECAL_BARREL, eCalBarrelParameters);
diff --git a/Reconstruction/PFA/Pandora/GaudiPandora/src/TrackCreator.cpp b/Reconstruction/PFA/Pandora/GaudiPandora/src/TrackCreator.cpp
index c2c0757fd3f9df1c0eb1684d73a07c41a2d3430c..6bf803ec4f07c15445faa1c9d57ce58fa000a4f0 100644
--- a/Reconstruction/PFA/Pandora/GaudiPandora/src/TrackCreator.cpp
+++ b/Reconstruction/PFA/Pandora/GaudiPandora/src/TrackCreator.cpp
@@ -57,9 +57,9 @@ TrackCreator::TrackCreator(const Settings &settings, const pandora::Pandora *con
     m_tpcZmax                 = (_GEAR->getTPCParameters().getMaxDriftLength());
     // fg: FTD description in GEAR has changed ...
     if(m_settings.m_use_dd4hep_geo){
-        const dd4hep::rec::LayeredCalorimeterData * eCalBarrelExtension= getExtension( ( dd4hep::DetType::CALORIMETER | dd4hep::DetType::ELECTROMAGNETIC | dd4hep::DetType::BARREL),
+        const dd4hep::rec::LayeredCalorimeterData * eCalBarrelExtension= PanUtil::getExtension( ( dd4hep::DetType::CALORIMETER | dd4hep::DetType::ELECTROMAGNETIC | dd4hep::DetType::BARREL),
             									     ( dd4hep::DetType::AUXILIARY  |  dd4hep::DetType::FORWARD ) );
-        const dd4hep::rec::LayeredCalorimeterData * eCalEndcapExtension= getExtension( ( dd4hep::DetType::CALORIMETER | dd4hep::DetType::ELECTROMAGNETIC | dd4hep::DetType::ENDCAP),
+        const dd4hep::rec::LayeredCalorimeterData * eCalEndcapExtension= PanUtil::getExtension( ( dd4hep::DetType::CALORIMETER | dd4hep::DetType::ELECTROMAGNETIC | dd4hep::DetType::ENDCAP),
             									     ( dd4hep::DetType::AUXILIARY |  dd4hep::DetType::FORWARD  ) );
         m_eCalBarrelInnerPhi0     = eCalBarrelExtension->inner_phi0/dd4hep::rad;
         m_eCalBarrelInnerSymmetry = eCalBarrelExtension->inner_symmetry;
diff --git a/Reconstruction/PFA/Pandora/GaudiPandora/src/Utility.cpp b/Reconstruction/PFA/Pandora/GaudiPandora/src/Utility.cpp
index 697681ff616c9f9cbaecaf95a38c52b9e4aeaa0c..179cd6e6a31e835ef5c5783f0bb1178346f1073a 100644
--- a/Reconstruction/PFA/Pandora/GaudiPandora/src/Utility.cpp
+++ b/Reconstruction/PFA/Pandora/GaudiPandora/src/Utility.cpp
@@ -1,11 +1,11 @@
 #include "Utility.h"
 
-std::string Convert (float number){
+std::string PanUtil::Convert (float number){
     std::ostringstream buff;
     buff<<number;
     return buff.str();   
 }
-dd4hep::rec::LayeredCalorimeterData * getExtension(unsigned int includeFlag, unsigned int excludeFlag=0) {
+dd4hep::rec::LayeredCalorimeterData * PanUtil::getExtension(unsigned int includeFlag, unsigned int excludeFlag=0) {
   
   
   dd4hep::rec::LayeredCalorimeterData * theExtension = 0;
@@ -34,7 +34,7 @@ dd4hep::rec::LayeredCalorimeterData * getExtension(unsigned int includeFlag, uns
 }
 
 
-int partition(float x, float y)
+int PanUtil::partition(float x, float y)
 {
     float a1, b1, a2, b2 ;
     if (x>1850 && x < 2020){
@@ -80,13 +80,13 @@ int partition(float x, float y)
     return -1;
 }
 
-void line_a_b(float x1, float y1, float x2, float y2, float& a, float& b)
+void PanUtil::line_a_b(float x1, float y1, float x2, float y2, float& a, float& b)
 {
     a = (y2-y1)/(x1*y2-x2*y1);
     b = (x1-x2)/(x1*y2-x2*y1);
 }
 
-float getPhi(float x, float y)
+float PanUtil::getPhi(float x, float y)
 {
     if     (x==0 && y>0) return 90;
     else if(x==0 && y<0) return 270;
@@ -97,14 +97,14 @@ float getPhi(float x, float y)
     return phi;
 }
 
-int getStave(float x, float y){
+int PanUtil::getStave(float x, float y){
 
 int part = partition(x, y);
 int Stave = part>=3 ? (part-2) : (part+6);// correct S is from 1 to 8, S-1 is from 0-7 
 return Stave-1;
 }
 
-int getLayer(float x, float y, float z, std::vector<float>& layers){
+int PanUtil::getLayer(float x, float y, float z, std::vector<float>& layers){
 if(abs(z) < 2400){
     float phi = getPhi(x, y);
     int part = partition(x, y);
@@ -130,7 +130,7 @@ else{
 return -1;
 }
 
-int getLayer_v1(float x, float y, float z, std::vector<float>& layers){
+int PanUtil::getLayer_v1(float x, float y, float z, std::vector<float>& layers){
 if(abs(z) < 2400){
     float phi = getPhi(x, y);
     int part = partition(x, y);