-
Couldn't load subscription status.
- Fork 33
Feature/aantonak crtveto caf #578
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Changes from 15 commits
b256c77
6cbfa8d
3a6116e
9254c24
2d109dc
21befcb
7e3023c
d03d9f6
387d4ad
25ef6cc
1ab38e5
c011954
4aac8d8
89516ab
7cdb76e
1b4390b
04a5a6c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -118,11 +118,11 @@ | |||||||||||||||||||||
| #include "sbnobj/Common/Trigger/ExtraTriggerInfo.h" | ||||||||||||||||||||||
| #include "sbnobj/Common/Reco/CRUMBSResult.h" | ||||||||||||||||||||||
| #include "sbnobj/Common/Reco/OpT0FinderResult.h" | ||||||||||||||||||||||
| #include "sbnobj/SBND/CRT/CRTVeto.hh" | ||||||||||||||||||||||
| #include "sbnobj/Common/Reco/CorrectedOpFlashTiming.h" | ||||||||||||||||||||||
| #include "sbnobj/SBND/Timing/TimingInfo.hh" | ||||||||||||||||||||||
| #include "sbnobj/SBND/Timing/FrameShiftInfo.hh" | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
|
|
||||||||||||||||||||||
| // GENIE | ||||||||||||||||||||||
| #include "Framework/EventGen/EventRecord.h" | ||||||||||||||||||||||
| #include "Framework/Ntuple/NtpMCEventRecord.h" | ||||||||||||||||||||||
|
|
@@ -1713,6 +1713,7 @@ void CAFMaker::produce(art::Event& evt) noexcept { | |||||||||||||||||||||
| std::vector<caf::SRCRTTrack> srcrttracks; | ||||||||||||||||||||||
| std::vector<caf::SRCRTSpacePoint> srcrtspacepoints; | ||||||||||||||||||||||
| std::vector<caf::SRSBNDCRTTrack> srsbndcrttracks; | ||||||||||||||||||||||
| caf::SRSBNDCRTVeto srsbndcrtveto; | ||||||||||||||||||||||
| caf::SRSBNDFrameShiftInfo srsbndframeshiftinfo; | ||||||||||||||||||||||
| caf::SRSBNDTimingInfo srsbndtiminginfo; | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
|
|
@@ -1783,6 +1784,25 @@ void CAFMaker::produce(art::Event& evt) noexcept { | |||||||||||||||||||||
| FillSBNDCRTTrack(sbndcrttracks[i], srsbndcrttracks.back()); | ||||||||||||||||||||||
| } | ||||||||||||||||||||||
| } | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| // Fill CRT Veto | ||||||||||||||||||||||
| art::Handle<std::vector<sbnd::crt::CRTVeto>> sbndcrtveto_handle; | ||||||||||||||||||||||
| GetByLabelStrict(evt, fParams.SBNDCRTVetoLabel(), sbndcrtveto_handle); | ||||||||||||||||||||||
| std::vector<art::Ptr<sbnd::crt::CRTVeto>> vetoPtrs; | ||||||||||||||||||||||
| // fill into event | ||||||||||||||||||||||
| if (sbndcrtveto_handle.isValid()) { | ||||||||||||||||||||||
| art::fill_ptr_vector(vetoPtrs, sbndcrtveto_handle); | ||||||||||||||||||||||
| // Only one valid veto per event | ||||||||||||||||||||||
| if (vetoPtrs.size() == 1) { | ||||||||||||||||||||||
|
||||||||||||||||||||||
| std::vector<art::Ptr<sbnd::crt::CRTVeto>> vetoPtrs; | |
| // fill into event | |
| if (sbndcrtveto_handle.isValid()) { | |
| art::fill_ptr_vector(vetoPtrs, sbndcrtveto_handle); | |
| // Only one valid veto per event | |
| if (vetoPtrs.size() == 1) { | |
| // fill into event | |
| if (sbndcrtveto_handle.isValid()) { | |
| // Only one valid veto per event | |
| if (sbndcrtveto_handle->size() == 1) { |
and then pass to the function a simple sbnd::crt::CRTVeto const* pointer (&sbndcrtveto_handle->front()) or, better, a reference sbnd::crt::CRTVeto const& (sbndcrtveto_handle->front()).
The reference is "better" than a pointer in that the latter would convey the message that the object could be absent (null pointer), which is not the case in your code.
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Across quite a few locations there are still quite a few indentation issues, this probably comes from tab size in the editor you are using - try and untabify to solve.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you're right. I see something completely different on my end. The indentation shown here doesn't look like what's shown in my text editor (I've been using vim)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Still needs resolving
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You are asking the key() of the art pointer created from the first element of a data product. The value of such key is always 0.
Also, avoid copying the vector of space point pointers: use a reference.
| const std::vector<art::Ptr<sbnd::crt::CRTSpacePoint>> veto_sp_v(spAssoc.at(vetoPtrs[0].key())); | |
| const std::vector<art::Ptr<sbnd::crt::CRTSpacePoint>>& veto_sp_v(spAssoc.at(0)); |
| Original file line number | Diff line number | Diff line change | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -188,6 +188,25 @@ namespace caf | |||||||||
| srsbndcrttrack.tof = track.ToF(); | ||||||||||
| } | ||||||||||
|
|
||||||||||
| void FillSBNDCRTVeto(const art::Ptr<sbnd::crt::CRTVeto> &veto, | ||||||||||
| const std::vector<art::Ptr<sbnd::crt::CRTSpacePoint>> &points, | ||||||||||
| caf::SRSBNDCRTVeto &srsbndcrtveto, | ||||||||||
| bool allowEmpty) | ||||||||||
|
||||||||||
| { | ||||||||||
| srsbndcrtveto.V0 = veto->V0(); | ||||||||||
| srsbndcrtveto.V1 = veto->V1(); | ||||||||||
| srsbndcrtveto.V2 = veto->V2(); | ||||||||||
| srsbndcrtveto.V3 = veto->V3(); | ||||||||||
| srsbndcrtveto.V4 = veto->V4(); | ||||||||||
|
|
||||||||||
| // add the CRTSpacePoint associations to the SR Veto | ||||||||||
| for(auto const& sp : points) { | ||||||||||
| srsbndcrtveto.sp_position.emplace_back(sp->X(), sp->Y(), sp->Z()); | ||||||||||
| srsbndcrtveto.sp_time.emplace_back(sp->Ts0()); /// ns for SBND CRT SpacePoints | ||||||||||
| srsbndcrtveto.sp_pe.emplace_back(sp->PE()); | ||||||||||
|
Comment on lines
+205
to
+206
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I suggest the use of good old
Suggested change
|
||||||||||
| } | ||||||||||
| } | ||||||||||
|
|
||||||||||
henrylay97 marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||||||
| void FillSBNDFrameShiftInfo(const sbnd::timing::FrameShiftInfo &frame, | ||||||||||
| caf::SRSBNDFrameShiftInfo &srsbndframe, | ||||||||||
| bool allowEmpty) | ||||||||||
|
|
||||||||||
Uh oh!
There was an error while loading. Please reload this page.