-
Notifications
You must be signed in to change notification settings - Fork 37
Adding offbeam gate counting into the CAFs #298
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
Closed
Closed
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
d94a7be
Implementation of offbeam gate counter in CAF similar to how BNB/NuMI…
6aae371
Merge with v9_59_00
59b62f5
Cleanup BNBRetriever module
90ebaa8
Merge branch 'develop' into feature/jzettle_OffBeamGateCountCAFs
miquelnebot 6399bda
Addressing review comments
2c3df8c
Modules now throw an exception if trigger gate type value is not the …
fb2dfa4
Merge branch 'feature/jzettle_OffBeamGateCountCAFs' of https://github…
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 5 additions & 0 deletions
5
sbncode/BeamSpillInfoRetriever/job/run_extinfo_sbn_dropfrag.fcl
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| #include "run_extinfo_sbn.fcl" | ||
|
|
||
| outputs.out1.outputCommands: [ | ||
| "keep *_*_*_EXTInfoGen" | ||
| ] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change | ||
|---|---|---|---|---|
|
|
@@ -105,6 +105,7 @@ | |||
| #include "sbnobj/Common/Reco/StoppingChi2Fit.h" | ||||
| #include "sbnobj/Common/POTAccounting/BNBSpillInfo.h" | ||||
| #include "sbnobj/Common/POTAccounting/NuMISpillInfo.h" | ||||
| #include "sbnobj/Common/POTAccounting/EXTCountInfo.h" | ||||
| #include "sbnobj/Common/Trigger/ExtraTriggerInfo.h" | ||||
| #include "sbnobj/Common/Reco/CRUMBSResult.h" | ||||
|
|
||||
|
|
@@ -182,12 +183,15 @@ class CAFMaker : public art::EDProducer { | |||
| int fFileNumber; | ||||
| double fTotalPOT; | ||||
| double fSubRunPOT; | ||||
| double fEXTGateCount; | ||||
| double fTotalEXTGateCount; | ||||
| double fTotalSinglePOT; | ||||
| double fTotalEvents; | ||||
| double fBlindEvents; | ||||
| double fPrescaleEvents; | ||||
| std::vector<caf::SRBNBInfo> fBNBInfo; ///< Store detailed BNB info to save into the first StandardRecord of the output file | ||||
| std::vector<caf::SRNuMIInfo> fNuMIInfo; ///< Store detailed NuMI info to save into the first StandardRecord of the output file | ||||
| std::vector<caf::SREXTInfo> fEXTInfo; | ||||
|
Member
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. The description of the meaning of this field is missing. |
||||
| std::vector<caf::SRTrigger> fSRTrigger; ///< Store trigger and beam gate information | ||||
|
|
||||
| // int fCycle; | ||||
|
|
@@ -673,7 +677,9 @@ void CAFMaker::beginSubRun(art::SubRun& sr) { | |||
| // get POT information | ||||
| fBNBInfo.clear(); | ||||
| fNuMIInfo.clear(); | ||||
| fEXTInfo.clear(); | ||||
| fSubRunPOT = 0; | ||||
| fEXTGateCount = 0; | ||||
|
|
||||
| if(auto bnb_spill = sr.getHandle<std::vector<sbn::BNBSpillInfo>>(fParams.BNBPOTDataLabel())){ | ||||
| FillExposure(*bnb_spill, fBNBInfo, fSubRunPOT); | ||||
|
|
@@ -683,16 +689,23 @@ void CAFMaker::beginSubRun(art::SubRun& sr) { | |||
| FillExposureNuMI(*numi_spill, fNuMIInfo, fSubRunPOT); | ||||
| fTotalPOT += fSubRunPOT; | ||||
| } | ||||
| else if(auto ext_spill = sr.getHandle<std::vector<sbn::EXTCountInfo>>(fParams.EXTCountDataLabel())) | ||||
| { | ||||
| FillExposureEXT(*ext_spill, fEXTInfo, fEXTGateCount); | ||||
| fTotalEXTGateCount += fEXTGateCount; | ||||
| } | ||||
| else if(auto pot_handle = sr.getHandle<sumdata::POTSummary>(fParams.GenLabel())){ | ||||
| fSubRunPOT = pot_handle->totgoodpot; | ||||
| fTotalPOT += fSubRunPOT; | ||||
| } | ||||
| else{ | ||||
| if(!fParams.BNBPOTDataLabel().empty() || !fParams.GenLabel().empty() || !fParams.NuMIPOTDataLabel().empty()){ | ||||
| if(!fParams.BNBPOTDataLabel().empty() || !fParams.GenLabel().empty() || !fParams.NuMIPOTDataLabel().empty() ||!fParams.EXTCountDataLabel().empty()){ | ||||
| std::cout << "Found neither BNB data POT info under '" | ||||
| << fParams.BNBPOTDataLabel() | ||||
| << "' not NuMIdata POT info under '" | ||||
| << "' nor NuMI data POT info under '" | ||||
| << fParams.NuMIPOTDataLabel() | ||||
| << "' nor EXT data count info under '" | ||||
| << fParams.EXTCountDataLabel() | ||||
| << "' nor MC POT info under '" | ||||
| << fParams.GenLabel() << "'" | ||||
| << std::endl; | ||||
|
|
@@ -702,7 +715,8 @@ void CAFMaker::beginSubRun(art::SubRun& sr) { | |||
| // Otherwise, if one label is blank, maybe no POT was the expected result | ||||
| } | ||||
|
|
||||
| std::cout << "POT: " << fSubRunPOT << std::endl; | ||||
| std::cout << "POT (for Beam files): " << fSubRunPOT << std::endl; | ||||
| std::cout << "OffBeam Gate Count (for OffBeam files): " << fEXTGateCount << std::endl; | ||||
|
|
||||
| fFirstInSubRun = true; | ||||
| } | ||||
|
|
@@ -860,6 +874,8 @@ void CAFMaker::InitializeOutfiles() | |||
| fTotalPOT = 0; | ||||
| fSubRunPOT = 0; | ||||
| fTotalSinglePOT = 0; | ||||
| fEXTGateCount = 0; | ||||
| fTotalEXTGateCount = 0; | ||||
| fTotalEvents = 0; | ||||
| fBlindEvents = 0; | ||||
| fPrescaleEvents = 0; | ||||
|
|
@@ -1818,10 +1834,14 @@ void CAFMaker::produce(art::Event& evt) noexcept { | |||
| rec.hdr.fno = fFileNumber; | ||||
| if(fFirstInFile) | ||||
| { | ||||
| rec.hdr.pot = fSubRunPOT; | ||||
|
Member
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. Already present at the end of this scope.
Suggested change
|
||||
| rec.hdr.extcount = fEXTGateCount; | ||||
| rec.hdr.nbnbinfo = fBNBInfo.size(); | ||||
| rec.hdr.bnbinfo = fBNBInfo; | ||||
| rec.hdr.nnumiinfo = fNuMIInfo.size(); | ||||
| rec.hdr.numiinfo = fNuMIInfo; | ||||
| rec.hdr.nextinfo = fEXTInfo.size(); | ||||
| rec.hdr.extinfo = fEXTInfo; | ||||
| rec.hdr.pot = fSubRunPOT; | ||||
| } | ||||
|
|
||||
|
|
@@ -1907,6 +1927,7 @@ void CAFMaker::produce(art::Event& evt) noexcept { | |||
|
|
||||
| fBNBInfo.clear(); | ||||
| fNuMIInfo.clear(); | ||||
| fEXTInfo.clear(); | ||||
| fSRTrigger.clear(); | ||||
| rec.hdr.pot = 0; | ||||
| } | ||||
|
|
||||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
art does not require the definition of
trigger_pathswhen there is only one producer path defined.It does not hurt to leave it though.