Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 6 additions & 7 deletions sbncode/CAFMaker/CAFMaker_module.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1552,22 +1552,21 @@ void CAFMaker::produce(art::Event& evt) noexcept {
}
}

// Get all of the CRTPMT Matches ..
// Get all of the CRTPMT Matches
std::vector<caf::SRCRTPMTMatch> srcrtpmtmatches;
std::cout << "srcrtpmtmatches.size = " << srcrtpmtmatches.size() << "\n";
art::Handle<std::vector<sbn::crt::CRTPMTMatching>> crtpmtmatch_handle;
GetByLabelStrict(evt, fParams.CRTPMTLabel(), crtpmtmatch_handle);
if(crtpmtmatch_handle.isValid()){
std::cout << "valid handle! label: " << fParams.CRTPMTLabel() << "\n";
const std::vector<sbn::crt::CRTPMTMatching> &crtpmtmatches = *crtpmtmatch_handle;
for (unsigned i = 0; i < crtpmtmatches.size(); i++) {
int topen = 0, topex = 0, sideen = 0, sideex = 0; // bottomen = 0, bottomex = 0;
srcrtpmtmatches.emplace_back();
FillCRTPMTMatch(crtpmtmatches[i],srcrtpmtmatches.back());
FillCRTPMTMatch(crtpmtmatches[i],
topen, topex, sideen, sideex,
//bottomen, bottomex,
srcrtpmtmatches.back());
}
}
else{
std::cout << "crtpmtmatch_handle.isNOTValid!\n";
}

// Get all of the OpFlashes
std::vector<caf::SROpFlash> srflashes;
Expand Down
13 changes: 11 additions & 2 deletions sbncode/CAFMaker/FillReco.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,8 @@ namespace caf
}

void FillCRTPMTMatch(const sbn::crt::CRTPMTMatching &match,
int &topen, int &topex, int &sideen, int &sideex,
//int &bottomen, int &bottomex,
caf::SRCRTPMTMatch &srmatch,
bool allowEmpty){
// allowEmpty does not (yet) matter here
Expand All @@ -157,17 +159,24 @@ namespace caf
srmatch.flashPosition = SRVector3D (match.flashPosition.X(), match.flashPosition.Y(), match.flashPosition.Z());
srmatch.flashYWidth = match.flashYWidth;
srmatch.flashZWidth = match.flashZWidth;
srmatch.flashClassification = static_cast<int>(match.flashClassification);
for(const auto& matchedCRTHit : match.matchedCRTHits){
std::cout << "CRTPMTTimeDiff = "<< matchedCRTHit.PMTTimeDiff << "\n";
caf::SRMatchedCRT matchedCRT;
matchedCRT.PMTTimeDiff = matchedCRTHit.PMTTimeDiff;
matchedCRT.time = matchedCRTHit.time;
matchedCRT.sys = matchedCRTHit.sys;
matchedCRT.region = matchedCRTHit.region;
matchedCRT.position = SRVector3D(matchedCRTHit.position.X(), matchedCRTHit.position.Y(), matchedCRTHit.position.Z());
if(matchedCRTHit.PMTTimeDiff < 0){
if(matchedCRTHit.sys == 0) topen++;
else if(matchedCRTHit.sys == 1) sideen++;
}
else if(matchedCRTHit.PMTTimeDiff >= 0){
if(matchedCRTHit.sys == 0) topex++;
else if(matchedCRTHit.sys == 1) sideex++;
}
srmatch.matchedCRTHits.push_back(matchedCRT);
}
srmatch.flashClassification = static_cast<int>(sbn::crt::assignFlashClassification(topen, topex, sideen, sideex, 0, 0));
}


Expand Down
6 changes: 4 additions & 2 deletions sbncode/CAFMaker/FillReco.h
Original file line number Diff line number Diff line change
Expand Up @@ -222,8 +222,10 @@ namespace caf
caf::SROpFlash &srflash,
bool allowEmpty = false);
void FillCRTPMTMatch(const sbn::crt::CRTPMTMatching &match,
caf::SRCRTPMTMatch &srmatch,
bool allowEmpty = false);
int &topen, int &topex, int &sideen, int &sidex,
//int &bottomen, int &bottomex,
caf::SRCRTPMTMatch &srmatch,
bool allowEmpty = false);

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