Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
107 commits
Select commit Hold shift + click to select a range
b3b5480
Saving GENIE event record to the caf output
jedori0228 Dec 19, 2023
f348e3e
Generating two identical GENIE trees for caf and flatcaf.. This might…
jedori0228 Dec 25, 2023
c5fc186
rollback the indents..
jedori0228 Feb 15, 2024
0bb0588
rollback the indents.. try 2
jedori0228 Feb 15, 2024
ff8308b
rollback the indents.. try 3
jedori0228 Feb 15, 2024
9d89d61
rollback the indents.. try 4
jedori0228 Feb 15, 2024
3cb9dfe
Saving SoruceFileHash to CAF and GENIE Tree for unique-indexing
jedori0228 Mar 25, 2024
604695d
Using truncated hash (from size_t to std::uint32_t) for SRHeader::sou…
jedori0228 Mar 26, 2024
deadba8
Delete fGenieEvtRec and fFlatGenieEvtRec
jedori0228 Apr 16, 2024
02d5724
Delete all the created GENIE objects in the destrcutor properly
jedori0228 Apr 22, 2024
57bfe1f
Merge branch 'develop' into feature/jskim_AddingGENIETreeToCAF_v09_83_01
jedori0228 Apr 26, 2024
9177be1
Merge tag 'v09_89_01_01' into develop
May 1, 2024
7823a7f
Update NearestWireID
bear-is-asleep May 6, 2024
053754d
Restore SBN_QGSP_BERT_NNC to be QGSP_BERT with no neutron cut
marcodeltutto May 6, 2024
fdcd037
Merge branch 'develop' into feature/mdeltutt_issue453
marcodeltutto May 7, 2024
8c3665e
last valid point for last segment validity
May 7, 2024
5c4c3ca
Merge pull request #461 from SBNSoftware/bugfix/bearc_cluster3dsbn
ibsafa May 8, 2024
696f83d
Merge pull request #463 from SBNSoftware/feature/munjung-mcs_patch
ibsafa May 9, 2024
9c2ed25
updated dependencies
May 9, 2024
f057d4d
Improve SystToolsEventWeight
jedori0228 May 9, 2024
9299e74
updated sbnobj dependency
May 9, 2024
92c5e11
Weekly release of sbncode
May 9, 2024
847fad0
Merge tag 'v09_90_00' into develop
May 9, 2024
1ff7791
Merge branch 'develop' into feature/jskim_ImproveSystToolsEventWeight…
ibsafa May 16, 2024
9ad9c7f
Merge branch 'develop' into feature/jskim_AddingGENIETreeToCAF_v09_83_01
ibsafa May 16, 2024
6accca2
Merge pull request #459 from SBNSoftware/feature/jskim_AddingGENIETre…
ibsafa May 16, 2024
c62dbdf
Allow time shift in trigger to IFBeam timing. Skip first event in str…
Jul 28, 2023
d90537f
Update following Gianluca's comments - those were related to PR 431 f…
brucehoward-physics May 22, 2024
afccd18
Per Gianluca's suggestion, adding the sbn bits value to get source ty…
brucehoward-physics May 23, 2024
e0c4f5b
Accommodate geometry-refactoring changes
knoepfel Jun 4, 2024
1b7ce52
Update FillReco
henrylay97 Jun 7, 2024
28c9830
Add t0CRT to Calibration Ntuple
Apr 17, 2024
53ec61f
Merge branch 'develop' into feature/alex_addCRTT0
afm1g15 Jun 19, 2024
4797846
Merge branch 'develop' into feature/jskim_ImproveSystToolsEventWeight…
ibsafa Jul 5, 2024
17fc292
Merge pull request #464 from SBNSoftware/feature/jskim_ImproveSystToo…
ibsafa Jul 5, 2024
c1bd64b
Merge branch 'develop' into feature/howard_forDev_incorporate_gputnam…
ibsafa Jul 5, 2024
2970675
Merge branch 'develop' into feature/alex_addCRTT0
ibsafa Jul 5, 2024
2bcd690
Merge pull request #462 from SBNSoftware/feature/mdeltutt_issue453
ibsafa Jul 5, 2024
c6c4b93
update dependencies and version number
Jul 5, 2024
f75676b
nusystematics dependency
Jul 5, 2024
782666a
trigger product changes
Jul 5, 2024
f3da898
Merge branch 'release/v09_91_01'
Jul 8, 2024
64bd28a
Merge tag 'v09_91_01' into develop
Jul 8, 2024
f65cefb
update dependencies
Jul 13, 2024
0374556
version number
Jul 13, 2024
4287079
dependencies
Jul 13, 2024
f2f196a
Merge branch 'release/v09_91_02'
Jul 13, 2024
a7dd2b7
Merge tag 'v09_91_02' into develop
Jul 13, 2024
0153e73
Add default params to gnocchi
absolution1 Jul 16, 2024
0e0436d
Create pull_request_template.md
ibsafa Jul 17, 2024
45df822
Merge branch 'develop' into dbrailsf_gnocchifcl
ibsafa Jul 17, 2024
4ac3034
Merge pull request #469 from SBNSoftware/dbrailsf_gnocchifcl
ibsafa Jul 18, 2024
3216e4a
Merge branch 'develop' into feature/alex_addCRTT0
ibsafa Jul 18, 2024
6d5a030
Merge pull request #468 from afm1g15/feature/alex_addCRTT0
ibsafa Jul 18, 2024
a027558
increment version and update sbnanaobj dep
Jul 18, 2024
bf374b5
Merge branch 'release/v09_91_02_01'
Jul 18, 2024
8917e9d
Merge tag 'v09_91_02_01' into develop
Jul 18, 2024
31b830e
Update supera tag
Jul 23, 2024
2053ea2
Update supera tag
Jul 29, 2024
56dc342
Merge pull request #470 from SBNSoftware/feature/bearc_sbnd_supera_data
ibsafa Jul 29, 2024
15e7df2
Clean up for PR
henrylay97 Aug 26, 2024
084ad23
Merge remote-tracking branch 'origin/develop' into feature/hlay_crt_o…
henrylay97 Aug 26, 2024
c3132d9
Accommodate changes to recob::Hit
knoepfel Sep 12, 2024
6206655
Change the default channel simulation to 2d
linyan-w Sep 16, 2024
fcbe7de
update for sbndaq offline release
Sep 24, 2024
6120d2e
patch for offline sbndaq
Sep 24, 2024
01ad47d
Merge pull request #471 from SBNSoftware/feature/hlay_crt_offline
ibsafa Sep 24, 2024
1d71411
Merge pull request #473 from SBNSoftware/feature/lwan_update_caloskim…
ibsafa Sep 24, 2024
77374c2
Merge branch 'develop' into summed-adc-interface
ibsafa Sep 24, 2024
b94eb79
Merge pull request #474 from SBNSoftware/main
ibsafa Sep 24, 2024
79fa4f3
Revert "Main"
ibsafa Sep 24, 2024
f923d3d
Merge pull request #475 from SBNSoftware/revert-474-main
ibsafa Sep 24, 2024
87baa5a
update deps and version
Sep 24, 2024
2ab76b9
Merge branch 'develop' into summed-adc-interface
ibsafa Sep 24, 2024
662cd1a
Merge branch 'release/v09_92_00' into summed-adc-interface
ibsafa Sep 24, 2024
7017ea4
Merge pull request #472 from knoepfel/summed-adc-interface
ibsafa Sep 24, 2024
370bdb1
deleted second application of GReWeightResonanceDecay calculator
leehagaman Oct 3, 2024
d0aeb51
Merge pull request #476 from leehagaman/develop
ibsafa Oct 17, 2024
e3275fe
larsoft dep
Oct 17, 2024
b490fb4
Merge branch 'release/v09_92_00'
Oct 17, 2024
4ab4407
Merge tag 'v09_92_00' into develop
Oct 17, 2024
5fce574
Merge branch 'develop' of https://github.com/SBNSoftware/sbncode into…
Oct 17, 2024
9028014
update larsoft dependency
Oct 30, 2024
c168f15
update nusystematics dependency
Oct 30, 2024
ccdf1cb
Update larsoft dependency to accommodate larreco patch needed for SBND
Oct 30, 2024
1d384a5
Merge tag 'v09_93_01' into develop
Oct 30, 2024
6607b03
artdaq core dependency. back to online version
Nov 7, 2024
12133ea
Initial commit of SimEnergyDeposit filter around defined rectangular …
Nov 7, 2024
c406c1d
reassign CRT-PMT MatchID while filling CAFs
aheggest Nov 8, 2024
b67723d
patch to enable sbndaq artdaq v10
Nov 10, 2024
f16e1b9
Merge branch 'develop' into geom-separate
knoepfel Nov 11, 2024
f3f378d
Merge branch 'develop' into feature/aheggest_reassignCRTPMTMatchIDinCAF
aheggest Nov 11, 2024
fa0b933
introduced counters for bottomCRT in a comment for future use, curren…
aheggest Nov 12, 2024
17d30da
Merge branch 'feature/aheggest_reassignCRTPMTMatchIDinCAF' of github.…
aheggest Nov 12, 2024
1b10bbd
Update filter module for ICARUS systematic studies
Nov 21, 2024
3ae3b13
Merge pull request #393 from knoepfel/geom-separate
ibsafa Dec 2, 2024
57269e3
Updated commit hashtag for Supera
Dec 2, 2024
468453f
trailing geometry refactoring typo
Dec 2, 2024
1b54a0f
artdaq_core dependency
Dec 2, 2024
8f94ec0
Release moving to larsoft v10
Dec 2, 2024
ad1c936
Merge tag 'v10_01_03' into develop
Dec 2, 2024
5c6b0bb
Merge branch 'develop' into feature/jzettle_sedfilter
ibsafa Dec 2, 2024
2ceda19
Merge branch 'develop' into feature/aheggest_reassignCRTPMTMatchIDinCAF
ibsafa Dec 3, 2024
fa5a922
Merge pull request #482 from SBNSoftware/feature/aheggest_reassignCRT…
ibsafa Dec 3, 2024
7e0d750
Merge branch 'develop' into feature/jzettle_sedfilter
ibsafa Dec 6, 2024
56b8089
Addressing review comments
Dec 6, 2024
b6adf33
Merge branch 'feature/jzettle_sedfilter' of https://github.com/SBNSof…
Dec 6, 2024
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
9 changes: 9 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
### Description
Please provide a detailed description of the changes this pull request introduces. If available, also link to a docdb link where the issue/change have been presented on/discussed.

- [X] Have you added a label? (bug/enhancement/physics etc.)
- [X] Have you assigned at least 1 reviewer?
- [X] Is this PR related to an open issue / project?
- [X] Does this PR affect CAF data format? If so, please assign a CAF maintainer as additional reviewer.
- [X] Does this PR require merging another PR in a different repository (such as sbnanobj/sbnobj etc.)? If so, please link it in the description.
- [X] Are you submitting this PR on behalf of someone else who made the code changes? If so, please mention them in the description.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
cmake_minimum_required(VERSION 3.20 FATAL_ERROR)

find_package(cetmodules 3.20.00 REQUIRED)
project(sbncode VERSION 09.89.01.01 LANGUAGES CXX)
project(sbncode VERSION 10.01.03 LANGUAGES CXX)

message(STATUS "\n\n ========================== ${PROJECT_NAME} ==========================")

Expand Down
4 changes: 4 additions & 0 deletions sbncode/CAFMaker/CAFMakerParams.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,10 @@ namespace caf
Comment("Provide a string to override the automatic filename."), ""
};

Atom<bool> SaveGENIEEventRecord { Name("SaveGENIEEventRecord"),
Comment("Whether to produce GENIE event record to the output file"), false
};

Atom<float> PrescaleFactor { Name("PrescaleFactor"),
Comment("Factor by which to prescale unblind events"), 10
};
Expand Down
115 changes: 98 additions & 17 deletions sbncode/CAFMaker/CAFMaker_module.cc
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,8 @@
#include "messagefacility/MessageLogger/MessageLogger.h"

// LArSoft includes
#include "larcore/Geometry/WireReadout.h"
#include "larcore/Geometry/Geometry.h"
#include "lardataobj/RecoBase/PFParticle.h"
#include "lardataobj/RecoBase/Slice.h"
#include "lardataobj/RecoBase/Track.h"
Expand All @@ -99,8 +101,6 @@
#include "nusimdata/SimulationBase/MCNeutrino.h"
#include "nusimdata/SimulationBase/GTruth.h"

#include "fhiclcpp/ParameterSetRegistry.h"

#include "sbnobj/Common/EventGen/MeVPrtl/MeVPrtlTruth.h"
#include "sbnobj/Common/Reco/RangeP.h"
#include "sbnobj/Common/SBNEventWeight/EventWeightMap.h"
Expand All @@ -116,6 +116,11 @@
#include "sbnobj/Common/Reco/CRUMBSResult.h"
#include "sbnobj/Common/Reco/OpT0FinderResult.h"

// GENIE
#include "Framework/EventGen/EventRecord.h"
#include "Framework/Ntuple/NtpMCEventRecord.h"
#include "nugen/EventGeneratorBase/GENIE/GENIE2ART.h"

#include "canvas/Persistency/Provenance/ProcessConfiguration.h"
#include "larcoreobj/SummaryData/POTSummary.h"

Expand Down Expand Up @@ -190,6 +195,7 @@ class CAFMaker : public art::EDProducer {
std::string fFlatCafPrescaleFilename;

std::string fSourceFile;
std::uint32_t fSourceFileHash;

bool fFirstInSubRun;
unsigned int fIndexInFile = SRHeader::NoSourceIndex;
Expand Down Expand Up @@ -232,6 +238,14 @@ class CAFMaker : public art::EDProducer {
TTree* fFlatTreeb = 0;
TTree* fFlatTreep = 0;

// GENIE EventRecord
genie::NtpMCEventRecord * fGenieEvtRec = 0;
TTree * fGenieTree = 0;
genie::NtpMCEventRecord * fFlatGenieEvtRec = 0;
TTree * fFlatGenieTree = 0;
bool fSaveGENIEEventRecord;
unsigned int fGenieEventCounter;

flat::Flat<caf::StandardRecord>* fFlatRecord = 0;
flat::Flat<caf::StandardRecord>* fFlatRecordb = 0;
flat::Flat<caf::StandardRecord>* fFlatRecordp = 0;
Expand Down Expand Up @@ -374,6 +388,8 @@ class CAFMaker : public art::EDProducer {
// setup volume definitions
InitVolumes();

fSaveGENIEEventRecord = fParams.SaveGENIEEventRecord();

}

//......................................................................
Expand Down Expand Up @@ -536,9 +552,14 @@ void CAFMaker::InitVolumes() {
//......................................................................
CAFMaker::~CAFMaker()
{

delete fGenieEvtRec;
delete fGenieTree;
delete fRecTree;
delete fFile;

delete fFlatGenieEvtRec;
delete fFlatGenieTree;
delete fFlatRecord;
delete fFlatTree;
delete fFlatFile;
Expand Down Expand Up @@ -640,6 +661,13 @@ void CAFMaker::respondToOpenInputFile(const art::FileBlock& fb) {
fFirstBlindInFile = true;
fFirstPrescaleInFile = true;
fSourceFile = inputBasename;
// Getting full hash
size_t fSourceFileHashFull = std::hash<std::string>{}(fSourceFile);
// truncate the full hash into a 32-bit integer
// This is required to be used as one of the ingredient of TTree::BuildIndex();
// it shifts the "major" value by 32-bit (https://root.cern/doc/master/classTTreeIndex.html#a08aac749ab22fd5c8ab792a0061a4b0f),
// so should be less than or equal to 32-bit
fSourceFileHash = static_cast<std::uint32_t>(fSourceFileHashFull);

}

Expand Down Expand Up @@ -948,6 +976,7 @@ void CAFMaker::AddMetadataToFile(TFile* outfile, const std::map<std::string, std
//......................................................................
void CAFMaker::InitializeOutfiles()
{

if(fParams.CreateCAF()){

mf::LogInfo("CAFMaker") << "Output filename is " << fCafFilename;
Expand Down Expand Up @@ -976,7 +1005,15 @@ void CAFMaker::InitializeOutfiles()
AddEnvToFile(fFilep);
}

}
if (fSaveGENIEEventRecord) {
fGenieTree = new TTree( "GenieEvtRecTree", "GenieEvtRecTree" );
fGenieTree->Branch("GenieEvtRec", &fGenieEvtRec);
fGenieTree->Branch("GENIEEntry", &fGenieEventCounter, "GENIEEntry/i");
fGenieTree->Branch("SourceFileHash", &fSourceFileHash, "SourceFileHash/i");
}

}


if(fParams.CreateFlatCAF()){
mf::LogInfo("CAFMaker") << "Output flat filename is " << fFlatCafFilename;
Expand Down Expand Up @@ -1011,8 +1048,17 @@ void CAFMaker::InitializeOutfiles()
AddEnvToFile(fFlatFilep);
}

if (fSaveGENIEEventRecord){
fFlatGenieTree = new TTree( "GenieEvtRecTree", "GenieEvtRecTree" );
fFlatGenieTree->Branch("GenieEvtRec", &fFlatGenieEvtRec);
fFlatGenieTree->Branch("GENIEEntry", &fGenieEventCounter, "GENIE/i");
fFlatGenieTree->Branch("SourceFileHash", &fSourceFileHash, "SourceFileHash/i");
}

}

fGenieEventCounter = 0;

fFileNumber = -1;
fTotalPOT = 0;
fSubRunPOT = 0;
Expand Down Expand Up @@ -1256,7 +1302,9 @@ void CAFMaker::produce(art::Event& evt) noexcept {
auto const clock_data = art::ServiceHandle<detinfo::DetectorClocksService const>()->DataFor(evt);
auto const dprop =
art::ServiceHandle<detinfo::DetectorPropertiesService const>()->DataFor(evt, clock_data);
const geo::GeometryCore *geometry = lar::providerFrom<geo::Geometry>();
const geo::GeometryCore* geom = lar::providerFrom<geo::Geometry>();
const geo::WireReadoutGeom &wireReadout =
art::ServiceHandle<geo::WireReadout>()->Get();

auto const *sce = lar::providerFrom<spacecharge::SpaceChargeService>();

Expand Down Expand Up @@ -1284,7 +1332,7 @@ void CAFMaker::produce(art::Event& evt) noexcept {
if ( !isRealData ) {
art::ServiceHandle<cheat::BackTrackerService> bt_serv;

id_to_ide_map = PrepSimChannels(simchannels, *geometry);
id_to_ide_map = PrepSimChannels(simchannels, wireReadout);
id_to_truehit_map = PrepTrueHits(hits, clock_data, *bt_serv);
id_to_hit_energy_map = SetupIDHitEnergyMap(hits, clock_data, *bt_serv);
}
Expand Down Expand Up @@ -1329,10 +1377,33 @@ void CAFMaker::produce(art::Event& evt) noexcept {
std::cout << "Failed to get GTruth object!" << std::endl;
}

//GENIE EventRecord

srtruthbranch.nu.push_back(SRTrueInteraction());
srtruthbranch.nnu ++;

if ( !isRealData ) FillTrueNeutrino(mctruth, mcflux, gtruth, true_particles, id_to_truehit_map, srtruthbranch.nu.back(), i, fActiveVolumes);
if ( !isRealData ){

FillTrueNeutrino(mctruth, mcflux, gtruth, true_particles, id_to_truehit_map, srtruthbranch.nu.back(), i, fActiveVolumes);

srtruthbranch.nu.back().genie_evtrec_idx = fGenieEventCounter;

// GENIE event record
if(fSaveGENIEEventRecord){
genie::EventRecord* genie_rec = evgb::RetrieveGHEP(*mctruth, gtruth);
if(fGenieTree){
fGenieEvtRec->Fill(fGenieEventCounter, genie_rec);
fGenieTree->Fill();
}
if(fFlatGenieTree){
fFlatGenieEvtRec->Fill(fGenieEventCounter, genie_rec);
fFlatGenieTree->Fill();
}
}

fGenieEventCounter++;

}

// Don't check for syst weight assocations until we have something (MCTruth
// corresponding to a neutrino) that could plausibly be reweighted. This
Expand Down Expand Up @@ -1481,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 Expand Up @@ -1979,7 +2049,7 @@ void CAFMaker::produce(art::Event& evt) noexcept {
FillTrackRangeP(*thisTrack[0], rangePs, trk);

if (fmChi2PID.isValid()) {
FillTrackChi2PID(fmChi2PID.at(iPart), lar::providerFrom<geo::Geometry>(), trk);
FillTrackChi2PID(fmChi2PID.at(iPart), trk);
}
if (fmScatterClosestApproach.isValid() && fmScatterClosestApproach.at(iPart).size()==1) {
FillTrackScatterClosestApproach(fmScatterClosestApproach.at(iPart).front(), trk);
Expand All @@ -1994,7 +2064,7 @@ void CAFMaker::produce(art::Event& evt) noexcept {
FillTrackCalo(fmCalo.at(iPart), fmTrackHit.at(iPart),
(fParams.FillHitsNeutrinoSlices() && NeutrinoSlice) || fParams.FillHitsAllSlices(),
fParams.TrackHitFillRRStartCut(), fParams.TrackHitFillRREndCut(),
lar::providerFrom<geo::Geometry>(), dprop, trk);
dprop, trk);
}
if (fmCRTHitMatch.isValid() && fDet == kICARUS) {
art::FindManyP<sbn::crt::CRTHit> CRTT02Hit = FindManyPStrict<sbn::crt::CRTHit>
Expand Down Expand Up @@ -2032,7 +2102,7 @@ void CAFMaker::produce(art::Event& evt) noexcept {
FillTrackTruth(fmTrackHit.at(iPart), id_to_hit_energy_map, true_particles, clock_data, trk);
// Hit truth information corresponding to Calo-Points
// Assumes truth matching and calo-points are filled
if (mc_particles.isValid() && fParams.FillTrackCaloTruth()) FillTrackCaloTruth(id_to_ide_map, *mc_particles, geometry, clock_data, sce, trk);
if (mc_particles.isValid() && fParams.FillTrackCaloTruth()) FillTrackCaloTruth(id_to_ide_map, *mc_particles, *geom, wireReadout, clock_data, sce, trk);
}
}
} // thisTrack exists
Expand All @@ -2041,7 +2111,7 @@ void CAFMaker::produce(art::Event& evt) noexcept {
assert(thisShower.size() == 1);

SRShower& shw = pfp.shw;
FillShowerVars(*thisShower[0], vertex, fmShowerHit.at(iPart), lar::providerFrom<geo::Geometry>(), producer, shw);
FillShowerVars(*thisShower[0], vertex, fmShowerHit.at(iPart), wireReadout, producer, shw);

// We may have many residuals per shower depending on how many showers ar in the slice
if (fmShowerRazzle.isValid() && fmShowerRazzle.at(iPart).size()==1) {
Expand Down Expand Up @@ -2189,6 +2259,8 @@ void CAFMaker::produce(art::Event& evt) noexcept {
rec.hdr.ngenevt = n_gen_evt;
rec.hdr.mctype = mctype;
rec.hdr.sourceName = fSourceFile;
rec.hdr.sourceNameHash = fSourceFileHash;

rec.hdr.sourceIndex = fIndexInFile;
rec.hdr.first_in_file = firstInFile;
rec.hdr.first_in_subrun = fFirstInSubRun;
Expand Down Expand Up @@ -2349,6 +2421,10 @@ void CAFMaker::endJob() {

AddHistogramsToFile(fFile);
fRecTree->SetDirectory(fFile);
if(fGenieTree){
fGenieTree->BuildIndex("SourceFileHash", "GENIEEntry");
fGenieTree->SetDirectory(fFile);
}
if (fParams.CreateBlindedCAF()) {
fRecTreeb->SetDirectory(fFileb);
fRecTreep->SetDirectory(fFilep);
Expand All @@ -2370,6 +2446,10 @@ void CAFMaker::endJob() {

AddHistogramsToFile(fFlatFile);
fFlatTree->SetDirectory(fFlatFile);
if(fFlatGenieTree){
fFlatGenieTree->BuildIndex("SourceFileHash", "GENIEEntry");
fFlatGenieTree->SetDirectory(fFlatFile);
}
if (fParams.CreateBlindedCAF() && fFlatFileb) {
fFlatTreeb->SetDirectory(fFlatFileb);
fFlatTreep->SetDirectory(fFlatFilep);
Expand All @@ -2384,6 +2464,7 @@ void CAFMaker::endJob() {
fFlatFilep->cd();
fFlatFilep->Write();
}

}

std::map<std::string, std::string> metamap;
Expand Down
2 changes: 2 additions & 0 deletions sbncode/CAFMaker/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ art_make_library( LIBRARY_NAME sbncode_CAFMaker
systematicstools::interface
systematicstools::interpreters
systematicstools::utility
${GENIE_LIB_LIST}
nugen::EventGeneratorBase_GENIE
)

cet_build_plugin ( CAFMaker art::module
Expand Down
Loading