Skip to content

Commit 0d69fd7

Browse files
Merge pull request #636 from yangtj207/feature/tjyang_cvnfix
Reenable CVN
2 parents 4ecfa2e + 65631c5 commit 0d69fd7

5 files changed

Lines changed: 17 additions & 23 deletions

File tree

sbndcode/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,4 +45,4 @@ add_subdirectory(ChannelMaps)
4545

4646
# for CVN
4747
# Disable for now
48-
#add_subdirectory(SBNDCVN)
48+
add_subdirectory(SBNDCVN)

sbndcode/SBNDCVN/module_helpers/SBNDICVNMapper.cxx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ template <class T, class U> void SBNDICVNMapper<T, U>::produce(art::Event& evt)
100100
std::vector<art::Ptr<U>> slicehits = findManyHits.at(slice.key());
101101
fProducer.Set_fT0_value(min_T0);
102102
PixelMap pm = fProducer.SBNDCreateMap(detProp, slicehits);
103-
auto nhits = fProducer.NROI();
103+
auto nhits = fProducer.TotHits();
104104
pm.SetTotHits(nhits);
105105
//pm.fSliceID = slice->ID();
106106

@@ -130,7 +130,7 @@ template <class T, class U> void SBNDICVNMapper<T, U>::produce(art::Event& evt)
130130

131131
auto const detProp = art::ServiceHandle<detinfo::DetectorPropertiesService const>()->DataFor(evt);
132132
PixelMap pm = fProducer.SBNDCreateMap(detProp, hitlist);
133-
auto nhits = fProducer.NROI();
133+
auto nhits = fProducer.TotHits();
134134
pm.SetTotHits(nhits);
135135

136136
if (nhits > fMinClusterHits) pmCol->push_back(pm);

sbndcode/SBNDCVN/module_helpers/SBNDPixelMapProducer.cxx

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -29,20 +29,20 @@ namespace lcvn
2929
//std::cout << "===================== SBNDPixelMapProducer::DefineBoundary() Number of hits : " << cluster.size() << "\n";
3030

3131
for (size_t iHit = 0; iHit < cluster.size(); ++iHit) {
32-
U wraphit(*(cluster[iHit]), this->fThreshold);
32+
U wraphit(*(cluster[iHit]), this->Threshold());
3333
Waveform wf = wraphit.GetWaveform();
3434
geo::WireID wireid = wraphit.GetID();
3535

3636
unsigned int tempWire = wireid.Wire;
3737
unsigned int tempPlane = wireid.Plane;
3838

39-
if (!this->fMultipleDrifts) ConvertLocaltoGlobal(wireid, tempWire, tempPlane);
39+
if (!this->MultipleDrifts()) ConvertLocaltoGlobal(wireid, tempWire, tempPlane);
4040

4141
for (auto& pulse : wf) {
4242
double min_tick = (double)INT_MAX;
4343
for (auto& i : pulse) {
4444
double temptdc = i.first;
45-
if (this->fMultipleDrifts) ConvertLocaltoGlobalTDC(wireid, i.first, tempWire, tempPlane, temptdc);
45+
if (this->MultipleDrifts()) ConvertLocaltoGlobalTDC(wireid, i.first, tempWire, tempPlane, temptdc);
4646
if (temptdc < min_tick) min_tick = temptdc;
4747
tsum[tempPlane] += temptdc;
4848
tsize[tempPlane] += 1.;
@@ -72,13 +72,13 @@ namespace lcvn
7272
double tmean_2 = tsum[2] / tsize[2];
7373

7474
for (int i = 0; i < (int)wire_0.size(); i++) {
75-
if (std::abs(tmin_0[i] - tmean_0) < (double)this->fTRes) bwire_0.push_back(wire_0[i]);
75+
if (std::abs(tmin_0[i] - tmean_0) < (double)this->TRes()) bwire_0.push_back(wire_0[i]);
7676
}
7777
for (int i = 0; i < (int)wire_1.size(); i++) {
78-
if (std::abs(tmin_1[i] - tmean_1) < (double)this->fTRes) bwire_1.push_back(wire_1[i]);
78+
if (std::abs(tmin_1[i] - tmean_1) < (double)this->TRes()) bwire_1.push_back(wire_1[i]);
7979
}
8080
for (int i = 0; i < (int)wire_2.size(); i++) {
81-
if (std::abs(tmin_2[i] - tmean_2) < (double)this->fTRes) bwire_2.push_back(wire_2[i]);
81+
if (std::abs(tmin_2[i] - tmean_2) < (double)this->TRes()) bwire_2.push_back(wire_2[i]);
8282
}
8383

8484
if (fverbose) std::cout << "Boundary wire vector sizes: " << bwire_0.size() << ", " << bwire_1.size() << ", " << bwire_2.size() << std::endl;
@@ -120,9 +120,9 @@ namespace lcvn
120120
}
121121
}
122122

123-
this->fTotHits = bwire_0.size() + bwire_1.size() + bwire_2.size();
123+
this->SetTotHits(bwire_0.size() + bwire_1.size() + bwire_2.size());
124124

125-
Boundary bound(this->fNWire, this->fTRes, minwire_0, minwire_1, minwire_2, tmean_0, tmean_1, tmean_2);
125+
Boundary bound(this->NWire(), this->TRes(), minwire_0, minwire_1, minwire_2, tmean_0, tmean_1, tmean_2);
126126

127127
if(fverbose) std::cout << "============ Reached the end of the function SBNDPixelMapProducer::DefineBoundary() ==============\n";
128128
return bound;
@@ -192,27 +192,27 @@ namespace lcvn
192192
template <class T, class U> PixelMap SBNDPixelMapProducer<T, U>::SBNDCreateMapGivenBoundary(detinfo::DetectorPropertiesData const& detProp,const std::vector< const T* >& cluster, const Boundary& bound)
193193
{
194194
if(fverbose) std::cout << "============ Calling the function SBNDPixelMapProducer::SBNDCreateMapGivenBoundary() ==============\n";
195-
PixelMap pm(this->fNWire, this->fNTdc, bound);
195+
PixelMap pm(this->NWire(), this->NTdc(), bound);
196196

197197
for(size_t iHit = 0; iHit < cluster.size(); ++iHit)
198198
{
199199

200-
U wraphit(*(cluster[iHit]), this->fThreshold);
200+
U wraphit(*(cluster[iHit]), this->Threshold());
201201
Waveform wf = wraphit.GetWaveform();
202202
geo::WireID wireid = wraphit.GetID();
203203

204204
unsigned int tempWire = wireid.Wire;
205205
unsigned int tempPlane = wireid.Plane;
206206

207-
if(!this->fMultipleDrifts)
207+
if(!this->MultipleDrifts())
208208
ConvertLocaltoGlobal(wireid, tempWire, tempPlane);
209209

210210
for(auto &pulse: wf){
211211
// Leigh: Simple modification to unwrap the collection view wire plane
212212
for(auto &i: pulse){
213213
const double pe = i.second;
214214
double temptdc = i.first;
215-
if(this->fMultipleDrifts)
215+
if(this->MultipleDrifts())
216216
ConvertLocaltoGlobalTDC(wireid, i.first, tempWire, tempPlane, temptdc);
217217

218218
const unsigned int wire = tempWire;
@@ -224,7 +224,7 @@ namespace lcvn
224224
}
225225

226226
}
227-
pm.SetTotHits(this->fTotHits);
227+
pm.SetTotHits(this->TotHits());
228228
if(fverbose) std::cout << "============ Reached the end of the function SBNDPixelMapProducer::SBNDCreateMapGivenBoundary() ==============\n";
229229
return pm;
230230
}

sbndcode/SBNDCVN/modules/CMakeLists.txt

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,6 @@ cet_build_plugin(SBNDCVNMapper art::EDProducer
1313
larreco::RecoAlg
1414
lardata::RecoObjects
1515
larpandora::LArPandoraInterface
16-
sbndcode_CRTUtils
17-
sbndcode_CRT
18-
sbnobj::Common_CRT
1916
nusimdata::SimulationBase
2017
art::Framework_Core
2118
art::Framework_Principal
@@ -52,9 +49,6 @@ cet_build_plugin(SBNDCVNZlibMaker art::EDAnalyzer
5249
larreco::RecoAlg
5350
lardata::RecoObjects
5451
larpandora::LArPandoraInterface
55-
sbndcode_CRTUtils
56-
sbndcode_CRT
57-
sbnobj::Common_CRT
5852
nusimdata::SimulationBase
5953
art::Framework_Core
6054
art::Framework_Principal

sbndcode/SBNDCVN/modules/SBNDCVNEvaluator_module.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ namespace lcvn {
140140
std::vector<art::Ptr<recob::Hit>> slicehits = findManyHits.at(slice.key());
141141
fPMProducer.Set_fT0_value(min_T0);
142142
PixelMap pm = fPMProducer.SBNDCreateMap(detProp, slicehits);
143-
auto nhits = fPMProducer.NROI();
143+
auto nhits = fPMProducer.TotHits();
144144
pm.SetTotHits(nhits);
145145
//pm.fSliceID = slice->ID();
146146
std::vector<std::vector<float>> output = fTFHandler->Predict(pm);

0 commit comments

Comments
 (0)