From 333b3de18bea188b297ace0d410640d0f08f53f6 Mon Sep 17 00:00:00 2001
From: Whitney Armstrong <warmstrong@anl.gov>
Date: Wed, 24 Mar 2021 12:03:20 -0500
Subject: [PATCH] 	modified:   compact/ecal.xml 	modified:  
 src/cb_EMCAL.cpp

---
 compact/ecal.xml |  6 +++---
 src/cb_EMCAL.cpp | 11 ++++++-----
 2 files changed, 9 insertions(+), 8 deletions(-)

diff --git a/compact/ecal.xml b/compact/ecal.xml
index 0ab9ced..c6e5f62 100644
--- a/compact/ecal.xml
+++ b/compact/ecal.xml
@@ -32,9 +32,9 @@
       A layered EM calorimeter with tungsten and silicon (or scintillator) strips
     </comment>
     <detector 
-      id="ECalBarrel_ID"
-      name="EcalBarrel"
-      type="DD4hep_EcalBarrel"
+      id="cb_EMCAL_ID"
+      name="cb_EMCAL"
+      type="cb_EMCAL"
       readout="EcalBarrelHits"
       calorimeterType="EM_BARREL">
       <dimensions 
diff --git a/src/cb_EMCAL.cpp b/src/cb_EMCAL.cpp
index d0e0818..6fa2099 100644
--- a/src/cb_EMCAL.cpp
+++ b/src/cb_EMCAL.cpp
@@ -8,20 +8,22 @@ static Ref_t createDetector(Detector& desc, xml_h handle, SensitiveDetector sens
   int             detID   = detElem.id();
 
   xml::Component dims      = detElem.dimensions();
-  double         rInner    = dims.inner_radius();
+  double         RIn    = dims.inner_radius();
   //double         rMin      = dims.rmin();
   double         thickness = dims.thickness();
-  double         rOuter    = thickness + rInner;
+  double         ROut    = thickness + rInner;
   double         innerZ    = dims.inner_z();
+  double         outerZ    = dims.outer_z();
   double         angle     = dims.angle();
 
   Material mat = desc.material(detElem.materialStr());
 
-  std::vector<double> coneROut = {cfg.ROut, cfg.ROut, cfg.ROut, cfg.ROut};
-  std::vector<double> coneRIn  = {cfg.ROut - 1. * cm, cfg.RIn, cfg.RIn, cfg.ROut - 1. * cm};
+  std::vector<double> coneROut = {ROut, ROut, ROut, ROut};
+  std::vector<double> coneRIn  = {ROut - 1. * cm, RIn, RIn, ROut - 1. * cm};
   std::vector<double> coneZ    = {-cfgsolenoid.SizeZ / 2, -cfgsolenoid.SizeZ / 2 + 30 * cm, cfgsolenoid.SizeZ / 2 - 30 * cm, cfgsolenoid.SizeZ / 2};
 
   Polycone cone_solid("cb_EMCAL_GVol_Solid", 0. * deg, 360. * deg, 4, coneZ, rInner, coneROut);
+  Volume           detVol(detName, cone_solid, mat);
   //Logic = new G4LogicalVolume(Solid, worldMaterial, "cb_EMCAL_GVol_Logic");
   //Phys = new G4PVPlacement(0, G4ThreeVector(), "cb_EMCAL_GVol_Phys", Logic, motherVolume, false, 0);
   //
@@ -30,7 +32,6 @@ static Ref_t createDetector(Detector& desc, xml_h handle, SensitiveDetector sens
   //SubtractionSolid unchamferedShape(outerTubeShape, innerTubeShape);
   //Cone             chamferShape(thickness, 0, rMin, 0, rMin + 2 * tan(angle) * thickness);
   //SubtractionSolid detShape(unchamferedShape, chamferShape, Position(0, 0, innerZ + thickness));
-  //Volume           detVol(detName, detShape, mat);
 
   detVol.setVisAttributes(desc.visAttributes(detElem.visStr()));
 
-- 
GitLab