From a3c5f2ece045c1369404ace2bab7e0dadc37dc5b Mon Sep 17 00:00:00 2001
From: Chengdong Fu <fucd@ihep.ac.cn>
Date: Sun, 27 Mar 2022 22:35:04 +0800
Subject: [PATCH] initialize variable

---
 Service/GearSvc/src/GearSvc.cpp | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/Service/GearSvc/src/GearSvc.cpp b/Service/GearSvc/src/GearSvc.cpp
index e793bdbe..81c3611f 100644
--- a/Service/GearSvc/src/GearSvc.cpp
+++ b/Service/GearSvc/src/GearSvc.cpp
@@ -206,9 +206,9 @@ StatusCode GearSvc::convertVXD(dd4hep::DetElement& vxd){
   double phi0=0;
   helpLayer thisLadder;
   double beryllium_ladder_block_length=0,end_electronics_half_z=0,side_band_electronics_width=0;
-  double rAlu=0, drAlu, rSty, drSty, dzSty, rInner, aluEndcapZ, aluHalfZ, alu_RadLen, Cryostat_dEdx;
-  double VXDSupportDensity, VXDSupportZeff, VXDSupportAeff, VXDSupportRadLen, VXDSupportIntLen=0;
-  double styDensity, styZeff, styAeff, styRadLen, styIntLen; 
+  double rAlu=0, drAlu=0, rSty=0, drSty=0, dzSty=0, rInner=0, aluEndcapZ=0, aluHalfZ=0, alu_RadLen=0, Cryostat_dEdx=0;
+  double VXDSupportDensity=0, VXDSupportZeff=0, VXDSupportAeff=0, VXDSupportRadLen=0, VXDSupportIntLen=0;
+  double styDensity=0, styZeff=0, styAeff=0, styRadLen=0, styIntLen=0; 
   dd4hep::Volume vxd_vol = vxd.volume();
   for(int i=0;i<vxd_vol->GetNdaughters();i++){
     TGeoNode* daughter = vxd_vol->GetNode(i);
@@ -402,11 +402,11 @@ StatusCode GearSvc::convertVXD(dd4hep::DetElement& vxd){
 
       int nFlexCable = 0, nFoamSpacer=0, nMetalTraces=0;
       int currentLayer = -1;
-      double tFlexCable, tFoamSpacer, tMetalTraces;
-      double radLFlexCable, radLFoamSpacer, radLMetalTraces;
-      double intLFlexCable, intLFoamSpacer, intLMetalTraces;
-      double dFlexCable, dFoamSpacer, dMetalTraces;
-      double metalZeff, metalZAeff, foamZeff, foamZAeff, flexZeff, flexZAeff;
+      double tFlexCable=0, tFoamSpacer=0, tMetalTraces=0;
+      double radLFlexCable=0, radLFoamSpacer=0, radLMetalTraces=0;
+      double intLFlexCable=0, intLFoamSpacer=0, intLMetalTraces=0;
+      double dFlexCable=0, dFoamSpacer=0, dMetalTraces=0;
+      double metalZeff=0, metalZAeff=0, foamZeff=0, foamZAeff=0, flexZeff=0, flexZAeff=0;
       for(int i=0;i<vol->GetNdaughters();i++){
 	TGeoNode* daughter = vol->GetNode(i);
         TGeoMaterial* matDaughter = daughter->GetMedium()->GetMaterial();
-- 
GitLab