Skip to content
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

Add PandoraLArRecoNDBranchFiller #76

Merged
merged 12 commits into from
Nov 14, 2024
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
16 changes: 1 addition & 15 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,7 @@ FORCE=no
if [[ $# == 1 && x$1 == x-f ]]; then FORCE=yes; fi

# set up software
source /cvmfs/dune.opensciencegrid.org/products/dune/setup_dune.sh
setup cmake v3_22_2
setup gcc v9_3_0
setup pycurl
setup ifdhc
setup geant4 v4_11_0_p01c -q e20:debug
setup dk2nugenie v01_10_01k -q debug:e20
setup genie_xsec v3_04_00 -q AR2320i00000:e1000:k250
setup genie_phyopt v3_04_00 -q dkcharmtau
setup jobsub_client
setup eigen v3_3_5
setup duneanaobj v03_06_01b -q e20:prof
setup hdf5 v1_10_5a -q e20
setup fhiclcpp v4_15_03 -q debug:e20
setup edepsim v3_2_0c -q debug:e20
source ndcaf_setup.sh

# edep-sim needs to know where a certain GEANT .cmake file is...
G4_cmake_file=`find ${GEANT4_FQ_DIR}/lib64 -name 'Geant4Config.cmake'`
Expand Down
30 changes: 30 additions & 0 deletions cfg/pandora.fcl
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#include "NDCAFMaker.fcl"
nd_cafmaker: @local::standard_nd_cafmaker

nd_cafmaker.CAFMakerSettings.GHEPFiles: [
"/exp/dune/data/users/jback/ND_CAFs/MiniRun6/MiniRun5_1E19_RHC.genie.nu.0000010.GHEP.root",
"/exp/dune/data/users/jback/ND_CAFs/MiniRun6/MiniRun5_1E19_RHC.genie.nu.0000011.GHEP.root",
"/exp/dune/data/users/jback/ND_CAFs/MiniRun6/MiniRun5_1E19_RHC.genie.nu.0000012.GHEP.root",
"/exp/dune/data/users/jback/ND_CAFs/MiniRun6/MiniRun5_1E19_RHC.genie.nu.0000013.GHEP.root",
"/exp/dune/data/users/jback/ND_CAFs/MiniRun6/MiniRun5_1E19_RHC.genie.nu.0000014.GHEP.root",
"/exp/dune/data/users/jback/ND_CAFs/MiniRun6/MiniRun5_1E19_RHC.genie.nu.0000015.GHEP.root",
"/exp/dune/data/users/jback/ND_CAFs/MiniRun6/MiniRun5_1E19_RHC.genie.nu.0000016.GHEP.root",
"/exp/dune/data/users/jback/ND_CAFs/MiniRun6/MiniRun5_1E19_RHC.genie.nu.0000017.GHEP.root",
"/exp/dune/data/users/jback/ND_CAFs/MiniRun6/MiniRun5_1E19_RHC.genie.nu.0000018.GHEP.root",
"/exp/dune/data/users/jback/ND_CAFs/MiniRun6/MiniRun5_1E19_RHC.genie.nu.0000019.GHEP.root",
"/exp/dune/data/users/jback/ND_CAFs/MiniRun6/MiniRun5_1E19_RHC.genie.rock.0000010.GHEP.root",
"/exp/dune/data/users/jback/ND_CAFs/MiniRun6/MiniRun5_1E19_RHC.genie.rock.0000011.GHEP.root",
"/exp/dune/data/users/jback/ND_CAFs/MiniRun6/MiniRun5_1E19_RHC.genie.rock.0000012.GHEP.root",
"/exp/dune/data/users/jback/ND_CAFs/MiniRun6/MiniRun5_1E19_RHC.genie.rock.0000013.GHEP.root",
"/exp/dune/data/users/jback/ND_CAFs/MiniRun6/MiniRun5_1E19_RHC.genie.rock.0000014.GHEP.root",
"/exp/dune/data/users/jback/ND_CAFs/MiniRun6/MiniRun5_1E19_RHC.genie.rock.0000015.GHEP.root",
"/exp/dune/data/users/jback/ND_CAFs/MiniRun6/MiniRun5_1E19_RHC.genie.rock.0000016.GHEP.root",
"/exp/dune/data/users/jback/ND_CAFs/MiniRun6/MiniRun5_1E19_RHC.genie.rock.0000017.GHEP.root",
"/exp/dune/data/users/jback/ND_CAFs/MiniRun6/MiniRun5_1E19_RHC.genie.rock.0000018.GHEP.root",
"/exp/dune/data/users/jback/ND_CAFs/MiniRun6/MiniRun5_1E19_RHC.genie.rock.0000019.GHEP.root"
]

nd_cafmaker.CAFMakerSettings.PandoraLArRecoNDFile: "/exp/dune/data/users/jback/ND_CAFs/MiniRun6/LArRecoND_MR6_0000001.root"
nd_cafmaker.CAFMakerSettings.OutputFile: "CAF_MR6_0000001.root"
nd_cafmaker.CAFMakerSettings.Verbosity: VERBOSE
nd_cafmaker.CAFMakerSettings.NumEvts: -1
3 changes: 2 additions & 1 deletion src/Params.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ namespace cafmaker
fhicl::OptionalAtom<std::string> tmsRecoFile { fhicl::Name{"TMSRecoFile"}, fhicl::Comment("Input TMS reco .root file") };
fhicl::OptionalAtom<std::string> sandRecoFile { fhicl::Name{"SANDRecoFile"}, fhicl::Comment("Input SAND reco .root file") };
fhicl::OptionalAtom<std::string> minervaRecoFile { fhicl::Name{"MINERVARecoFile"}, fhicl::Comment("Input MINERVA reco .root file") };

fhicl::OptionalAtom<std::string> pandoraLArRecoNDFile { fhicl::Name{"PandoraLArRecoNDFile"}, fhicl::Comment("Input Pandora LArRecoND .root file") };

// this is optional by way of the default value. Will result in an extra output file if enabled
fhicl::Atom<bool> makeFlatCAF { fhicl::Name{"MakeFlatCAF"}, fhicl::Comment("Make 'flat' CAF in addition to structured CAF?"), true };
Expand Down Expand Up @@ -90,6 +90,7 @@ namespace cafmaker
fhicl::Atom<double> gastpc_B { fhicl::Name("gastpc_B"), fhicl::Comment("Gas TPC B field strength (Tesla)"), 0.4 };
fhicl::Atom<double> gastpc_padPitch { fhicl::Name("gastpc_padPitch"), fhicl::Comment("(Fixed) pad pitch of gas TPC (cm)"), 0.1 }; // Actual pad pitch varies, which is going to be impossible to implement
fhicl::Atom<double> gastpc_X0 { fhicl::Name("gastpc_X0"), fhicl::Comment("Gas TPC radiation length (cm)"), 1300. };
fhicl::Atom<float> LArDensity { fhicl::Name("LArDensity"), fhicl::Comment("LAr density (g/cm3)"), 1.3973 };
};

/// FHICL table specifying which params are accepted
Expand Down
20 changes: 15 additions & 5 deletions src/makeCAF.C
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@

#include "reco/NDLArTMSMatchRecoFiller.h"
#include "reco/NDLArMINERvAMatchRecoFiller.h"
#include "reco/PandoraLArRecoNDBranchFiller.h"
#include "reco/SANDRecoBranchFiller.h"
#include "truth/FillTruth.h"
#include "beam/IFBeam.h"
Expand Down Expand Up @@ -138,6 +139,15 @@ std::vector<std::unique_ptr<cafmaker::IRecoBranchFiller>> getRecoFillers(const c
std::cout << " SAND\n";
}

// Pandora LArRecoND
std::string pandoraFile;
if (par().cafmaker().pandoraLArRecoNDFile(pandoraFile))
{
const float LArDensity = par().pseudoReco().LArDensity(); // For track lengths in g/cm2
recoFillers.emplace_back(std::make_unique<cafmaker::PandoraLArRecoNDBranchFiller>(pandoraFile, LArDensity));
std::cout << " Pandora LArRecoND\n";
}

// next: did we do TMS reco?
std::string tmsFile;
if (par().cafmaker().tmsRecoFile(tmsFile))
Expand Down Expand Up @@ -165,7 +175,7 @@ std::vector<std::unique_ptr<cafmaker::IRecoBranchFiller>> getRecoFillers(const c
{
recoFillers.emplace_back(std::make_unique<cafmaker::NDLArMINERvAMatchRecoFiller>(par().cafmaker().trackMatchExtrapolatedZ(), par().cafmaker().trackMatchdX(), par().cafmaker().trackMatchdY(), par().cafmaker().trackMatchdThetaX(), par().cafmaker().trackMatchdThetaY()));
std::cout << " ND-LAr + MINERvA matching\n";
}
}
// for now all the fillers get the same threshold.
// if we decide we need to do it differently later
// we can adjust the FCL params...
Expand Down Expand Up @@ -375,7 +385,7 @@ void loop(CAF &caf,

bool useIFBeam = false;
if (ghepFilenames.empty() && edepsimFilename.empty() && !par().cafmaker().ForceDisableIFBeam()) useIFBeam = true;

cafmaker::IFBeam beamManager(groupedTriggers, useIFBeam); //initialize IFBeam manager if data and when IFBeam is not force disabled

// Main event loop
Expand Down Expand Up @@ -407,17 +417,17 @@ void loop(CAF &caf,
filler->FillRecoBranches(groupedTriggers[ii][0].second, caf.sr, par, &truthMatcher);
}
}

//Fill POT
double pot = 0.0;
if (useIFBeam)
{
pot = beamManager.getPOT(par, groupedTriggers[ii], ii);
pot = beamManager.getPOT(par, groupedTriggers[ii], ii);
}
else
{
pot = par().runInfo().POTPerSpill() * 1e13;
caf.sr.beam.ismc = true;
caf.sr.beam.ismc = true;
}
if (std::isnan(caf.pot))
caf.pot = 0;
Expand Down
Loading