diff --git a/Reconstruction/PFA/Pandora/GaudiPandora/include/PandoraPFAlg.h b/Reconstruction/PFA/Pandora/GaudiPandora/include/PandoraPFAlg.h
index a74b8a77297e8facbbf6aee29c6916d35c0497c8..6a7a1bacfe9a26b462c645215dcc63370707d35a 100644
--- a/Reconstruction/PFA/Pandora/GaudiPandora/include/PandoraPFAlg.h
+++ b/Reconstruction/PFA/Pandora/GaudiPandora/include/PandoraPFAlg.h
@@ -279,6 +279,8 @@ protected:
   NTuple::Array<float> m_mc_charge;
 
 
+  Gaudi::Property<int> m_max_mc {this, "max_mc", 1000,""};
+  Gaudi::Property<int> m_max_rec {this, "max_rec", 1000,""};
 
   
   Gaudi::Property<bool> m_debug {this, "debug", false,"if do debug"};
diff --git a/Reconstruction/PFA/Pandora/GaudiPandora/src/CaloHitCreator.cpp b/Reconstruction/PFA/Pandora/GaudiPandora/src/CaloHitCreator.cpp
index 873ae8c3c7087bd513f6568857f63986d30e5f8c..e3bd6e3c3e9812a2fe75637c9ca3a0782c7b3933 100644
--- a/Reconstruction/PFA/Pandora/GaudiPandora/src/CaloHitCreator.cpp
+++ b/Reconstruction/PFA/Pandora/GaudiPandora/src/CaloHitCreator.cpp
@@ -438,7 +438,8 @@ pandora::StatusCode CaloHitCreator::CreateHCalCaloHits(const CollectionMaps& col
                     PandoraApi::CaloHit::Parameters caloHitParameters;
                     caloHitParameters.m_hitType = pandora::HCAL;
                     caloHitParameters.m_isDigital = false;// if it is DHCAL or AHCAL
-                    caloHitParameters.m_layer = m_settings.m_use_dd4hep_decoder == false ? cellIdDecoder(pCaloHit)[layerCoding.c_str()] : m_decoder->get(pCaloHit->getCellID(), "layer");
+                    caloHitParameters.m_layer = m_settings.m_use_dd4hep_decoder == false ? cellIdDecoder(pCaloHit)[layerCoding.c_str()]+1 : m_decoder->get(pCaloHit->getCellID(), "layer");//from 1 to 40
+                    //std::cout<<"HCAL layer="<<caloHitParameters.m_layer.Get()<<std::endl;
                     caloHitParameters.m_isInOuterSamplingLayer = (this->GetNLayersFromEdge(pCaloHit) <= m_settings.m_nOuterSamplingLayers);
                     this->GetCommonCaloHitProperties(pCaloHit, caloHitParameters);
                     int Stave = 0 ; 
@@ -447,7 +448,20 @@ pandora::StatusCode CaloHitCreator::CreateHCalCaloHits(const CollectionMaps& col
                     }
                     else{
                         Stave = m_decoder->get(pCaloHit->getCellID(), "stave");
-                        Stave = Stave <=2 ? Stave+5 : Stave-3 ;//FIXME , need check!!
+                        Stave = Stave ==0 ? Stave+7 : Stave-1 ;//correct, same with LCIO  
+                        /*
+                                    1                     0
+                                   ****                  ****
+                                2 *    * 0            1 *    * 7
+                                 *      *              *      *
+                                3*      * 7  --->     2*      * 6    
+                                 *      *              *      *
+                                4 *    * 6            3 *    * 5 
+                                   ****                  ****  
+                                    5                     4
+                            
+                            
+                        */
                     }
 
                     float absorberCorrection(1.);
@@ -550,15 +564,26 @@ pandora::StatusCode CaloHitCreator::CreateMuonCaloHits(const CollectionMaps& col
                     PandoraApi::CaloHit::Parameters caloHitParameters;
                     caloHitParameters.m_hitType = pandora::MUON;
                     caloHitParameters.m_layer = m_settings.m_use_dd4hep_decoder == false ? cellIdDecoder(pCaloHit)[layerCoding.c_str()] + 1 : m_decoder->get(pCaloHit->getCellID(), "layer");
+                    //std::cout<<"Muon layer="<<caloHitParameters.m_layer.Get()<<std::endl;
                     caloHitParameters.m_isInOuterSamplingLayer = true;
                     this->GetCommonCaloHitProperties(pCaloHit, caloHitParameters);
                     int Stave = 0 ; 
                     if (m_settings.m_use_dd4hep_decoder == false){
                         Stave = cellIdDecoder(pCaloHit)[ staveCoding];
+                        /*
+                        float tmp_x = pCaloHit->getPosition()[0];
+                        float tmp_y = pCaloHit->getPosition()[1];
+                        float tmp_z = pCaloHit->getPosition()[2];
+                        float tmp_phi = atan(tmp_y/tmp_x)*180/acos(-1);
+                        if(tmp_x<0) tmp_phi += 180;
+                        if(tmp_x>0 && tmp_y<0) tmp_phi += 360;
+                        if(abs(tmp_z) < 2000 )std::cout<<"Muon ILC Stave="<<Stave<<",phi="<<tmp_phi<<std::endl;
+                        */
                     }
                     else{
                         Stave = m_decoder->get(pCaloHit->getCellID(), "stave");
-                        Stave = Stave <=2 ? Stave+5 : Stave-3 ;//FIXME , need check!!
+                        Stave = 12 - Stave ;//correct to be same with LCIO
+                        if(Stave<0) throw("throw wrong stave number?");
                     }
 
                     const float radius(std::sqrt(pCaloHit->getPosition()[0] * pCaloHit->getPosition()[0] +
diff --git a/Reconstruction/PFA/Pandora/GaudiPandora/src/PandoraPFAlg.cpp b/Reconstruction/PFA/Pandora/GaudiPandora/src/PandoraPFAlg.cpp
index eef2087e5025060c000436a0a97968c6ee275ede..18030dbdb33cf0a5f62876fe64e237e550753855 100644
--- a/Reconstruction/PFA/Pandora/GaudiPandora/src/PandoraPFAlg.cpp
+++ b/Reconstruction/PFA/Pandora/GaudiPandora/src/PandoraPFAlg.cpp
@@ -109,8 +109,8 @@ StatusCode PandoraPFAlg::initialize()
       else {
           m_tuple = ntupleSvc()->book( "MyTuples/Pan_reco_evt", CLID_ColumnWiseTuple, "Pan_reco_evt" );
           if ( m_tuple ) {
-            m_tuple->addItem( "N_mc" , m_n_mc , 0, 1000 ).ignore();
-            m_tuple->addItem( "N_rec", m_n_rec, 0, 1000 ).ignore();
+            m_tuple->addItem( "N_mc" , m_n_mc , 0, m_max_mc.value() ).ignore();
+            m_tuple->addItem( "N_rec", m_n_rec, 0, m_max_rec.value()).ignore();
             m_tuple->addItem( "m_pReco_PID"   , m_n_rec, m_pReco_PID    ).ignore();
             m_tuple->addItem( "m_pReco_mass"  , m_n_rec, m_pReco_mass   ).ignore();
             m_tuple->addItem( "m_pReco_energy", m_n_rec, m_pReco_energy ).ignore();
@@ -484,7 +484,9 @@ StatusCode PandoraPFAlg::updateMap()
                     for(unsigned int i=0 ; i< po->size(); i++) m_CollectionMaps->collectionMap_MC [v.first].push_back(po->at(i));
                     debug()<<"saved col name="<<v.first<<endmsg;
                 }
-                debug()<<"don't find col name="<<v.first<<endmsg;
+                else{
+                    debug()<<"don't find col name="<<v.first<<endmsg;
+                }
                 
             }
             else if(m_collections[v.first]=="CalorimeterHit"){
@@ -496,7 +498,9 @@ StatusCode PandoraPFAlg::updateMap()
                     for(unsigned int i=0 ; i< po->size(); i++) m_CollectionMaps->collectionMap_CaloHit [v.first].push_back(po->at(i));
                     debug()<<"saved col name="<<v.first<<endmsg;
                 }
-                debug()<<"don't find col name="<<v.first<<endmsg;
+                else{
+                    debug()<<"don't find col name="<<v.first<<endmsg;
+                }
                 
             }
             else if(m_collections[v.first]=="Track"){
@@ -509,7 +513,9 @@ StatusCode PandoraPFAlg::updateMap()
                     debug() <<"saved col name="<<v.first<<endmsg;
                     m_marlinTrack = po->size();
                 }
-                debug() <<"don't find col name="<<v.first<<endmsg;
+                else{
+                    debug()<<"don't find col name="<<v.first<<endmsg;
+                }
                 
             }
             else if(m_collections[v.first]=="Vertex"){
@@ -521,7 +527,9 @@ StatusCode PandoraPFAlg::updateMap()
                     for(unsigned int i=0 ; i< po->size(); i++) m_CollectionMaps->collectionMap_Vertex [v.first].push_back(po->at(i));
                     debug() <<"saved col name="<<v.first<<endmsg;
                 }
-                debug() <<"don't find col name="<<v.first<<endmsg;
+                else{
+                    debug()<<"don't find col name="<<v.first<<endmsg;
+                }
                 
             }
             else if(m_collections[v.first]=="MCRecoCaloAssociation"){
@@ -533,7 +541,9 @@ StatusCode PandoraPFAlg::updateMap()
                     for(unsigned int i=0 ; i< po->size(); i++) m_CollectionMaps->collectionMap_CaloRel [v.first].push_back(po->at(i));
                     debug() <<"saved col name="<<v.first<<endmsg;
                 }
-                debug() <<"don't find col name="<<v.first<<endmsg;
+                else{
+                    debug()<<"don't find col name="<<v.first<<endmsg;
+                }
                 
             }
             else if(m_collections[v.first]=="MCRecoTrackerAssociation"){
@@ -545,7 +555,9 @@ StatusCode PandoraPFAlg::updateMap()
                     for(unsigned int i=0 ; i< po->size(); i++) m_CollectionMaps->collectionMap_TrkRel [v.first].push_back(po->at(i));
                     debug() <<"saved col name="<<v.first<<endmsg;
                 }
-                debug() <<"don't find col name="<<v.first<<endmsg;
+                else{
+                    debug()<<"don't find col name="<<v.first<<endmsg;
+                }
                 
             }
             else{
@@ -571,6 +583,7 @@ StatusCode PandoraPFAlg::Ana()
     const edm4hep::MCRecoParticleAssociationCollection* reco_associa_col = m_MCRecoParticleAssociation_w.get();
     for(int i=0; i<reco_col->size();i++)
     {
+        if( m_n_rec >= m_max_rec) break;
         const edm4hep::ReconstructedParticle pReco = reco_col->at(i);
         const float px = pReco.getMomentum()[0];
         const float py = pReco.getMomentum()[1];
@@ -600,6 +613,8 @@ StatusCode PandoraPFAlg::Ana()
     { 
         for(unsigned int i=0 ; i< MCParticle->size(); i++)
         {
+            if( m_n_mc >= m_max_mc) break;
+            if( MCParticle->at(i).parents_size() !=0 ) continue;// only save primary
             m_mc_p_size[m_n_mc] = MCParticle->at(i).parents_size();
             m_mc_pid   [m_n_mc] = MCParticle->at(i).getPDG();
             m_mc_mass  [m_n_mc] = MCParticle->at(i).getMass();
@@ -608,7 +623,7 @@ StatusCode PandoraPFAlg::Ana()
             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]);
-            debug() <<"mc type="<<MCParticle->at(i).getPDG()<<",energy="<<mc_E<<endmsg;
+            //debug() <<"mc type="<<MCParticle->at(i).getPDG()<<",energy="<<mc_E<<",m_mc_p_size="<<m_mc_p_size->size()<<endmsg;
             m_n_mc ++ ;
             if (MCParticle->at(i).getPDG() != 22) continue;
             int hasEm = 0;