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

Refactor reco2 workflow, and promote standard_reco2_sbnd.fcl back to the main workflow again #528

Open
wants to merge 7 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions sbndcode/Commissioning/fcls/reco2_sce_comm.fcl
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As with the reco1 changes, the name should be reco2_comm.fcl

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include "reco2_sce.fcl"
#include "standard_reco2_sbnd.fcl"

process_name: Reco2Comm

Expand All @@ -9,4 +9,4 @@ outputs.out1.outputCommands: [ "keep *_*_*_*"
# , "drop sim::OpDetBacktrackerRecords_*_*_*"
, "drop *_linecluster_*_*"
# , "drop *_fasthit_*_*"
]
]
9 changes: 6 additions & 3 deletions sbndcode/JobConfigurations/README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
# SBND Core FHiCL Files

4th October 2024 (Dom Brailsford)
`standard_reco2_sbnd.fcl` has been promoted back to an up-to-date fcl and has rejoined the standard workflow
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Might be good to explicitly mention that sce is now included in standard_reco2_sbnd.fcl for completion/documentation sake here!

15th July 2024 (Dom Brailsford)
`standard_reco1_sbnd.fcl` has been promoted back to an up-to-date fcl so can be used as part of any standard workflow. The below suggested workflows have been updated to include this information.


The intended operation of the fcl workflows is that the `standard-*` fcls run the standard workflow. This isn't currently true and should be acknowledged here. The WireCell 2D TPC simulation/signal processing workflow has now been implemented into the `standard-*` fcls, and the 1D simulation is now deprecated. The main deviation of the *core* workflow (described below) from the `standard-*` fcls is the inclusion of the space charge simulation. The *core* workflow also includes the dropping of some heavy data products (hence the `lite` suffix).

At the time of writing, the core workflow (for BNB + Dirt + Cosmics) is the following:
Expand All @@ -11,23 +14,23 @@ At the time of writing, the core workflow (for BNB + Dirt + Cosmics) is the foll
- `g4_sce_dirt_filter_lite.fcl` (does not include TPC electron drift simulation)
- `detsim_sce_lite.fcl` (includes TPC drift simulation, TPC electronics simulation, and signal processing)
- `standard_reco1_sbnd.fcl`
- `reco2_sce.fcl`
- `standard_reco2_sbnd.fcl`

The intime workflow is as follows:

- `prodcorsika_proton_intime_filter_sce.fcl`
- `g4_sce_simphotontime_filter_lite.fcl`
- `detsim_sce_lite.fcl`
- `standard_reco1_sbnd.fcl`
- `reco2_sce.fcl`
- `standard_reco2_sbnd.fcl`

For single generator workflows (like intrinsic neutrino samples) the workflow is the following:

- `<your-gen>.fcl`
- `g4_sce_lite.fcl`
- `detsim_sce_lite.fcl`
- `standard_reco1_sbnd.fcl`
- `reco2_sce.fcl`
- `standard_reco2_sbnd.fcl`

This may well change over the coming months, and this README should be updated to reflect this.

Expand Down
11 changes: 11 additions & 0 deletions sbndcode/JobConfigurations/standard/reco/config/drops_reco2.fcl
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#outputs configuration
#
#include "drops_reco1.fcl"

BEGIN_PROLOG

sbnd_reco2_drops: [
@sequence::sbnd_reco1_drops
]

END_PROLOG
169 changes: 169 additions & 0 deletions sbndcode/JobConfigurations/standard/reco/config/workflow_reco2.fcl
Original file line number Diff line number Diff line change
@@ -0,0 +1,169 @@
# module configuration
#
#include "pandoramodules_sbnd.fcl"
#include "calorimetry_sbnd.fcl"
#include "sbnd_flashfinder_deco.fcl"
#include "crtrecoproducers_sbnd.fcl"
#include "particleid_sbnd.fcl"
#include "crttpcmatchingproducers_sbnd.fcl"

#include "scecorrections.fcl"
#include "flashmatch_sbnd.fcl"

#include "opt0finder_sbnd.fcl"

#include "sbnd_trackcalo_skimmer.fcl"
#include "crtskim_sbnd.fcl"
#include "pmtskim_sbnd.fcl"

BEGIN_PROLOG

sbnd_reco2_producers:{
### random number saver
rns: { module_type: RandomNumberSaver }

### pandora
pandora: @local::sbnd_pandora
pandoraTrack: @local::sbnd_pandoraTrackCreation
pandoraShower: @local::sbnd_incremental_pandoraModularShowerCreation
pandoraShowerSBN: @local::sbnd_sbn_pandoraModularShowerCreation
pandoraCalo: @local::sbnd_gnewcalomc
pandoraPid: @local::sbnd_chi2pid

pandoraSCECalo: @local::sbnd_gnewcalomc
pandoraSCEPid: @local::sbnd_chi2pid

pandoraCaloData: @local::sbnd_gnewcalodata
pandoraPidData: @local::sbnd_chi2pid

### SCE-aware pandora:
pandoraSCE: @local::scecorrection
pandoraSCETrack: @local::sbnd_pandoraTrackCreation
pandoraSCEShower: @local::sbnd_sce_incremental_pandoraModularShowerCreation
pandoraSCEShowerSBN: @local::sbnd_sce_sbn_pandoraModularShowerCreation

### CRT reconstruction
crtclustering: @local::crtclusterproducer_sbnd
crtspacepoints: @local::crtspacepointproducer_sbnd
crttracks: @local::crttrackproducer_sbnd

### CRT-TPC matching
crtspacepointmatching: @local::crtspacepointmatchproducer_sbnd
crttrackmatching: @local::crttrackmatchproducer_sbnd
crtspacepointmatchingSCE: @local::crtspacepointmatchproducer_sbnd
crttrackmatchingSCE: @local::crttrackmatchproducer_sbnd

### flash-matching
fmatch: @local::sbnd_simple_flashmatch
fmatchSCE: @local::sbnd_simple_flashmatch_sce
fmatchop: @local::sbnd_simple_flashmatch_op
fmatchopSCE: @local::sbnd_simple_flashmatch_op_sce
fmatchara: @local::sbnd_simple_flashmatch_ara
fmatcharaSCE: @local::sbnd_simple_flashmatch_ara_sce
fmatchopara: @local::sbnd_simple_flashmatch_opara
fmatchoparaSCE: @local::sbnd_simple_flashmatch_opara_sce
opt0finder: @local::sbnd_opt0_finder_one_to_many
opt0finderSCE: @local::sbnd_opt0_finder_one_to_many

### Uncalibrated calorimetry producer for calibration caloskimmer
caloskimCalorimetry: @local::caloskim_calorimetry
}

sbnd_reco2_producer_sequence: [
rns
, pandora
, pandoraTrack
, pandoraShower
, pandoraShowerSBN
, pandoraCalo
, pandoraPid
, crtclustering
, crtspacepoints
, crttracks
, crtspacepointmatching
, crttrackmatching
, fmatch
, fmatchop
, fmatchara
, fmatchopara
, caloskimCalorimetry
, opt0finder
, pandoraSCE
, pandoraSCETrack
, pandoraSCEShower
, pandoraSCEShowerSBN
, pandoraSCECalo
, pandoraSCEPid
, crtspacepointmatchingSCE
, crttrackmatchingSCE
, fmatchSCE
, fmatchopSCE
, fmatcharaSCE
, fmatchoparaSCE
, opt0finderSCE
]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm just going to mention here that we've often talked about moving a lot of the producers currently run in the CAF stage into reco2 (CRUMBS, stubs, the MCS tool, the PID BDTs etc).

This shouldn't be part of this PR as this is meant to reorganise whilst maintaining behaviour. But now that this workflow fcl is nice & clean, we should look at doing this soon.


#FIXME override the producer labels. This should really happen in the module's config fcl
sbnd_reco2_producers.pandoraCalo.TrackModuleLabel: "pandoraTrack"
sbnd_reco2_producers.pandoraCalo.FieldDistortion: false
sbnd_reco2_producers.pandoraCalo.FieldDistortionEfield: false
sbnd_reco2_producers.pandoraCalo.TrackIsFieldDistortionCorrected: false
sbnd_reco2_producers.pandoraPid.TrackModuleLabel: "pandoraTrack"
sbnd_reco2_producers.pandoraPid.CalorimetryModuleLabel: "pandoraCalo"

sbnd_reco2_producers.pandoraSCECalo.TrackModuleLabel: "pandoraSCETrack"
sbnd_reco2_producers.pandoraSCECalo.FieldDistortion: true
sbnd_reco2_producers.pandoraSCECalo.FieldDistortionEfield: true
sbnd_reco2_producers.pandoraSCECalo.TrackIsFieldDistortionCorrected:true
sbnd_reco2_producers.pandoraSCEPid.TrackModuleLabel: "pandoraSCETrack"
sbnd_reco2_producers.pandoraSCEPid.CalorimetryModuleLabel: "pandoraSCECalo"

sbnd_reco2_producers.pandoraCaloData.TrackModuleLabel: "pandoraTrack"
sbnd_reco2_producers.pandoraCaloData.FieldDistortion: false
sbnd_reco2_producers.pandoraCaloData.FieldDistortionEfield: false
sbnd_reco2_producers.pandoraCaloData.TrackIsFieldDistortionCorrected: false
sbnd_reco2_producers.pandoraPidData.TrackModuleLabel: "pandoraTrack"
sbnd_reco2_producers.pandoraPidData.CalorimetryModuleLabel: "pandoraCaloData"

physics.analyzers.caloskim.SimChannelproducer: "simtpc2d:simpleSC"

sbnd_reco2_producers.opt0finderSCE.SliceProducer: "pandoraSCE"
sbnd_reco2_producers.opt0finderSCE.TrackProducer: "pandoraSCETrack"
sbnd_reco2_producers.opt0finderSCE.ShowerProducer: "pandoraSCEShowerSBN"
sbnd_reco2_producers.opt0finderSCE.CaloProducer: "pandoraSCECalo"

# Configure the SCE corrections
# For now: always assume t = 0
sbnd_reco2_producers.pandoraSCE.T0Labels: []
sbnd_reco2_producers.pandoraSCE.T0LabelsCorrectT0: []
sbnd_reco2_producers.pandoraSCE.CorrectNoT0Tag: true
# point track/shower creation to the SCE pandora
sbnd_reco2_producers.pandoraSCETrack.PFParticleLabel: "pandoraSCE"
sbnd_reco2_producers.pandoraSCEShower.PFParticleLabel: "pandoraSCE"
sbnd_reco2_producers.pandoraSCEShowerSBN.PFParticleLabel: "pandoraSCE"

sbnd_reco2_producers.crtspacepointmatchingSCE.TPCTrackModuleLabel: "pandoraSCETrack"
sbnd_reco2_producers.crtspacepointmatchingSCE.PFPModuleLabel: "pandoraSCE"
sbnd_reco2_producers.crtspacepointmatchingSCE.MatchingAlg.TPCTrackLabel: "pandoraSCETrack"

sbnd_reco2_producers.crttrackmatchingSCE.TPCTrackModuleLabel: "pandoraSCETrack"
sbnd_reco2_producers.crttrackmatchingSCE.PFPModuleLabel: "pandoraSCE"
sbnd_reco2_producers.crttrackmatchingSCE.MatchingAlg.TPCTrackLabel: "pandoraSCETrack"

sbnd_reco2_analyzers: {
caloskim: @local::caloskim_nodigits_goldentracks
crtskim: @local::crtskim_sbnd
pmtskim: @local::pmtskim_sbnd
}

sbnd_reco2_analyzer_sequence: [
caloskim
, pmtskim
, crtskim
]

#FIXME override the analyzer labels. This should really happen in the module's config fcl
sbnd_reco2_analyzers.caloskim.SimChannelproducer: "simtpc2d:simpleSC"

END_PROLOG

4 changes: 2 additions & 2 deletions sbndcode/JobConfigurations/standard/reco/reco2_data.fcl
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
#include "reco2_sce.fcl"
#include "standard_reco2_sbnd.fcl"

services:
{
@table::services
@table::sbnd_data_services
}

physics.reco2_sce: [pandora, pandoraTrack, pandoraShower, pandoraShowerSBN, pandoraCaloData, pandoraPidData, caloskimCalorimetry]
physics.reco2: [pandora, pandoraTrack, pandoraShower, pandoraShowerSBN, pandoraCaloData, pandoraPidData, caloskimCalorimetry]
physics.analyzers.caloskim.G4producer: ""
physics.analyzers.caloskim.SimChannelproducer: ""
physics.caloskimana_tpconly: [ caloskim ]
Expand Down
25 changes: 0 additions & 25 deletions sbndcode/JobConfigurations/standard/reco/reco2_sce.fcl

This file was deleted.

45 changes: 33 additions & 12 deletions sbndcode/JobConfigurations/standard/standard_reco2_sbnd.fcl
Original file line number Diff line number Diff line change
@@ -1,16 +1,37 @@
# File: standard_reco2_sbnd.fcl
# Purpose: The standard reconstruction workflow for 'reco2', starts at 2D clustering and includes all high level reconstruction
# Version: 1.0
#
# Changes:
# 20200923 ([email protected]) [v1.0]
# Initial definition
#
# job configuration

#include "reco_sbnd.fcl"
#
#include "workflow_reco2.fcl"
#include "drops_reco2.fcl"
#include "simulationservices_sbnd.fcl"
#include "generic_job_sbnd.fcl"

process_name: Reco2

physics.trigger_paths: [ reco2 ]
physics.end_paths: [stream1, caloskimana]
#services overrides
services:
{
@table::services
@table::sbnd_random_services
@table::sbnd_g4_services
# FIXME The following services are temporarily included here to test tht the workflow is unchanged
LArFFT: @local::sbnd_larfft
SignalShapingServiceSBND: @local::sbnd_signalshapingservice
BackTrackerService: @local::sbnd_backtrackerservice
ParticleInventoryService: @local::sbnd_particleinventoryservice
Comment on lines +16 to +20
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And the longer term plan would be to move these into a table?

}

#physics table overrides
physics.producers: @local::sbnd_reco2_producers
physics.reco2: @local::sbnd_reco2_producer_sequence
physics.trigger_paths: [ reco2 ]
#analysers
physics.analyzers: @local::sbnd_reco2_analyzers
physics.ana: @local::sbnd_reco2_analyzer_sequence
physics.end_paths: [ @sequence::physics.end_paths, ana ]

#outputs table overrides
outputs.out1.dataTier: "reconstructed"
outputs.out1.outputCommands: [@sequence::outputs.out1.outputCommands, @sequence::sbnd_reco2_drops]

#FIXME permanently enable SCE in a service rather than override specific params in this way...
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe we can delete this #FIXME line now since it looks like enabling SCE is through a service?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think Dom just means make it the default right? Rather than overrides at the bottom?

#include "enable_spacecharge_services_sbnd.fcl"
2 changes: 1 addition & 1 deletion test/ci/fcl_file_checks.list
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@ g4_sce.fcl
g4_sce_dirt_filter.fcl
detsim_sce.fcl
standard_reco1_sbnd.fcl
reco2_sce.fcl
standard_reco2_sbnd.fcl
cafmakerjob_sbnd_sce_systtools_and_fluxwgt.fcl
2 changes: 1 addition & 1 deletion test/ci/sbnd_ci_nucosmics_reco2_quick_test_sbndcode.fcl
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#include "reco2_sce.fcl"
#include "standard_reco2_sbnd.fcl"

services.NuRandomService.policy: "perEvent"
2 changes: 1 addition & 1 deletion test/ci/sbnd_ci_single_reco2_quick_test_sbndcode.fcl
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include "reco2_sce.fcl"
#include "standard_reco2_sbnd.fcl"

# rig the output file name to be the one expected by the C.I. configuration
services.TFileService.fileName: "standard_g4_sbnd_Reco-current_hist.root"
Expand Down