Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Light sim+reco updates for SBN2022A release #253

Merged
merged 10 commits into from
Mar 24, 2022
11 changes: 2 additions & 9 deletions sbndcode/JobConfigurations/base/reco_sbnd.fcl
Original file line number Diff line number Diff line change
Expand Up @@ -211,14 +211,10 @@ physics:
, crthitt0
, crttrackt0
, fmatch
, opt0finder
, caloskimCalorimetry
]

# The new flashmatching will eventually be part of reco2, but for now
# we are keeping it separate here so we can easily remove if from the
# reco fcl files.
opticalt0: [ opt0finder ]

# Run caloskimmer to produce ntuples for calibration as part of reco2 chain

analyzers:{
Expand Down Expand Up @@ -265,10 +261,7 @@ outputs:
#Here we tell ART that we want to run both sequences of paths. This has to be done here as ART is not able to find the sequences while still wrapped in physics{ }
physics.fullreco: [ @sequence::physics.reco1,
@sequence::physics.reco2
#,opt0finder
]
physics.fullreco_noflashmatch: [ @sequence::physics.reco1,
@sequence::physics.reco2]
]

physics.trigger_paths: [ fullreco ]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ physics.simulate: [ rns
, loader
, largeant
, ionandscint
# , ionandscintout
, ionandscintout
, pdfastsim
# , pdfastsimout
, pdfastsimout
, simdrift
, filter # Adding filter
, mcreco
Expand Down
4 changes: 2 additions & 2 deletions sbndcode/JobConfigurations/standard/g4/g4_dirt_filter.fcl
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@

physics.simulate: [ rns
, ionandscint
# , ionandscintout
, ionandscintout
, pdfastsim
# , pdfastsimout
, pdfastsimout
, simdrift
, mcreco
, genericcrt
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ physics.simulate: [ rns
, loader
, largeant
, ionandscint
# , ionandscintout
, ionandscintout
, pdfastsim
# , pdfastsimout
, pdfastsimout
, simdrift
, filter # Adding filter
, mcreco
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ physics.simulate: [ rns
, loader
, largeant
, ionandscint
# , ionandscintout
, ionandscintout
, pdfastsim
# , pdfastsimout
, pdfastsimout
, simdrift
, filter # Adding filter
, mcreco
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ physics.simulate: [ rns
, loader
, largeant
, ionandscint
# , ionandscintout
, ionandscintout
, pdfastsim
# , pdfastsimout
, pdfastsimout
, simdrift
, filter # Adding filter
, mcreco
Expand Down
40 changes: 20 additions & 20 deletions sbndcode/JobConfigurations/standard/g4/g4_simphotontime_filter.fcl
Original file line number Diff line number Diff line change
Expand Up @@ -30,16 +30,16 @@ physics.producers.simdriftouttime.SimulationLabel: "ionandscintouttime:priorSCE"
physics.producers.genericcrtouttime.LArG4Label: "larg4outtime"

# Add processes for light simulation outside the active volume (AV) for the intimes
# physics.producers.ionandscintoutintime: @local::sbnd_ionandscint_out
# physics.producers.pdfastsimoutintime: @local::sbnd_pdfastsim_pvs
# physics.producers.ionandscintoutintime.InputModuleLabels: ["larg4intime"]
# physics.producers.pdfastsimoutintime.SimulationLabel: "ionandscintoutintime"
physics.producers.ionandscintoutintime: @local::sbnd_ionandscint_out
physics.producers.pdfastsimoutintime: @local::sbnd_pdfastsim_pvs
physics.producers.ionandscintoutintime.InputModuleLabels: ["larg4intime"]
physics.producers.pdfastsimoutintime.SimulationLabel: "ionandscintoutintime"

# Add processes for light simulation outside the active volume (AV) for the outtimes
# physics.producers.ionandscintoutouttime: @local::sbnd_ionandscint_out
# physics.producers.pdfastsimoutouttime: @local::sbnd_pdfastsim_pvs
# physics.producers.ionandscintoutouttime.InputModuleLabels: ["larg4outtime"]
# physics.producers.pdfastsimoutouttime.SimulationLabel: "ionandscintoutouttime"
physics.producers.ionandscintoutouttime: @local::sbnd_ionandscint_out
physics.producers.pdfastsimoutouttime: @local::sbnd_pdfastsim_pvs
physics.producers.ionandscintoutouttime.InputModuleLabels: ["larg4outtime"]
physics.producers.pdfastsimoutouttime.SimulationLabel: "ionandscintoutouttime"

# Add a process that merges the MCParticles
physics.producers.largeant: @local::sbnd_merge_sim_sources
Expand Down Expand Up @@ -67,9 +67,9 @@ physics.producers.pdfastsim.FillSimPhotons: true
physics.producers.pdfastsim.InputSourcesLabels: [ "pdfastsimintime", "pdfastsimouttime"]

# Add a process that merges the SimPhotons outside the AV
# physics.producers.pdfastsimout: @local::sbnd_merge_sim_sources
# physics.producers.pdfastsimout.FillSimPhotons: true
# physics.producers.pdfastsimout.InputSourcesLabels: [ "pdfastsimoutintime", "pdfastsimoutouttime"]
physics.producers.pdfastsimout: @local::sbnd_merge_sim_sources
physics.producers.pdfastsimout.FillSimPhotons: true
physics.producers.pdfastsimout.InputSourcesLabels: [ "pdfastsimoutintime", "pdfastsimoutouttime"]

# Add all these new modules to the simulate path
physics.simulate: [ rns
Expand All @@ -84,16 +84,16 @@ physics.simulate: [ rns
, simdriftouttime
, genericcrtouttime
### Simulate the light outside the AV
# , ionandscintoutintime
# , pdfastsimoutintime
# , ionandscintoutouttime
# , pdfastsimoutouttime
, ionandscintoutintime
, pdfastsimoutintime
, ionandscintoutouttime
, pdfastsimoutouttime
### Merge the intime and outtime paths
, largeant
, ionandscint
, simdrift
, pdfastsim
# , pdfastsimout
, pdfastsimout
, genericcrt
### Do truth-level reconstruction
, mcreco
Expand All @@ -117,11 +117,11 @@ outputs.out1.outputCommands: [ "keep *_*_*_*"
, "drop *_simdriftintime_*_*"
, "drop *_simdriftouttime_*_*"
# Drop IonAndScint Outside AV
# , "drop *_ionandscintoutintime_*_*"
# , "drop *_ionandscintoutouttime_*_*"
, "drop *_ionandscintoutintime_*_*"
, "drop *_ionandscintoutouttime_*_*"
# Drop PDFastSim Ouside AV
# , "drop *_pdfastsimoutintime_*_*"
# , "drop *_pdfastsimoutouttime_*_*"
, "drop *_pdfastsimoutintime_*_*"
, "drop *_pdfastsimoutouttime_*_*"
# Drop LArG4 AuxDetHits, now replaced by AuxDetSimChannels
, "drop sim::AuxDetHits_*_*_*"
]
Expand Down
4 changes: 2 additions & 2 deletions sbndcode/JobConfigurations/standard/reco/reco2_sce.fcl
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@

process_name: Reco2

physics.reco2_sce: [@sequence::physics.reco2, #opt0finder,
pandoraSCE, pandoraSCETrack, pandoraSCEShower, pandoraSCEShowerSBN, pandoraSCECalo, pandoraSCEPid, fmatchSCE]#, opt0finderSCE]
physics.reco2_sce: [@sequence::physics.reco2,
pandoraSCE, pandoraSCETrack, pandoraSCEShower, pandoraSCEShowerSBN, pandoraSCECalo, pandoraSCEPid, fmatchSCE, opt0finderSCE]

physics.trigger_paths: [ reco2_sce ]

Expand Down
10 changes: 4 additions & 6 deletions sbndcode/JobConfigurations/standard/standard_g4_sbnd.fcl
Original file line number Diff line number Diff line change
Expand Up @@ -74,15 +74,13 @@ physics:
ionandscint: @local::sbnd_ionandscint

# Creation of ionization electrons and scintillation photons, outside the active volume
# ionandscintout: @local::sbnd_ionandscint_out
ionandscintout: @local::sbnd_ionandscint_out

# Light propogation inside the active volume
pdfastsim: @local::sbnd_pdfastsim_par

# Light propogation outside the active volume
# Nov 16th, 2021
# Temporarily disable light simulation in the OUT-TPC (sbndcode issue 219)
# pdfastsimout: @local::sbnd_pdfastsim_pvs
pdfastsimout: @local::sbnd_pdfastsim_pvs

# Electron propogation
simdrift: @local::sbnd_simdrift
Expand All @@ -100,9 +98,9 @@ physics:
, loader
, largeant
, ionandscint
# , ionandscintout
, ionandscintout
, pdfastsim
# , pdfastsimout
, pdfastsimout
, simdrift
, mcreco
, genericcrt
Expand Down
3 changes: 1 addition & 2 deletions sbndcode/JobConfigurations/standard/standard_reco2_sbnd.fcl
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,5 @@

process_name: Reco2

physics.trigger_paths: [reco2 #, opticalt0
]
physics.trigger_paths: [ reco2 ]
physics.end_paths: [stream1, caloskimana]
3 changes: 3 additions & 0 deletions sbndcode/LArSoftConfigurations/PDFastSim_sbnd.fcl
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,9 @@ sbnd_pdfastsim_pvs.IncludePropTime: true
sbnd_pdfastsim_pvs.StoreReflected: true
sbnd_pdfastsim_pvs.ScintTimeTool.SlowDecayTime: 1300.0

# propagation times
sbnd_pdfastsim_pvs.VUVTiming: @local::sbnd_vuv_timing_parameterization_fast
sbnd_pdfastsim_pvs.VISTiming: @local::sbnd_vis_timing_parameterization


END_PROLOG
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,11 @@ sbnd_vuv_timing_parameterization:
angle_bin_timing_vuv: 45
}

// faster, lower precision case for external argon volume (hybrid model)
sbnd_vuv_timing_parameterization_fast: @local::sbnd_vuv_timing_parameterization
sbnd_vuv_timing_parameterization_fast.step_size: 5.
sbnd_vuv_timing_parameterization_fast.angle_bin_timing_vuv: 90


# VUV/DIRECT LIGHT: NUMBER OF HITS CORRECTIONS
# SBND Gaisser-Hillas
Expand Down
16 changes: 8 additions & 8 deletions sbndcode/LArSoftConfigurations/photpropservices_sbnd.fcl
Original file line number Diff line number Diff line change
Expand Up @@ -95,17 +95,17 @@ sbnd_library_for_hybrid_mode_photonvisibilityservice:
{
@table::sbnd_library_vuv_vis_prop_timing_photonvisibilityservice
LibraryFile: "OpticalLibrary/SBND_OpLibOUT_v2.00.root"
NX: 66
NY: 56
NX: 104
NY: 54
NZ: 71
UseCryoBoundary: false
# IF UseCryoBoundary is set to false, so use the following parameters.
XMin: -264
XMax: 264
YMin: -280
YMax: 280
ZMin: -60
ZMax: 650
XMin: -261.69
XMax: 261.69
YMin: -275.0382
YMax: 275.0382
ZMin: -59.9294
ZMax: 649.2353
}


Expand Down
18 changes: 15 additions & 3 deletions sbndcode/OpT0Finder/SBNDOpT0Finder_module.cc
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@
#include "lardataobj/AnalysisBase/T0.h"
#include "larcore/Geometry/Geometry.h"

#include "larsim/PhotonPropagation/SemiAnalyticalModel.h"

#include "larpandora/LArPandoraInterface/LArPandoraHelper.h"

#include "sbncode/OpT0Finder/flashmatch/Base/OpT0FinderTypes.h"
Expand Down Expand Up @@ -87,6 +89,10 @@ class SBNDOpT0Finder : public art::EDProducer {
/// Returns a list of uncoated PMTs that are a subset of those in ch_to_use
std::vector<int> GetUncoatedPTMList(std::vector<int> ch_to_use);

std::unique_ptr<SemiAnalyticalModel> _semi_model;
fhicl::ParameterSet _vuv_params;
fhicl::ParameterSet _vis_params;

::flashmatch::FlashMatchManager _mgr; ///< The flash matching manager
std::vector<flashmatch::FlashMatch_t> _result_v; ///< Matching result will be stored here

Expand Down Expand Up @@ -137,6 +143,10 @@ SBNDOpT0Finder::SBNDOpT0Finder(fhicl::ParameterSet const& p)

::art::ServiceHandle<geo::Geometry> geo;

_vuv_params = p.get<fhicl::ParameterSet>("VUVHits");
_vis_params = p.get<fhicl::ParameterSet>("VIVHits");
_semi_model = std::make_unique<SemiAnalyticalModel>(_vuv_params, _vis_params, true, false);

_opflash_producer_v = p.get<std::vector<std::string>>("OpFlashProducers");
_tpc_v = p.get<std::vector<unsigned int>>("TPCs");
_slice_producer = p.get<std::string>("SliceProducer");
Expand All @@ -162,6 +172,7 @@ SBNDOpT0Finder::SBNDOpT0Finder(fhicl::ParameterSet const& p)

_mgr.SetUncoatedPMTs(_uncoated_pmts);

_mgr.SetSemiAnalyticalModel(std::move(_semi_model));

_flash_spec.resize(geo->NOpDets(), 0.);
_hypo_spec.resize(geo->NOpDets(), 0.);
Expand Down Expand Up @@ -303,20 +314,20 @@ void SBNDOpT0Finder::DoMatch(art::Event& e,

// Don't waste time if there are no flashes
if (n_flashes == 0) {
mf::LogWarning("SBNDOpT0Finder") << "Zero good flashes in this event." << std::endl;
mf::LogInfo("SBNDOpT0Finder") << "Zero good flashes in this event." << std::endl;
return;
}

// Get all the ligh clusters
// auto light_cluster_v = GetLighClusters(e);
if (!ConstructLightClusters(e, tpc)) {
mf::LogWarning("SBNDOpT0Finder") << "Cannot construct Light Clusters." << std::endl;
mf::LogInfo("SBNDOpT0Finder") << "Cannot construct Light Clusters." << std::endl;
return;
}

// Don't waste time if there are no clusters
if (!_light_cluster_v.size()) {
mf::LogWarning("SBNDOpT0Finder") << "No slices to work with." << std::endl;
mf::LogInfo("SBNDOpT0Finder") << "No slices to work with in TPC " << tpc << "." << std::endl;
return;
}

Expand Down Expand Up @@ -345,6 +356,7 @@ void SBNDOpT0Finder::DoMatch(art::Event& e,

mf::LogInfo("SBNDOpT0Finder") << "Matched TPC object " << _tpcid
<< " with flash number " << _flashid
<< " in TPC " << tpc
<< " -> score: " << _score
<< ", qll xmin: " << _qll_xmin << std::endl;

Expand Down
4 changes: 4 additions & 0 deletions sbndcode/OpT0Finder/job/opt0finder_sbnd.fcl
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#include "flashmatchalg.fcl"
#include "opticalsimparameterisations_sbnd.fcl"

BEGIN_PROLOG

Expand All @@ -15,6 +16,9 @@ sbnd_opt0_finder:
PhotoDetectors: ["pmt_coated", "pmt_uncoated"]
TPC: 0

VUVHits: @local::sbnd_vuv_RS100cm_hits_parameterization
VIVHits: @local::sbnd_vis_RS100cm_hits_parameterization

FlashMatchConfig: @local::flashmatch_config

ChargeToNPhotonsTrack: 39 # (1 / 0.0201293) e-/ADC*time_ticks x
Expand Down
2 changes: 1 addition & 1 deletion ups/product_deps
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ fwdir product_dir scripts

product version
sbncode v09_37_02
sbnd_data v01_10_00 - optional
sbnd_data v01_11_00 - optional
sbndutil v09_37_01_01 - optional

# list products required ONLY for the build
Expand Down