Skip to content

Commit e9ed25c

Browse files
Merge branch 'release/v10_10_03'
2 parents afc14b7 + 1de0abe commit e9ed25c

20 files changed

Lines changed: 1568 additions & 104 deletions

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515

1616
cmake_minimum_required(VERSION 3.20 FATAL_ERROR)
1717

18-
set(${PROJECT_NAME}_CMAKE_PROJECT_VERSION_STRING 10.10.02)
18+
set(${PROJECT_NAME}_CMAKE_PROJECT_VERSION_STRING 10.10.03)
1919
find_package(cetmodules REQUIRED)
2020
project(sbndcode LANGUAGES CXX)
2121

sbndcode/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,3 +50,4 @@ add_subdirectory(SBNDCVN)
5050
add_subdirectory(TPCPMTBarycenterMatching)
5151

5252
add_subdirectory(BlipRecoSBND)
53+
add_subdirectory(LightPropagationCorrection)

sbndcode/Calibration/TPCCalorimetry/NormalizeYZ_tool.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ namespace sbnd {
133133
return dQdx;
134134
}
135135

136-
return dQdx / scale;
136+
return dQdx*scale;
137137
}
138138

139139
DEFINE_ART_CLASS_TOOL(NormalizeYZ)

sbndcode/JobConfigurations/base/cafmakerjob_sbnd_data_base.fcl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,9 @@ physics.producers.cafmaker.TrackChi2PidLabel: "pandoraPidData"
156156
# Include 3D barycenter flahs matching
157157
physics.producers.cafmaker.TPCPMTBarycenterMatchLabel: "tpcpmtbarycentermatching"
158158

159+
# Include Light Propagation Correction for OpFlash timing
160+
physics.producers.cafmaker.CorrectedOpFlashLabel: "lightpropagationcorrection"
161+
159162
# Blinding not needed for MC
160163
physics.producers.cafmaker.CreateBlindedCAF: false
161164

sbndcode/JobConfigurations/standard/caf/cafmakerjob_sbnd_data_sce.fcl

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ physics.producers.cafmaker.SBNDCRTTrackMatchLabel: "crttrackmatchingSCE"
1313
physics.producers.cafmaker.OpT0Label: "opt0finderSCE"
1414
physics.producers.cafmaker.TPCPMTBarycenterMatchLabel: "tpcpmtbarycentermatchingSCE"
1515
physics.producers.cafmaker.CVNLabel: "cvnSCE"
16+
physics.producers.cafmaker.CorrectedOpFlashLabel: "lightpropagationcorrectionSCE"
1617

1718
physics.producers.cnnid.ClusterModuleLabel: "pandoraSCE"
1819
physics.producers.cnnid.PFParticleModuleLabel: "pandoraSCE"
@@ -23,6 +24,10 @@ physics.producers.pandoraTrackRange.TrackLabel: "pandoraSCETrack"
2324
physics.producers.cafmaker.FlashMatchOpDetSuffixes: ["", "op", "ara", "opara"]
2425
physics.producers.cafmaker.FlashMatchSCECryoSuffixes: ["SCE"]
2526

27+
28+
29+
30+
2631
physics.producers.pandoraShowerSelectionVars.PandoraLabel: "pandoraSCE"
2732
physics.producers.pandoraShowerSelectionVars.ShowerLabel: "pandoraSCEShowerSBN"
2833
physics.producers.pandoraShowerCosmicDist.PandoraLabel: "pandoraSCE"

sbndcode/JobConfigurations/standard/caf/cafmakerjob_sbnd_sce.fcl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ physics.producers.pandoraTrackRange.TrackLabel: "pandoraSCETrack"
2424

2525
physics.producers.cafmaker.FlashMatchOpDetSuffixes: ["", "op", "ara", "opara"]
2626
physics.producers.cafmaker.FlashMatchSCECryoSuffixes: ["SCE"]
27+
physics.producers.cafmaker.TrackHitFillRRStartCut: 1000
28+
physics.producers.cafmaker.TrackHitFillRREndCut: 1000
2729

2830
physics.producers.pandoraShowerSelectionVars.PandoraLabel: "pandoraSCE"
2931
physics.producers.pandoraShowerSelectionVars.ShowerLabel: "pandoraSCEShowerSBN"

sbndcode/JobConfigurations/standard/reco/reco2_data.fcl

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
#include "crt_calib_service.fcl"
33
#include "opt0finder_sbnd_data.fcl"
44
#include "sbnd_tpcpmt3dbarycentermatching_config.fcl"
5+
#include "sbnd_lightpropagationcorrection_config.fcl"
56
#include "frameshift_sbnd_data.fcl"
67
#include "standard_reco2_sbnd.fcl"
78

@@ -26,6 +27,8 @@ physics.producers:
2627
opt0finderSCE: @local::sbnd_opt0_finder_data
2728
tpcpmtbarycentermatching: @local::TPCPMTBarycenterMatchProducer
2829
tpcpmtbarycentermatchingSCE: @local::TPCPMTBarycenterMatchProducerSCE
30+
lightpropagationcorrection: @local::LightPropagationCorrection
31+
lightpropagationcorrectionSCE: @local::LightPropagationCorrectionSCE
2932

3033
### shower reco for data
3134
pandoraShower: @local::sbnd_incremental_pandoraModularShowerCreationData
@@ -41,7 +44,8 @@ physics.reco2: [ pandora, pandoraTrack, pandoraShower, pandoraShowerSBN, pandora
4144
cvn, opt0finder, crtveto, crtspacepointmatching, crttrackmatching, tpcpmtbarycentermatching,
4245
pandoraSCE, pandoraSCETrack, pandoraSCEShower, pandoraSCEShowerSBN, pandoraSCECaloData, pandoraSCEPidData,
4346
cvnSCE, opt0finderSCE, tpcpmtbarycentermatchingSCE, crtspacepointmatchingSCE, crttrackmatchingSCE,
44-
caloskimCalorimetry, blipreco, frameshift]
47+
caloskimCalorimetry, blipreco, lightpropagationcorrectionSCE, frameshift]
48+
4549

4650
physics.analyzers.caloskim.G4producer: ""
4751
physics.analyzers.caloskim.SimChannelproducer: ""
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
2+
set (
3+
MODULE_LIBRARIES
4+
art::Framework_Principal
5+
art::Framework_Services_Registry
6+
art_root_io::tfile_support
7+
art_root_io::TFileService_service
8+
art::Persistency_Common
9+
art::Persistency_Provenance
10+
art::Utilities
11+
12+
ROOT::Tree
13+
ROOT::Core
14+
15+
larsim::Utils
16+
lardata::DetectorInfoServices_DetectorClocksServiceStandard_service
17+
larcore::Geometry_Geometry_service
18+
larcorealg::Geometry
19+
lardataobj::RecoBase
20+
lardataobj::MCBase
21+
lardataobj::Simulation
22+
23+
24+
sbndcode_OpDetReco_OpFlash_FlashFinder
25+
26+
sbnobj::Common_Reco
27+
sbnobj::SBND_Timing
28+
sbndcode_OpDetSim
29+
)
30+
31+
cet_build_plugin(LightPropagationCorrection art::module SOURCE LightPropagationCorrection_module.cc LIBRARIES ${MODULE_LIBRARIES})
32+
cet_build_plugin(LightPropagationCorrectionAna art::module SOURCE LightPropagationCorrectionAna_module.cc LIBRARIES ${MODULE_LIBRARIES})
33+
34+
install_fhicl()
35+
install_source()
36+
install_headers()
37+
add_subdirectory(job)
38+
Lines changed: 150 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,150 @@
1+
////////////////////////////////////////////////////////////////////////
2+
// Class: SBNDOpT0FinderAna
3+
// Plugin Type: analyzer (art v3_05_01)
4+
// File: SBNDOpT0FinderAna_module.cc
5+
//
6+
// Generated at Mon Oct 12 13:52:37 2020 by Marco Del Tutto using cetskelgen
7+
// from cetlib version v3_10_00.
8+
////////////////////////////////////////////////////////////////////////
9+
10+
#include "art/Framework/Core/EDAnalyzer.h"
11+
#include "art/Framework/Core/ModuleMacros.h"
12+
#include "art/Framework/Principal/Event.h"
13+
#include "art/Framework/Principal/Handle.h"
14+
#include "art/Framework/Principal/Run.h"
15+
#include "art/Framework/Principal/SubRun.h"
16+
#include "canvas/Utilities/InputTag.h"
17+
#include "canvas/Persistency/Common/FindManyP.h"
18+
#include "fhiclcpp/ParameterSet.h"
19+
#include "messagefacility/MessageLogger/MessageLogger.h"
20+
21+
#include "lardataobj/RecoBase/Slice.h"
22+
#include "lardataobj/RecoBase/OpFlash.h"
23+
#include "sbnobj/Common/Reco/CorrectedOpFlashTiming.h"
24+
25+
#include "art_root_io/TFileService.h"
26+
27+
#include "TTree.h"
28+
29+
#include <numeric>
30+
31+
class LightPropagationCorrectionAna;
32+
33+
34+
class LightPropagationCorrectionAna : public art::EDAnalyzer {
35+
public:
36+
explicit LightPropagationCorrectionAna(fhicl::ParameterSet const& p);
37+
// The compiler-generated destructor is fine for non-base
38+
// classes without bare pointers or other resource use.
39+
40+
// Plugins should not be copied or assigned.
41+
LightPropagationCorrectionAna(LightPropagationCorrectionAna const&) = delete;
42+
LightPropagationCorrectionAna(LightPropagationCorrectionAna&&) = delete;
43+
LightPropagationCorrectionAna& operator=(LightPropagationCorrectionAna const&) = delete;
44+
LightPropagationCorrectionAna& operator=(LightPropagationCorrectionAna&&) = delete;
45+
46+
// Required functions.
47+
void analyze(art::Event const& e) override;
48+
void beginJob() override;
49+
private:
50+
51+
std::string fLightPropCorrectionLabel; ///< The light propagation correction label producer
52+
53+
TTree* fTree; ///< The TTree for storing event information
54+
55+
double fOpFlashT0;
56+
double fUpstreamTime_lightonly;
57+
double fUpstreamTime_tpczcorr;
58+
double fUpstreamTime_propcorr_tpczcorr;
59+
60+
unsigned int _eventID;
61+
unsigned int _runID;
62+
unsigned int _subrunID;
63+
64+
};
65+
66+
67+
LightPropagationCorrectionAna::LightPropagationCorrectionAna(fhicl::ParameterSet const& p)
68+
: EDAnalyzer{p}
69+
{
70+
fLightPropCorrectionLabel = p.get<std::string>("LightPropCorrectionLabel");
71+
}
72+
73+
void LightPropagationCorrectionAna::analyze(art::Event const& e)
74+
{
75+
fOpFlashT0=-99999.;
76+
fUpstreamTime_lightonly=-99999.;
77+
fUpstreamTime_tpczcorr=-99999.;
78+
fUpstreamTime_propcorr_tpczcorr=-99999.;
79+
80+
_eventID = -1;
81+
_runID = -1;
82+
_subrunID = -1;
83+
84+
std::cout << "Run: " << e.id().run() << " Sub: " << e.id().subRun() << " Evt: " << e.id().event() << std::endl;
85+
86+
_eventID = e.id().event();
87+
_runID = e.id().run();
88+
_subrunID = e.id().subRun();
89+
90+
// Get all the T0 objects
91+
::art::Handle<std::vector<sbn::CorrectedOpFlashTiming>> correctedopflash_h;
92+
e.getByLabel(fLightPropCorrectionLabel, correctedopflash_h);
93+
if(!correctedopflash_h.isValid() || correctedopflash_h->empty()) {
94+
mf::LogWarning("fLightPropCorrectionLabel") << "No LightPropCorrectionLabel objects with label " << fLightPropCorrectionLabel << std::endl;
95+
return;
96+
}
97+
98+
99+
std::vector<art::Ptr<sbn::CorrectedOpFlashTiming>> correctedopflash_v;
100+
art::fill_ptr_vector(correctedopflash_v, correctedopflash_h);
101+
102+
// Get the T0->Slice association
103+
art::FindManyP<recob::Slice> correctedflash_to_slices(correctedopflash_h, e, fLightPropCorrectionLabel);
104+
art::FindManyP<recob::OpFlash> correctedflash_to_flashes(correctedopflash_h, e, fLightPropCorrectionLabel);
105+
106+
for (size_t i = 0; i < correctedopflash_v.size(); i++) {
107+
108+
// The T0 object
109+
auto const correctedopflash = correctedopflash_v[i];
110+
111+
// The associations from T0 to both slices and flashes
112+
std::vector<art::Ptr<recob::Slice>> slice_v = correctedflash_to_slices.at(correctedopflash.key());
113+
std::vector<art::Ptr<recob::OpFlash>> flash_v = correctedflash_to_flashes.at(correctedopflash.key());
114+
115+
// One T0 object is always associated to one and only one Slice and Flash
116+
assert(slice_v.size() == 1);
117+
assert(flash_v.size() == 1);
118+
119+
std::cout << " Corrected flash time is " << correctedopflash->OpFlashT0 << std::endl;
120+
std::cout << " Associated with slice id " << slice_v[0]->ID() << std::endl;
121+
std::cout << "Corrected flash time light only " << correctedopflash->UpstreamTime_lightonly << std::endl;
122+
std::cout << "Corrected flash time tpc z corr " << correctedopflash->UpstreamTime_tpczcorr << std::endl;
123+
std::cout << "Corrected flash time prop corr tpc z corr " << correctedopflash->UpstreamTime_propcorr_tpczcorr << std::endl;
124+
125+
fOpFlashT0 = correctedopflash->OpFlashT0;
126+
fUpstreamTime_lightonly = correctedopflash->UpstreamTime_lightonly;
127+
fUpstreamTime_tpczcorr = correctedopflash->UpstreamTime_tpczcorr;
128+
fUpstreamTime_propcorr_tpczcorr = correctedopflash->UpstreamTime_propcorr_tpczcorr;
129+
fTree->Fill();
130+
}
131+
}
132+
133+
void LightPropagationCorrectionAna::beginJob()
134+
{
135+
// Implementation of optional member function here.
136+
art::ServiceHandle<art::TFileService> tfs;
137+
fTree = tfs->make<TTree>("LightPropagationCorrection", "Light Propagation Correction Tree");
138+
139+
fTree->Branch("eventID", &_eventID, "eventID/i");
140+
fTree->Branch("runID", &_runID, "runID/i");
141+
fTree->Branch("subrunID", &_subrunID, "subrunID/i");
142+
143+
fTree->Branch("fOpFlashT0", &fOpFlashT0, "OpFlashT0/d");
144+
fTree->Branch("fUpstreamTime_lightonly", &fUpstreamTime_lightonly, "UpstreamTime_lightonly/d");
145+
fTree->Branch("fUpstreamTime_tpczcorr", &fUpstreamTime_tpczcorr, "UpstreamTime_tpczcorr/d");
146+
fTree->Branch("fUpstreamTime_propcorr_tpczcorr", &fUpstreamTime_propcorr_tpczcorr, "UpstreamTime_propcorr_tpczcorr/d");
147+
148+
}
149+
150+
DEFINE_ART_MODULE(LightPropagationCorrectionAna)

0 commit comments

Comments
 (0)