Process one event.
232 <<
"(" <<
_nu_count <<
" neutrinos selected)"
240 auto const& mctruths = \
241 *ev.getValidHandle<std::vector<simb::MCTruth> >(
fTruthTag);
243 auto const& mctracks = \
244 *ev.getValidHandle<std::vector<sim::MCTrack> >(
fMCTrackTag);
245 auto const& mcshowers = \
246 *ev.getValidHandle<std::vector<sim::MCShower> >(
fMCShowerTag);
252 for (
unsigned i = 0; i < mctruths.size(); i++) {
253 auto const &mctruth = mctruths[i];
258 if (!pass_kMEC)
continue;
260 weight *= interaction.
weights.at(key)[0];
262 if (
containedInAV(mctruth.GetNeutrino().Nu().Position().Vect())) {
263 bool iscc = mctruth.GetNeutrino().CCNC() == 0;
264 unsigned n_pions = 0;
265 for (
auto const &mctrack: mctracks) {
266 if (
isFromNuVertex(mctruth, mctrack) &&
abs(mctrack.PdgCode()) == 211 && mctrack.Process() ==
"primary") {
285 int mode = mctruth.GetNeutrino().Mode();
298 bool selected =
false;
299 for (
size_t i=0; i<mctruths.size(); i++) {
300 auto const& mctruth = mctruths.at(i);
302 const simb::MCNeutrino&
nu = mctruth.GetNeutrino();
305 VisibleEnergyCalculator calculator;
306 calculator.lepton_pdgid = 13;
329 reco_interaction.reco_energy = visible_energy;
335 weight *= interaction.
weights.at(key)[0];
342 if (
abs(intInfo.t_pdgid) != 13) {
348 if (
abs(intInfo.t_pdgid) == 13) {
365 reco_interaction.weight = weight;
368 std::array<bool, NumuSelection::nCuts> selection =
Select(ev, mctruth, i, intInfo);
371 bool pass_selection = std::find(selection.begin(), selection.end(),
false) == selection.end();
372 if (pass_selection) {
374 reco.push_back(reco_interaction);
383 for (
size_t select_i=0; select_i < selection.size(); select_i++) {
384 if (selection[select_i]) {
TH1D * h_numu_t_is_muon_bkg
histogram of whether associated track is a muon
std::vector< NuMuInteraction > * _interactionInfo
Branch holder.
double showerEnergyDistortion
Energy distortion of showers for visible energy calculation (%).
TGraph * _cut_counts
Keep track of neutrinos per cut.
double constantEnergyScale
constant scale to apply to reco_energy calculation
double visibleEnergyProposal(TRandom &rand, const simb::MCTruth &mctruth, const std::vector< sim::MCTrack > &mctrack_list, const VisibleEnergyCalculator &calculator)
TH1D * h_numu_contained_L
histogram w/ FV contained length of track in CC event [cm]
TH1D * h_numu_t_length
histogram w/ total length of associated track [cm]
TVector3 momentum
Three-momentum.
bool containedInAV(const TVector3 &v)
double trackVisibleEnergyThreshold
Energy threshold for track to be acounted in visible energy calculation [GeV].
art::InputTag fTruthTag
art tag for MCTruth information
FinalStateParticle lepton
The primary final state lepton.
TH1D * h_numu_ccqe
histogram w/ CCQE energy veriable [GeV]
TH2D * h_numu_Vxy
2D x-y vertex histogram [cm]
bool isFromNuVertex(const simb::MCTruth &mc, const simb::MCParticle &mcp, float distance)
TH1D * h_numu_t_is_muon
histogram of whether associated track is a muon
Neutrino neutrino
The neutrino.
double backgroundRejection
Rejection applied to background (NC) events.
bool cutKMEC
Whether to remove MEC events (useful for studying difference w.r.t. proposal)
Config _config
The config.
bool iscc
CC (true) or NC/interference (false)
TH1D * h_numu_t_is_muon_sig
histogram of whether associated track is a muon
bool onlyKMEC
Whether to remove all non-MEC events.
double constantNCWeight
constant weight to apply to each NC event
std::map< std::string, double > _eventCategories
double leptonEnergyDistortionLeavingB
Parameter to be used in the energy distortion of primary lepton for visible energy calculation...
double leptonEnergyDistortionLeavingA
Parameter to be used in the energy distortion of primary lepton for visible energy calculation...
double leptonEnergyDistortionContained
Contains truth level information and additional fields for selection-defined reconstruction informati...
double constantCCWeight
constant weight to apply to each CC event
std::vector< std::string > uniformWeights
Weights taken from "EventWeight" that should be applied to the weight of each event.
TRandomMT64 _rand
random number generation
std::array< bool, nCuts > Select(const gallery::Event &ev, const simb::MCTruth &mctruth, unsigned truth_ind, const NumuSelection::NuMuInteraction &intInfo)
art::InputTag fMCShowerTag
art tag for MCShower
TH1D * h_numu_trueE
histogram w/ truth energy variable [GeV]
TH1D * h_numu_true_v_visibleE
histogram w/ difference of visible and truth energy [GeV]
unsigned _nu_count
Count selected events.
double constantWeight
constant weight to apply uniformly to each event
RootHistos _root_histos[nCuts]
Histos (one group per cut)
unsigned _event_counter
Count processed events.
TH1D * h_numu_visibleE
histogram w/ visible energy variable (total muon momentum + kinetic hadron energy) [GeV] ...
TH2D * h_numu_Vxz
2D x-z vertex histogram [cm]
double ECCQE(const TVector3 &l_momentum, double l_energy, double energy_distortion, double angle_distortion)
float energy
Neutrino energy (GeV)
double trackEnergyDistortion
Energy distortion of tracks for visible energy calculation (%).
double selectionEfficiency
Signal efficiency weight applied to signal (charged current) events.
TH1D * h_numu_t_is_contained
histogram w/ whether associated track is contained in AV
art::InputTag fMCTrackTag
art tag for MCTrack
NuMuInteraction interactionInfo(const gallery::Event &ev, const simb::MCTruth &mctruth, VisibleEnergyCalculator &calculator)
TH2D * h_numu_Vyz
2D y-z vertex histogram [cm]
All truth information associated with one neutrino interaction.
BEGIN_PROLOG could also be cout
std::map< std::string, std::vector< float > > weights