diff --git a/fcl/configurations/calibration_database_GlobalTags_icarus.fcl b/fcl/configurations/calibration_database_GlobalTags_icarus.fcl index 5d080878d..03f5d89a5 100644 --- a/fcl/configurations/calibration_database_GlobalTags_icarus.fcl +++ b/fcl/configurations/calibration_database_GlobalTags_icarus.fcl @@ -5,7 +5,7 @@ BEGIN_PROLOG ICARUS_Calibration_GlobalTags: { - @table::TPC_CalibrationTags_Jan2025 + @table::TPC_CalibrationTags_Jul2025 @table::PMT_CalibrationTags_Run3_Feb2025 @table::CRT_CalibrationTags_Oct2023 } diff --git a/fcl/configurations/calibration_database_TPC_TagSets_icarus.fcl b/fcl/configurations/calibration_database_TPC_TagSets_icarus.fcl index 828e8d8a3..99d15c020 100644 --- a/fcl/configurations/calibration_database_TPC_TagSets_icarus.fcl +++ b/fcl/configurations/calibration_database_TPC_TagSets_icarus.fcl @@ -37,4 +37,15 @@ TPC_CalibrationTags_Jan2025: { } +## TPC_CalibrationTags_Jul2024 +# Update to 2D deconv tags. Change TPC equalization to be per-plane +TPC_CalibrationTags_Jul2025: { + + tpc_channelstatus_data: "v3r4" + tpc_elifetime_data: "v3r0" + tpc_dqdxcalibration_allplanes_data: "v1r0" + tpc_yz_correction_allplanes_data: "v2r0" + +} + END_PROLOG diff --git a/fcl/reco/Definitions/stage1_icarus_defs.fcl b/fcl/reco/Definitions/stage1_icarus_defs.fcl index 22b46744c..95dd92faf 100644 --- a/fcl/reco/Definitions/stage1_icarus_defs.fcl +++ b/fcl/reco/Definitions/stage1_icarus_defs.fcl @@ -364,4 +364,28 @@ icarus_stage1_producers.SBNShowerGausCryoW.UseAllParticles: icarus_stage1_producers.SBNShowerGausCryoE.PFParticleLabel: "pandoraGausCryoE" icarus_stage1_producers.SBNShowerGausCryoE.UseAllParticles: true +applyNorm: true + +icarus_stage1_producers.SBNShowerGausCryoE.ShowerFinderTools[7].CalorimetryAlg: @local::icarus_calorimetryalgdata +icarus_stage1_producers.SBNShowerGausCryoE.ShowerFinderTools[7].ApplyCorrectionsInNorm: @local::applyNorm +icarus_stage1_producers.SBNShowerGausCryoE.ShowerFinderTools[7].NormTools: @local::icarus_calonormtools +icarus_stage1_producers.SBNShowerGausCryoW.ShowerFinderTools[7].CalorimetryAlg: @local::icarus_calorimetryalgdata +icarus_stage1_producers.SBNShowerGausCryoW.ShowerFinderTools[7].ApplyCorrectionsInNorm: @local::applyNorm +icarus_stage1_producers.SBNShowerGausCryoW.ShowerFinderTools[7].NormTools: @local::icarus_calonormtools + +icarus_stage1_producers.SBNShowerGausCryoE.ShowerFinderTools[5].CalorimetryAlg: @local::icarus_calorimetryalgdata +icarus_stage1_producers.SBNShowerGausCryoE.ShowerFinderTools[5].ApplyCorrectionsInNorm: @local::applyNorm +icarus_stage1_producers.SBNShowerGausCryoE.ShowerFinderTools[5].NormTools: @local::icarus_calonormtools +icarus_stage1_producers.SBNShowerGausCryoW.ShowerFinderTools[5].CalorimetryAlg: @local::icarus_calorimetryalgdata +icarus_stage1_producers.SBNShowerGausCryoW.ShowerFinderTools[5].ApplyCorrectionsInNorm: @local::applyNorm +icarus_stage1_producers.SBNShowerGausCryoW.ShowerFinderTools[5].NormTools: @local::icarus_calonormtools + +icarus_stage1_producers.SBNShowerGausCryoE.ShowerFinderTools[3].ApplyCorrectionsInNorm: @local::applyNorm +icarus_stage1_producers.SBNShowerGausCryoE.ShowerFinderTools[3].NormTools: @local::icarus_calonormtools +icarus_stage1_producers.SBNShowerGausCryoW.ShowerFinderTools[3].ApplyCorrectionsInNorm: @local::applyNorm +icarus_stage1_producers.SBNShowerGausCryoW.ShowerFinderTools[3].NormTools: @local::icarus_calonormtools + +# Set supera input fcl files +icarus_stage1_analyzers.superaMC.supera_params: "supera_icarus_MC_all_cryo_PMT_CRT_v10.fcl" + END_PROLOG diff --git a/fcl/reco/Stage1/mc/stage1_run2_icarus_MC.fcl b/fcl/reco/Stage1/mc/stage1_run2_icarus_MC.fcl index 0009c0806..a1c2ce7ff 100644 --- a/fcl/reco/Stage1/mc/stage1_run2_icarus_MC.fcl +++ b/fcl/reco/Stage1/mc/stage1_run2_icarus_MC.fcl @@ -105,6 +105,39 @@ physics.producers.mcreco.MCParticleDroppedLabel: "largeant:droppedMCParticles" physics.producers.mcreco.MCRecoPart.SavePathPDGList: [13,-13,211,-211,111,311,310,130,321,-321,2212,2112,2224,2214,2114,1114,3122,1000010020,1000010030,1000020030,1000020040] physics.producers.mcreco.MCRecoPart.TrackIDOffsets: [0,10000000,20000000] #Account for track ID offsets in labeling primaries +runPeriod: 2 + +physics.producers.SBNShowerGausCryoE.ShowerFinderTools[7].CalorimetryAlg: @local::icarus_calorimetryalgmc +physics.producers.SBNShowerGausCryoE.ShowerFinderTools[7].ApplyCorrectionsInNorm: true +physics.producers.SBNShowerGausCryoE.ShowerFinderTools[7].NormTools: @local::icarus_calonormtoolsMC +physics.producers.SBNShowerGausCryoE.ShowerFinderTools[7].NormTools[0].MC: @local::runPeriod +physics.producers.SBNShowerGausCryoE.ShowerFinderTools[7].NormTools[1].MC: @local::runPeriod +physics.producers.SBNShowerGausCryoW.ShowerFinderTools[7].CalorimetryAlg: @local::icarus_calorimetryalgmc +physics.producers.SBNShowerGausCryoW.ShowerFinderTools[7].ApplyCorrectionsInNorm: true +physics.producers.SBNShowerGausCryoW.ShowerFinderTools[7].NormTools: @local::icarus_calonormtoolsMC +physics.producers.SBNShowerGausCryoW.ShowerFinderTools[7].NormTools[0].MC: @local::runPeriod +physics.producers.SBNShowerGausCryoW.ShowerFinderTools[7].NormTools[1].MC: @local::runPeriod + +physics.producers.SBNShowerGausCryoE.ShowerFinderTools[5].CalorimetryAlg: @local::icarus_calorimetryalgmc +physics.producers.SBNShowerGausCryoE.ShowerFinderTools[5].ApplyCorrectionsInNorm: true +physics.producers.SBNShowerGausCryoE.ShowerFinderTools[5].NormTools: @local::icarus_calonormtoolsMC +physics.producers.SBNShowerGausCryoE.ShowerFinderTools[5].NormTools[0].MC: @local::runPeriod +physics.producers.SBNShowerGausCryoE.ShowerFinderTools[5].NormTools[1].MC: @local::runPeriod +physics.producers.SBNShowerGausCryoW.ShowerFinderTools[5].CalorimetryAlg: @local::icarus_calorimetryalgmc +physics.producers.SBNShowerGausCryoW.ShowerFinderTools[5].ApplyCorrectionsInNorm: true +physics.producers.SBNShowerGausCryoW.ShowerFinderTools[5].NormTools: @local::icarus_calonormtoolsMC +physics.producers.SBNShowerGausCryoW.ShowerFinderTools[5].NormTools[0].MC: @local::runPeriod +physics.producers.SBNShowerGausCryoW.ShowerFinderTools[5].NormTools[1].MC: @local::runPeriod + +physics.producers.SBNShowerGausCryoE.ShowerFinderTools[3].ApplyCorrectionsInNorm: true +physics.producers.SBNShowerGausCryoE.ShowerFinderTools[3].NormTools: @local::icarus_calonormtoolsMC +physics.producers.SBNShowerGausCryoE.ShowerFinderTools[3].NormTools[0].MC: @local::runPeriod +physics.producers.SBNShowerGausCryoE.ShowerFinderTools[3].NormTools[1].MC: @local::runPeriod +physics.producers.SBNShowerGausCryoW.ShowerFinderTools[3].ApplyCorrectionsInNorm: true +physics.producers.SBNShowerGausCryoW.ShowerFinderTools[3].NormTools: @local::icarus_calonormtoolsMC +physics.producers.SBNShowerGausCryoW.ShowerFinderTools[3].NormTools[0].MC: @local::runPeriod +physics.producers.SBNShowerGausCryoW.ShowerFinderTools[3].NormTools[1].MC: @local::runPeriod + services.message.destinations : { STDCOUT: diff --git a/icaruscode/TPC/Calorimetry/CMakeLists.txt b/icaruscode/TPC/Calorimetry/CMakeLists.txt index a3b1709c5..45b214a16 100644 --- a/icaruscode/TPC/Calorimetry/CMakeLists.txt +++ b/icaruscode/TPC/Calorimetry/CMakeLists.txt @@ -47,6 +47,8 @@ cet_build_plugin(NormalizeDriftSQLite art::tool LIBRARIES ${TOOL_LIBRARIES}) cet_build_plugin(NormalizeDrift art::tool LIBRARIES ${TOOL_LIBRARIES}) cet_build_plugin(NormalizeTPCSQL art::tool LIBRARIES ${TOOL_LIBRARIES}) cet_build_plugin(NormalizeTPC art::tool LIBRARIES ${TOOL_LIBRARIES}) +cet_build_plugin(NormalizeTPCPerPlaneSQL art::tool LIBRARIES ${TOOL_LIBRARIES}) +cet_build_plugin(NormalizeTPCPerPlane art::tool LIBRARIES ${TOOL_LIBRARIES}) cet_build_plugin(NormalizeTPCLocal art::tool LIBRARIES ${TOOL_LIBRARIES}) cet_build_plugin(NormalizeWire art::tool LIBRARIES ${TOOL_LIBRARIES}) cet_build_plugin(NormalizeYZSQL art::tool LIBRARIES ${TOOL_LIBRARIES}) diff --git a/icaruscode/TPC/Calorimetry/NormalizeTPCPerPlaneSQL_tool.cc b/icaruscode/TPC/Calorimetry/NormalizeTPCPerPlaneSQL_tool.cc new file mode 100644 index 000000000..e612530a3 --- /dev/null +++ b/icaruscode/TPC/Calorimetry/NormalizeTPCPerPlaneSQL_tool.cc @@ -0,0 +1,147 @@ +// Framework Includes +#include "art/Framework/Core/EDProducer.h" +#include "art/Framework/Principal/Event.h" +#include "art/Framework/Principal/Handle.h" +#include "art/Framework/Services/Registry/ServiceHandle.h" +#include "art/Persistency/Common/PtrMaker.h" +#include "art/Utilities/ToolMacros.h" +#include "cetlib/cpu_timer.h" +#include "fhiclcpp/ParameterSet.h" +#include "messagefacility/MessageLogger/MessageLogger.h" + +#include "larevt/CalibrationDBI/Providers/DBFolder.h" + +// Tool include +#include "larreco/Calorimetry/INormalizeCharge.h" + +// Services +#include "lardata/DetectorInfoServices/DetectorClocksService.h" + +// Lab helpers +#include "wda.h" + +// C++ +#include + +namespace icarus { + namespace calo { + +class NormalizeTPCPerPlaneSQL : public INormalizeCharge +{ +public: + NormalizeTPCPerPlaneSQL(fhicl::ParameterSet const &pset); + + void configure(const fhicl::ParameterSet& pset) override; + double Normalize(double dQdx, const art::Event &e, const recob::Hit &h, const geo::Point_t &location, const geo::Vector_t &direction, double t0) override; + +private: + // Configuration + std::string fDBFileName; + std::string fDBTag; + bool fVerbose; + int fMC; + + lariov::DBFolder fDB; + + // Class to hold data from DB + class ScaleInfo { + public: + std::map scale; + }; + + // Helpers + ScaleInfo GetScaleInfo(uint64_t run); + + // Cache run requests + std::map fScaleInfos; +}; + +DEFINE_ART_CLASS_TOOL(NormalizeTPCPerPlaneSQL) + + } // end namespace calo +} // end namespace icarus + + +icarus::calo::NormalizeTPCPerPlaneSQL::NormalizeTPCPerPlaneSQL(fhicl::ParameterSet const &pset): + fDBFileName(pset.get("DBFileName")), + fDBTag(pset.get("DBTag")), + fVerbose(pset.get("Verbose", false)), + fMC(pset.get("MC")), + fDB(fDBFileName, "", "", fDBTag, true, false) {} + +void icarus::calo::NormalizeTPCPerPlaneSQL::configure(const fhicl::ParameterSet& pset) {} + +icarus::calo::NormalizeTPCPerPlaneSQL::ScaleInfo icarus::calo::NormalizeTPCPerPlaneSQL::GetScaleInfo(uint64_t run) { + + // check the cache + if (fScaleInfos.count(run)) { + return fScaleInfos.at(run); + } + + // Look up the run + // + // Translate the run into a fake "timestamp" + fDB.UpdateData((run+1000000000)*1000000000); + + // Collect the run info + ScaleInfo thisscale; + + // Iterate over the rows + for (unsigned ch = 0; ch < 12; ch++) { + double scale; + fDB.GetNamedChannelData(ch, "scale", scale); + + thisscale.scale[ch] = scale; + } + // Set the cache + fScaleInfos[run] = thisscale; + + return thisscale; +} + +double icarus::calo::NormalizeTPCPerPlaneSQL::Normalize(double dQdx, const art::Event &e, + const recob::Hit &hit, const geo::Point_t &location, const geo::Vector_t &direction, double t0) { + + // Get the info + uint64_t runID = -1; + switch (fMC) { + case 1: + runID = 8460; + break; + case 2: + runID = 9301; + break; + case 3: + runID = 11806; + break; + case 4: + runID = 12960; + break; + case 5: + runID = 14079; + break; + default: + runID = e.id().runID().run(); + break; + } + + ScaleInfo const& i = GetScaleInfo(runID); + + // Lookup the TPC, cryo + unsigned tpc = hit.WireID().TPC; + unsigned cryo = hit.WireID().Cryostat; + unsigned plane = hit.WireID().Plane; + + // Get the TPC-Plane index + unsigned itpc_plane = 2*cryo + tpc/2 + plane*4; + + double scale = 1; + + // TODO: what to do if no scale is found? throw an exception?? + if (i.scale.count(itpc_plane)) scale = i.scale.at(itpc_plane); + + if (fVerbose) std::cout << "NormalizeTPCPerPlaneSQL Tool -- Data at Cryo: " << cryo << " TPC: " << tpc << " Plane: " << plane << " itpc_plane: " << itpc_plane << " scale: " << scale << std::endl; + + return dQdx * scale; +} + diff --git a/icaruscode/TPC/Calorimetry/NormalizeTPCPerPlane_tool.cc b/icaruscode/TPC/Calorimetry/NormalizeTPCPerPlane_tool.cc new file mode 100644 index 000000000..08b0c0ec4 --- /dev/null +++ b/icaruscode/TPC/Calorimetry/NormalizeTPCPerPlane_tool.cc @@ -0,0 +1,158 @@ +// Framework Includes +#include "art/Framework/Core/EDProducer.h" +#include "art/Framework/Principal/Event.h" +#include "art/Framework/Principal/Handle.h" +#include "art/Framework/Services/Registry/ServiceHandle.h" +#include "art/Persistency/Common/PtrMaker.h" +#include "art/Utilities/ToolMacros.h" +#include "cetlib/cpu_timer.h" +#include "fhiclcpp/ParameterSet.h" +#include "messagefacility/MessageLogger/MessageLogger.h" + +// Tool include +#include "larreco/Calorimetry/INormalizeCharge.h" + +// Services +#include "lardata/DetectorInfoServices/DetectorClocksService.h" + +// Lab helpers +#include "wda.h" + +// C++ +#include + +namespace icarus { + namespace calo { + +class NormalizeTPCPerPlane : public INormalizeCharge +{ +public: + NormalizeTPCPerPlane(fhicl::ParameterSet const &pset); + + void configure(const fhicl::ParameterSet& pset) override; + double Normalize(double dQdx, const art::Event &e, const recob::Hit &h, const geo::Point_t &location, const geo::Vector_t &direction, double t0) override; + +private: + // Configuration + int fTimeout; + std::string fURL; + bool fVerbose; + + // Class to hold data from DB + class ScaleInfo { + public: + std::map scale; + }; + + // Helpers + ScaleInfo GetScaleInfo(uint64_t run); + std::string URL(uint64_t run); + + // Cache run requests + std::map fScaleInfos; +}; + +DEFINE_ART_CLASS_TOOL(NormalizeTPCPerPlane) + + } // end namespace calo +} // end namespace icarus + + +icarus::calo::NormalizeTPCPerPlane::NormalizeTPCPerPlane(fhicl::ParameterSet const &pset) { + this->configure(pset); +} + +void icarus::calo::NormalizeTPCPerPlane::configure(const fhicl::ParameterSet& pset) { + fURL = pset.get("URL"); + fTimeout = pset.get("Timeout"); + fVerbose = pset.get("Verbose", false); +} + +std::string icarus::calo::NormalizeTPCPerPlane::URL(uint64_t run) { + return fURL + std::to_string(run); +} + +icarus::calo::NormalizeTPCPerPlane::ScaleInfo icarus::calo::NormalizeTPCPerPlane::GetScaleInfo(uint64_t run) { + // check the cache + if (fScaleInfos.count(run)) { + return fScaleInfos.at(run); + } + + // Otherwise, look it up + int error = 0; + std::string url = URL(run); + + if (fVerbose) std::cout << "NormalizeTPCPerPlane Tool -- New Scale info, requesting data from url:\n" << url << std::endl; + + Dataset d = getDataWithTimeout(url.c_str(), "", fTimeout, &error); + if (error) { + throw cet::exception("NormalizeTPCPerPlane") << "Calibration Database access failed. URL: (" << url << ") Error Code: " << error; + } + + if (fVerbose) std::cout << "NormalizeTPCPerPlane Tool -- Received HTTP response:\n" << getHTTPmessage(d) << std::endl; + + if (getHTTPstatus(d) != 200) { + throw cet::exception("NormalizeTPCPerPlane") + << "Calibration Database access failed. URL: (" << url + << "). HTTP error status: " << getHTTPstatus(d) << ". HTTP error message: " << getHTTPmessage(d); + } + + // Collect the run info + ScaleInfo thisscale; + + // Number of rows + int n_tuple = getNtuples(d); + if (n_tuple < 0) { + throw cet::exception("NormalizeTPCPerPlane") << "Calibration Database access failed. URL: (" << url << ") Bad Tuple Number: " << n_tuple; + } + + // Iterate over the rows + // The first 4 are metadata + for (unsigned row = 4; row < (unsigned)n_tuple; row++) { + Tuple tup = getTuple(d, row); + + int err = 0; + // Get the itpc number + int ch = getLongValue(tup, 0, &err); + if (error) { + throw cet::exception("NormalizeTPCPerPlane") << "Calibration Database access failed. URL: (" << url << ") Failed on tuple access, row: " << row << ", col 0. Error Code: " << error; + } + + // and the scale + double scale = getDoubleValue(tup, 3, &err); + if (error) { + throw cet::exception("NormalizeTPCPerPlane") << "Calibration Database access failed. URL: (" << url << ") Failed on tuple access, row: " << row << ", col 1. Error Code: " << error; + } + + thisscale.scale[ch] = scale; + } + + // Set the cache + fScaleInfos[run] = thisscale; + + return thisscale; +} + +double icarus::calo::NormalizeTPCPerPlane::Normalize(double dQdx, const art::Event &e, + const recob::Hit &hit, const geo::Point_t &location, const geo::Vector_t &direction, double t0) { + // Get the info + ScaleInfo i = GetScaleInfo(e.id().runID().run()); + + // Lookup the TPC, cryo + unsigned tpc = hit.WireID().TPC; + unsigned cryo = hit.WireID().Cryostat; + unsigned plane = hit.WireID().Plane; + + // Get the TPC-Plane index + unsigned itpc_plane = 2*cryo + tpc/2 + plane*4; + + double scale = 1; + + // TODO: what to do if no scale is found? throw an exception?? + if (i.scale.count(itpc_plane)) scale = i.scale.at(itpc_plane); + + if (fVerbose) std::cout << "NormalizeTPCPerPlaneSQL Tool -- Data at Cryo: " << cryo << " TPC: " << tpc << " Plane: " << plane << " itpc_plane: " << itpc_plane << " scale: " << scale << std::endl; + + return dQdx * scale; +} + diff --git a/icaruscode/TPC/Calorimetry/NormalizeTPCSQL_tool.cc b/icaruscode/TPC/Calorimetry/NormalizeTPCSQL_tool.cc index 8189bbb45..7a6a50051 100644 --- a/icaruscode/TPC/Calorimetry/NormalizeTPCSQL_tool.cc +++ b/icaruscode/TPC/Calorimetry/NormalizeTPCSQL_tool.cc @@ -39,6 +39,7 @@ class NormalizeTPCSQL : public INormalizeCharge std::string fDBFileName; std::string fDBTag; bool fVerbose; + int fMC; lariov::DBFolder fDB; @@ -65,11 +66,13 @@ icarus::calo::NormalizeTPCSQL::NormalizeTPCSQL(fhicl::ParameterSet const &pset): fDBFileName(pset.get("DBFileName")), fDBTag(pset.get("DBTag")), fVerbose(pset.get("Verbose", false)), + fMC(pset.get("MC")), fDB(fDBFileName, "", "", fDBTag, true, false) {} void icarus::calo::NormalizeTPCSQL::configure(const fhicl::ParameterSet& pset) {} icarus::calo::NormalizeTPCSQL::ScaleInfo icarus::calo::NormalizeTPCSQL::GetScaleInfo(uint64_t run) { + // check the cache if (fScaleInfos.count(run)) { return fScaleInfos.at(run); @@ -98,8 +101,28 @@ icarus::calo::NormalizeTPCSQL::ScaleInfo icarus::calo::NormalizeTPCSQL::GetScale double icarus::calo::NormalizeTPCSQL::Normalize(double dQdx, const art::Event &e, const recob::Hit &hit, const geo::Point_t &location, const geo::Vector_t &direction, double t0) { + // Get the info - ScaleInfo i = GetScaleInfo(e.id().runID().run()); + uint64_t runID = -1; + switch (fMC) { + case 1: + runID = 8460; + break; + case 2: + runID = 9301; + break; + case 3: + runID = 11806; + break; + case 4: + runID = 12960; + break; + default: + runID = e.id().runID().run(); + break; + } + + ScaleInfo const& i = GetScaleInfo(runID); // Lookup the TPC, cryo unsigned tpc = hit.WireID().TPC; diff --git a/icaruscode/TPC/Calorimetry/NormalizeYZSQL_tool.cc b/icaruscode/TPC/Calorimetry/NormalizeYZSQL_tool.cc index 9868bd627..3c5327a80 100644 --- a/icaruscode/TPC/Calorimetry/NormalizeYZSQL_tool.cc +++ b/icaruscode/TPC/Calorimetry/NormalizeYZSQL_tool.cc @@ -39,6 +39,7 @@ class NormalizeYZSQL : public INormalizeCharge std::string fDBFileName; std::string fDBTag; bool fVerbose; + int fMC; lariov::DBFolder fDB; @@ -155,6 +156,7 @@ icarus::calo::NormalizeYZSQL::NormalizeYZSQL(fhicl::ParameterSet const &pset): fDBFileName(pset.get("DBFileName")), fDBTag(pset.get("DBTag")), fVerbose(pset.get("Verbose", false)), + fMC(pset.get("MC")), fDB(fDBFileName, "", "", fDBTag, true, false) {} void icarus::calo::NormalizeYZSQL::configure(const fhicl::ParameterSet& pset) {} @@ -231,7 +233,29 @@ double icarus::calo::NormalizeYZSQL::Normalize(double dQdx, const art::Event &e, const recob::Hit &hit, const geo::Point_t &location, const geo::Vector_t &direction, double t0) { // Get the info - ScaleInfo const& i = GetScaleInfo(e.id().runID().run()); + uint64_t runID = -1; + switch (fMC) { + case 1: + runID = 8460; + break; + case 2: + runID = 9301; + break; + case 3: + runID = 11806; + break; + case 4: + runID = 12960; + break; + case 5: + runID = 14079; + break; + default: + runID = e.id().runID().run(); + break; + } + + ScaleInfo const& i = GetScaleInfo(runID); // plane int plane = hit.WireID().Plane; diff --git a/icaruscode/TPC/Calorimetry/normtools_icarus.fcl b/icaruscode/TPC/Calorimetry/normtools_icarus.fcl index 2a69eb647..48f2ea92d 100644 --- a/icaruscode/TPC/Calorimetry/normtools_icarus.fcl +++ b/icaruscode/TPC/Calorimetry/normtools_icarus.fcl @@ -24,9 +24,9 @@ yznorm: { } tpcgain: { - tool_type: NormalizeTPC + tool_type: NormalizeTPCPerPlane Timeout: 200 - URL: "https://dbdata0vm.fnal.gov:9443/icarus_con_prod/app/data?f=tpc_dqdxcalibration_data&t=" + URL: "https://dbdata0vm.fnal.gov:9443/icarus_con_prod/app/data?f=tpc_dqdxcalibration_allplanes_data&t=" Verbose: false } @@ -38,10 +38,11 @@ driftnorm_sql: { } tpcgain_sql: { - tool_type: NormalizeTPCSQL - DBFileName: tpc_dqdxcalibration_data - DBTag: @local::ICARUS_Calibration_GlobalTags.tpc_dqdxcalibration_data + tool_type: NormalizeTPCPerPlaneSQL + DBFileName: tpc_dqdxcalibration_allplanes_data + DBTag: @local::ICARUS_Calibration_GlobalTags.tpc_dqdxcalibration_allplanes_data Verbose: false + MC: -1 } tpcgain_local: { @@ -56,13 +57,15 @@ yznorm_sql: { DBFileName: tpc_yz_correction_allplanes_data DBTag: @local::ICARUS_Calibration_GlobalTags.tpc_yz_correction_allplanes_data Verbose: false + MC: -1 } -#icarus_calonormtools: [@local::driftnorm, @local::yznorm, @local::tpcgain] - icarus_calonormtools: [@local::driftnorm_sql, @local::yznorm_sql, @local::tpcgain_sql] +icarus_calonormtools: [@local::driftnorm_sql, @local::yznorm_sql, @local::tpcgain_sql] +icarus_calonormtoolsMC: [@local::yznorm_sql, @local::tpcgain_sql] -# Gain with angular dep. recombination. Measurement from: https://arxiv.org/pdf/2407.12969 -# Assume equal on planes -- this is __wrong__ -- will need to be fixed when they are calibrated -icarus_data_calconst: [0.0133333, 0.0133333, 0.0133333] +# +# GP 8/4/25 -- Update gain to re-measurement with Run 2 stopping muons and +# fixed recombination. +icarus_data_calconst: [0.016751, 0.012755, 0.012513] END_PROLOG