diff --git a/fcl/caf/cafmaker_add_detsim2d_icarus.fcl b/fcl/caf/cafmaker_add_detsim2d_icarus.fcl index 969eb4e7a..0c06987de 100644 --- a/fcl/caf/cafmaker_add_detsim2d_icarus.fcl +++ b/fcl/caf/cafmaker_add_detsim2d_icarus.fcl @@ -12,6 +12,7 @@ physics.producers.mcreco.SimChannelLabel: "daq:simpleSC" # Mini production, pre signal shape tuning # this_cal_constants: [1.343e-2, 1.338e-2, 0.01227] -# Post signal shape tuning -this_cal_constants: [1.343e-2, 1.338e-2, 0.01285] +# Post signal shape tuning, post gain fixing +# See docdb 32139 +this_cal_constants: [1.343e-2, 1.338e-2, 0.01265] #include "set_caf_calconst.fcl" diff --git a/fcl/caf/cafmaker_defs.fcl b/fcl/caf/cafmaker_defs.fcl index 6519be686..a66b1f767 100644 --- a/fcl/caf/cafmaker_defs.fcl +++ b/fcl/caf/cafmaker_defs.fcl @@ -43,6 +43,7 @@ recoana_mccalo_producers: { # Overwrite Labels recoana_mccalo_producers.pandoraCaloGausCryoE.TrackModuleLabel: "pandoraTrackGausCryoE" recoana_mccalo_producers.pandoraCaloGausCryoW.TrackModuleLabel: "pandoraTrackGausCryoW" +recoana_mccalo_producers.pandoraCaloGausCryoW.Cryostat: 1 # Setup CaloAlg for VertexCharge recoana_mccalo_producers.vertexChargeCryoE.CaloAlg: @local::icarus_calorimetryalgmc diff --git a/fcl/caf/cafmakerjob_icarus_data.fcl b/fcl/caf/cafmakerjob_icarus_data.fcl index 2894adb93..90e428270 100644 --- a/fcl/caf/cafmakerjob_icarus_data.fcl +++ b/fcl/caf/cafmakerjob_icarus_data.fcl @@ -32,5 +32,3 @@ physics.producers.cafmaker.SimChannelLabel: "" physics.producers.cafmaker.SystWeightLabels: [] physics.producers.cafmaker.TriggerLabel: "daqTrigger" # the general configuration, for MC, has a different one (see also https://github.com/SBNSoftware/icaruscode/issues/556) - -#include "icarus_data_recombination.fcl" diff --git a/icaruscode/TPC/Calorimetry/NormalizeTPCSQL_tool.cc b/icaruscode/TPC/Calorimetry/NormalizeTPCSQL_tool.cc index d12a802c5..efcac84d7 100644 --- a/icaruscode/TPC/Calorimetry/NormalizeTPCSQL_tool.cc +++ b/icaruscode/TPC/Calorimetry/NormalizeTPCSQL_tool.cc @@ -49,9 +49,9 @@ class NormalizeTPCSQL : public INormalizeCharge }; // Helpers - ScaleInfo GetScaleInfo(uint64_t timestamp); + ScaleInfo GetScaleInfo(uint64_t run); - // Cache timestamp requests + // Cache run requests std::map fScaleInfos; }; @@ -69,16 +69,18 @@ icarus::calo::NormalizeTPCSQL::NormalizeTPCSQL(fhicl::ParameterSet const &pset): void icarus::calo::NormalizeTPCSQL::configure(const fhicl::ParameterSet& pset) {} -icarus::calo::NormalizeTPCSQL::ScaleInfo icarus::calo::NormalizeTPCSQL::GetScaleInfo(uint64_t timestamp) { +icarus::calo::NormalizeTPCSQL::ScaleInfo icarus::calo::NormalizeTPCSQL::GetScaleInfo(uint64_t run) { // check the cache - if (fScaleInfos.count(timestamp)) { - return fScaleInfos.at(timestamp); + if (fScaleInfos.count(run)) { + return fScaleInfos.at(run); } - // Lookup the data - fDB.UpdateData(timestamp*1e9); + // Look up the run + // + // Translate the run into a fake "timestamp" + fDB.UpdateData((run+1000000000)*1000000000); - // Collect the timestamp info + // Collect the run info ScaleInfo thisscale; // Iterate over the rows @@ -89,7 +91,7 @@ icarus::calo::NormalizeTPCSQL::ScaleInfo icarus::calo::NormalizeTPCSQL::GetScale thisscale.scale[ch] = scale; } // Set the cache - fScaleInfos[timestamp] = thisscale; + fScaleInfos[run] = thisscale; return thisscale; } diff --git a/icaruscode/TPC/Calorimetry/NormalizeTPC_tool.cc b/icaruscode/TPC/Calorimetry/NormalizeTPC_tool.cc index 906b44a07..85f071321 100644 --- a/icaruscode/TPC/Calorimetry/NormalizeTPC_tool.cc +++ b/icaruscode/TPC/Calorimetry/NormalizeTPC_tool.cc @@ -45,10 +45,10 @@ class NormalizeTPC : public INormalizeCharge }; // Helpers - ScaleInfo GetScaleInfo(uint64_t timestamp); - std::string URL(uint64_t timestamp); + ScaleInfo GetScaleInfo(uint64_t run); + std::string URL(uint64_t run); - // Cache timestamp requests + // Cache run requests std::map fScaleInfos; }; @@ -68,19 +68,19 @@ void icarus::calo::NormalizeTPC::configure(const fhicl::ParameterSet& pset) { fVerbose = pset.get("Verbose", false); } -std::string icarus::calo::NormalizeTPC::URL(uint64_t timestamp) { - return fURL + std::to_string(timestamp); +std::string icarus::calo::NormalizeTPC::URL(uint64_t run) { + return fURL + std::to_string(run); } -icarus::calo::NormalizeTPC::ScaleInfo icarus::calo::NormalizeTPC::GetScaleInfo(uint64_t timestamp) { +icarus::calo::NormalizeTPC::ScaleInfo icarus::calo::NormalizeTPC::GetScaleInfo(uint64_t run) { // check the cache - if (fScaleInfos.count(timestamp)) { - return fScaleInfos.at(timestamp); + if (fScaleInfos.count(run)) { + return fScaleInfos.at(run); } // Otherwise, look it up int error = 0; - std::string url = URL(timestamp); + std::string url = URL(run); if (fVerbose) std::cout << "NormalizeTPC Tool -- New Scale info, requesting data from url:\n" << url << std::endl; @@ -97,7 +97,7 @@ icarus::calo::NormalizeTPC::ScaleInfo icarus::calo::NormalizeTPC::GetScaleInfo(u << "). HTTP error status: " << getHTTPstatus(d) << ". HTTP error message: " << getHTTPmessage(d); } - // Collect the timestamp info + // Collect the run info ScaleInfo thisscale; // Number of rows @@ -128,7 +128,7 @@ icarus::calo::NormalizeTPC::ScaleInfo icarus::calo::NormalizeTPC::GetScaleInfo(u } // Set the cache - fScaleInfos[timestamp] = thisscale; + fScaleInfos[run] = thisscale; return thisscale; } @@ -136,7 +136,7 @@ icarus::calo::NormalizeTPC::ScaleInfo icarus::calo::NormalizeTPC::GetScaleInfo(u double icarus::calo::NormalizeTPC::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.time().timeHigh()); + ScaleInfo i = GetScaleInfo(e.id().runID().run()); // 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 d6755797e..8c1619bad 100644 --- a/icaruscode/TPC/Calorimetry/NormalizeYZSQL_tool.cc +++ b/icaruscode/TPC/Calorimetry/NormalizeYZSQL_tool.cc @@ -78,11 +78,11 @@ class NormalizeYZSQL : public INormalizeCharge ScaleBin const* findBin(const Point& point) const noexcept; }; - // Cache timestamp requests + // Cache run requests std::map fScaleInfos; // Helpers - const ScaleInfo& GetScaleInfo(uint64_t timestamp); + const ScaleInfo& GetScaleInfo(uint64_t run); }; DEFINE_ART_CLASS_TOOL(NormalizeYZSQL) @@ -153,16 +153,18 @@ icarus::calo::NormalizeYZSQL::NormalizeYZSQL(fhicl::ParameterSet const &pset): void icarus::calo::NormalizeYZSQL::configure(const fhicl::ParameterSet& pset) {} -const icarus::calo::NormalizeYZSQL::ScaleInfo& icarus::calo::NormalizeYZSQL::GetScaleInfo(uint64_t timestamp) { +const icarus::calo::NormalizeYZSQL::ScaleInfo& icarus::calo::NormalizeYZSQL::GetScaleInfo(uint64_t run) { // check the cache - if (fScaleInfos.count(timestamp)) { - return fScaleInfos.at(timestamp); + if (fScaleInfos.count(run)) { + return fScaleInfos.at(run); } - // Prep data - fDB.UpdateData(timestamp*1e9); + // Look up the run + // + // Translate the run into a fake "timestamp" + fDB.UpdateData((run+1000000000)*1000000000); - // Collect the timestamp info + // Collect the run info ScaleInfo thisscale; // Lookup the channels @@ -207,7 +209,7 @@ const icarus::calo::NormalizeYZSQL::ScaleInfo& icarus::calo::NormalizeYZSQL::Get std::sort(thisscale.bins.begin(), thisscale.bins.end()); // Set the cache - return fScaleInfos[timestamp] = std::move(thisscale); + return fScaleInfos[run] = std::move(thisscale); } diff --git a/icaruscode/TPC/Calorimetry/NormalizeYZ_tool.cc b/icaruscode/TPC/Calorimetry/NormalizeYZ_tool.cc index 2dbc919c9..be46495d7 100644 --- a/icaruscode/TPC/Calorimetry/NormalizeYZ_tool.cc +++ b/icaruscode/TPC/Calorimetry/NormalizeYZ_tool.cc @@ -57,10 +57,10 @@ class NormalizeYZ : public INormalizeCharge }; // Helpers - const ScaleInfo& GetScaleInfo(uint64_t timestamp); - std::string URL(uint64_t timestamp); + const ScaleInfo& GetScaleInfo(uint64_t run); + std::string URL(uint64_t run); - // Cache timestamp requests + // Cache run requests std::map fScaleInfos; }; @@ -80,19 +80,19 @@ void icarus::calo::NormalizeYZ::configure(const fhicl::ParameterSet& pset) { fVerbose = pset.get("Verbose", false); } -std::string icarus::calo::NormalizeYZ::URL(uint64_t timestamp) { - return fURL + std::to_string(timestamp); +std::string icarus::calo::NormalizeYZ::URL(uint64_t run) { + return fURL + std::to_string(run); } -const icarus::calo::NormalizeYZ::ScaleInfo& icarus::calo::NormalizeYZ::GetScaleInfo(uint64_t timestamp) { +const icarus::calo::NormalizeYZ::ScaleInfo& icarus::calo::NormalizeYZ::GetScaleInfo(uint64_t run) { // check the cache - if (fScaleInfos.count(timestamp)) { - return fScaleInfos.at(timestamp); + if (fScaleInfos.count(run)) { + return fScaleInfos.at(run); } // Otherwise, look it up int error = 0; - std::string url = URL(timestamp); + std::string url = URL(run); if (fVerbose) std::cout << "NormalizeYZ Tool -- New Scale info, requesting data from url:\n" << url << std::endl; @@ -109,7 +109,7 @@ const icarus::calo::NormalizeYZ::ScaleInfo& icarus::calo::NormalizeYZ::GetScaleI << "). HTTP error status: " << getHTTPstatus(d) << ". HTTP error message: " << getHTTPmessage(d); } - // Collect the timestamp info + // Collect the run info ScaleInfo thisscale; // Get the First row to get tzero @@ -132,18 +132,18 @@ const icarus::calo::NormalizeYZ::ScaleInfo& icarus::calo::NormalizeYZ::GetScaleI thisscale = scale; found_scale_t0 = true; - if (fVerbose) std::cout << "NormalizeYZ Tool -- Found prior matching T0 from timestamp: " << scale_pair.first << std::endl; + if (fVerbose) std::cout << "NormalizeYZ Tool -- Found prior matching T0 from run: " << scale_pair.first << std::endl; break; } } if (found_scale_t0) { - fScaleInfos[timestamp] = thisscale; - return fScaleInfos.at(timestamp); + fScaleInfos[run] = thisscale; + return fScaleInfos.at(run); } - // We haven't seen this timestamp before and we haven't seen the valid t0 before. + // We haven't seen this run before and we haven't seen the valid t0 before. // // Process the HTTP response thisscale.tzero = tzero; @@ -213,14 +213,14 @@ const icarus::calo::NormalizeYZ::ScaleInfo& icarus::calo::NormalizeYZ::GetScaleI } // Set the cache - fScaleInfos[timestamp] = thisscale; - return fScaleInfos.at(timestamp); + fScaleInfos[run] = thisscale; + return fScaleInfos.at(run); } double icarus::calo::NormalizeYZ::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.time().timeHigh()); + ScaleInfo i = GetScaleInfo(e.id().runID().run()); double scale = 1; bool found_bin = false;; diff --git a/icaruscode/TPC/Calorimetry/calorimetryICARUS.fcl b/icaruscode/TPC/Calorimetry/calorimetryICARUS.fcl index 449fda020..f59db9a83 100644 --- a/icaruscode/TPC/Calorimetry/calorimetryICARUS.fcl +++ b/icaruscode/TPC/Calorimetry/calorimetryICARUS.fcl @@ -13,6 +13,9 @@ icarus_calorimetryalgmc.CalAreaConstants: [0.01343, 0.01338, 0.01219] icarus_calorimetryalgdata.CalAreaConstants: @local::icarus_data_calconst icarus_calorimetryalgdata.CaloDoLifeTimeCorrection: false # handled by NormTools +icarus_calorimetryalgdata.ModBoxA: 0.906 +icarus_calorimetryalgdata.ModBoxBTF1: "[0]/TMath::Sqrt(TMath::Sin(x*TMath::Pi()/180)**2 + TMath::Cos(x*TMath::Pi()/180)**2/[1]**2)" +icarus_calorimetryalgdata.ModBoxBParam: [0.203, 1.25] standard_gnocchicaloicarus: { diff --git a/icaruscode/TPC/Calorimetry/icarus_data_recombination.fcl b/icaruscode/TPC/Calorimetry/icarus_data_recombination.fcl deleted file mode 100644 index 6b32d8ed5..000000000 --- a/icaruscode/TPC/Calorimetry/icarus_data_recombination.fcl +++ /dev/null @@ -1,7 +0,0 @@ -# Recombination floating, muon+proton fit -# services.DetectorPropertiesService.ModBoxAlpha: 0.939 -# services.DetectorPropertiesService.ModBoxBeta: 0.192 - -# Recombination fixed -services.DetectorPropertiesService.ModBoxAlpha: 0.93 -services.DetectorPropertiesService.ModBoxBeta: 0.212 diff --git a/icaruscode/TPC/Calorimetry/normtools_icarus.fcl b/icaruscode/TPC/Calorimetry/normtools_icarus.fcl index fb490e314..9e864019f 100644 --- a/icaruscode/TPC/Calorimetry/normtools_icarus.fcl +++ b/icaruscode/TPC/Calorimetry/normtools_icarus.fcl @@ -17,7 +17,7 @@ wirenorm: { yznorm: { tool_type: NormalizeYZ Timeout: 200 - URL: "https://dbdata0vm.fnal.gov:9443/icarus_con_prod/app/data?f=test_tpc_yz_correction_data&t=" + URL: "https://dbdata0vm.fnal.gov:9443/icarus_con_prod/app/data?f=tpc_yz_correction_data&t=" Verbose: false } @@ -44,14 +44,11 @@ tpcgain_sql: { tpcgain_local: { tool_type: NormalizeTPCLocal - # Recombination floating, muon+proton fit - # CalConstants: [81.04, 79.5, 82.88, 81.88] - # Recombination fixed, muon+proton fit - CalConstants: [80.32, 79.82, 82.24, 81.68] + # Relative normalization of the TPCs + CalConstants: [1.0118, 1.0000, 1.0333, 1.0230] Verbose: false } - yznorm_sql: { tool_type: NormalizeYZSQL DBFileName: tpc_yz_correction_data @@ -59,10 +56,11 @@ yznorm_sql: { Verbose: false } -# icarus_calonormtools: [@local::driftnorm, @local::yznorm, @local::tpcgain] -icarus_calonormtools: [@local::driftnorm_sql, @local::yznorm_sql, @local::tpcgain_local] +icarus_calonormtools: [@local::driftnorm, @local::yznorm, @local::tpcgain] +# icarus_calonormtools: [@local::driftnorm_sql, @local::yznorm_sql, @local::tpcgain_sql] -# The norm tools already take care of this -icarus_data_calconst: [1., 1., 1.] +# Gain with angular dep. recombination +# Assume equal on planes -- this is __wrong__ -- will need to be fixed when they are calibrated +icarus_data_calconst: [0.013316, 0.013316, 0.013316] END_PROLOG diff --git a/icaruscode/TPC/ICARUSWireCell/detsimmodules_wirecell_ICARUS.fcl b/icaruscode/TPC/ICARUSWireCell/detsimmodules_wirecell_ICARUS.fcl index 9c6993c62..3541a44ab 100644 --- a/icaruscode/TPC/ICARUSWireCell/detsimmodules_wirecell_ICARUS.fcl +++ b/icaruscode/TPC/ICARUSWireCell/detsimmodules_wirecell_ICARUS.fcl @@ -75,10 +75,8 @@ icarus_simwire_wirecell_fitSR.wcls_main.params.file_rcresp: "icarus_fnal_rc_tail # Add in the tuned field responses icarus_simwire_wirecell_fitSR.wcls_main.params.files_fields: "icarus_fnal_fit_ks.json.bz2" # futz with shaping+gain values (note these are really just scale factors and should not be taken literally) -icarus_simwire_wirecell_fitSR.wcls_main.structs.gain0: 10.2636323 # mV/fC -icarus_simwire_wirecell_fitSR.wcls_main.structs.gain1: 12.1420344 # mV/fC +icarus_simwire_wirecell_fitSR.wcls_main.structs.gain0: 11.9918701 # mV/fC +icarus_simwire_wirecell_fitSR.wcls_main.structs.gain1: 12.6181926 # mV/fC icarus_simwire_wirecell_fitSR.wcls_main.structs.gain2: 13.0261362 # mV/fC icarus_simwire_wirecell_fitSR.wcls_main.structs.shaping1: 1.45 # us - - END_PROLOG