nuisance is hosted by Hepforge, IPPP Durham
close Warning: Can't synchronize with repository "(default)" ("(default)" is not readable or not a Git repository.). Look in the Trac log for more information.

Changes between Version 10 and Version 11 of HowToAddSample


Ignore:
Timestamp:
Jan 5, 2017, 3:05:57 PM (8 years ago)
Author:
Clarence Wret
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • HowToAddSample

    v10 v11  
    3333
    3434In NUISANCE we try to add all available distributions from a publication. '''However''', some distributions will have detector effects "folded" into them (i.e. they will be raw detector-level data). We can only use these if there is some method which bring detector-level variables (e.g. p_mu seen in the detector) to truth-level variable (e.g. p_mu seen after correcting for the detector effects).
     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//********************************************************************
     45T2K_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
     69void 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!
     87bool T2K_CC1pip_H2O_XSec_1Dpmu_nu::isSignal(FitEvent *event) {
     88//********************************************************************
     89  return SignalDef::isCC1pip_T2K_H2O(event, EnuMin, EnuMax);
     90}
     91}}}