From ca24e1df5375707b0dfb2f9ddc1563620b7b0609 Mon Sep 17 00:00:00 2001
From: myliu <201916234@mail.sdu.edu.cn>
Date: Tue, 29 Jun 2021 16:53:21 +0800
Subject: [PATCH] check doca

---
 Digitisers/DCHDigi/src/DCHDigiAlg.cpp         | 13 +++++-----
 Digitisers/DCHDigi/src/DCHDigiAlg.h           |  6 ++---
 Reconstruction/RecGenfitAlg/CMakeLists.txt    |  2 --
 .../RecGenfitAlg/src/RecGenfitAlgDC.cpp       | 26 +++++++++----------
 4 files changed, 22 insertions(+), 25 deletions(-)

diff --git a/Digitisers/DCHDigi/src/DCHDigiAlg.cpp b/Digitisers/DCHDigi/src/DCHDigiAlg.cpp
index cc80f325..01fb9406 100644
--- a/Digitisers/DCHDigi/src/DCHDigiAlg.cpp
+++ b/Digitisers/DCHDigi/src/DCHDigiAlg.cpp
@@ -28,15 +28,15 @@ DCHDigiAlg::DCHDigiAlg(const std::string& name, ISvcLocator* svcLoc)
   : GaudiAlgorithm(name, svcLoc),
     _nEvt(0)
 {
-  
+
   // Input collections
   declareProperty("SimDCHitCollection", r_SimDCHCol, "Handle of the Input SimHit collection");
-  
+
   // Output collections
   declareProperty("DigiDCHitCollection", w_DigiDCHCol, "Handle of Digi DCHit collection");
-  
+
   declareProperty("AssociationCollection", w_AssociationCol, "Handle of Association collection");
-   
+
 }
 
 StatusCode DCHDigiAlg::initialize()
@@ -54,7 +54,6 @@ StatusCode DCHDigiAlg::initialize()
   }
 
   if(m_WriteAna){
-
       NTuplePtr nt( ntupleSvc(), "MyTuples/DCH_digi_evt" );
       if ( nt ) m_tuple = nt;
       else {
@@ -105,8 +104,8 @@ StatusCode DCHDigiAlg::execute()
       unsigned long long id = SimHit.getCellID();
       float sim_hit_mom = sqrt( SimHit.getMomentum()[0]*SimHit.getMomentum()[0] + SimHit.getMomentum()[1]*SimHit.getMomentum()[1] + SimHit.getMomentum()[2]*SimHit.getMomentum()[2] );//GeV
       if(sim_hit_mom < m_mom_threshold) continue; 
-      if(SimHit.getEDep() <= 0) continue; 
-      
+      if(SimHit.getEDep() <= 0) continue;
+
       if ( id_hits_map.find(id) != id_hits_map.end()) id_hits_map[id].push_back(SimHit);
       else 
       {
diff --git a/Digitisers/DCHDigi/src/DCHDigiAlg.h b/Digitisers/DCHDigi/src/DCHDigiAlg.h
index 178f5518..d6a82961 100644
--- a/Digitisers/DCHDigi/src/DCHDigiAlg.h
+++ b/Digitisers/DCHDigi/src/DCHDigiAlg.h
@@ -69,9 +69,9 @@ protected:
   dd4hep::rec::CellIDPositionConverter* m_cellIDConverter;
   dd4hep::DDSegmentation::GridDriftChamber* m_segmentation;
   dd4hep::DDSegmentation::BitFieldCoder* m_decoder;
-  
+
   Gaudi::Property<std::string> m_readout_name{ this, "readout", "DriftChamberHitsCollection"};//readout for getting segmentation
- 
+
   Gaudi::Property<float> m_res_x     { this, "res_x", 0.11};//mm
   Gaudi::Property<float> m_res_y     { this, "res_y", 0.11};//mm
   Gaudi::Property<float> m_res_z     { this, "res_z", 1   };//mm
@@ -86,6 +86,6 @@ protected:
   // Output collections
   DataHandle<edm4hep::TrackerHitCollection>    w_DigiDCHCol{"DigiDCHitCollection", Gaudi::DataHandle::Writer, this};
   DataHandle<edm4hep::MCRecoTrackerAssociationCollection>    w_AssociationCol{"DCHitAssociationCollection", Gaudi::DataHandle::Writer, this};
-};
 
+};
 #endif
diff --git a/Reconstruction/RecGenfitAlg/CMakeLists.txt b/Reconstruction/RecGenfitAlg/CMakeLists.txt
index 7a36d353..86615603 100644
--- a/Reconstruction/RecGenfitAlg/CMakeLists.txt
+++ b/Reconstruction/RecGenfitAlg/CMakeLists.txt
@@ -3,8 +3,6 @@
 if (GenFit_FOUND)
 gaudi_add_module(RecGenfitAlg
         SOURCES src/RecGenfitAlgDC.cpp
-                src/DCHDigiSMAlg.cpp
-                src/DumpTrackAlg.cpp
                 src/GenfitTrack.cpp
                 src/GenfitField.cpp
                 src/GenfitFitter.cpp
diff --git a/Reconstruction/RecGenfitAlg/src/RecGenfitAlgDC.cpp b/Reconstruction/RecGenfitAlg/src/RecGenfitAlgDC.cpp
index cef756ad..0e93b89c 100644
--- a/Reconstruction/RecGenfitAlg/src/RecGenfitAlgDC.cpp
+++ b/Reconstruction/RecGenfitAlg/src/RecGenfitAlgDC.cpp
@@ -382,20 +382,21 @@ void RecGenfitAlgDC::debugEvent()
     mcParticleCol=m_mcParticleCol.get();
     simDCHitCol=m_simDCHitCol.get();
     m_nSimDCHit=simDCHitCol->size();
-    int iMcParticle=0;
     int iHit=0;
+    for(auto simDCHit: *simDCHitCol){
+        edm4hep::Vector3d pos=simDCHit.position();
+        TVectorD p(3);
+        p[0]=pos.x;//no unit conversion here
+        p[1]=pos.y;
+        p[2]=pos.z;
+        m_mdcHitMcX[iHit]=pos.x;
+        m_mdcHitMcY[iHit]=pos.y;
+        m_mdcHitMcZ[iHit]=pos.z;
+        iHit++;
+    }
+    m_mcIndex=iHit;
+    int iMcParticle=0;
     for(auto mcParticle : *mcParticleCol){
-        for(auto simDCHit: *simDCHitCol){
-            edm4hep::Vector3d pos=simDCHit.position();
-            TVectorD p(3);
-            p[0]=pos.x;//no unit conversion here
-            p[1]=pos.y;
-            p[2]=pos.z;
-            m_mdcHitMcX[iHit]=pos.x;
-            m_mdcHitMcY[iHit]=pos.y;
-            m_mdcHitMcZ[iHit]=pos.z;
-            iHit++;
-        }
         edm4hep::Vector3f mcPocaMom = mcParticle.getMomentum();//GeV
         float px=mcPocaMom.x;
         float py=mcPocaMom.y;
@@ -404,6 +405,5 @@ void RecGenfitAlgDC::debugEvent()
         m_pocaMomMcP[iMcParticle]=sqrt(px*px+py*py+pz*pz);
         iMcParticle++;
     }
-    m_mcIndex=iHit;
 
 }
-- 
GitLab