Skip to content

Commit d36651e

Browse files
authored
Merge pull request #483 from SBNSoftware/feature/aheggest_reassignCRTPMTMatchIDinCAF_prod
reassign CRT-PMT MatchID while filling CAFs [release/SBN2024A]
2 parents 8b1417c + a99d960 commit d36651e

File tree

3 files changed

+14
-11
lines changed

3 files changed

+14
-11
lines changed

sbncode/CAFMaker/CAFMaker_module.cc

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1549,22 +1549,17 @@ void CAFMaker::produce(art::Event& evt) noexcept {
15491549
}
15501550
}
15511551

1552-
// Get all of the CRTPMT Matches ..
1552+
// Get all of the CRTPMT Matches
15531553
std::vector<caf::SRCRTPMTMatch> srcrtpmtmatches;
1554-
std::cout << "srcrtpmtmatches.size = " << srcrtpmtmatches.size() << "\n";
15551554
art::Handle<std::vector<sbn::crt::CRTPMTMatching>> crtpmtmatch_handle;
15561555
GetByLabelStrict(evt, fParams.CRTPMTLabel(), crtpmtmatch_handle);
15571556
if(crtpmtmatch_handle.isValid()){
1558-
std::cout << "valid handle! label: " << fParams.CRTPMTLabel() << "\n";
15591557
const std::vector<sbn::crt::CRTPMTMatching> &crtpmtmatches = *crtpmtmatch_handle;
15601558
for (unsigned i = 0; i < crtpmtmatches.size(); i++) {
15611559
srcrtpmtmatches.emplace_back();
1562-
FillCRTPMTMatch(crtpmtmatches[i],srcrtpmtmatches.back());
1560+
FillCRTPMTMatch(crtpmtmatches[i], srcrtpmtmatches.back());
15631561
}
15641562
}
1565-
else{
1566-
std::cout << "crtpmtmatch_handle.isNOTValid!\n";
1567-
}
15681563

15691564
// Get all of the OpFlashes
15701565
std::vector<caf::SROpFlash> srflashes;

sbncode/CAFMaker/FillReco.cxx

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -154,17 +154,25 @@ namespace caf
154154
srmatch.flashPosition = SRVector3D (match.flashPosition.X(), match.flashPosition.Y(), match.flashPosition.Z());
155155
srmatch.flashYWidth = match.flashYWidth;
156156
srmatch.flashZWidth = match.flashZWidth;
157-
srmatch.flashClassification = static_cast<int>(match.flashClassification);
157+
unsigned int topen = 0, topex = 0, sideen = 0, sideex = 0;
158158
for(const auto& matchedCRTHit : match.matchedCRTHits){
159-
std::cout << "CRTPMTTimeDiff = "<< matchedCRTHit.PMTTimeDiff << "\n";
160159
caf::SRMatchedCRT matchedCRT;
161160
matchedCRT.PMTTimeDiff = matchedCRTHit.PMTTimeDiff;
162161
matchedCRT.time = matchedCRTHit.time;
163162
matchedCRT.sys = matchedCRTHit.sys;
164163
matchedCRT.region = matchedCRTHit.region;
165164
matchedCRT.position = SRVector3D(matchedCRTHit.position.X(), matchedCRTHit.position.Y(), matchedCRTHit.position.Z());
165+
if(matchedCRTHit.PMTTimeDiff < 0){
166+
if(matchedCRTHit.sys == 0) topen++;
167+
else if(matchedCRTHit.sys == 1) sideen++;
168+
}
169+
else if(matchedCRTHit.PMTTimeDiff >= 0){
170+
if(matchedCRTHit.sys == 0) topex++;
171+
else if(matchedCRTHit.sys == 1) sideex++;
172+
}
166173
srmatch.matchedCRTHits.push_back(matchedCRT);
167174
}
175+
srmatch.flashClassification = static_cast<int>(sbn::crt::assignFlashClassification(topen, topex, sideen, sideex, 0, 0));
168176
}
169177

170178

sbncode/CAFMaker/FillReco.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -225,8 +225,8 @@ namespace caf
225225
caf::SROpFlash &srflash,
226226
bool allowEmpty = false);
227227
void FillCRTPMTMatch(const sbn::crt::CRTPMTMatching &match,
228-
caf::SRCRTPMTMatch &srmatch,
229-
bool allowEmpty = false);
228+
caf::SRCRTPMTMatch &srmatch,
229+
bool allowEmpty = false);
230230

231231
void FillTPCPMTBarycenterMatch(const sbn::TPCPMTBarycenterMatch *matchInfo,
232232
caf::SRSlice& slice);

0 commit comments

Comments
 (0)