Skip to content

Commit 193666b

Browse files
committed
Merge branch 'feature/lynnt_lightcalorimetry' into feature/lynnt_lightcalorimetry_dev
2 parents d10e1ae + 6432861 commit 193666b

7 files changed

Lines changed: 84 additions & 53 deletions

File tree

sbndcode/Calorimetry/LightCaloProducer_module.cc

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,10 @@
5454
#include "sbnobj/Common/Reco/OpT0FinderResult.h"
5555
#include "sbnobj/Common/Reco/TPCPMTBarycenterMatch.h"
5656

57+
// Calibration database includes
58+
#include "sbndcode/Calibration/PDSDatabaseInterface/PMTCalibrationDatabase.h"
59+
#include "sbndcode/Calibration/PDSDatabaseInterface/IPMTCalibrationDatabaseService.h"
60+
5761
// ROOT includes
5862
#include "TFile.h"
5963
#include "TTree.h"
@@ -134,7 +138,6 @@ class sbnd::LightCaloProducer : public art::EDProducer {
134138
bool fuse_opt0;
135139
bool fverbose;
136140

137-
float fnuscore_cut;
138141
float fbcfmscore_cut;
139142
float fopt0score_cut;
140143

@@ -156,6 +159,8 @@ class sbnd::LightCaloProducer : public art::EDProducer {
156159
fhicl::ParameterSet fvis_params;
157160
std::shared_ptr<phot::OpticalPath> foptical_path_tool;
158161

162+
sbndDB::PMTCalibrationDatabase const* fpmt_calib_db;
163+
159164
opdet::sbndPDMapAlg opdetmap; //map for photon detector types
160165
unsigned int nchan = opdetmap.size();
161166

@@ -184,6 +189,7 @@ sbnd::LightCaloProducer::LightCaloProducer(fhicl::ParameterSet const& p)
184189
fvis_params = p.get<fhicl::ParameterSet>("VIVHits");
185190
foptical_path_tool = std::shared_ptr<phot::OpticalPath>(art::make_tool<phot::OpticalPath>(p.get<fhicl::ParameterSet>("OpticalPathTool")));
186191
fsemi_model = std::make_unique<phot::SemiAnalyticalModel>(fvuv_params, fvis_params, foptical_path_tool, true, false);
192+
fpmt_calib_db = lar::providerFrom<sbndDB::IPMTCalibrationDatabaseService const>();
187193

188194
fopflash_producer_v = p.get<std::vector<std::string>>("OpFlashProducers");
189195
fopflash_ara_producer_v = p.get<std::vector<std::string>>("OpFlashAraProducers");
@@ -196,7 +202,6 @@ sbnd::LightCaloProducer::LightCaloProducer(fhicl::ParameterSet const& p)
196202

197203
fverbose = p.get<bool>("Verbose");
198204

199-
fnuscore_cut = p.get<float>("nuScoreCut");
200205
fbcfmscore_cut = p.get<float>("bcfmScoreCut");
201206
fopt0score_cut = p.get<float>("opt0ScoreCut");
202207
fopt0_frac_diff_cut = p.get<float>("opt0FractionalCut");
@@ -510,6 +515,11 @@ void sbnd::LightCaloProducer::CalculateCalorimetry(art::Event& e,
510515
// error is proportional to the amount of light
511516
// that actually reached the optical detector
512517
for (size_t ich=0; ich<total_pe.size(); ich++){
518+
// if pmt channel is not on or reconstructable, set to zero
519+
if (opdetmap.pdType(ich) == "pmt_coated" || opdetmap.pdType(ich) == "pmt_uncoated"){
520+
if(!fpmt_calib_db->getReconstructChannel(ich) || !fpmt_calib_db->getOnPMT(ich))
521+
total_pe.at(ich) = 0;
522+
}
513523
// # if ich is in fopdet_mask, set to zero
514524
if (fopdet_mask.end() != std::find(fopdet_mask.begin(), fopdet_mask.end(), ich))
515525
total_pe.at(ich) = 0;

sbndcode/Calorimetry/lightcalo.fcl

Lines changed: 0 additions & 45 deletions
This file was deleted.
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
#include "opticalsimparameterisations_sbnd.fcl"
2+
#include "sbndopticalpath_tool.fcl"
3+
4+
BEGIN_PROLOG
5+
sbnd_lightcalo:
6+
{
7+
module_type: "LightCaloProducer"
8+
9+
VUVHits: @local::sbnd_vuv_RS100cm_hits_parameterization
10+
VIVHits: @local::sbnd_vis_RS100cm_hits_parameterization
11+
OpticalPathTool: @local::SBNDOpticalPath
12+
13+
OpFlashProducers: ["opflashtpc0", "opflashtpc1"]
14+
OpFlashAraProducers: ["opflashtpc0xarapuca", "opflashtpc1xarapuca"]
15+
# only validated for coated PMTs for now
16+
PDTypes: ["pmt_coated"] # "pmt_uncoated", "xarapuca_vuv", "xarapuca_vis"
17+
18+
SliceProducer: "pandora"
19+
OpT0FinderProducer: "opt0finder"
20+
BCFMProducer: "tpcpmtbarycentermatching"
21+
22+
UseBCFM: true
23+
UseOpT0Finder: false
24+
Verbose: false
25+
26+
bcfmScoreCut: 0.02 # default: accept bcfm match > bcfmScoreCut
27+
opt0ScoreCut: 200 # default: accept opt0 match > opt0ScoreCut
28+
opt0FractionalCut: 0.5
29+
30+
OpFlashMin: 0.0 # simulation [0.0], light-triggered data [-0.8]
31+
OpFlashMax: 2.0 # simulation [2.0], light-triggered data [2.0]
32+
33+
# flash parameters
34+
FlashOffset: 0.05 # acceptable offset between the t0 between TPCs or between PMTs/X-ARAPUCAs
35+
FlashNoiseThreshold: [ 600., 1500. ] # {PMT, xARAPUCA}, flash total PE threshold to ignore a flash
36+
OpDetMaxPEThreshold: [4000., 1e9] # PE in a single opdet to ignore (due to saturation effects)
37+
38+
# calibration constants & simulation parameters
39+
CalAreaConstants: [ 0.02052, 0.02044, 0.02019 ] # calibration constants for wire planes, found in sbndcode/LArSoftConfigurations/calorimetry_sbnd.fcl
40+
OpDetVUVEfficiencies: [0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.03920, 0.03920, 0.03920, 0.03920, 0.03920, 0.03920, 0.03920, 0.03920, 0.03920, 0.03920, 0.03920, 0.03920, 0.01752, 0.01752, 0.01752, 0.01752, 0.01752, 0.01752, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.03570, 0.03570, 0.03570, 0.03570, 0.03570, 0.03570, 0.01752, 0.01752, 0.01752, 0.01752, 0.01752, 0.01752, 0.01752, 0.01752, 0.01752, 0.01752, 0.01752, 0.01752, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.03920, 0.03920, 0.03920, 0.03920, 0.03920, 0.03920, 0.03920, 0.03920, 0.03920, 0.03920, 0.03920, 0.03920, 0.01752, 0.01752, 0.01752, 0.01752, 0.01752, 0.01752, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.03920, 0.03920, 0.03920, 0.03920, 0.03920, 0.03920, 0.03920, 0.03920, 0.03920, 0.03920, 0.03920, 0.03920, 0.01752, 0.01752, 0.01752, 0.01752, 0.01752, 0.01752, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.03570, 0.03570, 0.03570, 0.03570, 0.03570, 0.03570, 0.01752, 0.01752, 0.01752, 0.01752, 0.01752, 0.01752, 0.01752, 0.01752, 0.01752, 0.01752, 0.01752, 0.01752, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.03920, 0.03920, 0.03920, 0.03920, 0.03920, 0.03920, 0.03920, 0.03920, 0.03920, 0.03920, 0.03920, 0.03920, 0.01752, 0.01752, 0.01752, 0.01752, 0.01752, 0.01752, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.03920, 0.03920, 0.03920, 0.03920, 0.03920, 0.03920, 0.03920, 0.03920, 0.03920, 0.03920, 0.03920, 0.03920, 0.01752, 0.01752, 0.01752, 0.01752, 0.01752, 0.01752, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.03570, 0.03570, 0.03570, 0.03570, 0.03570, 0.03570, 0.01752, 0.01752, 0.01752, 0.01752, 0.01752, 0.01752, 0.01752, 0.01752, 0.01752, 0.01752, 0.01752, 0.01752, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.03920, 0.03920, 0.03920, 0.03920, 0.03920, 0.03920, 0.03920, 0.03920, 0.03920, 0.03920, 0.03920, 0.03920, 0.01752, 0.01752, 0.01752, 0.01752, 0.01752, 0.01752, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.03920, 0.03920, 0.03920, 0.03920, 0.03920, 0.03920, 0.03920, 0.03920, 0.03920, 0.03920, 0.03920, 0.03920, 0.01752, 0.01752, 0.01752, 0.01752, 0.01752, 0.01752, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.03570, 0.03570, 0.03570, 0.03570, 0.03570, 0.03570, 0.01752, 0.01752, 0.01752, 0.01752, 0.01752, 0.01752, 0.01752, 0.01752, 0.01752, 0.01752, 0.01752, 0.01752, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.03920, 0.03920, 0.03920, 0.03920, 0.03920, 0.03920, 0.03920, 0.03920, 0.03920, 0.03920, 0.03920, 0.03920, 0.01752, 0.01752, 0.01752, 0.01752, 0.01752, 0.01752]
41+
OpDetVISEfficiencies: [0.01264, 0.01264, 0.01264, 0.01264, 0.01264, 0.01264, 0.02600, 0.02600, 0.02600, 0.02600, 0.02600, 0.02600, 0.02600, 0.02600, 0.02600, 0.02600, 0.02600, 0.02600, 0.00271, 0.00271, 0.00271, 0.00271, 0.00271, 0.00271, 0.01264, 0.01264, 0.01264, 0.01264, 0.01264, 0.01264, 0.01264, 0.01264, 0.01264, 0.01264, 0.01264, 0.01264, 0.03570, 0.03570, 0.03570, 0.03570, 0.03570, 0.03570, 0.00271, 0.00271, 0.00271, 0.00271, 0.00271, 0.00271, 0.00271, 0.00271, 0.00271, 0.00271, 0.00271, 0.00271, 0.01264, 0.01264, 0.01264, 0.01264, 0.01264, 0.01264, 0.02600, 0.02600, 0.02600, 0.02600, 0.02600, 0.02600, 0.02600, 0.02600, 0.02600, 0.02600, 0.02600, 0.02600, 0.00271, 0.00271, 0.00271, 0.00271, 0.00271, 0.00271, 0.01264, 0.01264, 0.01264, 0.01264, 0.01264, 0.01264, 0.02600, 0.02600, 0.02600, 0.02600, 0.02600, 0.02600, 0.02600, 0.02600, 0.02600, 0.02600, 0.02600, 0.02600, 0.00271, 0.00271, 0.00271, 0.00271, 0.00271, 0.00271, 0.01264, 0.01264, 0.01264, 0.01264, 0.01264, 0.01264, 0.01264, 0.01264, 0.01264, 0.01264, 0.01264, 0.01264, 0.03570, 0.03570, 0.03570, 0.03570, 0.03570, 0.03570, 0.00271, 0.00271, 0.00271, 0.00271, 0.00271, 0.00271, 0.00271, 0.00271, 0.00271, 0.00271, 0.00271, 0.00271, 0.01264, 0.01264, 0.01264, 0.01264, 0.01264, 0.01264, 0.02600, 0.02600, 0.02600, 0.02600, 0.02600, 0.02600, 0.02600, 0.02600, 0.02600, 0.02600, 0.02600, 0.02600, 0.00271, 0.00271, 0.00271, 0.00271, 0.00271, 0.00271, 0.01264, 0.01264, 0.01264, 0.01264, 0.01264, 0.01264, 0.02600, 0.02600, 0.02600, 0.02600, 0.02600, 0.02600, 0.02600, 0.02600, 0.02600, 0.02600, 0.02600, 0.02600, 0.00271, 0.00271, 0.00271, 0.00271, 0.00271, 0.00271, 0.01264, 0.01264, 0.01264, 0.01264, 0.01264, 0.01264, 0.01264, 0.01264, 0.01264, 0.01264, 0.01264, 0.01264, 0.03570, 0.03570, 0.03570, 0.03570, 0.03570, 0.03570, 0.00271, 0.00271, 0.00271, 0.00271, 0.00271, 0.00271, 0.00271, 0.00271, 0.00271, 0.00271, 0.00271, 0.00271, 0.01264, 0.01264, 0.01264, 0.01264, 0.01264, 0.01264, 0.02600, 0.02600, 0.02600, 0.02600, 0.02600, 0.02600, 0.02600, 0.02600, 0.02600, 0.02600, 0.02600, 0.02600, 0.00271, 0.00271, 0.00271, 0.00271, 0.00271, 0.00271, 0.01264, 0.01264, 0.01264, 0.01264, 0.01264, 0.01264, 0.02600, 0.02600, 0.02600, 0.02600, 0.02600, 0.02600, 0.02600, 0.02600, 0.02600, 0.02600, 0.02600, 0.02600, 0.00271, 0.00271, 0.00271, 0.00271, 0.00271, 0.00271, 0.01264, 0.01264, 0.01264, 0.01264, 0.01264, 0.01264, 0.01264, 0.01264, 0.01264, 0.01264, 0.01264, 0.01264, 0.03570, 0.03570, 0.03570, 0.03570, 0.03570, 0.03570, 0.00271, 0.00271, 0.00271, 0.00271, 0.00271, 0.00271, 0.00271, 0.00271, 0.00271, 0.00271, 0.00271, 0.00271, 0.01264, 0.01264, 0.01264, 0.01264, 0.01264, 0.01264, 0.02600, 0.02600, 0.02600, 0.02600, 0.02600, 0.02600, 0.02600, 0.02600, 0.02600, 0.02600, 0.02600, 0.02600, 0.00271, 0.00271, 0.00271, 0.00271, 0.00271, 0.00271]
42+
OpDetMask: [] # list of opdet channels to ignore (off/non-reconstructable PMTs are already identified via calibration db)
43+
}
44+
45+
sbnd_lightcalo_sce: @local::sbnd_lightcalo
46+
sbnd_lightcalo_sce.SliceProducer: "pandoraSCE"
47+
sbnd_lightcalo_sce.OpT0FinderProducer: "opt0finderSCE"
48+
sbnd_lightcalo_sce.BCFMProducer: "tpcpmtbarycentermatchingSCE"
49+
50+
END_PROLOG
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
#include "lightcalo_sbnd.fcl"
2+
3+
BEGIN_PROLOG
4+
sbnd_lightcalo_data: @local::sbnd_lightcalo
5+
sbnd_lightcalo_data.CalAreaConstants: [ 0.02172 , 0.02150, 0.02103 ] # calibration constants for wire planes, found in sbndcode/LArSoftConfigurations/calorimetry_sbnd.fcl
6+
sbnd_lightcalo_data.OpFlashMin: -0.8 # assumption is light-triggered data
7+
sbnd_lightcalo_data.OpFlashMax: 2.0 # assumption is light-triggered data
8+
9+
sbnd_lightcalo_data_sce: @local::sbnd_lightcalo_data
10+
sbnd_lightcalo_data_sce.SliceProducer: "pandoraSCE"
11+
sbnd_lightcalo_data_sce.OpT0FinderProducer: "opt0finderSCE"
12+
sbnd_lightcalo_data_sce.BCFMProducer: "tpcpmtbarycentermatchingSCE"
13+
14+
END_PROLOG

sbndcode/JobConfigurations/standard/caf/cafmakerjob_sbnd_data_sce.fcl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ physics.producers.cafmaker.OpT0Label: "opt0finderSCE"
1515
physics.producers.cafmaker.TPCPMTBarycenterMatchLabel: "tpcpmtbarycentermatchingSCE"
1616
physics.producers.cafmaker.CVNLabel: "cvnSCE"
1717
physics.producers.cafmaker.CorrectedOpFlashLabel: "lightpropagationcorrectionSCE"
18+
physics.producers.cafmaker.LightCaloLabel: "lightcaloSCE"
19+
1820
physics.producers.cnnid.WireLabel: "sptpc2d:dnnsp"
1921

2022
physics.producers.cnnid.ClusterModuleLabel: "pandoraSCE"

sbndcode/JobConfigurations/standard/reco/config/workflow_reco2.fcl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020

2121
#include "SBNDCVNMapper.fcl"
2222
#include "blipreco_configs.fcl"
23-
#include "lightcalo.fcl"
23+
#include "lightcalo_sbnd.fcl"
2424

2525
BEGIN_PROLOG
2626

@@ -97,7 +97,7 @@ sbnd_reco2_producers:{
9797
}
9898

9999
### light calorimtery
100-
lightcaloSCE : @local::sbnd_lightcalo
100+
lightcaloSCE : @local::sbnd_lightcalo_sce
101101
}
102102

103103
sbnd_reco2_producer_sequence: [
@@ -138,7 +138,7 @@ sbnd_reco2_producer_sequence: [
138138
, tpcpmtbarycentermatchingSCE
139139
, cvn
140140
, cvnSCE
141-
# , blipreco
141+
, blipreco
142142
, lightcaloSCE
143143
]
144144

@@ -238,7 +238,7 @@ sbnd_reco2_analyzer_sequence: [
238238
caloskim
239239
, pmtskim
240240
, crtana
241-
# , blipana
241+
, blipana
242242
]
243243

244244
#FIXME override the analyzer labels. This should really happen in the module's config fcl

sbndcode/JobConfigurations/standard/reco/reco2_data.fcl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
#include "sbnd_lightpropagationcorrection_config.fcl"
44
#include "frameshift_sbnd_data.fcl"
55
#include "standard_reco2_sbnd.fcl"
6-
#include "lightcalo.fcl"
6+
#include "lightcalo_sbnd_data.fcl"
77

88
services:
99
{
@@ -35,7 +35,7 @@ physics.producers:
3535
pandoraSCEShower: @local::sbnd_sce_incremental_pandoraModularShowerCreationData
3636
pandoraSCEShowerSBN: @local::sbnd_sce_sbn_pandoraModularShowerCreationData
3737

38-
lightcaloSCE: @local::sbnd_lightcalo
38+
lightcaloSCE: @local::sbnd_lightcalo_data_sce
3939
frameshift: @local::frameshift_data
4040
}
4141

0 commit comments

Comments
 (0)