diff --git a/src/MINERvA/MINERvA_SignalDef.cxx b/src/MINERvA/MINERvA_SignalDef.cxx new file mode 100644 index 0000000..1198fd8 --- /dev/null +++ b/src/MINERvA/MINERvA_SignalDef.cxx @@ -0,0 +1,213 @@ +// Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret + +/******************************************************************************* +* This file is part of NUISANCE. +* +* NUISANCE is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* NUISANCE is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with NUISANCE. If not, see <http://www.gnu.org/licenses/>. +*******************************************************************************/ + +#include "SignalDef.h" +#include "FitUtils.h" + +#include "MINERvA_SignalDef.h" + +namespace SignalDef { + +// ********************************* +// MINERvA CC1pi+/- signal definition (2015 release) +// Note: There is a 2016 release which is different to this (listed below), but +// it is CCNpi+ and has a different W cut +// Note2: The W cut is implemented in the class implementation in MINERvA/ +// rather than here so we can draw events that don't pass the W cut (W cut is +// 1.4 GeV) +// Could possibly be changed for slight speed increase since less events +// would be used +// +// MINERvA signal is slightly different to MiniBooNE +// +// Exactly one negative muon +// Exactly one charged pion (both + and -); however, there is a Michel e- +// requirement but UNCLEAR IF UNFOLDED OR NOT (so don't know if should be +// applied) +// Exactly 1 charged pion exits (so + and - charge), however, has Michel +// electron requirement, so look for + only here? +// No restriction on neutral pions or other mesons +// MINERvA has unfolded and not unfolded muon phase space for 2015 +// +// Possible problems: +// 1) Should there be a pi+ only cut implemented due to Michel requirement, or +// is pi- events filled from MC? +// 2) There is a T_pi < 350 MeV cut coming from requiring a stopping pion so the +// Michel e is seen, this is also unclear if it's unfolded so any pion is OK +// +// Nice things: +// Much data given: with and without muon angle cuts and with and without shape +// only data + covariance +// +bool isCC1pip_MINERvA(FitEvent *event, double EnuMin, double EnuMax, + bool isRestricted) { + // ********************************* + + // Signal is both pi+ and pi- + // WARNING: PI- CONTAMINATION IS FULLY GENIE BECAUSE THE MICHEL TAG + // First, make sure it's CCINC + if (!isCCINC(event, 14, EnuMin, EnuMax)) return false; + + // Allow pi+/pi- + int piPDG[] = {211, -211}; + int nLeptons = event->NumFSLeptons(); + int nPion = event->NumFSParticle(piPDG); + + // Check that the desired pion exists and is the only meson + if (nPion != 1) return false; + + // Check that there is only one final state lepton + if (nLeptons != 1) return false; + + TLorentzVector pnu = event->GetHMISParticle(14)->fP; + TLorentzVector pmu = event->GetHMFSParticle(13)->fP; + + // Pion kinetic energy requirement for Michel tag, leave commented for now + // if (FitUtils::T(ppi)*1000. > 350 || FitUtils::T(ppi)*1000. < 35) return + // false; // Need to have a 35 to 350 MeV pion kinetic energy requirement + + // MINERvA released another CC1pi+ xsec without muon unfolding! + // here the muon angle is < 20 degrees (seen in MINOS) + if (isRestricted) { + double th_nu_mu = FitUtils::th(pmu, pnu) * 180. / M_PI; + if (th_nu_mu >= 20) return false; + } + + return true; +}; + +// ********************************* +// MINERvA CCNpi+/- signal definition from 2016 publication +// Different to CC1pi+/- listed above; additional has W < 1.8 GeV +// +// Still asks for a Michel e and still unclear if this is unfolded or not +// Says stuff like "requirement that a Michel e isolates a subsample that is +// more nearly a pi+ prodution", yet the signal definition is both pi+ and pi-? +// +// One negative muon +// At least one charged pion +// 1.5 < Enu < 10 +// No restrictions on pi0 or other mesons or baryons +// +// Also writes number of pions (nPions) if studies on this want to be done... +bool isCCNpip_MINERvA(FitEvent *event, int &nPions, double EnuMin, + double EnuMax, bool isRestricted) { + // ********************************* + + // First, make sure it's CCINC + if (!isCCINC(event, 14, EnuMin, EnuMax)) return false; + + int nLeptons = event->NumFSLeptons(); + + // Write the number of pions to the measurement class... + // Maybe better to just do that inside the class? + int pdgs[] = {-211, 211}; + nPions = event->NumFSParticle(pdgs); + + // Check that there is a pion! + if (nPions == 0) return false; + + // Check that there is only one final state lepton + if (nLeptons != 1) return false; + + TLorentzVector pnu = event->GetHMISParticle(14)->fP; + TLorentzVector pmu = event->GetHMFSParticle(13)->fP; + + // MINERvA released another CC1pi+ xsec without muon unfolding! + // Here the muon angle is < 20 degrees (seen in MINOS) + if (isRestricted) { + double th_nu_mu = FitUtils::th(pmu, pnu) * 180. / M_PI; + if (th_nu_mu >= 20) return false; + } + + return true; +}; + +//******************************************************************** +bool isCCQEnumu_MINERvA(FitEvent *event, double EnuMin, double EnuMax, + bool fullphasespace) { + //******************************************************************** + + if (!isCCQELike(event, 14, EnuMin, EnuMax)) return false; + + TLorentzVector pnu = event->GetHMISParticle(14)->fP; + TLorentzVector pmu = event->GetHMFSParticle(13)->fP; + + double ThetaMu = pnu.Vect().Angle(pmu.Vect()); + double Enu_rec = FitUtils::EnuQErec(pmu, cos(ThetaMu), 34., true); + + // If Restricted phase space + if (!fullphasespace && ThetaMu > 0.34906585) return false; + + // restrict energy range + if (Enu_rec < EnuMin || Enu_rec > EnuMax) return false; + + return true; +}; + +//******************************************************************** +bool isCCQEnumubar_MINERvA(FitEvent *event, double EnuMin, double EnuMax, + bool fullphasespace) { + //******************************************************************** + + if (!isCCQELike(event, -14, EnuMin, EnuMax)) return false; + + TLorentzVector pnu = event->GetHMISParticle(-14)->fP; + TLorentzVector pmu = event->GetHMFSParticle(-13)->fP; + + double ThetaMu = pnu.Vect().Angle(pmu.Vect()); + double Enu_rec = FitUtils::EnuQErec(pmu, cos(ThetaMu), 30., true); + + // If Restricted phase space + if (!fullphasespace && ThetaMu > 0.34906585) return false; + + // restrict energy range + if (Enu_rec < EnuMin || Enu_rec > EnuMax) return false; + + return true; +} + +//******************************************************************** +bool isCCincLowRecoil_MINERvA(FitEvent *event, double EnuMin, double EnuMax) { + //******************************************************************** + + if (!isCCINC(event, 14, EnuMin, EnuMax)) return false; + + // Need at least one muon + if (event->NumFSParticle(13) < 1) return false; + TLorentzVector pmu = event->GetHMFSParticle(13)->fP; + TLorentzVector pnu = event->GetHMISParticle(14)->fP; + + // Cut on muon angle greated than 20deg + if (pnu.Vect().Angle(pmu.Vect()) < 0.93969262078) return false; + + // Cut on muon energy < 1.5 GeV + if (pmu.E() < 1.5) return false; + + return true; +} + +bool isCC0pi1p_MINERvA(FitEvent *event, double enumin, double enumax) { + // Require numu CC0pi event with a proton above threshold + bool signal = (isCC0pi(event, 14, enumin, enumax) && + HasProtonKEAboveThreshold(event, 110.0)); + + return signal; +} +} diff --git a/src/MINERvA/MINERvA_SignalDef.h b/src/MINERvA/MINERvA_SignalDef.h new file mode 100644 index 0000000..0eb68e4 --- /dev/null +++ b/src/MINERvA/MINERvA_SignalDef.h @@ -0,0 +1,88 @@ +// Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret + +/******************************************************************************* +* This file is part of NUISANCE. +* +* NUISANCE is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* NUISANCE is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with NUISANCE. If not, see <http://www.gnu.org/licenses/>. +*******************************************************************************/ + +#ifndef MINERVA_SIGNALDEF_H_SEEN +#define MINERVA_SIGNALDEF_H_SEEN + +#include "FitEvent.h" + +namespace SignalDef { + +// ********************************* +/// MINERvA CC1pi+/- signal definition (2015 release) +/// Note: There is a 2016 release which is different to this (listed below), +/// but +/// it is CCNpi+ and has a different W cut +/// Note2: The W cut is implemented in the class implementation in MINERvA/ +/// rather than here so we can draw events that don't pass the W cut (W cut is +/// 1.4 GeV) +/// Could possibly be changed for slight speed increase since less events +/// would be used +/// +/// MINERvA signal is slightly different to MiniBooNE +/// +/// Exactly one negative muon +/// Exactly one charged pion (both + and -); however, there is a Michel e- +/// requirement but UNCLEAR IF UNFOLDED OR NOT (so don't know if should be +/// applied) +/// Exactly 1 charged pion exits (so + and - charge), however, has Michel +/// electron requirement, so look for + only here? +/// No restriction on neutral pions or other mesons +/// MINERvA has unfolded and not unfolded muon phase space for 2015 +/// +/// Possible problems: +/// 1) Should there be a pi+ only cut implemented due to Michel requirement, or +/// is pi- events filled from MC? +/// 2) There is a T_pi < 350 MeV cut coming from requiring a stopping pion so +/// the +/// Michel e is seen, this is also unclear if it's unfolded so any pion is OK +/// +/// Nice things: +/// Much data given: with and without muon angle cuts and with and without shape +/// only data + covariance +bool isCC1pip_MINERvA(FitEvent *event, double EnuMin, double EnuMax, + bool isRestricted = false); +// ********************************* +/// MINERvA CCNpi+/- signal definition from 2016 publication +/// Different to CC1pi+/- listed above; additional has W < 1.8 GeV +/// +/// Still asks for a Michel e and still unclear if this is unfolded or not +/// Says stuff like "requirement that a Michel e isolates a subsample that is +/// more nearly a pi+ prodution", yet the signal definition is both pi+ and pi-? +/// +/// One negative muon +/// At least one charged pion +/// 1.5 < Enu < 10 +/// No restrictions on pi0 or other mesons or baryons +/// +/// Also writes number of pions (nPions) if studies on this want to be done... +bool isCCNpip_MINERvA(FitEvent *event, int &nPions, double EnuMin, + double EnuMax, bool isRestricted = false); + +bool isCCQEnumu_MINERvA(FitEvent *event, double EnuMin, double EnuMax, + bool fullphasespace = true); +bool isCCQEnumubar_MINERvA(FitEvent *event, double EnuMin, double EnuMax, + bool fullphasespace = true); + +bool isCCincLowRecoil_MINERvA(FitEvent *event, double EnuMin, double EnuMax); + +bool isCC0pi1p_MINERvA(FitEvent *event, double enumin, double enumax); +} + +#endif diff --git a/src/T2K/T2K_SignalDef.cxx b/src/T2K/T2K_SignalDef.cxx new file mode 100644 index 0000000..dbfa0a1 --- /dev/null +++ b/src/T2K/T2K_SignalDef.cxx @@ -0,0 +1,152 @@ +// Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret + +/******************************************************************************* +* This file is part of NUISANCE. +* +* NUISANCE is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* NUISANCE is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with NUISANCE. If not, see <http://www.gnu.org/licenses/>. +*******************************************************************************/ + +#include "FitUtils.h" + +#include "T2K_SignalDef.h" + +namespace SignalDef { + +// T2K H2O signal definition +bool isCC1pip_T2K_H2O(FitEvent *event, double EnuMin, + double EnuMax) { + + if (!isCC1pi(event, 14, 211, EnuMin, EnuMax)) return false; + + TLorentzVector Pnu = event->GetHMISParticle(14)->fP; + TLorentzVector Pmu = event->GetHMFSParticle(13)->fP; + TLorentzVector Ppip = event->GetHMFSParticle(211)->fP; + + double p_mu = FitUtils::p(Pmu) * 1000; + double p_pi = FitUtils::p(Ppip) * 1000; + double cos_th_mu = cos(FitUtils::th(Pnu, Pmu)); + double cos_th_pi = cos(FitUtils::th(Pnu, Ppip)); + + if (p_mu <= 200 || p_pi <= 200 || cos_th_mu <= 0.3 || cos_th_pi <= 0.3) + return false; + + return true; +}; + +// ****************************************************** +// T2K CC1pi+ CH analysis (Raquel's thesis) +// Has different phase space cuts depending on if using Michel tag or not +// +// Essentially consists of two samples: one sample which has Michel e (which we +// can't get pion direction from); this covers backwards angles quite well. +// Measurements including this sample does not have include pion kinematics cuts +// one sample which has PID in FGD and TPC +// and no Michel e. These are mostly +// forward-going so require a pion +// kinematics cut +// +// Essentially, cuts are: +// 1 negative muon +// 1 positive pion +// Any number of nucleons +// No other particles in the final state +// +// MOVE T2K +bool isCC1pip_T2K_CH(FitEvent *event, double EnuMin, double EnuMax, + bool MichelElectron) { + // ****************************************************** + + if (!isCC1pi(event, 14, 211, EnuMin, EnuMax)) return false; + + TLorentzVector Pnu = event->GetHMISParticle(14)->fP; + TLorentzVector Pmu = event->GetHMFSParticle(13)->fP; + TLorentzVector Ppip = event->GetHMFSParticle(211)->fP; + + // If this event passes the criteria on particle counting, enforce the T2K + // ND280 phase space constraints + // Will be different if Michel tag sample is included or not + // Essentially, if there's a Michel tag we don't cut on the pion variables + + double p_mu = FitUtils::p(Pmu) * 1000; + double p_pi = FitUtils::p(Ppip) * 1000; + double cos_th_mu = cos(FitUtils::th(Pnu, Pmu)); + double cos_th_pi = cos(FitUtils::th(Pnu, Ppip)); + + // If we're using Michel e- requirement we only care about the muon restricted + // phase space and use full pion phase space + if (MichelElectron) { + // Make the cuts on the muon variables + if (p_mu <= 200 || cos_th_mu <= 0.2) { + return false; + } else { + return true; + } + + // If we aren't using Michel e- (i.e. we use directional information from + // pion) we need to impose the phase space cuts on the muon AND the pion) + } else { + // Make the cuts on muon and pion variables + if (p_mu <= 200 || p_pi <= 200 || cos_th_mu <= 0.2 || cos_th_pi <= 0.2) { + return false; + } else { + return true; + } + } + + // Default to false; should never fire + return false; +}; + +bool isT2K_CC0pi(FitEvent *event, double EnuMin, double EnuMax, + bool forwardgoing) { + + // Require a numu CC0pi event + if (!isCC0pi(event, 14, EnuMin, EnuMax)) return false; + + TLorentzVector pnu = event->GetHMISParticle(14)->fP; + TLorentzVector pmu = event->GetHMFSParticle(13)->fP; + + double CosThetaMu = pnu.Vect().Angle(pmu.Vect()); + + // restricted phase space + if (forwardgoing and CosThetaMu < 0.0) return false; + return true; +} + + +bool isT2K_CC0pi_STV(FitEvent *event, double EnuMin, double EnuMax) { + + // Require a numu CC0pi event + if (!isCC0pi(event, 14, EnuMin, EnuMax)) return false; + + // Require at least one FS proton + if (event->NumFSParticle(2212) == 0) return false; + + TLorentzVector pnu = event->GetHMISParticle(14)->fP; + TLorentzVector pmu = event->GetHMFSParticle(13)->fP; + TLorentzVector pp = event->GetHMFSParticle(2212)->fP; + + // mu phase space + if ((pmu.Vect().Mag() < 250) || (pnu.Vect().Angle(pmu.Vect()) < -0.6)) + return false; + + // p phase space + if ((pp.Vect().Mag() < 250) || (pp.Vect().Mag() > 1E3) || + (pnu.Vect().Angle(pp.Vect()) < 0.4)) { + return false; + } + return true; +} + +} diff --git a/src/T2K/T2K_SignalDef.h b/src/T2K/T2K_SignalDef.h new file mode 100644 index 0000000..e5f8930 --- /dev/null +++ b/src/T2K/T2K_SignalDef.h @@ -0,0 +1,33 @@ +// Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret + +/******************************************************************************* +* This file is part of NUISANCE. +* +* NUISANCE is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* NUISANCE is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with NUISANCE. If not, see <http://www.gnu.org/licenses/>. +*******************************************************************************/ + +#ifndef T2K_SIGNALDEF_H_SEEN +#define T2K_SIGNALDEF_H_SEEN + +#include "SignalDef.h" + +namespace SignalDef { + bool isCC1pip_T2K_H2O(FitEvent *event, double EnuMin, double EnuMax); + bool isCC1pip_T2K_CH(FitEvent *event, double EnuMin, double EnuMax, bool Michel); + + bool isT2K_CC0pi(FitEvent* event, double EnuMin, double EnuMax, bool forwardgoing); + bool isT2K_CC0pi_STV(FitEvent* event, double EnuMin, double EnuMax); +} + +#endif