From 580f79d3e16a4bf1fd46ff3578af392bfe3a1255 Mon Sep 17 00:00:00 2001
From: Dave Casper <dcasper@uci.edu>
Date: Thu, 12 May 2022 00:32:31 -0700
Subject: [PATCH] Clean-up and fine-tuning

---
 .../GeoModel/FaserGeoModel/data/geomDB.sql         |  2 +-
 .../src/DecodeFaserVersionKey.cxx                  | 14 --------------
 .../VetoNuGeoModel/src/VetoNuDetectorFactory.cxx   |  8 ++++----
 .../G4FaserTools/python/G4FieldConfigNew.py        |  6 +++---
 4 files changed, 8 insertions(+), 22 deletions(-)

diff --git a/DetectorDescription/GeoModel/FaserGeoModel/data/geomDB.sql b/DetectorDescription/GeoModel/FaserGeoModel/data/geomDB.sql
index 11cc87563..1c2cb41f0 100644
--- a/DetectorDescription/GeoModel/FaserGeoModel/data/geomDB.sql
+++ b/DetectorDescription/GeoModel/FaserGeoModel/data/geomDB.sql
@@ -2379,7 +2379,7 @@ INSERT INTO "VETORADIATORGENERAL_DATA" VALUES (0, 400.0, 350.0, 100.0, "std::Lea
 INSERT INTO "VETORADIATORGENERAL_DATA2TAG" VALUES (107810, 0);
 --
 --
-INSERT INTO "VETONUTOPLEVEL_DATA" VALUES (0, 10.0, -21.0, -3115.0, 0.0, 0.0, 0.0, 321, "VetoNu");
+INSERT INTO "VETONUTOPLEVEL_DATA" VALUES (0, 10.0, -21.0, -3112.0, 0.0, 0.0, 0.0, 321, "VetoNu");
 INSERT INTO "VETONUTOPLEVEL_DATA" VALUES (1, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 321, "StationA");
 INSERT INTO "VETONUTOPLEVEL_DATA2TAG" VALUES (107845, 0);
 INSERT INTO "VETONUTOPLEVEL_DATA2TAG" VALUES (107845, 1);
diff --git a/DetectorDescription/GeoModel/GeoModelFaserUtilities/src/DecodeFaserVersionKey.cxx b/DetectorDescription/GeoModel/GeoModelFaserUtilities/src/DecodeFaserVersionKey.cxx
index e6ac208bc..d2d4e1b9b 100644
--- a/DetectorDescription/GeoModel/GeoModelFaserUtilities/src/DecodeFaserVersionKey.cxx
+++ b/DetectorDescription/GeoModel/GeoModelFaserUtilities/src/DecodeFaserVersionKey.cxx
@@ -37,7 +37,6 @@ void DecodeFaserVersionKey::defineTag(const T* svc, const std::string & node)
   std::string trackerOverrideTag;
   std::string caloOverrideTag;
   std::string neutrinoOverrideTag;
-  std::cout << "node = " << node << " version = " << svc->faserVersion() << std::endl;
   if (node == "FASER") {
     nodeOverrideTag = "";
   } else if (node == "Neutrino") {
@@ -68,24 +67,16 @@ void DecodeFaserVersionKey::defineTag(const T* svc, const std::string & node)
     nodeOverrideTag = svc->dipoleVersionOverride();
     trackerOverrideTag = svc->trackerVersionOverride();
   } else if (node == "Calorimeter") {
-    std::cout << "calling caloVersionOverride()" << std::endl;
     const T* service = dynamic_cast<const T*>(svc);
-    std::cout << (service == nullptr ? " service is null" : "service is ok") << std::endl;
     nodeOverrideTag  = svc->caloVersionOverride();
-    std::cout << "nodeOverrideTag: " << nodeOverrideTag << std::endl;
   } else if (node == "Ecal") {
-    std::cout << "calling caloVersionOverride()" << std::endl;
     const T* service = dynamic_cast<const T*>(svc);
-    std::cout << (service == nullptr ? " service is null" : "service is ok") << std::endl;
     caloOverrideTag = svc->caloVersionOverride();
-    std::cout << "caloOverrideTag: " << caloOverrideTag << std::endl;
     nodeOverrideTag = svc->ecalVersionOverride();
-    std::cout << "nodeOverrideTag: " << nodeOverrideTag << std::endl;
   } else {
     std::cout << "DecodeFaserVersionKey passed an unknown node:" << node << std::endl; 
     nodeOverrideTag = "";
   }
-  std::cout << "Decode 1" << std::endl;
   // Default to faser version
   m_tag = svc->faserVersion();
   m_node = "FASER";
@@ -102,7 +93,6 @@ void DecodeFaserVersionKey::defineTag(const T* svc, const std::string & node)
     m_tag = neutrinoTag;
     m_node = "Neutrino";
   }
-  std::cout << "Decode 2" << std::endl;
 
   // If scintOverrideTag is specified (and is not just "CUSTOM") then override with the scint tag.
   std::string scintTag;
@@ -116,7 +106,6 @@ void DecodeFaserVersionKey::defineTag(const T* svc, const std::string & node)
     m_tag = scintTag;
     m_node = "Scintillator";
   }
-  std::cout << "Decode 3" << std::endl;
 
   // If trackerOverrideTag is specified (and is not just "CUSTOM") then override with the tracker tag.
   std::string trackerTag;
@@ -130,7 +119,6 @@ void DecodeFaserVersionKey::defineTag(const T* svc, const std::string & node)
     m_tag = trackerTag;
     m_node = "Tracker";
   }
-  std::cout << "Decode 4" << std::endl;
 
   // If caloOverrideTag is specified (and is not just "CUSTOM") then override with the calo tag.
   std::string caloTag;
@@ -144,7 +132,6 @@ void DecodeFaserVersionKey::defineTag(const T* svc, const std::string & node)
     m_tag = caloTag;
     m_node = "Calorimeter";
   }
-  std::cout << "Decode 5" << std::endl;
 
   // Finally if subsystem tag is overriden then use that.
   std::string outputTag;
@@ -154,7 +141,6 @@ void DecodeFaserVersionKey::defineTag(const T* svc, const std::string & node)
     m_tag  = outputTag;
     m_node = node;
   }
-  std::cout << "Decode 6" << std::endl;
 
 }
 
diff --git a/Scintillator/ScintDetDescr/VetoNuGeoModel/src/VetoNuDetectorFactory.cxx b/Scintillator/ScintDetDescr/VetoNuGeoModel/src/VetoNuDetectorFactory.cxx
index e22fe6f59..2ac00cd60 100644
--- a/Scintillator/ScintDetDescr/VetoNuGeoModel/src/VetoNuDetectorFactory.cxx
+++ b/Scintillator/ScintDetDescr/VetoNuGeoModel/src/VetoNuDetectorFactory.cxx
@@ -149,12 +149,12 @@ void VetoNuDetectorFactory::create(GeoPhysVol *world)
   GeoTrf::Transform3D vetoTransform = vetoGeneral->partTransform("VetoNu");
 
     std::string stationA_Label = "StationA";
-    std::string stationB_Label = "StationB";
-    std::string radiator_Label = "Radiator";
+    // std::string stationB_Label = "StationB";
+    // std::string radiator_Label = "Radiator";
 
     bool stationA_Present = vetoGeneral->partPresent(stationA_Label);
-    bool stationB_Present = vetoGeneral->partPresent(stationB_Label);
-    bool radiator_Present = vetoGeneral->partPresent(radiator_Label);
+    // bool stationB_Present = vetoGeneral->partPresent(stationB_Label);
+    // bool radiator_Present = vetoGeneral->partPresent(radiator_Label);
   //
   //  Plate is the same for all stations
   //
diff --git a/Simulation/G4Faser/G4FaserTools/python/G4FieldConfigNew.py b/Simulation/G4Faser/G4FaserTools/python/G4FieldConfigNew.py
index fc460d74d..54d41cf8f 100644
--- a/Simulation/G4Faser/G4FaserTools/python/G4FieldConfigNew.py
+++ b/Simulation/G4Faser/G4FaserTools/python/G4FieldConfigNew.py
@@ -54,7 +54,7 @@ def BasicDetectorConstantFieldManagerToolCfg(ConfigFlags, name='BasicDetectorCon
 #
 
 def EmulsionFieldManagerToolCfg(ConfigFlags, name='EmulsionFieldManager', **kwargs):
-    kwargs.setdefault("LogicalVolumes", ['Emulsion::Emulsion'])
+    kwargs.setdefault("LogicalVolumes", ['Emulsion::EmulsionStationA'])
     #kwargs.setdefault('DeltaChord',         0.00001)
     kwargs.setdefault('DeltaIntersection',  0.00001)
     kwargs.setdefault('DeltaOneStep',       0.0001)
@@ -63,7 +63,7 @@ def EmulsionFieldManagerToolCfg(ConfigFlags, name='EmulsionFieldManager', **kwar
     return BasicDetectorFieldManagerToolCfg(ConfigFlags, name, **kwargs)
 
 def VetoFieldManagerToolCfg(ConfigFlags, name='VetoFieldManager', **kwargs):
-    kwargs.setdefault("LogicalVolumes", ['Veto::Veto'])
+    kwargs.setdefault("LogicalVolumes", ['Veto::VetoStationA'])
     #kwargs.setdefault('DeltaChord',         0.00001)
     kwargs.setdefault('DeltaIntersection',  0.00001)
     kwargs.setdefault('DeltaOneStep',       0.0001)
@@ -72,7 +72,7 @@ def VetoFieldManagerToolCfg(ConfigFlags, name='VetoFieldManager', **kwargs):
     return BasicDetectorFieldManagerToolCfg(ConfigFlags, name, **kwargs)
 
 def VetoNuFieldManagerToolCfg(ConfigFlags, name='VetoNuFieldManager', **kwargs):
-    kwargs.setdefault("LogicalVolumes", ['VetoNu::VetoNu'])
+    kwargs.setdefault("LogicalVolumes", ['VetoNu::VetoNuStationA'])
     #kwargs.setdefault('DeltaChord',         0.00001)
     kwargs.setdefault('DeltaIntersection',  0.00001)
     kwargs.setdefault('DeltaOneStep',       0.0001)
-- 
GitLab