Skip to content

Commit 948306d

Browse files
Merge pull request #647 from SBNSoftware/feature/lynnt_opt0finder_data
Add fcls to run OpT0Finder on data
2 parents c4bc4ae + 55b9d93 commit 948306d

5 files changed

Lines changed: 118 additions & 18 deletions

File tree

sbndcode/JobConfigurations/standard/reco/reco2_data.fcl

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
#include "crt_channel_map_service.fcl"
22
#include "crt_calib_service.fcl"
3+
#include "opt0finder_sbnd_data.fcl"
34
#include "standard_reco2_sbnd.fcl"
45

56
services:
@@ -16,10 +17,11 @@ physics.producers:
1617
crtclustering: @local::crtclusterproducer_data_sbnd
1718
crtspacepoints: @local::crtspacepointproducer_data_sbnd
1819
crttracks: @local::crttrackproducer_data_sbnd
20+
opt0finder: @local::sbnd_opt0_finder_data
1921
}
2022

2123
physics.reco2: [ pandora, pandoraTrack, pandoraShower, pandoraShowerSBN, pandoraCaloData, pandoraPidData, caloskimCalorimetry,
22-
crtclustering, crtspacepoints, crttracks, cvn ]
24+
crtclustering, crtspacepoints, crttracks, cvn, opt0finder]
2325

2426
physics.analyzers.caloskim.G4producer: ""
2527
physics.analyzers.caloskim.SimChannelproducer: ""

sbndcode/OpT0Finder/SBNDOpT0Finder_module.cc

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -631,6 +631,8 @@ bool SBNDOpT0Finder::ConstructLightClusters(art::Event& e, unsigned int tpc) {
631631
art::FindManyP<recob::SpacePoint> shw_to_spacepoints(shw_h, e, _shw_producer);
632632
art::FindManyP<recob::Hit> spacepoint_to_hits (spacepoint_h, e, _slice_producer);
633633

634+
art::FindOneP<larpandoraobj::PFParticleMetadata> pfp_to_metadata(pfp_h, e, _slice_producer);
635+
634636
// Loop over the Slices
635637
for (size_t n_slice = 0; n_slice < slice_h->size(); n_slice++) {
636638
flashmatch::QCluster_t light_cluster;
@@ -653,15 +655,17 @@ bool SBNDOpT0Finder::ConstructLightClusters(art::Event& e, unsigned int tpc) {
653655
std::vector<art::Ptr<recob::PFParticle>> pfp_v = slice_to_pfps.at(n_slice);
654656

655657
if (_select_nus){
656-
bool nu_pfp = false;
658+
bool found_clear_cosmic = false;
657659
for (size_t n_pfp = 0; n_pfp < pfp_v.size(); n_pfp++) {
658660
auto pfp = pfp_v[n_pfp];
659-
unsigned pfpPDGC = std::abs(pfp->PdgCode());
660-
if ((pfpPDGC == 12) || (pfpPDGC == 14) || (pfpPDGC == 16))
661-
nu_pfp = true;
661+
const auto meta = pfp_to_metadata.at(pfp.key());
662+
const auto props = meta->GetPropertiesMap();
663+
if (props.count("IsClearCosmic")){
664+
found_clear_cosmic = true;
665+
break;
666+
}
662667
}
663-
if (nu_pfp == false)
664-
break;
668+
if (found_clear_cosmic) continue;
665669
}
666670

667671
for (size_t n_pfp = 0; n_pfp < pfp_v.size(); n_pfp++) {

sbndcode/OpT0Finder/job/opt0finder_sbnd.fcl

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -70,17 +70,6 @@ sbnd_opt0_finder_one_to_many.FlashMatchConfig.QLLMatch.ChiErrorWidth: 0.1
7070
sbnd_opt0_finder_one_to_many.FlashMatchConfig.QLLMatch.UseMinuit: false # do not perform minimiziation!!; Minuit not needed for one-to-many matching
7171
sbnd_opt0_finder_one_to_many.FlashMatchConfig.QLLMatch.SaturatedThreshold: 2.5e3 # fix for saturated PMTs, determines when to evaluate non-linearities
7272

73-
# ... for TPC 0
74-
sbnd_opt0_finder_one_to_many_tpc0: @local::sbnd_opt0_finder_one_to_many
75-
sbnd_opt0_finder_one_to_many_tpc0.TPC: 0
76-
sbnd_opt0_finder_one_to_many_tpc0.OpFlashProducer: ["opflashtpc0","opflashtpc0xarapuca"]
77-
78-
# ... for TPC 1
79-
sbnd_opt0_finder_one_to_many_tpc1: @local::sbnd_opt0_finder_one_to_many
80-
sbnd_opt0_finder_one_to_many_tpc1.TPC: 1
81-
sbnd_opt0_finder_one_to_many_tpc1.OpFlashProducer: ["opflashtpc1","opflashtpc1xarapuca"]
82-
83-
8473
# WARNING: many-to-many matching is untested, performance unknown!
8574
#
8675
# Configuration to run the flash matching in many flashes to many slices configuration
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
#include "opt0finder_sbnd.fcl"
2+
3+
BEGIN_PROLOG
4+
5+
sbnd_opt0_finder_data: @local::sbnd_opt0_finder_one_to_many
6+
7+
sbnd_opt0_finder_data.CaloProducer: "pandoraCaloData"
8+
sbnd_opt0_finder_data.SelectNeutrino: true
9+
sbnd_opt0_finder_data.CalAreaConstants: [ 0.0204 , 0.0210, 0.0193 ]
10+
sbnd_opt0_finder_data.OpChannelsToSkip: [39, 66, 67, 69, 71, 85, 86, 87, 92, 115, 138, 141, 170, 197, 217, 218, 221, 222, 223, 226, 245, 248, 249, 302]
11+
# since the flash time is w.r.t the TDC ETRIG, this may move with light arrival; need to extend the flash window
12+
sbnd_opt0_finder_data.FlashVetoTimeStart: -1
13+
sbnd_opt0_finder_data.FlashVetoTimeEnd: 5
14+
15+
sbnd_opt0_finder_data.FlashMatchConfig.QLLMatch.ChiErrorWidth: 0.25 # increase the error width from 0.1
16+
sbnd_opt0_finder_data.FlashMatchConfig.PhotonLibHypothesis.GlobalQE: 0.25 # effectively a global scaling factor
17+
sbnd_opt0_finder_data.FlashMatchConfig.PhotonLibHypothesis.GlobalQERefl: 0.25 # effectively a global scaling factor
18+
19+
# set to arbitrary high value to ignore non-linearity correction until we know it better
20+
sbnd_opt0_finder_data.FlashMatchConfig.QLLMatch.SaturatedThreshold: 1e9
21+
22+
END_PROLOG
Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
#include "services_sbnd.fcl"
2+
#include "simulationservices_sbnd.fcl"
3+
#include "messages_sbnd.fcl"
4+
#include "sam_sbnd.fcl"
5+
6+
#include "opt0finder_sbnd_data.fcl"
7+
#include "opt0finderana_sbnd.fcl"
8+
9+
process_name: OpT0Finder
10+
11+
services:
12+
{
13+
# Load the service that manages root files for histograms.
14+
TFileService: { fileName: "opt0finder_tree.root" }
15+
RandomNumberGenerator: {}
16+
message: @local::sbnd_message_services_prod # from messages_sbnd.fcl
17+
FileCatalogMetadata: @local::sbnd_file_catalog_mc # from sam_sbnd.fcl
18+
@table::sbnd_services # from services_sbnd.fcl
19+
@table::sbnd_g4_services
20+
}
21+
22+
23+
#source is now a root file
24+
source:
25+
{
26+
module_type: RootInput
27+
maxEvents: -1 # Number of events to create
28+
}
29+
30+
31+
#block to define where the output goes. if you defined a filter in the physics
32+
#block and put it in the trigger_paths then you need to put a SelectEvents: {SelectEvents: [XXX]}
33+
#entry in the output stream you want those to go to, where XXX is the label of the filter module(s)
34+
outputs:
35+
{
36+
out1:
37+
{
38+
module_type: RootOutput
39+
fileName: "opt0finder-art.root"
40+
dataTier: "reconstructed"
41+
compressionLevel: 1
42+
SelectEvents: ["reco"]
43+
}
44+
}
45+
46+
# Define and configure some modules to do work on each event.
47+
# First modules are defined; they are scheduled later.
48+
# Modules are grouped by type.
49+
physics:
50+
{
51+
producers:
52+
{
53+
opt0finder: @local::sbnd_opt0_finder_data
54+
}
55+
56+
analyzers:
57+
{
58+
opt0finderana: @local::sbnd_opt0_finder_ana
59+
}
60+
61+
62+
#define the producer and filter modules for this path, order matters,
63+
#filters reject all following items. see lines starting physics.producers below
64+
reco: [
65+
opt0finder
66+
]
67+
68+
ana: [
69+
opt0finderana
70+
]
71+
72+
# define the output stream, there could be more than one if using filters
73+
stream1: [out1]
74+
75+
# trigger_paths is a keyword and contains the paths that modify the art::event,
76+
# ie filters and producers
77+
trigger_paths: [reco]
78+
79+
# end_paths is a keyword and contains the paths that do not modify the art::Event,
80+
# ie analyzers and output streams. these all run simultaneously
81+
end_paths: [ana, stream1]
82+
}
83+

0 commit comments

Comments
 (0)