From 12133eac4f560066ead00b13c6e0cbec50daae00 Mon Sep 17 00:00:00 2001 From: = <=> Date: Thu, 7 Nov 2024 14:07:27 -0600 Subject: [PATCH 1/4] Initial commit of SimEnergyDeposit filter around defined rectangular region in order to assess systematics on unsimulated hardware in ICARUS --- sbncode/DetSim/CMakeLists.txt | 4 + .../DetSim/FilterSimEnergyDeposits_module.cc | 111 ++++++++++++++++++ sbncode/DetSim/fcl/CMakeLists.txt | 1 + sbncode/DetSim/fcl/icarus_simedepfilter.fcl | 43 +++++++ 4 files changed, 159 insertions(+) create mode 100644 sbncode/DetSim/FilterSimEnergyDeposits_module.cc create mode 100644 sbncode/DetSim/fcl/CMakeLists.txt create mode 100644 sbncode/DetSim/fcl/icarus_simedepfilter.fcl diff --git a/sbncode/DetSim/CMakeLists.txt b/sbncode/DetSim/CMakeLists.txt index 2a81d6a62..0bf4e263d 100644 --- a/sbncode/DetSim/CMakeLists.txt +++ b/sbncode/DetSim/CMakeLists.txt @@ -28,10 +28,14 @@ set( MODULE_LIBRARIES ROOT::Geom ROOT::XMLIO ROOT::Gdml + ROOT::Core FFTW3::FFTW3 ) cet_build_plugin(AdjustSimForTrigger art::module LIBRARIES ${MODULE_LIBRARIES}) +cet_build_plugin(FilterSimEnergyDeposits art::module LIBRARIES ${MODULE_LIBRARIES}) + +add_subdirectory(fcl) #install_headers() install_fhicl() diff --git a/sbncode/DetSim/FilterSimEnergyDeposits_module.cc b/sbncode/DetSim/FilterSimEnergyDeposits_module.cc new file mode 100644 index 000000000..a810ff618 --- /dev/null +++ b/sbncode/DetSim/FilterSimEnergyDeposits_module.cc @@ -0,0 +1,111 @@ +//////////////////////////////////////////////////////////////////////// +// Class: FilterSimEnergyDeposits +// Plugin Type: producer (Unknown Unknown) +// File: FilterSimEnergyDeposits_module.cc +// +// Generated at Thu Oct 17 20:16:12 2024 by Jacob Zettlemoyer using cetskelgen +// from cetlib version 3.18.02. +//////////////////////////////////////////////////////////////////////// + +#include "art/Framework/Core/EDProducer.h" +#include "art/Framework/Core/ModuleMacros.h" +#include "art/Framework/Principal/Event.h" +#include "art/Framework/Principal/Handle.h" +#include "art/Framework/Principal/Run.h" +#include "art/Framework/Principal/SubRun.h" +#include "canvas/Utilities/InputTag.h" +#include "fhiclcpp/ParameterSet.h" +#include "messagefacility/MessageLogger/MessageLogger.h" + +#include "lardataobj/Simulation/SimEnergyDeposit.h" + +#include "TVector3.h" + +#include + +class FilterSimEnergyDeposits; + + +class FilterSimEnergyDeposits : public art::EDProducer { +public: + explicit FilterSimEnergyDeposits(fhicl::ParameterSet const& p); + // The compiler-generated destructor is fine for non-base + // classes without bare pointers or other resource use. + + // Plugins should not be copied or assigned. + FilterSimEnergyDeposits(FilterSimEnergyDeposits const&) = delete; + FilterSimEnergyDeposits(FilterSimEnergyDeposits&&) = delete; + FilterSimEnergyDeposits& operator=(FilterSimEnergyDeposits const&) = delete; + FilterSimEnergyDeposits& operator=(FilterSimEnergyDeposits&&) = delete; + // Required functions. + void produce(art::Event& e) override; + +private: + + // Declare member data here. + + art::InputTag fInitSimEnergyDepositLabel; + std::string fOutSimEnergyDepositLabel; + double fP1_x; + double fP1_y; + double fP1_z; + double fP2_x; + double fP2_y; + double fP2_z; + static constexpr auto& kModuleName = "FilterSimEnergyDeposit"; + + bool isWithinVolume(TVector3 p1, TVector3 p2, TVector3 sedep); + +}; + + +FilterSimEnergyDeposits::FilterSimEnergyDeposits(fhicl::ParameterSet const& p) + : EDProducer{p} + , fInitSimEnergyDepositLabel{p.get("InitSimEnergyDepositLabel", "undefined")} + , fOutSimEnergyDepositLabel{p.get("OutSimEnergyDepositLabel", "undefined")} + , fP1_x{p.get("P1_X", 0.0)} + , fP1_y{p.get("P1_Y", 0.0)} + , fP1_z{p.get("P1_Z", 0.0)} + , fP2_x{p.get("P2_X", 0.0)} + , fP2_y{p.get("P2_Y", 0.0)} + , fP2_z{p.get("P2_Z", 0.0)} +{ + // Call appropriate produces<>() functions here. + // Call appropriate consumes<>() for any products to be retrieved by this module. + produces>(); +} + +bool FilterSimEnergyDeposits::isWithinVolume(TVector3 p_min, TVector3 p_max, TVector3 edep) +{ + bool ingap = false; + if(edep.X() >= p_min.X() && edep.X() <= p_max.X() && + edep.Y() >= p_min.Y() && edep.Y() <= p_max.Y() && + edep.Z() >= p_min.Z() && edep.Z() <= p_max.Z()) + { + ingap = true; + } + return ingap; +} + +void FilterSimEnergyDeposits::produce(art::Event& e) +{ + auto const& simEDeps = + e.getProduct>(fInitSimEnergyDepositLabel); + auto pSimEDeps = std::make_unique>(); + pSimEDeps->reserve(simEDeps.size()); + + TVector3 p1(fP1_x,fP1_y,fP1_z); + TVector3 p2(fP2_x,fP2_y,fP2_z); + + for(auto const& sedep : simEDeps) + { + TVector3 dep(sedep.StartX(), sedep.StartY(), sedep.StartZ()); + if(!(isWithinVolume(p1, p2, dep))) + { + pSimEDeps->emplace_back(sedep); + } + } + e.put(std::move(pSimEDeps)); +} + +DEFINE_ART_MODULE(FilterSimEnergyDeposits) diff --git a/sbncode/DetSim/fcl/CMakeLists.txt b/sbncode/DetSim/fcl/CMakeLists.txt new file mode 100644 index 000000000..eca2a52d6 --- /dev/null +++ b/sbncode/DetSim/fcl/CMakeLists.txt @@ -0,0 +1 @@ +install_fhicl() \ No newline at end of file diff --git a/sbncode/DetSim/fcl/icarus_simedepfilter.fcl b/sbncode/DetSim/fcl/icarus_simedepfilter.fcl new file mode 100644 index 000000000..e95961ee1 --- /dev/null +++ b/sbncode/DetSim/fcl/icarus_simedepfilter.fcl @@ -0,0 +1,43 @@ +BEGIN_PROLOG + +simedepfilter_ind1gap: { + module_type: "FilterSimEnergyDeposits" + InitSimEnergyDepositLabel: "ionization" + OutSimEnergyDepositLabel: "filteredSED" + P1_X: -400 + P1_Y: -200 + P1_Z: -2 + P2_X: 400 + P2_Y: 200 + P2_Z: 2 +} + +simedepfilter_cathodewest: { + module_type: "FilterSimEnergyDeposits" + InitSimEnergyDepositLabel: "ionization" + OutSimEnergyDepositLabel: "filteredSED" + P1_X: 192.2 + P1_Y: -200 + P1_Z: -900 + P2_X: 232.2 + P2_Y: 200 + P2_Z: 900 +} + +simedepfilter_cathodeeast: { + module_type: "FilterSimEnergyDeposits" + InitSimEnergyDepositLabel: "ionization" + OutSimEnergyDepositLabel: "filteredSED" + P1_X: -232.2 + P1_Y: -200 + P1_Z: -900 + P2_X: -198.2 + P2_Y: 200 + P2_Z: 900 +} + +filter_ind1gap: @local::simedepfilter_ind1gap +filter_cathodewest: @local::simedepfilter_cathodewest +filter_cathodeeast: @local::simedepfilter_cathodeeast + +END_PROLOG \ No newline at end of file From 1b10bbdeb82b36ecb69431c166f1c38fb250f010 Mon Sep 17 00:00:00 2001 From: = <=> Date: Thu, 21 Nov 2024 14:26:50 -0600 Subject: [PATCH 2/4] Update filter module for ICARUS systematic studies --- .../DetSim/FilterSimEnergyDeposits_module.cc | 57 ++++++++++++++++++- 1 file changed, 56 insertions(+), 1 deletion(-) diff --git a/sbncode/DetSim/FilterSimEnergyDeposits_module.cc b/sbncode/DetSim/FilterSimEnergyDeposits_module.cc index a810ff618..c70075f07 100644 --- a/sbncode/DetSim/FilterSimEnergyDeposits_module.cc +++ b/sbncode/DetSim/FilterSimEnergyDeposits_module.cc @@ -16,6 +16,11 @@ #include "canvas/Utilities/InputTag.h" #include "fhiclcpp/ParameterSet.h" #include "messagefacility/MessageLogger/MessageLogger.h" +#include "larcore/Geometry/Geometry.h" +#include "larcorealg/Geometry/GeometryCore.h" +#include "larcore/CoreUtils/ServiceUtil.h" +#include "lardata/DetectorInfoServices/LArPropertiesService.h" +#include "lardataalg/DetectorInfo/DetectorPropertiesData.h" #include "lardataobj/Simulation/SimEnergyDeposit.h" @@ -55,6 +60,7 @@ class FilterSimEnergyDeposits : public art::EDProducer { static constexpr auto& kModuleName = "FilterSimEnergyDeposit"; bool isWithinVolume(TVector3 p1, TVector3 p2, TVector3 sedep); + double ShiftX(double z); }; @@ -87,6 +93,17 @@ bool FilterSimEnergyDeposits::isWithinVolume(TVector3 p_min, TVector3 p_max, TVe return ingap; } +double FilterSimEnergyDeposits::ShiftX(double z) +{ + //known as a "Hill equation" from fitting distribution of angle corrected tracks looking at the deflection as it gets closer to z = 0 + double a = -0.431172; + double b = -2.52724; + double c = 0.22043; + double num = a*std::pow(z, b); + double denom = c + std::pow(z, b); + return num/denom; +} + void FilterSimEnergyDeposits::produce(art::Event& e) { auto const& simEDeps = @@ -102,7 +119,45 @@ void FilterSimEnergyDeposits::produce(art::Event& e) TVector3 dep(sedep.StartX(), sedep.StartY(), sedep.StartZ()); if(!(isWithinVolume(p1, p2, dep))) { - pSimEDeps->emplace_back(sedep); + art::ServiceHandle fGeometry; + geo::TPCID tpcid = fGeometry->PositionToTPCID(sedep.MidPoint()); + short int sign = 1; + //if not in TPC, don't do anything to be sure + if(bool(tpcid)) + { + const geo::TPCGeo& tpcGeo = fGeometry->TPC(tpcid); + sign = -1*tpcGeo.DetectDriftDirection(); //this gives us direction towards the anode, I want to shift towards the cathode so take the inverse of what I get + } + else + { + std::cout << "TPC ID not found! Not performing a shift!" << std::endl; + sign = 0; + } + const int numphotons = sedep.NumPhotons(); + const int numelectrons = sedep.NumElectrons(); + const double syratio = sedep.ScintYieldRatio(); + const double energy = sedep.Energy(); + //need to shift in -x for x positions > cathode position and +x for x positions < cathode position in each TPC + double shift_start_x = sedep.Start().X() + sign*ShiftX(std::abs(sedep.Start().Z())); + const geo::Point_t start = {shift_start_x, sedep.Start().Y(), sedep.Start().Z()}; + double shift_end_x = sedep.End().X() + sign*ShiftX(std::abs(sedep.End().Z())); + const geo::Point_t end = {shift_end_x, sedep.End().Y(), sedep.End().Z()}; + const double startT = sedep.StartT(); + const double endT = sedep.EndT(); + const int thisID = sedep.TrackID(); + const int thisPDG = sedep.PdgCode(); + const int origID = sedep.OrigTrackID(); + pSimEDeps->emplace_back(sim::SimEnergyDeposit(numphotons, + numelectrons, + syratio, + energy, + start, + end, + startT, + endT, + thisID, + thisPDG, + origID)); } } e.put(std::move(pSimEDeps)); From b4221fd3cabd39ad80ce99ab9527e3a2aa59d464 Mon Sep 17 00:00:00 2001 From: = <=> Date: Fri, 6 Dec 2024 15:40:17 -0600 Subject: [PATCH 3/4] Addressing review comments --- sbncode/DetSim/CMakeLists.txt | 1 - .../DetSim/FilterSimEnergyDeposits_module.cc | 145 +++++++----------- sbncode/DetSim/fcl/icarus_simedepfilter.fcl | 43 ++---- 3 files changed, 61 insertions(+), 128 deletions(-) diff --git a/sbncode/DetSim/CMakeLists.txt b/sbncode/DetSim/CMakeLists.txt index 0bf4e263d..113aa375a 100644 --- a/sbncode/DetSim/CMakeLists.txt +++ b/sbncode/DetSim/CMakeLists.txt @@ -28,7 +28,6 @@ set( MODULE_LIBRARIES ROOT::Geom ROOT::XMLIO ROOT::Gdml - ROOT::Core FFTW3::FFTW3 ) diff --git a/sbncode/DetSim/FilterSimEnergyDeposits_module.cc b/sbncode/DetSim/FilterSimEnergyDeposits_module.cc index c70075f07..18f911de4 100644 --- a/sbncode/DetSim/FilterSimEnergyDeposits_module.cc +++ b/sbncode/DetSim/FilterSimEnergyDeposits_module.cc @@ -1,31 +1,22 @@ -//////////////////////////////////////////////////////////////////////// -// Class: FilterSimEnergyDeposits -// Plugin Type: producer (Unknown Unknown) -// File: FilterSimEnergyDeposits_module.cc -// -// Generated at Thu Oct 17 20:16:12 2024 by Jacob Zettlemoyer using cetskelgen -// from cetlib version 3.18.02. -//////////////////////////////////////////////////////////////////////// +/** + * @file sbncode/DetSim/FilterSimEnergyDeposits_module.cc + * @date October 17, 2024 + * @author Jacob Zettlemoyer + */ #include "art/Framework/Core/EDProducer.h" #include "art/Framework/Core/ModuleMacros.h" #include "art/Framework/Principal/Event.h" -#include "art/Framework/Principal/Handle.h" -#include "art/Framework/Principal/Run.h" -#include "art/Framework/Principal/SubRun.h" #include "canvas/Utilities/InputTag.h" #include "fhiclcpp/ParameterSet.h" #include "messagefacility/MessageLogger/MessageLogger.h" #include "larcore/Geometry/Geometry.h" #include "larcorealg/Geometry/GeometryCore.h" #include "larcore/CoreUtils/ServiceUtil.h" -#include "lardata/DetectorInfoServices/LArPropertiesService.h" -#include "lardataalg/DetectorInfo/DetectorPropertiesData.h" +#include "larcorealg/Geometry/BoxBoundedGeo.h" #include "lardataobj/Simulation/SimEnergyDeposit.h" -#include "TVector3.h" - #include class FilterSimEnergyDeposits; @@ -50,17 +41,12 @@ class FilterSimEnergyDeposits : public art::EDProducer { // Declare member data here. art::InputTag fInitSimEnergyDepositLabel; - std::string fOutSimEnergyDepositLabel; - double fP1_x; - double fP1_y; - double fP1_z; - double fP2_x; - double fP2_y; - double fP2_z; - static constexpr auto& kModuleName = "FilterSimEnergyDeposit"; - - bool isWithinVolume(TVector3 p1, TVector3 p2, TVector3 sedep); - double ShiftX(double z); + geo::BoxBoundedGeo fBox; + static constexpr auto kModuleName = "FilterSimEnergyDeposit"; + const double ShiftX(double z); + double fA; + double fB; + double fC; }; @@ -68,37 +54,25 @@ class FilterSimEnergyDeposits : public art::EDProducer { FilterSimEnergyDeposits::FilterSimEnergyDeposits(fhicl::ParameterSet const& p) : EDProducer{p} , fInitSimEnergyDepositLabel{p.get("InitSimEnergyDepositLabel", "undefined")} - , fOutSimEnergyDepositLabel{p.get("OutSimEnergyDepositLabel", "undefined")} - , fP1_x{p.get("P1_X", 0.0)} - , fP1_y{p.get("P1_Y", 0.0)} - , fP1_z{p.get("P1_Z", 0.0)} - , fP2_x{p.get("P2_X", 0.0)} - , fP2_y{p.get("P2_Y", 0.0)} - , fP2_z{p.get("P2_Z", 0.0)} + , fBox{p.get("P1_X"), p.get("P2_X"), + p.get("P1_Y"), p.get("P2_Y"), + p.get("P1_Z"), p.get("P2_Z")} + , fA{p.get("A", 0.0)} + , fB{p.get("B", 0.0)} + , fC{p.get("C", 0.0)} { // Call appropriate produces<>() functions here. // Call appropriate consumes<>() for any products to be retrieved by this module. produces>(); } -bool FilterSimEnergyDeposits::isWithinVolume(TVector3 p_min, TVector3 p_max, TVector3 edep) -{ - bool ingap = false; - if(edep.X() >= p_min.X() && edep.X() <= p_max.X() && - edep.Y() >= p_min.Y() && edep.Y() <= p_max.Y() && - edep.Z() >= p_min.Z() && edep.Z() <= p_max.Z()) - { - ingap = true; - } - return ingap; -} -double FilterSimEnergyDeposits::ShiftX(double z) +const double FilterSimEnergyDeposits::ShiftX(double z) { //known as a "Hill equation" from fitting distribution of angle corrected tracks looking at the deflection as it gets closer to z = 0 - double a = -0.431172; - double b = -2.52724; - double c = 0.22043; + double a = fA; + double b = fB; + double c = fC; double num = a*std::pow(z, b); double denom = c + std::pow(z, b); return num/denom; @@ -111,54 +85,39 @@ void FilterSimEnergyDeposits::produce(art::Event& e) auto pSimEDeps = std::make_unique>(); pSimEDeps->reserve(simEDeps.size()); - TVector3 p1(fP1_x,fP1_y,fP1_z); - TVector3 p2(fP2_x,fP2_y,fP2_z); - for(auto const& sedep : simEDeps) { - TVector3 dep(sedep.StartX(), sedep.StartY(), sedep.StartZ()); - if(!(isWithinVolume(p1, p2, dep))) - { - art::ServiceHandle fGeometry; - geo::TPCID tpcid = fGeometry->PositionToTPCID(sedep.MidPoint()); - short int sign = 1; - //if not in TPC, don't do anything to be sure - if(bool(tpcid)) - { - const geo::TPCGeo& tpcGeo = fGeometry->TPC(tpcid); - sign = -1*tpcGeo.DetectDriftDirection(); //this gives us direction towards the anode, I want to shift towards the cathode so take the inverse of what I get - } - else - { - std::cout << "TPC ID not found! Not performing a shift!" << std::endl; - sign = 0; - } - const int numphotons = sedep.NumPhotons(); - const int numelectrons = sedep.NumElectrons(); - const double syratio = sedep.ScintYieldRatio(); - const double energy = sedep.Energy(); - //need to shift in -x for x positions > cathode position and +x for x positions < cathode position in each TPC - double shift_start_x = sedep.Start().X() + sign*ShiftX(std::abs(sedep.Start().Z())); - const geo::Point_t start = {shift_start_x, sedep.Start().Y(), sedep.Start().Z()}; - double shift_end_x = sedep.End().X() + sign*ShiftX(std::abs(sedep.End().Z())); - const geo::Point_t end = {shift_end_x, sedep.End().Y(), sedep.End().Z()}; - const double startT = sedep.StartT(); - const double endT = sedep.EndT(); - const int thisID = sedep.TrackID(); - const int thisPDG = sedep.PdgCode(); - const int origID = sedep.OrigTrackID(); - pSimEDeps->emplace_back(sim::SimEnergyDeposit(numphotons, - numelectrons, - syratio, - energy, - start, - end, - startT, - endT, - thisID, - thisPDG, - origID)); + if(fBox.ContainsPosition(sedep.Start())) + continue; + art::ServiceHandle geom; + geo::TPCGeo const* TPC = geom->PositionToTPCptr(sedep.MidPoint()); + if(!TPC) { + mf::LogVerbatim(kModuleName) << "TPC ID not found! Not performing a shift!"; } + const int numphotons = sedep.NumPhotons(); + const int numelectrons = sedep.NumElectrons(); + const double syratio = sedep.ScintYieldRatio(); + const double energy = sedep.Energy(); + geo::Point_t start = sedep.Start(); + if (TPC) TPC->DriftPoint(start, ShiftX(std::abs(sedep.Start().Z()))); + geo::Point_t end = sedep.End(); + if (TPC) TPC->DriftPoint(end, ShiftX(std::abs(sedep.End().Z()))); + const double startT = sedep.StartT(); + const double endT = sedep.EndT(); + const int thisID = sedep.TrackID(); + const int thisPDG = sedep.PdgCode(); + const int origID = sedep.OrigTrackID(); + pSimEDeps->push_back(sim::SimEnergyDeposit(numphotons, + numelectrons, + syratio, + energy, + start, + end, + startT, + endT, + thisID, + thisPDG, + origID)); } e.put(std::move(pSimEDeps)); } diff --git a/sbncode/DetSim/fcl/icarus_simedepfilter.fcl b/sbncode/DetSim/fcl/icarus_simedepfilter.fcl index e95961ee1..59485c690 100644 --- a/sbncode/DetSim/fcl/icarus_simedepfilter.fcl +++ b/sbncode/DetSim/fcl/icarus_simedepfilter.fcl @@ -3,41 +3,16 @@ BEGIN_PROLOG simedepfilter_ind1gap: { module_type: "FilterSimEnergyDeposits" InitSimEnergyDepositLabel: "ionization" - OutSimEnergyDepositLabel: "filteredSED" - P1_X: -400 - P1_Y: -200 - P1_Z: -2 - P2_X: 400 - P2_Y: 200 - P2_Z: 2 + P1_X: -400 #cm, create a box that spans the full x,y range. Not super-precise. + P1_Y: -200 #cm, create a box that spans the full x,y range. Not super-precise. + P1_Z: -2 #cm, one edge of the filtered gap based on the 37 mm total size of the wire gap + P2_X: 400 #cm, create a box that spans the full x,y range. Not super-precise. + P2_Y: 200 #cm, create a box that spans the full x,y range. Not super-precise. + P2_Z: 2 #cm, other edge of the filtered gap based on the 37 mm total size of the wire gap + A: -0.431172 + B: -2.52724 + C: 0.22043 } -simedepfilter_cathodewest: { - module_type: "FilterSimEnergyDeposits" - InitSimEnergyDepositLabel: "ionization" - OutSimEnergyDepositLabel: "filteredSED" - P1_X: 192.2 - P1_Y: -200 - P1_Z: -900 - P2_X: 232.2 - P2_Y: 200 - P2_Z: 900 -} - -simedepfilter_cathodeeast: { - module_type: "FilterSimEnergyDeposits" - InitSimEnergyDepositLabel: "ionization" - OutSimEnergyDepositLabel: "filteredSED" - P1_X: -232.2 - P1_Y: -200 - P1_Z: -900 - P2_X: -198.2 - P2_Y: 200 - P2_Z: 900 -} - -filter_ind1gap: @local::simedepfilter_ind1gap -filter_cathodewest: @local::simedepfilter_cathodewest -filter_cathodeeast: @local::simedepfilter_cathodeeast END_PROLOG \ No newline at end of file From 9b11cdc20a38da2f36e724492fb19fbf704a0f21 Mon Sep 17 00:00:00 2001 From: = <=> Date: Mon, 9 Dec 2024 12:28:30 -0600 Subject: [PATCH 4/4] Updating again to final version of code as approved --- sbncode/DetSim/FilterSimEnergyDeposits_module.cc | 10 +++++----- sbncode/DetSim/fcl/icarus_simedepfilter.fcl | 1 + 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/sbncode/DetSim/FilterSimEnergyDeposits_module.cc b/sbncode/DetSim/FilterSimEnergyDeposits_module.cc index 18f911de4..802887c91 100644 --- a/sbncode/DetSim/FilterSimEnergyDeposits_module.cc +++ b/sbncode/DetSim/FilterSimEnergyDeposits_module.cc @@ -43,7 +43,7 @@ class FilterSimEnergyDeposits : public art::EDProducer { art::InputTag fInitSimEnergyDepositLabel; geo::BoxBoundedGeo fBox; static constexpr auto kModuleName = "FilterSimEnergyDeposit"; - const double ShiftX(double z); + double ShiftX(double z) const; double fA; double fB; double fC; @@ -57,9 +57,9 @@ FilterSimEnergyDeposits::FilterSimEnergyDeposits(fhicl::ParameterSet const& p) , fBox{p.get("P1_X"), p.get("P2_X"), p.get("P1_Y"), p.get("P2_Y"), p.get("P1_Z"), p.get("P2_Z")} - , fA{p.get("A", 0.0)} - , fB{p.get("B", 0.0)} - , fC{p.get("C", 0.0)} + , fA{p.get("A")} + , fB{p.get("B")} + , fC{p.get("C")} { // Call appropriate produces<>() functions here. // Call appropriate consumes<>() for any products to be retrieved by this module. @@ -67,7 +67,7 @@ FilterSimEnergyDeposits::FilterSimEnergyDeposits(fhicl::ParameterSet const& p) } -const double FilterSimEnergyDeposits::ShiftX(double z) +double FilterSimEnergyDeposits::ShiftX(double z) const { //known as a "Hill equation" from fitting distribution of angle corrected tracks looking at the deflection as it gets closer to z = 0 double a = fA; diff --git a/sbncode/DetSim/fcl/icarus_simedepfilter.fcl b/sbncode/DetSim/fcl/icarus_simedepfilter.fcl index 59485c690..1a697cea8 100644 --- a/sbncode/DetSim/fcl/icarus_simedepfilter.fcl +++ b/sbncode/DetSim/fcl/icarus_simedepfilter.fcl @@ -9,6 +9,7 @@ simedepfilter_ind1gap: { P2_X: 400 #cm, create a box that spans the full x,y range. Not super-precise. P2_Y: 200 #cm, create a box that spans the full x,y range. Not super-precise. P2_Z: 2 #cm, other edge of the filtered gap based on the 37 mm total size of the wire gap + # Values from SBN DocDB 38701: A: -0.431172 B: -2.52724 C: 0.22043