Skip to content

Commit 18876a7

Browse files
committed
add fcl param on whether to fill TTree, add more comments, remove unused headers
1 parent 8f48fed commit 18876a7

3 files changed

Lines changed: 33 additions & 25 deletions

File tree

sbndcode/Calorimetry/LightCaloProducer_module.cc

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,11 +63,9 @@
6363
#include "TTree.h"
6464

6565
// C++ includes
66-
#include <numeric>
6766
#include <memory>
6867
#include <algorithm> // sort
6968
#include <cmath>
70-
#include <functional>
7169
#include <map>
7270
#include <string>
7371

@@ -98,6 +96,9 @@ class sbnd::LightCaloProducer : public art::EDProducer {
9896
std::unique_ptr< art::Assns<recob::Slice, sbn::LightCalo> >& slice_assn_v,
9997
std::unique_ptr< art::Assns<recob::OpFlash, sbn::LightCalo> >& flash_assn_v);
10098

99+
// Templated member function to collect matched slices and opflashes
100+
// The CheckFunc is a callable that takes a Ptr<MatchT> and returns bool
101+
// to determine if the match passes selection criteria
101102
template <typename MatchT, typename CheckFunc>
102103
void CollectMatches(const art::Handle<std::vector<MatchT>> &handle,
103104
const std::vector<art::Ptr<MatchT>> &fm_v,
@@ -108,6 +109,7 @@ class sbnd::LightCaloProducer : public art::EDProducer {
108109
std::vector<art::Ptr<recob::OpFlash>> &match_op1,
109110
CheckFunc check);
110111

112+
// Finds the opflash in flash_v that is closest in time to ref_time
111113
art::Ptr<recob::OpFlash> FindMatchingFlash(const std::vector<art::Ptr<recob::OpFlash>> &flash_v,
112114
double ref_time);
113115
// Returns visibility vector for all opdets given charge/position information
@@ -134,6 +136,7 @@ class sbnd::LightCaloProducer : public art::EDProducer {
134136
bool fuse_bcfm;
135137
bool fuse_opt0;
136138
bool fverbose;
139+
bool ffill_tree;
137140

138141
float fbcfmscore_cut;
139142
float fopt0score_cut;
@@ -211,6 +214,7 @@ sbnd::LightCaloProducer::LightCaloProducer(fhicl::ParameterSet const& p)
211214
fuse_bcfm = p.get<bool>("UseBCFM");
212215

213216
fverbose = p.get<bool>("Verbose");
217+
ffill_tree = p.get<bool>("FillTree");
214218

215219
fbcfmscore_cut = p.get<float>("bcfmScoreCut");
216220
fopt0score_cut = p.get<float>("opt0ScoreCut");
@@ -608,7 +612,8 @@ void sbnd::LightCaloProducer::CalculateCalorimetry(art::Event& e,
608612
util::CreateAssn(*this, e, *lightcalo_v, opflash0, *flash_assn_v);
609613
util::CreateAssn(*this, e, *lightcalo_v, opflash1, *flash_assn_v);
610614

611-
_tree->Fill();
615+
if (ffill_tree)
616+
_tree->Fill();
612617
} // end slice loop
613618
} // end produce
614619

sbndcode/Calorimetry/lightcalo_sbnd.fcl

Lines changed: 22 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -13,31 +13,32 @@ sbnd_lightcalo:
1313
VIVHits: @local::sbnd_vis_RS100cm_hits_parameterization
1414
OpticalPathTool: @local::SBNDOpticalPath
1515

16-
OpFlashProducers: ["opflashtpc0", "opflashtpc1"]
17-
OpFlashAraProducers: ["opflashtpc0xarapuca", "opflashtpc1xarapuca"]
16+
OpFlashProducers: ["opflashtpc0", "opflashtpc1"]
17+
OpFlashAraProducers: ["opflashtpc0xarapuca", "opflashtpc1xarapuca"]
1818
# only validated for coated PMTs for now
19-
PDTypes: ["pmt_coated"] # "pmt_uncoated", "xarapuca_vuv", "xarapuca_vis"
19+
PDTypes: ["pmt_coated"] # "pmt_uncoated", "xarapuca_vuv", "xarapuca_vis"
2020

21-
SliceProducer: "pandora"
22-
OpT0FinderProducer: "opt0finder"
23-
BCFMProducer: "tpcpmtbarycentermatching"
21+
SliceProducer: "pandora"
22+
OpT0FinderProducer: "opt0finder"
23+
BCFMProducer: "tpcpmtbarycentermatching"
2424

25-
UseBCFM: true
26-
UseOpT0Finder: false
27-
Verbose: false
25+
UseBCFM: true
26+
UseOpT0Finder: false
27+
Verbose: false
28+
FillTree: false
2829

29-
bcfmScoreCut: 0.02 # default: accept bcfm match > bcfmScoreCut
30-
opt0ScoreCut: 200 # default: accept opt0 match > opt0ScoreCut
31-
opt0FractionalCut: 0.5
30+
bcfmScoreCut: 0.02 # default: accept bcfm match > bcfmScoreCut
31+
opt0ScoreCut: 200 # default: accept opt0 match > opt0ScoreCut
32+
opt0FractionalCut: 0.5
3233

33-
OpFlashMin: 0.0 # in us, simulation [0.0], light-triggered data [-0.8]
34-
OpFlashMax: 2.0 # in us, simulation [2.0], light-triggered data [2.0]
34+
OpFlashMin: 0.0 # in us, simulation [0.0], light-triggered data [-0.8]
35+
OpFlashMax: 2.0 # in us, simulation [2.0], light-triggered data [2.0]
3536

3637
# flash parameters
37-
FlashOffset: 0.05 # in us, acceptable offset between the t0 between TPCs or between PMTs/X-ARAPUCAs
38-
FlashNoiseThreshold: [ 600., 1500. ] # in PE, {PMT, xARAPUCA}, flash total PE threshold to ignore a flash
39-
OpDetMaxPEThreshold: [4000., 1e9] # in PE, PE in a single opdet to ignore (due to saturation effects)
40-
OpDetMask: [] # list of opdet channels to ignore (off/non-reconstructable PMTs are already identified via calibration db)
38+
FlashOffset: 0.05 # in us, acceptable offset between the t0 between TPCs or between PMTs/X-ARAPUCAs
39+
FlashNoiseThreshold: [ 600., 1500. ] # in PE, {PMT, xARAPUCA}, flash total PE threshold to ignore a flash
40+
OpDetMaxPEThreshold: [4000., 1e9] # in PE, PE in a single opdet to ignore (due to saturation effects)
41+
OpDetMask: [] # list of opdet channels to ignore (off/non-reconstructable PMTs are already identified via calibration db)
4142

4243
# calibration constants & simulation parameters
4344
CalAreaConstants: @local::sbnd_calorimetryalgmc.CalAreaConstants
@@ -48,9 +49,9 @@ sbnd_lightcalo:
4849
PMTCoatedVUVEff_tpc1: @local::sbnd_digipmt_alg.PMTCoatedVUVEff_tpc1
4950
PMTUncoatedEff_tpc1: @local::sbnd_digipmt_alg.PMTUncoatedEff_tpc1
5051

51-
XArapucaVUVVUVEff: @local::sbnd_digiarapuca_alg.XArapucaVUVEffVUV
52-
XArapucaVUVVISEff: @local::sbnd_digiarapuca_alg.XArapucaVUVEffVis
53-
XArapucaVISEff: @local::sbnd_digiarapuca_alg.XArapucaVISEff
52+
XArapucaVUVVUVEff: @local::sbnd_digiarapuca_alg.XArapucaVUVEffVUV
53+
XArapucaVUVVISEff: @local::sbnd_digiarapuca_alg.XArapucaVUVEffVis
54+
XArapucaVISEff: @local::sbnd_digiarapuca_alg.XArapucaVISEff
5455
}
5556

5657
sbnd_lightcalo_sce: @local::sbnd_lightcalo

sbndcode/Calorimetry/run_lightcalo.fcl

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,4 +54,6 @@ physics:
5454
# end_paths is a keyword and contains the paths that do not modify the art::Event,
5555
# ie analyzers and output streams. these all run simultaneously
5656
end_paths: [stream1]
57-
}
57+
}
58+
59+
physics.producers.lightcalo.FillTree: true

0 commit comments

Comments
 (0)