| 35 | |
| 36 | === Implementing a sample === |
| 37 | |
| 38 | {{{ |
| 39 | #!c |
| 40 | #include "T2K_CC1pip_H2O_XSec_1Dpmu_nu.h" |
| 41 | |
| 42 | // The muon momentum |
| 43 | |
| 44 | //******************************************************************** |
| 45 | T2K_CC1pip_H2O_XSec_1Dpmu_nu::T2K_CC1pip_H2O_XSec_1Dpmu_nu(std::string inputfile, FitWeight *rw, std::string type, std::string fakeDataFile){ |
| 46 | //******************************************************************** |
| 47 | |
| 48 | fName = "T2K_CC1pip_H2O_XSec_1Dpmu_nu"; |
| 49 | fPlotTitles = "; p_{#mu} (GeV/c); d#sigma/dp_{#mu} (cm^{2}/(GeV/c)/nucleon)"; |
| 50 | EnuMin = 0.; |
| 51 | EnuMax = 10.; |
| 52 | Measurement1D::SetupMeasurement(inputfile, type, rw, fakeDataFile); |
| 53 | |
| 54 | // Data comes in ROOT file |
| 55 | // hResultTot is cross-section with all errors |
| 56 | // hResultStat is cross-section with stats-only errors |
| 57 | // hTruthNEUT is the NEUT cross-section given by experimenter |
| 58 | // hTruthGENIE is the GENIE cross-section given by experimenter |
| 59 | SetDataFromFile(GeneralUtils::GetTopLevelDir()+"/data/T2K/CC1pip/H2O/nd280data-numu-cc1pi-xs-on-h2o-2015.root","MuMom/hResultTot"); |
| 60 | SetCovarFromDataFile(GeneralUtils::GetTopLevelDir()+"/data/T2K/CC1pip/H2O/nd280data-numu-cc1pi-xs-on-h2o-2015.root", "MuMom/TotalCovariance", true); |
| 61 | |
| 62 | SetupDefaultHist(); |
| 63 | |
| 64 | fScaleFactor = (fEventHist->Integral("width")*1E-38)/double(fNEvents)/TotalIntegratedFlux("width"); |
| 65 | }; |
| 66 | |
| 67 | //******************************************************************** |
| 68 | // Find the momentum of the muon |
| 69 | void T2K_CC1pip_H2O_XSec_1Dpmu_nu::FillEventVariables(FitEvent *event) { |
| 70 | //******************************************************************** |
| 71 | |
| 72 | // Need to make sure there's a muon |
| 73 | if (event->NumFSParticle(13) == 0) return; |
| 74 | |
| 75 | // Get the muon |
| 76 | TLorentzVector Pmu = event->GetHMFSParticle(13)->fP; |
| 77 | |
| 78 | double p_mu = FitUtils::p(Pmu); |
| 79 | |
| 80 | fXVar = p_mu; |
| 81 | |
| 82 | return; |
| 83 | }; |
| 84 | |
| 85 | //******************************************************************** |
| 86 | // Beware: The H2O analysis has different signal definition to the CH analysis! |
| 87 | bool T2K_CC1pip_H2O_XSec_1Dpmu_nu::isSignal(FitEvent *event) { |
| 88 | //******************************************************************** |
| 89 | return SignalDef::isCC1pip_T2K_H2O(event, EnuMin, EnuMax); |
| 90 | } |
| 91 | }}} |